@kong-ui-public/analytics-chart 0.24.2 → 0.24.4
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.
package/dist/vitals-chart.umd.js
CHANGED
|
@@ -3,42 +3,42 @@
|
|
|
3
3
|
* https://github.com/kurkle/color#readme
|
|
4
4
|
* (c) 2023 Jukka Kurkela
|
|
5
5
|
* Released under the MIT License
|
|
6
|
-
*/function mi(n){return n+.5|0}const an=(n,t,e)=>Math.max(Math.min(n,e),t);function yi(n){return an(mi(n*2.55),0,255)}function sn(n){return an(mi(n*255),0,255)}function ze(n){return an(mi(n/2.55)/100,0,1)}function
|
|
6
|
+
*/function mi(n){return n+.5|0}const an=(n,t,e)=>Math.max(Math.min(n,e),t);function yi(n){return an(mi(n*2.55),0,255)}function sn(n){return an(mi(n*255),0,255)}function ze(n){return an(mi(n/2.55)/100,0,1)}function _l(n){return an(mi(n*100),0,100)}const _e={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},Oa=[..."0123456789ABCDEF"],Mh=n=>Oa[n&15],Ch=n=>Oa[(n&240)>>4]+Oa[n&15],ur=n=>(n&240)>>4===(n&15),kh=n=>ur(n.r)&&ur(n.g)&&ur(n.b)&&ur(n.a);function Oh(n){var t=n.length,e;return n[0]==="#"&&(t===4||t===5?e={r:255&_e[n[1]]*17,g:255&_e[n[2]]*17,b:255&_e[n[3]]*17,a:t===5?_e[n[4]]*17:255}:(t===7||t===9)&&(e={r:_e[n[1]]<<4|_e[n[2]],g:_e[n[3]]<<4|_e[n[4]],b:_e[n[5]]<<4|_e[n[6]],a:t===9?_e[n[7]]<<4|_e[n[8]]:255})),e}const Ph=(n,t)=>n<255?t(n):"";function Eh(n){var t=kh(n)?Mh:Ch;return n?"#"+t(n.r)+t(n.g)+t(n.b)+Ph(n.a,t):void 0}const Ah=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function wl(n,t,e){const i=t*Math.min(e,1-e),r=(a,s=(a+n/30)%12)=>e-i*Math.max(Math.min(s-3,9-s,1),-1);return[r(0),r(8),r(4)]}function Rh(n,t,e){const i=(r,a=(r+n/60)%6)=>e-e*t*Math.max(Math.min(a,4-a,1),0);return[i(5),i(3),i(1)]}function Lh(n,t,e){const i=wl(n,1,.5);let r;for(t+e>1&&(r=1/(t+e),t*=r,e*=r),r=0;r<3;r++)i[r]*=1-t-e,i[r]+=t;return i}function Ih(n,t,e,i,r){return n===r?(t-e)/i+(t<e?6:0):t===r?(e-n)/i+2:(n-t)/i+4}function Pa(n){const e=n.r/255,i=n.g/255,r=n.b/255,a=Math.max(e,i,r),s=Math.min(e,i,r),o=(a+s)/2;let l,c,u;return a!==s&&(u=a-s,c=o>.5?u/(2-a-s):u/(a+s),l=Ih(e,i,r,u,a),l=l*60+.5),[l|0,c||0,o]}function Ea(n,t,e,i){return(Array.isArray(t)?n(t[0],t[1],t[2]):n(t,e,i)).map(sn)}function Aa(n,t,e){return Ea(wl,n,t,e)}function Nh(n,t,e){return Ea(Lh,n,t,e)}function Fh(n,t,e){return Ea(Rh,n,t,e)}function Tl(n){return(n%360+360)%360}function Uh(n){const t=Ah.exec(n);let e=255,i;if(!t)return;t[5]!==i&&(e=t[6]?yi(+t[5]):sn(+t[5]));const r=Tl(+t[2]),a=+t[3]/100,s=+t[4]/100;return t[1]==="hwb"?i=Nh(r,a,s):t[1]==="hsv"?i=Fh(r,a,s):i=Aa(r,a,s),{r:i[0],g:i[1],b:i[2],a:e}}function Bh(n,t){var e=Pa(n);e[0]=Tl(e[0]+t),e=Aa(e),n.r=e[0],n.g=e[1],n.b=e[2]}function Wh(n){if(!n)return;const t=Pa(n),e=t[0],i=_l(t[1]),r=_l(t[2]);return n.a<255?`hsla(${e}, ${i}%, ${r}%, ${ze(n.a)})`:`hsl(${e}, ${i}%, ${r}%)`}const Dl={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"},Sl={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 Yh(){const n={},t=Object.keys(Sl),e=Object.keys(Dl);let i,r,a,s,o;for(i=0;i<t.length;i++){for(s=o=t[i],r=0;r<e.length;r++)a=e[r],o=o.replace(a,Dl[a]);a=parseInt(Sl[s],16),n[o]=[a>>16&255,a>>8&255,a&255]}return n}let dr;function zh(n){dr||(dr=Yh(),dr.transparent=[0,0,0,0]);const t=dr[n.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const Hh=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function $h(n){const t=Hh.exec(n);let e=255,i,r,a;if(t){if(t[7]!==i){const s=+t[7];e=t[8]?yi(s):an(s*255,0,255)}return i=+t[1],r=+t[3],a=+t[5],i=255&(t[2]?yi(i):an(i,0,255)),r=255&(t[4]?yi(r):an(r,0,255)),a=255&(t[6]?yi(a):an(a,0,255)),{r:i,g:r,b:a,a:e}}}function jh(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${ze(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const Ra=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,Xn=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function Vh(n,t,e){const i=Xn(ze(n.r)),r=Xn(ze(n.g)),a=Xn(ze(n.b));return{r:sn(Ra(i+e*(Xn(ze(t.r))-i))),g:sn(Ra(r+e*(Xn(ze(t.g))-r))),b:sn(Ra(a+e*(Xn(ze(t.b))-a))),a:n.a+e*(t.a-n.a)}}function fr(n,t,e){if(n){let i=Pa(n);i[t]=Math.max(0,Math.min(i[t]+i[t]*e,t===0?360:1)),i=Aa(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function Ml(n,t){return n&&Object.assign(t||{},n)}function Cl(n){var t={r:0,g:0,b:0,a:255};return Array.isArray(n)?n.length>=3&&(t={r:n[0],g:n[1],b:n[2],a:255},n.length>3&&(t.a=sn(n[3]))):(t=Ml(n,{r:0,g:0,b:0,a:1}),t.a=sn(t.a)),t}function qh(n){return n.charAt(0)==="r"?$h(n):Uh(n)}class bi{constructor(t){if(t instanceof bi)return t;const e=typeof t;let i;e==="object"?i=Cl(t):e==="string"&&(i=Oh(t)||zh(t)||qh(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=Ml(this._rgb);return t&&(t.a=ze(t.a)),t}set rgb(t){this._rgb=Cl(t)}rgbString(){return this._valid?jh(this._rgb):void 0}hexString(){return this._valid?Eh(this._rgb):void 0}hslString(){return this._valid?Wh(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,r=t.rgb;let a;const s=e===a?.5:e,o=2*s-1,l=i.a-r.a,c=((o*l===-1?o:(o+l)/(1+o*l))+1)/2;a=1-c,i.r=255&c*i.r+a*r.r+.5,i.g=255&c*i.g+a*r.g+.5,i.b=255&c*i.b+a*r.b+.5,i.a=s*i.a+(1-s)*r.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=Vh(this._rgb,t._rgb,e)),this}clone(){return new bi(this.rgb)}alpha(t){return this._rgb.a=sn(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=mi(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 fr(this._rgb,2,t),this}darken(t){return fr(this._rgb,2,-t),this}saturate(t){return fr(this._rgb,1,t),this}desaturate(t){return fr(this._rgb,1,-t),this}rotate(t){return Bh(this._rgb,t),this}}/*!
|
|
7
7
|
* Chart.js v4.4.1
|
|
8
8
|
* https://www.chartjs.org
|
|
9
9
|
* (c) 2023 Chart.js Contributors
|
|
10
10
|
* Released under the MIT License
|
|
11
|
-
*/function He(){}const Xh=(()=>{let n=0;return()=>n++})();function it(n){return n===null||typeof n>"u"}function yt(n){if(Array.isArray&&Array.isArray(n))return!0;const t=Object.prototype.toString.call(n);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function ct(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function Lt(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function be(n,t){return Lt(n)?n:t}function nt(n,t){return typeof n>"u"?t:n}const Gh=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:+n/t,kl=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*t:+n;function xt(n,t,e){if(n&&typeof n.call=="function")return n.apply(e,t)}function wt(n,t,e,i){let r,a,s;if(yt(n))if(a=n.length,i)for(r=a-1;r>=0;r--)t.call(e,n[r],r);else for(r=0;r<a;r++)t.call(e,n[r],r);else if(ct(n))for(s=Object.keys(n),a=s.length,r=0;r<a;r++)t.call(e,n[s[r]],s[r])}function hr(n,t){let e,i,r,a;if(!n||!t||n.length!==t.length)return!1;for(e=0,i=n.length;e<i;++e)if(r=n[e],a=t[e],r.datasetIndex!==a.datasetIndex||r.index!==a.index)return!1;return!0}function gr(n){if(yt(n))return n.map(gr);if(ct(n)){const t=Object.create(null),e=Object.keys(n),i=e.length;let r=0;for(;r<i;++r)t[e[r]]=gr(n[e[r]]);return t}return n}function Ol(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function Kh(n,t,e,i){if(!Ol(n))return;const r=t[n],a=e[n];ct(r)&&ct(a)?vi(r,a,i):t[n]=gr(a)}function vi(n,t,e){const i=yt(t)?t:[t],r=i.length;if(!ct(n))return n;e=e||{};const a=e.merger||Kh;let s;for(let o=0;o<r;++o){if(s=i[o],!ct(s))continue;const l=Object.keys(s);for(let c=0,u=l.length;c<u;++c)a(l[c],n,s,e)}return n}function xi(n,t){return vi(n,t,{merger:Zh})}function Zh(n,t,e){if(!Ol(n))return;const i=t[n],r=e[n];ct(i)&&ct(r)?xi(i,r):Object.prototype.hasOwnProperty.call(t,n)||(t[n]=gr(r))}const Pl={"":n=>n,x:n=>n.x,y:n=>n.y};function Qh(n){const t=n.split("."),e=[];let i="";for(const r of t)i+=r,i.endsWith("\\")?i=i.slice(0,-1)+".":(e.push(i),i="");return e}function Jh(n){const t=Qh(n);return e=>{for(const i of t){if(i==="")break;e=e&&e[i]}return e}}function on(n,t){return(Pl[t]||(Pl[t]=Jh(t)))(n)}function La(n){return n.charAt(0).toUpperCase()+n.slice(1)}const ue=n=>typeof n<"u",de=n=>typeof n=="function",El=(n,t)=>{if(n.size!==t.size)return!1;for(const e of n)if(!t.has(e))return!1;return!0};function tg(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const dt=Math.PI,kt=2*dt,eg=kt+dt,pr=Number.POSITIVE_INFINITY,Ia=dt/180,Pt=dt/2,_e=dt/4,mr=dt*2/3,ln=Math.log10,Le=Math.sign;function wi(n,t,e){return Math.abs(n-t)<e}function Al(n){const t=Math.round(n);n=wi(n,t,n/1e3)?t:n;const e=Math.pow(10,Math.floor(ln(n))),i=n/e;return(i<=1?1:i<=2?2:i<=5?5:10)*e}function ng(n){const t=[],e=Math.sqrt(n);let i;for(i=1;i<e;i++)n%i===0&&(t.push(i),t.push(n/i));return e===(e|0)&&t.push(e),t.sort((r,a)=>r-a).pop(),t}function cn(n){return!isNaN(parseFloat(n))&&isFinite(n)}function ig(n,t){const e=Math.round(n);return e-t<=n&&e+t>=n}function Rl(n,t,e){let i,r,a;for(i=0,r=n.length;i<r;i++)a=n[i][e],isNaN(a)||(t.min=Math.min(t.min,a),t.max=Math.max(t.max,a))}function qt(n){return n*(dt/180)}function yr(n){return n*(180/dt)}function Ll(n){if(!Lt(n))return;let t=1,e=0;for(;Math.round(n*t)/t!==n;)t*=10,e++;return e}function Il(n,t){const e=t.x-n.x,i=t.y-n.y,r=Math.sqrt(e*e+i*i);let a=Math.atan2(i,e);return a<-.5*dt&&(a+=kt),{angle:a,distance:r}}function Gn(n,t){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))}function rg(n,t){return(n-t+eg)%kt-dt}function ve(n){return(n%kt+kt)%kt}function _i(n,t,e,i){const r=ve(n),a=ve(t),s=ve(e),o=ve(a-r),l=ve(s-r),c=ve(r-a),u=ve(r-s);return r===a||r===s||i&&a===s||o>l&&c<u}function Zt(n,t,e){return Math.max(t,Math.min(e,n))}function ag(n){return Zt(n,-32768,32767)}function $e(n,t,e,i=1e-6){return n>=Math.min(t,e)-i&&n<=Math.max(t,e)+i}function Na(n,t,e){e=e||(s=>n[s]<t);let i=n.length-1,r=0,a;for(;i-r>1;)a=r+i>>1,e(a)?r=a:i=a;return{lo:r,hi:i}}const je=(n,t,e,i)=>Na(n,e,i?r=>{const a=n[r][t];return a<e||a===e&&n[r+1][t]===e}:r=>n[r][t]<e),sg=(n,t,e)=>Na(n,e,i=>n[i][t]>=e);function og(n,t,e){let i=0,r=n.length;for(;i<r&&n[i]<t;)i++;for(;r>i&&n[r-1]>e;)r--;return i>0||r<n.length?n.slice(i,r):n}const Nl=["push","pop","shift","splice","unshift"];function lg(n,t){if(n._chartjs){n._chartjs.listeners.push(t);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),Nl.forEach(e=>{const i="_onData"+La(e),r=n[e];Object.defineProperty(n,e,{configurable:!0,enumerable:!1,value(...a){const s=r.apply(this,a);return n._chartjs.listeners.forEach(o=>{typeof o[i]=="function"&&o[i](...a)}),s}})})}function Fl(n,t){const e=n._chartjs;if(!e)return;const i=e.listeners,r=i.indexOf(t);r!==-1&&i.splice(r,1),!(i.length>0)&&(Nl.forEach(a=>{delete n[a]}),delete n._chartjs)}function Ul(n){const t=new Set(n);return t.size===n.length?n:Array.from(t)}const Bl=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function Wl(n,t){let e=[],i=!1;return function(...r){e=r,i||(i=!0,Bl.call(window,()=>{i=!1,n.apply(t,e)}))}}function cg(n,t){let e;return function(...i){return t?(clearTimeout(e),e=setTimeout(n,t,i)):n.apply(this,i),t}}const Fa=n=>n==="start"?"left":n==="end"?"right":"center",ie=(n,t,e)=>n==="start"?t:n==="end"?e:(t+e)/2,ug=(n,t,e,i)=>n===(i?"left":"right")?e:n==="center"?(t+e)/2:t;function Yl(n,t,e){const i=t.length;let r=0,a=i;if(n._sorted){const{iScale:s,_parsed:o}=n,l=s.axis,{min:c,max:u,minDefined:d,maxDefined:f}=s.getUserBounds();d&&(r=Zt(Math.min(je(o,l,c).lo,e?i:je(t,l,s.getPixelForValue(c)).lo),0,i-1)),f?a=Zt(Math.max(je(o,s.axis,u,!0).hi+1,e?0:je(t,l,s.getPixelForValue(u),!0).hi+1),r,i)-r:a=i-r}return{start:r,count:a}}function zl(n){const{xScale:t,yScale:e,_scaleRanges:i}=n,r={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!i)return n._scaleRanges=r,!0;const a=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==e.min||i.ymax!==e.max;return Object.assign(i,r),a}const br=n=>n===0||n===1,Hl=(n,t,e)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-t)*kt/e)),$l=(n,t,e)=>Math.pow(2,-10*n)*Math.sin((n-t)*kt/e)+1,Ti={linear:n=>n,easeInQuad:n=>n*n,easeOutQuad:n=>-n*(n-2),easeInOutQuad:n=>(n/=.5)<1?.5*n*n:-.5*(--n*(n-2)-1),easeInCubic:n=>n*n*n,easeOutCubic:n=>(n-=1)*n*n+1,easeInOutCubic:n=>(n/=.5)<1?.5*n*n*n:.5*((n-=2)*n*n+2),easeInQuart:n=>n*n*n*n,easeOutQuart:n=>-((n-=1)*n*n*n-1),easeInOutQuart:n=>(n/=.5)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2),easeInQuint:n=>n*n*n*n*n,easeOutQuint:n=>(n-=1)*n*n*n*n+1,easeInOutQuint:n=>(n/=.5)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2),easeInSine:n=>-Math.cos(n*Pt)+1,easeOutSine:n=>Math.sin(n*Pt),easeInOutSine:n=>-.5*(Math.cos(dt*n)-1),easeInExpo:n=>n===0?0:Math.pow(2,10*(n-1)),easeOutExpo:n=>n===1?1:-Math.pow(2,-10*n)+1,easeInOutExpo:n=>br(n)?n:n<.5?.5*Math.pow(2,10*(n*2-1)):.5*(-Math.pow(2,-10*(n*2-1))+2),easeInCirc:n=>n>=1?n:-(Math.sqrt(1-n*n)-1),easeOutCirc:n=>Math.sqrt(1-(n-=1)*n),easeInOutCirc:n=>(n/=.5)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1),easeInElastic:n=>br(n)?n:Hl(n,.075,.3),easeOutElastic:n=>br(n)?n:$l(n,.075,.3),easeInOutElastic(n){return br(n)?n:n<.5?.5*Hl(n*2,.1125,.45):.5+.5*$l(n*2-1,.1125,.45)},easeInBack(n){return n*n*((1.70158+1)*n-1.70158)},easeOutBack(n){return(n-=1)*n*((1.70158+1)*n+1.70158)+1},easeInOutBack(n){let t=1.70158;return(n/=.5)<1?.5*(n*n*(((t*=1.525)+1)*n-t)):.5*((n-=2)*n*(((t*=1.525)+1)*n+t)+2)},easeInBounce:n=>1-Ti.easeOutBounce(1-n),easeOutBounce(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},easeInOutBounce:n=>n<.5?Ti.easeInBounce(n*2)*.5:Ti.easeOutBounce(n*2-1)*.5+.5};function Ua(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function jl(n){return Ua(n)?n:new bi(n)}function Ba(n){return Ua(n)?n:new bi(n).saturate(.5).darken(.1).hexString()}const dg=["x","y","borderWidth","radius","tension"],fg=["color","borderColor","backgroundColor"];function hg(n){n.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),n.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),n.set("animations",{colors:{type:"color",properties:fg},numbers:{type:"number",properties:dg}}),n.describe("animations",{_fallback:"animation"}),n.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 gg(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Vl=new Map;function pg(n,t){t=t||{};const e=n+JSON.stringify(t);let i=Vl.get(e);return i||(i=new Intl.NumberFormat(n,t),Vl.set(e,i)),i}function Di(n,t,e){return pg(t,e).format(n)}const ql={values(n){return yt(n)?n:""+n},numeric(n,t,e){if(n===0)return"0";const i=this.chart.options.locale;let r,a=n;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)&&(r="scientific"),a=mg(n,e)}const s=ln(Math.abs(a)),o=isNaN(s)?1:Math.max(Math.min(-1*Math.floor(s),20),0),l={notation:r,minimumFractionDigits:o,maximumFractionDigits:o};return Object.assign(l,this.options.ticks.format),Di(n,i,l)},logarithmic(n,t,e){if(n===0)return"0";const i=e[t].significand||n/Math.pow(10,Math.floor(ln(n)));return[1,2,3,5,10,15].includes(i)||t>.8*e.length?ql.numeric.call(this,n,t,e):""}};function mg(n,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&n!==Math.floor(n)&&(e=n-Math.floor(n)),e}var vr={formatters:ql};function yg(n){n.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:vr.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),n.route("scale.ticks","color","","color"),n.route("scale.grid","color","","borderColor"),n.route("scale.border","color","","borderColor"),n.route("scale.title","color","","color"),n.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),n.describe("scales",{_fallback:"scale"}),n.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const Cn=Object.create(null),Wa=Object.create(null);function Si(n,t){if(!t)return n;const e=t.split(".");for(let i=0,r=e.length;i<r;++i){const a=e[i];n=n[a]||(n[a]=Object.create(null))}return n}function Ya(n,t,e){return typeof t=="string"?vi(Si(n,t),e):vi(Si(n,""),t)}class bg{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=i=>i.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(i,r)=>Ba(r.backgroundColor),this.hoverBorderColor=(i,r)=>Ba(r.borderColor),this.hoverColor=(i,r)=>Ba(r.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 Ya(this,t,e)}get(t){return Si(this,t)}describe(t,e){return Ya(Wa,t,e)}override(t,e){return Ya(Cn,t,e)}route(t,e,i,r){const a=Si(this,t),s=Si(this,i),o="_"+e;Object.defineProperties(a,{[o]:{value:a[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[o],c=s[r];return ct(l)?Object.assign({},c,l):nt(l,c)},set(l){this[o]=l}}})}apply(t){t.forEach(e=>e(this))}}var Ft=new bg({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[hg,gg,yg]);function vg(n){return!n||it(n.size)||it(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function xr(n,t,e,i,r){let a=t[r];return a||(a=t[r]=n.measureText(r).width,e.push(r)),a>i&&(i=a),i}function xg(n,t,e,i){i=i||{};let r=i.data=i.data||{},a=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(r=i.data={},a=i.garbageCollect=[],i.font=t),n.save(),n.font=t;let s=0;const o=e.length;let l,c,u,d,f;for(l=0;l<o;l++)if(d=e[l],d!=null&&!yt(d))s=xr(n,r,a,s,d);else if(yt(d))for(c=0,u=d.length;c<u;c++)f=d[c],f!=null&&!yt(f)&&(s=xr(n,r,a,s,f));n.restore();const g=a.length/2;if(g>e.length){for(l=0;l<g;l++)delete r[a[l]];a.splice(0,g)}return s}function kn(n,t,e){const i=n.currentDevicePixelRatio,r=e!==0?Math.max(e/2,.5):0;return Math.round((t-r)*i)/i+r}function Xl(n,t){t=t||n.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,n.width,n.height),t.restore()}function za(n,t,e,i){Gl(n,t,e,i,null)}function Gl(n,t,e,i,r){let a,s,o,l,c,u,d,f;const g=t.pointStyle,p=t.rotation,m=t.radius;let y=(p||0)*Ia;if(g&&typeof g=="object"&&(a=g.toString(),a==="[object HTMLImageElement]"||a==="[object HTMLCanvasElement]")){n.save(),n.translate(e,i),n.rotate(y),n.drawImage(g,-g.width/2,-g.height/2,g.width,g.height),n.restore();return}if(!(isNaN(m)||m<=0)){switch(n.beginPath(),g){default:r?n.ellipse(e,i,r/2,m,0,0,kt):n.arc(e,i,m,0,kt),n.closePath();break;case"triangle":u=r?r/2:m,n.moveTo(e+Math.sin(y)*u,i-Math.cos(y)*m),y+=mr,n.lineTo(e+Math.sin(y)*u,i-Math.cos(y)*m),y+=mr,n.lineTo(e+Math.sin(y)*u,i-Math.cos(y)*m),n.closePath();break;case"rectRounded":c=m*.516,l=m-c,s=Math.cos(y+_e)*l,d=Math.cos(y+_e)*(r?r/2-c:l),o=Math.sin(y+_e)*l,f=Math.sin(y+_e)*(r?r/2-c:l),n.arc(e-d,i-o,c,y-dt,y-Pt),n.arc(e+f,i-s,c,y-Pt,y),n.arc(e+d,i+o,c,y,y+Pt),n.arc(e-f,i+s,c,y+Pt,y+dt),n.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*m,u=r?r/2:l,n.rect(e-u,i-l,2*u,2*l);break}y+=_e;case"rectRot":d=Math.cos(y)*(r?r/2:m),s=Math.cos(y)*m,o=Math.sin(y)*m,f=Math.sin(y)*(r?r/2:m),n.moveTo(e-d,i-o),n.lineTo(e+f,i-s),n.lineTo(e+d,i+o),n.lineTo(e-f,i+s),n.closePath();break;case"crossRot":y+=_e;case"cross":d=Math.cos(y)*(r?r/2:m),s=Math.cos(y)*m,o=Math.sin(y)*m,f=Math.sin(y)*(r?r/2:m),n.moveTo(e-d,i-o),n.lineTo(e+d,i+o),n.moveTo(e+f,i-s),n.lineTo(e-f,i+s);break;case"star":d=Math.cos(y)*(r?r/2:m),s=Math.cos(y)*m,o=Math.sin(y)*m,f=Math.sin(y)*(r?r/2:m),n.moveTo(e-d,i-o),n.lineTo(e+d,i+o),n.moveTo(e+f,i-s),n.lineTo(e-f,i+s),y+=_e,d=Math.cos(y)*(r?r/2:m),s=Math.cos(y)*m,o=Math.sin(y)*m,f=Math.sin(y)*(r?r/2:m),n.moveTo(e-d,i-o),n.lineTo(e+d,i+o),n.moveTo(e+f,i-s),n.lineTo(e-f,i+s);break;case"line":s=r?r/2:Math.cos(y)*m,o=Math.sin(y)*m,n.moveTo(e-s,i-o),n.lineTo(e+s,i+o);break;case"dash":n.moveTo(e,i),n.lineTo(e+Math.cos(y)*(r?r/2:m),i+Math.sin(y)*m);break;case!1:n.closePath();break}n.fill(),t.borderWidth>0&&n.stroke()}}function Ve(n,t,e){return e=e||.5,!t||n&&n.x>t.left-e&&n.x<t.right+e&&n.y>t.top-e&&n.y<t.bottom+e}function Mi(n,t){n.save(),n.beginPath(),n.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),n.clip()}function Ci(n){n.restore()}function wg(n,t,e,i,r){if(!t)return n.lineTo(e.x,e.y);if(r==="middle"){const a=(t.x+e.x)/2;n.lineTo(a,t.y),n.lineTo(a,e.y)}else r==="after"!=!!i?n.lineTo(t.x,e.y):n.lineTo(e.x,t.y);n.lineTo(e.x,e.y)}function _g(n,t,e,i){if(!t)return n.lineTo(e.x,e.y);n.bezierCurveTo(i?t.cp1x:t.cp2x,i?t.cp1y:t.cp2y,i?e.cp2x:e.cp1x,i?e.cp2y:e.cp1y,e.x,e.y)}function Tg(n,t){t.translation&&n.translate(t.translation[0],t.translation[1]),it(t.rotation)||n.rotate(t.rotation),t.color&&(n.fillStyle=t.color),t.textAlign&&(n.textAlign=t.textAlign),t.textBaseline&&(n.textBaseline=t.textBaseline)}function Dg(n,t,e,i,r){if(r.strikethrough||r.underline){const a=n.measureText(i),s=t-a.actualBoundingBoxLeft,o=t+a.actualBoundingBoxRight,l=e-a.actualBoundingBoxAscent,c=e+a.actualBoundingBoxDescent,u=r.strikethrough?(l+c)/2:c;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=r.decorationWidth||2,n.moveTo(s,u),n.lineTo(o,u),n.stroke()}}function Sg(n,t){const e=n.fillStyle;n.fillStyle=t.color,n.fillRect(t.left,t.top,t.width,t.height),n.fillStyle=e}function On(n,t,e,i,r,a={}){const s=yt(t)?t:[t],o=a.strokeWidth>0&&a.strokeColor!=="";let l,c;for(n.save(),n.font=r.string,Tg(n,a),l=0;l<s.length;++l)c=s[l],a.backdrop&&Sg(n,a.backdrop),o&&(a.strokeColor&&(n.strokeStyle=a.strokeColor),it(a.strokeWidth)||(n.lineWidth=a.strokeWidth),n.strokeText(c,e,i,a.maxWidth)),n.fillText(c,e,i,a.maxWidth),Dg(n,e,i,c,a),i+=Number(r.lineHeight);n.restore()}function Kn(n,t){const{x:e,y:i,w:r,h:a,radius:s}=t;n.arc(e+s.topLeft,i+s.topLeft,s.topLeft,1.5*dt,dt,!0),n.lineTo(e,i+a-s.bottomLeft),n.arc(e+s.bottomLeft,i+a-s.bottomLeft,s.bottomLeft,dt,Pt,!0),n.lineTo(e+r-s.bottomRight,i+a),n.arc(e+r-s.bottomRight,i+a-s.bottomRight,s.bottomRight,Pt,0,!0),n.lineTo(e+r,i+s.topRight),n.arc(e+r-s.topRight,i+s.topRight,s.topRight,0,-Pt,!0),n.lineTo(e+s.topLeft,i)}const Mg=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Cg=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function kg(n,t){const e=(""+n).match(Mg);if(!e||e[1]==="normal")return t*1.2;switch(n=+e[2],e[3]){case"px":return n;case"%":n/=100;break}return t*n}const Og=n=>+n||0;function Ha(n,t){const e={},i=ct(t),r=i?Object.keys(t):t,a=ct(n)?i?s=>nt(n[s],n[t[s]]):s=>n[s]:()=>n;for(const s of r)e[s]=Og(a(s));return e}function Kl(n){return Ha(n,{top:"y",right:"x",bottom:"y",left:"x"})}function un(n){return Ha(n,["topLeft","topRight","bottomLeft","bottomRight"])}function Xt(n){const t=Kl(n);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Et(n,t){n=n||{},t=t||Ft.font;let e=nt(n.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let i=nt(n.style,t.style);i&&!(""+i).match(Cg)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const r={family:nt(n.family,t.family),lineHeight:kg(nt(n.lineHeight,t.lineHeight),e),size:e,style:i,weight:nt(n.weight,t.weight),string:""};return r.string=vg(r),r}function ki(n,t,e,i){let r=!0,a,s,o;for(a=0,s=n.length;a<s;++a)if(o=n[a],o!==void 0&&(t!==void 0&&typeof o=="function"&&(o=o(t),r=!1),e!==void 0&&yt(o)&&(o=o[e%o.length],r=!1),o!==void 0))return i&&!r&&(i.cacheable=!1),o}function Pg(n,t,e){const{min:i,max:r}=n,a=kl(t,(r-i)/2),s=(o,l)=>e&&o===0?0:o+l;return{min:s(i,-Math.abs(a)),max:s(r,a)}}function dn(n,t){return Object.assign(Object.create(n),t)}function $a(n,t=[""],e,i,r=()=>n[0]){const a=e||n;typeof i>"u"&&(i=ec("_fallback",n));const s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:a,_fallback:i,_getTarget:r,override:o=>$a([o,...n],t,a,i)};return new Proxy(s,{deleteProperty(o,l){return delete o[l],delete o._keys,delete n[0][l],!0},get(o,l){return Ql(o,l,()=>Ug(l,t,n,o))},getOwnPropertyDescriptor(o,l){return Reflect.getOwnPropertyDescriptor(o._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(o,l){return nc(o).includes(l)},ownKeys(o){return nc(o)},set(o,l,c){const u=o._storage||(o._storage=r());return o[l]=u[l]=c,delete o._keys,!0}})}function Zn(n,t,e,i){const r={_cacheable:!1,_proxy:n,_context:t,_subProxy:e,_stack:new Set,_descriptors:Zl(n,i),setContext:a=>Zn(n,a,e,i),override:a=>Zn(n.override(a),t,e,i)};return new Proxy(r,{deleteProperty(a,s){return delete a[s],delete n[s],!0},get(a,s,o){return Ql(a,s,()=>Ag(a,s,o))},getOwnPropertyDescriptor(a,s){return a._descriptors.allKeys?Reflect.has(n,s)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,s)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(a,s){return Reflect.has(n,s)},ownKeys(){return Reflect.ownKeys(n)},set(a,s,o){return n[s]=o,delete a[s],!0}})}function Zl(n,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:i=t.indexable,_allKeys:r=t.allKeys}=n;return{allKeys:r,scriptable:e,indexable:i,isScriptable:de(e)?e:()=>e,isIndexable:de(i)?i:()=>i}}const Eg=(n,t)=>n?n+La(t):t,ja=(n,t)=>ct(t)&&n!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Ql(n,t,e){if(Object.prototype.hasOwnProperty.call(n,t))return n[t];const i=e();return n[t]=i,i}function Ag(n,t,e){const{_proxy:i,_context:r,_subProxy:a,_descriptors:s}=n;let o=i[t];return de(o)&&s.isScriptable(t)&&(o=Rg(t,o,n,e)),yt(o)&&o.length&&(o=Lg(t,o,n,s.isIndexable)),ja(t,o)&&(o=Zn(o,r,a&&a[t],s)),o}function Rg(n,t,e,i){const{_proxy:r,_context:a,_subProxy:s,_stack:o}=e;if(o.has(n))throw new Error("Recursion detected: "+Array.from(o).join("->")+"->"+n);o.add(n);let l=t(a,s||i);return o.delete(n),ja(n,l)&&(l=Va(r._scopes,r,n,l)),l}function Lg(n,t,e,i){const{_proxy:r,_context:a,_subProxy:s,_descriptors:o}=e;if(typeof a.index<"u"&&i(n))return t[a.index%t.length];if(ct(t[0])){const l=t,c=r._scopes.filter(u=>u!==l);t=[];for(const u of l){const d=Va(c,r,n,u);t.push(Zn(d,a,s&&s[n],o))}}return t}function Jl(n,t,e){return de(n)?n(t,e):n}const Ig=(n,t)=>n===!0?t:typeof n=="string"?on(t,n):void 0;function Ng(n,t,e,i,r){for(const a of t){const s=Ig(e,a);if(s){n.add(s);const o=Jl(s._fallback,e,r);if(typeof o<"u"&&o!==e&&o!==i)return o}else if(s===!1&&typeof i<"u"&&e!==i)return null}return!1}function Va(n,t,e,i){const r=t._rootScopes,a=Jl(t._fallback,e,i),s=[...n,...r],o=new Set;o.add(i);let l=tc(o,s,e,a||e,i);return l===null||typeof a<"u"&&a!==e&&(l=tc(o,s,a,l,i),l===null)?!1:$a(Array.from(o),[""],r,a,()=>Fg(t,e,i))}function tc(n,t,e,i,r){for(;e;)e=Ng(n,t,e,i,r);return e}function Fg(n,t,e){const i=n._getTarget();t in i||(i[t]={});const r=i[t];return yt(r)&&ct(e)?e:r||{}}function Ug(n,t,e,i){let r;for(const a of t)if(r=ec(Eg(a,n),e),typeof r<"u")return ja(n,r)?Va(e,i,n,r):r}function ec(n,t){for(const e of t){if(!e)continue;const i=e[n];if(typeof i<"u")return i}}function nc(n){let t=n._keys;return t||(t=n._keys=Bg(n._scopes)),t}function Bg(n){const t=new Set;for(const e of n)for(const i of Object.keys(e).filter(r=>!r.startsWith("_")))t.add(i);return Array.from(t)}function ic(n,t,e,i){const{iScale:r}=n,{key:a="r"}=this._parsing,s=new Array(i);let o,l,c,u;for(o=0,l=i;o<l;++o)c=o+e,u=t[c],s[o]={r:r.parse(on(u,a),c)};return s}const Wg=Number.EPSILON||1e-14,Qn=(n,t)=>t<n.length&&!n[t].skip&&n[t],rc=n=>n==="x"?"y":"x";function Yg(n,t,e,i){const r=n.skip?t:n,a=t,s=e.skip?t:e,o=Gn(a,r),l=Gn(s,a);let c=o/(o+l),u=l/(o+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const d=i*c,f=i*u;return{previous:{x:a.x-d*(s.x-r.x),y:a.y-d*(s.y-r.y)},next:{x:a.x+f*(s.x-r.x),y:a.y+f*(s.y-r.y)}}}function zg(n,t,e){const i=n.length;let r,a,s,o,l,c=Qn(n,0);for(let u=0;u<i-1;++u)if(l=c,c=Qn(n,u+1),!(!l||!c)){if(wi(t[u],0,Wg)){e[u]=e[u+1]=0;continue}r=e[u]/t[u],a=e[u+1]/t[u],o=Math.pow(r,2)+Math.pow(a,2),!(o<=9)&&(s=3/Math.sqrt(o),e[u]=r*s*t[u],e[u+1]=a*s*t[u])}}function Hg(n,t,e="x"){const i=rc(e),r=n.length;let a,s,o,l=Qn(n,0);for(let c=0;c<r;++c){if(s=o,o=l,l=Qn(n,c+1),!o)continue;const u=o[e],d=o[i];s&&(a=(u-s[e])/3,o[`cp1${e}`]=u-a,o[`cp1${i}`]=d-a*t[c]),l&&(a=(l[e]-u)/3,o[`cp2${e}`]=u+a,o[`cp2${i}`]=d+a*t[c])}}function $g(n,t="x"){const e=rc(t),i=n.length,r=Array(i).fill(0),a=Array(i);let s,o,l,c=Qn(n,0);for(s=0;s<i;++s)if(o=l,l=c,c=Qn(n,s+1),!!l){if(c){const u=c[t]-l[t];r[s]=u!==0?(c[e]-l[e])/u:0}a[s]=o?c?Le(r[s-1])!==Le(r[s])?0:(r[s-1]+r[s])/2:r[s-1]:r[s]}zg(n,r,a),Hg(n,a,t)}function wr(n,t,e){return Math.max(Math.min(n,e),t)}function jg(n,t){let e,i,r,a,s,o=Ve(n[0],t);for(e=0,i=n.length;e<i;++e)s=a,a=o,o=e<i-1&&Ve(n[e+1],t),a&&(r=n[e],s&&(r.cp1x=wr(r.cp1x,t.left,t.right),r.cp1y=wr(r.cp1y,t.top,t.bottom)),o&&(r.cp2x=wr(r.cp2x,t.left,t.right),r.cp2y=wr(r.cp2y,t.top,t.bottom)))}function Vg(n,t,e,i,r){let a,s,o,l;if(t.spanGaps&&(n=n.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")$g(n,r);else{let c=i?n[n.length-1]:n[0];for(a=0,s=n.length;a<s;++a)o=n[a],l=Yg(c,o,n[Math.min(a+1,s-(i?0:1))%s],t.tension),o.cp1x=l.previous.x,o.cp1y=l.previous.y,o.cp2x=l.next.x,o.cp2y=l.next.y,c=o}t.capBezierPoints&&jg(n,e)}function qa(){return typeof window<"u"&&typeof document<"u"}function Xa(n){let t=n.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function _r(n,t,e){let i;return typeof n=="string"?(i=parseInt(n,10),n.indexOf("%")!==-1&&(i=i/100*t.parentNode[e])):i=n,i}const Tr=n=>n.ownerDocument.defaultView.getComputedStyle(n,null);function qg(n,t){return Tr(n).getPropertyValue(t)}const Xg=["top","right","bottom","left"];function Pn(n,t,e){const i={};e=e?"-"+e:"";for(let r=0;r<4;r++){const a=Xg[r];i[a]=parseFloat(n[t+"-"+a+e])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const Gg=(n,t,e)=>(n>0||t>0)&&(!e||!e.shadowRoot);function Kg(n,t){const e=n.touches,i=e&&e.length?e[0]:n,{offsetX:r,offsetY:a}=i;let s=!1,o,l;if(Gg(r,a,n.target))o=r,l=a;else{const c=t.getBoundingClientRect();o=i.clientX-c.left,l=i.clientY-c.top,s=!0}return{x:o,y:l,box:s}}function fn(n,t){if("native"in n)return n;const{canvas:e,currentDevicePixelRatio:i}=t,r=Tr(e),a=r.boxSizing==="border-box",s=Pn(r,"padding"),o=Pn(r,"border","width"),{x:l,y:c,box:u}=Kg(n,e),d=s.left+(u&&o.left),f=s.top+(u&&o.top);let{width:g,height:p}=t;return a&&(g-=s.width+o.width,p-=s.height+o.height),{x:Math.round((l-d)/g*e.width/i),y:Math.round((c-f)/p*e.height/i)}}function Zg(n,t,e){let i,r;if(t===void 0||e===void 0){const a=Xa(n);if(!a)t=n.clientWidth,e=n.clientHeight;else{const s=a.getBoundingClientRect(),o=Tr(a),l=Pn(o,"border","width"),c=Pn(o,"padding");t=s.width-c.width-l.width,e=s.height-c.height-l.height,i=_r(o.maxWidth,a,"clientWidth"),r=_r(o.maxHeight,a,"clientHeight")}}return{width:t,height:e,maxWidth:i||pr,maxHeight:r||pr}}const Dr=n=>Math.round(n*10)/10;function Qg(n,t,e,i){const r=Tr(n),a=Pn(r,"margin"),s=_r(r.maxWidth,n,"clientWidth")||pr,o=_r(r.maxHeight,n,"clientHeight")||pr,l=Zg(n,t,e);let{width:c,height:u}=l;if(r.boxSizing==="content-box"){const f=Pn(r,"border","width"),g=Pn(r,"padding");c-=g.width+f.width,u-=g.height+f.height}return c=Math.max(0,c-a.width),u=Math.max(0,i?c/i:u-a.height),c=Dr(Math.min(c,s,l.maxWidth)),u=Dr(Math.min(u,o,l.maxHeight)),c&&!u&&(u=Dr(c/2)),(t!==void 0||e!==void 0)&&i&&l.height&&u>l.height&&(u=l.height,c=Dr(Math.floor(u*i))),{width:c,height:u}}function ac(n,t,e){const i=t||1,r=Math.floor(n.height*i),a=Math.floor(n.width*i);n.height=Math.floor(n.height),n.width=Math.floor(n.width);const s=n.canvas;return s.style&&(e||!s.style.height&&!s.style.width)&&(s.style.height=`${n.height}px`,s.style.width=`${n.width}px`),n.currentDevicePixelRatio!==i||s.height!==r||s.width!==a?(n.currentDevicePixelRatio=i,s.height=r,s.width=a,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const Jg=function(){let n=!1;try{const t={get passive(){return n=!0,!1}};qa()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return n}();function sc(n,t){const e=qg(n,t),i=e&&e.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function En(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}}function tp(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:i==="middle"?e<.5?n.y:t.y:i==="after"?e<1?n.y:t.y:e>0?t.y:n.y}}function ep(n,t,e,i){const r={x:n.cp2x,y:n.cp2y},a={x:t.cp1x,y:t.cp1y},s=En(n,r,e),o=En(r,a,e),l=En(a,t,e),c=En(s,o,e),u=En(o,l,e);return En(c,u,e)}const np=function(n,t){return{x(e){return n+n+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,i){return e-i},leftForLtr(e,i){return e-i}}},ip=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,t){return n+t},leftForLtr(n,t){return n}}};function Jn(n,t,e){return n?np(t,e):ip()}function oc(n,t){let e,i;(t==="ltr"||t==="rtl")&&(e=n.canvas.style,i=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),n.prevTextDirection=i)}function lc(n,t){t!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",t[0],t[1]))}function cc(n){return n==="angle"?{between:_i,compare:rg,normalize:ve}:{between:$e,compare:(t,e)=>t-e,normalize:t=>t}}function uc({start:n,end:t,count:e,loop:i,style:r}){return{start:n%e,end:t%e,loop:i&&(t-n+1)%e===0,style:r}}function rp(n,t,e){const{property:i,start:r,end:a}=e,{between:s,normalize:o}=cc(i),l=t.length;let{start:c,end:u,loop:d}=n,f,g;if(d){for(c+=l,u+=l,f=0,g=l;f<g&&s(o(t[c%l][i]),r,a);++f)c--,u--;c%=l,u%=l}return u<c&&(u+=l),{start:c,end:u,loop:d,style:n.style}}function dc(n,t,e){if(!e)return[n];const{property:i,start:r,end:a}=e,s=t.length,{compare:o,between:l,normalize:c}=cc(i),{start:u,end:d,loop:f,style:g}=rp(n,t,e),p=[];let m=!1,y=null,v,x,w;const _=()=>l(r,w,v)&&o(r,w)!==0,S=()=>o(a,v)===0||l(a,w,v),C=()=>m||_(),k=()=>!m||S();for(let T=u,D=u;T<=d;++T)x=t[T%s],!x.skip&&(v=c(x[i]),v!==w&&(m=l(v,r,a),y===null&&C()&&(y=o(v,r)===0?T:D),y!==null&&k()&&(p.push(uc({start:y,end:T,loop:f,count:s,style:g})),y=null),D=T,w=v));return y!==null&&p.push(uc({start:y,end:d,loop:f,count:s,style:g})),p}function fc(n,t){const e=[],i=n.segments;for(let r=0;r<i.length;r++){const a=dc(i[r],n.points,t);a.length&&e.push(...a)}return e}function ap(n,t,e,i){let r=0,a=t-1;if(e&&!i)for(;r<t&&!n[r].skip;)r++;for(;r<t&&n[r].skip;)r++;for(r%=t,e&&(a+=r);a>r&&n[a%t].skip;)a--;return a%=t,{start:r,end:a}}function sp(n,t,e,i){const r=n.length,a=[];let s=t,o=n[t],l;for(l=t+1;l<=e;++l){const c=n[l%r];c.skip||c.stop?o.skip||(i=!1,a.push({start:t%r,end:(l-1)%r,loop:i}),t=s=c.stop?l:null):(s=l,o.skip&&(t=l)),o=c}return s!==null&&a.push({start:t%r,end:s%r,loop:i}),a}function op(n,t){const e=n.points,i=n.options.spanGaps,r=e.length;if(!r)return[];const a=!!n._loop,{start:s,end:o}=ap(e,r,a,i);if(i===!0)return hc(n,[{start:s,end:o,loop:a}],e,t);const l=o<s?o+r:o,c=!!n._fullLoop&&s===0&&o===r-1;return hc(n,sp(e,s,l,c),e,t)}function hc(n,t,e,i){return!i||!i.setContext||!e?t:lp(n,t,e,i)}function lp(n,t,e,i){const r=n._chart.getContext(),a=gc(n.options),{_datasetIndex:s,options:{spanGaps:o}}=n,l=e.length,c=[];let u=a,d=t[0].start,f=d;function g(p,m,y,v){const x=o?-1:1;if(p!==m){for(p+=l;e[p%l].skip;)p-=x;for(;e[m%l].skip;)m+=x;p%l!==m%l&&(c.push({start:p%l,end:m%l,loop:y,style:v}),u=v,d=m%l)}}for(const p of t){d=o?d:p.start;let m=e[d%l],y;for(f=d+1;f<=p.end;f++){const v=e[f%l];y=gc(i.setContext(dn(r,{type:"segment",p0:m,p1:v,p0DataIndex:(f-1)%l,p1DataIndex:f%l,datasetIndex:s}))),cp(y,u)&&g(d,f-1,p.loop,u),m=v,u=y}d<f-1&&g(d,f-1,p.loop,u)}return c}function gc(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function cp(n,t){if(!t)return!1;const e=[],i=function(r,a){return Ua(a)?(e.includes(a)||e.push(a),e.indexOf(a)):a};return JSON.stringify(n,i)!==JSON.stringify(t,i)}/*!
|
|
11
|
+
*/function He(){}const Xh=(()=>{let n=0;return()=>n++})();function it(n){return n===null||typeof n>"u"}function yt(n){if(Array.isArray&&Array.isArray(n))return!0;const t=Object.prototype.toString.call(n);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function ct(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function Lt(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function be(n,t){return Lt(n)?n:t}function nt(n,t){return typeof n>"u"?t:n}const Gh=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:+n/t,kl=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*t:+n;function xt(n,t,e){if(n&&typeof n.call=="function")return n.apply(e,t)}function _t(n,t,e,i){let r,a,s;if(yt(n))if(a=n.length,i)for(r=a-1;r>=0;r--)t.call(e,n[r],r);else for(r=0;r<a;r++)t.call(e,n[r],r);else if(ct(n))for(s=Object.keys(n),a=s.length,r=0;r<a;r++)t.call(e,n[s[r]],s[r])}function hr(n,t){let e,i,r,a;if(!n||!t||n.length!==t.length)return!1;for(e=0,i=n.length;e<i;++e)if(r=n[e],a=t[e],r.datasetIndex!==a.datasetIndex||r.index!==a.index)return!1;return!0}function gr(n){if(yt(n))return n.map(gr);if(ct(n)){const t=Object.create(null),e=Object.keys(n),i=e.length;let r=0;for(;r<i;++r)t[e[r]]=gr(n[e[r]]);return t}return n}function Ol(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function Kh(n,t,e,i){if(!Ol(n))return;const r=t[n],a=e[n];ct(r)&&ct(a)?vi(r,a,i):t[n]=gr(a)}function vi(n,t,e){const i=yt(t)?t:[t],r=i.length;if(!ct(n))return n;e=e||{};const a=e.merger||Kh;let s;for(let o=0;o<r;++o){if(s=i[o],!ct(s))continue;const l=Object.keys(s);for(let c=0,u=l.length;c<u;++c)a(l[c],n,s,e)}return n}function xi(n,t){return vi(n,t,{merger:Zh})}function Zh(n,t,e){if(!Ol(n))return;const i=t[n],r=e[n];ct(i)&&ct(r)?xi(i,r):Object.prototype.hasOwnProperty.call(t,n)||(t[n]=gr(r))}const Pl={"":n=>n,x:n=>n.x,y:n=>n.y};function Qh(n){const t=n.split("."),e=[];let i="";for(const r of t)i+=r,i.endsWith("\\")?i=i.slice(0,-1)+".":(e.push(i),i="");return e}function Jh(n){const t=Qh(n);return e=>{for(const i of t){if(i==="")break;e=e&&e[i]}return e}}function on(n,t){return(Pl[t]||(Pl[t]=Jh(t)))(n)}function La(n){return n.charAt(0).toUpperCase()+n.slice(1)}const ue=n=>typeof n<"u",de=n=>typeof n=="function",El=(n,t)=>{if(n.size!==t.size)return!1;for(const e of n)if(!t.has(e))return!1;return!0};function tg(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const dt=Math.PI,kt=2*dt,eg=kt+dt,pr=Number.POSITIVE_INFINITY,Ia=dt/180,Pt=dt/2,we=dt/4,mr=dt*2/3,ln=Math.log10,Le=Math.sign;function _i(n,t,e){return Math.abs(n-t)<e}function Al(n){const t=Math.round(n);n=_i(n,t,n/1e3)?t:n;const e=Math.pow(10,Math.floor(ln(n))),i=n/e;return(i<=1?1:i<=2?2:i<=5?5:10)*e}function ng(n){const t=[],e=Math.sqrt(n);let i;for(i=1;i<e;i++)n%i===0&&(t.push(i),t.push(n/i));return e===(e|0)&&t.push(e),t.sort((r,a)=>r-a).pop(),t}function cn(n){return!isNaN(parseFloat(n))&&isFinite(n)}function ig(n,t){const e=Math.round(n);return e-t<=n&&e+t>=n}function Rl(n,t,e){let i,r,a;for(i=0,r=n.length;i<r;i++)a=n[i][e],isNaN(a)||(t.min=Math.min(t.min,a),t.max=Math.max(t.max,a))}function qt(n){return n*(dt/180)}function yr(n){return n*(180/dt)}function Ll(n){if(!Lt(n))return;let t=1,e=0;for(;Math.round(n*t)/t!==n;)t*=10,e++;return e}function Il(n,t){const e=t.x-n.x,i=t.y-n.y,r=Math.sqrt(e*e+i*i);let a=Math.atan2(i,e);return a<-.5*dt&&(a+=kt),{angle:a,distance:r}}function Gn(n,t){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))}function rg(n,t){return(n-t+eg)%kt-dt}function ve(n){return(n%kt+kt)%kt}function wi(n,t,e,i){const r=ve(n),a=ve(t),s=ve(e),o=ve(a-r),l=ve(s-r),c=ve(r-a),u=ve(r-s);return r===a||r===s||i&&a===s||o>l&&c<u}function Zt(n,t,e){return Math.max(t,Math.min(e,n))}function ag(n){return Zt(n,-32768,32767)}function $e(n,t,e,i=1e-6){return n>=Math.min(t,e)-i&&n<=Math.max(t,e)+i}function Na(n,t,e){e=e||(s=>n[s]<t);let i=n.length-1,r=0,a;for(;i-r>1;)a=r+i>>1,e(a)?r=a:i=a;return{lo:r,hi:i}}const je=(n,t,e,i)=>Na(n,e,i?r=>{const a=n[r][t];return a<e||a===e&&n[r+1][t]===e}:r=>n[r][t]<e),sg=(n,t,e)=>Na(n,e,i=>n[i][t]>=e);function og(n,t,e){let i=0,r=n.length;for(;i<r&&n[i]<t;)i++;for(;r>i&&n[r-1]>e;)r--;return i>0||r<n.length?n.slice(i,r):n}const Nl=["push","pop","shift","splice","unshift"];function lg(n,t){if(n._chartjs){n._chartjs.listeners.push(t);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),Nl.forEach(e=>{const i="_onData"+La(e),r=n[e];Object.defineProperty(n,e,{configurable:!0,enumerable:!1,value(...a){const s=r.apply(this,a);return n._chartjs.listeners.forEach(o=>{typeof o[i]=="function"&&o[i](...a)}),s}})})}function Fl(n,t){const e=n._chartjs;if(!e)return;const i=e.listeners,r=i.indexOf(t);r!==-1&&i.splice(r,1),!(i.length>0)&&(Nl.forEach(a=>{delete n[a]}),delete n._chartjs)}function Ul(n){const t=new Set(n);return t.size===n.length?n:Array.from(t)}const Bl=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function Wl(n,t){let e=[],i=!1;return function(...r){e=r,i||(i=!0,Bl.call(window,()=>{i=!1,n.apply(t,e)}))}}function cg(n,t){let e;return function(...i){return t?(clearTimeout(e),e=setTimeout(n,t,i)):n.apply(this,i),t}}const Fa=n=>n==="start"?"left":n==="end"?"right":"center",ie=(n,t,e)=>n==="start"?t:n==="end"?e:(t+e)/2,ug=(n,t,e,i)=>n===(i?"left":"right")?e:n==="center"?(t+e)/2:t;function Yl(n,t,e){const i=t.length;let r=0,a=i;if(n._sorted){const{iScale:s,_parsed:o}=n,l=s.axis,{min:c,max:u,minDefined:d,maxDefined:f}=s.getUserBounds();d&&(r=Zt(Math.min(je(o,l,c).lo,e?i:je(t,l,s.getPixelForValue(c)).lo),0,i-1)),f?a=Zt(Math.max(je(o,s.axis,u,!0).hi+1,e?0:je(t,l,s.getPixelForValue(u),!0).hi+1),r,i)-r:a=i-r}return{start:r,count:a}}function zl(n){const{xScale:t,yScale:e,_scaleRanges:i}=n,r={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!i)return n._scaleRanges=r,!0;const a=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==e.min||i.ymax!==e.max;return Object.assign(i,r),a}const br=n=>n===0||n===1,Hl=(n,t,e)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-t)*kt/e)),$l=(n,t,e)=>Math.pow(2,-10*n)*Math.sin((n-t)*kt/e)+1,Ti={linear:n=>n,easeInQuad:n=>n*n,easeOutQuad:n=>-n*(n-2),easeInOutQuad:n=>(n/=.5)<1?.5*n*n:-.5*(--n*(n-2)-1),easeInCubic:n=>n*n*n,easeOutCubic:n=>(n-=1)*n*n+1,easeInOutCubic:n=>(n/=.5)<1?.5*n*n*n:.5*((n-=2)*n*n+2),easeInQuart:n=>n*n*n*n,easeOutQuart:n=>-((n-=1)*n*n*n-1),easeInOutQuart:n=>(n/=.5)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2),easeInQuint:n=>n*n*n*n*n,easeOutQuint:n=>(n-=1)*n*n*n*n+1,easeInOutQuint:n=>(n/=.5)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2),easeInSine:n=>-Math.cos(n*Pt)+1,easeOutSine:n=>Math.sin(n*Pt),easeInOutSine:n=>-.5*(Math.cos(dt*n)-1),easeInExpo:n=>n===0?0:Math.pow(2,10*(n-1)),easeOutExpo:n=>n===1?1:-Math.pow(2,-10*n)+1,easeInOutExpo:n=>br(n)?n:n<.5?.5*Math.pow(2,10*(n*2-1)):.5*(-Math.pow(2,-10*(n*2-1))+2),easeInCirc:n=>n>=1?n:-(Math.sqrt(1-n*n)-1),easeOutCirc:n=>Math.sqrt(1-(n-=1)*n),easeInOutCirc:n=>(n/=.5)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1),easeInElastic:n=>br(n)?n:Hl(n,.075,.3),easeOutElastic:n=>br(n)?n:$l(n,.075,.3),easeInOutElastic(n){return br(n)?n:n<.5?.5*Hl(n*2,.1125,.45):.5+.5*$l(n*2-1,.1125,.45)},easeInBack(n){return n*n*((1.70158+1)*n-1.70158)},easeOutBack(n){return(n-=1)*n*((1.70158+1)*n+1.70158)+1},easeInOutBack(n){let t=1.70158;return(n/=.5)<1?.5*(n*n*(((t*=1.525)+1)*n-t)):.5*((n-=2)*n*(((t*=1.525)+1)*n+t)+2)},easeInBounce:n=>1-Ti.easeOutBounce(1-n),easeOutBounce(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},easeInOutBounce:n=>n<.5?Ti.easeInBounce(n*2)*.5:Ti.easeOutBounce(n*2-1)*.5+.5};function Ua(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function jl(n){return Ua(n)?n:new bi(n)}function Ba(n){return Ua(n)?n:new bi(n).saturate(.5).darken(.1).hexString()}const dg=["x","y","borderWidth","radius","tension"],fg=["color","borderColor","backgroundColor"];function hg(n){n.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),n.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),n.set("animations",{colors:{type:"color",properties:fg},numbers:{type:"number",properties:dg}}),n.describe("animations",{_fallback:"animation"}),n.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 gg(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Vl=new Map;function pg(n,t){t=t||{};const e=n+JSON.stringify(t);let i=Vl.get(e);return i||(i=new Intl.NumberFormat(n,t),Vl.set(e,i)),i}function Di(n,t,e){return pg(t,e).format(n)}const ql={values(n){return yt(n)?n:""+n},numeric(n,t,e){if(n===0)return"0";const i=this.chart.options.locale;let r,a=n;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)&&(r="scientific"),a=mg(n,e)}const s=ln(Math.abs(a)),o=isNaN(s)?1:Math.max(Math.min(-1*Math.floor(s),20),0),l={notation:r,minimumFractionDigits:o,maximumFractionDigits:o};return Object.assign(l,this.options.ticks.format),Di(n,i,l)},logarithmic(n,t,e){if(n===0)return"0";const i=e[t].significand||n/Math.pow(10,Math.floor(ln(n)));return[1,2,3,5,10,15].includes(i)||t>.8*e.length?ql.numeric.call(this,n,t,e):""}};function mg(n,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&n!==Math.floor(n)&&(e=n-Math.floor(n)),e}var vr={formatters:ql};function yg(n){n.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:vr.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),n.route("scale.ticks","color","","color"),n.route("scale.grid","color","","borderColor"),n.route("scale.border","color","","borderColor"),n.route("scale.title","color","","color"),n.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),n.describe("scales",{_fallback:"scale"}),n.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const Cn=Object.create(null),Wa=Object.create(null);function Si(n,t){if(!t)return n;const e=t.split(".");for(let i=0,r=e.length;i<r;++i){const a=e[i];n=n[a]||(n[a]=Object.create(null))}return n}function Ya(n,t,e){return typeof t=="string"?vi(Si(n,t),e):vi(Si(n,""),t)}class bg{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=i=>i.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(i,r)=>Ba(r.backgroundColor),this.hoverBorderColor=(i,r)=>Ba(r.borderColor),this.hoverColor=(i,r)=>Ba(r.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 Ya(this,t,e)}get(t){return Si(this,t)}describe(t,e){return Ya(Wa,t,e)}override(t,e){return Ya(Cn,t,e)}route(t,e,i,r){const a=Si(this,t),s=Si(this,i),o="_"+e;Object.defineProperties(a,{[o]:{value:a[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[o],c=s[r];return ct(l)?Object.assign({},c,l):nt(l,c)},set(l){this[o]=l}}})}apply(t){t.forEach(e=>e(this))}}var Ft=new bg({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[hg,gg,yg]);function vg(n){return!n||it(n.size)||it(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function xr(n,t,e,i,r){let a=t[r];return a||(a=t[r]=n.measureText(r).width,e.push(r)),a>i&&(i=a),i}function xg(n,t,e,i){i=i||{};let r=i.data=i.data||{},a=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(r=i.data={},a=i.garbageCollect=[],i.font=t),n.save(),n.font=t;let s=0;const o=e.length;let l,c,u,d,f;for(l=0;l<o;l++)if(d=e[l],d!=null&&!yt(d))s=xr(n,r,a,s,d);else if(yt(d))for(c=0,u=d.length;c<u;c++)f=d[c],f!=null&&!yt(f)&&(s=xr(n,r,a,s,f));n.restore();const g=a.length/2;if(g>e.length){for(l=0;l<g;l++)delete r[a[l]];a.splice(0,g)}return s}function kn(n,t,e){const i=n.currentDevicePixelRatio,r=e!==0?Math.max(e/2,.5):0;return Math.round((t-r)*i)/i+r}function Xl(n,t){t=t||n.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,n.width,n.height),t.restore()}function za(n,t,e,i){Gl(n,t,e,i,null)}function Gl(n,t,e,i,r){let a,s,o,l,c,u,d,f;const g=t.pointStyle,p=t.rotation,x=t.radius;let m=(p||0)*Ia;if(g&&typeof g=="object"&&(a=g.toString(),a==="[object HTMLImageElement]"||a==="[object HTMLCanvasElement]")){n.save(),n.translate(e,i),n.rotate(m),n.drawImage(g,-g.width/2,-g.height/2,g.width,g.height),n.restore();return}if(!(isNaN(x)||x<=0)){switch(n.beginPath(),g){default:r?n.ellipse(e,i,r/2,x,0,0,kt):n.arc(e,i,x,0,kt),n.closePath();break;case"triangle":u=r?r/2:x,n.moveTo(e+Math.sin(m)*u,i-Math.cos(m)*x),m+=mr,n.lineTo(e+Math.sin(m)*u,i-Math.cos(m)*x),m+=mr,n.lineTo(e+Math.sin(m)*u,i-Math.cos(m)*x),n.closePath();break;case"rectRounded":c=x*.516,l=x-c,s=Math.cos(m+we)*l,d=Math.cos(m+we)*(r?r/2-c:l),o=Math.sin(m+we)*l,f=Math.sin(m+we)*(r?r/2-c:l),n.arc(e-d,i-o,c,m-dt,m-Pt),n.arc(e+f,i-s,c,m-Pt,m),n.arc(e+d,i+o,c,m,m+Pt),n.arc(e-f,i+s,c,m+Pt,m+dt),n.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*x,u=r?r/2:l,n.rect(e-u,i-l,2*u,2*l);break}m+=we;case"rectRot":d=Math.cos(m)*(r?r/2:x),s=Math.cos(m)*x,o=Math.sin(m)*x,f=Math.sin(m)*(r?r/2:x),n.moveTo(e-d,i-o),n.lineTo(e+f,i-s),n.lineTo(e+d,i+o),n.lineTo(e-f,i+s),n.closePath();break;case"crossRot":m+=we;case"cross":d=Math.cos(m)*(r?r/2:x),s=Math.cos(m)*x,o=Math.sin(m)*x,f=Math.sin(m)*(r?r/2:x),n.moveTo(e-d,i-o),n.lineTo(e+d,i+o),n.moveTo(e+f,i-s),n.lineTo(e-f,i+s);break;case"star":d=Math.cos(m)*(r?r/2:x),s=Math.cos(m)*x,o=Math.sin(m)*x,f=Math.sin(m)*(r?r/2:x),n.moveTo(e-d,i-o),n.lineTo(e+d,i+o),n.moveTo(e+f,i-s),n.lineTo(e-f,i+s),m+=we,d=Math.cos(m)*(r?r/2:x),s=Math.cos(m)*x,o=Math.sin(m)*x,f=Math.sin(m)*(r?r/2:x),n.moveTo(e-d,i-o),n.lineTo(e+d,i+o),n.moveTo(e+f,i-s),n.lineTo(e-f,i+s);break;case"line":s=r?r/2:Math.cos(m)*x,o=Math.sin(m)*x,n.moveTo(e-s,i-o),n.lineTo(e+s,i+o);break;case"dash":n.moveTo(e,i),n.lineTo(e+Math.cos(m)*(r?r/2:x),i+Math.sin(m)*x);break;case!1:n.closePath();break}n.fill(),t.borderWidth>0&&n.stroke()}}function Ve(n,t,e){return e=e||.5,!t||n&&n.x>t.left-e&&n.x<t.right+e&&n.y>t.top-e&&n.y<t.bottom+e}function Mi(n,t){n.save(),n.beginPath(),n.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),n.clip()}function Ci(n){n.restore()}function _g(n,t,e,i,r){if(!t)return n.lineTo(e.x,e.y);if(r==="middle"){const a=(t.x+e.x)/2;n.lineTo(a,t.y),n.lineTo(a,e.y)}else r==="after"!=!!i?n.lineTo(t.x,e.y):n.lineTo(e.x,t.y);n.lineTo(e.x,e.y)}function wg(n,t,e,i){if(!t)return n.lineTo(e.x,e.y);n.bezierCurveTo(i?t.cp1x:t.cp2x,i?t.cp1y:t.cp2y,i?e.cp2x:e.cp1x,i?e.cp2y:e.cp1y,e.x,e.y)}function Tg(n,t){t.translation&&n.translate(t.translation[0],t.translation[1]),it(t.rotation)||n.rotate(t.rotation),t.color&&(n.fillStyle=t.color),t.textAlign&&(n.textAlign=t.textAlign),t.textBaseline&&(n.textBaseline=t.textBaseline)}function Dg(n,t,e,i,r){if(r.strikethrough||r.underline){const a=n.measureText(i),s=t-a.actualBoundingBoxLeft,o=t+a.actualBoundingBoxRight,l=e-a.actualBoundingBoxAscent,c=e+a.actualBoundingBoxDescent,u=r.strikethrough?(l+c)/2:c;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=r.decorationWidth||2,n.moveTo(s,u),n.lineTo(o,u),n.stroke()}}function Sg(n,t){const e=n.fillStyle;n.fillStyle=t.color,n.fillRect(t.left,t.top,t.width,t.height),n.fillStyle=e}function On(n,t,e,i,r,a={}){const s=yt(t)?t:[t],o=a.strokeWidth>0&&a.strokeColor!=="";let l,c;for(n.save(),n.font=r.string,Tg(n,a),l=0;l<s.length;++l)c=s[l],a.backdrop&&Sg(n,a.backdrop),o&&(a.strokeColor&&(n.strokeStyle=a.strokeColor),it(a.strokeWidth)||(n.lineWidth=a.strokeWidth),n.strokeText(c,e,i,a.maxWidth)),n.fillText(c,e,i,a.maxWidth),Dg(n,e,i,c,a),i+=Number(r.lineHeight);n.restore()}function Kn(n,t){const{x:e,y:i,w:r,h:a,radius:s}=t;n.arc(e+s.topLeft,i+s.topLeft,s.topLeft,1.5*dt,dt,!0),n.lineTo(e,i+a-s.bottomLeft),n.arc(e+s.bottomLeft,i+a-s.bottomLeft,s.bottomLeft,dt,Pt,!0),n.lineTo(e+r-s.bottomRight,i+a),n.arc(e+r-s.bottomRight,i+a-s.bottomRight,s.bottomRight,Pt,0,!0),n.lineTo(e+r,i+s.topRight),n.arc(e+r-s.topRight,i+s.topRight,s.topRight,0,-Pt,!0),n.lineTo(e+s.topLeft,i)}const Mg=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Cg=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function kg(n,t){const e=(""+n).match(Mg);if(!e||e[1]==="normal")return t*1.2;switch(n=+e[2],e[3]){case"px":return n;case"%":n/=100;break}return t*n}const Og=n=>+n||0;function Ha(n,t){const e={},i=ct(t),r=i?Object.keys(t):t,a=ct(n)?i?s=>nt(n[s],n[t[s]]):s=>n[s]:()=>n;for(const s of r)e[s]=Og(a(s));return e}function Kl(n){return Ha(n,{top:"y",right:"x",bottom:"y",left:"x"})}function un(n){return Ha(n,["topLeft","topRight","bottomLeft","bottomRight"])}function Xt(n){const t=Kl(n);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Et(n,t){n=n||{},t=t||Ft.font;let e=nt(n.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let i=nt(n.style,t.style);i&&!(""+i).match(Cg)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const r={family:nt(n.family,t.family),lineHeight:kg(nt(n.lineHeight,t.lineHeight),e),size:e,style:i,weight:nt(n.weight,t.weight),string:""};return r.string=vg(r),r}function ki(n,t,e,i){let r=!0,a,s,o;for(a=0,s=n.length;a<s;++a)if(o=n[a],o!==void 0&&(t!==void 0&&typeof o=="function"&&(o=o(t),r=!1),e!==void 0&&yt(o)&&(o=o[e%o.length],r=!1),o!==void 0))return i&&!r&&(i.cacheable=!1),o}function Pg(n,t,e){const{min:i,max:r}=n,a=kl(t,(r-i)/2),s=(o,l)=>e&&o===0?0:o+l;return{min:s(i,-Math.abs(a)),max:s(r,a)}}function dn(n,t){return Object.assign(Object.create(n),t)}function $a(n,t=[""],e,i,r=()=>n[0]){const a=e||n;typeof i>"u"&&(i=ec("_fallback",n));const s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:a,_fallback:i,_getTarget:r,override:o=>$a([o,...n],t,a,i)};return new Proxy(s,{deleteProperty(o,l){return delete o[l],delete o._keys,delete n[0][l],!0},get(o,l){return Ql(o,l,()=>Ug(l,t,n,o))},getOwnPropertyDescriptor(o,l){return Reflect.getOwnPropertyDescriptor(o._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(o,l){return nc(o).includes(l)},ownKeys(o){return nc(o)},set(o,l,c){const u=o._storage||(o._storage=r());return o[l]=u[l]=c,delete o._keys,!0}})}function Zn(n,t,e,i){const r={_cacheable:!1,_proxy:n,_context:t,_subProxy:e,_stack:new Set,_descriptors:Zl(n,i),setContext:a=>Zn(n,a,e,i),override:a=>Zn(n.override(a),t,e,i)};return new Proxy(r,{deleteProperty(a,s){return delete a[s],delete n[s],!0},get(a,s,o){return Ql(a,s,()=>Ag(a,s,o))},getOwnPropertyDescriptor(a,s){return a._descriptors.allKeys?Reflect.has(n,s)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,s)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(a,s){return Reflect.has(n,s)},ownKeys(){return Reflect.ownKeys(n)},set(a,s,o){return n[s]=o,delete a[s],!0}})}function Zl(n,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:i=t.indexable,_allKeys:r=t.allKeys}=n;return{allKeys:r,scriptable:e,indexable:i,isScriptable:de(e)?e:()=>e,isIndexable:de(i)?i:()=>i}}const Eg=(n,t)=>n?n+La(t):t,ja=(n,t)=>ct(t)&&n!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Ql(n,t,e){if(Object.prototype.hasOwnProperty.call(n,t))return n[t];const i=e();return n[t]=i,i}function Ag(n,t,e){const{_proxy:i,_context:r,_subProxy:a,_descriptors:s}=n;let o=i[t];return de(o)&&s.isScriptable(t)&&(o=Rg(t,o,n,e)),yt(o)&&o.length&&(o=Lg(t,o,n,s.isIndexable)),ja(t,o)&&(o=Zn(o,r,a&&a[t],s)),o}function Rg(n,t,e,i){const{_proxy:r,_context:a,_subProxy:s,_stack:o}=e;if(o.has(n))throw new Error("Recursion detected: "+Array.from(o).join("->")+"->"+n);o.add(n);let l=t(a,s||i);return o.delete(n),ja(n,l)&&(l=Va(r._scopes,r,n,l)),l}function Lg(n,t,e,i){const{_proxy:r,_context:a,_subProxy:s,_descriptors:o}=e;if(typeof a.index<"u"&&i(n))return t[a.index%t.length];if(ct(t[0])){const l=t,c=r._scopes.filter(u=>u!==l);t=[];for(const u of l){const d=Va(c,r,n,u);t.push(Zn(d,a,s&&s[n],o))}}return t}function Jl(n,t,e){return de(n)?n(t,e):n}const Ig=(n,t)=>n===!0?t:typeof n=="string"?on(t,n):void 0;function Ng(n,t,e,i,r){for(const a of t){const s=Ig(e,a);if(s){n.add(s);const o=Jl(s._fallback,e,r);if(typeof o<"u"&&o!==e&&o!==i)return o}else if(s===!1&&typeof i<"u"&&e!==i)return null}return!1}function Va(n,t,e,i){const r=t._rootScopes,a=Jl(t._fallback,e,i),s=[...n,...r],o=new Set;o.add(i);let l=tc(o,s,e,a||e,i);return l===null||typeof a<"u"&&a!==e&&(l=tc(o,s,a,l,i),l===null)?!1:$a(Array.from(o),[""],r,a,()=>Fg(t,e,i))}function tc(n,t,e,i,r){for(;e;)e=Ng(n,t,e,i,r);return e}function Fg(n,t,e){const i=n._getTarget();t in i||(i[t]={});const r=i[t];return yt(r)&&ct(e)?e:r||{}}function Ug(n,t,e,i){let r;for(const a of t)if(r=ec(Eg(a,n),e),typeof r<"u")return ja(n,r)?Va(e,i,n,r):r}function ec(n,t){for(const e of t){if(!e)continue;const i=e[n];if(typeof i<"u")return i}}function nc(n){let t=n._keys;return t||(t=n._keys=Bg(n._scopes)),t}function Bg(n){const t=new Set;for(const e of n)for(const i of Object.keys(e).filter(r=>!r.startsWith("_")))t.add(i);return Array.from(t)}function ic(n,t,e,i){const{iScale:r}=n,{key:a="r"}=this._parsing,s=new Array(i);let o,l,c,u;for(o=0,l=i;o<l;++o)c=o+e,u=t[c],s[o]={r:r.parse(on(u,a),c)};return s}const Wg=Number.EPSILON||1e-14,Qn=(n,t)=>t<n.length&&!n[t].skip&&n[t],rc=n=>n==="x"?"y":"x";function Yg(n,t,e,i){const r=n.skip?t:n,a=t,s=e.skip?t:e,o=Gn(a,r),l=Gn(s,a);let c=o/(o+l),u=l/(o+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const d=i*c,f=i*u;return{previous:{x:a.x-d*(s.x-r.x),y:a.y-d*(s.y-r.y)},next:{x:a.x+f*(s.x-r.x),y:a.y+f*(s.y-r.y)}}}function zg(n,t,e){const i=n.length;let r,a,s,o,l,c=Qn(n,0);for(let u=0;u<i-1;++u)if(l=c,c=Qn(n,u+1),!(!l||!c)){if(_i(t[u],0,Wg)){e[u]=e[u+1]=0;continue}r=e[u]/t[u],a=e[u+1]/t[u],o=Math.pow(r,2)+Math.pow(a,2),!(o<=9)&&(s=3/Math.sqrt(o),e[u]=r*s*t[u],e[u+1]=a*s*t[u])}}function Hg(n,t,e="x"){const i=rc(e),r=n.length;let a,s,o,l=Qn(n,0);for(let c=0;c<r;++c){if(s=o,o=l,l=Qn(n,c+1),!o)continue;const u=o[e],d=o[i];s&&(a=(u-s[e])/3,o[`cp1${e}`]=u-a,o[`cp1${i}`]=d-a*t[c]),l&&(a=(l[e]-u)/3,o[`cp2${e}`]=u+a,o[`cp2${i}`]=d+a*t[c])}}function $g(n,t="x"){const e=rc(t),i=n.length,r=Array(i).fill(0),a=Array(i);let s,o,l,c=Qn(n,0);for(s=0;s<i;++s)if(o=l,l=c,c=Qn(n,s+1),!!l){if(c){const u=c[t]-l[t];r[s]=u!==0?(c[e]-l[e])/u:0}a[s]=o?c?Le(r[s-1])!==Le(r[s])?0:(r[s-1]+r[s])/2:r[s-1]:r[s]}zg(n,r,a),Hg(n,a,t)}function _r(n,t,e){return Math.max(Math.min(n,e),t)}function jg(n,t){let e,i,r,a,s,o=Ve(n[0],t);for(e=0,i=n.length;e<i;++e)s=a,a=o,o=e<i-1&&Ve(n[e+1],t),a&&(r=n[e],s&&(r.cp1x=_r(r.cp1x,t.left,t.right),r.cp1y=_r(r.cp1y,t.top,t.bottom)),o&&(r.cp2x=_r(r.cp2x,t.left,t.right),r.cp2y=_r(r.cp2y,t.top,t.bottom)))}function Vg(n,t,e,i,r){let a,s,o,l;if(t.spanGaps&&(n=n.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")$g(n,r);else{let c=i?n[n.length-1]:n[0];for(a=0,s=n.length;a<s;++a)o=n[a],l=Yg(c,o,n[Math.min(a+1,s-(i?0:1))%s],t.tension),o.cp1x=l.previous.x,o.cp1y=l.previous.y,o.cp2x=l.next.x,o.cp2y=l.next.y,c=o}t.capBezierPoints&&jg(n,e)}function qa(){return typeof window<"u"&&typeof document<"u"}function Xa(n){let t=n.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function wr(n,t,e){let i;return typeof n=="string"?(i=parseInt(n,10),n.indexOf("%")!==-1&&(i=i/100*t.parentNode[e])):i=n,i}const Tr=n=>n.ownerDocument.defaultView.getComputedStyle(n,null);function qg(n,t){return Tr(n).getPropertyValue(t)}const Xg=["top","right","bottom","left"];function Pn(n,t,e){const i={};e=e?"-"+e:"";for(let r=0;r<4;r++){const a=Xg[r];i[a]=parseFloat(n[t+"-"+a+e])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const Gg=(n,t,e)=>(n>0||t>0)&&(!e||!e.shadowRoot);function Kg(n,t){const e=n.touches,i=e&&e.length?e[0]:n,{offsetX:r,offsetY:a}=i;let s=!1,o,l;if(Gg(r,a,n.target))o=r,l=a;else{const c=t.getBoundingClientRect();o=i.clientX-c.left,l=i.clientY-c.top,s=!0}return{x:o,y:l,box:s}}function fn(n,t){if("native"in n)return n;const{canvas:e,currentDevicePixelRatio:i}=t,r=Tr(e),a=r.boxSizing==="border-box",s=Pn(r,"padding"),o=Pn(r,"border","width"),{x:l,y:c,box:u}=Kg(n,e),d=s.left+(u&&o.left),f=s.top+(u&&o.top);let{width:g,height:p}=t;return a&&(g-=s.width+o.width,p-=s.height+o.height),{x:Math.round((l-d)/g*e.width/i),y:Math.round((c-f)/p*e.height/i)}}function Zg(n,t,e){let i,r;if(t===void 0||e===void 0){const a=Xa(n);if(!a)t=n.clientWidth,e=n.clientHeight;else{const s=a.getBoundingClientRect(),o=Tr(a),l=Pn(o,"border","width"),c=Pn(o,"padding");t=s.width-c.width-l.width,e=s.height-c.height-l.height,i=wr(o.maxWidth,a,"clientWidth"),r=wr(o.maxHeight,a,"clientHeight")}}return{width:t,height:e,maxWidth:i||pr,maxHeight:r||pr}}const Dr=n=>Math.round(n*10)/10;function Qg(n,t,e,i){const r=Tr(n),a=Pn(r,"margin"),s=wr(r.maxWidth,n,"clientWidth")||pr,o=wr(r.maxHeight,n,"clientHeight")||pr,l=Zg(n,t,e);let{width:c,height:u}=l;if(r.boxSizing==="content-box"){const f=Pn(r,"border","width"),g=Pn(r,"padding");c-=g.width+f.width,u-=g.height+f.height}return c=Math.max(0,c-a.width),u=Math.max(0,i?c/i:u-a.height),c=Dr(Math.min(c,s,l.maxWidth)),u=Dr(Math.min(u,o,l.maxHeight)),c&&!u&&(u=Dr(c/2)),(t!==void 0||e!==void 0)&&i&&l.height&&u>l.height&&(u=l.height,c=Dr(Math.floor(u*i))),{width:c,height:u}}function ac(n,t,e){const i=t||1,r=Math.floor(n.height*i),a=Math.floor(n.width*i);n.height=Math.floor(n.height),n.width=Math.floor(n.width);const s=n.canvas;return s.style&&(e||!s.style.height&&!s.style.width)&&(s.style.height=`${n.height}px`,s.style.width=`${n.width}px`),n.currentDevicePixelRatio!==i||s.height!==r||s.width!==a?(n.currentDevicePixelRatio=i,s.height=r,s.width=a,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const Jg=function(){let n=!1;try{const t={get passive(){return n=!0,!1}};qa()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return n}();function sc(n,t){const e=qg(n,t),i=e&&e.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function En(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}}function tp(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:i==="middle"?e<.5?n.y:t.y:i==="after"?e<1?n.y:t.y:e>0?t.y:n.y}}function ep(n,t,e,i){const r={x:n.cp2x,y:n.cp2y},a={x:t.cp1x,y:t.cp1y},s=En(n,r,e),o=En(r,a,e),l=En(a,t,e),c=En(s,o,e),u=En(o,l,e);return En(c,u,e)}const np=function(n,t){return{x(e){return n+n+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,i){return e-i},leftForLtr(e,i){return e-i}}},ip=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,t){return n+t},leftForLtr(n,t){return n}}};function Jn(n,t,e){return n?np(t,e):ip()}function oc(n,t){let e,i;(t==="ltr"||t==="rtl")&&(e=n.canvas.style,i=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),n.prevTextDirection=i)}function lc(n,t){t!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",t[0],t[1]))}function cc(n){return n==="angle"?{between:wi,compare:rg,normalize:ve}:{between:$e,compare:(t,e)=>t-e,normalize:t=>t}}function uc({start:n,end:t,count:e,loop:i,style:r}){return{start:n%e,end:t%e,loop:i&&(t-n+1)%e===0,style:r}}function rp(n,t,e){const{property:i,start:r,end:a}=e,{between:s,normalize:o}=cc(i),l=t.length;let{start:c,end:u,loop:d}=n,f,g;if(d){for(c+=l,u+=l,f=0,g=l;f<g&&s(o(t[c%l][i]),r,a);++f)c--,u--;c%=l,u%=l}return u<c&&(u+=l),{start:c,end:u,loop:d,style:n.style}}function dc(n,t,e){if(!e)return[n];const{property:i,start:r,end:a}=e,s=t.length,{compare:o,between:l,normalize:c}=cc(i),{start:u,end:d,loop:f,style:g}=rp(n,t,e),p=[];let x=!1,m=null,v,b,_;const w=()=>l(r,_,v)&&o(r,_)!==0,S=()=>o(a,v)===0||l(a,_,v),C=()=>x||w(),k=()=>!x||S();for(let T=u,D=u;T<=d;++T)b=t[T%s],!b.skip&&(v=c(b[i]),v!==_&&(x=l(v,r,a),m===null&&C()&&(m=o(v,r)===0?T:D),m!==null&&k()&&(p.push(uc({start:m,end:T,loop:f,count:s,style:g})),m=null),D=T,_=v));return m!==null&&p.push(uc({start:m,end:d,loop:f,count:s,style:g})),p}function fc(n,t){const e=[],i=n.segments;for(let r=0;r<i.length;r++){const a=dc(i[r],n.points,t);a.length&&e.push(...a)}return e}function ap(n,t,e,i){let r=0,a=t-1;if(e&&!i)for(;r<t&&!n[r].skip;)r++;for(;r<t&&n[r].skip;)r++;for(r%=t,e&&(a+=r);a>r&&n[a%t].skip;)a--;return a%=t,{start:r,end:a}}function sp(n,t,e,i){const r=n.length,a=[];let s=t,o=n[t],l;for(l=t+1;l<=e;++l){const c=n[l%r];c.skip||c.stop?o.skip||(i=!1,a.push({start:t%r,end:(l-1)%r,loop:i}),t=s=c.stop?l:null):(s=l,o.skip&&(t=l)),o=c}return s!==null&&a.push({start:t%r,end:s%r,loop:i}),a}function op(n,t){const e=n.points,i=n.options.spanGaps,r=e.length;if(!r)return[];const a=!!n._loop,{start:s,end:o}=ap(e,r,a,i);if(i===!0)return hc(n,[{start:s,end:o,loop:a}],e,t);const l=o<s?o+r:o,c=!!n._fullLoop&&s===0&&o===r-1;return hc(n,sp(e,s,l,c),e,t)}function hc(n,t,e,i){return!i||!i.setContext||!e?t:lp(n,t,e,i)}function lp(n,t,e,i){const r=n._chart.getContext(),a=gc(n.options),{_datasetIndex:s,options:{spanGaps:o}}=n,l=e.length,c=[];let u=a,d=t[0].start,f=d;function g(p,x,m,v){const b=o?-1:1;if(p!==x){for(p+=l;e[p%l].skip;)p-=b;for(;e[x%l].skip;)x+=b;p%l!==x%l&&(c.push({start:p%l,end:x%l,loop:m,style:v}),u=v,d=x%l)}}for(const p of t){d=o?d:p.start;let x=e[d%l],m;for(f=d+1;f<=p.end;f++){const v=e[f%l];m=gc(i.setContext(dn(r,{type:"segment",p0:x,p1:v,p0DataIndex:(f-1)%l,p1DataIndex:f%l,datasetIndex:s}))),cp(m,u)&&g(d,f-1,p.loop,u),x=v,u=m}d<f-1&&g(d,f-1,p.loop,u)}return c}function gc(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function cp(n,t){if(!t)return!1;const e=[],i=function(r,a){return Ua(a)?(e.includes(a)||e.push(a),e.indexOf(a)):a};return JSON.stringify(n,i)!==JSON.stringify(t,i)}/*!
|
|
12
12
|
* Chart.js v4.4.1
|
|
13
13
|
* https://www.chartjs.org
|
|
14
14
|
* (c) 2023 Chart.js Contributors
|
|
15
15
|
* Released under the MIT License
|
|
16
|
-
*/class up{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,r){const a=e.listeners[r],s=e.duration;a.forEach(o=>o({chart:t,initial:e.initial,numSteps:s,currentStep:Math.min(i-e.start,s)}))}_refresh(){this._request||(this._running=!0,this._request=Bl.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,r)=>{if(!i.running||!i.items.length)return;const a=i.items;let s=a.length-1,o=!1,l;for(;s>=0;--s)l=a[s],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),o=!0):(a[s]=a[a.length-1],a.pop());o&&(r.draw(),this._notify(r,i,t,"progress")),a.length||(i.running=!1,this._notify(r,i,t,"complete"),i.initial=!1),e+=a.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((i,r)=>Math.max(i,r._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let r=i.length-1;for(;r>=0;--r)i[r].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var qe=new up;const pc="transparent",dp={boolean(n,t,e){return e>.5?t:n},color(n,t,e){const i=jl(n||pc),r=i.valid&&jl(t||pc);return r&&r.valid?r.mix(i,e).hexString():t},number(n,t,e){return n+(t-n)*e}};class fp{constructor(t,e,i,r){const a=e[i];r=ki([t.to,r,a,t.from]);const s=ki([t.from,a,r]);this._active=!0,this._fn=t.fn||dp[t.type||typeof s],this._easing=Ti[t.easing]||Ti.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=s,this._to=r,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const r=this._target[this._prop],a=i-this._start,s=this._duration-a;this._start=i,this._duration=Math.floor(Math.max(s,t.duration)),this._total+=a,this._loop=!!t.loop,this._to=ki([t.to,e,r,t.from]),this._from=ki([t.from,r,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,r=this._prop,a=this._from,s=this._loop,o=this._to;let l;if(this._active=a!==o&&(s||e<i),!this._active){this._target[r]=o,this._notify(!0);return}if(e<0){this._target[r]=a;return}l=e/i%2,l=s&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[r]=this._fn(a,o,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let r=0;r<i.length;r++)i[r][e]()}}class Ga{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!ct(t))return;const e=Object.keys(Ft.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(r=>{const a=t[r];if(!ct(a))return;const s={};for(const o of e)s[o]=a[o];(yt(a.properties)&&a.properties||[r]).forEach(o=>{(o===r||!i.has(o))&&i.set(o,s)})})}_animateOptions(t,e){const i=e.options,r=gp(t,i);if(!r)return[];const a=this._createAnimations(r,i);return i.$shared&&hp(t.options.$animations,i).then(()=>{t.options=i},()=>{}),a}_createAnimations(t,e){const i=this._properties,r=[],a=t.$animations||(t.$animations={}),s=Object.keys(e),o=Date.now();let l;for(l=s.length-1;l>=0;--l){const c=s[l];if(c.charAt(0)==="$")continue;if(c==="options"){r.push(...this._animateOptions(t,e));continue}const u=e[c];let d=a[c];const f=i.get(c);if(d)if(f&&d.active()){d.update(f,u,o);continue}else d.cancel();if(!f||!f.duration){t[c]=u;continue}a[c]=d=new fp(f,t,c,u),r.push(d)}return r}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const i=this._createAnimations(t,e);if(i.length)return qe.add(this._chart,i),!0}}function hp(n,t){const e=[],i=Object.keys(t);for(let r=0;r<i.length;r++){const a=n[i[r]];a&&a.active()&&e.push(a.wait())}return Promise.all(e)}function gp(n,t){if(!t)return;let e=n.options;if(!e){n.options=t;return}return e.$shared&&(n.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function mc(n,t){const e=n&&n.options||{},i=e.reverse,r=e.min===void 0?t:0,a=e.max===void 0?t:0;return{start:i?a:r,end:i?r:a}}function pp(n,t,e){if(e===!1)return!1;const i=mc(n,e),r=mc(t,e);return{top:r.end,right:i.end,bottom:r.start,left:i.start}}function mp(n){let t,e,i,r;return ct(n)?(t=n.top,e=n.right,i=n.bottom,r=n.left):t=e=i=r=n,{top:t,right:e,bottom:i,left:r,disabled:n===!1}}function yc(n,t){const e=[],i=n._getSortedDatasetMetas(t);let r,a;for(r=0,a=i.length;r<a;++r)e.push(i[r].index);return e}function bc(n,t,e,i={}){const r=n.keys,a=i.mode==="single";let s,o,l,c;if(t!==null){for(s=0,o=r.length;s<o;++s){if(l=+r[s],l===e){if(i.all)continue;break}c=n.values[l],Lt(c)&&(a||t===0||Le(t)===Le(c))&&(t+=c)}return t}}function yp(n){const t=Object.keys(n),e=new Array(t.length);let i,r,a;for(i=0,r=t.length;i<r;++i)a=t[i],e[i]={x:a,y:n[a]};return e}function vc(n,t){const e=n&&n.options.stacked;return e||e===void 0&&t.stack!==void 0}function bp(n,t,e){return`${n.id}.${t.id}.${e.stack||e.type}`}function vp(n){const{min:t,max:e,minDefined:i,maxDefined:r}=n.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:r?e:Number.POSITIVE_INFINITY}}function xp(n,t,e){const i=n[t]||(n[t]={});return i[e]||(i[e]={})}function xc(n,t,e,i){for(const r of t.getMatchingVisibleMetas(i).reverse()){const a=n[r.index];if(e&&a>0||!e&&a<0)return r.index}return null}function wc(n,t){const{chart:e,_cachedMeta:i}=n,r=e._stacks||(e._stacks={}),{iScale:a,vScale:s,index:o}=i,l=a.axis,c=s.axis,u=bp(a,s,i),d=t.length;let f;for(let g=0;g<d;++g){const p=t[g],{[l]:m,[c]:y}=p,v=p._stacks||(p._stacks={});f=v[c]=xp(r,u,m),f[o]=y,f._top=xc(f,s,!0,i.type),f._bottom=xc(f,s,!1,i.type);const x=f._visualValues||(f._visualValues={});x[o]=y}}function Ka(n,t){const e=n.scales;return Object.keys(e).filter(i=>e[i].axis===t).shift()}function wp(n,t){return dn(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function _p(n,t,e){return dn(n,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function Oi(n,t){const e=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){t=t||n._parsed;for(const r of t){const a=r._stacks;if(!a||a[i]===void 0||a[i][e]===void 0)return;delete a[i][e],a[i]._visualValues!==void 0&&a[i]._visualValues[e]!==void 0&&delete a[i]._visualValues[e]}}}const Za=n=>n==="reset"||n==="none",_c=(n,t)=>t?n:Object.assign({},n),Tp=(n,t,e)=>n&&!t.hidden&&t._stacked&&{keys:yc(e,!0),values:null};class Oe{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=vc(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&&Oi(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),r=(d,f,g,p)=>d==="x"?f:d==="r"?p:g,a=e.xAxisID=nt(i.xAxisID,Ka(t,"x")),s=e.yAxisID=nt(i.yAxisID,Ka(t,"y")),o=e.rAxisID=nt(i.rAxisID,Ka(t,"r")),l=e.indexAxis,c=e.iAxisID=r(l,a,s,o),u=e.vAxisID=r(l,s,a,o);e.xScale=this.getScaleForId(a),e.yScale=this.getScaleForId(s),e.rScale=this.getScaleForId(o),e.iScale=this.getScaleForId(c),e.vScale=this.getScaleForId(u)}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&&Fl(this._data,this),t._stacked&&Oi(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(ct(e))this._data=yp(e);else if(i!==e){if(i){Fl(i,this);const r=this._cachedMeta;Oi(r),r._parsed=[]}e&&Object.isExtensible(e)&&lg(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let r=!1;this._dataCheck();const a=e._stacked;e._stacked=vc(e.vScale,e),e.stack!==i.stack&&(r=!0,Oi(e),e.stack=i.stack),this._resyncElements(t),(r||a!==e._stacked)&&wc(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:r}=this,{iScale:a,_stacked:s}=i,o=a.axis;let l=t===0&&e===r.length?!0:i._sorted,c=t>0&&i._parsed[t-1],u,d,f;if(this._parsing===!1)i._parsed=r,i._sorted=!0,f=r;else{yt(r[t])?f=this.parseArrayData(i,r,t,e):ct(r[t])?f=this.parseObjectData(i,r,t,e):f=this.parsePrimitiveData(i,r,t,e);const g=()=>d[o]===null||c&&d[o]<c[o];for(u=0;u<e;++u)i._parsed[u+t]=d=f[u],l&&(g()&&(l=!1),c=d);i._sorted=l}s&&wc(this,f)}parsePrimitiveData(t,e,i,r){const{iScale:a,vScale:s}=t,o=a.axis,l=s.axis,c=a.getLabels(),u=a===s,d=new Array(r);let f,g,p;for(f=0,g=r;f<g;++f)p=f+i,d[f]={[o]:u||a.parse(c[p],p),[l]:s.parse(e[p],p)};return d}parseArrayData(t,e,i,r){const{xScale:a,yScale:s}=t,o=new Array(r);let l,c,u,d;for(l=0,c=r;l<c;++l)u=l+i,d=e[u],o[l]={x:a.parse(d[0],u),y:s.parse(d[1],u)};return o}parseObjectData(t,e,i,r){const{xScale:a,yScale:s}=t,{xAxisKey:o="x",yAxisKey:l="y"}=this._parsing,c=new Array(r);let u,d,f,g;for(u=0,d=r;u<d;++u)f=u+i,g=e[f],c[u]={x:a.parse(on(g,o),f),y:s.parse(on(g,l),f)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const r=this.chart,a=this._cachedMeta,s=e[t.axis],o={keys:yc(r,!0),values:e._stacks[t.axis]._visualValues};return bc(o,s,a.index,{mode:i})}updateRangeFromParsed(t,e,i,r){const a=i[e.axis];let s=a===null?NaN:a;const o=r&&i._stacks[e.axis];r&&o&&(r.values=o,s=bc(r,a,this._cachedMeta.index)),t.min=Math.min(t.min,s),t.max=Math.max(t.max,s)}getMinMax(t,e){const i=this._cachedMeta,r=i._parsed,a=i._sorted&&t===i.iScale,s=r.length,o=this._getOtherScale(t),l=Tp(e,i,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=vp(o);let f,g;function p(){g=r[f];const m=g[o.axis];return!Lt(g[t.axis])||u>m||d<m}for(f=0;f<s&&!(!p()&&(this.updateRangeFromParsed(c,t,g,l),a));++f);if(a){for(f=s-1;f>=0;--f)if(!p()){this.updateRangeFromParsed(c,t,g,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let r,a,s;for(r=0,a=e.length;r<a;++r)s=e[r][t.axis],Lt(s)&&i.push(s);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,r=e.vScale,a=this.getParsed(t);return{label:i?""+i.getLabelForValue(a[i.axis]):"",value:r?""+r.getLabelForValue(a[r.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=mp(nt(this.options.clip,pp(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,r=i.data||[],a=e.chartArea,s=[],o=this._drawStart||0,l=this._drawCount||r.length-o,c=this.options.drawActiveElementsOnTop;let u;for(i.dataset&&i.dataset.draw(t,a,o,l),u=o;u<o+l;++u){const d=r[u];d.hidden||(d.active&&c?s.push(d):d.draw(t,a))}for(u=0;u<s.length;++u)s[u].draw(t,a)}getStyle(t,e){const i=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const r=this.getDataset();let a;if(t>=0&&t<this._cachedMeta.data.length){const s=this._cachedMeta.data[t];a=s.$context||(s.$context=_p(this.getContext(),t,s)),a.parsed=this.getParsed(t),a.raw=r.data[t],a.index=a.dataIndex=t}else a=this.$context||(this.$context=wp(this.chart.getContext(),this.index)),a.dataset=r,a.index=a.datasetIndex=this.index;return a.active=!!e,a.mode=i,a}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){const r=e==="active",a=this._cachedDataOpts,s=t+"-"+e,o=a[s],l=this.enableOptionSharing&&ue(i);if(o)return _c(o,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),d=r?[`${t}Hover`,"hover",t,""]:[t,""],f=c.getOptionScopes(this.getDataset(),u),g=Object.keys(Ft.elements[t]),p=()=>this.getContext(i,r,e),m=c.resolveNamedOptions(f,g,p,d);return m.$shared&&(m.$shared=l,a[s]=Object.freeze(_c(m,l))),m}_resolveAnimations(t,e,i){const r=this.chart,a=this._cachedDataOpts,s=`animation-${e}`,o=a[s];if(o)return o;let l;if(r.options.animation!==!1){const u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,e),f=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(f,this.getContext(t,i,e))}const c=new Ga(r,l&&l.animations);return l&&l._cacheable&&(a[s]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Za(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),r=this._sharedOptions,a=this.getSharedOptions(i),s=this.includeOptions(e,a)||a!==r;return this.updateSharedOptions(a,e,i),{sharedOptions:a,includeOptions:s}}updateElement(t,e,i,r){Za(r)?Object.assign(t,i):this._resolveAnimations(e,r).update(t,i)}updateSharedOptions(t,e,i){t&&!Za(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,r){t.active=r;const a=this.getStyle(e,r);this._resolveAnimations(e,i,r).update(t,{options:!r&&this.getSharedOptions(a)||a})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[o,l,c]of this._syncList)this[o](l,c);this._syncList=[];const r=i.length,a=e.length,s=Math.min(a,r);s&&this.parse(0,s),a>r?this._insertElements(r,a-r,t):a<r&&this._removeElements(a,r-a)}_insertElements(t,e,i=!0){const r=this._cachedMeta,a=r.data,s=t+e;let o;const l=c=>{for(c.length+=e,o=c.length-1;o>=s;o--)c[o]=c[o-e]};for(l(a),o=t;o<s;++o)a[o]=new this.dataElementType;this._parsing&&l(r._parsed),this.parse(t,e),i&&this.updateElements(a,t,e,"reset")}updateElements(t,e,i,r){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const r=i._parsed.splice(t,e);i._stacked&&Oi(i,r)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,r]=t;this[e](i,r)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}Y(Oe,"defaults",{}),Y(Oe,"datasetElementType",null),Y(Oe,"dataElementType",null);function Dp(n,t){if(!n._cache.$bar){const e=n.getMatchingVisibleMetas(t);let i=[];for(let r=0,a=e.length;r<a;r++)i=i.concat(e[r].controller.getAllParsedValues(n));n._cache.$bar=Ul(i.sort((r,a)=>r-a))}return n._cache.$bar}function Sp(n){const t=n.iScale,e=Dp(t,n.type);let i=t._length,r,a,s,o;const l=()=>{s===32767||s===-32768||(ue(o)&&(i=Math.min(i,Math.abs(s-o)||i)),o=s)};for(r=0,a=e.length;r<a;++r)s=t.getPixelForValue(e[r]),l();for(o=void 0,r=0,a=t.ticks.length;r<a;++r)s=t.getPixelForTick(r),l();return i}function Mp(n,t,e,i){const r=e.barThickness;let a,s;return it(r)?(a=t.min*e.categoryPercentage,s=e.barPercentage):(a=r*i,s=1),{chunk:a/i,ratio:s,start:t.pixels[n]-a/2}}function Cp(n,t,e,i){const r=t.pixels,a=r[n];let s=n>0?r[n-1]:null,o=n<r.length-1?r[n+1]:null;const l=e.categoryPercentage;s===null&&(s=a-(o===null?t.end-t.start:o-a)),o===null&&(o=a+a-s);const c=a-(a-Math.min(s,o))/2*l;return{chunk:Math.abs(o-s)/2*l/i,ratio:e.barPercentage,start:c}}function kp(n,t,e,i){const r=e.parse(n[0],i),a=e.parse(n[1],i),s=Math.min(r,a),o=Math.max(r,a);let l=s,c=o;Math.abs(s)>Math.abs(o)&&(l=o,c=s),t[e.axis]=c,t._custom={barStart:l,barEnd:c,start:r,end:a,min:s,max:o}}function Tc(n,t,e,i){return yt(n)?kp(n,t,e,i):t[e.axis]=e.parse(n,i),t}function Dc(n,t,e,i){const r=n.iScale,a=n.vScale,s=r.getLabels(),o=r===a,l=[];let c,u,d,f;for(c=e,u=e+i;c<u;++c)f=t[c],d={},d[r.axis]=o||r.parse(s[c],c),l.push(Tc(f,d,a,c));return l}function Qa(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function Op(n,t,e){return n!==0?Le(n):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function Pp(n){let t,e,i,r,a;return n.horizontal?(t=n.base>n.x,e="left",i="right"):(t=n.base<n.y,e="bottom",i="top"),t?(r="end",a="start"):(r="start",a="end"),{start:e,end:i,reverse:t,top:r,bottom:a}}function Ep(n,t,e,i){let r=t.borderSkipped;const a={};if(!r){n.borderSkipped=a;return}if(r===!0){n.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:s,end:o,reverse:l,top:c,bottom:u}=Pp(n);r==="middle"&&e&&(n.enableBorderRadius=!0,(e._top||0)===i?r=c:(e._bottom||0)===i?r=u:(a[Sc(u,s,o,l)]=!0,r=c)),a[Sc(r,s,o,l)]=!0,n.borderSkipped=a}function Sc(n,t,e,i){return i?(n=Ap(n,t,e),n=Mc(n,e,t)):n=Mc(n,t,e),n}function Ap(n,t,e){return n===t?e:n===e?t:n}function Mc(n,t,e){return n==="start"?t:n==="end"?e:n}function Rp(n,{inflateAmount:t},e){n.inflateAmount=t==="auto"?e===1?.33:0:t}class Pi extends Oe{parsePrimitiveData(t,e,i,r){return Dc(t,e,i,r)}parseArrayData(t,e,i,r){return Dc(t,e,i,r)}parseObjectData(t,e,i,r){const{iScale:a,vScale:s}=t,{xAxisKey:o="x",yAxisKey:l="y"}=this._parsing,c=a.axis==="x"?o:l,u=s.axis==="x"?o:l,d=[];let f,g,p,m;for(f=i,g=i+r;f<g;++f)m=e[f],p={},p[a.axis]=a.parse(on(m,c),f),d.push(Tc(on(m,u),p,s,f));return d}updateRangeFromParsed(t,e,i,r){super.updateRangeFromParsed(t,e,i,r);const a=i._custom;a&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,a.min),t.max=Math.max(t.max,a.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:i,vScale:r}=e,a=this.getParsed(t),s=a._custom,o=Qa(s)?"["+s.start+", "+s.end+"]":""+r.getLabelForValue(a[r.axis]);return{label:""+i.getLabelForValue(a[i.axis]),value:o}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,i,r){const a=r==="reset",{index:s,_cachedMeta:{vScale:o}}=this,l=o.getBasePixel(),c=o.isHorizontal(),u=this._getRuler(),{sharedOptions:d,includeOptions:f}=this._getSharedOptions(e,r);for(let g=e;g<e+i;g++){const p=this.getParsed(g),m=a||it(p[o.axis])?{base:l,head:l}:this._calculateBarValuePixels(g),y=this._calculateBarIndexPixels(g,u),v=(p._stacks||{})[o.axis],x={horizontal:c,base:m.base,enableBorderRadius:!v||Qa(p._custom)||s===v._top||s===v._bottom,x:c?m.head:y.center,y:c?y.center:m.head,height:c?y.size:Math.abs(m.size),width:c?Math.abs(m.size):y.size};f&&(x.options=d||this.resolveDataElementOptions(g,t[g].active?"active":r));const w=x.options||t[g].options;Ep(x,w,v,s),Rp(x,w,u.ratio),this.updateElement(t[g],g,x,r)}}_getStacks(t,e){const{iScale:i}=this._cachedMeta,r=i.getMatchingVisibleMetas(this._type).filter(l=>l.controller.options.grouped),a=i.options.stacked,s=[],o=l=>{const c=l.controller.getParsed(e),u=c&&c[l.vScale.axis];if(it(u)||isNaN(u))return!0};for(const l of r)if(!(e!==void 0&&o(l))&&((a===!1||s.indexOf(l.stack)===-1||a===void 0&&l.stack===void 0)&&s.push(l.stack),l.index===t))break;return s.length||s.push(void 0),s}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){const r=this._getStacks(t,i),a=e!==void 0?r.indexOf(e):-1;return a===-1?r.length-1:a}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,r=[];let a,s;for(a=0,s=e.data.length;a<s;++a)r.push(i.getPixelForValue(this.getParsed(a)[i.axis],a));const o=t.barThickness;return{min:o||Sp(e),pixels:r,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:o?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i,index:r},options:{base:a,minBarLength:s}}=this,o=a||0,l=this.getParsed(t),c=l._custom,u=Qa(c);let d=l[e.axis],f=0,g=i?this.applyStack(e,l,i):d,p,m;g!==d&&(f=g-d,g=d),u&&(d=c.barStart,g=c.barEnd-c.barStart,d!==0&&Le(d)!==Le(c.barEnd)&&(f=0),f+=d);const y=!it(a)&&!u?a:f;let v=e.getPixelForValue(y);if(this.chart.getDataVisibility(t)?p=e.getPixelForValue(f+g):p=v,m=p-v,Math.abs(m)<s){m=Op(m,e,o)*s,d===o&&(v-=m/2);const x=e.getPixelForDecimal(0),w=e.getPixelForDecimal(1),_=Math.min(x,w),S=Math.max(x,w);v=Math.max(Math.min(v,S),_),p=v+m,i&&!u&&(l._stacks[e.axis]._visualValues[r]=e.getValueForPixel(p)-e.getValueForPixel(v))}if(v===e.getPixelForValue(o)){const x=Le(m)*e.getLineWidthForValue(o)/2;v+=x,m-=x}return{size:m,base:v,head:p,center:p+m/2}}_calculateBarIndexPixels(t,e){const i=e.scale,r=this.options,a=r.skipNull,s=nt(r.maxBarThickness,1/0);let o,l;if(e.grouped){const c=a?this._getStackCount(t):e.stackCount,u=r.barThickness==="flex"?Cp(t,e,r,c):Mp(t,e,r,c),d=this._getStackIndex(this.index,this._cachedMeta.stack,a?t:void 0);o=u.start+u.chunk*d+u.chunk/2,l=Math.min(s,u.chunk*u.ratio)}else o=i.getPixelForValue(this.getParsed(t)[i.axis],t),l=Math.min(s,e.min*e.ratio);return{base:o-l/2,head:o+l/2,center:o,size:l}}draw(){const t=this._cachedMeta,e=t.vScale,i=t.data,r=i.length;let a=0;for(;a<r;++a)this.getParsed(a)[e.axis]!==null&&i[a].draw(this._ctx)}}Y(Pi,"id","bar"),Y(Pi,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),Y(Pi,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class Sr extends Oe{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,i,r){const a=super.parsePrimitiveData(t,e,i,r);for(let s=0;s<a.length;s++)a[s]._custom=this.resolveDataElementOptions(s+i).radius;return a}parseArrayData(t,e,i,r){const a=super.parseArrayData(t,e,i,r);for(let s=0;s<a.length;s++){const o=e[i+s];a[s]._custom=nt(o[2],this.resolveDataElementOptions(s+i).radius)}return a}parseObjectData(t,e,i,r){const a=super.parseObjectData(t,e,i,r);for(let s=0;s<a.length;s++){const o=e[i+s];a[s]._custom=nt(o&&o.r&&+o.r,this.resolveDataElementOptions(s+i).radius)}return a}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let i=t.length-1;i>=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:r,yScale:a}=e,s=this.getParsed(t),o=r.getLabelForValue(s.x),l=a.getLabelForValue(s.y),c=s._custom;return{label:i[t]||"",value:"("+o+", "+l+(c?", "+c:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,r){const a=r==="reset",{iScale:s,vScale:o}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(e,r),u=s.axis,d=o.axis;for(let f=e;f<e+i;f++){const g=t[f],p=!a&&this.getParsed(f),m={},y=m[u]=a?s.getPixelForDecimal(.5):s.getPixelForValue(p[u]),v=m[d]=a?o.getBasePixel():o.getPixelForValue(p[d]);m.skip=isNaN(y)||isNaN(v),c&&(m.options=l||this.resolveDataElementOptions(f,g.active?"active":r),a&&(m.options.radius=0)),this.updateElement(g,f,m,r)}}resolveDataElementOptions(t,e){const i=this.getParsed(t);let r=super.resolveDataElementOptions(t,e);r.$shared&&(r=Object.assign({},r,{$shared:!1}));const a=r.radius;return e!=="active"&&(r.radius=0),r.radius+=nt(i&&i._custom,a),r}}Y(Sr,"id","bubble"),Y(Sr,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),Y(Sr,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function Lp(n,t,e){let i=1,r=1,a=0,s=0;if(t<kt){const o=n,l=o+t,c=Math.cos(o),u=Math.sin(o),d=Math.cos(l),f=Math.sin(l),g=(w,_,S)=>_i(w,o,l,!0)?1:Math.max(_,_*e,S,S*e),p=(w,_,S)=>_i(w,o,l,!0)?-1:Math.min(_,_*e,S,S*e),m=g(0,c,d),y=g(Pt,u,f),v=p(dt,c,d),x=p(dt+Pt,u,f);i=(m-v)/2,r=(y-x)/2,a=-(m+v)/2,s=-(y+x)/2}return{ratioX:i,ratioY:r,offsetX:a,offsetY:s}}class hn extends Oe{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,r=this._cachedMeta;if(this._parsing===!1)r._parsed=i;else{let a=l=>+i[l];if(ct(i[t])){const{key:l="value"}=this._parsing;a=c=>+on(i[c],l)}let s,o;for(s=t,o=t+e;s<o;++s)r._parsed[s]=a(s)}}_getRotation(){return qt(this.options.rotation-90)}_getCircumference(){return qt(this.options.circumference)}_getRotationExtents(){let t=kt,e=-kt;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const r=this.chart.getDatasetMeta(i).controller,a=r._getRotation(),s=r._getCircumference();t=Math.min(t,a),e=Math.max(e,a+s)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:i}=e,r=this._cachedMeta,a=r.data,s=this.getMaxBorderWidth()+this.getMaxOffset(a)+this.options.spacing,o=Math.max((Math.min(i.width,i.height)-s)/2,0),l=Math.min(Gh(this.options.cutout,o),1),c=this._getRingWeight(this.index),{circumference:u,rotation:d}=this._getRotationExtents(),{ratioX:f,ratioY:g,offsetX:p,offsetY:m}=Lp(d,u,l),y=(i.width-s)/f,v=(i.height-s)/g,x=Math.max(Math.min(y,v)/2,0),w=kl(this.options.radius,x),_=Math.max(w*l,0),S=(w-_)/this._getVisibleDatasetWeightTotal();this.offsetX=p*w,this.offsetY=m*w,r.total=this.calculateTotal(),this.outerRadius=w-S*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-S*c,0),this.updateElements(a,0,a.length,t)}_circumference(t,e){const i=this.options,r=this._cachedMeta,a=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||r._parsed[t]===null||r.data[t].hidden?0:this.calculateCircumference(r._parsed[t]*a/kt)}updateElements(t,e,i,r){const a=r==="reset",s=this.chart,o=s.chartArea,c=s.options.animation,u=(o.left+o.right)/2,d=(o.top+o.bottom)/2,f=a&&c.animateScale,g=f?0:this.innerRadius,p=f?0:this.outerRadius,{sharedOptions:m,includeOptions:y}=this._getSharedOptions(e,r);let v=this._getRotation(),x;for(x=0;x<e;++x)v+=this._circumference(x,a);for(x=e;x<e+i;++x){const w=this._circumference(x,a),_=t[x],S={x:u+this.offsetX,y:d+this.offsetY,startAngle:v,endAngle:v+w,circumference:w,outerRadius:p,innerRadius:g};y&&(S.options=m||this.resolveDataElementOptions(x,_.active?"active":r)),v+=w,this.updateElement(_,x,S,r)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let i=0,r;for(r=0;r<e.length;r++){const a=t._parsed[r];a!==null&&!isNaN(a)&&this.chart.getDataVisibility(r)&&!e[r].hidden&&(i+=Math.abs(a))}return i}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?kt*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,r=i.data.labels||[],a=Di(e._parsed[t],i.options.locale);return{label:r[t]||"",value:a}}getMaxBorderWidth(t){let e=0;const i=this.chart;let r,a,s,o,l;if(!t){for(r=0,a=i.data.datasets.length;r<a;++r)if(i.isDatasetVisible(r)){s=i.getDatasetMeta(r),t=s.data,o=s.controller;break}}if(!t)return 0;for(r=0,a=t.length;r<a;++r)l=o.resolveDataElementOptions(r),l.borderAlign!=="inner"&&(e=Math.max(e,l.borderWidth||0,l.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let i=0,r=t.length;i<r;++i){const a=this.resolveDataElementOptions(i);e=Math.max(e,a.offset||0,a.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));return e}_getRingWeight(t){return Math.max(nt(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}Y(hn,"id","doughnut"),Y(hn,"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"}),Y(hn,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),Y(hn,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:r}}=t.legend.options;return e.labels.map((a,s)=>{const l=t.getDatasetMeta(0).controller.getStyle(s);return{text:a,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:r,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(s),index:s}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}});class Ei extends Oe{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:r=[],_dataset:a}=e,s=this.chart._animationsDisabled;let{start:o,count:l}=Yl(e,r,s);this._drawStart=o,this._drawCount=l,zl(e)&&(o=0,l=r.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!a._decimated,i.points=r;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(i,void 0,{animated:!s,options:c},t),this.updateElements(r,o,l,t)}updateElements(t,e,i,r){const a=r==="reset",{iScale:s,vScale:o,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(e,r),f=s.axis,g=o.axis,{spanGaps:p,segment:m}=this.options,y=cn(p)?p:Number.POSITIVE_INFINITY,v=this.chart._animationsDisabled||a||r==="none",x=e+i,w=t.length;let _=e>0&&this.getParsed(e-1);for(let S=0;S<w;++S){const C=t[S],k=v?C:{};if(S<e||S>=x){k.skip=!0;continue}const T=this.getParsed(S),D=it(T[g]),O=k[f]=s.getPixelForValue(T[f],S),A=k[g]=a||D?o.getBasePixel():o.getPixelForValue(l?this.applyStack(o,T,l):T[g],S);k.skip=isNaN(O)||isNaN(A)||D,k.stop=S>0&&Math.abs(T[f]-_[f])>y,m&&(k.parsed=T,k.raw=c.data[S]),d&&(k.options=u||this.resolveDataElementOptions(S,C.active?"active":r)),v||this.updateElement(C,S,k,r),_=T}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,r=t.data||[];if(!r.length)return i;const a=r[0].size(this.resolveDataElementOptions(0)),s=r[r.length-1].size(this.resolveDataElementOptions(r.length-1));return Math.max(i,a,s)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}Y(Ei,"id","line"),Y(Ei,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),Y(Ei,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Ai extends Oe{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,r=i.data.labels||[],a=Di(e._parsed[t].r,i.options.locale);return{label:r[t]||"",value:a}}parseObjectData(t,e,i,r){return ic.bind(this)(t,e,i,r)}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((i,r)=>{const a=this.getParsed(r).r;!isNaN(a)&&this.chart.getDataVisibility(r)&&(a<e.min&&(e.min=a),a>e.max&&(e.max=a))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,r=Math.min(e.right-e.left,e.bottom-e.top),a=Math.max(r/2,0),s=Math.max(i.cutoutPercentage?a/100*i.cutoutPercentage:1,0),o=(a-s)/t.getVisibleDatasetCount();this.outerRadius=a-o*this.index,this.innerRadius=this.outerRadius-o}updateElements(t,e,i,r){const a=r==="reset",s=this.chart,l=s.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,d=c.yCenter,f=c.getIndexAngle(0)-.5*dt;let g=f,p;const m=360/this.countVisibleElements();for(p=0;p<e;++p)g+=this._computeAngle(p,r,m);for(p=e;p<e+i;p++){const y=t[p];let v=g,x=g+this._computeAngle(p,r,m),w=s.getDataVisibility(p)?c.getDistanceFromCenterForValue(this.getParsed(p).r):0;g=x,a&&(l.animateScale&&(w=0),l.animateRotate&&(v=x=f));const _={x:u,y:d,innerRadius:0,outerRadius:w,startAngle:v,endAngle:x,options:this.resolveDataElementOptions(p,y.active?"active":r)};this.updateElement(y,p,_,r)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((i,r)=>{!isNaN(this.getParsed(r).r)&&this.chart.getDataVisibility(r)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?qt(this.resolveDataElementOptions(t,e).angle||i):0}}Y(Ai,"id","polarArea"),Y(Ai,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),Y(Ai,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:r}}=t.legend.options;return e.labels.map((a,s)=>{const l=t.getDatasetMeta(0).controller.getStyle(s);return{text:a,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:r,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(s),index:s}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class Ja extends hn{}Y(Ja,"id","pie"),Y(Ja,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class Mr extends Oe{getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,r){return ic.bind(this)(t,e,i,r)}update(t){const e=this._cachedMeta,i=e.dataset,r=e.data||[],a=e.iScale.getLabels();if(i.points=r,t!=="resize"){const s=this.resolveDatasetElementOptions(t);this.options.showLine||(s.borderWidth=0);const o={_loop:!0,_fullLoop:a.length===r.length,options:s};this.updateElement(i,void 0,o,t)}this.updateElements(r,0,r.length,t)}updateElements(t,e,i,r){const a=this._cachedMeta.rScale,s=r==="reset";for(let o=e;o<e+i;o++){const l=t[o],c=this.resolveDataElementOptions(o,l.active?"active":r),u=a.getPointPositionForValue(o,this.getParsed(o).r),d=s?a.xCenter:u.x,f=s?a.yCenter:u.y,g={x:d,y:f,angle:u.angle,skip:isNaN(d)||isNaN(f),options:c};this.updateElement(l,o,g,r)}}}Y(Mr,"id","radar"),Y(Mr,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),Y(Mr,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class Cr extends Oe{getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:r,yScale:a}=e,s=this.getParsed(t),o=r.getLabelForValue(s.x),l=a.getLabelForValue(s.y);return{label:i[t]||"",value:"("+o+", "+l+")"}}update(t){const e=this._cachedMeta,{data:i=[]}=e,r=this.chart._animationsDisabled;let{start:a,count:s}=Yl(e,i,r);if(this._drawStart=a,this._drawCount=s,zl(e)&&(a=0,s=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:o,_dataset:l}=e;o._chart=this.chart,o._datasetIndex=this.index,o._decimated=!!l._decimated,o.points=i;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(o,void 0,{animated:!r,options:c},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(i,a,s,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,i,r){const a=r==="reset",{iScale:s,vScale:o,_stacked:l,_dataset:c}=this._cachedMeta,u=this.resolveDataElementOptions(e,r),d=this.getSharedOptions(u),f=this.includeOptions(r,d),g=s.axis,p=o.axis,{spanGaps:m,segment:y}=this.options,v=cn(m)?m:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||a||r==="none";let w=e>0&&this.getParsed(e-1);for(let _=e;_<e+i;++_){const S=t[_],C=this.getParsed(_),k=x?S:{},T=it(C[p]),D=k[g]=s.getPixelForValue(C[g],_),O=k[p]=a||T?o.getBasePixel():o.getPixelForValue(l?this.applyStack(o,C,l):C[p],_);k.skip=isNaN(D)||isNaN(O)||T,k.stop=_>0&&Math.abs(C[g]-w[g])>v,y&&(k.parsed=C,k.raw=c.data[_]),f&&(k.options=d||this.resolveDataElementOptions(_,S.active?"active":r)),x||this.updateElement(S,_,k,r),w=C}this.updateSharedOptions(d,r,u)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let o=0;for(let l=e.length-1;l>=0;--l)o=Math.max(o,e[l].size(this.resolveDataElementOptions(l))/2);return o>0&&o}const i=t.dataset,r=i.options&&i.options.borderWidth||0;if(!e.length)return r;const a=e[0].size(this.resolveDataElementOptions(0)),s=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(r,a,s)/2}}Y(Cr,"id","scatter"),Y(Cr,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),Y(Cr,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var Ip=Object.freeze({__proto__:null,BarController:Pi,BubbleController:Sr,DoughnutController:hn,LineController:Ei,PieController:Ja,PolarAreaController:Ai,RadarController:Mr,ScatterController:Cr});function An(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class ts{constructor(t){Y(this,"options");this.options=t||{}}static override(t){Object.assign(ts.prototype,t)}init(){}formats(){return An()}parse(){return An()}format(){return An()}add(){return An()}diff(){return An()}startOf(){return An()}endOf(){return An()}}var Cc={_date:ts};function Np(n,t,e,i){const{controller:r,data:a,_sorted:s}=n,o=r._cachedMeta.iScale;if(o&&t===o.axis&&t!=="r"&&s&&a.length){const l=o._reversePixels?sg:je;if(i){if(r._sharedOptions){const c=a[0],u=typeof c.getRange=="function"&&c.getRange(t);if(u){const d=l(a,t,e-u),f=l(a,t,e+u);return{lo:d.lo,hi:f.hi}}}}else return l(a,t,e)}return{lo:0,hi:a.length-1}}function Ri(n,t,e,i,r){const a=n.getSortedVisibleDatasetMetas(),s=e[t];for(let o=0,l=a.length;o<l;++o){const{index:c,data:u}=a[o],{lo:d,hi:f}=Np(a[o],t,s,r);for(let g=d;g<=f;++g){const p=u[g];p.skip||i(p,c,g)}}}function Fp(n){const t=n.indexOf("x")!==-1,e=n.indexOf("y")!==-1;return function(i,r){const a=t?Math.abs(i.x-r.x):0,s=e?Math.abs(i.y-r.y):0;return Math.sqrt(Math.pow(a,2)+Math.pow(s,2))}}function es(n,t,e,i,r){const a=[];return!r&&!n.isPointInArea(t)||Ri(n,e,t,function(o,l,c){!r&&!Ve(o,n.chartArea,0)||o.inRange(t.x,t.y,i)&&a.push({element:o,datasetIndex:l,index:c})},!0),a}function Up(n,t,e,i){let r=[];function a(s,o,l){const{startAngle:c,endAngle:u}=s.getProps(["startAngle","endAngle"],i),{angle:d}=Il(s,{x:t.x,y:t.y});_i(d,c,u)&&r.push({element:s,datasetIndex:o,index:l})}return Ri(n,e,t,a),r}function Bp(n,t,e,i,r,a){let s=[];const o=Fp(e);let l=Number.POSITIVE_INFINITY;function c(u,d,f){const g=u.inRange(t.x,t.y,r);if(i&&!g)return;const p=u.getCenterPoint(r);if(!(!!a||n.isPointInArea(p))&&!g)return;const y=o(t,p);y<l?(s=[{element:u,datasetIndex:d,index:f}],l=y):y===l&&s.push({element:u,datasetIndex:d,index:f})}return Ri(n,e,t,c),s}function ns(n,t,e,i,r,a){return!a&&!n.isPointInArea(t)?[]:e==="r"&&!i?Up(n,t,e,r):Bp(n,t,e,i,r,a)}function kc(n,t,e,i,r){const a=[],s=e==="x"?"inXRange":"inYRange";let o=!1;return Ri(n,e,t,(l,c,u)=>{l[s](t[e],r)&&(a.push({element:l,datasetIndex:c,index:u}),o=o||l.inRange(t.x,t.y,r))}),i&&!o?[]:a}var is={evaluateInteractionItems:Ri,modes:{index(n,t,e,i){const r=fn(t,n),a=e.axis||"x",s=e.includeInvisible||!1,o=e.intersect?es(n,r,a,i,s):ns(n,r,a,!1,i,s),l=[];return o.length?(n.getSortedVisibleDatasetMetas().forEach(c=>{const u=o[0].index,d=c.data[u];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:u})}),l):[]},dataset(n,t,e,i){const r=fn(t,n),a=e.axis||"xy",s=e.includeInvisible||!1;let o=e.intersect?es(n,r,a,i,s):ns(n,r,a,!1,i,s);if(o.length>0){const l=o[0].datasetIndex,c=n.getDatasetMeta(l).data;o=[];for(let u=0;u<c.length;++u)o.push({element:c[u],datasetIndex:l,index:u})}return o},point(n,t,e,i){const r=fn(t,n),a=e.axis||"xy",s=e.includeInvisible||!1;return es(n,r,a,i,s)},nearest(n,t,e,i){const r=fn(t,n),a=e.axis||"xy",s=e.includeInvisible||!1;return ns(n,r,a,e.intersect,i,s)},x(n,t,e,i){const r=fn(t,n);return kc(n,r,"x",e.intersect,i)},y(n,t,e,i){const r=fn(t,n);return kc(n,r,"y",e.intersect,i)}}};const Oc=["left","top","right","bottom"];function Li(n,t){return n.filter(e=>e.pos===t)}function Pc(n,t){return n.filter(e=>Oc.indexOf(e.pos)===-1&&e.box.axis===t)}function Ii(n,t){return n.sort((e,i)=>{const r=t?i:e,a=t?e:i;return r.weight===a.weight?r.index-a.index:r.weight-a.weight})}function Wp(n){const t=[];let e,i,r,a,s,o;for(e=0,i=(n||[]).length;e<i;++e)r=n[e],{position:a,options:{stack:s,stackWeight:o=1}}=r,t.push({index:e,box:r,pos:a,horizontal:r.isHorizontal(),weight:r.weight,stack:s&&a+s,stackWeight:o});return t}function Yp(n){const t={};for(const e of n){const{stack:i,pos:r,stackWeight:a}=e;if(!i||!Oc.includes(r))continue;const s=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});s.count++,s.weight+=a}return t}function zp(n,t){const e=Yp(n),{vBoxMaxWidth:i,hBoxMaxHeight:r}=t;let a,s,o;for(a=0,s=n.length;a<s;++a){o=n[a];const{fullSize:l}=o.box,c=e[o.stack],u=c&&o.stackWeight/c.weight;o.horizontal?(o.width=u?u*i:l&&t.availableWidth,o.height=r):(o.width=i,o.height=u?u*r:l&&t.availableHeight)}return e}function Hp(n){const t=Wp(n),e=Ii(t.filter(c=>c.box.fullSize),!0),i=Ii(Li(t,"left"),!0),r=Ii(Li(t,"right")),a=Ii(Li(t,"top"),!0),s=Ii(Li(t,"bottom")),o=Pc(t,"x"),l=Pc(t,"y");return{fullSize:e,leftAndTop:i.concat(a),rightAndBottom:r.concat(l).concat(s).concat(o),chartArea:Li(t,"chartArea"),vertical:i.concat(r).concat(l),horizontal:a.concat(s).concat(o)}}function Ec(n,t,e,i){return Math.max(n[e],t[e])+Math.max(n[i],t[i])}function Ac(n,t){n.top=Math.max(n.top,t.top),n.left=Math.max(n.left,t.left),n.bottom=Math.max(n.bottom,t.bottom),n.right=Math.max(n.right,t.right)}function $p(n,t,e,i){const{pos:r,box:a}=e,s=n.maxPadding;if(!ct(r)){e.size&&(n[r]-=e.size);const d=i[e.stack]||{size:0,count:1};d.size=Math.max(d.size,e.horizontal?a.height:a.width),e.size=d.size/d.count,n[r]+=e.size}a.getPadding&&Ac(s,a.getPadding());const o=Math.max(0,t.outerWidth-Ec(s,n,"left","right")),l=Math.max(0,t.outerHeight-Ec(s,n,"top","bottom")),c=o!==n.w,u=l!==n.h;return n.w=o,n.h=l,e.horizontal?{same:c,other:u}:{same:u,other:c}}function jp(n){const t=n.maxPadding;function e(i){const r=Math.max(t[i]-n[i],0);return n[i]+=r,r}n.y+=e("top"),n.x+=e("left"),e("right"),e("bottom")}function Vp(n,t){const e=t.maxPadding;function i(r){const a={left:0,top:0,right:0,bottom:0};return r.forEach(s=>{a[s]=Math.max(t[s],e[s])}),a}return i(n?["left","right"]:["top","bottom"])}function Ni(n,t,e,i){const r=[];let a,s,o,l,c,u;for(a=0,s=n.length,c=0;a<s;++a){o=n[a],l=o.box,l.update(o.width||t.w,o.height||t.h,Vp(o.horizontal,t));const{same:d,other:f}=$p(t,e,o,i);c|=d&&r.length,u=u||f,l.fullSize||r.push(o)}return c&&Ni(r,t,e,i)||u}function kr(n,t,e,i,r){n.top=e,n.left=t,n.right=t+i,n.bottom=e+r,n.width=i,n.height=r}function Rc(n,t,e,i){const r=e.padding;let{x:a,y:s}=t;for(const o of n){const l=o.box,c=i[o.stack]||{count:1,placed:0,weight:1},u=o.stackWeight/c.weight||1;if(o.horizontal){const d=t.w*u,f=c.size||l.height;ue(c.start)&&(s=c.start),l.fullSize?kr(l,r.left,s,e.outerWidth-r.right-r.left,f):kr(l,t.left+c.placed,s,d,f),c.start=s,c.placed+=d,s=l.bottom}else{const d=t.h*u,f=c.size||l.width;ue(c.start)&&(a=c.start),l.fullSize?kr(l,a,r.top,f,e.outerHeight-r.bottom-r.top):kr(l,a,t.top+c.placed,f,d),c.start=a,c.placed+=d,a=l.right}}t.x=a,t.y=s}var re={addBox(n,t){n.boxes||(n.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)}}]},n.boxes.push(t)},removeBox(n,t){const e=n.boxes?n.boxes.indexOf(t):-1;e!==-1&&n.boxes.splice(e,1)},configure(n,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(n,t,e,i){if(!n)return;const r=Xt(n.options.layout.padding),a=Math.max(t-r.width,0),s=Math.max(e-r.height,0),o=Hp(n.boxes),l=o.vertical,c=o.horizontal;wt(n.boxes,m=>{typeof m.beforeLayout=="function"&&m.beforeLayout()});const u=l.reduce((m,y)=>y.box.options&&y.box.options.display===!1?m:m+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:e,padding:r,availableWidth:a,availableHeight:s,vBoxMaxWidth:a/2/u,hBoxMaxHeight:s/2}),f=Object.assign({},r);Ac(f,Xt(i));const g=Object.assign({maxPadding:f,w:a,h:s,x:r.left,y:r.top},r),p=zp(l.concat(c),d);Ni(o.fullSize,g,d,p),Ni(l,g,d,p),Ni(c,g,d,p)&&Ni(l,g,d,p),jp(g),Rc(o.leftAndTop,g,d,p),g.x+=g.w,g.y+=g.h,Rc(o.rightAndBottom,g,d,p),n.chartArea={left:g.left,top:g.top,right:g.left+g.w,bottom:g.top+g.h,height:g.h,width:g.w},wt(o.chartArea,m=>{const y=m.box;Object.assign(y,n.chartArea),y.update(g.w,g.h,{left:0,top:0,right:0,bottom:0})})}};class Lc{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,r){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,r?Math.floor(e/r):i)}}isAttached(t){return!0}updateConfig(t){}}class qp extends Lc{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Or="$chartjs",Xp={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Ic=n=>n===null||n==="";function Gp(n,t){const e=n.style,i=n.getAttribute("height"),r=n.getAttribute("width");if(n[Or]={initial:{height:i,width:r,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",Ic(r)){const a=sc(n,"width");a!==void 0&&(n.width=a)}if(Ic(i))if(n.style.height==="")n.height=n.width/(t||2);else{const a=sc(n,"height");a!==void 0&&(n.height=a)}return n}const Nc=Jg?{passive:!0}:!1;function Kp(n,t,e){n.addEventListener(t,e,Nc)}function Zp(n,t,e){n.canvas.removeEventListener(t,e,Nc)}function Qp(n,t){const e=Xp[n.type]||n.type,{x:i,y:r}=fn(n,t);return{type:e,chart:t,native:n,x:i!==void 0?i:null,y:r!==void 0?r:null}}function Pr(n,t){for(const e of n)if(e===t||e.contains(t))return!0}function Jp(n,t,e){const i=n.canvas,r=new MutationObserver(a=>{let s=!1;for(const o of a)s=s||Pr(o.addedNodes,i),s=s&&!Pr(o.removedNodes,i);s&&e()});return r.observe(document,{childList:!0,subtree:!0}),r}function tm(n,t,e){const i=n.canvas,r=new MutationObserver(a=>{let s=!1;for(const o of a)s=s||Pr(o.removedNodes,i),s=s&&!Pr(o.addedNodes,i);s&&e()});return r.observe(document,{childList:!0,subtree:!0}),r}const Fi=new Map;let Fc=0;function Uc(){const n=window.devicePixelRatio;n!==Fc&&(Fc=n,Fi.forEach((t,e)=>{e.currentDevicePixelRatio!==n&&t()}))}function em(n,t){Fi.size||window.addEventListener("resize",Uc),Fi.set(n,t)}function nm(n){Fi.delete(n),Fi.size||window.removeEventListener("resize",Uc)}function im(n,t,e){const i=n.canvas,r=i&&Xa(i);if(!r)return;const a=Wl((o,l)=>{const c=r.clientWidth;e(o,l),c<r.clientWidth&&e()},window),s=new ResizeObserver(o=>{const l=o[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||a(c,u)});return s.observe(r),em(n,a),s}function rs(n,t,e){e&&e.disconnect(),t==="resize"&&nm(n)}function rm(n,t,e){const i=n.canvas,r=Wl(a=>{n.ctx!==null&&e(Qp(a,n))},n);return Kp(i,t,r),r}class am extends Lc{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(Gp(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[Or])return!1;const i=e[Or].initial;["height","width"].forEach(a=>{const s=i[a];it(s)?e.removeAttribute(a):e.setAttribute(a,s)});const r=i.style||{};return Object.keys(r).forEach(a=>{e.style[a]=r[a]}),e.width=e.width,delete e[Or],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const r=t.$proxies||(t.$proxies={}),s={attach:Jp,detach:tm,resize:im}[e]||rm;r[e]=s(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),r=i[e];if(!r)return;({attach:rs,detach:rs,resize:rs}[e]||Zp)(t,e,r),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,r){return Qg(t,e,i,r)}isAttached(t){const e=Xa(t);return!!(e&&e.isConnected)}}function sm(n){return!qa()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?qp:am}class te{constructor(){Y(this,"x");Y(this,"y");Y(this,"active",!1);Y(this,"options");Y(this,"$animations")}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return cn(this.x)&&cn(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const r={};return t.forEach(a=>{r[a]=i[a]&&i[a].active()?i[a]._to:this[a]}),r}}Y(te,"defaults",{}),Y(te,"defaultRoutes");function om(n,t){const e=n.options.ticks,i=lm(n),r=Math.min(e.maxTicksLimit||i,i),a=e.major.enabled?um(t):[],s=a.length,o=a[0],l=a[s-1],c=[];if(s>r)return dm(t,c,a,s/r),c;const u=cm(a,t,r);if(s>0){let d,f;const g=s>1?Math.round((l-o)/(s-1)):null;for(Er(t,c,u,it(g)?0:o-g,o),d=0,f=s-1;d<f;d++)Er(t,c,u,a[d],a[d+1]);return Er(t,c,u,l,it(g)?t.length:l+g),c}return Er(t,c,u),c}function lm(n){const t=n.options.offset,e=n._tickSize(),i=n._length/e+(t?0:1),r=n._maxLength/e;return Math.floor(Math.min(i,r))}function cm(n,t,e){const i=fm(n),r=t.length/e;if(!i)return Math.max(r,1);const a=ng(i);for(let s=0,o=a.length-1;s<o;s++){const l=a[s];if(l>r)return l}return Math.max(r,1)}function um(n){const t=[];let e,i;for(e=0,i=n.length;e<i;e++)n[e].major&&t.push(e);return t}function dm(n,t,e,i){let r=0,a=e[0],s;for(i=Math.ceil(i),s=0;s<n.length;s++)s===a&&(t.push(n[s]),r++,a=e[r*i])}function Er(n,t,e,i,r){const a=nt(i,0),s=Math.min(nt(r,n.length),n.length);let o=0,l,c,u;for(e=Math.ceil(e),r&&(l=r-i,e=l/Math.floor(l/e)),u=a;u<0;)o++,u=Math.round(a+o*e);for(c=Math.max(a,0);c<s;c++)c===u&&(t.push(n[c]),o++,u=Math.round(a+o*e))}function fm(n){const t=n.length;let e,i;if(t<2)return!1;for(i=n[0],e=1;e<t;++e)if(n[e]-n[e-1]!==i)return!1;return i}const hm=n=>n==="left"?"right":n==="right"?"left":n,Bc=(n,t,e)=>t==="top"||t==="left"?n[t]+e:n[t]-e,Wc=(n,t)=>Math.min(t||n,n);function Yc(n,t){const e=[],i=n.length/t,r=n.length;let a=0;for(;a<r;a+=i)e.push(n[Math.floor(a)]);return e}function gm(n,t,e){const i=n.ticks.length,r=Math.min(t,i-1),a=n._startPixel,s=n._endPixel,o=1e-6;let l=n.getPixelForTick(r),c;if(!(e&&(i===1?c=Math.max(l-a,s-l):t===0?c=(n.getPixelForTick(1)-l)/2:c=(l-n.getPixelForTick(r-1))/2,l+=r<t?c:-c,l<a-o||l>s+o)))return l}function pm(n,t){wt(n,e=>{const i=e.gc,r=i.length/2;let a;if(r>t){for(a=0;a<r;++a)delete e.data[i[a]];i.splice(0,r)}})}function Ui(n){return n.drawTicks?n.tickLength:0}function zc(n,t){if(!n.display)return 0;const e=Et(n.font,t),i=Xt(n.padding);return(yt(n.text)?n.text.length:1)*e.lineHeight+i.height}function mm(n,t){return dn(n,{scale:t,type:"scale"})}function ym(n,t,e){return dn(n,{tick:e,index:t,type:"tick"})}function bm(n,t,e){let i=Fa(n);return(e&&t!=="right"||!e&&t==="right")&&(i=hm(i)),i}function vm(n,t,e,i){const{top:r,left:a,bottom:s,right:o,chart:l}=n,{chartArea:c,scales:u}=l;let d=0,f,g,p;const m=s-r,y=o-a;if(n.isHorizontal()){if(g=ie(i,a,o),ct(e)){const v=Object.keys(e)[0],x=e[v];p=u[v].getPixelForValue(x)+m-t}else e==="center"?p=(c.bottom+c.top)/2+m-t:p=Bc(n,e,t);f=o-a}else{if(ct(e)){const v=Object.keys(e)[0],x=e[v];g=u[v].getPixelForValue(x)-y+t}else e==="center"?g=(c.left+c.right)/2-y+t:g=Bc(n,e,t);p=ie(i,s,r),d=e==="left"?-Pt:Pt}return{titleX:g,titleY:p,maxWidth:f,rotation:d}}class Rn extends te{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:r}=this;return t=be(t,Number.POSITIVE_INFINITY),e=be(e,Number.NEGATIVE_INFINITY),i=be(i,Number.POSITIVE_INFINITY),r=be(r,Number.NEGATIVE_INFINITY),{min:be(t,i),max:be(e,r),minDefined:Lt(t),maxDefined:Lt(e)}}getMinMax(t){let{min:e,max:i,minDefined:r,maxDefined:a}=this.getUserBounds(),s;if(r&&a)return{min:e,max:i};const o=this.getMatchingVisibleMetas();for(let l=0,c=o.length;l<c;++l)s=o[l].controller.getMinMax(this,t),r||(e=Math.min(e,s.min)),a||(i=Math.max(i,s.max));return e=a&&e>i?i:e,i=r&&e>i?e:i,{min:be(e,be(i,e)),max:be(i,be(e,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){xt(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:r,grace:a,ticks:s}=this.options,o=s.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Pg(this,a,r),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=o<this.ticks.length;this._convertTicksToLabels(l?Yc(this.ticks,o):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),s.display&&(s.autoSkip||s.source==="auto")&&(this.ticks=om(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,i;this.isHorizontal()?(e=this.left,i=this.right):(e=this.top,i=this.bottom,t=!t),this._startPixel=e,this._endPixel=i,this._reversePixels=t,this._length=i-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){xt(this.options.afterUpdate,[this])}beforeSetDimensions(){xt(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(){xt(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),xt(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){xt(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,r,a;for(i=0,r=t.length;i<r;i++)a=t[i],a.label=xt(e.callback,[a.value,i,t],this)}afterTickToLabelConversion(){xt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){xt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=Wc(this.ticks.length,t.ticks.maxTicksLimit),r=e.minRotation||0,a=e.maxRotation;let s=r,o,l,c;if(!this._isVisible()||!e.display||r>=a||i<=1||!this.isHorizontal()){this.labelRotation=r;return}const u=this._getLabelSizes(),d=u.widest.width,f=u.highest.height,g=Zt(this.chart.width-d,0,this.maxWidth);o=t.offset?this.maxWidth/i:g/(i-1),d+6>o&&(o=g/(i-(t.offset?.5:1)),l=this.maxHeight-Ui(t.grid)-e.padding-zc(t.title,this.chart.options.font),c=Math.sqrt(d*d+f*f),s=yr(Math.min(Math.asin(Zt((u.highest.height+6)/o,-1,1)),Math.asin(Zt(l/c,-1,1))-Math.asin(Zt(f/c,-1,1)))),s=Math.max(r,Math.min(a,s))),this.labelRotation=s}afterCalculateLabelRotation(){xt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){xt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:r,grid:a}}=this,s=this._isVisible(),o=this.isHorizontal();if(s){const l=zc(r,e.options.font);if(o?(t.width=this.maxWidth,t.height=Ui(a)+l):(t.height=this.maxHeight,t.width=Ui(a)+l),i.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:f}=this._getLabelSizes(),g=i.padding*2,p=qt(this.labelRotation),m=Math.cos(p),y=Math.sin(p);if(o){const v=i.mirror?0:y*d.width+m*f.height;t.height=Math.min(this.maxHeight,t.height+v+g)}else{const v=i.mirror?0:m*d.width+y*f.height;t.width=Math.min(this.maxWidth,t.width+v+g)}this._calculatePadding(c,u,y,m)}}this._handleMargins(),o?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,r){const{ticks:{align:a,padding:s},position:o}=this.options,l=this.labelRotation!==0,c=o!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,g=0;l?c?(f=r*t.width,g=i*e.height):(f=i*t.height,g=r*e.width):a==="start"?g=e.width:a==="end"?f=t.width:a!=="inner"&&(f=t.width/2,g=e.width/2),this.paddingLeft=Math.max((f-u+s)*this.width/(this.width-u),0),this.paddingRight=Math.max((g-d+s)*this.width/(this.width-d),0)}else{let u=e.height/2,d=t.height/2;a==="start"?(u=0,d=t.height):a==="end"&&(u=e.height,d=0),this.paddingTop=u+s,this.paddingBottom=d+s}}_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(){xt(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,i;for(e=0,i=t.length;e<i;e++)it(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let i=this.ticks;e<i.length&&(i=Yc(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){const{ctx:r,_longestTextCache:a}=this,s=[],o=[],l=Math.floor(e/Wc(e,i));let c=0,u=0,d,f,g,p,m,y,v,x,w,_,S;for(d=0;d<e;d+=l){if(p=t[d].label,m=this._resolveTickFontOptions(d),r.font=y=m.string,v=a[y]=a[y]||{data:{},gc:[]},x=m.lineHeight,w=_=0,!it(p)&&!yt(p))w=xr(r,v.data,v.gc,w,p),_=x;else if(yt(p))for(f=0,g=p.length;f<g;++f)S=p[f],!it(S)&&!yt(S)&&(w=xr(r,v.data,v.gc,w,S),_+=x);s.push(w),o.push(_),c=Math.max(w,c),u=Math.max(_,u)}pm(a,e);const C=s.indexOf(c),k=o.indexOf(u),T=D=>({width:s[D]||0,height:o[D]||0});return{first:T(0),last:T(e-1),widest:T(C),highest:T(k),widths:s,heights:o}}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 ag(this._alignToPixels?kn(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const i=e[t];return i.$context||(i.$context=ym(this.getContext(),t,i))}return this.$context||(this.$context=mm(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=qt(this.labelRotation),i=Math.abs(Math.cos(e)),r=Math.abs(Math.sin(e)),a=this._getLabelSizes(),s=t.autoSkipPadding||0,o=a?a.widest.width+s:0,l=a?a.highest.height+s:0;return this.isHorizontal()?l*i>o*r?o/i:l/r:l*r<o*i?l/i:o/r}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=this.chart,r=this.options,{grid:a,position:s,border:o}=r,l=a.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),f=Ui(a),g=[],p=o.setContext(this.getContext()),m=p.display?p.width:0,y=m/2,v=function(H){return kn(i,H,m)};let x,w,_,S,C,k,T,D,O,A,R,W;if(s==="top")x=v(this.bottom),k=this.bottom-f,D=x-y,A=v(t.top)+y,W=t.bottom;else if(s==="bottom")x=v(this.top),A=t.top,W=v(t.bottom)-y,k=x+y,D=this.top+f;else if(s==="left")x=v(this.right),C=this.right-f,T=x-y,O=v(t.left)+y,R=t.right;else if(s==="right")x=v(this.left),O=t.left,R=v(t.right)-y,C=x+y,T=this.left+f;else if(e==="x"){if(s==="center")x=v((t.top+t.bottom)/2+.5);else if(ct(s)){const H=Object.keys(s)[0],I=s[H];x=v(this.chart.scales[H].getPixelForValue(I))}A=t.top,W=t.bottom,k=x+y,D=k+f}else if(e==="y"){if(s==="center")x=v((t.left+t.right)/2);else if(ct(s)){const H=Object.keys(s)[0],I=s[H];x=v(this.chart.scales[H].getPixelForValue(I))}C=x-y,T=C-f,O=t.left,R=t.right}const V=nt(r.ticks.maxTicksLimit,d),L=Math.max(1,Math.ceil(d/V));for(w=0;w<d;w+=L){const H=this.getContext(w),I=a.setContext(H),et=o.setContext(H),z=I.lineWidth,Mt=I.color,F=et.dash||[],E=et.dashOffset,$=I.tickWidth,K=I.tickColor,X=I.tickBorderDash||[],Q=I.tickBorderDashOffset;_=gm(this,w,l),_!==void 0&&(S=kn(i,_,z),c?C=T=O=R=S:k=D=A=W=S,g.push({tx1:C,ty1:k,tx2:T,ty2:D,x1:O,y1:A,x2:R,y2:W,width:z,color:Mt,borderDash:F,borderDashOffset:E,tickWidth:$,tickColor:K,tickBorderDash:X,tickBorderDashOffset:Q}))}return this._ticksLength=d,this._borderValue=x,g}_computeLabelItems(t){const e=this.axis,i=this.options,{position:r,ticks:a}=i,s=this.isHorizontal(),o=this.ticks,{align:l,crossAlign:c,padding:u,mirror:d}=a,f=Ui(i.grid),g=f+u,p=d?-u:g,m=-qt(this.labelRotation),y=[];let v,x,w,_,S,C,k,T,D,O,A,R,W="middle";if(r==="top")C=this.bottom-p,k=this._getXAxisLabelAlignment();else if(r==="bottom")C=this.top+p,k=this._getXAxisLabelAlignment();else if(r==="left"){const L=this._getYAxisLabelAlignment(f);k=L.textAlign,S=L.x}else if(r==="right"){const L=this._getYAxisLabelAlignment(f);k=L.textAlign,S=L.x}else if(e==="x"){if(r==="center")C=(t.top+t.bottom)/2+g;else if(ct(r)){const L=Object.keys(r)[0],H=r[L];C=this.chart.scales[L].getPixelForValue(H)+g}k=this._getXAxisLabelAlignment()}else if(e==="y"){if(r==="center")S=(t.left+t.right)/2-g;else if(ct(r)){const L=Object.keys(r)[0],H=r[L];S=this.chart.scales[L].getPixelForValue(H)}k=this._getYAxisLabelAlignment(f).textAlign}e==="y"&&(l==="start"?W="top":l==="end"&&(W="bottom"));const V=this._getLabelSizes();for(v=0,x=o.length;v<x;++v){w=o[v],_=w.label;const L=a.setContext(this.getContext(v));T=this.getPixelForTick(v)+a.labelOffset,D=this._resolveTickFontOptions(v),O=D.lineHeight,A=yt(_)?_.length:1;const H=A/2,I=L.color,et=L.textStrokeColor,z=L.textStrokeWidth;let Mt=k;s?(S=T,k==="inner"&&(v===x-1?Mt=this.options.reverse?"left":"right":v===0?Mt=this.options.reverse?"right":"left":Mt="center"),r==="top"?c==="near"||m!==0?R=-A*O+O/2:c==="center"?R=-V.highest.height/2-H*O+O:R=-V.highest.height+O/2:c==="near"||m!==0?R=O/2:c==="center"?R=V.highest.height/2-H*O:R=V.highest.height-A*O,d&&(R*=-1),m!==0&&!L.showLabelBackdrop&&(S+=O/2*Math.sin(m))):(C=T,R=(1-A)*O/2);let F;if(L.showLabelBackdrop){const E=Xt(L.backdropPadding),$=V.heights[v],K=V.widths[v];let X=R-E.top,Q=0-E.left;switch(W){case"middle":X-=$/2;break;case"bottom":X-=$;break}switch(k){case"center":Q-=K/2;break;case"right":Q-=K;break;case"inner":v===x-1?Q-=K:v>0&&(Q-=K/2);break}F={left:Q,top:X,width:K+E.width,height:$+E.height,color:L.backdropColor}}y.push({label:_,font:D,textOffset:R,options:{rotation:m,color:I,strokeColor:et,strokeWidth:z,textAlign:Mt,textBaseline:W,translation:[S,C],backdrop:F}})}return y}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-qt(this.labelRotation))return t==="top"?"left":"right";let r="center";return e.align==="start"?r="left":e.align==="end"?r="right":e.align==="inner"&&(r="inner"),r}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:r,padding:a}}=this.options,s=this._getLabelSizes(),o=t+a,l=s.widest.width;let c,u;return e==="left"?r?(u=this.right+a,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-o,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u=this.left)):e==="right"?r?(u=this.left+a,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+o,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:r,width:a,height:s}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,r,a,s),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const r=this.ticks.findIndex(a=>a.value===t);return r>=0?e.setContext(this.getContext(r)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,r=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let a,s;const o=(l,c,u)=>{!u.width||!u.color||(i.save(),i.lineWidth=u.width,i.strokeStyle=u.color,i.setLineDash(u.borderDash||[]),i.lineDashOffset=u.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(c.x,c.y),i.stroke(),i.restore())};if(e.display)for(a=0,s=r.length;a<s;++a){const l=r[a];e.drawOnChartArea&&o({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),e.drawTicks&&o({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:i,grid:r}}=this,a=i.setContext(this.getContext()),s=i.display?a.width:0;if(!s)return;const o=r.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,u,d,f;this.isHorizontal()?(c=kn(t,this.left,s)-s/2,u=kn(t,this.right,o)+o/2,d=f=l):(d=kn(t,this.top,s)-s/2,f=kn(t,this.bottom,o)+o/2,c=u=l),e.save(),e.lineWidth=a.width,e.strokeStyle=a.color,e.beginPath(),e.moveTo(c,d),e.lineTo(u,f),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,r=this._computeLabelArea();r&&Mi(i,r);const a=this.getLabelItems(t);for(const s of a){const o=s.options,l=s.font,c=s.label,u=s.textOffset;On(i,c,0,u,l,o)}r&&Ci(i)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:r}}=this;if(!i.display)return;const a=Et(i.font),s=Xt(i.padding),o=i.align;let l=a.lineHeight/2;e==="bottom"||e==="center"||ct(e)?(l+=s.bottom,yt(i.text)&&(l+=a.lineHeight*(i.text.length-1))):l+=s.top;const{titleX:c,titleY:u,maxWidth:d,rotation:f}=vm(this,l,e,o);On(t,i.text,0,0,a,{color:i.color,maxWidth:d,rotation:f,textAlign:bm(o,e,r),textBaseline:"middle",translation:[c,u]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,i=nt(t.grid&&t.grid.z,-1),r=nt(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Rn.prototype.draw?[{z:e,draw:a=>{this.draw(a)}}]:[{z:i,draw:a=>{this.drawBackground(),this.drawGrid(a),this.drawTitle()}},{z:r,draw:()=>{this.drawBorder()}},{z:e,draw:a=>{this.drawLabels(a)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",r=[];let a,s;for(a=0,s=e.length;a<s;++a){const o=e[a];o[i]===this.id&&(!t||o.type===t)&&r.push(o)}return r}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return Et(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Ar{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let i;_m(e)&&(i=this.register(e));const r=this.items,a=t.id,s=this.scope+"."+a;if(!a)throw new Error("class does not have id: "+t);return a in r||(r[a]=t,xm(t,s,i),this.override&&Ft.override(t.id,t.overrides)),s}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,r=this.scope;i in e&&delete e[i],r&&i in Ft[r]&&(delete Ft[r][i],this.override&&delete Cn[i])}}function xm(n,t,e){const i=vi(Object.create(null),[e?Ft.get(e):{},Ft.get(t),n.defaults]);Ft.set(t,i),n.defaultRoutes&&wm(t,n.defaultRoutes),n.descriptors&&Ft.describe(t,n.descriptors)}function wm(n,t){Object.keys(t).forEach(e=>{const i=e.split("."),r=i.pop(),a=[n].concat(i).join("."),s=t[e].split("."),o=s.pop(),l=s.join(".");Ft.route(a,r,l,o)})}function _m(n){return"id"in n&&"defaults"in n}class Tm{constructor(){this.controllers=new Ar(Oe,"datasets",!0),this.elements=new Ar(te,"elements"),this.plugins=new Ar(Object,"plugins"),this.scales=new Ar(Rn,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(r=>{const a=i||this._getRegistryForType(r);i||a.isForType(r)||a===this.plugins&&r.id?this._exec(t,a,r):wt(r,s=>{const o=i||this._getRegistryForType(s);this._exec(t,o,s)})})}_exec(t,e,i){const r=La(t);xt(i["before"+r],[],i),e[t](i),xt(i["after"+r],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const r=e.get(t);if(r===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return r}}var Ie=new Tm;class Dm{constructor(){this._init=[]}notify(t,e,i,r){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const a=r?this._descriptors(t).filter(r):this._descriptors(t),s=this._notify(a,t,e,i);return e==="afterDestroy"&&(this._notify(a,t,"stop"),this._notify(this._init,t,"uninstall")),s}_notify(t,e,i,r){r=r||{};for(const a of t){const s=a.plugin,o=s[i],l=[e,r,a.options];if(xt(o,l,s)===!1&&r.cancelable)return!1}return!0}invalidate(){it(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const i=t&&t.config,r=nt(i.options&&i.options.plugins,{}),a=Sm(i);return r===!1&&!e?[]:Cm(t,a,r,e)}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,r=(a,s)=>a.filter(o=>!s.some(l=>o.plugin.id===l.plugin.id));this._notify(r(e,i),t,"stop"),this._notify(r(i,e),t,"start")}}function Sm(n){const t={},e=[],i=Object.keys(Ie.plugins.items);for(let a=0;a<i.length;a++)e.push(Ie.getPlugin(i[a]));const r=n.plugins||[];for(let a=0;a<r.length;a++){const s=r[a];e.indexOf(s)===-1&&(e.push(s),t[s.id]=!0)}return{plugins:e,localIds:t}}function Mm(n,t){return!t&&n===!1?null:n===!0?{}:n}function Cm(n,{plugins:t,localIds:e},i,r){const a=[],s=n.getContext();for(const o of t){const l=o.id,c=Mm(i[l],r);c!==null&&a.push({plugin:o,options:km(n.config,{plugin:o,local:e[l]},c,s)})}return a}function km(n,{plugin:t,local:e},i,r){const a=n.pluginScopeKeys(t),s=n.getOptionScopes(i,a);return e&&t.defaults&&s.push(t.defaults),n.createResolver(s,r,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function as(n,t){const e=Ft.datasets[n]||{};return((t.datasets||{})[n]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function Om(n,t){let e=n;return n==="_index_"?e=t:n==="_value_"&&(e=t==="x"?"y":"x"),e}function Pm(n,t){return n===t?"_index_":"_value_"}function Hc(n){if(n==="x"||n==="y"||n==="r")return n}function Em(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function ss(n,...t){if(Hc(n))return n;for(const e of t){const i=e.axis||Em(e.position)||n.length>1&&Hc(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function $c(n,t,e){if(e[t+"AxisID"]===n)return{axis:t}}function Am(n,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(i=>i.xAxisID===n||i.yAxisID===n);if(e.length)return $c(n,"x",e[0])||$c(n,"y",e[0])}return{}}function Rm(n,t){const e=Cn[n.type]||{scales:{}},i=t.scales||{},r=as(n.type,t),a=Object.create(null);return Object.keys(i).forEach(s=>{const o=i[s];if(!ct(o))return console.error(`Invalid scale configuration for scale: ${s}`);if(o._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${s}`);const l=ss(s,o,Am(s,n),Ft.scales[o.type]),c=Pm(l,r),u=e.scales||{};a[s]=xi(Object.create(null),[{axis:l},o,u[l],u[c]])}),n.data.datasets.forEach(s=>{const o=s.type||n.type,l=s.indexAxis||as(o,t),u=(Cn[o]||{}).scales||{};Object.keys(u).forEach(d=>{const f=Om(d,l),g=s[f+"AxisID"]||f;a[g]=a[g]||Object.create(null),xi(a[g],[{axis:f},i[g],u[d]])})}),Object.keys(a).forEach(s=>{const o=a[s];xi(o,[Ft.scales[o.type],Ft.scale])}),a}function jc(n){const t=n.options||(n.options={});t.plugins=nt(t.plugins,{}),t.scales=Rm(n,t)}function Vc(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function Lm(n){return n=n||{},n.data=Vc(n.data),jc(n),n}const qc=new Map,Xc=new Set;function Rr(n,t){let e=qc.get(n);return e||(e=t(),qc.set(n,e),Xc.add(e)),e}const Bi=(n,t,e)=>{const i=on(t,e);i!==void 0&&n.add(i)};class Im{constructor(t){this._config=Lm(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=Vc(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(),jc(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Rr(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return Rr(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return Rr(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,i=this.type;return Rr(`${i}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let r=i.get(t);return(!r||e)&&(r=new Map,i.set(t,r)),r}getOptionScopes(t,e,i){const{options:r,type:a}=this,s=this._cachedScopes(t,i),o=s.get(e);if(o)return o;const l=new Set;e.forEach(u=>{t&&(l.add(t),u.forEach(d=>Bi(l,t,d))),u.forEach(d=>Bi(l,r,d)),u.forEach(d=>Bi(l,Cn[a]||{},d)),u.forEach(d=>Bi(l,Ft,d)),u.forEach(d=>Bi(l,Wa,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Xc.has(e)&&s.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,Cn[e]||{},Ft.datasets[e]||{},{type:e},Ft,Wa]}resolveNamedOptions(t,e,i,r=[""]){const a={$shared:!0},{resolver:s,subPrefixes:o}=Gc(this._resolverCache,t,r);let l=s;if(Fm(s,e)){a.$shared=!1,i=de(i)?i():i;const c=this.createResolver(t,i,o);l=Zn(s,i,c)}for(const c of e)a[c]=l[c];return a}createResolver(t,e,i=[""],r){const{resolver:a}=Gc(this._resolverCache,t,i);return ct(e)?Zn(a,e,void 0,r):a}}function Gc(n,t,e){let i=n.get(t);i||(i=new Map,n.set(t,i));const r=e.join();let a=i.get(r);return a||(a={resolver:$a(t,e),subPrefixes:e.filter(o=>!o.toLowerCase().includes("hover"))},i.set(r,a)),a}const Nm=n=>ct(n)&&Object.getOwnPropertyNames(n).some(t=>de(n[t]));function Fm(n,t){const{isScriptable:e,isIndexable:i}=Zl(n);for(const r of t){const a=e(r),s=i(r),o=(s||a)&&n[r];if(a&&(de(o)||Nm(o))||s&&yt(o))return!0}return!1}var Um="4.4.1";const Bm=["top","bottom","left","right","chartArea"];function Kc(n,t){return n==="top"||n==="bottom"||Bm.indexOf(n)===-1&&t==="x"}function Zc(n,t){return function(e,i){return e[n]===i[n]?e[t]-i[t]:e[n]-i[n]}}function Qc(n){const t=n.chart,e=t.options.animation;t.notifyPlugins("afterRender"),xt(e&&e.onComplete,[n],t)}function Wm(n){const t=n.chart,e=t.options.animation;xt(e&&e.onProgress,[n],t)}function Jc(n){return qa()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const Lr={},tu=n=>{const t=Jc(n);return Object.values(Lr).filter(e=>e.canvas===t).pop()};function Ym(n,t,e){const i=Object.keys(n);for(const r of i){const a=+r;if(a>=t){const s=n[r];delete n[r],(e>0||a>t)&&(n[a+e]=s)}}}function zm(n,t,e,i){return!e||n.type==="mouseout"?null:i?t:n}function Ir(n,t,e){return n.options.clip?n[e]:t[e]}function Hm(n,t){const{xScale:e,yScale:i}=n;return e&&i?{left:Ir(e,t,"left"),right:Ir(e,t,"right"),top:Ir(i,t,"top"),bottom:Ir(i,t,"bottom")}:t}let Te=(Tn=class{static register(...t){Ie.add(...t),eu()}static unregister(...t){Ie.remove(...t),eu()}constructor(t,e){const i=this.config=new Im(e),r=Jc(t),a=tu(r);if(a)throw new Error("Canvas is already in use. Chart with ID '"+a.id+"' must be destroyed before the canvas with ID '"+a.canvas.id+"' can be reused.");const s=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||sm(r)),this.platform.updateConfig(i);const o=this.platform.acquireContext(r,s.aspectRatio),l=o&&o.canvas,c=l&&l.height,u=l&&l.width;if(this.id=Xh(),this.ctx=o,this.canvas=l,this.width=u,this.height=c,this._options=s,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 Dm,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=cg(d=>this.update(d),s.resizeDelay||0),this._dataChanges=[],Lr[this.id]=this,!o||!l){console.error("Failed to create chart: can't acquire context from the given item");return}qe.listen(this,"complete",Qc),qe.listen(this,"progress",Wm),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:r,_aspectRatio:a}=this;return it(t)?e&&a?a:r?i/r: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 Ie}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():ac(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Xl(this.canvas,this.ctx),this}stop(){return qe.stop(this),this}resize(t,e){qe.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,r=this.canvas,a=i.maintainAspectRatio&&this.aspectRatio,s=this.platform.getMaximumSize(r,t,e,a),o=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=s.width,this.height=s.height,this._aspectRatio=this.aspectRatio,ac(this,o,!0)&&(this.notifyPlugins("resize",{size:s}),xt(i.onResize,[this,s],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};wt(e,(i,r)=>{i.id=r})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,r=Object.keys(i).reduce((s,o)=>(s[o]=!1,s),{});let a=[];e&&(a=a.concat(Object.keys(e).map(s=>{const o=e[s],l=ss(s,o),c=l==="r",u=l==="x";return{options:o,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),wt(a,s=>{const o=s.options,l=o.id,c=ss(l,o),u=nt(o.type,s.dtype);(o.position===void 0||Kc(o.position,c)!==Kc(s.dposition))&&(o.position=s.dposition),r[l]=!0;let d=null;if(l in i&&i[l].type===u)d=i[l];else{const f=Ie.getScale(u);d=new f({id:l,type:u,ctx:this.ctx,chart:this}),i[d.id]=d}d.init(o,t)}),wt(r,(s,o)=>{s||delete i[o]}),wt(i,s=>{re.configure(this,s,s.options),re.addBox(this,s)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((r,a)=>r.index-a.index),i>e){for(let r=e;r<i;++r)this._destroyDatasetMeta(r);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(Zc("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((i,r)=>{e.filter(a=>a===i._dataset).length===0&&this._destroyDatasetMeta(r)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,r;for(this._removeUnreferencedMetasets(),i=0,r=e.length;i<r;i++){const a=e[i];let s=this.getDatasetMeta(i);const o=a.type||this.config.type;if(s.type&&s.type!==o&&(this._destroyDatasetMeta(i),s=this.getDatasetMeta(i)),s.type=o,s.indexAxis=a.indexAxis||as(o,this.options),s.order=a.order||0,s.index=i,s.label=""+a.label,s.visible=this.isDatasetVisible(i),s.controller)s.controller.updateIndex(i),s.controller.linkScales();else{const l=Ie.getController(o),{datasetElementType:c,dataElementType:u}=Ft.datasets[o];Object.assign(l,{dataElementType:Ie.getElement(u),datasetElementType:c&&Ie.getElement(c)}),s.controller=new l(this,i),t.push(s.controller)}}return this._updateMetasets(),t}_resetElements(){wt(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),r=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const a=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let s=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:d}=this.getDatasetMeta(c),f=!r&&a.indexOf(d)===-1;d.buildOrUpdateElements(f),s=Math.max(+d.getMaxOverflow(),s)}s=this._minPadding=i.layout.autoPadding?s:0,this._updateLayout(s),r||wt(a,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Zc("z","_idx"));const{_active:o,_lastEvent:l}=this;l?this._eventHandler(l,!0):o.length&&this._updateHoverStyles(o,o,!0),this.render()}_updateScales(){wt(this.scales,t=>{re.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!El(e,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:r,count:a}of e){const s=i==="_removeElements"?-a:a;Ym(t,r,s)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=a=>new Set(t.filter(s=>s[0]===a).map((s,o)=>o+","+s.splice(1).join(","))),r=i(0);for(let a=1;a<e;a++)if(!El(r,i(a)))return;return Array.from(r).map(a=>a.split(",")).map(a=>({method:a[1],start:+a[2],count:+a[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;re.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],wt(this.boxes,r=>{i&&r.position==="chartArea"||(r.configure&&r.configure(),this._layers.push(...r._layers()))},this),this._layers.forEach((r,a)=>{r._idx=a}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,i=this.data.datasets.length;e<i;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,de(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),r={meta:i,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",r)!==!1&&(i.controller._update(e),r.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",r))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(qe.has(this)?this.attached&&!qe.running(this)&&qe.start(this):(this.draw(),Qc({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:i,height:r}=this._resizeBeforeDraw;this._resize(i,r),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,i=[];let r,a;for(r=0,a=e.length;r<a;++r){const s=e[r];(!t||s.visible)&&i.push(s)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i=t._clip,r=!i.disabled,a=Hm(t,this.chartArea),s={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",s)!==!1&&(r&&Mi(e,{left:i.left===!1?0:a.left-i.left,right:i.right===!1?this.width:a.right+i.right,top:i.top===!1?0:a.top-i.top,bottom:i.bottom===!1?this.height:a.bottom+i.bottom}),t.controller.draw(),r&&Ci(e),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(t){return Ve(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,r){const a=is.modes[e];return typeof a=="function"?a(this,t,i,r):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let r=i.filter(a=>a&&a._dataset===e).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(r)),r}getContext(){return this.$context||(this.$context=dn(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!e.hidden}setDatasetVisibility(t,e){const i=this.getDatasetMeta(t);i.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const r=i?"show":"hide",a=this.getDatasetMeta(t),s=a.controller._resolveAnimations(void 0,r);ue(e)?(a.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),s.update(a,{visible:i}),this.update(o=>o.datasetIndex===t?r: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(),qe.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(),Xl(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete Lr[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,i=(a,s)=>{e.addEventListener(this,a,s),t[a]=s},r=(a,s,o)=>{a.offsetX=s,a.offsetY=o,this._eventHandler(a)};wt(this.options.events,a=>i(a,r))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},r=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},a=(l,c)=>{this.canvas&&this.resize(l,c)};let s;const o=()=>{r("attach",o),this.attached=!0,this.resize(),i("resize",a),i("detach",s)};s=()=>{this.attached=!1,r("resize",a),this._stop(),this._resize(0,0),i("attach",o)},e.isAttached(this.canvas)?o():s()}unbindEvents(){wt(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},wt(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const r=i?"set":"remove";let a,s,o,l;for(e==="dataset"&&(a=this.getDatasetMeta(t[0].datasetIndex),a.controller["_"+r+"DatasetHoverStyle"]()),o=0,l=t.length;o<l;++o){s=t[o];const c=s&&this.getDatasetMeta(s.datasetIndex).controller;c&&c[r+"HoverStyle"](s.element,s.datasetIndex,s.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map(({datasetIndex:a,index:s})=>{const o=this.getDatasetMeta(a);if(!o)throw new Error("No dataset found at index "+a);return{datasetIndex:a,element:o.data[s],index:s}});!hr(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,i){const r=this.options.hover,a=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),s=a(e,t),o=i?t:a(t,e);s.length&&this.updateHoverStyle(s,r.mode,!1),o.length&&r.mode&&this.updateHoverStyle(o,r.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},r=s=>(s.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,r)===!1)return;const a=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,r),(a||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:r=[],options:a}=this,s=e,o=this._getActiveElements(t,r,i,s),l=tg(t),c=zm(t,this._lastEvent,i,l);i&&(this._lastEvent=null,xt(a.onHover,[t,o,this],this),l&&xt(a.onClick,[t,o,this],this));const u=!hr(o,r);return(u||e)&&(this._active=o,this._updateHoverStyles(o,r,e)),this._lastEvent=c,u}_getActiveElements(t,e,i,r){if(t.type==="mouseout")return[];if(!i)return e;const a=this.options.hover;return this.getElementsAtEventForMode(t,a.mode,a,r)}},Y(Tn,"defaults",Ft),Y(Tn,"instances",Lr),Y(Tn,"overrides",Cn),Y(Tn,"registry",Ie),Y(Tn,"version",Um),Y(Tn,"getChart",tu),Tn);function eu(){return wt(Te.instances,n=>n._plugins.invalidate())}function $m(n,t,e){const{startAngle:i,pixelMargin:r,x:a,y:s,outerRadius:o,innerRadius:l}=t;let c=r/o;n.beginPath(),n.arc(a,s,o,i-c,e+c),l>r?(c=r/l,n.arc(a,s,l,e+c,i-c,!0)):n.arc(a,s,r,e+Pt,i-Pt),n.closePath(),n.clip()}function jm(n){return Ha(n,["outerStart","outerEnd","innerStart","innerEnd"])}function Vm(n,t,e,i){const r=jm(n.options.borderRadius),a=(e-t)/2,s=Math.min(a,i*t/2),o=l=>{const c=(e-Math.min(a,l))*i/2;return Zt(l,0,Math.min(a,c))};return{outerStart:o(r.outerStart),outerEnd:o(r.outerEnd),innerStart:Zt(r.innerStart,0,s),innerEnd:Zt(r.innerEnd,0,s)}}function ti(n,t,e,i){return{x:e+n*Math.cos(t),y:i+n*Math.sin(t)}}function Nr(n,t,e,i,r,a){const{x:s,y:o,startAngle:l,pixelMargin:c,innerRadius:u}=t,d=Math.max(t.outerRadius+i+e-c,0),f=u>0?u+i+e+c:0;let g=0;const p=r-l;if(i){const L=u>0?u-i:0,H=d>0?d-i:0,I=(L+H)/2,et=I!==0?p*I/(I+i):p;g=(p-et)/2}const m=Math.max(.001,p*d-e/dt)/d,y=(p-m)/2,v=l+y+g,x=r-y-g,{outerStart:w,outerEnd:_,innerStart:S,innerEnd:C}=Vm(t,f,d,x-v),k=d-w,T=d-_,D=v+w/k,O=x-_/T,A=f+S,R=f+C,W=v+S/A,V=x-C/R;if(n.beginPath(),a){const L=(D+O)/2;if(n.arc(s,o,d,D,L),n.arc(s,o,d,L,O),_>0){const z=ti(T,O,s,o);n.arc(z.x,z.y,_,O,x+Pt)}const H=ti(R,x,s,o);if(n.lineTo(H.x,H.y),C>0){const z=ti(R,V,s,o);n.arc(z.x,z.y,C,x+Pt,V+Math.PI)}const I=(x-C/f+(v+S/f))/2;if(n.arc(s,o,f,x-C/f,I,!0),n.arc(s,o,f,I,v+S/f,!0),S>0){const z=ti(A,W,s,o);n.arc(z.x,z.y,S,W+Math.PI,v-Pt)}const et=ti(k,v,s,o);if(n.lineTo(et.x,et.y),w>0){const z=ti(k,D,s,o);n.arc(z.x,z.y,w,v-Pt,D)}}else{n.moveTo(s,o);const L=Math.cos(D)*d+s,H=Math.sin(D)*d+o;n.lineTo(L,H);const I=Math.cos(O)*d+s,et=Math.sin(O)*d+o;n.lineTo(I,et)}n.closePath()}function qm(n,t,e,i,r){const{fullCircles:a,startAngle:s,circumference:o}=t;let l=t.endAngle;if(a){Nr(n,t,e,i,l,r);for(let c=0;c<a;++c)n.fill();isNaN(o)||(l=s+(o%kt||kt))}return Nr(n,t,e,i,l,r),n.fill(),l}function Xm(n,t,e,i,r){const{fullCircles:a,startAngle:s,circumference:o,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:d,borderDashOffset:f}=l,g=l.borderAlign==="inner";if(!c)return;n.setLineDash(d||[]),n.lineDashOffset=f,g?(n.lineWidth=c*2,n.lineJoin=u||"round"):(n.lineWidth=c,n.lineJoin=u||"bevel");let p=t.endAngle;if(a){Nr(n,t,e,i,p,r);for(let m=0;m<a;++m)n.stroke();isNaN(o)||(p=s+(o%kt||kt))}g&&$m(n,t,p),a||(Nr(n,t,e,i,p,r),n.stroke())}class Wi extends te{constructor(e){super();Y(this,"circumference");Y(this,"endAngle");Y(this,"fullCircles");Y(this,"innerRadius");Y(this,"outerRadius");Y(this,"pixelMargin");Y(this,"startAngle");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,e&&Object.assign(this,e)}inRange(e,i,r){const a=this.getProps(["x","y"],r),{angle:s,distance:o}=Il(a,{x:e,y:i}),{startAngle:l,endAngle:c,innerRadius:u,outerRadius:d,circumference:f}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],r),g=(this.options.spacing+this.options.borderWidth)/2,m=nt(f,c-l)>=kt||_i(s,l,c),y=$e(o,u+g,d+g);return m&&y}getCenterPoint(e){const{x:i,y:r,startAngle:a,endAngle:s,innerRadius:o,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:c,spacing:u}=this.options,d=(a+s)/2,f=(o+l+u+c)/2;return{x:i+Math.cos(d)*f,y:r+Math.sin(d)*f}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:i,circumference:r}=this,a=(i.offset||0)/4,s=(i.spacing||0)/2,o=i.circular;if(this.pixelMargin=i.borderAlign==="inner"?.33:0,this.fullCircles=r>kt?Math.floor(r/kt):0,r===0||this.innerRadius<0||this.outerRadius<0)return;e.save();const l=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(l)*a,Math.sin(l)*a);const c=1-Math.sin(Math.min(dt,r||0)),u=a*c;e.fillStyle=i.backgroundColor,e.strokeStyle=i.borderColor,qm(e,this,u,s,o),Xm(e,this,u,s,o),e.restore()}}Y(Wi,"id","arc"),Y(Wi,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),Y(Wi,"defaultRoutes",{backgroundColor:"backgroundColor"}),Y(Wi,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"});function nu(n,t,e=t){n.lineCap=nt(e.borderCapStyle,t.borderCapStyle),n.setLineDash(nt(e.borderDash,t.borderDash)),n.lineDashOffset=nt(e.borderDashOffset,t.borderDashOffset),n.lineJoin=nt(e.borderJoinStyle,t.borderJoinStyle),n.lineWidth=nt(e.borderWidth,t.borderWidth),n.strokeStyle=nt(e.borderColor,t.borderColor)}function Gm(n,t,e){n.lineTo(e.x,e.y)}function Km(n){return n.stepped?wg:n.tension||n.cubicInterpolationMode==="monotone"?_g:Gm}function iu(n,t,e={}){const i=n.length,{start:r=0,end:a=i-1}=e,{start:s,end:o}=t,l=Math.max(r,s),c=Math.min(a,o),u=r<s&&a<s||r>o&&a>o;return{count:i,start:l,loop:t.loop,ilen:c<l&&!u?i+c-l:c-l}}function Zm(n,t,e,i){const{points:r,options:a}=t,{count:s,start:o,loop:l,ilen:c}=iu(r,e,i),u=Km(a);let{move:d=!0,reverse:f}=i||{},g,p,m;for(g=0;g<=c;++g)p=r[(o+(f?c-g:g))%s],!p.skip&&(d?(n.moveTo(p.x,p.y),d=!1):u(n,m,p,f,a.stepped),m=p);return l&&(p=r[(o+(f?c:0))%s],u(n,m,p,f,a.stepped)),!!l}function Qm(n,t,e,i){const r=t.points,{count:a,start:s,ilen:o}=iu(r,e,i),{move:l=!0,reverse:c}=i||{};let u=0,d=0,f,g,p,m,y,v;const x=_=>(s+(c?o-_:_))%a,w=()=>{m!==y&&(n.lineTo(u,y),n.lineTo(u,m),n.lineTo(u,v))};for(l&&(g=r[x(0)],n.moveTo(g.x,g.y)),f=0;f<=o;++f){if(g=r[x(f)],g.skip)continue;const _=g.x,S=g.y,C=_|0;C===p?(S<m?m=S:S>y&&(y=S),u=(d*u+_)/++d):(w(),n.lineTo(_,S),p=C,d=0,m=y=S),v=S}w()}function os(n){const t=n.options,e=t.borderDash&&t.borderDash.length;return!n._decimated&&!n._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?Qm:Zm}function Jm(n){return n.stepped?tp:n.tension||n.cubicInterpolationMode==="monotone"?ep:En}function t0(n,t,e,i){let r=t._path;r||(r=t._path=new Path2D,t.path(r,e,i)&&r.closePath()),nu(n,t.options),n.stroke(r)}function e0(n,t,e,i){const{segments:r,options:a}=t,s=os(t);for(const o of r)nu(n,a,o.style),n.beginPath(),s(n,t,o,{start:e,end:e+i-1})&&n.closePath(),n.stroke()}const n0=typeof Path2D=="function";function i0(n,t,e,i){n0&&!t.options.segment?t0(n,t,e,i):e0(n,t,e,i)}class gn extends te{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const r=i.spanGaps?this._loop:this._fullLoop;Vg(this._points,i,t,r,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=op(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,r=t[e],a=this.points,s=fc(this,{property:e,start:r,end:r});if(!s.length)return;const o=[],l=Jm(i);let c,u;for(c=0,u=s.length;c<u;++c){const{start:d,end:f}=s[c],g=a[d],p=a[f];if(g===p){o.push(g);continue}const m=Math.abs((r-g[e])/(p[e]-g[e])),y=l(g,p,m,i.stepped);y[e]=t[e],o.push(y)}return o.length===1?o[0]:o}pathSegment(t,e,i){return os(this)(t,this,e,i)}path(t,e,i){const r=this.segments,a=os(this);let s=this._loop;e=e||0,i=i||this.points.length-e;for(const o of r)s&=a(t,this,o,{start:e,end:e+i-1});return!!s}draw(t,e,i,r){const a=this.options||{};(this.points||[]).length&&a.borderWidth&&(t.save(),i0(t,this,i,r),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}Y(gn,"id","line"),Y(gn,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),Y(gn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),Y(gn,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function ru(n,t,e,i){const r=n.options,{[e]:a}=n.getProps([e],i);return Math.abs(t-a)<r.radius+r.hitRadius}class Fr extends te{constructor(e){super();Y(this,"parsed");Y(this,"skip");Y(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,i,r){const a=this.options,{x:s,y:o}=this.getProps(["x","y"],r);return Math.pow(e-s,2)+Math.pow(i-o,2)<Math.pow(a.hitRadius+a.radius,2)}inXRange(e,i){return ru(this,e,"x",i)}inYRange(e,i){return ru(this,e,"y",i)}getCenterPoint(e){const{x:i,y:r}=this.getProps(["x","y"],e);return{x:i,y:r}}size(e){e=e||this.options||{};let i=e.radius||0;i=Math.max(i,i&&e.hoverRadius||0);const r=i&&e.borderWidth||0;return(i+r)*2}draw(e,i){const r=this.options;this.skip||r.radius<.1||!Ve(this,i,this.size(r)/2)||(e.strokeStyle=r.borderColor,e.lineWidth=r.borderWidth,e.fillStyle=r.backgroundColor,za(e,r,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}Y(Fr,"id","point"),Y(Fr,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),Y(Fr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function au(n,t){const{x:e,y:i,base:r,width:a,height:s}=n.getProps(["x","y","base","width","height"],t);let o,l,c,u,d;return n.horizontal?(d=s/2,o=Math.min(e,r),l=Math.max(e,r),c=i-d,u=i+d):(d=a/2,o=e-d,l=e+d,c=Math.min(i,r),u=Math.max(i,r)),{left:o,top:c,right:l,bottom:u}}function pn(n,t,e,i){return n?0:Zt(t,e,i)}function r0(n,t,e){const i=n.options.borderWidth,r=n.borderSkipped,a=Kl(i);return{t:pn(r.top,a.top,0,e),r:pn(r.right,a.right,0,t),b:pn(r.bottom,a.bottom,0,e),l:pn(r.left,a.left,0,t)}}function a0(n,t,e){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),r=n.options.borderRadius,a=un(r),s=Math.min(t,e),o=n.borderSkipped,l=i||ct(r);return{topLeft:pn(!l||o.top||o.left,a.topLeft,0,s),topRight:pn(!l||o.top||o.right,a.topRight,0,s),bottomLeft:pn(!l||o.bottom||o.left,a.bottomLeft,0,s),bottomRight:pn(!l||o.bottom||o.right,a.bottomRight,0,s)}}function s0(n){const t=au(n),e=t.right-t.left,i=t.bottom-t.top,r=r0(n,e/2,i/2),a=a0(n,e/2,i/2);return{outer:{x:t.left,y:t.top,w:e,h:i,radius:a},inner:{x:t.left+r.l,y:t.top+r.t,w:e-r.l-r.r,h:i-r.t-r.b,radius:{topLeft:Math.max(0,a.topLeft-Math.max(r.t,r.l)),topRight:Math.max(0,a.topRight-Math.max(r.t,r.r)),bottomLeft:Math.max(0,a.bottomLeft-Math.max(r.b,r.l)),bottomRight:Math.max(0,a.bottomRight-Math.max(r.b,r.r))}}}}function ls(n,t,e,i){const r=t===null,a=e===null,o=n&&!(r&&a)&&au(n,i);return o&&(r||$e(t,o.left,o.right))&&(a||$e(e,o.top,o.bottom))}function o0(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function l0(n,t){n.rect(t.x,t.y,t.w,t.h)}function cs(n,t,e={}){const i=n.x!==e.x?-t:0,r=n.y!==e.y?-t:0,a=(n.x+n.w!==e.x+e.w?t:0)-i,s=(n.y+n.h!==e.y+e.h?t:0)-r;return{x:n.x+i,y:n.y+r,w:n.w+a,h:n.h+s,radius:n.radius}}class Ur extends te{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:i,backgroundColor:r}}=this,{inner:a,outer:s}=s0(this),o=o0(s.radius)?Kn:l0;t.save(),(s.w!==a.w||s.h!==a.h)&&(t.beginPath(),o(t,cs(s,e,a)),t.clip(),o(t,cs(a,-e,s)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),o(t,cs(a,e)),t.fillStyle=r,t.fill(),t.restore()}inRange(t,e,i){return ls(this,t,e,i)}inXRange(t,e){return ls(this,t,null,e)}inYRange(t,e){return ls(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:r,horizontal:a}=this.getProps(["x","y","base","horizontal"],t);return{x:a?(e+r)/2:e,y:a?i:(i+r)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}Y(Ur,"id","bar"),Y(Ur,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),Y(Ur,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var c0=Object.freeze({__proto__:null,ArcElement:Wi,BarElement:Ur,LineElement:gn,PointElement:Fr});const us=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],su=us.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function ou(n){return us[n%us.length]}function lu(n){return su[n%su.length]}function u0(n,t){return n.borderColor=ou(t),n.backgroundColor=lu(t),++t}function d0(n,t){return n.backgroundColor=n.data.map(()=>ou(t++)),t}function f0(n,t){return n.backgroundColor=n.data.map(()=>lu(t++)),t}function h0(n){let t=0;return(e,i)=>{const r=n.getDatasetMeta(i).controller;r instanceof hn?t=d0(e,t):r instanceof Ai?t=f0(e,t):r&&(t=u0(e,t))}}function cu(n){let t;for(t in n)if(n[t].borderColor||n[t].backgroundColor)return!0;return!1}function g0(n){return n&&(n.borderColor||n.backgroundColor)}var p0={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(n,t,e){if(!e.enabled)return;const{data:{datasets:i},options:r}=n.config,{elements:a}=r;if(!e.forceOverride&&(cu(i)||g0(r)||a&&cu(a)))return;const s=h0(n);i.forEach(s)}};function m0(n,t,e,i,r){const a=r.samples||i;if(a>=e)return n.slice(t,t+e);const s=[],o=(e-2)/(a-2);let l=0;const c=t+e-1;let u=t,d,f,g,p,m;for(s[l++]=n[u],d=0;d<a-2;d++){let y=0,v=0,x;const w=Math.floor((d+1)*o)+1+t,_=Math.min(Math.floor((d+2)*o)+1,e)+t,S=_-w;for(x=w;x<_;x++)y+=n[x].x,v+=n[x].y;y/=S,v/=S;const C=Math.floor(d*o)+1+t,k=Math.min(Math.floor((d+1)*o)+1,e)+t,{x:T,y:D}=n[u];for(g=p=-1,x=C;x<k;x++)p=.5*Math.abs((T-y)*(n[x].y-D)-(T-n[x].x)*(v-D)),p>g&&(g=p,f=n[x],m=x);s[l++]=f,u=m}return s[l++]=n[c],s}function y0(n,t,e,i){let r=0,a=0,s,o,l,c,u,d,f,g,p,m;const y=[],v=t+e-1,x=n[t].x,_=n[v].x-x;for(s=t;s<t+e;++s){o=n[s],l=(o.x-x)/_*i,c=o.y;const S=l|0;if(S===u)c<p?(p=c,d=s):c>m&&(m=c,f=s),r=(a*r+o.x)/++a;else{const C=s-1;if(!it(d)&&!it(f)){const k=Math.min(d,f),T=Math.max(d,f);k!==g&&k!==C&&y.push({...n[k],x:r}),T!==g&&T!==C&&y.push({...n[T],x:r})}s>0&&C!==g&&y.push(n[C]),y.push(o),u=S,a=0,p=m=c,d=f=g=s}}return y}function uu(n){if(n._decimated){const t=n._data;delete n._decimated,delete n._data,Object.defineProperty(n,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function du(n){n.data.datasets.forEach(t=>{uu(t)})}function b0(n,t){const e=t.length;let i=0,r;const{iScale:a}=n,{min:s,max:o,minDefined:l,maxDefined:c}=a.getUserBounds();return l&&(i=Zt(je(t,a.axis,s).lo,0,e-1)),c?r=Zt(je(t,a.axis,o).hi+1,i,e)-i:r=e-i,{start:i,count:r}}var v0={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(n,t,e)=>{if(!e.enabled){du(n);return}const i=n.width;n.data.datasets.forEach((r,a)=>{const{_data:s,indexAxis:o}=r,l=n.getDatasetMeta(a),c=s||r.data;if(ki([o,n.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const u=n.scales[l.xAxisID];if(u.type!=="linear"&&u.type!=="time"||n.options.parsing)return;let{start:d,count:f}=b0(l,c);const g=e.threshold||4*i;if(f<=g){uu(r);return}it(s)&&(r._data=c,delete r.data,Object.defineProperty(r,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(m){this._data=m}}));let p;switch(e.algorithm){case"lttb":p=m0(c,d,f,i,e);break;case"min-max":p=y0(c,d,f,i);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}r._decimated=p})},destroy(n){du(n)}};function x0(n,t,e){const i=n.segments,r=n.points,a=t.points,s=[];for(const o of i){let{start:l,end:c}=o;c=fs(l,c,r);const u=ds(e,r[l],r[c],o.loop);if(!t.segments){s.push({source:o,target:u,start:r[l],end:r[c]});continue}const d=fc(t,u);for(const f of d){const g=ds(e,a[f.start],a[f.end],f.loop),p=dc(o,r,g);for(const m of p)s.push({source:m,target:f,start:{[e]:fu(u,g,"start",Math.max)},end:{[e]:fu(u,g,"end",Math.min)}})}}return s}function ds(n,t,e,i){if(i)return;let r=t[n],a=e[n];return n==="angle"&&(r=ve(r),a=ve(a)),{property:n,start:r,end:a}}function w0(n,t){const{x:e=null,y:i=null}=n||{},r=t.points,a=[];return t.segments.forEach(({start:s,end:o})=>{o=fs(s,o,r);const l=r[s],c=r[o];i!==null?(a.push({x:l.x,y:i}),a.push({x:c.x,y:i})):e!==null&&(a.push({x:e,y:l.y}),a.push({x:e,y:c.y}))}),a}function fs(n,t,e){for(;t>n;t--){const i=e[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function fu(n,t,e,i){return n&&t?i(n[e],t[e]):n?n[e]:t?t[e]:0}function hu(n,t){let e=[],i=!1;return yt(n)?(i=!0,e=n):e=w0(n,t),e.length?new gn({points:e,options:{tension:0},_loop:i,_fullLoop:i}):null}function gu(n){return n&&n.fill!==!1}function _0(n,t,e){let r=n[t].fill;const a=[t];let s;if(!e)return r;for(;r!==!1&&a.indexOf(r)===-1;){if(!Lt(r))return r;if(s=n[r],!s)return!1;if(s.visible)return r;a.push(r),r=s.fill}return!1}function T0(n,t,e){const i=C0(n);if(ct(i))return isNaN(i.value)?!1:i;let r=parseFloat(i);return Lt(r)&&Math.floor(r)===r?D0(i[0],t,r,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function D0(n,t,e,i){return(n==="-"||n==="+")&&(e=t+e),e===t||e<0||e>=i?!1:e}function S0(n,t){let e=null;return n==="start"?e=t.bottom:n==="end"?e=t.top:ct(n)?e=t.getPixelForValue(n.value):t.getBasePixel&&(e=t.getBasePixel()),e}function M0(n,t,e){let i;return n==="start"?i=e:n==="end"?i=t.options.reverse?t.min:t.max:ct(n)?i=n.value:i=t.getBaseValue(),i}function C0(n){const t=n.options,e=t.fill;let i=nt(e&&e.target,e);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function k0(n){const{scale:t,index:e,line:i}=n,r=[],a=i.segments,s=i.points,o=O0(t,e);o.push(hu({x:null,y:t.bottom},i));for(let l=0;l<a.length;l++){const c=a[l];for(let u=c.start;u<=c.end;u++)P0(r,s[u],o)}return new gn({points:r,options:{}})}function O0(n,t){const e=[],i=n.getMatchingVisibleMetas("line");for(let r=0;r<i.length;r++){const a=i[r];if(a.index===t)break;a.hidden||e.unshift(a.dataset)}return e}function P0(n,t,e){const i=[];for(let r=0;r<e.length;r++){const a=e[r],{first:s,last:o,point:l}=E0(a,t,"x");if(!(!l||s&&o)){if(s)i.unshift(l);else if(n.push(l),!o)break}}n.push(...i)}function E0(n,t,e){const i=n.interpolate(t,e);if(!i)return{};const r=i[e],a=n.segments,s=n.points;let o=!1,l=!1;for(let c=0;c<a.length;c++){const u=a[c],d=s[u.start][e],f=s[u.end][e];if($e(r,d,f)){o=r===d,l=r===f;break}}return{first:o,last:l,point:i}}class pu{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:r,y:a,radius:s}=this;return e=e||{start:0,end:kt},t.arc(r,a,s,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:r}=this,a=t.angle;return{x:e+Math.cos(a)*r,y:i+Math.sin(a)*r,angle:a}}}function A0(n){const{chart:t,fill:e,line:i}=n;if(Lt(e))return R0(t,e);if(e==="stack")return k0(n);if(e==="shape")return!0;const r=L0(n);return r instanceof pu?r:hu(r,i)}function R0(n,t){const e=n.getDatasetMeta(t);return e&&n.isDatasetVisible(t)?e.dataset:null}function L0(n){return(n.scale||{}).getPointPositionForValue?N0(n):I0(n)}function I0(n){const{scale:t={},fill:e}=n,i=S0(e,t);if(Lt(i)){const r=t.isHorizontal();return{x:r?i:null,y:r?null:i}}return null}function N0(n){const{scale:t,fill:e}=n,i=t.options,r=t.getLabels().length,a=i.reverse?t.max:t.min,s=M0(e,t,a),o=[];if(i.grid.circular){const l=t.getPointPositionForValue(0,a);return new pu({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(s)})}for(let l=0;l<r;++l)o.push(t.getPointPositionForValue(l,s));return o}function hs(n,t,e){const i=A0(t),{line:r,scale:a,axis:s}=t,o=r.options,l=o.fill,c=o.backgroundColor,{above:u=c,below:d=c}=l||{};i&&r.points.length&&(Mi(n,e),F0(n,{line:r,target:i,above:u,below:d,area:e,scale:a,axis:s}),Ci(n))}function F0(n,t){const{line:e,target:i,above:r,below:a,area:s,scale:o}=t,l=e._loop?"angle":t.axis;n.save(),l==="x"&&a!==r&&(mu(n,i,s.top),yu(n,{line:e,target:i,color:r,scale:o,property:l}),n.restore(),n.save(),mu(n,i,s.bottom)),yu(n,{line:e,target:i,color:a,scale:o,property:l}),n.restore()}function mu(n,t,e){const{segments:i,points:r}=t;let a=!0,s=!1;n.beginPath();for(const o of i){const{start:l,end:c}=o,u=r[l],d=r[fs(l,c,r)];a?(n.moveTo(u.x,u.y),a=!1):(n.lineTo(u.x,e),n.lineTo(u.x,u.y)),s=!!t.pathSegment(n,o,{move:s}),s?n.closePath():n.lineTo(d.x,e)}n.lineTo(t.first().x,e),n.closePath(),n.clip()}function yu(n,t){const{line:e,target:i,property:r,color:a,scale:s}=t,o=x0(e,i,r);for(const{source:l,target:c,start:u,end:d}of o){const{style:{backgroundColor:f=a}={}}=l,g=i!==!0;n.save(),n.fillStyle=f,U0(n,s,g&&ds(r,u,d)),n.beginPath();const p=!!e.pathSegment(n,l);let m;if(g){p?n.closePath():bu(n,i,d,r);const y=!!i.pathSegment(n,c,{move:p,reverse:!0});m=p&&y,m||bu(n,i,u,r)}n.closePath(),n.fill(m?"evenodd":"nonzero"),n.restore()}}function U0(n,t,e){const{top:i,bottom:r}=t.chart.chartArea,{property:a,start:s,end:o}=e||{};a==="x"&&(n.beginPath(),n.rect(s,i,o-s,r-i),n.clip())}function bu(n,t,e,i){const r=t.interpolate(e,i);r&&n.lineTo(r.x,r.y)}var B0={id:"filler",afterDatasetsUpdate(n,t,e){const i=(n.data.datasets||[]).length,r=[];let a,s,o,l;for(s=0;s<i;++s)a=n.getDatasetMeta(s),o=a.dataset,l=null,o&&o.options&&o instanceof gn&&(l={visible:n.isDatasetVisible(s),index:s,fill:T0(o,s,i),chart:n,axis:a.controller.options.indexAxis,scale:a.vScale,line:o}),a.$filler=l,r.push(l);for(s=0;s<i;++s)l=r[s],!(!l||l.fill===!1)&&(l.fill=_0(r,s,e.propagate))},beforeDraw(n,t,e){const i=e.drawTime==="beforeDraw",r=n.getSortedVisibleDatasetMetas(),a=n.chartArea;for(let s=r.length-1;s>=0;--s){const o=r[s].$filler;o&&(o.line.updateControlPoints(a,o.axis),i&&o.fill&&hs(n.ctx,o,a))}},beforeDatasetsDraw(n,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let r=i.length-1;r>=0;--r){const a=i[r].$filler;gu(a)&&hs(n.ctx,a,n.chartArea)}},beforeDatasetDraw(n,t,e){const i=t.meta.$filler;!gu(i)||e.drawTime!=="beforeDatasetDraw"||hs(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const vu=(n,t)=>{let{boxHeight:e=t,boxWidth:i=t}=n;return n.usePointStyle&&(e=Math.min(e,t),i=n.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:e,itemHeight:Math.max(t,e)}},W0=(n,t)=>n!==null&&t!==null&&n.datasetIndex===t.datasetIndex&&n.index===t.index;class xu extends te{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=xt(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(i=>t.filter(i,this.chart.data))),t.sort&&(e=e.sort((i,r)=>t.sort(i,r,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 i=t.labels,r=Et(i.font),a=r.size,s=this._computeTitleHeight(),{boxWidth:o,itemHeight:l}=vu(i,a);let c,u;e.font=r.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(s,a,o,l)+10):(u=this.maxHeight,c=this._fitCols(s,r,o,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,r){const{ctx:a,maxWidth:s,options:{labels:{padding:o}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=r+o;let d=t;a.textAlign="left",a.textBaseline="middle";let f=-1,g=-u;return this.legendItems.forEach((p,m)=>{const y=i+e/2+a.measureText(p.text).width;(m===0||c[c.length-1]+y+2*o>s)&&(d+=u,c[c.length-(m>0?0:1)]=0,g+=u,f++),l[m]={left:0,top:g,row:f,width:y,height:r},c[c.length-1]+=y+o}),d}_fitCols(t,e,i,r){const{ctx:a,maxHeight:s,options:{labels:{padding:o}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=s-t;let d=o,f=0,g=0,p=0,m=0;return this.legendItems.forEach((y,v)=>{const{itemWidth:x,itemHeight:w}=Y0(i,e,a,y,r);v>0&&g+w+2*o>u&&(d+=f+o,c.push({width:f,height:g}),p+=f+o,m++,f=g=0),l[v]={left:p,top:g,col:m,width:x,height:w},f=Math.max(f,x),g+=w+o}),d+=f,c.push({width:f,height:g}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:r},rtl:a}}=this,s=Jn(a,this.left,this.width);if(this.isHorizontal()){let o=0,l=ie(i,this.left+r,this.right-this.lineWidths[o]);for(const c of e)o!==c.row&&(o=c.row,l=ie(i,this.left+r,this.right-this.lineWidths[o])),c.top+=this.top+t+r,c.left=s.leftForLtr(s.x(l),c.width),l+=c.width+r}else{let o=0,l=ie(i,this.top+t+r,this.bottom-this.columnSizes[o].height);for(const c of e)c.col!==o&&(o=c.col,l=ie(i,this.top+t+r,this.bottom-this.columnSizes[o].height)),c.top=l,c.left+=this.left+r,c.left=s.leftForLtr(s.x(c.left),c.width),l+=c.height+r}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Mi(t,this),this._draw(),Ci(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:r}=this,{align:a,labels:s}=t,o=Ft.color,l=Jn(t.rtl,this.left,this.width),c=Et(s.font),{padding:u}=s,d=c.size,f=d/2;let g;this.drawTitle(),r.textAlign=l.textAlign("left"),r.textBaseline="middle",r.lineWidth=.5,r.font=c.string;const{boxWidth:p,boxHeight:m,itemHeight:y}=vu(s,d),v=function(C,k,T){if(isNaN(p)||p<=0||isNaN(m)||m<0)return;r.save();const D=nt(T.lineWidth,1);if(r.fillStyle=nt(T.fillStyle,o),r.lineCap=nt(T.lineCap,"butt"),r.lineDashOffset=nt(T.lineDashOffset,0),r.lineJoin=nt(T.lineJoin,"miter"),r.lineWidth=D,r.strokeStyle=nt(T.strokeStyle,o),r.setLineDash(nt(T.lineDash,[])),s.usePointStyle){const O={radius:m*Math.SQRT2/2,pointStyle:T.pointStyle,rotation:T.rotation,borderWidth:D},A=l.xPlus(C,p/2),R=k+f;Gl(r,O,A,R,s.pointStyleWidth&&p)}else{const O=k+Math.max((d-m)/2,0),A=l.leftForLtr(C,p),R=un(T.borderRadius);r.beginPath(),Object.values(R).some(W=>W!==0)?Kn(r,{x:A,y:O,w:p,h:m,radius:R}):r.rect(A,O,p,m),r.fill(),D!==0&&r.stroke()}r.restore()},x=function(C,k,T){On(r,T.text,C,k+y/2,c,{strikethrough:T.hidden,textAlign:l.textAlign(T.textAlign)})},w=this.isHorizontal(),_=this._computeTitleHeight();w?g={x:ie(a,this.left+u,this.right-i[0]),y:this.top+u+_,line:0}:g={x:this.left+u,y:ie(a,this.top+_+u,this.bottom-e[0].height),line:0},oc(this.ctx,t.textDirection);const S=y+u;this.legendItems.forEach((C,k)=>{r.strokeStyle=C.fontColor,r.fillStyle=C.fontColor;const T=r.measureText(C.text).width,D=l.textAlign(C.textAlign||(C.textAlign=s.textAlign)),O=p+f+T;let A=g.x,R=g.y;l.setWidth(this.width),w?k>0&&A+O+u>this.right&&(R=g.y+=S,g.line++,A=g.x=ie(a,this.left+u,this.right-i[g.line])):k>0&&R+S>this.bottom&&(A=g.x=A+e[g.line].width+u,g.line++,R=g.y=ie(a,this.top+_+u,this.bottom-e[g.line].height));const W=l.x(A);if(v(W,R,C),A=ug(D,A+p+f,w?A+O:this.right,t.rtl),x(l.x(A),R,C),w)g.x+=O+u;else if(typeof C.text!="string"){const V=c.lineHeight;g.y+=wu(C,V)+u}else g.y+=S}),lc(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=Et(e.font),r=Xt(e.padding);if(!e.display)return;const a=Jn(t.rtl,this.left,this.width),s=this.ctx,o=e.position,l=i.size/2,c=r.top+l;let u,d=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),u=this.top+c,d=ie(t.align,d,this.right-f);else{const p=this.columnSizes.reduce((m,y)=>Math.max(m,y.height),0);u=c+ie(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const g=ie(o,d,d+f);s.textAlign=a.textAlign(Fa(o)),s.textBaseline="middle",s.strokeStyle=e.color,s.fillStyle=e.color,s.font=i.string,On(s,e.text,g,u,i)}_computeTitleHeight(){const t=this.options.title,e=Et(t.font),i=Xt(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,r,a;if($e(t,this.left,this.right)&&$e(e,this.top,this.bottom)){for(a=this.legendHitBoxes,i=0;i<a.length;++i)if(r=a[i],$e(t,r.left,r.left+r.width)&&$e(e,r.top,r.top+r.height))return this.legendItems[i]}return null}handleEvent(t){const e=this.options;if(!$0(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const r=this._hoveredItem,a=W0(r,i);r&&!a&&xt(e.onLeave,[t,r,this],this),this._hoveredItem=i,i&&!a&&xt(e.onHover,[t,i,this],this)}else i&&xt(e.onClick,[t,i,this],this)}}function Y0(n,t,e,i,r){const a=z0(i,n,t,e),s=H0(r,i,t.lineHeight);return{itemWidth:a,itemHeight:s}}function z0(n,t,e,i){let r=n.text;return r&&typeof r!="string"&&(r=r.reduce((a,s)=>a.length>s.length?a:s)),t+e.size/2+i.measureText(r).width}function H0(n,t,e){let i=n;return typeof t.text!="string"&&(i=wu(t,e)),i}function wu(n,t){const e=n.text?n.text.length:0;return t*e}function $0(n,t){return!!((n==="mousemove"||n==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(n==="click"||n==="mouseup"))}var j0={id:"legend",_element:xu,start(n,t,e){const i=n.legend=new xu({ctx:n.ctx,options:e,chart:n});re.configure(n,i,e),re.addBox(n,i)},stop(n){re.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,t,e){const i=n.legend;re.configure(n,i,e),i.options=e},afterUpdate(n){const t=n.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(n,t){t.replay||n.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(n,t,e){const i=t.datasetIndex,r=e.chart;r.isDatasetVisible(i)?(r.hide(i),t.hidden=!0):(r.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:n=>n.chart.options.color,boxWidth:40,padding:10,generateLabels(n){const t=n.data.datasets,{labels:{usePointStyle:e,pointStyle:i,textAlign:r,color:a,useBorderRadius:s,borderRadius:o}}=n.legend.options;return n._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),u=Xt(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:a,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:i||c.pointStyle,rotation:c.rotation,textAlign:r||c.textAlign,borderRadius:s&&(o||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:n=>n.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:n=>!n.startsWith("on"),labels:{_scriptable:n=>!["generateLabels","filter","sort"].includes(n)}}};class gs extends te{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const r=yt(i.text)?i.text.length:1;this._padding=Xt(i.padding);const a=r*Et(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=a:this.width=a}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:i,bottom:r,right:a,options:s}=this,o=s.align;let l=0,c,u,d;return this.isHorizontal()?(u=ie(o,i,a),d=e+t,c=a-i):(s.position==="left"?(u=i+t,d=ie(o,r,e),l=dt*-.5):(u=a-t,d=ie(o,e,r),l=dt*.5),c=r-e),{titleX:u,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=Et(e.font),a=i.lineHeight/2+this._padding.top,{titleX:s,titleY:o,maxWidth:l,rotation:c}=this._drawArgs(a);On(t,e.text,0,0,i,{color:e.color,maxWidth:l,rotation:c,textAlign:Fa(e.align),textBaseline:"middle",translation:[s,o]})}}function V0(n,t){const e=new gs({ctx:n.ctx,options:t,chart:n});re.configure(n,e,t),re.addBox(n,e),n.titleBlock=e}var q0={id:"title",_element:gs,start(n,t,e){V0(n,e)},stop(n){const t=n.titleBlock;re.removeBox(n,t),delete n.titleBlock},beforeUpdate(n,t,e){const i=n.titleBlock;re.configure(n,i,e),i.options=e},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Br=new WeakMap;var X0={id:"subtitle",start(n,t,e){const i=new gs({ctx:n.ctx,options:e,chart:n});re.configure(n,i,e),re.addBox(n,i),Br.set(n,i)},stop(n){re.removeBox(n,Br.get(n)),Br.delete(n)},beforeUpdate(n,t,e){const i=Br.get(n);re.configure(n,i,e),i.options=e},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Yi={average(n){if(!n.length)return!1;let t,e,i=0,r=0,a=0;for(t=0,e=n.length;t<e;++t){const s=n[t].element;if(s&&s.hasValue()){const o=s.tooltipPosition();i+=o.x,r+=o.y,++a}}return{x:i/a,y:r/a}},nearest(n,t){if(!n.length)return!1;let e=t.x,i=t.y,r=Number.POSITIVE_INFINITY,a,s,o;for(a=0,s=n.length;a<s;++a){const l=n[a].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),u=Gn(t,c);u<r&&(r=u,o=l)}}if(o){const l=o.tooltipPosition();e=l.x,i=l.y}return{x:e,y:i}}};function Ne(n,t){return t&&(yt(t)?Array.prototype.push.apply(n,t):n.push(t)),n}function Xe(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
|
|
16
|
+
*/class up{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,r){const a=e.listeners[r],s=e.duration;a.forEach(o=>o({chart:t,initial:e.initial,numSteps:s,currentStep:Math.min(i-e.start,s)}))}_refresh(){this._request||(this._running=!0,this._request=Bl.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,r)=>{if(!i.running||!i.items.length)return;const a=i.items;let s=a.length-1,o=!1,l;for(;s>=0;--s)l=a[s],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),o=!0):(a[s]=a[a.length-1],a.pop());o&&(r.draw(),this._notify(r,i,t,"progress")),a.length||(i.running=!1,this._notify(r,i,t,"complete"),i.initial=!1),e+=a.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((i,r)=>Math.max(i,r._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let r=i.length-1;for(;r>=0;--r)i[r].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var qe=new up;const pc="transparent",dp={boolean(n,t,e){return e>.5?t:n},color(n,t,e){const i=jl(n||pc),r=i.valid&&jl(t||pc);return r&&r.valid?r.mix(i,e).hexString():t},number(n,t,e){return n+(t-n)*e}};class fp{constructor(t,e,i,r){const a=e[i];r=ki([t.to,r,a,t.from]);const s=ki([t.from,a,r]);this._active=!0,this._fn=t.fn||dp[t.type||typeof s],this._easing=Ti[t.easing]||Ti.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=s,this._to=r,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const r=this._target[this._prop],a=i-this._start,s=this._duration-a;this._start=i,this._duration=Math.floor(Math.max(s,t.duration)),this._total+=a,this._loop=!!t.loop,this._to=ki([t.to,e,r,t.from]),this._from=ki([t.from,r,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,r=this._prop,a=this._from,s=this._loop,o=this._to;let l;if(this._active=a!==o&&(s||e<i),!this._active){this._target[r]=o,this._notify(!0);return}if(e<0){this._target[r]=a;return}l=e/i%2,l=s&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[r]=this._fn(a,o,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let r=0;r<i.length;r++)i[r][e]()}}class Ga{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!ct(t))return;const e=Object.keys(Ft.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(r=>{const a=t[r];if(!ct(a))return;const s={};for(const o of e)s[o]=a[o];(yt(a.properties)&&a.properties||[r]).forEach(o=>{(o===r||!i.has(o))&&i.set(o,s)})})}_animateOptions(t,e){const i=e.options,r=gp(t,i);if(!r)return[];const a=this._createAnimations(r,i);return i.$shared&&hp(t.options.$animations,i).then(()=>{t.options=i},()=>{}),a}_createAnimations(t,e){const i=this._properties,r=[],a=t.$animations||(t.$animations={}),s=Object.keys(e),o=Date.now();let l;for(l=s.length-1;l>=0;--l){const c=s[l];if(c.charAt(0)==="$")continue;if(c==="options"){r.push(...this._animateOptions(t,e));continue}const u=e[c];let d=a[c];const f=i.get(c);if(d)if(f&&d.active()){d.update(f,u,o);continue}else d.cancel();if(!f||!f.duration){t[c]=u;continue}a[c]=d=new fp(f,t,c,u),r.push(d)}return r}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const i=this._createAnimations(t,e);if(i.length)return qe.add(this._chart,i),!0}}function hp(n,t){const e=[],i=Object.keys(t);for(let r=0;r<i.length;r++){const a=n[i[r]];a&&a.active()&&e.push(a.wait())}return Promise.all(e)}function gp(n,t){if(!t)return;let e=n.options;if(!e){n.options=t;return}return e.$shared&&(n.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function mc(n,t){const e=n&&n.options||{},i=e.reverse,r=e.min===void 0?t:0,a=e.max===void 0?t:0;return{start:i?a:r,end:i?r:a}}function pp(n,t,e){if(e===!1)return!1;const i=mc(n,e),r=mc(t,e);return{top:r.end,right:i.end,bottom:r.start,left:i.start}}function mp(n){let t,e,i,r;return ct(n)?(t=n.top,e=n.right,i=n.bottom,r=n.left):t=e=i=r=n,{top:t,right:e,bottom:i,left:r,disabled:n===!1}}function yc(n,t){const e=[],i=n._getSortedDatasetMetas(t);let r,a;for(r=0,a=i.length;r<a;++r)e.push(i[r].index);return e}function bc(n,t,e,i={}){const r=n.keys,a=i.mode==="single";let s,o,l,c;if(t!==null){for(s=0,o=r.length;s<o;++s){if(l=+r[s],l===e){if(i.all)continue;break}c=n.values[l],Lt(c)&&(a||t===0||Le(t)===Le(c))&&(t+=c)}return t}}function yp(n){const t=Object.keys(n),e=new Array(t.length);let i,r,a;for(i=0,r=t.length;i<r;++i)a=t[i],e[i]={x:a,y:n[a]};return e}function vc(n,t){const e=n&&n.options.stacked;return e||e===void 0&&t.stack!==void 0}function bp(n,t,e){return`${n.id}.${t.id}.${e.stack||e.type}`}function vp(n){const{min:t,max:e,minDefined:i,maxDefined:r}=n.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:r?e:Number.POSITIVE_INFINITY}}function xp(n,t,e){const i=n[t]||(n[t]={});return i[e]||(i[e]={})}function xc(n,t,e,i){for(const r of t.getMatchingVisibleMetas(i).reverse()){const a=n[r.index];if(e&&a>0||!e&&a<0)return r.index}return null}function _c(n,t){const{chart:e,_cachedMeta:i}=n,r=e._stacks||(e._stacks={}),{iScale:a,vScale:s,index:o}=i,l=a.axis,c=s.axis,u=bp(a,s,i),d=t.length;let f;for(let g=0;g<d;++g){const p=t[g],{[l]:x,[c]:m}=p,v=p._stacks||(p._stacks={});f=v[c]=xp(r,u,x),f[o]=m,f._top=xc(f,s,!0,i.type),f._bottom=xc(f,s,!1,i.type);const b=f._visualValues||(f._visualValues={});b[o]=m}}function Ka(n,t){const e=n.scales;return Object.keys(e).filter(i=>e[i].axis===t).shift()}function _p(n,t){return dn(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function wp(n,t,e){return dn(n,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function Oi(n,t){const e=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){t=t||n._parsed;for(const r of t){const a=r._stacks;if(!a||a[i]===void 0||a[i][e]===void 0)return;delete a[i][e],a[i]._visualValues!==void 0&&a[i]._visualValues[e]!==void 0&&delete a[i]._visualValues[e]}}}const Za=n=>n==="reset"||n==="none",wc=(n,t)=>t?n:Object.assign({},n),Tp=(n,t,e)=>n&&!t.hidden&&t._stacked&&{keys:yc(e,!0),values:null};class Oe{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=vc(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&&Oi(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),r=(d,f,g,p)=>d==="x"?f:d==="r"?p:g,a=e.xAxisID=nt(i.xAxisID,Ka(t,"x")),s=e.yAxisID=nt(i.yAxisID,Ka(t,"y")),o=e.rAxisID=nt(i.rAxisID,Ka(t,"r")),l=e.indexAxis,c=e.iAxisID=r(l,a,s,o),u=e.vAxisID=r(l,s,a,o);e.xScale=this.getScaleForId(a),e.yScale=this.getScaleForId(s),e.rScale=this.getScaleForId(o),e.iScale=this.getScaleForId(c),e.vScale=this.getScaleForId(u)}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&&Fl(this._data,this),t._stacked&&Oi(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(ct(e))this._data=yp(e);else if(i!==e){if(i){Fl(i,this);const r=this._cachedMeta;Oi(r),r._parsed=[]}e&&Object.isExtensible(e)&&lg(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let r=!1;this._dataCheck();const a=e._stacked;e._stacked=vc(e.vScale,e),e.stack!==i.stack&&(r=!0,Oi(e),e.stack=i.stack),this._resyncElements(t),(r||a!==e._stacked)&&_c(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:r}=this,{iScale:a,_stacked:s}=i,o=a.axis;let l=t===0&&e===r.length?!0:i._sorted,c=t>0&&i._parsed[t-1],u,d,f;if(this._parsing===!1)i._parsed=r,i._sorted=!0,f=r;else{yt(r[t])?f=this.parseArrayData(i,r,t,e):ct(r[t])?f=this.parseObjectData(i,r,t,e):f=this.parsePrimitiveData(i,r,t,e);const g=()=>d[o]===null||c&&d[o]<c[o];for(u=0;u<e;++u)i._parsed[u+t]=d=f[u],l&&(g()&&(l=!1),c=d);i._sorted=l}s&&_c(this,f)}parsePrimitiveData(t,e,i,r){const{iScale:a,vScale:s}=t,o=a.axis,l=s.axis,c=a.getLabels(),u=a===s,d=new Array(r);let f,g,p;for(f=0,g=r;f<g;++f)p=f+i,d[f]={[o]:u||a.parse(c[p],p),[l]:s.parse(e[p],p)};return d}parseArrayData(t,e,i,r){const{xScale:a,yScale:s}=t,o=new Array(r);let l,c,u,d;for(l=0,c=r;l<c;++l)u=l+i,d=e[u],o[l]={x:a.parse(d[0],u),y:s.parse(d[1],u)};return o}parseObjectData(t,e,i,r){const{xScale:a,yScale:s}=t,{xAxisKey:o="x",yAxisKey:l="y"}=this._parsing,c=new Array(r);let u,d,f,g;for(u=0,d=r;u<d;++u)f=u+i,g=e[f],c[u]={x:a.parse(on(g,o),f),y:s.parse(on(g,l),f)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const r=this.chart,a=this._cachedMeta,s=e[t.axis],o={keys:yc(r,!0),values:e._stacks[t.axis]._visualValues};return bc(o,s,a.index,{mode:i})}updateRangeFromParsed(t,e,i,r){const a=i[e.axis];let s=a===null?NaN:a;const o=r&&i._stacks[e.axis];r&&o&&(r.values=o,s=bc(r,a,this._cachedMeta.index)),t.min=Math.min(t.min,s),t.max=Math.max(t.max,s)}getMinMax(t,e){const i=this._cachedMeta,r=i._parsed,a=i._sorted&&t===i.iScale,s=r.length,o=this._getOtherScale(t),l=Tp(e,i,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=vp(o);let f,g;function p(){g=r[f];const x=g[o.axis];return!Lt(g[t.axis])||u>x||d<x}for(f=0;f<s&&!(!p()&&(this.updateRangeFromParsed(c,t,g,l),a));++f);if(a){for(f=s-1;f>=0;--f)if(!p()){this.updateRangeFromParsed(c,t,g,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let r,a,s;for(r=0,a=e.length;r<a;++r)s=e[r][t.axis],Lt(s)&&i.push(s);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,r=e.vScale,a=this.getParsed(t);return{label:i?""+i.getLabelForValue(a[i.axis]):"",value:r?""+r.getLabelForValue(a[r.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=mp(nt(this.options.clip,pp(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,r=i.data||[],a=e.chartArea,s=[],o=this._drawStart||0,l=this._drawCount||r.length-o,c=this.options.drawActiveElementsOnTop;let u;for(i.dataset&&i.dataset.draw(t,a,o,l),u=o;u<o+l;++u){const d=r[u];d.hidden||(d.active&&c?s.push(d):d.draw(t,a))}for(u=0;u<s.length;++u)s[u].draw(t,a)}getStyle(t,e){const i=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const r=this.getDataset();let a;if(t>=0&&t<this._cachedMeta.data.length){const s=this._cachedMeta.data[t];a=s.$context||(s.$context=wp(this.getContext(),t,s)),a.parsed=this.getParsed(t),a.raw=r.data[t],a.index=a.dataIndex=t}else a=this.$context||(this.$context=_p(this.chart.getContext(),this.index)),a.dataset=r,a.index=a.datasetIndex=this.index;return a.active=!!e,a.mode=i,a}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){const r=e==="active",a=this._cachedDataOpts,s=t+"-"+e,o=a[s],l=this.enableOptionSharing&&ue(i);if(o)return wc(o,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),d=r?[`${t}Hover`,"hover",t,""]:[t,""],f=c.getOptionScopes(this.getDataset(),u),g=Object.keys(Ft.elements[t]),p=()=>this.getContext(i,r,e),x=c.resolveNamedOptions(f,g,p,d);return x.$shared&&(x.$shared=l,a[s]=Object.freeze(wc(x,l))),x}_resolveAnimations(t,e,i){const r=this.chart,a=this._cachedDataOpts,s=`animation-${e}`,o=a[s];if(o)return o;let l;if(r.options.animation!==!1){const u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,e),f=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(f,this.getContext(t,i,e))}const c=new Ga(r,l&&l.animations);return l&&l._cacheable&&(a[s]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Za(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),r=this._sharedOptions,a=this.getSharedOptions(i),s=this.includeOptions(e,a)||a!==r;return this.updateSharedOptions(a,e,i),{sharedOptions:a,includeOptions:s}}updateElement(t,e,i,r){Za(r)?Object.assign(t,i):this._resolveAnimations(e,r).update(t,i)}updateSharedOptions(t,e,i){t&&!Za(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,r){t.active=r;const a=this.getStyle(e,r);this._resolveAnimations(e,i,r).update(t,{options:!r&&this.getSharedOptions(a)||a})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[o,l,c]of this._syncList)this[o](l,c);this._syncList=[];const r=i.length,a=e.length,s=Math.min(a,r);s&&this.parse(0,s),a>r?this._insertElements(r,a-r,t):a<r&&this._removeElements(a,r-a)}_insertElements(t,e,i=!0){const r=this._cachedMeta,a=r.data,s=t+e;let o;const l=c=>{for(c.length+=e,o=c.length-1;o>=s;o--)c[o]=c[o-e]};for(l(a),o=t;o<s;++o)a[o]=new this.dataElementType;this._parsing&&l(r._parsed),this.parse(t,e),i&&this.updateElements(a,t,e,"reset")}updateElements(t,e,i,r){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const r=i._parsed.splice(t,e);i._stacked&&Oi(i,r)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,r]=t;this[e](i,r)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}Y(Oe,"defaults",{}),Y(Oe,"datasetElementType",null),Y(Oe,"dataElementType",null);function Dp(n,t){if(!n._cache.$bar){const e=n.getMatchingVisibleMetas(t);let i=[];for(let r=0,a=e.length;r<a;r++)i=i.concat(e[r].controller.getAllParsedValues(n));n._cache.$bar=Ul(i.sort((r,a)=>r-a))}return n._cache.$bar}function Sp(n){const t=n.iScale,e=Dp(t,n.type);let i=t._length,r,a,s,o;const l=()=>{s===32767||s===-32768||(ue(o)&&(i=Math.min(i,Math.abs(s-o)||i)),o=s)};for(r=0,a=e.length;r<a;++r)s=t.getPixelForValue(e[r]),l();for(o=void 0,r=0,a=t.ticks.length;r<a;++r)s=t.getPixelForTick(r),l();return i}function Mp(n,t,e,i){const r=e.barThickness;let a,s;return it(r)?(a=t.min*e.categoryPercentage,s=e.barPercentage):(a=r*i,s=1),{chunk:a/i,ratio:s,start:t.pixels[n]-a/2}}function Cp(n,t,e,i){const r=t.pixels,a=r[n];let s=n>0?r[n-1]:null,o=n<r.length-1?r[n+1]:null;const l=e.categoryPercentage;s===null&&(s=a-(o===null?t.end-t.start:o-a)),o===null&&(o=a+a-s);const c=a-(a-Math.min(s,o))/2*l;return{chunk:Math.abs(o-s)/2*l/i,ratio:e.barPercentage,start:c}}function kp(n,t,e,i){const r=e.parse(n[0],i),a=e.parse(n[1],i),s=Math.min(r,a),o=Math.max(r,a);let l=s,c=o;Math.abs(s)>Math.abs(o)&&(l=o,c=s),t[e.axis]=c,t._custom={barStart:l,barEnd:c,start:r,end:a,min:s,max:o}}function Tc(n,t,e,i){return yt(n)?kp(n,t,e,i):t[e.axis]=e.parse(n,i),t}function Dc(n,t,e,i){const r=n.iScale,a=n.vScale,s=r.getLabels(),o=r===a,l=[];let c,u,d,f;for(c=e,u=e+i;c<u;++c)f=t[c],d={},d[r.axis]=o||r.parse(s[c],c),l.push(Tc(f,d,a,c));return l}function Qa(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function Op(n,t,e){return n!==0?Le(n):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function Pp(n){let t,e,i,r,a;return n.horizontal?(t=n.base>n.x,e="left",i="right"):(t=n.base<n.y,e="bottom",i="top"),t?(r="end",a="start"):(r="start",a="end"),{start:e,end:i,reverse:t,top:r,bottom:a}}function Ep(n,t,e,i){let r=t.borderSkipped;const a={};if(!r){n.borderSkipped=a;return}if(r===!0){n.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:s,end:o,reverse:l,top:c,bottom:u}=Pp(n);r==="middle"&&e&&(n.enableBorderRadius=!0,(e._top||0)===i?r=c:(e._bottom||0)===i?r=u:(a[Sc(u,s,o,l)]=!0,r=c)),a[Sc(r,s,o,l)]=!0,n.borderSkipped=a}function Sc(n,t,e,i){return i?(n=Ap(n,t,e),n=Mc(n,e,t)):n=Mc(n,t,e),n}function Ap(n,t,e){return n===t?e:n===e?t:n}function Mc(n,t,e){return n==="start"?t:n==="end"?e:n}function Rp(n,{inflateAmount:t},e){n.inflateAmount=t==="auto"?e===1?.33:0:t}class Pi extends Oe{parsePrimitiveData(t,e,i,r){return Dc(t,e,i,r)}parseArrayData(t,e,i,r){return Dc(t,e,i,r)}parseObjectData(t,e,i,r){const{iScale:a,vScale:s}=t,{xAxisKey:o="x",yAxisKey:l="y"}=this._parsing,c=a.axis==="x"?o:l,u=s.axis==="x"?o:l,d=[];let f,g,p,x;for(f=i,g=i+r;f<g;++f)x=e[f],p={},p[a.axis]=a.parse(on(x,c),f),d.push(Tc(on(x,u),p,s,f));return d}updateRangeFromParsed(t,e,i,r){super.updateRangeFromParsed(t,e,i,r);const a=i._custom;a&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,a.min),t.max=Math.max(t.max,a.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:i,vScale:r}=e,a=this.getParsed(t),s=a._custom,o=Qa(s)?"["+s.start+", "+s.end+"]":""+r.getLabelForValue(a[r.axis]);return{label:""+i.getLabelForValue(a[i.axis]),value:o}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,i,r){const a=r==="reset",{index:s,_cachedMeta:{vScale:o}}=this,l=o.getBasePixel(),c=o.isHorizontal(),u=this._getRuler(),{sharedOptions:d,includeOptions:f}=this._getSharedOptions(e,r);for(let g=e;g<e+i;g++){const p=this.getParsed(g),x=a||it(p[o.axis])?{base:l,head:l}:this._calculateBarValuePixels(g),m=this._calculateBarIndexPixels(g,u),v=(p._stacks||{})[o.axis],b={horizontal:c,base:x.base,enableBorderRadius:!v||Qa(p._custom)||s===v._top||s===v._bottom,x:c?x.head:m.center,y:c?m.center:x.head,height:c?m.size:Math.abs(x.size),width:c?Math.abs(x.size):m.size};f&&(b.options=d||this.resolveDataElementOptions(g,t[g].active?"active":r));const _=b.options||t[g].options;Ep(b,_,v,s),Rp(b,_,u.ratio),this.updateElement(t[g],g,b,r)}}_getStacks(t,e){const{iScale:i}=this._cachedMeta,r=i.getMatchingVisibleMetas(this._type).filter(l=>l.controller.options.grouped),a=i.options.stacked,s=[],o=l=>{const c=l.controller.getParsed(e),u=c&&c[l.vScale.axis];if(it(u)||isNaN(u))return!0};for(const l of r)if(!(e!==void 0&&o(l))&&((a===!1||s.indexOf(l.stack)===-1||a===void 0&&l.stack===void 0)&&s.push(l.stack),l.index===t))break;return s.length||s.push(void 0),s}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){const r=this._getStacks(t,i),a=e!==void 0?r.indexOf(e):-1;return a===-1?r.length-1:a}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,r=[];let a,s;for(a=0,s=e.data.length;a<s;++a)r.push(i.getPixelForValue(this.getParsed(a)[i.axis],a));const o=t.barThickness;return{min:o||Sp(e),pixels:r,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:o?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i,index:r},options:{base:a,minBarLength:s}}=this,o=a||0,l=this.getParsed(t),c=l._custom,u=Qa(c);let d=l[e.axis],f=0,g=i?this.applyStack(e,l,i):d,p,x;g!==d&&(f=g-d,g=d),u&&(d=c.barStart,g=c.barEnd-c.barStart,d!==0&&Le(d)!==Le(c.barEnd)&&(f=0),f+=d);const m=!it(a)&&!u?a:f;let v=e.getPixelForValue(m);if(this.chart.getDataVisibility(t)?p=e.getPixelForValue(f+g):p=v,x=p-v,Math.abs(x)<s){x=Op(x,e,o)*s,d===o&&(v-=x/2);const b=e.getPixelForDecimal(0),_=e.getPixelForDecimal(1),w=Math.min(b,_),S=Math.max(b,_);v=Math.max(Math.min(v,S),w),p=v+x,i&&!u&&(l._stacks[e.axis]._visualValues[r]=e.getValueForPixel(p)-e.getValueForPixel(v))}if(v===e.getPixelForValue(o)){const b=Le(x)*e.getLineWidthForValue(o)/2;v+=b,x-=b}return{size:x,base:v,head:p,center:p+x/2}}_calculateBarIndexPixels(t,e){const i=e.scale,r=this.options,a=r.skipNull,s=nt(r.maxBarThickness,1/0);let o,l;if(e.grouped){const c=a?this._getStackCount(t):e.stackCount,u=r.barThickness==="flex"?Cp(t,e,r,c):Mp(t,e,r,c),d=this._getStackIndex(this.index,this._cachedMeta.stack,a?t:void 0);o=u.start+u.chunk*d+u.chunk/2,l=Math.min(s,u.chunk*u.ratio)}else o=i.getPixelForValue(this.getParsed(t)[i.axis],t),l=Math.min(s,e.min*e.ratio);return{base:o-l/2,head:o+l/2,center:o,size:l}}draw(){const t=this._cachedMeta,e=t.vScale,i=t.data,r=i.length;let a=0;for(;a<r;++a)this.getParsed(a)[e.axis]!==null&&i[a].draw(this._ctx)}}Y(Pi,"id","bar"),Y(Pi,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),Y(Pi,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class Sr extends Oe{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,i,r){const a=super.parsePrimitiveData(t,e,i,r);for(let s=0;s<a.length;s++)a[s]._custom=this.resolveDataElementOptions(s+i).radius;return a}parseArrayData(t,e,i,r){const a=super.parseArrayData(t,e,i,r);for(let s=0;s<a.length;s++){const o=e[i+s];a[s]._custom=nt(o[2],this.resolveDataElementOptions(s+i).radius)}return a}parseObjectData(t,e,i,r){const a=super.parseObjectData(t,e,i,r);for(let s=0;s<a.length;s++){const o=e[i+s];a[s]._custom=nt(o&&o.r&&+o.r,this.resolveDataElementOptions(s+i).radius)}return a}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let i=t.length-1;i>=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:r,yScale:a}=e,s=this.getParsed(t),o=r.getLabelForValue(s.x),l=a.getLabelForValue(s.y),c=s._custom;return{label:i[t]||"",value:"("+o+", "+l+(c?", "+c:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,r){const a=r==="reset",{iScale:s,vScale:o}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(e,r),u=s.axis,d=o.axis;for(let f=e;f<e+i;f++){const g=t[f],p=!a&&this.getParsed(f),x={},m=x[u]=a?s.getPixelForDecimal(.5):s.getPixelForValue(p[u]),v=x[d]=a?o.getBasePixel():o.getPixelForValue(p[d]);x.skip=isNaN(m)||isNaN(v),c&&(x.options=l||this.resolveDataElementOptions(f,g.active?"active":r),a&&(x.options.radius=0)),this.updateElement(g,f,x,r)}}resolveDataElementOptions(t,e){const i=this.getParsed(t);let r=super.resolveDataElementOptions(t,e);r.$shared&&(r=Object.assign({},r,{$shared:!1}));const a=r.radius;return e!=="active"&&(r.radius=0),r.radius+=nt(i&&i._custom,a),r}}Y(Sr,"id","bubble"),Y(Sr,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),Y(Sr,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function Lp(n,t,e){let i=1,r=1,a=0,s=0;if(t<kt){const o=n,l=o+t,c=Math.cos(o),u=Math.sin(o),d=Math.cos(l),f=Math.sin(l),g=(_,w,S)=>wi(_,o,l,!0)?1:Math.max(w,w*e,S,S*e),p=(_,w,S)=>wi(_,o,l,!0)?-1:Math.min(w,w*e,S,S*e),x=g(0,c,d),m=g(Pt,u,f),v=p(dt,c,d),b=p(dt+Pt,u,f);i=(x-v)/2,r=(m-b)/2,a=-(x+v)/2,s=-(m+b)/2}return{ratioX:i,ratioY:r,offsetX:a,offsetY:s}}class hn extends Oe{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,r=this._cachedMeta;if(this._parsing===!1)r._parsed=i;else{let a=l=>+i[l];if(ct(i[t])){const{key:l="value"}=this._parsing;a=c=>+on(i[c],l)}let s,o;for(s=t,o=t+e;s<o;++s)r._parsed[s]=a(s)}}_getRotation(){return qt(this.options.rotation-90)}_getCircumference(){return qt(this.options.circumference)}_getRotationExtents(){let t=kt,e=-kt;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const r=this.chart.getDatasetMeta(i).controller,a=r._getRotation(),s=r._getCircumference();t=Math.min(t,a),e=Math.max(e,a+s)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:i}=e,r=this._cachedMeta,a=r.data,s=this.getMaxBorderWidth()+this.getMaxOffset(a)+this.options.spacing,o=Math.max((Math.min(i.width,i.height)-s)/2,0),l=Math.min(Gh(this.options.cutout,o),1),c=this._getRingWeight(this.index),{circumference:u,rotation:d}=this._getRotationExtents(),{ratioX:f,ratioY:g,offsetX:p,offsetY:x}=Lp(d,u,l),m=(i.width-s)/f,v=(i.height-s)/g,b=Math.max(Math.min(m,v)/2,0),_=kl(this.options.radius,b),w=Math.max(_*l,0),S=(_-w)/this._getVisibleDatasetWeightTotal();this.offsetX=p*_,this.offsetY=x*_,r.total=this.calculateTotal(),this.outerRadius=_-S*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-S*c,0),this.updateElements(a,0,a.length,t)}_circumference(t,e){const i=this.options,r=this._cachedMeta,a=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||r._parsed[t]===null||r.data[t].hidden?0:this.calculateCircumference(r._parsed[t]*a/kt)}updateElements(t,e,i,r){const a=r==="reset",s=this.chart,o=s.chartArea,c=s.options.animation,u=(o.left+o.right)/2,d=(o.top+o.bottom)/2,f=a&&c.animateScale,g=f?0:this.innerRadius,p=f?0:this.outerRadius,{sharedOptions:x,includeOptions:m}=this._getSharedOptions(e,r);let v=this._getRotation(),b;for(b=0;b<e;++b)v+=this._circumference(b,a);for(b=e;b<e+i;++b){const _=this._circumference(b,a),w=t[b],S={x:u+this.offsetX,y:d+this.offsetY,startAngle:v,endAngle:v+_,circumference:_,outerRadius:p,innerRadius:g};m&&(S.options=x||this.resolveDataElementOptions(b,w.active?"active":r)),v+=_,this.updateElement(w,b,S,r)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let i=0,r;for(r=0;r<e.length;r++){const a=t._parsed[r];a!==null&&!isNaN(a)&&this.chart.getDataVisibility(r)&&!e[r].hidden&&(i+=Math.abs(a))}return i}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?kt*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,r=i.data.labels||[],a=Di(e._parsed[t],i.options.locale);return{label:r[t]||"",value:a}}getMaxBorderWidth(t){let e=0;const i=this.chart;let r,a,s,o,l;if(!t){for(r=0,a=i.data.datasets.length;r<a;++r)if(i.isDatasetVisible(r)){s=i.getDatasetMeta(r),t=s.data,o=s.controller;break}}if(!t)return 0;for(r=0,a=t.length;r<a;++r)l=o.resolveDataElementOptions(r),l.borderAlign!=="inner"&&(e=Math.max(e,l.borderWidth||0,l.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let i=0,r=t.length;i<r;++i){const a=this.resolveDataElementOptions(i);e=Math.max(e,a.offset||0,a.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));return e}_getRingWeight(t){return Math.max(nt(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}Y(hn,"id","doughnut"),Y(hn,"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"}),Y(hn,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),Y(hn,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:r}}=t.legend.options;return e.labels.map((a,s)=>{const l=t.getDatasetMeta(0).controller.getStyle(s);return{text:a,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:r,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(s),index:s}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}});class Ei extends Oe{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:r=[],_dataset:a}=e,s=this.chart._animationsDisabled;let{start:o,count:l}=Yl(e,r,s);this._drawStart=o,this._drawCount=l,zl(e)&&(o=0,l=r.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!a._decimated,i.points=r;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(i,void 0,{animated:!s,options:c},t),this.updateElements(r,o,l,t)}updateElements(t,e,i,r){const a=r==="reset",{iScale:s,vScale:o,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(e,r),f=s.axis,g=o.axis,{spanGaps:p,segment:x}=this.options,m=cn(p)?p:Number.POSITIVE_INFINITY,v=this.chart._animationsDisabled||a||r==="none",b=e+i,_=t.length;let w=e>0&&this.getParsed(e-1);for(let S=0;S<_;++S){const C=t[S],k=v?C:{};if(S<e||S>=b){k.skip=!0;continue}const T=this.getParsed(S),D=it(T[g]),O=k[f]=s.getPixelForValue(T[f],S),A=k[g]=a||D?o.getBasePixel():o.getPixelForValue(l?this.applyStack(o,T,l):T[g],S);k.skip=isNaN(O)||isNaN(A)||D,k.stop=S>0&&Math.abs(T[f]-w[f])>m,x&&(k.parsed=T,k.raw=c.data[S]),d&&(k.options=u||this.resolveDataElementOptions(S,C.active?"active":r)),v||this.updateElement(C,S,k,r),w=T}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,r=t.data||[];if(!r.length)return i;const a=r[0].size(this.resolveDataElementOptions(0)),s=r[r.length-1].size(this.resolveDataElementOptions(r.length-1));return Math.max(i,a,s)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}Y(Ei,"id","line"),Y(Ei,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),Y(Ei,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Ai extends Oe{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,r=i.data.labels||[],a=Di(e._parsed[t].r,i.options.locale);return{label:r[t]||"",value:a}}parseObjectData(t,e,i,r){return ic.bind(this)(t,e,i,r)}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((i,r)=>{const a=this.getParsed(r).r;!isNaN(a)&&this.chart.getDataVisibility(r)&&(a<e.min&&(e.min=a),a>e.max&&(e.max=a))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,r=Math.min(e.right-e.left,e.bottom-e.top),a=Math.max(r/2,0),s=Math.max(i.cutoutPercentage?a/100*i.cutoutPercentage:1,0),o=(a-s)/t.getVisibleDatasetCount();this.outerRadius=a-o*this.index,this.innerRadius=this.outerRadius-o}updateElements(t,e,i,r){const a=r==="reset",s=this.chart,l=s.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,d=c.yCenter,f=c.getIndexAngle(0)-.5*dt;let g=f,p;const x=360/this.countVisibleElements();for(p=0;p<e;++p)g+=this._computeAngle(p,r,x);for(p=e;p<e+i;p++){const m=t[p];let v=g,b=g+this._computeAngle(p,r,x),_=s.getDataVisibility(p)?c.getDistanceFromCenterForValue(this.getParsed(p).r):0;g=b,a&&(l.animateScale&&(_=0),l.animateRotate&&(v=b=f));const w={x:u,y:d,innerRadius:0,outerRadius:_,startAngle:v,endAngle:b,options:this.resolveDataElementOptions(p,m.active?"active":r)};this.updateElement(m,p,w,r)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((i,r)=>{!isNaN(this.getParsed(r).r)&&this.chart.getDataVisibility(r)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?qt(this.resolveDataElementOptions(t,e).angle||i):0}}Y(Ai,"id","polarArea"),Y(Ai,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),Y(Ai,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:r}}=t.legend.options;return e.labels.map((a,s)=>{const l=t.getDatasetMeta(0).controller.getStyle(s);return{text:a,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:r,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(s),index:s}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class Ja extends hn{}Y(Ja,"id","pie"),Y(Ja,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class Mr extends Oe{getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,r){return ic.bind(this)(t,e,i,r)}update(t){const e=this._cachedMeta,i=e.dataset,r=e.data||[],a=e.iScale.getLabels();if(i.points=r,t!=="resize"){const s=this.resolveDatasetElementOptions(t);this.options.showLine||(s.borderWidth=0);const o={_loop:!0,_fullLoop:a.length===r.length,options:s};this.updateElement(i,void 0,o,t)}this.updateElements(r,0,r.length,t)}updateElements(t,e,i,r){const a=this._cachedMeta.rScale,s=r==="reset";for(let o=e;o<e+i;o++){const l=t[o],c=this.resolveDataElementOptions(o,l.active?"active":r),u=a.getPointPositionForValue(o,this.getParsed(o).r),d=s?a.xCenter:u.x,f=s?a.yCenter:u.y,g={x:d,y:f,angle:u.angle,skip:isNaN(d)||isNaN(f),options:c};this.updateElement(l,o,g,r)}}}Y(Mr,"id","radar"),Y(Mr,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),Y(Mr,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class Cr extends Oe{getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:r,yScale:a}=e,s=this.getParsed(t),o=r.getLabelForValue(s.x),l=a.getLabelForValue(s.y);return{label:i[t]||"",value:"("+o+", "+l+")"}}update(t){const e=this._cachedMeta,{data:i=[]}=e,r=this.chart._animationsDisabled;let{start:a,count:s}=Yl(e,i,r);if(this._drawStart=a,this._drawCount=s,zl(e)&&(a=0,s=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:o,_dataset:l}=e;o._chart=this.chart,o._datasetIndex=this.index,o._decimated=!!l._decimated,o.points=i;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(o,void 0,{animated:!r,options:c},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(i,a,s,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,i,r){const a=r==="reset",{iScale:s,vScale:o,_stacked:l,_dataset:c}=this._cachedMeta,u=this.resolveDataElementOptions(e,r),d=this.getSharedOptions(u),f=this.includeOptions(r,d),g=s.axis,p=o.axis,{spanGaps:x,segment:m}=this.options,v=cn(x)?x:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||a||r==="none";let _=e>0&&this.getParsed(e-1);for(let w=e;w<e+i;++w){const S=t[w],C=this.getParsed(w),k=b?S:{},T=it(C[p]),D=k[g]=s.getPixelForValue(C[g],w),O=k[p]=a||T?o.getBasePixel():o.getPixelForValue(l?this.applyStack(o,C,l):C[p],w);k.skip=isNaN(D)||isNaN(O)||T,k.stop=w>0&&Math.abs(C[g]-_[g])>v,m&&(k.parsed=C,k.raw=c.data[w]),f&&(k.options=d||this.resolveDataElementOptions(w,S.active?"active":r)),b||this.updateElement(S,w,k,r),_=C}this.updateSharedOptions(d,r,u)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let o=0;for(let l=e.length-1;l>=0;--l)o=Math.max(o,e[l].size(this.resolveDataElementOptions(l))/2);return o>0&&o}const i=t.dataset,r=i.options&&i.options.borderWidth||0;if(!e.length)return r;const a=e[0].size(this.resolveDataElementOptions(0)),s=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(r,a,s)/2}}Y(Cr,"id","scatter"),Y(Cr,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),Y(Cr,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var Ip=Object.freeze({__proto__:null,BarController:Pi,BubbleController:Sr,DoughnutController:hn,LineController:Ei,PieController:Ja,PolarAreaController:Ai,RadarController:Mr,ScatterController:Cr});function An(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class ts{constructor(t){Y(this,"options");this.options=t||{}}static override(t){Object.assign(ts.prototype,t)}init(){}formats(){return An()}parse(){return An()}format(){return An()}add(){return An()}diff(){return An()}startOf(){return An()}endOf(){return An()}}var Cc={_date:ts};function Np(n,t,e,i){const{controller:r,data:a,_sorted:s}=n,o=r._cachedMeta.iScale;if(o&&t===o.axis&&t!=="r"&&s&&a.length){const l=o._reversePixels?sg:je;if(i){if(r._sharedOptions){const c=a[0],u=typeof c.getRange=="function"&&c.getRange(t);if(u){const d=l(a,t,e-u),f=l(a,t,e+u);return{lo:d.lo,hi:f.hi}}}}else return l(a,t,e)}return{lo:0,hi:a.length-1}}function Ri(n,t,e,i,r){const a=n.getSortedVisibleDatasetMetas(),s=e[t];for(let o=0,l=a.length;o<l;++o){const{index:c,data:u}=a[o],{lo:d,hi:f}=Np(a[o],t,s,r);for(let g=d;g<=f;++g){const p=u[g];p.skip||i(p,c,g)}}}function Fp(n){const t=n.indexOf("x")!==-1,e=n.indexOf("y")!==-1;return function(i,r){const a=t?Math.abs(i.x-r.x):0,s=e?Math.abs(i.y-r.y):0;return Math.sqrt(Math.pow(a,2)+Math.pow(s,2))}}function es(n,t,e,i,r){const a=[];return!r&&!n.isPointInArea(t)||Ri(n,e,t,function(o,l,c){!r&&!Ve(o,n.chartArea,0)||o.inRange(t.x,t.y,i)&&a.push({element:o,datasetIndex:l,index:c})},!0),a}function Up(n,t,e,i){let r=[];function a(s,o,l){const{startAngle:c,endAngle:u}=s.getProps(["startAngle","endAngle"],i),{angle:d}=Il(s,{x:t.x,y:t.y});wi(d,c,u)&&r.push({element:s,datasetIndex:o,index:l})}return Ri(n,e,t,a),r}function Bp(n,t,e,i,r,a){let s=[];const o=Fp(e);let l=Number.POSITIVE_INFINITY;function c(u,d,f){const g=u.inRange(t.x,t.y,r);if(i&&!g)return;const p=u.getCenterPoint(r);if(!(!!a||n.isPointInArea(p))&&!g)return;const m=o(t,p);m<l?(s=[{element:u,datasetIndex:d,index:f}],l=m):m===l&&s.push({element:u,datasetIndex:d,index:f})}return Ri(n,e,t,c),s}function ns(n,t,e,i,r,a){return!a&&!n.isPointInArea(t)?[]:e==="r"&&!i?Up(n,t,e,r):Bp(n,t,e,i,r,a)}function kc(n,t,e,i,r){const a=[],s=e==="x"?"inXRange":"inYRange";let o=!1;return Ri(n,e,t,(l,c,u)=>{l[s](t[e],r)&&(a.push({element:l,datasetIndex:c,index:u}),o=o||l.inRange(t.x,t.y,r))}),i&&!o?[]:a}var is={evaluateInteractionItems:Ri,modes:{index(n,t,e,i){const r=fn(t,n),a=e.axis||"x",s=e.includeInvisible||!1,o=e.intersect?es(n,r,a,i,s):ns(n,r,a,!1,i,s),l=[];return o.length?(n.getSortedVisibleDatasetMetas().forEach(c=>{const u=o[0].index,d=c.data[u];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:u})}),l):[]},dataset(n,t,e,i){const r=fn(t,n),a=e.axis||"xy",s=e.includeInvisible||!1;let o=e.intersect?es(n,r,a,i,s):ns(n,r,a,!1,i,s);if(o.length>0){const l=o[0].datasetIndex,c=n.getDatasetMeta(l).data;o=[];for(let u=0;u<c.length;++u)o.push({element:c[u],datasetIndex:l,index:u})}return o},point(n,t,e,i){const r=fn(t,n),a=e.axis||"xy",s=e.includeInvisible||!1;return es(n,r,a,i,s)},nearest(n,t,e,i){const r=fn(t,n),a=e.axis||"xy",s=e.includeInvisible||!1;return ns(n,r,a,e.intersect,i,s)},x(n,t,e,i){const r=fn(t,n);return kc(n,r,"x",e.intersect,i)},y(n,t,e,i){const r=fn(t,n);return kc(n,r,"y",e.intersect,i)}}};const Oc=["left","top","right","bottom"];function Li(n,t){return n.filter(e=>e.pos===t)}function Pc(n,t){return n.filter(e=>Oc.indexOf(e.pos)===-1&&e.box.axis===t)}function Ii(n,t){return n.sort((e,i)=>{const r=t?i:e,a=t?e:i;return r.weight===a.weight?r.index-a.index:r.weight-a.weight})}function Wp(n){const t=[];let e,i,r,a,s,o;for(e=0,i=(n||[]).length;e<i;++e)r=n[e],{position:a,options:{stack:s,stackWeight:o=1}}=r,t.push({index:e,box:r,pos:a,horizontal:r.isHorizontal(),weight:r.weight,stack:s&&a+s,stackWeight:o});return t}function Yp(n){const t={};for(const e of n){const{stack:i,pos:r,stackWeight:a}=e;if(!i||!Oc.includes(r))continue;const s=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});s.count++,s.weight+=a}return t}function zp(n,t){const e=Yp(n),{vBoxMaxWidth:i,hBoxMaxHeight:r}=t;let a,s,o;for(a=0,s=n.length;a<s;++a){o=n[a];const{fullSize:l}=o.box,c=e[o.stack],u=c&&o.stackWeight/c.weight;o.horizontal?(o.width=u?u*i:l&&t.availableWidth,o.height=r):(o.width=i,o.height=u?u*r:l&&t.availableHeight)}return e}function Hp(n){const t=Wp(n),e=Ii(t.filter(c=>c.box.fullSize),!0),i=Ii(Li(t,"left"),!0),r=Ii(Li(t,"right")),a=Ii(Li(t,"top"),!0),s=Ii(Li(t,"bottom")),o=Pc(t,"x"),l=Pc(t,"y");return{fullSize:e,leftAndTop:i.concat(a),rightAndBottom:r.concat(l).concat(s).concat(o),chartArea:Li(t,"chartArea"),vertical:i.concat(r).concat(l),horizontal:a.concat(s).concat(o)}}function Ec(n,t,e,i){return Math.max(n[e],t[e])+Math.max(n[i],t[i])}function Ac(n,t){n.top=Math.max(n.top,t.top),n.left=Math.max(n.left,t.left),n.bottom=Math.max(n.bottom,t.bottom),n.right=Math.max(n.right,t.right)}function $p(n,t,e,i){const{pos:r,box:a}=e,s=n.maxPadding;if(!ct(r)){e.size&&(n[r]-=e.size);const d=i[e.stack]||{size:0,count:1};d.size=Math.max(d.size,e.horizontal?a.height:a.width),e.size=d.size/d.count,n[r]+=e.size}a.getPadding&&Ac(s,a.getPadding());const o=Math.max(0,t.outerWidth-Ec(s,n,"left","right")),l=Math.max(0,t.outerHeight-Ec(s,n,"top","bottom")),c=o!==n.w,u=l!==n.h;return n.w=o,n.h=l,e.horizontal?{same:c,other:u}:{same:u,other:c}}function jp(n){const t=n.maxPadding;function e(i){const r=Math.max(t[i]-n[i],0);return n[i]+=r,r}n.y+=e("top"),n.x+=e("left"),e("right"),e("bottom")}function Vp(n,t){const e=t.maxPadding;function i(r){const a={left:0,top:0,right:0,bottom:0};return r.forEach(s=>{a[s]=Math.max(t[s],e[s])}),a}return i(n?["left","right"]:["top","bottom"])}function Ni(n,t,e,i){const r=[];let a,s,o,l,c,u;for(a=0,s=n.length,c=0;a<s;++a){o=n[a],l=o.box,l.update(o.width||t.w,o.height||t.h,Vp(o.horizontal,t));const{same:d,other:f}=$p(t,e,o,i);c|=d&&r.length,u=u||f,l.fullSize||r.push(o)}return c&&Ni(r,t,e,i)||u}function kr(n,t,e,i,r){n.top=e,n.left=t,n.right=t+i,n.bottom=e+r,n.width=i,n.height=r}function Rc(n,t,e,i){const r=e.padding;let{x:a,y:s}=t;for(const o of n){const l=o.box,c=i[o.stack]||{count:1,placed:0,weight:1},u=o.stackWeight/c.weight||1;if(o.horizontal){const d=t.w*u,f=c.size||l.height;ue(c.start)&&(s=c.start),l.fullSize?kr(l,r.left,s,e.outerWidth-r.right-r.left,f):kr(l,t.left+c.placed,s,d,f),c.start=s,c.placed+=d,s=l.bottom}else{const d=t.h*u,f=c.size||l.width;ue(c.start)&&(a=c.start),l.fullSize?kr(l,a,r.top,f,e.outerHeight-r.bottom-r.top):kr(l,a,t.top+c.placed,f,d),c.start=a,c.placed+=d,a=l.right}}t.x=a,t.y=s}var re={addBox(n,t){n.boxes||(n.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)}}]},n.boxes.push(t)},removeBox(n,t){const e=n.boxes?n.boxes.indexOf(t):-1;e!==-1&&n.boxes.splice(e,1)},configure(n,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(n,t,e,i){if(!n)return;const r=Xt(n.options.layout.padding),a=Math.max(t-r.width,0),s=Math.max(e-r.height,0),o=Hp(n.boxes),l=o.vertical,c=o.horizontal;_t(n.boxes,x=>{typeof x.beforeLayout=="function"&&x.beforeLayout()});const u=l.reduce((x,m)=>m.box.options&&m.box.options.display===!1?x:x+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:e,padding:r,availableWidth:a,availableHeight:s,vBoxMaxWidth:a/2/u,hBoxMaxHeight:s/2}),f=Object.assign({},r);Ac(f,Xt(i));const g=Object.assign({maxPadding:f,w:a,h:s,x:r.left,y:r.top},r),p=zp(l.concat(c),d);Ni(o.fullSize,g,d,p),Ni(l,g,d,p),Ni(c,g,d,p)&&Ni(l,g,d,p),jp(g),Rc(o.leftAndTop,g,d,p),g.x+=g.w,g.y+=g.h,Rc(o.rightAndBottom,g,d,p),n.chartArea={left:g.left,top:g.top,right:g.left+g.w,bottom:g.top+g.h,height:g.h,width:g.w},_t(o.chartArea,x=>{const m=x.box;Object.assign(m,n.chartArea),m.update(g.w,g.h,{left:0,top:0,right:0,bottom:0})})}};class Lc{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,r){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,r?Math.floor(e/r):i)}}isAttached(t){return!0}updateConfig(t){}}class qp extends Lc{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Or="$chartjs",Xp={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Ic=n=>n===null||n==="";function Gp(n,t){const e=n.style,i=n.getAttribute("height"),r=n.getAttribute("width");if(n[Or]={initial:{height:i,width:r,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",Ic(r)){const a=sc(n,"width");a!==void 0&&(n.width=a)}if(Ic(i))if(n.style.height==="")n.height=n.width/(t||2);else{const a=sc(n,"height");a!==void 0&&(n.height=a)}return n}const Nc=Jg?{passive:!0}:!1;function Kp(n,t,e){n.addEventListener(t,e,Nc)}function Zp(n,t,e){n.canvas.removeEventListener(t,e,Nc)}function Qp(n,t){const e=Xp[n.type]||n.type,{x:i,y:r}=fn(n,t);return{type:e,chart:t,native:n,x:i!==void 0?i:null,y:r!==void 0?r:null}}function Pr(n,t){for(const e of n)if(e===t||e.contains(t))return!0}function Jp(n,t,e){const i=n.canvas,r=new MutationObserver(a=>{let s=!1;for(const o of a)s=s||Pr(o.addedNodes,i),s=s&&!Pr(o.removedNodes,i);s&&e()});return r.observe(document,{childList:!0,subtree:!0}),r}function tm(n,t,e){const i=n.canvas,r=new MutationObserver(a=>{let s=!1;for(const o of a)s=s||Pr(o.removedNodes,i),s=s&&!Pr(o.addedNodes,i);s&&e()});return r.observe(document,{childList:!0,subtree:!0}),r}const Fi=new Map;let Fc=0;function Uc(){const n=window.devicePixelRatio;n!==Fc&&(Fc=n,Fi.forEach((t,e)=>{e.currentDevicePixelRatio!==n&&t()}))}function em(n,t){Fi.size||window.addEventListener("resize",Uc),Fi.set(n,t)}function nm(n){Fi.delete(n),Fi.size||window.removeEventListener("resize",Uc)}function im(n,t,e){const i=n.canvas,r=i&&Xa(i);if(!r)return;const a=Wl((o,l)=>{const c=r.clientWidth;e(o,l),c<r.clientWidth&&e()},window),s=new ResizeObserver(o=>{const l=o[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||a(c,u)});return s.observe(r),em(n,a),s}function rs(n,t,e){e&&e.disconnect(),t==="resize"&&nm(n)}function rm(n,t,e){const i=n.canvas,r=Wl(a=>{n.ctx!==null&&e(Qp(a,n))},n);return Kp(i,t,r),r}class am extends Lc{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(Gp(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[Or])return!1;const i=e[Or].initial;["height","width"].forEach(a=>{const s=i[a];it(s)?e.removeAttribute(a):e.setAttribute(a,s)});const r=i.style||{};return Object.keys(r).forEach(a=>{e.style[a]=r[a]}),e.width=e.width,delete e[Or],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const r=t.$proxies||(t.$proxies={}),s={attach:Jp,detach:tm,resize:im}[e]||rm;r[e]=s(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),r=i[e];if(!r)return;({attach:rs,detach:rs,resize:rs}[e]||Zp)(t,e,r),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,r){return Qg(t,e,i,r)}isAttached(t){const e=Xa(t);return!!(e&&e.isConnected)}}function sm(n){return!qa()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?qp:am}class te{constructor(){Y(this,"x");Y(this,"y");Y(this,"active",!1);Y(this,"options");Y(this,"$animations")}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return cn(this.x)&&cn(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const r={};return t.forEach(a=>{r[a]=i[a]&&i[a].active()?i[a]._to:this[a]}),r}}Y(te,"defaults",{}),Y(te,"defaultRoutes");function om(n,t){const e=n.options.ticks,i=lm(n),r=Math.min(e.maxTicksLimit||i,i),a=e.major.enabled?um(t):[],s=a.length,o=a[0],l=a[s-1],c=[];if(s>r)return dm(t,c,a,s/r),c;const u=cm(a,t,r);if(s>0){let d,f;const g=s>1?Math.round((l-o)/(s-1)):null;for(Er(t,c,u,it(g)?0:o-g,o),d=0,f=s-1;d<f;d++)Er(t,c,u,a[d],a[d+1]);return Er(t,c,u,l,it(g)?t.length:l+g),c}return Er(t,c,u),c}function lm(n){const t=n.options.offset,e=n._tickSize(),i=n._length/e+(t?0:1),r=n._maxLength/e;return Math.floor(Math.min(i,r))}function cm(n,t,e){const i=fm(n),r=t.length/e;if(!i)return Math.max(r,1);const a=ng(i);for(let s=0,o=a.length-1;s<o;s++){const l=a[s];if(l>r)return l}return Math.max(r,1)}function um(n){const t=[];let e,i;for(e=0,i=n.length;e<i;e++)n[e].major&&t.push(e);return t}function dm(n,t,e,i){let r=0,a=e[0],s;for(i=Math.ceil(i),s=0;s<n.length;s++)s===a&&(t.push(n[s]),r++,a=e[r*i])}function Er(n,t,e,i,r){const a=nt(i,0),s=Math.min(nt(r,n.length),n.length);let o=0,l,c,u;for(e=Math.ceil(e),r&&(l=r-i,e=l/Math.floor(l/e)),u=a;u<0;)o++,u=Math.round(a+o*e);for(c=Math.max(a,0);c<s;c++)c===u&&(t.push(n[c]),o++,u=Math.round(a+o*e))}function fm(n){const t=n.length;let e,i;if(t<2)return!1;for(i=n[0],e=1;e<t;++e)if(n[e]-n[e-1]!==i)return!1;return i}const hm=n=>n==="left"?"right":n==="right"?"left":n,Bc=(n,t,e)=>t==="top"||t==="left"?n[t]+e:n[t]-e,Wc=(n,t)=>Math.min(t||n,n);function Yc(n,t){const e=[],i=n.length/t,r=n.length;let a=0;for(;a<r;a+=i)e.push(n[Math.floor(a)]);return e}function gm(n,t,e){const i=n.ticks.length,r=Math.min(t,i-1),a=n._startPixel,s=n._endPixel,o=1e-6;let l=n.getPixelForTick(r),c;if(!(e&&(i===1?c=Math.max(l-a,s-l):t===0?c=(n.getPixelForTick(1)-l)/2:c=(l-n.getPixelForTick(r-1))/2,l+=r<t?c:-c,l<a-o||l>s+o)))return l}function pm(n,t){_t(n,e=>{const i=e.gc,r=i.length/2;let a;if(r>t){for(a=0;a<r;++a)delete e.data[i[a]];i.splice(0,r)}})}function Ui(n){return n.drawTicks?n.tickLength:0}function zc(n,t){if(!n.display)return 0;const e=Et(n.font,t),i=Xt(n.padding);return(yt(n.text)?n.text.length:1)*e.lineHeight+i.height}function mm(n,t){return dn(n,{scale:t,type:"scale"})}function ym(n,t,e){return dn(n,{tick:e,index:t,type:"tick"})}function bm(n,t,e){let i=Fa(n);return(e&&t!=="right"||!e&&t==="right")&&(i=hm(i)),i}function vm(n,t,e,i){const{top:r,left:a,bottom:s,right:o,chart:l}=n,{chartArea:c,scales:u}=l;let d=0,f,g,p;const x=s-r,m=o-a;if(n.isHorizontal()){if(g=ie(i,a,o),ct(e)){const v=Object.keys(e)[0],b=e[v];p=u[v].getPixelForValue(b)+x-t}else e==="center"?p=(c.bottom+c.top)/2+x-t:p=Bc(n,e,t);f=o-a}else{if(ct(e)){const v=Object.keys(e)[0],b=e[v];g=u[v].getPixelForValue(b)-m+t}else e==="center"?g=(c.left+c.right)/2-m+t:g=Bc(n,e,t);p=ie(i,s,r),d=e==="left"?-Pt:Pt}return{titleX:g,titleY:p,maxWidth:f,rotation:d}}class Rn extends te{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:r}=this;return t=be(t,Number.POSITIVE_INFINITY),e=be(e,Number.NEGATIVE_INFINITY),i=be(i,Number.POSITIVE_INFINITY),r=be(r,Number.NEGATIVE_INFINITY),{min:be(t,i),max:be(e,r),minDefined:Lt(t),maxDefined:Lt(e)}}getMinMax(t){let{min:e,max:i,minDefined:r,maxDefined:a}=this.getUserBounds(),s;if(r&&a)return{min:e,max:i};const o=this.getMatchingVisibleMetas();for(let l=0,c=o.length;l<c;++l)s=o[l].controller.getMinMax(this,t),r||(e=Math.min(e,s.min)),a||(i=Math.max(i,s.max));return e=a&&e>i?i:e,i=r&&e>i?e:i,{min:be(e,be(i,e)),max:be(i,be(e,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){xt(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:r,grace:a,ticks:s}=this.options,o=s.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Pg(this,a,r),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=o<this.ticks.length;this._convertTicksToLabels(l?Yc(this.ticks,o):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),s.display&&(s.autoSkip||s.source==="auto")&&(this.ticks=om(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,i;this.isHorizontal()?(e=this.left,i=this.right):(e=this.top,i=this.bottom,t=!t),this._startPixel=e,this._endPixel=i,this._reversePixels=t,this._length=i-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){xt(this.options.afterUpdate,[this])}beforeSetDimensions(){xt(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(){xt(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),xt(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){xt(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,r,a;for(i=0,r=t.length;i<r;i++)a=t[i],a.label=xt(e.callback,[a.value,i,t],this)}afterTickToLabelConversion(){xt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){xt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=Wc(this.ticks.length,t.ticks.maxTicksLimit),r=e.minRotation||0,a=e.maxRotation;let s=r,o,l,c;if(!this._isVisible()||!e.display||r>=a||i<=1||!this.isHorizontal()){this.labelRotation=r;return}const u=this._getLabelSizes(),d=u.widest.width,f=u.highest.height,g=Zt(this.chart.width-d,0,this.maxWidth);o=t.offset?this.maxWidth/i:g/(i-1),d+6>o&&(o=g/(i-(t.offset?.5:1)),l=this.maxHeight-Ui(t.grid)-e.padding-zc(t.title,this.chart.options.font),c=Math.sqrt(d*d+f*f),s=yr(Math.min(Math.asin(Zt((u.highest.height+6)/o,-1,1)),Math.asin(Zt(l/c,-1,1))-Math.asin(Zt(f/c,-1,1)))),s=Math.max(r,Math.min(a,s))),this.labelRotation=s}afterCalculateLabelRotation(){xt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){xt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:r,grid:a}}=this,s=this._isVisible(),o=this.isHorizontal();if(s){const l=zc(r,e.options.font);if(o?(t.width=this.maxWidth,t.height=Ui(a)+l):(t.height=this.maxHeight,t.width=Ui(a)+l),i.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:f}=this._getLabelSizes(),g=i.padding*2,p=qt(this.labelRotation),x=Math.cos(p),m=Math.sin(p);if(o){const v=i.mirror?0:m*d.width+x*f.height;t.height=Math.min(this.maxHeight,t.height+v+g)}else{const v=i.mirror?0:x*d.width+m*f.height;t.width=Math.min(this.maxWidth,t.width+v+g)}this._calculatePadding(c,u,m,x)}}this._handleMargins(),o?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,r){const{ticks:{align:a,padding:s},position:o}=this.options,l=this.labelRotation!==0,c=o!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,g=0;l?c?(f=r*t.width,g=i*e.height):(f=i*t.height,g=r*e.width):a==="start"?g=e.width:a==="end"?f=t.width:a!=="inner"&&(f=t.width/2,g=e.width/2),this.paddingLeft=Math.max((f-u+s)*this.width/(this.width-u),0),this.paddingRight=Math.max((g-d+s)*this.width/(this.width-d),0)}else{let u=e.height/2,d=t.height/2;a==="start"?(u=0,d=t.height):a==="end"&&(u=e.height,d=0),this.paddingTop=u+s,this.paddingBottom=d+s}}_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(){xt(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,i;for(e=0,i=t.length;e<i;e++)it(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let i=this.ticks;e<i.length&&(i=Yc(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){const{ctx:r,_longestTextCache:a}=this,s=[],o=[],l=Math.floor(e/Wc(e,i));let c=0,u=0,d,f,g,p,x,m,v,b,_,w,S;for(d=0;d<e;d+=l){if(p=t[d].label,x=this._resolveTickFontOptions(d),r.font=m=x.string,v=a[m]=a[m]||{data:{},gc:[]},b=x.lineHeight,_=w=0,!it(p)&&!yt(p))_=xr(r,v.data,v.gc,_,p),w=b;else if(yt(p))for(f=0,g=p.length;f<g;++f)S=p[f],!it(S)&&!yt(S)&&(_=xr(r,v.data,v.gc,_,S),w+=b);s.push(_),o.push(w),c=Math.max(_,c),u=Math.max(w,u)}pm(a,e);const C=s.indexOf(c),k=o.indexOf(u),T=D=>({width:s[D]||0,height:o[D]||0});return{first:T(0),last:T(e-1),widest:T(C),highest:T(k),widths:s,heights:o}}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 ag(this._alignToPixels?kn(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const i=e[t];return i.$context||(i.$context=ym(this.getContext(),t,i))}return this.$context||(this.$context=mm(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=qt(this.labelRotation),i=Math.abs(Math.cos(e)),r=Math.abs(Math.sin(e)),a=this._getLabelSizes(),s=t.autoSkipPadding||0,o=a?a.widest.width+s:0,l=a?a.highest.height+s:0;return this.isHorizontal()?l*i>o*r?o/i:l/r:l*r<o*i?l/i:o/r}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=this.chart,r=this.options,{grid:a,position:s,border:o}=r,l=a.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),f=Ui(a),g=[],p=o.setContext(this.getContext()),x=p.display?p.width:0,m=x/2,v=function(H){return kn(i,H,x)};let b,_,w,S,C,k,T,D,O,A,R,W;if(s==="top")b=v(this.bottom),k=this.bottom-f,D=b-m,A=v(t.top)+m,W=t.bottom;else if(s==="bottom")b=v(this.top),A=t.top,W=v(t.bottom)-m,k=b+m,D=this.top+f;else if(s==="left")b=v(this.right),C=this.right-f,T=b-m,O=v(t.left)+m,R=t.right;else if(s==="right")b=v(this.left),O=t.left,R=v(t.right)-m,C=b+m,T=this.left+f;else if(e==="x"){if(s==="center")b=v((t.top+t.bottom)/2+.5);else if(ct(s)){const H=Object.keys(s)[0],I=s[H];b=v(this.chart.scales[H].getPixelForValue(I))}A=t.top,W=t.bottom,k=b+m,D=k+f}else if(e==="y"){if(s==="center")b=v((t.left+t.right)/2);else if(ct(s)){const H=Object.keys(s)[0],I=s[H];b=v(this.chart.scales[H].getPixelForValue(I))}C=b-m,T=C-f,O=t.left,R=t.right}const V=nt(r.ticks.maxTicksLimit,d),L=Math.max(1,Math.ceil(d/V));for(_=0;_<d;_+=L){const H=this.getContext(_),I=a.setContext(H),et=o.setContext(H),z=I.lineWidth,Mt=I.color,F=et.dash||[],E=et.dashOffset,$=I.tickWidth,K=I.tickColor,X=I.tickBorderDash||[],Q=I.tickBorderDashOffset;w=gm(this,_,l),w!==void 0&&(S=kn(i,w,z),c?C=T=O=R=S:k=D=A=W=S,g.push({tx1:C,ty1:k,tx2:T,ty2:D,x1:O,y1:A,x2:R,y2:W,width:z,color:Mt,borderDash:F,borderDashOffset:E,tickWidth:$,tickColor:K,tickBorderDash:X,tickBorderDashOffset:Q}))}return this._ticksLength=d,this._borderValue=b,g}_computeLabelItems(t){const e=this.axis,i=this.options,{position:r,ticks:a}=i,s=this.isHorizontal(),o=this.ticks,{align:l,crossAlign:c,padding:u,mirror:d}=a,f=Ui(i.grid),g=f+u,p=d?-u:g,x=-qt(this.labelRotation),m=[];let v,b,_,w,S,C,k,T,D,O,A,R,W="middle";if(r==="top")C=this.bottom-p,k=this._getXAxisLabelAlignment();else if(r==="bottom")C=this.top+p,k=this._getXAxisLabelAlignment();else if(r==="left"){const L=this._getYAxisLabelAlignment(f);k=L.textAlign,S=L.x}else if(r==="right"){const L=this._getYAxisLabelAlignment(f);k=L.textAlign,S=L.x}else if(e==="x"){if(r==="center")C=(t.top+t.bottom)/2+g;else if(ct(r)){const L=Object.keys(r)[0],H=r[L];C=this.chart.scales[L].getPixelForValue(H)+g}k=this._getXAxisLabelAlignment()}else if(e==="y"){if(r==="center")S=(t.left+t.right)/2-g;else if(ct(r)){const L=Object.keys(r)[0],H=r[L];S=this.chart.scales[L].getPixelForValue(H)}k=this._getYAxisLabelAlignment(f).textAlign}e==="y"&&(l==="start"?W="top":l==="end"&&(W="bottom"));const V=this._getLabelSizes();for(v=0,b=o.length;v<b;++v){_=o[v],w=_.label;const L=a.setContext(this.getContext(v));T=this.getPixelForTick(v)+a.labelOffset,D=this._resolveTickFontOptions(v),O=D.lineHeight,A=yt(w)?w.length:1;const H=A/2,I=L.color,et=L.textStrokeColor,z=L.textStrokeWidth;let Mt=k;s?(S=T,k==="inner"&&(v===b-1?Mt=this.options.reverse?"left":"right":v===0?Mt=this.options.reverse?"right":"left":Mt="center"),r==="top"?c==="near"||x!==0?R=-A*O+O/2:c==="center"?R=-V.highest.height/2-H*O+O:R=-V.highest.height+O/2:c==="near"||x!==0?R=O/2:c==="center"?R=V.highest.height/2-H*O:R=V.highest.height-A*O,d&&(R*=-1),x!==0&&!L.showLabelBackdrop&&(S+=O/2*Math.sin(x))):(C=T,R=(1-A)*O/2);let F;if(L.showLabelBackdrop){const E=Xt(L.backdropPadding),$=V.heights[v],K=V.widths[v];let X=R-E.top,Q=0-E.left;switch(W){case"middle":X-=$/2;break;case"bottom":X-=$;break}switch(k){case"center":Q-=K/2;break;case"right":Q-=K;break;case"inner":v===b-1?Q-=K:v>0&&(Q-=K/2);break}F={left:Q,top:X,width:K+E.width,height:$+E.height,color:L.backdropColor}}m.push({label:w,font:D,textOffset:R,options:{rotation:x,color:I,strokeColor:et,strokeWidth:z,textAlign:Mt,textBaseline:W,translation:[S,C],backdrop:F}})}return m}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-qt(this.labelRotation))return t==="top"?"left":"right";let r="center";return e.align==="start"?r="left":e.align==="end"?r="right":e.align==="inner"&&(r="inner"),r}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:r,padding:a}}=this.options,s=this._getLabelSizes(),o=t+a,l=s.widest.width;let c,u;return e==="left"?r?(u=this.right+a,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-o,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u=this.left)):e==="right"?r?(u=this.left+a,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+o,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:r,width:a,height:s}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,r,a,s),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const r=this.ticks.findIndex(a=>a.value===t);return r>=0?e.setContext(this.getContext(r)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,r=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let a,s;const o=(l,c,u)=>{!u.width||!u.color||(i.save(),i.lineWidth=u.width,i.strokeStyle=u.color,i.setLineDash(u.borderDash||[]),i.lineDashOffset=u.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(c.x,c.y),i.stroke(),i.restore())};if(e.display)for(a=0,s=r.length;a<s;++a){const l=r[a];e.drawOnChartArea&&o({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),e.drawTicks&&o({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:i,grid:r}}=this,a=i.setContext(this.getContext()),s=i.display?a.width:0;if(!s)return;const o=r.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,u,d,f;this.isHorizontal()?(c=kn(t,this.left,s)-s/2,u=kn(t,this.right,o)+o/2,d=f=l):(d=kn(t,this.top,s)-s/2,f=kn(t,this.bottom,o)+o/2,c=u=l),e.save(),e.lineWidth=a.width,e.strokeStyle=a.color,e.beginPath(),e.moveTo(c,d),e.lineTo(u,f),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,r=this._computeLabelArea();r&&Mi(i,r);const a=this.getLabelItems(t);for(const s of a){const o=s.options,l=s.font,c=s.label,u=s.textOffset;On(i,c,0,u,l,o)}r&&Ci(i)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:r}}=this;if(!i.display)return;const a=Et(i.font),s=Xt(i.padding),o=i.align;let l=a.lineHeight/2;e==="bottom"||e==="center"||ct(e)?(l+=s.bottom,yt(i.text)&&(l+=a.lineHeight*(i.text.length-1))):l+=s.top;const{titleX:c,titleY:u,maxWidth:d,rotation:f}=vm(this,l,e,o);On(t,i.text,0,0,a,{color:i.color,maxWidth:d,rotation:f,textAlign:bm(o,e,r),textBaseline:"middle",translation:[c,u]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,i=nt(t.grid&&t.grid.z,-1),r=nt(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Rn.prototype.draw?[{z:e,draw:a=>{this.draw(a)}}]:[{z:i,draw:a=>{this.drawBackground(),this.drawGrid(a),this.drawTitle()}},{z:r,draw:()=>{this.drawBorder()}},{z:e,draw:a=>{this.drawLabels(a)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",r=[];let a,s;for(a=0,s=e.length;a<s;++a){const o=e[a];o[i]===this.id&&(!t||o.type===t)&&r.push(o)}return r}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return Et(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Ar{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let i;wm(e)&&(i=this.register(e));const r=this.items,a=t.id,s=this.scope+"."+a;if(!a)throw new Error("class does not have id: "+t);return a in r||(r[a]=t,xm(t,s,i),this.override&&Ft.override(t.id,t.overrides)),s}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,r=this.scope;i in e&&delete e[i],r&&i in Ft[r]&&(delete Ft[r][i],this.override&&delete Cn[i])}}function xm(n,t,e){const i=vi(Object.create(null),[e?Ft.get(e):{},Ft.get(t),n.defaults]);Ft.set(t,i),n.defaultRoutes&&_m(t,n.defaultRoutes),n.descriptors&&Ft.describe(t,n.descriptors)}function _m(n,t){Object.keys(t).forEach(e=>{const i=e.split("."),r=i.pop(),a=[n].concat(i).join("."),s=t[e].split("."),o=s.pop(),l=s.join(".");Ft.route(a,r,l,o)})}function wm(n){return"id"in n&&"defaults"in n}class Tm{constructor(){this.controllers=new Ar(Oe,"datasets",!0),this.elements=new Ar(te,"elements"),this.plugins=new Ar(Object,"plugins"),this.scales=new Ar(Rn,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(r=>{const a=i||this._getRegistryForType(r);i||a.isForType(r)||a===this.plugins&&r.id?this._exec(t,a,r):_t(r,s=>{const o=i||this._getRegistryForType(s);this._exec(t,o,s)})})}_exec(t,e,i){const r=La(t);xt(i["before"+r],[],i),e[t](i),xt(i["after"+r],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const r=e.get(t);if(r===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return r}}var Ie=new Tm;class Dm{constructor(){this._init=[]}notify(t,e,i,r){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const a=r?this._descriptors(t).filter(r):this._descriptors(t),s=this._notify(a,t,e,i);return e==="afterDestroy"&&(this._notify(a,t,"stop"),this._notify(this._init,t,"uninstall")),s}_notify(t,e,i,r){r=r||{};for(const a of t){const s=a.plugin,o=s[i],l=[e,r,a.options];if(xt(o,l,s)===!1&&r.cancelable)return!1}return!0}invalidate(){it(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const i=t&&t.config,r=nt(i.options&&i.options.plugins,{}),a=Sm(i);return r===!1&&!e?[]:Cm(t,a,r,e)}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,r=(a,s)=>a.filter(o=>!s.some(l=>o.plugin.id===l.plugin.id));this._notify(r(e,i),t,"stop"),this._notify(r(i,e),t,"start")}}function Sm(n){const t={},e=[],i=Object.keys(Ie.plugins.items);for(let a=0;a<i.length;a++)e.push(Ie.getPlugin(i[a]));const r=n.plugins||[];for(let a=0;a<r.length;a++){const s=r[a];e.indexOf(s)===-1&&(e.push(s),t[s.id]=!0)}return{plugins:e,localIds:t}}function Mm(n,t){return!t&&n===!1?null:n===!0?{}:n}function Cm(n,{plugins:t,localIds:e},i,r){const a=[],s=n.getContext();for(const o of t){const l=o.id,c=Mm(i[l],r);c!==null&&a.push({plugin:o,options:km(n.config,{plugin:o,local:e[l]},c,s)})}return a}function km(n,{plugin:t,local:e},i,r){const a=n.pluginScopeKeys(t),s=n.getOptionScopes(i,a);return e&&t.defaults&&s.push(t.defaults),n.createResolver(s,r,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function as(n,t){const e=Ft.datasets[n]||{};return((t.datasets||{})[n]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function Om(n,t){let e=n;return n==="_index_"?e=t:n==="_value_"&&(e=t==="x"?"y":"x"),e}function Pm(n,t){return n===t?"_index_":"_value_"}function Hc(n){if(n==="x"||n==="y"||n==="r")return n}function Em(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function ss(n,...t){if(Hc(n))return n;for(const e of t){const i=e.axis||Em(e.position)||n.length>1&&Hc(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function $c(n,t,e){if(e[t+"AxisID"]===n)return{axis:t}}function Am(n,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(i=>i.xAxisID===n||i.yAxisID===n);if(e.length)return $c(n,"x",e[0])||$c(n,"y",e[0])}return{}}function Rm(n,t){const e=Cn[n.type]||{scales:{}},i=t.scales||{},r=as(n.type,t),a=Object.create(null);return Object.keys(i).forEach(s=>{const o=i[s];if(!ct(o))return console.error(`Invalid scale configuration for scale: ${s}`);if(o._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${s}`);const l=ss(s,o,Am(s,n),Ft.scales[o.type]),c=Pm(l,r),u=e.scales||{};a[s]=xi(Object.create(null),[{axis:l},o,u[l],u[c]])}),n.data.datasets.forEach(s=>{const o=s.type||n.type,l=s.indexAxis||as(o,t),u=(Cn[o]||{}).scales||{};Object.keys(u).forEach(d=>{const f=Om(d,l),g=s[f+"AxisID"]||f;a[g]=a[g]||Object.create(null),xi(a[g],[{axis:f},i[g],u[d]])})}),Object.keys(a).forEach(s=>{const o=a[s];xi(o,[Ft.scales[o.type],Ft.scale])}),a}function jc(n){const t=n.options||(n.options={});t.plugins=nt(t.plugins,{}),t.scales=Rm(n,t)}function Vc(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function Lm(n){return n=n||{},n.data=Vc(n.data),jc(n),n}const qc=new Map,Xc=new Set;function Rr(n,t){let e=qc.get(n);return e||(e=t(),qc.set(n,e),Xc.add(e)),e}const Bi=(n,t,e)=>{const i=on(t,e);i!==void 0&&n.add(i)};class Im{constructor(t){this._config=Lm(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=Vc(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(),jc(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Rr(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return Rr(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return Rr(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,i=this.type;return Rr(`${i}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let r=i.get(t);return(!r||e)&&(r=new Map,i.set(t,r)),r}getOptionScopes(t,e,i){const{options:r,type:a}=this,s=this._cachedScopes(t,i),o=s.get(e);if(o)return o;const l=new Set;e.forEach(u=>{t&&(l.add(t),u.forEach(d=>Bi(l,t,d))),u.forEach(d=>Bi(l,r,d)),u.forEach(d=>Bi(l,Cn[a]||{},d)),u.forEach(d=>Bi(l,Ft,d)),u.forEach(d=>Bi(l,Wa,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Xc.has(e)&&s.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,Cn[e]||{},Ft.datasets[e]||{},{type:e},Ft,Wa]}resolveNamedOptions(t,e,i,r=[""]){const a={$shared:!0},{resolver:s,subPrefixes:o}=Gc(this._resolverCache,t,r);let l=s;if(Fm(s,e)){a.$shared=!1,i=de(i)?i():i;const c=this.createResolver(t,i,o);l=Zn(s,i,c)}for(const c of e)a[c]=l[c];return a}createResolver(t,e,i=[""],r){const{resolver:a}=Gc(this._resolverCache,t,i);return ct(e)?Zn(a,e,void 0,r):a}}function Gc(n,t,e){let i=n.get(t);i||(i=new Map,n.set(t,i));const r=e.join();let a=i.get(r);return a||(a={resolver:$a(t,e),subPrefixes:e.filter(o=>!o.toLowerCase().includes("hover"))},i.set(r,a)),a}const Nm=n=>ct(n)&&Object.getOwnPropertyNames(n).some(t=>de(n[t]));function Fm(n,t){const{isScriptable:e,isIndexable:i}=Zl(n);for(const r of t){const a=e(r),s=i(r),o=(s||a)&&n[r];if(a&&(de(o)||Nm(o))||s&&yt(o))return!0}return!1}var Um="4.4.1";const Bm=["top","bottom","left","right","chartArea"];function Kc(n,t){return n==="top"||n==="bottom"||Bm.indexOf(n)===-1&&t==="x"}function Zc(n,t){return function(e,i){return e[n]===i[n]?e[t]-i[t]:e[n]-i[n]}}function Qc(n){const t=n.chart,e=t.options.animation;t.notifyPlugins("afterRender"),xt(e&&e.onComplete,[n],t)}function Wm(n){const t=n.chart,e=t.options.animation;xt(e&&e.onProgress,[n],t)}function Jc(n){return qa()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const Lr={},tu=n=>{const t=Jc(n);return Object.values(Lr).filter(e=>e.canvas===t).pop()};function Ym(n,t,e){const i=Object.keys(n);for(const r of i){const a=+r;if(a>=t){const s=n[r];delete n[r],(e>0||a>t)&&(n[a+e]=s)}}}function zm(n,t,e,i){return!e||n.type==="mouseout"?null:i?t:n}function Ir(n,t,e){return n.options.clip?n[e]:t[e]}function Hm(n,t){const{xScale:e,yScale:i}=n;return e&&i?{left:Ir(e,t,"left"),right:Ir(e,t,"right"),top:Ir(i,t,"top"),bottom:Ir(i,t,"bottom")}:t}let Te=(Tn=class{static register(...t){Ie.add(...t),eu()}static unregister(...t){Ie.remove(...t),eu()}constructor(t,e){const i=this.config=new Im(e),r=Jc(t),a=tu(r);if(a)throw new Error("Canvas is already in use. Chart with ID '"+a.id+"' must be destroyed before the canvas with ID '"+a.canvas.id+"' can be reused.");const s=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||sm(r)),this.platform.updateConfig(i);const o=this.platform.acquireContext(r,s.aspectRatio),l=o&&o.canvas,c=l&&l.height,u=l&&l.width;if(this.id=Xh(),this.ctx=o,this.canvas=l,this.width=u,this.height=c,this._options=s,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 Dm,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=cg(d=>this.update(d),s.resizeDelay||0),this._dataChanges=[],Lr[this.id]=this,!o||!l){console.error("Failed to create chart: can't acquire context from the given item");return}qe.listen(this,"complete",Qc),qe.listen(this,"progress",Wm),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:r,_aspectRatio:a}=this;return it(t)?e&&a?a:r?i/r: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 Ie}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():ac(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Xl(this.canvas,this.ctx),this}stop(){return qe.stop(this),this}resize(t,e){qe.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,r=this.canvas,a=i.maintainAspectRatio&&this.aspectRatio,s=this.platform.getMaximumSize(r,t,e,a),o=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=s.width,this.height=s.height,this._aspectRatio=this.aspectRatio,ac(this,o,!0)&&(this.notifyPlugins("resize",{size:s}),xt(i.onResize,[this,s],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};_t(e,(i,r)=>{i.id=r})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,r=Object.keys(i).reduce((s,o)=>(s[o]=!1,s),{});let a=[];e&&(a=a.concat(Object.keys(e).map(s=>{const o=e[s],l=ss(s,o),c=l==="r",u=l==="x";return{options:o,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),_t(a,s=>{const o=s.options,l=o.id,c=ss(l,o),u=nt(o.type,s.dtype);(o.position===void 0||Kc(o.position,c)!==Kc(s.dposition))&&(o.position=s.dposition),r[l]=!0;let d=null;if(l in i&&i[l].type===u)d=i[l];else{const f=Ie.getScale(u);d=new f({id:l,type:u,ctx:this.ctx,chart:this}),i[d.id]=d}d.init(o,t)}),_t(r,(s,o)=>{s||delete i[o]}),_t(i,s=>{re.configure(this,s,s.options),re.addBox(this,s)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((r,a)=>r.index-a.index),i>e){for(let r=e;r<i;++r)this._destroyDatasetMeta(r);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(Zc("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((i,r)=>{e.filter(a=>a===i._dataset).length===0&&this._destroyDatasetMeta(r)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,r;for(this._removeUnreferencedMetasets(),i=0,r=e.length;i<r;i++){const a=e[i];let s=this.getDatasetMeta(i);const o=a.type||this.config.type;if(s.type&&s.type!==o&&(this._destroyDatasetMeta(i),s=this.getDatasetMeta(i)),s.type=o,s.indexAxis=a.indexAxis||as(o,this.options),s.order=a.order||0,s.index=i,s.label=""+a.label,s.visible=this.isDatasetVisible(i),s.controller)s.controller.updateIndex(i),s.controller.linkScales();else{const l=Ie.getController(o),{datasetElementType:c,dataElementType:u}=Ft.datasets[o];Object.assign(l,{dataElementType:Ie.getElement(u),datasetElementType:c&&Ie.getElement(c)}),s.controller=new l(this,i),t.push(s.controller)}}return this._updateMetasets(),t}_resetElements(){_t(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),r=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const a=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let s=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:d}=this.getDatasetMeta(c),f=!r&&a.indexOf(d)===-1;d.buildOrUpdateElements(f),s=Math.max(+d.getMaxOverflow(),s)}s=this._minPadding=i.layout.autoPadding?s:0,this._updateLayout(s),r||_t(a,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Zc("z","_idx"));const{_active:o,_lastEvent:l}=this;l?this._eventHandler(l,!0):o.length&&this._updateHoverStyles(o,o,!0),this.render()}_updateScales(){_t(this.scales,t=>{re.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!El(e,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:r,count:a}of e){const s=i==="_removeElements"?-a:a;Ym(t,r,s)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=a=>new Set(t.filter(s=>s[0]===a).map((s,o)=>o+","+s.splice(1).join(","))),r=i(0);for(let a=1;a<e;a++)if(!El(r,i(a)))return;return Array.from(r).map(a=>a.split(",")).map(a=>({method:a[1],start:+a[2],count:+a[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;re.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],_t(this.boxes,r=>{i&&r.position==="chartArea"||(r.configure&&r.configure(),this._layers.push(...r._layers()))},this),this._layers.forEach((r,a)=>{r._idx=a}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,i=this.data.datasets.length;e<i;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,de(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),r={meta:i,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",r)!==!1&&(i.controller._update(e),r.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",r))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(qe.has(this)?this.attached&&!qe.running(this)&&qe.start(this):(this.draw(),Qc({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:i,height:r}=this._resizeBeforeDraw;this._resize(i,r),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,i=[];let r,a;for(r=0,a=e.length;r<a;++r){const s=e[r];(!t||s.visible)&&i.push(s)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i=t._clip,r=!i.disabled,a=Hm(t,this.chartArea),s={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",s)!==!1&&(r&&Mi(e,{left:i.left===!1?0:a.left-i.left,right:i.right===!1?this.width:a.right+i.right,top:i.top===!1?0:a.top-i.top,bottom:i.bottom===!1?this.height:a.bottom+i.bottom}),t.controller.draw(),r&&Ci(e),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(t){return Ve(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,r){const a=is.modes[e];return typeof a=="function"?a(this,t,i,r):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let r=i.filter(a=>a&&a._dataset===e).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(r)),r}getContext(){return this.$context||(this.$context=dn(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!e.hidden}setDatasetVisibility(t,e){const i=this.getDatasetMeta(t);i.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const r=i?"show":"hide",a=this.getDatasetMeta(t),s=a.controller._resolveAnimations(void 0,r);ue(e)?(a.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),s.update(a,{visible:i}),this.update(o=>o.datasetIndex===t?r: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(),qe.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(),Xl(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete Lr[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,i=(a,s)=>{e.addEventListener(this,a,s),t[a]=s},r=(a,s,o)=>{a.offsetX=s,a.offsetY=o,this._eventHandler(a)};_t(this.options.events,a=>i(a,r))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},r=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},a=(l,c)=>{this.canvas&&this.resize(l,c)};let s;const o=()=>{r("attach",o),this.attached=!0,this.resize(),i("resize",a),i("detach",s)};s=()=>{this.attached=!1,r("resize",a),this._stop(),this._resize(0,0),i("attach",o)},e.isAttached(this.canvas)?o():s()}unbindEvents(){_t(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},_t(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const r=i?"set":"remove";let a,s,o,l;for(e==="dataset"&&(a=this.getDatasetMeta(t[0].datasetIndex),a.controller["_"+r+"DatasetHoverStyle"]()),o=0,l=t.length;o<l;++o){s=t[o];const c=s&&this.getDatasetMeta(s.datasetIndex).controller;c&&c[r+"HoverStyle"](s.element,s.datasetIndex,s.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map(({datasetIndex:a,index:s})=>{const o=this.getDatasetMeta(a);if(!o)throw new Error("No dataset found at index "+a);return{datasetIndex:a,element:o.data[s],index:s}});!hr(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,i){const r=this.options.hover,a=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),s=a(e,t),o=i?t:a(t,e);s.length&&this.updateHoverStyle(s,r.mode,!1),o.length&&r.mode&&this.updateHoverStyle(o,r.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},r=s=>(s.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,r)===!1)return;const a=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,r),(a||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:r=[],options:a}=this,s=e,o=this._getActiveElements(t,r,i,s),l=tg(t),c=zm(t,this._lastEvent,i,l);i&&(this._lastEvent=null,xt(a.onHover,[t,o,this],this),l&&xt(a.onClick,[t,o,this],this));const u=!hr(o,r);return(u||e)&&(this._active=o,this._updateHoverStyles(o,r,e)),this._lastEvent=c,u}_getActiveElements(t,e,i,r){if(t.type==="mouseout")return[];if(!i)return e;const a=this.options.hover;return this.getElementsAtEventForMode(t,a.mode,a,r)}},Y(Tn,"defaults",Ft),Y(Tn,"instances",Lr),Y(Tn,"overrides",Cn),Y(Tn,"registry",Ie),Y(Tn,"version",Um),Y(Tn,"getChart",tu),Tn);function eu(){return _t(Te.instances,n=>n._plugins.invalidate())}function $m(n,t,e){const{startAngle:i,pixelMargin:r,x:a,y:s,outerRadius:o,innerRadius:l}=t;let c=r/o;n.beginPath(),n.arc(a,s,o,i-c,e+c),l>r?(c=r/l,n.arc(a,s,l,e+c,i-c,!0)):n.arc(a,s,r,e+Pt,i-Pt),n.closePath(),n.clip()}function jm(n){return Ha(n,["outerStart","outerEnd","innerStart","innerEnd"])}function Vm(n,t,e,i){const r=jm(n.options.borderRadius),a=(e-t)/2,s=Math.min(a,i*t/2),o=l=>{const c=(e-Math.min(a,l))*i/2;return Zt(l,0,Math.min(a,c))};return{outerStart:o(r.outerStart),outerEnd:o(r.outerEnd),innerStart:Zt(r.innerStart,0,s),innerEnd:Zt(r.innerEnd,0,s)}}function ti(n,t,e,i){return{x:e+n*Math.cos(t),y:i+n*Math.sin(t)}}function Nr(n,t,e,i,r,a){const{x:s,y:o,startAngle:l,pixelMargin:c,innerRadius:u}=t,d=Math.max(t.outerRadius+i+e-c,0),f=u>0?u+i+e+c:0;let g=0;const p=r-l;if(i){const L=u>0?u-i:0,H=d>0?d-i:0,I=(L+H)/2,et=I!==0?p*I/(I+i):p;g=(p-et)/2}const x=Math.max(.001,p*d-e/dt)/d,m=(p-x)/2,v=l+m+g,b=r-m-g,{outerStart:_,outerEnd:w,innerStart:S,innerEnd:C}=Vm(t,f,d,b-v),k=d-_,T=d-w,D=v+_/k,O=b-w/T,A=f+S,R=f+C,W=v+S/A,V=b-C/R;if(n.beginPath(),a){const L=(D+O)/2;if(n.arc(s,o,d,D,L),n.arc(s,o,d,L,O),w>0){const z=ti(T,O,s,o);n.arc(z.x,z.y,w,O,b+Pt)}const H=ti(R,b,s,o);if(n.lineTo(H.x,H.y),C>0){const z=ti(R,V,s,o);n.arc(z.x,z.y,C,b+Pt,V+Math.PI)}const I=(b-C/f+(v+S/f))/2;if(n.arc(s,o,f,b-C/f,I,!0),n.arc(s,o,f,I,v+S/f,!0),S>0){const z=ti(A,W,s,o);n.arc(z.x,z.y,S,W+Math.PI,v-Pt)}const et=ti(k,v,s,o);if(n.lineTo(et.x,et.y),_>0){const z=ti(k,D,s,o);n.arc(z.x,z.y,_,v-Pt,D)}}else{n.moveTo(s,o);const L=Math.cos(D)*d+s,H=Math.sin(D)*d+o;n.lineTo(L,H);const I=Math.cos(O)*d+s,et=Math.sin(O)*d+o;n.lineTo(I,et)}n.closePath()}function qm(n,t,e,i,r){const{fullCircles:a,startAngle:s,circumference:o}=t;let l=t.endAngle;if(a){Nr(n,t,e,i,l,r);for(let c=0;c<a;++c)n.fill();isNaN(o)||(l=s+(o%kt||kt))}return Nr(n,t,e,i,l,r),n.fill(),l}function Xm(n,t,e,i,r){const{fullCircles:a,startAngle:s,circumference:o,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:d,borderDashOffset:f}=l,g=l.borderAlign==="inner";if(!c)return;n.setLineDash(d||[]),n.lineDashOffset=f,g?(n.lineWidth=c*2,n.lineJoin=u||"round"):(n.lineWidth=c,n.lineJoin=u||"bevel");let p=t.endAngle;if(a){Nr(n,t,e,i,p,r);for(let x=0;x<a;++x)n.stroke();isNaN(o)||(p=s+(o%kt||kt))}g&&$m(n,t,p),a||(Nr(n,t,e,i,p,r),n.stroke())}class Wi extends te{constructor(e){super();Y(this,"circumference");Y(this,"endAngle");Y(this,"fullCircles");Y(this,"innerRadius");Y(this,"outerRadius");Y(this,"pixelMargin");Y(this,"startAngle");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,e&&Object.assign(this,e)}inRange(e,i,r){const a=this.getProps(["x","y"],r),{angle:s,distance:o}=Il(a,{x:e,y:i}),{startAngle:l,endAngle:c,innerRadius:u,outerRadius:d,circumference:f}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],r),g=(this.options.spacing+this.options.borderWidth)/2,x=nt(f,c-l)>=kt||wi(s,l,c),m=$e(o,u+g,d+g);return x&&m}getCenterPoint(e){const{x:i,y:r,startAngle:a,endAngle:s,innerRadius:o,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:c,spacing:u}=this.options,d=(a+s)/2,f=(o+l+u+c)/2;return{x:i+Math.cos(d)*f,y:r+Math.sin(d)*f}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:i,circumference:r}=this,a=(i.offset||0)/4,s=(i.spacing||0)/2,o=i.circular;if(this.pixelMargin=i.borderAlign==="inner"?.33:0,this.fullCircles=r>kt?Math.floor(r/kt):0,r===0||this.innerRadius<0||this.outerRadius<0)return;e.save();const l=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(l)*a,Math.sin(l)*a);const c=1-Math.sin(Math.min(dt,r||0)),u=a*c;e.fillStyle=i.backgroundColor,e.strokeStyle=i.borderColor,qm(e,this,u,s,o),Xm(e,this,u,s,o),e.restore()}}Y(Wi,"id","arc"),Y(Wi,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),Y(Wi,"defaultRoutes",{backgroundColor:"backgroundColor"}),Y(Wi,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"});function nu(n,t,e=t){n.lineCap=nt(e.borderCapStyle,t.borderCapStyle),n.setLineDash(nt(e.borderDash,t.borderDash)),n.lineDashOffset=nt(e.borderDashOffset,t.borderDashOffset),n.lineJoin=nt(e.borderJoinStyle,t.borderJoinStyle),n.lineWidth=nt(e.borderWidth,t.borderWidth),n.strokeStyle=nt(e.borderColor,t.borderColor)}function Gm(n,t,e){n.lineTo(e.x,e.y)}function Km(n){return n.stepped?_g:n.tension||n.cubicInterpolationMode==="monotone"?wg:Gm}function iu(n,t,e={}){const i=n.length,{start:r=0,end:a=i-1}=e,{start:s,end:o}=t,l=Math.max(r,s),c=Math.min(a,o),u=r<s&&a<s||r>o&&a>o;return{count:i,start:l,loop:t.loop,ilen:c<l&&!u?i+c-l:c-l}}function Zm(n,t,e,i){const{points:r,options:a}=t,{count:s,start:o,loop:l,ilen:c}=iu(r,e,i),u=Km(a);let{move:d=!0,reverse:f}=i||{},g,p,x;for(g=0;g<=c;++g)p=r[(o+(f?c-g:g))%s],!p.skip&&(d?(n.moveTo(p.x,p.y),d=!1):u(n,x,p,f,a.stepped),x=p);return l&&(p=r[(o+(f?c:0))%s],u(n,x,p,f,a.stepped)),!!l}function Qm(n,t,e,i){const r=t.points,{count:a,start:s,ilen:o}=iu(r,e,i),{move:l=!0,reverse:c}=i||{};let u=0,d=0,f,g,p,x,m,v;const b=w=>(s+(c?o-w:w))%a,_=()=>{x!==m&&(n.lineTo(u,m),n.lineTo(u,x),n.lineTo(u,v))};for(l&&(g=r[b(0)],n.moveTo(g.x,g.y)),f=0;f<=o;++f){if(g=r[b(f)],g.skip)continue;const w=g.x,S=g.y,C=w|0;C===p?(S<x?x=S:S>m&&(m=S),u=(d*u+w)/++d):(_(),n.lineTo(w,S),p=C,d=0,x=m=S),v=S}_()}function os(n){const t=n.options,e=t.borderDash&&t.borderDash.length;return!n._decimated&&!n._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?Qm:Zm}function Jm(n){return n.stepped?tp:n.tension||n.cubicInterpolationMode==="monotone"?ep:En}function t0(n,t,e,i){let r=t._path;r||(r=t._path=new Path2D,t.path(r,e,i)&&r.closePath()),nu(n,t.options),n.stroke(r)}function e0(n,t,e,i){const{segments:r,options:a}=t,s=os(t);for(const o of r)nu(n,a,o.style),n.beginPath(),s(n,t,o,{start:e,end:e+i-1})&&n.closePath(),n.stroke()}const n0=typeof Path2D=="function";function i0(n,t,e,i){n0&&!t.options.segment?t0(n,t,e,i):e0(n,t,e,i)}class gn extends te{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const r=i.spanGaps?this._loop:this._fullLoop;Vg(this._points,i,t,r,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=op(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,r=t[e],a=this.points,s=fc(this,{property:e,start:r,end:r});if(!s.length)return;const o=[],l=Jm(i);let c,u;for(c=0,u=s.length;c<u;++c){const{start:d,end:f}=s[c],g=a[d],p=a[f];if(g===p){o.push(g);continue}const x=Math.abs((r-g[e])/(p[e]-g[e])),m=l(g,p,x,i.stepped);m[e]=t[e],o.push(m)}return o.length===1?o[0]:o}pathSegment(t,e,i){return os(this)(t,this,e,i)}path(t,e,i){const r=this.segments,a=os(this);let s=this._loop;e=e||0,i=i||this.points.length-e;for(const o of r)s&=a(t,this,o,{start:e,end:e+i-1});return!!s}draw(t,e,i,r){const a=this.options||{};(this.points||[]).length&&a.borderWidth&&(t.save(),i0(t,this,i,r),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}Y(gn,"id","line"),Y(gn,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),Y(gn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),Y(gn,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function ru(n,t,e,i){const r=n.options,{[e]:a}=n.getProps([e],i);return Math.abs(t-a)<r.radius+r.hitRadius}class Fr extends te{constructor(e){super();Y(this,"parsed");Y(this,"skip");Y(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,i,r){const a=this.options,{x:s,y:o}=this.getProps(["x","y"],r);return Math.pow(e-s,2)+Math.pow(i-o,2)<Math.pow(a.hitRadius+a.radius,2)}inXRange(e,i){return ru(this,e,"x",i)}inYRange(e,i){return ru(this,e,"y",i)}getCenterPoint(e){const{x:i,y:r}=this.getProps(["x","y"],e);return{x:i,y:r}}size(e){e=e||this.options||{};let i=e.radius||0;i=Math.max(i,i&&e.hoverRadius||0);const r=i&&e.borderWidth||0;return(i+r)*2}draw(e,i){const r=this.options;this.skip||r.radius<.1||!Ve(this,i,this.size(r)/2)||(e.strokeStyle=r.borderColor,e.lineWidth=r.borderWidth,e.fillStyle=r.backgroundColor,za(e,r,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}Y(Fr,"id","point"),Y(Fr,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),Y(Fr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function au(n,t){const{x:e,y:i,base:r,width:a,height:s}=n.getProps(["x","y","base","width","height"],t);let o,l,c,u,d;return n.horizontal?(d=s/2,o=Math.min(e,r),l=Math.max(e,r),c=i-d,u=i+d):(d=a/2,o=e-d,l=e+d,c=Math.min(i,r),u=Math.max(i,r)),{left:o,top:c,right:l,bottom:u}}function pn(n,t,e,i){return n?0:Zt(t,e,i)}function r0(n,t,e){const i=n.options.borderWidth,r=n.borderSkipped,a=Kl(i);return{t:pn(r.top,a.top,0,e),r:pn(r.right,a.right,0,t),b:pn(r.bottom,a.bottom,0,e),l:pn(r.left,a.left,0,t)}}function a0(n,t,e){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),r=n.options.borderRadius,a=un(r),s=Math.min(t,e),o=n.borderSkipped,l=i||ct(r);return{topLeft:pn(!l||o.top||o.left,a.topLeft,0,s),topRight:pn(!l||o.top||o.right,a.topRight,0,s),bottomLeft:pn(!l||o.bottom||o.left,a.bottomLeft,0,s),bottomRight:pn(!l||o.bottom||o.right,a.bottomRight,0,s)}}function s0(n){const t=au(n),e=t.right-t.left,i=t.bottom-t.top,r=r0(n,e/2,i/2),a=a0(n,e/2,i/2);return{outer:{x:t.left,y:t.top,w:e,h:i,radius:a},inner:{x:t.left+r.l,y:t.top+r.t,w:e-r.l-r.r,h:i-r.t-r.b,radius:{topLeft:Math.max(0,a.topLeft-Math.max(r.t,r.l)),topRight:Math.max(0,a.topRight-Math.max(r.t,r.r)),bottomLeft:Math.max(0,a.bottomLeft-Math.max(r.b,r.l)),bottomRight:Math.max(0,a.bottomRight-Math.max(r.b,r.r))}}}}function ls(n,t,e,i){const r=t===null,a=e===null,o=n&&!(r&&a)&&au(n,i);return o&&(r||$e(t,o.left,o.right))&&(a||$e(e,o.top,o.bottom))}function o0(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function l0(n,t){n.rect(t.x,t.y,t.w,t.h)}function cs(n,t,e={}){const i=n.x!==e.x?-t:0,r=n.y!==e.y?-t:0,a=(n.x+n.w!==e.x+e.w?t:0)-i,s=(n.y+n.h!==e.y+e.h?t:0)-r;return{x:n.x+i,y:n.y+r,w:n.w+a,h:n.h+s,radius:n.radius}}class Ur extends te{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:i,backgroundColor:r}}=this,{inner:a,outer:s}=s0(this),o=o0(s.radius)?Kn:l0;t.save(),(s.w!==a.w||s.h!==a.h)&&(t.beginPath(),o(t,cs(s,e,a)),t.clip(),o(t,cs(a,-e,s)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),o(t,cs(a,e)),t.fillStyle=r,t.fill(),t.restore()}inRange(t,e,i){return ls(this,t,e,i)}inXRange(t,e){return ls(this,t,null,e)}inYRange(t,e){return ls(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:r,horizontal:a}=this.getProps(["x","y","base","horizontal"],t);return{x:a?(e+r)/2:e,y:a?i:(i+r)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}Y(Ur,"id","bar"),Y(Ur,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),Y(Ur,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var c0=Object.freeze({__proto__:null,ArcElement:Wi,BarElement:Ur,LineElement:gn,PointElement:Fr});const us=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],su=us.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function ou(n){return us[n%us.length]}function lu(n){return su[n%su.length]}function u0(n,t){return n.borderColor=ou(t),n.backgroundColor=lu(t),++t}function d0(n,t){return n.backgroundColor=n.data.map(()=>ou(t++)),t}function f0(n,t){return n.backgroundColor=n.data.map(()=>lu(t++)),t}function h0(n){let t=0;return(e,i)=>{const r=n.getDatasetMeta(i).controller;r instanceof hn?t=d0(e,t):r instanceof Ai?t=f0(e,t):r&&(t=u0(e,t))}}function cu(n){let t;for(t in n)if(n[t].borderColor||n[t].backgroundColor)return!0;return!1}function g0(n){return n&&(n.borderColor||n.backgroundColor)}var p0={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(n,t,e){if(!e.enabled)return;const{data:{datasets:i},options:r}=n.config,{elements:a}=r;if(!e.forceOverride&&(cu(i)||g0(r)||a&&cu(a)))return;const s=h0(n);i.forEach(s)}};function m0(n,t,e,i,r){const a=r.samples||i;if(a>=e)return n.slice(t,t+e);const s=[],o=(e-2)/(a-2);let l=0;const c=t+e-1;let u=t,d,f,g,p,x;for(s[l++]=n[u],d=0;d<a-2;d++){let m=0,v=0,b;const _=Math.floor((d+1)*o)+1+t,w=Math.min(Math.floor((d+2)*o)+1,e)+t,S=w-_;for(b=_;b<w;b++)m+=n[b].x,v+=n[b].y;m/=S,v/=S;const C=Math.floor(d*o)+1+t,k=Math.min(Math.floor((d+1)*o)+1,e)+t,{x:T,y:D}=n[u];for(g=p=-1,b=C;b<k;b++)p=.5*Math.abs((T-m)*(n[b].y-D)-(T-n[b].x)*(v-D)),p>g&&(g=p,f=n[b],x=b);s[l++]=f,u=x}return s[l++]=n[c],s}function y0(n,t,e,i){let r=0,a=0,s,o,l,c,u,d,f,g,p,x;const m=[],v=t+e-1,b=n[t].x,w=n[v].x-b;for(s=t;s<t+e;++s){o=n[s],l=(o.x-b)/w*i,c=o.y;const S=l|0;if(S===u)c<p?(p=c,d=s):c>x&&(x=c,f=s),r=(a*r+o.x)/++a;else{const C=s-1;if(!it(d)&&!it(f)){const k=Math.min(d,f),T=Math.max(d,f);k!==g&&k!==C&&m.push({...n[k],x:r}),T!==g&&T!==C&&m.push({...n[T],x:r})}s>0&&C!==g&&m.push(n[C]),m.push(o),u=S,a=0,p=x=c,d=f=g=s}}return m}function uu(n){if(n._decimated){const t=n._data;delete n._decimated,delete n._data,Object.defineProperty(n,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function du(n){n.data.datasets.forEach(t=>{uu(t)})}function b0(n,t){const e=t.length;let i=0,r;const{iScale:a}=n,{min:s,max:o,minDefined:l,maxDefined:c}=a.getUserBounds();return l&&(i=Zt(je(t,a.axis,s).lo,0,e-1)),c?r=Zt(je(t,a.axis,o).hi+1,i,e)-i:r=e-i,{start:i,count:r}}var v0={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(n,t,e)=>{if(!e.enabled){du(n);return}const i=n.width;n.data.datasets.forEach((r,a)=>{const{_data:s,indexAxis:o}=r,l=n.getDatasetMeta(a),c=s||r.data;if(ki([o,n.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const u=n.scales[l.xAxisID];if(u.type!=="linear"&&u.type!=="time"||n.options.parsing)return;let{start:d,count:f}=b0(l,c);const g=e.threshold||4*i;if(f<=g){uu(r);return}it(s)&&(r._data=c,delete r.data,Object.defineProperty(r,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(x){this._data=x}}));let p;switch(e.algorithm){case"lttb":p=m0(c,d,f,i,e);break;case"min-max":p=y0(c,d,f,i);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}r._decimated=p})},destroy(n){du(n)}};function x0(n,t,e){const i=n.segments,r=n.points,a=t.points,s=[];for(const o of i){let{start:l,end:c}=o;c=fs(l,c,r);const u=ds(e,r[l],r[c],o.loop);if(!t.segments){s.push({source:o,target:u,start:r[l],end:r[c]});continue}const d=fc(t,u);for(const f of d){const g=ds(e,a[f.start],a[f.end],f.loop),p=dc(o,r,g);for(const x of p)s.push({source:x,target:f,start:{[e]:fu(u,g,"start",Math.max)},end:{[e]:fu(u,g,"end",Math.min)}})}}return s}function ds(n,t,e,i){if(i)return;let r=t[n],a=e[n];return n==="angle"&&(r=ve(r),a=ve(a)),{property:n,start:r,end:a}}function _0(n,t){const{x:e=null,y:i=null}=n||{},r=t.points,a=[];return t.segments.forEach(({start:s,end:o})=>{o=fs(s,o,r);const l=r[s],c=r[o];i!==null?(a.push({x:l.x,y:i}),a.push({x:c.x,y:i})):e!==null&&(a.push({x:e,y:l.y}),a.push({x:e,y:c.y}))}),a}function fs(n,t,e){for(;t>n;t--){const i=e[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function fu(n,t,e,i){return n&&t?i(n[e],t[e]):n?n[e]:t?t[e]:0}function hu(n,t){let e=[],i=!1;return yt(n)?(i=!0,e=n):e=_0(n,t),e.length?new gn({points:e,options:{tension:0},_loop:i,_fullLoop:i}):null}function gu(n){return n&&n.fill!==!1}function w0(n,t,e){let r=n[t].fill;const a=[t];let s;if(!e)return r;for(;r!==!1&&a.indexOf(r)===-1;){if(!Lt(r))return r;if(s=n[r],!s)return!1;if(s.visible)return r;a.push(r),r=s.fill}return!1}function T0(n,t,e){const i=C0(n);if(ct(i))return isNaN(i.value)?!1:i;let r=parseFloat(i);return Lt(r)&&Math.floor(r)===r?D0(i[0],t,r,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function D0(n,t,e,i){return(n==="-"||n==="+")&&(e=t+e),e===t||e<0||e>=i?!1:e}function S0(n,t){let e=null;return n==="start"?e=t.bottom:n==="end"?e=t.top:ct(n)?e=t.getPixelForValue(n.value):t.getBasePixel&&(e=t.getBasePixel()),e}function M0(n,t,e){let i;return n==="start"?i=e:n==="end"?i=t.options.reverse?t.min:t.max:ct(n)?i=n.value:i=t.getBaseValue(),i}function C0(n){const t=n.options,e=t.fill;let i=nt(e&&e.target,e);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function k0(n){const{scale:t,index:e,line:i}=n,r=[],a=i.segments,s=i.points,o=O0(t,e);o.push(hu({x:null,y:t.bottom},i));for(let l=0;l<a.length;l++){const c=a[l];for(let u=c.start;u<=c.end;u++)P0(r,s[u],o)}return new gn({points:r,options:{}})}function O0(n,t){const e=[],i=n.getMatchingVisibleMetas("line");for(let r=0;r<i.length;r++){const a=i[r];if(a.index===t)break;a.hidden||e.unshift(a.dataset)}return e}function P0(n,t,e){const i=[];for(let r=0;r<e.length;r++){const a=e[r],{first:s,last:o,point:l}=E0(a,t,"x");if(!(!l||s&&o)){if(s)i.unshift(l);else if(n.push(l),!o)break}}n.push(...i)}function E0(n,t,e){const i=n.interpolate(t,e);if(!i)return{};const r=i[e],a=n.segments,s=n.points;let o=!1,l=!1;for(let c=0;c<a.length;c++){const u=a[c],d=s[u.start][e],f=s[u.end][e];if($e(r,d,f)){o=r===d,l=r===f;break}}return{first:o,last:l,point:i}}class pu{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:r,y:a,radius:s}=this;return e=e||{start:0,end:kt},t.arc(r,a,s,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:r}=this,a=t.angle;return{x:e+Math.cos(a)*r,y:i+Math.sin(a)*r,angle:a}}}function A0(n){const{chart:t,fill:e,line:i}=n;if(Lt(e))return R0(t,e);if(e==="stack")return k0(n);if(e==="shape")return!0;const r=L0(n);return r instanceof pu?r:hu(r,i)}function R0(n,t){const e=n.getDatasetMeta(t);return e&&n.isDatasetVisible(t)?e.dataset:null}function L0(n){return(n.scale||{}).getPointPositionForValue?N0(n):I0(n)}function I0(n){const{scale:t={},fill:e}=n,i=S0(e,t);if(Lt(i)){const r=t.isHorizontal();return{x:r?i:null,y:r?null:i}}return null}function N0(n){const{scale:t,fill:e}=n,i=t.options,r=t.getLabels().length,a=i.reverse?t.max:t.min,s=M0(e,t,a),o=[];if(i.grid.circular){const l=t.getPointPositionForValue(0,a);return new pu({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(s)})}for(let l=0;l<r;++l)o.push(t.getPointPositionForValue(l,s));return o}function hs(n,t,e){const i=A0(t),{line:r,scale:a,axis:s}=t,o=r.options,l=o.fill,c=o.backgroundColor,{above:u=c,below:d=c}=l||{};i&&r.points.length&&(Mi(n,e),F0(n,{line:r,target:i,above:u,below:d,area:e,scale:a,axis:s}),Ci(n))}function F0(n,t){const{line:e,target:i,above:r,below:a,area:s,scale:o}=t,l=e._loop?"angle":t.axis;n.save(),l==="x"&&a!==r&&(mu(n,i,s.top),yu(n,{line:e,target:i,color:r,scale:o,property:l}),n.restore(),n.save(),mu(n,i,s.bottom)),yu(n,{line:e,target:i,color:a,scale:o,property:l}),n.restore()}function mu(n,t,e){const{segments:i,points:r}=t;let a=!0,s=!1;n.beginPath();for(const o of i){const{start:l,end:c}=o,u=r[l],d=r[fs(l,c,r)];a?(n.moveTo(u.x,u.y),a=!1):(n.lineTo(u.x,e),n.lineTo(u.x,u.y)),s=!!t.pathSegment(n,o,{move:s}),s?n.closePath():n.lineTo(d.x,e)}n.lineTo(t.first().x,e),n.closePath(),n.clip()}function yu(n,t){const{line:e,target:i,property:r,color:a,scale:s}=t,o=x0(e,i,r);for(const{source:l,target:c,start:u,end:d}of o){const{style:{backgroundColor:f=a}={}}=l,g=i!==!0;n.save(),n.fillStyle=f,U0(n,s,g&&ds(r,u,d)),n.beginPath();const p=!!e.pathSegment(n,l);let x;if(g){p?n.closePath():bu(n,i,d,r);const m=!!i.pathSegment(n,c,{move:p,reverse:!0});x=p&&m,x||bu(n,i,u,r)}n.closePath(),n.fill(x?"evenodd":"nonzero"),n.restore()}}function U0(n,t,e){const{top:i,bottom:r}=t.chart.chartArea,{property:a,start:s,end:o}=e||{};a==="x"&&(n.beginPath(),n.rect(s,i,o-s,r-i),n.clip())}function bu(n,t,e,i){const r=t.interpolate(e,i);r&&n.lineTo(r.x,r.y)}var B0={id:"filler",afterDatasetsUpdate(n,t,e){const i=(n.data.datasets||[]).length,r=[];let a,s,o,l;for(s=0;s<i;++s)a=n.getDatasetMeta(s),o=a.dataset,l=null,o&&o.options&&o instanceof gn&&(l={visible:n.isDatasetVisible(s),index:s,fill:T0(o,s,i),chart:n,axis:a.controller.options.indexAxis,scale:a.vScale,line:o}),a.$filler=l,r.push(l);for(s=0;s<i;++s)l=r[s],!(!l||l.fill===!1)&&(l.fill=w0(r,s,e.propagate))},beforeDraw(n,t,e){const i=e.drawTime==="beforeDraw",r=n.getSortedVisibleDatasetMetas(),a=n.chartArea;for(let s=r.length-1;s>=0;--s){const o=r[s].$filler;o&&(o.line.updateControlPoints(a,o.axis),i&&o.fill&&hs(n.ctx,o,a))}},beforeDatasetsDraw(n,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let r=i.length-1;r>=0;--r){const a=i[r].$filler;gu(a)&&hs(n.ctx,a,n.chartArea)}},beforeDatasetDraw(n,t,e){const i=t.meta.$filler;!gu(i)||e.drawTime!=="beforeDatasetDraw"||hs(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const vu=(n,t)=>{let{boxHeight:e=t,boxWidth:i=t}=n;return n.usePointStyle&&(e=Math.min(e,t),i=n.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:e,itemHeight:Math.max(t,e)}},W0=(n,t)=>n!==null&&t!==null&&n.datasetIndex===t.datasetIndex&&n.index===t.index;class xu extends te{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=xt(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(i=>t.filter(i,this.chart.data))),t.sort&&(e=e.sort((i,r)=>t.sort(i,r,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 i=t.labels,r=Et(i.font),a=r.size,s=this._computeTitleHeight(),{boxWidth:o,itemHeight:l}=vu(i,a);let c,u;e.font=r.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(s,a,o,l)+10):(u=this.maxHeight,c=this._fitCols(s,r,o,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,r){const{ctx:a,maxWidth:s,options:{labels:{padding:o}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=r+o;let d=t;a.textAlign="left",a.textBaseline="middle";let f=-1,g=-u;return this.legendItems.forEach((p,x)=>{const m=i+e/2+a.measureText(p.text).width;(x===0||c[c.length-1]+m+2*o>s)&&(d+=u,c[c.length-(x>0?0:1)]=0,g+=u,f++),l[x]={left:0,top:g,row:f,width:m,height:r},c[c.length-1]+=m+o}),d}_fitCols(t,e,i,r){const{ctx:a,maxHeight:s,options:{labels:{padding:o}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=s-t;let d=o,f=0,g=0,p=0,x=0;return this.legendItems.forEach((m,v)=>{const{itemWidth:b,itemHeight:_}=Y0(i,e,a,m,r);v>0&&g+_+2*o>u&&(d+=f+o,c.push({width:f,height:g}),p+=f+o,x++,f=g=0),l[v]={left:p,top:g,col:x,width:b,height:_},f=Math.max(f,b),g+=_+o}),d+=f,c.push({width:f,height:g}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:r},rtl:a}}=this,s=Jn(a,this.left,this.width);if(this.isHorizontal()){let o=0,l=ie(i,this.left+r,this.right-this.lineWidths[o]);for(const c of e)o!==c.row&&(o=c.row,l=ie(i,this.left+r,this.right-this.lineWidths[o])),c.top+=this.top+t+r,c.left=s.leftForLtr(s.x(l),c.width),l+=c.width+r}else{let o=0,l=ie(i,this.top+t+r,this.bottom-this.columnSizes[o].height);for(const c of e)c.col!==o&&(o=c.col,l=ie(i,this.top+t+r,this.bottom-this.columnSizes[o].height)),c.top=l,c.left+=this.left+r,c.left=s.leftForLtr(s.x(c.left),c.width),l+=c.height+r}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Mi(t,this),this._draw(),Ci(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:r}=this,{align:a,labels:s}=t,o=Ft.color,l=Jn(t.rtl,this.left,this.width),c=Et(s.font),{padding:u}=s,d=c.size,f=d/2;let g;this.drawTitle(),r.textAlign=l.textAlign("left"),r.textBaseline="middle",r.lineWidth=.5,r.font=c.string;const{boxWidth:p,boxHeight:x,itemHeight:m}=vu(s,d),v=function(C,k,T){if(isNaN(p)||p<=0||isNaN(x)||x<0)return;r.save();const D=nt(T.lineWidth,1);if(r.fillStyle=nt(T.fillStyle,o),r.lineCap=nt(T.lineCap,"butt"),r.lineDashOffset=nt(T.lineDashOffset,0),r.lineJoin=nt(T.lineJoin,"miter"),r.lineWidth=D,r.strokeStyle=nt(T.strokeStyle,o),r.setLineDash(nt(T.lineDash,[])),s.usePointStyle){const O={radius:x*Math.SQRT2/2,pointStyle:T.pointStyle,rotation:T.rotation,borderWidth:D},A=l.xPlus(C,p/2),R=k+f;Gl(r,O,A,R,s.pointStyleWidth&&p)}else{const O=k+Math.max((d-x)/2,0),A=l.leftForLtr(C,p),R=un(T.borderRadius);r.beginPath(),Object.values(R).some(W=>W!==0)?Kn(r,{x:A,y:O,w:p,h:x,radius:R}):r.rect(A,O,p,x),r.fill(),D!==0&&r.stroke()}r.restore()},b=function(C,k,T){On(r,T.text,C,k+m/2,c,{strikethrough:T.hidden,textAlign:l.textAlign(T.textAlign)})},_=this.isHorizontal(),w=this._computeTitleHeight();_?g={x:ie(a,this.left+u,this.right-i[0]),y:this.top+u+w,line:0}:g={x:this.left+u,y:ie(a,this.top+w+u,this.bottom-e[0].height),line:0},oc(this.ctx,t.textDirection);const S=m+u;this.legendItems.forEach((C,k)=>{r.strokeStyle=C.fontColor,r.fillStyle=C.fontColor;const T=r.measureText(C.text).width,D=l.textAlign(C.textAlign||(C.textAlign=s.textAlign)),O=p+f+T;let A=g.x,R=g.y;l.setWidth(this.width),_?k>0&&A+O+u>this.right&&(R=g.y+=S,g.line++,A=g.x=ie(a,this.left+u,this.right-i[g.line])):k>0&&R+S>this.bottom&&(A=g.x=A+e[g.line].width+u,g.line++,R=g.y=ie(a,this.top+w+u,this.bottom-e[g.line].height));const W=l.x(A);if(v(W,R,C),A=ug(D,A+p+f,_?A+O:this.right,t.rtl),b(l.x(A),R,C),_)g.x+=O+u;else if(typeof C.text!="string"){const V=c.lineHeight;g.y+=_u(C,V)+u}else g.y+=S}),lc(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=Et(e.font),r=Xt(e.padding);if(!e.display)return;const a=Jn(t.rtl,this.left,this.width),s=this.ctx,o=e.position,l=i.size/2,c=r.top+l;let u,d=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),u=this.top+c,d=ie(t.align,d,this.right-f);else{const p=this.columnSizes.reduce((x,m)=>Math.max(x,m.height),0);u=c+ie(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const g=ie(o,d,d+f);s.textAlign=a.textAlign(Fa(o)),s.textBaseline="middle",s.strokeStyle=e.color,s.fillStyle=e.color,s.font=i.string,On(s,e.text,g,u,i)}_computeTitleHeight(){const t=this.options.title,e=Et(t.font),i=Xt(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,r,a;if($e(t,this.left,this.right)&&$e(e,this.top,this.bottom)){for(a=this.legendHitBoxes,i=0;i<a.length;++i)if(r=a[i],$e(t,r.left,r.left+r.width)&&$e(e,r.top,r.top+r.height))return this.legendItems[i]}return null}handleEvent(t){const e=this.options;if(!$0(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const r=this._hoveredItem,a=W0(r,i);r&&!a&&xt(e.onLeave,[t,r,this],this),this._hoveredItem=i,i&&!a&&xt(e.onHover,[t,i,this],this)}else i&&xt(e.onClick,[t,i,this],this)}}function Y0(n,t,e,i,r){const a=z0(i,n,t,e),s=H0(r,i,t.lineHeight);return{itemWidth:a,itemHeight:s}}function z0(n,t,e,i){let r=n.text;return r&&typeof r!="string"&&(r=r.reduce((a,s)=>a.length>s.length?a:s)),t+e.size/2+i.measureText(r).width}function H0(n,t,e){let i=n;return typeof t.text!="string"&&(i=_u(t,e)),i}function _u(n,t){const e=n.text?n.text.length:0;return t*e}function $0(n,t){return!!((n==="mousemove"||n==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(n==="click"||n==="mouseup"))}var j0={id:"legend",_element:xu,start(n,t,e){const i=n.legend=new xu({ctx:n.ctx,options:e,chart:n});re.configure(n,i,e),re.addBox(n,i)},stop(n){re.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,t,e){const i=n.legend;re.configure(n,i,e),i.options=e},afterUpdate(n){const t=n.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(n,t){t.replay||n.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(n,t,e){const i=t.datasetIndex,r=e.chart;r.isDatasetVisible(i)?(r.hide(i),t.hidden=!0):(r.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:n=>n.chart.options.color,boxWidth:40,padding:10,generateLabels(n){const t=n.data.datasets,{labels:{usePointStyle:e,pointStyle:i,textAlign:r,color:a,useBorderRadius:s,borderRadius:o}}=n.legend.options;return n._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),u=Xt(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:a,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:i||c.pointStyle,rotation:c.rotation,textAlign:r||c.textAlign,borderRadius:s&&(o||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:n=>n.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:n=>!n.startsWith("on"),labels:{_scriptable:n=>!["generateLabels","filter","sort"].includes(n)}}};class gs extends te{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const r=yt(i.text)?i.text.length:1;this._padding=Xt(i.padding);const a=r*Et(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=a:this.width=a}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:i,bottom:r,right:a,options:s}=this,o=s.align;let l=0,c,u,d;return this.isHorizontal()?(u=ie(o,i,a),d=e+t,c=a-i):(s.position==="left"?(u=i+t,d=ie(o,r,e),l=dt*-.5):(u=a-t,d=ie(o,e,r),l=dt*.5),c=r-e),{titleX:u,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=Et(e.font),a=i.lineHeight/2+this._padding.top,{titleX:s,titleY:o,maxWidth:l,rotation:c}=this._drawArgs(a);On(t,e.text,0,0,i,{color:e.color,maxWidth:l,rotation:c,textAlign:Fa(e.align),textBaseline:"middle",translation:[s,o]})}}function V0(n,t){const e=new gs({ctx:n.ctx,options:t,chart:n});re.configure(n,e,t),re.addBox(n,e),n.titleBlock=e}var q0={id:"title",_element:gs,start(n,t,e){V0(n,e)},stop(n){const t=n.titleBlock;re.removeBox(n,t),delete n.titleBlock},beforeUpdate(n,t,e){const i=n.titleBlock;re.configure(n,i,e),i.options=e},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Br=new WeakMap;var X0={id:"subtitle",start(n,t,e){const i=new gs({ctx:n.ctx,options:e,chart:n});re.configure(n,i,e),re.addBox(n,i),Br.set(n,i)},stop(n){re.removeBox(n,Br.get(n)),Br.delete(n)},beforeUpdate(n,t,e){const i=Br.get(n);re.configure(n,i,e),i.options=e},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Yi={average(n){if(!n.length)return!1;let t,e,i=0,r=0,a=0;for(t=0,e=n.length;t<e;++t){const s=n[t].element;if(s&&s.hasValue()){const o=s.tooltipPosition();i+=o.x,r+=o.y,++a}}return{x:i/a,y:r/a}},nearest(n,t){if(!n.length)return!1;let e=t.x,i=t.y,r=Number.POSITIVE_INFINITY,a,s,o;for(a=0,s=n.length;a<s;++a){const l=n[a].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),u=Gn(t,c);u<r&&(r=u,o=l)}}if(o){const l=o.tooltipPosition();e=l.x,i=l.y}return{x:e,y:i}}};function Ne(n,t){return t&&(yt(t)?Array.prototype.push.apply(n,t):n.push(t)),n}function Xe(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
|
|
17
17
|
`)>-1?n.split(`
|
|
18
|
-
`):n}function G0(n,t){const{element:e,datasetIndex:i,index:r}=t,a=n.getDatasetMeta(i).controller,{label:s,value:o}=a.getLabelAndValue(r);return{chart:n,label:s,parsed:a.getParsed(r),raw:n.data.datasets[i].data[r],formattedValue:o,dataset:a.getDataset(),dataIndex:r,datasetIndex:i,element:e}}function _u(n,t){const e=n.chart.ctx,{body:i,footer:r,title:a}=n,{boxWidth:s,boxHeight:o}=t,l=Et(t.bodyFont),c=Et(t.titleFont),u=Et(t.footerFont),d=a.length,f=r.length,g=i.length,p=Xt(t.padding);let m=p.height,y=0,v=i.reduce((_,S)=>_+S.before.length+S.lines.length+S.after.length,0);if(v+=n.beforeBody.length+n.afterBody.length,d&&(m+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),v){const _=t.displayColors?Math.max(o,l.lineHeight):l.lineHeight;m+=g*_+(v-g)*l.lineHeight+(v-1)*t.bodySpacing}f&&(m+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let x=0;const w=function(_){y=Math.max(y,e.measureText(_).width+x)};return e.save(),e.font=c.string,wt(n.title,w),e.font=l.string,wt(n.beforeBody.concat(n.afterBody),w),x=t.displayColors?s+2+t.boxPadding:0,wt(i,_=>{wt(_.before,w),wt(_.lines,w),wt(_.after,w)}),x=0,e.font=u.string,wt(n.footer,w),e.restore(),y+=p.width,{width:y,height:m}}function K0(n,t){const{y:e,height:i}=t;return e<i/2?"top":e>n.height-i/2?"bottom":"center"}function Z0(n,t,e,i){const{x:r,width:a}=i,s=e.caretSize+e.caretPadding;if(n==="left"&&r+a+s>t.width||n==="right"&&r-a-s<0)return!0}function Q0(n,t,e,i){const{x:r,width:a}=e,{width:s,chartArea:{left:o,right:l}}=n;let c="center";return i==="center"?c=r<=(o+l)/2?"left":"right":r<=a/2?c="left":r>=s-a/2&&(c="right"),Z0(c,n,t,e)&&(c="center"),c}function Tu(n,t,e){const i=e.yAlign||t.yAlign||K0(n,e);return{xAlign:e.xAlign||t.xAlign||Q0(n,t,e,i),yAlign:i}}function J0(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function ty(n,t,e){let{y:i,height:r}=n;return t==="top"?i+=e:t==="bottom"?i-=r+e:i-=r/2,i}function Du(n,t,e,i){const{caretSize:r,caretPadding:a,cornerRadius:s}=n,{xAlign:o,yAlign:l}=e,c=r+a,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:g}=un(s);let p=J0(t,o);const m=ty(t,l,c);return l==="center"?o==="left"?p+=c:o==="right"&&(p-=c):o==="left"?p-=Math.max(u,f)+r:o==="right"&&(p+=Math.max(d,g)+r),{x:Zt(p,0,i.width-t.width),y:Zt(m,0,i.height-t.height)}}function Wr(n,t,e){const i=Xt(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-i.right:n.x+i.left}function Su(n){return Ne([],Xe(n))}function ey(n,t,e){return dn(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function Mu(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const Cu={beforeTitle:He,title(n){if(n.length>0){const t=n[0],e=t.chart.data.labels,i=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex<i)return e[t.dataIndex]}return""},afterTitle:He,beforeBody:He,beforeLabel:He,label(n){if(this&&this.options&&this.options.mode==="dataset")return n.label+": "+n.formattedValue||n.formattedValue;let t=n.dataset.label||"";t&&(t+=": ");const e=n.formattedValue;return it(e)||(t+=e),t},labelColor(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.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(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:He,afterBody:He,beforeFooter:He,footer:He,afterFooter:He};function fe(n,t,e,i){const r=n[t].call(e,i);return typeof r>"u"?Cu[t].call(e,i):r}class ps extends te{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,i=this.options.setContext(this.getContext()),r=i.enabled&&e.options.animation&&i.animations,a=new Ga(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(a)),a}getContext(){return this.$context||(this.$context=ey(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,r=fe(i,"beforeTitle",this,t),a=fe(i,"title",this,t),s=fe(i,"afterTitle",this,t);let o=[];return o=Ne(o,Xe(r)),o=Ne(o,Xe(a)),o=Ne(o,Xe(s)),o}getBeforeBody(t,e){return Su(fe(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,r=[];return wt(t,a=>{const s={before:[],lines:[],after:[]},o=Mu(i,a);Ne(s.before,Xe(fe(o,"beforeLabel",this,a))),Ne(s.lines,fe(o,"label",this,a)),Ne(s.after,Xe(fe(o,"afterLabel",this,a))),r.push(s)}),r}getAfterBody(t,e){return Su(fe(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,r=fe(i,"beforeFooter",this,t),a=fe(i,"footer",this,t),s=fe(i,"afterFooter",this,t);let o=[];return o=Ne(o,Xe(r)),o=Ne(o,Xe(a)),o=Ne(o,Xe(s)),o}_createItems(t){const e=this._active,i=this.chart.data,r=[],a=[],s=[];let o=[],l,c;for(l=0,c=e.length;l<c;++l)o.push(G0(this.chart,e[l]));return t.filter&&(o=o.filter((u,d,f)=>t.filter(u,d,f,i))),t.itemSort&&(o=o.sort((u,d)=>t.itemSort(u,d,i))),wt(o,u=>{const d=Mu(t.callbacks,u);r.push(fe(d,"labelColor",this,u)),a.push(fe(d,"labelPointStyle",this,u)),s.push(fe(d,"labelTextColor",this,u))}),this.labelColors=r,this.labelPointStyles=a,this.labelTextColors=s,this.dataPoints=o,o}update(t,e){const i=this.options.setContext(this.getContext()),r=this._active;let a,s=[];if(!r.length)this.opacity!==0&&(a={opacity:0});else{const o=Yi[i.position].call(this,r,this._eventPosition);s=this._createItems(i),this.title=this.getTitle(s,i),this.beforeBody=this.getBeforeBody(s,i),this.body=this.getBody(s,i),this.afterBody=this.getAfterBody(s,i),this.footer=this.getFooter(s,i);const l=this._size=_u(this,i),c=Object.assign({},o,l),u=Tu(this.chart,i,c),d=Du(i,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,a={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:o.x,caretY:o.y}}this._tooltipItems=s,this.$context=void 0,a&&this._resolveAnimations().update(this,a),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,r){const a=this.getCaretPosition(t,i,r);e.lineTo(a.x1,a.y1),e.lineTo(a.x2,a.y2),e.lineTo(a.x3,a.y3)}getCaretPosition(t,e,i){const{xAlign:r,yAlign:a}=this,{caretSize:s,cornerRadius:o}=i,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=un(o),{x:f,y:g}=t,{width:p,height:m}=e;let y,v,x,w,_,S;return a==="center"?(_=g+m/2,r==="left"?(y=f,v=y-s,w=_+s,S=_-s):(y=f+p,v=y+s,w=_-s,S=_+s),x=y):(r==="left"?v=f+Math.max(l,u)+s:r==="right"?v=f+p-Math.max(c,d)-s:v=this.caretX,a==="top"?(w=g,_=w-s,y=v-s,x=v+s):(w=g+m,_=w+s,y=v+s,x=v-s),S=w),{x1:y,x2:v,x3:x,y1:w,y2:_,y3:S}}drawTitle(t,e,i){const r=this.title,a=r.length;let s,o,l;if(a){const c=Jn(i.rtl,this.x,this.width);for(t.x=Wr(this,i.titleAlign,i),e.textAlign=c.textAlign(i.titleAlign),e.textBaseline="middle",s=Et(i.titleFont),o=i.titleSpacing,e.fillStyle=i.titleColor,e.font=s.string,l=0;l<a;++l)e.fillText(r[l],c.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+o,l+1===a&&(t.y+=i.titleMarginBottom-o)}}_drawColorBox(t,e,i,r,a){const s=this.labelColors[i],o=this.labelPointStyles[i],{boxHeight:l,boxWidth:c}=a,u=Et(a.bodyFont),d=Wr(this,"left",a),f=r.x(d),g=l<u.lineHeight?(u.lineHeight-l)/2:0,p=e.y+g;if(a.usePointStyle){const m={radius:Math.min(c,l)/2,pointStyle:o.pointStyle,rotation:o.rotation,borderWidth:1},y=r.leftForLtr(f,c)+c/2,v=p+l/2;t.strokeStyle=a.multiKeyBackground,t.fillStyle=a.multiKeyBackground,za(t,m,y,v),t.strokeStyle=s.borderColor,t.fillStyle=s.backgroundColor,za(t,m,y,v)}else{t.lineWidth=ct(s.borderWidth)?Math.max(...Object.values(s.borderWidth)):s.borderWidth||1,t.strokeStyle=s.borderColor,t.setLineDash(s.borderDash||[]),t.lineDashOffset=s.borderDashOffset||0;const m=r.leftForLtr(f,c),y=r.leftForLtr(r.xPlus(f,1),c-2),v=un(s.borderRadius);Object.values(v).some(x=>x!==0)?(t.beginPath(),t.fillStyle=a.multiKeyBackground,Kn(t,{x:m,y:p,w:c,h:l,radius:v}),t.fill(),t.stroke(),t.fillStyle=s.backgroundColor,t.beginPath(),Kn(t,{x:y,y:p+1,w:c-2,h:l-2,radius:v}),t.fill()):(t.fillStyle=a.multiKeyBackground,t.fillRect(m,p,c,l),t.strokeRect(m,p,c,l),t.fillStyle=s.backgroundColor,t.fillRect(y,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:r}=this,{bodySpacing:a,bodyAlign:s,displayColors:o,boxHeight:l,boxWidth:c,boxPadding:u}=i,d=Et(i.bodyFont);let f=d.lineHeight,g=0;const p=Jn(i.rtl,this.x,this.width),m=function(T){e.fillText(T,p.x(t.x+g),t.y+f/2),t.y+=f+a},y=p.textAlign(s);let v,x,w,_,S,C,k;for(e.textAlign=s,e.textBaseline="middle",e.font=d.string,t.x=Wr(this,y,i),e.fillStyle=i.bodyColor,wt(this.beforeBody,m),g=o&&y!=="right"?s==="center"?c/2+u:c+2+u:0,_=0,C=r.length;_<C;++_){for(v=r[_],x=this.labelTextColors[_],e.fillStyle=x,wt(v.before,m),w=v.lines,o&&w.length&&(this._drawColorBox(e,t,_,p,i),f=Math.max(d.lineHeight,l)),S=0,k=w.length;S<k;++S)m(w[S]),f=d.lineHeight;wt(v.after,m)}g=0,f=d.lineHeight,wt(this.afterBody,m),t.y-=a}drawFooter(t,e,i){const r=this.footer,a=r.length;let s,o;if(a){const l=Jn(i.rtl,this.x,this.width);for(t.x=Wr(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=l.textAlign(i.footerAlign),e.textBaseline="middle",s=Et(i.footerFont),e.fillStyle=i.footerColor,e.font=s.string,o=0;o<a;++o)e.fillText(r[o],l.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+i.footerSpacing}}drawBackground(t,e,i,r){const{xAlign:a,yAlign:s}=this,{x:o,y:l}=t,{width:c,height:u}=i,{topLeft:d,topRight:f,bottomLeft:g,bottomRight:p}=un(r.cornerRadius);e.fillStyle=r.backgroundColor,e.strokeStyle=r.borderColor,e.lineWidth=r.borderWidth,e.beginPath(),e.moveTo(o+d,l),s==="top"&&this.drawCaret(t,e,i,r),e.lineTo(o+c-f,l),e.quadraticCurveTo(o+c,l,o+c,l+f),s==="center"&&a==="right"&&this.drawCaret(t,e,i,r),e.lineTo(o+c,l+u-p),e.quadraticCurveTo(o+c,l+u,o+c-p,l+u),s==="bottom"&&this.drawCaret(t,e,i,r),e.lineTo(o+g,l+u),e.quadraticCurveTo(o,l+u,o,l+u-g),s==="center"&&a==="left"&&this.drawCaret(t,e,i,r),e.lineTo(o,l+d),e.quadraticCurveTo(o,l,o+d,l),e.closePath(),e.fill(),r.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,r=i&&i.x,a=i&&i.y;if(r||a){const s=Yi[t.position].call(this,this._active,this._eventPosition);if(!s)return;const o=this._size=_u(this,t),l=Object.assign({},s,this._size),c=Tu(e,t,l),u=Du(t,l,c,e);(r._to!==u.x||a._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=o.width,this.height=o.height,this.caretX=s.x,this.caretY=s.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const r={width:this.width,height:this.height},a={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const s=Xt(e.padding),o=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&o&&(t.save(),t.globalAlpha=i,this.drawBackground(a,t,r,e),oc(t,e.textDirection),a.y+=s.top,this.drawTitle(a,t,e),this.drawBody(a,t,e),this.drawFooter(a,t,e),lc(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,r=t.map(({datasetIndex:o,index:l})=>{const c=this.chart.getDatasetMeta(o);if(!c)throw new Error("Cannot find a dataset at index "+o);return{datasetIndex:o,element:c.data[l],index:l}}),a=!hr(i,r),s=this._positionChanged(r,e);(a||s)&&(this._active=r,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const r=this.options,a=this._active||[],s=this._getActiveElements(t,a,e,i),o=this._positionChanged(s,t),l=e||!hr(s,a)||o;return l&&(this._active=s,(r.enabled||r.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,i,r){const a=this.options;if(t.type==="mouseout")return[];if(!r)return e.filter(o=>this.chart.data.datasets[o.datasetIndex]&&this.chart.getDatasetMeta(o.datasetIndex).controller.getParsed(o.index)!==void 0);const s=this.chart.getElementsAtEventForMode(t,a.mode,a,i);return a.reverse&&s.reverse(),s}_positionChanged(t,e){const{caretX:i,caretY:r,options:a}=this,s=Yi[a.position].call(this,t,e);return s!==!1&&(i!==s.x||r!==s.y)}}Y(ps,"positioners",Yi);var Yr={id:"tooltip",_element:ps,positioners:Yi,afterInit(n,t,e){e&&(n.tooltip=new ps({chart:n,options:e}))},beforeUpdate(n,t,e){n.tooltip&&n.tooltip.initialize(e)},reset(n,t,e){n.tooltip&&n.tooltip.initialize(e)},afterDraw(n){const t=n.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(n.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",e)}},afterEvent(n,t){if(n.tooltip){const e=t.replay;n.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:(n,t)=>t.bodyFont.size,boxWidth:(n,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:Cu},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:n=>n!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},ny=Object.freeze({__proto__:null,Colors:p0,Decimation:v0,Filler:B0,Legend:j0,SubTitle:X0,Title:q0,Tooltip:Yr});const iy=(n,t,e,i)=>(typeof t=="string"?(e=n.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function ry(n,t,e,i){const r=n.indexOf(t);if(r===-1)return iy(n,t,e,i);const a=n.lastIndexOf(t);return r!==a?e:r}const ay=(n,t)=>n===null?null:Zt(Math.round(n),0,t);function ku(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class ms extends Rn{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const i=this.getLabels();for(const{index:r,label:a}of e)i[r]===a&&i.splice(r,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(it(t))return null;const i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:ry(i,t,nt(e,t),this._addedLabels),ay(e,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:r}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),e||(r=this.getLabels().length-1)),this.min=i,this.max=r}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,r=[];let a=this.getLabels();a=t===0&&e===a.length-1?a:a.slice(t,e+1),this._valueRange=Math.max(a.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let s=t;s<=e;s++)r.push({value:s});return r}getLabelForValue(t){return ku.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}}Y(ms,"id","category"),Y(ms,"defaults",{ticks:{callback:ku}});function sy(n,t){const e=[],{bounds:r,step:a,min:s,max:o,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:f}=n,g=a||1,p=u-1,{min:m,max:y}=t,v=!it(s),x=!it(o),w=!it(c),_=(y-m)/(d+1);let S=Al((y-m)/p/g)*g,C,k,T,D;if(S<1e-14&&!v&&!x)return[{value:m},{value:y}];D=Math.ceil(y/S)-Math.floor(m/S),D>p&&(S=Al(D*S/p/g)*g),it(l)||(C=Math.pow(10,l),S=Math.ceil(S*C)/C),r==="ticks"?(k=Math.floor(m/S)*S,T=Math.ceil(y/S)*S):(k=m,T=y),v&&x&&a&&ig((o-s)/a,S/1e3)?(D=Math.round(Math.min((o-s)/S,u)),S=(o-s)/D,k=s,T=o):w?(k=v?s:k,T=x?o:T,D=c-1,S=(T-k)/D):(D=(T-k)/S,wi(D,Math.round(D),S/1e3)?D=Math.round(D):D=Math.ceil(D));const O=Math.max(Ll(S),Ll(k));C=Math.pow(10,it(l)?O:l),k=Math.round(k*C)/C,T=Math.round(T*C)/C;let A=0;for(v&&(f&&k!==s?(e.push({value:s}),k<s&&A++,wi(Math.round((k+A*S)*C)/C,s,Ou(s,_,n))&&A++):k<s&&A++);A<D;++A){const R=Math.round((k+A*S)*C)/C;if(x&&R>o)break;e.push({value:R})}return x&&f&&T!==o?e.length&&wi(e[e.length-1].value,o,Ou(o,_,n))?e[e.length-1].value=o:e.push({value:o}):(!x||T===o)&&e.push({value:T}),e}function Ou(n,t,{horizontal:e,minRotation:i}){const r=qt(i),a=(e?Math.sin(r):Math.cos(r))||.001,s=.75*t*(""+n).length;return Math.min(t/a,s)}class zr extends Rn{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 it(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:r,max:a}=this;const s=l=>r=e?r:l,o=l=>a=i?a:l;if(t){const l=Le(r),c=Le(a);l<0&&c<0?o(0):l>0&&c>0&&s(0)}if(r===a){let l=a===0?1:Math.abs(a*.05);o(a+l),t||s(r-l)}this.min=r,this.max=a}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:i}=t,r;return i?(r=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,r>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${r} ticks. Limiting to 1000.`),r=1e3)):(r=this.computeTickLimit(),e=e||11),e&&(r=Math.min(e,r)),r}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const r={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},a=this._range||this,s=sy(r,a);return t.bounds==="ticks"&&Rl(s,this,"value"),t.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const r=(i-e)/Math.max(t.length-1,1)/2;e-=r,i+=r}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return Di(t,this.chart.options.locale,this.options.ticks.format)}}class ys extends zr{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Lt(t)?t:0,this.max=Lt(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=qt(this.options.ticks.minRotation),r=(t?Math.sin(i):Math.cos(i))||.001,a=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,a.lineHeight/r))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}Y(ys,"id","linear"),Y(ys,"defaults",{ticks:{callback:vr.formatters.numeric}});const zi=n=>Math.floor(ln(n)),Ln=(n,t)=>Math.pow(10,zi(n)+t);function Pu(n){return n/Math.pow(10,zi(n))===1}function Eu(n,t,e){const i=Math.pow(10,e),r=Math.floor(n/i);return Math.ceil(t/i)-r}function oy(n,t){const e=t-n;let i=zi(e);for(;Eu(n,t,i)>10;)i++;for(;Eu(n,t,i)<10;)i--;return Math.min(i,zi(n))}function ly(n,{min:t,max:e}){t=be(n.min,t);const i=[],r=zi(t);let a=oy(t,e),s=a<0?Math.pow(10,Math.abs(a)):1;const o=Math.pow(10,a),l=r>a?Math.pow(10,r):0,c=Math.round((t-l)*s)/s,u=Math.floor((t-l)/o/10)*o*10;let d=Math.floor((c-u)/Math.pow(10,a)),f=be(n.min,Math.round((l+u+d*Math.pow(10,a))*s)/s);for(;f<e;)i.push({value:f,major:Pu(f),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(a++,d=2,s=a>=0?1:s),f=Math.round((l+u+d*Math.pow(10,a))*s)/s;const g=be(n.max,f);return i.push({value:g,major:Pu(g),significand:d}),i}class bs extends Rn{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=zr.prototype.parse.apply(this,[t,e]);if(i===0){this._zero=!0;return}return Lt(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Lt(t)?Math.max(0,t):null,this.max=Lt(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Lt(this._userMin)&&(this.min=t===Ln(this.min,0)?Ln(this.min,-1):Ln(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,r=this.max;const a=o=>i=t?i:o,s=o=>r=e?r:o;i===r&&(i<=0?(a(1),s(10)):(a(Ln(i,-1)),s(Ln(r,1)))),i<=0&&a(Ln(r,-1)),r<=0&&s(Ln(i,1)),this.min=i,this.max=r}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},i=ly(e,this);return t.bounds==="ticks"&&Rl(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return t===void 0?"0":Di(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=ln(t),this._valueRange=ln(this.max)-ln(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(ln(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}Y(bs,"id","logarithmic"),Y(bs,"defaults",{ticks:{callback:vr.formatters.logarithmic,major:{enabled:!0}}});function vs(n){const t=n.ticks;if(t.display&&n.display){const e=Xt(t.backdropPadding);return nt(t.font&&t.font.size,Ft.font.size)+e.height}return 0}function cy(n,t,e){return e=yt(e)?e:[e],{w:xg(n,t.string,e),h:e.length*t.lineHeight}}function Au(n,t,e,i,r){return n===i||n===r?{start:t-e/2,end:t+e/2}:n<i||n>r?{start:t-e,end:t}:{start:t,end:t+e}}function uy(n){const t={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},e=Object.assign({},t),i=[],r=[],a=n._pointLabels.length,s=n.options.pointLabels,o=s.centerPointLabels?dt/a:0;for(let l=0;l<a;l++){const c=s.setContext(n.getPointLabelContext(l));r[l]=c.padding;const u=n.getPointPosition(l,n.drawingArea+r[l],o),d=Et(c.font),f=cy(n.ctx,d,n._pointLabels[l]);i[l]=f;const g=ve(n.getIndexAngle(l)+o),p=Math.round(yr(g)),m=Au(p,u.x,f.w,0,180),y=Au(p,u.y,f.h,90,270);dy(e,t,g,m,y)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=gy(n,i,r)}function dy(n,t,e,i,r){const a=Math.abs(Math.sin(e)),s=Math.abs(Math.cos(e));let o=0,l=0;i.start<t.l?(o=(t.l-i.start)/a,n.l=Math.min(n.l,t.l-o)):i.end>t.r&&(o=(i.end-t.r)/a,n.r=Math.max(n.r,t.r+o)),r.start<t.t?(l=(t.t-r.start)/s,n.t=Math.min(n.t,t.t-l)):r.end>t.b&&(l=(r.end-t.b)/s,n.b=Math.max(n.b,t.b+l))}function fy(n,t,e){const i=n.drawingArea,{extra:r,additionalAngle:a,padding:s,size:o}=e,l=n.getPointPosition(t,i+r+s,a),c=Math.round(yr(ve(l.angle+Pt))),u=yy(l.y,o.h,c),d=py(c),f=my(l.x,o.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:f,top:u,right:f+o.w,bottom:u+o.h}}function hy(n,t){if(!t)return!0;const{left:e,top:i,right:r,bottom:a}=n;return!(Ve({x:e,y:i},t)||Ve({x:e,y:a},t)||Ve({x:r,y:i},t)||Ve({x:r,y:a},t))}function gy(n,t,e){const i=[],r=n._pointLabels.length,a=n.options,{centerPointLabels:s,display:o}=a.pointLabels,l={extra:vs(a)/2,additionalAngle:s?dt/r:0};let c;for(let u=0;u<r;u++){l.padding=e[u],l.size=t[u];const d=fy(n,u,l);i.push(d),o==="auto"&&(d.visible=hy(d,c),d.visible&&(c=d))}return i}function py(n){return n===0||n===180?"center":n<180?"left":"right"}function my(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function yy(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function by(n,t,e){const{left:i,top:r,right:a,bottom:s}=e,{backdropColor:o}=t;if(!it(o)){const l=un(t.borderRadius),c=Xt(t.backdropPadding);n.fillStyle=o;const u=i-c.left,d=r-c.top,f=a-i+c.width,g=s-r+c.height;Object.values(l).some(p=>p!==0)?(n.beginPath(),Kn(n,{x:u,y:d,w:f,h:g,radius:l}),n.fill()):n.fillRect(u,d,f,g)}}function vy(n,t){const{ctx:e,options:{pointLabels:i}}=n;for(let r=t-1;r>=0;r--){const a=n._pointLabelItems[r];if(!a.visible)continue;const s=i.setContext(n.getPointLabelContext(r));by(e,s,a);const o=Et(s.font),{x:l,y:c,textAlign:u}=a;On(e,n._pointLabels[r],l,c+o.lineHeight/2,o,{color:s.color,textAlign:u,textBaseline:"middle"})}}function Ru(n,t,e,i){const{ctx:r}=n;if(e)r.arc(n.xCenter,n.yCenter,t,0,kt);else{let a=n.getPointPosition(0,t);r.moveTo(a.x,a.y);for(let s=1;s<i;s++)a=n.getPointPosition(s,t),r.lineTo(a.x,a.y)}}function xy(n,t,e,i,r){const a=n.ctx,s=t.circular,{color:o,lineWidth:l}=t;!s&&!i||!o||!l||e<0||(a.save(),a.strokeStyle=o,a.lineWidth=l,a.setLineDash(r.dash),a.lineDashOffset=r.dashOffset,a.beginPath(),Ru(n,e,s,i),a.closePath(),a.stroke(),a.restore())}function wy(n,t,e){return dn(n,{label:e,index:t,type:"pointLabel"})}class Hi extends zr{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=Xt(vs(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=Lt(t)&&!isNaN(t)?t:0,this.max=Lt(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/vs(this.options))}generateTickLabels(t){zr.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,i)=>{const r=xt(this.options.pointLabels.callback,[e,i],this);return r||r===0?r:""}).filter((e,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?uy(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,r){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-r)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,r))}getIndexAngle(t){const e=kt/(this._pointLabels.length||1),i=this.options.startAngle||0;return ve(t*e+qt(i))}getDistanceFromCenterForValue(t){if(it(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(it(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 i=e[t];return wy(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const r=this.getIndexAngle(t)-Pt+i;return{x:Math.cos(r)*e+this.xCenter,y:Math.sin(r)*e+this.yCenter,angle:r}}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:i,right:r,bottom:a}=this._pointLabelItems[t];return{left:e,top:i,right:r,bottom:a}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),Ru(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:i,grid:r,border:a}=e,s=this._pointLabels.length;let o,l,c;if(e.pointLabels.display&&vy(this,s),r.display&&this.ticks.forEach((u,d)=>{if(d!==0){l=this.getDistanceFromCenterForValue(u.value);const f=this.getContext(d),g=r.setContext(f),p=a.setContext(f);xy(this,g,l,s,p)}}),i.display){for(t.save(),o=s-1;o>=0;o--){const u=i.setContext(this.getPointLabelContext(o)),{color:d,lineWidth:f}=u;!f||!d||(t.lineWidth=f,t.strokeStyle=d,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),c=this.getPointPosition(o,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,i=e.ticks;if(!i.display)return;const r=this.getIndexAngle(0);let a,s;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(r),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((o,l)=>{if(l===0&&!e.reverse)return;const c=i.setContext(this.getContext(l)),u=Et(c.font);if(a=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,s=t.measureText(o.label).width,t.fillStyle=c.backdropColor;const d=Xt(c.backdropPadding);t.fillRect(-s/2-d.left,-a-u.size/2-d.top,s+d.width,u.size+d.height)}On(t,o.label,0,-a,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}Y(Hi,"id","radialLinear"),Y(Hi,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:vr.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),Y(Hi,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),Y(Hi,"descriptors",{angleLines:{_fallback:"grid"}});const Hr={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}},he=Object.keys(Hr);function Lu(n,t){return n-t}function Iu(n,t){if(it(t))return null;const e=n._adapter,{parser:i,round:r,isoWeekday:a}=n._parseOpts;let s=t;return typeof i=="function"&&(s=i(s)),Lt(s)||(s=typeof i=="string"?e.parse(s,i):e.parse(s)),s===null?null:(r&&(s=r==="week"&&(cn(a)||a===!0)?e.startOf(s,"isoWeek",a):e.startOf(s,r)),+s)}function Nu(n,t,e,i){const r=he.length;for(let a=he.indexOf(n);a<r-1;++a){const s=Hr[he[a]],o=s.steps?s.steps:Number.MAX_SAFE_INTEGER;if(s.common&&Math.ceil((e-t)/(o*s.size))<=i)return he[a]}return he[r-1]}function _y(n,t,e,i,r){for(let a=he.length-1;a>=he.indexOf(e);a--){const s=he[a];if(Hr[s].common&&n._adapter.diff(r,i,s)>=t-1)return s}return he[e?he.indexOf(e):0]}function Ty(n){for(let t=he.indexOf(n)+1,e=he.length;t<e;++t)if(Hr[he[t]].common)return he[t]}function Fu(n,t,e){if(!e)n[t]=!0;else if(e.length){const{lo:i,hi:r}=Na(e,t),a=e[i]>=t?e[i]:e[r];n[a]=!0}}function Dy(n,t,e,i){const r=n._adapter,a=+r.startOf(t[0].value,i),s=t[t.length-1].value;let o,l;for(o=a;o<=s;o=+r.add(o,1,i))l=e[o],l>=0&&(t[l].major=!0);return t}function Uu(n,t,e){const i=[],r={},a=t.length;let s,o;for(s=0;s<a;++s)o=t[s],r[o]=s,i.push({value:o,major:!1});return a===0||!e?i:Dy(n,i,r,e)}class $i extends Rn{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const i=t.time||(t.time={}),r=this._adapter=new Cc._date(t.adapters.date);r.init(e),xi(i.displayFormats,r.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:Iu(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:r,max:a,minDefined:s,maxDefined:o}=this.getUserBounds();function l(c){!s&&!isNaN(c.min)&&(r=Math.min(r,c.min)),!o&&!isNaN(c.max)&&(a=Math.max(a,c.max))}(!s||!o)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),r=Lt(r)&&!isNaN(r)?r:+e.startOf(Date.now(),i),a=Lt(a)&&!isNaN(a)?a:+e.endOf(Date.now(),i)+1,this.min=Math.min(r,a-1),this.max=Math.max(r+1,a)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,r=i.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&r.length&&(this.min=this._userMin||r[0],this.max=this._userMax||r[r.length-1]);const a=this.min,s=this.max,o=og(r,a,s);return this._unit=e.unit||(i.autoSkip?Nu(e.minUnit,this.min,this.max,this._getLabelCapacity(a)):_y(this,o.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:Ty(this._unit),this.initOffsets(r),t.reverse&&o.reverse(),Uu(this,o,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,i=0,r,a;this.options.offset&&t.length&&(r=this.getDecimalForValue(t[0]),t.length===1?e=1-r:e=(this.getDecimalForValue(t[1])-r)/2,a=this.getDecimalForValue(t[t.length-1]),t.length===1?i=a:i=(a-this.getDecimalForValue(t[t.length-2]))/2);const s=t.length<3?.5:.25;e=Zt(e,0,s),i=Zt(i,0,s),this._offsets={start:e,end:i,factor:1/(e+1+i)}}_generate(){const t=this._adapter,e=this.min,i=this.max,r=this.options,a=r.time,s=a.unit||Nu(a.minUnit,e,i,this._getLabelCapacity(e)),o=nt(r.ticks.stepSize,1),l=s==="week"?a.isoWeekday:!1,c=cn(l)||l===!0,u={};let d=e,f,g;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":s),t.diff(i,e,s)>1e5*o)throw new Error(e+" and "+i+" are too far apart with stepSize of "+o+" "+s);const p=r.ticks.source==="data"&&this.getDataTimestamps();for(f=d,g=0;f<i;f=+t.add(f,o,s),g++)Fu(u,f,p);return(f===i||r.bounds==="ticks"||g===1)&&Fu(u,f,p),Object.keys(u).sort(Lu).map(m=>+m)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const r=this.options.time.displayFormats,a=this._unit,s=e||r[a];return this._adapter.format(t,s)}_tickFormatFunction(t,e,i,r){const a=this.options,s=a.ticks.callback;if(s)return xt(s,[t,e,i],this);const o=a.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&o[l],d=c&&o[c],f=i[e],g=c&&d&&f&&f.major;return this._adapter.format(t,r||(g?d:u))}generateTickLabels(t){let e,i,r;for(e=0,i=t.length;e<i;++e)r=t[e],r.label=this._tickFormatFunction(r.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,i=this.ctx.measureText(t).width,r=qt(this.isHorizontal()?e.maxRotation:e.minRotation),a=Math.cos(r),s=Math.sin(r),o=this._resolveTickFontOptions(0).size;return{w:i*a+o*s,h:i*s+o*a}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,r=i[e.unit]||i.millisecond,a=this._tickFormatFunction(t,0,Uu(this,[t],this._majorUnit),r),s=this._getLabelSize(a),o=Math.floor(this.isHorizontal()?this.width/s.w:this.height/s.h)-1;return o>0?o:1}getDataTimestamps(){let t=this._cache.data||[],e,i;if(t.length)return t;const r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(e=0,i=r.length;e<i;++e)t=t.concat(r[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;const r=this.getLabels();for(e=0,i=r.length;e<i;++e)t.push(Iu(this,r[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Ul(t.sort(Lu))}}Y($i,"id","time"),Y($i,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function $r(n,t,e){let i=0,r=n.length-1,a,s,o,l;e?(t>=n[i].pos&&t<=n[r].pos&&({lo:i,hi:r}=je(n,"pos",t)),{pos:a,time:o}=n[i],{pos:s,time:l}=n[r]):(t>=n[i].time&&t<=n[r].time&&({lo:i,hi:r}=je(n,"time",t)),{time:a,pos:o}=n[i],{time:s,pos:l}=n[r]);const c=s-a;return c?o+(l-o)*(t-a)/c:o}class xs extends $i{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=$r(e,this.min),this._tableRange=$r(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,r=[],a=[];let s,o,l,c,u;for(s=0,o=t.length;s<o;++s)c=t[s],c>=e&&c<=i&&r.push(c);if(r.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(s=0,o=r.length;s<o;++s)u=r[s+1],l=r[s-1],c=r[s],Math.round((u+l)/2)!==c&&a.push({time:c,pos:s/(o-1)});return a}_generate(){const t=this.min,e=this.max;let i=super.getDataTimestamps();return(!i.includes(t)||!i.length)&&i.splice(0,0,t),(!i.includes(e)||i.length===1)&&i.push(e),i.sort((r,a)=>r-a)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return e.length&&i.length?t=this.normalize(e.concat(i)):t=e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return($r(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return $r(this._table,i*this._tableRange+this._minPos,!0)}}Y(xs,"id","timeseries"),Y(xs,"defaults",$i.defaults);var Sy=Object.freeze({__proto__:null,CategoryScale:ms,LinearScale:ys,LogarithmicScale:bs,RadialLinearScale:Hi,TimeScale:$i,TimeSeriesScale:xs});const My=[Ip,c0,ny,Sy],Cy=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],ky=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],Oy=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],Py=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],Bu=(n,t,e)=>{let i=n;return typeof t=="string"||Array.isArray(t)?i=n.toLocaleString(t,e):(t===!0||e!==void 0)&&(i=n.toLocaleString(void 0,e)),i};function ws(n,t){if(!Number.isFinite(n))throw new TypeError(`Expected a finite number, got ${typeof n}: ${n}`);t={bits:!1,binary:!1,space:!0,...t};const e=t.bits?t.binary?Py:Oy:t.binary?ky:Cy,i=t.space?" ":"";if(t.signed&&n===0)return` 0${i}${e[0]}`;const r=n<0,a=r?"-":t.signed?"+":"";r&&(n=-n);let s;if(t.minimumFractionDigits!==void 0&&(s={minimumFractionDigits:t.minimumFractionDigits}),t.maximumFractionDigits!==void 0&&(s={maximumFractionDigits:t.maximumFractionDigits,...s}),n<1){const u=Bu(n,t.locale,s);return a+u+i+e[0]}const o=Math.min(Math.floor(t.binary?Math.log(n)/Math.log(1024):Math.log10(n)/3),e.length-1);n/=(t.binary?1024:1e3)**o,s||(n=n.toPrecision(3));const l=Bu(Number(n),t.locale,s),c=e[o];return a+l+i+c}function Ge(n){"@babel/helpers - typeof";return Ge=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ge(n)}function At(n){if(n===null||n===!0||n===!1)return NaN;var t=Number(n);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function G(n,t){if(t.length<n)throw new TypeError(n+" argument"+(n>1?"s":"")+" required, but only "+t.length+" present")}function J(n){G(1,arguments);var t=Object.prototype.toString.call(n);return n instanceof Date||Ge(n)==="object"&&t==="[object Date]"?new Date(n.getTime()):typeof n=="number"||t==="[object Number]"?new Date(n):((typeof n=="string"||t==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function Wu(n,t){G(2,arguments);var e=J(n),i=At(t);return isNaN(i)?new Date(NaN):(i&&e.setDate(e.getDate()+i),e)}function _s(n,t){G(2,arguments);var e=J(n),i=At(t);if(isNaN(i))return new Date(NaN);if(!i)return e;var r=e.getDate(),a=new Date(e.getTime());a.setMonth(e.getMonth()+i+1,0);var s=a.getDate();return r>=s?a:(e.setFullYear(a.getFullYear(),a.getMonth(),r),e)}function ji(n,t){G(2,arguments);var e=J(n).getTime(),i=At(t);return new Date(e+i)}var Ey=36e5;function Ay(n,t){G(2,arguments);var e=At(t);return ji(n,e*Ey)}var Ry={};function mn(){return Ry}function Yu(n,t){var e,i,r,a,s,o,l,c;G(1,arguments);var u=mn(),d=At((e=(i=(r=(a=t==null?void 0:t.weekStartsOn)!==null&&a!==void 0?a:t==null||(s=t.locale)===null||s===void 0||(o=s.options)===null||o===void 0?void 0:o.weekStartsOn)!==null&&r!==void 0?r:u.weekStartsOn)!==null&&i!==void 0?i:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&e!==void 0?e:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=J(n),g=f.getDay(),p=(g<d?7:0)+g-d;return f.setDate(f.getDate()-p),f.setHours(0,0,0,0),f}function jr(n){var t=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return t.setUTCFullYear(n.getFullYear()),n.getTime()-t.getTime()}function Ts(n){G(1,arguments);var t=J(n);return t.setHours(0,0,0,0),t}var Ly=864e5;function Iy(n,t){G(2,arguments);var e=Ts(n),i=Ts(t),r=e.getTime()-jr(e),a=i.getTime()-jr(i);return Math.round((r-a)/Ly)}var Ny=6e4;function Fy(n,t){G(2,arguments);var e=At(t);return ji(n,e*Ny)}function Uy(n,t){G(2,arguments);var e=At(t),i=e*3;return _s(n,i)}function By(n,t){G(2,arguments);var e=At(t);return ji(n,e*1e3)}function Wy(n,t){G(2,arguments);var e=At(t),i=e*7;return Wu(n,i)}function Yy(n,t){G(2,arguments);var e=At(t);return _s(n,e*12)}function Vi(n,t){G(2,arguments);var e=J(n),i=J(t),r=e.getTime()-i.getTime();return r<0?-1:r>0?1:r}var Vr=6e4,qi=36e5,zy=1e3,Hy=3600;function $y(n){return G(1,arguments),n instanceof Date||Ge(n)==="object"&&Object.prototype.toString.call(n)==="[object Date]"}function Ds(n){if(G(1,arguments),!$y(n)&&typeof n!="number")return!1;var t=J(n);return!isNaN(Number(t))}function jy(n,t){G(2,arguments);var e=J(n),i=J(t),r=e.getFullYear()-i.getFullYear(),a=e.getMonth()-i.getMonth();return r*12+a}function Vy(n,t){G(2,arguments);var e=J(n),i=J(t);return e.getFullYear()-i.getFullYear()}function zu(n,t){var e=n.getFullYear()-t.getFullYear()||n.getMonth()-t.getMonth()||n.getDate()-t.getDate()||n.getHours()-t.getHours()||n.getMinutes()-t.getMinutes()||n.getSeconds()-t.getSeconds()||n.getMilliseconds()-t.getMilliseconds();return e<0?-1:e>0?1:e}function Hu(n,t){G(2,arguments);var e=J(n),i=J(t),r=zu(e,i),a=Math.abs(Iy(e,i));e.setDate(e.getDate()-r*a);var s=+(zu(e,i)===-r),o=r*(a-s);return o===0?0:o}function qr(n,t){return G(2,arguments),J(n).getTime()-J(t).getTime()}var $u={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(t){return t<0?Math.ceil(t):Math.floor(t)}},qy="trunc";function Xi(n){return n?$u[n]:$u[qy]}function Xy(n,t,e){G(2,arguments);var i=qr(n,t)/qi;return Xi(e==null?void 0:e.roundingMethod)(i)}function Gy(n,t,e){G(2,arguments);var i=qr(n,t)/Vr;return Xi(e==null?void 0:e.roundingMethod)(i)}function ju(n){G(1,arguments);var t=J(n);return t.setHours(23,59,59,999),t}function Vu(n){G(1,arguments);var t=J(n),e=t.getMonth();return t.setFullYear(t.getFullYear(),e+1,0),t.setHours(23,59,59,999),t}function Ky(n){G(1,arguments);var t=J(n);return ju(t).getTime()===Vu(t).getTime()}function qu(n,t){G(2,arguments);var e=J(n),i=J(t),r=Vi(e,i),a=Math.abs(jy(e,i)),s;if(a<1)s=0;else{e.getMonth()===1&&e.getDate()>27&&e.setDate(30),e.setMonth(e.getMonth()-r*a);var o=Vi(e,i)===-r;Ky(J(n))&&a===1&&Vi(n,i)===1&&(o=!1),s=r*(a-Number(o))}return s===0?0:s}function Zy(n,t,e){G(2,arguments);var i=qu(n,t)/3;return Xi(e==null?void 0:e.roundingMethod)(i)}function Qy(n,t,e){G(2,arguments);var i=qr(n,t)/1e3;return Xi(e==null?void 0:e.roundingMethod)(i)}function Jy(n,t,e){G(2,arguments);var i=Hu(n,t)/7;return Xi(e==null?void 0:e.roundingMethod)(i)}function tb(n,t){G(2,arguments);var e=J(n),i=J(t),r=Vi(e,i),a=Math.abs(Vy(e,i));e.setFullYear(1584),i.setFullYear(1584);var s=Vi(e,i)===-r,o=r*(a-Number(s));return o===0?0:o}function eb(n){G(1,arguments);var t=J(n);return t.setSeconds(0,0),t}function nb(n){G(1,arguments);var t=J(n),e=t.getMonth(),i=e-e%3;return t.setMonth(i,1),t.setHours(0,0,0,0),t}function ib(n){G(1,arguments);var t=J(n);return t.setDate(1),t.setHours(0,0,0,0),t}function rb(n){G(1,arguments);var t=J(n),e=t.getFullYear();return t.setFullYear(e+1,0,0),t.setHours(23,59,59,999),t}function ab(n){G(1,arguments);var t=J(n),e=new Date(0);return e.setFullYear(t.getFullYear(),0,1),e.setHours(0,0,0,0),e}function sb(n){G(1,arguments);var t=J(n);return t.setMinutes(59,59,999),t}function ob(n,t){var e,i,r,a,s,o,l,c;G(1,arguments);var u=mn(),d=At((e=(i=(r=(a=t==null?void 0:t.weekStartsOn)!==null&&a!==void 0?a:t==null||(s=t.locale)===null||s===void 0||(o=s.options)===null||o===void 0?void 0:o.weekStartsOn)!==null&&r!==void 0?r:u.weekStartsOn)!==null&&i!==void 0?i:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&e!==void 0?e:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=J(n),g=f.getDay(),p=(g<d?-7:0)+6-(g-d);return f.setDate(f.getDate()+p),f.setHours(23,59,59,999),f}function lb(n){G(1,arguments);var t=J(n);return t.setSeconds(59,999),t}function cb(n){G(1,arguments);var t=J(n),e=t.getMonth(),i=e-e%3+3;return t.setMonth(i,0),t.setHours(23,59,59,999),t}function ub(n){G(1,arguments);var t=J(n);return t.setMilliseconds(999),t}function Xu(n,t){G(2,arguments);var e=At(t);return ji(n,-e)}var db=864e5;function fb(n){G(1,arguments);var t=J(n),e=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var i=t.getTime(),r=e-i;return Math.floor(r/db)+1}function ei(n){G(1,arguments);var t=1,e=J(n),i=e.getUTCDay(),r=(i<t?7:0)+i-t;return e.setUTCDate(e.getUTCDate()-r),e.setUTCHours(0,0,0,0),e}function Gu(n){G(1,arguments);var t=J(n),e=t.getUTCFullYear(),i=new Date(0);i.setUTCFullYear(e+1,0,4),i.setUTCHours(0,0,0,0);var r=ei(i),a=new Date(0);a.setUTCFullYear(e,0,4),a.setUTCHours(0,0,0,0);var s=ei(a);return t.getTime()>=r.getTime()?e+1:t.getTime()>=s.getTime()?e:e-1}function hb(n){G(1,arguments);var t=Gu(n),e=new Date(0);e.setUTCFullYear(t,0,4),e.setUTCHours(0,0,0,0);var i=ei(e);return i}var gb=6048e5;function Ku(n){G(1,arguments);var t=J(n),e=ei(t).getTime()-hb(t).getTime();return Math.round(e/gb)+1}function In(n,t){var e,i,r,a,s,o,l,c;G(1,arguments);var u=mn(),d=At((e=(i=(r=(a=t==null?void 0:t.weekStartsOn)!==null&&a!==void 0?a:t==null||(s=t.locale)===null||s===void 0||(o=s.options)===null||o===void 0?void 0:o.weekStartsOn)!==null&&r!==void 0?r:u.weekStartsOn)!==null&&i!==void 0?i:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&e!==void 0?e:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=J(n),g=f.getUTCDay(),p=(g<d?7:0)+g-d;return f.setUTCDate(f.getUTCDate()-p),f.setUTCHours(0,0,0,0),f}function Ss(n,t){var e,i,r,a,s,o,l,c;G(1,arguments);var u=J(n),d=u.getUTCFullYear(),f=mn(),g=At((e=(i=(r=(a=t==null?void 0:t.firstWeekContainsDate)!==null&&a!==void 0?a:t==null||(s=t.locale)===null||s===void 0||(o=s.options)===null||o===void 0?void 0:o.firstWeekContainsDate)!==null&&r!==void 0?r:f.firstWeekContainsDate)!==null&&i!==void 0?i:(l=f.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&e!==void 0?e:1);if(!(g>=1&&g<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var p=new Date(0);p.setUTCFullYear(d+1,0,g),p.setUTCHours(0,0,0,0);var m=In(p,t),y=new Date(0);y.setUTCFullYear(d,0,g),y.setUTCHours(0,0,0,0);var v=In(y,t);return u.getTime()>=m.getTime()?d+1:u.getTime()>=v.getTime()?d:d-1}function pb(n,t){var e,i,r,a,s,o,l,c;G(1,arguments);var u=mn(),d=At((e=(i=(r=(a=t==null?void 0:t.firstWeekContainsDate)!==null&&a!==void 0?a:t==null||(s=t.locale)===null||s===void 0||(o=s.options)===null||o===void 0?void 0:o.firstWeekContainsDate)!==null&&r!==void 0?r:u.firstWeekContainsDate)!==null&&i!==void 0?i:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&e!==void 0?e:1),f=Ss(n,t),g=new Date(0);g.setUTCFullYear(f,0,d),g.setUTCHours(0,0,0,0);var p=In(g,t);return p}var mb=6048e5;function Zu(n,t){G(1,arguments);var e=J(n),i=In(e,t).getTime()-pb(e,t).getTime();return Math.round(i/mb)+1}function _t(n,t){for(var e=n<0?"-":"",i=Math.abs(n).toString();i.length<t;)i="0"+i;return e+i}var yb={y:function(t,e){var i=t.getUTCFullYear(),r=i>0?i:1-i;return _t(e==="yy"?r%100:r,e.length)},M:function(t,e){var i=t.getUTCMonth();return e==="M"?String(i+1):_t(i+1,2)},d:function(t,e){return _t(t.getUTCDate(),e.length)},a:function(t,e){var i=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return i.toUpperCase();case"aaa":return i;case"aaaaa":return i[0];case"aaaa":default:return i==="am"?"a.m.":"p.m."}},h:function(t,e){return _t(t.getUTCHours()%12||12,e.length)},H:function(t,e){return _t(t.getUTCHours(),e.length)},m:function(t,e){return _t(t.getUTCMinutes(),e.length)},s:function(t,e){return _t(t.getUTCSeconds(),e.length)},S:function(t,e){var i=e.length,r=t.getUTCMilliseconds(),a=Math.floor(r*Math.pow(10,i-3));return _t(a,e.length)}};const yn=yb;var ni={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},bb={G:function(t,e,i){var r=t.getUTCFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return i.era(r,{width:"abbreviated"});case"GGGGG":return i.era(r,{width:"narrow"});case"GGGG":default:return i.era(r,{width:"wide"})}},y:function(t,e,i){if(e==="yo"){var r=t.getUTCFullYear(),a=r>0?r:1-r;return i.ordinalNumber(a,{unit:"year"})}return yn.y(t,e)},Y:function(t,e,i,r){var a=Ss(t,r),s=a>0?a:1-a;if(e==="YY"){var o=s%100;return _t(o,2)}return e==="Yo"?i.ordinalNumber(s,{unit:"year"}):_t(s,e.length)},R:function(t,e){var i=Gu(t);return _t(i,e.length)},u:function(t,e){var i=t.getUTCFullYear();return _t(i,e.length)},Q:function(t,e,i){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return _t(r,2);case"Qo":return i.ordinalNumber(r,{unit:"quarter"});case"QQQ":return i.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return i.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return i.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,i){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return _t(r,2);case"qo":return i.ordinalNumber(r,{unit:"quarter"});case"qqq":return i.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return i.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return i.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,i){var r=t.getUTCMonth();switch(e){case"M":case"MM":return yn.M(t,e);case"Mo":return i.ordinalNumber(r+1,{unit:"month"});case"MMM":return i.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return i.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return i.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,i){var r=t.getUTCMonth();switch(e){case"L":return String(r+1);case"LL":return _t(r+1,2);case"Lo":return i.ordinalNumber(r+1,{unit:"month"});case"LLL":return i.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return i.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return i.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,i,r){var a=Zu(t,r);return e==="wo"?i.ordinalNumber(a,{unit:"week"}):_t(a,e.length)},I:function(t,e,i){var r=Ku(t);return e==="Io"?i.ordinalNumber(r,{unit:"week"}):_t(r,e.length)},d:function(t,e,i){return e==="do"?i.ordinalNumber(t.getUTCDate(),{unit:"date"}):yn.d(t,e)},D:function(t,e,i){var r=fb(t);return e==="Do"?i.ordinalNumber(r,{unit:"dayOfYear"}):_t(r,e.length)},E:function(t,e,i){var r=t.getUTCDay();switch(e){case"E":case"EE":case"EEE":return i.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return i.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return i.day(r,{width:"short",context:"formatting"});case"EEEE":default:return i.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,i,r){var a=t.getUTCDay(),s=(a-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(s);case"ee":return _t(s,2);case"eo":return i.ordinalNumber(s,{unit:"day"});case"eee":return i.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return i.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return i.day(a,{width:"short",context:"formatting"});case"eeee":default:return i.day(a,{width:"wide",context:"formatting"})}},c:function(t,e,i,r){var a=t.getUTCDay(),s=(a-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(s);case"cc":return _t(s,e.length);case"co":return i.ordinalNumber(s,{unit:"day"});case"ccc":return i.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return i.day(a,{width:"narrow",context:"standalone"});case"cccccc":return i.day(a,{width:"short",context:"standalone"});case"cccc":default:return i.day(a,{width:"wide",context:"standalone"})}},i:function(t,e,i){var r=t.getUTCDay(),a=r===0?7:r;switch(e){case"i":return String(a);case"ii":return _t(a,e.length);case"io":return i.ordinalNumber(a,{unit:"day"});case"iii":return i.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return i.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return i.day(r,{width:"short",context:"formatting"});case"iiii":default:return i.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,i){var r=t.getUTCHours(),a=r/12>=1?"pm":"am";switch(e){case"a":case"aa":return i.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return i.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return i.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return i.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(t,e,i){var r=t.getUTCHours(),a;switch(r===12?a=ni.noon:r===0?a=ni.midnight:a=r/12>=1?"pm":"am",e){case"b":case"bb":return i.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return i.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return i.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return i.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,e,i){var r=t.getUTCHours(),a;switch(r>=17?a=ni.evening:r>=12?a=ni.afternoon:r>=4?a=ni.morning:a=ni.night,e){case"B":case"BB":case"BBB":return i.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return i.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return i.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,e,i){if(e==="ho"){var r=t.getUTCHours()%12;return r===0&&(r=12),i.ordinalNumber(r,{unit:"hour"})}return yn.h(t,e)},H:function(t,e,i){return e==="Ho"?i.ordinalNumber(t.getUTCHours(),{unit:"hour"}):yn.H(t,e)},K:function(t,e,i){var r=t.getUTCHours()%12;return e==="Ko"?i.ordinalNumber(r,{unit:"hour"}):_t(r,e.length)},k:function(t,e,i){var r=t.getUTCHours();return r===0&&(r=24),e==="ko"?i.ordinalNumber(r,{unit:"hour"}):_t(r,e.length)},m:function(t,e,i){return e==="mo"?i.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):yn.m(t,e)},s:function(t,e,i){return e==="so"?i.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):yn.s(t,e)},S:function(t,e){return yn.S(t,e)},X:function(t,e,i,r){var a=r._originalDate||t,s=a.getTimezoneOffset();if(s===0)return"Z";switch(e){case"X":return Ju(s);case"XXXX":case"XX":return Nn(s);case"XXXXX":case"XXX":default:return Nn(s,":")}},x:function(t,e,i,r){var a=r._originalDate||t,s=a.getTimezoneOffset();switch(e){case"x":return Ju(s);case"xxxx":case"xx":return Nn(s);case"xxxxx":case"xxx":default:return Nn(s,":")}},O:function(t,e,i,r){var a=r._originalDate||t,s=a.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Qu(s,":");case"OOOO":default:return"GMT"+Nn(s,":")}},z:function(t,e,i,r){var a=r._originalDate||t,s=a.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Qu(s,":");case"zzzz":default:return"GMT"+Nn(s,":")}},t:function(t,e,i,r){var a=r._originalDate||t,s=Math.floor(a.getTime()/1e3);return _t(s,e.length)},T:function(t,e,i,r){var a=r._originalDate||t,s=a.getTime();return _t(s,e.length)}};function Qu(n,t){var e=n>0?"-":"+",i=Math.abs(n),r=Math.floor(i/60),a=i%60;if(a===0)return e+String(r);var s=t||"";return e+String(r)+s+_t(a,2)}function Ju(n,t){if(n%60===0){var e=n>0?"-":"+";return e+_t(Math.abs(n)/60,2)}return Nn(n,t)}function Nn(n,t){var e=t||"",i=n>0?"-":"+",r=Math.abs(n),a=_t(Math.floor(r/60),2),s=_t(r%60,2);return i+a+e+s}const vb=bb;var td=function(t,e){switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},ed=function(t,e){switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},xb=function(t,e){var i=t.match(/(P+)(p+)?/)||[],r=i[1],a=i[2];if(!a)return td(t,e);var s;switch(r){case"P":s=e.dateTime({width:"short"});break;case"PP":s=e.dateTime({width:"medium"});break;case"PPP":s=e.dateTime({width:"long"});break;case"PPPP":default:s=e.dateTime({width:"full"});break}return s.replace("{{date}}",td(r,e)).replace("{{time}}",ed(a,e))},wb={p:ed,P:xb};const Ms=wb;var _b=["D","DD"],Tb=["YY","YYYY"];function nd(n){return _b.indexOf(n)!==-1}function id(n){return Tb.indexOf(n)!==-1}function Xr(n,t,e){if(n==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var Db={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Sb=function(t,e,i){var r,a=Db[t];return typeof a=="string"?r=a:e===1?r=a.one:r=a.other.replace("{{count}}",e.toString()),i!=null&&i.addSuffix?i.comparison&&i.comparison>0?"in "+r:r+" ago":r};const Mb=Sb;function Cs(n){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=t.width?String(t.width):n.defaultWidth,i=n.formats[e]||n.formats[n.defaultWidth];return i}}var Cb={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},kb={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Ob={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Pb={date:Cs({formats:Cb,defaultWidth:"full"}),time:Cs({formats:kb,defaultWidth:"full"}),dateTime:Cs({formats:Ob,defaultWidth:"full"})};const Eb=Pb;var Ab={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Rb=function(t,e,i,r){return Ab[t]};const Lb=Rb;function Gi(n){return function(t,e){var i=e!=null&&e.context?String(e.context):"standalone",r;if(i==="formatting"&&n.formattingValues){var a=n.defaultFormattingWidth||n.defaultWidth,s=e!=null&&e.width?String(e.width):a;r=n.formattingValues[s]||n.formattingValues[a]}else{var o=n.defaultWidth,l=e!=null&&e.width?String(e.width):n.defaultWidth;r=n.values[l]||n.values[o]}var c=n.argumentCallback?n.argumentCallback(t):t;return r[c]}}var Ib={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Nb={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Fb={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Ub={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Bb={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Wb={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Yb=function(t,e){var i=Number(t),r=i%100;if(r>20||r<10)switch(r%10){case 1:return i+"st";case 2:return i+"nd";case 3:return i+"rd"}return i+"th"},zb={ordinalNumber:Yb,era:Gi({values:Ib,defaultWidth:"wide"}),quarter:Gi({values:Nb,defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:Gi({values:Fb,defaultWidth:"wide"}),day:Gi({values:Ub,defaultWidth:"wide"}),dayPeriod:Gi({values:Bb,defaultWidth:"wide",formattingValues:Wb,defaultFormattingWidth:"wide"})};const Hb=zb;function Ki(n){return function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=e.width,r=i&&n.matchPatterns[i]||n.matchPatterns[n.defaultMatchWidth],a=t.match(r);if(!a)return null;var s=a[0],o=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],l=Array.isArray(o)?jb(o,function(d){return d.test(s)}):$b(o,function(d){return d.test(s)}),c;c=n.valueCallback?n.valueCallback(l):l,c=e.valueCallback?e.valueCallback(c):c;var u=t.slice(s.length);return{value:c,rest:u}}}function $b(n,t){for(var e in n)if(n.hasOwnProperty(e)&&t(n[e]))return e}function jb(n,t){for(var e=0;e<n.length;e++)if(t(n[e]))return e}function Vb(n){return function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=t.match(n.matchPattern);if(!i)return null;var r=i[0],a=t.match(n.parsePattern);if(!a)return null;var s=n.valueCallback?n.valueCallback(a[0]):a[0];s=e.valueCallback?e.valueCallback(s):s;var o=t.slice(r.length);return{value:s,rest:o}}}var qb=/^(\d+)(th|st|nd|rd)?/i,Xb=/\d+/i,Gb={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Kb={any:[/^b/i,/^(a|c)/i]},Zb={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Qb={any:[/1/i,/2/i,/3/i,/4/i]},Jb={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},tv={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},ev={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},nv={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},iv={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},rv={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},av={ordinalNumber:Vb({matchPattern:qb,parsePattern:Xb,valueCallback:function(t){return parseInt(t,10)}}),era:Ki({matchPatterns:Gb,defaultMatchWidth:"wide",parsePatterns:Kb,defaultParseWidth:"any"}),quarter:Ki({matchPatterns:Zb,defaultMatchWidth:"wide",parsePatterns:Qb,defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:Ki({matchPatterns:Jb,defaultMatchWidth:"wide",parsePatterns:tv,defaultParseWidth:"any"}),day:Ki({matchPatterns:ev,defaultMatchWidth:"wide",parsePatterns:nv,defaultParseWidth:"any"}),dayPeriod:Ki({matchPatterns:iv,defaultMatchWidth:"any",parsePatterns:rv,defaultParseWidth:"any"})},sv={code:"en-US",formatDistance:Mb,formatLong:Eb,formatRelative:Lb,localize:Hb,match:av,options:{weekStartsOn:0,firstWeekContainsDate:1}};const rd=sv;var ov=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,lv=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,cv=/^'([^]*?)'?$/,uv=/''/g,dv=/[a-zA-Z]/;function fv(n,t,e){var i,r,a,s,o,l,c,u,d,f,g,p,m,y,v,x,w,_;G(2,arguments);var S=String(t),C=mn(),k=(i=(r=e==null?void 0:e.locale)!==null&&r!==void 0?r:C.locale)!==null&&i!==void 0?i:rd,T=At((a=(s=(o=(l=e==null?void 0:e.firstWeekContainsDate)!==null&&l!==void 0?l:e==null||(c=e.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&o!==void 0?o:C.firstWeekContainsDate)!==null&&s!==void 0?s:(d=C.locale)===null||d===void 0||(f=d.options)===null||f===void 0?void 0:f.firstWeekContainsDate)!==null&&a!==void 0?a:1);if(!(T>=1&&T<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var D=At((g=(p=(m=(y=e==null?void 0:e.weekStartsOn)!==null&&y!==void 0?y:e==null||(v=e.locale)===null||v===void 0||(x=v.options)===null||x===void 0?void 0:x.weekStartsOn)!==null&&m!==void 0?m:C.weekStartsOn)!==null&&p!==void 0?p:(w=C.locale)===null||w===void 0||(_=w.options)===null||_===void 0?void 0:_.weekStartsOn)!==null&&g!==void 0?g:0);if(!(D>=0&&D<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!k.localize)throw new RangeError("locale must contain localize property");if(!k.formatLong)throw new RangeError("locale must contain formatLong property");var O=J(n);if(!Ds(O))throw new RangeError("Invalid time value");var A=jr(O),R=Xu(O,A),W={firstWeekContainsDate:T,weekStartsOn:D,locale:k,_originalDate:O},V=S.match(lv).map(function(L){var H=L[0];if(H==="p"||H==="P"){var I=Ms[H];return I(L,k.formatLong)}return L}).join("").match(ov).map(function(L){if(L==="''")return"'";var H=L[0];if(H==="'")return hv(L);var I=vb[H];if(I)return!(e!=null&&e.useAdditionalWeekYearTokens)&&id(L)&&Xr(L,t,String(n)),!(e!=null&&e.useAdditionalDayOfYearTokens)&&nd(L)&&Xr(L,t,String(n)),I(R,L,k.localize,W);if(H.match(dv))throw new RangeError("Format string contains an unescaped latin alphabet character `"+H+"`");return L}).join("");return V}function hv(n){var t=n.match(cv);return t?t[1].replace(uv,"'"):n}function gv(n,t){if(n==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n}function ad(n,t){(t==null||t>n.length)&&(t=n.length);for(var e=0,i=new Array(t);e<t;e++)i[e]=n[e];return i}function pv(n,t){if(n){if(typeof n=="string")return ad(n,t);var e=Object.prototype.toString.call(n).slice(8,-1);if(e==="Object"&&n.constructor&&(e=n.constructor.name),e==="Map"||e==="Set")return Array.from(n);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return ad(n,t)}}function sd(n,t){var e=typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(!e){if(Array.isArray(n)||(e=pv(n))||t&&n&&typeof n.length=="number"){e&&(n=e);var i=0,r=function(){};return{s:r,n:function(){return i>=n.length?{done:!0}:{done:!1,value:n[i++]}},e:function(c){throw c},f:r}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
19
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,s=!1,o;return{s:function(){e=e.call(n)},n:function(){var c=e.next();return a=c.done,c},e:function(c){s=!0,o=c},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(s)throw o}}}}function q(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function ks(n,t){return ks=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,r){return i.__proto__=r,i},ks(n,t)}function pt(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),t&&ks(n,t)}function Gr(n){return Gr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Gr(n)}function mv(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function yv(n,t){if(t&&(Ge(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return q(n)}function mt(n){var t=mv();return function(){var i=Gr(n),r;if(t){var a=Gr(this).constructor;r=Reflect.construct(i,arguments,a)}else r=i.apply(this,arguments);return yv(this,r)}}function ft(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}function bv(n,t){if(Ge(n)!=="object"||n===null)return n;var e=n[Symbol.toPrimitive];if(e!==void 0){var i=e.call(n,t||"default");if(Ge(i)!=="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(n)}function od(n){var t=bv(n,"string");return Ge(t)==="symbol"?t:String(t)}function ld(n,t){for(var e=0;e<t.length;e++){var i=t[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,od(i.key),i)}}function ht(n,t,e){return t&&ld(n.prototype,t),e&&ld(n,e),Object.defineProperty(n,"prototype",{writable:!1}),n}function j(n,t,e){return t=od(t),t in n?Object.defineProperty(n,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[t]=e,n}var vv=10,cd=function(){function n(){ft(this,n),j(this,"priority",void 0),j(this,"subPriority",0)}return ht(n,[{key:"validate",value:function(e,i){return!0}}]),n}(),xv=function(n){pt(e,n);var t=mt(e);function e(i,r,a,s,o){var l;return ft(this,e),l=t.call(this),l.value=i,l.validateValue=r,l.setValue=a,l.priority=s,o&&(l.subPriority=o),l}return ht(e,[{key:"validate",value:function(r,a){return this.validateValue(r,this.value,a)}},{key:"set",value:function(r,a,s){return this.setValue(r,a,this.value,s)}}]),e}(cd),wv=function(n){pt(e,n);var t=mt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(q(i),"priority",vv),j(q(i),"subPriority",-1),i}return ht(e,[{key:"set",value:function(r,a){if(a.timestampIsSet)return r;var s=new Date(0);return s.setFullYear(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate()),s.setHours(r.getUTCHours(),r.getUTCMinutes(),r.getUTCSeconds(),r.getUTCMilliseconds()),s}}]),e}(cd),bt=function(){function n(){ft(this,n),j(this,"incompatibleTokens",void 0),j(this,"priority",void 0),j(this,"subPriority",void 0)}return ht(n,[{key:"run",value:function(e,i,r,a){var s=this.parse(e,i,r,a);return s?{setter:new xv(s.value,this.validate,this.set,this.priority,this.subPriority),rest:s.rest}:null}},{key:"validate",value:function(e,i,r){return!0}}]),n}(),_v=function(n){pt(e,n);var t=mt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(q(i),"priority",140),j(q(i),"incompatibleTokens",["R","u","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"G":case"GG":case"GGG":return s.era(r,{width:"abbreviated"})||s.era(r,{width:"narrow"});case"GGGGG":return s.era(r,{width:"narrow"});case"GGGG":default:return s.era(r,{width:"wide"})||s.era(r,{width:"abbreviated"})||s.era(r,{width:"narrow"})}}},{key:"set",value:function(r,a,s){return a.era=s,r.setUTCFullYear(s,0,1),r.setUTCHours(0,0,0,0),r}}]),e}(bt),jt={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},Fe={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function Vt(n,t){return n&&{value:t(n.value),rest:n.rest}}function Ut(n,t){var e=t.match(n);return e?{value:parseInt(e[0],10),rest:t.slice(e[0].length)}:null}function Ue(n,t){var e=t.match(n);if(!e)return null;if(e[0]==="Z")return{value:0,rest:t.slice(1)};var i=e[1]==="+"?1:-1,r=e[2]?parseInt(e[2],10):0,a=e[3]?parseInt(e[3],10):0,s=e[5]?parseInt(e[5],10):0;return{value:i*(r*qi+a*Vr+s*zy),rest:t.slice(e[0].length)}}function ud(n){return Ut(jt.anyDigitsSigned,n)}function $t(n,t){switch(n){case 1:return Ut(jt.singleDigit,t);case 2:return Ut(jt.twoDigits,t);case 3:return Ut(jt.threeDigits,t);case 4:return Ut(jt.fourDigits,t);default:return Ut(new RegExp("^\\d{1,"+n+"}"),t)}}function Kr(n,t){switch(n){case 1:return Ut(jt.singleDigitSigned,t);case 2:return Ut(jt.twoDigitsSigned,t);case 3:return Ut(jt.threeDigitsSigned,t);case 4:return Ut(jt.fourDigitsSigned,t);default:return Ut(new RegExp("^-?\\d{1,"+n+"}"),t)}}function Os(n){switch(n){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function dd(n,t){var e=t>0,i=e?t:1-t,r;if(i<=50)r=n||100;else{var a=i+50,s=Math.floor(a/100)*100,o=n>=a%100;r=n+s-(o?100:0)}return e?r:1-r}function fd(n){return n%400===0||n%4===0&&n%100!==0}var Tv=function(n){pt(e,n);var t=mt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(q(i),"priority",130),j(q(i),"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){var o=function(c){return{year:c,isTwoDigitYear:a==="yy"}};switch(a){case"y":return Vt($t(4,r),o);case"yo":return Vt(s.ordinalNumber(r,{unit:"year"}),o);default:return Vt($t(a.length,r),o)}}},{key:"validate",value:function(r,a){return a.isTwoDigitYear||a.year>0}},{key:"set",value:function(r,a,s){var o=r.getUTCFullYear();if(s.isTwoDigitYear){var l=dd(s.year,o);return r.setUTCFullYear(l,0,1),r.setUTCHours(0,0,0,0),r}var c=!("era"in a)||a.era===1?s.year:1-s.year;return r.setUTCFullYear(c,0,1),r.setUTCHours(0,0,0,0),r}}]),e}(bt),Dv=function(n){pt(e,n);var t=mt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(q(i),"priority",130),j(q(i),"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){var o=function(c){return{year:c,isTwoDigitYear:a==="YY"}};switch(a){case"Y":return Vt($t(4,r),o);case"Yo":return Vt(s.ordinalNumber(r,{unit:"year"}),o);default:return Vt($t(a.length,r),o)}}},{key:"validate",value:function(r,a){return a.isTwoDigitYear||a.year>0}},{key:"set",value:function(r,a,s,o){var l=Ss(r,o);if(s.isTwoDigitYear){var c=dd(s.year,l);return r.setUTCFullYear(c,0,o.firstWeekContainsDate),r.setUTCHours(0,0,0,0),In(r,o)}var u=!("era"in a)||a.era===1?s.year:1-s.year;return r.setUTCFullYear(u,0,o.firstWeekContainsDate),r.setUTCHours(0,0,0,0),In(r,o)}}]),e}(bt),Sv=function(n){pt(e,n);var t=mt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(q(i),"priority",130),j(q(i),"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a){return Kr(a==="R"?4:a.length,r)}},{key:"set",value:function(r,a,s){var o=new Date(0);return o.setUTCFullYear(s,0,4),o.setUTCHours(0,0,0,0),ei(o)}}]),e}(bt),Mv=function(n){pt(e,n);var t=mt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(q(i),"priority",130),j(q(i),"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a){return Kr(a==="u"?4:a.length,r)}},{key:"set",value:function(r,a,s){return r.setUTCFullYear(s,0,1),r.setUTCHours(0,0,0,0),r}}]),e}(bt),Cv=function(n){pt(e,n);var t=mt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(q(i),"priority",120),j(q(i),"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"Q":case"QQ":return $t(a.length,r);case"Qo":return s.ordinalNumber(r,{unit:"quarter"});case"QQQ":return s.quarter(r,{width:"abbreviated",context:"formatting"})||s.quarter(r,{width:"narrow",context:"formatting"});case"QQQQQ":return s.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return s.quarter(r,{width:"wide",context:"formatting"})||s.quarter(r,{width:"abbreviated",context:"formatting"})||s.quarter(r,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(r,a){return a>=1&&a<=4}},{key:"set",value:function(r,a,s){return r.setUTCMonth((s-1)*3,1),r.setUTCHours(0,0,0,0),r}}]),e}(bt),kv=function(n){pt(e,n);var t=mt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(q(i),"priority",120),j(q(i),"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"q":case"qq":return $t(a.length,r);case"qo":return s.ordinalNumber(r,{unit:"quarter"});case"qqq":return s.quarter(r,{width:"abbreviated",context:"standalone"})||s.quarter(r,{width:"narrow",context:"standalone"});case"qqqqq":return s.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return s.quarter(r,{width:"wide",context:"standalone"})||s.quarter(r,{width:"abbreviated",context:"standalone"})||s.quarter(r,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(r,a){return a>=1&&a<=4}},{key:"set",value:function(r,a,s){return r.setUTCMonth((s-1)*3,1),r.setUTCHours(0,0,0,0),r}}]),e}(bt),Ov=function(n){pt(e,n);var t=mt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(q(i),"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]),j(q(i),"priority",110),i}return ht(e,[{key:"parse",value:function(r,a,s){var o=function(c){return c-1};switch(a){case"M":return Vt(Ut(jt.month,r),o);case"MM":return Vt($t(2,r),o);case"Mo":return Vt(s.ordinalNumber(r,{unit:"month"}),o);case"MMM":return s.month(r,{width:"abbreviated",context:"formatting"})||s.month(r,{width:"narrow",context:"formatting"});case"MMMMM":return s.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return s.month(r,{width:"wide",context:"formatting"})||s.month(r,{width:"abbreviated",context:"formatting"})||s.month(r,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(r,a){return a>=0&&a<=11}},{key:"set",value:function(r,a,s){return r.setUTCMonth(s,1),r.setUTCHours(0,0,0,0),r}}]),e}(bt),Pv=function(n){pt(e,n);var t=mt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(q(i),"priority",110),j(q(i),"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){var o=function(c){return c-1};switch(a){case"L":return Vt(Ut(jt.month,r),o);case"LL":return Vt($t(2,r),o);case"Lo":return Vt(s.ordinalNumber(r,{unit:"month"}),o);case"LLL":return s.month(r,{width:"abbreviated",context:"standalone"})||s.month(r,{width:"narrow",context:"standalone"});case"LLLLL":return s.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return s.month(r,{width:"wide",context:"standalone"})||s.month(r,{width:"abbreviated",context:"standalone"})||s.month(r,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(r,a){return a>=0&&a<=11}},{key:"set",value:function(r,a,s){return r.setUTCMonth(s,1),r.setUTCHours(0,0,0,0),r}}]),e}(bt);function Ev(n,t,e){G(2,arguments);var i=J(n),r=At(t),a=Zu(i,e)-r;return i.setUTCDate(i.getUTCDate()-a*7),i}var Av=function(n){pt(e,n);var t=mt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(q(i),"priority",100),j(q(i),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"w":return Ut(jt.week,r);case"wo":return s.ordinalNumber(r,{unit:"week"});default:return $t(a.length,r)}}},{key:"validate",value:function(r,a){return a>=1&&a<=53}},{key:"set",value:function(r,a,s,o){return In(Ev(r,s,o),o)}}]),e}(bt);function Rv(n,t){G(2,arguments);var e=J(n),i=At(t),r=Ku(e)-i;return e.setUTCDate(e.getUTCDate()-r*7),e}var Lv=function(n){pt(e,n);var t=mt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(q(i),"priority",100),j(q(i),"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"I":return Ut(jt.week,r);case"Io":return s.ordinalNumber(r,{unit:"week"});default:return $t(a.length,r)}}},{key:"validate",value:function(r,a){return a>=1&&a<=53}},{key:"set",value:function(r,a,s){return ei(Rv(r,s))}}]),e}(bt),Iv=[31,28,31,30,31,30,31,31,30,31,30,31],Nv=[31,29,31,30,31,30,31,31,30,31,30,31],Fv=function(n){pt(e,n);var t=mt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(q(i),"priority",90),j(q(i),"subPriority",1),j(q(i),"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"d":return Ut(jt.date,r);case"do":return s.ordinalNumber(r,{unit:"date"});default:return $t(a.length,r)}}},{key:"validate",value:function(r,a){var s=r.getUTCFullYear(),o=fd(s),l=r.getUTCMonth();return o?a>=1&&a<=Nv[l]:a>=1&&a<=Iv[l]}},{key:"set",value:function(r,a,s){return r.setUTCDate(s),r.setUTCHours(0,0,0,0),r}}]),e}(bt),Uv=function(n){pt(e,n);var t=mt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(q(i),"priority",90),j(q(i),"subpriority",1),j(q(i),"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"D":case"DD":return Ut(jt.dayOfYear,r);case"Do":return s.ordinalNumber(r,{unit:"date"});default:return $t(a.length,r)}}},{key:"validate",value:function(r,a){var s=r.getUTCFullYear(),o=fd(s);return o?a>=1&&a<=366:a>=1&&a<=365}},{key:"set",value:function(r,a,s){return r.setUTCMonth(0,s),r.setUTCHours(0,0,0,0),r}}]),e}(bt);function Ps(n,t,e){var i,r,a,s,o,l,c,u;G(2,arguments);var d=mn(),f=At((i=(r=(a=(s=e==null?void 0:e.weekStartsOn)!==null&&s!==void 0?s:e==null||(o=e.locale)===null||o===void 0||(l=o.options)===null||l===void 0?void 0:l.weekStartsOn)!==null&&a!==void 0?a:d.weekStartsOn)!==null&&r!==void 0?r:(c=d.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&i!==void 0?i:0);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var g=J(n),p=At(t),m=g.getUTCDay(),y=p%7,v=(y+7)%7,x=(v<f?7:0)+p-m;return g.setUTCDate(g.getUTCDate()+x),g}var Bv=function(n){pt(e,n);var t=mt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(q(i),"priority",90),j(q(i),"incompatibleTokens",["D","i","e","c","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"E":case"EE":case"EEE":return s.day(r,{width:"abbreviated",context:"formatting"})||s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"});case"EEEEE":return s.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"});case"EEEE":default:return s.day(r,{width:"wide",context:"formatting"})||s.day(r,{width:"abbreviated",context:"formatting"})||s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(r,a){return a>=0&&a<=6}},{key:"set",value:function(r,a,s,o){return r=Ps(r,s,o),r.setUTCHours(0,0,0,0),r}}]),e}(bt),Wv=function(n){pt(e,n);var t=mt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(q(i),"priority",90),j(q(i),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s,o){var l=function(u){var d=Math.floor((u-1)/7)*7;return(u+o.weekStartsOn+6)%7+d};switch(a){case"e":case"ee":return Vt($t(a.length,r),l);case"eo":return Vt(s.ordinalNumber(r,{unit:"day"}),l);case"eee":return s.day(r,{width:"abbreviated",context:"formatting"})||s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"});case"eeeee":return s.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"});case"eeee":default:return s.day(r,{width:"wide",context:"formatting"})||s.day(r,{width:"abbreviated",context:"formatting"})||s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(r,a){return a>=0&&a<=6}},{key:"set",value:function(r,a,s,o){return r=Ps(r,s,o),r.setUTCHours(0,0,0,0),r}}]),e}(bt),Yv=function(n){pt(e,n);var t=mt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(q(i),"priority",90),j(q(i),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s,o){var l=function(u){var d=Math.floor((u-1)/7)*7;return(u+o.weekStartsOn+6)%7+d};switch(a){case"c":case"cc":return Vt($t(a.length,r),l);case"co":return Vt(s.ordinalNumber(r,{unit:"day"}),l);case"ccc":return s.day(r,{width:"abbreviated",context:"standalone"})||s.day(r,{width:"short",context:"standalone"})||s.day(r,{width:"narrow",context:"standalone"});case"ccccc":return s.day(r,{width:"narrow",context:"standalone"});case"cccccc":return s.day(r,{width:"short",context:"standalone"})||s.day(r,{width:"narrow",context:"standalone"});case"cccc":default:return s.day(r,{width:"wide",context:"standalone"})||s.day(r,{width:"abbreviated",context:"standalone"})||s.day(r,{width:"short",context:"standalone"})||s.day(r,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(r,a){return a>=0&&a<=6}},{key:"set",value:function(r,a,s,o){return r=Ps(r,s,o),r.setUTCHours(0,0,0,0),r}}]),e}(bt);function zv(n,t){G(2,arguments);var e=At(t);e%7===0&&(e=e-7);var i=1,r=J(n),a=r.getUTCDay(),s=e%7,o=(s+7)%7,l=(o<i?7:0)+e-a;return r.setUTCDate(r.getUTCDate()+l),r}var Hv=function(n){pt(e,n);var t=mt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(q(i),"priority",90),j(q(i),"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){var o=function(c){return c===0?7:c};switch(a){case"i":case"ii":return $t(a.length,r);case"io":return s.ordinalNumber(r,{unit:"day"});case"iii":return Vt(s.day(r,{width:"abbreviated",context:"formatting"})||s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"}),o);case"iiiii":return Vt(s.day(r,{width:"narrow",context:"formatting"}),o);case"iiiiii":return Vt(s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"}),o);case"iiii":default:return Vt(s.day(r,{width:"wide",context:"formatting"})||s.day(r,{width:"abbreviated",context:"formatting"})||s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"}),o)}}},{key:"validate",value:function(r,a){return a>=1&&a<=7}},{key:"set",value:function(r,a,s){return r=zv(r,s),r.setUTCHours(0,0,0,0),r}}]),e}(bt),$v=function(n){pt(e,n);var t=mt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(q(i),"priority",80),j(q(i),"incompatibleTokens",["b","B","H","k","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"a":case"aa":case"aaa":return s.dayPeriod(r,{width:"abbreviated",context:"formatting"})||s.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaaa":return s.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return s.dayPeriod(r,{width:"wide",context:"formatting"})||s.dayPeriod(r,{width:"abbreviated",context:"formatting"})||s.dayPeriod(r,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(r,a,s){return r.setUTCHours(Os(s),0,0,0),r}}]),e}(bt),jv=function(n){pt(e,n);var t=mt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(q(i),"priority",80),j(q(i),"incompatibleTokens",["a","B","H","k","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"b":case"bb":case"bbb":return s.dayPeriod(r,{width:"abbreviated",context:"formatting"})||s.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbbb":return s.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return s.dayPeriod(r,{width:"wide",context:"formatting"})||s.dayPeriod(r,{width:"abbreviated",context:"formatting"})||s.dayPeriod(r,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(r,a,s){return r.setUTCHours(Os(s),0,0,0),r}}]),e}(bt),Vv=function(n){pt(e,n);var t=mt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(q(i),"priority",80),j(q(i),"incompatibleTokens",["a","b","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"B":case"BB":case"BBB":return s.dayPeriod(r,{width:"abbreviated",context:"formatting"})||s.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBBB":return s.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return s.dayPeriod(r,{width:"wide",context:"formatting"})||s.dayPeriod(r,{width:"abbreviated",context:"formatting"})||s.dayPeriod(r,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(r,a,s){return r.setUTCHours(Os(s),0,0,0),r}}]),e}(bt),qv=function(n){pt(e,n);var t=mt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(q(i),"priority",70),j(q(i),"incompatibleTokens",["H","K","k","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"h":return Ut(jt.hour12h,r);case"ho":return s.ordinalNumber(r,{unit:"hour"});default:return $t(a.length,r)}}},{key:"validate",value:function(r,a){return a>=1&&a<=12}},{key:"set",value:function(r,a,s){var o=r.getUTCHours()>=12;return o&&s<12?r.setUTCHours(s+12,0,0,0):!o&&s===12?r.setUTCHours(0,0,0,0):r.setUTCHours(s,0,0,0),r}}]),e}(bt),Xv=function(n){pt(e,n);var t=mt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(q(i),"priority",70),j(q(i),"incompatibleTokens",["a","b","h","K","k","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"H":return Ut(jt.hour23h,r);case"Ho":return s.ordinalNumber(r,{unit:"hour"});default:return $t(a.length,r)}}},{key:"validate",value:function(r,a){return a>=0&&a<=23}},{key:"set",value:function(r,a,s){return r.setUTCHours(s,0,0,0),r}}]),e}(bt),Gv=function(n){pt(e,n);var t=mt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(q(i),"priority",70),j(q(i),"incompatibleTokens",["h","H","k","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"K":return Ut(jt.hour11h,r);case"Ko":return s.ordinalNumber(r,{unit:"hour"});default:return $t(a.length,r)}}},{key:"validate",value:function(r,a){return a>=0&&a<=11}},{key:"set",value:function(r,a,s){var o=r.getUTCHours()>=12;return o&&s<12?r.setUTCHours(s+12,0,0,0):r.setUTCHours(s,0,0,0),r}}]),e}(bt),Kv=function(n){pt(e,n);var t=mt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(q(i),"priority",70),j(q(i),"incompatibleTokens",["a","b","h","H","K","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"k":return Ut(jt.hour24h,r);case"ko":return s.ordinalNumber(r,{unit:"hour"});default:return $t(a.length,r)}}},{key:"validate",value:function(r,a){return a>=1&&a<=24}},{key:"set",value:function(r,a,s){var o=s<=24?s%24:s;return r.setUTCHours(o,0,0,0),r}}]),e}(bt),Zv=function(n){pt(e,n);var t=mt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(q(i),"priority",60),j(q(i),"incompatibleTokens",["t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"m":return Ut(jt.minute,r);case"mo":return s.ordinalNumber(r,{unit:"minute"});default:return $t(a.length,r)}}},{key:"validate",value:function(r,a){return a>=0&&a<=59}},{key:"set",value:function(r,a,s){return r.setUTCMinutes(s,0,0),r}}]),e}(bt),Qv=function(n){pt(e,n);var t=mt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(q(i),"priority",50),j(q(i),"incompatibleTokens",["t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"s":return Ut(jt.second,r);case"so":return s.ordinalNumber(r,{unit:"second"});default:return $t(a.length,r)}}},{key:"validate",value:function(r,a){return a>=0&&a<=59}},{key:"set",value:function(r,a,s){return r.setUTCSeconds(s,0),r}}]),e}(bt),Jv=function(n){pt(e,n);var t=mt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(q(i),"priority",30),j(q(i),"incompatibleTokens",["t","T"]),i}return ht(e,[{key:"parse",value:function(r,a){var s=function(l){return Math.floor(l*Math.pow(10,-a.length+3))};return Vt($t(a.length,r),s)}},{key:"set",value:function(r,a,s){return r.setUTCMilliseconds(s),r}}]),e}(bt),tx=function(n){pt(e,n);var t=mt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(q(i),"priority",10),j(q(i),"incompatibleTokens",["t","T","x"]),i}return ht(e,[{key:"parse",value:function(r,a){switch(a){case"X":return Ue(Fe.basicOptionalMinutes,r);case"XX":return Ue(Fe.basic,r);case"XXXX":return Ue(Fe.basicOptionalSeconds,r);case"XXXXX":return Ue(Fe.extendedOptionalSeconds,r);case"XXX":default:return Ue(Fe.extended,r)}}},{key:"set",value:function(r,a,s){return a.timestampIsSet?r:new Date(r.getTime()-s)}}]),e}(bt),ex=function(n){pt(e,n);var t=mt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(q(i),"priority",10),j(q(i),"incompatibleTokens",["t","T","X"]),i}return ht(e,[{key:"parse",value:function(r,a){switch(a){case"x":return Ue(Fe.basicOptionalMinutes,r);case"xx":return Ue(Fe.basic,r);case"xxxx":return Ue(Fe.basicOptionalSeconds,r);case"xxxxx":return Ue(Fe.extendedOptionalSeconds,r);case"xxx":default:return Ue(Fe.extended,r)}}},{key:"set",value:function(r,a,s){return a.timestampIsSet?r:new Date(r.getTime()-s)}}]),e}(bt),nx=function(n){pt(e,n);var t=mt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(q(i),"priority",40),j(q(i),"incompatibleTokens","*"),i}return ht(e,[{key:"parse",value:function(r){return ud(r)}},{key:"set",value:function(r,a,s){return[new Date(s*1e3),{timestampIsSet:!0}]}}]),e}(bt),ix=function(n){pt(e,n);var t=mt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(q(i),"priority",20),j(q(i),"incompatibleTokens","*"),i}return ht(e,[{key:"parse",value:function(r){return ud(r)}},{key:"set",value:function(r,a,s){return[new Date(s),{timestampIsSet:!0}]}}]),e}(bt),rx={G:new _v,y:new Tv,Y:new Dv,R:new Sv,u:new Mv,Q:new Cv,q:new kv,M:new Ov,L:new Pv,w:new Av,I:new Lv,d:new Fv,D:new Uv,E:new Bv,e:new Wv,c:new Yv,i:new Hv,a:new $v,b:new jv,B:new Vv,h:new qv,H:new Xv,K:new Gv,k:new Kv,m:new Zv,s:new Qv,S:new Jv,X:new tx,x:new ex,t:new nx,T:new ix},ax=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,sx=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ox=/^'([^]*?)'?$/,lx=/''/g,cx=/\S/,ux=/[a-zA-Z]/;function dx(n,t,e,i){var r,a,s,o,l,c,u,d,f,g,p,m,y,v,x,w,_,S;G(3,arguments);var C=String(n),k=String(t),T=mn(),D=(r=(a=i==null?void 0:i.locale)!==null&&a!==void 0?a:T.locale)!==null&&r!==void 0?r:rd;if(!D.match)throw new RangeError("locale must contain match property");var O=At((s=(o=(l=(c=i==null?void 0:i.firstWeekContainsDate)!==null&&c!==void 0?c:i==null||(u=i.locale)===null||u===void 0||(d=u.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&l!==void 0?l:T.firstWeekContainsDate)!==null&&o!==void 0?o:(f=T.locale)===null||f===void 0||(g=f.options)===null||g===void 0?void 0:g.firstWeekContainsDate)!==null&&s!==void 0?s:1);if(!(O>=1&&O<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var A=At((p=(m=(y=(v=i==null?void 0:i.weekStartsOn)!==null&&v!==void 0?v:i==null||(x=i.locale)===null||x===void 0||(w=x.options)===null||w===void 0?void 0:w.weekStartsOn)!==null&&y!==void 0?y:T.weekStartsOn)!==null&&m!==void 0?m:(_=T.locale)===null||_===void 0||(S=_.options)===null||S===void 0?void 0:S.weekStartsOn)!==null&&p!==void 0?p:0);if(!(A>=0&&A<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(k==="")return C===""?J(e):new Date(NaN);var R={firstWeekContainsDate:O,weekStartsOn:A,locale:D},W=[new wv],V=k.match(sx).map(function(B){var N=B[0];if(N in Ms){var tt=Ms[N];return tt(B,D.formatLong)}return B}).join("").match(ax),L=[],H=sd(V),I;try{var et=function(){var N=I.value;!(i!=null&&i.useAdditionalWeekYearTokens)&&id(N)&&Xr(N,k,n),!(i!=null&&i.useAdditionalDayOfYearTokens)&&nd(N)&&Xr(N,k,n);var tt=N[0],rt=rx[tt];if(rt){var Ct=rt.incompatibleTokens;if(Array.isArray(Ct)){var gt=L.find(function(Tt){return Ct.includes(Tt.token)||Tt.token===tt});if(gt)throw new RangeError("The format string mustn't contain `".concat(gt.fullToken,"` and `").concat(N,"` at the same time"))}else if(rt.incompatibleTokens==="*"&&L.length>0)throw new RangeError("The format string mustn't contain `".concat(N,"` and any other token at the same time"));L.push({token:tt,fullToken:N});var It=rt.run(C,N,D.match,R);if(!It)return{v:new Date(NaN)};W.push(It.setter),C=It.rest}else{if(tt.match(ux))throw new RangeError("Format string contains an unescaped latin alphabet character `"+tt+"`");if(N==="''"?N="'":tt==="'"&&(N=fx(N)),C.indexOf(N)===0)C=C.slice(N.length);else return{v:new Date(NaN)}}};for(H.s();!(I=H.n()).done;){var z=et();if(Ge(z)==="object")return z.v}}catch(B){H.e(B)}finally{H.f()}if(C.length>0&&cx.test(C))return new Date(NaN);var Mt=W.map(function(B){return B.priority}).sort(function(B,N){return N-B}).filter(function(B,N,tt){return tt.indexOf(B)===N}).map(function(B){return W.filter(function(N){return N.priority===B}).sort(function(N,tt){return tt.subPriority-N.subPriority})}).map(function(B){return B[0]}),F=J(e);if(isNaN(F.getTime()))return new Date(NaN);var E=Xu(F,jr(F)),$={},K=sd(Mt),X;try{for(K.s();!(X=K.n()).done;){var Q=X.value;if(!Q.validate(E,R))return new Date(NaN);var at=Q.set(E,$,R);Array.isArray(at)?(E=at[0],gv($,at[1])):E=at}}catch(B){K.e(B)}finally{K.f()}return E}function fx(n){return n.match(ox)[1].replace(lx,"'")}function hx(n){G(1,arguments);var t=J(n);return t.setMinutes(0,0,0),t}function gx(n){G(1,arguments);var t=J(n);return t.setMilliseconds(0),t}function px(n){G(1,arguments);var t=n/qi;return Math.floor(t)}function hd(n,t){var e;G(1,arguments);var i=At((e=t==null?void 0:t.additionalDigits)!==null&&e!==void 0?e:2);if(i!==2&&i!==1&&i!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(!(typeof n=="string"||Object.prototype.toString.call(n)==="[object String]"))return new Date(NaN);var r=vx(n),a;if(r.date){var s=xx(r.date,i);a=wx(s.restDateString,s.year)}if(!a||isNaN(a.getTime()))return new Date(NaN);var o=a.getTime(),l=0,c;if(r.time&&(l=_x(r.time),isNaN(l)))return new Date(NaN);if(r.timezone){if(c=Tx(r.timezone),isNaN(c))return new Date(NaN)}else{var u=new Date(o+l),d=new Date(0);return d.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),d.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),d}return new Date(o+l+c)}var Zr={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},mx=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,yx=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,bx=/^([+-])(\d{2})(?::?(\d{2}))?$/;function vx(n){var t={},e=n.split(Zr.dateTimeDelimiter),i;if(e.length>2)return t;if(/:/.test(e[0])?i=e[0]:(t.date=e[0],i=e[1],Zr.timeZoneDelimiter.test(t.date)&&(t.date=n.split(Zr.timeZoneDelimiter)[0],i=n.substr(t.date.length,n.length))),i){var r=Zr.timezone.exec(i);r?(t.time=i.replace(r[1],""),t.timezone=r[1]):t.time=i}return t}function xx(n,t){var e=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),i=n.match(e);if(!i)return{year:NaN,restDateString:""};var r=i[1]?parseInt(i[1]):null,a=i[2]?parseInt(i[2]):null;return{year:a===null?r:a*100,restDateString:n.slice((i[1]||i[2]).length)}}function wx(n,t){if(t===null)return new Date(NaN);var e=n.match(mx);if(!e)return new Date(NaN);var i=!!e[4],r=Zi(e[1]),a=Zi(e[2])-1,s=Zi(e[3]),o=Zi(e[4]),l=Zi(e[5])-1;if(i)return kx(t,o,l)?Dx(t,o,l):new Date(NaN);var c=new Date(0);return!Mx(t,a,s)||!Cx(t,r)?new Date(NaN):(c.setUTCFullYear(t,a,Math.max(r,s)),c)}function Zi(n){return n?parseInt(n):1}function _x(n){var t=n.match(yx);if(!t)return NaN;var e=Es(t[1]),i=Es(t[2]),r=Es(t[3]);return Ox(e,i,r)?e*qi+i*Vr+r*1e3:NaN}function Es(n){return n&&parseFloat(n.replace(",","."))||0}function Tx(n){if(n==="Z")return 0;var t=n.match(bx);if(!t)return 0;var e=t[1]==="+"?-1:1,i=parseInt(t[2]),r=t[3]&&parseInt(t[3])||0;return Px(i,r)?e*(i*qi+r*Vr):NaN}function Dx(n,t,e){var i=new Date(0);i.setUTCFullYear(n,0,4);var r=i.getUTCDay()||7,a=(t-1)*7+e+1-r;return i.setUTCDate(i.getUTCDate()+a),i}var Sx=[31,null,31,30,31,30,31,31,30,31,30,31];function gd(n){return n%400===0||n%4===0&&n%100!==0}function Mx(n,t,e){return t>=0&&t<=11&&e>=1&&e<=(Sx[t]||(gd(n)?29:28))}function Cx(n,t){return t>=1&&t<=(gd(n)?366:365)}function kx(n,t,e){return t>=1&&t<=53&&e>=0&&e<=6}function Ox(n,t,e){return n===24?t===0&&e===0:e>=0&&e<60&&t>=0&&t<60&&n>=0&&n<25}function Px(n,t){return t>=0&&t<=59}function Ex(n){G(1,arguments);var t=n/Hy;return Math.floor(t)}var ee=(n=>(n.DOUGHNUT="Doughnut",n.HORIZONTAL_BAR="HorizontalBar",n.VERTICAL_BAR="VerticalBar",n.TIMESERIES_LINE="Line",n.TIMESERIES_BAR="TimeSeriesBar",n))(ee||{}),Qr=(n=>(n.GAUGE="Gauge",n.TOPN="TopN",n))(Qr||{}),Bt=(n=>(n.Hidden="hidden",n.Right="right",n.Bottom="bottom",n))(Bt||{}),ii=(n=>(n.Hidden="hidden",n.SingleMetric="single",n.Full="full",n))(ii||{});const As=(n,t)=>{var r,a;const{tooltip:e}=t;if(e.opacity===0&&!n.locked){n.showTooltip=!1;return}const i=n.chartTooltipSortFn||((s,o)=>o.rawValue-s.rawValue);if(e.body&&!n.locked){const s=e.labelColors,o=((a=(r=t.chart.config)==null?void 0:r.options)==null?void 0:a.indexAxis)==="y"?"x":"y",l=[ee.HORIZONTAL_BAR,ee.VERTICAL_BAR].includes(n.chartType),c=[Qr.GAUGE,ee.DOUGHNUT].includes(n.chartType);n.tooltipContext=l?e.dataPoints.length>1?e.dataPoints[0].label:"":e.dataPoints[0].parsed.x,n.tooltipSeries=e.dataPoints.map((u,d)=>{const f=c?u.parsed:u.parsed[o];let g;if(n.units==="bytes")g=isNaN(f)?f:ws(f);else{const m=n.translateUnit(n.units,f);g=`${f%1===0?ta.format(f):ta.format(Number(f.toFixed(Nd)))} ${m}`}const p=l&&u.dataset.label!==u.label?u.dataset.label:c?u.dataset.labels[u.dataIndex]:u.dataset.label;return{backgroundColor:s[d].backgroundColor,borderColor:s[d].borderColor,label:p,value:g,rawValue:f}}).sort(i),n.left=`${e.x}px`,n.top=`${e.y}px`,n.showTooltip=!0}},Ax=n=>n&&n.datasets&&n.datasets.length,Rx=n=>Ax(n)&&n.datasets.some(t=>t.data.length),Lx=n=>Rx(n)&&n.datasets.some(t=>t.data.length>1),Ix=n=>Lx(n)&&n.datasets.some(t=>t.data[0]&&Ds(t.data[0].x)),Nx=n=>Ix(n)&&n.datasets.some(t=>t.data[0]&&t.data[0].x.toString().length>=13),Rs=(n,t,e)=>{const r=Math.min(t/1150,1),a=.15,s=1.15;return n.x<e?n.x+t*a*(1-r):n.x-t*s*(1-r)},Fx=(n,t,e)=>n.y<e?n.y+t*.15:n.y-t*.5;var ge=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Fn(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Ls={exports:{}},pd={exports:{}};(function(n){function t(e){return e&&e.__esModule?e:{default:e}}n.exports=t,n.exports.__esModule=!0,n.exports.default=n.exports})(pd);var Wt=pd.exports,Is={exports:{}},Ns={exports:{}},md={exports:{}};(function(n){function t(e){"@babel/helpers - typeof";return n.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},n.exports.__esModule=!0,n.exports.default=n.exports,t(e)}n.exports=t,n.exports.__esModule=!0,n.exports.default=n.exports})(md);var yd=md.exports,Fs={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(i,r){if(r.length<i)throw new TypeError(i+" argument"+(i>1?"s":"")+" required, but only "+r.length+" present")}n.exports=t.default})(Fs,Fs.exports);var ae=Fs.exports;(function(n,t){var e=Wt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var i=e(yd),r=e(ae);function a(s){return(0,r.default)(1,arguments),s instanceof Date||(0,i.default)(s)==="object"&&Object.prototype.toString.call(s)==="[object Date]"}n.exports=t.default})(Ns,Ns.exports);var Ux=Ns.exports,Us={exports:{}};(function(n,t){var e=Wt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var i=e(yd),r=e(ae);function a(s){(0,r.default)(1,arguments);var o=Object.prototype.toString.call(s);return s instanceof Date||(0,i.default)(s)==="object"&&o==="[object Date]"?new Date(s.getTime()):typeof s=="number"||o==="[object Number]"?new Date(s):((typeof s=="string"||o==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}n.exports=t.default})(Us,Us.exports);var Be=Us.exports;(function(n,t){var e=Wt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var i=e(Ux),r=e(Be),a=e(ae);function s(o){if((0,a.default)(1,arguments),!(0,i.default)(o)&&typeof o!="number")return!1;var l=(0,r.default)(o);return!isNaN(Number(l))}n.exports=t.default})(Is,Is.exports);var Bx=Is.exports,Bs={exports:{}},Ws={exports:{}},Ys={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(i){if(i===null||i===!0||i===!1)return NaN;var r=Number(i);return isNaN(r)?r:r<0?Math.ceil(r):Math.floor(r)}n.exports=t.default})(Ys,Ys.exports);var Un=Ys.exports;const Wx=Fn(Un);(function(n,t){var e=Wt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var i=e(Un),r=e(Be),a=e(ae);function s(o,l){(0,a.default)(2,arguments);var c=(0,r.default)(o).getTime(),u=(0,i.default)(l);return new Date(c+u)}n.exports=t.default})(Ws,Ws.exports);var Yx=Ws.exports;(function(n,t){var e=Wt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var i=e(Yx),r=e(ae),a=e(Un);function s(o,l){(0,r.default)(2,arguments);var c=(0,a.default)(l);return(0,i.default)(o,-c)}n.exports=t.default})(Bs,Bs.exports);var zx=Bs.exports,zs={exports:{}},Hs={exports:{}};(function(n,t){var e=Wt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var i=e(Be),r=e(ae),a=864e5;function s(o){(0,r.default)(1,arguments);var l=(0,i.default)(o),c=l.getTime();l.setUTCMonth(0,1),l.setUTCHours(0,0,0,0);var u=l.getTime(),d=c-u;return Math.floor(d/a)+1}n.exports=t.default})(Hs,Hs.exports);var Hx=Hs.exports,$s={exports:{}},js={exports:{}};(function(n,t){var e=Wt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var i=e(Be),r=e(ae);function a(s){(0,r.default)(1,arguments);var o=1,l=(0,i.default)(s),c=l.getUTCDay(),u=(c<o?7:0)+c-o;return l.setUTCDate(l.getUTCDate()-u),l.setUTCHours(0,0,0,0),l}n.exports=t.default})(js,js.exports);var Vs=js.exports,qs={exports:{}},Xs={exports:{}};(function(n,t){var e=Wt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var i=e(Be),r=e(ae),a=e(Vs);function s(o){(0,r.default)(1,arguments);var l=(0,i.default)(o),c=l.getUTCFullYear(),u=new Date(0);u.setUTCFullYear(c+1,0,4),u.setUTCHours(0,0,0,0);var d=(0,a.default)(u),f=new Date(0);f.setUTCFullYear(c,0,4),f.setUTCHours(0,0,0,0);var g=(0,a.default)(f);return l.getTime()>=d.getTime()?c+1:l.getTime()>=g.getTime()?c:c-1}n.exports=t.default})(Xs,Xs.exports);var bd=Xs.exports;(function(n,t){var e=Wt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var i=e(bd),r=e(Vs),a=e(ae);function s(o){(0,a.default)(1,arguments);var l=(0,i.default)(o),c=new Date(0);c.setUTCFullYear(l,0,4),c.setUTCHours(0,0,0,0);var u=(0,r.default)(c);return u}n.exports=t.default})(qs,qs.exports);var $x=qs.exports;(function(n,t){var e=Wt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var i=e(Be),r=e(Vs),a=e($x),s=e(ae),o=6048e5;function l(c){(0,s.default)(1,arguments);var u=(0,i.default)(c),d=(0,r.default)(u).getTime()-(0,a.default)(u).getTime();return Math.round(d/o)+1}n.exports=t.default})($s,$s.exports);var jx=$s.exports,Gs={exports:{}},Ks={exports:{}},Bn={};Object.defineProperty(Bn,"__esModule",{value:!0}),Bn.getDefaultOptions=Vx,Bn.setDefaultOptions=qx;var vd={};function Vx(){return vd}function qx(n){vd=n}(function(n,t){var e=Wt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var i=e(Be),r=e(ae),a=e(Un),s=Bn;function o(l,c){var u,d,f,g,p,m,y,v;(0,r.default)(1,arguments);var x=(0,s.getDefaultOptions)(),w=(0,a.default)((u=(d=(f=(g=c==null?void 0:c.weekStartsOn)!==null&&g!==void 0?g:c==null||(p=c.locale)===null||p===void 0||(m=p.options)===null||m===void 0?void 0:m.weekStartsOn)!==null&&f!==void 0?f:x.weekStartsOn)!==null&&d!==void 0?d:(y=x.locale)===null||y===void 0||(v=y.options)===null||v===void 0?void 0:v.weekStartsOn)!==null&&u!==void 0?u:0);if(!(w>=0&&w<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var _=(0,i.default)(l),S=_.getUTCDay(),C=(S<w?7:0)+S-w;return _.setUTCDate(_.getUTCDate()-C),_.setUTCHours(0,0,0,0),_}n.exports=t.default})(Ks,Ks.exports);var Zs=Ks.exports,Qs={exports:{}},Js={exports:{}};(function(n,t){var e=Wt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var i=e(Be),r=e(ae),a=e(Zs),s=e(Un),o=Bn;function l(c,u){var d,f,g,p,m,y,v,x;(0,r.default)(1,arguments);var w=(0,i.default)(c),_=w.getUTCFullYear(),S=(0,o.getDefaultOptions)(),C=(0,s.default)((d=(f=(g=(p=u==null?void 0:u.firstWeekContainsDate)!==null&&p!==void 0?p:u==null||(m=u.locale)===null||m===void 0||(y=m.options)===null||y===void 0?void 0:y.firstWeekContainsDate)!==null&&g!==void 0?g:S.firstWeekContainsDate)!==null&&f!==void 0?f:(v=S.locale)===null||v===void 0||(x=v.options)===null||x===void 0?void 0:x.firstWeekContainsDate)!==null&&d!==void 0?d:1);if(!(C>=1&&C<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var k=new Date(0);k.setUTCFullYear(_+1,0,C),k.setUTCHours(0,0,0,0);var T=(0,a.default)(k,u),D=new Date(0);D.setUTCFullYear(_,0,C),D.setUTCHours(0,0,0,0);var O=(0,a.default)(D,u);return w.getTime()>=T.getTime()?_+1:w.getTime()>=O.getTime()?_:_-1}n.exports=t.default})(Js,Js.exports);var xd=Js.exports;(function(n,t){var e=Wt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var i=e(xd),r=e(ae),a=e(Zs),s=e(Un),o=Bn;function l(c,u){var d,f,g,p,m,y,v,x;(0,r.default)(1,arguments);var w=(0,o.getDefaultOptions)(),_=(0,s.default)((d=(f=(g=(p=u==null?void 0:u.firstWeekContainsDate)!==null&&p!==void 0?p:u==null||(m=u.locale)===null||m===void 0||(y=m.options)===null||y===void 0?void 0:y.firstWeekContainsDate)!==null&&g!==void 0?g:w.firstWeekContainsDate)!==null&&f!==void 0?f:(v=w.locale)===null||v===void 0||(x=v.options)===null||x===void 0?void 0:x.firstWeekContainsDate)!==null&&d!==void 0?d:1),S=(0,i.default)(c,u),C=new Date(0);C.setUTCFullYear(S,0,_),C.setUTCHours(0,0,0,0);var k=(0,a.default)(C,u);return k}n.exports=t.default})(Qs,Qs.exports);var Xx=Qs.exports;(function(n,t){var e=Wt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var i=e(Be),r=e(Zs),a=e(Xx),s=e(ae),o=6048e5;function l(c,u){(0,s.default)(1,arguments);var d=(0,i.default)(c),f=(0,r.default)(d,u).getTime()-(0,a.default)(d,u).getTime();return Math.round(f/o)+1}n.exports=t.default})(Gs,Gs.exports);var Gx=Gs.exports,to={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(i,r){for(var a=i<0?"-":"",s=Math.abs(i).toString();s.length<r;)s="0"+s;return a+s}n.exports=t.default})(to,to.exports);var wd=to.exports,eo={exports:{}};(function(n,t){var e=Wt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=e(wd),r={y:function(o,l){var c=o.getUTCFullYear(),u=c>0?c:1-c;return(0,i.default)(l==="yy"?u%100:u,l.length)},M:function(o,l){var c=o.getUTCMonth();return l==="M"?String(c+1):(0,i.default)(c+1,2)},d:function(o,l){return(0,i.default)(o.getUTCDate(),l.length)},a:function(o,l){var c=o.getUTCHours()/12>=1?"pm":"am";switch(l){case"a":case"aa":return c.toUpperCase();case"aaa":return c;case"aaaaa":return c[0];case"aaaa":default:return c==="am"?"a.m.":"p.m."}},h:function(o,l){return(0,i.default)(o.getUTCHours()%12||12,l.length)},H:function(o,l){return(0,i.default)(o.getUTCHours(),l.length)},m:function(o,l){return(0,i.default)(o.getUTCMinutes(),l.length)},s:function(o,l){return(0,i.default)(o.getUTCSeconds(),l.length)},S:function(o,l){var c=l.length,u=o.getUTCMilliseconds(),d=Math.floor(u*Math.pow(10,c-3));return(0,i.default)(d,l.length)}},a=r;t.default=a,n.exports=t.default})(eo,eo.exports);var Kx=eo.exports;(function(n,t){var e=Wt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=e(Hx),r=e(jx),a=e(bd),s=e(Gx),o=e(xd),l=e(wd),c=e(Kx),u={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},d={G:function(v,x,w){var _=v.getUTCFullYear()>0?1:0;switch(x){case"G":case"GG":case"GGG":return w.era(_,{width:"abbreviated"});case"GGGGG":return w.era(_,{width:"narrow"});case"GGGG":default:return w.era(_,{width:"wide"})}},y:function(v,x,w){if(x==="yo"){var _=v.getUTCFullYear(),S=_>0?_:1-_;return w.ordinalNumber(S,{unit:"year"})}return c.default.y(v,x)},Y:function(v,x,w,_){var S=(0,o.default)(v,_),C=S>0?S:1-S;if(x==="YY"){var k=C%100;return(0,l.default)(k,2)}return x==="Yo"?w.ordinalNumber(C,{unit:"year"}):(0,l.default)(C,x.length)},R:function(v,x){var w=(0,a.default)(v);return(0,l.default)(w,x.length)},u:function(v,x){var w=v.getUTCFullYear();return(0,l.default)(w,x.length)},Q:function(v,x,w){var _=Math.ceil((v.getUTCMonth()+1)/3);switch(x){case"Q":return String(_);case"QQ":return(0,l.default)(_,2);case"Qo":return w.ordinalNumber(_,{unit:"quarter"});case"QQQ":return w.quarter(_,{width:"abbreviated",context:"formatting"});case"QQQQQ":return w.quarter(_,{width:"narrow",context:"formatting"});case"QQQQ":default:return w.quarter(_,{width:"wide",context:"formatting"})}},q:function(v,x,w){var _=Math.ceil((v.getUTCMonth()+1)/3);switch(x){case"q":return String(_);case"qq":return(0,l.default)(_,2);case"qo":return w.ordinalNumber(_,{unit:"quarter"});case"qqq":return w.quarter(_,{width:"abbreviated",context:"standalone"});case"qqqqq":return w.quarter(_,{width:"narrow",context:"standalone"});case"qqqq":default:return w.quarter(_,{width:"wide",context:"standalone"})}},M:function(v,x,w){var _=v.getUTCMonth();switch(x){case"M":case"MM":return c.default.M(v,x);case"Mo":return w.ordinalNumber(_+1,{unit:"month"});case"MMM":return w.month(_,{width:"abbreviated",context:"formatting"});case"MMMMM":return w.month(_,{width:"narrow",context:"formatting"});case"MMMM":default:return w.month(_,{width:"wide",context:"formatting"})}},L:function(v,x,w){var _=v.getUTCMonth();switch(x){case"L":return String(_+1);case"LL":return(0,l.default)(_+1,2);case"Lo":return w.ordinalNumber(_+1,{unit:"month"});case"LLL":return w.month(_,{width:"abbreviated",context:"standalone"});case"LLLLL":return w.month(_,{width:"narrow",context:"standalone"});case"LLLL":default:return w.month(_,{width:"wide",context:"standalone"})}},w:function(v,x,w,_){var S=(0,s.default)(v,_);return x==="wo"?w.ordinalNumber(S,{unit:"week"}):(0,l.default)(S,x.length)},I:function(v,x,w){var _=(0,r.default)(v);return x==="Io"?w.ordinalNumber(_,{unit:"week"}):(0,l.default)(_,x.length)},d:function(v,x,w){return x==="do"?w.ordinalNumber(v.getUTCDate(),{unit:"date"}):c.default.d(v,x)},D:function(v,x,w){var _=(0,i.default)(v);return x==="Do"?w.ordinalNumber(_,{unit:"dayOfYear"}):(0,l.default)(_,x.length)},E:function(v,x,w){var _=v.getUTCDay();switch(x){case"E":case"EE":case"EEE":return w.day(_,{width:"abbreviated",context:"formatting"});case"EEEEE":return w.day(_,{width:"narrow",context:"formatting"});case"EEEEEE":return w.day(_,{width:"short",context:"formatting"});case"EEEE":default:return w.day(_,{width:"wide",context:"formatting"})}},e:function(v,x,w,_){var S=v.getUTCDay(),C=(S-_.weekStartsOn+8)%7||7;switch(x){case"e":return String(C);case"ee":return(0,l.default)(C,2);case"eo":return w.ordinalNumber(C,{unit:"day"});case"eee":return w.day(S,{width:"abbreviated",context:"formatting"});case"eeeee":return w.day(S,{width:"narrow",context:"formatting"});case"eeeeee":return w.day(S,{width:"short",context:"formatting"});case"eeee":default:return w.day(S,{width:"wide",context:"formatting"})}},c:function(v,x,w,_){var S=v.getUTCDay(),C=(S-_.weekStartsOn+8)%7||7;switch(x){case"c":return String(C);case"cc":return(0,l.default)(C,x.length);case"co":return w.ordinalNumber(C,{unit:"day"});case"ccc":return w.day(S,{width:"abbreviated",context:"standalone"});case"ccccc":return w.day(S,{width:"narrow",context:"standalone"});case"cccccc":return w.day(S,{width:"short",context:"standalone"});case"cccc":default:return w.day(S,{width:"wide",context:"standalone"})}},i:function(v,x,w){var _=v.getUTCDay(),S=_===0?7:_;switch(x){case"i":return String(S);case"ii":return(0,l.default)(S,x.length);case"io":return w.ordinalNumber(S,{unit:"day"});case"iii":return w.day(_,{width:"abbreviated",context:"formatting"});case"iiiii":return w.day(_,{width:"narrow",context:"formatting"});case"iiiiii":return w.day(_,{width:"short",context:"formatting"});case"iiii":default:return w.day(_,{width:"wide",context:"formatting"})}},a:function(v,x,w){var _=v.getUTCHours(),S=_/12>=1?"pm":"am";switch(x){case"a":case"aa":return w.dayPeriod(S,{width:"abbreviated",context:"formatting"});case"aaa":return w.dayPeriod(S,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return w.dayPeriod(S,{width:"narrow",context:"formatting"});case"aaaa":default:return w.dayPeriod(S,{width:"wide",context:"formatting"})}},b:function(v,x,w){var _=v.getUTCHours(),S;switch(_===12?S=u.noon:_===0?S=u.midnight:S=_/12>=1?"pm":"am",x){case"b":case"bb":return w.dayPeriod(S,{width:"abbreviated",context:"formatting"});case"bbb":return w.dayPeriod(S,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return w.dayPeriod(S,{width:"narrow",context:"formatting"});case"bbbb":default:return w.dayPeriod(S,{width:"wide",context:"formatting"})}},B:function(v,x,w){var _=v.getUTCHours(),S;switch(_>=17?S=u.evening:_>=12?S=u.afternoon:_>=4?S=u.morning:S=u.night,x){case"B":case"BB":case"BBB":return w.dayPeriod(S,{width:"abbreviated",context:"formatting"});case"BBBBB":return w.dayPeriod(S,{width:"narrow",context:"formatting"});case"BBBB":default:return w.dayPeriod(S,{width:"wide",context:"formatting"})}},h:function(v,x,w){if(x==="ho"){var _=v.getUTCHours()%12;return _===0&&(_=12),w.ordinalNumber(_,{unit:"hour"})}return c.default.h(v,x)},H:function(v,x,w){return x==="Ho"?w.ordinalNumber(v.getUTCHours(),{unit:"hour"}):c.default.H(v,x)},K:function(v,x,w){var _=v.getUTCHours()%12;return x==="Ko"?w.ordinalNumber(_,{unit:"hour"}):(0,l.default)(_,x.length)},k:function(v,x,w){var _=v.getUTCHours();return _===0&&(_=24),x==="ko"?w.ordinalNumber(_,{unit:"hour"}):(0,l.default)(_,x.length)},m:function(v,x,w){return x==="mo"?w.ordinalNumber(v.getUTCMinutes(),{unit:"minute"}):c.default.m(v,x)},s:function(v,x,w){return x==="so"?w.ordinalNumber(v.getUTCSeconds(),{unit:"second"}):c.default.s(v,x)},S:function(v,x){return c.default.S(v,x)},X:function(v,x,w,_){var S=_._originalDate||v,C=S.getTimezoneOffset();if(C===0)return"Z";switch(x){case"X":return g(C);case"XXXX":case"XX":return p(C);case"XXXXX":case"XXX":default:return p(C,":")}},x:function(v,x,w,_){var S=_._originalDate||v,C=S.getTimezoneOffset();switch(x){case"x":return g(C);case"xxxx":case"xx":return p(C);case"xxxxx":case"xxx":default:return p(C,":")}},O:function(v,x,w,_){var S=_._originalDate||v,C=S.getTimezoneOffset();switch(x){case"O":case"OO":case"OOO":return"GMT"+f(C,":");case"OOOO":default:return"GMT"+p(C,":")}},z:function(v,x,w,_){var S=_._originalDate||v,C=S.getTimezoneOffset();switch(x){case"z":case"zz":case"zzz":return"GMT"+f(C,":");case"zzzz":default:return"GMT"+p(C,":")}},t:function(v,x,w,_){var S=_._originalDate||v,C=Math.floor(S.getTime()/1e3);return(0,l.default)(C,x.length)},T:function(v,x,w,_){var S=_._originalDate||v,C=S.getTime();return(0,l.default)(C,x.length)}};function f(y,v){var x=y>0?"-":"+",w=Math.abs(y),_=Math.floor(w/60),S=w%60;if(S===0)return x+String(_);var C=v||"";return x+String(_)+C+(0,l.default)(S,2)}function g(y,v){if(y%60===0){var x=y>0?"-":"+";return x+(0,l.default)(Math.abs(y)/60,2)}return p(y,v)}function p(y,v){var x=v||"",w=y>0?"-":"+",_=Math.abs(y),S=(0,l.default)(Math.floor(_/60),2),C=(0,l.default)(_%60,2);return w+S+x+C}var m=d;t.default=m,n.exports=t.default})(zs,zs.exports);var Zx=zs.exports,no={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=function(l,c){switch(l){case"P":return c.date({width:"short"});case"PP":return c.date({width:"medium"});case"PPP":return c.date({width:"long"});case"PPPP":default:return c.date({width:"full"})}},i=function(l,c){switch(l){case"p":return c.time({width:"short"});case"pp":return c.time({width:"medium"});case"ppp":return c.time({width:"long"});case"pppp":default:return c.time({width:"full"})}},r=function(l,c){var u=l.match(/(P+)(p+)?/)||[],d=u[1],f=u[2];if(!f)return e(l,c);var g;switch(d){case"P":g=c.dateTime({width:"short"});break;case"PP":g=c.dateTime({width:"medium"});break;case"PPP":g=c.dateTime({width:"long"});break;case"PPPP":default:g=c.dateTime({width:"full"});break}return g.replace("{{date}}",e(d,c)).replace("{{time}}",i(f,c))},a={p:i,P:r},s=a;t.default=s,n.exports=t.default})(no,no.exports);var Qx=no.exports,io={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(i){var r=new Date(Date.UTC(i.getFullYear(),i.getMonth(),i.getDate(),i.getHours(),i.getMinutes(),i.getSeconds(),i.getMilliseconds()));return r.setUTCFullYear(i.getFullYear()),i.getTime()-r.getTime()}n.exports=t.default})(io,io.exports);var _d=io.exports;const Td=Fn(_d);var Qi={};Object.defineProperty(Qi,"__esModule",{value:!0}),Qi.isProtectedDayOfYearToken=ew,Qi.isProtectedWeekYearToken=nw,Qi.throwProtectedError=iw;var Jx=["D","DD"],tw=["YY","YYYY"];function ew(n){return Jx.indexOf(n)!==-1}function nw(n){return tw.indexOf(n)!==-1}function iw(n,t,e){if(n==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var ro={exports:{}},ao={exports:{}},so={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},i=function(s,o,l){var c,u=e[s];return typeof u=="string"?c=u:o===1?c=u.one:c=u.other.replace("{{count}}",o.toString()),l!=null&&l.addSuffix?l.comparison&&l.comparison>0?"in "+c:c+" ago":c},r=i;t.default=r,n.exports=t.default})(so,so.exports);var rw=so.exports,oo={exports:{}},lo={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(i){return function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=r.width?String(r.width):i.defaultWidth,s=i.formats[a]||i.formats[i.defaultWidth];return s}}n.exports=t.default})(lo,lo.exports);var aw=lo.exports;(function(n,t){var e=Wt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=e(aw),r={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},a={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},s={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},o={date:(0,i.default)({formats:r,defaultWidth:"full"}),time:(0,i.default)({formats:a,defaultWidth:"full"}),dateTime:(0,i.default)({formats:s,defaultWidth:"full"})},l=o;t.default=l,n.exports=t.default})(oo,oo.exports);var sw=oo.exports,co={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},i=function(s,o,l,c){return e[s]},r=i;t.default=r,n.exports=t.default})(co,co.exports);var ow=co.exports,uo={exports:{}},fo={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(i){return function(r,a){var s=a!=null&&a.context?String(a.context):"standalone",o;if(s==="formatting"&&i.formattingValues){var l=i.defaultFormattingWidth||i.defaultWidth,c=a!=null&&a.width?String(a.width):l;o=i.formattingValues[c]||i.formattingValues[l]}else{var u=i.defaultWidth,d=a!=null&&a.width?String(a.width):i.defaultWidth;o=i.values[d]||i.values[u]}var f=i.argumentCallback?i.argumentCallback(r):r;return o[f]}}n.exports=t.default})(fo,fo.exports);var lw=fo.exports;(function(n,t){var e=Wt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=e(lw),r={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},a={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},s={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},o={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},l={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},c={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},u=function(p,m){var y=Number(p),v=y%100;if(v>20||v<10)switch(v%10){case 1:return y+"st";case 2:return y+"nd";case 3:return y+"rd"}return y+"th"},d={ordinalNumber:u,era:(0,i.default)({values:r,defaultWidth:"wide"}),quarter:(0,i.default)({values:a,defaultWidth:"wide",argumentCallback:function(p){return p-1}}),month:(0,i.default)({values:s,defaultWidth:"wide"}),day:(0,i.default)({values:o,defaultWidth:"wide"}),dayPeriod:(0,i.default)({values:l,defaultWidth:"wide",formattingValues:c,defaultFormattingWidth:"wide"})},f=d;t.default=f,n.exports=t.default})(uo,uo.exports);var cw=uo.exports,ho={exports:{}},go={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(a){return function(s){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=o.width,c=l&&a.matchPatterns[l]||a.matchPatterns[a.defaultMatchWidth],u=s.match(c);if(!u)return null;var d=u[0],f=l&&a.parsePatterns[l]||a.parsePatterns[a.defaultParseWidth],g=Array.isArray(f)?r(f,function(y){return y.test(d)}):i(f,function(y){return y.test(d)}),p;p=a.valueCallback?a.valueCallback(g):g,p=o.valueCallback?o.valueCallback(p):p;var m=s.slice(d.length);return{value:p,rest:m}}}function i(a,s){for(var o in a)if(a.hasOwnProperty(o)&&s(a[o]))return o}function r(a,s){for(var o=0;o<a.length;o++)if(s(a[o]))return o}n.exports=t.default})(go,go.exports);var uw=go.exports,po={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(i){return function(r){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=r.match(i.matchPattern);if(!s)return null;var o=s[0],l=r.match(i.parsePattern);if(!l)return null;var c=i.valueCallback?i.valueCallback(l[0]):l[0];c=a.valueCallback?a.valueCallback(c):c;var u=r.slice(o.length);return{value:c,rest:u}}}n.exports=t.default})(po,po.exports);var dw=po.exports;(function(n,t){var e=Wt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=e(uw),r=e(dw),a=/^(\d+)(th|st|nd|rd)?/i,s=/\d+/i,o={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},l={any:[/^b/i,/^(a|c)/i]},c={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},u={any:[/1/i,/2/i,/3/i,/4/i]},d={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},f={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},g={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},p={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},m={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},y={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},v={ordinalNumber:(0,r.default)({matchPattern:a,parsePattern:s,valueCallback:function(_){return parseInt(_,10)}}),era:(0,i.default)({matchPatterns:o,defaultMatchWidth:"wide",parsePatterns:l,defaultParseWidth:"any"}),quarter:(0,i.default)({matchPatterns:c,defaultMatchWidth:"wide",parsePatterns:u,defaultParseWidth:"any",valueCallback:function(_){return _+1}}),month:(0,i.default)({matchPatterns:d,defaultMatchWidth:"wide",parsePatterns:f,defaultParseWidth:"any"}),day:(0,i.default)({matchPatterns:g,defaultMatchWidth:"wide",parsePatterns:p,defaultParseWidth:"any"}),dayPeriod:(0,i.default)({matchPatterns:m,defaultMatchWidth:"any",parsePatterns:y,defaultParseWidth:"any"})},x=v;t.default=x,n.exports=t.default})(ho,ho.exports);var fw=ho.exports;(function(n,t){var e=Wt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=e(rw),r=e(sw),a=e(ow),s=e(cw),o=e(fw),l={code:"en-US",formatDistance:i.default,formatLong:r.default,formatRelative:a.default,localize:s.default,match:o.default,options:{weekStartsOn:0,firstWeekContainsDate:1}},c=l;t.default=c,n.exports=t.default})(ao,ao.exports);var hw=ao.exports;(function(n,t){var e=Wt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=e(hw),r=i.default;t.default=r,n.exports=t.default})(ro,ro.exports);var gw=ro.exports;(function(n,t){var e=Wt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=w;var i=e(Bx),r=e(zx),a=e(Be),s=e(Zx),o=e(Qx),l=e(_d),c=Qi,u=e(Un),d=e(ae),f=Bn,g=e(gw),p=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,m=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,y=/^'([^]*?)'?$/,v=/''/g,x=/[a-zA-Z]/;function w(S,C,k){var T,D,O,A,R,W,V,L,H,I,et,z,Mt,F,E,$,K,X;(0,d.default)(2,arguments);var Q=String(C),at=(0,f.getDefaultOptions)(),B=(T=(D=k==null?void 0:k.locale)!==null&&D!==void 0?D:at.locale)!==null&&T!==void 0?T:g.default,N=(0,u.default)((O=(A=(R=(W=k==null?void 0:k.firstWeekContainsDate)!==null&&W!==void 0?W:k==null||(V=k.locale)===null||V===void 0||(L=V.options)===null||L===void 0?void 0:L.firstWeekContainsDate)!==null&&R!==void 0?R:at.firstWeekContainsDate)!==null&&A!==void 0?A:(H=at.locale)===null||H===void 0||(I=H.options)===null||I===void 0?void 0:I.firstWeekContainsDate)!==null&&O!==void 0?O:1);if(!(N>=1&&N<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var tt=(0,u.default)((et=(z=(Mt=(F=k==null?void 0:k.weekStartsOn)!==null&&F!==void 0?F:k==null||(E=k.locale)===null||E===void 0||($=E.options)===null||$===void 0?void 0:$.weekStartsOn)!==null&&Mt!==void 0?Mt:at.weekStartsOn)!==null&&z!==void 0?z:(K=at.locale)===null||K===void 0||(X=K.options)===null||X===void 0?void 0:X.weekStartsOn)!==null&&et!==void 0?et:0);if(!(tt>=0&&tt<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!B.localize)throw new RangeError("locale must contain localize property");if(!B.formatLong)throw new RangeError("locale must contain formatLong property");var rt=(0,a.default)(S);if(!(0,i.default)(rt))throw new RangeError("Invalid time value");var Ct=(0,l.default)(rt),gt=(0,r.default)(rt,Ct),It={firstWeekContainsDate:N,weekStartsOn:tt,locale:B,_originalDate:rt},Tt=Q.match(m).map(function(lt){var zt=lt[0];if(zt==="p"||zt==="P"){var Gt=o.default[zt];return Gt(lt,B.formatLong)}return lt}).join("").match(p).map(function(lt){if(lt==="''")return"'";var zt=lt[0];if(zt==="'")return _(lt);var Gt=s.default[zt];if(Gt)return!(k!=null&&k.useAdditionalWeekYearTokens)&&(0,c.isProtectedWeekYearToken)(lt)&&(0,c.throwProtectedError)(lt,C,String(S)),!(k!=null&&k.useAdditionalDayOfYearTokens)&&(0,c.isProtectedDayOfYearToken)(lt)&&(0,c.throwProtectedError)(lt,C,String(S)),Gt(gt,lt,B.localize,It);if(zt.match(x))throw new RangeError("Format string contains an unescaped latin alphabet character `"+zt+"`");return lt}).join("");return Tt}function _(S){var C=S.match(y);return C?C[1].replace(v,"'"):S}n.exports=t.default})(Ls,Ls.exports);var pw=Ls.exports;const mw=Fn(pw);function Dd(n,t,e){var i=vw(n,e.timeZone,e.locale);return i.formatToParts?yw(i,t):bw(i,t)}function yw(n,t){for(var e=n.formatToParts(t),i=e.length-1;i>=0;--i)if(e[i].type==="timeZoneName")return e[i].value}function bw(n,t){var e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function vw(n,t,e){if(e&&!e.code)throw new Error("date-fns-tz error: Please set a language code on the locale object imported from date-fns, e.g. `locale.code = 'en-US'`");return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function xw(n,t){var e=Dw(t);return e.formatToParts?_w(e,n):Tw(e,n)}var ww={year:0,month:1,day:2,hour:3,minute:4,second:5};function _w(n,t){try{for(var e=n.formatToParts(t),i=[],r=0;r<e.length;r++){var a=ww[e[r].type];a>=0&&(i[a]=parseInt(e[r].value,10))}return i}catch(s){if(s instanceof RangeError)return[NaN];throw s}}function Tw(n,t){var e=n.format(t).replace(/\u200E/g,""),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(e);return[i[3],i[1],i[2],i[4],i[5],i[6]]}var mo={};function Dw(n){if(!mo[n]){var t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:"America/New_York",year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),e=t==="06/25/2014, 00:00:00"||t==="06/25/2014 00:00:00";mo[n]=e?new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}return mo[n]}function Sd(n,t,e,i,r,a,s){var o=new Date(0);return o.setUTCFullYear(n,t,e),o.setUTCHours(i,r,a,s),o}var Md=36e5,Sw=6e4,yo={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-]\d{2}):?(\d{2})$/};function bo(n,t,e){var i,r;if(!n||(i=yo.timezoneZ.exec(n),i))return 0;var a;if(i=yo.timezoneHH.exec(n),i)return a=parseInt(i[1],10),Cd(a)?-(a*Md):NaN;if(i=yo.timezoneHHMM.exec(n),i){a=parseInt(i[1],10);var s=parseInt(i[2],10);return Cd(a,s)?(r=Math.abs(a)*Md+s*Sw,a>0?-r:r):NaN}if(kw(n)){t=new Date(t||Date.now());var o=e?t:Mw(t),l=vo(o,n),c=e?l:Cw(t,l,n);return-c}return NaN}function Mw(n){return Sd(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function vo(n,t){var e=xw(n,t),i=Sd(e[0],e[1]-1,e[2],e[3]%24,e[4],e[5],0).getTime(),r=n.getTime(),a=r%1e3;return r-=a>=0?a:1e3+a,i-r}function Cw(n,t,e){var i=n.getTime(),r=i-t,a=vo(new Date(r),e);if(t===a)return t;r-=a-t;var s=vo(new Date(r),e);return a===s?a:Math.max(a,s)}function Cd(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}var kd={};function kw(n){if(kd[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),kd[n]=!0,!0}catch{return!1}}var Ow=60*1e3,Pw={X:function(n,t,e,i){var r=xo(i.timeZone,i._originalDate||n);if(r===0)return"Z";switch(t){case"X":return Od(r);case"XXXX":case"XX":return ri(r);case"XXXXX":case"XXX":default:return ri(r,":")}},x:function(n,t,e,i){var r=xo(i.timeZone,i._originalDate||n);switch(t){case"x":return Od(r);case"xxxx":case"xx":return ri(r);case"xxxxx":case"xxx":default:return ri(r,":")}},O:function(n,t,e,i){var r=xo(i.timeZone,i._originalDate||n);switch(t){case"O":case"OO":case"OOO":return"GMT"+Ew(r,":");case"OOOO":default:return"GMT"+ri(r,":")}},z:function(n,t,e,i){var r=i._originalDate||n;switch(t){case"z":case"zz":case"zzz":return Dd("short",r,i);case"zzzz":default:return Dd("long",r,i)}}};function xo(n,t){var e=n?bo(n,t,!0)/Ow:t.getTimezoneOffset();if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function Jr(n,t){for(var e=n<0?"-":"",i=Math.abs(n).toString();i.length<t;)i="0"+i;return e+i}function ri(n,t){var e=t||"",i=n>0?"-":"+",r=Math.abs(n),a=Jr(Math.floor(r/60),2),s=Jr(Math.floor(r%60),2);return i+a+e+s}function Od(n,t){if(n%60===0){var e=n>0?"-":"+";return e+Jr(Math.abs(n)/60,2)}return ri(n,t)}function Ew(n,t){var e=n>0?"-":"+",i=Math.abs(n),r=Math.floor(i/60),a=i%60;if(a===0)return e+String(r);var s=t||"";return e+String(r)+s+Jr(a,2)}const Aw=Pw;var Rw=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,wo=36e5,Pd=6e4,Lw=2,se={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,plainTime:/:/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:Rw};function Ed(n,t){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(n===null)return new Date(NaN);var e=t||{},i=e.additionalDigits==null?Lw:Wx(e.additionalDigits);if(i!==2&&i!==1&&i!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]")return new Date(n.getTime());if(typeof n=="number"||Object.prototype.toString.call(n)==="[object Number]")return new Date(n);if(!(typeof n=="string"||Object.prototype.toString.call(n)==="[object String]"))return new Date(NaN);var r=Iw(n),a=Nw(r.date,i),s=a.year,o=a.restDateString,l=Fw(o,s);if(isNaN(l))return new Date(NaN);if(l){var c=l.getTime(),u=0,d;if(r.time&&(u=Uw(r.time),isNaN(u)))return new Date(NaN);if(r.timeZone||e.timeZone){if(d=bo(r.timeZone||e.timeZone,new Date(c+u)),isNaN(d))return new Date(NaN)}else d=Td(new Date(c+u)),d=Td(new Date(c+u+d));return new Date(c+u+d)}else return new Date(NaN)}function Iw(n){var t={},e=se.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=se.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){var r=se.timeZone.exec(i);r?(t.time=i.replace(r[1],""),t.timeZone=r[1].trim()):t.time=i}return t}function Nw(n,t){var e=se.YYY[t],i=se.YYYYY[t],r;if(r=se.YYYY.exec(n)||i.exec(n),r){var a=r[1];return{year:parseInt(a,10),restDateString:n.slice(a.length)}}if(r=se.YY.exec(n)||e.exec(n),r){var s=r[1];return{year:parseInt(s,10)*100,restDateString:n.slice(s.length)}}return{year:null}}function Fw(n,t){if(t===null)return null;var e,i,r,a;if(n.length===0)return i=new Date(0),i.setUTCFullYear(t),i;if(e=se.MM.exec(n),e)return i=new Date(0),r=parseInt(e[1],10)-1,Ld(t,r)?(i.setUTCFullYear(t,r),i):new Date(NaN);if(e=se.DDD.exec(n),e){i=new Date(0);var s=parseInt(e[1],10);return Yw(t,s)?(i.setUTCFullYear(t,0,s),i):new Date(NaN)}if(e=se.MMDD.exec(n),e){i=new Date(0),r=parseInt(e[1],10)-1;var o=parseInt(e[2],10);return Ld(t,r,o)?(i.setUTCFullYear(t,r,o),i):new Date(NaN)}if(e=se.Www.exec(n),e)return a=parseInt(e[1],10)-1,Id(t,a)?Ad(t,a):new Date(NaN);if(e=se.WwwD.exec(n),e){a=parseInt(e[1],10)-1;var l=parseInt(e[2],10)-1;return Id(t,a,l)?Ad(t,a,l):new Date(NaN)}return null}function Uw(n){var t,e,i;if(t=se.HH.exec(n),t)return e=parseFloat(t[1].replace(",",".")),_o(e)?e%24*wo:NaN;if(t=se.HHMM.exec(n),t)return e=parseInt(t[1],10),i=parseFloat(t[2].replace(",",".")),_o(e,i)?e%24*wo+i*Pd:NaN;if(t=se.HHMMSS.exec(n),t){e=parseInt(t[1],10),i=parseInt(t[2],10);var r=parseFloat(t[3].replace(",","."));return _o(e,i,r)?e%24*wo+i*Pd+r*1e3:NaN}return null}function Ad(n,t,e){t=t||0,e=e||0;var i=new Date(0);i.setUTCFullYear(n,0,4);var r=i.getUTCDay()||7,a=t*7+e+1-r;return i.setUTCDate(i.getUTCDate()+a),i}var Bw=[31,28,31,30,31,30,31,31,30,31,30,31],Ww=[31,29,31,30,31,30,31,31,30,31,30,31];function Rd(n){return n%400===0||n%4===0&&n%100!==0}function Ld(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;var i=Rd(n);if(i&&e>Ww[t]||!i&&e>Bw[t])return!1}return!0}function Yw(n,t){if(t<1)return!1;var e=Rd(n);return!(e&&t>366||!e&&t>365)}function Id(n,t,e){return!(t<0||t>52||e!=null&&(e<0||e>6))}function _o(n,t,e){return!(n!=null&&(n<0||n>=25)||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}var zw=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function To(n,t,e){var i=String(t),r=e||{},a=i.match(zw);if(a){var s=Ed(n,r);i=a.reduce(function(o,l){if(l[0]==="'")return o;var c=o.indexOf(l),u=o[c-1]==="'",d=o.replace(l,"'"+Aw[l[0]](s,l,null,r)+"'");return u?d.substring(0,c-1)+d.substring(c+1):d},i)}return mw(n,i,r)}var Do={exports:{}},So={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(i,r){if(i==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(i[a]=r[a]);return i}n.exports=t.default})(So,So.exports);var Hw=So.exports;(function(n,t){var e=Wt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var i=e(Hw);function r(a){return(0,i.default)({},a)}n.exports=t.default})(Do,Do.exports);var $w=Do.exports;const jw=Fn($w);function Vw(n,t,e){var i=Ed(n,e),r=bo(t,i,!0),a=new Date(i.getTime()-r),s=new Date(0);return s.setFullYear(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate()),s.setHours(a.getUTCHours(),a.getUTCMinutes(),a.getUTCSeconds(),a.getUTCMilliseconds()),s}function qw(n,t,e,i){var r=jw(i);return r.timeZone=t,To(Vw(n,t),e,r)}const Nd=2,Fd=10,Ud=12,ta=new Intl.NumberFormat(((uh=document==null?void 0:document.documentElement)==null?void 0:uh.lang)||"en-US");function ea(n,t={}){if(!n)return n;const e=t.tz||Intl.DateTimeFormat().resolvedOptions().timeZone;try{let i="MMM dd, YYY hh:mm a";t.short&&(i="MMM dd, YYY"),t.includeTZ&&(i+=" (z)");const r=new Date(n);return qw(r,e,i)}catch{return console.error("Invalid value passed to formatTime",n),"(invalid date)"}}const na=10,De=["#a86cd5","#6a86d2","#00bbf9","#00c4b0","#ffdf15"],ai=(n,t)=>(t||De)[n%De.length],Ji=(n,t)=>{n[0]==="#"&&(n=n.slice(1));let e=parseInt(n.substring(0,2),16),i=parseInt(n.substring(2,4),16),r=parseInt(n.substring(4,6),16);e=e-t,i=i-t,r=r-t,e>255?e=255:e<0&&(e=0),i>255?i=255:i<0&&(i=0),r>255?r=255:r<0&&(r=0);const a=e.toString(16).length===1?"0"+e.toString(16):e.toString(16),s=i.toString(16).length===1?"0"+i.toString(16):i.toString(16),o=r.toString(16).length===1?"0"+r.toString(16):r.toString(16);return`#${a}${s}${o}`},Bd="#6f7787",Xw={lineTension:.4,borderWidth:2,pointBorderWidth:1.2,borderJoinStyle:"round",fill:!0},Mo=new Map,Co=(n,t)=>t==="bytes"?ws(n):t==="count/minute"?n.toFixed(2):ta.format(n),Wd=n=>{const e=document.createElement("canvas").getContext("2d"),i=Et({});return e.font=i.string,e.measureText(n).width},Gw=()=>{const n="label_height";if(!Mo.has(n)){const t=Et({});Mo.set(n,t.lineHeight)}return Mo.get(n)},Kw=n=>n.datasets.reduce((t,e)=>t+e.data.reduce((i,r)=>isNaN(r)?i:i+r,0),0),Yd=(n,t)=>t.datasets.reduce((e,i,r)=>n.isDatasetVisible(r)?e+i.data.reduce((a,s)=>isNaN(s)?a:a+s,0):e,0),zd=(n,t)=>t===0?" (0.0%)":` (${(n/t*100).toFixed(1)}%)`;function Zw(n){const t={enabled:!1,position:"barChartTooltipPosition",callbacks:{label:r=>({label:r.dataset.label,value:r.label})}};Yr.positioners.barChartTooltipPosition=function(r,a){if(!r.length)return!1;const s=this.chart.canvas.getBoundingClientRect(),o=n.tooltipState.width||this.width,l=s.width/2,c=Rs(a,o,l),u=a.y,d=a.x<l?"left":"center";return{x:c-n.tooltipState.offset,y:u,xAlign:d}},is.modes.customInteractionMode=function(r,a){const s=fn(a,r),o=[];return is.evaluateInteractionItems(r,r.options.indexAxis||"x",s,(l,c,u)=>{r.options.indexAxis==="y"&&l.inYRange(s.y,!0)&&r.data.datasets[c].data[u]&&o.push({element:l,datasetIndex:c,index:u}),r.options.indexAxis==="x"&&l.inXRange(s.x,!0)&&r.data.datasets[c].data[u]&&o.push({element:l,datasetIndex:c,index:u})}),o};const e=n.numLabels.value>25?Fd:Ud;return h.computed(()=>{var r,a,s,o,l,c,u,d;return{indexAxis:n.indexAxis,skipNull:!0,scales:{x:{border:{display:!1},stacked:n.stacked.value,grid:{display:!1,drawBorder:!1},ticks:{maxRotation:90,autoSkip:!1,font:e,callback:function(f,g){const p=this;if(p.chart.options.indexAxis===p.axis){f=p.getLabelForValue(g);const m=10;return f&&f.length>m?f.slice(0,m)+"...":f}return p.getLabelForValue(Number(f))}},title:{display:n.indexAxis==="y"?!it((r=n.metricAxesTitle)==null?void 0:r.value):!it((a=n.dimensionAxesTitle)==null?void 0:a.value),text:n.indexAxis==="y"?(s=n.metricAxesTitle)==null?void 0:s.value:(o=n.dimensionAxesTitle)==null?void 0:o.value,padding:{top:20},font:{weight:"bold"}}},y:{border:{display:!1},stacked:n.stacked.value,beginAtZero:!0,grid:{display:!1,drawBorder:!1},ticks:{font:e,callback:function(f,g){const p=this;return p.chart.options.indexAxis===p.axis?(f=p.getLabelForValue(g),f&&f.length>na?f.slice(0,na)+"...":f):p.getLabelForValue(Number(f))}},title:{display:n.indexAxis==="x"?!it((l=n.metricAxesTitle)==null?void 0:l.value):!it((c=n.dimensionAxesTitle)==null?void 0:c.value),text:n.indexAxis==="x"?(u=n.metricAxesTitle)==null?void 0:u.value:(d=n.dimensionAxesTitle)==null?void 0:d.value,padding:{bottom:20},font:{weight:"bold"}}}},plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...t,external:f=>{As(n.tooltipState,f)}}},interaction:{mode:"customInteractionMode",intersect:!0},maxBarThickness:60,maintainAspectRatio:!1}})}Te.register(...My);const Qw=(n,t)=>{const e=t.datasets.map(r=>r.label),i=n.datasets.map(r=>r.label);return n.datasets.length===t.datasets.length&&e.every((r,a)=>r===i[a])};function Jw(n,t,e,i,r){const a=h.shallowRef(null),s=(o,l)=>{if(t.value)return new Te(t.value,{type:n,data:o,plugins:i,options:l})};return h.onMounted(()=>{a.value=s(e.value,r.value)}),h.onBeforeUnmount(()=>{it(a.value)||a.value.destroy()}),h.watch(e,(o,l)=>{if(Qw(l,o)&&!it(a.value)){for(const[c,u]of o.datasets.entries())Object.assign(a.value.data.datasets[c],u);a.value.data.labels=o.labels,a.value.update()}else it(a.value)||a.value.destroy(),a.value=s(o,r.value)}),h.watch(t,()=>{it(a.value)||a.value.destroy(),a.value=s(e.value,r.value)}),h.watch(r,(o,l)=>{(o.indexAxis!==l.indexAxis||JSON.stringify(o.scales.x.title)!==JSON.stringify(l.scales.x.title)||JSON.stringify(o.scales.y.title)!==JSON.stringify(l.scales.y.title))&&(it(a.value)||a.value.destroy(),a.value=s(e.value,o))}),a}var Hd={exports:{}};(function(n){(function(){function t(c,u){if(u.separator===!1||c<1e3)return c.toString();var d=typeof u.separator=="string"?u.separator:",",f=[],g=Math.round(c).toString().split("");return g.reverse().forEach(function(p,m){m&&m%3===0&&f.push(d),f.push(p)}),f.reverse().join("")}function e(c,u,d){var f=c/u,g=d.round?"round":"floor";return d.decimal===!1?(c=Math[g](f),c.toString()):(d.precision?c=f:c=f<10?Math[g](f*10)/10:Math[g](f),c=c.toString(),typeof d.decimal=="string"&&(c=c.replace(".",d.decimal)),c)}var i=1e3,r=1e4,a=1e6,s=1e9,o=1e12;function l(c,u){var d;u=u||{};var f=c<0;f&&(c=Math.abs(c)),u.precision&&(c=parseFloat(c.toPrecision(u.precision)));var g=u.min10k?r:i;return c<g||u.precision&&u.precision>Math.log10(c)?d=t(e(c,1,u),u):c<a?d=e(c,i,u)+"k":c<s?d=e(c,a,u)+"m":c<o?d=t(e(c,s,u),u)+"b":d=t(e(c,o,u),u)+"t",f&&(d="-"+d),u.capital&&(d=d.toUpperCase()),u.prefix&&(d=u.prefix+d),u.suffix&&(d=d+u.suffix),d}l.addCommas=t,n.exports=l})()})(Hd);var t_=Hd.exports;const tr=Fn(t_);function e_(n,t,e){const{i18n:i}=St.useI18n(),{translateUnit:r}=St.useTranslatedUnits();return{legendValues:h.computed(()=>n.value.datasets.reduce((s,o)=>{const l=o.total?o.total:o.data.reduce((u,d)=>u+(typeof d=="number"?Number(d)||0:Number(d&&d.y)||0),0);let c;if(e.value==="bytes")c=isNaN(l)?"0":ws(l);else{const u=r(e.value,l);c=i&&i.t("legend.datapointValueDisplay",{value:tr(l,{capital:!0}),unit:u})||`${tr(l,{capital:!0})} ${e.value}`}return{...s,[o.label]:{raw:l,formatted:c}}},{}))}}function n_(n){return h.computed(()=>{var r,a,s;if(!((r=n.value)!=null&&r.meta))return"";const e="startMs"in n.value.meta?n.value.meta.startMs:((a=n.value.meta)==null?void 0:a.start)*1e3||"",i="endMs"in n.value.meta?n.value.meta.endMs:((s=n.value.meta)==null?void 0:s.end)*1e3||"";return e&&i?`${ea(e)} - ${ea(i,{includeTZ:!0})}`:""})}function i_(n){const t={enabled:!1,position:"doughnutChartTooltipPosition",callbacks:{label:i=>({label:i.dataset.label,value:i.label})}};return Yr.positioners.doughnutChartTooltipPosition=function(i,r){if(!i.length)return!1;const a=this.chart.canvas.getBoundingClientRect(),s=n.tooltipState.width||this.width,o=a.width/2,l=Rs(r,s,o),c=r.y,u=r.x<o?"left":"center";return{x:l-n.tooltipState.offset,y:c,xAlign:u}},{options:h.computed(()=>({responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...t,external:i=>{As(n.tooltipState,i)}}}}))}}var r_=Object.defineProperty,a_=(n,t,e)=>t in n?r_(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,We=(n,t,e)=>(a_(n,typeof t!="symbol"?t+"":t,e),e),ot=(n=>(n.MINUTELY="Minutely",n.HOURLY="Hourly",n.DAILY="Daily",n.WEEKLY="Weekly",n))(ot||{}),Yt=(n=>(n.FIFTEEN_MIN="15m",n.ONE_HOUR="1h",n.SIX_HOUR="6h",n.TWELVE_HOUR="12h",n.ONE_DAY="24h",n.SEVEN_DAY="7d",n.THIRTY_DAY="30d",n.CURRENT_WEEK="current_week",n.CURRENT_MONTH="current_month",n.CURRENT_QUARTER="current_quarter",n.PREVIOUS_WEEK="previous_week",n.PREVIOUS_MONTH="previous_month",n.PREVIOUS_QUARTER="previous_quarter",n))(Yt||{});function ko(n){"@babel/helpers - typeof";return ko=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ko(n)}function ia(n){if(n===null||n===!0||n===!1)return NaN;var t=Number(n);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function Ye(n,t){if(t.length<n)throw new TypeError(n+" argument"+(n>1?"s":"")+" required, but only "+t.length+" present")}function si(n){Ye(1,arguments);var t=Object.prototype.toString.call(n);return n instanceof Date||ko(n)==="object"&&t==="[object Date]"?new Date(n.getTime()):typeof n=="number"||t==="[object Number]"?new Date(n):((typeof n=="string"||t==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function $d(n,t){Ye(2,arguments);var e=si(n),i=ia(t);return isNaN(i)?new Date(NaN):(i&&e.setDate(e.getDate()+i),e)}function s_(n,t){Ye(2,arguments);var e=si(n),i=ia(t);if(isNaN(i))return new Date(NaN);if(!i)return e;var r=e.getDate(),a=new Date(e.getTime());a.setMonth(e.getMonth()+i+1,0);var s=a.getDate();return r>=s?a:(e.setFullYear(a.getFullYear(),a.getMonth(),r),e)}var o_={};function l_(){return o_}function ra(n,t){var e,i,r,a,s,o,l,c;Ye(1,arguments);var u=l_(),d=ia((e=(i=(r=(a=t==null?void 0:t.weekStartsOn)!==null&&a!==void 0?a:t==null||(s=t.locale)===null||s===void 0||(o=s.options)===null||o===void 0?void 0:o.weekStartsOn)!==null&&r!==void 0?r:u.weekStartsOn)!==null&&i!==void 0?i:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&e!==void 0?e:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=si(n),g=f.getDay(),p=(g<d?7:0)+g-d;return f.setDate(f.getDate()-p),f.setHours(0,0,0,0),f}function jd(n){Ye(1,arguments);var t=si(n);return t.setHours(0,0,0,0),t}var c_=60,u_=3600;function oi(n){Ye(1,arguments);var t=si(n);return t.setDate(1),t.setHours(0,0,0,0),t}function d_(n){Ye(1,arguments);var t=si(n),e=t.getFullYear(),i=t.getMonth(),r=new Date(0);return r.setFullYear(e,i+1,0),r.setHours(0,0,0,0),r.getDate()}function f_(n){return Ye(1,arguments),Math.floor(n*u_)}function h_(n){Ye(1,arguments);var t=n/c_;return Math.floor(t)}function Vd(n,t){Ye(2,arguments);var e=ia(t);return s_(n,-e)}function Oo(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var qd={exports:{}};(function(n){function t(e){return e&&e.__esModule?e:{default:e}}n.exports=t,n.exports.__esModule=!0,n.exports.default=n.exports})(qd);var g_=qd.exports,Po={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(i){if(i===null||i===!0||i===!1)return NaN;var r=Number(i);return isNaN(r)?r:r<0?Math.ceil(r):Math.floor(r)}n.exports=t.default})(Po,Po.exports);var p_=Po.exports;const m_=Oo(p_);var Eo={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(i){var r=new Date(Date.UTC(i.getFullYear(),i.getMonth(),i.getDate(),i.getHours(),i.getMinutes(),i.getSeconds(),i.getMilliseconds()));return r.setUTCFullYear(i.getFullYear()),i.getTime()-r.getTime()}n.exports=t.default})(Eo,Eo.exports);var y_=Eo.exports;const Xd=Oo(y_);function b_(n,t){var e=__(t);return e.formatToParts?x_(e,n):w_(e,n)}var v_={year:0,month:1,day:2,hour:3,minute:4,second:5};function x_(n,t){try{for(var e=n.formatToParts(t),i=[],r=0;r<e.length;r++){var a=v_[e[r].type];a>=0&&(i[a]=parseInt(e[r].value,10))}return i}catch(s){if(s instanceof RangeError)return[NaN];throw s}}function w_(n,t){var e=n.format(t).replace(/\u200E/g,""),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(e);return[i[3],i[1],i[2],i[4],i[5],i[6]]}var Ao={};function __(n){if(!Ao[n]){var t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:"America/New_York",year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),e=t==="06/25/2014, 00:00:00"||t==="06/25/2014 00:00:00";Ao[n]=e?new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}return Ao[n]}function Ro(n,t,e,i,r,a,s){var o=new Date(0);return o.setUTCFullYear(n,t,e),o.setUTCHours(i,r,a,s),o}var Gd=36e5,T_=6e4,Lo={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-]\d{2}):?(\d{2})$/};function aa(n,t,e){var i,r;if(!n||(i=Lo.timezoneZ.exec(n),i))return 0;var a;if(i=Lo.timezoneHH.exec(n),i)return a=parseInt(i[1],10),Kd(a)?-(a*Gd):NaN;if(i=Lo.timezoneHHMM.exec(n),i){a=parseInt(i[1],10);var s=parseInt(i[2],10);return Kd(a,s)?(r=Math.abs(a)*Gd+s*T_,a>0?-r:r):NaN}if(M_(n)){t=new Date(t||Date.now());var o=e?t:D_(t),l=Io(o,n),c=e?l:S_(t,l,n);return-c}return NaN}function D_(n){return Ro(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function Io(n,t){var e=b_(n,t),i=Ro(e[0],e[1]-1,e[2],e[3]%24,e[4],e[5],0).getTime(),r=n.getTime(),a=r%1e3;return r-=a>=0?a:1e3+a,i-r}function S_(n,t,e){var i=n.getTime(),r=i-t,a=Io(new Date(r),e);if(t===a)return t;r-=a-t;var s=Io(new Date(r),e);return a===s?a:Math.max(a,s)}function Kd(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}var Zd={};function M_(n){if(Zd[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),Zd[n]=!0,!0}catch{return!1}}var C_=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/;const Qd=C_;var No=36e5,Jd=6e4,k_=2,oe={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,plainTime:/:/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:Qd};function Fo(n,t){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(n===null)return new Date(NaN);var e=t||{},i=e.additionalDigits==null?k_:m_(e.additionalDigits);if(i!==2&&i!==1&&i!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]")return new Date(n.getTime());if(typeof n=="number"||Object.prototype.toString.call(n)==="[object Number]")return new Date(n);if(!(typeof n=="string"||Object.prototype.toString.call(n)==="[object String]"))return new Date(NaN);var r=O_(n),a=P_(r.date,i),s=a.year,o=a.restDateString,l=E_(o,s);if(isNaN(l))return new Date(NaN);if(l){var c=l.getTime(),u=0,d;if(r.time&&(u=A_(r.time),isNaN(u)))return new Date(NaN);if(r.timeZone||e.timeZone){if(d=aa(r.timeZone||e.timeZone,new Date(c+u)),isNaN(d))return new Date(NaN)}else d=Xd(new Date(c+u)),d=Xd(new Date(c+u+d));return new Date(c+u+d)}else return new Date(NaN)}function O_(n){var t={},e=oe.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=oe.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){var r=oe.timeZone.exec(i);r?(t.time=i.replace(r[1],""),t.timeZone=r[1].trim()):t.time=i}return t}function P_(n,t){var e=oe.YYY[t],i=oe.YYYYY[t],r;if(r=oe.YYYY.exec(n)||i.exec(n),r){var a=r[1];return{year:parseInt(a,10),restDateString:n.slice(a.length)}}if(r=oe.YY.exec(n)||e.exec(n),r){var s=r[1];return{year:parseInt(s,10)*100,restDateString:n.slice(s.length)}}return{year:null}}function E_(n,t){if(t===null)return null;var e,i,r,a;if(n.length===0)return i=new Date(0),i.setUTCFullYear(t),i;if(e=oe.MM.exec(n),e)return i=new Date(0),r=parseInt(e[1],10)-1,nf(t,r)?(i.setUTCFullYear(t,r),i):new Date(NaN);if(e=oe.DDD.exec(n),e){i=new Date(0);var s=parseInt(e[1],10);return I_(t,s)?(i.setUTCFullYear(t,0,s),i):new Date(NaN)}if(e=oe.MMDD.exec(n),e){i=new Date(0),r=parseInt(e[1],10)-1;var o=parseInt(e[2],10);return nf(t,r,o)?(i.setUTCFullYear(t,r,o),i):new Date(NaN)}if(e=oe.Www.exec(n),e)return a=parseInt(e[1],10)-1,rf(t,a)?tf(t,a):new Date(NaN);if(e=oe.WwwD.exec(n),e){a=parseInt(e[1],10)-1;var l=parseInt(e[2],10)-1;return rf(t,a,l)?tf(t,a,l):new Date(NaN)}return null}function A_(n){var t,e,i;if(t=oe.HH.exec(n),t)return e=parseFloat(t[1].replace(",",".")),Uo(e)?e%24*No:NaN;if(t=oe.HHMM.exec(n),t)return e=parseInt(t[1],10),i=parseFloat(t[2].replace(",",".")),Uo(e,i)?e%24*No+i*Jd:NaN;if(t=oe.HHMMSS.exec(n),t){e=parseInt(t[1],10),i=parseInt(t[2],10);var r=parseFloat(t[3].replace(",","."));return Uo(e,i,r)?e%24*No+i*Jd+r*1e3:NaN}return null}function tf(n,t,e){t=t||0,e=e||0;var i=new Date(0);i.setUTCFullYear(n,0,4);var r=i.getUTCDay()||7,a=t*7+e+1-r;return i.setUTCDate(i.getUTCDate()+a),i}var R_=[31,28,31,30,31,30,31,31,30,31,30,31],L_=[31,29,31,30,31,30,31,31,30,31,30,31];function ef(n){return n%400===0||n%4===0&&n%100!==0}function nf(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;var i=ef(n);if(i&&e>L_[t]||!i&&e>R_[t])return!1}return!0}function I_(n,t){if(t<1)return!1;var e=ef(n);return!(e&&t>366||!e&&t>365)}function rf(n,t,e){return!(t<0||t>52||e!=null&&(e<0||e>6))}function Uo(n,t,e){return!(n!=null&&(n<0||n>=25)||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}var Bo={exports:{}},Wo={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(i,r){if(i==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(i[a]=r[a]);return i}n.exports=t.default})(Wo,Wo.exports);var N_=Wo.exports;(function(n,t){var e=g_.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var i=e(N_);function r(a){return(0,i.default)({},a)}n.exports=t.default})(Bo,Bo.exports);var F_=Bo.exports;const U_=Oo(F_);function B_(n,t,e){var i=Fo(n,e),r=aa(t,i,!0),a=new Date(i.getTime()-r),s=new Date(0);return s.setFullYear(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate()),s.setHours(a.getUTCHours(),a.getUTCMinutes(),a.getUTCSeconds(),a.getUTCMilliseconds()),s}function W_(n,t){return-aa(n,t)}function Y_(n,t,e){if(typeof n=="string"&&!n.match(Qd)){var i=U_(e);return i.timeZone=t,Fo(n,i)}var r=Fo(n,e),a=Ro(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()).getTime(),s=aa(t,new Date(a));return new Date(a+s)}const z_={[ot.MINUTELY]:60*1e3,[ot.HOURLY]:60*60*1e3,[ot.DAILY]:60*60*24*1e3,[ot.WEEKLY]:60*60*24*7*1e3};function er(n){return n&&Object.values(ot).find(t=>n<=z_[t])||null}const li=(n,t)=>new Date(n.getTime()-W_(t,n));let Pe=class{constructor(t){We(this,"timeframeText"),We(this,"key"),We(this,"display"),We(this,"timeframeLength"),We(this,"allowedTiers"),We(this,"defaultResponseGranularity"),We(this,"dataGranularity"),We(this,"isRelative"),We(this,"_startCustom"),We(this,"_endCustom"),this.display=t.display,this.timeframeText=t.timeframeText,this.key=t.key,this.timeframeLength=t.timeframeLength,this.allowedTiers=t.allowedTiers,this.defaultResponseGranularity=t.defaultResponseGranularity,this.dataGranularity=t.dataGranularity,this.isRelative=t.isRelative,this._startCustom=t.startCustom,this._endCustom=t.endCustom}rawEnd(t){return this._endCustom||new Date}rawStart(t){return this._startCustom||new Date(this.rawEnd().getTime()-this.timeframeLengthMs())}timeframeLengthMs(){return this.timeframeLength()*1e3}maximumTimeframeLength(){return this.timeframeLength()}allowedGranularities(){const t=new Set,e=this.maximumTimeframeLength()/3600;return e<=6&&t.add(ot.MINUTELY),e>=2&&e<=7*24&&t.add(ot.HOURLY),e>=2*24&&t.add(ot.DAILY),e>=2*24*14&&t.add(ot.WEEKLY),t}tzAdjustedDate(t){if(!t)return new Date;const e=Y_(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return B_(e,t)}};class H_ extends Pe{rawStart(t){let e=ra(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=li(e,t)),e}maximumTimeframeLength(){return 60*60*24*7}}class $_ extends Pe{rawStart(t){let e=oi(this.tzAdjustedDate(t));return t&&(e=li(e,t)),e}maximumTimeframeLength(){return 60*60*24*31}}class j_ extends Pe{rawEnd(t){let e=ra(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=li(e,t)),e}rawStart(t){const e=this.tzAdjustedDate(t);let i=ra(e.setDate(e.getDate()-7),{weekStartsOn:1});return t&&(i=li(i,t)),i}}class V_ extends Pe{rawEnd(t){let e=oi(this.tzAdjustedDate(t));return t&&(e=li(e,t)),e}rawStart(t){let e=oi(Vd(this.tzAdjustedDate(t),1));return t&&(e=li(e,t)),e}}Yt.FIFTEEN_MIN,new Pe({key:Yt.FIFTEEN_MIN,display:"Last 15 minutes",timeframeText:"15 minutes",timeframeLength:()=>60*15,defaultResponseGranularity:ot.MINUTELY,dataGranularity:ot.MINUTELY,isRelative:!0,allowedTiers:["free","trial","plus","enterprise"]}),Yt.ONE_HOUR,new Pe({key:Yt.ONE_HOUR,display:"Last hour",timeframeText:"One hour",timeframeLength:()=>60*60*1,defaultResponseGranularity:ot.MINUTELY,dataGranularity:ot.MINUTELY,isRelative:!0,allowedTiers:["free","trial","plus","enterprise"]}),Yt.SIX_HOUR,new Pe({key:Yt.SIX_HOUR,display:"Last 6 hours",timeframeText:"6 hours",timeframeLength:()=>60*60*6,defaultResponseGranularity:ot.HOURLY,dataGranularity:ot.HOURLY,isRelative:!0,allowedTiers:["free","trial","plus","enterprise"]}),Yt.TWELVE_HOUR,new Pe({key:Yt.TWELVE_HOUR,display:"Last 12 hours",timeframeText:"12 hours",timeframeLength:()=>60*60*12,defaultResponseGranularity:ot.HOURLY,dataGranularity:ot.HOURLY,isRelative:!0,allowedTiers:["free","trial","plus","enterprise"]}),Yt.ONE_DAY,new Pe({key:Yt.ONE_DAY,display:"Last 24 hours",timeframeText:"24 hours",timeframeLength:()=>60*60*24,defaultResponseGranularity:ot.HOURLY,dataGranularity:ot.HOURLY,isRelative:!0,allowedTiers:["free","trial","plus","enterprise"]}),Yt.SEVEN_DAY,new Pe({key:Yt.SEVEN_DAY,display:"Last 7 days",timeframeText:"7 days",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:ot.DAILY,dataGranularity:ot.DAILY,isRelative:!0,allowedTiers:["trial","plus","enterprise"]}),Yt.THIRTY_DAY,new Pe({key:Yt.THIRTY_DAY,display:"Last 30 days",timeframeText:"30 days",timeframeLength:()=>60*60*24*30,defaultResponseGranularity:ot.DAILY,dataGranularity:ot.DAILY,isRelative:!0,allowedTiers:["trial","plus","enterprise"]}),Yt.CURRENT_WEEK,new H_({key:Yt.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const n=ra(new Date,{weekStartsOn:1});return(jd($d(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:ot.DAILY,dataGranularity:ot.DAILY,isRelative:!1,allowedTiers:["plus","enterprise"]}),Yt.CURRENT_MONTH,new $_({key:Yt.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const n=oi(new Date);return(jd($d(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:ot.DAILY,dataGranularity:ot.DAILY,isRelative:!1,allowedTiers:["plus","enterprise"]}),Yt.PREVIOUS_WEEK,new j_({key:Yt.PREVIOUS_WEEK,display:"Previous week",timeframeText:"Week",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:ot.DAILY,dataGranularity:ot.DAILY,isRelative:!1,allowedTiers:["plus","enterprise"]}),Yt.PREVIOUS_MONTH,new V_({key:Yt.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let n=0;const t=oi(new Date),e=oi(Vd(new Date,1));return t.getTimezoneOffset()!==e.getTimezoneOffset()&&(n=q_(t,e)),60*60*24*d_(new Date().setMonth(new Date().getMonth()-1))+f_(n)},defaultResponseGranularity:ot.DAILY,dataGranularity:ot.DAILY,isRelative:!1,allowedTiers:["plus","enterprise"]});function q_(n,t){return h_(n.getTimezoneOffset()-t.getTimezoneOffset())}function X_(n){const t=h.computed(()=>{var l,c;return{type:"timeseries",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:10,autoSkipPadding:100,source:"auto",maxRotation:0},title:{display:!it((l=n.dimensionAxesTitle)==null?void 0:l.value),text:(c=n.dimensionAxesTitle)==null?void 0:c.value,padding:{top:20},font:{weight:"bold"}}}}),e=h.computed(()=>{var l,c;return{title:{display:!it((l=n.metricAxesTitle)==null?void 0:l.value),text:(c=n.metricAxesTitle)==null?void 0:c.value,padding:{bottom:20},font:{weight:"bold"}},ticks:{maxTicksLimit:5},grid:{drawBorder:!1},id:"main-y-axis",beginAtZero:!0}}),i={enabled:!1,position:"lineChartTooltipPosition"};Yr.positioners.lineChartTooltipPosition=function(l,c){if(!l.length||n.tooltipState.locked)return!1;const u=this.chart.canvas.getBoundingClientRect(),d=n.tooltipState.width||this.width,f=n.tooltipState.height||this.height,g=u.width/2,p=u.height/2,m=Rs(c,d,g);let y=Fx(c,f,p);const v=c.y<p?"top":"bottom",x=c.x<g?"left":"center";return f>u.height&&(y=0),{x:m,y,xAlign:x,yAlign:v}};const r=h.computed(()=>{switch(n.granularity.value){case ot.MINUTELY:return"minute";case ot.HOURLY:return"hour";case ot.DAILY:return"day";default:return"day"}}),a=h.computed(()=>n.timeRangeMs?px(Number(n.timeRangeMs.value))>=24?"yyyy-MM-dd h:mm":"h:mm":Ex(Number(n.timeRangeSec.value))>=24?"yyyy-MM-dd h:mm":"h:mm"),s=h.computed(()=>[ot.DAILY,ot.WEEKLY].includes(n.granularity.value)?"yyyy-MM-dd":"yyyy-MM-dd h:mm");return{options:h.computed(()=>({hover:{mode:"index",intersect:!1},elements:{point:{radius:0,hitRadius:4,hoverRadius:4}},animation:{duration:250,easing:"linear"},scales:{x:{border:{display:!1},...t.value,stacked:n.stacked.value,time:{tooltipFormat:"h:mm:ss a",unit:r.value,displayFormats:{minute:"h:mm:ss a",hour:a.value,day:s.value}}},y:{border:{display:!1},...e.value,stacked:n.stacked.value}},responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},streaming:!1,tooltip:{...i,external:l=>{As(n.tooltipState,l)}}},interaction:{mode:"index",intersect:!1}}))}}function G_(n){const{isMultiMetric:t,hasDimensions:e,metricNames:i,barSegmentLabels:r,pivotRecords:a,rowLabels:s,colorPalette:o}=n,{i18n:l}=St.useI18n();return t?i.map(c=>({label:l&&l.te(`chartLabels.${c}`)&&l.t(`chartLabels.${c}`)||c,backgroundColor:ai(i.indexOf(c),De),data:s.map((u,d)=>e?a[`${u},${c}`]||0:a[`${d},${c}`]||null)})):Array.from(r).flatMap((c,u)=>{if(!c)return[];const d=Array.isArray(o)?ai(u,o):o[c]||ai(u);return{label:l&&l.te(`chartLabels.${c}`)&&l.t(`chartLabels.${c}`)||c,backgroundColor:d,data:s.map(f=>a[`${f},${c}`]||null)}})}function K_(n,t){const{i18n:e}=St.useI18n();return h.computed(()=>{try{if(t.value&&"meta"in t.value&&"records"in t.value){const r=t.value.records,{dimensions:a,metricNames:s}=t.value.meta,o=a&&Object.keys(a),l=s&&s.length>1,c=a&&o&&(o.length===1?o[0]!=="Organization":o.length>0);if(!r.length||!s)return{datasets:[],labels:[]};const u=c&&o||s,d=u[0],f=u.length>1?u[1]:u[0],g=Object.fromEntries(l?r.flatMap(v=>s.map((x,w)=>{const _=v.event[d],S=c?`${_},${x}`:`${w},${x}`,C=v.event[x];return[S,C]})):r.map(v=>{const x=c?`${v.event[d]},${v.event[f]}`:`${d},${f}`,w=v.event[s[0]];return[x,w]})),p=c&&a[d]||s,m=c&&a[f]||s;return!p||!m?{labels:[],datasets:[]}:{labels:c?a[d].map(v=>e&&e.te(`chartLabels.${v}`)&&e.t(`chartLabels.${v}`)||v):s.map(v=>e&&e.te(`chartLabels.${v}`)&&e.t(`chartLabels.${v}`)||v),datasets:G_({isMultiMetric:l,hasDimensions:c,metricNames:s,dimensionFieldNames:u,barSegmentLabels:m,pivotRecords:g,rowLabels:p,colorPalette:n.colorPalette||De})}}}catch(r){return console.error(r),{datasets:[],labels:[]}}return{labels:[],datasets:[]}})}const Z_=(n,t,e=1)=>Array(Math.ceil((t-n)/e)).fill(n).map((i,r)=>i+r*e),Q_=n=>{if(typeof n=="string"){const t=+n;if(t)return t;try{return hd(n).getTime()}catch(e){if(e instanceof RangeError)return 0;throw e}}return n},J_=(n,t,e,i,r)=>{const s=Math.max(t-6e4,Math.max(...(r||[]).map(c=>new Date(c.timestamp).valueOf()))),o=Math.floor((n-i)/e)*e+i,l=Math.floor((s-i)/e)*e+i+e;return Z_(o,l,e)};function t1(n,t){const{i18n:e}=St.useI18n();return h.computed(()=>{try{if(t.value&&"meta"in t.value&&"records"in t.value){const r=t.value.records,{dimensions:a,metricNames:s}=t.value.meta,o="startMs"in t.value.meta?t.value.meta.startMs:t.value.meta.start*1e3,l="endMs"in t.value.meta?t.value.meta.endMs:t.value.meta.end*1e3;if(!s)return console.error("Cannot build chart data from this explore result. Missing metric names."),{datasets:[]};const c=a&&Object.keys(a)||s,u=c&&c[0],d=a&&a[u]||s,f=t.value.meta.granularity;if(typeof f!="number"||isNaN(f)||!isFinite(f)||f===0)return console.error("Invalid step value:",f),{datasets:[]};if(!r.length)return{datasets:[]};const g=Q_(o),p=J_(o,l,f,g,r),m=new Set,y=r!=null&&r.length?r.reduce((_,S)=>{const C=new Date(S.timestamp).valueOf(),k=S.event;for(const T of s)m.add(T),C in _||(_[C]={}),T in _[C]||(_[C][T]={});for(const T of s)d.forEach(D=>{k[u]===D||T===D?(_[C][T]||(_[C][T]={}),_[C][T][D]=Math.round(Number(k[T])*1e3)/1e3):c.length||(_[C][T]||(_[C][T]={}),_[C][T][D]=Math.round(Number(k[D])*1e3)/1e3)});return _},{}):{},v=s.length===1?s.flatMap(_=>d.map(S=>[_,S])):d.map(_=>[_,_]),x={},w=[...v].map(([_,S],C)=>{const k=p.map(R=>R in y&&_ in y[R]?{x:R,y:y[R][_][S]||0}:{x:R,y:0});let{colorPalette:T,fill:D}=n;it(T)&&(T=De);const O=Array.isArray(T)?ai(C,T):T[S]||ai(C),A=Ji(O,50);return x[S]=O,{rawDimension:S,rawMetric:_,label:e&&e.te(`chartLabels.${S}`)&&e.t(`chartLabels.${S}`)||S,borderColor:A,backgroundColor:O,data:k,total:k.reduce((R,{y:W})=>R+Number(W),0),...Xw,fill:D}});return w.sort((_,S)=>Number(_.total)<Number(S.total)?-1:1),{datasets:w,colorMap:x}}}catch(r){return console.error(r),{labels:[],datasets:[]}}return{labels:[],datasets:[]}})}const e1=(n,t)=>{h.watch([n,t],(e,i,r)=>{const[a,s]=e;!s||!window||(window._AnalyticsChartDataInternal||(window._AnalyticsChartDataInternal=new Map),window._AnalyticsChartDataInternal.set(s,a),r(()=>{var o;(o=window._AnalyticsChartDataInternal)==null||o.delete(s)}))},{immediate:!0})};function n1(){const{i18n:n}=St.useI18n();return{translateUnit:(e,i)=>{const r=i===1,a=`chartUnits.${e}`;return n.te(a)?n.t(a,{plural:r?"":"s"}):e}}}const St={useBarChartOptions:Zw,useChartJSCommon:Jw,useChartLegendValues:e_,useChartSelectedRange:n_,useExploreResultToDatasets:K_,useExploreResultToTimeDataset:t1,useDoughnutChartOptions:i_,useLinechartOptions:X_,useI18n:Sh,useReportChartDataForSynthetics:e1,useTranslatedUnits:n1};/*!
|
|
18
|
+
`):n}function G0(n,t){const{element:e,datasetIndex:i,index:r}=t,a=n.getDatasetMeta(i).controller,{label:s,value:o}=a.getLabelAndValue(r);return{chart:n,label:s,parsed:a.getParsed(r),raw:n.data.datasets[i].data[r],formattedValue:o,dataset:a.getDataset(),dataIndex:r,datasetIndex:i,element:e}}function wu(n,t){const e=n.chart.ctx,{body:i,footer:r,title:a}=n,{boxWidth:s,boxHeight:o}=t,l=Et(t.bodyFont),c=Et(t.titleFont),u=Et(t.footerFont),d=a.length,f=r.length,g=i.length,p=Xt(t.padding);let x=p.height,m=0,v=i.reduce((w,S)=>w+S.before.length+S.lines.length+S.after.length,0);if(v+=n.beforeBody.length+n.afterBody.length,d&&(x+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),v){const w=t.displayColors?Math.max(o,l.lineHeight):l.lineHeight;x+=g*w+(v-g)*l.lineHeight+(v-1)*t.bodySpacing}f&&(x+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let b=0;const _=function(w){m=Math.max(m,e.measureText(w).width+b)};return e.save(),e.font=c.string,_t(n.title,_),e.font=l.string,_t(n.beforeBody.concat(n.afterBody),_),b=t.displayColors?s+2+t.boxPadding:0,_t(i,w=>{_t(w.before,_),_t(w.lines,_),_t(w.after,_)}),b=0,e.font=u.string,_t(n.footer,_),e.restore(),m+=p.width,{width:m,height:x}}function K0(n,t){const{y:e,height:i}=t;return e<i/2?"top":e>n.height-i/2?"bottom":"center"}function Z0(n,t,e,i){const{x:r,width:a}=i,s=e.caretSize+e.caretPadding;if(n==="left"&&r+a+s>t.width||n==="right"&&r-a-s<0)return!0}function Q0(n,t,e,i){const{x:r,width:a}=e,{width:s,chartArea:{left:o,right:l}}=n;let c="center";return i==="center"?c=r<=(o+l)/2?"left":"right":r<=a/2?c="left":r>=s-a/2&&(c="right"),Z0(c,n,t,e)&&(c="center"),c}function Tu(n,t,e){const i=e.yAlign||t.yAlign||K0(n,e);return{xAlign:e.xAlign||t.xAlign||Q0(n,t,e,i),yAlign:i}}function J0(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function ty(n,t,e){let{y:i,height:r}=n;return t==="top"?i+=e:t==="bottom"?i-=r+e:i-=r/2,i}function Du(n,t,e,i){const{caretSize:r,caretPadding:a,cornerRadius:s}=n,{xAlign:o,yAlign:l}=e,c=r+a,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:g}=un(s);let p=J0(t,o);const x=ty(t,l,c);return l==="center"?o==="left"?p+=c:o==="right"&&(p-=c):o==="left"?p-=Math.max(u,f)+r:o==="right"&&(p+=Math.max(d,g)+r),{x:Zt(p,0,i.width-t.width),y:Zt(x,0,i.height-t.height)}}function Wr(n,t,e){const i=Xt(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-i.right:n.x+i.left}function Su(n){return Ne([],Xe(n))}function ey(n,t,e){return dn(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function Mu(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const Cu={beforeTitle:He,title(n){if(n.length>0){const t=n[0],e=t.chart.data.labels,i=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex<i)return e[t.dataIndex]}return""},afterTitle:He,beforeBody:He,beforeLabel:He,label(n){if(this&&this.options&&this.options.mode==="dataset")return n.label+": "+n.formattedValue||n.formattedValue;let t=n.dataset.label||"";t&&(t+=": ");const e=n.formattedValue;return it(e)||(t+=e),t},labelColor(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.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(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:He,afterBody:He,beforeFooter:He,footer:He,afterFooter:He};function fe(n,t,e,i){const r=n[t].call(e,i);return typeof r>"u"?Cu[t].call(e,i):r}class ps extends te{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,i=this.options.setContext(this.getContext()),r=i.enabled&&e.options.animation&&i.animations,a=new Ga(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(a)),a}getContext(){return this.$context||(this.$context=ey(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,r=fe(i,"beforeTitle",this,t),a=fe(i,"title",this,t),s=fe(i,"afterTitle",this,t);let o=[];return o=Ne(o,Xe(r)),o=Ne(o,Xe(a)),o=Ne(o,Xe(s)),o}getBeforeBody(t,e){return Su(fe(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,r=[];return _t(t,a=>{const s={before:[],lines:[],after:[]},o=Mu(i,a);Ne(s.before,Xe(fe(o,"beforeLabel",this,a))),Ne(s.lines,fe(o,"label",this,a)),Ne(s.after,Xe(fe(o,"afterLabel",this,a))),r.push(s)}),r}getAfterBody(t,e){return Su(fe(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,r=fe(i,"beforeFooter",this,t),a=fe(i,"footer",this,t),s=fe(i,"afterFooter",this,t);let o=[];return o=Ne(o,Xe(r)),o=Ne(o,Xe(a)),o=Ne(o,Xe(s)),o}_createItems(t){const e=this._active,i=this.chart.data,r=[],a=[],s=[];let o=[],l,c;for(l=0,c=e.length;l<c;++l)o.push(G0(this.chart,e[l]));return t.filter&&(o=o.filter((u,d,f)=>t.filter(u,d,f,i))),t.itemSort&&(o=o.sort((u,d)=>t.itemSort(u,d,i))),_t(o,u=>{const d=Mu(t.callbacks,u);r.push(fe(d,"labelColor",this,u)),a.push(fe(d,"labelPointStyle",this,u)),s.push(fe(d,"labelTextColor",this,u))}),this.labelColors=r,this.labelPointStyles=a,this.labelTextColors=s,this.dataPoints=o,o}update(t,e){const i=this.options.setContext(this.getContext()),r=this._active;let a,s=[];if(!r.length)this.opacity!==0&&(a={opacity:0});else{const o=Yi[i.position].call(this,r,this._eventPosition);s=this._createItems(i),this.title=this.getTitle(s,i),this.beforeBody=this.getBeforeBody(s,i),this.body=this.getBody(s,i),this.afterBody=this.getAfterBody(s,i),this.footer=this.getFooter(s,i);const l=this._size=wu(this,i),c=Object.assign({},o,l),u=Tu(this.chart,i,c),d=Du(i,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,a={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:o.x,caretY:o.y}}this._tooltipItems=s,this.$context=void 0,a&&this._resolveAnimations().update(this,a),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,r){const a=this.getCaretPosition(t,i,r);e.lineTo(a.x1,a.y1),e.lineTo(a.x2,a.y2),e.lineTo(a.x3,a.y3)}getCaretPosition(t,e,i){const{xAlign:r,yAlign:a}=this,{caretSize:s,cornerRadius:o}=i,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=un(o),{x:f,y:g}=t,{width:p,height:x}=e;let m,v,b,_,w,S;return a==="center"?(w=g+x/2,r==="left"?(m=f,v=m-s,_=w+s,S=w-s):(m=f+p,v=m+s,_=w-s,S=w+s),b=m):(r==="left"?v=f+Math.max(l,u)+s:r==="right"?v=f+p-Math.max(c,d)-s:v=this.caretX,a==="top"?(_=g,w=_-s,m=v-s,b=v+s):(_=g+x,w=_+s,m=v+s,b=v-s),S=_),{x1:m,x2:v,x3:b,y1:_,y2:w,y3:S}}drawTitle(t,e,i){const r=this.title,a=r.length;let s,o,l;if(a){const c=Jn(i.rtl,this.x,this.width);for(t.x=Wr(this,i.titleAlign,i),e.textAlign=c.textAlign(i.titleAlign),e.textBaseline="middle",s=Et(i.titleFont),o=i.titleSpacing,e.fillStyle=i.titleColor,e.font=s.string,l=0;l<a;++l)e.fillText(r[l],c.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+o,l+1===a&&(t.y+=i.titleMarginBottom-o)}}_drawColorBox(t,e,i,r,a){const s=this.labelColors[i],o=this.labelPointStyles[i],{boxHeight:l,boxWidth:c}=a,u=Et(a.bodyFont),d=Wr(this,"left",a),f=r.x(d),g=l<u.lineHeight?(u.lineHeight-l)/2:0,p=e.y+g;if(a.usePointStyle){const x={radius:Math.min(c,l)/2,pointStyle:o.pointStyle,rotation:o.rotation,borderWidth:1},m=r.leftForLtr(f,c)+c/2,v=p+l/2;t.strokeStyle=a.multiKeyBackground,t.fillStyle=a.multiKeyBackground,za(t,x,m,v),t.strokeStyle=s.borderColor,t.fillStyle=s.backgroundColor,za(t,x,m,v)}else{t.lineWidth=ct(s.borderWidth)?Math.max(...Object.values(s.borderWidth)):s.borderWidth||1,t.strokeStyle=s.borderColor,t.setLineDash(s.borderDash||[]),t.lineDashOffset=s.borderDashOffset||0;const x=r.leftForLtr(f,c),m=r.leftForLtr(r.xPlus(f,1),c-2),v=un(s.borderRadius);Object.values(v).some(b=>b!==0)?(t.beginPath(),t.fillStyle=a.multiKeyBackground,Kn(t,{x,y:p,w:c,h:l,radius:v}),t.fill(),t.stroke(),t.fillStyle=s.backgroundColor,t.beginPath(),Kn(t,{x:m,y:p+1,w:c-2,h:l-2,radius:v}),t.fill()):(t.fillStyle=a.multiKeyBackground,t.fillRect(x,p,c,l),t.strokeRect(x,p,c,l),t.fillStyle=s.backgroundColor,t.fillRect(m,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:r}=this,{bodySpacing:a,bodyAlign:s,displayColors:o,boxHeight:l,boxWidth:c,boxPadding:u}=i,d=Et(i.bodyFont);let f=d.lineHeight,g=0;const p=Jn(i.rtl,this.x,this.width),x=function(T){e.fillText(T,p.x(t.x+g),t.y+f/2),t.y+=f+a},m=p.textAlign(s);let v,b,_,w,S,C,k;for(e.textAlign=s,e.textBaseline="middle",e.font=d.string,t.x=Wr(this,m,i),e.fillStyle=i.bodyColor,_t(this.beforeBody,x),g=o&&m!=="right"?s==="center"?c/2+u:c+2+u:0,w=0,C=r.length;w<C;++w){for(v=r[w],b=this.labelTextColors[w],e.fillStyle=b,_t(v.before,x),_=v.lines,o&&_.length&&(this._drawColorBox(e,t,w,p,i),f=Math.max(d.lineHeight,l)),S=0,k=_.length;S<k;++S)x(_[S]),f=d.lineHeight;_t(v.after,x)}g=0,f=d.lineHeight,_t(this.afterBody,x),t.y-=a}drawFooter(t,e,i){const r=this.footer,a=r.length;let s,o;if(a){const l=Jn(i.rtl,this.x,this.width);for(t.x=Wr(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=l.textAlign(i.footerAlign),e.textBaseline="middle",s=Et(i.footerFont),e.fillStyle=i.footerColor,e.font=s.string,o=0;o<a;++o)e.fillText(r[o],l.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+i.footerSpacing}}drawBackground(t,e,i,r){const{xAlign:a,yAlign:s}=this,{x:o,y:l}=t,{width:c,height:u}=i,{topLeft:d,topRight:f,bottomLeft:g,bottomRight:p}=un(r.cornerRadius);e.fillStyle=r.backgroundColor,e.strokeStyle=r.borderColor,e.lineWidth=r.borderWidth,e.beginPath(),e.moveTo(o+d,l),s==="top"&&this.drawCaret(t,e,i,r),e.lineTo(o+c-f,l),e.quadraticCurveTo(o+c,l,o+c,l+f),s==="center"&&a==="right"&&this.drawCaret(t,e,i,r),e.lineTo(o+c,l+u-p),e.quadraticCurveTo(o+c,l+u,o+c-p,l+u),s==="bottom"&&this.drawCaret(t,e,i,r),e.lineTo(o+g,l+u),e.quadraticCurveTo(o,l+u,o,l+u-g),s==="center"&&a==="left"&&this.drawCaret(t,e,i,r),e.lineTo(o,l+d),e.quadraticCurveTo(o,l,o+d,l),e.closePath(),e.fill(),r.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,r=i&&i.x,a=i&&i.y;if(r||a){const s=Yi[t.position].call(this,this._active,this._eventPosition);if(!s)return;const o=this._size=wu(this,t),l=Object.assign({},s,this._size),c=Tu(e,t,l),u=Du(t,l,c,e);(r._to!==u.x||a._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=o.width,this.height=o.height,this.caretX=s.x,this.caretY=s.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const r={width:this.width,height:this.height},a={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const s=Xt(e.padding),o=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&o&&(t.save(),t.globalAlpha=i,this.drawBackground(a,t,r,e),oc(t,e.textDirection),a.y+=s.top,this.drawTitle(a,t,e),this.drawBody(a,t,e),this.drawFooter(a,t,e),lc(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,r=t.map(({datasetIndex:o,index:l})=>{const c=this.chart.getDatasetMeta(o);if(!c)throw new Error("Cannot find a dataset at index "+o);return{datasetIndex:o,element:c.data[l],index:l}}),a=!hr(i,r),s=this._positionChanged(r,e);(a||s)&&(this._active=r,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const r=this.options,a=this._active||[],s=this._getActiveElements(t,a,e,i),o=this._positionChanged(s,t),l=e||!hr(s,a)||o;return l&&(this._active=s,(r.enabled||r.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,i,r){const a=this.options;if(t.type==="mouseout")return[];if(!r)return e.filter(o=>this.chart.data.datasets[o.datasetIndex]&&this.chart.getDatasetMeta(o.datasetIndex).controller.getParsed(o.index)!==void 0);const s=this.chart.getElementsAtEventForMode(t,a.mode,a,i);return a.reverse&&s.reverse(),s}_positionChanged(t,e){const{caretX:i,caretY:r,options:a}=this,s=Yi[a.position].call(this,t,e);return s!==!1&&(i!==s.x||r!==s.y)}}Y(ps,"positioners",Yi);var Yr={id:"tooltip",_element:ps,positioners:Yi,afterInit(n,t,e){e&&(n.tooltip=new ps({chart:n,options:e}))},beforeUpdate(n,t,e){n.tooltip&&n.tooltip.initialize(e)},reset(n,t,e){n.tooltip&&n.tooltip.initialize(e)},afterDraw(n){const t=n.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(n.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",e)}},afterEvent(n,t){if(n.tooltip){const e=t.replay;n.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:(n,t)=>t.bodyFont.size,boxWidth:(n,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:Cu},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:n=>n!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},ny=Object.freeze({__proto__:null,Colors:p0,Decimation:v0,Filler:B0,Legend:j0,SubTitle:X0,Title:q0,Tooltip:Yr});const iy=(n,t,e,i)=>(typeof t=="string"?(e=n.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function ry(n,t,e,i){const r=n.indexOf(t);if(r===-1)return iy(n,t,e,i);const a=n.lastIndexOf(t);return r!==a?e:r}const ay=(n,t)=>n===null?null:Zt(Math.round(n),0,t);function ku(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class ms extends Rn{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const i=this.getLabels();for(const{index:r,label:a}of e)i[r]===a&&i.splice(r,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(it(t))return null;const i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:ry(i,t,nt(e,t),this._addedLabels),ay(e,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:r}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),e||(r=this.getLabels().length-1)),this.min=i,this.max=r}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,r=[];let a=this.getLabels();a=t===0&&e===a.length-1?a:a.slice(t,e+1),this._valueRange=Math.max(a.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let s=t;s<=e;s++)r.push({value:s});return r}getLabelForValue(t){return ku.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}}Y(ms,"id","category"),Y(ms,"defaults",{ticks:{callback:ku}});function sy(n,t){const e=[],{bounds:r,step:a,min:s,max:o,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:f}=n,g=a||1,p=u-1,{min:x,max:m}=t,v=!it(s),b=!it(o),_=!it(c),w=(m-x)/(d+1);let S=Al((m-x)/p/g)*g,C,k,T,D;if(S<1e-14&&!v&&!b)return[{value:x},{value:m}];D=Math.ceil(m/S)-Math.floor(x/S),D>p&&(S=Al(D*S/p/g)*g),it(l)||(C=Math.pow(10,l),S=Math.ceil(S*C)/C),r==="ticks"?(k=Math.floor(x/S)*S,T=Math.ceil(m/S)*S):(k=x,T=m),v&&b&&a&&ig((o-s)/a,S/1e3)?(D=Math.round(Math.min((o-s)/S,u)),S=(o-s)/D,k=s,T=o):_?(k=v?s:k,T=b?o:T,D=c-1,S=(T-k)/D):(D=(T-k)/S,_i(D,Math.round(D),S/1e3)?D=Math.round(D):D=Math.ceil(D));const O=Math.max(Ll(S),Ll(k));C=Math.pow(10,it(l)?O:l),k=Math.round(k*C)/C,T=Math.round(T*C)/C;let A=0;for(v&&(f&&k!==s?(e.push({value:s}),k<s&&A++,_i(Math.round((k+A*S)*C)/C,s,Ou(s,w,n))&&A++):k<s&&A++);A<D;++A){const R=Math.round((k+A*S)*C)/C;if(b&&R>o)break;e.push({value:R})}return b&&f&&T!==o?e.length&&_i(e[e.length-1].value,o,Ou(o,w,n))?e[e.length-1].value=o:e.push({value:o}):(!b||T===o)&&e.push({value:T}),e}function Ou(n,t,{horizontal:e,minRotation:i}){const r=qt(i),a=(e?Math.sin(r):Math.cos(r))||.001,s=.75*t*(""+n).length;return Math.min(t/a,s)}class zr extends Rn{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 it(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:r,max:a}=this;const s=l=>r=e?r:l,o=l=>a=i?a:l;if(t){const l=Le(r),c=Le(a);l<0&&c<0?o(0):l>0&&c>0&&s(0)}if(r===a){let l=a===0?1:Math.abs(a*.05);o(a+l),t||s(r-l)}this.min=r,this.max=a}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:i}=t,r;return i?(r=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,r>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${r} ticks. Limiting to 1000.`),r=1e3)):(r=this.computeTickLimit(),e=e||11),e&&(r=Math.min(e,r)),r}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const r={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},a=this._range||this,s=sy(r,a);return t.bounds==="ticks"&&Rl(s,this,"value"),t.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const r=(i-e)/Math.max(t.length-1,1)/2;e-=r,i+=r}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return Di(t,this.chart.options.locale,this.options.ticks.format)}}class ys extends zr{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Lt(t)?t:0,this.max=Lt(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=qt(this.options.ticks.minRotation),r=(t?Math.sin(i):Math.cos(i))||.001,a=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,a.lineHeight/r))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}Y(ys,"id","linear"),Y(ys,"defaults",{ticks:{callback:vr.formatters.numeric}});const zi=n=>Math.floor(ln(n)),Ln=(n,t)=>Math.pow(10,zi(n)+t);function Pu(n){return n/Math.pow(10,zi(n))===1}function Eu(n,t,e){const i=Math.pow(10,e),r=Math.floor(n/i);return Math.ceil(t/i)-r}function oy(n,t){const e=t-n;let i=zi(e);for(;Eu(n,t,i)>10;)i++;for(;Eu(n,t,i)<10;)i--;return Math.min(i,zi(n))}function ly(n,{min:t,max:e}){t=be(n.min,t);const i=[],r=zi(t);let a=oy(t,e),s=a<0?Math.pow(10,Math.abs(a)):1;const o=Math.pow(10,a),l=r>a?Math.pow(10,r):0,c=Math.round((t-l)*s)/s,u=Math.floor((t-l)/o/10)*o*10;let d=Math.floor((c-u)/Math.pow(10,a)),f=be(n.min,Math.round((l+u+d*Math.pow(10,a))*s)/s);for(;f<e;)i.push({value:f,major:Pu(f),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(a++,d=2,s=a>=0?1:s),f=Math.round((l+u+d*Math.pow(10,a))*s)/s;const g=be(n.max,f);return i.push({value:g,major:Pu(g),significand:d}),i}class bs extends Rn{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=zr.prototype.parse.apply(this,[t,e]);if(i===0){this._zero=!0;return}return Lt(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Lt(t)?Math.max(0,t):null,this.max=Lt(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Lt(this._userMin)&&(this.min=t===Ln(this.min,0)?Ln(this.min,-1):Ln(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,r=this.max;const a=o=>i=t?i:o,s=o=>r=e?r:o;i===r&&(i<=0?(a(1),s(10)):(a(Ln(i,-1)),s(Ln(r,1)))),i<=0&&a(Ln(r,-1)),r<=0&&s(Ln(i,1)),this.min=i,this.max=r}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},i=ly(e,this);return t.bounds==="ticks"&&Rl(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return t===void 0?"0":Di(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=ln(t),this._valueRange=ln(this.max)-ln(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(ln(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}Y(bs,"id","logarithmic"),Y(bs,"defaults",{ticks:{callback:vr.formatters.logarithmic,major:{enabled:!0}}});function vs(n){const t=n.ticks;if(t.display&&n.display){const e=Xt(t.backdropPadding);return nt(t.font&&t.font.size,Ft.font.size)+e.height}return 0}function cy(n,t,e){return e=yt(e)?e:[e],{w:xg(n,t.string,e),h:e.length*t.lineHeight}}function Au(n,t,e,i,r){return n===i||n===r?{start:t-e/2,end:t+e/2}:n<i||n>r?{start:t-e,end:t}:{start:t,end:t+e}}function uy(n){const t={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},e=Object.assign({},t),i=[],r=[],a=n._pointLabels.length,s=n.options.pointLabels,o=s.centerPointLabels?dt/a:0;for(let l=0;l<a;l++){const c=s.setContext(n.getPointLabelContext(l));r[l]=c.padding;const u=n.getPointPosition(l,n.drawingArea+r[l],o),d=Et(c.font),f=cy(n.ctx,d,n._pointLabels[l]);i[l]=f;const g=ve(n.getIndexAngle(l)+o),p=Math.round(yr(g)),x=Au(p,u.x,f.w,0,180),m=Au(p,u.y,f.h,90,270);dy(e,t,g,x,m)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=gy(n,i,r)}function dy(n,t,e,i,r){const a=Math.abs(Math.sin(e)),s=Math.abs(Math.cos(e));let o=0,l=0;i.start<t.l?(o=(t.l-i.start)/a,n.l=Math.min(n.l,t.l-o)):i.end>t.r&&(o=(i.end-t.r)/a,n.r=Math.max(n.r,t.r+o)),r.start<t.t?(l=(t.t-r.start)/s,n.t=Math.min(n.t,t.t-l)):r.end>t.b&&(l=(r.end-t.b)/s,n.b=Math.max(n.b,t.b+l))}function fy(n,t,e){const i=n.drawingArea,{extra:r,additionalAngle:a,padding:s,size:o}=e,l=n.getPointPosition(t,i+r+s,a),c=Math.round(yr(ve(l.angle+Pt))),u=yy(l.y,o.h,c),d=py(c),f=my(l.x,o.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:f,top:u,right:f+o.w,bottom:u+o.h}}function hy(n,t){if(!t)return!0;const{left:e,top:i,right:r,bottom:a}=n;return!(Ve({x:e,y:i},t)||Ve({x:e,y:a},t)||Ve({x:r,y:i},t)||Ve({x:r,y:a},t))}function gy(n,t,e){const i=[],r=n._pointLabels.length,a=n.options,{centerPointLabels:s,display:o}=a.pointLabels,l={extra:vs(a)/2,additionalAngle:s?dt/r:0};let c;for(let u=0;u<r;u++){l.padding=e[u],l.size=t[u];const d=fy(n,u,l);i.push(d),o==="auto"&&(d.visible=hy(d,c),d.visible&&(c=d))}return i}function py(n){return n===0||n===180?"center":n<180?"left":"right"}function my(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function yy(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function by(n,t,e){const{left:i,top:r,right:a,bottom:s}=e,{backdropColor:o}=t;if(!it(o)){const l=un(t.borderRadius),c=Xt(t.backdropPadding);n.fillStyle=o;const u=i-c.left,d=r-c.top,f=a-i+c.width,g=s-r+c.height;Object.values(l).some(p=>p!==0)?(n.beginPath(),Kn(n,{x:u,y:d,w:f,h:g,radius:l}),n.fill()):n.fillRect(u,d,f,g)}}function vy(n,t){const{ctx:e,options:{pointLabels:i}}=n;for(let r=t-1;r>=0;r--){const a=n._pointLabelItems[r];if(!a.visible)continue;const s=i.setContext(n.getPointLabelContext(r));by(e,s,a);const o=Et(s.font),{x:l,y:c,textAlign:u}=a;On(e,n._pointLabels[r],l,c+o.lineHeight/2,o,{color:s.color,textAlign:u,textBaseline:"middle"})}}function Ru(n,t,e,i){const{ctx:r}=n;if(e)r.arc(n.xCenter,n.yCenter,t,0,kt);else{let a=n.getPointPosition(0,t);r.moveTo(a.x,a.y);for(let s=1;s<i;s++)a=n.getPointPosition(s,t),r.lineTo(a.x,a.y)}}function xy(n,t,e,i,r){const a=n.ctx,s=t.circular,{color:o,lineWidth:l}=t;!s&&!i||!o||!l||e<0||(a.save(),a.strokeStyle=o,a.lineWidth=l,a.setLineDash(r.dash),a.lineDashOffset=r.dashOffset,a.beginPath(),Ru(n,e,s,i),a.closePath(),a.stroke(),a.restore())}function _y(n,t,e){return dn(n,{label:e,index:t,type:"pointLabel"})}class Hi extends zr{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=Xt(vs(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=Lt(t)&&!isNaN(t)?t:0,this.max=Lt(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/vs(this.options))}generateTickLabels(t){zr.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,i)=>{const r=xt(this.options.pointLabels.callback,[e,i],this);return r||r===0?r:""}).filter((e,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?uy(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,r){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-r)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,r))}getIndexAngle(t){const e=kt/(this._pointLabels.length||1),i=this.options.startAngle||0;return ve(t*e+qt(i))}getDistanceFromCenterForValue(t){if(it(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(it(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 i=e[t];return _y(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const r=this.getIndexAngle(t)-Pt+i;return{x:Math.cos(r)*e+this.xCenter,y:Math.sin(r)*e+this.yCenter,angle:r}}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:i,right:r,bottom:a}=this._pointLabelItems[t];return{left:e,top:i,right:r,bottom:a}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),Ru(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:i,grid:r,border:a}=e,s=this._pointLabels.length;let o,l,c;if(e.pointLabels.display&&vy(this,s),r.display&&this.ticks.forEach((u,d)=>{if(d!==0){l=this.getDistanceFromCenterForValue(u.value);const f=this.getContext(d),g=r.setContext(f),p=a.setContext(f);xy(this,g,l,s,p)}}),i.display){for(t.save(),o=s-1;o>=0;o--){const u=i.setContext(this.getPointLabelContext(o)),{color:d,lineWidth:f}=u;!f||!d||(t.lineWidth=f,t.strokeStyle=d,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),c=this.getPointPosition(o,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,i=e.ticks;if(!i.display)return;const r=this.getIndexAngle(0);let a,s;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(r),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((o,l)=>{if(l===0&&!e.reverse)return;const c=i.setContext(this.getContext(l)),u=Et(c.font);if(a=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,s=t.measureText(o.label).width,t.fillStyle=c.backdropColor;const d=Xt(c.backdropPadding);t.fillRect(-s/2-d.left,-a-u.size/2-d.top,s+d.width,u.size+d.height)}On(t,o.label,0,-a,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}Y(Hi,"id","radialLinear"),Y(Hi,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:vr.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),Y(Hi,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),Y(Hi,"descriptors",{angleLines:{_fallback:"grid"}});const Hr={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}},he=Object.keys(Hr);function Lu(n,t){return n-t}function Iu(n,t){if(it(t))return null;const e=n._adapter,{parser:i,round:r,isoWeekday:a}=n._parseOpts;let s=t;return typeof i=="function"&&(s=i(s)),Lt(s)||(s=typeof i=="string"?e.parse(s,i):e.parse(s)),s===null?null:(r&&(s=r==="week"&&(cn(a)||a===!0)?e.startOf(s,"isoWeek",a):e.startOf(s,r)),+s)}function Nu(n,t,e,i){const r=he.length;for(let a=he.indexOf(n);a<r-1;++a){const s=Hr[he[a]],o=s.steps?s.steps:Number.MAX_SAFE_INTEGER;if(s.common&&Math.ceil((e-t)/(o*s.size))<=i)return he[a]}return he[r-1]}function wy(n,t,e,i,r){for(let a=he.length-1;a>=he.indexOf(e);a--){const s=he[a];if(Hr[s].common&&n._adapter.diff(r,i,s)>=t-1)return s}return he[e?he.indexOf(e):0]}function Ty(n){for(let t=he.indexOf(n)+1,e=he.length;t<e;++t)if(Hr[he[t]].common)return he[t]}function Fu(n,t,e){if(!e)n[t]=!0;else if(e.length){const{lo:i,hi:r}=Na(e,t),a=e[i]>=t?e[i]:e[r];n[a]=!0}}function Dy(n,t,e,i){const r=n._adapter,a=+r.startOf(t[0].value,i),s=t[t.length-1].value;let o,l;for(o=a;o<=s;o=+r.add(o,1,i))l=e[o],l>=0&&(t[l].major=!0);return t}function Uu(n,t,e){const i=[],r={},a=t.length;let s,o;for(s=0;s<a;++s)o=t[s],r[o]=s,i.push({value:o,major:!1});return a===0||!e?i:Dy(n,i,r,e)}class $i extends Rn{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const i=t.time||(t.time={}),r=this._adapter=new Cc._date(t.adapters.date);r.init(e),xi(i.displayFormats,r.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:Iu(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:r,max:a,minDefined:s,maxDefined:o}=this.getUserBounds();function l(c){!s&&!isNaN(c.min)&&(r=Math.min(r,c.min)),!o&&!isNaN(c.max)&&(a=Math.max(a,c.max))}(!s||!o)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),r=Lt(r)&&!isNaN(r)?r:+e.startOf(Date.now(),i),a=Lt(a)&&!isNaN(a)?a:+e.endOf(Date.now(),i)+1,this.min=Math.min(r,a-1),this.max=Math.max(r+1,a)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,r=i.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&r.length&&(this.min=this._userMin||r[0],this.max=this._userMax||r[r.length-1]);const a=this.min,s=this.max,o=og(r,a,s);return this._unit=e.unit||(i.autoSkip?Nu(e.minUnit,this.min,this.max,this._getLabelCapacity(a)):wy(this,o.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:Ty(this._unit),this.initOffsets(r),t.reverse&&o.reverse(),Uu(this,o,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,i=0,r,a;this.options.offset&&t.length&&(r=this.getDecimalForValue(t[0]),t.length===1?e=1-r:e=(this.getDecimalForValue(t[1])-r)/2,a=this.getDecimalForValue(t[t.length-1]),t.length===1?i=a:i=(a-this.getDecimalForValue(t[t.length-2]))/2);const s=t.length<3?.5:.25;e=Zt(e,0,s),i=Zt(i,0,s),this._offsets={start:e,end:i,factor:1/(e+1+i)}}_generate(){const t=this._adapter,e=this.min,i=this.max,r=this.options,a=r.time,s=a.unit||Nu(a.minUnit,e,i,this._getLabelCapacity(e)),o=nt(r.ticks.stepSize,1),l=s==="week"?a.isoWeekday:!1,c=cn(l)||l===!0,u={};let d=e,f,g;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":s),t.diff(i,e,s)>1e5*o)throw new Error(e+" and "+i+" are too far apart with stepSize of "+o+" "+s);const p=r.ticks.source==="data"&&this.getDataTimestamps();for(f=d,g=0;f<i;f=+t.add(f,o,s),g++)Fu(u,f,p);return(f===i||r.bounds==="ticks"||g===1)&&Fu(u,f,p),Object.keys(u).sort(Lu).map(x=>+x)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const r=this.options.time.displayFormats,a=this._unit,s=e||r[a];return this._adapter.format(t,s)}_tickFormatFunction(t,e,i,r){const a=this.options,s=a.ticks.callback;if(s)return xt(s,[t,e,i],this);const o=a.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&o[l],d=c&&o[c],f=i[e],g=c&&d&&f&&f.major;return this._adapter.format(t,r||(g?d:u))}generateTickLabels(t){let e,i,r;for(e=0,i=t.length;e<i;++e)r=t[e],r.label=this._tickFormatFunction(r.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,i=this.ctx.measureText(t).width,r=qt(this.isHorizontal()?e.maxRotation:e.minRotation),a=Math.cos(r),s=Math.sin(r),o=this._resolveTickFontOptions(0).size;return{w:i*a+o*s,h:i*s+o*a}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,r=i[e.unit]||i.millisecond,a=this._tickFormatFunction(t,0,Uu(this,[t],this._majorUnit),r),s=this._getLabelSize(a),o=Math.floor(this.isHorizontal()?this.width/s.w:this.height/s.h)-1;return o>0?o:1}getDataTimestamps(){let t=this._cache.data||[],e,i;if(t.length)return t;const r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(e=0,i=r.length;e<i;++e)t=t.concat(r[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;const r=this.getLabels();for(e=0,i=r.length;e<i;++e)t.push(Iu(this,r[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Ul(t.sort(Lu))}}Y($i,"id","time"),Y($i,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function $r(n,t,e){let i=0,r=n.length-1,a,s,o,l;e?(t>=n[i].pos&&t<=n[r].pos&&({lo:i,hi:r}=je(n,"pos",t)),{pos:a,time:o}=n[i],{pos:s,time:l}=n[r]):(t>=n[i].time&&t<=n[r].time&&({lo:i,hi:r}=je(n,"time",t)),{time:a,pos:o}=n[i],{time:s,pos:l}=n[r]);const c=s-a;return c?o+(l-o)*(t-a)/c:o}class xs extends $i{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=$r(e,this.min),this._tableRange=$r(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,r=[],a=[];let s,o,l,c,u;for(s=0,o=t.length;s<o;++s)c=t[s],c>=e&&c<=i&&r.push(c);if(r.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(s=0,o=r.length;s<o;++s)u=r[s+1],l=r[s-1],c=r[s],Math.round((u+l)/2)!==c&&a.push({time:c,pos:s/(o-1)});return a}_generate(){const t=this.min,e=this.max;let i=super.getDataTimestamps();return(!i.includes(t)||!i.length)&&i.splice(0,0,t),(!i.includes(e)||i.length===1)&&i.push(e),i.sort((r,a)=>r-a)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return e.length&&i.length?t=this.normalize(e.concat(i)):t=e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return($r(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return $r(this._table,i*this._tableRange+this._minPos,!0)}}Y(xs,"id","timeseries"),Y(xs,"defaults",$i.defaults);var Sy=Object.freeze({__proto__:null,CategoryScale:ms,LinearScale:ys,LogarithmicScale:bs,RadialLinearScale:Hi,TimeScale:$i,TimeSeriesScale:xs});const My=[Ip,c0,ny,Sy],Cy=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],ky=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],Oy=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],Py=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],Bu=(n,t,e)=>{let i=n;return typeof t=="string"||Array.isArray(t)?i=n.toLocaleString(t,e):(t===!0||e!==void 0)&&(i=n.toLocaleString(void 0,e)),i};function _s(n,t){if(!Number.isFinite(n))throw new TypeError(`Expected a finite number, got ${typeof n}: ${n}`);t={bits:!1,binary:!1,space:!0,...t};const e=t.bits?t.binary?Py:Oy:t.binary?ky:Cy,i=t.space?" ":"";if(t.signed&&n===0)return` 0${i}${e[0]}`;const r=n<0,a=r?"-":t.signed?"+":"";r&&(n=-n);let s;if(t.minimumFractionDigits!==void 0&&(s={minimumFractionDigits:t.minimumFractionDigits}),t.maximumFractionDigits!==void 0&&(s={maximumFractionDigits:t.maximumFractionDigits,...s}),n<1){const u=Bu(n,t.locale,s);return a+u+i+e[0]}const o=Math.min(Math.floor(t.binary?Math.log(n)/Math.log(1024):Math.log10(n)/3),e.length-1);n/=(t.binary?1024:1e3)**o,s||(n=n.toPrecision(3));const l=Bu(Number(n),t.locale,s),c=e[o];return a+l+i+c}function Ge(n){"@babel/helpers - typeof";return Ge=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ge(n)}function At(n){if(n===null||n===!0||n===!1)return NaN;var t=Number(n);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function G(n,t){if(t.length<n)throw new TypeError(n+" argument"+(n>1?"s":"")+" required, but only "+t.length+" present")}function J(n){G(1,arguments);var t=Object.prototype.toString.call(n);return n instanceof Date||Ge(n)==="object"&&t==="[object Date]"?new Date(n.getTime()):typeof n=="number"||t==="[object Number]"?new Date(n):((typeof n=="string"||t==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function Wu(n,t){G(2,arguments);var e=J(n),i=At(t);return isNaN(i)?new Date(NaN):(i&&e.setDate(e.getDate()+i),e)}function ws(n,t){G(2,arguments);var e=J(n),i=At(t);if(isNaN(i))return new Date(NaN);if(!i)return e;var r=e.getDate(),a=new Date(e.getTime());a.setMonth(e.getMonth()+i+1,0);var s=a.getDate();return r>=s?a:(e.setFullYear(a.getFullYear(),a.getMonth(),r),e)}function ji(n,t){G(2,arguments);var e=J(n).getTime(),i=At(t);return new Date(e+i)}var Ey=36e5;function Ay(n,t){G(2,arguments);var e=At(t);return ji(n,e*Ey)}var Ry={};function mn(){return Ry}function Yu(n,t){var e,i,r,a,s,o,l,c;G(1,arguments);var u=mn(),d=At((e=(i=(r=(a=t==null?void 0:t.weekStartsOn)!==null&&a!==void 0?a:t==null||(s=t.locale)===null||s===void 0||(o=s.options)===null||o===void 0?void 0:o.weekStartsOn)!==null&&r!==void 0?r:u.weekStartsOn)!==null&&i!==void 0?i:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&e!==void 0?e:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=J(n),g=f.getDay(),p=(g<d?7:0)+g-d;return f.setDate(f.getDate()-p),f.setHours(0,0,0,0),f}function jr(n){var t=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return t.setUTCFullYear(n.getFullYear()),n.getTime()-t.getTime()}function Ts(n){G(1,arguments);var t=J(n);return t.setHours(0,0,0,0),t}var Ly=864e5;function Iy(n,t){G(2,arguments);var e=Ts(n),i=Ts(t),r=e.getTime()-jr(e),a=i.getTime()-jr(i);return Math.round((r-a)/Ly)}var Ny=6e4;function Fy(n,t){G(2,arguments);var e=At(t);return ji(n,e*Ny)}function Uy(n,t){G(2,arguments);var e=At(t),i=e*3;return ws(n,i)}function By(n,t){G(2,arguments);var e=At(t);return ji(n,e*1e3)}function Wy(n,t){G(2,arguments);var e=At(t),i=e*7;return Wu(n,i)}function Yy(n,t){G(2,arguments);var e=At(t);return ws(n,e*12)}function Vi(n,t){G(2,arguments);var e=J(n),i=J(t),r=e.getTime()-i.getTime();return r<0?-1:r>0?1:r}var Vr=6e4,qi=36e5,zy=1e3,Hy=3600;function $y(n){return G(1,arguments),n instanceof Date||Ge(n)==="object"&&Object.prototype.toString.call(n)==="[object Date]"}function Ds(n){if(G(1,arguments),!$y(n)&&typeof n!="number")return!1;var t=J(n);return!isNaN(Number(t))}function jy(n,t){G(2,arguments);var e=J(n),i=J(t),r=e.getFullYear()-i.getFullYear(),a=e.getMonth()-i.getMonth();return r*12+a}function Vy(n,t){G(2,arguments);var e=J(n),i=J(t);return e.getFullYear()-i.getFullYear()}function zu(n,t){var e=n.getFullYear()-t.getFullYear()||n.getMonth()-t.getMonth()||n.getDate()-t.getDate()||n.getHours()-t.getHours()||n.getMinutes()-t.getMinutes()||n.getSeconds()-t.getSeconds()||n.getMilliseconds()-t.getMilliseconds();return e<0?-1:e>0?1:e}function Hu(n,t){G(2,arguments);var e=J(n),i=J(t),r=zu(e,i),a=Math.abs(Iy(e,i));e.setDate(e.getDate()-r*a);var s=+(zu(e,i)===-r),o=r*(a-s);return o===0?0:o}function qr(n,t){return G(2,arguments),J(n).getTime()-J(t).getTime()}var $u={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(t){return t<0?Math.ceil(t):Math.floor(t)}},qy="trunc";function Xi(n){return n?$u[n]:$u[qy]}function Xy(n,t,e){G(2,arguments);var i=qr(n,t)/qi;return Xi(e==null?void 0:e.roundingMethod)(i)}function Gy(n,t,e){G(2,arguments);var i=qr(n,t)/Vr;return Xi(e==null?void 0:e.roundingMethod)(i)}function ju(n){G(1,arguments);var t=J(n);return t.setHours(23,59,59,999),t}function Vu(n){G(1,arguments);var t=J(n),e=t.getMonth();return t.setFullYear(t.getFullYear(),e+1,0),t.setHours(23,59,59,999),t}function Ky(n){G(1,arguments);var t=J(n);return ju(t).getTime()===Vu(t).getTime()}function qu(n,t){G(2,arguments);var e=J(n),i=J(t),r=Vi(e,i),a=Math.abs(jy(e,i)),s;if(a<1)s=0;else{e.getMonth()===1&&e.getDate()>27&&e.setDate(30),e.setMonth(e.getMonth()-r*a);var o=Vi(e,i)===-r;Ky(J(n))&&a===1&&Vi(n,i)===1&&(o=!1),s=r*(a-Number(o))}return s===0?0:s}function Zy(n,t,e){G(2,arguments);var i=qu(n,t)/3;return Xi(e==null?void 0:e.roundingMethod)(i)}function Qy(n,t,e){G(2,arguments);var i=qr(n,t)/1e3;return Xi(e==null?void 0:e.roundingMethod)(i)}function Jy(n,t,e){G(2,arguments);var i=Hu(n,t)/7;return Xi(e==null?void 0:e.roundingMethod)(i)}function tb(n,t){G(2,arguments);var e=J(n),i=J(t),r=Vi(e,i),a=Math.abs(Vy(e,i));e.setFullYear(1584),i.setFullYear(1584);var s=Vi(e,i)===-r,o=r*(a-Number(s));return o===0?0:o}function eb(n){G(1,arguments);var t=J(n);return t.setSeconds(0,0),t}function nb(n){G(1,arguments);var t=J(n),e=t.getMonth(),i=e-e%3;return t.setMonth(i,1),t.setHours(0,0,0,0),t}function ib(n){G(1,arguments);var t=J(n);return t.setDate(1),t.setHours(0,0,0,0),t}function rb(n){G(1,arguments);var t=J(n),e=t.getFullYear();return t.setFullYear(e+1,0,0),t.setHours(23,59,59,999),t}function ab(n){G(1,arguments);var t=J(n),e=new Date(0);return e.setFullYear(t.getFullYear(),0,1),e.setHours(0,0,0,0),e}function sb(n){G(1,arguments);var t=J(n);return t.setMinutes(59,59,999),t}function ob(n,t){var e,i,r,a,s,o,l,c;G(1,arguments);var u=mn(),d=At((e=(i=(r=(a=t==null?void 0:t.weekStartsOn)!==null&&a!==void 0?a:t==null||(s=t.locale)===null||s===void 0||(o=s.options)===null||o===void 0?void 0:o.weekStartsOn)!==null&&r!==void 0?r:u.weekStartsOn)!==null&&i!==void 0?i:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&e!==void 0?e:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=J(n),g=f.getDay(),p=(g<d?-7:0)+6-(g-d);return f.setDate(f.getDate()+p),f.setHours(23,59,59,999),f}function lb(n){G(1,arguments);var t=J(n);return t.setSeconds(59,999),t}function cb(n){G(1,arguments);var t=J(n),e=t.getMonth(),i=e-e%3+3;return t.setMonth(i,0),t.setHours(23,59,59,999),t}function ub(n){G(1,arguments);var t=J(n);return t.setMilliseconds(999),t}function Xu(n,t){G(2,arguments);var e=At(t);return ji(n,-e)}var db=864e5;function fb(n){G(1,arguments);var t=J(n),e=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var i=t.getTime(),r=e-i;return Math.floor(r/db)+1}function ei(n){G(1,arguments);var t=1,e=J(n),i=e.getUTCDay(),r=(i<t?7:0)+i-t;return e.setUTCDate(e.getUTCDate()-r),e.setUTCHours(0,0,0,0),e}function Gu(n){G(1,arguments);var t=J(n),e=t.getUTCFullYear(),i=new Date(0);i.setUTCFullYear(e+1,0,4),i.setUTCHours(0,0,0,0);var r=ei(i),a=new Date(0);a.setUTCFullYear(e,0,4),a.setUTCHours(0,0,0,0);var s=ei(a);return t.getTime()>=r.getTime()?e+1:t.getTime()>=s.getTime()?e:e-1}function hb(n){G(1,arguments);var t=Gu(n),e=new Date(0);e.setUTCFullYear(t,0,4),e.setUTCHours(0,0,0,0);var i=ei(e);return i}var gb=6048e5;function Ku(n){G(1,arguments);var t=J(n),e=ei(t).getTime()-hb(t).getTime();return Math.round(e/gb)+1}function In(n,t){var e,i,r,a,s,o,l,c;G(1,arguments);var u=mn(),d=At((e=(i=(r=(a=t==null?void 0:t.weekStartsOn)!==null&&a!==void 0?a:t==null||(s=t.locale)===null||s===void 0||(o=s.options)===null||o===void 0?void 0:o.weekStartsOn)!==null&&r!==void 0?r:u.weekStartsOn)!==null&&i!==void 0?i:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&e!==void 0?e:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=J(n),g=f.getUTCDay(),p=(g<d?7:0)+g-d;return f.setUTCDate(f.getUTCDate()-p),f.setUTCHours(0,0,0,0),f}function Ss(n,t){var e,i,r,a,s,o,l,c;G(1,arguments);var u=J(n),d=u.getUTCFullYear(),f=mn(),g=At((e=(i=(r=(a=t==null?void 0:t.firstWeekContainsDate)!==null&&a!==void 0?a:t==null||(s=t.locale)===null||s===void 0||(o=s.options)===null||o===void 0?void 0:o.firstWeekContainsDate)!==null&&r!==void 0?r:f.firstWeekContainsDate)!==null&&i!==void 0?i:(l=f.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&e!==void 0?e:1);if(!(g>=1&&g<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var p=new Date(0);p.setUTCFullYear(d+1,0,g),p.setUTCHours(0,0,0,0);var x=In(p,t),m=new Date(0);m.setUTCFullYear(d,0,g),m.setUTCHours(0,0,0,0);var v=In(m,t);return u.getTime()>=x.getTime()?d+1:u.getTime()>=v.getTime()?d:d-1}function pb(n,t){var e,i,r,a,s,o,l,c;G(1,arguments);var u=mn(),d=At((e=(i=(r=(a=t==null?void 0:t.firstWeekContainsDate)!==null&&a!==void 0?a:t==null||(s=t.locale)===null||s===void 0||(o=s.options)===null||o===void 0?void 0:o.firstWeekContainsDate)!==null&&r!==void 0?r:u.firstWeekContainsDate)!==null&&i!==void 0?i:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&e!==void 0?e:1),f=Ss(n,t),g=new Date(0);g.setUTCFullYear(f,0,d),g.setUTCHours(0,0,0,0);var p=In(g,t);return p}var mb=6048e5;function Zu(n,t){G(1,arguments);var e=J(n),i=In(e,t).getTime()-pb(e,t).getTime();return Math.round(i/mb)+1}function wt(n,t){for(var e=n<0?"-":"",i=Math.abs(n).toString();i.length<t;)i="0"+i;return e+i}var yb={y:function(t,e){var i=t.getUTCFullYear(),r=i>0?i:1-i;return wt(e==="yy"?r%100:r,e.length)},M:function(t,e){var i=t.getUTCMonth();return e==="M"?String(i+1):wt(i+1,2)},d:function(t,e){return wt(t.getUTCDate(),e.length)},a:function(t,e){var i=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return i.toUpperCase();case"aaa":return i;case"aaaaa":return i[0];case"aaaa":default:return i==="am"?"a.m.":"p.m."}},h:function(t,e){return wt(t.getUTCHours()%12||12,e.length)},H:function(t,e){return wt(t.getUTCHours(),e.length)},m:function(t,e){return wt(t.getUTCMinutes(),e.length)},s:function(t,e){return wt(t.getUTCSeconds(),e.length)},S:function(t,e){var i=e.length,r=t.getUTCMilliseconds(),a=Math.floor(r*Math.pow(10,i-3));return wt(a,e.length)}};const yn=yb;var ni={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},bb={G:function(t,e,i){var r=t.getUTCFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return i.era(r,{width:"abbreviated"});case"GGGGG":return i.era(r,{width:"narrow"});case"GGGG":default:return i.era(r,{width:"wide"})}},y:function(t,e,i){if(e==="yo"){var r=t.getUTCFullYear(),a=r>0?r:1-r;return i.ordinalNumber(a,{unit:"year"})}return yn.y(t,e)},Y:function(t,e,i,r){var a=Ss(t,r),s=a>0?a:1-a;if(e==="YY"){var o=s%100;return wt(o,2)}return e==="Yo"?i.ordinalNumber(s,{unit:"year"}):wt(s,e.length)},R:function(t,e){var i=Gu(t);return wt(i,e.length)},u:function(t,e){var i=t.getUTCFullYear();return wt(i,e.length)},Q:function(t,e,i){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return wt(r,2);case"Qo":return i.ordinalNumber(r,{unit:"quarter"});case"QQQ":return i.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return i.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return i.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,i){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return wt(r,2);case"qo":return i.ordinalNumber(r,{unit:"quarter"});case"qqq":return i.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return i.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return i.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,i){var r=t.getUTCMonth();switch(e){case"M":case"MM":return yn.M(t,e);case"Mo":return i.ordinalNumber(r+1,{unit:"month"});case"MMM":return i.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return i.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return i.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,i){var r=t.getUTCMonth();switch(e){case"L":return String(r+1);case"LL":return wt(r+1,2);case"Lo":return i.ordinalNumber(r+1,{unit:"month"});case"LLL":return i.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return i.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return i.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,i,r){var a=Zu(t,r);return e==="wo"?i.ordinalNumber(a,{unit:"week"}):wt(a,e.length)},I:function(t,e,i){var r=Ku(t);return e==="Io"?i.ordinalNumber(r,{unit:"week"}):wt(r,e.length)},d:function(t,e,i){return e==="do"?i.ordinalNumber(t.getUTCDate(),{unit:"date"}):yn.d(t,e)},D:function(t,e,i){var r=fb(t);return e==="Do"?i.ordinalNumber(r,{unit:"dayOfYear"}):wt(r,e.length)},E:function(t,e,i){var r=t.getUTCDay();switch(e){case"E":case"EE":case"EEE":return i.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return i.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return i.day(r,{width:"short",context:"formatting"});case"EEEE":default:return i.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,i,r){var a=t.getUTCDay(),s=(a-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(s);case"ee":return wt(s,2);case"eo":return i.ordinalNumber(s,{unit:"day"});case"eee":return i.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return i.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return i.day(a,{width:"short",context:"formatting"});case"eeee":default:return i.day(a,{width:"wide",context:"formatting"})}},c:function(t,e,i,r){var a=t.getUTCDay(),s=(a-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(s);case"cc":return wt(s,e.length);case"co":return i.ordinalNumber(s,{unit:"day"});case"ccc":return i.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return i.day(a,{width:"narrow",context:"standalone"});case"cccccc":return i.day(a,{width:"short",context:"standalone"});case"cccc":default:return i.day(a,{width:"wide",context:"standalone"})}},i:function(t,e,i){var r=t.getUTCDay(),a=r===0?7:r;switch(e){case"i":return String(a);case"ii":return wt(a,e.length);case"io":return i.ordinalNumber(a,{unit:"day"});case"iii":return i.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return i.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return i.day(r,{width:"short",context:"formatting"});case"iiii":default:return i.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,i){var r=t.getUTCHours(),a=r/12>=1?"pm":"am";switch(e){case"a":case"aa":return i.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return i.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return i.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return i.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(t,e,i){var r=t.getUTCHours(),a;switch(r===12?a=ni.noon:r===0?a=ni.midnight:a=r/12>=1?"pm":"am",e){case"b":case"bb":return i.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return i.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return i.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return i.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,e,i){var r=t.getUTCHours(),a;switch(r>=17?a=ni.evening:r>=12?a=ni.afternoon:r>=4?a=ni.morning:a=ni.night,e){case"B":case"BB":case"BBB":return i.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return i.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return i.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,e,i){if(e==="ho"){var r=t.getUTCHours()%12;return r===0&&(r=12),i.ordinalNumber(r,{unit:"hour"})}return yn.h(t,e)},H:function(t,e,i){return e==="Ho"?i.ordinalNumber(t.getUTCHours(),{unit:"hour"}):yn.H(t,e)},K:function(t,e,i){var r=t.getUTCHours()%12;return e==="Ko"?i.ordinalNumber(r,{unit:"hour"}):wt(r,e.length)},k:function(t,e,i){var r=t.getUTCHours();return r===0&&(r=24),e==="ko"?i.ordinalNumber(r,{unit:"hour"}):wt(r,e.length)},m:function(t,e,i){return e==="mo"?i.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):yn.m(t,e)},s:function(t,e,i){return e==="so"?i.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):yn.s(t,e)},S:function(t,e){return yn.S(t,e)},X:function(t,e,i,r){var a=r._originalDate||t,s=a.getTimezoneOffset();if(s===0)return"Z";switch(e){case"X":return Ju(s);case"XXXX":case"XX":return Nn(s);case"XXXXX":case"XXX":default:return Nn(s,":")}},x:function(t,e,i,r){var a=r._originalDate||t,s=a.getTimezoneOffset();switch(e){case"x":return Ju(s);case"xxxx":case"xx":return Nn(s);case"xxxxx":case"xxx":default:return Nn(s,":")}},O:function(t,e,i,r){var a=r._originalDate||t,s=a.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Qu(s,":");case"OOOO":default:return"GMT"+Nn(s,":")}},z:function(t,e,i,r){var a=r._originalDate||t,s=a.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Qu(s,":");case"zzzz":default:return"GMT"+Nn(s,":")}},t:function(t,e,i,r){var a=r._originalDate||t,s=Math.floor(a.getTime()/1e3);return wt(s,e.length)},T:function(t,e,i,r){var a=r._originalDate||t,s=a.getTime();return wt(s,e.length)}};function Qu(n,t){var e=n>0?"-":"+",i=Math.abs(n),r=Math.floor(i/60),a=i%60;if(a===0)return e+String(r);var s=t||"";return e+String(r)+s+wt(a,2)}function Ju(n,t){if(n%60===0){var e=n>0?"-":"+";return e+wt(Math.abs(n)/60,2)}return Nn(n,t)}function Nn(n,t){var e=t||"",i=n>0?"-":"+",r=Math.abs(n),a=wt(Math.floor(r/60),2),s=wt(r%60,2);return i+a+e+s}const vb=bb;var td=function(t,e){switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},ed=function(t,e){switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},xb=function(t,e){var i=t.match(/(P+)(p+)?/)||[],r=i[1],a=i[2];if(!a)return td(t,e);var s;switch(r){case"P":s=e.dateTime({width:"short"});break;case"PP":s=e.dateTime({width:"medium"});break;case"PPP":s=e.dateTime({width:"long"});break;case"PPPP":default:s=e.dateTime({width:"full"});break}return s.replace("{{date}}",td(r,e)).replace("{{time}}",ed(a,e))},_b={p:ed,P:xb};const Ms=_b;var wb=["D","DD"],Tb=["YY","YYYY"];function nd(n){return wb.indexOf(n)!==-1}function id(n){return Tb.indexOf(n)!==-1}function Xr(n,t,e){if(n==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var Db={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Sb=function(t,e,i){var r,a=Db[t];return typeof a=="string"?r=a:e===1?r=a.one:r=a.other.replace("{{count}}",e.toString()),i!=null&&i.addSuffix?i.comparison&&i.comparison>0?"in "+r:r+" ago":r};const Mb=Sb;function Cs(n){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=t.width?String(t.width):n.defaultWidth,i=n.formats[e]||n.formats[n.defaultWidth];return i}}var Cb={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},kb={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Ob={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Pb={date:Cs({formats:Cb,defaultWidth:"full"}),time:Cs({formats:kb,defaultWidth:"full"}),dateTime:Cs({formats:Ob,defaultWidth:"full"})};const Eb=Pb;var Ab={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Rb=function(t,e,i,r){return Ab[t]};const Lb=Rb;function Gi(n){return function(t,e){var i=e!=null&&e.context?String(e.context):"standalone",r;if(i==="formatting"&&n.formattingValues){var a=n.defaultFormattingWidth||n.defaultWidth,s=e!=null&&e.width?String(e.width):a;r=n.formattingValues[s]||n.formattingValues[a]}else{var o=n.defaultWidth,l=e!=null&&e.width?String(e.width):n.defaultWidth;r=n.values[l]||n.values[o]}var c=n.argumentCallback?n.argumentCallback(t):t;return r[c]}}var Ib={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Nb={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Fb={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Ub={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Bb={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Wb={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Yb=function(t,e){var i=Number(t),r=i%100;if(r>20||r<10)switch(r%10){case 1:return i+"st";case 2:return i+"nd";case 3:return i+"rd"}return i+"th"},zb={ordinalNumber:Yb,era:Gi({values:Ib,defaultWidth:"wide"}),quarter:Gi({values:Nb,defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:Gi({values:Fb,defaultWidth:"wide"}),day:Gi({values:Ub,defaultWidth:"wide"}),dayPeriod:Gi({values:Bb,defaultWidth:"wide",formattingValues:Wb,defaultFormattingWidth:"wide"})};const Hb=zb;function Ki(n){return function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=e.width,r=i&&n.matchPatterns[i]||n.matchPatterns[n.defaultMatchWidth],a=t.match(r);if(!a)return null;var s=a[0],o=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],l=Array.isArray(o)?jb(o,function(d){return d.test(s)}):$b(o,function(d){return d.test(s)}),c;c=n.valueCallback?n.valueCallback(l):l,c=e.valueCallback?e.valueCallback(c):c;var u=t.slice(s.length);return{value:c,rest:u}}}function $b(n,t){for(var e in n)if(n.hasOwnProperty(e)&&t(n[e]))return e}function jb(n,t){for(var e=0;e<n.length;e++)if(t(n[e]))return e}function Vb(n){return function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=t.match(n.matchPattern);if(!i)return null;var r=i[0],a=t.match(n.parsePattern);if(!a)return null;var s=n.valueCallback?n.valueCallback(a[0]):a[0];s=e.valueCallback?e.valueCallback(s):s;var o=t.slice(r.length);return{value:s,rest:o}}}var qb=/^(\d+)(th|st|nd|rd)?/i,Xb=/\d+/i,Gb={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Kb={any:[/^b/i,/^(a|c)/i]},Zb={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Qb={any:[/1/i,/2/i,/3/i,/4/i]},Jb={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},tv={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},ev={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},nv={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},iv={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},rv={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},av={ordinalNumber:Vb({matchPattern:qb,parsePattern:Xb,valueCallback:function(t){return parseInt(t,10)}}),era:Ki({matchPatterns:Gb,defaultMatchWidth:"wide",parsePatterns:Kb,defaultParseWidth:"any"}),quarter:Ki({matchPatterns:Zb,defaultMatchWidth:"wide",parsePatterns:Qb,defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:Ki({matchPatterns:Jb,defaultMatchWidth:"wide",parsePatterns:tv,defaultParseWidth:"any"}),day:Ki({matchPatterns:ev,defaultMatchWidth:"wide",parsePatterns:nv,defaultParseWidth:"any"}),dayPeriod:Ki({matchPatterns:iv,defaultMatchWidth:"any",parsePatterns:rv,defaultParseWidth:"any"})},sv={code:"en-US",formatDistance:Mb,formatLong:Eb,formatRelative:Lb,localize:Hb,match:av,options:{weekStartsOn:0,firstWeekContainsDate:1}};const rd=sv;var ov=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,lv=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,cv=/^'([^]*?)'?$/,uv=/''/g,dv=/[a-zA-Z]/;function fv(n,t,e){var i,r,a,s,o,l,c,u,d,f,g,p,x,m,v,b,_,w;G(2,arguments);var S=String(t),C=mn(),k=(i=(r=e==null?void 0:e.locale)!==null&&r!==void 0?r:C.locale)!==null&&i!==void 0?i:rd,T=At((a=(s=(o=(l=e==null?void 0:e.firstWeekContainsDate)!==null&&l!==void 0?l:e==null||(c=e.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&o!==void 0?o:C.firstWeekContainsDate)!==null&&s!==void 0?s:(d=C.locale)===null||d===void 0||(f=d.options)===null||f===void 0?void 0:f.firstWeekContainsDate)!==null&&a!==void 0?a:1);if(!(T>=1&&T<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var D=At((g=(p=(x=(m=e==null?void 0:e.weekStartsOn)!==null&&m!==void 0?m:e==null||(v=e.locale)===null||v===void 0||(b=v.options)===null||b===void 0?void 0:b.weekStartsOn)!==null&&x!==void 0?x:C.weekStartsOn)!==null&&p!==void 0?p:(_=C.locale)===null||_===void 0||(w=_.options)===null||w===void 0?void 0:w.weekStartsOn)!==null&&g!==void 0?g:0);if(!(D>=0&&D<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!k.localize)throw new RangeError("locale must contain localize property");if(!k.formatLong)throw new RangeError("locale must contain formatLong property");var O=J(n);if(!Ds(O))throw new RangeError("Invalid time value");var A=jr(O),R=Xu(O,A),W={firstWeekContainsDate:T,weekStartsOn:D,locale:k,_originalDate:O},V=S.match(lv).map(function(L){var H=L[0];if(H==="p"||H==="P"){var I=Ms[H];return I(L,k.formatLong)}return L}).join("").match(ov).map(function(L){if(L==="''")return"'";var H=L[0];if(H==="'")return hv(L);var I=vb[H];if(I)return!(e!=null&&e.useAdditionalWeekYearTokens)&&id(L)&&Xr(L,t,String(n)),!(e!=null&&e.useAdditionalDayOfYearTokens)&&nd(L)&&Xr(L,t,String(n)),I(R,L,k.localize,W);if(H.match(dv))throw new RangeError("Format string contains an unescaped latin alphabet character `"+H+"`");return L}).join("");return V}function hv(n){var t=n.match(cv);return t?t[1].replace(uv,"'"):n}function gv(n,t){if(n==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n}function ad(n,t){(t==null||t>n.length)&&(t=n.length);for(var e=0,i=new Array(t);e<t;e++)i[e]=n[e];return i}function pv(n,t){if(n){if(typeof n=="string")return ad(n,t);var e=Object.prototype.toString.call(n).slice(8,-1);if(e==="Object"&&n.constructor&&(e=n.constructor.name),e==="Map"||e==="Set")return Array.from(n);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return ad(n,t)}}function sd(n,t){var e=typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(!e){if(Array.isArray(n)||(e=pv(n))||t&&n&&typeof n.length=="number"){e&&(n=e);var i=0,r=function(){};return{s:r,n:function(){return i>=n.length?{done:!0}:{done:!1,value:n[i++]}},e:function(c){throw c},f:r}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
19
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,s=!1,o;return{s:function(){e=e.call(n)},n:function(){var c=e.next();return a=c.done,c},e:function(c){s=!0,o=c},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(s)throw o}}}}function q(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function ks(n,t){return ks=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,r){return i.__proto__=r,i},ks(n,t)}function pt(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),t&&ks(n,t)}function Gr(n){return Gr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Gr(n)}function mv(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function yv(n,t){if(t&&(Ge(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return q(n)}function mt(n){var t=mv();return function(){var i=Gr(n),r;if(t){var a=Gr(this).constructor;r=Reflect.construct(i,arguments,a)}else r=i.apply(this,arguments);return yv(this,r)}}function ft(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}function bv(n,t){if(Ge(n)!=="object"||n===null)return n;var e=n[Symbol.toPrimitive];if(e!==void 0){var i=e.call(n,t||"default");if(Ge(i)!=="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(n)}function od(n){var t=bv(n,"string");return Ge(t)==="symbol"?t:String(t)}function ld(n,t){for(var e=0;e<t.length;e++){var i=t[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,od(i.key),i)}}function ht(n,t,e){return t&&ld(n.prototype,t),e&&ld(n,e),Object.defineProperty(n,"prototype",{writable:!1}),n}function j(n,t,e){return t=od(t),t in n?Object.defineProperty(n,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[t]=e,n}var vv=10,cd=function(){function n(){ft(this,n),j(this,"priority",void 0),j(this,"subPriority",0)}return ht(n,[{key:"validate",value:function(e,i){return!0}}]),n}(),xv=function(n){pt(e,n);var t=mt(e);function e(i,r,a,s,o){var l;return ft(this,e),l=t.call(this),l.value=i,l.validateValue=r,l.setValue=a,l.priority=s,o&&(l.subPriority=o),l}return ht(e,[{key:"validate",value:function(r,a){return this.validateValue(r,this.value,a)}},{key:"set",value:function(r,a,s){return this.setValue(r,a,this.value,s)}}]),e}(cd),_v=function(n){pt(e,n);var t=mt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(q(i),"priority",vv),j(q(i),"subPriority",-1),i}return ht(e,[{key:"set",value:function(r,a){if(a.timestampIsSet)return r;var s=new Date(0);return s.setFullYear(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate()),s.setHours(r.getUTCHours(),r.getUTCMinutes(),r.getUTCSeconds(),r.getUTCMilliseconds()),s}}]),e}(cd),bt=function(){function n(){ft(this,n),j(this,"incompatibleTokens",void 0),j(this,"priority",void 0),j(this,"subPriority",void 0)}return ht(n,[{key:"run",value:function(e,i,r,a){var s=this.parse(e,i,r,a);return s?{setter:new xv(s.value,this.validate,this.set,this.priority,this.subPriority),rest:s.rest}:null}},{key:"validate",value:function(e,i,r){return!0}}]),n}(),wv=function(n){pt(e,n);var t=mt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(q(i),"priority",140),j(q(i),"incompatibleTokens",["R","u","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"G":case"GG":case"GGG":return s.era(r,{width:"abbreviated"})||s.era(r,{width:"narrow"});case"GGGGG":return s.era(r,{width:"narrow"});case"GGGG":default:return s.era(r,{width:"wide"})||s.era(r,{width:"abbreviated"})||s.era(r,{width:"narrow"})}}},{key:"set",value:function(r,a,s){return a.era=s,r.setUTCFullYear(s,0,1),r.setUTCHours(0,0,0,0),r}}]),e}(bt),jt={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},Fe={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function Vt(n,t){return n&&{value:t(n.value),rest:n.rest}}function Ut(n,t){var e=t.match(n);return e?{value:parseInt(e[0],10),rest:t.slice(e[0].length)}:null}function Ue(n,t){var e=t.match(n);if(!e)return null;if(e[0]==="Z")return{value:0,rest:t.slice(1)};var i=e[1]==="+"?1:-1,r=e[2]?parseInt(e[2],10):0,a=e[3]?parseInt(e[3],10):0,s=e[5]?parseInt(e[5],10):0;return{value:i*(r*qi+a*Vr+s*zy),rest:t.slice(e[0].length)}}function ud(n){return Ut(jt.anyDigitsSigned,n)}function $t(n,t){switch(n){case 1:return Ut(jt.singleDigit,t);case 2:return Ut(jt.twoDigits,t);case 3:return Ut(jt.threeDigits,t);case 4:return Ut(jt.fourDigits,t);default:return Ut(new RegExp("^\\d{1,"+n+"}"),t)}}function Kr(n,t){switch(n){case 1:return Ut(jt.singleDigitSigned,t);case 2:return Ut(jt.twoDigitsSigned,t);case 3:return Ut(jt.threeDigitsSigned,t);case 4:return Ut(jt.fourDigitsSigned,t);default:return Ut(new RegExp("^-?\\d{1,"+n+"}"),t)}}function Os(n){switch(n){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function dd(n,t){var e=t>0,i=e?t:1-t,r;if(i<=50)r=n||100;else{var a=i+50,s=Math.floor(a/100)*100,o=n>=a%100;r=n+s-(o?100:0)}return e?r:1-r}function fd(n){return n%400===0||n%4===0&&n%100!==0}var Tv=function(n){pt(e,n);var t=mt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(q(i),"priority",130),j(q(i),"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){var o=function(c){return{year:c,isTwoDigitYear:a==="yy"}};switch(a){case"y":return Vt($t(4,r),o);case"yo":return Vt(s.ordinalNumber(r,{unit:"year"}),o);default:return Vt($t(a.length,r),o)}}},{key:"validate",value:function(r,a){return a.isTwoDigitYear||a.year>0}},{key:"set",value:function(r,a,s){var o=r.getUTCFullYear();if(s.isTwoDigitYear){var l=dd(s.year,o);return r.setUTCFullYear(l,0,1),r.setUTCHours(0,0,0,0),r}var c=!("era"in a)||a.era===1?s.year:1-s.year;return r.setUTCFullYear(c,0,1),r.setUTCHours(0,0,0,0),r}}]),e}(bt),Dv=function(n){pt(e,n);var t=mt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(q(i),"priority",130),j(q(i),"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){var o=function(c){return{year:c,isTwoDigitYear:a==="YY"}};switch(a){case"Y":return Vt($t(4,r),o);case"Yo":return Vt(s.ordinalNumber(r,{unit:"year"}),o);default:return Vt($t(a.length,r),o)}}},{key:"validate",value:function(r,a){return a.isTwoDigitYear||a.year>0}},{key:"set",value:function(r,a,s,o){var l=Ss(r,o);if(s.isTwoDigitYear){var c=dd(s.year,l);return r.setUTCFullYear(c,0,o.firstWeekContainsDate),r.setUTCHours(0,0,0,0),In(r,o)}var u=!("era"in a)||a.era===1?s.year:1-s.year;return r.setUTCFullYear(u,0,o.firstWeekContainsDate),r.setUTCHours(0,0,0,0),In(r,o)}}]),e}(bt),Sv=function(n){pt(e,n);var t=mt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(q(i),"priority",130),j(q(i),"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a){return Kr(a==="R"?4:a.length,r)}},{key:"set",value:function(r,a,s){var o=new Date(0);return o.setUTCFullYear(s,0,4),o.setUTCHours(0,0,0,0),ei(o)}}]),e}(bt),Mv=function(n){pt(e,n);var t=mt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(q(i),"priority",130),j(q(i),"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a){return Kr(a==="u"?4:a.length,r)}},{key:"set",value:function(r,a,s){return r.setUTCFullYear(s,0,1),r.setUTCHours(0,0,0,0),r}}]),e}(bt),Cv=function(n){pt(e,n);var t=mt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(q(i),"priority",120),j(q(i),"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"Q":case"QQ":return $t(a.length,r);case"Qo":return s.ordinalNumber(r,{unit:"quarter"});case"QQQ":return s.quarter(r,{width:"abbreviated",context:"formatting"})||s.quarter(r,{width:"narrow",context:"formatting"});case"QQQQQ":return s.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return s.quarter(r,{width:"wide",context:"formatting"})||s.quarter(r,{width:"abbreviated",context:"formatting"})||s.quarter(r,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(r,a){return a>=1&&a<=4}},{key:"set",value:function(r,a,s){return r.setUTCMonth((s-1)*3,1),r.setUTCHours(0,0,0,0),r}}]),e}(bt),kv=function(n){pt(e,n);var t=mt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(q(i),"priority",120),j(q(i),"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"q":case"qq":return $t(a.length,r);case"qo":return s.ordinalNumber(r,{unit:"quarter"});case"qqq":return s.quarter(r,{width:"abbreviated",context:"standalone"})||s.quarter(r,{width:"narrow",context:"standalone"});case"qqqqq":return s.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return s.quarter(r,{width:"wide",context:"standalone"})||s.quarter(r,{width:"abbreviated",context:"standalone"})||s.quarter(r,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(r,a){return a>=1&&a<=4}},{key:"set",value:function(r,a,s){return r.setUTCMonth((s-1)*3,1),r.setUTCHours(0,0,0,0),r}}]),e}(bt),Ov=function(n){pt(e,n);var t=mt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(q(i),"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]),j(q(i),"priority",110),i}return ht(e,[{key:"parse",value:function(r,a,s){var o=function(c){return c-1};switch(a){case"M":return Vt(Ut(jt.month,r),o);case"MM":return Vt($t(2,r),o);case"Mo":return Vt(s.ordinalNumber(r,{unit:"month"}),o);case"MMM":return s.month(r,{width:"abbreviated",context:"formatting"})||s.month(r,{width:"narrow",context:"formatting"});case"MMMMM":return s.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return s.month(r,{width:"wide",context:"formatting"})||s.month(r,{width:"abbreviated",context:"formatting"})||s.month(r,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(r,a){return a>=0&&a<=11}},{key:"set",value:function(r,a,s){return r.setUTCMonth(s,1),r.setUTCHours(0,0,0,0),r}}]),e}(bt),Pv=function(n){pt(e,n);var t=mt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(q(i),"priority",110),j(q(i),"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){var o=function(c){return c-1};switch(a){case"L":return Vt(Ut(jt.month,r),o);case"LL":return Vt($t(2,r),o);case"Lo":return Vt(s.ordinalNumber(r,{unit:"month"}),o);case"LLL":return s.month(r,{width:"abbreviated",context:"standalone"})||s.month(r,{width:"narrow",context:"standalone"});case"LLLLL":return s.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return s.month(r,{width:"wide",context:"standalone"})||s.month(r,{width:"abbreviated",context:"standalone"})||s.month(r,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(r,a){return a>=0&&a<=11}},{key:"set",value:function(r,a,s){return r.setUTCMonth(s,1),r.setUTCHours(0,0,0,0),r}}]),e}(bt);function Ev(n,t,e){G(2,arguments);var i=J(n),r=At(t),a=Zu(i,e)-r;return i.setUTCDate(i.getUTCDate()-a*7),i}var Av=function(n){pt(e,n);var t=mt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(q(i),"priority",100),j(q(i),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"w":return Ut(jt.week,r);case"wo":return s.ordinalNumber(r,{unit:"week"});default:return $t(a.length,r)}}},{key:"validate",value:function(r,a){return a>=1&&a<=53}},{key:"set",value:function(r,a,s,o){return In(Ev(r,s,o),o)}}]),e}(bt);function Rv(n,t){G(2,arguments);var e=J(n),i=At(t),r=Ku(e)-i;return e.setUTCDate(e.getUTCDate()-r*7),e}var Lv=function(n){pt(e,n);var t=mt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(q(i),"priority",100),j(q(i),"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"I":return Ut(jt.week,r);case"Io":return s.ordinalNumber(r,{unit:"week"});default:return $t(a.length,r)}}},{key:"validate",value:function(r,a){return a>=1&&a<=53}},{key:"set",value:function(r,a,s){return ei(Rv(r,s))}}]),e}(bt),Iv=[31,28,31,30,31,30,31,31,30,31,30,31],Nv=[31,29,31,30,31,30,31,31,30,31,30,31],Fv=function(n){pt(e,n);var t=mt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(q(i),"priority",90),j(q(i),"subPriority",1),j(q(i),"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"d":return Ut(jt.date,r);case"do":return s.ordinalNumber(r,{unit:"date"});default:return $t(a.length,r)}}},{key:"validate",value:function(r,a){var s=r.getUTCFullYear(),o=fd(s),l=r.getUTCMonth();return o?a>=1&&a<=Nv[l]:a>=1&&a<=Iv[l]}},{key:"set",value:function(r,a,s){return r.setUTCDate(s),r.setUTCHours(0,0,0,0),r}}]),e}(bt),Uv=function(n){pt(e,n);var t=mt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(q(i),"priority",90),j(q(i),"subpriority",1),j(q(i),"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"D":case"DD":return Ut(jt.dayOfYear,r);case"Do":return s.ordinalNumber(r,{unit:"date"});default:return $t(a.length,r)}}},{key:"validate",value:function(r,a){var s=r.getUTCFullYear(),o=fd(s);return o?a>=1&&a<=366:a>=1&&a<=365}},{key:"set",value:function(r,a,s){return r.setUTCMonth(0,s),r.setUTCHours(0,0,0,0),r}}]),e}(bt);function Ps(n,t,e){var i,r,a,s,o,l,c,u;G(2,arguments);var d=mn(),f=At((i=(r=(a=(s=e==null?void 0:e.weekStartsOn)!==null&&s!==void 0?s:e==null||(o=e.locale)===null||o===void 0||(l=o.options)===null||l===void 0?void 0:l.weekStartsOn)!==null&&a!==void 0?a:d.weekStartsOn)!==null&&r!==void 0?r:(c=d.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&i!==void 0?i:0);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var g=J(n),p=At(t),x=g.getUTCDay(),m=p%7,v=(m+7)%7,b=(v<f?7:0)+p-x;return g.setUTCDate(g.getUTCDate()+b),g}var Bv=function(n){pt(e,n);var t=mt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(q(i),"priority",90),j(q(i),"incompatibleTokens",["D","i","e","c","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"E":case"EE":case"EEE":return s.day(r,{width:"abbreviated",context:"formatting"})||s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"});case"EEEEE":return s.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"});case"EEEE":default:return s.day(r,{width:"wide",context:"formatting"})||s.day(r,{width:"abbreviated",context:"formatting"})||s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(r,a){return a>=0&&a<=6}},{key:"set",value:function(r,a,s,o){return r=Ps(r,s,o),r.setUTCHours(0,0,0,0),r}}]),e}(bt),Wv=function(n){pt(e,n);var t=mt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(q(i),"priority",90),j(q(i),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s,o){var l=function(u){var d=Math.floor((u-1)/7)*7;return(u+o.weekStartsOn+6)%7+d};switch(a){case"e":case"ee":return Vt($t(a.length,r),l);case"eo":return Vt(s.ordinalNumber(r,{unit:"day"}),l);case"eee":return s.day(r,{width:"abbreviated",context:"formatting"})||s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"});case"eeeee":return s.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"});case"eeee":default:return s.day(r,{width:"wide",context:"formatting"})||s.day(r,{width:"abbreviated",context:"formatting"})||s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(r,a){return a>=0&&a<=6}},{key:"set",value:function(r,a,s,o){return r=Ps(r,s,o),r.setUTCHours(0,0,0,0),r}}]),e}(bt),Yv=function(n){pt(e,n);var t=mt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(q(i),"priority",90),j(q(i),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s,o){var l=function(u){var d=Math.floor((u-1)/7)*7;return(u+o.weekStartsOn+6)%7+d};switch(a){case"c":case"cc":return Vt($t(a.length,r),l);case"co":return Vt(s.ordinalNumber(r,{unit:"day"}),l);case"ccc":return s.day(r,{width:"abbreviated",context:"standalone"})||s.day(r,{width:"short",context:"standalone"})||s.day(r,{width:"narrow",context:"standalone"});case"ccccc":return s.day(r,{width:"narrow",context:"standalone"});case"cccccc":return s.day(r,{width:"short",context:"standalone"})||s.day(r,{width:"narrow",context:"standalone"});case"cccc":default:return s.day(r,{width:"wide",context:"standalone"})||s.day(r,{width:"abbreviated",context:"standalone"})||s.day(r,{width:"short",context:"standalone"})||s.day(r,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(r,a){return a>=0&&a<=6}},{key:"set",value:function(r,a,s,o){return r=Ps(r,s,o),r.setUTCHours(0,0,0,0),r}}]),e}(bt);function zv(n,t){G(2,arguments);var e=At(t);e%7===0&&(e=e-7);var i=1,r=J(n),a=r.getUTCDay(),s=e%7,o=(s+7)%7,l=(o<i?7:0)+e-a;return r.setUTCDate(r.getUTCDate()+l),r}var Hv=function(n){pt(e,n);var t=mt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(q(i),"priority",90),j(q(i),"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){var o=function(c){return c===0?7:c};switch(a){case"i":case"ii":return $t(a.length,r);case"io":return s.ordinalNumber(r,{unit:"day"});case"iii":return Vt(s.day(r,{width:"abbreviated",context:"formatting"})||s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"}),o);case"iiiii":return Vt(s.day(r,{width:"narrow",context:"formatting"}),o);case"iiiiii":return Vt(s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"}),o);case"iiii":default:return Vt(s.day(r,{width:"wide",context:"formatting"})||s.day(r,{width:"abbreviated",context:"formatting"})||s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"}),o)}}},{key:"validate",value:function(r,a){return a>=1&&a<=7}},{key:"set",value:function(r,a,s){return r=zv(r,s),r.setUTCHours(0,0,0,0),r}}]),e}(bt),$v=function(n){pt(e,n);var t=mt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(q(i),"priority",80),j(q(i),"incompatibleTokens",["b","B","H","k","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"a":case"aa":case"aaa":return s.dayPeriod(r,{width:"abbreviated",context:"formatting"})||s.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaaa":return s.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return s.dayPeriod(r,{width:"wide",context:"formatting"})||s.dayPeriod(r,{width:"abbreviated",context:"formatting"})||s.dayPeriod(r,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(r,a,s){return r.setUTCHours(Os(s),0,0,0),r}}]),e}(bt),jv=function(n){pt(e,n);var t=mt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(q(i),"priority",80),j(q(i),"incompatibleTokens",["a","B","H","k","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"b":case"bb":case"bbb":return s.dayPeriod(r,{width:"abbreviated",context:"formatting"})||s.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbbb":return s.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return s.dayPeriod(r,{width:"wide",context:"formatting"})||s.dayPeriod(r,{width:"abbreviated",context:"formatting"})||s.dayPeriod(r,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(r,a,s){return r.setUTCHours(Os(s),0,0,0),r}}]),e}(bt),Vv=function(n){pt(e,n);var t=mt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(q(i),"priority",80),j(q(i),"incompatibleTokens",["a","b","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"B":case"BB":case"BBB":return s.dayPeriod(r,{width:"abbreviated",context:"formatting"})||s.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBBB":return s.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return s.dayPeriod(r,{width:"wide",context:"formatting"})||s.dayPeriod(r,{width:"abbreviated",context:"formatting"})||s.dayPeriod(r,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(r,a,s){return r.setUTCHours(Os(s),0,0,0),r}}]),e}(bt),qv=function(n){pt(e,n);var t=mt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(q(i),"priority",70),j(q(i),"incompatibleTokens",["H","K","k","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"h":return Ut(jt.hour12h,r);case"ho":return s.ordinalNumber(r,{unit:"hour"});default:return $t(a.length,r)}}},{key:"validate",value:function(r,a){return a>=1&&a<=12}},{key:"set",value:function(r,a,s){var o=r.getUTCHours()>=12;return o&&s<12?r.setUTCHours(s+12,0,0,0):!o&&s===12?r.setUTCHours(0,0,0,0):r.setUTCHours(s,0,0,0),r}}]),e}(bt),Xv=function(n){pt(e,n);var t=mt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(q(i),"priority",70),j(q(i),"incompatibleTokens",["a","b","h","K","k","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"H":return Ut(jt.hour23h,r);case"Ho":return s.ordinalNumber(r,{unit:"hour"});default:return $t(a.length,r)}}},{key:"validate",value:function(r,a){return a>=0&&a<=23}},{key:"set",value:function(r,a,s){return r.setUTCHours(s,0,0,0),r}}]),e}(bt),Gv=function(n){pt(e,n);var t=mt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(q(i),"priority",70),j(q(i),"incompatibleTokens",["h","H","k","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"K":return Ut(jt.hour11h,r);case"Ko":return s.ordinalNumber(r,{unit:"hour"});default:return $t(a.length,r)}}},{key:"validate",value:function(r,a){return a>=0&&a<=11}},{key:"set",value:function(r,a,s){var o=r.getUTCHours()>=12;return o&&s<12?r.setUTCHours(s+12,0,0,0):r.setUTCHours(s,0,0,0),r}}]),e}(bt),Kv=function(n){pt(e,n);var t=mt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(q(i),"priority",70),j(q(i),"incompatibleTokens",["a","b","h","H","K","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"k":return Ut(jt.hour24h,r);case"ko":return s.ordinalNumber(r,{unit:"hour"});default:return $t(a.length,r)}}},{key:"validate",value:function(r,a){return a>=1&&a<=24}},{key:"set",value:function(r,a,s){var o=s<=24?s%24:s;return r.setUTCHours(o,0,0,0),r}}]),e}(bt),Zv=function(n){pt(e,n);var t=mt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(q(i),"priority",60),j(q(i),"incompatibleTokens",["t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"m":return Ut(jt.minute,r);case"mo":return s.ordinalNumber(r,{unit:"minute"});default:return $t(a.length,r)}}},{key:"validate",value:function(r,a){return a>=0&&a<=59}},{key:"set",value:function(r,a,s){return r.setUTCMinutes(s,0,0),r}}]),e}(bt),Qv=function(n){pt(e,n);var t=mt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(q(i),"priority",50),j(q(i),"incompatibleTokens",["t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"s":return Ut(jt.second,r);case"so":return s.ordinalNumber(r,{unit:"second"});default:return $t(a.length,r)}}},{key:"validate",value:function(r,a){return a>=0&&a<=59}},{key:"set",value:function(r,a,s){return r.setUTCSeconds(s,0),r}}]),e}(bt),Jv=function(n){pt(e,n);var t=mt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(q(i),"priority",30),j(q(i),"incompatibleTokens",["t","T"]),i}return ht(e,[{key:"parse",value:function(r,a){var s=function(l){return Math.floor(l*Math.pow(10,-a.length+3))};return Vt($t(a.length,r),s)}},{key:"set",value:function(r,a,s){return r.setUTCMilliseconds(s),r}}]),e}(bt),tx=function(n){pt(e,n);var t=mt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(q(i),"priority",10),j(q(i),"incompatibleTokens",["t","T","x"]),i}return ht(e,[{key:"parse",value:function(r,a){switch(a){case"X":return Ue(Fe.basicOptionalMinutes,r);case"XX":return Ue(Fe.basic,r);case"XXXX":return Ue(Fe.basicOptionalSeconds,r);case"XXXXX":return Ue(Fe.extendedOptionalSeconds,r);case"XXX":default:return Ue(Fe.extended,r)}}},{key:"set",value:function(r,a,s){return a.timestampIsSet?r:new Date(r.getTime()-s)}}]),e}(bt),ex=function(n){pt(e,n);var t=mt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(q(i),"priority",10),j(q(i),"incompatibleTokens",["t","T","X"]),i}return ht(e,[{key:"parse",value:function(r,a){switch(a){case"x":return Ue(Fe.basicOptionalMinutes,r);case"xx":return Ue(Fe.basic,r);case"xxxx":return Ue(Fe.basicOptionalSeconds,r);case"xxxxx":return Ue(Fe.extendedOptionalSeconds,r);case"xxx":default:return Ue(Fe.extended,r)}}},{key:"set",value:function(r,a,s){return a.timestampIsSet?r:new Date(r.getTime()-s)}}]),e}(bt),nx=function(n){pt(e,n);var t=mt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(q(i),"priority",40),j(q(i),"incompatibleTokens","*"),i}return ht(e,[{key:"parse",value:function(r){return ud(r)}},{key:"set",value:function(r,a,s){return[new Date(s*1e3),{timestampIsSet:!0}]}}]),e}(bt),ix=function(n){pt(e,n);var t=mt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(q(i),"priority",20),j(q(i),"incompatibleTokens","*"),i}return ht(e,[{key:"parse",value:function(r){return ud(r)}},{key:"set",value:function(r,a,s){return[new Date(s),{timestampIsSet:!0}]}}]),e}(bt),rx={G:new wv,y:new Tv,Y:new Dv,R:new Sv,u:new Mv,Q:new Cv,q:new kv,M:new Ov,L:new Pv,w:new Av,I:new Lv,d:new Fv,D:new Uv,E:new Bv,e:new Wv,c:new Yv,i:new Hv,a:new $v,b:new jv,B:new Vv,h:new qv,H:new Xv,K:new Gv,k:new Kv,m:new Zv,s:new Qv,S:new Jv,X:new tx,x:new ex,t:new nx,T:new ix},ax=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,sx=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ox=/^'([^]*?)'?$/,lx=/''/g,cx=/\S/,ux=/[a-zA-Z]/;function dx(n,t,e,i){var r,a,s,o,l,c,u,d,f,g,p,x,m,v,b,_,w,S;G(3,arguments);var C=String(n),k=String(t),T=mn(),D=(r=(a=i==null?void 0:i.locale)!==null&&a!==void 0?a:T.locale)!==null&&r!==void 0?r:rd;if(!D.match)throw new RangeError("locale must contain match property");var O=At((s=(o=(l=(c=i==null?void 0:i.firstWeekContainsDate)!==null&&c!==void 0?c:i==null||(u=i.locale)===null||u===void 0||(d=u.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&l!==void 0?l:T.firstWeekContainsDate)!==null&&o!==void 0?o:(f=T.locale)===null||f===void 0||(g=f.options)===null||g===void 0?void 0:g.firstWeekContainsDate)!==null&&s!==void 0?s:1);if(!(O>=1&&O<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var A=At((p=(x=(m=(v=i==null?void 0:i.weekStartsOn)!==null&&v!==void 0?v:i==null||(b=i.locale)===null||b===void 0||(_=b.options)===null||_===void 0?void 0:_.weekStartsOn)!==null&&m!==void 0?m:T.weekStartsOn)!==null&&x!==void 0?x:(w=T.locale)===null||w===void 0||(S=w.options)===null||S===void 0?void 0:S.weekStartsOn)!==null&&p!==void 0?p:0);if(!(A>=0&&A<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(k==="")return C===""?J(e):new Date(NaN);var R={firstWeekContainsDate:O,weekStartsOn:A,locale:D},W=[new _v],V=k.match(sx).map(function(B){var N=B[0];if(N in Ms){var tt=Ms[N];return tt(B,D.formatLong)}return B}).join("").match(ax),L=[],H=sd(V),I;try{var et=function(){var N=I.value;!(i!=null&&i.useAdditionalWeekYearTokens)&&id(N)&&Xr(N,k,n),!(i!=null&&i.useAdditionalDayOfYearTokens)&&nd(N)&&Xr(N,k,n);var tt=N[0],rt=rx[tt];if(rt){var Ct=rt.incompatibleTokens;if(Array.isArray(Ct)){var gt=L.find(function(Tt){return Ct.includes(Tt.token)||Tt.token===tt});if(gt)throw new RangeError("The format string mustn't contain `".concat(gt.fullToken,"` and `").concat(N,"` at the same time"))}else if(rt.incompatibleTokens==="*"&&L.length>0)throw new RangeError("The format string mustn't contain `".concat(N,"` and any other token at the same time"));L.push({token:tt,fullToken:N});var It=rt.run(C,N,D.match,R);if(!It)return{v:new Date(NaN)};W.push(It.setter),C=It.rest}else{if(tt.match(ux))throw new RangeError("Format string contains an unescaped latin alphabet character `"+tt+"`");if(N==="''"?N="'":tt==="'"&&(N=fx(N)),C.indexOf(N)===0)C=C.slice(N.length);else return{v:new Date(NaN)}}};for(H.s();!(I=H.n()).done;){var z=et();if(Ge(z)==="object")return z.v}}catch(B){H.e(B)}finally{H.f()}if(C.length>0&&cx.test(C))return new Date(NaN);var Mt=W.map(function(B){return B.priority}).sort(function(B,N){return N-B}).filter(function(B,N,tt){return tt.indexOf(B)===N}).map(function(B){return W.filter(function(N){return N.priority===B}).sort(function(N,tt){return tt.subPriority-N.subPriority})}).map(function(B){return B[0]}),F=J(e);if(isNaN(F.getTime()))return new Date(NaN);var E=Xu(F,jr(F)),$={},K=sd(Mt),X;try{for(K.s();!(X=K.n()).done;){var Q=X.value;if(!Q.validate(E,R))return new Date(NaN);var at=Q.set(E,$,R);Array.isArray(at)?(E=at[0],gv($,at[1])):E=at}}catch(B){K.e(B)}finally{K.f()}return E}function fx(n){return n.match(ox)[1].replace(lx,"'")}function hx(n){G(1,arguments);var t=J(n);return t.setMinutes(0,0,0),t}function gx(n){G(1,arguments);var t=J(n);return t.setMilliseconds(0),t}function px(n){G(1,arguments);var t=n/qi;return Math.floor(t)}function hd(n,t){var e;G(1,arguments);var i=At((e=t==null?void 0:t.additionalDigits)!==null&&e!==void 0?e:2);if(i!==2&&i!==1&&i!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(!(typeof n=="string"||Object.prototype.toString.call(n)==="[object String]"))return new Date(NaN);var r=vx(n),a;if(r.date){var s=xx(r.date,i);a=_x(s.restDateString,s.year)}if(!a||isNaN(a.getTime()))return new Date(NaN);var o=a.getTime(),l=0,c;if(r.time&&(l=wx(r.time),isNaN(l)))return new Date(NaN);if(r.timezone){if(c=Tx(r.timezone),isNaN(c))return new Date(NaN)}else{var u=new Date(o+l),d=new Date(0);return d.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),d.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),d}return new Date(o+l+c)}var Zr={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},mx=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,yx=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,bx=/^([+-])(\d{2})(?::?(\d{2}))?$/;function vx(n){var t={},e=n.split(Zr.dateTimeDelimiter),i;if(e.length>2)return t;if(/:/.test(e[0])?i=e[0]:(t.date=e[0],i=e[1],Zr.timeZoneDelimiter.test(t.date)&&(t.date=n.split(Zr.timeZoneDelimiter)[0],i=n.substr(t.date.length,n.length))),i){var r=Zr.timezone.exec(i);r?(t.time=i.replace(r[1],""),t.timezone=r[1]):t.time=i}return t}function xx(n,t){var e=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),i=n.match(e);if(!i)return{year:NaN,restDateString:""};var r=i[1]?parseInt(i[1]):null,a=i[2]?parseInt(i[2]):null;return{year:a===null?r:a*100,restDateString:n.slice((i[1]||i[2]).length)}}function _x(n,t){if(t===null)return new Date(NaN);var e=n.match(mx);if(!e)return new Date(NaN);var i=!!e[4],r=Zi(e[1]),a=Zi(e[2])-1,s=Zi(e[3]),o=Zi(e[4]),l=Zi(e[5])-1;if(i)return kx(t,o,l)?Dx(t,o,l):new Date(NaN);var c=new Date(0);return!Mx(t,a,s)||!Cx(t,r)?new Date(NaN):(c.setUTCFullYear(t,a,Math.max(r,s)),c)}function Zi(n){return n?parseInt(n):1}function wx(n){var t=n.match(yx);if(!t)return NaN;var e=Es(t[1]),i=Es(t[2]),r=Es(t[3]);return Ox(e,i,r)?e*qi+i*Vr+r*1e3:NaN}function Es(n){return n&&parseFloat(n.replace(",","."))||0}function Tx(n){if(n==="Z")return 0;var t=n.match(bx);if(!t)return 0;var e=t[1]==="+"?-1:1,i=parseInt(t[2]),r=t[3]&&parseInt(t[3])||0;return Px(i,r)?e*(i*qi+r*Vr):NaN}function Dx(n,t,e){var i=new Date(0);i.setUTCFullYear(n,0,4);var r=i.getUTCDay()||7,a=(t-1)*7+e+1-r;return i.setUTCDate(i.getUTCDate()+a),i}var Sx=[31,null,31,30,31,30,31,31,30,31,30,31];function gd(n){return n%400===0||n%4===0&&n%100!==0}function Mx(n,t,e){return t>=0&&t<=11&&e>=1&&e<=(Sx[t]||(gd(n)?29:28))}function Cx(n,t){return t>=1&&t<=(gd(n)?366:365)}function kx(n,t,e){return t>=1&&t<=53&&e>=0&&e<=6}function Ox(n,t,e){return n===24?t===0&&e===0:e>=0&&e<60&&t>=0&&t<60&&n>=0&&n<25}function Px(n,t){return t>=0&&t<=59}function Ex(n){G(1,arguments);var t=n/Hy;return Math.floor(t)}var ee=(n=>(n.DOUGHNUT="Doughnut",n.HORIZONTAL_BAR="HorizontalBar",n.VERTICAL_BAR="VerticalBar",n.TIMESERIES_LINE="Line",n.TIMESERIES_BAR="TimeSeriesBar",n))(ee||{}),Qr=(n=>(n.GAUGE="Gauge",n.TOPN="TopN",n))(Qr||{}),Bt=(n=>(n.Hidden="hidden",n.Right="right",n.Bottom="bottom",n))(Bt||{}),ii=(n=>(n.Hidden="hidden",n.SingleMetric="single",n.Full="full",n))(ii||{});const As=(n,t)=>{var r,a;const{tooltip:e}=t;if(e.opacity===0&&!n.locked){n.showTooltip=!1;return}const i=n.chartTooltipSortFn||((s,o)=>o.rawValue-s.rawValue);if(e.body&&!n.locked){const s=e.labelColors,o=((a=(r=t.chart.config)==null?void 0:r.options)==null?void 0:a.indexAxis)==="y"?"x":"y",l=[ee.HORIZONTAL_BAR,ee.VERTICAL_BAR].includes(n.chartType),c=[Qr.GAUGE,ee.DOUGHNUT].includes(n.chartType);n.tooltipContext=l?e.dataPoints.length>1?e.dataPoints[0].label:"":e.dataPoints[0].parsed.x,n.tooltipSeries=e.dataPoints.map((u,d)=>{const f=c?u.parsed:u.parsed[o];let g;if(n.units==="bytes")g=isNaN(f)?f:_s(f);else{const x=n.translateUnit(n.units,f);g=`${f%1===0?ta.format(f):ta.format(Number(f.toFixed(Nd)))} ${x}`}const p=l&&u.dataset.label!==u.label?u.dataset.label:c?u.dataset.labels[u.dataIndex]:u.dataset.label;return{backgroundColor:s[d].backgroundColor,borderColor:s[d].borderColor,label:p,value:g,rawValue:f}}).sort(i),n.left=`${e.x}px`,n.top=`${e.y}px`,n.showTooltip=!0}},Ax=n=>n&&n.datasets&&n.datasets.length,Rx=n=>Ax(n)&&n.datasets.some(t=>t.data.length),Lx=n=>Rx(n)&&n.datasets.some(t=>t.data.length>1),Ix=n=>Lx(n)&&n.datasets.some(t=>t.data[0]&&Ds(t.data[0].x)),Nx=n=>Ix(n)&&n.datasets.some(t=>t.data[0]&&t.data[0].x.toString().length>=13),Rs=(n,t,e)=>{const r=Math.min(t/1150,1),a=.15,s=1.15;return n.x<e?n.x+t*a*(1-r):n.x-t*s*(1-r)},Fx=(n,t,e)=>n.y<e?n.y+t*.15:n.y-t*.5;var ge=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Fn(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Ls={exports:{}},pd={exports:{}};(function(n){function t(e){return e&&e.__esModule?e:{default:e}}n.exports=t,n.exports.__esModule=!0,n.exports.default=n.exports})(pd);var Wt=pd.exports,Is={exports:{}},Ns={exports:{}},md={exports:{}};(function(n){function t(e){"@babel/helpers - typeof";return n.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},n.exports.__esModule=!0,n.exports.default=n.exports,t(e)}n.exports=t,n.exports.__esModule=!0,n.exports.default=n.exports})(md);var yd=md.exports,Fs={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(i,r){if(r.length<i)throw new TypeError(i+" argument"+(i>1?"s":"")+" required, but only "+r.length+" present")}n.exports=t.default})(Fs,Fs.exports);var ae=Fs.exports;(function(n,t){var e=Wt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var i=e(yd),r=e(ae);function a(s){return(0,r.default)(1,arguments),s instanceof Date||(0,i.default)(s)==="object"&&Object.prototype.toString.call(s)==="[object Date]"}n.exports=t.default})(Ns,Ns.exports);var Ux=Ns.exports,Us={exports:{}};(function(n,t){var e=Wt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var i=e(yd),r=e(ae);function a(s){(0,r.default)(1,arguments);var o=Object.prototype.toString.call(s);return s instanceof Date||(0,i.default)(s)==="object"&&o==="[object Date]"?new Date(s.getTime()):typeof s=="number"||o==="[object Number]"?new Date(s):((typeof s=="string"||o==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}n.exports=t.default})(Us,Us.exports);var Be=Us.exports;(function(n,t){var e=Wt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var i=e(Ux),r=e(Be),a=e(ae);function s(o){if((0,a.default)(1,arguments),!(0,i.default)(o)&&typeof o!="number")return!1;var l=(0,r.default)(o);return!isNaN(Number(l))}n.exports=t.default})(Is,Is.exports);var Bx=Is.exports,Bs={exports:{}},Ws={exports:{}},Ys={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(i){if(i===null||i===!0||i===!1)return NaN;var r=Number(i);return isNaN(r)?r:r<0?Math.ceil(r):Math.floor(r)}n.exports=t.default})(Ys,Ys.exports);var Un=Ys.exports;const Wx=Fn(Un);(function(n,t){var e=Wt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var i=e(Un),r=e(Be),a=e(ae);function s(o,l){(0,a.default)(2,arguments);var c=(0,r.default)(o).getTime(),u=(0,i.default)(l);return new Date(c+u)}n.exports=t.default})(Ws,Ws.exports);var Yx=Ws.exports;(function(n,t){var e=Wt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var i=e(Yx),r=e(ae),a=e(Un);function s(o,l){(0,r.default)(2,arguments);var c=(0,a.default)(l);return(0,i.default)(o,-c)}n.exports=t.default})(Bs,Bs.exports);var zx=Bs.exports,zs={exports:{}},Hs={exports:{}};(function(n,t){var e=Wt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var i=e(Be),r=e(ae),a=864e5;function s(o){(0,r.default)(1,arguments);var l=(0,i.default)(o),c=l.getTime();l.setUTCMonth(0,1),l.setUTCHours(0,0,0,0);var u=l.getTime(),d=c-u;return Math.floor(d/a)+1}n.exports=t.default})(Hs,Hs.exports);var Hx=Hs.exports,$s={exports:{}},js={exports:{}};(function(n,t){var e=Wt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var i=e(Be),r=e(ae);function a(s){(0,r.default)(1,arguments);var o=1,l=(0,i.default)(s),c=l.getUTCDay(),u=(c<o?7:0)+c-o;return l.setUTCDate(l.getUTCDate()-u),l.setUTCHours(0,0,0,0),l}n.exports=t.default})(js,js.exports);var Vs=js.exports,qs={exports:{}},Xs={exports:{}};(function(n,t){var e=Wt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var i=e(Be),r=e(ae),a=e(Vs);function s(o){(0,r.default)(1,arguments);var l=(0,i.default)(o),c=l.getUTCFullYear(),u=new Date(0);u.setUTCFullYear(c+1,0,4),u.setUTCHours(0,0,0,0);var d=(0,a.default)(u),f=new Date(0);f.setUTCFullYear(c,0,4),f.setUTCHours(0,0,0,0);var g=(0,a.default)(f);return l.getTime()>=d.getTime()?c+1:l.getTime()>=g.getTime()?c:c-1}n.exports=t.default})(Xs,Xs.exports);var bd=Xs.exports;(function(n,t){var e=Wt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var i=e(bd),r=e(Vs),a=e(ae);function s(o){(0,a.default)(1,arguments);var l=(0,i.default)(o),c=new Date(0);c.setUTCFullYear(l,0,4),c.setUTCHours(0,0,0,0);var u=(0,r.default)(c);return u}n.exports=t.default})(qs,qs.exports);var $x=qs.exports;(function(n,t){var e=Wt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var i=e(Be),r=e(Vs),a=e($x),s=e(ae),o=6048e5;function l(c){(0,s.default)(1,arguments);var u=(0,i.default)(c),d=(0,r.default)(u).getTime()-(0,a.default)(u).getTime();return Math.round(d/o)+1}n.exports=t.default})($s,$s.exports);var jx=$s.exports,Gs={exports:{}},Ks={exports:{}},Bn={};Object.defineProperty(Bn,"__esModule",{value:!0}),Bn.getDefaultOptions=Vx,Bn.setDefaultOptions=qx;var vd={};function Vx(){return vd}function qx(n){vd=n}(function(n,t){var e=Wt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var i=e(Be),r=e(ae),a=e(Un),s=Bn;function o(l,c){var u,d,f,g,p,x,m,v;(0,r.default)(1,arguments);var b=(0,s.getDefaultOptions)(),_=(0,a.default)((u=(d=(f=(g=c==null?void 0:c.weekStartsOn)!==null&&g!==void 0?g:c==null||(p=c.locale)===null||p===void 0||(x=p.options)===null||x===void 0?void 0:x.weekStartsOn)!==null&&f!==void 0?f:b.weekStartsOn)!==null&&d!==void 0?d:(m=b.locale)===null||m===void 0||(v=m.options)===null||v===void 0?void 0:v.weekStartsOn)!==null&&u!==void 0?u:0);if(!(_>=0&&_<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var w=(0,i.default)(l),S=w.getUTCDay(),C=(S<_?7:0)+S-_;return w.setUTCDate(w.getUTCDate()-C),w.setUTCHours(0,0,0,0),w}n.exports=t.default})(Ks,Ks.exports);var Zs=Ks.exports,Qs={exports:{}},Js={exports:{}};(function(n,t){var e=Wt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var i=e(Be),r=e(ae),a=e(Zs),s=e(Un),o=Bn;function l(c,u){var d,f,g,p,x,m,v,b;(0,r.default)(1,arguments);var _=(0,i.default)(c),w=_.getUTCFullYear(),S=(0,o.getDefaultOptions)(),C=(0,s.default)((d=(f=(g=(p=u==null?void 0:u.firstWeekContainsDate)!==null&&p!==void 0?p:u==null||(x=u.locale)===null||x===void 0||(m=x.options)===null||m===void 0?void 0:m.firstWeekContainsDate)!==null&&g!==void 0?g:S.firstWeekContainsDate)!==null&&f!==void 0?f:(v=S.locale)===null||v===void 0||(b=v.options)===null||b===void 0?void 0:b.firstWeekContainsDate)!==null&&d!==void 0?d:1);if(!(C>=1&&C<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var k=new Date(0);k.setUTCFullYear(w+1,0,C),k.setUTCHours(0,0,0,0);var T=(0,a.default)(k,u),D=new Date(0);D.setUTCFullYear(w,0,C),D.setUTCHours(0,0,0,0);var O=(0,a.default)(D,u);return _.getTime()>=T.getTime()?w+1:_.getTime()>=O.getTime()?w:w-1}n.exports=t.default})(Js,Js.exports);var xd=Js.exports;(function(n,t){var e=Wt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var i=e(xd),r=e(ae),a=e(Zs),s=e(Un),o=Bn;function l(c,u){var d,f,g,p,x,m,v,b;(0,r.default)(1,arguments);var _=(0,o.getDefaultOptions)(),w=(0,s.default)((d=(f=(g=(p=u==null?void 0:u.firstWeekContainsDate)!==null&&p!==void 0?p:u==null||(x=u.locale)===null||x===void 0||(m=x.options)===null||m===void 0?void 0:m.firstWeekContainsDate)!==null&&g!==void 0?g:_.firstWeekContainsDate)!==null&&f!==void 0?f:(v=_.locale)===null||v===void 0||(b=v.options)===null||b===void 0?void 0:b.firstWeekContainsDate)!==null&&d!==void 0?d:1),S=(0,i.default)(c,u),C=new Date(0);C.setUTCFullYear(S,0,w),C.setUTCHours(0,0,0,0);var k=(0,a.default)(C,u);return k}n.exports=t.default})(Qs,Qs.exports);var Xx=Qs.exports;(function(n,t){var e=Wt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var i=e(Be),r=e(Zs),a=e(Xx),s=e(ae),o=6048e5;function l(c,u){(0,s.default)(1,arguments);var d=(0,i.default)(c),f=(0,r.default)(d,u).getTime()-(0,a.default)(d,u).getTime();return Math.round(f/o)+1}n.exports=t.default})(Gs,Gs.exports);var Gx=Gs.exports,to={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(i,r){for(var a=i<0?"-":"",s=Math.abs(i).toString();s.length<r;)s="0"+s;return a+s}n.exports=t.default})(to,to.exports);var _d=to.exports,eo={exports:{}};(function(n,t){var e=Wt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=e(_d),r={y:function(o,l){var c=o.getUTCFullYear(),u=c>0?c:1-c;return(0,i.default)(l==="yy"?u%100:u,l.length)},M:function(o,l){var c=o.getUTCMonth();return l==="M"?String(c+1):(0,i.default)(c+1,2)},d:function(o,l){return(0,i.default)(o.getUTCDate(),l.length)},a:function(o,l){var c=o.getUTCHours()/12>=1?"pm":"am";switch(l){case"a":case"aa":return c.toUpperCase();case"aaa":return c;case"aaaaa":return c[0];case"aaaa":default:return c==="am"?"a.m.":"p.m."}},h:function(o,l){return(0,i.default)(o.getUTCHours()%12||12,l.length)},H:function(o,l){return(0,i.default)(o.getUTCHours(),l.length)},m:function(o,l){return(0,i.default)(o.getUTCMinutes(),l.length)},s:function(o,l){return(0,i.default)(o.getUTCSeconds(),l.length)},S:function(o,l){var c=l.length,u=o.getUTCMilliseconds(),d=Math.floor(u*Math.pow(10,c-3));return(0,i.default)(d,l.length)}},a=r;t.default=a,n.exports=t.default})(eo,eo.exports);var Kx=eo.exports;(function(n,t){var e=Wt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=e(Hx),r=e(jx),a=e(bd),s=e(Gx),o=e(xd),l=e(_d),c=e(Kx),u={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},d={G:function(v,b,_){var w=v.getUTCFullYear()>0?1:0;switch(b){case"G":case"GG":case"GGG":return _.era(w,{width:"abbreviated"});case"GGGGG":return _.era(w,{width:"narrow"});case"GGGG":default:return _.era(w,{width:"wide"})}},y:function(v,b,_){if(b==="yo"){var w=v.getUTCFullYear(),S=w>0?w:1-w;return _.ordinalNumber(S,{unit:"year"})}return c.default.y(v,b)},Y:function(v,b,_,w){var S=(0,o.default)(v,w),C=S>0?S:1-S;if(b==="YY"){var k=C%100;return(0,l.default)(k,2)}return b==="Yo"?_.ordinalNumber(C,{unit:"year"}):(0,l.default)(C,b.length)},R:function(v,b){var _=(0,a.default)(v);return(0,l.default)(_,b.length)},u:function(v,b){var _=v.getUTCFullYear();return(0,l.default)(_,b.length)},Q:function(v,b,_){var w=Math.ceil((v.getUTCMonth()+1)/3);switch(b){case"Q":return String(w);case"QQ":return(0,l.default)(w,2);case"Qo":return _.ordinalNumber(w,{unit:"quarter"});case"QQQ":return _.quarter(w,{width:"abbreviated",context:"formatting"});case"QQQQQ":return _.quarter(w,{width:"narrow",context:"formatting"});case"QQQQ":default:return _.quarter(w,{width:"wide",context:"formatting"})}},q:function(v,b,_){var w=Math.ceil((v.getUTCMonth()+1)/3);switch(b){case"q":return String(w);case"qq":return(0,l.default)(w,2);case"qo":return _.ordinalNumber(w,{unit:"quarter"});case"qqq":return _.quarter(w,{width:"abbreviated",context:"standalone"});case"qqqqq":return _.quarter(w,{width:"narrow",context:"standalone"});case"qqqq":default:return _.quarter(w,{width:"wide",context:"standalone"})}},M:function(v,b,_){var w=v.getUTCMonth();switch(b){case"M":case"MM":return c.default.M(v,b);case"Mo":return _.ordinalNumber(w+1,{unit:"month"});case"MMM":return _.month(w,{width:"abbreviated",context:"formatting"});case"MMMMM":return _.month(w,{width:"narrow",context:"formatting"});case"MMMM":default:return _.month(w,{width:"wide",context:"formatting"})}},L:function(v,b,_){var w=v.getUTCMonth();switch(b){case"L":return String(w+1);case"LL":return(0,l.default)(w+1,2);case"Lo":return _.ordinalNumber(w+1,{unit:"month"});case"LLL":return _.month(w,{width:"abbreviated",context:"standalone"});case"LLLLL":return _.month(w,{width:"narrow",context:"standalone"});case"LLLL":default:return _.month(w,{width:"wide",context:"standalone"})}},w:function(v,b,_,w){var S=(0,s.default)(v,w);return b==="wo"?_.ordinalNumber(S,{unit:"week"}):(0,l.default)(S,b.length)},I:function(v,b,_){var w=(0,r.default)(v);return b==="Io"?_.ordinalNumber(w,{unit:"week"}):(0,l.default)(w,b.length)},d:function(v,b,_){return b==="do"?_.ordinalNumber(v.getUTCDate(),{unit:"date"}):c.default.d(v,b)},D:function(v,b,_){var w=(0,i.default)(v);return b==="Do"?_.ordinalNumber(w,{unit:"dayOfYear"}):(0,l.default)(w,b.length)},E:function(v,b,_){var w=v.getUTCDay();switch(b){case"E":case"EE":case"EEE":return _.day(w,{width:"abbreviated",context:"formatting"});case"EEEEE":return _.day(w,{width:"narrow",context:"formatting"});case"EEEEEE":return _.day(w,{width:"short",context:"formatting"});case"EEEE":default:return _.day(w,{width:"wide",context:"formatting"})}},e:function(v,b,_,w){var S=v.getUTCDay(),C=(S-w.weekStartsOn+8)%7||7;switch(b){case"e":return String(C);case"ee":return(0,l.default)(C,2);case"eo":return _.ordinalNumber(C,{unit:"day"});case"eee":return _.day(S,{width:"abbreviated",context:"formatting"});case"eeeee":return _.day(S,{width:"narrow",context:"formatting"});case"eeeeee":return _.day(S,{width:"short",context:"formatting"});case"eeee":default:return _.day(S,{width:"wide",context:"formatting"})}},c:function(v,b,_,w){var S=v.getUTCDay(),C=(S-w.weekStartsOn+8)%7||7;switch(b){case"c":return String(C);case"cc":return(0,l.default)(C,b.length);case"co":return _.ordinalNumber(C,{unit:"day"});case"ccc":return _.day(S,{width:"abbreviated",context:"standalone"});case"ccccc":return _.day(S,{width:"narrow",context:"standalone"});case"cccccc":return _.day(S,{width:"short",context:"standalone"});case"cccc":default:return _.day(S,{width:"wide",context:"standalone"})}},i:function(v,b,_){var w=v.getUTCDay(),S=w===0?7:w;switch(b){case"i":return String(S);case"ii":return(0,l.default)(S,b.length);case"io":return _.ordinalNumber(S,{unit:"day"});case"iii":return _.day(w,{width:"abbreviated",context:"formatting"});case"iiiii":return _.day(w,{width:"narrow",context:"formatting"});case"iiiiii":return _.day(w,{width:"short",context:"formatting"});case"iiii":default:return _.day(w,{width:"wide",context:"formatting"})}},a:function(v,b,_){var w=v.getUTCHours(),S=w/12>=1?"pm":"am";switch(b){case"a":case"aa":return _.dayPeriod(S,{width:"abbreviated",context:"formatting"});case"aaa":return _.dayPeriod(S,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return _.dayPeriod(S,{width:"narrow",context:"formatting"});case"aaaa":default:return _.dayPeriod(S,{width:"wide",context:"formatting"})}},b:function(v,b,_){var w=v.getUTCHours(),S;switch(w===12?S=u.noon:w===0?S=u.midnight:S=w/12>=1?"pm":"am",b){case"b":case"bb":return _.dayPeriod(S,{width:"abbreviated",context:"formatting"});case"bbb":return _.dayPeriod(S,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return _.dayPeriod(S,{width:"narrow",context:"formatting"});case"bbbb":default:return _.dayPeriod(S,{width:"wide",context:"formatting"})}},B:function(v,b,_){var w=v.getUTCHours(),S;switch(w>=17?S=u.evening:w>=12?S=u.afternoon:w>=4?S=u.morning:S=u.night,b){case"B":case"BB":case"BBB":return _.dayPeriod(S,{width:"abbreviated",context:"formatting"});case"BBBBB":return _.dayPeriod(S,{width:"narrow",context:"formatting"});case"BBBB":default:return _.dayPeriod(S,{width:"wide",context:"formatting"})}},h:function(v,b,_){if(b==="ho"){var w=v.getUTCHours()%12;return w===0&&(w=12),_.ordinalNumber(w,{unit:"hour"})}return c.default.h(v,b)},H:function(v,b,_){return b==="Ho"?_.ordinalNumber(v.getUTCHours(),{unit:"hour"}):c.default.H(v,b)},K:function(v,b,_){var w=v.getUTCHours()%12;return b==="Ko"?_.ordinalNumber(w,{unit:"hour"}):(0,l.default)(w,b.length)},k:function(v,b,_){var w=v.getUTCHours();return w===0&&(w=24),b==="ko"?_.ordinalNumber(w,{unit:"hour"}):(0,l.default)(w,b.length)},m:function(v,b,_){return b==="mo"?_.ordinalNumber(v.getUTCMinutes(),{unit:"minute"}):c.default.m(v,b)},s:function(v,b,_){return b==="so"?_.ordinalNumber(v.getUTCSeconds(),{unit:"second"}):c.default.s(v,b)},S:function(v,b){return c.default.S(v,b)},X:function(v,b,_,w){var S=w._originalDate||v,C=S.getTimezoneOffset();if(C===0)return"Z";switch(b){case"X":return g(C);case"XXXX":case"XX":return p(C);case"XXXXX":case"XXX":default:return p(C,":")}},x:function(v,b,_,w){var S=w._originalDate||v,C=S.getTimezoneOffset();switch(b){case"x":return g(C);case"xxxx":case"xx":return p(C);case"xxxxx":case"xxx":default:return p(C,":")}},O:function(v,b,_,w){var S=w._originalDate||v,C=S.getTimezoneOffset();switch(b){case"O":case"OO":case"OOO":return"GMT"+f(C,":");case"OOOO":default:return"GMT"+p(C,":")}},z:function(v,b,_,w){var S=w._originalDate||v,C=S.getTimezoneOffset();switch(b){case"z":case"zz":case"zzz":return"GMT"+f(C,":");case"zzzz":default:return"GMT"+p(C,":")}},t:function(v,b,_,w){var S=w._originalDate||v,C=Math.floor(S.getTime()/1e3);return(0,l.default)(C,b.length)},T:function(v,b,_,w){var S=w._originalDate||v,C=S.getTime();return(0,l.default)(C,b.length)}};function f(m,v){var b=m>0?"-":"+",_=Math.abs(m),w=Math.floor(_/60),S=_%60;if(S===0)return b+String(w);var C=v||"";return b+String(w)+C+(0,l.default)(S,2)}function g(m,v){if(m%60===0){var b=m>0?"-":"+";return b+(0,l.default)(Math.abs(m)/60,2)}return p(m,v)}function p(m,v){var b=v||"",_=m>0?"-":"+",w=Math.abs(m),S=(0,l.default)(Math.floor(w/60),2),C=(0,l.default)(w%60,2);return _+S+b+C}var x=d;t.default=x,n.exports=t.default})(zs,zs.exports);var Zx=zs.exports,no={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=function(l,c){switch(l){case"P":return c.date({width:"short"});case"PP":return c.date({width:"medium"});case"PPP":return c.date({width:"long"});case"PPPP":default:return c.date({width:"full"})}},i=function(l,c){switch(l){case"p":return c.time({width:"short"});case"pp":return c.time({width:"medium"});case"ppp":return c.time({width:"long"});case"pppp":default:return c.time({width:"full"})}},r=function(l,c){var u=l.match(/(P+)(p+)?/)||[],d=u[1],f=u[2];if(!f)return e(l,c);var g;switch(d){case"P":g=c.dateTime({width:"short"});break;case"PP":g=c.dateTime({width:"medium"});break;case"PPP":g=c.dateTime({width:"long"});break;case"PPPP":default:g=c.dateTime({width:"full"});break}return g.replace("{{date}}",e(d,c)).replace("{{time}}",i(f,c))},a={p:i,P:r},s=a;t.default=s,n.exports=t.default})(no,no.exports);var Qx=no.exports,io={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(i){var r=new Date(Date.UTC(i.getFullYear(),i.getMonth(),i.getDate(),i.getHours(),i.getMinutes(),i.getSeconds(),i.getMilliseconds()));return r.setUTCFullYear(i.getFullYear()),i.getTime()-r.getTime()}n.exports=t.default})(io,io.exports);var wd=io.exports;const Td=Fn(wd);var Qi={};Object.defineProperty(Qi,"__esModule",{value:!0}),Qi.isProtectedDayOfYearToken=e_,Qi.isProtectedWeekYearToken=n_,Qi.throwProtectedError=i_;var Jx=["D","DD"],t_=["YY","YYYY"];function e_(n){return Jx.indexOf(n)!==-1}function n_(n){return t_.indexOf(n)!==-1}function i_(n,t,e){if(n==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var ro={exports:{}},ao={exports:{}},so={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},i=function(s,o,l){var c,u=e[s];return typeof u=="string"?c=u:o===1?c=u.one:c=u.other.replace("{{count}}",o.toString()),l!=null&&l.addSuffix?l.comparison&&l.comparison>0?"in "+c:c+" ago":c},r=i;t.default=r,n.exports=t.default})(so,so.exports);var r_=so.exports,oo={exports:{}},lo={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(i){return function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=r.width?String(r.width):i.defaultWidth,s=i.formats[a]||i.formats[i.defaultWidth];return s}}n.exports=t.default})(lo,lo.exports);var a_=lo.exports;(function(n,t){var e=Wt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=e(a_),r={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},a={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},s={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},o={date:(0,i.default)({formats:r,defaultWidth:"full"}),time:(0,i.default)({formats:a,defaultWidth:"full"}),dateTime:(0,i.default)({formats:s,defaultWidth:"full"})},l=o;t.default=l,n.exports=t.default})(oo,oo.exports);var s_=oo.exports,co={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},i=function(s,o,l,c){return e[s]},r=i;t.default=r,n.exports=t.default})(co,co.exports);var o_=co.exports,uo={exports:{}},fo={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(i){return function(r,a){var s=a!=null&&a.context?String(a.context):"standalone",o;if(s==="formatting"&&i.formattingValues){var l=i.defaultFormattingWidth||i.defaultWidth,c=a!=null&&a.width?String(a.width):l;o=i.formattingValues[c]||i.formattingValues[l]}else{var u=i.defaultWidth,d=a!=null&&a.width?String(a.width):i.defaultWidth;o=i.values[d]||i.values[u]}var f=i.argumentCallback?i.argumentCallback(r):r;return o[f]}}n.exports=t.default})(fo,fo.exports);var l_=fo.exports;(function(n,t){var e=Wt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=e(l_),r={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},a={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},s={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},o={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},l={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},c={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},u=function(p,x){var m=Number(p),v=m%100;if(v>20||v<10)switch(v%10){case 1:return m+"st";case 2:return m+"nd";case 3:return m+"rd"}return m+"th"},d={ordinalNumber:u,era:(0,i.default)({values:r,defaultWidth:"wide"}),quarter:(0,i.default)({values:a,defaultWidth:"wide",argumentCallback:function(p){return p-1}}),month:(0,i.default)({values:s,defaultWidth:"wide"}),day:(0,i.default)({values:o,defaultWidth:"wide"}),dayPeriod:(0,i.default)({values:l,defaultWidth:"wide",formattingValues:c,defaultFormattingWidth:"wide"})},f=d;t.default=f,n.exports=t.default})(uo,uo.exports);var c_=uo.exports,ho={exports:{}},go={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(a){return function(s){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=o.width,c=l&&a.matchPatterns[l]||a.matchPatterns[a.defaultMatchWidth],u=s.match(c);if(!u)return null;var d=u[0],f=l&&a.parsePatterns[l]||a.parsePatterns[a.defaultParseWidth],g=Array.isArray(f)?r(f,function(m){return m.test(d)}):i(f,function(m){return m.test(d)}),p;p=a.valueCallback?a.valueCallback(g):g,p=o.valueCallback?o.valueCallback(p):p;var x=s.slice(d.length);return{value:p,rest:x}}}function i(a,s){for(var o in a)if(a.hasOwnProperty(o)&&s(a[o]))return o}function r(a,s){for(var o=0;o<a.length;o++)if(s(a[o]))return o}n.exports=t.default})(go,go.exports);var u_=go.exports,po={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(i){return function(r){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=r.match(i.matchPattern);if(!s)return null;var o=s[0],l=r.match(i.parsePattern);if(!l)return null;var c=i.valueCallback?i.valueCallback(l[0]):l[0];c=a.valueCallback?a.valueCallback(c):c;var u=r.slice(o.length);return{value:c,rest:u}}}n.exports=t.default})(po,po.exports);var d_=po.exports;(function(n,t){var e=Wt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=e(u_),r=e(d_),a=/^(\d+)(th|st|nd|rd)?/i,s=/\d+/i,o={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},l={any:[/^b/i,/^(a|c)/i]},c={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},u={any:[/1/i,/2/i,/3/i,/4/i]},d={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},f={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},g={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},p={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},x={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},m={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},v={ordinalNumber:(0,r.default)({matchPattern:a,parsePattern:s,valueCallback:function(w){return parseInt(w,10)}}),era:(0,i.default)({matchPatterns:o,defaultMatchWidth:"wide",parsePatterns:l,defaultParseWidth:"any"}),quarter:(0,i.default)({matchPatterns:c,defaultMatchWidth:"wide",parsePatterns:u,defaultParseWidth:"any",valueCallback:function(w){return w+1}}),month:(0,i.default)({matchPatterns:d,defaultMatchWidth:"wide",parsePatterns:f,defaultParseWidth:"any"}),day:(0,i.default)({matchPatterns:g,defaultMatchWidth:"wide",parsePatterns:p,defaultParseWidth:"any"}),dayPeriod:(0,i.default)({matchPatterns:x,defaultMatchWidth:"any",parsePatterns:m,defaultParseWidth:"any"})},b=v;t.default=b,n.exports=t.default})(ho,ho.exports);var f_=ho.exports;(function(n,t){var e=Wt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=e(r_),r=e(s_),a=e(o_),s=e(c_),o=e(f_),l={code:"en-US",formatDistance:i.default,formatLong:r.default,formatRelative:a.default,localize:s.default,match:o.default,options:{weekStartsOn:0,firstWeekContainsDate:1}},c=l;t.default=c,n.exports=t.default})(ao,ao.exports);var h_=ao.exports;(function(n,t){var e=Wt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=e(h_),r=i.default;t.default=r,n.exports=t.default})(ro,ro.exports);var g_=ro.exports;(function(n,t){var e=Wt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=_;var i=e(Bx),r=e(zx),a=e(Be),s=e(Zx),o=e(Qx),l=e(wd),c=Qi,u=e(Un),d=e(ae),f=Bn,g=e(g_),p=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,x=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,m=/^'([^]*?)'?$/,v=/''/g,b=/[a-zA-Z]/;function _(S,C,k){var T,D,O,A,R,W,V,L,H,I,et,z,Mt,F,E,$,K,X;(0,d.default)(2,arguments);var Q=String(C),at=(0,f.getDefaultOptions)(),B=(T=(D=k==null?void 0:k.locale)!==null&&D!==void 0?D:at.locale)!==null&&T!==void 0?T:g.default,N=(0,u.default)((O=(A=(R=(W=k==null?void 0:k.firstWeekContainsDate)!==null&&W!==void 0?W:k==null||(V=k.locale)===null||V===void 0||(L=V.options)===null||L===void 0?void 0:L.firstWeekContainsDate)!==null&&R!==void 0?R:at.firstWeekContainsDate)!==null&&A!==void 0?A:(H=at.locale)===null||H===void 0||(I=H.options)===null||I===void 0?void 0:I.firstWeekContainsDate)!==null&&O!==void 0?O:1);if(!(N>=1&&N<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var tt=(0,u.default)((et=(z=(Mt=(F=k==null?void 0:k.weekStartsOn)!==null&&F!==void 0?F:k==null||(E=k.locale)===null||E===void 0||($=E.options)===null||$===void 0?void 0:$.weekStartsOn)!==null&&Mt!==void 0?Mt:at.weekStartsOn)!==null&&z!==void 0?z:(K=at.locale)===null||K===void 0||(X=K.options)===null||X===void 0?void 0:X.weekStartsOn)!==null&&et!==void 0?et:0);if(!(tt>=0&&tt<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!B.localize)throw new RangeError("locale must contain localize property");if(!B.formatLong)throw new RangeError("locale must contain formatLong property");var rt=(0,a.default)(S);if(!(0,i.default)(rt))throw new RangeError("Invalid time value");var Ct=(0,l.default)(rt),gt=(0,r.default)(rt,Ct),It={firstWeekContainsDate:N,weekStartsOn:tt,locale:B,_originalDate:rt},Tt=Q.match(x).map(function(lt){var zt=lt[0];if(zt==="p"||zt==="P"){var Gt=o.default[zt];return Gt(lt,B.formatLong)}return lt}).join("").match(p).map(function(lt){if(lt==="''")return"'";var zt=lt[0];if(zt==="'")return w(lt);var Gt=s.default[zt];if(Gt)return!(k!=null&&k.useAdditionalWeekYearTokens)&&(0,c.isProtectedWeekYearToken)(lt)&&(0,c.throwProtectedError)(lt,C,String(S)),!(k!=null&&k.useAdditionalDayOfYearTokens)&&(0,c.isProtectedDayOfYearToken)(lt)&&(0,c.throwProtectedError)(lt,C,String(S)),Gt(gt,lt,B.localize,It);if(zt.match(b))throw new RangeError("Format string contains an unescaped latin alphabet character `"+zt+"`");return lt}).join("");return Tt}function w(S){var C=S.match(m);return C?C[1].replace(v,"'"):S}n.exports=t.default})(Ls,Ls.exports);var p_=Ls.exports;const m_=Fn(p_);function Dd(n,t,e){var i=v_(n,e.timeZone,e.locale);return i.formatToParts?y_(i,t):b_(i,t)}function y_(n,t){for(var e=n.formatToParts(t),i=e.length-1;i>=0;--i)if(e[i].type==="timeZoneName")return e[i].value}function b_(n,t){var e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function v_(n,t,e){if(e&&!e.code)throw new Error("date-fns-tz error: Please set a language code on the locale object imported from date-fns, e.g. `locale.code = 'en-US'`");return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function x_(n,t){var e=D_(t);return e.formatToParts?w_(e,n):T_(e,n)}var __={year:0,month:1,day:2,hour:3,minute:4,second:5};function w_(n,t){try{for(var e=n.formatToParts(t),i=[],r=0;r<e.length;r++){var a=__[e[r].type];a>=0&&(i[a]=parseInt(e[r].value,10))}return i}catch(s){if(s instanceof RangeError)return[NaN];throw s}}function T_(n,t){var e=n.format(t).replace(/\u200E/g,""),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(e);return[i[3],i[1],i[2],i[4],i[5],i[6]]}var mo={};function D_(n){if(!mo[n]){var t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:"America/New_York",year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),e=t==="06/25/2014, 00:00:00"||t==="06/25/2014 00:00:00";mo[n]=e?new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}return mo[n]}function Sd(n,t,e,i,r,a,s){var o=new Date(0);return o.setUTCFullYear(n,t,e),o.setUTCHours(i,r,a,s),o}var Md=36e5,S_=6e4,yo={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-]\d{2}):?(\d{2})$/};function bo(n,t,e){var i,r;if(!n||(i=yo.timezoneZ.exec(n),i))return 0;var a;if(i=yo.timezoneHH.exec(n),i)return a=parseInt(i[1],10),Cd(a)?-(a*Md):NaN;if(i=yo.timezoneHHMM.exec(n),i){a=parseInt(i[1],10);var s=parseInt(i[2],10);return Cd(a,s)?(r=Math.abs(a)*Md+s*S_,a>0?-r:r):NaN}if(k_(n)){t=new Date(t||Date.now());var o=e?t:M_(t),l=vo(o,n),c=e?l:C_(t,l,n);return-c}return NaN}function M_(n){return Sd(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function vo(n,t){var e=x_(n,t),i=Sd(e[0],e[1]-1,e[2],e[3]%24,e[4],e[5],0).getTime(),r=n.getTime(),a=r%1e3;return r-=a>=0?a:1e3+a,i-r}function C_(n,t,e){var i=n.getTime(),r=i-t,a=vo(new Date(r),e);if(t===a)return t;r-=a-t;var s=vo(new Date(r),e);return a===s?a:Math.max(a,s)}function Cd(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}var kd={};function k_(n){if(kd[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),kd[n]=!0,!0}catch{return!1}}var O_=60*1e3,P_={X:function(n,t,e,i){var r=xo(i.timeZone,i._originalDate||n);if(r===0)return"Z";switch(t){case"X":return Od(r);case"XXXX":case"XX":return ri(r);case"XXXXX":case"XXX":default:return ri(r,":")}},x:function(n,t,e,i){var r=xo(i.timeZone,i._originalDate||n);switch(t){case"x":return Od(r);case"xxxx":case"xx":return ri(r);case"xxxxx":case"xxx":default:return ri(r,":")}},O:function(n,t,e,i){var r=xo(i.timeZone,i._originalDate||n);switch(t){case"O":case"OO":case"OOO":return"GMT"+E_(r,":");case"OOOO":default:return"GMT"+ri(r,":")}},z:function(n,t,e,i){var r=i._originalDate||n;switch(t){case"z":case"zz":case"zzz":return Dd("short",r,i);case"zzzz":default:return Dd("long",r,i)}}};function xo(n,t){var e=n?bo(n,t,!0)/O_:t.getTimezoneOffset();if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function Jr(n,t){for(var e=n<0?"-":"",i=Math.abs(n).toString();i.length<t;)i="0"+i;return e+i}function ri(n,t){var e=t||"",i=n>0?"-":"+",r=Math.abs(n),a=Jr(Math.floor(r/60),2),s=Jr(Math.floor(r%60),2);return i+a+e+s}function Od(n,t){if(n%60===0){var e=n>0?"-":"+";return e+Jr(Math.abs(n)/60,2)}return ri(n,t)}function E_(n,t){var e=n>0?"-":"+",i=Math.abs(n),r=Math.floor(i/60),a=i%60;if(a===0)return e+String(r);var s=t||"";return e+String(r)+s+Jr(a,2)}const A_=P_;var R_=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,_o=36e5,Pd=6e4,L_=2,se={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,plainTime:/:/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:R_};function Ed(n,t){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(n===null)return new Date(NaN);var e=t||{},i=e.additionalDigits==null?L_:Wx(e.additionalDigits);if(i!==2&&i!==1&&i!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]")return new Date(n.getTime());if(typeof n=="number"||Object.prototype.toString.call(n)==="[object Number]")return new Date(n);if(!(typeof n=="string"||Object.prototype.toString.call(n)==="[object String]"))return new Date(NaN);var r=I_(n),a=N_(r.date,i),s=a.year,o=a.restDateString,l=F_(o,s);if(isNaN(l))return new Date(NaN);if(l){var c=l.getTime(),u=0,d;if(r.time&&(u=U_(r.time),isNaN(u)))return new Date(NaN);if(r.timeZone||e.timeZone){if(d=bo(r.timeZone||e.timeZone,new Date(c+u)),isNaN(d))return new Date(NaN)}else d=Td(new Date(c+u)),d=Td(new Date(c+u+d));return new Date(c+u+d)}else return new Date(NaN)}function I_(n){var t={},e=se.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=se.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){var r=se.timeZone.exec(i);r?(t.time=i.replace(r[1],""),t.timeZone=r[1].trim()):t.time=i}return t}function N_(n,t){var e=se.YYY[t],i=se.YYYYY[t],r;if(r=se.YYYY.exec(n)||i.exec(n),r){var a=r[1];return{year:parseInt(a,10),restDateString:n.slice(a.length)}}if(r=se.YY.exec(n)||e.exec(n),r){var s=r[1];return{year:parseInt(s,10)*100,restDateString:n.slice(s.length)}}return{year:null}}function F_(n,t){if(t===null)return null;var e,i,r,a;if(n.length===0)return i=new Date(0),i.setUTCFullYear(t),i;if(e=se.MM.exec(n),e)return i=new Date(0),r=parseInt(e[1],10)-1,Ld(t,r)?(i.setUTCFullYear(t,r),i):new Date(NaN);if(e=se.DDD.exec(n),e){i=new Date(0);var s=parseInt(e[1],10);return Y_(t,s)?(i.setUTCFullYear(t,0,s),i):new Date(NaN)}if(e=se.MMDD.exec(n),e){i=new Date(0),r=parseInt(e[1],10)-1;var o=parseInt(e[2],10);return Ld(t,r,o)?(i.setUTCFullYear(t,r,o),i):new Date(NaN)}if(e=se.Www.exec(n),e)return a=parseInt(e[1],10)-1,Id(t,a)?Ad(t,a):new Date(NaN);if(e=se.WwwD.exec(n),e){a=parseInt(e[1],10)-1;var l=parseInt(e[2],10)-1;return Id(t,a,l)?Ad(t,a,l):new Date(NaN)}return null}function U_(n){var t,e,i;if(t=se.HH.exec(n),t)return e=parseFloat(t[1].replace(",",".")),wo(e)?e%24*_o:NaN;if(t=se.HHMM.exec(n),t)return e=parseInt(t[1],10),i=parseFloat(t[2].replace(",",".")),wo(e,i)?e%24*_o+i*Pd:NaN;if(t=se.HHMMSS.exec(n),t){e=parseInt(t[1],10),i=parseInt(t[2],10);var r=parseFloat(t[3].replace(",","."));return wo(e,i,r)?e%24*_o+i*Pd+r*1e3:NaN}return null}function Ad(n,t,e){t=t||0,e=e||0;var i=new Date(0);i.setUTCFullYear(n,0,4);var r=i.getUTCDay()||7,a=t*7+e+1-r;return i.setUTCDate(i.getUTCDate()+a),i}var B_=[31,28,31,30,31,30,31,31,30,31,30,31],W_=[31,29,31,30,31,30,31,31,30,31,30,31];function Rd(n){return n%400===0||n%4===0&&n%100!==0}function Ld(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;var i=Rd(n);if(i&&e>W_[t]||!i&&e>B_[t])return!1}return!0}function Y_(n,t){if(t<1)return!1;var e=Rd(n);return!(e&&t>366||!e&&t>365)}function Id(n,t,e){return!(t<0||t>52||e!=null&&(e<0||e>6))}function wo(n,t,e){return!(n!=null&&(n<0||n>=25)||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}var z_=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function To(n,t,e){var i=String(t),r=e||{},a=i.match(z_);if(a){var s=Ed(n,r);i=a.reduce(function(o,l){if(l[0]==="'")return o;var c=o.indexOf(l),u=o[c-1]==="'",d=o.replace(l,"'"+A_[l[0]](s,l,null,r)+"'");return u?d.substring(0,c-1)+d.substring(c+1):d},i)}return m_(n,i,r)}var Do={exports:{}},So={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(i,r){if(i==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(i[a]=r[a]);return i}n.exports=t.default})(So,So.exports);var H_=So.exports;(function(n,t){var e=Wt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var i=e(H_);function r(a){return(0,i.default)({},a)}n.exports=t.default})(Do,Do.exports);var $_=Do.exports;const j_=Fn($_);function V_(n,t,e){var i=Ed(n,e),r=bo(t,i,!0),a=new Date(i.getTime()-r),s=new Date(0);return s.setFullYear(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate()),s.setHours(a.getUTCHours(),a.getUTCMinutes(),a.getUTCSeconds(),a.getUTCMilliseconds()),s}function q_(n,t,e,i){var r=j_(i);return r.timeZone=t,To(V_(n,t),e,r)}const Nd=2,Fd=10,Ud=12,ta=new Intl.NumberFormat(((uh=document==null?void 0:document.documentElement)==null?void 0:uh.lang)||"en-US");function ea(n,t={}){if(!n)return n;const e=t.tz||Intl.DateTimeFormat().resolvedOptions().timeZone;try{let i="MMM dd, YYY hh:mm a";t.short&&(i="MMM dd, YYY"),t.includeTZ&&(i+=" (z)");const r=new Date(n);return q_(r,e,i)}catch{return console.error("Invalid value passed to formatTime",n),"(invalid date)"}}const na=10,De=["#a86cd5","#6a86d2","#00bbf9","#00c4b0","#ffdf15"],ai=(n,t)=>(t||De)[n%De.length],Ji=(n,t)=>{n[0]==="#"&&(n=n.slice(1));let e=parseInt(n.substring(0,2),16),i=parseInt(n.substring(2,4),16),r=parseInt(n.substring(4,6),16);e=e-t,i=i-t,r=r-t,e>255?e=255:e<0&&(e=0),i>255?i=255:i<0&&(i=0),r>255?r=255:r<0&&(r=0);const a=e.toString(16).length===1?"0"+e.toString(16):e.toString(16),s=i.toString(16).length===1?"0"+i.toString(16):i.toString(16),o=r.toString(16).length===1?"0"+r.toString(16):r.toString(16);return`#${a}${s}${o}`},Bd="#6f7787",X_={lineTension:.4,borderWidth:2,pointBorderWidth:1.2,borderJoinStyle:"round",fill:!0},Mo=new Map,Co=(n,t)=>t==="bytes"?_s(n):t==="count/minute"?n.toFixed(2):ta.format(n),Wd=n=>{const e=document.createElement("canvas").getContext("2d"),i=Et({});return e.font=i.string,e.measureText(n).width},G_=()=>{const n="label_height";if(!Mo.has(n)){const t=Et({});Mo.set(n,t.lineHeight)}return Mo.get(n)},K_=n=>n.datasets.reduce((t,e)=>t+e.data.reduce((i,r)=>isNaN(r)?i:i+r,0),0),Yd=(n,t)=>t.datasets.reduce((e,i,r)=>n.isDatasetVisible(r)?e+i.data.reduce((a,s)=>isNaN(s)?a:a+s,0):e,0),zd=(n,t)=>t===0?" (0.0%)":` (${(n/t*100).toFixed(1)}%)`;function Z_(n){const t={enabled:!1,position:"barChartTooltipPosition",callbacks:{label:r=>({label:r.dataset.label,value:r.label})}};Yr.positioners.barChartTooltipPosition=function(r,a){if(!r.length)return!1;const s=this.chart.canvas.getBoundingClientRect(),o=n.tooltipState.width||this.width,l=s.width/2,c=Rs(a,o,l),u=a.y,d=a.x<l?"left":"center";return{x:c-n.tooltipState.offset,y:u,xAlign:d}},is.modes.customInteractionMode=function(r,a){const s=fn(a,r),o=[];return is.evaluateInteractionItems(r,r.options.indexAxis||"x",s,(l,c,u)=>{r.options.indexAxis==="y"&&l.inYRange(s.y,!0)&&r.data.datasets[c].data[u]&&o.push({element:l,datasetIndex:c,index:u}),r.options.indexAxis==="x"&&l.inXRange(s.x,!0)&&r.data.datasets[c].data[u]&&o.push({element:l,datasetIndex:c,index:u})}),o};const e=n.numLabels.value>25?Fd:Ud;return h.computed(()=>{var r,a,s,o,l,c,u,d;return{indexAxis:n.indexAxis,skipNull:!0,scales:{x:{border:{display:!1},stacked:n.stacked.value,grid:{display:!1,drawBorder:!1},ticks:{maxRotation:90,autoSkip:!1,font:e,callback:function(f,g){const p=this;if(p.chart.options.indexAxis===p.axis){f=p.getLabelForValue(g);const x=10;return f&&f.length>x?f.slice(0,x)+"...":f}return p.getLabelForValue(Number(f))}},title:{display:n.indexAxis==="y"?!it((r=n.metricAxesTitle)==null?void 0:r.value):!it((a=n.dimensionAxesTitle)==null?void 0:a.value),text:n.indexAxis==="y"?(s=n.metricAxesTitle)==null?void 0:s.value:(o=n.dimensionAxesTitle)==null?void 0:o.value,padding:{top:20},font:{weight:"bold"}}},y:{border:{display:!1},stacked:n.stacked.value,beginAtZero:!0,grid:{display:!1,drawBorder:!1},ticks:{font:e,callback:function(f,g){const p=this;return p.chart.options.indexAxis===p.axis?(f=p.getLabelForValue(g),f&&f.length>na?f.slice(0,na)+"...":f):p.getLabelForValue(Number(f))}},title:{display:n.indexAxis==="x"?!it((l=n.metricAxesTitle)==null?void 0:l.value):!it((c=n.dimensionAxesTitle)==null?void 0:c.value),text:n.indexAxis==="x"?(u=n.metricAxesTitle)==null?void 0:u.value:(d=n.dimensionAxesTitle)==null?void 0:d.value,padding:{bottom:20},font:{weight:"bold"}}}},plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...t,external:f=>{As(n.tooltipState,f)}}},interaction:{mode:"customInteractionMode",intersect:!0},maxBarThickness:60,maintainAspectRatio:!1}})}Te.register(...My);const Q_=(n,t)=>{const e=t.datasets.map(r=>r.label),i=n.datasets.map(r=>r.label);return n.datasets.length===t.datasets.length&&e.every((r,a)=>r===i[a])};function J_(n,t,e,i,r){const a=h.shallowRef(null),s=(o,l)=>{if(t.value)return new Te(t.value,{type:n,data:o,plugins:i,options:l})};return h.onMounted(()=>{a.value=s(e.value,r.value)}),h.onBeforeUnmount(()=>{it(a.value)||a.value.destroy()}),h.watch(e,(o,l)=>{if(Q_(l,o)&&!it(a.value)){for(const[c,u]of o.datasets.entries())Object.assign(a.value.data.datasets[c],u);a.value.data.labels=o.labels,a.value.update()}else it(a.value)||a.value.destroy(),a.value=s(o,r.value)}),h.watch(t,()=>{it(a.value)||a.value.destroy(),a.value=s(e.value,r.value)}),h.watch(r,(o,l)=>{(o.indexAxis!==l.indexAxis||JSON.stringify(o.scales.x.title)!==JSON.stringify(l.scales.x.title)||JSON.stringify(o.scales.y.title)!==JSON.stringify(l.scales.y.title))&&(it(a.value)||a.value.destroy(),a.value=s(e.value,o))}),a}var Hd={exports:{}};(function(n){(function(){function t(c,u){if(u.separator===!1||c<1e3)return c.toString();var d=typeof u.separator=="string"?u.separator:",",f=[],g=Math.round(c).toString().split("");return g.reverse().forEach(function(p,x){x&&x%3===0&&f.push(d),f.push(p)}),f.reverse().join("")}function e(c,u,d){var f=c/u,g=d.round?"round":"floor";return d.decimal===!1?(c=Math[g](f),c.toString()):(d.precision?c=f:c=f<10?Math[g](f*10)/10:Math[g](f),c=c.toString(),typeof d.decimal=="string"&&(c=c.replace(".",d.decimal)),c)}var i=1e3,r=1e4,a=1e6,s=1e9,o=1e12;function l(c,u){var d;u=u||{};var f=c<0;f&&(c=Math.abs(c)),u.precision&&(c=parseFloat(c.toPrecision(u.precision)));var g=u.min10k?r:i;return c<g||u.precision&&u.precision>Math.log10(c)?d=t(e(c,1,u),u):c<a?d=e(c,i,u)+"k":c<s?d=e(c,a,u)+"m":c<o?d=t(e(c,s,u),u)+"b":d=t(e(c,o,u),u)+"t",f&&(d="-"+d),u.capital&&(d=d.toUpperCase()),u.prefix&&(d=u.prefix+d),u.suffix&&(d=d+u.suffix),d}l.addCommas=t,n.exports=l})()})(Hd);var tw=Hd.exports;const tr=Fn(tw);function ew(n,t,e){const{i18n:i}=St.useI18n(),{translateUnit:r}=St.useTranslatedUnits();return{legendValues:h.computed(()=>n.value.datasets.reduce((s,o)=>{const l=o.total?o.total:o.data.reduce((u,d)=>u+(typeof d=="number"?Number(d)||0:Number(d&&d.y)||0),0);let c;if(e.value==="bytes")c=isNaN(l)?"0":_s(l);else{const u=r(e.value,l);c=i&&i.t("legend.datapointValueDisplay",{value:tr(l,{capital:!0}),unit:u})||`${tr(l,{capital:!0})} ${e.value}`}return{...s,[o.label]:{raw:l,formatted:c}}},{}))}}function nw(n){return h.computed(()=>{var r,a,s;if(!((r=n.value)!=null&&r.meta))return"";const e="startMs"in n.value.meta?n.value.meta.startMs:((a=n.value.meta)==null?void 0:a.start)*1e3||"",i="endMs"in n.value.meta?n.value.meta.endMs:((s=n.value.meta)==null?void 0:s.end)*1e3||"";return e&&i?`${ea(e)} - ${ea(i,{includeTZ:!0})}`:""})}function iw(n){const t={enabled:!1,position:"doughnutChartTooltipPosition",callbacks:{label:i=>({label:i.dataset.label,value:i.label})}};return Yr.positioners.doughnutChartTooltipPosition=function(i,r){if(!i.length)return!1;const a=this.chart.canvas.getBoundingClientRect(),s=n.tooltipState.width||this.width,o=a.width/2,l=Rs(r,s,o),c=r.y,u=r.x<o?"left":"center";return{x:l-n.tooltipState.offset,y:c,xAlign:u}},{options:h.computed(()=>({responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...t,external:i=>{As(n.tooltipState,i)}}}}))}}var rw=Object.defineProperty,aw=(n,t,e)=>t in n?rw(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,We=(n,t,e)=>(aw(n,typeof t!="symbol"?t+"":t,e),e),ot=(n=>(n.MINUTELY="Minutely",n.HOURLY="Hourly",n.DAILY="Daily",n.WEEKLY="Weekly",n))(ot||{}),Yt=(n=>(n.FIFTEEN_MIN="15m",n.ONE_HOUR="1h",n.SIX_HOUR="6h",n.TWELVE_HOUR="12h",n.ONE_DAY="24h",n.SEVEN_DAY="7d",n.THIRTY_DAY="30d",n.CURRENT_WEEK="current_week",n.CURRENT_MONTH="current_month",n.CURRENT_QUARTER="current_quarter",n.PREVIOUS_WEEK="previous_week",n.PREVIOUS_MONTH="previous_month",n.PREVIOUS_QUARTER="previous_quarter",n))(Yt||{});function ko(n){"@babel/helpers - typeof";return ko=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ko(n)}function ia(n){if(n===null||n===!0||n===!1)return NaN;var t=Number(n);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function Ye(n,t){if(t.length<n)throw new TypeError(n+" argument"+(n>1?"s":"")+" required, but only "+t.length+" present")}function si(n){Ye(1,arguments);var t=Object.prototype.toString.call(n);return n instanceof Date||ko(n)==="object"&&t==="[object Date]"?new Date(n.getTime()):typeof n=="number"||t==="[object Number]"?new Date(n):((typeof n=="string"||t==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function $d(n,t){Ye(2,arguments);var e=si(n),i=ia(t);return isNaN(i)?new Date(NaN):(i&&e.setDate(e.getDate()+i),e)}function sw(n,t){Ye(2,arguments);var e=si(n),i=ia(t);if(isNaN(i))return new Date(NaN);if(!i)return e;var r=e.getDate(),a=new Date(e.getTime());a.setMonth(e.getMonth()+i+1,0);var s=a.getDate();return r>=s?a:(e.setFullYear(a.getFullYear(),a.getMonth(),r),e)}var ow={};function lw(){return ow}function ra(n,t){var e,i,r,a,s,o,l,c;Ye(1,arguments);var u=lw(),d=ia((e=(i=(r=(a=t==null?void 0:t.weekStartsOn)!==null&&a!==void 0?a:t==null||(s=t.locale)===null||s===void 0||(o=s.options)===null||o===void 0?void 0:o.weekStartsOn)!==null&&r!==void 0?r:u.weekStartsOn)!==null&&i!==void 0?i:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&e!==void 0?e:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=si(n),g=f.getDay(),p=(g<d?7:0)+g-d;return f.setDate(f.getDate()-p),f.setHours(0,0,0,0),f}function jd(n){Ye(1,arguments);var t=si(n);return t.setHours(0,0,0,0),t}var cw=60,uw=3600;function oi(n){Ye(1,arguments);var t=si(n);return t.setDate(1),t.setHours(0,0,0,0),t}function dw(n){Ye(1,arguments);var t=si(n),e=t.getFullYear(),i=t.getMonth(),r=new Date(0);return r.setFullYear(e,i+1,0),r.setHours(0,0,0,0),r.getDate()}function fw(n){return Ye(1,arguments),Math.floor(n*uw)}function hw(n){Ye(1,arguments);var t=n/cw;return Math.floor(t)}function Vd(n,t){Ye(2,arguments);var e=ia(t);return sw(n,-e)}function Oo(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var qd={exports:{}};(function(n){function t(e){return e&&e.__esModule?e:{default:e}}n.exports=t,n.exports.__esModule=!0,n.exports.default=n.exports})(qd);var gw=qd.exports,Po={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(i){if(i===null||i===!0||i===!1)return NaN;var r=Number(i);return isNaN(r)?r:r<0?Math.ceil(r):Math.floor(r)}n.exports=t.default})(Po,Po.exports);var pw=Po.exports;const mw=Oo(pw);var Eo={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(i){var r=new Date(Date.UTC(i.getFullYear(),i.getMonth(),i.getDate(),i.getHours(),i.getMinutes(),i.getSeconds(),i.getMilliseconds()));return r.setUTCFullYear(i.getFullYear()),i.getTime()-r.getTime()}n.exports=t.default})(Eo,Eo.exports);var yw=Eo.exports;const Xd=Oo(yw);function bw(n,t){var e=ww(t);return e.formatToParts?xw(e,n):_w(e,n)}var vw={year:0,month:1,day:2,hour:3,minute:4,second:5};function xw(n,t){try{for(var e=n.formatToParts(t),i=[],r=0;r<e.length;r++){var a=vw[e[r].type];a>=0&&(i[a]=parseInt(e[r].value,10))}return i}catch(s){if(s instanceof RangeError)return[NaN];throw s}}function _w(n,t){var e=n.format(t).replace(/\u200E/g,""),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(e);return[i[3],i[1],i[2],i[4],i[5],i[6]]}var Ao={};function ww(n){if(!Ao[n]){var t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:"America/New_York",year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),e=t==="06/25/2014, 00:00:00"||t==="06/25/2014 00:00:00";Ao[n]=e?new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}return Ao[n]}function Ro(n,t,e,i,r,a,s){var o=new Date(0);return o.setUTCFullYear(n,t,e),o.setUTCHours(i,r,a,s),o}var Gd=36e5,Tw=6e4,Lo={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-]\d{2}):?(\d{2})$/};function aa(n,t,e){var i,r;if(!n||(i=Lo.timezoneZ.exec(n),i))return 0;var a;if(i=Lo.timezoneHH.exec(n),i)return a=parseInt(i[1],10),Kd(a)?-(a*Gd):NaN;if(i=Lo.timezoneHHMM.exec(n),i){a=parseInt(i[1],10);var s=parseInt(i[2],10);return Kd(a,s)?(r=Math.abs(a)*Gd+s*Tw,a>0?-r:r):NaN}if(Mw(n)){t=new Date(t||Date.now());var o=e?t:Dw(t),l=Io(o,n),c=e?l:Sw(t,l,n);return-c}return NaN}function Dw(n){return Ro(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function Io(n,t){var e=bw(n,t),i=Ro(e[0],e[1]-1,e[2],e[3]%24,e[4],e[5],0).getTime(),r=n.getTime(),a=r%1e3;return r-=a>=0?a:1e3+a,i-r}function Sw(n,t,e){var i=n.getTime(),r=i-t,a=Io(new Date(r),e);if(t===a)return t;r-=a-t;var s=Io(new Date(r),e);return a===s?a:Math.max(a,s)}function Kd(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}var Zd={};function Mw(n){if(Zd[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),Zd[n]=!0,!0}catch{return!1}}var Cw=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/;const Qd=Cw;var No=36e5,Jd=6e4,kw=2,oe={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,plainTime:/:/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:Qd};function Fo(n,t){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(n===null)return new Date(NaN);var e=t||{},i=e.additionalDigits==null?kw:mw(e.additionalDigits);if(i!==2&&i!==1&&i!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]")return new Date(n.getTime());if(typeof n=="number"||Object.prototype.toString.call(n)==="[object Number]")return new Date(n);if(!(typeof n=="string"||Object.prototype.toString.call(n)==="[object String]"))return new Date(NaN);var r=Ow(n),a=Pw(r.date,i),s=a.year,o=a.restDateString,l=Ew(o,s);if(isNaN(l))return new Date(NaN);if(l){var c=l.getTime(),u=0,d;if(r.time&&(u=Aw(r.time),isNaN(u)))return new Date(NaN);if(r.timeZone||e.timeZone){if(d=aa(r.timeZone||e.timeZone,new Date(c+u)),isNaN(d))return new Date(NaN)}else d=Xd(new Date(c+u)),d=Xd(new Date(c+u+d));return new Date(c+u+d)}else return new Date(NaN)}function Ow(n){var t={},e=oe.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=oe.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){var r=oe.timeZone.exec(i);r?(t.time=i.replace(r[1],""),t.timeZone=r[1].trim()):t.time=i}return t}function Pw(n,t){var e=oe.YYY[t],i=oe.YYYYY[t],r;if(r=oe.YYYY.exec(n)||i.exec(n),r){var a=r[1];return{year:parseInt(a,10),restDateString:n.slice(a.length)}}if(r=oe.YY.exec(n)||e.exec(n),r){var s=r[1];return{year:parseInt(s,10)*100,restDateString:n.slice(s.length)}}return{year:null}}function Ew(n,t){if(t===null)return null;var e,i,r,a;if(n.length===0)return i=new Date(0),i.setUTCFullYear(t),i;if(e=oe.MM.exec(n),e)return i=new Date(0),r=parseInt(e[1],10)-1,nf(t,r)?(i.setUTCFullYear(t,r),i):new Date(NaN);if(e=oe.DDD.exec(n),e){i=new Date(0);var s=parseInt(e[1],10);return Iw(t,s)?(i.setUTCFullYear(t,0,s),i):new Date(NaN)}if(e=oe.MMDD.exec(n),e){i=new Date(0),r=parseInt(e[1],10)-1;var o=parseInt(e[2],10);return nf(t,r,o)?(i.setUTCFullYear(t,r,o),i):new Date(NaN)}if(e=oe.Www.exec(n),e)return a=parseInt(e[1],10)-1,rf(t,a)?tf(t,a):new Date(NaN);if(e=oe.WwwD.exec(n),e){a=parseInt(e[1],10)-1;var l=parseInt(e[2],10)-1;return rf(t,a,l)?tf(t,a,l):new Date(NaN)}return null}function Aw(n){var t,e,i;if(t=oe.HH.exec(n),t)return e=parseFloat(t[1].replace(",",".")),Uo(e)?e%24*No:NaN;if(t=oe.HHMM.exec(n),t)return e=parseInt(t[1],10),i=parseFloat(t[2].replace(",",".")),Uo(e,i)?e%24*No+i*Jd:NaN;if(t=oe.HHMMSS.exec(n),t){e=parseInt(t[1],10),i=parseInt(t[2],10);var r=parseFloat(t[3].replace(",","."));return Uo(e,i,r)?e%24*No+i*Jd+r*1e3:NaN}return null}function tf(n,t,e){t=t||0,e=e||0;var i=new Date(0);i.setUTCFullYear(n,0,4);var r=i.getUTCDay()||7,a=t*7+e+1-r;return i.setUTCDate(i.getUTCDate()+a),i}var Rw=[31,28,31,30,31,30,31,31,30,31,30,31],Lw=[31,29,31,30,31,30,31,31,30,31,30,31];function ef(n){return n%400===0||n%4===0&&n%100!==0}function nf(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;var i=ef(n);if(i&&e>Lw[t]||!i&&e>Rw[t])return!1}return!0}function Iw(n,t){if(t<1)return!1;var e=ef(n);return!(e&&t>366||!e&&t>365)}function rf(n,t,e){return!(t<0||t>52||e!=null&&(e<0||e>6))}function Uo(n,t,e){return!(n!=null&&(n<0||n>=25)||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}var Bo={exports:{}},Wo={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(i,r){if(i==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(i[a]=r[a]);return i}n.exports=t.default})(Wo,Wo.exports);var Nw=Wo.exports;(function(n,t){var e=gw.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var i=e(Nw);function r(a){return(0,i.default)({},a)}n.exports=t.default})(Bo,Bo.exports);var Fw=Bo.exports;const Uw=Oo(Fw);function Bw(n,t,e){var i=Fo(n,e),r=aa(t,i,!0),a=new Date(i.getTime()-r),s=new Date(0);return s.setFullYear(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate()),s.setHours(a.getUTCHours(),a.getUTCMinutes(),a.getUTCSeconds(),a.getUTCMilliseconds()),s}function Ww(n,t){return-aa(n,t)}function Yw(n,t,e){if(typeof n=="string"&&!n.match(Qd)){var i=Uw(e);return i.timeZone=t,Fo(n,i)}var r=Fo(n,e),a=Ro(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()).getTime(),s=aa(t,new Date(a));return new Date(a+s)}const zw={[ot.MINUTELY]:60*1e3,[ot.HOURLY]:60*60*1e3,[ot.DAILY]:60*60*24*1e3,[ot.WEEKLY]:60*60*24*7*1e3};function er(n){return n&&Object.values(ot).find(t=>n<=zw[t])||null}const li=(n,t)=>new Date(n.getTime()-Ww(t,n));let Pe=class{constructor(t){We(this,"timeframeText"),We(this,"key"),We(this,"display"),We(this,"timeframeLength"),We(this,"allowedTiers"),We(this,"defaultResponseGranularity"),We(this,"dataGranularity"),We(this,"isRelative"),We(this,"_startCustom"),We(this,"_endCustom"),this.display=t.display,this.timeframeText=t.timeframeText,this.key=t.key,this.timeframeLength=t.timeframeLength,this.allowedTiers=t.allowedTiers,this.defaultResponseGranularity=t.defaultResponseGranularity,this.dataGranularity=t.dataGranularity,this.isRelative=t.isRelative,this._startCustom=t.startCustom,this._endCustom=t.endCustom}rawEnd(t){return this._endCustom||new Date}rawStart(t){return this._startCustom||new Date(this.rawEnd().getTime()-this.timeframeLengthMs())}timeframeLengthMs(){return this.timeframeLength()*1e3}maximumTimeframeLength(){return this.timeframeLength()}allowedGranularities(){const t=new Set,e=this.maximumTimeframeLength()/3600;return e<=6&&t.add(ot.MINUTELY),e>=2&&e<=7*24&&t.add(ot.HOURLY),e>=2*24&&t.add(ot.DAILY),e>=2*24*14&&t.add(ot.WEEKLY),t}tzAdjustedDate(t){if(!t)return new Date;const e=Yw(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return Bw(e,t)}};class Hw extends Pe{rawStart(t){let e=ra(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=li(e,t)),e}maximumTimeframeLength(){return 60*60*24*7}}class $w extends Pe{rawStart(t){let e=oi(this.tzAdjustedDate(t));return t&&(e=li(e,t)),e}maximumTimeframeLength(){return 60*60*24*31}}class jw extends Pe{rawEnd(t){let e=ra(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=li(e,t)),e}rawStart(t){const e=this.tzAdjustedDate(t);let i=ra(e.setDate(e.getDate()-7),{weekStartsOn:1});return t&&(i=li(i,t)),i}}class Vw extends Pe{rawEnd(t){let e=oi(this.tzAdjustedDate(t));return t&&(e=li(e,t)),e}rawStart(t){let e=oi(Vd(this.tzAdjustedDate(t),1));return t&&(e=li(e,t)),e}}Yt.FIFTEEN_MIN,new Pe({key:Yt.FIFTEEN_MIN,display:"Last 15 minutes",timeframeText:"15 minutes",timeframeLength:()=>60*15,defaultResponseGranularity:ot.MINUTELY,dataGranularity:ot.MINUTELY,isRelative:!0,allowedTiers:["free","trial","plus","enterprise"]}),Yt.ONE_HOUR,new Pe({key:Yt.ONE_HOUR,display:"Last hour",timeframeText:"One hour",timeframeLength:()=>60*60*1,defaultResponseGranularity:ot.MINUTELY,dataGranularity:ot.MINUTELY,isRelative:!0,allowedTiers:["free","trial","plus","enterprise"]}),Yt.SIX_HOUR,new Pe({key:Yt.SIX_HOUR,display:"Last 6 hours",timeframeText:"6 hours",timeframeLength:()=>60*60*6,defaultResponseGranularity:ot.HOURLY,dataGranularity:ot.HOURLY,isRelative:!0,allowedTiers:["free","trial","plus","enterprise"]}),Yt.TWELVE_HOUR,new Pe({key:Yt.TWELVE_HOUR,display:"Last 12 hours",timeframeText:"12 hours",timeframeLength:()=>60*60*12,defaultResponseGranularity:ot.HOURLY,dataGranularity:ot.HOURLY,isRelative:!0,allowedTiers:["free","trial","plus","enterprise"]}),Yt.ONE_DAY,new Pe({key:Yt.ONE_DAY,display:"Last 24 hours",timeframeText:"24 hours",timeframeLength:()=>60*60*24,defaultResponseGranularity:ot.HOURLY,dataGranularity:ot.HOURLY,isRelative:!0,allowedTiers:["free","trial","plus","enterprise"]}),Yt.SEVEN_DAY,new Pe({key:Yt.SEVEN_DAY,display:"Last 7 days",timeframeText:"7 days",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:ot.DAILY,dataGranularity:ot.DAILY,isRelative:!0,allowedTiers:["trial","plus","enterprise"]}),Yt.THIRTY_DAY,new Pe({key:Yt.THIRTY_DAY,display:"Last 30 days",timeframeText:"30 days",timeframeLength:()=>60*60*24*30,defaultResponseGranularity:ot.DAILY,dataGranularity:ot.DAILY,isRelative:!0,allowedTiers:["trial","plus","enterprise"]}),Yt.CURRENT_WEEK,new Hw({key:Yt.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const n=ra(new Date,{weekStartsOn:1});return(jd($d(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:ot.DAILY,dataGranularity:ot.DAILY,isRelative:!1,allowedTiers:["plus","enterprise"]}),Yt.CURRENT_MONTH,new $w({key:Yt.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const n=oi(new Date);return(jd($d(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:ot.DAILY,dataGranularity:ot.DAILY,isRelative:!1,allowedTiers:["plus","enterprise"]}),Yt.PREVIOUS_WEEK,new jw({key:Yt.PREVIOUS_WEEK,display:"Previous week",timeframeText:"Week",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:ot.DAILY,dataGranularity:ot.DAILY,isRelative:!1,allowedTiers:["plus","enterprise"]}),Yt.PREVIOUS_MONTH,new Vw({key:Yt.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let n=0;const t=oi(new Date),e=oi(Vd(new Date,1));return t.getTimezoneOffset()!==e.getTimezoneOffset()&&(n=qw(t,e)),60*60*24*dw(new Date().setMonth(new Date().getMonth()-1))+fw(n)},defaultResponseGranularity:ot.DAILY,dataGranularity:ot.DAILY,isRelative:!1,allowedTiers:["plus","enterprise"]});function qw(n,t){return hw(n.getTimezoneOffset()-t.getTimezoneOffset())}function Xw(n){const t=h.computed(()=>{var l,c;return{type:"timeseries",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:10,autoSkipPadding:100,source:"auto",maxRotation:0},title:{display:!it((l=n.dimensionAxesTitle)==null?void 0:l.value),text:(c=n.dimensionAxesTitle)==null?void 0:c.value,padding:{top:20},font:{weight:"bold"}}}}),e=h.computed(()=>{var l,c;return{title:{display:!it((l=n.metricAxesTitle)==null?void 0:l.value),text:(c=n.metricAxesTitle)==null?void 0:c.value,padding:{bottom:20},font:{weight:"bold"}},ticks:{maxTicksLimit:5},grid:{drawBorder:!1},id:"main-y-axis",beginAtZero:!0}}),i={enabled:!1,position:"lineChartTooltipPosition"};Yr.positioners.lineChartTooltipPosition=function(l,c){if(!l.length||n.tooltipState.locked)return!1;const u=this.chart.canvas.getBoundingClientRect(),d=n.tooltipState.width||this.width,f=n.tooltipState.height||this.height,g=u.width/2,p=u.height/2,x=Rs(c,d,g);let m=Fx(c,f,p);const v=c.y<p?"top":"bottom",b=c.x<g?"left":"center";return f>u.height&&(m=0),{x,y:m,xAlign:b,yAlign:v}};const r=h.computed(()=>{switch(n.granularity.value){case ot.MINUTELY:return"minute";case ot.HOURLY:return"hour";case ot.DAILY:return"day";default:return"day"}}),a=h.computed(()=>n.timeRangeMs?px(Number(n.timeRangeMs.value))>=24?"yyyy-MM-dd h:mm":"h:mm":Ex(Number(n.timeRangeSec.value))>=24?"yyyy-MM-dd h:mm":"h:mm"),s=h.computed(()=>[ot.DAILY,ot.WEEKLY].includes(n.granularity.value)?"yyyy-MM-dd":"yyyy-MM-dd h:mm");return{options:h.computed(()=>({hover:{mode:"index",intersect:!1},elements:{point:{radius:0,hitRadius:4,hoverRadius:4}},animation:{duration:250,easing:"linear"},scales:{x:{border:{display:!1},...t.value,stacked:n.stacked.value,time:{tooltipFormat:"h:mm:ss a",unit:r.value,displayFormats:{minute:"h:mm:ss a",hour:a.value,day:s.value}}},y:{border:{display:!1},...e.value,stacked:n.stacked.value}},responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},streaming:!1,tooltip:{...i,external:l=>{As(n.tooltipState,l)}}},interaction:{mode:"index",intersect:!1}}))}}function Gw(n){const{isMultiMetric:t,hasDimensions:e,metricNames:i,barSegmentLabels:r,pivotRecords:a,rowLabels:s,colorPalette:o}=n,{i18n:l}=St.useI18n();return t?i.map(c=>({label:l&&l.te(`chartLabels.${c}`)&&l.t(`chartLabels.${c}`)||c,backgroundColor:ai(i.indexOf(c),De),data:s.map((u,d)=>e?a[`${u},${c}`]||0:a[`${d},${c}`]||null)})):Array.from(r).flatMap((c,u)=>{if(!c)return[];const d=Array.isArray(o)?ai(u,o):o[c]||ai(u);return{label:l&&l.te(`chartLabels.${c}`)&&l.t(`chartLabels.${c}`)||c,backgroundColor:d,data:s.map(f=>a[`${f},${c}`]||null)}})}function Kw(n,t){const{i18n:e}=St.useI18n();return h.computed(()=>{try{if(t.value&&"meta"in t.value&&"records"in t.value){const r=t.value.records,{dimensions:a,metricNames:s}=t.value.meta,o=a&&Object.keys(a),l=s&&s.length>1,c=a&&o&&(o.length===1?o[0]!=="Organization":o.length>0);if(!r.length||!s)return{datasets:[],labels:[]};const u=c&&o||s,d=u[0],f=u.length>1?u[1]:u[0],g=Object.fromEntries(l?r.flatMap(v=>s.map((b,_)=>{const w=v.event[d],S=c?`${w},${b}`:`${_},${b}`,C=v.event[b];return[S,C]})):r.map(v=>{const b=c?`${v.event[d]},${v.event[f]}`:`${d},${f}`,_=v.event[s[0]];return[b,_]})),p=c&&a[d]||s,x=c&&a[f]||s;return!p||!x?{labels:[],datasets:[]}:{labels:c?a[d].map(v=>e&&e.te(`chartLabels.${v}`)&&e.t(`chartLabels.${v}`)||v):s.map(v=>e&&e.te(`chartLabels.${v}`)&&e.t(`chartLabels.${v}`)||v),datasets:Gw({isMultiMetric:l,hasDimensions:c,metricNames:s,dimensionFieldNames:u,barSegmentLabels:x,pivotRecords:g,rowLabels:p,colorPalette:n.colorPalette||De})}}}catch(r){return console.error(r),{datasets:[],labels:[]}}return{labels:[],datasets:[]}})}const Zw=(n,t,e=1)=>Array(Math.ceil((t-n)/e)).fill(n).map((i,r)=>i+r*e),Qw=n=>{if(typeof n=="string"){const t=+n;if(t)return t;try{return hd(n).getTime()}catch(e){if(e instanceof RangeError)return 0;throw e}}return n},Jw=(n,t,e,i,r)=>{const s=Math.max(t-6e4,Math.max(...(r||[]).map(c=>new Date(c.timestamp).valueOf()))),o=Math.floor((n-i)/e)*e+i,l=Math.floor((s-i)/e)*e+i+e;return Zw(o,l,e)};function t1(n,t){const{i18n:e}=St.useI18n();return h.computed(()=>{try{if(t.value&&"meta"in t.value&&"records"in t.value){const r=t.value.records,{dimensions:a,metricNames:s}=t.value.meta,o="startMs"in t.value.meta?t.value.meta.startMs:t.value.meta.start*1e3,l="endMs"in t.value.meta?t.value.meta.endMs:t.value.meta.end*1e3;if(!s)return console.error("Cannot build chart data from this explore result. Missing metric names."),{datasets:[]};const c=a&&Object.keys(a)||s,u=c&&c[0],d=a&&a[u]||s,f=t.value.meta.granularity;if(typeof f!="number"||isNaN(f)||!isFinite(f)||f===0)return console.error("Invalid step value:",f),{datasets:[]};if(!r.length)return{datasets:[]};const g=Qw(o),p=Jw(o,l,f,g,r),x=new Set,m=r!=null&&r.length?r.reduce((w,S)=>{const C=new Date(S.timestamp).valueOf(),k=S.event;for(const T of s)x.add(T),C in w||(w[C]={}),T in w[C]||(w[C][T]={});for(const T of s)d.forEach(D=>{k[u]===D||T===D?(w[C][T]||(w[C][T]={}),w[C][T][D]=Math.round(Number(k[T])*1e3)/1e3):c.length||(w[C][T]||(w[C][T]={}),w[C][T][D]=Math.round(Number(k[D])*1e3)/1e3)});return w},{}):{},v=s.length===1?s.flatMap(w=>d.map(S=>[w,S])):d.map(w=>[w,w]),b={},_=[...v].map(([w,S],C)=>{const k=p.map(R=>R in m&&w in m[R]?{x:R,y:m[R][w][S]||0}:{x:R,y:0});let{colorPalette:T,fill:D}=n;it(T)&&(T=De);const O=Array.isArray(T)?ai(C,T):T[S]||ai(C),A=Ji(O,50);return b[S]=O,{rawDimension:S,rawMetric:w,label:e&&e.te(`chartLabels.${S}`)&&e.t(`chartLabels.${S}`)||S,borderColor:A,backgroundColor:O,data:k,total:k.reduce((R,{y:W})=>R+Number(W),0),...X_,fill:D}});return _.sort((w,S)=>Number(w.total)<Number(S.total)?-1:1),{datasets:_,colorMap:b}}}catch(r){return console.error(r),{labels:[],datasets:[]}}return{labels:[],datasets:[]}})}const e1=(n,t)=>{h.watch([n,t],(e,i,r)=>{const[a,s]=e;!s||!window||(window._AnalyticsChartDataInternal||(window._AnalyticsChartDataInternal=new Map),window._AnalyticsChartDataInternal.set(s,a),r(()=>{var o;(o=window._AnalyticsChartDataInternal)==null||o.delete(s)}))},{immediate:!0})};function n1(){const{i18n:n}=St.useI18n();return{translateUnit:(e,i)=>{const r=i===1,a=`chartUnits.${e}`;return n.te(a)?n.t(a,{plural:r?"":"s"}):e}}}const St={useBarChartOptions:Z_,useChartJSCommon:J_,useChartLegendValues:ew,useChartSelectedRange:nw,useExploreResultToDatasets:Kw,useExploreResultToTimeDataset:t1,useDoughnutChartOptions:iw,useLinechartOptions:Xw,useI18n:Sh,useReportChartDataForSynthetics:e1,useTranslatedUnits:n1};/*!
|
|
20
20
|
* chartjs-plugin-annotation v3.0.1
|
|
21
21
|
* https://www.chartjs.org/chartjs-plugin-annotation/index
|
|
22
22
|
* (c) 2023 chartjs-plugin-annotation Contributors
|
|
23
23
|
* Released under the MIT License
|
|
24
|
-
*/const af={modes:{point(n,t){return sa(n,t,{intersect:!0})},nearest(n,t,e){return a1(n,t,e)},x(n,t,e){return sa(n,t,{intersect:e.intersect,axis:"x"})},y(n,t,e){return sa(n,t,{intersect:e.intersect,axis:"y"})}}};function Yo(n,t,e){return(af.modes[e.mode]||af.modes.nearest)(n,t,e)}function i1(n,t,e){return e!=="x"&&e!=="y"?n.inRange(t.x,t.y,"x",!0)||n.inRange(t.x,t.y,"y",!0):n.inRange(t.x,t.y,e,!0)}function r1(n,t,e){return e==="x"?{x:n.x,y:t.y}:e==="y"?{x:t.x,y:n.y}:t}function sa(n,t,e){return n.visibleElements.filter(i=>e.intersect?i.inRange(t.x,t.y):i1(i,t,e.axis))}function a1(n,t,e){let i=Number.POSITIVE_INFINITY;return sa(n,t,e).reduce((r,a)=>{const s=a.getCenterPoint(),o=r1(t,s,e.axis),l=Gn(t,o);return l<i?(r=[a],i=l):l===i&&r.push(a),r},[]).sort((r,a)=>r._index-a._index).slice(0,1)}const s1=(n,t)=>t>n||n.length>t.length&&n.slice(0,t.length)===t,Wn=.001,oa=(n,t,e)=>Math.min(e,Math.max(t,n));function o1(n,t,e){for(const i of Object.keys(n))n[i]=oa(n[i],t,e);return n}function l1(n,t,e,i){if(!n||!t||e<=0)return!1;const r=i/2;return Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2)<=Math.pow(e+r,2)}function sf(n,{x:t,y:e,x2:i,y2:r},a,s){const o=s/2,l=n.x>=t-o-Wn&&n.x<=i+o+Wn,c=n.y>=e-o-Wn&&n.y<=r+o+Wn;return a==="x"?l:(a==="y"||l)&&c}function ci(n,t){const{centerX:e,centerY:i}=n.getProps(["centerX","centerY"],t);return{x:e,y:i}}function c1(n,t,e,i=!0){const r=e.split(".");let a=0;for(const s of t.split(".")){const o=r[a++];if(parseInt(s,10)<parseInt(o,10))break;if(s1(o,s)){if(i)throw new Error(`${n} v${e} is not supported. v${t} or newer is required.`);return!1}}return!0}const of=n=>typeof n=="string"&&n.endsWith("%"),lf=n=>parseFloat(n)/100,cf=n=>oa(lf(n),0,1),la=(n,t)=>({x:n,y:t,x2:n,y2:t,width:0,height:0}),u1={box:n=>la(n.centerX,n.centerY),ellipse:n=>({centerX:n.centerX,centerY:n.centerX,radius:0,width:0,height:0}),label:n=>la(n.centerX,n.centerY),line:n=>la(n.x,n.y),point:n=>({centerX:n.centerX,centerY:n.centerY,radius:0,width:0,height:0}),polygon:n=>la(n.centerX,n.centerY)};function zo(n,t){return t==="start"?0:t==="end"?n:of(t)?cf(t)*n:n/2}function bn(n,t,e=!0){return typeof t=="number"?t:of(t)?(e?cf(t):lf(t))*n:n}function d1(n,t){const{x:e,width:i}=n,r=t.textAlign;return r==="center"?e+i/2:r==="end"||r==="right"?e+i:e}function Ho(n,t="center"){return ct(n)?{x:nt(n.x,t),y:nt(n.y,t)}:(n=nt(n,t),{x:n,y:n})}function uf(n){return n&&(ue(n.xValue)||ue(n.yValue))}function nr(n,t,e){const i=e.init;if(i){if(i===!0)return ff(t,e)}else return;return f1(n,t,e)}function df(n,t,e){let i=!1;return t.forEach(r=>{de(n[r])?(i=!0,e[r]=n[r]):ue(e[r])&&delete e[r]}),i}function ff(n,t){const e=t.type||"line";return u1[e](n)}function f1(n,t,e){const i=xt(e.init,[{chart:n,properties:t,options:e}]);if(i===!0)return ff(t,e);if(ct(i))return i}const $o=new Map,h1=n=>isNaN(n)||n<=0,g1=n=>n.reduce(function(t,e){return t+=e.string,t},"");function ca(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object HTMLImageElement]"||t==="[object HTMLCanvasElement]"}}function jo(n,{x:t,y:e},i){i&&(n.translate(t,e),n.rotate(qt(i)),n.translate(-t,-e))}function vn(n,t){if(t&&t.borderWidth)return n.lineCap=t.borderCapStyle,n.setLineDash(t.borderDash),n.lineDashOffset=t.borderDashOffset,n.lineJoin=t.borderJoinStyle,n.lineWidth=t.borderWidth,n.strokeStyle=t.borderColor,!0}function ui(n,t){n.shadowColor=t.backgroundShadowColor,n.shadowBlur=t.shadowBlur,n.shadowOffsetX=t.shadowOffsetX,n.shadowOffsetY=t.shadowOffsetY}function Vo(n,t){const e=t.content;if(ca(e))return{width:bn(e.width,t.width),height:bn(e.height,t.height)};const i=t.font,r=yt(i)?i.map(l=>Et(l)):[Et(i)],a=t.textStrokeWidth,s=yt(e)?e:[e],o=s.join()+g1(r)+a+(n._measureText?"-spriting":"");return $o.has(o)||$o.set(o,v1(n,s,r,a)),$o.get(o)}function hf(n,t,e){const{x:i,y:r,width:a,height:s}=t;n.save(),ui(n,e);const o=vn(n,e);n.fillStyle=e.backgroundColor,n.beginPath(),Kn(n,{x:i,y:r,w:a,h:s,radius:o1(un(e.borderRadius),0,Math.min(a,s)/2)}),n.closePath(),n.fill(),o&&(n.shadowColor=e.borderShadowColor,n.stroke()),n.restore()}function p1(n,t,e){const i=e.content;if(ca(i)){n.save(),n.globalAlpha=_1(e.opacity,i.style.opacity),n.drawImage(i,t.x,t.y,t.width,t.height),n.restore();return}const r=yt(i)?i:[i],a=e.font,s=yt(a)?a.map(d=>Et(d)):[Et(a)],o=e.color,l=yt(o)?o:[o],c=d1(t,e),u=t.y+e.textStrokeWidth/2;n.save(),n.textBaseline="middle",n.textAlign=e.textAlign,m1(n,e)&&x1(n,{x:c,y:u},r,s),w1(n,{x:c,y:u},r,{fonts:s,colors:l}),n.restore()}function m1(n,t){if(t.textStrokeWidth>0)return n.lineJoin="round",n.miterLimit=2,n.lineWidth=t.textStrokeWidth,n.strokeStyle=t.textStrokeColor,!0}function y1(n,t,e,i){const{radius:r,options:a}=t,s=a.pointStyle,o=a.rotation;let l=(o||0)*Ia;if(ca(s)){n.save(),n.translate(e,i),n.rotate(l),n.drawImage(s,-s.width/2,-s.height/2,s.width,s.height),n.restore();return}h1(r)||b1(n,{x:e,y:i,radius:r,rotation:o,style:s,rad:l})}function b1(n,{x:t,y:e,radius:i,rotation:r,style:a,rad:s}){let o,l,c,u;switch(n.beginPath(),a){default:n.arc(t,e,i,0,kt),n.closePath();break;case"triangle":n.moveTo(t+Math.sin(s)*i,e-Math.cos(s)*i),s+=mr,n.lineTo(t+Math.sin(s)*i,e-Math.cos(s)*i),s+=mr,n.lineTo(t+Math.sin(s)*i,e-Math.cos(s)*i),n.closePath();break;case"rectRounded":u=i*.516,c=i-u,o=Math.cos(s+_e)*c,l=Math.sin(s+_e)*c,n.arc(t-o,e-l,u,s-dt,s-Pt),n.arc(t+l,e-o,u,s-Pt,s),n.arc(t+o,e+l,u,s,s+Pt),n.arc(t-l,e+o,u,s+Pt,s+dt),n.closePath();break;case"rect":if(!r){c=Math.SQRT1_2*i,n.rect(t-c,e-c,2*c,2*c);break}s+=_e;case"rectRot":o=Math.cos(s)*i,l=Math.sin(s)*i,n.moveTo(t-o,e-l),n.lineTo(t+l,e-o),n.lineTo(t+o,e+l),n.lineTo(t-l,e+o),n.closePath();break;case"crossRot":s+=_e;case"cross":o=Math.cos(s)*i,l=Math.sin(s)*i,n.moveTo(t-o,e-l),n.lineTo(t+o,e+l),n.moveTo(t+l,e-o),n.lineTo(t-l,e+o);break;case"star":o=Math.cos(s)*i,l=Math.sin(s)*i,n.moveTo(t-o,e-l),n.lineTo(t+o,e+l),n.moveTo(t+l,e-o),n.lineTo(t-l,e+o),s+=_e,o=Math.cos(s)*i,l=Math.sin(s)*i,n.moveTo(t-o,e-l),n.lineTo(t+o,e+l),n.moveTo(t+l,e-o),n.lineTo(t-l,e+o);break;case"line":o=Math.cos(s)*i,l=Math.sin(s)*i,n.moveTo(t-o,e-l),n.lineTo(t+o,e+l);break;case"dash":n.moveTo(t,e),n.lineTo(t+Math.cos(s)*i,e+Math.sin(s)*i);break}n.fill()}function v1(n,t,e,i){n.save();const r=t.length;let a=0,s=i;for(let o=0;o<r;o++){const l=e[Math.min(o,e.length-1)];n.font=l.string;const c=t[o];a=Math.max(a,n.measureText(c).width+i),s+=l.lineHeight}return n.restore(),{width:a,height:s}}function x1(n,{x:t,y:e},i,r){n.beginPath();let a=0;i.forEach(function(s,o){const l=r[Math.min(o,r.length-1)],c=l.lineHeight;n.font=l.string,n.strokeText(s,t,e+c/2+a),a+=c}),n.stroke()}function w1(n,{x:t,y:e},i,{fonts:r,colors:a}){let s=0;i.forEach(function(o,l){const c=a[Math.min(l,a.length-1)],u=r[Math.min(l,r.length-1)],d=u.lineHeight;n.beginPath(),n.font=u.string,n.fillStyle=c,n.fillText(o,t,e+d/2+s),s+=d,n.fill()})}function _1(n,t){const e=cn(n)?n:t;return cn(e)?oa(e,0,1):1}const gf={xScaleID:{min:"xMin",max:"xMax",start:"left",end:"right",startProp:"x",endProp:"x2"},yScaleID:{min:"yMin",max:"yMax",start:"bottom",end:"top",startProp:"y",endProp:"y2"}};function di(n,t,e){return t=typeof t=="number"?t:n.parse(t),Lt(t)?n.getPixelForValue(t):e}function Yn(n,t,e){const i=t[e];if(i||e==="scaleID")return i;const r=e.charAt(0),a=Object.values(n).filter(s=>s.axis&&s.axis===r);return a.length?a[0].id:r}function pf(n,t){if(n){const e=n.options.reverse,i=di(n,t.min,e?t.end:t.start),r=di(n,t.max,e?t.start:t.end);return{start:i,end:r}}}function mf(n,t){const{chartArea:e,scales:i}=n,r=i[Yn(i,t,"xScaleID")],a=i[Yn(i,t,"yScaleID")];let s=e.width/2,o=e.height/2;return r&&(s=di(r,t.xValue,r.left+r.width/2)),a&&(o=di(a,t.yValue,a.top+a.height/2)),{x:s,y:o}}function qo(n,t){const e=n.scales,i=e[Yn(e,t,"xScaleID")],r=e[Yn(e,t,"yScaleID")];if(!i&&!r)return{};let{left:a,right:s}=i||n.chartArea,{top:o,bottom:l}=r||n.chartArea;const c=vf(i,{min:t.xMin,max:t.xMax,start:a,end:s});a=c.start,s=c.end;const u=vf(r,{min:t.yMin,max:t.yMax,start:l,end:o});return o=u.start,l=u.end,{x:a,y:o,x2:s,y2:l,width:s-a,height:l-o,centerX:a+(s-a)/2,centerY:o+(l-o)/2}}function yf(n,t){if(!uf(t)){const e=qo(n,t);let i=t.radius;(!i||isNaN(i))&&(i=Math.min(e.width,e.height)/2,t.radius=i);const r=i*2,a=e.centerX+t.xAdjust,s=e.centerY+t.yAdjust;return{x:a-i,y:s-i,x2:a+i,y2:s+i,centerX:a,centerY:s,width:r,height:r,radius:i}}return D1(n,t)}function T1(n,t){const{scales:e,chartArea:i}=n,r=e[t.scaleID],a={x:i.left,y:i.top,x2:i.right,y2:i.bottom};return r?S1(r,a,t):M1(e,a,t),a}function bf(n,t){const e=qo(n,t);return e.initProperties=nr(n,e,t),e.elements=[{type:"label",optionScope:"label",properties:O1(n,e,t),initProperties:e.initProperties}],e}function D1(n,t){const e=mf(n,t),i=t.radius*2;return{x:e.x-t.radius+t.xAdjust,y:e.y-t.radius+t.yAdjust,x2:e.x+t.radius+t.xAdjust,y2:e.y+t.radius+t.yAdjust,centerX:e.x+t.xAdjust,centerY:e.y+t.yAdjust,radius:t.radius,width:i,height:i}}function vf(n,t){const e=pf(n,t)||t;return{start:Math.min(e.start,e.end),end:Math.max(e.start,e.end)}}function S1(n,t,e){const i=di(n,e.value,NaN),r=di(n,e.endValue,i);n.isHorizontal()?(t.x=i,t.x2=r):(t.y=i,t.y2=r)}function M1(n,t,e){for(const i of Object.keys(gf)){const r=n[Yn(n,e,i)];if(r){const{min:a,max:s,start:o,end:l,startProp:c,endProp:u}=gf[i],d=pf(r,{min:e[a],max:e[s],start:r[o],end:r[l]});t[c]=d.start,t[u]=d.end}}}function C1({properties:n,options:t},e,i,r){const{x:a,x2:s,width:o}=n;return xf({start:a,end:s,size:o,borderWidth:t.borderWidth},{position:i.x,padding:{start:r.left,end:r.right},adjust:t.label.xAdjust,size:e.width})}function k1({properties:n,options:t},e,i,r){const{y:a,y2:s,height:o}=n;return xf({start:a,end:s,size:o,borderWidth:t.borderWidth},{position:i.y,padding:{start:r.top,end:r.bottom},adjust:t.label.yAdjust,size:e.height})}function xf(n,t){const{start:e,end:i,borderWidth:r}=n,{position:a,padding:{start:s,end:o},adjust:l}=t,c=i-r-e-s-o-t.size;return e+r/2+l+zo(c,a)}function O1(n,t,e){const i=e.label;i.backgroundColor="transparent",i.callout.display=!1;const r=Ho(i.position),a=Xt(i.padding),s=Vo(n.ctx,i),o=C1({properties:t,options:e},s,r,a),l=k1({properties:t,options:e},s,r,a),c=s.width+a.width,u=s.height+a.height;return{x:o,y:l,x2:o+c,y2:l+u,width:c,height:u,centerX:o+c/2,centerY:l+u/2,rotation:i.rotation}}function zn(n,t,e){const i=Math.cos(e),r=Math.sin(e),a=t.x,s=t.y;return{x:a+i*(n.x-a)-r*(n.y-s),y:s+r*(n.x-a)+i*(n.y-s)}}const Xo=["enter","leave"],Go=Xo.concat("click");function P1(n,t,e){t.listened=df(e,Go,t.listeners),t.moveListened=!1,t._getElements=Yo,Xo.forEach(i=>{de(e[i])&&(t.moveListened=!0)}),(!t.listened||!t.moveListened)&&t.annotations.forEach(i=>{!t.listened&&de(i.click)&&(t.listened=!0),t.moveListened||Xo.forEach(r=>{de(i[r])&&(t.listened=!0,t.moveListened=!0)})})}function E1(n,t,e){if(n.listened)switch(t.type){case"mousemove":case"mouseout":return A1(n,t,e);case"click":return R1(n,t,e)}}function A1(n,t,e){if(!n.moveListened)return;let i;t.type==="mousemove"?i=Yo(n,t,e.interaction):i=[];const r=n.hovered;n.hovered=i;const a={state:n,event:t};let s=wf(a,"leave",r,i);return wf(a,"enter",i,r)||s}function wf({state:n,event:t},e,i,r){let a;for(const s of i)r.indexOf(s)<0&&(a=_f(s.options[e]||n.listeners[e],s,t)||a);return a}function R1(n,t,e){const i=n.listeners,r=Yo(n,t,e.interaction);let a;for(const s of r)a=_f(s.options.click||i.click,s,t)||a;return a}function _f(n,t,e){return xt(n,[t.$context,e])===!0}const ua=["afterDraw","beforeDraw"];function L1(n,t,e){const i=t.visibleElements;t.hooked=df(e,ua,t.hooks),t.hooked||i.forEach(r=>{t.hooked||ua.forEach(a=>{de(r.options[a])&&(t.hooked=!0)})})}function Tf(n,t,e){if(n.hooked){const i=t.options[e]||n.hooks[e];return xt(i,[t.$context])}}function I1(n,t,e){const i=W1(n.scales,t,e);let r=Df(t,i,"min","suggestedMin");r=Df(t,i,"max","suggestedMax")||r,r&&de(t.handleTickRangeOptions)&&t.handleTickRangeOptions()}function N1(n,t){for(const e of n)U1(e,t)}function Df(n,t,e,i){if(Lt(t[e])&&!F1(n.options,e,i)){const r=n[e]!==t[e];return n[e]=t[e],r}}function F1(n,t,e){return ue(n[t])||ue(n[e])}function U1(n,t){for(const e of["scaleID","xScaleID","yScaleID"]){const i=Yn(t,n,e);i&&!t[i]&&B1(n,e)&&console.warn(`No scale found with id '${i}' for annotation '${n.id}'`)}}function B1(n,t){if(t==="scaleID")return!0;const e=t.charAt(0);for(const i of["Min","Max","Value"])if(ue(n[e+i]))return!0;return!1}function W1(n,t,e){const i=t.axis,r=t.id,a=i+"ScaleID",s={min:nt(t.min,Number.NEGATIVE_INFINITY),max:nt(t.max,Number.POSITIVE_INFINITY)};for(const o of e)o.scaleID===r?Sf(o,t,["value","endValue"],s):Yn(n,o,a)===r&&Sf(o,t,[i+"Min",i+"Max",i+"Value"],s);return s}function Sf(n,t,e,i){for(const r of e){const a=n[r];if(ue(a)){const s=t.parse(a);i.min=Math.min(i.min,s),i.max=Math.max(i.max,s)}}}class fi extends te{inRange(t,e,i,r){const{x:a,y:s}=zn({x:t,y:e},this.getCenterPoint(r),qt(-this.options.rotation));return sf({x:a,y:s},this.getProps(["x","y","x2","y2"],r),i,this.options.borderWidth)}getCenterPoint(t){return ci(this,t)}draw(t){t.save(),jo(t,this.getCenterPoint(),this.options.rotation),hf(t,this,this.options),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return bf(t,e)}}fi.id="boxAnnotation",fi.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,label:{backgroundColor:"transparent",borderWidth:0,callout:{display:!1},color:"black",content:null,display:!1,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,opacity:void 0,padding:6,position:"center",rotation:void 0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0},fi.defaultRoutes={borderColor:"color",backgroundColor:"color"},fi.descriptors={label:{_fallback:!0}};const Mf=["left","bottom","top","right"];class ir extends te{inRange(t,e,i,r){const{x:a,y:s}=zn({x:t,y:e},this.getCenterPoint(r),qt(-this.rotation));return sf({x:a,y:s},this.getProps(["x","y","x2","y2"],r),i,this.options.borderWidth)}getCenterPoint(t){return ci(this,t)}draw(t){const e=this.options,i=!ue(this._visible)||this._visible;!e.display||!e.content||!i||(t.save(),jo(t,this.getCenterPoint(),this.rotation),z1(t,this),hf(t,this,e),p1(t,G1(this),e),t.restore())}resolveElementProperties(t,e){let i;if(uf(e))i=mf(t,e);else{const{centerX:o,centerY:l}=qo(t,e);i={x:o,y:l}}const r=Xt(e.padding),a=Vo(t.ctx,e),s=Y1(i,a,e,r);return{initProperties:nr(t,s,e),pointX:i.x,pointY:i.y,...s,rotation:e.rotation}}}ir.id="labelAnnotation",ir.defaults={adjustScaleRange:!0,backgroundColor:"transparent",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:0,callout:{borderCapStyle:"butt",borderColor:void 0,borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:1,display:!1,margin:5,position:"auto",side:5,start:"50%"},color:"black",content:null,display:!0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:void 0},height:void 0,init:void 0,opacity:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0},ir.defaultRoutes={borderColor:"color"};function Y1(n,t,e,i){const r=t.width+i.width+e.borderWidth,a=t.height+i.height+e.borderWidth,s=Ho(e.position,"center"),o=Cf(n.x,r,e.xAdjust,s.x),l=Cf(n.y,a,e.yAdjust,s.y);return{x:o,y:l,x2:o+r,y2:l+a,width:r,height:a,centerX:o+r/2,centerY:l+a/2}}function Cf(n,t,e=0,i){return n-zo(t,i)+e}function z1(n,t){const{pointX:e,pointY:i,options:r}=t,a=r.callout,s=a&&a.display&&q1(t,a);if(!s||K1(t,a,s))return;if(n.save(),n.beginPath(),!vn(n,a))return n.restore();const{separatorStart:l,separatorEnd:c}=H1(t,s),{sideStart:u,sideEnd:d}=j1(t,s,l);(a.margin>0||r.borderWidth===0)&&(n.moveTo(l.x,l.y),n.lineTo(c.x,c.y)),n.moveTo(u.x,u.y),n.lineTo(d.x,d.y);const f=zn({x:e,y:i},t.getCenterPoint(),qt(-t.rotation));n.lineTo(f.x,f.y),n.stroke(),n.restore()}function H1(n,t){const{x:e,y:i,x2:r,y2:a}=n,s=$1(n,t);let o,l;return t==="left"||t==="right"?(o={x:e+s,y:i},l={x:o.x,y:a}):(o={x:e,y:i+s},l={x:r,y:o.y}),{separatorStart:o,separatorEnd:l}}function $1(n,t){const{width:e,height:i,options:r}=n,a=r.callout.margin+r.borderWidth/2;return t==="right"?e+a:t==="bottom"?i+a:-a}function j1(n,t,e){const{y:i,width:r,height:a,options:s}=n,o=s.callout.start,l=V1(t,s.callout);let c,u;return t==="left"||t==="right"?(c={x:e.x,y:i+bn(a,o)},u={x:c.x+l,y:c.y}):(c={x:e.x+bn(r,o),y:e.y},u={x:c.x,y:c.y+l}),{sideStart:c,sideEnd:u}}function V1(n,t){const e=t.side;return n==="left"||n==="top"?-e:e}function q1(n,t){const e=t.position;return Mf.includes(e)?e:X1(n,t)}function X1(n,t){const{x:e,y:i,x2:r,y2:a,width:s,height:o,pointX:l,pointY:c,centerX:u,centerY:d,rotation:f}=n,g={x:u,y:d},p=t.start,m=bn(s,p),y=bn(o,p),v=[e,e+m,e+m,r],x=[i+y,a,i,a],w=[];for(let _=0;_<4;_++){const S=zn({x:v[_],y:x[_]},g,qt(f));w.push({position:Mf[_],distance:Gn(S,{x:l,y:c})})}return w.sort((_,S)=>_.distance-S.distance)[0].position}function G1({x:n,y:t,width:e,height:i,options:r}){const a=r.borderWidth/2,s=Xt(r.padding);return{x:n+s.left+a,y:t+s.top+a,width:e-s.left-s.right-r.borderWidth,height:i-s.top-s.bottom-r.borderWidth}}function K1(n,t,e){const{pointX:i,pointY:r}=n,a=t.margin;let s=i,o=r;return e==="left"?s+=a:e==="right"?s-=a:e==="top"?o+=a:e==="bottom"&&(o-=a),n.inRange(s,o)}const Ko=(n,t,e)=>({x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}),Zo=(n,t,e)=>Ko(t,e,Math.abs((n-t.y)/(e.y-t.y))).x,kf=(n,t,e)=>Ko(t,e,Math.abs((n-t.x)/(e.x-t.x))).y,rr=n=>n*n,Z1=(n,t,{x:e,y:i,x2:r,y2:a},s)=>s==="y"?{start:Math.min(i,a),end:Math.max(i,a),value:t}:{start:Math.min(e,r),end:Math.max(e,r),value:n},Of=(n,t,e,i)=>(1-i)*(1-i)*n+2*(1-i)*i*t+i*i*e,Qo=(n,t,e,i)=>({x:Of(n.x,t.x,e.x,i),y:Of(n.y,t.y,e.y,i)}),Pf=(n,t,e,i)=>2*(1-i)*(t-n)+2*i*(e-t),Ef=(n,t,e,i)=>-Math.atan2(Pf(n.x,t.x,e.x,i),Pf(n.y,t.y,e.y,i))+.5*dt;class ar extends te{inRange(t,e,i,r){const a=this.options.borderWidth/2;if(i!=="x"&&i!=="y"){const s={mouseX:t,mouseY:e},{path:o,ctx:l}=this;if(o){vn(l,this.options);const{chart:u}=this.$context,d=t*u.currentDevicePixelRatio,f=e*u.currentDevicePixelRatio,g=l.isPointInStroke(o,d,f)||Jo(this,s,r);return l.restore(),g}const c=rr(a);return eT(this,s,c,r)||Jo(this,s,r)}return Q1(this,{mouseX:t,mouseY:e},i,{hBorderWidth:a,useFinalPosition:r})}getCenterPoint(t){return ci(this,t)}draw(t){const{x:e,y:i,x2:r,y2:a,cp:s,options:o}=this;if(t.save(),!vn(t,o))return t.restore();ui(t,o);const l=Math.sqrt(Math.pow(r-e,2)+Math.pow(a-i,2));if(o.curve&&s)return cT(t,this,s,l),t.restore();const{startOpts:c,endOpts:u,startAdjust:d,endAdjust:f}=Nf(this),g=Math.atan2(a-i,r-e);t.translate(e,i),t.rotate(g),t.beginPath(),t.moveTo(0+d,0),t.lineTo(l-f,0),t.shadowColor=o.borderShadowColor,t.stroke(),tl(t,0,d,c),tl(t,l,-f,u),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){const i=T1(t,e),{x:r,y:a,x2:s,y2:o}=i,l=J1(i,t.chartArea),c=l?tT({x:r,y:a},{x:s,y:o},t.chartArea):{x:r,y:a,x2:s,y2:o,width:Math.abs(s-r),height:Math.abs(o-a)};if(c.centerX=(s+r)/2,c.centerY=(o+a)/2,c.initProperties=nr(t,c,e),e.curve){const d={x:c.x,y:c.y},f={x:c.x2,y:c.y2};c.cp=lT(c,e,Gn(d,f))}const u=nT(t,c,e.label);return u._visible=l,c.elements=[{type:"label",optionScope:"label",properties:u,initProperties:c.initProperties}],c}}ar.id="lineAnnotation";const Af={backgroundColor:void 0,backgroundShadowColor:void 0,borderColor:void 0,borderDash:void 0,borderDashOffset:void 0,borderShadowColor:void 0,borderWidth:void 0,display:void 0,fill:void 0,length:void 0,shadowBlur:void 0,shadowOffsetX:void 0,shadowOffsetY:void 0,width:void 0};ar.defaults={adjustScaleRange:!0,arrowHeads:{display:!1,end:Object.assign({},Af),fill:!1,length:12,start:Object.assign({},Af),width:6},borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:2,curve:!1,controlPoint:{y:"-50%"},display:!0,endValue:void 0,init:void 0,label:{backgroundColor:"rgba(0,0,0,0.8)",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderColor:"black",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:6,borderShadowColor:"transparent",borderWidth:0,callout:Object.assign({},ir.defaults.callout),color:"#fff",content:null,display:!1,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,opacity:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},scaleID:void 0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,value:void 0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0},ar.descriptors={arrowHeads:{start:{_fallback:!0},end:{_fallback:!0},_fallback:!0}},ar.defaultRoutes={borderColor:"color"};function Q1(n,{mouseX:t,mouseY:e},i,{hBorderWidth:r,useFinalPosition:a}){const s=Z1(t,e,n.getProps(["x","y","x2","y2"],a),i);return s.value>=s.start-r&&s.value<=s.end+r||Jo(n,{mouseX:t,mouseY:e},a,i)}function J1({x:n,y:t,x2:e,y2:i},{top:r,right:a,bottom:s,left:o}){return!(n<o&&e<o||n>a&&e>a||t<r&&i<r||t>s&&i>s)}function Rf({x:n,y:t},e,{top:i,right:r,bottom:a,left:s}){return n<s&&(t=kf(s,{x:n,y:t},e),n=s),n>r&&(t=kf(r,{x:n,y:t},e),n=r),t<i&&(n=Zo(i,{x:n,y:t},e),t=i),t>a&&(n=Zo(a,{x:n,y:t},e),t=a),{x:n,y:t}}function tT(n,t,e){const{x:i,y:r}=Rf(n,t,e),{x:a,y:s}=Rf(t,n,e);return{x:i,y:r,x2:a,y2:s,width:Math.abs(a-i),height:Math.abs(s-r)}}function eT(n,{mouseX:t,mouseY:e},i=Wn,r){const{x:a,y:s,x2:o,y2:l}=n.getProps(["x","y","x2","y2"],r),c=o-a,u=l-s,d=rr(c)+rr(u),f=d===0?-1:((t-a)*c+(e-s)*u)/d;let g,p;return f<0?(g=a,p=s):f>1?(g=o,p=l):(g=a+f*c,p=s+f*u),rr(t-g)+rr(e-p)<=i}function Jo(n,{mouseX:t,mouseY:e},i,r){const a=n.label;return a.options.display&&a.inRange(t,e,r,i)}function nT(n,t,e){const i=e.borderWidth,r=Xt(e.padding),a=Vo(n.ctx,e),s=a.width+r.width+i,o=a.height+r.height+i;return rT(t,e,{width:s,height:o,padding:r},n.chartArea)}function iT(n){const{x:t,y:e,x2:i,y2:r}=n,a=Math.atan2(r-e,i-t);return a>dt/2?a-dt:a<dt/-2?a+dt:a}function rT(n,t,e,i){const{width:r,height:a,padding:s}=e,{xAdjust:o,yAdjust:l}=t,c={x:n.x,y:n.y},u={x:n.x2,y:n.y2},d=t.rotation==="auto"?iT(n):qt(t.rotation),f=aT(r,a,d),g=sT(n,t,{labelSize:f,padding:s},i),p=n.cp?Qo(c,n.cp,u,g):Ko(c,u,g),m={size:f.w,min:i.left,max:i.right,padding:s.left},y={size:f.h,min:i.top,max:i.bottom,padding:s.top},v=If(p.x,m)+o,x=If(p.y,y)+l;return{x:v-r/2,y:x-a/2,x2:v+r/2,y2:x+a/2,centerX:v,centerY:x,pointX:p.x,pointY:p.y,width:r,height:a,rotation:yr(d)}}function aT(n,t,e){const i=Math.cos(e),r=Math.sin(e);return{w:Math.abs(n*i)+Math.abs(t*r),h:Math.abs(n*r)+Math.abs(t*i)}}function sT(n,t,e,i){let r;const a=oT(n,i);return t.position==="start"?r=Lf({w:n.x2-n.x,h:n.y2-n.y},e,t,a):t.position==="end"?r=1-Lf({w:n.x-n.x2,h:n.y-n.y2},e,t,a):r=zo(1,t.position),r}function Lf(n,t,e,i){const{labelSize:r,padding:a}=t,s=n.w*i.dx,o=n.h*i.dy,l=s>0&&(r.w/2+a.left-i.x)/s,c=o>0&&(r.h/2+a.top-i.y)/o;return oa(Math.max(l,c),0,.25)}function oT(n,t){const{x:e,x2:i,y:r,y2:a}=n,s=Math.min(r,a)-t.top,o=Math.min(e,i)-t.left,l=t.bottom-Math.max(r,a),c=t.right-Math.max(e,i);return{x:Math.min(o,c),y:Math.min(s,l),dx:o<=c?1:-1,dy:s<=l?1:-1}}function If(n,t){const{size:e,min:i,max:r,padding:a}=t,s=e/2;return e>r-i?(r+i)/2:(i>=n-a-s&&(n=i+a+s),r<=n+a+s&&(n=r-a-s),n)}function Nf(n){const t=n.options,e=t.arrowHeads&&t.arrowHeads.start,i=t.arrowHeads&&t.arrowHeads.end;return{startOpts:e,endOpts:i,startAdjust:Ff(n,e),endAdjust:Ff(n,i)}}function Ff(n,t){if(!t||!t.display)return 0;const{length:e,width:i}=t,r=n.options.borderWidth/2,a={x:e,y:i+r};return Math.abs(Zo(0,a,{x:0,y:r}))}function tl(n,t,e,i){if(!i||!i.display)return;const{length:r,width:a,fill:s,backgroundColor:o,borderColor:l}=i,c=Math.abs(t-r)+e;n.beginPath(),ui(n,i),vn(n,i),n.moveTo(c,-a),n.lineTo(t+e,0),n.lineTo(c,a),s===!0?(n.fillStyle=o||l,n.closePath(),n.fill(),n.shadowColor="transparent"):n.shadowColor=i.borderShadowColor,n.stroke()}function lT(n,t,e){const{x:i,y:r,x2:a,y2:s,centerX:o,centerY:l}=n,c=Math.atan2(s-r,a-i),u=Ho(t.controlPoint,0),d={x:o+bn(e,u.x,!1),y:l+bn(e,u.y,!1)};return zn(d,{x:o,y:l},c)}function Uf(n,{x:t,y:e},{angle:i,adjust:r},a){!a||!a.display||(n.save(),n.translate(t,e),n.rotate(i),tl(n,0,-r,a),n.restore())}function cT(n,t,e,i){const{x:r,y:a,x2:s,y2:o,options:l}=t,{startOpts:c,endOpts:u,startAdjust:d,endAdjust:f}=Nf(t),g={x:r,y:a},p={x:s,y:o},m=Ef(g,e,p,0),y=Ef(g,e,p,1)-dt,v=Qo(g,e,p,d/i),x=Qo(g,e,p,1-f/i),w=new Path2D;n.beginPath(),w.moveTo(v.x,v.y),w.quadraticCurveTo(e.x,e.y,x.x,x.y),n.shadowColor=l.borderShadowColor,n.stroke(w),t.path=w,t.ctx=n,Uf(n,v,{angle:m,adjust:d},c),Uf(n,x,{angle:y,adjust:f},u)}class sr extends te{inRange(t,e,i,r){const a=this.options.rotation,s=this.options.borderWidth;if(i!=="x"&&i!=="y")return uT({x:t,y:e},this.getProps(["width","height","centerX","centerY"],r),a,s);const{x:o,y:l,x2:c,y2:u}=this.getProps(["x","y","x2","y2"],r),d=s/2,f=i==="y"?{start:l,end:u}:{start:o,end:c},g=zn({x:t,y:e},this.getCenterPoint(r),qt(-a));return g[i]>=f.start-d-Wn&&g[i]<=f.end+d+Wn}getCenterPoint(t){return ci(this,t)}draw(t){const{width:e,height:i,centerX:r,centerY:a,options:s}=this;t.save(),jo(t,this.getCenterPoint(),s.rotation),ui(t,this.options),t.beginPath(),t.fillStyle=s.backgroundColor;const o=vn(t,s);t.ellipse(r,a,i/2,e/2,dt/2,0,2*dt),t.fill(),o&&(t.shadowColor=s.borderShadowColor,t.stroke()),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return bf(t,e)}}sr.id="ellipseAnnotation",sr.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,label:Object.assign({},fi.defaults.label),rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0},sr.defaultRoutes={borderColor:"color",backgroundColor:"color"},sr.descriptors={label:{_fallback:!0}};function uT(n,t,e,i){const{width:r,height:a,centerX:s,centerY:o}=t,l=r/2,c=a/2;if(l<=0||c<=0)return!1;const u=qt(e||0),d=i/2||0,f=Math.cos(u),g=Math.sin(u),p=Math.pow(f*(n.x-s)+g*(n.y-o),2),m=Math.pow(g*(n.x-s)-f*(n.y-o),2);return p/Math.pow(l+d,2)+m/Math.pow(c+d,2)<=1.0001}class da extends te{inRange(t,e,i,r){const{x:a,y:s,x2:o,y2:l,width:c}=this.getProps(["x","y","x2","y2","width"],r),u=this.options.borderWidth;if(i!=="x"&&i!=="y")return l1({x:t,y:e},this.getCenterPoint(r),c/2,u);const d=u/2,f=i==="y"?{start:s,end:l,value:e}:{start:a,end:o,value:t};return f.value>=f.start-d&&f.value<=f.end+d}getCenterPoint(t){return ci(this,t)}draw(t){const e=this.options,i=e.borderWidth;if(e.radius<.1)return;t.save(),t.fillStyle=e.backgroundColor,ui(t,e);const r=vn(t,e);y1(t,this,this.centerX,this.centerY),r&&!ca(e.pointStyle)&&(t.shadowColor=e.borderShadowColor,t.stroke()),t.restore(),e.borderWidth=i}resolveElementProperties(t,e){const i=yf(t,e);return i.initProperties=nr(t,i,e),i}}da.id="pointAnnotation",da.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,pointStyle:"circle",radius:10,rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0},da.defaultRoutes={borderColor:"color",backgroundColor:"color"};class fa extends te{inRange(t,e,i,r){if(i!=="x"&&i!=="y")return this.options.radius>=.1&&this.elements.length>1&&fT(this.elements,t,e,r);const a=zn({x:t,y:e},this.getCenterPoint(r),qt(-this.options.rotation)),s=this.elements.map(c=>i==="y"?c.bY:c.bX),o=Math.min(...s),l=Math.max(...s);return a[i]>=o&&a[i]<=l}getCenterPoint(t){return ci(this,t)}draw(t){const{elements:e,options:i}=this;t.save(),t.beginPath(),t.fillStyle=i.backgroundColor,ui(t,i);const r=vn(t,i);let a=!0;for(const s of e)a?(t.moveTo(s.x,s.y),a=!1):t.lineTo(s.x,s.y);t.closePath(),t.fill(),r&&(t.shadowColor=i.borderShadowColor,t.stroke()),t.restore()}resolveElementProperties(t,e){const i=yf(t,e),{sides:r,rotation:a}=e,s=[],o=2*dt/r;let l=a*Ia;for(let c=0;c<r;c++,l+=o){const u=dT(i,e,l);u.initProperties=nr(t,i,e),s.push(u)}return i.elements=s,i}}fa.id="polygonAnnotation",fa.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,point:{radius:0},radius:10,rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,sides:3,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0},fa.defaultRoutes={borderColor:"color",backgroundColor:"color"};function dT({centerX:n,centerY:t},{radius:e,borderWidth:i},r){const a=i/2,s=Math.sin(r),o=Math.cos(r),l={x:n+s*e,y:t-o*e};return{type:"point",optionScope:"point",properties:{x:l.x,y:l.y,centerX:l.x,centerY:l.y,bX:n+s*(e+a),bY:t-o*(e+a)}}}function fT(n,t,e,i){let r=!1,a=n[n.length-1].getProps(["bX","bY"],i);for(const s of n){const o=s.getProps(["bX","bY"],i);o.bY>e!=a.bY>e&&t<(a.bX-o.bX)*(e-o.bY)/(a.bY-o.bY)+o.bX&&(r=!r),a=o}return r}const xn={box:fi,ellipse:sr,label:ir,line:ar,point:da,polygon:fa};Object.keys(xn).forEach(n=>{Ft.describe(`elements.${xn[n].id}`,{_fallback:"plugins.annotation.common"})});const hT={update:Object.assign},gT=Go.concat(ua),Bf=(n,t)=>ct(t)?il(n,t):n,el=n=>n==="color"||n==="font";function nl(n="line"){return xn[n]?n:(console.warn(`Unknown annotation type: '${n}', defaulting to 'line'`),"line")}function pT(n,t,e,i){const r=yT(n,e.animations,i),a=t.annotations,s=xT(t.elements,a);for(let o=0;o<a.length;o++){const l=a[o],c=Wf(s,o,l.type),u=l.setContext(vT(n,c,l)),d=c.resolveElementProperties(n,u);d.skip=mT(d),"elements"in d&&(bT(c,d.elements,u,r),delete d.elements),ue(c.x)||Object.assign(c,d),Object.assign(c,d.initProperties),d.options=Yf(u),r.update(c,d)}}function mT(n){return isNaN(n.x)||isNaN(n.y)}function yT(n,t,e){return e==="reset"||e==="none"||e==="resize"?hT:new Ga(n,t)}function bT(n,t,e,i){const r=n.elements||(n.elements=[]);r.length=t.length;for(let a=0;a<t.length;a++){const s=t[a],o=s.properties,l=Wf(r,a,s.type,s.initProperties),c=e[s.optionScope].override(s);o.options=Yf(c),i.update(l,o)}}function Wf(n,t,e,i){const r=xn[nl(e)];let a=n[t];return(!a||!(a instanceof r))&&(a=n[t]=new r,Object.assign(a,i)),a}function Yf(n){const t=xn[nl(n.type)],e={};e.id=n.id,e.type=n.type,e.drawTime=n.drawTime,Object.assign(e,il(n,t.defaults),il(n,t.defaultRoutes));for(const i of gT)e[i]=n[i];return e}function il(n,t){const e={};for(const i of Object.keys(t)){const r=t[i],a=n[i];el(i)&&yt(a)?e[i]=a.map(s=>Bf(s,r)):e[i]=Bf(a,r)}return e}function vT(n,t,e){return t.$context||(t.$context=Object.assign(Object.create(n.getContext()),{element:t,id:e.id,type:"annotation"}))}function xT(n,t){const e=t.length,i=n.length;if(i<e){const r=e-i;n.splice(i,0,...new Array(r))}else i>e&&n.splice(e,i-e);return n}var wT="3.0.1";const wn=new Map,_T=Go.concat(ua);var zf={id:"annotation",version:wT,beforeRegister(){c1("chart.js","4.0",Te.version)},afterRegister(){Te.register(xn)},afterUnregister(){Te.unregister(xn)},beforeInit(n){wn.set(n,{annotations:[],elements:[],visibleElements:[],listeners:{},listened:!1,moveListened:!1,hooks:{},hooked:!1,hovered:[]})},beforeUpdate(n,t,e){const i=wn.get(n),r=i.annotations=[];let a=e.annotations;ct(a)?Object.keys(a).forEach(s=>{const o=a[s];ct(o)&&(o.id=s,r.push(o))}):yt(a)&&r.push(...a),N1(r,n.scales)},afterDataLimits(n,t){const e=wn.get(n);I1(n,t.scale,e.annotations.filter(i=>i.display&&i.adjustScaleRange))},afterUpdate(n,t,e){const i=wn.get(n);P1(n,i,e),pT(n,i,e,t.mode),i.visibleElements=i.elements.filter(r=>!r.skip&&r.options.display),L1(n,i,e)},beforeDatasetsDraw(n,t,e){ha(n,"beforeDatasetsDraw",e.clip)},afterDatasetsDraw(n,t,e){ha(n,"afterDatasetsDraw",e.clip)},beforeDraw(n,t,e){ha(n,"beforeDraw",e.clip)},afterDraw(n,t,e){ha(n,"afterDraw",e.clip)},beforeEvent(n,t,e){const i=wn.get(n);E1(i,t.event,e)&&(t.changed=!0)},afterDestroy(n){wn.delete(n)},_getState(n){return wn.get(n)},defaults:{animations:{numbers:{properties:["x","y","x2","y2","width","height","centerX","centerY","pointX","pointY","radius"],type:"number"}},clip:!0,interaction:{mode:void 0,axis:void 0,intersect:void 0},common:{drawTime:"afterDatasetsDraw",init:!1,label:{}}},descriptors:{_indexable:!1,_scriptable:n=>!_T.includes(n)&&n!=="init",annotations:{_allKeys:!1,_fallback:(n,t)=>`elements.${xn[nl(t.type)].id}`},interaction:{_fallback:!0},common:{label:{_indexable:el,_fallback:!0},_indexable:el}},additionalOptionScopes:[""]};function ha(n,t,e){const{ctx:i,chartArea:r}=n,a=wn.get(n);e&&Mi(i,r);const s=TT(a.visibleElements,t).sort((o,l)=>o.element.options.z-l.element.options.z);for(const o of s)DT(i,r,a,o);e&&Ci(i)}function TT(n,t){const e=[];for(const i of n)if(i.options.drawTime===t&&e.push({element:i,main:!0}),i.elements&&i.elements.length)for(const r of i.elements)r.options.display&&r.options.drawTime===t&&e.push({element:r});return e}function DT(n,t,e,i){const r=i.element;i.main?(Tf(e,r,"beforeDraw"),r.draw(n,t),Tf(e,r,"afterDraw")):r.draw(n,t)}const ga="24px",Hf=(n,t)=>{const e=n.__vccOpts||n;for(const[i,r]of t)e[i]=r;return e},ST=n=>(h.pushScopeId("data-v-bcbde7a2"),n=n(),h.popScopeId(),n),MT=["aria-hidden"],CT={key:0,"data-testid":"kui-icon-svg-title"},kT=ST(()=>h.createElementVNode("path",{d:"M9 20C8.45 20 7.97917 19.8042 7.5875 19.4125C7.19583 19.0208 7 18.55 7 18C7 17.45 7.19583 16.9792 7.5875 16.5875C7.97917 16.1958 8.45 16 9 16C9.55 16 10.0208 16.1958 10.4125 16.5875C10.8042 16.9792 11 17.45 11 18C11 18.55 10.8042 19.0208 10.4125 19.4125C10.0208 19.8042 9.55 20 9 20ZM15 20C14.45 20 13.9792 19.8042 13.5875 19.4125C13.1958 19.0208 13 18.55 13 18C13 17.45 13.1958 16.9792 13.5875 16.5875C13.9792 16.1958 14.45 16 15 16C15.55 16 16.0208 16.1958 16.4125 16.5875C16.8042 16.9792 17 17.45 17 18C17 18.55 16.8042 19.0208 16.4125 19.4125C16.0208 19.8042 15.55 20 15 20ZM9 14C8.45 14 7.97917 13.8042 7.5875 13.4125C7.19583 13.0208 7 12.55 7 12C7 11.45 7.19583 10.9792 7.5875 10.5875C7.97917 10.1958 8.45 10 9 10C9.55 10 10.0208 10.1958 10.4125 10.5875C10.8042 10.9792 11 11.45 11 12C11 12.55 10.8042 13.0208 10.4125 13.4125C10.0208 13.8042 9.55 14 9 14ZM15 14C14.45 14 13.9792 13.8042 13.5875 13.4125C13.1958 13.0208 13 12.55 13 12C13 11.45 13.1958 10.9792 13.5875 10.5875C13.9792 10.1958 14.45 10 15 10C15.55 10 16.0208 10.1958 16.4125 10.5875C16.8042 10.9792 17 11.45 17 12C17 12.55 16.8042 13.0208 16.4125 13.4125C16.0208 13.8042 15.55 14 15 14ZM9 8C8.45 8 7.97917 7.80417 7.5875 7.4125C7.19583 7.02083 7 6.55 7 6C7 5.45 7.19583 4.97917 7.5875 4.5875C7.97917 4.19583 8.45 4 9 4C9.55 4 10.0208 4.19583 10.4125 4.5875C10.8042 4.97917 11 5.45 11 6C11 6.55 10.8042 7.02083 10.4125 7.4125C10.0208 7.80417 9.55 8 9 8ZM15 8C14.45 8 13.9792 7.80417 13.5875 7.4125C13.1958 7.02083 13 6.55 13 6C13 5.45 13.1958 4.97917 13.5875 4.5875C13.9792 4.19583 14.45 4 15 4C15.55 4 16.0208 4.19583 16.4125 4.5875C16.8042 4.97917 17 5.45 17 6C17 6.55 16.8042 7.02083 16.4125 7.4125C16.0208 7.80417 15.55 8 15 8Z",fill:"currentColor"},null,-1)),OT=h.defineComponent({__name:"DragIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:ga,validator:n=>{if(typeof n=="number"&&n>0)return!0;if(typeof n=="string"){const t=String(n).replace(/px/gi,""),e=Number(t);if(e&&!isNaN(e)&&Number.isInteger(e)&&e>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(n){const t=n,e=h.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const r=String(t.size).replace(/px/gi,""),a=Number(r);if(a&&!isNaN(a)&&Number.isInteger(a)&&a>0)return`${a}px`}return ga}),i=h.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:e.value,lineHeight:"0",width:e.value}));return(r,a)=>(h.openBlock(),h.createBlock(h.resolveDynamicComponent(n.as),{"aria-hidden":n.decorative?"true":void 0,class:"kui-icon drag-icon","data-testid":"kui-icon-wrapper-drag-icon",style:h.normalizeStyle(i.value)},{default:h.withCtx(()=>[(h.openBlock(),h.createElementBlock("svg",{"aria-hidden":n.decorative?"true":void 0,"data-testid":"kui-icon-svg-drag-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[n.title?(h.openBlock(),h.createElementBlock("title",CT,h.toDisplayString(n.title),1)):h.createCommentVNode("",!0),kT],8,MT))]),_:1},8,["aria-hidden","style"]))}}),PT=Hf(OT,[["__scopeId","data-v-bcbde7a2"]]),ET=n=>(h.pushScopeId("data-v-755ff393"),n=n(),h.popScopeId(),n),AT=["aria-hidden"],RT={key:0,"data-testid":"kui-icon-svg-title"},LT=ET(()=>h.createElementVNode("path",{d:"M12.025 22.05C11.7583 22.05 11.5042 22 11.2625 21.9C11.0208 21.8 10.8 21.6583 10.6 21.475L2.575 13.45C2.39167 13.25 2.25 13.0292 2.15 12.7875C2.05 12.5458 2 12.2917 2 12.025C2 11.7583 2.05 11.5 2.15 11.25C2.25 11 2.39167 10.7833 2.575 10.6L10.6 2.575C10.8 2.375 11.0208 2.22917 11.2625 2.1375C11.5042 2.04583 11.7583 2 12.025 2C12.2917 2 12.55 2.04583 12.8 2.1375C13.05 2.22917 13.2667 2.375 13.45 2.575L21.475 10.6C21.675 10.7833 21.8208 11 21.9125 11.25C22.0042 11.5 22.05 11.7583 22.05 12.025C22.05 12.2917 22.0042 12.5458 21.9125 12.7875C21.8208 13.0292 21.675 13.25 21.475 13.45L13.45 21.475C13.2667 21.6583 13.05 21.8 12.8 21.9C12.55 22 12.2917 22.05 12.025 22.05ZM11.025 13.025H13.025V7.025H11.025V13.025ZM12.025 16.025C12.3083 16.025 12.5458 15.9292 12.7375 15.7375C12.9292 15.5458 13.025 15.3083 13.025 15.025C13.025 14.7417 12.9292 14.5042 12.7375 14.3125C12.5458 14.1208 12.3083 14.025 12.025 14.025C11.7417 14.025 11.5042 14.1208 11.3125 14.3125C11.1208 14.5042 11.025 14.7417 11.025 15.025C11.025 15.3083 11.1208 15.5458 11.3125 15.7375C11.5042 15.9292 11.7417 16.025 12.025 16.025Z",fill:"currentColor"},null,-1)),IT=h.defineComponent({__name:"WarningIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:ga,validator:n=>{if(typeof n=="number"&&n>0)return!0;if(typeof n=="string"){const t=String(n).replace(/px/gi,""),e=Number(t);if(e&&!isNaN(e)&&Number.isInteger(e)&&e>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(n){const t=n,e=h.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const r=String(t.size).replace(/px/gi,""),a=Number(r);if(a&&!isNaN(a)&&Number.isInteger(a)&&a>0)return`${a}px`}return ga}),i=h.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:e.value,lineHeight:"0",width:e.value}));return(r,a)=>(h.openBlock(),h.createBlock(h.resolveDynamicComponent(n.as),{"aria-hidden":n.decorative?"true":void 0,class:"kui-icon warning-icon","data-testid":"kui-icon-wrapper-warning-icon",style:h.normalizeStyle(i.value)},{default:h.withCtx(()=>[(h.openBlock(),h.createElementBlock("svg",{"aria-hidden":n.decorative?"true":void 0,"data-testid":"kui-icon-svg-warning-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[n.title?(h.openBlock(),h.createElementBlock("title",RT,h.toDisplayString(n.title),1)):h.createCommentVNode("",!0),LT],8,AT))]),_:1},8,["aria-hidden","style"]))}}),NT=Hf(IT,[["__scopeId","data-v-755ff393"]]),FT="#6c7489",UT="#995c00",BT="20px",WT="40px",YT={class:"tooltip-title"},zT={class:"title font-bold"},HT={key:1,class:"subtitle"},$T={class:"tooltip"},jT={key:0},VT={class:"display-label"},qT={class:"display-value"},XT=h.defineComponent({__name:"ChartTooltip",props:{showTooltip:{type:Boolean,required:!0,default:!1},left:{type:String,required:!1,default:null},top:{type:String,required:!1,default:null},tooltipTitle:{type:String,required:!1,default:""},context:{type:[String,Number],required:!1,default:""},series:{type:Array,required:!0,default:()=>[]},locked:{type:Boolean,required:!1,default:!1}},emits:["dimensions","top","left"],setup(n,{emit:t}){const e=t,i=n,r=h.ref(null),a=h.ref(!1),s=h.ref({x:0,y:0}),o=h.ref({x:0,y:0}),l=h.ref({left:i.left,top:i.top});h.watch(r,g=>{if(g){const{width:p,height:m}=g.getBoundingClientRect();e("dimensions",{width:p,height:m})}}),h.watch(()=>i.locked,g=>{g?(l.value.left=i.left,l.value.top=i.top):g===!1&&(e("top",l.value.top),e("left",l.value.left))});function c(g){if(r.value){a.value=!0;const p=window.getComputedStyle(r.value),m=p.transform||p.webkitTransform||p.mozTransform,y=new DOMMatrix(m),v=y.m41,x=y.m42;s.value={x:v,y:x},o.value={x:g.clientX,y:g.clientY},window.addEventListener("mousemove",d),window.addEventListener("mouseup",f)}}let u=null;function d(g){g.preventDefault(),g.stopPropagation(),a.value&&(u!==null&&window.cancelAnimationFrame(u),u=window.requestAnimationFrame(()=>{const p=g.clientX-o.value.x,m=g.clientY-o.value.y;l.value.left=`${s.value.x+p}px`,l.value.top=`${s.value.y+m}px`}))}function f(){a.value=!1,u!==null&&window.cancelAnimationFrame(u),window.removeEventListener("mousemove",d),window.removeEventListener("mouseup",f)}return(g,p)=>n.showTooltip?(h.openBlock(),h.createElementBlock("div",{key:0,ref_key:"tooltipEl",ref:r,class:h.normalizeClass(["tooltip-container",{locked:n.locked}]),style:h.normalizeStyle({transform:n.locked?`translate(${l.value.left}, ${l.value.top})`:`translate(${n.left}, ${n.top})`,left:"0",top:"0",pointerEvents:n.locked?"all":"none"}),onMousedown:c},[h.createElementVNode("div",YT,[h.createElementVNode("span",zT,h.toDisplayString(n.tooltipTitle),1),n.locked?(h.openBlock(),h.createBlock(h.unref(PT),{key:0,class:"drag-icon",color:h.unref(FT)},null,8,["color"])):h.createCommentVNode("",!0),n.context?(h.openBlock(),h.createElementBlock("span",HT,h.toDisplayString(n.context),1)):h.createCommentVNode("",!0)]),h.createElementVNode("ul",$T,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(n.series,({backgroundColor:m,borderColor:y,label:v,value:x})=>(h.openBlock(),h.createElementBlock(h.Fragment,{key:v},[n.series.length?(h.openBlock(),h.createElementBlock("li",jT,[h.createElementVNode("div",{class:"tooltip-legend",style:h.normalizeStyle({background:m,"border-color":y})},null,4),h.createElementVNode("span",VT,h.toDisplayString(v),1),h.createElementVNode("span",qT,h.toDisplayString(x),1)])):h.createCommentVNode("",!0)],64))),128))])],38)):h.createCommentVNode("",!0)}}),Ke=(n,t)=>{const e=n.__vccOpts||n;for(const[i,r]of t)e[i]=r;return e},rl=Ke(XT,[["__scopeId","data-v-fe2a03e1"]]),GT=["onClick"],KT=["title"],ZT={key:0,class:"sub-label"},al=Ke(h.defineComponent({__name:"ChartLegend",props:{id:{type:String,required:!0},items:{type:Object,required:!0},chartInstance:{type:Object,required:!1,default:()=>null}},setup(n){const t=n,e=h.ref(),i=h.ref([]),r=h.ref(!1),a=h.inject("showLegendValues",!0),s=h.inject("legendPosition",h.ref(Bt.Right)),o=h.ref([]),l=()=>{const m=e.value;if(!m||!i.value||m.children.length===0)return 0;let y=1,v=m.children[0].getBoundingClientRect().top;for(const x of i.value){const w=x.getBoundingClientRect().top;w!==v&&(y++,v=w)}return y},c=()=>{e.value&&s.value===Bt.Bottom&&(l()>1?r.value=!0:r.value=!1)},u=()=>{if(e.value&&s.value===Bt.Bottom){let m=0;i.value.forEach(v=>{const x=Array.from(v.children).reduce((w,_)=>w+_.offsetWidth,0);x>m&&(m=x)});const y=parseInt(WT,10);e.value.style.gridTemplateColumns=`repeat(auto-fit, ${m+y}px)`}},d=()=>{if(t.items.length!==o.value.length)return o.value=t.items,!0;for(let m=0;m<t.items.length;m++)if(t.items[m].text!==o.value[m].text)return o.value=t.items,!0;return!1};h.watch(()=>t.items,()=>{c(),d()&&u()},{immediate:!0,flush:"post"}),h.watch(()=>s.value,()=>{u()}),h.onMounted(()=>{o.value=t.items,window.addEventListener("resize",c)}),h.onBeforeUnmount(()=>{window.removeEventListener("resize",c)});const f=(m=0,y)=>{if(t.chartInstance===null)return;const v=t.chartInstance instanceof Te?t.chartInstance:t.chartInstance.chart;g(m,y)?v.hide(m,y):v.show(m,y),v.update()},g=(m=0,y)=>{if(t.chartInstance===null||t.chartInstance.chart===null)return!0;const v=t.chartInstance instanceof Te?t.chartInstance:t.chartInstance.chart,x=v.getDatasetMeta(m);return x.dataset||y===void 0?v.isDatasetVisible(m):!(x.data.length&&x.data[y].hidden)},p=m=>({[Bt.Right]:"vertical",[Bt.Bottom]:"horizontal",[Bt.Hidden]:"hidden"})[m];return(m,y)=>h.unref(s)!==h.unref(Bt).Hidden?(h.openBlock(),h.createElementBlock("ul",{key:0,ref_key:"legendContainerRef",ref:e,class:h.normalizeClass(["legend-container",p(h.unref(s))]),"data-testid":"legend"},[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(n.items,({fillStyle:v,strokeStyle:x,text:w,datasetIndex:_,index:S,value:C})=>(h.openBlock(),h.createElementBlock("li",{key:w,ref_for:!0,ref_key:"legendItemsRef",ref:i,onClick:k=>f(_,S)},[h.createElementVNode("div",{class:"legend",style:h.normalizeStyle({background:v,"border-color":x})},null,4),h.createElementVNode("div",{class:h.normalizeClass(["label-container",{"strike-through":!g(_,S)}])},[h.createElementVNode("div",{class:h.normalizeClass(["label",{"truncate-label":r.value}]),title:h.unref(s)===h.unref(Bt).Bottom&&w},h.toDisplayString(w),11,KT),C&&h.unref(a)?(h.openBlock(),h.createElementBlock("div",ZT,h.toDisplayString(C.formatted),1)):h.createCommentVNode("",!0)],2)],8,GT))),128))],2)):h.createCommentVNode("",!0)}}),[["__scopeId","data-v-fe1c4994"]]);let pa;const QT=new Uint8Array(16);function JT(){if(!pa&&(pa=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!pa))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return pa(QT)}const ne=[];for(let n=0;n<256;++n)ne.push((n+256).toString(16).slice(1));function tD(n,t=0){return ne[n[t+0]]+ne[n[t+1]]+ne[n[t+2]]+ne[n[t+3]]+"-"+ne[n[t+4]]+ne[n[t+5]]+"-"+ne[n[t+6]]+ne[n[t+7]]+"-"+ne[n[t+8]]+ne[n[t+9]]+"-"+ne[n[t+10]]+ne[n[t+11]]+ne[n[t+12]]+ne[n[t+13]]+ne[n[t+14]]+ne[n[t+15]]}const $f={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function _n(n,t,e){if($f.randomUUID&&!t&&!n)return $f.randomUUID();n=n||{};const i=n.random||(n.rng||JT)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,t){e=e||0;for(let r=0;r<16;++r)t[e+r]=i[r];return t}return tD(i)}const jf=(n,t)=>{const e=n.ctx,i=n.scales.y,r=n.scales.x,a=t[t.length-1].element;e.save(),e.strokeStyle="rgba(100, 100, 100, 1)",e.lineWidth=3,n.options.indexAxis==="x"?e.strokeRect(a.x-a.width/2,a.y,a.width,i.bottom-a.y):e.strokeRect(r.left,a.y-a.height/2,a.x-r.left,a.height),e.restore()},Vf={id:"highlightPlugin",clicked:!1,afterDatasetsDraw:function(n){this.clickedElements&&this.clickedElements.length&&jf(n,this.clickedElements)},afterEvent:function(n,{event:t}){var r;if(t.type!=="click"||!t.native)return;this.clicked=!this.clicked;const e=((r=n.options.interaction)==null?void 0:r.mode)||"index",i=n.getElementsAtEventForMode(t.native,e,{intersect:!1},!0);i.length&&this.clicked?(this.clickedElements=i,jf(n,this.clickedElements),this.previousHoverOption=n.options.hover,n.options.hover={mode:null}):(delete this.clickedElements,n.options.hover=this.previousHoverOption||n.options.hover,this.clicked=!1)},beforeDestroy(n){delete this.clickedElements,n.options.hover=this.previousHoverOption||n.options.hover,this.clicked=!1}},qf=6,eD=20,nD="100%",sl=30,iD=40,rD=0,aD=10,sD=10,oD=1,lD=6,cD=Ke(h.defineComponent({__name:"StackedBarChart",props:{chartData:{type:Object,required:!1,default:()=>({labels:[],datasets:[]})},tooltipTitle:{type:String,required:!1,default:""},legendValues:{type:Object,required:!1,default:null},metricUnit:{type:String,required:!1,default:""},orientation:{type:String,required:!1,default:"horizontal",validator:n=>["horizontal","vertical"].includes(n)},annotations:{type:Boolean,required:!1,default:!0},metricAxesTitle:{type:String,required:!1,default:null},dimensionAxesTitle:{type:String,required:!1,default:null},stacked:{type:Boolean,required:!1,default:!0},syntheticsDataKey:{type:String,required:!1,default:""},height:{type:String,required:!1,default:"500px",validator:n=>/(\d *)(px|%)/.test(n)},chartLegendSortFn:{type:Function,required:!1,default:(n,t)=>n.value&&t.value&&t.value.raw-n.value.raw},chartTooltipSortFn:{type:Function,required:!1,default:(n,t)=>t.rawValue-n.rawValue}},emits:["heightUpdate"],setup(n,{emit:t}){const e=n,i=t,{i18n:r}=St.useI18n(),{translateUnit:a}=St.useTranslatedUnits(),s=({chart:F},E)=>{var X;const $=F.data,K=(X=$.labels)==null?void 0:X.indexOf(E);return $.datasets.reduce((Q,at,B)=>{if(F.isDatasetVisible(B)){const N=at.data[K];return isNaN(N)?Q:Q+N}else return Q},0)},o=(F,E,$,K)=>{const X=K==="horizontal";E===null&&(E=r.t("entityNoName"));const Q={type:"label",yValue:N=>X?E:s(N,E),xValue:N=>X?s(N,E):E},at={...Q,position:X?{x:"start",y:"center"}:{x:"center",y:"end"},yAdjust:()=>X?0:-Math.abs(Gw()),content:N=>Co(s(N,E),$)},B={...Q,content:N=>zd(s(N,E),Yd(N.chart,F)),position:X?{x:"start",y:"center"}:{x:"center",y:"end"},xAdjust:N=>X?Wd(Co(s(N,E),$)):0,color:Bd};return{[`${E}-value`]:at,[`${E}-percent`]:B}},l=h.ref(),c=h.ref(),u=h.ref(_n()),d=_n(),f=_n(),g=h.ref([]),p=h.ref(h.inject("legendPosition",Bt.Right)),m=h.ref({show:!1,top:"0px",left:"0px",text:"",offset:0}),y=h.toRef(e,"metricUnit"),v=h.computed(()=>h.toRef(e,"orientation").value==="horizontal"),x=h.reactive({showTooltip:!1,tooltipContext:"",tooltipSeries:[],left:"",top:"",units:y,translateUnit:a,offset:0,width:0,height:0,locked:!1,chartType:v.value?ee.HORIZONTAL_BAR:ee.VERTICAL_BAR,chartTooltipSortFn:e.chartTooltipSortFn}),w=h.ref(0),_=()=>{var F;return e.annotations&&((F=e.chartData.labels)==null?void 0:F.reduce((E,$)=>Object.assign(E,o(e.chartData,$,y.value,e.orientation)),{}))},S={id:u.value,afterUpdate(F){w.value+=1,g.value=F.options.plugins.legend.labels.generateLabels(F).map(E=>({...E,value:e.legendValues&&e.legendValues[E.text]})).sort(e.chartLegendSortFn)}},C={id:d,afterUpdate(F){F.options.plugins.annotation.annotations=e.annotations?_():{}}},D=[S,{id:"axisHover",afterEvent(F,E){if(m.value.show=!1,E.event.type==="mousemove"){const $=E.event,K=F.options.indexAxis,X=F.scales,Q=F.scales[K].getLabelForValue(Number(F.scales[K].getValueForPixel($[K])));if((B=>B==="x"?$.y>X.x.top:$.x<X.y.right)(K))if(x.locked||(x.showTooltip=!1),Q.length>na){const N=F.canvas.getContext("2d").measureText(Q).width,tt=Math.abs(Math.round($.x-N*.5)),rt=Math.round($.x+N*.5);m.value.left=K==="x"?`${(tt>0?tt:rt)-m.value.offset}px`:`${$.x-N*.5-m.value.offset}px`,m.value.top=`${$.y-50}px`,m.value.show=!0,m.value.text=Q}else m.value.show=!1;else m.value.show=!1}}},{id:f,afterUpdate(F){F.options.layout.padding.right=v.value?L.value:0}},Vf,...e.annotations?[C]:[]],O=h.computed(()=>e.chartData.labels&&e.chartData.labels.length||0),A=h.computed(()=>{var E,$;let F=nD;if(l.value&&(F=l.value.width,l.value&&((E=e.chartData)!=null&&E.labels)&&(($=e.chartData)==null?void 0:$.labels.length)>sl&&!v.value)){const K=e.chartData.labels.length;F=`${l.value.offsetWidth+(K-sl)*iD}px`}return F}),R=h.computed(()=>{let F=parseInt(e.height,10);if(O.value&&v.value){const E=O.value*(eD+lD);F=Math.max(E,F)}return F});h.watch(()=>R.value,F=>{i("heightUpdate",F)}),St.useReportChartDataForSynthetics(h.toRef(e,"chartData"),h.toRef(e,"syntheticsDataKey")),h.onMounted(()=>{e.annotations&&Te.register(zf),window.requestAnimationFrame(()=>{i("heightUpdate",R.value)})});const W=h.computed(()=>{const F=St.useBarChartOptions({tooltipState:x,legendID:u.value,stacked:h.toRef(e,"stacked"),metricAxesTitle:h.toRef(e,"metricAxesTitle"),dimensionAxesTitle:h.toRef(e,"dimensionAxesTitle"),indexAxis:v.value?"y":"x",numLabels:O});return{...F.value,plugins:{...F.value.plugins,annotation:{annotations:_(),clip:!1}},layout:{autoPadding:!1,padding:{right:0,top:6*qf}}}}),V=St.useChartJSCommon("bar",l,h.toRef(e,"chartData"),D,W),L=h.computed(()=>{w.value;const F=e.chartData.labels,E=e.chartData.datasets,$=F.map((Q,at)=>E.reduce((B,N)=>isNaN(Number(N.data[at]))?B:B+Number(N.data[at]),0)),K=V.value?Yd(V.value,e.chartData):Kw(e.chartData);return $.map(Q=>Wd(Co(Q,y.value)+zd(Q,K))).reduce((Q,at)=>Math.max(Q,at),0)+qf});h.onBeforeUnmount(()=>{Te.unregister(zf)});const H={[Bt.Right]:"legend-row",[Bt.Bottom]:"column"},I=h.computed(()=>{if(c.value&&V.value){const F=window.devicePixelRatio,E=V.value,$=E.scales.y.width*F+oD,K=(E.scales.y.height+E.scales.y.top+E.scales.x.height)*F,X=c.value.getContext("2d");return X.scale(F,F),X.canvas.width=$,X.canvas.height=K,X.canvas.style.width=`${$/F}px`,X.canvas.style.height=`${K/F}px`,{scale:F,width:$*F,height:K*F,targetCtx:X}}return null}),et=F=>{if(I.value&&V.value){const E=I.value.scale,$=I.value.targetCtx,K=I.value.width,X=I.value.height,Q=V.value,at=Q.canvas,B=F.target;$.fillStyle="white",B.scrollLeft>=rD&&B.scrollLeft<=aD?($.globalCompositeOperation="source-over",$.clearRect(0,0,K,X),$.drawImage(at,0,0,K,X,0,0,K,X),$.globalCompositeOperation="destination-over",$.fillRect(0,0,K,X)):($.globalCompositeOperation="source-over",$.fillRect(0,(Q.scales.y.height+Q.scales.y.top+sD)*E,K,Q.scales.x.height*E)),x.offset=B.scrollLeft,m.value.offset=B.scrollLeft}},z=({width:F,height:E})=>{x.width=F,x.height=E};h.watch(()=>e.orientation,()=>{var F;if(c.value&&I.value){const E=I.value.width,$=I.value.height;((F=c.value)==null?void 0:F.getContext("2d")).clearRect(0,0,E,$)}x.showTooltip=!1,x.locked=!1}),h.watch(()=>e.annotations,F=>{V.value&&(F?V.value.options.plugins.annotation.annotations=_(e.chartData):delete V.value.options.plugins.annotation.annotations)});const Mt=()=>{x.showTooltip&&(x.locked=!x.locked)};return(F,E)=>(h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass(["chart-parent",H[p.value]])},[h.createElementVNode("canvas",{ref_key:"axis",ref:c,class:"axis"},null,512),h.createElementVNode("div",{class:"chart-container",style:h.normalizeStyle({"overflow-x":O.value>sl?"auto":"hidden"}),"on:scroll":et,onClick:E[0]||(E[0]=$=>Mt())},[h.createElementVNode("div",{class:"chart-body",style:h.normalizeStyle({width:A.value})},[h.createElementVNode("canvas",{ref_key:"canvas",ref:l},null,512)],4)],36),m.value.show?(h.openBlock(),h.createElementBlock("div",{key:0,class:"axis-tooltip",style:h.normalizeStyle({top:m.value.top,left:m.value.left})},h.toDisplayString(m.value.text),5)):h.createCommentVNode("",!0),h.createVNode(rl,{context:x.tooltipContext,left:x.left,locked:x.locked,series:x.tooltipSeries,"show-tooltip":x.showTooltip,"tooltip-title":n.tooltipTitle,top:x.top,onDimensions:z},null,8,["context","left","locked","series","show-tooltip","tooltip-title","top"]),h.createVNode(al,{id:u.value,"chart-instance":h.unref(V),items:g.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-502e266a"]]);/*!
|
|
24
|
+
*/const af={modes:{point(n,t){return sa(n,t,{intersect:!0})},nearest(n,t,e){return a1(n,t,e)},x(n,t,e){return sa(n,t,{intersect:e.intersect,axis:"x"})},y(n,t,e){return sa(n,t,{intersect:e.intersect,axis:"y"})}}};function Yo(n,t,e){return(af.modes[e.mode]||af.modes.nearest)(n,t,e)}function i1(n,t,e){return e!=="x"&&e!=="y"?n.inRange(t.x,t.y,"x",!0)||n.inRange(t.x,t.y,"y",!0):n.inRange(t.x,t.y,e,!0)}function r1(n,t,e){return e==="x"?{x:n.x,y:t.y}:e==="y"?{x:t.x,y:n.y}:t}function sa(n,t,e){return n.visibleElements.filter(i=>e.intersect?i.inRange(t.x,t.y):i1(i,t,e.axis))}function a1(n,t,e){let i=Number.POSITIVE_INFINITY;return sa(n,t,e).reduce((r,a)=>{const s=a.getCenterPoint(),o=r1(t,s,e.axis),l=Gn(t,o);return l<i?(r=[a],i=l):l===i&&r.push(a),r},[]).sort((r,a)=>r._index-a._index).slice(0,1)}const s1=(n,t)=>t>n||n.length>t.length&&n.slice(0,t.length)===t,Wn=.001,oa=(n,t,e)=>Math.min(e,Math.max(t,n));function o1(n,t,e){for(const i of Object.keys(n))n[i]=oa(n[i],t,e);return n}function l1(n,t,e,i){if(!n||!t||e<=0)return!1;const r=i/2;return Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2)<=Math.pow(e+r,2)}function sf(n,{x:t,y:e,x2:i,y2:r},a,s){const o=s/2,l=n.x>=t-o-Wn&&n.x<=i+o+Wn,c=n.y>=e-o-Wn&&n.y<=r+o+Wn;return a==="x"?l:(a==="y"||l)&&c}function ci(n,t){const{centerX:e,centerY:i}=n.getProps(["centerX","centerY"],t);return{x:e,y:i}}function c1(n,t,e,i=!0){const r=e.split(".");let a=0;for(const s of t.split(".")){const o=r[a++];if(parseInt(s,10)<parseInt(o,10))break;if(s1(o,s)){if(i)throw new Error(`${n} v${e} is not supported. v${t} or newer is required.`);return!1}}return!0}const of=n=>typeof n=="string"&&n.endsWith("%"),lf=n=>parseFloat(n)/100,cf=n=>oa(lf(n),0,1),la=(n,t)=>({x:n,y:t,x2:n,y2:t,width:0,height:0}),u1={box:n=>la(n.centerX,n.centerY),ellipse:n=>({centerX:n.centerX,centerY:n.centerX,radius:0,width:0,height:0}),label:n=>la(n.centerX,n.centerY),line:n=>la(n.x,n.y),point:n=>({centerX:n.centerX,centerY:n.centerY,radius:0,width:0,height:0}),polygon:n=>la(n.centerX,n.centerY)};function zo(n,t){return t==="start"?0:t==="end"?n:of(t)?cf(t)*n:n/2}function bn(n,t,e=!0){return typeof t=="number"?t:of(t)?(e?cf(t):lf(t))*n:n}function d1(n,t){const{x:e,width:i}=n,r=t.textAlign;return r==="center"?e+i/2:r==="end"||r==="right"?e+i:e}function Ho(n,t="center"){return ct(n)?{x:nt(n.x,t),y:nt(n.y,t)}:(n=nt(n,t),{x:n,y:n})}function uf(n){return n&&(ue(n.xValue)||ue(n.yValue))}function nr(n,t,e){const i=e.init;if(i){if(i===!0)return ff(t,e)}else return;return f1(n,t,e)}function df(n,t,e){let i=!1;return t.forEach(r=>{de(n[r])?(i=!0,e[r]=n[r]):ue(e[r])&&delete e[r]}),i}function ff(n,t){const e=t.type||"line";return u1[e](n)}function f1(n,t,e){const i=xt(e.init,[{chart:n,properties:t,options:e}]);if(i===!0)return ff(t,e);if(ct(i))return i}const $o=new Map,h1=n=>isNaN(n)||n<=0,g1=n=>n.reduce(function(t,e){return t+=e.string,t},"");function ca(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object HTMLImageElement]"||t==="[object HTMLCanvasElement]"}}function jo(n,{x:t,y:e},i){i&&(n.translate(t,e),n.rotate(qt(i)),n.translate(-t,-e))}function vn(n,t){if(t&&t.borderWidth)return n.lineCap=t.borderCapStyle,n.setLineDash(t.borderDash),n.lineDashOffset=t.borderDashOffset,n.lineJoin=t.borderJoinStyle,n.lineWidth=t.borderWidth,n.strokeStyle=t.borderColor,!0}function ui(n,t){n.shadowColor=t.backgroundShadowColor,n.shadowBlur=t.shadowBlur,n.shadowOffsetX=t.shadowOffsetX,n.shadowOffsetY=t.shadowOffsetY}function Vo(n,t){const e=t.content;if(ca(e))return{width:bn(e.width,t.width),height:bn(e.height,t.height)};const i=t.font,r=yt(i)?i.map(l=>Et(l)):[Et(i)],a=t.textStrokeWidth,s=yt(e)?e:[e],o=s.join()+g1(r)+a+(n._measureText?"-spriting":"");return $o.has(o)||$o.set(o,v1(n,s,r,a)),$o.get(o)}function hf(n,t,e){const{x:i,y:r,width:a,height:s}=t;n.save(),ui(n,e);const o=vn(n,e);n.fillStyle=e.backgroundColor,n.beginPath(),Kn(n,{x:i,y:r,w:a,h:s,radius:o1(un(e.borderRadius),0,Math.min(a,s)/2)}),n.closePath(),n.fill(),o&&(n.shadowColor=e.borderShadowColor,n.stroke()),n.restore()}function p1(n,t,e){const i=e.content;if(ca(i)){n.save(),n.globalAlpha=w1(e.opacity,i.style.opacity),n.drawImage(i,t.x,t.y,t.width,t.height),n.restore();return}const r=yt(i)?i:[i],a=e.font,s=yt(a)?a.map(d=>Et(d)):[Et(a)],o=e.color,l=yt(o)?o:[o],c=d1(t,e),u=t.y+e.textStrokeWidth/2;n.save(),n.textBaseline="middle",n.textAlign=e.textAlign,m1(n,e)&&x1(n,{x:c,y:u},r,s),_1(n,{x:c,y:u},r,{fonts:s,colors:l}),n.restore()}function m1(n,t){if(t.textStrokeWidth>0)return n.lineJoin="round",n.miterLimit=2,n.lineWidth=t.textStrokeWidth,n.strokeStyle=t.textStrokeColor,!0}function y1(n,t,e,i){const{radius:r,options:a}=t,s=a.pointStyle,o=a.rotation;let l=(o||0)*Ia;if(ca(s)){n.save(),n.translate(e,i),n.rotate(l),n.drawImage(s,-s.width/2,-s.height/2,s.width,s.height),n.restore();return}h1(r)||b1(n,{x:e,y:i,radius:r,rotation:o,style:s,rad:l})}function b1(n,{x:t,y:e,radius:i,rotation:r,style:a,rad:s}){let o,l,c,u;switch(n.beginPath(),a){default:n.arc(t,e,i,0,kt),n.closePath();break;case"triangle":n.moveTo(t+Math.sin(s)*i,e-Math.cos(s)*i),s+=mr,n.lineTo(t+Math.sin(s)*i,e-Math.cos(s)*i),s+=mr,n.lineTo(t+Math.sin(s)*i,e-Math.cos(s)*i),n.closePath();break;case"rectRounded":u=i*.516,c=i-u,o=Math.cos(s+we)*c,l=Math.sin(s+we)*c,n.arc(t-o,e-l,u,s-dt,s-Pt),n.arc(t+l,e-o,u,s-Pt,s),n.arc(t+o,e+l,u,s,s+Pt),n.arc(t-l,e+o,u,s+Pt,s+dt),n.closePath();break;case"rect":if(!r){c=Math.SQRT1_2*i,n.rect(t-c,e-c,2*c,2*c);break}s+=we;case"rectRot":o=Math.cos(s)*i,l=Math.sin(s)*i,n.moveTo(t-o,e-l),n.lineTo(t+l,e-o),n.lineTo(t+o,e+l),n.lineTo(t-l,e+o),n.closePath();break;case"crossRot":s+=we;case"cross":o=Math.cos(s)*i,l=Math.sin(s)*i,n.moveTo(t-o,e-l),n.lineTo(t+o,e+l),n.moveTo(t+l,e-o),n.lineTo(t-l,e+o);break;case"star":o=Math.cos(s)*i,l=Math.sin(s)*i,n.moveTo(t-o,e-l),n.lineTo(t+o,e+l),n.moveTo(t+l,e-o),n.lineTo(t-l,e+o),s+=we,o=Math.cos(s)*i,l=Math.sin(s)*i,n.moveTo(t-o,e-l),n.lineTo(t+o,e+l),n.moveTo(t+l,e-o),n.lineTo(t-l,e+o);break;case"line":o=Math.cos(s)*i,l=Math.sin(s)*i,n.moveTo(t-o,e-l),n.lineTo(t+o,e+l);break;case"dash":n.moveTo(t,e),n.lineTo(t+Math.cos(s)*i,e+Math.sin(s)*i);break}n.fill()}function v1(n,t,e,i){n.save();const r=t.length;let a=0,s=i;for(let o=0;o<r;o++){const l=e[Math.min(o,e.length-1)];n.font=l.string;const c=t[o];a=Math.max(a,n.measureText(c).width+i),s+=l.lineHeight}return n.restore(),{width:a,height:s}}function x1(n,{x:t,y:e},i,r){n.beginPath();let a=0;i.forEach(function(s,o){const l=r[Math.min(o,r.length-1)],c=l.lineHeight;n.font=l.string,n.strokeText(s,t,e+c/2+a),a+=c}),n.stroke()}function _1(n,{x:t,y:e},i,{fonts:r,colors:a}){let s=0;i.forEach(function(o,l){const c=a[Math.min(l,a.length-1)],u=r[Math.min(l,r.length-1)],d=u.lineHeight;n.beginPath(),n.font=u.string,n.fillStyle=c,n.fillText(o,t,e+d/2+s),s+=d,n.fill()})}function w1(n,t){const e=cn(n)?n:t;return cn(e)?oa(e,0,1):1}const gf={xScaleID:{min:"xMin",max:"xMax",start:"left",end:"right",startProp:"x",endProp:"x2"},yScaleID:{min:"yMin",max:"yMax",start:"bottom",end:"top",startProp:"y",endProp:"y2"}};function di(n,t,e){return t=typeof t=="number"?t:n.parse(t),Lt(t)?n.getPixelForValue(t):e}function Yn(n,t,e){const i=t[e];if(i||e==="scaleID")return i;const r=e.charAt(0),a=Object.values(n).filter(s=>s.axis&&s.axis===r);return a.length?a[0].id:r}function pf(n,t){if(n){const e=n.options.reverse,i=di(n,t.min,e?t.end:t.start),r=di(n,t.max,e?t.start:t.end);return{start:i,end:r}}}function mf(n,t){const{chartArea:e,scales:i}=n,r=i[Yn(i,t,"xScaleID")],a=i[Yn(i,t,"yScaleID")];let s=e.width/2,o=e.height/2;return r&&(s=di(r,t.xValue,r.left+r.width/2)),a&&(o=di(a,t.yValue,a.top+a.height/2)),{x:s,y:o}}function qo(n,t){const e=n.scales,i=e[Yn(e,t,"xScaleID")],r=e[Yn(e,t,"yScaleID")];if(!i&&!r)return{};let{left:a,right:s}=i||n.chartArea,{top:o,bottom:l}=r||n.chartArea;const c=vf(i,{min:t.xMin,max:t.xMax,start:a,end:s});a=c.start,s=c.end;const u=vf(r,{min:t.yMin,max:t.yMax,start:l,end:o});return o=u.start,l=u.end,{x:a,y:o,x2:s,y2:l,width:s-a,height:l-o,centerX:a+(s-a)/2,centerY:o+(l-o)/2}}function yf(n,t){if(!uf(t)){const e=qo(n,t);let i=t.radius;(!i||isNaN(i))&&(i=Math.min(e.width,e.height)/2,t.radius=i);const r=i*2,a=e.centerX+t.xAdjust,s=e.centerY+t.yAdjust;return{x:a-i,y:s-i,x2:a+i,y2:s+i,centerX:a,centerY:s,width:r,height:r,radius:i}}return D1(n,t)}function T1(n,t){const{scales:e,chartArea:i}=n,r=e[t.scaleID],a={x:i.left,y:i.top,x2:i.right,y2:i.bottom};return r?S1(r,a,t):M1(e,a,t),a}function bf(n,t){const e=qo(n,t);return e.initProperties=nr(n,e,t),e.elements=[{type:"label",optionScope:"label",properties:O1(n,e,t),initProperties:e.initProperties}],e}function D1(n,t){const e=mf(n,t),i=t.radius*2;return{x:e.x-t.radius+t.xAdjust,y:e.y-t.radius+t.yAdjust,x2:e.x+t.radius+t.xAdjust,y2:e.y+t.radius+t.yAdjust,centerX:e.x+t.xAdjust,centerY:e.y+t.yAdjust,radius:t.radius,width:i,height:i}}function vf(n,t){const e=pf(n,t)||t;return{start:Math.min(e.start,e.end),end:Math.max(e.start,e.end)}}function S1(n,t,e){const i=di(n,e.value,NaN),r=di(n,e.endValue,i);n.isHorizontal()?(t.x=i,t.x2=r):(t.y=i,t.y2=r)}function M1(n,t,e){for(const i of Object.keys(gf)){const r=n[Yn(n,e,i)];if(r){const{min:a,max:s,start:o,end:l,startProp:c,endProp:u}=gf[i],d=pf(r,{min:e[a],max:e[s],start:r[o],end:r[l]});t[c]=d.start,t[u]=d.end}}}function C1({properties:n,options:t},e,i,r){const{x:a,x2:s,width:o}=n;return xf({start:a,end:s,size:o,borderWidth:t.borderWidth},{position:i.x,padding:{start:r.left,end:r.right},adjust:t.label.xAdjust,size:e.width})}function k1({properties:n,options:t},e,i,r){const{y:a,y2:s,height:o}=n;return xf({start:a,end:s,size:o,borderWidth:t.borderWidth},{position:i.y,padding:{start:r.top,end:r.bottom},adjust:t.label.yAdjust,size:e.height})}function xf(n,t){const{start:e,end:i,borderWidth:r}=n,{position:a,padding:{start:s,end:o},adjust:l}=t,c=i-r-e-s-o-t.size;return e+r/2+l+zo(c,a)}function O1(n,t,e){const i=e.label;i.backgroundColor="transparent",i.callout.display=!1;const r=Ho(i.position),a=Xt(i.padding),s=Vo(n.ctx,i),o=C1({properties:t,options:e},s,r,a),l=k1({properties:t,options:e},s,r,a),c=s.width+a.width,u=s.height+a.height;return{x:o,y:l,x2:o+c,y2:l+u,width:c,height:u,centerX:o+c/2,centerY:l+u/2,rotation:i.rotation}}function zn(n,t,e){const i=Math.cos(e),r=Math.sin(e),a=t.x,s=t.y;return{x:a+i*(n.x-a)-r*(n.y-s),y:s+r*(n.x-a)+i*(n.y-s)}}const Xo=["enter","leave"],Go=Xo.concat("click");function P1(n,t,e){t.listened=df(e,Go,t.listeners),t.moveListened=!1,t._getElements=Yo,Xo.forEach(i=>{de(e[i])&&(t.moveListened=!0)}),(!t.listened||!t.moveListened)&&t.annotations.forEach(i=>{!t.listened&&de(i.click)&&(t.listened=!0),t.moveListened||Xo.forEach(r=>{de(i[r])&&(t.listened=!0,t.moveListened=!0)})})}function E1(n,t,e){if(n.listened)switch(t.type){case"mousemove":case"mouseout":return A1(n,t,e);case"click":return R1(n,t,e)}}function A1(n,t,e){if(!n.moveListened)return;let i;t.type==="mousemove"?i=Yo(n,t,e.interaction):i=[];const r=n.hovered;n.hovered=i;const a={state:n,event:t};let s=_f(a,"leave",r,i);return _f(a,"enter",i,r)||s}function _f({state:n,event:t},e,i,r){let a;for(const s of i)r.indexOf(s)<0&&(a=wf(s.options[e]||n.listeners[e],s,t)||a);return a}function R1(n,t,e){const i=n.listeners,r=Yo(n,t,e.interaction);let a;for(const s of r)a=wf(s.options.click||i.click,s,t)||a;return a}function wf(n,t,e){return xt(n,[t.$context,e])===!0}const ua=["afterDraw","beforeDraw"];function L1(n,t,e){const i=t.visibleElements;t.hooked=df(e,ua,t.hooks),t.hooked||i.forEach(r=>{t.hooked||ua.forEach(a=>{de(r.options[a])&&(t.hooked=!0)})})}function Tf(n,t,e){if(n.hooked){const i=t.options[e]||n.hooks[e];return xt(i,[t.$context])}}function I1(n,t,e){const i=W1(n.scales,t,e);let r=Df(t,i,"min","suggestedMin");r=Df(t,i,"max","suggestedMax")||r,r&&de(t.handleTickRangeOptions)&&t.handleTickRangeOptions()}function N1(n,t){for(const e of n)U1(e,t)}function Df(n,t,e,i){if(Lt(t[e])&&!F1(n.options,e,i)){const r=n[e]!==t[e];return n[e]=t[e],r}}function F1(n,t,e){return ue(n[t])||ue(n[e])}function U1(n,t){for(const e of["scaleID","xScaleID","yScaleID"]){const i=Yn(t,n,e);i&&!t[i]&&B1(n,e)&&console.warn(`No scale found with id '${i}' for annotation '${n.id}'`)}}function B1(n,t){if(t==="scaleID")return!0;const e=t.charAt(0);for(const i of["Min","Max","Value"])if(ue(n[e+i]))return!0;return!1}function W1(n,t,e){const i=t.axis,r=t.id,a=i+"ScaleID",s={min:nt(t.min,Number.NEGATIVE_INFINITY),max:nt(t.max,Number.POSITIVE_INFINITY)};for(const o of e)o.scaleID===r?Sf(o,t,["value","endValue"],s):Yn(n,o,a)===r&&Sf(o,t,[i+"Min",i+"Max",i+"Value"],s);return s}function Sf(n,t,e,i){for(const r of e){const a=n[r];if(ue(a)){const s=t.parse(a);i.min=Math.min(i.min,s),i.max=Math.max(i.max,s)}}}class fi extends te{inRange(t,e,i,r){const{x:a,y:s}=zn({x:t,y:e},this.getCenterPoint(r),qt(-this.options.rotation));return sf({x:a,y:s},this.getProps(["x","y","x2","y2"],r),i,this.options.borderWidth)}getCenterPoint(t){return ci(this,t)}draw(t){t.save(),jo(t,this.getCenterPoint(),this.options.rotation),hf(t,this,this.options),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return bf(t,e)}}fi.id="boxAnnotation",fi.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,label:{backgroundColor:"transparent",borderWidth:0,callout:{display:!1},color:"black",content:null,display:!1,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,opacity:void 0,padding:6,position:"center",rotation:void 0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0},fi.defaultRoutes={borderColor:"color",backgroundColor:"color"},fi.descriptors={label:{_fallback:!0}};const Mf=["left","bottom","top","right"];class ir extends te{inRange(t,e,i,r){const{x:a,y:s}=zn({x:t,y:e},this.getCenterPoint(r),qt(-this.rotation));return sf({x:a,y:s},this.getProps(["x","y","x2","y2"],r),i,this.options.borderWidth)}getCenterPoint(t){return ci(this,t)}draw(t){const e=this.options,i=!ue(this._visible)||this._visible;!e.display||!e.content||!i||(t.save(),jo(t,this.getCenterPoint(),this.rotation),z1(t,this),hf(t,this,e),p1(t,G1(this),e),t.restore())}resolveElementProperties(t,e){let i;if(uf(e))i=mf(t,e);else{const{centerX:o,centerY:l}=qo(t,e);i={x:o,y:l}}const r=Xt(e.padding),a=Vo(t.ctx,e),s=Y1(i,a,e,r);return{initProperties:nr(t,s,e),pointX:i.x,pointY:i.y,...s,rotation:e.rotation}}}ir.id="labelAnnotation",ir.defaults={adjustScaleRange:!0,backgroundColor:"transparent",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:0,callout:{borderCapStyle:"butt",borderColor:void 0,borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:1,display:!1,margin:5,position:"auto",side:5,start:"50%"},color:"black",content:null,display:!0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:void 0},height:void 0,init:void 0,opacity:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0},ir.defaultRoutes={borderColor:"color"};function Y1(n,t,e,i){const r=t.width+i.width+e.borderWidth,a=t.height+i.height+e.borderWidth,s=Ho(e.position,"center"),o=Cf(n.x,r,e.xAdjust,s.x),l=Cf(n.y,a,e.yAdjust,s.y);return{x:o,y:l,x2:o+r,y2:l+a,width:r,height:a,centerX:o+r/2,centerY:l+a/2}}function Cf(n,t,e=0,i){return n-zo(t,i)+e}function z1(n,t){const{pointX:e,pointY:i,options:r}=t,a=r.callout,s=a&&a.display&&q1(t,a);if(!s||K1(t,a,s))return;if(n.save(),n.beginPath(),!vn(n,a))return n.restore();const{separatorStart:l,separatorEnd:c}=H1(t,s),{sideStart:u,sideEnd:d}=j1(t,s,l);(a.margin>0||r.borderWidth===0)&&(n.moveTo(l.x,l.y),n.lineTo(c.x,c.y)),n.moveTo(u.x,u.y),n.lineTo(d.x,d.y);const f=zn({x:e,y:i},t.getCenterPoint(),qt(-t.rotation));n.lineTo(f.x,f.y),n.stroke(),n.restore()}function H1(n,t){const{x:e,y:i,x2:r,y2:a}=n,s=$1(n,t);let o,l;return t==="left"||t==="right"?(o={x:e+s,y:i},l={x:o.x,y:a}):(o={x:e,y:i+s},l={x:r,y:o.y}),{separatorStart:o,separatorEnd:l}}function $1(n,t){const{width:e,height:i,options:r}=n,a=r.callout.margin+r.borderWidth/2;return t==="right"?e+a:t==="bottom"?i+a:-a}function j1(n,t,e){const{y:i,width:r,height:a,options:s}=n,o=s.callout.start,l=V1(t,s.callout);let c,u;return t==="left"||t==="right"?(c={x:e.x,y:i+bn(a,o)},u={x:c.x+l,y:c.y}):(c={x:e.x+bn(r,o),y:e.y},u={x:c.x,y:c.y+l}),{sideStart:c,sideEnd:u}}function V1(n,t){const e=t.side;return n==="left"||n==="top"?-e:e}function q1(n,t){const e=t.position;return Mf.includes(e)?e:X1(n,t)}function X1(n,t){const{x:e,y:i,x2:r,y2:a,width:s,height:o,pointX:l,pointY:c,centerX:u,centerY:d,rotation:f}=n,g={x:u,y:d},p=t.start,x=bn(s,p),m=bn(o,p),v=[e,e+x,e+x,r],b=[i+m,a,i,a],_=[];for(let w=0;w<4;w++){const S=zn({x:v[w],y:b[w]},g,qt(f));_.push({position:Mf[w],distance:Gn(S,{x:l,y:c})})}return _.sort((w,S)=>w.distance-S.distance)[0].position}function G1({x:n,y:t,width:e,height:i,options:r}){const a=r.borderWidth/2,s=Xt(r.padding);return{x:n+s.left+a,y:t+s.top+a,width:e-s.left-s.right-r.borderWidth,height:i-s.top-s.bottom-r.borderWidth}}function K1(n,t,e){const{pointX:i,pointY:r}=n,a=t.margin;let s=i,o=r;return e==="left"?s+=a:e==="right"?s-=a:e==="top"?o+=a:e==="bottom"&&(o-=a),n.inRange(s,o)}const Ko=(n,t,e)=>({x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}),Zo=(n,t,e)=>Ko(t,e,Math.abs((n-t.y)/(e.y-t.y))).x,kf=(n,t,e)=>Ko(t,e,Math.abs((n-t.x)/(e.x-t.x))).y,rr=n=>n*n,Z1=(n,t,{x:e,y:i,x2:r,y2:a},s)=>s==="y"?{start:Math.min(i,a),end:Math.max(i,a),value:t}:{start:Math.min(e,r),end:Math.max(e,r),value:n},Of=(n,t,e,i)=>(1-i)*(1-i)*n+2*(1-i)*i*t+i*i*e,Qo=(n,t,e,i)=>({x:Of(n.x,t.x,e.x,i),y:Of(n.y,t.y,e.y,i)}),Pf=(n,t,e,i)=>2*(1-i)*(t-n)+2*i*(e-t),Ef=(n,t,e,i)=>-Math.atan2(Pf(n.x,t.x,e.x,i),Pf(n.y,t.y,e.y,i))+.5*dt;class ar extends te{inRange(t,e,i,r){const a=this.options.borderWidth/2;if(i!=="x"&&i!=="y"){const s={mouseX:t,mouseY:e},{path:o,ctx:l}=this;if(o){vn(l,this.options);const{chart:u}=this.$context,d=t*u.currentDevicePixelRatio,f=e*u.currentDevicePixelRatio,g=l.isPointInStroke(o,d,f)||Jo(this,s,r);return l.restore(),g}const c=rr(a);return eT(this,s,c,r)||Jo(this,s,r)}return Q1(this,{mouseX:t,mouseY:e},i,{hBorderWidth:a,useFinalPosition:r})}getCenterPoint(t){return ci(this,t)}draw(t){const{x:e,y:i,x2:r,y2:a,cp:s,options:o}=this;if(t.save(),!vn(t,o))return t.restore();ui(t,o);const l=Math.sqrt(Math.pow(r-e,2)+Math.pow(a-i,2));if(o.curve&&s)return cT(t,this,s,l),t.restore();const{startOpts:c,endOpts:u,startAdjust:d,endAdjust:f}=Nf(this),g=Math.atan2(a-i,r-e);t.translate(e,i),t.rotate(g),t.beginPath(),t.moveTo(0+d,0),t.lineTo(l-f,0),t.shadowColor=o.borderShadowColor,t.stroke(),tl(t,0,d,c),tl(t,l,-f,u),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){const i=T1(t,e),{x:r,y:a,x2:s,y2:o}=i,l=J1(i,t.chartArea),c=l?tT({x:r,y:a},{x:s,y:o},t.chartArea):{x:r,y:a,x2:s,y2:o,width:Math.abs(s-r),height:Math.abs(o-a)};if(c.centerX=(s+r)/2,c.centerY=(o+a)/2,c.initProperties=nr(t,c,e),e.curve){const d={x:c.x,y:c.y},f={x:c.x2,y:c.y2};c.cp=lT(c,e,Gn(d,f))}const u=nT(t,c,e.label);return u._visible=l,c.elements=[{type:"label",optionScope:"label",properties:u,initProperties:c.initProperties}],c}}ar.id="lineAnnotation";const Af={backgroundColor:void 0,backgroundShadowColor:void 0,borderColor:void 0,borderDash:void 0,borderDashOffset:void 0,borderShadowColor:void 0,borderWidth:void 0,display:void 0,fill:void 0,length:void 0,shadowBlur:void 0,shadowOffsetX:void 0,shadowOffsetY:void 0,width:void 0};ar.defaults={adjustScaleRange:!0,arrowHeads:{display:!1,end:Object.assign({},Af),fill:!1,length:12,start:Object.assign({},Af),width:6},borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:2,curve:!1,controlPoint:{y:"-50%"},display:!0,endValue:void 0,init:void 0,label:{backgroundColor:"rgba(0,0,0,0.8)",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderColor:"black",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:6,borderShadowColor:"transparent",borderWidth:0,callout:Object.assign({},ir.defaults.callout),color:"#fff",content:null,display:!1,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,opacity:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},scaleID:void 0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,value:void 0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0},ar.descriptors={arrowHeads:{start:{_fallback:!0},end:{_fallback:!0},_fallback:!0}},ar.defaultRoutes={borderColor:"color"};function Q1(n,{mouseX:t,mouseY:e},i,{hBorderWidth:r,useFinalPosition:a}){const s=Z1(t,e,n.getProps(["x","y","x2","y2"],a),i);return s.value>=s.start-r&&s.value<=s.end+r||Jo(n,{mouseX:t,mouseY:e},a,i)}function J1({x:n,y:t,x2:e,y2:i},{top:r,right:a,bottom:s,left:o}){return!(n<o&&e<o||n>a&&e>a||t<r&&i<r||t>s&&i>s)}function Rf({x:n,y:t},e,{top:i,right:r,bottom:a,left:s}){return n<s&&(t=kf(s,{x:n,y:t},e),n=s),n>r&&(t=kf(r,{x:n,y:t},e),n=r),t<i&&(n=Zo(i,{x:n,y:t},e),t=i),t>a&&(n=Zo(a,{x:n,y:t},e),t=a),{x:n,y:t}}function tT(n,t,e){const{x:i,y:r}=Rf(n,t,e),{x:a,y:s}=Rf(t,n,e);return{x:i,y:r,x2:a,y2:s,width:Math.abs(a-i),height:Math.abs(s-r)}}function eT(n,{mouseX:t,mouseY:e},i=Wn,r){const{x:a,y:s,x2:o,y2:l}=n.getProps(["x","y","x2","y2"],r),c=o-a,u=l-s,d=rr(c)+rr(u),f=d===0?-1:((t-a)*c+(e-s)*u)/d;let g,p;return f<0?(g=a,p=s):f>1?(g=o,p=l):(g=a+f*c,p=s+f*u),rr(t-g)+rr(e-p)<=i}function Jo(n,{mouseX:t,mouseY:e},i,r){const a=n.label;return a.options.display&&a.inRange(t,e,r,i)}function nT(n,t,e){const i=e.borderWidth,r=Xt(e.padding),a=Vo(n.ctx,e),s=a.width+r.width+i,o=a.height+r.height+i;return rT(t,e,{width:s,height:o,padding:r},n.chartArea)}function iT(n){const{x:t,y:e,x2:i,y2:r}=n,a=Math.atan2(r-e,i-t);return a>dt/2?a-dt:a<dt/-2?a+dt:a}function rT(n,t,e,i){const{width:r,height:a,padding:s}=e,{xAdjust:o,yAdjust:l}=t,c={x:n.x,y:n.y},u={x:n.x2,y:n.y2},d=t.rotation==="auto"?iT(n):qt(t.rotation),f=aT(r,a,d),g=sT(n,t,{labelSize:f,padding:s},i),p=n.cp?Qo(c,n.cp,u,g):Ko(c,u,g),x={size:f.w,min:i.left,max:i.right,padding:s.left},m={size:f.h,min:i.top,max:i.bottom,padding:s.top},v=If(p.x,x)+o,b=If(p.y,m)+l;return{x:v-r/2,y:b-a/2,x2:v+r/2,y2:b+a/2,centerX:v,centerY:b,pointX:p.x,pointY:p.y,width:r,height:a,rotation:yr(d)}}function aT(n,t,e){const i=Math.cos(e),r=Math.sin(e);return{w:Math.abs(n*i)+Math.abs(t*r),h:Math.abs(n*r)+Math.abs(t*i)}}function sT(n,t,e,i){let r;const a=oT(n,i);return t.position==="start"?r=Lf({w:n.x2-n.x,h:n.y2-n.y},e,t,a):t.position==="end"?r=1-Lf({w:n.x-n.x2,h:n.y-n.y2},e,t,a):r=zo(1,t.position),r}function Lf(n,t,e,i){const{labelSize:r,padding:a}=t,s=n.w*i.dx,o=n.h*i.dy,l=s>0&&(r.w/2+a.left-i.x)/s,c=o>0&&(r.h/2+a.top-i.y)/o;return oa(Math.max(l,c),0,.25)}function oT(n,t){const{x:e,x2:i,y:r,y2:a}=n,s=Math.min(r,a)-t.top,o=Math.min(e,i)-t.left,l=t.bottom-Math.max(r,a),c=t.right-Math.max(e,i);return{x:Math.min(o,c),y:Math.min(s,l),dx:o<=c?1:-1,dy:s<=l?1:-1}}function If(n,t){const{size:e,min:i,max:r,padding:a}=t,s=e/2;return e>r-i?(r+i)/2:(i>=n-a-s&&(n=i+a+s),r<=n+a+s&&(n=r-a-s),n)}function Nf(n){const t=n.options,e=t.arrowHeads&&t.arrowHeads.start,i=t.arrowHeads&&t.arrowHeads.end;return{startOpts:e,endOpts:i,startAdjust:Ff(n,e),endAdjust:Ff(n,i)}}function Ff(n,t){if(!t||!t.display)return 0;const{length:e,width:i}=t,r=n.options.borderWidth/2,a={x:e,y:i+r};return Math.abs(Zo(0,a,{x:0,y:r}))}function tl(n,t,e,i){if(!i||!i.display)return;const{length:r,width:a,fill:s,backgroundColor:o,borderColor:l}=i,c=Math.abs(t-r)+e;n.beginPath(),ui(n,i),vn(n,i),n.moveTo(c,-a),n.lineTo(t+e,0),n.lineTo(c,a),s===!0?(n.fillStyle=o||l,n.closePath(),n.fill(),n.shadowColor="transparent"):n.shadowColor=i.borderShadowColor,n.stroke()}function lT(n,t,e){const{x:i,y:r,x2:a,y2:s,centerX:o,centerY:l}=n,c=Math.atan2(s-r,a-i),u=Ho(t.controlPoint,0),d={x:o+bn(e,u.x,!1),y:l+bn(e,u.y,!1)};return zn(d,{x:o,y:l},c)}function Uf(n,{x:t,y:e},{angle:i,adjust:r},a){!a||!a.display||(n.save(),n.translate(t,e),n.rotate(i),tl(n,0,-r,a),n.restore())}function cT(n,t,e,i){const{x:r,y:a,x2:s,y2:o,options:l}=t,{startOpts:c,endOpts:u,startAdjust:d,endAdjust:f}=Nf(t),g={x:r,y:a},p={x:s,y:o},x=Ef(g,e,p,0),m=Ef(g,e,p,1)-dt,v=Qo(g,e,p,d/i),b=Qo(g,e,p,1-f/i),_=new Path2D;n.beginPath(),_.moveTo(v.x,v.y),_.quadraticCurveTo(e.x,e.y,b.x,b.y),n.shadowColor=l.borderShadowColor,n.stroke(_),t.path=_,t.ctx=n,Uf(n,v,{angle:x,adjust:d},c),Uf(n,b,{angle:m,adjust:f},u)}class sr extends te{inRange(t,e,i,r){const a=this.options.rotation,s=this.options.borderWidth;if(i!=="x"&&i!=="y")return uT({x:t,y:e},this.getProps(["width","height","centerX","centerY"],r),a,s);const{x:o,y:l,x2:c,y2:u}=this.getProps(["x","y","x2","y2"],r),d=s/2,f=i==="y"?{start:l,end:u}:{start:o,end:c},g=zn({x:t,y:e},this.getCenterPoint(r),qt(-a));return g[i]>=f.start-d-Wn&&g[i]<=f.end+d+Wn}getCenterPoint(t){return ci(this,t)}draw(t){const{width:e,height:i,centerX:r,centerY:a,options:s}=this;t.save(),jo(t,this.getCenterPoint(),s.rotation),ui(t,this.options),t.beginPath(),t.fillStyle=s.backgroundColor;const o=vn(t,s);t.ellipse(r,a,i/2,e/2,dt/2,0,2*dt),t.fill(),o&&(t.shadowColor=s.borderShadowColor,t.stroke()),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return bf(t,e)}}sr.id="ellipseAnnotation",sr.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,label:Object.assign({},fi.defaults.label),rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0},sr.defaultRoutes={borderColor:"color",backgroundColor:"color"},sr.descriptors={label:{_fallback:!0}};function uT(n,t,e,i){const{width:r,height:a,centerX:s,centerY:o}=t,l=r/2,c=a/2;if(l<=0||c<=0)return!1;const u=qt(e||0),d=i/2||0,f=Math.cos(u),g=Math.sin(u),p=Math.pow(f*(n.x-s)+g*(n.y-o),2),x=Math.pow(g*(n.x-s)-f*(n.y-o),2);return p/Math.pow(l+d,2)+x/Math.pow(c+d,2)<=1.0001}class da extends te{inRange(t,e,i,r){const{x:a,y:s,x2:o,y2:l,width:c}=this.getProps(["x","y","x2","y2","width"],r),u=this.options.borderWidth;if(i!=="x"&&i!=="y")return l1({x:t,y:e},this.getCenterPoint(r),c/2,u);const d=u/2,f=i==="y"?{start:s,end:l,value:e}:{start:a,end:o,value:t};return f.value>=f.start-d&&f.value<=f.end+d}getCenterPoint(t){return ci(this,t)}draw(t){const e=this.options,i=e.borderWidth;if(e.radius<.1)return;t.save(),t.fillStyle=e.backgroundColor,ui(t,e);const r=vn(t,e);y1(t,this,this.centerX,this.centerY),r&&!ca(e.pointStyle)&&(t.shadowColor=e.borderShadowColor,t.stroke()),t.restore(),e.borderWidth=i}resolveElementProperties(t,e){const i=yf(t,e);return i.initProperties=nr(t,i,e),i}}da.id="pointAnnotation",da.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,pointStyle:"circle",radius:10,rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0},da.defaultRoutes={borderColor:"color",backgroundColor:"color"};class fa extends te{inRange(t,e,i,r){if(i!=="x"&&i!=="y")return this.options.radius>=.1&&this.elements.length>1&&fT(this.elements,t,e,r);const a=zn({x:t,y:e},this.getCenterPoint(r),qt(-this.options.rotation)),s=this.elements.map(c=>i==="y"?c.bY:c.bX),o=Math.min(...s),l=Math.max(...s);return a[i]>=o&&a[i]<=l}getCenterPoint(t){return ci(this,t)}draw(t){const{elements:e,options:i}=this;t.save(),t.beginPath(),t.fillStyle=i.backgroundColor,ui(t,i);const r=vn(t,i);let a=!0;for(const s of e)a?(t.moveTo(s.x,s.y),a=!1):t.lineTo(s.x,s.y);t.closePath(),t.fill(),r&&(t.shadowColor=i.borderShadowColor,t.stroke()),t.restore()}resolveElementProperties(t,e){const i=yf(t,e),{sides:r,rotation:a}=e,s=[],o=2*dt/r;let l=a*Ia;for(let c=0;c<r;c++,l+=o){const u=dT(i,e,l);u.initProperties=nr(t,i,e),s.push(u)}return i.elements=s,i}}fa.id="polygonAnnotation",fa.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,point:{radius:0},radius:10,rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,sides:3,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0},fa.defaultRoutes={borderColor:"color",backgroundColor:"color"};function dT({centerX:n,centerY:t},{radius:e,borderWidth:i},r){const a=i/2,s=Math.sin(r),o=Math.cos(r),l={x:n+s*e,y:t-o*e};return{type:"point",optionScope:"point",properties:{x:l.x,y:l.y,centerX:l.x,centerY:l.y,bX:n+s*(e+a),bY:t-o*(e+a)}}}function fT(n,t,e,i){let r=!1,a=n[n.length-1].getProps(["bX","bY"],i);for(const s of n){const o=s.getProps(["bX","bY"],i);o.bY>e!=a.bY>e&&t<(a.bX-o.bX)*(e-o.bY)/(a.bY-o.bY)+o.bX&&(r=!r),a=o}return r}const xn={box:fi,ellipse:sr,label:ir,line:ar,point:da,polygon:fa};Object.keys(xn).forEach(n=>{Ft.describe(`elements.${xn[n].id}`,{_fallback:"plugins.annotation.common"})});const hT={update:Object.assign},gT=Go.concat(ua),Bf=(n,t)=>ct(t)?il(n,t):n,el=n=>n==="color"||n==="font";function nl(n="line"){return xn[n]?n:(console.warn(`Unknown annotation type: '${n}', defaulting to 'line'`),"line")}function pT(n,t,e,i){const r=yT(n,e.animations,i),a=t.annotations,s=xT(t.elements,a);for(let o=0;o<a.length;o++){const l=a[o],c=Wf(s,o,l.type),u=l.setContext(vT(n,c,l)),d=c.resolveElementProperties(n,u);d.skip=mT(d),"elements"in d&&(bT(c,d.elements,u,r),delete d.elements),ue(c.x)||Object.assign(c,d),Object.assign(c,d.initProperties),d.options=Yf(u),r.update(c,d)}}function mT(n){return isNaN(n.x)||isNaN(n.y)}function yT(n,t,e){return e==="reset"||e==="none"||e==="resize"?hT:new Ga(n,t)}function bT(n,t,e,i){const r=n.elements||(n.elements=[]);r.length=t.length;for(let a=0;a<t.length;a++){const s=t[a],o=s.properties,l=Wf(r,a,s.type,s.initProperties),c=e[s.optionScope].override(s);o.options=Yf(c),i.update(l,o)}}function Wf(n,t,e,i){const r=xn[nl(e)];let a=n[t];return(!a||!(a instanceof r))&&(a=n[t]=new r,Object.assign(a,i)),a}function Yf(n){const t=xn[nl(n.type)],e={};e.id=n.id,e.type=n.type,e.drawTime=n.drawTime,Object.assign(e,il(n,t.defaults),il(n,t.defaultRoutes));for(const i of gT)e[i]=n[i];return e}function il(n,t){const e={};for(const i of Object.keys(t)){const r=t[i],a=n[i];el(i)&&yt(a)?e[i]=a.map(s=>Bf(s,r)):e[i]=Bf(a,r)}return e}function vT(n,t,e){return t.$context||(t.$context=Object.assign(Object.create(n.getContext()),{element:t,id:e.id,type:"annotation"}))}function xT(n,t){const e=t.length,i=n.length;if(i<e){const r=e-i;n.splice(i,0,...new Array(r))}else i>e&&n.splice(e,i-e);return n}var _T="3.0.1";const _n=new Map,wT=Go.concat(ua);var zf={id:"annotation",version:_T,beforeRegister(){c1("chart.js","4.0",Te.version)},afterRegister(){Te.register(xn)},afterUnregister(){Te.unregister(xn)},beforeInit(n){_n.set(n,{annotations:[],elements:[],visibleElements:[],listeners:{},listened:!1,moveListened:!1,hooks:{},hooked:!1,hovered:[]})},beforeUpdate(n,t,e){const i=_n.get(n),r=i.annotations=[];let a=e.annotations;ct(a)?Object.keys(a).forEach(s=>{const o=a[s];ct(o)&&(o.id=s,r.push(o))}):yt(a)&&r.push(...a),N1(r,n.scales)},afterDataLimits(n,t){const e=_n.get(n);I1(n,t.scale,e.annotations.filter(i=>i.display&&i.adjustScaleRange))},afterUpdate(n,t,e){const i=_n.get(n);P1(n,i,e),pT(n,i,e,t.mode),i.visibleElements=i.elements.filter(r=>!r.skip&&r.options.display),L1(n,i,e)},beforeDatasetsDraw(n,t,e){ha(n,"beforeDatasetsDraw",e.clip)},afterDatasetsDraw(n,t,e){ha(n,"afterDatasetsDraw",e.clip)},beforeDraw(n,t,e){ha(n,"beforeDraw",e.clip)},afterDraw(n,t,e){ha(n,"afterDraw",e.clip)},beforeEvent(n,t,e){const i=_n.get(n);E1(i,t.event,e)&&(t.changed=!0)},afterDestroy(n){_n.delete(n)},_getState(n){return _n.get(n)},defaults:{animations:{numbers:{properties:["x","y","x2","y2","width","height","centerX","centerY","pointX","pointY","radius"],type:"number"}},clip:!0,interaction:{mode:void 0,axis:void 0,intersect:void 0},common:{drawTime:"afterDatasetsDraw",init:!1,label:{}}},descriptors:{_indexable:!1,_scriptable:n=>!wT.includes(n)&&n!=="init",annotations:{_allKeys:!1,_fallback:(n,t)=>`elements.${xn[nl(t.type)].id}`},interaction:{_fallback:!0},common:{label:{_indexable:el,_fallback:!0},_indexable:el}},additionalOptionScopes:[""]};function ha(n,t,e){const{ctx:i,chartArea:r}=n,a=_n.get(n);e&&Mi(i,r);const s=TT(a.visibleElements,t).sort((o,l)=>o.element.options.z-l.element.options.z);for(const o of s)DT(i,r,a,o);e&&Ci(i)}function TT(n,t){const e=[];for(const i of n)if(i.options.drawTime===t&&e.push({element:i,main:!0}),i.elements&&i.elements.length)for(const r of i.elements)r.options.display&&r.options.drawTime===t&&e.push({element:r});return e}function DT(n,t,e,i){const r=i.element;i.main?(Tf(e,r,"beforeDraw"),r.draw(n,t),Tf(e,r,"afterDraw")):r.draw(n,t)}const ga="24px",Hf=(n,t)=>{const e=n.__vccOpts||n;for(const[i,r]of t)e[i]=r;return e},ST=n=>(h.pushScopeId("data-v-bcbde7a2"),n=n(),h.popScopeId(),n),MT=["aria-hidden"],CT={key:0,"data-testid":"kui-icon-svg-title"},kT=ST(()=>h.createElementVNode("path",{d:"M9 20C8.45 20 7.97917 19.8042 7.5875 19.4125C7.19583 19.0208 7 18.55 7 18C7 17.45 7.19583 16.9792 7.5875 16.5875C7.97917 16.1958 8.45 16 9 16C9.55 16 10.0208 16.1958 10.4125 16.5875C10.8042 16.9792 11 17.45 11 18C11 18.55 10.8042 19.0208 10.4125 19.4125C10.0208 19.8042 9.55 20 9 20ZM15 20C14.45 20 13.9792 19.8042 13.5875 19.4125C13.1958 19.0208 13 18.55 13 18C13 17.45 13.1958 16.9792 13.5875 16.5875C13.9792 16.1958 14.45 16 15 16C15.55 16 16.0208 16.1958 16.4125 16.5875C16.8042 16.9792 17 17.45 17 18C17 18.55 16.8042 19.0208 16.4125 19.4125C16.0208 19.8042 15.55 20 15 20ZM9 14C8.45 14 7.97917 13.8042 7.5875 13.4125C7.19583 13.0208 7 12.55 7 12C7 11.45 7.19583 10.9792 7.5875 10.5875C7.97917 10.1958 8.45 10 9 10C9.55 10 10.0208 10.1958 10.4125 10.5875C10.8042 10.9792 11 11.45 11 12C11 12.55 10.8042 13.0208 10.4125 13.4125C10.0208 13.8042 9.55 14 9 14ZM15 14C14.45 14 13.9792 13.8042 13.5875 13.4125C13.1958 13.0208 13 12.55 13 12C13 11.45 13.1958 10.9792 13.5875 10.5875C13.9792 10.1958 14.45 10 15 10C15.55 10 16.0208 10.1958 16.4125 10.5875C16.8042 10.9792 17 11.45 17 12C17 12.55 16.8042 13.0208 16.4125 13.4125C16.0208 13.8042 15.55 14 15 14ZM9 8C8.45 8 7.97917 7.80417 7.5875 7.4125C7.19583 7.02083 7 6.55 7 6C7 5.45 7.19583 4.97917 7.5875 4.5875C7.97917 4.19583 8.45 4 9 4C9.55 4 10.0208 4.19583 10.4125 4.5875C10.8042 4.97917 11 5.45 11 6C11 6.55 10.8042 7.02083 10.4125 7.4125C10.0208 7.80417 9.55 8 9 8ZM15 8C14.45 8 13.9792 7.80417 13.5875 7.4125C13.1958 7.02083 13 6.55 13 6C13 5.45 13.1958 4.97917 13.5875 4.5875C13.9792 4.19583 14.45 4 15 4C15.55 4 16.0208 4.19583 16.4125 4.5875C16.8042 4.97917 17 5.45 17 6C17 6.55 16.8042 7.02083 16.4125 7.4125C16.0208 7.80417 15.55 8 15 8Z",fill:"currentColor"},null,-1)),OT=h.defineComponent({__name:"DragIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:ga,validator:n=>{if(typeof n=="number"&&n>0)return!0;if(typeof n=="string"){const t=String(n).replace(/px/gi,""),e=Number(t);if(e&&!isNaN(e)&&Number.isInteger(e)&&e>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(n){const t=n,e=h.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const r=String(t.size).replace(/px/gi,""),a=Number(r);if(a&&!isNaN(a)&&Number.isInteger(a)&&a>0)return`${a}px`}return ga}),i=h.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:e.value,lineHeight:"0",width:e.value}));return(r,a)=>(h.openBlock(),h.createBlock(h.resolveDynamicComponent(n.as),{"aria-hidden":n.decorative?"true":void 0,class:"kui-icon drag-icon","data-testid":"kui-icon-wrapper-drag-icon",style:h.normalizeStyle(i.value)},{default:h.withCtx(()=>[(h.openBlock(),h.createElementBlock("svg",{"aria-hidden":n.decorative?"true":void 0,"data-testid":"kui-icon-svg-drag-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[n.title?(h.openBlock(),h.createElementBlock("title",CT,h.toDisplayString(n.title),1)):h.createCommentVNode("",!0),kT],8,MT))]),_:1},8,["aria-hidden","style"]))}}),PT=Hf(OT,[["__scopeId","data-v-bcbde7a2"]]),ET=n=>(h.pushScopeId("data-v-755ff393"),n=n(),h.popScopeId(),n),AT=["aria-hidden"],RT={key:0,"data-testid":"kui-icon-svg-title"},LT=ET(()=>h.createElementVNode("path",{d:"M12.025 22.05C11.7583 22.05 11.5042 22 11.2625 21.9C11.0208 21.8 10.8 21.6583 10.6 21.475L2.575 13.45C2.39167 13.25 2.25 13.0292 2.15 12.7875C2.05 12.5458 2 12.2917 2 12.025C2 11.7583 2.05 11.5 2.15 11.25C2.25 11 2.39167 10.7833 2.575 10.6L10.6 2.575C10.8 2.375 11.0208 2.22917 11.2625 2.1375C11.5042 2.04583 11.7583 2 12.025 2C12.2917 2 12.55 2.04583 12.8 2.1375C13.05 2.22917 13.2667 2.375 13.45 2.575L21.475 10.6C21.675 10.7833 21.8208 11 21.9125 11.25C22.0042 11.5 22.05 11.7583 22.05 12.025C22.05 12.2917 22.0042 12.5458 21.9125 12.7875C21.8208 13.0292 21.675 13.25 21.475 13.45L13.45 21.475C13.2667 21.6583 13.05 21.8 12.8 21.9C12.55 22 12.2917 22.05 12.025 22.05ZM11.025 13.025H13.025V7.025H11.025V13.025ZM12.025 16.025C12.3083 16.025 12.5458 15.9292 12.7375 15.7375C12.9292 15.5458 13.025 15.3083 13.025 15.025C13.025 14.7417 12.9292 14.5042 12.7375 14.3125C12.5458 14.1208 12.3083 14.025 12.025 14.025C11.7417 14.025 11.5042 14.1208 11.3125 14.3125C11.1208 14.5042 11.025 14.7417 11.025 15.025C11.025 15.3083 11.1208 15.5458 11.3125 15.7375C11.5042 15.9292 11.7417 16.025 12.025 16.025Z",fill:"currentColor"},null,-1)),IT=h.defineComponent({__name:"WarningIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:ga,validator:n=>{if(typeof n=="number"&&n>0)return!0;if(typeof n=="string"){const t=String(n).replace(/px/gi,""),e=Number(t);if(e&&!isNaN(e)&&Number.isInteger(e)&&e>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(n){const t=n,e=h.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const r=String(t.size).replace(/px/gi,""),a=Number(r);if(a&&!isNaN(a)&&Number.isInteger(a)&&a>0)return`${a}px`}return ga}),i=h.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:e.value,lineHeight:"0",width:e.value}));return(r,a)=>(h.openBlock(),h.createBlock(h.resolveDynamicComponent(n.as),{"aria-hidden":n.decorative?"true":void 0,class:"kui-icon warning-icon","data-testid":"kui-icon-wrapper-warning-icon",style:h.normalizeStyle(i.value)},{default:h.withCtx(()=>[(h.openBlock(),h.createElementBlock("svg",{"aria-hidden":n.decorative?"true":void 0,"data-testid":"kui-icon-svg-warning-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[n.title?(h.openBlock(),h.createElementBlock("title",RT,h.toDisplayString(n.title),1)):h.createCommentVNode("",!0),LT],8,AT))]),_:1},8,["aria-hidden","style"]))}}),NT=Hf(IT,[["__scopeId","data-v-755ff393"]]),FT="#6c7489",UT="#995c00",BT="20px",WT="40px",YT={class:"tooltip-title"},zT={class:"title font-bold"},HT={key:1,class:"subtitle"},$T={class:"tooltip"},jT={key:0},VT={class:"display-label"},qT={class:"display-value"},XT=h.defineComponent({__name:"ChartTooltip",props:{showTooltip:{type:Boolean,required:!0,default:!1},left:{type:String,required:!1,default:null},top:{type:String,required:!1,default:null},tooltipTitle:{type:String,required:!1,default:""},context:{type:[String,Number],required:!1,default:""},series:{type:Array,required:!0,default:()=>[]},locked:{type:Boolean,required:!1,default:!1}},emits:["dimensions","top","left"],setup(n,{emit:t}){const e=t,i=n,r=h.ref(null),a=h.ref(!1),s=h.ref({x:0,y:0}),o=h.ref({x:0,y:0}),l=h.ref({left:i.left,top:i.top});h.watch(r,g=>{if(g){const{width:p,height:x}=g.getBoundingClientRect();e("dimensions",{width:p,height:x})}}),h.watch(()=>i.locked,g=>{g?(l.value.left=i.left,l.value.top=i.top):g===!1&&(e("top",l.value.top),e("left",l.value.left))});function c(g){if(r.value){a.value=!0;const p=window.getComputedStyle(r.value),x=p.transform||p.webkitTransform||p.mozTransform,m=new DOMMatrix(x),v=m.m41,b=m.m42;s.value={x:v,y:b},o.value={x:g.clientX,y:g.clientY},window.addEventListener("mousemove",d),window.addEventListener("mouseup",f)}}let u=null;function d(g){g.preventDefault(),g.stopPropagation(),a.value&&(u!==null&&window.cancelAnimationFrame(u),u=window.requestAnimationFrame(()=>{const p=g.clientX-o.value.x,x=g.clientY-o.value.y;l.value.left=`${s.value.x+p}px`,l.value.top=`${s.value.y+x}px`}))}function f(){a.value=!1,u!==null&&window.cancelAnimationFrame(u),window.removeEventListener("mousemove",d),window.removeEventListener("mouseup",f)}return(g,p)=>n.showTooltip?(h.openBlock(),h.createElementBlock("div",{key:0,ref_key:"tooltipEl",ref:r,class:h.normalizeClass(["tooltip-container",{locked:n.locked}]),style:h.normalizeStyle({transform:n.locked?`translate(${l.value.left}, ${l.value.top})`:`translate(${n.left}, ${n.top})`,left:"0",top:"0",pointerEvents:n.locked?"all":"none"}),onMousedown:c},[h.createElementVNode("div",YT,[h.createElementVNode("span",zT,h.toDisplayString(n.tooltipTitle),1),n.locked?(h.openBlock(),h.createBlock(h.unref(PT),{key:0,class:"drag-icon",color:h.unref(FT)},null,8,["color"])):h.createCommentVNode("",!0),n.context?(h.openBlock(),h.createElementBlock("span",HT,h.toDisplayString(n.context),1)):h.createCommentVNode("",!0)]),h.createElementVNode("ul",$T,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(n.series,({backgroundColor:x,borderColor:m,label:v,value:b})=>(h.openBlock(),h.createElementBlock(h.Fragment,{key:v},[n.series.length?(h.openBlock(),h.createElementBlock("li",jT,[h.createElementVNode("div",{class:"tooltip-legend",style:h.normalizeStyle({background:x,"border-color":m})},null,4),h.createElementVNode("span",VT,h.toDisplayString(v),1),h.createElementVNode("span",qT,h.toDisplayString(b),1)])):h.createCommentVNode("",!0)],64))),128))])],38)):h.createCommentVNode("",!0)}}),Ke=(n,t)=>{const e=n.__vccOpts||n;for(const[i,r]of t)e[i]=r;return e},rl=Ke(XT,[["__scopeId","data-v-fe2a03e1"]]),GT=["onClick"],KT=["title"],ZT={key:0,class:"sub-label"},al=Ke(h.defineComponent({__name:"ChartLegend",props:{id:{type:String,required:!0},items:{type:Object,required:!0},chartInstance:{type:Object,required:!1,default:()=>null}},setup(n){const t=n,e=h.ref(),i=h.ref([]),r=h.ref(!1),a=h.inject("showLegendValues",!0),s=h.inject("legendPosition",h.ref(Bt.Right)),o=h.ref([]),l=()=>{const m=e.value;if(!m||!i.value||m.children.length===0)return 0;const v=m.children[0].getBoundingClientRect().top;for(const b of i.value)if(b.getBoundingClientRect().top>v)return!0;return!1},c=()=>{e.value&&s.value===Bt.Bottom&&(l()?r.value=!0:r.value=!1)},u=()=>{if(e.value&&s.value===Bt.Bottom){let m=0;i.value.forEach(b=>{const _=Array.from(b.children).reduce((w,S)=>w+S.offsetWidth,0);_>m&&(m=_)});const v=parseInt(WT,10);e.value.style.gridTemplateColumns=`repeat(auto-fit, ${m+v}px)`}},d=()=>{if(t.items.length!==o.value.length)return o.value=t.items,!0;for(let m=0;m<t.items.length;m++)if(t.items[m].text!==o.value[m].text)return o.value=t.items,!0;return!1};h.watch(()=>t.items,()=>{c(),d()&&u()},{immediate:!0,flush:"post"});const f=new ResizeObserver(()=>{c()});h.watch(()=>s.value,()=>{u()}),h.onMounted(()=>{o.value=t.items,e.value&&f.observe(e.value)}),h.onBeforeUnmount(()=>{e.value&&f.unobserve(e.value)});const g=(m=0,v)=>{if(t.chartInstance===null)return;const b=t.chartInstance instanceof Te?t.chartInstance:t.chartInstance.chart;p(m,v)?b.hide(m,v):b.show(m,v),b.update()},p=(m=0,v)=>{if(t.chartInstance===null||t.chartInstance.chart===null)return!0;const b=t.chartInstance instanceof Te?t.chartInstance:t.chartInstance.chart,_=b.getDatasetMeta(m);return _.dataset||v===void 0?b.isDatasetVisible(m):!(_.data.length&&_.data[v].hidden)},x=m=>({[Bt.Right]:"vertical",[Bt.Bottom]:"horizontal",[Bt.Hidden]:"hidden"})[m];return(m,v)=>h.unref(s)!==h.unref(Bt).Hidden?(h.openBlock(),h.createElementBlock("ul",{key:0,ref_key:"legendContainerRef",ref:e,class:h.normalizeClass(["legend-container",x(h.unref(s))]),"data-testid":"legend"},[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(n.items,({fillStyle:b,strokeStyle:_,text:w,datasetIndex:S,index:C,value:k})=>(h.openBlock(),h.createElementBlock("li",{key:w,ref_for:!0,ref_key:"legendItemsRef",ref:i,onClick:T=>g(S,C)},[h.createElementVNode("div",{class:"legend",style:h.normalizeStyle({background:b,"border-color":_})},null,4),h.createElementVNode("div",{class:h.normalizeClass(["label-container",{"strike-through":!p(S,C)}])},[h.createElementVNode("div",{class:h.normalizeClass(["label",{"truncate-label":r.value}]),title:h.unref(s)===h.unref(Bt).Bottom&&w},h.toDisplayString(w),11,KT),k&&h.unref(a)?(h.openBlock(),h.createElementBlock("div",ZT,h.toDisplayString(k.formatted),1)):h.createCommentVNode("",!0)],2)],8,GT))),128))],2)):h.createCommentVNode("",!0)}}),[["__scopeId","data-v-71ab0079"]]);let pa;const QT=new Uint8Array(16);function JT(){if(!pa&&(pa=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!pa))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return pa(QT)}const ne=[];for(let n=0;n<256;++n)ne.push((n+256).toString(16).slice(1));function tD(n,t=0){return ne[n[t+0]]+ne[n[t+1]]+ne[n[t+2]]+ne[n[t+3]]+"-"+ne[n[t+4]]+ne[n[t+5]]+"-"+ne[n[t+6]]+ne[n[t+7]]+"-"+ne[n[t+8]]+ne[n[t+9]]+"-"+ne[n[t+10]]+ne[n[t+11]]+ne[n[t+12]]+ne[n[t+13]]+ne[n[t+14]]+ne[n[t+15]]}const $f={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function wn(n,t,e){if($f.randomUUID&&!t&&!n)return $f.randomUUID();n=n||{};const i=n.random||(n.rng||JT)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,t){e=e||0;for(let r=0;r<16;++r)t[e+r]=i[r];return t}return tD(i)}const jf=(n,t)=>{const e=n.ctx,i=n.scales.y,r=n.scales.x,a=t[t.length-1].element;e.save(),e.strokeStyle="rgba(100, 100, 100, 1)",e.lineWidth=3,n.options.indexAxis==="x"?e.strokeRect(a.x-a.width/2,a.y,a.width,i.bottom-a.y):e.strokeRect(r.left,a.y-a.height/2,a.x-r.left,a.height),e.restore()},Vf={id:"highlightPlugin",clicked:!1,afterDatasetsDraw:function(n){this.clickedElements&&this.clickedElements.length&&jf(n,this.clickedElements)},afterEvent:function(n,{event:t}){var r;if(t.type!=="click"||!t.native)return;this.clicked=!this.clicked;const e=((r=n.options.interaction)==null?void 0:r.mode)||"index",i=n.getElementsAtEventForMode(t.native,e,{intersect:!1},!0);i.length&&this.clicked?(this.clickedElements=i,jf(n,this.clickedElements),this.previousHoverOption=n.options.hover,n.options.hover={mode:null}):(delete this.clickedElements,n.options.hover=this.previousHoverOption||n.options.hover,this.clicked=!1)},beforeDestroy(n){delete this.clickedElements,n.options.hover=this.previousHoverOption||n.options.hover,this.clicked=!1}},qf=6,eD=20,nD="100%",sl=30,iD=40,rD=0,aD=10,sD=10,oD=1,lD=6,cD=Ke(h.defineComponent({__name:"StackedBarChart",props:{chartData:{type:Object,required:!1,default:()=>({labels:[],datasets:[]})},tooltipTitle:{type:String,required:!1,default:""},legendValues:{type:Object,required:!1,default:null},metricUnit:{type:String,required:!1,default:""},orientation:{type:String,required:!1,default:"horizontal",validator:n=>["horizontal","vertical"].includes(n)},annotations:{type:Boolean,required:!1,default:!0},metricAxesTitle:{type:String,required:!1,default:null},dimensionAxesTitle:{type:String,required:!1,default:null},stacked:{type:Boolean,required:!1,default:!0},syntheticsDataKey:{type:String,required:!1,default:""},height:{type:String,required:!1,default:"500px",validator:n=>/(\d *)(px|%)/.test(n)},chartLegendSortFn:{type:Function,required:!1,default:(n,t)=>n.value&&t.value&&t.value.raw-n.value.raw},chartTooltipSortFn:{type:Function,required:!1,default:(n,t)=>t.rawValue-n.rawValue}},emits:["heightUpdate"],setup(n,{emit:t}){const e=n,i=t,{i18n:r}=St.useI18n(),{translateUnit:a}=St.useTranslatedUnits(),s=({chart:F},E)=>{var X;const $=F.data,K=(X=$.labels)==null?void 0:X.indexOf(E);return $.datasets.reduce((Q,at,B)=>{if(F.isDatasetVisible(B)){const N=at.data[K];return isNaN(N)?Q:Q+N}else return Q},0)},o=(F,E,$,K)=>{const X=K==="horizontal";E===null&&(E=r.t("entityNoName"));const Q={type:"label",yValue:N=>X?E:s(N,E),xValue:N=>X?s(N,E):E},at={...Q,position:X?{x:"start",y:"center"}:{x:"center",y:"end"},yAdjust:()=>X?0:-Math.abs(G_()),content:N=>Co(s(N,E),$)},B={...Q,content:N=>zd(s(N,E),Yd(N.chart,F)),position:X?{x:"start",y:"center"}:{x:"center",y:"end"},xAdjust:N=>X?Wd(Co(s(N,E),$)):0,color:Bd};return{[`${E}-value`]:at,[`${E}-percent`]:B}},l=h.ref(),c=h.ref(),u=h.ref(wn()),d=wn(),f=wn(),g=h.ref([]),p=h.ref(h.inject("legendPosition",Bt.Right)),x=h.ref({show:!1,top:"0px",left:"0px",text:"",offset:0}),m=h.toRef(e,"metricUnit"),v=h.computed(()=>h.toRef(e,"orientation").value==="horizontal"),b=h.reactive({showTooltip:!1,tooltipContext:"",tooltipSeries:[],left:"",top:"",units:m,translateUnit:a,offset:0,width:0,height:0,locked:!1,chartType:v.value?ee.HORIZONTAL_BAR:ee.VERTICAL_BAR,chartTooltipSortFn:e.chartTooltipSortFn}),_=h.ref(0),w=()=>{var F;return e.annotations&&((F=e.chartData.labels)==null?void 0:F.reduce((E,$)=>Object.assign(E,o(e.chartData,$,m.value,e.orientation)),{}))},S={id:u.value,afterUpdate(F){_.value+=1,g.value=F.options.plugins.legend.labels.generateLabels(F).map(E=>({...E,value:e.legendValues&&e.legendValues[E.text]})).sort(e.chartLegendSortFn)}},C={id:d,afterUpdate(F){F.options.plugins.annotation.annotations=e.annotations?w():{}}},D=[S,{id:"axisHover",afterEvent(F,E){if(x.value.show=!1,E.event.type==="mousemove"){const $=E.event,K=F.options.indexAxis,X=F.scales,Q=F.scales[K].getLabelForValue(Number(F.scales[K].getValueForPixel($[K])));if((B=>B==="x"?$.y>X.x.top:$.x<X.y.right)(K))if(b.locked||(b.showTooltip=!1),Q.length>na){const N=F.canvas.getContext("2d").measureText(Q).width,tt=Math.abs(Math.round($.x-N*.5)),rt=Math.round($.x+N*.5);x.value.left=K==="x"?`${(tt>0?tt:rt)-x.value.offset}px`:`${$.x-N*.5-x.value.offset}px`,x.value.top=`${$.y-50}px`,x.value.show=!0,x.value.text=Q}else x.value.show=!1;else x.value.show=!1}}},{id:f,afterUpdate(F){F.options.layout.padding.right=v.value?L.value:0}},Vf,...e.annotations?[C]:[]],O=h.computed(()=>e.chartData.labels&&e.chartData.labels.length||0),A=h.computed(()=>{var E,$;let F=nD;if(l.value&&(F=l.value.width,l.value&&((E=e.chartData)!=null&&E.labels)&&(($=e.chartData)==null?void 0:$.labels.length)>sl&&!v.value)){const K=e.chartData.labels.length;F=`${l.value.offsetWidth+(K-sl)*iD}px`}return F}),R=h.computed(()=>{let F=parseInt(e.height,10);if(O.value&&v.value){const E=O.value*(eD+lD);F=Math.max(E,F)}return F});h.watch(()=>R.value,F=>{i("heightUpdate",F)}),St.useReportChartDataForSynthetics(h.toRef(e,"chartData"),h.toRef(e,"syntheticsDataKey")),h.onMounted(()=>{e.annotations&&Te.register(zf),window.requestAnimationFrame(()=>{i("heightUpdate",R.value)})});const W=h.computed(()=>{const F=St.useBarChartOptions({tooltipState:b,legendID:u.value,stacked:h.toRef(e,"stacked"),metricAxesTitle:h.toRef(e,"metricAxesTitle"),dimensionAxesTitle:h.toRef(e,"dimensionAxesTitle"),indexAxis:v.value?"y":"x",numLabels:O});return{...F.value,plugins:{...F.value.plugins,annotation:{annotations:w(),clip:!1}},layout:{autoPadding:!1,padding:{right:0,top:6*qf}}}}),V=St.useChartJSCommon("bar",l,h.toRef(e,"chartData"),D,W),L=h.computed(()=>{_.value;const F=e.chartData.labels,E=e.chartData.datasets,$=F.map((Q,at)=>E.reduce((B,N)=>isNaN(Number(N.data[at]))?B:B+Number(N.data[at]),0)),K=V.value?Yd(V.value,e.chartData):K_(e.chartData);return $.map(Q=>Wd(Co(Q,m.value)+zd(Q,K))).reduce((Q,at)=>Math.max(Q,at),0)+qf});h.onBeforeUnmount(()=>{Te.unregister(zf)});const H={[Bt.Right]:"legend-row",[Bt.Bottom]:"column"},I=h.computed(()=>{if(c.value&&V.value){const F=window.devicePixelRatio,E=V.value,$=E.scales.y.width*F+oD,K=(E.scales.y.height+E.scales.y.top+E.scales.x.height)*F,X=c.value.getContext("2d");return X.scale(F,F),X.canvas.width=$,X.canvas.height=K,X.canvas.style.width=`${$/F}px`,X.canvas.style.height=`${K/F}px`,{scale:F,width:$*F,height:K*F,targetCtx:X}}return null}),et=F=>{if(I.value&&V.value){const E=I.value.scale,$=I.value.targetCtx,K=I.value.width,X=I.value.height,Q=V.value,at=Q.canvas,B=F.target;$.fillStyle="white",B.scrollLeft>=rD&&B.scrollLeft<=aD?($.globalCompositeOperation="source-over",$.clearRect(0,0,K,X),$.drawImage(at,0,0,K,X,0,0,K,X),$.globalCompositeOperation="destination-over",$.fillRect(0,0,K,X)):($.globalCompositeOperation="source-over",$.fillRect(0,(Q.scales.y.height+Q.scales.y.top+sD)*E,K,Q.scales.x.height*E)),b.offset=B.scrollLeft,x.value.offset=B.scrollLeft}},z=({width:F,height:E})=>{b.width=F,b.height=E};h.watch(()=>e.orientation,()=>{var F;if(c.value&&I.value){const E=I.value.width,$=I.value.height;((F=c.value)==null?void 0:F.getContext("2d")).clearRect(0,0,E,$)}b.showTooltip=!1,b.locked=!1}),h.watch(()=>e.annotations,F=>{V.value&&(F?V.value.options.plugins.annotation.annotations=w(e.chartData):delete V.value.options.plugins.annotation.annotations)});const Mt=()=>{b.showTooltip&&(b.locked=!b.locked)};return(F,E)=>(h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass(["chart-parent",H[p.value]])},[h.createElementVNode("canvas",{ref_key:"axis",ref:c,class:"axis"},null,512),h.createElementVNode("div",{class:"chart-container",style:h.normalizeStyle({"overflow-x":O.value>sl?"auto":"hidden"}),"on:scroll":et,onClick:E[0]||(E[0]=$=>Mt())},[h.createElementVNode("div",{class:"chart-body",style:h.normalizeStyle({width:A.value})},[h.createElementVNode("canvas",{ref_key:"canvas",ref:l},null,512)],4)],36),x.value.show?(h.openBlock(),h.createElementBlock("div",{key:0,class:"axis-tooltip",style:h.normalizeStyle({top:x.value.top,left:x.value.left})},h.toDisplayString(x.value.text),5)):h.createCommentVNode("",!0),h.createVNode(rl,{context:b.tooltipContext,left:b.left,locked:b.locked,series:b.tooltipSeries,"show-tooltip":b.showTooltip,"tooltip-title":n.tooltipTitle,top:b.top,onDimensions:z},null,8,["context","left","locked","series","show-tooltip","tooltip-title","top"]),h.createVNode(al,{id:u.value,"chart-instance":h.unref(V),items:g.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-502e266a"]]);/*!
|
|
25
25
|
* chartjs-adapter-date-fns v3.0.0
|
|
26
26
|
* https://www.chartjs.org
|
|
27
27
|
* (c) 2022 chartjs-adapter-date-fns Contributors
|
|
28
28
|
* Released under the MIT license
|
|
29
|
-
*/const uD={datetime:"MMM d, yyyy, h:mm:ss aaaa",millisecond:"h:mm:ss.SSS aaaa",second:"h:mm:ss aaaa",minute:"h:mm aaaa",hour:"ha",day:"MMM d",week:"PP",month:"MMM yyyy",quarter:"qqq - yyyy",year:"yyyy"};Cc._date.override({_id:"date-fns",formats:function(){return uD},parse:function(n,t){if(n===null||typeof n>"u")return null;const e=typeof n;return e==="number"||n instanceof Date?n=J(n):e==="string"&&(typeof t=="string"?n=dx(n,t,new Date,this.options):n=hd(n,this.options)),Ds(n)?n.getTime():null},format:function(n,t){return fv(n,t,this.options)},add:function(n,t,e){switch(e){case"millisecond":return ji(n,t);case"second":return By(n,t);case"minute":return Fy(n,t);case"hour":return Ay(n,t);case"day":return Wu(n,t);case"week":return Wy(n,t);case"month":return _s(n,t);case"quarter":return Uy(n,t);case"year":return Yy(n,t);default:return n}},diff:function(n,t,e){switch(e){case"millisecond":return qr(n,t);case"second":return Qy(n,t);case"minute":return Gy(n,t);case"hour":return Xy(n,t);case"day":return Hu(n,t);case"week":return Jy(n,t);case"month":return qu(n,t);case"quarter":return Zy(n,t);case"year":return tb(n,t);default:return 0}},startOf:function(n,t,e){switch(t){case"second":return gx(n);case"minute":return eb(n);case"hour":return hx(n);case"day":return Ts(n);case"week":return Yu(n);case"isoWeek":return Yu(n,{weekStartsOn:+e});case"month":return ib(n);case"quarter":return nb(n);case"year":return ab(n);default:return n}},endOf:function(n,t){switch(t){case"second":return ub(n);case"minute":return lb(n);case"hour":return sb(n);case"day":return ju(n);case"week":return ob(n);case"month":return Vu(n);case"quarter":return cb(n);case"year":return rb(n);default:return n}}});const Xf={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},dD={type:{type:String,required:!0},...Xf,...{ariaLabel:{type:String},ariaDescribedby:{type:String}}},fD=h.version[0]==="2"?(n,t)=>Object.assign(n,{attrs:t}):(n,t)=>Object.assign(n,t);function hi(n){return h.isProxy(n)?h.toRaw(n):n}function hD(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:n;return h.isProxy(t)?new Proxy(n,{}):n}function gD(n,t){const e=n.options;e&&t&&Object.assign(e,t)}function Gf(n,t){n.labels=t}function Kf(n,t,e){const i=[];n.datasets=t.map(r=>{const a=n.datasets.find(s=>s[e]===r[e]);return!a||!r.data||i.includes(a)?{...r}:(i.push(a),Object.assign(a,r),a)})}function pD(n,t){const e={labels:[],datasets:[]};return Gf(e,n.labels),Kf(e,n.datasets,t),e}const mD=h.defineComponent({props:dD,setup(n,t){let{expose:e,slots:i}=t;const r=h.ref(null),a=h.shallowRef(null);e({chart:a});const s=()=>{if(!r.value)return;const{type:c,data:u,options:d,plugins:f,datasetIdKey:g}=n,p=pD(u,g),m=hD(p,u);a.value=new Te(r.value,{type:c,data:m,options:{...d},plugins:f})},o=()=>{const c=h.toRaw(a.value);c&&(c.destroy(),a.value=null)},l=c=>{c.update(n.updateMode)};return h.onMounted(s),h.onBeforeUnmount(o),h.watch([()=>n.options,()=>n.data],(c,u)=>{let[d,f]=c,[g,p]=u;const m=h.toRaw(a.value);if(!m)return;let y=!1;if(d){const v=hi(d),x=hi(g);v&&v!==x&&(gD(m,v),y=!0)}if(f){const v=hi(f.labels),x=hi(p.labels),w=hi(f.datasets),_=hi(p.datasets);v!==x&&(Gf(m.config.data,v),y=!0),w&&w!==_&&(Kf(m.config.data,w,n.datasetIdKey),y=!0)}y&&h.nextTick(()=>{l(m)})},{deep:!0}),()=>h.h("canvas",{role:"img",ariaLabel:n.ariaLabel,ariaDescribedby:n.ariaDescribedby,ref:r},[h.h("p",{},[i.default?i.default():""])])}});function ol(n,t){return Te.register(t),h.defineComponent({props:Xf,setup(e,i){let{expose:r}=i;const a=h.shallowRef(null),s=o=>{a.value=o==null?void 0:o.chart};return r({chart:a}),()=>h.h(mD,fD({ref:s},{type:n,...e}))}})}const yD=ol("bar",Pi),Zf=ol("doughnut",hn),bD=ol("line",Ei),vD={class:"chart-container"},xD=h.defineComponent({__name:"DoughnutChart",props:{chartData:{type:Object,required:!1,default:null},fill:{type:Boolean,required:!1,default:!1},tooltipTitle:{type:String,required:!0},metricUnit:{type:String,required:!1,default:""},legendPosition:{type:String,required:!1,default:Bt.Right},legendValues:{type:Object,required:!1,default:null},syntheticsDataKey:{type:String,required:!1,default:""},datasetColors:{type:Object,required:!1,default:De}},setup(n){const t=n,{translateUnit:e}=St.useTranslatedUnits(),i=h.ref(_n()),r=h.ref(_n()),a=h.ref([]),s=h.reactive({showTooltip:!1,tooltipContext:"",tooltipSeries:[],left:"",top:"",units:t.metricUnit,translateUnit:e,offset:0,width:0,height:0,chartType:ee.DOUGHNUT}),o={id:i.value,afterUpdate(m){a.value=m.options.plugins.legend.labels.generateLabels(m).map(y=>({...y,value:t.legendValues&&t.legendValues[y.text],hidden:!1}))}},l=h.computed(()=>[o]),c=h.computed(()=>[t.chartData.datasets.reduce((y,v)=>(y.labels.push(v.label),y.backgroundColor.push(v.backgroundColor),y.borderColor.push(Ji(v.backgroundColor,50)),y.data.push(v.data.reduce((x,w)=>x+w,0)),y),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),u=h.computed(()=>({...t.chartData,datasets:c.value}));St.useReportChartDataForSynthetics(h.toRef(t,"chartData"),h.toRef(t,"syntheticsDataKey"));const{options:d}=St.useDoughnutChartOptions({tooltipState:s,legendID:i.value}),f=h.ref(),g=m=>({[Bt.Right]:"legend-row",[Bt.Bottom]:"column",[Bt.Hidden]:"hidden"})[m],p=({width:m,height:y})=>{s.width=m,s.height=y};return(m,y)=>(h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass(["chart-parent",g(n.legendPosition)]),"data-testid":"doughnut-chart-parent"},[h.createElementVNode("div",vD,[h.createVNode(h.unref(Zf),{ref_key:"chartInstance",ref:f,"chart-id":r.value,data:u.value,options:h.unref(d),plugins:l.value},null,8,["chart-id","data","options","plugins"]),h.createVNode(rl,{left:s.left,series:s.tooltipSeries,"show-tooltip":s.showTooltip,"tooltip-title":n.tooltipTitle,top:s.top,unit:n.metricUnit,onDimensions:p},null,8,["left","series","show-tooltip","tooltip-title","top","unit"])]),h.createVNode(al,{id:i.value,"chart-instance":f.value,items:a.value,position:n.legendPosition},null,8,["id","chart-instance","items","position"])],2))}}),wD=Ke(xD,[["__scopeId","data-v-c005e7f5"]]);var Hn=(n=>(n.String="string",n.Number="number",n.Boolean="boolean",n.Object="object",n.Undefined="undefined",n))(Hn||{}),ma={exports:{}};ma.exports,function(n,t){var e=200,i="Expected a function",r="__lodash_hash_undefined__",a=1,s=2,o=1/0,l=9007199254740991,c="[object Arguments]",u="[object Array]",d="[object Boolean]",f="[object Date]",g="[object Error]",p="[object Function]",m="[object GeneratorFunction]",y="[object Map]",v="[object Number]",x="[object Object]",w="[object Promise]",_="[object RegExp]",S="[object Set]",C="[object String]",k="[object Symbol]",T="[object WeakMap]",D="[object ArrayBuffer]",O="[object DataView]",A="[object Float32Array]",R="[object Float64Array]",W="[object Int8Array]",V="[object Int16Array]",L="[object Int32Array]",H="[object Uint8Array]",I="[object Uint8ClampedArray]",et="[object Uint16Array]",z="[object Uint32Array]",Mt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,F=/^\w*$/,E=/^\./,$=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,K=/[\\^$.*+?()[\]{}|]/g,X=/\\(\\)?/g,Q=/^\[object .+?Constructor\]$/,at=/^(?:0|[1-9]\d*)$/,B={};B[A]=B[R]=B[W]=B[V]=B[L]=B[H]=B[I]=B[et]=B[z]=!0,B[c]=B[u]=B[D]=B[d]=B[O]=B[f]=B[g]=B[p]=B[y]=B[v]=B[x]=B[_]=B[S]=B[C]=B[T]=!1;var N=typeof ge=="object"&&ge&&ge.Object===Object&&ge,tt=typeof self=="object"&&self&&self.Object===Object&&self,rt=N||tt||Function("return this")(),Ct=t&&!t.nodeType&&t,gt=Ct&&!0&&n&&!n.nodeType&&n,It=gt&>.exports===Ct,Tt=It&&N.process,lt=function(){try{return Tt&&Tt.binding("util")}catch{}}(),zt=lt&<.isTypedArray;function Gt(b,M){for(var P=-1,U=b?b.length:0;++P<U;)if(M(b[P],P,b))return!0;return!1}function Se(b){return function(M){return M==null?void 0:M[b]}}function Ee(b,M){for(var P=-1,U=Array(b);++P<b;)U[P]=M(P);return U}function pe(b){return function(M){return b(M)}}function Rt(b,M){return b==null?void 0:b[M]}function Nt(b){var M=!1;if(b!=null&&typeof b.toString!="function")try{M=!!(b+"")}catch{}return M}function Ze(b){var M=-1,P=Array(b.size);return b.forEach(function(U,st){P[++M]=[st,U]}),P}function Dt(b,M){return function(P){return b(M(P))}}function Dn(b){var M=-1,P=Array(b.size);return b.forEach(function(U){P[++M]=U}),P}var Ae=Array.prototype,Qe=Function.prototype,xe=Object.prototype,Me=rt["__core-js_shared__"],Re=function(){var b=/[^.]+$/.exec(Me&&Me.keys&&Me.keys.IE_PROTO||"");return b?"Symbol(src)_1."+b:""}(),le=Qe.toString,me=xe.hasOwnProperty,Kt=xe.toString,ya=RegExp("^"+le.call(me).replace(K,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),gi=rt.Symbol,dh=rt.Uint8Array,WS=xe.propertyIsEnumerable,YS=Ae.splice,zS=Dt(Object.keys,Object),fl=pi(rt,"DataView"),lr=pi(rt,"Map"),hl=pi(rt,"Promise"),gl=pi(rt,"Set"),pl=pi(rt,"WeakMap"),cr=pi(Object,"create"),HS=jn(fl),$S=jn(lr),jS=jn(hl),VS=jn(gl),qS=jn(pl),ba=gi?gi.prototype:void 0,ml=ba?ba.valueOf:void 0,fh=ba?ba.toString:void 0;function $n(b){var M=-1,P=b?b.length:0;for(this.clear();++M<P;){var U=b[M];this.set(U[0],U[1])}}function XS(){this.__data__=cr?cr(null):{}}function GS(b){return this.has(b)&&delete this.__data__[b]}function KS(b){var M=this.__data__;if(cr){var P=M[b];return P===r?void 0:P}return me.call(M,b)?M[b]:void 0}function ZS(b){var M=this.__data__;return cr?M[b]!==void 0:me.call(M,b)}function QS(b,M){var P=this.__data__;return P[b]=cr&&M===void 0?r:M,this}$n.prototype.clear=XS,$n.prototype.delete=GS,$n.prototype.get=KS,$n.prototype.has=ZS,$n.prototype.set=QS;function Je(b){var M=-1,P=b?b.length:0;for(this.clear();++M<P;){var U=b[M];this.set(U[0],U[1])}}function JS(){this.__data__=[]}function tM(b){var M=this.__data__,P=xa(M,b);if(P<0)return!1;var U=M.length-1;return P==U?M.pop():YS.call(M,P,1),!0}function eM(b){var M=this.__data__,P=xa(M,b);return P<0?void 0:M[P][1]}function nM(b){return xa(this.__data__,b)>-1}function iM(b,M){var P=this.__data__,U=xa(P,b);return U<0?P.push([b,M]):P[U][1]=M,this}Je.prototype.clear=JS,Je.prototype.delete=tM,Je.prototype.get=eM,Je.prototype.has=nM,Je.prototype.set=iM;function tn(b){var M=-1,P=b?b.length:0;for(this.clear();++M<P;){var U=b[M];this.set(U[0],U[1])}}function rM(){this.__data__={hash:new $n,map:new(lr||Je),string:new $n}}function aM(b){return wa(this,b).delete(b)}function sM(b){return wa(this,b).get(b)}function oM(b){return wa(this,b).has(b)}function lM(b,M){return wa(this,b).set(b,M),this}tn.prototype.clear=rM,tn.prototype.delete=aM,tn.prototype.get=sM,tn.prototype.has=oM,tn.prototype.set=lM;function va(b){var M=-1,P=b?b.length:0;for(this.__data__=new tn;++M<P;)this.add(b[M])}function cM(b){return this.__data__.set(b,r),this}function uM(b){return this.__data__.has(b)}va.prototype.add=va.prototype.push=cM,va.prototype.has=uM;function en(b){this.__data__=new Je(b)}function dM(){this.__data__=new Je}function fM(b){return this.__data__.delete(b)}function hM(b){return this.__data__.get(b)}function gM(b){return this.__data__.has(b)}function pM(b,M){var P=this.__data__;if(P instanceof Je){var U=P.__data__;if(!lr||U.length<e-1)return U.push([b,M]),this;P=this.__data__=new tn(U)}return P.set(b,M),this}en.prototype.clear=dM,en.prototype.delete=fM,en.prototype.get=hM,en.prototype.has=gM,en.prototype.set=pM;function mM(b,M){var P=Vn(b)||xh(b)?Ee(b.length,String):[],U=P.length,st=!!U;for(var Z in b)(M||me.call(b,Z))&&!(st&&(Z=="length"||mh(Z,U)))&&P.push(Z);return P}function xa(b,M){for(var P=b.length;P--;)if(vh(b[P][0],M))return P;return-1}var yM=EM();function bM(b,M){return b&&yM(b,M,Ma)}function hh(b,M){M=_a(M,b)?[M]:gh(M);for(var P=0,U=M.length;b!=null&&P<U;)b=b[Ta(M[P++])];return P&&P==U?b:void 0}function vM(b){return Kt.call(b)}function xM(b,M){return b!=null&&M in Object(b)}function yl(b,M,P,U,st){return b===M?!0:b==null||M==null||!Da(b)&&!Sa(M)?b!==b&&M!==M:wM(b,M,yl,P,U,st)}function wM(b,M,P,U,st,Z){var vt=Vn(b),Ot=Vn(M),Ht=u,Qt=u;vt||(Ht=Sn(b),Ht=Ht==c?x:Ht),Ot||(Qt=Sn(M),Qt=Qt==c?x:Qt);var ce=Ht==x&&!Nt(b),ye=Qt==x&&!Nt(M),Jt=Ht==Qt;if(Jt&&!ce)return Z||(Z=new en),vt||YM(b)?ph(b,M,P,U,st,Z):AM(b,M,Ht,P,U,st,Z);if(!(st&s)){var Ce=ce&&me.call(b,"__wrapped__"),ke=ye&&me.call(M,"__wrapped__");if(Ce||ke){var Mn=Ce?b.value():b,nn=ke?M.value():M;return Z||(Z=new en),P(Mn,nn,U,st,Z)}}return Jt?(Z||(Z=new en),RM(b,M,P,U,st,Z)):!1}function _M(b,M,P,U){var st=P.length,Z=st,vt=!U;if(b==null)return!Z;for(b=Object(b);st--;){var Ot=P[st];if(vt&&Ot[2]?Ot[1]!==b[Ot[0]]:!(Ot[0]in b))return!1}for(;++st<Z;){Ot=P[st];var Ht=Ot[0],Qt=b[Ht],ce=Ot[1];if(vt&&Ot[2]){if(Qt===void 0&&!(Ht in b))return!1}else{var ye=new en;if(U)var Jt=U(Qt,ce,Ht,b,M,ye);if(!(Jt===void 0?yl(ce,Qt,U,a|s,ye):Jt))return!1}}return!0}function TM(b){if(!Da(b)||FM(b))return!1;var M=_h(b)||Nt(b)?ya:Q;return M.test(jn(b))}function DM(b){return Sa(b)&&vl(b.length)&&!!B[Kt.call(b)]}function SM(b){return typeof b=="function"?b:b==null?VM:typeof b=="object"?Vn(b)?kM(b[0],b[1]):CM(b):qM(b)}function MM(b){if(!UM(b))return zS(b);var M=[];for(var P in Object(b))me.call(b,P)&&P!="constructor"&&M.push(P);return M}function CM(b){var M=LM(b);return M.length==1&&M[0][2]?bh(M[0][0],M[0][1]):function(P){return P===b||_M(P,b,M)}}function kM(b,M){return _a(b)&&yh(M)?bh(Ta(b),M):function(P){var U=HM(P,b);return U===void 0&&U===M?$M(P,b):yl(M,U,void 0,a|s)}}function OM(b){return function(M){return hh(M,b)}}function PM(b){if(typeof b=="string")return b;if(xl(b))return fh?fh.call(b):"";var M=b+"";return M=="0"&&1/b==-o?"-0":M}function gh(b){return Vn(b)?b:BM(b)}function EM(b){return function(M,P,U){for(var st=-1,Z=Object(M),vt=U(M),Ot=vt.length;Ot--;){var Ht=vt[b?Ot:++st];if(P(Z[Ht],Ht,Z)===!1)break}return M}}function ph(b,M,P,U,st,Z){var vt=st&s,Ot=b.length,Ht=M.length;if(Ot!=Ht&&!(vt&&Ht>Ot))return!1;var Qt=Z.get(b);if(Qt&&Z.get(M))return Qt==M;var ce=-1,ye=!0,Jt=st&a?new va:void 0;for(Z.set(b,M),Z.set(M,b);++ce<Ot;){var Ce=b[ce],ke=M[ce];if(U)var Mn=vt?U(ke,Ce,ce,M,b,Z):U(Ce,ke,ce,b,M,Z);if(Mn!==void 0){if(Mn)continue;ye=!1;break}if(Jt){if(!Gt(M,function(nn,qn){if(!Jt.has(qn)&&(Ce===nn||P(Ce,nn,U,st,Z)))return Jt.add(qn)})){ye=!1;break}}else if(!(Ce===ke||P(Ce,ke,U,st,Z))){ye=!1;break}}return Z.delete(b),Z.delete(M),ye}function AM(b,M,P,U,st,Z,vt){switch(P){case O:if(b.byteLength!=M.byteLength||b.byteOffset!=M.byteOffset)return!1;b=b.buffer,M=M.buffer;case D:return!(b.byteLength!=M.byteLength||!U(new dh(b),new dh(M)));case d:case f:case v:return vh(+b,+M);case g:return b.name==M.name&&b.message==M.message;case _:case C:return b==M+"";case y:var Ot=Ze;case S:var Ht=Z&s;if(Ot||(Ot=Dn),b.size!=M.size&&!Ht)return!1;var Qt=vt.get(b);if(Qt)return Qt==M;Z|=a,vt.set(b,M);var ce=ph(Ot(b),Ot(M),U,st,Z,vt);return vt.delete(b),ce;case k:if(ml)return ml.call(b)==ml.call(M)}return!1}function RM(b,M,P,U,st,Z){var vt=st&s,Ot=Ma(b),Ht=Ot.length,Qt=Ma(M),ce=Qt.length;if(Ht!=ce&&!vt)return!1;for(var ye=Ht;ye--;){var Jt=Ot[ye];if(!(vt?Jt in M:me.call(M,Jt)))return!1}var Ce=Z.get(b);if(Ce&&Z.get(M))return Ce==M;var ke=!0;Z.set(b,M),Z.set(M,b);for(var Mn=vt;++ye<Ht;){Jt=Ot[ye];var nn=b[Jt],qn=M[Jt];if(U)var Th=vt?U(qn,nn,Jt,M,b,Z):U(nn,qn,Jt,b,M,Z);if(!(Th===void 0?nn===qn||P(nn,qn,U,st,Z):Th)){ke=!1;break}Mn||(Mn=Jt=="constructor")}if(ke&&!Mn){var Ca=b.constructor,ka=M.constructor;Ca!=ka&&"constructor"in b&&"constructor"in M&&!(typeof Ca=="function"&&Ca instanceof Ca&&typeof ka=="function"&&ka instanceof ka)&&(ke=!1)}return Z.delete(b),Z.delete(M),ke}function wa(b,M){var P=b.__data__;return NM(M)?P[typeof M=="string"?"string":"hash"]:P.map}function LM(b){for(var M=Ma(b),P=M.length;P--;){var U=M[P],st=b[U];M[P]=[U,st,yh(st)]}return M}function pi(b,M){var P=Rt(b,M);return TM(P)?P:void 0}var Sn=vM;(fl&&Sn(new fl(new ArrayBuffer(1)))!=O||lr&&Sn(new lr)!=y||hl&&Sn(hl.resolve())!=w||gl&&Sn(new gl)!=S||pl&&Sn(new pl)!=T)&&(Sn=function(b){var M=Kt.call(b),P=M==x?b.constructor:void 0,U=P?jn(P):void 0;if(U)switch(U){case HS:return O;case $S:return y;case jS:return w;case VS:return S;case qS:return T}return M});function IM(b,M,P){M=_a(M,b)?[M]:gh(M);for(var U,st=-1,vt=M.length;++st<vt;){var Z=Ta(M[st]);if(!(U=b!=null&&P(b,Z)))break;b=b[Z]}if(U)return U;var vt=b?b.length:0;return!!vt&&vl(vt)&&mh(Z,vt)&&(Vn(b)||xh(b))}function mh(b,M){return M=M??l,!!M&&(typeof b=="number"||at.test(b))&&b>-1&&b%1==0&&b<M}function _a(b,M){if(Vn(b))return!1;var P=typeof b;return P=="number"||P=="symbol"||P=="boolean"||b==null||xl(b)?!0:F.test(b)||!Mt.test(b)||M!=null&&b in Object(M)}function NM(b){var M=typeof b;return M=="string"||M=="number"||M=="symbol"||M=="boolean"?b!=="__proto__":b===null}function FM(b){return!!Re&&Re in b}function UM(b){var M=b&&b.constructor,P=typeof M=="function"&&M.prototype||xe;return b===P}function yh(b){return b===b&&!Da(b)}function bh(b,M){return function(P){return P==null?!1:P[b]===M&&(M!==void 0||b in Object(P))}}var BM=bl(function(b){b=zM(b);var M=[];return E.test(b)&&M.push(""),b.replace($,function(P,U,st,Z){M.push(st?Z.replace(X,"$1"):U||P)}),M});function Ta(b){if(typeof b=="string"||xl(b))return b;var M=b+"";return M=="0"&&1/b==-o?"-0":M}function jn(b){if(b!=null){try{return le.call(b)}catch{}try{return b+""}catch{}}return""}function bl(b,M){if(typeof b!="function"||M&&typeof M!="function")throw new TypeError(i);var P=function(){var U=arguments,st=M?M.apply(this,U):U[0],Z=P.cache;if(Z.has(st))return Z.get(st);var vt=b.apply(this,U);return P.cache=Z.set(st,vt),vt};return P.cache=new(bl.Cache||tn),P}bl.Cache=tn;function vh(b,M){return b===M||b!==b&&M!==M}function xh(b){return WM(b)&&me.call(b,"callee")&&(!WS.call(b,"callee")||Kt.call(b)==c)}var Vn=Array.isArray;function wh(b){return b!=null&&vl(b.length)&&!_h(b)}function WM(b){return Sa(b)&&wh(b)}function _h(b){var M=Da(b)?Kt.call(b):"";return M==p||M==m}function vl(b){return typeof b=="number"&&b>-1&&b%1==0&&b<=l}function Da(b){var M=typeof b;return!!b&&(M=="object"||M=="function")}function Sa(b){return!!b&&typeof b=="object"}function xl(b){return typeof b=="symbol"||Sa(b)&&Kt.call(b)==k}var YM=zt?pe(zt):DM;function zM(b){return b==null?"":PM(b)}function HM(b,M,P){var U=b==null?void 0:hh(b,M);return U===void 0?P:U}function $M(b,M){return b!=null&&IM(b,M,xM)}function Ma(b){return wh(b)?mM(b):MM(b)}function jM(b,M){var P={};return M=SM(M),bM(b,function(U,st,Z){P[M(U,st,Z)]=U}),P}function VM(b){return b}function qM(b){return _a(b)?Se(Ta(b)):OM(b)}n.exports=jM}(ma,ma.exports);var _D=ma.exports;const TD=Fn(_D);var DD=1/0,SD=9007199254740991,MD="[object Arguments]",CD="[object Function]",kD="[object GeneratorFunction]",OD="[object Symbol]",PD=typeof ge=="object"&&ge&&ge.Object===Object&&ge,ED=typeof self=="object"&&self&&self.Object===Object&&self,AD=PD||ED||Function("return this")();function RD(n,t,e){switch(e.length){case 0:return n.call(t);case 1:return n.call(t,e[0]);case 2:return n.call(t,e[0],e[1]);case 3:return n.call(t,e[0],e[1],e[2])}return n.apply(t,e)}function LD(n,t){for(var e=-1,i=n?n.length:0,r=Array(i);++e<i;)r[e]=t(n[e],e,n);return r}function ID(n,t){for(var e=-1,i=t.length,r=n.length;++e<i;)n[r+e]=t[e];return n}var ll=Object.prototype,ND=ll.hasOwnProperty,cl=ll.toString,Qf=AD.Symbol,FD=ll.propertyIsEnumerable,Jf=Qf?Qf.isConcatSpreadable:void 0,th=Math.max;function eh(n,t,e,i,r){var a=-1,s=n.length;for(e||(e=YD),r||(r=[]);++a<s;){var o=n[a];t>0&&e(o)?t>1?eh(o,t-1,e,i,r):ID(r,o):i||(r[r.length]=o)}return r}function UD(n,t){return n=Object(n),BD(n,t,function(e,i){return i in n})}function BD(n,t,e){for(var i=-1,r=t.length,a={};++i<r;){var s=t[i],o=n[s];e(o,s)&&(a[s]=o)}return a}function WD(n,t){return t=th(t===void 0?n.length-1:t,0),function(){for(var e=arguments,i=-1,r=th(e.length-t,0),a=Array(r);++i<r;)a[i]=e[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=e[i];return s[t]=a,RD(n,this,s)}}function YD(n){return $D(n)||HD(n)||!!(Jf&&n&&n[Jf])}function zD(n){if(typeof n=="string"||KD(n))return n;var t=n+"";return t=="0"&&1/n==-DD?"-0":t}function HD(n){return VD(n)&&ND.call(n,"callee")&&(!FD.call(n,"callee")||cl.call(n)==MD)}var $D=Array.isArray;function jD(n){return n!=null&&XD(n.length)&&!qD(n)}function VD(n){return nh(n)&&jD(n)}function qD(n){var t=GD(n)?cl.call(n):"";return t==CD||t==kD}function XD(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=SD}function GD(n){var t=typeof n;return!!n&&(t=="object"||t=="function")}function nh(n){return!!n&&typeof n=="object"}function KD(n){return typeof n=="symbol"||nh(n)&&cl.call(n)==OD}var ZD=WD(function(n,t){return n==null?{}:UD(n,LD(eh(t,1),zD))}),QD=ZD;const JD=Fn(QD);var ih={exports:{}};(function(n,t){(function(e,i){i()})(ge,function(){function e(c,u){return typeof u>"u"?u={autoBom:!1}:typeof u!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),u={autoBom:!u}),u.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(c.type)?new Blob(["\uFEFF",c],{type:c.type}):c}function i(c,u,d){var f=new XMLHttpRequest;f.open("GET",c),f.responseType="blob",f.onload=function(){l(f.response,u,d)},f.onerror=function(){console.error("could not download file")},f.send()}function r(c){var u=new XMLHttpRequest;u.open("HEAD",c,!1);try{u.send()}catch{}return 200<=u.status&&299>=u.status}function a(c){try{c.dispatchEvent(new MouseEvent("click"))}catch{var u=document.createEvent("MouseEvents");u.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),c.dispatchEvent(u)}}var s=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof ge=="object"&&ge.global===ge?ge:void 0,o=s.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=s.saveAs||(typeof window!="object"||window!==s?function(){}:"download"in HTMLAnchorElement.prototype&&!o?function(c,u,d){var f=s.URL||s.webkitURL,g=document.createElement("a");u=u||c.name||"download",g.download=u,g.rel="noopener",typeof c=="string"?(g.href=c,g.origin===location.origin?a(g):r(g.href)?i(c,u,d):a(g,g.target="_blank")):(g.href=f.createObjectURL(c),setTimeout(function(){f.revokeObjectURL(g.href)},4e4),setTimeout(function(){a(g)},0))}:"msSaveOrOpenBlob"in navigator?function(c,u,d){if(u=u||c.name||"download",typeof c!="string")navigator.msSaveOrOpenBlob(e(c,d),u);else if(r(c))i(c,u,d);else{var f=document.createElement("a");f.href=c,f.target="_blank",setTimeout(function(){a(f)})}}:function(c,u,d,f){if(f=f||open("","_blank"),f&&(f.document.title=f.document.body.innerText="downloading..."),typeof c=="string")return i(c,u,d);var g=c.type==="application/octet-stream",p=/constructor/i.test(s.HTMLElement)||s.safari,m=/CriOS\/[\d]+/.test(navigator.userAgent);if((m||g&&p||o)&&typeof FileReader<"u"){var y=new FileReader;y.onloadend=function(){var w=y.result;w=m?w:w.replace(/^data:[^;]*;/,"data:attachment/file;"),f?f.location.href=w:location=w,f=null},y.readAsDataURL(c)}else{var v=s.URL||s.webkitURL,x=v.createObjectURL(c);f?f.location=x:location.href=x,f=null,setTimeout(function(){v.revokeObjectURL(x)},4e4)}});s.saveAs=l.saveAs=l,n.exports=l})})(ih);var tS=ih.exports,rh={exports:{}};/* @license
|
|
29
|
+
*/const uD={datetime:"MMM d, yyyy, h:mm:ss aaaa",millisecond:"h:mm:ss.SSS aaaa",second:"h:mm:ss aaaa",minute:"h:mm aaaa",hour:"ha",day:"MMM d",week:"PP",month:"MMM yyyy",quarter:"qqq - yyyy",year:"yyyy"};Cc._date.override({_id:"date-fns",formats:function(){return uD},parse:function(n,t){if(n===null||typeof n>"u")return null;const e=typeof n;return e==="number"||n instanceof Date?n=J(n):e==="string"&&(typeof t=="string"?n=dx(n,t,new Date,this.options):n=hd(n,this.options)),Ds(n)?n.getTime():null},format:function(n,t){return fv(n,t,this.options)},add:function(n,t,e){switch(e){case"millisecond":return ji(n,t);case"second":return By(n,t);case"minute":return Fy(n,t);case"hour":return Ay(n,t);case"day":return Wu(n,t);case"week":return Wy(n,t);case"month":return ws(n,t);case"quarter":return Uy(n,t);case"year":return Yy(n,t);default:return n}},diff:function(n,t,e){switch(e){case"millisecond":return qr(n,t);case"second":return Qy(n,t);case"minute":return Gy(n,t);case"hour":return Xy(n,t);case"day":return Hu(n,t);case"week":return Jy(n,t);case"month":return qu(n,t);case"quarter":return Zy(n,t);case"year":return tb(n,t);default:return 0}},startOf:function(n,t,e){switch(t){case"second":return gx(n);case"minute":return eb(n);case"hour":return hx(n);case"day":return Ts(n);case"week":return Yu(n);case"isoWeek":return Yu(n,{weekStartsOn:+e});case"month":return ib(n);case"quarter":return nb(n);case"year":return ab(n);default:return n}},endOf:function(n,t){switch(t){case"second":return ub(n);case"minute":return lb(n);case"hour":return sb(n);case"day":return ju(n);case"week":return ob(n);case"month":return Vu(n);case"quarter":return cb(n);case"year":return rb(n);default:return n}}});const Xf={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},dD={type:{type:String,required:!0},...Xf,...{ariaLabel:{type:String},ariaDescribedby:{type:String}}},fD=h.version[0]==="2"?(n,t)=>Object.assign(n,{attrs:t}):(n,t)=>Object.assign(n,t);function hi(n){return h.isProxy(n)?h.toRaw(n):n}function hD(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:n;return h.isProxy(t)?new Proxy(n,{}):n}function gD(n,t){const e=n.options;e&&t&&Object.assign(e,t)}function Gf(n,t){n.labels=t}function Kf(n,t,e){const i=[];n.datasets=t.map(r=>{const a=n.datasets.find(s=>s[e]===r[e]);return!a||!r.data||i.includes(a)?{...r}:(i.push(a),Object.assign(a,r),a)})}function pD(n,t){const e={labels:[],datasets:[]};return Gf(e,n.labels),Kf(e,n.datasets,t),e}const mD=h.defineComponent({props:dD,setup(n,t){let{expose:e,slots:i}=t;const r=h.ref(null),a=h.shallowRef(null);e({chart:a});const s=()=>{if(!r.value)return;const{type:c,data:u,options:d,plugins:f,datasetIdKey:g}=n,p=pD(u,g),x=hD(p,u);a.value=new Te(r.value,{type:c,data:x,options:{...d},plugins:f})},o=()=>{const c=h.toRaw(a.value);c&&(c.destroy(),a.value=null)},l=c=>{c.update(n.updateMode)};return h.onMounted(s),h.onBeforeUnmount(o),h.watch([()=>n.options,()=>n.data],(c,u)=>{let[d,f]=c,[g,p]=u;const x=h.toRaw(a.value);if(!x)return;let m=!1;if(d){const v=hi(d),b=hi(g);v&&v!==b&&(gD(x,v),m=!0)}if(f){const v=hi(f.labels),b=hi(p.labels),_=hi(f.datasets),w=hi(p.datasets);v!==b&&(Gf(x.config.data,v),m=!0),_&&_!==w&&(Kf(x.config.data,_,n.datasetIdKey),m=!0)}m&&h.nextTick(()=>{l(x)})},{deep:!0}),()=>h.h("canvas",{role:"img",ariaLabel:n.ariaLabel,ariaDescribedby:n.ariaDescribedby,ref:r},[h.h("p",{},[i.default?i.default():""])])}});function ol(n,t){return Te.register(t),h.defineComponent({props:Xf,setup(e,i){let{expose:r}=i;const a=h.shallowRef(null),s=o=>{a.value=o==null?void 0:o.chart};return r({chart:a}),()=>h.h(mD,fD({ref:s},{type:n,...e}))}})}const yD=ol("bar",Pi),Zf=ol("doughnut",hn),bD=ol("line",Ei),vD={class:"chart-container"},xD=h.defineComponent({__name:"DoughnutChart",props:{chartData:{type:Object,required:!1,default:null},fill:{type:Boolean,required:!1,default:!1},tooltipTitle:{type:String,required:!0},metricUnit:{type:String,required:!1,default:""},legendPosition:{type:String,required:!1,default:Bt.Right},legendValues:{type:Object,required:!1,default:null},syntheticsDataKey:{type:String,required:!1,default:""},datasetColors:{type:Object,required:!1,default:De}},setup(n){const t=n,{translateUnit:e}=St.useTranslatedUnits(),i=h.ref(wn()),r=h.ref(wn()),a=h.ref([]),s=h.reactive({showTooltip:!1,tooltipContext:"",tooltipSeries:[],left:"",top:"",units:t.metricUnit,translateUnit:e,offset:0,width:0,height:0,chartType:ee.DOUGHNUT}),o={id:i.value,afterUpdate(x){a.value=x.options.plugins.legend.labels.generateLabels(x).map(m=>({...m,value:t.legendValues&&t.legendValues[m.text],hidden:!1}))}},l=h.computed(()=>[o]),c=h.computed(()=>[t.chartData.datasets.reduce((m,v)=>(m.labels.push(v.label),m.backgroundColor.push(v.backgroundColor),m.borderColor.push(Ji(v.backgroundColor,50)),m.data.push(v.data.reduce((b,_)=>b+_,0)),m),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),u=h.computed(()=>({...t.chartData,datasets:c.value}));St.useReportChartDataForSynthetics(h.toRef(t,"chartData"),h.toRef(t,"syntheticsDataKey"));const{options:d}=St.useDoughnutChartOptions({tooltipState:s,legendID:i.value}),f=h.ref(),g=x=>({[Bt.Right]:"legend-row",[Bt.Bottom]:"column",[Bt.Hidden]:"hidden"})[x],p=({width:x,height:m})=>{s.width=x,s.height=m};return(x,m)=>(h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass(["chart-parent",g(n.legendPosition)]),"data-testid":"doughnut-chart-parent"},[h.createElementVNode("div",vD,[h.createVNode(h.unref(Zf),{ref_key:"chartInstance",ref:f,"chart-id":r.value,data:u.value,options:h.unref(d),plugins:l.value},null,8,["chart-id","data","options","plugins"]),h.createVNode(rl,{left:s.left,series:s.tooltipSeries,"show-tooltip":s.showTooltip,"tooltip-title":n.tooltipTitle,top:s.top,unit:n.metricUnit,onDimensions:p},null,8,["left","series","show-tooltip","tooltip-title","top","unit"])]),h.createVNode(al,{id:i.value,"chart-instance":f.value,items:a.value,position:n.legendPosition},null,8,["id","chart-instance","items","position"])],2))}}),_D=Ke(xD,[["__scopeId","data-v-c005e7f5"]]);var Hn=(n=>(n.String="string",n.Number="number",n.Boolean="boolean",n.Object="object",n.Undefined="undefined",n))(Hn||{}),ma={exports:{}};ma.exports,function(n,t){var e=200,i="Expected a function",r="__lodash_hash_undefined__",a=1,s=2,o=1/0,l=9007199254740991,c="[object Arguments]",u="[object Array]",d="[object Boolean]",f="[object Date]",g="[object Error]",p="[object Function]",x="[object GeneratorFunction]",m="[object Map]",v="[object Number]",b="[object Object]",_="[object Promise]",w="[object RegExp]",S="[object Set]",C="[object String]",k="[object Symbol]",T="[object WeakMap]",D="[object ArrayBuffer]",O="[object DataView]",A="[object Float32Array]",R="[object Float64Array]",W="[object Int8Array]",V="[object Int16Array]",L="[object Int32Array]",H="[object Uint8Array]",I="[object Uint8ClampedArray]",et="[object Uint16Array]",z="[object Uint32Array]",Mt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,F=/^\w*$/,E=/^\./,$=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,K=/[\\^$.*+?()[\]{}|]/g,X=/\\(\\)?/g,Q=/^\[object .+?Constructor\]$/,at=/^(?:0|[1-9]\d*)$/,B={};B[A]=B[R]=B[W]=B[V]=B[L]=B[H]=B[I]=B[et]=B[z]=!0,B[c]=B[u]=B[D]=B[d]=B[O]=B[f]=B[g]=B[p]=B[m]=B[v]=B[b]=B[w]=B[S]=B[C]=B[T]=!1;var N=typeof ge=="object"&&ge&&ge.Object===Object&&ge,tt=typeof self=="object"&&self&&self.Object===Object&&self,rt=N||tt||Function("return this")(),Ct=t&&!t.nodeType&&t,gt=Ct&&!0&&n&&!n.nodeType&&n,It=gt&>.exports===Ct,Tt=It&&N.process,lt=function(){try{return Tt&&Tt.binding("util")}catch{}}(),zt=lt&<.isTypedArray;function Gt(y,M){for(var P=-1,U=y?y.length:0;++P<U;)if(M(y[P],P,y))return!0;return!1}function Se(y){return function(M){return M==null?void 0:M[y]}}function Ee(y,M){for(var P=-1,U=Array(y);++P<y;)U[P]=M(P);return U}function pe(y){return function(M){return y(M)}}function Rt(y,M){return y==null?void 0:y[M]}function Nt(y){var M=!1;if(y!=null&&typeof y.toString!="function")try{M=!!(y+"")}catch{}return M}function Ze(y){var M=-1,P=Array(y.size);return y.forEach(function(U,st){P[++M]=[st,U]}),P}function Dt(y,M){return function(P){return y(M(P))}}function Dn(y){var M=-1,P=Array(y.size);return y.forEach(function(U){P[++M]=U}),P}var Ae=Array.prototype,Qe=Function.prototype,xe=Object.prototype,Me=rt["__core-js_shared__"],Re=function(){var y=/[^.]+$/.exec(Me&&Me.keys&&Me.keys.IE_PROTO||"");return y?"Symbol(src)_1."+y:""}(),le=Qe.toString,me=xe.hasOwnProperty,Kt=xe.toString,ya=RegExp("^"+le.call(me).replace(K,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),gi=rt.Symbol,dh=rt.Uint8Array,WS=xe.propertyIsEnumerable,YS=Ae.splice,zS=Dt(Object.keys,Object),fl=pi(rt,"DataView"),lr=pi(rt,"Map"),hl=pi(rt,"Promise"),gl=pi(rt,"Set"),pl=pi(rt,"WeakMap"),cr=pi(Object,"create"),HS=jn(fl),$S=jn(lr),jS=jn(hl),VS=jn(gl),qS=jn(pl),ba=gi?gi.prototype:void 0,ml=ba?ba.valueOf:void 0,fh=ba?ba.toString:void 0;function $n(y){var M=-1,P=y?y.length:0;for(this.clear();++M<P;){var U=y[M];this.set(U[0],U[1])}}function XS(){this.__data__=cr?cr(null):{}}function GS(y){return this.has(y)&&delete this.__data__[y]}function KS(y){var M=this.__data__;if(cr){var P=M[y];return P===r?void 0:P}return me.call(M,y)?M[y]:void 0}function ZS(y){var M=this.__data__;return cr?M[y]!==void 0:me.call(M,y)}function QS(y,M){var P=this.__data__;return P[y]=cr&&M===void 0?r:M,this}$n.prototype.clear=XS,$n.prototype.delete=GS,$n.prototype.get=KS,$n.prototype.has=ZS,$n.prototype.set=QS;function Je(y){var M=-1,P=y?y.length:0;for(this.clear();++M<P;){var U=y[M];this.set(U[0],U[1])}}function JS(){this.__data__=[]}function tM(y){var M=this.__data__,P=xa(M,y);if(P<0)return!1;var U=M.length-1;return P==U?M.pop():YS.call(M,P,1),!0}function eM(y){var M=this.__data__,P=xa(M,y);return P<0?void 0:M[P][1]}function nM(y){return xa(this.__data__,y)>-1}function iM(y,M){var P=this.__data__,U=xa(P,y);return U<0?P.push([y,M]):P[U][1]=M,this}Je.prototype.clear=JS,Je.prototype.delete=tM,Je.prototype.get=eM,Je.prototype.has=nM,Je.prototype.set=iM;function tn(y){var M=-1,P=y?y.length:0;for(this.clear();++M<P;){var U=y[M];this.set(U[0],U[1])}}function rM(){this.__data__={hash:new $n,map:new(lr||Je),string:new $n}}function aM(y){return _a(this,y).delete(y)}function sM(y){return _a(this,y).get(y)}function oM(y){return _a(this,y).has(y)}function lM(y,M){return _a(this,y).set(y,M),this}tn.prototype.clear=rM,tn.prototype.delete=aM,tn.prototype.get=sM,tn.prototype.has=oM,tn.prototype.set=lM;function va(y){var M=-1,P=y?y.length:0;for(this.__data__=new tn;++M<P;)this.add(y[M])}function cM(y){return this.__data__.set(y,r),this}function uM(y){return this.__data__.has(y)}va.prototype.add=va.prototype.push=cM,va.prototype.has=uM;function en(y){this.__data__=new Je(y)}function dM(){this.__data__=new Je}function fM(y){return this.__data__.delete(y)}function hM(y){return this.__data__.get(y)}function gM(y){return this.__data__.has(y)}function pM(y,M){var P=this.__data__;if(P instanceof Je){var U=P.__data__;if(!lr||U.length<e-1)return U.push([y,M]),this;P=this.__data__=new tn(U)}return P.set(y,M),this}en.prototype.clear=dM,en.prototype.delete=fM,en.prototype.get=hM,en.prototype.has=gM,en.prototype.set=pM;function mM(y,M){var P=Vn(y)||xh(y)?Ee(y.length,String):[],U=P.length,st=!!U;for(var Z in y)(M||me.call(y,Z))&&!(st&&(Z=="length"||mh(Z,U)))&&P.push(Z);return P}function xa(y,M){for(var P=y.length;P--;)if(vh(y[P][0],M))return P;return-1}var yM=EM();function bM(y,M){return y&&yM(y,M,Ma)}function hh(y,M){M=wa(M,y)?[M]:gh(M);for(var P=0,U=M.length;y!=null&&P<U;)y=y[Ta(M[P++])];return P&&P==U?y:void 0}function vM(y){return Kt.call(y)}function xM(y,M){return y!=null&&M in Object(y)}function yl(y,M,P,U,st){return y===M?!0:y==null||M==null||!Da(y)&&!Sa(M)?y!==y&&M!==M:_M(y,M,yl,P,U,st)}function _M(y,M,P,U,st,Z){var vt=Vn(y),Ot=Vn(M),Ht=u,Qt=u;vt||(Ht=Sn(y),Ht=Ht==c?b:Ht),Ot||(Qt=Sn(M),Qt=Qt==c?b:Qt);var ce=Ht==b&&!Nt(y),ye=Qt==b&&!Nt(M),Jt=Ht==Qt;if(Jt&&!ce)return Z||(Z=new en),vt||YM(y)?ph(y,M,P,U,st,Z):AM(y,M,Ht,P,U,st,Z);if(!(st&s)){var Ce=ce&&me.call(y,"__wrapped__"),ke=ye&&me.call(M,"__wrapped__");if(Ce||ke){var Mn=Ce?y.value():y,nn=ke?M.value():M;return Z||(Z=new en),P(Mn,nn,U,st,Z)}}return Jt?(Z||(Z=new en),RM(y,M,P,U,st,Z)):!1}function wM(y,M,P,U){var st=P.length,Z=st,vt=!U;if(y==null)return!Z;for(y=Object(y);st--;){var Ot=P[st];if(vt&&Ot[2]?Ot[1]!==y[Ot[0]]:!(Ot[0]in y))return!1}for(;++st<Z;){Ot=P[st];var Ht=Ot[0],Qt=y[Ht],ce=Ot[1];if(vt&&Ot[2]){if(Qt===void 0&&!(Ht in y))return!1}else{var ye=new en;if(U)var Jt=U(Qt,ce,Ht,y,M,ye);if(!(Jt===void 0?yl(ce,Qt,U,a|s,ye):Jt))return!1}}return!0}function TM(y){if(!Da(y)||FM(y))return!1;var M=wh(y)||Nt(y)?ya:Q;return M.test(jn(y))}function DM(y){return Sa(y)&&vl(y.length)&&!!B[Kt.call(y)]}function SM(y){return typeof y=="function"?y:y==null?VM:typeof y=="object"?Vn(y)?kM(y[0],y[1]):CM(y):qM(y)}function MM(y){if(!UM(y))return zS(y);var M=[];for(var P in Object(y))me.call(y,P)&&P!="constructor"&&M.push(P);return M}function CM(y){var M=LM(y);return M.length==1&&M[0][2]?bh(M[0][0],M[0][1]):function(P){return P===y||wM(P,y,M)}}function kM(y,M){return wa(y)&&yh(M)?bh(Ta(y),M):function(P){var U=HM(P,y);return U===void 0&&U===M?$M(P,y):yl(M,U,void 0,a|s)}}function OM(y){return function(M){return hh(M,y)}}function PM(y){if(typeof y=="string")return y;if(xl(y))return fh?fh.call(y):"";var M=y+"";return M=="0"&&1/y==-o?"-0":M}function gh(y){return Vn(y)?y:BM(y)}function EM(y){return function(M,P,U){for(var st=-1,Z=Object(M),vt=U(M),Ot=vt.length;Ot--;){var Ht=vt[y?Ot:++st];if(P(Z[Ht],Ht,Z)===!1)break}return M}}function ph(y,M,P,U,st,Z){var vt=st&s,Ot=y.length,Ht=M.length;if(Ot!=Ht&&!(vt&&Ht>Ot))return!1;var Qt=Z.get(y);if(Qt&&Z.get(M))return Qt==M;var ce=-1,ye=!0,Jt=st&a?new va:void 0;for(Z.set(y,M),Z.set(M,y);++ce<Ot;){var Ce=y[ce],ke=M[ce];if(U)var Mn=vt?U(ke,Ce,ce,M,y,Z):U(Ce,ke,ce,y,M,Z);if(Mn!==void 0){if(Mn)continue;ye=!1;break}if(Jt){if(!Gt(M,function(nn,qn){if(!Jt.has(qn)&&(Ce===nn||P(Ce,nn,U,st,Z)))return Jt.add(qn)})){ye=!1;break}}else if(!(Ce===ke||P(Ce,ke,U,st,Z))){ye=!1;break}}return Z.delete(y),Z.delete(M),ye}function AM(y,M,P,U,st,Z,vt){switch(P){case O:if(y.byteLength!=M.byteLength||y.byteOffset!=M.byteOffset)return!1;y=y.buffer,M=M.buffer;case D:return!(y.byteLength!=M.byteLength||!U(new dh(y),new dh(M)));case d:case f:case v:return vh(+y,+M);case g:return y.name==M.name&&y.message==M.message;case w:case C:return y==M+"";case m:var Ot=Ze;case S:var Ht=Z&s;if(Ot||(Ot=Dn),y.size!=M.size&&!Ht)return!1;var Qt=vt.get(y);if(Qt)return Qt==M;Z|=a,vt.set(y,M);var ce=ph(Ot(y),Ot(M),U,st,Z,vt);return vt.delete(y),ce;case k:if(ml)return ml.call(y)==ml.call(M)}return!1}function RM(y,M,P,U,st,Z){var vt=st&s,Ot=Ma(y),Ht=Ot.length,Qt=Ma(M),ce=Qt.length;if(Ht!=ce&&!vt)return!1;for(var ye=Ht;ye--;){var Jt=Ot[ye];if(!(vt?Jt in M:me.call(M,Jt)))return!1}var Ce=Z.get(y);if(Ce&&Z.get(M))return Ce==M;var ke=!0;Z.set(y,M),Z.set(M,y);for(var Mn=vt;++ye<Ht;){Jt=Ot[ye];var nn=y[Jt],qn=M[Jt];if(U)var Th=vt?U(qn,nn,Jt,M,y,Z):U(nn,qn,Jt,y,M,Z);if(!(Th===void 0?nn===qn||P(nn,qn,U,st,Z):Th)){ke=!1;break}Mn||(Mn=Jt=="constructor")}if(ke&&!Mn){var Ca=y.constructor,ka=M.constructor;Ca!=ka&&"constructor"in y&&"constructor"in M&&!(typeof Ca=="function"&&Ca instanceof Ca&&typeof ka=="function"&&ka instanceof ka)&&(ke=!1)}return Z.delete(y),Z.delete(M),ke}function _a(y,M){var P=y.__data__;return NM(M)?P[typeof M=="string"?"string":"hash"]:P.map}function LM(y){for(var M=Ma(y),P=M.length;P--;){var U=M[P],st=y[U];M[P]=[U,st,yh(st)]}return M}function pi(y,M){var P=Rt(y,M);return TM(P)?P:void 0}var Sn=vM;(fl&&Sn(new fl(new ArrayBuffer(1)))!=O||lr&&Sn(new lr)!=m||hl&&Sn(hl.resolve())!=_||gl&&Sn(new gl)!=S||pl&&Sn(new pl)!=T)&&(Sn=function(y){var M=Kt.call(y),P=M==b?y.constructor:void 0,U=P?jn(P):void 0;if(U)switch(U){case HS:return O;case $S:return m;case jS:return _;case VS:return S;case qS:return T}return M});function IM(y,M,P){M=wa(M,y)?[M]:gh(M);for(var U,st=-1,vt=M.length;++st<vt;){var Z=Ta(M[st]);if(!(U=y!=null&&P(y,Z)))break;y=y[Z]}if(U)return U;var vt=y?y.length:0;return!!vt&&vl(vt)&&mh(Z,vt)&&(Vn(y)||xh(y))}function mh(y,M){return M=M??l,!!M&&(typeof y=="number"||at.test(y))&&y>-1&&y%1==0&&y<M}function wa(y,M){if(Vn(y))return!1;var P=typeof y;return P=="number"||P=="symbol"||P=="boolean"||y==null||xl(y)?!0:F.test(y)||!Mt.test(y)||M!=null&&y in Object(M)}function NM(y){var M=typeof y;return M=="string"||M=="number"||M=="symbol"||M=="boolean"?y!=="__proto__":y===null}function FM(y){return!!Re&&Re in y}function UM(y){var M=y&&y.constructor,P=typeof M=="function"&&M.prototype||xe;return y===P}function yh(y){return y===y&&!Da(y)}function bh(y,M){return function(P){return P==null?!1:P[y]===M&&(M!==void 0||y in Object(P))}}var BM=bl(function(y){y=zM(y);var M=[];return E.test(y)&&M.push(""),y.replace($,function(P,U,st,Z){M.push(st?Z.replace(X,"$1"):U||P)}),M});function Ta(y){if(typeof y=="string"||xl(y))return y;var M=y+"";return M=="0"&&1/y==-o?"-0":M}function jn(y){if(y!=null){try{return le.call(y)}catch{}try{return y+""}catch{}}return""}function bl(y,M){if(typeof y!="function"||M&&typeof M!="function")throw new TypeError(i);var P=function(){var U=arguments,st=M?M.apply(this,U):U[0],Z=P.cache;if(Z.has(st))return Z.get(st);var vt=y.apply(this,U);return P.cache=Z.set(st,vt),vt};return P.cache=new(bl.Cache||tn),P}bl.Cache=tn;function vh(y,M){return y===M||y!==y&&M!==M}function xh(y){return WM(y)&&me.call(y,"callee")&&(!WS.call(y,"callee")||Kt.call(y)==c)}var Vn=Array.isArray;function _h(y){return y!=null&&vl(y.length)&&!wh(y)}function WM(y){return Sa(y)&&_h(y)}function wh(y){var M=Da(y)?Kt.call(y):"";return M==p||M==x}function vl(y){return typeof y=="number"&&y>-1&&y%1==0&&y<=l}function Da(y){var M=typeof y;return!!y&&(M=="object"||M=="function")}function Sa(y){return!!y&&typeof y=="object"}function xl(y){return typeof y=="symbol"||Sa(y)&&Kt.call(y)==k}var YM=zt?pe(zt):DM;function zM(y){return y==null?"":PM(y)}function HM(y,M,P){var U=y==null?void 0:hh(y,M);return U===void 0?P:U}function $M(y,M){return y!=null&&IM(y,M,xM)}function Ma(y){return _h(y)?mM(y):MM(y)}function jM(y,M){var P={};return M=SM(M),bM(y,function(U,st,Z){P[M(U,st,Z)]=U}),P}function VM(y){return y}function qM(y){return wa(y)?Se(Ta(y)):OM(y)}n.exports=jM}(ma,ma.exports);var wD=ma.exports;const TD=Fn(wD);var DD=1/0,SD=9007199254740991,MD="[object Arguments]",CD="[object Function]",kD="[object GeneratorFunction]",OD="[object Symbol]",PD=typeof ge=="object"&&ge&&ge.Object===Object&&ge,ED=typeof self=="object"&&self&&self.Object===Object&&self,AD=PD||ED||Function("return this")();function RD(n,t,e){switch(e.length){case 0:return n.call(t);case 1:return n.call(t,e[0]);case 2:return n.call(t,e[0],e[1]);case 3:return n.call(t,e[0],e[1],e[2])}return n.apply(t,e)}function LD(n,t){for(var e=-1,i=n?n.length:0,r=Array(i);++e<i;)r[e]=t(n[e],e,n);return r}function ID(n,t){for(var e=-1,i=t.length,r=n.length;++e<i;)n[r+e]=t[e];return n}var ll=Object.prototype,ND=ll.hasOwnProperty,cl=ll.toString,Qf=AD.Symbol,FD=ll.propertyIsEnumerable,Jf=Qf?Qf.isConcatSpreadable:void 0,th=Math.max;function eh(n,t,e,i,r){var a=-1,s=n.length;for(e||(e=YD),r||(r=[]);++a<s;){var o=n[a];t>0&&e(o)?t>1?eh(o,t-1,e,i,r):ID(r,o):i||(r[r.length]=o)}return r}function UD(n,t){return n=Object(n),BD(n,t,function(e,i){return i in n})}function BD(n,t,e){for(var i=-1,r=t.length,a={};++i<r;){var s=t[i],o=n[s];e(o,s)&&(a[s]=o)}return a}function WD(n,t){return t=th(t===void 0?n.length-1:t,0),function(){for(var e=arguments,i=-1,r=th(e.length-t,0),a=Array(r);++i<r;)a[i]=e[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=e[i];return s[t]=a,RD(n,this,s)}}function YD(n){return $D(n)||HD(n)||!!(Jf&&n&&n[Jf])}function zD(n){if(typeof n=="string"||KD(n))return n;var t=n+"";return t=="0"&&1/n==-DD?"-0":t}function HD(n){return VD(n)&&ND.call(n,"callee")&&(!FD.call(n,"callee")||cl.call(n)==MD)}var $D=Array.isArray;function jD(n){return n!=null&&XD(n.length)&&!qD(n)}function VD(n){return nh(n)&&jD(n)}function qD(n){var t=GD(n)?cl.call(n):"";return t==CD||t==kD}function XD(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=SD}function GD(n){var t=typeof n;return!!n&&(t=="object"||t=="function")}function nh(n){return!!n&&typeof n=="object"}function KD(n){return typeof n=="symbol"||nh(n)&&cl.call(n)==OD}var ZD=WD(function(n,t){return n==null?{}:UD(n,LD(eh(t,1),zD))}),QD=ZD;const JD=Fn(QD);var ih={exports:{}};(function(n,t){(function(e,i){i()})(ge,function(){function e(c,u){return typeof u>"u"?u={autoBom:!1}:typeof u!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),u={autoBom:!u}),u.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(c.type)?new Blob(["\uFEFF",c],{type:c.type}):c}function i(c,u,d){var f=new XMLHttpRequest;f.open("GET",c),f.responseType="blob",f.onload=function(){l(f.response,u,d)},f.onerror=function(){console.error("could not download file")},f.send()}function r(c){var u=new XMLHttpRequest;u.open("HEAD",c,!1);try{u.send()}catch{}return 200<=u.status&&299>=u.status}function a(c){try{c.dispatchEvent(new MouseEvent("click"))}catch{var u=document.createEvent("MouseEvents");u.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),c.dispatchEvent(u)}}var s=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof ge=="object"&&ge.global===ge?ge:void 0,o=s.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=s.saveAs||(typeof window!="object"||window!==s?function(){}:"download"in HTMLAnchorElement.prototype&&!o?function(c,u,d){var f=s.URL||s.webkitURL,g=document.createElement("a");u=u||c.name||"download",g.download=u,g.rel="noopener",typeof c=="string"?(g.href=c,g.origin===location.origin?a(g):r(g.href)?i(c,u,d):a(g,g.target="_blank")):(g.href=f.createObjectURL(c),setTimeout(function(){f.revokeObjectURL(g.href)},4e4),setTimeout(function(){a(g)},0))}:"msSaveOrOpenBlob"in navigator?function(c,u,d){if(u=u||c.name||"download",typeof c!="string")navigator.msSaveOrOpenBlob(e(c,d),u);else if(r(c))i(c,u,d);else{var f=document.createElement("a");f.href=c,f.target="_blank",setTimeout(function(){a(f)})}}:function(c,u,d,f){if(f=f||open("","_blank"),f&&(f.document.title=f.document.body.innerText="downloading..."),typeof c=="string")return i(c,u,d);var g=c.type==="application/octet-stream",p=/constructor/i.test(s.HTMLElement)||s.safari,x=/CriOS\/[\d]+/.test(navigator.userAgent);if((x||g&&p||o)&&typeof FileReader<"u"){var m=new FileReader;m.onloadend=function(){var _=m.result;_=x?_:_.replace(/^data:[^;]*;/,"data:attachment/file;"),f?f.location.href=_:location=_,f=null},m.readAsDataURL(c)}else{var v=s.URL||s.webkitURL,b=v.createObjectURL(c);f?f.location=b:location.href=b,f=null,setTimeout(function(){v.revokeObjectURL(b)},4e4)}});s.saveAs=l.saveAs=l,n.exports=l})})(ih);var tS=ih.exports,rh={exports:{}};/* @license
|
|
30
30
|
Papa Parse
|
|
31
31
|
v5.4.1
|
|
32
32
|
https://github.com/mholt/PapaParse
|
|
33
33
|
License: MIT
|
|
34
|
-
*/(function(n,t){(function(e,i){n.exports=i()})(ge,function e(){var i=typeof self<"u"?self:typeof window<"u"?window:i!==void 0?i:{},r=!i.document&&!!i.postMessage,a=i.IS_PAPA_WORKER||!1,s={},o=0,l={parse:function(T,D){var O=(D=D||{}).dynamicTyping||!1;if(k(O)&&(D.dynamicTypingFunction=O,O={}),D.dynamicTyping=O,D.transform=!!k(D.transform)&&D.transform,D.worker&&l.WORKERS_SUPPORTED){var A=function(){if(!l.WORKERS_SUPPORTED)return!1;var W=(L=i.URL||i.webkitURL||null,H=e.toString(),l.BLOB_URL||(l.BLOB_URL=L.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",H,")();"],{type:"text/javascript"})))),V=new i.Worker(W),L,H;return V.onmessage=
|
|
35
|
-
`,V='"',L=V+V,H=!1,I=null,et=!1;(function(){if(typeof D=="object"){if(typeof D.delimiter!="string"||l.BAD_DELIMITERS.filter(function(E){return D.delimiter.indexOf(E)!==-1}).length||(R=D.delimiter),(typeof D.quotes=="boolean"||typeof D.quotes=="function"||Array.isArray(D.quotes))&&(O=D.quotes),typeof D.skipEmptyLines!="boolean"&&typeof D.skipEmptyLines!="string"||(H=D.skipEmptyLines),typeof D.newline=="string"&&(W=D.newline),typeof D.quoteChar=="string"&&(V=D.quoteChar),typeof D.header=="boolean"&&(A=D.header),Array.isArray(D.columns)){if(D.columns.length===0)throw new Error("Option columns is empty");I=D.columns}D.escapeChar!==void 0&&(L=D.escapeChar+V),(typeof D.escapeFormulae=="boolean"||D.escapeFormulae instanceof RegExp)&&(et=D.escapeFormulae instanceof RegExp?D.escapeFormulae:/^[=+\-@\t\r].*$/)}})();var z=new RegExp(
|
|
36
|
-
`,'"',l.BYTE_ORDER_MARK],l.WORKERS_SUPPORTED=!r&&!!i.Worker,l.NODE_STREAM_INPUT=1,l.LocalChunkSize=10485760,l.RemoteChunkSize=5242880,l.DefaultDelimiter=",",l.Parser=v,l.ParserHandle=
|
|
34
|
+
*/(function(n,t){(function(e,i){n.exports=i()})(ge,function e(){var i=typeof self<"u"?self:typeof window<"u"?window:i!==void 0?i:{},r=!i.document&&!!i.postMessage,a=i.IS_PAPA_WORKER||!1,s={},o=0,l={parse:function(T,D){var O=(D=D||{}).dynamicTyping||!1;if(k(O)&&(D.dynamicTypingFunction=O,O={}),D.dynamicTyping=O,D.transform=!!k(D.transform)&&D.transform,D.worker&&l.WORKERS_SUPPORTED){var A=function(){if(!l.WORKERS_SUPPORTED)return!1;var W=(L=i.URL||i.webkitURL||null,H=e.toString(),l.BLOB_URL||(l.BLOB_URL=L.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",H,")();"],{type:"text/javascript"})))),V=new i.Worker(W),L,H;return V.onmessage=b,V.id=o++,s[V.id]=V}();return A.userStep=D.step,A.userChunk=D.chunk,A.userComplete=D.complete,A.userError=D.error,D.step=k(D.step),D.chunk=k(D.chunk),D.complete=k(D.complete),D.error=k(D.error),delete D.worker,void A.postMessage({input:T,config:D,workerId:A.id})}var R=null;return l.NODE_STREAM_INPUT,typeof T=="string"?(T=function(W){return W.charCodeAt(0)===65279?W.slice(1):W}(T),R=D.download?new d(D):new g(D)):T.readable===!0&&k(T.read)&&k(T.on)?R=new p(D):(i.File&&T instanceof File||T instanceof Object)&&(R=new f(D)),R.stream(T)},unparse:function(T,D){var O=!1,A=!0,R=",",W=`\r
|
|
35
|
+
`,V='"',L=V+V,H=!1,I=null,et=!1;(function(){if(typeof D=="object"){if(typeof D.delimiter!="string"||l.BAD_DELIMITERS.filter(function(E){return D.delimiter.indexOf(E)!==-1}).length||(R=D.delimiter),(typeof D.quotes=="boolean"||typeof D.quotes=="function"||Array.isArray(D.quotes))&&(O=D.quotes),typeof D.skipEmptyLines!="boolean"&&typeof D.skipEmptyLines!="string"||(H=D.skipEmptyLines),typeof D.newline=="string"&&(W=D.newline),typeof D.quoteChar=="string"&&(V=D.quoteChar),typeof D.header=="boolean"&&(A=D.header),Array.isArray(D.columns)){if(D.columns.length===0)throw new Error("Option columns is empty");I=D.columns}D.escapeChar!==void 0&&(L=D.escapeChar+V),(typeof D.escapeFormulae=="boolean"||D.escapeFormulae instanceof RegExp)&&(et=D.escapeFormulae instanceof RegExp?D.escapeFormulae:/^[=+\-@\t\r].*$/)}})();var z=new RegExp(m(V),"g");if(typeof T=="string"&&(T=JSON.parse(T)),Array.isArray(T)){if(!T.length||Array.isArray(T[0]))return Mt(null,T,H);if(typeof T[0]=="object")return Mt(I||Object.keys(T[0]),T,H)}else if(typeof T=="object")return typeof T.data=="string"&&(T.data=JSON.parse(T.data)),Array.isArray(T.data)&&(T.fields||(T.fields=T.meta&&T.meta.fields||I),T.fields||(T.fields=Array.isArray(T.data[0])?T.fields:typeof T.data[0]=="object"?Object.keys(T.data[0]):[]),Array.isArray(T.data[0])||typeof T.data[0]=="object"||(T.data=[T.data])),Mt(T.fields||[],T.data||[],H);throw new Error("Unable to serialize unrecognized input");function Mt(E,$,K){var X="";typeof E=="string"&&(E=JSON.parse(E)),typeof $=="string"&&($=JSON.parse($));var Q=Array.isArray(E)&&0<E.length,at=!Array.isArray($[0]);if(Q&&A){for(var B=0;B<E.length;B++)0<B&&(X+=R),X+=F(E[B],B);0<$.length&&(X+=W)}for(var N=0;N<$.length;N++){var tt=Q?E.length:$[N].length,rt=!1,Ct=Q?Object.keys($[N]).length===0:$[N].length===0;if(K&&!Q&&(rt=K==="greedy"?$[N].join("").trim()==="":$[N].length===1&&$[N][0].length===0),K==="greedy"&&Q){for(var gt=[],It=0;It<tt;It++){var Tt=at?E[It]:It;gt.push($[N][Tt])}rt=gt.join("").trim()===""}if(!rt){for(var lt=0;lt<tt;lt++){0<lt&&!Ct&&(X+=R);var zt=Q&&at?E[lt]:lt;X+=F($[N][zt],lt)}N<$.length-1&&(!K||0<tt&&!Ct)&&(X+=W)}}return X}function F(E,$){if(E==null)return"";if(E.constructor===Date)return JSON.stringify(E).slice(1,25);var K=!1;et&&typeof E=="string"&&et.test(E)&&(E="'"+E,K=!0);var X=E.toString().replace(z,L);return(K=K||O===!0||typeof O=="function"&&O(E,$)||Array.isArray(O)&&O[$]||function(Q,at){for(var B=0;B<at.length;B++)if(-1<Q.indexOf(at[B]))return!0;return!1}(X,l.BAD_DELIMITERS)||-1<X.indexOf(R)||X.charAt(0)===" "||X.charAt(X.length-1)===" ")?V+X+V:X}}};if(l.RECORD_SEP="",l.UNIT_SEP="",l.BYTE_ORDER_MARK="\uFEFF",l.BAD_DELIMITERS=["\r",`
|
|
36
|
+
`,'"',l.BYTE_ORDER_MARK],l.WORKERS_SUPPORTED=!r&&!!i.Worker,l.NODE_STREAM_INPUT=1,l.LocalChunkSize=10485760,l.RemoteChunkSize=5242880,l.DefaultDelimiter=",",l.Parser=v,l.ParserHandle=x,l.NetworkStreamer=d,l.FileStreamer=f,l.StringStreamer=g,l.ReadableStreamStreamer=p,i.jQuery){var c=i.jQuery;c.fn.parse=function(T){var D=T.config||{},O=[];return this.each(function(W){if(!(c(this).prop("tagName").toUpperCase()==="INPUT"&&c(this).attr("type").toLowerCase()==="file"&&i.FileReader)||!this.files||this.files.length===0)return!0;for(var V=0;V<this.files.length;V++)O.push({file:this.files[V],inputElem:this,instanceConfig:c.extend({},D)})}),A(),this;function A(){if(O.length!==0){var W,V,L,H,I=O[0];if(k(T.before)){var et=T.before(I.file,I.inputElem);if(typeof et=="object"){if(et.action==="abort")return W="AbortError",V=I.file,L=I.inputElem,H=et.reason,void(k(T.error)&&T.error({name:W},V,L,H));if(et.action==="skip")return void R();typeof et.config=="object"&&(I.instanceConfig=c.extend(I.instanceConfig,et.config))}else if(et==="skip")return void R()}var z=I.instanceConfig.complete;I.instanceConfig.complete=function(Mt){k(z)&&z(Mt,I.file,I.inputElem),R()},l.parse(I.file,I.instanceConfig)}else k(T.complete)&&T.complete()}function R(){O.splice(0,1),A()}}}function u(T){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},(function(D){var O=S(D);O.chunkSize=parseInt(O.chunkSize),D.step||D.chunk||(O.chunkSize=null),this._handle=new x(O),(this._handle.streamer=this)._config=O}).call(this,T),this.parseChunk=function(D,O){if(this.isFirstChunk&&k(this._config.beforeFirstChunk)){var A=this._config.beforeFirstChunk(D);A!==void 0&&(D=A)}this.isFirstChunk=!1,this._halted=!1;var R=this._partialLine+D;this._partialLine="";var W=this._handle.parse(R,this._baseIndex,!this._finished);if(!this._handle.paused()&&!this._handle.aborted()){var V=W.meta.cursor;this._finished||(this._partialLine=R.substring(V-this._baseIndex),this._baseIndex=V),W&&W.data&&(this._rowCount+=W.data.length);var L=this._finished||this._config.preview&&this._rowCount>=this._config.preview;if(a)i.postMessage({results:W,workerId:l.WORKER_ID,finished:L});else if(k(this._config.chunk)&&!O){if(this._config.chunk(W,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);W=void 0,this._completeResults=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(W.data),this._completeResults.errors=this._completeResults.errors.concat(W.errors),this._completeResults.meta=W.meta),this._completed||!L||!k(this._config.complete)||W&&W.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),L||W&&W.meta.paused||this._nextChunk(),W}this._halted=!0},this._sendError=function(D){k(this._config.error)?this._config.error(D):a&&this._config.error&&i.postMessage({workerId:l.WORKER_ID,error:D,finished:!1})}}function d(T){var D;(T=T||{}).chunkSize||(T.chunkSize=l.RemoteChunkSize),u.call(this,T),this._nextChunk=r?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(O){this._input=O,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(D=new XMLHttpRequest,this._config.withCredentials&&(D.withCredentials=this._config.withCredentials),r||(D.onload=C(this._chunkLoaded,this),D.onerror=C(this._chunkError,this)),D.open(this._config.downloadRequestBody?"POST":"GET",this._input,!r),this._config.downloadRequestHeaders){var O=this._config.downloadRequestHeaders;for(var A in O)D.setRequestHeader(A,O[A])}if(this._config.chunkSize){var R=this._start+this._config.chunkSize-1;D.setRequestHeader("Range","bytes="+this._start+"-"+R)}try{D.send(this._config.downloadRequestBody)}catch(W){this._chunkError(W.message)}r&&D.status===0&&this._chunkError()}},this._chunkLoaded=function(){D.readyState===4&&(D.status<200||400<=D.status?this._chunkError():(this._start+=this._config.chunkSize?this._config.chunkSize:D.responseText.length,this._finished=!this._config.chunkSize||this._start>=function(O){var A=O.getResponseHeader("Content-Range");return A===null?-1:parseInt(A.substring(A.lastIndexOf("/")+1))}(D),this.parseChunk(D.responseText)))},this._chunkError=function(O){var A=D.statusText||O;this._sendError(new Error(A))}}function f(T){var D,O;(T=T||{}).chunkSize||(T.chunkSize=l.LocalChunkSize),u.call(this,T);var A=typeof FileReader<"u";this.stream=function(R){this._input=R,O=R.slice||R.webkitSlice||R.mozSlice,A?((D=new FileReader).onload=C(this._chunkLoaded,this),D.onerror=C(this._chunkError,this)):D=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var R=this._input;if(this._config.chunkSize){var W=Math.min(this._start+this._config.chunkSize,this._input.size);R=O.call(R,this._start,W)}var V=D.readAsText(R,this._config.encoding);A||this._chunkLoaded({target:{result:V}})},this._chunkLoaded=function(R){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(R.target.result)},this._chunkError=function(){this._sendError(D.error)}}function g(T){var D;u.call(this,T=T||{}),this.stream=function(O){return D=O,this._nextChunk()},this._nextChunk=function(){if(!this._finished){var O,A=this._config.chunkSize;return A?(O=D.substring(0,A),D=D.substring(A)):(O=D,D=""),this._finished=!D,this.parseChunk(O)}}}function p(T){u.call(this,T=T||{});var D=[],O=!0,A=!1;this.pause=function(){u.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){u.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(R){this._input=R,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){A&&D.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),D.length?this.parseChunk(D.shift()):O=!0},this._streamData=C(function(R){try{D.push(typeof R=="string"?R:R.toString(this._config.encoding)),O&&(O=!1,this._checkIsFinished(),this.parseChunk(D.shift()))}catch(W){this._streamError(W)}},this),this._streamError=C(function(R){this._streamCleanUp(),this._sendError(R)},this),this._streamEnd=C(function(){this._streamCleanUp(),A=!0,this._streamData("")},this),this._streamCleanUp=C(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function x(T){var D,O,A,R=Math.pow(2,53),W=-R,V=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,L=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,H=this,I=0,et=0,z=!1,Mt=!1,F=[],E={data:[],errors:[],meta:{}};if(k(T.step)){var $=T.step;T.step=function(N){if(E=N,Q())X();else{if(X(),E.data.length===0)return;I+=N.data.length,T.preview&&I>T.preview?O.abort():(E.data=E.data[0],$(E,H))}}}function K(N){return T.skipEmptyLines==="greedy"?N.join("").trim()==="":N.length===1&&N[0].length===0}function X(){return E&&A&&(B("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+l.DefaultDelimiter+"'"),A=!1),T.skipEmptyLines&&(E.data=E.data.filter(function(N){return!K(N)})),Q()&&function(){if(!E)return;function N(rt,Ct){k(T.transformHeader)&&(rt=T.transformHeader(rt,Ct)),F.push(rt)}if(Array.isArray(E.data[0])){for(var tt=0;Q()&&tt<E.data.length;tt++)E.data[tt].forEach(N);E.data.splice(0,1)}else E.data.forEach(N)}(),function(){if(!E||!T.header&&!T.dynamicTyping&&!T.transform)return E;function N(rt,Ct){var gt,It=T.header?{}:[];for(gt=0;gt<rt.length;gt++){var Tt=gt,lt=rt[gt];T.header&&(Tt=gt>=F.length?"__parsed_extra":F[gt]),T.transform&&(lt=T.transform(lt,Tt)),lt=at(Tt,lt),Tt==="__parsed_extra"?(It[Tt]=It[Tt]||[],It[Tt].push(lt)):It[Tt]=lt}return T.header&&(gt>F.length?B("FieldMismatch","TooManyFields","Too many fields: expected "+F.length+" fields but parsed "+gt,et+Ct):gt<F.length&&B("FieldMismatch","TooFewFields","Too few fields: expected "+F.length+" fields but parsed "+gt,et+Ct)),It}var tt=1;return!E.data.length||Array.isArray(E.data[0])?(E.data=E.data.map(N),tt=E.data.length):E.data=N(E.data,0),T.header&&E.meta&&(E.meta.fields=F),et+=tt,E}()}function Q(){return T.header&&F.length===0}function at(N,tt){return rt=N,T.dynamicTypingFunction&&T.dynamicTyping[rt]===void 0&&(T.dynamicTyping[rt]=T.dynamicTypingFunction(rt)),(T.dynamicTyping[rt]||T.dynamicTyping)===!0?tt==="true"||tt==="TRUE"||tt!=="false"&&tt!=="FALSE"&&(function(Ct){if(V.test(Ct)){var gt=parseFloat(Ct);if(W<gt&><R)return!0}return!1}(tt)?parseFloat(tt):L.test(tt)?new Date(tt):tt===""?null:tt):tt;var rt}function B(N,tt,rt,Ct){var gt={type:N,code:tt,message:rt};Ct!==void 0&&(gt.row=Ct),E.errors.push(gt)}this.parse=function(N,tt,rt){var Ct=T.quoteChar||'"';if(T.newline||(T.newline=function(Tt,lt){Tt=Tt.substring(0,1048576);var zt=new RegExp(m(lt)+"([^]*?)"+m(lt),"gm"),Gt=(Tt=Tt.replace(zt,"")).split("\r"),Se=Tt.split(`
|
|
37
37
|
`),Ee=1<Se.length&&Se[0].length<Gt[0].length;if(Gt.length===1||Ee)return`
|
|
38
38
|
`;for(var pe=0,Rt=0;Rt<Gt.length;Rt++)Gt[Rt][0]===`
|
|
39
39
|
`&&pe++;return pe>=Gt.length/2?`\r
|
|
40
|
-
`:"\r"}(N,Ct)),A=!1,T.delimiter)k(T.delimiter)&&(T.delimiter=T.delimiter(N),E.meta.delimiter=T.delimiter);else{var gt=function(Tt,lt,zt,Gt,Se){var Ee,pe,Rt,Nt;Se=Se||[","," ","|",";",l.RECORD_SEP,l.UNIT_SEP];for(var Ze=0;Ze<Se.length;Ze++){var Dt=Se[Ze],Dn=0,Ae=0,Qe=0;Rt=void 0;for(var xe=new v({comments:Gt,delimiter:Dt,newline:lt,preview:10}).parse(Tt),Me=0;Me<xe.data.length;Me++)if(zt&&K(xe.data[Me]))Qe++;else{var Re=xe.data[Me].length;Ae+=Re,Rt!==void 0?0<Re&&(Dn+=Math.abs(Re-Rt),Rt=Re):Rt=Re}0<xe.data.length&&(Ae/=xe.data.length-Qe),(pe===void 0||Dn<=pe)&&(Nt===void 0||Nt<Ae)&&1.99<Ae&&(pe=Dn,Ee=Dt,Nt=Ae)}return{successful:!!(T.delimiter=Ee),bestDelimiter:Ee}}(N,T.newline,T.skipEmptyLines,T.comments,T.delimitersToGuess);gt.successful?T.delimiter=gt.bestDelimiter:(A=!0,T.delimiter=l.DefaultDelimiter),E.meta.delimiter=T.delimiter}var It=S(T);return T.preview&&T.header&&It.preview++,D=N,O=new v(It),E=O.parse(D,tt,rt),X(),z?{meta:{paused:!0}}:E||{meta:{paused:!1}}},this.paused=function(){return z},this.pause=function(){z=!0,O.abort(),D=k(T.chunk)?"":D.substring(O.getCharIndex())},this.resume=function(){H.streamer._halted?(z=!1,H.streamer.parseChunk(D,!0)):setTimeout(H.resume,3)},this.aborted=function(){return Mt},this.abort=function(){Mt=!0,O.abort(),E.meta.aborted=!0,k(T.complete)&&T.complete(E),D=""}}function
|
|
40
|
+
`:"\r"}(N,Ct)),A=!1,T.delimiter)k(T.delimiter)&&(T.delimiter=T.delimiter(N),E.meta.delimiter=T.delimiter);else{var gt=function(Tt,lt,zt,Gt,Se){var Ee,pe,Rt,Nt;Se=Se||[","," ","|",";",l.RECORD_SEP,l.UNIT_SEP];for(var Ze=0;Ze<Se.length;Ze++){var Dt=Se[Ze],Dn=0,Ae=0,Qe=0;Rt=void 0;for(var xe=new v({comments:Gt,delimiter:Dt,newline:lt,preview:10}).parse(Tt),Me=0;Me<xe.data.length;Me++)if(zt&&K(xe.data[Me]))Qe++;else{var Re=xe.data[Me].length;Ae+=Re,Rt!==void 0?0<Re&&(Dn+=Math.abs(Re-Rt),Rt=Re):Rt=Re}0<xe.data.length&&(Ae/=xe.data.length-Qe),(pe===void 0||Dn<=pe)&&(Nt===void 0||Nt<Ae)&&1.99<Ae&&(pe=Dn,Ee=Dt,Nt=Ae)}return{successful:!!(T.delimiter=Ee),bestDelimiter:Ee}}(N,T.newline,T.skipEmptyLines,T.comments,T.delimitersToGuess);gt.successful?T.delimiter=gt.bestDelimiter:(A=!0,T.delimiter=l.DefaultDelimiter),E.meta.delimiter=T.delimiter}var It=S(T);return T.preview&&T.header&&It.preview++,D=N,O=new v(It),E=O.parse(D,tt,rt),X(),z?{meta:{paused:!0}}:E||{meta:{paused:!1}}},this.paused=function(){return z},this.pause=function(){z=!0,O.abort(),D=k(T.chunk)?"":D.substring(O.getCharIndex())},this.resume=function(){H.streamer._halted?(z=!1,H.streamer.parseChunk(D,!0)):setTimeout(H.resume,3)},this.aborted=function(){return Mt},this.abort=function(){Mt=!0,O.abort(),E.meta.aborted=!0,k(T.complete)&&T.complete(E),D=""}}function m(T){return T.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function v(T){var D,O=(T=T||{}).delimiter,A=T.newline,R=T.comments,W=T.step,V=T.preview,L=T.fastMode,H=D=T.quoteChar===void 0||T.quoteChar===null?'"':T.quoteChar;if(T.escapeChar!==void 0&&(H=T.escapeChar),(typeof O!="string"||-1<l.BAD_DELIMITERS.indexOf(O))&&(O=","),R===O)throw new Error("Comment character same as delimiter");R===!0?R="#":(typeof R!="string"||-1<l.BAD_DELIMITERS.indexOf(R))&&(R=!1),A!==`
|
|
41
41
|
`&&A!=="\r"&&A!==`\r
|
|
42
42
|
`&&(A=`
|
|
43
|
-
`);var I=0,et=!1;this.parse=function(z,Mt,F){if(typeof z!="string")throw new Error("Input must be a string");var E=z.length,$=O.length,K=A.length,X=R.length,Q=k(W),at=[],B=[],N=[],tt=I=0;if(!z)return le();if(T.header&&!Mt){var rt=z.split(A)[0].split(O),Ct=[],gt={},It=!1;for(var Tt in rt){var lt=rt[Tt];k(T.transformHeader)&&(lt=T.transformHeader(lt,Tt));var zt=lt,Gt=gt[lt]||0;for(0<Gt&&(It=!0,zt=lt+"_"+Gt),gt[lt]=Gt+1;Ct.includes(zt);)zt=zt+"_"+Gt;Ct.push(zt)}if(It){var Se=z.split(A);Se[0]=Ct.join(O),z=Se.join(A)}}if(L||L!==!1&&z.indexOf(D)===-1){for(var Ee=z.split(A),pe=0;pe<Ee.length;pe++){if(N=Ee[pe],I+=N.length,pe!==Ee.length-1)I+=A.length;else if(F)return le();if(!R||N.substring(0,X)!==R){if(Q){if(at=[],Qe(N.split(O)),me(),et)return le()}else Qe(N.split(O));if(V&&V<=pe)return at=at.slice(0,V),le(!0)}}return le()}for(var Rt=z.indexOf(O,I),Nt=z.indexOf(A,I),Ze=new RegExp(
|
|
44
|
-
`+u),i.encoding==="utf-8"&&(u="\uFEFF"+u),e("export-finished",i.filename),!i.testing){const d=new Blob([u],{type:"text/csv;charset="+i.encoding});tS.saveAs(d,i.filename)}};return(u,d)=>(h.openBlock(),h.createElementBlock("div",{id:r.value,"data-testid":"export-csv",onClick:c},[h.renderSlot(u.$slots,"default",{},()=>[h.createTextVNode("Download "+h.toDisplayString(n.filename),1)])],8,nS))}}),rS=h.defineComponent({__name:"DownloadCsv",props:{rows:{},headers:{},filename:{}},setup(n){const t=n,e=h.computed(()=>Object.keys(t.headers));return(i,r)=>(h.openBlock(),h.createElementBlock("div",null,[h.createVNode(iS,{data:i.rows,fields:e.value,filename:i.filename,labels:i.headers},{default:h.withCtx(()=>[h.renderSlot(i.$slots,"default")]),_:3},8,["data","fields","filename","labels"])]))}}),aS={class:"kong-ui-public-csv-export-modal"},sS={key:0,class:"selected-range"},oS={key:1,class:"text-muted",tag:"span"},ah=3,sh=h.defineComponent({__name:"CsvExportModal",props:{filename:{},modalDescription:{default:void 0},selectedRange:{},chartData:{}},emits:["toggleModal"],setup(n,{emit:t}){const{i18n:e}=St.useI18n(),i=n,r=t,a=`${i.filename.replace(/\s+/g,"-").toLowerCase()}-${new Date().toISOString().slice(0,10)}.csv`,s=h.ref(!0),o=h.computed(()=>{var p,m;return!!((m=(p=i.chartData)==null?void 0:p.records)!=null&&m.length)}),l=h.ref(1),c=h.computed(()=>f.value.rows.length),u=h.computed(()=>e.t("csvExport.previewRows",{rowsMax:Math.min(ah,c.value),rowsTotal:c.value,plural:c.value===1?"":"s"})),d=()=>{r("toggleModal",!1)},f=h.computed(()=>{var _,S,C;if(!o.value||!((_=i.chartData)!=null&&_.meta.metricNames))return{headers:[],rows:[],csvHeaders:{}};const p=i.chartData.records.some(k=>k.timestamp!==i.chartData.records[0].timestamp),m=i.chartData.records.map(k=>{const T=new Date(k.timestamp);return{...k.event,...p?{timestamp:To(T,"yyyy-MM-dd HH:mm:ss"),tzOffset:To(T,"XXX")}:{}}});let y=[];p&&(y=[{label:"Timestamp",key:"timestamp"},{label:"UtcOffset",key:"tzOffset"}]);const v="dimensions"in i.chartData.meta&&((S=i.chartData.meta)!=null&&S.dimensions)?(C=i.chartData.meta)==null?void 0:C.dimensions:{},x=[...y,...Object.keys(v).map(k=>({label:k,key:k})),...i.chartData.meta.metricNames.map(k=>({label:k,key:k}))],w=x.reduce((k,T)=>(k[T.key]=T.label,k),{});return{headers:x,csvHeaders:w,rows:m}}),g=()=>{const{rows:p}=f.value;return s.value=!1,{total:Number(p.length)||0,data:p.slice(0,ah)}};return h.watch(f,()=>{l.value++}),(p,m)=>{const y=h.resolveComponent("KEmptyState"),v=h.resolveComponent("KTable"),x=h.resolveComponent("KButton"),w=h.resolveComponent("KPrompt");return h.openBlock(),h.createElementBlock("div",aS,[h.createVNode(w,{class:"vitals-report","data-testid":"csv-export-modal","is-visible":"","show-dismiss-icon":"","text-align":"left",title:h.unref(e).t("csvExport.exportPreview"),onCanceled:d,onKeyup:h.withKeys(d,["esc"])},{"body-content":h.withCtx(()=>{var _;return[h.createElementVNode("div",null,[o.value?(h.openBlock(),h.createElementBlock("div",sS,[h.createElementVNode("p",null,h.toDisplayString(p.modalDescription?p.modalDescription:h.unref(e).t("csvExport.exportDescription")),1),h.createElementVNode("p",null,h.toDisplayString(h.unref(e).t("csvExport.exportTimeRange"))+": "+h.toDisplayString(p.selectedRange),1)])):h.createCommentVNode("",!0),h.createVNode(v,{class:"vitals-table","disable-pagination":"","disable-sorting":"",fetcher:g,"fetcher-cache-key":String(l.value),"has-hover":!1,headers:((_=f.value)==null?void 0:_.headers)||[]},{"empty-state":h.withCtx(()=>[h.createVNode(y,{"cta-is-hidden":"",icon:"stateNoData","icon-size":"96"},{title:h.withCtx(()=>[h.createElementVNode("h5",null,h.toDisplayString(h.unref(e).t("csvExport.noDataRange")),1)]),message:h.withCtx(()=>[h.createElementVNode("p",null,h.toDisplayString(h.unref(e).t("csvExport.noDataRetry")),1)]),_:1})]),_:1},8,["fetcher-cache-key","headers"]),!s.value&&o.value?(h.openBlock(),h.createElementBlock("div",oS,h.toDisplayString(u.value),1)):h.createCommentVNode("",!0)])]}),"action-buttons":h.withCtx(()=>[h.createVNode(x,{appearance:"secondary",class:"cancel-btn",onClick:d},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(h.unref(e).t("csvExport.cancelButton")),1)]),_:1}),h.createVNode(rS,{class:"vitals-report-export-button",filename:a,headers:f.value.csvHeaders,rows:f.value.rows},{default:h.withCtx(()=>[h.createVNode(x,{appearance:"primary","data-testid":"csv-download-button",disabled:s.value||!o.value},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(h.unref(e).t("csvExport.downloadButton")),1)]),_:1},8,["disabled"])]),_:1},8,["headers","rows"])]),_:1},8,["title"])])}}}),oh=(n,t,e,i)=>{n.save(),n.beginPath(),n.moveTo(t,e),n.lineTo(t,i),n.lineWidth=1,n.strokeStyle="#0275d8",n.stroke(),n.restore()},ul={id:"linePlugin",afterDatasetsDraw:function(n){if(n.tooltip&&n.tooltip.getActiveElements()&&n.tooltip.getActiveElements().length&&!this.clickedSegment){const{x:t}=n.tooltip.dataPoints[0].element,e=n.ctx;oh(e,t,n.scales.y.top,n.scales.y.bottom)}if(this.clickedSegment){const{x:t}=this.clickedSegment.element,e=n.ctx;oh(e,t,n.scales.y.top,n.scales.y.bottom)}},beforeDestroy(){delete this.clickedSegment}},lS=h.defineComponent({__name:"TimeSeriesChart",props:{chartData:{type:Object,required:!1,default:null},type:{type:String,required:!1,default:ee.TIMESERIES_LINE},fill:{type:Boolean,required:!1,default:!1},tooltipTitle:{type:String,required:!0},metricUnit:{type:String,required:!1,default:""},timeRangeMs:{type:Number,required:!1,default:void 0},timeRangeSec:{type:Number,required:!1,default:void 0},granularity:{type:String,required:!0},stacked:{type:Boolean,required:!1,default:!0},legendValues:{type:Object,required:!1,default:null},metricAxesTitle:{type:String,required:!1,default:null},dimensionAxesTitle:{type:String,required:!1,default:null},syntheticsDataKey:{type:String,required:!1,default:""},datasetColors:{type:Object,required:!1,default:De},chartLegendSortFn:{type:Function,required:!1,default:(n,t)=>n.value&&t.value&&t.value.raw-n.value.raw},chartTooltipSortFn:{type:Function,required:!1,default:(n,t)=>t.rawValue-n.rawValue}},setup(n){const t=n,{translateUnit:e}=St.useTranslatedUnits(),i=h.ref(),r=h.ref(_n()),a=h.ref(_n()),s=h.ref([]),o=h.ref(),l=h.ref(h.inject("legendPosition",Bt.Right)),c=h.reactive({showTooltip:!1,tooltipContext:"",tooltipSeries:[],left:"",top:"",units:t.metricUnit,translateUnit:e,offset:0,width:0,height:0,chartType:t.type,locked:!1,chartTooltipSortFn:t.chartTooltipSortFn}),u={id:r.value,afterUpdate(x){s.value=x.options.plugins.legend.labels.generateLabels(x).map(w=>({...w,value:t.legendValues&&t.legendValues[w.text]})).sort(t.chartLegendSortFn)}},d=h.computed(()=>[u,Vf,...t.type===ee.TIMESERIES_LINE?[ul]:[]]),{options:f}=St.useLinechartOptions({tooltipState:c,timeRangeMs:h.toRef(t,"timeRangeMs"),timeRangeSec:h.toRef(t,"timeRangeSec"),granularity:h.toRef(t,"granularity"),legendID:r.value,stacked:h.toRef(t,"stacked"),metricAxesTitle:h.toRef(t,"metricAxesTitle"),dimensionAxesTitle:h.toRef(t,"dimensionAxesTitle")}),g=h.computed(()=>({...t.chartData,datasets:t.chartData.datasets.map((x,w)=>(Array.isArray(t.datasetColors)?(x.backgroundColor=t.datasetColors[w%t.datasetColors.length],x.borderColor=Ji(x.backgroundColor,50)):x.rawDimension in t.datasetColors&&(x.backgroundColor=t.datasetColors[x.rawDimension],x.borderColor=Ji(x.backgroundColor,50)),x.fill=t.fill,x))}));St.useReportChartDataForSynthetics(h.toRef(t,"chartData"),h.toRef(t,"syntheticsDataKey"));const p=x=>ea(x,{short:[ot.DAILY,ot.WEEKLY].includes(t.granularity)}),m=x=>({[Bt.Right]:"legend-row",[Bt.Bottom]:"column",[Bt.Hidden]:"hidden"})[x],y=({width:x,height:w})=>{c.width=x,c.height=w},v=()=>{var x,w,_;c.locked=!c.locked,i.value&&((w=(x=i.value.chart.tooltip)==null?void 0:x.dataPoints)!=null&&w.length)&&(ul.clickedSegment=c.locked?(_=i.value.chart.tooltip)==null?void 0:_.dataPoints[0]:void 0)};return h.watch(()=>t.type,()=>{c.locked=!1,c.showTooltip=!1,delete ul.clickedSegment}),(x,w)=>(h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass(["chart-parent",m(l.value)]),"data-testid":"line-chart-parent"},[h.createElementVNode("div",{class:"chart-container",onClick:w[0]||(w[0]=_=>v())},[n.type===h.unref(ee).TIMESERIES_LINE?(h.openBlock(),h.createBlock(h.unref(bD),{key:0,ref_key:"chartInstance",ref:i,"chart-id":a.value,data:g.value,"data-testid":"time-series-line-chart",options:h.unref(f),plugins:d.value},null,8,["chart-id","data","options","plugins"])):n.type===h.unref(ee).TIMESERIES_BAR?(h.openBlock(),h.createBlock(h.unref(yD),{key:1,ref_key:"chartInstance",ref:i,"chart-id":a.value,data:g.value,"data-testid":"time-series-bar-chart",options:h.unref(f),plugins:d.value},null,8,["chart-id","data","options","plugins"])):h.createCommentVNode("",!0)]),h.createVNode(rl,{ref_key:"tooltipElement",ref:o,context:p(c.tooltipContext),"data-testid":"tooltip",left:c.left,locked:c.locked,series:c.tooltipSeries,"show-tooltip":c.showTooltip,"tooltip-title":n.tooltipTitle,top:c.top,unit:n.metricUnit,onDimensions:y,onLeft:w[1]||(w[1]=_=>c.left=_),onTop:w[2]||(w[2]=_=>c.top=_)},null,8,["context","left","locked","series","show-tooltip","tooltip-title","top","unit"]),h.createVNode(al,{id:r.value,"chart-instance":i.value,"data-testid":"legend",items:s.value},null,8,["id","chart-instance","items"])],2))}}),cS=Ke(lS,[["__scopeId","data-v-1aa05a3a"]]),uS={class:"analytics-chart-shell"},dS={class:"chart-header"},fS={key:0,class:"chart-title"},hS={class:"chart-header-icons-wrapper"},gS={key:1,class:"chart-export-button"},pS={key:1,class:"analytics-chart-parent"},mS=h.defineComponent({__name:"AnalyticsChart",props:{allowCsvExport:{type:Boolean,required:!1,default:!1},chartData:{type:Object,required:!0},chartOptions:{type:Object,required:!0},tooltipTitle:{type:String,required:!0},emptyStateTitle:{type:String,required:!1,default:""},emptyStateDescription:{type:String,required:!1,default:""},chartTitle:{type:String,required:!1,default:void 0},filenamePrefix:{type:String,required:!1,default:void 0},legendPosition:{type:String,required:!1,default:Bt.Right},syntheticsDataKey:{type:String,required:!1,default:""},height:{type:String,required:!1,default:"500px",validator:n=>/(\d *)(px)/.test(n)},width:{type:String,required:!1,default:"100%",validator:n=>/(\d *)(px|%)/.test(n)},showLegendValues:{type:Boolean,required:!1,default:!0},showAnnotations:{type:Boolean,required:!1,default:!0}},setup(n){h.useCssVars(L=>({"55ce9380":i.value,"1cb391c8":t.width}));const t=n,{i18n:e}=St.useI18n(),i=h.ref(t.height),r=h.computed(()=>t.filenamePrefix??(t.chartTitle||e.t("csvExport.defaultFilename"))),a=L=>{i.value=`${L}px`};h.watch(()=>t.height,L=>{i.value=L});const s=h.toRef(t,"chartData"),o=h.computed(()=>v.value?St.useExploreResultToTimeDataset({fill:t.chartOptions.fill,colorPalette:t.chartOptions.chartDatasetColors||De},h.toRef(t,"chartData")).value:St.useExploreResultToDatasets({fill:t.chartOptions.fill,colorPalette:t.chartOptions.chartDatasetColors||De},h.toRef(t,"chartData")).value),l=h.computed(()=>{var L;return(L=t.chartData)!=null&&L.meta?"start"in t.chartData.meta?t.chartData.meta.end-t.chartData.meta.start:void 0:0}),c=h.computed(()=>{var L;return(L=t.chartData)!=null&&L.meta?"startMs"in t.chartData.meta?t.chartData.meta.endMs-t.chartData.meta.startMs:void 0:0}),u=h.computed(()=>{var L;return(L=t.chartData.meta)!=null&&L.metricUnits?Object.values(t.chartData.meta.metricUnits)[0]:""}),d=h.computed(()=>t.showLegendValues&&t.legendPosition!==Bt.Bottom),{legendValues:f}=St.useChartLegendValues(o,t.chartOptions.type,u),g=h.computed(()=>{var L,H,I;return((I=(H=(L=t.chartData)==null?void 0:L.meta)==null?void 0:H.limit)==null?void 0:I.toString())||null}),p=h.computed(()=>{var L,H;return((H=(L=t.chartData)==null?void 0:L.meta)==null?void 0:H.truncated)||!1}),m=e.t("limitedResultsShown",{maxReturned:g.value}),y=h.computed(()=>[ee.VERTICAL_BAR.toString(),ee.HORIZONTAL_BAR.toString()].includes(t.chartOptions.type)),v=h.computed(()=>[ee.TIMESERIES_BAR,ee.TIMESERIES_LINE].some(L=>L===t.chartOptions.type)),x=h.computed(()=>t.chartOptions.type===ee.DOUGHNUT),w=h.computed(()=>t.chartOptions.type.includes("Vertical")?"vertical":"horizontal"),_=h.computed(()=>{var I,et,z;if(!((I=t.chartData)!=null&&I.meta.metricNames)||!((et=t.chartData)!=null&&et.meta.metricUnits))return;const L=t.chartData.meta.metricNames[0],H=t.chartData.meta.metricUnits[L];return((z=t.chartOptions)==null?void 0:z.metricAxesTitle)||e.te(`metricAxisTitles.${L}`)&&e.te(`chartUnits.${H}`)&&e.t(`metricAxisTitles.${L}`,{unit:e.t(`chartUnits.${H}`,{plural:"s"})})||void 0}),S=h.computed(()=>{const L=v.value?"Time":Object.keys(t.chartData.meta.dimensions||t.chartData.meta.metricNames)[0];return t.chartOptions.dimensionAxesTitle||e.te(`chartLabels.${L}`)&&e.t(`chartLabels.${L}`)||void 0}),C=h.computed(()=>{if(t.chartData.meta.granularity&&typeof t.chartData.meta.granularity!="number"&&"duration"in t.chartData.meta.granularity){const L=er(t.chartData.meta.granularity.duration);return e.t(`granularityAxisTitles.${L}`)}else if(t.chartData.meta.granularity&&!isNaN(Number(t.chartData.meta.granularity))){const L=er(Number(t.chartData.meta.granularity));return e.t(`granularityAxisTitles.${L}`)}return e.t("chartlabels.Time")}),k=h.computed(()=>t.emptyStateTitle||e.t("noDataAvailableTitle")),T=h.computed(()=>t.emptyStateDescription||e.t("noDataAvailableDescription")),D=h.computed(()=>v.value?Nx(o.value):t.chartData&&t.chartData.meta&&t.chartData.records.length),O=h.computed(()=>t.chartData.meta.granularity?typeof t.chartData.meta.granularity=="number"?er(t.chartData.meta.granularity)||ot.HOURLY:er(t.chartData.meta.granularity.duration)||ot.HOURLY:er(new Date(t.chartData.records[1].timestamp).getTime()-new Date(t.chartData.records[0].timestamp).getTime())||ot.HOURLY),A=h.ref(!1),R=St.useChartSelectedRange(s),W=L=>{A.value=L},V=()=>{W(!0)};return h.provide("showLegendValues",d),h.provide("legendPosition",h.toRef(t,"legendPosition")),(L,H)=>{const I=h.resolveComponent("KTooltip"),et=h.resolveComponent("KButton"),z=h.resolveComponent("KEmptyState");return h.openBlock(),h.createElementBlock("div",uS,[h.createElementVNode("div",dS,[n.chartTitle?(h.openBlock(),h.createElementBlock("div",fS,h.toDisplayString(n.chartTitle),1)):h.createCommentVNode("",!0),h.createElementVNode("div",hS,[D.value&&p.value&&g.value?(h.openBlock(),h.createBlock(I,{key:0,class:"tooltip","max-width":"500",placement:"right"},{content:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(h.unref(m)),1)]),default:h.withCtx(()=>[h.createVNode(h.unref(NT),{color:h.unref(UT),decorative:"",size:h.unref(BT)},null,8,["color","size"])]),_:1})):h.createCommentVNode("",!0)]),n.allowCsvExport&&D.value?(h.openBlock(),h.createElementBlock("div",gS,[h.createVNode(et,{appearance:"tertiary",class:"chart-export-button-display","data-testid":"csv-export-button",onClick:h.withModifiers(V,["prevent"])},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(h.unref(e).t("csvExport.exportButton")),1)]),_:1})])):h.createCommentVNode("",!0),n.allowCsvExport&&D.value&&A.value?(h.openBlock(),h.createBlock(sh,{key:2,"chart-data":s.value,filename:r.value,"selected-range":h.unref(R),onToggleModal:W},null,8,["chart-data","filename","selected-range"])):h.createCommentVNode("",!0)]),D.value?(h.openBlock(),h.createElementBlock("div",pS,[v.value?(h.openBlock(),h.createBlock(cS,{key:0,"chart-data":o.value,"chart-legend-sort-fn":n.chartOptions.chartLegendSortFn,"chart-tooltip-sort-fn":n.chartOptions.chartTooltipSortFn,"dataset-colors":n.chartOptions.chartDatasetColors,"dimension-axes-title":C.value,fill:n.chartOptions.fill,granularity:O.value,"legend-values":h.unref(f),"metric-axes-title":_.value,"metric-unit":u.value,stacked:n.chartOptions.stacked,"synthetics-data-key":n.syntheticsDataKey,"time-range-ms":c.value,"time-range-sec":l.value,"tooltip-title":n.tooltipTitle,type:n.chartOptions.type},null,8,["chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dataset-colors","dimension-axes-title","fill","granularity","legend-values","metric-axes-title","metric-unit","stacked","synthetics-data-key","time-range-ms","time-range-sec","tooltip-title","type"])):y.value?(h.openBlock(),h.createBlock(cD,{key:1,annotations:n.showAnnotations,"chart-data":o.value,"chart-legend-sort-fn":n.chartOptions.chartLegendSortFn,"chart-tooltip-sort-fn":n.chartOptions.chartTooltipSortFn,"data-testid":"bar-chart-container","dimension-axes-title":S.value,"legend-values":h.unref(f),"metric-axes-title":_.value,"metric-unit":u.value,orientation:w.value,stacked:n.chartOptions.stacked,"synthetics-data-key":n.syntheticsDataKey,"tooltip-title":n.tooltipTitle,onHeightUpdate:a},null,8,["annotations","chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dimension-axes-title","legend-values","metric-axes-title","metric-unit","orientation","stacked","synthetics-data-key","tooltip-title"])):x.value?(h.openBlock(),h.createBlock(wD,{key:2,"chart-data":o.value,"dataset-colors":n.chartOptions.chartDatasetColors,fill:n.chartOptions.fill,"legend-position":n.legendPosition,"legend-values":h.unref(f),"metric-unit":u.value,"synthetics-data-key":n.syntheticsDataKey,"tooltip-title":n.tooltipTitle},null,8,["chart-data","dataset-colors","fill","legend-position","legend-values","metric-unit","synthetics-data-key","tooltip-title"])):h.createCommentVNode("",!0)])):(h.openBlock(),h.createBlock(z,{key:0,class:"chart-empty-state","cta-is-hidden":!0,"data-testid":"no-data-in-report",icon:"stateNoData","icon-size":"170"},{title:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(k.value),1)]),message:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(T.value),1)]),_:1}))])}}}),yS=Ke(mS,[["__scopeId","data-v-3432f859"]]),bS={class:"chart-parent","data-testid":"doughnut-chart-parent"},vS={class:"chart-totals-flex"},xS={key:1,class:"metric-small","data-testid":"doughnut-chart-total"},wS=h.defineComponent({__name:"GaugeChart",props:{chartData:{type:Object,required:!1,default:null},metricDisplay:{type:String,required:!1,default:ii.Hidden},numerator:{type:Number,required:!1,default:0},syntheticsDataKey:{type:String,required:!1,default:""},datasetColors:{type:Object,required:!1,default:De},height:{type:String,required:!1,default:"400px",validator:n=>/(\d *)(px|%)/.test(n)},width:{type:String,required:!1,default:"100%",validator:n=>/(\d *)(px|%)/.test(n)}},setup(n){const t=n,{i18n:e}=St.useI18n(),i=h.ref(_n()),r=h.computed(()=>[t.chartData.datasets.reduce((p,m)=>(p.labels.push(m.label),p.borderColor.push(m.backgroundColor),p.backgroundColor.push(m.backgroundColor),p.data.push(m.data.reduce((y,v)=>y+v,0)),p),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),a=h.computed(()=>({...t.chartData,datasets:r.value}));St.useReportChartDataForSynthetics(h.toRef(t,"chartData"),h.toRef(t,"syntheticsDataKey"));const s={responsive:!0,maintainAspectRatio:!0,cutout:"78%",circumference:"200",rotation:"260",plugins:{legend:{display:!1}}},o=h.ref(),l=h.computed(()=>{var g;return tr((g=r==null?void 0:r.value[0])==null?void 0:g.data[t.numerator],{capital:!0})}),c=h.computed(()=>{var g,p;return tr(((g=r==null?void 0:r.value[0])==null?void 0:g.data[0])+((p=r==null?void 0:r.value[0])==null?void 0:p.data[1]),{capital:!0})}),u=h.computed(()=>{var g;return`color: ${(g=r==null?void 0:r.value[0])==null?void 0:g.backgroundColor[t.numerator]}`}),d=h.computed(()=>[ii.Full,ii.SingleMetric].includes(t.metricDisplay)),f=h.computed(()=>t.metricDisplay===ii.Full);return(g,p)=>(h.openBlock(),h.createElementBlock("div",bS,[h.createElementVNode("div",vS,[d.value?(h.openBlock(),h.createElementBlock("div",{key:0,class:"metric-large","data-testid":"doughnut-chart-metric",style:h.normalizeStyle(u.value)},h.toDisplayString(l.value),5)):h.createCommentVNode("",!0),f.value?(h.openBlock(),h.createElementBlock("div",xS,h.toDisplayString(h.unref(e).t("total"))+": "+h.toDisplayString(c.value),1)):h.createCommentVNode("",!0)]),h.createElementVNode("div",{class:"chart-container",style:h.normalizeStyle({height:n.height,width:n.width})},[h.createVNode(h.unref(Zf),{ref_key:"chartInstance",ref:o,"chart-id":i.value,data:a.value,options:s},null,8,["chart-id","data","options"])],4)]))}}),_S=Ke(wS,[["__scopeId","data-v-5871cb7a"]]),TS={class:"simple-chart-shell"},DS={key:1,class:"analytics-chart-parent"},SS=Ke(h.defineComponent({__name:"SimpleChart",props:{chartData:{type:Object,required:!0},chartOptions:{type:Object,required:!0},emptyStateTitle:{type:String,required:!1,default:""},syntheticsDataKey:{type:String,required:!1,default:""},height:{type:String,required:!1,default:"400px",validator:n=>/(\d *)(px|%)/.test(n)},width:{type:String,required:!1,default:"100%",validator:n=>/(\d *)(px|%)/.test(n)}},setup(n){const t=n,{i18n:e}=St.useI18n(),i=h.computed(()=>{var c;const l=St.useExploreResultToDatasets({colorPalette:t.chartOptions.chartDatasetColors||De},h.toRef(t,"chartData")).value;return(c=t.chartOptions)!=null&&c.reverseDataset&&(l==null||l.datasets.reverse()),l}),r=h.computed(()=>{var l;return(l=t.chartData.meta)!=null&&l.metricUnits?Object.values(t.chartData.meta.metricUnits)[0]:""}),a=h.computed(()=>t.chartOptions.type===Qr.GAUGE),s=h.computed(()=>t.emptyStateTitle||e.t("noDataAvailableTitle")),o=h.computed(()=>t.chartData&&t.chartData.meta&&t.chartData.records.length);return(l,c)=>{const u=h.resolveComponent("KEmptyState");return h.openBlock(),h.createElementBlock("div",TS,[o.value?(h.openBlock(),h.createElementBlock("div",DS,[a.value?(h.openBlock(),h.createBlock(_S,{key:0,"chart-data":i.value,"dataset-colors":n.chartOptions.chartDatasetColors,"is-simple":"","metric-display":n.chartOptions.metricDisplay,"metric-unit":r.value,numerator:n.chartOptions.numerator,"synthetics-data-key":n.syntheticsDataKey,width:n.width},null,8,["chart-data","dataset-colors","metric-display","metric-unit","numerator","synthetics-data-key","width"])):h.createCommentVNode("",!0)])):(h.openBlock(),h.createBlock(u,{key:0,class:"chart-empty-state","cta-is-hidden":!0,"data-testid":"no-data-in-report",icon:"stateNoData","icon-size":"80"},{title:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(s.value),1)]),_:1}))])}}}),[["__scopeId","data-v-f014a616"]]),MS={class:"top-n-card-title","data-testid":"top-n-card-title"},CS={class:"top-n-card-description","data-testid":"top-n-card-description"},kS={key:3,class:"top-n-table","data-testid":"top-n-table"},OS={class:"table-headings"},PS={class:"table-row"},ES={class:"column-1"},AS={class:"column-2"},RS={class:"table-body","data-testid":"top-n-data"},LS=["data-testid"],IS={class:"column-1"},NS={class:"column-2"},FS=Ke(h.defineComponent({__name:"TopNTable",props:{title:{type:String,required:!0},description:{type:String,default:""},data:{type:Object,required:!0},emptyStateTitle:{type:String,default:""},isLoading:{type:Boolean,default:!1}},setup(n){const t=n,{i18n:e}=St.useI18n(),i=h.computed(()=>t.data.records),r=h.computed(()=>{var p;return!!((p=i.value)!=null&&p.length)}),a=h.computed(()=>{var p,m;return(p=t.data.meta)!=null&&p.display&&((m=Object.keys(t.data.meta.display))==null?void 0:m[0])||""}),s=h.computed(()=>a.value?t.data.meta.display[a.value]:{}),o=h.computed(()=>{var p,m;return(m=(p=t.data.meta)==null?void 0:p.metricNames)!=null&&m.length?t.data.meta.metricNames[0]:""}),l=h.computed(()=>o.value?e.t(`chartLabels.${o.value}`)||o.value:""),c=h.computed(()=>{if(!r.value)return"";if(t.data.meta)if(Object.keys(s.value).length){if(!o.value)return e.t("topNTable.errors.metricNames")}else return e.t("topNTable.errors.display");else return e.t("topNTable.errors.meta");return""}),u=p=>{const m=p.event;return String(m[a.value])},d=p=>{const m=u(p),y=s.value[m];return y?y.name:"-"},f=p=>{const m=u(p),y=s.value[m];return y?y.deleted:!1},g=p=>{if(!o.value)return"–";const y=p.event[o.value];return y?tr(y,{capital:!0,round:!0}):"–"};return(p,m)=>{const y=h.resolveComponent("KEmptyState"),v=h.resolveComponent("KSkeleton"),x=h.resolveComponent("KCard");return h.openBlock(),h.createBlock(x,{class:"kong-ui-public-top-n-table"},h.createSlots({default:h.withCtx(()=>[c.value?(h.openBlock(),h.createBlock(y,{key:0,"cta-is-hidden":"","data-testid":"top-n-error-state","is-error":""},{title:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(h.unref(e).t("topNTable.defaultErrorStateTitle")),1)]),message:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(c.value),1)]),_:1})):n.isLoading?(h.openBlock(),h.createBlock(v,{key:1,"table-columns":2,type:"table"})):r.value?(h.openBlock(),h.createElementBlock("div",kS,[h.createElementVNode("div",OS,[h.createElementVNode("div",PS,[h.createElementVNode("div",ES,h.toDisplayString(h.unref(e).t("topNTable.nameLabel")),1),h.createElementVNode("div",AS,h.toDisplayString(l.value),1)])]),h.createElementVNode("div",RS,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(i.value,(w,_)=>(h.openBlock(),h.createElementBlock("div",{key:`entry-${_}`,class:"table-row","data-testid":`row-${u(w)}`},[h.createElementVNode("div",IS,[h.renderSlot(p.$slots,"name",{record:{id:u(w),name:d(w),deleted:f(w),dimension:a.value}},()=>[h.createTextVNode(h.toDisplayString(d(w)),1)],!0)]),h.createElementVNode("div",NS," "+h.toDisplayString(g(w)),1)],8,LS))),128))])])):(h.openBlock(),h.createBlock(y,{key:2,"cta-is-hidden":"","data-testid":"top-n-empty-state",icon:"stateNoData","icon-size":"80"},{title:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(n.emptyStateTitle||h.unref(e).t("topNTable.defaultEmptyStateTitle")),1)]),_:1}))]),_:2},[n.title?{name:"title",fn:h.withCtx(()=>[h.createElementVNode("div",MS,h.toDisplayString(n.title),1)]),key:"0"}:void 0,n.description?{name:"actions",fn:h.withCtx(()=>[h.createElementVNode("div",CS,h.toDisplayString(n.description),1)]),key:"1"}:void 0]),1024)}}}),[["__scopeId","data-v-bd78642f"]]),dl="#e0e4ea",US={100:["#c8e2fd","#80bfff","#4da6ff","#1a8cff","#0072e5","#0059b2"],200:["#ceedd2","#9edca6","#89d595","#6fcc83","#44c26b","#0bb652","#0ca84a","#169643","#196e33","#1b572a"],300:["#fff4db","#ffe9b8","#ffe2a1","#ffd982","#ffd062","#fdc53b","#f4bb1e","#e8b00b","#d9a30f","#c89407"],400:["#ffead8","#ffd5b1","#ffc899","#ffba81","#ffae6b","#fe9439","#f6871d","#eb7c0c","#da700c","#cc6100"],500:["#ffd5d5","#ffb6b6","#ff9d9d","#ff8484","#ff6a6a","#ff4545","#fb1f1f","#e90b0b","#d40202","#be0202"]},or=(n,t)=>{let e=1;const i=US[n],r=new Map;for(const a of t)r.set(a,i[e]),e=e%(i.length-1)+1;return r.set(-1,i[0]),r},lh=new Map([[100,or("100",[100,101,102,103])],[200,or("200",[200,201,202,203,204,205,206,207,208,226])],[300,or("300",[300,301,302,303,304,305,307,308])],[400,or("400",[400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,421,422,423,424,425,426,428,429,431,451])],[500,or("500",[500,501,502,503,504,505,506,507,508,510,511])]]),ch=n=>{const t=parseInt(n,10),e=Math.floor(t/100)*100,i=lh.get(e);return i===void 0?dl:i.get(t)??i.get(-1)??dl},BS=n=>{const t=ch(n);return{solid:t,light:t}};ut.AnalyticsChart=yS,ut.ChartLegendPosition=Bt,ut.ChartMetricDisplay=ii,ut.ChartTypes=ee,ut.ChartTypesSimple=Qr,ut.CsvExportModal=sh,ut.DECIMAL_DISPLAY=Nd,ut.FONT_SIZE_REGULAR=Ud,ut.FONT_SIZE_SMALL=Fd,ut.MAX_LABEL_LENGTH=na,ut.SimpleChart=SS,ut.TopNTable=FS,ut.ValidType=Hn,ut.accessibleGrey=Bd,ut.codesInSpec=lh,ut.darkenColor=Ji,ut.datavisPalette=De,ut.formatTime=ea,ut.lightGrey=dl,ut.lookupDatavisColor=ai,ut.lookupStatusCodeCategoryColor=BS,ut.lookupStatusCodeColor=ch,ut.numberFormatter=ta,Object.defineProperty(ut,Symbol.toStringTag,{value:"Module"})});
|
|
43
|
+
`);var I=0,et=!1;this.parse=function(z,Mt,F){if(typeof z!="string")throw new Error("Input must be a string");var E=z.length,$=O.length,K=A.length,X=R.length,Q=k(W),at=[],B=[],N=[],tt=I=0;if(!z)return le();if(T.header&&!Mt){var rt=z.split(A)[0].split(O),Ct=[],gt={},It=!1;for(var Tt in rt){var lt=rt[Tt];k(T.transformHeader)&&(lt=T.transformHeader(lt,Tt));var zt=lt,Gt=gt[lt]||0;for(0<Gt&&(It=!0,zt=lt+"_"+Gt),gt[lt]=Gt+1;Ct.includes(zt);)zt=zt+"_"+Gt;Ct.push(zt)}if(It){var Se=z.split(A);Se[0]=Ct.join(O),z=Se.join(A)}}if(L||L!==!1&&z.indexOf(D)===-1){for(var Ee=z.split(A),pe=0;pe<Ee.length;pe++){if(N=Ee[pe],I+=N.length,pe!==Ee.length-1)I+=A.length;else if(F)return le();if(!R||N.substring(0,X)!==R){if(Q){if(at=[],Qe(N.split(O)),me(),et)return le()}else Qe(N.split(O));if(V&&V<=pe)return at=at.slice(0,V),le(!0)}}return le()}for(var Rt=z.indexOf(O,I),Nt=z.indexOf(A,I),Ze=new RegExp(m(H)+m(D),"g"),Dt=z.indexOf(D,I);;)if(z[I]!==D)if(R&&N.length===0&&z.substring(I,I+X)===R){if(Nt===-1)return le();I=Nt+K,Nt=z.indexOf(A,I),Rt=z.indexOf(O,I)}else if(Rt!==-1&&(Rt<Nt||Nt===-1))N.push(z.substring(I,Rt)),I=Rt+$,Rt=z.indexOf(O,I);else{if(Nt===-1)break;if(N.push(z.substring(I,Nt)),Re(Nt+K),Q&&(me(),et))return le();if(V&&at.length>=V)return le(!0)}else for(Dt=I,I++;;){if((Dt=z.indexOf(D,Dt+1))===-1)return F||B.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:at.length,index:I}),Me();if(Dt===E-1)return Me(z.substring(I,Dt).replace(Ze,D));if(D!==H||z[Dt+1]!==H){if(D===H||Dt===0||z[Dt-1]!==H){Rt!==-1&&Rt<Dt+1&&(Rt=z.indexOf(O,Dt+1)),Nt!==-1&&Nt<Dt+1&&(Nt=z.indexOf(A,Dt+1));var Dn=xe(Nt===-1?Rt:Math.min(Rt,Nt));if(z.substr(Dt+1+Dn,$)===O){N.push(z.substring(I,Dt).replace(Ze,D)),z[I=Dt+1+Dn+$]!==D&&(Dt=z.indexOf(D,I)),Rt=z.indexOf(O,I),Nt=z.indexOf(A,I);break}var Ae=xe(Nt);if(z.substring(Dt+1+Ae,Dt+1+Ae+K)===A){if(N.push(z.substring(I,Dt).replace(Ze,D)),Re(Dt+1+Ae+K),Rt=z.indexOf(O,I),Dt=z.indexOf(D,I),Q&&(me(),et))return le();if(V&&at.length>=V)return le(!0);break}B.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:at.length,index:I}),Dt++}}else Dt++}return Me();function Qe(Kt){at.push(Kt),tt=I}function xe(Kt){var ya=0;if(Kt!==-1){var gi=z.substring(Dt+1,Kt);gi&&gi.trim()===""&&(ya=gi.length)}return ya}function Me(Kt){return F||(Kt===void 0&&(Kt=z.substring(I)),N.push(Kt),I=E,Qe(N),Q&&me()),le()}function Re(Kt){I=Kt,Qe(N),N=[],Nt=z.indexOf(A,I)}function le(Kt){return{data:at,errors:B,meta:{delimiter:O,linebreak:A,aborted:et,truncated:!!Kt,cursor:tt+(Mt||0)}}}function me(){W(le()),at=[],B=[]}},this.abort=function(){et=!0},this.getCharIndex=function(){return I}}function b(T){var D=T.data,O=s[D.workerId],A=!1;if(D.error)O.userError(D.error,D.file);else if(D.results&&D.results.data){var R={abort:function(){A=!0,_(D.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:w,resume:w};if(k(O.userStep)){for(var W=0;W<D.results.data.length&&(O.userStep({data:D.results.data[W],errors:D.results.errors,meta:D.results.meta},R),!A);W++);delete D.results}else k(O.userChunk)&&(O.userChunk(D.results,R,D.file),delete D.results)}D.finished&&!A&&_(D.workerId,D.results)}function _(T,D){var O=s[T];k(O.userComplete)&&O.userComplete(D),O.terminate(),delete s[T]}function w(){throw new Error("Not implemented.")}function S(T){if(typeof T!="object"||T===null)return T;var D=Array.isArray(T)?[]:{};for(var O in T)D[O]=S(T[O]);return D}function C(T,D){return function(){T.apply(D,arguments)}}function k(T){return typeof T=="function"}return a&&(i.onmessage=function(T){var D=T.data;if(l.WORKER_ID===void 0&&D&&(l.WORKER_ID=D.workerId),typeof D.input=="string")i.postMessage({workerId:l.WORKER_ID,results:l.parse(D.input,D.config),finished:!0});else if(i.File&&D.input instanceof File||D.input instanceof Object){var O=l.parse(D.input,D.config);O&&i.postMessage({workerId:l.WORKER_ID,results:O,finished:!0})}}),(d.prototype=Object.create(u.prototype)).constructor=d,(f.prototype=Object.create(u.prototype)).constructor=f,(g.prototype=Object.create(g.prototype)).constructor=g,(p.prototype=Object.create(u.prototype)).constructor=p,l})})(rh);var eS=rh.exports;const nS=["id"],iS=h.defineComponent({__name:"VueJsonCsv",props:{data:{type:Array,required:!0},fields:{type:Array,required:!1,default:null},labels:{type:Object,required:!1,default:null},filename:{type:String,default:"report-data.csv"},delimiter:{type:String,default:",",required:!1},separatorExcel:{type:Boolean,default:!1},encoding:{type:String,default:"utf-8"},testing:{type:Boolean,required:!1,default:!1}},emits:["export-started","export-finished"],setup(n,{emit:t}){const e=t,i=n,r=h.computed(()=>`export_${new Date().getTime()}`),a=h.computed(()=>{const u=l();return u.length?u:null}),s=()=>{const u=i.labels;if(typeof i.fields!==Hn.Object)throw new Error("Labels needs to be a object containing key / value pairs.");return typeof u===Hn.Object?d=>TD(d,(f,g)=>u[g]||g):d=>d},o=()=>{const u=i.fields;if(typeof i.fields!==Hn.Object&&!Array.isArray(u))throw new Error("Fields needs to be an array of strings.");return Array.isArray(u)?d=>JD(d,u):d=>d},l=()=>{if(typeof i.fields===Hn.Undefined&&typeof i.labels===Hn.Undefined)return i.data;const u=s(),d=o();return i.data.map(f=>u(d(f)))},c=()=>{if(!(a!=null&&a.value)){console.warn("No data to export");return}e("export-started",a.value);let u=eS.unparse(a.value,Object.assign({delimiter:i.delimiter,encoding:i.encoding}));if(i.separatorExcel&&(u="SEP="+i.delimiter+`\r
|
|
44
|
+
`+u),i.encoding==="utf-8"&&(u="\uFEFF"+u),e("export-finished",i.filename),!i.testing){const d=new Blob([u],{type:"text/csv;charset="+i.encoding});tS.saveAs(d,i.filename)}};return(u,d)=>(h.openBlock(),h.createElementBlock("div",{id:r.value,"data-testid":"export-csv",onClick:c},[h.renderSlot(u.$slots,"default",{},()=>[h.createTextVNode("Download "+h.toDisplayString(n.filename),1)])],8,nS))}}),rS=h.defineComponent({__name:"DownloadCsv",props:{rows:{},headers:{},filename:{}},setup(n){const t=n,e=h.computed(()=>Object.keys(t.headers));return(i,r)=>(h.openBlock(),h.createElementBlock("div",null,[h.createVNode(iS,{data:i.rows,fields:e.value,filename:i.filename,labels:i.headers},{default:h.withCtx(()=>[h.renderSlot(i.$slots,"default")]),_:3},8,["data","fields","filename","labels"])]))}}),aS={class:"kong-ui-public-csv-export-modal"},sS={key:0,class:"selected-range"},oS={key:1,class:"text-muted",tag:"span"},ah=3,sh=h.defineComponent({__name:"CsvExportModal",props:{filename:{},modalDescription:{default:void 0},selectedRange:{},chartData:{}},emits:["toggleModal"],setup(n,{emit:t}){const{i18n:e}=St.useI18n(),i=n,r=t,a=`${i.filename.replace(/\s+/g,"-").toLowerCase()}-${new Date().toISOString().slice(0,10)}.csv`,s=h.ref(!0),o=h.computed(()=>{var p,x;return!!((x=(p=i.chartData)==null?void 0:p.records)!=null&&x.length)}),l=h.ref(1),c=h.computed(()=>f.value.rows.length),u=h.computed(()=>e.t("csvExport.previewRows",{rowsMax:Math.min(ah,c.value),rowsTotal:c.value,plural:c.value===1?"":"s"})),d=()=>{r("toggleModal",!1)},f=h.computed(()=>{var w,S,C;if(!o.value||!((w=i.chartData)!=null&&w.meta.metricNames))return{headers:[],rows:[],csvHeaders:{}};const p=i.chartData.records.some(k=>k.timestamp!==i.chartData.records[0].timestamp),x=i.chartData.records.map(k=>{const T=new Date(k.timestamp);return{...k.event,...p?{timestamp:To(T,"yyyy-MM-dd HH:mm:ss"),tzOffset:To(T,"XXX")}:{}}});let m=[];p&&(m=[{label:"Timestamp",key:"timestamp"},{label:"UtcOffset",key:"tzOffset"}]);const v="dimensions"in i.chartData.meta&&((S=i.chartData.meta)!=null&&S.dimensions)?(C=i.chartData.meta)==null?void 0:C.dimensions:{},b=[...m,...Object.keys(v).map(k=>({label:k,key:k})),...i.chartData.meta.metricNames.map(k=>({label:k,key:k}))],_=b.reduce((k,T)=>(k[T.key]=T.label,k),{});return{headers:b,csvHeaders:_,rows:x}}),g=()=>{const{rows:p}=f.value;return s.value=!1,{total:Number(p.length)||0,data:p.slice(0,ah)}};return h.watch(f,()=>{l.value++}),(p,x)=>{const m=h.resolveComponent("KEmptyState"),v=h.resolveComponent("KTable"),b=h.resolveComponent("KButton"),_=h.resolveComponent("KPrompt");return h.openBlock(),h.createElementBlock("div",aS,[h.createVNode(_,{class:"vitals-report","data-testid":"csv-export-modal","is-visible":"","show-dismiss-icon":"","text-align":"left",title:h.unref(e).t("csvExport.exportPreview"),onCanceled:d,onKeyup:h.withKeys(d,["esc"])},{"body-content":h.withCtx(()=>{var w;return[h.createElementVNode("div",null,[o.value?(h.openBlock(),h.createElementBlock("div",sS,[h.createElementVNode("p",null,h.toDisplayString(p.modalDescription?p.modalDescription:h.unref(e).t("csvExport.exportDescription")),1),h.createElementVNode("p",null,h.toDisplayString(h.unref(e).t("csvExport.exportTimeRange"))+": "+h.toDisplayString(p.selectedRange),1)])):h.createCommentVNode("",!0),h.createVNode(v,{class:"vitals-table","disable-pagination":"","disable-sorting":"",fetcher:g,"fetcher-cache-key":String(l.value),"has-hover":!1,headers:((w=f.value)==null?void 0:w.headers)||[]},{"empty-state":h.withCtx(()=>[h.createVNode(m,{"cta-is-hidden":"",icon:"stateNoData","icon-size":"96"},{title:h.withCtx(()=>[h.createElementVNode("h5",null,h.toDisplayString(h.unref(e).t("csvExport.noDataRange")),1)]),message:h.withCtx(()=>[h.createElementVNode("p",null,h.toDisplayString(h.unref(e).t("csvExport.noDataRetry")),1)]),_:1})]),_:1},8,["fetcher-cache-key","headers"]),!s.value&&o.value?(h.openBlock(),h.createElementBlock("div",oS,h.toDisplayString(u.value),1)):h.createCommentVNode("",!0)])]}),"action-buttons":h.withCtx(()=>[h.createVNode(b,{appearance:"secondary",class:"cancel-btn",onClick:d},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(h.unref(e).t("csvExport.cancelButton")),1)]),_:1}),h.createVNode(rS,{class:"vitals-report-export-button",filename:a,headers:f.value.csvHeaders,rows:f.value.rows},{default:h.withCtx(()=>[h.createVNode(b,{appearance:"primary","data-testid":"csv-download-button",disabled:s.value||!o.value},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(h.unref(e).t("csvExport.downloadButton")),1)]),_:1},8,["disabled"])]),_:1},8,["headers","rows"])]),_:1},8,["title"])])}}}),oh=(n,t,e,i)=>{n.save(),n.beginPath(),n.moveTo(t,e),n.lineTo(t,i),n.lineWidth=1,n.strokeStyle="#0275d8",n.stroke(),n.restore()},ul={id:"linePlugin",afterDatasetsDraw:function(n){if(n.tooltip&&n.tooltip.getActiveElements()&&n.tooltip.getActiveElements().length&&!this.clickedSegment){const{x:t}=n.tooltip.dataPoints[0].element,e=n.ctx;oh(e,t,n.scales.y.top,n.scales.y.bottom)}if(this.clickedSegment){const{x:t}=this.clickedSegment.element,e=n.ctx;oh(e,t,n.scales.y.top,n.scales.y.bottom)}},beforeDestroy(){delete this.clickedSegment}},lS=h.defineComponent({__name:"TimeSeriesChart",props:{chartData:{type:Object,required:!1,default:null},type:{type:String,required:!1,default:ee.TIMESERIES_LINE},fill:{type:Boolean,required:!1,default:!1},tooltipTitle:{type:String,required:!0},metricUnit:{type:String,required:!1,default:""},timeRangeMs:{type:Number,required:!1,default:void 0},timeRangeSec:{type:Number,required:!1,default:void 0},granularity:{type:String,required:!0},stacked:{type:Boolean,required:!1,default:!0},legendValues:{type:Object,required:!1,default:null},metricAxesTitle:{type:String,required:!1,default:null},dimensionAxesTitle:{type:String,required:!1,default:null},syntheticsDataKey:{type:String,required:!1,default:""},datasetColors:{type:Object,required:!1,default:De},chartLegendSortFn:{type:Function,required:!1,default:(n,t)=>n.value&&t.value&&t.value.raw-n.value.raw},chartTooltipSortFn:{type:Function,required:!1,default:(n,t)=>t.rawValue-n.rawValue}},setup(n){const t=n,{translateUnit:e}=St.useTranslatedUnits(),i=h.ref(),r=h.ref(wn()),a=h.ref(wn()),s=h.ref([]),o=h.ref(),l=h.ref(h.inject("legendPosition",Bt.Right)),c=h.reactive({showTooltip:!1,tooltipContext:"",tooltipSeries:[],left:"",top:"",units:t.metricUnit,translateUnit:e,offset:0,width:0,height:0,chartType:t.type,locked:!1,chartTooltipSortFn:t.chartTooltipSortFn}),u={id:r.value,afterUpdate(b){s.value=b.options.plugins.legend.labels.generateLabels(b).map(_=>({..._,value:t.legendValues&&t.legendValues[_.text]})).sort(t.chartLegendSortFn)}},d=h.computed(()=>[u,Vf,...t.type===ee.TIMESERIES_LINE?[ul]:[]]),{options:f}=St.useLinechartOptions({tooltipState:c,timeRangeMs:h.toRef(t,"timeRangeMs"),timeRangeSec:h.toRef(t,"timeRangeSec"),granularity:h.toRef(t,"granularity"),legendID:r.value,stacked:h.toRef(t,"stacked"),metricAxesTitle:h.toRef(t,"metricAxesTitle"),dimensionAxesTitle:h.toRef(t,"dimensionAxesTitle")}),g=h.computed(()=>({...t.chartData,datasets:t.chartData.datasets.map((b,_)=>(Array.isArray(t.datasetColors)?(b.backgroundColor=t.datasetColors[_%t.datasetColors.length],b.borderColor=Ji(b.backgroundColor,50)):b.rawDimension in t.datasetColors&&(b.backgroundColor=t.datasetColors[b.rawDimension],b.borderColor=Ji(b.backgroundColor,50)),b.fill=t.fill,b))}));St.useReportChartDataForSynthetics(h.toRef(t,"chartData"),h.toRef(t,"syntheticsDataKey"));const p=b=>ea(b,{short:[ot.DAILY,ot.WEEKLY].includes(t.granularity)}),x=b=>({[Bt.Right]:"legend-row",[Bt.Bottom]:"column",[Bt.Hidden]:"hidden"})[b],m=({width:b,height:_})=>{c.width=b,c.height=_},v=()=>{var b,_,w;c.locked=!c.locked,i.value&&((_=(b=i.value.chart.tooltip)==null?void 0:b.dataPoints)!=null&&_.length)&&(ul.clickedSegment=c.locked?(w=i.value.chart.tooltip)==null?void 0:w.dataPoints[0]:void 0)};return h.watch(()=>t.type,()=>{c.locked=!1,c.showTooltip=!1,delete ul.clickedSegment}),(b,_)=>(h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass(["chart-parent",x(l.value)]),"data-testid":"line-chart-parent"},[h.createElementVNode("div",{class:"chart-container",onClick:_[0]||(_[0]=w=>v())},[n.type===h.unref(ee).TIMESERIES_LINE?(h.openBlock(),h.createBlock(h.unref(bD),{key:0,ref_key:"chartInstance",ref:i,"chart-id":a.value,data:g.value,"data-testid":"time-series-line-chart",options:h.unref(f),plugins:d.value},null,8,["chart-id","data","options","plugins"])):n.type===h.unref(ee).TIMESERIES_BAR?(h.openBlock(),h.createBlock(h.unref(yD),{key:1,ref_key:"chartInstance",ref:i,"chart-id":a.value,data:g.value,"data-testid":"time-series-bar-chart",options:h.unref(f),plugins:d.value},null,8,["chart-id","data","options","plugins"])):h.createCommentVNode("",!0)]),h.createVNode(rl,{ref_key:"tooltipElement",ref:o,context:p(c.tooltipContext),"data-testid":"tooltip",left:c.left,locked:c.locked,series:c.tooltipSeries,"show-tooltip":c.showTooltip,"tooltip-title":n.tooltipTitle,top:c.top,unit:n.metricUnit,onDimensions:m,onLeft:_[1]||(_[1]=w=>c.left=w),onTop:_[2]||(_[2]=w=>c.top=w)},null,8,["context","left","locked","series","show-tooltip","tooltip-title","top","unit"]),h.createVNode(al,{id:r.value,"chart-instance":i.value,"data-testid":"legend",items:s.value},null,8,["id","chart-instance","items"])],2))}}),cS=Ke(lS,[["__scopeId","data-v-1aa05a3a"]]),uS={class:"analytics-chart-shell"},dS={class:"chart-header"},fS={key:0,class:"chart-title"},hS={class:"chart-header-icons-wrapper"},gS={key:1,class:"chart-export-button"},pS={key:1,class:"analytics-chart-parent"},mS=h.defineComponent({__name:"AnalyticsChart",props:{allowCsvExport:{type:Boolean,required:!1,default:!1},chartData:{type:Object,required:!0},chartOptions:{type:Object,required:!0},tooltipTitle:{type:String,required:!0},emptyStateTitle:{type:String,required:!1,default:""},emptyStateDescription:{type:String,required:!1,default:""},chartTitle:{type:String,required:!1,default:void 0},filenamePrefix:{type:String,required:!1,default:void 0},legendPosition:{type:String,required:!1,default:Bt.Right},syntheticsDataKey:{type:String,required:!1,default:""},height:{type:String,required:!1,default:"500px",validator:n=>/(\d *)(px)/.test(n)},width:{type:String,required:!1,default:"100%",validator:n=>/(\d *)(px|%)/.test(n)},showLegendValues:{type:Boolean,required:!1,default:!0},showAnnotations:{type:Boolean,required:!1,default:!0}},setup(n){h.useCssVars(L=>({"55ce9380":i.value,"1cb391c8":t.width}));const t=n,{i18n:e}=St.useI18n(),i=h.ref(t.height),r=h.computed(()=>t.filenamePrefix??(t.chartTitle||e.t("csvExport.defaultFilename"))),a=L=>{i.value=`${L}px`};h.watch(()=>t.height,L=>{i.value=L});const s=h.toRef(t,"chartData"),o=h.computed(()=>v.value?St.useExploreResultToTimeDataset({fill:t.chartOptions.fill,colorPalette:t.chartOptions.chartDatasetColors||De},h.toRef(t,"chartData")).value:St.useExploreResultToDatasets({fill:t.chartOptions.fill,colorPalette:t.chartOptions.chartDatasetColors||De},h.toRef(t,"chartData")).value),l=h.computed(()=>{var L;return(L=t.chartData)!=null&&L.meta?"start"in t.chartData.meta?t.chartData.meta.end-t.chartData.meta.start:void 0:0}),c=h.computed(()=>{var L;return(L=t.chartData)!=null&&L.meta?"startMs"in t.chartData.meta?t.chartData.meta.endMs-t.chartData.meta.startMs:void 0:0}),u=h.computed(()=>{var L;return(L=t.chartData.meta)!=null&&L.metricUnits?Object.values(t.chartData.meta.metricUnits)[0]:""}),d=h.computed(()=>t.showLegendValues&&t.legendPosition!==Bt.Bottom),{legendValues:f}=St.useChartLegendValues(o,t.chartOptions.type,u),g=h.computed(()=>{var L,H,I;return((I=(H=(L=t.chartData)==null?void 0:L.meta)==null?void 0:H.limit)==null?void 0:I.toString())||null}),p=h.computed(()=>{var L,H;return((H=(L=t.chartData)==null?void 0:L.meta)==null?void 0:H.truncated)||!1}),x=e.t("limitedResultsShown",{maxReturned:g.value}),m=h.computed(()=>[ee.VERTICAL_BAR.toString(),ee.HORIZONTAL_BAR.toString()].includes(t.chartOptions.type)),v=h.computed(()=>[ee.TIMESERIES_BAR,ee.TIMESERIES_LINE].some(L=>L===t.chartOptions.type)),b=h.computed(()=>t.chartOptions.type===ee.DOUGHNUT),_=h.computed(()=>t.chartOptions.type.includes("Vertical")?"vertical":"horizontal"),w=h.computed(()=>{var I,et,z;if(!((I=t.chartData)!=null&&I.meta.metricNames)||!((et=t.chartData)!=null&&et.meta.metricUnits))return;const L=t.chartData.meta.metricNames[0],H=t.chartData.meta.metricUnits[L];return((z=t.chartOptions)==null?void 0:z.metricAxesTitle)||e.te(`metricAxisTitles.${L}`)&&e.te(`chartUnits.${H}`)&&e.t(`metricAxisTitles.${L}`,{unit:e.t(`chartUnits.${H}`,{plural:"s"})})||void 0}),S=h.computed(()=>{const L=v.value?"Time":Object.keys(t.chartData.meta.dimensions||t.chartData.meta.metricNames)[0];return t.chartOptions.dimensionAxesTitle||e.te(`chartLabels.${L}`)&&e.t(`chartLabels.${L}`)||void 0}),C=h.computed(()=>{if(t.chartData.meta.granularity&&typeof t.chartData.meta.granularity!="number"&&"duration"in t.chartData.meta.granularity){const L=er(t.chartData.meta.granularity.duration);return e.t(`granularityAxisTitles.${L}`)}else if(t.chartData.meta.granularity&&!isNaN(Number(t.chartData.meta.granularity))){const L=er(Number(t.chartData.meta.granularity));return e.t(`granularityAxisTitles.${L}`)}return e.t("chartlabels.Time")}),k=h.computed(()=>t.emptyStateTitle||e.t("noDataAvailableTitle")),T=h.computed(()=>t.emptyStateDescription||e.t("noDataAvailableDescription")),D=h.computed(()=>v.value?Nx(o.value):t.chartData&&t.chartData.meta&&t.chartData.records.length),O=h.computed(()=>t.chartData.meta.granularity?typeof t.chartData.meta.granularity=="number"?er(t.chartData.meta.granularity)||ot.HOURLY:er(t.chartData.meta.granularity.duration)||ot.HOURLY:er(new Date(t.chartData.records[1].timestamp).getTime()-new Date(t.chartData.records[0].timestamp).getTime())||ot.HOURLY),A=h.ref(!1),R=St.useChartSelectedRange(s),W=L=>{A.value=L},V=()=>{W(!0)};return h.provide("showLegendValues",d),h.provide("legendPosition",h.toRef(t,"legendPosition")),(L,H)=>{const I=h.resolveComponent("KTooltip"),et=h.resolveComponent("KButton"),z=h.resolveComponent("KEmptyState");return h.openBlock(),h.createElementBlock("div",uS,[h.createElementVNode("div",dS,[n.chartTitle?(h.openBlock(),h.createElementBlock("div",fS,h.toDisplayString(n.chartTitle),1)):h.createCommentVNode("",!0),h.createElementVNode("div",hS,[D.value&&p.value&&g.value?(h.openBlock(),h.createBlock(I,{key:0,class:"tooltip","max-width":"500",placement:"right"},{content:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(h.unref(x)),1)]),default:h.withCtx(()=>[h.createVNode(h.unref(NT),{color:h.unref(UT),decorative:"",size:h.unref(BT)},null,8,["color","size"])]),_:1})):h.createCommentVNode("",!0)]),n.allowCsvExport&&D.value?(h.openBlock(),h.createElementBlock("div",gS,[h.createVNode(et,{appearance:"tertiary",class:"chart-export-button-display","data-testid":"csv-export-button",onClick:h.withModifiers(V,["prevent"])},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(h.unref(e).t("csvExport.exportButton")),1)]),_:1})])):h.createCommentVNode("",!0),n.allowCsvExport&&D.value&&A.value?(h.openBlock(),h.createBlock(sh,{key:2,"chart-data":s.value,filename:r.value,"selected-range":h.unref(R),onToggleModal:W},null,8,["chart-data","filename","selected-range"])):h.createCommentVNode("",!0)]),D.value?(h.openBlock(),h.createElementBlock("div",pS,[v.value?(h.openBlock(),h.createBlock(cS,{key:0,"chart-data":o.value,"chart-legend-sort-fn":n.chartOptions.chartLegendSortFn,"chart-tooltip-sort-fn":n.chartOptions.chartTooltipSortFn,"dataset-colors":n.chartOptions.chartDatasetColors,"dimension-axes-title":C.value,fill:n.chartOptions.fill,granularity:O.value,"legend-values":h.unref(f),"metric-axes-title":w.value,"metric-unit":u.value,stacked:n.chartOptions.stacked,"synthetics-data-key":n.syntheticsDataKey,"time-range-ms":c.value,"time-range-sec":l.value,"tooltip-title":n.tooltipTitle,type:n.chartOptions.type},null,8,["chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dataset-colors","dimension-axes-title","fill","granularity","legend-values","metric-axes-title","metric-unit","stacked","synthetics-data-key","time-range-ms","time-range-sec","tooltip-title","type"])):m.value?(h.openBlock(),h.createBlock(cD,{key:1,annotations:n.showAnnotations,"chart-data":o.value,"chart-legend-sort-fn":n.chartOptions.chartLegendSortFn,"chart-tooltip-sort-fn":n.chartOptions.chartTooltipSortFn,"data-testid":"bar-chart-container","dimension-axes-title":S.value,"legend-values":h.unref(f),"metric-axes-title":w.value,"metric-unit":u.value,orientation:_.value,stacked:n.chartOptions.stacked,"synthetics-data-key":n.syntheticsDataKey,"tooltip-title":n.tooltipTitle,onHeightUpdate:a},null,8,["annotations","chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dimension-axes-title","legend-values","metric-axes-title","metric-unit","orientation","stacked","synthetics-data-key","tooltip-title"])):b.value?(h.openBlock(),h.createBlock(_D,{key:2,"chart-data":o.value,"dataset-colors":n.chartOptions.chartDatasetColors,fill:n.chartOptions.fill,"legend-position":n.legendPosition,"legend-values":h.unref(f),"metric-unit":u.value,"synthetics-data-key":n.syntheticsDataKey,"tooltip-title":n.tooltipTitle},null,8,["chart-data","dataset-colors","fill","legend-position","legend-values","metric-unit","synthetics-data-key","tooltip-title"])):h.createCommentVNode("",!0)])):(h.openBlock(),h.createBlock(z,{key:0,class:"chart-empty-state","cta-is-hidden":!0,"data-testid":"no-data-in-report",icon:"stateNoData","icon-size":"170"},{title:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(k.value),1)]),message:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(T.value),1)]),_:1}))])}}}),yS=Ke(mS,[["__scopeId","data-v-3432f859"]]),bS={class:"chart-parent","data-testid":"doughnut-chart-parent"},vS={class:"chart-totals-flex"},xS={key:1,class:"metric-small","data-testid":"doughnut-chart-total"},_S=h.defineComponent({__name:"GaugeChart",props:{chartData:{type:Object,required:!1,default:null},metricDisplay:{type:String,required:!1,default:ii.Hidden},numerator:{type:Number,required:!1,default:0},syntheticsDataKey:{type:String,required:!1,default:""},datasetColors:{type:Object,required:!1,default:De},height:{type:String,required:!1,default:"400px",validator:n=>/(\d *)(px|%)/.test(n)},width:{type:String,required:!1,default:"100%",validator:n=>/(\d *)(px|%)/.test(n)}},setup(n){const t=n,{i18n:e}=St.useI18n(),i=h.ref(wn()),r=h.computed(()=>[t.chartData.datasets.reduce((p,x)=>(p.labels.push(x.label),p.borderColor.push(x.backgroundColor),p.backgroundColor.push(x.backgroundColor),p.data.push(x.data.reduce((m,v)=>m+v,0)),p),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),a=h.computed(()=>({...t.chartData,datasets:r.value}));St.useReportChartDataForSynthetics(h.toRef(t,"chartData"),h.toRef(t,"syntheticsDataKey"));const s={responsive:!0,maintainAspectRatio:!0,cutout:"78%",circumference:"200",rotation:"260",plugins:{legend:{display:!1}}},o=h.ref(),l=h.computed(()=>{var g;return tr((g=r==null?void 0:r.value[0])==null?void 0:g.data[t.numerator],{capital:!0})}),c=h.computed(()=>{var g,p;return tr(((g=r==null?void 0:r.value[0])==null?void 0:g.data[0])+((p=r==null?void 0:r.value[0])==null?void 0:p.data[1]),{capital:!0})}),u=h.computed(()=>{var g;return`color: ${(g=r==null?void 0:r.value[0])==null?void 0:g.backgroundColor[t.numerator]}`}),d=h.computed(()=>[ii.Full,ii.SingleMetric].includes(t.metricDisplay)),f=h.computed(()=>t.metricDisplay===ii.Full);return(g,p)=>(h.openBlock(),h.createElementBlock("div",bS,[h.createElementVNode("div",vS,[d.value?(h.openBlock(),h.createElementBlock("div",{key:0,class:"metric-large","data-testid":"doughnut-chart-metric",style:h.normalizeStyle(u.value)},h.toDisplayString(l.value),5)):h.createCommentVNode("",!0),f.value?(h.openBlock(),h.createElementBlock("div",xS,h.toDisplayString(h.unref(e).t("total"))+": "+h.toDisplayString(c.value),1)):h.createCommentVNode("",!0)]),h.createElementVNode("div",{class:"chart-container",style:h.normalizeStyle({height:n.height,width:n.width})},[h.createVNode(h.unref(Zf),{ref_key:"chartInstance",ref:o,"chart-id":i.value,data:a.value,options:s},null,8,["chart-id","data","options"])],4)]))}}),wS=Ke(_S,[["__scopeId","data-v-5871cb7a"]]),TS={class:"simple-chart-shell"},DS={key:1,class:"analytics-chart-parent"},SS=Ke(h.defineComponent({__name:"SimpleChart",props:{chartData:{type:Object,required:!0},chartOptions:{type:Object,required:!0},emptyStateTitle:{type:String,required:!1,default:""},syntheticsDataKey:{type:String,required:!1,default:""},height:{type:String,required:!1,default:"400px",validator:n=>/(\d *)(px|%)/.test(n)},width:{type:String,required:!1,default:"100%",validator:n=>/(\d *)(px|%)/.test(n)}},setup(n){const t=n,{i18n:e}=St.useI18n(),i=h.computed(()=>{var c;const l=St.useExploreResultToDatasets({colorPalette:t.chartOptions.chartDatasetColors||De},h.toRef(t,"chartData")).value;return(c=t.chartOptions)!=null&&c.reverseDataset&&(l==null||l.datasets.reverse()),l}),r=h.computed(()=>{var l;return(l=t.chartData.meta)!=null&&l.metricUnits?Object.values(t.chartData.meta.metricUnits)[0]:""}),a=h.computed(()=>t.chartOptions.type===Qr.GAUGE),s=h.computed(()=>t.emptyStateTitle||e.t("noDataAvailableTitle")),o=h.computed(()=>t.chartData&&t.chartData.meta&&t.chartData.records.length);return(l,c)=>{const u=h.resolveComponent("KEmptyState");return h.openBlock(),h.createElementBlock("div",TS,[o.value?(h.openBlock(),h.createElementBlock("div",DS,[a.value?(h.openBlock(),h.createBlock(wS,{key:0,"chart-data":i.value,"dataset-colors":n.chartOptions.chartDatasetColors,"is-simple":"","metric-display":n.chartOptions.metricDisplay,"metric-unit":r.value,numerator:n.chartOptions.numerator,"synthetics-data-key":n.syntheticsDataKey,width:n.width},null,8,["chart-data","dataset-colors","metric-display","metric-unit","numerator","synthetics-data-key","width"])):h.createCommentVNode("",!0)])):(h.openBlock(),h.createBlock(u,{key:0,class:"chart-empty-state","cta-is-hidden":!0,"data-testid":"no-data-in-report",icon:"stateNoData","icon-size":"80"},{title:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(s.value),1)]),_:1}))])}}}),[["__scopeId","data-v-f014a616"]]),MS={class:"top-n-card-title","data-testid":"top-n-card-title"},CS={class:"top-n-card-description","data-testid":"top-n-card-description"},kS={key:3,class:"top-n-table","data-testid":"top-n-table"},OS={class:"table-headings"},PS={class:"table-row"},ES={class:"column-1"},AS={class:"column-2"},RS={class:"table-body","data-testid":"top-n-data"},LS=["data-testid"],IS={class:"column-1"},NS={class:"column-2"},FS=Ke(h.defineComponent({__name:"TopNTable",props:{title:{type:String,required:!0},description:{type:String,default:""},data:{type:Object,required:!0},emptyStateTitle:{type:String,default:""},isLoading:{type:Boolean,default:!1}},setup(n){const t=n,{i18n:e}=St.useI18n(),i=h.computed(()=>t.data.records),r=h.computed(()=>{var p;return!!((p=i.value)!=null&&p.length)}),a=h.computed(()=>{var p,x;return(p=t.data.meta)!=null&&p.display&&((x=Object.keys(t.data.meta.display))==null?void 0:x[0])||""}),s=h.computed(()=>a.value?t.data.meta.display[a.value]:{}),o=h.computed(()=>{var p,x;return(x=(p=t.data.meta)==null?void 0:p.metricNames)!=null&&x.length?t.data.meta.metricNames[0]:""}),l=h.computed(()=>o.value?e.t(`chartLabels.${o.value}`)||o.value:""),c=h.computed(()=>{if(!r.value)return"";if(t.data.meta)if(Object.keys(s.value).length){if(!o.value)return e.t("topNTable.errors.metricNames")}else return e.t("topNTable.errors.display");else return e.t("topNTable.errors.meta");return""}),u=p=>{const x=p.event;return String(x[a.value])},d=p=>{const x=u(p),m=s.value[x];return m?m.name:"-"},f=p=>{const x=u(p),m=s.value[x];return m?m.deleted:!1},g=p=>{if(!o.value)return"–";const m=p.event[o.value];return m?tr(m,{capital:!0,round:!0}):"–"};return(p,x)=>{const m=h.resolveComponent("KEmptyState"),v=h.resolveComponent("KSkeleton"),b=h.resolveComponent("KCard");return h.openBlock(),h.createBlock(b,{class:"kong-ui-public-top-n-table"},h.createSlots({default:h.withCtx(()=>[c.value?(h.openBlock(),h.createBlock(m,{key:0,"cta-is-hidden":"","data-testid":"top-n-error-state","is-error":""},{title:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(h.unref(e).t("topNTable.defaultErrorStateTitle")),1)]),message:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(c.value),1)]),_:1})):n.isLoading?(h.openBlock(),h.createBlock(v,{key:1,"table-columns":2,type:"table"})):r.value?(h.openBlock(),h.createElementBlock("div",kS,[h.createElementVNode("div",OS,[h.createElementVNode("div",PS,[h.createElementVNode("div",ES,h.toDisplayString(h.unref(e).t("topNTable.nameLabel")),1),h.createElementVNode("div",AS,h.toDisplayString(l.value),1)])]),h.createElementVNode("div",RS,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(i.value,(_,w)=>(h.openBlock(),h.createElementBlock("div",{key:`entry-${w}`,class:"table-row","data-testid":`row-${u(_)}`},[h.createElementVNode("div",IS,[h.renderSlot(p.$slots,"name",{record:{id:u(_),name:d(_),deleted:f(_),dimension:a.value}},()=>[h.createTextVNode(h.toDisplayString(d(_)),1)],!0)]),h.createElementVNode("div",NS," "+h.toDisplayString(g(_)),1)],8,LS))),128))])])):(h.openBlock(),h.createBlock(m,{key:2,"cta-is-hidden":"","data-testid":"top-n-empty-state",icon:"stateNoData","icon-size":"80"},{title:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(n.emptyStateTitle||h.unref(e).t("topNTable.defaultEmptyStateTitle")),1)]),_:1}))]),_:2},[n.title?{name:"title",fn:h.withCtx(()=>[h.createElementVNode("div",MS,h.toDisplayString(n.title),1)]),key:"0"}:void 0,n.description?{name:"actions",fn:h.withCtx(()=>[h.createElementVNode("div",CS,h.toDisplayString(n.description),1)]),key:"1"}:void 0]),1024)}}}),[["__scopeId","data-v-bd78642f"]]),dl="#e0e4ea",US={100:["#c8e2fd","#80bfff","#4da6ff","#1a8cff","#0072e5","#0059b2"],200:["#ceedd2","#9edca6","#89d595","#6fcc83","#44c26b","#0bb652","#0ca84a","#169643","#196e33","#1b572a"],300:["#fff4db","#ffe9b8","#ffe2a1","#ffd982","#ffd062","#fdc53b","#f4bb1e","#e8b00b","#d9a30f","#c89407"],400:["#ffead8","#ffd5b1","#ffc899","#ffba81","#ffae6b","#fe9439","#f6871d","#eb7c0c","#da700c","#cc6100"],500:["#ffd5d5","#ffb6b6","#ff9d9d","#ff8484","#ff6a6a","#ff4545","#fb1f1f","#e90b0b","#d40202","#be0202"]},or=(n,t)=>{let e=1;const i=US[n],r=new Map;for(const a of t)r.set(a,i[e]),e=e%(i.length-1)+1;return r.set(-1,i[0]),r},lh=new Map([[100,or("100",[100,101,102,103])],[200,or("200",[200,201,202,203,204,205,206,207,208,226])],[300,or("300",[300,301,302,303,304,305,307,308])],[400,or("400",[400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,421,422,423,424,425,426,428,429,431,451])],[500,or("500",[500,501,502,503,504,505,506,507,508,510,511])]]),ch=n=>{const t=parseInt(n,10),e=Math.floor(t/100)*100,i=lh.get(e);return i===void 0?dl:i.get(t)??i.get(-1)??dl},BS=n=>{const t=ch(n);return{solid:t,light:t}};ut.AnalyticsChart=yS,ut.ChartLegendPosition=Bt,ut.ChartMetricDisplay=ii,ut.ChartTypes=ee,ut.ChartTypesSimple=Qr,ut.CsvExportModal=sh,ut.DECIMAL_DISPLAY=Nd,ut.FONT_SIZE_REGULAR=Ud,ut.FONT_SIZE_SMALL=Fd,ut.MAX_LABEL_LENGTH=na,ut.SimpleChart=SS,ut.TopNTable=FS,ut.ValidType=Hn,ut.accessibleGrey=Bd,ut.codesInSpec=lh,ut.darkenColor=Ji,ut.datavisPalette=De,ut.formatTime=ea,ut.lightGrey=dl,ut.lookupDatavisColor=ai,ut.lookupStatusCodeCategoryColor=BS,ut.lookupStatusCodeColor=ch,ut.numberFormatter=ta,Object.defineProperty(ut,Symbol.toStringTag,{value:"Module"})});
|