@eodash/eodash 5.0.0-alpha → 5.0.0-alpha.1.1
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/bin/app.js +16 -147
- package/bin/cli.js +57 -0
- package/bin/serverConfig.js +134 -0
- package/bin/update.js +17 -0
- package/bin/utils.js +33 -0
- package/core/App.vue +21 -0
- package/core/components/DashboardLayout.vue +58 -0
- package/core/components/DynamicWebComponent.vue +68 -0
- package/core/components/Footer.vue +31 -0
- package/core/components/Header.vue +38 -0
- package/core/components/IframeWrapper.vue +11 -0
- package/core/components/MobileLayout.vue +79 -0
- package/core/composables/DefineConfig.js +44 -0
- package/core/composables/DefineWidgets.js +118 -0
- package/core/composables/index.js +147 -0
- package/core/eodashConfig.js +136 -0
- package/core/main.js +4 -0
- package/core/plugins/index.js +27 -0
- package/core/plugins/router.js +20 -0
- package/core/plugins/vuetify.js +27 -0
- package/core/render.js +13 -0
- package/core/store/Actions.js +28 -0
- package/core/store/Keys.js +6 -0
- package/core/store/States.js +12 -0
- package/core/store/index.js +23 -0
- package/core/store/stac.js +61 -0
- package/core/types.d.ts +333 -0
- package/core/views/Dashboard.vue +49 -0
- package/core/vite-env.d.ts +35 -0
- package/package.json +20 -21
- package/widgets/WidgetsContainer.vue +46 -0
- package/dist/.gitkeep +0 -0
- package/dist/assets/Dashboard-4233cc52.css +0 -1
- package/dist/assets/Dashboard-d7d438a6.js +0 -1
- package/dist/assets/DashboardLayout-5ab6c4a5.js +0 -29
- package/dist/assets/DashboardLayout-739135c5.css +0 -1
- package/dist/assets/DynamicWebComponent-1b7b527a.js +0 -1
- package/dist/assets/Footer-0fe1887a.css +0 -1
- package/dist/assets/Footer-7e1ca735.js +0 -1
- package/dist/assets/Header-9cac598d.css +0 -1
- package/dist/assets/Header-ae17296c.js +0 -1
- package/dist/assets/IframeWrapper-b2c05ffd.js +0 -1
- package/dist/assets/MobileLayout-1b3cb89b.js +0 -1
- package/dist/assets/MobileLayout-ad647682.css +0 -1
- package/dist/assets/VMain-d6216866.css +0 -1
- package/dist/assets/VMain-f6b3f120.js +0 -1
- package/dist/assets/WidgetsContainer-cdad3d50.js +0 -1
- package/dist/assets/color-6039ab34.js +0 -1
- package/dist/assets/eox-chart-3b122ba4.js +0 -142
- package/dist/assets/eox-itemfilter-a63da0da.js +0 -981
- package/dist/assets/eox-jsonform-98c2af62.js +0 -239
- package/dist/assets/eox-layercontrol-f5e35702.js +0 -1126
- package/dist/assets/eox-map-7f82b0d4.js +0 -178
- package/dist/assets/eox-stacinfo-65a8d8f3.js +0 -388
- package/dist/assets/eox-timecontrol-4be63aa2.js +0 -237
- package/dist/assets/index-52c9d989.js +0 -34
- package/dist/assets/index-5d2400e5.css +0 -5
- package/dist/assets/materialdesignicons-webfont-48d3eec6.woff +0 -0
- package/dist/assets/materialdesignicons-webfont-861aea05.eot +0 -0
- package/dist/assets/materialdesignicons-webfont-bd725a7a.ttf +0 -0
- package/dist/assets/materialdesignicons-webfont-e52d60f6.woff2 +0 -0
- package/dist/assets/ssrBoot-0b8754a9.css +0 -1
- package/dist/assets/ssrBoot-d383eb61.js +0 -1
- package/dist/assets/webfontloader-523643f5.js +0 -1
- package/dist/index.html +0 -17
- package/dist/types/index.d.ts +0 -124
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
var th=Object.defineProperty,eh=(s,t,e)=>t in s?th(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,w=(s,t,e)=>(eh(s,typeof t!="symbol"?t+"":t,e),e);/*!
|
|
2
|
-
* @kurkle/color v0.3.2
|
|
3
|
-
* https://github.com/kurkle/color#readme
|
|
4
|
-
* (c) 2023 Jukka Kurkela
|
|
5
|
-
* Released under the MIT License
|
|
6
|
-
*/function Ts(s){return s+.5|0}const Gt=(s,t,e)=>Math.max(Math.min(s,e),t);function as(s){return Gt(Ts(s*2.55),0,255)}function Qt(s){return Gt(Ts(s*255),0,255)}function zt(s){return Gt(Ts(s/2.55)/100,0,1)}function Zi(s){return Gt(Ts(s*100),0,100)}const xt={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},ti=[..."0123456789ABCDEF"],sh=s=>ti[s&15],nh=s=>ti[(s&240)>>4]+ti[s&15],Ls=s=>(s&240)>>4===(s&15),ih=s=>Ls(s.r)&&Ls(s.g)&&Ls(s.b)&&Ls(s.a);function rh(s){var t=s.length,e;return s[0]==="#"&&(t===4||t===5?e={r:255&xt[s[1]]*17,g:255&xt[s[2]]*17,b:255&xt[s[3]]*17,a:t===5?xt[s[4]]*17:255}:(t===7||t===9)&&(e={r:xt[s[1]]<<4|xt[s[2]],g:xt[s[3]]<<4|xt[s[4]],b:xt[s[5]]<<4|xt[s[6]],a:t===9?xt[s[7]]<<4|xt[s[8]]:255})),e}const oh=(s,t)=>s<255?t(s):"";function ah(s){var t=ih(s)?sh:nh;return s?"#"+t(s.r)+t(s.g)+t(s.b)+oh(s.a,t):void 0}const lh=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Bo(s,t,e){const n=t*Math.min(e,1-e),i=(r,o=(r+s/30)%12)=>e-n*Math.max(Math.min(o-3,9-o,1),-1);return[i(0),i(8),i(4)]}function hh(s,t,e){const n=(i,r=(i+s/60)%6)=>e-e*t*Math.max(Math.min(r,4-r,1),0);return[n(5),n(3),n(1)]}function ch(s,t,e){const n=Bo(s,1,.5);let i;for(t+e>1&&(i=1/(t+e),t*=i,e*=i),i=0;i<3;i++)n[i]*=1-t-e,n[i]+=t;return n}function uh(s,t,e,n,i){return s===i?(t-e)/n+(t<e?6:0):t===i?(e-s)/n+2:(s-t)/n+4}function _i(s){const t=s.r/255,e=s.g/255,n=s.b/255,i=Math.max(t,e,n),r=Math.min(t,e,n),o=(i+r)/2;let a,l,h;return i!==r&&(h=i-r,l=o>.5?h/(2-i-r):h/(i+r),a=uh(t,e,n,h,i),a=a*60+.5),[a|0,l||0,o]}function wi(s,t,e,n){return(Array.isArray(t)?s(t[0],t[1],t[2]):s(t,e,n)).map(Qt)}function Mi(s,t,e){return wi(Bo,s,t,e)}function dh(s,t,e){return wi(ch,s,t,e)}function fh(s,t,e){return wi(hh,s,t,e)}function Ho(s){return(s%360+360)%360}function mh(s){const t=lh.exec(s);let e=255,n;if(!t)return;t[5]!==n&&(e=t[6]?as(+t[5]):Qt(+t[5]));const i=Ho(+t[2]),r=+t[3]/100,o=+t[4]/100;return t[1]==="hwb"?n=dh(i,r,o):t[1]==="hsv"?n=fh(i,r,o):n=Mi(i,r,o),{r:n[0],g:n[1],b:n[2],a:e}}function gh(s,t){var e=_i(s);e[0]=Ho(e[0]+t),e=Mi(e),s.r=e[0],s.g=e[1],s.b=e[2]}function ph(s){if(!s)return;const t=_i(s),e=t[0],n=Zi(t[1]),i=Zi(t[2]);return s.a<255?`hsla(${e}, ${n}%, ${i}%, ${zt(s.a)})`:`hsl(${e}, ${n}%, ${i}%)`}const Yi={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"},Gi={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 s={},t=Object.keys(Gi),e=Object.keys(Yi);let n,i,r,o,a;for(n=0;n<t.length;n++){for(o=a=t[n],i=0;i<e.length;i++)r=e[i],a=a.replace(r,Yi[r]);r=parseInt(Gi[o],16),s[a]=[r>>16&255,r>>8&255,r&255]}return s}let Ns;function bh(s){Ns||(Ns=yh(),Ns.transparent=[0,0,0,0]);const t=Ns[s.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const xh=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function vh(s){const t=xh.exec(s);let e=255,n,i,r;if(t){if(t[7]!==n){const o=+t[7];e=t[8]?as(o):Gt(o*255,0,255)}return n=+t[1],i=+t[3],r=+t[5],n=255&(t[2]?as(n):Gt(n,0,255)),i=255&(t[4]?as(i):Gt(i,0,255)),r=255&(t[6]?as(r):Gt(r,0,255)),{r:n,g:i,b:r,a:e}}}function _h(s){return s&&(s.a<255?`rgba(${s.r}, ${s.g}, ${s.b}, ${zt(s.a)})`:`rgb(${s.r}, ${s.g}, ${s.b})`)}const Nn=s=>s<=.0031308?s*12.92:Math.pow(s,1/2.4)*1.055-.055,Ee=s=>s<=.04045?s/12.92:Math.pow((s+.055)/1.055,2.4);function wh(s,t,e){const n=Ee(zt(s.r)),i=Ee(zt(s.g)),r=Ee(zt(s.b));return{r:Qt(Nn(n+e*(Ee(zt(t.r))-n))),g:Qt(Nn(i+e*(Ee(zt(t.g))-i))),b:Qt(Nn(r+e*(Ee(zt(t.b))-r))),a:s.a+e*(t.a-s.a)}}function Rs(s,t,e){if(s){let n=_i(s);n[t]=Math.max(0,Math.min(n[t]+n[t]*e,t===0?360:1)),n=Mi(n),s.r=n[0],s.g=n[1],s.b=n[2]}}function qo(s,t){return s&&Object.assign(t||{},s)}function Ji(s){var t={r:0,g:0,b:0,a:255};return Array.isArray(s)?s.length>=3&&(t={r:s[0],g:s[1],b:s[2],a:255},s.length>3&&(t.a=Qt(s[3]))):(t=qo(s,{r:0,g:0,b:0,a:1}),t.a=Qt(t.a)),t}function Mh(s){return s.charAt(0)==="r"?vh(s):mh(s)}class bs{constructor(t){if(t instanceof bs)return t;const e=typeof t;let n;e==="object"?n=Ji(t):e==="string"&&(n=rh(t)||bh(t)||Mh(t)),this._rgb=n,this._valid=!!n}get valid(){return this._valid}get rgb(){var t=qo(this._rgb);return t&&(t.a=zt(t.a)),t}set rgb(t){this._rgb=Ji(t)}rgbString(){return this._valid?_h(this._rgb):void 0}hexString(){return this._valid?ah(this._rgb):void 0}hslString(){return this._valid?ph(this._rgb):void 0}mix(t,e){if(t){const n=this.rgb,i=t.rgb;let r;const o=e===r?.5:e,a=2*o-1,l=n.a-i.a,h=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;r=1-h,n.r=255&h*n.r+r*i.r+.5,n.g=255&h*n.g+r*i.g+.5,n.b=255&h*n.b+r*i.b+.5,n.a=o*n.a+(1-o)*i.a,this.rgb=n}return this}interpolate(t,e){return t&&(this._rgb=wh(this._rgb,t._rgb,e)),this}clone(){return new bs(this.rgb)}alpha(t){return this._rgb.a=Qt(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=Ts(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 Rs(this._rgb,2,t),this}darken(t){return Rs(this._rgb,2,-t),this}saturate(t){return Rs(this._rgb,1,t),this}desaturate(t){return Rs(this._rgb,1,-t),this}rotate(t){return gh(this._rgb,t),this}}/*!
|
|
7
|
-
* Chart.js v4.2.1
|
|
8
|
-
* https://www.chartjs.org
|
|
9
|
-
* (c) 2023 Chart.js Contributors
|
|
10
|
-
* Released under the MIT License
|
|
11
|
-
*/function Rt(){}const kh=(()=>{let s=0;return()=>s++})();function N(s){return s===null||typeof s>"u"}function $(s){if(Array.isArray&&Array.isArray(s))return!0;const t=Object.prototype.toString.call(s);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function P(s){return s!==null&&Object.prototype.toString.call(s)==="[object Object]"}function Z(s){return(typeof s=="number"||s instanceof Number)&&isFinite(+s)}function mt(s,t){return Z(s)?s:t}function E(s,t){return typeof s>"u"?t:s}const Sh=(s,t)=>typeof s=="string"&&s.endsWith("%")?parseFloat(s)/100:+s/t,Uo=(s,t)=>typeof s=="string"&&s.endsWith("%")?parseFloat(s)/100*t:+s;function W(s,t,e){if(s&&typeof s.call=="function")return s.apply(e,t)}function z(s,t,e,n){let i,r,o;if($(s))if(r=s.length,n)for(i=r-1;i>=0;i--)t.call(e,s[i],i);else for(i=0;i<r;i++)t.call(e,s[i],i);else if(P(s))for(o=Object.keys(s),r=o.length,i=0;i<r;i++)t.call(e,s[o[i]],o[i])}function on(s,t){let e,n,i,r;if(!s||!t||s.length!==t.length)return!1;for(e=0,n=s.length;e<n;++e)if(i=s[e],r=t[e],i.datasetIndex!==r.datasetIndex||i.index!==r.index)return!1;return!0}function an(s){if($(s))return s.map(an);if(P(s)){const t=Object.create(null),e=Object.keys(s),n=e.length;let i=0;for(;i<n;++i)t[e[i]]=an(s[e[i]]);return t}return s}function Zo(s){return["__proto__","prototype","constructor"].indexOf(s)===-1}function Th(s,t,e,n){if(!Zo(s))return;const i=t[s],r=e[s];P(i)&&P(r)?yt(i,r,n):t[s]=an(r)}function yt(s,t,e){const n=$(t)?t:[t],i=n.length;if(!P(s))return s;e=e||{};const r=e.merger||Th;let o;for(let a=0;a<i;++a){if(o=n[a],!P(o))continue;const l=Object.keys(o);for(let h=0,c=l.length;h<c;++h)r(l[h],s,o,e)}return s}function us(s,t){return yt(s,t,{merger:Dh})}function Dh(s,t,e){if(!Zo(s))return;const n=t[s],i=e[s];P(n)&&P(i)?us(n,i):Object.prototype.hasOwnProperty.call(t,s)||(t[s]=an(i))}const Xi={"":s=>s,x:s=>s.x,y:s=>s.y};function Oh(s){const t=s.split("."),e=[];let n="";for(const i of t)n+=i,n.endsWith("\\")?n=n.slice(0,-1)+".":(e.push(n),n="");return e}function Eh(s){const t=Oh(s);return e=>{for(const n of t){if(n==="")break;e=e&&e[n]}return e}}function ee(s,t){return(Xi[t]||(Xi[t]=Eh(t)))(s)}function ki(s){return s.charAt(0).toUpperCase()+s.slice(1)}const Mt=s=>typeof s<"u",se=s=>typeof s=="function",Ki=(s,t)=>{if(s.size!==t.size)return!1;for(const e of s)if(!t.has(e))return!1;return!0};function Ch(s){return s.type==="mouseup"||s.type==="click"||s.type==="contextmenu"}const q=Math.PI,B=2*q,Ah=B+q,ln=Number.POSITIVE_INFINITY,Ph=q/180,Y=q/2,ie=q/4,Qi=q*2/3,Jt=Math.log10,Lt=Math.sign;function ds(s,t,e){return Math.abs(s-t)<e}function tr(s){const t=Math.round(s);s=ds(s,t,s/1e3)?t:s;const e=Math.pow(10,Math.floor(Jt(s))),n=s/e;return(n<=1?1:n<=2?2:n<=5?5:10)*e}function Ih(s){const t=[],e=Math.sqrt(s);let n;for(n=1;n<e;n++)s%n===0&&(t.push(n),t.push(s/n));return e===(e|0)&&t.push(e),t.sort((i,r)=>i-r).pop(),t}function Re(s){return!isNaN(parseFloat(s))&&isFinite(s)}function Lh(s,t){const e=Math.round(s);return e-t<=s&&e+t>=s}function Yo(s,t,e){let n,i,r;for(n=0,i=s.length;n<i;n++)r=s[n][e],isNaN(r)||(t.min=Math.min(t.min,r),t.max=Math.max(t.max,r))}function Ot(s){return s*(q/180)}function Si(s){return s*(180/q)}function er(s){if(!Z(s))return;let t=1,e=0;for(;Math.round(s*t)/t!==s;)t*=10,e++;return e}function Go(s,t){const e=t.x-s.x,n=t.y-s.y,i=Math.sqrt(e*e+n*n);let r=Math.atan2(n,e);return r<-.5*q&&(r+=B),{angle:r,distance:i}}function ei(s,t){return Math.sqrt(Math.pow(t.x-s.x,2)+Math.pow(t.y-s.y,2))}function Nh(s,t){return(s-t+Ah)%B-q}function gt(s){return(s%B+B)%B}function xs(s,t,e,n){const i=gt(s),r=gt(t),o=gt(e),a=gt(r-i),l=gt(o-i),h=gt(i-r),c=gt(i-o);return i===r||i===o||n&&r===o||a>l&&h<c}function Q(s,t,e){return Math.max(t,Math.min(e,s))}function Rh(s){return Q(s,-32768,32767)}function Wt(s,t,e,n=1e-6){return s>=Math.min(t,e)-n&&s<=Math.max(t,e)+n}function Ti(s,t,e){e=e||(o=>s[o]<t);let n=s.length-1,i=0,r;for(;n-i>1;)r=i+n>>1,e(r)?i=r:n=r;return{lo:i,hi:n}}const jt=(s,t,e,n)=>Ti(s,e,n?i=>{const r=s[i][t];return r<e||r===e&&s[i+1][t]===e}:i=>s[i][t]<e),Fh=(s,t,e)=>Ti(s,e,n=>s[n][t]>=e);function Vh(s,t,e){let n=0,i=s.length;for(;n<i&&s[n]<t;)n++;for(;i>n&&s[i-1]>e;)i--;return n>0||i<s.length?s.slice(n,i):s}const Jo=["push","pop","shift","splice","unshift"];function zh(s,t){if(s._chartjs){s._chartjs.listeners.push(t);return}Object.defineProperty(s,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),Jo.forEach(e=>{const n="_onData"+ki(e),i=s[e];Object.defineProperty(s,e,{configurable:!0,enumerable:!1,value(...r){const o=i.apply(this,r);return s._chartjs.listeners.forEach(a=>{typeof a[n]=="function"&&a[n](...r)}),o}})})}function sr(s,t){const e=s._chartjs;if(!e)return;const n=e.listeners,i=n.indexOf(t);i!==-1&&n.splice(i,1),!(n.length>0)&&(Jo.forEach(r=>{delete s[r]}),delete s._chartjs)}function Xo(s){const t=new Set;let e,n;for(e=0,n=s.length;e<n;++e)t.add(s[e]);return t.size===n?s:Array.from(t)}const Ko=function(){return typeof window>"u"?function(s){return s()}:window.requestAnimationFrame}();function Qo(s,t){let e=[],n=!1;return function(...i){e=i,n||(n=!0,Ko.call(window,()=>{n=!1,s.apply(t,e)}))}}function Wh(s,t){let e;return function(...n){return t?(clearTimeout(e),e=setTimeout(s,t,n)):s.apply(this,n),t}}const Di=s=>s==="start"?"left":s==="end"?"right":"center",tt=(s,t,e)=>s==="start"?t:s==="end"?e:(t+e)/2,jh=(s,t,e,n)=>s===(n?"left":"right")?e:s==="center"?(t+e)/2:t;function ta(s,t,e){const n=t.length;let i=0,r=n;if(s._sorted){const{iScale:o,_parsed:a}=s,l=o.axis,{min:h,max:c,minDefined:u,maxDefined:d}=o.getUserBounds();u&&(i=Q(Math.min(jt(a,o.axis,h).lo,e?n:jt(t,l,o.getPixelForValue(h)).lo),0,n-1)),d?r=Q(Math.max(jt(a,o.axis,c,!0).hi+1,e?0:jt(t,l,o.getPixelForValue(c),!0).hi+1),i,n)-i:r=n-i}return{start:i,count:r}}function ea(s){const{xScale:t,yScale:e,_scaleRanges:n}=s,i={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!n)return s._scaleRanges=i,!0;const r=n.xmin!==t.min||n.xmax!==t.max||n.ymin!==e.min||n.ymax!==e.max;return Object.assign(n,i),r}const Fs=s=>s===0||s===1,nr=(s,t,e)=>-(Math.pow(2,10*(s-=1))*Math.sin((s-t)*B/e)),ir=(s,t,e)=>Math.pow(2,-10*s)*Math.sin((s-t)*B/e)+1,fs={linear:s=>s,easeInQuad:s=>s*s,easeOutQuad:s=>-s*(s-2),easeInOutQuad:s=>(s/=.5)<1?.5*s*s:-.5*(--s*(s-2)-1),easeInCubic:s=>s*s*s,easeOutCubic:s=>(s-=1)*s*s+1,easeInOutCubic:s=>(s/=.5)<1?.5*s*s*s:.5*((s-=2)*s*s+2),easeInQuart:s=>s*s*s*s,easeOutQuart:s=>-((s-=1)*s*s*s-1),easeInOutQuart:s=>(s/=.5)<1?.5*s*s*s*s:-.5*((s-=2)*s*s*s-2),easeInQuint:s=>s*s*s*s*s,easeOutQuint:s=>(s-=1)*s*s*s*s+1,easeInOutQuint:s=>(s/=.5)<1?.5*s*s*s*s*s:.5*((s-=2)*s*s*s*s+2),easeInSine:s=>-Math.cos(s*Y)+1,easeOutSine:s=>Math.sin(s*Y),easeInOutSine:s=>-.5*(Math.cos(q*s)-1),easeInExpo:s=>s===0?0:Math.pow(2,10*(s-1)),easeOutExpo:s=>s===1?1:-Math.pow(2,-10*s)+1,easeInOutExpo:s=>Fs(s)?s:s<.5?.5*Math.pow(2,10*(s*2-1)):.5*(-Math.pow(2,-10*(s*2-1))+2),easeInCirc:s=>s>=1?s:-(Math.sqrt(1-s*s)-1),easeOutCirc:s=>Math.sqrt(1-(s-=1)*s),easeInOutCirc:s=>(s/=.5)<1?-.5*(Math.sqrt(1-s*s)-1):.5*(Math.sqrt(1-(s-=2)*s)+1),easeInElastic:s=>Fs(s)?s:nr(s,.075,.3),easeOutElastic:s=>Fs(s)?s:ir(s,.075,.3),easeInOutElastic(s){return Fs(s)?s:s<.5?.5*nr(s*2,.1125,.45):.5+.5*ir(s*2-1,.1125,.45)},easeInBack(s){return s*s*((1.70158+1)*s-1.70158)},easeOutBack(s){return(s-=1)*s*((1.70158+1)*s+1.70158)+1},easeInOutBack(s){let t=1.70158;return(s/=.5)<1?.5*(s*s*(((t*=1.525)+1)*s-t)):.5*((s-=2)*s*(((t*=1.525)+1)*s+t)+2)},easeInBounce:s=>1-fs.easeOutBounce(1-s),easeOutBounce(s){return s<1/2.75?7.5625*s*s:s<2/2.75?7.5625*(s-=1.5/2.75)*s+.75:s<2.5/2.75?7.5625*(s-=2.25/2.75)*s+.9375:7.5625*(s-=2.625/2.75)*s+.984375},easeInOutBounce:s=>s<.5?fs.easeInBounce(s*2)*.5:fs.easeOutBounce(s*2-1)*.5+.5};function sa(s){if(s&&typeof s=="object"){const t=s.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function hn(s){return sa(s)?s:new bs(s)}function Rn(s){return sa(s)?s:new bs(s).saturate(.5).darken(.1).hexString()}const $h=["x","y","borderWidth","radius","tension"],Bh=["color","borderColor","backgroundColor"];function Hh(s){s.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),s.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),s.set("animations",{colors:{type:"color",properties:Bh},numbers:{type:"number",properties:$h}}),s.describe("animations",{_fallback:"animation"}),s.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function qh(s){s.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const rr=new Map;function Uh(s,t){t=t||{};const e=s+JSON.stringify(t);let n=rr.get(e);return n||(n=new Intl.NumberFormat(s,t),rr.set(e,n)),n}function Ds(s,t,e){return Uh(t,e).format(s)}const na={values(s){return $(s)?s:""+s},numeric(s,t,e){if(s===0)return"0";const n=this.chart.options.locale;let i,r=s;if(e.length>1){const h=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(h<1e-4||h>1e15)&&(i="scientific"),r=Zh(s,e)}const o=Jt(Math.abs(r)),a=Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:i,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),Ds(s,n,l)},logarithmic(s,t,e){if(s===0)return"0";const n=e[t].significand||s/Math.pow(10,Math.floor(Jt(s)));return[1,2,3,5,10,15].includes(n)||t>.8*e.length?na.numeric.call(this,s,t,e):""}};function Zh(s,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&s!==Math.floor(s)&&(e=s-Math.floor(s)),e}var _n={formatters:na};function Yh(s){s.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",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:_n.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),s.route("scale.ticks","color","","color"),s.route("scale.grid","color","","borderColor"),s.route("scale.border","color","","borderColor"),s.route("scale.title","color","","color"),s.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),s.describe("scales",{_fallback:"scale"}),s.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const ve=Object.create(null),si=Object.create(null);function ms(s,t){if(!t)return s;const e=t.split(".");for(let n=0,i=e.length;n<i;++n){const r=e[n];s=s[r]||(s[r]=Object.create(null))}return s}function Fn(s,t,e){return typeof t=="string"?yt(ms(s,t),e):yt(ms(s,""),t)}class Gh{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=n=>n.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(n,i)=>Rn(i.backgroundColor),this.hoverBorderColor=(n,i)=>Rn(i.borderColor),this.hoverColor=(n,i)=>Rn(i.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 Fn(this,t,e)}get(t){return ms(this,t)}describe(t,e){return Fn(si,t,e)}override(t,e){return Fn(ve,t,e)}route(t,e,n,i){const r=ms(this,t),o=ms(this,n),a="_"+e;Object.defineProperties(r,{[a]:{value:r[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[a],h=o[i];return P(l)?Object.assign({},h,l):E(l,h)},set(l){this[a]=l}}})}apply(t){t.forEach(e=>e(this))}}var G=new Gh({_scriptable:s=>!s.startsWith("on"),_indexable:s=>s!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Hh,qh,Yh]);function Jh(s){return!s||N(s.size)||N(s.family)?null:(s.style?s.style+" ":"")+(s.weight?s.weight+" ":"")+s.size+"px "+s.family}function cn(s,t,e,n,i){let r=t[i];return r||(r=t[i]=s.measureText(i).width,e.push(i)),r>n&&(n=r),n}function Xh(s,t,e,n){n=n||{};let i=n.data=n.data||{},r=n.garbageCollect=n.garbageCollect||[];n.font!==t&&(i=n.data={},r=n.garbageCollect=[],n.font=t),s.save(),s.font=t;let o=0;const a=e.length;let l,h,c,u,d;for(l=0;l<a;l++)if(u=e[l],u!=null&&$(u)!==!0)o=cn(s,i,r,o,u);else if($(u))for(h=0,c=u.length;h<c;h++)d=u[h],d!=null&&!$(d)&&(o=cn(s,i,r,o,d));s.restore();const f=r.length/2;if(f>e.length){for(l=0;l<f;l++)delete i[r[l]];r.splice(0,f)}return o}function re(s,t,e){const n=s.currentDevicePixelRatio,i=e!==0?Math.max(e/2,.5):0;return Math.round((t-i)*n)/n+i}function or(s,t){t=t||s.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,s.width,s.height),t.restore()}function ni(s,t,e,n){ia(s,t,e,n,null)}function ia(s,t,e,n,i){let r,o,a,l,h,c,u,d;const f=t.pointStyle,m=t.rotation,g=t.radius;let p=(m||0)*Ph;if(f&&typeof f=="object"&&(r=f.toString(),r==="[object HTMLImageElement]"||r==="[object HTMLCanvasElement]")){s.save(),s.translate(e,n),s.rotate(p),s.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),s.restore();return}if(!(isNaN(g)||g<=0)){switch(s.beginPath(),f){default:i?s.ellipse(e,n,i/2,g,0,0,B):s.arc(e,n,g,0,B),s.closePath();break;case"triangle":c=i?i/2:g,s.moveTo(e+Math.sin(p)*c,n-Math.cos(p)*g),p+=Qi,s.lineTo(e+Math.sin(p)*c,n-Math.cos(p)*g),p+=Qi,s.lineTo(e+Math.sin(p)*c,n-Math.cos(p)*g),s.closePath();break;case"rectRounded":h=g*.516,l=g-h,o=Math.cos(p+ie)*l,u=Math.cos(p+ie)*(i?i/2-h:l),a=Math.sin(p+ie)*l,d=Math.sin(p+ie)*(i?i/2-h:l),s.arc(e-u,n-a,h,p-q,p-Y),s.arc(e+d,n-o,h,p-Y,p),s.arc(e+u,n+a,h,p,p+Y),s.arc(e-d,n+o,h,p+Y,p+q),s.closePath();break;case"rect":if(!m){l=Math.SQRT1_2*g,c=i?i/2:l,s.rect(e-c,n-l,2*c,2*l);break}p+=ie;case"rectRot":u=Math.cos(p)*(i?i/2:g),o=Math.cos(p)*g,a=Math.sin(p)*g,d=Math.sin(p)*(i?i/2:g),s.moveTo(e-u,n-a),s.lineTo(e+d,n-o),s.lineTo(e+u,n+a),s.lineTo(e-d,n+o),s.closePath();break;case"crossRot":p+=ie;case"cross":u=Math.cos(p)*(i?i/2:g),o=Math.cos(p)*g,a=Math.sin(p)*g,d=Math.sin(p)*(i?i/2:g),s.moveTo(e-u,n-a),s.lineTo(e+u,n+a),s.moveTo(e+d,n-o),s.lineTo(e-d,n+o);break;case"star":u=Math.cos(p)*(i?i/2:g),o=Math.cos(p)*g,a=Math.sin(p)*g,d=Math.sin(p)*(i?i/2:g),s.moveTo(e-u,n-a),s.lineTo(e+u,n+a),s.moveTo(e+d,n-o),s.lineTo(e-d,n+o),p+=ie,u=Math.cos(p)*(i?i/2:g),o=Math.cos(p)*g,a=Math.sin(p)*g,d=Math.sin(p)*(i?i/2:g),s.moveTo(e-u,n-a),s.lineTo(e+u,n+a),s.moveTo(e+d,n-o),s.lineTo(e-d,n+o);break;case"line":o=i?i/2:Math.cos(p)*g,a=Math.sin(p)*g,s.moveTo(e-o,n-a),s.lineTo(e+o,n+a);break;case"dash":s.moveTo(e,n),s.lineTo(e+Math.cos(p)*(i?i/2:g),n+Math.sin(p)*g);break;case!1:s.closePath();break}s.fill(),t.borderWidth>0&&s.stroke()}}function vs(s,t,e){return e=e||.5,!t||s&&s.x>t.left-e&&s.x<t.right+e&&s.y>t.top-e&&s.y<t.bottom+e}function wn(s,t){s.save(),s.beginPath(),s.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),s.clip()}function Mn(s){s.restore()}function Kh(s,t,e,n,i){if(!t)return s.lineTo(e.x,e.y);if(i==="middle"){const r=(t.x+e.x)/2;s.lineTo(r,t.y),s.lineTo(r,e.y)}else i==="after"!=!!n?s.lineTo(t.x,e.y):s.lineTo(e.x,t.y);s.lineTo(e.x,e.y)}function Qh(s,t,e,n){if(!t)return s.lineTo(e.x,e.y);s.bezierCurveTo(n?t.cp1x:t.cp2x,n?t.cp1y:t.cp2y,n?e.cp2x:e.cp1x,n?e.cp2y:e.cp1y,e.x,e.y)}function _e(s,t,e,n,i,r={}){const o=$(t)?t:[t],a=r.strokeWidth>0&&r.strokeColor!=="";let l,h;for(s.save(),s.font=i.string,tc(s,r),l=0;l<o.length;++l)h=o[l],r.backdrop&&sc(s,r.backdrop),a&&(r.strokeColor&&(s.strokeStyle=r.strokeColor),N(r.strokeWidth)||(s.lineWidth=r.strokeWidth),s.strokeText(h,e,n,r.maxWidth)),s.fillText(h,e,n,r.maxWidth),ec(s,e,n,h,r),n+=i.lineHeight;s.restore()}function tc(s,t){t.translation&&s.translate(t.translation[0],t.translation[1]),N(t.rotation)||s.rotate(t.rotation),t.color&&(s.fillStyle=t.color),t.textAlign&&(s.textAlign=t.textAlign),t.textBaseline&&(s.textBaseline=t.textBaseline)}function ec(s,t,e,n,i){if(i.strikethrough||i.underline){const r=s.measureText(n),o=t-r.actualBoundingBoxLeft,a=t+r.actualBoundingBoxRight,l=e-r.actualBoundingBoxAscent,h=e+r.actualBoundingBoxDescent,c=i.strikethrough?(l+h)/2:h;s.strokeStyle=s.fillStyle,s.beginPath(),s.lineWidth=i.decorationWidth||2,s.moveTo(o,c),s.lineTo(a,c),s.stroke()}}function sc(s,t){const e=s.fillStyle;s.fillStyle=t.color,s.fillRect(t.left,t.top,t.width,t.height),s.fillStyle=e}function _s(s,t){const{x:e,y:n,w:i,h:r,radius:o}=t;s.arc(e+o.topLeft,n+o.topLeft,o.topLeft,-Y,q,!0),s.lineTo(e,n+r-o.bottomLeft),s.arc(e+o.bottomLeft,n+r-o.bottomLeft,o.bottomLeft,q,Y,!0),s.lineTo(e+i-o.bottomRight,n+r),s.arc(e+i-o.bottomRight,n+r-o.bottomRight,o.bottomRight,Y,0,!0),s.lineTo(e+i,n+o.topRight),s.arc(e+i-o.topRight,n+o.topRight,o.topRight,0,-Y,!0),s.lineTo(e+o.topLeft,n)}const nc=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,ic=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function rc(s,t){const e=(""+s).match(nc);if(!e||e[1]==="normal")return t*1.2;switch(s=+e[2],e[3]){case"px":return s;case"%":s/=100;break}return t*s}const oc=s=>+s||0;function Oi(s,t){const e={},n=P(t),i=n?Object.keys(t):t,r=P(s)?n?o=>E(s[o],s[t[o]]):o=>s[o]:()=>s;for(const o of i)e[o]=oc(r(o));return e}function ra(s){return Oi(s,{top:"y",right:"x",bottom:"y",left:"x"})}function fe(s){return Oi(s,["topLeft","topRight","bottomLeft","bottomRight"])}function nt(s){const t=ra(s);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function K(s,t){s=s||{},t=t||G.font;let e=E(s.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let n=E(s.style,t.style);n&&!(""+n).match(ic)&&(console.warn('Invalid font style specified: "'+n+'"'),n=void 0);const i={family:E(s.family,t.family),lineHeight:rc(E(s.lineHeight,t.lineHeight),e),size:e,style:n,weight:E(s.weight,t.weight),string:""};return i.string=Jh(i),i}function ls(s,t,e,n){let i=!0,r,o,a;for(r=0,o=s.length;r<o;++r)if(a=s[r],a!==void 0&&(t!==void 0&&typeof a=="function"&&(a=a(t),i=!1),e!==void 0&&$(a)&&(a=a[e%a.length],i=!1),a!==void 0))return n&&!i&&(n.cacheable=!1),a}function ac(s,t,e){const{min:n,max:i}=s,r=Uo(t,(i-n)/2),o=(a,l)=>e&&a===0?0:a+l;return{min:o(n,-Math.abs(r)),max:o(i,r)}}function ne(s,t){return Object.assign(Object.create(s),t)}function Ei(s,t=[""],e=s,n,i=()=>s[0]){Mt(n)||(n=ha("_fallback",s));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:s,_rootScopes:e,_fallback:n,_getTarget:i,override:o=>Ei([o,...s],t,e,n)};return new Proxy(r,{deleteProperty(o,a){return delete o[a],delete o._keys,delete s[0][a],!0},get(o,a){return aa(o,a,()=>gc(a,t,s,o))},getOwnPropertyDescriptor(o,a){return Reflect.getOwnPropertyDescriptor(o._scopes[0],a)},getPrototypeOf(){return Reflect.getPrototypeOf(s[0])},has(o,a){return lr(o).includes(a)},ownKeys(o){return lr(o)},set(o,a,l){const h=o._storage||(o._storage=i());return o[a]=h[a]=l,delete o._keys,!0}})}function Fe(s,t,e,n){const i={_cacheable:!1,_proxy:s,_context:t,_subProxy:e,_stack:new Set,_descriptors:oa(s,n),setContext:r=>Fe(s,r,e,n),override:r=>Fe(s.override(r),t,e,n)};return new Proxy(i,{deleteProperty(r,o){return delete r[o],delete s[o],!0},get(r,o,a){return aa(r,o,()=>hc(r,o,a))},getOwnPropertyDescriptor(r,o){return r._descriptors.allKeys?Reflect.has(s,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(s,o)},getPrototypeOf(){return Reflect.getPrototypeOf(s)},has(r,o){return Reflect.has(s,o)},ownKeys(){return Reflect.ownKeys(s)},set(r,o,a){return s[o]=a,delete r[o],!0}})}function oa(s,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:n=t.indexable,_allKeys:i=t.allKeys}=s;return{allKeys:i,scriptable:e,indexable:n,isScriptable:se(e)?e:()=>e,isIndexable:se(n)?n:()=>n}}const lc=(s,t)=>s?s+ki(t):t,Ci=(s,t)=>P(t)&&s!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function aa(s,t,e){if(Object.prototype.hasOwnProperty.call(s,t))return s[t];const n=e();return s[t]=n,n}function hc(s,t,e){const{_proxy:n,_context:i,_subProxy:r,_descriptors:o}=s;let a=n[t];return se(a)&&o.isScriptable(t)&&(a=cc(t,a,s,e)),$(a)&&a.length&&(a=uc(t,a,s,o.isIndexable)),Ci(t,a)&&(a=Fe(a,i,r&&r[t],o)),a}function cc(s,t,e,n){const{_proxy:i,_context:r,_subProxy:o,_stack:a}=e;if(a.has(s))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+s);return a.add(s),t=t(r,o||n),a.delete(s),Ci(s,t)&&(t=Ai(i._scopes,i,s,t)),t}function uc(s,t,e,n){const{_proxy:i,_context:r,_subProxy:o,_descriptors:a}=e;if(Mt(r.index)&&n(s))t=t[r.index%t.length];else if(P(t[0])){const l=t,h=i._scopes.filter(c=>c!==l);t=[];for(const c of l){const u=Ai(h,i,s,c);t.push(Fe(u,r,o&&o[s],a))}}return t}function la(s,t,e){return se(s)?s(t,e):s}const dc=(s,t)=>s===!0?t:typeof s=="string"?ee(t,s):void 0;function fc(s,t,e,n,i){for(const r of t){const o=dc(e,r);if(o){s.add(o);const a=la(o._fallback,e,i);if(Mt(a)&&a!==e&&a!==n)return a}else if(o===!1&&Mt(n)&&e!==n)return null}return!1}function Ai(s,t,e,n){const i=t._rootScopes,r=la(t._fallback,e,n),o=[...s,...i],a=new Set;a.add(n);let l=ar(a,o,e,r||e,n);return l===null||Mt(r)&&r!==e&&(l=ar(a,o,r,l,n),l===null)?!1:Ei(Array.from(a),[""],i,r,()=>mc(t,e,n))}function ar(s,t,e,n,i){for(;e;)e=fc(s,t,e,n,i);return e}function mc(s,t,e){const n=s._getTarget();t in n||(n[t]={});const i=n[t];return $(i)&&P(e)?e:i||{}}function gc(s,t,e,n){let i;for(const r of t)if(i=ha(lc(r,s),e),Mt(i))return Ci(s,i)?Ai(e,n,s,i):i}function ha(s,t){for(const e of t){if(!e)continue;const n=e[s];if(Mt(n))return n}}function lr(s){let t=s._keys;return t||(t=s._keys=pc(s._scopes)),t}function pc(s){const t=new Set;for(const e of s)for(const n of Object.keys(e).filter(i=>!i.startsWith("_")))t.add(n);return Array.from(t)}function ca(s,t,e,n){const{iScale:i}=s,{key:r="r"}=this._parsing,o=new Array(n);let a,l,h,c;for(a=0,l=n;a<l;++a)h=a+e,c=t[h],o[a]={r:i.parse(ee(c,r),h)};return o}const yc=Number.EPSILON||1e-14,Ve=(s,t)=>t<s.length&&!s[t].skip&&s[t],ua=s=>s==="x"?"y":"x";function bc(s,t,e,n){const i=s.skip?t:s,r=t,o=e.skip?t:e,a=ei(r,i),l=ei(o,r);let h=a/(a+l),c=l/(a+l);h=isNaN(h)?0:h,c=isNaN(c)?0:c;const u=n*h,d=n*c;return{previous:{x:r.x-u*(o.x-i.x),y:r.y-u*(o.y-i.y)},next:{x:r.x+d*(o.x-i.x),y:r.y+d*(o.y-i.y)}}}function xc(s,t,e){const n=s.length;let i,r,o,a,l,h=Ve(s,0);for(let c=0;c<n-1;++c)if(l=h,h=Ve(s,c+1),!(!l||!h)){if(ds(t[c],0,yc)){e[c]=e[c+1]=0;continue}i=e[c]/t[c],r=e[c+1]/t[c],a=Math.pow(i,2)+Math.pow(r,2),!(a<=9)&&(o=3/Math.sqrt(a),e[c]=i*o*t[c],e[c+1]=r*o*t[c])}}function vc(s,t,e="x"){const n=ua(e),i=s.length;let r,o,a,l=Ve(s,0);for(let h=0;h<i;++h){if(o=a,a=l,l=Ve(s,h+1),!a)continue;const c=a[e],u=a[n];o&&(r=(c-o[e])/3,a[`cp1${e}`]=c-r,a[`cp1${n}`]=u-r*t[h]),l&&(r=(l[e]-c)/3,a[`cp2${e}`]=c+r,a[`cp2${n}`]=u+r*t[h])}}function _c(s,t="x"){const e=ua(t),n=s.length,i=Array(n).fill(0),r=Array(n);let o,a,l,h=Ve(s,0);for(o=0;o<n;++o)if(a=l,l=h,h=Ve(s,o+1),!!l){if(h){const c=h[t]-l[t];i[o]=c!==0?(h[e]-l[e])/c:0}r[o]=a?h?Lt(i[o-1])!==Lt(i[o])?0:(i[o-1]+i[o])/2:i[o-1]:i[o]}xc(s,i,r),vc(s,r,t)}function Vs(s,t,e){return Math.max(Math.min(s,e),t)}function wc(s,t){let e,n,i,r,o,a=vs(s[0],t);for(e=0,n=s.length;e<n;++e)o=r,r=a,a=e<n-1&&vs(s[e+1],t),r&&(i=s[e],o&&(i.cp1x=Vs(i.cp1x,t.left,t.right),i.cp1y=Vs(i.cp1y,t.top,t.bottom)),a&&(i.cp2x=Vs(i.cp2x,t.left,t.right),i.cp2y=Vs(i.cp2y,t.top,t.bottom)))}function Mc(s,t,e,n,i){let r,o,a,l;if(t.spanGaps&&(s=s.filter(h=>!h.skip)),t.cubicInterpolationMode==="monotone")_c(s,i);else{let h=n?s[s.length-1]:s[0];for(r=0,o=s.length;r<o;++r)a=s[r],l=bc(h,a,s[Math.min(r+1,o-(n?0:1))%o],t.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,h=a}t.capBezierPoints&&wc(s,e)}function da(){return typeof window<"u"&&typeof document<"u"}function Pi(s){let t=s.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function un(s,t,e){let n;return typeof s=="string"?(n=parseInt(s,10),s.indexOf("%")!==-1&&(n=n/100*t.parentNode[e])):n=s,n}const kn=s=>s.ownerDocument.defaultView.getComputedStyle(s,null);function kc(s,t){return kn(s).getPropertyValue(t)}const Sc=["top","right","bottom","left"];function me(s,t,e){const n={};e=e?"-"+e:"";for(let i=0;i<4;i++){const r=Sc[i];n[r]=parseFloat(s[t+"-"+r+e])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}const Tc=(s,t,e)=>(s>0||t>0)&&(!e||!e.shadowRoot);function Dc(s,t){const e=s.touches,n=e&&e.length?e[0]:s,{offsetX:i,offsetY:r}=n;let o=!1,a,l;if(Tc(i,r,s.target))a=i,l=r;else{const h=t.getBoundingClientRect();a=n.clientX-h.left,l=n.clientY-h.top,o=!0}return{x:a,y:l,box:o}}function he(s,t){if("native"in s)return s;const{canvas:e,currentDevicePixelRatio:n}=t,i=kn(e),r=i.boxSizing==="border-box",o=me(i,"padding"),a=me(i,"border","width"),{x:l,y:h,box:c}=Dc(s,e),u=o.left+(c&&a.left),d=o.top+(c&&a.top);let{width:f,height:m}=t;return r&&(f-=o.width+a.width,m-=o.height+a.height),{x:Math.round((l-u)/f*e.width/n),y:Math.round((h-d)/m*e.height/n)}}function Oc(s,t,e){let n,i;if(t===void 0||e===void 0){const r=Pi(s);if(!r)t=s.clientWidth,e=s.clientHeight;else{const o=r.getBoundingClientRect(),a=kn(r),l=me(a,"border","width"),h=me(a,"padding");t=o.width-h.width-l.width,e=o.height-h.height-l.height,n=un(a.maxWidth,r,"clientWidth"),i=un(a.maxHeight,r,"clientHeight")}}return{width:t,height:e,maxWidth:n||ln,maxHeight:i||ln}}const zs=s=>Math.round(s*10)/10;function Ec(s,t,e,n){const i=kn(s),r=me(i,"margin"),o=un(i.maxWidth,s,"clientWidth")||ln,a=un(i.maxHeight,s,"clientHeight")||ln,l=Oc(s,t,e);let{width:h,height:c}=l;if(i.boxSizing==="content-box"){const u=me(i,"border","width"),d=me(i,"padding");h-=d.width+u.width,c-=d.height+u.height}return h=Math.max(0,h-r.width),c=Math.max(0,n?h/n:c-r.height),h=zs(Math.min(h,o,l.maxWidth)),c=zs(Math.min(c,a,l.maxHeight)),h&&!c&&(c=zs(h/2)),(t!==void 0||e!==void 0)&&n&&l.height&&c>l.height&&(c=l.height,h=zs(Math.floor(c*n))),{width:h,height:c}}function hr(s,t,e){const n=t||1,i=Math.floor(s.height*n),r=Math.floor(s.width*n);s.height=Math.floor(s.height),s.width=Math.floor(s.width);const o=s.canvas;return o.style&&(e||!o.style.height&&!o.style.width)&&(o.style.height=`${s.height}px`,o.style.width=`${s.width}px`),s.currentDevicePixelRatio!==n||o.height!==i||o.width!==r?(s.currentDevicePixelRatio=n,o.height=i,o.width=r,s.ctx.setTransform(n,0,0,n,0,0),!0):!1}const Cc=function(){let s=!1;try{const t={get passive(){return s=!0,!1}};window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch{}return s}();function cr(s,t){const e=kc(s,t),n=e&&e.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function ce(s,t,e,n){return{x:s.x+e*(t.x-s.x),y:s.y+e*(t.y-s.y)}}function Ac(s,t,e,n){return{x:s.x+e*(t.x-s.x),y:n==="middle"?e<.5?s.y:t.y:n==="after"?e<1?s.y:t.y:e>0?t.y:s.y}}function Pc(s,t,e,n){const i={x:s.cp2x,y:s.cp2y},r={x:t.cp1x,y:t.cp1y},o=ce(s,i,e),a=ce(i,r,e),l=ce(r,t,e),h=ce(o,a,e),c=ce(a,l,e);return ce(h,c,e)}const Ic=function(s,t){return{x(e){return s+s+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,n){return e-n},leftForLtr(e,n){return e-n}}},Lc=function(){return{x(s){return s},setWidth(s){},textAlign(s){return s},xPlus(s,t){return s+t},leftForLtr(s,t){return s}}};function Le(s,t,e){return s?Ic(t,e):Lc()}function fa(s,t){let e,n;(t==="ltr"||t==="rtl")&&(e=s.canvas.style,n=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),s.prevTextDirection=n)}function ma(s,t){t!==void 0&&(delete s.prevTextDirection,s.canvas.style.setProperty("direction",t[0],t[1]))}function ga(s){return s==="angle"?{between:xs,compare:Nh,normalize:gt}:{between:Wt,compare:(t,e)=>t-e,normalize:t=>t}}function ur({start:s,end:t,count:e,loop:n,style:i}){return{start:s%e,end:t%e,loop:n&&(t-s+1)%e===0,style:i}}function Nc(s,t,e){const{property:n,start:i,end:r}=e,{between:o,normalize:a}=ga(n),l=t.length;let{start:h,end:c,loop:u}=s,d,f;if(u){for(h+=l,c+=l,d=0,f=l;d<f&&o(a(t[h%l][n]),i,r);++d)h--,c--;h%=l,c%=l}return c<h&&(c+=l),{start:h,end:c,loop:u,style:s.style}}function pa(s,t,e){if(!e)return[s];const{property:n,start:i,end:r}=e,o=t.length,{compare:a,between:l,normalize:h}=ga(n),{start:c,end:u,loop:d,style:f}=Nc(s,t,e),m=[];let g=!1,p=null,y,x,_;const b=()=>l(i,_,y)&&a(i,_)!==0,v=()=>a(r,y)===0||l(r,_,y),M=()=>g||b(),S=()=>!g||v();for(let k=c,C=c;k<=u;++k)x=t[k%o],!x.skip&&(y=h(x[n]),y!==_&&(g=l(y,i,r),p===null&&M()&&(p=a(y,i)===0?k:C),p!==null&&S()&&(m.push(ur({start:p,end:k,loop:d,count:o,style:f})),p=null),C=k,_=y));return p!==null&&m.push(ur({start:p,end:u,loop:d,count:o,style:f})),m}function ya(s,t){const e=[],n=s.segments;for(let i=0;i<n.length;i++){const r=pa(n[i],s.points,t);r.length&&e.push(...r)}return e}function Rc(s,t,e,n){let i=0,r=t-1;if(e&&!n)for(;i<t&&!s[i].skip;)i++;for(;i<t&&s[i].skip;)i++;for(i%=t,e&&(r+=i);r>i&&s[r%t].skip;)r--;return r%=t,{start:i,end:r}}function Fc(s,t,e,n){const i=s.length,r=[];let o=t,a=s[t],l;for(l=t+1;l<=e;++l){const h=s[l%i];h.skip||h.stop?a.skip||(n=!1,r.push({start:t%i,end:(l-1)%i,loop:n}),t=o=h.stop?l:null):(o=l,a.skip&&(t=l)),a=h}return o!==null&&r.push({start:t%i,end:o%i,loop:n}),r}function Vc(s,t){const e=s.points,n=s.options.spanGaps,i=e.length;if(!i)return[];const r=!!s._loop,{start:o,end:a}=Rc(e,i,r,n);if(n===!0)return dr(s,[{start:o,end:a,loop:r}],e,t);const l=a<o?a+i:a,h=!!s._fullLoop&&o===0&&a===i-1;return dr(s,Fc(e,o,l,h),e,t)}function dr(s,t,e,n){return!n||!n.setContext||!e?t:zc(s,t,e,n)}function zc(s,t,e,n){const i=s._chart.getContext(),r=fr(s.options),{_datasetIndex:o,options:{spanGaps:a}}=s,l=e.length,h=[];let c=r,u=t[0].start,d=u;function f(m,g,p,y){const x=a?-1:1;if(m!==g){for(m+=l;e[m%l].skip;)m-=x;for(;e[g%l].skip;)g+=x;m%l!==g%l&&(h.push({start:m%l,end:g%l,loop:p,style:y}),c=y,u=g%l)}}for(const m of t){u=a?u:m.start;let g=e[u%l],p;for(d=u+1;d<=m.end;d++){const y=e[d%l];p=fr(n.setContext(ne(i,{type:"segment",p0:g,p1:y,p0DataIndex:(d-1)%l,p1DataIndex:d%l,datasetIndex:o}))),Wc(p,c)&&f(u,d-1,m.loop,c),g=y,c=p}u<d-1&&f(u,d-1,m.loop,c)}return h}function fr(s){return{backgroundColor:s.backgroundColor,borderCapStyle:s.borderCapStyle,borderDash:s.borderDash,borderDashOffset:s.borderDashOffset,borderJoinStyle:s.borderJoinStyle,borderWidth:s.borderWidth,borderColor:s.borderColor}}function Wc(s,t){return t&&JSON.stringify(s)!==JSON.stringify(t)}/*!
|
|
12
|
-
* Chart.js v4.2.1
|
|
13
|
-
* https://www.chartjs.org
|
|
14
|
-
* (c) 2023 Chart.js Contributors
|
|
15
|
-
* Released under the MIT License
|
|
16
|
-
*/class jc{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,n,i){const r=e.listeners[i],o=e.duration;r.forEach(a=>a({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(n-e.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=Ko.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((n,i)=>{if(!n.running||!n.items.length)return;const r=n.items;let o=r.length-1,a=!1,l;for(;o>=0;--o)l=r[o],l._active?(l._total>n.duration&&(n.duration=l._total),l.tick(t),a=!0):(r[o]=r[r.length-1],r.pop());a&&(i.draw(),this._notify(i,n,t,"progress")),r.length||(n.running=!1,this._notify(i,n,t,"complete"),n.initial=!1),e+=r.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let n=e.get(t);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,n)),n}listen(t,e,n){this._getAnims(t).listeners[e].push(n)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((n,i)=>Math.max(n,i._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const n=e.items;let i=n.length-1;for(;i>=0;--i)n[i].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Ft=new jc;const mr="transparent",$c={boolean(s,t,e){return e>.5?t:s},color(s,t,e){const n=hn(s||mr),i=n.valid&&hn(t||mr);return i&&i.valid?i.mix(n,e).hexString():t},number(s,t,e){return s+(t-s)*e}};class Bc{constructor(t,e,n,i){const r=e[n];i=ls([t.to,i,r,t.from]);const o=ls([t.from,r,i]);this._active=!0,this._fn=t.fn||$c[t.type||typeof o],this._easing=fs[t.easing]||fs.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=n,this._from=o,this._to=i,this._promises=void 0}active(){return this._active}update(t,e,n){if(this._active){this._notify(!1);const i=this._target[this._prop],r=n-this._start,o=this._duration-r;this._start=n,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=r,this._loop=!!t.loop,this._to=ls([t.to,e,i,t.from]),this._from=ls([t.from,i,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,n=this._duration,i=this._prop,r=this._from,o=this._loop,a=this._to;let l;if(this._active=r!==a&&(o||e<n),!this._active){this._target[i]=a,this._notify(!0);return}if(e<0){this._target[i]=r;return}l=e/n%2,l=o&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[i]=this._fn(r,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,n)=>{t.push({res:e,rej:n})})}_notify(t){const e=t?"res":"rej",n=this._promises||[];for(let i=0;i<n.length;i++)n[i][e]()}}class ba{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!P(t))return;const e=Object.keys(G.animation),n=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const r=t[i];if(!P(r))return;const o={};for(const a of e)o[a]=r[a];($(r.properties)&&r.properties||[i]).forEach(a=>{(a===i||!n.has(a))&&n.set(a,o)})})}_animateOptions(t,e){const n=e.options,i=qc(t,n);if(!i)return[];const r=this._createAnimations(i,n);return n.$shared&&Hc(t.options.$animations,n).then(()=>{t.options=n},()=>{}),r}_createAnimations(t,e){const n=this._properties,i=[],r=t.$animations||(t.$animations={}),o=Object.keys(e),a=Date.now();let l;for(l=o.length-1;l>=0;--l){const h=o[l];if(h.charAt(0)==="$")continue;if(h==="options"){i.push(...this._animateOptions(t,e));continue}const c=e[h];let u=r[h];const d=n.get(h);if(u)if(d&&u.active()){u.update(d,c,a);continue}else u.cancel();if(!d||!d.duration){t[h]=c;continue}r[h]=u=new Bc(d,t,h,c),i.push(u)}return i}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const n=this._createAnimations(t,e);if(n.length)return Ft.add(this._chart,n),!0}}function Hc(s,t){const e=[],n=Object.keys(t);for(let i=0;i<n.length;i++){const r=s[n[i]];r&&r.active()&&e.push(r.wait())}return Promise.all(e)}function qc(s,t){if(!t)return;let e=s.options;if(!e){s.options=t;return}return e.$shared&&(s.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function gr(s,t){const e=s&&s.options||{},n=e.reverse,i=e.min===void 0?t:0,r=e.max===void 0?t:0;return{start:n?r:i,end:n?i:r}}function Uc(s,t,e){if(e===!1)return!1;const n=gr(s,e),i=gr(t,e);return{top:i.end,right:n.end,bottom:i.start,left:n.start}}function Zc(s){let t,e,n,i;return P(s)?(t=s.top,e=s.right,n=s.bottom,i=s.left):t=e=n=i=s,{top:t,right:e,bottom:n,left:i,disabled:s===!1}}function xa(s,t){const e=[],n=s._getSortedDatasetMetas(t);let i,r;for(i=0,r=n.length;i<r;++i)e.push(n[i].index);return e}function pr(s,t,e,n={}){const i=s.keys,r=n.mode==="single";let o,a,l,h;if(t!==null){for(o=0,a=i.length;o<a;++o){if(l=+i[o],l===e){if(n.all)continue;break}h=s.values[l],Z(h)&&(r||t===0||Lt(t)===Lt(h))&&(t+=h)}return t}}function Yc(s){const t=Object.keys(s),e=new Array(t.length);let n,i,r;for(n=0,i=t.length;n<i;++n)r=t[n],e[n]={x:r,y:s[r]};return e}function yr(s,t){const e=s&&s.options.stacked;return e||e===void 0&&t.stack!==void 0}function Gc(s,t,e){return`${s.id}.${t.id}.${e.stack||e.type}`}function Jc(s){const{min:t,max:e,minDefined:n,maxDefined:i}=s.getUserBounds();return{min:n?t:Number.NEGATIVE_INFINITY,max:i?e:Number.POSITIVE_INFINITY}}function Xc(s,t,e){const n=s[t]||(s[t]={});return n[e]||(n[e]={})}function br(s,t,e,n){for(const i of t.getMatchingVisibleMetas(n).reverse()){const r=s[i.index];if(e&&r>0||!e&&r<0)return i.index}return null}function xr(s,t){const{chart:e,_cachedMeta:n}=s,i=e._stacks||(e._stacks={}),{iScale:r,vScale:o,index:a}=n,l=r.axis,h=o.axis,c=Gc(r,o,n),u=t.length;let d;for(let f=0;f<u;++f){const m=t[f],{[l]:g,[h]:p}=m,y=m._stacks||(m._stacks={});d=y[h]=Xc(i,c,g),d[a]=p,d._top=br(d,o,!0,n.type),d._bottom=br(d,o,!1,n.type);const x=d._visualValues||(d._visualValues={});x[a]=p}}function Vn(s,t){const e=s.scales;return Object.keys(e).filter(n=>e[n].axis===t).shift()}function Kc(s,t){return ne(s,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Qc(s,t,e){return ne(s,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function Qe(s,t){const e=s.controller.index,n=s.vScale&&s.vScale.axis;if(n){t=t||s._parsed;for(const i of t){const r=i._stacks;if(!r||r[n]===void 0||r[n][e]===void 0)return;delete r[n][e],r[n]._visualValues!==void 0&&r[n]._visualValues[e]!==void 0&&delete r[n]._visualValues[e]}}}const zn=s=>s==="reset"||s==="none",vr=(s,t)=>t?s:Object.assign({},s),tu=(s,t,e)=>s&&!t.hidden&&t._stacked&&{keys:xa(e,!0),values:null};class Ct{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=yr(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&&Qe(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,n=this.getDataset(),i=(u,d,f,m)=>u==="x"?d:u==="r"?m:f,r=e.xAxisID=E(n.xAxisID,Vn(t,"x")),o=e.yAxisID=E(n.yAxisID,Vn(t,"y")),a=e.rAxisID=E(n.rAxisID,Vn(t,"r")),l=e.indexAxis,h=e.iAxisID=i(l,r,o,a),c=e.vAxisID=i(l,o,r,a);e.xScale=this.getScaleForId(r),e.yScale=this.getScaleForId(o),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(h),e.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&sr(this._data,this),t._stacked&&Qe(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),n=this._data;if(P(e))this._data=Yc(e);else if(n!==e){if(n){sr(n,this);const i=this._cachedMeta;Qe(i),i._parsed=[]}e&&Object.isExtensible(e)&&zh(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,n=this.getDataset();let i=!1;this._dataCheck();const r=e._stacked;e._stacked=yr(e.vScale,e),e.stack!==n.stack&&(i=!0,Qe(e),e.stack=n.stack),this._resyncElements(t),(i||r!==e._stacked)&&xr(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),n=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:n,_data:i}=this,{iScale:r,_stacked:o}=n,a=r.axis;let l=t===0&&e===i.length?!0:n._sorted,h=t>0&&n._parsed[t-1],c,u,d;if(this._parsing===!1)n._parsed=i,n._sorted=!0,d=i;else{$(i[t])?d=this.parseArrayData(n,i,t,e):P(i[t])?d=this.parseObjectData(n,i,t,e):d=this.parsePrimitiveData(n,i,t,e);const f=()=>u[a]===null||h&&u[a]<h[a];for(c=0;c<e;++c)n._parsed[c+t]=u=d[c],l&&(f()&&(l=!1),h=u);n._sorted=l}o&&xr(this,d)}parsePrimitiveData(t,e,n,i){const{iScale:r,vScale:o}=t,a=r.axis,l=o.axis,h=r.getLabels(),c=r===o,u=new Array(i);let d,f,m;for(d=0,f=i;d<f;++d)m=d+n,u[d]={[a]:c||r.parse(h[m],m),[l]:o.parse(e[m],m)};return u}parseArrayData(t,e,n,i){const{xScale:r,yScale:o}=t,a=new Array(i);let l,h,c,u;for(l=0,h=i;l<h;++l)c=l+n,u=e[c],a[l]={x:r.parse(u[0],c),y:o.parse(u[1],c)};return a}parseObjectData(t,e,n,i){const{xScale:r,yScale:o}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,h=new Array(i);let c,u,d,f;for(c=0,u=i;c<u;++c)d=c+n,f=e[d],h[c]={x:r.parse(ee(f,a),d),y:o.parse(ee(f,l),d)};return h}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,n){const i=this.chart,r=this._cachedMeta,o=e[t.axis],a={keys:xa(i,!0),values:e._stacks[t.axis]._visualValues};return pr(a,o,r.index,{mode:n})}updateRangeFromParsed(t,e,n,i){const r=n[e.axis];let o=r===null?NaN:r;const a=i&&n._stacks[e.axis];i&&a&&(i.values=a,o=pr(i,r,this._cachedMeta.index)),t.min=Math.min(t.min,o),t.max=Math.max(t.max,o)}getMinMax(t,e){const n=this._cachedMeta,i=n._parsed,r=n._sorted&&t===n.iScale,o=i.length,a=this._getOtherScale(t),l=tu(e,n,this.chart),h={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:u}=Jc(a);let d,f;function m(){f=i[d];const g=f[a.axis];return!Z(f[t.axis])||c>g||u<g}for(d=0;d<o&&!(!m()&&(this.updateRangeFromParsed(h,t,f,l),r));++d);if(r){for(d=o-1;d>=0;--d)if(!m()){this.updateRangeFromParsed(h,t,f,l);break}}return h}getAllParsedValues(t){const e=this._cachedMeta._parsed,n=[];let i,r,o;for(i=0,r=e.length;i<r;++i)o=e[i][t.axis],Z(o)&&n.push(o);return n}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,n=e.iScale,i=e.vScale,r=this.getParsed(t);return{label:n?""+n.getLabelForValue(r[n.axis]):"",value:i?""+i.getLabelForValue(r[i.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=Zc(E(this.options.clip,Uc(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,n=this._cachedMeta,i=n.data||[],r=e.chartArea,o=[],a=this._drawStart||0,l=this._drawCount||i.length-a,h=this.options.drawActiveElementsOnTop;let c;for(n.dataset&&n.dataset.draw(t,r,a,l),c=a;c<a+l;++c){const u=i[c];u.hidden||(u.active&&h?o.push(u):u.draw(t,r))}for(c=0;c<o.length;++c)o[c].draw(t,r)}getStyle(t,e){const n=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(n):this.resolveDataElementOptions(t||0,n)}getContext(t,e,n){const i=this.getDataset();let r;if(t>=0&&t<this._cachedMeta.data.length){const o=this._cachedMeta.data[t];r=o.$context||(o.$context=Qc(this.getContext(),t,o)),r.parsed=this.getParsed(t),r.raw=i.data[t],r.index=r.dataIndex=t}else r=this.$context||(this.$context=Kc(this.chart.getContext(),this.index)),r.dataset=i,r.index=r.datasetIndex=this.index;return r.active=!!e,r.mode=n,r}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",n){const i=e==="active",r=this._cachedDataOpts,o=t+"-"+e,a=r[o],l=this.enableOptionSharing&&Mt(n);if(a)return vr(a,l);const h=this.chart.config,c=h.datasetElementScopeKeys(this._type,t),u=i?[`${t}Hover`,"hover",t,""]:[t,""],d=h.getOptionScopes(this.getDataset(),c),f=Object.keys(G.elements[t]),m=()=>this.getContext(n,i,e),g=h.resolveNamedOptions(d,f,m,u);return g.$shared&&(g.$shared=l,r[o]=Object.freeze(vr(g,l))),g}_resolveAnimations(t,e,n){const i=this.chart,r=this._cachedDataOpts,o=`animation-${e}`,a=r[o];if(a)return a;let l;if(i.options.animation!==!1){const c=this.chart.config,u=c.datasetAnimationScopeKeys(this._type,e),d=c.getOptionScopes(this.getDataset(),u);l=c.createResolver(d,this.getContext(t,n,e))}const h=new ba(i,l&&l.animations);return l&&l._cacheable&&(r[o]=Object.freeze(h)),h}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||zn(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const n=this.resolveDataElementOptions(t,e),i=this._sharedOptions,r=this.getSharedOptions(n),o=this.includeOptions(e,r)||r!==i;return this.updateSharedOptions(r,e,n),{sharedOptions:r,includeOptions:o}}updateElement(t,e,n,i){zn(i)?Object.assign(t,n):this._resolveAnimations(e,i).update(t,n)}updateSharedOptions(t,e,n){t&&!zn(e)&&this._resolveAnimations(void 0,e).update(t,n)}_setStyle(t,e,n,i){t.active=i;const r=this.getStyle(e,i);this._resolveAnimations(e,n,i).update(t,{options:!i&&this.getSharedOptions(r)||r})}removeHoverStyle(t,e,n){this._setStyle(t,n,"active",!1)}setHoverStyle(t,e,n){this._setStyle(t,n,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,n=this._cachedMeta.data;for(const[a,l,h]of this._syncList)this[a](l,h);this._syncList=[];const i=n.length,r=e.length,o=Math.min(r,i);o&&this.parse(0,o),r>i?this._insertElements(i,r-i,t):r<i&&this._removeElements(r,i-r)}_insertElements(t,e,n=!0){const i=this._cachedMeta,r=i.data,o=t+e;let a;const l=h=>{for(h.length+=e,a=h.length-1;a>=o;a--)h[a]=h[a-e]};for(l(r),a=t;a<o;++a)r[a]=new this.dataElementType;this._parsing&&l(i._parsed),this.parse(t,e),n&&this.updateElements(r,t,e,"reset")}updateElements(t,e,n,i){}_removeElements(t,e){const n=this._cachedMeta;if(this._parsing){const i=n._parsed.splice(t,e);n._stacked&&Qe(n,i)}n.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,n,i]=t;this[e](n,i)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const n=arguments.length-2;n&&this._sync(["_insertElements",t,n])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}w(Ct,"defaults",{}),w(Ct,"datasetElementType",null),w(Ct,"dataElementType",null);function eu(s,t){if(!s._cache.$bar){const e=s.getMatchingVisibleMetas(t);let n=[];for(let i=0,r=e.length;i<r;i++)n=n.concat(e[i].controller.getAllParsedValues(s));s._cache.$bar=Xo(n.sort((i,r)=>i-r))}return s._cache.$bar}function su(s){const t=s.iScale,e=eu(t,s.type);let n=t._length,i,r,o,a;const l=()=>{o===32767||o===-32768||(Mt(a)&&(n=Math.min(n,Math.abs(o-a)||n)),a=o)};for(i=0,r=e.length;i<r;++i)o=t.getPixelForValue(e[i]),l();for(a=void 0,i=0,r=t.ticks.length;i<r;++i)o=t.getPixelForTick(i),l();return n}function nu(s,t,e,n){const i=e.barThickness;let r,o;return N(i)?(r=t.min*e.categoryPercentage,o=e.barPercentage):(r=i*n,o=1),{chunk:r/n,ratio:o,start:t.pixels[s]-r/2}}function iu(s,t,e,n){const i=t.pixels,r=i[s];let o=s>0?i[s-1]:null,a=s<i.length-1?i[s+1]:null;const l=e.categoryPercentage;o===null&&(o=r-(a===null?t.end-t.start:a-r)),a===null&&(a=r+r-o);const h=r-(r-Math.min(o,a))/2*l;return{chunk:Math.abs(a-o)/2*l/n,ratio:e.barPercentage,start:h}}function ru(s,t,e,n){const i=e.parse(s[0],n),r=e.parse(s[1],n),o=Math.min(i,r),a=Math.max(i,r);let l=o,h=a;Math.abs(o)>Math.abs(a)&&(l=a,h=o),t[e.axis]=h,t._custom={barStart:l,barEnd:h,start:i,end:r,min:o,max:a}}function va(s,t,e,n){return $(s)?ru(s,t,e,n):t[e.axis]=e.parse(s,n),t}function _r(s,t,e,n){const i=s.iScale,r=s.vScale,o=i.getLabels(),a=i===r,l=[];let h,c,u,d;for(h=e,c=e+n;h<c;++h)d=t[h],u={},u[i.axis]=a||i.parse(o[h],h),l.push(va(d,u,r,h));return l}function Wn(s){return s&&s.barStart!==void 0&&s.barEnd!==void 0}function ou(s,t,e){return s!==0?Lt(s):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function au(s){let t,e,n,i,r;return s.horizontal?(t=s.base>s.x,e="left",n="right"):(t=s.base<s.y,e="bottom",n="top"),t?(i="end",r="start"):(i="start",r="end"),{start:e,end:n,reverse:t,top:i,bottom:r}}function lu(s,t,e,n){let i=t.borderSkipped;const r={};if(!i){s.borderSkipped=r;return}if(i===!0){s.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:o,end:a,reverse:l,top:h,bottom:c}=au(s);i==="middle"&&e&&(s.enableBorderRadius=!0,(e._top||0)===n?i=h:(e._bottom||0)===n?i=c:(r[wr(c,o,a,l)]=!0,i=h)),r[wr(i,o,a,l)]=!0,s.borderSkipped=r}function wr(s,t,e,n){return n?(s=hu(s,t,e),s=Mr(s,e,t)):s=Mr(s,t,e),s}function hu(s,t,e){return s===t?e:s===e?t:s}function Mr(s,t,e){return s==="start"?t:s==="end"?e:s}function cu(s,{inflateAmount:t},e){s.inflateAmount=t==="auto"?e===1?.33:0:t}class te extends Ct{parsePrimitiveData(t,e,n,i){return _r(t,e,n,i)}parseArrayData(t,e,n,i){return _r(t,e,n,i)}parseObjectData(t,e,n,i){const{iScale:r,vScale:o}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,h=r.axis==="x"?a:l,c=o.axis==="x"?a:l,u=[];let d,f,m,g;for(d=n,f=n+i;d<f;++d)g=e[d],m={},m[r.axis]=r.parse(ee(g,h),d),u.push(va(ee(g,c),m,o,d));return u}updateRangeFromParsed(t,e,n,i){super.updateRangeFromParsed(t,e,n,i);const r=n._custom;r&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,r.min),t.max=Math.max(t.max,r.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:n,vScale:i}=e,r=this.getParsed(t),o=r._custom,a=Wn(o)?"["+o.start+", "+o.end+"]":""+i.getLabelForValue(r[i.axis]);return{label:""+n.getLabelForValue(r[n.axis]),value:a}}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,n,i){const r=i==="reset",{index:o,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),h=a.isHorizontal(),c=this._getRuler(),{sharedOptions:u,includeOptions:d}=this._getSharedOptions(e,i);for(let f=e;f<e+n;f++){const m=this.getParsed(f),g=r||N(m[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(f),p=this._calculateBarIndexPixels(f,c),y=(m._stacks||{})[a.axis],x={horizontal:h,base:g.base,enableBorderRadius:!y||Wn(m._custom)||o===y._top||o===y._bottom,x:h?g.head:p.center,y:h?p.center:g.head,height:h?p.size:Math.abs(g.size),width:h?Math.abs(g.size):p.size};d&&(x.options=u||this.resolveDataElementOptions(f,t[f].active?"active":i));const _=x.options||t[f].options;lu(x,_,y,o),cu(x,_,c.ratio),this.updateElement(t[f],f,x,i)}}_getStacks(t,e){const{iScale:n}=this._cachedMeta,i=n.getMatchingVisibleMetas(this._type).filter(l=>l.controller.options.grouped),r=n.options.stacked,o=[],a=l=>{const h=l.controller.getParsed(e),c=h&&h[l.vScale.axis];if(N(c)||isNaN(c))return!0};for(const l of i)if(!(e!==void 0&&a(l))&&((r===!1||o.indexOf(l.stack)===-1||r===void 0&&l.stack===void 0)&&o.push(l.stack),l.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,n){const i=this._getStacks(t,n),r=e!==void 0?i.indexOf(e):-1;return r===-1?i.length-1:r}_getRuler(){const t=this.options,e=this._cachedMeta,n=e.iScale,i=[];let r,o;for(r=0,o=e.data.length;r<o;++r)i.push(n.getPixelForValue(this.getParsed(r)[n.axis],r));const a=t.barThickness;return{min:a||su(e),pixels:i,start:n._startPixel,end:n._endPixel,stackCount:this._getStackCount(),scale:n,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:n,index:i},options:{base:r,minBarLength:o}}=this,a=r||0,l=this.getParsed(t),h=l._custom,c=Wn(h);let u=l[e.axis],d=0,f=n?this.applyStack(e,l,n):u,m,g;f!==u&&(d=f-u,f=u),c&&(u=h.barStart,f=h.barEnd-h.barStart,u!==0&&Lt(u)!==Lt(h.barEnd)&&(d=0),d+=u);const p=!N(r)&&!c?r:d;let y=e.getPixelForValue(p);if(this.chart.getDataVisibility(t)?m=e.getPixelForValue(d+f):m=y,g=m-y,Math.abs(g)<o){g=ou(g,e,a)*o,u===a&&(y-=g/2);const x=e.getPixelForDecimal(0),_=e.getPixelForDecimal(1),b=Math.min(x,_),v=Math.max(x,_);y=Math.max(Math.min(y,v),b),m=y+g,n&&!c&&(l._stacks[e.axis]._visualValues[i]=e.getValueForPixel(m)-e.getValueForPixel(y))}if(y===e.getPixelForValue(a)){const x=Lt(g)*e.getLineWidthForValue(a)/2;y+=x,g-=x}return{size:g,base:y,head:m,center:m+g/2}}_calculateBarIndexPixels(t,e){const n=e.scale,i=this.options,r=i.skipNull,o=E(i.maxBarThickness,1/0);let a,l;if(e.grouped){const h=r?this._getStackCount(t):e.stackCount,c=i.barThickness==="flex"?iu(t,e,i,h):nu(t,e,i,h),u=this._getStackIndex(this.index,this._cachedMeta.stack,r?t:void 0);a=c.start+c.chunk*u+c.chunk/2,l=Math.min(o,c.chunk*c.ratio)}else a=n.getPixelForValue(this.getParsed(t)[n.axis],t),l=Math.min(o,e.min*e.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){const t=this._cachedMeta,e=t.vScale,n=t.data,i=n.length;let r=0;for(;r<i;++r)this.getParsed(r)[e.axis]!==null&&n[r].draw(this._ctx)}}w(te,"id","bar"),w(te,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),w(te,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class Qs extends Ct{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,n,i){const r=super.parsePrimitiveData(t,e,n,i);for(let o=0;o<r.length;o++)r[o]._custom=this.resolveDataElementOptions(o+n).radius;return r}parseArrayData(t,e,n,i){const r=super.parseArrayData(t,e,n,i);for(let o=0;o<r.length;o++){const a=e[n+o];r[o]._custom=E(a[2],this.resolveDataElementOptions(o+n).radius)}return r}parseObjectData(t,e,n,i){const r=super.parseObjectData(t,e,n,i);for(let o=0;o<r.length;o++){const a=e[n+o];r[o]._custom=E(a&&a.r&&+a.r,this.resolveDataElementOptions(o+n).radius)}return r}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let n=t.length-1;n>=0;--n)e=Math.max(e,t[n].size(this.resolveDataElementOptions(n))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart.data.labels||[],{xScale:i,yScale:r}=e,o=this.getParsed(t),a=i.getLabelForValue(o.x),l=r.getLabelForValue(o.y),h=o._custom;return{label:n[t]||"",value:"("+a+", "+l+(h?", "+h:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,n,i){const r=i==="reset",{iScale:o,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:h}=this._getSharedOptions(e,i),c=o.axis,u=a.axis;for(let d=e;d<e+n;d++){const f=t[d],m=!r&&this.getParsed(d),g={},p=g[c]=r?o.getPixelForDecimal(.5):o.getPixelForValue(m[c]),y=g[u]=r?a.getBasePixel():a.getPixelForValue(m[u]);g.skip=isNaN(p)||isNaN(y),h&&(g.options=l||this.resolveDataElementOptions(d,f.active?"active":i),r&&(g.options.radius=0)),this.updateElement(f,d,g,i)}}resolveDataElementOptions(t,e){const n=this.getParsed(t);let i=super.resolveDataElementOptions(t,e);i.$shared&&(i=Object.assign({},i,{$shared:!1}));const r=i.radius;return e!=="active"&&(i.radius=0),i.radius+=E(n&&n._custom,r),i}}w(Qs,"id","bubble"),w(Qs,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),w(Qs,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function uu(s,t,e){let n=1,i=1,r=0,o=0;if(t<B){const a=s,l=a+t,h=Math.cos(a),c=Math.sin(a),u=Math.cos(l),d=Math.sin(l),f=(_,b,v)=>xs(_,a,l,!0)?1:Math.max(b,b*e,v,v*e),m=(_,b,v)=>xs(_,a,l,!0)?-1:Math.min(b,b*e,v,v*e),g=f(0,h,u),p=f(Y,c,d),y=m(q,h,u),x=m(q+Y,c,d);n=(g-y)/2,i=(p-x)/2,r=-(g+y)/2,o=-(p+x)/2}return{ratioX:n,ratioY:i,offsetX:r,offsetY:o}}class de extends Ct{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const n=this.getDataset().data,i=this._cachedMeta;if(this._parsing===!1)i._parsed=n;else{let r=l=>+n[l];if(P(n[t])){const{key:l="value"}=this._parsing;r=h=>+ee(n[h],l)}let o,a;for(o=t,a=t+e;o<a;++o)i._parsed[o]=r(o)}}_getRotation(){return Ot(this.options.rotation-90)}_getCircumference(){return Ot(this.options.circumference)}_getRotationExtents(){let t=B,e=-B;for(let n=0;n<this.chart.data.datasets.length;++n)if(this.chart.isDatasetVisible(n)&&this.chart.getDatasetMeta(n).type===this._type){const i=this.chart.getDatasetMeta(n).controller,r=i._getRotation(),o=i._getCircumference();t=Math.min(t,r),e=Math.max(e,r+o)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:n}=e,i=this._cachedMeta,r=i.data,o=this.getMaxBorderWidth()+this.getMaxOffset(r)+this.options.spacing,a=Math.max((Math.min(n.width,n.height)-o)/2,0),l=Math.min(Sh(this.options.cutout,a),1),h=this._getRingWeight(this.index),{circumference:c,rotation:u}=this._getRotationExtents(),{ratioX:d,ratioY:f,offsetX:m,offsetY:g}=uu(u,c,l),p=(n.width-o)/d,y=(n.height-o)/f,x=Math.max(Math.min(p,y)/2,0),_=Uo(this.options.radius,x),b=Math.max(_*l,0),v=(_-b)/this._getVisibleDatasetWeightTotal();this.offsetX=m*_,this.offsetY=g*_,i.total=this.calculateTotal(),this.outerRadius=_-v*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-v*h,0),this.updateElements(r,0,r.length,t)}_circumference(t,e){const n=this.options,i=this._cachedMeta,r=this._getCircumference();return e&&n.animation.animateRotate||!this.chart.getDataVisibility(t)||i._parsed[t]===null||i.data[t].hidden?0:this.calculateCircumference(i._parsed[t]*r/B)}updateElements(t,e,n,i){const r=i==="reset",o=this.chart,a=o.chartArea,l=o.options.animation,h=(a.left+a.right)/2,c=(a.top+a.bottom)/2,u=r&&l.animateScale,d=u?0:this.innerRadius,f=u?0:this.outerRadius,{sharedOptions:m,includeOptions:g}=this._getSharedOptions(e,i);let p=this._getRotation(),y;for(y=0;y<e;++y)p+=this._circumference(y,r);for(y=e;y<e+n;++y){const x=this._circumference(y,r),_=t[y],b={x:h+this.offsetX,y:c+this.offsetY,startAngle:p,endAngle:p+x,circumference:x,outerRadius:f,innerRadius:d};g&&(b.options=m||this.resolveDataElementOptions(y,_.active?"active":i)),p+=x,this.updateElement(_,y,b,i)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let n=0,i;for(i=0;i<e.length;i++){const r=t._parsed[i];r!==null&&!isNaN(r)&&this.chart.getDataVisibility(i)&&!e[i].hidden&&(n+=Math.abs(r))}return n}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?B*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart,i=n.data.labels||[],r=Ds(e._parsed[t],n.options.locale);return{label:i[t]||"",value:r}}getMaxBorderWidth(t){let e=0;const n=this.chart;let i,r,o,a,l;if(!t){for(i=0,r=n.data.datasets.length;i<r;++i)if(n.isDatasetVisible(i)){o=n.getDatasetMeta(i),t=o.data,a=o.controller;break}}if(!t)return 0;for(i=0,r=t.length;i<r;++i)l=a.resolveDataElementOptions(i),l.borderAlign!=="inner"&&(e=Math.max(e,l.borderWidth||0,l.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let n=0,i=t.length;n<i;++n){const r=this.resolveDataElementOptions(n);e=Math.max(e,r.offset||0,r.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let n=0;n<t;++n)this.chart.isDatasetVisible(n)&&(e+=this._getRingWeight(n));return e}_getRingWeight(t){return Math.max(E(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}w(de,"id","doughnut"),w(de,"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"}),w(de,"descriptors",{_scriptable:s=>s!=="spacing",_indexable:s=>s!=="spacing"}),w(de,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(s){const t=s.data;if(t.labels.length&&t.datasets.length){const{labels:{pointStyle:e,color:n}}=s.legend.options;return t.labels.map((i,r)=>{const o=s.getDatasetMeta(0).controller.getStyle(r);return{text:i,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,fontColor:n,lineWidth:o.borderWidth,pointStyle:e,hidden:!s.getDataVisibility(r),index:r}})}return[]}},onClick(s,t,e){e.chart.toggleDataVisibility(t.index),e.chart.update()}}}});class Bt extends Ct{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:n,data:i=[],_dataset:r}=e,o=this.chart._animationsDisabled;let{start:a,count:l}=ta(e,i,o);this._drawStart=a,this._drawCount=l,ea(e)&&(a=0,l=i.length),n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!r._decimated,n.points=i;const h=this.resolveDatasetElementOptions(t);this.options.showLine||(h.borderWidth=0),h.segment=this.options.segment,this.updateElement(n,void 0,{animated:!o,options:h},t),this.updateElements(i,a,l,t)}updateElements(t,e,n,i){const r=i==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:h}=this._cachedMeta,{sharedOptions:c,includeOptions:u}=this._getSharedOptions(e,i),d=o.axis,f=a.axis,{spanGaps:m,segment:g}=this.options,p=Re(m)?m:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||r||i==="none",x=e+n,_=t.length;let b=e>0&&this.getParsed(e-1);for(let v=0;v<_;++v){const M=t[v],S=y?M:{};if(v<e||v>=x){S.skip=!0;continue}const k=this.getParsed(v),C=N(k[f]),O=S[d]=o.getPixelForValue(k[d],v),R=S[f]=r||C?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,k,l):k[f],v);S.skip=isNaN(O)||isNaN(R)||C,S.stop=v>0&&Math.abs(k[d]-b[d])>p,g&&(S.parsed=k,S.raw=h.data[v]),u&&(S.options=c||this.resolveDataElementOptions(v,M.active?"active":i)),y||this.updateElement(M,v,S,i),b=k}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,n=e.options&&e.options.borderWidth||0,i=t.data||[];if(!i.length)return n;const r=i[0].size(this.resolveDataElementOptions(0)),o=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(n,r,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}w(Bt,"id","line"),w(Bt,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),w(Bt,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Nt extends Ct{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart,i=n.data.labels||[],r=Ds(e._parsed[t].r,n.options.locale);return{label:i[t]||"",value:r}}parseObjectData(t,e,n,i){return ca.bind(this)(t,e,n,i)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((n,i)=>{const r=this.getParsed(i).r;!isNaN(r)&&this.chart.getDataVisibility(i)&&(r<e.min&&(e.min=r),r>e.max&&(e.max=r))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,n=t.options,i=Math.min(e.right-e.left,e.bottom-e.top),r=Math.max(i/2,0),o=Math.max(n.cutoutPercentage?r/100*n.cutoutPercentage:1,0),a=(r-o)/t.getVisibleDatasetCount();this.outerRadius=r-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,e,n,i){const r=i==="reset",o=this.chart,a=o.options.animation,l=this._cachedMeta.rScale,h=l.xCenter,c=l.yCenter,u=l.getIndexAngle(0)-.5*q;let d=u,f;const m=360/this.countVisibleElements();for(f=0;f<e;++f)d+=this._computeAngle(f,i,m);for(f=e;f<e+n;f++){const g=t[f];let p=d,y=d+this._computeAngle(f,i,m),x=o.getDataVisibility(f)?l.getDistanceFromCenterForValue(this.getParsed(f).r):0;d=y,r&&(a.animateScale&&(x=0),a.animateRotate&&(p=y=u));const _={x:h,y:c,innerRadius:0,outerRadius:x,startAngle:p,endAngle:y,options:this.resolveDataElementOptions(f,g.active?"active":i)};this.updateElement(g,f,_,i)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((n,i)=>{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&e++}),e}_computeAngle(t,e,n){return this.chart.getDataVisibility(t)?Ot(this.resolveDataElementOptions(t,e).angle||n):0}}w(Nt,"id","polarArea"),w(Nt,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),w(Nt,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(s){const t=s.data;if(t.labels.length&&t.datasets.length){const{labels:{pointStyle:e,color:n}}=s.legend.options;return t.labels.map((i,r)=>{const o=s.getDatasetMeta(0).controller.getStyle(r);return{text:i,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,fontColor:n,lineWidth:o.borderWidth,pointStyle:e,hidden:!s.getDataVisibility(r),index:r}})}return[]}},onClick(s,t,e){e.chart.toggleDataVisibility(t.index),e.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class ii extends de{}w(ii,"id","pie"),w(ii,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class tn extends Ct{getLabelAndValue(t){const e=this._cachedMeta.vScale,n=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(n[e.axis])}}parseObjectData(t,e,n,i){return ca.bind(this)(t,e,n,i)}update(t){const e=this._cachedMeta,n=e.dataset,i=e.data||[],r=e.iScale.getLabels();if(n.points=i,t!=="resize"){const o=this.resolveDatasetElementOptions(t);this.options.showLine||(o.borderWidth=0);const a={_loop:!0,_fullLoop:r.length===i.length,options:o};this.updateElement(n,void 0,a,t)}this.updateElements(i,0,i.length,t)}updateElements(t,e,n,i){const r=this._cachedMeta.rScale,o=i==="reset";for(let a=e;a<e+n;a++){const l=t[a],h=this.resolveDataElementOptions(a,l.active?"active":i),c=r.getPointPositionForValue(a,this.getParsed(a).r),u=o?r.xCenter:c.x,d=o?r.yCenter:c.y,f={x:u,y:d,angle:c.angle,skip:isNaN(u)||isNaN(d),options:h};this.updateElement(l,a,f,i)}}}w(tn,"id","radar"),w(tn,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),w(tn,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class ge extends Ct{getLabelAndValue(t){const e=this._cachedMeta,n=this.chart.data.labels||[],{xScale:i,yScale:r}=e,o=this.getParsed(t),a=i.getLabelForValue(o.x),l=r.getLabelForValue(o.y);return{label:n[t]||"",value:"("+a+", "+l+")"}}update(t){const e=this._cachedMeta,{data:n=[]}=e,i=this.chart._animationsDisabled;let{start:r,count:o}=ta(e,n,i);if(this._drawStart=r,this._drawCount=o,ea(e)&&(r=0,o=n.length),this.options.showLine){const{dataset:a,_dataset:l}=e;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!l._decimated,a.points=n;const h=this.resolveDatasetElementOptions(t);h.segment=this.options.segment,this.updateElement(a,void 0,{animated:!i,options:h},t)}this.updateElements(n,r,o,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,n,i){const r=i==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:h}=this._cachedMeta,c=this.resolveDataElementOptions(e,i),u=this.getSharedOptions(c),d=this.includeOptions(i,u),f=o.axis,m=a.axis,{spanGaps:g,segment:p}=this.options,y=Re(g)?g:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||r||i==="none";let _=e>0&&this.getParsed(e-1);for(let b=e;b<e+n;++b){const v=t[b],M=this.getParsed(b),S=x?v:{},k=N(M[m]),C=S[f]=o.getPixelForValue(M[f],b),O=S[m]=r||k?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,M,l):M[m],b);S.skip=isNaN(C)||isNaN(O)||k,S.stop=b>0&&Math.abs(M[f]-_[f])>y,p&&(S.parsed=M,S.raw=h.data[b]),d&&(S.options=u||this.resolveDataElementOptions(b,v.active?"active":i)),x||this.updateElement(v,b,S,i),_=M}this.updateSharedOptions(u,i,c)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let a=0;for(let l=e.length-1;l>=0;--l)a=Math.max(a,e[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const n=t.dataset,i=n.options&&n.options.borderWidth||0;if(!e.length)return i;const r=e[0].size(this.resolveDataElementOptions(0)),o=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(i,r,o)/2}}w(ge,"id","scatter"),w(ge,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),w(ge,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var du=Object.freeze({__proto__:null,BarController:te,BubbleController:Qs,DoughnutController:de,LineController:Bt,PolarAreaController:Nt,PieController:ii,RadarController:tn,ScatterController:ge});function oe(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Ii{static override(t){Object.assign(Ii.prototype,t)}constructor(t){this.options=t||{}}init(){}formats(){return oe()}parse(){return oe()}format(){return oe()}add(){return oe()}diff(){return oe()}startOf(){return oe()}endOf(){return oe()}}var _a={_date:Ii};function fu(s,t,e,n){const{controller:i,data:r,_sorted:o}=s,a=i._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&o&&r.length){const l=a._reversePixels?Fh:jt;if(n){if(i._sharedOptions){const h=r[0],c=typeof h.getRange=="function"&&h.getRange(t);if(c){const u=l(r,t,e-c),d=l(r,t,e+c);return{lo:u.lo,hi:d.hi}}}}else return l(r,t,e)}return{lo:0,hi:r.length-1}}function Os(s,t,e,n,i){const r=s.getSortedVisibleDatasetMetas(),o=e[t];for(let a=0,l=r.length;a<l;++a){const{index:h,data:c}=r[a],{lo:u,hi:d}=fu(r[a],t,o,i);for(let f=u;f<=d;++f){const m=c[f];m.skip||n(m,h,f)}}}function mu(s){const t=s.indexOf("x")!==-1,e=s.indexOf("y")!==-1;return function(n,i){const r=t?Math.abs(n.x-i.x):0,o=e?Math.abs(n.y-i.y):0;return Math.sqrt(Math.pow(r,2)+Math.pow(o,2))}}function jn(s,t,e,n,i){const r=[];return!i&&!s.isPointInArea(t)||Os(s,e,t,function(o,a,l){!i&&!vs(o,s.chartArea,0)||o.inRange(t.x,t.y,n)&&r.push({element:o,datasetIndex:a,index:l})},!0),r}function gu(s,t,e,n){let i=[];function r(o,a,l){const{startAngle:h,endAngle:c}=o.getProps(["startAngle","endAngle"],n),{angle:u}=Go(o,{x:t.x,y:t.y});xs(u,h,c)&&i.push({element:o,datasetIndex:a,index:l})}return Os(s,e,t,r),i}function pu(s,t,e,n,i,r){let o=[];const a=mu(e);let l=Number.POSITIVE_INFINITY;function h(c,u,d){const f=c.inRange(t.x,t.y,i);if(n&&!f)return;const m=c.getCenterPoint(i);if(!(r||s.isPointInArea(m))&&!f)return;const g=a(t,m);g<l?(o=[{element:c,datasetIndex:u,index:d}],l=g):g===l&&o.push({element:c,datasetIndex:u,index:d})}return Os(s,e,t,h),o}function $n(s,t,e,n,i,r){return!r&&!s.isPointInArea(t)?[]:e==="r"&&!n?gu(s,t,e,i):pu(s,t,e,n,i,r)}function kr(s,t,e,n,i){const r=[],o=e==="x"?"inXRange":"inYRange";let a=!1;return Os(s,e,t,(l,h,c)=>{l[o](t[e],i)&&(r.push({element:l,datasetIndex:h,index:c}),a=a||l.inRange(t.x,t.y,i))}),n&&!a?[]:r}var yu={evaluateInteractionItems:Os,modes:{index(s,t,e,n){const i=he(t,s),r=e.axis||"x",o=e.includeInvisible||!1,a=e.intersect?jn(s,i,r,n,o):$n(s,i,r,!1,n,o),l=[];return a.length?(s.getSortedVisibleDatasetMetas().forEach(h=>{const c=a[0].index,u=h.data[c];u&&!u.skip&&l.push({element:u,datasetIndex:h.index,index:c})}),l):[]},dataset(s,t,e,n){const i=he(t,s),r=e.axis||"xy",o=e.includeInvisible||!1;let a=e.intersect?jn(s,i,r,n,o):$n(s,i,r,!1,n,o);if(a.length>0){const l=a[0].datasetIndex,h=s.getDatasetMeta(l).data;a=[];for(let c=0;c<h.length;++c)a.push({element:h[c],datasetIndex:l,index:c})}return a},point(s,t,e,n){const i=he(t,s),r=e.axis||"xy",o=e.includeInvisible||!1;return jn(s,i,r,n,o)},nearest(s,t,e,n){const i=he(t,s),r=e.axis||"xy",o=e.includeInvisible||!1;return $n(s,i,r,e.intersect,n,o)},x(s,t,e,n){const i=he(t,s);return kr(s,i,"x",e.intersect,n)},y(s,t,e,n){const i=he(t,s);return kr(s,i,"y",e.intersect,n)}}};const wa=["left","top","right","bottom"];function ts(s,t){return s.filter(e=>e.pos===t)}function Sr(s,t){return s.filter(e=>wa.indexOf(e.pos)===-1&&e.box.axis===t)}function es(s,t){return s.sort((e,n)=>{const i=t?n:e,r=t?e:n;return i.weight===r.weight?i.index-r.index:i.weight-r.weight})}function bu(s){const t=[];let e,n,i,r,o,a;for(e=0,n=(s||[]).length;e<n;++e)i=s[e],{position:r,options:{stack:o,stackWeight:a=1}}=i,t.push({index:e,box:i,pos:r,horizontal:i.isHorizontal(),weight:i.weight,stack:o&&r+o,stackWeight:a});return t}function xu(s){const t={};for(const e of s){const{stack:n,pos:i,stackWeight:r}=e;if(!n||!wa.includes(i))continue;const o=t[n]||(t[n]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=r}return t}function vu(s,t){const e=xu(s),{vBoxMaxWidth:n,hBoxMaxHeight:i}=t;let r,o,a;for(r=0,o=s.length;r<o;++r){a=s[r];const{fullSize:l}=a.box,h=e[a.stack],c=h&&a.stackWeight/h.weight;a.horizontal?(a.width=c?c*n:l&&t.availableWidth,a.height=i):(a.width=n,a.height=c?c*i:l&&t.availableHeight)}return e}function _u(s){const t=bu(s),e=es(t.filter(h=>h.box.fullSize),!0),n=es(ts(t,"left"),!0),i=es(ts(t,"right")),r=es(ts(t,"top"),!0),o=es(ts(t,"bottom")),a=Sr(t,"x"),l=Sr(t,"y");return{fullSize:e,leftAndTop:n.concat(r),rightAndBottom:i.concat(l).concat(o).concat(a),chartArea:ts(t,"chartArea"),vertical:n.concat(i).concat(l),horizontal:r.concat(o).concat(a)}}function Tr(s,t,e,n){return Math.max(s[e],t[e])+Math.max(s[n],t[n])}function Ma(s,t){s.top=Math.max(s.top,t.top),s.left=Math.max(s.left,t.left),s.bottom=Math.max(s.bottom,t.bottom),s.right=Math.max(s.right,t.right)}function wu(s,t,e,n){const{pos:i,box:r}=e,o=s.maxPadding;if(!P(i)){e.size&&(s[i]-=e.size);const u=n[e.stack]||{size:0,count:1};u.size=Math.max(u.size,e.horizontal?r.height:r.width),e.size=u.size/u.count,s[i]+=e.size}r.getPadding&&Ma(o,r.getPadding());const a=Math.max(0,t.outerWidth-Tr(o,s,"left","right")),l=Math.max(0,t.outerHeight-Tr(o,s,"top","bottom")),h=a!==s.w,c=l!==s.h;return s.w=a,s.h=l,e.horizontal?{same:h,other:c}:{same:c,other:h}}function Mu(s){const t=s.maxPadding;function e(n){const i=Math.max(t[n]-s[n],0);return s[n]+=i,i}s.y+=e("top"),s.x+=e("left"),e("right"),e("bottom")}function ku(s,t){const e=t.maxPadding;function n(i){const r={left:0,top:0,right:0,bottom:0};return i.forEach(o=>{r[o]=Math.max(t[o],e[o])}),r}return n(s?["left","right"]:["top","bottom"])}function hs(s,t,e,n){const i=[];let r,o,a,l,h,c;for(r=0,o=s.length,h=0;r<o;++r){a=s[r],l=a.box,l.update(a.width||t.w,a.height||t.h,ku(a.horizontal,t));const{same:u,other:d}=wu(t,e,a,n);h|=u&&i.length,c=c||d,l.fullSize||i.push(a)}return h&&hs(i,t,e,n)||c}function Ws(s,t,e,n,i){s.top=e,s.left=t,s.right=t+n,s.bottom=e+i,s.width=n,s.height=i}function Dr(s,t,e,n){const i=e.padding;let{x:r,y:o}=t;for(const a of s){const l=a.box,h=n[a.stack]||{count:1,placed:0,weight:1},c=a.stackWeight/h.weight||1;if(a.horizontal){const u=t.w*c,d=h.size||l.height;Mt(h.start)&&(o=h.start),l.fullSize?Ws(l,i.left,o,e.outerWidth-i.right-i.left,d):Ws(l,t.left+h.placed,o,u,d),h.start=o,h.placed+=u,o=l.bottom}else{const u=t.h*c,d=h.size||l.width;Mt(h.start)&&(r=h.start),l.fullSize?Ws(l,r,i.top,d,e.outerHeight-i.bottom-i.top):Ws(l,r,t.top+h.placed,d,u),h.start=r,h.placed+=u,r=l.right}}t.x=r,t.y=o}var st={addBox(s,t){s.boxes||(s.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},s.boxes.push(t)},removeBox(s,t){const e=s.boxes?s.boxes.indexOf(t):-1;e!==-1&&s.boxes.splice(e,1)},configure(s,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(s,t,e,n){if(!s)return;const i=nt(s.options.layout.padding),r=Math.max(t-i.width,0),o=Math.max(e-i.height,0),a=_u(s.boxes),l=a.vertical,h=a.horizontal;z(s.boxes,g=>{typeof g.beforeLayout=="function"&&g.beforeLayout()});const c=l.reduce((g,p)=>p.box.options&&p.box.options.display===!1?g:g+1,0)||1,u=Object.freeze({outerWidth:t,outerHeight:e,padding:i,availableWidth:r,availableHeight:o,vBoxMaxWidth:r/2/c,hBoxMaxHeight:o/2}),d=Object.assign({},i);Ma(d,nt(n));const f=Object.assign({maxPadding:d,w:r,h:o,x:i.left,y:i.top},i),m=vu(l.concat(h),u);hs(a.fullSize,f,u,m),hs(l,f,u,m),hs(h,f,u,m)&&hs(l,f,u,m),Mu(f),Dr(a.leftAndTop,f,u,m),f.x+=f.w,f.y+=f.h,Dr(a.rightAndBottom,f,u,m),s.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},z(a.chartArea,g=>{const p=g.box;Object.assign(p,s.chartArea),p.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class ka{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,n){}removeEventListener(t,e,n){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,n,i){return e=Math.max(0,e||t.width),n=n||t.height,{width:e,height:Math.max(0,i?Math.floor(e/i):n)}}isAttached(t){return!0}updateConfig(t){}}class Su extends ka{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const en="$chartjs",Tu={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Or=s=>s===null||s==="";function Du(s,t){const e=s.style,n=s.getAttribute("height"),i=s.getAttribute("width");if(s[en]={initial:{height:n,width:i,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",Or(i)){const r=cr(s,"width");r!==void 0&&(s.width=r)}if(Or(n))if(s.style.height==="")s.height=s.width/(t||2);else{const r=cr(s,"height");r!==void 0&&(s.height=r)}return s}const Sa=Cc?{passive:!0}:!1;function Ou(s,t,e){s.addEventListener(t,e,Sa)}function Eu(s,t,e){s.canvas.removeEventListener(t,e,Sa)}function Cu(s,t){const e=Tu[s.type]||s.type,{x:n,y:i}=he(s,t);return{type:e,chart:t,native:s,x:n!==void 0?n:null,y:i!==void 0?i:null}}function dn(s,t){for(const e of s)if(e===t||e.contains(t))return!0}function Au(s,t,e){const n=s.canvas,i=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||dn(a.addedNodes,n),o=o&&!dn(a.removedNodes,n);o&&e()});return i.observe(document,{childList:!0,subtree:!0}),i}function Pu(s,t,e){const n=s.canvas,i=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||dn(a.removedNodes,n),o=o&&!dn(a.addedNodes,n);o&&e()});return i.observe(document,{childList:!0,subtree:!0}),i}const ws=new Map;let Er=0;function Ta(){const s=window.devicePixelRatio;s!==Er&&(Er=s,ws.forEach((t,e)=>{e.currentDevicePixelRatio!==s&&t()}))}function Iu(s,t){ws.size||window.addEventListener("resize",Ta),ws.set(s,t)}function Lu(s){ws.delete(s),ws.size||window.removeEventListener("resize",Ta)}function Nu(s,t,e){const n=s.canvas,i=n&&Pi(n);if(!i)return;const r=Qo((a,l)=>{const h=i.clientWidth;e(a,l),h<i.clientWidth&&e()},window),o=new ResizeObserver(a=>{const l=a[0],h=l.contentRect.width,c=l.contentRect.height;h===0&&c===0||r(h,c)});return o.observe(i),Iu(s,r),o}function Bn(s,t,e){e&&e.disconnect(),t==="resize"&&Lu(s)}function Ru(s,t,e){const n=s.canvas,i=Qo(r=>{s.ctx!==null&&e(Cu(r,s))},s);return Ou(n,t,i),i}class Fu extends ka{acquireContext(t,e){const n=t&&t.getContext&&t.getContext("2d");return n&&n.canvas===t?(Du(t,e),n):null}releaseContext(t){const e=t.canvas;if(!e[en])return!1;const n=e[en].initial;["height","width"].forEach(r=>{const o=n[r];N(o)?e.removeAttribute(r):e.setAttribute(r,o)});const i=n.style||{};return Object.keys(i).forEach(r=>{e.style[r]=i[r]}),e.width=e.width,delete e[en],!0}addEventListener(t,e,n){this.removeEventListener(t,e);const i=t.$proxies||(t.$proxies={}),r={attach:Au,detach:Pu,resize:Nu}[e]||Ru;i[e]=r(t,e,n)}removeEventListener(t,e){const n=t.$proxies||(t.$proxies={}),i=n[e];i&&(({attach:Bn,detach:Bn,resize:Bn}[e]||Eu)(t,e,i),n[e]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,n,i){return Ec(t,e,n,i)}isAttached(t){const e=Pi(t);return!!(e&&e.isConnected)}}function Vu(s){return!da()||typeof OffscreenCanvas<"u"&&s instanceof OffscreenCanvas?Su:Fu}class At{constructor(){w(this,"active",!1)}tooltipPosition(t){const{x:e,y:n}=this.getProps(["x","y"],t);return{x:e,y:n}}hasValue(){return Re(this.x)&&Re(this.y)}getProps(t,e){const n=this.$animations;if(!e||!n)return this;const i={};return t.forEach(r=>{i[r]=n[r]&&n[r].active()?n[r]._to:this[r]}),i}}w(At,"defaults",{}),w(At,"defaultRoutes");function zu(s,t){const e=s.options.ticks,n=Wu(s),i=Math.min(e.maxTicksLimit||n,n),r=e.major.enabled?$u(t):[],o=r.length,a=r[0],l=r[o-1],h=[];if(o>i)return Bu(t,h,r,o/i),h;const c=ju(r,t,i);if(o>0){let u,d;const f=o>1?Math.round((l-a)/(o-1)):null;for(js(t,h,c,N(f)?0:a-f,a),u=0,d=o-1;u<d;u++)js(t,h,c,r[u],r[u+1]);return js(t,h,c,l,N(f)?t.length:l+f),h}return js(t,h,c),h}function Wu(s){const t=s.options.offset,e=s._tickSize(),n=s._length/e+(t?0:1),i=s._maxLength/e;return Math.floor(Math.min(n,i))}function ju(s,t,e){const n=Hu(s),i=t.length/e;if(!n)return Math.max(i,1);const r=Ih(n);for(let o=0,a=r.length-1;o<a;o++){const l=r[o];if(l>i)return l}return Math.max(i,1)}function $u(s){const t=[];let e,n;for(e=0,n=s.length;e<n;e++)s[e].major&&t.push(e);return t}function Bu(s,t,e,n){let i=0,r=e[0],o;for(n=Math.ceil(n),o=0;o<s.length;o++)o===r&&(t.push(s[o]),i++,r=e[i*n])}function js(s,t,e,n,i){const r=E(n,0),o=Math.min(E(i,s.length),s.length);let a=0,l,h,c;for(e=Math.ceil(e),i&&(l=i-n,e=l/Math.floor(l/e)),c=r;c<0;)a++,c=Math.round(r+a*e);for(h=Math.max(r,0);h<o;h++)h===c&&(t.push(s[h]),a++,c=Math.round(r+a*e))}function Hu(s){const t=s.length;let e,n;if(t<2)return!1;for(n=s[0],e=1;e<t;++e)if(s[e]-s[e-1]!==n)return!1;return n}const qu=s=>s==="left"?"right":s==="right"?"left":s,Cr=(s,t,e)=>t==="top"||t==="left"?s[t]+e:s[t]-e,Ar=(s,t)=>Math.min(t||s,s);function Pr(s,t){const e=[],n=s.length/t,i=s.length;let r=0;for(;r<i;r+=n)e.push(s[Math.floor(r)]);return e}function Uu(s,t,e){const n=s.ticks.length,i=Math.min(t,n-1),r=s._startPixel,o=s._endPixel,a=1e-6;let l=s.getPixelForTick(i),h;if(!(e&&(n===1?h=Math.max(l-r,o-l):t===0?h=(s.getPixelForTick(1)-l)/2:h=(l-s.getPixelForTick(i-1))/2,l+=i<t?h:-h,l<r-a||l>o+a)))return l}function Zu(s,t){z(s,e=>{const n=e.gc,i=n.length/2;let r;if(i>t){for(r=0;r<i;++r)delete e.data[n[r]];n.splice(0,i)}})}function ss(s){return s.drawTicks?s.tickLength:0}function Ir(s,t){if(!s.display)return 0;const e=K(s.font,t),n=nt(s.padding);return($(s.text)?s.text.length:1)*e.lineHeight+n.height}function Yu(s,t){return ne(s,{scale:t,type:"scale"})}function Gu(s,t,e){return ne(s,{tick:e,index:t,type:"tick"})}function Ju(s,t,e){let n=Di(s);return(e&&t!=="right"||!e&&t==="right")&&(n=qu(n)),n}function Xu(s,t,e,n){const{top:i,left:r,bottom:o,right:a,chart:l}=s,{chartArea:h,scales:c}=l;let u=0,d,f,m;const g=o-i,p=a-r;if(s.isHorizontal()){if(f=tt(n,r,a),P(e)){const y=Object.keys(e)[0],x=e[y];m=c[y].getPixelForValue(x)+g-t}else e==="center"?m=(h.bottom+h.top)/2+g-t:m=Cr(s,e,t);d=a-r}else{if(P(e)){const y=Object.keys(e)[0],x=e[y];f=c[y].getPixelForValue(x)-p+t}else e==="center"?f=(h.left+h.right)/2-p+t:f=Cr(s,e,t);m=tt(n,o,i),u=e==="left"?-Y:Y}return{titleX:f,titleY:m,maxWidth:d,rotation:u}}class Me extends At{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:n,_suggestedMax:i}=this;return t=mt(t,Number.POSITIVE_INFINITY),e=mt(e,Number.NEGATIVE_INFINITY),n=mt(n,Number.POSITIVE_INFINITY),i=mt(i,Number.NEGATIVE_INFINITY),{min:mt(t,n),max:mt(e,i),minDefined:Z(t),maxDefined:Z(e)}}getMinMax(t){let{min:e,max:n,minDefined:i,maxDefined:r}=this.getUserBounds(),o;if(i&&r)return{min:e,max:n};const a=this.getMatchingVisibleMetas();for(let l=0,h=a.length;l<h;++l)o=a[l].controller.getMinMax(this,t),i||(e=Math.min(e,o.min)),r||(n=Math.max(n,o.max));return e=r&&e>n?n:e,n=i&&e>n?e:n,{min:mt(e,mt(n,e)),max:mt(n,mt(e,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){W(this.options.beforeUpdate,[this])}update(t,e,n){const{beginAtZero:i,grace:r,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=ac(this,r,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?Pr(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=zu(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,n;this.isHorizontal()?(e=this.left,n=this.right):(e=this.top,n=this.bottom,t=!t),this._startPixel=e,this._endPixel=n,this._reversePixels=t,this._length=n-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){W(this.options.afterUpdate,[this])}beforeSetDimensions(){W(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(){W(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),W(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){W(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let n,i,r;for(n=0,i=t.length;n<i;n++)r=t[n],r.label=W(e.callback,[r.value,n,t],this)}afterTickToLabelConversion(){W(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){W(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,n=Ar(this.ticks.length,t.ticks.maxTicksLimit),i=e.minRotation||0,r=e.maxRotation;let o=i,a,l,h;if(!this._isVisible()||!e.display||i>=r||n<=1||!this.isHorizontal()){this.labelRotation=i;return}const c=this._getLabelSizes(),u=c.widest.width,d=c.highest.height,f=Q(this.chart.width-u,0,this.maxWidth);a=t.offset?this.maxWidth/n:f/(n-1),u+6>a&&(a=f/(n-(t.offset?.5:1)),l=this.maxHeight-ss(t.grid)-e.padding-Ir(t.title,this.chart.options.font),h=Math.sqrt(u*u+d*d),o=Si(Math.min(Math.asin(Q((c.highest.height+6)/a,-1,1)),Math.asin(Q(l/h,-1,1))-Math.asin(Q(d/h,-1,1)))),o=Math.max(i,Math.min(r,o))),this.labelRotation=o}afterCalculateLabelRotation(){W(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){W(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:n,title:i,grid:r}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const l=Ir(i,e.options.font);if(a?(t.width=this.maxWidth,t.height=ss(r)+l):(t.height=this.maxHeight,t.width=ss(r)+l),n.display&&this.ticks.length){const{first:h,last:c,widest:u,highest:d}=this._getLabelSizes(),f=n.padding*2,m=Ot(this.labelRotation),g=Math.cos(m),p=Math.sin(m);if(a){const y=n.mirror?0:p*u.width+g*d.height;t.height=Math.min(this.maxHeight,t.height+y+f)}else{const y=n.mirror?0:g*u.width+p*d.height;t.width=Math.min(this.maxWidth,t.width+y+f)}this._calculatePadding(h,c,p,g)}}this._handleMargins(),a?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,n,i){const{ticks:{align:r,padding:o},position:a}=this.options,l=this.labelRotation!==0,h=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const c=this.getPixelForTick(0)-this.left,u=this.right-this.getPixelForTick(this.ticks.length-1);let d=0,f=0;l?h?(d=i*t.width,f=n*e.height):(d=n*t.height,f=i*e.width):r==="start"?f=e.width:r==="end"?d=t.width:r!=="inner"&&(d=t.width/2,f=e.width/2),this.paddingLeft=Math.max((d-c+o)*this.width/(this.width-c),0),this.paddingRight=Math.max((f-u+o)*this.width/(this.width-u),0)}else{let c=e.height/2,u=t.height/2;r==="start"?(c=0,u=t.height):r==="end"&&(c=e.height,u=0),this.paddingTop=c+o,this.paddingBottom=u+o}}_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(){W(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,n;for(e=0,n=t.length;e<n;e++)N(t[e].label)&&(t.splice(e,1),n--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let n=this.ticks;e<n.length&&(n=Pr(n,e)),this._labelSizes=t=this._computeLabelSizes(n,n.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,n){const{ctx:i,_longestTextCache:r}=this,o=[],a=[],l=Math.floor(e/Ar(e,n));let h=0,c=0,u,d,f,m,g,p,y,x,_,b,v;for(u=0;u<e;u+=l){if(m=t[u].label,g=this._resolveTickFontOptions(u),i.font=p=g.string,y=r[p]=r[p]||{data:{},gc:[]},x=g.lineHeight,_=b=0,!N(m)&&!$(m))_=cn(i,y.data,y.gc,_,m),b=x;else if($(m))for(d=0,f=m.length;d<f;++d)v=m[d],!N(v)&&!$(v)&&(_=cn(i,y.data,y.gc,_,v),b+=x);o.push(_),a.push(b),h=Math.max(_,h),c=Math.max(b,c)}Zu(r,e);const M=o.indexOf(h),S=a.indexOf(c),k=C=>({width:o[C]||0,height:a[C]||0});return{first:k(0),last:k(e-1),widest:k(M),highest:k(S),widths:o,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return Rh(this._alignToPixels?re(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const n=e[t];return n.$context||(n.$context=Gu(this.getContext(),t,n))}return this.$context||(this.$context=Yu(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=Ot(this.labelRotation),n=Math.abs(Math.cos(e)),i=Math.abs(Math.sin(e)),r=this._getLabelSizes(),o=t.autoSkipPadding||0,a=r?r.widest.width+o:0,l=r?r.highest.height+o:0;return this.isHorizontal()?l*n>a*i?a/n:l/i:l*i<a*n?l/n:a/i}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,n=this.chart,i=this.options,{grid:r,position:o,border:a}=i,l=r.offset,h=this.isHorizontal(),c=this.ticks.length+(l?1:0),u=ss(r),d=[],f=a.setContext(this.getContext()),m=f.display?f.width:0,g=m/2,p=function(A){return re(n,A,m)};let y,x,_,b,v,M,S,k,C,O,R,F;if(o==="top")y=p(this.bottom),M=this.bottom-u,k=y-g,O=p(t.top)+g,F=t.bottom;else if(o==="bottom")y=p(this.top),O=t.top,F=p(t.bottom)-g,M=y+g,k=this.top+u;else if(o==="left")y=p(this.right),v=this.right-u,S=y-g,C=p(t.left)+g,R=t.right;else if(o==="right")y=p(this.left),C=t.left,R=p(t.right)-g,v=y+g,S=this.left+u;else if(e==="x"){if(o==="center")y=p((t.top+t.bottom)/2+.5);else if(P(o)){const A=Object.keys(o)[0],H=o[A];y=p(this.chart.scales[A].getPixelForValue(H))}O=t.top,F=t.bottom,M=y+g,k=M+u}else if(e==="y"){if(o==="center")y=p((t.left+t.right)/2);else if(P(o)){const A=Object.keys(o)[0],H=o[A];y=p(this.chart.scales[A].getPixelForValue(H))}v=y-g,S=v-u,C=t.left,R=t.right}const ut=E(i.ticks.maxTicksLimit,c),dt=Math.max(1,Math.ceil(c/ut));for(x=0;x<c;x+=dt){const A=this.getContext(x),H=r.setContext(A),ft=a.setContext(A),St=H.lineWidth,it=H.color,De=ft.dash||[],Is=ft.dashOffset,Oe=H.tickWidth,Je=H.tickColor,Xe=H.tickBorderDash||[],Ke=H.tickBorderDashOffset;_=Uu(this,x,l),_!==void 0&&(b=re(n,_,St),h?v=S=C=R=b:M=k=O=F=b,d.push({tx1:v,ty1:M,tx2:S,ty2:k,x1:C,y1:O,x2:R,y2:F,width:St,color:it,borderDash:De,borderDashOffset:Is,tickWidth:Oe,tickColor:Je,tickBorderDash:Xe,tickBorderDashOffset:Ke}))}return this._ticksLength=c,this._borderValue=y,d}_computeLabelItems(t){const e=this.axis,n=this.options,{position:i,ticks:r}=n,o=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:h,padding:c,mirror:u}=r,d=ss(n.grid),f=d+c,m=u?-c:f,g=-Ot(this.labelRotation),p=[];let y,x,_,b,v,M,S,k,C,O,R,F,ut="middle";if(i==="top")M=this.bottom-m,S=this._getXAxisLabelAlignment();else if(i==="bottom")M=this.top+m,S=this._getXAxisLabelAlignment();else if(i==="left"){const A=this._getYAxisLabelAlignment(d);S=A.textAlign,v=A.x}else if(i==="right"){const A=this._getYAxisLabelAlignment(d);S=A.textAlign,v=A.x}else if(e==="x"){if(i==="center")M=(t.top+t.bottom)/2+f;else if(P(i)){const A=Object.keys(i)[0],H=i[A];M=this.chart.scales[A].getPixelForValue(H)+f}S=this._getXAxisLabelAlignment()}else if(e==="y"){if(i==="center")v=(t.left+t.right)/2-f;else if(P(i)){const A=Object.keys(i)[0],H=i[A];v=this.chart.scales[A].getPixelForValue(H)}S=this._getYAxisLabelAlignment(d).textAlign}e==="y"&&(l==="start"?ut="top":l==="end"&&(ut="bottom"));const dt=this._getLabelSizes();for(y=0,x=a.length;y<x;++y){_=a[y],b=_.label;const A=r.setContext(this.getContext(y));k=this.getPixelForTick(y)+r.labelOffset,C=this._resolveTickFontOptions(y),O=C.lineHeight,R=$(b)?b.length:1;const H=R/2,ft=A.color,St=A.textStrokeColor,it=A.textStrokeWidth;let De=S;o?(v=k,S==="inner"&&(y===x-1?De=this.options.reverse?"left":"right":y===0?De=this.options.reverse?"right":"left":De="center"),i==="top"?h==="near"||g!==0?F=-R*O+O/2:h==="center"?F=-dt.highest.height/2-H*O+O:F=-dt.highest.height+O/2:h==="near"||g!==0?F=O/2:h==="center"?F=dt.highest.height/2-H*O:F=dt.highest.height-R*O,u&&(F*=-1),g!==0&&!A.showLabelBackdrop&&(v+=O/2*Math.sin(g))):(M=k,F=(1-R)*O/2);let Is;if(A.showLabelBackdrop){const Oe=nt(A.backdropPadding),Je=dt.heights[y],Xe=dt.widths[y];let Ke=F-Oe.top,Ln=0-Oe.left;switch(ut){case"middle":Ke-=Je/2;break;case"bottom":Ke-=Je;break}switch(S){case"center":Ln-=Xe/2;break;case"right":Ln-=Xe;break}Is={left:Ln,top:Ke,width:Xe+Oe.width,height:Je+Oe.height,color:A.backdropColor}}p.push({label:b,font:C,textOffset:F,options:{rotation:g,color:ft,strokeColor:St,strokeWidth:it,textAlign:De,textBaseline:ut,translation:[v,M],backdrop:Is}})}return p}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-Ot(this.labelRotation))return t==="top"?"left":"right";let n="center";return e.align==="start"?n="left":e.align==="end"?n="right":e.align==="inner"&&(n="inner"),n}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:n,mirror:i,padding:r}}=this.options,o=this._getLabelSizes(),a=t+r,l=o.widest.width;let h,c;return e==="left"?i?(c=this.right+r,n==="near"?h="left":n==="center"?(h="center",c+=l/2):(h="right",c+=l)):(c=this.right-a,n==="near"?h="right":n==="center"?(h="center",c-=l/2):(h="left",c=this.left)):e==="right"?i?(c=this.left+r,n==="near"?h="right":n==="center"?(h="center",c-=l/2):(h="left",c-=l)):(c=this.left+a,n==="near"?h="left":n==="center"?(h="center",c+=l/2):(h="right",c=this.right)):h="right",{textAlign:h,x:c}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:n,top:i,width:r,height:o}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(n,i,r,o),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const n=this.ticks.findIndex(i=>i.value===t);return n>=0?e.setContext(this.getContext(n)).lineWidth:0}drawGrid(t){const e=this.options.grid,n=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let r,o;const a=(l,h,c)=>{!c.width||!c.color||(n.save(),n.lineWidth=c.width,n.strokeStyle=c.color,n.setLineDash(c.borderDash||[]),n.lineDashOffset=c.borderDashOffset,n.beginPath(),n.moveTo(l.x,l.y),n.lineTo(h.x,h.y),n.stroke(),n.restore())};if(e.display)for(r=0,o=i.length;r<o;++r){const l=i[r];e.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),e.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:n,grid:i}}=this,r=n.setContext(this.getContext()),o=n.display?r.width:0;if(!o)return;const a=i.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let h,c,u,d;this.isHorizontal()?(h=re(t,this.left,o)-o/2,c=re(t,this.right,a)+a/2,u=d=l):(u=re(t,this.top,o)-o/2,d=re(t,this.bottom,a)+a/2,h=c=l),e.save(),e.lineWidth=r.width,e.strokeStyle=r.color,e.beginPath(),e.moveTo(h,u),e.lineTo(c,d),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const e=this.ctx,n=this._computeLabelArea();n&&wn(e,n);const i=this.getLabelItems(t);for(const r of i){const o=r.options,a=r.font,l=r.label,h=r.textOffset;_e(e,l,0,h,a,o)}n&&Mn(e)}drawTitle(){const{ctx:t,options:{position:e,title:n,reverse:i}}=this;if(!n.display)return;const r=K(n.font),o=nt(n.padding),a=n.align;let l=r.lineHeight/2;e==="bottom"||e==="center"||P(e)?(l+=o.bottom,$(n.text)&&(l+=r.lineHeight*(n.text.length-1))):l+=o.top;const{titleX:h,titleY:c,maxWidth:u,rotation:d}=Xu(this,l,e,a);_e(t,n.text,0,0,r,{color:n.color,maxWidth:u,rotation:d,textAlign:Ju(a,e,i),textBaseline:"middle",translation:[h,c]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,n=E(t.grid&&t.grid.z,-1),i=E(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Me.prototype.draw?[{z:e,draw:r=>{this.draw(r)}}]:[{z:n,draw:r=>{this.drawBackground(),this.drawGrid(r),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:e,draw:r=>{this.drawLabels(r)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+"AxisID",i=[];let r,o;for(r=0,o=e.length;r<o;++r){const a=e[r];a[n]===this.id&&(!t||a.type===t)&&i.push(a)}return i}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return K(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class $s{constructor(t,e,n){this.type=t,this.scope=e,this.override=n,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let n;td(e)&&(n=this.register(e));const i=this.items,r=t.id,o=this.scope+"."+r;if(!r)throw new Error("class does not have id: "+t);return r in i||(i[r]=t,Ku(t,o,n),this.override&&G.override(t.id,t.overrides)),o}get(t){return this.items[t]}unregister(t){const e=this.items,n=t.id,i=this.scope;n in e&&delete e[n],i&&n in G[i]&&(delete G[i][n],this.override&&delete ve[n])}}function Ku(s,t,e){const n=yt(Object.create(null),[e?G.get(e):{},G.get(t),s.defaults]);G.set(t,n),s.defaultRoutes&&Qu(t,s.defaultRoutes),s.descriptors&&G.describe(t,s.descriptors)}function Qu(s,t){Object.keys(t).forEach(e=>{const n=e.split("."),i=n.pop(),r=[s].concat(n).join("."),o=t[e].split("."),a=o.pop(),l=o.join(".");G.route(r,i,l,a)})}function td(s){return"id"in s&&"defaults"in s}class ed{constructor(){this.controllers=new $s(Ct,"datasets",!0),this.elements=new $s(At,"elements"),this.plugins=new $s(Object,"plugins"),this.scales=new $s(Me,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,n){[...e].forEach(i=>{const r=n||this._getRegistryForType(i);n||r.isForType(i)||r===this.plugins&&i.id?this._exec(t,r,i):z(i,o=>{const a=n||this._getRegistryForType(o);this._exec(t,a,o)})})}_exec(t,e,n){const i=ki(t);W(n["before"+i],[],n),e[t](n),W(n["after"+i],[],n)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const n=this._typedRegistries[e];if(n.isForType(t))return n}return this.plugins}_get(t,e,n){const i=e.get(t);if(i===void 0)throw new Error('"'+t+'" is not a registered '+n+".");return i}}var rt=new ed;class sd{constructor(){this._init=[]}notify(t,e,n,i){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const r=i?this._descriptors(t).filter(i):this._descriptors(t),o=this._notify(r,t,e,n);return e==="afterDestroy"&&(this._notify(r,t,"stop"),this._notify(this._init,t,"uninstall")),o}_notify(t,e,n,i){i=i||{};for(const r of t){const o=r.plugin,a=o[n],l=[e,i,r.options];if(W(a,l,o)===!1&&i.cancelable)return!1}return!0}invalidate(){N(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const n=t&&t.config,i=E(n.options&&n.options.plugins,{}),r=nd(n);return i===!1&&!e?[]:rd(t,r,i,e)}_notifyStateChanges(t){const e=this._oldCache||[],n=this._cache,i=(r,o)=>r.filter(a=>!o.some(l=>a.plugin.id===l.plugin.id));this._notify(i(e,n),t,"stop"),this._notify(i(n,e),t,"start")}}function nd(s){const t={},e=[],n=Object.keys(rt.plugins.items);for(let r=0;r<n.length;r++)e.push(rt.getPlugin(n[r]));const i=s.plugins||[];for(let r=0;r<i.length;r++){const o=i[r];e.indexOf(o)===-1&&(e.push(o),t[o.id]=!0)}return{plugins:e,localIds:t}}function id(s,t){return!t&&s===!1?null:s===!0?{}:s}function rd(s,{plugins:t,localIds:e},n,i){const r=[],o=s.getContext();for(const a of t){const l=a.id,h=id(n[l],i);h!==null&&r.push({plugin:a,options:od(s.config,{plugin:a,local:e[l]},h,o)})}return r}function od(s,{plugin:t,local:e},n,i){const r=s.pluginScopeKeys(t),o=s.getOptionScopes(n,r);return e&&t.defaults&&o.push(t.defaults),s.createResolver(o,i,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function ri(s,t){const e=G.datasets[s]||{};return((t.datasets||{})[s]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function ad(s,t){let e=s;return s==="_index_"?e=t:s==="_value_"&&(e=t==="x"?"y":"x"),e}function ld(s,t){return s===t?"_index_":"_value_"}function hd(s){if(s==="top"||s==="bottom")return"x";if(s==="left"||s==="right")return"y"}function fn(s,t){if(s==="x"||s==="y"||s==="r"||(s=t.axis||hd(t.position)||s.length>1&&fn(s[0].toLowerCase(),t),s))return s;throw new Error(`Cannot determine type of '${name}' axis. Please provide 'axis' or 'position' option.`)}function cd(s,t){const e=ve[s.type]||{scales:{}},n=t.scales||{},i=ri(s.type,t),r=Object.create(null);return Object.keys(n).forEach(o=>{const a=n[o];if(!P(a))return console.error(`Invalid scale configuration for scale: ${o}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);const l=fn(o,a),h=ld(l,i),c=e.scales||{};r[o]=us(Object.create(null),[{axis:l},a,c[l],c[h]])}),s.data.datasets.forEach(o=>{const a=o.type||s.type,l=o.indexAxis||ri(a,t),h=(ve[a]||{}).scales||{};Object.keys(h).forEach(c=>{const u=ad(c,l),d=o[u+"AxisID"]||u;r[d]=r[d]||Object.create(null),us(r[d],[{axis:u},n[d],h[c]])})}),Object.keys(r).forEach(o=>{const a=r[o];us(a,[G.scales[a.type],G.scale])}),r}function Da(s){const t=s.options||(s.options={});t.plugins=E(t.plugins,{}),t.scales=cd(s,t)}function Oa(s){return s=s||{},s.datasets=s.datasets||[],s.labels=s.labels||[],s}function ud(s){return s=s||{},s.data=Oa(s.data),Da(s),s}const Lr=new Map,Ea=new Set;function Bs(s,t){let e=Lr.get(s);return e||(e=t(),Lr.set(s,e),Ea.add(e)),e}const ns=(s,t,e)=>{const n=ee(t,e);n!==void 0&&s.add(n)};class dd{constructor(t){this._config=ud(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=Oa(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(),Da(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Bs(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return Bs(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return Bs(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,n=this.type;return Bs(`${n}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const n=this._scopeCache;let i=n.get(t);return(!i||e)&&(i=new Map,n.set(t,i)),i}getOptionScopes(t,e,n){const{options:i,type:r}=this,o=this._cachedScopes(t,n),a=o.get(e);if(a)return a;const l=new Set;e.forEach(c=>{t&&(l.add(t),c.forEach(u=>ns(l,t,u))),c.forEach(u=>ns(l,i,u)),c.forEach(u=>ns(l,ve[r]||{},u)),c.forEach(u=>ns(l,G,u)),c.forEach(u=>ns(l,si,u))});const h=Array.from(l);return h.length===0&&h.push(Object.create(null)),Ea.has(e)&&o.set(e,h),h}chartOptionScopes(){const{options:t,type:e}=this;return[t,ve[e]||{},G.datasets[e]||{},{type:e},G,si]}resolveNamedOptions(t,e,n,i=[""]){const r={$shared:!0},{resolver:o,subPrefixes:a}=Nr(this._resolverCache,t,i);let l=o;if(md(o,e)){r.$shared=!1,n=se(n)?n():n;const h=this.createResolver(t,n,a);l=Fe(o,n,h)}for(const h of e)r[h]=l[h];return r}createResolver(t,e,n=[""],i){const{resolver:r}=Nr(this._resolverCache,t,n);return P(e)?Fe(r,e,void 0,i):r}}function Nr(s,t,e){let n=s.get(t);n||(n=new Map,s.set(t,n));const i=e.join();let r=n.get(i);return r||(r={resolver:Ei(t,e),subPrefixes:e.filter(o=>!o.toLowerCase().includes("hover"))},n.set(i,r)),r}const fd=s=>P(s)&&Object.getOwnPropertyNames(s).reduce((t,e)=>t||se(s[e]),!1);function md(s,t){const{isScriptable:e,isIndexable:n}=oa(s);for(const i of t){const r=e(i),o=n(i),a=(o||r)&&s[i];if(r&&(se(a)||fd(a))||o&&$(a))return!0}return!1}var gd="4.2.1";const pd=["top","bottom","left","right","chartArea"];function Rr(s,t){return s==="top"||s==="bottom"||pd.indexOf(s)===-1&&t==="x"}function Fr(s,t){return function(e,n){return e[s]===n[s]?e[t]-n[t]:e[s]-n[s]}}function Vr(s){const t=s.chart,e=t.options.animation;t.notifyPlugins("afterRender"),W(e&&e.onComplete,[s],t)}function yd(s){const t=s.chart,e=t.options.animation;W(e&&e.onProgress,[s],t)}function Ca(s){return da()&&typeof s=="string"?s=document.getElementById(s):s&&s.length&&(s=s[0]),s&&s.canvas&&(s=s.canvas),s}const mn={},Aa=s=>{const t=Ca(s);return Object.values(mn).filter(e=>e.canvas===t).pop()};function bd(s,t,e){const n=Object.keys(s);for(const i of n){const r=+i;if(r>=t){const o=s[i];delete s[i],(e>0||r>t)&&(s[r+e]=o)}}}function xd(s,t,e,n){return!e||s.type==="mouseout"?null:n?t:s}function vd(s){const{xScale:t,yScale:e}=s;if(t&&e)return{left:t.left,right:t.right,top:e.top,bottom:e.bottom}}class lt{static register(...t){rt.add(...t),zr()}static unregister(...t){rt.remove(...t),zr()}constructor(t,e){const n=this.config=new dd(e),i=Ca(t),r=Aa(i);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");const o=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||Vu(i)),this.platform.updateConfig(n);const a=this.platform.acquireContext(i,o.aspectRatio),l=a&&a.canvas,h=l&&l.height,c=l&&l.width;if(this.id=kh(),this.ctx=a,this.canvas=l,this.width=c,this.height=h,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new sd,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Wh(u=>this.update(u),o.resizeDelay||0),this._dataChanges=[],mn[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Ft.listen(this,"complete",Vr),Ft.listen(this,"progress",yd),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:n,height:i,_aspectRatio:r}=this;return N(t)?e&&r?r:i?n/i: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 rt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():hr(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return or(this.canvas,this.ctx),this}stop(){return Ft.stop(this),this}resize(t,e){Ft.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const n=this.options,i=this.canvas,r=n.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(i,t,e,r),a=n.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,hr(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),W(n.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const t=this.options.scales||{};z(t,(e,n)=>{e.id=n})}buildOrUpdateScales(){const t=this.options,e=t.scales,n=this.scales,i=Object.keys(n).reduce((o,a)=>(o[a]=!1,o),{});let r=[];e&&(r=r.concat(Object.keys(e).map(o=>{const a=e[o],l=fn(o,a),h=l==="r",c=l==="x";return{options:a,dposition:h?"chartArea":c?"bottom":"left",dtype:h?"radialLinear":c?"category":"linear"}}))),z(r,o=>{const a=o.options,l=a.id,h=fn(l,a),c=E(a.type,o.dtype);(a.position===void 0||Rr(a.position,h)!==Rr(o.dposition))&&(a.position=o.dposition),i[l]=!0;let u=null;if(l in n&&n[l].type===c)u=n[l];else{const d=rt.getScale(c);u=new d({id:l,type:c,ctx:this.ctx,chart:this}),n[u.id]=u}u.init(a,t)}),z(i,(o,a)=>{o||delete n[a]}),z(n,o=>{st.configure(this,o,o.options),st.addBox(this,o)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,n=t.length;if(t.sort((i,r)=>i.index-r.index),n>e){for(let i=e;i<n;++i)this._destroyDatasetMeta(i);t.splice(e,n-e)}this._sortedMetasets=t.slice(0).sort(Fr("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((n,i)=>{e.filter(r=>r===n._dataset).length===0&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let n,i;for(this._removeUnreferencedMetasets(),n=0,i=e.length;n<i;n++){const r=e[n];let o=this.getDatasetMeta(n);const a=r.type||this.config.type;if(o.type&&o.type!==a&&(this._destroyDatasetMeta(n),o=this.getDatasetMeta(n)),o.type=a,o.indexAxis=r.indexAxis||ri(a,this.options),o.order=r.order||0,o.index=n,o.label=""+r.label,o.visible=this.isDatasetVisible(n),o.controller)o.controller.updateIndex(n),o.controller.linkScales();else{const l=rt.getController(a),{datasetElementType:h,dataElementType:c}=G.datasets[a];Object.assign(l,{dataElementType:rt.getElement(c),datasetElementType:h&&rt.getElement(h)}),o.controller=new l(this,n),t.push(o.controller)}}return this._updateMetasets(),t}_resetElements(){z(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const n=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),i=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let h=0,c=this.data.datasets.length;h<c;h++){const{controller:u}=this.getDatasetMeta(h),d=!i&&r.indexOf(u)===-1;u.buildOrUpdateElements(d),o=Math.max(+u.getMaxOverflow(),o)}o=this._minPadding=n.layout.autoPadding?o:0,this._updateLayout(o),i||z(r,h=>{h.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Fr("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){z(this.scales,t=>{st.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),n=new Set(t.events);(!Ki(e,n)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:n,start:i,count:r}of e){const o=n==="_removeElements"?-r:r;bd(t,i,o)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,n=r=>new Set(t.filter(o=>o[0]===r).map((o,a)=>a+","+o.splice(1).join(","))),i=n(0);for(let r=1;r<e;r++)if(!Ki(i,n(r)))return;return Array.from(i).map(r=>r.split(",")).map(r=>({method:r[1],start:+r[2],count:+r[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;st.update(this,this.width,this.height,t);const e=this.chartArea,n=e.width<=0||e.height<=0;this._layers=[],z(this.boxes,i=>{n&&i.position==="chartArea"||(i.configure&&i.configure(),this._layers.push(...i._layers()))},this),this._layers.forEach((i,r)=>{i._idx=r}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,n=this.data.datasets.length;e<n;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,n=this.data.datasets.length;e<n;++e)this._updateDataset(e,se(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const n=this.getDatasetMeta(t),i={meta:n,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",i)!==!1&&(n.controller._update(e),i.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",i))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Ft.has(this)?this.attached&&!Ft.running(this)&&Ft.start(this):(this.draw(),Vr({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:n,height:i}=this._resizeBeforeDraw;this._resize(n,i),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,n=[];let i,r;for(i=0,r=e.length;i<r;++i){const o=e[i];(!t||o.visible)&&n.push(o)}return n}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,n=t._clip,i=!n.disabled,r=vd(t)||this.chartArea,o={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(i&&wn(e,{left:n.left===!1?0:r.left-n.left,right:n.right===!1?this.width:r.right+n.right,top:n.top===!1?0:r.top-n.top,bottom:n.bottom===!1?this.height:r.bottom+n.bottom}),t.controller.draw(),i&&Mn(e),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(t){return vs(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,n,i){const r=yu.modes[e];return typeof r=="function"?r(this,t,n,i):[]}getDatasetMeta(t){const e=this.data.datasets[t],n=this._metasets;let i=n.filter(r=>r&&r._dataset===e).pop();return i||(i={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},n.push(i)),i}getContext(){return this.$context||(this.$context=ne(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const n=this.getDatasetMeta(t);return typeof n.hidden=="boolean"?!n.hidden:!e.hidden}setDatasetVisibility(t,e){const n=this.getDatasetMeta(t);n.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,n){const i=n?"show":"hide",r=this.getDatasetMeta(t),o=r.controller._resolveAnimations(void 0,i);Mt(e)?(r.data[e].hidden=!n,this.update()):(this.setDatasetVisibility(t,n),o.update(r,{visible:n}),this.update(a=>a.datasetIndex===t?i: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(),Ft.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(),or(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete mn[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,n=(r,o)=>{e.addEventListener(this,r,o),t[r]=o},i=(r,o,a)=>{r.offsetX=o,r.offsetY=a,this._eventHandler(r)};z(this.options.events,r=>n(r,i))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,n=(l,h)=>{e.addEventListener(this,l,h),t[l]=h},i=(l,h)=>{t[l]&&(e.removeEventListener(this,l,h),delete t[l])},r=(l,h)=>{this.canvas&&this.resize(l,h)};let o;const a=()=>{i("attach",a),this.attached=!0,this.resize(),n("resize",r),n("detach",o)};o=()=>{this.attached=!1,i("resize",r),this._stop(),this._resize(0,0),n("attach",a)},e.isAttached(this.canvas)?a():o()}unbindEvents(){z(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},z(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,n){const i=n?"set":"remove";let r,o,a,l;for(e==="dataset"&&(r=this.getDatasetMeta(t[0].datasetIndex),r.controller["_"+i+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){o=t[a];const h=o&&this.getDatasetMeta(o.datasetIndex).controller;h&&h[i+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],n=t.map(({datasetIndex:i,index:r})=>{const o=this.getDatasetMeta(i);if(!o)throw new Error("No dataset found at index "+i);return{datasetIndex:i,element:o.data[r],index:r}});!on(n,e)&&(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,e))}notifyPlugins(t,e,n){return this._plugins.notify(this,t,e,n)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,n){const i=this.options.hover,r=(l,h)=>l.filter(c=>!h.some(u=>c.datasetIndex===u.datasetIndex&&c.index===u.index)),o=r(e,t),a=n?t:r(t,e);o.length&&this.updateHoverStyle(o,i.mode,!1),a.length&&i.mode&&this.updateHoverStyle(a,i.mode,!0)}_eventHandler(t,e){const n={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},i=o=>(o.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",n,i)===!1)return;const r=this._handleEvent(t,e,n.inChartArea);return n.cancelable=!1,this.notifyPlugins("afterEvent",n,i),(r||n.changed)&&this.render(),this}_handleEvent(t,e,n){const{_active:i=[],options:r}=this,o=e,a=this._getActiveElements(t,i,n,o),l=Ch(t),h=xd(t,this._lastEvent,n,l);n&&(this._lastEvent=null,W(r.onHover,[t,a,this],this),l&&W(r.onClick,[t,a,this],this));const c=!on(a,i);return(c||e)&&(this._active=a,this._updateHoverStyles(a,i,e)),this._lastEvent=h,c}_getActiveElements(t,e,n,i){if(t.type==="mouseout")return[];if(!n)return e;const r=this.options.hover;return this.getElementsAtEventForMode(t,r.mode,r,i)}}w(lt,"defaults",G),w(lt,"instances",mn),w(lt,"overrides",ve),w(lt,"registry",rt),w(lt,"version",gd),w(lt,"getChart",Aa);function zr(){return z(lt.instances,s=>s._plugins.invalidate())}function _d(s,t,e){const{startAngle:n,pixelMargin:i,x:r,y:o,outerRadius:a,innerRadius:l}=t;let h=i/a;s.beginPath(),s.arc(r,o,a,n-h,e+h),l>i?(h=i/l,s.arc(r,o,l,e+h,n-h,!0)):s.arc(r,o,i,e+Y,n-Y),s.closePath(),s.clip()}function wd(s){return Oi(s,["outerStart","outerEnd","innerStart","innerEnd"])}function Md(s,t,e,n){const i=wd(s.options.borderRadius),r=(e-t)/2,o=Math.min(r,n*t/2),a=l=>{const h=(e-Math.min(r,l))*n/2;return Q(l,0,Math.min(r,h))};return{outerStart:a(i.outerStart),outerEnd:a(i.outerEnd),innerStart:Q(i.innerStart,0,o),innerEnd:Q(i.innerEnd,0,o)}}function Ce(s,t,e,n){return{x:e+s*Math.cos(t),y:n+s*Math.sin(t)}}function gn(s,t,e,n,i,r){const{x:o,y:a,startAngle:l,pixelMargin:h,innerRadius:c}=t,u=Math.max(t.outerRadius+n+e-h,0),d=c>0?c+n+e+h:0;let f=0;const m=i-l;if(n){const A=c>0?c-n:0,H=u>0?u-n:0,ft=(A+H)/2,St=ft!==0?m*ft/(ft+n):m;f=(m-St)/2}const g=Math.max(.001,m*u-e/q)/u,p=(m-g)/2,y=l+p+f,x=i-p-f,{outerStart:_,outerEnd:b,innerStart:v,innerEnd:M}=Md(t,d,u,x-y),S=u-_,k=u-b,C=y+_/S,O=x-b/k,R=d+v,F=d+M,ut=y+v/R,dt=x-M/F;if(s.beginPath(),r){const A=(C+O)/2;if(s.arc(o,a,u,C,A),s.arc(o,a,u,A,O),b>0){const it=Ce(k,O,o,a);s.arc(it.x,it.y,b,O,x+Y)}const H=Ce(F,x,o,a);if(s.lineTo(H.x,H.y),M>0){const it=Ce(F,dt,o,a);s.arc(it.x,it.y,M,x+Y,dt+Math.PI)}const ft=(x-M/d+(y+v/d))/2;if(s.arc(o,a,d,x-M/d,ft,!0),s.arc(o,a,d,ft,y+v/d,!0),v>0){const it=Ce(R,ut,o,a);s.arc(it.x,it.y,v,ut+Math.PI,y-Y)}const St=Ce(S,y,o,a);if(s.lineTo(St.x,St.y),_>0){const it=Ce(S,C,o,a);s.arc(it.x,it.y,_,y-Y,C)}}else{s.moveTo(o,a);const A=Math.cos(C)*u+o,H=Math.sin(C)*u+a;s.lineTo(A,H);const ft=Math.cos(O)*u+o,St=Math.sin(O)*u+a;s.lineTo(ft,St)}s.closePath()}function kd(s,t,e,n,i){const{fullCircles:r,startAngle:o,circumference:a}=t;let l=t.endAngle;if(r){gn(s,t,e,n,l,i);for(let h=0;h<r;++h)s.fill();isNaN(a)||(l=o+(a%B||B))}return gn(s,t,e,n,l,i),s.fill(),l}function Sd(s,t,e,n,i){const{fullCircles:r,startAngle:o,circumference:a,options:l}=t,{borderWidth:h,borderJoinStyle:c}=l,u=l.borderAlign==="inner";if(!h)return;u?(s.lineWidth=h*2,s.lineJoin=c||"round"):(s.lineWidth=h,s.lineJoin=c||"bevel");let d=t.endAngle;if(r){gn(s,t,e,n,d,i);for(let f=0;f<r;++f)s.stroke();isNaN(a)||(d=o+(a%B||B))}u&&_d(s,t,d),r||(gn(s,t,e,n,d,i),s.stroke())}class pe extends At{constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,n){const i=this.getProps(["x","y"],n),{angle:r,distance:o}=Go(i,{x:t,y:e}),{startAngle:a,endAngle:l,innerRadius:h,outerRadius:c,circumference:u}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],n),d=this.options.spacing/2,f=E(u,l-a)>=B||xs(r,a,l),m=Wt(o,h+d,c+d);return f&&m}getCenterPoint(t){const{x:e,y:n,startAngle:i,endAngle:r,innerRadius:o,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:l,spacing:h}=this.options,c=(i+r)/2,u=(o+a+h+l)/2;return{x:e+Math.cos(c)*u,y:n+Math.sin(c)*u}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:n}=this,i=(e.offset||0)/4,r=(e.spacing||0)/2,o=e.circular;if(this.pixelMargin=e.borderAlign==="inner"?.33:0,this.fullCircles=n>B?Math.floor(n/B):0,n===0||this.innerRadius<0||this.outerRadius<0)return;t.save();const a=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(a)*i,Math.sin(a)*i);const l=1-Math.sin(Math.min(q,n||0)),h=i*l;t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,kd(t,this,h,r,o),Sd(t,this,h,r,o),t.restore()}}w(pe,"id","arc"),w(pe,"defaults",{borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),w(pe,"defaultRoutes",{backgroundColor:"backgroundColor"});function Pa(s,t,e=t){s.lineCap=E(e.borderCapStyle,t.borderCapStyle),s.setLineDash(E(e.borderDash,t.borderDash)),s.lineDashOffset=E(e.borderDashOffset,t.borderDashOffset),s.lineJoin=E(e.borderJoinStyle,t.borderJoinStyle),s.lineWidth=E(e.borderWidth,t.borderWidth),s.strokeStyle=E(e.borderColor,t.borderColor)}function Td(s,t,e){s.lineTo(e.x,e.y)}function Dd(s){return s.stepped?Kh:s.tension||s.cubicInterpolationMode==="monotone"?Qh:Td}function Ia(s,t,e={}){const n=s.length,{start:i=0,end:r=n-1}=e,{start:o,end:a}=t,l=Math.max(i,o),h=Math.min(r,a),c=i<o&&r<o||i>a&&r>a;return{count:n,start:l,loop:t.loop,ilen:h<l&&!c?n+h-l:h-l}}function Od(s,t,e,n){const{points:i,options:r}=t,{count:o,start:a,loop:l,ilen:h}=Ia(i,e,n),c=Dd(r);let{move:u=!0,reverse:d}=n||{},f,m,g;for(f=0;f<=h;++f)m=i[(a+(d?h-f:f))%o],!m.skip&&(u?(s.moveTo(m.x,m.y),u=!1):c(s,g,m,d,r.stepped),g=m);return l&&(m=i[(a+(d?h:0))%o],c(s,g,m,d,r.stepped)),!!l}function Ed(s,t,e,n){const i=t.points,{count:r,start:o,ilen:a}=Ia(i,e,n),{move:l=!0,reverse:h}=n||{};let c=0,u=0,d,f,m,g,p,y;const x=b=>(o+(h?a-b:b))%r,_=()=>{g!==p&&(s.lineTo(c,p),s.lineTo(c,g),s.lineTo(c,y))};for(l&&(f=i[x(0)],s.moveTo(f.x,f.y)),d=0;d<=a;++d){if(f=i[x(d)],f.skip)continue;const b=f.x,v=f.y,M=b|0;M===m?(v<g?g=v:v>p&&(p=v),c=(u*c+b)/++u):(_(),s.lineTo(b,v),m=M,u=0,g=p=v),y=v}_()}function oi(s){const t=s.options,e=t.borderDash&&t.borderDash.length;return!s._decimated&&!s._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?Ed:Od}function Cd(s){return s.stepped?Ac:s.tension||s.cubicInterpolationMode==="monotone"?Pc:ce}function Ad(s,t,e,n){let i=t._path;i||(i=t._path=new Path2D,t.path(i,e,n)&&i.closePath()),Pa(s,t.options),s.stroke(i)}function Pd(s,t,e,n){const{segments:i,options:r}=t,o=oi(t);for(const a of i)Pa(s,r,a.style),s.beginPath(),o(s,t,a,{start:e,end:e+n-1})&&s.closePath(),s.stroke()}const Id=typeof Path2D=="function";function Ld(s,t,e,n){Id&&!t.options.segment?Ad(s,t,e,n):Pd(s,t,e,n)}class Xt extends At{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const n=this.options;if((n.tension||n.cubicInterpolationMode==="monotone")&&!n.stepped&&!this._pointsUpdated){const i=n.spanGaps?this._loop:this._fullLoop;Mc(this._points,n,t,i,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=Vc(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,n=t.length;return n&&e[t[n-1].end]}interpolate(t,e){const n=this.options,i=t[e],r=this.points,o=ya(this,{property:e,start:i,end:i});if(!o.length)return;const a=[],l=Cd(n);let h,c;for(h=0,c=o.length;h<c;++h){const{start:u,end:d}=o[h],f=r[u],m=r[d];if(f===m){a.push(f);continue}const g=Math.abs((i-f[e])/(m[e]-f[e])),p=l(f,m,g,n.stepped);p[e]=t[e],a.push(p)}return a.length===1?a[0]:a}pathSegment(t,e,n){return oi(this)(t,this,e,n)}path(t,e,n){const i=this.segments,r=oi(this);let o=this._loop;e=e||0,n=n||this.points.length-e;for(const a of i)o&=r(t,this,a,{start:e,end:e+n-1});return!!o}draw(t,e,n,i){const r=this.options||{};(this.points||[]).length&&r.borderWidth&&(t.save(),Ld(t,this,n,i),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}w(Xt,"id","line"),w(Xt,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),w(Xt,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),w(Xt,"descriptors",{_scriptable:!0,_indexable:s=>s!=="borderDash"&&s!=="fill"});function Wr(s,t,e,n){const i=s.options,{[e]:r}=s.getProps([e],n);return Math.abs(t-r)<i.radius+i.hitRadius}class ye extends At{constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,n){const i=this.options,{x:r,y:o}=this.getProps(["x","y"],n);return Math.pow(t-r,2)+Math.pow(e-o,2)<Math.pow(i.hitRadius+i.radius,2)}inXRange(t,e){return Wr(this,t,"x",e)}inYRange(t,e){return Wr(this,t,"y",e)}getCenterPoint(t){const{x:e,y:n}=this.getProps(["x","y"],t);return{x:e,y:n}}size(t){t=t||this.options||{};let e=t.radius||0;e=Math.max(e,e&&t.hoverRadius||0);const n=e&&t.borderWidth||0;return(e+n)*2}draw(t,e){const n=this.options;this.skip||n.radius<.1||!vs(this,e,this.size(n)/2)||(t.strokeStyle=n.borderColor,t.lineWidth=n.borderWidth,t.fillStyle=n.backgroundColor,ni(t,n,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}w(ye,"id","point"),w(ye,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),w(ye,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function La(s,t){const{x:e,y:n,base:i,width:r,height:o}=s.getProps(["x","y","base","width","height"],t);let a,l,h,c,u;return s.horizontal?(u=o/2,a=Math.min(e,i),l=Math.max(e,i),h=n-u,c=n+u):(u=r/2,a=e-u,l=e+u,h=Math.min(n,i),c=Math.max(n,i)),{left:a,top:h,right:l,bottom:c}}function Kt(s,t,e,n){return s?0:Q(t,e,n)}function Nd(s,t,e){const n=s.options.borderWidth,i=s.borderSkipped,r=ra(n);return{t:Kt(i.top,r.top,0,e),r:Kt(i.right,r.right,0,t),b:Kt(i.bottom,r.bottom,0,e),l:Kt(i.left,r.left,0,t)}}function Rd(s,t,e){const{enableBorderRadius:n}=s.getProps(["enableBorderRadius"]),i=s.options.borderRadius,r=fe(i),o=Math.min(t,e),a=s.borderSkipped,l=n||P(i);return{topLeft:Kt(!l||a.top||a.left,r.topLeft,0,o),topRight:Kt(!l||a.top||a.right,r.topRight,0,o),bottomLeft:Kt(!l||a.bottom||a.left,r.bottomLeft,0,o),bottomRight:Kt(!l||a.bottom||a.right,r.bottomRight,0,o)}}function Fd(s){const t=La(s),e=t.right-t.left,n=t.bottom-t.top,i=Nd(s,e/2,n/2),r=Rd(s,e/2,n/2);return{outer:{x:t.left,y:t.top,w:e,h:n,radius:r},inner:{x:t.left+i.l,y:t.top+i.t,w:e-i.l-i.r,h:n-i.t-i.b,radius:{topLeft:Math.max(0,r.topLeft-Math.max(i.t,i.l)),topRight:Math.max(0,r.topRight-Math.max(i.t,i.r)),bottomLeft:Math.max(0,r.bottomLeft-Math.max(i.b,i.l)),bottomRight:Math.max(0,r.bottomRight-Math.max(i.b,i.r))}}}}function Hn(s,t,e,n){const i=t===null,r=e===null,o=s&&!(i&&r)&&La(s,n);return o&&(i||Wt(t,o.left,o.right))&&(r||Wt(e,o.top,o.bottom))}function Vd(s){return s.topLeft||s.topRight||s.bottomLeft||s.bottomRight}function zd(s,t){s.rect(t.x,t.y,t.w,t.h)}function qn(s,t,e={}){const n=s.x!==e.x?-t:0,i=s.y!==e.y?-t:0,r=(s.x+s.w!==e.x+e.w?t:0)-n,o=(s.y+s.h!==e.y+e.h?t:0)-i;return{x:s.x+n,y:s.y+i,w:s.w+r,h:s.h+o,radius:s.radius}}class be extends At{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:n,backgroundColor:i}}=this,{inner:r,outer:o}=Fd(this),a=Vd(o.radius)?_s:zd;t.save(),(o.w!==r.w||o.h!==r.h)&&(t.beginPath(),a(t,qn(o,e,r)),t.clip(),a(t,qn(r,-e,o)),t.fillStyle=n,t.fill("evenodd")),t.beginPath(),a(t,qn(r,e)),t.fillStyle=i,t.fill(),t.restore()}inRange(t,e,n){return Hn(this,t,e,n)}inXRange(t,e){return Hn(this,t,null,e)}inYRange(t,e){return Hn(this,null,t,e)}getCenterPoint(t){const{x:e,y:n,base:i,horizontal:r}=this.getProps(["x","y","base","horizontal"],t);return{x:r?(e+i)/2:e,y:r?n:(n+i)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}w(be,"id","bar"),w(be,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),w(be,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var Wd=Object.freeze({__proto__:null,ArcElement:pe,LineElement:Xt,PointElement:ye,BarElement:be});const ai=["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)"],jr=ai.map(s=>s.replace("rgb(","rgba(").replace(")",", 0.5)"));function Na(s){return ai[s%ai.length]}function Ra(s){return jr[s%jr.length]}function jd(s,t){return s.borderColor=Na(t),s.backgroundColor=Ra(t),++t}function $d(s,t){return s.backgroundColor=s.data.map(()=>Na(t++)),t}function Bd(s,t){return s.backgroundColor=s.data.map(()=>Ra(t++)),t}function Hd(s){let t=0;return(e,n)=>{const i=s.getDatasetMeta(n).controller;i instanceof de?t=$d(e,t):i instanceof Nt?t=Bd(e,t):i&&(t=jd(e,t))}}function $r(s){let t;for(t in s)if(s[t].borderColor||s[t].backgroundColor)return!0;return!1}function qd(s){return s&&(s.borderColor||s.backgroundColor)}var Ud={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(s,t,e){if(!e.enabled)return;const{data:{datasets:n},options:i}=s.config,{elements:r}=i;if(!e.forceOverride&&($r(n)||qd(i)||r&&$r(r)))return;const o=Hd(s);n.forEach(o)}};function Zd(s,t,e,n,i){const r=i.samples||n;if(r>=e)return s.slice(t,t+e);const o=[],a=(e-2)/(r-2);let l=0;const h=t+e-1;let c=t,u,d,f,m,g;for(o[l++]=s[c],u=0;u<r-2;u++){let p=0,y=0,x;const _=Math.floor((u+1)*a)+1+t,b=Math.min(Math.floor((u+2)*a)+1,e)+t,v=b-_;for(x=_;x<b;x++)p+=s[x].x,y+=s[x].y;p/=v,y/=v;const M=Math.floor(u*a)+1+t,S=Math.min(Math.floor((u+1)*a)+1,e)+t,{x:k,y:C}=s[c];for(f=m=-1,x=M;x<S;x++)m=.5*Math.abs((k-p)*(s[x].y-C)-(k-s[x].x)*(y-C)),m>f&&(f=m,d=s[x],g=x);o[l++]=d,c=g}return o[l++]=s[h],o}function Yd(s,t,e,n){let i=0,r=0,o,a,l,h,c,u,d,f,m,g;const p=[],y=t+e-1,x=s[t].x,_=s[y].x-x;for(o=t;o<t+e;++o){a=s[o],l=(a.x-x)/_*n,h=a.y;const b=l|0;if(b===c)h<m?(m=h,u=o):h>g&&(g=h,d=o),i=(r*i+a.x)/++r;else{const v=o-1;if(!N(u)&&!N(d)){const M=Math.min(u,d),S=Math.max(u,d);M!==f&&M!==v&&p.push({...s[M],x:i}),S!==f&&S!==v&&p.push({...s[S],x:i})}o>0&&v!==f&&p.push(s[v]),p.push(a),c=b,r=0,m=g=h,u=d=f=o}}return p}function Fa(s){if(s._decimated){const t=s._data;delete s._decimated,delete s._data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function Br(s){s.data.datasets.forEach(t=>{Fa(t)})}function Gd(s,t){const e=t.length;let n=0,i;const{iScale:r}=s,{min:o,max:a,minDefined:l,maxDefined:h}=r.getUserBounds();return l&&(n=Q(jt(t,r.axis,o).lo,0,e-1)),h?i=Q(jt(t,r.axis,a).hi+1,n,e)-n:i=e-n,{start:n,count:i}}var Jd={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(s,t,e)=>{if(!e.enabled){Br(s);return}const n=s.width;s.data.datasets.forEach((i,r)=>{const{_data:o,indexAxis:a}=i,l=s.getDatasetMeta(r),h=o||i.data;if(ls([a,s.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const c=s.scales[l.xAxisID];if(c.type!=="linear"&&c.type!=="time"||s.options.parsing)return;let{start:u,count:d}=Gd(l,h);const f=e.threshold||4*n;if(d<=f){Fa(i);return}N(o)&&(i._data=h,delete i.data,Object.defineProperty(i,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(g){this._data=g}}));let m;switch(e.algorithm){case"lttb":m=Zd(h,u,d,n,e);break;case"min-max":m=Yd(h,u,d,n);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}i._decimated=m})},destroy(s){Br(s)}};function Xd(s,t,e){const n=s.segments,i=s.points,r=t.points,o=[];for(const a of n){let{start:l,end:h}=a;h=Li(l,h,i);const c=li(e,i[l],i[h],a.loop);if(!t.segments){o.push({source:a,target:c,start:i[l],end:i[h]});continue}const u=ya(t,c);for(const d of u){const f=li(e,r[d.start],r[d.end],d.loop),m=pa(a,i,f);for(const g of m)o.push({source:g,target:d,start:{[e]:Hr(c,f,"start",Math.max)},end:{[e]:Hr(c,f,"end",Math.min)}})}}return o}function li(s,t,e,n){if(n)return;let i=t[s],r=e[s];return s==="angle"&&(i=gt(i),r=gt(r)),{property:s,start:i,end:r}}function Kd(s,t){const{x:e=null,y:n=null}=s||{},i=t.points,r=[];return t.segments.forEach(({start:o,end:a})=>{a=Li(o,a,i);const l=i[o],h=i[a];n!==null?(r.push({x:l.x,y:n}),r.push({x:h.x,y:n})):e!==null&&(r.push({x:e,y:l.y}),r.push({x:e,y:h.y}))}),r}function Li(s,t,e){for(;t>s;t--){const n=e[t];if(!isNaN(n.x)&&!isNaN(n.y))break}return t}function Hr(s,t,e,n){return s&&t?n(s[e],t[e]):s?s[e]:t?t[e]:0}function Va(s,t){let e=[],n=!1;return $(s)?(n=!0,e=s):e=Kd(s,t),e.length?new Xt({points:e,options:{tension:0},_loop:n,_fullLoop:n}):null}function qr(s){return s&&s.fill!==!1}function Qd(s,t,e){let n=s[t].fill;const i=[t];let r;if(!e)return n;for(;n!==!1&&i.indexOf(n)===-1;){if(!Z(n))return n;if(r=s[n],!r)return!1;if(r.visible)return n;i.push(n),n=r.fill}return!1}function tf(s,t,e){const n=rf(s);if(P(n))return isNaN(n.value)?!1:n;let i=parseFloat(n);return Z(i)&&Math.floor(i)===i?ef(n[0],t,i,e):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}function ef(s,t,e,n){return(s==="-"||s==="+")&&(e=t+e),e===t||e<0||e>=n?!1:e}function sf(s,t){let e=null;return s==="start"?e=t.bottom:s==="end"?e=t.top:P(s)?e=t.getPixelForValue(s.value):t.getBasePixel&&(e=t.getBasePixel()),e}function nf(s,t,e){let n;return s==="start"?n=e:s==="end"?n=t.options.reverse?t.min:t.max:P(s)?n=s.value:n=t.getBaseValue(),n}function rf(s){const t=s.options,e=t.fill;let n=E(e&&e.target,e);return n===void 0&&(n=!!t.backgroundColor),n===!1||n===null?!1:n===!0?"origin":n}function of(s){const{scale:t,index:e,line:n}=s,i=[],r=n.segments,o=n.points,a=af(t,e);a.push(Va({x:null,y:t.bottom},n));for(let l=0;l<r.length;l++){const h=r[l];for(let c=h.start;c<=h.end;c++)lf(i,o[c],a)}return new Xt({points:i,options:{}})}function af(s,t){const e=[],n=s.getMatchingVisibleMetas("line");for(let i=0;i<n.length;i++){const r=n[i];if(r.index===t)break;r.hidden||e.unshift(r.dataset)}return e}function lf(s,t,e){const n=[];for(let i=0;i<e.length;i++){const r=e[i],{first:o,last:a,point:l}=hf(r,t,"x");if(!(!l||o&&a)){if(o)n.unshift(l);else if(s.push(l),!a)break}}s.push(...n)}function hf(s,t,e){const n=s.interpolate(t,e);if(!n)return{};const i=n[e],r=s.segments,o=s.points;let a=!1,l=!1;for(let h=0;h<r.length;h++){const c=r[h],u=o[c.start][e],d=o[c.end][e];if(Wt(i,u,d)){a=i===u,l=i===d;break}}return{first:a,last:l,point:n}}class za{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,n){const{x:i,y:r,radius:o}=this;return e=e||{start:0,end:B},t.arc(i,r,o,e.end,e.start,!0),!n.bounds}interpolate(t){const{x:e,y:n,radius:i}=this,r=t.angle;return{x:e+Math.cos(r)*i,y:n+Math.sin(r)*i,angle:r}}}function cf(s){const{chart:t,fill:e,line:n}=s;if(Z(e))return uf(t,e);if(e==="stack")return of(s);if(e==="shape")return!0;const i=df(s);return i instanceof za?i:Va(i,n)}function uf(s,t){const e=s.getDatasetMeta(t);return e&&s.isDatasetVisible(t)?e.dataset:null}function df(s){return(s.scale||{}).getPointPositionForValue?mf(s):ff(s)}function ff(s){const{scale:t={},fill:e}=s,n=sf(e,t);if(Z(n)){const i=t.isHorizontal();return{x:i?n:null,y:i?null:n}}return null}function mf(s){const{scale:t,fill:e}=s,n=t.options,i=t.getLabels().length,r=n.reverse?t.max:t.min,o=nf(e,t,r),a=[];if(n.grid.circular){const l=t.getPointPositionForValue(0,r);return new za({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(o)})}for(let l=0;l<i;++l)a.push(t.getPointPositionForValue(l,o));return a}function Un(s,t,e){const n=cf(t),{line:i,scale:r,axis:o}=t,a=i.options,l=a.fill,h=a.backgroundColor,{above:c=h,below:u=h}=l||{};n&&i.points.length&&(wn(s,e),gf(s,{line:i,target:n,above:c,below:u,area:e,scale:r,axis:o}),Mn(s))}function gf(s,t){const{line:e,target:n,above:i,below:r,area:o,scale:a}=t,l=e._loop?"angle":t.axis;s.save(),l==="x"&&r!==i&&(Ur(s,n,o.top),Zr(s,{line:e,target:n,color:i,scale:a,property:l}),s.restore(),s.save(),Ur(s,n,o.bottom)),Zr(s,{line:e,target:n,color:r,scale:a,property:l}),s.restore()}function Ur(s,t,e){const{segments:n,points:i}=t;let r=!0,o=!1;s.beginPath();for(const a of n){const{start:l,end:h}=a,c=i[l],u=i[Li(l,h,i)];r?(s.moveTo(c.x,c.y),r=!1):(s.lineTo(c.x,e),s.lineTo(c.x,c.y)),o=!!t.pathSegment(s,a,{move:o}),o?s.closePath():s.lineTo(u.x,e)}s.lineTo(t.first().x,e),s.closePath(),s.clip()}function Zr(s,t){const{line:e,target:n,property:i,color:r,scale:o}=t,a=Xd(e,n,i);for(const{source:l,target:h,start:c,end:u}of a){const{style:{backgroundColor:d=r}={}}=l,f=n!==!0;s.save(),s.fillStyle=d,pf(s,o,f&&li(i,c,u)),s.beginPath();const m=!!e.pathSegment(s,l);let g;if(f){m?s.closePath():Yr(s,n,u,i);const p=!!n.pathSegment(s,h,{move:m,reverse:!0});g=m&&p,g||Yr(s,n,c,i)}s.closePath(),s.fill(g?"evenodd":"nonzero"),s.restore()}}function pf(s,t,e){const{top:n,bottom:i}=t.chart.chartArea,{property:r,start:o,end:a}=e||{};r==="x"&&(s.beginPath(),s.rect(o,n,a-o,i-n),s.clip())}function Yr(s,t,e,n){const i=t.interpolate(e,n);i&&s.lineTo(i.x,i.y)}var yf={id:"filler",afterDatasetsUpdate(s,t,e){const n=(s.data.datasets||[]).length,i=[];let r,o,a,l;for(o=0;o<n;++o)r=s.getDatasetMeta(o),a=r.dataset,l=null,a&&a.options&&a instanceof Xt&&(l={visible:s.isDatasetVisible(o),index:o,fill:tf(a,o,n),chart:s,axis:r.controller.options.indexAxis,scale:r.vScale,line:a}),r.$filler=l,i.push(l);for(o=0;o<n;++o)l=i[o],!(!l||l.fill===!1)&&(l.fill=Qd(i,o,e.propagate))},beforeDraw(s,t,e){const n=e.drawTime==="beforeDraw",i=s.getSortedVisibleDatasetMetas(),r=s.chartArea;for(let o=i.length-1;o>=0;--o){const a=i[o].$filler;a&&(a.line.updateControlPoints(r,a.axis),n&&a.fill&&Un(s.ctx,a,r))}},beforeDatasetsDraw(s,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const n=s.getSortedVisibleDatasetMetas();for(let i=n.length-1;i>=0;--i){const r=n[i].$filler;qr(r)&&Un(s.ctx,r,s.chartArea)}},beforeDatasetDraw(s,t,e){const n=t.meta.$filler;!qr(n)||e.drawTime!=="beforeDatasetDraw"||Un(s.ctx,n,s.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Gr=(s,t)=>{let{boxHeight:e=t,boxWidth:n=t}=s;return s.usePointStyle&&(e=Math.min(e,t),n=s.pointStyleWidth||Math.min(n,t)),{boxWidth:n,boxHeight:e,itemHeight:Math.max(t,e)}},bf=(s,t)=>s!==null&&t!==null&&s.datasetIndex===t.datasetIndex&&s.index===t.index;class Jr extends At{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,n){this.maxWidth=t,this.maxHeight=e,this._margins=n,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=W(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(n=>t.filter(n,this.chart.data))),t.sort&&(e=e.sort((n,i)=>t.sort(n,i,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const n=t.labels,i=K(n.font),r=i.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=Gr(n,r);let h,c;e.font=i.string,this.isHorizontal()?(h=this.maxWidth,c=this._fitRows(o,r,a,l)+10):(c=this.maxHeight,h=this._fitCols(o,i,a,l)+10),this.width=Math.min(h,t.maxWidth||this.maxWidth),this.height=Math.min(c,t.maxHeight||this.maxHeight)}_fitRows(t,e,n,i){const{ctx:r,maxWidth:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],h=this.lineWidths=[0],c=i+a;let u=t;r.textAlign="left",r.textBaseline="middle";let d=-1,f=-c;return this.legendItems.forEach((m,g)=>{const p=n+e/2+r.measureText(m.text).width;(g===0||h[h.length-1]+p+2*a>o)&&(u+=c,h[h.length-(g>0?0:1)]=0,f+=c,d++),l[g]={left:0,top:f,row:d,width:p,height:i},h[h.length-1]+=p+a}),u}_fitCols(t,e,n,i){const{ctx:r,maxHeight:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],h=this.columnSizes=[],c=o-t;let u=a,d=0,f=0,m=0,g=0;return this.legendItems.forEach((p,y)=>{const{itemWidth:x,itemHeight:_}=xf(n,e,r,p,i);y>0&&f+_+2*a>c&&(u+=d+a,h.push({width:d,height:f}),m+=d+a,g++,d=f=0),l[y]={left:m,top:f,col:g,width:x,height:_},d=Math.max(d,x),f+=_+a}),u+=d,h.push({width:d,height:f}),u}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:n,labels:{padding:i},rtl:r}}=this,o=Le(r,this.left,this.width);if(this.isHorizontal()){let a=0,l=tt(n,this.left+i,this.right-this.lineWidths[a]);for(const h of e)a!==h.row&&(a=h.row,l=tt(n,this.left+i,this.right-this.lineWidths[a])),h.top+=this.top+t+i,h.left=o.leftForLtr(o.x(l),h.width),l+=h.width+i}else{let a=0,l=tt(n,this.top+t+i,this.bottom-this.columnSizes[a].height);for(const h of e)h.col!==a&&(a=h.col,l=tt(n,this.top+t+i,this.bottom-this.columnSizes[a].height)),h.top=l,h.left+=this.left+i,h.left=o.leftForLtr(o.x(h.left),h.width),l+=h.height+i}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;wn(t,this),this._draw(),Mn(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:n,ctx:i}=this,{align:r,labels:o}=t,a=G.color,l=Le(t.rtl,this.left,this.width),h=K(o.font),{padding:c}=o,u=h.size,d=u/2;let f;this.drawTitle(),i.textAlign=l.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=h.string;const{boxWidth:m,boxHeight:g,itemHeight:p}=Gr(o,u),y=function(M,S,k){if(isNaN(m)||m<=0||isNaN(g)||g<0)return;i.save();const C=E(k.lineWidth,1);if(i.fillStyle=E(k.fillStyle,a),i.lineCap=E(k.lineCap,"butt"),i.lineDashOffset=E(k.lineDashOffset,0),i.lineJoin=E(k.lineJoin,"miter"),i.lineWidth=C,i.strokeStyle=E(k.strokeStyle,a),i.setLineDash(E(k.lineDash,[])),o.usePointStyle){const O={radius:g*Math.SQRT2/2,pointStyle:k.pointStyle,rotation:k.rotation,borderWidth:C},R=l.xPlus(M,m/2),F=S+d;ia(i,O,R,F,o.pointStyleWidth&&m)}else{const O=S+Math.max((u-g)/2,0),R=l.leftForLtr(M,m),F=fe(k.borderRadius);i.beginPath(),Object.values(F).some(ut=>ut!==0)?_s(i,{x:R,y:O,w:m,h:g,radius:F}):i.rect(R,O,m,g),i.fill(),C!==0&&i.stroke()}i.restore()},x=function(M,S,k){_e(i,k.text,M,S+p/2,h,{strikethrough:k.hidden,textAlign:l.textAlign(k.textAlign)})},_=this.isHorizontal(),b=this._computeTitleHeight();_?f={x:tt(r,this.left+c,this.right-n[0]),y:this.top+c+b,line:0}:f={x:this.left+c,y:tt(r,this.top+b+c,this.bottom-e[0].height),line:0},fa(this.ctx,t.textDirection);const v=p+c;this.legendItems.forEach((M,S)=>{i.strokeStyle=M.fontColor,i.fillStyle=M.fontColor;const k=i.measureText(M.text).width,C=l.textAlign(M.textAlign||(M.textAlign=o.textAlign)),O=m+d+k;let R=f.x,F=f.y;l.setWidth(this.width),_?S>0&&R+O+c>this.right&&(F=f.y+=v,f.line++,R=f.x=tt(r,this.left+c,this.right-n[f.line])):S>0&&F+v>this.bottom&&(R=f.x=R+e[f.line].width+c,f.line++,F=f.y=tt(r,this.top+b+c,this.bottom-e[f.line].height));const ut=l.x(R);if(y(ut,F,M),R=jh(C,R+m+d,_?R+O:this.right,t.rtl),x(l.x(R),F,M),_)f.x+=O+c;else if(typeof M.text!="string"){const dt=h.lineHeight;f.y+=Wa(M,dt)}else f.y+=v}),ma(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,n=K(e.font),i=nt(e.padding);if(!e.display)return;const r=Le(t.rtl,this.left,this.width),o=this.ctx,a=e.position,l=n.size/2,h=i.top+l;let c,u=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),c=this.top+h,u=tt(t.align,u,this.right-d);else{const m=this.columnSizes.reduce((g,p)=>Math.max(g,p.height),0);c=h+tt(t.align,this.top,this.bottom-m-t.labels.padding-this._computeTitleHeight())}const f=tt(a,u,u+d);o.textAlign=r.textAlign(Di(a)),o.textBaseline="middle",o.strokeStyle=e.color,o.fillStyle=e.color,o.font=n.string,_e(o,e.text,f,c,n)}_computeTitleHeight(){const t=this.options.title,e=K(t.font),n=nt(t.padding);return t.display?e.lineHeight+n.height:0}_getLegendItemAt(t,e){let n,i,r;if(Wt(t,this.left,this.right)&&Wt(e,this.top,this.bottom)){for(r=this.legendHitBoxes,n=0;n<r.length;++n)if(i=r[n],Wt(t,i.left,i.left+i.width)&&Wt(e,i.top,i.top+i.height))return this.legendItems[n]}return null}handleEvent(t){const e=this.options;if(!wf(t.type,e))return;const n=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const i=this._hoveredItem,r=bf(i,n);i&&!r&&W(e.onLeave,[t,i,this],this),this._hoveredItem=n,n&&!r&&W(e.onHover,[t,n,this],this)}else n&&W(e.onClick,[t,n,this],this)}}function xf(s,t,e,n,i){const r=vf(n,s,t,e),o=_f(i,n,t.lineHeight);return{itemWidth:r,itemHeight:o}}function vf(s,t,e,n){let i=s.text;return i&&typeof i!="string"&&(i=i.reduce((r,o)=>r.length>o.length?r:o)),t+e.size/2+n.measureText(i).width}function _f(s,t,e){let n=s;return typeof t.text!="string"&&(n=Wa(t,e)),n}function Wa(s,t){const e=s.text?s.text.length+.5:0;return t*e}function wf(s,t){return!!((s==="mousemove"||s==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(s==="click"||s==="mouseup"))}var Mf={id:"legend",_element:Jr,start(s,t,e){const n=s.legend=new Jr({ctx:s.ctx,options:e,chart:s});st.configure(s,n,e),st.addBox(s,n)},stop(s){st.removeBox(s,s.legend),delete s.legend},beforeUpdate(s,t,e){const n=s.legend;st.configure(s,n,e),n.options=e},afterUpdate(s){const t=s.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(s,t){t.replay||s.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(s,t,e){const n=t.datasetIndex,i=e.chart;i.isDatasetVisible(n)?(i.hide(n),t.hidden=!0):(i.show(n),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:s=>s.chart.options.color,boxWidth:40,padding:10,generateLabels(s){const t=s.data.datasets,{labels:{usePointStyle:e,pointStyle:n,textAlign:i,color:r,useBorderRadius:o,borderRadius:a}}=s.legend.options;return s._getSortedDatasetMetas().map(l=>{const h=l.controller.getStyle(e?0:void 0),c=nt(h.borderWidth);return{text:t[l.index].label,fillStyle:h.backgroundColor,fontColor:r,hidden:!l.visible,lineCap:h.borderCapStyle,lineDash:h.borderDash,lineDashOffset:h.borderDashOffset,lineJoin:h.borderJoinStyle,lineWidth:(c.width+c.height)/4,strokeStyle:h.borderColor,pointStyle:n||h.pointStyle,rotation:h.rotation,textAlign:i||h.textAlign,borderRadius:o&&(a||h.borderRadius),datasetIndex:l.index}},this)}},title:{color:s=>s.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:s=>!s.startsWith("on"),labels:{_scriptable:s=>!["generateLabels","filter","sort"].includes(s)}}};class Ni extends At{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 n=this.options;if(this.left=0,this.top=0,!n.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const i=$(n.text)?n.text.length:1;this._padding=nt(n.padding);const r=i*K(n.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:n,bottom:i,right:r,options:o}=this,a=o.align;let l=0,h,c,u;return this.isHorizontal()?(c=tt(a,n,r),u=e+t,h=r-n):(o.position==="left"?(c=n+t,u=tt(a,i,e),l=q*-.5):(c=r-t,u=tt(a,e,i),l=q*.5),h=i-e),{titleX:c,titleY:u,maxWidth:h,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const n=K(e.font),i=n.lineHeight/2+this._padding.top,{titleX:r,titleY:o,maxWidth:a,rotation:l}=this._drawArgs(i);_e(t,e.text,0,0,n,{color:e.color,maxWidth:a,rotation:l,textAlign:Di(e.align),textBaseline:"middle",translation:[r,o]})}}function kf(s,t){const e=new Ni({ctx:s.ctx,options:t,chart:s});st.configure(s,e,t),st.addBox(s,e),s.titleBlock=e}var Sf={id:"title",_element:Ni,start(s,t,e){kf(s,e)},stop(s){const t=s.titleBlock;st.removeBox(s,t),delete s.titleBlock},beforeUpdate(s,t,e){const n=s.titleBlock;st.configure(s,n,e),n.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 Hs=new WeakMap;var Tf={id:"subtitle",start(s,t,e){const n=new Ni({ctx:s.ctx,options:e,chart:s});st.configure(s,n,e),st.addBox(s,n),Hs.set(s,n)},stop(s){st.removeBox(s,Hs.get(s)),Hs.delete(s)},beforeUpdate(s,t,e){const n=Hs.get(s);st.configure(s,n,e),n.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 gs={average(s){if(!s.length)return!1;let t,e,n=0,i=0,r=0;for(t=0,e=s.length;t<e;++t){const o=s[t].element;if(o&&o.hasValue()){const a=o.tooltipPosition();n+=a.x,i+=a.y,++r}}return{x:n/r,y:i/r}},nearest(s,t){if(!s.length)return!1;let e=t.x,n=t.y,i=Number.POSITIVE_INFINITY,r,o,a;for(r=0,o=s.length;r<o;++r){const l=s[r].element;if(l&&l.hasValue()){const h=l.getCenterPoint(),c=ei(t,h);c<i&&(i=c,a=l)}}if(a){const l=a.tooltipPosition();e=l.x,n=l.y}return{x:e,y:n}}};function It(s,t){return t&&($(t)?Array.prototype.push.apply(s,t):s.push(t)),s}function Vt(s){return(typeof s=="string"||s instanceof String)&&s.indexOf(`
|
|
17
|
-
`)>-1?s.split(`
|
|
18
|
-
`):s}function Df(s,t){const{element:e,datasetIndex:n,index:i}=t,r=s.getDatasetMeta(n).controller,{label:o,value:a}=r.getLabelAndValue(i);return{chart:s,label:o,parsed:r.getParsed(i),raw:s.data.datasets[n].data[i],formattedValue:a,dataset:r.getDataset(),dataIndex:i,datasetIndex:n,element:e}}function Xr(s,t){const e=s.chart.ctx,{body:n,footer:i,title:r}=s,{boxWidth:o,boxHeight:a}=t,l=K(t.bodyFont),h=K(t.titleFont),c=K(t.footerFont),u=r.length,d=i.length,f=n.length,m=nt(t.padding);let g=m.height,p=0,y=n.reduce((b,v)=>b+v.before.length+v.lines.length+v.after.length,0);if(y+=s.beforeBody.length+s.afterBody.length,u&&(g+=u*h.lineHeight+(u-1)*t.titleSpacing+t.titleMarginBottom),y){const b=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;g+=f*b+(y-f)*l.lineHeight+(y-1)*t.bodySpacing}d&&(g+=t.footerMarginTop+d*c.lineHeight+(d-1)*t.footerSpacing);let x=0;const _=function(b){p=Math.max(p,e.measureText(b).width+x)};return e.save(),e.font=h.string,z(s.title,_),e.font=l.string,z(s.beforeBody.concat(s.afterBody),_),x=t.displayColors?o+2+t.boxPadding:0,z(n,b=>{z(b.before,_),z(b.lines,_),z(b.after,_)}),x=0,e.font=c.string,z(s.footer,_),e.restore(),p+=m.width,{width:p,height:g}}function Of(s,t){const{y:e,height:n}=t;return e<n/2?"top":e>s.height-n/2?"bottom":"center"}function Ef(s,t,e,n){const{x:i,width:r}=n,o=e.caretSize+e.caretPadding;if(s==="left"&&i+r+o>t.width||s==="right"&&i-r-o<0)return!0}function Cf(s,t,e,n){const{x:i,width:r}=e,{width:o,chartArea:{left:a,right:l}}=s;let h="center";return n==="center"?h=i<=(a+l)/2?"left":"right":i<=r/2?h="left":i>=o-r/2&&(h="right"),Ef(h,s,t,e)&&(h="center"),h}function Kr(s,t,e){const n=e.yAlign||t.yAlign||Of(s,e);return{xAlign:e.xAlign||t.xAlign||Cf(s,t,e,n),yAlign:n}}function Af(s,t){let{x:e,width:n}=s;return t==="right"?e-=n:t==="center"&&(e-=n/2),e}function Pf(s,t,e){let{y:n,height:i}=s;return t==="top"?n+=e:t==="bottom"?n-=i+e:n-=i/2,n}function Qr(s,t,e,n){const{caretSize:i,caretPadding:r,cornerRadius:o}=s,{xAlign:a,yAlign:l}=e,h=i+r,{topLeft:c,topRight:u,bottomLeft:d,bottomRight:f}=fe(o);let m=Af(t,a);const g=Pf(t,l,h);return l==="center"?a==="left"?m+=h:a==="right"&&(m-=h):a==="left"?m-=Math.max(c,d)+i:a==="right"&&(m+=Math.max(u,f)+i),{x:Q(m,0,n.width-t.width),y:Q(g,0,n.height-t.height)}}function qs(s,t,e){const n=nt(e.padding);return t==="center"?s.x+s.width/2:t==="right"?s.x+s.width-n.right:s.x+n.left}function to(s){return It([],Vt(s))}function If(s,t,e){return ne(s,{tooltip:t,tooltipItems:e,type:"tooltip"})}function eo(s,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?s.override(e):s}const ja={beforeTitle:Rt,title(s){if(s.length>0){const t=s[0],e=t.chart.data.labels,n=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(n>0&&t.dataIndex<n)return e[t.dataIndex]}return""},afterTitle:Rt,beforeBody:Rt,beforeLabel:Rt,label(s){if(this&&this.options&&this.options.mode==="dataset")return s.label+": "+s.formattedValue||s.formattedValue;let t=s.dataset.label||"";t&&(t+=": ");const e=s.formattedValue;return N(e)||(t+=e),t},labelColor(s){const t=s.chart.getDatasetMeta(s.datasetIndex).controller.getStyle(s.dataIndex);return{borderColor:t.borderColor,backgroundColor:t.backgroundColor,borderWidth:t.borderWidth,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(s){const t=s.chart.getDatasetMeta(s.datasetIndex).controller.getStyle(s.dataIndex);return{pointStyle:t.pointStyle,rotation:t.rotation}},afterLabel:Rt,afterBody:Rt,beforeFooter:Rt,footer:Rt,afterFooter:Rt};function at(s,t,e,n){const i=s[t].call(e,n);return typeof i>"u"?ja[t].call(e,n):i}class hi extends At{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,n=this.options.setContext(this.getContext()),i=n.enabled&&e.options.animation&&n.animations,r=new ba(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=If(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:n}=e,i=at(n,"beforeTitle",this,t),r=at(n,"title",this,t),o=at(n,"afterTitle",this,t);let a=[];return a=It(a,Vt(i)),a=It(a,Vt(r)),a=It(a,Vt(o)),a}getBeforeBody(t,e){return to(at(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:n}=e,i=[];return z(t,r=>{const o={before:[],lines:[],after:[]},a=eo(n,r);It(o.before,Vt(at(a,"beforeLabel",this,r))),It(o.lines,at(a,"label",this,r)),It(o.after,Vt(at(a,"afterLabel",this,r))),i.push(o)}),i}getAfterBody(t,e){return to(at(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:n}=e,i=at(n,"beforeFooter",this,t),r=at(n,"footer",this,t),o=at(n,"afterFooter",this,t);let a=[];return a=It(a,Vt(i)),a=It(a,Vt(r)),a=It(a,Vt(o)),a}_createItems(t){const e=this._active,n=this.chart.data,i=[],r=[],o=[];let a=[],l,h;for(l=0,h=e.length;l<h;++l)a.push(Df(this.chart,e[l]));return t.filter&&(a=a.filter((c,u,d)=>t.filter(c,u,d,n))),t.itemSort&&(a=a.sort((c,u)=>t.itemSort(c,u,n))),z(a,c=>{const u=eo(t.callbacks,c);i.push(at(u,"labelColor",this,c)),r.push(at(u,"labelPointStyle",this,c)),o.push(at(u,"labelTextColor",this,c))}),this.labelColors=i,this.labelPointStyles=r,this.labelTextColors=o,this.dataPoints=a,a}update(t,e){const n=this.options.setContext(this.getContext()),i=this._active;let r,o=[];if(!i.length)this.opacity!==0&&(r={opacity:0});else{const a=gs[n.position].call(this,i,this._eventPosition);o=this._createItems(n),this.title=this.getTitle(o,n),this.beforeBody=this.getBeforeBody(o,n),this.body=this.getBody(o,n),this.afterBody=this.getAfterBody(o,n),this.footer=this.getFooter(o,n);const l=this._size=Xr(this,n),h=Object.assign({},a,l),c=Kr(this.chart,n,h),u=Qr(n,h,c,this.chart);this.xAlign=c.xAlign,this.yAlign=c.yAlign,r={opacity:1,x:u.x,y:u.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=o,this.$context=void 0,r&&this._resolveAnimations().update(this,r),t&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,n,i){const r=this.getCaretPosition(t,n,i);e.lineTo(r.x1,r.y1),e.lineTo(r.x2,r.y2),e.lineTo(r.x3,r.y3)}getCaretPosition(t,e,n){const{xAlign:i,yAlign:r}=this,{caretSize:o,cornerRadius:a}=n,{topLeft:l,topRight:h,bottomLeft:c,bottomRight:u}=fe(a),{x:d,y:f}=t,{width:m,height:g}=e;let p,y,x,_,b,v;return r==="center"?(b=f+g/2,i==="left"?(p=d,y=p-o,_=b+o,v=b-o):(p=d+m,y=p+o,_=b-o,v=b+o),x=p):(i==="left"?y=d+Math.max(l,c)+o:i==="right"?y=d+m-Math.max(h,u)-o:y=this.caretX,r==="top"?(_=f,b=_-o,p=y-o,x=y+o):(_=f+g,b=_+o,p=y+o,x=y-o),v=_),{x1:p,x2:y,x3:x,y1:_,y2:b,y3:v}}drawTitle(t,e,n){const i=this.title,r=i.length;let o,a,l;if(r){const h=Le(n.rtl,this.x,this.width);for(t.x=qs(this,n.titleAlign,n),e.textAlign=h.textAlign(n.titleAlign),e.textBaseline="middle",o=K(n.titleFont),a=n.titleSpacing,e.fillStyle=n.titleColor,e.font=o.string,l=0;l<r;++l)e.fillText(i[l],h.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+a,l+1===r&&(t.y+=n.titleMarginBottom-a)}}_drawColorBox(t,e,n,i,r){const o=this.labelColors[n],a=this.labelPointStyles[n],{boxHeight:l,boxWidth:h,boxPadding:c}=r,u=K(r.bodyFont),d=qs(this,"left",r),f=i.x(d),m=l<u.lineHeight?(u.lineHeight-l)/2:0,g=e.y+m;if(r.usePointStyle){const p={radius:Math.min(h,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},y=i.leftForLtr(f,h)+h/2,x=g+l/2;t.strokeStyle=r.multiKeyBackground,t.fillStyle=r.multiKeyBackground,ni(t,p,y,x),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,ni(t,p,y,x)}else{t.lineWidth=P(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,t.strokeStyle=o.borderColor,t.setLineDash(o.borderDash||[]),t.lineDashOffset=o.borderDashOffset||0;const p=i.leftForLtr(f,h-c),y=i.leftForLtr(i.xPlus(f,1),h-c-2),x=fe(o.borderRadius);Object.values(x).some(_=>_!==0)?(t.beginPath(),t.fillStyle=r.multiKeyBackground,_s(t,{x:p,y:g,w:h,h:l,radius:x}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),_s(t,{x:y,y:g+1,w:h-2,h:l-2,radius:x}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(p,g,h,l),t.strokeRect(p,g,h,l),t.fillStyle=o.backgroundColor,t.fillRect(y,g+1,h-2,l-2))}t.fillStyle=this.labelTextColors[n]}drawBody(t,e,n){const{body:i}=this,{bodySpacing:r,bodyAlign:o,displayColors:a,boxHeight:l,boxWidth:h,boxPadding:c}=n,u=K(n.bodyFont);let d=u.lineHeight,f=0;const m=Le(n.rtl,this.x,this.width),g=function(k){e.fillText(k,m.x(t.x+f),t.y+d/2),t.y+=d+r},p=m.textAlign(o);let y,x,_,b,v,M,S;for(e.textAlign=o,e.textBaseline="middle",e.font=u.string,t.x=qs(this,p,n),e.fillStyle=n.bodyColor,z(this.beforeBody,g),f=a&&p!=="right"?o==="center"?h/2+c:h+2+c:0,b=0,M=i.length;b<M;++b){for(y=i[b],x=this.labelTextColors[b],e.fillStyle=x,z(y.before,g),_=y.lines,a&&_.length&&(this._drawColorBox(e,t,b,m,n),d=Math.max(u.lineHeight,l)),v=0,S=_.length;v<S;++v)g(_[v]),d=u.lineHeight;z(y.after,g)}f=0,d=u.lineHeight,z(this.afterBody,g),t.y-=r}drawFooter(t,e,n){const i=this.footer,r=i.length;let o,a;if(r){const l=Le(n.rtl,this.x,this.width);for(t.x=qs(this,n.footerAlign,n),t.y+=n.footerMarginTop,e.textAlign=l.textAlign(n.footerAlign),e.textBaseline="middle",o=K(n.footerFont),e.fillStyle=n.footerColor,e.font=o.string,a=0;a<r;++a)e.fillText(i[a],l.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+n.footerSpacing}}drawBackground(t,e,n,i){const{xAlign:r,yAlign:o}=this,{x:a,y:l}=t,{width:h,height:c}=n,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:m}=fe(i.cornerRadius);e.fillStyle=i.backgroundColor,e.strokeStyle=i.borderColor,e.lineWidth=i.borderWidth,e.beginPath(),e.moveTo(a+u,l),o==="top"&&this.drawCaret(t,e,n,i),e.lineTo(a+h-d,l),e.quadraticCurveTo(a+h,l,a+h,l+d),o==="center"&&r==="right"&&this.drawCaret(t,e,n,i),e.lineTo(a+h,l+c-m),e.quadraticCurveTo(a+h,l+c,a+h-m,l+c),o==="bottom"&&this.drawCaret(t,e,n,i),e.lineTo(a+f,l+c),e.quadraticCurveTo(a,l+c,a,l+c-f),o==="center"&&r==="left"&&this.drawCaret(t,e,n,i),e.lineTo(a,l+u),e.quadraticCurveTo(a,l,a+u,l),e.closePath(),e.fill(),i.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,n=this.$animations,i=n&&n.x,r=n&&n.y;if(i||r){const o=gs[t.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=Xr(this,t),l=Object.assign({},o,this._size),h=Kr(e,t,l),c=Qr(t,l,h,e);(i._to!==c.x||r._to!==c.y)&&(this.xAlign=h.xAlign,this.yAlign=h.yAlign,this.width=a.width,this.height=a.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,c))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let n=this.opacity;if(!n)return;this._updateAnimationTarget(e);const i={width:this.width,height:this.height},r={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;const o=nt(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=n,this.drawBackground(r,t,i,e),fa(t,e.textDirection),r.y+=o.top,this.drawTitle(r,t,e),this.drawBody(r,t,e),this.drawFooter(r,t,e),ma(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const n=this._active,i=t.map(({datasetIndex:a,index:l})=>{const h=this.chart.getDatasetMeta(a);if(!h)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:h.data[l],index:l}}),r=!on(n,i),o=this._positionChanged(i,e);(r||o)&&(this._active=i,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,n=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const i=this.options,r=this._active||[],o=this._getActiveElements(t,r,e,n),a=this._positionChanged(o,t),l=e||!on(o,r)||a;return l&&(this._active=o,(i.enabled||i.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,n,i){const r=this.options;if(t.type==="mouseout")return[];if(!i)return e;const o=this.chart.getElementsAtEventForMode(t,r.mode,r,n);return r.reverse&&o.reverse(),o}_positionChanged(t,e){const{caretX:n,caretY:i,options:r}=this,o=gs[r.position].call(this,t,e);return o!==!1&&(n!==o.x||i!==o.y)}}w(hi,"positioners",gs);var $a={id:"tooltip",_element:hi,positioners:gs,afterInit(s,t,e){e&&(s.tooltip=new hi({chart:s,options:e}))},beforeUpdate(s,t,e){s.tooltip&&s.tooltip.initialize(e)},reset(s,t,e){s.tooltip&&s.tooltip.initialize(e)},afterDraw(s){const t=s.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(s.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(s.ctx),s.notifyPlugins("afterTooltipDraw",e)}},afterEvent(s,t){if(s.tooltip){const e=t.replay;s.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:(s,t)=>t.bodyFont.size,boxWidth:(s,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:ja},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:s=>s!=="filter"&&s!=="itemSort"&&s!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Lf=Object.freeze({__proto__:null,Colors:Ud,Decimation:Jd,Filler:yf,Legend:Mf,SubTitle:Tf,Title:Sf,Tooltip:$a});const Nf=(s,t,e,n)=>(typeof t=="string"?(e=s.push(t)-1,n.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function Rf(s,t,e,n){const i=s.indexOf(t);if(i===-1)return Nf(s,t,e,n);const r=s.lastIndexOf(t);return i!==r?e:i}const Ff=(s,t)=>s===null?null:Q(Math.round(s),0,t);function Ba(s){const t=this.getLabels();return s>=0&&s<t.length?t[s]:s}class ze extends Me{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const n=this.getLabels();for(const{index:i,label:r}of e)n[i]===r&&n.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(N(t))return null;const n=this.getLabels();return e=isFinite(e)&&n[e]===t?e:Rf(n,t,E(e,t),this._addedLabels),Ff(e,n.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:n,max:i}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(n=0),e||(i=this.getLabels().length-1)),this.min=n,this.max=i}buildTicks(){const t=this.min,e=this.max,n=this.options.offset,i=[];let r=this.getLabels();r=t===0&&e===r.length-1?r:r.slice(t,e+1),this._valueRange=Math.max(r.length-(n?0:1),1),this._startValue=this.min-(n?.5:0);for(let o=t;o<=e;o++)i.push({value:o});return i}getLabelForValue(t){return Ba.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}}w(ze,"id","category"),w(ze,"defaults",{ticks:{callback:Ba}});function Vf(s,t){const e=[],{bounds:n,step:i,min:r,max:o,precision:a,count:l,maxTicks:h,maxDigits:c,includeBounds:u}=s,d=i||1,f=h-1,{min:m,max:g}=t,p=!N(r),y=!N(o),x=!N(l),_=(g-m)/(c+1);let b=tr((g-m)/f/d)*d,v,M,S,k;if(b<1e-14&&!p&&!y)return[{value:m},{value:g}];k=Math.ceil(g/b)-Math.floor(m/b),k>f&&(b=tr(k*b/f/d)*d),N(a)||(v=Math.pow(10,a),b=Math.ceil(b*v)/v),n==="ticks"?(M=Math.floor(m/b)*b,S=Math.ceil(g/b)*b):(M=m,S=g),p&&y&&i&&Lh((o-r)/i,b/1e3)?(k=Math.round(Math.min((o-r)/b,h)),b=(o-r)/k,M=r,S=o):x?(M=p?r:M,S=y?o:S,k=l-1,b=(S-M)/k):(k=(S-M)/b,ds(k,Math.round(k),b/1e3)?k=Math.round(k):k=Math.ceil(k));const C=Math.max(er(b),er(M));v=Math.pow(10,N(a)?C:a),M=Math.round(M*v)/v,S=Math.round(S*v)/v;let O=0;for(p&&(u&&M!==r?(e.push({value:r}),M<r&&O++,ds(Math.round((M+O*b)*v)/v,r,so(r,_,s))&&O++):M<r&&O++);O<k;++O)e.push({value:Math.round((M+O*b)*v)/v});return y&&u&&S!==o?e.length&&ds(e[e.length-1].value,o,so(o,_,s))?e[e.length-1].value=o:e.push({value:o}):(!y||S===o)&&e.push({value:S}),e}function so(s,t,{horizontal:e,minRotation:n}){const i=Ot(n),r=(e?Math.sin(i):Math.cos(i))||.001,o=.75*t*(""+s).length;return Math.min(t/r,o)}class pn extends Me{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 N(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:n}=this.getUserBounds();let{min:i,max:r}=this;const o=l=>i=e?i:l,a=l=>r=n?r:l;if(t){const l=Lt(i),h=Lt(r);l<0&&h<0?a(0):l>0&&h>0&&o(0)}if(i===r){let l=r===0?1:Math.abs(r*.05);a(r+l),t||o(i-l)}this.min=i,this.max=r}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:n}=t,i;return n?(i=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,i>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${i} ticks. Limiting to 1000.`),i=1e3)):(i=this.computeTickLimit(),e=e||11),e&&(i=Math.min(e,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let n=this.getTickLimit();n=Math.max(2,n);const i={maxTicks:n,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},r=this._range||this,o=Vf(i,r);return t.bounds==="ticks"&&Yo(o,this,"value"),t.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const t=this.ticks;let e=this.min,n=this.max;if(super.configure(),this.options.offset&&t.length){const i=(n-e)/Math.max(t.length-1,1)/2;e-=i,n+=i}this._startValue=e,this._endValue=n,this._valueRange=n-e}getLabelForValue(t){return Ds(t,this.chart.options.locale,this.options.ticks.format)}}class we extends pn{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Z(t)?t:0,this.max=Z(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,n=Ot(this.options.ticks.minRotation),i=(t?Math.sin(n):Math.cos(n))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,r.lineHeight/i))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}w(we,"id","linear"),w(we,"defaults",{ticks:{callback:_n.formatters.numeric}});const Ms=s=>Math.floor(Jt(s)),ae=(s,t)=>Math.pow(10,Ms(s)+t);function no(s){return s/Math.pow(10,Ms(s))===1}function io(s,t,e){const n=Math.pow(10,e),i=Math.floor(s/n);return Math.ceil(t/n)-i}function zf(s,t){const e=t-s;let n=Ms(e);for(;io(s,t,n)>10;)n++;for(;io(s,t,n)<10;)n--;return Math.min(n,Ms(s))}function Wf(s,{min:t,max:e}){t=mt(s.min,t);const n=[],i=Ms(t);let r=zf(t,e),o=r<0?Math.pow(10,Math.abs(r)):1;const a=Math.pow(10,r),l=i>r?Math.pow(10,i):0,h=Math.round((t-l)*o)/o,c=Math.floor((t-l)/a/10)*a*10;let u=Math.floor((h-c)/Math.pow(10,r)),d=mt(s.min,Math.round((l+c+u*Math.pow(10,r))*o)/o);for(;d<e;)n.push({value:d,major:no(d),significand:u}),u>=10?u=u<15?15:20:u++,u>=20&&(r++,u=2,o=r>=0?1:o),d=Math.round((l+c+u*Math.pow(10,r))*o)/o;const f=mt(s.max,d);return n.push({value:f,major:no(f),significand:u}),n}class ci extends Me{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const n=pn.prototype.parse.apply(this,[t,e]);if(n===0){this._zero=!0;return}return Z(n)&&n>0?n:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Z(t)?Math.max(0,t):null,this.max=Z(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Z(this._userMin)&&(this.min=t===ae(this.min,0)?ae(this.min,-1):ae(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let n=this.min,i=this.max;const r=a=>n=t?n:a,o=a=>i=e?i:a;n===i&&(n<=0?(r(1),o(10)):(r(ae(n,-1)),o(ae(i,1)))),n<=0&&r(ae(i,-1)),i<=0&&o(ae(n,1)),this.min=n,this.max=i}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},n=Wf(e,this);return t.bounds==="ticks"&&Yo(n,this,"value"),t.reverse?(n.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),n}getLabelForValue(t){return t===void 0?"0":Ds(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Jt(t),this._valueRange=Jt(this.max)-Jt(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Jt(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}w(ci,"id","logarithmic"),w(ci,"defaults",{ticks:{callback:_n.formatters.logarithmic,major:{enabled:!0}}});function ui(s){const t=s.ticks;if(t.display&&s.display){const e=nt(t.backdropPadding);return E(t.font&&t.font.size,G.font.size)+e.height}return 0}function jf(s,t,e){return e=$(e)?e:[e],{w:Xh(s,t.string,e),h:e.length*t.lineHeight}}function ro(s,t,e,n,i){return s===n||s===i?{start:t-e/2,end:t+e/2}:s<n||s>i?{start:t-e,end:t}:{start:t,end:t+e}}function $f(s){const t={l:s.left+s._padding.left,r:s.right-s._padding.right,t:s.top+s._padding.top,b:s.bottom-s._padding.bottom},e=Object.assign({},t),n=[],i=[],r=s._pointLabels.length,o=s.options.pointLabels,a=o.centerPointLabels?q/r:0;for(let l=0;l<r;l++){const h=o.setContext(s.getPointLabelContext(l));i[l]=h.padding;const c=s.getPointPosition(l,s.drawingArea+i[l],a),u=K(h.font),d=jf(s.ctx,u,s._pointLabels[l]);n[l]=d;const f=gt(s.getIndexAngle(l)+a),m=Math.round(Si(f)),g=ro(m,c.x,d.w,0,180),p=ro(m,c.y,d.h,90,270);Bf(e,t,f,g,p)}s.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),s._pointLabelItems=Hf(s,n,i)}function Bf(s,t,e,n,i){const r=Math.abs(Math.sin(e)),o=Math.abs(Math.cos(e));let a=0,l=0;n.start<t.l?(a=(t.l-n.start)/r,s.l=Math.min(s.l,t.l-a)):n.end>t.r&&(a=(n.end-t.r)/r,s.r=Math.max(s.r,t.r+a)),i.start<t.t?(l=(t.t-i.start)/o,s.t=Math.min(s.t,t.t-l)):i.end>t.b&&(l=(i.end-t.b)/o,s.b=Math.max(s.b,t.b+l))}function Hf(s,t,e){const n=[],i=s._pointLabels.length,r=s.options,o=ui(r)/2,a=s.drawingArea,l=r.pointLabels.centerPointLabels?q/i:0;for(let h=0;h<i;h++){const c=s.getPointPosition(h,a+o+e[h],l),u=Math.round(Si(gt(c.angle+Y))),d=t[h],f=Zf(c.y,d.h,u),m=qf(u),g=Uf(c.x,d.w,m);n.push({x:c.x,y:f,textAlign:m,left:g,top:f,right:g+d.w,bottom:f+d.h})}return n}function qf(s){return s===0||s===180?"center":s<180?"left":"right"}function Uf(s,t,e){return e==="right"?s-=t:e==="center"&&(s-=t/2),s}function Zf(s,t,e){return e===90||e===270?s-=t/2:(e>270||e<90)&&(s-=t),s}function Yf(s,t){const{ctx:e,options:{pointLabels:n}}=s;for(let i=t-1;i>=0;i--){const r=n.setContext(s.getPointLabelContext(i)),o=K(r.font),{x:a,y:l,textAlign:h,left:c,top:u,right:d,bottom:f}=s._pointLabelItems[i],{backdropColor:m}=r;if(!N(m)){const g=fe(r.borderRadius),p=nt(r.backdropPadding);e.fillStyle=m;const y=c-p.left,x=u-p.top,_=d-c+p.width,b=f-u+p.height;Object.values(g).some(v=>v!==0)?(e.beginPath(),_s(e,{x:y,y:x,w:_,h:b,radius:g}),e.fill()):e.fillRect(y,x,_,b)}_e(e,s._pointLabels[i],a,l+o.lineHeight/2,o,{color:r.color,textAlign:h,textBaseline:"middle"})}}function Ha(s,t,e,n){const{ctx:i}=s;if(e)i.arc(s.xCenter,s.yCenter,t,0,B);else{let r=s.getPointPosition(0,t);i.moveTo(r.x,r.y);for(let o=1;o<n;o++)r=s.getPointPosition(o,t),i.lineTo(r.x,r.y)}}function Gf(s,t,e,n,i){const r=s.ctx,o=t.circular,{color:a,lineWidth:l}=t;!o&&!n||!a||!l||e<0||(r.save(),r.strokeStyle=a,r.lineWidth=l,r.setLineDash(i.dash),r.lineDashOffset=i.dashOffset,r.beginPath(),Ha(s,e,o,n),r.closePath(),r.stroke(),r.restore())}function Jf(s,t,e){return ne(s,{label:e,index:t,type:"pointLabel"})}class Ie extends pn{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=nt(ui(this.options)/2),e=this.width=this.maxWidth-t.width,n=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+n/2+t.top),this.drawingArea=Math.floor(Math.min(e,n)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=Z(t)&&!isNaN(t)?t:0,this.max=Z(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/ui(this.options))}generateTickLabels(t){pn.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,n)=>{const i=W(this.options.pointLabels.callback,[e,n],this);return i||i===0?i:""}).filter((e,n)=>this.chart.getDataVisibility(n))}fit(){const t=this.options;t.display&&t.pointLabels.display?$f(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,n,i){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((n-i)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,n,i))}getIndexAngle(t){const e=B/(this._pointLabels.length||1),n=this.options.startAngle||0;return gt(t*e+Ot(n))}getDistanceFromCenterForValue(t){if(N(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(N(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const n=e[t];return Jf(this.getContext(),t,n)}}getPointPosition(t,e,n=0){const i=this.getIndexAngle(t)-Y+n;return{x:Math.cos(i)*e+this.xCenter,y:Math.sin(i)*e+this.yCenter,angle:i}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:n,right:i,bottom:r}=this._pointLabelItems[t];return{left:e,top:n,right:i,bottom:r}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const n=this.ctx;n.save(),n.beginPath(),Ha(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),n.closePath(),n.fillStyle=t,n.fill(),n.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:n,grid:i,border:r}=e,o=this._pointLabels.length;let a,l,h;if(e.pointLabels.display&&Yf(this,o),i.display&&this.ticks.forEach((c,u)=>{if(u!==0){l=this.getDistanceFromCenterForValue(c.value);const d=this.getContext(u),f=i.setContext(d),m=r.setContext(d);Gf(this,f,l,o,m)}}),n.display){for(t.save(),a=o-1;a>=0;a--){const c=n.setContext(this.getPointLabelContext(a)),{color:u,lineWidth:d}=c;!d||!u||(t.lineWidth=d,t.strokeStyle=u,t.setLineDash(c.borderDash),t.lineDashOffset=c.borderDashOffset,l=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),h=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(h.x,h.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,n=e.ticks;if(!n.display)return;const i=this.getIndexAngle(0);let r,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(i),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&!e.reverse)return;const h=n.setContext(this.getContext(l)),c=K(h.font);if(r=this.getDistanceFromCenterForValue(this.ticks[l].value),h.showLabelBackdrop){t.font=c.string,o=t.measureText(a.label).width,t.fillStyle=h.backdropColor;const u=nt(h.backdropPadding);t.fillRect(-o/2-u.left,-r-c.size/2-u.top,o+u.width,c.size+u.height)}_e(t,a.label,0,-r,c,{color:h.color})}),t.restore()}drawTitle(){}}w(Ie,"id","radialLinear"),w(Ie,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:_n.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(s){return s},padding:5,centerPointLabels:!1}}),w(Ie,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),w(Ie,"descriptors",{angleLines:{_fallback:"grid"}});const Sn={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}},ht=Object.keys(Sn);function Xf(s,t){return s-t}function oo(s,t){if(N(t))return null;const e=s._adapter,{parser:n,round:i,isoWeekday:r}=s._parseOpts;let o=t;return typeof n=="function"&&(o=n(o)),Z(o)||(o=typeof n=="string"?e.parse(o,n):e.parse(o)),o===null?null:(i&&(o=i==="week"&&(Re(r)||r===!0)?e.startOf(o,"isoWeek",r):e.startOf(o,i)),+o)}function ao(s,t,e,n){const i=ht.length;for(let r=ht.indexOf(s);r<i-1;++r){const o=Sn[ht[r]],a=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((e-t)/(a*o.size))<=n)return ht[r]}return ht[i-1]}function Kf(s,t,e,n,i){for(let r=ht.length-1;r>=ht.indexOf(e);r--){const o=ht[r];if(Sn[o].common&&s._adapter.diff(i,n,o)>=t-1)return o}return ht[e?ht.indexOf(e):0]}function Qf(s){for(let t=ht.indexOf(s)+1,e=ht.length;t<e;++t)if(Sn[ht[t]].common)return ht[t]}function lo(s,t,e){if(!e)s[t]=!0;else if(e.length){const{lo:n,hi:i}=Ti(e,t),r=e[n]>=t?e[n]:e[i];s[r]=!0}}function tm(s,t,e,n){const i=s._adapter,r=+i.startOf(t[0].value,n),o=t[t.length-1].value;let a,l;for(a=r;a<=o;a=+i.add(a,1,n))l=e[a],l>=0&&(t[l].major=!0);return t}function ho(s,t,e){const n=[],i={},r=t.length;let o,a;for(o=0;o<r;++o)a=t[o],i[a]=o,n.push({value:a,major:!1});return r===0||!e?n:tm(s,n,i,e)}class ks extends Me{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const n=t.time||(t.time={}),i=this._adapter=new _a._date(t.adapters.date);i.init(e),us(n.displayFormats,i.formats()),this._parseOpts={parser:n.parser,round:n.round,isoWeekday:n.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:oo(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,n=t.time.unit||"day";let{min:i,max:r,minDefined:o,maxDefined:a}=this.getUserBounds();function l(h){!o&&!isNaN(h.min)&&(i=Math.min(i,h.min)),!a&&!isNaN(h.max)&&(r=Math.max(r,h.max))}(!o||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),i=Z(i)&&!isNaN(i)?i:+e.startOf(Date.now(),n),r=Z(r)&&!isNaN(r)?r:+e.endOf(Date.now(),n)+1,this.min=Math.min(i,r-1),this.max=Math.max(i+1,r)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],n=t[t.length-1]),{min:e,max:n}}buildTicks(){const t=this.options,e=t.time,n=t.ticks,i=n.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&i.length&&(this.min=this._userMin||i[0],this.max=this._userMax||i[i.length-1]);const r=this.min,o=this.max,a=Vh(i,r,o);return this._unit=e.unit||(n.autoSkip?ao(e.minUnit,this.min,this.max,this._getLabelCapacity(r)):Kf(this,a.length,e.minUnit,this.min,this.max)),this._majorUnit=!n.major.enabled||this._unit==="year"?void 0:Qf(this._unit),this.initOffsets(i),t.reverse&&a.reverse(),ho(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,n=0,i,r;this.options.offset&&t.length&&(i=this.getDecimalForValue(t[0]),t.length===1?e=1-i:e=(this.getDecimalForValue(t[1])-i)/2,r=this.getDecimalForValue(t[t.length-1]),t.length===1?n=r:n=(r-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;e=Q(e,0,o),n=Q(n,0,o),this._offsets={start:e,end:n,factor:1/(e+1+n)}}_generate(){const t=this._adapter,e=this.min,n=this.max,i=this.options,r=i.time,o=r.unit||ao(r.minUnit,e,n,this._getLabelCapacity(e)),a=E(i.ticks.stepSize,1),l=o==="week"?r.isoWeekday:!1,h=Re(l)||l===!0,c={};let u=e,d,f;if(h&&(u=+t.startOf(u,"isoWeek",l)),u=+t.startOf(u,h?"day":o),t.diff(n,e,o)>1e5*a)throw new Error(e+" and "+n+" are too far apart with stepSize of "+a+" "+o);const m=i.ticks.source==="data"&&this.getDataTimestamps();for(d=u,f=0;d<n;d=+t.add(d,a,o),f++)lo(c,d,m);return(d===n||i.bounds==="ticks"||f===1)&&lo(c,d,m),Object.keys(c).sort((g,p)=>g-p).map(g=>+g)}getLabelForValue(t){const e=this._adapter,n=this.options.time;return n.tooltipFormat?e.format(t,n.tooltipFormat):e.format(t,n.displayFormats.datetime)}format(t,e){const n=this.options.time.displayFormats,i=this._unit,r=e||n[i];return this._adapter.format(t,r)}_tickFormatFunction(t,e,n,i){const r=this.options,o=r.ticks.callback;if(o)return W(o,[t,e,n],this);const a=r.time.displayFormats,l=this._unit,h=this._majorUnit,c=l&&a[l],u=h&&a[h],d=n[e],f=h&&u&&d&&d.major;return this._adapter.format(t,i||(f?u:c))}generateTickLabels(t){let e,n,i;for(e=0,n=t.length;e<n;++e)i=t[e],i.label=this._tickFormatFunction(i.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,n=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+n)*e.factor)}getValueForPixel(t){const e=this._offsets,n=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+n*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,n=this.ctx.measureText(t).width,i=Ot(this.isHorizontal()?e.maxRotation:e.minRotation),r=Math.cos(i),o=Math.sin(i),a=this._resolveTickFontOptions(0).size;return{w:n*r+a*o,h:n*o+a*r}}_getLabelCapacity(t){const e=this.options.time,n=e.displayFormats,i=n[e.unit]||n.millisecond,r=this._tickFormatFunction(t,0,ho(this,[t],this._majorUnit),i),o=this._getLabelSize(r),a=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],e,n;if(t.length)return t;const i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(e=0,n=i.length;e<n;++e)t=t.concat(i[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,n;if(t.length)return t;const i=this.getLabels();for(e=0,n=i.length;e<n;++e)t.push(oo(this,i[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Xo(t.sort(Xf))}}w(ks,"id","time"),w(ks,"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 Us(s,t,e){let n=0,i=s.length-1,r,o,a,l;e?(t>=s[n].pos&&t<=s[i].pos&&({lo:n,hi:i}=jt(s,"pos",t)),{pos:r,time:a}=s[n],{pos:o,time:l}=s[i]):(t>=s[n].time&&t<=s[i].time&&({lo:n,hi:i}=jt(s,"time",t)),{time:r,pos:a}=s[n],{time:o,pos:l}=s[i]);const h=o-r;return h?a+(l-a)*(t-r)/h:a}class di extends ks{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=Us(e,this.min),this._tableRange=Us(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:n}=this,i=[],r=[];let o,a,l,h,c;for(o=0,a=t.length;o<a;++o)h=t[o],h>=e&&h<=n&&i.push(h);if(i.length<2)return[{time:e,pos:0},{time:n,pos:1}];for(o=0,a=i.length;o<a;++o)c=i[o+1],l=i[o-1],h=i[o],Math.round((c+l)/2)!==h&&r.push({time:h,pos:o/(a-1)});return r}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),n=this.getLabelTimestamps();return e.length&&n.length?t=this.normalize(e.concat(n)):t=e.length?e:n,t=this._cache.all=t,t}getDecimalForValue(t){return(Us(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,n=this.getDecimalForPixel(t)/e.factor-e.end;return Us(this._table,n*this._tableRange+this._minPos,!0)}}w(di,"id","timeseries"),w(di,"defaults",ks.defaults);var em=Object.freeze({__proto__:null,CategoryScale:ze,LinearScale:we,LogarithmicScale:ci,RadialLinearScale:Ie,TimeScale:ks,TimeSeriesScale:di});const sm=[du,Wd,Lf,em];lt.register(...sm);class ke extends Error{}class nm extends ke{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}}class im extends ke{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}}class rm extends ke{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}}class cs extends ke{}class qa extends ke{constructor(t){super(`Invalid unit ${t}`)}}class _t extends ke{}class qt extends ke{constructor(){super("Zone is an abstract class")}}const T="numeric",Pt="short",pt="long",yn={year:T,month:T,day:T},Ua={year:T,month:Pt,day:T},om={year:T,month:Pt,day:T,weekday:Pt},Za={year:T,month:pt,day:T},Ya={year:T,month:pt,day:T,weekday:pt},Ga={hour:T,minute:T},Ja={hour:T,minute:T,second:T},Xa={hour:T,minute:T,second:T,timeZoneName:Pt},Ka={hour:T,minute:T,second:T,timeZoneName:pt},Qa={hour:T,minute:T,hourCycle:"h23"},tl={hour:T,minute:T,second:T,hourCycle:"h23"},el={hour:T,minute:T,second:T,hourCycle:"h23",timeZoneName:Pt},sl={hour:T,minute:T,second:T,hourCycle:"h23",timeZoneName:pt},nl={year:T,month:T,day:T,hour:T,minute:T},il={year:T,month:T,day:T,hour:T,minute:T,second:T},rl={year:T,month:Pt,day:T,hour:T,minute:T},ol={year:T,month:Pt,day:T,hour:T,minute:T,second:T},am={year:T,month:Pt,day:T,weekday:Pt,hour:T,minute:T},al={year:T,month:pt,day:T,hour:T,minute:T,timeZoneName:Pt},ll={year:T,month:pt,day:T,hour:T,minute:T,second:T,timeZoneName:Pt},hl={year:T,month:pt,day:T,weekday:pt,hour:T,minute:T,timeZoneName:pt},cl={year:T,month:pt,day:T,weekday:pt,hour:T,minute:T,second:T,timeZoneName:pt};class Es{get type(){throw new qt}get name(){throw new qt}get ianaName(){return this.name}get isUniversal(){throw new qt}offsetName(t,e){throw new qt}formatOffset(t,e){throw new qt}offset(t){throw new qt}equals(t){throw new qt}get isValid(){throw new qt}}let Zn=null;class Tn extends Es{static get instance(){return Zn===null&&(Zn=new Tn),Zn}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:e,locale:n}){return dl(t,e,n)}formatOffset(t,e){return ys(this.offset(t),e)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return t.type==="system"}get isValid(){return!0}}let sn={};function lm(s){return sn[s]||(sn[s]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:s,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),sn[s]}const hm={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function cm(s,t){const e=s.format(t).replace(/\u200E/g,""),n=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(e),[,i,r,o,a,l,h,c]=n;return[o,i,r,a,l,h,c]}function um(s,t){const e=s.formatToParts(t),n=[];for(let i=0;i<e.length;i++){const{type:r,value:o}=e[i],a=hm[r];r==="era"?n[a]=o:I(a)||(n[a]=parseInt(o,10))}return n}let Zs={};class Ht extends Es{static create(t){return Zs[t]||(Zs[t]=new Ht(t)),Zs[t]}static resetCache(){Zs={},sn={}}static isValidSpecifier(t){return this.isValidZone(t)}static isValidZone(t){if(!t)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:t}).format(),!0}catch{return!1}}constructor(t){super(),this.zoneName=t,this.valid=Ht.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:e,locale:n}){return dl(t,e,n,this.name)}formatOffset(t,e){return ys(this.offset(t),e)}offset(t){const e=new Date(t);if(isNaN(e))return NaN;const n=lm(this.name);let[i,r,o,a,l,h,c]=n.formatToParts?um(n,e):cm(n,e);a==="BC"&&(i=-Math.abs(i)+1);const u=Vi({year:i,month:r,day:o,hour:l===24?0:l,minute:h,second:c,millisecond:0});let d=+e;const f=d%1e3;return d-=f>=0?f:1e3+f,(u-d)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}}let co={};function dm(s,t={}){const e=JSON.stringify([s,t]);let n=co[e];return n||(n=new Intl.ListFormat(s,t),co[e]=n),n}let fi={};function mi(s,t={}){const e=JSON.stringify([s,t]);let n=fi[e];return n||(n=new Intl.DateTimeFormat(s,t),fi[e]=n),n}let gi={};function fm(s,t={}){const e=JSON.stringify([s,t]);let n=gi[e];return n||(n=new Intl.NumberFormat(s,t),gi[e]=n),n}let pi={};function mm(s,t={}){const{base:e,...n}=t,i=JSON.stringify([s,n]);let r=pi[i];return r||(r=new Intl.RelativeTimeFormat(s,t),pi[i]=r),r}let nn=null;function gm(){return nn||(nn=new Intl.DateTimeFormat().resolvedOptions().locale,nn)}function pm(s){const t=s.indexOf("-x-");t!==-1&&(s=s.substring(0,t));const e=s.indexOf("-u-");if(e===-1)return[s];{let n,i;try{n=mi(s).resolvedOptions(),i=s}catch{const a=s.substring(0,e);n=mi(a).resolvedOptions(),i=a}const{numberingSystem:r,calendar:o}=n;return[i,r,o]}}function ym(s,t,e){return(e||t)&&(s.includes("-u-")||(s+="-u"),e&&(s+=`-ca-${e}`),t&&(s+=`-nu-${t}`)),s}function bm(s){const t=[];for(let e=1;e<=12;e++){const n=D.utc(2016,e,1);t.push(s(n))}return t}function xm(s){const t=[];for(let e=1;e<=7;e++){const n=D.utc(2016,11,13+e);t.push(s(n))}return t}function Ys(s,t,e,n,i){const r=s.listingMode(e);return r==="error"?null:r==="en"?n(t):i(t)}function vm(s){return s.numberingSystem&&s.numberingSystem!=="latn"?!1:s.numberingSystem==="latn"||!s.locale||s.locale.startsWith("en")||new Intl.DateTimeFormat(s.intl).resolvedOptions().numberingSystem==="latn"}class _m{constructor(t,e,n){this.padTo=n.padTo||0,this.floor=n.floor||!1;const{padTo:i,floor:r,...o}=n;if(!e||Object.keys(o).length>0){const a={useGrouping:!1,...n};n.padTo>0&&(a.minimumIntegerDigits=n.padTo),this.inf=fm(t,a)}}format(t){if(this.inf){const e=this.floor?Math.floor(t):t;return this.inf.format(e)}else{const e=this.floor?Math.floor(t):Fi(t,3);return X(e,this.padTo)}}}class wm{constructor(t,e,n){this.opts=n,this.originalZone=void 0;let i;if(this.opts.timeZone)this.dt=t;else if(t.zone.type==="fixed"){const o=-1*(t.offset/60),a=o>=0?`Etc/GMT+${o}`:`Etc/GMT${o}`;t.offset!==0&&Ht.create(a).valid?(i=a,this.dt=t):(i="UTC",this.dt=t.offset===0?t:t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone)}else t.zone.type==="system"?this.dt=t:t.zone.type==="iana"?(this.dt=t,i=t.zone.name):(i="UTC",this.dt=t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone);const r={...this.opts};r.timeZone=r.timeZone||i,this.dtf=mi(e,r)}format(){return this.originalZone?this.formatToParts().map(({value:t})=>t).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const t=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?t.map(e=>{if(e.type==="timeZoneName"){const n=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...e,value:n}}else return e}):t}resolvedOptions(){return this.dtf.resolvedOptions()}}class Mm{constructor(t,e,n){this.opts={style:"long",...n},!e&&ul()&&(this.rtf=mm(t,n))}format(t,e){return this.rtf?this.rtf.format(t,e):Wm(e,t,this.opts.numeric,this.opts.style!=="long")}formatToParts(t,e){return this.rtf?this.rtf.formatToParts(t,e):[]}}class j{static fromOpts(t){return j.create(t.locale,t.numberingSystem,t.outputCalendar,t.defaultToEN)}static create(t,e,n,i=!1){const r=t||J.defaultLocale,o=r||(i?"en-US":gm()),a=e||J.defaultNumberingSystem,l=n||J.defaultOutputCalendar;return new j(o,a,l,r)}static resetCache(){nn=null,fi={},gi={},pi={}}static fromObject({locale:t,numberingSystem:e,outputCalendar:n}={}){return j.create(t,e,n)}constructor(t,e,n,i){const[r,o,a]=pm(t);this.locale=r,this.numberingSystem=e||o||null,this.outputCalendar=n||a||null,this.intl=ym(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=i,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=vm(this)),this.fastNumbersCached}listingMode(){const t=this.isEnglish(),e=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return t&&e?"en":"intl"}clone(t){return!t||Object.getOwnPropertyNames(t).length===0?this:j.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,t.defaultToEN||!1)}redefaultToEN(t={}){return this.clone({...t,defaultToEN:!0})}redefaultToSystem(t={}){return this.clone({...t,defaultToEN:!1})}months(t,e=!1,n=!0){return Ys(this,t,n,gl,()=>{const i=e?{month:t,day:"numeric"}:{month:t},r=e?"format":"standalone";return this.monthsCache[r][t]||(this.monthsCache[r][t]=bm(o=>this.extract(o,i,"month"))),this.monthsCache[r][t]})}weekdays(t,e=!1,n=!0){return Ys(this,t,n,bl,()=>{const i=e?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},r=e?"format":"standalone";return this.weekdaysCache[r][t]||(this.weekdaysCache[r][t]=xm(o=>this.extract(o,i,"weekday"))),this.weekdaysCache[r][t]})}meridiems(t=!0){return Ys(this,void 0,t,()=>xl,()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[D.utc(2016,11,13,9),D.utc(2016,11,13,19)].map(n=>this.extract(n,e,"dayperiod"))}return this.meridiemCache})}eras(t,e=!0){return Ys(this,t,e,vl,()=>{const n={era:t};return this.eraCache[t]||(this.eraCache[t]=[D.utc(-40,1,1),D.utc(2017,1,1)].map(i=>this.extract(i,n,"era"))),this.eraCache[t]})}extract(t,e,n){const i=this.dtFormatter(t,e),r=i.formatToParts(),o=r.find(a=>a.type.toLowerCase()===n);return o?o.value:null}numberFormatter(t={}){return new _m(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,e={}){return new wm(t,this.intl,e)}relFormatter(t={}){return new Mm(this.intl,this.isEnglish(),t)}listFormatter(t={}){return dm(this.intl,t)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}equals(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar}}let Yn=null;class ot extends Es{static get utcInstance(){return Yn===null&&(Yn=new ot(0)),Yn}static instance(t){return t===0?ot.utcInstance:new ot(t)}static parseSpecifier(t){if(t){const e=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(e)return new ot(On(e[1],e[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${ys(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${ys(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,e){return ys(this.fixed,e)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}}class km extends Es{constructor(t){super(),this.zoneName=t}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function Yt(s,t){if(I(s)||s===null)return t;if(s instanceof Es)return s;if(Sm(s)){const e=s.toLowerCase();return e==="default"?t:e==="local"||e==="system"?Tn.instance:e==="utc"||e==="gmt"?ot.utcInstance:ot.parseSpecifier(e)||Ht.create(s)}else return xe(s)?ot.instance(s):typeof s=="object"&&s.offset&&typeof s.offset=="number"?s:new km(s)}let uo=()=>Date.now(),fo="system",mo=null,go=null,po=null,yo=60,bo;class J{static get now(){return uo}static set now(t){uo=t}static set defaultZone(t){fo=t}static get defaultZone(){return Yt(fo,Tn.instance)}static get defaultLocale(){return mo}static set defaultLocale(t){mo=t}static get defaultNumberingSystem(){return go}static set defaultNumberingSystem(t){go=t}static get defaultOutputCalendar(){return po}static set defaultOutputCalendar(t){po=t}static get twoDigitCutoffYear(){return yo}static set twoDigitCutoffYear(t){yo=t%100}static get throwOnInvalid(){return bo}static set throwOnInvalid(t){bo=t}static resetCaches(){j.resetCache(),Ht.resetCache()}}function I(s){return typeof s>"u"}function xe(s){return typeof s=="number"}function Dn(s){return typeof s=="number"&&s%1===0}function Sm(s){return typeof s=="string"}function Tm(s){return Object.prototype.toString.call(s)==="[object Date]"}function ul(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function Dm(s){return Array.isArray(s)?s:[s]}function xo(s,t,e){if(s.length!==0)return s.reduce((n,i)=>{const r=[t(i),i];return n&&e(n[0],r[0])===n[0]?n:r},null)[1]}function Om(s,t){return t.reduce((e,n)=>(e[n]=s[n],e),{})}function We(s,t){return Object.prototype.hasOwnProperty.call(s,t)}function $t(s,t,e){return Dn(s)&&s>=t&&s<=e}function Em(s,t){return s-t*Math.floor(s/t)}function X(s,t=2){const e=s<0;let n;return e?n="-"+(""+-s).padStart(t,"0"):n=(""+s).padStart(t,"0"),n}function Zt(s){if(!(I(s)||s===null||s===""))return parseInt(s,10)}function le(s){if(!(I(s)||s===null||s===""))return parseFloat(s)}function Ri(s){if(!(I(s)||s===null||s==="")){const t=parseFloat("0."+s)*1e3;return Math.floor(t)}}function Fi(s,t,e=!1){const n=10**t;return(e?Math.trunc:Math.round)(s*n)/n}function Cs(s){return s%4===0&&(s%100!==0||s%400===0)}function ps(s){return Cs(s)?366:365}function bn(s,t){const e=Em(t-1,12)+1,n=s+(t-e)/12;return e===2?Cs(n)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][e-1]}function Vi(s){let t=Date.UTC(s.year,s.month-1,s.day,s.hour,s.minute,s.second,s.millisecond);return s.year<100&&s.year>=0&&(t=new Date(t),t.setUTCFullYear(s.year,s.month-1,s.day)),+t}function xn(s){const t=(s+Math.floor(s/4)-Math.floor(s/100)+Math.floor(s/400))%7,e=s-1,n=(e+Math.floor(e/4)-Math.floor(e/100)+Math.floor(e/400))%7;return t===4||n===3?53:52}function yi(s){return s>99?s:s>J.twoDigitCutoffYear?1900+s:2e3+s}function dl(s,t,e,n=null){const i=new Date(s),r={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};n&&(r.timeZone=n);const o={timeZoneName:t,...r},a=new Intl.DateTimeFormat(e,o).formatToParts(i).find(l=>l.type.toLowerCase()==="timezonename");return a?a.value:null}function On(s,t){let e=parseInt(s,10);Number.isNaN(e)&&(e=0);const n=parseInt(t,10)||0,i=e<0||Object.is(e,-0)?-n:n;return e*60+i}function fl(s){const t=Number(s);if(typeof s=="boolean"||s===""||Number.isNaN(t))throw new _t(`Invalid unit value ${s}`);return t}function vn(s,t){const e={};for(const n in s)if(We(s,n)){const i=s[n];if(i==null)continue;e[t(n)]=fl(i)}return e}function ys(s,t){const e=Math.trunc(Math.abs(s/60)),n=Math.trunc(Math.abs(s%60)),i=s>=0?"+":"-";switch(t){case"short":return`${i}${X(e,2)}:${X(n,2)}`;case"narrow":return`${i}${e}${n>0?`:${n}`:""}`;case"techie":return`${i}${X(e,2)}${X(n,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function En(s){return Om(s,["hour","minute","second","millisecond"])}const Cm=["January","February","March","April","May","June","July","August","September","October","November","December"],ml=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Am=["J","F","M","A","M","J","J","A","S","O","N","D"];function gl(s){switch(s){case"narrow":return[...Am];case"short":return[...ml];case"long":return[...Cm];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const pl=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],yl=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Pm=["M","T","W","T","F","S","S"];function bl(s){switch(s){case"narrow":return[...Pm];case"short":return[...yl];case"long":return[...pl];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const xl=["AM","PM"],Im=["Before Christ","Anno Domini"],Lm=["BC","AD"],Nm=["B","A"];function vl(s){switch(s){case"narrow":return[...Nm];case"short":return[...Lm];case"long":return[...Im];default:return null}}function Rm(s){return xl[s.hour<12?0:1]}function Fm(s,t){return bl(t)[s.weekday-1]}function Vm(s,t){return gl(t)[s.month-1]}function zm(s,t){return vl(t)[s.year<0?0:1]}function Wm(s,t,e="always",n=!1){const i={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},r=["hours","minutes","seconds"].indexOf(s)===-1;if(e==="auto"&&r){const u=s==="days";switch(t){case 1:return u?"tomorrow":`next ${i[s][0]}`;case-1:return u?"yesterday":`last ${i[s][0]}`;case 0:return u?"today":`this ${i[s][0]}`}}const o=Object.is(t,-0)||t<0,a=Math.abs(t),l=a===1,h=i[s],c=n?l?h[1]:h[2]||h[1]:l?i[s][0]:s;return o?`${a} ${c} ago`:`in ${a} ${c}`}function vo(s,t){let e="";for(const n of s)n.literal?e+=n.val:e+=t(n.val);return e}const jm={D:yn,DD:Ua,DDD:Za,DDDD:Ya,t:Ga,tt:Ja,ttt:Xa,tttt:Ka,T:Qa,TT:tl,TTT:el,TTTT:sl,f:nl,ff:rl,fff:al,ffff:hl,F:il,FF:ol,FFF:ll,FFFF:cl};class et{static create(t,e={}){return new et(t,e)}static parseFormat(t){let e=null,n="",i=!1;const r=[];for(let o=0;o<t.length;o++){const a=t.charAt(o);a==="'"?(n.length>0&&r.push({literal:i||/^\s+$/.test(n),val:n}),e=null,n="",i=!i):i||a===e?n+=a:(n.length>0&&r.push({literal:/^\s+$/.test(n),val:n}),n=a,e=a)}return n.length>0&&r.push({literal:i||/^\s+$/.test(n),val:n}),r}static macroTokenToFormatOpts(t){return jm[t]}constructor(t,e){this.opts=e,this.loc=t,this.systemLoc=null}formatWithSystemDefault(t,e){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(t,{...this.opts,...e}).format()}formatDateTime(t,e={}){return this.loc.dtFormatter(t,{...this.opts,...e}).format()}formatDateTimeParts(t,e={}){return this.loc.dtFormatter(t,{...this.opts,...e}).formatToParts()}formatInterval(t,e={}){return this.loc.dtFormatter(t.start,{...this.opts,...e}).dtf.formatRange(t.start.toJSDate(),t.end.toJSDate())}resolvedOptions(t,e={}){return this.loc.dtFormatter(t,{...this.opts,...e}).resolvedOptions()}num(t,e=0){if(this.opts.forceSimple)return X(t,e);const n={...this.opts};return e>0&&(n.padTo=e),this.loc.numberFormatter(n).format(t)}formatDateTimeFromString(t,e){const n=this.loc.listingMode()==="en",i=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",r=(f,m)=>this.loc.extract(t,f,m),o=f=>t.isOffsetFixed&&t.offset===0&&f.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,f.format):"",a=()=>n?Rm(t):r({hour:"numeric",hourCycle:"h12"},"dayperiod"),l=(f,m)=>n?Vm(t,f):r(m?{month:f}:{month:f,day:"numeric"},"month"),h=(f,m)=>n?Fm(t,f):r(m?{weekday:f}:{weekday:f,month:"long",day:"numeric"},"weekday"),c=f=>{const m=et.macroTokenToFormatOpts(f);return m?this.formatWithSystemDefault(t,m):f},u=f=>n?zm(t,f):r({era:f},"era"),d=f=>{switch(f){case"S":return this.num(t.millisecond);case"u":case"SSS":return this.num(t.millisecond,3);case"s":return this.num(t.second);case"ss":return this.num(t.second,2);case"uu":return this.num(Math.floor(t.millisecond/10),2);case"uuu":return this.num(Math.floor(t.millisecond/100));case"m":return this.num(t.minute);case"mm":return this.num(t.minute,2);case"h":return this.num(t.hour%12===0?12:t.hour%12);case"hh":return this.num(t.hour%12===0?12:t.hour%12,2);case"H":return this.num(t.hour);case"HH":return this.num(t.hour,2);case"Z":return o({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return o({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return o({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return t.zone.offsetName(t.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:this.loc.locale});case"z":return t.zoneName;case"a":return a();case"d":return i?r({day:"numeric"},"day"):this.num(t.day);case"dd":return i?r({day:"2-digit"},"day"):this.num(t.day,2);case"c":return this.num(t.weekday);case"ccc":return h("short",!0);case"cccc":return h("long",!0);case"ccccc":return h("narrow",!0);case"E":return this.num(t.weekday);case"EEE":return h("short",!1);case"EEEE":return h("long",!1);case"EEEEE":return h("narrow",!1);case"L":return i?r({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return i?r({month:"2-digit",day:"numeric"},"month"):this.num(t.month,2);case"LLL":return l("short",!0);case"LLLL":return l("long",!0);case"LLLLL":return l("narrow",!0);case"M":return i?r({month:"numeric"},"month"):this.num(t.month);case"MM":return i?r({month:"2-digit"},"month"):this.num(t.month,2);case"MMM":return l("short",!1);case"MMMM":return l("long",!1);case"MMMMM":return l("narrow",!1);case"y":return i?r({year:"numeric"},"year"):this.num(t.year);case"yy":return i?r({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return i?r({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return i?r({year:"numeric"},"year"):this.num(t.year,6);case"G":return u("short");case"GG":return u("long");case"GGGGG":return u("narrow");case"kk":return this.num(t.weekYear.toString().slice(-2),2);case"kkkk":return this.num(t.weekYear,4);case"W":return this.num(t.weekNumber);case"WW":return this.num(t.weekNumber,2);case"o":return this.num(t.ordinal);case"ooo":return this.num(t.ordinal,3);case"q":return this.num(t.quarter);case"qq":return this.num(t.quarter,2);case"X":return this.num(Math.floor(t.ts/1e3));case"x":return this.num(t.ts);default:return c(f)}};return vo(et.parseFormat(e),d)}formatDurationFromString(t,e){const n=l=>{switch(l[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},i=l=>h=>{const c=n(h);return c?this.num(l.get(c),h.length):h},r=et.parseFormat(e),o=r.reduce((l,{literal:h,val:c})=>h?l:l.concat(c),[]),a=t.shiftTo(...o.map(n).filter(l=>l));return vo(r,i(a))}}class Et{constructor(t,e){this.reason=t,this.explanation=e}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const _l=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function $e(...s){const t=s.reduce((e,n)=>e+n.source,"");return RegExp(`^${t}$`)}function Be(...s){return t=>s.reduce(([e,n,i],r)=>{const[o,a,l]=r(t,i);return[{...e,...o},a||n,l]},[{},null,1]).slice(0,2)}function He(s,...t){if(s==null)return[null,null];for(const[e,n]of t){const i=e.exec(s);if(i)return n(i)}return[null,null]}function wl(...s){return(t,e)=>{const n={};let i;for(i=0;i<s.length;i++)n[s[i]]=Zt(t[e+i]);return[n,null,e+i]}}const Ml=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,$m=`(?:${Ml.source}?(?:\\[(${_l.source})\\])?)?`,zi=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,kl=RegExp(`${zi.source}${$m}`),Wi=RegExp(`(?:T${kl.source})?`),Bm=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,Hm=/(\d{4})-?W(\d\d)(?:-?(\d))?/,qm=/(\d{4})-?(\d{3})/,Um=wl("weekYear","weekNumber","weekDay"),Zm=wl("year","ordinal"),Ym=/(\d{4})-(\d\d)-(\d\d)/,Sl=RegExp(`${zi.source} ?(?:${Ml.source}|(${_l.source}))?`),Gm=RegExp(`(?: ${Sl.source})?`);function Ne(s,t,e){const n=s[t];return I(n)?e:Zt(n)}function Jm(s,t){return[{year:Ne(s,t),month:Ne(s,t+1,1),day:Ne(s,t+2,1)},null,t+3]}function qe(s,t){return[{hours:Ne(s,t,0),minutes:Ne(s,t+1,0),seconds:Ne(s,t+2,0),milliseconds:Ri(s[t+3])},null,t+4]}function As(s,t){const e=!s[t]&&!s[t+1],n=On(s[t+1],s[t+2]),i=e?null:ot.instance(n);return[{},i,t+3]}function Ps(s,t){const e=s[t]?Ht.create(s[t]):null;return[{},e,t+1]}const Xm=RegExp(`^T?${zi.source}$`),Km=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function Qm(s){const[t,e,n,i,r,o,a,l,h]=s,c=t[0]==="-",u=l&&l[0]==="-",d=(f,m=!1)=>f!==void 0&&(m||f&&c)?-f:f;return[{years:d(le(e)),months:d(le(n)),weeks:d(le(i)),days:d(le(r)),hours:d(le(o)),minutes:d(le(a)),seconds:d(le(l),l==="-0"),milliseconds:d(Ri(h),u)}]}const tg={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function ji(s,t,e,n,i,r,o){const a={year:t.length===2?yi(Zt(t)):Zt(t),month:ml.indexOf(e)+1,day:Zt(n),hour:Zt(i),minute:Zt(r)};return o&&(a.second=Zt(o)),s&&(a.weekday=s.length>3?pl.indexOf(s)+1:yl.indexOf(s)+1),a}const eg=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function sg(s){const[,t,e,n,i,r,o,a,l,h,c,u]=s,d=ji(t,i,n,e,r,o,a);let f;return l?f=tg[l]:h?f=0:f=On(c,u),[d,new ot(f)]}function ng(s){return s.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const ig=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,rg=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,og=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function _o(s){const[,t,e,n,i,r,o,a]=s;return[ji(t,i,n,e,r,o,a),ot.utcInstance]}function ag(s){const[,t,e,n,i,r,o,a]=s;return[ji(t,a,e,n,i,r,o),ot.utcInstance]}const lg=$e(Bm,Wi),hg=$e(Hm,Wi),cg=$e(qm,Wi),ug=$e(kl),Tl=Be(Jm,qe,As,Ps),dg=Be(Um,qe,As,Ps),fg=Be(Zm,qe,As,Ps),mg=Be(qe,As,Ps);function gg(s){return He(s,[lg,Tl],[hg,dg],[cg,fg],[ug,mg])}function pg(s){return He(ng(s),[eg,sg])}function yg(s){return He(s,[ig,_o],[rg,_o],[og,ag])}function bg(s){return He(s,[Km,Qm])}const xg=Be(qe);function vg(s){return He(s,[Xm,xg])}const _g=$e(Ym,Gm),wg=$e(Sl),Mg=Be(qe,As,Ps);function kg(s){return He(s,[_g,Tl],[wg,Mg])}const Sg="Invalid Duration",Dl={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},Tg={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...Dl},vt=146097/400,Ae=146097/4800,Dg={years:{quarters:4,months:12,weeks:vt/7,days:vt,hours:vt*24,minutes:vt*24*60,seconds:vt*24*60*60,milliseconds:vt*24*60*60*1e3},quarters:{months:3,weeks:vt/28,days:vt/4,hours:vt*24/4,minutes:vt*24*60/4,seconds:vt*24*60*60/4,milliseconds:vt*24*60*60*1e3/4},months:{weeks:Ae/7,days:Ae,hours:Ae*24,minutes:Ae*24*60,seconds:Ae*24*60*60,milliseconds:Ae*24*60*60*1e3},...Dl},ue=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Og=ue.slice(0).reverse();function Ut(s,t,e=!1){const n={values:e?t.values:{...s.values,...t.values||{}},loc:s.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||s.conversionAccuracy,matrix:t.matrix||s.matrix};return new L(n)}function Eg(s){return s<0?Math.floor(s):Math.ceil(s)}function Ol(s,t,e,n,i){const r=s[i][e],o=t[e]/r,a=Math.sign(o)===Math.sign(n[i]),l=!a&&n[i]!==0&&Math.abs(o)<=1?Eg(o):Math.trunc(o);n[i]+=l,t[e]-=l*r}function Cg(s,t){Og.reduce((e,n)=>I(t[n])?e:(e&&Ol(s,t,e,t,n),n),null)}function Ag(s){const t={};for(const[e,n]of Object.entries(s))n!==0&&(t[e]=n);return t}class L{constructor(t){const e=t.conversionAccuracy==="longterm"||!1;let n=e?Dg:Tg;t.matrix&&(n=t.matrix),this.values=t.values,this.loc=t.loc||j.create(),this.conversionAccuracy=e?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=n,this.isLuxonDuration=!0}static fromMillis(t,e){return L.fromObject({milliseconds:t},e)}static fromObject(t,e={}){if(t==null||typeof t!="object")throw new _t(`Duration.fromObject: argument expected to be an object, got ${t===null?"null":typeof t}`);return new L({values:vn(t,L.normalizeUnit),loc:j.fromObject(e),conversionAccuracy:e.conversionAccuracy,matrix:e.matrix})}static fromDurationLike(t){if(xe(t))return L.fromMillis(t);if(L.isDuration(t))return t;if(typeof t=="object")return L.fromObject(t);throw new _t(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,e){const[n]=bg(t);return n?L.fromObject(n,e):L.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,e){const[n]=vg(t);return n?L.fromObject(n,e):L.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,e=null){if(!t)throw new _t("need to specify a reason the Duration is invalid");const n=t instanceof Et?t:new Et(t,e);if(J.throwOnInvalid)throw new rm(n);return new L({invalid:n})}static normalizeUnit(t){const e={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[t&&t.toLowerCase()];if(!e)throw new qa(t);return e}static isDuration(t){return t&&t.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(t,e={}){const n={...e,floor:e.round!==!1&&e.floor!==!1};return this.isValid?et.create(this.loc,n).formatDurationFromString(this,t):Sg}toHuman(t={}){const e=ue.map(n=>{const i=this.values[n];return I(i)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...t,unit:n.slice(0,-1)}).format(i)}).filter(n=>n);return this.loc.listFormatter({type:"conjunction",style:t.listStyle||"narrow",...t}).format(e)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let t="P";return this.years!==0&&(t+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(t+=this.months+this.quarters*3+"M"),this.weeks!==0&&(t+=this.weeks+"W"),this.days!==0&&(t+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(t+="T"),this.hours!==0&&(t+=this.hours+"H"),this.minutes!==0&&(t+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(t+=Fi(this.seconds+this.milliseconds/1e3,3)+"S"),t==="P"&&(t+="T0S"),t}toISOTime(t={}){if(!this.isValid)return null;const e=this.toMillis();if(e<0||e>=864e5)return null;t={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...t};const n=this.shiftTo("hours","minutes","seconds","milliseconds");let i=t.format==="basic"?"hhmm":"hh:mm";(!t.suppressSeconds||n.seconds!==0||n.milliseconds!==0)&&(i+=t.format==="basic"?"ss":":ss",(!t.suppressMilliseconds||n.milliseconds!==0)&&(i+=".SSS"));let r=n.toFormat(i);return t.includePrefix&&(r="T"+r),r}toJSON(){return this.toISO()}toString(){return this.toISO()}toMillis(){return this.as("milliseconds")}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;const e=L.fromDurationLike(t),n={};for(const i of ue)(We(e.values,i)||We(this.values,i))&&(n[i]=e.get(i)+this.get(i));return Ut(this,{values:n},!0)}minus(t){if(!this.isValid)return this;const e=L.fromDurationLike(t);return this.plus(e.negate())}mapUnits(t){if(!this.isValid)return this;const e={};for(const n of Object.keys(this.values))e[n]=fl(t(this.values[n],n));return Ut(this,{values:e},!0)}get(t){return this[L.normalizeUnit(t)]}set(t){if(!this.isValid)return this;const e={...this.values,...vn(t,L.normalizeUnit)};return Ut(this,{values:e})}reconfigure({locale:t,numberingSystem:e,conversionAccuracy:n,matrix:i}={}){const r={loc:this.loc.clone({locale:t,numberingSystem:e}),matrix:i,conversionAccuracy:n};return Ut(this,r)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;const t=this.toObject();return Cg(this.matrix,t),Ut(this,{values:t},!0)}rescale(){if(!this.isValid)return this;const t=Ag(this.normalize().shiftToAll().toObject());return Ut(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(t.length===0)return this;t=t.map(o=>L.normalizeUnit(o));const e={},n={},i=this.toObject();let r;for(const o of ue)if(t.indexOf(o)>=0){r=o;let a=0;for(const h in n)a+=this.matrix[h][o]*n[h],n[h]=0;xe(i[o])&&(a+=i[o]);const l=Math.trunc(a);e[o]=l,n[o]=(a*1e3-l*1e3)/1e3;for(const h in i)ue.indexOf(h)>ue.indexOf(o)&&Ol(this.matrix,i,h,e,o)}else xe(i[o])&&(n[o]=i[o]);for(const o in n)n[o]!==0&&(e[r]+=o===r?n[o]:n[o]/this.matrix[r][o]);return Ut(this,{values:e},!0).normalize()}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const t={};for(const e of Object.keys(this.values))t[e]=this.values[e]===0?0:-this.values[e];return Ut(this,{values:t},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(t){if(!this.isValid||!t.isValid||!this.loc.equals(t.loc))return!1;function e(n,i){return n===void 0||n===0?i===void 0||i===0:n===i}for(const n of ue)if(!e(this.values[n],t.values[n]))return!1;return!0}}const Pe="Invalid Interval";function Pg(s,t){return!s||!s.isValid?U.invalid("missing or invalid start"):!t||!t.isValid?U.invalid("missing or invalid end"):t<s?U.invalid("end before start",`The end of an interval must be after its start, but you had start=${s.toISO()} and end=${t.toISO()}`):null}class U{constructor(t){this.s=t.start,this.e=t.end,this.invalid=t.invalid||null,this.isLuxonInterval=!0}static invalid(t,e=null){if(!t)throw new _t("need to specify a reason the Interval is invalid");const n=t instanceof Et?t:new Et(t,e);if(J.throwOnInvalid)throw new im(n);return new U({invalid:n})}static fromDateTimes(t,e){const n=os(t),i=os(e);return Pg(n,i)??new U({start:n,end:i})}static after(t,e){const n=L.fromDurationLike(e),i=os(t);return U.fromDateTimes(i,i.plus(n))}static before(t,e){const n=L.fromDurationLike(e),i=os(t);return U.fromDateTimes(i.minus(n),i)}static fromISO(t,e){const[n,i]=(t||"").split("/",2);if(n&&i){let r,o;try{r=D.fromISO(n,e),o=r.isValid}catch{o=!1}let a,l;try{a=D.fromISO(i,e),l=a.isValid}catch{l=!1}if(o&&l)return U.fromDateTimes(r,a);if(o){const h=L.fromISO(i,e);if(h.isValid)return U.after(r,h)}else if(l){const h=L.fromISO(n,e);if(h.isValid)return U.before(a,h)}}return U.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static isInterval(t){return t&&t.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(t="milliseconds"){return this.isValid?this.toDuration(t).get(t):NaN}count(t="milliseconds"){if(!this.isValid)return NaN;const e=this.start.startOf(t),n=this.end.startOf(t);return Math.floor(n.diff(e,t).get(t))+(n.valueOf()!==this.end.valueOf())}hasSame(t){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,t):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(t){return this.isValid?this.s>t:!1}isBefore(t){return this.isValid?this.e<=t:!1}contains(t){return this.isValid?this.s<=t&&this.e>t:!1}set({start:t,end:e}={}){return this.isValid?U.fromDateTimes(t||this.s,e||this.e):this}splitAt(...t){if(!this.isValid)return[];const e=t.map(os).filter(o=>this.contains(o)).sort(),n=[];let{s:i}=this,r=0;for(;i<this.e;){const o=e[r]||this.e,a=+o>+this.e?this.e:o;n.push(U.fromDateTimes(i,a)),i=a,r+=1}return n}splitBy(t){const e=L.fromDurationLike(t);if(!this.isValid||!e.isValid||e.as("milliseconds")===0)return[];let{s:n}=this,i=1,r;const o=[];for(;n<this.e;){const a=this.start.plus(e.mapUnits(l=>l*i));r=+a>+this.e?this.e:a,o.push(U.fromDateTimes(n,r)),n=r,i+=1}return o}divideEqually(t){return this.isValid?this.splitBy(this.length()/t).slice(0,t):[]}overlaps(t){return this.e>t.s&&this.s<t.e}abutsStart(t){return this.isValid?+this.e==+t.s:!1}abutsEnd(t){return this.isValid?+t.e==+this.s:!1}engulfs(t){return this.isValid?this.s<=t.s&&this.e>=t.e:!1}equals(t){return!this.isValid||!t.isValid?!1:this.s.equals(t.s)&&this.e.equals(t.e)}intersection(t){if(!this.isValid)return this;const e=this.s>t.s?this.s:t.s,n=this.e<t.e?this.e:t.e;return e>=n?null:U.fromDateTimes(e,n)}union(t){if(!this.isValid)return this;const e=this.s<t.s?this.s:t.s,n=this.e>t.e?this.e:t.e;return U.fromDateTimes(e,n)}static merge(t){const[e,n]=t.sort((i,r)=>i.s-r.s).reduce(([i,r],o)=>r?r.overlaps(o)||r.abutsStart(o)?[i,r.union(o)]:[i.concat([r]),o]:[i,o],[[],null]);return n&&e.push(n),e}static xor(t){let e=null,n=0;const i=[],r=t.map(l=>[{time:l.s,type:"s"},{time:l.e,type:"e"}]),o=Array.prototype.concat(...r),a=o.sort((l,h)=>l.time-h.time);for(const l of a)n+=l.type==="s"?1:-1,n===1?e=l.time:(e&&+e!=+l.time&&i.push(U.fromDateTimes(e,l.time)),e=null);return U.merge(i)}difference(...t){return U.xor([this].concat(t)).map(e=>this.intersection(e)).filter(e=>e&&!e.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Pe}toLocaleString(t=yn,e={}){return this.isValid?et.create(this.s.loc.clone(e),t).formatInterval(this):Pe}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:Pe}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Pe}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:Pe}toFormat(t,{separator:e=" – "}={}){return this.isValid?`${this.s.toFormat(t)}${e}${this.e.toFormat(t)}`:Pe}toDuration(t,e){return this.isValid?this.e.diff(this.s,t,e):L.invalid(this.invalidReason)}mapEndpoints(t){return U.fromDateTimes(t(this.s),t(this.e))}}class Gs{static hasDST(t=J.defaultZone){const e=D.now().setZone(t).set({month:12});return!t.isUniversal&&e.offset!==e.set({month:6}).offset}static isValidIANAZone(t){return Ht.isValidZone(t)}static normalizeZone(t){return Yt(t,J.defaultZone)}static months(t="long",{locale:e=null,numberingSystem:n=null,locObj:i=null,outputCalendar:r="gregory"}={}){return(i||j.create(e,n,r)).months(t)}static monthsFormat(t="long",{locale:e=null,numberingSystem:n=null,locObj:i=null,outputCalendar:r="gregory"}={}){return(i||j.create(e,n,r)).months(t,!0)}static weekdays(t="long",{locale:e=null,numberingSystem:n=null,locObj:i=null}={}){return(i||j.create(e,n,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:e=null,numberingSystem:n=null,locObj:i=null}={}){return(i||j.create(e,n,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return j.create(t).meridiems()}static eras(t="short",{locale:e=null}={}){return j.create(e,null,"gregory").eras(t)}static features(){return{relative:ul()}}}function wo(s,t){const e=i=>i.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),n=e(t)-e(s);return Math.floor(L.fromMillis(n).as("days"))}function Ig(s,t,e){const n=[["years",(l,h)=>h.year-l.year],["quarters",(l,h)=>h.quarter-l.quarter+(h.year-l.year)*4],["months",(l,h)=>h.month-l.month+(h.year-l.year)*12],["weeks",(l,h)=>{const c=wo(l,h);return(c-c%7)/7}],["days",wo]],i={},r=s;let o,a;for(const[l,h]of n)e.indexOf(l)>=0&&(o=l,i[l]=h(s,t),a=r.plus(i),a>t?(i[l]--,s=r.plus(i)):s=a);return[s,i,a,o]}function Lg(s,t,e,n){let[i,r,o,a]=Ig(s,t,e);const l=t-i,h=e.filter(u=>["hours","minutes","seconds","milliseconds"].indexOf(u)>=0);h.length===0&&(o<t&&(o=i.plus({[a]:1})),o!==i&&(r[a]=(r[a]||0)+l/(o-i)));const c=L.fromObject(r,n);return h.length>0?L.fromMillis(l,n).shiftTo(...h).plus(c):c}const $i={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},Mo={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Ng=$i.hanidec.replace(/[\[|\]]/g,"").split("");function Rg(s){let t=parseInt(s,10);if(isNaN(t)){t="";for(let e=0;e<s.length;e++){const n=s.charCodeAt(e);if(s[e].search($i.hanidec)!==-1)t+=Ng.indexOf(s[e]);else for(const i in Mo){const[r,o]=Mo[i];n>=r&&n<=o&&(t+=n-r)}}return parseInt(t,10)}else return t}function Tt({numberingSystem:s},t=""){return new RegExp(`${$i[s||"latn"]}${t}`)}const Fg="missing Intl.DateTimeFormat.formatToParts support";function V(s,t=e=>e){return{regex:s,deser:([e])=>t(Rg(e))}}const Vg=String.fromCharCode(160),El=`[ ${Vg}]`,Cl=new RegExp(El,"g");function zg(s){return s.replace(/\./g,"\\.?").replace(Cl,El)}function ko(s){return s.replace(/\./g,"").replace(Cl," ").toLowerCase()}function Dt(s,t){return s===null?null:{regex:RegExp(s.map(zg).join("|")),deser:([e])=>s.findIndex(n=>ko(e)===ko(n))+t}}function So(s,t){return{regex:s,deser:([,e,n])=>On(e,n),groups:t}}function Js(s){return{regex:s,deser:([t])=>t}}function Wg(s){return s.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function jg(s,t){const e=Tt(t),n=Tt(t,"{2}"),i=Tt(t,"{3}"),r=Tt(t,"{4}"),o=Tt(t,"{6}"),a=Tt(t,"{1,2}"),l=Tt(t,"{1,3}"),h=Tt(t,"{1,6}"),c=Tt(t,"{1,9}"),u=Tt(t,"{2,4}"),d=Tt(t,"{4,6}"),f=g=>({regex:RegExp(Wg(g.val)),deser:([p])=>p,literal:!0}),m=(g=>{if(s.literal)return f(g);switch(g.val){case"G":return Dt(t.eras("short",!1),0);case"GG":return Dt(t.eras("long",!1),0);case"y":return V(h);case"yy":return V(u,yi);case"yyyy":return V(r);case"yyyyy":return V(d);case"yyyyyy":return V(o);case"M":return V(a);case"MM":return V(n);case"MMM":return Dt(t.months("short",!0,!1),1);case"MMMM":return Dt(t.months("long",!0,!1),1);case"L":return V(a);case"LL":return V(n);case"LLL":return Dt(t.months("short",!1,!1),1);case"LLLL":return Dt(t.months("long",!1,!1),1);case"d":return V(a);case"dd":return V(n);case"o":return V(l);case"ooo":return V(i);case"HH":return V(n);case"H":return V(a);case"hh":return V(n);case"h":return V(a);case"mm":return V(n);case"m":return V(a);case"q":return V(a);case"qq":return V(n);case"s":return V(a);case"ss":return V(n);case"S":return V(l);case"SSS":return V(i);case"u":return Js(c);case"uu":return Js(a);case"uuu":return V(e);case"a":return Dt(t.meridiems(),0);case"kkkk":return V(r);case"kk":return V(u,yi);case"W":return V(a);case"WW":return V(n);case"E":case"c":return V(e);case"EEE":return Dt(t.weekdays("short",!1,!1),1);case"EEEE":return Dt(t.weekdays("long",!1,!1),1);case"ccc":return Dt(t.weekdays("short",!0,!1),1);case"cccc":return Dt(t.weekdays("long",!0,!1),1);case"Z":case"ZZ":return So(new RegExp(`([+-]${a.source})(?::(${n.source}))?`),2);case"ZZZ":return So(new RegExp(`([+-]${a.source})(${n.source})?`),2);case"z":return Js(/[a-z_+-/]{1,256}?/i);case" ":return Js(/[^\S\n\r]/);default:return f(g)}})(s)||{invalidReason:Fg};return m.token=s,m}const $g={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour:{numeric:"h","2-digit":"hh"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function Bg(s,t){const{type:e,value:n}=s;if(e==="literal"){const o=/^\s+$/.test(n);return{literal:!o,val:o?" ":n}}const i=t[e];let r=$g[e];if(typeof r=="object"&&(r=r[i]),r)return{literal:!1,val:r}}function Hg(s){return[`^${s.map(t=>t.regex).reduce((t,e)=>`${t}(${e.source})`,"")}$`,s]}function qg(s,t,e){const n=s.match(t);if(n){const i={};let r=1;for(const o in e)if(We(e,o)){const a=e[o],l=a.groups?a.groups+1:1;!a.literal&&a.token&&(i[a.token.val[0]]=a.deser(n.slice(r,r+l))),r+=l}return[n,i]}else return[n,{}]}function Ug(s){const t=i=>{switch(i){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let e=null,n;return I(s.z)||(e=Ht.create(s.z)),I(s.Z)||(e||(e=new ot(s.Z)),n=s.Z),I(s.q)||(s.M=(s.q-1)*3+1),I(s.h)||(s.h<12&&s.a===1?s.h+=12:s.h===12&&s.a===0&&(s.h=0)),s.G===0&&s.y&&(s.y=-s.y),I(s.u)||(s.S=Ri(s.u)),[Object.keys(s).reduce((i,r)=>{const o=t(r);return o&&(i[o]=s[r]),i},{}),e,n]}let Gn=null;function Zg(){return Gn||(Gn=D.fromMillis(1555555555555)),Gn}function Yg(s,t){if(s.literal)return s;const e=et.macroTokenToFormatOpts(s.val),n=Il(e,t);return n==null||n.includes(void 0)?s:n}function Al(s,t){return Array.prototype.concat(...s.map(e=>Yg(e,t)))}function Pl(s,t,e){const n=Al(et.parseFormat(e),s),i=n.map(o=>jg(o,s)),r=i.find(o=>o.invalidReason);if(r)return{input:t,tokens:n,invalidReason:r.invalidReason};{const[o,a]=Hg(i),l=RegExp(o,"i"),[h,c]=qg(t,l,a),[u,d,f]=c?Ug(c):[null,null,void 0];if(We(c,"a")&&We(c,"H"))throw new cs("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:n,regex:l,rawMatches:h,matches:c,result:u,zone:d,specificOffset:f}}}function Gg(s,t,e){const{result:n,zone:i,specificOffset:r,invalidReason:o}=Pl(s,t,e);return[n,i,r,o]}function Il(s,t){return s?et.create(t,s).formatDateTimeParts(Zg()).map(e=>Bg(e,s)):null}const Ll=[0,31,59,90,120,151,181,212,243,273,304,334],Nl=[0,31,60,91,121,152,182,213,244,274,305,335];function wt(s,t){return new Et("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${s}, which is invalid`)}function Rl(s,t,e){const n=new Date(Date.UTC(s,t-1,e));s<100&&s>=0&&n.setUTCFullYear(n.getUTCFullYear()-1900);const i=n.getUTCDay();return i===0?7:i}function Fl(s,t,e){return e+(Cs(s)?Nl:Ll)[t-1]}function Vl(s,t){const e=Cs(s)?Nl:Ll,n=e.findIndex(r=>r<t),i=t-e[n];return{month:n+1,day:i}}function bi(s){const{year:t,month:e,day:n}=s,i=Fl(t,e,n),r=Rl(t,e,n);let o=Math.floor((i-r+10)/7),a;return o<1?(a=t-1,o=xn(a)):o>xn(t)?(a=t+1,o=1):a=t,{weekYear:a,weekNumber:o,weekday:r,...En(s)}}function To(s){const{weekYear:t,weekNumber:e,weekday:n}=s,i=Rl(t,1,4),r=ps(t);let o=e*7+n-i-3,a;o<1?(a=t-1,o+=ps(a)):o>r?(a=t+1,o-=ps(t)):a=t;const{month:l,day:h}=Vl(a,o);return{year:a,month:l,day:h,...En(s)}}function Jn(s){const{year:t,month:e,day:n}=s,i=Fl(t,e,n);return{year:t,ordinal:i,...En(s)}}function Do(s){const{year:t,ordinal:e}=s,{month:n,day:i}=Vl(t,e);return{year:t,month:n,day:i,...En(s)}}function Jg(s){const t=Dn(s.weekYear),e=$t(s.weekNumber,1,xn(s.weekYear)),n=$t(s.weekday,1,7);return t?e?n?!1:wt("weekday",s.weekday):wt("week",s.week):wt("weekYear",s.weekYear)}function Xg(s){const t=Dn(s.year),e=$t(s.ordinal,1,ps(s.year));return t?e?!1:wt("ordinal",s.ordinal):wt("year",s.year)}function zl(s){const t=Dn(s.year),e=$t(s.month,1,12),n=$t(s.day,1,bn(s.year,s.month));return t?e?n?!1:wt("day",s.day):wt("month",s.month):wt("year",s.year)}function Wl(s){const{hour:t,minute:e,second:n,millisecond:i}=s,r=$t(t,0,23)||t===24&&e===0&&n===0&&i===0,o=$t(e,0,59),a=$t(n,0,59),l=$t(i,0,999);return r?o?a?l?!1:wt("millisecond",i):wt("second",n):wt("minute",e):wt("hour",t)}const Xn="Invalid DateTime",Oo=864e13;function Xs(s){return new Et("unsupported zone",`the zone "${s.name}" is not supported`)}function Kn(s){return s.weekData===null&&(s.weekData=bi(s.c)),s.weekData}function is(s,t){const e={ts:s.ts,zone:s.zone,c:s.c,o:s.o,loc:s.loc,invalid:s.invalid};return new D({...e,...t,old:e})}function jl(s,t,e){let n=s-t*60*1e3;const i=e.offset(n);if(t===i)return[n,t];n-=(i-t)*60*1e3;const r=e.offset(n);return i===r?[n,i]:[s-Math.min(i,r)*60*1e3,Math.max(i,r)]}function Eo(s,t){s+=t*60*1e3;const e=new Date(s);return{year:e.getUTCFullYear(),month:e.getUTCMonth()+1,day:e.getUTCDate(),hour:e.getUTCHours(),minute:e.getUTCMinutes(),second:e.getUTCSeconds(),millisecond:e.getUTCMilliseconds()}}function rn(s,t,e){return jl(Vi(s),t,e)}function Co(s,t){const e=s.o,n=s.c.year+Math.trunc(t.years),i=s.c.month+Math.trunc(t.months)+Math.trunc(t.quarters)*3,r={...s.c,year:n,month:i,day:Math.min(s.c.day,bn(n,i))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},o=L.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),a=Vi(r);let[l,h]=jl(a,e,s.zone);return o!==0&&(l+=o,h=s.zone.offset(l)),{ts:l,o:h}}function rs(s,t,e,n,i,r){const{setZone:o,zone:a}=e;if(s&&Object.keys(s).length!==0||t){const l=t||a,h=D.fromObject(s,{...e,zone:l,specificOffset:r});return o?h:h.setZone(a)}else return D.invalid(new Et("unparsable",`the input "${i}" can't be parsed as ${n}`))}function Ks(s,t,e=!0){return s.isValid?et.create(j.create("en-US"),{allowZ:e,forceSimple:!0}).formatDateTimeFromString(s,t):null}function Qn(s,t){const e=s.c.year>9999||s.c.year<0;let n="";return e&&s.c.year>=0&&(n+="+"),n+=X(s.c.year,e?6:4),t?(n+="-",n+=X(s.c.month),n+="-",n+=X(s.c.day)):(n+=X(s.c.month),n+=X(s.c.day)),n}function Ao(s,t,e,n,i,r){let o=X(s.c.hour);return t?(o+=":",o+=X(s.c.minute),(s.c.second!==0||!e)&&(o+=":")):o+=X(s.c.minute),(s.c.second!==0||!e)&&(o+=X(s.c.second),(s.c.millisecond!==0||!n)&&(o+=".",o+=X(s.c.millisecond,3))),i&&(s.isOffsetFixed&&s.offset===0&&!r?o+="Z":s.o<0?(o+="-",o+=X(Math.trunc(-s.o/60)),o+=":",o+=X(Math.trunc(-s.o%60))):(o+="+",o+=X(Math.trunc(s.o/60)),o+=":",o+=X(Math.trunc(s.o%60)))),r&&(o+="["+s.zone.ianaName+"]"),o}const $l={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Kg={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},Qg={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Bl=["year","month","day","hour","minute","second","millisecond"],tp=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],ep=["year","ordinal","hour","minute","second","millisecond"];function Po(s){const t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[s.toLowerCase()];if(!t)throw new qa(s);return t}function Io(s,t){const e=Yt(t.zone,J.defaultZone),n=j.fromObject(t),i=J.now();let r,o;if(I(s.year))r=i;else{for(const h of Bl)I(s[h])&&(s[h]=$l[h]);const a=zl(s)||Wl(s);if(a)return D.invalid(a);const l=e.offset(i);[r,o]=rn(s,l,e)}return new D({ts:r,zone:e,loc:n,o})}function Lo(s,t,e){const n=I(e.round)?!0:e.round,i=(o,a)=>(o=Fi(o,n||e.calendary?0:2,!0),t.loc.clone(e).relFormatter(e).format(o,a)),r=o=>e.calendary?t.hasSame(s,o)?0:t.startOf(o).diff(s.startOf(o),o).get(o):t.diff(s,o).get(o);if(e.unit)return i(r(e.unit),e.unit);for(const o of e.units){const a=r(o);if(Math.abs(a)>=1)return i(a,o)}return i(s>t?-0:0,e.units[e.units.length-1])}function No(s){let t={},e;return s.length>0&&typeof s[s.length-1]=="object"?(t=s[s.length-1],e=Array.from(s).slice(0,s.length-1)):e=Array.from(s),[t,e]}class D{constructor(t){const e=t.zone||J.defaultZone;let n=t.invalid||(Number.isNaN(t.ts)?new Et("invalid input"):null)||(e.isValid?null:Xs(e));this.ts=I(t.ts)?J.now():t.ts;let i=null,r=null;if(!n)if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(e))[i,r]=[t.old.c,t.old.o];else{const o=e.offset(this.ts);i=Eo(this.ts,o),n=Number.isNaN(i.year)?new Et("invalid input"):null,i=n?null:i,r=n?null:o}this._zone=e,this.loc=t.loc||j.create(),this.invalid=n,this.weekData=null,this.c=i,this.o=r,this.isLuxonDateTime=!0}static now(){return new D({})}static local(){const[t,e]=No(arguments),[n,i,r,o,a,l,h]=e;return Io({year:n,month:i,day:r,hour:o,minute:a,second:l,millisecond:h},t)}static utc(){const[t,e]=No(arguments),[n,i,r,o,a,l,h]=e;return t.zone=ot.utcInstance,Io({year:n,month:i,day:r,hour:o,minute:a,second:l,millisecond:h},t)}static fromJSDate(t,e={}){const n=Tm(t)?t.valueOf():NaN;if(Number.isNaN(n))return D.invalid("invalid input");const i=Yt(e.zone,J.defaultZone);return i.isValid?new D({ts:n,zone:i,loc:j.fromObject(e)}):D.invalid(Xs(i))}static fromMillis(t,e={}){if(xe(t))return t<-Oo||t>Oo?D.invalid("Timestamp out of range"):new D({ts:t,zone:Yt(e.zone,J.defaultZone),loc:j.fromObject(e)});throw new _t(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,e={}){if(xe(t))return new D({ts:t*1e3,zone:Yt(e.zone,J.defaultZone),loc:j.fromObject(e)});throw new _t("fromSeconds requires a numerical input")}static fromObject(t,e={}){t=t||{};const n=Yt(e.zone,J.defaultZone);if(!n.isValid)return D.invalid(Xs(n));const i=J.now(),r=I(e.specificOffset)?n.offset(i):e.specificOffset,o=vn(t,Po),a=!I(o.ordinal),l=!I(o.year),h=!I(o.month)||!I(o.day),c=l||h,u=o.weekYear||o.weekNumber,d=j.fromObject(e);if((c||a)&&u)throw new cs("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(h&&a)throw new cs("Can't mix ordinal dates with month/day");const f=u||o.weekday&&!c;let m,g,p=Eo(i,r);f?(m=tp,g=Kg,p=bi(p)):a?(m=ep,g=Qg,p=Jn(p)):(m=Bl,g=$l);let y=!1;for(const k of m){const C=o[k];I(C)?y?o[k]=g[k]:o[k]=p[k]:y=!0}const x=f?Jg(o):a?Xg(o):zl(o),_=x||Wl(o);if(_)return D.invalid(_);const b=f?To(o):a?Do(o):o,[v,M]=rn(b,r,n),S=new D({ts:v,zone:n,o:M,loc:d});return o.weekday&&c&&t.weekday!==S.weekday?D.invalid("mismatched weekday",`you can't specify both a weekday of ${o.weekday} and a date of ${S.toISO()}`):S}static fromISO(t,e={}){const[n,i]=gg(t);return rs(n,i,e,"ISO 8601",t)}static fromRFC2822(t,e={}){const[n,i]=pg(t);return rs(n,i,e,"RFC 2822",t)}static fromHTTP(t,e={}){const[n,i]=yg(t);return rs(n,i,e,"HTTP",e)}static fromFormat(t,e,n={}){if(I(t)||I(e))throw new _t("fromFormat requires an input string and a format");const{locale:i=null,numberingSystem:r=null}=n,o=j.fromOpts({locale:i,numberingSystem:r,defaultToEN:!0}),[a,l,h,c]=Gg(o,t,e);return c?D.invalid(c):rs(a,l,n,`format ${e}`,t,h)}static fromString(t,e,n={}){return D.fromFormat(t,e,n)}static fromSQL(t,e={}){const[n,i]=kg(t);return rs(n,i,e,"SQL",t)}static invalid(t,e=null){if(!t)throw new _t("need to specify a reason the DateTime is invalid");const n=t instanceof Et?t:new Et(t,e);if(J.throwOnInvalid)throw new nm(n);return new D({invalid:n})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}static parseFormatForOpts(t,e={}){const n=Il(t,j.fromObject(e));return n?n.map(i=>i?i.val:null).join(""):null}static expandFormat(t,e={}){return Al(et.parseFormat(t),j.fromObject(e)).map(n=>n.val).join("")}get(t){return this[t]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?Kn(this).weekYear:NaN}get weekNumber(){return this.isValid?Kn(this).weekNumber:NaN}get weekday(){return this.isValid?Kn(this).weekday:NaN}get ordinal(){return this.isValid?Jn(this.c).ordinal:NaN}get monthShort(){return this.isValid?Gs.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Gs.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Gs.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Gs.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}get isInLeapYear(){return Cs(this.year)}get daysInMonth(){return bn(this.year,this.month)}get daysInYear(){return this.isValid?ps(this.year):NaN}get weeksInWeekYear(){return this.isValid?xn(this.weekYear):NaN}resolvedLocaleOptions(t={}){const{locale:e,numberingSystem:n,calendar:i}=et.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:e,numberingSystem:n,outputCalendar:i}}toUTC(t=0,e={}){return this.setZone(ot.instance(t),e)}toLocal(){return this.setZone(J.defaultZone)}setZone(t,{keepLocalTime:e=!1,keepCalendarTime:n=!1}={}){if(t=Yt(t,J.defaultZone),t.equals(this.zone))return this;if(t.isValid){let i=this.ts;if(e||n){const r=t.offset(this.ts),o=this.toObject();[i]=rn(o,r,t)}return is(this,{ts:i,zone:t})}else return D.invalid(Xs(t))}reconfigure({locale:t,numberingSystem:e,outputCalendar:n}={}){const i=this.loc.clone({locale:t,numberingSystem:e,outputCalendar:n});return is(this,{loc:i})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;const e=vn(t,Po),n=!I(e.weekYear)||!I(e.weekNumber)||!I(e.weekday),i=!I(e.ordinal),r=!I(e.year),o=!I(e.month)||!I(e.day),a=r||o,l=e.weekYear||e.weekNumber;if((a||i)&&l)throw new cs("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(o&&i)throw new cs("Can't mix ordinal dates with month/day");let h;n?h=To({...bi(this.c),...e}):I(e.ordinal)?(h={...this.toObject(),...e},I(e.day)&&(h.day=Math.min(bn(h.year,h.month),h.day))):h=Do({...Jn(this.c),...e});const[c,u]=rn(h,this.o,this.zone);return is(this,{ts:c,o:u})}plus(t){if(!this.isValid)return this;const e=L.fromDurationLike(t);return is(this,Co(this,e))}minus(t){if(!this.isValid)return this;const e=L.fromDurationLike(t).negate();return is(this,Co(this,e))}startOf(t){if(!this.isValid)return this;const e={},n=L.normalizeUnit(t);switch(n){case"years":e.month=1;case"quarters":case"months":e.day=1;case"weeks":case"days":e.hour=0;case"hours":e.minute=0;case"minutes":e.second=0;case"seconds":e.millisecond=0;break}if(n==="weeks"&&(e.weekday=1),n==="quarters"){const i=Math.ceil(this.month/3);e.month=(i-1)*3+1}return this.set(e)}endOf(t){return this.isValid?this.plus({[t]:1}).startOf(t).minus(1):this}toFormat(t,e={}){return this.isValid?et.create(this.loc.redefaultToEN(e)).formatDateTimeFromString(this,t):Xn}toLocaleString(t=yn,e={}){return this.isValid?et.create(this.loc.clone(e),t).formatDateTime(this):Xn}toLocaleParts(t={}){return this.isValid?et.create(this.loc.clone(t),t).formatDateTimeParts(this):[]}toISO({format:t="extended",suppressSeconds:e=!1,suppressMilliseconds:n=!1,includeOffset:i=!0,extendedZone:r=!1}={}){if(!this.isValid)return null;const o=t==="extended";let a=Qn(this,o);return a+="T",a+=Ao(this,o,e,n,i,r),a}toISODate({format:t="extended"}={}){return this.isValid?Qn(this,t==="extended"):null}toISOWeekDate(){return Ks(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:t=!1,suppressSeconds:e=!1,includeOffset:n=!0,includePrefix:i=!1,extendedZone:r=!1,format:o="extended"}={}){return this.isValid?(i?"T":"")+Ao(this,o==="extended",e,t,n,r):null}toRFC2822(){return Ks(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Ks(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?Qn(this,!0):null}toSQLTime({includeOffset:t=!0,includeZone:e=!1,includeOffsetSpace:n=!0}={}){let i="HH:mm:ss.SSS";return(e||t)&&(n&&(i+=" "),e?i+="z":t&&(i+="ZZ")),Ks(this,i,!0)}toSQL(t={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(t)}`:null}toString(){return this.isValid?this.toISO():Xn}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(t={}){if(!this.isValid)return{};const e={...this.c};return t.includeConfig&&(e.outputCalendar=this.outputCalendar,e.numberingSystem=this.loc.numberingSystem,e.locale=this.loc.locale),e}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(t,e="milliseconds",n={}){if(!this.isValid||!t.isValid)return L.invalid("created by diffing an invalid DateTime");const i={locale:this.locale,numberingSystem:this.numberingSystem,...n},r=Dm(e).map(L.normalizeUnit),o=t.valueOf()>this.valueOf(),a=o?this:t,l=o?t:this,h=Lg(a,l,r,i);return o?h.negate():h}diffNow(t="milliseconds",e={}){return this.diff(D.now(),t,e)}until(t){return this.isValid?U.fromDateTimes(this,t):this}hasSame(t,e){if(!this.isValid)return!1;const n=t.valueOf(),i=this.setZone(t.zone,{keepLocalTime:!0});return i.startOf(e)<=n&&n<=i.endOf(e)}equals(t){return this.isValid&&t.isValid&&this.valueOf()===t.valueOf()&&this.zone.equals(t.zone)&&this.loc.equals(t.loc)}toRelative(t={}){if(!this.isValid)return null;const e=t.base||D.fromObject({},{zone:this.zone}),n=t.padding?this<e?-t.padding:t.padding:0;let i=["years","months","days","hours","minutes","seconds"],r=t.unit;return Array.isArray(t.unit)&&(i=t.unit,r=void 0),Lo(e,this.plus(n),{...t,numeric:"always",units:i,unit:r})}toRelativeCalendar(t={}){return this.isValid?Lo(t.base||D.fromObject({},{zone:this.zone}),this,{...t,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...t){if(!t.every(D.isDateTime))throw new _t("min requires all arguments be DateTimes");return xo(t,e=>e.valueOf(),Math.min)}static max(...t){if(!t.every(D.isDateTime))throw new _t("max requires all arguments be DateTimes");return xo(t,e=>e.valueOf(),Math.max)}static fromFormatExplain(t,e,n={}){const{locale:i=null,numberingSystem:r=null}=n,o=j.fromOpts({locale:i,numberingSystem:r,defaultToEN:!0});return Pl(o,t,e)}static fromStringExplain(t,e,n={}){return D.fromFormatExplain(t,e,n)}static get DATE_SHORT(){return yn}static get DATE_MED(){return Ua}static get DATE_MED_WITH_WEEKDAY(){return om}static get DATE_FULL(){return Za}static get DATE_HUGE(){return Ya}static get TIME_SIMPLE(){return Ga}static get TIME_WITH_SECONDS(){return Ja}static get TIME_WITH_SHORT_OFFSET(){return Xa}static get TIME_WITH_LONG_OFFSET(){return Ka}static get TIME_24_SIMPLE(){return Qa}static get TIME_24_WITH_SECONDS(){return tl}static get TIME_24_WITH_SHORT_OFFSET(){return el}static get TIME_24_WITH_LONG_OFFSET(){return sl}static get DATETIME_SHORT(){return nl}static get DATETIME_SHORT_WITH_SECONDS(){return il}static get DATETIME_MED(){return rl}static get DATETIME_MED_WITH_SECONDS(){return ol}static get DATETIME_MED_WITH_WEEKDAY(){return am}static get DATETIME_FULL(){return al}static get DATETIME_FULL_WITH_SECONDS(){return ll}static get DATETIME_HUGE(){return hl}static get DATETIME_HUGE_WITH_SECONDS(){return cl}}function os(s){if(D.isDateTime(s))return s;if(s&&s.valueOf&&xe(s.valueOf()))return D.fromJSDate(s);if(s&&typeof s=="object")return D.fromObject(s);throw new _t(`Unknown datetime argument: ${s}, of type ${typeof s}`)}/*!
|
|
19
|
-
* chartjs-adapter-luxon v1.3.1
|
|
20
|
-
* https://www.chartjs.org
|
|
21
|
-
* (c) 2023 chartjs-adapter-luxon Contributors
|
|
22
|
-
* Released under the MIT license
|
|
23
|
-
*/const sp={datetime:D.DATETIME_MED_WITH_SECONDS,millisecond:"h:mm:ss.SSS a",second:D.TIME_WITH_SECONDS,minute:D.TIME_SIMPLE,hour:{hour:"numeric"},day:{day:"numeric",month:"short"},week:"DD",month:{month:"short",year:"numeric"},quarter:"'Q'q - yyyy",year:{year:"numeric"}};_a._date.override({_id:"luxon",_create:function(s){return D.fromMillis(s,this.options)},init(s){this.options.locale||(this.options.locale=s.locale)},formats:function(){return sp},parse:function(s,t){const e=this.options,n=typeof s;return s===null||n==="undefined"?null:(n==="number"?s=this._create(s):n==="string"?typeof t=="string"?s=D.fromFormat(s,t,e):s=D.fromISO(s,e):s instanceof Date?s=D.fromJSDate(s,e):n==="object"&&!(s instanceof D)&&(s=D.fromObject(s,e)),s.isValid?s.valueOf():null)},format:function(s,t){const e=this._create(s);return typeof t=="string"?e.toFormat(t):e.toLocaleString(t)},add:function(s,t,e){const n={};return n[e]=t,this._create(s).plus(n).valueOf()},diff:function(s,t,e){return this._create(s).diff(this._create(t)).as(e).valueOf()},startOf:function(s,t,e){if(t==="isoWeek"){e=Math.trunc(Math.min(Math.max(0,e),6));const n=this._create(s);return n.minus({days:(n.weekday-e+7)%7}).startOf("day").valueOf()}return t?this._create(s).startOf(t).valueOf():s},endOf:function(s,t){return this._create(s).endOf(t).valueOf()}});const Cn={errorBarLineWidth:{v:[1,3]},errorBarColor:{v:["#2c2c2c","#1f1f1f"]},errorBarWhiskerLineWidth:{v:[1,3]},errorBarWhiskerRatio:{v:[.2,.25]},errorBarWhiskerSize:{v:[20,24]},errorBarWhiskerColor:{v:["#2c2c2c","#1f1f1f"]}},Bi={_scriptable:!0,_indexable:s=>s!=="v"},Ro=Object.keys(Cn);function Hi(s,t){const e=Array.isArray(s)?s:[s],n=Array.isArray(t)?t:[t];if(e.length===n.length)return e.map((r,o)=>[r,n[o]]);const i=Math.max(e.length,n.length);return Array(i).map((r,o)=>[e[o%e.length],n[o%n.length]])}function ct(s,t){if(typeof s=="string"||typeof s=="number")return s;const e=Array.isArray(s)?s:s.v;return e[t%e.length]}function qi(s,t,e){const n=ct(t.errorBarWhiskerRatio,e);return s!=null&&n>0?s*n*.5:ct(t.errorBarWhiskerSize,e)*.5}function np(s,t,e,n,i){i.save(),i.translate(s.x,0);const r=Hi(t??s.y,e??s.y);r.reverse().forEach(([o,a],l)=>{const h=r.length-l-1,c=qi(s.width,n,h);i.lineWidth=ct(n.errorBarLineWidth,h),i.strokeStyle=ct(n.errorBarColor,h),i.beginPath(),i.moveTo(0,o),i.lineTo(0,a),i.stroke(),i.lineWidth=ct(n.errorBarWhiskerLineWidth,h),i.strokeStyle=ct(n.errorBarWhiskerColor,h),i.beginPath(),i.moveTo(-c,o),i.lineTo(c,o),i.moveTo(-c,a),i.lineTo(c,a),i.stroke()}),i.restore()}function ip(s,t,e,n,i){i.save(),i.translate(0,s.y);const r=Hi(t??s.x,e??s.x);r.reverse().forEach(([o,a],l)=>{const h=r.length-l-1,c=qi(s.height,n,h);i.lineWidth=ct(n.errorBarLineWidth,h),i.strokeStyle=ct(n.errorBarColor,h),i.beginPath(),i.moveTo(o,0),i.lineTo(a,0),i.stroke(),i.lineWidth=ct(n.errorBarWhiskerLineWidth,h),i.strokeStyle=ct(n.errorBarWhiskerColor,h),i.beginPath(),i.moveTo(o,-c),i.lineTo(o,c),i.moveTo(a,-c),i.lineTo(a,c),i.stroke()}),i.restore()}function Hl(s,t){var e,n,i,r;const o=s.getProps(["x","y","width","height","xMin","xMax","yMin","yMax"]);(o.xMin!=null||o.xMax!=null)&&ip(o,(e=o.xMin)!==null&&e!==void 0?e:null,(n=o.xMax)!==null&&n!==void 0?n:null,s.options,t),(o.yMin!=null||o.yMax!=null)&&np(o,(i=o.yMin)!==null&&i!==void 0?i:null,(r=o.yMax)!==null&&r!==void 0?r:null,s.options,t)}function rp(s,t,e,n,i){i.save(),i.translate(s.x,s.y);const r=(s.startAngle+s.endAngle)/2,o=Math.cos(r),a=Math.sin(r),l={x:-a,y:o},h=Math.sqrt(l.x*l.x+l.y*l.y);l.x/=h,l.y/=h;const c=Hi(t??s.outerRadius,e??s.outerRadius);c.reverse().forEach(([u,d],f)=>{const m=c.length-f-1,g=u*o,p=u*a,y=d*o,x=d*a,_=qi(null,n,m),b=l.x*_,v=l.y*_;i.lineWidth=ct(n.errorBarLineWidth,m),i.strokeStyle=ct(n.errorBarColor,m),i.beginPath(),i.moveTo(g,p),i.lineTo(y,x),i.stroke(),i.lineWidth=ct(n.errorBarWhiskerLineWidth,m),i.strokeStyle=ct(n.errorBarWhiskerColor,m),i.beginPath(),i.moveTo(g+b,p+v),i.lineTo(g-b,p-v),i.moveTo(y+b,x+v),i.lineTo(y-b,x-v),i.stroke()}),i.restore()}function op(s,t){const e=s.getProps(["x","y","startAngle","endAngle","rMin","rMax","outerRadius"]);(e.rMin!=null||e.rMax!=null)&&rp(e,e.rMin,e.rMax,s.options,t)}class Ue extends be{draw(t){super.draw(t),Hl(this,t)}}Ue.id="barWithErrorBar";Ue.defaults={...be.defaults,...Cn};Ue.defaultRoutes=be.defaultRoutes;Ue.descriptors=Bi;class bt extends ye{draw(t,e){super.draw.call(this,t,e),Hl(this,t)}}bt.id="pointWithErrorBar";bt.defaults={...ye.defaults,...Cn};bt.defaultRoutes=ye.defaultRoutes;bt.descriptors=Bi;class Ze extends pe{draw(t){super.draw(t),op(this,t)}}Ze.id="arcWithErrorBar";Ze.defaults={...pe.defaults,...Cn};Ze.defaultRoutes=pe.defaultRoutes;Ze.descriptors=Bi;const xi=["xMin","xMax","yMin","yMax"];function ql(s){return s?xi.slice(0,2):xi.slice(2)}function Ss(s,t,e,n,i){const r=[`${n.axis}Min`,`${n.axis}Max`],o=n.getBasePixel();for(const a of r){const l=t[a];Array.isArray(l)?s[a]=l.map(h=>i?o:n.getPixelForValue(h,e)):typeof l=="number"?s[a]=i?o:n.getPixelForValue(l,e):s[a]=null}}function ap(s,t,e,n,i){const r=i.animation,o=[`${e.axis}Min`,`${e.axis}Max`],a=l=>{const h=e.getDistanceFromCenterForValue(l),c=r.animateScale?0:h;return n?c:h};for(const l of o){const h=t[l];Array.isArray(h)?s[l]=h.map(a):typeof h=="number"?s[l]=a(h):s[l]=null}}function Ui(s){return Array.isArray(s)?s.slice().reverse():s}function Ul(s){const t=ql(s.element.horizontal),e=$a.defaults.callbacks.label.call(this,s),n=s.chart.data.datasets[s.datasetIndex].data[s.dataIndex];return n==null||t.every(i=>n[i]==null)?e:`${e} (${Ui(n[t[0]])} .. ${n[t[1]]})`}function lp(s){const t=s.chart.data.datasets[s.datasetIndex].data[s.dataIndex],e=(n,i)=>{const r=ql(i);return t==null||r.every(o=>t[o]==null)?n:`${n} [${Ui(t[r[0]])} .. ${t[r[1]]}]`};return`(${e(s.label,!0)}, ${e(s.parsed.y,!1)})`}function hp(s){const t=Nt.overrides.plugins.tooltip.callbacks.label.call(this,s),e=s.chart.data.datasets[s.datasetIndex].data[s.dataIndex],n=["rMin","rMax"];return e==null||n.every(i=>e[i]==null)?t:`${t} [${Ui(e[n[0]])} .. ${e[n[1]]}]`}const Zl={color(s,t,e){const n=s||"transparent",i=t||"transparent";if(n===i)return t;const r=hn(n),o=r.valid&&hn(i);return o&&o.valid?o.mix(r,e).hexString():t},number(s,t,e){return s===t?t:s+(t-s)*e}};function Yl(s,t,e,n,i){if(typeof s===n&&typeof t===n)return i(s,t,e);if(Array.isArray(s)&&Array.isArray(t))return s.map((o,a)=>i(o,t[a],e));const r=o=>o&&Array.isArray(o.v);return r(s)&&r(t)?{v:s.v.map((o,a)=>i(o,t.v[a],e))}:t}function cp(s,t,e){return Yl(s,t,e,"number",Zl.number)}function up(s,t,e){return Yl(s,t,e,"string",Zl.color)}const An={animations:{numberArray:{fn:cp,properties:xi.concat(Ro.filter(s=>!s.endsWith("Color")),["rMin","rMax"])},colorArray:{fn:up,properties:Ro.filter(s=>s.endsWith("Color"))}}};function Pn(s,t){const{axis:e}=s;s.axis=`${e}MinMin`;const{min:n}=t(s);s.axis=`${e}MaxMax`;const{max:i}=t(s);return s.axis=e,{min:n,max:i}}function Fo(s,t,e){return Array.isArray(t)?e(s,...t):typeof t=="number"?e(s,t):s}function je(s,t,e,n,i){const r=typeof t=="string"?t:t.axis,o=`${r}Min`,a=`${r}Max`,l=`${r}MinMin`,h=`${r}MaxMax`;for(let c=0;c<i;c+=1){const u=c+n,d=s[c];d[o]=typeof e[u]=="object"?e[u][o]:null,d[a]=typeof e[u]=="object"?e[u][a]:null,d[l]=Fo(d[r],d[o],Math.min),d[h]=Fo(d[r],d[a],Math.max)}}function Gl(s,t,e,n){const{axis:i}=t,r=t.getLabels();for(let o=0;o<n;o+=1){const a=o+e,l=s[o];l[i]=t.parse(r[a],a)}}function In(s,t,e,n=[],i=[]){rt.addControllers(e),Array.isArray(n)?rt.addElements(...n):rt.addElements(n),Array.isArray(i)?rt.addScales(...i):rt.addScales(i);const r=t;return r.type=s,r}class Ye extends te{getMinMax(t,e){return Pn(t,n=>super.getMinMax(n,e))}parsePrimitiveData(t,e,n,i){const r=super.parsePrimitiveData(t,e,n,i);return this.parseErrorData(r,t,e,n,i),r}parseObjectData(t,e,n,i){const r=super.parseObjectData(t,e,n,i);return this.parseErrorData(r,t,e,n,i),r}parseErrorData(t,e,n,i,r){je(t,e.vScale,n,i,r),Gl(t,e.iScale,i,r)}updateElement(t,e,n,i){typeof e=="number"&&Ss(n,this.getParsed(e),e,this._cachedMeta.vScale,i==="reset"),super.updateElement(t,e,n,i)}}Ye.id="barWithErrorBars";Ye.defaults=yt({},[te.defaults,An,{dataElementType:Ue.id}]);Ye.overrides=yt({},[te.overrides,{plugins:{tooltip:{callbacks:{label:Ul}}}}]);Ye.defaultRoutes=te.defaultRoutes;class dp extends lt{constructor(t,e){super(t,In("barWithErrorBars",e,Ye,Ue,[we,ze]))}}dp.id=Ye.id;const Vo=["linear","logarithmic","time","timeseries"];class Se extends Bt{getMinMax(t,e){return Pn(t,n=>super.getMinMax(n,e))}parsePrimitiveData(t,e,n,i){const r=super.parsePrimitiveData(t,e,n,i);return this.parseErrorData(r,t,e,n,i),r}parseObjectData(t,e,n,i){const r=super.parseObjectData(t,e,n,i);return this.parseErrorData(r,t,e,n,i),r}parseErrorData(t,e,n,i,r){je(t,e.vScale,n,i,r);const o=e.iScale;Vo.includes(o.type)?je(t,e.iScale,n,i,r):Gl(t,e.iScale,i,r)}updateElement(t,e,n,i){t instanceof bt&&typeof e=="number"&&this.updateElementScale(e,n,i),super.updateElement(t,e,n,i)}updateElementScale(t,e,n){Ss(e,this.getParsed(t),t,this._cachedMeta.vScale,n==="reset");const i=this._cachedMeta.iScale;Vo.includes(i.type)&&Ss(e,this.getParsed(t),t,this._cachedMeta.iScale,n==="reset")}updateElements(t,e,n,i){const r=i==="reset",o=this.chart._animationsDisabled||r||i==="none";if(super.updateElements(t,e,n,i),!!o)for(let a=e;a<e+n;++a){const l=t[a];l instanceof bt&&this.updateElementScale(a,l,i)}}}Se.id="lineWithErrorBars";Se.defaults=yt({},[Bt.defaults,An,{dataElementType:bt.id}]);Se.overrides=yt({},[Bt.overrides,{plugins:{tooltip:{callbacks:{label:Ul}}}}]);Se.defaultRoutes=Bt.defaultRoutes;class Jl extends lt{constructor(t,e){super(t,In("lineWithErrorBars",e,Se,bt,[we,ze]))}}Jl.id=Se.id;class Te extends ge{getMinMax(t,e){return Pn(t,n=>super.getMinMax(n,e))}parsePrimitiveData(t,e,n,i){const r=super.parsePrimitiveData(t,e,n,i);return this.parseErrorData(r,t,e,n,i),r}parseObjectData(t,e,n,i){const r=super.parseObjectData(t,e,n,i);return this.parseErrorData(r,t,e,n,i),r}parseErrorData(t,e,n,i,r){je(t,e.xScale,n,i,r),je(t,e.yScale,n,i,r)}updateElement(t,e,n,i){t instanceof bt&&typeof e=="number"&&this.updateElementScale(e,n,i),super.updateElement(t,e,n,i)}updateElementScale(t,e,n){Ss(e,this.getParsed(t),t,this._cachedMeta.xScale,n==="reset"),Ss(e,this.getParsed(t),t,this._cachedMeta.yScale,n==="reset")}updateElements(t,e,n,i){const r=i==="reset",o=this.chart._animationsDisabled||r||i==="none";if(super.updateElements(t,e,n,i),!!o)for(let a=e;a<e+n;++a){const l=t[a];l instanceof bt&&this.updateElementScale(a,l,i)}}}Te.id="scatterWithErrorBars";Te.defaults=yt({},[ge.defaults,An,{dataElementType:bt.id}]);Te.overrides=yt({},[ge.overrides,{plugins:{tooltip:{callbacks:{label:lp}}}}]);Te.defaultRoutes=Bt.defaultRoutes;class Xl extends lt{constructor(t,e){super(t,In("scatterWithErrorBars",e,Te,bt,[we]))}}Xl.id=Te.id;class Ge extends Nt{getMinMaxImpl(t){const e=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return e.data.forEach((i,r)=>{const o=this.getParsed(r)[t.axis];Number.isNaN(o)||!this.chart.getDataVisibility(r)||(o<n.min&&(n.min=o),o>n.max&&(n.max=o))}),n}getMinMax(t){return Pn(t,e=>this.getMinMaxImpl(e))}countVisibleElements(){const t=this._cachedMeta;return t.data.reduce((e,n,i)=>!Number.isNaN(t._parsed[i].r)&&this.chart.getDataVisibility(i)?e+1:e,0)}parsePrimitiveData(t,e,n,i){const r=super.parsePrimitiveData(t,e,n,i);return this.parseErrorData(r,t,e,n,i),r}parseObjectData(t,e,n,i){const r=super.parseObjectData(t,e,n,i);return this.parseErrorData(r,t,e,n,i),r}parseErrorData(t,e,n,i,r){const o=e.rScale;for(let a=0;a<r;a+=1){const l=a+i,h=n[l],c=o.parse(h[o.axis],l);t[a]={[o.axis]:c}}je(t,o,n,i,r)}updateElement(t,e,n,i){typeof e=="number"&&ap(n,this.getParsed(e),this._cachedMeta.rScale,i==="reset",this.chart.options),super.updateElement(t,e,n,i)}updateElements(t,e,n,i){const r=this.chart.scales.r,o=r.getDistanceFromCenterForValue;r.getDistanceFromCenterForValue=function(a){return typeof a=="number"?o.call(this,a):o.call(this,a.r)},super.updateElements(t,e,n,i),r.getDistanceFromCenterForValue=o}}Ge.id="polarAreaWithErrorBars";Ge.defaults=yt({},[Nt.defaults,An,{dataElementType:Ze.id}]);Ge.overrides=yt({},[Nt.overrides,{plugins:{tooltip:{callbacks:{label:hp}}}}]);Ge.defaultRoutes=Nt.defaultRoutes;class fp extends lt{constructor(t,e){super(t,In("polarAreaWithErrorBars",e,Ge,Ze,[Ie]))}}fp.id=Ge.id;function mp(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var Kl={};function kt(s,t){typeof t=="boolean"&&(t={forever:t}),this._originalTimeouts=JSON.parse(JSON.stringify(s)),this._timeouts=s,this._options=t||{},this._maxRetryTime=t&&t.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}var gp=kt;kt.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};kt.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};kt.prototype.retry=function(s){if(this._timeout&&clearTimeout(this._timeout),!s)return!1;var t=new Date().getTime();if(s&&t-this._operationStart>=this._maxRetryTime)return this._errors.push(s),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(s);var e=this._timeouts.shift();if(e===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),e=this._cachedTimeouts.slice(-1);else return!1;var n=this;return this._timer=setTimeout(function(){n._attempts++,n._operationTimeoutCb&&(n._timeout=setTimeout(function(){n._operationTimeoutCb(n._attempts)},n._operationTimeout),n._options.unref&&n._timeout.unref()),n._fn(n._attempts)},e),this._options.unref&&this._timer.unref(),!0};kt.prototype.attempt=function(s,t){this._fn=s,t&&(t.timeout&&(this._operationTimeout=t.timeout),t.cb&&(this._operationTimeoutCb=t.cb));var e=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){e._operationTimeoutCb()},e._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};kt.prototype.try=function(s){console.log("Using RetryOperation.try() is deprecated"),this.attempt(s)};kt.prototype.start=function(s){console.log("Using RetryOperation.start() is deprecated"),this.attempt(s)};kt.prototype.start=kt.prototype.try;kt.prototype.errors=function(){return this._errors};kt.prototype.attempts=function(){return this._attempts};kt.prototype.mainError=function(){if(this._errors.length===0)return null;for(var s={},t=null,e=0,n=0;n<this._errors.length;n++){var i=this._errors[n],r=i.message,o=(s[r]||0)+1;s[r]=o,o>=e&&(t=i,e=o)}return t};(function(s){var t=gp;s.operation=function(e){var n=s.timeouts(e);return new t(n,{forever:e&&(e.forever||e.retries===1/0),unref:e&&e.unref,maxRetryTime:e&&e.maxRetryTime})},s.timeouts=function(e){if(e instanceof Array)return[].concat(e);var n={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var i in e)n[i]=e[i];if(n.minTimeout>n.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var r=[],o=0;o<n.retries;o++)r.push(this.createTimeout(o,n));return e&&e.forever&&!r.length&&r.push(this.createTimeout(o,n)),r.sort(function(a,l){return a-l}),r},s.createTimeout=function(e,n){var i=n.randomize?Math.random()+1:1,r=Math.round(i*Math.max(n.minTimeout,1)*Math.pow(n.factor,e));return r=Math.min(r,n.maxTimeout),r},s.wrap=function(e,n,i){if(n instanceof Array&&(i=n,n=null),!i){i=[];for(var r in e)typeof e[r]=="function"&&i.push(r)}for(var o=0;o<i.length;o++){var a=i[o],l=e[a];e[a]=(function(h){var c=s.operation(n),u=Array.prototype.slice.call(arguments,1),d=u.pop();u.push(function(f){c.retry(f)||(f&&(arguments[0]=c.mainError()),d.apply(this,arguments))}),c.attempt(function(){h.apply(e,u)})}).bind(e,l),e[a].options=n}}})(Kl);var pp=Kl;const yp=mp(pp),bp=new Set(["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed","fetch failed"]);class vi extends Error{constructor(t){super(),t instanceof Error?(this.originalError=t,{message:t}=t):(this.originalError=new Error(t),this.originalError.stack=this.stack),this.name="AbortError",this.message=t}}const xp=(s,t,e)=>{const n=e.retries-(t-1);return s.attemptNumber=t,s.retriesLeft=n,s},vp=s=>bp.has(s),zo=s=>globalThis.DOMException===void 0?new Error(s):new DOMException(s);async function Wo(s,t){return new Promise((e,n)=>{t={onFailedAttempt(){},retries:10,...t};const i=yp.operation(t);i.attempt(async r=>{try{e(await s(r))}catch(o){if(!(o instanceof Error)){n(new TypeError(`Non-error was thrown: "${o}". You should only throw errors.`));return}if(o instanceof vi)i.stop(),n(o.originalError);else if(o instanceof TypeError&&!vp(o.message))i.stop(),n(o);else{xp(o,r,t);try{await t.onFailedAttempt(o)}catch(a){n(a);return}i.retry(o)||n(i.mainError())}}}),t.signal&&!t.signal.aborted&&t.signal.addEventListener("abort",()=>{i.stop();const r=t.signal.reason===void 0?zo("The operation was aborted."):t.signal.reason;n(r instanceof Error?r:zo(r))},{once:!0})})}class _p{constructor(t,e,n,i,r,o,a,l){w(this,"type"),w(this,"endpoint"),w(this,"parameters"),w(this,"retries"),w(this,"source"),w(this,"table"),w(this,"geometry"),w(this,"timeParameter"),this.type=t,this.endpoint=e,this.parameters=n,this.retries=i,this.source=r,this.table=o,this.geometry=a,this.timeParameter=l}fetchData(t,e,n){switch(this.type){case"signals":return this.fetchSignals(t,e,n);case"geodb":return this.fetchGeoDBData(t,e,n);default:return null}}fetchGeoDBData(t,e,n){const i=this.parameters[t].join(","),r=`and=(${this.timeParameter}.gte.${e.toISODate()},${this.timeParameter}.lte.${n.toISODate()})`,o=`${this.endpoint}/${this.source}_${this.table}?${r}&select=${i},${this.timeParameter}`;async function a(){const l=await fetch(o,{headers:{"Content-Type":"application/json; charset=utf-8"},method:"GET",mode:"cors"});if(l.status===404)throw new vi(l.statusText);if(l.status!==200)throw Error(l.statusText);return l}return Wo(a,{onFailedAttempt:l=>{console.log(`Attempt ${l.attemptNumber} failed. There are ${l.retriesLeft} retries left.`)},retries:this.retries}).then(function(l){return l.json()})}fetchSignals(t,e,n){const i=this.parameters[t].map(h=>`feature=${h}`).join("&"),r=`${e?"&start_date="+e.toISODate():""}${n?"&end_date="+n.toISODate():""}`,o=`${this.endpoint}?source=${this.source}&${i}${r}`,a=this.geometry;async function l(){const h=await fetch(o,{headers:{"Content-Type":"application/json; charset=utf-8"},method:"POST",mode:"cors",body:JSON.stringify({geometry:a})});if(h.status===404)throw new vi(h.statusText);if(h.status!==200)throw Error(h.statusText);return h}return Wo(l,{onFailedAttempt:h=>{console.log(`Attempt ${h.attemptNumber} failed. There are ${h.retriesLeft} retries left.`)},retries:this.retries}).then(function(h){return h.json()}).catch(h=>{console.error(h),document.querySelector("eox-chart").shadowRoot.querySelector("#error").style.display="flex",setTimeout(()=>{document.querySelector("eox-chart").shadowRoot.querySelector("#error").style.display="none"})})}convertData(t){switch(this.type){case"signals":return this.convertSignals(t);case"geodb":return this.convertGeoDBData(t);default:return null}}convertSignals(t){let e={};const n=t.basicStats;return t&&t.date!=="missing"&&(e={x:D.fromISO(t.date).setZone("UTC"),y:n.mean,yMin:n.min,yMax:n.max}),e}convertGeoDBData(t){let e={};return t&&t.date!=="missing"&&(e={x:D.fromISO(t.date).setZone("UTC"),y:t.basicStats.mean,yMin:null,yMax:null}),e}setGeometry(t){this.geometry=t}}lt.register(Se,Jl,bt,Xl,Te,we,ze);class jo{constructor(t,e,n){if(w(this,"type"),w(this,"chart"),w(this,"startTime"),w(this,"endTime"),w(this,"timeAggregation"),w(this,"options"),w(this,"chartOptions"),w(this,"dataStorage"),w(this,"status"),w(this,"activeFields"),w(this,"requestHandler"),w(this,"additionalYAxis"),this.type=t,this.chart=e,this.options=n,this.startTime=D.now().minus(n.timeInterval),this.endTime=D.now(),n.startTime&&n.endTime&&(this.startTime=D.fromISO(n.startTime).setZone("UTC"),this.endTime=D.fromISO(n.endTime).setZone("UTC")),this.options.timeAggregation&&(this.timeAggregation=this.options.timeAggregation),this.options.retries=this.options.retries?this.options.retries:5,this.options.normalize=this.options.normalize?this.options.normalize:!1,this.options.showMinMax=this.options.showMinMax?this.options.showMinMax:!1,this.additionalYAxis=this.options.additionalYAxis?this.options.additionalYAxis:null,this.dataStorage={},this.options.features.forEach((i,r)=>this.dataStorage[r]={}),this.requestHandler=new _p(t,this.options.endpoint,this.options.features,this.options.retries,this.options.source,this.options.table,this.options.geometry,this.options.timeParameter),this.status="ready",this.chartOptions={responsive:!0,maintainAspectRatio:!1,layout:{padding:{top:60,left:10,bottom:10}},scales:{x:{type:"time",min:this.startTime.toISODate(),max:this.endTime.toISODate(),ticks:{minRotation:0,maxRotation:0}}},interaction:{axis:"x",mode:"nearest",intersect:!1},plugins:{htmlLegend:{containerID:"legend-container",onClick:(i,r)=>{if(r.hidden)this.setActiveFields([...this.activeFields,r.text]);else{const o=this.activeFields.indexOf(r.text),a=this.activeFields;a.splice(o,1),this.setActiveFields(a)}}},legend:{display:!1},tooltip:{callbacks:{title:i=>{var r;return((r=i[0])==null?void 0:r.raw).x.toISODate()},label:i=>{const r=i.raw,o=r.yMin!==null?`; ↓ ${r.yMin.toPrecision(3)}`:"",a=r.yMax!==null?`, ↑ ${r.yMax.toPrecision(3)}`:"";return`${i.dataset.label}: ↔ ${r.y.toPrecision(3)}${o}${a}`}}}}},this.additionalYAxis!==null)for(let i=0;i<this.additionalYAxis.length;i++){const r=this.additionalYAxis[i];this.chartOptions.scales[r.id]={type:"linear",position:"right"}}}checkLoadingStatus(){const t=document.querySelector("eox-chart").shadowRoot.querySelector("#loadingIndicator");let e=!1;Object.keys(this.dataStorage).forEach((n,i)=>{Object.keys(this.dataStorage[i]).forEach(r=>{this.dataStorage[i][r].status==="fetching"&&(e=!0)})}),t.className=e?"loader":"loader hidden"}updateChart(){this.checkLoadingStatus(),this.chart.options=this.chartOptions;const t=[];this.options.features.flat().forEach((e,n)=>{let i=-1;if(this.options.features.forEach((r,o)=>{r.includes(e)&&(i=o)}),i!==-1){let r=[],o=Number.MAX_VALUE,a=Number.MIN_VALUE;Object.keys(this.dataStorage[i]).forEach(u=>{const d=this.dataStorage[i][u];if(d.status==="finished"){if(this.type==="signals"&&Object.keys(d.data).length!==0&&Object.keys(d.data).includes(e)&&(d.data[e].forEach(f=>{const m=f.basicStats;this.options.showMinMax?(o=m.min<o?m.min:o,a=m.max>a?m.max:a):(o=m.mean<o?m.mean:o,a=m.mean>a?m.mean:a)}),r.push(...d.data[e])),this.type==="geodb"&&Object.keys(d.data).length!==0){const f=d.data.map(m=>(m[e]!==null&&(o=m[e]<o?m[e]:o,a=m[e]>a?m[e]:a),{date:m[this.options.timeParameter],basicStats:{mean:m[e]}}));r.push(...f)}}else r.push({date:"missing"})});let l=!1,h=r.map(u=>this.requestHandler.convertData(u));if(h.sort((u,d)=>u.x-d.x),h.length>0&&(l=!0),l&&this.timeAggregation){let u=Number.MIN_VALUE,d=Number.MAX_VALUE;o=Number.MAX_VALUE,a=Number.MIN_VALUE;const f=[];let m=0,g=D.fromObject({year:this.startTime.year,month:this.startTime.month,day:this.startTime.day});for(;g<this.endTime;){let p=0,y=!1;for(;m<h.length&&(Object.keys(h[m]).length===0||h[m].x<g);)m++;const x=m;for(;m<h.length&&(Object.keys(h[m]).length===0||h[m].x<g.plus(this.timeAggregation));){const b=h[m];p+=b.y,u=b.y!==null&&b.y>u?b.y:u,u=b.yMax!==null&&b.yMax>u?b.yMax:u,d=b.y!==null&&b.y<d?b.y:d,d=b.yMin!==null&&b.yMin<d?b.yMin:d,m++,y=!0}const _=m-x;if(_>0&&y){const b=p/_;this.options.showMinMax?(o=d<o?d:o,a=u>a?u:a):(o=b<o?b:o,a=b>a?b:a),f.push({x:g,y:b,yMin:d,yMax:u}),u=Number.MIN_VALUE,d=Number.MAX_VALUE}g=g.plus(this.timeAggregation)}h=f}if(l&&this.options.normalize){const u=a-o;h=h.map(d=>(d.y!==null?d.y=(d.y-o)/u:d.y=null,d.yMin=(d.yMin-o)/u,d.yMax=(d.yMax-o)/u,d))}let c={type:"line",label:e,data:h,hidden:!this.activeFields.includes(e)};if(this.options.showMinMax&&(c={type:"lineWithErrorBars",label:e,data:h,hidden:!this.activeFields.includes(e),errorBarWhiskerLineWidth:2,errorBarColor:"#00000000"}),this.options.colors&&this.options.colors.length>=n){const u=this.options.colors[n];c.backgroundColor=u,c.borderColor=u,this.options.showMinMax&&(c={type:"lineWithErrorBars",label:e,data:h,hidden:!this.activeFields.includes(e),errorBarWhiskerLineWidth:2,errorBarColor:"#00000000",errorBarWhiskerColor:u,errorBarWhiskerSize:10,backgroundColor:u,borderColor:u})}if(this.additionalYAxis!==null)for(let u=0;u<this.additionalYAxis.length;u++){const d=this.additionalYAxis[u];d.containedSignals.includes(e)&&(c.yAxisID=d.id)}t.push(c)}}),this.chart.data={datasets:t},this.chart.update("none")}retrieveMissingData(){const t=[];this.activeFields.forEach(i=>{this.options.features.forEach((r,o)=>{r.includes(i)&&!t.includes(o)&&t.push(o)})});let e=D.fromObject({year:this.endTime.year,month:this.endTime.month}).plus({month:1}).minus({second:1});const n=D.fromObject({year:this.startTime.year,month:this.startTime.month}).plus({month:1}).minus({second:1});for(;e>n;){const i=e.toFormat("yyyyMM");t.forEach(r=>{if(!(i in this.dataStorage[r])){const o=this.requestHandler.fetchData(r,D.fromObject({year:e.year,month:e.month}),D.fromObject({year:e.year,month:e.month}).plus({month:1}).minus({second:1})).then(a=>{this.dataStorage[r][i].data=a,this.dataStorage[r][i].status="finished",this.updateChart()}).catch(()=>{this.dataStorage[r][i].status="failed",this.updateChart()});this.dataStorage[r][i]={request:o,status:"fetching"}}}),e=e.minus({months:1})}}triggerCSVDownload(){const t=[],e=[],n=this.activeFields;n.forEach((l,h)=>{let c=-1;if(this.options.features.forEach((u,d)=>{u.includes(l)&&(c=d)}),c!==-1){let u=[];Object.keys(this.dataStorage[c]).forEach(d=>{const f=this.dataStorage[c][d];f.status==="finished"&&Object.keys(f.data).length!==0&&Object.keys(f.data).includes(l)&&u.push(...f.data[l])}),u.length>0&&(e.push(n[h]),t.push(u))}});const i={};e.forEach((l,h)=>{t[h].forEach(c=>{i[c.date]||(i[c.date]={}),i[c.date][l]=c.basicStats})});let r="time,";const o=e.map(l=>[l,`${l}_max`,`${l}_min`]);r+=o.flat().join(","),r+=`
|
|
24
|
-
`,Object.keys(i).forEach(l=>{const h=[l];e.forEach(c=>{const u=i[l][c]?i[l][c]:null;u!=null?h.push(u.mean,u.max,u.min):h.push("","","")}),r+=h.join(","),r+=`
|
|
25
|
-
`});const a=document.createElement("a");a.href="data:text/csv;charset=utf-8,"+encodeURI(r),a.target="_blank",a.download="chart_data.csv",a.click()}setGeometry(t){this.dataStorage={},this.options.features.forEach((e,n)=>this.dataStorage[n]={}),this.options.geometry=t,this.requestHandler.setGeometry(t),this.retrieveMissingData(),this.updateChart()}setActiveFields(t){this.activeFields=t,this.retrieveMissingData(),this.updateChart()}setTimeInterval(t,e){this.startTime=t,this.endTime=e,this.chartOptions.scales.x.min=t.toISODate(),this.chartOptions.scales.x.max=e.toISODate(),this.retrieveMissingData(),this.updateChart()}setNormalize(t){this.options.normalize=t,this.updateChart()}setShowMinMax(t){this.options.showMinMax=t,this.updateChart()}setTimeAggregation(t){this.timeAggregation=t,this.updateChart()}}class $o{constructor(t,e,n,i){w(this,"element"),w(this,"sdm"),w(this,"sdmOptions"),w(this,"options"),this.element=t,this.sdm=e,this.options=i,this.sdmOptions=n,this.generateTimeAggregationOptions(),this.addNormalizeCheckbox(),this.addShowMinMax(),this.addCSVDownload(),this.generateTimeSelectionOptions(),document.querySelector("eox-chart").shadowRoot.querySelector("#controls").style.display="flex",document.querySelector("eox-chart").shadowRoot.querySelector("#legend-container").style.display="block",document.querySelector("eox-chart").shadowRoot.querySelector("#chart-container").classList.add("controls")}removeStartEndInputs(){const t=document.querySelector("eox-chart").shadowRoot.querySelector("#startInput"),e=document.querySelector("eox-chart").shadowRoot.querySelector("#endInput"),n=document.querySelector("eox-chart").shadowRoot.querySelector("#setTime");t&&e&&n&&(t.style.display="none",e.style.display="none",n.style.display="none")}addStartEndInputs(){const t=document.querySelector("eox-chart").shadowRoot.querySelector("#startInput");t.value=this.sdm.startTime.toISODate(),t.style.display="inline";const e=document.querySelector("eox-chart").shadowRoot.querySelector("#endInput");e.value=this.sdm.endTime.toISODate(),e.style.display="inline";const n=document.querySelector("eox-chart").shadowRoot.querySelector("#setTime");n.style.display="inline",n.addEventListener("click",()=>{const i=D.fromISO(t.value),r=D.fromISO(e.value);i.isValid&&r.isValid?this.sdm.setTimeInterval(i,r):(t.className=i.isValid?"":"parsingError",e.className=r.isValid?"":"parsingError")})}addNormalizeCheckbox(){const t=document.querySelector("eox-chart").shadowRoot.querySelector("#normalize");t.checked=this.sdmOptions.normalize,t.addEventListener("change",()=>{this.sdm.setNormalize(t.checked)})}addShowMinMax(){const t=document.querySelector("eox-chart").shadowRoot.querySelector("#showMinMax");t.checked=this.sdmOptions.showMinMax,t.addEventListener("change",()=>{this.sdm.setShowMinMax(t.checked)})}addCSVDownload(){document.querySelector("eox-chart").shadowRoot.querySelector("#csvDownload").addEventListener("click",()=>{this.sdm.triggerCSVDownload()})}generateTimeSelectionOptions(){document.querySelector("eox-chart").shadowRoot.querySelector("#dateSelect").addEventListener("change",t=>{const e=D.now(),[n,i]=t.target.value.split("-");switch(this.removeStartEndInputs(),n){case"month":this.sdm.setTimeInterval(e.minus({month:Number(i)}),e);break;case"year":this.sdm.setTimeInterval(e.minus({year:Number(i)}),e);break;case"custom":this.addStartEndInputs();break}})}generateTimeAggregationOptions(){document.querySelector("eox-chart").shadowRoot.querySelector("#aggregationSelect").addEventListener("change",t=>{const[e,n]=t.target.value.split("-");switch(e){case"none":this.sdm.setTimeAggregation(null);break;case"week":this.sdm.setTimeAggregation({week:Number(n)});break;case"month":this.sdm.setTimeAggregation({month:Number(n)});break;case"year":this.sdm.setTimeAggregation({year:Number(n)});break}})}}const wp=(s,t)=>{const e=document.querySelector("eox-chart").shadowRoot.getElementById(t);if(!e)return;e.style.overflowY="auto";let n=e.querySelector("ul");return n||(n=document.createElement("ul"),n.style.display="flex",n.style.flexDirection="column",n.style.margin=0,n.style.padding="10px",e.appendChild(n)),n},Mp={id:"htmlLegend",afterUpdate(s,t,e){const n=wp(s,e.containerID);if(n){for(;n.firstChild;)n.firstChild.remove();s.options.plugins.legend.labels.generateLabels(s).sort((i,r)=>i.text<r.text?-1:1).forEach(i=>{const r=document.createElement("li");r.style.alignItems="center",r.style.cursor="pointer",r.style.display="flex",r.style.flexDirection="row",r.style.marginLeft="10px";const o=()=>{e.onClick(null,i)};r.onclick=o;const a=document.createElement("span");a.style.background=i.fillStyle,a.style.borderColor=i.strokeStyle,a.style.borderWidth=i.lineWidth+"px",a.style.display="inline-block",a.style.height="10px",a.style.marginRight="10px",a.style.width="10px";const l=document.createElement("p");l.style.color=i.fontColor,l.style.margin=0,l.style.padding=0,l.style.opacity=i.hidden?"0.5":"1",l.style.fontWeight=i.hidden?"300":"900";const h=document.createTextNode(i.text);l.appendChild(h),r.appendChild(a),r.appendChild(l),n.appendChild(r)})}}},kp=`
|
|
26
|
-
<style>
|
|
27
|
-
:host {
|
|
28
|
-
font-size: small;
|
|
29
|
-
}
|
|
30
|
-
.hidden {
|
|
31
|
-
visibility: hidden;
|
|
32
|
-
}
|
|
33
|
-
.loader {
|
|
34
|
-
width: 20px;
|
|
35
|
-
height: 20px;
|
|
36
|
-
border: 2px solid #004170;
|
|
37
|
-
border-bottom-color: transparent;
|
|
38
|
-
border-radius: 50%;
|
|
39
|
-
display: inline-block;
|
|
40
|
-
box-sizing: border-box;
|
|
41
|
-
animation: rotation 1s linear infinite;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
@keyframes rotation {
|
|
45
|
-
0% {
|
|
46
|
-
transform: rotate(0deg);
|
|
47
|
-
}
|
|
48
|
-
100% {
|
|
49
|
-
transform: rotate(360deg);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
#controls {
|
|
53
|
-
position: absolute;
|
|
54
|
-
width: 100%;
|
|
55
|
-
max-width: 100%;
|
|
56
|
-
display: none;
|
|
57
|
-
gap: 5px;
|
|
58
|
-
flex-direction: row;
|
|
59
|
-
flex-wrap: wrap;
|
|
60
|
-
align-items: center;
|
|
61
|
-
justify-content: space-between;
|
|
62
|
-
z-index: 1;
|
|
63
|
-
}
|
|
64
|
-
select {
|
|
65
|
-
font-size: 11px;
|
|
66
|
-
padding: 3px;
|
|
67
|
-
}
|
|
68
|
-
#csvDownload {
|
|
69
|
-
border: none;
|
|
70
|
-
background: none;
|
|
71
|
-
cursor: pointer;
|
|
72
|
-
margin-left: 7px;
|
|
73
|
-
padding: 0;
|
|
74
|
-
display: flex;
|
|
75
|
-
align-items: center;
|
|
76
|
-
}
|
|
77
|
-
#csvDownload svg {
|
|
78
|
-
width: 24px;
|
|
79
|
-
height: 24px;
|
|
80
|
-
}
|
|
81
|
-
.parsingError {
|
|
82
|
-
background-color: #ff6d6d;
|
|
83
|
-
}
|
|
84
|
-
#chart-container {
|
|
85
|
-
width: 100%;
|
|
86
|
-
height: 100%;
|
|
87
|
-
position: relative;
|
|
88
|
-
}
|
|
89
|
-
#chart-container.controls {
|
|
90
|
-
flex-basis: 80%;
|
|
91
|
-
max-width: 80%;
|
|
92
|
-
width: unset;
|
|
93
|
-
}
|
|
94
|
-
#legend-container {
|
|
95
|
-
flex-basis: 20%;
|
|
96
|
-
margin-top: 50px;
|
|
97
|
-
}
|
|
98
|
-
#legend-container ul {
|
|
99
|
-
padding-top: 0 !important;
|
|
100
|
-
}
|
|
101
|
-
</style>
|
|
102
|
-
<div style="display: flex; width: 100%; height: 100%; max-width: 100%;">
|
|
103
|
-
<div id="controls" class="controls" data-cy="controls">
|
|
104
|
-
<div style="display: flex; align-items: center; padding: 10px;">
|
|
105
|
-
<select id="dateSelect" style="margin-right: 7px;">
|
|
106
|
-
<option value="month-3">3 months back</option>
|
|
107
|
-
<option value="month-6">6 months back</option>
|
|
108
|
-
<option value="year-1">1 year back</option>
|
|
109
|
-
<option value="year-2">2 years back</option>
|
|
110
|
-
<option value="year-3">3 years back</option>
|
|
111
|
-
<option value="custom">custom</option>
|
|
112
|
-
</select>
|
|
113
|
-
<input id="startInput" size="8" style="display: none">
|
|
114
|
-
<input id="endInput" size="8" style="display: none">
|
|
115
|
-
<button id="setTime" style="display: none; margin-right: 7px;">ok</button>
|
|
116
|
-
<select id="aggregationSelect" style="margin-right: 7px;">
|
|
117
|
-
<option value="none">no aggregation</option>
|
|
118
|
-
<option value="week-1">1 week</option>
|
|
119
|
-
<option value="week-2">2 weeks</option>
|
|
120
|
-
<option value="month-1">1 month</option>
|
|
121
|
-
<option value="month-3">3 months</option>
|
|
122
|
-
<option value="month-6">6 months</option>
|
|
123
|
-
</select>
|
|
124
|
-
<label for="normalize">normalize</label>
|
|
125
|
-
<input type="checkbox" id="normalize" value="normalize" style="margin-right: 7px;">
|
|
126
|
-
<label for="showMinMax">show min/max</label>
|
|
127
|
-
<input type="checkbox" id="showMinMax" value="showMinMax" style="margin-right: 7px;">
|
|
128
|
-
<span id="error" style="color: red; display: none;">Retrieving of signals timed out. Please try again.</span>
|
|
129
|
-
</div>
|
|
130
|
-
<div style="display: flex; align-items: center; padding: 10px;">
|
|
131
|
-
<span id="loadingIndicator" class="loader hidden"></span>
|
|
132
|
-
<button id="csvDownload" title="CSV download">
|
|
133
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>download</title><path d="M5,20H19V18H5M19,9H15V3H9V9H5L12,16L19,9Z" /></svg>
|
|
134
|
-
</button>
|
|
135
|
-
</div>
|
|
136
|
-
</div>
|
|
137
|
-
<div id="chart-container">
|
|
138
|
-
<canvas id="chart" class="chart" data-cy="chart"></canvas>
|
|
139
|
-
</div>
|
|
140
|
-
<div id="legend-container" style="display: none"></div>
|
|
141
|
-
</div>
|
|
142
|
-
`,Ql=document.createElement("template");Ql.innerHTML=kp;class Sp extends HTMLElement{constructor(){super(),w(this,"shadowRoot"),w(this,"chart"),w(this,"setData"),w(this,"setOptions"),w(this,"setSignalsData"),w(this,"setSignalsEndpoint"),w(this,"setSignalsGeometry"),w(this,"setGeoDBEndpoint"),this.shadowRoot=this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Ql.content.cloneNode(!0))}connectedCallback(){this.chart=new lt(this.shadowRoot.querySelector("canvas"),{options:{maintainAspectRatio:!1,responsive:!0},data:{labels:[],datasets:[]},plugins:[Mp,{id:"selectionLineHighlight",afterDraw:e=>{if(e&&e.tooltip){const n=e.tooltip.getActiveElements();if(n!=null&&n.length){let i=n[0].element.x,r=e.scales.y,o=e.ctx;o.save(),o.beginPath(),o.moveTo(i,r.top),o.lineTo(i,r.bottom),o.lineWidth=1,o.strokeStyle="rgba(0, 0, 255, 0.4)",o.stroke(),o.restore()}}}}]}),this.setData=e=>{this.chart.data=e,this.chart.update("none")},this.setOptions=e=>{this.chart.options=e,this.chart.update("none")},this.setSignalsData=e=>{this.chart.data={datasets:Object.entries(e).map(([n,i])=>({type:"line",label:n,data:i}))},this.chart.update("none")},this.setSignalsGeometry=e=>{t&&t.setGeometry(e)};let t=null;this.setSignalsEndpoint=e=>{t=new jo("signals",this.chart,e),new $o(document.getElementById("controls"),t,e),t.setActiveFields(e.active)},this.setGeoDBEndpoint=e=>{t=new jo("geodb",this.chart,e),new $o(document.getElementById("controls"),t,e),t.setActiveFields(e.active)}}}customElements.define("eox-chart",Sp);export{Sp as EOxChart};
|