@mxtommy/kip 3.9.0-beta.8 → 3.9.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/.github/copilot-instructions.md +1 -1
- package/.github/instructions/angular.instructions.md +46 -0
- package/CHANGELOG.md +11 -0
- package/README.md +1 -1
- package/package.json +3 -5
- package/public/3rdpartylicenses.txt +129 -129
- package/public/assets/apple-icon-180.png +0 -0
- package/public/assets/apple-splash-1125-2436.jpg +0 -0
- package/public/assets/apple-splash-1136-640.jpg +0 -0
- package/public/assets/apple-splash-1170-2532.jpg +0 -0
- package/public/assets/apple-splash-1179-2556.jpg +0 -0
- package/public/assets/apple-splash-1206-2622.jpg +0 -0
- package/public/assets/apple-splash-1242-2208.jpg +0 -0
- package/public/assets/apple-splash-1242-2688.jpg +0 -0
- package/public/assets/apple-splash-1284-2778.jpg +0 -0
- package/public/assets/apple-splash-1290-2796.jpg +0 -0
- package/public/assets/apple-splash-1320-2868.jpg +0 -0
- package/public/assets/apple-splash-1334-750.jpg +0 -0
- package/public/assets/apple-splash-1488-2266.jpg +0 -0
- package/public/assets/apple-splash-1536-2048.jpg +0 -0
- package/public/assets/apple-splash-1620-2160.jpg +0 -0
- package/public/assets/apple-splash-1640-2360.jpg +0 -0
- package/public/assets/apple-splash-1668-2224.jpg +0 -0
- package/public/assets/apple-splash-1668-2388.jpg +0 -0
- package/public/assets/apple-splash-1792-828.jpg +0 -0
- package/public/assets/apple-splash-2048-1536.jpg +0 -0
- package/public/assets/apple-splash-2048-2732.jpg +0 -0
- package/public/assets/apple-splash-2160-1620.jpg +0 -0
- package/public/assets/apple-splash-2208-1242.jpg +0 -0
- package/public/assets/apple-splash-2224-1668.jpg +0 -0
- package/public/assets/apple-splash-2266-1488.jpg +0 -0
- package/public/assets/apple-splash-2360-1640.jpg +0 -0
- package/public/assets/apple-splash-2388-1668.jpg +0 -0
- package/public/assets/apple-splash-2436-1125.jpg +0 -0
- package/public/assets/apple-splash-2532-1170.jpg +0 -0
- package/public/assets/apple-splash-2556-1179.jpg +0 -0
- package/public/assets/apple-splash-2622-1206.jpg +0 -0
- package/public/assets/apple-splash-2688-1242.jpg +0 -0
- package/public/assets/apple-splash-2732-2048.jpg +0 -0
- package/public/assets/apple-splash-2778-1284.jpg +0 -0
- package/public/assets/apple-splash-2796-1290.jpg +0 -0
- package/public/assets/apple-splash-2868-1320.jpg +0 -0
- package/public/assets/apple-splash-640-1136.jpg +0 -0
- package/public/assets/apple-splash-750-1334.jpg +0 -0
- package/public/assets/apple-splash-828-1792.jpg +0 -0
- package/public/assets/apple-touch-icon.png +0 -0
- package/public/assets/favicon-16x16.png +0 -0
- package/public/assets/favicon-32x32.png +0 -0
- package/public/assets/favicon-64x64.png +0 -0
- package/public/assets/favicon.ico +0 -0
- package/public/assets/favicon.svg +25 -73
- package/public/assets/faviconn.ico +0 -0
- package/public/assets/help-docs/configuration.md +4 -4
- package/public/assets/help-docs/dashboards.md +4 -2
- package/public/assets/help-docs/welcome.md +14 -9
- package/public/assets/icon-192x192.png +0 -0
- package/public/assets/icon-256x256.png +0 -0
- package/public/assets/icon-384x384.png +0 -0
- package/public/assets/icon-512x512.png +0 -0
- package/public/assets/icon-64x64.png +0 -0
- package/public/assets/icon-72x72.png +0 -0
- package/public/assets/manifest-icon-192.maskable.png +0 -0
- package/public/assets/manifest-icon-512.maskable.png +0 -0
- package/public/assets/svg/icons.svg +436 -45
- package/public/{chunk-2YVW3TBK.js → chunk-25PZU2O2.js} +1 -1
- package/public/chunk-2RLXZJPK.js +7 -0
- package/public/chunk-3IUMPTFN.js +6 -0
- package/public/chunk-5KVBD33V.js +4 -0
- package/public/chunk-6WOHGZ7K.js +11 -0
- package/public/{chunk-CQXWGD3T.js → chunk-BYWGV2DR.js} +2 -2
- package/public/chunk-CW3ZK4N3.js +2 -0
- package/public/chunk-DNBBDEKP.js +6 -0
- package/public/chunk-FYD5M4IT.js +16 -0
- package/public/{chunk-KTDDP73O.js → chunk-HECHZXLY.js} +1 -1
- package/public/chunk-N6T2NRWF.js +1 -0
- package/public/chunk-NEYBKWJP.js +1 -0
- package/public/{chunk-4JJLPUET.js → chunk-NHAQWUX3.js} +1 -1
- package/public/chunk-RIG2POCP.js +1 -0
- package/public/chunk-TGXMWTBW.js +1 -0
- package/public/chunk-TP7LH2BI.js +11 -0
- package/public/chunk-ZJO5PJKQ.js +5 -0
- package/public/chunk-ZMNGRHMV.js +1 -0
- package/public/index.html +18 -16
- package/public/main-AQ7CLM7C.js +53 -0
- package/public/{styles-RECKN66R.css → styles-PDNHT2L2.css} +1 -1
- package/public/assets/favicon.png +0 -0
- package/public/assets/hammer.min.js +0 -7
- package/public/chunk-35L7BBBD.js +0 -15
- package/public/chunk-3LEMFOCV.js +0 -3
- package/public/chunk-4R5CMHNA.js +0 -1
- package/public/chunk-5EKHF7EF.js +0 -11
- package/public/chunk-6VZOEK74.js +0 -1
- package/public/chunk-CBUY7NMR.js +0 -2
- package/public/chunk-HCXH72CD.js +0 -5
- package/public/chunk-JY3WVS7C.js +0 -2
- package/public/chunk-LZDK7UWR.js +0 -1
- package/public/chunk-NMEZOCU2.js +0 -1
- package/public/chunk-NS2FPVWM.js +0 -4
- package/public/chunk-O5TE5WOD.js +0 -2
- package/public/chunk-OTC6RE7Y.js +0 -6
- package/public/chunk-PKNLASTF.js +0 -4
- package/public/chunk-Q2Y75POI.js +0 -1
- package/public/chunk-RRTCHHRC.js +0 -3
- package/public/chunk-TA4GACKT.js +0 -4
- package/public/chunk-TXPLRBW5.js +0 -2
- package/public/chunk-VHFBF47T.js +0 -1
- package/public/chunk-VYUMZVH2.js +0 -2
- package/public/chunk-ZBCOJLI4.js +0 -6
- package/public/main-A3JGSNJ3.js +0 -53
package/public/chunk-NS2FPVWM.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{a as Si,b as Ai,oa as Ws}from"./chunk-35L7BBBD.js";var Op=(()=>{class i{DEFAULT_FONT="Roboto";EDGE_BUFFER=10;scaleFactor=window.devicePixelRatio||1;fontsReadyPromise;constructor(){this.fontsReadyPromise=document.fonts.ready}setHighDPISize(t,n){let r=Math.floor(n.width),s=Math.floor(n.height);t.width=r*this.scaleFactor,t.height=s*this.scaleFactor,t.style.width=`${r}px`,t.style.height=`${s}px`}drawTitle(t,n,r,s="normal",o,a){t&&this.fontsReadyPromise.then(()=>{requestAnimationFrame(()=>{this.drawTitleInternal(t,n,r,s,o,a)})}).catch(l=>{console.warn(`[Canvas Service] Font readiness failed: ${l}`),this.drawTitleInternal(t,n,r,s,o,a)})}drawTitleInternal(t,n,r,s="normal",o,a){if(!t)return;let l=o-2*this.EDGE_BUFFER,c=Math.floor(a*.1),u=this.calculateOptimalFontSize(t,n,l,c,s);t.clearRect(0,0,o,a),t.font=`${s} ${u}px ${this.DEFAULT_FONT}`,t.fillStyle=r,t.textAlign="left",t.textBaseline="top",t.fillText(n,this.EDGE_BUFFER*this.scaleFactor,this.EDGE_BUFFER*this.scaleFactor,l)}clearCanvas(t,n,r){t.clearRect(0,0,n,r)}drawText(t,n,r=this.EDGE_BUFFER,s=this.EDGE_BUFFER,o,a,l="normal",c="#000",u="center",f="middle"){t&&(document.fonts.status==="loaded"?this.drawTextInternal(t,n,r,s,o,a,l,c,u,f):this.fontsReadyPromise.then(()=>{this.drawTextInternal(t,n,r,s,o,a,l,c,u,f)}).catch(d=>{console.warn(`[Canvas Service] Font readiness failed: ${d}`),this.drawTextInternal(t,n,r,s,o,a,l,c,u,f)}))}drawTextInternal(t,n,r=this.EDGE_BUFFER,s=this.EDGE_BUFFER,o,a,l="normal",c="#000",u="center",f="middle"){let d=this.calculateOptimalFontSize(t,n,o,a,l);t.font=`${l} ${d}px ${this.DEFAULT_FONT}`,t.fillStyle=c,t.textAlign=u,t.textBaseline=f,t.fillText(n,r,s,o)}calculateOptimalFontSize(t,n,r,s,o="normal"){let a=1,l=s,c=l;for(;a<=l;)c=Math.floor((a+l)/2),t.font=`${o} ${c}px ${this.DEFAULT_FONT}`,t.measureText(n).width>r?l=c-1:a=c+1;return l}drawRectangle(t,n,r,s,o,a){t.fillStyle=a,t.fillRect(n,r,s,o)}releaseCanvas(t,n={}){if(!t)return;let{removeFromDom:r=!1,clear:s=!0,expandoKeys:o=[]}=n;try{let a=t.getContext("2d");s&&a&&a.clearRect(0,0,t.width,t.height),t.width=0,t.height=0,o.forEach(l=>{try{delete t[l]}catch{}}),r&&t.parentNode&&t.parentNode.removeChild(t)}catch(a){console.warn("[CanvasService] releaseCanvas failed",a)}}releaseCanvases(t,n){t.forEach(r=>this.releaseCanvas(r,n))}static \u0275fac=function(n){return new(n||i)};static \u0275prov=Ws({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();function ei(i){return i+.5|0}var te=(i,e,t)=>Math.max(Math.min(i,t),e);function Je(i){return te(ei(i*2.55),0,255)}function ee(i){return te(ei(i*255),0,255)}function Yt(i){return te(ei(i/2.55)/100,0,1)}function Ns(i){return te(ei(i*100),0,100)}var Tt={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},ir=[..."0123456789ABCDEF"],Jl=i=>ir[i&15],tc=i=>ir[(i&240)>>4]+ir[i&15],Ii=i=>(i&240)>>4===(i&15),ec=i=>Ii(i.r)&&Ii(i.g)&&Ii(i.b)&&Ii(i.a);function ic(i){var e=i.length,t;return i[0]==="#"&&(e===4||e===5?t={r:255&Tt[i[1]]*17,g:255&Tt[i[2]]*17,b:255&Tt[i[3]]*17,a:e===5?Tt[i[4]]*17:255}:(e===7||e===9)&&(t={r:Tt[i[1]]<<4|Tt[i[2]],g:Tt[i[3]]<<4|Tt[i[4]],b:Tt[i[5]]<<4|Tt[i[6]],a:e===9?Tt[i[7]]<<4|Tt[i[8]]:255})),t}var nc=(i,e)=>i<255?e(i):"";function rc(i){var e=ec(i)?Jl:tc;return i?"#"+e(i.r)+e(i.g)+e(i.b)+nc(i.a,e):void 0}var sc=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Ys(i,e,t){let n=e*Math.min(t,1-t),r=(s,o=(s+i/30)%12)=>t-n*Math.max(Math.min(o-3,9-o,1),-1);return[r(0),r(8),r(4)]}function oc(i,e,t){let n=(r,s=(r+i/60)%6)=>t-t*e*Math.max(Math.min(s,4-s,1),0);return[n(5),n(3),n(1)]}function ac(i,e,t){let n=Ys(i,1,.5),r;for(e+t>1&&(r=1/(e+t),e*=r,t*=r),r=0;r<3;r++)n[r]*=1-e-t,n[r]+=e;return n}function lc(i,e,t,n,r){return i===r?(e-t)/n+(e<t?6:0):e===r?(t-i)/n+2:(i-e)/n+4}function nr(i){let t=i.r/255,n=i.g/255,r=i.b/255,s=Math.max(t,n,r),o=Math.min(t,n,r),a=(s+o)/2,l,c,u;return s!==o&&(u=s-o,c=a>.5?u/(2-s-o):u/(s+o),l=lc(t,n,r,u,s),l=l*60+.5),[l|0,c||0,a]}function rr(i,e,t,n){return(Array.isArray(e)?i(e[0],e[1],e[2]):i(e,t,n)).map(ee)}function sr(i,e,t){return rr(Ys,i,e,t)}function cc(i,e,t){return rr(ac,i,e,t)}function uc(i,e,t){return rr(oc,i,e,t)}function Us(i){return(i%360+360)%360}function fc(i){let e=sc.exec(i),t=255,n;if(!e)return;e[5]!==n&&(t=e[6]?Je(+e[5]):ee(+e[5]));let r=Us(+e[2]),s=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?n=cc(r,s,o):e[1]==="hsv"?n=uc(r,s,o):n=sr(r,s,o),{r:n[0],g:n[1],b:n[2],a:t}}function dc(i,e){var t=nr(i);t[0]=Us(t[0]+e),t=sr(t),i.r=t[0],i.g=t[1],i.b=t[2]}function hc(i){if(!i)return;let e=nr(i),t=e[0],n=Ns(e[1]),r=Ns(e[2]);return i.a<255?`hsla(${t}, ${n}%, ${r}%, ${Yt(i.a)})`:`hsl(${t}, ${n}%, ${r}%)`}var zs={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"},Hs={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 mc(){let i={},e=Object.keys(Hs),t=Object.keys(zs),n,r,s,o,a;for(n=0;n<e.length;n++){for(o=a=e[n],r=0;r<t.length;r++)s=t[r],a=a.replace(s,zs[s]);s=parseInt(Hs[o],16),i[a]=[s>>16&255,s>>8&255,s&255]}return i}var Li;function pc(i){Li||(Li=mc(),Li.transparent=[0,0,0,0]);let e=Li[i.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}var gc=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function bc(i){let e=gc.exec(i),t=255,n,r,s;if(e){if(e[7]!==n){let o=+e[7];t=e[8]?Je(o):te(o*255,0,255)}return n=+e[1],r=+e[3],s=+e[5],n=255&(e[2]?Je(n):te(n,0,255)),r=255&(e[4]?Je(r):te(r,0,255)),s=255&(e[6]?Je(s):te(s,0,255)),{r:n,g:r,b:s,a:t}}}function xc(i){return i&&(i.a<255?`rgba(${i.r}, ${i.g}, ${i.b}, ${Yt(i.a)})`:`rgb(${i.r}, ${i.g}, ${i.b})`)}var er=i=>i<=.0031308?i*12.92:Math.pow(i,1/2.4)*1.055-.055,Oe=i=>i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4);function vc(i,e,t){let n=Oe(Yt(i.r)),r=Oe(Yt(i.g)),s=Oe(Yt(i.b));return{r:ee(er(n+t*(Oe(Yt(e.r))-n))),g:ee(er(r+t*(Oe(Yt(e.g))-r))),b:ee(er(s+t*(Oe(Yt(e.b))-s))),a:i.a+t*(e.a-i.a)}}function Ei(i,e,t){if(i){let n=nr(i);n[e]=Math.max(0,Math.min(n[e]+n[e]*t,e===0?360:1)),n=sr(n),i.r=n[0],i.g=n[1],i.b=n[2]}}function Vs(i,e){return i&&Object.assign(e||{},i)}function Bs(i){var e={r:0,g:0,b:0,a:255};return Array.isArray(i)?i.length>=3&&(e={r:i[0],g:i[1],b:i[2],a:255},i.length>3&&(e.a=ee(i[3]))):(e=Vs(i,{r:0,g:0,b:0,a:1}),e.a=ee(e.a)),e}function yc(i){return i.charAt(0)==="r"?bc(i):fc(i)}var ti=class i{constructor(e){if(e instanceof i)return e;let t=typeof e,n;t==="object"?n=Bs(e):t==="string"&&(n=ic(e)||pc(e)||yc(e)),this._rgb=n,this._valid=!!n}get valid(){return this._valid}get rgb(){var e=Vs(this._rgb);return e&&(e.a=Yt(e.a)),e}set rgb(e){this._rgb=Bs(e)}rgbString(){return this._valid?xc(this._rgb):void 0}hexString(){return this._valid?rc(this._rgb):void 0}hslString(){return this._valid?hc(this._rgb):void 0}mix(e,t){if(e){let n=this.rgb,r=e.rgb,s,o=t===s?.5:t,a=2*o-1,l=n.a-r.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;s=1-c,n.r=255&c*n.r+s*r.r+.5,n.g=255&c*n.g+s*r.g+.5,n.b=255&c*n.b+s*r.b+.5,n.a=o*n.a+(1-o)*r.a,this.rgb=n}return this}interpolate(e,t){return e&&(this._rgb=vc(this._rgb,e._rgb,t)),this}clone(){return new i(this.rgb)}alpha(e){return this._rgb.a=ee(e),this}clearer(e){let t=this._rgb;return t.a*=1-e,this}greyscale(){let e=this._rgb,t=ei(e.r*.3+e.g*.59+e.b*.11);return e.r=e.g=e.b=t,this}opaquer(e){let t=this._rgb;return t.a*=1+e,this}negate(){let e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return Ei(this._rgb,2,e),this}darken(e){return Ei(this._rgb,2,-e),this}saturate(e){return Ei(this._rgb,1,e),this}desaturate(e){return Ei(this._rgb,1,-e),this}rotate(e){return dc(this._rgb,e),this}};function Ft(){}var eo=(()=>{let i=0;return()=>i++})();function U(i){return i==null}function tt(i){if(Array.isArray&&Array.isArray(i))return!0;let e=Object.prototype.toString.call(i);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function V(i){return i!==null&&Object.prototype.toString.call(i)==="[object Object]"}function rt(i){return(typeof i=="number"||i instanceof Number)&&isFinite(+i)}function bt(i,e){return rt(i)?i:e}function z(i,e){return typeof i>"u"?e:i}var io=(i,e)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100:+i/e,cr=(i,e)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100*e:+i;function Z(i,e,t){if(i&&typeof i.call=="function")return i.apply(t,e)}function Q(i,e,t,n){let r,s,o;if(tt(i))if(s=i.length,n)for(r=s-1;r>=0;r--)e.call(t,i[r],r);else for(r=0;r<s;r++)e.call(t,i[r],r);else if(V(i))for(o=Object.keys(i),s=o.length,r=0;r<s;r++)e.call(t,i[o[r]],o[r])}function ri(i,e){let t,n,r,s;if(!i||!e||i.length!==e.length)return!1;for(t=0,n=i.length;t<n;++t)if(r=i[t],s=e[t],r.datasetIndex!==s.datasetIndex||r.index!==s.index)return!1;return!0}function zi(i){if(tt(i))return i.map(zi);if(V(i)){let e=Object.create(null),t=Object.keys(i),n=t.length,r=0;for(;r<n;++r)e[t[r]]=zi(i[t[r]]);return e}return i}function no(i){return["__proto__","prototype","constructor"].indexOf(i)===-1}function _c(i,e,t,n){if(!no(i))return;let r=e[i],s=t[i];V(r)&&V(s)?Ae(r,s,n):e[i]=zi(s)}function Ae(i,e,t){let n=tt(e)?e:[e],r=n.length;if(!V(i))return i;t=t||{};let s=t.merger||_c,o;for(let a=0;a<r;++a){if(o=n[a],!V(o))continue;let l=Object.keys(o);for(let c=0,u=l.length;c<u;++c)s(l[c],i,o,t)}return i}function Le(i,e){return Ae(i,e,{merger:wc})}function wc(i,e,t){if(!no(i))return;let n=e[i],r=t[i];V(n)&&V(r)?Le(n,r):Object.prototype.hasOwnProperty.call(e,i)||(e[i]=zi(r))}var js={"":i=>i,x:i=>i.x,y:i=>i.y};function Mc(i){let e=i.split("."),t=[],n="";for(let r of e)n+=r,n.endsWith("\\")?n=n.slice(0,-1)+".":(t.push(n),n="");return t}function kc(i){let e=Mc(i);return t=>{for(let n of e){if(n==="")break;t=t&&t[n]}return t}}function jt(i,e){return(js[e]||(js[e]=kc(e)))(i)}function Ui(i){return i.charAt(0).toUpperCase()+i.slice(1)}var Ee=i=>typeof i<"u",Ut=i=>typeof i=="function",ur=(i,e)=>{if(i.size!==e.size)return!1;for(let t of i)if(!e.has(t))return!1;return!0};function ro(i){return i.type==="mouseup"||i.type==="click"||i.type==="contextmenu"}var $=Math.PI,et=2*$,Tc=et+$,Hi=Number.POSITIVE_INFINITY,Dc=$/180,st=$/2,he=$/4,qs=$*2/3,Vt=Math.log10,At=Math.sign;function Re(i,e,t){return Math.abs(i-e)<t}function fr(i){let e=Math.round(i);i=Re(i,e,i/1e3)?e:i;let t=Math.pow(10,Math.floor(Vt(i))),n=i/t;return(n<=1?1:n<=2?2:n<=5?5:10)*t}function so(i){let e=[],t=Math.sqrt(i),n;for(n=1;n<t;n++)i%n===0&&(e.push(n),e.push(i/n));return t===(t|0)&&e.push(t),e.sort((r,s)=>r-s).pop(),e}function Pc(i){return typeof i=="symbol"||typeof i=="object"&&i!==null&&!(Symbol.toPrimitive in i||"toString"in i||"valueOf"in i)}function ge(i){return!Pc(i)&&!isNaN(parseFloat(i))&&isFinite(i)}function oo(i,e){let t=Math.round(i);return t-e<=i&&t+e>=i}function dr(i,e,t){let n,r,s;for(n=0,r=i.length;n<r;n++)s=i[n][t],isNaN(s)||(e.min=Math.min(e.min,s),e.max=Math.max(e.max,s))}function Dt(i){return i*($/180)}function Vi(i){return i*(180/$)}function hr(i){if(!rt(i))return;let e=1,t=0;for(;Math.round(i*e)/e!==i;)e*=10,t++;return t}function mr(i,e){let t=e.x-i.x,n=e.y-i.y,r=Math.sqrt(t*t+n*n),s=Math.atan2(n,t);return s<-.5*$&&(s+=et),{angle:s,distance:r}}function Bi(i,e){return Math.sqrt(Math.pow(e.x-i.x,2)+Math.pow(e.y-i.y,2))}function Cc(i,e){return(i-e+Tc)%et-$}function ft(i){return(i%et+et)%et}function Fe(i,e,t,n){let r=ft(i),s=ft(e),o=ft(t),a=ft(s-r),l=ft(o-r),c=ft(r-s),u=ft(r-o);return r===s||r===o||n&&s===o||a>l&&c<u}function lt(i,e,t){return Math.max(e,Math.min(t,i))}function ao(i){return lt(i,-32768,32767)}function Wt(i,e,t,n=1e-6){return i>=Math.min(e,t)-n&&i<=Math.max(e,t)+n}function ji(i,e,t){t=t||(o=>i[o]<e);let n=i.length-1,r=0,s;for(;n-r>1;)s=r+n>>1,t(s)?r=s:n=s;return{lo:r,hi:n}}var Et=(i,e,t,n)=>ji(i,t,n?r=>{let s=i[r][e];return s<t||s===t&&i[r+1][e]===t}:r=>i[r][e]<t),lo=(i,e,t)=>ji(i,t,n=>i[n][e]>=t);function co(i,e,t){let n=0,r=i.length;for(;n<r&&i[n]<e;)n++;for(;r>n&&i[r-1]>t;)r--;return n>0||r<i.length?i.slice(n,r):i}var uo=["push","pop","shift","splice","unshift"];function fo(i,e){if(i._chartjs){i._chartjs.listeners.push(e);return}Object.defineProperty(i,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),uo.forEach(t=>{let n="_onData"+Ui(t),r=i[t];Object.defineProperty(i,t,{configurable:!0,enumerable:!1,value(...s){let o=r.apply(this,s);return i._chartjs.listeners.forEach(a=>{typeof a[n]=="function"&&a[n](...s)}),o}})})}function pr(i,e){let t=i._chartjs;if(!t)return;let n=t.listeners,r=n.indexOf(e);r!==-1&&n.splice(r,1),!(n.length>0)&&(uo.forEach(s=>{delete i[s]}),delete i._chartjs)}function gr(i){let e=new Set(i);return e.size===i.length?i:Array.from(e)}var br=(function(){return typeof window>"u"?function(i){return i()}:window.requestAnimationFrame})();function xr(i,e){let t=[],n=!1;return function(...r){t=r,n||(n=!0,br.call(window,()=>{n=!1,i.apply(e,t)}))}}function ho(i,e){let t;return function(...n){return e?(clearTimeout(t),t=setTimeout(i,e,n)):i.apply(this,n),e}}var qi=i=>i==="start"?"left":i==="end"?"right":"center",dt=(i,e,t)=>i==="start"?e:i==="end"?t:(e+t)/2,mo=(i,e,t,n)=>i===(n?"left":"right")?t:i==="center"?(e+t)/2:e;function vr(i,e,t){let n=e.length,r=0,s=n;if(i._sorted){let{iScale:o,vScale:a,_parsed:l}=i,c=i.dataset&&i.dataset.options?i.dataset.options.spanGaps:null,u=o.axis,{min:f,max:d,minDefined:h,maxDefined:m}=o.getUserBounds();if(h){if(r=Math.min(Et(l,u,f).lo,t?n:Et(e,u,o.getPixelForValue(f)).lo),c){let p=l.slice(0,r+1).reverse().findIndex(g=>!U(g[a.axis]));r-=Math.max(0,p)}r=lt(r,0,n-1)}if(m){let p=Math.max(Et(l,o.axis,d,!0).hi+1,t?0:Et(e,u,o.getPixelForValue(d),!0).hi+1);if(c){let g=l.slice(p-1).findIndex(b=>!U(b[a.axis]));p+=Math.max(0,g)}s=lt(p,r,n)-r}else s=n-r}return{start:r,count:s}}function yr(i){let{xScale:e,yScale:t,_scaleRanges:n}=i,r={xmin:e.min,xmax:e.max,ymin:t.min,ymax:t.max};if(!n)return i._scaleRanges=r,!0;let s=n.xmin!==e.min||n.xmax!==e.max||n.ymin!==t.min||n.ymax!==t.max;return Object.assign(n,r),s}var Ri=i=>i===0||i===1,$s=(i,e,t)=>-(Math.pow(2,10*(i-=1))*Math.sin((i-e)*et/t)),Xs=(i,e,t)=>Math.pow(2,-10*i)*Math.sin((i-e)*et/t)+1,Se={linear:i=>i,easeInQuad:i=>i*i,easeOutQuad:i=>-i*(i-2),easeInOutQuad:i=>(i/=.5)<1?.5*i*i:-.5*(--i*(i-2)-1),easeInCubic:i=>i*i*i,easeOutCubic:i=>(i-=1)*i*i+1,easeInOutCubic:i=>(i/=.5)<1?.5*i*i*i:.5*((i-=2)*i*i+2),easeInQuart:i=>i*i*i*i,easeOutQuart:i=>-((i-=1)*i*i*i-1),easeInOutQuart:i=>(i/=.5)<1?.5*i*i*i*i:-.5*((i-=2)*i*i*i-2),easeInQuint:i=>i*i*i*i*i,easeOutQuint:i=>(i-=1)*i*i*i*i+1,easeInOutQuint:i=>(i/=.5)<1?.5*i*i*i*i*i:.5*((i-=2)*i*i*i*i+2),easeInSine:i=>-Math.cos(i*st)+1,easeOutSine:i=>Math.sin(i*st),easeInOutSine:i=>-.5*(Math.cos($*i)-1),easeInExpo:i=>i===0?0:Math.pow(2,10*(i-1)),easeOutExpo:i=>i===1?1:-Math.pow(2,-10*i)+1,easeInOutExpo:i=>Ri(i)?i:i<.5?.5*Math.pow(2,10*(i*2-1)):.5*(-Math.pow(2,-10*(i*2-1))+2),easeInCirc:i=>i>=1?i:-(Math.sqrt(1-i*i)-1),easeOutCirc:i=>Math.sqrt(1-(i-=1)*i),easeInOutCirc:i=>(i/=.5)<1?-.5*(Math.sqrt(1-i*i)-1):.5*(Math.sqrt(1-(i-=2)*i)+1),easeInElastic:i=>Ri(i)?i:$s(i,.075,.3),easeOutElastic:i=>Ri(i)?i:Xs(i,.075,.3),easeInOutElastic(i){return Ri(i)?i:i<.5?.5*$s(i*2,.1125,.45):.5+.5*Xs(i*2-1,.1125,.45)},easeInBack(i){return i*i*((1.70158+1)*i-1.70158)},easeOutBack(i){return(i-=1)*i*((1.70158+1)*i+1.70158)+1},easeInOutBack(i){let e=1.70158;return(i/=.5)<1?.5*(i*i*(((e*=1.525)+1)*i-e)):.5*((i-=2)*i*(((e*=1.525)+1)*i+e)+2)},easeInBounce:i=>1-Se.easeOutBounce(1-i),easeOutBounce(i){return i<1/2.75?7.5625*i*i:i<2/2.75?7.5625*(i-=1.5/2.75)*i+.75:i<2.5/2.75?7.5625*(i-=2.25/2.75)*i+.9375:7.5625*(i-=2.625/2.75)*i+.984375},easeInOutBounce:i=>i<.5?Se.easeInBounce(i*2)*.5:Se.easeOutBounce(i*2-1)*.5+.5};function _r(i){if(i&&typeof i=="object"){let e=i.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function wr(i){return _r(i)?i:new ti(i)}function or(i){return _r(i)?i:new ti(i).saturate(.5).darken(.1).hexString()}var Oc=["x","y","borderWidth","radius","tension"],Sc=["color","borderColor","backgroundColor"];function Ac(i){i.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),i.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:e=>e!=="onProgress"&&e!=="onComplete"&&e!=="fn"}),i.set("animations",{colors:{type:"color",properties:Sc},numbers:{type:"number",properties:Oc}}),i.describe("animations",{_fallback:"animation"}),i.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:e=>e|0}}}})}function Ic(i){i.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}var Qs=new Map;function Lc(i,e){e=e||{};let t=i+JSON.stringify(e),n=Qs.get(t);return n||(n=new Intl.NumberFormat(i,e),Qs.set(t,n)),n}function We(i,e,t){return Lc(e,t).format(i)}var po={values(i){return tt(i)?i:""+i},numeric(i,e,t){if(i===0)return"0";let n=this.chart.options.locale,r,s=i;if(t.length>1){let c=Math.max(Math.abs(t[0].value),Math.abs(t[t.length-1].value));(c<1e-4||c>1e15)&&(r="scientific"),s=Ec(i,t)}let o=Vt(Math.abs(s)),a=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:r,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),We(i,n,l)},logarithmic(i,e,t){if(i===0)return"0";let n=t[e].significand||i/Math.pow(10,Math.floor(Vt(i)));return[1,2,3,5,10,15].includes(n)||e>.8*t.length?po.numeric.call(this,i,e,t):""}};function Ec(i,e){let t=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(t)>=1&&i!==Math.floor(i)&&(t=i-Math.floor(i)),t}var si={formatters:po};function Rc(i){i.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,t)=>t.lineWidth,tickColor:(e,t)=>t.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:si.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),i.route("scale.ticks","color","","color"),i.route("scale.grid","color","","borderColor"),i.route("scale.border","color","","borderColor"),i.route("scale.title","color","","color"),i.describe("scale",{_fallback:!1,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&e!=="callback"&&e!=="parser",_indexable:e=>e!=="borderDash"&&e!=="tickBorderDash"&&e!=="dash"}),i.describe("scales",{_fallback:"scale"}),i.describe("scale.ticks",{_scriptable:e=>e!=="backdropPadding"&&e!=="callback",_indexable:e=>e!=="backdropPadding"})}var ne=Object.create(null),$i=Object.create(null);function ii(i,e){if(!e)return i;let t=e.split(".");for(let n=0,r=t.length;n<r;++n){let s=t[n];i=i[s]||(i[s]=Object.create(null))}return i}function ar(i,e,t){return typeof e=="string"?Ae(ii(i,e),t):Ae(ii(i,""),e)}var lr=class{constructor(e,t){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=n=>n.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(n,r)=>or(r.backgroundColor),this.hoverBorderColor=(n,r)=>or(r.borderColor),this.hoverColor=(n,r)=>or(r.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e),this.apply(t)}set(e,t){return ar(this,e,t)}get(e){return ii(this,e)}describe(e,t){return ar($i,e,t)}override(e,t){return ar(ne,e,t)}route(e,t,n,r){let s=ii(this,e),o=ii(this,n),a="_"+t;Object.defineProperties(s,{[a]:{value:s[t],writable:!0},[t]:{enumerable:!0,get(){let l=this[a],c=o[r];return V(l)?Object.assign({},c,l):z(l,c)},set(l){this[a]=l}}})}apply(e){e.forEach(t=>t(this))}},it=new lr({_scriptable:i=>!i.startsWith("on"),_indexable:i=>i!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Ac,Ic,Rc]);function Fc(i){return!i||U(i.size)||U(i.family)?null:(i.style?i.style+" ":"")+(i.weight?i.weight+" ":"")+i.size+"px "+i.family}function ni(i,e,t,n,r){let s=e[r];return s||(s=e[r]=i.measureText(r).width,t.push(r)),s>n&&(n=s),n}function go(i,e,t,n){n=n||{};let r=n.data=n.data||{},s=n.garbageCollect=n.garbageCollect||[];n.font!==e&&(r=n.data={},s=n.garbageCollect=[],n.font=e),i.save(),i.font=e;let o=0,a=t.length,l,c,u,f,d;for(l=0;l<a;l++)if(f=t[l],f!=null&&!tt(f))o=ni(i,r,s,o,f);else if(tt(f))for(c=0,u=f.length;c<u;c++)d=f[c],d!=null&&!tt(d)&&(o=ni(i,r,s,o,d));i.restore();let h=s.length/2;if(h>t.length){for(l=0;l<h;l++)delete r[s[l]];s.splice(0,h)}return o}function re(i,e,t){let n=i.currentDevicePixelRatio,r=t!==0?Math.max(t/2,.5):0;return Math.round((e-r)*n)/n+r}function Mr(i,e){!e&&!i||(e=e||i.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,i.width,i.height),e.restore())}function Xi(i,e,t,n){kr(i,e,t,n,null)}function kr(i,e,t,n,r){let s,o,a,l,c,u,f,d,h=e.pointStyle,m=e.rotation,p=e.radius,g=(m||0)*Dc;if(h&&typeof h=="object"&&(s=h.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){i.save(),i.translate(t,n),i.rotate(g),i.drawImage(h,-h.width/2,-h.height/2,h.width,h.height),i.restore();return}if(!(isNaN(p)||p<=0)){switch(i.beginPath(),h){default:r?i.ellipse(t,n,r/2,p,0,0,et):i.arc(t,n,p,0,et),i.closePath();break;case"triangle":u=r?r/2:p,i.moveTo(t+Math.sin(g)*u,n-Math.cos(g)*p),g+=qs,i.lineTo(t+Math.sin(g)*u,n-Math.cos(g)*p),g+=qs,i.lineTo(t+Math.sin(g)*u,n-Math.cos(g)*p),i.closePath();break;case"rectRounded":c=p*.516,l=p-c,o=Math.cos(g+he)*l,f=Math.cos(g+he)*(r?r/2-c:l),a=Math.sin(g+he)*l,d=Math.sin(g+he)*(r?r/2-c:l),i.arc(t-f,n-a,c,g-$,g-st),i.arc(t+d,n-o,c,g-st,g),i.arc(t+f,n+a,c,g,g+st),i.arc(t-d,n+o,c,g+st,g+$),i.closePath();break;case"rect":if(!m){l=Math.SQRT1_2*p,u=r?r/2:l,i.rect(t-u,n-l,2*u,2*l);break}g+=he;case"rectRot":f=Math.cos(g)*(r?r/2:p),o=Math.cos(g)*p,a=Math.sin(g)*p,d=Math.sin(g)*(r?r/2:p),i.moveTo(t-f,n-a),i.lineTo(t+d,n-o),i.lineTo(t+f,n+a),i.lineTo(t-d,n+o),i.closePath();break;case"crossRot":g+=he;case"cross":f=Math.cos(g)*(r?r/2:p),o=Math.cos(g)*p,a=Math.sin(g)*p,d=Math.sin(g)*(r?r/2:p),i.moveTo(t-f,n-a),i.lineTo(t+f,n+a),i.moveTo(t+d,n-o),i.lineTo(t-d,n+o);break;case"star":f=Math.cos(g)*(r?r/2:p),o=Math.cos(g)*p,a=Math.sin(g)*p,d=Math.sin(g)*(r?r/2:p),i.moveTo(t-f,n-a),i.lineTo(t+f,n+a),i.moveTo(t+d,n-o),i.lineTo(t-d,n+o),g+=he,f=Math.cos(g)*(r?r/2:p),o=Math.cos(g)*p,a=Math.sin(g)*p,d=Math.sin(g)*(r?r/2:p),i.moveTo(t-f,n-a),i.lineTo(t+f,n+a),i.moveTo(t+d,n-o),i.lineTo(t-d,n+o);break;case"line":o=r?r/2:Math.cos(g)*p,a=Math.sin(g)*p,i.moveTo(t-o,n-a),i.lineTo(t+o,n+a);break;case"dash":i.moveTo(t,n),i.lineTo(t+Math.cos(g)*(r?r/2:p),n+Math.sin(g)*p);break;case!1:i.closePath();break}i.fill(),e.borderWidth>0&&i.stroke()}}function Rt(i,e,t){return t=t||.5,!e||i&&i.x>e.left-t&&i.x<e.right+t&&i.y>e.top-t&&i.y<e.bottom+t}function oi(i,e){i.save(),i.beginPath(),i.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),i.clip()}function ai(i){i.restore()}function bo(i,e,t,n,r){if(!e)return i.lineTo(t.x,t.y);if(r==="middle"){let s=(e.x+t.x)/2;i.lineTo(s,e.y),i.lineTo(s,t.y)}else r==="after"!=!!n?i.lineTo(e.x,t.y):i.lineTo(t.x,e.y);i.lineTo(t.x,t.y)}function xo(i,e,t,n){if(!e)return i.lineTo(t.x,t.y);i.bezierCurveTo(n?e.cp1x:e.cp2x,n?e.cp1y:e.cp2y,n?t.cp2x:t.cp1x,n?t.cp2y:t.cp1y,t.x,t.y)}function Wc(i,e){e.translation&&i.translate(e.translation[0],e.translation[1]),U(e.rotation)||i.rotate(e.rotation),e.color&&(i.fillStyle=e.color),e.textAlign&&(i.textAlign=e.textAlign),e.textBaseline&&(i.textBaseline=e.textBaseline)}function Nc(i,e,t,n,r){if(r.strikethrough||r.underline){let s=i.measureText(n),o=e-s.actualBoundingBoxLeft,a=e+s.actualBoundingBoxRight,l=t-s.actualBoundingBoxAscent,c=t+s.actualBoundingBoxDescent,u=r.strikethrough?(l+c)/2:c;i.strokeStyle=i.fillStyle,i.beginPath(),i.lineWidth=r.decorationWidth||2,i.moveTo(o,u),i.lineTo(a,u),i.stroke()}}function zc(i,e){let t=i.fillStyle;i.fillStyle=e.color,i.fillRect(e.left,e.top,e.width,e.height),i.fillStyle=t}function se(i,e,t,n,r,s={}){let o=tt(e)?e:[e],a=s.strokeWidth>0&&s.strokeColor!=="",l,c;for(i.save(),i.font=r.string,Wc(i,s),l=0;l<o.length;++l)c=o[l],s.backdrop&&zc(i,s.backdrop),a&&(s.strokeColor&&(i.strokeStyle=s.strokeColor),U(s.strokeWidth)||(i.lineWidth=s.strokeWidth),i.strokeText(c,t,n,s.maxWidth)),i.fillText(c,t,n,s.maxWidth),Nc(i,t,n,c,s),n+=Number(r.lineHeight);i.restore()}function Ne(i,e){let{x:t,y:n,w:r,h:s,radius:o}=e;i.arc(t+o.topLeft,n+o.topLeft,o.topLeft,1.5*$,$,!0),i.lineTo(t,n+s-o.bottomLeft),i.arc(t+o.bottomLeft,n+s-o.bottomLeft,o.bottomLeft,$,st,!0),i.lineTo(t+r-o.bottomRight,n+s),i.arc(t+r-o.bottomRight,n+s-o.bottomRight,o.bottomRight,st,0,!0),i.lineTo(t+r,n+o.topRight),i.arc(t+r-o.topRight,n+o.topRight,o.topRight,0,-st,!0),i.lineTo(t+o.topLeft,n)}var Hc=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Bc=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Yc(i,e){let t=(""+i).match(Hc);if(!t||t[1]==="normal")return e*1.2;switch(i=+t[2],t[3]){case"px":return i;case"%":i/=100;break}return e*i}var Uc=i=>+i||0;function Qi(i,e){let t={},n=V(e),r=n?Object.keys(e):e,s=V(i)?n?o=>z(i[o],i[e[o]]):o=>i[o]:()=>i;for(let o of r)t[o]=Uc(s(o));return t}function Tr(i){return Qi(i,{top:"y",right:"x",bottom:"y",left:"x"})}function oe(i){return Qi(i,["topLeft","topRight","bottomLeft","bottomRight"])}function ht(i){let e=Tr(i);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function ot(i,e){i=i||{},e=e||it.font;let t=z(i.size,e.size);typeof t=="string"&&(t=parseInt(t,10));let n=z(i.style,e.style);n&&!(""+n).match(Bc)&&(console.warn('Invalid font style specified: "'+n+'"'),n=void 0);let r={family:z(i.family,e.family),lineHeight:Yc(z(i.lineHeight,e.lineHeight),t),size:t,style:n,weight:z(i.weight,e.weight),string:""};return r.string=Fc(r),r}function ze(i,e,t,n){let r=!0,s,o,a;for(s=0,o=i.length;s<o;++s)if(a=i[s],a!==void 0&&(e!==void 0&&typeof a=="function"&&(a=a(e),r=!1),t!==void 0&&tt(a)&&(a=a[t%a.length],r=!1),a!==void 0))return n&&!r&&(n.cacheable=!1),a}function vo(i,e,t){let{min:n,max:r}=i,s=cr(e,(r-n)/2),o=(a,l)=>t&&a===0?0:a+l;return{min:o(n,-Math.abs(s)),max:o(r,s)}}function qt(i,e){return Object.assign(Object.create(i),e)}function Gi(i,e=[""],t,n,r=()=>i[0]){let s=t||i;typeof n>"u"&&(n=wo("_fallback",i));let o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:i,_rootScopes:s,_fallback:n,_getTarget:r,override:a=>Gi([a,...i],e,s,n)};return new Proxy(o,{deleteProperty(a,l){return delete a[l],delete a._keys,delete i[0][l],!0},get(a,l){return yo(a,l,()=>Kc(l,e,i,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(i[0])},has(a,l){return Ks(a).includes(l)},ownKeys(a){return Ks(a)},set(a,l,c){let u=a._storage||(a._storage=r());return a[l]=u[l]=c,delete a._keys,!0}})}function pe(i,e,t,n){let r={_cacheable:!1,_proxy:i,_context:e,_subProxy:t,_stack:new Set,_descriptors:Dr(i,n),setContext:s=>pe(i,s,t,n),override:s=>pe(i.override(s),e,t,n)};return new Proxy(r,{deleteProperty(s,o){return delete s[o],delete i[o],!0},get(s,o,a){return yo(s,o,()=>jc(s,o,a))},getOwnPropertyDescriptor(s,o){return s._descriptors.allKeys?Reflect.has(i,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(i,o)},getPrototypeOf(){return Reflect.getPrototypeOf(i)},has(s,o){return Reflect.has(i,o)},ownKeys(){return Reflect.ownKeys(i)},set(s,o,a){return i[o]=a,delete s[o],!0}})}function Dr(i,e={scriptable:!0,indexable:!0}){let{_scriptable:t=e.scriptable,_indexable:n=e.indexable,_allKeys:r=e.allKeys}=i;return{allKeys:r,scriptable:t,indexable:n,isScriptable:Ut(t)?t:()=>t,isIndexable:Ut(n)?n:()=>n}}var Vc=(i,e)=>i?i+Ui(e):e,Pr=(i,e)=>V(e)&&i!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function yo(i,e,t){if(Object.prototype.hasOwnProperty.call(i,e)||e==="constructor")return i[e];let n=t();return i[e]=n,n}function jc(i,e,t){let{_proxy:n,_context:r,_subProxy:s,_descriptors:o}=i,a=n[e];return Ut(a)&&o.isScriptable(e)&&(a=qc(e,a,i,t)),tt(a)&&a.length&&(a=$c(e,a,i,o.isIndexable)),Pr(e,a)&&(a=pe(a,r,s&&s[e],o)),a}function qc(i,e,t,n){let{_proxy:r,_context:s,_subProxy:o,_stack:a}=t;if(a.has(i))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+i);a.add(i);let l=e(s,o||n);return a.delete(i),Pr(i,l)&&(l=Cr(r._scopes,r,i,l)),l}function $c(i,e,t,n){let{_proxy:r,_context:s,_subProxy:o,_descriptors:a}=t;if(typeof s.index<"u"&&n(i))return e[s.index%e.length];if(V(e[0])){let l=e,c=r._scopes.filter(u=>u!==l);e=[];for(let u of l){let f=Cr(c,r,i,u);e.push(pe(f,s,o&&o[i],a))}}return e}function _o(i,e,t){return Ut(i)?i(e,t):i}var Xc=(i,e)=>i===!0?e:typeof i=="string"?jt(e,i):void 0;function Qc(i,e,t,n,r){for(let s of e){let o=Xc(t,s);if(o){i.add(o);let a=_o(o._fallback,t,r);if(typeof a<"u"&&a!==t&&a!==n)return a}else if(o===!1&&typeof n<"u"&&t!==n)return null}return!1}function Cr(i,e,t,n){let r=e._rootScopes,s=_o(e._fallback,t,n),o=[...i,...r],a=new Set;a.add(n);let l=Gs(a,o,t,s||t,n);return l===null||typeof s<"u"&&s!==t&&(l=Gs(a,o,s,l,n),l===null)?!1:Gi(Array.from(a),[""],r,s,()=>Gc(e,t,n))}function Gs(i,e,t,n,r){for(;t;)t=Qc(i,e,t,n,r);return t}function Gc(i,e,t){let n=i._getTarget();e in n||(n[e]={});let r=n[e];return tt(r)&&V(t)?t:r||{}}function Kc(i,e,t,n){let r;for(let s of e)if(r=wo(Vc(s,i),t),typeof r<"u")return Pr(i,r)?Cr(t,n,i,r):r}function wo(i,e){for(let t of e){if(!t)continue;let n=t[i];if(typeof n<"u")return n}}function Ks(i){let e=i._keys;return e||(e=i._keys=Zc(i._scopes)),e}function Zc(i){let e=new Set;for(let t of i)for(let n of Object.keys(t).filter(r=>!r.startsWith("_")))e.add(n);return Array.from(e)}function Or(i,e,t,n){let{iScale:r}=i,{key:s="r"}=this._parsing,o=new Array(n),a,l,c,u;for(a=0,l=n;a<l;++a)c=a+t,u=e[c],o[a]={r:r.parse(jt(u,s),c)};return o}var Jc=Number.EPSILON||1e-14,Ie=(i,e)=>e<i.length&&!i[e].skip&&i[e],Mo=i=>i==="x"?"y":"x";function tu(i,e,t,n){let r=i.skip?e:i,s=e,o=t.skip?e:t,a=Bi(s,r),l=Bi(o,s),c=a/(a+l),u=l/(a+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;let f=n*c,d=n*u;return{previous:{x:s.x-f*(o.x-r.x),y:s.y-f*(o.y-r.y)},next:{x:s.x+d*(o.x-r.x),y:s.y+d*(o.y-r.y)}}}function eu(i,e,t){let n=i.length,r,s,o,a,l,c=Ie(i,0);for(let u=0;u<n-1;++u)if(l=c,c=Ie(i,u+1),!(!l||!c)){if(Re(e[u],0,Jc)){t[u]=t[u+1]=0;continue}r=t[u]/e[u],s=t[u+1]/e[u],a=Math.pow(r,2)+Math.pow(s,2),!(a<=9)&&(o=3/Math.sqrt(a),t[u]=r*o*e[u],t[u+1]=s*o*e[u])}}function iu(i,e,t="x"){let n=Mo(t),r=i.length,s,o,a,l=Ie(i,0);for(let c=0;c<r;++c){if(o=a,a=l,l=Ie(i,c+1),!a)continue;let u=a[t],f=a[n];o&&(s=(u-o[t])/3,a[`cp1${t}`]=u-s,a[`cp1${n}`]=f-s*e[c]),l&&(s=(l[t]-u)/3,a[`cp2${t}`]=u+s,a[`cp2${n}`]=f+s*e[c])}}function nu(i,e="x"){let t=Mo(e),n=i.length,r=Array(n).fill(0),s=Array(n),o,a,l,c=Ie(i,0);for(o=0;o<n;++o)if(a=l,l=c,c=Ie(i,o+1),!!l){if(c){let u=c[e]-l[e];r[o]=u!==0?(c[t]-l[t])/u:0}s[o]=a?c?At(r[o-1])!==At(r[o])?0:(r[o-1]+r[o])/2:r[o-1]:r[o]}eu(i,r,s),iu(i,s,e)}function Fi(i,e,t){return Math.max(Math.min(i,t),e)}function ru(i,e){let t,n,r,s,o,a=Rt(i[0],e);for(t=0,n=i.length;t<n;++t)o=s,s=a,a=t<n-1&&Rt(i[t+1],e),s&&(r=i[t],o&&(r.cp1x=Fi(r.cp1x,e.left,e.right),r.cp1y=Fi(r.cp1y,e.top,e.bottom)),a&&(r.cp2x=Fi(r.cp2x,e.left,e.right),r.cp2y=Fi(r.cp2y,e.top,e.bottom)))}function ko(i,e,t,n,r){let s,o,a,l;if(e.spanGaps&&(i=i.filter(c=>!c.skip)),e.cubicInterpolationMode==="monotone")nu(i,r);else{let c=n?i[i.length-1]:i[0];for(s=0,o=i.length;s<o;++s)a=i[s],l=tu(c,a,i[Math.min(s+1,o-(n?0:1))%o],e.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,c=a}e.capBezierPoints&&ru(i,t)}function Ki(){return typeof window<"u"&&typeof document<"u"}function Zi(i){let e=i.parentNode;return e&&e.toString()==="[object ShadowRoot]"&&(e=e.host),e}function Yi(i,e,t){let n;return typeof i=="string"?(n=parseInt(i,10),i.indexOf("%")!==-1&&(n=n/100*e.parentNode[t])):n=i,n}var Ji=i=>i.ownerDocument.defaultView.getComputedStyle(i,null);function su(i,e){return Ji(i).getPropertyValue(e)}var ou=["top","right","bottom","left"];function me(i,e,t){let n={};t=t?"-"+t:"";for(let r=0;r<4;r++){let s=ou[r];n[s]=parseFloat(i[e+"-"+s+t])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}var au=(i,e,t)=>(i>0||e>0)&&(!t||!t.shadowRoot);function lu(i,e){let t=i.touches,n=t&&t.length?t[0]:i,{offsetX:r,offsetY:s}=n,o=!1,a,l;if(au(r,s,i.target))a=r,l=s;else{let c=e.getBoundingClientRect();a=n.clientX-c.left,l=n.clientY-c.top,o=!0}return{x:a,y:l,box:o}}function ae(i,e){if("native"in i)return i;let{canvas:t,currentDevicePixelRatio:n}=e,r=Ji(t),s=r.boxSizing==="border-box",o=me(r,"padding"),a=me(r,"border","width"),{x:l,y:c,box:u}=lu(i,t),f=o.left+(u&&a.left),d=o.top+(u&&a.top),{width:h,height:m}=e;return s&&(h-=o.width+a.width,m-=o.height+a.height),{x:Math.round((l-f)/h*t.width/n),y:Math.round((c-d)/m*t.height/n)}}function cu(i,e,t){let n,r;if(e===void 0||t===void 0){let s=i&&Zi(i);if(!s)e=i.clientWidth,t=i.clientHeight;else{let o=s.getBoundingClientRect(),a=Ji(s),l=me(a,"border","width"),c=me(a,"padding");e=o.width-c.width-l.width,t=o.height-c.height-l.height,n=Yi(a.maxWidth,s,"clientWidth"),r=Yi(a.maxHeight,s,"clientHeight")}}return{width:e,height:t,maxWidth:n||Hi,maxHeight:r||Hi}}var Wi=i=>Math.round(i*10)/10;function To(i,e,t,n){let r=Ji(i),s=me(r,"margin"),o=Yi(r.maxWidth,i,"clientWidth")||Hi,a=Yi(r.maxHeight,i,"clientHeight")||Hi,l=cu(i,e,t),{width:c,height:u}=l;if(r.boxSizing==="content-box"){let d=me(r,"border","width"),h=me(r,"padding");c-=h.width+d.width,u-=h.height+d.height}return c=Math.max(0,c-s.width),u=Math.max(0,n?c/n:u-s.height),c=Wi(Math.min(c,o,l.maxWidth)),u=Wi(Math.min(u,a,l.maxHeight)),c&&!u&&(u=Wi(c/2)),(e!==void 0||t!==void 0)&&n&&l.height&&u>l.height&&(u=l.height,c=Wi(Math.floor(u*n))),{width:c,height:u}}function Sr(i,e,t){let n=e||1,r=Math.floor(i.height*n),s=Math.floor(i.width*n);i.height=Math.floor(i.height),i.width=Math.floor(i.width);let o=i.canvas;return o.style&&(t||!o.style.height&&!o.style.width)&&(o.style.height=`${i.height}px`,o.style.width=`${i.width}px`),i.currentDevicePixelRatio!==n||o.height!==r||o.width!==s?(i.currentDevicePixelRatio=n,o.height=r,o.width=s,i.ctx.setTransform(n,0,0,n,0,0),!0):!1}var Do=(function(){let i=!1;try{let e={get passive(){return i=!0,!1}};Ki()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch{}return i})();function Ar(i,e){let t=su(i,e),n=t&&t.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function ie(i,e,t,n){return{x:i.x+t*(e.x-i.x),y:i.y+t*(e.y-i.y)}}function Po(i,e,t,n){return{x:i.x+t*(e.x-i.x),y:n==="middle"?t<.5?i.y:e.y:n==="after"?t<1?i.y:e.y:t>0?e.y:i.y}}function Co(i,e,t,n){let r={x:i.cp2x,y:i.cp2y},s={x:e.cp1x,y:e.cp1y},o=ie(i,r,t),a=ie(r,s,t),l=ie(s,e,t),c=ie(o,a,t),u=ie(a,l,t);return ie(c,u,t)}var uu=function(i,e){return{x(t){return i+i+e-t},setWidth(t){e=t},textAlign(t){return t==="center"?t:t==="right"?"left":"right"},xPlus(t,n){return t-n},leftForLtr(t,n){return t-n}}},fu=function(){return{x(i){return i},setWidth(i){},textAlign(i){return i},xPlus(i,e){return i+e},leftForLtr(i,e){return i}}};function be(i,e,t){return i?uu(e,t):fu()}function Ir(i,e){let t,n;(e==="ltr"||e==="rtl")&&(t=i.canvas.style,n=[t.getPropertyValue("direction"),t.getPropertyPriority("direction")],t.setProperty("direction",e,"important"),i.prevTextDirection=n)}function Lr(i,e){e!==void 0&&(delete i.prevTextDirection,i.canvas.style.setProperty("direction",e[0],e[1]))}function Oo(i){return i==="angle"?{between:Fe,compare:Cc,normalize:ft}:{between:Wt,compare:(e,t)=>e-t,normalize:e=>e}}function Zs({start:i,end:e,count:t,loop:n,style:r}){return{start:i%t,end:e%t,loop:n&&(e-i+1)%t===0,style:r}}function du(i,e,t){let{property:n,start:r,end:s}=t,{between:o,normalize:a}=Oo(n),l=e.length,{start:c,end:u,loop:f}=i,d,h;if(f){for(c+=l,u+=l,d=0,h=l;d<h&&o(a(e[c%l][n]),r,s);++d)c--,u--;c%=l,u%=l}return u<c&&(u+=l),{start:c,end:u,loop:f,style:i.style}}function Er(i,e,t){if(!t)return[i];let{property:n,start:r,end:s}=t,o=e.length,{compare:a,between:l,normalize:c}=Oo(n),{start:u,end:f,loop:d,style:h}=du(i,e,t),m=[],p=!1,g=null,b,x,w,k=()=>l(r,w,b)&&a(r,w)!==0,v=()=>a(s,b)===0||l(s,w,b),_=()=>p||k(),C=()=>!p||v();for(let P=u,O=u;P<=f;++P)x=e[P%o],!x.skip&&(b=c(x[n]),b!==w&&(p=l(b,r,s),g===null&&_()&&(g=a(b,r)===0?P:O),g!==null&&C()&&(m.push(Zs({start:g,end:P,loop:d,count:o,style:h})),g=null),O=P,w=b));return g!==null&&m.push(Zs({start:g,end:f,loop:d,count:o,style:h})),m}function Rr(i,e){let t=[],n=i.segments;for(let r=0;r<n.length;r++){let s=Er(n[r],i.points,e);s.length&&t.push(...s)}return t}function hu(i,e,t,n){let r=0,s=e-1;if(t&&!n)for(;r<e&&!i[r].skip;)r++;for(;r<e&&i[r].skip;)r++;for(r%=e,t&&(s+=r);s>r&&i[s%e].skip;)s--;return s%=e,{start:r,end:s}}function mu(i,e,t,n){let r=i.length,s=[],o=e,a=i[e],l;for(l=e+1;l<=t;++l){let c=i[l%r];c.skip||c.stop?a.skip||(n=!1,s.push({start:e%r,end:(l-1)%r,loop:n}),e=o=c.stop?l:null):(o=l,a.skip&&(e=l)),a=c}return o!==null&&s.push({start:e%r,end:o%r,loop:n}),s}function So(i,e){let t=i.points,n=i.options.spanGaps,r=t.length;if(!r)return[];let s=!!i._loop,{start:o,end:a}=hu(t,r,s,n);if(n===!0)return Js(i,[{start:o,end:a,loop:s}],t,e);let l=a<o?a+r:a,c=!!i._fullLoop&&o===0&&a===r-1;return Js(i,mu(t,o,l,c),t,e)}function Js(i,e,t,n){return!n||!n.setContext||!t?e:pu(i,e,t,n)}function pu(i,e,t,n){let r=i._chart.getContext(),s=to(i.options),{_datasetIndex:o,options:{spanGaps:a}}=i,l=t.length,c=[],u=s,f=e[0].start,d=f;function h(m,p,g,b){let x=a?-1:1;if(m!==p){for(m+=l;t[m%l].skip;)m-=x;for(;t[p%l].skip;)p+=x;m%l!==p%l&&(c.push({start:m%l,end:p%l,loop:g,style:b}),u=b,f=p%l)}}for(let m of e){f=a?f:m.start;let p=t[f%l],g;for(d=f+1;d<=m.end;d++){let b=t[d%l];g=to(n.setContext(qt(r,{type:"segment",p0:p,p1:b,p0DataIndex:(d-1)%l,p1DataIndex:d%l,datasetIndex:o}))),gu(g,u)&&h(f,d-1,m.loop,u),p=b,u=g}f<d-1&&h(f,d-1,m.loop,u)}return c}function to(i){return{backgroundColor:i.backgroundColor,borderCapStyle:i.borderCapStyle,borderDash:i.borderDash,borderDashOffset:i.borderDashOffset,borderJoinStyle:i.borderJoinStyle,borderWidth:i.borderWidth,borderColor:i.borderColor}}function gu(i,e){if(!e)return!1;let t=[],n=function(r,s){return _r(s)?(t.includes(s)||t.push(s),t.indexOf(s)):s};return JSON.stringify(i,n)!==JSON.stringify(e,n)}function Ni(i,e,t){return i.options.clip?i[t]:e[t]}function bu(i,e){let{xScale:t,yScale:n}=i;return t&&n?{left:Ni(t,e,"left"),right:Ni(t,e,"right"),top:Ni(n,e,"top"),bottom:Ni(n,e,"bottom")}:e}function Fr(i,e){let t=e._clip;if(t.disabled)return!1;let n=bu(e,i.chartArea);return{left:t.left===!1?0:n.left-(t.left===!0?0:t.left),right:t.right===!1?i.width:n.right+(t.right===!0?0:t.right),top:t.top===!1?0:n.top-(t.top===!0?0:t.top),bottom:t.bottom===!1?i.height:n.bottom+(t.bottom===!0?0:t.bottom)}}var Xr=class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,t,n,r){let s=t.listeners[r],o=t.duration;s.forEach(a=>a({chart:e,initial:t.initial,numSteps:o,currentStep:Math.min(n-t.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=br.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((n,r)=>{if(!n.running||!n.items.length)return;let s=n.items,o=s.length-1,a=!1,l;for(;o>=0;--o)l=s[o],l._active?(l._total>n.duration&&(n.duration=l._total),l.tick(e),a=!0):(s[o]=s[s.length-1],s.pop());a&&(r.draw(),this._notify(r,n,e,"progress")),s.length||(n.running=!1,this._notify(r,n,e,"complete"),n.initial=!1),t+=s.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){let t=this._charts,n=t.get(e);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,n)),n}listen(e,t,n){this._getAnims(e).listeners[t].push(n)}add(e,t){!t||!t.length||this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){let t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((n,r)=>Math.max(n,r._duration),0),this._refresh())}running(e){if(!this._running)return!1;let t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){let t=this._charts.get(e);if(!t||!t.items.length)return;let n=t.items,r=n.length-1;for(;r>=0;--r)n[r].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}},$t=new Xr,Ao="transparent",xu={boolean(i,e,t){return t>.5?e:i},color(i,e,t){let n=wr(i||Ao),r=n.valid&&wr(e||Ao);return r&&r.valid?r.mix(n,t).hexString():e},number(i,e,t){return i+(e-i)*t}},Qr=class{constructor(e,t,n,r){let s=t[n];r=ze([e.to,r,s,e.from]);let o=ze([e.from,s,r]);this._active=!0,this._fn=e.fn||xu[e.type||typeof o],this._easing=Se[e.easing]||Se.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=n,this._from=o,this._to=r,this._promises=void 0}active(){return this._active}update(e,t,n){if(this._active){this._notify(!1);let r=this._target[this._prop],s=n-this._start,o=this._duration-s;this._start=n,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=s,this._loop=!!e.loop,this._to=ze([e.to,t,r,e.from]),this._from=ze([e.from,r,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){let t=e-this._start,n=this._duration,r=this._prop,s=this._from,o=this._loop,a=this._to,l;if(this._active=s!==a&&(o||t<n),!this._active){this._target[r]=a,this._notify(!0);return}if(t<0){this._target[r]=s;return}l=t/n%2,l=o&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[r]=this._fn(s,a,l)}wait(){let e=this._promises||(this._promises=[]);return new Promise((t,n)=>{e.push({res:t,rej:n})})}_notify(e){let t=e?"res":"rej",n=this._promises||[];for(let r=0;r<n.length;r++)n[r][t]()}},cn=class{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!V(e))return;let t=Object.keys(it.animation),n=this._properties;Object.getOwnPropertyNames(e).forEach(r=>{let s=e[r];if(!V(s))return;let o={};for(let a of t)o[a]=s[a];(tt(s.properties)&&s.properties||[r]).forEach(a=>{(a===r||!n.has(a))&&n.set(a,o)})})}_animateOptions(e,t){let n=t.options,r=yu(e,n);if(!r)return[];let s=this._createAnimations(r,n);return n.$shared&&vu(e.options.$animations,n).then(()=>{e.options=n},()=>{}),s}_createAnimations(e,t){let n=this._properties,r=[],s=e.$animations||(e.$animations={}),o=Object.keys(t),a=Date.now(),l;for(l=o.length-1;l>=0;--l){let c=o[l];if(c.charAt(0)==="$")continue;if(c==="options"){r.push(...this._animateOptions(e,t));continue}let u=t[c],f=s[c],d=n.get(c);if(f)if(d&&f.active()){f.update(d,u,a);continue}else f.cancel();if(!d||!d.duration){e[c]=u;continue}s[c]=f=new Qr(d,e,c,u),r.push(f)}return r}update(e,t){if(this._properties.size===0){Object.assign(e,t);return}let n=this._createAnimations(e,t);if(n.length)return $t.add(this._chart,n),!0}};function vu(i,e){let t=[],n=Object.keys(e);for(let r=0;r<n.length;r++){let s=i[n[r]];s&&s.active()&&t.push(s.wait())}return Promise.all(t)}function yu(i,e){if(!e)return;let t=i.options;if(!t){i.options=e;return}return t.$shared&&(i.options=t=Object.assign({},t,{$shared:!1,$animations:{}})),t}function Io(i,e){let t=i&&i.options||{},n=t.reverse,r=t.min===void 0?e:0,s=t.max===void 0?e:0;return{start:n?s:r,end:n?r:s}}function _u(i,e,t){if(t===!1)return!1;let n=Io(i,t),r=Io(e,t);return{top:r.end,right:n.end,bottom:r.start,left:n.start}}function wu(i){let e,t,n,r;return V(i)?(e=i.top,t=i.right,n=i.bottom,r=i.left):e=t=n=r=i,{top:e,right:t,bottom:n,left:r,disabled:i===!1}}function Aa(i,e){let t=[],n=i._getSortedDatasetMetas(e),r,s;for(r=0,s=n.length;r<s;++r)t.push(n[r].index);return t}function Lo(i,e,t,n={}){let r=i.keys,s=n.mode==="single",o,a,l,c;if(e===null)return;let u=!1;for(o=0,a=r.length;o<a;++o){if(l=+r[o],l===t){if(u=!0,n.all)continue;break}c=i.values[l],rt(c)&&(s||e===0||At(e)===At(c))&&(e+=c)}return!u&&!n.all?0:e}function Mu(i,e){let{iScale:t,vScale:n}=e,r=t.axis==="x"?"x":"y",s=n.axis==="x"?"x":"y",o=Object.keys(i),a=new Array(o.length),l,c,u;for(l=0,c=o.length;l<c;++l)u=o[l],a[l]={[r]:u,[s]:i[u]};return a}function Wr(i,e){let t=i&&i.options.stacked;return t||t===void 0&&e.stack!==void 0}function ku(i,e,t){return`${i.id}.${e.id}.${t.stack||t.type}`}function Tu(i){let{min:e,max:t,minDefined:n,maxDefined:r}=i.getUserBounds();return{min:n?e:Number.NEGATIVE_INFINITY,max:r?t:Number.POSITIVE_INFINITY}}function Du(i,e,t){let n=i[e]||(i[e]={});return n[t]||(n[t]={})}function Eo(i,e,t,n){for(let r of e.getMatchingVisibleMetas(n).reverse()){let s=i[r.index];if(t&&s>0||!t&&s<0)return r.index}return null}function Ro(i,e){let{chart:t,_cachedMeta:n}=i,r=t._stacks||(t._stacks={}),{iScale:s,vScale:o,index:a}=n,l=s.axis,c=o.axis,u=ku(s,o,n),f=e.length,d;for(let h=0;h<f;++h){let m=e[h],{[l]:p,[c]:g}=m,b=m._stacks||(m._stacks={});d=b[c]=Du(r,u,p),d[a]=g,d._top=Eo(d,o,!0,n.type),d._bottom=Eo(d,o,!1,n.type);let x=d._visualValues||(d._visualValues={});x[a]=g}}function Nr(i,e){let t=i.scales;return Object.keys(t).filter(n=>t[n].axis===e).shift()}function Pu(i,e){return qt(i,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function Cu(i,e,t){return qt(i,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:t,index:e,mode:"default",type:"data"})}function li(i,e){let t=i.controller.index,n=i.vScale&&i.vScale.axis;if(n){e=e||i._parsed;for(let r of e){let s=r._stacks;if(!s||s[n]===void 0||s[n][t]===void 0)return;delete s[n][t],s[n]._visualValues!==void 0&&s[n]._visualValues[t]!==void 0&&delete s[n]._visualValues[t]}}}var zr=i=>i==="reset"||i==="none",Fo=(i,e)=>e?i:Object.assign({},i),Ou=(i,e,t)=>i&&!e.hidden&&e._stacked&&{keys:Aa(t,!0),values:null},ce=(()=>{class i{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,n){this.chart=t,this._ctx=t.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){let t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Wr(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&&li(this._cachedMeta),this.index=t}linkScales(){let t=this.chart,n=this._cachedMeta,r=this.getDataset(),s=(d,h,m,p)=>d==="x"?h:d==="r"?p:m,o=n.xAxisID=z(r.xAxisID,Nr(t,"x")),a=n.yAxisID=z(r.yAxisID,Nr(t,"y")),l=n.rAxisID=z(r.rAxisID,Nr(t,"r")),c=n.indexAxis,u=n.iAxisID=s(c,o,a,l),f=n.vAxisID=s(c,a,o,l);n.xScale=this.getScaleForId(o),n.yScale=this.getScaleForId(a),n.rScale=this.getScaleForId(l),n.iScale=this.getScaleForId(u),n.vScale=this.getScaleForId(f)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){let n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){let t=this._cachedMeta;this._data&&pr(this._data,this),t._stacked&&li(t)}_dataCheck(){let t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(V(n)){let s=this._cachedMeta;this._data=Mu(n,s)}else if(r!==n){if(r){pr(r,this);let s=this._cachedMeta;li(s),s._parsed=[]}n&&Object.isExtensible(n)&&fo(n,this),this._syncList=[],this._data=n}}addElements(){let t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){let n=this._cachedMeta,r=this.getDataset(),s=!1;this._dataCheck();let o=n._stacked;n._stacked=Wr(n.vScale,n),n.stack!==r.stack&&(s=!0,li(n),n.stack=r.stack),this._resyncElements(t),(s||o!==n._stacked)&&(Ro(this,n._parsed),n._stacked=Wr(n.vScale,n))}configure(){let t=this.chart.config,n=t.datasetScopeKeys(this._type),r=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){let{_cachedMeta:r,_data:s}=this,{iScale:o,_stacked:a}=r,l=o.axis,c=t===0&&n===s.length?!0:r._sorted,u=t>0&&r._parsed[t-1],f,d,h;if(this._parsing===!1)r._parsed=s,r._sorted=!0,h=s;else{tt(s[t])?h=this.parseArrayData(r,s,t,n):V(s[t])?h=this.parseObjectData(r,s,t,n):h=this.parsePrimitiveData(r,s,t,n);let m=()=>d[l]===null||u&&d[l]<u[l];for(f=0;f<n;++f)r._parsed[f+t]=d=h[f],c&&(m()&&(c=!1),u=d);r._sorted=c}a&&Ro(this,h)}parsePrimitiveData(t,n,r,s){let{iScale:o,vScale:a}=t,l=o.axis,c=a.axis,u=o.getLabels(),f=o===a,d=new Array(s),h,m,p;for(h=0,m=s;h<m;++h)p=h+r,d[h]={[l]:f||o.parse(u[p],p),[c]:a.parse(n[p],p)};return d}parseArrayData(t,n,r,s){let{xScale:o,yScale:a}=t,l=new Array(s),c,u,f,d;for(c=0,u=s;c<u;++c)f=c+r,d=n[f],l[c]={x:o.parse(d[0],f),y:a.parse(d[1],f)};return l}parseObjectData(t,n,r,s){let{xScale:o,yScale:a}=t,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,u=new Array(s),f,d,h,m;for(f=0,d=s;f<d;++f)h=f+r,m=n[h],u[f]={x:o.parse(jt(m,l),h),y:a.parse(jt(m,c),h)};return u}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,r){let s=this.chart,o=this._cachedMeta,a=n[t.axis],l={keys:Aa(s,!0),values:n._stacks[t.axis]._visualValues};return Lo(l,a,o.index,{mode:r})}updateRangeFromParsed(t,n,r,s){let o=r[n.axis],a=o===null?NaN:o,l=s&&r._stacks[n.axis];s&&l&&(s.values=l,a=Lo(s,o,this._cachedMeta.index)),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a)}getMinMax(t,n){let r=this._cachedMeta,s=r._parsed,o=r._sorted&&t===r.iScale,a=s.length,l=this._getOtherScale(t),c=Ou(n,r,this.chart),u={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:f,max:d}=Tu(l),h,m;function p(){m=s[h];let g=m[l.axis];return!rt(m[t.axis])||f>g||d<g}for(h=0;h<a&&!(!p()&&(this.updateRangeFromParsed(u,t,m,c),o));++h);if(o){for(h=a-1;h>=0;--h)if(!p()){this.updateRangeFromParsed(u,t,m,c);break}}return u}getAllParsedValues(t){let n=this._cachedMeta._parsed,r=[],s,o,a;for(s=0,o=n.length;s<o;++s)a=n[s][t.axis],rt(a)&&r.push(a);return r}getMaxOverflow(){return!1}getLabelAndValue(t){let n=this._cachedMeta,r=n.iScale,s=n.vScale,o=this.getParsed(t);return{label:r?""+r.getLabelForValue(o[r.axis]):"",value:s?""+s.getLabelForValue(o[s.axis]):""}}_update(t){let n=this._cachedMeta;this.update(t||"default"),n._clip=wu(z(this.options.clip,_u(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){let t=this._ctx,n=this.chart,r=this._cachedMeta,s=r.data||[],o=n.chartArea,a=[],l=this._drawStart||0,c=this._drawCount||s.length-l,u=this.options.drawActiveElementsOnTop,f;for(r.dataset&&r.dataset.draw(t,o,l,c),f=l;f<l+c;++f){let d=s[f];d.hidden||(d.active&&u?a.push(d):d.draw(t,o))}for(f=0;f<a.length;++f)a[f].draw(t,o)}getStyle(t,n){let r=n?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(r):this.resolveDataElementOptions(t||0,r)}getContext(t,n,r){let s=this.getDataset(),o;if(t>=0&&t<this._cachedMeta.data.length){let a=this._cachedMeta.data[t];o=a.$context||(a.$context=Cu(this.getContext(),t,a)),o.parsed=this.getParsed(t),o.raw=s.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=Pu(this.chart.getContext(),this.index)),o.dataset=s,o.index=o.datasetIndex=this.index;return o.active=!!n,o.mode=r,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,n){return this._resolveElementOptions(this.dataElementType.id,n,t)}_resolveElementOptions(t,n="default",r){let s=n==="active",o=this._cachedDataOpts,a=t+"-"+n,l=o[a],c=this.enableOptionSharing&&Ee(r);if(l)return Fo(l,c);let u=this.chart.config,f=u.datasetElementScopeKeys(this._type,t),d=s?[`${t}Hover`,"hover",t,""]:[t,""],h=u.getOptionScopes(this.getDataset(),f),m=Object.keys(it.elements[t]),p=()=>this.getContext(r,s,n),g=u.resolveNamedOptions(h,m,p,d);return g.$shared&&(g.$shared=c,o[a]=Object.freeze(Fo(g,c))),g}_resolveAnimations(t,n,r){let s=this.chart,o=this._cachedDataOpts,a=`animation-${n}`,l=o[a];if(l)return l;let c;if(s.options.animation!==!1){let f=this.chart.config,d=f.datasetAnimationScopeKeys(this._type,n),h=f.getOptionScopes(this.getDataset(),d);c=f.createResolver(h,this.getContext(t,r,n))}let u=new cn(s,c&&c.animations);return c&&c._cacheable&&(o[a]=Object.freeze(u)),u}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||zr(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){let r=this.resolveDataElementOptions(t,n),s=this._sharedOptions,o=this.getSharedOptions(r),a=this.includeOptions(n,o)||o!==s;return this.updateSharedOptions(o,n,r),{sharedOptions:o,includeOptions:a}}updateElement(t,n,r,s){zr(s)?Object.assign(t,r):this._resolveAnimations(n,s).update(t,r)}updateSharedOptions(t,n,r){t&&!zr(n)&&this._resolveAnimations(void 0,n).update(t,r)}_setStyle(t,n,r,s){t.active=s;let o=this.getStyle(n,s);this._resolveAnimations(n,r,s).update(t,{options:!s&&this.getSharedOptions(o)||o})}removeHoverStyle(t,n,r){this._setStyle(t,r,"active",!1)}setHoverStyle(t,n,r){this._setStyle(t,r,"active",!0)}_removeDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){let n=this._data,r=this._cachedMeta.data;for(let[l,c,u]of this._syncList)this[l](c,u);this._syncList=[];let s=r.length,o=n.length,a=Math.min(o,s);a&&this.parse(0,a),o>s?this._insertElements(s,o-s,t):o<s&&this._removeElements(o,s-o)}_insertElements(t,n,r=!0){let s=this._cachedMeta,o=s.data,a=t+n,l,c=u=>{for(u.length+=n,l=u.length-1;l>=a;l--)u[l]=u[l-n]};for(c(o),l=t;l<a;++l)o[l]=new this.dataElementType;this._parsing&&c(s._parsed),this.parse(t,n),r&&this.updateElements(o,t,n,"reset")}updateElements(t,n,r,s){}_removeElements(t,n){let r=this._cachedMeta;if(this._parsing){let s=r._parsed.splice(t,n);r._stacked&&li(r,s)}r.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{let[n,r,s]=t;this[n](r,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){let t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,n){n&&this._sync(["_removeElements",t,n]);let r=arguments.length-2;r&&this._sync(["_insertElements",t,r])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}return i})();function Su(i,e){if(!i._cache.$bar){let t=i.getMatchingVisibleMetas(e),n=[];for(let r=0,s=t.length;r<s;r++)n=n.concat(t[r].controller.getAllParsedValues(i));i._cache.$bar=gr(n.sort((r,s)=>r-s))}return i._cache.$bar}function Au(i){let e=i.iScale,t=Su(e,i.type),n=e._length,r,s,o,a,l=()=>{o===32767||o===-32768||(Ee(a)&&(n=Math.min(n,Math.abs(o-a)||n)),a=o)};for(r=0,s=t.length;r<s;++r)o=e.getPixelForValue(t[r]),l();for(a=void 0,r=0,s=e.ticks.length;r<s;++r)o=e.getPixelForTick(r),l();return n}function Iu(i,e,t,n){let r=t.barThickness,s,o;return U(r)?(s=e.min*t.categoryPercentage,o=t.barPercentage):(s=r*n,o=1),{chunk:s/n,ratio:o,start:e.pixels[i]-s/2}}function Lu(i,e,t,n){let r=e.pixels,s=r[i],o=i>0?r[i-1]:null,a=i<r.length-1?r[i+1]:null,l=t.categoryPercentage;o===null&&(o=s-(a===null?e.end-e.start:a-s)),a===null&&(a=s+s-o);let c=s-(s-Math.min(o,a))/2*l;return{chunk:Math.abs(a-o)/2*l/n,ratio:t.barPercentage,start:c}}function Eu(i,e,t,n){let r=t.parse(i[0],n),s=t.parse(i[1],n),o=Math.min(r,s),a=Math.max(r,s),l=o,c=a;Math.abs(o)>Math.abs(a)&&(l=a,c=o),e[t.axis]=c,e._custom={barStart:l,barEnd:c,start:r,end:s,min:o,max:a}}function Ia(i,e,t,n){return tt(i)?Eu(i,e,t,n):e[t.axis]=t.parse(i,n),e}function Wo(i,e,t,n){let r=i.iScale,s=i.vScale,o=r.getLabels(),a=r===s,l=[],c,u,f,d;for(c=t,u=t+n;c<u;++c)d=e[c],f={},f[r.axis]=a||r.parse(o[c],c),l.push(Ia(d,f,s,c));return l}function Hr(i){return i&&i.barStart!==void 0&&i.barEnd!==void 0}function Ru(i,e,t){return i!==0?At(i):(e.isHorizontal()?1:-1)*(e.min>=t?1:-1)}function Fu(i){let e,t,n,r,s;return i.horizontal?(e=i.base>i.x,t="left",n="right"):(e=i.base<i.y,t="bottom",n="top"),e?(r="end",s="start"):(r="start",s="end"),{start:t,end:n,reverse:e,top:r,bottom:s}}function Wu(i,e,t,n){let r=e.borderSkipped,s={};if(!r){i.borderSkipped=s;return}if(r===!0){i.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}let{start:o,end:a,reverse:l,top:c,bottom:u}=Fu(i);r==="middle"&&t&&(i.enableBorderRadius=!0,(t._top||0)===n?r=c:(t._bottom||0)===n?r=u:(s[No(u,o,a,l)]=!0,r=c)),s[No(r,o,a,l)]=!0,i.borderSkipped=s}function No(i,e,t,n){return n?(i=Nu(i,e,t),i=zo(i,t,e)):i=zo(i,e,t),i}function Nu(i,e,t){return i===e?t:i===t?e:i}function zo(i,e,t){return i==="start"?e:i==="end"?t:i}function zu(i,{inflateAmount:e},t){i.inflateAmount=e==="auto"?t===1?.33:0:e}var Hu=(()=>{class i extends ce{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(t,n,r,s){return Wo(t,n,r,s)}parseArrayData(t,n,r,s){return Wo(t,n,r,s)}parseObjectData(t,n,r,s){let{iScale:o,vScale:a}=t,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,u=o.axis==="x"?l:c,f=a.axis==="x"?l:c,d=[],h,m,p,g;for(h=r,m=r+s;h<m;++h)g=n[h],p={},p[o.axis]=o.parse(jt(g,u),h),d.push(Ia(jt(g,f),p,a,h));return d}updateRangeFromParsed(t,n,r,s){super.updateRangeFromParsed(t,n,r,s);let o=r._custom;o&&n===this._cachedMeta.vScale&&(t.min=Math.min(t.min,o.min),t.max=Math.max(t.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(t){let n=this._cachedMeta,{iScale:r,vScale:s}=n,o=this.getParsed(t),a=o._custom,l=Hr(a)?"["+a.start+", "+a.end+"]":""+s.getLabelForValue(o[s.axis]);return{label:""+r.getLabelForValue(o[r.axis]),value:l}}initialize(){this.enableOptionSharing=!0,super.initialize();let t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){let n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,t)}updateElements(t,n,r,s){let o=s==="reset",{index:a,_cachedMeta:{vScale:l}}=this,c=l.getBasePixel(),u=l.isHorizontal(),f=this._getRuler(),{sharedOptions:d,includeOptions:h}=this._getSharedOptions(n,s);for(let m=n;m<n+r;m++){let p=this.getParsed(m),g=o||U(p[l.axis])?{base:c,head:c}:this._calculateBarValuePixels(m),b=this._calculateBarIndexPixels(m,f),x=(p._stacks||{})[l.axis],w={horizontal:u,base:g.base,enableBorderRadius:!x||Hr(p._custom)||a===x._top||a===x._bottom,x:u?g.head:b.center,y:u?b.center:g.head,height:u?b.size:Math.abs(g.size),width:u?Math.abs(g.size):b.size};h&&(w.options=d||this.resolveDataElementOptions(m,t[m].active?"active":s));let k=w.options||t[m].options;Wu(w,k,x,a),zu(w,k,f.ratio),this.updateElement(t[m],m,w,s)}}_getStacks(t,n){let{iScale:r}=this._cachedMeta,s=r.getMatchingVisibleMetas(this._type).filter(f=>f.controller.options.grouped),o=r.options.stacked,a=[],l=this._cachedMeta.controller.getParsed(n),c=l&&l[r.axis],u=f=>{let d=f._parsed.find(m=>m[r.axis]===c),h=d&&d[f.vScale.axis];if(U(h)||isNaN(h))return!0};for(let f of s)if(!(n!==void 0&&u(f))&&((o===!1||a.indexOf(f.stack)===-1||o===void 0&&f.stack===void 0)&&a.push(f.stack),f.index===t))break;return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){let t=this.chart.scales,n=this.chart.options.indexAxis;return Object.keys(t).filter(r=>t[r].axis===n).shift()}_getAxis(){let t={},n=this.getFirstScaleIdForIndexAxis();for(let r of this.chart.data.datasets)t[z(this.chart.options.indexAxis==="x"?r.xAxisID:r.yAxisID,n)]=!0;return Object.keys(t)}_getStackIndex(t,n,r){let s=this._getStacks(t,r),o=n!==void 0?s.indexOf(n):-1;return o===-1?s.length-1:o}_getRuler(){let t=this.options,n=this._cachedMeta,r=n.iScale,s=[],o,a;for(o=0,a=n.data.length;o<a;++o)s.push(r.getPixelForValue(this.getParsed(o)[r.axis],o));let l=t.barThickness;return{min:l||Au(n),pixels:s,start:r._startPixel,end:r._endPixel,stackCount:this._getStackCount(),scale:r,grouped:t.grouped,ratio:l?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){let{_cachedMeta:{vScale:n,_stacked:r,index:s},options:{base:o,minBarLength:a}}=this,l=o||0,c=this.getParsed(t),u=c._custom,f=Hr(u),d=c[n.axis],h=0,m=r?this.applyStack(n,c,r):d,p,g;m!==d&&(h=m-d,m=d),f&&(d=u.barStart,m=u.barEnd-u.barStart,d!==0&&At(d)!==At(u.barEnd)&&(h=0),h+=d);let b=!U(o)&&!f?o:h,x=n.getPixelForValue(b);if(this.chart.getDataVisibility(t)?p=n.getPixelForValue(h+m):p=x,g=p-x,Math.abs(g)<a){g=Ru(g,n,l)*a,d===l&&(x-=g/2);let w=n.getPixelForDecimal(0),k=n.getPixelForDecimal(1),v=Math.min(w,k),_=Math.max(w,k);x=Math.max(Math.min(x,_),v),p=x+g,r&&!f&&(c._stacks[n.axis]._visualValues[s]=n.getValueForPixel(p)-n.getValueForPixel(x))}if(x===n.getPixelForValue(l)){let w=At(g)*n.getLineWidthForValue(l)/2;x+=w,g-=w}return{size:g,base:x,head:p,center:p+g/2}}_calculateBarIndexPixels(t,n){let r=n.scale,s=this.options,o=s.skipNull,a=z(s.maxBarThickness,1/0),l,c,u=this._getAxisCount();if(n.grouped){let f=o?this._getStackCount(t):n.stackCount,d=s.barThickness==="flex"?Lu(t,n,s,f*u):Iu(t,n,s,f*u),h=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,m=this._getAxis().indexOf(z(h,this.getFirstScaleIdForIndexAxis())),p=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0)+m;l=d.start+d.chunk*p+d.chunk/2,c=Math.min(a,d.chunk*d.ratio)}else l=r.getPixelForValue(this.getParsed(t)[r.axis],t),c=Math.min(a,n.min*n.ratio);return{base:l-c/2,head:l+c/2,center:l,size:c}}draw(){let t=this._cachedMeta,n=t.vScale,r=t.data,s=r.length,o=0;for(;o<s;++o)this.getParsed(o)[n.axis]!==null&&!r[o].hidden&&r[o].draw(this._ctx)}}return i})(),Bu=(()=>{class i extends ce{static id="bubble";static defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};static overrides={scales:{x:{type:"linear"},y:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,n,r,s){let o=super.parsePrimitiveData(t,n,r,s);for(let a=0;a<o.length;a++)o[a]._custom=this.resolveDataElementOptions(a+r).radius;return o}parseArrayData(t,n,r,s){let o=super.parseArrayData(t,n,r,s);for(let a=0;a<o.length;a++){let l=n[r+a];o[a]._custom=z(l[2],this.resolveDataElementOptions(a+r).radius)}return o}parseObjectData(t,n,r,s){let o=super.parseObjectData(t,n,r,s);for(let a=0;a<o.length;a++){let l=n[r+a];o[a]._custom=z(l&&l.r&&+l.r,this.resolveDataElementOptions(a+r).radius)}return o}getMaxOverflow(){let t=this._cachedMeta.data,n=0;for(let r=t.length-1;r>=0;--r)n=Math.max(n,t[r].size(this.resolveDataElementOptions(r))/2);return n>0&&n}getLabelAndValue(t){let n=this._cachedMeta,r=this.chart.data.labels||[],{xScale:s,yScale:o}=n,a=this.getParsed(t),l=s.getLabelForValue(a.x),c=o.getLabelForValue(a.y),u=a._custom;return{label:r[t]||"",value:"("+l+", "+c+(u?", "+u:"")+")"}}update(t){let n=this._cachedMeta.data;this.updateElements(n,0,n.length,t)}updateElements(t,n,r,s){let o=s==="reset",{iScale:a,vScale:l}=this._cachedMeta,{sharedOptions:c,includeOptions:u}=this._getSharedOptions(n,s),f=a.axis,d=l.axis;for(let h=n;h<n+r;h++){let m=t[h],p=!o&&this.getParsed(h),g={},b=g[f]=o?a.getPixelForDecimal(.5):a.getPixelForValue(p[f]),x=g[d]=o?l.getBasePixel():l.getPixelForValue(p[d]);g.skip=isNaN(b)||isNaN(x),u&&(g.options=c||this.resolveDataElementOptions(h,m.active?"active":s),o&&(g.options.radius=0)),this.updateElement(m,h,g,s)}}resolveDataElementOptions(t,n){let r=this.getParsed(t),s=super.resolveDataElementOptions(t,n);s.$shared&&(s=Object.assign({},s,{$shared:!1}));let o=s.radius;return n!=="active"&&(s.radius=0),s.radius+=z(r&&r._custom,o),s}}return i})();function Yu(i,e,t){let n=1,r=1,s=0,o=0;if(e<et){let a=i,l=a+e,c=Math.cos(a),u=Math.sin(a),f=Math.cos(l),d=Math.sin(l),h=(w,k,v)=>Fe(w,a,l,!0)?1:Math.max(k,k*t,v,v*t),m=(w,k,v)=>Fe(w,a,l,!0)?-1:Math.min(k,k*t,v,v*t),p=h(0,c,f),g=h(st,u,d),b=m($,c,f),x=m($+st,u,d);n=(p-b)/2,r=(g-x)/2,s=-(p+b)/2,o=-(g+x)/2}return{ratioX:n,ratioY:r,offsetX:s,offsetY:o}}var ps=(()=>{class i extends ce{static id="doughnut";static defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};static descriptors={_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){let n=t.data;if(n.labels.length&&n.datasets.length){let{labels:{pointStyle:r,color:s}}=t.legend.options;return n.labels.map((o,a)=>{let c=t.getDatasetMeta(0).controller.getStyle(a);return{text:o,fillStyle:c.backgroundColor,strokeStyle:c.borderColor,fontColor:s,lineWidth:c.borderWidth,pointStyle:r,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}}};constructor(t,n){super(t,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,n){let r=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=r;else{let o=c=>+r[c];if(V(r[t])){let{key:c="value"}=this._parsing;o=u=>+jt(r[u],c)}let a,l;for(a=t,l=t+n;a<l;++a)s._parsed[a]=o(a)}}_getRotation(){return Dt(this.options.rotation-90)}_getCircumference(){return Dt(this.options.circumference)}_getRotationExtents(){let t=et,n=-et;for(let r=0;r<this.chart.data.datasets.length;++r)if(this.chart.isDatasetVisible(r)&&this.chart.getDatasetMeta(r).type===this._type){let s=this.chart.getDatasetMeta(r).controller,o=s._getRotation(),a=s._getCircumference();t=Math.min(t,o),n=Math.max(n,o+a)}return{rotation:t,circumference:n-t}}update(t){let n=this.chart,{chartArea:r}=n,s=this._cachedMeta,o=s.data,a=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,l=Math.max((Math.min(r.width,r.height)-a)/2,0),c=Math.min(io(this.options.cutout,l),1),u=this._getRingWeight(this.index),{circumference:f,rotation:d}=this._getRotationExtents(),{ratioX:h,ratioY:m,offsetX:p,offsetY:g}=Yu(d,f,c),b=(r.width-a)/h,x=(r.height-a)/m,w=Math.max(Math.min(b,x)/2,0),k=cr(this.options.radius,w),v=Math.max(k*c,0),_=(k-v)/this._getVisibleDatasetWeightTotal();this.offsetX=p*k,this.offsetY=g*k,s.total=this.calculateTotal(),this.outerRadius=k-_*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-_*u,0),this.updateElements(o,0,o.length,t)}_circumference(t,n){let r=this.options,s=this._cachedMeta,o=this._getCircumference();return n&&r.animation.animateRotate||!this.chart.getDataVisibility(t)||s._parsed[t]===null||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*o/et)}updateElements(t,n,r,s){let o=s==="reset",a=this.chart,l=a.chartArea,u=a.options.animation,f=(l.left+l.right)/2,d=(l.top+l.bottom)/2,h=o&&u.animateScale,m=h?0:this.innerRadius,p=h?0:this.outerRadius,{sharedOptions:g,includeOptions:b}=this._getSharedOptions(n,s),x=this._getRotation(),w;for(w=0;w<n;++w)x+=this._circumference(w,o);for(w=n;w<n+r;++w){let k=this._circumference(w,o),v=t[w],_={x:f+this.offsetX,y:d+this.offsetY,startAngle:x,endAngle:x+k,circumference:k,outerRadius:p,innerRadius:m};b&&(_.options=g||this.resolveDataElementOptions(w,v.active?"active":s)),x+=k,this.updateElement(v,w,_,s)}}calculateTotal(){let t=this._cachedMeta,n=t.data,r=0,s;for(s=0;s<n.length;s++){let o=t._parsed[s];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(s)&&!n[s].hidden&&(r+=Math.abs(o))}return r}calculateCircumference(t){let n=this._cachedMeta.total;return n>0&&!isNaN(t)?et*(Math.abs(t)/n):0}getLabelAndValue(t){let n=this._cachedMeta,r=this.chart,s=r.data.labels||[],o=We(n._parsed[t],r.options.locale);return{label:s[t]||"",value:o}}getMaxBorderWidth(t){let n=0,r=this.chart,s,o,a,l,c;if(!t){for(s=0,o=r.data.datasets.length;s<o;++s)if(r.isDatasetVisible(s)){a=r.getDatasetMeta(s),t=a.data,l=a.controller;break}}if(!t)return 0;for(s=0,o=t.length;s<o;++s)c=l.resolveDataElementOptions(s),c.borderAlign!=="inner"&&(n=Math.max(n,c.borderWidth||0,c.hoverBorderWidth||0));return n}getMaxOffset(t){let n=0;for(let r=0,s=t.length;r<s;++r){let o=this.resolveDataElementOptions(r);n=Math.max(n,o.offset||0,o.hoverOffset||0)}return n}_getRingWeightOffset(t){let n=0;for(let r=0;r<t;++r)this.chart.isDatasetVisible(r)&&(n+=this._getRingWeight(r));return n}_getRingWeight(t){return Math.max(z(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}return i})(),Uu=(()=>{class i extends ce{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){let n=this._cachedMeta,{dataset:r,data:s=[],_dataset:o}=n,a=this.chart._animationsDisabled,{start:l,count:c}=vr(n,s,a);this._drawStart=l,this._drawCount=c,yr(n)&&(l=0,c=s.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!o._decimated,r.points=s;let u=this.resolveDatasetElementOptions(t);this.options.showLine||(u.borderWidth=0),u.segment=this.options.segment,this.updateElement(r,void 0,{animated:!a,options:u},t),this.updateElements(s,l,c,t)}updateElements(t,n,r,s){let o=s==="reset",{iScale:a,vScale:l,_stacked:c,_dataset:u}=this._cachedMeta,{sharedOptions:f,includeOptions:d}=this._getSharedOptions(n,s),h=a.axis,m=l.axis,{spanGaps:p,segment:g}=this.options,b=ge(p)?p:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||o||s==="none",w=n+r,k=t.length,v=n>0&&this.getParsed(n-1);for(let _=0;_<k;++_){let C=t[_],P=x?C:{};if(_<n||_>=w){P.skip=!0;continue}let O=this.getParsed(_),R=U(O[m]),W=P[h]=a.getPixelForValue(O[h],_),H=P[m]=o||R?l.getBasePixel():l.getPixelForValue(c?this.applyStack(l,O,c):O[m],_);P.skip=isNaN(W)||isNaN(H)||R,P.stop=_>0&&Math.abs(O[h]-v[h])>b,g&&(P.parsed=O,P.raw=u.data[_]),d&&(P.options=f||this.resolveDataElementOptions(_,C.active?"active":s)),x||this.updateElement(C,_,P,s),v=O}}getMaxOverflow(){let t=this._cachedMeta,n=t.dataset,r=n.options&&n.options.borderWidth||0,s=t.data||[];if(!s.length)return r;let o=s[0].size(this.resolveDataElementOptions(0)),a=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(r,o,a)/2}draw(){let t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}return i})(),La=(()=>{class i extends ce{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){let n=t.data;if(n.labels.length&&n.datasets.length){let{labels:{pointStyle:r,color:s}}=t.legend.options;return n.labels.map((o,a)=>{let c=t.getDatasetMeta(0).controller.getStyle(a);return{text:o,fillStyle:c.backgroundColor,strokeStyle:c.borderColor,fontColor:s,lineWidth:c.borderWidth,pointStyle:r,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){let n=this._cachedMeta,r=this.chart,s=r.data.labels||[],o=We(n._parsed[t].r,r.options.locale);return{label:s[t]||"",value:o}}parseObjectData(t,n,r,s){return Or.bind(this)(t,n,r,s)}update(t){let n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,t)}getMinMax(){let t=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((r,s)=>{let o=this.getParsed(s).r;!isNaN(o)&&this.chart.getDataVisibility(s)&&(o<n.min&&(n.min=o),o>n.max&&(n.max=o))}),n}_updateRadius(){let t=this.chart,n=t.chartArea,r=t.options,s=Math.min(n.right-n.left,n.bottom-n.top),o=Math.max(s/2,0),a=Math.max(r.cutoutPercentage?o/100*r.cutoutPercentage:1,0),l=(o-a)/t.getVisibleDatasetCount();this.outerRadius=o-l*this.index,this.innerRadius=this.outerRadius-l}updateElements(t,n,r,s){let o=s==="reset",a=this.chart,c=a.options.animation,u=this._cachedMeta.rScale,f=u.xCenter,d=u.yCenter,h=u.getIndexAngle(0)-.5*$,m=h,p,g=360/this.countVisibleElements();for(p=0;p<n;++p)m+=this._computeAngle(p,s,g);for(p=n;p<n+r;p++){let b=t[p],x=m,w=m+this._computeAngle(p,s,g),k=a.getDataVisibility(p)?u.getDistanceFromCenterForValue(this.getParsed(p).r):0;m=w,o&&(c.animateScale&&(k=0),c.animateRotate&&(x=w=h));let v={x:f,y:d,innerRadius:0,outerRadius:k,startAngle:x,endAngle:w,options:this.resolveDataElementOptions(p,b.active?"active":s)};this.updateElement(b,p,v,s)}}countVisibleElements(){let t=this._cachedMeta,n=0;return t.data.forEach((r,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&n++}),n}_computeAngle(t,n,r){return this.chart.getDataVisibility(t)?Dt(this.resolveDataElementOptions(t,n).angle||r):0}}return i})(),Vu=(()=>{class i extends ps{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}}return i})(),ju=(()=>{class i extends ce{static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};getLabelAndValue(t){let n=this._cachedMeta.vScale,r=this.getParsed(t);return{label:n.getLabels()[t],value:""+n.getLabelForValue(r[n.axis])}}parseObjectData(t,n,r,s){return Or.bind(this)(t,n,r,s)}update(t){let n=this._cachedMeta,r=n.dataset,s=n.data||[],o=n.iScale.getLabels();if(r.points=s,t!=="resize"){let a=this.resolveDatasetElementOptions(t);this.options.showLine||(a.borderWidth=0);let l={_loop:!0,_fullLoop:o.length===s.length,options:a};this.updateElement(r,void 0,l,t)}this.updateElements(s,0,s.length,t)}updateElements(t,n,r,s){let o=this._cachedMeta.rScale,a=s==="reset";for(let l=n;l<n+r;l++){let c=t[l],u=this.resolveDataElementOptions(l,c.active?"active":s),f=o.getPointPositionForValue(l,this.getParsed(l).r),d=a?o.xCenter:f.x,h=a?o.yCenter:f.y,m={x:d,y:h,angle:f.angle,skip:isNaN(d)||isNaN(h),options:u};this.updateElement(c,l,m,s)}}}return i})(),qu=(()=>{class i extends ce{static id="scatter";static defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};static overrides={interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}};getLabelAndValue(t){let n=this._cachedMeta,r=this.chart.data.labels||[],{xScale:s,yScale:o}=n,a=this.getParsed(t),l=s.getLabelForValue(a.x),c=o.getLabelForValue(a.y);return{label:r[t]||"",value:"("+l+", "+c+")"}}update(t){let n=this._cachedMeta,{data:r=[]}=n,s=this.chart._animationsDisabled,{start:o,count:a}=vr(n,r,s);if(this._drawStart=o,this._drawCount=a,yr(n)&&(o=0,a=r.length),this.options.showLine){this.datasetElementType||this.addElements();let{dataset:l,_dataset:c}=n;l._chart=this.chart,l._datasetIndex=this.index,l._decimated=!!c._decimated,l.points=r;let u=this.resolveDatasetElementOptions(t);u.segment=this.options.segment,this.updateElement(l,void 0,{animated:!s,options:u},t)}else this.datasetElementType&&(delete n.dataset,this.datasetElementType=!1);this.updateElements(r,o,a,t)}addElements(){let{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,n,r,s){let o=s==="reset",{iScale:a,vScale:l,_stacked:c,_dataset:u}=this._cachedMeta,f=this.resolveDataElementOptions(n,s),d=this.getSharedOptions(f),h=this.includeOptions(s,d),m=a.axis,p=l.axis,{spanGaps:g,segment:b}=this.options,x=ge(g)?g:Number.POSITIVE_INFINITY,w=this.chart._animationsDisabled||o||s==="none",k=n>0&&this.getParsed(n-1);for(let v=n;v<n+r;++v){let _=t[v],C=this.getParsed(v),P=w?_:{},O=U(C[p]),R=P[m]=a.getPixelForValue(C[m],v),W=P[p]=o||O?l.getBasePixel():l.getPixelForValue(c?this.applyStack(l,C,c):C[p],v);P.skip=isNaN(R)||isNaN(W)||O,P.stop=v>0&&Math.abs(C[m]-k[m])>x,b&&(P.parsed=C,P.raw=u.data[v]),h&&(P.options=d||this.resolveDataElementOptions(v,_.active?"active":s)),w||this.updateElement(_,v,P,s),k=C}this.updateSharedOptions(d,s,f)}getMaxOverflow(){let t=this._cachedMeta,n=t.data||[];if(!this.options.showLine){let l=0;for(let c=n.length-1;c>=0;--c)l=Math.max(l,n[c].size(this.resolveDataElementOptions(c))/2);return l>0&&l}let r=t.dataset,s=r.options&&r.options.borderWidth||0;if(!n.length)return s;let o=n[0].size(this.resolveDataElementOptions(0)),a=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(s,o,a)/2}}return i})(),$u=Object.freeze({__proto__:null,BarController:Hu,BubbleController:Bu,DoughnutController:ps,LineController:Uu,PieController:Vu,PolarAreaController:La,RadarController:ju,ScatterController:qu});function xe(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}var Gr=class i{static override(e){Object.assign(i.prototype,e)}options;constructor(e){this.options=e||{}}init(){}formats(){return xe()}parse(){return xe()}format(){return xe()}add(){return xe()}diff(){return xe()}startOf(){return xe()}endOf(){return xe()}},gs={_date:Gr};function Xu(i,e,t,n){let{controller:r,data:s,_sorted:o}=i,a=r._cachedMeta.iScale,l=i.dataset&&i.dataset.options?i.dataset.options.spanGaps:null;if(a&&e===a.axis&&e!=="r"&&o&&s.length){let c=a._reversePixels?lo:Et;if(n){if(r._sharedOptions){let u=s[0],f=typeof u.getRange=="function"&&u.getRange(e);if(f){let d=c(s,e,t-f),h=c(s,e,t+f);return{lo:d.lo,hi:h.hi}}}}else{let u=c(s,e,t);if(l){let{vScale:f}=r._cachedMeta,{_parsed:d}=i,h=d.slice(0,u.lo+1).reverse().findIndex(p=>!U(p[f.axis]));u.lo-=Math.max(0,h);let m=d.slice(u.hi).findIndex(p=>!U(p[f.axis]));u.hi+=Math.max(0,m)}return u}}return{lo:0,hi:s.length-1}}function xi(i,e,t,n,r){let s=i.getSortedVisibleDatasetMetas(),o=t[e];for(let a=0,l=s.length;a<l;++a){let{index:c,data:u}=s[a],{lo:f,hi:d}=Xu(s[a],e,o,r);for(let h=f;h<=d;++h){let m=u[h];m.skip||n(m,c,h)}}}function Qu(i){let e=i.indexOf("x")!==-1,t=i.indexOf("y")!==-1;return function(n,r){let s=e?Math.abs(n.x-r.x):0,o=t?Math.abs(n.y-r.y):0;return Math.sqrt(Math.pow(s,2)+Math.pow(o,2))}}function Br(i,e,t,n,r){let s=[];return!r&&!i.isPointInArea(e)||xi(i,t,e,function(a,l,c){!r&&!Rt(a,i.chartArea,0)||a.inRange(e.x,e.y,n)&&s.push({element:a,datasetIndex:l,index:c})},!0),s}function Gu(i,e,t,n){let r=[];function s(o,a,l){let{startAngle:c,endAngle:u}=o.getProps(["startAngle","endAngle"],n),{angle:f}=mr(o,{x:e.x,y:e.y});Fe(f,c,u)&&r.push({element:o,datasetIndex:a,index:l})}return xi(i,t,e,s),r}function Ku(i,e,t,n,r,s){let o=[],a=Qu(t),l=Number.POSITIVE_INFINITY;function c(u,f,d){let h=u.inRange(e.x,e.y,r);if(n&&!h)return;let m=u.getCenterPoint(r);if(!(!!s||i.isPointInArea(m))&&!h)return;let g=a(e,m);g<l?(o=[{element:u,datasetIndex:f,index:d}],l=g):g===l&&o.push({element:u,datasetIndex:f,index:d})}return xi(i,t,e,c),o}function Yr(i,e,t,n,r,s){return!s&&!i.isPointInArea(e)?[]:t==="r"&&!n?Gu(i,e,t,r):Ku(i,e,t,n,r,s)}function Ho(i,e,t,n,r){let s=[],o=t==="x"?"inXRange":"inYRange",a=!1;return xi(i,t,e,(l,c,u)=>{l[o]&&l[o](e[t],r)&&(s.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(e.x,e.y,r))}),n&&!a?[]:s}var Zu={evaluateInteractionItems:xi,modes:{index(i,e,t,n){let r=ae(e,i),s=t.axis||"x",o=t.includeInvisible||!1,a=t.intersect?Br(i,r,s,n,o):Yr(i,r,s,!1,n,o),l=[];return a.length?(i.getSortedVisibleDatasetMetas().forEach(c=>{let u=a[0].index,f=c.data[u];f&&!f.skip&&l.push({element:f,datasetIndex:c.index,index:u})}),l):[]},dataset(i,e,t,n){let r=ae(e,i),s=t.axis||"xy",o=t.includeInvisible||!1,a=t.intersect?Br(i,r,s,n,o):Yr(i,r,s,!1,n,o);if(a.length>0){let l=a[0].datasetIndex,c=i.getDatasetMeta(l).data;a=[];for(let u=0;u<c.length;++u)a.push({element:c[u],datasetIndex:l,index:u})}return a},point(i,e,t,n){let r=ae(e,i),s=t.axis||"xy",o=t.includeInvisible||!1;return Br(i,r,s,n,o)},nearest(i,e,t,n){let r=ae(e,i),s=t.axis||"xy",o=t.includeInvisible||!1;return Yr(i,r,s,t.intersect,n,o)},x(i,e,t,n){let r=ae(e,i);return Ho(i,r,"x",t.intersect,n)},y(i,e,t,n){let r=ae(e,i);return Ho(i,r,"y",t.intersect,n)}}},Ea=["left","top","right","bottom"];function ci(i,e){return i.filter(t=>t.pos===e)}function Bo(i,e){return i.filter(t=>Ea.indexOf(t.pos)===-1&&t.box.axis===e)}function ui(i,e){return i.sort((t,n)=>{let r=e?n:t,s=e?t:n;return r.weight===s.weight?r.index-s.index:r.weight-s.weight})}function Ju(i){let e=[],t,n,r,s,o,a;for(t=0,n=(i||[]).length;t<n;++t)r=i[t],{position:s,options:{stack:o,stackWeight:a=1}}=r,e.push({index:t,box:r,pos:s,horizontal:r.isHorizontal(),weight:r.weight,stack:o&&s+o,stackWeight:a});return e}function tf(i){let e={};for(let t of i){let{stack:n,pos:r,stackWeight:s}=t;if(!n||!Ea.includes(r))continue;let o=e[n]||(e[n]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=s}return e}function ef(i,e){let t=tf(i),{vBoxMaxWidth:n,hBoxMaxHeight:r}=e,s,o,a;for(s=0,o=i.length;s<o;++s){a=i[s];let{fullSize:l}=a.box,c=t[a.stack],u=c&&a.stackWeight/c.weight;a.horizontal?(a.width=u?u*n:l&&e.availableWidth,a.height=r):(a.width=n,a.height=u?u*r:l&&e.availableHeight)}return t}function nf(i){let e=Ju(i),t=ui(e.filter(c=>c.box.fullSize),!0),n=ui(ci(e,"left"),!0),r=ui(ci(e,"right")),s=ui(ci(e,"top"),!0),o=ui(ci(e,"bottom")),a=Bo(e,"x"),l=Bo(e,"y");return{fullSize:t,leftAndTop:n.concat(s),rightAndBottom:r.concat(l).concat(o).concat(a),chartArea:ci(e,"chartArea"),vertical:n.concat(r).concat(l),horizontal:s.concat(o).concat(a)}}function Yo(i,e,t,n){return Math.max(i[t],e[t])+Math.max(i[n],e[n])}function Ra(i,e){i.top=Math.max(i.top,e.top),i.left=Math.max(i.left,e.left),i.bottom=Math.max(i.bottom,e.bottom),i.right=Math.max(i.right,e.right)}function rf(i,e,t,n){let{pos:r,box:s}=t,o=i.maxPadding;if(!V(r)){t.size&&(i[r]-=t.size);let f=n[t.stack]||{size:0,count:1};f.size=Math.max(f.size,t.horizontal?s.height:s.width),t.size=f.size/f.count,i[r]+=t.size}s.getPadding&&Ra(o,s.getPadding());let a=Math.max(0,e.outerWidth-Yo(o,i,"left","right")),l=Math.max(0,e.outerHeight-Yo(o,i,"top","bottom")),c=a!==i.w,u=l!==i.h;return i.w=a,i.h=l,t.horizontal?{same:c,other:u}:{same:u,other:c}}function sf(i){let e=i.maxPadding;function t(n){let r=Math.max(e[n]-i[n],0);return i[n]+=r,r}i.y+=t("top"),i.x+=t("left"),t("right"),t("bottom")}function of(i,e){let t=e.maxPadding;function n(r){let s={left:0,top:0,right:0,bottom:0};return r.forEach(o=>{s[o]=Math.max(e[o],t[o])}),s}return n(i?["left","right"]:["top","bottom"])}function hi(i,e,t,n){let r=[],s,o,a,l,c,u;for(s=0,o=i.length,c=0;s<o;++s){a=i[s],l=a.box,l.update(a.width||e.w,a.height||e.h,of(a.horizontal,e));let{same:f,other:d}=rf(e,t,a,n);c|=f&&r.length,u=u||d,l.fullSize||r.push(a)}return c&&hi(r,e,t,n)||u}function tn(i,e,t,n,r){i.top=t,i.left=e,i.right=e+n,i.bottom=t+r,i.width=n,i.height=r}function Uo(i,e,t,n){let r=t.padding,{x:s,y:o}=e;for(let a of i){let l=a.box,c=n[a.stack]||{count:1,placed:0,weight:1},u=a.stackWeight/c.weight||1;if(a.horizontal){let f=e.w*u,d=c.size||l.height;Ee(c.start)&&(o=c.start),l.fullSize?tn(l,r.left,o,t.outerWidth-r.right-r.left,d):tn(l,e.left+c.placed,o,f,d),c.start=o,c.placed+=f,o=l.bottom}else{let f=e.h*u,d=c.size||l.width;Ee(c.start)&&(s=c.start),l.fullSize?tn(l,s,r.top,d,t.outerHeight-r.bottom-r.top):tn(l,s,e.top+c.placed,d,f),c.start=s,c.placed+=f,s=l.right}}e.x=s,e.y=o}var mt={addBox(i,e){i.boxes||(i.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(t){e.draw(t)}}]},i.boxes.push(e)},removeBox(i,e){let t=i.boxes?i.boxes.indexOf(e):-1;t!==-1&&i.boxes.splice(t,1)},configure(i,e,t){e.fullSize=t.fullSize,e.position=t.position,e.weight=t.weight},update(i,e,t,n){if(!i)return;let r=ht(i.options.layout.padding),s=Math.max(e-r.width,0),o=Math.max(t-r.height,0),a=nf(i.boxes),l=a.vertical,c=a.horizontal;Q(i.boxes,p=>{typeof p.beforeLayout=="function"&&p.beforeLayout()});let u=l.reduce((p,g)=>g.box.options&&g.box.options.display===!1?p:p+1,0)||1,f=Object.freeze({outerWidth:e,outerHeight:t,padding:r,availableWidth:s,availableHeight:o,vBoxMaxWidth:s/2/u,hBoxMaxHeight:o/2}),d=Object.assign({},r);Ra(d,ht(n));let h=Object.assign({maxPadding:d,w:s,h:o,x:r.left,y:r.top},r),m=ef(l.concat(c),f);hi(a.fullSize,h,f,m),hi(l,h,f,m),hi(c,h,f,m)&&hi(l,h,f,m),sf(h),Uo(a.leftAndTop,h,f,m),h.x+=h.w,h.y+=h.h,Uo(a.rightAndBottom,h,f,m),i.chartArea={left:h.left,top:h.top,right:h.left+h.w,bottom:h.top+h.h,height:h.h,width:h.w},Q(a.chartArea,p=>{let g=p.box;Object.assign(g,i.chartArea),g.update(h.w,h.h,{left:0,top:0,right:0,bottom:0})})}},un=class{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,n){}removeEventListener(e,t,n){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,n,r){return t=Math.max(0,t||e.width),n=n||e.height,{width:t,height:Math.max(0,r?Math.floor(t/r):n)}}isAttached(e){return!0}updateConfig(e){}},Kr=class extends un{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}},an="$chartjs",af={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Vo=i=>i===null||i==="";function lf(i,e){let t=i.style,n=i.getAttribute("height"),r=i.getAttribute("width");if(i[an]={initial:{height:n,width:r,style:{display:t.display,height:t.height,width:t.width}}},t.display=t.display||"block",t.boxSizing=t.boxSizing||"border-box",Vo(r)){let s=Ar(i,"width");s!==void 0&&(i.width=s)}if(Vo(n))if(i.style.height==="")i.height=i.width/(e||2);else{let s=Ar(i,"height");s!==void 0&&(i.height=s)}return i}var Fa=Do?{passive:!0}:!1;function cf(i,e,t){i&&i.addEventListener(e,t,Fa)}function uf(i,e,t){i&&i.canvas&&i.canvas.removeEventListener(e,t,Fa)}function ff(i,e){let t=af[i.type]||i.type,{x:n,y:r}=ae(i,e);return{type:t,chart:e,native:i,x:n!==void 0?n:null,y:r!==void 0?r:null}}function fn(i,e){for(let t of i)if(t===e||t.contains(e))return!0}function df(i,e,t){let n=i.canvas,r=new MutationObserver(s=>{let o=!1;for(let a of s)o=o||fn(a.addedNodes,n),o=o&&!fn(a.removedNodes,n);o&&t()});return r.observe(document,{childList:!0,subtree:!0}),r}function hf(i,e,t){let n=i.canvas,r=new MutationObserver(s=>{let o=!1;for(let a of s)o=o||fn(a.removedNodes,n),o=o&&!fn(a.addedNodes,n);o&&t()});return r.observe(document,{childList:!0,subtree:!0}),r}var pi=new Map,jo=0;function Wa(){let i=window.devicePixelRatio;i!==jo&&(jo=i,pi.forEach((e,t)=>{t.currentDevicePixelRatio!==i&&e()}))}function mf(i,e){pi.size||window.addEventListener("resize",Wa),pi.set(i,e)}function pf(i){pi.delete(i),pi.size||window.removeEventListener("resize",Wa)}function gf(i,e,t){let n=i.canvas,r=n&&Zi(n);if(!r)return;let s=xr((a,l)=>{let c=r.clientWidth;t(a,l),c<r.clientWidth&&t()},window),o=new ResizeObserver(a=>{let l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||s(c,u)});return o.observe(r),mf(i,s),o}function Ur(i,e,t){t&&t.disconnect(),e==="resize"&&pf(i)}function bf(i,e,t){let n=i.canvas,r=xr(s=>{i.ctx!==null&&t(ff(s,i))},i);return cf(n,e,r),r}var Zr=class extends un{acquireContext(e,t){let n=e&&e.getContext&&e.getContext("2d");return n&&n.canvas===e?(lf(e,t),n):null}releaseContext(e){let t=e.canvas;if(!t[an])return!1;let n=t[an].initial;["height","width"].forEach(s=>{let o=n[s];U(o)?t.removeAttribute(s):t.setAttribute(s,o)});let r=n.style||{};return Object.keys(r).forEach(s=>{t.style[s]=r[s]}),t.width=t.width,delete t[an],!0}addEventListener(e,t,n){this.removeEventListener(e,t);let r=e.$proxies||(e.$proxies={}),o={attach:df,detach:hf,resize:gf}[t]||bf;r[t]=o(e,t,n)}removeEventListener(e,t){let n=e.$proxies||(e.$proxies={}),r=n[t];if(!r)return;({attach:Ur,detach:Ur,resize:Ur}[t]||uf)(e,t,r),n[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,n,r){return To(e,t,n,r)}isAttached(e){let t=e&&Zi(e);return!!(t&&t.isConnected)}};function xf(i){return!Ki()||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas?Kr:Zr}var It=class{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(e){let{x:t,y:n}=this.getProps(["x","y"],e);return{x:t,y:n}}hasValue(){return ge(this.x)&&ge(this.y)}getProps(e,t){let n=this.$animations;if(!t||!n)return this;let r={};return e.forEach(s=>{r[s]=n[s]&&n[s].active()?n[s]._to:this[s]}),r}};function vf(i,e){let t=i.options.ticks,n=yf(i),r=Math.min(t.maxTicksLimit||n,n),s=t.major.enabled?wf(e):[],o=s.length,a=s[0],l=s[o-1],c=[];if(o>r)return Mf(e,c,s,o/r),c;let u=_f(s,e,r);if(o>0){let f,d,h=o>1?Math.round((l-a)/(o-1)):null;for(en(e,c,u,U(h)?0:a-h,a),f=0,d=o-1;f<d;f++)en(e,c,u,s[f],s[f+1]);return en(e,c,u,l,U(h)?e.length:l+h),c}return en(e,c,u),c}function yf(i){let e=i.options.offset,t=i._tickSize(),n=i._length/t+(e?0:1),r=i._maxLength/t;return Math.floor(Math.min(n,r))}function _f(i,e,t){let n=kf(i),r=e.length/t;if(!n)return Math.max(r,1);let s=so(n);for(let o=0,a=s.length-1;o<a;o++){let l=s[o];if(l>r)return l}return Math.max(r,1)}function wf(i){let e=[],t,n;for(t=0,n=i.length;t<n;t++)i[t].major&&e.push(t);return e}function Mf(i,e,t,n){let r=0,s=t[0],o;for(n=Math.ceil(n),o=0;o<i.length;o++)o===s&&(e.push(i[o]),r++,s=t[r*n])}function en(i,e,t,n,r){let s=z(n,0),o=Math.min(z(r,i.length),i.length),a=0,l,c,u;for(t=Math.ceil(t),r&&(l=r-n,t=l/Math.floor(l/t)),u=s;u<0;)a++,u=Math.round(s+a*t);for(c=Math.max(s,0);c<o;c++)c===u&&(e.push(i[c]),a++,u=Math.round(s+a*t))}function kf(i){let e=i.length,t,n;if(e<2)return!1;for(n=i[0],t=1;t<e;++t)if(i[t]-i[t-1]!==n)return!1;return n}var Tf=i=>i==="left"?"right":i==="right"?"left":i,qo=(i,e,t)=>e==="top"||e==="left"?i[e]+t:i[e]-t,$o=(i,e)=>Math.min(e||i,i);function Xo(i,e){let t=[],n=i.length/e,r=i.length,s=0;for(;s<r;s+=n)t.push(i[Math.floor(s)]);return t}function Df(i,e,t){let n=i.ticks.length,r=Math.min(e,n-1),s=i._startPixel,o=i._endPixel,a=1e-6,l=i.getPixelForTick(r),c;if(!(t&&(n===1?c=Math.max(l-s,o-l):e===0?c=(i.getPixelForTick(1)-l)/2:c=(l-i.getPixelForTick(r-1))/2,l+=r<e?c:-c,l<s-a||l>o+a)))return l}function Pf(i,e){Q(i,t=>{let n=t.gc,r=n.length/2,s;if(r>e){for(s=0;s<r;++s)delete t.data[n[s]];n.splice(0,r)}})}function fi(i){return i.drawTicks?i.tickLength:0}function Qo(i,e){if(!i.display)return 0;let t=ot(i.font,e),n=ht(i.padding);return(tt(i.text)?i.text.length:1)*t.lineHeight+n.height}function Cf(i,e){return qt(i,{scale:e,type:"scale"})}function Of(i,e,t){return qt(i,{tick:t,index:e,type:"tick"})}function Sf(i,e,t){let n=qi(i);return(t&&e!=="right"||!t&&e==="right")&&(n=Tf(n)),n}function Af(i,e,t,n){let{top:r,left:s,bottom:o,right:a,chart:l}=i,{chartArea:c,scales:u}=l,f=0,d,h,m,p=o-r,g=a-s;if(i.isHorizontal()){if(h=dt(n,s,a),V(t)){let b=Object.keys(t)[0],x=t[b];m=u[b].getPixelForValue(x)+p-e}else t==="center"?m=(c.bottom+c.top)/2+p-e:m=qo(i,t,e);d=a-s}else{if(V(t)){let b=Object.keys(t)[0],x=t[b];h=u[b].getPixelForValue(x)-g+e}else t==="center"?h=(c.left+c.right)/2-g+e:h=qo(i,t,e);m=dt(n,o,r),f=t==="left"?-st:st}return{titleX:h,titleY:m,maxWidth:d,rotation:f}}var ye=class i extends It{constructor(e){super(),this.id=e.id,this.type=e.type,this.options=void 0,this.ctx=e.ctx,this.chart=e.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(e){this.options=e.setContext(this.getContext()),this.axis=e.axis,this._userMin=this.parse(e.min),this._userMax=this.parse(e.max),this._suggestedMin=this.parse(e.suggestedMin),this._suggestedMax=this.parse(e.suggestedMax)}parse(e,t){return e}getUserBounds(){let{_userMin:e,_userMax:t,_suggestedMin:n,_suggestedMax:r}=this;return e=bt(e,Number.POSITIVE_INFINITY),t=bt(t,Number.NEGATIVE_INFINITY),n=bt(n,Number.POSITIVE_INFINITY),r=bt(r,Number.NEGATIVE_INFINITY),{min:bt(e,n),max:bt(t,r),minDefined:rt(e),maxDefined:rt(t)}}getMinMax(e){let{min:t,max:n,minDefined:r,maxDefined:s}=this.getUserBounds(),o;if(r&&s)return{min:t,max:n};let a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)o=a[l].controller.getMinMax(this,e),r||(t=Math.min(t,o.min)),s||(n=Math.max(n,o.max));return t=s&&t>n?n:t,n=r&&t>n?t:n,{min:bt(t,bt(n,t)),max:bt(n,bt(t,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){let e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Z(this.options.beforeUpdate,[this])}update(e,t,n){let{beginAtZero:r,grace:s,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=vo(this,s,r),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let l=a<this.ticks.length;this._convertTicksToLabels(l?Xo(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=vf(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let e=this.options.reverse,t,n;this.isHorizontal()?(t=this.left,n=this.right):(t=this.top,n=this.bottom,e=!e),this._startPixel=t,this._endPixel=n,this._reversePixels=e,this._length=n-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Z(this.options.afterUpdate,[this])}beforeSetDimensions(){Z(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(){Z(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),Z(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Z(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){let t=this.options.ticks,n,r,s;for(n=0,r=e.length;n<r;n++)s=e[n],s.label=Z(t.callback,[s.value,n,e],this)}afterTickToLabelConversion(){Z(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Z(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){let e=this.options,t=e.ticks,n=$o(this.ticks.length,e.ticks.maxTicksLimit),r=t.minRotation||0,s=t.maxRotation,o=r,a,l,c;if(!this._isVisible()||!t.display||r>=s||n<=1||!this.isHorizontal()){this.labelRotation=r;return}let u=this._getLabelSizes(),f=u.widest.width,d=u.highest.height,h=lt(this.chart.width-f,0,this.maxWidth);a=e.offset?this.maxWidth/n:h/(n-1),f+6>a&&(a=h/(n-(e.offset?.5:1)),l=this.maxHeight-fi(e.grid)-t.padding-Qo(e.title,this.chart.options.font),c=Math.sqrt(f*f+d*d),o=Vi(Math.min(Math.asin(lt((u.highest.height+6)/a,-1,1)),Math.asin(lt(l/c,-1,1))-Math.asin(lt(d/c,-1,1)))),o=Math.max(r,Math.min(s,o))),this.labelRotation=o}afterCalculateLabelRotation(){Z(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Z(this.options.beforeFit,[this])}fit(){let e={width:0,height:0},{chart:t,options:{ticks:n,title:r,grid:s}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){let l=Qo(r,t.options.font);if(a?(e.width=this.maxWidth,e.height=fi(s)+l):(e.height=this.maxHeight,e.width=fi(s)+l),n.display&&this.ticks.length){let{first:c,last:u,widest:f,highest:d}=this._getLabelSizes(),h=n.padding*2,m=Dt(this.labelRotation),p=Math.cos(m),g=Math.sin(m);if(a){let b=n.mirror?0:g*f.width+p*d.height;e.height=Math.min(this.maxHeight,e.height+b+h)}else{let b=n.mirror?0:p*f.width+g*d.height;e.width=Math.min(this.maxWidth,e.width+b+h)}this._calculatePadding(c,u,g,p)}}this._handleMargins(),a?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,n,r){let{ticks:{align:s,padding:o},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){let u=this.getPixelForTick(0)-this.left,f=this.right-this.getPixelForTick(this.ticks.length-1),d=0,h=0;l?c?(d=r*e.width,h=n*t.height):(d=n*e.height,h=r*t.width):s==="start"?h=t.width:s==="end"?d=e.width:s!=="inner"&&(d=e.width/2,h=t.width/2),this.paddingLeft=Math.max((d-u+o)*this.width/(this.width-u),0),this.paddingRight=Math.max((h-f+o)*this.width/(this.width-f),0)}else{let u=t.height/2,f=e.height/2;s==="start"?(u=0,f=e.height):s==="end"&&(u=t.height,f=0),this.paddingTop=u+o,this.paddingBottom=f+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Z(this.options.afterFit,[this])}isHorizontal(){let{axis:e,position:t}=this.options;return t==="top"||t==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let t,n;for(t=0,n=e.length;t<n;t++)U(e[t].label)&&(e.splice(t,1),n--,t--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){let t=this.options.ticks.sampleSize,n=this.ticks;t<n.length&&(n=Xo(n,t)),this._labelSizes=e=this._computeLabelSizes(n,n.length,this.options.ticks.maxTicksLimit)}return e}_computeLabelSizes(e,t,n){let{ctx:r,_longestTextCache:s}=this,o=[],a=[],l=Math.floor(t/$o(t,n)),c=0,u=0,f,d,h,m,p,g,b,x,w,k,v;for(f=0;f<t;f+=l){if(m=e[f].label,p=this._resolveTickFontOptions(f),r.font=g=p.string,b=s[g]=s[g]||{data:{},gc:[]},x=p.lineHeight,w=k=0,!U(m)&&!tt(m))w=ni(r,b.data,b.gc,w,m),k=x;else if(tt(m))for(d=0,h=m.length;d<h;++d)v=m[d],!U(v)&&!tt(v)&&(w=ni(r,b.data,b.gc,w,v),k+=x);o.push(w),a.push(k),c=Math.max(w,c),u=Math.max(k,u)}Pf(s,t);let _=o.indexOf(c),C=a.indexOf(u),P=O=>({width:o[O]||0,height:a[O]||0});return{first:P(0),last:P(t-1),widest:P(_),highest:P(C),widths:o,heights:a}}getLabelForValue(e){return e}getPixelForValue(e,t){return NaN}getValueForPixel(e){}getPixelForTick(e){let t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);let t=this._startPixel+e*this._length;return ao(this._alignToPixels?re(this.chart,t,0):t)}getDecimalForPixel(e){let t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){let{min:e,max:t}=this;return e<0&&t<0?t:e>0&&t>0?e:0}getContext(e){let t=this.ticks||[];if(e>=0&&e<t.length){let n=t[e];return n.$context||(n.$context=Of(this.getContext(),e,n))}return this.$context||(this.$context=Cf(this.chart.getContext(),this))}_tickSize(){let e=this.options.ticks,t=Dt(this.labelRotation),n=Math.abs(Math.cos(t)),r=Math.abs(Math.sin(t)),s=this._getLabelSizes(),o=e.autoSkipPadding||0,a=s?s.widest.width+o:0,l=s?s.highest.height+o:0;return this.isHorizontal()?l*n>a*r?a/n:l/r:l*r<a*n?l/n:a/r}_isVisible(){let e=this.options.display;return e!=="auto"?!!e:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(e){let t=this.axis,n=this.chart,r=this.options,{grid:s,position:o,border:a}=r,l=s.offset,c=this.isHorizontal(),f=this.ticks.length+(l?1:0),d=fi(s),h=[],m=a.setContext(this.getContext()),p=m.display?m.width:0,g=p/2,b=function(Y){return re(n,Y,p)},x,w,k,v,_,C,P,O,R,W,H,nt;if(o==="top")x=b(this.bottom),C=this.bottom-d,O=x-g,W=b(e.top)+g,nt=e.bottom;else if(o==="bottom")x=b(this.top),W=e.top,nt=b(e.bottom)-g,C=x+g,O=this.top+d;else if(o==="left")x=b(this.right),_=this.right-d,P=x-g,R=b(e.left)+g,H=e.right;else if(o==="right")x=b(this.left),R=e.left,H=b(e.right)-g,_=x+g,P=this.left+d;else if(t==="x"){if(o==="center")x=b((e.top+e.bottom)/2+.5);else if(V(o)){let Y=Object.keys(o)[0],G=o[Y];x=b(this.chart.scales[Y].getPixelForValue(G))}W=e.top,nt=e.bottom,C=x+g,O=C+d}else if(t==="y"){if(o==="center")x=b((e.left+e.right)/2);else if(V(o)){let Y=Object.keys(o)[0],G=o[Y];x=b(this.chart.scales[Y].getPixelForValue(G))}_=x-g,P=_-d,R=e.left,H=e.right}let ut=z(r.ticks.maxTicksLimit,f),N=Math.max(1,Math.ceil(f/ut));for(w=0;w<f;w+=N){let Y=this.getContext(w),G=s.setContext(Y),yt=a.setContext(Y),at=G.lineWidth,Gt=G.color,Kt=yt.dash||[],wt=yt.dashOffset,Zt=G.tickWidth,Mt=G.tickColor,Jt=G.tickBorderDash||[],Lt=G.tickBorderDashOffset;k=Df(this,w,l),k!==void 0&&(v=re(n,k,at),c?_=P=R=H=v:C=O=W=nt=v,h.push({tx1:_,ty1:C,tx2:P,ty2:O,x1:R,y1:W,x2:H,y2:nt,width:at,color:Gt,borderDash:Kt,borderDashOffset:wt,tickWidth:Zt,tickColor:Mt,tickBorderDash:Jt,tickBorderDashOffset:Lt}))}return this._ticksLength=f,this._borderValue=x,h}_computeLabelItems(e){let t=this.axis,n=this.options,{position:r,ticks:s}=n,o=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:u,mirror:f}=s,d=fi(n.grid),h=d+u,m=f?-u:h,p=-Dt(this.labelRotation),g=[],b,x,w,k,v,_,C,P,O,R,W,H,nt="middle";if(r==="top")_=this.bottom-m,C=this._getXAxisLabelAlignment();else if(r==="bottom")_=this.top+m,C=this._getXAxisLabelAlignment();else if(r==="left"){let N=this._getYAxisLabelAlignment(d);C=N.textAlign,v=N.x}else if(r==="right"){let N=this._getYAxisLabelAlignment(d);C=N.textAlign,v=N.x}else if(t==="x"){if(r==="center")_=(e.top+e.bottom)/2+h;else if(V(r)){let N=Object.keys(r)[0],Y=r[N];_=this.chart.scales[N].getPixelForValue(Y)+h}C=this._getXAxisLabelAlignment()}else if(t==="y"){if(r==="center")v=(e.left+e.right)/2-h;else if(V(r)){let N=Object.keys(r)[0],Y=r[N];v=this.chart.scales[N].getPixelForValue(Y)}C=this._getYAxisLabelAlignment(d).textAlign}t==="y"&&(l==="start"?nt="top":l==="end"&&(nt="bottom"));let ut=this._getLabelSizes();for(b=0,x=a.length;b<x;++b){w=a[b],k=w.label;let N=s.setContext(this.getContext(b));P=this.getPixelForTick(b)+s.labelOffset,O=this._resolveTickFontOptions(b),R=O.lineHeight,W=tt(k)?k.length:1;let Y=W/2,G=N.color,yt=N.textStrokeColor,at=N.textStrokeWidth,Gt=C;o?(v=P,C==="inner"&&(b===x-1?Gt=this.options.reverse?"left":"right":b===0?Gt=this.options.reverse?"right":"left":Gt="center"),r==="top"?c==="near"||p!==0?H=-W*R+R/2:c==="center"?H=-ut.highest.height/2-Y*R+R:H=-ut.highest.height+R/2:c==="near"||p!==0?H=R/2:c==="center"?H=ut.highest.height/2-Y*R:H=ut.highest.height-W*R,f&&(H*=-1),p!==0&&!N.showLabelBackdrop&&(v+=R/2*Math.sin(p))):(_=P,H=(1-W)*R/2);let Kt;if(N.showLabelBackdrop){let wt=ht(N.backdropPadding),Zt=ut.heights[b],Mt=ut.widths[b],Jt=H-wt.top,Lt=0-wt.left;switch(nt){case"middle":Jt-=Zt/2;break;case"bottom":Jt-=Zt;break}switch(C){case"center":Lt-=Mt/2;break;case"right":Lt-=Mt;break;case"inner":b===x-1?Lt-=Mt:b>0&&(Lt-=Mt/2);break}Kt={left:Lt,top:Jt,width:Mt+wt.width,height:Zt+wt.height,color:N.backdropColor}}g.push({label:k,font:O,textOffset:H,options:{rotation:p,color:G,strokeColor:yt,strokeWidth:at,textAlign:Gt,textBaseline:nt,translation:[v,_],backdrop:Kt}})}return g}_getXAxisLabelAlignment(){let{position:e,ticks:t}=this.options;if(-Dt(this.labelRotation))return e==="top"?"left":"right";let r="center";return t.align==="start"?r="left":t.align==="end"?r="right":t.align==="inner"&&(r="inner"),r}_getYAxisLabelAlignment(e){let{position:t,ticks:{crossAlign:n,mirror:r,padding:s}}=this.options,o=this._getLabelSizes(),a=e+s,l=o.widest.width,c,u;return t==="left"?r?(u=this.right+s,n==="near"?c="left":n==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-a,n==="near"?c="right":n==="center"?(c="center",u-=l/2):(c="left",u=this.left)):t==="right"?r?(u=this.left+s,n==="near"?c="right":n==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+a,n==="near"?c="left":n==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;let e=this.chart,t=this.options.position;if(t==="left"||t==="right")return{top:0,left:this.left,bottom:e.height,right:this.right};if(t==="top"||t==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){let{ctx:e,options:{backgroundColor:t},left:n,top:r,width:s,height:o}=this;t&&(e.save(),e.fillStyle=t,e.fillRect(n,r,s,o),e.restore())}getLineWidthForValue(e){let t=this.options.grid;if(!this._isVisible()||!t.display)return 0;let r=this.ticks.findIndex(s=>s.value===e);return r>=0?t.setContext(this.getContext(r)).lineWidth:0}drawGrid(e){let t=this.options.grid,n=this.ctx,r=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e)),s,o,a=(l,c,u)=>{!u.width||!u.color||(n.save(),n.lineWidth=u.width,n.strokeStyle=u.color,n.setLineDash(u.borderDash||[]),n.lineDashOffset=u.borderDashOffset,n.beginPath(),n.moveTo(l.x,l.y),n.lineTo(c.x,c.y),n.stroke(),n.restore())};if(t.display)for(s=0,o=r.length;s<o;++s){let l=r[s];t.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),t.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(){let{chart:e,ctx:t,options:{border:n,grid:r}}=this,s=n.setContext(this.getContext()),o=n.display?s.width:0;if(!o)return;let a=r.setContext(this.getContext(0)).lineWidth,l=this._borderValue,c,u,f,d;this.isHorizontal()?(c=re(e,this.left,o)-o/2,u=re(e,this.right,a)+a/2,f=d=l):(f=re(e,this.top,o)-o/2,d=re(e,this.bottom,a)+a/2,c=u=l),t.save(),t.lineWidth=s.width,t.strokeStyle=s.color,t.beginPath(),t.moveTo(c,f),t.lineTo(u,d),t.stroke(),t.restore()}drawLabels(e){if(!this.options.ticks.display)return;let n=this.ctx,r=this._computeLabelArea();r&&oi(n,r);let s=this.getLabelItems(e);for(let o of s){let a=o.options,l=o.font,c=o.label,u=o.textOffset;se(n,c,0,u,l,a)}r&&ai(n)}drawTitle(){let{ctx:e,options:{position:t,title:n,reverse:r}}=this;if(!n.display)return;let s=ot(n.font),o=ht(n.padding),a=n.align,l=s.lineHeight/2;t==="bottom"||t==="center"||V(t)?(l+=o.bottom,tt(n.text)&&(l+=s.lineHeight*(n.text.length-1))):l+=o.top;let{titleX:c,titleY:u,maxWidth:f,rotation:d}=Af(this,l,t,a);se(e,n.text,0,0,s,{color:n.color,maxWidth:f,rotation:d,textAlign:Sf(a,t,r),textBaseline:"middle",translation:[c,u]})}draw(e){this._isVisible()&&(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){let e=this.options,t=e.ticks&&e.ticks.z||0,n=z(e.grid&&e.grid.z,-1),r=z(e.border&&e.border.z,0);return!this._isVisible()||this.draw!==i.prototype.draw?[{z:t,draw:s=>{this.draw(s)}}]:[{z:n,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:r,draw:()=>{this.drawBorder()}},{z:t,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(e){let t=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+"AxisID",r=[],s,o;for(s=0,o=t.length;s<o;++s){let a=t[s];a[n]===this.id&&(!e||a.type===e)&&r.push(a)}return r}_resolveTickFontOptions(e){let t=this.options.ticks.setContext(this.getContext(e));return ot(t.font)}_maxDigits(){let e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}},Be=class{constructor(e,t,n){this.type=e,this.scope=t,this.override=n,this.items=Object.create(null)}isForType(e){return Object.prototype.isPrototypeOf.call(this.type.prototype,e.prototype)}register(e){let t=Object.getPrototypeOf(e),n;Ef(t)&&(n=this.register(t));let r=this.items,s=e.id,o=this.scope+"."+s;if(!s)throw new Error("class does not have id: "+e);return s in r||(r[s]=e,If(e,o,n),this.override&&it.override(e.id,e.overrides)),o}get(e){return this.items[e]}unregister(e){let t=this.items,n=e.id,r=this.scope;n in t&&delete t[n],r&&n in it[r]&&(delete it[r][n],this.override&&delete ne[n])}};function If(i,e,t){let n=Ae(Object.create(null),[t?it.get(t):{},it.get(e),i.defaults]);it.set(e,n),i.defaultRoutes&&Lf(e,i.defaultRoutes),i.descriptors&&it.describe(e,i.descriptors)}function Lf(i,e){Object.keys(e).forEach(t=>{let n=t.split("."),r=n.pop(),s=[i].concat(n).join("."),o=e[t].split("."),a=o.pop(),l=o.join(".");it.route(s,r,l,a)})}function Ef(i){return"id"in i&&"defaults"in i}var Jr=class{constructor(){this.controllers=new Be(ce,"datasets",!0),this.elements=new Be(It,"elements"),this.plugins=new Be(Object,"plugins"),this.scales=new Be(ye,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,t,n){[...t].forEach(r=>{let s=n||this._getRegistryForType(r);n||s.isForType(r)||s===this.plugins&&r.id?this._exec(e,s,r):Q(r,o=>{let a=n||this._getRegistryForType(o);this._exec(e,a,o)})})}_exec(e,t,n){let r=Ui(e);Z(n["before"+r],[],n),t[e](n),Z(n["after"+r],[],n)}_getRegistryForType(e){for(let t=0;t<this._typedRegistries.length;t++){let n=this._typedRegistries[t];if(n.isForType(e))return n}return this.plugins}_get(e,t,n){let r=t.get(e);if(r===void 0)throw new Error('"'+e+'" is not a registered '+n+".");return r}},zt=new Jr,ts=class{constructor(){this._init=[]}notify(e,t,n,r){t==="beforeInit"&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install"));let s=r?this._descriptors(e).filter(r):this._descriptors(e),o=this._notify(s,e,t,n);return t==="afterDestroy"&&(this._notify(s,e,"stop"),this._notify(this._init,e,"uninstall")),o}_notify(e,t,n,r){r=r||{};for(let s of e){let o=s.plugin,a=o[n],l=[t,r,s.options];if(Z(a,l,o)===!1&&r.cancelable)return!1}return!0}invalidate(){U(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;let t=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),t}_createDescriptors(e,t){let n=e&&e.config,r=z(n.options&&n.options.plugins,{}),s=Rf(n);return r===!1&&!t?[]:Wf(e,s,r,t)}_notifyStateChanges(e){let t=this._oldCache||[],n=this._cache,r=(s,o)=>s.filter(a=>!o.some(l=>a.plugin.id===l.plugin.id));this._notify(r(t,n),e,"stop"),this._notify(r(n,t),e,"start")}};function Rf(i){let e={},t=[],n=Object.keys(zt.plugins.items);for(let s=0;s<n.length;s++)t.push(zt.getPlugin(n[s]));let r=i.plugins||[];for(let s=0;s<r.length;s++){let o=r[s];t.indexOf(o)===-1&&(t.push(o),e[o.id]=!0)}return{plugins:t,localIds:e}}function Ff(i,e){return!e&&i===!1?null:i===!0?{}:i}function Wf(i,{plugins:e,localIds:t},n,r){let s=[],o=i.getContext();for(let a of e){let l=a.id,c=Ff(n[l],r);c!==null&&s.push({plugin:a,options:Nf(i.config,{plugin:a,local:t[l]},c,o)})}return s}function Nf(i,{plugin:e,local:t},n,r){let s=i.pluginScopeKeys(e),o=i.getOptionScopes(n,s);return t&&e.defaults&&o.push(e.defaults),i.createResolver(o,r,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function es(i,e){let t=it.datasets[i]||{};return((e.datasets||{})[i]||{}).indexAxis||e.indexAxis||t.indexAxis||"x"}function zf(i,e){let t=i;return i==="_index_"?t=e:i==="_value_"&&(t=e==="x"?"y":"x"),t}function Hf(i,e){return i===e?"_index_":"_value_"}function Go(i){if(i==="x"||i==="y"||i==="r")return i}function Bf(i){if(i==="top"||i==="bottom")return"x";if(i==="left"||i==="right")return"y"}function is(i,...e){if(Go(i))return i;for(let t of e){let n=t.axis||Bf(t.position)||i.length>1&&Go(i[0].toLowerCase());if(n)return n}throw new Error(`Cannot determine type of '${i}' axis. Please provide 'axis' or 'position' option.`)}function Ko(i,e,t){if(t[e+"AxisID"]===i)return{axis:e}}function Yf(i,e){if(e.data&&e.data.datasets){let t=e.data.datasets.filter(n=>n.xAxisID===i||n.yAxisID===i);if(t.length)return Ko(i,"x",t[0])||Ko(i,"y",t[0])}return{}}function Uf(i,e){let t=ne[i.type]||{scales:{}},n=e.scales||{},r=es(i.type,e),s=Object.create(null);return Object.keys(n).forEach(o=>{let a=n[o];if(!V(a))return console.error(`Invalid scale configuration for scale: ${o}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);let l=is(o,a,Yf(o,i),it.scales[a.type]),c=Hf(l,r),u=t.scales||{};s[o]=Le(Object.create(null),[{axis:l},a,u[l],u[c]])}),i.data.datasets.forEach(o=>{let a=o.type||i.type,l=o.indexAxis||es(a,e),u=(ne[a]||{}).scales||{};Object.keys(u).forEach(f=>{let d=zf(f,l),h=o[d+"AxisID"]||d;s[h]=s[h]||Object.create(null),Le(s[h],[{axis:d},n[h],u[f]])})}),Object.keys(s).forEach(o=>{let a=s[o];Le(a,[it.scales[a.type],it.scale])}),s}function Na(i){let e=i.options||(i.options={});e.plugins=z(e.plugins,{}),e.scales=Uf(i,e)}function za(i){return i=i||{},i.datasets=i.datasets||[],i.labels=i.labels||[],i}function Vf(i){return i=i||{},i.data=za(i.data),Na(i),i}var Zo=new Map,Ha=new Set;function nn(i,e){let t=Zo.get(i);return t||(t=e(),Zo.set(i,t),Ha.add(t)),t}var di=(i,e,t)=>{let n=jt(e,t);n!==void 0&&i.add(n)},ns=class{constructor(e){this._config=Vf(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=za(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){let e=this._config;this.clearCache(),Na(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return nn(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,t){return nn(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,t){return nn(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,""]])}pluginScopeKeys(e){let t=e.id,n=this.type;return nn(`${n}-plugin-${t}`,()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){let n=this._scopeCache,r=n.get(e);return(!r||t)&&(r=new Map,n.set(e,r)),r}getOptionScopes(e,t,n){let{options:r,type:s}=this,o=this._cachedScopes(e,n),a=o.get(t);if(a)return a;let l=new Set;t.forEach(u=>{e&&(l.add(e),u.forEach(f=>di(l,e,f))),u.forEach(f=>di(l,r,f)),u.forEach(f=>di(l,ne[s]||{},f)),u.forEach(f=>di(l,it,f)),u.forEach(f=>di(l,$i,f))});let c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Ha.has(t)&&o.set(t,c),c}chartOptionScopes(){let{options:e,type:t}=this;return[e,ne[t]||{},it.datasets[t]||{},{type:t},it,$i]}resolveNamedOptions(e,t,n,r=[""]){let s={$shared:!0},{resolver:o,subPrefixes:a}=Jo(this._resolverCache,e,r),l=o;if(qf(o,t)){s.$shared=!1,n=Ut(n)?n():n;let c=this.createResolver(e,n,a);l=pe(o,n,c)}for(let c of t)s[c]=l[c];return s}createResolver(e,t,n=[""],r){let{resolver:s}=Jo(this._resolverCache,e,n);return V(t)?pe(s,t,void 0,r):s}};function Jo(i,e,t){let n=i.get(e);n||(n=new Map,i.set(e,n));let r=t.join(),s=n.get(r);return s||(s={resolver:Gi(e,t),subPrefixes:t.filter(a=>!a.toLowerCase().includes("hover"))},n.set(r,s)),s}var jf=i=>V(i)&&Object.getOwnPropertyNames(i).some(e=>Ut(i[e]));function qf(i,e){let{isScriptable:t,isIndexable:n}=Dr(i);for(let r of e){let s=t(r),o=n(r),a=(o||s)&&i[r];if(s&&(Ut(a)||jf(a))||o&&tt(a))return!0}return!1}var $f="4.5.0",Xf=["top","bottom","left","right","chartArea"];function ta(i,e){return i==="top"||i==="bottom"||Xf.indexOf(i)===-1&&e==="x"}function ea(i,e){return function(t,n){return t[i]===n[i]?t[e]-n[e]:t[i]-n[i]}}function ia(i){let e=i.chart,t=e.options.animation;e.notifyPlugins("afterRender"),Z(t&&t.onComplete,[i],e)}function Qf(i){let e=i.chart,t=e.options.animation;Z(t&&t.onProgress,[i],e)}function Ba(i){return Ki()&&typeof i=="string"?i=document.getElementById(i):i&&i.length&&(i=i[0]),i&&i.canvas&&(i=i.canvas),i}var ln={},na=i=>{let e=Ba(i);return Object.values(ln).filter(t=>t.canvas===e).pop()};function Gf(i,e,t){let n=Object.keys(i);for(let r of n){let s=+r;if(s>=e){let o=i[r];delete i[r],(t>0||s>e)&&(i[s+t]=o)}}}function Kf(i,e,t,n){return!t||i.type==="mouseout"?null:n?e:i}var Zf=(()=>{class i{static defaults=it;static instances=ln;static overrides=ne;static registry=zt;static version=$f;static getChart=na;static register(...t){zt.add(...t),ra()}static unregister(...t){zt.remove(...t),ra()}constructor(t,n){let r=this.config=new ns(n),s=Ba(t),o=na(s);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");let a=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||xf(s)),this.platform.updateConfig(r);let l=this.platform.acquireContext(s,a.aspectRatio),c=l&&l.canvas,u=c&&c.height,f=c&&c.width;if(this.id=eo(),this.ctx=l,this.canvas=c,this.width=f,this.height=u,this._options=a,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new ts,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=ho(d=>this.update(d),a.resizeDelay||0),this._dataChanges=[],ln[this.id]=this,!l||!c){console.error("Failed to create chart: can't acquire context from the given item");return}$t.listen(this,"complete",ia),$t.listen(this,"progress",Qf),this._initialize(),this.attached&&this.update()}get aspectRatio(){let{options:{aspectRatio:t,maintainAspectRatio:n},width:r,height:s,_aspectRatio:o}=this;return U(t)?n&&o?o:s?r/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return zt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Sr(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Mr(this.canvas,this.ctx),this}stop(){return $t.stop(this),this}resize(t,n){$t.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){let r=this.options,s=this.canvas,o=r.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(s,t,n,o),l=r.devicePixelRatio||this.platform.getDevicePixelRatio(),c=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,Sr(this,l,!0)&&(this.notifyPlugins("resize",{size:a}),Z(r.onResize,[this,a],this),this.attached&&this._doResize(c)&&this.render())}ensureScalesHaveIDs(){let n=this.options.scales||{};Q(n,(r,s)=>{r.id=s})}buildOrUpdateScales(){let t=this.options,n=t.scales,r=this.scales,s=Object.keys(r).reduce((a,l)=>(a[l]=!1,a),{}),o=[];n&&(o=o.concat(Object.keys(n).map(a=>{let l=n[a],c=is(a,l),u=c==="r",f=c==="x";return{options:l,dposition:u?"chartArea":f?"bottom":"left",dtype:u?"radialLinear":f?"category":"linear"}}))),Q(o,a=>{let l=a.options,c=l.id,u=is(c,l),f=z(l.type,a.dtype);(l.position===void 0||ta(l.position,u)!==ta(a.dposition))&&(l.position=a.dposition),s[c]=!0;let d=null;if(c in r&&r[c].type===f)d=r[c];else{let h=zt.getScale(f);d=new h({id:c,type:f,ctx:this.ctx,chart:this}),r[d.id]=d}d.init(l,t)}),Q(s,(a,l)=>{a||delete r[l]}),Q(r,a=>{mt.configure(this,a,a.options),mt.addBox(this,a)})}_updateMetasets(){let t=this._metasets,n=this.data.datasets.length,r=t.length;if(t.sort((s,o)=>s.index-o.index),r>n){for(let s=n;s<r;++s)this._destroyDatasetMeta(s);t.splice(n,r-n)}this._sortedMetasets=t.slice(0).sort(ea("order","index"))}_removeUnreferencedMetasets(){let{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((r,s)=>{n.filter(o=>o===r._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){let t=[],n=this.data.datasets,r,s;for(this._removeUnreferencedMetasets(),r=0,s=n.length;r<s;r++){let o=n[r],a=this.getDatasetMeta(r),l=o.type||this.config.type;if(a.type&&a.type!==l&&(this._destroyDatasetMeta(r),a=this.getDatasetMeta(r)),a.type=l,a.indexAxis=o.indexAxis||es(l,this.options),a.order=o.order||0,a.index=r,a.label=""+o.label,a.visible=this.isDatasetVisible(r),a.controller)a.controller.updateIndex(r),a.controller.linkScales();else{let c=zt.getController(l),{datasetElementType:u,dataElementType:f}=it.datasets[l];Object.assign(c,{dataElementType:zt.getElement(f),datasetElementType:u&&zt.getElement(u)}),a.controller=new c(this,r),t.push(a.controller)}}return this._updateMetasets(),t}_resetElements(){Q(this.data.datasets,(t,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){let n=this.config;n.update();let r=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;let o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let u=0,f=this.data.datasets.length;u<f;u++){let{controller:d}=this.getDatasetMeta(u),h=!s&&o.indexOf(d)===-1;d.buildOrUpdateElements(h),a=Math.max(+d.getMaxOverflow(),a)}a=this._minPadding=r.layout.autoPadding?a:0,this._updateLayout(a),s||Q(o,u=>{u.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(ea("z","_idx"));let{_active:l,_lastEvent:c}=this;c?this._eventHandler(c,!0):l.length&&this._updateHoverStyles(l,l,!0),this.render()}_updateScales(){Q(this.scales,t=>{mt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){let t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!ur(n,r)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){let{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(let{method:r,start:s,count:o}of n){let a=r==="_removeElements"?-o:o;Gf(t,s,a)}}_getUniformDataChanges(){let t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];let n=this.data.datasets.length,r=o=>new Set(t.filter(a=>a[0]===o).map((a,l)=>l+","+a.splice(1).join(","))),s=r(0);for(let o=1;o<n;o++)if(!ur(s,r(o)))return;return Array.from(s).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;mt.update(this,this.width,this.height,t);let n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],Q(this.boxes,s=>{r&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,o)=>{s._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,r=this.data.datasets.length;n<r;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,r=this.data.datasets.length;n<r;++n)this._updateDataset(n,Ut(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){let r=this.getDatasetMeta(t),s={meta:r,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(r.controller._update(n),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&($t.has(this)?this.attached&&!$t.running(this)&&$t.start(this):(this.draw(),ia({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){let{width:r,height:s}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(r,s)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;let n=this._layers;for(t=0;t<n.length&&n[t].z<=0;++t)n[t].draw(this.chartArea);for(this._drawDatasets();t<n.length;++t)n[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){let n=this._sortedMetasets,r=[],s,o;for(s=0,o=n.length;s<o;++s){let a=n[s];(!t||a.visible)&&r.push(a)}return r}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;let t=this.getSortedVisibleDatasetMetas();for(let n=t.length-1;n>=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){let n=this.ctx,r={meta:t,index:t.index,cancelable:!0},s=Fr(this,t);this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(s&&oi(n,s),t.controller.draw(),s&&ai(n),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return Rt(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,s){let o=Zu.modes[n];return typeof o=="function"?o(this,t,r,s):[]}getDatasetMeta(t){let n=this.data.datasets[t],r=this._metasets,s=r.filter(o=>o&&o._dataset===n).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},r.push(s)),s}getContext(){return this.$context||(this.$context=qt(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){let n=this.data.datasets[t];if(!n)return!1;let r=this.getDatasetMeta(t);return typeof r.hidden=="boolean"?!r.hidden:!n.hidden}setDatasetVisibility(t,n){let r=this.getDatasetMeta(t);r.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,r){let s=r?"show":"hide",o=this.getDatasetMeta(t),a=o.controller._resolveAnimations(void 0,s);Ee(n)?(o.data[n].hidden=!r,this.update()):(this.setDatasetVisibility(t,r),a.update(o,{visible:r}),this.update(l=>l.datasetIndex===t?s:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){let n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),$t.remove(this),t=0,n=this.data.datasets.length;t<n;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");let{canvas:t,ctx:n}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),Mr(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete ln[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){let t=this._listeners,n=this.platform,r=(o,a)=>{n.addEventListener(this,o,a),t[o]=a},s=(o,a,l)=>{o.offsetX=a,o.offsetY=l,this._eventHandler(o)};Q(this.options.events,o=>r(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});let t=this._responsiveListeners,n=this.platform,r=(c,u)=>{n.addEventListener(this,c,u),t[c]=u},s=(c,u)=>{t[c]&&(n.removeEventListener(this,c,u),delete t[c])},o=(c,u)=>{this.canvas&&this.resize(c,u)},a,l=()=>{s("attach",l),this.attached=!0,this.resize(),r("resize",o),r("detach",a)};a=()=>{this.attached=!1,s("resize",o),this._stop(),this._resize(0,0),r("attach",l)},n.isAttached(this.canvas)?l():a()}unbindEvents(){Q(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},Q(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,r){let s=r?"set":"remove",o,a,l,c;for(n==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+s+"DatasetHoverStyle"]()),l=0,c=t.length;l<c;++l){a=t[l];let u=a&&this.getDatasetMeta(a.datasetIndex).controller;u&&u[s+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){let n=this._active||[],r=t.map(({datasetIndex:o,index:a})=>{let l=this.getDatasetMeta(o);if(!l)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:l.data[a],index:a}});!ri(r,n)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,n))}notifyPlugins(t,n,r){return this._plugins.notify(this,t,n,r)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,r){let s=this.options.hover,o=(c,u)=>c.filter(f=>!u.some(d=>f.datasetIndex===d.datasetIndex&&f.index===d.index)),a=o(n,t),l=r?t:o(t,n);a.length&&this.updateHoverStyle(a,s.mode,!1),l.length&&s.mode&&this.updateHoverStyle(l,s.mode,!0)}_eventHandler(t,n){let r={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},s=a=>(a.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",r,s)===!1)return;let o=this._handleEvent(t,n,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,s),(o||r.changed)&&this.render(),this}_handleEvent(t,n,r){let{_active:s=[],options:o}=this,a=n,l=this._getActiveElements(t,s,r,a),c=ro(t),u=Kf(t,this._lastEvent,r,c);r&&(this._lastEvent=null,Z(o.onHover,[t,l,this],this),c&&Z(o.onClick,[t,l,this],this));let f=!ri(l,s);return(f||n)&&(this._active=l,this._updateHoverStyles(l,s,n)),this._lastEvent=u,f}_getActiveElements(t,n,r,s){if(t.type==="mouseout")return[];if(!r)return n;let o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,s)}}return i})();function ra(){return Q(Zf.instances,i=>i._plugins.invalidate())}function Jf(i,e,t){let{startAngle:n,x:r,y:s,outerRadius:o,innerRadius:a,options:l}=e,{borderWidth:c,borderJoinStyle:u}=l,f=Math.min(c/o,ft(n-t));if(i.beginPath(),i.arc(r,s,o-c/2,n+f/2,t-f/2),a>0){let d=Math.min(c/a,ft(n-t));i.arc(r,s,a+c/2,t-d/2,n+d/2,!0)}else{let d=Math.min(c/2,o*ft(n-t));if(u==="round")i.arc(r,s,d,t-$/2,n+$/2,!0);else if(u==="bevel"){let h=2*d*d,m=-h*Math.cos(t+$/2)+r,p=-h*Math.sin(t+$/2)+s,g=h*Math.cos(n+$/2)+r,b=h*Math.sin(n+$/2)+s;i.lineTo(m,p),i.lineTo(g,b)}}i.closePath(),i.moveTo(0,0),i.rect(0,0,i.canvas.width,i.canvas.height),i.clip("evenodd")}function td(i,e,t){let{startAngle:n,pixelMargin:r,x:s,y:o,outerRadius:a,innerRadius:l}=e,c=r/a;i.beginPath(),i.arc(s,o,a,n-c,t+c),l>r?(c=r/l,i.arc(s,o,l,t+c,n-c,!0)):i.arc(s,o,r,t+st,n-st),i.closePath(),i.clip()}function ed(i){return Qi(i,["outerStart","outerEnd","innerStart","innerEnd"])}function id(i,e,t,n){let r=ed(i.options.borderRadius),s=(t-e)/2,o=Math.min(s,n*e/2),a=l=>{let c=(t-Math.min(s,l))*n/2;return lt(l,0,Math.min(s,c))};return{outerStart:a(r.outerStart),outerEnd:a(r.outerEnd),innerStart:lt(r.innerStart,0,o),innerEnd:lt(r.innerEnd,0,o)}}function He(i,e,t,n){return{x:t+i*Math.cos(e),y:n+i*Math.sin(e)}}function dn(i,e,t,n,r,s){let{x:o,y:a,startAngle:l,pixelMargin:c,innerRadius:u}=e,f=Math.max(e.outerRadius+n+t-c,0),d=u>0?u+n+t+c:0,h=0,m=r-l;if(n){let N=u>0?u-n:0,Y=f>0?f-n:0,G=(N+Y)/2,yt=G!==0?m*G/(G+n):m;h=(m-yt)/2}let p=Math.max(.001,m*f-t/$)/f,g=(m-p)/2,b=l+g+h,x=r-g-h,{outerStart:w,outerEnd:k,innerStart:v,innerEnd:_}=id(e,d,f,x-b),C=f-w,P=f-k,O=b+w/C,R=x-k/P,W=d+v,H=d+_,nt=b+v/W,ut=x-_/H;if(i.beginPath(),s){let N=(O+R)/2;if(i.arc(o,a,f,O,N),i.arc(o,a,f,N,R),k>0){let at=He(P,R,o,a);i.arc(at.x,at.y,k,R,x+st)}let Y=He(H,x,o,a);if(i.lineTo(Y.x,Y.y),_>0){let at=He(H,ut,o,a);i.arc(at.x,at.y,_,x+st,ut+Math.PI)}let G=(x-_/d+(b+v/d))/2;if(i.arc(o,a,d,x-_/d,G,!0),i.arc(o,a,d,G,b+v/d,!0),v>0){let at=He(W,nt,o,a);i.arc(at.x,at.y,v,nt+Math.PI,b-st)}let yt=He(C,b,o,a);if(i.lineTo(yt.x,yt.y),w>0){let at=He(C,O,o,a);i.arc(at.x,at.y,w,b-st,O)}}else{i.moveTo(o,a);let N=Math.cos(O)*f+o,Y=Math.sin(O)*f+a;i.lineTo(N,Y);let G=Math.cos(R)*f+o,yt=Math.sin(R)*f+a;i.lineTo(G,yt)}i.closePath()}function nd(i,e,t,n,r){let{fullCircles:s,startAngle:o,circumference:a}=e,l=e.endAngle;if(s){dn(i,e,t,n,l,r);for(let c=0;c<s;++c)i.fill();isNaN(a)||(l=o+(a%et||et))}return dn(i,e,t,n,l,r),i.fill(),l}function rd(i,e,t,n,r){let{fullCircles:s,startAngle:o,circumference:a,options:l}=e,{borderWidth:c,borderJoinStyle:u,borderDash:f,borderDashOffset:d,borderRadius:h}=l,m=l.borderAlign==="inner";if(!c)return;i.setLineDash(f||[]),i.lineDashOffset=d,m?(i.lineWidth=c*2,i.lineJoin=u||"round"):(i.lineWidth=c,i.lineJoin=u||"bevel");let p=e.endAngle;if(s){dn(i,e,t,n,p,r);for(let g=0;g<s;++g)i.stroke();isNaN(a)||(p=o+(a%et||et))}m&&td(i,e,p),l.selfJoin&&p-o>=$&&h===0&&u!=="miter"&&Jf(i,e,p),s||(dn(i,e,t,n,p,r),i.stroke())}var rs=class extends It{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:e=>e!=="borderDash"};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(e){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,t,n){let r=this.getProps(["x","y"],n),{angle:s,distance:o}=mr(r,{x:e,y:t}),{startAngle:a,endAngle:l,innerRadius:c,outerRadius:u,circumference:f}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],n),d=(this.options.spacing+this.options.borderWidth)/2,h=z(f,l-a),m=Fe(s,a,l)&&a!==l,p=h>=et||m,g=Wt(o,c+d,u+d);return p&&g}getCenterPoint(e){let{x:t,y:n,startAngle:r,endAngle:s,innerRadius:o,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:l,spacing:c}=this.options,u=(r+s)/2,f=(o+a+c+l)/2;return{x:t+Math.cos(u)*f,y:n+Math.sin(u)*f}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){let{options:t,circumference:n}=this,r=(t.offset||0)/4,s=(t.spacing||0)/2,o=t.circular;if(this.pixelMargin=t.borderAlign==="inner"?.33:0,this.fullCircles=n>et?Math.floor(n/et):0,n===0||this.innerRadius<0||this.outerRadius<0)return;e.save();let a=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(a)*r,Math.sin(a)*r);let l=1-Math.sin(Math.min($,n||0)),c=r*l;e.fillStyle=t.backgroundColor,e.strokeStyle=t.borderColor,nd(e,this,c,s,o),rd(e,this,c,s,o),e.restore()}};function Ya(i,e,t=e){i.lineCap=z(t.borderCapStyle,e.borderCapStyle),i.setLineDash(z(t.borderDash,e.borderDash)),i.lineDashOffset=z(t.borderDashOffset,e.borderDashOffset),i.lineJoin=z(t.borderJoinStyle,e.borderJoinStyle),i.lineWidth=z(t.borderWidth,e.borderWidth),i.strokeStyle=z(t.borderColor,e.borderColor)}function sd(i,e,t){i.lineTo(t.x,t.y)}function od(i){return i.stepped?bo:i.tension||i.cubicInterpolationMode==="monotone"?xo:sd}function Ua(i,e,t={}){let n=i.length,{start:r=0,end:s=n-1}=t,{start:o,end:a}=e,l=Math.max(r,o),c=Math.min(s,a),u=r<o&&s<o||r>a&&s>a;return{count:n,start:l,loop:e.loop,ilen:c<l&&!u?n+c-l:c-l}}function ad(i,e,t,n){let{points:r,options:s}=e,{count:o,start:a,loop:l,ilen:c}=Ua(r,t,n),u=od(s),{move:f=!0,reverse:d}=n||{},h,m,p;for(h=0;h<=c;++h)m=r[(a+(d?c-h:h))%o],!m.skip&&(f?(i.moveTo(m.x,m.y),f=!1):u(i,p,m,d,s.stepped),p=m);return l&&(m=r[(a+(d?c:0))%o],u(i,p,m,d,s.stepped)),!!l}function ld(i,e,t,n){let r=e.points,{count:s,start:o,ilen:a}=Ua(r,t,n),{move:l=!0,reverse:c}=n||{},u=0,f=0,d,h,m,p,g,b,x=k=>(o+(c?a-k:k))%s,w=()=>{p!==g&&(i.lineTo(u,g),i.lineTo(u,p),i.lineTo(u,b))};for(l&&(h=r[x(0)],i.moveTo(h.x,h.y)),d=0;d<=a;++d){if(h=r[x(d)],h.skip)continue;let k=h.x,v=h.y,_=k|0;_===m?(v<p?p=v:v>g&&(g=v),u=(f*u+k)/++f):(w(),i.lineTo(k,v),m=_,f=0,p=g=v),b=v}w()}function ss(i){let e=i.options,t=e.borderDash&&e.borderDash.length;return!i._decimated&&!i._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!t?ld:ad}function cd(i){return i.stepped?Po:i.tension||i.cubicInterpolationMode==="monotone"?Co:ie}function ud(i,e,t,n){let r=e._path;r||(r=e._path=new Path2D,e.path(r,t,n)&&r.closePath()),Ya(i,e.options),i.stroke(r)}function fd(i,e,t,n){let{segments:r,options:s}=e,o=ss(e);for(let a of r)Ya(i,s,a.style),i.beginPath(),o(i,e,a,{start:t,end:t+n-1})&&i.closePath(),i.stroke()}var dd=typeof Path2D=="function";function hd(i,e,t,n){dd&&!e.options.segment?ud(i,e,t,n):fd(i,e,t,n)}var pn=(()=>{class i extends It{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"};constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,n){let r=this.options;if((r.tension||r.cubicInterpolationMode==="monotone")&&!r.stepped&&!this._pointsUpdated){let s=r.spanGaps?this._loop:this._fullLoop;ko(this._points,r,t,s,n),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=So(this,this.options.segment))}first(){let t=this.segments,n=this.points;return t.length&&n[t[0].start]}last(){let t=this.segments,n=this.points,r=t.length;return r&&n[t[r-1].end]}interpolate(t,n){let r=this.options,s=t[n],o=this.points,a=Rr(this,{property:n,start:s,end:s});if(!a.length)return;let l=[],c=cd(r),u,f;for(u=0,f=a.length;u<f;++u){let{start:d,end:h}=a[u],m=o[d],p=o[h];if(m===p){l.push(m);continue}let g=Math.abs((s-m[n])/(p[n]-m[n])),b=c(m,p,g,r.stepped);b[n]=t[n],l.push(b)}return l.length===1?l[0]:l}pathSegment(t,n,r){return ss(this)(t,this,n,r)}path(t,n,r){let s=this.segments,o=ss(this),a=this._loop;n=n||0,r=r||this.points.length-n;for(let l of s)a&=o(t,this,l,{start:n,end:n+r-1});return!!a}draw(t,n,r,s){let o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),hd(t,this,r,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}return i})();function sa(i,e,t,n){let r=i.options,{[t]:s}=i.getProps([t],n);return Math.abs(e-s)<r.radius+r.hitRadius}var md=(()=>{class i extends It{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,n,r){let s=this.options,{x:o,y:a}=this.getProps(["x","y"],r);return Math.pow(t-o,2)+Math.pow(n-a,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(t,n){return sa(this,t,"x",n)}inYRange(t,n){return sa(this,t,"y",n)}getCenterPoint(t){let{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}size(t){t=t||this.options||{};let n=t.radius||0;n=Math.max(n,n&&t.hoverRadius||0);let r=n&&t.borderWidth||0;return(n+r)*2}draw(t,n){let r=this.options;this.skip||r.radius<.1||!Rt(this,n,this.size(r)/2)||(t.strokeStyle=r.borderColor,t.lineWidth=r.borderWidth,t.fillStyle=r.backgroundColor,Xi(t,r,this.x,this.y))}getRange(){let t=this.options||{};return t.radius+t.hitRadius}}return i})();function Va(i,e){let{x:t,y:n,base:r,width:s,height:o}=i.getProps(["x","y","base","width","height"],e),a,l,c,u,f;return i.horizontal?(f=o/2,a=Math.min(t,r),l=Math.max(t,r),c=n-f,u=n+f):(f=s/2,a=t-f,l=t+f,c=Math.min(n,r),u=Math.max(n,r)),{left:a,top:c,right:l,bottom:u}}function le(i,e,t,n){return i?0:lt(e,t,n)}function pd(i,e,t){let n=i.options.borderWidth,r=i.borderSkipped,s=Tr(n);return{t:le(r.top,s.top,0,t),r:le(r.right,s.right,0,e),b:le(r.bottom,s.bottom,0,t),l:le(r.left,s.left,0,e)}}function gd(i,e,t){let{enableBorderRadius:n}=i.getProps(["enableBorderRadius"]),r=i.options.borderRadius,s=oe(r),o=Math.min(e,t),a=i.borderSkipped,l=n||V(r);return{topLeft:le(!l||a.top||a.left,s.topLeft,0,o),topRight:le(!l||a.top||a.right,s.topRight,0,o),bottomLeft:le(!l||a.bottom||a.left,s.bottomLeft,0,o),bottomRight:le(!l||a.bottom||a.right,s.bottomRight,0,o)}}function bd(i){let e=Va(i),t=e.right-e.left,n=e.bottom-e.top,r=pd(i,t/2,n/2),s=gd(i,t/2,n/2);return{outer:{x:e.left,y:e.top,w:t,h:n,radius:s},inner:{x:e.left+r.l,y:e.top+r.t,w:t-r.l-r.r,h:n-r.t-r.b,radius:{topLeft:Math.max(0,s.topLeft-Math.max(r.t,r.l)),topRight:Math.max(0,s.topRight-Math.max(r.t,r.r)),bottomLeft:Math.max(0,s.bottomLeft-Math.max(r.b,r.l)),bottomRight:Math.max(0,s.bottomRight-Math.max(r.b,r.r))}}}}function Vr(i,e,t,n){let r=e===null,s=t===null,a=i&&!(r&&s)&&Va(i,n);return a&&(r||Wt(e,a.left,a.right))&&(s||Wt(t,a.top,a.bottom))}function xd(i){return i.topLeft||i.topRight||i.bottomLeft||i.bottomRight}function vd(i,e){i.rect(e.x,e.y,e.w,e.h)}function jr(i,e,t={}){let n=i.x!==t.x?-e:0,r=i.y!==t.y?-e:0,s=(i.x+i.w!==t.x+t.w?e:0)-n,o=(i.y+i.h!==t.y+t.h?e:0)-r;return{x:i.x+n,y:i.y+r,w:i.w+s,h:i.h+o,radius:i.radius}}var os=class extends It{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(e){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,e&&Object.assign(this,e)}draw(e){let{inflateAmount:t,options:{borderColor:n,backgroundColor:r}}=this,{inner:s,outer:o}=bd(this),a=xd(o.radius)?Ne:vd;e.save(),(o.w!==s.w||o.h!==s.h)&&(e.beginPath(),a(e,jr(o,t,s)),e.clip(),a(e,jr(s,-t,o)),e.fillStyle=n,e.fill("evenodd")),e.beginPath(),a(e,jr(s,t)),e.fillStyle=r,e.fill(),e.restore()}inRange(e,t,n){return Vr(this,e,t,n)}inXRange(e,t){return Vr(this,e,null,t)}inYRange(e,t){return Vr(this,null,e,t)}getCenterPoint(e){let{x:t,y:n,base:r,horizontal:s}=this.getProps(["x","y","base","horizontal"],e);return{x:s?(t+r)/2:t,y:s?n:(n+r)/2}}getRange(e){return e==="x"?this.width/2:this.height/2}},yd=Object.freeze({__proto__:null,ArcElement:rs,BarElement:os,LineElement:pn,PointElement:md}),as=["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)"],oa=as.map(i=>i.replace("rgb(","rgba(").replace(")",", 0.5)"));function ja(i){return as[i%as.length]}function qa(i){return oa[i%oa.length]}function _d(i,e){return i.borderColor=ja(e),i.backgroundColor=qa(e),++e}function wd(i,e){return i.backgroundColor=i.data.map(()=>ja(e++)),e}function Md(i,e){return i.backgroundColor=i.data.map(()=>qa(e++)),e}function kd(i){let e=0;return(t,n)=>{let r=i.getDatasetMeta(n).controller;r instanceof ps?e=wd(t,e):r instanceof La?e=Md(t,e):r&&(e=_d(t,e))}}function aa(i){let e;for(e in i)if(i[e].borderColor||i[e].backgroundColor)return!0;return!1}function Td(i){return i&&(i.borderColor||i.backgroundColor)}function Dd(){return it.borderColor!=="rgba(0,0,0,0.1)"||it.backgroundColor!=="rgba(0,0,0,0.1)"}var Pd={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(i,e,t){if(!t.enabled)return;let{data:{datasets:n},options:r}=i.config,{elements:s}=r,o=aa(n)||Td(r)||s&&aa(s)||Dd();if(!t.forceOverride&&o)return;let a=kd(i);n.forEach(a)}};function Cd(i,e,t,n,r){let s=r.samples||n;if(s>=t)return i.slice(e,e+t);let o=[],a=(t-2)/(s-2),l=0,c=e+t-1,u=e,f,d,h,m,p;for(o[l++]=i[u],f=0;f<s-2;f++){let g=0,b=0,x,w=Math.floor((f+1)*a)+1+e,k=Math.min(Math.floor((f+2)*a)+1,t)+e,v=k-w;for(x=w;x<k;x++)g+=i[x].x,b+=i[x].y;g/=v,b/=v;let _=Math.floor(f*a)+1+e,C=Math.min(Math.floor((f+1)*a)+1,t)+e,{x:P,y:O}=i[u];for(h=m=-1,x=_;x<C;x++)m=.5*Math.abs((P-g)*(i[x].y-O)-(P-i[x].x)*(b-O)),m>h&&(h=m,d=i[x],p=x);o[l++]=d,u=p}return o[l++]=i[c],o}function Od(i,e,t,n){let r=0,s=0,o,a,l,c,u,f,d,h,m,p,g=[],b=e+t-1,x=i[e].x,k=i[b].x-x;for(o=e;o<e+t;++o){a=i[o],l=(a.x-x)/k*n,c=a.y;let v=l|0;if(v===u)c<m?(m=c,f=o):c>p&&(p=c,d=o),r=(s*r+a.x)/++s;else{let _=o-1;if(!U(f)&&!U(d)){let C=Math.min(f,d),P=Math.max(f,d);C!==h&&C!==_&&g.push(Ai(Si({},i[C]),{x:r})),P!==h&&P!==_&&g.push(Ai(Si({},i[P]),{x:r}))}o>0&&_!==h&&g.push(i[_]),g.push(a),u=v,s=0,m=p=c,f=d=h=o}}return g}function $a(i){if(i._decimated){let e=i._data;delete i._decimated,delete i._data,Object.defineProperty(i,"data",{configurable:!0,enumerable:!0,writable:!0,value:e})}}function la(i){i.data.datasets.forEach(e=>{$a(e)})}function Sd(i,e){let t=e.length,n=0,r,{iScale:s}=i,{min:o,max:a,minDefined:l,maxDefined:c}=s.getUserBounds();return l&&(n=lt(Et(e,s.axis,o).lo,0,t-1)),c?r=lt(Et(e,s.axis,a).hi+1,n,t)-n:r=t-n,{start:n,count:r}}var Ad={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(i,e,t)=>{if(!t.enabled){la(i);return}let n=i.width;i.data.datasets.forEach((r,s)=>{let{_data:o,indexAxis:a}=r,l=i.getDatasetMeta(s),c=o||r.data;if(ze([a,i.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;let u=i.scales[l.xAxisID];if(u.type!=="linear"&&u.type!=="time"||i.options.parsing)return;let{start:f,count:d}=Sd(l,c),h=t.threshold||4*n;if(d<=h){$a(r);return}U(o)&&(r._data=c,delete r.data,Object.defineProperty(r,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(p){this._data=p}}));let m;switch(t.algorithm){case"lttb":m=Cd(c,f,d,n,t);break;case"min-max":m=Od(c,f,d,n);break;default:throw new Error(`Unsupported decimation algorithm '${t.algorithm}'`)}r._decimated=m})},destroy(i){la(i)}};function Id(i,e,t){let n=i.segments,r=i.points,s=e.points,o=[];for(let a of n){let{start:l,end:c}=a;c=gn(l,c,r);let u=ls(t,r[l],r[c],a.loop);if(!e.segments){o.push({source:a,target:u,start:r[l],end:r[c]});continue}let f=Rr(e,u);for(let d of f){let h=ls(t,s[d.start],s[d.end],d.loop),m=Er(a,r,h);for(let p of m)o.push({source:p,target:d,start:{[t]:ca(u,h,"start",Math.max)},end:{[t]:ca(u,h,"end",Math.min)}})}}return o}function ls(i,e,t,n){if(n)return;let r=e[i],s=t[i];return i==="angle"&&(r=ft(r),s=ft(s)),{property:i,start:r,end:s}}function Ld(i,e){let{x:t=null,y:n=null}=i||{},r=e.points,s=[];return e.segments.forEach(({start:o,end:a})=>{a=gn(o,a,r);let l=r[o],c=r[a];n!==null?(s.push({x:l.x,y:n}),s.push({x:c.x,y:n})):t!==null&&(s.push({x:t,y:l.y}),s.push({x:t,y:c.y}))}),s}function gn(i,e,t){for(;e>i;e--){let n=t[e];if(!isNaN(n.x)&&!isNaN(n.y))break}return e}function ca(i,e,t,n){return i&&e?n(i[t],e[t]):i?i[t]:e?e[t]:0}function Xa(i,e){let t=[],n=!1;return tt(i)?(n=!0,t=i):t=Ld(i,e),t.length?new pn({points:t,options:{tension:0},_loop:n,_fullLoop:n}):null}function ua(i){return i&&i.fill!==!1}function Ed(i,e,t){let r=i[e].fill,s=[e],o;if(!t)return r;for(;r!==!1&&s.indexOf(r)===-1;){if(!rt(r))return r;if(o=i[r],!o)return!1;if(o.visible)return r;s.push(r),r=o.fill}return!1}function Rd(i,e,t){let n=zd(i);if(V(n))return isNaN(n.value)?!1:n;let r=parseFloat(n);return rt(r)&&Math.floor(r)===r?Fd(n[0],e,r,t):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}function Fd(i,e,t,n){return(i==="-"||i==="+")&&(t=e+t),t===e||t<0||t>=n?!1:t}function Wd(i,e){let t=null;return i==="start"?t=e.bottom:i==="end"?t=e.top:V(i)?t=e.getPixelForValue(i.value):e.getBasePixel&&(t=e.getBasePixel()),t}function Nd(i,e,t){let n;return i==="start"?n=t:i==="end"?n=e.options.reverse?e.min:e.max:V(i)?n=i.value:n=e.getBaseValue(),n}function zd(i){let e=i.options,t=e.fill,n=z(t&&t.target,t);return n===void 0&&(n=!!e.backgroundColor),n===!1||n===null?!1:n===!0?"origin":n}function Hd(i){let{scale:e,index:t,line:n}=i,r=[],s=n.segments,o=n.points,a=Bd(e,t);a.push(Xa({x:null,y:e.bottom},n));for(let l=0;l<s.length;l++){let c=s[l];for(let u=c.start;u<=c.end;u++)Yd(r,o[u],a)}return new pn({points:r,options:{}})}function Bd(i,e){let t=[],n=i.getMatchingVisibleMetas("line");for(let r=0;r<n.length;r++){let s=n[r];if(s.index===e)break;s.hidden||t.unshift(s.dataset)}return t}function Yd(i,e,t){let n=[];for(let r=0;r<t.length;r++){let s=t[r],{first:o,last:a,point:l}=Ud(s,e,"x");if(!(!l||o&&a)){if(o)n.unshift(l);else if(i.push(l),!a)break}}i.push(...n)}function Ud(i,e,t){let n=i.interpolate(e,t);if(!n)return{};let r=n[t],s=i.segments,o=i.points,a=!1,l=!1;for(let c=0;c<s.length;c++){let u=s[c],f=o[u.start][t],d=o[u.end][t];if(Wt(r,f,d)){a=r===f,l=r===d;break}}return{first:a,last:l,point:n}}var hn=class{constructor(e){this.x=e.x,this.y=e.y,this.radius=e.radius}pathSegment(e,t,n){let{x:r,y:s,radius:o}=this;return t=t||{start:0,end:et},e.arc(r,s,o,t.end,t.start,!0),!n.bounds}interpolate(e){let{x:t,y:n,radius:r}=this,s=e.angle;return{x:t+Math.cos(s)*r,y:n+Math.sin(s)*r,angle:s}}};function Vd(i){let{chart:e,fill:t,line:n}=i;if(rt(t))return jd(e,t);if(t==="stack")return Hd(i);if(t==="shape")return!0;let r=qd(i);return r instanceof hn?r:Xa(r,n)}function jd(i,e){let t=i.getDatasetMeta(e);return t&&i.isDatasetVisible(e)?t.dataset:null}function qd(i){return(i.scale||{}).getPointPositionForValue?Xd(i):$d(i)}function $d(i){let{scale:e={},fill:t}=i,n=Wd(t,e);if(rt(n)){let r=e.isHorizontal();return{x:r?n:null,y:r?null:n}}return null}function Xd(i){let{scale:e,fill:t}=i,n=e.options,r=e.getLabels().length,s=n.reverse?e.max:e.min,o=Nd(t,e,s),a=[];if(n.grid.circular){let l=e.getPointPositionForValue(0,s);return new hn({x:l.x,y:l.y,radius:e.getDistanceFromCenterForValue(o)})}for(let l=0;l<r;++l)a.push(e.getPointPositionForValue(l,o));return a}function qr(i,e,t){let n=Vd(e),{chart:r,index:s,line:o,scale:a,axis:l}=e,c=o.options,u=c.fill,f=c.backgroundColor,{above:d=f,below:h=f}=u||{},m=r.getDatasetMeta(s),p=Fr(r,m);n&&o.points.length&&(oi(i,t),Qd(i,{line:o,target:n,above:d,below:h,area:t,scale:a,axis:l,clip:p}),ai(i))}function Qd(i,e){let{line:t,target:n,above:r,below:s,area:o,scale:a,clip:l}=e,c=t._loop?"angle":e.axis;i.save();let u=s;s!==r&&(c==="x"?(fa(i,n,o.top),$r(i,{line:t,target:n,color:r,scale:a,property:c,clip:l}),i.restore(),i.save(),fa(i,n,o.bottom)):c==="y"&&(da(i,n,o.left),$r(i,{line:t,target:n,color:s,scale:a,property:c,clip:l}),i.restore(),i.save(),da(i,n,o.right),u=r)),$r(i,{line:t,target:n,color:u,scale:a,property:c,clip:l}),i.restore()}function fa(i,e,t){let{segments:n,points:r}=e,s=!0,o=!1;i.beginPath();for(let a of n){let{start:l,end:c}=a,u=r[l],f=r[gn(l,c,r)];s?(i.moveTo(u.x,u.y),s=!1):(i.lineTo(u.x,t),i.lineTo(u.x,u.y)),o=!!e.pathSegment(i,a,{move:o}),o?i.closePath():i.lineTo(f.x,t)}i.lineTo(e.first().x,t),i.closePath(),i.clip()}function da(i,e,t){let{segments:n,points:r}=e,s=!0,o=!1;i.beginPath();for(let a of n){let{start:l,end:c}=a,u=r[l],f=r[gn(l,c,r)];s?(i.moveTo(u.x,u.y),s=!1):(i.lineTo(t,u.y),i.lineTo(u.x,u.y)),o=!!e.pathSegment(i,a,{move:o}),o?i.closePath():i.lineTo(t,f.y)}i.lineTo(t,e.first().y),i.closePath(),i.clip()}function $r(i,e){let{line:t,target:n,property:r,color:s,scale:o,clip:a}=e,l=Id(t,n,r);for(let{source:c,target:u,start:f,end:d}of l){let{style:{backgroundColor:h=s}={}}=c,m=n!==!0;i.save(),i.fillStyle=h,Gd(i,o,a,m&&ls(r,f,d)),i.beginPath();let p=!!t.pathSegment(i,c),g;if(m){p?i.closePath():ha(i,n,d,r);let b=!!n.pathSegment(i,u,{move:p,reverse:!0});g=p&&b,g||ha(i,n,f,r)}i.closePath(),i.fill(g?"evenodd":"nonzero"),i.restore()}}function Gd(i,e,t,n){let r=e.chart.chartArea,{property:s,start:o,end:a}=n||{};if(s==="x"||s==="y"){let l,c,u,f;s==="x"?(l=o,c=r.top,u=a,f=r.bottom):(l=r.left,c=o,u=r.right,f=a),i.beginPath(),t&&(l=Math.max(l,t.left),u=Math.min(u,t.right),c=Math.max(c,t.top),f=Math.min(f,t.bottom)),i.rect(l,c,u-l,f-c),i.clip()}}function ha(i,e,t,n){let r=e.interpolate(t,n);r&&i.lineTo(r.x,r.y)}var Kd={id:"filler",afterDatasetsUpdate(i,e,t){let n=(i.data.datasets||[]).length,r=[],s,o,a,l;for(o=0;o<n;++o)s=i.getDatasetMeta(o),a=s.dataset,l=null,a&&a.options&&a instanceof pn&&(l={visible:i.isDatasetVisible(o),index:o,fill:Rd(a,o,n),chart:i,axis:s.controller.options.indexAxis,scale:s.vScale,line:a}),s.$filler=l,r.push(l);for(o=0;o<n;++o)l=r[o],!(!l||l.fill===!1)&&(l.fill=Ed(r,o,t.propagate))},beforeDraw(i,e,t){let n=t.drawTime==="beforeDraw",r=i.getSortedVisibleDatasetMetas(),s=i.chartArea;for(let o=r.length-1;o>=0;--o){let a=r[o].$filler;a&&(a.line.updateControlPoints(s,a.axis),n&&a.fill&&qr(i.ctx,a,s))}},beforeDatasetsDraw(i,e,t){if(t.drawTime!=="beforeDatasetsDraw")return;let n=i.getSortedVisibleDatasetMetas();for(let r=n.length-1;r>=0;--r){let s=n[r].$filler;ua(s)&&qr(i.ctx,s,i.chartArea)}},beforeDatasetDraw(i,e,t){let n=e.meta.$filler;!ua(n)||t.drawTime!=="beforeDatasetDraw"||qr(i.ctx,n,i.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}},ma=(i,e)=>{let{boxHeight:t=e,boxWidth:n=e}=i;return i.usePointStyle&&(t=Math.min(t,e),n=i.pointStyleWidth||Math.min(n,e)),{boxWidth:n,boxHeight:t,itemHeight:Math.max(e,t)}},Zd=(i,e)=>i!==null&&e!==null&&i.datasetIndex===e.datasetIndex&&i.index===e.index,mn=class extends It{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.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(e,t,n){this.maxWidth=e,this.maxHeight=t,this._margins=n,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){let e=this.options.labels||{},t=Z(e.generateLabels,[this.chart],this)||[];e.filter&&(t=t.filter(n=>e.filter(n,this.chart.data))),e.sort&&(t=t.sort((n,r)=>e.sort(n,r,this.chart.data))),this.options.reverse&&t.reverse(),this.legendItems=t}fit(){let{options:e,ctx:t}=this;if(!e.display){this.width=this.height=0;return}let n=e.labels,r=ot(n.font),s=r.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=ma(n,s),c,u;t.font=r.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(o,s,a,l)+10):(u=this.maxHeight,c=this._fitCols(o,r,a,l)+10),this.width=Math.min(c,e.maxWidth||this.maxWidth),this.height=Math.min(u,e.maxHeight||this.maxHeight)}_fitRows(e,t,n,r){let{ctx:s,maxWidth:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=r+a,f=e;s.textAlign="left",s.textBaseline="middle";let d=-1,h=-u;return this.legendItems.forEach((m,p)=>{let g=n+t/2+s.measureText(m.text).width;(p===0||c[c.length-1]+g+2*a>o)&&(f+=u,c[c.length-(p>0?0:1)]=0,h+=u,d++),l[p]={left:0,top:h,row:d,width:g,height:r},c[c.length-1]+=g+a}),f}_fitCols(e,t,n,r){let{ctx:s,maxHeight:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=o-e,f=a,d=0,h=0,m=0,p=0;return this.legendItems.forEach((g,b)=>{let{itemWidth:x,itemHeight:w}=Jd(n,t,s,g,r);b>0&&h+w+2*a>u&&(f+=d+a,c.push({width:d,height:h}),m+=d+a,p++,d=h=0),l[b]={left:m,top:h,col:p,width:x,height:w},d=Math.max(d,x),h+=w+a}),f+=d,c.push({width:d,height:h}),f}adjustHitBoxes(){if(!this.options.display)return;let e=this._computeTitleHeight(),{legendHitBoxes:t,options:{align:n,labels:{padding:r},rtl:s}}=this,o=be(s,this.left,this.width);if(this.isHorizontal()){let a=0,l=dt(n,this.left+r,this.right-this.lineWidths[a]);for(let c of t)a!==c.row&&(a=c.row,l=dt(n,this.left+r,this.right-this.lineWidths[a])),c.top+=this.top+e+r,c.left=o.leftForLtr(o.x(l),c.width),l+=c.width+r}else{let a=0,l=dt(n,this.top+e+r,this.bottom-this.columnSizes[a].height);for(let c of t)c.col!==a&&(a=c.col,l=dt(n,this.top+e+r,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+r,c.left=o.leftForLtr(o.x(c.left),c.width),l+=c.height+r}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){let e=this.ctx;oi(e,this),this._draw(),ai(e)}}_draw(){let{options:e,columnSizes:t,lineWidths:n,ctx:r}=this,{align:s,labels:o}=e,a=it.color,l=be(e.rtl,this.left,this.width),c=ot(o.font),{padding:u}=o,f=c.size,d=f/2,h;this.drawTitle(),r.textAlign=l.textAlign("left"),r.textBaseline="middle",r.lineWidth=.5,r.font=c.string;let{boxWidth:m,boxHeight:p,itemHeight:g}=ma(o,f),b=function(_,C,P){if(isNaN(m)||m<=0||isNaN(p)||p<0)return;r.save();let O=z(P.lineWidth,1);if(r.fillStyle=z(P.fillStyle,a),r.lineCap=z(P.lineCap,"butt"),r.lineDashOffset=z(P.lineDashOffset,0),r.lineJoin=z(P.lineJoin,"miter"),r.lineWidth=O,r.strokeStyle=z(P.strokeStyle,a),r.setLineDash(z(P.lineDash,[])),o.usePointStyle){let R={radius:p*Math.SQRT2/2,pointStyle:P.pointStyle,rotation:P.rotation,borderWidth:O},W=l.xPlus(_,m/2),H=C+d;kr(r,R,W,H,o.pointStyleWidth&&m)}else{let R=C+Math.max((f-p)/2,0),W=l.leftForLtr(_,m),H=oe(P.borderRadius);r.beginPath(),Object.values(H).some(nt=>nt!==0)?Ne(r,{x:W,y:R,w:m,h:p,radius:H}):r.rect(W,R,m,p),r.fill(),O!==0&&r.stroke()}r.restore()},x=function(_,C,P){se(r,P.text,_,C+g/2,c,{strikethrough:P.hidden,textAlign:l.textAlign(P.textAlign)})},w=this.isHorizontal(),k=this._computeTitleHeight();w?h={x:dt(s,this.left+u,this.right-n[0]),y:this.top+u+k,line:0}:h={x:this.left+u,y:dt(s,this.top+k+u,this.bottom-t[0].height),line:0},Ir(this.ctx,e.textDirection);let v=g+u;this.legendItems.forEach((_,C)=>{r.strokeStyle=_.fontColor,r.fillStyle=_.fontColor;let P=r.measureText(_.text).width,O=l.textAlign(_.textAlign||(_.textAlign=o.textAlign)),R=m+d+P,W=h.x,H=h.y;l.setWidth(this.width),w?C>0&&W+R+u>this.right&&(H=h.y+=v,h.line++,W=h.x=dt(s,this.left+u,this.right-n[h.line])):C>0&&H+v>this.bottom&&(W=h.x=W+t[h.line].width+u,h.line++,H=h.y=dt(s,this.top+k+u,this.bottom-t[h.line].height));let nt=l.x(W);if(b(nt,H,_),W=mo(O,W+m+d,w?W+R:this.right,e.rtl),x(l.x(W),H,_),w)h.x+=R+u;else if(typeof _.text!="string"){let ut=c.lineHeight;h.y+=Qa(_,ut)+u}else h.y+=v}),Lr(this.ctx,e.textDirection)}drawTitle(){let e=this.options,t=e.title,n=ot(t.font),r=ht(t.padding);if(!t.display)return;let s=be(e.rtl,this.left,this.width),o=this.ctx,a=t.position,l=n.size/2,c=r.top+l,u,f=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),u=this.top+c,f=dt(e.align,f,this.right-d);else{let m=this.columnSizes.reduce((p,g)=>Math.max(p,g.height),0);u=c+dt(e.align,this.top,this.bottom-m-e.labels.padding-this._computeTitleHeight())}let h=dt(a,f,f+d);o.textAlign=s.textAlign(qi(a)),o.textBaseline="middle",o.strokeStyle=t.color,o.fillStyle=t.color,o.font=n.string,se(o,t.text,h,u,n)}_computeTitleHeight(){let e=this.options.title,t=ot(e.font),n=ht(e.padding);return e.display?t.lineHeight+n.height:0}_getLegendItemAt(e,t){let n,r,s;if(Wt(e,this.left,this.right)&&Wt(t,this.top,this.bottom)){for(s=this.legendHitBoxes,n=0;n<s.length;++n)if(r=s[n],Wt(e,r.left,r.left+r.width)&&Wt(t,r.top,r.top+r.height))return this.legendItems[n]}return null}handleEvent(e){let t=this.options;if(!ih(e.type,t))return;let n=this._getLegendItemAt(e.x,e.y);if(e.type==="mousemove"||e.type==="mouseout"){let r=this._hoveredItem,s=Zd(r,n);r&&!s&&Z(t.onLeave,[e,r,this],this),this._hoveredItem=n,n&&!s&&Z(t.onHover,[e,n,this],this)}else n&&Z(t.onClick,[e,n,this],this)}};function Jd(i,e,t,n,r){let s=th(n,i,e,t),o=eh(r,n,e.lineHeight);return{itemWidth:s,itemHeight:o}}function th(i,e,t,n){let r=i.text;return r&&typeof r!="string"&&(r=r.reduce((s,o)=>s.length>o.length?s:o)),e+t.size/2+n.measureText(r).width}function eh(i,e,t){let n=i;return typeof e.text!="string"&&(n=Qa(e,t)),n}function Qa(i,e){let t=i.text?i.text.length:0;return e*t}function ih(i,e){return!!((i==="mousemove"||i==="mouseout")&&(e.onHover||e.onLeave)||e.onClick&&(i==="click"||i==="mouseup"))}var nh={id:"legend",_element:mn,start(i,e,t){let n=i.legend=new mn({ctx:i.ctx,options:t,chart:i});mt.configure(i,n,t),mt.addBox(i,n)},stop(i){mt.removeBox(i,i.legend),delete i.legend},beforeUpdate(i,e,t){let n=i.legend;mt.configure(i,n,t),n.options=t},afterUpdate(i){let e=i.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(i,e){e.replay||i.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(i,e,t){let n=e.datasetIndex,r=t.chart;r.isDatasetVisible(n)?(r.hide(n),e.hidden=!0):(r.show(n),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:i=>i.chart.options.color,boxWidth:40,padding:10,generateLabels(i){let e=i.data.datasets,{labels:{usePointStyle:t,pointStyle:n,textAlign:r,color:s,useBorderRadius:o,borderRadius:a}}=i.legend.options;return i._getSortedDatasetMetas().map(l=>{let c=l.controller.getStyle(t?0:void 0),u=ht(c.borderWidth);return{text:e[l.index].label,fillStyle:c.backgroundColor,fontColor:s,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:n||c.pointStyle,rotation:c.rotation,textAlign:r||c.textAlign,borderRadius:o&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:i=>i.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:i=>!i.startsWith("on"),labels:{_scriptable:i=>!["generateLabels","filter","sort"].includes(i)}}},gi=class extends It{constructor(e){super(),this.chart=e.chart,this.options=e.options,this.ctx=e.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(e,t){let n=this.options;if(this.left=0,this.top=0,!n.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=e,this.height=this.bottom=t;let r=tt(n.text)?n.text.length:1;this._padding=ht(n.padding);let s=r*ot(n.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=s:this.width=s}isHorizontal(){let e=this.options.position;return e==="top"||e==="bottom"}_drawArgs(e){let{top:t,left:n,bottom:r,right:s,options:o}=this,a=o.align,l=0,c,u,f;return this.isHorizontal()?(u=dt(a,n,s),f=t+e,c=s-n):(o.position==="left"?(u=n+e,f=dt(a,r,t),l=$*-.5):(u=s-e,f=dt(a,t,r),l=$*.5),c=r-t),{titleX:u,titleY:f,maxWidth:c,rotation:l}}draw(){let e=this.ctx,t=this.options;if(!t.display)return;let n=ot(t.font),s=n.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(s);se(e,t.text,0,0,n,{color:t.color,maxWidth:l,rotation:c,textAlign:qi(t.align),textBaseline:"middle",translation:[o,a]})}};function rh(i,e){let t=new gi({ctx:i.ctx,options:e,chart:i});mt.configure(i,t,e),mt.addBox(i,t),i.titleBlock=t}var sh={id:"title",_element:gi,start(i,e,t){rh(i,t)},stop(i){let e=i.titleBlock;mt.removeBox(i,e),delete i.titleBlock},beforeUpdate(i,e,t){let n=i.titleBlock;mt.configure(i,n,t),n.options=t},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}},rn=new WeakMap,oh={id:"subtitle",start(i,e,t){let n=new gi({ctx:i.ctx,options:t,chart:i});mt.configure(i,n,t),mt.addBox(i,n),rn.set(i,n)},stop(i){mt.removeBox(i,rn.get(i)),rn.delete(i)},beforeUpdate(i,e,t){let n=rn.get(i);mt.configure(i,n,t),n.options=t},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}},mi={average(i){if(!i.length)return!1;let e,t,n=new Set,r=0,s=0;for(e=0,t=i.length;e<t;++e){let a=i[e].element;if(a&&a.hasValue()){let l=a.tooltipPosition();n.add(l.x),r+=l.y,++s}}return s===0||n.size===0?!1:{x:[...n].reduce((a,l)=>a+l)/n.size,y:r/s}},nearest(i,e){if(!i.length)return!1;let t=e.x,n=e.y,r=Number.POSITIVE_INFINITY,s,o,a;for(s=0,o=i.length;s<o;++s){let l=i[s].element;if(l&&l.hasValue()){let c=l.getCenterPoint(),u=Bi(e,c);u<r&&(r=u,a=l)}}if(a){let l=a.tooltipPosition();t=l.x,n=l.y}return{x:t,y:n}}};function Nt(i,e){return e&&(tt(e)?Array.prototype.push.apply(i,e):i.push(e)),i}function Xt(i){return(typeof i=="string"||i instanceof String)&&i.indexOf(`
|
|
2
|
-
`)>-1?i.split(`
|
|
3
|
-
`):i}function ah(i,e){let{element:t,datasetIndex:n,index:r}=e,s=i.getDatasetMeta(n).controller,{label:o,value:a}=s.getLabelAndValue(r);return{chart:i,label:o,parsed:s.getParsed(r),raw:i.data.datasets[n].data[r],formattedValue:a,dataset:s.getDataset(),dataIndex:r,datasetIndex:n,element:t}}function pa(i,e){let t=i.chart.ctx,{body:n,footer:r,title:s}=i,{boxWidth:o,boxHeight:a}=e,l=ot(e.bodyFont),c=ot(e.titleFont),u=ot(e.footerFont),f=s.length,d=r.length,h=n.length,m=ht(e.padding),p=m.height,g=0,b=n.reduce((k,v)=>k+v.before.length+v.lines.length+v.after.length,0);if(b+=i.beforeBody.length+i.afterBody.length,f&&(p+=f*c.lineHeight+(f-1)*e.titleSpacing+e.titleMarginBottom),b){let k=e.displayColors?Math.max(a,l.lineHeight):l.lineHeight;p+=h*k+(b-h)*l.lineHeight+(b-1)*e.bodySpacing}d&&(p+=e.footerMarginTop+d*u.lineHeight+(d-1)*e.footerSpacing);let x=0,w=function(k){g=Math.max(g,t.measureText(k).width+x)};return t.save(),t.font=c.string,Q(i.title,w),t.font=l.string,Q(i.beforeBody.concat(i.afterBody),w),x=e.displayColors?o+2+e.boxPadding:0,Q(n,k=>{Q(k.before,w),Q(k.lines,w),Q(k.after,w)}),x=0,t.font=u.string,Q(i.footer,w),t.restore(),g+=m.width,{width:g,height:p}}function lh(i,e){let{y:t,height:n}=e;return t<n/2?"top":t>i.height-n/2?"bottom":"center"}function ch(i,e,t,n){let{x:r,width:s}=n,o=t.caretSize+t.caretPadding;if(i==="left"&&r+s+o>e.width||i==="right"&&r-s-o<0)return!0}function uh(i,e,t,n){let{x:r,width:s}=t,{width:o,chartArea:{left:a,right:l}}=i,c="center";return n==="center"?c=r<=(a+l)/2?"left":"right":r<=s/2?c="left":r>=o-s/2&&(c="right"),ch(c,i,e,t)&&(c="center"),c}function ga(i,e,t){let n=t.yAlign||e.yAlign||lh(i,t);return{xAlign:t.xAlign||e.xAlign||uh(i,e,t,n),yAlign:n}}function fh(i,e){let{x:t,width:n}=i;return e==="right"?t-=n:e==="center"&&(t-=n/2),t}function dh(i,e,t){let{y:n,height:r}=i;return e==="top"?n+=t:e==="bottom"?n-=r+t:n-=r/2,n}function ba(i,e,t,n){let{caretSize:r,caretPadding:s,cornerRadius:o}=i,{xAlign:a,yAlign:l}=t,c=r+s,{topLeft:u,topRight:f,bottomLeft:d,bottomRight:h}=oe(o),m=fh(e,a),p=dh(e,l,c);return l==="center"?a==="left"?m+=c:a==="right"&&(m-=c):a==="left"?m-=Math.max(u,d)+r:a==="right"&&(m+=Math.max(f,h)+r),{x:lt(m,0,n.width-e.width),y:lt(p,0,n.height-e.height)}}function sn(i,e,t){let n=ht(t.padding);return e==="center"?i.x+i.width/2:e==="right"?i.x+i.width-n.right:i.x+n.left}function xa(i){return Nt([],Xt(i))}function hh(i,e,t){return qt(i,{tooltip:e,tooltipItems:t,type:"tooltip"})}function va(i,e){let t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?i.override(t):i}var Ga={beforeTitle:Ft,title(i){if(i.length>0){let e=i[0],t=e.chart.data.labels,n=t?t.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(n>0&&e.dataIndex<n)return t[e.dataIndex]}return""},afterTitle:Ft,beforeBody:Ft,beforeLabel:Ft,label(i){if(this&&this.options&&this.options.mode==="dataset")return i.label+": "+i.formattedValue||i.formattedValue;let e=i.dataset.label||"";e&&(e+=": ");let t=i.formattedValue;return U(t)||(e+=t),e},labelColor(i){let t=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.dataIndex);return{borderColor:t.borderColor,backgroundColor:t.backgroundColor,borderWidth:t.borderWidth,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(i){let t=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.dataIndex);return{pointStyle:t.pointStyle,rotation:t.rotation}},afterLabel:Ft,afterBody:Ft,beforeFooter:Ft,footer:Ft,afterFooter:Ft};function xt(i,e,t,n){let r=i[e].call(t,n);return typeof r>"u"?Ga[e].call(t,n):r}var ya=(()=>{class i extends It{static positioners=mi;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){let t=this._cachedAnimations;if(t)return t;let n=this.chart,r=this.options.setContext(this.getContext()),s=r.enabled&&n.options.animation&&r.animations,o=new cn(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=hh(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){let{callbacks:r}=n,s=xt(r,"beforeTitle",this,t),o=xt(r,"title",this,t),a=xt(r,"afterTitle",this,t),l=[];return l=Nt(l,Xt(s)),l=Nt(l,Xt(o)),l=Nt(l,Xt(a)),l}getBeforeBody(t,n){return xa(xt(n.callbacks,"beforeBody",this,t))}getBody(t,n){let{callbacks:r}=n,s=[];return Q(t,o=>{let a={before:[],lines:[],after:[]},l=va(r,o);Nt(a.before,Xt(xt(l,"beforeLabel",this,o))),Nt(a.lines,xt(l,"label",this,o)),Nt(a.after,Xt(xt(l,"afterLabel",this,o))),s.push(a)}),s}getAfterBody(t,n){return xa(xt(n.callbacks,"afterBody",this,t))}getFooter(t,n){let{callbacks:r}=n,s=xt(r,"beforeFooter",this,t),o=xt(r,"footer",this,t),a=xt(r,"afterFooter",this,t),l=[];return l=Nt(l,Xt(s)),l=Nt(l,Xt(o)),l=Nt(l,Xt(a)),l}_createItems(t){let n=this._active,r=this.chart.data,s=[],o=[],a=[],l=[],c,u;for(c=0,u=n.length;c<u;++c)l.push(ah(this.chart,n[c]));return t.filter&&(l=l.filter((f,d,h)=>t.filter(f,d,h,r))),t.itemSort&&(l=l.sort((f,d)=>t.itemSort(f,d,r))),Q(l,f=>{let d=va(t.callbacks,f);s.push(xt(d,"labelColor",this,f)),o.push(xt(d,"labelPointStyle",this,f)),a.push(xt(d,"labelTextColor",this,f))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=a,this.dataPoints=l,l}update(t,n){let r=this.options.setContext(this.getContext()),s=this._active,o,a=[];if(!s.length)this.opacity!==0&&(o={opacity:0});else{let l=mi[r.position].call(this,s,this._eventPosition);a=this._createItems(r),this.title=this.getTitle(a,r),this.beforeBody=this.getBeforeBody(a,r),this.body=this.getBody(a,r),this.afterBody=this.getAfterBody(a,r),this.footer=this.getFooter(a,r);let c=this._size=pa(this,r),u=Object.assign({},l,c),f=ga(this.chart,r,u),d=ba(r,u,f,this.chart);this.xAlign=f.xAlign,this.yAlign=f.yAlign,o={opacity:1,x:d.x,y:d.y,width:c.width,height:c.height,caretX:l.x,caretY:l.y}}this._tooltipItems=a,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,r,s){let o=this.getCaretPosition(t,r,s);n.lineTo(o.x1,o.y1),n.lineTo(o.x2,o.y2),n.lineTo(o.x3,o.y3)}getCaretPosition(t,n,r){let{xAlign:s,yAlign:o}=this,{caretSize:a,cornerRadius:l}=r,{topLeft:c,topRight:u,bottomLeft:f,bottomRight:d}=oe(l),{x:h,y:m}=t,{width:p,height:g}=n,b,x,w,k,v,_;return o==="center"?(v=m+g/2,s==="left"?(b=h,x=b-a,k=v+a,_=v-a):(b=h+p,x=b+a,k=v-a,_=v+a),w=b):(s==="left"?x=h+Math.max(c,f)+a:s==="right"?x=h+p-Math.max(u,d)-a:x=this.caretX,o==="top"?(k=m,v=k-a,b=x-a,w=x+a):(k=m+g,v=k+a,b=x+a,w=x-a),_=k),{x1:b,x2:x,x3:w,y1:k,y2:v,y3:_}}drawTitle(t,n,r){let s=this.title,o=s.length,a,l,c;if(o){let u=be(r.rtl,this.x,this.width);for(t.x=sn(this,r.titleAlign,r),n.textAlign=u.textAlign(r.titleAlign),n.textBaseline="middle",a=ot(r.titleFont),l=r.titleSpacing,n.fillStyle=r.titleColor,n.font=a.string,c=0;c<o;++c)n.fillText(s[c],u.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+l,c+1===o&&(t.y+=r.titleMarginBottom-l)}}_drawColorBox(t,n,r,s,o){let a=this.labelColors[r],l=this.labelPointStyles[r],{boxHeight:c,boxWidth:u}=o,f=ot(o.bodyFont),d=sn(this,"left",o),h=s.x(d),m=c<f.lineHeight?(f.lineHeight-c)/2:0,p=n.y+m;if(o.usePointStyle){let g={radius:Math.min(u,c)/2,pointStyle:l.pointStyle,rotation:l.rotation,borderWidth:1},b=s.leftForLtr(h,u)+u/2,x=p+c/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,Xi(t,g,b,x),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,Xi(t,g,b,x)}else{t.lineWidth=V(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;let g=s.leftForLtr(h,u),b=s.leftForLtr(s.xPlus(h,1),u-2),x=oe(a.borderRadius);Object.values(x).some(w=>w!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,Ne(t,{x:g,y:p,w:u,h:c,radius:x}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),Ne(t,{x:b,y:p+1,w:u-2,h:c-2,radius:x}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(g,p,u,c),t.strokeRect(g,p,u,c),t.fillStyle=a.backgroundColor,t.fillRect(b,p+1,u-2,c-2))}t.fillStyle=this.labelTextColors[r]}drawBody(t,n,r){let{body:s}=this,{bodySpacing:o,bodyAlign:a,displayColors:l,boxHeight:c,boxWidth:u,boxPadding:f}=r,d=ot(r.bodyFont),h=d.lineHeight,m=0,p=be(r.rtl,this.x,this.width),g=function(O){n.fillText(O,p.x(t.x+m),t.y+h/2),t.y+=h+o},b=p.textAlign(a),x,w,k,v,_,C,P;for(n.textAlign=a,n.textBaseline="middle",n.font=d.string,t.x=sn(this,b,r),n.fillStyle=r.bodyColor,Q(this.beforeBody,g),m=l&&b!=="right"?a==="center"?u/2+f:u+2+f:0,v=0,C=s.length;v<C;++v){for(x=s[v],w=this.labelTextColors[v],n.fillStyle=w,Q(x.before,g),k=x.lines,l&&k.length&&(this._drawColorBox(n,t,v,p,r),h=Math.max(d.lineHeight,c)),_=0,P=k.length;_<P;++_)g(k[_]),h=d.lineHeight;Q(x.after,g)}m=0,h=d.lineHeight,Q(this.afterBody,g),t.y-=o}drawFooter(t,n,r){let s=this.footer,o=s.length,a,l;if(o){let c=be(r.rtl,this.x,this.width);for(t.x=sn(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=c.textAlign(r.footerAlign),n.textBaseline="middle",a=ot(r.footerFont),n.fillStyle=r.footerColor,n.font=a.string,l=0;l<o;++l)n.fillText(s[l],c.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+r.footerSpacing}}drawBackground(t,n,r,s){let{xAlign:o,yAlign:a}=this,{x:l,y:c}=t,{width:u,height:f}=r,{topLeft:d,topRight:h,bottomLeft:m,bottomRight:p}=oe(s.cornerRadius);n.fillStyle=s.backgroundColor,n.strokeStyle=s.borderColor,n.lineWidth=s.borderWidth,n.beginPath(),n.moveTo(l+d,c),a==="top"&&this.drawCaret(t,n,r,s),n.lineTo(l+u-h,c),n.quadraticCurveTo(l+u,c,l+u,c+h),a==="center"&&o==="right"&&this.drawCaret(t,n,r,s),n.lineTo(l+u,c+f-p),n.quadraticCurveTo(l+u,c+f,l+u-p,c+f),a==="bottom"&&this.drawCaret(t,n,r,s),n.lineTo(l+m,c+f),n.quadraticCurveTo(l,c+f,l,c+f-m),a==="center"&&o==="left"&&this.drawCaret(t,n,r,s),n.lineTo(l,c+d),n.quadraticCurveTo(l,c,l+d,c),n.closePath(),n.fill(),s.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){let n=this.chart,r=this.$animations,s=r&&r.x,o=r&&r.y;if(s||o){let a=mi[t.position].call(this,this._active,this._eventPosition);if(!a)return;let l=this._size=pa(this,t),c=Object.assign({},a,this._size),u=ga(n,t,c),f=ba(t,c,u,n);(s._to!==f.x||o._to!==f.y)&&(this.xAlign=u.xAlign,this.yAlign=u.yAlign,this.width=l.width,this.height=l.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,f))}}_willRender(){return!!this.opacity}draw(t){let n=this.options.setContext(this.getContext()),r=this.opacity;if(!r)return;this._updateAnimationTarget(n);let s={width:this.width,height:this.height},o={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;let a=ht(n.padding),l=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&l&&(t.save(),t.globalAlpha=r,this.drawBackground(o,t,s,n),Ir(t,n.textDirection),o.y+=a.top,this.drawTitle(o,t,n),this.drawBody(o,t,n),this.drawFooter(o,t,n),Lr(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){let r=this._active,s=t.map(({datasetIndex:l,index:c})=>{let u=this.chart.getDatasetMeta(l);if(!u)throw new Error("Cannot find a dataset at index "+l);return{datasetIndex:l,element:u.data[c],index:c}}),o=!ri(r,s),a=this._positionChanged(s,n);(o||a)&&(this._active=s,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;let s=this.options,o=this._active||[],a=this._getActiveElements(t,o,n,r),l=this._positionChanged(a,t),c=n||!ri(a,o)||l;return c&&(this._active=a,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),c}_getActiveElements(t,n,r,s){let o=this.options;if(t.type==="mouseout")return[];if(!s)return n.filter(l=>this.chart.data.datasets[l.datasetIndex]&&this.chart.getDatasetMeta(l.datasetIndex).controller.getParsed(l.index)!==void 0);let a=this.chart.getElementsAtEventForMode(t,o.mode,o,r);return o.reverse&&a.reverse(),a}_positionChanged(t,n){let{caretX:r,caretY:s,options:o}=this,a=mi[o.position].call(this,t,n);return a!==!1&&(r!==a.x||s!==a.y)}}return i})(),mh={id:"tooltip",_element:ya,positioners:mi,afterInit(i,e,t){t&&(i.tooltip=new ya({chart:i,options:t}))},beforeUpdate(i,e,t){i.tooltip&&i.tooltip.initialize(t)},reset(i,e,t){i.tooltip&&i.tooltip.initialize(t)},afterDraw(i){let e=i.tooltip;if(e&&e._willRender()){let t={tooltip:e};if(i.notifyPlugins("beforeTooltipDraw",Ai(Si({},t),{cancelable:!0}))===!1)return;e.draw(i.ctx),i.notifyPlugins("afterTooltipDraw",t)}},afterEvent(i,e){if(i.tooltip){let t=e.replay;i.tooltip.handleEvent(e.event,t,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(i,e)=>e.bodyFont.size,boxWidth:(i,e)=>e.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:Ga},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:i=>i!=="filter"&&i!=="itemSort"&&i!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},ph=Object.freeze({__proto__:null,Colors:Pd,Decimation:Ad,Filler:Kd,Legend:nh,SubTitle:oh,Title:sh,Tooltip:mh}),gh=(i,e,t,n)=>(typeof e=="string"?(t=i.push(e)-1,n.unshift({index:t,label:e})):isNaN(e)&&(t=null),t);function bh(i,e,t,n){let r=i.indexOf(e);if(r===-1)return gh(i,e,t,n);let s=i.lastIndexOf(e);return r!==s?t:r}var xh=(i,e)=>i===null?null:lt(Math.round(i),0,e);function _a(i){let e=this.getLabels();return i>=0&&i<e.length?e[i]:i}var vh=(()=>{class i extends ye{static id="category";static defaults={ticks:{callback:_a}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){let n=this._addedLabels;if(n.length){let r=this.getLabels();for(let{index:s,label:o}of n)r[s]===o&&r.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(U(t))return null;let r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:bh(r,t,z(n,t),this._addedLabels),xh(n,r.length-1)}determineDataLimits(){let{minDefined:t,maxDefined:n}=this.getUserBounds(),{min:r,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(r=0),n||(s=this.getLabels().length-1)),this.min=r,this.max=s}buildTicks(){let t=this.min,n=this.max,r=this.options.offset,s=[],o=this.getLabels();o=t===0&&n===o.length-1?o:o.slice(t,n+1),this._valueRange=Math.max(o.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let a=t;a<=n;a++)s.push({value:a});return s}getLabelForValue(t){return _a.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){let n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}return i})();function yh(i,e){let t=[],{bounds:r,step:s,min:o,max:a,precision:l,count:c,maxTicks:u,maxDigits:f,includeBounds:d}=i,h=s||1,m=u-1,{min:p,max:g}=e,b=!U(o),x=!U(a),w=!U(c),k=(g-p)/(f+1),v=fr((g-p)/m/h)*h,_,C,P,O;if(v<1e-14&&!b&&!x)return[{value:p},{value:g}];O=Math.ceil(g/v)-Math.floor(p/v),O>m&&(v=fr(O*v/m/h)*h),U(l)||(_=Math.pow(10,l),v=Math.ceil(v*_)/_),r==="ticks"?(C=Math.floor(p/v)*v,P=Math.ceil(g/v)*v):(C=p,P=g),b&&x&&s&&oo((a-o)/s,v/1e3)?(O=Math.round(Math.min((a-o)/v,u)),v=(a-o)/O,C=o,P=a):w?(C=b?o:C,P=x?a:P,O=c-1,v=(P-C)/O):(O=(P-C)/v,Re(O,Math.round(O),v/1e3)?O=Math.round(O):O=Math.ceil(O));let R=Math.max(hr(v),hr(C));_=Math.pow(10,U(l)?R:l),C=Math.round(C*_)/_,P=Math.round(P*_)/_;let W=0;for(b&&(d&&C!==o?(t.push({value:o}),C<o&&W++,Re(Math.round((C+W*v)*_)/_,o,wa(o,k,i))&&W++):C<o&&W++);W<O;++W){let H=Math.round((C+W*v)*_)/_;if(x&&H>a)break;t.push({value:H})}return x&&d&&P!==a?t.length&&Re(t[t.length-1].value,a,wa(a,k,i))?t[t.length-1].value=a:t.push({value:a}):(!x||P===a)&&t.push({value:P}),t}function wa(i,e,{horizontal:t,minRotation:n}){let r=Dt(n),s=(t?Math.sin(r):Math.cos(r))||.001,o=.75*e*(""+i).length;return Math.min(e/s,o)}var Ye=class extends ye{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,t){return U(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){let{beginAtZero:e}=this.options,{minDefined:t,maxDefined:n}=this.getUserBounds(),{min:r,max:s}=this,o=l=>r=t?r:l,a=l=>s=n?s:l;if(e){let l=At(r),c=At(s);l<0&&c<0?a(0):l>0&&c>0&&o(0)}if(r===s){let l=s===0?1:Math.abs(s*.05);a(s+l),e||o(r-l)}this.min=r,this.max=s}getTickLimit(){let e=this.options.ticks,{maxTicksLimit:t,stepSize:n}=e,r;return n?(r=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,r>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${r} ticks. Limiting to 1000.`),r=1e3)):(r=this.computeTickLimit(),t=t||11),t&&(r=Math.min(t,r)),r}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){let e=this.options,t=e.ticks,n=this.getTickLimit();n=Math.max(2,n);let r={maxTicks:n,bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:t.includeBounds!==!1},s=this._range||this,o=yh(r,s);return e.bounds==="ticks"&&dr(o,this,"value"),e.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){let e=this.ticks,t=this.min,n=this.max;if(super.configure(),this.options.offset&&e.length){let r=(n-t)/Math.max(e.length-1,1)/2;t-=r,n+=r}this._startValue=t,this._endValue=n,this._valueRange=n-t}getLabelForValue(e){return We(e,this.chart.options.locale,this.options.ticks.format)}},cs=class extends Ye{static id="linear";static defaults={ticks:{callback:si.formatters.numeric}};determineDataLimits(){let{min:e,max:t}=this.getMinMax(!0);this.min=rt(e)?e:0,this.max=rt(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){let e=this.isHorizontal(),t=e?this.width:this.height,n=Dt(this.options.ticks.minRotation),r=(e?Math.sin(n):Math.cos(n))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,s.lineHeight/r))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}},bi=i=>Math.floor(Vt(i)),ve=(i,e)=>Math.pow(10,bi(i)+e);function Ma(i){return i/Math.pow(10,bi(i))===1}function ka(i,e,t){let n=Math.pow(10,t),r=Math.floor(i/n);return Math.ceil(e/n)-r}function _h(i,e){let t=e-i,n=bi(t);for(;ka(i,e,n)>10;)n++;for(;ka(i,e,n)<10;)n--;return Math.min(n,bi(i))}function wh(i,{min:e,max:t}){e=bt(i.min,e);let n=[],r=bi(e),s=_h(e,t),o=s<0?Math.pow(10,Math.abs(s)):1,a=Math.pow(10,s),l=r>s?Math.pow(10,r):0,c=Math.round((e-l)*o)/o,u=Math.floor((e-l)/a/10)*a*10,f=Math.floor((c-u)/Math.pow(10,s)),d=bt(i.min,Math.round((l+u+f*Math.pow(10,s))*o)/o);for(;d<t;)n.push({value:d,major:Ma(d),significand:f}),f>=10?f=f<15?15:20:f++,f>=20&&(s++,f=2,o=s>=0?1:o),d=Math.round((l+u+f*Math.pow(10,s))*o)/o;let h=bt(i.max,d);return n.push({value:h,major:Ma(h),significand:f}),n}var us=class extends ye{static id="logarithmic";static defaults={ticks:{callback:si.formatters.logarithmic,major:{enabled:!0}}};constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,t){let n=Ye.prototype.parse.apply(this,[e,t]);if(n===0){this._zero=!0;return}return rt(n)&&n>0?n:null}determineDataLimits(){let{min:e,max:t}=this.getMinMax(!0);this.min=rt(e)?Math.max(0,e):null,this.max=rt(t)?Math.max(0,t):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!rt(this._userMin)&&(this.min=e===ve(this.min,0)?ve(this.min,-1):ve(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){let{minDefined:e,maxDefined:t}=this.getUserBounds(),n=this.min,r=this.max,s=a=>n=e?n:a,o=a=>r=t?r:a;n===r&&(n<=0?(s(1),o(10)):(s(ve(n,-1)),o(ve(r,1)))),n<=0&&s(ve(r,-1)),r<=0&&o(ve(n,1)),this.min=n,this.max=r}buildTicks(){let e=this.options,t={min:this._userMin,max:this._userMax},n=wh(t,this);return e.bounds==="ticks"&&dr(n,this,"value"),e.reverse?(n.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),n}getLabelForValue(e){return e===void 0?"0":We(e,this.chart.options.locale,this.options.ticks.format)}configure(){let e=this.min;super.configure(),this._startValue=Vt(e),this._valueRange=Vt(this.max)-Vt(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(Vt(e)-this._startValue)/this._valueRange)}getValueForPixel(e){let t=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+t*this._valueRange)}};function fs(i){let e=i.ticks;if(e.display&&i.display){let t=ht(e.backdropPadding);return z(e.font&&e.font.size,it.font.size)+t.height}return 0}function Mh(i,e,t){return t=tt(t)?t:[t],{w:go(i,e.string,t),h:t.length*e.lineHeight}}function Ta(i,e,t,n,r){return i===n||i===r?{start:e-t/2,end:e+t/2}:i<n||i>r?{start:e-t,end:e}:{start:e,end:e+t}}function kh(i){let e={l:i.left+i._padding.left,r:i.right-i._padding.right,t:i.top+i._padding.top,b:i.bottom-i._padding.bottom},t=Object.assign({},e),n=[],r=[],s=i._pointLabels.length,o=i.options.pointLabels,a=o.centerPointLabels?$/s:0;for(let l=0;l<s;l++){let c=o.setContext(i.getPointLabelContext(l));r[l]=c.padding;let u=i.getPointPosition(l,i.drawingArea+r[l],a),f=ot(c.font),d=Mh(i.ctx,f,i._pointLabels[l]);n[l]=d;let h=ft(i.getIndexAngle(l)+a),m=Math.round(Vi(h)),p=Ta(m,u.x,d.w,0,180),g=Ta(m,u.y,d.h,90,270);Th(t,e,h,p,g)}i.setCenterPoint(e.l-t.l,t.r-e.r,e.t-t.t,t.b-e.b),i._pointLabelItems=Ch(i,n,r)}function Th(i,e,t,n,r){let s=Math.abs(Math.sin(t)),o=Math.abs(Math.cos(t)),a=0,l=0;n.start<e.l?(a=(e.l-n.start)/s,i.l=Math.min(i.l,e.l-a)):n.end>e.r&&(a=(n.end-e.r)/s,i.r=Math.max(i.r,e.r+a)),r.start<e.t?(l=(e.t-r.start)/o,i.t=Math.min(i.t,e.t-l)):r.end>e.b&&(l=(r.end-e.b)/o,i.b=Math.max(i.b,e.b+l))}function Dh(i,e,t){let n=i.drawingArea,{extra:r,additionalAngle:s,padding:o,size:a}=t,l=i.getPointPosition(e,n+r+o,s),c=Math.round(Vi(ft(l.angle+st))),u=Ah(l.y,a.h,c),f=Oh(c),d=Sh(l.x,a.w,f);return{visible:!0,x:l.x,y:u,textAlign:f,left:d,top:u,right:d+a.w,bottom:u+a.h}}function Ph(i,e){if(!e)return!0;let{left:t,top:n,right:r,bottom:s}=i;return!(Rt({x:t,y:n},e)||Rt({x:t,y:s},e)||Rt({x:r,y:n},e)||Rt({x:r,y:s},e))}function Ch(i,e,t){let n=[],r=i._pointLabels.length,s=i.options,{centerPointLabels:o,display:a}=s.pointLabels,l={extra:fs(s)/2,additionalAngle:o?$/r:0},c;for(let u=0;u<r;u++){l.padding=t[u],l.size=e[u];let f=Dh(i,u,l);n.push(f),a==="auto"&&(f.visible=Ph(f,c),f.visible&&(c=f))}return n}function Oh(i){return i===0||i===180?"center":i<180?"left":"right"}function Sh(i,e,t){return t==="right"?i-=e:t==="center"&&(i-=e/2),i}function Ah(i,e,t){return t===90||t===270?i-=e/2:(t>270||t<90)&&(i-=e),i}function Ih(i,e,t){let{left:n,top:r,right:s,bottom:o}=t,{backdropColor:a}=e;if(!U(a)){let l=oe(e.borderRadius),c=ht(e.backdropPadding);i.fillStyle=a;let u=n-c.left,f=r-c.top,d=s-n+c.width,h=o-r+c.height;Object.values(l).some(m=>m!==0)?(i.beginPath(),Ne(i,{x:u,y:f,w:d,h,radius:l}),i.fill()):i.fillRect(u,f,d,h)}}function Lh(i,e){let{ctx:t,options:{pointLabels:n}}=i;for(let r=e-1;r>=0;r--){let s=i._pointLabelItems[r];if(!s.visible)continue;let o=n.setContext(i.getPointLabelContext(r));Ih(t,o,s);let a=ot(o.font),{x:l,y:c,textAlign:u}=s;se(t,i._pointLabels[r],l,c+a.lineHeight/2,a,{color:o.color,textAlign:u,textBaseline:"middle"})}}function Ka(i,e,t,n){let{ctx:r}=i;if(t)r.arc(i.xCenter,i.yCenter,e,0,et);else{let s=i.getPointPosition(0,e);r.moveTo(s.x,s.y);for(let o=1;o<n;o++)s=i.getPointPosition(o,e),r.lineTo(s.x,s.y)}}function Eh(i,e,t,n,r){let s=i.ctx,o=e.circular,{color:a,lineWidth:l}=e;!o&&!n||!a||!l||t<0||(s.save(),s.strokeStyle=a,s.lineWidth=l,s.setLineDash(r.dash||[]),s.lineDashOffset=r.dashOffset,s.beginPath(),Ka(i,t,o,n),s.closePath(),s.stroke(),s.restore())}function Rh(i,e,t){return qt(i,{label:t,index:e,type:"pointLabel"})}var ds=class extends Ye{static id="radialLinear";static defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:si.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(e){return e},padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};constructor(e){super(e),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){let e=this._padding=ht(fs(this.options)/2),t=this.width=this.maxWidth-e.width,n=this.height=this.maxHeight-e.height;this.xCenter=Math.floor(this.left+t/2+e.left),this.yCenter=Math.floor(this.top+n/2+e.top),this.drawingArea=Math.floor(Math.min(t,n)/2)}determineDataLimits(){let{min:e,max:t}=this.getMinMax(!1);this.min=rt(e)&&!isNaN(e)?e:0,this.max=rt(t)&&!isNaN(t)?t:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/fs(this.options))}generateTickLabels(e){Ye.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map((t,n)=>{let r=Z(this.options.pointLabels.callback,[t,n],this);return r||r===0?r:""}).filter((t,n)=>this.chart.getDataVisibility(n))}fit(){let e=this.options;e.display&&e.pointLabels.display?kh(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,t,n,r){this.xCenter+=Math.floor((e-t)/2),this.yCenter+=Math.floor((n-r)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,t,n,r))}getIndexAngle(e){let t=et/(this._pointLabels.length||1),n=this.options.startAngle||0;return ft(e*t+Dt(n))}getDistanceFromCenterForValue(e){if(U(e))return NaN;let t=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*t:(e-this.min)*t}getValueForDistanceFromCenter(e){if(U(e))return NaN;let t=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-t:this.min+t}getPointLabelContext(e){let t=this._pointLabels||[];if(e>=0&&e<t.length){let n=t[e];return Rh(this.getContext(),e,n)}}getPointPosition(e,t,n=0){let r=this.getIndexAngle(e)-st+n;return{x:Math.cos(r)*t+this.xCenter,y:Math.sin(r)*t+this.yCenter,angle:r}}getPointPositionForValue(e,t){return this.getPointPosition(e,this.getDistanceFromCenterForValue(t))}getBasePosition(e){return this.getPointPositionForValue(e||0,this.getBaseValue())}getPointLabelPosition(e){let{left:t,top:n,right:r,bottom:s}=this._pointLabelItems[e];return{left:t,top:n,right:r,bottom:s}}drawBackground(){let{backgroundColor:e,grid:{circular:t}}=this.options;if(e){let n=this.ctx;n.save(),n.beginPath(),Ka(this,this.getDistanceFromCenterForValue(this._endValue),t,this._pointLabels.length),n.closePath(),n.fillStyle=e,n.fill(),n.restore()}}drawGrid(){let e=this.ctx,t=this.options,{angleLines:n,grid:r,border:s}=t,o=this._pointLabels.length,a,l,c;if(t.pointLabels.display&&Lh(this,o),r.display&&this.ticks.forEach((u,f)=>{if(f!==0||f===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);let d=this.getContext(f),h=r.setContext(d),m=s.setContext(d);Eh(this,h,l,o,m)}}),n.display){for(e.save(),a=o-1;a>=0;a--){let u=n.setContext(this.getPointLabelContext(a)),{color:f,lineWidth:d}=u;!d||!f||(e.lineWidth=d,e.strokeStyle=f,e.setLineDash(u.borderDash),e.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(t.reverse?this.min:this.max),c=this.getPointPosition(a,l),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(c.x,c.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){let e=this.ctx,t=this.options,n=t.ticks;if(!n.display)return;let r=this.getIndexAngle(0),s,o;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(r),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!t.reverse)return;let c=n.setContext(this.getContext(l)),u=ot(c.font);if(s=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){e.font=u.string,o=e.measureText(a.label).width,e.fillStyle=c.backdropColor;let f=ht(c.backdropPadding);e.fillRect(-o/2-f.left,-s-u.size/2-f.top,o+f.width,u.size+f.height)}se(e,a.label,0,-s,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),e.restore()}drawTitle(){}},bn={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}},vt=Object.keys(bn);function Da(i,e){return i-e}function Pa(i,e){if(U(e))return null;let t=i._adapter,{parser:n,round:r,isoWeekday:s}=i._parseOpts,o=e;return typeof n=="function"&&(o=n(o)),rt(o)||(o=typeof n=="string"?t.parse(o,n):t.parse(o)),o===null?null:(r&&(o=r==="week"&&(ge(s)||s===!0)?t.startOf(o,"isoWeek",s):t.startOf(o,r)),+o)}function Ca(i,e,t,n){let r=vt.length;for(let s=vt.indexOf(i);s<r-1;++s){let o=bn[vt[s]],a=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((t-e)/(a*o.size))<=n)return vt[s]}return vt[r-1]}function Fh(i,e,t,n,r){for(let s=vt.length-1;s>=vt.indexOf(t);s--){let o=vt[s];if(bn[o].common&&i._adapter.diff(r,n,o)>=e-1)return o}return vt[t?vt.indexOf(t):0]}function Wh(i){for(let e=vt.indexOf(i)+1,t=vt.length;e<t;++e)if(bn[vt[e]].common)return vt[e]}function Oa(i,e,t){if(!t)i[e]=!0;else if(t.length){let{lo:n,hi:r}=ji(t,e),s=t[n]>=e?t[n]:t[r];i[s]=!0}}function Nh(i,e,t,n){let r=i._adapter,s=+r.startOf(e[0].value,n),o=e[e.length-1].value,a,l;for(a=s;a<=o;a=+r.add(a,1,n))l=t[a],l>=0&&(e[l].major=!0);return e}function Sa(i,e,t){let n=[],r={},s=e.length,o,a;for(o=0;o<s;++o)a=e[o],r[a]=o,n.push({value:a,major:!1});return s===0||!t?n:Nh(i,n,r,t)}var hs=(()=>{class i extends ye{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,n={}){let r=t.time||(t.time={}),s=this._adapter=new gs._date(t.adapters.date);s.init(n),Le(r.displayFormats,s.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:Pa(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){let t=this.options,n=this._adapter,r=t.time.unit||"day",{min:s,max:o,minDefined:a,maxDefined:l}=this.getUserBounds();function c(u){!a&&!isNaN(u.min)&&(s=Math.min(s,u.min)),!l&&!isNaN(u.max)&&(o=Math.max(o,u.max))}(!a||!l)&&(c(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&c(this.getMinMax(!1))),s=rt(s)&&!isNaN(s)?s:+n.startOf(Date.now(),r),o=rt(o)&&!isNaN(o)?o:+n.endOf(Date.now(),r)+1,this.min=Math.min(s,o-1),this.max=Math.max(s+1,o)}_getLabelBounds(){let t=this.getLabelTimestamps(),n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],r=t[t.length-1]),{min:n,max:r}}buildTicks(){let t=this.options,n=t.time,r=t.ticks,s=r.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);let o=this.min,a=this.max,l=co(s,o,a);return this._unit=n.unit||(r.autoSkip?Ca(n.minUnit,this.min,this.max,this._getLabelCapacity(o)):Fh(this,l.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:Wh(this._unit),this.initOffsets(s),t.reverse&&l.reverse(),Sa(this,l,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,r=0,s,o;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?n=1-s:n=(this.getDecimalForValue(t[1])-s)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?r=o:r=(o-this.getDecimalForValue(t[t.length-2]))/2);let a=t.length<3?.5:.25;n=lt(n,0,a),r=lt(r,0,a),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){let t=this._adapter,n=this.min,r=this.max,s=this.options,o=s.time,a=o.unit||Ca(o.minUnit,n,r,this._getLabelCapacity(n)),l=z(s.ticks.stepSize,1),c=a==="week"?o.isoWeekday:!1,u=ge(c)||c===!0,f={},d=n,h,m;if(u&&(d=+t.startOf(d,"isoWeek",c)),d=+t.startOf(d,u?"day":a),t.diff(r,n,a)>1e5*l)throw new Error(n+" and "+r+" are too far apart with stepSize of "+l+" "+a);let p=s.ticks.source==="data"&&this.getDataTimestamps();for(h=d,m=0;h<r;h=+t.add(h,l,a),m++)Oa(f,h,p);return(h===r||s.bounds==="ticks"||m===1)&&Oa(f,h,p),Object.keys(f).sort(Da).map(g=>+g)}getLabelForValue(t){let n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(t,r.tooltipFormat):n.format(t,r.displayFormats.datetime)}format(t,n){let s=this.options.time.displayFormats,o=this._unit,a=n||s[o];return this._adapter.format(t,a)}_tickFormatFunction(t,n,r,s){let o=this.options,a=o.ticks.callback;if(a)return Z(a,[t,n,r],this);let l=o.time.displayFormats,c=this._unit,u=this._majorUnit,f=c&&l[c],d=u&&l[u],h=r[n],m=u&&d&&h&&h.major;return this._adapter.format(t,s||(m?d:f))}generateTickLabels(t){let n,r,s;for(n=0,r=t.length;n<r;++n)s=t[n],s.label=this._tickFormatFunction(s.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){let n=this._offsets,r=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+r)*n.factor)}getValueForPixel(t){let n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+r*(this.max-this.min)}_getLabelSize(t){let n=this.options.ticks,r=this.ctx.measureText(t).width,s=Dt(this.isHorizontal()?n.maxRotation:n.minRotation),o=Math.cos(s),a=Math.sin(s),l=this._resolveTickFontOptions(0).size;return{w:r*o+l*a,h:r*a+l*o}}_getLabelCapacity(t){let n=this.options.time,r=n.displayFormats,s=r[n.unit]||r.millisecond,o=this._tickFormatFunction(t,0,Sa(this,[t],this._majorUnit),s),a=this._getLabelSize(o),l=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return l>0?l:1}getDataTimestamps(){let t=this._cache.data||[],n,r;if(t.length)return t;let s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(n=0,r=s.length;n<r;++n)t=t.concat(s[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){let t=this._cache.labels||[],n,r;if(t.length)return t;let s=this.getLabels();for(n=0,r=s.length;n<r;++n)t.push(Pa(this,s[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return gr(t.sort(Da))}}return i})();function on(i,e,t){let n=0,r=i.length-1,s,o,a,l;t?(e>=i[n].pos&&e<=i[r].pos&&({lo:n,hi:r}=Et(i,"pos",e)),{pos:s,time:a}=i[n],{pos:o,time:l}=i[r]):(e>=i[n].time&&e<=i[r].time&&({lo:n,hi:r}=Et(i,"time",e)),{time:s,pos:a}=i[n],{time:o,pos:l}=i[r]);let c=o-s;return c?a+(l-a)*(e-s)/c:a}var ms=class extends hs{static id="timeseries";static defaults=hs.defaults;constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){let e=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(e);this._minPos=on(t,this.min),this._tableRange=on(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){let{min:t,max:n}=this,r=[],s=[],o,a,l,c,u;for(o=0,a=e.length;o<a;++o)c=e[o],c>=t&&c<=n&&r.push(c);if(r.length<2)return[{time:t,pos:0},{time:n,pos:1}];for(o=0,a=r.length;o<a;++o)u=r[o+1],l=r[o-1],c=r[o],Math.round((u+l)/2)!==c&&s.push({time:c,pos:o/(a-1)});return s}_generate(){let e=this.min,t=this.max,n=super.getDataTimestamps();return(!n.includes(e)||!n.length)&&n.splice(0,0,e),(!n.includes(t)||n.length===1)&&n.push(t),n.sort((r,s)=>r-s)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;let t=this.getDataTimestamps(),n=this.getLabelTimestamps();return t.length&&n.length?e=this.normalize(t.concat(n)):e=t.length?t:n,e=this._cache.all=e,e}getDecimalForValue(e){return(on(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){let t=this._offsets,n=this.getDecimalForPixel(e)/t.factor-t.end;return on(this._table,n*this._tableRange+this._minPos,!0)}},zh=Object.freeze({__proto__:null,CategoryScale:vh,LinearScale:cs,LogarithmicScale:us,RadialLinearScale:ds,TimeScale:hs,TimeSeriesScale:ms}),Rp=[$u,yd,ph,zh];function gt(i){"@babel/helpers - typeof";return gt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},gt(i)}function F(i){if(i===null||i===!0||i===!1)return NaN;var e=Number(i);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}function y(i,e){if(e.length<i)throw new TypeError(i+" argument"+(i>1?"s":"")+" required, but only "+e.length+" present")}function D(i){y(1,arguments);var e=Object.prototype.toString.call(i);return i instanceof Date||gt(i)==="object"&&e==="[object Date]"?new Date(i.getTime()):typeof i=="number"||e==="[object Number]"?new Date(i):((typeof i=="string"||e==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function Ue(i,e){y(2,arguments);var t=D(i),n=F(e);return isNaN(n)?new Date(NaN):(n&&t.setDate(t.getDate()+n),t)}function ue(i,e){y(2,arguments);var t=D(i),n=F(e);if(isNaN(n))return new Date(NaN);if(!n)return t;var r=t.getDate(),s=new Date(t.getTime());s.setMonth(t.getMonth()+n+1,0);var o=s.getDate();return r>=o?s:(t.setFullYear(s.getFullYear(),s.getMonth(),r),t)}function Pt(i,e){y(2,arguments);var t=D(i).getTime(),n=F(e);return new Date(t+n)}var Hh=36e5;function xn(i,e){y(2,arguments);var t=F(e);return Pt(i,t*Hh)}var Bh={};function pt(){return Bh}function vi(i,e){var t,n,r,s,o,a,l,c;y(1,arguments);var u=pt(),f=F((t=(n=(r=(s=e?.weekStartsOn)!==null&&s!==void 0?s:e==null||(o=e.locale)===null||o===void 0||(a=o.options)===null||a===void 0?void 0:a.weekStartsOn)!==null&&r!==void 0?r:u.weekStartsOn)!==null&&n!==void 0?n:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&t!==void 0?t:0);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=D(i),h=d.getDay(),m=(h<f?7:0)+h-f;return d.setDate(d.getDate()-m),d.setHours(0,0,0,0),d}function fe(i){var e=new Date(Date.UTC(i.getFullYear(),i.getMonth(),i.getDate(),i.getHours(),i.getMinutes(),i.getSeconds(),i.getMilliseconds()));return e.setUTCFullYear(i.getFullYear()),i.getTime()-e.getTime()}function _e(i){y(1,arguments);var e=D(i);return e.setHours(0,0,0,0),e}var Yh=864e5;function bs(i,e){y(2,arguments);var t=_e(i),n=_e(e),r=t.getTime()-fe(t),s=n.getTime()-fe(n);return Math.round((r-s)/Yh)}var Uh=6e4;function vn(i,e){y(2,arguments);var t=F(e);return Pt(i,t*Uh)}function yn(i,e){y(2,arguments);var t=F(e),n=t*3;return ue(i,n)}function _n(i,e){y(2,arguments);var t=F(e);return Pt(i,t*1e3)}function wn(i,e){y(2,arguments);var t=F(e),n=t*7;return Ue(i,n)}function Mn(i,e){y(2,arguments);var t=F(e);return ue(i,t*12)}function de(i,e){y(2,arguments);var t=D(i),n=D(e),r=t.getTime()-n.getTime();return r<0?-1:r>0?1:r}var Vh=365.2425,jh=Math.pow(10,8)*24*60*60*1e3,we=6e4,Me=36e5,Za=1e3,Ug=-jh;var qh=3600;var Ja=qh*24,Vg=Ja*7,$h=Ja*Vh,Xh=$h/12,jg=Xh*3;function xs(i){return y(1,arguments),i instanceof Date||gt(i)==="object"&&Object.prototype.toString.call(i)==="[object Date]"}function Ve(i){if(y(1,arguments),!xs(i)&&typeof i!="number")return!1;var e=D(i);return!isNaN(Number(e))}function vs(i,e){y(2,arguments);var t=D(i),n=D(e),r=t.getFullYear()-n.getFullYear(),s=t.getMonth()-n.getMonth();return r*12+s}function ys(i,e){y(2,arguments);var t=D(i),n=D(e);return t.getFullYear()-n.getFullYear()}function tl(i,e){var t=i.getFullYear()-e.getFullYear()||i.getMonth()-e.getMonth()||i.getDate()-e.getDate()||i.getHours()-e.getHours()||i.getMinutes()-e.getMinutes()||i.getSeconds()-e.getSeconds()||i.getMilliseconds()-e.getMilliseconds();return t<0?-1:t>0?1:t}function je(i,e){y(2,arguments);var t=D(i),n=D(e),r=tl(t,n),s=Math.abs(bs(t,n));t.setDate(t.getDate()-r*s);var o=+(tl(t,n)===-r),a=r*(s-o);return a===0?0:a}function Ht(i,e){return y(2,arguments),D(i).getTime()-D(e).getTime()}var el={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(e){return e<0?Math.ceil(e):Math.floor(e)}},Qh="trunc";function Bt(i){return i?el[i]:el[Qh]}function kn(i,e,t){y(2,arguments);var n=Ht(i,e)/Me;return Bt(t?.roundingMethod)(n)}function Tn(i,e,t){y(2,arguments);var n=Ht(i,e)/we;return Bt(t?.roundingMethod)(n)}function qe(i){y(1,arguments);var e=D(i);return e.setHours(23,59,59,999),e}function $e(i){y(1,arguments);var e=D(i),t=e.getMonth();return e.setFullYear(e.getFullYear(),t+1,0),e.setHours(23,59,59,999),e}function _s(i){y(1,arguments);var e=D(i);return qe(e).getTime()===$e(e).getTime()}function Xe(i,e){y(2,arguments);var t=D(i),n=D(e),r=de(t,n),s=Math.abs(vs(t,n)),o;if(s<1)o=0;else{t.getMonth()===1&&t.getDate()>27&&t.setDate(30),t.setMonth(t.getMonth()-r*s);var a=de(t,n)===-r;_s(D(i))&&s===1&&de(i,n)===1&&(a=!1),o=r*(s-Number(a))}return o===0?0:o}function Dn(i,e,t){y(2,arguments);var n=Xe(i,e)/3;return Bt(t?.roundingMethod)(n)}function Pn(i,e,t){y(2,arguments);var n=Ht(i,e)/1e3;return Bt(t?.roundingMethod)(n)}function Cn(i,e,t){y(2,arguments);var n=je(i,e)/7;return Bt(t?.roundingMethod)(n)}function On(i,e){y(2,arguments);var t=D(i),n=D(e),r=de(t,n),s=Math.abs(ys(t,n));t.setFullYear(1584),n.setFullYear(1584);var o=de(t,n)===-r,a=r*(s-Number(o));return a===0?0:a}function Sn(i){y(1,arguments);var e=D(i);return e.setSeconds(0,0),e}function An(i){y(1,arguments);var e=D(i),t=e.getMonth(),n=t-t%3;return e.setMonth(n,1),e.setHours(0,0,0,0),e}function In(i){y(1,arguments);var e=D(i);return e.setDate(1),e.setHours(0,0,0,0),e}function Ln(i){y(1,arguments);var e=D(i),t=e.getFullYear();return e.setFullYear(t+1,0,0),e.setHours(23,59,59,999),e}function En(i){y(1,arguments);var e=D(i),t=new Date(0);return t.setFullYear(e.getFullYear(),0,1),t.setHours(0,0,0,0),t}function Rn(i){y(1,arguments);var e=D(i);return e.setMinutes(59,59,999),e}function Fn(i,e){var t,n,r,s,o,a,l,c;y(1,arguments);var u=pt(),f=F((t=(n=(r=(s=e?.weekStartsOn)!==null&&s!==void 0?s:e==null||(o=e.locale)===null||o===void 0||(a=o.options)===null||a===void 0?void 0:a.weekStartsOn)!==null&&r!==void 0?r:u.weekStartsOn)!==null&&n!==void 0?n:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&t!==void 0?t:0);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=D(i),h=d.getDay(),m=(h<f?-7:0)+6-(h-f);return d.setDate(d.getDate()+m),d.setHours(23,59,59,999),d}function Wn(i){y(1,arguments);var e=D(i);return e.setSeconds(59,999),e}function Nn(i){y(1,arguments);var e=D(i),t=e.getMonth(),n=t-t%3+3;return e.setMonth(n,0),e.setHours(23,59,59,999),e}function zn(i){y(1,arguments);var e=D(i);return e.setMilliseconds(999),e}function yi(i,e){y(2,arguments);var t=F(e);return Pt(i,-t)}var Gh=864e5;function ws(i){y(1,arguments);var e=D(i),t=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var n=e.getTime(),r=t-n;return Math.floor(r/Gh)+1}function Ct(i){y(1,arguments);var e=1,t=D(i),n=t.getUTCDay(),r=(n<e?7:0)+n-e;return t.setUTCDate(t.getUTCDate()-r),t.setUTCHours(0,0,0,0),t}function _i(i){y(1,arguments);var e=D(i),t=e.getUTCFullYear(),n=new Date(0);n.setUTCFullYear(t+1,0,4),n.setUTCHours(0,0,0,0);var r=Ct(n),s=new Date(0);s.setUTCFullYear(t,0,4),s.setUTCHours(0,0,0,0);var o=Ct(s);return e.getTime()>=r.getTime()?t+1:e.getTime()>=o.getTime()?t:t-1}function Ms(i){y(1,arguments);var e=_i(i),t=new Date(0);t.setUTCFullYear(e,0,4),t.setUTCHours(0,0,0,0);var n=Ct(t);return n}var Kh=6048e5;function wi(i){y(1,arguments);var e=D(i),t=Ct(e).getTime()-Ms(e).getTime();return Math.round(t/Kh)+1}function _t(i,e){var t,n,r,s,o,a,l,c;y(1,arguments);var u=pt(),f=F((t=(n=(r=(s=e?.weekStartsOn)!==null&&s!==void 0?s:e==null||(o=e.locale)===null||o===void 0||(a=o.options)===null||a===void 0?void 0:a.weekStartsOn)!==null&&r!==void 0?r:u.weekStartsOn)!==null&&n!==void 0?n:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&t!==void 0?t:0);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=D(i),h=d.getUTCDay(),m=(h<f?7:0)+h-f;return d.setUTCDate(d.getUTCDate()-m),d.setUTCHours(0,0,0,0),d}function ke(i,e){var t,n,r,s,o,a,l,c;y(1,arguments);var u=D(i),f=u.getUTCFullYear(),d=pt(),h=F((t=(n=(r=(s=e?.firstWeekContainsDate)!==null&&s!==void 0?s:e==null||(o=e.locale)===null||o===void 0||(a=o.options)===null||a===void 0?void 0:a.firstWeekContainsDate)!==null&&r!==void 0?r:d.firstWeekContainsDate)!==null&&n!==void 0?n:(l=d.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&t!==void 0?t:1);if(!(h>=1&&h<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var m=new Date(0);m.setUTCFullYear(f+1,0,h),m.setUTCHours(0,0,0,0);var p=_t(m,e),g=new Date(0);g.setUTCFullYear(f,0,h),g.setUTCHours(0,0,0,0);var b=_t(g,e);return u.getTime()>=p.getTime()?f+1:u.getTime()>=b.getTime()?f:f-1}function ks(i,e){var t,n,r,s,o,a,l,c;y(1,arguments);var u=pt(),f=F((t=(n=(r=(s=e?.firstWeekContainsDate)!==null&&s!==void 0?s:e==null||(o=e.locale)===null||o===void 0||(a=o.options)===null||a===void 0?void 0:a.firstWeekContainsDate)!==null&&r!==void 0?r:u.firstWeekContainsDate)!==null&&n!==void 0?n:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&t!==void 0?t:1),d=ke(i,e),h=new Date(0);h.setUTCFullYear(d,0,f),h.setUTCHours(0,0,0,0);var m=_t(h,e);return m}var Zh=6048e5;function Mi(i,e){y(1,arguments);var t=D(i),n=_t(t,e).getTime()-ks(t,e).getTime();return Math.round(n/Zh)+1}function X(i,e){for(var t=i<0?"-":"",n=Math.abs(i).toString();n.length<e;)n="0"+n;return t+n}var Jh={y:function(e,t){var n=e.getUTCFullYear(),r=n>0?n:1-n;return X(t==="yy"?r%100:r,t.length)},M:function(e,t){var n=e.getUTCMonth();return t==="M"?String(n+1):X(n+1,2)},d:function(e,t){return X(e.getUTCDate(),t.length)},a:function(e,t){var n=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h:function(e,t){return X(e.getUTCHours()%12||12,t.length)},H:function(e,t){return X(e.getUTCHours(),t.length)},m:function(e,t){return X(e.getUTCMinutes(),t.length)},s:function(e,t){return X(e.getUTCSeconds(),t.length)},S:function(e,t){var n=t.length,r=e.getUTCMilliseconds(),s=Math.floor(r*Math.pow(10,n-3));return X(s,t.length)}},Qt=Jh;var Qe={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},tm={G:function(e,t,n){var r=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){var r=e.getUTCFullYear(),s=r>0?r:1-r;return n.ordinalNumber(s,{unit:"year"})}return Qt.y(e,t)},Y:function(e,t,n,r){var s=ke(e,r),o=s>0?s:1-s;if(t==="YY"){var a=o%100;return X(a,2)}return t==="Yo"?n.ordinalNumber(o,{unit:"year"}):X(o,t.length)},R:function(e,t){var n=_i(e);return X(n,t.length)},u:function(e,t){var n=e.getUTCFullYear();return X(n,t.length)},Q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return X(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return X(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){var r=e.getUTCMonth();switch(t){case"M":case"MM":return Qt.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){var r=e.getUTCMonth();switch(t){case"L":return String(r+1);case"LL":return X(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){var s=Mi(e,r);return t==="wo"?n.ordinalNumber(s,{unit:"week"}):X(s,t.length)},I:function(e,t,n){var r=wi(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):X(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getUTCDate(),{unit:"date"}):Qt.d(e,t)},D:function(e,t,n){var r=ws(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):X(r,t.length)},E:function(e,t,n){var r=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){var s=e.getUTCDay(),o=(s-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return X(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(s,{width:"short",context:"formatting"});case"eeee":default:return n.day(s,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){var s=e.getUTCDay(),o=(s-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return X(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(s,{width:"narrow",context:"standalone"});case"cccccc":return n.day(s,{width:"short",context:"standalone"});case"cccc":default:return n.day(s,{width:"wide",context:"standalone"})}},i:function(e,t,n){var r=e.getUTCDay(),s=r===0?7:r;switch(t){case"i":return String(s);case"ii":return X(s,t.length);case"io":return n.ordinalNumber(s,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){var r=e.getUTCHours(),s=r/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(e,t,n){var r=e.getUTCHours(),s;switch(r===12?s=Qe.noon:r===0?s=Qe.midnight:s=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(e,t,n){var r=e.getUTCHours(),s;switch(r>=17?s=Qe.evening:r>=12?s=Qe.afternoon:r>=4?s=Qe.morning:s=Qe.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){var r=e.getUTCHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Qt.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getUTCHours(),{unit:"hour"}):Qt.H(e,t)},K:function(e,t,n){var r=e.getUTCHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):X(r,t.length)},k:function(e,t,n){var r=e.getUTCHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):X(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):Qt.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):Qt.s(e,t)},S:function(e,t){return Qt.S(e,t)},X:function(e,t,n,r){var s=r._originalDate||e,o=s.getTimezoneOffset();if(o===0)return"Z";switch(t){case"X":return nl(o);case"XXXX":case"XX":return Te(o);case"XXXXX":case"XXX":default:return Te(o,":")}},x:function(e,t,n,r){var s=r._originalDate||e,o=s.getTimezoneOffset();switch(t){case"x":return nl(o);case"xxxx":case"xx":return Te(o);case"xxxxx":case"xxx":default:return Te(o,":")}},O:function(e,t,n,r){var s=r._originalDate||e,o=s.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+il(o,":");case"OOOO":default:return"GMT"+Te(o,":")}},z:function(e,t,n,r){var s=r._originalDate||e,o=s.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+il(o,":");case"zzzz":default:return"GMT"+Te(o,":")}},t:function(e,t,n,r){var s=r._originalDate||e,o=Math.floor(s.getTime()/1e3);return X(o,t.length)},T:function(e,t,n,r){var s=r._originalDate||e,o=s.getTime();return X(o,t.length)}};function il(i,e){var t=i>0?"-":"+",n=Math.abs(i),r=Math.floor(n/60),s=n%60;if(s===0)return t+String(r);var o=e||"";return t+String(r)+o+X(s,2)}function nl(i,e){if(i%60===0){var t=i>0?"-":"+";return t+X(Math.abs(i)/60,2)}return Te(i,e)}function Te(i,e){var t=e||"",n=i>0?"-":"+",r=Math.abs(i),s=X(Math.floor(r/60),2),o=X(r%60,2);return n+s+t+o}var rl=tm;var sl=function(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},ol=function(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},em=function(e,t){var n=e.match(/(P+)(p+)?/)||[],r=n[1],s=n[2];if(!s)return sl(e,t);var o;switch(r){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",sl(r,t)).replace("{{time}}",ol(s,t))},im={p:ol,P:em},ki=im;var nm=["D","DD"],rm=["YY","YYYY"];function Hn(i){return nm.indexOf(i)!==-1}function Bn(i){return rm.indexOf(i)!==-1}function Ge(i,e,t){if(i==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(i==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(i==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(i==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var sm={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},om=function(e,t,n){var r,s=sm[e];return typeof s=="string"?r=s:t===1?r=s.one:r=s.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},al=om;function Ti(i){return function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.width?String(e.width):i.defaultWidth,n=i.formats[t]||i.formats[i.defaultWidth];return n}}var am={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},lm={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},cm={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},um={date:Ti({formats:am,defaultWidth:"full"}),time:Ti({formats:lm,defaultWidth:"full"}),dateTime:Ti({formats:cm,defaultWidth:"full"})},ll=um;var fm={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},dm=function(e,t,n,r){return fm[e]},cl=dm;function De(i){return function(e,t){var n=t!=null&&t.context?String(t.context):"standalone",r;if(n==="formatting"&&i.formattingValues){var s=i.defaultFormattingWidth||i.defaultWidth,o=t!=null&&t.width?String(t.width):s;r=i.formattingValues[o]||i.formattingValues[s]}else{var a=i.defaultWidth,l=t!=null&&t.width?String(t.width):i.defaultWidth;r=i.values[l]||i.values[a]}var c=i.argumentCallback?i.argumentCallback(e):e;return r[c]}}var hm={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},mm={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},pm={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},gm={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},bm={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},xm={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},vm=function(e,t){var n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},ym={ordinalNumber:vm,era:De({values:hm,defaultWidth:"wide"}),quarter:De({values:mm,defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:De({values:pm,defaultWidth:"wide"}),day:De({values:gm,defaultWidth:"wide"}),dayPeriod:De({values:bm,defaultWidth:"wide",formattingValues:xm,defaultFormattingWidth:"wide"})},ul=ym;function Pe(i){return function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.width,r=n&&i.matchPatterns[n]||i.matchPatterns[i.defaultMatchWidth],s=e.match(r);if(!s)return null;var o=s[0],a=n&&i.parsePatterns[n]||i.parsePatterns[i.defaultParseWidth],l=Array.isArray(a)?wm(a,function(f){return f.test(o)}):_m(a,function(f){return f.test(o)}),c;c=i.valueCallback?i.valueCallback(l):l,c=t.valueCallback?t.valueCallback(c):c;var u=e.slice(o.length);return{value:c,rest:u}}}function _m(i,e){for(var t in i)if(i.hasOwnProperty(t)&&e(i[t]))return t}function wm(i,e){for(var t=0;t<i.length;t++)if(e(i[t]))return t}function Ts(i){return function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=e.match(i.matchPattern);if(!n)return null;var r=n[0],s=e.match(i.parsePattern);if(!s)return null;var o=i.valueCallback?i.valueCallback(s[0]):s[0];o=t.valueCallback?t.valueCallback(o):o;var a=e.slice(r.length);return{value:o,rest:a}}}var Mm=/^(\d+)(th|st|nd|rd)?/i,km=/\d+/i,Tm={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Dm={any:[/^b/i,/^(a|c)/i]},Pm={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Cm={any:[/1/i,/2/i,/3/i,/4/i]},Om={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Sm={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Am={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Im={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Lm={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Em={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Rm={ordinalNumber:Ts({matchPattern:Mm,parsePattern:km,valueCallback:function(e){return parseInt(e,10)}}),era:Pe({matchPatterns:Tm,defaultMatchWidth:"wide",parsePatterns:Dm,defaultParseWidth:"any"}),quarter:Pe({matchPatterns:Pm,defaultMatchWidth:"wide",parsePatterns:Cm,defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:Pe({matchPatterns:Om,defaultMatchWidth:"wide",parsePatterns:Sm,defaultParseWidth:"any"}),day:Pe({matchPatterns:Am,defaultMatchWidth:"wide",parsePatterns:Im,defaultParseWidth:"any"}),dayPeriod:Pe({matchPatterns:Lm,defaultMatchWidth:"any",parsePatterns:Em,defaultParseWidth:"any"})},fl=Rm;var Fm={code:"en-US",formatDistance:al,formatLong:ll,formatRelative:cl,localize:ul,match:fl,options:{weekStartsOn:0,firstWeekContainsDate:1}},dl=Fm;var Yn=dl;var Wm=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Nm=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,zm=/^'([^]*?)'?$/,Hm=/''/g,Bm=/[a-zA-Z]/;function Un(i,e,t){var n,r,s,o,a,l,c,u,f,d,h,m,p,g,b,x,w,k;y(2,arguments);var v=String(e),_=pt(),C=(n=(r=t?.locale)!==null&&r!==void 0?r:_.locale)!==null&&n!==void 0?n:Yn,P=F((s=(o=(a=(l=t?.firstWeekContainsDate)!==null&&l!==void 0?l:t==null||(c=t.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&a!==void 0?a:_.firstWeekContainsDate)!==null&&o!==void 0?o:(f=_.locale)===null||f===void 0||(d=f.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&s!==void 0?s:1);if(!(P>=1&&P<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var O=F((h=(m=(p=(g=t?.weekStartsOn)!==null&&g!==void 0?g:t==null||(b=t.locale)===null||b===void 0||(x=b.options)===null||x===void 0?void 0:x.weekStartsOn)!==null&&p!==void 0?p:_.weekStartsOn)!==null&&m!==void 0?m:(w=_.locale)===null||w===void 0||(k=w.options)===null||k===void 0?void 0:k.weekStartsOn)!==null&&h!==void 0?h:0);if(!(O>=0&&O<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!C.localize)throw new RangeError("locale must contain localize property");if(!C.formatLong)throw new RangeError("locale must contain formatLong property");var R=D(i);if(!Ve(R))throw new RangeError("Invalid time value");var W=fe(R),H=yi(R,W),nt={firstWeekContainsDate:P,weekStartsOn:O,locale:C,_originalDate:R},ut=v.match(Nm).map(function(N){var Y=N[0];if(Y==="p"||Y==="P"){var G=ki[Y];return G(N,C.formatLong)}return N}).join("").match(Wm).map(function(N){if(N==="''")return"'";var Y=N[0];if(Y==="'")return Ym(N);var G=rl[Y];if(G)return!(t!=null&&t.useAdditionalWeekYearTokens)&&Bn(N)&&Ge(N,e,String(i)),!(t!=null&&t.useAdditionalDayOfYearTokens)&&Hn(N)&&Ge(N,e,String(i)),G(H,N,C.localize,nt);if(Y.match(Bm))throw new RangeError("Format string contains an unescaped latin alphabet character `"+Y+"`");return N}).join("");return ut}function Ym(i){var e=i.match(zm);return e?e[1].replace(Hm,"'"):i}function Ds(i,e){if(i==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(i[t]=e[t]);return i}function Ps(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,n=Array(e);t<e;t++)n[t]=i[t];return n}function hl(i,e){if(i){if(typeof i=="string")return Ps(i,e);var t={}.toString.call(i).slice(8,-1);return t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set"?Array.from(i):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Ps(i,e):void 0}}function Cs(i,e){var t=typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(!t){if(Array.isArray(i)||(t=hl(i))||e&&i&&typeof i.length=="number"){t&&(i=t);var n=0,r=function(){};return{s:r,n:function(){return n>=i.length?{done:!0}:{done:!1,value:i[n++]}},e:function(c){throw c},f:r}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
4
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s,o=!0,a=!1;return{s:function(){t=t.call(i)},n:function(){var c=t.next();return o=c.done,c},e:function(c){a=!0,s=c},f:function(){try{o||t.return==null||t.return()}finally{if(a)throw s}}}}function T(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function Vn(i,e){return Vn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},Vn(i,e)}function I(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),e&&Vn(i,e)}function Di(i){return Di=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Di(i)}function Os(){try{var i=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Os=function(){return!!i})()}function ml(i,e){if(e&&(gt(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return T(i)}function L(i){var e=Os();return function(){var t,n=Di(i);if(e){var r=Di(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return ml(this,t)}}function S(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function pl(i,e){if(gt(i)!="object"||!i)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e||"default");if(gt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}function jn(i){var e=pl(i,"string");return gt(e)=="symbol"?e:e+""}function gl(i,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(i,jn(n.key),n)}}function A(i,e,t){return e&&gl(i.prototype,e),t&&gl(i,t),Object.defineProperty(i,"prototype",{writable:!1}),i}function M(i,e,t){return(e=jn(e))in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}var Um=10,bl=(function(){function i(){S(this,i),M(this,"priority",void 0),M(this,"subPriority",0)}return A(i,[{key:"validate",value:function(t,n){return!0}}]),i})(),xl=(function(i){I(t,i);var e=L(t);function t(n,r,s,o,a){var l;return S(this,t),l=e.call(this),l.value=n,l.validateValue=r,l.setValue=s,l.priority=o,a&&(l.subPriority=a),l}return A(t,[{key:"validate",value:function(r,s){return this.validateValue(r,this.value,s)}},{key:"set",value:function(r,s,o){return this.setValue(r,s,this.value,o)}}]),t})(bl),vl=(function(i){I(t,i);var e=L(t);function t(){var n;S(this,t);for(var r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return n=e.call.apply(e,[this].concat(s)),M(T(n),"priority",Um),M(T(n),"subPriority",-1),n}return A(t,[{key:"set",value:function(r,s){if(s.timestampIsSet)return r;var o=new Date(0);return o.setFullYear(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate()),o.setHours(r.getUTCHours(),r.getUTCMinutes(),r.getUTCSeconds(),r.getUTCMilliseconds()),o}}]),t})(bl);var E=(function(){function i(){S(this,i),M(this,"incompatibleTokens",void 0),M(this,"priority",void 0),M(this,"subPriority",void 0)}return A(i,[{key:"run",value:function(t,n,r,s){var o=this.parse(t,n,r,s);return o?{setter:new xl(o.value,this.validate,this.set,this.priority,this.subPriority),rest:o.rest}:null}},{key:"validate",value:function(t,n,r){return!0}}]),i})();var yl=(function(i){I(t,i);var e=L(t);function t(){var n;S(this,t);for(var r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return n=e.call.apply(e,[this].concat(s)),M(T(n),"priority",140),M(T(n),"incompatibleTokens",["R","u","t","T"]),n}return A(t,[{key:"parse",value:function(r,s,o){switch(s){case"G":case"GG":case"GGG":return o.era(r,{width:"abbreviated"})||o.era(r,{width:"narrow"});case"GGGGG":return o.era(r,{width:"narrow"});case"GGGG":default:return o.era(r,{width:"wide"})||o.era(r,{width:"abbreviated"})||o.era(r,{width:"narrow"})}}},{key:"set",value:function(r,s,o){return s.era=o,r.setUTCFullYear(o,0,1),r.setUTCHours(0,0,0,0),r}}]),t})(E);var q={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},Ot={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function K(i,e){return i&&{value:e(i.value),rest:i.rest}}function j(i,e){var t=e.match(i);return t?{value:parseInt(t[0],10),rest:e.slice(t[0].length)}:null}function St(i,e){var t=e.match(i);if(!t)return null;if(t[0]==="Z")return{value:0,rest:e.slice(1)};var n=t[1]==="+"?1:-1,r=t[2]?parseInt(t[2],10):0,s=t[3]?parseInt(t[3],10):0,o=t[5]?parseInt(t[5],10):0;return{value:n*(r*Me+s*we+o*Za),rest:e.slice(t[0].length)}}function qn(i){return j(q.anyDigitsSigned,i)}function B(i,e){switch(i){case 1:return j(q.singleDigit,e);case 2:return j(q.twoDigits,e);case 3:return j(q.threeDigits,e);case 4:return j(q.fourDigits,e);default:return j(new RegExp("^\\d{1,"+i+"}"),e)}}function Ke(i,e){switch(i){case 1:return j(q.singleDigitSigned,e);case 2:return j(q.twoDigitsSigned,e);case 3:return j(q.threeDigitsSigned,e);case 4:return j(q.fourDigitsSigned,e);default:return j(new RegExp("^-?\\d{1,"+i+"}"),e)}}function Ze(i){switch(i){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function $n(i,e){var t=e>0,n=t?e:1-e,r;if(n<=50)r=i||100;else{var s=n+50,o=Math.floor(s/100)*100,a=i>=s%100;r=i+o-(a?100:0)}return t?r:1-r}function Xn(i){return i%400===0||i%4===0&&i%100!==0}var _l=(function(i){I(t,i);var e=L(t);function t(){var n;S(this,t);for(var r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return n=e.call.apply(e,[this].concat(s)),M(T(n),"priority",130),M(T(n),"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"]),n}return A(t,[{key:"parse",value:function(r,s,o){var a=function(c){return{year:c,isTwoDigitYear:s==="yy"}};switch(s){case"y":return K(B(4,r),a);case"yo":return K(o.ordinalNumber(r,{unit:"year"}),a);default:return K(B(s.length,r),a)}}},{key:"validate",value:function(r,s){return s.isTwoDigitYear||s.year>0}},{key:"set",value:function(r,s,o){var a=r.getUTCFullYear();if(o.isTwoDigitYear){var l=$n(o.year,a);return r.setUTCFullYear(l,0,1),r.setUTCHours(0,0,0,0),r}var c=!("era"in s)||s.era===1?o.year:1-o.year;return r.setUTCFullYear(c,0,1),r.setUTCHours(0,0,0,0),r}}]),t})(E);var wl=(function(i){I(t,i);var e=L(t);function t(){var n;S(this,t);for(var r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return n=e.call.apply(e,[this].concat(s)),M(T(n),"priority",130),M(T(n),"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"]),n}return A(t,[{key:"parse",value:function(r,s,o){var a=function(c){return{year:c,isTwoDigitYear:s==="YY"}};switch(s){case"Y":return K(B(4,r),a);case"Yo":return K(o.ordinalNumber(r,{unit:"year"}),a);default:return K(B(s.length,r),a)}}},{key:"validate",value:function(r,s){return s.isTwoDigitYear||s.year>0}},{key:"set",value:function(r,s,o,a){var l=ke(r,a);if(o.isTwoDigitYear){var c=$n(o.year,l);return r.setUTCFullYear(c,0,a.firstWeekContainsDate),r.setUTCHours(0,0,0,0),_t(r,a)}var u=!("era"in s)||s.era===1?o.year:1-o.year;return r.setUTCFullYear(u,0,a.firstWeekContainsDate),r.setUTCHours(0,0,0,0),_t(r,a)}}]),t})(E);var Ml=(function(i){I(t,i);var e=L(t);function t(){var n;S(this,t);for(var r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return n=e.call.apply(e,[this].concat(s)),M(T(n),"priority",130),M(T(n),"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]),n}return A(t,[{key:"parse",value:function(r,s){return s==="R"?Ke(4,r):Ke(s.length,r)}},{key:"set",value:function(r,s,o){var a=new Date(0);return a.setUTCFullYear(o,0,4),a.setUTCHours(0,0,0,0),Ct(a)}}]),t})(E);var kl=(function(i){I(t,i);var e=L(t);function t(){var n;S(this,t);for(var r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return n=e.call.apply(e,[this].concat(s)),M(T(n),"priority",130),M(T(n),"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"]),n}return A(t,[{key:"parse",value:function(r,s){return s==="u"?Ke(4,r):Ke(s.length,r)}},{key:"set",value:function(r,s,o){return r.setUTCFullYear(o,0,1),r.setUTCHours(0,0,0,0),r}}]),t})(E);var Tl=(function(i){I(t,i);var e=L(t);function t(){var n;S(this,t);for(var r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return n=e.call.apply(e,[this].concat(s)),M(T(n),"priority",120),M(T(n),"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]),n}return A(t,[{key:"parse",value:function(r,s,o){switch(s){case"Q":case"QQ":return B(s.length,r);case"Qo":return o.ordinalNumber(r,{unit:"quarter"});case"QQQ":return o.quarter(r,{width:"abbreviated",context:"formatting"})||o.quarter(r,{width:"narrow",context:"formatting"});case"QQQQQ":return o.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return o.quarter(r,{width:"wide",context:"formatting"})||o.quarter(r,{width:"abbreviated",context:"formatting"})||o.quarter(r,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(r,s){return s>=1&&s<=4}},{key:"set",value:function(r,s,o){return r.setUTCMonth((o-1)*3,1),r.setUTCHours(0,0,0,0),r}}]),t})(E);var Dl=(function(i){I(t,i);var e=L(t);function t(){var n;S(this,t);for(var r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return n=e.call.apply(e,[this].concat(s)),M(T(n),"priority",120),M(T(n),"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]),n}return A(t,[{key:"parse",value:function(r,s,o){switch(s){case"q":case"qq":return B(s.length,r);case"qo":return o.ordinalNumber(r,{unit:"quarter"});case"qqq":return o.quarter(r,{width:"abbreviated",context:"standalone"})||o.quarter(r,{width:"narrow",context:"standalone"});case"qqqqq":return o.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return o.quarter(r,{width:"wide",context:"standalone"})||o.quarter(r,{width:"abbreviated",context:"standalone"})||o.quarter(r,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(r,s){return s>=1&&s<=4}},{key:"set",value:function(r,s,o){return r.setUTCMonth((o-1)*3,1),r.setUTCHours(0,0,0,0),r}}]),t})(E);var Pl=(function(i){I(t,i);var e=L(t);function t(){var n;S(this,t);for(var r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return n=e.call.apply(e,[this].concat(s)),M(T(n),"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]),M(T(n),"priority",110),n}return A(t,[{key:"parse",value:function(r,s,o){var a=function(c){return c-1};switch(s){case"M":return K(j(q.month,r),a);case"MM":return K(B(2,r),a);case"Mo":return K(o.ordinalNumber(r,{unit:"month"}),a);case"MMM":return o.month(r,{width:"abbreviated",context:"formatting"})||o.month(r,{width:"narrow",context:"formatting"});case"MMMMM":return o.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return o.month(r,{width:"wide",context:"formatting"})||o.month(r,{width:"abbreviated",context:"formatting"})||o.month(r,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(r,s){return s>=0&&s<=11}},{key:"set",value:function(r,s,o){return r.setUTCMonth(o,1),r.setUTCHours(0,0,0,0),r}}]),t})(E);var Cl=(function(i){I(t,i);var e=L(t);function t(){var n;S(this,t);for(var r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return n=e.call.apply(e,[this].concat(s)),M(T(n),"priority",110),M(T(n),"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]),n}return A(t,[{key:"parse",value:function(r,s,o){var a=function(c){return c-1};switch(s){case"L":return K(j(q.month,r),a);case"LL":return K(B(2,r),a);case"Lo":return K(o.ordinalNumber(r,{unit:"month"}),a);case"LLL":return o.month(r,{width:"abbreviated",context:"standalone"})||o.month(r,{width:"narrow",context:"standalone"});case"LLLLL":return o.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return o.month(r,{width:"wide",context:"standalone"})||o.month(r,{width:"abbreviated",context:"standalone"})||o.month(r,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(r,s){return s>=0&&s<=11}},{key:"set",value:function(r,s,o){return r.setUTCMonth(o,1),r.setUTCHours(0,0,0,0),r}}]),t})(E);function Ss(i,e,t){y(2,arguments);var n=D(i),r=F(e),s=Mi(n,t)-r;return n.setUTCDate(n.getUTCDate()-s*7),n}var Ol=(function(i){I(t,i);var e=L(t);function t(){var n;S(this,t);for(var r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return n=e.call.apply(e,[this].concat(s)),M(T(n),"priority",100),M(T(n),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"]),n}return A(t,[{key:"parse",value:function(r,s,o){switch(s){case"w":return j(q.week,r);case"wo":return o.ordinalNumber(r,{unit:"week"});default:return B(s.length,r)}}},{key:"validate",value:function(r,s){return s>=1&&s<=53}},{key:"set",value:function(r,s,o,a){return _t(Ss(r,o,a),a)}}]),t})(E);function As(i,e){y(2,arguments);var t=D(i),n=F(e),r=wi(t)-n;return t.setUTCDate(t.getUTCDate()-r*7),t}var Sl=(function(i){I(t,i);var e=L(t);function t(){var n;S(this,t);for(var r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return n=e.call.apply(e,[this].concat(s)),M(T(n),"priority",100),M(T(n),"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]),n}return A(t,[{key:"parse",value:function(r,s,o){switch(s){case"I":return j(q.week,r);case"Io":return o.ordinalNumber(r,{unit:"week"});default:return B(s.length,r)}}},{key:"validate",value:function(r,s){return s>=1&&s<=53}},{key:"set",value:function(r,s,o){return Ct(As(r,o))}}]),t})(E);var Vm=[31,28,31,30,31,30,31,31,30,31,30,31],jm=[31,29,31,30,31,30,31,31,30,31,30,31],Al=(function(i){I(t,i);var e=L(t);function t(){var n;S(this,t);for(var r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return n=e.call.apply(e,[this].concat(s)),M(T(n),"priority",90),M(T(n),"subPriority",1),M(T(n),"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"]),n}return A(t,[{key:"parse",value:function(r,s,o){switch(s){case"d":return j(q.date,r);case"do":return o.ordinalNumber(r,{unit:"date"});default:return B(s.length,r)}}},{key:"validate",value:function(r,s){var o=r.getUTCFullYear(),a=Xn(o),l=r.getUTCMonth();return a?s>=1&&s<=jm[l]:s>=1&&s<=Vm[l]}},{key:"set",value:function(r,s,o){return r.setUTCDate(o),r.setUTCHours(0,0,0,0),r}}]),t})(E);var Il=(function(i){I(t,i);var e=L(t);function t(){var n;S(this,t);for(var r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return n=e.call.apply(e,[this].concat(s)),M(T(n),"priority",90),M(T(n),"subpriority",1),M(T(n),"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]),n}return A(t,[{key:"parse",value:function(r,s,o){switch(s){case"D":case"DD":return j(q.dayOfYear,r);case"Do":return o.ordinalNumber(r,{unit:"date"});default:return B(s.length,r)}}},{key:"validate",value:function(r,s){var o=r.getUTCFullYear(),a=Xn(o);return a?s>=1&&s<=366:s>=1&&s<=365}},{key:"set",value:function(r,s,o){return r.setUTCMonth(0,o),r.setUTCHours(0,0,0,0),r}}]),t})(E);function Ce(i,e,t){var n,r,s,o,a,l,c,u;y(2,arguments);var f=pt(),d=F((n=(r=(s=(o=t?.weekStartsOn)!==null&&o!==void 0?o:t==null||(a=t.locale)===null||a===void 0||(l=a.options)===null||l===void 0?void 0:l.weekStartsOn)!==null&&s!==void 0?s:f.weekStartsOn)!==null&&r!==void 0?r:(c=f.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&n!==void 0?n:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=D(i),m=F(e),p=h.getUTCDay(),g=m%7,b=(g+7)%7,x=(b<d?7:0)+m-p;return h.setUTCDate(h.getUTCDate()+x),h}var Ll=(function(i){I(t,i);var e=L(t);function t(){var n;S(this,t);for(var r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return n=e.call.apply(e,[this].concat(s)),M(T(n),"priority",90),M(T(n),"incompatibleTokens",["D","i","e","c","t","T"]),n}return A(t,[{key:"parse",value:function(r,s,o){switch(s){case"E":case"EE":case"EEE":return o.day(r,{width:"abbreviated",context:"formatting"})||o.day(r,{width:"short",context:"formatting"})||o.day(r,{width:"narrow",context:"formatting"});case"EEEEE":return o.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return o.day(r,{width:"short",context:"formatting"})||o.day(r,{width:"narrow",context:"formatting"});case"EEEE":default:return o.day(r,{width:"wide",context:"formatting"})||o.day(r,{width:"abbreviated",context:"formatting"})||o.day(r,{width:"short",context:"formatting"})||o.day(r,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(r,s){return s>=0&&s<=6}},{key:"set",value:function(r,s,o,a){return r=Ce(r,o,a),r.setUTCHours(0,0,0,0),r}}]),t})(E);var El=(function(i){I(t,i);var e=L(t);function t(){var n;S(this,t);for(var r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return n=e.call.apply(e,[this].concat(s)),M(T(n),"priority",90),M(T(n),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]),n}return A(t,[{key:"parse",value:function(r,s,o,a){var l=function(u){var f=Math.floor((u-1)/7)*7;return(u+a.weekStartsOn+6)%7+f};switch(s){case"e":case"ee":return K(B(s.length,r),l);case"eo":return K(o.ordinalNumber(r,{unit:"day"}),l);case"eee":return o.day(r,{width:"abbreviated",context:"formatting"})||o.day(r,{width:"short",context:"formatting"})||o.day(r,{width:"narrow",context:"formatting"});case"eeeee":return o.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return o.day(r,{width:"short",context:"formatting"})||o.day(r,{width:"narrow",context:"formatting"});case"eeee":default:return o.day(r,{width:"wide",context:"formatting"})||o.day(r,{width:"abbreviated",context:"formatting"})||o.day(r,{width:"short",context:"formatting"})||o.day(r,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(r,s){return s>=0&&s<=6}},{key:"set",value:function(r,s,o,a){return r=Ce(r,o,a),r.setUTCHours(0,0,0,0),r}}]),t})(E);var Rl=(function(i){I(t,i);var e=L(t);function t(){var n;S(this,t);for(var r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return n=e.call.apply(e,[this].concat(s)),M(T(n),"priority",90),M(T(n),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]),n}return A(t,[{key:"parse",value:function(r,s,o,a){var l=function(u){var f=Math.floor((u-1)/7)*7;return(u+a.weekStartsOn+6)%7+f};switch(s){case"c":case"cc":return K(B(s.length,r),l);case"co":return K(o.ordinalNumber(r,{unit:"day"}),l);case"ccc":return o.day(r,{width:"abbreviated",context:"standalone"})||o.day(r,{width:"short",context:"standalone"})||o.day(r,{width:"narrow",context:"standalone"});case"ccccc":return o.day(r,{width:"narrow",context:"standalone"});case"cccccc":return o.day(r,{width:"short",context:"standalone"})||o.day(r,{width:"narrow",context:"standalone"});case"cccc":default:return o.day(r,{width:"wide",context:"standalone"})||o.day(r,{width:"abbreviated",context:"standalone"})||o.day(r,{width:"short",context:"standalone"})||o.day(r,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(r,s){return s>=0&&s<=6}},{key:"set",value:function(r,s,o,a){return r=Ce(r,o,a),r.setUTCHours(0,0,0,0),r}}]),t})(E);function Is(i,e){y(2,arguments);var t=F(e);t%7===0&&(t=t-7);var n=1,r=D(i),s=r.getUTCDay(),o=t%7,a=(o+7)%7,l=(a<n?7:0)+t-s;return r.setUTCDate(r.getUTCDate()+l),r}var Fl=(function(i){I(t,i);var e=L(t);function t(){var n;S(this,t);for(var r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return n=e.call.apply(e,[this].concat(s)),M(T(n),"priority",90),M(T(n),"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]),n}return A(t,[{key:"parse",value:function(r,s,o){var a=function(c){return c===0?7:c};switch(s){case"i":case"ii":return B(s.length,r);case"io":return o.ordinalNumber(r,{unit:"day"});case"iii":return K(o.day(r,{width:"abbreviated",context:"formatting"})||o.day(r,{width:"short",context:"formatting"})||o.day(r,{width:"narrow",context:"formatting"}),a);case"iiiii":return K(o.day(r,{width:"narrow",context:"formatting"}),a);case"iiiiii":return K(o.day(r,{width:"short",context:"formatting"})||o.day(r,{width:"narrow",context:"formatting"}),a);case"iiii":default:return K(o.day(r,{width:"wide",context:"formatting"})||o.day(r,{width:"abbreviated",context:"formatting"})||o.day(r,{width:"short",context:"formatting"})||o.day(r,{width:"narrow",context:"formatting"}),a)}}},{key:"validate",value:function(r,s){return s>=1&&s<=7}},{key:"set",value:function(r,s,o){return r=Is(r,o),r.setUTCHours(0,0,0,0),r}}]),t})(E);var Wl=(function(i){I(t,i);var e=L(t);function t(){var n;S(this,t);for(var r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return n=e.call.apply(e,[this].concat(s)),M(T(n),"priority",80),M(T(n),"incompatibleTokens",["b","B","H","k","t","T"]),n}return A(t,[{key:"parse",value:function(r,s,o){switch(s){case"a":case"aa":case"aaa":return o.dayPeriod(r,{width:"abbreviated",context:"formatting"})||o.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaaa":return o.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return o.dayPeriod(r,{width:"wide",context:"formatting"})||o.dayPeriod(r,{width:"abbreviated",context:"formatting"})||o.dayPeriod(r,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(r,s,o){return r.setUTCHours(Ze(o),0,0,0),r}}]),t})(E);var Nl=(function(i){I(t,i);var e=L(t);function t(){var n;S(this,t);for(var r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return n=e.call.apply(e,[this].concat(s)),M(T(n),"priority",80),M(T(n),"incompatibleTokens",["a","B","H","k","t","T"]),n}return A(t,[{key:"parse",value:function(r,s,o){switch(s){case"b":case"bb":case"bbb":return o.dayPeriod(r,{width:"abbreviated",context:"formatting"})||o.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbbb":return o.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return o.dayPeriod(r,{width:"wide",context:"formatting"})||o.dayPeriod(r,{width:"abbreviated",context:"formatting"})||o.dayPeriod(r,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(r,s,o){return r.setUTCHours(Ze(o),0,0,0),r}}]),t})(E);var zl=(function(i){I(t,i);var e=L(t);function t(){var n;S(this,t);for(var r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return n=e.call.apply(e,[this].concat(s)),M(T(n),"priority",80),M(T(n),"incompatibleTokens",["a","b","t","T"]),n}return A(t,[{key:"parse",value:function(r,s,o){switch(s){case"B":case"BB":case"BBB":return o.dayPeriod(r,{width:"abbreviated",context:"formatting"})||o.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBBB":return o.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return o.dayPeriod(r,{width:"wide",context:"formatting"})||o.dayPeriod(r,{width:"abbreviated",context:"formatting"})||o.dayPeriod(r,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(r,s,o){return r.setUTCHours(Ze(o),0,0,0),r}}]),t})(E);var Hl=(function(i){I(t,i);var e=L(t);function t(){var n;S(this,t);for(var r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return n=e.call.apply(e,[this].concat(s)),M(T(n),"priority",70),M(T(n),"incompatibleTokens",["H","K","k","t","T"]),n}return A(t,[{key:"parse",value:function(r,s,o){switch(s){case"h":return j(q.hour12h,r);case"ho":return o.ordinalNumber(r,{unit:"hour"});default:return B(s.length,r)}}},{key:"validate",value:function(r,s){return s>=1&&s<=12}},{key:"set",value:function(r,s,o){var a=r.getUTCHours()>=12;return a&&o<12?r.setUTCHours(o+12,0,0,0):!a&&o===12?r.setUTCHours(0,0,0,0):r.setUTCHours(o,0,0,0),r}}]),t})(E);var Bl=(function(i){I(t,i);var e=L(t);function t(){var n;S(this,t);for(var r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return n=e.call.apply(e,[this].concat(s)),M(T(n),"priority",70),M(T(n),"incompatibleTokens",["a","b","h","K","k","t","T"]),n}return A(t,[{key:"parse",value:function(r,s,o){switch(s){case"H":return j(q.hour23h,r);case"Ho":return o.ordinalNumber(r,{unit:"hour"});default:return B(s.length,r)}}},{key:"validate",value:function(r,s){return s>=0&&s<=23}},{key:"set",value:function(r,s,o){return r.setUTCHours(o,0,0,0),r}}]),t})(E);var Yl=(function(i){I(t,i);var e=L(t);function t(){var n;S(this,t);for(var r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return n=e.call.apply(e,[this].concat(s)),M(T(n),"priority",70),M(T(n),"incompatibleTokens",["h","H","k","t","T"]),n}return A(t,[{key:"parse",value:function(r,s,o){switch(s){case"K":return j(q.hour11h,r);case"Ko":return o.ordinalNumber(r,{unit:"hour"});default:return B(s.length,r)}}},{key:"validate",value:function(r,s){return s>=0&&s<=11}},{key:"set",value:function(r,s,o){var a=r.getUTCHours()>=12;return a&&o<12?r.setUTCHours(o+12,0,0,0):r.setUTCHours(o,0,0,0),r}}]),t})(E);var Ul=(function(i){I(t,i);var e=L(t);function t(){var n;S(this,t);for(var r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return n=e.call.apply(e,[this].concat(s)),M(T(n),"priority",70),M(T(n),"incompatibleTokens",["a","b","h","H","K","t","T"]),n}return A(t,[{key:"parse",value:function(r,s,o){switch(s){case"k":return j(q.hour24h,r);case"ko":return o.ordinalNumber(r,{unit:"hour"});default:return B(s.length,r)}}},{key:"validate",value:function(r,s){return s>=1&&s<=24}},{key:"set",value:function(r,s,o){var a=o<=24?o%24:o;return r.setUTCHours(a,0,0,0),r}}]),t})(E);var Vl=(function(i){I(t,i);var e=L(t);function t(){var n;S(this,t);for(var r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return n=e.call.apply(e,[this].concat(s)),M(T(n),"priority",60),M(T(n),"incompatibleTokens",["t","T"]),n}return A(t,[{key:"parse",value:function(r,s,o){switch(s){case"m":return j(q.minute,r);case"mo":return o.ordinalNumber(r,{unit:"minute"});default:return B(s.length,r)}}},{key:"validate",value:function(r,s){return s>=0&&s<=59}},{key:"set",value:function(r,s,o){return r.setUTCMinutes(o,0,0),r}}]),t})(E);var jl=(function(i){I(t,i);var e=L(t);function t(){var n;S(this,t);for(var r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return n=e.call.apply(e,[this].concat(s)),M(T(n),"priority",50),M(T(n),"incompatibleTokens",["t","T"]),n}return A(t,[{key:"parse",value:function(r,s,o){switch(s){case"s":return j(q.second,r);case"so":return o.ordinalNumber(r,{unit:"second"});default:return B(s.length,r)}}},{key:"validate",value:function(r,s){return s>=0&&s<=59}},{key:"set",value:function(r,s,o){return r.setUTCSeconds(o,0),r}}]),t})(E);var ql=(function(i){I(t,i);var e=L(t);function t(){var n;S(this,t);for(var r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return n=e.call.apply(e,[this].concat(s)),M(T(n),"priority",30),M(T(n),"incompatibleTokens",["t","T"]),n}return A(t,[{key:"parse",value:function(r,s){var o=function(l){return Math.floor(l*Math.pow(10,-s.length+3))};return K(B(s.length,r),o)}},{key:"set",value:function(r,s,o){return r.setUTCMilliseconds(o),r}}]),t})(E);var $l=(function(i){I(t,i);var e=L(t);function t(){var n;S(this,t);for(var r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return n=e.call.apply(e,[this].concat(s)),M(T(n),"priority",10),M(T(n),"incompatibleTokens",["t","T","x"]),n}return A(t,[{key:"parse",value:function(r,s){switch(s){case"X":return St(Ot.basicOptionalMinutes,r);case"XX":return St(Ot.basic,r);case"XXXX":return St(Ot.basicOptionalSeconds,r);case"XXXXX":return St(Ot.extendedOptionalSeconds,r);case"XXX":default:return St(Ot.extended,r)}}},{key:"set",value:function(r,s,o){return s.timestampIsSet?r:new Date(r.getTime()-o)}}]),t})(E);var Xl=(function(i){I(t,i);var e=L(t);function t(){var n;S(this,t);for(var r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return n=e.call.apply(e,[this].concat(s)),M(T(n),"priority",10),M(T(n),"incompatibleTokens",["t","T","X"]),n}return A(t,[{key:"parse",value:function(r,s){switch(s){case"x":return St(Ot.basicOptionalMinutes,r);case"xx":return St(Ot.basic,r);case"xxxx":return St(Ot.basicOptionalSeconds,r);case"xxxxx":return St(Ot.extendedOptionalSeconds,r);case"xxx":default:return St(Ot.extended,r)}}},{key:"set",value:function(r,s,o){return s.timestampIsSet?r:new Date(r.getTime()-o)}}]),t})(E);var Ql=(function(i){I(t,i);var e=L(t);function t(){var n;S(this,t);for(var r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return n=e.call.apply(e,[this].concat(s)),M(T(n),"priority",40),M(T(n),"incompatibleTokens","*"),n}return A(t,[{key:"parse",value:function(r){return qn(r)}},{key:"set",value:function(r,s,o){return[new Date(o*1e3),{timestampIsSet:!0}]}}]),t})(E);var Gl=(function(i){I(t,i);var e=L(t);function t(){var n;S(this,t);for(var r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return n=e.call.apply(e,[this].concat(s)),M(T(n),"priority",20),M(T(n),"incompatibleTokens","*"),n}return A(t,[{key:"parse",value:function(r){return qn(r)}},{key:"set",value:function(r,s,o){return[new Date(o),{timestampIsSet:!0}]}}]),t})(E);var Kl={G:new yl,y:new _l,Y:new wl,R:new Ml,u:new kl,Q:new Tl,q:new Dl,M:new Pl,L:new Cl,w:new Ol,I:new Sl,d:new Al,D:new Il,E:new Ll,e:new El,c:new Rl,i:new Fl,a:new Wl,b:new Nl,B:new zl,h:new Hl,H:new Bl,K:new Yl,k:new Ul,m:new Vl,s:new jl,S:new ql,X:new $l,x:new Xl,t:new Ql,T:new Gl};var qm=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,$m=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Xm=/^'([^]*?)'?$/,Qm=/''/g,Gm=/\S/,Km=/[a-zA-Z]/;function Qn(i,e,t,n){var r,s,o,a,l,c,u,f,d,h,m,p,g,b,x,w,k,v;y(3,arguments);var _=String(i),C=String(e),P=pt(),O=(r=(s=n?.locale)!==null&&s!==void 0?s:P.locale)!==null&&r!==void 0?r:Yn;if(!O.match)throw new RangeError("locale must contain match property");var R=F((o=(a=(l=(c=n?.firstWeekContainsDate)!==null&&c!==void 0?c:n==null||(u=n.locale)===null||u===void 0||(f=u.options)===null||f===void 0?void 0:f.firstWeekContainsDate)!==null&&l!==void 0?l:P.firstWeekContainsDate)!==null&&a!==void 0?a:(d=P.locale)===null||d===void 0||(h=d.options)===null||h===void 0?void 0:h.firstWeekContainsDate)!==null&&o!==void 0?o:1);if(!(R>=1&&R<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var W=F((m=(p=(g=(b=n?.weekStartsOn)!==null&&b!==void 0?b:n==null||(x=n.locale)===null||x===void 0||(w=x.options)===null||w===void 0?void 0:w.weekStartsOn)!==null&&g!==void 0?g:P.weekStartsOn)!==null&&p!==void 0?p:(k=P.locale)===null||k===void 0||(v=k.options)===null||v===void 0?void 0:v.weekStartsOn)!==null&&m!==void 0?m:0);if(!(W>=0&&W<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(C==="")return _===""?D(t):new Date(NaN);var H={firstWeekContainsDate:R,weekStartsOn:W,locale:O},nt=[new vl],ut=C.match($m).map(function(ct){var J=ct[0];if(J in ki){var kt=ki[J];return kt(ct,O.formatLong)}return ct}).join("").match(qm),N=[],Y=Cs(ut),G;try{var yt=function(){var J=G.value;!(n!=null&&n.useAdditionalWeekYearTokens)&&Bn(J)&&Ge(J,C,i),!(n!=null&&n.useAdditionalDayOfYearTokens)&&Hn(J)&&Ge(J,C,i);var kt=J[0],Oi=Kl[kt];if(Oi){var Es=Oi.incompatibleTokens;if(Array.isArray(Es)){var Rs=N.find(function(Fs){return Es.includes(Fs.token)||Fs.token===kt});if(Rs)throw new RangeError("The format string mustn't contain `".concat(Rs.fullToken,"` and `").concat(J,"` at the same time"))}else if(Oi.incompatibleTokens==="*"&&N.length>0)throw new RangeError("The format string mustn't contain `".concat(J,"` and any other token at the same time"));N.push({token:kt,fullToken:J});var tr=Oi.run(_,J,O.match,H);if(!tr)return{v:new Date(NaN)};nt.push(tr.setter),_=tr.rest}else{if(kt.match(Km))throw new RangeError("Format string contains an unescaped latin alphabet character `"+kt+"`");if(J==="''"?J="'":kt==="'"&&(J=Zm(J)),_.indexOf(J)===0)_=_.slice(J.length);else return{v:new Date(NaN)}}};for(Y.s();!(G=Y.n()).done;){var at=yt();if(gt(at)==="object")return at.v}}catch(ct){Y.e(ct)}finally{Y.f()}if(_.length>0&&Gm.test(_))return new Date(NaN);var Gt=nt.map(function(ct){return ct.priority}).sort(function(ct,J){return J-ct}).filter(function(ct,J,kt){return kt.indexOf(ct)===J}).map(function(ct){return nt.filter(function(J){return J.priority===ct}).sort(function(J,kt){return kt.subPriority-J.subPriority})}).map(function(ct){return ct[0]}),Kt=D(t);if(isNaN(Kt.getTime()))return new Date(NaN);var wt=yi(Kt,fe(Kt)),Zt={},Mt=Cs(Gt),Jt;try{for(Mt.s();!(Jt=Mt.n()).done;){var Lt=Jt.value;if(!Lt.validate(wt,H))return new Date(NaN);var Ci=Lt.set(wt,Zt,H);Array.isArray(Ci)?(wt=Ci[0],Ds(Zt,Ci[1])):wt=Ci}}catch(ct){Mt.e(ct)}finally{Mt.f()}return wt}function Zm(i){return i.match(Xm)[1].replace(Qm,"'")}function Gn(i){y(1,arguments);var e=D(i);return e.setMinutes(0,0,0),e}function Kn(i){y(1,arguments);var e=D(i);return e.setMilliseconds(0),e}function Jn(i,e){var t;y(1,arguments);var n=F((t=e?.additionalDigits)!==null&&t!==void 0?t:2);if(n!==2&&n!==1&&n!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(!(typeof i=="string"||Object.prototype.toString.call(i)==="[object String]"))return new Date(NaN);var r=ip(i),s;if(r.date){var o=np(r.date,n);s=rp(o.restDateString,o.year)}if(!s||isNaN(s.getTime()))return new Date(NaN);var a=s.getTime(),l=0,c;if(r.time&&(l=sp(r.time),isNaN(l)))return new Date(NaN);if(r.timezone){if(c=op(r.timezone),isNaN(c))return new Date(NaN)}else{var u=new Date(a+l),f=new Date(0);return f.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),f.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),f}return new Date(a+l+c)}var Zn={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Jm=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,tp=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,ep=/^([+-])(\d{2})(?::?(\d{2}))?$/;function ip(i){var e={},t=i.split(Zn.dateTimeDelimiter),n;if(t.length>2)return e;if(/:/.test(t[0])?n=t[0]:(e.date=t[0],n=t[1],Zn.timeZoneDelimiter.test(e.date)&&(e.date=i.split(Zn.timeZoneDelimiter)[0],n=i.substr(e.date.length,i.length))),n){var r=Zn.timezone.exec(n);r?(e.time=n.replace(r[1],""),e.timezone=r[1]):e.time=n}return e}function np(i,e){var t=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),n=i.match(t);if(!n)return{year:NaN,restDateString:""};var r=n[1]?parseInt(n[1]):null,s=n[2]?parseInt(n[2]):null;return{year:s===null?r:s*100,restDateString:i.slice((n[1]||n[2]).length)}}function rp(i,e){if(e===null)return new Date(NaN);var t=i.match(Jm);if(!t)return new Date(NaN);var n=!!t[4],r=Pi(t[1]),s=Pi(t[2])-1,o=Pi(t[3]),a=Pi(t[4]),l=Pi(t[5])-1;if(n)return fp(e,a,l)?ap(e,a,l):new Date(NaN);var c=new Date(0);return!cp(e,s,o)||!up(e,r)?new Date(NaN):(c.setUTCFullYear(e,s,Math.max(r,o)),c)}function Pi(i){return i?parseInt(i):1}function sp(i){var e=i.match(tp);if(!e)return NaN;var t=Ls(e[1]),n=Ls(e[2]),r=Ls(e[3]);return dp(t,n,r)?t*Me+n*we+r*1e3:NaN}function Ls(i){return i&&parseFloat(i.replace(",","."))||0}function op(i){if(i==="Z")return 0;var e=i.match(ep);if(!e)return 0;var t=e[1]==="+"?-1:1,n=parseInt(e[2]),r=e[3]&&parseInt(e[3])||0;return hp(n,r)?t*(n*Me+r*we):NaN}function ap(i,e,t){var n=new Date(0);n.setUTCFullYear(i,0,4);var r=n.getUTCDay()||7,s=(e-1)*7+t+1-r;return n.setUTCDate(n.getUTCDate()+s),n}var lp=[31,null,31,30,31,30,31,31,30,31,30,31];function Zl(i){return i%400===0||i%4===0&&i%100!==0}function cp(i,e,t){return e>=0&&e<=11&&t>=1&&t<=(lp[e]||(Zl(i)?29:28))}function up(i,e){return e>=1&&e<=(Zl(i)?366:365)}function fp(i,e,t){return e>=1&&e<=53&&t>=0&&t<=6}function dp(i,e,t){return i===24?e===0&&t===0:t>=0&&t<60&&e>=0&&e<60&&i>=0&&i<25}function hp(i,e){return e>=0&&e<=59}var mp={datetime:"MMM d, yyyy, h:mm:ss aaaa",millisecond:"h:mm:ss.SSS aaaa",second:"h:mm:ss aaaa",minute:"h:mm aaaa",hour:"ha",day:"MMM d",week:"PP",month:"MMM yyyy",quarter:"qqq - yyyy",year:"yyyy"};gs._date.override({_id:"date-fns",formats:function(){return mp},parse:function(i,e){if(i===null||typeof i>"u")return null;let t=typeof i;return t==="number"||i instanceof Date?i=D(i):t==="string"&&(typeof e=="string"?i=Qn(i,e,new Date,this.options):i=Jn(i,this.options)),Ve(i)?i.getTime():null},format:function(i,e){return Un(i,e,this.options)},add:function(i,e,t){switch(t){case"millisecond":return Pt(i,e);case"second":return _n(i,e);case"minute":return vn(i,e);case"hour":return xn(i,e);case"day":return Ue(i,e);case"week":return wn(i,e);case"month":return ue(i,e);case"quarter":return yn(i,e);case"year":return Mn(i,e);default:return i}},diff:function(i,e,t){switch(t){case"millisecond":return Ht(i,e);case"second":return Pn(i,e);case"minute":return Tn(i,e);case"hour":return kn(i,e);case"day":return je(i,e);case"week":return Cn(i,e);case"month":return Xe(i,e);case"quarter":return Dn(i,e);case"year":return On(i,e);default:return 0}},startOf:function(i,e,t){switch(e){case"second":return Kn(i);case"minute":return Sn(i);case"hour":return Gn(i);case"day":return _e(i);case"week":return vi(i);case"isoWeek":return vi(i,{weekStartsOn:+t});case"month":return In(i);case"quarter":return An(i);case"year":return En(i);default:return i}},endOf:function(i,e){switch(e){case"second":return zn(i);case"minute":return Wn(i);case"hour":return Rn(i);case"day":return qe(i);case"week":return Fn(i);case"month":return $e(i);case"quarter":return Nn(i);case"year":return Ln(i);default:return i}}});export{Op as a,tt as b,V as c,rt as d,z as e,Z as f,Ee as g,Ut as h,$ as i,et as j,Dc as k,st as l,he as m,qs as n,ge as o,Dt as p,Vi as q,mr as r,Bi as s,it as t,oi as u,ai as v,Ne as w,oe as x,ht as y,ot as z,cn as A,ps as B,Uu as C,It as D,Zf as E,pn as F,md as G,Kd as H,sh as I,oh as J,vh as K,cs as L,hs as M,Rp as N};
|