@feedmepos/ui-library 1.5.5 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/CHANGELOG.md +4 -0
- package/dist/components/chart/bar/FmBar.vue.d.ts +39 -3
- package/dist/components/chart/index.d.ts +50 -0
- package/dist/components/chart/line/FmLine.vue.d.ts +42 -3
- package/dist/components/chart/pie/FmPie.vue.d.ts +23 -0
- package/dist/components/form/phone-number/FmPhoneNumber.vue.d.ts +1 -1
- package/dist/components/form/text-field/FmTextField.vue.d.ts +1 -1
- package/dist/components.d.ts +292 -38
- package/dist/federation/FmBar.vue_vue_type_script_setup_true_lang-Bl4sODG-.js +1 -0
- package/dist/federation/{FmDatePicker.vue_vue_type_script_setup_true_lang-CVf7YqmS.js → FmDatePicker.vue_vue_type_script_setup_true_lang-BR6sHrvV.js} +1 -1
- package/dist/federation/{FmDateRangePicker.vue_vue_type_script_setup_true_lang-Cp-NcTG7.js → FmDateRangePicker.vue_vue_type_script_setup_true_lang-CSiD74b7.js} +1 -1
- package/dist/federation/{FmFormGroup.vue_vue_type_script_setup_true_lang-C8ov2Pv_.js → FmFormGroup.vue_vue_type_script_setup_true_lang-CPFsJMqz.js} +1 -1
- package/dist/federation/{FmGlobalSearch.vue_vue_type_script_setup_true_lang-Dn5qQfPo.js → FmGlobalSearch.vue_vue_type_script_setup_true_lang-DVVrreN4.js} +1 -1
- package/dist/federation/{FmLabel.vue_vue_type_script_setup_true_lang-CyTDupXC.js → FmLabel.vue_vue_type_script_setup_true_lang-C1kz7I1W.js} +1 -1
- package/dist/federation/FmLine.vue_vue_type_script_setup_true_lang-BfUXDVEE.js +1 -0
- package/dist/federation/{FmPageHead.vue_vue_type_script_setup_true_lang-CGlBjLgY.js → FmPageHead.vue_vue_type_script_setup_true_lang-DHWKstRJ.js} +1 -1
- package/dist/federation/FmPhoneNumber.vue_vue_type_script_setup_true_lang-CtQVRdRD.js +51 -0
- package/dist/federation/FmPie.vue_vue_type_script_setup_true_lang-DEnVqSIk.js +2 -0
- package/dist/federation/{FmRadioGroup.vue_vue_type_script_setup_true_lang-BAIzXGw3.js → FmRadioGroup.vue_vue_type_script_setup_true_lang-C9uEzB4m.js} +1 -1
- package/dist/federation/{FmSearch.vue_vue_type_script_setup_true_lang-BVxVedt-.js → FmSearch.vue_vue_type_script_setup_true_lang-CXttKhOw.js} +1 -1
- package/dist/federation/{FmTableToolbar.vue_vue_type_script_setup_true_lang-HALhCgyM.js → FmTableToolbar.vue_vue_type_script_setup_true_lang-DW1Z7sfU.js} +1 -1
- package/dist/federation/{FmTextField.vue_vue_type_style_index_0_lang-BuqF3hJ0.js → FmTextField.vue_vue_type_style_index_0_lang-BKQSdS7y.js} +1 -1
- package/dist/federation/{FmTimeInput.vue_vue_type_style_index_0_lang-rSyFp1RK.js → FmTimeInput.vue_vue_type_style_index_0_lang-4x6nMMiP.js} +1 -1
- package/dist/federation/{FmTimePicker.vue_vue_type_script_setup_true_lang-lMEdmDDg.js → FmTimePicker.vue_vue_type_script_setup_true_lang-Dsu7qbKr.js} +1 -1
- package/dist/federation/{FmTimeRangePicker.vue_vue_type_script_setup_true_lang-CJWAvWSk.js → FmTimeRangePicker.vue_vue_type_script_setup_true_lang-BrYVB8yG.js} +1 -1
- package/dist/federation/{__federation_expose_FmBarChart-WYq8CGXV.js → __federation_expose_FmBarChart-maVOJTjq.js} +1 -1
- package/dist/federation/{__federation_expose_FmDatePicker-Bn3Vwh22.js → __federation_expose_FmDatePicker-RrtvdOh4.js} +1 -1
- package/dist/federation/{__federation_expose_FmDatePickerMobile-tzEB9UWH.js → __federation_expose_FmDatePickerMobile-D0tESDmB.js} +1 -1
- package/dist/federation/{__federation_expose_FmDateRangePicker-DH-Sw9CL.js → __federation_expose_FmDateRangePicker-A0Vg-503.js} +1 -1
- package/dist/federation/{__federation_expose_FmDateRangePickerMobile-Bwfn8Z_K.js → __federation_expose_FmDateRangePickerMobile-BZb3pBiL.js} +1 -1
- package/dist/federation/{__federation_expose_FmDropField-CraIk3cE.js → __federation_expose_FmDropField-BXDILay7.js} +1 -1
- package/dist/federation/{__federation_expose_FmFormGroup-B_tji0-s.js → __federation_expose_FmFormGroup-BSNxzoPX.js} +1 -1
- package/dist/federation/{__federation_expose_FmGlobalSearch-D_jMZUfa.js → __federation_expose_FmGlobalSearch-C52I95EN.js} +1 -1
- package/dist/federation/{__federation_expose_FmLabel-BR6nZ4Cc.js → __federation_expose_FmLabel-DTxPb3rG.js} +1 -1
- package/dist/federation/{__federation_expose_FmLineChart-B_THAX96.js → __federation_expose_FmLineChart-BRZZwRvH.js} +1 -1
- package/dist/federation/{__federation_expose_FmPageHead-DVQw94tf.js → __federation_expose_FmPageHead-DqtKbI6k.js} +1 -1
- package/dist/federation/{__federation_expose_FmPhoneNumber-DNejmR5W.js → __federation_expose_FmPhoneNumber-wWwNKTPh.js} +1 -1
- package/dist/federation/{__federation_expose_FmPieChart-Dzt9QEU_.js → __federation_expose_FmPieChart-Cn0ugDlM.js} +1 -1
- package/dist/federation/{__federation_expose_FmRadioGroup-BGWTZkoQ.js → __federation_expose_FmRadioGroup-CbkXvEjy.js} +1 -1
- package/dist/federation/{__federation_expose_FmSearch-C6j_Izqk.js → __federation_expose_FmSearch-DPlCZX53.js} +1 -1
- package/dist/federation/{__federation_expose_FmSelect-BPkWxuJp.js → __federation_expose_FmSelect-lPcVzkTo.js} +1 -1
- package/dist/federation/{__federation_expose_FmStepperField-COqGqOf2.js → __federation_expose_FmStepperField-Bq7UgUQm.js} +1 -1
- package/dist/federation/{__federation_expose_FmTable-CZsd9Z_r.js → __federation_expose_FmTable-C8qb_6Dq.js} +1 -1
- package/dist/federation/{__federation_expose_FmTableToolbar-COgE55h7.js → __federation_expose_FmTableToolbar-ChAVT2cL.js} +1 -1
- package/dist/federation/{__federation_expose_FmTextField-BljHsT4v.js → __federation_expose_FmTextField-BEQsKJ32.js} +1 -1
- package/dist/federation/{__federation_expose_FmTextarea-Duzk5w9Y.js → __federation_expose_FmTextarea-BkAwUMW9.js} +1 -1
- package/dist/federation/{__federation_expose_FmTimeInput-Y5BG8Aue.js → __federation_expose_FmTimeInput-Clm9dFmm.js} +1 -1
- package/dist/federation/{__federation_expose_FmTimePicker-jkNpVC6l.js → __federation_expose_FmTimePicker-CnhpFqZZ.js} +1 -1
- package/dist/federation/{__federation_expose_FmTimeRangePicker-D83ktnJD.js → __federation_expose_FmTimeRangePicker-CYk4UeIk.js} +1 -1
- package/dist/federation/chartjs-plugin-datalabels.esm-C74bC3XK.js +24 -0
- package/dist/federation/feedmepos-ui-components.js +1 -1
- package/dist/federation/{helper-BVOxjFdR.js → helper-BNNOBjyd.js} +1 -1
- package/dist/federation/{index-k8v7kpNr.js → index-f8xLr9zu.js} +2 -2
- package/dist/federation/locale-DnpNb53i.js +1 -0
- package/dist/federation/{useInheritFormState-CS-xMMVp.js → useInheritFormState-fo3LSQ_0.js} +1 -1
- package/dist/feedmepos-ui-library.js +9414 -8772
- package/dist/feedmepos-ui-library.umd.cjs +37 -31
- package/dist/utils/locale.d.ts +1 -0
- package/package.json +2 -1
- package/dist/federation/FmBar.vue_vue_type_script_setup_true_lang-BiGNhPIQ.js +0 -1
- package/dist/federation/FmLine.vue_vue_type_script_setup_true_lang-D-feq6Ni.js +0 -1
- package/dist/federation/FmPhoneNumber.vue_vue_type_script_setup_true_lang-r_7aHX0_.js +0 -51
- package/dist/federation/FmPie.vue_vue_type_script_setup_true_lang-CNra1Yi2.js +0 -2
- package/dist/federation/auto-CXNy_eJA.js +0 -18
- package/dist/federation/locale-rHx6IY80.js +0 -1
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
var Bo=Object.defineProperty;var Wo=(s,t,e)=>t in s?Bo(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e;var M=(s,t,e)=>Wo(s,typeof t!="symbol"?t+"":t,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 ee(s){return s+.5|0}const Mt=(s,t,e)=>Math.max(Math.min(s,e),t);function se(s){return Mt(ee(s*2.55),0,255)}function wt(s){return Mt(ee(s*255),0,255)}function ft(s){return Mt(ee(s/2.55)/100,0,1)}function li(s){return Mt(ee(s*100),0,100)}const nt={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},ps=[..."0123456789ABCDEF"],No=s=>ps[s&15],Ho=s=>ps[(s&240)>>4]+ps[s&15],Te=s=>(s&240)>>4===(s&15),jo=s=>Te(s.r)&&Te(s.g)&&Te(s.b)&&Te(s.a);function $o(s){var t=s.length,e;return s[0]==="#"&&(t===4||t===5?e={r:255&nt[s[1]]*17,g:255&nt[s[2]]*17,b:255&nt[s[3]]*17,a:t===5?nt[s[4]]*17:255}:(t===7||t===9)&&(e={r:nt[s[1]]<<4|nt[s[2]],g:nt[s[3]]<<4|nt[s[4]],b:nt[s[5]]<<4|nt[s[6]],a:t===9?nt[s[7]]<<4|nt[s[8]]:255})),e}const Yo=(s,t)=>s<255?t(s):"";function Uo(s){var t=jo(s)?No:Ho;return s?"#"+t(s.r)+t(s.g)+t(s.b)+Yo(s.a,t):void 0}const Xo=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function hi(s,t,e){const i=t*Math.min(e,1-e),n=(o,r=(o+s/30)%12)=>e-i*Math.max(Math.min(r-3,9-r,1),-1);return[n(0),n(8),n(4)]}function Ko(s,t,e){const i=(n,o=(n+s/60)%6)=>e-e*t*Math.max(Math.min(o,4-o,1),0);return[i(5),i(3),i(1)]}function qo(s,t,e){const i=hi(s,1,.5);let n;for(t+e>1&&(n=1/(t+e),t*=n,e*=n),n=0;n<3;n++)i[n]*=1-t-e,i[n]+=t;return i}function Go(s,t,e,i,n){return s===n?(t-e)/i+(t<e?6:0):t===n?(e-s)/i+2:(s-t)/i+4}function ms(s){const t=s.r/255,e=s.g/255,i=s.b/255,n=Math.max(t,e,i),o=Math.min(t,e,i),r=(n+o)/2;let a,l,h;return n!==o&&(h=n-o,l=r>.5?h/(2-n-o):h/(n+o),a=Go(t,e,i,h,n),a=a*60+.5),[a|0,l||0,r]}function xs(s,t,e,i){return(Array.isArray(t)?s(t[0],t[1],t[2]):s(t,e,i)).map(wt)}function bs(s,t,e){return xs(hi,s,t,e)}function Zo(s,t,e){return xs(qo,s,t,e)}function Jo(s,t,e){return xs(Ko,s,t,e)}function ci(s){return(s%360+360)%360}function Qo(s){const t=Xo.exec(s);let e=255,i;if(!t)return;t[5]!==i&&(e=t[6]?se(+t[5]):wt(+t[5]));const n=ci(+t[2]),o=+t[3]/100,r=+t[4]/100;return t[1]==="hwb"?i=Zo(n,o,r):t[1]==="hsv"?i=Jo(n,o,r):i=bs(n,o,r),{r:i[0],g:i[1],b:i[2],a:e}}function tr(s,t){var e=ms(s);e[0]=ci(e[0]+t),e=bs(e),s.r=e[0],s.g=e[1],s.b=e[2]}function er(s){if(!s)return;const t=ms(s),e=t[0],i=li(t[1]),n=li(t[2]);return s.a<255?`hsla(${e}, ${i}%, ${n}%, ${ft(s.a)})`:`hsl(${e}, ${i}%, ${n}%)`}const di={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"},ui={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 sr(){const s={},t=Object.keys(ui),e=Object.keys(di);let i,n,o,r,a;for(i=0;i<t.length;i++){for(r=a=t[i],n=0;n<e.length;n++)o=e[n],a=a.replace(o,di[o]);o=parseInt(ui[r],16),s[a]=[o>>16&255,o>>8&255,o&255]}return s}let Le;function ir(s){Le||(Le=sr(),Le.transparent=[0,0,0,0]);const t=Le[s.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const nr=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function or(s){const t=nr.exec(s);let e=255,i,n,o;if(t){if(t[7]!==i){const r=+t[7];e=t[8]?se(r):Mt(r*255,0,255)}return i=+t[1],n=+t[3],o=+t[5],i=255&(t[2]?se(i):Mt(i,0,255)),n=255&(t[4]?se(n):Mt(n,0,255)),o=255&(t[6]?se(o):Mt(o,0,255)),{r:i,g:n,b:o,a:e}}}function rr(s){return s&&(s.a<255?`rgba(${s.r}, ${s.g}, ${s.b}, ${ft(s.a)})`:`rgb(${s.r}, ${s.g}, ${s.b})`)}const _s=s=>s<=.0031308?s*12.92:Math.pow(s,1/2.4)*1.055-.055,Yt=s=>s<=.04045?s/12.92:Math.pow((s+.055)/1.055,2.4);function ar(s,t,e){const i=Yt(ft(s.r)),n=Yt(ft(s.g)),o=Yt(ft(s.b));return{r:wt(_s(i+e*(Yt(ft(t.r))-i))),g:wt(_s(n+e*(Yt(ft(t.g))-n))),b:wt(_s(o+e*(Yt(ft(t.b))-o))),a:s.a+e*(t.a-s.a)}}function Ee(s,t,e){if(s){let i=ms(s);i[t]=Math.max(0,Math.min(i[t]+i[t]*e,t===0?360:1)),i=bs(i),s.r=i[0],s.g=i[1],s.b=i[2]}}function fi(s,t){return s&&Object.assign(t||{},s)}function gi(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=wt(s[3]))):(t=fi(s,{r:0,g:0,b:0,a:1}),t.a=wt(t.a)),t}function lr(s){return s.charAt(0)==="r"?or(s):Qo(s)}class Oe{constructor(t){if(t instanceof Oe)return t;const e=typeof t;let i;e==="object"?i=gi(t):e==="string"&&(i=$o(t)||ir(t)||lr(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=fi(this._rgb);return t&&(t.a=ft(t.a)),t}set rgb(t){this._rgb=gi(t)}rgbString(){return this._valid?rr(this._rgb):void 0}hexString(){return this._valid?Uo(this._rgb):void 0}hslString(){return this._valid?er(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,n=t.rgb;let o;const r=e===o?.5:e,a=2*r-1,l=i.a-n.a,h=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;o=1-h,i.r=255&h*i.r+o*n.r+.5,i.g=255&h*i.g+o*n.g+.5,i.b=255&h*i.b+o*n.b+.5,i.a=r*i.a+(1-r)*n.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=ar(this._rgb,t._rgb,e)),this}clone(){return new Oe(this.rgb)}alpha(t){return this._rgb.a=wt(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=ee(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 Ee(this._rgb,2,t),this}darken(t){return Ee(this._rgb,2,-t),this}saturate(t){return Ee(this._rgb,1,t),this}desaturate(t){return Ee(this._rgb,1,-t),this}rotate(t){return tr(this._rgb,t),this}}/*!
|
|
7
|
+
* Chart.js v4.4.3
|
|
8
|
+
* https://www.chartjs.org
|
|
9
|
+
* (c) 2024 Chart.js Contributors
|
|
10
|
+
* Released under the MIT License
|
|
11
|
+
*/function gt(){}const hr=(()=>{let s=0;return()=>s++})();function O(s){return s===null||typeof s>"u"}function z(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 T(s){return s!==null&&Object.prototype.toString.call(s)==="[object Object]"}function H(s){return(typeof s=="number"||s instanceof Number)&&isFinite(+s)}function st(s,t){return H(s)?s:t}function D(s,t){return typeof s>"u"?t:s}const cr=(s,t)=>typeof s=="string"&&s.endsWith("%")?parseFloat(s)/100:+s/t,pi=(s,t)=>typeof s=="string"&&s.endsWith("%")?parseFloat(s)/100*t:+s;function I(s,t,e){if(s&&typeof s.call=="function")return s.apply(e,t)}function R(s,t,e,i){let n,o,r;if(z(s))for(o=s.length,n=0;n<o;n++)t.call(e,s[n],n);else if(T(s))for(r=Object.keys(s),o=r.length,n=0;n<o;n++)t.call(e,s[r[n]],r[n])}function Re(s,t){let e,i,n,o;if(!s||!t||s.length!==t.length)return!1;for(e=0,i=s.length;e<i;++e)if(n=s[e],o=t[e],n.datasetIndex!==o.datasetIndex||n.index!==o.index)return!1;return!0}function Ie(s){if(z(s))return s.map(Ie);if(T(s)){const t=Object.create(null),e=Object.keys(s),i=e.length;let n=0;for(;n<i;++n)t[e[n]]=Ie(s[e[n]]);return t}return s}function mi(s){return["__proto__","prototype","constructor"].indexOf(s)===-1}function dr(s,t,e,i){if(!mi(s))return;const n=t[s],o=e[s];T(n)&&T(o)?ht(n,o,i):t[s]=Ie(o)}function ht(s,t,e){const i=z(t)?t:[t],n=i.length;if(!T(s))return s;e=e||{};const o=e.merger||dr;let r;for(let a=0;a<n;++a){if(r=i[a],!T(r))continue;const l=Object.keys(r);for(let h=0,c=l.length;h<c;++h)o(l[h],s,r,e)}return s}function ie(s,t){return ht(s,t,{merger:ur})}function ur(s,t,e){if(!mi(s))return;const i=t[s],n=e[s];T(i)&&T(n)?ie(i,n):Object.prototype.hasOwnProperty.call(t,s)||(t[s]=Ie(n))}const xi={"":s=>s,x:s=>s.x,y:s=>s.y};function fr(s){const t=s.split("."),e=[];let i="";for(const n of t)i+=n,i.endsWith("\\")?i=i.slice(0,-1)+".":(e.push(i),i="");return e}function gr(s){const t=fr(s);return e=>{for(const i of t){if(i==="")break;e=e&&e[i]}return e}}function kt(s,t){return(xi[t]||(xi[t]=gr(t)))(s)}function ys(s){return s.charAt(0).toUpperCase()+s.slice(1)}const ne=s=>typeof s<"u",St=s=>typeof s=="function",bi=(s,t)=>{if(s.size!==t.size)return!1;for(const e of s)if(!t.has(e))return!1;return!0};function pr(s){return s.type==="mouseup"||s.type==="click"||s.type==="contextmenu"}const F=Math.PI,V=2*F,mr=V+F,ze=Number.POSITIVE_INFINITY,xr=F/180,j=F/2,Tt=F/4,_i=F*2/3,Pt=Math.log10,ct=Math.sign;function oe(s,t,e){return Math.abs(s-t)<e}function yi(s){const t=Math.round(s);s=oe(s,t,s/1e3)?t:s;const e=Math.pow(10,Math.floor(Pt(s))),i=s/e;return(i<=1?1:i<=2?2:i<=5?5:10)*e}function br(s){const t=[],e=Math.sqrt(s);let i;for(i=1;i<e;i++)s%i===0&&(t.push(i),t.push(s/i));return e===(e|0)&&t.push(e),t.sort((n,o)=>n-o).pop(),t}function Ut(s){return!isNaN(parseFloat(s))&&isFinite(s)}function _r(s,t){const e=Math.round(s);return e-t<=s&&e+t>=s}function vi(s,t,e){let i,n,o;for(i=0,n=s.length;i<n;i++)o=s[i][e],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function rt(s){return s*(F/180)}function vs(s){return s*(180/F)}function Mi(s){if(!H(s))return;let t=1,e=0;for(;Math.round(s*t)/t!==s;)t*=10,e++;return e}function wi(s,t){const e=t.x-s.x,i=t.y-s.y,n=Math.sqrt(e*e+i*i);let o=Math.atan2(i,e);return o<-.5*F&&(o+=V),{angle:o,distance:n}}function Ms(s,t){return Math.sqrt(Math.pow(t.x-s.x,2)+Math.pow(t.y-s.y,2))}function yr(s,t){return(s-t+mr)%V-F}function it(s){return(s%V+V)%V}function re(s,t,e,i){const n=it(s),o=it(t),r=it(e),a=it(o-n),l=it(r-n),h=it(n-o),c=it(n-r);return n===o||n===r||i&&o===r||a>l&&h<c}function Y(s,t,e){return Math.max(t,Math.min(e,s))}function vr(s){return Y(s,-32768,32767)}function pt(s,t,e,i=1e-6){return s>=Math.min(t,e)-i&&s<=Math.max(t,e)+i}function ws(s,t,e){e=e||(r=>s[r]<t);let i=s.length-1,n=0,o;for(;i-n>1;)o=n+i>>1,e(o)?n=o:i=o;return{lo:n,hi:i}}const mt=(s,t,e,i)=>ws(s,e,i?n=>{const o=s[n][t];return o<e||o===e&&s[n+1][t]===e}:n=>s[n][t]<e),Mr=(s,t,e)=>ws(s,e,i=>s[i][t]>=e);function wr(s,t,e){let i=0,n=s.length;for(;i<n&&s[i]<t;)i++;for(;n>i&&s[n-1]>e;)n--;return i>0||n<s.length?s.slice(i,n):s}const ki=["push","pop","shift","splice","unshift"];function kr(s,t){if(s._chartjs){s._chartjs.listeners.push(t);return}Object.defineProperty(s,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),ki.forEach(e=>{const i="_onData"+ys(e),n=s[e];Object.defineProperty(s,e,{configurable:!0,enumerable:!1,value(...o){const r=n.apply(this,o);return s._chartjs.listeners.forEach(a=>{typeof a[i]=="function"&&a[i](...o)}),r}})})}function Si(s,t){const e=s._chartjs;if(!e)return;const i=e.listeners,n=i.indexOf(t);n!==-1&&i.splice(n,1),!(i.length>0)&&(ki.forEach(o=>{delete s[o]}),delete s._chartjs)}function Pi(s){const t=new Set(s);return t.size===s.length?s:Array.from(t)}const Di=function(){return typeof window>"u"?function(s){return s()}:window.requestAnimationFrame}();function Ci(s,t){let e=[],i=!1;return function(...n){e=n,i||(i=!0,Di.call(window,()=>{i=!1,s.apply(t,e)}))}}function Sr(s,t){let e;return function(...i){return t?(clearTimeout(e),e=setTimeout(s,t,i)):s.apply(this,i),t}}const ks=s=>s==="start"?"left":s==="end"?"right":"center",X=(s,t,e)=>s==="start"?t:s==="end"?e:(t+e)/2,Pr=(s,t,e,i)=>s===(i?"left":"right")?e:s==="center"?(t+e)/2:t;function Oi(s,t,e){const i=t.length;let n=0,o=i;if(s._sorted){const{iScale:r,_parsed:a}=s,l=r.axis,{min:h,max:c,minDefined:d,maxDefined:u}=r.getUserBounds();d&&(n=Y(Math.min(mt(a,l,h).lo,e?i:mt(t,l,r.getPixelForValue(h)).lo),0,i-1)),u?o=Y(Math.max(mt(a,r.axis,c,!0).hi+1,e?0:mt(t,l,r.getPixelForValue(c),!0).hi+1),n,i)-n:o=i-n}return{start:n,count:o}}function Ai(s){const{xScale:t,yScale:e,_scaleRanges:i}=s,n={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!i)return s._scaleRanges=n,!0;const o=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==e.min||i.ymax!==e.max;return Object.assign(i,n),o}const Fe=s=>s===0||s===1,Ti=(s,t,e)=>-(Math.pow(2,10*(s-=1))*Math.sin((s-t)*V/e)),Li=(s,t,e)=>Math.pow(2,-10*s)*Math.sin((s-t)*V/e)+1,ae={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*j)+1,easeOutSine:s=>Math.sin(s*j),easeInOutSine:s=>-.5*(Math.cos(F*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=>Fe(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=>Fe(s)?s:Ti(s,.075,.3),easeOutElastic:s=>Fe(s)?s:Li(s,.075,.3),easeInOutElastic(s){return Fe(s)?s:s<.5?.5*Ti(s*2,.1125,.45):.5+.5*Li(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-ae.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?ae.easeInBounce(s*2)*.5:ae.easeOutBounce(s*2-1)*.5+.5};function Ss(s){if(s&&typeof s=="object"){const t=s.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Ei(s){return Ss(s)?s:new Oe(s)}function Ps(s){return Ss(s)?s:new Oe(s).saturate(.5).darken(.1).hexString()}const Dr=["x","y","borderWidth","radius","tension"],Cr=["color","borderColor","backgroundColor"];function Or(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:Cr},numbers:{type:"number",properties:Dr}}),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 Ar(s){s.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Ri=new Map;function Tr(s,t){t=t||{};const e=s+JSON.stringify(t);let i=Ri.get(e);return i||(i=new Intl.NumberFormat(s,t),Ri.set(e,i)),i}function le(s,t,e){return Tr(t,e).format(s)}const Ii={values(s){return z(s)?s:""+s},numeric(s,t,e){if(s===0)return"0";const i=this.chart.options.locale;let n,o=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)&&(n="scientific"),o=Lr(s,e)}const r=Pt(Math.abs(o)),a=isNaN(r)?1:Math.max(Math.min(-1*Math.floor(r),20),0),l={notation:n,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),le(s,i,l)},logarithmic(s,t,e){if(s===0)return"0";const i=e[t].significand||s/Math.pow(10,Math.floor(Pt(s)));return[1,2,3,5,10,15].includes(i)||t>.8*e.length?Ii.numeric.call(this,s,t,e):""}};function Lr(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 Ve={formatters:Ii};function Er(s){s.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Ve.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 Lt=Object.create(null),Ds=Object.create(null);function he(s,t){if(!t)return s;const e=t.split(".");for(let i=0,n=e.length;i<n;++i){const o=e[i];s=s[o]||(s[o]=Object.create(null))}return s}function Cs(s,t,e){return typeof t=="string"?ht(he(s,t),e):ht(he(s,""),t)}class Rr{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=i=>i.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(i,n)=>Ps(n.backgroundColor),this.hoverBorderColor=(i,n)=>Ps(n.borderColor),this.hoverColor=(i,n)=>Ps(n.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return Cs(this,t,e)}get(t){return he(this,t)}describe(t,e){return Cs(Ds,t,e)}override(t,e){return Cs(Lt,t,e)}route(t,e,i,n){const o=he(this,t),r=he(this,i),a="_"+e;Object.defineProperties(o,{[a]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[a],h=r[n];return T(l)?Object.assign({},h,l):D(l,h)},set(l){this[a]=l}}})}apply(t){t.forEach(e=>e(this))}}var N=new Rr({_scriptable:s=>!s.startsWith("on"),_indexable:s=>s!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Or,Ar,Er]);function Ir(s){return!s||O(s.size)||O(s.family)?null:(s.style?s.style+" ":"")+(s.weight?s.weight+" ":"")+s.size+"px "+s.family}function Be(s,t,e,i,n){let o=t[n];return o||(o=t[n]=s.measureText(n).width,e.push(n)),o>i&&(i=o),i}function zr(s,t,e,i){i=i||{};let n=i.data=i.data||{},o=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(n=i.data={},o=i.garbageCollect=[],i.font=t),s.save(),s.font=t;let r=0;const a=e.length;let l,h,c,d,u;for(l=0;l<a;l++)if(d=e[l],d!=null&&!z(d))r=Be(s,n,o,r,d);else if(z(d))for(h=0,c=d.length;h<c;h++)u=d[h],u!=null&&!z(u)&&(r=Be(s,n,o,r,u));s.restore();const f=o.length/2;if(f>e.length){for(l=0;l<f;l++)delete n[o[l]];o.splice(0,f)}return r}function Et(s,t,e){const i=s.currentDevicePixelRatio,n=e!==0?Math.max(e/2,.5):0;return Math.round((t-n)*i)/i+n}function zi(s,t){!t&&!s||(t=t||s.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,s.width,s.height),t.restore())}function Os(s,t,e,i){Fi(s,t,e,i,null)}function Fi(s,t,e,i,n){let o,r,a,l,h,c,d,u;const f=t.pointStyle,p=t.rotation,g=t.radius;let m=(p||0)*xr;if(f&&typeof f=="object"&&(o=f.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){s.save(),s.translate(e,i),s.rotate(m),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:n?s.ellipse(e,i,n/2,g,0,0,V):s.arc(e,i,g,0,V),s.closePath();break;case"triangle":c=n?n/2:g,s.moveTo(e+Math.sin(m)*c,i-Math.cos(m)*g),m+=_i,s.lineTo(e+Math.sin(m)*c,i-Math.cos(m)*g),m+=_i,s.lineTo(e+Math.sin(m)*c,i-Math.cos(m)*g),s.closePath();break;case"rectRounded":h=g*.516,l=g-h,r=Math.cos(m+Tt)*l,d=Math.cos(m+Tt)*(n?n/2-h:l),a=Math.sin(m+Tt)*l,u=Math.sin(m+Tt)*(n?n/2-h:l),s.arc(e-d,i-a,h,m-F,m-j),s.arc(e+u,i-r,h,m-j,m),s.arc(e+d,i+a,h,m,m+j),s.arc(e-u,i+r,h,m+j,m+F),s.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*g,c=n?n/2:l,s.rect(e-c,i-l,2*c,2*l);break}m+=Tt;case"rectRot":d=Math.cos(m)*(n?n/2:g),r=Math.cos(m)*g,a=Math.sin(m)*g,u=Math.sin(m)*(n?n/2:g),s.moveTo(e-d,i-a),s.lineTo(e+u,i-r),s.lineTo(e+d,i+a),s.lineTo(e-u,i+r),s.closePath();break;case"crossRot":m+=Tt;case"cross":d=Math.cos(m)*(n?n/2:g),r=Math.cos(m)*g,a=Math.sin(m)*g,u=Math.sin(m)*(n?n/2:g),s.moveTo(e-d,i-a),s.lineTo(e+d,i+a),s.moveTo(e+u,i-r),s.lineTo(e-u,i+r);break;case"star":d=Math.cos(m)*(n?n/2:g),r=Math.cos(m)*g,a=Math.sin(m)*g,u=Math.sin(m)*(n?n/2:g),s.moveTo(e-d,i-a),s.lineTo(e+d,i+a),s.moveTo(e+u,i-r),s.lineTo(e-u,i+r),m+=Tt,d=Math.cos(m)*(n?n/2:g),r=Math.cos(m)*g,a=Math.sin(m)*g,u=Math.sin(m)*(n?n/2:g),s.moveTo(e-d,i-a),s.lineTo(e+d,i+a),s.moveTo(e+u,i-r),s.lineTo(e-u,i+r);break;case"line":r=n?n/2:Math.cos(m)*g,a=Math.sin(m)*g,s.moveTo(e-r,i-a),s.lineTo(e+r,i+a);break;case"dash":s.moveTo(e,i),s.lineTo(e+Math.cos(m)*(n?n/2:g),i+Math.sin(m)*g);break;case!1:s.closePath();break}s.fill(),t.borderWidth>0&&s.stroke()}}function xt(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 We(s,t){s.save(),s.beginPath(),s.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),s.clip()}function Ne(s){s.restore()}function Fr(s,t,e,i,n){if(!t)return s.lineTo(e.x,e.y);if(n==="middle"){const o=(t.x+e.x)/2;s.lineTo(o,t.y),s.lineTo(o,e.y)}else n==="after"!=!!i?s.lineTo(t.x,e.y):s.lineTo(e.x,t.y);s.lineTo(e.x,e.y)}function Vr(s,t,e,i){if(!t)return s.lineTo(e.x,e.y);s.bezierCurveTo(i?t.cp1x:t.cp2x,i?t.cp1y:t.cp2y,i?e.cp2x:e.cp1x,i?e.cp2y:e.cp1y,e.x,e.y)}function Br(s,t){t.translation&&s.translate(t.translation[0],t.translation[1]),O(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 Wr(s,t,e,i,n){if(n.strikethrough||n.underline){const o=s.measureText(i),r=t-o.actualBoundingBoxLeft,a=t+o.actualBoundingBoxRight,l=e-o.actualBoundingBoxAscent,h=e+o.actualBoundingBoxDescent,c=n.strikethrough?(l+h)/2:h;s.strokeStyle=s.fillStyle,s.beginPath(),s.lineWidth=n.decorationWidth||2,s.moveTo(r,c),s.lineTo(a,c),s.stroke()}}function Nr(s,t){const e=s.fillStyle;s.fillStyle=t.color,s.fillRect(t.left,t.top,t.width,t.height),s.fillStyle=e}function Rt(s,t,e,i,n,o={}){const r=z(t)?t:[t],a=o.strokeWidth>0&&o.strokeColor!=="";let l,h;for(s.save(),s.font=n.string,Br(s,o),l=0;l<r.length;++l)h=r[l],o.backdrop&&Nr(s,o.backdrop),a&&(o.strokeColor&&(s.strokeStyle=o.strokeColor),O(o.strokeWidth)||(s.lineWidth=o.strokeWidth),s.strokeText(h,e,i,o.maxWidth)),s.fillText(h,e,i,o.maxWidth),Wr(s,e,i,h,o),i+=Number(n.lineHeight);s.restore()}function ce(s,t){const{x:e,y:i,w:n,h:o,radius:r}=t;s.arc(e+r.topLeft,i+r.topLeft,r.topLeft,1.5*F,F,!0),s.lineTo(e,i+o-r.bottomLeft),s.arc(e+r.bottomLeft,i+o-r.bottomLeft,r.bottomLeft,F,j,!0),s.lineTo(e+n-r.bottomRight,i+o),s.arc(e+n-r.bottomRight,i+o-r.bottomRight,r.bottomRight,j,0,!0),s.lineTo(e+n,i+r.topRight),s.arc(e+n-r.topRight,i+r.topRight,r.topRight,0,-j,!0),s.lineTo(e+r.topLeft,i)}const Hr=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,jr=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function $r(s,t){const e=(""+s).match(Hr);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 Yr=s=>+s||0;function As(s,t){const e={},i=T(t),n=i?Object.keys(t):t,o=T(s)?i?r=>D(s[r],s[t[r]]):r=>s[r]:()=>s;for(const r of n)e[r]=Yr(o(r));return e}function Vi(s){return As(s,{top:"y",right:"x",bottom:"y",left:"x"})}function It(s){return As(s,["topLeft","topRight","bottomLeft","bottomRight"])}function U(s){const t=Vi(s);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function $(s,t){s=s||{},t=t||N.font;let e=D(s.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let i=D(s.style,t.style);i&&!(""+i).match(jr)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const n={family:D(s.family,t.family),lineHeight:$r(D(s.lineHeight,t.lineHeight),e),size:e,style:i,weight:D(s.weight,t.weight),string:""};return n.string=Ir(n),n}function B(s,t,e,i){let n,o,r;for(n=0,o=s.length;n<o;++n)if(r=s[n],r!==void 0&&(t!==void 0&&typeof r=="function"&&(r=r(t)),e!==void 0&&z(r)&&(r=r[e%r.length]),r!==void 0))return r}function Ur(s,t,e){const{min:i,max:n}=s,o=pi(t,(n-i)/2),r=(a,l)=>e&&a===0?0:a+l;return{min:r(i,-Math.abs(o)),max:r(n,o)}}function Dt(s,t){return Object.assign(Object.create(s),t)}function Ts(s,t=[""],e,i,n=()=>s[0]){const o=e||s;typeof i>"u"&&(i=ji("_fallback",s));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:s,_rootScopes:o,_fallback:i,_getTarget:n,override:a=>Ts([a,...s],t,o,i)};return new Proxy(r,{deleteProperty(a,l){return delete a[l],delete a._keys,delete s[0][l],!0},get(a,l){return Wi(a,l,()=>ta(l,t,s,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(s[0])},has(a,l){return $i(a).includes(l)},ownKeys(a){return $i(a)},set(a,l,h){const c=a._storage||(a._storage=n());return a[l]=c[l]=h,delete a._keys,!0}})}function Xt(s,t,e,i){const n={_cacheable:!1,_proxy:s,_context:t,_subProxy:e,_stack:new Set,_descriptors:Bi(s,i),setContext:o=>Xt(s,o,e,i),override:o=>Xt(s.override(o),t,e,i)};return new Proxy(n,{deleteProperty(o,r){return delete o[r],delete s[r],!0},get(o,r,a){return Wi(o,r,()=>Kr(o,r,a))},getOwnPropertyDescriptor(o,r){return o._descriptors.allKeys?Reflect.has(s,r)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(s,r)},getPrototypeOf(){return Reflect.getPrototypeOf(s)},has(o,r){return Reflect.has(s,r)},ownKeys(){return Reflect.ownKeys(s)},set(o,r,a){return s[r]=a,delete o[r],!0}})}function Bi(s,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:i=t.indexable,_allKeys:n=t.allKeys}=s;return{allKeys:n,scriptable:e,indexable:i,isScriptable:St(e)?e:()=>e,isIndexable:St(i)?i:()=>i}}const Xr=(s,t)=>s?s+ys(t):t,Ls=(s,t)=>T(t)&&s!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Wi(s,t,e){if(Object.prototype.hasOwnProperty.call(s,t)||t==="constructor")return s[t];const i=e();return s[t]=i,i}function Kr(s,t,e){const{_proxy:i,_context:n,_subProxy:o,_descriptors:r}=s;let a=i[t];return St(a)&&r.isScriptable(t)&&(a=qr(t,a,s,e)),z(a)&&a.length&&(a=Gr(t,a,s,r.isIndexable)),Ls(t,a)&&(a=Xt(a,n,o&&o[t],r)),a}function qr(s,t,e,i){const{_proxy:n,_context:o,_subProxy:r,_stack:a}=e;if(a.has(s))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+s);a.add(s);let l=t(o,r||i);return a.delete(s),Ls(s,l)&&(l=Es(n._scopes,n,s,l)),l}function Gr(s,t,e,i){const{_proxy:n,_context:o,_subProxy:r,_descriptors:a}=e;if(typeof o.index<"u"&&i(s))return t[o.index%t.length];if(T(t[0])){const l=t,h=n._scopes.filter(c=>c!==l);t=[];for(const c of l){const d=Es(h,n,s,c);t.push(Xt(d,o,r&&r[s],a))}}return t}function Ni(s,t,e){return St(s)?s(t,e):s}const Zr=(s,t)=>s===!0?t:typeof s=="string"?kt(t,s):void 0;function Jr(s,t,e,i,n){for(const o of t){const r=Zr(e,o);if(r){s.add(r);const a=Ni(r._fallback,e,n);if(typeof a<"u"&&a!==e&&a!==i)return a}else if(r===!1&&typeof i<"u"&&e!==i)return null}return!1}function Es(s,t,e,i){const n=t._rootScopes,o=Ni(t._fallback,e,i),r=[...s,...n],a=new Set;a.add(i);let l=Hi(a,r,e,o||e,i);return l===null||typeof o<"u"&&o!==e&&(l=Hi(a,r,o,l,i),l===null)?!1:Ts(Array.from(a),[""],n,o,()=>Qr(t,e,i))}function Hi(s,t,e,i,n){for(;e;)e=Jr(s,t,e,i,n);return e}function Qr(s,t,e){const i=s._getTarget();t in i||(i[t]={});const n=i[t];return z(n)&&T(e)?e:n||{}}function ta(s,t,e,i){let n;for(const o of t)if(n=ji(Xr(o,s),e),typeof n<"u")return Ls(s,n)?Es(e,i,s,n):n}function ji(s,t){for(const e of t){if(!e)continue;const i=e[s];if(typeof i<"u")return i}}function $i(s){let t=s._keys;return t||(t=s._keys=ea(s._scopes)),t}function ea(s){const t=new Set;for(const e of s)for(const i of Object.keys(e).filter(n=>!n.startsWith("_")))t.add(i);return Array.from(t)}function Yi(s,t,e,i){const{iScale:n}=s,{key:o="r"}=this._parsing,r=new Array(i);let a,l,h,c;for(a=0,l=i;a<l;++a)h=a+e,c=t[h],r[a]={r:n.parse(kt(c,o),h)};return r}const sa=Number.EPSILON||1e-14,Kt=(s,t)=>t<s.length&&!s[t].skip&&s[t],Ui=s=>s==="x"?"y":"x";function ia(s,t,e,i){const n=s.skip?t:s,o=t,r=e.skip?t:e,a=Ms(o,n),l=Ms(r,o);let h=a/(a+l),c=l/(a+l);h=isNaN(h)?0:h,c=isNaN(c)?0:c;const d=i*h,u=i*c;return{previous:{x:o.x-d*(r.x-n.x),y:o.y-d*(r.y-n.y)},next:{x:o.x+u*(r.x-n.x),y:o.y+u*(r.y-n.y)}}}function na(s,t,e){const i=s.length;let n,o,r,a,l,h=Kt(s,0);for(let c=0;c<i-1;++c)if(l=h,h=Kt(s,c+1),!(!l||!h)){if(oe(t[c],0,sa)){e[c]=e[c+1]=0;continue}n=e[c]/t[c],o=e[c+1]/t[c],a=Math.pow(n,2)+Math.pow(o,2),!(a<=9)&&(r=3/Math.sqrt(a),e[c]=n*r*t[c],e[c+1]=o*r*t[c])}}function oa(s,t,e="x"){const i=Ui(e),n=s.length;let o,r,a,l=Kt(s,0);for(let h=0;h<n;++h){if(r=a,a=l,l=Kt(s,h+1),!a)continue;const c=a[e],d=a[i];r&&(o=(c-r[e])/3,a[`cp1${e}`]=c-o,a[`cp1${i}`]=d-o*t[h]),l&&(o=(l[e]-c)/3,a[`cp2${e}`]=c+o,a[`cp2${i}`]=d+o*t[h])}}function ra(s,t="x"){const e=Ui(t),i=s.length,n=Array(i).fill(0),o=Array(i);let r,a,l,h=Kt(s,0);for(r=0;r<i;++r)if(a=l,l=h,h=Kt(s,r+1),!!l){if(h){const c=h[t]-l[t];n[r]=c!==0?(h[e]-l[e])/c:0}o[r]=a?h?ct(n[r-1])!==ct(n[r])?0:(n[r-1]+n[r])/2:n[r-1]:n[r]}na(s,n,o),oa(s,o,t)}function He(s,t,e){return Math.max(Math.min(s,e),t)}function aa(s,t){let e,i,n,o,r,a=xt(s[0],t);for(e=0,i=s.length;e<i;++e)r=o,o=a,a=e<i-1&&xt(s[e+1],t),o&&(n=s[e],r&&(n.cp1x=He(n.cp1x,t.left,t.right),n.cp1y=He(n.cp1y,t.top,t.bottom)),a&&(n.cp2x=He(n.cp2x,t.left,t.right),n.cp2y=He(n.cp2y,t.top,t.bottom)))}function la(s,t,e,i,n){let o,r,a,l;if(t.spanGaps&&(s=s.filter(h=>!h.skip)),t.cubicInterpolationMode==="monotone")ra(s,n);else{let h=i?s[s.length-1]:s[0];for(o=0,r=s.length;o<r;++o)a=s[o],l=ia(h,a,s[Math.min(o+1,r-(i?0:1))%r],t.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,h=a}t.capBezierPoints&&aa(s,e)}function Rs(){return typeof window<"u"&&typeof document<"u"}function Is(s){let t=s.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function je(s,t,e){let i;return typeof s=="string"?(i=parseInt(s,10),s.indexOf("%")!==-1&&(i=i/100*t.parentNode[e])):i=s,i}const $e=s=>s.ownerDocument.defaultView.getComputedStyle(s,null);function ha(s,t){return $e(s).getPropertyValue(t)}const ca=["top","right","bottom","left"];function zt(s,t,e){const i={};e=e?"-"+e:"";for(let n=0;n<4;n++){const o=ca[n];i[o]=parseFloat(s[t+"-"+o+e])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const da=(s,t,e)=>(s>0||t>0)&&(!e||!e.shadowRoot);function ua(s,t){const e=s.touches,i=e&&e.length?e[0]:s,{offsetX:n,offsetY:o}=i;let r=!1,a,l;if(da(n,o,s.target))a=n,l=o;else{const h=t.getBoundingClientRect();a=i.clientX-h.left,l=i.clientY-h.top,r=!0}return{x:a,y:l,box:r}}function Ft(s,t){if("native"in s)return s;const{canvas:e,currentDevicePixelRatio:i}=t,n=$e(e),o=n.boxSizing==="border-box",r=zt(n,"padding"),a=zt(n,"border","width"),{x:l,y:h,box:c}=ua(s,e),d=r.left+(c&&a.left),u=r.top+(c&&a.top);let{width:f,height:p}=t;return o&&(f-=r.width+a.width,p-=r.height+a.height),{x:Math.round((l-d)/f*e.width/i),y:Math.round((h-u)/p*e.height/i)}}function fa(s,t,e){let i,n;if(t===void 0||e===void 0){const o=s&&Is(s);if(!o)t=s.clientWidth,e=s.clientHeight;else{const r=o.getBoundingClientRect(),a=$e(o),l=zt(a,"border","width"),h=zt(a,"padding");t=r.width-h.width-l.width,e=r.height-h.height-l.height,i=je(a.maxWidth,o,"clientWidth"),n=je(a.maxHeight,o,"clientHeight")}}return{width:t,height:e,maxWidth:i||ze,maxHeight:n||ze}}const Ye=s=>Math.round(s*10)/10;function ga(s,t,e,i){const n=$e(s),o=zt(n,"margin"),r=je(n.maxWidth,s,"clientWidth")||ze,a=je(n.maxHeight,s,"clientHeight")||ze,l=fa(s,t,e);let{width:h,height:c}=l;if(n.boxSizing==="content-box"){const d=zt(n,"border","width"),u=zt(n,"padding");h-=u.width+d.width,c-=u.height+d.height}return h=Math.max(0,h-o.width),c=Math.max(0,i?h/i:c-o.height),h=Ye(Math.min(h,r,l.maxWidth)),c=Ye(Math.min(c,a,l.maxHeight)),h&&!c&&(c=Ye(h/2)),(t!==void 0||e!==void 0)&&i&&l.height&&c>l.height&&(c=l.height,h=Ye(Math.floor(c*i))),{width:h,height:c}}function Xi(s,t,e){const i=t||1,n=Math.floor(s.height*i),o=Math.floor(s.width*i);s.height=Math.floor(s.height),s.width=Math.floor(s.width);const r=s.canvas;return r.style&&(e||!r.style.height&&!r.style.width)&&(r.style.height=`${s.height}px`,r.style.width=`${s.width}px`),s.currentDevicePixelRatio!==i||r.height!==n||r.width!==o?(s.currentDevicePixelRatio=i,r.height=n,r.width=o,s.ctx.setTransform(i,0,0,i,0,0),!0):!1}const pa=function(){let s=!1;try{const t={get passive(){return s=!0,!1}};Rs()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return s}();function Ki(s,t){const e=ha(s,t),i=e&&e.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Vt(s,t,e,i){return{x:s.x+e*(t.x-s.x),y:s.y+e*(t.y-s.y)}}function ma(s,t,e,i){return{x:s.x+e*(t.x-s.x),y:i==="middle"?e<.5?s.y:t.y:i==="after"?e<1?s.y:t.y:e>0?t.y:s.y}}function xa(s,t,e,i){const n={x:s.cp2x,y:s.cp2y},o={x:t.cp1x,y:t.cp1y},r=Vt(s,n,e),a=Vt(n,o,e),l=Vt(o,t,e),h=Vt(r,a,e),c=Vt(a,l,e);return Vt(h,c,e)}const ba=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,i){return e-i},leftForLtr(e,i){return e-i}}},_a=function(){return{x(s){return s},setWidth(s){},textAlign(s){return s},xPlus(s,t){return s+t},leftForLtr(s,t){return s}}};function qt(s,t,e){return s?ba(t,e):_a()}function qi(s,t){let e,i;(t==="ltr"||t==="rtl")&&(e=s.canvas.style,i=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),s.prevTextDirection=i)}function Gi(s,t){t!==void 0&&(delete s.prevTextDirection,s.canvas.style.setProperty("direction",t[0],t[1]))}function Zi(s){return s==="angle"?{between:re,compare:yr,normalize:it}:{between:pt,compare:(t,e)=>t-e,normalize:t=>t}}function Ji({start:s,end:t,count:e,loop:i,style:n}){return{start:s%e,end:t%e,loop:i&&(t-s+1)%e===0,style:n}}function ya(s,t,e){const{property:i,start:n,end:o}=e,{between:r,normalize:a}=Zi(i),l=t.length;let{start:h,end:c,loop:d}=s,u,f;if(d){for(h+=l,c+=l,u=0,f=l;u<f&&r(a(t[h%l][i]),n,o);++u)h--,c--;h%=l,c%=l}return c<h&&(c+=l),{start:h,end:c,loop:d,style:s.style}}function Qi(s,t,e){if(!e)return[s];const{property:i,start:n,end:o}=e,r=t.length,{compare:a,between:l,normalize:h}=Zi(i),{start:c,end:d,loop:u,style:f}=ya(s,t,e),p=[];let g=!1,m=null,x,_,v;const b=()=>l(n,v,x)&&a(n,v)!==0,y=()=>a(o,x)===0||l(o,v,x),w=()=>g||b(),S=()=>!g||y();for(let k=c,C=c;k<=d;++k)_=t[k%r],!_.skip&&(x=h(_[i]),x!==v&&(g=l(x,n,o),m===null&&w()&&(m=a(x,n)===0?k:C),m!==null&&S()&&(p.push(Ji({start:m,end:k,loop:u,count:r,style:f})),m=null),C=k,v=x));return m!==null&&p.push(Ji({start:m,end:d,loop:u,count:r,style:f})),p}function tn(s,t){const e=[],i=s.segments;for(let n=0;n<i.length;n++){const o=Qi(i[n],s.points,t);o.length&&e.push(...o)}return e}function va(s,t,e,i){let n=0,o=t-1;if(e&&!i)for(;n<t&&!s[n].skip;)n++;for(;n<t&&s[n].skip;)n++;for(n%=t,e&&(o+=n);o>n&&s[o%t].skip;)o--;return o%=t,{start:n,end:o}}function Ma(s,t,e,i){const n=s.length,o=[];let r=t,a=s[t],l;for(l=t+1;l<=e;++l){const h=s[l%n];h.skip||h.stop?a.skip||(i=!1,o.push({start:t%n,end:(l-1)%n,loop:i}),t=r=h.stop?l:null):(r=l,a.skip&&(t=l)),a=h}return r!==null&&o.push({start:t%n,end:r%n,loop:i}),o}function wa(s,t){const e=s.points,i=s.options.spanGaps,n=e.length;if(!n)return[];const o=!!s._loop,{start:r,end:a}=va(e,n,o,i);if(i===!0)return en(s,[{start:r,end:a,loop:o}],e,t);const l=a<r?a+n:a,h=!!s._fullLoop&&r===0&&a===n-1;return en(s,Ma(e,r,l,h),e,t)}function en(s,t,e,i){return!i||!i.setContext||!e?t:ka(s,t,e,i)}function ka(s,t,e,i){const n=s._chart.getContext(),o=sn(s.options),{_datasetIndex:r,options:{spanGaps:a}}=s,l=e.length,h=[];let c=o,d=t[0].start,u=d;function f(p,g,m,x){const _=a?-1:1;if(p!==g){for(p+=l;e[p%l].skip;)p-=_;for(;e[g%l].skip;)g+=_;p%l!==g%l&&(h.push({start:p%l,end:g%l,loop:m,style:x}),c=x,d=g%l)}}for(const p of t){d=a?d:p.start;let g=e[d%l],m;for(u=d+1;u<=p.end;u++){const x=e[u%l];m=sn(i.setContext(Dt(n,{type:"segment",p0:g,p1:x,p0DataIndex:(u-1)%l,p1DataIndex:u%l,datasetIndex:r}))),Sa(m,c)&&f(d,u-1,p.loop,c),g=x,c=m}d<u-1&&f(d,u-1,p.loop,c)}return h}function sn(s){return{backgroundColor:s.backgroundColor,borderCapStyle:s.borderCapStyle,borderDash:s.borderDash,borderDashOffset:s.borderDashOffset,borderJoinStyle:s.borderJoinStyle,borderWidth:s.borderWidth,borderColor:s.borderColor}}function Sa(s,t){if(!t)return!1;const e=[],i=function(n,o){return Ss(o)?(e.includes(o)||e.push(o),e.indexOf(o)):o};return JSON.stringify(s,i)!==JSON.stringify(t,i)}/*!
|
|
12
|
+
* Chart.js v4.4.3
|
|
13
|
+
* https://www.chartjs.org
|
|
14
|
+
* (c) 2024 Chart.js Contributors
|
|
15
|
+
* Released under the MIT License
|
|
16
|
+
*/class Pa{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,n){const o=e.listeners[n],r=e.duration;o.forEach(a=>a({chart:t,initial:e.initial,numSteps:r,currentStep:Math.min(i-e.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=Di.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,n)=>{if(!i.running||!i.items.length)return;const o=i.items;let r=o.length-1,a=!1,l;for(;r>=0;--r)l=o[r],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),a=!0):(o[r]=o[o.length-1],o.pop());a&&(n.draw(),this._notify(n,i,t,"progress")),o.length||(i.running=!1,this._notify(n,i,t,"complete"),i.initial=!1),e+=o.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((i,n)=>Math.max(i,n._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let n=i.length-1;for(;n>=0;--n)i[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var bt=new Pa;const nn="transparent",Da={boolean(s,t,e){return e>.5?t:s},color(s,t,e){const i=Ei(s||nn),n=i.valid&&Ei(t||nn);return n&&n.valid?n.mix(i,e).hexString():t},number(s,t,e){return s+(t-s)*e}};class Ca{constructor(t,e,i,n){const o=e[i];n=B([t.to,n,o,t.from]);const r=B([t.from,o,n]);this._active=!0,this._fn=t.fn||Da[t.type||typeof r],this._easing=ae[t.easing]||ae.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=r,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const n=this._target[this._prop],o=i-this._start,r=this._duration-o;this._start=i,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=B([t.to,e,n,t.from]),this._from=B([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,n=this._prop,o=this._from,r=this._loop,a=this._to;let l;if(this._active=o!==a&&(r||e<i),!this._active){this._target[n]=a,this._notify(!0);return}if(e<0){this._target[n]=o;return}l=e/i%2,l=r&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[n]=this._fn(o,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let n=0;n<i.length;n++)i[n][e]()}}class on{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!T(t))return;const e=Object.keys(N.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(n=>{const o=t[n];if(!T(o))return;const r={};for(const a of e)r[a]=o[a];(z(o.properties)&&o.properties||[n]).forEach(a=>{(a===n||!i.has(a))&&i.set(a,r)})})}_animateOptions(t,e){const i=e.options,n=Aa(t,i);if(!n)return[];const o=this._createAnimations(n,i);return i.$shared&&Oa(t.options.$animations,i).then(()=>{t.options=i},()=>{}),o}_createAnimations(t,e){const i=this._properties,n=[],o=t.$animations||(t.$animations={}),r=Object.keys(e),a=Date.now();let l;for(l=r.length-1;l>=0;--l){const h=r[l];if(h.charAt(0)==="$")continue;if(h==="options"){n.push(...this._animateOptions(t,e));continue}const c=e[h];let d=o[h];const u=i.get(h);if(d)if(u&&d.active()){d.update(u,c,a);continue}else d.cancel();if(!u||!u.duration){t[h]=c;continue}o[h]=d=new Ca(u,t,h,c),n.push(d)}return n}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const i=this._createAnimations(t,e);if(i.length)return bt.add(this._chart,i),!0}}function Oa(s,t){const e=[],i=Object.keys(t);for(let n=0;n<i.length;n++){const o=s[i[n]];o&&o.active()&&e.push(o.wait())}return Promise.all(e)}function Aa(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 rn(s,t){const e=s&&s.options||{},i=e.reverse,n=e.min===void 0?t:0,o=e.max===void 0?t:0;return{start:i?o:n,end:i?n:o}}function Ta(s,t,e){if(e===!1)return!1;const i=rn(s,e),n=rn(t,e);return{top:n.end,right:i.end,bottom:n.start,left:i.start}}function La(s){let t,e,i,n;return T(s)?(t=s.top,e=s.right,i=s.bottom,n=s.left):t=e=i=n=s,{top:t,right:e,bottom:i,left:n,disabled:s===!1}}function an(s,t){const e=[],i=s._getSortedDatasetMetas(t);let n,o;for(n=0,o=i.length;n<o;++n)e.push(i[n].index);return e}function ln(s,t,e,i={}){const n=s.keys,o=i.mode==="single";let r,a,l,h;if(t!==null){for(r=0,a=n.length;r<a;++r){if(l=+n[r],l===e){if(i.all)continue;break}h=s.values[l],H(h)&&(o||t===0||ct(t)===ct(h))&&(t+=h)}return t}}function Ea(s,t){const{iScale:e,vScale:i}=t,n=e.axis==="x"?"x":"y",o=i.axis==="x"?"x":"y",r=Object.keys(s),a=new Array(r.length);let l,h,c;for(l=0,h=r.length;l<h;++l)c=r[l],a[l]={[n]:c,[o]:s[c]};return a}function hn(s,t){const e=s&&s.options.stacked;return e||e===void 0&&t.stack!==void 0}function Ra(s,t,e){return`${s.id}.${t.id}.${e.stack||e.type}`}function Ia(s){const{min:t,max:e,minDefined:i,maxDefined:n}=s.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:n?e:Number.POSITIVE_INFINITY}}function za(s,t,e){const i=s[t]||(s[t]={});return i[e]||(i[e]={})}function cn(s,t,e,i){for(const n of t.getMatchingVisibleMetas(i).reverse()){const o=s[n.index];if(e&&o>0||!e&&o<0)return n.index}return null}function dn(s,t){const{chart:e,_cachedMeta:i}=s,n=e._stacks||(e._stacks={}),{iScale:o,vScale:r,index:a}=i,l=o.axis,h=r.axis,c=Ra(o,r,i),d=t.length;let u;for(let f=0;f<d;++f){const p=t[f],{[l]:g,[h]:m}=p,x=p._stacks||(p._stacks={});u=x[h]=za(n,c,g),u[a]=m,u._top=cn(u,r,!0,i.type),u._bottom=cn(u,r,!1,i.type);const _=u._visualValues||(u._visualValues={});_[a]=m}}function zs(s,t){const e=s.scales;return Object.keys(e).filter(i=>e[i].axis===t).shift()}function Fa(s,t){return Dt(s,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Va(s,t,e){return Dt(s,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function de(s,t){const e=s.controller.index,i=s.vScale&&s.vScale.axis;if(i){t=t||s._parsed;for(const n of t){const o=n._stacks;if(!o||o[i]===void 0||o[i][e]===void 0)return;delete o[i][e],o[i]._visualValues!==void 0&&o[i]._visualValues[e]!==void 0&&delete o[i]._visualValues[e]}}}const Fs=s=>s==="reset"||s==="none",un=(s,t)=>t?s:Object.assign({},s),Ba=(s,t,e)=>s&&!t.hidden&&t._stacked&&{keys:an(e,!0),values:null};class at{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=hn(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&&de(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),n=(d,u,f,p)=>d==="x"?u:d==="r"?p:f,o=e.xAxisID=D(i.xAxisID,zs(t,"x")),r=e.yAxisID=D(i.yAxisID,zs(t,"y")),a=e.rAxisID=D(i.rAxisID,zs(t,"r")),l=e.indexAxis,h=e.iAxisID=n(l,o,r,a),c=e.vAxisID=n(l,r,o,a);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(r),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&&Si(this._data,this),t._stacked&&de(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(T(e)){const n=this._cachedMeta;this._data=Ea(e,n)}else if(i!==e){if(i){Si(i,this);const n=this._cachedMeta;de(n),n._parsed=[]}e&&Object.isExtensible(e)&&kr(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let n=!1;this._dataCheck();const o=e._stacked;e._stacked=hn(e.vScale,e),e.stack!==i.stack&&(n=!0,de(e),e.stack=i.stack),this._resyncElements(t),(n||o!==e._stacked)&&dn(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:n}=this,{iScale:o,_stacked:r}=i,a=o.axis;let l=t===0&&e===n.length?!0:i._sorted,h=t>0&&i._parsed[t-1],c,d,u;if(this._parsing===!1)i._parsed=n,i._sorted=!0,u=n;else{z(n[t])?u=this.parseArrayData(i,n,t,e):T(n[t])?u=this.parseObjectData(i,n,t,e):u=this.parsePrimitiveData(i,n,t,e);const f=()=>d[a]===null||h&&d[a]<h[a];for(c=0;c<e;++c)i._parsed[c+t]=d=u[c],l&&(f()&&(l=!1),h=d);i._sorted=l}r&&dn(this,u)}parsePrimitiveData(t,e,i,n){const{iScale:o,vScale:r}=t,a=o.axis,l=r.axis,h=o.getLabels(),c=o===r,d=new Array(n);let u,f,p;for(u=0,f=n;u<f;++u)p=u+i,d[u]={[a]:c||o.parse(h[p],p),[l]:r.parse(e[p],p)};return d}parseArrayData(t,e,i,n){const{xScale:o,yScale:r}=t,a=new Array(n);let l,h,c,d;for(l=0,h=n;l<h;++l)c=l+i,d=e[c],a[l]={x:o.parse(d[0],c),y:r.parse(d[1],c)};return a}parseObjectData(t,e,i,n){const{xScale:o,yScale:r}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,h=new Array(n);let c,d,u,f;for(c=0,d=n;c<d;++c)u=c+i,f=e[u],h[c]={x:o.parse(kt(f,a),u),y:r.parse(kt(f,l),u)};return h}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const n=this.chart,o=this._cachedMeta,r=e[t.axis],a={keys:an(n,!0),values:e._stacks[t.axis]._visualValues};return ln(a,r,o.index,{mode:i})}updateRangeFromParsed(t,e,i,n){const o=i[e.axis];let r=o===null?NaN:o;const a=n&&i._stacks[e.axis];n&&a&&(n.values=a,r=ln(n,o,this._cachedMeta.index)),t.min=Math.min(t.min,r),t.max=Math.max(t.max,r)}getMinMax(t,e){const i=this._cachedMeta,n=i._parsed,o=i._sorted&&t===i.iScale,r=n.length,a=this._getOtherScale(t),l=Ba(e,i,this.chart),h={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:d}=Ia(a);let u,f;function p(){f=n[u];const g=f[a.axis];return!H(f[t.axis])||c>g||d<g}for(u=0;u<r&&!(!p()&&(this.updateRangeFromParsed(h,t,f,l),o));++u);if(o){for(u=r-1;u>=0;--u)if(!p()){this.updateRangeFromParsed(h,t,f,l);break}}return h}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let n,o,r;for(n=0,o=e.length;n<o;++n)r=e[n][t.axis],H(r)&&i.push(r);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,n=e.vScale,o=this.getParsed(t);return{label:i?""+i.getLabelForValue(o[i.axis]):"",value:n?""+n.getLabelForValue(o[n.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=La(D(this.options.clip,Ta(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,n=i.data||[],o=e.chartArea,r=[],a=this._drawStart||0,l=this._drawCount||n.length-a,h=this.options.drawActiveElementsOnTop;let c;for(i.dataset&&i.dataset.draw(t,o,a,l),c=a;c<a+l;++c){const d=n[c];d.hidden||(d.active&&h?r.push(d):d.draw(t,o))}for(c=0;c<r.length;++c)r[c].draw(t,o)}getStyle(t,e){const i=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const n=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const r=this._cachedMeta.data[t];o=r.$context||(r.$context=Va(this.getContext(),t,r)),o.parsed=this.getParsed(t),o.raw=n.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=Fa(this.chart.getContext(),this.index)),o.dataset=n,o.index=o.datasetIndex=this.index;return o.active=!!e,o.mode=i,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){const n=e==="active",o=this._cachedDataOpts,r=t+"-"+e,a=o[r],l=this.enableOptionSharing&&ne(i);if(a)return un(a,l);const h=this.chart.config,c=h.datasetElementScopeKeys(this._type,t),d=n?[`${t}Hover`,"hover",t,""]:[t,""],u=h.getOptionScopes(this.getDataset(),c),f=Object.keys(N.elements[t]),p=()=>this.getContext(i,n,e),g=h.resolveNamedOptions(u,f,p,d);return g.$shared&&(g.$shared=l,o[r]=Object.freeze(un(g,l))),g}_resolveAnimations(t,e,i){const n=this.chart,o=this._cachedDataOpts,r=`animation-${e}`,a=o[r];if(a)return a;let l;if(n.options.animation!==!1){const c=this.chart.config,d=c.datasetAnimationScopeKeys(this._type,e),u=c.getOptionScopes(this.getDataset(),d);l=c.createResolver(u,this.getContext(t,i,e))}const h=new on(n,l&&l.animations);return l&&l._cacheable&&(o[r]=Object.freeze(h)),h}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Fs(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),n=this._sharedOptions,o=this.getSharedOptions(i),r=this.includeOptions(e,o)||o!==n;return this.updateSharedOptions(o,e,i),{sharedOptions:o,includeOptions:r}}updateElement(t,e,i,n){Fs(n)?Object.assign(t,i):this._resolveAnimations(e,n).update(t,i)}updateSharedOptions(t,e,i){t&&!Fs(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,n){t.active=n;const o=this.getStyle(e,n);this._resolveAnimations(e,i,n).update(t,{options:!n&&this.getSharedOptions(o)||o})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[a,l,h]of this._syncList)this[a](l,h);this._syncList=[];const n=i.length,o=e.length,r=Math.min(o,n);r&&this.parse(0,r),o>n?this._insertElements(n,o-n,t):o<n&&this._removeElements(o,n-o)}_insertElements(t,e,i=!0){const n=this._cachedMeta,o=n.data,r=t+e;let a;const l=h=>{for(h.length+=e,a=h.length-1;a>=r;a--)h[a]=h[a-e]};for(l(o),a=t;a<r;++a)o[a]=new this.dataElementType;this._parsing&&l(n._parsed),this.parse(t,e),i&&this.updateElements(o,t,e,"reset")}updateElements(t,e,i,n){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const n=i._parsed.splice(t,e);i._stacked&&de(i,n)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,n]=t;this[e](i,n)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}M(at,"defaults",{}),M(at,"datasetElementType",null),M(at,"dataElementType",null);function Wa(s,t){if(!s._cache.$bar){const e=s.getMatchingVisibleMetas(t);let i=[];for(let n=0,o=e.length;n<o;n++)i=i.concat(e[n].controller.getAllParsedValues(s));s._cache.$bar=Pi(i.sort((n,o)=>n-o))}return s._cache.$bar}function Na(s){const t=s.iScale,e=Wa(t,s.type);let i=t._length,n,o,r,a;const l=()=>{r===32767||r===-32768||(ne(a)&&(i=Math.min(i,Math.abs(r-a)||i)),a=r)};for(n=0,o=e.length;n<o;++n)r=t.getPixelForValue(e[n]),l();for(a=void 0,n=0,o=t.ticks.length;n<o;++n)r=t.getPixelForTick(n),l();return i}function Ha(s,t,e,i){const n=e.barThickness;let o,r;return O(n)?(o=t.min*e.categoryPercentage,r=e.barPercentage):(o=n*i,r=1),{chunk:o/i,ratio:r,start:t.pixels[s]-o/2}}function ja(s,t,e,i){const n=t.pixels,o=n[s];let r=s>0?n[s-1]:null,a=s<n.length-1?n[s+1]:null;const l=e.categoryPercentage;r===null&&(r=o-(a===null?t.end-t.start:a-o)),a===null&&(a=o+o-r);const h=o-(o-Math.min(r,a))/2*l;return{chunk:Math.abs(a-r)/2*l/i,ratio:e.barPercentage,start:h}}function $a(s,t,e,i){const n=e.parse(s[0],i),o=e.parse(s[1],i),r=Math.min(n,o),a=Math.max(n,o);let l=r,h=a;Math.abs(r)>Math.abs(a)&&(l=a,h=r),t[e.axis]=h,t._custom={barStart:l,barEnd:h,start:n,end:o,min:r,max:a}}function fn(s,t,e,i){return z(s)?$a(s,t,e,i):t[e.axis]=e.parse(s,i),t}function gn(s,t,e,i){const n=s.iScale,o=s.vScale,r=n.getLabels(),a=n===o,l=[];let h,c,d,u;for(h=e,c=e+i;h<c;++h)u=t[h],d={},d[n.axis]=a||n.parse(r[h],h),l.push(fn(u,d,o,h));return l}function Vs(s){return s&&s.barStart!==void 0&&s.barEnd!==void 0}function Ya(s,t,e){return s!==0?ct(s):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function Ua(s){let t,e,i,n,o;return s.horizontal?(t=s.base>s.x,e="left",i="right"):(t=s.base<s.y,e="bottom",i="top"),t?(n="end",o="start"):(n="start",o="end"),{start:e,end:i,reverse:t,top:n,bottom:o}}function Xa(s,t,e,i){let n=t.borderSkipped;const o={};if(!n){s.borderSkipped=o;return}if(n===!0){s.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:r,end:a,reverse:l,top:h,bottom:c}=Ua(s);n==="middle"&&e&&(s.enableBorderRadius=!0,(e._top||0)===i?n=h:(e._bottom||0)===i?n=c:(o[pn(c,r,a,l)]=!0,n=h)),o[pn(n,r,a,l)]=!0,s.borderSkipped=o}function pn(s,t,e,i){return i?(s=Ka(s,t,e),s=mn(s,e,t)):s=mn(s,t,e),s}function Ka(s,t,e){return s===t?e:s===e?t:s}function mn(s,t,e){return s==="start"?t:s==="end"?e:s}function qa(s,{inflateAmount:t},e){s.inflateAmount=t==="auto"?e===1?.33:0:t}class Ue extends at{parsePrimitiveData(t,e,i,n){return gn(t,e,i,n)}parseArrayData(t,e,i,n){return gn(t,e,i,n)}parseObjectData(t,e,i,n){const{iScale:o,vScale:r}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,h=o.axis==="x"?a:l,c=r.axis==="x"?a:l,d=[];let u,f,p,g;for(u=i,f=i+n;u<f;++u)g=e[u],p={},p[o.axis]=o.parse(kt(g,h),u),d.push(fn(kt(g,c),p,r,u));return d}updateRangeFromParsed(t,e,i,n){super.updateRangeFromParsed(t,e,i,n);const o=i._custom;o&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,o.min),t.max=Math.max(t.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:i,vScale:n}=e,o=this.getParsed(t),r=o._custom,a=Vs(r)?"["+r.start+", "+r.end+"]":""+n.getLabelForValue(o[n.axis]);return{label:""+i.getLabelForValue(o[i.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,i,n){const o=n==="reset",{index:r,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),h=a.isHorizontal(),c=this._getRuler(),{sharedOptions:d,includeOptions:u}=this._getSharedOptions(e,n);for(let f=e;f<e+i;f++){const p=this.getParsed(f),g=o||O(p[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(f),m=this._calculateBarIndexPixels(f,c),x=(p._stacks||{})[a.axis],_={horizontal:h,base:g.base,enableBorderRadius:!x||Vs(p._custom)||r===x._top||r===x._bottom,x:h?g.head:m.center,y:h?m.center:g.head,height:h?m.size:Math.abs(g.size),width:h?Math.abs(g.size):m.size};u&&(_.options=d||this.resolveDataElementOptions(f,t[f].active?"active":n));const v=_.options||t[f].options;Xa(_,v,x,r),qa(_,v,c.ratio),this.updateElement(t[f],f,_,n)}}_getStacks(t,e){const{iScale:i}=this._cachedMeta,n=i.getMatchingVisibleMetas(this._type).filter(l=>l.controller.options.grouped),o=i.options.stacked,r=[],a=l=>{const h=l.controller.getParsed(e),c=h&&h[l.vScale.axis];if(O(c)||isNaN(c))return!0};for(const l of n)if(!(e!==void 0&&a(l))&&((o===!1||r.indexOf(l.stack)===-1||o===void 0&&l.stack===void 0)&&r.push(l.stack),l.index===t))break;return r.length||r.push(void 0),r}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){const n=this._getStacks(t,i),o=e!==void 0?n.indexOf(e):-1;return o===-1?n.length-1:o}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,n=[];let o,r;for(o=0,r=e.data.length;o<r;++o)n.push(i.getPixelForValue(this.getParsed(o)[i.axis],o));const a=t.barThickness;return{min:a||Na(e),pixels:n,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i,index:n},options:{base:o,minBarLength:r}}=this,a=o||0,l=this.getParsed(t),h=l._custom,c=Vs(h);let d=l[e.axis],u=0,f=i?this.applyStack(e,l,i):d,p,g;f!==d&&(u=f-d,f=d),c&&(d=h.barStart,f=h.barEnd-h.barStart,d!==0&&ct(d)!==ct(h.barEnd)&&(u=0),u+=d);const m=!O(o)&&!c?o:u;let x=e.getPixelForValue(m);if(this.chart.getDataVisibility(t)?p=e.getPixelForValue(u+f):p=x,g=p-x,Math.abs(g)<r){g=Ya(g,e,a)*r,d===a&&(x-=g/2);const _=e.getPixelForDecimal(0),v=e.getPixelForDecimal(1),b=Math.min(_,v),y=Math.max(_,v);x=Math.max(Math.min(x,y),b),p=x+g,i&&!c&&(l._stacks[e.axis]._visualValues[n]=e.getValueForPixel(p)-e.getValueForPixel(x))}if(x===e.getPixelForValue(a)){const _=ct(g)*e.getLineWidthForValue(a)/2;x+=_,g-=_}return{size:g,base:x,head:p,center:p+g/2}}_calculateBarIndexPixels(t,e){const i=e.scale,n=this.options,o=n.skipNull,r=D(n.maxBarThickness,1/0);let a,l;if(e.grouped){const h=o?this._getStackCount(t):e.stackCount,c=n.barThickness==="flex"?ja(t,e,n,h):Ha(t,e,n,h),d=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0);a=c.start+c.chunk*d+c.chunk/2,l=Math.min(r,c.chunk*c.ratio)}else a=i.getPixelForValue(this.getParsed(t)[i.axis],t),l=Math.min(r,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,i=t.data,n=i.length;let o=0;for(;o<n;++o)this.getParsed(o)[e.axis]!==null&&!i[o].hidden&&i[o].draw(this._ctx)}}M(Ue,"id","bar"),M(Ue,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),M(Ue,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class Xe extends at{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,i,n){const o=super.parsePrimitiveData(t,e,i,n);for(let r=0;r<o.length;r++)o[r]._custom=this.resolveDataElementOptions(r+i).radius;return o}parseArrayData(t,e,i,n){const o=super.parseArrayData(t,e,i,n);for(let r=0;r<o.length;r++){const a=e[i+r];o[r]._custom=D(a[2],this.resolveDataElementOptions(r+i).radius)}return o}parseObjectData(t,e,i,n){const o=super.parseObjectData(t,e,i,n);for(let r=0;r<o.length;r++){const a=e[i+r];o[r]._custom=D(a&&a.r&&+a.r,this.resolveDataElementOptions(r+i).radius)}return o}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let i=t.length-1;i>=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:n,yScale:o}=e,r=this.getParsed(t),a=n.getLabelForValue(r.x),l=o.getLabelForValue(r.y),h=r._custom;return{label:i[t]||"",value:"("+a+", "+l+(h?", "+h:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,n){const o=n==="reset",{iScale:r,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:h}=this._getSharedOptions(e,n),c=r.axis,d=a.axis;for(let u=e;u<e+i;u++){const f=t[u],p=!o&&this.getParsed(u),g={},m=g[c]=o?r.getPixelForDecimal(.5):r.getPixelForValue(p[c]),x=g[d]=o?a.getBasePixel():a.getPixelForValue(p[d]);g.skip=isNaN(m)||isNaN(x),h&&(g.options=l||this.resolveDataElementOptions(u,f.active?"active":n),o&&(g.options.radius=0)),this.updateElement(f,u,g,n)}}resolveDataElementOptions(t,e){const i=this.getParsed(t);let n=super.resolveDataElementOptions(t,e);n.$shared&&(n=Object.assign({},n,{$shared:!1}));const o=n.radius;return e!=="active"&&(n.radius=0),n.radius+=D(i&&i._custom,o),n}}M(Xe,"id","bubble"),M(Xe,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),M(Xe,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function Ga(s,t,e){let i=1,n=1,o=0,r=0;if(t<V){const a=s,l=a+t,h=Math.cos(a),c=Math.sin(a),d=Math.cos(l),u=Math.sin(l),f=(v,b,y)=>re(v,a,l,!0)?1:Math.max(b,b*e,y,y*e),p=(v,b,y)=>re(v,a,l,!0)?-1:Math.min(b,b*e,y,y*e),g=f(0,h,d),m=f(j,c,u),x=p(F,h,d),_=p(F+j,c,u);i=(g-x)/2,n=(m-_)/2,o=-(g+x)/2,r=-(m+_)/2}return{ratioX:i,ratioY:n,offsetX:o,offsetY:r}}class Bt extends at{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,n=this._cachedMeta;if(this._parsing===!1)n._parsed=i;else{let o=l=>+i[l];if(T(i[t])){const{key:l="value"}=this._parsing;o=h=>+kt(i[h],l)}let r,a;for(r=t,a=t+e;r<a;++r)n._parsed[r]=o(r)}}_getRotation(){return rt(this.options.rotation-90)}_getCircumference(){return rt(this.options.circumference)}_getRotationExtents(){let t=V,e=-V;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const n=this.chart.getDatasetMeta(i).controller,o=n._getRotation(),r=n._getCircumference();t=Math.min(t,o),e=Math.max(e,o+r)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:i}=e,n=this._cachedMeta,o=n.data,r=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,a=Math.max((Math.min(i.width,i.height)-r)/2,0),l=Math.min(cr(this.options.cutout,a),1),h=this._getRingWeight(this.index),{circumference:c,rotation:d}=this._getRotationExtents(),{ratioX:u,ratioY:f,offsetX:p,offsetY:g}=Ga(d,c,l),m=(i.width-r)/u,x=(i.height-r)/f,_=Math.max(Math.min(m,x)/2,0),v=pi(this.options.radius,_),b=Math.max(v*l,0),y=(v-b)/this._getVisibleDatasetWeightTotal();this.offsetX=p*v,this.offsetY=g*v,n.total=this.calculateTotal(),this.outerRadius=v-y*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-y*h,0),this.updateElements(o,0,o.length,t)}_circumference(t,e){const i=this.options,n=this._cachedMeta,o=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||n._parsed[t]===null||n.data[t].hidden?0:this.calculateCircumference(n._parsed[t]*o/V)}updateElements(t,e,i,n){const o=n==="reset",r=this.chart,a=r.chartArea,l=r.options.animation,h=(a.left+a.right)/2,c=(a.top+a.bottom)/2,d=o&&l.animateScale,u=d?0:this.innerRadius,f=d?0:this.outerRadius,{sharedOptions:p,includeOptions:g}=this._getSharedOptions(e,n);let m=this._getRotation(),x;for(x=0;x<e;++x)m+=this._circumference(x,o);for(x=e;x<e+i;++x){const _=this._circumference(x,o),v=t[x],b={x:h+this.offsetX,y:c+this.offsetY,startAngle:m,endAngle:m+_,circumference:_,outerRadius:f,innerRadius:u};g&&(b.options=p||this.resolveDataElementOptions(x,v.active?"active":n)),m+=_,this.updateElement(v,x,b,n)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let i=0,n;for(n=0;n<e.length;n++){const o=t._parsed[n];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(n)&&!e[n].hidden&&(i+=Math.abs(o))}return i}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?V*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,n=i.data.labels||[],o=le(e._parsed[t],i.options.locale);return{label:n[t]||"",value:o}}getMaxBorderWidth(t){let e=0;const i=this.chart;let n,o,r,a,l;if(!t){for(n=0,o=i.data.datasets.length;n<o;++n)if(i.isDatasetVisible(n)){r=i.getDatasetMeta(n),t=r.data,a=r.controller;break}}if(!t)return 0;for(n=0,o=t.length;n<o;++n)l=a.resolveDataElementOptions(n),l.borderAlign!=="inner"&&(e=Math.max(e,l.borderWidth||0,l.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let i=0,n=t.length;i<n;++i){const o=this.resolveDataElementOptions(i);e=Math.max(e,o.offset||0,o.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));return e}_getRingWeight(t){return Math.max(D(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}M(Bt,"id","doughnut"),M(Bt,"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"}),M(Bt,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),M(Bt,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:n}}=t.legend.options;return e.labels.map((o,r)=>{const a=t.getDatasetMeta(0).controller.getStyle(r);return{text:o,fillStyle:a.backgroundColor,strokeStyle:a.borderColor,fontColor:n,lineWidth:a.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(r),index:r}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}});class Ke extends at{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:n=[],_dataset:o}=e,r=this.chart._animationsDisabled;let{start:a,count:l}=Oi(e,n,r);this._drawStart=a,this._drawCount=l,Ai(e)&&(a=0,l=n.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!o._decimated,i.points=n;const h=this.resolveDatasetElementOptions(t);this.options.showLine||(h.borderWidth=0),h.segment=this.options.segment,this.updateElement(i,void 0,{animated:!r,options:h},t),this.updateElements(n,a,l,t)}updateElements(t,e,i,n){const o=n==="reset",{iScale:r,vScale:a,_stacked:l,_dataset:h}=this._cachedMeta,{sharedOptions:c,includeOptions:d}=this._getSharedOptions(e,n),u=r.axis,f=a.axis,{spanGaps:p,segment:g}=this.options,m=Ut(p)?p:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||o||n==="none",_=e+i,v=t.length;let b=e>0&&this.getParsed(e-1);for(let y=0;y<v;++y){const w=t[y],S=x?w:{};if(y<e||y>=_){S.skip=!0;continue}const k=this.getParsed(y),C=O(k[f]),P=S[u]=r.getPixelForValue(k[u],y),L=S[f]=o||C?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,k,l):k[f],y);S.skip=isNaN(P)||isNaN(L)||C,S.stop=y>0&&Math.abs(k[u]-b[u])>m,g&&(S.parsed=k,S.raw=h.data[y]),d&&(S.options=c||this.resolveDataElementOptions(y,w.active?"active":n)),x||this.updateElement(w,y,S,n),b=k}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return i;const o=n[0].size(this.resolveDataElementOptions(0)),r=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,o,r)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}M(Ke,"id","line"),M(Ke,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),M(Ke,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class ue extends at{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,n=i.data.labels||[],o=le(e._parsed[t].r,i.options.locale);return{label:n[t]||"",value:o}}parseObjectData(t,e,i,n){return Yi.bind(this)(t,e,i,n)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,n)=>{const o=this.getParsed(n).r;!isNaN(o)&&this.chart.getDataVisibility(n)&&(o<e.min&&(e.min=o),o>e.max&&(e.max=o))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,n=Math.min(e.right-e.left,e.bottom-e.top),o=Math.max(n/2,0),r=Math.max(i.cutoutPercentage?o/100*i.cutoutPercentage:1,0),a=(o-r)/t.getVisibleDatasetCount();this.outerRadius=o-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,e,i,n){const o=n==="reset",r=this.chart,a=r.options.animation,l=this._cachedMeta.rScale,h=l.xCenter,c=l.yCenter,d=l.getIndexAngle(0)-.5*F;let u=d,f;const p=360/this.countVisibleElements();for(f=0;f<e;++f)u+=this._computeAngle(f,n,p);for(f=e;f<e+i;f++){const g=t[f];let m=u,x=u+this._computeAngle(f,n,p),_=r.getDataVisibility(f)?l.getDistanceFromCenterForValue(this.getParsed(f).r):0;u=x,o&&(a.animateScale&&(_=0),a.animateRotate&&(m=x=d));const v={x:h,y:c,innerRadius:0,outerRadius:_,startAngle:m,endAngle:x,options:this.resolveDataElementOptions(f,g.active?"active":n)};this.updateElement(g,f,v,n)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((i,n)=>{!isNaN(this.getParsed(n).r)&&this.chart.getDataVisibility(n)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?rt(this.resolveDataElementOptions(t,e).angle||i):0}}M(ue,"id","polarArea"),M(ue,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),M(ue,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:n}}=t.legend.options;return e.labels.map((o,r)=>{const a=t.getDatasetMeta(0).controller.getStyle(r);return{text:o,fillStyle:a.backgroundColor,strokeStyle:a.borderColor,fontColor:n,lineWidth:a.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(r),index:r}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class Bs extends Bt{}M(Bs,"id","pie"),M(Bs,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class qe extends at{getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,n){return Yi.bind(this)(t,e,i,n)}update(t){const e=this._cachedMeta,i=e.dataset,n=e.data||[],o=e.iScale.getLabels();if(i.points=n,t!=="resize"){const r=this.resolveDatasetElementOptions(t);this.options.showLine||(r.borderWidth=0);const a={_loop:!0,_fullLoop:o.length===n.length,options:r};this.updateElement(i,void 0,a,t)}this.updateElements(n,0,n.length,t)}updateElements(t,e,i,n){const o=this._cachedMeta.rScale,r=n==="reset";for(let a=e;a<e+i;a++){const l=t[a],h=this.resolveDataElementOptions(a,l.active?"active":n),c=o.getPointPositionForValue(a,this.getParsed(a).r),d=r?o.xCenter:c.x,u=r?o.yCenter:c.y,f={x:d,y:u,angle:c.angle,skip:isNaN(d)||isNaN(u),options:h};this.updateElement(l,a,f,n)}}}M(qe,"id","radar"),M(qe,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),M(qe,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class Ge extends at{getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:n,yScale:o}=e,r=this.getParsed(t),a=n.getLabelForValue(r.x),l=o.getLabelForValue(r.y);return{label:i[t]||"",value:"("+a+", "+l+")"}}update(t){const e=this._cachedMeta,{data:i=[]}=e,n=this.chart._animationsDisabled;let{start:o,count:r}=Oi(e,i,n);if(this._drawStart=o,this._drawCount=r,Ai(e)&&(o=0,r=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:a,_dataset:l}=e;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!l._decimated,a.points=i;const h=this.resolveDatasetElementOptions(t);h.segment=this.options.segment,this.updateElement(a,void 0,{animated:!n,options:h},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(i,o,r,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,i,n){const o=n==="reset",{iScale:r,vScale:a,_stacked:l,_dataset:h}=this._cachedMeta,c=this.resolveDataElementOptions(e,n),d=this.getSharedOptions(c),u=this.includeOptions(n,d),f=r.axis,p=a.axis,{spanGaps:g,segment:m}=this.options,x=Ut(g)?g:Number.POSITIVE_INFINITY,_=this.chart._animationsDisabled||o||n==="none";let v=e>0&&this.getParsed(e-1);for(let b=e;b<e+i;++b){const y=t[b],w=this.getParsed(b),S=_?y:{},k=O(w[p]),C=S[f]=r.getPixelForValue(w[f],b),P=S[p]=o||k?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,w,l):w[p],b);S.skip=isNaN(C)||isNaN(P)||k,S.stop=b>0&&Math.abs(w[f]-v[f])>x,m&&(S.parsed=w,S.raw=h.data[b]),u&&(S.options=d||this.resolveDataElementOptions(b,y.active?"active":n)),_||this.updateElement(y,b,S,n),v=w}this.updateSharedOptions(d,n,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 i=t.dataset,n=i.options&&i.options.borderWidth||0;if(!e.length)return n;const o=e[0].size(this.resolveDataElementOptions(0)),r=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(n,o,r)/2}}M(Ge,"id","scatter"),M(Ge,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),M(Ge,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var Za=Object.freeze({__proto__:null,BarController:Ue,BubbleController:Xe,DoughnutController:Bt,LineController:Ke,PieController:Bs,PolarAreaController:ue,RadarController:qe,ScatterController:Ge});function Wt(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class ai{constructor(t){M(this,"options");this.options=t||{}}static override(t){Object.assign(ai.prototype,t)}init(){}formats(){return Wt()}parse(){return Wt()}format(){return Wt()}add(){return Wt()}diff(){return Wt()}startOf(){return Wt()}endOf(){return Wt()}}var Ja={_date:ai};function Qa(s,t,e,i){const{controller:n,data:o,_sorted:r}=s,a=n._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&r&&o.length){const l=a._reversePixels?Mr:mt;if(i){if(n._sharedOptions){const h=o[0],c=typeof h.getRange=="function"&&h.getRange(t);if(c){const d=l(o,t,e-c),u=l(o,t,e+c);return{lo:d.lo,hi:u.hi}}}}else return l(o,t,e)}return{lo:0,hi:o.length-1}}function fe(s,t,e,i,n){const o=s.getSortedVisibleDatasetMetas(),r=e[t];for(let a=0,l=o.length;a<l;++a){const{index:h,data:c}=o[a],{lo:d,hi:u}=Qa(o[a],t,r,n);for(let f=d;f<=u;++f){const p=c[f];p.skip||i(p,h,f)}}}function tl(s){const t=s.indexOf("x")!==-1,e=s.indexOf("y")!==-1;return function(i,n){const o=t?Math.abs(i.x-n.x):0,r=e?Math.abs(i.y-n.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(r,2))}}function Ws(s,t,e,i,n){const o=[];return!n&&!s.isPointInArea(t)||fe(s,e,t,function(r,a,l){!n&&!xt(r,s.chartArea,0)||r.inRange(t.x,t.y,i)&&o.push({element:r,datasetIndex:a,index:l})},!0),o}function el(s,t,e,i){let n=[];function o(r,a,l){const{startAngle:h,endAngle:c}=r.getProps(["startAngle","endAngle"],i),{angle:d}=wi(r,{x:t.x,y:t.y});re(d,h,c)&&n.push({element:r,datasetIndex:a,index:l})}return fe(s,e,t,o),n}function sl(s,t,e,i,n,o){let r=[];const a=tl(e);let l=Number.POSITIVE_INFINITY;function h(c,d,u){const f=c.inRange(t.x,t.y,n);if(i&&!f)return;const p=c.getCenterPoint(n);if(!(o||s.isPointInArea(p))&&!f)return;const g=a(t,p);g<l?(r=[{element:c,datasetIndex:d,index:u}],l=g):g===l&&r.push({element:c,datasetIndex:d,index:u})}return fe(s,e,t,h),r}function Ns(s,t,e,i,n,o){return!o&&!s.isPointInArea(t)?[]:e==="r"&&!i?el(s,t,e,n):sl(s,t,e,i,n,o)}function xn(s,t,e,i,n){const o=[],r=e==="x"?"inXRange":"inYRange";let a=!1;return fe(s,e,t,(l,h,c)=>{l[r](t[e],n)&&(o.push({element:l,datasetIndex:h,index:c}),a=a||l.inRange(t.x,t.y,n))}),i&&!a?[]:o}var il={evaluateInteractionItems:fe,modes:{index(s,t,e,i){const n=Ft(t,s),o=e.axis||"x",r=e.includeInvisible||!1,a=e.intersect?Ws(s,n,o,i,r):Ns(s,n,o,!1,i,r),l=[];return a.length?(s.getSortedVisibleDatasetMetas().forEach(h=>{const c=a[0].index,d=h.data[c];d&&!d.skip&&l.push({element:d,datasetIndex:h.index,index:c})}),l):[]},dataset(s,t,e,i){const n=Ft(t,s),o=e.axis||"xy",r=e.includeInvisible||!1;let a=e.intersect?Ws(s,n,o,i,r):Ns(s,n,o,!1,i,r);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,i){const n=Ft(t,s),o=e.axis||"xy",r=e.includeInvisible||!1;return Ws(s,n,o,i,r)},nearest(s,t,e,i){const n=Ft(t,s),o=e.axis||"xy",r=e.includeInvisible||!1;return Ns(s,n,o,e.intersect,i,r)},x(s,t,e,i){const n=Ft(t,s);return xn(s,n,"x",e.intersect,i)},y(s,t,e,i){const n=Ft(t,s);return xn(s,n,"y",e.intersect,i)}}};const bn=["left","top","right","bottom"];function ge(s,t){return s.filter(e=>e.pos===t)}function _n(s,t){return s.filter(e=>bn.indexOf(e.pos)===-1&&e.box.axis===t)}function pe(s,t){return s.sort((e,i)=>{const n=t?i:e,o=t?e:i;return n.weight===o.weight?n.index-o.index:n.weight-o.weight})}function nl(s){const t=[];let e,i,n,o,r,a;for(e=0,i=(s||[]).length;e<i;++e)n=s[e],{position:o,options:{stack:r,stackWeight:a=1}}=n,t.push({index:e,box:n,pos:o,horizontal:n.isHorizontal(),weight:n.weight,stack:r&&o+r,stackWeight:a});return t}function ol(s){const t={};for(const e of s){const{stack:i,pos:n,stackWeight:o}=e;if(!i||!bn.includes(n))continue;const r=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});r.count++,r.weight+=o}return t}function rl(s,t){const e=ol(s),{vBoxMaxWidth:i,hBoxMaxHeight:n}=t;let o,r,a;for(o=0,r=s.length;o<r;++o){a=s[o];const{fullSize:l}=a.box,h=e[a.stack],c=h&&a.stackWeight/h.weight;a.horizontal?(a.width=c?c*i:l&&t.availableWidth,a.height=n):(a.width=i,a.height=c?c*n:l&&t.availableHeight)}return e}function al(s){const t=nl(s),e=pe(t.filter(h=>h.box.fullSize),!0),i=pe(ge(t,"left"),!0),n=pe(ge(t,"right")),o=pe(ge(t,"top"),!0),r=pe(ge(t,"bottom")),a=_n(t,"x"),l=_n(t,"y");return{fullSize:e,leftAndTop:i.concat(o),rightAndBottom:n.concat(l).concat(r).concat(a),chartArea:ge(t,"chartArea"),vertical:i.concat(n).concat(l),horizontal:o.concat(r).concat(a)}}function yn(s,t,e,i){return Math.max(s[e],t[e])+Math.max(s[i],t[i])}function vn(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 ll(s,t,e,i){const{pos:n,box:o}=e,r=s.maxPadding;if(!T(n)){e.size&&(s[n]-=e.size);const d=i[e.stack]||{size:0,count:1};d.size=Math.max(d.size,e.horizontal?o.height:o.width),e.size=d.size/d.count,s[n]+=e.size}o.getPadding&&vn(r,o.getPadding());const a=Math.max(0,t.outerWidth-yn(r,s,"left","right")),l=Math.max(0,t.outerHeight-yn(r,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 hl(s){const t=s.maxPadding;function e(i){const n=Math.max(t[i]-s[i],0);return s[i]+=n,n}s.y+=e("top"),s.x+=e("left"),e("right"),e("bottom")}function cl(s,t){const e=t.maxPadding;function i(n){const o={left:0,top:0,right:0,bottom:0};return n.forEach(r=>{o[r]=Math.max(t[r],e[r])}),o}return i(s?["left","right"]:["top","bottom"])}function me(s,t,e,i){const n=[];let o,r,a,l,h,c;for(o=0,r=s.length,h=0;o<r;++o){a=s[o],l=a.box,l.update(a.width||t.w,a.height||t.h,cl(a.horizontal,t));const{same:d,other:u}=ll(t,e,a,i);h|=d&&n.length,c=c||u,l.fullSize||n.push(a)}return h&&me(n,t,e,i)||c}function Ze(s,t,e,i,n){s.top=e,s.left=t,s.right=t+i,s.bottom=e+n,s.width=i,s.height=n}function Mn(s,t,e,i){const n=e.padding;let{x:o,y:r}=t;for(const a of s){const l=a.box,h=i[a.stack]||{count:1,placed:0,weight:1},c=a.stackWeight/h.weight||1;if(a.horizontal){const d=t.w*c,u=h.size||l.height;ne(h.start)&&(r=h.start),l.fullSize?Ze(l,n.left,r,e.outerWidth-n.right-n.left,u):Ze(l,t.left+h.placed,r,d,u),h.start=r,h.placed+=d,r=l.bottom}else{const d=t.h*c,u=h.size||l.width;ne(h.start)&&(o=h.start),l.fullSize?Ze(l,o,n.top,u,e.outerHeight-n.bottom-n.top):Ze(l,o,t.top+h.placed,u,d),h.start=o,h.placed+=d,o=l.right}}t.x=o,t.y=r}var K={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,i){if(!s)return;const n=U(s.options.layout.padding),o=Math.max(t-n.width,0),r=Math.max(e-n.height,0),a=al(s.boxes),l=a.vertical,h=a.horizontal;R(s.boxes,g=>{typeof g.beforeLayout=="function"&&g.beforeLayout()});const c=l.reduce((g,m)=>m.box.options&&m.box.options.display===!1?g:g+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:e,padding:n,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/c,hBoxMaxHeight:r/2}),u=Object.assign({},n);vn(u,U(i));const f=Object.assign({maxPadding:u,w:o,h:r,x:n.left,y:n.top},n),p=rl(l.concat(h),d);me(a.fullSize,f,d,p),me(l,f,d,p),me(h,f,d,p)&&me(l,f,d,p),hl(f),Mn(a.leftAndTop,f,d,p),f.x+=f.w,f.y+=f.h,Mn(a.rightAndBottom,f,d,p),s.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},R(a.chartArea,g=>{const m=g.box;Object.assign(m,s.chartArea),m.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class wn{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,n){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):i)}}isAttached(t){return!0}updateConfig(t){}}class dl extends wn{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Je="$chartjs",ul={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},kn=s=>s===null||s==="";function fl(s,t){const e=s.style,i=s.getAttribute("height"),n=s.getAttribute("width");if(s[Je]={initial:{height:i,width:n,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",kn(n)){const o=Ki(s,"width");o!==void 0&&(s.width=o)}if(kn(i))if(s.style.height==="")s.height=s.width/(t||2);else{const o=Ki(s,"height");o!==void 0&&(s.height=o)}return s}const Sn=pa?{passive:!0}:!1;function gl(s,t,e){s&&s.addEventListener(t,e,Sn)}function pl(s,t,e){s&&s.canvas&&s.canvas.removeEventListener(t,e,Sn)}function ml(s,t){const e=ul[s.type]||s.type,{x:i,y:n}=Ft(s,t);return{type:e,chart:t,native:s,x:i!==void 0?i:null,y:n!==void 0?n:null}}function Qe(s,t){for(const e of s)if(e===t||e.contains(t))return!0}function xl(s,t,e){const i=s.canvas,n=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||Qe(a.addedNodes,i),r=r&&!Qe(a.removedNodes,i);r&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}function bl(s,t,e){const i=s.canvas,n=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||Qe(a.removedNodes,i),r=r&&!Qe(a.addedNodes,i);r&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}const xe=new Map;let Pn=0;function Dn(){const s=window.devicePixelRatio;s!==Pn&&(Pn=s,xe.forEach((t,e)=>{e.currentDevicePixelRatio!==s&&t()}))}function _l(s,t){xe.size||window.addEventListener("resize",Dn),xe.set(s,t)}function yl(s){xe.delete(s),xe.size||window.removeEventListener("resize",Dn)}function vl(s,t,e){const i=s.canvas,n=i&&Is(i);if(!n)return;const o=Ci((a,l)=>{const h=n.clientWidth;e(a,l),h<n.clientWidth&&e()},window),r=new ResizeObserver(a=>{const l=a[0],h=l.contentRect.width,c=l.contentRect.height;h===0&&c===0||o(h,c)});return r.observe(n),_l(s,o),r}function Hs(s,t,e){e&&e.disconnect(),t==="resize"&&yl(s)}function Ml(s,t,e){const i=s.canvas,n=Ci(o=>{s.ctx!==null&&e(ml(o,s))},s);return gl(i,t,n),n}class wl extends wn{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(fl(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[Je])return!1;const i=e[Je].initial;["height","width"].forEach(o=>{const r=i[o];O(r)?e.removeAttribute(o):e.setAttribute(o,r)});const n=i.style||{};return Object.keys(n).forEach(o=>{e.style[o]=n[o]}),e.width=e.width,delete e[Je],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),o={attach:xl,detach:bl,resize:vl}[e]||Ml;n[e]=o(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),n=i[e];n&&(({attach:Hs,detach:Hs,resize:Hs}[e]||pl)(t,e,n),i[e]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,n){return ga(t,e,i,n)}isAttached(t){const e=t&&Is(t);return!!(e&&e.isConnected)}}function kl(s){return!Rs()||typeof OffscreenCanvas<"u"&&s instanceof OffscreenCanvas?dl:wl}class lt{constructor(){M(this,"x");M(this,"y");M(this,"active",!1);M(this,"options");M(this,"$animations")}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return Ut(this.x)&&Ut(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const n={};return t.forEach(o=>{n[o]=i[o]&&i[o].active()?i[o]._to:this[o]}),n}}M(lt,"defaults",{}),M(lt,"defaultRoutes");function Sl(s,t){const e=s.options.ticks,i=Pl(s),n=Math.min(e.maxTicksLimit||i,i),o=e.major.enabled?Cl(t):[],r=o.length,a=o[0],l=o[r-1],h=[];if(r>n)return Ol(t,h,o,r/n),h;const c=Dl(o,t,n);if(r>0){let d,u;const f=r>1?Math.round((l-a)/(r-1)):null;for(ts(t,h,c,O(f)?0:a-f,a),d=0,u=r-1;d<u;d++)ts(t,h,c,o[d],o[d+1]);return ts(t,h,c,l,O(f)?t.length:l+f),h}return ts(t,h,c),h}function Pl(s){const t=s.options.offset,e=s._tickSize(),i=s._length/e+(t?0:1),n=s._maxLength/e;return Math.floor(Math.min(i,n))}function Dl(s,t,e){const i=Al(s),n=t.length/e;if(!i)return Math.max(n,1);const o=br(i);for(let r=0,a=o.length-1;r<a;r++){const l=o[r];if(l>n)return l}return Math.max(n,1)}function Cl(s){const t=[];let e,i;for(e=0,i=s.length;e<i;e++)s[e].major&&t.push(e);return t}function Ol(s,t,e,i){let n=0,o=e[0],r;for(i=Math.ceil(i),r=0;r<s.length;r++)r===o&&(t.push(s[r]),n++,o=e[n*i])}function ts(s,t,e,i,n){const o=D(i,0),r=Math.min(D(n,s.length),s.length);let a=0,l,h,c;for(e=Math.ceil(e),n&&(l=n-i,e=l/Math.floor(l/e)),c=o;c<0;)a++,c=Math.round(o+a*e);for(h=Math.max(o,0);h<r;h++)h===c&&(t.push(s[h]),a++,c=Math.round(o+a*e))}function Al(s){const t=s.length;let e,i;if(t<2)return!1;for(i=s[0],e=1;e<t;++e)if(s[e]-s[e-1]!==i)return!1;return i}const Tl=s=>s==="left"?"right":s==="right"?"left":s,Cn=(s,t,e)=>t==="top"||t==="left"?s[t]+e:s[t]-e,On=(s,t)=>Math.min(t||s,s);function An(s,t){const e=[],i=s.length/t,n=s.length;let o=0;for(;o<n;o+=i)e.push(s[Math.floor(o)]);return e}function Ll(s,t,e){const i=s.ticks.length,n=Math.min(t,i-1),o=s._startPixel,r=s._endPixel,a=1e-6;let l=s.getPixelForTick(n),h;if(!(e&&(i===1?h=Math.max(l-o,r-l):t===0?h=(s.getPixelForTick(1)-l)/2:h=(l-s.getPixelForTick(n-1))/2,l+=n<t?h:-h,l<o-a||l>r+a)))return l}function El(s,t){R(s,e=>{const i=e.gc,n=i.length/2;let o;if(n>t){for(o=0;o<n;++o)delete e.data[i[o]];i.splice(0,n)}})}function be(s){return s.drawTicks?s.tickLength:0}function Tn(s,t){if(!s.display)return 0;const e=$(s.font,t),i=U(s.padding);return(z(s.text)?s.text.length:1)*e.lineHeight+i.height}function Rl(s,t){return Dt(s,{scale:t,type:"scale"})}function Il(s,t,e){return Dt(s,{tick:e,index:t,type:"tick"})}function zl(s,t,e){let i=ks(s);return(e&&t!=="right"||!e&&t==="right")&&(i=Tl(i)),i}function Fl(s,t,e,i){const{top:n,left:o,bottom:r,right:a,chart:l}=s,{chartArea:h,scales:c}=l;let d=0,u,f,p;const g=r-n,m=a-o;if(s.isHorizontal()){if(f=X(i,o,a),T(e)){const x=Object.keys(e)[0],_=e[x];p=c[x].getPixelForValue(_)+g-t}else e==="center"?p=(h.bottom+h.top)/2+g-t:p=Cn(s,e,t);u=a-o}else{if(T(e)){const x=Object.keys(e)[0],_=e[x];f=c[x].getPixelForValue(_)-m+t}else e==="center"?f=(h.left+h.right)/2-m+t:f=Cn(s,e,t);p=X(i,r,n),d=e==="left"?-j:j}return{titleX:f,titleY:p,maxWidth:u,rotation:d}}class Ht extends lt{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:n}=this;return t=st(t,Number.POSITIVE_INFINITY),e=st(e,Number.NEGATIVE_INFINITY),i=st(i,Number.POSITIVE_INFINITY),n=st(n,Number.NEGATIVE_INFINITY),{min:st(t,i),max:st(e,n),minDefined:H(t),maxDefined:H(e)}}getMinMax(t){let{min:e,max:i,minDefined:n,maxDefined:o}=this.getUserBounds(),r;if(n&&o)return{min:e,max:i};const a=this.getMatchingVisibleMetas();for(let l=0,h=a.length;l<h;++l)r=a[l].controller.getMinMax(this,t),n||(e=Math.min(e,r.min)),o||(i=Math.max(i,r.max));return e=o&&e>i?i:e,i=n&&e>i?e:i,{min:st(e,st(i,e)),max:st(i,st(e,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){I(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:n,grace:o,ticks:r}=this.options,a=r.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Ur(this,o,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?An(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||r.source==="auto")&&(this.ticks=Sl(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,i;this.isHorizontal()?(e=this.left,i=this.right):(e=this.top,i=this.bottom,t=!t),this._startPixel=e,this._endPixel=i,this._reversePixels=t,this._length=i-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){I(this.options.afterUpdate,[this])}beforeSetDimensions(){I(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(){I(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),I(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){I(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,n,o;for(i=0,n=t.length;i<n;i++)o=t[i],o.label=I(e.callback,[o.value,i,t],this)}afterTickToLabelConversion(){I(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){I(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=On(this.ticks.length,t.ticks.maxTicksLimit),n=e.minRotation||0,o=e.maxRotation;let r=n,a,l,h;if(!this._isVisible()||!e.display||n>=o||i<=1||!this.isHorizontal()){this.labelRotation=n;return}const c=this._getLabelSizes(),d=c.widest.width,u=c.highest.height,f=Y(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/i:f/(i-1),d+6>a&&(a=f/(i-(t.offset?.5:1)),l=this.maxHeight-be(t.grid)-e.padding-Tn(t.title,this.chart.options.font),h=Math.sqrt(d*d+u*u),r=vs(Math.min(Math.asin(Y((c.highest.height+6)/a,-1,1)),Math.asin(Y(l/h,-1,1))-Math.asin(Y(u/h,-1,1)))),r=Math.max(n,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){I(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){I(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:n,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){const l=Tn(n,e.options.font);if(a?(t.width=this.maxWidth,t.height=be(o)+l):(t.height=this.maxHeight,t.width=be(o)+l),i.display&&this.ticks.length){const{first:h,last:c,widest:d,highest:u}=this._getLabelSizes(),f=i.padding*2,p=rt(this.labelRotation),g=Math.cos(p),m=Math.sin(p);if(a){const x=i.mirror?0:m*d.width+g*u.height;t.height=Math.min(this.maxHeight,t.height+x+f)}else{const x=i.mirror?0:g*d.width+m*u.height;t.width=Math.min(this.maxWidth,t.width+x+f)}this._calculatePadding(h,c,m,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,i,n){const{ticks:{align:o,padding:r},position:a}=this.options,l=this.labelRotation!==0,h=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const c=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let u=0,f=0;l?h?(u=n*t.width,f=i*e.height):(u=i*t.height,f=n*e.width):o==="start"?f=e.width:o==="end"?u=t.width:o!=="inner"&&(u=t.width/2,f=e.width/2),this.paddingLeft=Math.max((u-c+r)*this.width/(this.width-c),0),this.paddingRight=Math.max((f-d+r)*this.width/(this.width-d),0)}else{let c=e.height/2,d=t.height/2;o==="start"?(c=0,d=t.height):o==="end"&&(c=e.height,d=0),this.paddingTop=c+r,this.paddingBottom=d+r}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){I(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,i;for(e=0,i=t.length;e<i;e++)O(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let i=this.ticks;e<i.length&&(i=An(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){const{ctx:n,_longestTextCache:o}=this,r=[],a=[],l=Math.floor(e/On(e,i));let h=0,c=0,d,u,f,p,g,m,x,_,v,b,y;for(d=0;d<e;d+=l){if(p=t[d].label,g=this._resolveTickFontOptions(d),n.font=m=g.string,x=o[m]=o[m]||{data:{},gc:[]},_=g.lineHeight,v=b=0,!O(p)&&!z(p))v=Be(n,x.data,x.gc,v,p),b=_;else if(z(p))for(u=0,f=p.length;u<f;++u)y=p[u],!O(y)&&!z(y)&&(v=Be(n,x.data,x.gc,v,y),b+=_);r.push(v),a.push(b),h=Math.max(v,h),c=Math.max(b,c)}El(o,e);const w=r.indexOf(h),S=a.indexOf(c),k=C=>({width:r[C]||0,height:a[C]||0});return{first:k(0),last:k(e-1),widest:k(w),highest:k(S),widths:r,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return vr(this._alignToPixels?Et(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const i=e[t];return i.$context||(i.$context=Il(this.getContext(),t,i))}return this.$context||(this.$context=Rl(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=rt(this.labelRotation),i=Math.abs(Math.cos(e)),n=Math.abs(Math.sin(e)),o=this._getLabelSizes(),r=t.autoSkipPadding||0,a=o?o.widest.width+r:0,l=o?o.highest.height+r:0;return this.isHorizontal()?l*i>a*n?a/i:l/n:l*n<a*i?l/i:a/n}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=this.chart,n=this.options,{grid:o,position:r,border:a}=n,l=o.offset,h=this.isHorizontal(),c=this.ticks.length+(l?1:0),d=be(o),u=[],f=a.setContext(this.getContext()),p=f.display?f.width:0,g=p/2,m=function(A){return Et(i,A,p)};let x,_,v,b,y,w,S,k,C,P,L,E;if(r==="top")x=m(this.bottom),w=this.bottom-d,k=x-g,P=m(t.top)+g,E=t.bottom;else if(r==="bottom")x=m(this.top),P=t.top,E=m(t.bottom)-g,w=x+g,k=this.top+d;else if(r==="left")x=m(this.right),y=this.right-d,S=x-g,C=m(t.left)+g,L=t.right;else if(r==="right")x=m(this.left),C=t.left,L=m(t.right)-g,y=x+g,S=this.left+d;else if(e==="x"){if(r==="center")x=m((t.top+t.bottom)/2+.5);else if(T(r)){const A=Object.keys(r)[0],W=r[A];x=m(this.chart.scales[A].getPixelForValue(W))}P=t.top,E=t.bottom,w=x+g,k=w+d}else if(e==="y"){if(r==="center")x=m((t.left+t.right)/2);else if(T(r)){const A=Object.keys(r)[0],W=r[A];x=m(this.chart.scales[A].getPixelForValue(W))}y=x-g,S=y-d,C=t.left,L=t.right}const Q=D(n.ticks.maxTicksLimit,c),tt=Math.max(1,Math.ceil(c/Q));for(_=0;_<c;_+=tt){const A=this.getContext(_),W=o.setContext(A),et=a.setContext(A),ot=W.lineWidth,q=W.color,jt=et.dash||[],Ae=et.dashOffset,$t=W.tickWidth,Jt=W.tickColor,At=W.tickBorderDash||[],Qt=W.tickBorderDashOffset;v=Ll(this,_,l),v!==void 0&&(b=Et(i,v,ot),h?y=S=C=L=b:w=k=P=E=b,u.push({tx1:y,ty1:w,tx2:S,ty2:k,x1:C,y1:P,x2:L,y2:E,width:ot,color:q,borderDash:jt,borderDashOffset:Ae,tickWidth:$t,tickColor:Jt,tickBorderDash:At,tickBorderDashOffset:Qt}))}return this._ticksLength=c,this._borderValue=x,u}_computeLabelItems(t){const e=this.axis,i=this.options,{position:n,ticks:o}=i,r=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:h,padding:c,mirror:d}=o,u=be(i.grid),f=u+c,p=d?-c:f,g=-rt(this.labelRotation),m=[];let x,_,v,b,y,w,S,k,C,P,L,E,Q="middle";if(n==="top")w=this.bottom-p,S=this._getXAxisLabelAlignment();else if(n==="bottom")w=this.top+p,S=this._getXAxisLabelAlignment();else if(n==="left"){const A=this._getYAxisLabelAlignment(u);S=A.textAlign,y=A.x}else if(n==="right"){const A=this._getYAxisLabelAlignment(u);S=A.textAlign,y=A.x}else if(e==="x"){if(n==="center")w=(t.top+t.bottom)/2+f;else if(T(n)){const A=Object.keys(n)[0],W=n[A];w=this.chart.scales[A].getPixelForValue(W)+f}S=this._getXAxisLabelAlignment()}else if(e==="y"){if(n==="center")y=(t.left+t.right)/2-f;else if(T(n)){const A=Object.keys(n)[0],W=n[A];y=this.chart.scales[A].getPixelForValue(W)}S=this._getYAxisLabelAlignment(u).textAlign}e==="y"&&(l==="start"?Q="top":l==="end"&&(Q="bottom"));const tt=this._getLabelSizes();for(x=0,_=a.length;x<_;++x){v=a[x],b=v.label;const A=o.setContext(this.getContext(x));k=this.getPixelForTick(x)+o.labelOffset,C=this._resolveTickFontOptions(x),P=C.lineHeight,L=z(b)?b.length:1;const W=L/2,et=A.color,ot=A.textStrokeColor,q=A.textStrokeWidth;let jt=S;r?(y=k,S==="inner"&&(x===_-1?jt=this.options.reverse?"left":"right":x===0?jt=this.options.reverse?"right":"left":jt="center"),n==="top"?h==="near"||g!==0?E=-L*P+P/2:h==="center"?E=-tt.highest.height/2-W*P+P:E=-tt.highest.height+P/2:h==="near"||g!==0?E=P/2:h==="center"?E=tt.highest.height/2-W*P:E=tt.highest.height-L*P,d&&(E*=-1),g!==0&&!A.showLabelBackdrop&&(y+=P/2*Math.sin(g))):(w=k,E=(1-L)*P/2);let Ae;if(A.showLabelBackdrop){const $t=U(A.backdropPadding),Jt=tt.heights[x],At=tt.widths[x];let Qt=E-$t.top,te=0-$t.left;switch(Q){case"middle":Qt-=Jt/2;break;case"bottom":Qt-=Jt;break}switch(S){case"center":te-=At/2;break;case"right":te-=At;break;case"inner":x===_-1?te-=At:x>0&&(te-=At/2);break}Ae={left:te,top:Qt,width:At+$t.width,height:Jt+$t.height,color:A.backdropColor}}m.push({label:b,font:C,textOffset:E,options:{rotation:g,color:et,strokeColor:ot,strokeWidth:q,textAlign:jt,textBaseline:Q,translation:[y,w],backdrop:Ae}})}return m}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-rt(this.labelRotation))return t==="top"?"left":"right";let i="center";return e.align==="start"?i="left":e.align==="end"?i="right":e.align==="inner"&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:n,padding:o}}=this.options,r=this._getLabelSizes(),a=t+o,l=r.widest.width;let h,c;return e==="left"?n?(c=this.right+o,i==="near"?h="left":i==="center"?(h="center",c+=l/2):(h="right",c+=l)):(c=this.right-a,i==="near"?h="right":i==="center"?(h="center",c-=l/2):(h="left",c=this.left)):e==="right"?n?(c=this.left+o,i==="near"?h="right":i==="center"?(h="center",c-=l/2):(h="left",c-=l)):(c=this.left+a,i==="near"?h="left":i==="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:i,top:n,width:o,height:r}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,n,o,r),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const i=this.ticks.findIndex(n=>n.value===t);return i>=0?e.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,r;const a=(l,h,c)=>{!c.width||!c.color||(i.save(),i.lineWidth=c.width,i.strokeStyle=c.color,i.setLineDash(c.borderDash||[]),i.lineDashOffset=c.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(h.x,h.y),i.stroke(),i.restore())};if(e.display)for(o=0,r=n.length;o<r;++o){const l=n[o];e.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),e.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:i,grid:n}}=this,o=i.setContext(this.getContext()),r=i.display?o.width:0;if(!r)return;const a=n.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let h,c,d,u;this.isHorizontal()?(h=Et(t,this.left,r)-r/2,c=Et(t,this.right,a)+a/2,d=u=l):(d=Et(t,this.top,r)-r/2,u=Et(t,this.bottom,a)+a/2,h=c=l),e.save(),e.lineWidth=o.width,e.strokeStyle=o.color,e.beginPath(),e.moveTo(h,d),e.lineTo(c,u),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const e=this.ctx,i=this._computeLabelArea();i&&We(e,i);const n=this.getLabelItems(t);for(const o of n){const r=o.options,a=o.font,l=o.label,h=o.textOffset;Rt(e,l,0,h,a,r)}i&&Ne(e)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:n}}=this;if(!i.display)return;const o=$(i.font),r=U(i.padding),a=i.align;let l=o.lineHeight/2;e==="bottom"||e==="center"||T(e)?(l+=r.bottom,z(i.text)&&(l+=o.lineHeight*(i.text.length-1))):l+=r.top;const{titleX:h,titleY:c,maxWidth:d,rotation:u}=Fl(this,l,e,a);Rt(t,i.text,0,0,o,{color:i.color,maxWidth:d,rotation:u,textAlign:zl(a,e,n),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,i=D(t.grid&&t.grid.z,-1),n=D(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Ht.prototype.draw?[{z:e,draw:o=>{this.draw(o)}}]:[{z:i,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:n,draw:()=>{this.drawBorder()}},{z:e,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",n=[];let o,r;for(o=0,r=e.length;o<r;++o){const a=e[o];a[i]===this.id&&(!t||a.type===t)&&n.push(a)}return n}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return $(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class es{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let i;Wl(e)&&(i=this.register(e));const n=this.items,o=t.id,r=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in n||(n[o]=t,Vl(t,r,i),this.override&&N.override(t.id,t.overrides)),r}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,n=this.scope;i in e&&delete e[i],n&&i in N[n]&&(delete N[n][i],this.override&&delete Lt[i])}}function Vl(s,t,e){const i=ht(Object.create(null),[e?N.get(e):{},N.get(t),s.defaults]);N.set(t,i),s.defaultRoutes&&Bl(t,s.defaultRoutes),s.descriptors&&N.describe(t,s.descriptors)}function Bl(s,t){Object.keys(t).forEach(e=>{const i=e.split("."),n=i.pop(),o=[s].concat(i).join("."),r=t[e].split("."),a=r.pop(),l=r.join(".");N.route(o,n,l,a)})}function Wl(s){return"id"in s&&"defaults"in s}class Nl{constructor(){this.controllers=new es(at,"datasets",!0),this.elements=new es(lt,"elements"),this.plugins=new es(Object,"plugins"),this.scales=new es(Ht,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(n=>{const o=i||this._getRegistryForType(n);i||o.isForType(n)||o===this.plugins&&n.id?this._exec(t,o,n):R(n,r=>{const a=i||this._getRegistryForType(r);this._exec(t,a,r)})})}_exec(t,e,i){const n=ys(t);I(i["before"+n],[],i),e[t](i),I(i["after"+n],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const n=e.get(t);if(n===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return n}}var dt=new Nl;class Hl{constructor(){this._init=[]}notify(t,e,i,n){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const o=n?this._descriptors(t).filter(n):this._descriptors(t),r=this._notify(o,t,e,i);return e==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall")),r}_notify(t,e,i,n){n=n||{};for(const o of t){const r=o.plugin,a=r[i],l=[e,n,o.options];if(I(a,l,r)===!1&&n.cancelable)return!1}return!0}invalidate(){O(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const i=t&&t.config,n=D(i.options&&i.options.plugins,{}),o=jl(i);return n===!1&&!e?[]:Yl(t,o,n,e)}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,n=(o,r)=>o.filter(a=>!r.some(l=>a.plugin.id===l.plugin.id));this._notify(n(e,i),t,"stop"),this._notify(n(i,e),t,"start")}}function jl(s){const t={},e=[],i=Object.keys(dt.plugins.items);for(let o=0;o<i.length;o++)e.push(dt.getPlugin(i[o]));const n=s.plugins||[];for(let o=0;o<n.length;o++){const r=n[o];e.indexOf(r)===-1&&(e.push(r),t[r.id]=!0)}return{plugins:e,localIds:t}}function $l(s,t){return!t&&s===!1?null:s===!0?{}:s}function Yl(s,{plugins:t,localIds:e},i,n){const o=[],r=s.getContext();for(const a of t){const l=a.id,h=$l(i[l],n);h!==null&&o.push({plugin:a,options:Ul(s.config,{plugin:a,local:e[l]},h,r)})}return o}function Ul(s,{plugin:t,local:e},i,n){const o=s.pluginScopeKeys(t),r=s.getOptionScopes(i,o);return e&&t.defaults&&r.push(t.defaults),s.createResolver(r,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function js(s,t){const e=N.datasets[s]||{};return((t.datasets||{})[s]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function Xl(s,t){let e=s;return s==="_index_"?e=t:s==="_value_"&&(e=t==="x"?"y":"x"),e}function Kl(s,t){return s===t?"_index_":"_value_"}function Ln(s){if(s==="x"||s==="y"||s==="r")return s}function ql(s){if(s==="top"||s==="bottom")return"x";if(s==="left"||s==="right")return"y"}function $s(s,...t){if(Ln(s))return s;for(const e of t){const i=e.axis||ql(e.position)||s.length>1&&Ln(s[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${s}' axis. Please provide 'axis' or 'position' option.`)}function En(s,t,e){if(e[t+"AxisID"]===s)return{axis:t}}function Gl(s,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(i=>i.xAxisID===s||i.yAxisID===s);if(e.length)return En(s,"x",e[0])||En(s,"y",e[0])}return{}}function Zl(s,t){const e=Lt[s.type]||{scales:{}},i=t.scales||{},n=js(s.type,t),o=Object.create(null);return Object.keys(i).forEach(r=>{const a=i[r];if(!T(a))return console.error(`Invalid scale configuration for scale: ${r}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);const l=$s(r,a,Gl(r,s),N.scales[a.type]),h=Kl(l,n),c=e.scales||{};o[r]=ie(Object.create(null),[{axis:l},a,c[l],c[h]])}),s.data.datasets.forEach(r=>{const a=r.type||s.type,l=r.indexAxis||js(a,t),h=(Lt[a]||{}).scales||{};Object.keys(h).forEach(c=>{const d=Xl(c,l),u=r[d+"AxisID"]||d;o[u]=o[u]||Object.create(null),ie(o[u],[{axis:d},i[u],h[c]])})}),Object.keys(o).forEach(r=>{const a=o[r];ie(a,[N.scales[a.type],N.scale])}),o}function Rn(s){const t=s.options||(s.options={});t.plugins=D(t.plugins,{}),t.scales=Zl(s,t)}function In(s){return s=s||{},s.datasets=s.datasets||[],s.labels=s.labels||[],s}function Jl(s){return s=s||{},s.data=In(s.data),Rn(s),s}const zn=new Map,Fn=new Set;function ss(s,t){let e=zn.get(s);return e||(e=t(),zn.set(s,e),Fn.add(e)),e}const _e=(s,t,e)=>{const i=kt(t,e);i!==void 0&&s.add(i)};class Ql{constructor(t){this._config=Jl(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=In(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(),Rn(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return ss(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return ss(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return ss(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,i=this.type;return ss(`${i}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let n=i.get(t);return(!n||e)&&(n=new Map,i.set(t,n)),n}getOptionScopes(t,e,i){const{options:n,type:o}=this,r=this._cachedScopes(t,i),a=r.get(e);if(a)return a;const l=new Set;e.forEach(c=>{t&&(l.add(t),c.forEach(d=>_e(l,t,d))),c.forEach(d=>_e(l,n,d)),c.forEach(d=>_e(l,Lt[o]||{},d)),c.forEach(d=>_e(l,N,d)),c.forEach(d=>_e(l,Ds,d))});const h=Array.from(l);return h.length===0&&h.push(Object.create(null)),Fn.has(e)&&r.set(e,h),h}chartOptionScopes(){const{options:t,type:e}=this;return[t,Lt[e]||{},N.datasets[e]||{},{type:e},N,Ds]}resolveNamedOptions(t,e,i,n=[""]){const o={$shared:!0},{resolver:r,subPrefixes:a}=Vn(this._resolverCache,t,n);let l=r;if(eh(r,e)){o.$shared=!1,i=St(i)?i():i;const h=this.createResolver(t,i,a);l=Xt(r,i,h)}for(const h of e)o[h]=l[h];return o}createResolver(t,e,i=[""],n){const{resolver:o}=Vn(this._resolverCache,t,i);return T(e)?Xt(o,e,void 0,n):o}}function Vn(s,t,e){let i=s.get(t);i||(i=new Map,s.set(t,i));const n=e.join();let o=i.get(n);return o||(o={resolver:Ts(t,e),subPrefixes:e.filter(r=>!r.toLowerCase().includes("hover"))},i.set(n,o)),o}const th=s=>T(s)&&Object.getOwnPropertyNames(s).some(t=>St(s[t]));function eh(s,t){const{isScriptable:e,isIndexable:i}=Bi(s);for(const n of t){const o=e(n),r=i(n),a=(r||o)&&s[n];if(o&&(St(a)||th(a))||r&&z(a))return!0}return!1}var sh="4.4.3";const ih=["top","bottom","left","right","chartArea"];function Bn(s,t){return s==="top"||s==="bottom"||ih.indexOf(s)===-1&&t==="x"}function Wn(s,t){return function(e,i){return e[s]===i[s]?e[t]-i[t]:e[s]-i[s]}}function Nn(s){const t=s.chart,e=t.options.animation;t.notifyPlugins("afterRender"),I(e&&e.onComplete,[s],t)}function nh(s){const t=s.chart,e=t.options.animation;I(e&&e.onProgress,[s],t)}function Hn(s){return Rs()&&typeof s=="string"?s=document.getElementById(s):s&&s.length&&(s=s[0]),s&&s.canvas&&(s=s.canvas),s}const is={},jn=s=>{const t=Hn(s);return Object.values(is).filter(e=>e.canvas===t).pop()};function oh(s,t,e){const i=Object.keys(s);for(const n of i){const o=+n;if(o>=t){const r=s[n];delete s[n],(e>0||o>t)&&(s[o+e]=r)}}}function rh(s,t,e,i){return!e||s.type==="mouseout"?null:i?t:s}function ns(s,t,e){return s.options.clip?s[e]:t[e]}function ah(s,t){const{xScale:e,yScale:i}=s;return e&&i?{left:ns(e,t,"left"),right:ns(e,t,"right"),top:ns(i,t,"top"),bottom:ns(i,t,"bottom")}:t}class _t{static register(...t){dt.add(...t),$n()}static unregister(...t){dt.remove(...t),$n()}constructor(t,e){const i=this.config=new Ql(e),n=Hn(t),o=jn(n);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const r=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||kl(n)),this.platform.updateConfig(i);const a=this.platform.acquireContext(n,r.aspectRatio),l=a&&a.canvas,h=l&&l.height,c=l&&l.width;if(this.id=hr(),this.ctx=a,this.canvas=l,this.width=c,this.height=h,this._options=r,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Hl,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Sr(d=>this.update(d),r.resizeDelay||0),this._dataChanges=[],is[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}bt.listen(this,"complete",Nn),bt.listen(this,"progress",nh),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:n,_aspectRatio:o}=this;return O(t)?e&&o?o:n?i/n:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return dt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Xi(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return zi(this.canvas,this.ctx),this}stop(){return bt.stop(this),this}resize(t,e){bt.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,n=this.canvas,o=i.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(n,t,e,o),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,Xi(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),I(i.onResize,[this,r],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const t=this.options.scales||{};R(t,(e,i)=>{e.id=i})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,n=Object.keys(i).reduce((r,a)=>(r[a]=!1,r),{});let o=[];e&&(o=o.concat(Object.keys(e).map(r=>{const a=e[r],l=$s(r,a),h=l==="r",c=l==="x";return{options:a,dposition:h?"chartArea":c?"bottom":"left",dtype:h?"radialLinear":c?"category":"linear"}}))),R(o,r=>{const a=r.options,l=a.id,h=$s(l,a),c=D(a.type,r.dtype);(a.position===void 0||Bn(a.position,h)!==Bn(r.dposition))&&(a.position=r.dposition),n[l]=!0;let d=null;if(l in i&&i[l].type===c)d=i[l];else{const u=dt.getScale(c);d=new u({id:l,type:c,ctx:this.ctx,chart:this}),i[d.id]=d}d.init(a,t)}),R(n,(r,a)=>{r||delete i[a]}),R(i,r=>{K.configure(this,r,r.options),K.addBox(this,r)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((n,o)=>n.index-o.index),i>e){for(let n=e;n<i;++n)this._destroyDatasetMeta(n);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(Wn("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((i,n)=>{e.filter(o=>o===i._dataset).length===0&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,n;for(this._removeUnreferencedMetasets(),i=0,n=e.length;i<n;i++){const o=e[i];let r=this.getDatasetMeta(i);const a=o.type||this.config.type;if(r.type&&r.type!==a&&(this._destroyDatasetMeta(i),r=this.getDatasetMeta(i)),r.type=a,r.indexAxis=o.indexAxis||js(a,this.options),r.order=o.order||0,r.index=i,r.label=""+o.label,r.visible=this.isDatasetVisible(i),r.controller)r.controller.updateIndex(i),r.controller.linkScales();else{const l=dt.getController(a),{datasetElementType:h,dataElementType:c}=N.datasets[a];Object.assign(l,{dataElementType:dt.getElement(c),datasetElementType:h&&dt.getElement(h)}),r.controller=new l(this,i),t.push(r.controller)}}return this._updateMetasets(),t}_resetElements(){R(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let h=0,c=this.data.datasets.length;h<c;h++){const{controller:d}=this.getDatasetMeta(h),u=!n&&o.indexOf(d)===-1;d.buildOrUpdateElements(u),r=Math.max(+d.getMaxOverflow(),r)}r=this._minPadding=i.layout.autoPadding?r:0,this._updateLayout(r),n||R(o,h=>{h.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Wn("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){R(this.scales,t=>{K.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!bi(e,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:n,count:o}of e){const r=i==="_removeElements"?-o:o;oh(t,n,r)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=o=>new Set(t.filter(r=>r[0]===o).map((r,a)=>a+","+r.splice(1).join(","))),n=i(0);for(let o=1;o<e;o++)if(!bi(n,i(o)))return;return Array.from(n).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;K.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],R(this.boxes,n=>{i&&n.position==="chartArea"||(n.configure&&n.configure(),this._layers.push(...n._layers()))},this),this._layers.forEach((n,o)=>{n._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,i=this.data.datasets.length;e<i;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,St(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),n={meta:i,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",n)!==!1&&(i.controller._update(e),n.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",n))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(bt.has(this)?this.attached&&!bt.running(this)&&bt.start(this):(this.draw(),Nn({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:i,height:n}=this._resizeBeforeDraw;this._resize(i,n),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,i=[];let n,o;for(n=0,o=e.length;n<o;++n){const r=e[n];(!t||r.visible)&&i.push(r)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i=t._clip,n=!i.disabled,o=ah(t,this.chartArea),r={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(n&&We(e,{left:i.left===!1?0:o.left-i.left,right:i.right===!1?this.width:o.right+i.right,top:i.top===!1?0:o.top-i.top,bottom:i.bottom===!1?this.height:o.bottom+i.bottom}),t.controller.draw(),n&&Ne(e),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return xt(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,n){const o=il.modes[e];return typeof o=="function"?o(this,t,i,n):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let n=i.filter(o=>o&&o._dataset===e).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(n)),n}getContext(){return this.$context||(this.$context=Dt(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!e.hidden}setDatasetVisibility(t,e){const i=this.getDatasetMeta(t);i.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const n=i?"show":"hide",o=this.getDatasetMeta(t),r=o.controller._resolveAnimations(void 0,n);ne(e)?(o.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),r.update(o,{visible:i}),this.update(a=>a.datasetIndex===t?n: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(),bt.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),zi(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete is[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,i=(o,r)=>{e.addEventListener(this,o,r),t[o]=r},n=(o,r,a)=>{o.offsetX=r,o.offsetY=a,this._eventHandler(o)};R(this.options.events,o=>i(o,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(l,h)=>{e.addEventListener(this,l,h),t[l]=h},n=(l,h)=>{t[l]&&(e.removeEventListener(this,l,h),delete t[l])},o=(l,h)=>{this.canvas&&this.resize(l,h)};let r;const a=()=>{n("attach",a),this.attached=!0,this.resize(),i("resize",o),i("detach",r)};r=()=>{this.attached=!1,n("resize",o),this._stop(),this._resize(0,0),i("attach",a)},e.isAttached(this.canvas)?a():r()}unbindEvents(){R(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},R(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const n=i?"set":"remove";let o,r,a,l;for(e==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+n+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){r=t[a];const h=r&&this.getDatasetMeta(r.datasetIndex).controller;h&&h[n+"HoverStyle"](r.element,r.datasetIndex,r.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map(({datasetIndex:n,index:o})=>{const r=this.getDatasetMeta(n);if(!r)throw new Error("No dataset found at index "+n);return{datasetIndex:n,element:r.data[o],index:o}});!Re(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,i){const n=this.options.hover,o=(l,h)=>l.filter(c=>!h.some(d=>c.datasetIndex===d.datasetIndex&&c.index===d.index)),r=o(e,t),a=i?t:o(t,e);r.length&&this.updateHoverStyle(r,n.mode,!1),a.length&&n.mode&&this.updateHoverStyle(a,n.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},n=r=>(r.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,n)===!1)return;const o=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,n),(o||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:n=[],options:o}=this,r=e,a=this._getActiveElements(t,n,i,r),l=pr(t),h=rh(t,this._lastEvent,i,l);i&&(this._lastEvent=null,I(o.onHover,[t,a,this],this),l&&I(o.onClick,[t,a,this],this));const c=!Re(a,n);return(c||e)&&(this._active=a,this._updateHoverStyles(a,n,e)),this._lastEvent=h,c}_getActiveElements(t,e,i,n){if(t.type==="mouseout")return[];if(!i)return e;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,n)}}M(_t,"defaults",N),M(_t,"instances",is),M(_t,"overrides",Lt),M(_t,"registry",dt),M(_t,"version",sh),M(_t,"getChart",jn);function $n(){return R(_t.instances,s=>s._plugins.invalidate())}function lh(s,t,e){const{startAngle:i,pixelMargin:n,x:o,y:r,outerRadius:a,innerRadius:l}=t;let h=n/a;s.beginPath(),s.arc(o,r,a,i-h,e+h),l>n?(h=n/l,s.arc(o,r,l,e+h,i-h,!0)):s.arc(o,r,n,e+j,i-j),s.closePath(),s.clip()}function hh(s){return As(s,["outerStart","outerEnd","innerStart","innerEnd"])}function ch(s,t,e,i){const n=hh(s.options.borderRadius),o=(e-t)/2,r=Math.min(o,i*t/2),a=l=>{const h=(e-Math.min(o,l))*i/2;return Y(l,0,Math.min(o,h))};return{outerStart:a(n.outerStart),outerEnd:a(n.outerEnd),innerStart:Y(n.innerStart,0,r),innerEnd:Y(n.innerEnd,0,r)}}function Gt(s,t,e,i){return{x:e+s*Math.cos(t),y:i+s*Math.sin(t)}}function os(s,t,e,i,n,o){const{x:r,y:a,startAngle:l,pixelMargin:h,innerRadius:c}=t,d=Math.max(t.outerRadius+i+e-h,0),u=c>0?c+i+e+h:0;let f=0;const p=n-l;if(i){const A=c>0?c-i:0,W=d>0?d-i:0,et=(A+W)/2,ot=et!==0?p*et/(et+i):p;f=(p-ot)/2}const g=Math.max(.001,p*d-e/F)/d,m=(p-g)/2,x=l+m+f,_=n-m-f,{outerStart:v,outerEnd:b,innerStart:y,innerEnd:w}=ch(t,u,d,_-x),S=d-v,k=d-b,C=x+v/S,P=_-b/k,L=u+y,E=u+w,Q=x+y/L,tt=_-w/E;if(s.beginPath(),o){const A=(C+P)/2;if(s.arc(r,a,d,C,A),s.arc(r,a,d,A,P),b>0){const q=Gt(k,P,r,a);s.arc(q.x,q.y,b,P,_+j)}const W=Gt(E,_,r,a);if(s.lineTo(W.x,W.y),w>0){const q=Gt(E,tt,r,a);s.arc(q.x,q.y,w,_+j,tt+Math.PI)}const et=(_-w/u+(x+y/u))/2;if(s.arc(r,a,u,_-w/u,et,!0),s.arc(r,a,u,et,x+y/u,!0),y>0){const q=Gt(L,Q,r,a);s.arc(q.x,q.y,y,Q+Math.PI,x-j)}const ot=Gt(S,x,r,a);if(s.lineTo(ot.x,ot.y),v>0){const q=Gt(S,C,r,a);s.arc(q.x,q.y,v,x-j,C)}}else{s.moveTo(r,a);const A=Math.cos(C)*d+r,W=Math.sin(C)*d+a;s.lineTo(A,W);const et=Math.cos(P)*d+r,ot=Math.sin(P)*d+a;s.lineTo(et,ot)}s.closePath()}function dh(s,t,e,i,n){const{fullCircles:o,startAngle:r,circumference:a}=t;let l=t.endAngle;if(o){os(s,t,e,i,l,n);for(let h=0;h<o;++h)s.fill();isNaN(a)||(l=r+(a%V||V))}return os(s,t,e,i,l,n),s.fill(),l}function uh(s,t,e,i,n){const{fullCircles:o,startAngle:r,circumference:a,options:l}=t,{borderWidth:h,borderJoinStyle:c,borderDash:d,borderDashOffset:u}=l,f=l.borderAlign==="inner";if(!h)return;s.setLineDash(d||[]),s.lineDashOffset=u,f?(s.lineWidth=h*2,s.lineJoin=c||"round"):(s.lineWidth=h,s.lineJoin=c||"bevel");let p=t.endAngle;if(o){os(s,t,e,i,p,n);for(let g=0;g<o;++g)s.stroke();isNaN(a)||(p=r+(a%V||V))}f&&lh(s,t,p),o||(os(s,t,e,i,p,n),s.stroke())}class Zt extends lt{constructor(e){super();M(this,"circumference");M(this,"endAngle");M(this,"fullCircles");M(this,"innerRadius");M(this,"outerRadius");M(this,"pixelMargin");M(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,i,n){const o=this.getProps(["x","y"],n),{angle:r,distance:a}=wi(o,{x:e,y:i}),{startAngle:l,endAngle:h,innerRadius:c,outerRadius:d,circumference:u}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],n),f=(this.options.spacing+this.options.borderWidth)/2,p=D(u,h-l)>=V||re(r,l,h),g=pt(a,c+f,d+f);return p&&g}getCenterPoint(e){const{x:i,y:n,startAngle:o,endAngle:r,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:h,spacing:c}=this.options,d=(o+r)/2,u=(a+l+c+h)/2;return{x:i+Math.cos(d)*u,y:n+Math.sin(d)*u}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:i,circumference:n}=this,o=(i.offset||0)/4,r=(i.spacing||0)/2,a=i.circular;if(this.pixelMargin=i.borderAlign==="inner"?.33:0,this.fullCircles=n>V?Math.floor(n/V):0,n===0||this.innerRadius<0||this.outerRadius<0)return;e.save();const l=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(l)*o,Math.sin(l)*o);const h=1-Math.sin(Math.min(F,n||0)),c=o*h;e.fillStyle=i.backgroundColor,e.strokeStyle=i.borderColor,dh(e,this,c,r,a),uh(e,this,c,r,a),e.restore()}}M(Zt,"id","arc"),M(Zt,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),M(Zt,"defaultRoutes",{backgroundColor:"backgroundColor"}),M(Zt,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"});function Yn(s,t,e=t){s.lineCap=D(e.borderCapStyle,t.borderCapStyle),s.setLineDash(D(e.borderDash,t.borderDash)),s.lineDashOffset=D(e.borderDashOffset,t.borderDashOffset),s.lineJoin=D(e.borderJoinStyle,t.borderJoinStyle),s.lineWidth=D(e.borderWidth,t.borderWidth),s.strokeStyle=D(e.borderColor,t.borderColor)}function fh(s,t,e){s.lineTo(e.x,e.y)}function gh(s){return s.stepped?Fr:s.tension||s.cubicInterpolationMode==="monotone"?Vr:fh}function Un(s,t,e={}){const i=s.length,{start:n=0,end:o=i-1}=e,{start:r,end:a}=t,l=Math.max(n,r),h=Math.min(o,a),c=n<r&&o<r||n>a&&o>a;return{count:i,start:l,loop:t.loop,ilen:h<l&&!c?i+h-l:h-l}}function ph(s,t,e,i){const{points:n,options:o}=t,{count:r,start:a,loop:l,ilen:h}=Un(n,e,i),c=gh(o);let{move:d=!0,reverse:u}=i||{},f,p,g;for(f=0;f<=h;++f)p=n[(a+(u?h-f:f))%r],!p.skip&&(d?(s.moveTo(p.x,p.y),d=!1):c(s,g,p,u,o.stepped),g=p);return l&&(p=n[(a+(u?h:0))%r],c(s,g,p,u,o.stepped)),!!l}function mh(s,t,e,i){const n=t.points,{count:o,start:r,ilen:a}=Un(n,e,i),{move:l=!0,reverse:h}=i||{};let c=0,d=0,u,f,p,g,m,x;const _=b=>(r+(h?a-b:b))%o,v=()=>{g!==m&&(s.lineTo(c,m),s.lineTo(c,g),s.lineTo(c,x))};for(l&&(f=n[_(0)],s.moveTo(f.x,f.y)),u=0;u<=a;++u){if(f=n[_(u)],f.skip)continue;const b=f.x,y=f.y,w=b|0;w===p?(y<g?g=y:y>m&&(m=y),c=(d*c+b)/++d):(v(),s.lineTo(b,y),p=w,d=0,g=m=y),x=y}v()}function Ys(s){const t=s.options,e=t.borderDash&&t.borderDash.length;return!s._decimated&&!s._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?mh:ph}function xh(s){return s.stepped?ma:s.tension||s.cubicInterpolationMode==="monotone"?xa:Vt}function bh(s,t,e,i){let n=t._path;n||(n=t._path=new Path2D,t.path(n,e,i)&&n.closePath()),Yn(s,t.options),s.stroke(n)}function _h(s,t,e,i){const{segments:n,options:o}=t,r=Ys(t);for(const a of n)Yn(s,o,a.style),s.beginPath(),r(s,t,a,{start:e,end:e+i-1})&&s.closePath(),s.stroke()}const yh=typeof Path2D=="function";function vh(s,t,e,i){yh&&!t.options.segment?bh(s,t,e,i):_h(s,t,e,i)}class Ct extends lt{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const n=i.spanGaps?this._loop:this._fullLoop;la(this._points,i,t,n,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=wa(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,n=t[e],o=this.points,r=tn(this,{property:e,start:n,end:n});if(!r.length)return;const a=[],l=xh(i);let h,c;for(h=0,c=r.length;h<c;++h){const{start:d,end:u}=r[h],f=o[d],p=o[u];if(f===p){a.push(f);continue}const g=Math.abs((n-f[e])/(p[e]-f[e])),m=l(f,p,g,i.stepped);m[e]=t[e],a.push(m)}return a.length===1?a[0]:a}pathSegment(t,e,i){return Ys(this)(t,this,e,i)}path(t,e,i){const n=this.segments,o=Ys(this);let r=this._loop;e=e||0,i=i||this.points.length-e;for(const a of n)r&=o(t,this,a,{start:e,end:e+i-1});return!!r}draw(t,e,i,n){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),vh(t,this,i,n),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}M(Ct,"id","line"),M(Ct,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),M(Ct,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),M(Ct,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function Xn(s,t,e,i){const n=s.options,{[e]:o}=s.getProps([e],i);return Math.abs(t-o)<n.radius+n.hitRadius}class ye extends lt{constructor(e){super();M(this,"parsed");M(this,"skip");M(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,i,n){const o=this.options,{x:r,y:a}=this.getProps(["x","y"],n);return Math.pow(e-r,2)+Math.pow(i-a,2)<Math.pow(o.hitRadius+o.radius,2)}inXRange(e,i){return Xn(this,e,"x",i)}inYRange(e,i){return Xn(this,e,"y",i)}getCenterPoint(e){const{x:i,y:n}=this.getProps(["x","y"],e);return{x:i,y:n}}size(e){e=e||this.options||{};let i=e.radius||0;i=Math.max(i,i&&e.hoverRadius||0);const n=i&&e.borderWidth||0;return(i+n)*2}draw(e,i){const n=this.options;this.skip||n.radius<.1||!xt(this,i,this.size(n)/2)||(e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.fillStyle=n.backgroundColor,Os(e,n,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}M(ye,"id","point"),M(ye,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),M(ye,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Kn(s,t){const{x:e,y:i,base:n,width:o,height:r}=s.getProps(["x","y","base","width","height"],t);let a,l,h,c,d;return s.horizontal?(d=r/2,a=Math.min(e,n),l=Math.max(e,n),h=i-d,c=i+d):(d=o/2,a=e-d,l=e+d,h=Math.min(i,n),c=Math.max(i,n)),{left:a,top:h,right:l,bottom:c}}function Ot(s,t,e,i){return s?0:Y(t,e,i)}function Mh(s,t,e){const i=s.options.borderWidth,n=s.borderSkipped,o=Vi(i);return{t:Ot(n.top,o.top,0,e),r:Ot(n.right,o.right,0,t),b:Ot(n.bottom,o.bottom,0,e),l:Ot(n.left,o.left,0,t)}}function wh(s,t,e){const{enableBorderRadius:i}=s.getProps(["enableBorderRadius"]),n=s.options.borderRadius,o=It(n),r=Math.min(t,e),a=s.borderSkipped,l=i||T(n);return{topLeft:Ot(!l||a.top||a.left,o.topLeft,0,r),topRight:Ot(!l||a.top||a.right,o.topRight,0,r),bottomLeft:Ot(!l||a.bottom||a.left,o.bottomLeft,0,r),bottomRight:Ot(!l||a.bottom||a.right,o.bottomRight,0,r)}}function kh(s){const t=Kn(s),e=t.right-t.left,i=t.bottom-t.top,n=Mh(s,e/2,i/2),o=wh(s,e/2,i/2);return{outer:{x:t.left,y:t.top,w:e,h:i,radius:o},inner:{x:t.left+n.l,y:t.top+n.t,w:e-n.l-n.r,h:i-n.t-n.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(n.t,n.l)),topRight:Math.max(0,o.topRight-Math.max(n.t,n.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(n.b,n.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(n.b,n.r))}}}}function Us(s,t,e,i){const n=t===null,o=e===null,r=s&&!(n&&o)&&Kn(s,i);return r&&(n||pt(t,r.left,r.right))&&(o||pt(e,r.top,r.bottom))}function Sh(s){return s.topLeft||s.topRight||s.bottomLeft||s.bottomRight}function Ph(s,t){s.rect(t.x,t.y,t.w,t.h)}function Xs(s,t,e={}){const i=s.x!==e.x?-t:0,n=s.y!==e.y?-t:0,o=(s.x+s.w!==e.x+e.w?t:0)-i,r=(s.y+s.h!==e.y+e.h?t:0)-n;return{x:s.x+i,y:s.y+n,w:s.w+o,h:s.h+r,radius:s.radius}}class ve extends lt{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:i,backgroundColor:n}}=this,{inner:o,outer:r}=kh(this),a=Sh(r.radius)?ce:Ph;t.save(),(r.w!==o.w||r.h!==o.h)&&(t.beginPath(),a(t,Xs(r,e,o)),t.clip(),a(t,Xs(o,-e,r)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),a(t,Xs(o,e)),t.fillStyle=n,t.fill(),t.restore()}inRange(t,e,i){return Us(this,t,e,i)}inXRange(t,e){return Us(this,t,null,e)}inYRange(t,e){return Us(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:n,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(e+n)/2:e,y:o?i:(i+n)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}M(ve,"id","bar"),M(ve,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),M(ve,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var Dh=Object.freeze({__proto__:null,ArcElement:Zt,BarElement:ve,LineElement:Ct,PointElement:ye});const Ks=["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)"],qn=Ks.map(s=>s.replace("rgb(","rgba(").replace(")",", 0.5)"));function Gn(s){return Ks[s%Ks.length]}function Zn(s){return qn[s%qn.length]}function Ch(s,t){return s.borderColor=Gn(t),s.backgroundColor=Zn(t),++t}function Oh(s,t){return s.backgroundColor=s.data.map(()=>Gn(t++)),t}function Ah(s,t){return s.backgroundColor=s.data.map(()=>Zn(t++)),t}function Th(s){let t=0;return(e,i)=>{const n=s.getDatasetMeta(i).controller;n instanceof Bt?t=Oh(e,t):n instanceof ue?t=Ah(e,t):n&&(t=Ch(e,t))}}function Jn(s){let t;for(t in s)if(s[t].borderColor||s[t].backgroundColor)return!0;return!1}function Lh(s){return s&&(s.borderColor||s.backgroundColor)}var Eh={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(s,t,e){if(!e.enabled)return;const{data:{datasets:i},options:n}=s.config,{elements:o}=n;if(!e.forceOverride&&(Jn(i)||Lh(n)||o&&Jn(o)))return;const r=Th(s);i.forEach(r)}};function Rh(s,t,e,i,n){const o=n.samples||i;if(o>=e)return s.slice(t,t+e);const r=[],a=(e-2)/(o-2);let l=0;const h=t+e-1;let c=t,d,u,f,p,g;for(r[l++]=s[c],d=0;d<o-2;d++){let m=0,x=0,_;const v=Math.floor((d+1)*a)+1+t,b=Math.min(Math.floor((d+2)*a)+1,e)+t,y=b-v;for(_=v;_<b;_++)m+=s[_].x,x+=s[_].y;m/=y,x/=y;const w=Math.floor(d*a)+1+t,S=Math.min(Math.floor((d+1)*a)+1,e)+t,{x:k,y:C}=s[c];for(f=p=-1,_=w;_<S;_++)p=.5*Math.abs((k-m)*(s[_].y-C)-(k-s[_].x)*(x-C)),p>f&&(f=p,u=s[_],g=_);r[l++]=u,c=g}return r[l++]=s[h],r}function Ih(s,t,e,i){let n=0,o=0,r,a,l,h,c,d,u,f,p,g;const m=[],x=t+e-1,_=s[t].x,v=s[x].x-_;for(r=t;r<t+e;++r){a=s[r],l=(a.x-_)/v*i,h=a.y;const b=l|0;if(b===c)h<p?(p=h,d=r):h>g&&(g=h,u=r),n=(o*n+a.x)/++o;else{const y=r-1;if(!O(d)&&!O(u)){const w=Math.min(d,u),S=Math.max(d,u);w!==f&&w!==y&&m.push({...s[w],x:n}),S!==f&&S!==y&&m.push({...s[S],x:n})}r>0&&y!==f&&m.push(s[y]),m.push(a),c=b,o=0,p=g=h,d=u=f=r}}return m}function Qn(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 to(s){s.data.datasets.forEach(t=>{Qn(t)})}function zh(s,t){const e=t.length;let i=0,n;const{iScale:o}=s,{min:r,max:a,minDefined:l,maxDefined:h}=o.getUserBounds();return l&&(i=Y(mt(t,o.axis,r).lo,0,e-1)),h?n=Y(mt(t,o.axis,a).hi+1,i,e)-i:n=e-i,{start:i,count:n}}var Fh={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(s,t,e)=>{if(!e.enabled){to(s);return}const i=s.width;s.data.datasets.forEach((n,o)=>{const{_data:r,indexAxis:a}=n,l=s.getDatasetMeta(o),h=r||n.data;if(B([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:d,count:u}=zh(l,h);const f=e.threshold||4*i;if(u<=f){Qn(n);return}O(r)&&(n._data=h,delete n.data,Object.defineProperty(n,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(g){this._data=g}}));let p;switch(e.algorithm){case"lttb":p=Rh(h,d,u,i,e);break;case"min-max":p=Ih(h,d,u,i);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}n._decimated=p})},destroy(s){to(s)}};function Vh(s,t,e){const i=s.segments,n=s.points,o=t.points,r=[];for(const a of i){let{start:l,end:h}=a;h=Gs(l,h,n);const c=qs(e,n[l],n[h],a.loop);if(!t.segments){r.push({source:a,target:c,start:n[l],end:n[h]});continue}const d=tn(t,c);for(const u of d){const f=qs(e,o[u.start],o[u.end],u.loop),p=Qi(a,n,f);for(const g of p)r.push({source:g,target:u,start:{[e]:eo(c,f,"start",Math.max)},end:{[e]:eo(c,f,"end",Math.min)}})}}return r}function qs(s,t,e,i){if(i)return;let n=t[s],o=e[s];return s==="angle"&&(n=it(n),o=it(o)),{property:s,start:n,end:o}}function Bh(s,t){const{x:e=null,y:i=null}=s||{},n=t.points,o=[];return t.segments.forEach(({start:r,end:a})=>{a=Gs(r,a,n);const l=n[r],h=n[a];i!==null?(o.push({x:l.x,y:i}),o.push({x:h.x,y:i})):e!==null&&(o.push({x:e,y:l.y}),o.push({x:e,y:h.y}))}),o}function Gs(s,t,e){for(;t>s;t--){const i=e[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function eo(s,t,e,i){return s&&t?i(s[e],t[e]):s?s[e]:t?t[e]:0}function so(s,t){let e=[],i=!1;return z(s)?(i=!0,e=s):e=Bh(s,t),e.length?new Ct({points:e,options:{tension:0},_loop:i,_fullLoop:i}):null}function io(s){return s&&s.fill!==!1}function Wh(s,t,e){let i=s[t].fill;const n=[t];let o;if(!e)return i;for(;i!==!1&&n.indexOf(i)===-1;){if(!H(i))return i;if(o=s[i],!o)return!1;if(o.visible)return i;n.push(i),i=o.fill}return!1}function Nh(s,t,e){const i=Yh(s);if(T(i))return isNaN(i.value)?!1:i;let n=parseFloat(i);return H(n)&&Math.floor(n)===n?Hh(i[0],t,n,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function Hh(s,t,e,i){return(s==="-"||s==="+")&&(e=t+e),e===t||e<0||e>=i?!1:e}function jh(s,t){let e=null;return s==="start"?e=t.bottom:s==="end"?e=t.top:T(s)?e=t.getPixelForValue(s.value):t.getBasePixel&&(e=t.getBasePixel()),e}function $h(s,t,e){let i;return s==="start"?i=e:s==="end"?i=t.options.reverse?t.min:t.max:T(s)?i=s.value:i=t.getBaseValue(),i}function Yh(s){const t=s.options,e=t.fill;let i=D(e&&e.target,e);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function Uh(s){const{scale:t,index:e,line:i}=s,n=[],o=i.segments,r=i.points,a=Xh(t,e);a.push(so({x:null,y:t.bottom},i));for(let l=0;l<o.length;l++){const h=o[l];for(let c=h.start;c<=h.end;c++)Kh(n,r[c],a)}return new Ct({points:n,options:{}})}function Xh(s,t){const e=[],i=s.getMatchingVisibleMetas("line");for(let n=0;n<i.length;n++){const o=i[n];if(o.index===t)break;o.hidden||e.unshift(o.dataset)}return e}function Kh(s,t,e){const i=[];for(let n=0;n<e.length;n++){const o=e[n],{first:r,last:a,point:l}=qh(o,t,"x");if(!(!l||r&&a)){if(r)i.unshift(l);else if(s.push(l),!a)break}}s.push(...i)}function qh(s,t,e){const i=s.interpolate(t,e);if(!i)return{};const n=i[e],o=s.segments,r=s.points;let a=!1,l=!1;for(let h=0;h<o.length;h++){const c=o[h],d=r[c.start][e],u=r[c.end][e];if(pt(n,d,u)){a=n===d,l=n===u;break}}return{first:a,last:l,point:i}}class no{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:n,y:o,radius:r}=this;return e=e||{start:0,end:V},t.arc(n,o,r,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:n}=this,o=t.angle;return{x:e+Math.cos(o)*n,y:i+Math.sin(o)*n,angle:o}}}function Gh(s){const{chart:t,fill:e,line:i}=s;if(H(e))return Zh(t,e);if(e==="stack")return Uh(s);if(e==="shape")return!0;const n=Jh(s);return n instanceof no?n:so(n,i)}function Zh(s,t){const e=s.getDatasetMeta(t);return e&&s.isDatasetVisible(t)?e.dataset:null}function Jh(s){return(s.scale||{}).getPointPositionForValue?tc(s):Qh(s)}function Qh(s){const{scale:t={},fill:e}=s,i=jh(e,t);if(H(i)){const n=t.isHorizontal();return{x:n?i:null,y:n?null:i}}return null}function tc(s){const{scale:t,fill:e}=s,i=t.options,n=t.getLabels().length,o=i.reverse?t.max:t.min,r=$h(e,t,o),a=[];if(i.grid.circular){const l=t.getPointPositionForValue(0,o);return new no({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(r)})}for(let l=0;l<n;++l)a.push(t.getPointPositionForValue(l,r));return a}function Zs(s,t,e){const i=Gh(t),{line:n,scale:o,axis:r}=t,a=n.options,l=a.fill,h=a.backgroundColor,{above:c=h,below:d=h}=l||{};i&&n.points.length&&(We(s,e),ec(s,{line:n,target:i,above:c,below:d,area:e,scale:o,axis:r}),Ne(s))}function ec(s,t){const{line:e,target:i,above:n,below:o,area:r,scale:a}=t,l=e._loop?"angle":t.axis;s.save(),l==="x"&&o!==n&&(oo(s,i,r.top),ro(s,{line:e,target:i,color:n,scale:a,property:l}),s.restore(),s.save(),oo(s,i,r.bottom)),ro(s,{line:e,target:i,color:o,scale:a,property:l}),s.restore()}function oo(s,t,e){const{segments:i,points:n}=t;let o=!0,r=!1;s.beginPath();for(const a of i){const{start:l,end:h}=a,c=n[l],d=n[Gs(l,h,n)];o?(s.moveTo(c.x,c.y),o=!1):(s.lineTo(c.x,e),s.lineTo(c.x,c.y)),r=!!t.pathSegment(s,a,{move:r}),r?s.closePath():s.lineTo(d.x,e)}s.lineTo(t.first().x,e),s.closePath(),s.clip()}function ro(s,t){const{line:e,target:i,property:n,color:o,scale:r}=t,a=Vh(e,i,n);for(const{source:l,target:h,start:c,end:d}of a){const{style:{backgroundColor:u=o}={}}=l,f=i!==!0;s.save(),s.fillStyle=u,sc(s,r,f&&qs(n,c,d)),s.beginPath();const p=!!e.pathSegment(s,l);let g;if(f){p?s.closePath():ao(s,i,d,n);const m=!!i.pathSegment(s,h,{move:p,reverse:!0});g=p&&m,g||ao(s,i,c,n)}s.closePath(),s.fill(g?"evenodd":"nonzero"),s.restore()}}function sc(s,t,e){const{top:i,bottom:n}=t.chart.chartArea,{property:o,start:r,end:a}=e||{};o==="x"&&(s.beginPath(),s.rect(r,i,a-r,n-i),s.clip())}function ao(s,t,e,i){const n=t.interpolate(e,i);n&&s.lineTo(n.x,n.y)}var ic={id:"filler",afterDatasetsUpdate(s,t,e){const i=(s.data.datasets||[]).length,n=[];let o,r,a,l;for(r=0;r<i;++r)o=s.getDatasetMeta(r),a=o.dataset,l=null,a&&a.options&&a instanceof Ct&&(l={visible:s.isDatasetVisible(r),index:r,fill:Nh(a,r,i),chart:s,axis:o.controller.options.indexAxis,scale:o.vScale,line:a}),o.$filler=l,n.push(l);for(r=0;r<i;++r)l=n[r],!(!l||l.fill===!1)&&(l.fill=Wh(n,r,e.propagate))},beforeDraw(s,t,e){const i=e.drawTime==="beforeDraw",n=s.getSortedVisibleDatasetMetas(),o=s.chartArea;for(let r=n.length-1;r>=0;--r){const a=n[r].$filler;a&&(a.line.updateControlPoints(o,a.axis),i&&a.fill&&Zs(s.ctx,a,o))}},beforeDatasetsDraw(s,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const i=s.getSortedVisibleDatasetMetas();for(let n=i.length-1;n>=0;--n){const o=i[n].$filler;io(o)&&Zs(s.ctx,o,s.chartArea)}},beforeDatasetDraw(s,t,e){const i=t.meta.$filler;!io(i)||e.drawTime!=="beforeDatasetDraw"||Zs(s.ctx,i,s.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const lo=(s,t)=>{let{boxHeight:e=t,boxWidth:i=t}=s;return s.usePointStyle&&(e=Math.min(e,t),i=s.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:e,itemHeight:Math.max(t,e)}},nc=(s,t)=>s!==null&&t!==null&&s.datasetIndex===t.datasetIndex&&s.index===t.index;class ho extends lt{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=I(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(i=>t.filter(i,this.chart.data))),t.sort&&(e=e.sort((i,n)=>t.sort(i,n,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const i=t.labels,n=$(i.font),o=n.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=lo(i,o);let h,c;e.font=n.string,this.isHorizontal()?(h=this.maxWidth,c=this._fitRows(r,o,a,l)+10):(c=this.maxHeight,h=this._fitCols(r,n,a,l)+10),this.width=Math.min(h,t.maxWidth||this.maxWidth),this.height=Math.min(c,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,n){const{ctx:o,maxWidth:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],h=this.lineWidths=[0],c=n+a;let d=t;o.textAlign="left",o.textBaseline="middle";let u=-1,f=-c;return this.legendItems.forEach((p,g)=>{const m=i+e/2+o.measureText(p.text).width;(g===0||h[h.length-1]+m+2*a>r)&&(d+=c,h[h.length-(g>0?0:1)]=0,f+=c,u++),l[g]={left:0,top:f,row:u,width:m,height:n},h[h.length-1]+=m+a}),d}_fitCols(t,e,i,n){const{ctx:o,maxHeight:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],h=this.columnSizes=[],c=r-t;let d=a,u=0,f=0,p=0,g=0;return this.legendItems.forEach((m,x)=>{const{itemWidth:_,itemHeight:v}=oc(i,e,o,m,n);x>0&&f+v+2*a>c&&(d+=u+a,h.push({width:u,height:f}),p+=u+a,g++,u=f=0),l[x]={left:p,top:f,col:g,width:_,height:v},u=Math.max(u,_),f+=v+a}),d+=u,h.push({width:u,height:f}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:n},rtl:o}}=this,r=qt(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=X(i,this.left+n,this.right-this.lineWidths[a]);for(const h of e)a!==h.row&&(a=h.row,l=X(i,this.left+n,this.right-this.lineWidths[a])),h.top+=this.top+t+n,h.left=r.leftForLtr(r.x(l),h.width),l+=h.width+n}else{let a=0,l=X(i,this.top+t+n,this.bottom-this.columnSizes[a].height);for(const h of e)h.col!==a&&(a=h.col,l=X(i,this.top+t+n,this.bottom-this.columnSizes[a].height)),h.top=l,h.left+=this.left+n,h.left=r.leftForLtr(r.x(h.left),h.width),l+=h.height+n}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;We(t,this),this._draw(),Ne(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:n}=this,{align:o,labels:r}=t,a=N.color,l=qt(t.rtl,this.left,this.width),h=$(r.font),{padding:c}=r,d=h.size,u=d/2;let f;this.drawTitle(),n.textAlign=l.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=h.string;const{boxWidth:p,boxHeight:g,itemHeight:m}=lo(r,d),x=function(w,S,k){if(isNaN(p)||p<=0||isNaN(g)||g<0)return;n.save();const C=D(k.lineWidth,1);if(n.fillStyle=D(k.fillStyle,a),n.lineCap=D(k.lineCap,"butt"),n.lineDashOffset=D(k.lineDashOffset,0),n.lineJoin=D(k.lineJoin,"miter"),n.lineWidth=C,n.strokeStyle=D(k.strokeStyle,a),n.setLineDash(D(k.lineDash,[])),r.usePointStyle){const P={radius:g*Math.SQRT2/2,pointStyle:k.pointStyle,rotation:k.rotation,borderWidth:C},L=l.xPlus(w,p/2),E=S+u;Fi(n,P,L,E,r.pointStyleWidth&&p)}else{const P=S+Math.max((d-g)/2,0),L=l.leftForLtr(w,p),E=It(k.borderRadius);n.beginPath(),Object.values(E).some(Q=>Q!==0)?ce(n,{x:L,y:P,w:p,h:g,radius:E}):n.rect(L,P,p,g),n.fill(),C!==0&&n.stroke()}n.restore()},_=function(w,S,k){Rt(n,k.text,w,S+m/2,h,{strikethrough:k.hidden,textAlign:l.textAlign(k.textAlign)})},v=this.isHorizontal(),b=this._computeTitleHeight();v?f={x:X(o,this.left+c,this.right-i[0]),y:this.top+c+b,line:0}:f={x:this.left+c,y:X(o,this.top+b+c,this.bottom-e[0].height),line:0},qi(this.ctx,t.textDirection);const y=m+c;this.legendItems.forEach((w,S)=>{n.strokeStyle=w.fontColor,n.fillStyle=w.fontColor;const k=n.measureText(w.text).width,C=l.textAlign(w.textAlign||(w.textAlign=r.textAlign)),P=p+u+k;let L=f.x,E=f.y;l.setWidth(this.width),v?S>0&&L+P+c>this.right&&(E=f.y+=y,f.line++,L=f.x=X(o,this.left+c,this.right-i[f.line])):S>0&&E+y>this.bottom&&(L=f.x=L+e[f.line].width+c,f.line++,E=f.y=X(o,this.top+b+c,this.bottom-e[f.line].height));const Q=l.x(L);if(x(Q,E,w),L=Pr(C,L+p+u,v?L+P:this.right,t.rtl),_(l.x(L),E,w),v)f.x+=P+c;else if(typeof w.text!="string"){const tt=h.lineHeight;f.y+=co(w,tt)+c}else f.y+=y}),Gi(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=$(e.font),n=U(e.padding);if(!e.display)return;const o=qt(t.rtl,this.left,this.width),r=this.ctx,a=e.position,l=i.size/2,h=n.top+l;let c,d=this.left,u=this.width;if(this.isHorizontal())u=Math.max(...this.lineWidths),c=this.top+h,d=X(t.align,d,this.right-u);else{const p=this.columnSizes.reduce((g,m)=>Math.max(g,m.height),0);c=h+X(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const f=X(a,d,d+u);r.textAlign=o.textAlign(ks(a)),r.textBaseline="middle",r.strokeStyle=e.color,r.fillStyle=e.color,r.font=i.string,Rt(r,e.text,f,c,i)}_computeTitleHeight(){const t=this.options.title,e=$(t.font),i=U(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,n,o;if(pt(t,this.left,this.right)&&pt(e,this.top,this.bottom)){for(o=this.legendHitBoxes,i=0;i<o.length;++i)if(n=o[i],pt(t,n.left,n.left+n.width)&&pt(e,n.top,n.top+n.height))return this.legendItems[i]}return null}handleEvent(t){const e=this.options;if(!lc(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const n=this._hoveredItem,o=nc(n,i);n&&!o&&I(e.onLeave,[t,n,this],this),this._hoveredItem=i,i&&!o&&I(e.onHover,[t,i,this],this)}else i&&I(e.onClick,[t,i,this],this)}}function oc(s,t,e,i,n){const o=rc(i,s,t,e),r=ac(n,i,t.lineHeight);return{itemWidth:o,itemHeight:r}}function rc(s,t,e,i){let n=s.text;return n&&typeof n!="string"&&(n=n.reduce((o,r)=>o.length>r.length?o:r)),t+e.size/2+i.measureText(n).width}function ac(s,t,e){let i=s;return typeof t.text!="string"&&(i=co(t,e)),i}function co(s,t){const e=s.text?s.text.length:0;return t*e}function lc(s,t){return!!((s==="mousemove"||s==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(s==="click"||s==="mouseup"))}var hc={id:"legend",_element:ho,start(s,t,e){const i=s.legend=new ho({ctx:s.ctx,options:e,chart:s});K.configure(s,i,e),K.addBox(s,i)},stop(s){K.removeBox(s,s.legend),delete s.legend},beforeUpdate(s,t,e){const i=s.legend;K.configure(s,i,e),i.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 i=t.datasetIndex,n=e.chart;n.isDatasetVisible(i)?(n.hide(i),t.hidden=!0):(n.show(i),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:i,textAlign:n,color:o,useBorderRadius:r,borderRadius:a}}=s.legend.options;return s._getSortedDatasetMetas().map(l=>{const h=l.controller.getStyle(e?0:void 0),c=U(h.borderWidth);return{text:t[l.index].label,fillStyle:h.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:h.borderCapStyle,lineDash:h.borderDash,lineDashOffset:h.borderDashOffset,lineJoin:h.borderJoinStyle,lineWidth:(c.width+c.height)/4,strokeStyle:h.borderColor,pointStyle:i||h.pointStyle,rotation:h.rotation,textAlign:n||h.textAlign,borderRadius:r&&(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 Js extends lt{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const n=z(i.text)?i.text.length:1;this._padding=U(i.padding);const o=n*$(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:i,bottom:n,right:o,options:r}=this,a=r.align;let l=0,h,c,d;return this.isHorizontal()?(c=X(a,i,o),d=e+t,h=o-i):(r.position==="left"?(c=i+t,d=X(a,n,e),l=F*-.5):(c=o-t,d=X(a,e,n),l=F*.5),h=n-e),{titleX:c,titleY:d,maxWidth:h,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=$(e.font),n=i.lineHeight/2+this._padding.top,{titleX:o,titleY:r,maxWidth:a,rotation:l}=this._drawArgs(n);Rt(t,e.text,0,0,i,{color:e.color,maxWidth:a,rotation:l,textAlign:ks(e.align),textBaseline:"middle",translation:[o,r]})}}function cc(s,t){const e=new Js({ctx:s.ctx,options:t,chart:s});K.configure(s,e,t),K.addBox(s,e),s.titleBlock=e}var dc={id:"title",_element:Js,start(s,t,e){cc(s,e)},stop(s){const t=s.titleBlock;K.removeBox(s,t),delete s.titleBlock},beforeUpdate(s,t,e){const i=s.titleBlock;K.configure(s,i,e),i.options=e},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const rs=new WeakMap;var uc={id:"subtitle",start(s,t,e){const i=new Js({ctx:s.ctx,options:e,chart:s});K.configure(s,i,e),K.addBox(s,i),rs.set(s,i)},stop(s){K.removeBox(s,rs.get(s)),rs.delete(s)},beforeUpdate(s,t,e){const i=rs.get(s);K.configure(s,i,e),i.options=e},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Me={average(s){if(!s.length)return!1;let t,e,i=new Set,n=0,o=0;for(t=0,e=s.length;t<e;++t){const r=s[t].element;if(r&&r.hasValue()){const a=r.tooltipPosition();i.add(a.x),n+=a.y,++o}}return{x:[...i].reduce((r,a)=>r+a)/i.size,y:n/o}},nearest(s,t){if(!s.length)return!1;let e=t.x,i=t.y,n=Number.POSITIVE_INFINITY,o,r,a;for(o=0,r=s.length;o<r;++o){const l=s[o].element;if(l&&l.hasValue()){const h=l.getCenterPoint(),c=Ms(t,h);c<n&&(n=c,a=l)}}if(a){const l=a.tooltipPosition();e=l.x,i=l.y}return{x:e,y:i}}};function ut(s,t){return t&&(z(t)?Array.prototype.push.apply(s,t):s.push(t)),s}function yt(s){return(typeof s=="string"||s instanceof String)&&s.indexOf(`
|
|
17
|
+
`)>-1?s.split(`
|
|
18
|
+
`):s}function fc(s,t){const{element:e,datasetIndex:i,index:n}=t,o=s.getDatasetMeta(i).controller,{label:r,value:a}=o.getLabelAndValue(n);return{chart:s,label:r,parsed:o.getParsed(n),raw:s.data.datasets[i].data[n],formattedValue:a,dataset:o.getDataset(),dataIndex:n,datasetIndex:i,element:e}}function uo(s,t){const e=s.chart.ctx,{body:i,footer:n,title:o}=s,{boxWidth:r,boxHeight:a}=t,l=$(t.bodyFont),h=$(t.titleFont),c=$(t.footerFont),d=o.length,u=n.length,f=i.length,p=U(t.padding);let g=p.height,m=0,x=i.reduce((b,y)=>b+y.before.length+y.lines.length+y.after.length,0);if(x+=s.beforeBody.length+s.afterBody.length,d&&(g+=d*h.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),x){const b=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;g+=f*b+(x-f)*l.lineHeight+(x-1)*t.bodySpacing}u&&(g+=t.footerMarginTop+u*c.lineHeight+(u-1)*t.footerSpacing);let _=0;const v=function(b){m=Math.max(m,e.measureText(b).width+_)};return e.save(),e.font=h.string,R(s.title,v),e.font=l.string,R(s.beforeBody.concat(s.afterBody),v),_=t.displayColors?r+2+t.boxPadding:0,R(i,b=>{R(b.before,v),R(b.lines,v),R(b.after,v)}),_=0,e.font=c.string,R(s.footer,v),e.restore(),m+=p.width,{width:m,height:g}}function gc(s,t){const{y:e,height:i}=t;return e<i/2?"top":e>s.height-i/2?"bottom":"center"}function pc(s,t,e,i){const{x:n,width:o}=i,r=e.caretSize+e.caretPadding;if(s==="left"&&n+o+r>t.width||s==="right"&&n-o-r<0)return!0}function mc(s,t,e,i){const{x:n,width:o}=e,{width:r,chartArea:{left:a,right:l}}=s;let h="center";return i==="center"?h=n<=(a+l)/2?"left":"right":n<=o/2?h="left":n>=r-o/2&&(h="right"),pc(h,s,t,e)&&(h="center"),h}function fo(s,t,e){const i=e.yAlign||t.yAlign||gc(s,e);return{xAlign:e.xAlign||t.xAlign||mc(s,t,e,i),yAlign:i}}function xc(s,t){let{x:e,width:i}=s;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function bc(s,t,e){let{y:i,height:n}=s;return t==="top"?i+=e:t==="bottom"?i-=n+e:i-=n/2,i}function go(s,t,e,i){const{caretSize:n,caretPadding:o,cornerRadius:r}=s,{xAlign:a,yAlign:l}=e,h=n+o,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:f}=It(r);let p=xc(t,a);const g=bc(t,l,h);return l==="center"?a==="left"?p+=h:a==="right"&&(p-=h):a==="left"?p-=Math.max(c,u)+n:a==="right"&&(p+=Math.max(d,f)+n),{x:Y(p,0,i.width-t.width),y:Y(g,0,i.height-t.height)}}function as(s,t,e){const i=U(e.padding);return t==="center"?s.x+s.width/2:t==="right"?s.x+s.width-i.right:s.x+i.left}function po(s){return ut([],yt(s))}function _c(s,t,e){return Dt(s,{tooltip:t,tooltipItems:e,type:"tooltip"})}function mo(s,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?s.override(e):s}const xo={beforeTitle:gt,title(s){if(s.length>0){const t=s[0],e=t.chart.data.labels,i=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex<i)return e[t.dataIndex]}return""},afterTitle:gt,beforeBody:gt,beforeLabel:gt,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 O(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:gt,afterBody:gt,beforeFooter:gt,footer:gt,afterFooter:gt};function G(s,t,e,i){const n=s[t].call(e,i);return typeof n>"u"?xo[t].call(e,i):n}class Qs extends lt{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),n=i.enabled&&e.options.animation&&i.animations,o=new on(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=_c(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,n=G(i,"beforeTitle",this,t),o=G(i,"title",this,t),r=G(i,"afterTitle",this,t);let a=[];return a=ut(a,yt(n)),a=ut(a,yt(o)),a=ut(a,yt(r)),a}getBeforeBody(t,e){return po(G(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,n=[];return R(t,o=>{const r={before:[],lines:[],after:[]},a=mo(i,o);ut(r.before,yt(G(a,"beforeLabel",this,o))),ut(r.lines,G(a,"label",this,o)),ut(r.after,yt(G(a,"afterLabel",this,o))),n.push(r)}),n}getAfterBody(t,e){return po(G(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,n=G(i,"beforeFooter",this,t),o=G(i,"footer",this,t),r=G(i,"afterFooter",this,t);let a=[];return a=ut(a,yt(n)),a=ut(a,yt(o)),a=ut(a,yt(r)),a}_createItems(t){const e=this._active,i=this.chart.data,n=[],o=[],r=[];let a=[],l,h;for(l=0,h=e.length;l<h;++l)a.push(fc(this.chart,e[l]));return t.filter&&(a=a.filter((c,d,u)=>t.filter(c,d,u,i))),t.itemSort&&(a=a.sort((c,d)=>t.itemSort(c,d,i))),R(a,c=>{const d=mo(t.callbacks,c);n.push(G(d,"labelColor",this,c)),o.push(G(d,"labelPointStyle",this,c)),r.push(G(d,"labelTextColor",this,c))}),this.labelColors=n,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=a,a}update(t,e){const i=this.options.setContext(this.getContext()),n=this._active;let o,r=[];if(!n.length)this.opacity!==0&&(o={opacity:0});else{const a=Me[i.position].call(this,n,this._eventPosition);r=this._createItems(i),this.title=this.getTitle(r,i),this.beforeBody=this.getBeforeBody(r,i),this.body=this.getBody(r,i),this.afterBody=this.getAfterBody(r,i),this.footer=this.getFooter(r,i);const l=this._size=uo(this,i),h=Object.assign({},a,l),c=fo(this.chart,i,h),d=go(i,h,c,this.chart);this.xAlign=c.xAlign,this.yAlign=c.yAlign,o={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=r,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,n){const o=this.getCaretPosition(t,i,n);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(t,e,i){const{xAlign:n,yAlign:o}=this,{caretSize:r,cornerRadius:a}=i,{topLeft:l,topRight:h,bottomLeft:c,bottomRight:d}=It(a),{x:u,y:f}=t,{width:p,height:g}=e;let m,x,_,v,b,y;return o==="center"?(b=f+g/2,n==="left"?(m=u,x=m-r,v=b+r,y=b-r):(m=u+p,x=m+r,v=b-r,y=b+r),_=m):(n==="left"?x=u+Math.max(l,c)+r:n==="right"?x=u+p-Math.max(h,d)-r:x=this.caretX,o==="top"?(v=f,b=v-r,m=x-r,_=x+r):(v=f+g,b=v+r,m=x+r,_=x-r),y=v),{x1:m,x2:x,x3:_,y1:v,y2:b,y3:y}}drawTitle(t,e,i){const n=this.title,o=n.length;let r,a,l;if(o){const h=qt(i.rtl,this.x,this.width);for(t.x=as(this,i.titleAlign,i),e.textAlign=h.textAlign(i.titleAlign),e.textBaseline="middle",r=$(i.titleFont),a=i.titleSpacing,e.fillStyle=i.titleColor,e.font=r.string,l=0;l<o;++l)e.fillText(n[l],h.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+a,l+1===o&&(t.y+=i.titleMarginBottom-a)}}_drawColorBox(t,e,i,n,o){const r=this.labelColors[i],a=this.labelPointStyles[i],{boxHeight:l,boxWidth:h}=o,c=$(o.bodyFont),d=as(this,"left",o),u=n.x(d),f=l<c.lineHeight?(c.lineHeight-l)/2:0,p=e.y+f;if(o.usePointStyle){const g={radius:Math.min(h,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},m=n.leftForLtr(u,h)+h/2,x=p+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,Os(t,g,m,x),t.strokeStyle=r.borderColor,t.fillStyle=r.backgroundColor,Os(t,g,m,x)}else{t.lineWidth=T(r.borderWidth)?Math.max(...Object.values(r.borderWidth)):r.borderWidth||1,t.strokeStyle=r.borderColor,t.setLineDash(r.borderDash||[]),t.lineDashOffset=r.borderDashOffset||0;const g=n.leftForLtr(u,h),m=n.leftForLtr(n.xPlus(u,1),h-2),x=It(r.borderRadius);Object.values(x).some(_=>_!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,ce(t,{x:g,y:p,w:h,h:l,radius:x}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),ce(t,{x:m,y:p+1,w:h-2,h:l-2,radius:x}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(g,p,h,l),t.strokeRect(g,p,h,l),t.fillStyle=r.backgroundColor,t.fillRect(m,p+1,h-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:n}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:l,boxWidth:h,boxPadding:c}=i,d=$(i.bodyFont);let u=d.lineHeight,f=0;const p=qt(i.rtl,this.x,this.width),g=function(k){e.fillText(k,p.x(t.x+f),t.y+u/2),t.y+=u+o},m=p.textAlign(r);let x,_,v,b,y,w,S;for(e.textAlign=r,e.textBaseline="middle",e.font=d.string,t.x=as(this,m,i),e.fillStyle=i.bodyColor,R(this.beforeBody,g),f=a&&m!=="right"?r==="center"?h/2+c:h+2+c:0,b=0,w=n.length;b<w;++b){for(x=n[b],_=this.labelTextColors[b],e.fillStyle=_,R(x.before,g),v=x.lines,a&&v.length&&(this._drawColorBox(e,t,b,p,i),u=Math.max(d.lineHeight,l)),y=0,S=v.length;y<S;++y)g(v[y]),u=d.lineHeight;R(x.after,g)}f=0,u=d.lineHeight,R(this.afterBody,g),t.y-=o}drawFooter(t,e,i){const n=this.footer,o=n.length;let r,a;if(o){const l=qt(i.rtl,this.x,this.width);for(t.x=as(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=l.textAlign(i.footerAlign),e.textBaseline="middle",r=$(i.footerFont),e.fillStyle=i.footerColor,e.font=r.string,a=0;a<o;++a)e.fillText(n[a],l.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+i.footerSpacing}}drawBackground(t,e,i,n){const{xAlign:o,yAlign:r}=this,{x:a,y:l}=t,{width:h,height:c}=i,{topLeft:d,topRight:u,bottomLeft:f,bottomRight:p}=It(n.cornerRadius);e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.beginPath(),e.moveTo(a+d,l),r==="top"&&this.drawCaret(t,e,i,n),e.lineTo(a+h-u,l),e.quadraticCurveTo(a+h,l,a+h,l+u),r==="center"&&o==="right"&&this.drawCaret(t,e,i,n),e.lineTo(a+h,l+c-p),e.quadraticCurveTo(a+h,l+c,a+h-p,l+c),r==="bottom"&&this.drawCaret(t,e,i,n),e.lineTo(a+f,l+c),e.quadraticCurveTo(a,l+c,a,l+c-f),r==="center"&&o==="left"&&this.drawCaret(t,e,i,n),e.lineTo(a,l+d),e.quadraticCurveTo(a,l,a+d,l),e.closePath(),e.fill(),n.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,n=i&&i.x,o=i&&i.y;if(n||o){const r=Me[t.position].call(this,this._active,this._eventPosition);if(!r)return;const a=this._size=uo(this,t),l=Object.assign({},r,this._size),h=fo(e,t,l),c=go(t,l,h,e);(n._to!==c.x||o._to!==c.y)&&(this.xAlign=h.xAlign,this.yAlign=h.yAlign,this.width=a.width,this.height=a.height,this.caretX=r.x,this.caretY=r.y,this._resolveAnimations().update(this,c))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const n={width:this.width,height:this.height},o={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const r=U(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=i,this.drawBackground(o,t,n,e),qi(t,e.textDirection),o.y+=r.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),Gi(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,n=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}}),o=!Re(i,n),r=this._positionChanged(n,e);(o||r)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,o=this._active||[],r=this._getActiveElements(t,o,e,i),a=this._positionChanged(r,t),l=e||!Re(r,o)||a;return l&&(this._active=r,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,i,n){const o=this.options;if(t.type==="mouseout")return[];if(!n)return e.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const r=this.chart.getElementsAtEventForMode(t,o.mode,o,i);return o.reverse&&r.reverse(),r}_positionChanged(t,e){const{caretX:i,caretY:n,options:o}=this,r=Me[o.position].call(this,t,e);return r!==!1&&(i!==r.x||n!==r.y)}}M(Qs,"positioners",Me);var yc={id:"tooltip",_element:Qs,positioners:Me,afterInit(s,t,e){e&&(s.tooltip=new Qs({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:xo},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"]},vc=Object.freeze({__proto__:null,Colors:Eh,Decimation:Fh,Filler:ic,Legend:hc,SubTitle:uc,Title:dc,Tooltip:yc});const Mc=(s,t,e,i)=>(typeof t=="string"?(e=s.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function wc(s,t,e,i){const n=s.indexOf(t);if(n===-1)return Mc(s,t,e,i);const o=s.lastIndexOf(t);return n!==o?e:n}const kc=(s,t)=>s===null?null:Y(Math.round(s),0,t);function bo(s){const t=this.getLabels();return s>=0&&s<t.length?t[s]:s}class ti extends Ht{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const i=this.getLabels();for(const{index:n,label:o}of e)i[n]===o&&i.splice(n,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(O(t))return null;const i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:wc(i,t,D(e,t),this._addedLabels),kc(e,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:n}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),e||(n=this.getLabels().length-1)),this.min=i,this.max=n}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,n=[];let o=this.getLabels();o=t===0&&e===o.length-1?o:o.slice(t,e+1),this._valueRange=Math.max(o.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let r=t;r<=e;r++)n.push({value:r});return n}getLabelForValue(t){return bo.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}}M(ti,"id","category"),M(ti,"defaults",{ticks:{callback:bo}});function Sc(s,t){const e=[],{bounds:i,step:n,min:o,max:r,precision:a,count:l,maxTicks:h,maxDigits:c,includeBounds:d}=s,u=n||1,f=h-1,{min:p,max:g}=t,m=!O(o),x=!O(r),_=!O(l),v=(g-p)/(c+1);let b=yi((g-p)/f/u)*u,y,w,S,k;if(b<1e-14&&!m&&!x)return[{value:p},{value:g}];k=Math.ceil(g/b)-Math.floor(p/b),k>f&&(b=yi(k*b/f/u)*u),O(a)||(y=Math.pow(10,a),b=Math.ceil(b*y)/y),i==="ticks"?(w=Math.floor(p/b)*b,S=Math.ceil(g/b)*b):(w=p,S=g),m&&x&&n&&_r((r-o)/n,b/1e3)?(k=Math.round(Math.min((r-o)/b,h)),b=(r-o)/k,w=o,S=r):_?(w=m?o:w,S=x?r:S,k=l-1,b=(S-w)/k):(k=(S-w)/b,oe(k,Math.round(k),b/1e3)?k=Math.round(k):k=Math.ceil(k));const C=Math.max(Mi(b),Mi(w));y=Math.pow(10,O(a)?C:a),w=Math.round(w*y)/y,S=Math.round(S*y)/y;let P=0;for(m&&(d&&w!==o?(e.push({value:o}),w<o&&P++,oe(Math.round((w+P*b)*y)/y,o,_o(o,v,s))&&P++):w<o&&P++);P<k;++P){const L=Math.round((w+P*b)*y)/y;if(x&&L>r)break;e.push({value:L})}return x&&d&&S!==r?e.length&&oe(e[e.length-1].value,r,_o(r,v,s))?e[e.length-1].value=r:e.push({value:r}):(!x||S===r)&&e.push({value:S}),e}function _o(s,t,{horizontal:e,minRotation:i}){const n=rt(i),o=(e?Math.sin(n):Math.cos(n))||.001,r=.75*t*(""+s).length;return Math.min(t/o,r)}class ls extends Ht{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 O(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:n,max:o}=this;const r=l=>n=e?n:l,a=l=>o=i?o:l;if(t){const l=ct(n),h=ct(o);l<0&&h<0?a(0):l>0&&h>0&&r(0)}if(n===o){let l=o===0?1:Math.abs(o*.05);a(o+l),t||r(n-l)}this.min=n,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:i}=t,n;return i?(n=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,n>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${n} ticks. Limiting to 1000.`),n=1e3)):(n=this.computeTickLimit(),e=e||11),e&&(n=Math.min(e,n)),n}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const n={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},o=this._range||this,r=Sc(n,o);return t.bounds==="ticks"&&vi(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const n=(i-e)/Math.max(t.length-1,1)/2;e-=n,i+=n}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return le(t,this.chart.options.locale,this.options.ticks.format)}}class ei extends ls{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=H(t)?t:0,this.max=H(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=rt(this.options.ticks.minRotation),n=(t?Math.sin(i):Math.cos(i))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/n))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}M(ei,"id","linear"),M(ei,"defaults",{ticks:{callback:Ve.formatters.numeric}});const we=s=>Math.floor(Pt(s)),Nt=(s,t)=>Math.pow(10,we(s)+t);function yo(s){return s/Math.pow(10,we(s))===1}function vo(s,t,e){const i=Math.pow(10,e),n=Math.floor(s/i);return Math.ceil(t/i)-n}function Pc(s,t){const e=t-s;let i=we(e);for(;vo(s,t,i)>10;)i++;for(;vo(s,t,i)<10;)i--;return Math.min(i,we(s))}function Dc(s,{min:t,max:e}){t=st(s.min,t);const i=[],n=we(t);let o=Pc(t,e),r=o<0?Math.pow(10,Math.abs(o)):1;const a=Math.pow(10,o),l=n>o?Math.pow(10,n):0,h=Math.round((t-l)*r)/r,c=Math.floor((t-l)/a/10)*a*10;let d=Math.floor((h-c)/Math.pow(10,o)),u=st(s.min,Math.round((l+c+d*Math.pow(10,o))*r)/r);for(;u<e;)i.push({value:u,major:yo(u),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(o++,d=2,r=o>=0?1:r),u=Math.round((l+c+d*Math.pow(10,o))*r)/r;const f=st(s.max,u);return i.push({value:f,major:yo(f),significand:d}),i}class si extends Ht{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=ls.prototype.parse.apply(this,[t,e]);if(i===0){this._zero=!0;return}return H(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=H(t)?Math.max(0,t):null,this.max=H(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!H(this._userMin)&&(this.min=t===Nt(this.min,0)?Nt(this.min,-1):Nt(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,n=this.max;const o=a=>i=t?i:a,r=a=>n=e?n:a;i===n&&(i<=0?(o(1),r(10)):(o(Nt(i,-1)),r(Nt(n,1)))),i<=0&&o(Nt(n,-1)),n<=0&&r(Nt(i,1)),this.min=i,this.max=n}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},i=Dc(e,this);return t.bounds==="ticks"&&vi(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return t===void 0?"0":le(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Pt(t),this._valueRange=Pt(this.max)-Pt(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Pt(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}M(si,"id","logarithmic"),M(si,"defaults",{ticks:{callback:Ve.formatters.logarithmic,major:{enabled:!0}}});function ii(s){const t=s.ticks;if(t.display&&s.display){const e=U(t.backdropPadding);return D(t.font&&t.font.size,N.font.size)+e.height}return 0}function Cc(s,t,e){return e=z(e)?e:[e],{w:zr(s,t.string,e),h:e.length*t.lineHeight}}function Mo(s,t,e,i,n){return s===i||s===n?{start:t-e/2,end:t+e/2}:s<i||s>n?{start:t-e,end:t}:{start:t,end:t+e}}function Oc(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),i=[],n=[],o=s._pointLabels.length,r=s.options.pointLabels,a=r.centerPointLabels?F/o:0;for(let l=0;l<o;l++){const h=r.setContext(s.getPointLabelContext(l));n[l]=h.padding;const c=s.getPointPosition(l,s.drawingArea+n[l],a),d=$(h.font),u=Cc(s.ctx,d,s._pointLabels[l]);i[l]=u;const f=it(s.getIndexAngle(l)+a),p=Math.round(vs(f)),g=Mo(p,c.x,u.w,0,180),m=Mo(p,c.y,u.h,90,270);Ac(e,t,f,g,m)}s.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),s._pointLabelItems=Ec(s,i,n)}function Ac(s,t,e,i,n){const o=Math.abs(Math.sin(e)),r=Math.abs(Math.cos(e));let a=0,l=0;i.start<t.l?(a=(t.l-i.start)/o,s.l=Math.min(s.l,t.l-a)):i.end>t.r&&(a=(i.end-t.r)/o,s.r=Math.max(s.r,t.r+a)),n.start<t.t?(l=(t.t-n.start)/r,s.t=Math.min(s.t,t.t-l)):n.end>t.b&&(l=(n.end-t.b)/r,s.b=Math.max(s.b,t.b+l))}function Tc(s,t,e){const i=s.drawingArea,{extra:n,additionalAngle:o,padding:r,size:a}=e,l=s.getPointPosition(t,i+n+r,o),h=Math.round(vs(it(l.angle+j))),c=zc(l.y,a.h,h),d=Rc(h),u=Ic(l.x,a.w,d);return{visible:!0,x:l.x,y:c,textAlign:d,left:u,top:c,right:u+a.w,bottom:c+a.h}}function Lc(s,t){if(!t)return!0;const{left:e,top:i,right:n,bottom:o}=s;return!(xt({x:e,y:i},t)||xt({x:e,y:o},t)||xt({x:n,y:i},t)||xt({x:n,y:o},t))}function Ec(s,t,e){const i=[],n=s._pointLabels.length,o=s.options,{centerPointLabels:r,display:a}=o.pointLabels,l={extra:ii(o)/2,additionalAngle:r?F/n:0};let h;for(let c=0;c<n;c++){l.padding=e[c],l.size=t[c];const d=Tc(s,c,l);i.push(d),a==="auto"&&(d.visible=Lc(d,h),d.visible&&(h=d))}return i}function Rc(s){return s===0||s===180?"center":s<180?"left":"right"}function Ic(s,t,e){return e==="right"?s-=t:e==="center"&&(s-=t/2),s}function zc(s,t,e){return e===90||e===270?s-=t/2:(e>270||e<90)&&(s-=t),s}function Fc(s,t,e){const{left:i,top:n,right:o,bottom:r}=e,{backdropColor:a}=t;if(!O(a)){const l=It(t.borderRadius),h=U(t.backdropPadding);s.fillStyle=a;const c=i-h.left,d=n-h.top,u=o-i+h.width,f=r-n+h.height;Object.values(l).some(p=>p!==0)?(s.beginPath(),ce(s,{x:c,y:d,w:u,h:f,radius:l}),s.fill()):s.fillRect(c,d,u,f)}}function Vc(s,t){const{ctx:e,options:{pointLabels:i}}=s;for(let n=t-1;n>=0;n--){const o=s._pointLabelItems[n];if(!o.visible)continue;const r=i.setContext(s.getPointLabelContext(n));Fc(e,r,o);const a=$(r.font),{x:l,y:h,textAlign:c}=o;Rt(e,s._pointLabels[n],l,h+a.lineHeight/2,a,{color:r.color,textAlign:c,textBaseline:"middle"})}}function wo(s,t,e,i){const{ctx:n}=s;if(e)n.arc(s.xCenter,s.yCenter,t,0,V);else{let o=s.getPointPosition(0,t);n.moveTo(o.x,o.y);for(let r=1;r<i;r++)o=s.getPointPosition(r,t),n.lineTo(o.x,o.y)}}function Bc(s,t,e,i,n){const o=s.ctx,r=t.circular,{color:a,lineWidth:l}=t;!r&&!i||!a||!l||e<0||(o.save(),o.strokeStyle=a,o.lineWidth=l,o.setLineDash(n.dash),o.lineDashOffset=n.dashOffset,o.beginPath(),wo(s,e,r,i),o.closePath(),o.stroke(),o.restore())}function Wc(s,t,e){return Dt(s,{label:e,index:t,type:"pointLabel"})}class ke extends ls{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=U(ii(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=H(t)&&!isNaN(t)?t:0,this.max=H(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/ii(this.options))}generateTickLabels(t){ls.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,i)=>{const n=I(this.options.pointLabels.callback,[e,i],this);return n||n===0?n:""}).filter((e,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?Oc(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,n){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-n)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,n))}getIndexAngle(t){const e=V/(this._pointLabels.length||1),i=this.options.startAngle||0;return it(t*e+rt(i))}getDistanceFromCenterForValue(t){if(O(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(O(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const i=e[t];return Wc(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const n=this.getIndexAngle(t)-j+i;return{x:Math.cos(n)*e+this.xCenter,y:Math.sin(n)*e+this.yCenter,angle:n}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:i,right:n,bottom:o}=this._pointLabelItems[t];return{left:e,top:i,right:n,bottom:o}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),wo(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:i,grid:n,border:o}=e,r=this._pointLabels.length;let a,l,h;if(e.pointLabels.display&&Vc(this,r),n.display&&this.ticks.forEach((c,d)=>{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(c.value);const u=this.getContext(d),f=n.setContext(u),p=o.setContext(u);Bc(this,f,l,r,p)}}),i.display){for(t.save(),a=r-1;a>=0;a--){const c=i.setContext(this.getPointLabelContext(a)),{color:d,lineWidth:u}=c;!u||!d||(t.lineWidth=u,t.strokeStyle=d,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,i=e.ticks;if(!i.display)return;const n=this.getIndexAngle(0);let o,r;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(n),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!e.reverse)return;const h=i.setContext(this.getContext(l)),c=$(h.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),h.showLabelBackdrop){t.font=c.string,r=t.measureText(a.label).width,t.fillStyle=h.backdropColor;const d=U(h.backdropPadding);t.fillRect(-r/2-d.left,-o-c.size/2-d.top,r+d.width,c.size+d.height)}Rt(t,a.label,0,-o,c,{color:h.color,strokeColor:h.textStrokeColor,strokeWidth:h.textStrokeWidth})}),t.restore()}drawTitle(){}}M(ke,"id","radialLinear"),M(ke,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Ve.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),M(ke,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),M(ke,"descriptors",{angleLines:{_fallback:"grid"}});const hs={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}},Z=Object.keys(hs);function ko(s,t){return s-t}function So(s,t){if(O(t))return null;const e=s._adapter,{parser:i,round:n,isoWeekday:o}=s._parseOpts;let r=t;return typeof i=="function"&&(r=i(r)),H(r)||(r=typeof i=="string"?e.parse(r,i):e.parse(r)),r===null?null:(n&&(r=n==="week"&&(Ut(o)||o===!0)?e.startOf(r,"isoWeek",o):e.startOf(r,n)),+r)}function Po(s,t,e,i){const n=Z.length;for(let o=Z.indexOf(s);o<n-1;++o){const r=hs[Z[o]],a=r.steps?r.steps:Number.MAX_SAFE_INTEGER;if(r.common&&Math.ceil((e-t)/(a*r.size))<=i)return Z[o]}return Z[n-1]}function Nc(s,t,e,i,n){for(let o=Z.length-1;o>=Z.indexOf(e);o--){const r=Z[o];if(hs[r].common&&s._adapter.diff(n,i,r)>=t-1)return r}return Z[e?Z.indexOf(e):0]}function Hc(s){for(let t=Z.indexOf(s)+1,e=Z.length;t<e;++t)if(hs[Z[t]].common)return Z[t]}function Do(s,t,e){if(!e)s[t]=!0;else if(e.length){const{lo:i,hi:n}=ws(e,t),o=e[i]>=t?e[i]:e[n];s[o]=!0}}function jc(s,t,e,i){const n=s._adapter,o=+n.startOf(t[0].value,i),r=t[t.length-1].value;let a,l;for(a=o;a<=r;a=+n.add(a,1,i))l=e[a],l>=0&&(t[l].major=!0);return t}function Co(s,t,e){const i=[],n={},o=t.length;let r,a;for(r=0;r<o;++r)a=t[r],n[a]=r,i.push({value:a,major:!1});return o===0||!e?i:jc(s,i,n,e)}class Se extends Ht{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const i=t.time||(t.time={}),n=this._adapter=new Ja._date(t.adapters.date);n.init(e),ie(i.displayFormats,n.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:So(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:n,max:o,minDefined:r,maxDefined:a}=this.getUserBounds();function l(h){!r&&!isNaN(h.min)&&(n=Math.min(n,h.min)),!a&&!isNaN(h.max)&&(o=Math.max(o,h.max))}(!r||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),n=H(n)&&!isNaN(n)?n:+e.startOf(Date.now(),i),o=H(o)&&!isNaN(o)?o:+e.endOf(Date.now(),i)+1,this.min=Math.min(n,o-1),this.max=Math.max(n+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,n=i.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&n.length&&(this.min=this._userMin||n[0],this.max=this._userMax||n[n.length-1]);const o=this.min,r=this.max,a=wr(n,o,r);return this._unit=e.unit||(i.autoSkip?Po(e.minUnit,this.min,this.max,this._getLabelCapacity(o)):Nc(this,a.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:Hc(this._unit),this.initOffsets(n),t.reverse&&a.reverse(),Co(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,i=0,n,o;this.options.offset&&t.length&&(n=this.getDecimalForValue(t[0]),t.length===1?e=1-n:e=(this.getDecimalForValue(t[1])-n)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?i=o:i=(o-this.getDecimalForValue(t[t.length-2]))/2);const r=t.length<3?.5:.25;e=Y(e,0,r),i=Y(i,0,r),this._offsets={start:e,end:i,factor:1/(e+1+i)}}_generate(){const t=this._adapter,e=this.min,i=this.max,n=this.options,o=n.time,r=o.unit||Po(o.minUnit,e,i,this._getLabelCapacity(e)),a=D(n.ticks.stepSize,1),l=r==="week"?o.isoWeekday:!1,h=Ut(l)||l===!0,c={};let d=e,u,f;if(h&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,h?"day":r),t.diff(i,e,r)>1e5*a)throw new Error(e+" and "+i+" are too far apart with stepSize of "+a+" "+r);const p=n.ticks.source==="data"&&this.getDataTimestamps();for(u=d,f=0;u<i;u=+t.add(u,a,r),f++)Do(c,u,p);return(u===i||n.bounds==="ticks"||f===1)&&Do(c,u,p),Object.keys(c).sort(ko).map(g=>+g)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const i=this.options.time.displayFormats,n=this._unit,o=e||i[n];return this._adapter.format(t,o)}_tickFormatFunction(t,e,i,n){const o=this.options,r=o.ticks.callback;if(r)return I(r,[t,e,i],this);const a=o.time.displayFormats,l=this._unit,h=this._majorUnit,c=l&&a[l],d=h&&a[h],u=i[e],f=h&&d&&u&&u.major;return this._adapter.format(t,n||(f?d:c))}generateTickLabels(t){let e,i,n;for(e=0,i=t.length;e<i;++e)n=t[e],n.label=this._tickFormatFunction(n.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,i=this.ctx.measureText(t).width,n=rt(this.isHorizontal()?e.maxRotation:e.minRotation),o=Math.cos(n),r=Math.sin(n),a=this._resolveTickFontOptions(0).size;return{w:i*o+a*r,h:i*r+a*o}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,n=i[e.unit]||i.millisecond,o=this._tickFormatFunction(t,0,Co(this,[t],this._majorUnit),n),r=this._getLabelSize(o),a=Math.floor(this.isHorizontal()?this.width/r.w:this.height/r.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],e,i;if(t.length)return t;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(e=0,i=n.length;e<i;++e)t=t.concat(n[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;const n=this.getLabels();for(e=0,i=n.length;e<i;++e)t.push(So(this,n[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Pi(t.sort(ko))}}M(Se,"id","time"),M(Se,"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 cs(s,t,e){let i=0,n=s.length-1,o,r,a,l;e?(t>=s[i].pos&&t<=s[n].pos&&({lo:i,hi:n}=mt(s,"pos",t)),{pos:o,time:a}=s[i],{pos:r,time:l}=s[n]):(t>=s[i].time&&t<=s[n].time&&({lo:i,hi:n}=mt(s,"time",t)),{time:o,pos:a}=s[i],{time:r,pos:l}=s[n]);const h=r-o;return h?a+(l-a)*(t-o)/h:a}class ni extends Se{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=cs(e,this.min),this._tableRange=cs(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,n=[],o=[];let r,a,l,h,c;for(r=0,a=t.length;r<a;++r)h=t[r],h>=e&&h<=i&&n.push(h);if(n.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(r=0,a=n.length;r<a;++r)c=n[r+1],l=n[r-1],h=n[r],Math.round((c+l)/2)!==h&&o.push({time:h,pos:r/(a-1)});return o}_generate(){const t=this.min,e=this.max;let i=super.getDataTimestamps();return(!i.includes(t)||!i.length)&&i.splice(0,0,t),(!i.includes(e)||i.length===1)&&i.push(e),i.sort((n,o)=>n-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return e.length&&i.length?t=this.normalize(e.concat(i)):t=e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(cs(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return cs(this._table,i*this._tableRange+this._minPos,!0)}}M(ni,"id","timeseries"),M(ni,"defaults",Se.defaults);var $c=Object.freeze({__proto__:null,CategoryScale:ti,LinearScale:ei,LogarithmicScale:si,RadialLinearScale:ke,TimeScale:Se,TimeSeriesScale:ni});const Yc=[Za,Dh,vc,$c];_t.register(...Yc);/*!
|
|
19
|
+
* chartjs-plugin-datalabels v2.2.0
|
|
20
|
+
* https://chartjs-plugin-datalabels.netlify.app
|
|
21
|
+
* (c) 2017-2022 chartjs-plugin-datalabels contributors
|
|
22
|
+
* Released under the MIT license
|
|
23
|
+
*/var Oo=function(){if(typeof window<"u"){if(window.devicePixelRatio)return window.devicePixelRatio;var s=window.screen;if(s)return(s.deviceXDPI||1)/(s.logicalXDPI||1)}return 1}(),Pe={toTextLines:function(s){var t=[],e;for(s=[].concat(s);s.length;)e=s.pop(),typeof e=="string"?t.unshift.apply(t,e.split(`
|
|
24
|
+
`)):Array.isArray(e)?s.push.apply(s,e):O(s)||t.unshift(""+e);return t},textSize:function(s,t,e){var i=[].concat(t),n=i.length,o=s.font,r=0,a;for(s.font=e.string,a=0;a<n;++a)r=Math.max(s.measureText(i[a]).width,r);return s.font=o,{height:n*e.lineHeight,width:r}},bound:function(s,t,e){return Math.max(s,Math.min(t,e))},arrayDiff:function(s,t){var e=s.slice(),i=[],n,o,r,a;for(n=0,r=t.length;n<r;++n)a=t[n],o=e.indexOf(a),o===-1?i.push([a,1]):e.splice(o,1);for(n=0,r=e.length;n<r;++n)i.push([e[n],-1]);return i},rasterize:function(s){return Math.round(s*Oo)/Oo}};function oi(s,t){var e=t.x,i=t.y;if(e===null)return{x:0,y:-1};if(i===null)return{x:1,y:0};var n=s.x-e,o=s.y-i,r=Math.sqrt(n*n+o*o);return{x:r?n/r:0,y:r?o/r:-1}}function Uc(s,t,e,i,n){switch(n){case"center":e=i=0;break;case"bottom":e=0,i=1;break;case"right":e=1,i=0;break;case"left":e=-1,i=0;break;case"top":e=0,i=-1;break;case"start":e=-e,i=-i;break;case"end":break;default:n*=Math.PI/180,e=Math.cos(n),i=Math.sin(n);break}return{x:s,y:t,vx:e,vy:i}}var Xc=0,Ao=1,To=2,Lo=4,Eo=8;function ds(s,t,e){var i=Xc;return s<e.left?i|=Ao:s>e.right&&(i|=To),t<e.top?i|=Eo:t>e.bottom&&(i|=Lo),i}function Kc(s,t){for(var e=s.x0,i=s.y0,n=s.x1,o=s.y1,r=ds(e,i,t),a=ds(n,o,t),l,h,c;!(!(r|a)||r&a);)l=r||a,l&Eo?(h=e+(n-e)*(t.top-i)/(o-i),c=t.top):l&Lo?(h=e+(n-e)*(t.bottom-i)/(o-i),c=t.bottom):l&To?(c=i+(o-i)*(t.right-e)/(n-e),h=t.right):l&Ao&&(c=i+(o-i)*(t.left-e)/(n-e),h=t.left),l===r?(e=h,i=c,r=ds(e,i,t)):(n=h,o=c,a=ds(n,o,t));return{x0:e,x1:n,y0:i,y1:o}}function us(s,t){var e=t.anchor,i=s,n,o;return t.clamp&&(i=Kc(i,t.area)),e==="start"?(n=i.x0,o=i.y0):e==="end"?(n=i.x1,o=i.y1):(n=(i.x0+i.x1)/2,o=(i.y0+i.y1)/2),Uc(n,o,s.vx,s.vy,t.align)}var fs={arc:function(s,t){var e=(s.startAngle+s.endAngle)/2,i=Math.cos(e),n=Math.sin(e),o=s.innerRadius,r=s.outerRadius;return us({x0:s.x+i*o,y0:s.y+n*o,x1:s.x+i*r,y1:s.y+n*r,vx:i,vy:n},t)},point:function(s,t){var e=oi(s,t.origin),i=e.x*s.options.radius,n=e.y*s.options.radius;return us({x0:s.x-i,y0:s.y-n,x1:s.x+i,y1:s.y+n,vx:e.x,vy:e.y},t)},bar:function(s,t){var e=oi(s,t.origin),i=s.x,n=s.y,o=0,r=0;return s.horizontal?(i=Math.min(s.x,s.base),o=Math.abs(s.base-s.x)):(n=Math.min(s.y,s.base),r=Math.abs(s.base-s.y)),us({x0:i,y0:n+r,x1:i+o,y1:n,vx:e.x,vy:e.y},t)},fallback:function(s,t){var e=oi(s,t.origin);return us({x0:s.x,y0:s.y,x1:s.x+(s.width||0),y1:s.y+(s.height||0),vx:e.x,vy:e.y},t)}},vt=Pe.rasterize;function qc(s){var t=s.borderWidth||0,e=s.padding,i=s.size.height,n=s.size.width,o=-n/2,r=-i/2;return{frame:{x:o-e.left-t,y:r-e.top-t,w:n+e.width+t*2,h:i+e.height+t*2},text:{x:o,y:r,w:n,h:i}}}function Gc(s,t){var e=t.chart.getDatasetMeta(t.datasetIndex).vScale;if(!e)return null;if(e.xCenter!==void 0&&e.yCenter!==void 0)return{x:e.xCenter,y:e.yCenter};var i=e.getBasePixel();return s.horizontal?{x:i,y:null}:{x:null,y:i}}function Zc(s){return s instanceof Zt?fs.arc:s instanceof ye?fs.point:s instanceof ve?fs.bar:fs.fallback}function Jc(s,t,e,i,n,o){var r=Math.PI/2;if(o){var a=Math.min(o,n/2,i/2),l=t+a,h=e+a,c=t+i-a,d=e+n-a;s.moveTo(t,h),l<c&&h<d?(s.arc(l,h,a,-Math.PI,-r),s.arc(c,h,a,-r,0),s.arc(c,d,a,0,r),s.arc(l,d,a,r,Math.PI)):l<c?(s.moveTo(l,e),s.arc(c,h,a,-r,r),s.arc(l,h,a,r,Math.PI+r)):h<d?(s.arc(l,h,a,-Math.PI,0),s.arc(l,d,a,0,Math.PI)):s.arc(l,h,a,-Math.PI,Math.PI),s.closePath(),s.moveTo(t,e)}else s.rect(t,e,i,n)}function Qc(s,t,e){var i=e.backgroundColor,n=e.borderColor,o=e.borderWidth;!i&&(!n||!o)||(s.beginPath(),Jc(s,vt(t.x)+o/2,vt(t.y)+o/2,vt(t.w)-o,vt(t.h)-o,e.borderRadius),s.closePath(),i&&(s.fillStyle=i,s.fill()),n&&o&&(s.strokeStyle=n,s.lineWidth=o,s.lineJoin="miter",s.stroke()))}function td(s,t,e){var i=e.lineHeight,n=s.w,o=s.x,r=s.y+i/2;return t==="center"?o+=n/2:(t==="end"||t==="right")&&(o+=n),{h:i,w:n,x:o,y:r}}function ed(s,t,e){var i=s.shadowBlur,n=e.stroked,o=vt(e.x),r=vt(e.y),a=vt(e.w);n&&s.strokeText(t,o,r,a),e.filled&&(i&&n&&(s.shadowBlur=0),s.fillText(t,o,r,a),i&&n&&(s.shadowBlur=i))}function sd(s,t,e,i){var n=i.textAlign,o=i.color,r=!!o,a=i.font,l=t.length,h=i.textStrokeColor,c=i.textStrokeWidth,d=h&&c,u;if(!(!l||!r&&!d))for(e=td(e,n,a),s.font=a.string,s.textAlign=n,s.textBaseline="middle",s.shadowBlur=i.textShadowBlur,s.shadowColor=i.textShadowColor,r&&(s.fillStyle=o),d&&(s.lineJoin="round",s.lineWidth=c,s.strokeStyle=h),u=0,l=t.length;u<l;++u)ed(s,t[u],{stroked:d,filled:r,w:e.w,x:e.x,y:e.y+e.h*u})}var Ro=function(s,t,e,i){var n=this;n._config=s,n._index=i,n._model=null,n._rects=null,n._ctx=t,n._el=e};ht(Ro.prototype,{_modelize:function(s,t,e,i){var n=this,o=n._index,r=$(B([e.font,{}],i,o)),a=B([e.color,N.color],i,o);return{align:B([e.align,"center"],i,o),anchor:B([e.anchor,"center"],i,o),area:i.chart.chartArea,backgroundColor:B([e.backgroundColor,null],i,o),borderColor:B([e.borderColor,null],i,o),borderRadius:B([e.borderRadius,0],i,o),borderWidth:B([e.borderWidth,0],i,o),clamp:B([e.clamp,!1],i,o),clip:B([e.clip,!1],i,o),color:a,display:s,font:r,lines:t,offset:B([e.offset,4],i,o),opacity:B([e.opacity,1],i,o),origin:Gc(n._el,i),padding:U(B([e.padding,4],i,o)),positioner:Zc(n._el),rotation:B([e.rotation,0],i,o)*(Math.PI/180),size:Pe.textSize(n._ctx,t,r),textAlign:B([e.textAlign,"start"],i,o),textShadowBlur:B([e.textShadowBlur,0],i,o),textShadowColor:B([e.textShadowColor,a],i,o),textStrokeColor:B([e.textStrokeColor,a],i,o),textStrokeWidth:B([e.textStrokeWidth,0],i,o)}},update:function(s){var t=this,e=null,i=null,n=t._index,o=t._config,r,a,l,h=B([o.display,!0],s,n);h&&(r=s.dataset.data[n],a=D(I(o.formatter,[r,s]),r),l=O(a)?[]:Pe.toTextLines(a),l.length&&(e=t._modelize(h,l,o,s),i=qc(e))),t._model=e,t._rects=i},geometry:function(){return this._rects?this._rects.frame:{}},rotation:function(){return this._model?this._model.rotation:0},visible:function(){return this._model&&this._model.opacity},model:function(){return this._model},draw:function(s,t){var e=this,i=s.ctx,n=e._model,o=e._rects,r;this.visible()&&(i.save(),n.clip&&(r=n.area,i.beginPath(),i.rect(r.left,r.top,r.right-r.left,r.bottom-r.top),i.clip()),i.globalAlpha=Pe.bound(0,n.opacity,1),i.translate(vt(t.x),vt(t.y)),i.rotate(n.rotation),Qc(i,o.frame,n),sd(i,n.lines,o.text,n),i.restore())}});var id=Number.MIN_SAFE_INTEGER||-9007199254740991,nd=Number.MAX_SAFE_INTEGER||9007199254740991;function De(s,t,e){var i=Math.cos(e),n=Math.sin(e),o=t.x,r=t.y;return{x:o+i*(s.x-o)-n*(s.y-r),y:r+n*(s.x-o)+i*(s.y-r)}}function Io(s,t){var e=nd,i=id,n=t.origin,o,r,a,l,h;for(o=0;o<s.length;++o)r=s[o],a=r.x-n.x,l=r.y-n.y,h=t.vx*a+t.vy*l,e=Math.min(e,h),i=Math.max(i,h);return{min:e,max:i}}function gs(s,t){var e=t.x-s.x,i=t.y-s.y,n=Math.sqrt(e*e+i*i);return{vx:(t.x-s.x)/n,vy:(t.y-s.y)/n,origin:s,ln:n}}var zo=function(){this._rotation=0,this._rect={x:0,y:0,w:0,h:0}};ht(zo.prototype,{center:function(){var s=this._rect;return{x:s.x+s.w/2,y:s.y+s.h/2}},update:function(s,t,e){this._rotation=e,this._rect={x:t.x+s.x,y:t.y+s.y,w:t.w,h:t.h}},contains:function(s){var t=this,e=1,i=t._rect;return s=De(s,t.center(),-t._rotation),!(s.x<i.x-e||s.y<i.y-e||s.x>i.x+i.w+e*2||s.y>i.y+i.h+e*2)},intersects:function(s){var t=this._points(),e=s._points(),i=[gs(t[0],t[1]),gs(t[0],t[3])],n,o,r;for(this._rotation!==s._rotation&&i.push(gs(e[0],e[1]),gs(e[0],e[3])),n=0;n<i.length;++n)if(o=Io(t,i[n]),r=Io(e,i[n]),o.max<r.min||r.max<o.min)return!1;return!0},_points:function(){var s=this,t=s._rect,e=s._rotation,i=s.center();return[De({x:t.x,y:t.y},i,e),De({x:t.x+t.w,y:t.y},i,e),De({x:t.x+t.w,y:t.y+t.h},i,e),De({x:t.x,y:t.y+t.h},i,e)]}});function Fo(s,t,e){var i=t.positioner(s,t),n=i.vx,o=i.vy;if(!n&&!o)return{x:i.x,y:i.y};var r=e.w,a=e.h,l=t.rotation,h=Math.abs(r/2*Math.cos(l))+Math.abs(a/2*Math.sin(l)),c=Math.abs(r/2*Math.sin(l))+Math.abs(a/2*Math.cos(l)),d=1/Math.max(Math.abs(n),Math.abs(o));return h*=n*d,c*=o*d,h+=t.offset*n,c+=t.offset*o,{x:i.x+h,y:i.y+c}}function od(s,t){var e,i,n,o;for(e=s.length-1;e>=0;--e)for(n=s[e].$layout,i=e-1;i>=0&&n._visible;--i)o=s[i].$layout,o._visible&&n._box.intersects(o._box)&&t(n,o);return s}function rd(s){var t,e,i,n,o,r,a;for(t=0,e=s.length;t<e;++t)i=s[t],n=i.$layout,n._visible&&(a=new Proxy(i._el,{get:(l,h)=>l.getProps([h],!0)[h]}),o=i.geometry(),r=Fo(a,i.model(),o),n._box.update(r,o,i.rotation()));return od(s,function(l,h){var c=l._hidable,d=h._hidable;c&&d||d?h._visible=!1:c&&(l._visible=!1)})}var Ce={prepare:function(s){var t=[],e,i,n,o,r;for(e=0,n=s.length;e<n;++e)for(i=0,o=s[e].length;i<o;++i)r=s[e][i],t.push(r),r.$layout={_box:new zo,_hidable:!1,_visible:!0,_set:e,_idx:r._index};return t.sort(function(a,l){var h=a.$layout,c=l.$layout;return h._idx===c._idx?c._set-h._set:c._idx-h._idx}),this.update(t),t},update:function(s){var t=!1,e,i,n,o,r;for(e=0,i=s.length;e<i;++e)n=s[e],o=n.model(),r=n.$layout,r._hidable=o&&o.display==="auto",r._visible=n.visible(),t|=r._hidable;t&&rd(s)},lookup:function(s,t){var e,i;for(e=s.length-1;e>=0;--e)if(i=s[e].$layout,i&&i._visible&&i._box.contains(t))return s[e];return null},draw:function(s,t){var e,i,n,o,r,a;for(e=0,i=t.length;e<i;++e)n=t[e],o=n.$layout,o._visible&&(r=n.geometry(),a=Fo(n._el,n.model(),r),o._box.update(a,r,n.rotation()),n.draw(s,a))}},ad=function(s){if(O(s))return null;var t=s,e,i,n;if(T(s))if(!O(s.label))t=s.label;else if(!O(s.r))t=s.r;else for(t="",e=Object.keys(s),n=0,i=e.length;n<i;++n)t+=(n!==0?", ":"")+e[n]+": "+s[e[n]];return""+t},ld={align:"center",anchor:"center",backgroundColor:null,borderColor:null,borderRadius:0,borderWidth:0,clamp:!1,clip:!1,color:void 0,display:!0,font:{family:void 0,lineHeight:1.2,size:void 0,style:void 0,weight:null},formatter:ad,labels:void 0,listeners:{},offset:4,opacity:1,padding:{top:4,right:4,bottom:4,left:4},rotation:0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,textShadowBlur:0,textShadowColor:void 0},J="$datalabels",Vo="$default";function hd(s,t){var e=s.datalabels,i={},n=[],o,r;return e===!1?null:(e===!0&&(e={}),t=ht({},[t,e]),o=t.labels||{},r=Object.keys(o),delete t.labels,r.length?r.forEach(function(a){o[a]&&n.push(ht({},[t,o[a],{_key:a}]))}):n.push(t),i=n.reduce(function(a,l){return R(l.listeners||{},function(h,c){a[c]=a[c]||{},a[c][l._key||Vo]=h}),delete l.listeners,a},{}),{labels:n,listeners:i})}function ri(s,t,e,i){if(t){var n=e.$context,o=e.$groups,r;t[o._set]&&(r=t[o._set][o._key],r&&I(r,[n,i])===!0&&(s[J]._dirty=!0,e.update(n)))}}function cd(s,t,e,i,n){var o,r;!e&&!i||(e?i?e!==i&&(r=o=!0):r=!0:o=!0,r&&ri(s,t.leave,e,n),o&&ri(s,t.enter,i,n))}function dd(s,t){var e=s[J],i=e._listeners,n,o;if(!(!i.enter&&!i.leave)){if(t.type==="mousemove")o=Ce.lookup(e._labels,t);else if(t.type!=="mouseout")return;n=e._hovered,e._hovered=o,cd(s,i,n,o,t)}}function ud(s,t){var e=s[J],i=e._listeners.click,n=i&&Ce.lookup(e._labels,t);n&&ri(s,i,n,t)}var fd={id:"datalabels",defaults:ld,beforeInit:function(s){s[J]={_actives:[]}},beforeUpdate:function(s){var t=s[J];t._listened=!1,t._listeners={},t._datasets=[],t._labels=[]},afterDatasetUpdate:function(s,t,e){var i=t.index,n=s[J],o=n._datasets[i]=[],r=s.isDatasetVisible(i),a=s.data.datasets[i],l=hd(a,e),h=t.meta.data||[],c=s.ctx,d,u,f,p,g,m,x,_;for(c.save(),d=0,f=h.length;d<f;++d)if(x=h[d],x[J]=[],r&&x&&s.getDataVisibility(d)&&!x.skip)for(u=0,p=l.labels.length;u<p;++u)g=l.labels[u],m=g._key,_=new Ro(g,c,x,d),_.$groups={_set:i,_key:m||Vo},_.$context={active:!1,chart:s,dataIndex:d,dataset:a,datasetIndex:i},_.update(_.$context),x[J].push(_),o.push(_);c.restore(),ht(n._listeners,l.listeners,{merger:function(v,b,y){b[v]=b[v]||{},b[v][t.index]=y[v],n._listened=!0}})},afterUpdate:function(s){s[J]._labels=Ce.prepare(s[J]._datasets)},afterDatasetsDraw:function(s){Ce.draw(s,s[J]._labels)},beforeEvent:function(s,t){if(s[J]._listened){var e=t.event;switch(e.type){case"mousemove":case"mouseout":dd(s,e);break;case"click":ud(s,e);break}}},afterEvent:function(s){var t=s[J],e=t._actives,i=t._actives=s.getActiveElements(),n=Pe.arrayDiff(e,i),o,r,a,l,h,c,d;for(o=0,r=n.length;o<r;++o)if(h=n[o],h[1])for(d=h[0].element[J]||[],a=0,l=d.length;a<l;++a)c=d[a],c.$context.active=h[1]===1,c.update(c.$context);(t._dirty||n.length)&&(Ce.update(t._labels),s.render()),delete t._dirty}};export{_t as C,fd as p};
|