nemesischart 0.1.20 → 0.1.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- .bg-black{background:#000}.bg-transparent{background:none}.nc-btn-todos[data-v-ead5a9da]{display:inline-flex;align-items:center;gap:.3rem;background:transparent;border:none;box-shadow:none;padding:0;cursor:pointer;font-weight:500;font-family:inherit;font-size:inherit}.nc-btn-todos[data-v-ead5a9da]:focus{outline:none}.nc-card-hover[data-v-ead5a9da]:hover,.nc-card-hover[data-v-8d8f36f0]:hover,.nc-card-hover[data-v-03cd0de7]:hover,.nc-card-hover[data-v-c81361ad]:hover,.nc-card-hover[data-v-bea474a0]:hover,.nc-card-hover[data-v-124dc0bb]:hover{opacity:.92}
1
+ .bg-black{background:#000}.bg-transparent{background:none}.nc-btn-todos[data-v-2f20b7b5]{display:inline-flex;align-items:center;gap:.3rem;background:transparent;border:none;box-shadow:none;padding:0;cursor:pointer;font-weight:500;font-family:inherit;font-size:inherit}.nc-btn-todos[data-v-2f20b7b5]:focus{outline:none}.nc-card-hover[data-v-2f20b7b5]:hover,.nc-card-hover[data-v-8d8f36f0]:hover,.nc-card-hover[data-v-03cd0de7]:hover,.nc-card-hover[data-v-c81361ad]:hover,.nc-card-hover[data-v-bea474a0]:hover,.nc-card-hover[data-v-124dc0bb]:hover{opacity:.92}
@@ -42,7 +42,7 @@ const ee = (i, t) => {
42
42
  n("click");
43
43
  };
44
44
  return (a, l) => (F(), z("div", {
45
- class: U([o.value, "border-round-xl cursor-pointer flex flex-column w-full transition-linear transition-all transition-duration-200 select-none nc-card-hover"]),
45
+ class: U([o.value, "border-round-xl flex flex-column w-full transition-linear transition-all transition-duration-200 select-none nc-card-hover", i.botao_todos ? "cursor-pointer" : ""]),
46
46
  style: { padding: "1.25rem", gap: "1.438rem", border: "1px solid #e5e7eb" },
47
47
  onClick: r
48
48
  }, [
@@ -65,7 +65,7 @@ const ee = (i, t) => {
65
65
  ])], 2)) : mt("", !0)
66
66
  ], 2));
67
67
  }
68
- }, Jn = /* @__PURE__ */ ee(Gn, [["__scopeId", "data-v-ead5a9da"]]);
68
+ }, Jn = /* @__PURE__ */ ee(Gn, [["__scopeId", "data-v-2f20b7b5"]]);
69
69
  function ke(i) {
70
70
  return i + 0.5 | 0;
71
71
  }
@@ -1,3 +1,3 @@
1
- (function(it,u){typeof exports=="object"&&typeof module<"u"?u(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],u):(it=typeof globalThis<"u"?globalThis:it||self,u(it.NemesisChart={},it.Vue))})(this,(function(it,u){"use strict";const zt=(i,t)=>{const e=i.__vccOpts||i;for(const[n,s]of t)e[n]=s;return e},Vs={class:"m-0 text-sm",style:{color:"#7B7B7B","word-break":"break-word"}},Di=zt({__name:"Cards",props:{cor:{type:String,default:"light",validator:i=>["light","dark","transparent"].includes(i)},titulo:{type:String,default:"Card Title"},valor:{type:String,default:"0"},descricao:{type:String,default:"This is a card component."},botao_todos:{type:Boolean,default:!1}},emits:["click"],setup(i,{emit:t}){const e=i,n={light:"bg-white",dark:"bg-black",transparent:"bg-transparent"},s=t,o=u.computed(()=>n[e.cor]??"bg-white"),r=()=>{s("click")};return(a,l)=>(u.openBlock(),u.createElementBlock("div",{class:u.normalizeClass([o.value,"border-round-xl cursor-pointer flex flex-column w-full transition-linear transition-all transition-duration-200 select-none nc-card-hover"]),style:{padding:"1.25rem",gap:"1.438rem",border:"1px solid #e5e7eb"},onClick:r},[u.createElementVNode("p",{class:u.normalizeClass(["m-0 text-xs font-medium",o.value==="bg-black"?"text-white":"text-gray-900"])},u.toDisplayString(i.titulo),3),u.createElementVNode("div",null,[u.createElementVNode("h2",{class:u.normalizeClass(["m-0 text-3xl font-semibold",o.value==="bg-black"?"text-white":"text-gray-900"]),style:{"line-height":"33px","letter-spacing":"-1px"}},u.toDisplayString(i.valor),3),u.createElementVNode("p",Vs,u.toDisplayString(i.descricao),1)]),i.botao_todos?(u.openBlock(),u.createElementBlock("button",{key:0,class:u.normalizeClass(["nc-btn-todos text-xs",o.value==="bg-black"?"text-white":"text-gray-900"])},[...l[0]||(l[0]=[u.createTextVNode(" Ver Todos ",-1),u.createElementVNode("i",{class:"pi pi-angle-right text-xs"},null,-1)])],2)):u.createCommentVNode("",!0)],2))}},[["__scopeId","data-v-ead5a9da"]]);function Xt(i){return i+.5|0}const yt=(i,t,e)=>Math.max(Math.min(i,e),t);function qt(i){return yt(Xt(i*2.55),0,255)}function _t(i){return yt(Xt(i*255),0,255)}function ht(i){return yt(Xt(i/2.55)/100,0,1)}function Pi(i){return yt(Xt(i*100),0,100)}const st={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},$e=[..."0123456789ABCDEF"],Ws=i=>$e[i&15],Hs=i=>$e[(i&240)>>4]+$e[i&15],de=i=>(i&240)>>4===(i&15),js=i=>de(i.r)&&de(i.g)&&de(i.b)&&de(i.a);function $s(i){var t=i.length,e;return i[0]==="#"&&(t===4||t===5?e={r:255&st[i[1]]*17,g:255&st[i[2]]*17,b:255&st[i[3]]*17,a:t===5?st[i[4]]*17:255}:(t===7||t===9)&&(e={r:st[i[1]]<<4|st[i[2]],g:st[i[3]]<<4|st[i[4]],b:st[i[5]]<<4|st[i[6]],a:t===9?st[i[7]]<<4|st[i[8]]:255})),e}const Ys=(i,t)=>i<255?t(i):"";function Us(i){var t=js(i)?Ws:Hs;return i?"#"+t(i.r)+t(i.g)+t(i.b)+Ys(i.a,t):void 0}const Xs=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Ai(i,t,e){const n=t*Math.min(e,1-e),s=(o,r=(o+i/30)%12)=>e-n*Math.max(Math.min(r-3,9-r,1),-1);return[s(0),s(8),s(4)]}function qs(i,t,e){const n=(s,o=(s+i/60)%6)=>e-e*t*Math.max(Math.min(o,4-o,1),0);return[n(5),n(3),n(1)]}function Ks(i,t,e){const n=Ai(i,1,.5);let s;for(t+e>1&&(s=1/(t+e),t*=s,e*=s),s=0;s<3;s++)n[s]*=1-t-e,n[s]+=t;return n}function Gs(i,t,e,n,s){return i===s?(t-e)/n+(t<e?6:0):t===s?(e-i)/n+2:(i-t)/n+4}function Ye(i){const e=i.r/255,n=i.g/255,s=i.b/255,o=Math.max(e,n,s),r=Math.min(e,n,s),a=(o+r)/2;let l,c,h;return o!==r&&(h=o-r,c=a>.5?h/(2-o-r):h/(o+r),l=Gs(e,n,s,h,o),l=l*60+.5),[l|0,c||0,a]}function Ue(i,t,e,n){return(Array.isArray(t)?i(t[0],t[1],t[2]):i(t,e,n)).map(_t)}function Xe(i,t,e){return Ue(Ai,i,t,e)}function Js(i,t,e){return Ue(Ks,i,t,e)}function Qs(i,t,e){return Ue(qs,i,t,e)}function Oi(i){return(i%360+360)%360}function Zs(i){const t=Xs.exec(i);let e=255,n;if(!t)return;t[5]!==n&&(e=t[6]?qt(+t[5]):_t(+t[5]));const s=Oi(+t[2]),o=+t[3]/100,r=+t[4]/100;return t[1]==="hwb"?n=Js(s,o,r):t[1]==="hsv"?n=Qs(s,o,r):n=Xe(s,o,r),{r:n[0],g:n[1],b:n[2],a:e}}function to(i,t){var e=Ye(i);e[0]=Oi(e[0]+t),e=Xe(e),i.r=e[0],i.g=e[1],i.b=e[2]}function eo(i){if(!i)return;const t=Ye(i),e=t[0],n=Pi(t[1]),s=Pi(t[2]);return i.a<255?`hsla(${e}, ${n}%, ${s}%, ${ht(i.a)})`:`hsl(${e}, ${n}%, ${s}%)`}const Ti={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"},Ei={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function io(){const i={},t=Object.keys(Ei),e=Object.keys(Ti);let n,s,o,r,a;for(n=0;n<t.length;n++){for(r=a=t[n],s=0;s<e.length;s++)o=e[s],a=a.replace(o,Ti[o]);o=parseInt(Ei[r],16),i[a]=[o>>16&255,o>>8&255,o&255]}return i}let fe;function no(i){fe||(fe=io(),fe.transparent=[0,0,0,0]);const t=fe[i.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const so=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function oo(i){const t=so.exec(i);let e=255,n,s,o;if(t){if(t[7]!==n){const r=+t[7];e=t[8]?qt(r):yt(r*255,0,255)}return n=+t[1],s=+t[3],o=+t[5],n=255&(t[2]?qt(n):yt(n,0,255)),s=255&(t[4]?qt(s):yt(s,0,255)),o=255&(t[6]?qt(o):yt(o,0,255)),{r:n,g:s,b:o,a:e}}}function ro(i){return i&&(i.a<255?`rgba(${i.r}, ${i.g}, ${i.b}, ${ht(i.a)})`:`rgb(${i.r}, ${i.g}, ${i.b})`)}const qe=i=>i<=.0031308?i*12.92:Math.pow(i,1/2.4)*1.055-.055,It=i=>i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4);function ao(i,t,e){const n=It(ht(i.r)),s=It(ht(i.g)),o=It(ht(i.b));return{r:_t(qe(n+e*(It(ht(t.r))-n))),g:_t(qe(s+e*(It(ht(t.g))-s))),b:_t(qe(o+e*(It(ht(t.b))-o))),a:i.a+e*(t.a-i.a)}}function ue(i,t,e){if(i){let n=Ye(i);n[t]=Math.max(0,Math.min(n[t]+n[t]*e,t===0?360:1)),n=Xe(n),i.r=n[0],i.g=n[1],i.b=n[2]}}function Ri(i,t){return i&&Object.assign(t||{},i)}function Li(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=_t(i[3]))):(t=Ri(i,{r:0,g:0,b:0,a:1}),t.a=_t(t.a)),t}function lo(i){return i.charAt(0)==="r"?oo(i):Zs(i)}class Kt{constructor(t){if(t instanceof Kt)return t;const e=typeof t;let n;e==="object"?n=Li(t):e==="string"&&(n=$s(t)||no(t)||lo(t)),this._rgb=n,this._valid=!!n}get valid(){return this._valid}get rgb(){var t=Ri(this._rgb);return t&&(t.a=ht(t.a)),t}set rgb(t){this._rgb=Li(t)}rgbString(){return this._valid?ro(this._rgb):void 0}hexString(){return this._valid?Us(this._rgb):void 0}hslString(){return this._valid?eo(this._rgb):void 0}mix(t,e){if(t){const n=this.rgb,s=t.rgb;let o;const r=e===o?.5:e,a=2*r-1,l=n.a-s.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;o=1-c,n.r=255&c*n.r+o*s.r+.5,n.g=255&c*n.g+o*s.g+.5,n.b=255&c*n.b+o*s.b+.5,n.a=r*n.a+(1-r)*s.a,this.rgb=n}return this}interpolate(t,e){return t&&(this._rgb=ao(this._rgb,t._rgb,e)),this}clone(){return new Kt(this.rgb)}alpha(t){return this._rgb.a=_t(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=Xt(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){const e=this._rgb;return e.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return ue(this._rgb,2,t),this}darken(t){return ue(this._rgb,2,-t),this}saturate(t){return ue(this._rgb,1,t),this}desaturate(t){return ue(this._rgb,1,-t),this}rotate(t){return to(this._rgb,t),this}}function dt(){}const co=(()=>{let i=0;return()=>i++})();function z(i){return i==null}function j(i){if(Array.isArray&&Array.isArray(i))return!0;const t=Object.prototype.toString.call(i);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function R(i){return i!==null&&Object.prototype.toString.call(i)==="[object Object]"}function X(i){return(typeof i=="number"||i instanceof Number)&&isFinite(+i)}function at(i,t){return X(i)?i:t}function T(i,t){return typeof i>"u"?t:i}const ho=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100:+i/t,Bi=(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 I(i,t,e,n){let s,o,r;if(j(i))for(o=i.length,s=0;s<o;s++)t.call(e,i[s],s);else if(R(i))for(r=Object.keys(i),o=r.length,s=0;s<o;s++)t.call(e,i[r[s]],r[s])}function ge(i,t){let e,n,s,o;if(!i||!t||i.length!==t.length)return!1;for(e=0,n=i.length;e<n;++e)if(s=i[e],o=t[e],s.datasetIndex!==o.datasetIndex||s.index!==o.index)return!1;return!0}function pe(i){if(j(i))return i.map(pe);if(R(i)){const t=Object.create(null),e=Object.keys(i),n=e.length;let s=0;for(;s<n;++s)t[e[s]]=pe(i[e[s]]);return t}return i}function zi(i){return["__proto__","prototype","constructor"].indexOf(i)===-1}function fo(i,t,e,n){if(!zi(i))return;const s=t[i],o=e[i];R(s)&&R(o)?Gt(s,o,n):t[i]=pe(o)}function Gt(i,t,e){const n=j(t)?t:[t],s=n.length;if(!R(i))return i;e=e||{};const o=e.merger||fo;let r;for(let a=0;a<s;++a){if(r=n[a],!R(r))continue;const l=Object.keys(r);for(let c=0,h=l.length;c<h;++c)o(l[c],i,r,e)}return i}function Jt(i,t){return Gt(i,t,{merger:uo})}function uo(i,t,e){if(!zi(i))return;const n=t[i],s=e[i];R(n)&&R(s)?Jt(n,s):Object.prototype.hasOwnProperty.call(t,i)||(t[i]=pe(s))}const Ii={"":i=>i,x:i=>i.x,y:i=>i.y};function go(i){const t=i.split("."),e=[];let n="";for(const s of t)n+=s,n.endsWith("\\")?n=n.slice(0,-1)+".":(e.push(n),n="");return e}function po(i){const t=go(i);return e=>{for(const n of t){if(n==="")break;e=e&&e[n]}return e}}function Ft(i,t){return(Ii[t]||(Ii[t]=po(t)))(i)}function Ke(i){return i.charAt(0).toUpperCase()+i.slice(1)}const me=i=>typeof i<"u",kt=i=>typeof i=="function",Fi=(i,t)=>{if(i.size!==t.size)return!1;for(const e of i)if(!t.has(e))return!1;return!0};function mo(i){return i.type==="mouseup"||i.type==="click"||i.type==="contextmenu"}const B=Math.PI,W=2*B,bo=W+B,be=Number.POSITIVE_INFINITY,xo=B/180,Y=B/2,vt=B/4,Ni=B*2/3,Vi=Math.log10,Nt=Math.sign;function Qt(i,t,e){return Math.abs(i-t)<e}function Wi(i){const t=Math.round(i);i=Qt(i,t,i/1e3)?t:i;const e=Math.pow(10,Math.floor(Vi(i))),n=i/e;return(n<=1?1:n<=2?2:n<=5?5:10)*e}function yo(i){const t=[],e=Math.sqrt(i);let n;for(n=1;n<e;n++)i%n===0&&(t.push(n),t.push(i/n));return e===(e|0)&&t.push(e),t.sort((s,o)=>s-o).pop(),t}function _o(i){return typeof i=="symbol"||typeof i=="object"&&i!==null&&!(Symbol.toPrimitive in i||"toString"in i||"valueOf"in i)}function Zt(i){return!_o(i)&&!isNaN(parseFloat(i))&&isFinite(i)}function ko(i,t){const e=Math.round(i);return e-t<=i&&e+t>=i}function wo(i,t,e){let n,s,o;for(n=0,s=i.length;n<s;n++)o=i[n][e],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function rt(i){return i*(B/180)}function Ge(i){return i*(180/B)}function Hi(i){if(!X(i))return;let t=1,e=0;for(;Math.round(i*t)/t!==i;)t*=10,e++;return e}function ji(i,t){const e=t.x-i.x,n=t.y-i.y,s=Math.sqrt(e*e+n*n);let o=Math.atan2(n,e);return o<-.5*B&&(o+=W),{angle:o,distance:s}}function Je(i,t){return Math.sqrt(Math.pow(t.x-i.x,2)+Math.pow(t.y-i.y,2))}function So(i,t){return(i-t+bo)%W-B}function G(i){return(i%W+W)%W}function te(i,t,e,n){const s=G(i),o=G(t),r=G(e),a=G(o-s),l=G(r-s),c=G(s-o),h=G(s-r);return s===o||s===r||n&&o===r||a>l&&c<h}function J(i,t,e){return Math.max(t,Math.min(e,i))}function Mo(i){return J(i,-32768,32767)}function Ct(i,t,e,n=1e-6){return i>=Math.min(t,e)-n&&i<=Math.max(t,e)+n}function Qe(i,t,e){e=e||(r=>i[r]<t);let n=i.length-1,s=0,o;for(;n-s>1;)o=s+n>>1,e(o)?s=o:n=o;return{lo:s,hi:n}}const Dt=(i,t,e,n)=>Qe(i,e,n?s=>{const o=i[s][t];return o<e||o===e&&i[s+1][t]===e}:s=>i[s][t]<e),vo=(i,t,e)=>Qe(i,e,n=>i[n][t]>=e);function Co(i,t,e){let n=0,s=i.length;for(;n<s&&i[n]<t;)n++;for(;s>n&&i[s-1]>e;)s--;return n>0||s<i.length?i.slice(n,s):i}const $i=["push","pop","shift","splice","unshift"];function Do(i,t){if(i._chartjs){i._chartjs.listeners.push(t);return}Object.defineProperty(i,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),$i.forEach(e=>{const n="_onData"+Ke(e),s=i[e];Object.defineProperty(i,e,{configurable:!0,enumerable:!1,value(...o){const r=s.apply(this,o);return i._chartjs.listeners.forEach(a=>{typeof a[n]=="function"&&a[n](...o)}),r}})})}function Yi(i,t){const e=i._chartjs;if(!e)return;const n=e.listeners,s=n.indexOf(t);s!==-1&&n.splice(s,1),!(n.length>0)&&($i.forEach(o=>{delete i[o]}),delete i._chartjs)}function Po(i){const t=new Set(i);return t.size===i.length?i:Array.from(t)}const Ui=(function(){return typeof window>"u"?function(i){return i()}:window.requestAnimationFrame})();function Xi(i,t){let e=[],n=!1;return function(...s){e=s,n||(n=!0,Ui.call(window,()=>{n=!1,i.apply(t,e)}))}}function Ao(i,t){let e;return function(...n){return t?(clearTimeout(e),e=setTimeout(i,t,n)):i.apply(this,n),t}}const qi=i=>i==="start"?"left":i==="end"?"right":"center",nt=(i,t,e)=>i==="start"?t:i==="end"?e:(t+e)/2,Oo=(i,t,e,n)=>i===(n?"left":"right")?e:i==="center"?(t+e)/2:t;function To(i,t,e){const n=t.length;let s=0,o=n;if(i._sorted){const{iScale:r,vScale:a,_parsed:l}=i,c=i.dataset&&i.dataset.options?i.dataset.options.spanGaps:null,h=r.axis,{min:d,max:f,minDefined:g,maxDefined:p}=r.getUserBounds();if(g){if(s=Math.min(Dt(l,h,d).lo,e?n:Dt(t,h,r.getPixelForValue(d)).lo),c){const b=l.slice(0,s+1).reverse().findIndex(m=>!z(m[a.axis]));s-=Math.max(0,b)}s=J(s,0,n-1)}if(p){let b=Math.max(Dt(l,r.axis,f,!0).hi+1,e?0:Dt(t,h,r.getPixelForValue(f),!0).hi+1);if(c){const m=l.slice(b-1).findIndex(x=>!z(x[a.axis]));b+=Math.max(0,m)}o=J(b,s,n)-s}else o=n-s}return{start:s,count:o}}function Eo(i){const{xScale:t,yScale:e,_scaleRanges:n}=i,s={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!n)return i._scaleRanges=s,!0;const o=n.xmin!==t.min||n.xmax!==t.max||n.ymin!==e.min||n.ymax!==e.max;return Object.assign(n,s),o}const xe=i=>i===0||i===1,Ki=(i,t,e)=>-(Math.pow(2,10*(i-=1))*Math.sin((i-t)*W/e)),Gi=(i,t,e)=>Math.pow(2,-10*i)*Math.sin((i-t)*W/e)+1,ee={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=>-Math.cos(i*Y)+1,easeOutSine:i=>Math.sin(i*Y),easeInOutSine:i=>-.5*(Math.cos(B*i)-1),easeInExpo:i=>i===0?0:Math.pow(2,10*(i-1)),easeOutExpo:i=>i===1?1:-Math.pow(2,-10*i)+1,easeInOutExpo:i=>xe(i)?i:i<.5?.5*Math.pow(2,10*(i*2-1)):.5*(-Math.pow(2,-10*(i*2-1))+2),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:Ki(i,.075,.3),easeOutElastic:i=>xe(i)?i:Gi(i,.075,.3),easeInOutElastic(i){return xe(i)?i:i<.5?.5*Ki(i*2,.1125,.45):.5+.5*Gi(i*2-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?.5*(i*i*(((t*=1.525)+1)*i-t)):.5*((i-=2)*i*(((t*=1.525)+1)*i+t)+2)},easeInBounce:i=>1-ee.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?ee.easeInBounce(i*2)*.5:ee.easeOutBounce(i*2-1)*.5+.5};function Ze(i){if(i&&typeof i=="object"){const t=i.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Ji(i){return Ze(i)?i:new Kt(i)}function ti(i){return Ze(i)?i:new Kt(i).saturate(.5).darken(.1).hexString()}const Ro=["x","y","borderWidth","radius","tension"],Lo=["color","borderColor","backgroundColor"];function Bo(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:Lo},numbers:{type:"number",properties:Ro}}),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=>t|0}}}})}function zo(i){i.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Qi=new Map;function Io(i,t){t=t||{};const e=i+JSON.stringify(t);let n=Qi.get(e);return n||(n=new Intl.NumberFormat(i,t),Qi.set(e,n)),n}function ye(i,t,e){return Io(t,e).format(i)}const Fo={values(i){return j(i)?i:""+i},numeric(i,t,e){if(i===0)return"0";const n=this.chart.options.locale;let s,o=i;if(e.length>1){const c=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),o=No(i,e)}const r=Vi(Math.abs(o)),a=isNaN(r)?1:Math.max(Math.min(-1*Math.floor(r),20),0),l={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),ye(i,n,l)}};function No(i,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&i!==Math.floor(i)&&(e=i-Math.floor(i)),e}var ei={formatters:Fo};function Vo(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:ei.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"})}const Pt=Object.create(null),ii=Object.create(null);function ie(i,t){if(!t)return i;const e=t.split(".");for(let n=0,s=e.length;n<s;++n){const o=e[n];i=i[o]||(i[o]=Object.create(null))}return i}function ni(i,t,e){return typeof t=="string"?Gt(ie(i,t),e):Gt(ie(i,""),t)}class Wo{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=n=>n.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=(n,s)=>ti(s.backgroundColor),this.hoverBorderColor=(n,s)=>ti(s.borderColor),this.hoverColor=(n,s)=>ti(s.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 ni(this,t,e)}get(t){return ie(this,t)}describe(t,e){return ni(ii,t,e)}override(t,e){return ni(Pt,t,e)}route(t,e,n,s){const o=ie(this,t),r=ie(this,n),a="_"+e;Object.defineProperties(o,{[a]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[a],c=r[s];return R(l)?Object.assign({},c,l):T(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(e=>e(this))}}var $=new Wo({_scriptable:i=>!i.startsWith("on"),_indexable:i=>i!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Bo,zo,Vo]);function Ho(i){return!i||z(i.size)||z(i.family)?null:(i.style?i.style+" ":"")+(i.weight?i.weight+" ":"")+i.size+"px "+i.family}function _e(i,t,e,n,s){let o=t[s];return o||(o=t[s]=i.measureText(s).width,e.push(s)),o>n&&(n=o),n}function jo(i,t,e,n){n=n||{};let s=n.data=n.data||{},o=n.garbageCollect=n.garbageCollect||[];n.font!==t&&(s=n.data={},o=n.garbageCollect=[],n.font=t),i.save(),i.font=t;let r=0;const a=e.length;let l,c,h,d,f;for(l=0;l<a;l++)if(d=e[l],d!=null&&!j(d))r=_e(i,s,o,r,d);else if(j(d))for(c=0,h=d.length;c<h;c++)f=d[c],f!=null&&!j(f)&&(r=_e(i,s,o,r,f));i.restore();const g=o.length/2;if(g>e.length){for(l=0;l<g;l++)delete s[o[l]];o.splice(0,g)}return r}function At(i,t,e){const n=i.currentDevicePixelRatio,s=e!==0?Math.max(e/2,.5):0;return Math.round((t-s)*n)/n+s}function Zi(i,t){!t&&!i||(t=t||i.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,i.width,i.height),t.restore())}function si(i,t,e,n){tn(i,t,e,n,null)}function tn(i,t,e,n,s){let o,r,a,l,c,h,d,f;const g=t.pointStyle,p=t.rotation,b=t.radius;let m=(p||0)*xo;if(g&&typeof g=="object"&&(o=g.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){i.save(),i.translate(e,n),i.rotate(m),i.drawImage(g,-g.width/2,-g.height/2,g.width,g.height),i.restore();return}if(!(isNaN(b)||b<=0)){switch(i.beginPath(),g){default:s?i.ellipse(e,n,s/2,b,0,0,W):i.arc(e,n,b,0,W),i.closePath();break;case"triangle":h=s?s/2:b,i.moveTo(e+Math.sin(m)*h,n-Math.cos(m)*b),m+=Ni,i.lineTo(e+Math.sin(m)*h,n-Math.cos(m)*b),m+=Ni,i.lineTo(e+Math.sin(m)*h,n-Math.cos(m)*b),i.closePath();break;case"rectRounded":c=b*.516,l=b-c,r=Math.cos(m+vt)*l,d=Math.cos(m+vt)*(s?s/2-c:l),a=Math.sin(m+vt)*l,f=Math.sin(m+vt)*(s?s/2-c:l),i.arc(e-d,n-a,c,m-B,m-Y),i.arc(e+f,n-r,c,m-Y,m),i.arc(e+d,n+a,c,m,m+Y),i.arc(e-f,n+r,c,m+Y,m+B),i.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*b,h=s?s/2:l,i.rect(e-h,n-l,2*h,2*l);break}m+=vt;case"rectRot":d=Math.cos(m)*(s?s/2:b),r=Math.cos(m)*b,a=Math.sin(m)*b,f=Math.sin(m)*(s?s/2:b),i.moveTo(e-d,n-a),i.lineTo(e+f,n-r),i.lineTo(e+d,n+a),i.lineTo(e-f,n+r),i.closePath();break;case"crossRot":m+=vt;case"cross":d=Math.cos(m)*(s?s/2:b),r=Math.cos(m)*b,a=Math.sin(m)*b,f=Math.sin(m)*(s?s/2:b),i.moveTo(e-d,n-a),i.lineTo(e+d,n+a),i.moveTo(e+f,n-r),i.lineTo(e-f,n+r);break;case"star":d=Math.cos(m)*(s?s/2:b),r=Math.cos(m)*b,a=Math.sin(m)*b,f=Math.sin(m)*(s?s/2:b),i.moveTo(e-d,n-a),i.lineTo(e+d,n+a),i.moveTo(e+f,n-r),i.lineTo(e-f,n+r),m+=vt,d=Math.cos(m)*(s?s/2:b),r=Math.cos(m)*b,a=Math.sin(m)*b,f=Math.sin(m)*(s?s/2:b),i.moveTo(e-d,n-a),i.lineTo(e+d,n+a),i.moveTo(e+f,n-r),i.lineTo(e-f,n+r);break;case"line":r=s?s/2:Math.cos(m)*b,a=Math.sin(m)*b,i.moveTo(e-r,n-a),i.lineTo(e+r,n+a);break;case"dash":i.moveTo(e,n),i.lineTo(e+Math.cos(m)*(s?s/2:b),n+Math.sin(m)*b);break;case!1:i.closePath();break}i.fill(),t.borderWidth>0&&i.stroke()}}function ft(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 ke(i,t){i.save(),i.beginPath(),i.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),i.clip()}function we(i){i.restore()}function $o(i,t,e,n,s){if(!t)return i.lineTo(e.x,e.y);if(s==="middle"){const o=(t.x+e.x)/2;i.lineTo(o,t.y),i.lineTo(o,e.y)}else s==="after"!=!!n?i.lineTo(t.x,e.y):i.lineTo(e.x,t.y);i.lineTo(e.x,e.y)}function Yo(i,t,e,n){if(!t)return i.lineTo(e.x,e.y);i.bezierCurveTo(n?t.cp1x:t.cp2x,n?t.cp1y:t.cp2y,n?e.cp2x:e.cp1x,n?e.cp2y:e.cp1y,e.x,e.y)}function Uo(i,t){t.translation&&i.translate(t.translation[0],t.translation[1]),z(t.rotation)||i.rotate(t.rotation),t.color&&(i.fillStyle=t.color),t.textAlign&&(i.textAlign=t.textAlign),t.textBaseline&&(i.textBaseline=t.textBaseline)}function Xo(i,t,e,n,s){if(s.strikethrough||s.underline){const o=i.measureText(n),r=t-o.actualBoundingBoxLeft,a=t+o.actualBoundingBoxRight,l=e-o.actualBoundingBoxAscent,c=e+o.actualBoundingBoxDescent,h=s.strikethrough?(l+c)/2:c;i.strokeStyle=i.fillStyle,i.beginPath(),i.lineWidth=s.decorationWidth||2,i.moveTo(r,h),i.lineTo(a,h),i.stroke()}}function qo(i,t){const e=i.fillStyle;i.fillStyle=t.color,i.fillRect(t.left,t.top,t.width,t.height),i.fillStyle=e}function Vt(i,t,e,n,s,o={}){const r=j(t)?t:[t],a=o.strokeWidth>0&&o.strokeColor!=="";let l,c;for(i.save(),i.font=s.string,Uo(i,o),l=0;l<r.length;++l)c=r[l],o.backdrop&&qo(i,o.backdrop),a&&(o.strokeColor&&(i.strokeStyle=o.strokeColor),z(o.strokeWidth)||(i.lineWidth=o.strokeWidth),i.strokeText(c,e,n,o.maxWidth)),i.fillText(c,e,n,o.maxWidth),Xo(i,e,n,c,o),n+=Number(s.lineHeight);i.restore()}function Se(i,t){const{x:e,y:n,w:s,h:o,radius:r}=t;i.arc(e+r.topLeft,n+r.topLeft,r.topLeft,1.5*B,B,!0),i.lineTo(e,n+o-r.bottomLeft),i.arc(e+r.bottomLeft,n+o-r.bottomLeft,r.bottomLeft,B,Y,!0),i.lineTo(e+s-r.bottomRight,n+o),i.arc(e+s-r.bottomRight,n+o-r.bottomRight,r.bottomRight,Y,0,!0),i.lineTo(e+s,n+r.topRight),i.arc(e+s-r.topRight,n+r.topRight,r.topRight,0,-Y,!0),i.lineTo(e+r.topLeft,n)}const Ko=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Go=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Jo(i,t){const e=(""+i).match(Ko);if(!e||e[1]==="normal")return t*1.2;switch(i=+e[2],e[3]){case"px":return i;case"%":i/=100;break}return t*i}const Qo=i=>+i||0;function oi(i,t){const e={},n=R(t),s=n?Object.keys(t):t,o=R(i)?n?r=>T(i[r],i[t[r]]):r=>i[r]:()=>i;for(const r of s)e[r]=Qo(o(r));return e}function Zo(i){return oi(i,{top:"y",right:"x",bottom:"y",left:"x"})}function Wt(i){return oi(i,["topLeft","topRight","bottomLeft","bottomRight"])}function Q(i){const t=Zo(i);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function q(i,t){i=i||{},t=t||$.font;let e=T(i.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let n=T(i.style,t.style);n&&!(""+n).match(Go)&&(console.warn('Invalid font style specified: "'+n+'"'),n=void 0);const s={family:T(i.family,t.family),lineHeight:Jo(T(i.lineHeight,t.lineHeight),e),size:e,style:n,weight:T(i.weight,t.weight),string:""};return s.string=Ho(s),s}function Me(i,t,e,n){let s,o,r;for(s=0,o=i.length;s<o;++s)if(r=i[s],r!==void 0&&r!==void 0)return r}function tr(i,t,e){const{min:n,max:s}=i,o=Bi(t,(s-n)/2),r=(a,l)=>e&&a===0?0:a+l;return{min:r(n,-Math.abs(o)),max:r(s,o)}}function wt(i,t){return Object.assign(Object.create(i),t)}function ri(i,t=[""],e,n,s=()=>i[0]){const o=e||i;typeof n>"u"&&(n=rn("_fallback",i));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:i,_rootScopes:o,_fallback:n,_getTarget:s,override:a=>ri([a,...i],t,o,n)};return new Proxy(r,{deleteProperty(a,l){return delete a[l],delete a._keys,delete i[0][l],!0},get(a,l){return nn(a,l,()=>lr(l,t,i,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(i[0])},has(a,l){return an(a).includes(l)},ownKeys(a){return an(a)},set(a,l,c){const h=a._storage||(a._storage=s());return a[l]=h[l]=c,delete a._keys,!0}})}function Ht(i,t,e,n){const s={_cacheable:!1,_proxy:i,_context:t,_subProxy:e,_stack:new Set,_descriptors:en(i,n),setContext:o=>Ht(i,o,e,n),override:o=>Ht(i.override(o),t,e,n)};return new Proxy(s,{deleteProperty(o,r){return delete o[r],delete i[r],!0},get(o,r,a){return nn(o,r,()=>ir(o,r,a))},getOwnPropertyDescriptor(o,r){return o._descriptors.allKeys?Reflect.has(i,r)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(i,r)},getPrototypeOf(){return Reflect.getPrototypeOf(i)},has(o,r){return Reflect.has(i,r)},ownKeys(){return Reflect.ownKeys(i)},set(o,r,a){return i[r]=a,delete o[r],!0}})}function en(i,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:n=t.indexable,_allKeys:s=t.allKeys}=i;return{allKeys:s,scriptable:e,indexable:n,isScriptable:kt(e)?e:()=>e,isIndexable:kt(n)?n:()=>n}}const er=(i,t)=>i?i+Ke(t):t,ai=(i,t)=>R(t)&&i!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function nn(i,t,e){if(Object.prototype.hasOwnProperty.call(i,t)||t==="constructor")return i[t];const n=e();return i[t]=n,n}function ir(i,t,e){const{_proxy:n,_context:s,_subProxy:o,_descriptors:r}=i;let a=n[t];return kt(a)&&r.isScriptable(t)&&(a=nr(t,a,i,e)),j(a)&&a.length&&(a=sr(t,a,i,r.isIndexable)),ai(t,a)&&(a=Ht(a,s,o&&o[t],r)),a}function nr(i,t,e,n){const{_proxy:s,_context:o,_subProxy:r,_stack:a}=e;if(a.has(i))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+i);a.add(i);let l=t(o,r||n);return a.delete(i),ai(i,l)&&(l=li(s._scopes,s,i,l)),l}function sr(i,t,e,n){const{_proxy:s,_context:o,_subProxy:r,_descriptors:a}=e;if(typeof o.index<"u"&&n(i))return t[o.index%t.length];if(R(t[0])){const l=t,c=s._scopes.filter(h=>h!==l);t=[];for(const h of l){const d=li(c,s,i,h);t.push(Ht(d,o,r&&r[i],a))}}return t}function sn(i,t,e){return kt(i)?i(t,e):i}const or=(i,t)=>i===!0?t:typeof i=="string"?Ft(t,i):void 0;function rr(i,t,e,n,s){for(const o of t){const r=or(e,o);if(r){i.add(r);const a=sn(r._fallback,e,s);if(typeof a<"u"&&a!==e&&a!==n)return a}else if(r===!1&&typeof n<"u"&&e!==n)return null}return!1}function li(i,t,e,n){const s=t._rootScopes,o=sn(t._fallback,e,n),r=[...i,...s],a=new Set;a.add(n);let l=on(a,r,e,o||e,n);return l===null||typeof o<"u"&&o!==e&&(l=on(a,r,o,l,n),l===null)?!1:ri(Array.from(a),[""],s,o,()=>ar(t,e,n))}function on(i,t,e,n,s){for(;e;)e=rr(i,t,e,n,s);return e}function ar(i,t,e){const n=i._getTarget();t in n||(n[t]={});const s=n[t];return j(s)&&R(e)?e:s||{}}function lr(i,t,e,n){let s;for(const o of t)if(s=rn(er(o,i),e),typeof s<"u")return ai(i,s)?li(e,n,i,s):s}function rn(i,t){for(const e of t){if(!e)continue;const n=e[i];if(typeof n<"u")return n}}function an(i){let t=i._keys;return t||(t=i._keys=cr(i._scopes)),t}function cr(i){const t=new Set;for(const e of i)for(const n of Object.keys(e).filter(s=>!s.startsWith("_")))t.add(n);return Array.from(t)}function hr(i,t,e,n){const{iScale:s}=i,{key:o="r"}=this._parsing,r=new Array(n);let a,l,c,h;for(a=0,l=n;a<l;++a)c=a+e,h=t[c],r[a]={r:s.parse(Ft(h,o),c)};return r}const dr=Number.EPSILON||1e-14,jt=(i,t)=>t<i.length&&!i[t].skip&&i[t],ln=i=>i==="x"?"y":"x";function fr(i,t,e,n){const s=i.skip?t:i,o=t,r=e.skip?t:e,a=Je(o,s),l=Je(r,o);let c=a/(a+l),h=l/(a+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const d=n*c,f=n*h;return{previous:{x:o.x-d*(r.x-s.x),y:o.y-d*(r.y-s.y)},next:{x:o.x+f*(r.x-s.x),y:o.y+f*(r.y-s.y)}}}function ur(i,t,e){const n=i.length;let s,o,r,a,l,c=jt(i,0);for(let h=0;h<n-1;++h)if(l=c,c=jt(i,h+1),!(!l||!c)){if(Qt(t[h],0,dr)){e[h]=e[h+1]=0;continue}s=e[h]/t[h],o=e[h+1]/t[h],a=Math.pow(s,2)+Math.pow(o,2),!(a<=9)&&(r=3/Math.sqrt(a),e[h]=s*r*t[h],e[h+1]=o*r*t[h])}}function gr(i,t,e="x"){const n=ln(e),s=i.length;let o,r,a,l=jt(i,0);for(let c=0;c<s;++c){if(r=a,a=l,l=jt(i,c+1),!a)continue;const h=a[e],d=a[n];r&&(o=(h-r[e])/3,a[`cp1${e}`]=h-o,a[`cp1${n}`]=d-o*t[c]),l&&(o=(l[e]-h)/3,a[`cp2${e}`]=h+o,a[`cp2${n}`]=d+o*t[c])}}function pr(i,t="x"){const e=ln(t),n=i.length,s=Array(n).fill(0),o=Array(n);let r,a,l,c=jt(i,0);for(r=0;r<n;++r)if(a=l,l=c,c=jt(i,r+1),!!l){if(c){const h=c[t]-l[t];s[r]=h!==0?(c[e]-l[e])/h:0}o[r]=a?c?Nt(s[r-1])!==Nt(s[r])?0:(s[r-1]+s[r])/2:s[r-1]:s[r]}ur(i,s,o),gr(i,o,t)}function ve(i,t,e){return Math.max(Math.min(i,e),t)}function mr(i,t){let e,n,s,o,r,a=ft(i[0],t);for(e=0,n=i.length;e<n;++e)r=o,o=a,a=e<n-1&&ft(i[e+1],t),o&&(s=i[e],r&&(s.cp1x=ve(s.cp1x,t.left,t.right),s.cp1y=ve(s.cp1y,t.top,t.bottom)),a&&(s.cp2x=ve(s.cp2x,t.left,t.right),s.cp2y=ve(s.cp2y,t.top,t.bottom)))}function br(i,t,e,n,s){let o,r,a,l;if(t.spanGaps&&(i=i.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")pr(i,s);else{let c=n?i[i.length-1]:i[0];for(o=0,r=i.length;o<r;++o)a=i[o],l=fr(c,a,i[Math.min(o+1,r-(n?0:1))%r],t.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,c=a}t.capBezierPoints&&mr(i,e)}function ci(){return typeof window<"u"&&typeof document<"u"}function hi(i){let t=i.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Ce(i,t,e){let n;return typeof i=="string"?(n=parseInt(i,10),i.indexOf("%")!==-1&&(n=n/100*t.parentNode[e])):n=i,n}const De=i=>i.ownerDocument.defaultView.getComputedStyle(i,null);function xr(i,t){return De(i).getPropertyValue(t)}const yr=["top","right","bottom","left"];function Ot(i,t,e){const n={};e=e?"-"+e:"";for(let s=0;s<4;s++){const o=yr[s];n[o]=parseFloat(i[t+"-"+o+e])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}const _r=(i,t,e)=>(i>0||t>0)&&(!e||!e.shadowRoot);function kr(i,t){const e=i.touches,n=e&&e.length?e[0]:i,{offsetX:s,offsetY:o}=n;let r=!1,a,l;if(_r(s,o,i.target))a=s,l=o;else{const c=t.getBoundingClientRect();a=n.clientX-c.left,l=n.clientY-c.top,r=!0}return{x:a,y:l,box:r}}function Tt(i,t){if("native"in i)return i;const{canvas:e,currentDevicePixelRatio:n}=t,s=De(e),o=s.boxSizing==="border-box",r=Ot(s,"padding"),a=Ot(s,"border","width"),{x:l,y:c,box:h}=kr(i,e),d=r.left+(h&&a.left),f=r.top+(h&&a.top);let{width:g,height:p}=t;return o&&(g-=r.width+a.width,p-=r.height+a.height),{x:Math.round((l-d)/g*e.width/n),y:Math.round((c-f)/p*e.height/n)}}function wr(i,t,e){let n,s;if(t===void 0||e===void 0){const o=i&&hi(i);if(!o)t=i.clientWidth,e=i.clientHeight;else{const r=o.getBoundingClientRect(),a=De(o),l=Ot(a,"border","width"),c=Ot(a,"padding");t=r.width-c.width-l.width,e=r.height-c.height-l.height,n=Ce(a.maxWidth,o,"clientWidth"),s=Ce(a.maxHeight,o,"clientHeight")}}return{width:t,height:e,maxWidth:n||be,maxHeight:s||be}}const St=i=>Math.round(i*10)/10;function Sr(i,t,e,n){const s=De(i),o=Ot(s,"margin"),r=Ce(s.maxWidth,i,"clientWidth")||be,a=Ce(s.maxHeight,i,"clientHeight")||be,l=wr(i,t,e);let{width:c,height:h}=l;if(s.boxSizing==="content-box"){const f=Ot(s,"border","width"),g=Ot(s,"padding");c-=g.width+f.width,h-=g.height+f.height}return c=Math.max(0,c-o.width),h=Math.max(0,n?c/n:h-o.height),c=St(Math.min(c,r,l.maxWidth)),h=St(Math.min(h,a,l.maxHeight)),c&&!h&&(h=St(c/2)),(t!==void 0||e!==void 0)&&n&&l.height&&h>l.height&&(h=l.height,c=St(Math.floor(h*n))),{width:c,height:h}}function cn(i,t,e){const n=t||1,s=St(i.height*n),o=St(i.width*n);i.height=St(i.height),i.width=St(i.width);const r=i.canvas;return r.style&&(e||!r.style.height&&!r.style.width)&&(r.style.height=`${i.height}px`,r.style.width=`${i.width}px`),i.currentDevicePixelRatio!==n||r.height!==s||r.width!==o?(i.currentDevicePixelRatio=n,r.height=s,r.width=o,i.ctx.setTransform(n,0,0,n,0,0),!0):!1}const Mr=(function(){let i=!1;try{const t={get passive(){return i=!0,!1}};ci()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return i})();function hn(i,t){const e=xr(i,t),n=e&&e.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function Et(i,t,e,n){return{x:i.x+e*(t.x-i.x),y:i.y+e*(t.y-i.y)}}function vr(i,t,e,n){return{x:i.x+e*(t.x-i.x),y:n==="middle"?e<.5?i.y:t.y:n==="after"?e<1?i.y:t.y:e>0?t.y:i.y}}function Cr(i,t,e,n){const s={x:i.cp2x,y:i.cp2y},o={x:t.cp1x,y:t.cp1y},r=Et(i,s,e),a=Et(s,o,e),l=Et(o,t,e),c=Et(r,a,e),h=Et(a,l,e);return Et(c,h,e)}const Dr=function(i,t){return{x(e){return i+i+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,n){return e-n},leftForLtr(e,n){return e-n}}},Pr=function(){return{x(i){return i},setWidth(i){},textAlign(i){return i},xPlus(i,t){return i+t},leftForLtr(i,t){return i}}};function $t(i,t,e){return i?Dr(t,e):Pr()}function dn(i,t){let e,n;(t==="ltr"||t==="rtl")&&(e=i.canvas.style,n=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),i.prevTextDirection=n)}function fn(i,t){t!==void 0&&(delete i.prevTextDirection,i.canvas.style.setProperty("direction",t[0],t[1]))}function un(i){return i==="angle"?{between:te,compare:So,normalize:G}:{between:Ct,compare:(t,e)=>t-e,normalize:t=>t}}function gn({start:i,end:t,count:e,loop:n,style:s}){return{start:i%e,end:t%e,loop:n&&(t-i+1)%e===0,style:s}}function Ar(i,t,e){const{property:n,start:s,end:o}=e,{between:r,normalize:a}=un(n),l=t.length;let{start:c,end:h,loop:d}=i,f,g;if(d){for(c+=l,h+=l,f=0,g=l;f<g&&r(a(t[c%l][n]),s,o);++f)c--,h--;c%=l,h%=l}return h<c&&(h+=l),{start:c,end:h,loop:d,style:i.style}}function pn(i,t,e){if(!e)return[i];const{property:n,start:s,end:o}=e,r=t.length,{compare:a,between:l,normalize:c}=un(n),{start:h,end:d,loop:f,style:g}=Ar(i,t,e),p=[];let b=!1,m=null,x,_,w;const v=()=>l(s,w,x)&&a(s,w)!==0,y=()=>a(o,x)===0||l(o,w,x),k=()=>b||v(),S=()=>!b||y();for(let M=h,C=h;M<=d;++M)_=t[M%r],!_.skip&&(x=c(_[n]),x!==w&&(b=l(x,s,o),m===null&&k()&&(m=a(x,s)===0?M:C),m!==null&&S()&&(p.push(gn({start:m,end:M,loop:f,count:r,style:g})),m=null),C=M,w=x));return m!==null&&p.push(gn({start:m,end:d,loop:f,count:r,style:g})),p}function mn(i,t){const e=[],n=i.segments;for(let s=0;s<n.length;s++){const o=pn(n[s],i.points,t);o.length&&e.push(...o)}return e}function Or(i,t,e,n){let s=0,o=t-1;if(e&&!n)for(;s<t&&!i[s].skip;)s++;for(;s<t&&i[s].skip;)s++;for(s%=t,e&&(o+=s);o>s&&i[o%t].skip;)o--;return o%=t,{start:s,end:o}}function Tr(i,t,e,n){const s=i.length,o=[];let r=t,a=i[t],l;for(l=t+1;l<=e;++l){const c=i[l%s];c.skip||c.stop?a.skip||(n=!1,o.push({start:t%s,end:(l-1)%s,loop:n}),t=r=c.stop?l:null):(r=l,a.skip&&(t=l)),a=c}return r!==null&&o.push({start:t%s,end:r%s,loop:n}),o}function Er(i,t){const e=i.points,n=i.options.spanGaps,s=e.length;if(!s)return[];const o=!!i._loop,{start:r,end:a}=Or(e,s,o,n);if(n===!0)return bn(i,[{start:r,end:a,loop:o}],e,t);const l=a<r?a+s:a,c=!!i._fullLoop&&r===0&&a===s-1;return bn(i,Tr(e,r,l,c),e,t)}function bn(i,t,e,n){return!n||!n.setContext||!e?t:Rr(i,t,e,n)}function Rr(i,t,e,n){const s=i._chart.getContext(),o=xn(i.options),{_datasetIndex:r,options:{spanGaps:a}}=i,l=e.length,c=[];let h=o,d=t[0].start,f=d;function g(p,b,m,x){const _=a?-1:1;if(p!==b){for(p+=l;e[p%l].skip;)p-=_;for(;e[b%l].skip;)b+=_;p%l!==b%l&&(c.push({start:p%l,end:b%l,loop:m,style:x}),h=x,d=b%l)}}for(const p of t){d=a?d:p.start;let b=e[d%l],m;for(f=d+1;f<=p.end;f++){const x=e[f%l];m=xn(n.setContext(wt(s,{type:"segment",p0:b,p1:x,p0DataIndex:(f-1)%l,p1DataIndex:f%l,datasetIndex:r}))),Lr(m,h)&&g(d,f-1,p.loop,h),b=x,h=m}d<f-1&&g(d,f-1,p.loop,h)}return c}function xn(i){return{backgroundColor:i.backgroundColor,borderCapStyle:i.borderCapStyle,borderDash:i.borderDash,borderDashOffset:i.borderDashOffset,borderJoinStyle:i.borderJoinStyle,borderWidth:i.borderWidth,borderColor:i.borderColor}}function Lr(i,t){if(!t)return!1;const e=[],n=function(s,o){return Ze(o)?(e.includes(o)||e.push(o),e.indexOf(o)):o};return JSON.stringify(i,n)!==JSON.stringify(t,n)}function Pe(i,t,e){return i.options.clip?i[e]:t[e]}function Br(i,t){const{xScale:e,yScale:n}=i;return e&&n?{left:Pe(e,t,"left"),right:Pe(e,t,"right"),top:Pe(n,t,"top"),bottom:Pe(n,t,"bottom")}:t}function yn(i,t){const e=t._clip;if(e.disabled)return!1;const n=Br(t,i.chartArea);return{left:e.left===!1?0:n.left-(e.left===!0?0:e.left),right:e.right===!1?i.width:n.right+(e.right===!0?0:e.right),top:e.top===!1?0:n.top-(e.top===!0?0:e.top),bottom:e.bottom===!1?i.height:n.bottom+(e.bottom===!0?0:e.bottom)}}class zr{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,n,s){const o=e.listeners[s],r=e.duration;o.forEach(a=>a({chart:t,initial:e.initial,numSteps:r,currentStep:Math.min(n-e.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=Ui.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((n,s)=>{if(!n.running||!n.items.length)return;const o=n.items;let r=o.length-1,a=!1,l;for(;r>=0;--r)l=o[r],l._active?(l._total>n.duration&&(n.duration=l._total),l.tick(t),a=!0):(o[r]=o[o.length-1],o.pop());a&&(s.draw(),this._notify(s,n,t,"progress")),o.length||(n.running=!1,this._notify(s,n,t,"complete"),n.initial=!1),e+=o.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let n=e.get(t);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,n)),n}listen(t,e,n){this._getAnims(t).listeners[e].push(n)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((n,s)=>Math.max(n,s._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const n=e.items;let s=n.length-1;for(;s>=0;--s)n[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var ut=new zr;const _n="transparent",Ir={boolean(i,t,e){return e>.5?t:i},color(i,t,e){const n=Ji(i||_n),s=n.valid&&Ji(t||_n);return s&&s.valid?s.mix(n,e).hexString():t},number(i,t,e){return i+(t-i)*e}};class Fr{constructor(t,e,n,s){const o=e[n];s=Me([t.to,s,o,t.from]);const r=Me([t.from,o,s]);this._active=!0,this._fn=t.fn||Ir[t.type||typeof r],this._easing=ee[t.easing]||ee.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=n,this._from=r,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,n){if(this._active){this._notify(!1);const s=this._target[this._prop],o=n-this._start,r=this._duration-o;this._start=n,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=Me([t.to,e,s,t.from]),this._from=Me([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,n=this._duration,s=this._prop,o=this._from,r=this._loop,a=this._to;let l;if(this._active=o!==a&&(r||e<n),!this._active){this._target[s]=a,this._notify(!0);return}if(e<0){this._target[s]=o;return}l=e/n%2,l=r&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(o,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,n)=>{t.push({res:e,rej:n})})}_notify(t){const e=t?"res":"rej",n=this._promises||[];for(let s=0;s<n.length;s++)n[s][e]()}}class kn{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!R(t))return;const e=Object.keys($.animation),n=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const o=t[s];if(!R(o))return;const r={};for(const a of e)r[a]=o[a];(j(o.properties)&&o.properties||[s]).forEach(a=>{(a===s||!n.has(a))&&n.set(a,r)})})}_animateOptions(t,e){const n=e.options,s=Vr(t,n);if(!s)return[];const o=this._createAnimations(s,n);return n.$shared&&Nr(t.options.$animations,n).then(()=>{t.options=n},()=>{}),o}_createAnimations(t,e){const n=this._properties,s=[],o=t.$animations||(t.$animations={}),r=Object.keys(e),a=Date.now();let l;for(l=r.length-1;l>=0;--l){const c=r[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,e));continue}const h=e[c];let d=o[c];const f=n.get(c);if(d)if(f&&d.active()){d.update(f,h,a);continue}else d.cancel();if(!f||!f.duration){t[c]=h;continue}o[c]=d=new Fr(f,t,c,h),s.push(d)}return s}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const n=this._createAnimations(t,e);if(n.length)return ut.add(this._chart,n),!0}}function Nr(i,t){const e=[],n=Object.keys(t);for(let s=0;s<n.length;s++){const o=i[n[s]];o&&o.active()&&e.push(o.wait())}return Promise.all(e)}function Vr(i,t){if(!t)return;let e=i.options;if(!e){i.options=t;return}return e.$shared&&(i.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function wn(i,t){const e=i&&i.options||{},n=e.reverse,s=e.min===void 0?t:0,o=e.max===void 0?t:0;return{start:n?o:s,end:n?s:o}}function Wr(i,t,e){if(e===!1)return!1;const n=wn(i,e),s=wn(t,e);return{top:s.end,right:n.end,bottom:s.start,left:n.start}}function Hr(i){let t,e,n,s;return R(i)?(t=i.top,e=i.right,n=i.bottom,s=i.left):t=e=n=s=i,{top:t,right:e,bottom:n,left:s,disabled:i===!1}}function Sn(i,t){const e=[],n=i._getSortedDatasetMetas(t);let s,o;for(s=0,o=n.length;s<o;++s)e.push(n[s].index);return e}function Mn(i,t,e,n={}){const s=i.keys,o=n.mode==="single";let r,a,l,c;if(t===null)return;let h=!1;for(r=0,a=s.length;r<a;++r){if(l=+s[r],l===e){if(h=!0,n.all)continue;break}c=i.values[l],X(c)&&(o||t===0||Nt(t)===Nt(c))&&(t+=c)}return!h&&!n.all?0:t}function jr(i,t){const{iScale:e,vScale:n}=t,s=e.axis==="x"?"x":"y",o=n.axis==="x"?"x":"y",r=Object.keys(i),a=new Array(r.length);let l,c,h;for(l=0,c=r.length;l<c;++l)h=r[l],a[l]={[s]:h,[o]:i[h]};return a}function di(i,t){const e=i&&i.options.stacked;return e||e===void 0&&t.stack!==void 0}function $r(i,t,e){return`${i.id}.${t.id}.${e.stack||e.type}`}function Yr(i){const{min:t,max:e,minDefined:n,maxDefined:s}=i.getUserBounds();return{min:n?t:Number.NEGATIVE_INFINITY,max:s?e:Number.POSITIVE_INFINITY}}function Ur(i,t,e){const n=i[t]||(i[t]={});return n[e]||(n[e]={})}function vn(i,t,e,n){for(const s of t.getMatchingVisibleMetas(n).reverse()){const o=i[s.index];if(e&&o>0||!e&&o<0)return s.index}return null}function Cn(i,t){const{chart:e,_cachedMeta:n}=i,s=e._stacks||(e._stacks={}),{iScale:o,vScale:r,index:a}=n,l=o.axis,c=r.axis,h=$r(o,r,n),d=t.length;let f;for(let g=0;g<d;++g){const p=t[g],{[l]:b,[c]:m}=p,x=p._stacks||(p._stacks={});f=x[c]=Ur(s,h,b),f[a]=m,f._top=vn(f,r,!0,n.type),f._bottom=vn(f,r,!1,n.type);const _=f._visualValues||(f._visualValues={});_[a]=m}}function fi(i,t){const e=i.scales;return Object.keys(e).filter(n=>e[n].axis===t).shift()}function Xr(i,t){return wt(i,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function qr(i,t,e){return wt(i,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function ne(i,t){const e=i.controller.index,n=i.vScale&&i.vScale.axis;if(n){t=t||i._parsed;for(const s of t){const o=s._stacks;if(!o||o[n]===void 0||o[n][e]===void 0)return;delete o[n][e],o[n]._visualValues!==void 0&&o[n]._visualValues[e]!==void 0&&delete o[n]._visualValues[e]}}}const ui=i=>i==="reset"||i==="none",Dn=(i,t)=>t?i:Object.assign({},i),Kr=(i,t,e)=>i&&!t.hidden&&t._stacked&&{keys:Sn(e,!0),values:null};class Ae{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(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=di(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&&ne(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,n=this.getDataset(),s=(d,f,g,p)=>d==="x"?f:d==="r"?p:g,o=e.xAxisID=T(n.xAxisID,fi(t,"x")),r=e.yAxisID=T(n.yAxisID,fi(t,"y")),a=e.rAxisID=T(n.rAxisID,fi(t,"r")),l=e.indexAxis,c=e.iAxisID=s(l,o,r,a),h=e.vAxisID=s(l,r,o,a);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(r),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(c),e.vScale=this.getScaleForId(h)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Yi(this._data,this),t._stacked&&ne(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),n=this._data;if(R(e)){const s=this._cachedMeta;this._data=jr(e,s)}else if(n!==e){if(n){Yi(n,this);const s=this._cachedMeta;ne(s),s._parsed=[]}e&&Object.isExtensible(e)&&Do(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,n=this.getDataset();let s=!1;this._dataCheck();const o=e._stacked;e._stacked=di(e.vScale,e),e.stack!==n.stack&&(s=!0,ne(e),e.stack=n.stack),this._resyncElements(t),(s||o!==e._stacked)&&(Cn(this,e._parsed),e._stacked=di(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),n=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:n,_data:s}=this,{iScale:o,_stacked:r}=n,a=o.axis;let l=t===0&&e===s.length?!0:n._sorted,c=t>0&&n._parsed[t-1],h,d,f;if(this._parsing===!1)n._parsed=s,n._sorted=!0,f=s;else{j(s[t])?f=this.parseArrayData(n,s,t,e):R(s[t])?f=this.parseObjectData(n,s,t,e):f=this.parsePrimitiveData(n,s,t,e);const g=()=>d[a]===null||c&&d[a]<c[a];for(h=0;h<e;++h)n._parsed[h+t]=d=f[h],l&&(g()&&(l=!1),c=d);n._sorted=l}r&&Cn(this,f)}parsePrimitiveData(t,e,n,s){const{iScale:o,vScale:r}=t,a=o.axis,l=r.axis,c=o.getLabels(),h=o===r,d=new Array(s);let f,g,p;for(f=0,g=s;f<g;++f)p=f+n,d[f]={[a]:h||o.parse(c[p],p),[l]:r.parse(e[p],p)};return d}parseArrayData(t,e,n,s){const{xScale:o,yScale:r}=t,a=new Array(s);let l,c,h,d;for(l=0,c=s;l<c;++l)h=l+n,d=e[h],a[l]={x:o.parse(d[0],h),y:r.parse(d[1],h)};return a}parseObjectData(t,e,n,s){const{xScale:o,yScale:r}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(s);let h,d,f,g;for(h=0,d=s;h<d;++h)f=h+n,g=e[f],c[h]={x:o.parse(Ft(g,a),f),y:r.parse(Ft(g,l),f)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,n){const s=this.chart,o=this._cachedMeta,r=e[t.axis],a={keys:Sn(s,!0),values:e._stacks[t.axis]._visualValues};return Mn(a,r,o.index,{mode:n})}updateRangeFromParsed(t,e,n,s){const o=n[e.axis];let r=o===null?NaN:o;const a=s&&n._stacks[e.axis];s&&a&&(s.values=a,r=Mn(s,o,this._cachedMeta.index)),t.min=Math.min(t.min,r),t.max=Math.max(t.max,r)}getMinMax(t,e){const n=this._cachedMeta,s=n._parsed,o=n._sorted&&t===n.iScale,r=s.length,a=this._getOtherScale(t),l=Kr(e,n,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:d}=Yr(a);let f,g;function p(){g=s[f];const b=g[a.axis];return!X(g[t.axis])||h>b||d<b}for(f=0;f<r&&!(!p()&&(this.updateRangeFromParsed(c,t,g,l),o));++f);if(o){for(f=r-1;f>=0;--f)if(!p()){this.updateRangeFromParsed(c,t,g,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,n=[];let s,o,r;for(s=0,o=e.length;s<o;++s)r=e[s][t.axis],X(r)&&n.push(r);return n}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,n=e.iScale,s=e.vScale,o=this.getParsed(t);return{label:n?""+n.getLabelForValue(o[n.axis]):"",value:s?""+s.getLabelForValue(o[s.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=Hr(T(this.options.clip,Wr(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,n=this._cachedMeta,s=n.data||[],o=e.chartArea,r=[],a=this._drawStart||0,l=this._drawCount||s.length-a,c=this.options.drawActiveElementsOnTop;let h;for(n.dataset&&n.dataset.draw(t,o,a,l),h=a;h<a+l;++h){const d=s[h];d.hidden||(d.active&&c?r.push(d):d.draw(t,o))}for(h=0;h<r.length;++h)r[h].draw(t,o)}getStyle(t,e){const n=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(n):this.resolveDataElementOptions(t||0,n)}getContext(t,e,n){const s=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const r=this._cachedMeta.data[t];o=r.$context||(r.$context=qr(this.getContext(),t,r)),o.parsed=this.getParsed(t),o.raw=s.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=Xr(this.chart.getContext(),this.index)),o.dataset=s,o.index=o.datasetIndex=this.index;return o.active=!!e,o.mode=n,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",n){const s=e==="active",o=this._cachedDataOpts,r=t+"-"+e,a=o[r],l=this.enableOptionSharing&&me(n);if(a)return Dn(a,l);const c=this.chart.config,h=c.datasetElementScopeKeys(this._type,t),d=s?[`${t}Hover`,"hover",t,""]:[t,""],f=c.getOptionScopes(this.getDataset(),h),g=Object.keys($.elements[t]),p=()=>this.getContext(n,s,e),b=c.resolveNamedOptions(f,g,p,d);return b.$shared&&(b.$shared=l,o[r]=Object.freeze(Dn(b,l))),b}_resolveAnimations(t,e,n){const s=this.chart,o=this._cachedDataOpts,r=`animation-${e}`,a=o[r];if(a)return a;let l;if(s.options.animation!==!1){const h=this.chart.config,d=h.datasetAnimationScopeKeys(this._type,e),f=h.getOptionScopes(this.getDataset(),d);l=h.createResolver(f,this.getContext(t,n,e))}const c=new kn(s,l&&l.animations);return l&&l._cacheable&&(o[r]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||ui(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const n=this.resolveDataElementOptions(t,e),s=this._sharedOptions,o=this.getSharedOptions(n),r=this.includeOptions(e,o)||o!==s;return this.updateSharedOptions(o,e,n),{sharedOptions:o,includeOptions:r}}updateElement(t,e,n,s){ui(s)?Object.assign(t,n):this._resolveAnimations(e,s).update(t,n)}updateSharedOptions(t,e,n){t&&!ui(e)&&this._resolveAnimations(void 0,e).update(t,n)}_setStyle(t,e,n,s){t.active=s;const o=this.getStyle(e,s);this._resolveAnimations(e,n,s).update(t,{options:!s&&this.getSharedOptions(o)||o})}removeHoverStyle(t,e,n){this._setStyle(t,n,"active",!1)}setHoverStyle(t,e,n){this._setStyle(t,n,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,n=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const s=n.length,o=e.length,r=Math.min(o,s);r&&this.parse(0,r),o>s?this._insertElements(s,o-s,t):o<s&&this._removeElements(o,s-o)}_insertElements(t,e,n=!0){const s=this._cachedMeta,o=s.data,r=t+e;let a;const l=c=>{for(c.length+=e,a=c.length-1;a>=r;a--)c[a]=c[a-e]};for(l(o),a=t;a<r;++a)o[a]=new this.dataElementType;this._parsing&&l(s._parsed),this.parse(t,e),n&&this.updateElements(o,t,e,"reset")}updateElements(t,e,n,s){}_removeElements(t,e){const n=this._cachedMeta;if(this._parsing){const s=n._parsed.splice(t,e);n._stacked&&ne(n,s)}n.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,n,s]=t;this[e](n,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const n=arguments.length-2;n&&this._sync(["_insertElements",t,n])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function Gr(i,t,e){let n=1,s=1,o=0,r=0;if(t<W){const a=i,l=a+t,c=Math.cos(a),h=Math.sin(a),d=Math.cos(l),f=Math.sin(l),g=(w,v,y)=>te(w,a,l,!0)?1:Math.max(v,v*e,y,y*e),p=(w,v,y)=>te(w,a,l,!0)?-1:Math.min(v,v*e,y,y*e),b=g(0,c,d),m=g(Y,h,f),x=p(B,c,d),_=p(B+Y,h,f);n=(b-x)/2,s=(m-_)/2,o=-(b+x)/2,r=-(m+_)/2}return{ratioX:n,ratioY:s,offsetX:o,offsetY:r}}class Jr extends Ae{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){const e=t.data,{labels:{pointStyle:n,textAlign:s,color:o,useBorderRadius:r,borderRadius:a}}=t.legend.options;return e.labels.length&&e.datasets.length?e.labels.map((l,c)=>{const d=t.getDatasetMeta(0).controller.getStyle(c);return{text:l,fillStyle:d.backgroundColor,fontColor:o,hidden:!t.getDataVisibility(c),lineDash:d.borderDash,lineDashOffset:d.borderDashOffset,lineJoin:d.borderJoinStyle,lineWidth:d.borderWidth,strokeStyle:d.borderColor,textAlign:s,pointStyle:n,borderRadius:r&&(a||d.borderRadius),index:c}}):[]}},onClick(t,e,n){n.chart.toggleDataVisibility(e.index),n.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){const n=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=n;else{let o=l=>+n[l];if(R(n[t])){const{key:l="value"}=this._parsing;o=c=>+Ft(n[c],l)}let r,a;for(r=t,a=t+e;r<a;++r)s._parsed[r]=o(r)}}_getRotation(){return rt(this.options.rotation-90)}_getCircumference(){return rt(this.options.circumference)}_getRotationExtents(){let t=W,e=-W;for(let n=0;n<this.chart.data.datasets.length;++n)if(this.chart.isDatasetVisible(n)&&this.chart.getDatasetMeta(n).type===this._type){const s=this.chart.getDatasetMeta(n).controller,o=s._getRotation(),r=s._getCircumference();t=Math.min(t,o),e=Math.max(e,o+r)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:n}=e,s=this._cachedMeta,o=s.data,r=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,a=Math.max((Math.min(n.width,n.height)-r)/2,0),l=Math.min(ho(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:h,rotation:d}=this._getRotationExtents(),{ratioX:f,ratioY:g,offsetX:p,offsetY:b}=Gr(d,h,l),m=(n.width-r)/f,x=(n.height-r)/g,_=Math.max(Math.min(m,x)/2,0),w=Bi(this.options.radius,_),v=Math.max(w*l,0),y=(w-v)/this._getVisibleDatasetWeightTotal();this.offsetX=p*w,this.offsetY=b*w,s.total=this.calculateTotal(),this.outerRadius=w-y*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-y*c,0),this.updateElements(o,0,o.length,t)}_circumference(t,e){const n=this.options,s=this._cachedMeta,o=this._getCircumference();return e&&n.animation.animateRotate||!this.chart.getDataVisibility(t)||s._parsed[t]===null||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*o/W)}updateElements(t,e,n,s){const o=s==="reset",r=this.chart,a=r.chartArea,c=r.options.animation,h=(a.left+a.right)/2,d=(a.top+a.bottom)/2,f=o&&c.animateScale,g=f?0:this.innerRadius,p=f?0:this.outerRadius,{sharedOptions:b,includeOptions:m}=this._getSharedOptions(e,s);let x=this._getRotation(),_;for(_=0;_<e;++_)x+=this._circumference(_,o);for(_=e;_<e+n;++_){const w=this._circumference(_,o),v=t[_],y={x:h+this.offsetX,y:d+this.offsetY,startAngle:x,endAngle:x+w,circumference:w,outerRadius:p,innerRadius:g};m&&(y.options=b||this.resolveDataElementOptions(_,v.active?"active":s)),x+=w,this.updateElement(v,_,y,s)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let n=0,s;for(s=0;s<e.length;s++){const o=t._parsed[s];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(s)&&!e[s].hidden&&(n+=Math.abs(o))}return n}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?W*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart,s=n.data.labels||[],o=ye(e._parsed[t],n.options.locale);return{label:s[t]||"",value:o}}getMaxBorderWidth(t){let e=0;const n=this.chart;let s,o,r,a,l;if(!t){for(s=0,o=n.data.datasets.length;s<o;++s)if(n.isDatasetVisible(s)){r=n.getDatasetMeta(s),t=r.data,a=r.controller;break}}if(!t)return 0;for(s=0,o=t.length;s<o;++s)l=a.resolveDataElementOptions(s),l.borderAlign!=="inner"&&(e=Math.max(e,l.borderWidth||0,l.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let n=0,s=t.length;n<s;++n){const o=this.resolveDataElementOptions(n);e=Math.max(e,o.offset||0,o.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let n=0;n<t;++n)this.chart.isDatasetVisible(n)&&(e+=this._getRingWeight(n));return e}_getRingWeight(t){return Math.max(T(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class Qr extends Ae{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:n,data:s=[],_dataset:o}=e,r=this.chart._animationsDisabled;let{start:a,count:l}=To(e,s,r);this._drawStart=a,this._drawCount=l,Eo(e)&&(a=0,l=s.length),n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!o._decimated,n.points=s;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(n,void 0,{animated:!r,options:c},t),this.updateElements(s,a,l,t)}updateElements(t,e,n,s){const o=s==="reset",{iScale:r,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:h,includeOptions:d}=this._getSharedOptions(e,s),f=r.axis,g=a.axis,{spanGaps:p,segment:b}=this.options,m=Zt(p)?p:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||o||s==="none",_=e+n,w=t.length;let v=e>0&&this.getParsed(e-1);for(let y=0;y<w;++y){const k=t[y],S=x?k:{};if(y<e||y>=_){S.skip=!0;continue}const M=this.getParsed(y),C=z(M[g]),D=S[f]=r.getPixelForValue(M[f],y),P=S[g]=o||C?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,M,l):M[g],y);S.skip=isNaN(D)||isNaN(P)||C,S.stop=y>0&&Math.abs(M[f]-v[f])>m,b&&(S.parsed=M,S.raw=c.data[y]),d&&(S.options=h||this.resolveDataElementOptions(y,k.active?"active":s)),x||this.updateElement(k,y,S,s),v=M}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,n=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return n;const o=s[0].size(this.resolveDataElementOptions(0)),r=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(n,o,r)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}class Zr extends Ae{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){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:n,color:s}}=t.legend.options;return e.labels.map((o,r)=>{const l=t.getDatasetMeta(0).controller.getStyle(r);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:n,hidden:!t.getDataVisibility(r),index:r}})}return[]}},onClick(t,e,n){n.chart.toggleDataVisibility(e.index),n.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){const e=this._cachedMeta,n=this.chart,s=n.data.labels||[],o=ye(e._parsed[t].r,n.options.locale);return{label:s[t]||"",value:o}}parseObjectData(t,e,n,s){return hr.bind(this)(t,e,n,s)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((n,s)=>{const o=this.getParsed(s).r;!isNaN(o)&&this.chart.getDataVisibility(s)&&(o<e.min&&(e.min=o),o>e.max&&(e.max=o))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,n=t.options,s=Math.min(e.right-e.left,e.bottom-e.top),o=Math.max(s/2,0),r=Math.max(n.cutoutPercentage?o/100*n.cutoutPercentage:1,0),a=(o-r)/t.getVisibleDatasetCount();this.outerRadius=o-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,e,n,s){const o=s==="reset",r=this.chart,l=r.options.animation,c=this._cachedMeta.rScale,h=c.xCenter,d=c.yCenter,f=c.getIndexAngle(0)-.5*B;let g=f,p;const b=360/this.countVisibleElements();for(p=0;p<e;++p)g+=this._computeAngle(p,s,b);for(p=e;p<e+n;p++){const m=t[p];let x=g,_=g+this._computeAngle(p,s,b),w=r.getDataVisibility(p)?c.getDistanceFromCenterForValue(this.getParsed(p).r):0;g=_,o&&(l.animateScale&&(w=0),l.animateRotate&&(x=_=f));const v={x:h,y:d,innerRadius:0,outerRadius:w,startAngle:x,endAngle:_,options:this.resolveDataElementOptions(p,m.active?"active":s)};this.updateElement(m,p,v,s)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((n,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&e++}),e}_computeAngle(t,e,n){return this.chart.getDataVisibility(t)?rt(this.resolveDataElementOptions(t,e).angle||n):0}}function Rt(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class gi{static override(t){Object.assign(gi.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return Rt()}parse(){return Rt()}format(){return Rt()}add(){return Rt()}diff(){return Rt()}startOf(){return Rt()}endOf(){return Rt()}}var ta={_date:gi};function ea(i,t,e,n){const{controller:s,data:o,_sorted:r}=i,a=s._cachedMeta.iScale,l=i.dataset&&i.dataset.options?i.dataset.options.spanGaps:null;if(a&&t===a.axis&&t!=="r"&&r&&o.length){const c=a._reversePixels?vo:Dt;if(n){if(s._sharedOptions){const h=o[0],d=typeof h.getRange=="function"&&h.getRange(t);if(d){const f=c(o,t,e-d),g=c(o,t,e+d);return{lo:f.lo,hi:g.hi}}}}else{const h=c(o,t,e);if(l){const{vScale:d}=s._cachedMeta,{_parsed:f}=i,g=f.slice(0,h.lo+1).reverse().findIndex(b=>!z(b[d.axis]));h.lo-=Math.max(0,g);const p=f.slice(h.hi).findIndex(b=>!z(b[d.axis]));h.hi+=Math.max(0,p)}return h}}return{lo:0,hi:o.length-1}}function Oe(i,t,e,n,s){const o=i.getSortedVisibleDatasetMetas(),r=e[t];for(let a=0,l=o.length;a<l;++a){const{index:c,data:h}=o[a],{lo:d,hi:f}=ea(o[a],t,r,s);for(let g=d;g<=f;++g){const p=h[g];p.skip||n(p,c,g)}}}function ia(i){const t=i.indexOf("x")!==-1,e=i.indexOf("y")!==-1;return function(n,s){const o=t?Math.abs(n.x-s.x):0,r=e?Math.abs(n.y-s.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(r,2))}}function pi(i,t,e,n,s){const o=[];return!s&&!i.isPointInArea(t)||Oe(i,e,t,function(a,l,c){!s&&!ft(a,i.chartArea,0)||a.inRange(t.x,t.y,n)&&o.push({element:a,datasetIndex:l,index:c})},!0),o}function na(i,t,e,n){let s=[];function o(r,a,l){const{startAngle:c,endAngle:h}=r.getProps(["startAngle","endAngle"],n),{angle:d}=ji(r,{x:t.x,y:t.y});te(d,c,h)&&s.push({element:r,datasetIndex:a,index:l})}return Oe(i,e,t,o),s}function sa(i,t,e,n,s,o){let r=[];const a=ia(e);let l=Number.POSITIVE_INFINITY;function c(h,d,f){const g=h.inRange(t.x,t.y,s);if(n&&!g)return;const p=h.getCenterPoint(s);if(!(!!o||i.isPointInArea(p))&&!g)return;const m=a(t,p);m<l?(r=[{element:h,datasetIndex:d,index:f}],l=m):m===l&&r.push({element:h,datasetIndex:d,index:f})}return Oe(i,e,t,c),r}function mi(i,t,e,n,s,o){return!o&&!i.isPointInArea(t)?[]:e==="r"&&!n?na(i,t,e,s):sa(i,t,e,n,s,o)}function Pn(i,t,e,n,s){const o=[],r=e==="x"?"inXRange":"inYRange";let a=!1;return Oe(i,e,t,(l,c,h)=>{l[r]&&l[r](t[e],s)&&(o.push({element:l,datasetIndex:c,index:h}),a=a||l.inRange(t.x,t.y,s))}),n&&!a?[]:o}var oa={modes:{index(i,t,e,n){const s=Tt(t,i),o=e.axis||"x",r=e.includeInvisible||!1,a=e.intersect?pi(i,s,o,n,r):mi(i,s,o,!1,n,r),l=[];return a.length?(i.getSortedVisibleDatasetMetas().forEach(c=>{const h=a[0].index,d=c.data[h];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:h})}),l):[]},dataset(i,t,e,n){const s=Tt(t,i),o=e.axis||"xy",r=e.includeInvisible||!1;let a=e.intersect?pi(i,s,o,n,r):mi(i,s,o,!1,n,r);if(a.length>0){const l=a[0].datasetIndex,c=i.getDatasetMeta(l).data;a=[];for(let h=0;h<c.length;++h)a.push({element:c[h],datasetIndex:l,index:h})}return a},point(i,t,e,n){const s=Tt(t,i),o=e.axis||"xy",r=e.includeInvisible||!1;return pi(i,s,o,n,r)},nearest(i,t,e,n){const s=Tt(t,i),o=e.axis||"xy",r=e.includeInvisible||!1;return mi(i,s,o,e.intersect,n,r)},x(i,t,e,n){const s=Tt(t,i);return Pn(i,s,"x",e.intersect,n)},y(i,t,e,n){const s=Tt(t,i);return Pn(i,s,"y",e.intersect,n)}}};const An=["left","top","right","bottom"];function se(i,t){return i.filter(e=>e.pos===t)}function On(i,t){return i.filter(e=>An.indexOf(e.pos)===-1&&e.box.axis===t)}function oe(i,t){return i.sort((e,n)=>{const s=t?n:e,o=t?e:n;return s.weight===o.weight?s.index-o.index:s.weight-o.weight})}function ra(i){const t=[];let e,n,s,o,r,a;for(e=0,n=(i||[]).length;e<n;++e)s=i[e],{position:o,options:{stack:r,stackWeight:a=1}}=s,t.push({index:e,box:s,pos:o,horizontal:s.isHorizontal(),weight:s.weight,stack:r&&o+r,stackWeight:a});return t}function aa(i){const t={};for(const e of i){const{stack:n,pos:s,stackWeight:o}=e;if(!n||!An.includes(s))continue;const r=t[n]||(t[n]={count:0,placed:0,weight:0,size:0});r.count++,r.weight+=o}return t}function la(i,t){const e=aa(i),{vBoxMaxWidth:n,hBoxMaxHeight:s}=t;let o,r,a;for(o=0,r=i.length;o<r;++o){a=i[o];const{fullSize:l}=a.box,c=e[a.stack],h=c&&a.stackWeight/c.weight;a.horizontal?(a.width=h?h*n:l&&t.availableWidth,a.height=s):(a.width=n,a.height=h?h*s:l&&t.availableHeight)}return e}function ca(i){const t=ra(i),e=oe(t.filter(c=>c.box.fullSize),!0),n=oe(se(t,"left"),!0),s=oe(se(t,"right")),o=oe(se(t,"top"),!0),r=oe(se(t,"bottom")),a=On(t,"x"),l=On(t,"y");return{fullSize:e,leftAndTop:n.concat(o),rightAndBottom:s.concat(l).concat(r).concat(a),chartArea:se(t,"chartArea"),vertical:n.concat(s).concat(l),horizontal:o.concat(r).concat(a)}}function Tn(i,t,e,n){return Math.max(i[e],t[e])+Math.max(i[n],t[n])}function En(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 ha(i,t,e,n){const{pos:s,box:o}=e,r=i.maxPadding;if(!R(s)){e.size&&(i[s]-=e.size);const d=n[e.stack]||{size:0,count:1};d.size=Math.max(d.size,e.horizontal?o.height:o.width),e.size=d.size/d.count,i[s]+=e.size}o.getPadding&&En(r,o.getPadding());const a=Math.max(0,t.outerWidth-Tn(r,i,"left","right")),l=Math.max(0,t.outerHeight-Tn(r,i,"top","bottom")),c=a!==i.w,h=l!==i.h;return i.w=a,i.h=l,e.horizontal?{same:c,other:h}:{same:h,other:c}}function da(i){const t=i.maxPadding;function e(n){const s=Math.max(t[n]-i[n],0);return i[n]+=s,s}i.y+=e("top"),i.x+=e("left"),e("right"),e("bottom")}function fa(i,t){const e=t.maxPadding;function n(s){const o={left:0,top:0,right:0,bottom:0};return s.forEach(r=>{o[r]=Math.max(t[r],e[r])}),o}return n(i?["left","right"]:["top","bottom"])}function re(i,t,e,n){const s=[];let o,r,a,l,c,h;for(o=0,r=i.length,c=0;o<r;++o){a=i[o],l=a.box,l.update(a.width||t.w,a.height||t.h,fa(a.horizontal,t));const{same:d,other:f}=ha(t,e,a,n);c|=d&&s.length,h=h||f,l.fullSize||s.push(a)}return c&&re(s,t,e,n)||h}function Te(i,t,e,n,s){i.top=e,i.left=t,i.right=t+n,i.bottom=e+s,i.width=n,i.height=s}function Rn(i,t,e,n){const s=e.padding;let{x:o,y:r}=t;for(const a of i){const l=a.box,c=n[a.stack]||{placed:0,weight:1},h=a.stackWeight/c.weight||1;if(a.horizontal){const d=t.w*h,f=c.size||l.height;me(c.start)&&(r=c.start),l.fullSize?Te(l,s.left,r,e.outerWidth-s.right-s.left,f):Te(l,t.left+c.placed,r,d,f),c.start=r,c.placed+=d,r=l.bottom}else{const d=t.h*h,f=c.size||l.width;me(c.start)&&(o=c.start),l.fullSize?Te(l,o,s.top,f,e.outerHeight-s.bottom-s.top):Te(l,o,t.top+c.placed,f,d),c.start=o,c.placed+=d,o=l.right}}t.x=o,t.y=r}var Mt={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){const 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,n){if(!i)return;const s=Q(i.options.layout.padding),o=Math.max(t-s.width,0),r=Math.max(e-s.height,0),a=ca(i.boxes),l=a.vertical,c=a.horizontal;I(i.boxes,b=>{typeof b.beforeLayout=="function"&&b.beforeLayout()});const h=l.reduce((b,m)=>m.box.options&&m.box.options.display===!1?b:b+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:e,padding:s,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/h,hBoxMaxHeight:r/2}),f=Object.assign({},s);En(f,Q(n));const g=Object.assign({maxPadding:f,w:o,h:r,x:s.left,y:s.top},s),p=la(l.concat(c),d);re(a.fullSize,g,d,p),re(l,g,d,p),re(c,g,d,p)&&re(l,g,d,p),da(g),Rn(a.leftAndTop,g,d,p),g.x+=g.w,g.y+=g.h,Rn(a.rightAndBottom,g,d,p),i.chartArea={left:g.left,top:g.top,right:g.left+g.w,bottom:g.top+g.h,height:g.h,width:g.w},I(a.chartArea,b=>{const m=b.box;Object.assign(m,i.chartArea),m.update(g.w,g.h,{left:0,top:0,right:0,bottom:0})})}};class Ln{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,n){}removeEventListener(t,e,n){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,n,s){return e=Math.max(0,e||t.width),n=n||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):n)}}isAttached(t){return!0}updateConfig(t){}}class ua extends Ln{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Ee="$chartjs",ga={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Bn=i=>i===null||i==="";function pa(i,t){const e=i.style,n=i.getAttribute("height"),s=i.getAttribute("width");if(i[Ee]={initial:{height:n,width:s,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",Bn(s)){const o=hn(i,"width");o!==void 0&&(i.width=o)}if(Bn(n))if(i.style.height==="")i.height=i.width/(t||2);else{const o=hn(i,"height");o!==void 0&&(i.height=o)}return i}const zn=Mr?{passive:!0}:!1;function ma(i,t,e){i&&i.addEventListener(t,e,zn)}function ba(i,t,e){i&&i.canvas&&i.canvas.removeEventListener(t,e,zn)}function xa(i,t){const e=ga[i.type]||i.type,{x:n,y:s}=Tt(i,t);return{type:e,chart:t,native:i,x:n!==void 0?n:null,y:s!==void 0?s:null}}function Re(i,t){for(const e of i)if(e===t||e.contains(t))return!0}function ya(i,t,e){const n=i.canvas,s=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||Re(a.addedNodes,n),r=r&&!Re(a.removedNodes,n);r&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}function _a(i,t,e){const n=i.canvas,s=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||Re(a.removedNodes,n),r=r&&!Re(a.addedNodes,n);r&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}const ae=new Map;let In=0;function Fn(){const i=window.devicePixelRatio;i!==In&&(In=i,ae.forEach((t,e)=>{e.currentDevicePixelRatio!==i&&t()}))}function ka(i,t){ae.size||window.addEventListener("resize",Fn),ae.set(i,t)}function wa(i){ae.delete(i),ae.size||window.removeEventListener("resize",Fn)}function Sa(i,t,e){const n=i.canvas,s=n&&hi(n);if(!s)return;const o=Xi((a,l)=>{const c=s.clientWidth;e(a,l),c<s.clientWidth&&e()},window),r=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,h=l.contentRect.height;c===0&&h===0||o(c,h)});return r.observe(s),ka(i,o),r}function bi(i,t,e){e&&e.disconnect(),t==="resize"&&wa(i)}function Ma(i,t,e){const n=i.canvas,s=Xi(o=>{i.ctx!==null&&e(xa(o,i))},i);return ma(n,t,s),s}class va extends Ln{acquireContext(t,e){const n=t&&t.getContext&&t.getContext("2d");return n&&n.canvas===t?(pa(t,e),n):null}releaseContext(t){const e=t.canvas;if(!e[Ee])return!1;const n=e[Ee].initial;["height","width"].forEach(o=>{const r=n[o];z(r)?e.removeAttribute(o):e.setAttribute(o,r)});const s=n.style||{};return Object.keys(s).forEach(o=>{e.style[o]=s[o]}),e.width=e.width,delete e[Ee],!0}addEventListener(t,e,n){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),r={attach:ya,detach:_a,resize:Sa}[e]||Ma;s[e]=r(t,e,n)}removeEventListener(t,e){const n=t.$proxies||(t.$proxies={}),s=n[e];if(!s)return;({attach:bi,detach:bi,resize:bi}[e]||ba)(t,e,s),n[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,n,s){return Sr(t,e,n,s)}isAttached(t){const e=t&&hi(t);return!!(e&&e.isConnected)}}function Ca(i){return!ci()||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas?ua:va}class Lt{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:e,y:n}=this.getProps(["x","y"],t);return{x:e,y:n}}hasValue(){return Zt(this.x)&&Zt(this.y)}getProps(t,e){const n=this.$animations;if(!e||!n)return this;const s={};return t.forEach(o=>{s[o]=n[o]&&n[o].active()?n[o]._to:this[o]}),s}}function Da(i,t){const e=i.options.ticks,n=Pa(i),s=Math.min(e.maxTicksLimit||n,n),o=e.major.enabled?Oa(t):[],r=o.length,a=o[0],l=o[r-1],c=[];if(r>s)return Ta(t,c,o,r/s),c;const h=Aa(o,t,s);if(r>0){let d,f;const g=r>1?Math.round((l-a)/(r-1)):null;for(Le(t,c,h,z(g)?0:a-g,a),d=0,f=r-1;d<f;d++)Le(t,c,h,o[d],o[d+1]);return Le(t,c,h,l,z(g)?t.length:l+g),c}return Le(t,c,h),c}function Pa(i){const t=i.options.offset,e=i._tickSize(),n=i._length/e+(t?0:1),s=i._maxLength/e;return Math.floor(Math.min(n,s))}function Aa(i,t,e){const n=Ea(i),s=t.length/e;if(!n)return Math.max(s,1);const o=yo(n);for(let r=0,a=o.length-1;r<a;r++){const l=o[r];if(l>s)return l}return Math.max(s,1)}function Oa(i){const t=[];let e,n;for(e=0,n=i.length;e<n;e++)i[e].major&&t.push(e);return t}function Ta(i,t,e,n){let s=0,o=e[0],r;for(n=Math.ceil(n),r=0;r<i.length;r++)r===o&&(t.push(i[r]),s++,o=e[s*n])}function Le(i,t,e,n,s){const o=T(n,0),r=Math.min(T(s,i.length),i.length);let a=0,l,c,h;for(e=Math.ceil(e),s&&(l=s-n,e=l/Math.floor(l/e)),h=o;h<0;)a++,h=Math.round(o+a*e);for(c=Math.max(o,0);c<r;c++)c===h&&(t.push(i[c]),a++,h=Math.round(o+a*e))}function Ea(i){const t=i.length;let e,n;if(t<2)return!1;for(n=i[0],e=1;e<t;++e)if(i[e]-i[e-1]!==n)return!1;return n}const Ra=i=>i==="left"?"right":i==="right"?"left":i,Nn=(i,t,e)=>t==="top"||t==="left"?i[t]+e:i[t]-e,Vn=(i,t)=>Math.min(t||i,i);function Wn(i,t){const e=[],n=i.length/t,s=i.length;let o=0;for(;o<s;o+=n)e.push(i[Math.floor(o)]);return e}function La(i,t,e){const n=i.ticks.length,s=Math.min(t,n-1),o=i._startPixel,r=i._endPixel,a=1e-6;let l=i.getPixelForTick(s),c;if(!(e&&(n===1?c=Math.max(l-o,r-l):t===0?c=(i.getPixelForTick(1)-l)/2:c=(l-i.getPixelForTick(s-1))/2,l+=s<t?c:-c,l<o-a||l>r+a)))return l}function Ba(i,t){I(i,e=>{const n=e.gc,s=n.length/2;let o;if(s>t){for(o=0;o<s;++o)delete e.data[n[o]];n.splice(0,s)}})}function le(i){return i.drawTicks?i.tickLength:0}function Hn(i,t){if(!i.display)return 0;const e=q(i.font,t),n=Q(i.padding);return(j(i.text)?i.text.length:1)*e.lineHeight+n.height}function za(i,t){return wt(i,{scale:t,type:"scale"})}function Ia(i,t,e){return wt(i,{tick:e,index:t,type:"tick"})}function Fa(i,t,e){let n=qi(i);return(e&&t!=="right"||!e&&t==="right")&&(n=Ra(n)),n}function Na(i,t,e,n){const{top:s,left:o,bottom:r,right:a,chart:l}=i,{chartArea:c,scales:h}=l;let d=0,f,g,p;const b=r-s,m=a-o;if(i.isHorizontal()){if(g=nt(n,o,a),R(e)){const x=Object.keys(e)[0],_=e[x];p=h[x].getPixelForValue(_)+b-t}else e==="center"?p=(c.bottom+c.top)/2+b-t:p=Nn(i,e,t);f=a-o}else{if(R(e)){const x=Object.keys(e)[0],_=e[x];g=h[x].getPixelForValue(_)-m+t}else e==="center"?g=(c.left+c.right)/2-m+t:g=Nn(i,e,t);p=nt(n,r,s),d=e==="left"?-Y:Y}return{titleX:g,titleY:p,maxWidth:f,rotation:d}}class Yt extends Lt{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:n,_suggestedMax:s}=this;return t=at(t,Number.POSITIVE_INFINITY),e=at(e,Number.NEGATIVE_INFINITY),n=at(n,Number.POSITIVE_INFINITY),s=at(s,Number.NEGATIVE_INFINITY),{min:at(t,n),max:at(e,s),minDefined:X(t),maxDefined:X(e)}}getMinMax(t){let{min:e,max:n,minDefined:s,maxDefined:o}=this.getUserBounds(),r;if(s&&o)return{min:e,max:n};const a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)r=a[l].controller.getMinMax(this,t),s||(e=Math.min(e,r.min)),o||(n=Math.max(n,r.max));return e=o&&e>n?n:e,n=s&&e>n?e:n,{min:at(e,at(n,e)),max:at(n,at(e,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){N(this.options.beforeUpdate,[this])}update(t,e,n){const{beginAtZero:s,grace:o,ticks:r}=this.options,a=r.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=tr(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?Wn(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||r.source==="auto")&&(this.ticks=Da(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,n;this.isHorizontal()?(e=this.left,n=this.right):(e=this.top,n=this.bottom,t=!t),this._startPixel=e,this._endPixel=n,this._reversePixels=t,this._length=n-e,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){const e=this.options.ticks;let n,s,o;for(n=0,s=t.length;n<s;n++)o=t[n],o.label=N(e.callback,[o.value,n,t],this)}afterTickToLabelConversion(){N(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){N(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,n=Vn(this.ticks.length,t.ticks.maxTicksLimit),s=e.minRotation||0,o=e.maxRotation;let r=s,a,l,c;if(!this._isVisible()||!e.display||s>=o||n<=1||!this.isHorizontal()){this.labelRotation=s;return}const h=this._getLabelSizes(),d=h.widest.width,f=h.highest.height,g=J(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/n:g/(n-1),d+6>a&&(a=g/(n-(t.offset?.5:1)),l=this.maxHeight-le(t.grid)-e.padding-Hn(t.title,this.chart.options.font),c=Math.sqrt(d*d+f*f),r=Ge(Math.min(Math.asin(J((h.highest.height+6)/a,-1,1)),Math.asin(J(l/c,-1,1))-Math.asin(J(f/c,-1,1)))),r=Math.max(s,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){N(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){N(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:n,title:s,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){const l=Hn(s,e.options.font);if(a?(t.width=this.maxWidth,t.height=le(o)+l):(t.height=this.maxHeight,t.width=le(o)+l),n.display&&this.ticks.length){const{first:c,last:h,widest:d,highest:f}=this._getLabelSizes(),g=n.padding*2,p=rt(this.labelRotation),b=Math.cos(p),m=Math.sin(p);if(a){const x=n.mirror?0:m*d.width+b*f.height;t.height=Math.min(this.maxHeight,t.height+x+g)}else{const x=n.mirror?0:b*d.width+m*f.height;t.width=Math.min(this.maxWidth,t.width+x+g)}this._calculatePadding(c,h,m,b)}}this._handleMargins(),a?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,n,s){const{ticks:{align:o,padding:r},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const h=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,g=0;l?c?(f=s*t.width,g=n*e.height):(f=n*t.height,g=s*e.width):o==="start"?g=e.width:o==="end"?f=t.width:o!=="inner"&&(f=t.width/2,g=e.width/2),this.paddingLeft=Math.max((f-h+r)*this.width/(this.width-h),0),this.paddingRight=Math.max((g-d+r)*this.width/(this.width-d),0)}else{let h=e.height/2,d=t.height/2;o==="start"?(h=0,d=t.height):o==="end"&&(h=e.height,d=0),this.paddingTop=h+r,this.paddingBottom=d+r}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){N(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,n;for(e=0,n=t.length;e<n;e++)z(t[e].label)&&(t.splice(e,1),n--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let n=this.ticks;e<n.length&&(n=Wn(n,e)),this._labelSizes=t=this._computeLabelSizes(n,n.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,n){const{ctx:s,_longestTextCache:o}=this,r=[],a=[],l=Math.floor(e/Vn(e,n));let c=0,h=0,d,f,g,p,b,m,x,_,w,v,y;for(d=0;d<e;d+=l){if(p=t[d].label,b=this._resolveTickFontOptions(d),s.font=m=b.string,x=o[m]=o[m]||{data:{},gc:[]},_=b.lineHeight,w=v=0,!z(p)&&!j(p))w=_e(s,x.data,x.gc,w,p),v=_;else if(j(p))for(f=0,g=p.length;f<g;++f)y=p[f],!z(y)&&!j(y)&&(w=_e(s,x.data,x.gc,w,y),v+=_);r.push(w),a.push(v),c=Math.max(w,c),h=Math.max(v,h)}Ba(o,e);const k=r.indexOf(c),S=a.indexOf(h),M=C=>({width:r[C]||0,height:a[C]||0});return{first:M(0),last:M(e-1),widest:M(k),highest:M(S),widths:r,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return Mo(this._alignToPixels?At(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const n=e[t];return n.$context||(n.$context=Ia(this.getContext(),t,n))}return this.$context||(this.$context=za(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=rt(this.labelRotation),n=Math.abs(Math.cos(e)),s=Math.abs(Math.sin(e)),o=this._getLabelSizes(),r=t.autoSkipPadding||0,a=o?o.widest.width+r:0,l=o?o.highest.height+r:0;return this.isHorizontal()?l*n>a*s?a/n:l/s:l*s<a*n?l/n:a/s}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,n=this.chart,s=this.options,{grid:o,position:r,border:a}=s,l=o.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),f=le(o),g=[],p=a.setContext(this.getContext()),b=p.display?p.width:0,m=b/2,x=function(E){return At(n,E,b)};let _,w,v,y,k,S,M,C,D,P,O,F;if(r==="top")_=x(this.bottom),S=this.bottom-f,C=_-m,P=x(t.top)+m,F=t.bottom;else if(r==="bottom")_=x(this.top),P=t.top,F=x(t.bottom)-m,S=_+m,C=this.top+f;else if(r==="left")_=x(this.right),k=this.right-f,M=_-m,D=x(t.left)+m,O=t.right;else if(r==="right")_=x(this.left),D=t.left,O=x(t.right)-m,k=_+m,M=this.left+f;else if(e==="x"){if(r==="center")_=x((t.top+t.bottom)/2+.5);else if(R(r)){const E=Object.keys(r)[0],L=r[E];_=x(this.chart.scales[E].getPixelForValue(L))}P=t.top,F=t.bottom,S=_+m,C=S+f}else if(e==="y"){if(r==="center")_=x((t.left+t.right)/2);else if(R(r)){const E=Object.keys(r)[0],L=r[E];_=x(this.chart.scales[E].getPixelForValue(L))}k=_-m,M=k-f,D=t.left,O=t.right}const H=T(s.ticks.maxTicksLimit,d),A=Math.max(1,Math.ceil(d/H));for(w=0;w<d;w+=A){const E=this.getContext(w),L=o.setContext(E),K=a.setContext(E),V=L.lineWidth,ot=L.color,U=K.dash||[],et=K.dashOffset,pt=L.tickWidth,mt=L.tickColor,bt=L.tickBorderDash||[],xt=L.tickBorderDashOffset;v=La(this,w,l),v!==void 0&&(y=At(n,v,V),c?k=M=D=O=y:S=C=P=F=y,g.push({tx1:k,ty1:S,tx2:M,ty2:C,x1:D,y1:P,x2:O,y2:F,width:V,color:ot,borderDash:U,borderDashOffset:et,tickWidth:pt,tickColor:mt,tickBorderDash:bt,tickBorderDashOffset:xt}))}return this._ticksLength=d,this._borderValue=_,g}_computeLabelItems(t){const e=this.axis,n=this.options,{position:s,ticks:o}=n,r=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:h,mirror:d}=o,f=le(n.grid),g=f+h,p=d?-h:g,b=-rt(this.labelRotation),m=[];let x,_,w,v,y,k,S,M,C,D,P,O,F="middle";if(s==="top")k=this.bottom-p,S=this._getXAxisLabelAlignment();else if(s==="bottom")k=this.top+p,S=this._getXAxisLabelAlignment();else if(s==="left"){const A=this._getYAxisLabelAlignment(f);S=A.textAlign,y=A.x}else if(s==="right"){const A=this._getYAxisLabelAlignment(f);S=A.textAlign,y=A.x}else if(e==="x"){if(s==="center")k=(t.top+t.bottom)/2+g;else if(R(s)){const A=Object.keys(s)[0],E=s[A];k=this.chart.scales[A].getPixelForValue(E)+g}S=this._getXAxisLabelAlignment()}else if(e==="y"){if(s==="center")y=(t.left+t.right)/2-g;else if(R(s)){const A=Object.keys(s)[0],E=s[A];y=this.chart.scales[A].getPixelForValue(E)}S=this._getYAxisLabelAlignment(f).textAlign}e==="y"&&(l==="start"?F="top":l==="end"&&(F="bottom"));const H=this._getLabelSizes();for(x=0,_=a.length;x<_;++x){w=a[x],v=w.label;const A=o.setContext(this.getContext(x));M=this.getPixelForTick(x)+o.labelOffset,C=this._resolveTickFontOptions(x),D=C.lineHeight,P=j(v)?v.length:1;const E=P/2,L=A.color,K=A.textStrokeColor,V=A.textStrokeWidth;let ot=S;r?(y=M,S==="inner"&&(x===_-1?ot=this.options.reverse?"left":"right":x===0?ot=this.options.reverse?"right":"left":ot="center"),s==="top"?c==="near"||b!==0?O=-P*D+D/2:c==="center"?O=-H.highest.height/2-E*D+D:O=-H.highest.height+D/2:c==="near"||b!==0?O=D/2:c==="center"?O=H.highest.height/2-E*D:O=H.highest.height-P*D,d&&(O*=-1),b!==0&&!A.showLabelBackdrop&&(y+=D/2*Math.sin(b))):(k=M,O=(1-P)*D/2);let U;if(A.showLabelBackdrop){const et=Q(A.backdropPadding),pt=H.heights[x],mt=H.widths[x];let bt=O-et.top,xt=0-et.left;switch(F){case"middle":bt-=pt/2;break;case"bottom":bt-=pt;break}switch(S){case"center":xt-=mt/2;break;case"right":xt-=mt;break;case"inner":x===_-1?xt-=mt:x>0&&(xt-=mt/2);break}U={left:xt,top:bt,width:mt+et.width,height:pt+et.height,color:A.backdropColor}}m.push({label:v,font:C,textOffset:O,options:{rotation:b,color:L,strokeColor:K,strokeWidth:V,textAlign:ot,textBaseline:F,translation:[y,k],backdrop:U}})}return m}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-rt(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){const{position:e,ticks:{crossAlign:n,mirror:s,padding:o}}=this.options,r=this._getLabelSizes(),a=t+o,l=r.widest.width;let c,h;return e==="left"?s?(h=this.right+o,n==="near"?c="left":n==="center"?(c="center",h+=l/2):(c="right",h+=l)):(h=this.right-a,n==="near"?c="right":n==="center"?(c="center",h-=l/2):(c="left",h=this.left)):e==="right"?s?(h=this.left+o,n==="near"?c="right":n==="center"?(c="center",h-=l/2):(c="left",h-=l)):(h=this.left+a,n==="near"?c="left":n==="center"?(c="center",h+=l/2):(c="right",h=this.right)):c="right",{textAlign:c,x:h}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:n,top:s,width:o,height:r}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(n,s,o,r),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const s=this.ticks.findIndex(o=>o.value===t);return s>=0?e.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const e=this.options.grid,n=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,r;const a=(l,c,h)=>{!h.width||!h.color||(n.save(),n.lineWidth=h.width,n.strokeStyle=h.color,n.setLineDash(h.borderDash||[]),n.lineDashOffset=h.borderDashOffset,n.beginPath(),n.moveTo(l.x,l.y),n.lineTo(c.x,c.y),n.stroke(),n.restore())};if(e.display)for(o=0,r=s.length;o<r;++o){const l=s[o];e.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),e.drawTicks&&a({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(){const{chart:t,ctx:e,options:{border:n,grid:s}}=this,o=n.setContext(this.getContext()),r=n.display?o.width:0;if(!r)return;const a=s.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,h,d,f;this.isHorizontal()?(c=At(t,this.left,r)-r/2,h=At(t,this.right,a)+a/2,d=f=l):(d=At(t,this.top,r)-r/2,f=At(t,this.bottom,a)+a/2,c=h=l),e.save(),e.lineWidth=o.width,e.strokeStyle=o.color,e.beginPath(),e.moveTo(c,d),e.lineTo(h,f),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const n=this.ctx,s=this._computeLabelArea();s&&ke(n,s);const o=this.getLabelItems(t);for(const r of o){const a=r.options,l=r.font,c=r.label,h=r.textOffset;Vt(n,c,0,h,l,a)}s&&we(n)}drawTitle(){const{ctx:t,options:{position:e,title:n,reverse:s}}=this;if(!n.display)return;const o=q(n.font),r=Q(n.padding),a=n.align;let l=o.lineHeight/2;e==="bottom"||e==="center"||R(e)?(l+=r.bottom,j(n.text)&&(l+=o.lineHeight*(n.text.length-1))):l+=r.top;const{titleX:c,titleY:h,maxWidth:d,rotation:f}=Na(this,l,e,a);Vt(t,n.text,0,0,o,{color:n.color,maxWidth:d,rotation:f,textAlign:Fa(a,e,s),textBaseline:"middle",translation:[c,h]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,n=T(t.grid&&t.grid.z,-1),s=T(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Yt.prototype.draw?[{z:e,draw:o=>{this.draw(o)}}]:[{z:n,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:e,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+"AxisID",s=[];let o,r;for(o=0,r=e.length;o<r;++o){const a=e[o];a[n]===this.id&&(!t||a.type===t)&&s.push(a)}return s}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return q(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Be{constructor(t,e,n){this.type=t,this.scope=e,this.override=n,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let n;Ha(e)&&(n=this.register(e));const s=this.items,o=t.id,r=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in s||(s[o]=t,Va(t,r,n),this.override&&$.override(t.id,t.overrides)),r}get(t){return this.items[t]}unregister(t){const e=this.items,n=t.id,s=this.scope;n in e&&delete e[n],s&&n in $[s]&&(delete $[s][n],this.override&&delete Pt[n])}}function Va(i,t,e){const n=Gt(Object.create(null),[e?$.get(e):{},$.get(t),i.defaults]);$.set(t,n),i.defaultRoutes&&Wa(t,i.defaultRoutes),i.descriptors&&$.describe(t,i.descriptors)}function Wa(i,t){Object.keys(t).forEach(e=>{const n=e.split("."),s=n.pop(),o=[i].concat(n).join("."),r=t[e].split("."),a=r.pop(),l=r.join(".");$.route(o,s,l,a)})}function Ha(i){return"id"in i&&"defaults"in i}class ja{constructor(){this.controllers=new Be(Ae,"datasets",!0),this.elements=new Be(Lt,"elements"),this.plugins=new Be(Object,"plugins"),this.scales=new Be(Yt,"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,n){[...e].forEach(s=>{const o=n||this._getRegistryForType(s);n||o.isForType(s)||o===this.plugins&&s.id?this._exec(t,o,s):I(s,r=>{const a=n||this._getRegistryForType(r);this._exec(t,a,r)})})}_exec(t,e,n){const s=Ke(t);N(n["before"+s],[],n),e[t](n),N(n["after"+s],[],n)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const n=this._typedRegistries[e];if(n.isForType(t))return n}return this.plugins}_get(t,e,n){const s=e.get(t);if(s===void 0)throw new Error('"'+t+'" is not a registered '+n+".");return s}}var lt=new ja;class $a{constructor(){this._init=void 0}notify(t,e,n,s){if(e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),this._init===void 0)return;const o=s?this._descriptors(t).filter(s):this._descriptors(t),r=this._notify(o,t,e,n);return e==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),r}_notify(t,e,n,s){s=s||{};for(const o of t){const r=o.plugin,a=r[n],l=[e,s,o.options];if(N(a,l,r)===!1&&s.cancelable)return!1}return!0}invalidate(){z(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const n=t&&t.config,s=T(n.options&&n.options.plugins,{}),o=Ya(n);return s===!1&&!e?[]:Xa(t,o,s,e)}_notifyStateChanges(t){const e=this._oldCache||[],n=this._cache,s=(o,r)=>o.filter(a=>!r.some(l=>a.plugin.id===l.plugin.id));this._notify(s(e,n),t,"stop"),this._notify(s(n,e),t,"start")}}function Ya(i){const t={},e=[],n=Object.keys(lt.plugins.items);for(let o=0;o<n.length;o++)e.push(lt.getPlugin(n[o]));const s=i.plugins||[];for(let o=0;o<s.length;o++){const r=s[o];e.indexOf(r)===-1&&(e.push(r),t[r.id]=!0)}return{plugins:e,localIds:t}}function Ua(i,t){return!t&&i===!1?null:i===!0?{}:i}function Xa(i,{plugins:t,localIds:e},n,s){const o=[],r=i.getContext();for(const a of t){const l=a.id,c=Ua(n[l],s);c!==null&&o.push({plugin:a,options:qa(i.config,{plugin:a,local:e[l]},c,r)})}return o}function qa(i,{plugin:t,local:e},n,s){const o=i.pluginScopeKeys(t),r=i.getOptionScopes(n,o);return e&&t.defaults&&r.push(t.defaults),i.createResolver(r,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function xi(i,t){const e=$.datasets[i]||{};return((t.datasets||{})[i]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function Ka(i,t){let e=i;return i==="_index_"?e=t:i==="_value_"&&(e=t==="x"?"y":"x"),e}function Ga(i,t){return i===t?"_index_":"_value_"}function jn(i){if(i==="x"||i==="y"||i==="r")return i}function Ja(i){if(i==="top"||i==="bottom")return"x";if(i==="left"||i==="right")return"y"}function yi(i,...t){if(jn(i))return i;for(const e of t){const n=e.axis||Ja(e.position)||i.length>1&&jn(i[0].toLowerCase());if(n)return n}throw new Error(`Cannot determine type of '${i}' axis. Please provide 'axis' or 'position' option.`)}function $n(i,t,e){if(e[t+"AxisID"]===i)return{axis:t}}function Qa(i,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(n=>n.xAxisID===i||n.yAxisID===i);if(e.length)return $n(i,"x",e[0])||$n(i,"y",e[0])}return{}}function Za(i,t){const e=Pt[i.type]||{scales:{}},n=t.scales||{},s=xi(i.type,t),o=Object.create(null);return Object.keys(n).forEach(r=>{const a=n[r];if(!R(a))return console.error(`Invalid scale configuration for scale: ${r}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);const l=yi(r,a,Qa(r,i),$.scales[a.type]),c=Ga(l,s),h=e.scales||{};o[r]=Jt(Object.create(null),[{axis:l},a,h[l],h[c]])}),i.data.datasets.forEach(r=>{const a=r.type||i.type,l=r.indexAxis||xi(a,t),h=(Pt[a]||{}).scales||{};Object.keys(h).forEach(d=>{const f=Ka(d,l),g=r[f+"AxisID"]||f;o[g]=o[g]||Object.create(null),Jt(o[g],[{axis:f},n[g],h[d]])})}),Object.keys(o).forEach(r=>{const a=o[r];Jt(a,[$.scales[a.type],$.scale])}),o}function Yn(i){const t=i.options||(i.options={});t.plugins=T(t.plugins,{}),t.scales=Za(i,t)}function Un(i){return i=i||{},i.datasets=i.datasets||[],i.labels=i.labels||[],i}function tl(i){return i=i||{},i.data=Un(i.data),Yn(i),i}const Xn=new Map,qn=new Set;function ze(i,t){let e=Xn.get(i);return e||(e=t(),Xn.set(i,e),qn.add(e)),e}const ce=(i,t,e)=>{const n=Ft(t,e);n!==void 0&&i.add(n)};class el{constructor(t){this._config=tl(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=Un(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),Yn(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return ze(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return ze(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return ze(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,n=this.type;return ze(`${n}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const n=this._scopeCache;let s=n.get(t);return(!s||e)&&(s=new Map,n.set(t,s)),s}getOptionScopes(t,e,n){const{options:s,type:o}=this,r=this._cachedScopes(t,n),a=r.get(e);if(a)return a;const l=new Set;e.forEach(h=>{t&&(l.add(t),h.forEach(d=>ce(l,t,d))),h.forEach(d=>ce(l,s,d)),h.forEach(d=>ce(l,Pt[o]||{},d)),h.forEach(d=>ce(l,$,d)),h.forEach(d=>ce(l,ii,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),qn.has(e)&&r.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,Pt[e]||{},$.datasets[e]||{},{type:e},$,ii]}resolveNamedOptions(t,e,n,s=[""]){const o={$shared:!0},{resolver:r,subPrefixes:a}=Kn(this._resolverCache,t,s);let l=r;if(nl(r,e)){o.$shared=!1,n=kt(n)?n():n;const c=this.createResolver(t,n,a);l=Ht(r,n,c)}for(const c of e)o[c]=l[c];return o}createResolver(t,e,n=[""],s){const{resolver:o}=Kn(this._resolverCache,t,n);return R(e)?Ht(o,e,void 0,s):o}}function Kn(i,t,e){let n=i.get(t);n||(n=new Map,i.set(t,n));const s=e.join();let o=n.get(s);return o||(o={resolver:ri(t,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},n.set(s,o)),o}const il=i=>R(i)&&Object.getOwnPropertyNames(i).some(t=>kt(i[t]));function nl(i,t){const{isScriptable:e,isIndexable:n}=en(i);for(const s of t){const o=e(s),r=n(s),a=(r||o)&&i[s];if(o&&(kt(a)||il(a))||r&&j(a))return!0}return!1}var sl="4.5.1";const ol=["top","bottom","left","right","chartArea"];function Gn(i,t){return i==="top"||i==="bottom"||ol.indexOf(i)===-1&&t==="x"}function Jn(i,t){return function(e,n){return e[i]===n[i]?e[t]-n[t]:e[i]-n[i]}}function Qn(i){const t=i.chart,e=t.options.animation;t.notifyPlugins("afterRender"),N(e&&e.onComplete,[i],t)}function rl(i){const t=i.chart,e=t.options.animation;N(e&&e.onProgress,[i],t)}function Zn(i){return ci()&&typeof i=="string"?i=document.getElementById(i):i&&i.length&&(i=i[0]),i&&i.canvas&&(i=i.canvas),i}const Ie={},ts=i=>{const t=Zn(i);return Object.values(Ie).filter(e=>e.canvas===t).pop()};function al(i,t,e){const n=Object.keys(i);for(const s of n){const o=+s;if(o>=t){const r=i[s];delete i[s],(e>0||o>t)&&(i[o+e]=r)}}}function ll(i,t,e,n){return!e||i.type==="mouseout"?null:n?t:i}class Bt{static defaults=$;static instances=Ie;static overrides=Pt;static registry=lt;static version=sl;static getChart=ts;static register(...t){lt.add(...t),es()}static unregister(...t){lt.remove(...t),es()}constructor(t,e){const n=this.config=new el(e),s=Zn(t),o=ts(s);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const r=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||Ca(s)),this.platform.updateConfig(n);const a=this.platform.acquireContext(s,r.aspectRatio),l=a&&a.canvas,c=l&&l.height,h=l&&l.width;if(this.id=co(),this.ctx=a,this.canvas=l,this.width=h,this.height=c,this._options=r,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new $a,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Ao(d=>this.update(d),r.resizeDelay||0),this._dataChanges=[],Ie[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}ut.listen(this,"complete",Qn),ut.listen(this,"progress",rl),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:n,height:s,_aspectRatio:o}=this;return z(t)?e&&o?o:s?n/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return lt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():cn(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Zi(this.canvas,this.ctx),this}stop(){return ut.stop(this),this}resize(t,e){ut.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const n=this.options,s=this.canvas,o=n.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(s,t,e,o),a=n.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,cn(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),N(n.onResize,[this,r],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};I(e,(n,s)=>{n.id=s})}buildOrUpdateScales(){const t=this.options,e=t.scales,n=this.scales,s=Object.keys(n).reduce((r,a)=>(r[a]=!1,r),{});let o=[];e&&(o=o.concat(Object.keys(e).map(r=>{const a=e[r],l=yi(r,a),c=l==="r",h=l==="x";return{options:a,dposition:c?"chartArea":h?"bottom":"left",dtype:c?"radialLinear":h?"category":"linear"}}))),I(o,r=>{const a=r.options,l=a.id,c=yi(l,a),h=T(a.type,r.dtype);(a.position===void 0||Gn(a.position,c)!==Gn(r.dposition))&&(a.position=r.dposition),s[l]=!0;let d=null;if(l in n&&n[l].type===h)d=n[l];else{const f=lt.getScale(h);d=new f({id:l,type:h,ctx:this.ctx,chart:this}),n[d.id]=d}d.init(a,t)}),I(s,(r,a)=>{r||delete n[a]}),I(n,r=>{Mt.configure(this,r,r.options),Mt.addBox(this,r)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,n=t.length;if(t.sort((s,o)=>s.index-o.index),n>e){for(let s=e;s<n;++s)this._destroyDatasetMeta(s);t.splice(e,n-e)}this._sortedMetasets=t.slice(0).sort(Jn("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((n,s)=>{e.filter(o=>o===n._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let n,s;for(this._removeUnreferencedMetasets(),n=0,s=e.length;n<s;n++){const o=e[n];let r=this.getDatasetMeta(n);const a=o.type||this.config.type;if(r.type&&r.type!==a&&(this._destroyDatasetMeta(n),r=this.getDatasetMeta(n)),r.type=a,r.indexAxis=o.indexAxis||xi(a,this.options),r.order=o.order||0,r.index=n,r.label=""+o.label,r.visible=this.isDatasetVisible(n),r.controller)r.controller.updateIndex(n),r.controller.linkScales();else{const l=lt.getController(a),{datasetElementType:c,dataElementType:h}=$.datasets[a];Object.assign(l,{dataElementType:lt.getElement(h),datasetElementType:c&&lt.getElement(c)}),r.controller=new l(this,n),t.push(r.controller)}}return this._updateMetasets(),t}_resetElements(){I(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const n=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let c=0,h=this.data.datasets.length;c<h;c++){const{controller:d}=this.getDatasetMeta(c),f=!s&&o.indexOf(d)===-1;d.buildOrUpdateElements(f),r=Math.max(+d.getMaxOverflow(),r)}r=this._minPadding=n.layout.autoPadding?r:0,this._updateLayout(r),s||I(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Jn("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){I(this.scales,t=>{Mt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),n=new Set(t.events);(!Fi(e,n)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:n,start:s,count:o}of e){const r=n==="_removeElements"?-o:o;al(t,s,r)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,n=o=>new Set(t.filter(r=>r[0]===o).map((r,a)=>a+","+r.splice(1).join(","))),s=n(0);for(let o=1;o<e;o++)if(!Fi(s,n(o)))return;return Array.from(s).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;Mt.update(this,this.width,this.height,t);const e=this.chartArea,n=e.width<=0||e.height<=0;this._layers=[],I(this.boxes,s=>{n&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,o)=>{s._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,n=this.data.datasets.length;e<n;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,n=this.data.datasets.length;e<n;++e)this._updateDataset(e,kt(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const n=this.getDatasetMeta(t),s={meta:n,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(n.controller._update(e),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(ut.has(this)?this.attached&&!ut.running(this)&&ut.start(this):(this.draw(),Qn({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:n,height:s}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(n,s)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,n=[];let s,o;for(s=0,o=e.length;s<o;++s){const r=e[s];(!t||r.visible)&&n.push(r)}return n}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,n={meta:t,index:t.index,cancelable:!0},s=yn(this,t);this.notifyPlugins("beforeDatasetDraw",n)!==!1&&(s&&ke(e,s),t.controller.draw(),s&&we(e),n.cancelable=!1,this.notifyPlugins("afterDatasetDraw",n))}isPointInArea(t){return ft(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,n,s){const o=oa.modes[e];return typeof o=="function"?o(this,t,n,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],n=this._metasets;let s=n.filter(o=>o&&o._dataset===e).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},n.push(s)),s}getContext(){return this.$context||(this.$context=wt(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const n=this.getDatasetMeta(t);return typeof n.hidden=="boolean"?!n.hidden:!e.hidden}setDatasetVisibility(t,e){const n=this.getDatasetMeta(t);n.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,n){const s=n?"show":"hide",o=this.getDatasetMeta(t),r=o.controller._resolveAnimations(void 0,s);me(e)?(o.data[e].hidden=!n,this.update()):(this.setDatasetVisibility(t,n),r.update(o,{visible:n}),this.update(a=>a.datasetIndex===t?s:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),ut.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),Zi(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete Ie[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,n=(o,r)=>{e.addEventListener(this,o,r),t[o]=r},s=(o,r,a)=>{o.offsetX=r,o.offsetY=a,this._eventHandler(o)};I(this.options.events,o=>n(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,n=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let r;const a=()=>{s("attach",a),this.attached=!0,this.resize(),n("resize",o),n("detach",r)};r=()=>{this.attached=!1,s("resize",o),this._stop(),this._resize(0,0),n("attach",a)},e.isAttached(this.canvas)?a():r()}unbindEvents(){I(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},I(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,n){const s=n?"set":"remove";let o,r,a,l;for(e==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+s+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){r=t[a];const c=r&&this.getDatasetMeta(r.datasetIndex).controller;c&&c[s+"HoverStyle"](r.element,r.datasetIndex,r.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],n=t.map(({datasetIndex:o,index:r})=>{const a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[r],index:r}});!ge(n,e)&&(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,e))}notifyPlugins(t,e,n){return this._plugins.notify(this,t,e,n)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,n){const s=this.options.hover,o=(l,c)=>l.filter(h=>!c.some(d=>h.datasetIndex===d.datasetIndex&&h.index===d.index)),r=o(e,t),a=n?t:o(t,e);r.length&&this.updateHoverStyle(r,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,e){const n={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=r=>(r.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",n,s)===!1)return;const o=this._handleEvent(t,e,n.inChartArea);return n.cancelable=!1,this.notifyPlugins("afterEvent",n,s),(o||n.changed)&&this.render(),this}_handleEvent(t,e,n){const{_active:s=[],options:o}=this,r=e,a=this._getActiveElements(t,s,n,r),l=mo(t),c=ll(t,this._lastEvent,n,l);n&&(this._lastEvent=null,N(o.onHover,[t,a,this],this),l&&N(o.onClick,[t,a,this],this));const h=!ge(a,s);return(h||e)&&(this._active=a,this._updateHoverStyles(a,s,e)),this._lastEvent=c,h}_getActiveElements(t,e,n,s){if(t.type==="mouseout")return[];if(!n)return e;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,s)}}function es(){return I(Bt.instances,i=>i._plugins.invalidate())}function cl(i,t,e){const{startAngle:n,x:s,y:o,outerRadius:r,innerRadius:a,options:l}=t,{borderWidth:c,borderJoinStyle:h}=l,d=Math.min(c/r,G(n-e));if(i.beginPath(),i.arc(s,o,r-c/2,n+d/2,e-d/2),a>0){const f=Math.min(c/a,G(n-e));i.arc(s,o,a+c/2,e-f/2,n+f/2,!0)}else{const f=Math.min(c/2,r*G(n-e));if(h==="round")i.arc(s,o,f,e-B/2,n+B/2,!0);else if(h==="bevel"){const g=2*f*f,p=-g*Math.cos(e+B/2)+s,b=-g*Math.sin(e+B/2)+o,m=g*Math.cos(n+B/2)+s,x=g*Math.sin(n+B/2)+o;i.lineTo(p,b),i.lineTo(m,x)}}i.closePath(),i.moveTo(0,0),i.rect(0,0,i.canvas.width,i.canvas.height),i.clip("evenodd")}function hl(i,t,e){const{startAngle:n,pixelMargin:s,x:o,y:r,outerRadius:a,innerRadius:l}=t;let c=s/a;i.beginPath(),i.arc(o,r,a,n-c,e+c),l>s?(c=s/l,i.arc(o,r,l,e+c,n-c,!0)):i.arc(o,r,s,e+Y,n-Y),i.closePath(),i.clip()}function dl(i){return oi(i,["outerStart","outerEnd","innerStart","innerEnd"])}function fl(i,t,e,n){const s=dl(i.options.borderRadius),o=(e-t)/2,r=Math.min(o,n*t/2),a=l=>{const c=(e-Math.min(o,l))*n/2;return J(l,0,Math.min(o,c))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:J(s.innerStart,0,r),innerEnd:J(s.innerEnd,0,r)}}function Ut(i,t,e,n){return{x:e+i*Math.cos(t),y:n+i*Math.sin(t)}}function Fe(i,t,e,n,s,o){const{x:r,y:a,startAngle:l,pixelMargin:c,innerRadius:h}=t,d=Math.max(t.outerRadius+n+e-c,0),f=h>0?h+n+e+c:0;let g=0;const p=s-l;if(n){const A=h>0?h-n:0,E=d>0?d-n:0,L=(A+E)/2,K=L!==0?p*L/(L+n):p;g=(p-K)/2}const b=Math.max(.001,p*d-e/B)/d,m=(p-b)/2,x=l+m+g,_=s-m-g,{outerStart:w,outerEnd:v,innerStart:y,innerEnd:k}=fl(t,f,d,_-x),S=d-w,M=d-v,C=x+w/S,D=_-v/M,P=f+y,O=f+k,F=x+y/P,H=_-k/O;if(i.beginPath(),o){const A=(C+D)/2;if(i.arc(r,a,d,C,A),i.arc(r,a,d,A,D),v>0){const V=Ut(M,D,r,a);i.arc(V.x,V.y,v,D,_+Y)}const E=Ut(O,_,r,a);if(i.lineTo(E.x,E.y),k>0){const V=Ut(O,H,r,a);i.arc(V.x,V.y,k,_+Y,H+Math.PI)}const L=(_-k/f+(x+y/f))/2;if(i.arc(r,a,f,_-k/f,L,!0),i.arc(r,a,f,L,x+y/f,!0),y>0){const V=Ut(P,F,r,a);i.arc(V.x,V.y,y,F+Math.PI,x-Y)}const K=Ut(S,x,r,a);if(i.lineTo(K.x,K.y),w>0){const V=Ut(S,C,r,a);i.arc(V.x,V.y,w,x-Y,C)}}else{i.moveTo(r,a);const A=Math.cos(C)*d+r,E=Math.sin(C)*d+a;i.lineTo(A,E);const L=Math.cos(D)*d+r,K=Math.sin(D)*d+a;i.lineTo(L,K)}i.closePath()}function ul(i,t,e,n,s){const{fullCircles:o,startAngle:r,circumference:a}=t;let l=t.endAngle;if(o){Fe(i,t,e,n,l,s);for(let c=0;c<o;++c)i.fill();isNaN(a)||(l=r+(a%W||W))}return Fe(i,t,e,n,l,s),i.fill(),l}function gl(i,t,e,n,s){const{fullCircles:o,startAngle:r,circumference:a,options:l}=t,{borderWidth:c,borderJoinStyle:h,borderDash:d,borderDashOffset:f,borderRadius:g}=l,p=l.borderAlign==="inner";if(!c)return;i.setLineDash(d||[]),i.lineDashOffset=f,p?(i.lineWidth=c*2,i.lineJoin=h||"round"):(i.lineWidth=c,i.lineJoin=h||"bevel");let b=t.endAngle;if(o){Fe(i,t,e,n,b,s);for(let m=0;m<o;++m)i.stroke();isNaN(a)||(b=r+(a%W||W))}p&&hl(i,t,b),l.selfJoin&&b-r>=B&&g===0&&h!=="miter"&&cl(i,t,b),o||(Fe(i,t,e,n,b,s),i.stroke())}class is extends Lt{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,selfJoin:!1};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,n){const s=this.getProps(["x","y"],n),{angle:o,distance:r}=ji(s,{x:t,y:e}),{startAngle:a,endAngle:l,innerRadius:c,outerRadius:h,circumference:d}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],n),f=(this.options.spacing+this.options.borderWidth)/2,g=T(d,l-a),p=te(o,a,l)&&a!==l,b=g>=W||p,m=Ct(r,c+f,h+f);return b&&m}getCenterPoint(t){const{x:e,y:n,startAngle:s,endAngle:o,innerRadius:r,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:l,spacing:c}=this.options,h=(s+o)/2,d=(r+a+c+l)/2;return{x:e+Math.cos(h)*d,y:n+Math.sin(h)*d}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:n}=this,s=(e.offset||0)/4,o=(e.spacing||0)/2,r=e.circular;if(this.pixelMargin=e.borderAlign==="inner"?.33:0,this.fullCircles=n>W?Math.floor(n/W):0,n===0||this.innerRadius<0||this.outerRadius<0)return;t.save();const a=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(a)*s,Math.sin(a)*s);const l=1-Math.sin(Math.min(B,n||0)),c=s*l;t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,ul(t,this,c,o,r),gl(t,this,c,o,r),t.restore()}}function ns(i,t,e=t){i.lineCap=T(e.borderCapStyle,t.borderCapStyle),i.setLineDash(T(e.borderDash,t.borderDash)),i.lineDashOffset=T(e.borderDashOffset,t.borderDashOffset),i.lineJoin=T(e.borderJoinStyle,t.borderJoinStyle),i.lineWidth=T(e.borderWidth,t.borderWidth),i.strokeStyle=T(e.borderColor,t.borderColor)}function pl(i,t,e){i.lineTo(e.x,e.y)}function ml(i){return i.stepped?$o:i.tension||i.cubicInterpolationMode==="monotone"?Yo:pl}function ss(i,t,e={}){const n=i.length,{start:s=0,end:o=n-1}=e,{start:r,end:a}=t,l=Math.max(s,r),c=Math.min(o,a),h=s<r&&o<r||s>a&&o>a;return{count:n,start:l,loop:t.loop,ilen:c<l&&!h?n+c-l:c-l}}function bl(i,t,e,n){const{points:s,options:o}=t,{count:r,start:a,loop:l,ilen:c}=ss(s,e,n),h=ml(o);let{move:d=!0,reverse:f}=n||{},g,p,b;for(g=0;g<=c;++g)p=s[(a+(f?c-g:g))%r],!p.skip&&(d?(i.moveTo(p.x,p.y),d=!1):h(i,b,p,f,o.stepped),b=p);return l&&(p=s[(a+(f?c:0))%r],h(i,b,p,f,o.stepped)),!!l}function xl(i,t,e,n){const s=t.points,{count:o,start:r,ilen:a}=ss(s,e,n),{move:l=!0,reverse:c}=n||{};let h=0,d=0,f,g,p,b,m,x;const _=v=>(r+(c?a-v:v))%o,w=()=>{b!==m&&(i.lineTo(h,m),i.lineTo(h,b),i.lineTo(h,x))};for(l&&(g=s[_(0)],i.moveTo(g.x,g.y)),f=0;f<=a;++f){if(g=s[_(f)],g.skip)continue;const v=g.x,y=g.y,k=v|0;k===p?(y<b?b=y:y>m&&(m=y),h=(d*h+v)/++d):(w(),i.lineTo(v,y),p=k,d=0,b=m=y),x=y}w()}function _i(i){const t=i.options,e=t.borderDash&&t.borderDash.length;return!i._decimated&&!i._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?xl:bl}function yl(i){return i.stepped?vr:i.tension||i.cubicInterpolationMode==="monotone"?Cr:Et}function _l(i,t,e,n){let s=t._path;s||(s=t._path=new Path2D,t.path(s,e,n)&&s.closePath()),ns(i,t.options),i.stroke(s)}function kl(i,t,e,n){const{segments:s,options:o}=t,r=_i(t);for(const a of s)ns(i,o,a.style),i.beginPath(),r(i,t,a,{start:e,end:e+n-1})&&i.closePath(),i.stroke()}const wl=typeof Path2D=="function";function Sl(i,t,e,n){wl&&!t.options.segment?_l(i,t,e,n):kl(i,t,e,n)}class Ne extends Lt{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){const n=this.options;if((n.tension||n.cubicInterpolationMode==="monotone")&&!n.stepped&&!this._pointsUpdated){const s=n.spanGaps?this._loop:this._fullLoop;br(this._points,n,t,s,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Er(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,n=t.length;return n&&e[t[n-1].end]}interpolate(t,e){const n=this.options,s=t[e],o=this.points,r=mn(this,{property:e,start:s,end:s});if(!r.length)return;const a=[],l=yl(n);let c,h;for(c=0,h=r.length;c<h;++c){const{start:d,end:f}=r[c],g=o[d],p=o[f];if(g===p){a.push(g);continue}const b=Math.abs((s-g[e])/(p[e]-g[e])),m=l(g,p,b,n.stepped);m[e]=t[e],a.push(m)}return a.length===1?a[0]:a}pathSegment(t,e,n){return _i(this)(t,this,e,n)}path(t,e,n){const s=this.segments,o=_i(this);let r=this._loop;e=e||0,n=n||this.points.length-e;for(const a of s)r&=o(t,this,a,{start:e,end:e+n-1});return!!r}draw(t,e,n,s){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),Sl(t,this,n,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function os(i,t,e,n){const s=i.options,{[e]:o}=i.getProps([e],n);return Math.abs(t-o)<s.radius+s.hitRadius}class Ml extends Lt{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,n){const s=this.options,{x:o,y:r}=this.getProps(["x","y"],n);return Math.pow(t-o,2)+Math.pow(e-r,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(t,e){return os(this,t,"x",e)}inYRange(t,e){return os(this,t,"y",e)}getCenterPoint(t){const{x:e,y:n}=this.getProps(["x","y"],t);return{x:e,y:n}}size(t){t=t||this.options||{};let e=t.radius||0;e=Math.max(e,e&&t.hoverRadius||0);const n=e&&t.borderWidth||0;return(e+n)*2}draw(t,e){const n=this.options;this.skip||n.radius<.1||!ft(this,e,this.size(n)/2)||(t.strokeStyle=n.borderColor,t.lineWidth=n.borderWidth,t.fillStyle=n.backgroundColor,si(t,n,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function vl(i,t,e){const n=i.segments,s=i.points,o=t.points,r=[];for(const a of n){let{start:l,end:c}=a;c=Ve(l,c,s);const h=ki(e,s[l],s[c],a.loop);if(!t.segments){r.push({source:a,target:h,start:s[l],end:s[c]});continue}const d=mn(t,h);for(const f of d){const g=ki(e,o[f.start],o[f.end],f.loop),p=pn(a,s,g);for(const b of p)r.push({source:b,target:f,start:{[e]:rs(h,g,"start",Math.max)},end:{[e]:rs(h,g,"end",Math.min)}})}}return r}function ki(i,t,e,n){if(n)return;let s=t[i],o=e[i];return i==="angle"&&(s=G(s),o=G(o)),{property:i,start:s,end:o}}function Cl(i,t){const{x:e=null,y:n=null}=i||{},s=t.points,o=[];return t.segments.forEach(({start:r,end:a})=>{a=Ve(r,a,s);const l=s[r],c=s[a];n!==null?(o.push({x:l.x,y:n}),o.push({x:c.x,y:n})):e!==null&&(o.push({x:e,y:l.y}),o.push({x:e,y:c.y}))}),o}function Ve(i,t,e){for(;t>i;t--){const n=e[t];if(!isNaN(n.x)&&!isNaN(n.y))break}return t}function rs(i,t,e,n){return i&&t?n(i[e],t[e]):i?i[e]:t?t[e]:0}function as(i,t){let e=[],n=!1;return j(i)?(n=!0,e=i):e=Cl(i,t),e.length?new Ne({points:e,options:{tension:0},_loop:n,_fullLoop:n}):null}function ls(i){return i&&i.fill!==!1}function Dl(i,t,e){let s=i[t].fill;const o=[t];let r;if(!e)return s;for(;s!==!1&&o.indexOf(s)===-1;){if(!X(s))return s;if(r=i[s],!r)return!1;if(r.visible)return s;o.push(s),s=r.fill}return!1}function Pl(i,t,e){const n=El(i);if(R(n))return isNaN(n.value)?!1:n;let s=parseFloat(n);return X(s)&&Math.floor(s)===s?Al(n[0],t,s,e):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}function Al(i,t,e,n){return(i==="-"||i==="+")&&(e=t+e),e===t||e<0||e>=n?!1:e}function Ol(i,t){let e=null;return i==="start"?e=t.bottom:i==="end"?e=t.top:R(i)?e=t.getPixelForValue(i.value):t.getBasePixel&&(e=t.getBasePixel()),e}function Tl(i,t,e){let n;return i==="start"?n=e:i==="end"?n=t.options.reverse?t.min:t.max:R(i)?n=i.value:n=t.getBaseValue(),n}function El(i){const t=i.options,e=t.fill;let n=T(e&&e.target,e);return n===void 0&&(n=!!t.backgroundColor),n===!1||n===null?!1:n===!0?"origin":n}function Rl(i){const{scale:t,index:e,line:n}=i,s=[],o=n.segments,r=n.points,a=Ll(t,e);a.push(as({x:null,y:t.bottom},n));for(let l=0;l<o.length;l++){const c=o[l];for(let h=c.start;h<=c.end;h++)Bl(s,r[h],a)}return new Ne({points:s,options:{}})}function Ll(i,t){const e=[],n=i.getMatchingVisibleMetas("line");for(let s=0;s<n.length;s++){const o=n[s];if(o.index===t)break;o.hidden||e.unshift(o.dataset)}return e}function Bl(i,t,e){const n=[];for(let s=0;s<e.length;s++){const o=e[s],{first:r,last:a,point:l}=zl(o,t,"x");if(!(!l||r&&a)){if(r)n.unshift(l);else if(i.push(l),!a)break}}i.push(...n)}function zl(i,t,e){const n=i.interpolate(t,e);if(!n)return{};const s=n[e],o=i.segments,r=i.points;let a=!1,l=!1;for(let c=0;c<o.length;c++){const h=o[c],d=r[h.start][e],f=r[h.end][e];if(Ct(s,d,f)){a=s===d,l=s===f;break}}return{first:a,last:l,point:n}}class cs{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,n){const{x:s,y:o,radius:r}=this;return e=e||{start:0,end:W},t.arc(s,o,r,e.end,e.start,!0),!n.bounds}interpolate(t){const{x:e,y:n,radius:s}=this,o=t.angle;return{x:e+Math.cos(o)*s,y:n+Math.sin(o)*s,angle:o}}}function Il(i){const{chart:t,fill:e,line:n}=i;if(X(e))return Fl(t,e);if(e==="stack")return Rl(i);if(e==="shape")return!0;const s=Nl(i);return s instanceof cs?s:as(s,n)}function Fl(i,t){const e=i.getDatasetMeta(t);return e&&i.isDatasetVisible(t)?e.dataset:null}function Nl(i){return(i.scale||{}).getPointPositionForValue?Wl(i):Vl(i)}function Vl(i){const{scale:t={},fill:e}=i,n=Ol(e,t);if(X(n)){const s=t.isHorizontal();return{x:s?n:null,y:s?null:n}}return null}function Wl(i){const{scale:t,fill:e}=i,n=t.options,s=t.getLabels().length,o=n.reverse?t.max:t.min,r=Tl(e,t,o),a=[];if(n.grid.circular){const l=t.getPointPositionForValue(0,o);return new cs({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(r)})}for(let l=0;l<s;++l)a.push(t.getPointPositionForValue(l,r));return a}function wi(i,t,e){const n=Il(t),{chart:s,index:o,line:r,scale:a,axis:l}=t,c=r.options,h=c.fill,d=c.backgroundColor,{above:f=d,below:g=d}=h||{},p=s.getDatasetMeta(o),b=yn(s,p);n&&r.points.length&&(ke(i,e),Hl(i,{line:r,target:n,above:f,below:g,area:e,scale:a,axis:l,clip:b}),we(i))}function Hl(i,t){const{line:e,target:n,above:s,below:o,area:r,scale:a,clip:l}=t,c=e._loop?"angle":t.axis;i.save();let h=o;o!==s&&(c==="x"?(hs(i,n,r.top),Si(i,{line:e,target:n,color:s,scale:a,property:c,clip:l}),i.restore(),i.save(),hs(i,n,r.bottom)):c==="y"&&(ds(i,n,r.left),Si(i,{line:e,target:n,color:o,scale:a,property:c,clip:l}),i.restore(),i.save(),ds(i,n,r.right),h=s)),Si(i,{line:e,target:n,color:h,scale:a,property:c,clip:l}),i.restore()}function hs(i,t,e){const{segments:n,points:s}=t;let o=!0,r=!1;i.beginPath();for(const a of n){const{start:l,end:c}=a,h=s[l],d=s[Ve(l,c,s)];o?(i.moveTo(h.x,h.y),o=!1):(i.lineTo(h.x,e),i.lineTo(h.x,h.y)),r=!!t.pathSegment(i,a,{move:r}),r?i.closePath():i.lineTo(d.x,e)}i.lineTo(t.first().x,e),i.closePath(),i.clip()}function ds(i,t,e){const{segments:n,points:s}=t;let o=!0,r=!1;i.beginPath();for(const a of n){const{start:l,end:c}=a,h=s[l],d=s[Ve(l,c,s)];o?(i.moveTo(h.x,h.y),o=!1):(i.lineTo(e,h.y),i.lineTo(h.x,h.y)),r=!!t.pathSegment(i,a,{move:r}),r?i.closePath():i.lineTo(e,d.y)}i.lineTo(e,t.first().y),i.closePath(),i.clip()}function Si(i,t){const{line:e,target:n,property:s,color:o,scale:r,clip:a}=t,l=vl(e,n,s);for(const{source:c,target:h,start:d,end:f}of l){const{style:{backgroundColor:g=o}={}}=c,p=n!==!0;i.save(),i.fillStyle=g,jl(i,r,a,p&&ki(s,d,f)),i.beginPath();const b=!!e.pathSegment(i,c);let m;if(p){b?i.closePath():fs(i,n,f,s);const x=!!n.pathSegment(i,h,{move:b,reverse:!0});m=b&&x,m||fs(i,n,d,s)}i.closePath(),i.fill(m?"evenodd":"nonzero"),i.restore()}}function jl(i,t,e,n){const s=t.chart.chartArea,{property:o,start:r,end:a}=n||{};if(o==="x"||o==="y"){let l,c,h,d;o==="x"?(l=r,c=s.top,h=a,d=s.bottom):(l=s.left,c=r,h=s.right,d=a),i.beginPath(),e&&(l=Math.max(l,e.left),h=Math.min(h,e.right),c=Math.max(c,e.top),d=Math.min(d,e.bottom)),i.rect(l,c,h-l,d-c),i.clip()}}function fs(i,t,e,n){const s=t.interpolate(e,n);s&&i.lineTo(s.x,s.y)}var $l={id:"filler",afterDatasetsUpdate(i,t,e){const n=(i.data.datasets||[]).length,s=[];let o,r,a,l;for(r=0;r<n;++r)o=i.getDatasetMeta(r),a=o.dataset,l=null,a&&a.options&&a instanceof Ne&&(l={visible:i.isDatasetVisible(r),index:r,fill:Pl(a,r,n),chart:i,axis:o.controller.options.indexAxis,scale:o.vScale,line:a}),o.$filler=l,s.push(l);for(r=0;r<n;++r)l=s[r],!(!l||l.fill===!1)&&(l.fill=Dl(s,r,e.propagate))},beforeDraw(i,t,e){const n=e.drawTime==="beforeDraw",s=i.getSortedVisibleDatasetMetas(),o=i.chartArea;for(let r=s.length-1;r>=0;--r){const a=s[r].$filler;a&&(a.line.updateControlPoints(o,a.axis),n&&a.fill&&wi(i.ctx,a,o))}},beforeDatasetsDraw(i,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const n=i.getSortedVisibleDatasetMetas();for(let s=n.length-1;s>=0;--s){const o=n[s].$filler;ls(o)&&wi(i.ctx,o,i.chartArea)}},beforeDatasetDraw(i,t,e){const n=t.meta.$filler;!ls(n)||e.drawTime!=="beforeDatasetDraw"||wi(i.ctx,n,i.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const us=(i,t)=>{let{boxHeight:e=t,boxWidth:n=t}=i;return i.usePointStyle&&(e=Math.min(e,t),n=i.pointStyleWidth||Math.min(n,t)),{boxWidth:n,boxHeight:e,itemHeight:Math.max(t,e)}},Yl=(i,t)=>i!==null&&t!==null&&i.datasetIndex===t.datasetIndex&&i.index===t.index;class gs extends Lt{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,n){this.maxWidth=t,this.maxHeight=e,this._margins=n,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(){const t=this.options.labels||{};let e=N(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(n=>t.filter(n,this.chart.data))),t.sort&&(e=e.sort((n,s)=>t.sort(n,s,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const n=t.labels,s=q(n.font),o=s.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=us(n,o);let c,h;e.font=s.string,this.isHorizontal()?(c=this.maxWidth,h=this._fitRows(r,o,a,l)+10):(h=this.maxHeight,c=this._fitCols(r,s,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,n,s){const{ctx:o,maxWidth:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],h=s+a;let d=t;o.textAlign="left",o.textBaseline="middle";let f=-1,g=-h;return this.legendItems.forEach((p,b)=>{const m=n+e/2+o.measureText(p.text).width;(b===0||c[c.length-1]+m+2*a>r)&&(d+=h,c[c.length-(b>0?0:1)]=0,g+=h,f++),l[b]={left:0,top:g,row:f,width:m,height:s},c[c.length-1]+=m+a}),d}_fitCols(t,e,n,s){const{ctx:o,maxHeight:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],h=r-t;let d=a,f=0,g=0,p=0,b=0;return this.legendItems.forEach((m,x)=>{const{itemWidth:_,itemHeight:w}=Ul(n,e,o,m,s);x>0&&g+w+2*a>h&&(d+=f+a,c.push({width:f,height:g}),p+=f+a,b++,f=g=0),l[x]={left:p,top:g,col:b,width:_,height:w},f=Math.max(f,_),g+=w+a}),d+=f,c.push({width:f,height:g}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:n,labels:{padding:s},rtl:o}}=this,r=$t(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=nt(n,this.left+s,this.right-this.lineWidths[a]);for(const c of e)a!==c.row&&(a=c.row,l=nt(n,this.left+s,this.right-this.lineWidths[a])),c.top+=this.top+t+s,c.left=r.leftForLtr(r.x(l),c.width),l+=c.width+s}else{let a=0,l=nt(n,this.top+t+s,this.bottom-this.columnSizes[a].height);for(const c of e)c.col!==a&&(a=c.col,l=nt(n,this.top+t+s,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+s,c.left=r.leftForLtr(r.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;ke(t,this),this._draw(),we(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:n,ctx:s}=this,{align:o,labels:r}=t,a=$.color,l=$t(t.rtl,this.left,this.width),c=q(r.font),{padding:h}=r,d=c.size,f=d/2;let g;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:p,boxHeight:b,itemHeight:m}=us(r,d),x=function(k,S,M){if(isNaN(p)||p<=0||isNaN(b)||b<0)return;s.save();const C=T(M.lineWidth,1);if(s.fillStyle=T(M.fillStyle,a),s.lineCap=T(M.lineCap,"butt"),s.lineDashOffset=T(M.lineDashOffset,0),s.lineJoin=T(M.lineJoin,"miter"),s.lineWidth=C,s.strokeStyle=T(M.strokeStyle,a),s.setLineDash(T(M.lineDash,[])),r.usePointStyle){const D={radius:b*Math.SQRT2/2,pointStyle:M.pointStyle,rotation:M.rotation,borderWidth:C},P=l.xPlus(k,p/2),O=S+f;tn(s,D,P,O,r.pointStyleWidth&&p)}else{const D=S+Math.max((d-b)/2,0),P=l.leftForLtr(k,p),O=Wt(M.borderRadius);s.beginPath(),Object.values(O).some(F=>F!==0)?Se(s,{x:P,y:D,w:p,h:b,radius:O}):s.rect(P,D,p,b),s.fill(),C!==0&&s.stroke()}s.restore()},_=function(k,S,M){Vt(s,M.text,k,S+m/2,c,{strikethrough:M.hidden,textAlign:l.textAlign(M.textAlign)})},w=this.isHorizontal(),v=this._computeTitleHeight();w?g={x:nt(o,this.left+h,this.right-n[0]),y:this.top+h+v,line:0}:g={x:this.left+h,y:nt(o,this.top+v+h,this.bottom-e[0].height),line:0},dn(this.ctx,t.textDirection);const y=m+h;this.legendItems.forEach((k,S)=>{s.strokeStyle=k.fontColor,s.fillStyle=k.fontColor;const M=s.measureText(k.text).width,C=l.textAlign(k.textAlign||(k.textAlign=r.textAlign)),D=p+f+M;let P=g.x,O=g.y;l.setWidth(this.width),w?S>0&&P+D+h>this.right&&(O=g.y+=y,g.line++,P=g.x=nt(o,this.left+h,this.right-n[g.line])):S>0&&O+y>this.bottom&&(P=g.x=P+e[g.line].width+h,g.line++,O=g.y=nt(o,this.top+v+h,this.bottom-e[g.line].height));const F=l.x(P);if(x(F,O,k),P=Oo(C,P+p+f,w?P+D:this.right,t.rtl),_(l.x(P),O,k),w)g.x+=D+h;else if(typeof k.text!="string"){const H=c.lineHeight;g.y+=ps(k,H)+h}else g.y+=y}),fn(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,n=q(e.font),s=Q(e.padding);if(!e.display)return;const o=$t(t.rtl,this.left,this.width),r=this.ctx,a=e.position,l=n.size/2,c=s.top+l;let h,d=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),h=this.top+c,d=nt(t.align,d,this.right-f);else{const p=this.columnSizes.reduce((b,m)=>Math.max(b,m.height),0);h=c+nt(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const g=nt(a,d,d+f);r.textAlign=o.textAlign(qi(a)),r.textBaseline="middle",r.strokeStyle=e.color,r.fillStyle=e.color,r.font=n.string,Vt(r,e.text,g,h,n)}_computeTitleHeight(){const t=this.options.title,e=q(t.font),n=Q(t.padding);return t.display?e.lineHeight+n.height:0}_getLegendItemAt(t,e){let n,s,o;if(Ct(t,this.left,this.right)&&Ct(e,this.top,this.bottom)){for(o=this.legendHitBoxes,n=0;n<o.length;++n)if(s=o[n],Ct(t,s.left,s.left+s.width)&&Ct(e,s.top,s.top+s.height))return this.legendItems[n]}return null}handleEvent(t){const e=this.options;if(!Kl(t.type,e))return;const n=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,o=Yl(s,n);s&&!o&&N(e.onLeave,[t,s,this],this),this._hoveredItem=n,n&&!o&&N(e.onHover,[t,n,this],this)}else n&&N(e.onClick,[t,n,this],this)}}function Ul(i,t,e,n,s){const o=Xl(n,i,t,e),r=ql(s,n,t.lineHeight);return{itemWidth:o,itemHeight:r}}function Xl(i,t,e,n){let s=i.text;return s&&typeof s!="string"&&(s=s.reduce((o,r)=>o.length>r.length?o:r)),t+e.size/2+n.measureText(s).width}function ql(i,t,e){let n=i;return typeof t.text!="string"&&(n=ps(t,e)),n}function ps(i,t){const e=i.text?i.text.length:0;return t*e}function Kl(i,t){return!!((i==="mousemove"||i==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(i==="click"||i==="mouseup"))}var ms={id:"legend",_element:gs,start(i,t,e){const n=i.legend=new gs({ctx:i.ctx,options:e,chart:i});Mt.configure(i,n,e),Mt.addBox(i,n)},stop(i){Mt.removeBox(i,i.legend),delete i.legend},beforeUpdate(i,t,e){const n=i.legend;Mt.configure(i,n,e),n.options=e},afterUpdate(i){const 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){const n=t.datasetIndex,s=e.chart;s.isDatasetVisible(n)?(s.hide(n),t.hidden=!0):(s.show(n),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:i=>i.chart.options.color,boxWidth:40,padding:10,generateLabels(i){const t=i.data.datasets,{labels:{usePointStyle:e,pointStyle:n,textAlign:s,color:o,useBorderRadius:r,borderRadius:a}}=i.legend.options;return i._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),h=Q(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:c.borderColor,pointStyle:n||c.pointStyle,rotation:c.rotation,textAlign:s||c.textAlign,borderRadius:r&&(a||c.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)}}};const he={average(i){if(!i.length)return!1;let t,e,n=new Set,s=0,o=0;for(t=0,e=i.length;t<e;++t){const a=i[t].element;if(a&&a.hasValue()){const l=a.tooltipPosition();n.add(l.x),s+=l.y,++o}}return o===0||n.size===0?!1:{x:[...n].reduce((a,l)=>a+l)/n.size,y:s/o}},nearest(i,t){if(!i.length)return!1;let e=t.x,n=t.y,s=Number.POSITIVE_INFINITY,o,r,a;for(o=0,r=i.length;o<r;++o){const l=i[o].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),h=Je(t,c);h<s&&(s=h,a=l)}}if(a){const l=a.tooltipPosition();e=l.x,n=l.y}return{x:e,y:n}}};function ct(i,t){return t&&(j(t)?Array.prototype.push.apply(i,t):i.push(t)),i}function gt(i){return(typeof i=="string"||i instanceof String)&&i.indexOf(`
1
+ (function(it,u){typeof exports=="object"&&typeof module<"u"?u(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],u):(it=typeof globalThis<"u"?globalThis:it||self,u(it.NemesisChart={},it.Vue))})(this,(function(it,u){"use strict";const zt=(i,t)=>{const e=i.__vccOpts||i;for(const[n,s]of t)e[n]=s;return e},Vs={class:"m-0 text-sm",style:{color:"#7B7B7B","word-break":"break-word"}},Di=zt({__name:"Cards",props:{cor:{type:String,default:"light",validator:i=>["light","dark","transparent"].includes(i)},titulo:{type:String,default:"Card Title"},valor:{type:String,default:"0"},descricao:{type:String,default:"This is a card component."},botao_todos:{type:Boolean,default:!1}},emits:["click"],setup(i,{emit:t}){const e=i,n={light:"bg-white",dark:"bg-black",transparent:"bg-transparent"},s=t,o=u.computed(()=>n[e.cor]??"bg-white"),r=()=>{s("click")};return(a,l)=>(u.openBlock(),u.createElementBlock("div",{class:u.normalizeClass([o.value,"border-round-xl flex flex-column w-full transition-linear transition-all transition-duration-200 select-none nc-card-hover",i.botao_todos?"cursor-pointer":""]),style:{padding:"1.25rem",gap:"1.438rem",border:"1px solid #e5e7eb"},onClick:r},[u.createElementVNode("p",{class:u.normalizeClass(["m-0 text-xs font-medium",o.value==="bg-black"?"text-white":"text-gray-900"])},u.toDisplayString(i.titulo),3),u.createElementVNode("div",null,[u.createElementVNode("h2",{class:u.normalizeClass(["m-0 text-3xl font-semibold",o.value==="bg-black"?"text-white":"text-gray-900"]),style:{"line-height":"33px","letter-spacing":"-1px"}},u.toDisplayString(i.valor),3),u.createElementVNode("p",Vs,u.toDisplayString(i.descricao),1)]),i.botao_todos?(u.openBlock(),u.createElementBlock("button",{key:0,class:u.normalizeClass(["nc-btn-todos text-xs",o.value==="bg-black"?"text-white":"text-gray-900"])},[...l[0]||(l[0]=[u.createTextVNode(" Ver Todos ",-1),u.createElementVNode("i",{class:"pi pi-angle-right text-xs"},null,-1)])],2)):u.createCommentVNode("",!0)],2))}},[["__scopeId","data-v-2f20b7b5"]]);function Xt(i){return i+.5|0}const yt=(i,t,e)=>Math.max(Math.min(i,e),t);function qt(i){return yt(Xt(i*2.55),0,255)}function _t(i){return yt(Xt(i*255),0,255)}function ht(i){return yt(Xt(i/2.55)/100,0,1)}function Pi(i){return yt(Xt(i*100),0,100)}const st={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},$e=[..."0123456789ABCDEF"],Ws=i=>$e[i&15],Hs=i=>$e[(i&240)>>4]+$e[i&15],de=i=>(i&240)>>4===(i&15),js=i=>de(i.r)&&de(i.g)&&de(i.b)&&de(i.a);function $s(i){var t=i.length,e;return i[0]==="#"&&(t===4||t===5?e={r:255&st[i[1]]*17,g:255&st[i[2]]*17,b:255&st[i[3]]*17,a:t===5?st[i[4]]*17:255}:(t===7||t===9)&&(e={r:st[i[1]]<<4|st[i[2]],g:st[i[3]]<<4|st[i[4]],b:st[i[5]]<<4|st[i[6]],a:t===9?st[i[7]]<<4|st[i[8]]:255})),e}const Ys=(i,t)=>i<255?t(i):"";function Us(i){var t=js(i)?Ws:Hs;return i?"#"+t(i.r)+t(i.g)+t(i.b)+Ys(i.a,t):void 0}const Xs=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Ai(i,t,e){const n=t*Math.min(e,1-e),s=(o,r=(o+i/30)%12)=>e-n*Math.max(Math.min(r-3,9-r,1),-1);return[s(0),s(8),s(4)]}function qs(i,t,e){const n=(s,o=(s+i/60)%6)=>e-e*t*Math.max(Math.min(o,4-o,1),0);return[n(5),n(3),n(1)]}function Ks(i,t,e){const n=Ai(i,1,.5);let s;for(t+e>1&&(s=1/(t+e),t*=s,e*=s),s=0;s<3;s++)n[s]*=1-t-e,n[s]+=t;return n}function Gs(i,t,e,n,s){return i===s?(t-e)/n+(t<e?6:0):t===s?(e-i)/n+2:(i-t)/n+4}function Ye(i){const e=i.r/255,n=i.g/255,s=i.b/255,o=Math.max(e,n,s),r=Math.min(e,n,s),a=(o+r)/2;let l,c,h;return o!==r&&(h=o-r,c=a>.5?h/(2-o-r):h/(o+r),l=Gs(e,n,s,h,o),l=l*60+.5),[l|0,c||0,a]}function Ue(i,t,e,n){return(Array.isArray(t)?i(t[0],t[1],t[2]):i(t,e,n)).map(_t)}function Xe(i,t,e){return Ue(Ai,i,t,e)}function Js(i,t,e){return Ue(Ks,i,t,e)}function Qs(i,t,e){return Ue(qs,i,t,e)}function Oi(i){return(i%360+360)%360}function Zs(i){const t=Xs.exec(i);let e=255,n;if(!t)return;t[5]!==n&&(e=t[6]?qt(+t[5]):_t(+t[5]));const s=Oi(+t[2]),o=+t[3]/100,r=+t[4]/100;return t[1]==="hwb"?n=Js(s,o,r):t[1]==="hsv"?n=Qs(s,o,r):n=Xe(s,o,r),{r:n[0],g:n[1],b:n[2],a:e}}function to(i,t){var e=Ye(i);e[0]=Oi(e[0]+t),e=Xe(e),i.r=e[0],i.g=e[1],i.b=e[2]}function eo(i){if(!i)return;const t=Ye(i),e=t[0],n=Pi(t[1]),s=Pi(t[2]);return i.a<255?`hsla(${e}, ${n}%, ${s}%, ${ht(i.a)})`:`hsl(${e}, ${n}%, ${s}%)`}const Ti={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"},Ei={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function io(){const i={},t=Object.keys(Ei),e=Object.keys(Ti);let n,s,o,r,a;for(n=0;n<t.length;n++){for(r=a=t[n],s=0;s<e.length;s++)o=e[s],a=a.replace(o,Ti[o]);o=parseInt(Ei[r],16),i[a]=[o>>16&255,o>>8&255,o&255]}return i}let fe;function no(i){fe||(fe=io(),fe.transparent=[0,0,0,0]);const t=fe[i.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const so=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function oo(i){const t=so.exec(i);let e=255,n,s,o;if(t){if(t[7]!==n){const r=+t[7];e=t[8]?qt(r):yt(r*255,0,255)}return n=+t[1],s=+t[3],o=+t[5],n=255&(t[2]?qt(n):yt(n,0,255)),s=255&(t[4]?qt(s):yt(s,0,255)),o=255&(t[6]?qt(o):yt(o,0,255)),{r:n,g:s,b:o,a:e}}}function ro(i){return i&&(i.a<255?`rgba(${i.r}, ${i.g}, ${i.b}, ${ht(i.a)})`:`rgb(${i.r}, ${i.g}, ${i.b})`)}const qe=i=>i<=.0031308?i*12.92:Math.pow(i,1/2.4)*1.055-.055,It=i=>i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4);function ao(i,t,e){const n=It(ht(i.r)),s=It(ht(i.g)),o=It(ht(i.b));return{r:_t(qe(n+e*(It(ht(t.r))-n))),g:_t(qe(s+e*(It(ht(t.g))-s))),b:_t(qe(o+e*(It(ht(t.b))-o))),a:i.a+e*(t.a-i.a)}}function ue(i,t,e){if(i){let n=Ye(i);n[t]=Math.max(0,Math.min(n[t]+n[t]*e,t===0?360:1)),n=Xe(n),i.r=n[0],i.g=n[1],i.b=n[2]}}function Ri(i,t){return i&&Object.assign(t||{},i)}function Li(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=_t(i[3]))):(t=Ri(i,{r:0,g:0,b:0,a:1}),t.a=_t(t.a)),t}function lo(i){return i.charAt(0)==="r"?oo(i):Zs(i)}class Kt{constructor(t){if(t instanceof Kt)return t;const e=typeof t;let n;e==="object"?n=Li(t):e==="string"&&(n=$s(t)||no(t)||lo(t)),this._rgb=n,this._valid=!!n}get valid(){return this._valid}get rgb(){var t=Ri(this._rgb);return t&&(t.a=ht(t.a)),t}set rgb(t){this._rgb=Li(t)}rgbString(){return this._valid?ro(this._rgb):void 0}hexString(){return this._valid?Us(this._rgb):void 0}hslString(){return this._valid?eo(this._rgb):void 0}mix(t,e){if(t){const n=this.rgb,s=t.rgb;let o;const r=e===o?.5:e,a=2*r-1,l=n.a-s.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;o=1-c,n.r=255&c*n.r+o*s.r+.5,n.g=255&c*n.g+o*s.g+.5,n.b=255&c*n.b+o*s.b+.5,n.a=r*n.a+(1-r)*s.a,this.rgb=n}return this}interpolate(t,e){return t&&(this._rgb=ao(this._rgb,t._rgb,e)),this}clone(){return new Kt(this.rgb)}alpha(t){return this._rgb.a=_t(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=Xt(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){const e=this._rgb;return e.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return ue(this._rgb,2,t),this}darken(t){return ue(this._rgb,2,-t),this}saturate(t){return ue(this._rgb,1,t),this}desaturate(t){return ue(this._rgb,1,-t),this}rotate(t){return to(this._rgb,t),this}}function dt(){}const co=(()=>{let i=0;return()=>i++})();function z(i){return i==null}function j(i){if(Array.isArray&&Array.isArray(i))return!0;const t=Object.prototype.toString.call(i);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function R(i){return i!==null&&Object.prototype.toString.call(i)==="[object Object]"}function X(i){return(typeof i=="number"||i instanceof Number)&&isFinite(+i)}function at(i,t){return X(i)?i:t}function T(i,t){return typeof i>"u"?t:i}const ho=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100:+i/t,Bi=(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 I(i,t,e,n){let s,o,r;if(j(i))for(o=i.length,s=0;s<o;s++)t.call(e,i[s],s);else if(R(i))for(r=Object.keys(i),o=r.length,s=0;s<o;s++)t.call(e,i[r[s]],r[s])}function ge(i,t){let e,n,s,o;if(!i||!t||i.length!==t.length)return!1;for(e=0,n=i.length;e<n;++e)if(s=i[e],o=t[e],s.datasetIndex!==o.datasetIndex||s.index!==o.index)return!1;return!0}function pe(i){if(j(i))return i.map(pe);if(R(i)){const t=Object.create(null),e=Object.keys(i),n=e.length;let s=0;for(;s<n;++s)t[e[s]]=pe(i[e[s]]);return t}return i}function zi(i){return["__proto__","prototype","constructor"].indexOf(i)===-1}function fo(i,t,e,n){if(!zi(i))return;const s=t[i],o=e[i];R(s)&&R(o)?Gt(s,o,n):t[i]=pe(o)}function Gt(i,t,e){const n=j(t)?t:[t],s=n.length;if(!R(i))return i;e=e||{};const o=e.merger||fo;let r;for(let a=0;a<s;++a){if(r=n[a],!R(r))continue;const l=Object.keys(r);for(let c=0,h=l.length;c<h;++c)o(l[c],i,r,e)}return i}function Jt(i,t){return Gt(i,t,{merger:uo})}function uo(i,t,e){if(!zi(i))return;const n=t[i],s=e[i];R(n)&&R(s)?Jt(n,s):Object.prototype.hasOwnProperty.call(t,i)||(t[i]=pe(s))}const Ii={"":i=>i,x:i=>i.x,y:i=>i.y};function go(i){const t=i.split("."),e=[];let n="";for(const s of t)n+=s,n.endsWith("\\")?n=n.slice(0,-1)+".":(e.push(n),n="");return e}function po(i){const t=go(i);return e=>{for(const n of t){if(n==="")break;e=e&&e[n]}return e}}function Ft(i,t){return(Ii[t]||(Ii[t]=po(t)))(i)}function Ke(i){return i.charAt(0).toUpperCase()+i.slice(1)}const me=i=>typeof i<"u",kt=i=>typeof i=="function",Fi=(i,t)=>{if(i.size!==t.size)return!1;for(const e of i)if(!t.has(e))return!1;return!0};function mo(i){return i.type==="mouseup"||i.type==="click"||i.type==="contextmenu"}const B=Math.PI,W=2*B,bo=W+B,be=Number.POSITIVE_INFINITY,xo=B/180,Y=B/2,vt=B/4,Ni=B*2/3,Vi=Math.log10,Nt=Math.sign;function Qt(i,t,e){return Math.abs(i-t)<e}function Wi(i){const t=Math.round(i);i=Qt(i,t,i/1e3)?t:i;const e=Math.pow(10,Math.floor(Vi(i))),n=i/e;return(n<=1?1:n<=2?2:n<=5?5:10)*e}function yo(i){const t=[],e=Math.sqrt(i);let n;for(n=1;n<e;n++)i%n===0&&(t.push(n),t.push(i/n));return e===(e|0)&&t.push(e),t.sort((s,o)=>s-o).pop(),t}function _o(i){return typeof i=="symbol"||typeof i=="object"&&i!==null&&!(Symbol.toPrimitive in i||"toString"in i||"valueOf"in i)}function Zt(i){return!_o(i)&&!isNaN(parseFloat(i))&&isFinite(i)}function ko(i,t){const e=Math.round(i);return e-t<=i&&e+t>=i}function wo(i,t,e){let n,s,o;for(n=0,s=i.length;n<s;n++)o=i[n][e],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function rt(i){return i*(B/180)}function Ge(i){return i*(180/B)}function Hi(i){if(!X(i))return;let t=1,e=0;for(;Math.round(i*t)/t!==i;)t*=10,e++;return e}function ji(i,t){const e=t.x-i.x,n=t.y-i.y,s=Math.sqrt(e*e+n*n);let o=Math.atan2(n,e);return o<-.5*B&&(o+=W),{angle:o,distance:s}}function Je(i,t){return Math.sqrt(Math.pow(t.x-i.x,2)+Math.pow(t.y-i.y,2))}function So(i,t){return(i-t+bo)%W-B}function G(i){return(i%W+W)%W}function te(i,t,e,n){const s=G(i),o=G(t),r=G(e),a=G(o-s),l=G(r-s),c=G(s-o),h=G(s-r);return s===o||s===r||n&&o===r||a>l&&c<h}function J(i,t,e){return Math.max(t,Math.min(e,i))}function Mo(i){return J(i,-32768,32767)}function Ct(i,t,e,n=1e-6){return i>=Math.min(t,e)-n&&i<=Math.max(t,e)+n}function Qe(i,t,e){e=e||(r=>i[r]<t);let n=i.length-1,s=0,o;for(;n-s>1;)o=s+n>>1,e(o)?s=o:n=o;return{lo:s,hi:n}}const Dt=(i,t,e,n)=>Qe(i,e,n?s=>{const o=i[s][t];return o<e||o===e&&i[s+1][t]===e}:s=>i[s][t]<e),vo=(i,t,e)=>Qe(i,e,n=>i[n][t]>=e);function Co(i,t,e){let n=0,s=i.length;for(;n<s&&i[n]<t;)n++;for(;s>n&&i[s-1]>e;)s--;return n>0||s<i.length?i.slice(n,s):i}const $i=["push","pop","shift","splice","unshift"];function Do(i,t){if(i._chartjs){i._chartjs.listeners.push(t);return}Object.defineProperty(i,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),$i.forEach(e=>{const n="_onData"+Ke(e),s=i[e];Object.defineProperty(i,e,{configurable:!0,enumerable:!1,value(...o){const r=s.apply(this,o);return i._chartjs.listeners.forEach(a=>{typeof a[n]=="function"&&a[n](...o)}),r}})})}function Yi(i,t){const e=i._chartjs;if(!e)return;const n=e.listeners,s=n.indexOf(t);s!==-1&&n.splice(s,1),!(n.length>0)&&($i.forEach(o=>{delete i[o]}),delete i._chartjs)}function Po(i){const t=new Set(i);return t.size===i.length?i:Array.from(t)}const Ui=(function(){return typeof window>"u"?function(i){return i()}:window.requestAnimationFrame})();function Xi(i,t){let e=[],n=!1;return function(...s){e=s,n||(n=!0,Ui.call(window,()=>{n=!1,i.apply(t,e)}))}}function Ao(i,t){let e;return function(...n){return t?(clearTimeout(e),e=setTimeout(i,t,n)):i.apply(this,n),t}}const qi=i=>i==="start"?"left":i==="end"?"right":"center",nt=(i,t,e)=>i==="start"?t:i==="end"?e:(t+e)/2,Oo=(i,t,e,n)=>i===(n?"left":"right")?e:i==="center"?(t+e)/2:t;function To(i,t,e){const n=t.length;let s=0,o=n;if(i._sorted){const{iScale:r,vScale:a,_parsed:l}=i,c=i.dataset&&i.dataset.options?i.dataset.options.spanGaps:null,h=r.axis,{min:d,max:f,minDefined:g,maxDefined:p}=r.getUserBounds();if(g){if(s=Math.min(Dt(l,h,d).lo,e?n:Dt(t,h,r.getPixelForValue(d)).lo),c){const b=l.slice(0,s+1).reverse().findIndex(m=>!z(m[a.axis]));s-=Math.max(0,b)}s=J(s,0,n-1)}if(p){let b=Math.max(Dt(l,r.axis,f,!0).hi+1,e?0:Dt(t,h,r.getPixelForValue(f),!0).hi+1);if(c){const m=l.slice(b-1).findIndex(x=>!z(x[a.axis]));b+=Math.max(0,m)}o=J(b,s,n)-s}else o=n-s}return{start:s,count:o}}function Eo(i){const{xScale:t,yScale:e,_scaleRanges:n}=i,s={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!n)return i._scaleRanges=s,!0;const o=n.xmin!==t.min||n.xmax!==t.max||n.ymin!==e.min||n.ymax!==e.max;return Object.assign(n,s),o}const xe=i=>i===0||i===1,Ki=(i,t,e)=>-(Math.pow(2,10*(i-=1))*Math.sin((i-t)*W/e)),Gi=(i,t,e)=>Math.pow(2,-10*i)*Math.sin((i-t)*W/e)+1,ee={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=>-Math.cos(i*Y)+1,easeOutSine:i=>Math.sin(i*Y),easeInOutSine:i=>-.5*(Math.cos(B*i)-1),easeInExpo:i=>i===0?0:Math.pow(2,10*(i-1)),easeOutExpo:i=>i===1?1:-Math.pow(2,-10*i)+1,easeInOutExpo:i=>xe(i)?i:i<.5?.5*Math.pow(2,10*(i*2-1)):.5*(-Math.pow(2,-10*(i*2-1))+2),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:Ki(i,.075,.3),easeOutElastic:i=>xe(i)?i:Gi(i,.075,.3),easeInOutElastic(i){return xe(i)?i:i<.5?.5*Ki(i*2,.1125,.45):.5+.5*Gi(i*2-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?.5*(i*i*(((t*=1.525)+1)*i-t)):.5*((i-=2)*i*(((t*=1.525)+1)*i+t)+2)},easeInBounce:i=>1-ee.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?ee.easeInBounce(i*2)*.5:ee.easeOutBounce(i*2-1)*.5+.5};function Ze(i){if(i&&typeof i=="object"){const t=i.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Ji(i){return Ze(i)?i:new Kt(i)}function ti(i){return Ze(i)?i:new Kt(i).saturate(.5).darken(.1).hexString()}const Ro=["x","y","borderWidth","radius","tension"],Lo=["color","borderColor","backgroundColor"];function Bo(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:Lo},numbers:{type:"number",properties:Ro}}),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=>t|0}}}})}function zo(i){i.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Qi=new Map;function Io(i,t){t=t||{};const e=i+JSON.stringify(t);let n=Qi.get(e);return n||(n=new Intl.NumberFormat(i,t),Qi.set(e,n)),n}function ye(i,t,e){return Io(t,e).format(i)}const Fo={values(i){return j(i)?i:""+i},numeric(i,t,e){if(i===0)return"0";const n=this.chart.options.locale;let s,o=i;if(e.length>1){const c=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),o=No(i,e)}const r=Vi(Math.abs(o)),a=isNaN(r)?1:Math.max(Math.min(-1*Math.floor(r),20),0),l={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),ye(i,n,l)}};function No(i,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&i!==Math.floor(i)&&(e=i-Math.floor(i)),e}var ei={formatters:Fo};function Vo(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:ei.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"})}const Pt=Object.create(null),ii=Object.create(null);function ie(i,t){if(!t)return i;const e=t.split(".");for(let n=0,s=e.length;n<s;++n){const o=e[n];i=i[o]||(i[o]=Object.create(null))}return i}function ni(i,t,e){return typeof t=="string"?Gt(ie(i,t),e):Gt(ie(i,""),t)}class Wo{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=n=>n.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=(n,s)=>ti(s.backgroundColor),this.hoverBorderColor=(n,s)=>ti(s.borderColor),this.hoverColor=(n,s)=>ti(s.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 ni(this,t,e)}get(t){return ie(this,t)}describe(t,e){return ni(ii,t,e)}override(t,e){return ni(Pt,t,e)}route(t,e,n,s){const o=ie(this,t),r=ie(this,n),a="_"+e;Object.defineProperties(o,{[a]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[a],c=r[s];return R(l)?Object.assign({},c,l):T(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(e=>e(this))}}var $=new Wo({_scriptable:i=>!i.startsWith("on"),_indexable:i=>i!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Bo,zo,Vo]);function Ho(i){return!i||z(i.size)||z(i.family)?null:(i.style?i.style+" ":"")+(i.weight?i.weight+" ":"")+i.size+"px "+i.family}function _e(i,t,e,n,s){let o=t[s];return o||(o=t[s]=i.measureText(s).width,e.push(s)),o>n&&(n=o),n}function jo(i,t,e,n){n=n||{};let s=n.data=n.data||{},o=n.garbageCollect=n.garbageCollect||[];n.font!==t&&(s=n.data={},o=n.garbageCollect=[],n.font=t),i.save(),i.font=t;let r=0;const a=e.length;let l,c,h,d,f;for(l=0;l<a;l++)if(d=e[l],d!=null&&!j(d))r=_e(i,s,o,r,d);else if(j(d))for(c=0,h=d.length;c<h;c++)f=d[c],f!=null&&!j(f)&&(r=_e(i,s,o,r,f));i.restore();const g=o.length/2;if(g>e.length){for(l=0;l<g;l++)delete s[o[l]];o.splice(0,g)}return r}function At(i,t,e){const n=i.currentDevicePixelRatio,s=e!==0?Math.max(e/2,.5):0;return Math.round((t-s)*n)/n+s}function Zi(i,t){!t&&!i||(t=t||i.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,i.width,i.height),t.restore())}function si(i,t,e,n){tn(i,t,e,n,null)}function tn(i,t,e,n,s){let o,r,a,l,c,h,d,f;const g=t.pointStyle,p=t.rotation,b=t.radius;let m=(p||0)*xo;if(g&&typeof g=="object"&&(o=g.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){i.save(),i.translate(e,n),i.rotate(m),i.drawImage(g,-g.width/2,-g.height/2,g.width,g.height),i.restore();return}if(!(isNaN(b)||b<=0)){switch(i.beginPath(),g){default:s?i.ellipse(e,n,s/2,b,0,0,W):i.arc(e,n,b,0,W),i.closePath();break;case"triangle":h=s?s/2:b,i.moveTo(e+Math.sin(m)*h,n-Math.cos(m)*b),m+=Ni,i.lineTo(e+Math.sin(m)*h,n-Math.cos(m)*b),m+=Ni,i.lineTo(e+Math.sin(m)*h,n-Math.cos(m)*b),i.closePath();break;case"rectRounded":c=b*.516,l=b-c,r=Math.cos(m+vt)*l,d=Math.cos(m+vt)*(s?s/2-c:l),a=Math.sin(m+vt)*l,f=Math.sin(m+vt)*(s?s/2-c:l),i.arc(e-d,n-a,c,m-B,m-Y),i.arc(e+f,n-r,c,m-Y,m),i.arc(e+d,n+a,c,m,m+Y),i.arc(e-f,n+r,c,m+Y,m+B),i.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*b,h=s?s/2:l,i.rect(e-h,n-l,2*h,2*l);break}m+=vt;case"rectRot":d=Math.cos(m)*(s?s/2:b),r=Math.cos(m)*b,a=Math.sin(m)*b,f=Math.sin(m)*(s?s/2:b),i.moveTo(e-d,n-a),i.lineTo(e+f,n-r),i.lineTo(e+d,n+a),i.lineTo(e-f,n+r),i.closePath();break;case"crossRot":m+=vt;case"cross":d=Math.cos(m)*(s?s/2:b),r=Math.cos(m)*b,a=Math.sin(m)*b,f=Math.sin(m)*(s?s/2:b),i.moveTo(e-d,n-a),i.lineTo(e+d,n+a),i.moveTo(e+f,n-r),i.lineTo(e-f,n+r);break;case"star":d=Math.cos(m)*(s?s/2:b),r=Math.cos(m)*b,a=Math.sin(m)*b,f=Math.sin(m)*(s?s/2:b),i.moveTo(e-d,n-a),i.lineTo(e+d,n+a),i.moveTo(e+f,n-r),i.lineTo(e-f,n+r),m+=vt,d=Math.cos(m)*(s?s/2:b),r=Math.cos(m)*b,a=Math.sin(m)*b,f=Math.sin(m)*(s?s/2:b),i.moveTo(e-d,n-a),i.lineTo(e+d,n+a),i.moveTo(e+f,n-r),i.lineTo(e-f,n+r);break;case"line":r=s?s/2:Math.cos(m)*b,a=Math.sin(m)*b,i.moveTo(e-r,n-a),i.lineTo(e+r,n+a);break;case"dash":i.moveTo(e,n),i.lineTo(e+Math.cos(m)*(s?s/2:b),n+Math.sin(m)*b);break;case!1:i.closePath();break}i.fill(),t.borderWidth>0&&i.stroke()}}function ft(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 ke(i,t){i.save(),i.beginPath(),i.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),i.clip()}function we(i){i.restore()}function $o(i,t,e,n,s){if(!t)return i.lineTo(e.x,e.y);if(s==="middle"){const o=(t.x+e.x)/2;i.lineTo(o,t.y),i.lineTo(o,e.y)}else s==="after"!=!!n?i.lineTo(t.x,e.y):i.lineTo(e.x,t.y);i.lineTo(e.x,e.y)}function Yo(i,t,e,n){if(!t)return i.lineTo(e.x,e.y);i.bezierCurveTo(n?t.cp1x:t.cp2x,n?t.cp1y:t.cp2y,n?e.cp2x:e.cp1x,n?e.cp2y:e.cp1y,e.x,e.y)}function Uo(i,t){t.translation&&i.translate(t.translation[0],t.translation[1]),z(t.rotation)||i.rotate(t.rotation),t.color&&(i.fillStyle=t.color),t.textAlign&&(i.textAlign=t.textAlign),t.textBaseline&&(i.textBaseline=t.textBaseline)}function Xo(i,t,e,n,s){if(s.strikethrough||s.underline){const o=i.measureText(n),r=t-o.actualBoundingBoxLeft,a=t+o.actualBoundingBoxRight,l=e-o.actualBoundingBoxAscent,c=e+o.actualBoundingBoxDescent,h=s.strikethrough?(l+c)/2:c;i.strokeStyle=i.fillStyle,i.beginPath(),i.lineWidth=s.decorationWidth||2,i.moveTo(r,h),i.lineTo(a,h),i.stroke()}}function qo(i,t){const e=i.fillStyle;i.fillStyle=t.color,i.fillRect(t.left,t.top,t.width,t.height),i.fillStyle=e}function Vt(i,t,e,n,s,o={}){const r=j(t)?t:[t],a=o.strokeWidth>0&&o.strokeColor!=="";let l,c;for(i.save(),i.font=s.string,Uo(i,o),l=0;l<r.length;++l)c=r[l],o.backdrop&&qo(i,o.backdrop),a&&(o.strokeColor&&(i.strokeStyle=o.strokeColor),z(o.strokeWidth)||(i.lineWidth=o.strokeWidth),i.strokeText(c,e,n,o.maxWidth)),i.fillText(c,e,n,o.maxWidth),Xo(i,e,n,c,o),n+=Number(s.lineHeight);i.restore()}function Se(i,t){const{x:e,y:n,w:s,h:o,radius:r}=t;i.arc(e+r.topLeft,n+r.topLeft,r.topLeft,1.5*B,B,!0),i.lineTo(e,n+o-r.bottomLeft),i.arc(e+r.bottomLeft,n+o-r.bottomLeft,r.bottomLeft,B,Y,!0),i.lineTo(e+s-r.bottomRight,n+o),i.arc(e+s-r.bottomRight,n+o-r.bottomRight,r.bottomRight,Y,0,!0),i.lineTo(e+s,n+r.topRight),i.arc(e+s-r.topRight,n+r.topRight,r.topRight,0,-Y,!0),i.lineTo(e+r.topLeft,n)}const Ko=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Go=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Jo(i,t){const e=(""+i).match(Ko);if(!e||e[1]==="normal")return t*1.2;switch(i=+e[2],e[3]){case"px":return i;case"%":i/=100;break}return t*i}const Qo=i=>+i||0;function oi(i,t){const e={},n=R(t),s=n?Object.keys(t):t,o=R(i)?n?r=>T(i[r],i[t[r]]):r=>i[r]:()=>i;for(const r of s)e[r]=Qo(o(r));return e}function Zo(i){return oi(i,{top:"y",right:"x",bottom:"y",left:"x"})}function Wt(i){return oi(i,["topLeft","topRight","bottomLeft","bottomRight"])}function Q(i){const t=Zo(i);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function q(i,t){i=i||{},t=t||$.font;let e=T(i.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let n=T(i.style,t.style);n&&!(""+n).match(Go)&&(console.warn('Invalid font style specified: "'+n+'"'),n=void 0);const s={family:T(i.family,t.family),lineHeight:Jo(T(i.lineHeight,t.lineHeight),e),size:e,style:n,weight:T(i.weight,t.weight),string:""};return s.string=Ho(s),s}function Me(i,t,e,n){let s,o,r;for(s=0,o=i.length;s<o;++s)if(r=i[s],r!==void 0&&r!==void 0)return r}function tr(i,t,e){const{min:n,max:s}=i,o=Bi(t,(s-n)/2),r=(a,l)=>e&&a===0?0:a+l;return{min:r(n,-Math.abs(o)),max:r(s,o)}}function wt(i,t){return Object.assign(Object.create(i),t)}function ri(i,t=[""],e,n,s=()=>i[0]){const o=e||i;typeof n>"u"&&(n=rn("_fallback",i));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:i,_rootScopes:o,_fallback:n,_getTarget:s,override:a=>ri([a,...i],t,o,n)};return new Proxy(r,{deleteProperty(a,l){return delete a[l],delete a._keys,delete i[0][l],!0},get(a,l){return nn(a,l,()=>lr(l,t,i,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(i[0])},has(a,l){return an(a).includes(l)},ownKeys(a){return an(a)},set(a,l,c){const h=a._storage||(a._storage=s());return a[l]=h[l]=c,delete a._keys,!0}})}function Ht(i,t,e,n){const s={_cacheable:!1,_proxy:i,_context:t,_subProxy:e,_stack:new Set,_descriptors:en(i,n),setContext:o=>Ht(i,o,e,n),override:o=>Ht(i.override(o),t,e,n)};return new Proxy(s,{deleteProperty(o,r){return delete o[r],delete i[r],!0},get(o,r,a){return nn(o,r,()=>ir(o,r,a))},getOwnPropertyDescriptor(o,r){return o._descriptors.allKeys?Reflect.has(i,r)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(i,r)},getPrototypeOf(){return Reflect.getPrototypeOf(i)},has(o,r){return Reflect.has(i,r)},ownKeys(){return Reflect.ownKeys(i)},set(o,r,a){return i[r]=a,delete o[r],!0}})}function en(i,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:n=t.indexable,_allKeys:s=t.allKeys}=i;return{allKeys:s,scriptable:e,indexable:n,isScriptable:kt(e)?e:()=>e,isIndexable:kt(n)?n:()=>n}}const er=(i,t)=>i?i+Ke(t):t,ai=(i,t)=>R(t)&&i!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function nn(i,t,e){if(Object.prototype.hasOwnProperty.call(i,t)||t==="constructor")return i[t];const n=e();return i[t]=n,n}function ir(i,t,e){const{_proxy:n,_context:s,_subProxy:o,_descriptors:r}=i;let a=n[t];return kt(a)&&r.isScriptable(t)&&(a=nr(t,a,i,e)),j(a)&&a.length&&(a=sr(t,a,i,r.isIndexable)),ai(t,a)&&(a=Ht(a,s,o&&o[t],r)),a}function nr(i,t,e,n){const{_proxy:s,_context:o,_subProxy:r,_stack:a}=e;if(a.has(i))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+i);a.add(i);let l=t(o,r||n);return a.delete(i),ai(i,l)&&(l=li(s._scopes,s,i,l)),l}function sr(i,t,e,n){const{_proxy:s,_context:o,_subProxy:r,_descriptors:a}=e;if(typeof o.index<"u"&&n(i))return t[o.index%t.length];if(R(t[0])){const l=t,c=s._scopes.filter(h=>h!==l);t=[];for(const h of l){const d=li(c,s,i,h);t.push(Ht(d,o,r&&r[i],a))}}return t}function sn(i,t,e){return kt(i)?i(t,e):i}const or=(i,t)=>i===!0?t:typeof i=="string"?Ft(t,i):void 0;function rr(i,t,e,n,s){for(const o of t){const r=or(e,o);if(r){i.add(r);const a=sn(r._fallback,e,s);if(typeof a<"u"&&a!==e&&a!==n)return a}else if(r===!1&&typeof n<"u"&&e!==n)return null}return!1}function li(i,t,e,n){const s=t._rootScopes,o=sn(t._fallback,e,n),r=[...i,...s],a=new Set;a.add(n);let l=on(a,r,e,o||e,n);return l===null||typeof o<"u"&&o!==e&&(l=on(a,r,o,l,n),l===null)?!1:ri(Array.from(a),[""],s,o,()=>ar(t,e,n))}function on(i,t,e,n,s){for(;e;)e=rr(i,t,e,n,s);return e}function ar(i,t,e){const n=i._getTarget();t in n||(n[t]={});const s=n[t];return j(s)&&R(e)?e:s||{}}function lr(i,t,e,n){let s;for(const o of t)if(s=rn(er(o,i),e),typeof s<"u")return ai(i,s)?li(e,n,i,s):s}function rn(i,t){for(const e of t){if(!e)continue;const n=e[i];if(typeof n<"u")return n}}function an(i){let t=i._keys;return t||(t=i._keys=cr(i._scopes)),t}function cr(i){const t=new Set;for(const e of i)for(const n of Object.keys(e).filter(s=>!s.startsWith("_")))t.add(n);return Array.from(t)}function hr(i,t,e,n){const{iScale:s}=i,{key:o="r"}=this._parsing,r=new Array(n);let a,l,c,h;for(a=0,l=n;a<l;++a)c=a+e,h=t[c],r[a]={r:s.parse(Ft(h,o),c)};return r}const dr=Number.EPSILON||1e-14,jt=(i,t)=>t<i.length&&!i[t].skip&&i[t],ln=i=>i==="x"?"y":"x";function fr(i,t,e,n){const s=i.skip?t:i,o=t,r=e.skip?t:e,a=Je(o,s),l=Je(r,o);let c=a/(a+l),h=l/(a+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const d=n*c,f=n*h;return{previous:{x:o.x-d*(r.x-s.x),y:o.y-d*(r.y-s.y)},next:{x:o.x+f*(r.x-s.x),y:o.y+f*(r.y-s.y)}}}function ur(i,t,e){const n=i.length;let s,o,r,a,l,c=jt(i,0);for(let h=0;h<n-1;++h)if(l=c,c=jt(i,h+1),!(!l||!c)){if(Qt(t[h],0,dr)){e[h]=e[h+1]=0;continue}s=e[h]/t[h],o=e[h+1]/t[h],a=Math.pow(s,2)+Math.pow(o,2),!(a<=9)&&(r=3/Math.sqrt(a),e[h]=s*r*t[h],e[h+1]=o*r*t[h])}}function gr(i,t,e="x"){const n=ln(e),s=i.length;let o,r,a,l=jt(i,0);for(let c=0;c<s;++c){if(r=a,a=l,l=jt(i,c+1),!a)continue;const h=a[e],d=a[n];r&&(o=(h-r[e])/3,a[`cp1${e}`]=h-o,a[`cp1${n}`]=d-o*t[c]),l&&(o=(l[e]-h)/3,a[`cp2${e}`]=h+o,a[`cp2${n}`]=d+o*t[c])}}function pr(i,t="x"){const e=ln(t),n=i.length,s=Array(n).fill(0),o=Array(n);let r,a,l,c=jt(i,0);for(r=0;r<n;++r)if(a=l,l=c,c=jt(i,r+1),!!l){if(c){const h=c[t]-l[t];s[r]=h!==0?(c[e]-l[e])/h:0}o[r]=a?c?Nt(s[r-1])!==Nt(s[r])?0:(s[r-1]+s[r])/2:s[r-1]:s[r]}ur(i,s,o),gr(i,o,t)}function ve(i,t,e){return Math.max(Math.min(i,e),t)}function mr(i,t){let e,n,s,o,r,a=ft(i[0],t);for(e=0,n=i.length;e<n;++e)r=o,o=a,a=e<n-1&&ft(i[e+1],t),o&&(s=i[e],r&&(s.cp1x=ve(s.cp1x,t.left,t.right),s.cp1y=ve(s.cp1y,t.top,t.bottom)),a&&(s.cp2x=ve(s.cp2x,t.left,t.right),s.cp2y=ve(s.cp2y,t.top,t.bottom)))}function br(i,t,e,n,s){let o,r,a,l;if(t.spanGaps&&(i=i.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")pr(i,s);else{let c=n?i[i.length-1]:i[0];for(o=0,r=i.length;o<r;++o)a=i[o],l=fr(c,a,i[Math.min(o+1,r-(n?0:1))%r],t.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,c=a}t.capBezierPoints&&mr(i,e)}function ci(){return typeof window<"u"&&typeof document<"u"}function hi(i){let t=i.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Ce(i,t,e){let n;return typeof i=="string"?(n=parseInt(i,10),i.indexOf("%")!==-1&&(n=n/100*t.parentNode[e])):n=i,n}const De=i=>i.ownerDocument.defaultView.getComputedStyle(i,null);function xr(i,t){return De(i).getPropertyValue(t)}const yr=["top","right","bottom","left"];function Ot(i,t,e){const n={};e=e?"-"+e:"";for(let s=0;s<4;s++){const o=yr[s];n[o]=parseFloat(i[t+"-"+o+e])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}const _r=(i,t,e)=>(i>0||t>0)&&(!e||!e.shadowRoot);function kr(i,t){const e=i.touches,n=e&&e.length?e[0]:i,{offsetX:s,offsetY:o}=n;let r=!1,a,l;if(_r(s,o,i.target))a=s,l=o;else{const c=t.getBoundingClientRect();a=n.clientX-c.left,l=n.clientY-c.top,r=!0}return{x:a,y:l,box:r}}function Tt(i,t){if("native"in i)return i;const{canvas:e,currentDevicePixelRatio:n}=t,s=De(e),o=s.boxSizing==="border-box",r=Ot(s,"padding"),a=Ot(s,"border","width"),{x:l,y:c,box:h}=kr(i,e),d=r.left+(h&&a.left),f=r.top+(h&&a.top);let{width:g,height:p}=t;return o&&(g-=r.width+a.width,p-=r.height+a.height),{x:Math.round((l-d)/g*e.width/n),y:Math.round((c-f)/p*e.height/n)}}function wr(i,t,e){let n,s;if(t===void 0||e===void 0){const o=i&&hi(i);if(!o)t=i.clientWidth,e=i.clientHeight;else{const r=o.getBoundingClientRect(),a=De(o),l=Ot(a,"border","width"),c=Ot(a,"padding");t=r.width-c.width-l.width,e=r.height-c.height-l.height,n=Ce(a.maxWidth,o,"clientWidth"),s=Ce(a.maxHeight,o,"clientHeight")}}return{width:t,height:e,maxWidth:n||be,maxHeight:s||be}}const St=i=>Math.round(i*10)/10;function Sr(i,t,e,n){const s=De(i),o=Ot(s,"margin"),r=Ce(s.maxWidth,i,"clientWidth")||be,a=Ce(s.maxHeight,i,"clientHeight")||be,l=wr(i,t,e);let{width:c,height:h}=l;if(s.boxSizing==="content-box"){const f=Ot(s,"border","width"),g=Ot(s,"padding");c-=g.width+f.width,h-=g.height+f.height}return c=Math.max(0,c-o.width),h=Math.max(0,n?c/n:h-o.height),c=St(Math.min(c,r,l.maxWidth)),h=St(Math.min(h,a,l.maxHeight)),c&&!h&&(h=St(c/2)),(t!==void 0||e!==void 0)&&n&&l.height&&h>l.height&&(h=l.height,c=St(Math.floor(h*n))),{width:c,height:h}}function cn(i,t,e){const n=t||1,s=St(i.height*n),o=St(i.width*n);i.height=St(i.height),i.width=St(i.width);const r=i.canvas;return r.style&&(e||!r.style.height&&!r.style.width)&&(r.style.height=`${i.height}px`,r.style.width=`${i.width}px`),i.currentDevicePixelRatio!==n||r.height!==s||r.width!==o?(i.currentDevicePixelRatio=n,r.height=s,r.width=o,i.ctx.setTransform(n,0,0,n,0,0),!0):!1}const Mr=(function(){let i=!1;try{const t={get passive(){return i=!0,!1}};ci()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return i})();function hn(i,t){const e=xr(i,t),n=e&&e.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function Et(i,t,e,n){return{x:i.x+e*(t.x-i.x),y:i.y+e*(t.y-i.y)}}function vr(i,t,e,n){return{x:i.x+e*(t.x-i.x),y:n==="middle"?e<.5?i.y:t.y:n==="after"?e<1?i.y:t.y:e>0?t.y:i.y}}function Cr(i,t,e,n){const s={x:i.cp2x,y:i.cp2y},o={x:t.cp1x,y:t.cp1y},r=Et(i,s,e),a=Et(s,o,e),l=Et(o,t,e),c=Et(r,a,e),h=Et(a,l,e);return Et(c,h,e)}const Dr=function(i,t){return{x(e){return i+i+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,n){return e-n},leftForLtr(e,n){return e-n}}},Pr=function(){return{x(i){return i},setWidth(i){},textAlign(i){return i},xPlus(i,t){return i+t},leftForLtr(i,t){return i}}};function $t(i,t,e){return i?Dr(t,e):Pr()}function dn(i,t){let e,n;(t==="ltr"||t==="rtl")&&(e=i.canvas.style,n=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),i.prevTextDirection=n)}function fn(i,t){t!==void 0&&(delete i.prevTextDirection,i.canvas.style.setProperty("direction",t[0],t[1]))}function un(i){return i==="angle"?{between:te,compare:So,normalize:G}:{between:Ct,compare:(t,e)=>t-e,normalize:t=>t}}function gn({start:i,end:t,count:e,loop:n,style:s}){return{start:i%e,end:t%e,loop:n&&(t-i+1)%e===0,style:s}}function Ar(i,t,e){const{property:n,start:s,end:o}=e,{between:r,normalize:a}=un(n),l=t.length;let{start:c,end:h,loop:d}=i,f,g;if(d){for(c+=l,h+=l,f=0,g=l;f<g&&r(a(t[c%l][n]),s,o);++f)c--,h--;c%=l,h%=l}return h<c&&(h+=l),{start:c,end:h,loop:d,style:i.style}}function pn(i,t,e){if(!e)return[i];const{property:n,start:s,end:o}=e,r=t.length,{compare:a,between:l,normalize:c}=un(n),{start:h,end:d,loop:f,style:g}=Ar(i,t,e),p=[];let b=!1,m=null,x,_,w;const v=()=>l(s,w,x)&&a(s,w)!==0,y=()=>a(o,x)===0||l(o,w,x),k=()=>b||v(),S=()=>!b||y();for(let M=h,C=h;M<=d;++M)_=t[M%r],!_.skip&&(x=c(_[n]),x!==w&&(b=l(x,s,o),m===null&&k()&&(m=a(x,s)===0?M:C),m!==null&&S()&&(p.push(gn({start:m,end:M,loop:f,count:r,style:g})),m=null),C=M,w=x));return m!==null&&p.push(gn({start:m,end:d,loop:f,count:r,style:g})),p}function mn(i,t){const e=[],n=i.segments;for(let s=0;s<n.length;s++){const o=pn(n[s],i.points,t);o.length&&e.push(...o)}return e}function Or(i,t,e,n){let s=0,o=t-1;if(e&&!n)for(;s<t&&!i[s].skip;)s++;for(;s<t&&i[s].skip;)s++;for(s%=t,e&&(o+=s);o>s&&i[o%t].skip;)o--;return o%=t,{start:s,end:o}}function Tr(i,t,e,n){const s=i.length,o=[];let r=t,a=i[t],l;for(l=t+1;l<=e;++l){const c=i[l%s];c.skip||c.stop?a.skip||(n=!1,o.push({start:t%s,end:(l-1)%s,loop:n}),t=r=c.stop?l:null):(r=l,a.skip&&(t=l)),a=c}return r!==null&&o.push({start:t%s,end:r%s,loop:n}),o}function Er(i,t){const e=i.points,n=i.options.spanGaps,s=e.length;if(!s)return[];const o=!!i._loop,{start:r,end:a}=Or(e,s,o,n);if(n===!0)return bn(i,[{start:r,end:a,loop:o}],e,t);const l=a<r?a+s:a,c=!!i._fullLoop&&r===0&&a===s-1;return bn(i,Tr(e,r,l,c),e,t)}function bn(i,t,e,n){return!n||!n.setContext||!e?t:Rr(i,t,e,n)}function Rr(i,t,e,n){const s=i._chart.getContext(),o=xn(i.options),{_datasetIndex:r,options:{spanGaps:a}}=i,l=e.length,c=[];let h=o,d=t[0].start,f=d;function g(p,b,m,x){const _=a?-1:1;if(p!==b){for(p+=l;e[p%l].skip;)p-=_;for(;e[b%l].skip;)b+=_;p%l!==b%l&&(c.push({start:p%l,end:b%l,loop:m,style:x}),h=x,d=b%l)}}for(const p of t){d=a?d:p.start;let b=e[d%l],m;for(f=d+1;f<=p.end;f++){const x=e[f%l];m=xn(n.setContext(wt(s,{type:"segment",p0:b,p1:x,p0DataIndex:(f-1)%l,p1DataIndex:f%l,datasetIndex:r}))),Lr(m,h)&&g(d,f-1,p.loop,h),b=x,h=m}d<f-1&&g(d,f-1,p.loop,h)}return c}function xn(i){return{backgroundColor:i.backgroundColor,borderCapStyle:i.borderCapStyle,borderDash:i.borderDash,borderDashOffset:i.borderDashOffset,borderJoinStyle:i.borderJoinStyle,borderWidth:i.borderWidth,borderColor:i.borderColor}}function Lr(i,t){if(!t)return!1;const e=[],n=function(s,o){return Ze(o)?(e.includes(o)||e.push(o),e.indexOf(o)):o};return JSON.stringify(i,n)!==JSON.stringify(t,n)}function Pe(i,t,e){return i.options.clip?i[e]:t[e]}function Br(i,t){const{xScale:e,yScale:n}=i;return e&&n?{left:Pe(e,t,"left"),right:Pe(e,t,"right"),top:Pe(n,t,"top"),bottom:Pe(n,t,"bottom")}:t}function yn(i,t){const e=t._clip;if(e.disabled)return!1;const n=Br(t,i.chartArea);return{left:e.left===!1?0:n.left-(e.left===!0?0:e.left),right:e.right===!1?i.width:n.right+(e.right===!0?0:e.right),top:e.top===!1?0:n.top-(e.top===!0?0:e.top),bottom:e.bottom===!1?i.height:n.bottom+(e.bottom===!0?0:e.bottom)}}class zr{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,n,s){const o=e.listeners[s],r=e.duration;o.forEach(a=>a({chart:t,initial:e.initial,numSteps:r,currentStep:Math.min(n-e.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=Ui.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((n,s)=>{if(!n.running||!n.items.length)return;const o=n.items;let r=o.length-1,a=!1,l;for(;r>=0;--r)l=o[r],l._active?(l._total>n.duration&&(n.duration=l._total),l.tick(t),a=!0):(o[r]=o[o.length-1],o.pop());a&&(s.draw(),this._notify(s,n,t,"progress")),o.length||(n.running=!1,this._notify(s,n,t,"complete"),n.initial=!1),e+=o.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let n=e.get(t);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,n)),n}listen(t,e,n){this._getAnims(t).listeners[e].push(n)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((n,s)=>Math.max(n,s._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const n=e.items;let s=n.length-1;for(;s>=0;--s)n[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var ut=new zr;const _n="transparent",Ir={boolean(i,t,e){return e>.5?t:i},color(i,t,e){const n=Ji(i||_n),s=n.valid&&Ji(t||_n);return s&&s.valid?s.mix(n,e).hexString():t},number(i,t,e){return i+(t-i)*e}};class Fr{constructor(t,e,n,s){const o=e[n];s=Me([t.to,s,o,t.from]);const r=Me([t.from,o,s]);this._active=!0,this._fn=t.fn||Ir[t.type||typeof r],this._easing=ee[t.easing]||ee.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=n,this._from=r,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,n){if(this._active){this._notify(!1);const s=this._target[this._prop],o=n-this._start,r=this._duration-o;this._start=n,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=Me([t.to,e,s,t.from]),this._from=Me([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,n=this._duration,s=this._prop,o=this._from,r=this._loop,a=this._to;let l;if(this._active=o!==a&&(r||e<n),!this._active){this._target[s]=a,this._notify(!0);return}if(e<0){this._target[s]=o;return}l=e/n%2,l=r&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(o,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,n)=>{t.push({res:e,rej:n})})}_notify(t){const e=t?"res":"rej",n=this._promises||[];for(let s=0;s<n.length;s++)n[s][e]()}}class kn{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!R(t))return;const e=Object.keys($.animation),n=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const o=t[s];if(!R(o))return;const r={};for(const a of e)r[a]=o[a];(j(o.properties)&&o.properties||[s]).forEach(a=>{(a===s||!n.has(a))&&n.set(a,r)})})}_animateOptions(t,e){const n=e.options,s=Vr(t,n);if(!s)return[];const o=this._createAnimations(s,n);return n.$shared&&Nr(t.options.$animations,n).then(()=>{t.options=n},()=>{}),o}_createAnimations(t,e){const n=this._properties,s=[],o=t.$animations||(t.$animations={}),r=Object.keys(e),a=Date.now();let l;for(l=r.length-1;l>=0;--l){const c=r[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,e));continue}const h=e[c];let d=o[c];const f=n.get(c);if(d)if(f&&d.active()){d.update(f,h,a);continue}else d.cancel();if(!f||!f.duration){t[c]=h;continue}o[c]=d=new Fr(f,t,c,h),s.push(d)}return s}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const n=this._createAnimations(t,e);if(n.length)return ut.add(this._chart,n),!0}}function Nr(i,t){const e=[],n=Object.keys(t);for(let s=0;s<n.length;s++){const o=i[n[s]];o&&o.active()&&e.push(o.wait())}return Promise.all(e)}function Vr(i,t){if(!t)return;let e=i.options;if(!e){i.options=t;return}return e.$shared&&(i.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function wn(i,t){const e=i&&i.options||{},n=e.reverse,s=e.min===void 0?t:0,o=e.max===void 0?t:0;return{start:n?o:s,end:n?s:o}}function Wr(i,t,e){if(e===!1)return!1;const n=wn(i,e),s=wn(t,e);return{top:s.end,right:n.end,bottom:s.start,left:n.start}}function Hr(i){let t,e,n,s;return R(i)?(t=i.top,e=i.right,n=i.bottom,s=i.left):t=e=n=s=i,{top:t,right:e,bottom:n,left:s,disabled:i===!1}}function Sn(i,t){const e=[],n=i._getSortedDatasetMetas(t);let s,o;for(s=0,o=n.length;s<o;++s)e.push(n[s].index);return e}function Mn(i,t,e,n={}){const s=i.keys,o=n.mode==="single";let r,a,l,c;if(t===null)return;let h=!1;for(r=0,a=s.length;r<a;++r){if(l=+s[r],l===e){if(h=!0,n.all)continue;break}c=i.values[l],X(c)&&(o||t===0||Nt(t)===Nt(c))&&(t+=c)}return!h&&!n.all?0:t}function jr(i,t){const{iScale:e,vScale:n}=t,s=e.axis==="x"?"x":"y",o=n.axis==="x"?"x":"y",r=Object.keys(i),a=new Array(r.length);let l,c,h;for(l=0,c=r.length;l<c;++l)h=r[l],a[l]={[s]:h,[o]:i[h]};return a}function di(i,t){const e=i&&i.options.stacked;return e||e===void 0&&t.stack!==void 0}function $r(i,t,e){return`${i.id}.${t.id}.${e.stack||e.type}`}function Yr(i){const{min:t,max:e,minDefined:n,maxDefined:s}=i.getUserBounds();return{min:n?t:Number.NEGATIVE_INFINITY,max:s?e:Number.POSITIVE_INFINITY}}function Ur(i,t,e){const n=i[t]||(i[t]={});return n[e]||(n[e]={})}function vn(i,t,e,n){for(const s of t.getMatchingVisibleMetas(n).reverse()){const o=i[s.index];if(e&&o>0||!e&&o<0)return s.index}return null}function Cn(i,t){const{chart:e,_cachedMeta:n}=i,s=e._stacks||(e._stacks={}),{iScale:o,vScale:r,index:a}=n,l=o.axis,c=r.axis,h=$r(o,r,n),d=t.length;let f;for(let g=0;g<d;++g){const p=t[g],{[l]:b,[c]:m}=p,x=p._stacks||(p._stacks={});f=x[c]=Ur(s,h,b),f[a]=m,f._top=vn(f,r,!0,n.type),f._bottom=vn(f,r,!1,n.type);const _=f._visualValues||(f._visualValues={});_[a]=m}}function fi(i,t){const e=i.scales;return Object.keys(e).filter(n=>e[n].axis===t).shift()}function Xr(i,t){return wt(i,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function qr(i,t,e){return wt(i,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function ne(i,t){const e=i.controller.index,n=i.vScale&&i.vScale.axis;if(n){t=t||i._parsed;for(const s of t){const o=s._stacks;if(!o||o[n]===void 0||o[n][e]===void 0)return;delete o[n][e],o[n]._visualValues!==void 0&&o[n]._visualValues[e]!==void 0&&delete o[n]._visualValues[e]}}}const ui=i=>i==="reset"||i==="none",Dn=(i,t)=>t?i:Object.assign({},i),Kr=(i,t,e)=>i&&!t.hidden&&t._stacked&&{keys:Sn(e,!0),values:null};class Ae{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(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=di(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&&ne(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,n=this.getDataset(),s=(d,f,g,p)=>d==="x"?f:d==="r"?p:g,o=e.xAxisID=T(n.xAxisID,fi(t,"x")),r=e.yAxisID=T(n.yAxisID,fi(t,"y")),a=e.rAxisID=T(n.rAxisID,fi(t,"r")),l=e.indexAxis,c=e.iAxisID=s(l,o,r,a),h=e.vAxisID=s(l,r,o,a);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(r),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(c),e.vScale=this.getScaleForId(h)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Yi(this._data,this),t._stacked&&ne(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),n=this._data;if(R(e)){const s=this._cachedMeta;this._data=jr(e,s)}else if(n!==e){if(n){Yi(n,this);const s=this._cachedMeta;ne(s),s._parsed=[]}e&&Object.isExtensible(e)&&Do(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,n=this.getDataset();let s=!1;this._dataCheck();const o=e._stacked;e._stacked=di(e.vScale,e),e.stack!==n.stack&&(s=!0,ne(e),e.stack=n.stack),this._resyncElements(t),(s||o!==e._stacked)&&(Cn(this,e._parsed),e._stacked=di(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),n=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:n,_data:s}=this,{iScale:o,_stacked:r}=n,a=o.axis;let l=t===0&&e===s.length?!0:n._sorted,c=t>0&&n._parsed[t-1],h,d,f;if(this._parsing===!1)n._parsed=s,n._sorted=!0,f=s;else{j(s[t])?f=this.parseArrayData(n,s,t,e):R(s[t])?f=this.parseObjectData(n,s,t,e):f=this.parsePrimitiveData(n,s,t,e);const g=()=>d[a]===null||c&&d[a]<c[a];for(h=0;h<e;++h)n._parsed[h+t]=d=f[h],l&&(g()&&(l=!1),c=d);n._sorted=l}r&&Cn(this,f)}parsePrimitiveData(t,e,n,s){const{iScale:o,vScale:r}=t,a=o.axis,l=r.axis,c=o.getLabels(),h=o===r,d=new Array(s);let f,g,p;for(f=0,g=s;f<g;++f)p=f+n,d[f]={[a]:h||o.parse(c[p],p),[l]:r.parse(e[p],p)};return d}parseArrayData(t,e,n,s){const{xScale:o,yScale:r}=t,a=new Array(s);let l,c,h,d;for(l=0,c=s;l<c;++l)h=l+n,d=e[h],a[l]={x:o.parse(d[0],h),y:r.parse(d[1],h)};return a}parseObjectData(t,e,n,s){const{xScale:o,yScale:r}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(s);let h,d,f,g;for(h=0,d=s;h<d;++h)f=h+n,g=e[f],c[h]={x:o.parse(Ft(g,a),f),y:r.parse(Ft(g,l),f)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,n){const s=this.chart,o=this._cachedMeta,r=e[t.axis],a={keys:Sn(s,!0),values:e._stacks[t.axis]._visualValues};return Mn(a,r,o.index,{mode:n})}updateRangeFromParsed(t,e,n,s){const o=n[e.axis];let r=o===null?NaN:o;const a=s&&n._stacks[e.axis];s&&a&&(s.values=a,r=Mn(s,o,this._cachedMeta.index)),t.min=Math.min(t.min,r),t.max=Math.max(t.max,r)}getMinMax(t,e){const n=this._cachedMeta,s=n._parsed,o=n._sorted&&t===n.iScale,r=s.length,a=this._getOtherScale(t),l=Kr(e,n,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:d}=Yr(a);let f,g;function p(){g=s[f];const b=g[a.axis];return!X(g[t.axis])||h>b||d<b}for(f=0;f<r&&!(!p()&&(this.updateRangeFromParsed(c,t,g,l),o));++f);if(o){for(f=r-1;f>=0;--f)if(!p()){this.updateRangeFromParsed(c,t,g,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,n=[];let s,o,r;for(s=0,o=e.length;s<o;++s)r=e[s][t.axis],X(r)&&n.push(r);return n}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,n=e.iScale,s=e.vScale,o=this.getParsed(t);return{label:n?""+n.getLabelForValue(o[n.axis]):"",value:s?""+s.getLabelForValue(o[s.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=Hr(T(this.options.clip,Wr(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,n=this._cachedMeta,s=n.data||[],o=e.chartArea,r=[],a=this._drawStart||0,l=this._drawCount||s.length-a,c=this.options.drawActiveElementsOnTop;let h;for(n.dataset&&n.dataset.draw(t,o,a,l),h=a;h<a+l;++h){const d=s[h];d.hidden||(d.active&&c?r.push(d):d.draw(t,o))}for(h=0;h<r.length;++h)r[h].draw(t,o)}getStyle(t,e){const n=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(n):this.resolveDataElementOptions(t||0,n)}getContext(t,e,n){const s=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const r=this._cachedMeta.data[t];o=r.$context||(r.$context=qr(this.getContext(),t,r)),o.parsed=this.getParsed(t),o.raw=s.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=Xr(this.chart.getContext(),this.index)),o.dataset=s,o.index=o.datasetIndex=this.index;return o.active=!!e,o.mode=n,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",n){const s=e==="active",o=this._cachedDataOpts,r=t+"-"+e,a=o[r],l=this.enableOptionSharing&&me(n);if(a)return Dn(a,l);const c=this.chart.config,h=c.datasetElementScopeKeys(this._type,t),d=s?[`${t}Hover`,"hover",t,""]:[t,""],f=c.getOptionScopes(this.getDataset(),h),g=Object.keys($.elements[t]),p=()=>this.getContext(n,s,e),b=c.resolveNamedOptions(f,g,p,d);return b.$shared&&(b.$shared=l,o[r]=Object.freeze(Dn(b,l))),b}_resolveAnimations(t,e,n){const s=this.chart,o=this._cachedDataOpts,r=`animation-${e}`,a=o[r];if(a)return a;let l;if(s.options.animation!==!1){const h=this.chart.config,d=h.datasetAnimationScopeKeys(this._type,e),f=h.getOptionScopes(this.getDataset(),d);l=h.createResolver(f,this.getContext(t,n,e))}const c=new kn(s,l&&l.animations);return l&&l._cacheable&&(o[r]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||ui(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const n=this.resolveDataElementOptions(t,e),s=this._sharedOptions,o=this.getSharedOptions(n),r=this.includeOptions(e,o)||o!==s;return this.updateSharedOptions(o,e,n),{sharedOptions:o,includeOptions:r}}updateElement(t,e,n,s){ui(s)?Object.assign(t,n):this._resolveAnimations(e,s).update(t,n)}updateSharedOptions(t,e,n){t&&!ui(e)&&this._resolveAnimations(void 0,e).update(t,n)}_setStyle(t,e,n,s){t.active=s;const o=this.getStyle(e,s);this._resolveAnimations(e,n,s).update(t,{options:!s&&this.getSharedOptions(o)||o})}removeHoverStyle(t,e,n){this._setStyle(t,n,"active",!1)}setHoverStyle(t,e,n){this._setStyle(t,n,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,n=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const s=n.length,o=e.length,r=Math.min(o,s);r&&this.parse(0,r),o>s?this._insertElements(s,o-s,t):o<s&&this._removeElements(o,s-o)}_insertElements(t,e,n=!0){const s=this._cachedMeta,o=s.data,r=t+e;let a;const l=c=>{for(c.length+=e,a=c.length-1;a>=r;a--)c[a]=c[a-e]};for(l(o),a=t;a<r;++a)o[a]=new this.dataElementType;this._parsing&&l(s._parsed),this.parse(t,e),n&&this.updateElements(o,t,e,"reset")}updateElements(t,e,n,s){}_removeElements(t,e){const n=this._cachedMeta;if(this._parsing){const s=n._parsed.splice(t,e);n._stacked&&ne(n,s)}n.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,n,s]=t;this[e](n,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const n=arguments.length-2;n&&this._sync(["_insertElements",t,n])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function Gr(i,t,e){let n=1,s=1,o=0,r=0;if(t<W){const a=i,l=a+t,c=Math.cos(a),h=Math.sin(a),d=Math.cos(l),f=Math.sin(l),g=(w,v,y)=>te(w,a,l,!0)?1:Math.max(v,v*e,y,y*e),p=(w,v,y)=>te(w,a,l,!0)?-1:Math.min(v,v*e,y,y*e),b=g(0,c,d),m=g(Y,h,f),x=p(B,c,d),_=p(B+Y,h,f);n=(b-x)/2,s=(m-_)/2,o=-(b+x)/2,r=-(m+_)/2}return{ratioX:n,ratioY:s,offsetX:o,offsetY:r}}class Jr extends Ae{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){const e=t.data,{labels:{pointStyle:n,textAlign:s,color:o,useBorderRadius:r,borderRadius:a}}=t.legend.options;return e.labels.length&&e.datasets.length?e.labels.map((l,c)=>{const d=t.getDatasetMeta(0).controller.getStyle(c);return{text:l,fillStyle:d.backgroundColor,fontColor:o,hidden:!t.getDataVisibility(c),lineDash:d.borderDash,lineDashOffset:d.borderDashOffset,lineJoin:d.borderJoinStyle,lineWidth:d.borderWidth,strokeStyle:d.borderColor,textAlign:s,pointStyle:n,borderRadius:r&&(a||d.borderRadius),index:c}}):[]}},onClick(t,e,n){n.chart.toggleDataVisibility(e.index),n.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){const n=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=n;else{let o=l=>+n[l];if(R(n[t])){const{key:l="value"}=this._parsing;o=c=>+Ft(n[c],l)}let r,a;for(r=t,a=t+e;r<a;++r)s._parsed[r]=o(r)}}_getRotation(){return rt(this.options.rotation-90)}_getCircumference(){return rt(this.options.circumference)}_getRotationExtents(){let t=W,e=-W;for(let n=0;n<this.chart.data.datasets.length;++n)if(this.chart.isDatasetVisible(n)&&this.chart.getDatasetMeta(n).type===this._type){const s=this.chart.getDatasetMeta(n).controller,o=s._getRotation(),r=s._getCircumference();t=Math.min(t,o),e=Math.max(e,o+r)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:n}=e,s=this._cachedMeta,o=s.data,r=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,a=Math.max((Math.min(n.width,n.height)-r)/2,0),l=Math.min(ho(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:h,rotation:d}=this._getRotationExtents(),{ratioX:f,ratioY:g,offsetX:p,offsetY:b}=Gr(d,h,l),m=(n.width-r)/f,x=(n.height-r)/g,_=Math.max(Math.min(m,x)/2,0),w=Bi(this.options.radius,_),v=Math.max(w*l,0),y=(w-v)/this._getVisibleDatasetWeightTotal();this.offsetX=p*w,this.offsetY=b*w,s.total=this.calculateTotal(),this.outerRadius=w-y*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-y*c,0),this.updateElements(o,0,o.length,t)}_circumference(t,e){const n=this.options,s=this._cachedMeta,o=this._getCircumference();return e&&n.animation.animateRotate||!this.chart.getDataVisibility(t)||s._parsed[t]===null||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*o/W)}updateElements(t,e,n,s){const o=s==="reset",r=this.chart,a=r.chartArea,c=r.options.animation,h=(a.left+a.right)/2,d=(a.top+a.bottom)/2,f=o&&c.animateScale,g=f?0:this.innerRadius,p=f?0:this.outerRadius,{sharedOptions:b,includeOptions:m}=this._getSharedOptions(e,s);let x=this._getRotation(),_;for(_=0;_<e;++_)x+=this._circumference(_,o);for(_=e;_<e+n;++_){const w=this._circumference(_,o),v=t[_],y={x:h+this.offsetX,y:d+this.offsetY,startAngle:x,endAngle:x+w,circumference:w,outerRadius:p,innerRadius:g};m&&(y.options=b||this.resolveDataElementOptions(_,v.active?"active":s)),x+=w,this.updateElement(v,_,y,s)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let n=0,s;for(s=0;s<e.length;s++){const o=t._parsed[s];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(s)&&!e[s].hidden&&(n+=Math.abs(o))}return n}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?W*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart,s=n.data.labels||[],o=ye(e._parsed[t],n.options.locale);return{label:s[t]||"",value:o}}getMaxBorderWidth(t){let e=0;const n=this.chart;let s,o,r,a,l;if(!t){for(s=0,o=n.data.datasets.length;s<o;++s)if(n.isDatasetVisible(s)){r=n.getDatasetMeta(s),t=r.data,a=r.controller;break}}if(!t)return 0;for(s=0,o=t.length;s<o;++s)l=a.resolveDataElementOptions(s),l.borderAlign!=="inner"&&(e=Math.max(e,l.borderWidth||0,l.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let n=0,s=t.length;n<s;++n){const o=this.resolveDataElementOptions(n);e=Math.max(e,o.offset||0,o.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let n=0;n<t;++n)this.chart.isDatasetVisible(n)&&(e+=this._getRingWeight(n));return e}_getRingWeight(t){return Math.max(T(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class Qr extends Ae{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:n,data:s=[],_dataset:o}=e,r=this.chart._animationsDisabled;let{start:a,count:l}=To(e,s,r);this._drawStart=a,this._drawCount=l,Eo(e)&&(a=0,l=s.length),n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!o._decimated,n.points=s;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(n,void 0,{animated:!r,options:c},t),this.updateElements(s,a,l,t)}updateElements(t,e,n,s){const o=s==="reset",{iScale:r,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:h,includeOptions:d}=this._getSharedOptions(e,s),f=r.axis,g=a.axis,{spanGaps:p,segment:b}=this.options,m=Zt(p)?p:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||o||s==="none",_=e+n,w=t.length;let v=e>0&&this.getParsed(e-1);for(let y=0;y<w;++y){const k=t[y],S=x?k:{};if(y<e||y>=_){S.skip=!0;continue}const M=this.getParsed(y),C=z(M[g]),D=S[f]=r.getPixelForValue(M[f],y),P=S[g]=o||C?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,M,l):M[g],y);S.skip=isNaN(D)||isNaN(P)||C,S.stop=y>0&&Math.abs(M[f]-v[f])>m,b&&(S.parsed=M,S.raw=c.data[y]),d&&(S.options=h||this.resolveDataElementOptions(y,k.active?"active":s)),x||this.updateElement(k,y,S,s),v=M}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,n=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return n;const o=s[0].size(this.resolveDataElementOptions(0)),r=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(n,o,r)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}class Zr extends Ae{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){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:n,color:s}}=t.legend.options;return e.labels.map((o,r)=>{const l=t.getDatasetMeta(0).controller.getStyle(r);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:n,hidden:!t.getDataVisibility(r),index:r}})}return[]}},onClick(t,e,n){n.chart.toggleDataVisibility(e.index),n.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){const e=this._cachedMeta,n=this.chart,s=n.data.labels||[],o=ye(e._parsed[t].r,n.options.locale);return{label:s[t]||"",value:o}}parseObjectData(t,e,n,s){return hr.bind(this)(t,e,n,s)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((n,s)=>{const o=this.getParsed(s).r;!isNaN(o)&&this.chart.getDataVisibility(s)&&(o<e.min&&(e.min=o),o>e.max&&(e.max=o))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,n=t.options,s=Math.min(e.right-e.left,e.bottom-e.top),o=Math.max(s/2,0),r=Math.max(n.cutoutPercentage?o/100*n.cutoutPercentage:1,0),a=(o-r)/t.getVisibleDatasetCount();this.outerRadius=o-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,e,n,s){const o=s==="reset",r=this.chart,l=r.options.animation,c=this._cachedMeta.rScale,h=c.xCenter,d=c.yCenter,f=c.getIndexAngle(0)-.5*B;let g=f,p;const b=360/this.countVisibleElements();for(p=0;p<e;++p)g+=this._computeAngle(p,s,b);for(p=e;p<e+n;p++){const m=t[p];let x=g,_=g+this._computeAngle(p,s,b),w=r.getDataVisibility(p)?c.getDistanceFromCenterForValue(this.getParsed(p).r):0;g=_,o&&(l.animateScale&&(w=0),l.animateRotate&&(x=_=f));const v={x:h,y:d,innerRadius:0,outerRadius:w,startAngle:x,endAngle:_,options:this.resolveDataElementOptions(p,m.active?"active":s)};this.updateElement(m,p,v,s)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((n,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&e++}),e}_computeAngle(t,e,n){return this.chart.getDataVisibility(t)?rt(this.resolveDataElementOptions(t,e).angle||n):0}}function Rt(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class gi{static override(t){Object.assign(gi.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return Rt()}parse(){return Rt()}format(){return Rt()}add(){return Rt()}diff(){return Rt()}startOf(){return Rt()}endOf(){return Rt()}}var ta={_date:gi};function ea(i,t,e,n){const{controller:s,data:o,_sorted:r}=i,a=s._cachedMeta.iScale,l=i.dataset&&i.dataset.options?i.dataset.options.spanGaps:null;if(a&&t===a.axis&&t!=="r"&&r&&o.length){const c=a._reversePixels?vo:Dt;if(n){if(s._sharedOptions){const h=o[0],d=typeof h.getRange=="function"&&h.getRange(t);if(d){const f=c(o,t,e-d),g=c(o,t,e+d);return{lo:f.lo,hi:g.hi}}}}else{const h=c(o,t,e);if(l){const{vScale:d}=s._cachedMeta,{_parsed:f}=i,g=f.slice(0,h.lo+1).reverse().findIndex(b=>!z(b[d.axis]));h.lo-=Math.max(0,g);const p=f.slice(h.hi).findIndex(b=>!z(b[d.axis]));h.hi+=Math.max(0,p)}return h}}return{lo:0,hi:o.length-1}}function Oe(i,t,e,n,s){const o=i.getSortedVisibleDatasetMetas(),r=e[t];for(let a=0,l=o.length;a<l;++a){const{index:c,data:h}=o[a],{lo:d,hi:f}=ea(o[a],t,r,s);for(let g=d;g<=f;++g){const p=h[g];p.skip||n(p,c,g)}}}function ia(i){const t=i.indexOf("x")!==-1,e=i.indexOf("y")!==-1;return function(n,s){const o=t?Math.abs(n.x-s.x):0,r=e?Math.abs(n.y-s.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(r,2))}}function pi(i,t,e,n,s){const o=[];return!s&&!i.isPointInArea(t)||Oe(i,e,t,function(a,l,c){!s&&!ft(a,i.chartArea,0)||a.inRange(t.x,t.y,n)&&o.push({element:a,datasetIndex:l,index:c})},!0),o}function na(i,t,e,n){let s=[];function o(r,a,l){const{startAngle:c,endAngle:h}=r.getProps(["startAngle","endAngle"],n),{angle:d}=ji(r,{x:t.x,y:t.y});te(d,c,h)&&s.push({element:r,datasetIndex:a,index:l})}return Oe(i,e,t,o),s}function sa(i,t,e,n,s,o){let r=[];const a=ia(e);let l=Number.POSITIVE_INFINITY;function c(h,d,f){const g=h.inRange(t.x,t.y,s);if(n&&!g)return;const p=h.getCenterPoint(s);if(!(!!o||i.isPointInArea(p))&&!g)return;const m=a(t,p);m<l?(r=[{element:h,datasetIndex:d,index:f}],l=m):m===l&&r.push({element:h,datasetIndex:d,index:f})}return Oe(i,e,t,c),r}function mi(i,t,e,n,s,o){return!o&&!i.isPointInArea(t)?[]:e==="r"&&!n?na(i,t,e,s):sa(i,t,e,n,s,o)}function Pn(i,t,e,n,s){const o=[],r=e==="x"?"inXRange":"inYRange";let a=!1;return Oe(i,e,t,(l,c,h)=>{l[r]&&l[r](t[e],s)&&(o.push({element:l,datasetIndex:c,index:h}),a=a||l.inRange(t.x,t.y,s))}),n&&!a?[]:o}var oa={modes:{index(i,t,e,n){const s=Tt(t,i),o=e.axis||"x",r=e.includeInvisible||!1,a=e.intersect?pi(i,s,o,n,r):mi(i,s,o,!1,n,r),l=[];return a.length?(i.getSortedVisibleDatasetMetas().forEach(c=>{const h=a[0].index,d=c.data[h];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:h})}),l):[]},dataset(i,t,e,n){const s=Tt(t,i),o=e.axis||"xy",r=e.includeInvisible||!1;let a=e.intersect?pi(i,s,o,n,r):mi(i,s,o,!1,n,r);if(a.length>0){const l=a[0].datasetIndex,c=i.getDatasetMeta(l).data;a=[];for(let h=0;h<c.length;++h)a.push({element:c[h],datasetIndex:l,index:h})}return a},point(i,t,e,n){const s=Tt(t,i),o=e.axis||"xy",r=e.includeInvisible||!1;return pi(i,s,o,n,r)},nearest(i,t,e,n){const s=Tt(t,i),o=e.axis||"xy",r=e.includeInvisible||!1;return mi(i,s,o,e.intersect,n,r)},x(i,t,e,n){const s=Tt(t,i);return Pn(i,s,"x",e.intersect,n)},y(i,t,e,n){const s=Tt(t,i);return Pn(i,s,"y",e.intersect,n)}}};const An=["left","top","right","bottom"];function se(i,t){return i.filter(e=>e.pos===t)}function On(i,t){return i.filter(e=>An.indexOf(e.pos)===-1&&e.box.axis===t)}function oe(i,t){return i.sort((e,n)=>{const s=t?n:e,o=t?e:n;return s.weight===o.weight?s.index-o.index:s.weight-o.weight})}function ra(i){const t=[];let e,n,s,o,r,a;for(e=0,n=(i||[]).length;e<n;++e)s=i[e],{position:o,options:{stack:r,stackWeight:a=1}}=s,t.push({index:e,box:s,pos:o,horizontal:s.isHorizontal(),weight:s.weight,stack:r&&o+r,stackWeight:a});return t}function aa(i){const t={};for(const e of i){const{stack:n,pos:s,stackWeight:o}=e;if(!n||!An.includes(s))continue;const r=t[n]||(t[n]={count:0,placed:0,weight:0,size:0});r.count++,r.weight+=o}return t}function la(i,t){const e=aa(i),{vBoxMaxWidth:n,hBoxMaxHeight:s}=t;let o,r,a;for(o=0,r=i.length;o<r;++o){a=i[o];const{fullSize:l}=a.box,c=e[a.stack],h=c&&a.stackWeight/c.weight;a.horizontal?(a.width=h?h*n:l&&t.availableWidth,a.height=s):(a.width=n,a.height=h?h*s:l&&t.availableHeight)}return e}function ca(i){const t=ra(i),e=oe(t.filter(c=>c.box.fullSize),!0),n=oe(se(t,"left"),!0),s=oe(se(t,"right")),o=oe(se(t,"top"),!0),r=oe(se(t,"bottom")),a=On(t,"x"),l=On(t,"y");return{fullSize:e,leftAndTop:n.concat(o),rightAndBottom:s.concat(l).concat(r).concat(a),chartArea:se(t,"chartArea"),vertical:n.concat(s).concat(l),horizontal:o.concat(r).concat(a)}}function Tn(i,t,e,n){return Math.max(i[e],t[e])+Math.max(i[n],t[n])}function En(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 ha(i,t,e,n){const{pos:s,box:o}=e,r=i.maxPadding;if(!R(s)){e.size&&(i[s]-=e.size);const d=n[e.stack]||{size:0,count:1};d.size=Math.max(d.size,e.horizontal?o.height:o.width),e.size=d.size/d.count,i[s]+=e.size}o.getPadding&&En(r,o.getPadding());const a=Math.max(0,t.outerWidth-Tn(r,i,"left","right")),l=Math.max(0,t.outerHeight-Tn(r,i,"top","bottom")),c=a!==i.w,h=l!==i.h;return i.w=a,i.h=l,e.horizontal?{same:c,other:h}:{same:h,other:c}}function da(i){const t=i.maxPadding;function e(n){const s=Math.max(t[n]-i[n],0);return i[n]+=s,s}i.y+=e("top"),i.x+=e("left"),e("right"),e("bottom")}function fa(i,t){const e=t.maxPadding;function n(s){const o={left:0,top:0,right:0,bottom:0};return s.forEach(r=>{o[r]=Math.max(t[r],e[r])}),o}return n(i?["left","right"]:["top","bottom"])}function re(i,t,e,n){const s=[];let o,r,a,l,c,h;for(o=0,r=i.length,c=0;o<r;++o){a=i[o],l=a.box,l.update(a.width||t.w,a.height||t.h,fa(a.horizontal,t));const{same:d,other:f}=ha(t,e,a,n);c|=d&&s.length,h=h||f,l.fullSize||s.push(a)}return c&&re(s,t,e,n)||h}function Te(i,t,e,n,s){i.top=e,i.left=t,i.right=t+n,i.bottom=e+s,i.width=n,i.height=s}function Rn(i,t,e,n){const s=e.padding;let{x:o,y:r}=t;for(const a of i){const l=a.box,c=n[a.stack]||{placed:0,weight:1},h=a.stackWeight/c.weight||1;if(a.horizontal){const d=t.w*h,f=c.size||l.height;me(c.start)&&(r=c.start),l.fullSize?Te(l,s.left,r,e.outerWidth-s.right-s.left,f):Te(l,t.left+c.placed,r,d,f),c.start=r,c.placed+=d,r=l.bottom}else{const d=t.h*h,f=c.size||l.width;me(c.start)&&(o=c.start),l.fullSize?Te(l,o,s.top,f,e.outerHeight-s.bottom-s.top):Te(l,o,t.top+c.placed,f,d),c.start=o,c.placed+=d,o=l.right}}t.x=o,t.y=r}var Mt={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){const 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,n){if(!i)return;const s=Q(i.options.layout.padding),o=Math.max(t-s.width,0),r=Math.max(e-s.height,0),a=ca(i.boxes),l=a.vertical,c=a.horizontal;I(i.boxes,b=>{typeof b.beforeLayout=="function"&&b.beforeLayout()});const h=l.reduce((b,m)=>m.box.options&&m.box.options.display===!1?b:b+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:e,padding:s,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/h,hBoxMaxHeight:r/2}),f=Object.assign({},s);En(f,Q(n));const g=Object.assign({maxPadding:f,w:o,h:r,x:s.left,y:s.top},s),p=la(l.concat(c),d);re(a.fullSize,g,d,p),re(l,g,d,p),re(c,g,d,p)&&re(l,g,d,p),da(g),Rn(a.leftAndTop,g,d,p),g.x+=g.w,g.y+=g.h,Rn(a.rightAndBottom,g,d,p),i.chartArea={left:g.left,top:g.top,right:g.left+g.w,bottom:g.top+g.h,height:g.h,width:g.w},I(a.chartArea,b=>{const m=b.box;Object.assign(m,i.chartArea),m.update(g.w,g.h,{left:0,top:0,right:0,bottom:0})})}};class Ln{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,n){}removeEventListener(t,e,n){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,n,s){return e=Math.max(0,e||t.width),n=n||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):n)}}isAttached(t){return!0}updateConfig(t){}}class ua extends Ln{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Ee="$chartjs",ga={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Bn=i=>i===null||i==="";function pa(i,t){const e=i.style,n=i.getAttribute("height"),s=i.getAttribute("width");if(i[Ee]={initial:{height:n,width:s,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",Bn(s)){const o=hn(i,"width");o!==void 0&&(i.width=o)}if(Bn(n))if(i.style.height==="")i.height=i.width/(t||2);else{const o=hn(i,"height");o!==void 0&&(i.height=o)}return i}const zn=Mr?{passive:!0}:!1;function ma(i,t,e){i&&i.addEventListener(t,e,zn)}function ba(i,t,e){i&&i.canvas&&i.canvas.removeEventListener(t,e,zn)}function xa(i,t){const e=ga[i.type]||i.type,{x:n,y:s}=Tt(i,t);return{type:e,chart:t,native:i,x:n!==void 0?n:null,y:s!==void 0?s:null}}function Re(i,t){for(const e of i)if(e===t||e.contains(t))return!0}function ya(i,t,e){const n=i.canvas,s=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||Re(a.addedNodes,n),r=r&&!Re(a.removedNodes,n);r&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}function _a(i,t,e){const n=i.canvas,s=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||Re(a.removedNodes,n),r=r&&!Re(a.addedNodes,n);r&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}const ae=new Map;let In=0;function Fn(){const i=window.devicePixelRatio;i!==In&&(In=i,ae.forEach((t,e)=>{e.currentDevicePixelRatio!==i&&t()}))}function ka(i,t){ae.size||window.addEventListener("resize",Fn),ae.set(i,t)}function wa(i){ae.delete(i),ae.size||window.removeEventListener("resize",Fn)}function Sa(i,t,e){const n=i.canvas,s=n&&hi(n);if(!s)return;const o=Xi((a,l)=>{const c=s.clientWidth;e(a,l),c<s.clientWidth&&e()},window),r=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,h=l.contentRect.height;c===0&&h===0||o(c,h)});return r.observe(s),ka(i,o),r}function bi(i,t,e){e&&e.disconnect(),t==="resize"&&wa(i)}function Ma(i,t,e){const n=i.canvas,s=Xi(o=>{i.ctx!==null&&e(xa(o,i))},i);return ma(n,t,s),s}class va extends Ln{acquireContext(t,e){const n=t&&t.getContext&&t.getContext("2d");return n&&n.canvas===t?(pa(t,e),n):null}releaseContext(t){const e=t.canvas;if(!e[Ee])return!1;const n=e[Ee].initial;["height","width"].forEach(o=>{const r=n[o];z(r)?e.removeAttribute(o):e.setAttribute(o,r)});const s=n.style||{};return Object.keys(s).forEach(o=>{e.style[o]=s[o]}),e.width=e.width,delete e[Ee],!0}addEventListener(t,e,n){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),r={attach:ya,detach:_a,resize:Sa}[e]||Ma;s[e]=r(t,e,n)}removeEventListener(t,e){const n=t.$proxies||(t.$proxies={}),s=n[e];if(!s)return;({attach:bi,detach:bi,resize:bi}[e]||ba)(t,e,s),n[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,n,s){return Sr(t,e,n,s)}isAttached(t){const e=t&&hi(t);return!!(e&&e.isConnected)}}function Ca(i){return!ci()||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas?ua:va}class Lt{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:e,y:n}=this.getProps(["x","y"],t);return{x:e,y:n}}hasValue(){return Zt(this.x)&&Zt(this.y)}getProps(t,e){const n=this.$animations;if(!e||!n)return this;const s={};return t.forEach(o=>{s[o]=n[o]&&n[o].active()?n[o]._to:this[o]}),s}}function Da(i,t){const e=i.options.ticks,n=Pa(i),s=Math.min(e.maxTicksLimit||n,n),o=e.major.enabled?Oa(t):[],r=o.length,a=o[0],l=o[r-1],c=[];if(r>s)return Ta(t,c,o,r/s),c;const h=Aa(o,t,s);if(r>0){let d,f;const g=r>1?Math.round((l-a)/(r-1)):null;for(Le(t,c,h,z(g)?0:a-g,a),d=0,f=r-1;d<f;d++)Le(t,c,h,o[d],o[d+1]);return Le(t,c,h,l,z(g)?t.length:l+g),c}return Le(t,c,h),c}function Pa(i){const t=i.options.offset,e=i._tickSize(),n=i._length/e+(t?0:1),s=i._maxLength/e;return Math.floor(Math.min(n,s))}function Aa(i,t,e){const n=Ea(i),s=t.length/e;if(!n)return Math.max(s,1);const o=yo(n);for(let r=0,a=o.length-1;r<a;r++){const l=o[r];if(l>s)return l}return Math.max(s,1)}function Oa(i){const t=[];let e,n;for(e=0,n=i.length;e<n;e++)i[e].major&&t.push(e);return t}function Ta(i,t,e,n){let s=0,o=e[0],r;for(n=Math.ceil(n),r=0;r<i.length;r++)r===o&&(t.push(i[r]),s++,o=e[s*n])}function Le(i,t,e,n,s){const o=T(n,0),r=Math.min(T(s,i.length),i.length);let a=0,l,c,h;for(e=Math.ceil(e),s&&(l=s-n,e=l/Math.floor(l/e)),h=o;h<0;)a++,h=Math.round(o+a*e);for(c=Math.max(o,0);c<r;c++)c===h&&(t.push(i[c]),a++,h=Math.round(o+a*e))}function Ea(i){const t=i.length;let e,n;if(t<2)return!1;for(n=i[0],e=1;e<t;++e)if(i[e]-i[e-1]!==n)return!1;return n}const Ra=i=>i==="left"?"right":i==="right"?"left":i,Nn=(i,t,e)=>t==="top"||t==="left"?i[t]+e:i[t]-e,Vn=(i,t)=>Math.min(t||i,i);function Wn(i,t){const e=[],n=i.length/t,s=i.length;let o=0;for(;o<s;o+=n)e.push(i[Math.floor(o)]);return e}function La(i,t,e){const n=i.ticks.length,s=Math.min(t,n-1),o=i._startPixel,r=i._endPixel,a=1e-6;let l=i.getPixelForTick(s),c;if(!(e&&(n===1?c=Math.max(l-o,r-l):t===0?c=(i.getPixelForTick(1)-l)/2:c=(l-i.getPixelForTick(s-1))/2,l+=s<t?c:-c,l<o-a||l>r+a)))return l}function Ba(i,t){I(i,e=>{const n=e.gc,s=n.length/2;let o;if(s>t){for(o=0;o<s;++o)delete e.data[n[o]];n.splice(0,s)}})}function le(i){return i.drawTicks?i.tickLength:0}function Hn(i,t){if(!i.display)return 0;const e=q(i.font,t),n=Q(i.padding);return(j(i.text)?i.text.length:1)*e.lineHeight+n.height}function za(i,t){return wt(i,{scale:t,type:"scale"})}function Ia(i,t,e){return wt(i,{tick:e,index:t,type:"tick"})}function Fa(i,t,e){let n=qi(i);return(e&&t!=="right"||!e&&t==="right")&&(n=Ra(n)),n}function Na(i,t,e,n){const{top:s,left:o,bottom:r,right:a,chart:l}=i,{chartArea:c,scales:h}=l;let d=0,f,g,p;const b=r-s,m=a-o;if(i.isHorizontal()){if(g=nt(n,o,a),R(e)){const x=Object.keys(e)[0],_=e[x];p=h[x].getPixelForValue(_)+b-t}else e==="center"?p=(c.bottom+c.top)/2+b-t:p=Nn(i,e,t);f=a-o}else{if(R(e)){const x=Object.keys(e)[0],_=e[x];g=h[x].getPixelForValue(_)-m+t}else e==="center"?g=(c.left+c.right)/2-m+t:g=Nn(i,e,t);p=nt(n,r,s),d=e==="left"?-Y:Y}return{titleX:g,titleY:p,maxWidth:f,rotation:d}}class Yt extends Lt{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:n,_suggestedMax:s}=this;return t=at(t,Number.POSITIVE_INFINITY),e=at(e,Number.NEGATIVE_INFINITY),n=at(n,Number.POSITIVE_INFINITY),s=at(s,Number.NEGATIVE_INFINITY),{min:at(t,n),max:at(e,s),minDefined:X(t),maxDefined:X(e)}}getMinMax(t){let{min:e,max:n,minDefined:s,maxDefined:o}=this.getUserBounds(),r;if(s&&o)return{min:e,max:n};const a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)r=a[l].controller.getMinMax(this,t),s||(e=Math.min(e,r.min)),o||(n=Math.max(n,r.max));return e=o&&e>n?n:e,n=s&&e>n?e:n,{min:at(e,at(n,e)),max:at(n,at(e,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){N(this.options.beforeUpdate,[this])}update(t,e,n){const{beginAtZero:s,grace:o,ticks:r}=this.options,a=r.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=tr(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?Wn(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||r.source==="auto")&&(this.ticks=Da(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,n;this.isHorizontal()?(e=this.left,n=this.right):(e=this.top,n=this.bottom,t=!t),this._startPixel=e,this._endPixel=n,this._reversePixels=t,this._length=n-e,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){const e=this.options.ticks;let n,s,o;for(n=0,s=t.length;n<s;n++)o=t[n],o.label=N(e.callback,[o.value,n,t],this)}afterTickToLabelConversion(){N(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){N(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,n=Vn(this.ticks.length,t.ticks.maxTicksLimit),s=e.minRotation||0,o=e.maxRotation;let r=s,a,l,c;if(!this._isVisible()||!e.display||s>=o||n<=1||!this.isHorizontal()){this.labelRotation=s;return}const h=this._getLabelSizes(),d=h.widest.width,f=h.highest.height,g=J(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/n:g/(n-1),d+6>a&&(a=g/(n-(t.offset?.5:1)),l=this.maxHeight-le(t.grid)-e.padding-Hn(t.title,this.chart.options.font),c=Math.sqrt(d*d+f*f),r=Ge(Math.min(Math.asin(J((h.highest.height+6)/a,-1,1)),Math.asin(J(l/c,-1,1))-Math.asin(J(f/c,-1,1)))),r=Math.max(s,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){N(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){N(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:n,title:s,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){const l=Hn(s,e.options.font);if(a?(t.width=this.maxWidth,t.height=le(o)+l):(t.height=this.maxHeight,t.width=le(o)+l),n.display&&this.ticks.length){const{first:c,last:h,widest:d,highest:f}=this._getLabelSizes(),g=n.padding*2,p=rt(this.labelRotation),b=Math.cos(p),m=Math.sin(p);if(a){const x=n.mirror?0:m*d.width+b*f.height;t.height=Math.min(this.maxHeight,t.height+x+g)}else{const x=n.mirror?0:b*d.width+m*f.height;t.width=Math.min(this.maxWidth,t.width+x+g)}this._calculatePadding(c,h,m,b)}}this._handleMargins(),a?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,n,s){const{ticks:{align:o,padding:r},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const h=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,g=0;l?c?(f=s*t.width,g=n*e.height):(f=n*t.height,g=s*e.width):o==="start"?g=e.width:o==="end"?f=t.width:o!=="inner"&&(f=t.width/2,g=e.width/2),this.paddingLeft=Math.max((f-h+r)*this.width/(this.width-h),0),this.paddingRight=Math.max((g-d+r)*this.width/(this.width-d),0)}else{let h=e.height/2,d=t.height/2;o==="start"?(h=0,d=t.height):o==="end"&&(h=e.height,d=0),this.paddingTop=h+r,this.paddingBottom=d+r}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){N(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,n;for(e=0,n=t.length;e<n;e++)z(t[e].label)&&(t.splice(e,1),n--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let n=this.ticks;e<n.length&&(n=Wn(n,e)),this._labelSizes=t=this._computeLabelSizes(n,n.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,n){const{ctx:s,_longestTextCache:o}=this,r=[],a=[],l=Math.floor(e/Vn(e,n));let c=0,h=0,d,f,g,p,b,m,x,_,w,v,y;for(d=0;d<e;d+=l){if(p=t[d].label,b=this._resolveTickFontOptions(d),s.font=m=b.string,x=o[m]=o[m]||{data:{},gc:[]},_=b.lineHeight,w=v=0,!z(p)&&!j(p))w=_e(s,x.data,x.gc,w,p),v=_;else if(j(p))for(f=0,g=p.length;f<g;++f)y=p[f],!z(y)&&!j(y)&&(w=_e(s,x.data,x.gc,w,y),v+=_);r.push(w),a.push(v),c=Math.max(w,c),h=Math.max(v,h)}Ba(o,e);const k=r.indexOf(c),S=a.indexOf(h),M=C=>({width:r[C]||0,height:a[C]||0});return{first:M(0),last:M(e-1),widest:M(k),highest:M(S),widths:r,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return Mo(this._alignToPixels?At(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const n=e[t];return n.$context||(n.$context=Ia(this.getContext(),t,n))}return this.$context||(this.$context=za(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=rt(this.labelRotation),n=Math.abs(Math.cos(e)),s=Math.abs(Math.sin(e)),o=this._getLabelSizes(),r=t.autoSkipPadding||0,a=o?o.widest.width+r:0,l=o?o.highest.height+r:0;return this.isHorizontal()?l*n>a*s?a/n:l/s:l*s<a*n?l/n:a/s}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,n=this.chart,s=this.options,{grid:o,position:r,border:a}=s,l=o.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),f=le(o),g=[],p=a.setContext(this.getContext()),b=p.display?p.width:0,m=b/2,x=function(E){return At(n,E,b)};let _,w,v,y,k,S,M,C,D,P,O,F;if(r==="top")_=x(this.bottom),S=this.bottom-f,C=_-m,P=x(t.top)+m,F=t.bottom;else if(r==="bottom")_=x(this.top),P=t.top,F=x(t.bottom)-m,S=_+m,C=this.top+f;else if(r==="left")_=x(this.right),k=this.right-f,M=_-m,D=x(t.left)+m,O=t.right;else if(r==="right")_=x(this.left),D=t.left,O=x(t.right)-m,k=_+m,M=this.left+f;else if(e==="x"){if(r==="center")_=x((t.top+t.bottom)/2+.5);else if(R(r)){const E=Object.keys(r)[0],L=r[E];_=x(this.chart.scales[E].getPixelForValue(L))}P=t.top,F=t.bottom,S=_+m,C=S+f}else if(e==="y"){if(r==="center")_=x((t.left+t.right)/2);else if(R(r)){const E=Object.keys(r)[0],L=r[E];_=x(this.chart.scales[E].getPixelForValue(L))}k=_-m,M=k-f,D=t.left,O=t.right}const H=T(s.ticks.maxTicksLimit,d),A=Math.max(1,Math.ceil(d/H));for(w=0;w<d;w+=A){const E=this.getContext(w),L=o.setContext(E),K=a.setContext(E),V=L.lineWidth,ot=L.color,U=K.dash||[],et=K.dashOffset,pt=L.tickWidth,mt=L.tickColor,bt=L.tickBorderDash||[],xt=L.tickBorderDashOffset;v=La(this,w,l),v!==void 0&&(y=At(n,v,V),c?k=M=D=O=y:S=C=P=F=y,g.push({tx1:k,ty1:S,tx2:M,ty2:C,x1:D,y1:P,x2:O,y2:F,width:V,color:ot,borderDash:U,borderDashOffset:et,tickWidth:pt,tickColor:mt,tickBorderDash:bt,tickBorderDashOffset:xt}))}return this._ticksLength=d,this._borderValue=_,g}_computeLabelItems(t){const e=this.axis,n=this.options,{position:s,ticks:o}=n,r=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:h,mirror:d}=o,f=le(n.grid),g=f+h,p=d?-h:g,b=-rt(this.labelRotation),m=[];let x,_,w,v,y,k,S,M,C,D,P,O,F="middle";if(s==="top")k=this.bottom-p,S=this._getXAxisLabelAlignment();else if(s==="bottom")k=this.top+p,S=this._getXAxisLabelAlignment();else if(s==="left"){const A=this._getYAxisLabelAlignment(f);S=A.textAlign,y=A.x}else if(s==="right"){const A=this._getYAxisLabelAlignment(f);S=A.textAlign,y=A.x}else if(e==="x"){if(s==="center")k=(t.top+t.bottom)/2+g;else if(R(s)){const A=Object.keys(s)[0],E=s[A];k=this.chart.scales[A].getPixelForValue(E)+g}S=this._getXAxisLabelAlignment()}else if(e==="y"){if(s==="center")y=(t.left+t.right)/2-g;else if(R(s)){const A=Object.keys(s)[0],E=s[A];y=this.chart.scales[A].getPixelForValue(E)}S=this._getYAxisLabelAlignment(f).textAlign}e==="y"&&(l==="start"?F="top":l==="end"&&(F="bottom"));const H=this._getLabelSizes();for(x=0,_=a.length;x<_;++x){w=a[x],v=w.label;const A=o.setContext(this.getContext(x));M=this.getPixelForTick(x)+o.labelOffset,C=this._resolveTickFontOptions(x),D=C.lineHeight,P=j(v)?v.length:1;const E=P/2,L=A.color,K=A.textStrokeColor,V=A.textStrokeWidth;let ot=S;r?(y=M,S==="inner"&&(x===_-1?ot=this.options.reverse?"left":"right":x===0?ot=this.options.reverse?"right":"left":ot="center"),s==="top"?c==="near"||b!==0?O=-P*D+D/2:c==="center"?O=-H.highest.height/2-E*D+D:O=-H.highest.height+D/2:c==="near"||b!==0?O=D/2:c==="center"?O=H.highest.height/2-E*D:O=H.highest.height-P*D,d&&(O*=-1),b!==0&&!A.showLabelBackdrop&&(y+=D/2*Math.sin(b))):(k=M,O=(1-P)*D/2);let U;if(A.showLabelBackdrop){const et=Q(A.backdropPadding),pt=H.heights[x],mt=H.widths[x];let bt=O-et.top,xt=0-et.left;switch(F){case"middle":bt-=pt/2;break;case"bottom":bt-=pt;break}switch(S){case"center":xt-=mt/2;break;case"right":xt-=mt;break;case"inner":x===_-1?xt-=mt:x>0&&(xt-=mt/2);break}U={left:xt,top:bt,width:mt+et.width,height:pt+et.height,color:A.backdropColor}}m.push({label:v,font:C,textOffset:O,options:{rotation:b,color:L,strokeColor:K,strokeWidth:V,textAlign:ot,textBaseline:F,translation:[y,k],backdrop:U}})}return m}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-rt(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){const{position:e,ticks:{crossAlign:n,mirror:s,padding:o}}=this.options,r=this._getLabelSizes(),a=t+o,l=r.widest.width;let c,h;return e==="left"?s?(h=this.right+o,n==="near"?c="left":n==="center"?(c="center",h+=l/2):(c="right",h+=l)):(h=this.right-a,n==="near"?c="right":n==="center"?(c="center",h-=l/2):(c="left",h=this.left)):e==="right"?s?(h=this.left+o,n==="near"?c="right":n==="center"?(c="center",h-=l/2):(c="left",h-=l)):(h=this.left+a,n==="near"?c="left":n==="center"?(c="center",h+=l/2):(c="right",h=this.right)):c="right",{textAlign:c,x:h}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:n,top:s,width:o,height:r}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(n,s,o,r),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const s=this.ticks.findIndex(o=>o.value===t);return s>=0?e.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const e=this.options.grid,n=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,r;const a=(l,c,h)=>{!h.width||!h.color||(n.save(),n.lineWidth=h.width,n.strokeStyle=h.color,n.setLineDash(h.borderDash||[]),n.lineDashOffset=h.borderDashOffset,n.beginPath(),n.moveTo(l.x,l.y),n.lineTo(c.x,c.y),n.stroke(),n.restore())};if(e.display)for(o=0,r=s.length;o<r;++o){const l=s[o];e.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),e.drawTicks&&a({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(){const{chart:t,ctx:e,options:{border:n,grid:s}}=this,o=n.setContext(this.getContext()),r=n.display?o.width:0;if(!r)return;const a=s.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,h,d,f;this.isHorizontal()?(c=At(t,this.left,r)-r/2,h=At(t,this.right,a)+a/2,d=f=l):(d=At(t,this.top,r)-r/2,f=At(t,this.bottom,a)+a/2,c=h=l),e.save(),e.lineWidth=o.width,e.strokeStyle=o.color,e.beginPath(),e.moveTo(c,d),e.lineTo(h,f),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const n=this.ctx,s=this._computeLabelArea();s&&ke(n,s);const o=this.getLabelItems(t);for(const r of o){const a=r.options,l=r.font,c=r.label,h=r.textOffset;Vt(n,c,0,h,l,a)}s&&we(n)}drawTitle(){const{ctx:t,options:{position:e,title:n,reverse:s}}=this;if(!n.display)return;const o=q(n.font),r=Q(n.padding),a=n.align;let l=o.lineHeight/2;e==="bottom"||e==="center"||R(e)?(l+=r.bottom,j(n.text)&&(l+=o.lineHeight*(n.text.length-1))):l+=r.top;const{titleX:c,titleY:h,maxWidth:d,rotation:f}=Na(this,l,e,a);Vt(t,n.text,0,0,o,{color:n.color,maxWidth:d,rotation:f,textAlign:Fa(a,e,s),textBaseline:"middle",translation:[c,h]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,n=T(t.grid&&t.grid.z,-1),s=T(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Yt.prototype.draw?[{z:e,draw:o=>{this.draw(o)}}]:[{z:n,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:e,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+"AxisID",s=[];let o,r;for(o=0,r=e.length;o<r;++o){const a=e[o];a[n]===this.id&&(!t||a.type===t)&&s.push(a)}return s}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return q(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Be{constructor(t,e,n){this.type=t,this.scope=e,this.override=n,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let n;Ha(e)&&(n=this.register(e));const s=this.items,o=t.id,r=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in s||(s[o]=t,Va(t,r,n),this.override&&$.override(t.id,t.overrides)),r}get(t){return this.items[t]}unregister(t){const e=this.items,n=t.id,s=this.scope;n in e&&delete e[n],s&&n in $[s]&&(delete $[s][n],this.override&&delete Pt[n])}}function Va(i,t,e){const n=Gt(Object.create(null),[e?$.get(e):{},$.get(t),i.defaults]);$.set(t,n),i.defaultRoutes&&Wa(t,i.defaultRoutes),i.descriptors&&$.describe(t,i.descriptors)}function Wa(i,t){Object.keys(t).forEach(e=>{const n=e.split("."),s=n.pop(),o=[i].concat(n).join("."),r=t[e].split("."),a=r.pop(),l=r.join(".");$.route(o,s,l,a)})}function Ha(i){return"id"in i&&"defaults"in i}class ja{constructor(){this.controllers=new Be(Ae,"datasets",!0),this.elements=new Be(Lt,"elements"),this.plugins=new Be(Object,"plugins"),this.scales=new Be(Yt,"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,n){[...e].forEach(s=>{const o=n||this._getRegistryForType(s);n||o.isForType(s)||o===this.plugins&&s.id?this._exec(t,o,s):I(s,r=>{const a=n||this._getRegistryForType(r);this._exec(t,a,r)})})}_exec(t,e,n){const s=Ke(t);N(n["before"+s],[],n),e[t](n),N(n["after"+s],[],n)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const n=this._typedRegistries[e];if(n.isForType(t))return n}return this.plugins}_get(t,e,n){const s=e.get(t);if(s===void 0)throw new Error('"'+t+'" is not a registered '+n+".");return s}}var lt=new ja;class $a{constructor(){this._init=void 0}notify(t,e,n,s){if(e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),this._init===void 0)return;const o=s?this._descriptors(t).filter(s):this._descriptors(t),r=this._notify(o,t,e,n);return e==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),r}_notify(t,e,n,s){s=s||{};for(const o of t){const r=o.plugin,a=r[n],l=[e,s,o.options];if(N(a,l,r)===!1&&s.cancelable)return!1}return!0}invalidate(){z(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const n=t&&t.config,s=T(n.options&&n.options.plugins,{}),o=Ya(n);return s===!1&&!e?[]:Xa(t,o,s,e)}_notifyStateChanges(t){const e=this._oldCache||[],n=this._cache,s=(o,r)=>o.filter(a=>!r.some(l=>a.plugin.id===l.plugin.id));this._notify(s(e,n),t,"stop"),this._notify(s(n,e),t,"start")}}function Ya(i){const t={},e=[],n=Object.keys(lt.plugins.items);for(let o=0;o<n.length;o++)e.push(lt.getPlugin(n[o]));const s=i.plugins||[];for(let o=0;o<s.length;o++){const r=s[o];e.indexOf(r)===-1&&(e.push(r),t[r.id]=!0)}return{plugins:e,localIds:t}}function Ua(i,t){return!t&&i===!1?null:i===!0?{}:i}function Xa(i,{plugins:t,localIds:e},n,s){const o=[],r=i.getContext();for(const a of t){const l=a.id,c=Ua(n[l],s);c!==null&&o.push({plugin:a,options:qa(i.config,{plugin:a,local:e[l]},c,r)})}return o}function qa(i,{plugin:t,local:e},n,s){const o=i.pluginScopeKeys(t),r=i.getOptionScopes(n,o);return e&&t.defaults&&r.push(t.defaults),i.createResolver(r,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function xi(i,t){const e=$.datasets[i]||{};return((t.datasets||{})[i]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function Ka(i,t){let e=i;return i==="_index_"?e=t:i==="_value_"&&(e=t==="x"?"y":"x"),e}function Ga(i,t){return i===t?"_index_":"_value_"}function jn(i){if(i==="x"||i==="y"||i==="r")return i}function Ja(i){if(i==="top"||i==="bottom")return"x";if(i==="left"||i==="right")return"y"}function yi(i,...t){if(jn(i))return i;for(const e of t){const n=e.axis||Ja(e.position)||i.length>1&&jn(i[0].toLowerCase());if(n)return n}throw new Error(`Cannot determine type of '${i}' axis. Please provide 'axis' or 'position' option.`)}function $n(i,t,e){if(e[t+"AxisID"]===i)return{axis:t}}function Qa(i,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(n=>n.xAxisID===i||n.yAxisID===i);if(e.length)return $n(i,"x",e[0])||$n(i,"y",e[0])}return{}}function Za(i,t){const e=Pt[i.type]||{scales:{}},n=t.scales||{},s=xi(i.type,t),o=Object.create(null);return Object.keys(n).forEach(r=>{const a=n[r];if(!R(a))return console.error(`Invalid scale configuration for scale: ${r}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);const l=yi(r,a,Qa(r,i),$.scales[a.type]),c=Ga(l,s),h=e.scales||{};o[r]=Jt(Object.create(null),[{axis:l},a,h[l],h[c]])}),i.data.datasets.forEach(r=>{const a=r.type||i.type,l=r.indexAxis||xi(a,t),h=(Pt[a]||{}).scales||{};Object.keys(h).forEach(d=>{const f=Ka(d,l),g=r[f+"AxisID"]||f;o[g]=o[g]||Object.create(null),Jt(o[g],[{axis:f},n[g],h[d]])})}),Object.keys(o).forEach(r=>{const a=o[r];Jt(a,[$.scales[a.type],$.scale])}),o}function Yn(i){const t=i.options||(i.options={});t.plugins=T(t.plugins,{}),t.scales=Za(i,t)}function Un(i){return i=i||{},i.datasets=i.datasets||[],i.labels=i.labels||[],i}function tl(i){return i=i||{},i.data=Un(i.data),Yn(i),i}const Xn=new Map,qn=new Set;function ze(i,t){let e=Xn.get(i);return e||(e=t(),Xn.set(i,e),qn.add(e)),e}const ce=(i,t,e)=>{const n=Ft(t,e);n!==void 0&&i.add(n)};class el{constructor(t){this._config=tl(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=Un(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),Yn(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return ze(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return ze(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return ze(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,n=this.type;return ze(`${n}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const n=this._scopeCache;let s=n.get(t);return(!s||e)&&(s=new Map,n.set(t,s)),s}getOptionScopes(t,e,n){const{options:s,type:o}=this,r=this._cachedScopes(t,n),a=r.get(e);if(a)return a;const l=new Set;e.forEach(h=>{t&&(l.add(t),h.forEach(d=>ce(l,t,d))),h.forEach(d=>ce(l,s,d)),h.forEach(d=>ce(l,Pt[o]||{},d)),h.forEach(d=>ce(l,$,d)),h.forEach(d=>ce(l,ii,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),qn.has(e)&&r.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,Pt[e]||{},$.datasets[e]||{},{type:e},$,ii]}resolveNamedOptions(t,e,n,s=[""]){const o={$shared:!0},{resolver:r,subPrefixes:a}=Kn(this._resolverCache,t,s);let l=r;if(nl(r,e)){o.$shared=!1,n=kt(n)?n():n;const c=this.createResolver(t,n,a);l=Ht(r,n,c)}for(const c of e)o[c]=l[c];return o}createResolver(t,e,n=[""],s){const{resolver:o}=Kn(this._resolverCache,t,n);return R(e)?Ht(o,e,void 0,s):o}}function Kn(i,t,e){let n=i.get(t);n||(n=new Map,i.set(t,n));const s=e.join();let o=n.get(s);return o||(o={resolver:ri(t,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},n.set(s,o)),o}const il=i=>R(i)&&Object.getOwnPropertyNames(i).some(t=>kt(i[t]));function nl(i,t){const{isScriptable:e,isIndexable:n}=en(i);for(const s of t){const o=e(s),r=n(s),a=(r||o)&&i[s];if(o&&(kt(a)||il(a))||r&&j(a))return!0}return!1}var sl="4.5.1";const ol=["top","bottom","left","right","chartArea"];function Gn(i,t){return i==="top"||i==="bottom"||ol.indexOf(i)===-1&&t==="x"}function Jn(i,t){return function(e,n){return e[i]===n[i]?e[t]-n[t]:e[i]-n[i]}}function Qn(i){const t=i.chart,e=t.options.animation;t.notifyPlugins("afterRender"),N(e&&e.onComplete,[i],t)}function rl(i){const t=i.chart,e=t.options.animation;N(e&&e.onProgress,[i],t)}function Zn(i){return ci()&&typeof i=="string"?i=document.getElementById(i):i&&i.length&&(i=i[0]),i&&i.canvas&&(i=i.canvas),i}const Ie={},ts=i=>{const t=Zn(i);return Object.values(Ie).filter(e=>e.canvas===t).pop()};function al(i,t,e){const n=Object.keys(i);for(const s of n){const o=+s;if(o>=t){const r=i[s];delete i[s],(e>0||o>t)&&(i[o+e]=r)}}}function ll(i,t,e,n){return!e||i.type==="mouseout"?null:n?t:i}class Bt{static defaults=$;static instances=Ie;static overrides=Pt;static registry=lt;static version=sl;static getChart=ts;static register(...t){lt.add(...t),es()}static unregister(...t){lt.remove(...t),es()}constructor(t,e){const n=this.config=new el(e),s=Zn(t),o=ts(s);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const r=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||Ca(s)),this.platform.updateConfig(n);const a=this.platform.acquireContext(s,r.aspectRatio),l=a&&a.canvas,c=l&&l.height,h=l&&l.width;if(this.id=co(),this.ctx=a,this.canvas=l,this.width=h,this.height=c,this._options=r,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new $a,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Ao(d=>this.update(d),r.resizeDelay||0),this._dataChanges=[],Ie[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}ut.listen(this,"complete",Qn),ut.listen(this,"progress",rl),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:n,height:s,_aspectRatio:o}=this;return z(t)?e&&o?o:s?n/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return lt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():cn(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Zi(this.canvas,this.ctx),this}stop(){return ut.stop(this),this}resize(t,e){ut.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const n=this.options,s=this.canvas,o=n.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(s,t,e,o),a=n.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,cn(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),N(n.onResize,[this,r],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};I(e,(n,s)=>{n.id=s})}buildOrUpdateScales(){const t=this.options,e=t.scales,n=this.scales,s=Object.keys(n).reduce((r,a)=>(r[a]=!1,r),{});let o=[];e&&(o=o.concat(Object.keys(e).map(r=>{const a=e[r],l=yi(r,a),c=l==="r",h=l==="x";return{options:a,dposition:c?"chartArea":h?"bottom":"left",dtype:c?"radialLinear":h?"category":"linear"}}))),I(o,r=>{const a=r.options,l=a.id,c=yi(l,a),h=T(a.type,r.dtype);(a.position===void 0||Gn(a.position,c)!==Gn(r.dposition))&&(a.position=r.dposition),s[l]=!0;let d=null;if(l in n&&n[l].type===h)d=n[l];else{const f=lt.getScale(h);d=new f({id:l,type:h,ctx:this.ctx,chart:this}),n[d.id]=d}d.init(a,t)}),I(s,(r,a)=>{r||delete n[a]}),I(n,r=>{Mt.configure(this,r,r.options),Mt.addBox(this,r)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,n=t.length;if(t.sort((s,o)=>s.index-o.index),n>e){for(let s=e;s<n;++s)this._destroyDatasetMeta(s);t.splice(e,n-e)}this._sortedMetasets=t.slice(0).sort(Jn("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((n,s)=>{e.filter(o=>o===n._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let n,s;for(this._removeUnreferencedMetasets(),n=0,s=e.length;n<s;n++){const o=e[n];let r=this.getDatasetMeta(n);const a=o.type||this.config.type;if(r.type&&r.type!==a&&(this._destroyDatasetMeta(n),r=this.getDatasetMeta(n)),r.type=a,r.indexAxis=o.indexAxis||xi(a,this.options),r.order=o.order||0,r.index=n,r.label=""+o.label,r.visible=this.isDatasetVisible(n),r.controller)r.controller.updateIndex(n),r.controller.linkScales();else{const l=lt.getController(a),{datasetElementType:c,dataElementType:h}=$.datasets[a];Object.assign(l,{dataElementType:lt.getElement(h),datasetElementType:c&&lt.getElement(c)}),r.controller=new l(this,n),t.push(r.controller)}}return this._updateMetasets(),t}_resetElements(){I(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const n=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let c=0,h=this.data.datasets.length;c<h;c++){const{controller:d}=this.getDatasetMeta(c),f=!s&&o.indexOf(d)===-1;d.buildOrUpdateElements(f),r=Math.max(+d.getMaxOverflow(),r)}r=this._minPadding=n.layout.autoPadding?r:0,this._updateLayout(r),s||I(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Jn("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){I(this.scales,t=>{Mt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),n=new Set(t.events);(!Fi(e,n)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:n,start:s,count:o}of e){const r=n==="_removeElements"?-o:o;al(t,s,r)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,n=o=>new Set(t.filter(r=>r[0]===o).map((r,a)=>a+","+r.splice(1).join(","))),s=n(0);for(let o=1;o<e;o++)if(!Fi(s,n(o)))return;return Array.from(s).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;Mt.update(this,this.width,this.height,t);const e=this.chartArea,n=e.width<=0||e.height<=0;this._layers=[],I(this.boxes,s=>{n&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,o)=>{s._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,n=this.data.datasets.length;e<n;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,n=this.data.datasets.length;e<n;++e)this._updateDataset(e,kt(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const n=this.getDatasetMeta(t),s={meta:n,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(n.controller._update(e),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(ut.has(this)?this.attached&&!ut.running(this)&&ut.start(this):(this.draw(),Qn({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:n,height:s}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(n,s)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,n=[];let s,o;for(s=0,o=e.length;s<o;++s){const r=e[s];(!t||r.visible)&&n.push(r)}return n}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,n={meta:t,index:t.index,cancelable:!0},s=yn(this,t);this.notifyPlugins("beforeDatasetDraw",n)!==!1&&(s&&ke(e,s),t.controller.draw(),s&&we(e),n.cancelable=!1,this.notifyPlugins("afterDatasetDraw",n))}isPointInArea(t){return ft(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,n,s){const o=oa.modes[e];return typeof o=="function"?o(this,t,n,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],n=this._metasets;let s=n.filter(o=>o&&o._dataset===e).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},n.push(s)),s}getContext(){return this.$context||(this.$context=wt(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const n=this.getDatasetMeta(t);return typeof n.hidden=="boolean"?!n.hidden:!e.hidden}setDatasetVisibility(t,e){const n=this.getDatasetMeta(t);n.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,n){const s=n?"show":"hide",o=this.getDatasetMeta(t),r=o.controller._resolveAnimations(void 0,s);me(e)?(o.data[e].hidden=!n,this.update()):(this.setDatasetVisibility(t,n),r.update(o,{visible:n}),this.update(a=>a.datasetIndex===t?s:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),ut.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),Zi(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete Ie[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,n=(o,r)=>{e.addEventListener(this,o,r),t[o]=r},s=(o,r,a)=>{o.offsetX=r,o.offsetY=a,this._eventHandler(o)};I(this.options.events,o=>n(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,n=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let r;const a=()=>{s("attach",a),this.attached=!0,this.resize(),n("resize",o),n("detach",r)};r=()=>{this.attached=!1,s("resize",o),this._stop(),this._resize(0,0),n("attach",a)},e.isAttached(this.canvas)?a():r()}unbindEvents(){I(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},I(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,n){const s=n?"set":"remove";let o,r,a,l;for(e==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+s+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){r=t[a];const c=r&&this.getDatasetMeta(r.datasetIndex).controller;c&&c[s+"HoverStyle"](r.element,r.datasetIndex,r.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],n=t.map(({datasetIndex:o,index:r})=>{const a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[r],index:r}});!ge(n,e)&&(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,e))}notifyPlugins(t,e,n){return this._plugins.notify(this,t,e,n)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,n){const s=this.options.hover,o=(l,c)=>l.filter(h=>!c.some(d=>h.datasetIndex===d.datasetIndex&&h.index===d.index)),r=o(e,t),a=n?t:o(t,e);r.length&&this.updateHoverStyle(r,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,e){const n={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=r=>(r.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",n,s)===!1)return;const o=this._handleEvent(t,e,n.inChartArea);return n.cancelable=!1,this.notifyPlugins("afterEvent",n,s),(o||n.changed)&&this.render(),this}_handleEvent(t,e,n){const{_active:s=[],options:o}=this,r=e,a=this._getActiveElements(t,s,n,r),l=mo(t),c=ll(t,this._lastEvent,n,l);n&&(this._lastEvent=null,N(o.onHover,[t,a,this],this),l&&N(o.onClick,[t,a,this],this));const h=!ge(a,s);return(h||e)&&(this._active=a,this._updateHoverStyles(a,s,e)),this._lastEvent=c,h}_getActiveElements(t,e,n,s){if(t.type==="mouseout")return[];if(!n)return e;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,s)}}function es(){return I(Bt.instances,i=>i._plugins.invalidate())}function cl(i,t,e){const{startAngle:n,x:s,y:o,outerRadius:r,innerRadius:a,options:l}=t,{borderWidth:c,borderJoinStyle:h}=l,d=Math.min(c/r,G(n-e));if(i.beginPath(),i.arc(s,o,r-c/2,n+d/2,e-d/2),a>0){const f=Math.min(c/a,G(n-e));i.arc(s,o,a+c/2,e-f/2,n+f/2,!0)}else{const f=Math.min(c/2,r*G(n-e));if(h==="round")i.arc(s,o,f,e-B/2,n+B/2,!0);else if(h==="bevel"){const g=2*f*f,p=-g*Math.cos(e+B/2)+s,b=-g*Math.sin(e+B/2)+o,m=g*Math.cos(n+B/2)+s,x=g*Math.sin(n+B/2)+o;i.lineTo(p,b),i.lineTo(m,x)}}i.closePath(),i.moveTo(0,0),i.rect(0,0,i.canvas.width,i.canvas.height),i.clip("evenodd")}function hl(i,t,e){const{startAngle:n,pixelMargin:s,x:o,y:r,outerRadius:a,innerRadius:l}=t;let c=s/a;i.beginPath(),i.arc(o,r,a,n-c,e+c),l>s?(c=s/l,i.arc(o,r,l,e+c,n-c,!0)):i.arc(o,r,s,e+Y,n-Y),i.closePath(),i.clip()}function dl(i){return oi(i,["outerStart","outerEnd","innerStart","innerEnd"])}function fl(i,t,e,n){const s=dl(i.options.borderRadius),o=(e-t)/2,r=Math.min(o,n*t/2),a=l=>{const c=(e-Math.min(o,l))*n/2;return J(l,0,Math.min(o,c))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:J(s.innerStart,0,r),innerEnd:J(s.innerEnd,0,r)}}function Ut(i,t,e,n){return{x:e+i*Math.cos(t),y:n+i*Math.sin(t)}}function Fe(i,t,e,n,s,o){const{x:r,y:a,startAngle:l,pixelMargin:c,innerRadius:h}=t,d=Math.max(t.outerRadius+n+e-c,0),f=h>0?h+n+e+c:0;let g=0;const p=s-l;if(n){const A=h>0?h-n:0,E=d>0?d-n:0,L=(A+E)/2,K=L!==0?p*L/(L+n):p;g=(p-K)/2}const b=Math.max(.001,p*d-e/B)/d,m=(p-b)/2,x=l+m+g,_=s-m-g,{outerStart:w,outerEnd:v,innerStart:y,innerEnd:k}=fl(t,f,d,_-x),S=d-w,M=d-v,C=x+w/S,D=_-v/M,P=f+y,O=f+k,F=x+y/P,H=_-k/O;if(i.beginPath(),o){const A=(C+D)/2;if(i.arc(r,a,d,C,A),i.arc(r,a,d,A,D),v>0){const V=Ut(M,D,r,a);i.arc(V.x,V.y,v,D,_+Y)}const E=Ut(O,_,r,a);if(i.lineTo(E.x,E.y),k>0){const V=Ut(O,H,r,a);i.arc(V.x,V.y,k,_+Y,H+Math.PI)}const L=(_-k/f+(x+y/f))/2;if(i.arc(r,a,f,_-k/f,L,!0),i.arc(r,a,f,L,x+y/f,!0),y>0){const V=Ut(P,F,r,a);i.arc(V.x,V.y,y,F+Math.PI,x-Y)}const K=Ut(S,x,r,a);if(i.lineTo(K.x,K.y),w>0){const V=Ut(S,C,r,a);i.arc(V.x,V.y,w,x-Y,C)}}else{i.moveTo(r,a);const A=Math.cos(C)*d+r,E=Math.sin(C)*d+a;i.lineTo(A,E);const L=Math.cos(D)*d+r,K=Math.sin(D)*d+a;i.lineTo(L,K)}i.closePath()}function ul(i,t,e,n,s){const{fullCircles:o,startAngle:r,circumference:a}=t;let l=t.endAngle;if(o){Fe(i,t,e,n,l,s);for(let c=0;c<o;++c)i.fill();isNaN(a)||(l=r+(a%W||W))}return Fe(i,t,e,n,l,s),i.fill(),l}function gl(i,t,e,n,s){const{fullCircles:o,startAngle:r,circumference:a,options:l}=t,{borderWidth:c,borderJoinStyle:h,borderDash:d,borderDashOffset:f,borderRadius:g}=l,p=l.borderAlign==="inner";if(!c)return;i.setLineDash(d||[]),i.lineDashOffset=f,p?(i.lineWidth=c*2,i.lineJoin=h||"round"):(i.lineWidth=c,i.lineJoin=h||"bevel");let b=t.endAngle;if(o){Fe(i,t,e,n,b,s);for(let m=0;m<o;++m)i.stroke();isNaN(a)||(b=r+(a%W||W))}p&&hl(i,t,b),l.selfJoin&&b-r>=B&&g===0&&h!=="miter"&&cl(i,t,b),o||(Fe(i,t,e,n,b,s),i.stroke())}class is extends Lt{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,selfJoin:!1};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,n){const s=this.getProps(["x","y"],n),{angle:o,distance:r}=ji(s,{x:t,y:e}),{startAngle:a,endAngle:l,innerRadius:c,outerRadius:h,circumference:d}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],n),f=(this.options.spacing+this.options.borderWidth)/2,g=T(d,l-a),p=te(o,a,l)&&a!==l,b=g>=W||p,m=Ct(r,c+f,h+f);return b&&m}getCenterPoint(t){const{x:e,y:n,startAngle:s,endAngle:o,innerRadius:r,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:l,spacing:c}=this.options,h=(s+o)/2,d=(r+a+c+l)/2;return{x:e+Math.cos(h)*d,y:n+Math.sin(h)*d}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:n}=this,s=(e.offset||0)/4,o=(e.spacing||0)/2,r=e.circular;if(this.pixelMargin=e.borderAlign==="inner"?.33:0,this.fullCircles=n>W?Math.floor(n/W):0,n===0||this.innerRadius<0||this.outerRadius<0)return;t.save();const a=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(a)*s,Math.sin(a)*s);const l=1-Math.sin(Math.min(B,n||0)),c=s*l;t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,ul(t,this,c,o,r),gl(t,this,c,o,r),t.restore()}}function ns(i,t,e=t){i.lineCap=T(e.borderCapStyle,t.borderCapStyle),i.setLineDash(T(e.borderDash,t.borderDash)),i.lineDashOffset=T(e.borderDashOffset,t.borderDashOffset),i.lineJoin=T(e.borderJoinStyle,t.borderJoinStyle),i.lineWidth=T(e.borderWidth,t.borderWidth),i.strokeStyle=T(e.borderColor,t.borderColor)}function pl(i,t,e){i.lineTo(e.x,e.y)}function ml(i){return i.stepped?$o:i.tension||i.cubicInterpolationMode==="monotone"?Yo:pl}function ss(i,t,e={}){const n=i.length,{start:s=0,end:o=n-1}=e,{start:r,end:a}=t,l=Math.max(s,r),c=Math.min(o,a),h=s<r&&o<r||s>a&&o>a;return{count:n,start:l,loop:t.loop,ilen:c<l&&!h?n+c-l:c-l}}function bl(i,t,e,n){const{points:s,options:o}=t,{count:r,start:a,loop:l,ilen:c}=ss(s,e,n),h=ml(o);let{move:d=!0,reverse:f}=n||{},g,p,b;for(g=0;g<=c;++g)p=s[(a+(f?c-g:g))%r],!p.skip&&(d?(i.moveTo(p.x,p.y),d=!1):h(i,b,p,f,o.stepped),b=p);return l&&(p=s[(a+(f?c:0))%r],h(i,b,p,f,o.stepped)),!!l}function xl(i,t,e,n){const s=t.points,{count:o,start:r,ilen:a}=ss(s,e,n),{move:l=!0,reverse:c}=n||{};let h=0,d=0,f,g,p,b,m,x;const _=v=>(r+(c?a-v:v))%o,w=()=>{b!==m&&(i.lineTo(h,m),i.lineTo(h,b),i.lineTo(h,x))};for(l&&(g=s[_(0)],i.moveTo(g.x,g.y)),f=0;f<=a;++f){if(g=s[_(f)],g.skip)continue;const v=g.x,y=g.y,k=v|0;k===p?(y<b?b=y:y>m&&(m=y),h=(d*h+v)/++d):(w(),i.lineTo(v,y),p=k,d=0,b=m=y),x=y}w()}function _i(i){const t=i.options,e=t.borderDash&&t.borderDash.length;return!i._decimated&&!i._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?xl:bl}function yl(i){return i.stepped?vr:i.tension||i.cubicInterpolationMode==="monotone"?Cr:Et}function _l(i,t,e,n){let s=t._path;s||(s=t._path=new Path2D,t.path(s,e,n)&&s.closePath()),ns(i,t.options),i.stroke(s)}function kl(i,t,e,n){const{segments:s,options:o}=t,r=_i(t);for(const a of s)ns(i,o,a.style),i.beginPath(),r(i,t,a,{start:e,end:e+n-1})&&i.closePath(),i.stroke()}const wl=typeof Path2D=="function";function Sl(i,t,e,n){wl&&!t.options.segment?_l(i,t,e,n):kl(i,t,e,n)}class Ne extends Lt{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){const n=this.options;if((n.tension||n.cubicInterpolationMode==="monotone")&&!n.stepped&&!this._pointsUpdated){const s=n.spanGaps?this._loop:this._fullLoop;br(this._points,n,t,s,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Er(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,n=t.length;return n&&e[t[n-1].end]}interpolate(t,e){const n=this.options,s=t[e],o=this.points,r=mn(this,{property:e,start:s,end:s});if(!r.length)return;const a=[],l=yl(n);let c,h;for(c=0,h=r.length;c<h;++c){const{start:d,end:f}=r[c],g=o[d],p=o[f];if(g===p){a.push(g);continue}const b=Math.abs((s-g[e])/(p[e]-g[e])),m=l(g,p,b,n.stepped);m[e]=t[e],a.push(m)}return a.length===1?a[0]:a}pathSegment(t,e,n){return _i(this)(t,this,e,n)}path(t,e,n){const s=this.segments,o=_i(this);let r=this._loop;e=e||0,n=n||this.points.length-e;for(const a of s)r&=o(t,this,a,{start:e,end:e+n-1});return!!r}draw(t,e,n,s){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),Sl(t,this,n,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function os(i,t,e,n){const s=i.options,{[e]:o}=i.getProps([e],n);return Math.abs(t-o)<s.radius+s.hitRadius}class Ml extends Lt{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,n){const s=this.options,{x:o,y:r}=this.getProps(["x","y"],n);return Math.pow(t-o,2)+Math.pow(e-r,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(t,e){return os(this,t,"x",e)}inYRange(t,e){return os(this,t,"y",e)}getCenterPoint(t){const{x:e,y:n}=this.getProps(["x","y"],t);return{x:e,y:n}}size(t){t=t||this.options||{};let e=t.radius||0;e=Math.max(e,e&&t.hoverRadius||0);const n=e&&t.borderWidth||0;return(e+n)*2}draw(t,e){const n=this.options;this.skip||n.radius<.1||!ft(this,e,this.size(n)/2)||(t.strokeStyle=n.borderColor,t.lineWidth=n.borderWidth,t.fillStyle=n.backgroundColor,si(t,n,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function vl(i,t,e){const n=i.segments,s=i.points,o=t.points,r=[];for(const a of n){let{start:l,end:c}=a;c=Ve(l,c,s);const h=ki(e,s[l],s[c],a.loop);if(!t.segments){r.push({source:a,target:h,start:s[l],end:s[c]});continue}const d=mn(t,h);for(const f of d){const g=ki(e,o[f.start],o[f.end],f.loop),p=pn(a,s,g);for(const b of p)r.push({source:b,target:f,start:{[e]:rs(h,g,"start",Math.max)},end:{[e]:rs(h,g,"end",Math.min)}})}}return r}function ki(i,t,e,n){if(n)return;let s=t[i],o=e[i];return i==="angle"&&(s=G(s),o=G(o)),{property:i,start:s,end:o}}function Cl(i,t){const{x:e=null,y:n=null}=i||{},s=t.points,o=[];return t.segments.forEach(({start:r,end:a})=>{a=Ve(r,a,s);const l=s[r],c=s[a];n!==null?(o.push({x:l.x,y:n}),o.push({x:c.x,y:n})):e!==null&&(o.push({x:e,y:l.y}),o.push({x:e,y:c.y}))}),o}function Ve(i,t,e){for(;t>i;t--){const n=e[t];if(!isNaN(n.x)&&!isNaN(n.y))break}return t}function rs(i,t,e,n){return i&&t?n(i[e],t[e]):i?i[e]:t?t[e]:0}function as(i,t){let e=[],n=!1;return j(i)?(n=!0,e=i):e=Cl(i,t),e.length?new Ne({points:e,options:{tension:0},_loop:n,_fullLoop:n}):null}function ls(i){return i&&i.fill!==!1}function Dl(i,t,e){let s=i[t].fill;const o=[t];let r;if(!e)return s;for(;s!==!1&&o.indexOf(s)===-1;){if(!X(s))return s;if(r=i[s],!r)return!1;if(r.visible)return s;o.push(s),s=r.fill}return!1}function Pl(i,t,e){const n=El(i);if(R(n))return isNaN(n.value)?!1:n;let s=parseFloat(n);return X(s)&&Math.floor(s)===s?Al(n[0],t,s,e):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}function Al(i,t,e,n){return(i==="-"||i==="+")&&(e=t+e),e===t||e<0||e>=n?!1:e}function Ol(i,t){let e=null;return i==="start"?e=t.bottom:i==="end"?e=t.top:R(i)?e=t.getPixelForValue(i.value):t.getBasePixel&&(e=t.getBasePixel()),e}function Tl(i,t,e){let n;return i==="start"?n=e:i==="end"?n=t.options.reverse?t.min:t.max:R(i)?n=i.value:n=t.getBaseValue(),n}function El(i){const t=i.options,e=t.fill;let n=T(e&&e.target,e);return n===void 0&&(n=!!t.backgroundColor),n===!1||n===null?!1:n===!0?"origin":n}function Rl(i){const{scale:t,index:e,line:n}=i,s=[],o=n.segments,r=n.points,a=Ll(t,e);a.push(as({x:null,y:t.bottom},n));for(let l=0;l<o.length;l++){const c=o[l];for(let h=c.start;h<=c.end;h++)Bl(s,r[h],a)}return new Ne({points:s,options:{}})}function Ll(i,t){const e=[],n=i.getMatchingVisibleMetas("line");for(let s=0;s<n.length;s++){const o=n[s];if(o.index===t)break;o.hidden||e.unshift(o.dataset)}return e}function Bl(i,t,e){const n=[];for(let s=0;s<e.length;s++){const o=e[s],{first:r,last:a,point:l}=zl(o,t,"x");if(!(!l||r&&a)){if(r)n.unshift(l);else if(i.push(l),!a)break}}i.push(...n)}function zl(i,t,e){const n=i.interpolate(t,e);if(!n)return{};const s=n[e],o=i.segments,r=i.points;let a=!1,l=!1;for(let c=0;c<o.length;c++){const h=o[c],d=r[h.start][e],f=r[h.end][e];if(Ct(s,d,f)){a=s===d,l=s===f;break}}return{first:a,last:l,point:n}}class cs{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,n){const{x:s,y:o,radius:r}=this;return e=e||{start:0,end:W},t.arc(s,o,r,e.end,e.start,!0),!n.bounds}interpolate(t){const{x:e,y:n,radius:s}=this,o=t.angle;return{x:e+Math.cos(o)*s,y:n+Math.sin(o)*s,angle:o}}}function Il(i){const{chart:t,fill:e,line:n}=i;if(X(e))return Fl(t,e);if(e==="stack")return Rl(i);if(e==="shape")return!0;const s=Nl(i);return s instanceof cs?s:as(s,n)}function Fl(i,t){const e=i.getDatasetMeta(t);return e&&i.isDatasetVisible(t)?e.dataset:null}function Nl(i){return(i.scale||{}).getPointPositionForValue?Wl(i):Vl(i)}function Vl(i){const{scale:t={},fill:e}=i,n=Ol(e,t);if(X(n)){const s=t.isHorizontal();return{x:s?n:null,y:s?null:n}}return null}function Wl(i){const{scale:t,fill:e}=i,n=t.options,s=t.getLabels().length,o=n.reverse?t.max:t.min,r=Tl(e,t,o),a=[];if(n.grid.circular){const l=t.getPointPositionForValue(0,o);return new cs({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(r)})}for(let l=0;l<s;++l)a.push(t.getPointPositionForValue(l,r));return a}function wi(i,t,e){const n=Il(t),{chart:s,index:o,line:r,scale:a,axis:l}=t,c=r.options,h=c.fill,d=c.backgroundColor,{above:f=d,below:g=d}=h||{},p=s.getDatasetMeta(o),b=yn(s,p);n&&r.points.length&&(ke(i,e),Hl(i,{line:r,target:n,above:f,below:g,area:e,scale:a,axis:l,clip:b}),we(i))}function Hl(i,t){const{line:e,target:n,above:s,below:o,area:r,scale:a,clip:l}=t,c=e._loop?"angle":t.axis;i.save();let h=o;o!==s&&(c==="x"?(hs(i,n,r.top),Si(i,{line:e,target:n,color:s,scale:a,property:c,clip:l}),i.restore(),i.save(),hs(i,n,r.bottom)):c==="y"&&(ds(i,n,r.left),Si(i,{line:e,target:n,color:o,scale:a,property:c,clip:l}),i.restore(),i.save(),ds(i,n,r.right),h=s)),Si(i,{line:e,target:n,color:h,scale:a,property:c,clip:l}),i.restore()}function hs(i,t,e){const{segments:n,points:s}=t;let o=!0,r=!1;i.beginPath();for(const a of n){const{start:l,end:c}=a,h=s[l],d=s[Ve(l,c,s)];o?(i.moveTo(h.x,h.y),o=!1):(i.lineTo(h.x,e),i.lineTo(h.x,h.y)),r=!!t.pathSegment(i,a,{move:r}),r?i.closePath():i.lineTo(d.x,e)}i.lineTo(t.first().x,e),i.closePath(),i.clip()}function ds(i,t,e){const{segments:n,points:s}=t;let o=!0,r=!1;i.beginPath();for(const a of n){const{start:l,end:c}=a,h=s[l],d=s[Ve(l,c,s)];o?(i.moveTo(h.x,h.y),o=!1):(i.lineTo(e,h.y),i.lineTo(h.x,h.y)),r=!!t.pathSegment(i,a,{move:r}),r?i.closePath():i.lineTo(e,d.y)}i.lineTo(e,t.first().y),i.closePath(),i.clip()}function Si(i,t){const{line:e,target:n,property:s,color:o,scale:r,clip:a}=t,l=vl(e,n,s);for(const{source:c,target:h,start:d,end:f}of l){const{style:{backgroundColor:g=o}={}}=c,p=n!==!0;i.save(),i.fillStyle=g,jl(i,r,a,p&&ki(s,d,f)),i.beginPath();const b=!!e.pathSegment(i,c);let m;if(p){b?i.closePath():fs(i,n,f,s);const x=!!n.pathSegment(i,h,{move:b,reverse:!0});m=b&&x,m||fs(i,n,d,s)}i.closePath(),i.fill(m?"evenodd":"nonzero"),i.restore()}}function jl(i,t,e,n){const s=t.chart.chartArea,{property:o,start:r,end:a}=n||{};if(o==="x"||o==="y"){let l,c,h,d;o==="x"?(l=r,c=s.top,h=a,d=s.bottom):(l=s.left,c=r,h=s.right,d=a),i.beginPath(),e&&(l=Math.max(l,e.left),h=Math.min(h,e.right),c=Math.max(c,e.top),d=Math.min(d,e.bottom)),i.rect(l,c,h-l,d-c),i.clip()}}function fs(i,t,e,n){const s=t.interpolate(e,n);s&&i.lineTo(s.x,s.y)}var $l={id:"filler",afterDatasetsUpdate(i,t,e){const n=(i.data.datasets||[]).length,s=[];let o,r,a,l;for(r=0;r<n;++r)o=i.getDatasetMeta(r),a=o.dataset,l=null,a&&a.options&&a instanceof Ne&&(l={visible:i.isDatasetVisible(r),index:r,fill:Pl(a,r,n),chart:i,axis:o.controller.options.indexAxis,scale:o.vScale,line:a}),o.$filler=l,s.push(l);for(r=0;r<n;++r)l=s[r],!(!l||l.fill===!1)&&(l.fill=Dl(s,r,e.propagate))},beforeDraw(i,t,e){const n=e.drawTime==="beforeDraw",s=i.getSortedVisibleDatasetMetas(),o=i.chartArea;for(let r=s.length-1;r>=0;--r){const a=s[r].$filler;a&&(a.line.updateControlPoints(o,a.axis),n&&a.fill&&wi(i.ctx,a,o))}},beforeDatasetsDraw(i,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const n=i.getSortedVisibleDatasetMetas();for(let s=n.length-1;s>=0;--s){const o=n[s].$filler;ls(o)&&wi(i.ctx,o,i.chartArea)}},beforeDatasetDraw(i,t,e){const n=t.meta.$filler;!ls(n)||e.drawTime!=="beforeDatasetDraw"||wi(i.ctx,n,i.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const us=(i,t)=>{let{boxHeight:e=t,boxWidth:n=t}=i;return i.usePointStyle&&(e=Math.min(e,t),n=i.pointStyleWidth||Math.min(n,t)),{boxWidth:n,boxHeight:e,itemHeight:Math.max(t,e)}},Yl=(i,t)=>i!==null&&t!==null&&i.datasetIndex===t.datasetIndex&&i.index===t.index;class gs extends Lt{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,n){this.maxWidth=t,this.maxHeight=e,this._margins=n,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(){const t=this.options.labels||{};let e=N(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(n=>t.filter(n,this.chart.data))),t.sort&&(e=e.sort((n,s)=>t.sort(n,s,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const n=t.labels,s=q(n.font),o=s.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=us(n,o);let c,h;e.font=s.string,this.isHorizontal()?(c=this.maxWidth,h=this._fitRows(r,o,a,l)+10):(h=this.maxHeight,c=this._fitCols(r,s,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,n,s){const{ctx:o,maxWidth:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],h=s+a;let d=t;o.textAlign="left",o.textBaseline="middle";let f=-1,g=-h;return this.legendItems.forEach((p,b)=>{const m=n+e/2+o.measureText(p.text).width;(b===0||c[c.length-1]+m+2*a>r)&&(d+=h,c[c.length-(b>0?0:1)]=0,g+=h,f++),l[b]={left:0,top:g,row:f,width:m,height:s},c[c.length-1]+=m+a}),d}_fitCols(t,e,n,s){const{ctx:o,maxHeight:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],h=r-t;let d=a,f=0,g=0,p=0,b=0;return this.legendItems.forEach((m,x)=>{const{itemWidth:_,itemHeight:w}=Ul(n,e,o,m,s);x>0&&g+w+2*a>h&&(d+=f+a,c.push({width:f,height:g}),p+=f+a,b++,f=g=0),l[x]={left:p,top:g,col:b,width:_,height:w},f=Math.max(f,_),g+=w+a}),d+=f,c.push({width:f,height:g}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:n,labels:{padding:s},rtl:o}}=this,r=$t(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=nt(n,this.left+s,this.right-this.lineWidths[a]);for(const c of e)a!==c.row&&(a=c.row,l=nt(n,this.left+s,this.right-this.lineWidths[a])),c.top+=this.top+t+s,c.left=r.leftForLtr(r.x(l),c.width),l+=c.width+s}else{let a=0,l=nt(n,this.top+t+s,this.bottom-this.columnSizes[a].height);for(const c of e)c.col!==a&&(a=c.col,l=nt(n,this.top+t+s,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+s,c.left=r.leftForLtr(r.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;ke(t,this),this._draw(),we(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:n,ctx:s}=this,{align:o,labels:r}=t,a=$.color,l=$t(t.rtl,this.left,this.width),c=q(r.font),{padding:h}=r,d=c.size,f=d/2;let g;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:p,boxHeight:b,itemHeight:m}=us(r,d),x=function(k,S,M){if(isNaN(p)||p<=0||isNaN(b)||b<0)return;s.save();const C=T(M.lineWidth,1);if(s.fillStyle=T(M.fillStyle,a),s.lineCap=T(M.lineCap,"butt"),s.lineDashOffset=T(M.lineDashOffset,0),s.lineJoin=T(M.lineJoin,"miter"),s.lineWidth=C,s.strokeStyle=T(M.strokeStyle,a),s.setLineDash(T(M.lineDash,[])),r.usePointStyle){const D={radius:b*Math.SQRT2/2,pointStyle:M.pointStyle,rotation:M.rotation,borderWidth:C},P=l.xPlus(k,p/2),O=S+f;tn(s,D,P,O,r.pointStyleWidth&&p)}else{const D=S+Math.max((d-b)/2,0),P=l.leftForLtr(k,p),O=Wt(M.borderRadius);s.beginPath(),Object.values(O).some(F=>F!==0)?Se(s,{x:P,y:D,w:p,h:b,radius:O}):s.rect(P,D,p,b),s.fill(),C!==0&&s.stroke()}s.restore()},_=function(k,S,M){Vt(s,M.text,k,S+m/2,c,{strikethrough:M.hidden,textAlign:l.textAlign(M.textAlign)})},w=this.isHorizontal(),v=this._computeTitleHeight();w?g={x:nt(o,this.left+h,this.right-n[0]),y:this.top+h+v,line:0}:g={x:this.left+h,y:nt(o,this.top+v+h,this.bottom-e[0].height),line:0},dn(this.ctx,t.textDirection);const y=m+h;this.legendItems.forEach((k,S)=>{s.strokeStyle=k.fontColor,s.fillStyle=k.fontColor;const M=s.measureText(k.text).width,C=l.textAlign(k.textAlign||(k.textAlign=r.textAlign)),D=p+f+M;let P=g.x,O=g.y;l.setWidth(this.width),w?S>0&&P+D+h>this.right&&(O=g.y+=y,g.line++,P=g.x=nt(o,this.left+h,this.right-n[g.line])):S>0&&O+y>this.bottom&&(P=g.x=P+e[g.line].width+h,g.line++,O=g.y=nt(o,this.top+v+h,this.bottom-e[g.line].height));const F=l.x(P);if(x(F,O,k),P=Oo(C,P+p+f,w?P+D:this.right,t.rtl),_(l.x(P),O,k),w)g.x+=D+h;else if(typeof k.text!="string"){const H=c.lineHeight;g.y+=ps(k,H)+h}else g.y+=y}),fn(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,n=q(e.font),s=Q(e.padding);if(!e.display)return;const o=$t(t.rtl,this.left,this.width),r=this.ctx,a=e.position,l=n.size/2,c=s.top+l;let h,d=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),h=this.top+c,d=nt(t.align,d,this.right-f);else{const p=this.columnSizes.reduce((b,m)=>Math.max(b,m.height),0);h=c+nt(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const g=nt(a,d,d+f);r.textAlign=o.textAlign(qi(a)),r.textBaseline="middle",r.strokeStyle=e.color,r.fillStyle=e.color,r.font=n.string,Vt(r,e.text,g,h,n)}_computeTitleHeight(){const t=this.options.title,e=q(t.font),n=Q(t.padding);return t.display?e.lineHeight+n.height:0}_getLegendItemAt(t,e){let n,s,o;if(Ct(t,this.left,this.right)&&Ct(e,this.top,this.bottom)){for(o=this.legendHitBoxes,n=0;n<o.length;++n)if(s=o[n],Ct(t,s.left,s.left+s.width)&&Ct(e,s.top,s.top+s.height))return this.legendItems[n]}return null}handleEvent(t){const e=this.options;if(!Kl(t.type,e))return;const n=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,o=Yl(s,n);s&&!o&&N(e.onLeave,[t,s,this],this),this._hoveredItem=n,n&&!o&&N(e.onHover,[t,n,this],this)}else n&&N(e.onClick,[t,n,this],this)}}function Ul(i,t,e,n,s){const o=Xl(n,i,t,e),r=ql(s,n,t.lineHeight);return{itemWidth:o,itemHeight:r}}function Xl(i,t,e,n){let s=i.text;return s&&typeof s!="string"&&(s=s.reduce((o,r)=>o.length>r.length?o:r)),t+e.size/2+n.measureText(s).width}function ql(i,t,e){let n=i;return typeof t.text!="string"&&(n=ps(t,e)),n}function ps(i,t){const e=i.text?i.text.length:0;return t*e}function Kl(i,t){return!!((i==="mousemove"||i==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(i==="click"||i==="mouseup"))}var ms={id:"legend",_element:gs,start(i,t,e){const n=i.legend=new gs({ctx:i.ctx,options:e,chart:i});Mt.configure(i,n,e),Mt.addBox(i,n)},stop(i){Mt.removeBox(i,i.legend),delete i.legend},beforeUpdate(i,t,e){const n=i.legend;Mt.configure(i,n,e),n.options=e},afterUpdate(i){const 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){const n=t.datasetIndex,s=e.chart;s.isDatasetVisible(n)?(s.hide(n),t.hidden=!0):(s.show(n),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:i=>i.chart.options.color,boxWidth:40,padding:10,generateLabels(i){const t=i.data.datasets,{labels:{usePointStyle:e,pointStyle:n,textAlign:s,color:o,useBorderRadius:r,borderRadius:a}}=i.legend.options;return i._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),h=Q(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:c.borderColor,pointStyle:n||c.pointStyle,rotation:c.rotation,textAlign:s||c.textAlign,borderRadius:r&&(a||c.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)}}};const he={average(i){if(!i.length)return!1;let t,e,n=new Set,s=0,o=0;for(t=0,e=i.length;t<e;++t){const a=i[t].element;if(a&&a.hasValue()){const l=a.tooltipPosition();n.add(l.x),s+=l.y,++o}}return o===0||n.size===0?!1:{x:[...n].reduce((a,l)=>a+l)/n.size,y:s/o}},nearest(i,t){if(!i.length)return!1;let e=t.x,n=t.y,s=Number.POSITIVE_INFINITY,o,r,a;for(o=0,r=i.length;o<r;++o){const l=i[o].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),h=Je(t,c);h<s&&(s=h,a=l)}}if(a){const l=a.tooltipPosition();e=l.x,n=l.y}return{x:e,y:n}}};function ct(i,t){return t&&(j(t)?Array.prototype.push.apply(i,t):i.push(t)),i}function gt(i){return(typeof i=="string"||i instanceof String)&&i.indexOf(`
2
2
  `)>-1?i.split(`
3
3
  `):i}function Gl(i,t){const{element:e,datasetIndex:n,index:s}=t,o=i.getDatasetMeta(n).controller,{label:r,value:a}=o.getLabelAndValue(s);return{chart:i,label:r,parsed:o.getParsed(s),raw:i.data.datasets[n].data[s],formattedValue:a,dataset:o.getDataset(),dataIndex:s,datasetIndex:n,element:e}}function bs(i,t){const e=i.chart.ctx,{body:n,footer:s,title:o}=i,{boxWidth:r,boxHeight:a}=t,l=q(t.bodyFont),c=q(t.titleFont),h=q(t.footerFont),d=o.length,f=s.length,g=n.length,p=Q(t.padding);let b=p.height,m=0,x=n.reduce((v,y)=>v+y.before.length+y.lines.length+y.after.length,0);if(x+=i.beforeBody.length+i.afterBody.length,d&&(b+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),x){const v=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;b+=g*v+(x-g)*l.lineHeight+(x-1)*t.bodySpacing}f&&(b+=t.footerMarginTop+f*h.lineHeight+(f-1)*t.footerSpacing);let _=0;const w=function(v){m=Math.max(m,e.measureText(v).width+_)};return e.save(),e.font=c.string,I(i.title,w),e.font=l.string,I(i.beforeBody.concat(i.afterBody),w),_=t.displayColors?r+2+t.boxPadding:0,I(n,v=>{I(v.before,w),I(v.lines,w),I(v.after,w)}),_=0,e.font=h.string,I(i.footer,w),e.restore(),m+=p.width,{width:m,height:b}}function Jl(i,t){const{y:e,height:n}=t;return e<n/2?"top":e>i.height-n/2?"bottom":"center"}function Ql(i,t,e,n){const{x:s,width:o}=n,r=e.caretSize+e.caretPadding;if(i==="left"&&s+o+r>t.width||i==="right"&&s-o-r<0)return!0}function Zl(i,t,e,n){const{x:s,width:o}=e,{width:r,chartArea:{left:a,right:l}}=i;let c="center";return n==="center"?c=s<=(a+l)/2?"left":"right":s<=o/2?c="left":s>=r-o/2&&(c="right"),Ql(c,i,t,e)&&(c="center"),c}function xs(i,t,e){const n=e.yAlign||t.yAlign||Jl(i,e);return{xAlign:e.xAlign||t.xAlign||Zl(i,t,e,n),yAlign:n}}function tc(i,t){let{x:e,width:n}=i;return t==="right"?e-=n:t==="center"&&(e-=n/2),e}function ec(i,t,e){let{y:n,height:s}=i;return t==="top"?n+=e:t==="bottom"?n-=s+e:n-=s/2,n}function ys(i,t,e,n){const{caretSize:s,caretPadding:o,cornerRadius:r}=i,{xAlign:a,yAlign:l}=e,c=s+o,{topLeft:h,topRight:d,bottomLeft:f,bottomRight:g}=Wt(r);let p=tc(t,a);const b=ec(t,l,c);return l==="center"?a==="left"?p+=c:a==="right"&&(p-=c):a==="left"?p-=Math.max(h,f)+s:a==="right"&&(p+=Math.max(d,g)+s),{x:J(p,0,n.width-t.width),y:J(b,0,n.height-t.height)}}function We(i,t,e){const n=Q(e.padding);return t==="center"?i.x+i.width/2:t==="right"?i.x+i.width-n.right:i.x+n.left}function _s(i){return ct([],gt(i))}function ic(i,t,e){return wt(i,{tooltip:t,tooltipItems:e,type:"tooltip"})}function ks(i,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?i.override(e):i}const ws={beforeTitle:dt,title(i){if(i.length>0){const t=i[0],e=t.chart.data.labels,n=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(n>0&&t.dataIndex<n)return e[t.dataIndex]}return""},afterTitle:dt,beforeBody:dt,beforeLabel:dt,label(i){if(this&&this.options&&this.options.mode==="dataset")return i.label+": "+i.formattedValue||i.formattedValue;let t=i.dataset.label||"";t&&(t+=": ");const e=i.formattedValue;return z(e)||(t+=e),t},labelColor(i){const e=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(i){const e=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:dt,afterBody:dt,beforeFooter:dt,footer:dt,afterFooter:dt};function Z(i,t,e,n){const s=i[t].call(e,n);return typeof s>"u"?ws[t].call(e,n):s}class Ss extends Lt{static positioners=he;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(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,n=this.options.setContext(this.getContext()),s=n.enabled&&e.options.animation&&n.animations,o=new kn(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=ic(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:n}=e,s=Z(n,"beforeTitle",this,t),o=Z(n,"title",this,t),r=Z(n,"afterTitle",this,t);let a=[];return a=ct(a,gt(s)),a=ct(a,gt(o)),a=ct(a,gt(r)),a}getBeforeBody(t,e){return _s(Z(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:n}=e,s=[];return I(t,o=>{const r={before:[],lines:[],after:[]},a=ks(n,o);ct(r.before,gt(Z(a,"beforeLabel",this,o))),ct(r.lines,Z(a,"label",this,o)),ct(r.after,gt(Z(a,"afterLabel",this,o))),s.push(r)}),s}getAfterBody(t,e){return _s(Z(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:n}=e,s=Z(n,"beforeFooter",this,t),o=Z(n,"footer",this,t),r=Z(n,"afterFooter",this,t);let a=[];return a=ct(a,gt(s)),a=ct(a,gt(o)),a=ct(a,gt(r)),a}_createItems(t){const e=this._active,n=this.chart.data,s=[],o=[],r=[];let a=[],l,c;for(l=0,c=e.length;l<c;++l)a.push(Gl(this.chart,e[l]));return t.filter&&(a=a.filter((h,d,f)=>t.filter(h,d,f,n))),t.itemSort&&(a=a.sort((h,d)=>t.itemSort(h,d,n))),I(a,h=>{const d=ks(t.callbacks,h);s.push(Z(d,"labelColor",this,h)),o.push(Z(d,"labelPointStyle",this,h)),r.push(Z(d,"labelTextColor",this,h))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=a,a}update(t,e){const n=this.options.setContext(this.getContext()),s=this._active;let o,r=[];if(!s.length)this.opacity!==0&&(o={opacity:0});else{const a=he[n.position].call(this,s,this._eventPosition);r=this._createItems(n),this.title=this.getTitle(r,n),this.beforeBody=this.getBeforeBody(r,n),this.body=this.getBody(r,n),this.afterBody=this.getAfterBody(r,n),this.footer=this.getFooter(r,n);const l=this._size=bs(this,n),c=Object.assign({},a,l),h=xs(this.chart,n,c),d=ys(n,c,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,o={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=r,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,n,s){const o=this.getCaretPosition(t,n,s);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(t,e,n){const{xAlign:s,yAlign:o}=this,{caretSize:r,cornerRadius:a}=n,{topLeft:l,topRight:c,bottomLeft:h,bottomRight:d}=Wt(a),{x:f,y:g}=t,{width:p,height:b}=e;let m,x,_,w,v,y;return o==="center"?(v=g+b/2,s==="left"?(m=f,x=m-r,w=v+r,y=v-r):(m=f+p,x=m+r,w=v-r,y=v+r),_=m):(s==="left"?x=f+Math.max(l,h)+r:s==="right"?x=f+p-Math.max(c,d)-r:x=this.caretX,o==="top"?(w=g,v=w-r,m=x-r,_=x+r):(w=g+b,v=w+r,m=x+r,_=x-r),y=w),{x1:m,x2:x,x3:_,y1:w,y2:v,y3:y}}drawTitle(t,e,n){const s=this.title,o=s.length;let r,a,l;if(o){const c=$t(n.rtl,this.x,this.width);for(t.x=We(this,n.titleAlign,n),e.textAlign=c.textAlign(n.titleAlign),e.textBaseline="middle",r=q(n.titleFont),a=n.titleSpacing,e.fillStyle=n.titleColor,e.font=r.string,l=0;l<o;++l)e.fillText(s[l],c.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+a,l+1===o&&(t.y+=n.titleMarginBottom-a)}}_drawColorBox(t,e,n,s,o){const r=this.labelColors[n],a=this.labelPointStyles[n],{boxHeight:l,boxWidth:c}=o,h=q(o.bodyFont),d=We(this,"left",o),f=s.x(d),g=l<h.lineHeight?(h.lineHeight-l)/2:0,p=e.y+g;if(o.usePointStyle){const b={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},m=s.leftForLtr(f,c)+c/2,x=p+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,si(t,b,m,x),t.strokeStyle=r.borderColor,t.fillStyle=r.backgroundColor,si(t,b,m,x)}else{t.lineWidth=R(r.borderWidth)?Math.max(...Object.values(r.borderWidth)):r.borderWidth||1,t.strokeStyle=r.borderColor,t.setLineDash(r.borderDash||[]),t.lineDashOffset=r.borderDashOffset||0;const b=s.leftForLtr(f,c),m=s.leftForLtr(s.xPlus(f,1),c-2),x=Wt(r.borderRadius);Object.values(x).some(_=>_!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,Se(t,{x:b,y:p,w:c,h:l,radius:x}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),Se(t,{x:m,y:p+1,w:c-2,h:l-2,radius:x}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(b,p,c,l),t.strokeRect(b,p,c,l),t.fillStyle=r.backgroundColor,t.fillRect(m,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[n]}drawBody(t,e,n){const{body:s}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:h}=n,d=q(n.bodyFont);let f=d.lineHeight,g=0;const p=$t(n.rtl,this.x,this.width),b=function(M){e.fillText(M,p.x(t.x+g),t.y+f/2),t.y+=f+o},m=p.textAlign(r);let x,_,w,v,y,k,S;for(e.textAlign=r,e.textBaseline="middle",e.font=d.string,t.x=We(this,m,n),e.fillStyle=n.bodyColor,I(this.beforeBody,b),g=a&&m!=="right"?r==="center"?c/2+h:c+2+h:0,v=0,k=s.length;v<k;++v){for(x=s[v],_=this.labelTextColors[v],e.fillStyle=_,I(x.before,b),w=x.lines,a&&w.length&&(this._drawColorBox(e,t,v,p,n),f=Math.max(d.lineHeight,l)),y=0,S=w.length;y<S;++y)b(w[y]),f=d.lineHeight;I(x.after,b)}g=0,f=d.lineHeight,I(this.afterBody,b),t.y-=o}drawFooter(t,e,n){const s=this.footer,o=s.length;let r,a;if(o){const l=$t(n.rtl,this.x,this.width);for(t.x=We(this,n.footerAlign,n),t.y+=n.footerMarginTop,e.textAlign=l.textAlign(n.footerAlign),e.textBaseline="middle",r=q(n.footerFont),e.fillStyle=n.footerColor,e.font=r.string,a=0;a<o;++a)e.fillText(s[a],l.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+n.footerSpacing}}drawBackground(t,e,n,s){const{xAlign:o,yAlign:r}=this,{x:a,y:l}=t,{width:c,height:h}=n,{topLeft:d,topRight:f,bottomLeft:g,bottomRight:p}=Wt(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(a+d,l),r==="top"&&this.drawCaret(t,e,n,s),e.lineTo(a+c-f,l),e.quadraticCurveTo(a+c,l,a+c,l+f),r==="center"&&o==="right"&&this.drawCaret(t,e,n,s),e.lineTo(a+c,l+h-p),e.quadraticCurveTo(a+c,l+h,a+c-p,l+h),r==="bottom"&&this.drawCaret(t,e,n,s),e.lineTo(a+g,l+h),e.quadraticCurveTo(a,l+h,a,l+h-g),r==="center"&&o==="left"&&this.drawCaret(t,e,n,s),e.lineTo(a,l+d),e.quadraticCurveTo(a,l,a+d,l),e.closePath(),e.fill(),s.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,n=this.$animations,s=n&&n.x,o=n&&n.y;if(s||o){const r=he[t.position].call(this,this._active,this._eventPosition);if(!r)return;const a=this._size=bs(this,t),l=Object.assign({},r,this._size),c=xs(e,t,l),h=ys(t,l,c,e);(s._to!==h.x||o._to!==h.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=r.x,this.caretY=r.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let n=this.opacity;if(!n)return;this._updateAnimationTarget(e);const s={width:this.width,height:this.height},o={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;const r=Q(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=n,this.drawBackground(o,t,s,e),dn(t,e.textDirection),o.y+=r.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),fn(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const n=this._active,s=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),o=!ge(n,s),r=this._positionChanged(s,e);(o||r)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,n=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,o=this._active||[],r=this._getActiveElements(t,o,e,n),a=this._positionChanged(r,t),l=e||!ge(r,o)||a;return l&&(this._active=r,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,n,s){const o=this.options;if(t.type==="mouseout")return[];if(!s)return e.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const r=this.chart.getElementsAtEventForMode(t,o.mode,o,n);return o.reverse&&r.reverse(),r}_positionChanged(t,e){const{caretX:n,caretY:s,options:o}=this,r=he[o.position].call(this,t,e);return r!==!1&&(n!==r.x||s!==r.y)}}var Mi={id:"tooltip",_element:Ss,positioners:he,afterInit(i,t,e){e&&(i.tooltip=new Ss({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){const t=i.tooltip;if(t&&t._willRender()){const 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){const 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:ws},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"]};const nc=(i,t,e,n)=>(typeof t=="string"?(e=i.push(t)-1,n.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function sc(i,t,e,n){const s=i.indexOf(t);if(s===-1)return nc(i,t,e,n);const o=i.lastIndexOf(t);return s!==o?e:s}const oc=(i,t)=>i===null?null:J(Math.round(i),0,t);function Ms(i){const t=this.getLabels();return i>=0&&i<t.length?t[i]:i}class rc extends Yt{static id="category";static defaults={ticks:{callback:Ms}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const n=this.getLabels();for(const{index:s,label:o}of e)n[s]===o&&n.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(z(t))return null;const n=this.getLabels();return e=isFinite(e)&&n[e]===t?e:sc(n,t,T(e,t),this._addedLabels),oc(e,n.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:n,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(n=0),e||(s=this.getLabels().length-1)),this.min=n,this.max=s}buildTicks(){const t=this.min,e=this.max,n=this.options.offset,s=[];let o=this.getLabels();o=t===0&&e===o.length-1?o:o.slice(t,e+1),this._valueRange=Math.max(o.length-(n?0:1),1),this._startValue=this.min-(n?.5:0);for(let r=t;r<=e;r++)s.push({value:r});return s}getLabelForValue(t){return Ms.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function ac(i,t){const e=[],{bounds:s,step:o,min:r,max:a,precision:l,count:c,maxTicks:h,maxDigits:d,includeBounds:f}=i,g=o||1,p=h-1,{min:b,max:m}=t,x=!z(r),_=!z(a),w=!z(c),v=(m-b)/(d+1);let y=Wi((m-b)/p/g)*g,k,S,M,C;if(y<1e-14&&!x&&!_)return[{value:b},{value:m}];C=Math.ceil(m/y)-Math.floor(b/y),C>p&&(y=Wi(C*y/p/g)*g),z(l)||(k=Math.pow(10,l),y=Math.ceil(y*k)/k),s==="ticks"?(S=Math.floor(b/y)*y,M=Math.ceil(m/y)*y):(S=b,M=m),x&&_&&o&&ko((a-r)/o,y/1e3)?(C=Math.round(Math.min((a-r)/y,h)),y=(a-r)/C,S=r,M=a):w?(S=x?r:S,M=_?a:M,C=c-1,y=(M-S)/C):(C=(M-S)/y,Qt(C,Math.round(C),y/1e3)?C=Math.round(C):C=Math.ceil(C));const D=Math.max(Hi(y),Hi(S));k=Math.pow(10,z(l)?D:l),S=Math.round(S*k)/k,M=Math.round(M*k)/k;let P=0;for(x&&(f&&S!==r?(e.push({value:r}),S<r&&P++,Qt(Math.round((S+P*y)*k)/k,r,vs(r,v,i))&&P++):S<r&&P++);P<C;++P){const O=Math.round((S+P*y)*k)/k;if(_&&O>a)break;e.push({value:O})}return _&&f&&M!==a?e.length&&Qt(e[e.length-1].value,a,vs(a,v,i))?e[e.length-1].value=a:e.push({value:a}):(!_||M===a)&&e.push({value:M}),e}function vs(i,t,{horizontal:e,minRotation:n}){const s=rt(n),o=(e?Math.sin(s):Math.cos(s))||.001,r=.75*t*(""+i).length;return Math.min(t/o,r)}class vi extends Yt{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 z(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:n}=this.getUserBounds();let{min:s,max:o}=this;const r=l=>s=e?s:l,a=l=>o=n?o:l;if(t){const l=Nt(s),c=Nt(o);l<0&&c<0?a(0):l>0&&c>0&&r(0)}if(s===o){let l=o===0?1:Math.abs(o*.05);a(o+l),t||r(s-l)}this.min=s,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:n}=t,s;return n?(s=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),e=e||11),e&&(s=Math.min(e,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let n=this.getTickLimit();n=Math.max(2,n);const s={maxTicks:n,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},o=this._range||this,r=ac(s,o);return t.bounds==="ticks"&&wo(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){const t=this.ticks;let e=this.min,n=this.max;if(super.configure(),this.options.offset&&t.length){const s=(n-e)/Math.max(t.length-1,1)/2;e-=s,n+=s}this._startValue=e,this._endValue=n,this._valueRange=n-e}getLabelForValue(t){return ye(t,this.chart.options.locale,this.options.ticks.format)}}class lc extends vi{static id="linear";static defaults={ticks:{callback:ei.formatters.numeric}};determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=X(t)?t:0,this.max=X(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,n=rt(this.options.ticks.minRotation),s=(t?Math.sin(n):Math.cos(n))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}function Ci(i){const t=i.ticks;if(t.display&&i.display){const e=Q(t.backdropPadding);return T(t.font&&t.font.size,$.font.size)+e.height}return 0}function cc(i,t,e){return e=j(e)?e:[e],{w:jo(i,t.string,e),h:e.length*t.lineHeight}}function Cs(i,t,e,n,s){return i===n||i===s?{start:t-e/2,end:t+e/2}:i<n||i>s?{start:t-e,end:t}:{start:t,end:t+e}}function hc(i){const 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),n=[],s=[],o=i._pointLabels.length,r=i.options.pointLabels,a=r.centerPointLabels?B/o:0;for(let l=0;l<o;l++){const c=r.setContext(i.getPointLabelContext(l));s[l]=c.padding;const h=i.getPointPosition(l,i.drawingArea+s[l],a),d=q(c.font),f=cc(i.ctx,d,i._pointLabels[l]);n[l]=f;const g=G(i.getIndexAngle(l)+a),p=Math.round(Ge(g)),b=Cs(p,h.x,f.w,0,180),m=Cs(p,h.y,f.h,90,270);dc(e,t,g,b,m)}i.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),i._pointLabelItems=gc(i,n,s)}function dc(i,t,e,n,s){const o=Math.abs(Math.sin(e)),r=Math.abs(Math.cos(e));let a=0,l=0;n.start<t.l?(a=(t.l-n.start)/o,i.l=Math.min(i.l,t.l-a)):n.end>t.r&&(a=(n.end-t.r)/o,i.r=Math.max(i.r,t.r+a)),s.start<t.t?(l=(t.t-s.start)/r,i.t=Math.min(i.t,t.t-l)):s.end>t.b&&(l=(s.end-t.b)/r,i.b=Math.max(i.b,t.b+l))}function fc(i,t,e){const n=i.drawingArea,{extra:s,additionalAngle:o,padding:r,size:a}=e,l=i.getPointPosition(t,n+s+r,o),c=Math.round(Ge(G(l.angle+Y))),h=bc(l.y,a.h,c),d=pc(c),f=mc(l.x,a.w,d);return{visible:!0,x:l.x,y:h,textAlign:d,left:f,top:h,right:f+a.w,bottom:h+a.h}}function uc(i,t){if(!t)return!0;const{left:e,top:n,right:s,bottom:o}=i;return!(ft({x:e,y:n},t)||ft({x:e,y:o},t)||ft({x:s,y:n},t)||ft({x:s,y:o},t))}function gc(i,t,e){const n=[],s=i._pointLabels.length,o=i.options,{centerPointLabels:r,display:a}=o.pointLabels,l={extra:Ci(o)/2,additionalAngle:r?B/s:0};let c;for(let h=0;h<s;h++){l.padding=e[h],l.size=t[h];const d=fc(i,h,l);n.push(d),a==="auto"&&(d.visible=uc(d,c),d.visible&&(c=d))}return n}function pc(i){return i===0||i===180?"center":i<180?"left":"right"}function mc(i,t,e){return e==="right"?i-=t:e==="center"&&(i-=t/2),i}function bc(i,t,e){return e===90||e===270?i-=t/2:(e>270||e<90)&&(i-=t),i}function xc(i,t,e){const{left:n,top:s,right:o,bottom:r}=e,{backdropColor:a}=t;if(!z(a)){const l=Wt(t.borderRadius),c=Q(t.backdropPadding);i.fillStyle=a;const h=n-c.left,d=s-c.top,f=o-n+c.width,g=r-s+c.height;Object.values(l).some(p=>p!==0)?(i.beginPath(),Se(i,{x:h,y:d,w:f,h:g,radius:l}),i.fill()):i.fillRect(h,d,f,g)}}function yc(i,t){const{ctx:e,options:{pointLabels:n}}=i;for(let s=t-1;s>=0;s--){const o=i._pointLabelItems[s];if(!o.visible)continue;const r=n.setContext(i.getPointLabelContext(s));xc(e,r,o);const a=q(r.font),{x:l,y:c,textAlign:h}=o;Vt(e,i._pointLabels[s],l,c+a.lineHeight/2,a,{color:r.color,textAlign:h,textBaseline:"middle"})}}function Ds(i,t,e,n){const{ctx:s}=i;if(e)s.arc(i.xCenter,i.yCenter,t,0,W);else{let o=i.getPointPosition(0,t);s.moveTo(o.x,o.y);for(let r=1;r<n;r++)o=i.getPointPosition(r,t),s.lineTo(o.x,o.y)}}function _c(i,t,e,n,s){const o=i.ctx,r=t.circular,{color:a,lineWidth:l}=t;!r&&!n||!a||!l||e<0||(o.save(),o.strokeStyle=a,o.lineWidth=l,o.setLineDash(s.dash||[]),o.lineDashOffset=s.dashOffset,o.beginPath(),Ds(i,e,r,n),o.closePath(),o.stroke(),o.restore())}function kc(i,t,e){return wt(i,{label:e,index:t,type:"pointLabel"})}class wc extends vi{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:ei.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return 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(){const t=this._padding=Q(Ci(this.options)/2),e=this.width=this.maxWidth-t.width,n=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+n/2+t.top),this.drawingArea=Math.floor(Math.min(e,n)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=X(t)&&!isNaN(t)?t:0,this.max=X(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Ci(this.options))}generateTickLabels(t){vi.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,n)=>{const s=N(this.options.pointLabels.callback,[e,n],this);return s||s===0?s:""}).filter((e,n)=>this.chart.getDataVisibility(n))}fit(){const t=this.options;t.display&&t.pointLabels.display?hc(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,n,s){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((n-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,n,s))}getIndexAngle(t){const e=W/(this._pointLabels.length||1),n=this.options.startAngle||0;return G(t*e+rt(n))}getDistanceFromCenterForValue(t){if(z(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(z(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const n=e[t];return kc(this.getContext(),t,n)}}getPointPosition(t,e,n=0){const s=this.getIndexAngle(t)-Y+n;return{x:Math.cos(s)*e+this.xCenter,y:Math.sin(s)*e+this.yCenter,angle:s}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:n,right:s,bottom:o}=this._pointLabelItems[t];return{left:e,top:n,right:s,bottom:o}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const n=this.ctx;n.save(),n.beginPath(),Ds(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),n.closePath(),n.fillStyle=t,n.fill(),n.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:n,grid:s,border:o}=e,r=this._pointLabels.length;let a,l,c;if(e.pointLabels.display&&yc(this,r),s.display&&this.ticks.forEach((h,d)=>{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(h.value);const f=this.getContext(d),g=s.setContext(f),p=o.setContext(f);_c(this,g,l,r,p)}}),n.display){for(t.save(),a=r-1;a>=0;a--){const h=n.setContext(this.getPointLabelContext(a)),{color:d,lineWidth:f}=h;!f||!d||(t.lineWidth=f,t.strokeStyle=d,t.setLineDash(h.borderDash),t.lineDashOffset=h.borderDashOffset,l=this.getDistanceFromCenterForValue(e.reverse?this.min:this.max),c=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,n=e.ticks;if(!n.display)return;const s=this.getIndexAngle(0);let o,r;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!e.reverse)return;const c=n.setContext(this.getContext(l)),h=q(c.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=h.string,r=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const d=Q(c.backdropPadding);t.fillRect(-r/2-d.left,-o-h.size/2-d.top,r+d.width,h.size+d.height)}Vt(t,a.label,0,-o,h,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}const He={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}},tt=Object.keys(He);function Ps(i,t){return i-t}function As(i,t){if(z(t))return null;const e=i._adapter,{parser:n,round:s,isoWeekday:o}=i._parseOpts;let r=t;return typeof n=="function"&&(r=n(r)),X(r)||(r=typeof n=="string"?e.parse(r,n):e.parse(r)),r===null?null:(s&&(r=s==="week"&&(Zt(o)||o===!0)?e.startOf(r,"isoWeek",o):e.startOf(r,s)),+r)}function Os(i,t,e,n){const s=tt.length;for(let o=tt.indexOf(i);o<s-1;++o){const r=He[tt[o]],a=r.steps?r.steps:Number.MAX_SAFE_INTEGER;if(r.common&&Math.ceil((e-t)/(a*r.size))<=n)return tt[o]}return tt[s-1]}function Sc(i,t,e,n,s){for(let o=tt.length-1;o>=tt.indexOf(e);o--){const r=tt[o];if(He[r].common&&i._adapter.diff(s,n,r)>=t-1)return r}return tt[e?tt.indexOf(e):0]}function Mc(i){for(let t=tt.indexOf(i)+1,e=tt.length;t<e;++t)if(He[tt[t]].common)return tt[t]}function Ts(i,t,e){if(!e)i[t]=!0;else if(e.length){const{lo:n,hi:s}=Qe(e,t),o=e[n]>=t?e[n]:e[s];i[o]=!0}}function vc(i,t,e,n){const s=i._adapter,o=+s.startOf(t[0].value,n),r=t[t.length-1].value;let a,l;for(a=o;a<=r;a=+s.add(a,1,n))l=e[a],l>=0&&(t[l].major=!0);return t}function Es(i,t,e){const n=[],s={},o=t.length;let r,a;for(r=0;r<o;++r)a=t[r],s[a]=r,n.push({value:a,major:!1});return o===0||!e?n:vc(i,n,s,e)}class Rs extends Yt{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={}){const n=t.time||(t.time={}),s=this._adapter=new ta._date(t.adapters.date);s.init(e),Jt(n.displayFormats,s.formats()),this._parseOpts={parser:n.parser,round:n.round,isoWeekday:n.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:As(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,n=t.time.unit||"day";let{min:s,max:o,minDefined:r,maxDefined:a}=this.getUserBounds();function l(c){!r&&!isNaN(c.min)&&(s=Math.min(s,c.min)),!a&&!isNaN(c.max)&&(o=Math.max(o,c.max))}(!r||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),s=X(s)&&!isNaN(s)?s:+e.startOf(Date.now(),n),o=X(o)&&!isNaN(o)?o:+e.endOf(Date.now(),n)+1,this.min=Math.min(s,o-1),this.max=Math.max(s+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],n=t[t.length-1]),{min:e,max:n}}buildTicks(){const t=this.options,e=t.time,n=t.ticks,s=n.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const o=this.min,r=this.max,a=Co(s,o,r);return this._unit=e.unit||(n.autoSkip?Os(e.minUnit,this.min,this.max,this._getLabelCapacity(o)):Sc(this,a.length,e.minUnit,this.min,this.max)),this._majorUnit=!n.major.enabled||this._unit==="year"?void 0:Mc(this._unit),this.initOffsets(s),t.reverse&&a.reverse(),Es(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,n=0,s,o;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?e=1-s:e=(this.getDecimalForValue(t[1])-s)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?n=o:n=(o-this.getDecimalForValue(t[t.length-2]))/2);const r=t.length<3?.5:.25;e=J(e,0,r),n=J(n,0,r),this._offsets={start:e,end:n,factor:1/(e+1+n)}}_generate(){const t=this._adapter,e=this.min,n=this.max,s=this.options,o=s.time,r=o.unit||Os(o.minUnit,e,n,this._getLabelCapacity(e)),a=T(s.ticks.stepSize,1),l=r==="week"?o.isoWeekday:!1,c=Zt(l)||l===!0,h={};let d=e,f,g;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":r),t.diff(n,e,r)>1e5*a)throw new Error(e+" and "+n+" are too far apart with stepSize of "+a+" "+r);const p=s.ticks.source==="data"&&this.getDataTimestamps();for(f=d,g=0;f<n;f=+t.add(f,a,r),g++)Ts(h,f,p);return(f===n||s.bounds==="ticks"||g===1)&&Ts(h,f,p),Object.keys(h).sort(Ps).map(b=>+b)}getLabelForValue(t){const e=this._adapter,n=this.options.time;return n.tooltipFormat?e.format(t,n.tooltipFormat):e.format(t,n.displayFormats.datetime)}format(t,e){const s=this.options.time.displayFormats,o=this._unit,r=e||s[o];return this._adapter.format(t,r)}_tickFormatFunction(t,e,n,s){const o=this.options,r=o.ticks.callback;if(r)return N(r,[t,e,n],this);const a=o.time.displayFormats,l=this._unit,c=this._majorUnit,h=l&&a[l],d=c&&a[c],f=n[e],g=c&&d&&f&&f.major;return this._adapter.format(t,s||(g?d:h))}generateTickLabels(t){let e,n,s;for(e=0,n=t.length;e<n;++e)s=t[e],s.label=this._tickFormatFunction(s.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,n=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+n)*e.factor)}getValueForPixel(t){const e=this._offsets,n=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+n*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,n=this.ctx.measureText(t).width,s=rt(this.isHorizontal()?e.maxRotation:e.minRotation),o=Math.cos(s),r=Math.sin(s),a=this._resolveTickFontOptions(0).size;return{w:n*o+a*r,h:n*r+a*o}}_getLabelCapacity(t){const e=this.options.time,n=e.displayFormats,s=n[e.unit]||n.millisecond,o=this._tickFormatFunction(t,0,Es(this,[t],this._majorUnit),s),r=this._getLabelSize(o),a=Math.floor(this.isHorizontal()?this.width/r.w:this.height/r.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],e,n;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(e=0,n=s.length;e<n;++e)t=t.concat(s[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,n;if(t.length)return t;const s=this.getLabels();for(e=0,n=s.length;e<n;++e)t.push(As(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Po(t.sort(Ps))}}function je(i,t,e){let n=0,s=i.length-1,o,r,a,l;e?(t>=i[n].pos&&t<=i[s].pos&&({lo:n,hi:s}=Dt(i,"pos",t)),{pos:o,time:a}=i[n],{pos:r,time:l}=i[s]):(t>=i[n].time&&t<=i[s].time&&({lo:n,hi:s}=Dt(i,"time",t)),{time:o,pos:a}=i[n],{time:r,pos:l}=i[s]);const c=r-o;return c?a+(l-a)*(t-o)/c:a}class rh extends Rs{static id="timeseries";static defaults=Rs.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=je(e,this.min),this._tableRange=je(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:n}=this,s=[],o=[];let r,a,l,c,h;for(r=0,a=t.length;r<a;++r)c=t[r],c>=e&&c<=n&&s.push(c);if(s.length<2)return[{time:e,pos:0},{time:n,pos:1}];for(r=0,a=s.length;r<a;++r)h=s[r+1],l=s[r-1],c=s[r],Math.round((h+l)/2)!==c&&o.push({time:c,pos:r/(a-1)});return o}_generate(){const t=this.min,e=this.max;let n=super.getDataTimestamps();return(!n.includes(t)||!n.length)&&n.splice(0,0,t),(!n.includes(e)||n.length===1)&&n.push(e),n.sort((s,o)=>s-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),n=this.getLabelTimestamps();return e.length&&n.length?t=this.normalize(e.concat(n)):t=e.length?e:n,t=this._cache.all=t,t}getDecimalForValue(t){return(je(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,n=this.getDecimalForPixel(t)/e.factor-e.end;return je(this._table,n*this._tableRange+this._minPos,!0)}}const Cc={key:0,class:"m-0 text-xs",style:{color:"#7B7B7B"}},Dc={class:"flex flex-column gap-2 flex-1 w-full",style:{"max-width":"26rem"}},Pc={class:"flex align-items-center justify-content-between gap-2 pb-1",style:{"border-bottom":"1px solid #e5e7eb"}},Ac={class:"flex align-items-center gap-2"},Oc={class:"flex align-items-center gap-2"},Tc={class:"flex justify-content-center align-items-center mx-auto",style:{width:"200px",height:"200px","flex-shrink":"0"}},Ls=zt({__name:"Polar",props:{label_rotulo:{type:String,default:"Rótulo"},label_quantidade:{type:String,default:"Quantidade"},titulo:{type:String,default:"Polar Chart"},subtitulo:{type:String,default:""},dados:{type:Array,required:!1,default:()=>[]},cor:{type:String,default:"light",validator:i=>["light","dark","transparent"].includes(i)},corPaleta:{type:String,default:"#1E40AF"},direcao:{type:String,default:null,validator:i=>i===null||["horizontal","vertical"].includes(i)}},setup(i){Bt.register(Zr,wc,is,Mi,ms);const t=i,e={light:"bg-white",dark:"bg-black",transparent:"bg-transparent"},n=u.computed(()=>e[t.cor]??"bg-white"),s=u.computed(()=>t.cor==="dark");function o(m,x=7){const _=m.replace("#","");let w=parseInt(_.slice(0,2),16),v=parseInt(_.slice(2,4),16),y=parseInt(_.slice(4,6),16);w/=255,v/=255,y/=255;const k=Math.max(w,v,y),S=Math.min(w,v,y);let M,C,D=(k+S)/2;if(k===S)M=C=0;else{const A=k-S;switch(C=D>.5?A/(2-k-S):A/(k+S),k){case w:M=((v-y)/A+(v<y?6:0))/6;break;case v:M=((y-w)/A+2)/6;break;case y:M=((w-v)/A+4)/6;break}}const P=Math.max(.2,D-.3),F=(Math.min(.95,D+.35)-P)/(x-1);function H(A,E,L){const K=E*Math.min(L,1-L),V=ot=>{const U=(ot+A*12)%12,et=L-K*Math.max(-1,Math.min(U-3,9-U,1));return Math.round(255*et).toString(16).padStart(2,"0")};return`#${V(0)}${V(8)}${V(4)}`}return Array.from({length:x},(A,E)=>H(M,C,P+F*E))}const r=u.computed(()=>o(t.corPaleta,t.dados.length)),a=u.ref(null),l=u.ref(null),c=u.ref(!0);let h=null,d=null;const f=u.computed(()=>t.direcao==="vertical"?"flex-column-reverse":t.direcao==="horizontal"?"flex-row":c.value?"flex-column-reverse":"flex-row"),g=u.computed(()=>({labels:t.dados.map(m=>m.rotulo),datasets:[{data:t.dados.map(m=>m.quantidade),backgroundColor:r.value,borderWidth:0,borderColor:"transparent"}]})),p=u.computed(()=>({responsive:!0,maintainAspectRatio:!0,animation:{duration:800,easing:"easeOutQuart"},plugins:{legend:{display:!1},tooltip:{enabled:!0}},scales:{r:{ticks:{display:!1},grid:{color:s.value?"rgba(255, 255, 255, 0.1)":"rgba(0, 0, 0, 0.05)"}}}}));function b(){d&&d.destroy(),d=new Bt(a.value,{type:"polarArea",data:g.value,options:p.value})}return u.onMounted(()=>{b(),h=new ResizeObserver(([m])=>{c.value=m.contentRect.width<380}),h.observe(l.value)}),u.onBeforeUnmount(()=>{d&&d.destroy(),h&&h.disconnect()}),u.watch(()=>t.dados,()=>{b()},{deep:!0}),u.watch(()=>t.cor,()=>{b()}),u.watch(()=>t.corPaleta,()=>{b()}),(m,x)=>(u.openBlock(),u.createElementBlock("div",{class:u.normalizeClass([n.value,"border-round-xl flex flex-column w-full transition-linear transition-all transition-duration-200 select-none nc-card-hover"]),style:{padding:"1.25rem",gap:"1.438rem",border:"1px solid #e5e7eb"}},[u.createElementVNode("div",null,[u.createElementVNode("p",{class:u.normalizeClass(["m-0 text-xs font-medium",s.value?"text-white":"text-gray-900"])},u.toDisplayString(i.titulo),3),i.subtitulo?(u.openBlock(),u.createElementBlock("p",Cc,u.toDisplayString(i.subtitulo),1)):u.createCommentVNode("",!0)]),u.createElementVNode("div",{ref_key:"containerRef",ref:l,class:u.normalizeClass(["flex w-full h-full gap-3 align-items-center justify-content-between",f.value])},[u.createElementVNode("div",Dc,[u.createElementVNode("div",Pc,[u.createElementVNode("div",Ac,[x[0]||(x[0]=u.createElementVNode("span",{style:{width:"10px",height:"10px",flexShrink:0}},null,-1)),u.createElementVNode("span",{class:"text-xs font-medium",style:u.normalizeStyle({color:s.value?"#fff":"#6b7280"})},u.toDisplayString(i.label_rotulo),5)]),u.createElementVNode("span",{class:"text-xs font-medium",style:u.normalizeStyle({color:s.value?"#fff":"#6b7280"})},u.toDisplayString(i.label_quantidade),5)]),(u.openBlock(!0),u.createElementBlock(u.Fragment,null,u.renderList(i.dados,(_,w)=>(u.openBlock(),u.createElementBlock("div",{key:w,class:"flex align-items-center justify-content-between"},[u.createElementVNode("div",Oc,[u.createElementVNode("span",{style:u.normalizeStyle({backgroundColor:r.value[w],width:"10px",height:"10px",flexShrink:0,borderRadius:"50%"})},null,4),u.createElementVNode("span",{class:"text-xs font-medium",style:u.normalizeStyle({color:s.value?"#fff":"#374151"})},u.toDisplayString(_.rotulo),5)]),u.createElementVNode("span",{class:"text-xs font-semibold",style:u.normalizeStyle({color:s.value?"#fff":"#111"})},u.toDisplayString(_.quantidade),5)]))),128))]),u.createElementVNode("div",Tc,[u.createElementVNode("canvas",{ref_key:"canvasRef",ref:a,width:"200",height:"200"},null,512)])],2)],2))}},[["__scopeId","data-v-8d8f36f0"]]),Ec={class:"w-full"},Rc={key:0,class:"m-0 text-xs",style:{color:"#7B7B7B"}},Lc={class:"flex w-full gap-3 justify-content-between flex-column",style:{flex:"1","min-height":"0"}},Bc={class:"m-0 text-sm",style:{color:"#7B7B7B","word-break":"break-word"}},zc=["onMouseenter","onMousemove"],Ic={class:"flex gap-1",style:{width:"100%","margin-top":"4px"}},Bs=zt({__name:"CardColumn",props:{titulo:{type:String,default:"CardColumn"},subtitulo:{type:String,default:""},valor:{type:String,default:"0"},descricao:{type:String,default:"This is a card component."},dados:{type:Array,required:!1,default:()=>[]},cor:{type:String,default:"light",validator:i=>["light","dark","transparent"].includes(i)},corPaleta:{type:String,default:"#1E40AF"},moeda:{type:Boolean,default:!1}},setup(i){const t=i,e={light:"bg-white",dark:"bg-black",transparent:"bg-transparent"},n=u.computed(()=>e[t.cor]??"bg-white"),s=u.computed(()=>t.cor==="dark"),o=u.computed(()=>t.cor==="dark"?"#252525":"#E9E9E9");function r(k,S=7){const M=k.replace("#","");let C=parseInt(M.slice(0,2),16),D=parseInt(M.slice(2,4),16),P=parseInt(M.slice(4,6),16);C/=255,D/=255,P/=255;const O=Math.max(C,D,P),F=Math.min(C,D,P);let H,A,E=(O+F)/2;if(O===F)H=A=0;else{const U=O-F;switch(A=E>.5?U/(2-O-F):U/(O+F),O){case C:H=((D-P)/U+(D<P?6:0))/6;break;case D:H=((P-C)/U+2)/6;break;case P:H=((C-D)/U+4)/6;break}}const L=Math.max(.2,E-.3),K=Math.min(.95,E+.35),V=S>1?(K-L)/(S-1):0;function ot(U,et,pt){const mt=et*Math.min(pt,1-pt),bt=xt=>{const Ns=(xt+U*12)%12,sh=pt-mt*Math.max(-1,Math.min(Ns-3,9-Ns,1));return Math.round(255*sh).toString(16).padStart(2,"0")};return`#${bt(0)}${bt(8)}${bt(4)}`}return Array.from({length:S},(U,et)=>ot(H,A,L+V*et))}const a=u.computed(()=>r(t.corPaleta,t.dados.length)),l=u.computed(()=>Math.max(...t.dados.map(k=>k.quantidade),1)),c=u.ref(null),h=u.ref(80),d=u.ref(null),f=u.ref(!1);let g=null,p=null;u.onMounted(()=>{g=new ResizeObserver(([k])=>{h.value=k.contentRect.height||80}),g.observe(c.value),p=new ResizeObserver(([k])=>{f.value=k.contentRect.width<340}),p.observe(d.value)}),u.onBeforeUnmount(()=>{g&&g.disconnect(),p&&p.disconnect()});const b=u.ref(null),m=u.ref({visible:!1,x:0,y:0,text:""});function x(k,S){b.value=k,y(k,S)}function _(k,S){y(k,S)}function w(){b.value=null,m.value.visible=!1}function v(k){return t.moeda?Number(k).toLocaleString("pt-BR",{style:"currency",currency:"BRL"}):`${k}`}function y(k,S){const M=t.dados[k],C=S.currentTarget.closest(".chart-container").getBoundingClientRect(),D=S.currentTarget.getBoundingClientRect();m.value={visible:!0,x:D.left-C.left+D.width/2,y:D.top-C.top-8,text:v(M.quantidade)}}return(k,S)=>(u.openBlock(),u.createElementBlock("div",{ref_key:"rootRef",ref:d,class:u.normalizeClass([n.value,"border-round-xl flex flex-column w-full transition-linear transition-all transition-duration-200 select-none nc-card-hover"]),style:{padding:"1.25rem",gap:"1.438rem","min-height":"0",border:"1px solid #e5e7eb"}},[u.createElementVNode("div",{class:u.normalizeClass(["w-full flex justify-content-between",f.value?"flex-column align-items-start gap-2":"flex-row align-items-center"])},[u.createElementVNode("div",Ec,[u.createElementVNode("p",{class:u.normalizeClass(["m-0 text-xs font-medium",s.value?"text-white":"text-gray-900"])},u.toDisplayString(i.titulo),3),i.subtitulo?(u.openBlock(),u.createElementBlock("p",Rc,u.toDisplayString(i.subtitulo),1)):u.createCommentVNode("",!0)]),u.renderSlot(k.$slots,"header-right",{},void 0,!0)],2),u.createElementVNode("div",Lc,[u.createElementVNode("div",null,[u.createElementVNode("h2",{class:u.normalizeClass(["m-0 text-3xl font-semibold",s.value?"text-white":"text-gray-900"]),style:{"line-height":"33px","letter-spacing":"-1px"}},u.toDisplayString(i.valor),3),u.createElementVNode("p",Bc,u.toDisplayString(i.descricao),1)]),u.createElementVNode("div",{ref_key:"chartRef",ref:c,class:"chart-container",style:{position:"relative",width:"100%",flex:"1","min-height":"80px"}},[m.value.visible?(u.openBlock(),u.createElementBlock("div",{key:0,style:u.normalizeStyle([{position:"absolute",transform:"translate(-50%, -100%)",background:"rgba(0,0,0,0.75)",color:"#fff","font-size":"0.7rem",padding:"3px 8px","border-radius":"4px","white-space":"nowrap","pointer-events":"none","z-index":"10"},{left:m.value.x+"px",top:m.value.y+"px"}])},u.toDisplayString(m.value.text),5)):u.createCommentVNode("",!0),u.createElementVNode("div",{class:"flex align-items-end gap-1",style:u.normalizeStyle([{width:"100%"},{height:h.value-20+"px"}])},[(u.openBlock(!0),u.createElementBlock(u.Fragment,null,u.renderList(i.dados,(M,C)=>(u.openBlock(),u.createElementBlock("div",{key:C,class:"flex-1",style:{display:"flex","align-items":"flex-end",height:"100%",cursor:"pointer"},onMouseenter:D=>x(C,D),onMousemove:D=>_(C,D),onMouseleave:w},[u.createElementVNode("div",{style:u.normalizeStyle({height:M.quantidade/l.value*100+"%",minHeight:"4px",width:"100%",backgroundColor:b.value===C?a.value[C]:o.value,borderRadius:"4px 4px 4px 4px",transition:"background-color 0.15s ease"})},null,4)],40,zc))),128))],4),u.createElementVNode("div",Ic,[(u.openBlock(!0),u.createElementBlock(u.Fragment,null,u.renderList(i.dados,(M,C)=>(u.openBlock(),u.createElementBlock("div",{key:C,class:"flex-1 text-center",style:u.normalizeStyle([{"font-size":"0.6rem",overflow:"hidden","text-overflow":"ellipsis","white-space":"nowrap"},{color:s.value?"#888":"#aaa"}])},u.toDisplayString(M.rotulo),5))),128))])],512)])],2))}},[["__scopeId","data-v-03cd0de7"]]),Fc={key:0,class:"m-0 text-xs",style:{color:"#7B7B7B"}},Nc={class:"flex flex-column gap-2 flex-1 w-full",style:{"max-width":"26rem"}},Vc={class:"flex align-items-center justify-content-between gap-2 pb-1",style:{"border-bottom":"1px solid #e5e7eb"}},Wc={class:"flex align-items-center gap-2"},Hc={class:"flex align-items-center gap-2"},jc={class:"flex justify-content-center align-items-center mx-auto",style:{position:"relative",width:"200px",height:"200px","flex-shrink":"0"}},$c={key:0,style:{position:"absolute",inset:"0",display:"flex","flex-direction":"column","align-items":"center","justify-content":"center","pointer-events":"none"}},Yc={key:0,style:{"font-size":"0.6rem",color:"#7B7B7B","text-align":"center","max-width":"80px","line-height":"1.3"}},zs=zt({__name:"cardPizza",props:{label_rotulo:{type:String,default:"Rótulo"},label_quantidade:{type:String,default:"Quantidade"},titulo:{type:String,default:"Pizza Chart"},subtitulo:{type:String,default:""},valor:{type:String,default:""},descricao:{type:String,default:""},dados:{type:Array,required:!1,default:()=>[]},cor:{type:String,default:"light",validator:i=>["light","dark","transparent"].includes(i)},corPaleta:{type:String,default:"#1E40AF"},direcao:{type:String,default:null,validator:i=>i===null||["horizontal","vertical"].includes(i)}},setup(i){Bt.register(Jr,is,Mi,ms);const t=i,e={light:"bg-white",dark:"bg-black",transparent:"bg-transparent"},n=u.computed(()=>e[t.cor]??"bg-white"),s=u.computed(()=>t.cor==="dark");function o(m,x=7){const _=m.replace("#","");let w=parseInt(_.slice(0,2),16),v=parseInt(_.slice(2,4),16),y=parseInt(_.slice(4,6),16);w/=255,v/=255,y/=255;const k=Math.max(w,v,y),S=Math.min(w,v,y);let M,C,D=(k+S)/2;if(k===S)M=C=0;else{const A=k-S;switch(C=D>.5?A/(2-k-S):A/(k+S),k){case w:M=((v-y)/A+(v<y?6:0))/6;break;case v:M=((y-w)/A+2)/6;break;case y:M=((w-v)/A+4)/6;break}}const P=Math.max(.2,D-.3),F=(Math.min(.95,D+.35)-P)/(x-1);function H(A,E,L){const K=E*Math.min(L,1-L),V=ot=>{const U=(ot+A*12)%12,et=L-K*Math.max(-1,Math.min(U-3,9-U,1));return Math.round(255*et).toString(16).padStart(2,"0")};return`#${V(0)}${V(8)}${V(4)}`}return Array.from({length:x},(A,E)=>H(M,C,P+F*E))}const r=u.computed(()=>o(t.corPaleta,t.dados.length)),a=u.ref(null),l=u.ref(null),c=u.ref(!0);let h=null,d=null;const f=u.computed(()=>t.direcao==="vertical"?"flex-column-reverse":t.direcao==="horizontal"?"flex-row":c.value?"flex-column-reverse":"flex-row"),g=u.computed(()=>({labels:t.dados.map(m=>m.rotulo),datasets:[{data:t.dados.map(m=>m.quantidade),backgroundColor:r.value,borderWidth:0,borderColor:"transparent"}]})),p=u.computed(()=>({responsive:!0,maintainAspectRatio:!0,cutout:t.valor?"65%":"50%",animation:{duration:800,easing:"easeOutQuart"},plugins:{legend:{display:!1},tooltip:{enabled:!0}}}));function b(){d&&d.destroy(),d=new Bt(a.value,{type:"doughnut",data:g.value,options:p.value})}return u.onMounted(()=>{b(),h=new ResizeObserver(([m])=>{c.value=m.contentRect.width<380}),h.observe(l.value)}),u.onBeforeUnmount(()=>{d&&d.destroy(),h&&h.disconnect()}),u.watch(()=>t.dados,()=>{b()},{deep:!0}),u.watch(()=>t.cor,()=>{b()}),u.watch(()=>t.corPaleta,()=>{b()}),(m,x)=>(u.openBlock(),u.createElementBlock("div",{class:u.normalizeClass([n.value,"border-round-xl flex flex-column w-full transition-linear transition-all transition-duration-200 select-none nc-card-hover"]),style:{padding:"1.25rem",gap:"1.438rem",border:"1px solid #e5e7eb"}},[u.createElementVNode("div",null,[u.createElementVNode("p",{class:u.normalizeClass(["m-0 text-xs font-medium",s.value?"text-white":"text-gray-900"])},u.toDisplayString(i.titulo),3),i.subtitulo?(u.openBlock(),u.createElementBlock("p",Fc,u.toDisplayString(i.subtitulo),1)):u.createCommentVNode("",!0)]),u.createElementVNode("div",{ref_key:"containerRef",ref:l,class:u.normalizeClass(["flex w-full h-full align-items-center justify-content-between",[f.value,c.value||t.direcao==="vertical"?"gap-4":"gap-7"]])},[u.createElementVNode("div",Nc,[u.createElementVNode("div",Vc,[u.createElementVNode("div",Wc,[x[0]||(x[0]=u.createElementVNode("span",{style:{width:"10px",height:"10px",flexShrink:0}},null,-1)),u.createElementVNode("span",{class:"text-xs font-medium",style:u.normalizeStyle({color:s.value?"#fff":"#6b7280"})},u.toDisplayString(t.label_rotulo),5)]),u.createElementVNode("span",{class:"text-xs font-medium",style:u.normalizeStyle({color:s.value?"#fff":"#6b7280"})},u.toDisplayString(t.label_quantidade),5)]),(u.openBlock(!0),u.createElementBlock(u.Fragment,null,u.renderList(i.dados,(_,w)=>(u.openBlock(),u.createElementBlock("div",{key:w,class:"flex align-items-center justify-content-between"},[u.createElementVNode("div",Hc,[u.createElementVNode("span",{style:u.normalizeStyle({backgroundColor:r.value[w],width:"10px",height:"10px",flexShrink:0,borderRadius:"50%"})},null,4),u.createElementVNode("span",{class:"text-xs font-medium",style:u.normalizeStyle({color:s.value?"#fff":"#374151"})},u.toDisplayString(_.rotulo),5)]),u.createElementVNode("span",{class:"text-xs font-semibold",style:u.normalizeStyle({color:s.value?"#fff":"#111"})},u.toDisplayString(_.quantidade),5)]))),128))]),u.createElementVNode("div",jc,[u.createElementVNode("canvas",{ref_key:"canvasRef",ref:a,width:"200",height:"200"},null,512),i.valor?(u.openBlock(),u.createElementBlock("div",$c,[u.createElementVNode("span",{class:"font-semibold",style:u.normalizeStyle([{"font-size":"1.25rem","line-height":"1.2","letter-spacing":"-0.5px"},{color:s.value?"#fff":"#111"}])},u.toDisplayString(i.valor),5),i.descricao?(u.openBlock(),u.createElementBlock("span",Yc,u.toDisplayString(i.descricao),1)):u.createCommentVNode("",!0)])):u.createCommentVNode("",!0)])],2)],2))}},[["__scopeId","data-v-c81361ad"]]),Uc={class:"w-full"},Xc={key:0,class:"m-0 text-xs",style:{color:"#7B7B7B"}},qc={style:{position:"relative","z-index":"1"}},Kc={class:"m-0 text-sm",style:{color:"#7B7B7B","word-break":"break-word"}},Gc={style:{position:"absolute",bottom:"0",left:"0",right:"0",height:"160px","pointer-events":"none"}},Is=zt({__name:"cardLines",props:{titulo:{type:String,default:"CardLines"},subtitulo:{type:String,default:""},valor:{type:String,default:"0"},descricao:{type:String,default:"This is a card component."},dados:{type:Array,required:!1,default:()=>[]},cor:{type:String,default:"light",validator:i=>["light","dark","transparent"].includes(i)},corPaleta:{type:String,default:"#1D4ED8"},moeda:{type:Boolean,default:!1}},setup(i){Bt.register(Qr,Ne,Ml,lc,rc,Mi,$l);const t=i,e={light:"bg-white",dark:"bg-black",transparent:"bg-transparent"},n=u.computed(()=>e[t.cor]??"bg-white"),s=u.computed(()=>t.cor==="dark");function o(p){return t.moeda?Number(p).toLocaleString("pt-BR",{style:"currency",currency:"BRL"}):`${p}`}const r=u.ref(null),a=u.ref(null),l=u.ref(!1);let c=null,h=null;function d(p){const b=p.replace("#",""),m=parseInt(b.slice(0,2),16),x=parseInt(b.slice(2,4),16),_=parseInt(b.slice(4,6),16);return`${m}, ${x}, ${_}`}function f(p,b){const m=p.createLinearGradient(0,b.top,0,b.bottom);if(t.cor==="dark")m.addColorStop(0,"rgba(10, 50, 150, 0.60)"),m.addColorStop(1,"rgba(10, 50, 150, 0)");else{const x=d(t.corPaleta);m.addColorStop(0,`rgba(${x}, 0.12)`),m.addColorStop(1,`rgba(${x}, 0)`)}return m}function g(){c&&c.destroy(),c=new Bt(r.value,{type:"line",data:{labels:t.dados.map(p=>p.rotulo),datasets:[{data:t.dados.map(p=>p.quantidade),borderColor:t.corPaleta,backgroundColor(p){const b=p.chart,{ctx:m,chartArea:x}=b;return x?f(m,x):t.cor==="dark"?"rgba(10, 50, 150, 0.40)":`rgba(${d(t.corPaleta)}, 0.12)`},borderWidth:3,pointRadius:0,pointHitRadius:20,pointHoverRadius:5,pointHoverBackgroundColor:"#fff",pointHoverBorderColor:t.corPaleta,pointHoverBorderWidth:2,tension:.4,fill:!0}]},options:{responsive:!0,maintainAspectRatio:!1,animation:{duration:600,easing:"easeOutQuart"},layout:{padding:0},interaction:{mode:"index",intersect:!1},plugins:{legend:{display:!1},tooltip:{enabled:!0,displayColors:!1,callbacks:{title:p=>p[0].label,label:p=>o(p.parsed.y)}}},scales:{x:{display:!1},y:{display:!1}}}})}return u.onMounted(()=>{g(),h=new ResizeObserver(([p])=>{l.value=p.contentRect.width<340}),h.observe(a.value)}),u.onBeforeUnmount(()=>{c&&c.destroy(),h&&h.disconnect()}),u.watch(()=>t.dados,()=>g(),{deep:!0}),u.watch(()=>t.cor,()=>g()),u.watch(()=>t.corPaleta,()=>g()),(p,b)=>(u.openBlock(),u.createElementBlock("div",{ref_key:"rootRef",ref:a,class:u.normalizeClass([n.value,"border-round-xl flex flex-column w-full transition-linear transition-all transition-duration-200 select-none nc-card-hover"]),style:{padding:"1.25rem",gap:"1.438rem","min-height":"0",position:"relative",overflow:"hidden",border:"1px solid #e5e7eb"}},[u.createElementVNode("div",{class:u.normalizeClass(["w-full flex justify-content-between",l.value?"flex-column align-items-start gap-2":"flex-row align-items-center"]),style:{position:"relative","z-index":"1"}},[u.createElementVNode("div",Uc,[u.createElementVNode("p",{class:u.normalizeClass(["m-0 text-xs font-medium",s.value?"text-white":"text-gray-900"])},u.toDisplayString(t.titulo),3),t.subtitulo?(u.openBlock(),u.createElementBlock("p",Xc,u.toDisplayString(t.subtitulo),1)):u.createCommentVNode("",!0)]),u.renderSlot(p.$slots,"header-right",{},void 0,!0)],2),u.createElementVNode("div",qc,[u.createElementVNode("h2",{class:u.normalizeClass(["m-0 text-3xl font-semibold",s.value?"text-white":"text-gray-900"]),style:{"line-height":"33px","letter-spacing":"-1px"}},u.toDisplayString(t.valor),3),u.createElementVNode("p",Kc,u.toDisplayString(t.descricao),1)]),u.createElementVNode("div",Gc,[u.createElementVNode("canvas",{ref_key:"canvasRef",ref:r,style:{width:"100%",height:"100%","pointer-events":"auto"}},null,512)]),b[0]||(b[0]=u.createElementVNode("div",{style:{height:"130px"}},null,-1))],2))}},[["__scopeId","data-v-bea474a0"]]),Jc={class:"w-full"},Qc={key:0,class:"m-0 text-xs",style:{color:"#7B7B7B"}},Zc={class:"m-0 text-sm",style:{color:"#7B7B7B","word-break":"break-word"}},th={style:{color:"#ccc"}},eh=["onMouseenter","onMousemove"],ih={class:"flex gap-1",style:{width:"100%","margin-top":"4px"}},Fs=zt({__name:"CardColumnDual",props:{titulo:{type:String,default:"CardColumnDual"},subtitulo:{type:String,default:""},valor:{type:String,default:"0"},descricao:{type:String,default:"This is a card component."},dados:{type:Array,required:!1,default:()=>[]},cor:{type:String,default:"light",validator:i=>["light","dark","transparent"].includes(i)},corPaleta:{type:String,default:"#1E40AF"},moeda:{type:Boolean,default:!1},eixo:{type:String,default:"vertical",validator:i=>["horizontal","vertical"].includes(i)},segmentos:{type:Array,default:()=>[{key:"total_previsto",label:"Previsto"},{key:"total_recebido",label:"Recebido"}]},segmentoTooltip:{type:Object,default:()=>({key:"total_em_aberto",label:"Em aberto"})}},setup(i){const t=i,e={light:"bg-white",dark:"bg-black",transparent:"bg-transparent"},n=u.computed(()=>e[t.cor]??"bg-white"),s=u.computed(()=>t.cor==="dark"),o=u.computed(()=>{const y=Array(t.segmentos.length).fill(t.cor==="dark"?"#252525":"#E9E9E9");return y[y.length-1]=t.corPaleta,y}),r=u.computed(()=>Math.max(1,...t.dados.map(y=>Number(y[t.segmentos[0].key])||0)));function a(y){return t.segmentos.map((k,S)=>({key:k.key,label:k.label,valor:Number(y[k.key])||0,cor:o.value[S]}))}function l(y){const k=a(y),S=t.segmentoTooltip?[{label:t.segmentoTooltip.label,valor:Number(y[t.segmentoTooltip.key])||0,cor:s.value?"#666":"#bbb"}]:[];return[...k.map(M=>({label:M.label,valor:M.valor,cor:M.cor})),...S]}const c=u.ref(null),h=u.ref(80),d=u.ref(null),f=u.ref(!1);let g=null,p=null;u.onMounted(()=>{g=new ResizeObserver(([y])=>{h.value=y.contentRect.height||80}),g.observe(c.value),p=new ResizeObserver(([y])=>{f.value=y.contentRect.width<340}),p.observe(d.value)}),u.onBeforeUnmount(()=>{g&&g.disconnect(),p&&p.disconnect()});const b=u.computed(()=>t.eixo==="horizontal"&&!f.value?"flex-row align-items-center":"flex-column"),m=u.ref({visible:!1,x:0,y:0,lines:[]});function x(y){return t.moeda?Number(y).toLocaleString("pt-BR",{style:"currency",currency:"BRL"}):`${y}`}function _(y,k){const S=k.currentTarget.closest(".chart-container").getBoundingClientRect(),M=k.currentTarget.getBoundingClientRect();m.value={visible:!0,x:M.left-S.left+M.width/2,y:M.top-S.top-8,lines:l(y).map(C=>({label:C.label,valor:x(C.valor),cor:C.cor}))}}function w(y,k){_(y,k)}function v(){m.value.visible=!1}return(y,k)=>(u.openBlock(),u.createElementBlock("div",{ref_key:"rootRef",ref:d,class:u.normalizeClass([n.value,"border-round-xl flex flex-column w-full transition-linear transition-all transition-duration-200 select-none nc-card-hover"]),style:{padding:"1.25rem",gap:"1.438rem","min-height":"0",border:"1px solid #e5e7eb"}},[u.createElementVNode("div",{class:u.normalizeClass(["w-full flex justify-content-between",f.value?"flex-column align-items-start gap-2":"flex-row align-items-center"])},[u.createElementVNode("div",Jc,[u.createElementVNode("p",{class:u.normalizeClass(["m-0 text-xs font-medium",s.value?"text-white":"text-gray-900"])},u.toDisplayString(i.titulo),3),i.subtitulo?(u.openBlock(),u.createElementBlock("p",Qc,u.toDisplayString(i.subtitulo),1)):u.createCommentVNode("",!0)]),u.renderSlot(y.$slots,"header-right",{},void 0,!0)],2),u.createElementVNode("div",{class:u.normalizeClass(["flex w-full gap-5 justify-content-between",b.value]),style:{flex:"1","min-height":"0"}},[u.createElementVNode("div",null,[u.createElementVNode("h2",{class:u.normalizeClass(["m-0 text-3xl font-semibold",s.value?"text-white":"text-gray-900"]),style:{"line-height":"33px","letter-spacing":"-1px"}},u.toDisplayString(i.valor),3),u.createElementVNode("p",Zc,u.toDisplayString(i.descricao),1)]),u.createElementVNode("div",{ref_key:"chartRef",ref:c,class:"chart-container",style:{position:"relative",width:"100%",flex:"1","min-height":"80px",height:"100%"}},[m.value.visible?(u.openBlock(),u.createElementBlock("div",{key:0,style:u.normalizeStyle([{position:"absolute",transform:"translate(-50%, -100%)",background:"rgba(0,0,0,0.8)",color:"#fff","font-size":"0.65rem",padding:"5px 8px","border-radius":"4px","white-space":"nowrap","pointer-events":"none","z-index":"10",display:"flex","flex-direction":"column",gap:"2px"},{left:m.value.x+"px",top:m.value.y+"px"}])},[(u.openBlock(!0),u.createElementBlock(u.Fragment,null,u.renderList(m.value.lines,S=>(u.openBlock(),u.createElementBlock("div",{key:S.label,style:{display:"flex","align-items":"center",gap:"4px"}},[u.createElementVNode("span",{style:u.normalizeStyle({width:"6px",height:"6px",borderRadius:"1px",backgroundColor:S.cor,display:"inline-block",flexShrink:0})},null,4),u.createElementVNode("span",th,u.toDisplayString(S.label)+":",1),u.createElementVNode("span",null,u.toDisplayString(S.valor),1)]))),128))],4)):u.createCommentVNode("",!0),u.createElementVNode("div",{class:"flex align-items-end gap-1",style:u.normalizeStyle([{width:"100%"},{height:h.value-20+"px"}])},[(u.openBlock(!0),u.createElementBlock(u.Fragment,null,u.renderList(i.dados,(S,M)=>(u.openBlock(),u.createElementBlock("div",{key:M,class:"flex-1",style:{position:"relative",height:"100%",cursor:"pointer"},onMouseenter:C=>_(S,C),onMousemove:C=>w(S,C),onMouseleave:v},[(u.openBlock(!0),u.createElementBlock(u.Fragment,null,u.renderList(a(S),C=>(u.openBlock(),u.createElementBlock("div",{key:C.key,style:u.normalizeStyle({position:"absolute",bottom:"0",left:"0",right:"0",height:C.valor/r.value*(h.value-20)+"px",minHeight:C.valor>0?"3px":"0",backgroundColor:C.cor,borderRadius:"4px 4px 0 0",transition:"height 0.2s ease"})},null,4))),128))],40,eh))),128))],4),u.createElementVNode("div",ih,[(u.openBlock(!0),u.createElementBlock(u.Fragment,null,u.renderList(i.dados,(S,M)=>(u.openBlock(),u.createElementBlock("div",{key:M,class:"flex-1 text-center",style:u.normalizeStyle([{"font-size":"0.6rem",overflow:"hidden","text-overflow":"ellipsis","white-space":"nowrap"},{color:s.value?"#888":"#aaa"}])},u.toDisplayString(S.rotulo),5))),128))])],512)],2)],2))}},[["__scopeId","data-v-124dc0bb"]]),nh={install(i){i.component("NemesisCards",Di),i.component("NemesisPolar",Ls),i.component("NemesisCardColumn",Bs),i.component("NemesisCardPizza",zs),i.component("NemesisCardLines",Is),i.component("NemesisCardColumnDual",Fs)}};it.CardColumn=Bs,it.CardColumnDual=Fs,it.CardLines=Is,it.CardPizza=zs,it.Cards=Di,it.Polar=Ls,it.default=nh,Object.defineProperties(it,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nemesischart",
3
- "version": "0.1.20",
3
+ "version": "0.1.21",
4
4
  "type": "module",
5
5
  "description": "A Vue 3 component library for dashboard cards and charts.",
6
6
  "keywords": [