llm-simple-router 1.0.20 → 1.0.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/frontend-dist/assets/{AuthLayout-BwI_T7qz.js → AuthLayout-UzmdwXpC.js} +1 -1
  2. package/frontend-dist/assets/{Card-C5jCkE1m.js → Card-BAJ7K-oq.js} +1 -1
  3. package/frontend-dist/assets/{CardContent-Dozca7Pu.js → CardContent-D4ma-cic.js} +1 -1
  4. package/frontend-dist/assets/{CardTitle-DqrzLNUU.js → CardTitle-B3frXOF6.js} +1 -1
  5. package/frontend-dist/assets/{CascadingModelSelect-D2DRpM28.js → CascadingModelSelect-D1iTboYP.js} +1 -1
  6. package/frontend-dist/assets/{Checkbox-B-BvqDQI.js → Checkbox-FFHFrFEk.js} +1 -1
  7. package/frontend-dist/assets/{CollapsibleContent-BV1VGpMl.js → CollapsibleContent-CsQhKwq1.js} +1 -1
  8. package/frontend-dist/assets/{CollapsibleTrigger-BNuoyr3g.js → CollapsibleTrigger-x1DJz63o.js} +1 -1
  9. package/frontend-dist/assets/{ConcurrencyControl-XSeHDo1-.js → ConcurrencyControl-CjQi9JM0.js} +1 -1
  10. package/frontend-dist/assets/{Dashboard-CsgO9KeQ.js → Dashboard-DKm9udvl.js} +1 -1
  11. package/frontend-dist/assets/{Input-C5OLhaEA.js → Input-4bkkJSKj.js} +1 -1
  12. package/frontend-dist/assets/{Label-B5FJLcPy.js → Label-D9CEaBof.js} +1 -1
  13. package/frontend-dist/assets/{Login-wZ8_XeqQ.js → Login-h4I4rmnC.js} +1 -1
  14. package/frontend-dist/assets/{Logs-CiC8wTHb.js → Logs-CAU6FiMD.js} +1 -1
  15. package/frontend-dist/assets/{ModelMappings-CZcMgWbM.js → ModelMappings-B6rCeno-.js} +1 -1
  16. package/frontend-dist/assets/{Monitor-Cb4RhaXB.js → Monitor-Dmb_-qsO.js} +1 -1
  17. package/frontend-dist/assets/{Providers-DGwBmDka.js → Providers-U4m7hTSJ.js} +1 -1
  18. package/frontend-dist/assets/{ProxyEnhancement-Duyvg2Pu.js → ProxyEnhancement-DRgjcB7n.js} +1 -1
  19. package/frontend-dist/assets/{QuickSetup-MgM8jncN.js → QuickSetup-BNmLBUdC.js} +1 -1
  20. package/frontend-dist/assets/{RetryRules-CucoGQb3.js → RetryRules-Bl3ZVdvu.js} +1 -1
  21. package/frontend-dist/assets/{RouterKeys-Cj46NlnE.js → RouterKeys-BwnEUWyG.js} +1 -1
  22. package/frontend-dist/assets/{RovingFocusItem-zXj-QlAl.js → RovingFocusItem-DsNw2OyU.js} +1 -1
  23. package/frontend-dist/assets/{Schedules-BxtgE_jQ.js → Schedules-D2N8icq0.js} +1 -1
  24. package/frontend-dist/assets/{Separator-Cmw60D6s.js → Separator-BAEMvYDZ.js} +1 -1
  25. package/frontend-dist/assets/{Settings-CSjzJJ1L.js → Settings-C4ZqRV31.js} +1 -1
  26. package/frontend-dist/assets/{Setup-P3Amua1-.js → Setup-BXEaeu0C.js} +1 -1
  27. package/frontend-dist/assets/{Skeleton-Bb6JdseU.js → Skeleton-BwwGudhK.js} +1 -1
  28. package/frontend-dist/assets/{Switch-G855OsUp.js → Switch-C9A1URA9.js} +1 -1
  29. package/frontend-dist/assets/{TableHeader-CFMCLKRy.js → TableHeader-B8tbY3uE.js} +1 -1
  30. package/frontend-dist/assets/{TabsTrigger-P5C-goq6.js → TabsTrigger-BciD13aS.js} +1 -1
  31. package/frontend-dist/assets/{UnifiedRequestDialog-b0YkEvxq.js → UnifiedRequestDialog-Dnhxxnoi.js} +1 -1
  32. package/frontend-dist/assets/{VisuallyHiddenInput-De_zFaJT.js → VisuallyHiddenInput-Deh-FeJI.js} +1 -1
  33. package/frontend-dist/assets/arrow-down-CL1-lpk5.js +1 -0
  34. package/frontend-dist/assets/{badge-BKjuTJ01.js → badge-_5ZpB7R1.js} +1 -1
  35. package/frontend-dist/assets/{button-DpPvjx0f.js → button-BcmABzob.js} +2 -2
  36. package/frontend-dist/assets/chevron-right-Bf3Fdg6M.js +1 -0
  37. package/frontend-dist/assets/{dialog-BxDRyeVd.js → dialog-BDw6KIzh.js} +1 -1
  38. package/frontend-dist/assets/{image-Bp59tVen.js → image-BQjpozCO.js} +1 -1
  39. package/frontend-dist/assets/{index-Di7f6Crg.js → index-CpvOTf7s.js} +2 -2
  40. package/frontend-dist/assets/{model-patches-CGEItLFI.js → model-patches-Bz5q_usR.js} +1 -1
  41. package/frontend-dist/assets/{pencil-d2ST8J0H.js → pencil-QUrS_Knn.js} +1 -1
  42. package/frontend-dist/assets/plus-COwF_5ra.js +1 -0
  43. package/frontend-dist/assets/search-aFGV_wt3.js +1 -0
  44. package/frontend-dist/assets/{sparkles-C1RBYUoM.js → sparkles-D26eNUGF.js} +1 -1
  45. package/frontend-dist/assets/{transform-domain-CaOlRFL4.js → transform-domain-BiEMeUvX.js} +1 -1
  46. package/frontend-dist/assets/{trash-2-C1YCkSOe.js → trash-2-4HdxTT6S.js} +1 -1
  47. package/frontend-dist/assets/{useClipboard-DfhNcDMZ.js → useClipboard-Bv5gUQAX.js} +1 -1
  48. package/frontend-dist/assets/{useLogRetention-Ck3INr4l.js → useLogRetention-NFhOwCBf.js} +1 -1
  49. package/frontend-dist/assets/{useProviderGroups-IgmEpHao.js → useProviderGroups-Z3iRaBYM.js} +1 -1
  50. package/frontend-dist/index.html +2 -2
  51. package/package.json +1 -1
  52. package/frontend-dist/assets/arrow-down-C0j8UmLw.js +0 -1
  53. package/frontend-dist/assets/chevron-right-QdaibhaO.js +0 -1
  54. package/frontend-dist/assets/plus-DPWmbUOf.js +0 -1
  55. package/frontend-dist/assets/search-BNr8kuWX.js +0 -1
@@ -1,3 +1,3 @@
1
- import{$ as e,A as t,Ft as n,Ht as r,J as i,K as a,Mt as o,Ot as s,Pt as c,Q as l,Qt as u,R as d,S as f,St as p,U as m,Vt as h,Wt as g,X as _,Xt as v,Y as y,Yt as b,_t as x,at as S,bt as C,c as w,ct as T,et as E,gt as D,h as ee,i as O,it as k,j as te,jt as A,lt as ne,mt as re,n as ie,nt as j,ot as M,pt as N,qt as P,r as F,t as ae,tt as oe,vt as I,xt as L,zt as R}from"./button-DpPvjx0f.js";import{t as z}from"./chevron-right-QdaibhaO.js";import{t as se}from"./Label-B5FJLcPy.js";import{Dt as ce,Et as le,G as ue,H as de,Ot as fe,R as pe,U as me,X as he,_ as ge,a as _e,b as ve,g as ye,h as be,i as xe,m as Se,q as Ce,v as we,vt as Te,wt as Ee,x as De,y as Oe}from"./index-Di7f6Crg.js";import{t as ke}from"./Skeleton-Bb6JdseU.js";import{t as Ae}from"./badge-BKjuTJ01.js";import{t as je}from"./Input-C5OLhaEA.js";var Me=d(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),Ne=d(`funnel`,[[`path`,{d:`M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z`,key:`sc7q7i`}]]);function Pe(e,t){return e-t*Math.floor(e/t)}var Fe=1721426;function Ie(e,t,n,r){t=Re(e,t);let i=t-1,a=-2;return n<=2?a=0:Le(t)&&(a=-1),Fe-1+365*i+Math.floor(i/4)-Math.floor(i/100)+Math.floor(i/400)+Math.floor((367*n-362)/12+a+r)}function Le(e){return e%4==0&&(e%100!=0||e%400==0)}function Re(e,t){return e===`BC`?1-t:t}function ze(e){let t=`AD`;return e<=0&&(t=`BC`,e=1-e),[t,e]}var Be={standard:[31,28,31,30,31,30,31,31,30,31,30,31],leapyear:[31,29,31,30,31,30,31,31,30,31,30,31]},Ve=class{fromJulianDay(e){let t=e,n=t-Fe,r=Math.floor(n/146097),i=Pe(n,146097),a=Math.floor(i/36524),o=Pe(i,36524),s=Math.floor(o/1461),c=Pe(o,1461),l=Math.floor(c/365),[u,d]=ze(r*400+a*100+s*4+l+ +(a!==4&&l!==4)),f=t-Ie(u,d,1,1),p=2;t<Ie(u,d,3,1)?p=0:Le(d)&&(p=1);let m=Math.floor(((f+p)*12+373)/367);return new V(u,d,m,t-Ie(u,d,m,1)+1)}toJulianDay(e){return Ie(e.era,e.year,e.month,e.day)}getDaysInMonth(e){return Be[Le(e.year)?`leapyear`:`standard`][e.month-1]}getMonthsInYear(e){return 12}getDaysInYear(e){return Le(e.year)?366:365}getMaximumMonthsInYear(){return 12}getMaximumDaysInMonth(){return 31}getYearsInEra(e){return 9999}getEras(){return[`BC`,`AD`]}isInverseEra(e){return e.era===`BC`}balanceDate(e){e.year<=0&&(e.era=e.era===`BC`?`AD`:`BC`,e.year=1-e.year)}constructor(){this.identifier=`gregory`}},He={"001":1,AD:1,AE:6,AF:6,AI:1,AL:1,AM:1,AN:1,AR:1,AT:1,AU:1,AX:1,AZ:1,BA:1,BE:1,BG:1,BH:6,BM:1,BN:1,BY:1,CH:1,CL:1,CM:1,CN:1,CR:1,CY:1,CZ:1,DE:1,DJ:6,DK:1,DZ:6,EC:1,EE:1,EG:6,ES:1,FI:1,FJ:1,FO:1,FR:1,GB:1,GE:1,GF:1,GP:1,GR:1,HR:1,HU:1,IE:1,IQ:6,IR:6,IS:1,IT:1,JO:6,KG:1,KW:6,KZ:1,LB:1,LI:1,LK:1,LT:1,LU:1,LV:1,LY:6,MC:1,MD:1,ME:1,MK:1,MN:1,MQ:1,MV:5,MY:1,NL:1,NO:1,NZ:1,OM:6,PL:1,QA:6,RE:1,RO:1,RS:1,RU:1,SD:6,SE:1,SI:1,SK:1,SM:1,SY:6,TJ:1,TM:1,TR:1,UA:1,UY:1,UZ:1,VA:1,VN:1,XK:1};function Ue(e,t){return t=B(t,e.calendar),e.era===t.era&&e.year===t.year&&e.month===t.month&&e.day===t.day}function We(e,t){return t=B(t,e.calendar),e=ot(e),t=ot(t),e.era===t.era&&e.year===t.year&&e.month===t.month}function Ge(e,t){return qe(e.calendar,t.calendar)&&Ue(e,t)}function Ke(e,t){return qe(e.calendar,t.calendar)&&We(e,t)}function qe(e,t){return e.isEqual?.(t)??t.isEqual?.(e)??e.identifier===t.identifier}function Je(e,t){return Ue(e,Qe(t))}var Ye={sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6};function Xe(e,t,n){let r=e.calendar.toJulianDay(e),i=n?Ye[n]:ft(t),a=Math.ceil(r+1-i)%7;return a<0&&(a+=7),a}function Ze(e){return Ct(Date.now(),e)}function Qe(e){return wt(Ze(e))}function $e(e,t){return e.calendar.toJulianDay(e)-t.calendar.toJulianDay(t)}function et(e,t){return tt(e)-tt(t)}function tt(e){return e.hour*36e5+e.minute*6e4+e.second*1e3+e.millisecond}var nt=null,rt=!1;function it(){return nt??=new Intl.DateTimeFormat().resolvedOptions().timeZone,nt}function at(){return rt}function ot(e){return e.subtract({days:e.day-1})}function st(e){return e.add({days:e.calendar.getDaysInMonth(e)-e.day})}function ct(e){return ot(e.subtract({months:e.month-1}))}var lt=new Map,ut=new Map;function dt(e){if(Intl.Locale){let t=lt.get(e);return t||(t=new Intl.Locale(e).maximize().region,t&&lt.set(e,t)),t}let t=e.split(`-`)[1];return t===`u`?void 0:t}function ft(e){let t=ut.get(e);if(!t){if(Intl.Locale){let n=new Intl.Locale(e);if(`getWeekInfo`in n&&(t=n.getWeekInfo(),t))return ut.set(e,t),t.firstDay}let n=dt(e);if(e.includes(`-fw-`)){let n=e.split(`-fw-`)[1].split(`-`)[0];t=n===`mon`?{firstDay:1}:n===`tue`?{firstDay:2}:n===`wed`?{firstDay:3}:n===`thu`?{firstDay:4}:n===`fri`?{firstDay:5}:n===`sat`?{firstDay:6}:{firstDay:0}}else t=e.includes(`-ca-iso8601`)?{firstDay:1}:{firstDay:n&&He[n]||0};ut.set(e,t)}return t.firstDay}function pt(e){return e=B(e,new Ve),mt(Re(e.era,e.year),e.month,e.day,e.hour,e.minute,e.second,e.millisecond)}function mt(e,t,n,r,i,a,o){let s=new Date;return s.setUTCHours(r,i,a,o),s.setUTCFullYear(e,t-1,n),s.getTime()}function ht(e,t){if(t===`UTC`)return 0;if(e>0&&t===it()&&!at())return new Date(e).getTimezoneOffset()*-6e4;let{year:n,month:r,day:i,hour:a,minute:o,second:s}=_t(e,t);return mt(n,r,i,a,o,s,0)-Math.floor(e/1e3)*1e3}var gt=new Map;function _t(e,t){let n=gt.get(t);n||(n=new Intl.DateTimeFormat(`en-US`,{timeZone:t,hour12:!1,era:`short`,year:`numeric`,month:`numeric`,day:`numeric`,hour:`numeric`,minute:`numeric`,second:`numeric`}),gt.set(t,n));let r=n.formatToParts(new Date(e)),i={};for(let e of r)e.type!==`literal`&&(i[e.type]=e.value);return{year:i.era===`BC`||i.era===`B`?-i.year+1:+i.year,month:+i.month,day:+i.day,hour:i.hour===`24`?0:+i.hour,minute:+i.minute,second:+i.second}}var vt=864e5;function yt(e,t,n,r){return(n===r?[n]:[n,r]).filter(n=>bt(e,t,n))}function bt(e,t,n){let r=_t(n,t);return e.year===r.year&&e.month===r.month&&e.day===r.day&&e.hour===r.hour&&e.minute===r.minute&&e.second===r.second}function xt(e,t,n=`compatible`){let r=Tt(e);if(t===`UTC`)return pt(r);if(t===it()&&n===`compatible`&&!at()){r=B(r,new Ve);let e=new Date,t=Re(r.era,r.year);return e.setFullYear(t,r.month-1,r.day),e.setHours(r.hour,r.minute,r.second,r.millisecond),e.getTime()}let i=pt(r),a=ht(i-vt,t),o=ht(i+vt,t),s=yt(r,t,i-a,i-o);if(s.length===1)return s[0];if(s.length>1)switch(n){case`compatible`:case`earlier`:return s[0];case`later`:return s[s.length-1];case`reject`:throw RangeError(`Multiple possible absolute times found`)}switch(n){case`earlier`:return Math.min(i-a,i-o);case`compatible`:case`later`:return Math.max(i-a,i-o);case`reject`:throw RangeError(`No such absolute time found`)}}function St(e,t,n=`compatible`){return new Date(xt(e,t,n))}function Ct(e,t){let n=ht(e,t),r=new Date(e+n),i=r.getUTCFullYear(),a=r.getUTCMonth()+1,o=r.getUTCDate(),s=r.getUTCHours(),c=r.getUTCMinutes(),l=r.getUTCSeconds(),u=r.getUTCMilliseconds();return new an(i<1?`BC`:`AD`,i<1?-i+1:i,a,o,t,n,s,c,l,u)}function wt(e){return new V(e.calendar,e.era,e.year,e.month,e.day)}function Tt(e,t){let n=0,r=0,i=0,a=0;if(`timeZone`in e)({hour:n,minute:r,second:i,millisecond:a}=e);else if(`hour`in e&&!t)return e;return t&&({hour:n,minute:r,second:i,millisecond:a}=t),new rn(e.calendar,e.era,e.year,e.month,e.day,n,r,i,a)}function B(e,t){if(qe(e.calendar,t))return e;let n=t.fromJulianDay(e.calendar.toJulianDay(e)),r=e.copy();return r.calendar=t,r.era=n.era,r.year=n.year,r.month=n.month,r.day=n.day,Ft(r),r}function Et(e,t,n){return e instanceof an?e.timeZone===t?e:Ot(e,t):Ct(xt(e,t,n),t)}function Dt(e){let t=pt(e)-e.offset;return new Date(t)}function Ot(e,t){return B(Ct(pt(e)-e.offset,t),e.calendar)}var kt=36e5;function At(e,t){let n=e.copy(),r=`hour`in n?Ut(n,t):0;jt(n,t.years||0),n.calendar.balanceYearMonth&&n.calendar.balanceYearMonth(n,e),n.month+=t.months||0,Mt(n),Pt(n),n.day+=(t.weeks||0)*7,n.day+=t.days||0,n.day+=r,Nt(n),n.calendar.balanceDate&&n.calendar.balanceDate(n),n.year<1&&(n.year=1,n.month=1,n.day=1);let i=n.calendar.getYearsInEra(n);if(n.year>i){let e=n.calendar.isInverseEra?.(n);n.year=i,n.month=e?1:n.calendar.getMonthsInYear(n),n.day=e?1:n.calendar.getDaysInMonth(n)}n.month<1&&(n.month=1,n.day=1);let a=n.calendar.getMonthsInYear(n);return n.month>a&&(n.month=a,n.day=n.calendar.getDaysInMonth(n)),n.day=Math.max(1,Math.min(n.calendar.getDaysInMonth(n),n.day)),n}function jt(e,t){e.calendar.isInverseEra?.(e)&&(t=-t),e.year+=t}function Mt(e){for(;e.month<1;)jt(e,-1),e.month+=e.calendar.getMonthsInYear(e);let t=0;for(;e.month>(t=e.calendar.getMonthsInYear(e));)e.month-=t,jt(e,1)}function Nt(e){for(;e.day<1;)e.month--,Mt(e),e.day+=e.calendar.getDaysInMonth(e);for(;e.day>e.calendar.getDaysInMonth(e);)e.day-=e.calendar.getDaysInMonth(e),e.month++,Mt(e)}function Pt(e){e.month=Math.max(1,Math.min(e.calendar.getMonthsInYear(e),e.month)),e.day=Math.max(1,Math.min(e.calendar.getDaysInMonth(e),e.day))}function Ft(e){e.calendar.constrainDate&&e.calendar.constrainDate(e),e.year=Math.max(1,Math.min(e.calendar.getYearsInEra(e),e.year)),Pt(e)}function It(e){let t={};for(let n in e)typeof e[n]==`number`&&(t[n]=-e[n]);return t}function Lt(e,t){return At(e,It(t))}function Rt(e,t){let n=e.copy();return t.era!=null&&(n.era=t.era),t.year!=null&&(n.year=t.year),t.month!=null&&(n.month=t.month),t.day!=null&&(n.day=t.day),Ft(n),n}function zt(e,t){let n=e.copy();return t.hour!=null&&(n.hour=t.hour),t.minute!=null&&(n.minute=t.minute),t.second!=null&&(n.second=t.second),t.millisecond!=null&&(n.millisecond=t.millisecond),Vt(n),n}function Bt(e){e.second+=Math.floor(e.millisecond/1e3),e.millisecond=Ht(e.millisecond,1e3),e.minute+=Math.floor(e.second/60),e.second=Ht(e.second,60),e.hour+=Math.floor(e.minute/60),e.minute=Ht(e.minute,60);let t=Math.floor(e.hour/24);return e.hour=Ht(e.hour,24),t}function Vt(e){e.millisecond=Math.max(0,Math.min(e.millisecond,1e3)),e.second=Math.max(0,Math.min(e.second,59)),e.minute=Math.max(0,Math.min(e.minute,59)),e.hour=Math.max(0,Math.min(e.hour,23))}function Ht(e,t){let n=e%t;return n<0&&(n+=t),n}function Ut(e,t){return e.hour+=t.hours||0,e.minute+=t.minutes||0,e.second+=t.seconds||0,e.millisecond+=t.milliseconds||0,Bt(e)}function Wt(e,t,n,r){let i=e.copy();switch(t){case`era`:{let t=e.calendar.getEras(),a=t.indexOf(e.era);if(a<0)throw Error(`Invalid era: `+e.era);a=Kt(a,n,0,t.length-1,r?.round),i.era=t[a],Ft(i);break}case`year`:i.calendar.isInverseEra?.(i)&&(n=-n),i.year=Kt(e.year,n,-1/0,9999,r?.round),i.year===-1/0&&(i.year=1),i.calendar.balanceYearMonth&&i.calendar.balanceYearMonth(i,e);break;case`month`:i.month=Kt(e.month,n,1,e.calendar.getMonthsInYear(e),r?.round);break;case`day`:i.day=Kt(e.day,n,1,e.calendar.getDaysInMonth(e),r?.round);break;default:throw Error(`Unsupported field `+t)}return e.calendar.balanceDate&&e.calendar.balanceDate(i),Ft(i),i}function Gt(e,t,n,r){let i=e.copy();switch(t){case`hour`:{let t=e.hour,a=0,o=23;if(r?.hourCycle===12){let e=t>=12;a=e?12:0,o=e?23:11}i.hour=Kt(t,n,a,o,r?.round);break}case`minute`:i.minute=Kt(e.minute,n,0,59,r?.round);break;case`second`:i.second=Kt(e.second,n,0,59,r?.round);break;case`millisecond`:i.millisecond=Kt(e.millisecond,n,0,999,r?.round);break;default:throw Error(`Unsupported field `+t)}return i}function Kt(e,t,n,r,i=!1){if(i){e+=Math.sign(t),e<n&&(e=r);let i=Math.abs(t);e=t>0?Math.ceil(e/i)*i:Math.floor(e/i)*i,e>r&&(e=n)}else e+=t,e<n?e=r-(n-e-1):e>r&&(e=n+(e-r-1));return e}function qt(e,t){let n;return n=t.years!=null&&t.years!==0||t.months!=null&&t.months!==0||t.weeks!=null&&t.weeks!==0||t.days!=null&&t.days!==0?xt(At(Tt(e),{years:t.years,months:t.months,weeks:t.weeks,days:t.days}),e.timeZone):pt(e)-e.offset,n+=t.milliseconds||0,n+=(t.seconds||0)*1e3,n+=(t.minutes||0)*6e4,n+=(t.hours||0)*36e5,B(Ct(n,e.timeZone),e.calendar)}function Jt(e,t){return qt(e,It(t))}function Yt(e,t,n,r){switch(t){case`hour`:{let t=0,i=23;if(r?.hourCycle===12){let n=e.hour>=12;t=n?12:0,i=n?23:11}let a=Tt(e),o=B(zt(a,{hour:t}),new Ve),s=[xt(o,e.timeZone,`earlier`),xt(o,e.timeZone,`later`)].filter(t=>Ct(t,e.timeZone).day===o.day)[0],c=B(zt(a,{hour:i}),new Ve),l=[xt(c,e.timeZone,`earlier`),xt(c,e.timeZone,`later`)].filter(t=>Ct(t,e.timeZone).day===c.day).pop(),u=pt(e)-e.offset,d=Math.floor(u/kt),f=u%kt;return u=Kt(d,n,Math.floor(s/kt),Math.floor(l/kt),r?.round)*kt+f,B(Ct(u,e.timeZone),e.calendar)}case`minute`:case`second`:case`millisecond`:return Gt(e,t,n,r);case`era`:case`year`:case`month`:case`day`:return B(Ct(xt(Wt(Tt(e),t,n,r),e.timeZone),e.timeZone),e.calendar);default:throw Error(`Unsupported field `+t)}}function Xt(e,t,n){let r=Tt(e),i=zt(Rt(r,t),t);return i.compare(r)===0?e:B(Ct(xt(i,e.timeZone,n),e.timeZone),e.calendar)}function Zt(e){return`${String(e.hour).padStart(2,`0`)}:${String(e.minute).padStart(2,`0`)}:${String(e.second).padStart(2,`0`)}${e.millisecond?String(e.millisecond/1e3).slice(1):``}`}function Qt(e){let t=B(e,new Ve),n;return n=t.era===`BC`?t.year===1?`0000`:`-`+String(Math.abs(1-t.year)).padStart(6,`00`):String(t.year).padStart(4,`0`),`${n}-${String(t.month).padStart(2,`0`)}-${String(t.day).padStart(2,`0`)}`}function $t(e){return`${Qt(e)}T${Zt(e)}`}function en(e){let t=Math.sign(e)<0?`-`:`+`;e=Math.abs(e);let n=Math.floor(e/36e5),r=Math.floor(e%36e5/6e4),i=Math.floor(e%36e5%6e4/1e3),a=`${t}${String(n).padStart(2,`0`)}:${String(r).padStart(2,`0`)}`;return i!==0&&(a+=`:${String(i).padStart(2,`0`)}`),a}function tn(e){return`${$t(e)}${en(e.offset)}[${e.timeZone}]`}function nn(e){let t=typeof e[0]==`object`?e.shift():new Ve,n;if(typeof e[0]==`string`)n=e.shift();else{let e=t.getEras();n=e[e.length-1]}let r=e.shift(),i=e.shift(),a=e.shift();return[t,n,r,i,a]}var V=class e{constructor(...e){let[t,n,r,i,a]=nn(e);this.calendar=t,this.era=n,this.year=r,this.month=i,this.day=a,Ft(this)}copy(){return this.era?new e(this.calendar,this.era,this.year,this.month,this.day):new e(this.calendar,this.year,this.month,this.day)}add(e){return At(this,e)}subtract(e){return Lt(this,e)}set(e){return Rt(this,e)}cycle(e,t,n){return Wt(this,e,t,n)}toDate(e){return St(this,e)}toString(){return Qt(this)}compare(e){return $e(this,e)}},rn=class e{constructor(...e){let[t,n,r,i,a]=nn(e);this.calendar=t,this.era=n,this.year=r,this.month=i,this.day=a,this.hour=e.shift()||0,this.minute=e.shift()||0,this.second=e.shift()||0,this.millisecond=e.shift()||0,Ft(this)}copy(){return this.era?new e(this.calendar,this.era,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond):new e(this.calendar,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond)}add(e){return At(this,e)}subtract(e){return Lt(this,e)}set(e){return Rt(zt(this,e),e)}cycle(e,t,n){switch(e){case`era`:case`year`:case`month`:case`day`:return Wt(this,e,t,n);default:return Gt(this,e,t,n)}}toDate(e,t){return St(this,e,t)}toString(){return $t(this)}compare(e){let t=$e(this,e);return t===0?et(this,Tt(e)):t}},an=class e{constructor(...e){let[t,n,r,i,a]=nn(e),o=e.shift(),s=e.shift();this.calendar=t,this.era=n,this.year=r,this.month=i,this.day=a,this.timeZone=o,this.offset=s,this.hour=e.shift()||0,this.minute=e.shift()||0,this.second=e.shift()||0,this.millisecond=e.shift()||0,Ft(this)}copy(){return this.era?new e(this.calendar,this.era,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond):new e(this.calendar,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond)}add(e){return qt(this,e)}subtract(e){return Jt(this,e)}set(e,t){return Xt(this,e,t)}cycle(e,t,n){return Yt(this,e,t,n)}toDate(){return Dt(this)}toString(){return tn(this)}toAbsoluteString(){return this.toDate().toISOString()}compare(e){return this.toDate().getTime()-Et(e,this.timeZone).toDate().getTime()}},on=[[1868,9,8],[1912,7,30],[1926,12,25],[1989,1,8],[2019,5,1]],sn=[[1912,7,29],[1926,12,24],[1989,1,7],[2019,4,30]],cn=[1867,1911,1925,1988,2018],ln=[`meiji`,`taisho`,`showa`,`heisei`,`reiwa`];function un(e){let t=on.findIndex(([t,n,r])=>e.year<t||e.year===t&&e.month<n||e.year===t&&e.month===n&&e.day<r);return t===-1?on.length-1:t===0?0:t-1}function dn(e){let t=cn[ln.indexOf(e.era)];if(!t)throw Error(`Unknown era: `+e.era);return new V(e.year+t,e.month,e.day)}var fn=class extends Ve{fromJulianDay(e){let t=super.fromJulianDay(e),n=un(t);return new V(this,ln[n],t.year-cn[n],t.month,t.day)}toJulianDay(e){return super.toJulianDay(dn(e))}balanceDate(e){let t=dn(e),n=un(t);ln[n]!==e.era&&(e.era=ln[n],e.year=t.year-cn[n]),this.constrainDate(e)}constrainDate(e){let t=ln.indexOf(e.era),n=sn[t];if(n!=null){let[r,i,a]=n,o=r-cn[t];e.year=Math.max(1,Math.min(o,e.year)),e.year===o&&(e.month=Math.min(i,e.month),e.month===i&&(e.day=Math.min(a,e.day)))}if(e.year===1&&t>=0){let[,n,r]=on[t];e.month=Math.max(n,e.month),e.month===n&&(e.day=Math.max(r,e.day))}}getEras(){return ln}getYearsInEra(e){let t=ln.indexOf(e.era),n=on[t],r=on[t+1];if(r==null)return 9999-n[0]+1;let i=r[0]-n[0];return(e.month<r[1]||e.month===r[1]&&e.day<r[2])&&i++,i}getDaysInMonth(e){return super.getDaysInMonth(dn(e))}getMinimumMonthInYear(e){let t=pn(e);return t?t[1]:1}getMinimumDayInMonth(e){let t=pn(e);return t&&e.month===t[1]?t[2]:1}constructor(...e){super(...e),this.identifier=`japanese`}};function pn(e){if(e.year===1)return on[ln.indexOf(e.era)]}var mn=-543,hn=class extends Ve{fromJulianDay(e){let t=super.fromJulianDay(e),n=Re(t.era,t.year);return new V(this,n-mn,t.month,t.day)}toJulianDay(e){return super.toJulianDay(gn(e))}getEras(){return[`BE`]}getDaysInMonth(e){return super.getDaysInMonth(gn(e))}balanceDate(){}constructor(...e){super(...e),this.identifier=`buddhist`}};function gn(e){let[t,n]=ze(e.year+mn);return new V(t,n,e.month,e.day)}var _n=1911;function vn(e){return e.era===`minguo`?e.year+_n:1-e.year+_n}function yn(e){let t=e-_n;return t>0?[`minguo`,t]:[`before_minguo`,1-t]}var bn=class extends Ve{fromJulianDay(e){let t=super.fromJulianDay(e),[n,r]=yn(Re(t.era,t.year));return new V(this,n,r,t.month,t.day)}toJulianDay(e){return super.toJulianDay(xn(e))}getEras(){return[`before_minguo`,`minguo`]}balanceDate(e){let[t,n]=yn(vn(e));e.era=t,e.year=n}isInverseEra(e){return e.era===`before_minguo`}getDaysInMonth(e){return super.getDaysInMonth(xn(e))}getYearsInEra(e){return e.era===`before_minguo`?9999:9999-_n}constructor(...e){super(...e),this.identifier=`roc`}};function xn(e){let[t,n]=ze(vn(e));return new V(t,n,e.month,e.day)}var Sn=1948320,Cn=[0,31,62,93,124,155,186,216,246,276,306,336],wn=class{fromJulianDay(e){let t=e-Sn,n=1+Math.floor((33*t+3)/12053),r=t-(365*(n-1)+Math.floor((8*n+21)/33)),i=Math.floor(r<216?r/31:(r-6)/30),a=r-Cn[i]+1;return new V(this,n,i+1,a)}toJulianDay(e){let t=Sn-1+365*(e.year-1)+Math.floor((8*e.year+21)/33);return t+=Cn[e.month-1],t+=e.day,t}getMonthsInYear(){return 12}getDaysInMonth(e){return e.month<=6?31:e.month<=11||Pe(25*e.year+11,33)<8?30:29}getMaximumMonthsInYear(){return 12}getMaximumDaysInMonth(){return 31}getEras(){return[`AP`]}getYearsInEra(){return 9377}constructor(){this.identifier=`persian`}},Tn=78,En=80,Dn=class extends Ve{fromJulianDay(e){let t=super.fromJulianDay(e),n=t.year-Tn,r=e-Ie(t.era,t.year,1,1),i;r<En?(n--,i=Le(t.year-1)?31:30,r+=i+155+90+10):(i=Le(t.year)?31:30,r-=En);let a,o;if(r<i)a=1,o=r+1;else{let e=r-i;e<155?(a=Math.floor(e/31)+2,o=e%31+1):(e-=155,a=Math.floor(e/30)+7,o=e%30+1)}return new V(this,n,a,o)}toJulianDay(e){let[t,n]=ze(e.year+Tn),r,i;return Le(n)?(r=31,i=Ie(t,n,3,21)):(r=30,i=Ie(t,n,3,22)),e.month===1?i+e.day-1:(i+=r+Math.min(e.month-2,5)*31,e.month>=8&&(i+=(e.month-7)*30),i+=e.day-1,i)}getDaysInMonth(e){return e.month===1&&Le(e.year+Tn)||e.month>=2&&e.month<=6?31:30}getYearsInEra(){return 9919}getEras(){return[`saka`]}balanceDate(){}constructor(...e){super(...e),this.identifier=`indian`}},On=1948440,kn=1948439,An=1300,jn=1600,Mn=460322;function Nn(e,t,n,r){return r+Math.ceil(29.5*(n-1))+(t-1)*354+Math.floor((3+11*t)/30)+e-1}function Pn(e,t,n){let r=Math.floor((30*(n-t)+10646)/10631),i=Math.min(12,Math.ceil((n-(29+Nn(t,r,1,1)))/29.5)+1);return new V(e,r,i,n-Nn(t,r,i,1)+1)}function Fn(e){return(14+11*e)%30<11}var In=class{fromJulianDay(e){return Pn(this,On,e)}toJulianDay(e){return Nn(On,e.year,e.month,e.day)}getDaysInMonth(e){let t=29+e.month%2;return e.month===12&&Fn(e.year)&&t++,t}getMonthsInYear(){return 12}getDaysInYear(e){return Fn(e.year)?355:354}getMaximumMonthsInYear(){return 12}getMaximumDaysInMonth(){return 30}getYearsInEra(){return 9665}getEras(){return[`AH`]}constructor(){this.identifier=`islamic-civil`}},Ln=class extends In{fromJulianDay(e){return Pn(this,kn,e)}toJulianDay(e){return Nn(kn,e.year,e.month,e.day)}constructor(...e){super(...e),this.identifier=`islamic-tbla`}},Rn=`qgpUDckO1AbqBmwDrQpVBakGkgepC9QF2gpcBS0NlQZKB1QLagutBa4ETwoXBYsGpQbVCtYCWwmdBE0KJg2VDawFtgm6AlsKKwWVCsoG6Qr0AnYJtgJWCcoKpAvSC9kF3AJtCU0FpQpSC6ULtAW2CVcFlwJLBaMGUgdlC2oFqworBZUMSg2lDcoF1gpXCasESwmlClILagt1BXYCtwhbBFUFqQW0BdoJ3QRuAjYJqgpUDbIN1QXaAlsJqwRVCkkLZAtxC7QFtQpVCiUNkg7JDtQG6QprCasEkwpJDaQNsg25CroEWworBZUKKgtVC1wFvQQ9Ah0JlQpKC1oLbQW2AjsJmwRVBqkGVAdqC2wFrQpVBSkLkgupC9QF2gpaBasKlQVJB2QHqgu1BbYCVgpNDiULUgtqC60FrgIvCZcESwalBqwG1gpdBZ0ETQoWDZUNqgW1BdoCWwmtBJUFygbkBuoK9QS2AlYJqgpUC9IL2QXqAm0JrQSVCkoLpQuyBbUJ1gSXCkcFkwZJB1ULagVrCisFiwpGDaMNygXWCtsEawJLCaUKUgtpC3UFdgG3CFsCKwVlBbQF2gntBG0BtgimClINqQ3UBdoKWwmrBFMGKQdiB6kLsgW1ClUFJQuSDckO0gbpCmsFqwRVCikNVA2qDbUJugQ7CpsETQqqCtUK2gJdCV4ELgqaDFUNsga5BroEXQotBZUKUguoC7QLuQXaAloJSgukDdEO6AZqC20FNQWVBkoNqA3UDdoGWwWdAisGFQtKC5ULqgWuCi4JjwwnBZUGqgbWCl0FnQI=`,zn,Bn;function Vn(e){return Mn+Bn[e-An]}function Hn(e,t){let n=e-An,r=1<<11-(t-1);return(zn[n]&r)===0?29:30}function Un(e,t){let n=Vn(e);for(let r=1;r<t;r++)n+=Hn(e,r);return n}function Wn(e){return Bn[e+1-An]-Bn[e-An]}var Gn=class extends In{constructor(){if(super(),this.identifier=`islamic-umalqura`,zn||=new Uint16Array(Uint8Array.from(atob(Rn),e=>e.charCodeAt(0)).buffer),!Bn){Bn=new Uint32Array(jn-An+1);let e=0;for(let t=An;t<=jn;t++){Bn[t-An]=e;for(let n=1;n<=12;n++)e+=Hn(t,n)}}}fromJulianDay(e){let t=e-On,n=Vn(An),r=Vn(jn);if(t<n||t>r)return super.fromJulianDay(e);{let e=An-1,n=1,r=1;for(;r>0;){e++,r=t-Vn(e)+1;let i=Wn(e);if(r===i){n=12;break}else if(r<i){let t=Hn(e,n);for(n=1;r>t;)r-=t,n++,t=Hn(e,n);break}}return new V(this,e,n,t-Un(e,n)+1)}}toJulianDay(e){return e.year<An||e.year>jn?super.toJulianDay(e):On+Un(e.year,e.month)+(e.day-1)}getDaysInMonth(e){return e.year<An||e.year>jn?super.getDaysInMonth(e):Hn(e.year,e.month)}getDaysInYear(e){return e.year<An||e.year>jn?super.getDaysInYear(e):Wn(e.year)}},Kn=347997,qn=1080,Jn=24*qn,Yn=29,Xn=12*qn+793,Zn=Yn*Jn+Xn;function Qn(e){return Pe(e*7+1,19)<7}function $n(e){let t=Math.floor((235*e-234)/19),n=12084+13753*t,r=t*29+Math.floor(n/25920);return Pe(3*(r+1),7)<3&&(r+=1),r}function er(e){let t=$n(e-1),n=$n(e);return $n(e+1)-n===356?2:+(n-t===382)}function tr(e){return $n(e)+er(e)}function nr(e){return tr(e+1)-tr(e)}function rr(e){let t=nr(e);switch(t>380&&(t-=30),t){case 353:return 0;case 354:return 1;case 355:return 2}}function ir(e,t){if(t>=6&&!Qn(e)&&t++,t===4||t===7||t===9||t===11||t===13)return 29;let n=rr(e);return t===2?n===2?30:29:t===3?n===0?29:30:t===6?Qn(e)?30:0:30}var ar=class{fromJulianDay(e){let t=e-Kn,n=t*Jn/Zn,r=Math.floor((19*n+234)/235)+1,i=tr(r),a=Math.floor(t-i);for(;a<1;)r--,i=tr(r),a=Math.floor(t-i);let o=1,s=0;for(;s<a;)s+=ir(r,o),o++;o--,s-=ir(r,o);let c=a-s;return new V(this,r,o,c)}toJulianDay(e){let t=tr(e.year);for(let n=1;n<e.month;n++)t+=ir(e.year,n);return t+e.day+Kn}getDaysInMonth(e){return ir(e.year,e.month)}getMonthsInYear(e){return Qn(e.year)?13:12}getDaysInYear(e){return nr(e.year)}getMaximumMonthsInYear(){return 13}getMaximumDaysInMonth(){return 30}getYearsInEra(){return 9999}getEras(){return[`AM`]}balanceYearMonth(e,t){t.year!==e.year&&(Qn(t.year)&&!Qn(e.year)&&t.month>6?e.month--:!Qn(t.year)&&Qn(e.year)&&t.month>6&&e.month++)}constructor(){this.identifier=`hebrew`}},or=1723856,sr=1824665,cr=5500;function lr(e,t,n,r){return e+365*t+Math.floor(t/4)+30*(n-1)+r-1}function ur(e,t){let n=Math.floor(4*(t-e)/1461),r=1+Math.floor((t-lr(e,n,1,1))/30);return[n,r,t+1-lr(e,n,r,1)]}function dr(e){return Math.floor(e%4/3)}function fr(e,t){return t%13==0?dr(e)+5:30}var pr=class{fromJulianDay(e){let[t,n,r]=ur(or,e),i=`AM`;return t<=0&&(i=`AA`,t+=cr),new V(this,i,t,n,r)}toJulianDay(e){let t=e.year;return e.era===`AA`&&(t-=cr),lr(or,t,e.month,e.day)}getDaysInMonth(e){return fr(e.year,e.month)}getMonthsInYear(){return 13}getDaysInYear(e){return 365+dr(e.year)}getMaximumMonthsInYear(){return 13}getMaximumDaysInMonth(){return 30}getYearsInEra(e){return e.era===`AA`?9999:9991}getEras(){return[`AA`,`AM`]}constructor(){this.identifier=`ethiopic`}},mr=class extends pr{fromJulianDay(e){let[t,n,r]=ur(or,e);return t+=cr,new V(this,`AA`,t,n,r)}getEras(){return[`AA`]}getYearsInEra(){return 9999}constructor(...e){super(...e),this.identifier=`ethioaa`}},hr=class extends pr{fromJulianDay(e){let[t,n,r]=ur(sr,e),i=`CE`;return t<=0&&(i=`BCE`,t=1-t),new V(this,i,t,n,r)}toJulianDay(e){let t=e.year;return e.era===`BCE`&&(t=1-t),lr(sr,t,e.month,e.day)}getDaysInMonth(e){let t=e.year;return e.era===`BCE`&&(t=1-t),fr(t,e.month)}isInverseEra(e){return e.era===`BCE`}balanceDate(e){e.year<=0&&(e.era=e.era===`BCE`?`CE`:`BCE`,e.year=1-e.year)}getEras(){return[`BCE`,`CE`]}getYearsInEra(e){return e.era===`BCE`?9999:9715}constructor(...e){super(...e),this.identifier=`coptic`}};function gr(e){switch(e){case`buddhist`:return new hn;case`ethiopic`:return new pr;case`ethioaa`:return new mr;case`coptic`:return new hr;case`hebrew`:return new ar;case`indian`:return new Dn;case`islamic-civil`:return new In;case`islamic-tbla`:return new Ln;case`islamic-umalqura`:return new Gn;case`japanese`:return new fn;case`persian`:return new wn;case`roc`:return new bn;default:return new Ve}}var _r=new Map,vr=class{constructor(e,t={}){this.formatter=br(e,t),this.options=t}format(e){return this.formatter.format(e)}formatToParts(e){return this.formatter.formatToParts(e)}formatRange(e,t){if(typeof this.formatter.formatRange==`function`)return this.formatter.formatRange(e,t);if(t<e)throw RangeError(`End date must be >= start date`);return`${this.formatter.format(e)} \u{2013} ${this.formatter.format(t)}`}formatRangeToParts(e,t){if(typeof this.formatter.formatRangeToParts==`function`)return this.formatter.formatRangeToParts(e,t);if(t<e)throw RangeError(`End date must be >= start date`);let n=this.formatter.formatToParts(e),r=this.formatter.formatToParts(t);return[...n.map(e=>({...e,source:`startRange`})),{type:`literal`,value:` – `,source:`shared`},...r.map(e=>({...e,source:`endRange`}))]}resolvedOptions(){let e=this.formatter.resolvedOptions();return wr()&&(this.resolvedHourCycle||=Tr(e.locale,this.options),e.hourCycle=this.resolvedHourCycle,e.hour12=this.resolvedHourCycle===`h11`||this.resolvedHourCycle===`h12`),e.calendar===`ethiopic-amete-alem`&&(e.calendar=`ethioaa`),e}},yr={true:{ja:`h11`},false:{}};function br(e,t={}){if(typeof t.hour12==`boolean`&&Sr()){t={...t};let n=yr[String(t.hour12)][e.split(`-`)[0]],r=t.hour12?`h12`:`h23`;t.hourCycle=n??r,delete t.hour12}let n=e+(t?Object.entries(t).sort((e,t)=>e[0]<t[0]?-1:1).join():``);if(_r.has(n))return _r.get(n);let r=new Intl.DateTimeFormat(e,t);return _r.set(n,r),r}var xr=null;function Sr(){return xr??=new Intl.DateTimeFormat(`en-US`,{hour:`numeric`,hour12:!1}).format(new Date(2020,2,3,0))===`24`,xr}var Cr=null;function wr(){return Cr??=new Intl.DateTimeFormat(`fr`,{hour:`numeric`,hour12:!1}).resolvedOptions().hourCycle===`h12`,Cr}function Tr(e,t){if(!t.timeStyle&&!t.hour)return;e=e.replace(/(-u-)?-nu-[a-zA-Z0-9]+/,``),e+=(e.includes(`-u-`)?``:`-u`)+`-nu-latn`;let n=br(e,{...t,timeZone:void 0}),r=parseInt(n.formatToParts(new Date(2020,2,3,0)).find(e=>e.type===`hour`).value,10),i=parseInt(n.formatToParts(new Date(2020,2,3,23)).find(e=>e.type===`hour`).value,10);if(r===0&&i===23)return`h23`;if(r===24&&i===23)return`h24`;if(r===0&&i===11)return`h11`;if(r===12&&i===11)return`h12`;throw Error(`Unexpected hour cycle result`)}function H(e,t=it()){return Dr(e)?e.toDate():e.toDate(t)}function Er(e){return e instanceof rn}function Dr(e){return e instanceof an}function Or(e){return Er(e)||Dr(e)}function kr(e){if(e instanceof Date){let t=e.getFullYear(),n=e.getMonth()+1;return new Date(t,n,0).getDate()}else return e.set({day:100}).day}function Ar(e,t){return e.compare(t)<0}function jr(e,t){return e.compare(t)>0}function Mr(e,t,n){let r=Xe(e,n,`sun`);return t>r?e.subtract({days:r+7-t}):t===r?e:e.subtract({days:r-t})}function Nr(e,t,n){let r=Xe(e,n,`sun`),i=t===0?6:t-1;return r===i?e:r>i?e.add({days:7-r+i}):e.add({days:i-r})}function Pr(e){let{defaultValue:t,defaultPlaceholder:n,granularity:r=`day`,locale:i=`en`}=e;if(Array.isArray(t)&&t.length)return t.at(-1).copy();if(t&&!Array.isArray(t))return t.copy();if(n)return n.copy();let a=new Date,o=a.getFullYear(),s=a.getMonth()+1,c=a.getDate(),l=[`hour`,`minute`,`second`],u=gr(new vr(i).resolvedOptions().calendar);return l.includes(r??`day`)?B(new rn(o,s,c,0,0,0),u):B(new V(o,s,c),u)}function Fr(e,t){let n=[];for(let r=0;r<e.length;r+=t)n.push(e.slice(r,r+t));return n}function Ir(e){let t=e.querySelector(`[data-selected]`);if(t)return t.focus();let n=e.querySelector(`[data-today]`);if(n)return n.focus();let r=e.querySelector(`[data-reka-calendar-day]`);if(r)return r.focus()}function Lr(e,t){let n=[],r=e.add({days:1}),i=t;for(;r.compare(i)<0;)n.push(r),r=r.add({days:1});return n}function Rr(e){let{dateObj:t,weekStartsOn:n,fixedWeeks:r,locale:i}=e,a=kr(t),o=Array.from({length:a},(e,n)=>t.set({day:n+1})),s=ot(t),c=st(t),l=Mr(s,n,i),u=Nr(c,n,i),d=Lr(l.subtract({days:1}),s),f=Lr(c,u.add({days:1})),p=d.length+o.length+f.length;if(r&&p<42){let e=42-p,n=f.at(-1);n||=st(t);let r=Array.from({length:e},(e,t)=>{let r=t+1;return n.add({days:r})});f.push(...r)}let m=d.concat(o,f);return{value:t,cells:m,rows:Fr(m,7)}}function zr(e){let{dateObj:t,numberOfMonths:n=1,pagedNavigation:r=!1}=e;return n&&r?Array.from({length:Math.floor(12/n)},(e,r)=>ot(t.set({month:r*n+1}))):Array.from({length:12},(e,n)=>ot(t.set({month:n+1})))}function Br(e){let{numberOfMonths:t,dateObj:n,...r}=e,i=[];if(!t||t===1)return i.push(Rr({...r,dateObj:n})),i;i.push(Rr({...r,dateObj:n}));for(let e=1;e<t;e++){let t=n.add({months:e});i.push(Rr({...r,dateObj:t}))}return i}function Vr({start:e,end:t}){let n=[];if(!e||!t)return n;let r=ct(e);for(;r.compare(t)<=0;)n.push(r),r=ct(r.add({years:1}));return n}function Hr(e){return(1-Xe(new V(2025,1,6),e)+7)%7}function Ur(e,t={}){let n=R(e);function r(){return n.value}function i(e){n.value=e}function a(e,r){return new vr(n.value,{...t,...r}).format(e)}function o(e,t=!0){return Or(e)&&t?a(H(e),{dateStyle:`long`,timeStyle:`long`}):a(H(e),{dateStyle:`long`})}function s(e,r={}){return new vr(n.value,{...t,month:`long`,year:`numeric`,...r}).format(e)}function c(e,r={}){return new vr(n.value,{...t,month:`long`,...r}).format(e)}function l(){let e=Qe(it());return[1,2,3,4,5,6,7,8,9,10,11,12].map(t=>({label:c(H(e.set({month:t}))),value:t}))}function u(e,r={}){return new vr(n.value,{...t,year:`numeric`,...r}).format(e)}function d(e,r){return Dr(e)?new vr(n.value,{...t,...r,timeZone:e.timeZone}).formatToParts(H(e)):new vr(n.value,{...t,...r}).formatToParts(H(e))}function f(e,r=`narrow`){return new vr(n.value,{...t,weekday:r}).format(e)}function p(e){let r=new vr(n.value,{...t,hour:`numeric`,minute:`numeric`}).formatToParts(e).find(e=>e.type===`dayPeriod`)?.value;return r===`PM`||r===`pm`||r===`p.m.`?`PM`:`AM`}let m={year:`numeric`,month:`numeric`,day:`numeric`,hour:`numeric`,minute:`numeric`,second:`numeric`};function h(e,t,n={}){let r=d(e,{...m,...n}).find(e=>e.type===t);return r?r.value:``}return{setLocale:i,getLocale:r,fullMonth:c,fullYear:u,fullMonthAndYear:s,toParts:d,custom:a,part:h,dayPeriod:p,selectedDate:o,dayOfWeek:f,getMonths:l}}function Wr(){return{ALT:`Alt`,ARROW_DOWN:`ArrowDown`,ARROW_LEFT:`ArrowLeft`,ARROW_RIGHT:`ArrowRight`,ARROW_UP:`ArrowUp`,BACKSPACE:`Backspace`,CAPS_LOCK:`CapsLock`,CONTROL:`Control`,DELETE:`Delete`,END:`End`,ENTER:`Enter`,ESCAPE:`Escape`,F1:`F1`,F10:`F10`,F11:`F11`,F12:`F12`,F2:`F2`,F3:`F3`,F4:`F4`,F5:`F5`,F6:`F6`,F7:`F7`,F8:`F8`,F9:`F9`,HOME:`Home`,META:`Meta`,PAGE_DOWN:`PageDown`,PAGE_UP:`PageUp`,SHIFT:`Shift`,SPACE:` `,TAB:`Tab`,CTRL:`Control`,ASTERISK:`*`,SPACE_CODE:`Space`}}function Gr(e){let t=Ce({locale:R(`en`)});return l(()=>e?.value||t.locale?.value||`en`)}function Kr(e){function t(t){return Array.isArray(e.date.value)?e.date.value.some(e=>Ue(e,t)):e.date.value?Ue(e.date.value,t):!1}return{isDateSelected:t,isInvalid:l(()=>{if(Array.isArray(e.date.value)){if(!e.date.value.length)return!1;for(let t of e.date.value)if(e.isDateDisabled?.(t)||e.isDateUnavailable?.(t))return!0}else{if(!e.date.value)return!1;if(e.isDateDisabled?.(e.date.value)||e.isDateUnavailable?.(e.date.value))return!0}return!1}),hasSelectedDate:l(()=>Array.isArray(e.date.value)?e.date.value.length>0:!!e.date.value),isSelectedDateDisabled:l(()=>Array.isArray(e.date.value)?e.date.value.length?e.date.value.some(t=>e.isDateDisabled?.(t)):!1:e.date.value?!!e.isDateDisabled?.(e.date.value):!1)}}function qr(e,t){let n=t(e),r=n.compare(e),i={};return r>=7&&(i.day=1),r>=kr(e)&&(i.month=1),n.set({...i})}function Jr(e,t){let n=t(e),r=e.compare(n),i={};return r>=7&&(i.day=35),r>=kr(e)&&(i.month=13),n.set({...i})}function Yr(e,t){return t(e)}function Xr(e,t){return t(e)}function Zr(e){let t=Ur(e.locale.value),n=l(()=>{let t={calendar:e.placeholder.value.calendar.identifier};return e.placeholder.value.calendar.identifier===`gregory`&&e.placeholder.value.era===`BC`&&(t.era=`short`),t}),r=R(Br({dateObj:e.placeholder.value,weekStartsOn:e.weekStartsOn.value,locale:e.locale.value,fixedWeeks:e.fixedWeeks.value,numberOfMonths:e.numberOfMonths.value})),i=l(()=>r.value.map(e=>e.value));function a(e){return!i.value.some(t=>Ke(e,t))}let o=t=>{if(!e.maxValue.value||!r.value.length)return!1;if(e.disabled.value)return!0;let n=r.value.at(-1).value;return!t&&!e.nextPage.value?jr(n.add({months:1}).set({day:1}),e.maxValue.value):jr(qr(n,t||e.nextPage.value),e.maxValue.value)},c=t=>{if(!e.minValue.value||!r.value.length)return!1;if(e.disabled.value)return!0;let n=r.value[0].value;return!t&&!e.prevPage.value?Ar(n.subtract({months:1}).set({day:35}),e.minValue.value):Ar(Jr(n,t||e.prevPage.value),e.minValue.value)};function u(t){return!!(e.isDateDisabled?.(t)||e.disabled.value||e.maxValue.value&&jr(t,e.maxValue.value)||e.minValue.value&&Ar(t,e.minValue.value))}let d=t=>!!e.isDateUnavailable?.(t),f=l(()=>r.value.length?r.value[0].rows[0].map(n=>t.dayOfWeek(H(n),e.weekdayFormat.value)):[]),p=t=>{let n=r.value[0].value;if(!t&&!e.nextPage.value){let t=Br({dateObj:n.add({months:e.pagedNavigation.value?e.numberOfMonths.value:1}),weekStartsOn:e.weekStartsOn.value,locale:e.locale.value,fixedWeeks:e.fixedWeeks.value,numberOfMonths:e.numberOfMonths.value});r.value=t,e.placeholder.value=t[0].value.set({day:1});return}let i=Br({dateObj:Yr(n,t||e.nextPage.value),weekStartsOn:e.weekStartsOn.value,locale:e.locale.value,fixedWeeks:e.fixedWeeks.value,numberOfMonths:e.numberOfMonths.value});r.value=i;let a={};if(!t){let e=i[0].value.compare(n);e>=kr(n)&&(a.day=1),e>=365&&(a.month=1)}e.placeholder.value=i[0].value.set({...a})},m=t=>{let n=r.value[0].value;if(!t&&!e.prevPage.value){let t=Br({dateObj:n.subtract({months:e.pagedNavigation.value?e.numberOfMonths.value:1}),weekStartsOn:e.weekStartsOn.value,locale:e.locale.value,fixedWeeks:e.fixedWeeks.value,numberOfMonths:e.numberOfMonths.value});r.value=t,e.placeholder.value=t[0].value.set({day:1});return}let i=Br({dateObj:Xr(n,t||e.prevPage.value),weekStartsOn:e.weekStartsOn.value,locale:e.locale.value,fixedWeeks:e.fixedWeeks.value,numberOfMonths:e.numberOfMonths.value});r.value=i;let a={};if(!t){let e=n.compare(i[0].value);e>=kr(n)&&(a.day=1),e>=365&&(a.month=1)}e.placeholder.value=i[0].value.set({...a})};s(e.placeholder,t=>{i.value.some(e=>Ke(e,t))||(r.value=Br({dateObj:t,weekStartsOn:e.weekStartsOn.value,locale:e.locale.value,fixedWeeks:e.fixedWeeks.value,numberOfMonths:e.numberOfMonths.value}))}),s([e.locale,e.weekStartsOn,e.fixedWeeks,e.numberOfMonths],()=>{r.value=Br({dateObj:e.placeholder.value,weekStartsOn:e.weekStartsOn.value,locale:e.locale.value,fixedWeeks:e.fixedWeeks.value,numberOfMonths:e.numberOfMonths.value})});let h=l(()=>{if(!r.value.length)return``;if(e.locale.value!==t.getLocale()&&t.setLocale(e.locale.value),r.value.length===1){let e=r.value[0].value;return`${t.fullMonthAndYear(H(e),n.value)}`}let i=H(r.value[0].value),a=H(r.value.at(-1).value),o=t.fullMonth(i,n.value),s=t.fullMonth(a,n.value),c=t.fullYear(i,n.value),l=t.fullYear(a,n.value);return c===l?`${o} - ${s} ${l}`:`${o} ${c} - ${s} ${l}`});return{isDateDisabled:u,isDateUnavailable:d,isNextButtonDisabled:o,isPrevButtonDisabled:c,grid:r,weekdays:f,visibleView:i,isOutsideVisibleView:a,formatter:t,nextPage:p,prevPage:m,headingValue:h,fullCalendarLabel:l(()=>`${e.calendarLabel.value??`Event Date`}, ${h.value}`),isPlaceholderFocusable:l(()=>!(u(e.placeholder.value)||d(e.placeholder.value)||a(e.placeholder.value))),firstFocusableDate:l(()=>{for(let t of r.value){if(e.minValue.value&&Ar(t.value,e.minValue.value))continue;let n=kr(t.value),r=e.minValue.value&&We(e.minValue.value,t.value)?e.minValue.value.day:1;for(let e=r;e<=n;e++){let n=t.value.set({day:e});if(!(u(n)||d(n)))return n}}})}}var Qr={style:{border:`0px`,clip:`rect(0px, 0px, 0px, 0px)`,"clip-path":`inset(50%)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:`0px`,position:`absolute`,"white-space":`nowrap`,width:`1px`}},$r={role:`heading`,"aria-level":`2`},[ei,ti]=he(`CalendarRoot`),ni=M({__name:`CalendarRoot`,props:{defaultValue:{type:null,required:!1,default:void 0},defaultPlaceholder:{type:null,required:!1},placeholder:{type:null,required:!1,default:void 0},pagedNavigation:{type:Boolean,required:!1,default:!1},preventDeselect:{type:Boolean,required:!1,default:!1},weekStartsOn:{type:Number,required:!1},weekdayFormat:{type:String,required:!1,default:`narrow`},calendarLabel:{type:String,required:!1},fixedWeeks:{type:Boolean,required:!1,default:!1},maxValue:{type:null,required:!1},minValue:{type:null,required:!1},locale:{type:String,required:!1},numberOfMonths:{type:Number,required:!1,default:1},disabled:{type:Boolean,required:!1,default:!1},readonly:{type:Boolean,required:!1,default:!1},initialFocus:{type:Boolean,required:!1,default:!1},isDateDisabled:{type:Function,required:!1,default:void 0},isDateUnavailable:{type:Function,required:!1,default:void 0},dir:{type:String,required:!1},nextPage:{type:Function,required:!1},prevPage:{type:Function,required:!1},modelValue:{type:null,required:!1},multiple:{type:Boolean,required:!1,default:!1},disableDaysOutsideCurrentView:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`div`}},emits:[`update:modelValue`,`update:placeholder`],setup(t,{emit:n}){let r=t,i=n,{disabled:a,readonly:o,initialFocus:c,pagedNavigation:d,weekdayFormat:f,fixedWeeks:p,multiple:m,minValue:h,maxValue:_,numberOfMonths:v,preventDeselect:y,isDateDisabled:b,isDateUnavailable:x,calendarLabel:S,defaultValue:C,nextPage:w,prevPage:T,dir:k,locale:te,disableDaysOutsideCurrentView:ne}=g(r),{primitiveElement:re,currentElement:ie}=pe(),j=Gr(te),M=ue(k),N=l(()=>r.weekStartsOn??Hr(j.value)),F=ee(r,`modelValue`,i,{defaultValue:C.value,passive:r.modelValue===void 0}),ae=Pr({defaultPlaceholder:r.placeholder,defaultValue:F.value,locale:r.locale}),oe=ee(r,`placeholder`,i,{defaultValue:r.defaultPlaceholder??ae.copy(),passive:r.placeholder===void 0});function R(e){oe.value=e.copy()}let{fullCalendarLabel:z,headingValue:se,isDateDisabled:ce,isDateUnavailable:le,isNextButtonDisabled:de,isPrevButtonDisabled:fe,weekdays:me,isOutsideVisibleView:he,nextPage:ge,prevPage:_e,formatter:ve,grid:ye,isPlaceholderFocusable:be,firstFocusableDate:xe}=Zr({locale:j,placeholder:oe,weekStartsOn:N,fixedWeeks:p,numberOfMonths:v,minValue:h,maxValue:_,disabled:a,weekdayFormat:f,pagedNavigation:d,isDateDisabled:b.value,isDateUnavailable:x.value,calendarLabel:S,nextPage:w,prevPage:T}),{isInvalid:Se,isDateSelected:Ce,hasSelectedDate:we,isSelectedDateDisabled:Te}=Kr({date:F,isDateDisabled:ce,isDateUnavailable:le});s(F,e=>{if(Array.isArray(e)&&e.length){let t=e.at(-1);t&&!Ge(oe.value,t)&&R(t)}else !Array.isArray(e)&&e&&!Ge(oe.value,e)&&R(e)});function Ee(e){if(!m.value){if(!F.value){F.value=e.copy();return}!y.value&&Ge(F.value,e)?(oe.value=e.copy(),F.value=void 0):F.value=e.copy()}else if(!F.value)F.value=[e.copy()];else if(Array.isArray(F.value)){if(F.value.findIndex(t=>Ue(t,e))===-1)F.value=[...F.value,e];else if(!y.value){let t=F.value.filter(t=>!Ue(t,e));if(!t.length){oe.value=e.copy(),F.value=void 0;return}F.value=t.map(e=>e.copy())}}}return D(()=>{c.value&&Ir(ie.value)}),ti({isDateUnavailable:le,dir:M,isDateDisabled:ce,locale:j,formatter:ve,modelValue:F,placeholder:oe,disabled:a,initialFocus:c,pagedNavigation:d,grid:ye,weekDays:me,weekStartsOn:N,weekdayFormat:f,fixedWeeks:p,multiple:m,numberOfMonths:v,readonly:o,preventDeselect:y,fullCalendarLabel:z,headingValue:se,isInvalid:Se,isDateSelected:Ce,isNextButtonDisabled:de,isPrevButtonDisabled:fe,isOutsideVisibleView:he,nextPage:ge,prevPage:_e,parentElement:ie,onPlaceholderChange:R,onDateChange:Ee,disableDaysOutsideCurrentView:ne,minValue:h,maxValue:_,isPlaceholderFocusable:be,firstFocusableDate:xe,hasSelectedDate:we,isSelectedDateDisabled:Te}),(t,n)=>(I(),E(P(O),{ref_key:`primitiveElement`,ref:re,as:t.as,"as-child":t.asChild,"aria-label":P(z),"data-readonly":P(o)?``:void 0,"data-disabled":P(a)?``:void 0,"data-invalid":P(Se)?``:void 0,dir:P(M)},{default:A(()=>[L(t.$slots,`default`,{date:P(oe),grid:P(ye),weekDays:P(me),weekStartsOn:N.value,locale:P(j),fixedWeeks:P(p),modelValue:P(F)}),e(`div`,Qr,[e(`div`,$r,u(P(z)),1)])]),_:3},8,[`as`,`as-child`,`aria-label`,`data-readonly`,`data-disabled`,`data-invalid`,`dir`]))}}),ri=M({__name:`CalendarCell`,props:{date:{type:null,required:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`td`}},setup(e){let t=ei();return(e,n)=>(I(),E(P(O),{as:e.as,"as-child":e.asChild,role:`gridcell`,"aria-selected":P(t).isDateSelected(e.date)?!0:void 0,"aria-disabled":P(t).isDateDisabled(e.date)||P(t).isDateUnavailable?.(e.date)||P(t).disableDaysOutsideCurrentView.value,"data-disabled":P(t).isDateDisabled(e.date)||P(t).disableDaysOutsideCurrentView.value?``:void 0},{default:A(()=>[L(e.$slots,`default`)]),_:3},8,[`as`,`as-child`,`aria-selected`,`aria-disabled`,`data-disabled`]))}}),ii=M({__name:`CalendarCellTrigger`,props:{day:{type:null,required:!0},month:{type:null,required:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`div`}},setup(e){let t=e,n=Wr(),r=ei(),{primitiveElement:a,currentElement:o}=pe(),s=l(()=>t.day.day.toLocaleString(r.locale.value)),c=l(()=>r.formatter.custom(H(t.day),{weekday:`long`,month:`long`,day:`numeric`,year:`numeric`})),d=l(()=>r.isDateUnavailable?.(t.day)??!1),f=l(()=>Je(t.day,it())),p=l(()=>!We(t.day,t.month)),m=l(()=>r.isOutsideVisibleView(t.day)),h=l(()=>r.isDateDisabled(t.day)||r.disableDaysOutsideCurrentView.value&&p.value),g=l(()=>p.value||h.value?!1:!r.disabled.value&&r.isPlaceholderFocusable.value&&Ue(t.day,r.placeholder.value)?!0:(!r.hasSelectedDate.value||r.isSelectedDateDisabled.value)&&!r.isPlaceholderFocusable.value?r.firstFocusableDate.value&&Ue(t.day,r.firstFocusableDate.value):!1),_=l(()=>r.isDateSelected(t.day));function v(e){r.readonly.value||r.isDateDisabled(e)||r.isDateUnavailable?.(e)||r.onDateChange(e)}function b(){h.value||v(t.day)}function x(e){if(h.value)return;e.preventDefault(),e.stopPropagation();let i=r.parentElement.value,a=r.dir.value===`rtl`?-1:1;switch(e.code){case n.ARROW_RIGHT:o(t.day,a);break;case n.ARROW_LEFT:o(t.day,-a);break;case n.ARROW_UP:o(t.day,-7);break;case n.ARROW_DOWN:o(t.day,7);break;case n.ENTER:case n.SPACE_CODE:v(t.day)}function o(e,t){let n=e.add({days:t});if(r.minValue.value&&n.compare(r.minValue.value)<0||r.maxValue.value&&n.compare(r.maxValue.value)>0)return;let a=i.querySelector(`[data-value='${n.toString()}']:not([data-outside-view])`);if(!a){if(t>0){if(r.isNextButtonDisabled())return;r.nextPage()}else{if(r.isPrevButtonDisabled())return;r.prevPage()}re(()=>{o(e,t)});return}if(a&&a.hasAttribute(`data-disabled`))return o(n,t);r.onPlaceholderChange(n),a?.focus()}}return(e,n)=>(I(),E(P(O),{ref_key:`primitiveElement`,ref:a,as:t.as,"as-child":t.asChild,role:`button`,"aria-label":c.value,"data-reka-calendar-cell-trigger":``,"aria-disabled":h.value||d.value?!0:void 0,"data-selected":_.value?!0:void 0,"data-value":e.day.toString(),"data-disabled":h.value?``:void 0,"data-unavailable":d.value?``:void 0,"data-today":f.value?``:void 0,"data-outside-view":p.value?``:void 0,"data-outside-visible-view":m.value?``:void 0,"data-focused":g.value?``:void 0,tabindex:g.value?0:p.value||h.value?void 0:-1,onClick:b,onKeydown:[i(x,[`up`,`down`,`left`,`right`,`space`,`enter`]),n[0]||=i(y(()=>{},[`prevent`]),[`enter`])]},{default:A(()=>[L(e.$slots,`default`,{dayValue:s.value,disabled:h.value,today:f.value,selected:_.value,outsideView:p.value,outsideVisibleView:m.value,unavailable:d.value},()=>[k(u(s.value),1)])]),_:3},8,[`as`,`as-child`,`aria-label`,`aria-disabled`,`data-selected`,`data-value`,`data-disabled`,`data-unavailable`,`data-today`,`data-outside-view`,`data-outside-visible-view`,`data-focused`,`tabindex`]))}}),ai=M({__name:`CalendarGrid`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`table`}},setup(e){let t=e,n=ei(),r=l(()=>n.disabled.value?!0:void 0),i=l(()=>n.readonly.value?!0:void 0);return(e,n)=>(I(),E(P(O),N(t,{tabindex:`-1`,role:`application`,"aria-readonly":i.value,"aria-disabled":r.value,"data-readonly":i.value&&``,"data-disabled":r.value&&``}),{default:A(()=>[L(e.$slots,`default`)]),_:3},16,[`aria-readonly`,`aria-disabled`,`data-readonly`,`data-disabled`]))}}),oi=M({__name:`CalendarGridBody`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`tbody`}},setup(e){let t=e;return(e,n)=>(I(),E(P(O),v(T(t)),{default:A(()=>[L(e.$slots,`default`)]),_:3},16))}}),si=M({__name:`CalendarGridHead`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`thead`}},setup(e){let t=e;return(e,n)=>(I(),E(P(O),N(t,{"aria-hidden":`true`}),{default:A(()=>[L(e.$slots,`default`)]),_:3},16))}}),ci=M({__name:`CalendarGridRow`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`tr`}},setup(e){let t=e;return(e,n)=>(I(),E(P(O),v(T(t)),{default:A(()=>[L(e.$slots,`default`)]),_:3},16))}}),li=M({__name:`CalendarHeadCell`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`th`}},setup(e){let t=e;return(e,n)=>(I(),E(P(O),v(T(t)),{default:A(()=>[L(e.$slots,`default`)]),_:3},16))}}),ui=M({__name:`CalendarHeader`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`div`}},setup(e){let t=e;return(e,n)=>(I(),E(P(O),v(T(t)),{default:A(()=>[L(e.$slots,`default`)]),_:3},16))}}),di=M({__name:`CalendarHeading`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`div`}},setup(e){let t=e,n=ei();return(e,r)=>(I(),E(P(O),N(t,{"data-disabled":P(n).disabled.value?``:void 0}),{default:A(()=>[L(e.$slots,`default`,{headingValue:P(n).headingValue.value},()=>[k(u(P(n).headingValue.value),1)])]),_:3},16,[`data-disabled`]))}}),fi=M({__name:`CalendarNext`,props:{nextPage:{type:Function,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,n=l(()=>r.disabled.value||r.isNextButtonDisabled(t.nextPage)),r=ei();function i(){n.value||r.nextPage(t.nextPage)}return(e,r)=>(I(),E(P(O),{as:t.as,"as-child":t.asChild,"aria-label":`Next page`,type:t.as===`button`?`button`:void 0,"aria-disabled":n.value||void 0,"data-disabled":n.value||void 0,disabled:n.value,onClick:i},{default:A(()=>[L(e.$slots,`default`,{disabled:n.value},()=>[r[0]||=k(` Next page `)])]),_:3},8,[`as`,`as-child`,`type`,`aria-disabled`,`data-disabled`,`disabled`]))}}),pi=M({__name:`CalendarPrev`,props:{prevPage:{type:Function,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,n=l(()=>r.disabled.value||r.isPrevButtonDisabled(t.prevPage)),r=ei();function i(){n.value||r.prevPage(t.prevPage)}return(e,r)=>(I(),E(P(O),{"aria-label":`Previous page`,as:t.as,"as-child":t.asChild,type:t.as===`button`?`button`:void 0,"aria-disabled":n.value||void 0,"data-disabled":n.value||void 0,disabled:n.value,onClick:i},{default:A(()=>[L(e.$slots,`default`,{disabled:n.value},()=>[r[0]||=k(` Prev page `)])]),_:3},8,[`as`,`as-child`,`type`,`aria-disabled`,`data-disabled`,`disabled`]))}});function mi(e){return e+.5|0}var hi=(e,t,n)=>Math.max(Math.min(e,n),t);function gi(e){return hi(mi(e*2.55),0,255)}function _i(e){return hi(mi(e*255),0,255)}function vi(e){return hi(mi(e/2.55)/100,0,1)}function yi(e){return hi(mi(e*100),0,100)}var bi={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},xi=[...`0123456789ABCDEF`],Si=e=>xi[e&15],Ci=e=>xi[(e&240)>>4]+xi[e&15],wi=e=>(e&240)>>4==(e&15),Ti=e=>wi(e.r)&&wi(e.g)&&wi(e.b)&&wi(e.a);function Ei(e){var t=e.length,n;return e[0]===`#`&&(t===4||t===5?n={r:255&bi[e[1]]*17,g:255&bi[e[2]]*17,b:255&bi[e[3]]*17,a:t===5?bi[e[4]]*17:255}:(t===7||t===9)&&(n={r:bi[e[1]]<<4|bi[e[2]],g:bi[e[3]]<<4|bi[e[4]],b:bi[e[5]]<<4|bi[e[6]],a:t===9?bi[e[7]]<<4|bi[e[8]]:255})),n}var Di=(e,t)=>e<255?t(e):``;function Oi(e){var t=Ti(e)?Si:Ci;return e?`#`+t(e.r)+t(e.g)+t(e.b)+Di(e.a,t):void 0}var ki=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Ai(e,t,n){let r=t*Math.min(n,1-n),i=(t,i=(t+e/30)%12)=>n-r*Math.max(Math.min(i-3,9-i,1),-1);return[i(0),i(8),i(4)]}function ji(e,t,n){let r=(r,i=(r+e/60)%6)=>n-n*t*Math.max(Math.min(i,4-i,1),0);return[r(5),r(3),r(1)]}function Mi(e,t,n){let r=Ai(e,1,.5),i;for(t+n>1&&(i=1/(t+n),t*=i,n*=i),i=0;i<3;i++)r[i]*=1-t-n,r[i]+=t;return r}function Ni(e,t,n,r,i){return e===i?(t-n)/r+(t<n?6:0):t===i?(n-e)/r+2:(e-t)/r+4}function Pi(e){let t=e.r/255,n=e.g/255,r=e.b/255,i=Math.max(t,n,r),a=Math.min(t,n,r),o=(i+a)/2,s,c,l;return i!==a&&(l=i-a,c=o>.5?l/(2-i-a):l/(i+a),s=Ni(t,n,r,l,i),s=s*60+.5),[s|0,c||0,o]}function Fi(e,t,n,r){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,r)).map(_i)}function Ii(e,t,n){return Fi(Ai,e,t,n)}function Li(e,t,n){return Fi(Mi,e,t,n)}function Ri(e,t,n){return Fi(ji,e,t,n)}function zi(e){return(e%360+360)%360}function Bi(e){let t=ki.exec(e),n=255,r;if(!t)return;t[5]!==r&&(n=t[6]?gi(+t[5]):_i(+t[5]));let i=zi(+t[2]),a=t[3]/100,o=t[4]/100;return r=t[1]===`hwb`?Li(i,a,o):t[1]===`hsv`?Ri(i,a,o):Ii(i,a,o),{r:r[0],g:r[1],b:r[2],a:n}}function Vi(e,t){var n=Pi(e);n[0]=zi(n[0]+t),n=Ii(n),e.r=n[0],e.g=n[1],e.b=n[2]}function Hi(e){if(!e)return;let t=Pi(e),n=t[0],r=yi(t[1]),i=yi(t[2]);return e.a<255?`hsla(${n}, ${r}%, ${i}%, ${vi(e.a)})`:`hsl(${n}, ${r}%, ${i}%)`}var Ui={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`},Wi={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 Gi(){let e={},t=Object.keys(Wi),n=Object.keys(Ui),r,i,a,o,s;for(r=0;r<t.length;r++){for(o=s=t[r],i=0;i<n.length;i++)a=n[i],s=s.replace(a,Ui[a]);a=parseInt(Wi[o],16),e[s]=[a>>16&255,a>>8&255,a&255]}return e}var Ki;function qi(e){Ki||(Ki=Gi(),Ki.transparent=[0,0,0,0]);let t=Ki[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}var Ji=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Yi(e){let t=Ji.exec(e),n=255,r,i,a;if(t){if(t[7]!==r){let e=+t[7];n=t[8]?gi(e):hi(e*255,0,255)}return r=+t[1],i=+t[3],a=+t[5],r=255&(t[2]?gi(r):hi(r,0,255)),i=255&(t[4]?gi(i):hi(i,0,255)),a=255&(t[6]?gi(a):hi(a,0,255)),{r,g:i,b:a,a:n}}}function Xi(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${vi(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}var Zi=e=>e<=.0031308?e*12.92:e**(1/2.4)*1.055-.055,Qi=e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4;function $i(e,t,n){let r=Qi(vi(e.r)),i=Qi(vi(e.g)),a=Qi(vi(e.b));return{r:_i(Zi(r+n*(Qi(vi(t.r))-r))),g:_i(Zi(i+n*(Qi(vi(t.g))-i))),b:_i(Zi(a+n*(Qi(vi(t.b))-a))),a:e.a+n*(t.a-e.a)}}function ea(e,t,n){if(e){let r=Pi(e);r[t]=Math.max(0,Math.min(r[t]+r[t]*n,t===0?360:1)),r=Ii(r),e.r=r[0],e.g=r[1],e.b=r[2]}}function ta(e,t){return e&&Object.assign(t||{},e)}function na(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=_i(e[3]))):(t=ta(e,{r:0,g:0,b:0,a:1}),t.a=_i(t.a)),t}function ra(e){return e.charAt(0)===`r`?Yi(e):Bi(e)}var ia=class e{constructor(t){if(t instanceof e)return t;let n=typeof t,r;n===`object`?r=na(t):n===`string`&&(r=Ei(t)||qi(t)||ra(t)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var e=ta(this._rgb);return e&&(e.a=vi(e.a)),e}set rgb(e){this._rgb=na(e)}rgbString(){return this._valid?Xi(this._rgb):void 0}hexString(){return this._valid?Oi(this._rgb):void 0}hslString(){return this._valid?Hi(this._rgb):void 0}mix(e,t){if(e){let n=this.rgb,r=e.rgb,i,a=t===i?.5:t,o=2*a-1,s=n.a-r.a,c=((o*s===-1?o:(o+s)/(1+o*s))+1)/2;i=1-c,n.r=255&c*n.r+i*r.r+.5,n.g=255&c*n.g+i*r.g+.5,n.b=255&c*n.b+i*r.b+.5,n.a=a*n.a+(1-a)*r.a,this.rgb=n}return this}interpolate(e,t){return e&&(this._rgb=$i(this._rgb,e._rgb,t)),this}clone(){return new e(this.rgb)}alpha(e){return this._rgb.a=_i(e),this}clearer(e){let t=this._rgb;return t.a*=1-e,this}greyscale(){let e=this._rgb;return e.r=e.g=e.b=mi(e.r*.3+e.g*.59+e.b*.11),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 ea(this._rgb,2,e),this}darken(e){return ea(this._rgb,2,-e),this}saturate(e){return ea(this._rgb,1,e),this}desaturate(e){return ea(this._rgb,1,-e),this}rotate(e){return Vi(this._rgb,e),this}};function aa(){}var oa=(()=>{let e=0;return()=>e++})();function U(e){return e==null}function W(e){if(Array.isArray&&Array.isArray(e))return!0;let t=Object.prototype.toString.call(e);return t.slice(0,7)===`[object`&&t.slice(-6)===`Array]`}function G(e){return e!==null&&Object.prototype.toString.call(e)===`[object Object]`}function K(e){return(typeof e==`number`||e instanceof Number)&&isFinite(+e)}function sa(e,t){return K(e)?e:t}function q(e,t){return e===void 0?t:e}var ca=(e,t)=>typeof e==`string`&&e.endsWith(`%`)?parseFloat(e)/100*t:+e;function J(e,t,n){if(e&&typeof e.call==`function`)return e.apply(n,t)}function Y(e,t,n,r){let i,a,o;if(W(e))if(a=e.length,r)for(i=a-1;i>=0;i--)t.call(n,e[i],i);else for(i=0;i<a;i++)t.call(n,e[i],i);else if(G(e))for(o=Object.keys(e),a=o.length,i=0;i<a;i++)t.call(n,e[o[i]],o[i])}function la(e,t){let n,r,i,a;if(!e||!t||e.length!==t.length)return!1;for(n=0,r=e.length;n<r;++n)if(i=e[n],a=t[n],i.datasetIndex!==a.datasetIndex||i.index!==a.index)return!1;return!0}function ua(e){if(W(e))return e.map(ua);if(G(e)){let t=Object.create(null),n=Object.keys(e),r=n.length,i=0;for(;i<r;++i)t[n[i]]=ua(e[n[i]]);return t}return e}function da(e){return[`__proto__`,`prototype`,`constructor`].indexOf(e)===-1}function fa(e,t,n,r){if(!da(e))return;let i=t[e],a=n[e];G(i)&&G(a)?pa(i,a,r):t[e]=ua(a)}function pa(e,t,n){let r=W(t)?t:[t],i=r.length;if(!G(e))return e;n||={};let a=n.merger||fa,o;for(let t=0;t<i;++t){if(o=r[t],!G(o))continue;let i=Object.keys(o);for(let t=0,r=i.length;t<r;++t)a(i[t],e,o,n)}return e}function ma(e,t){return pa(e,t,{merger:ha})}function ha(e,t,n){if(!da(e))return;let r=t[e],i=n[e];G(r)&&G(i)?ma(r,i):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=ua(i))}var ga={"":e=>e,x:e=>e.x,y:e=>e.y};function _a(e){let t=e.split(`.`),n=[],r=``;for(let e of t)r+=e,r.endsWith(`\\`)?r=r.slice(0,-1)+`.`:(n.push(r),r=``);return n}function va(e){let t=_a(e);return e=>{for(let n of t){if(n===``)break;e&&=e[n]}return e}}function ya(e,t){return(ga[t]||(ga[t]=va(t)))(e)}function ba(e){return e.charAt(0).toUpperCase()+e.slice(1)}var xa=e=>e!==void 0,Sa=e=>typeof e==`function`,Ca=(e,t)=>{if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0};function wa(e){return e.type===`mouseup`||e.type===`click`||e.type===`contextmenu`}var X=Math.PI,Ta=2*X,Ea=Ta+X,Da=1/0,Oa=X/180,ka=X/2,Aa=X/4,ja=X*2/3,Ma=Math.log10,Na=Math.sign;function Pa(e,t,n){return Math.abs(e-t)<n}function Fa(e){let t=Math.round(e);e=Pa(e,t,e/1e3)?t:e;let n=10**Math.floor(Ma(e)),r=e/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function Ia(e){let t=[],n=Math.sqrt(e),r;for(r=1;r<n;r++)e%r===0&&(t.push(r),t.push(e/r));return n===(n|0)&&t.push(n),t.sort((e,t)=>e-t).pop(),t}function La(e){return typeof e==`symbol`||typeof e==`object`&&!!e&&!(Symbol.toPrimitive in e||`toString`in e||`valueOf`in e)}function Ra(e){return!La(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function za(e,t){let n=Math.round(e);return n-t<=e&&n+t>=e}function Ba(e,t,n){let r,i,a;for(r=0,i=e.length;r<i;r++)a=e[r][n],isNaN(a)||(t.min=Math.min(t.min,a),t.max=Math.max(t.max,a))}function Va(e){return X/180*e}function Ha(e){return 180/X*e}function Ua(e){if(!K(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function Wa(e,t){let n=t.x-e.x,r=t.y-e.y,i=Math.sqrt(n*n+r*r),a=Math.atan2(r,n);return a<-.5*X&&(a+=Ta),{angle:a,distance:i}}function Ga(e,t){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)}function Ka(e,t){return(e-t+Ea)%Ta-X}function qa(e){return(e%Ta+Ta)%Ta}function Ja(e,t,n,r){let i=qa(e),a=qa(t),o=qa(n),s=qa(a-i),c=qa(o-i),l=qa(i-a),u=qa(i-o);return i===a||i===o||r&&a===o||s>c&&l<u}function Ya(e,t,n){return Math.max(t,Math.min(n,e))}function Xa(e){return Ya(e,-32768,32767)}function Za(e,t,n,r=1e-6){return e>=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function Qa(e,t,n){n||=(n=>e[n]<t);let r=e.length-1,i=0,a;for(;r-i>1;)a=i+r>>1,n(a)?i=a:r=a;return{lo:i,hi:r}}var $a=(e,t,n,r)=>Qa(e,n,r?r=>{let i=e[r][t];return i<n||i===n&&e[r+1][t]===n}:r=>e[r][t]<n),eo=(e,t,n)=>Qa(e,n,r=>e[r][t]>=n);function to(e,t,n){let r=0,i=e.length;for(;r<i&&e[r]<t;)r++;for(;i>r&&e[i-1]>n;)i--;return r>0||i<e.length?e.slice(r,i):e}var no=[`push`,`pop`,`shift`,`splice`,`unshift`];function ro(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,`_chartjs`,{configurable:!0,enumerable:!1,value:{listeners:[t]}}),no.forEach(t=>{let n=`_onData`+ba(t),r=e[t];Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value(...t){let i=r.apply(this,t);return e._chartjs.listeners.forEach(e=>{typeof e[n]==`function`&&e[n](...t)}),i}})})}function io(e,t){let n=e._chartjs;if(!n)return;let r=n.listeners,i=r.indexOf(t);i!==-1&&r.splice(i,1),!(r.length>0)&&(no.forEach(t=>{delete e[t]}),delete e._chartjs)}function ao(e){let t=new Set(e);return t.size===e.length?e:Array.from(t)}var oo=function(){return typeof window>`u`?function(e){return e()}:window.requestAnimationFrame}();function so(e,t){let n=[],r=!1;return function(...i){n=i,r||(r=!0,oo.call(window,()=>{r=!1,e.apply(t,n)}))}}function co(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}var lo=e=>e===`start`?`left`:e===`end`?`right`:`center`,uo=(e,t,n)=>e===`start`?t:e===`end`?n:(t+n)/2,fo=(e,t,n,r)=>e===(r?`left`:`right`)?n:e===`center`?(t+n)/2:t;function po(e,t,n){let r=t.length,i=0,a=r;if(e._sorted){let{iScale:o,vScale:s,_parsed:c}=e,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,u=o.axis,{min:d,max:f,minDefined:p,maxDefined:m}=o.getUserBounds();if(p){if(i=Math.min($a(c,u,d).lo,n?r:$a(t,u,o.getPixelForValue(d)).lo),l){let e=c.slice(0,i+1).reverse().findIndex(e=>!U(e[s.axis]));i-=Math.max(0,e)}i=Ya(i,0,r-1)}if(m){let e=Math.max($a(c,o.axis,f,!0).hi+1,n?0:$a(t,u,o.getPixelForValue(f),!0).hi+1);if(l){let t=c.slice(e-1).findIndex(e=>!U(e[s.axis]));e+=Math.max(0,t)}a=Ya(e,i,r)-i}else a=r-i}return{start:i,count:a}}function mo(e){let{xScale:t,yScale:n,_scaleRanges:r}=e,i={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!r)return e._scaleRanges=i,!0;let a=r.xmin!==t.min||r.xmax!==t.max||r.ymin!==n.min||r.ymax!==n.max;return Object.assign(r,i),a}var ho=e=>e===0||e===1,go=(e,t,n)=>-(2**(10*--e)*Math.sin((e-t)*Ta/n)),_o=(e,t,n)=>2**(-10*e)*Math.sin((e-t)*Ta/n)+1,vo={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>--e*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-(--e*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>--e*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*ka)+1,easeOutSine:e=>Math.sin(e*ka),easeInOutSine:e=>-.5*(Math.cos(X*e)-1),easeInExpo:e=>e===0?0:2**(10*(e-1)),easeOutExpo:e=>e===1?1:-(2**(-10*e))+1,easeInOutExpo:e=>ho(e)?e:e<.5?.5*2**(10*(e*2-1)):.5*(-(2**(-10*(e*2-1)))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1- --e*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>ho(e)?e:go(e,.075,.3),easeOutElastic:e=>ho(e)?e:_o(e,.075,.3),easeInOutElastic(e){let t=.1125,n=.45;return ho(e)?e:e<.5?.5*go(e*2,t,n):.5+.5*_o(e*2-1,t,n)},easeInBack(e){let t=1.70158;return e*e*((t+1)*e-t)},easeOutBack(e){let t=1.70158;return--e*e*((t+1)*e+t)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-vo.easeOutBounce(1-e),easeOutBounce(e){let t=7.5625,n=2.75;return e<1/n?t*e*e:e<2/n?t*(e-=1.5/n)*e+.75:e<2.5/n?t*(e-=2.25/n)*e+.9375:t*(e-=2.625/n)*e+.984375},easeInOutBounce:e=>e<.5?vo.easeInBounce(e*2)*.5:vo.easeOutBounce(e*2-1)*.5+.5};function yo(e){if(e&&typeof e==`object`){let t=e.toString();return t===`[object CanvasPattern]`||t===`[object CanvasGradient]`}return!1}function bo(e){return yo(e)?e:new ia(e)}function xo(e){return yo(e)?e:new ia(e).saturate(.5).darken(.1).hexString()}var So=[`x`,`y`,`borderWidth`,`radius`,`tension`],Co=[`color`,`borderColor`,`backgroundColor`];function wo(e){e.set(`animation`,{delay:void 0,duration:1e3,easing:`easeOutQuart`,fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe(`animation`,{_fallback:!1,_indexable:!1,_scriptable:e=>e!==`onProgress`&&e!==`onComplete`&&e!==`fn`}),e.set(`animations`,{colors:{type:`color`,properties:Co},numbers:{type:`number`,properties:So}}),e.describe(`animations`,{_fallback:`animation`}),e.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 To(e){e.set(`layout`,{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}var Eo=new Map;function Do(e,t){t||={};let n=e+JSON.stringify(t),r=Eo.get(n);return r||(r=new Intl.NumberFormat(e,t),Eo.set(n,r)),r}function Oo(e,t,n){return Do(t,n).format(e)}var ko={values(e){return W(e)?e:``+e},numeric(e,t,n){if(e===0)return`0`;let r=this.chart.options.locale,i,a=e;if(n.length>1){let t=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(t<1e-4||t>0x38d7ea4c68000)&&(i=`scientific`),a=Ao(e,n)}let o=Ma(Math.abs(a)),s=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),c={notation:i,minimumFractionDigits:s,maximumFractionDigits:s};return Object.assign(c,this.options.ticks.format),Oo(e,r,c)},logarithmic(e,t,n){if(e===0)return`0`;let r=n[t].significand||e/10**Math.floor(Ma(e));return[1,2,3,5,10,15].includes(r)||t>.8*n.length?ko.numeric.call(this,e,t,n):``}};function Ao(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}var jo={formatters:ko};function Mo(e){e.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:jo.formatters.values,minor:{},major:{},align:`center`,crossAlign:`near`,showLabelBackdrop:!1,backdropColor:`rgba(255, 255, 255, 0.75)`,backdropPadding:2}}),e.route(`scale.ticks`,`color`,``,`color`),e.route(`scale.grid`,`color`,``,`borderColor`),e.route(`scale.border`,`color`,``,`borderColor`),e.route(`scale.title`,`color`,``,`color`),e.describe(`scale`,{_fallback:!1,_scriptable:e=>!e.startsWith(`before`)&&!e.startsWith(`after`)&&e!==`callback`&&e!==`parser`,_indexable:e=>e!==`borderDash`&&e!==`tickBorderDash`&&e!==`dash`}),e.describe(`scales`,{_fallback:`scale`}),e.describe(`scale.ticks`,{_scriptable:e=>e!==`backdropPadding`&&e!==`callback`,_indexable:e=>e!==`backdropPadding`})}var No=Object.create(null),Po=Object.create(null);function Fo(e,t){if(!t)return e;let n=t.split(`.`);for(let t=0,r=n.length;t<r;++t){let r=n[t];e=e[r]||(e[r]=Object.create(null))}return e}function Io(e,t,n){return typeof t==`string`?pa(Fo(e,t),n):pa(Fo(e,``),t)}var Z=new 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=e=>e.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=(e,t)=>xo(t.backgroundColor),this.hoverBorderColor=(e,t)=>xo(t.borderColor),this.hoverColor=(e,t)=>xo(t.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 Io(this,e,t)}get(e){return Fo(this,e)}describe(e,t){return Io(Po,e,t)}override(e,t){return Io(No,e,t)}route(e,t,n,r){let i=Fo(this,e),a=Fo(this,n),o=`_`+t;Object.defineProperties(i,{[o]:{value:i[t],writable:!0},[t]:{enumerable:!0,get(){let e=this[o],t=a[r];return G(e)?Object.assign({},t,e):q(e,t)},set(e){this[o]=e}}})}apply(e){e.forEach(e=>e(this))}}({_scriptable:e=>!e.startsWith(`on`),_indexable:e=>e!==`events`,hover:{_fallback:`interaction`},interaction:{_scriptable:!1,_indexable:!1}},[wo,To,Mo]);function Lo(e){return!e||U(e.size)||U(e.family)?null:(e.style?e.style+` `:``)+(e.weight?e.weight+` `:``)+e.size+`px `+e.family}function Ro(e,t,n,r,i){let a=t[i];return a||(a=t[i]=e.measureText(i).width,n.push(i)),a>r&&(r=a),r}function zo(e,t,n,r){r||={};let i=r.data=r.data||{},a=r.garbageCollect=r.garbageCollect||[];r.font!==t&&(i=r.data={},a=r.garbageCollect=[],r.font=t),e.save(),e.font=t;let o=0,s=n.length,c,l,u,d,f;for(c=0;c<s;c++)if(d=n[c],d!=null&&!W(d))o=Ro(e,i,a,o,d);else if(W(d))for(l=0,u=d.length;l<u;l++)f=d[l],f!=null&&!W(f)&&(o=Ro(e,i,a,o,f));e.restore();let p=a.length/2;if(p>n.length){for(c=0;c<p;c++)delete i[a[c]];a.splice(0,p)}return o}function Bo(e,t,n){let r=e.currentDevicePixelRatio,i=n===0?0:Math.max(n/2,.5);return Math.round((t-i)*r)/r+i}function Vo(e,t){!t&&!e||(t||=e.getContext(`2d`),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function Ho(e,t,n,r){Uo(e,t,n,r,null)}function Uo(e,t,n,r,i){let a,o,s,c,l,u,d,f,p=t.pointStyle,m=t.rotation,h=t.radius,g=(m||0)*Oa;if(p&&typeof p==`object`&&(a=p.toString(),a===`[object HTMLImageElement]`||a===`[object HTMLCanvasElement]`)){e.save(),e.translate(n,r),e.rotate(g),e.drawImage(p,-p.width/2,-p.height/2,p.width,p.height),e.restore();return}if(!(isNaN(h)||h<=0)){switch(e.beginPath(),p){default:i?e.ellipse(n,r,i/2,h,0,0,Ta):e.arc(n,r,h,0,Ta),e.closePath();break;case`triangle`:u=i?i/2:h,e.moveTo(n+Math.sin(g)*u,r-Math.cos(g)*h),g+=ja,e.lineTo(n+Math.sin(g)*u,r-Math.cos(g)*h),g+=ja,e.lineTo(n+Math.sin(g)*u,r-Math.cos(g)*h),e.closePath();break;case`rectRounded`:l=h*.516,c=h-l,o=Math.cos(g+Aa)*c,d=Math.cos(g+Aa)*(i?i/2-l:c),s=Math.sin(g+Aa)*c,f=Math.sin(g+Aa)*(i?i/2-l:c),e.arc(n-d,r-s,l,g-X,g-ka),e.arc(n+f,r-o,l,g-ka,g),e.arc(n+d,r+s,l,g,g+ka),e.arc(n-f,r+o,l,g+ka,g+X),e.closePath();break;case`rect`:if(!m){c=Math.SQRT1_2*h,u=i?i/2:c,e.rect(n-u,r-c,2*u,2*c);break}g+=Aa;case`rectRot`:d=Math.cos(g)*(i?i/2:h),o=Math.cos(g)*h,s=Math.sin(g)*h,f=Math.sin(g)*(i?i/2:h),e.moveTo(n-d,r-s),e.lineTo(n+f,r-o),e.lineTo(n+d,r+s),e.lineTo(n-f,r+o),e.closePath();break;case`crossRot`:g+=Aa;case`cross`:d=Math.cos(g)*(i?i/2:h),o=Math.cos(g)*h,s=Math.sin(g)*h,f=Math.sin(g)*(i?i/2:h),e.moveTo(n-d,r-s),e.lineTo(n+d,r+s),e.moveTo(n+f,r-o),e.lineTo(n-f,r+o);break;case`star`:d=Math.cos(g)*(i?i/2:h),o=Math.cos(g)*h,s=Math.sin(g)*h,f=Math.sin(g)*(i?i/2:h),e.moveTo(n-d,r-s),e.lineTo(n+d,r+s),e.moveTo(n+f,r-o),e.lineTo(n-f,r+o),g+=Aa,d=Math.cos(g)*(i?i/2:h),o=Math.cos(g)*h,s=Math.sin(g)*h,f=Math.sin(g)*(i?i/2:h),e.moveTo(n-d,r-s),e.lineTo(n+d,r+s),e.moveTo(n+f,r-o),e.lineTo(n-f,r+o);break;case`line`:o=i?i/2:Math.cos(g)*h,s=Math.sin(g)*h,e.moveTo(n-o,r-s),e.lineTo(n+o,r+s);break;case`dash`:e.moveTo(n,r),e.lineTo(n+Math.cos(g)*(i?i/2:h),r+Math.sin(g)*h);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function Wo(e,t,n){return n||=.5,!t||e&&e.x>t.left-n&&e.x<t.right+n&&e.y>t.top-n&&e.y<t.bottom+n}function Go(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function Ko(e){e.restore()}function qo(e,t,n,r,i){if(!t)return e.lineTo(n.x,n.y);if(i===`middle`){let r=(t.x+n.x)/2;e.lineTo(r,t.y),e.lineTo(r,n.y)}else i===`after`==!!r?e.lineTo(n.x,t.y):e.lineTo(t.x,n.y);e.lineTo(n.x,n.y)}function Jo(e,t,n,r){if(!t)return e.lineTo(n.x,n.y);e.bezierCurveTo(r?t.cp1x:t.cp2x,r?t.cp1y:t.cp2y,r?n.cp2x:n.cp1x,r?n.cp2y:n.cp1y,n.x,n.y)}function Yo(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),U(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}function Xo(e,t,n,r,i){if(i.strikethrough||i.underline){let a=e.measureText(r),o=t-a.actualBoundingBoxLeft,s=t+a.actualBoundingBoxRight,c=n-a.actualBoundingBoxAscent,l=n+a.actualBoundingBoxDescent,u=i.strikethrough?(c+l)/2:l;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=i.decorationWidth||2,e.moveTo(o,u),e.lineTo(s,u),e.stroke()}}function Zo(e,t){let n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function Qo(e,t,n,r,i,a={}){let o=W(t)?t:[t],s=a.strokeWidth>0&&a.strokeColor!==``,c,l;for(e.save(),e.font=i.string,Yo(e,a),c=0;c<o.length;++c)l=o[c],a.backdrop&&Zo(e,a.backdrop),s&&(a.strokeColor&&(e.strokeStyle=a.strokeColor),U(a.strokeWidth)||(e.lineWidth=a.strokeWidth),e.strokeText(l,n,r,a.maxWidth)),e.fillText(l,n,r,a.maxWidth),Xo(e,n,r,l,a),r+=Number(i.lineHeight);e.restore()}function $o(e,t){let{x:n,y:r,w:i,h:a,radius:o}=t;e.arc(n+o.topLeft,r+o.topLeft,o.topLeft,1.5*X,X,!0),e.lineTo(n,r+a-o.bottomLeft),e.arc(n+o.bottomLeft,r+a-o.bottomLeft,o.bottomLeft,X,ka,!0),e.lineTo(n+i-o.bottomRight,r+a),e.arc(n+i-o.bottomRight,r+a-o.bottomRight,o.bottomRight,ka,0,!0),e.lineTo(n+i,r+o.topRight),e.arc(n+i-o.topRight,r+o.topRight,o.topRight,0,-ka,!0),e.lineTo(n+o.topLeft,r)}var es=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,ts=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function ns(e,t){let n=(``+e).match(es);if(!n||n[1]===`normal`)return t*1.2;switch(e=+n[2],n[3]){case`px`:return e;case`%`:e/=100;break}return t*e}var rs=e=>+e||0;function is(e,t){let n={},r=G(t),i=r?Object.keys(t):t,a=G(e)?r?n=>q(e[n],e[t[n]]):t=>e[t]:()=>e;for(let e of i)n[e]=rs(a(e));return n}function as(e){return is(e,{top:`y`,right:`x`,bottom:`y`,left:`x`})}function os(e){return is(e,[`topLeft`,`topRight`,`bottomLeft`,`bottomRight`])}function Q(e){let t=as(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function $(e,t){e||={},t||=Z.font;let n=q(e.size,t.size);typeof n==`string`&&(n=parseInt(n,10));let r=q(e.style,t.style);r&&!(``+r).match(ts)&&(console.warn(`Invalid font style specified: "`+r+`"`),r=void 0);let i={family:q(e.family,t.family),lineHeight:ns(q(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:q(e.weight,t.weight),string:``};return i.string=Lo(i),i}function ss(e,t,n,r){let i=!0,a,o,s;for(a=0,o=e.length;a<o;++a)if(s=e[a],s!==void 0&&(t!==void 0&&typeof s==`function`&&(s=s(t),i=!1),n!==void 0&&W(s)&&(s=s[n%s.length],i=!1),s!==void 0))return r&&!i&&(r.cacheable=!1),s}function cs(e,t,n){let{min:r,max:i}=e,a=ca(t,(i-r)/2),o=(e,t)=>n&&e===0?0:e+t;return{min:o(r,-Math.abs(a)),max:o(i,a)}}function ls(e,t){return Object.assign(Object.create(e),t)}function us(e,t=[``],n,r,i=()=>e[0]){let a=n||e;return r===void 0&&(r=Es(`_fallback`,e)),new Proxy({[Symbol.toStringTag]:`Object`,_cacheable:!0,_scopes:e,_rootScopes:a,_fallback:r,_getTarget:i,override:n=>us([n,...e],t,a,r)},{deleteProperty(t,n){return delete t[n],delete t._keys,delete e[0][n],!0},get(n,r){return hs(n,r,()=>Ts(r,t,e,n))},getOwnPropertyDescriptor(e,t){return Reflect.getOwnPropertyDescriptor(e._scopes[0],t)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(e,t){return Ds(e).includes(t)},ownKeys(e){return Ds(e)},set(e,t,n){let r=e._storage||=i();return e[t]=r[t]=n,delete e._keys,!0}})}function ds(e,t,n,r){let i={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:fs(e,r),setContext:t=>ds(e,t,n,r),override:i=>ds(e.override(i),t,n,r)};return new Proxy(i,{deleteProperty(t,n){return delete t[n],delete e[n],!0},get(e,t,n){return hs(e,t,()=>gs(e,t,n))},getOwnPropertyDescriptor(t,n){return t._descriptors.allKeys?Reflect.has(e,n)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,n)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(t,n){return Reflect.has(e,n)},ownKeys(){return Reflect.ownKeys(e)},set(t,n,r){return e[n]=r,delete t[n],!0}})}function fs(e,t={scriptable:!0,indexable:!0}){let{_scriptable:n=t.scriptable,_indexable:r=t.indexable,_allKeys:i=t.allKeys}=e;return{allKeys:i,scriptable:n,indexable:r,isScriptable:Sa(n)?n:()=>n,isIndexable:Sa(r)?r:()=>r}}var ps=(e,t)=>e?e+ba(t):t,ms=(e,t)=>G(t)&&e!==`adapters`&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function hs(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t===`constructor`)return e[t];let r=n();return e[t]=r,r}function gs(e,t,n){let{_proxy:r,_context:i,_subProxy:a,_descriptors:o}=e,s=r[t];return Sa(s)&&o.isScriptable(t)&&(s=_s(t,s,e,n)),W(s)&&s.length&&(s=vs(t,s,e,o.isIndexable)),ms(t,s)&&(s=ds(s,i,a&&a[t],o)),s}function _s(e,t,n,r){let{_proxy:i,_context:a,_subProxy:o,_stack:s}=n;if(s.has(e))throw Error(`Recursion detected: `+Array.from(s).join(`->`)+`->`+e);s.add(e);let c=t(a,o||r);return s.delete(e),ms(e,c)&&(c=Ss(i._scopes,i,e,c)),c}function vs(e,t,n,r){let{_proxy:i,_context:a,_subProxy:o,_descriptors:s}=n;if(a.index!==void 0&&r(e))return t[a.index%t.length];if(G(t[0])){let n=t,r=i._scopes.filter(e=>e!==n);t=[];for(let c of n){let n=Ss(r,i,e,c);t.push(ds(n,a,o&&o[e],s))}}return t}function ys(e,t,n){return Sa(e)?e(t,n):e}var bs=(e,t)=>e===!0?t:typeof e==`string`?ya(t,e):void 0;function xs(e,t,n,r,i){for(let a of t){let t=bs(n,a);if(t){e.add(t);let a=ys(t._fallback,n,i);if(a!==void 0&&a!==n&&a!==r)return a}else if(t===!1&&r!==void 0&&n!==r)return null}return!1}function Ss(e,t,n,r){let i=t._rootScopes,a=ys(t._fallback,n,r),o=[...e,...i],s=new Set;s.add(r);let c=Cs(s,o,n,a||n,r);return c===null||a!==void 0&&a!==n&&(c=Cs(s,o,a,c,r),c===null)?!1:us(Array.from(s),[``],i,a,()=>ws(t,n,r))}function Cs(e,t,n,r,i){for(;n;)n=xs(e,t,n,r,i);return n}function ws(e,t,n){let r=e._getTarget();t in r||(r[t]={});let i=r[t];return W(i)&&G(n)?n:i||{}}function Ts(e,t,n,r){let i;for(let a of t)if(i=Es(ps(a,e),n),i!==void 0)return ms(e,i)?Ss(n,r,e,i):i}function Es(e,t){for(let n of t){if(!n)continue;let t=n[e];if(t!==void 0)return t}}function Ds(e){let t=e._keys;return t||=e._keys=Os(e._scopes),t}function Os(e){let t=new Set;for(let n of e)for(let e of Object.keys(n).filter(e=>!e.startsWith(`_`)))t.add(e);return Array.from(t)}var ks=2**-52||1e-14,As=(e,t)=>t<e.length&&!e[t].skip&&e[t],js=e=>e===`x`?`y`:`x`;function Ms(e,t,n,r){let i=e.skip?t:e,a=t,o=n.skip?t:n,s=Ga(a,i),c=Ga(o,a),l=s/(s+c),u=c/(s+c);l=isNaN(l)?0:l,u=isNaN(u)?0:u;let d=r*l,f=r*u;return{previous:{x:a.x-d*(o.x-i.x),y:a.y-d*(o.y-i.y)},next:{x:a.x+f*(o.x-i.x),y:a.y+f*(o.y-i.y)}}}function Ns(e,t,n){let r=e.length,i,a,o,s,c,l=As(e,0);for(let u=0;u<r-1;++u)if(c=l,l=As(e,u+1),!(!c||!l)){if(Pa(t[u],0,ks)){n[u]=n[u+1]=0;continue}i=n[u]/t[u],a=n[u+1]/t[u],s=i**2+a**2,!(s<=9)&&(o=3/Math.sqrt(s),n[u]=i*o*t[u],n[u+1]=a*o*t[u])}}function Ps(e,t,n=`x`){let r=js(n),i=e.length,a,o,s,c=As(e,0);for(let l=0;l<i;++l){if(o=s,s=c,c=As(e,l+1),!s)continue;let i=s[n],u=s[r];o&&(a=(i-o[n])/3,s[`cp1${n}`]=i-a,s[`cp1${r}`]=u-a*t[l]),c&&(a=(c[n]-i)/3,s[`cp2${n}`]=i+a,s[`cp2${r}`]=u+a*t[l])}}function Fs(e,t=`x`){let n=js(t),r=e.length,i=Array(r).fill(0),a=Array(r),o,s,c,l=As(e,0);for(o=0;o<r;++o)if(s=c,c=l,l=As(e,o+1),c){if(l){let e=l[t]-c[t];i[o]=e===0?0:(l[n]-c[n])/e}a[o]=s?l?Na(i[o-1])===Na(i[o])?(i[o-1]+i[o])/2:0:i[o-1]:i[o]}Ns(e,i,a),Ps(e,a,t)}function Is(e,t,n){return Math.max(Math.min(e,n),t)}function Ls(e,t){let n,r,i,a,o,s=Wo(e[0],t);for(n=0,r=e.length;n<r;++n)o=a,a=s,s=n<r-1&&Wo(e[n+1],t),a&&(i=e[n],o&&(i.cp1x=Is(i.cp1x,t.left,t.right),i.cp1y=Is(i.cp1y,t.top,t.bottom)),s&&(i.cp2x=Is(i.cp2x,t.left,t.right),i.cp2y=Is(i.cp2y,t.top,t.bottom)))}function Rs(e,t,n,r,i){let a,o,s,c;if(t.spanGaps&&(e=e.filter(e=>!e.skip)),t.cubicInterpolationMode===`monotone`)Fs(e,i);else{let n=r?e[e.length-1]:e[0];for(a=0,o=e.length;a<o;++a)s=e[a],c=Ms(n,s,e[Math.min(a+1,o-+!r)%o],t.tension),s.cp1x=c.previous.x,s.cp1y=c.previous.y,s.cp2x=c.next.x,s.cp2y=c.next.y,n=s}t.capBezierPoints&&Ls(e,n)}function zs(){return typeof window<`u`&&typeof document<`u`}function Bs(e){let t=e.parentNode;return t&&t.toString()===`[object ShadowRoot]`&&(t=t.host),t}function Vs(e,t,n){let r;return typeof e==`string`?(r=parseInt(e,10),e.indexOf(`%`)!==-1&&(r=r/100*t.parentNode[n])):r=e,r}var Hs=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function Us(e,t){return Hs(e).getPropertyValue(t)}var Ws=[`top`,`right`,`bottom`,`left`];function Gs(e,t,n){let r={};n=n?`-`+n:``;for(let i=0;i<4;i++){let a=Ws[i];r[a]=parseFloat(e[t+`-`+a+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}var Ks=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function qs(e,t){let n=e.touches,r=n&&n.length?n[0]:e,{offsetX:i,offsetY:a}=r,o=!1,s,c;if(Ks(i,a,e.target))s=i,c=a;else{let e=t.getBoundingClientRect();s=r.clientX-e.left,c=r.clientY-e.top,o=!0}return{x:s,y:c,box:o}}function Js(e,t){if(`native`in e)return e;let{canvas:n,currentDevicePixelRatio:r}=t,i=Hs(n),a=i.boxSizing===`border-box`,o=Gs(i,`padding`),s=Gs(i,`border`,`width`),{x:c,y:l,box:u}=qs(e,n),d=o.left+(u&&s.left),f=o.top+(u&&s.top),{width:p,height:m}=t;return a&&(p-=o.width+s.width,m-=o.height+s.height),{x:Math.round((c-d)/p*n.width/r),y:Math.round((l-f)/m*n.height/r)}}function Ys(e,t,n){let r,i;if(t===void 0||n===void 0){let a=e&&Bs(e);if(!a)t=e.clientWidth,n=e.clientHeight;else{let e=a.getBoundingClientRect(),o=Hs(a),s=Gs(o,`border`,`width`),c=Gs(o,`padding`);t=e.width-c.width-s.width,n=e.height-c.height-s.height,r=Vs(o.maxWidth,a,`clientWidth`),i=Vs(o.maxHeight,a,`clientHeight`)}}return{width:t,height:n,maxWidth:r||Da,maxHeight:i||Da}}var Xs=e=>Math.round(e*10)/10;function Zs(e,t,n,r){let i=Hs(e),a=Gs(i,`margin`),o=Vs(i.maxWidth,e,`clientWidth`)||Da,s=Vs(i.maxHeight,e,`clientHeight`)||Da,c=Ys(e,t,n),{width:l,height:u}=c;if(i.boxSizing===`content-box`){let e=Gs(i,`border`,`width`),t=Gs(i,`padding`);l-=t.width+e.width,u-=t.height+e.height}return l=Math.max(0,l-a.width),u=Math.max(0,r?l/r:u-a.height),l=Xs(Math.min(l,o,c.maxWidth)),u=Xs(Math.min(u,s,c.maxHeight)),l&&!u&&(u=Xs(l/2)),(t!==void 0||n!==void 0)&&r&&c.height&&u>c.height&&(u=c.height,l=Xs(Math.floor(u*r))),{width:l,height:u}}function Qs(e,t,n){let r=t||1,i=Xs(e.height*r),a=Xs(e.width*r);e.height=Xs(e.height),e.width=Xs(e.width);let o=e.canvas;return o.style&&(n||!o.style.height&&!o.style.width)&&(o.style.height=`${e.height}px`,o.style.width=`${e.width}px`),e.currentDevicePixelRatio!==r||o.height!==i||o.width!==a?(e.currentDevicePixelRatio=r,o.height=i,o.width=a,e.ctx.setTransform(r,0,0,r,0,0),!0):!1}var $s=function(){let e=!1;try{let t={get passive(){return e=!0,!1}};zs()&&(window.addEventListener(`test`,null,t),window.removeEventListener(`test`,null,t))}catch{}return e}();function ec(e,t){let n=Us(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function tc(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function nc(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:r===`middle`?n<.5?e.y:t.y:r===`after`?n<1?e.y:t.y:n>0?t.y:e.y}}function rc(e,t,n,r){let i={x:e.cp2x,y:e.cp2y},a={x:t.cp1x,y:t.cp1y},o=tc(e,i,n),s=tc(i,a,n),c=tc(a,t,n);return tc(tc(o,s,n),tc(s,c,n),n)}var ic=function(e,t){return{x(n){return e+e+t-n},setWidth(e){t=e},textAlign(e){return e===`center`?e:e===`right`?`left`:`right`},xPlus(e,t){return e-t},leftForLtr(e,t){return e-t}}},ac=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function oc(e,t,n){return e?ic(t,n):ac()}function sc(e,t){let n,r;(t===`ltr`||t===`rtl`)&&(n=e.canvas.style,r=[n.getPropertyValue(`direction`),n.getPropertyPriority(`direction`)],n.setProperty(`direction`,t,`important`),e.prevTextDirection=r)}function cc(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty(`direction`,t[0],t[1]))}function lc(e){return e===`angle`?{between:Ja,compare:Ka,normalize:qa}:{between:Za,compare:(e,t)=>e-t,normalize:e=>e}}function uc({start:e,end:t,count:n,loop:r,style:i}){return{start:e%n,end:t%n,loop:r&&(t-e+1)%n===0,style:i}}function dc(e,t,n){let{property:r,start:i,end:a}=n,{between:o,normalize:s}=lc(r),c=t.length,{start:l,end:u,loop:d}=e,f,p;if(d){for(l+=c,u+=c,f=0,p=c;f<p&&o(s(t[l%c][r]),i,a);++f)l--,u--;l%=c,u%=c}return u<l&&(u+=c),{start:l,end:u,loop:d,style:e.style}}function fc(e,t,n){if(!n)return[e];let{property:r,start:i,end:a}=n,o=t.length,{compare:s,between:c,normalize:l}=lc(r),{start:u,end:d,loop:f,style:p}=dc(e,t,n),m=[],h=!1,g=null,_,v,y,b=()=>c(i,y,_)&&s(i,y)!==0,x=()=>s(a,_)===0||c(a,y,_),S=()=>h||b(),C=()=>!h||x();for(let e=u,n=u;e<=d;++e)v=t[e%o],!v.skip&&(_=l(v[r]),_!==y&&(h=c(_,i,a),g===null&&S()&&(g=s(_,i)===0?e:n),g!==null&&C()&&(m.push(uc({start:g,end:e,loop:f,count:o,style:p})),g=null),n=e,y=_));return g!==null&&m.push(uc({start:g,end:d,loop:f,count:o,style:p})),m}function pc(e,t){let n=[],r=e.segments;for(let i=0;i<r.length;i++){let a=fc(r[i],e.points,t);a.length&&n.push(...a)}return n}function mc(e,t,n,r){let i=0,a=t-1;if(n&&!r)for(;i<t&&!e[i].skip;)i++;for(;i<t&&e[i].skip;)i++;for(i%=t,n&&(a+=i);a>i&&e[a%t].skip;)a--;return a%=t,{start:i,end:a}}function hc(e,t,n,r){let i=e.length,a=[],o=t,s=e[t],c;for(c=t+1;c<=n;++c){let n=e[c%i];n.skip||n.stop?s.skip||(r=!1,a.push({start:t%i,end:(c-1)%i,loop:r}),t=o=n.stop?c:null):(o=c,s.skip&&(t=c)),s=n}return o!==null&&a.push({start:t%i,end:o%i,loop:r}),a}function gc(e,t){let n=e.points,r=e.options.spanGaps,i=n.length;if(!i)return[];let a=!!e._loop,{start:o,end:s}=mc(n,i,a,r);return r===!0?_c(e,[{start:o,end:s,loop:a}],n,t):_c(e,hc(n,o,s<o?s+i:s,!!e._fullLoop&&o===0&&s===i-1),n,t)}function _c(e,t,n,r){return!r||!r.setContext||!n?t:vc(e,t,n,r)}function vc(e,t,n,r){let i=e._chart.getContext(),a=yc(e.options),{_datasetIndex:o,options:{spanGaps:s}}=e,c=n.length,l=[],u=a,d=t[0].start,f=d;function p(e,t,r,i){let a=s?-1:1;if(e!==t){for(e+=c;n[e%c].skip;)e-=a;for(;n[t%c].skip;)t+=a;e%c!==t%c&&(l.push({start:e%c,end:t%c,loop:r,style:i}),u=i,d=t%c)}}for(let e of t){d=s?d:e.start;let t=n[d%c],a;for(f=d+1;f<=e.end;f++){let s=n[f%c];a=yc(r.setContext(ls(i,{type:`segment`,p0:t,p1:s,p0DataIndex:(f-1)%c,p1DataIndex:f%c,datasetIndex:o}))),bc(a,u)&&p(d,f-1,e.loop,u),t=s,u=a}d<f-1&&p(d,f-1,e.loop,u)}return l}function yc(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function bc(e,t){if(!t)return!1;let n=[],r=function(e,t){return yo(t)?(n.includes(t)||n.push(t),n.indexOf(t)):t};return JSON.stringify(e,r)!==JSON.stringify(t,r)}function xc(e,t,n){return e.options.clip?e[n]:t[n]}function Sc(e,t){let{xScale:n,yScale:r}=e;return n&&r?{left:xc(n,t,`left`),right:xc(n,t,`right`),top:xc(r,t,`top`),bottom:xc(r,t,`bottom`)}:t}function Cc(e,t){let n=t._clip;if(n.disabled)return!1;let r=Sc(t,e.chartArea);return{left:n.left===!1?0:r.left-(n.left===!0?0:n.left),right:n.right===!1?e.width:r.right+(n.right===!0?0:n.right),top:n.top===!1?0:r.top-(n.top===!0?0:n.top),bottom:n.bottom===!1?e.height:r.bottom+(n.bottom===!0?0:n.bottom)}}var wc=new class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,t,n,r){let i=t.listeners[r],a=t.duration;i.forEach(r=>r({chart:e,initial:t.initial,numSteps:a,currentStep:Math.min(n-t.start,a)}))}_refresh(){this._request||=(this._running=!0,oo.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 i=n.items,a=i.length-1,o=!1,s;for(;a>=0;--a)s=i[a],s._active?(s._total>n.duration&&(n.duration=s._total),s.tick(e),o=!0):(i[a]=i[i.length-1],i.pop());o&&(r.draw(),this._notify(r,n,e,`progress`)),i.length||(n.running=!1,this._notify(r,n,e,`complete`),n.initial=!1),t+=i.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((e,t)=>Math.max(e,t._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)}},Tc=`transparent`,Ec={boolean(e,t,n){return n>.5?t:e},color(e,t,n){let r=bo(e||Tc),i=r.valid&&bo(t||Tc);return i&&i.valid?i.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}},Dc=class{constructor(e,t,n,r){let i=t[n];r=ss([e.to,r,i,e.from]);let a=ss([e.from,i,r]);this._active=!0,this._fn=e.fn||Ec[e.type||typeof a],this._easing=vo[e.easing]||vo.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=a,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],i=n-this._start,a=this._duration-i;this._start=n,this._duration=Math.floor(Math.max(a,e.duration)),this._total+=i,this._loop=!!e.loop,this._to=ss([e.to,t,r,e.from]),this._from=ss([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,i=this._from,a=this._loop,o=this._to,s;if(this._active=i!==o&&(a||t<n),!this._active){this._target[r]=o,this._notify(!0);return}if(t<0){this._target[r]=i;return}s=t/n%2,s=a&&s>1?2-s:s,s=this._easing(Math.min(1,Math.max(0,s))),this._target[r]=this._fn(i,o,s)}wait(){let e=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 e=0;e<n.length;e++)n[e][t]()}},Oc=class{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!G(e))return;let t=Object.keys(Z.animation),n=this._properties;Object.getOwnPropertyNames(e).forEach(r=>{let i=e[r];if(!G(i))return;let a={};for(let e of t)a[e]=i[e];(W(i.properties)&&i.properties||[r]).forEach(e=>{(e===r||!n.has(e))&&n.set(e,a)})})}_animateOptions(e,t){let n=t.options,r=Ac(e,n);if(!r)return[];let i=this._createAnimations(r,n);return n.$shared&&kc(e.options.$animations,n).then(()=>{e.options=n},()=>{}),i}_createAnimations(e,t){let n=this._properties,r=[],i=e.$animations||={},a=Object.keys(t),o=Date.now(),s;for(s=a.length-1;s>=0;--s){let c=a[s];if(c.charAt(0)===`$`)continue;if(c===`options`){r.push(...this._animateOptions(e,t));continue}let l=t[c],u=i[c],d=n.get(c);if(u)if(d&&u.active()){u.update(d,l,o);continue}else u.cancel();if(!d||!d.duration){e[c]=l;continue}i[c]=u=new Dc(d,e,c,l),r.push(u)}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 wc.add(this._chart,n),!0}};function kc(e,t){let n=[],r=Object.keys(t);for(let t=0;t<r.length;t++){let i=e[r[t]];i&&i.active()&&n.push(i.wait())}return Promise.all(n)}function Ac(e,t){if(!t)return;let n=e.options;if(!n){e.options=t;return}return n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function jc(e,t){let n=e&&e.options||{},r=n.reverse,i=n.min===void 0?t:0,a=n.max===void 0?t:0;return{start:r?a:i,end:r?i:a}}function Mc(e,t,n){if(n===!1)return!1;let r=jc(e,n),i=jc(t,n);return{top:i.end,right:r.end,bottom:i.start,left:r.start}}function Nc(e){let t,n,r,i;return G(e)?(t=e.top,n=e.right,r=e.bottom,i=e.left):t=n=r=i=e,{top:t,right:n,bottom:r,left:i,disabled:e===!1}}function Pc(e,t){let n=[],r=e._getSortedDatasetMetas(t),i,a;for(i=0,a=r.length;i<a;++i)n.push(r[i].index);return n}function Fc(e,t,n,r={}){let i=e.keys,a=r.mode===`single`,o,s,c,l;if(t===null)return;let u=!1;for(o=0,s=i.length;o<s;++o){if(c=+i[o],c===n){if(u=!0,r.all)continue;break}l=e.values[c],K(l)&&(a||t===0||Na(t)===Na(l))&&(t+=l)}return!u&&!r.all?0:t}function Ic(e,t){let{iScale:n,vScale:r}=t,i=n.axis===`x`?`x`:`y`,a=r.axis===`x`?`x`:`y`,o=Object.keys(e),s=Array(o.length),c,l,u;for(c=0,l=o.length;c<l;++c)u=o[c],s[c]={[i]:u,[a]:e[u]};return s}function Lc(e,t){let n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function Rc(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function zc(e){let{min:t,max:n,minDefined:r,maxDefined:i}=e.getUserBounds();return{min:r?t:-1/0,max:i?n:1/0}}function Bc(e,t,n){let r=e[t]||(e[t]={});return r[n]||(r[n]={})}function Vc(e,t,n,r){for(let i of t.getMatchingVisibleMetas(r).reverse()){let t=e[i.index];if(n&&t>0||!n&&t<0)return i.index}return null}function Hc(e,t){let{chart:n,_cachedMeta:r}=e,i=n._stacks||={},{iScale:a,vScale:o,index:s}=r,c=a.axis,l=o.axis,u=Rc(a,o,r),d=t.length,f;for(let e=0;e<d;++e){let n=t[e],{[c]:a,[l]:d}=n,p=n._stacks||={};f=p[l]=Bc(i,u,a),f[s]=d,f._top=Vc(f,o,!0,r.type),f._bottom=Vc(f,o,!1,r.type);let m=f._visualValues||={};m[s]=d}}function Uc(e,t){let n=e.scales;return Object.keys(n).filter(e=>n[e].axis===t).shift()}function Wc(e,t){return ls(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:`default`,type:`dataset`})}function Gc(e,t,n){return ls(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:`default`,type:`data`})}function Kc(e,t){let n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t||=e._parsed;for(let e of t){let t=e._stacks;if(!t||t[r]===void 0||t[r][n]===void 0)return;delete t[r][n],t[r]._visualValues!==void 0&&t[r]._visualValues[n]!==void 0&&delete t[r]._visualValues[n]}}}var qc=e=>e===`reset`||e===`none`,Jc=(e,t)=>t?e:Object.assign({},e),Yc=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:Pc(n,!0),values:null},Xc=class{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(e,t){this.chart=e,this._ctx=e.ctx,this.index=t,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 e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=Lc(e.vScale,e),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(e){this.index!==e&&Kc(this._cachedMeta),this.index=e}linkScales(){let e=this.chart,t=this._cachedMeta,n=this.getDataset(),r=(e,t,n,r)=>e===`x`?t:e===`r`?r:n,i=t.xAxisID=q(n.xAxisID,Uc(e,`x`)),a=t.yAxisID=q(n.yAxisID,Uc(e,`y`)),o=t.rAxisID=q(n.rAxisID,Uc(e,`r`)),s=t.indexAxis,c=t.iAxisID=r(s,i,a,o),l=t.vAxisID=r(s,a,i,o);t.xScale=this.getScaleForId(i),t.yScale=this.getScaleForId(a),t.rScale=this.getScaleForId(o),t.iScale=this.getScaleForId(c),t.vScale=this.getScaleForId(l)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){let t=this._cachedMeta;return e===t.iScale?t.vScale:t.iScale}reset(){this._update(`reset`)}_destroy(){let e=this._cachedMeta;this._data&&io(this._data,this),e._stacked&&Kc(e)}_dataCheck(){let e=this.getDataset(),t=e.data||=[],n=this._data;if(G(t)){let e=this._cachedMeta;this._data=Ic(t,e)}else if(n!==t){if(n){io(n,this);let e=this._cachedMeta;Kc(e),e._parsed=[]}t&&Object.isExtensible(t)&&ro(t,this),this._syncList=[],this._data=t}}addElements(){let e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){let t=this._cachedMeta,n=this.getDataset(),r=!1;this._dataCheck();let i=t._stacked;t._stacked=Lc(t.vScale,t),t.stack!==n.stack&&(r=!0,Kc(t),t.stack=n.stack),this._resyncElements(e),(r||i!==t._stacked)&&(Hc(this,t._parsed),t._stacked=Lc(t.vScale,t))}configure(){let e=this.chart.config,t=e.datasetScopeKeys(this._type),n=e.getOptionScopes(this.getDataset(),t,!0);this.options=e.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,t){let{_cachedMeta:n,_data:r}=this,{iScale:i,_stacked:a}=n,o=i.axis,s=e===0&&t===r.length?!0:n._sorted,c=e>0&&n._parsed[e-1],l,u,d;if(this._parsing===!1)n._parsed=r,n._sorted=!0,d=r;else{d=W(r[e])?this.parseArrayData(n,r,e,t):G(r[e])?this.parseObjectData(n,r,e,t):this.parsePrimitiveData(n,r,e,t);let i=()=>u[o]===null||c&&u[o]<c[o];for(l=0;l<t;++l)n._parsed[l+e]=u=d[l],s&&(i()&&(s=!1),c=u);n._sorted=s}a&&Hc(this,d)}parsePrimitiveData(e,t,n,r){let{iScale:i,vScale:a}=e,o=i.axis,s=a.axis,c=i.getLabels(),l=i===a,u=Array(r),d,f,p;for(d=0,f=r;d<f;++d)p=d+n,u[d]={[o]:l||i.parse(c[p],p),[s]:a.parse(t[p],p)};return u}parseArrayData(e,t,n,r){let{xScale:i,yScale:a}=e,o=Array(r),s,c,l,u;for(s=0,c=r;s<c;++s)l=s+n,u=t[l],o[s]={x:i.parse(u[0],l),y:a.parse(u[1],l)};return o}parseObjectData(e,t,n,r){let{xScale:i,yScale:a}=e,{xAxisKey:o=`x`,yAxisKey:s=`y`}=this._parsing,c=Array(r),l,u,d,f;for(l=0,u=r;l<u;++l)d=l+n,f=t[d],c[l]={x:i.parse(ya(f,o),d),y:a.parse(ya(f,s),d)};return c}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,t,n){let r=this.chart,i=this._cachedMeta,a=t[e.axis];return Fc({keys:Pc(r,!0),values:t._stacks[e.axis]._visualValues},a,i.index,{mode:n})}updateRangeFromParsed(e,t,n,r){let i=n[t.axis],a=i===null?NaN:i,o=r&&n._stacks[t.axis];r&&o&&(r.values=o,a=Fc(r,i,this._cachedMeta.index)),e.min=Math.min(e.min,a),e.max=Math.max(e.max,a)}getMinMax(e,t){let n=this._cachedMeta,r=n._parsed,i=n._sorted&&e===n.iScale,a=r.length,o=this._getOtherScale(e),s=Yc(t,n,this.chart),c={min:1/0,max:-1/0},{min:l,max:u}=zc(o),d,f;function p(){f=r[d];let t=f[o.axis];return!K(f[e.axis])||l>t||u<t}for(d=0;d<a&&!(!p()&&(this.updateRangeFromParsed(c,e,f,s),i));++d);if(i){for(d=a-1;d>=0;--d)if(!p()){this.updateRangeFromParsed(c,e,f,s);break}}return c}getAllParsedValues(e){let t=this._cachedMeta._parsed,n=[],r,i,a;for(r=0,i=t.length;r<i;++r)a=t[r][e.axis],K(a)&&n.push(a);return n}getMaxOverflow(){return!1}getLabelAndValue(e){let t=this._cachedMeta,n=t.iScale,r=t.vScale,i=this.getParsed(e);return{label:n?``+n.getLabelForValue(i[n.axis]):``,value:r?``+r.getLabelForValue(i[r.axis]):``}}_update(e){let t=this._cachedMeta;this.update(e||`default`),t._clip=Nc(q(this.options.clip,Mc(t.xScale,t.yScale,this.getMaxOverflow())))}update(e){}draw(){let e=this._ctx,t=this.chart,n=this._cachedMeta,r=n.data||[],i=t.chartArea,a=[],o=this._drawStart||0,s=this._drawCount||r.length-o,c=this.options.drawActiveElementsOnTop,l;for(n.dataset&&n.dataset.draw(e,i,o,s),l=o;l<o+s;++l){let t=r[l];t.hidden||(t.active&&c?a.push(t):t.draw(e,i))}for(l=0;l<a.length;++l)a[l].draw(e,i)}getStyle(e,t){let n=t?`active`:`default`;return e===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(n):this.resolveDataElementOptions(e||0,n)}getContext(e,t,n){let r=this.getDataset(),i;if(e>=0&&e<this._cachedMeta.data.length){let t=this._cachedMeta.data[e];i=t.$context||=Gc(this.getContext(),e,t),i.parsed=this.getParsed(e),i.raw=r.data[e],i.index=i.dataIndex=e}else i=this.$context||=Wc(this.chart.getContext(),this.index),i.dataset=r,i.index=i.datasetIndex=this.index;return i.active=!!t,i.mode=n,i}resolveDatasetElementOptions(e){return this._resolveElementOptions(this.datasetElementType.id,e)}resolveDataElementOptions(e,t){return this._resolveElementOptions(this.dataElementType.id,t,e)}_resolveElementOptions(e,t=`default`,n){let r=t===`active`,i=this._cachedDataOpts,a=e+`-`+t,o=i[a],s=this.enableOptionSharing&&xa(n);if(o)return Jc(o,s);let c=this.chart.config,l=c.datasetElementScopeKeys(this._type,e),u=r?[`${e}Hover`,`hover`,e,``]:[e,``],d=c.getOptionScopes(this.getDataset(),l),f=Object.keys(Z.elements[e]),p=c.resolveNamedOptions(d,f,()=>this.getContext(n,r,t),u);return p.$shared&&(p.$shared=s,i[a]=Object.freeze(Jc(p,s))),p}_resolveAnimations(e,t,n){let r=this.chart,i=this._cachedDataOpts,a=`animation-${t}`,o=i[a];if(o)return o;let s;if(r.options.animation!==!1){let r=this.chart.config,i=r.datasetAnimationScopeKeys(this._type,t),a=r.getOptionScopes(this.getDataset(),i);s=r.createResolver(a,this.getContext(e,n,t))}let c=new Oc(r,s&&s.animations);return s&&s._cacheable&&(i[a]=Object.freeze(c)),c}getSharedOptions(e){if(e.$shared)return this._sharedOptions||=Object.assign({},e)}includeOptions(e,t){return!t||qc(e)||this.chart._animationsDisabled}_getSharedOptions(e,t){let n=this.resolveDataElementOptions(e,t),r=this._sharedOptions,i=this.getSharedOptions(n),a=this.includeOptions(t,i)||i!==r;return this.updateSharedOptions(i,t,n),{sharedOptions:i,includeOptions:a}}updateElement(e,t,n,r){qc(r)?Object.assign(e,n):this._resolveAnimations(t,r).update(e,n)}updateSharedOptions(e,t,n){e&&!qc(t)&&this._resolveAnimations(void 0,t).update(e,n)}_setStyle(e,t,n,r){e.active=r;let i=this.getStyle(t,r);this._resolveAnimations(t,n,r).update(e,{options:!r&&this.getSharedOptions(i)||i})}removeHoverStyle(e,t,n){this._setStyle(e,n,`active`,!1)}setHoverStyle(e,t,n){this._setStyle(e,n,`active`,!0)}_removeDatasetHoverStyle(){let e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,`active`,!1)}_setDatasetHoverStyle(){let e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,`active`,!0)}_resyncElements(e){let t=this._data,n=this._cachedMeta.data;for(let[e,t,n]of this._syncList)this[e](t,n);this._syncList=[];let r=n.length,i=t.length,a=Math.min(i,r);a&&this.parse(0,a),i>r?this._insertElements(r,i-r,e):i<r&&this._removeElements(i,r-i)}_insertElements(e,t,n=!0){let r=this._cachedMeta,i=r.data,a=e+t,o,s=e=>{for(e.length+=t,o=e.length-1;o>=a;o--)e[o]=e[o-t]};for(s(i),o=e;o<a;++o)i[o]=new this.dataElementType;this._parsing&&s(r._parsed),this.parse(e,t),n&&this.updateElements(i,e,t,`reset`)}updateElements(e,t,n,r){}_removeElements(e,t){let n=this._cachedMeta;if(this._parsing){let r=n._parsed.splice(e,t);n._stacked&&Kc(n,r)}n.data.splice(e,t)}_sync(e){if(this._parsing)this._syncList.push(e);else{let[t,n,r]=e;this[t](n,r)}this.chart._dataChanges.push([this.index,...e])}_onDataPush(){let e=arguments.length;this._sync([`_insertElements`,this.getDataset().data.length-e,e])}_onDataPop(){this._sync([`_removeElements`,this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync([`_removeElements`,0,1])}_onDataSplice(e,t){t&&this._sync([`_removeElements`,e,t]);let n=arguments.length-2;n&&this._sync([`_insertElements`,e,n])}_onDataUnshift(){this._sync([`_insertElements`,0,arguments.length])}},Zc=class extends Xc{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(e){let t=this._cachedMeta,{dataset:n,data:r=[],_dataset:i}=t,a=this.chart._animationsDisabled,{start:o,count:s}=po(t,r,a);this._drawStart=o,this._drawCount=s,mo(t)&&(o=0,s=r.length),n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!i._decimated,n.points=r;let c=this.resolveDatasetElementOptions(e);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(n,void 0,{animated:!a,options:c},e),this.updateElements(r,o,s,e)}updateElements(e,t,n,r){let i=r===`reset`,{iScale:a,vScale:o,_stacked:s,_dataset:c}=this._cachedMeta,{sharedOptions:l,includeOptions:u}=this._getSharedOptions(t,r),d=a.axis,f=o.axis,{spanGaps:p,segment:m}=this.options,h=Ra(p)?p:1/0,g=this.chart._animationsDisabled||i||r===`none`,_=t+n,v=e.length,y=t>0&&this.getParsed(t-1);for(let n=0;n<v;++n){let p=e[n],v=g?p:{};if(n<t||n>=_){v.skip=!0;continue}let b=this.getParsed(n),x=U(b[f]),S=v[d]=a.getPixelForValue(b[d],n),C=v[f]=i||x?o.getBasePixel():o.getPixelForValue(s?this.applyStack(o,b,s):b[f],n);v.skip=isNaN(S)||isNaN(C)||x,v.stop=n>0&&Math.abs(b[d]-y[d])>h,m&&(v.parsed=b,v.raw=c.data[n]),u&&(v.options=l||this.resolveDataElementOptions(n,p.active?`active`:r)),g||this.updateElement(p,n,v,r),y=b}}getMaxOverflow(){let e=this._cachedMeta,t=e.dataset,n=t.options&&t.options.borderWidth||0,r=e.data||[];if(!r.length)return n;let i=r[0].size(this.resolveDataElementOptions(0)),a=r[r.length-1].size(this.resolveDataElementOptions(r.length-1));return Math.max(n,i,a)/2}draw(){let e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}};function Qc(){throw Error(`This method is not implemented: Check that a complete date adapter is provided.`)}var $c={_date:class e{static override(t){Object.assign(e.prototype,t)}options;constructor(e){this.options=e||{}}init(){}formats(){return Qc()}parse(){return Qc()}format(){return Qc()}add(){return Qc()}diff(){return Qc()}startOf(){return Qc()}endOf(){return Qc()}}};function el(e,t,n,r){let{controller:i,data:a,_sorted:o}=e,s=i._cachedMeta.iScale,c=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(s&&t===s.axis&&t!==`r`&&o&&a.length){let o=s._reversePixels?eo:$a;if(!r){let r=o(a,t,n);if(c){let{vScale:t}=i._cachedMeta,{_parsed:n}=e,a=n.slice(0,r.lo+1).reverse().findIndex(e=>!U(e[t.axis]));r.lo-=Math.max(0,a);let o=n.slice(r.hi).findIndex(e=>!U(e[t.axis]));r.hi+=Math.max(0,o)}return r}else if(i._sharedOptions){let e=a[0],r=typeof e.getRange==`function`&&e.getRange(t);if(r){let e=o(a,t,n-r),i=o(a,t,n+r);return{lo:e.lo,hi:i.hi}}}}return{lo:0,hi:a.length-1}}function tl(e,t,n,r,i){let a=e.getSortedVisibleDatasetMetas(),o=n[t];for(let e=0,n=a.length;e<n;++e){let{index:n,data:s}=a[e],{lo:c,hi:l}=el(a[e],t,o,i);for(let e=c;e<=l;++e){let t=s[e];t.skip||r(t,n,e)}}}function nl(e){let t=e.indexOf(`x`)!==-1,n=e.indexOf(`y`)!==-1;return function(e,r){let i=t?Math.abs(e.x-r.x):0,a=n?Math.abs(e.y-r.y):0;return Math.sqrt(i**2+a**2)}}function rl(e,t,n,r,i){let a=[];return!i&&!e.isPointInArea(t)||tl(e,n,t,function(n,o,s){!i&&!Wo(n,e.chartArea,0)||n.inRange(t.x,t.y,r)&&a.push({element:n,datasetIndex:o,index:s})},!0),a}function il(e,t,n,r){let i=[];function a(e,n,a){let{startAngle:o,endAngle:s}=e.getProps([`startAngle`,`endAngle`],r),{angle:c}=Wa(e,{x:t.x,y:t.y});Ja(c,o,s)&&i.push({element:e,datasetIndex:n,index:a})}return tl(e,n,t,a),i}function al(e,t,n,r,i,a){let o=[],s=nl(n),c=1/0;function l(n,l,u){let d=n.inRange(t.x,t.y,i);if(r&&!d)return;let f=n.getCenterPoint(i);if(!(a||e.isPointInArea(f))&&!d)return;let p=s(t,f);p<c?(o=[{element:n,datasetIndex:l,index:u}],c=p):p===c&&o.push({element:n,datasetIndex:l,index:u})}return tl(e,n,t,l),o}function ol(e,t,n,r,i,a){return!a&&!e.isPointInArea(t)?[]:n===`r`&&!r?il(e,t,n,i):al(e,t,n,r,i,a)}function sl(e,t,n,r,i){let a=[],o=n===`x`?`inXRange`:`inYRange`,s=!1;return tl(e,n,t,(e,r,c)=>{e[o]&&e[o](t[n],i)&&(a.push({element:e,datasetIndex:r,index:c}),s||=e.inRange(t.x,t.y,i))}),r&&!s?[]:a}var cl={evaluateInteractionItems:tl,modes:{index(e,t,n,r){let i=Js(t,e),a=n.axis||`x`,o=n.includeInvisible||!1,s=n.intersect?rl(e,i,a,r,o):ol(e,i,a,!1,r,o),c=[];return s.length?(e.getSortedVisibleDatasetMetas().forEach(e=>{let t=s[0].index,n=e.data[t];n&&!n.skip&&c.push({element:n,datasetIndex:e.index,index:t})}),c):[]},dataset(e,t,n,r){let i=Js(t,e),a=n.axis||`xy`,o=n.includeInvisible||!1,s=n.intersect?rl(e,i,a,r,o):ol(e,i,a,!1,r,o);if(s.length>0){let t=s[0].datasetIndex,n=e.getDatasetMeta(t).data;s=[];for(let e=0;e<n.length;++e)s.push({element:n[e],datasetIndex:t,index:e})}return s},point(e,t,n,r){return rl(e,Js(t,e),n.axis||`xy`,r,n.includeInvisible||!1)},nearest(e,t,n,r){let i=Js(t,e),a=n.axis||`xy`,o=n.includeInvisible||!1;return ol(e,i,a,n.intersect,r,o)},x(e,t,n,r){return sl(e,Js(t,e),`x`,n.intersect,r)},y(e,t,n,r){return sl(e,Js(t,e),`y`,n.intersect,r)}}},ll=[`left`,`top`,`right`,`bottom`];function ul(e,t){return e.filter(e=>e.pos===t)}function dl(e,t){return e.filter(e=>ll.indexOf(e.pos)===-1&&e.box.axis===t)}function fl(e,t){return e.sort((e,n)=>{let r=t?n:e,i=t?e:n;return r.weight===i.weight?r.index-i.index:r.weight-i.weight})}function pl(e){let t=[],n,r,i,a,o,s;for(n=0,r=(e||[]).length;n<r;++n)i=e[n],{position:a,options:{stack:o,stackWeight:s=1}}=i,t.push({index:n,box:i,pos:a,horizontal:i.isHorizontal(),weight:i.weight,stack:o&&a+o,stackWeight:s});return t}function ml(e){let t={};for(let n of e){let{stack:e,pos:r,stackWeight:i}=n;if(!e||!ll.includes(r))continue;let a=t[e]||(t[e]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=i}return t}function hl(e,t){let n=ml(e),{vBoxMaxWidth:r,hBoxMaxHeight:i}=t,a,o,s;for(a=0,o=e.length;a<o;++a){s=e[a];let{fullSize:o}=s.box,c=n[s.stack],l=c&&s.stackWeight/c.weight;s.horizontal?(s.width=l?l*r:o&&t.availableWidth,s.height=i):(s.width=r,s.height=l?l*i:o&&t.availableHeight)}return n}function gl(e){let t=pl(e),n=fl(t.filter(e=>e.box.fullSize),!0),r=fl(ul(t,`left`),!0),i=fl(ul(t,`right`)),a=fl(ul(t,`top`),!0),o=fl(ul(t,`bottom`)),s=dl(t,`x`),c=dl(t,`y`);return{fullSize:n,leftAndTop:r.concat(a),rightAndBottom:i.concat(c).concat(o).concat(s),chartArea:ul(t,`chartArea`),vertical:r.concat(i).concat(c),horizontal:a.concat(o).concat(s)}}function _l(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function vl(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function yl(e,t,n,r){let{pos:i,box:a}=n,o=e.maxPadding;if(!G(i)){n.size&&(e[i]-=n.size);let t=r[n.stack]||{size:0,count:1};t.size=Math.max(t.size,n.horizontal?a.height:a.width),n.size=t.size/t.count,e[i]+=n.size}a.getPadding&&vl(o,a.getPadding());let s=Math.max(0,t.outerWidth-_l(o,e,`left`,`right`)),c=Math.max(0,t.outerHeight-_l(o,e,`top`,`bottom`)),l=s!==e.w,u=c!==e.h;return e.w=s,e.h=c,n.horizontal?{same:l,other:u}:{same:u,other:l}}function bl(e){let t=e.maxPadding;function n(n){let r=Math.max(t[n]-e[n],0);return e[n]+=r,r}e.y+=n(`top`),e.x+=n(`left`),n(`right`),n(`bottom`)}function xl(e,t){let n=t.maxPadding;function r(e){let r={left:0,top:0,right:0,bottom:0};return e.forEach(e=>{r[e]=Math.max(t[e],n[e])}),r}return r(e?[`left`,`right`]:[`top`,`bottom`])}function Sl(e,t,n,r){let i=[],a,o,s,c,l,u;for(a=0,o=e.length,l=0;a<o;++a){s=e[a],c=s.box,c.update(s.width||t.w,s.height||t.h,xl(s.horizontal,t));let{same:o,other:d}=yl(t,n,s,r);l|=o&&i.length,u||=d,c.fullSize||i.push(s)}return l&&Sl(i,t,n,r)||u}function Cl(e,t,n,r,i){e.top=n,e.left=t,e.right=t+r,e.bottom=n+i,e.width=r,e.height=i}function wl(e,t,n,r){let i=n.padding,{x:a,y:o}=t;for(let s of e){let e=s.box,c=r[s.stack]||{count:1,placed:0,weight:1},l=s.stackWeight/c.weight||1;if(s.horizontal){let r=t.w*l,a=c.size||e.height;xa(c.start)&&(o=c.start),e.fullSize?Cl(e,i.left,o,n.outerWidth-i.right-i.left,a):Cl(e,t.left+c.placed,o,r,a),c.start=o,c.placed+=r,o=e.bottom}else{let r=t.h*l,o=c.size||e.width;xa(c.start)&&(a=c.start),e.fullSize?Cl(e,a,i.top,o,n.outerHeight-i.bottom-i.top):Cl(e,a,t.top+c.placed,o,r),c.start=a,c.placed+=r,a=e.right}}t.x=a,t.y=o}var Tl={addBox(e,t){e.boxes||=[],t.fullSize=t.fullSize||!1,t.position=t.position||`top`,t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},e.boxes.push(t)},removeBox(e,t){let n=e.boxes?e.boxes.indexOf(t):-1;n!==-1&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,r){if(!e)return;let i=Q(e.options.layout.padding),a=Math.max(t-i.width,0),o=Math.max(n-i.height,0),s=gl(e.boxes),c=s.vertical,l=s.horizontal;Y(e.boxes,e=>{typeof e.beforeLayout==`function`&&e.beforeLayout()});let u=c.reduce((e,t)=>t.box.options&&t.box.options.display===!1?e:e+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:i,availableWidth:a,availableHeight:o,vBoxMaxWidth:a/2/u,hBoxMaxHeight:o/2}),f=Object.assign({},i);vl(f,Q(r));let p=Object.assign({maxPadding:f,w:a,h:o,x:i.left,y:i.top},i),m=hl(c.concat(l),d);Sl(s.fullSize,p,d,m),Sl(c,p,d,m),Sl(l,p,d,m)&&Sl(c,p,d,m),bl(p),wl(s.leftAndTop,p,d,m),p.x+=p.w,p.y+=p.h,wl(s.rightAndBottom,p,d,m),e.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},Y(s.chartArea,t=>{let n=t.box;Object.assign(n,e.chartArea),n.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}},El=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||=e.height,{width:t,height:Math.max(0,r?Math.floor(t/r):n)}}isAttached(e){return!0}updateConfig(e){}},Dl=class extends El{acquireContext(e){return e&&e.getContext&&e.getContext(`2d`)||null}updateConfig(e){e.options.animation=!1}},Ol=`$chartjs`,kl={touchstart:`mousedown`,touchmove:`mousemove`,touchend:`mouseup`,pointerenter:`mouseenter`,pointerdown:`mousedown`,pointermove:`mousemove`,pointerup:`mouseup`,pointerleave:`mouseout`,pointerout:`mouseout`},Al=e=>e===null||e===``;function jl(e,t){let n=e.style,r=e.getAttribute(`height`),i=e.getAttribute(`width`);if(e[Ol]={initial:{height:r,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||`block`,n.boxSizing=n.boxSizing||`border-box`,Al(i)){let t=ec(e,`width`);t!==void 0&&(e.width=t)}if(Al(r))if(e.style.height===``)e.height=e.width/(t||2);else{let t=ec(e,`height`);t!==void 0&&(e.height=t)}return e}var Ml=$s?{passive:!0}:!1;function Nl(e,t,n){e&&e.addEventListener(t,n,Ml)}function Pl(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,Ml)}function Fl(e,t){let n=kl[e.type]||e.type,{x:r,y:i}=Js(e,t);return{type:n,chart:t,native:e,x:r===void 0?null:r,y:i===void 0?null:i}}function Il(e,t){for(let n of e)if(n===t||n.contains(t))return!0}function Ll(e,t,n){let r=e.canvas,i=new MutationObserver(e=>{let t=!1;for(let n of e)t||=Il(n.addedNodes,r),t&&=!Il(n.removedNodes,r);t&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function Rl(e,t,n){let r=e.canvas,i=new MutationObserver(e=>{let t=!1;for(let n of e)t||=Il(n.removedNodes,r),t&&=!Il(n.addedNodes,r);t&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}var zl=new Map,Bl=0;function Vl(){let e=window.devicePixelRatio;e!==Bl&&(Bl=e,zl.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function Hl(e,t){zl.size||window.addEventListener(`resize`,Vl),zl.set(e,t)}function Ul(e){zl.delete(e),zl.size||window.removeEventListener(`resize`,Vl)}function Wl(e,t,n){let r=e.canvas,i=r&&Bs(r);if(!i)return;let a=so((e,t)=>{let r=i.clientWidth;n(e,t),r<i.clientWidth&&n()},window),o=new ResizeObserver(e=>{let t=e[0],n=t.contentRect.width,r=t.contentRect.height;n===0&&r===0||a(n,r)});return o.observe(i),Hl(e,a),o}function Gl(e,t,n){n&&n.disconnect(),t===`resize`&&Ul(e)}function Kl(e,t,n){let r=e.canvas,i=so(t=>{e.ctx!==null&&n(Fl(t,e))},e);return Nl(r,t,i),i}var ql=class extends El{acquireContext(e,t){let n=e&&e.getContext&&e.getContext(`2d`);return n&&n.canvas===e?(jl(e,t),n):null}releaseContext(e){let t=e.canvas;if(!t[Ol])return!1;let n=t[Ol].initial;[`height`,`width`].forEach(e=>{let r=n[e];U(r)?t.removeAttribute(e):t.setAttribute(e,r)});let r=n.style||{};return Object.keys(r).forEach(e=>{t.style[e]=r[e]}),t.width=t.width,delete t[Ol],!0}addEventListener(e,t,n){this.removeEventListener(e,t);let r=e.$proxies||={};r[t]=({attach:Ll,detach:Rl,resize:Wl}[t]||Kl)(e,t,n)}removeEventListener(e,t){let n=e.$proxies||={},r=n[t];r&&(({attach:Gl,detach:Gl,resize:Gl}[t]||Pl)(e,t,r),n[t]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,n,r){return Zs(e,t,n,r)}isAttached(e){let t=e&&Bs(e);return!!(t&&t.isConnected)}};function Jl(e){return!zs()||typeof OffscreenCanvas<`u`&&e instanceof OffscreenCanvas?Dl:ql}var Yl=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 Ra(this.x)&&Ra(this.y)}getProps(e,t){let n=this.$animations;if(!t||!n)return this;let r={};return e.forEach(e=>{r[e]=n[e]&&n[e].active()?n[e]._to:this[e]}),r}};function Xl(e,t){let n=e.options.ticks,r=Zl(e),i=Math.min(n.maxTicksLimit||r,r),a=n.major.enabled?$l(t):[],o=a.length,s=a[0],c=a[o-1],l=[];if(o>i)return eu(t,l,a,o/i),l;let u=Ql(a,t,i);if(o>0){let e,n,r=o>1?Math.round((c-s)/(o-1)):null;for(tu(t,l,u,U(r)?0:s-r,s),e=0,n=o-1;e<n;e++)tu(t,l,u,a[e],a[e+1]);return tu(t,l,u,c,U(r)?t.length:c+r),l}return tu(t,l,u),l}function Zl(e){let t=e.options.offset,n=e._tickSize(),r=e._length/n+ +!t,i=e._maxLength/n;return Math.floor(Math.min(r,i))}function Ql(e,t,n){let r=nu(e),i=t.length/n;if(!r)return Math.max(i,1);let a=Ia(r);for(let e=0,t=a.length-1;e<t;e++){let t=a[e];if(t>i)return t}return Math.max(i,1)}function $l(e){let t=[],n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function eu(e,t,n,r){let i=0,a=n[0],o;for(r=Math.ceil(r),o=0;o<e.length;o++)o===a&&(t.push(e[o]),i++,a=n[i*r])}function tu(e,t,n,r,i){let a=q(r,0),o=Math.min(q(i,e.length),e.length),s=0,c,l,u;for(n=Math.ceil(n),i&&(c=i-r,n=c/Math.floor(c/n)),u=a;u<0;)s++,u=Math.round(a+s*n);for(l=Math.max(a,0);l<o;l++)l===u&&(t.push(e[l]),s++,u=Math.round(a+s*n))}function nu(e){let t=e.length,n,r;if(t<2)return!1;for(r=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==r)return!1;return r}var ru=e=>e===`left`?`right`:e===`right`?`left`:e,iu=(e,t,n)=>t===`top`||t===`left`?e[t]+n:e[t]-n,au=(e,t)=>Math.min(t||e,e);function ou(e,t){let n=[],r=e.length/t,i=e.length,a=0;for(;a<i;a+=r)n.push(e[Math.floor(a)]);return n}function su(e,t,n){let r=e.ticks.length,i=Math.min(t,r-1),a=e._startPixel,o=e._endPixel,s=1e-6,c=e.getPixelForTick(i),l;if(!(n&&(l=r===1?Math.max(c-a,o-c):t===0?(e.getPixelForTick(1)-c)/2:(c-e.getPixelForTick(i-1))/2,c+=i<t?l:-l,c<a-s||c>o+s)))return c}function cu(e,t){Y(e,e=>{let n=e.gc,r=n.length/2,i;if(r>t){for(i=0;i<r;++i)delete e.data[n[i]];n.splice(0,r)}})}function lu(e){return e.drawTicks?e.tickLength:0}function uu(e,t){if(!e.display)return 0;let n=$(e.font,t),r=Q(e.padding);return(W(e.text)?e.text.length:1)*n.lineHeight+r.height}function du(e,t){return ls(e,{scale:t,type:`scale`})}function fu(e,t,n){return ls(e,{tick:n,index:t,type:`tick`})}function pu(e,t,n){let r=lo(e);return(n&&t!==`right`||!n&&t===`right`)&&(r=ru(r)),r}function mu(e,t,n,r){let{top:i,left:a,bottom:o,right:s,chart:c}=e,{chartArea:l,scales:u}=c,d=0,f,p,m,h=o-i,g=s-a;if(e.isHorizontal()){if(p=uo(r,a,s),G(n)){let e=Object.keys(n)[0],r=n[e];m=u[e].getPixelForValue(r)+h-t}else m=n===`center`?(l.bottom+l.top)/2+h-t:iu(e,n,t);f=s-a}else{if(G(n)){let e=Object.keys(n)[0],r=n[e];p=u[e].getPixelForValue(r)-g+t}else p=n===`center`?(l.left+l.right)/2-g+t:iu(e,n,t);m=uo(r,o,i),d=n===`left`?-ka:ka}return{titleX:p,titleY:m,maxWidth:f,rotation:d}}var hu=class e extends Yl{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=sa(e,1/0),t=sa(t,-1/0),n=sa(n,1/0),r=sa(r,-1/0),{min:sa(e,n),max:sa(t,r),minDefined:K(e),maxDefined:K(t)}}getMinMax(e){let{min:t,max:n,minDefined:r,maxDefined:i}=this.getUserBounds(),a;if(r&&i)return{min:t,max:n};let o=this.getMatchingVisibleMetas();for(let s=0,c=o.length;s<c;++s)a=o[s].controller.getMinMax(this,e),r||(t=Math.min(t,a.min)),i||(n=Math.max(n,a.max));return t=i&&t>n?n:t,n=r&&t>n?t:n,{min:sa(t,sa(n,t)),max:sa(n,sa(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._computeLabelItems(e)}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){J(this.options.beforeUpdate,[this])}update(e,t,n){let{beginAtZero:r,grace:i,ticks:a}=this.options,o=a.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=cs(this,i,r),!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let s=o<this.ticks.length;this._convertTicksToLabels(s?ou(this.ticks,o):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source===`auto`)&&(this.ticks=Xl(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),s&&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(){J(this.options.afterUpdate,[this])}beforeSetDimensions(){J(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(){J(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),J(this.options[e],[this])}beforeDataLimits(){this._callHooks(`beforeDataLimits`)}determineDataLimits(){}afterDataLimits(){this._callHooks(`afterDataLimits`)}beforeBuildTicks(){this._callHooks(`beforeBuildTicks`)}buildTicks(){return[]}afterBuildTicks(){this._callHooks(`afterBuildTicks`)}beforeTickToLabelConversion(){J(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){let t=this.options.ticks,n,r,i;for(n=0,r=e.length;n<r;n++)i=e[n],i.label=J(t.callback,[i.value,n,e],this)}afterTickToLabelConversion(){J(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){J(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){let e=this.options,t=e.ticks,n=au(this.ticks.length,e.ticks.maxTicksLimit),r=t.minRotation||0,i=t.maxRotation,a=r,o,s,c;if(!this._isVisible()||!t.display||r>=i||n<=1||!this.isHorizontal()){this.labelRotation=r;return}let l=this._getLabelSizes(),u=l.widest.width,d=l.highest.height,f=Ya(this.chart.width-u,0,this.maxWidth);o=e.offset?this.maxWidth/n:f/(n-1),u+6>o&&(o=f/(n-(e.offset?.5:1)),s=this.maxHeight-lu(e.grid)-t.padding-uu(e.title,this.chart.options.font),c=Math.sqrt(u*u+d*d),a=Ha(Math.min(Math.asin(Ya((l.highest.height+6)/o,-1,1)),Math.asin(Ya(s/c,-1,1))-Math.asin(Ya(d/c,-1,1)))),a=Math.max(r,Math.min(i,a))),this.labelRotation=a}afterCalculateLabelRotation(){J(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){J(this.options.beforeFit,[this])}fit(){let e={width:0,height:0},{chart:t,options:{ticks:n,title:r,grid:i}}=this,a=this._isVisible(),o=this.isHorizontal();if(a){let a=uu(r,t.options.font);if(o?(e.width=this.maxWidth,e.height=lu(i)+a):(e.height=this.maxHeight,e.width=lu(i)+a),n.display&&this.ticks.length){let{first:t,last:r,widest:i,highest:a}=this._getLabelSizes(),s=n.padding*2,c=Va(this.labelRotation),l=Math.cos(c),u=Math.sin(c);if(o){let t=n.mirror?0:u*i.width+l*a.height;e.height=Math.min(this.maxHeight,e.height+t+s)}else{let t=n.mirror?0:l*i.width+u*a.height;e.width=Math.min(this.maxWidth,e.width+t+s)}this._calculatePadding(t,r,u,l)}}this._handleMargins(),o?(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:i,padding:a},position:o}=this.options,s=this.labelRotation!==0,c=o!==`top`&&this.axis===`x`;if(this.isHorizontal()){let o=this.getPixelForTick(0)-this.left,l=this.right-this.getPixelForTick(this.ticks.length-1),u=0,d=0;s?c?(u=r*e.width,d=n*t.height):(u=n*e.height,d=r*t.width):i===`start`?d=t.width:i===`end`?u=e.width:i!==`inner`&&(u=e.width/2,d=t.width/2),this.paddingLeft=Math.max((u-o+a)*this.width/(this.width-o),0),this.paddingRight=Math.max((d-l+a)*this.width/(this.width-l),0)}else{let n=t.height/2,r=e.height/2;i===`start`?(n=0,r=e.height):i===`end`&&(n=t.height,r=0),this.paddingTop=n+a,this.paddingBottom=r+a}}_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(){J(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=ou(n,t)),this._labelSizes=e=this._computeLabelSizes(n,n.length,this.options.ticks.maxTicksLimit)}return e}_computeLabelSizes(e,t,n){let{ctx:r,_longestTextCache:i}=this,a=[],o=[],s=Math.floor(t/au(t,n)),c=0,l=0,u,d,f,p,m,h,g,_,v,y,b;for(u=0;u<t;u+=s){if(p=e[u].label,m=this._resolveTickFontOptions(u),r.font=h=m.string,g=i[h]=i[h]||{data:{},gc:[]},_=m.lineHeight,v=y=0,!U(p)&&!W(p))v=Ro(r,g.data,g.gc,v,p),y=_;else if(W(p))for(d=0,f=p.length;d<f;++d)b=p[d],!U(b)&&!W(b)&&(v=Ro(r,g.data,g.gc,v,b),y+=_);a.push(v),o.push(y),c=Math.max(v,c),l=Math.max(y,l)}cu(i,t);let x=a.indexOf(c),S=o.indexOf(l),C=e=>({width:a[e]||0,height:o[e]||0});return{first:C(0),last:C(t-1),widest:C(x),highest:C(S),widths:a,heights:o}}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 Xa(this._alignToPixels?Bo(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||=fu(this.getContext(),e,n)}return this.$context||=du(this.chart.getContext(),this)}_tickSize(){let e=this.options.ticks,t=Va(this.labelRotation),n=Math.abs(Math.cos(t)),r=Math.abs(Math.sin(t)),i=this._getLabelSizes(),a=e.autoSkipPadding||0,o=i?i.widest.width+a:0,s=i?i.highest.height+a:0;return this.isHorizontal()?s*n>o*r?o/n:s/r:s*r<o*n?s/n:o/r}_isVisible(){let e=this.options.display;return e===`auto`?this.getMatchingVisibleMetas().length>0:!!e}_computeGridLineItems(e){let t=this.axis,n=this.chart,r=this.options,{grid:i,position:a,border:o}=r,s=i.offset,c=this.isHorizontal(),l=this.ticks.length+ +!!s,u=lu(i),d=[],f=o.setContext(this.getContext()),p=f.display?f.width:0,m=p/2,h=function(e){return Bo(n,e,p)},g,_,v,y,b,x,S,C,w,T,E,D;if(a===`top`)g=h(this.bottom),x=this.bottom-u,C=g-m,T=h(e.top)+m,D=e.bottom;else if(a===`bottom`)g=h(this.top),T=e.top,D=h(e.bottom)-m,x=g+m,C=this.top+u;else if(a===`left`)g=h(this.right),b=this.right-u,S=g-m,w=h(e.left)+m,E=e.right;else if(a===`right`)g=h(this.left),w=e.left,E=h(e.right)-m,b=g+m,S=this.left+u;else if(t===`x`){if(a===`center`)g=h((e.top+e.bottom)/2+.5);else if(G(a)){let e=Object.keys(a)[0],t=a[e];g=h(this.chart.scales[e].getPixelForValue(t))}T=e.top,D=e.bottom,x=g+m,C=x+u}else if(t===`y`){if(a===`center`)g=h((e.left+e.right)/2);else if(G(a)){let e=Object.keys(a)[0],t=a[e];g=h(this.chart.scales[e].getPixelForValue(t))}b=g-m,S=b-u,w=e.left,E=e.right}let ee=q(r.ticks.maxTicksLimit,l),O=Math.max(1,Math.ceil(l/ee));for(_=0;_<l;_+=O){let e=this.getContext(_),t=i.setContext(e),r=o.setContext(e),a=t.lineWidth,l=t.color,u=r.dash||[],f=r.dashOffset,p=t.tickWidth,m=t.tickColor,h=t.tickBorderDash||[],g=t.tickBorderDashOffset;v=su(this,_,s),v!==void 0&&(y=Bo(n,v,a),c?b=S=w=E=y:x=C=T=D=y,d.push({tx1:b,ty1:x,tx2:S,ty2:C,x1:w,y1:T,x2:E,y2:D,width:a,color:l,borderDash:u,borderDashOffset:f,tickWidth:p,tickColor:m,tickBorderDash:h,tickBorderDashOffset:g}))}return this._ticksLength=l,this._borderValue=g,d}_computeLabelItems(e){let t=this.axis,n=this.options,{position:r,ticks:i}=n,a=this.isHorizontal(),o=this.ticks,{align:s,crossAlign:c,padding:l,mirror:u}=i,d=lu(n.grid),f=d+l,p=u?-l:f,m=-Va(this.labelRotation),h=[],g,_,v,y,b,x,S,C,w,T,E,D,ee=`middle`;if(r===`top`)x=this.bottom-p,S=this._getXAxisLabelAlignment();else if(r===`bottom`)x=this.top+p,S=this._getXAxisLabelAlignment();else if(r===`left`){let e=this._getYAxisLabelAlignment(d);S=e.textAlign,b=e.x}else if(r===`right`){let e=this._getYAxisLabelAlignment(d);S=e.textAlign,b=e.x}else if(t===`x`){if(r===`center`)x=(e.top+e.bottom)/2+f;else if(G(r)){let e=Object.keys(r)[0],t=r[e];x=this.chart.scales[e].getPixelForValue(t)+f}S=this._getXAxisLabelAlignment()}else if(t===`y`){if(r===`center`)b=(e.left+e.right)/2-f;else if(G(r)){let e=Object.keys(r)[0],t=r[e];b=this.chart.scales[e].getPixelForValue(t)}S=this._getYAxisLabelAlignment(d).textAlign}t===`y`&&(s===`start`?ee=`top`:s===`end`&&(ee=`bottom`));let O=this._getLabelSizes();for(g=0,_=o.length;g<_;++g){v=o[g],y=v.label;let e=i.setContext(this.getContext(g));C=this.getPixelForTick(g)+i.labelOffset,w=this._resolveTickFontOptions(g),T=w.lineHeight,E=W(y)?y.length:1;let t=E/2,n=e.color,s=e.textStrokeColor,l=e.textStrokeWidth,d=S;a?(b=C,S===`inner`&&(d=g===_-1?this.options.reverse?`left`:`right`:g===0?this.options.reverse?`right`:`left`:`center`),D=r===`top`?c===`near`||m!==0?-E*T+T/2:c===`center`?-O.highest.height/2-t*T+T:-O.highest.height+T/2:c===`near`||m!==0?T/2:c===`center`?O.highest.height/2-t*T:O.highest.height-E*T,u&&(D*=-1),m!==0&&!e.showLabelBackdrop&&(b+=T/2*Math.sin(m))):(x=C,D=(1-E)*T/2);let f;if(e.showLabelBackdrop){let t=Q(e.backdropPadding),n=O.heights[g],r=O.widths[g],i=D-t.top,a=0-t.left;switch(ee){case`middle`:i-=n/2;break;case`bottom`:i-=n;break}switch(S){case`center`:a-=r/2;break;case`right`:a-=r;break;case`inner`:g===_-1?a-=r:g>0&&(a-=r/2);break}f={left:a,top:i,width:r+t.width,height:n+t.height,color:e.backdropColor}}h.push({label:y,font:w,textOffset:D,options:{rotation:m,color:n,strokeColor:s,strokeWidth:l,textAlign:d,textBaseline:ee,translation:[b,x],backdrop:f}})}return h}_getXAxisLabelAlignment(){let{position:e,ticks:t}=this.options;if(-Va(this.labelRotation))return e===`top`?`left`:`right`;let n=`center`;return t.align===`start`?n=`left`:t.align===`end`?n=`right`:t.align===`inner`&&(n=`inner`),n}_getYAxisLabelAlignment(e){let{position:t,ticks:{crossAlign:n,mirror:r,padding:i}}=this.options,a=this._getLabelSizes(),o=e+i,s=a.widest.width,c,l;return t===`left`?r?(l=this.right+i,n===`near`?c=`left`:n===`center`?(c=`center`,l+=s/2):(c=`right`,l+=s)):(l=this.right-o,n===`near`?c=`right`:n===`center`?(c=`center`,l-=s/2):(c=`left`,l=this.left)):t===`right`?r?(l=this.left+i,n===`near`?c=`right`:n===`center`?(c=`center`,l-=s/2):(c=`left`,l-=s)):(l=this.left+o,n===`near`?c=`left`:n===`center`?(c=`center`,l+=s/2):(c=`right`,l=this.right)):c=`right`,{textAlign:c,x:l}}_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:i,height:a}=this;t&&(e.save(),e.fillStyle=t,e.fillRect(n,r,i,a),e.restore())}getLineWidthForValue(e){let t=this.options.grid;if(!this._isVisible()||!t.display)return 0;let n=this.ticks.findIndex(t=>t.value===e);return n>=0?t.setContext(this.getContext(n)).lineWidth:0}drawGrid(e){let t=this.options.grid,n=this.ctx,r=this._gridLineItems||=this._computeGridLineItems(e),i,a,o=(e,t,r)=>{!r.width||!r.color||(n.save(),n.lineWidth=r.width,n.strokeStyle=r.color,n.setLineDash(r.borderDash||[]),n.lineDashOffset=r.borderDashOffset,n.beginPath(),n.moveTo(e.x,e.y),n.lineTo(t.x,t.y),n.stroke(),n.restore())};if(t.display)for(i=0,a=r.length;i<a;++i){let e=r[i];t.drawOnChartArea&&o({x:e.x1,y:e.y1},{x:e.x2,y:e.y2},e),t.drawTicks&&o({x:e.tx1,y:e.ty1},{x:e.tx2,y:e.ty2},{color:e.tickColor,width:e.tickWidth,borderDash:e.tickBorderDash,borderDashOffset:e.tickBorderDashOffset})}}drawBorder(){let{chart:e,ctx:t,options:{border:n,grid:r}}=this,i=n.setContext(this.getContext()),a=n.display?i.width:0;if(!a)return;let o=r.setContext(this.getContext(0)).lineWidth,s=this._borderValue,c,l,u,d;this.isHorizontal()?(c=Bo(e,this.left,a)-a/2,l=Bo(e,this.right,o)+o/2,u=d=s):(u=Bo(e,this.top,a)-a/2,d=Bo(e,this.bottom,o)+o/2,c=l=s),t.save(),t.lineWidth=i.width,t.strokeStyle=i.color,t.beginPath(),t.moveTo(c,u),t.lineTo(l,d),t.stroke(),t.restore()}drawLabels(e){if(!this.options.ticks.display)return;let t=this.ctx,n=this._computeLabelArea();n&&Go(t,n);let r=this.getLabelItems(e);for(let e of r){let n=e.options,r=e.font,i=e.label,a=e.textOffset;Qo(t,i,0,a,r,n)}n&&Ko(t)}drawTitle(){let{ctx:e,options:{position:t,title:n,reverse:r}}=this;if(!n.display)return;let i=$(n.font),a=Q(n.padding),o=n.align,s=i.lineHeight/2;t===`bottom`||t===`center`||G(t)?(s+=a.bottom,W(n.text)&&(s+=i.lineHeight*(n.text.length-1))):s+=a.top;let{titleX:c,titleY:l,maxWidth:u,rotation:d}=mu(this,s,t,o);Qo(e,n.text,0,0,i,{color:n.color,maxWidth:u,rotation:d,textAlign:pu(o,t,r),textBaseline:`middle`,translation:[c,l]})}draw(e){this._isVisible()&&(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){let t=this.options,n=t.ticks&&t.ticks.z||0,r=q(t.grid&&t.grid.z,-1),i=q(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==e.prototype.draw?[{z:n,draw:e=>{this.draw(e)}}]:[{z:r,draw:e=>{this.drawBackground(),this.drawGrid(e),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:n,draw:e=>{this.drawLabels(e)}}]}getMatchingVisibleMetas(e){let t=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+`AxisID`,r=[],i,a;for(i=0,a=t.length;i<a;++i){let a=t[i];a[n]===this.id&&(!e||a.type===e)&&r.push(a)}return r}_resolveTickFontOptions(e){return $(this.options.ticks.setContext(this.getContext(e)).font)}_maxDigits(){let e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}},gu=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;yu(t)&&(n=this.register(t));let r=this.items,i=e.id,a=this.scope+`.`+i;if(!i)throw Error(`class does not have id: `+e);return i in r?a:(r[i]=e,_u(e,a,n),this.override&&Z.override(e.id,e.overrides),a)}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 Z[r]&&(delete Z[r][n],this.override&&delete No[n])}};function _u(e,t,n){let r=pa(Object.create(null),[n?Z.get(n):{},Z.get(t),e.defaults]);Z.set(t,r),e.defaultRoutes&&vu(t,e.defaultRoutes),e.descriptors&&Z.describe(t,e.descriptors)}function vu(e,t){Object.keys(t).forEach(n=>{let r=n.split(`.`),i=r.pop(),a=[e].concat(r).join(`.`),o=t[n].split(`.`),s=o.pop(),c=o.join(`.`);Z.route(a,i,c,s)})}function yu(e){return`id`in e&&`defaults`in e}var bu=new class{constructor(){this.controllers=new gu(Xc,`datasets`,!0),this.elements=new gu(Yl,`elements`),this.plugins=new gu(Object,`plugins`),this.scales=new gu(hu,`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(t=>{let r=n||this._getRegistryForType(t);n||r.isForType(t)||r===this.plugins&&t.id?this._exec(e,r,t):Y(t,t=>{let r=n||this._getRegistryForType(t);this._exec(e,r,t)})})}_exec(e,t,n){let r=ba(e);J(n[`before`+r],[],n),t[e](n),J(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 Error(`"`+e+`" is not a registered `+n+`.`);return r}},xu=class{constructor(){this._init=void 0}notify(e,t,n,r){if(t===`beforeInit`&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,`install`)),this._init===void 0)return;let i=r?this._descriptors(e).filter(r):this._descriptors(e),a=this._notify(i,e,t,n);return t===`afterDestroy`&&(this._notify(i,e,`stop`),this._notify(this._init,e,`uninstall`),this._init=void 0),a}_notify(e,t,n,r){r||={};for(let i of e){let e=i.plugin,a=e[n];if(J(a,[t,r,i.options],e)===!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=q(n.options&&n.options.plugins,{}),i=Su(n);return r===!1&&!t?[]:wu(e,i,r,t)}_notifyStateChanges(e){let t=this._oldCache||[],n=this._cache,r=(e,t)=>e.filter(e=>!t.some(t=>e.plugin.id===t.plugin.id));this._notify(r(t,n),e,`stop`),this._notify(r(n,t),e,`start`)}};function Su(e){let t={},n=[],r=Object.keys(bu.plugins.items);for(let e=0;e<r.length;e++)n.push(bu.getPlugin(r[e]));let i=e.plugins||[];for(let e=0;e<i.length;e++){let r=i[e];n.indexOf(r)===-1&&(n.push(r),t[r.id]=!0)}return{plugins:n,localIds:t}}function Cu(e,t){return!t&&e===!1?null:e===!0?{}:e}function wu(e,{plugins:t,localIds:n},r,i){let a=[],o=e.getContext();for(let s of t){let t=s.id,c=Cu(r[t],i);c!==null&&a.push({plugin:s,options:Tu(e.config,{plugin:s,local:n[t]},c,o)})}return a}function Tu(e,{plugin:t,local:n},r,i){let a=e.pluginScopeKeys(t),o=e.getOptionScopes(r,a);return n&&t.defaults&&o.push(t.defaults),e.createResolver(o,i,[``],{scriptable:!1,indexable:!1,allKeys:!0})}function Eu(e,t){let n=Z.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||`x`}function Du(e,t){let n=e;return e===`_index_`?n=t:e===`_value_`&&(n=t===`x`?`y`:`x`),n}function Ou(e,t){return e===t?`_index_`:`_value_`}function ku(e){if(e===`x`||e===`y`||e===`r`)return e}function Au(e){if(e===`top`||e===`bottom`)return`x`;if(e===`left`||e===`right`)return`y`}function ju(e,...t){if(ku(e))return e;for(let n of t){let t=n.axis||Au(n.position)||e.length>1&&ku(e[0].toLowerCase());if(t)return t}throw Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function Mu(e,t,n){if(n[t+`AxisID`]===e)return{axis:t}}function Nu(e,t){if(t.data&&t.data.datasets){let n=t.data.datasets.filter(t=>t.xAxisID===e||t.yAxisID===e);if(n.length)return Mu(e,`x`,n[0])||Mu(e,`y`,n[0])}return{}}function Pu(e,t){let n=No[e.type]||{scales:{}},r=t.scales||{},i=Eu(e.type,t),a=Object.create(null);return Object.keys(r).forEach(t=>{let o=r[t];if(!G(o))return console.error(`Invalid scale configuration for scale: ${t}`);if(o._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${t}`);let s=ju(t,o,Nu(t,e),Z.scales[o.type]),c=Ou(s,i),l=n.scales||{};a[t]=ma(Object.create(null),[{axis:s},o,l[s],l[c]])}),e.data.datasets.forEach(n=>{let i=n.type||e.type,o=n.indexAxis||Eu(i,t),s=(No[i]||{}).scales||{};Object.keys(s).forEach(e=>{let t=Du(e,o),i=n[t+`AxisID`]||t;a[i]=a[i]||Object.create(null),ma(a[i],[{axis:t},r[i],s[e]])})}),Object.keys(a).forEach(e=>{let t=a[e];ma(t,[Z.scales[t.type],Z.scale])}),a}function Fu(e){let t=e.options||={};t.plugins=q(t.plugins,{}),t.scales=Pu(e,t)}function Iu(e){return e||={},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function Lu(e){return e||={},e.data=Iu(e.data),Fu(e),e}var Ru=new Map,zu=new Set;function Bu(e,t){let n=Ru.get(e);return n||(n=t(),Ru.set(e,n),zu.add(n)),n}var Vu=(e,t,n)=>{let r=ya(t,n);r!==void 0&&e.add(r)},Hu=class{constructor(e){this._config=Lu(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=Iu(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(),Fu(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return Bu(e,()=>[[`datasets.${e}`,``]])}datasetAnimationScopeKeys(e,t){return Bu(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,``]])}datasetElementScopeKeys(e,t){return Bu(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,``]])}pluginScopeKeys(e){let t=e.id,n=this.type;return Bu(`${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:i}=this,a=this._cachedScopes(e,n),o=a.get(t);if(o)return o;let s=new Set;t.forEach(t=>{e&&(s.add(e),t.forEach(t=>Vu(s,e,t))),t.forEach(e=>Vu(s,r,e)),t.forEach(e=>Vu(s,No[i]||{},e)),t.forEach(e=>Vu(s,Z,e)),t.forEach(e=>Vu(s,Po,e))});let c=Array.from(s);return c.length===0&&c.push(Object.create(null)),zu.has(t)&&a.set(t,c),c}chartOptionScopes(){let{options:e,type:t}=this;return[e,No[t]||{},Z.datasets[t]||{},{type:t},Z,Po]}resolveNamedOptions(e,t,n,r=[``]){let i={$shared:!0},{resolver:a,subPrefixes:o}=Uu(this._resolverCache,e,r),s=a;if(Gu(a,t)){i.$shared=!1,n=Sa(n)?n():n;let t=this.createResolver(e,n,o);s=ds(a,n,t)}for(let e of t)i[e]=s[e];return i}createResolver(e,t,n=[``],r){let{resolver:i}=Uu(this._resolverCache,e,n);return G(t)?ds(i,t,void 0,r):i}};function Uu(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));let i=n.join(),a=r.get(i);return a||(a={resolver:us(t,n),subPrefixes:n.filter(e=>!e.toLowerCase().includes(`hover`))},r.set(i,a)),a}var Wu=e=>G(e)&&Object.getOwnPropertyNames(e).some(t=>Sa(e[t]));function Gu(e,t){let{isScriptable:n,isIndexable:r}=fs(e);for(let i of t){let t=n(i),a=r(i),o=(a||t)&&e[i];if(t&&(Sa(o)||Wu(o))||a&&W(o))return!0}return!1}var Ku=`4.5.1`,qu=[`top`,`bottom`,`left`,`right`,`chartArea`];function Ju(e,t){return e===`top`||e===`bottom`||qu.indexOf(e)===-1&&t===`x`}function Yu(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function Xu(e){let t=e.chart,n=t.options.animation;t.notifyPlugins(`afterRender`),J(n&&n.onComplete,[e],t)}function Zu(e){let t=e.chart,n=t.options.animation;J(n&&n.onProgress,[e],t)}function Qu(e){return zs()&&typeof e==`string`?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}var $u={},ed=e=>{let t=Qu(e);return Object.values($u).filter(e=>e.canvas===t).pop()};function td(e,t,n){let r=Object.keys(e);for(let i of r){let r=+i;if(r>=t){let a=e[i];delete e[i],(n>0||r>t)&&(e[r+n]=a)}}}function nd(e,t,n,r){return!n||e.type===`mouseout`?null:r?t:e}var rd=class{static defaults=Z;static instances=$u;static overrides=No;static registry=bu;static version=Ku;static getChart=ed;static register(...e){bu.add(...e),id()}static unregister(...e){bu.remove(...e),id()}constructor(e,t){let n=this.config=new Hu(t),r=Qu(e),i=ed(r);if(i)throw Error(`Canvas is already in use. Chart with ID '`+i.id+`' must be destroyed before the canvas with ID '`+i.canvas.id+`' can be reused.`);let a=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||(Jl(r))),this.platform.updateConfig(n);let o=this.platform.acquireContext(r,a.aspectRatio),s=o&&o.canvas,c=s&&s.height,l=s&&s.width;if(this.id=oa(),this.ctx=o,this.canvas=s,this.width=l,this.height=c,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 xu,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=co(e=>this.update(e),a.resizeDelay||0),this._dataChanges=[],$u[this.id]=this,!o||!s){console.error(`Failed to create chart: can't acquire context from the given item`);return}wc.listen(this,`complete`,Xu),wc.listen(this,`progress`,Zu),this._initialize(),this.attached&&this.update()}get aspectRatio(){let{options:{aspectRatio:e,maintainAspectRatio:t},width:n,height:r,_aspectRatio:i}=this;return U(e)?t&&i?i:r?n/r:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return bu}_initialize(){return this.notifyPlugins(`beforeInit`),this.options.responsive?this.resize():Qs(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins(`afterInit`),this}clear(){return Vo(this.canvas,this.ctx),this}stop(){return wc.stop(this),this}resize(e,t){wc.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){let n=this.options,r=this.canvas,i=n.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(r,e,t,i),o=n.devicePixelRatio||this.platform.getDevicePixelRatio(),s=this.width?`resize`:`attach`;this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,Qs(this,o,!0)&&(this.notifyPlugins(`resize`,{size:a}),J(n.onResize,[this,a],this),this.attached&&this._doResize(s)&&this.render())}ensureScalesHaveIDs(){Y(this.options.scales||{},(e,t)=>{e.id=t})}buildOrUpdateScales(){let e=this.options,t=e.scales,n=this.scales,r=Object.keys(n).reduce((e,t)=>(e[t]=!1,e),{}),i=[];t&&(i=i.concat(Object.keys(t).map(e=>{let n=t[e],r=ju(e,n),i=r===`r`,a=r===`x`;return{options:n,dposition:i?`chartArea`:a?`bottom`:`left`,dtype:i?`radialLinear`:a?`category`:`linear`}}))),Y(i,t=>{let i=t.options,a=i.id,o=ju(a,i),s=q(i.type,t.dtype);(i.position===void 0||Ju(i.position,o)!==Ju(t.dposition))&&(i.position=t.dposition),r[a]=!0;let c=null;a in n&&n[a].type===s?c=n[a]:(c=new(bu.getScale(s))({id:a,type:s,ctx:this.ctx,chart:this}),n[c.id]=c),c.init(i,e)}),Y(r,(e,t)=>{e||delete n[t]}),Y(n,e=>{Tl.configure(this,e,e.options),Tl.addBox(this,e)})}_updateMetasets(){let e=this._metasets,t=this.data.datasets.length,n=e.length;if(e.sort((e,t)=>e.index-t.index),n>t){for(let e=t;e<n;++e)this._destroyDatasetMeta(e);e.splice(t,n-t)}this._sortedMetasets=e.slice(0).sort(Yu(`order`,`index`))}_removeUnreferencedMetasets(){let{_metasets:e,data:{datasets:t}}=this;e.length>t.length&&delete this._stacks,e.forEach((e,n)=>{t.filter(t=>t===e._dataset).length===0&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){let e=[],t=this.data.datasets,n,r;for(this._removeUnreferencedMetasets(),n=0,r=t.length;n<r;n++){let r=t[n],i=this.getDatasetMeta(n),a=r.type||this.config.type;if(i.type&&i.type!==a&&(this._destroyDatasetMeta(n),i=this.getDatasetMeta(n)),i.type=a,i.indexAxis=r.indexAxis||Eu(a,this.options),i.order=r.order||0,i.index=n,i.label=``+r.label,i.visible=this.isDatasetVisible(n),i.controller)i.controller.updateIndex(n),i.controller.linkScales();else{let t=bu.getController(a),{datasetElementType:r,dataElementType:o}=Z.datasets[a];Object.assign(t,{dataElementType:bu.getElement(o),datasetElementType:r&&bu.getElement(r)}),i.controller=new t(this,n),e.push(i.controller)}}return this._updateMetasets(),e}_resetElements(){Y(this.data.datasets,(e,t)=>{this.getDatasetMeta(t).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins(`reset`)}update(e){let t=this.config;t.update();let n=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),r=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins(`beforeUpdate`,{mode:e,cancelable:!0})===!1)return;let i=this.buildOrUpdateControllers();this.notifyPlugins(`beforeElementsUpdate`);let a=0;for(let e=0,t=this.data.datasets.length;e<t;e++){let{controller:t}=this.getDatasetMeta(e),n=!r&&i.indexOf(t)===-1;t.buildOrUpdateElements(n),a=Math.max(+t.getMaxOverflow(),a)}a=this._minPadding=n.layout.autoPadding?a:0,this._updateLayout(a),r||Y(i,e=>{e.reset()}),this._updateDatasets(e),this.notifyPlugins(`afterUpdate`,{mode:e}),this._layers.sort(Yu(`z`,`_idx`));let{_active:o,_lastEvent:s}=this;s?this._eventHandler(s,!0):o.length&&this._updateHoverStyles(o,o,!0),this.render()}_updateScales(){Y(this.scales,e=>{Tl.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){let e=this.options;(!Ca(new Set(Object.keys(this._listeners)),new Set(e.events))||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){let{_hiddenIndices:e}=this,t=this._getUniformDataChanges()||[];for(let{method:n,start:r,count:i}of t)td(e,r,n===`_removeElements`?-i:i)}_getUniformDataChanges(){let e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];let t=this.data.datasets.length,n=t=>new Set(e.filter(e=>e[0]===t).map((e,t)=>t+`,`+e.splice(1).join(`,`))),r=n(0);for(let e=1;e<t;e++)if(!Ca(r,n(e)))return;return Array.from(r).map(e=>e.split(`,`)).map(e=>({method:e[1],start:+e[2],count:+e[3]}))}_updateLayout(e){if(this.notifyPlugins(`beforeLayout`,{cancelable:!0})===!1)return;Tl.update(this,this.width,this.height,e);let t=this.chartArea,n=t.width<=0||t.height<=0;this._layers=[],Y(this.boxes,e=>{n&&e.position===`chartArea`||(e.configure&&e.configure(),this._layers.push(...e._layers()))},this),this._layers.forEach((e,t)=>{e._idx=t}),this.notifyPlugins(`afterLayout`)}_updateDatasets(e){if(this.notifyPlugins(`beforeDatasetsUpdate`,{mode:e,cancelable:!0})!==!1){for(let e=0,t=this.data.datasets.length;e<t;++e)this.getDatasetMeta(e).controller.configure();for(let t=0,n=this.data.datasets.length;t<n;++t)this._updateDataset(t,Sa(e)?e({datasetIndex:t}):e);this.notifyPlugins(`afterDatasetsUpdate`,{mode:e})}}_updateDataset(e,t){let n=this.getDatasetMeta(e),r={meta:n,index:e,mode:t,cancelable:!0};this.notifyPlugins(`beforeDatasetUpdate`,r)!==!1&&(n.controller._update(t),r.cancelable=!1,this.notifyPlugins(`afterDatasetUpdate`,r))}render(){this.notifyPlugins(`beforeRender`,{cancelable:!0})!==!1&&(wc.has(this)?this.attached&&!wc.running(this)&&wc.start(this):(this.draw(),Xu({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){let{width:e,height:t}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(e,t)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins(`beforeDraw`,{cancelable:!0})===!1)return;let t=this._layers;for(e=0;e<t.length&&t[e].z<=0;++e)t[e].draw(this.chartArea);for(this._drawDatasets();e<t.length;++e)t[e].draw(this.chartArea);this.notifyPlugins(`afterDraw`)}_getSortedDatasetMetas(e){let t=this._sortedMetasets,n=[],r,i;for(r=0,i=t.length;r<i;++r){let i=t[r];(!e||i.visible)&&n.push(i)}return n}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins(`beforeDatasetsDraw`,{cancelable:!0})===!1)return;let e=this.getSortedVisibleDatasetMetas();for(let t=e.length-1;t>=0;--t)this._drawDataset(e[t]);this.notifyPlugins(`afterDatasetsDraw`)}_drawDataset(e){let t=this.ctx,n={meta:e,index:e.index,cancelable:!0},r=Cc(this,e);this.notifyPlugins(`beforeDatasetDraw`,n)!==!1&&(r&&Go(t,r),e.controller.draw(),r&&Ko(t),n.cancelable=!1,this.notifyPlugins(`afterDatasetDraw`,n))}isPointInArea(e){return Wo(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,n,r){let i=cl.modes[t];return typeof i==`function`?i(this,e,n,r):[]}getDatasetMeta(e){let t=this.data.datasets[e],n=this._metasets,r=n.filter(e=>e&&e._dataset===t).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},n.push(r)),r}getContext(){return this.$context||=ls(null,{chart:this,type:`chart`})}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){let t=this.data.datasets[e];if(!t)return!1;let n=this.getDatasetMeta(e);return typeof n.hidden==`boolean`?!n.hidden:!t.hidden}setDatasetVisibility(e,t){let n=this.getDatasetMeta(e);n.hidden=!t}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,t,n){let r=n?`show`:`hide`,i=this.getDatasetMeta(e),a=i.controller._resolveAnimations(void 0,r);xa(t)?(i.data[t].hidden=!n,this.update()):(this.setDatasetVisibility(e,n),a.update(i,{visible:n}),this.update(t=>t.datasetIndex===e?r:void 0))}hide(e,t){this._updateVisibility(e,t,!1)}show(e,t){this._updateVisibility(e,t,!0)}_destroyDatasetMeta(e){let t=this._metasets[e];t&&t.controller&&t.controller._destroy(),delete this._metasets[e]}_stop(){let e,t;for(this.stop(),wc.remove(this),e=0,t=this.data.datasets.length;e<t;++e)this._destroyDatasetMeta(e)}destroy(){this.notifyPlugins(`beforeDestroy`);let{canvas:e,ctx:t}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),Vo(e,t),this.platform.releaseContext(t),this.canvas=null,this.ctx=null),delete $u[this.id],this.notifyPlugins(`afterDestroy`)}toBase64Image(...e){return this.canvas.toDataURL(...e)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){let e=this._listeners,t=this.platform,n=(n,r)=>{t.addEventListener(this,n,r),e[n]=r},r=(e,t,n)=>{e.offsetX=t,e.offsetY=n,this._eventHandler(e)};Y(this.options.events,e=>n(e,r))}bindResponsiveEvents(){this._responsiveListeners||={};let e=this._responsiveListeners,t=this.platform,n=(n,r)=>{t.addEventListener(this,n,r),e[n]=r},r=(n,r)=>{e[n]&&(t.removeEventListener(this,n,r),delete e[n])},i=(e,t)=>{this.canvas&&this.resize(e,t)},a,o=()=>{r(`attach`,o),this.attached=!0,this.resize(),n(`resize`,i),n(`detach`,a)};a=()=>{this.attached=!1,r(`resize`,i),this._stop(),this._resize(0,0),n(`attach`,o)},t.isAttached(this.canvas)?o():a()}unbindEvents(){Y(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},Y(this._responsiveListeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,n){let r=n?`set`:`remove`,i,a,o,s;for(t===`dataset`&&(i=this.getDatasetMeta(e[0].datasetIndex),i.controller[`_`+r+`DatasetHoverStyle`]()),o=0,s=e.length;o<s;++o){a=e[o];let t=a&&this.getDatasetMeta(a.datasetIndex).controller;t&&t[r+`HoverStyle`](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){let t=this._active||[],n=e.map(({datasetIndex:e,index:t})=>{let n=this.getDatasetMeta(e);if(!n)throw Error(`No dataset found at index `+e);return{datasetIndex:e,element:n.data[t],index:t}});la(n,t)||(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,t))}notifyPlugins(e,t,n){return this._plugins.notify(this,e,t,n)}isPluginEnabled(e){return this._plugins._cache.filter(t=>t.plugin.id===e).length===1}_updateHoverStyles(e,t,n){let r=this.options.hover,i=(e,t)=>e.filter(e=>!t.some(t=>e.datasetIndex===t.datasetIndex&&e.index===t.index)),a=i(t,e),o=n?e:i(e,t);a.length&&this.updateHoverStyle(a,r.mode,!1),o.length&&r.mode&&this.updateHoverStyle(o,r.mode,!0)}_eventHandler(e,t){let n={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},r=t=>(t.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins(`beforeEvent`,n,r)===!1)return;let i=this._handleEvent(e,t,n.inChartArea);return n.cancelable=!1,this.notifyPlugins(`afterEvent`,n,r),(i||n.changed)&&this.render(),this}_handleEvent(e,t,n){let{_active:r=[],options:i}=this,a=t,o=this._getActiveElements(e,r,n,a),s=wa(e),c=nd(e,this._lastEvent,n,s);n&&(this._lastEvent=null,J(i.onHover,[e,o,this],this),s&&J(i.onClick,[e,o,this],this));let l=!la(o,r);return(l||t)&&(this._active=o,this._updateHoverStyles(o,r,t)),this._lastEvent=c,l}_getActiveElements(e,t,n,r){if(e.type===`mouseout`)return[];if(!n)return t;let i=this.options.hover;return this.getElementsAtEventForMode(e,i.mode,i,r)}};function id(){return Y(rd.instances,e=>e._plugins.invalidate())}function ad(e,t,n=t){e.lineCap=q(n.borderCapStyle,t.borderCapStyle),e.setLineDash(q(n.borderDash,t.borderDash)),e.lineDashOffset=q(n.borderDashOffset,t.borderDashOffset),e.lineJoin=q(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=q(n.borderWidth,t.borderWidth),e.strokeStyle=q(n.borderColor,t.borderColor)}function od(e,t,n){e.lineTo(n.x,n.y)}function sd(e){return e.stepped?qo:e.tension||e.cubicInterpolationMode===`monotone`?Jo:od}function cd(e,t,n={}){let r=e.length,{start:i=0,end:a=r-1}=n,{start:o,end:s}=t,c=Math.max(i,o),l=Math.min(a,s),u=i<o&&a<o||i>s&&a>s;return{count:r,start:c,loop:t.loop,ilen:l<c&&!u?r+l-c:l-c}}function ld(e,t,n,r){let{points:i,options:a}=t,{count:o,start:s,loop:c,ilen:l}=cd(i,n,r),u=sd(a),{move:d=!0,reverse:f}=r||{},p,m,h;for(p=0;p<=l;++p)m=i[(s+(f?l-p:p))%o],!m.skip&&(d?(e.moveTo(m.x,m.y),d=!1):u(e,h,m,f,a.stepped),h=m);return c&&(m=i[(s+(f?l:0))%o],u(e,h,m,f,a.stepped)),!!c}function ud(e,t,n,r){let i=t.points,{count:a,start:o,ilen:s}=cd(i,n,r),{move:c=!0,reverse:l}=r||{},u=0,d=0,f,p,m,h,g,_,v=e=>(o+(l?s-e:e))%a,y=()=>{h!==g&&(e.lineTo(u,g),e.lineTo(u,h),e.lineTo(u,_))};for(c&&(p=i[v(0)],e.moveTo(p.x,p.y)),f=0;f<=s;++f){if(p=i[v(f)],p.skip)continue;let t=p.x,n=p.y,r=t|0;r===m?(n<h?h=n:n>g&&(g=n),u=(d*u+t)/++d):(y(),e.lineTo(t,n),m=r,d=0,h=g=n),_=n}y()}function dd(e){let t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!==`monotone`&&!t.stepped&&!n?ud:ld}function fd(e){return e.stepped?nc:e.tension||e.cubicInterpolationMode===`monotone`?rc:tc}function pd(e,t,n,r){let i=t._path;i||(i=t._path=new Path2D,t.path(i,n,r)&&i.closePath()),ad(e,t.options),e.stroke(i)}function md(e,t,n,r){let{segments:i,options:a}=t,o=dd(t);for(let s of i)ad(e,a,s.style),e.beginPath(),o(e,t,s,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}var hd=typeof Path2D==`function`;function gd(e,t,n,r){hd&&!t.options.segment?pd(e,t,n,r):md(e,t,n,r)}var _d=class extends Yl{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:e=>e!==`borderDash`&&e!==`fill`};constructor(e){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,e&&Object.assign(this,e)}updateControlPoints(e,t){let n=this.options;if((n.tension||n.cubicInterpolationMode===`monotone`)&&!n.stepped&&!this._pointsUpdated){let r=n.spanGaps?this._loop:this._fullLoop;Rs(this._points,n,e,r,t),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||=gc(this,this.options.segment)}first(){let e=this.segments,t=this.points;return e.length&&t[e[0].start]}last(){let e=this.segments,t=this.points,n=e.length;return n&&t[e[n-1].end]}interpolate(e,t){let n=this.options,r=e[t],i=this.points,a=pc(this,{property:t,start:r,end:r});if(!a.length)return;let o=[],s=fd(n),c,l;for(c=0,l=a.length;c<l;++c){let{start:l,end:u}=a[c],d=i[l],f=i[u];if(d===f){o.push(d);continue}let p=s(d,f,Math.abs((r-d[t])/(f[t]-d[t])),n.stepped);p[t]=e[t],o.push(p)}return o.length===1?o[0]:o}pathSegment(e,t,n){return dd(this)(e,this,t,n)}path(e,t,n){let r=this.segments,i=dd(this),a=this._loop;t||=0,n||=this.points.length-t;for(let o of r)a&=i(e,this,o,{start:t,end:t+n-1});return!!a}draw(e,t,n,r){let i=this.options||{};(this.points||[]).length&&i.borderWidth&&(e.save(),gd(e,this,n,r),e.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}};function vd(e,t,n,r){let i=e.options,{[n]:a}=e.getProps([n],r);return Math.abs(t-a)<i.radius+i.hitRadius}var yd=class extends Yl{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(e){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,t,n){let r=this.options,{x:i,y:a}=this.getProps([`x`,`y`],n);return(e-i)**2+(t-a)**2<(r.hitRadius+r.radius)**2}inXRange(e,t){return vd(this,e,`x`,t)}inYRange(e,t){return vd(this,e,`y`,t)}getCenterPoint(e){let{x:t,y:n}=this.getProps([`x`,`y`],e);return{x:t,y:n}}size(e){e=e||this.options||{};let t=e.radius||0;t=Math.max(t,t&&e.hoverRadius||0);let n=t&&e.borderWidth||0;return(t+n)*2}draw(e,t){let n=this.options;this.skip||n.radius<.1||!Wo(this,t,this.size(n)/2)||(e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.fillStyle=n.backgroundColor,Ho(e,n,this.x,this.y))}getRange(){let e=this.options||{};return e.radius+e.hitRadius}};function bd(e,t,n){let r=e.segments,i=e.points,a=t.points,o=[];for(let e of r){let{start:r,end:s}=e;s=Cd(r,s,i);let c=xd(n,i[r],i[s],e.loop);if(!t.segments){o.push({source:e,target:c,start:i[r],end:i[s]});continue}let l=pc(t,c);for(let t of l){let r=xd(n,a[t.start],a[t.end],t.loop),s=fc(e,i,r);for(let e of s)o.push({source:e,target:t,start:{[n]:wd(c,r,`start`,Math.max)},end:{[n]:wd(c,r,`end`,Math.min)}})}}return o}function xd(e,t,n,r){if(r)return;let i=t[e],a=n[e];return e===`angle`&&(i=qa(i),a=qa(a)),{property:e,start:i,end:a}}function Sd(e,t){let{x:n=null,y:r=null}=e||{},i=t.points,a=[];return t.segments.forEach(({start:e,end:t})=>{t=Cd(e,t,i);let o=i[e],s=i[t];r===null?n!==null&&(a.push({x:n,y:o.y}),a.push({x:n,y:s.y})):(a.push({x:o.x,y:r}),a.push({x:s.x,y:r}))}),a}function Cd(e,t,n){for(;t>e;t--){let e=n[t];if(!isNaN(e.x)&&!isNaN(e.y))break}return t}function wd(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function Td(e,t){let n=[],r=!1;return W(e)?(r=!0,n=e):n=Sd(e,t),n.length?new _d({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function Ed(e){return e&&e.fill!==!1}function Dd(e,t,n){let r=e[t].fill,i=[t],a;if(!n)return r;for(;r!==!1&&i.indexOf(r)===-1;){if(!K(r))return r;if(a=e[r],!a)return!1;if(a.visible)return r;i.push(r),r=a.fill}return!1}function Od(e,t,n){let r=Md(e);if(G(r))return isNaN(r.value)?!1:r;let i=parseFloat(r);return K(i)&&Math.floor(i)===i?kd(r[0],t,i,n):[`origin`,`start`,`end`,`stack`,`shape`].indexOf(r)>=0&&r}function kd(e,t,n,r){return(e===`-`||e===`+`)&&(n=t+n),n===t||n<0||n>=r?!1:n}function Ad(e,t){let n=null;return e===`start`?n=t.bottom:e===`end`?n=t.top:G(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function jd(e,t,n){let r;return r=e===`start`?n:e===`end`?t.options.reverse?t.min:t.max:G(e)?e.value:t.getBaseValue(),r}function Md(e){let t=e.options,n=t.fill,r=q(n&&n.target,n);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?`origin`:r}function Nd(e){let{scale:t,index:n,line:r}=e,i=[],a=r.segments,o=r.points,s=Pd(t,n);s.push(Td({x:null,y:t.bottom},r));for(let e=0;e<a.length;e++){let t=a[e];for(let e=t.start;e<=t.end;e++)Fd(i,o[e],s)}return new _d({points:i,options:{}})}function Pd(e,t){let n=[],r=e.getMatchingVisibleMetas(`line`);for(let e=0;e<r.length;e++){let i=r[e];if(i.index===t)break;i.hidden||n.unshift(i.dataset)}return n}function Fd(e,t,n){let r=[];for(let i=0;i<n.length;i++){let a=n[i],{first:o,last:s,point:c}=Id(a,t,`x`);if(!(!c||o&&s)){if(o)r.unshift(c);else if(e.push(c),!s)break}}e.push(...r)}function Id(e,t,n){let r=e.interpolate(t,n);if(!r)return{};let i=r[n],a=e.segments,o=e.points,s=!1,c=!1;for(let e=0;e<a.length;e++){let t=a[e],r=o[t.start][n],l=o[t.end][n];if(Za(i,r,l)){s=i===r,c=i===l;break}}return{first:s,last:c,point:r}}var Ld=class{constructor(e){this.x=e.x,this.y=e.y,this.radius=e.radius}pathSegment(e,t,n){let{x:r,y:i,radius:a}=this;return t||={start:0,end:Ta},e.arc(r,i,a,t.end,t.start,!0),!n.bounds}interpolate(e){let{x:t,y:n,radius:r}=this,i=e.angle;return{x:t+Math.cos(i)*r,y:n+Math.sin(i)*r,angle:i}}};function Rd(e){let{chart:t,fill:n,line:r}=e;if(K(n))return zd(t,n);if(n===`stack`)return Nd(e);if(n===`shape`)return!0;let i=Bd(e);return i instanceof Ld?i:Td(i,r)}function zd(e,t){let n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function Bd(e){return(e.scale||{}).getPointPositionForValue?Hd(e):Vd(e)}function Vd(e){let{scale:t={},fill:n}=e,r=Ad(n,t);if(K(r)){let e=t.isHorizontal();return{x:e?r:null,y:e?null:r}}return null}function Hd(e){let{scale:t,fill:n}=e,r=t.options,i=t.getLabels().length,a=r.reverse?t.max:t.min,o=jd(n,t,a),s=[];if(r.grid.circular){let e=t.getPointPositionForValue(0,a);return new Ld({x:e.x,y:e.y,radius:t.getDistanceFromCenterForValue(o)})}for(let e=0;e<i;++e)s.push(t.getPointPositionForValue(e,o));return s}function Ud(e,t,n){let r=Rd(t),{chart:i,index:a,line:o,scale:s,axis:c}=t,l=o.options,u=l.fill,d=l.backgroundColor,{above:f=d,below:p=d}=u||{},m=Cc(i,i.getDatasetMeta(a));r&&o.points.length&&(Go(e,n),Wd(e,{line:o,target:r,above:f,below:p,area:n,scale:s,axis:c,clip:m}),Ko(e))}function Wd(e,t){let{line:n,target:r,above:i,below:a,area:o,scale:s,clip:c}=t,l=n._loop?`angle`:t.axis;e.save();let u=a;a!==i&&(l===`x`?(Gd(e,r,o.top),qd(e,{line:n,target:r,color:i,scale:s,property:l,clip:c}),e.restore(),e.save(),Gd(e,r,o.bottom)):l===`y`&&(Kd(e,r,o.left),qd(e,{line:n,target:r,color:a,scale:s,property:l,clip:c}),e.restore(),e.save(),Kd(e,r,o.right),u=i)),qd(e,{line:n,target:r,color:u,scale:s,property:l,clip:c}),e.restore()}function Gd(e,t,n){let{segments:r,points:i}=t,a=!0,o=!1;e.beginPath();for(let s of r){let{start:r,end:c}=s,l=i[r],u=i[Cd(r,c,i)];a?(e.moveTo(l.x,l.y),a=!1):(e.lineTo(l.x,n),e.lineTo(l.x,l.y)),o=!!t.pathSegment(e,s,{move:o}),o?e.closePath():e.lineTo(u.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function Kd(e,t,n){let{segments:r,points:i}=t,a=!0,o=!1;e.beginPath();for(let s of r){let{start:r,end:c}=s,l=i[r],u=i[Cd(r,c,i)];a?(e.moveTo(l.x,l.y),a=!1):(e.lineTo(n,l.y),e.lineTo(l.x,l.y)),o=!!t.pathSegment(e,s,{move:o}),o?e.closePath():e.lineTo(n,u.y)}e.lineTo(n,t.first().y),e.closePath(),e.clip()}function qd(e,t){let{line:n,target:r,property:i,color:a,scale:o,clip:s}=t,c=bd(n,r,i);for(let{source:t,target:l,start:u,end:d}of c){let{style:{backgroundColor:c=a}={}}=t,f=r!==!0;e.save(),e.fillStyle=c,Jd(e,o,s,f&&xd(i,u,d)),e.beginPath();let p=!!n.pathSegment(e,t),m;if(f){p?e.closePath():Yd(e,r,d,i);let t=!!r.pathSegment(e,l,{move:p,reverse:!0});m=p&&t,m||Yd(e,r,u,i)}e.closePath(),e.fill(m?`evenodd`:`nonzero`),e.restore()}}function Jd(e,t,n,r){let i=t.chart.chartArea,{property:a,start:o,end:s}=r||{};if(a===`x`||a===`y`){let t,r,c,l;a===`x`?(t=o,r=i.top,c=s,l=i.bottom):(t=i.left,r=o,c=i.right,l=s),e.beginPath(),n&&(t=Math.max(t,n.left),c=Math.min(c,n.right),r=Math.max(r,n.top),l=Math.min(l,n.bottom)),e.rect(t,r,c-t,l-r),e.clip()}}function Yd(e,t,n,r){let i=t.interpolate(n,r);i&&e.lineTo(i.x,i.y)}var Xd={id:`filler`,afterDatasetsUpdate(e,t,n){let r=(e.data.datasets||[]).length,i=[],a,o,s,c;for(o=0;o<r;++o)a=e.getDatasetMeta(o),s=a.dataset,c=null,s&&s.options&&s instanceof _d&&(c={visible:e.isDatasetVisible(o),index:o,fill:Od(s,o,r),chart:e,axis:a.controller.options.indexAxis,scale:a.vScale,line:s}),a.$filler=c,i.push(c);for(o=0;o<r;++o)c=i[o],!(!c||c.fill===!1)&&(c.fill=Dd(i,o,n.propagate))},beforeDraw(e,t,n){let r=n.drawTime===`beforeDraw`,i=e.getSortedVisibleDatasetMetas(),a=e.chartArea;for(let t=i.length-1;t>=0;--t){let n=i[t].$filler;n&&(n.line.updateControlPoints(a,n.axis),r&&n.fill&&Ud(e.ctx,n,a))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!==`beforeDatasetsDraw`)return;let r=e.getSortedVisibleDatasetMetas();for(let t=r.length-1;t>=0;--t){let n=r[t].$filler;Ed(n)&&Ud(e.ctx,n,e.chartArea)}},beforeDatasetDraw(e,t,n){let r=t.meta.$filler;!Ed(r)||n.drawTime!==`beforeDatasetDraw`||Ud(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:`beforeDatasetDraw`}},Zd=(e,t)=>{let{boxHeight:n=t,boxWidth:r=t}=e;return e.usePointStyle&&(n=Math.min(n,t),r=e.pointStyleWidth||Math.min(r,t)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(t,n)}},Qd=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index,$d=class extends Yl{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=J(e.generateLabels,[this.chart],this)||[];e.filter&&(t=t.filter(t=>e.filter(t,this.chart.data))),e.sort&&(t=t.sort((t,n)=>e.sort(t,n,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=$(n.font),i=r.size,a=this._computeTitleHeight(),{boxWidth:o,itemHeight:s}=Zd(n,i),c,l;t.font=r.string,this.isHorizontal()?(c=this.maxWidth,l=this._fitRows(a,i,o,s)+10):(l=this.maxHeight,c=this._fitCols(a,r,o,s)+10),this.width=Math.min(c,e.maxWidth||this.maxWidth),this.height=Math.min(l,e.maxHeight||this.maxHeight)}_fitRows(e,t,n,r){let{ctx:i,maxWidth:a,options:{labels:{padding:o}}}=this,s=this.legendHitBoxes=[],c=this.lineWidths=[0],l=r+o,u=e;i.textAlign=`left`,i.textBaseline=`middle`;let d=-1,f=-l;return this.legendItems.forEach((e,p)=>{let m=n+t/2+i.measureText(e.text).width;(p===0||c[c.length-1]+m+2*o>a)&&(u+=l,c[c.length-(p>0?0:1)]=0,f+=l,d++),s[p]={left:0,top:f,row:d,width:m,height:r},c[c.length-1]+=m+o}),u}_fitCols(e,t,n,r){let{ctx:i,maxHeight:a,options:{labels:{padding:o}}}=this,s=this.legendHitBoxes=[],c=this.columnSizes=[],l=a-e,u=o,d=0,f=0,p=0,m=0;return this.legendItems.forEach((e,a)=>{let{itemWidth:h,itemHeight:g}=ef(n,t,i,e,r);a>0&&f+g+2*o>l&&(u+=d+o,c.push({width:d,height:f}),p+=d+o,m++,d=f=0),s[a]={left:p,top:f,col:m,width:h,height:g},d=Math.max(d,h),f+=g+o}),u+=d,c.push({width:d,height:f}),u}adjustHitBoxes(){if(!this.options.display)return;let e=this._computeTitleHeight(),{legendHitBoxes:t,options:{align:n,labels:{padding:r},rtl:i}}=this,a=oc(i,this.left,this.width);if(this.isHorizontal()){let i=0,o=uo(n,this.left+r,this.right-this.lineWidths[i]);for(let s of t)i!==s.row&&(i=s.row,o=uo(n,this.left+r,this.right-this.lineWidths[i])),s.top+=this.top+e+r,s.left=a.leftForLtr(a.x(o),s.width),o+=s.width+r}else{let i=0,o=uo(n,this.top+e+r,this.bottom-this.columnSizes[i].height);for(let s of t)s.col!==i&&(i=s.col,o=uo(n,this.top+e+r,this.bottom-this.columnSizes[i].height)),s.top=o,s.left+=this.left+r,s.left=a.leftForLtr(a.x(s.left),s.width),o+=s.height+r}}isHorizontal(){return this.options.position===`top`||this.options.position===`bottom`}draw(){if(this.options.display){let e=this.ctx;Go(e,this),this._draw(),Ko(e)}}_draw(){let{options:e,columnSizes:t,lineWidths:n,ctx:r}=this,{align:i,labels:a}=e,o=Z.color,s=oc(e.rtl,this.left,this.width),c=$(a.font),{padding:l}=a,u=c.size,d=u/2,f;this.drawTitle(),r.textAlign=s.textAlign(`left`),r.textBaseline=`middle`,r.lineWidth=.5,r.font=c.string;let{boxWidth:p,boxHeight:m,itemHeight:h}=Zd(a,u),g=function(e,t,n){if(isNaN(p)||p<=0||isNaN(m)||m<0)return;r.save();let i=q(n.lineWidth,1);if(r.fillStyle=q(n.fillStyle,o),r.lineCap=q(n.lineCap,`butt`),r.lineDashOffset=q(n.lineDashOffset,0),r.lineJoin=q(n.lineJoin,`miter`),r.lineWidth=i,r.strokeStyle=q(n.strokeStyle,o),r.setLineDash(q(n.lineDash,[])),a.usePointStyle)Uo(r,{radius:m*Math.SQRT2/2,pointStyle:n.pointStyle,rotation:n.rotation,borderWidth:i},s.xPlus(e,p/2),t+d,a.pointStyleWidth&&p);else{let a=t+Math.max((u-m)/2,0),o=s.leftForLtr(e,p),c=os(n.borderRadius);r.beginPath(),Object.values(c).some(e=>e!==0)?$o(r,{x:o,y:a,w:p,h:m,radius:c}):r.rect(o,a,p,m),r.fill(),i!==0&&r.stroke()}r.restore()},_=function(e,t,n){Qo(r,n.text,e,t+h/2,c,{strikethrough:n.hidden,textAlign:s.textAlign(n.textAlign)})},v=this.isHorizontal(),y=this._computeTitleHeight();f=v?{x:uo(i,this.left+l,this.right-n[0]),y:this.top+l+y,line:0}:{x:this.left+l,y:uo(i,this.top+y+l,this.bottom-t[0].height),line:0},sc(this.ctx,e.textDirection);let b=h+l;this.legendItems.forEach((o,u)=>{r.strokeStyle=o.fontColor,r.fillStyle=o.fontColor;let m=r.measureText(o.text).width,h=s.textAlign(o.textAlign||=a.textAlign),x=p+d+m,S=f.x,C=f.y;if(s.setWidth(this.width),v?u>0&&S+x+l>this.right&&(C=f.y+=b,f.line++,S=f.x=uo(i,this.left+l,this.right-n[f.line])):u>0&&C+b>this.bottom&&(S=f.x=S+t[f.line].width+l,f.line++,C=f.y=uo(i,this.top+y+l,this.bottom-t[f.line].height)),g(s.x(S),C,o),S=fo(h,S+p+d,v?S+x:this.right,e.rtl),_(s.x(S),C,o),v)f.x+=x+l;else if(typeof o.text!=`string`){let e=c.lineHeight;f.y+=rf(o,e)+l}else f.y+=b}),cc(this.ctx,e.textDirection)}drawTitle(){let e=this.options,t=e.title,n=$(t.font),r=Q(t.padding);if(!t.display)return;let i=oc(e.rtl,this.left,this.width),a=this.ctx,o=t.position,s=n.size/2,c=r.top+s,l,u=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),l=this.top+c,u=uo(e.align,u,this.right-d);else{let t=this.columnSizes.reduce((e,t)=>Math.max(e,t.height),0);l=c+uo(e.align,this.top,this.bottom-t-e.labels.padding-this._computeTitleHeight())}let f=uo(o,u,u+d);a.textAlign=i.textAlign(lo(o)),a.textBaseline=`middle`,a.strokeStyle=t.color,a.fillStyle=t.color,a.font=n.string,Qo(a,t.text,f,l,n)}_computeTitleHeight(){let e=this.options.title,t=$(e.font),n=Q(e.padding);return e.display?t.lineHeight+n.height:0}_getLegendItemAt(e,t){let n,r,i;if(Za(e,this.left,this.right)&&Za(t,this.top,this.bottom)){for(i=this.legendHitBoxes,n=0;n<i.length;++n)if(r=i[n],Za(e,r.left,r.left+r.width)&&Za(t,r.top,r.top+r.height))return this.legendItems[n]}return null}handleEvent(e){let t=this.options;if(!af(e.type,t))return;let n=this._getLegendItemAt(e.x,e.y);if(e.type===`mousemove`||e.type===`mouseout`){let r=this._hoveredItem,i=Qd(r,n);r&&!i&&J(t.onLeave,[e,r,this],this),this._hoveredItem=n,n&&!i&&J(t.onHover,[e,n,this],this)}else n&&J(t.onClick,[e,n,this],this)}};function ef(e,t,n,r,i){return{itemWidth:tf(r,e,t,n),itemHeight:nf(i,r,t.lineHeight)}}function tf(e,t,n,r){let i=e.text;return i&&typeof i!=`string`&&(i=i.reduce((e,t)=>e.length>t.length?e:t)),t+n.size/2+r.measureText(i).width}function nf(e,t,n){let r=e;return typeof t.text!=`string`&&(r=rf(t,n)),r}function rf(e,t){return t*(e.text?e.text.length:0)}function af(e,t){return!!((e===`mousemove`||e===`mouseout`)&&(t.onHover||t.onLeave)||t.onClick&&(e===`click`||e===`mouseup`))}var of={id:`legend`,_element:$d,start(e,t,n){let r=e.legend=new $d({ctx:e.ctx,options:n,chart:e});Tl.configure(e,r,n),Tl.addBox(e,r)},stop(e){Tl.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){let r=e.legend;Tl.configure(e,r,n),r.options=n},afterUpdate(e){let t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:`top`,align:`center`,fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){let r=t.datasetIndex,i=n.chart;i.isDatasetVisible(r)?(i.hide(r),t.hidden=!0):(i.show(r),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){let t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:i,color:a,useBorderRadius:o,borderRadius:s}}=e.legend.options;return e._getSortedDatasetMetas().map(e=>{let c=e.controller.getStyle(n?0:void 0),l=Q(c.borderWidth);return{text:t[e.index].label,fillStyle:c.backgroundColor,fontColor:a,hidden:!e.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(l.width+l.height)/4,strokeStyle:c.borderColor,pointStyle:r||c.pointStyle,rotation:c.rotation,textAlign:i||c.textAlign,borderRadius:o&&(s||c.borderRadius),datasetIndex:e.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:`center`,text:``}},descriptors:{_scriptable:e=>!e.startsWith(`on`),labels:{_scriptable:e=>![`generateLabels`,`filter`,`sort`].includes(e)}}},sf={average(e){if(!e.length)return!1;let t,n,r=new Set,i=0,a=0;for(t=0,n=e.length;t<n;++t){let n=e[t].element;if(n&&n.hasValue()){let e=n.tooltipPosition();r.add(e.x),i+=e.y,++a}}return a===0||r.size===0?!1:{x:[...r].reduce((e,t)=>e+t)/r.size,y:i/a}},nearest(e,t){if(!e.length)return!1;let n=t.x,r=t.y,i=1/0,a,o,s;for(a=0,o=e.length;a<o;++a){let n=e[a].element;if(n&&n.hasValue()){let e=Ga(t,n.getCenterPoint());e<i&&(i=e,s=n)}}if(s){let e=s.tooltipPosition();n=e.x,r=e.y}return{x:n,y:r}}};function cf(e,t){return t&&(W(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function lf(e){return(typeof e==`string`||e instanceof String)&&e.indexOf(`
1
+ import{$ as e,A as t,Ft as n,Ht as r,J as i,K as a,Mt as o,Ot as s,Pt as c,Q as l,Qt as u,R as d,S as f,St as p,U as m,Vt as h,Wt as g,X as _,Xt as v,Y as y,Yt as b,_t as x,at as S,bt as C,c as w,ct as T,et as E,gt as D,h as ee,i as O,it as k,j as te,jt as A,lt as ne,mt as re,n as ie,nt as j,ot as M,pt as N,qt as P,r as F,t as ae,tt as oe,vt as I,xt as L,zt as R}from"./button-BcmABzob.js";import{t as z}from"./chevron-right-Bf3Fdg6M.js";import{t as se}from"./Label-D9CEaBof.js";import{Dt as ce,Et as le,G as ue,H as de,Ot as fe,R as pe,U as me,X as he,_ as ge,a as _e,b as ve,g as ye,h as be,i as xe,m as Se,q as Ce,v as we,vt as Te,wt as Ee,x as De,y as Oe}from"./index-CpvOTf7s.js";import{t as ke}from"./Skeleton-BwwGudhK.js";import{t as Ae}from"./badge-_5ZpB7R1.js";import{t as je}from"./Input-4bkkJSKj.js";var Me=d(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),Ne=d(`funnel`,[[`path`,{d:`M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z`,key:`sc7q7i`}]]);function Pe(e,t){return e-t*Math.floor(e/t)}var Fe=1721426;function Ie(e,t,n,r){t=Re(e,t);let i=t-1,a=-2;return n<=2?a=0:Le(t)&&(a=-1),Fe-1+365*i+Math.floor(i/4)-Math.floor(i/100)+Math.floor(i/400)+Math.floor((367*n-362)/12+a+r)}function Le(e){return e%4==0&&(e%100!=0||e%400==0)}function Re(e,t){return e===`BC`?1-t:t}function ze(e){let t=`AD`;return e<=0&&(t=`BC`,e=1-e),[t,e]}var Be={standard:[31,28,31,30,31,30,31,31,30,31,30,31],leapyear:[31,29,31,30,31,30,31,31,30,31,30,31]},Ve=class{fromJulianDay(e){let t=e,n=t-Fe,r=Math.floor(n/146097),i=Pe(n,146097),a=Math.floor(i/36524),o=Pe(i,36524),s=Math.floor(o/1461),c=Pe(o,1461),l=Math.floor(c/365),[u,d]=ze(r*400+a*100+s*4+l+ +(a!==4&&l!==4)),f=t-Ie(u,d,1,1),p=2;t<Ie(u,d,3,1)?p=0:Le(d)&&(p=1);let m=Math.floor(((f+p)*12+373)/367);return new V(u,d,m,t-Ie(u,d,m,1)+1)}toJulianDay(e){return Ie(e.era,e.year,e.month,e.day)}getDaysInMonth(e){return Be[Le(e.year)?`leapyear`:`standard`][e.month-1]}getMonthsInYear(e){return 12}getDaysInYear(e){return Le(e.year)?366:365}getMaximumMonthsInYear(){return 12}getMaximumDaysInMonth(){return 31}getYearsInEra(e){return 9999}getEras(){return[`BC`,`AD`]}isInverseEra(e){return e.era===`BC`}balanceDate(e){e.year<=0&&(e.era=e.era===`BC`?`AD`:`BC`,e.year=1-e.year)}constructor(){this.identifier=`gregory`}},He={"001":1,AD:1,AE:6,AF:6,AI:1,AL:1,AM:1,AN:1,AR:1,AT:1,AU:1,AX:1,AZ:1,BA:1,BE:1,BG:1,BH:6,BM:1,BN:1,BY:1,CH:1,CL:1,CM:1,CN:1,CR:1,CY:1,CZ:1,DE:1,DJ:6,DK:1,DZ:6,EC:1,EE:1,EG:6,ES:1,FI:1,FJ:1,FO:1,FR:1,GB:1,GE:1,GF:1,GP:1,GR:1,HR:1,HU:1,IE:1,IQ:6,IR:6,IS:1,IT:1,JO:6,KG:1,KW:6,KZ:1,LB:1,LI:1,LK:1,LT:1,LU:1,LV:1,LY:6,MC:1,MD:1,ME:1,MK:1,MN:1,MQ:1,MV:5,MY:1,NL:1,NO:1,NZ:1,OM:6,PL:1,QA:6,RE:1,RO:1,RS:1,RU:1,SD:6,SE:1,SI:1,SK:1,SM:1,SY:6,TJ:1,TM:1,TR:1,UA:1,UY:1,UZ:1,VA:1,VN:1,XK:1};function Ue(e,t){return t=B(t,e.calendar),e.era===t.era&&e.year===t.year&&e.month===t.month&&e.day===t.day}function We(e,t){return t=B(t,e.calendar),e=ot(e),t=ot(t),e.era===t.era&&e.year===t.year&&e.month===t.month}function Ge(e,t){return qe(e.calendar,t.calendar)&&Ue(e,t)}function Ke(e,t){return qe(e.calendar,t.calendar)&&We(e,t)}function qe(e,t){return e.isEqual?.(t)??t.isEqual?.(e)??e.identifier===t.identifier}function Je(e,t){return Ue(e,Qe(t))}var Ye={sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6};function Xe(e,t,n){let r=e.calendar.toJulianDay(e),i=n?Ye[n]:ft(t),a=Math.ceil(r+1-i)%7;return a<0&&(a+=7),a}function Ze(e){return Ct(Date.now(),e)}function Qe(e){return wt(Ze(e))}function $e(e,t){return e.calendar.toJulianDay(e)-t.calendar.toJulianDay(t)}function et(e,t){return tt(e)-tt(t)}function tt(e){return e.hour*36e5+e.minute*6e4+e.second*1e3+e.millisecond}var nt=null,rt=!1;function it(){return nt??=new Intl.DateTimeFormat().resolvedOptions().timeZone,nt}function at(){return rt}function ot(e){return e.subtract({days:e.day-1})}function st(e){return e.add({days:e.calendar.getDaysInMonth(e)-e.day})}function ct(e){return ot(e.subtract({months:e.month-1}))}var lt=new Map,ut=new Map;function dt(e){if(Intl.Locale){let t=lt.get(e);return t||(t=new Intl.Locale(e).maximize().region,t&&lt.set(e,t)),t}let t=e.split(`-`)[1];return t===`u`?void 0:t}function ft(e){let t=ut.get(e);if(!t){if(Intl.Locale){let n=new Intl.Locale(e);if(`getWeekInfo`in n&&(t=n.getWeekInfo(),t))return ut.set(e,t),t.firstDay}let n=dt(e);if(e.includes(`-fw-`)){let n=e.split(`-fw-`)[1].split(`-`)[0];t=n===`mon`?{firstDay:1}:n===`tue`?{firstDay:2}:n===`wed`?{firstDay:3}:n===`thu`?{firstDay:4}:n===`fri`?{firstDay:5}:n===`sat`?{firstDay:6}:{firstDay:0}}else t=e.includes(`-ca-iso8601`)?{firstDay:1}:{firstDay:n&&He[n]||0};ut.set(e,t)}return t.firstDay}function pt(e){return e=B(e,new Ve),mt(Re(e.era,e.year),e.month,e.day,e.hour,e.minute,e.second,e.millisecond)}function mt(e,t,n,r,i,a,o){let s=new Date;return s.setUTCHours(r,i,a,o),s.setUTCFullYear(e,t-1,n),s.getTime()}function ht(e,t){if(t===`UTC`)return 0;if(e>0&&t===it()&&!at())return new Date(e).getTimezoneOffset()*-6e4;let{year:n,month:r,day:i,hour:a,minute:o,second:s}=_t(e,t);return mt(n,r,i,a,o,s,0)-Math.floor(e/1e3)*1e3}var gt=new Map;function _t(e,t){let n=gt.get(t);n||(n=new Intl.DateTimeFormat(`en-US`,{timeZone:t,hour12:!1,era:`short`,year:`numeric`,month:`numeric`,day:`numeric`,hour:`numeric`,minute:`numeric`,second:`numeric`}),gt.set(t,n));let r=n.formatToParts(new Date(e)),i={};for(let e of r)e.type!==`literal`&&(i[e.type]=e.value);return{year:i.era===`BC`||i.era===`B`?-i.year+1:+i.year,month:+i.month,day:+i.day,hour:i.hour===`24`?0:+i.hour,minute:+i.minute,second:+i.second}}var vt=864e5;function yt(e,t,n,r){return(n===r?[n]:[n,r]).filter(n=>bt(e,t,n))}function bt(e,t,n){let r=_t(n,t);return e.year===r.year&&e.month===r.month&&e.day===r.day&&e.hour===r.hour&&e.minute===r.minute&&e.second===r.second}function xt(e,t,n=`compatible`){let r=Tt(e);if(t===`UTC`)return pt(r);if(t===it()&&n===`compatible`&&!at()){r=B(r,new Ve);let e=new Date,t=Re(r.era,r.year);return e.setFullYear(t,r.month-1,r.day),e.setHours(r.hour,r.minute,r.second,r.millisecond),e.getTime()}let i=pt(r),a=ht(i-vt,t),o=ht(i+vt,t),s=yt(r,t,i-a,i-o);if(s.length===1)return s[0];if(s.length>1)switch(n){case`compatible`:case`earlier`:return s[0];case`later`:return s[s.length-1];case`reject`:throw RangeError(`Multiple possible absolute times found`)}switch(n){case`earlier`:return Math.min(i-a,i-o);case`compatible`:case`later`:return Math.max(i-a,i-o);case`reject`:throw RangeError(`No such absolute time found`)}}function St(e,t,n=`compatible`){return new Date(xt(e,t,n))}function Ct(e,t){let n=ht(e,t),r=new Date(e+n),i=r.getUTCFullYear(),a=r.getUTCMonth()+1,o=r.getUTCDate(),s=r.getUTCHours(),c=r.getUTCMinutes(),l=r.getUTCSeconds(),u=r.getUTCMilliseconds();return new an(i<1?`BC`:`AD`,i<1?-i+1:i,a,o,t,n,s,c,l,u)}function wt(e){return new V(e.calendar,e.era,e.year,e.month,e.day)}function Tt(e,t){let n=0,r=0,i=0,a=0;if(`timeZone`in e)({hour:n,minute:r,second:i,millisecond:a}=e);else if(`hour`in e&&!t)return e;return t&&({hour:n,minute:r,second:i,millisecond:a}=t),new rn(e.calendar,e.era,e.year,e.month,e.day,n,r,i,a)}function B(e,t){if(qe(e.calendar,t))return e;let n=t.fromJulianDay(e.calendar.toJulianDay(e)),r=e.copy();return r.calendar=t,r.era=n.era,r.year=n.year,r.month=n.month,r.day=n.day,Ft(r),r}function Et(e,t,n){return e instanceof an?e.timeZone===t?e:Ot(e,t):Ct(xt(e,t,n),t)}function Dt(e){let t=pt(e)-e.offset;return new Date(t)}function Ot(e,t){return B(Ct(pt(e)-e.offset,t),e.calendar)}var kt=36e5;function At(e,t){let n=e.copy(),r=`hour`in n?Ut(n,t):0;jt(n,t.years||0),n.calendar.balanceYearMonth&&n.calendar.balanceYearMonth(n,e),n.month+=t.months||0,Mt(n),Pt(n),n.day+=(t.weeks||0)*7,n.day+=t.days||0,n.day+=r,Nt(n),n.calendar.balanceDate&&n.calendar.balanceDate(n),n.year<1&&(n.year=1,n.month=1,n.day=1);let i=n.calendar.getYearsInEra(n);if(n.year>i){let e=n.calendar.isInverseEra?.(n);n.year=i,n.month=e?1:n.calendar.getMonthsInYear(n),n.day=e?1:n.calendar.getDaysInMonth(n)}n.month<1&&(n.month=1,n.day=1);let a=n.calendar.getMonthsInYear(n);return n.month>a&&(n.month=a,n.day=n.calendar.getDaysInMonth(n)),n.day=Math.max(1,Math.min(n.calendar.getDaysInMonth(n),n.day)),n}function jt(e,t){e.calendar.isInverseEra?.(e)&&(t=-t),e.year+=t}function Mt(e){for(;e.month<1;)jt(e,-1),e.month+=e.calendar.getMonthsInYear(e);let t=0;for(;e.month>(t=e.calendar.getMonthsInYear(e));)e.month-=t,jt(e,1)}function Nt(e){for(;e.day<1;)e.month--,Mt(e),e.day+=e.calendar.getDaysInMonth(e);for(;e.day>e.calendar.getDaysInMonth(e);)e.day-=e.calendar.getDaysInMonth(e),e.month++,Mt(e)}function Pt(e){e.month=Math.max(1,Math.min(e.calendar.getMonthsInYear(e),e.month)),e.day=Math.max(1,Math.min(e.calendar.getDaysInMonth(e),e.day))}function Ft(e){e.calendar.constrainDate&&e.calendar.constrainDate(e),e.year=Math.max(1,Math.min(e.calendar.getYearsInEra(e),e.year)),Pt(e)}function It(e){let t={};for(let n in e)typeof e[n]==`number`&&(t[n]=-e[n]);return t}function Lt(e,t){return At(e,It(t))}function Rt(e,t){let n=e.copy();return t.era!=null&&(n.era=t.era),t.year!=null&&(n.year=t.year),t.month!=null&&(n.month=t.month),t.day!=null&&(n.day=t.day),Ft(n),n}function zt(e,t){let n=e.copy();return t.hour!=null&&(n.hour=t.hour),t.minute!=null&&(n.minute=t.minute),t.second!=null&&(n.second=t.second),t.millisecond!=null&&(n.millisecond=t.millisecond),Vt(n),n}function Bt(e){e.second+=Math.floor(e.millisecond/1e3),e.millisecond=Ht(e.millisecond,1e3),e.minute+=Math.floor(e.second/60),e.second=Ht(e.second,60),e.hour+=Math.floor(e.minute/60),e.minute=Ht(e.minute,60);let t=Math.floor(e.hour/24);return e.hour=Ht(e.hour,24),t}function Vt(e){e.millisecond=Math.max(0,Math.min(e.millisecond,1e3)),e.second=Math.max(0,Math.min(e.second,59)),e.minute=Math.max(0,Math.min(e.minute,59)),e.hour=Math.max(0,Math.min(e.hour,23))}function Ht(e,t){let n=e%t;return n<0&&(n+=t),n}function Ut(e,t){return e.hour+=t.hours||0,e.minute+=t.minutes||0,e.second+=t.seconds||0,e.millisecond+=t.milliseconds||0,Bt(e)}function Wt(e,t,n,r){let i=e.copy();switch(t){case`era`:{let t=e.calendar.getEras(),a=t.indexOf(e.era);if(a<0)throw Error(`Invalid era: `+e.era);a=Kt(a,n,0,t.length-1,r?.round),i.era=t[a],Ft(i);break}case`year`:i.calendar.isInverseEra?.(i)&&(n=-n),i.year=Kt(e.year,n,-1/0,9999,r?.round),i.year===-1/0&&(i.year=1),i.calendar.balanceYearMonth&&i.calendar.balanceYearMonth(i,e);break;case`month`:i.month=Kt(e.month,n,1,e.calendar.getMonthsInYear(e),r?.round);break;case`day`:i.day=Kt(e.day,n,1,e.calendar.getDaysInMonth(e),r?.round);break;default:throw Error(`Unsupported field `+t)}return e.calendar.balanceDate&&e.calendar.balanceDate(i),Ft(i),i}function Gt(e,t,n,r){let i=e.copy();switch(t){case`hour`:{let t=e.hour,a=0,o=23;if(r?.hourCycle===12){let e=t>=12;a=e?12:0,o=e?23:11}i.hour=Kt(t,n,a,o,r?.round);break}case`minute`:i.minute=Kt(e.minute,n,0,59,r?.round);break;case`second`:i.second=Kt(e.second,n,0,59,r?.round);break;case`millisecond`:i.millisecond=Kt(e.millisecond,n,0,999,r?.round);break;default:throw Error(`Unsupported field `+t)}return i}function Kt(e,t,n,r,i=!1){if(i){e+=Math.sign(t),e<n&&(e=r);let i=Math.abs(t);e=t>0?Math.ceil(e/i)*i:Math.floor(e/i)*i,e>r&&(e=n)}else e+=t,e<n?e=r-(n-e-1):e>r&&(e=n+(e-r-1));return e}function qt(e,t){let n;return n=t.years!=null&&t.years!==0||t.months!=null&&t.months!==0||t.weeks!=null&&t.weeks!==0||t.days!=null&&t.days!==0?xt(At(Tt(e),{years:t.years,months:t.months,weeks:t.weeks,days:t.days}),e.timeZone):pt(e)-e.offset,n+=t.milliseconds||0,n+=(t.seconds||0)*1e3,n+=(t.minutes||0)*6e4,n+=(t.hours||0)*36e5,B(Ct(n,e.timeZone),e.calendar)}function Jt(e,t){return qt(e,It(t))}function Yt(e,t,n,r){switch(t){case`hour`:{let t=0,i=23;if(r?.hourCycle===12){let n=e.hour>=12;t=n?12:0,i=n?23:11}let a=Tt(e),o=B(zt(a,{hour:t}),new Ve),s=[xt(o,e.timeZone,`earlier`),xt(o,e.timeZone,`later`)].filter(t=>Ct(t,e.timeZone).day===o.day)[0],c=B(zt(a,{hour:i}),new Ve),l=[xt(c,e.timeZone,`earlier`),xt(c,e.timeZone,`later`)].filter(t=>Ct(t,e.timeZone).day===c.day).pop(),u=pt(e)-e.offset,d=Math.floor(u/kt),f=u%kt;return u=Kt(d,n,Math.floor(s/kt),Math.floor(l/kt),r?.round)*kt+f,B(Ct(u,e.timeZone),e.calendar)}case`minute`:case`second`:case`millisecond`:return Gt(e,t,n,r);case`era`:case`year`:case`month`:case`day`:return B(Ct(xt(Wt(Tt(e),t,n,r),e.timeZone),e.timeZone),e.calendar);default:throw Error(`Unsupported field `+t)}}function Xt(e,t,n){let r=Tt(e),i=zt(Rt(r,t),t);return i.compare(r)===0?e:B(Ct(xt(i,e.timeZone,n),e.timeZone),e.calendar)}function Zt(e){return`${String(e.hour).padStart(2,`0`)}:${String(e.minute).padStart(2,`0`)}:${String(e.second).padStart(2,`0`)}${e.millisecond?String(e.millisecond/1e3).slice(1):``}`}function Qt(e){let t=B(e,new Ve),n;return n=t.era===`BC`?t.year===1?`0000`:`-`+String(Math.abs(1-t.year)).padStart(6,`00`):String(t.year).padStart(4,`0`),`${n}-${String(t.month).padStart(2,`0`)}-${String(t.day).padStart(2,`0`)}`}function $t(e){return`${Qt(e)}T${Zt(e)}`}function en(e){let t=Math.sign(e)<0?`-`:`+`;e=Math.abs(e);let n=Math.floor(e/36e5),r=Math.floor(e%36e5/6e4),i=Math.floor(e%36e5%6e4/1e3),a=`${t}${String(n).padStart(2,`0`)}:${String(r).padStart(2,`0`)}`;return i!==0&&(a+=`:${String(i).padStart(2,`0`)}`),a}function tn(e){return`${$t(e)}${en(e.offset)}[${e.timeZone}]`}function nn(e){let t=typeof e[0]==`object`?e.shift():new Ve,n;if(typeof e[0]==`string`)n=e.shift();else{let e=t.getEras();n=e[e.length-1]}let r=e.shift(),i=e.shift(),a=e.shift();return[t,n,r,i,a]}var V=class e{constructor(...e){let[t,n,r,i,a]=nn(e);this.calendar=t,this.era=n,this.year=r,this.month=i,this.day=a,Ft(this)}copy(){return this.era?new e(this.calendar,this.era,this.year,this.month,this.day):new e(this.calendar,this.year,this.month,this.day)}add(e){return At(this,e)}subtract(e){return Lt(this,e)}set(e){return Rt(this,e)}cycle(e,t,n){return Wt(this,e,t,n)}toDate(e){return St(this,e)}toString(){return Qt(this)}compare(e){return $e(this,e)}},rn=class e{constructor(...e){let[t,n,r,i,a]=nn(e);this.calendar=t,this.era=n,this.year=r,this.month=i,this.day=a,this.hour=e.shift()||0,this.minute=e.shift()||0,this.second=e.shift()||0,this.millisecond=e.shift()||0,Ft(this)}copy(){return this.era?new e(this.calendar,this.era,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond):new e(this.calendar,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond)}add(e){return At(this,e)}subtract(e){return Lt(this,e)}set(e){return Rt(zt(this,e),e)}cycle(e,t,n){switch(e){case`era`:case`year`:case`month`:case`day`:return Wt(this,e,t,n);default:return Gt(this,e,t,n)}}toDate(e,t){return St(this,e,t)}toString(){return $t(this)}compare(e){let t=$e(this,e);return t===0?et(this,Tt(e)):t}},an=class e{constructor(...e){let[t,n,r,i,a]=nn(e),o=e.shift(),s=e.shift();this.calendar=t,this.era=n,this.year=r,this.month=i,this.day=a,this.timeZone=o,this.offset=s,this.hour=e.shift()||0,this.minute=e.shift()||0,this.second=e.shift()||0,this.millisecond=e.shift()||0,Ft(this)}copy(){return this.era?new e(this.calendar,this.era,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond):new e(this.calendar,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond)}add(e){return qt(this,e)}subtract(e){return Jt(this,e)}set(e,t){return Xt(this,e,t)}cycle(e,t,n){return Yt(this,e,t,n)}toDate(){return Dt(this)}toString(){return tn(this)}toAbsoluteString(){return this.toDate().toISOString()}compare(e){return this.toDate().getTime()-Et(e,this.timeZone).toDate().getTime()}},on=[[1868,9,8],[1912,7,30],[1926,12,25],[1989,1,8],[2019,5,1]],sn=[[1912,7,29],[1926,12,24],[1989,1,7],[2019,4,30]],cn=[1867,1911,1925,1988,2018],ln=[`meiji`,`taisho`,`showa`,`heisei`,`reiwa`];function un(e){let t=on.findIndex(([t,n,r])=>e.year<t||e.year===t&&e.month<n||e.year===t&&e.month===n&&e.day<r);return t===-1?on.length-1:t===0?0:t-1}function dn(e){let t=cn[ln.indexOf(e.era)];if(!t)throw Error(`Unknown era: `+e.era);return new V(e.year+t,e.month,e.day)}var fn=class extends Ve{fromJulianDay(e){let t=super.fromJulianDay(e),n=un(t);return new V(this,ln[n],t.year-cn[n],t.month,t.day)}toJulianDay(e){return super.toJulianDay(dn(e))}balanceDate(e){let t=dn(e),n=un(t);ln[n]!==e.era&&(e.era=ln[n],e.year=t.year-cn[n]),this.constrainDate(e)}constrainDate(e){let t=ln.indexOf(e.era),n=sn[t];if(n!=null){let[r,i,a]=n,o=r-cn[t];e.year=Math.max(1,Math.min(o,e.year)),e.year===o&&(e.month=Math.min(i,e.month),e.month===i&&(e.day=Math.min(a,e.day)))}if(e.year===1&&t>=0){let[,n,r]=on[t];e.month=Math.max(n,e.month),e.month===n&&(e.day=Math.max(r,e.day))}}getEras(){return ln}getYearsInEra(e){let t=ln.indexOf(e.era),n=on[t],r=on[t+1];if(r==null)return 9999-n[0]+1;let i=r[0]-n[0];return(e.month<r[1]||e.month===r[1]&&e.day<r[2])&&i++,i}getDaysInMonth(e){return super.getDaysInMonth(dn(e))}getMinimumMonthInYear(e){let t=pn(e);return t?t[1]:1}getMinimumDayInMonth(e){let t=pn(e);return t&&e.month===t[1]?t[2]:1}constructor(...e){super(...e),this.identifier=`japanese`}};function pn(e){if(e.year===1)return on[ln.indexOf(e.era)]}var mn=-543,hn=class extends Ve{fromJulianDay(e){let t=super.fromJulianDay(e),n=Re(t.era,t.year);return new V(this,n-mn,t.month,t.day)}toJulianDay(e){return super.toJulianDay(gn(e))}getEras(){return[`BE`]}getDaysInMonth(e){return super.getDaysInMonth(gn(e))}balanceDate(){}constructor(...e){super(...e),this.identifier=`buddhist`}};function gn(e){let[t,n]=ze(e.year+mn);return new V(t,n,e.month,e.day)}var _n=1911;function vn(e){return e.era===`minguo`?e.year+_n:1-e.year+_n}function yn(e){let t=e-_n;return t>0?[`minguo`,t]:[`before_minguo`,1-t]}var bn=class extends Ve{fromJulianDay(e){let t=super.fromJulianDay(e),[n,r]=yn(Re(t.era,t.year));return new V(this,n,r,t.month,t.day)}toJulianDay(e){return super.toJulianDay(xn(e))}getEras(){return[`before_minguo`,`minguo`]}balanceDate(e){let[t,n]=yn(vn(e));e.era=t,e.year=n}isInverseEra(e){return e.era===`before_minguo`}getDaysInMonth(e){return super.getDaysInMonth(xn(e))}getYearsInEra(e){return e.era===`before_minguo`?9999:9999-_n}constructor(...e){super(...e),this.identifier=`roc`}};function xn(e){let[t,n]=ze(vn(e));return new V(t,n,e.month,e.day)}var Sn=1948320,Cn=[0,31,62,93,124,155,186,216,246,276,306,336],wn=class{fromJulianDay(e){let t=e-Sn,n=1+Math.floor((33*t+3)/12053),r=t-(365*(n-1)+Math.floor((8*n+21)/33)),i=Math.floor(r<216?r/31:(r-6)/30),a=r-Cn[i]+1;return new V(this,n,i+1,a)}toJulianDay(e){let t=Sn-1+365*(e.year-1)+Math.floor((8*e.year+21)/33);return t+=Cn[e.month-1],t+=e.day,t}getMonthsInYear(){return 12}getDaysInMonth(e){return e.month<=6?31:e.month<=11||Pe(25*e.year+11,33)<8?30:29}getMaximumMonthsInYear(){return 12}getMaximumDaysInMonth(){return 31}getEras(){return[`AP`]}getYearsInEra(){return 9377}constructor(){this.identifier=`persian`}},Tn=78,En=80,Dn=class extends Ve{fromJulianDay(e){let t=super.fromJulianDay(e),n=t.year-Tn,r=e-Ie(t.era,t.year,1,1),i;r<En?(n--,i=Le(t.year-1)?31:30,r+=i+155+90+10):(i=Le(t.year)?31:30,r-=En);let a,o;if(r<i)a=1,o=r+1;else{let e=r-i;e<155?(a=Math.floor(e/31)+2,o=e%31+1):(e-=155,a=Math.floor(e/30)+7,o=e%30+1)}return new V(this,n,a,o)}toJulianDay(e){let[t,n]=ze(e.year+Tn),r,i;return Le(n)?(r=31,i=Ie(t,n,3,21)):(r=30,i=Ie(t,n,3,22)),e.month===1?i+e.day-1:(i+=r+Math.min(e.month-2,5)*31,e.month>=8&&(i+=(e.month-7)*30),i+=e.day-1,i)}getDaysInMonth(e){return e.month===1&&Le(e.year+Tn)||e.month>=2&&e.month<=6?31:30}getYearsInEra(){return 9919}getEras(){return[`saka`]}balanceDate(){}constructor(...e){super(...e),this.identifier=`indian`}},On=1948440,kn=1948439,An=1300,jn=1600,Mn=460322;function Nn(e,t,n,r){return r+Math.ceil(29.5*(n-1))+(t-1)*354+Math.floor((3+11*t)/30)+e-1}function Pn(e,t,n){let r=Math.floor((30*(n-t)+10646)/10631),i=Math.min(12,Math.ceil((n-(29+Nn(t,r,1,1)))/29.5)+1);return new V(e,r,i,n-Nn(t,r,i,1)+1)}function Fn(e){return(14+11*e)%30<11}var In=class{fromJulianDay(e){return Pn(this,On,e)}toJulianDay(e){return Nn(On,e.year,e.month,e.day)}getDaysInMonth(e){let t=29+e.month%2;return e.month===12&&Fn(e.year)&&t++,t}getMonthsInYear(){return 12}getDaysInYear(e){return Fn(e.year)?355:354}getMaximumMonthsInYear(){return 12}getMaximumDaysInMonth(){return 30}getYearsInEra(){return 9665}getEras(){return[`AH`]}constructor(){this.identifier=`islamic-civil`}},Ln=class extends In{fromJulianDay(e){return Pn(this,kn,e)}toJulianDay(e){return Nn(kn,e.year,e.month,e.day)}constructor(...e){super(...e),this.identifier=`islamic-tbla`}},Rn=`qgpUDckO1AbqBmwDrQpVBakGkgepC9QF2gpcBS0NlQZKB1QLagutBa4ETwoXBYsGpQbVCtYCWwmdBE0KJg2VDawFtgm6AlsKKwWVCsoG6Qr0AnYJtgJWCcoKpAvSC9kF3AJtCU0FpQpSC6ULtAW2CVcFlwJLBaMGUgdlC2oFqworBZUMSg2lDcoF1gpXCasESwmlClILagt1BXYCtwhbBFUFqQW0BdoJ3QRuAjYJqgpUDbIN1QXaAlsJqwRVCkkLZAtxC7QFtQpVCiUNkg7JDtQG6QprCasEkwpJDaQNsg25CroEWworBZUKKgtVC1wFvQQ9Ah0JlQpKC1oLbQW2AjsJmwRVBqkGVAdqC2wFrQpVBSkLkgupC9QF2gpaBasKlQVJB2QHqgu1BbYCVgpNDiULUgtqC60FrgIvCZcESwalBqwG1gpdBZ0ETQoWDZUNqgW1BdoCWwmtBJUFygbkBuoK9QS2AlYJqgpUC9IL2QXqAm0JrQSVCkoLpQuyBbUJ1gSXCkcFkwZJB1ULagVrCisFiwpGDaMNygXWCtsEawJLCaUKUgtpC3UFdgG3CFsCKwVlBbQF2gntBG0BtgimClINqQ3UBdoKWwmrBFMGKQdiB6kLsgW1ClUFJQuSDckO0gbpCmsFqwRVCikNVA2qDbUJugQ7CpsETQqqCtUK2gJdCV4ELgqaDFUNsga5BroEXQotBZUKUguoC7QLuQXaAloJSgukDdEO6AZqC20FNQWVBkoNqA3UDdoGWwWdAisGFQtKC5ULqgWuCi4JjwwnBZUGqgbWCl0FnQI=`,zn,Bn;function Vn(e){return Mn+Bn[e-An]}function Hn(e,t){let n=e-An,r=1<<11-(t-1);return(zn[n]&r)===0?29:30}function Un(e,t){let n=Vn(e);for(let r=1;r<t;r++)n+=Hn(e,r);return n}function Wn(e){return Bn[e+1-An]-Bn[e-An]}var Gn=class extends In{constructor(){if(super(),this.identifier=`islamic-umalqura`,zn||=new Uint16Array(Uint8Array.from(atob(Rn),e=>e.charCodeAt(0)).buffer),!Bn){Bn=new Uint32Array(jn-An+1);let e=0;for(let t=An;t<=jn;t++){Bn[t-An]=e;for(let n=1;n<=12;n++)e+=Hn(t,n)}}}fromJulianDay(e){let t=e-On,n=Vn(An),r=Vn(jn);if(t<n||t>r)return super.fromJulianDay(e);{let e=An-1,n=1,r=1;for(;r>0;){e++,r=t-Vn(e)+1;let i=Wn(e);if(r===i){n=12;break}else if(r<i){let t=Hn(e,n);for(n=1;r>t;)r-=t,n++,t=Hn(e,n);break}}return new V(this,e,n,t-Un(e,n)+1)}}toJulianDay(e){return e.year<An||e.year>jn?super.toJulianDay(e):On+Un(e.year,e.month)+(e.day-1)}getDaysInMonth(e){return e.year<An||e.year>jn?super.getDaysInMonth(e):Hn(e.year,e.month)}getDaysInYear(e){return e.year<An||e.year>jn?super.getDaysInYear(e):Wn(e.year)}},Kn=347997,qn=1080,Jn=24*qn,Yn=29,Xn=12*qn+793,Zn=Yn*Jn+Xn;function Qn(e){return Pe(e*7+1,19)<7}function $n(e){let t=Math.floor((235*e-234)/19),n=12084+13753*t,r=t*29+Math.floor(n/25920);return Pe(3*(r+1),7)<3&&(r+=1),r}function er(e){let t=$n(e-1),n=$n(e);return $n(e+1)-n===356?2:+(n-t===382)}function tr(e){return $n(e)+er(e)}function nr(e){return tr(e+1)-tr(e)}function rr(e){let t=nr(e);switch(t>380&&(t-=30),t){case 353:return 0;case 354:return 1;case 355:return 2}}function ir(e,t){if(t>=6&&!Qn(e)&&t++,t===4||t===7||t===9||t===11||t===13)return 29;let n=rr(e);return t===2?n===2?30:29:t===3?n===0?29:30:t===6?Qn(e)?30:0:30}var ar=class{fromJulianDay(e){let t=e-Kn,n=t*Jn/Zn,r=Math.floor((19*n+234)/235)+1,i=tr(r),a=Math.floor(t-i);for(;a<1;)r--,i=tr(r),a=Math.floor(t-i);let o=1,s=0;for(;s<a;)s+=ir(r,o),o++;o--,s-=ir(r,o);let c=a-s;return new V(this,r,o,c)}toJulianDay(e){let t=tr(e.year);for(let n=1;n<e.month;n++)t+=ir(e.year,n);return t+e.day+Kn}getDaysInMonth(e){return ir(e.year,e.month)}getMonthsInYear(e){return Qn(e.year)?13:12}getDaysInYear(e){return nr(e.year)}getMaximumMonthsInYear(){return 13}getMaximumDaysInMonth(){return 30}getYearsInEra(){return 9999}getEras(){return[`AM`]}balanceYearMonth(e,t){t.year!==e.year&&(Qn(t.year)&&!Qn(e.year)&&t.month>6?e.month--:!Qn(t.year)&&Qn(e.year)&&t.month>6&&e.month++)}constructor(){this.identifier=`hebrew`}},or=1723856,sr=1824665,cr=5500;function lr(e,t,n,r){return e+365*t+Math.floor(t/4)+30*(n-1)+r-1}function ur(e,t){let n=Math.floor(4*(t-e)/1461),r=1+Math.floor((t-lr(e,n,1,1))/30);return[n,r,t+1-lr(e,n,r,1)]}function dr(e){return Math.floor(e%4/3)}function fr(e,t){return t%13==0?dr(e)+5:30}var pr=class{fromJulianDay(e){let[t,n,r]=ur(or,e),i=`AM`;return t<=0&&(i=`AA`,t+=cr),new V(this,i,t,n,r)}toJulianDay(e){let t=e.year;return e.era===`AA`&&(t-=cr),lr(or,t,e.month,e.day)}getDaysInMonth(e){return fr(e.year,e.month)}getMonthsInYear(){return 13}getDaysInYear(e){return 365+dr(e.year)}getMaximumMonthsInYear(){return 13}getMaximumDaysInMonth(){return 30}getYearsInEra(e){return e.era===`AA`?9999:9991}getEras(){return[`AA`,`AM`]}constructor(){this.identifier=`ethiopic`}},mr=class extends pr{fromJulianDay(e){let[t,n,r]=ur(or,e);return t+=cr,new V(this,`AA`,t,n,r)}getEras(){return[`AA`]}getYearsInEra(){return 9999}constructor(...e){super(...e),this.identifier=`ethioaa`}},hr=class extends pr{fromJulianDay(e){let[t,n,r]=ur(sr,e),i=`CE`;return t<=0&&(i=`BCE`,t=1-t),new V(this,i,t,n,r)}toJulianDay(e){let t=e.year;return e.era===`BCE`&&(t=1-t),lr(sr,t,e.month,e.day)}getDaysInMonth(e){let t=e.year;return e.era===`BCE`&&(t=1-t),fr(t,e.month)}isInverseEra(e){return e.era===`BCE`}balanceDate(e){e.year<=0&&(e.era=e.era===`BCE`?`CE`:`BCE`,e.year=1-e.year)}getEras(){return[`BCE`,`CE`]}getYearsInEra(e){return e.era===`BCE`?9999:9715}constructor(...e){super(...e),this.identifier=`coptic`}};function gr(e){switch(e){case`buddhist`:return new hn;case`ethiopic`:return new pr;case`ethioaa`:return new mr;case`coptic`:return new hr;case`hebrew`:return new ar;case`indian`:return new Dn;case`islamic-civil`:return new In;case`islamic-tbla`:return new Ln;case`islamic-umalqura`:return new Gn;case`japanese`:return new fn;case`persian`:return new wn;case`roc`:return new bn;default:return new Ve}}var _r=new Map,vr=class{constructor(e,t={}){this.formatter=br(e,t),this.options=t}format(e){return this.formatter.format(e)}formatToParts(e){return this.formatter.formatToParts(e)}formatRange(e,t){if(typeof this.formatter.formatRange==`function`)return this.formatter.formatRange(e,t);if(t<e)throw RangeError(`End date must be >= start date`);return`${this.formatter.format(e)} \u{2013} ${this.formatter.format(t)}`}formatRangeToParts(e,t){if(typeof this.formatter.formatRangeToParts==`function`)return this.formatter.formatRangeToParts(e,t);if(t<e)throw RangeError(`End date must be >= start date`);let n=this.formatter.formatToParts(e),r=this.formatter.formatToParts(t);return[...n.map(e=>({...e,source:`startRange`})),{type:`literal`,value:` – `,source:`shared`},...r.map(e=>({...e,source:`endRange`}))]}resolvedOptions(){let e=this.formatter.resolvedOptions();return wr()&&(this.resolvedHourCycle||=Tr(e.locale,this.options),e.hourCycle=this.resolvedHourCycle,e.hour12=this.resolvedHourCycle===`h11`||this.resolvedHourCycle===`h12`),e.calendar===`ethiopic-amete-alem`&&(e.calendar=`ethioaa`),e}},yr={true:{ja:`h11`},false:{}};function br(e,t={}){if(typeof t.hour12==`boolean`&&Sr()){t={...t};let n=yr[String(t.hour12)][e.split(`-`)[0]],r=t.hour12?`h12`:`h23`;t.hourCycle=n??r,delete t.hour12}let n=e+(t?Object.entries(t).sort((e,t)=>e[0]<t[0]?-1:1).join():``);if(_r.has(n))return _r.get(n);let r=new Intl.DateTimeFormat(e,t);return _r.set(n,r),r}var xr=null;function Sr(){return xr??=new Intl.DateTimeFormat(`en-US`,{hour:`numeric`,hour12:!1}).format(new Date(2020,2,3,0))===`24`,xr}var Cr=null;function wr(){return Cr??=new Intl.DateTimeFormat(`fr`,{hour:`numeric`,hour12:!1}).resolvedOptions().hourCycle===`h12`,Cr}function Tr(e,t){if(!t.timeStyle&&!t.hour)return;e=e.replace(/(-u-)?-nu-[a-zA-Z0-9]+/,``),e+=(e.includes(`-u-`)?``:`-u`)+`-nu-latn`;let n=br(e,{...t,timeZone:void 0}),r=parseInt(n.formatToParts(new Date(2020,2,3,0)).find(e=>e.type===`hour`).value,10),i=parseInt(n.formatToParts(new Date(2020,2,3,23)).find(e=>e.type===`hour`).value,10);if(r===0&&i===23)return`h23`;if(r===24&&i===23)return`h24`;if(r===0&&i===11)return`h11`;if(r===12&&i===11)return`h12`;throw Error(`Unexpected hour cycle result`)}function H(e,t=it()){return Dr(e)?e.toDate():e.toDate(t)}function Er(e){return e instanceof rn}function Dr(e){return e instanceof an}function Or(e){return Er(e)||Dr(e)}function kr(e){if(e instanceof Date){let t=e.getFullYear(),n=e.getMonth()+1;return new Date(t,n,0).getDate()}else return e.set({day:100}).day}function Ar(e,t){return e.compare(t)<0}function jr(e,t){return e.compare(t)>0}function Mr(e,t,n){let r=Xe(e,n,`sun`);return t>r?e.subtract({days:r+7-t}):t===r?e:e.subtract({days:r-t})}function Nr(e,t,n){let r=Xe(e,n,`sun`),i=t===0?6:t-1;return r===i?e:r>i?e.add({days:7-r+i}):e.add({days:i-r})}function Pr(e){let{defaultValue:t,defaultPlaceholder:n,granularity:r=`day`,locale:i=`en`}=e;if(Array.isArray(t)&&t.length)return t.at(-1).copy();if(t&&!Array.isArray(t))return t.copy();if(n)return n.copy();let a=new Date,o=a.getFullYear(),s=a.getMonth()+1,c=a.getDate(),l=[`hour`,`minute`,`second`],u=gr(new vr(i).resolvedOptions().calendar);return l.includes(r??`day`)?B(new rn(o,s,c,0,0,0),u):B(new V(o,s,c),u)}function Fr(e,t){let n=[];for(let r=0;r<e.length;r+=t)n.push(e.slice(r,r+t));return n}function Ir(e){let t=e.querySelector(`[data-selected]`);if(t)return t.focus();let n=e.querySelector(`[data-today]`);if(n)return n.focus();let r=e.querySelector(`[data-reka-calendar-day]`);if(r)return r.focus()}function Lr(e,t){let n=[],r=e.add({days:1}),i=t;for(;r.compare(i)<0;)n.push(r),r=r.add({days:1});return n}function Rr(e){let{dateObj:t,weekStartsOn:n,fixedWeeks:r,locale:i}=e,a=kr(t),o=Array.from({length:a},(e,n)=>t.set({day:n+1})),s=ot(t),c=st(t),l=Mr(s,n,i),u=Nr(c,n,i),d=Lr(l.subtract({days:1}),s),f=Lr(c,u.add({days:1})),p=d.length+o.length+f.length;if(r&&p<42){let e=42-p,n=f.at(-1);n||=st(t);let r=Array.from({length:e},(e,t)=>{let r=t+1;return n.add({days:r})});f.push(...r)}let m=d.concat(o,f);return{value:t,cells:m,rows:Fr(m,7)}}function zr(e){let{dateObj:t,numberOfMonths:n=1,pagedNavigation:r=!1}=e;return n&&r?Array.from({length:Math.floor(12/n)},(e,r)=>ot(t.set({month:r*n+1}))):Array.from({length:12},(e,n)=>ot(t.set({month:n+1})))}function Br(e){let{numberOfMonths:t,dateObj:n,...r}=e,i=[];if(!t||t===1)return i.push(Rr({...r,dateObj:n})),i;i.push(Rr({...r,dateObj:n}));for(let e=1;e<t;e++){let t=n.add({months:e});i.push(Rr({...r,dateObj:t}))}return i}function Vr({start:e,end:t}){let n=[];if(!e||!t)return n;let r=ct(e);for(;r.compare(t)<=0;)n.push(r),r=ct(r.add({years:1}));return n}function Hr(e){return(1-Xe(new V(2025,1,6),e)+7)%7}function Ur(e,t={}){let n=R(e);function r(){return n.value}function i(e){n.value=e}function a(e,r){return new vr(n.value,{...t,...r}).format(e)}function o(e,t=!0){return Or(e)&&t?a(H(e),{dateStyle:`long`,timeStyle:`long`}):a(H(e),{dateStyle:`long`})}function s(e,r={}){return new vr(n.value,{...t,month:`long`,year:`numeric`,...r}).format(e)}function c(e,r={}){return new vr(n.value,{...t,month:`long`,...r}).format(e)}function l(){let e=Qe(it());return[1,2,3,4,5,6,7,8,9,10,11,12].map(t=>({label:c(H(e.set({month:t}))),value:t}))}function u(e,r={}){return new vr(n.value,{...t,year:`numeric`,...r}).format(e)}function d(e,r){return Dr(e)?new vr(n.value,{...t,...r,timeZone:e.timeZone}).formatToParts(H(e)):new vr(n.value,{...t,...r}).formatToParts(H(e))}function f(e,r=`narrow`){return new vr(n.value,{...t,weekday:r}).format(e)}function p(e){let r=new vr(n.value,{...t,hour:`numeric`,minute:`numeric`}).formatToParts(e).find(e=>e.type===`dayPeriod`)?.value;return r===`PM`||r===`pm`||r===`p.m.`?`PM`:`AM`}let m={year:`numeric`,month:`numeric`,day:`numeric`,hour:`numeric`,minute:`numeric`,second:`numeric`};function h(e,t,n={}){let r=d(e,{...m,...n}).find(e=>e.type===t);return r?r.value:``}return{setLocale:i,getLocale:r,fullMonth:c,fullYear:u,fullMonthAndYear:s,toParts:d,custom:a,part:h,dayPeriod:p,selectedDate:o,dayOfWeek:f,getMonths:l}}function Wr(){return{ALT:`Alt`,ARROW_DOWN:`ArrowDown`,ARROW_LEFT:`ArrowLeft`,ARROW_RIGHT:`ArrowRight`,ARROW_UP:`ArrowUp`,BACKSPACE:`Backspace`,CAPS_LOCK:`CapsLock`,CONTROL:`Control`,DELETE:`Delete`,END:`End`,ENTER:`Enter`,ESCAPE:`Escape`,F1:`F1`,F10:`F10`,F11:`F11`,F12:`F12`,F2:`F2`,F3:`F3`,F4:`F4`,F5:`F5`,F6:`F6`,F7:`F7`,F8:`F8`,F9:`F9`,HOME:`Home`,META:`Meta`,PAGE_DOWN:`PageDown`,PAGE_UP:`PageUp`,SHIFT:`Shift`,SPACE:` `,TAB:`Tab`,CTRL:`Control`,ASTERISK:`*`,SPACE_CODE:`Space`}}function Gr(e){let t=Ce({locale:R(`en`)});return l(()=>e?.value||t.locale?.value||`en`)}function Kr(e){function t(t){return Array.isArray(e.date.value)?e.date.value.some(e=>Ue(e,t)):e.date.value?Ue(e.date.value,t):!1}return{isDateSelected:t,isInvalid:l(()=>{if(Array.isArray(e.date.value)){if(!e.date.value.length)return!1;for(let t of e.date.value)if(e.isDateDisabled?.(t)||e.isDateUnavailable?.(t))return!0}else{if(!e.date.value)return!1;if(e.isDateDisabled?.(e.date.value)||e.isDateUnavailable?.(e.date.value))return!0}return!1}),hasSelectedDate:l(()=>Array.isArray(e.date.value)?e.date.value.length>0:!!e.date.value),isSelectedDateDisabled:l(()=>Array.isArray(e.date.value)?e.date.value.length?e.date.value.some(t=>e.isDateDisabled?.(t)):!1:e.date.value?!!e.isDateDisabled?.(e.date.value):!1)}}function qr(e,t){let n=t(e),r=n.compare(e),i={};return r>=7&&(i.day=1),r>=kr(e)&&(i.month=1),n.set({...i})}function Jr(e,t){let n=t(e),r=e.compare(n),i={};return r>=7&&(i.day=35),r>=kr(e)&&(i.month=13),n.set({...i})}function Yr(e,t){return t(e)}function Xr(e,t){return t(e)}function Zr(e){let t=Ur(e.locale.value),n=l(()=>{let t={calendar:e.placeholder.value.calendar.identifier};return e.placeholder.value.calendar.identifier===`gregory`&&e.placeholder.value.era===`BC`&&(t.era=`short`),t}),r=R(Br({dateObj:e.placeholder.value,weekStartsOn:e.weekStartsOn.value,locale:e.locale.value,fixedWeeks:e.fixedWeeks.value,numberOfMonths:e.numberOfMonths.value})),i=l(()=>r.value.map(e=>e.value));function a(e){return!i.value.some(t=>Ke(e,t))}let o=t=>{if(!e.maxValue.value||!r.value.length)return!1;if(e.disabled.value)return!0;let n=r.value.at(-1).value;return!t&&!e.nextPage.value?jr(n.add({months:1}).set({day:1}),e.maxValue.value):jr(qr(n,t||e.nextPage.value),e.maxValue.value)},c=t=>{if(!e.minValue.value||!r.value.length)return!1;if(e.disabled.value)return!0;let n=r.value[0].value;return!t&&!e.prevPage.value?Ar(n.subtract({months:1}).set({day:35}),e.minValue.value):Ar(Jr(n,t||e.prevPage.value),e.minValue.value)};function u(t){return!!(e.isDateDisabled?.(t)||e.disabled.value||e.maxValue.value&&jr(t,e.maxValue.value)||e.minValue.value&&Ar(t,e.minValue.value))}let d=t=>!!e.isDateUnavailable?.(t),f=l(()=>r.value.length?r.value[0].rows[0].map(n=>t.dayOfWeek(H(n),e.weekdayFormat.value)):[]),p=t=>{let n=r.value[0].value;if(!t&&!e.nextPage.value){let t=Br({dateObj:n.add({months:e.pagedNavigation.value?e.numberOfMonths.value:1}),weekStartsOn:e.weekStartsOn.value,locale:e.locale.value,fixedWeeks:e.fixedWeeks.value,numberOfMonths:e.numberOfMonths.value});r.value=t,e.placeholder.value=t[0].value.set({day:1});return}let i=Br({dateObj:Yr(n,t||e.nextPage.value),weekStartsOn:e.weekStartsOn.value,locale:e.locale.value,fixedWeeks:e.fixedWeeks.value,numberOfMonths:e.numberOfMonths.value});r.value=i;let a={};if(!t){let e=i[0].value.compare(n);e>=kr(n)&&(a.day=1),e>=365&&(a.month=1)}e.placeholder.value=i[0].value.set({...a})},m=t=>{let n=r.value[0].value;if(!t&&!e.prevPage.value){let t=Br({dateObj:n.subtract({months:e.pagedNavigation.value?e.numberOfMonths.value:1}),weekStartsOn:e.weekStartsOn.value,locale:e.locale.value,fixedWeeks:e.fixedWeeks.value,numberOfMonths:e.numberOfMonths.value});r.value=t,e.placeholder.value=t[0].value.set({day:1});return}let i=Br({dateObj:Xr(n,t||e.prevPage.value),weekStartsOn:e.weekStartsOn.value,locale:e.locale.value,fixedWeeks:e.fixedWeeks.value,numberOfMonths:e.numberOfMonths.value});r.value=i;let a={};if(!t){let e=n.compare(i[0].value);e>=kr(n)&&(a.day=1),e>=365&&(a.month=1)}e.placeholder.value=i[0].value.set({...a})};s(e.placeholder,t=>{i.value.some(e=>Ke(e,t))||(r.value=Br({dateObj:t,weekStartsOn:e.weekStartsOn.value,locale:e.locale.value,fixedWeeks:e.fixedWeeks.value,numberOfMonths:e.numberOfMonths.value}))}),s([e.locale,e.weekStartsOn,e.fixedWeeks,e.numberOfMonths],()=>{r.value=Br({dateObj:e.placeholder.value,weekStartsOn:e.weekStartsOn.value,locale:e.locale.value,fixedWeeks:e.fixedWeeks.value,numberOfMonths:e.numberOfMonths.value})});let h=l(()=>{if(!r.value.length)return``;if(e.locale.value!==t.getLocale()&&t.setLocale(e.locale.value),r.value.length===1){let e=r.value[0].value;return`${t.fullMonthAndYear(H(e),n.value)}`}let i=H(r.value[0].value),a=H(r.value.at(-1).value),o=t.fullMonth(i,n.value),s=t.fullMonth(a,n.value),c=t.fullYear(i,n.value),l=t.fullYear(a,n.value);return c===l?`${o} - ${s} ${l}`:`${o} ${c} - ${s} ${l}`});return{isDateDisabled:u,isDateUnavailable:d,isNextButtonDisabled:o,isPrevButtonDisabled:c,grid:r,weekdays:f,visibleView:i,isOutsideVisibleView:a,formatter:t,nextPage:p,prevPage:m,headingValue:h,fullCalendarLabel:l(()=>`${e.calendarLabel.value??`Event Date`}, ${h.value}`),isPlaceholderFocusable:l(()=>!(u(e.placeholder.value)||d(e.placeholder.value)||a(e.placeholder.value))),firstFocusableDate:l(()=>{for(let t of r.value){if(e.minValue.value&&Ar(t.value,e.minValue.value))continue;let n=kr(t.value),r=e.minValue.value&&We(e.minValue.value,t.value)?e.minValue.value.day:1;for(let e=r;e<=n;e++){let n=t.value.set({day:e});if(!(u(n)||d(n)))return n}}})}}var Qr={style:{border:`0px`,clip:`rect(0px, 0px, 0px, 0px)`,"clip-path":`inset(50%)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:`0px`,position:`absolute`,"white-space":`nowrap`,width:`1px`}},$r={role:`heading`,"aria-level":`2`},[ei,ti]=he(`CalendarRoot`),ni=M({__name:`CalendarRoot`,props:{defaultValue:{type:null,required:!1,default:void 0},defaultPlaceholder:{type:null,required:!1},placeholder:{type:null,required:!1,default:void 0},pagedNavigation:{type:Boolean,required:!1,default:!1},preventDeselect:{type:Boolean,required:!1,default:!1},weekStartsOn:{type:Number,required:!1},weekdayFormat:{type:String,required:!1,default:`narrow`},calendarLabel:{type:String,required:!1},fixedWeeks:{type:Boolean,required:!1,default:!1},maxValue:{type:null,required:!1},minValue:{type:null,required:!1},locale:{type:String,required:!1},numberOfMonths:{type:Number,required:!1,default:1},disabled:{type:Boolean,required:!1,default:!1},readonly:{type:Boolean,required:!1,default:!1},initialFocus:{type:Boolean,required:!1,default:!1},isDateDisabled:{type:Function,required:!1,default:void 0},isDateUnavailable:{type:Function,required:!1,default:void 0},dir:{type:String,required:!1},nextPage:{type:Function,required:!1},prevPage:{type:Function,required:!1},modelValue:{type:null,required:!1},multiple:{type:Boolean,required:!1,default:!1},disableDaysOutsideCurrentView:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`div`}},emits:[`update:modelValue`,`update:placeholder`],setup(t,{emit:n}){let r=t,i=n,{disabled:a,readonly:o,initialFocus:c,pagedNavigation:d,weekdayFormat:f,fixedWeeks:p,multiple:m,minValue:h,maxValue:_,numberOfMonths:v,preventDeselect:y,isDateDisabled:b,isDateUnavailable:x,calendarLabel:S,defaultValue:C,nextPage:w,prevPage:T,dir:k,locale:te,disableDaysOutsideCurrentView:ne}=g(r),{primitiveElement:re,currentElement:ie}=pe(),j=Gr(te),M=ue(k),N=l(()=>r.weekStartsOn??Hr(j.value)),F=ee(r,`modelValue`,i,{defaultValue:C.value,passive:r.modelValue===void 0}),ae=Pr({defaultPlaceholder:r.placeholder,defaultValue:F.value,locale:r.locale}),oe=ee(r,`placeholder`,i,{defaultValue:r.defaultPlaceholder??ae.copy(),passive:r.placeholder===void 0});function R(e){oe.value=e.copy()}let{fullCalendarLabel:z,headingValue:se,isDateDisabled:ce,isDateUnavailable:le,isNextButtonDisabled:de,isPrevButtonDisabled:fe,weekdays:me,isOutsideVisibleView:he,nextPage:ge,prevPage:_e,formatter:ve,grid:ye,isPlaceholderFocusable:be,firstFocusableDate:xe}=Zr({locale:j,placeholder:oe,weekStartsOn:N,fixedWeeks:p,numberOfMonths:v,minValue:h,maxValue:_,disabled:a,weekdayFormat:f,pagedNavigation:d,isDateDisabled:b.value,isDateUnavailable:x.value,calendarLabel:S,nextPage:w,prevPage:T}),{isInvalid:Se,isDateSelected:Ce,hasSelectedDate:we,isSelectedDateDisabled:Te}=Kr({date:F,isDateDisabled:ce,isDateUnavailable:le});s(F,e=>{if(Array.isArray(e)&&e.length){let t=e.at(-1);t&&!Ge(oe.value,t)&&R(t)}else !Array.isArray(e)&&e&&!Ge(oe.value,e)&&R(e)});function Ee(e){if(!m.value){if(!F.value){F.value=e.copy();return}!y.value&&Ge(F.value,e)?(oe.value=e.copy(),F.value=void 0):F.value=e.copy()}else if(!F.value)F.value=[e.copy()];else if(Array.isArray(F.value)){if(F.value.findIndex(t=>Ue(t,e))===-1)F.value=[...F.value,e];else if(!y.value){let t=F.value.filter(t=>!Ue(t,e));if(!t.length){oe.value=e.copy(),F.value=void 0;return}F.value=t.map(e=>e.copy())}}}return D(()=>{c.value&&Ir(ie.value)}),ti({isDateUnavailable:le,dir:M,isDateDisabled:ce,locale:j,formatter:ve,modelValue:F,placeholder:oe,disabled:a,initialFocus:c,pagedNavigation:d,grid:ye,weekDays:me,weekStartsOn:N,weekdayFormat:f,fixedWeeks:p,multiple:m,numberOfMonths:v,readonly:o,preventDeselect:y,fullCalendarLabel:z,headingValue:se,isInvalid:Se,isDateSelected:Ce,isNextButtonDisabled:de,isPrevButtonDisabled:fe,isOutsideVisibleView:he,nextPage:ge,prevPage:_e,parentElement:ie,onPlaceholderChange:R,onDateChange:Ee,disableDaysOutsideCurrentView:ne,minValue:h,maxValue:_,isPlaceholderFocusable:be,firstFocusableDate:xe,hasSelectedDate:we,isSelectedDateDisabled:Te}),(t,n)=>(I(),E(P(O),{ref_key:`primitiveElement`,ref:re,as:t.as,"as-child":t.asChild,"aria-label":P(z),"data-readonly":P(o)?``:void 0,"data-disabled":P(a)?``:void 0,"data-invalid":P(Se)?``:void 0,dir:P(M)},{default:A(()=>[L(t.$slots,`default`,{date:P(oe),grid:P(ye),weekDays:P(me),weekStartsOn:N.value,locale:P(j),fixedWeeks:P(p),modelValue:P(F)}),e(`div`,Qr,[e(`div`,$r,u(P(z)),1)])]),_:3},8,[`as`,`as-child`,`aria-label`,`data-readonly`,`data-disabled`,`data-invalid`,`dir`]))}}),ri=M({__name:`CalendarCell`,props:{date:{type:null,required:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`td`}},setup(e){let t=ei();return(e,n)=>(I(),E(P(O),{as:e.as,"as-child":e.asChild,role:`gridcell`,"aria-selected":P(t).isDateSelected(e.date)?!0:void 0,"aria-disabled":P(t).isDateDisabled(e.date)||P(t).isDateUnavailable?.(e.date)||P(t).disableDaysOutsideCurrentView.value,"data-disabled":P(t).isDateDisabled(e.date)||P(t).disableDaysOutsideCurrentView.value?``:void 0},{default:A(()=>[L(e.$slots,`default`)]),_:3},8,[`as`,`as-child`,`aria-selected`,`aria-disabled`,`data-disabled`]))}}),ii=M({__name:`CalendarCellTrigger`,props:{day:{type:null,required:!0},month:{type:null,required:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`div`}},setup(e){let t=e,n=Wr(),r=ei(),{primitiveElement:a,currentElement:o}=pe(),s=l(()=>t.day.day.toLocaleString(r.locale.value)),c=l(()=>r.formatter.custom(H(t.day),{weekday:`long`,month:`long`,day:`numeric`,year:`numeric`})),d=l(()=>r.isDateUnavailable?.(t.day)??!1),f=l(()=>Je(t.day,it())),p=l(()=>!We(t.day,t.month)),m=l(()=>r.isOutsideVisibleView(t.day)),h=l(()=>r.isDateDisabled(t.day)||r.disableDaysOutsideCurrentView.value&&p.value),g=l(()=>p.value||h.value?!1:!r.disabled.value&&r.isPlaceholderFocusable.value&&Ue(t.day,r.placeholder.value)?!0:(!r.hasSelectedDate.value||r.isSelectedDateDisabled.value)&&!r.isPlaceholderFocusable.value?r.firstFocusableDate.value&&Ue(t.day,r.firstFocusableDate.value):!1),_=l(()=>r.isDateSelected(t.day));function v(e){r.readonly.value||r.isDateDisabled(e)||r.isDateUnavailable?.(e)||r.onDateChange(e)}function b(){h.value||v(t.day)}function x(e){if(h.value)return;e.preventDefault(),e.stopPropagation();let i=r.parentElement.value,a=r.dir.value===`rtl`?-1:1;switch(e.code){case n.ARROW_RIGHT:o(t.day,a);break;case n.ARROW_LEFT:o(t.day,-a);break;case n.ARROW_UP:o(t.day,-7);break;case n.ARROW_DOWN:o(t.day,7);break;case n.ENTER:case n.SPACE_CODE:v(t.day)}function o(e,t){let n=e.add({days:t});if(r.minValue.value&&n.compare(r.minValue.value)<0||r.maxValue.value&&n.compare(r.maxValue.value)>0)return;let a=i.querySelector(`[data-value='${n.toString()}']:not([data-outside-view])`);if(!a){if(t>0){if(r.isNextButtonDisabled())return;r.nextPage()}else{if(r.isPrevButtonDisabled())return;r.prevPage()}re(()=>{o(e,t)});return}if(a&&a.hasAttribute(`data-disabled`))return o(n,t);r.onPlaceholderChange(n),a?.focus()}}return(e,n)=>(I(),E(P(O),{ref_key:`primitiveElement`,ref:a,as:t.as,"as-child":t.asChild,role:`button`,"aria-label":c.value,"data-reka-calendar-cell-trigger":``,"aria-disabled":h.value||d.value?!0:void 0,"data-selected":_.value?!0:void 0,"data-value":e.day.toString(),"data-disabled":h.value?``:void 0,"data-unavailable":d.value?``:void 0,"data-today":f.value?``:void 0,"data-outside-view":p.value?``:void 0,"data-outside-visible-view":m.value?``:void 0,"data-focused":g.value?``:void 0,tabindex:g.value?0:p.value||h.value?void 0:-1,onClick:b,onKeydown:[i(x,[`up`,`down`,`left`,`right`,`space`,`enter`]),n[0]||=i(y(()=>{},[`prevent`]),[`enter`])]},{default:A(()=>[L(e.$slots,`default`,{dayValue:s.value,disabled:h.value,today:f.value,selected:_.value,outsideView:p.value,outsideVisibleView:m.value,unavailable:d.value},()=>[k(u(s.value),1)])]),_:3},8,[`as`,`as-child`,`aria-label`,`aria-disabled`,`data-selected`,`data-value`,`data-disabled`,`data-unavailable`,`data-today`,`data-outside-view`,`data-outside-visible-view`,`data-focused`,`tabindex`]))}}),ai=M({__name:`CalendarGrid`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`table`}},setup(e){let t=e,n=ei(),r=l(()=>n.disabled.value?!0:void 0),i=l(()=>n.readonly.value?!0:void 0);return(e,n)=>(I(),E(P(O),N(t,{tabindex:`-1`,role:`application`,"aria-readonly":i.value,"aria-disabled":r.value,"data-readonly":i.value&&``,"data-disabled":r.value&&``}),{default:A(()=>[L(e.$slots,`default`)]),_:3},16,[`aria-readonly`,`aria-disabled`,`data-readonly`,`data-disabled`]))}}),oi=M({__name:`CalendarGridBody`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`tbody`}},setup(e){let t=e;return(e,n)=>(I(),E(P(O),v(T(t)),{default:A(()=>[L(e.$slots,`default`)]),_:3},16))}}),si=M({__name:`CalendarGridHead`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`thead`}},setup(e){let t=e;return(e,n)=>(I(),E(P(O),N(t,{"aria-hidden":`true`}),{default:A(()=>[L(e.$slots,`default`)]),_:3},16))}}),ci=M({__name:`CalendarGridRow`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`tr`}},setup(e){let t=e;return(e,n)=>(I(),E(P(O),v(T(t)),{default:A(()=>[L(e.$slots,`default`)]),_:3},16))}}),li=M({__name:`CalendarHeadCell`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`th`}},setup(e){let t=e;return(e,n)=>(I(),E(P(O),v(T(t)),{default:A(()=>[L(e.$slots,`default`)]),_:3},16))}}),ui=M({__name:`CalendarHeader`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`div`}},setup(e){let t=e;return(e,n)=>(I(),E(P(O),v(T(t)),{default:A(()=>[L(e.$slots,`default`)]),_:3},16))}}),di=M({__name:`CalendarHeading`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`div`}},setup(e){let t=e,n=ei();return(e,r)=>(I(),E(P(O),N(t,{"data-disabled":P(n).disabled.value?``:void 0}),{default:A(()=>[L(e.$slots,`default`,{headingValue:P(n).headingValue.value},()=>[k(u(P(n).headingValue.value),1)])]),_:3},16,[`data-disabled`]))}}),fi=M({__name:`CalendarNext`,props:{nextPage:{type:Function,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,n=l(()=>r.disabled.value||r.isNextButtonDisabled(t.nextPage)),r=ei();function i(){n.value||r.nextPage(t.nextPage)}return(e,r)=>(I(),E(P(O),{as:t.as,"as-child":t.asChild,"aria-label":`Next page`,type:t.as===`button`?`button`:void 0,"aria-disabled":n.value||void 0,"data-disabled":n.value||void 0,disabled:n.value,onClick:i},{default:A(()=>[L(e.$slots,`default`,{disabled:n.value},()=>[r[0]||=k(` Next page `)])]),_:3},8,[`as`,`as-child`,`type`,`aria-disabled`,`data-disabled`,`disabled`]))}}),pi=M({__name:`CalendarPrev`,props:{prevPage:{type:Function,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,n=l(()=>r.disabled.value||r.isPrevButtonDisabled(t.prevPage)),r=ei();function i(){n.value||r.prevPage(t.prevPage)}return(e,r)=>(I(),E(P(O),{"aria-label":`Previous page`,as:t.as,"as-child":t.asChild,type:t.as===`button`?`button`:void 0,"aria-disabled":n.value||void 0,"data-disabled":n.value||void 0,disabled:n.value,onClick:i},{default:A(()=>[L(e.$slots,`default`,{disabled:n.value},()=>[r[0]||=k(` Prev page `)])]),_:3},8,[`as`,`as-child`,`type`,`aria-disabled`,`data-disabled`,`disabled`]))}});function mi(e){return e+.5|0}var hi=(e,t,n)=>Math.max(Math.min(e,n),t);function gi(e){return hi(mi(e*2.55),0,255)}function _i(e){return hi(mi(e*255),0,255)}function vi(e){return hi(mi(e/2.55)/100,0,1)}function yi(e){return hi(mi(e*100),0,100)}var bi={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},xi=[...`0123456789ABCDEF`],Si=e=>xi[e&15],Ci=e=>xi[(e&240)>>4]+xi[e&15],wi=e=>(e&240)>>4==(e&15),Ti=e=>wi(e.r)&&wi(e.g)&&wi(e.b)&&wi(e.a);function Ei(e){var t=e.length,n;return e[0]===`#`&&(t===4||t===5?n={r:255&bi[e[1]]*17,g:255&bi[e[2]]*17,b:255&bi[e[3]]*17,a:t===5?bi[e[4]]*17:255}:(t===7||t===9)&&(n={r:bi[e[1]]<<4|bi[e[2]],g:bi[e[3]]<<4|bi[e[4]],b:bi[e[5]]<<4|bi[e[6]],a:t===9?bi[e[7]]<<4|bi[e[8]]:255})),n}var Di=(e,t)=>e<255?t(e):``;function Oi(e){var t=Ti(e)?Si:Ci;return e?`#`+t(e.r)+t(e.g)+t(e.b)+Di(e.a,t):void 0}var ki=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Ai(e,t,n){let r=t*Math.min(n,1-n),i=(t,i=(t+e/30)%12)=>n-r*Math.max(Math.min(i-3,9-i,1),-1);return[i(0),i(8),i(4)]}function ji(e,t,n){let r=(r,i=(r+e/60)%6)=>n-n*t*Math.max(Math.min(i,4-i,1),0);return[r(5),r(3),r(1)]}function Mi(e,t,n){let r=Ai(e,1,.5),i;for(t+n>1&&(i=1/(t+n),t*=i,n*=i),i=0;i<3;i++)r[i]*=1-t-n,r[i]+=t;return r}function Ni(e,t,n,r,i){return e===i?(t-n)/r+(t<n?6:0):t===i?(n-e)/r+2:(e-t)/r+4}function Pi(e){let t=e.r/255,n=e.g/255,r=e.b/255,i=Math.max(t,n,r),a=Math.min(t,n,r),o=(i+a)/2,s,c,l;return i!==a&&(l=i-a,c=o>.5?l/(2-i-a):l/(i+a),s=Ni(t,n,r,l,i),s=s*60+.5),[s|0,c||0,o]}function Fi(e,t,n,r){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,r)).map(_i)}function Ii(e,t,n){return Fi(Ai,e,t,n)}function Li(e,t,n){return Fi(Mi,e,t,n)}function Ri(e,t,n){return Fi(ji,e,t,n)}function zi(e){return(e%360+360)%360}function Bi(e){let t=ki.exec(e),n=255,r;if(!t)return;t[5]!==r&&(n=t[6]?gi(+t[5]):_i(+t[5]));let i=zi(+t[2]),a=t[3]/100,o=t[4]/100;return r=t[1]===`hwb`?Li(i,a,o):t[1]===`hsv`?Ri(i,a,o):Ii(i,a,o),{r:r[0],g:r[1],b:r[2],a:n}}function Vi(e,t){var n=Pi(e);n[0]=zi(n[0]+t),n=Ii(n),e.r=n[0],e.g=n[1],e.b=n[2]}function Hi(e){if(!e)return;let t=Pi(e),n=t[0],r=yi(t[1]),i=yi(t[2]);return e.a<255?`hsla(${n}, ${r}%, ${i}%, ${vi(e.a)})`:`hsl(${n}, ${r}%, ${i}%)`}var Ui={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`},Wi={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 Gi(){let e={},t=Object.keys(Wi),n=Object.keys(Ui),r,i,a,o,s;for(r=0;r<t.length;r++){for(o=s=t[r],i=0;i<n.length;i++)a=n[i],s=s.replace(a,Ui[a]);a=parseInt(Wi[o],16),e[s]=[a>>16&255,a>>8&255,a&255]}return e}var Ki;function qi(e){Ki||(Ki=Gi(),Ki.transparent=[0,0,0,0]);let t=Ki[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}var Ji=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Yi(e){let t=Ji.exec(e),n=255,r,i,a;if(t){if(t[7]!==r){let e=+t[7];n=t[8]?gi(e):hi(e*255,0,255)}return r=+t[1],i=+t[3],a=+t[5],r=255&(t[2]?gi(r):hi(r,0,255)),i=255&(t[4]?gi(i):hi(i,0,255)),a=255&(t[6]?gi(a):hi(a,0,255)),{r,g:i,b:a,a:n}}}function Xi(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${vi(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}var Zi=e=>e<=.0031308?e*12.92:e**(1/2.4)*1.055-.055,Qi=e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4;function $i(e,t,n){let r=Qi(vi(e.r)),i=Qi(vi(e.g)),a=Qi(vi(e.b));return{r:_i(Zi(r+n*(Qi(vi(t.r))-r))),g:_i(Zi(i+n*(Qi(vi(t.g))-i))),b:_i(Zi(a+n*(Qi(vi(t.b))-a))),a:e.a+n*(t.a-e.a)}}function ea(e,t,n){if(e){let r=Pi(e);r[t]=Math.max(0,Math.min(r[t]+r[t]*n,t===0?360:1)),r=Ii(r),e.r=r[0],e.g=r[1],e.b=r[2]}}function ta(e,t){return e&&Object.assign(t||{},e)}function na(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=_i(e[3]))):(t=ta(e,{r:0,g:0,b:0,a:1}),t.a=_i(t.a)),t}function ra(e){return e.charAt(0)===`r`?Yi(e):Bi(e)}var ia=class e{constructor(t){if(t instanceof e)return t;let n=typeof t,r;n===`object`?r=na(t):n===`string`&&(r=Ei(t)||qi(t)||ra(t)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var e=ta(this._rgb);return e&&(e.a=vi(e.a)),e}set rgb(e){this._rgb=na(e)}rgbString(){return this._valid?Xi(this._rgb):void 0}hexString(){return this._valid?Oi(this._rgb):void 0}hslString(){return this._valid?Hi(this._rgb):void 0}mix(e,t){if(e){let n=this.rgb,r=e.rgb,i,a=t===i?.5:t,o=2*a-1,s=n.a-r.a,c=((o*s===-1?o:(o+s)/(1+o*s))+1)/2;i=1-c,n.r=255&c*n.r+i*r.r+.5,n.g=255&c*n.g+i*r.g+.5,n.b=255&c*n.b+i*r.b+.5,n.a=a*n.a+(1-a)*r.a,this.rgb=n}return this}interpolate(e,t){return e&&(this._rgb=$i(this._rgb,e._rgb,t)),this}clone(){return new e(this.rgb)}alpha(e){return this._rgb.a=_i(e),this}clearer(e){let t=this._rgb;return t.a*=1-e,this}greyscale(){let e=this._rgb;return e.r=e.g=e.b=mi(e.r*.3+e.g*.59+e.b*.11),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 ea(this._rgb,2,e),this}darken(e){return ea(this._rgb,2,-e),this}saturate(e){return ea(this._rgb,1,e),this}desaturate(e){return ea(this._rgb,1,-e),this}rotate(e){return Vi(this._rgb,e),this}};function aa(){}var oa=(()=>{let e=0;return()=>e++})();function U(e){return e==null}function W(e){if(Array.isArray&&Array.isArray(e))return!0;let t=Object.prototype.toString.call(e);return t.slice(0,7)===`[object`&&t.slice(-6)===`Array]`}function G(e){return e!==null&&Object.prototype.toString.call(e)===`[object Object]`}function K(e){return(typeof e==`number`||e instanceof Number)&&isFinite(+e)}function sa(e,t){return K(e)?e:t}function q(e,t){return e===void 0?t:e}var ca=(e,t)=>typeof e==`string`&&e.endsWith(`%`)?parseFloat(e)/100*t:+e;function J(e,t,n){if(e&&typeof e.call==`function`)return e.apply(n,t)}function Y(e,t,n,r){let i,a,o;if(W(e))if(a=e.length,r)for(i=a-1;i>=0;i--)t.call(n,e[i],i);else for(i=0;i<a;i++)t.call(n,e[i],i);else if(G(e))for(o=Object.keys(e),a=o.length,i=0;i<a;i++)t.call(n,e[o[i]],o[i])}function la(e,t){let n,r,i,a;if(!e||!t||e.length!==t.length)return!1;for(n=0,r=e.length;n<r;++n)if(i=e[n],a=t[n],i.datasetIndex!==a.datasetIndex||i.index!==a.index)return!1;return!0}function ua(e){if(W(e))return e.map(ua);if(G(e)){let t=Object.create(null),n=Object.keys(e),r=n.length,i=0;for(;i<r;++i)t[n[i]]=ua(e[n[i]]);return t}return e}function da(e){return[`__proto__`,`prototype`,`constructor`].indexOf(e)===-1}function fa(e,t,n,r){if(!da(e))return;let i=t[e],a=n[e];G(i)&&G(a)?pa(i,a,r):t[e]=ua(a)}function pa(e,t,n){let r=W(t)?t:[t],i=r.length;if(!G(e))return e;n||={};let a=n.merger||fa,o;for(let t=0;t<i;++t){if(o=r[t],!G(o))continue;let i=Object.keys(o);for(let t=0,r=i.length;t<r;++t)a(i[t],e,o,n)}return e}function ma(e,t){return pa(e,t,{merger:ha})}function ha(e,t,n){if(!da(e))return;let r=t[e],i=n[e];G(r)&&G(i)?ma(r,i):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=ua(i))}var ga={"":e=>e,x:e=>e.x,y:e=>e.y};function _a(e){let t=e.split(`.`),n=[],r=``;for(let e of t)r+=e,r.endsWith(`\\`)?r=r.slice(0,-1)+`.`:(n.push(r),r=``);return n}function va(e){let t=_a(e);return e=>{for(let n of t){if(n===``)break;e&&=e[n]}return e}}function ya(e,t){return(ga[t]||(ga[t]=va(t)))(e)}function ba(e){return e.charAt(0).toUpperCase()+e.slice(1)}var xa=e=>e!==void 0,Sa=e=>typeof e==`function`,Ca=(e,t)=>{if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0};function wa(e){return e.type===`mouseup`||e.type===`click`||e.type===`contextmenu`}var X=Math.PI,Ta=2*X,Ea=Ta+X,Da=1/0,Oa=X/180,ka=X/2,Aa=X/4,ja=X*2/3,Ma=Math.log10,Na=Math.sign;function Pa(e,t,n){return Math.abs(e-t)<n}function Fa(e){let t=Math.round(e);e=Pa(e,t,e/1e3)?t:e;let n=10**Math.floor(Ma(e)),r=e/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function Ia(e){let t=[],n=Math.sqrt(e),r;for(r=1;r<n;r++)e%r===0&&(t.push(r),t.push(e/r));return n===(n|0)&&t.push(n),t.sort((e,t)=>e-t).pop(),t}function La(e){return typeof e==`symbol`||typeof e==`object`&&!!e&&!(Symbol.toPrimitive in e||`toString`in e||`valueOf`in e)}function Ra(e){return!La(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function za(e,t){let n=Math.round(e);return n-t<=e&&n+t>=e}function Ba(e,t,n){let r,i,a;for(r=0,i=e.length;r<i;r++)a=e[r][n],isNaN(a)||(t.min=Math.min(t.min,a),t.max=Math.max(t.max,a))}function Va(e){return X/180*e}function Ha(e){return 180/X*e}function Ua(e){if(!K(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function Wa(e,t){let n=t.x-e.x,r=t.y-e.y,i=Math.sqrt(n*n+r*r),a=Math.atan2(r,n);return a<-.5*X&&(a+=Ta),{angle:a,distance:i}}function Ga(e,t){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)}function Ka(e,t){return(e-t+Ea)%Ta-X}function qa(e){return(e%Ta+Ta)%Ta}function Ja(e,t,n,r){let i=qa(e),a=qa(t),o=qa(n),s=qa(a-i),c=qa(o-i),l=qa(i-a),u=qa(i-o);return i===a||i===o||r&&a===o||s>c&&l<u}function Ya(e,t,n){return Math.max(t,Math.min(n,e))}function Xa(e){return Ya(e,-32768,32767)}function Za(e,t,n,r=1e-6){return e>=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function Qa(e,t,n){n||=(n=>e[n]<t);let r=e.length-1,i=0,a;for(;r-i>1;)a=i+r>>1,n(a)?i=a:r=a;return{lo:i,hi:r}}var $a=(e,t,n,r)=>Qa(e,n,r?r=>{let i=e[r][t];return i<n||i===n&&e[r+1][t]===n}:r=>e[r][t]<n),eo=(e,t,n)=>Qa(e,n,r=>e[r][t]>=n);function to(e,t,n){let r=0,i=e.length;for(;r<i&&e[r]<t;)r++;for(;i>r&&e[i-1]>n;)i--;return r>0||i<e.length?e.slice(r,i):e}var no=[`push`,`pop`,`shift`,`splice`,`unshift`];function ro(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,`_chartjs`,{configurable:!0,enumerable:!1,value:{listeners:[t]}}),no.forEach(t=>{let n=`_onData`+ba(t),r=e[t];Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value(...t){let i=r.apply(this,t);return e._chartjs.listeners.forEach(e=>{typeof e[n]==`function`&&e[n](...t)}),i}})})}function io(e,t){let n=e._chartjs;if(!n)return;let r=n.listeners,i=r.indexOf(t);i!==-1&&r.splice(i,1),!(r.length>0)&&(no.forEach(t=>{delete e[t]}),delete e._chartjs)}function ao(e){let t=new Set(e);return t.size===e.length?e:Array.from(t)}var oo=function(){return typeof window>`u`?function(e){return e()}:window.requestAnimationFrame}();function so(e,t){let n=[],r=!1;return function(...i){n=i,r||(r=!0,oo.call(window,()=>{r=!1,e.apply(t,n)}))}}function co(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}var lo=e=>e===`start`?`left`:e===`end`?`right`:`center`,uo=(e,t,n)=>e===`start`?t:e===`end`?n:(t+n)/2,fo=(e,t,n,r)=>e===(r?`left`:`right`)?n:e===`center`?(t+n)/2:t;function po(e,t,n){let r=t.length,i=0,a=r;if(e._sorted){let{iScale:o,vScale:s,_parsed:c}=e,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,u=o.axis,{min:d,max:f,minDefined:p,maxDefined:m}=o.getUserBounds();if(p){if(i=Math.min($a(c,u,d).lo,n?r:$a(t,u,o.getPixelForValue(d)).lo),l){let e=c.slice(0,i+1).reverse().findIndex(e=>!U(e[s.axis]));i-=Math.max(0,e)}i=Ya(i,0,r-1)}if(m){let e=Math.max($a(c,o.axis,f,!0).hi+1,n?0:$a(t,u,o.getPixelForValue(f),!0).hi+1);if(l){let t=c.slice(e-1).findIndex(e=>!U(e[s.axis]));e+=Math.max(0,t)}a=Ya(e,i,r)-i}else a=r-i}return{start:i,count:a}}function mo(e){let{xScale:t,yScale:n,_scaleRanges:r}=e,i={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!r)return e._scaleRanges=i,!0;let a=r.xmin!==t.min||r.xmax!==t.max||r.ymin!==n.min||r.ymax!==n.max;return Object.assign(r,i),a}var ho=e=>e===0||e===1,go=(e,t,n)=>-(2**(10*--e)*Math.sin((e-t)*Ta/n)),_o=(e,t,n)=>2**(-10*e)*Math.sin((e-t)*Ta/n)+1,vo={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>--e*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-(--e*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>--e*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*ka)+1,easeOutSine:e=>Math.sin(e*ka),easeInOutSine:e=>-.5*(Math.cos(X*e)-1),easeInExpo:e=>e===0?0:2**(10*(e-1)),easeOutExpo:e=>e===1?1:-(2**(-10*e))+1,easeInOutExpo:e=>ho(e)?e:e<.5?.5*2**(10*(e*2-1)):.5*(-(2**(-10*(e*2-1)))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1- --e*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>ho(e)?e:go(e,.075,.3),easeOutElastic:e=>ho(e)?e:_o(e,.075,.3),easeInOutElastic(e){let t=.1125,n=.45;return ho(e)?e:e<.5?.5*go(e*2,t,n):.5+.5*_o(e*2-1,t,n)},easeInBack(e){let t=1.70158;return e*e*((t+1)*e-t)},easeOutBack(e){let t=1.70158;return--e*e*((t+1)*e+t)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-vo.easeOutBounce(1-e),easeOutBounce(e){let t=7.5625,n=2.75;return e<1/n?t*e*e:e<2/n?t*(e-=1.5/n)*e+.75:e<2.5/n?t*(e-=2.25/n)*e+.9375:t*(e-=2.625/n)*e+.984375},easeInOutBounce:e=>e<.5?vo.easeInBounce(e*2)*.5:vo.easeOutBounce(e*2-1)*.5+.5};function yo(e){if(e&&typeof e==`object`){let t=e.toString();return t===`[object CanvasPattern]`||t===`[object CanvasGradient]`}return!1}function bo(e){return yo(e)?e:new ia(e)}function xo(e){return yo(e)?e:new ia(e).saturate(.5).darken(.1).hexString()}var So=[`x`,`y`,`borderWidth`,`radius`,`tension`],Co=[`color`,`borderColor`,`backgroundColor`];function wo(e){e.set(`animation`,{delay:void 0,duration:1e3,easing:`easeOutQuart`,fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe(`animation`,{_fallback:!1,_indexable:!1,_scriptable:e=>e!==`onProgress`&&e!==`onComplete`&&e!==`fn`}),e.set(`animations`,{colors:{type:`color`,properties:Co},numbers:{type:`number`,properties:So}}),e.describe(`animations`,{_fallback:`animation`}),e.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 To(e){e.set(`layout`,{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}var Eo=new Map;function Do(e,t){t||={};let n=e+JSON.stringify(t),r=Eo.get(n);return r||(r=new Intl.NumberFormat(e,t),Eo.set(n,r)),r}function Oo(e,t,n){return Do(t,n).format(e)}var ko={values(e){return W(e)?e:``+e},numeric(e,t,n){if(e===0)return`0`;let r=this.chart.options.locale,i,a=e;if(n.length>1){let t=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(t<1e-4||t>0x38d7ea4c68000)&&(i=`scientific`),a=Ao(e,n)}let o=Ma(Math.abs(a)),s=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),c={notation:i,minimumFractionDigits:s,maximumFractionDigits:s};return Object.assign(c,this.options.ticks.format),Oo(e,r,c)},logarithmic(e,t,n){if(e===0)return`0`;let r=n[t].significand||e/10**Math.floor(Ma(e));return[1,2,3,5,10,15].includes(r)||t>.8*n.length?ko.numeric.call(this,e,t,n):``}};function Ao(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}var jo={formatters:ko};function Mo(e){e.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:jo.formatters.values,minor:{},major:{},align:`center`,crossAlign:`near`,showLabelBackdrop:!1,backdropColor:`rgba(255, 255, 255, 0.75)`,backdropPadding:2}}),e.route(`scale.ticks`,`color`,``,`color`),e.route(`scale.grid`,`color`,``,`borderColor`),e.route(`scale.border`,`color`,``,`borderColor`),e.route(`scale.title`,`color`,``,`color`),e.describe(`scale`,{_fallback:!1,_scriptable:e=>!e.startsWith(`before`)&&!e.startsWith(`after`)&&e!==`callback`&&e!==`parser`,_indexable:e=>e!==`borderDash`&&e!==`tickBorderDash`&&e!==`dash`}),e.describe(`scales`,{_fallback:`scale`}),e.describe(`scale.ticks`,{_scriptable:e=>e!==`backdropPadding`&&e!==`callback`,_indexable:e=>e!==`backdropPadding`})}var No=Object.create(null),Po=Object.create(null);function Fo(e,t){if(!t)return e;let n=t.split(`.`);for(let t=0,r=n.length;t<r;++t){let r=n[t];e=e[r]||(e[r]=Object.create(null))}return e}function Io(e,t,n){return typeof t==`string`?pa(Fo(e,t),n):pa(Fo(e,``),t)}var Z=new 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=e=>e.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=(e,t)=>xo(t.backgroundColor),this.hoverBorderColor=(e,t)=>xo(t.borderColor),this.hoverColor=(e,t)=>xo(t.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 Io(this,e,t)}get(e){return Fo(this,e)}describe(e,t){return Io(Po,e,t)}override(e,t){return Io(No,e,t)}route(e,t,n,r){let i=Fo(this,e),a=Fo(this,n),o=`_`+t;Object.defineProperties(i,{[o]:{value:i[t],writable:!0},[t]:{enumerable:!0,get(){let e=this[o],t=a[r];return G(e)?Object.assign({},t,e):q(e,t)},set(e){this[o]=e}}})}apply(e){e.forEach(e=>e(this))}}({_scriptable:e=>!e.startsWith(`on`),_indexable:e=>e!==`events`,hover:{_fallback:`interaction`},interaction:{_scriptable:!1,_indexable:!1}},[wo,To,Mo]);function Lo(e){return!e||U(e.size)||U(e.family)?null:(e.style?e.style+` `:``)+(e.weight?e.weight+` `:``)+e.size+`px `+e.family}function Ro(e,t,n,r,i){let a=t[i];return a||(a=t[i]=e.measureText(i).width,n.push(i)),a>r&&(r=a),r}function zo(e,t,n,r){r||={};let i=r.data=r.data||{},a=r.garbageCollect=r.garbageCollect||[];r.font!==t&&(i=r.data={},a=r.garbageCollect=[],r.font=t),e.save(),e.font=t;let o=0,s=n.length,c,l,u,d,f;for(c=0;c<s;c++)if(d=n[c],d!=null&&!W(d))o=Ro(e,i,a,o,d);else if(W(d))for(l=0,u=d.length;l<u;l++)f=d[l],f!=null&&!W(f)&&(o=Ro(e,i,a,o,f));e.restore();let p=a.length/2;if(p>n.length){for(c=0;c<p;c++)delete i[a[c]];a.splice(0,p)}return o}function Bo(e,t,n){let r=e.currentDevicePixelRatio,i=n===0?0:Math.max(n/2,.5);return Math.round((t-i)*r)/r+i}function Vo(e,t){!t&&!e||(t||=e.getContext(`2d`),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function Ho(e,t,n,r){Uo(e,t,n,r,null)}function Uo(e,t,n,r,i){let a,o,s,c,l,u,d,f,p=t.pointStyle,m=t.rotation,h=t.radius,g=(m||0)*Oa;if(p&&typeof p==`object`&&(a=p.toString(),a===`[object HTMLImageElement]`||a===`[object HTMLCanvasElement]`)){e.save(),e.translate(n,r),e.rotate(g),e.drawImage(p,-p.width/2,-p.height/2,p.width,p.height),e.restore();return}if(!(isNaN(h)||h<=0)){switch(e.beginPath(),p){default:i?e.ellipse(n,r,i/2,h,0,0,Ta):e.arc(n,r,h,0,Ta),e.closePath();break;case`triangle`:u=i?i/2:h,e.moveTo(n+Math.sin(g)*u,r-Math.cos(g)*h),g+=ja,e.lineTo(n+Math.sin(g)*u,r-Math.cos(g)*h),g+=ja,e.lineTo(n+Math.sin(g)*u,r-Math.cos(g)*h),e.closePath();break;case`rectRounded`:l=h*.516,c=h-l,o=Math.cos(g+Aa)*c,d=Math.cos(g+Aa)*(i?i/2-l:c),s=Math.sin(g+Aa)*c,f=Math.sin(g+Aa)*(i?i/2-l:c),e.arc(n-d,r-s,l,g-X,g-ka),e.arc(n+f,r-o,l,g-ka,g),e.arc(n+d,r+s,l,g,g+ka),e.arc(n-f,r+o,l,g+ka,g+X),e.closePath();break;case`rect`:if(!m){c=Math.SQRT1_2*h,u=i?i/2:c,e.rect(n-u,r-c,2*u,2*c);break}g+=Aa;case`rectRot`:d=Math.cos(g)*(i?i/2:h),o=Math.cos(g)*h,s=Math.sin(g)*h,f=Math.sin(g)*(i?i/2:h),e.moveTo(n-d,r-s),e.lineTo(n+f,r-o),e.lineTo(n+d,r+s),e.lineTo(n-f,r+o),e.closePath();break;case`crossRot`:g+=Aa;case`cross`:d=Math.cos(g)*(i?i/2:h),o=Math.cos(g)*h,s=Math.sin(g)*h,f=Math.sin(g)*(i?i/2:h),e.moveTo(n-d,r-s),e.lineTo(n+d,r+s),e.moveTo(n+f,r-o),e.lineTo(n-f,r+o);break;case`star`:d=Math.cos(g)*(i?i/2:h),o=Math.cos(g)*h,s=Math.sin(g)*h,f=Math.sin(g)*(i?i/2:h),e.moveTo(n-d,r-s),e.lineTo(n+d,r+s),e.moveTo(n+f,r-o),e.lineTo(n-f,r+o),g+=Aa,d=Math.cos(g)*(i?i/2:h),o=Math.cos(g)*h,s=Math.sin(g)*h,f=Math.sin(g)*(i?i/2:h),e.moveTo(n-d,r-s),e.lineTo(n+d,r+s),e.moveTo(n+f,r-o),e.lineTo(n-f,r+o);break;case`line`:o=i?i/2:Math.cos(g)*h,s=Math.sin(g)*h,e.moveTo(n-o,r-s),e.lineTo(n+o,r+s);break;case`dash`:e.moveTo(n,r),e.lineTo(n+Math.cos(g)*(i?i/2:h),r+Math.sin(g)*h);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function Wo(e,t,n){return n||=.5,!t||e&&e.x>t.left-n&&e.x<t.right+n&&e.y>t.top-n&&e.y<t.bottom+n}function Go(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function Ko(e){e.restore()}function qo(e,t,n,r,i){if(!t)return e.lineTo(n.x,n.y);if(i===`middle`){let r=(t.x+n.x)/2;e.lineTo(r,t.y),e.lineTo(r,n.y)}else i===`after`==!!r?e.lineTo(n.x,t.y):e.lineTo(t.x,n.y);e.lineTo(n.x,n.y)}function Jo(e,t,n,r){if(!t)return e.lineTo(n.x,n.y);e.bezierCurveTo(r?t.cp1x:t.cp2x,r?t.cp1y:t.cp2y,r?n.cp2x:n.cp1x,r?n.cp2y:n.cp1y,n.x,n.y)}function Yo(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),U(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}function Xo(e,t,n,r,i){if(i.strikethrough||i.underline){let a=e.measureText(r),o=t-a.actualBoundingBoxLeft,s=t+a.actualBoundingBoxRight,c=n-a.actualBoundingBoxAscent,l=n+a.actualBoundingBoxDescent,u=i.strikethrough?(c+l)/2:l;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=i.decorationWidth||2,e.moveTo(o,u),e.lineTo(s,u),e.stroke()}}function Zo(e,t){let n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function Qo(e,t,n,r,i,a={}){let o=W(t)?t:[t],s=a.strokeWidth>0&&a.strokeColor!==``,c,l;for(e.save(),e.font=i.string,Yo(e,a),c=0;c<o.length;++c)l=o[c],a.backdrop&&Zo(e,a.backdrop),s&&(a.strokeColor&&(e.strokeStyle=a.strokeColor),U(a.strokeWidth)||(e.lineWidth=a.strokeWidth),e.strokeText(l,n,r,a.maxWidth)),e.fillText(l,n,r,a.maxWidth),Xo(e,n,r,l,a),r+=Number(i.lineHeight);e.restore()}function $o(e,t){let{x:n,y:r,w:i,h:a,radius:o}=t;e.arc(n+o.topLeft,r+o.topLeft,o.topLeft,1.5*X,X,!0),e.lineTo(n,r+a-o.bottomLeft),e.arc(n+o.bottomLeft,r+a-o.bottomLeft,o.bottomLeft,X,ka,!0),e.lineTo(n+i-o.bottomRight,r+a),e.arc(n+i-o.bottomRight,r+a-o.bottomRight,o.bottomRight,ka,0,!0),e.lineTo(n+i,r+o.topRight),e.arc(n+i-o.topRight,r+o.topRight,o.topRight,0,-ka,!0),e.lineTo(n+o.topLeft,r)}var es=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,ts=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function ns(e,t){let n=(``+e).match(es);if(!n||n[1]===`normal`)return t*1.2;switch(e=+n[2],n[3]){case`px`:return e;case`%`:e/=100;break}return t*e}var rs=e=>+e||0;function is(e,t){let n={},r=G(t),i=r?Object.keys(t):t,a=G(e)?r?n=>q(e[n],e[t[n]]):t=>e[t]:()=>e;for(let e of i)n[e]=rs(a(e));return n}function as(e){return is(e,{top:`y`,right:`x`,bottom:`y`,left:`x`})}function os(e){return is(e,[`topLeft`,`topRight`,`bottomLeft`,`bottomRight`])}function Q(e){let t=as(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function $(e,t){e||={},t||=Z.font;let n=q(e.size,t.size);typeof n==`string`&&(n=parseInt(n,10));let r=q(e.style,t.style);r&&!(``+r).match(ts)&&(console.warn(`Invalid font style specified: "`+r+`"`),r=void 0);let i={family:q(e.family,t.family),lineHeight:ns(q(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:q(e.weight,t.weight),string:``};return i.string=Lo(i),i}function ss(e,t,n,r){let i=!0,a,o,s;for(a=0,o=e.length;a<o;++a)if(s=e[a],s!==void 0&&(t!==void 0&&typeof s==`function`&&(s=s(t),i=!1),n!==void 0&&W(s)&&(s=s[n%s.length],i=!1),s!==void 0))return r&&!i&&(r.cacheable=!1),s}function cs(e,t,n){let{min:r,max:i}=e,a=ca(t,(i-r)/2),o=(e,t)=>n&&e===0?0:e+t;return{min:o(r,-Math.abs(a)),max:o(i,a)}}function ls(e,t){return Object.assign(Object.create(e),t)}function us(e,t=[``],n,r,i=()=>e[0]){let a=n||e;return r===void 0&&(r=Es(`_fallback`,e)),new Proxy({[Symbol.toStringTag]:`Object`,_cacheable:!0,_scopes:e,_rootScopes:a,_fallback:r,_getTarget:i,override:n=>us([n,...e],t,a,r)},{deleteProperty(t,n){return delete t[n],delete t._keys,delete e[0][n],!0},get(n,r){return hs(n,r,()=>Ts(r,t,e,n))},getOwnPropertyDescriptor(e,t){return Reflect.getOwnPropertyDescriptor(e._scopes[0],t)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(e,t){return Ds(e).includes(t)},ownKeys(e){return Ds(e)},set(e,t,n){let r=e._storage||=i();return e[t]=r[t]=n,delete e._keys,!0}})}function ds(e,t,n,r){let i={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:fs(e,r),setContext:t=>ds(e,t,n,r),override:i=>ds(e.override(i),t,n,r)};return new Proxy(i,{deleteProperty(t,n){return delete t[n],delete e[n],!0},get(e,t,n){return hs(e,t,()=>gs(e,t,n))},getOwnPropertyDescriptor(t,n){return t._descriptors.allKeys?Reflect.has(e,n)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,n)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(t,n){return Reflect.has(e,n)},ownKeys(){return Reflect.ownKeys(e)},set(t,n,r){return e[n]=r,delete t[n],!0}})}function fs(e,t={scriptable:!0,indexable:!0}){let{_scriptable:n=t.scriptable,_indexable:r=t.indexable,_allKeys:i=t.allKeys}=e;return{allKeys:i,scriptable:n,indexable:r,isScriptable:Sa(n)?n:()=>n,isIndexable:Sa(r)?r:()=>r}}var ps=(e,t)=>e?e+ba(t):t,ms=(e,t)=>G(t)&&e!==`adapters`&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function hs(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t===`constructor`)return e[t];let r=n();return e[t]=r,r}function gs(e,t,n){let{_proxy:r,_context:i,_subProxy:a,_descriptors:o}=e,s=r[t];return Sa(s)&&o.isScriptable(t)&&(s=_s(t,s,e,n)),W(s)&&s.length&&(s=vs(t,s,e,o.isIndexable)),ms(t,s)&&(s=ds(s,i,a&&a[t],o)),s}function _s(e,t,n,r){let{_proxy:i,_context:a,_subProxy:o,_stack:s}=n;if(s.has(e))throw Error(`Recursion detected: `+Array.from(s).join(`->`)+`->`+e);s.add(e);let c=t(a,o||r);return s.delete(e),ms(e,c)&&(c=Ss(i._scopes,i,e,c)),c}function vs(e,t,n,r){let{_proxy:i,_context:a,_subProxy:o,_descriptors:s}=n;if(a.index!==void 0&&r(e))return t[a.index%t.length];if(G(t[0])){let n=t,r=i._scopes.filter(e=>e!==n);t=[];for(let c of n){let n=Ss(r,i,e,c);t.push(ds(n,a,o&&o[e],s))}}return t}function ys(e,t,n){return Sa(e)?e(t,n):e}var bs=(e,t)=>e===!0?t:typeof e==`string`?ya(t,e):void 0;function xs(e,t,n,r,i){for(let a of t){let t=bs(n,a);if(t){e.add(t);let a=ys(t._fallback,n,i);if(a!==void 0&&a!==n&&a!==r)return a}else if(t===!1&&r!==void 0&&n!==r)return null}return!1}function Ss(e,t,n,r){let i=t._rootScopes,a=ys(t._fallback,n,r),o=[...e,...i],s=new Set;s.add(r);let c=Cs(s,o,n,a||n,r);return c===null||a!==void 0&&a!==n&&(c=Cs(s,o,a,c,r),c===null)?!1:us(Array.from(s),[``],i,a,()=>ws(t,n,r))}function Cs(e,t,n,r,i){for(;n;)n=xs(e,t,n,r,i);return n}function ws(e,t,n){let r=e._getTarget();t in r||(r[t]={});let i=r[t];return W(i)&&G(n)?n:i||{}}function Ts(e,t,n,r){let i;for(let a of t)if(i=Es(ps(a,e),n),i!==void 0)return ms(e,i)?Ss(n,r,e,i):i}function Es(e,t){for(let n of t){if(!n)continue;let t=n[e];if(t!==void 0)return t}}function Ds(e){let t=e._keys;return t||=e._keys=Os(e._scopes),t}function Os(e){let t=new Set;for(let n of e)for(let e of Object.keys(n).filter(e=>!e.startsWith(`_`)))t.add(e);return Array.from(t)}var ks=2**-52||1e-14,As=(e,t)=>t<e.length&&!e[t].skip&&e[t],js=e=>e===`x`?`y`:`x`;function Ms(e,t,n,r){let i=e.skip?t:e,a=t,o=n.skip?t:n,s=Ga(a,i),c=Ga(o,a),l=s/(s+c),u=c/(s+c);l=isNaN(l)?0:l,u=isNaN(u)?0:u;let d=r*l,f=r*u;return{previous:{x:a.x-d*(o.x-i.x),y:a.y-d*(o.y-i.y)},next:{x:a.x+f*(o.x-i.x),y:a.y+f*(o.y-i.y)}}}function Ns(e,t,n){let r=e.length,i,a,o,s,c,l=As(e,0);for(let u=0;u<r-1;++u)if(c=l,l=As(e,u+1),!(!c||!l)){if(Pa(t[u],0,ks)){n[u]=n[u+1]=0;continue}i=n[u]/t[u],a=n[u+1]/t[u],s=i**2+a**2,!(s<=9)&&(o=3/Math.sqrt(s),n[u]=i*o*t[u],n[u+1]=a*o*t[u])}}function Ps(e,t,n=`x`){let r=js(n),i=e.length,a,o,s,c=As(e,0);for(let l=0;l<i;++l){if(o=s,s=c,c=As(e,l+1),!s)continue;let i=s[n],u=s[r];o&&(a=(i-o[n])/3,s[`cp1${n}`]=i-a,s[`cp1${r}`]=u-a*t[l]),c&&(a=(c[n]-i)/3,s[`cp2${n}`]=i+a,s[`cp2${r}`]=u+a*t[l])}}function Fs(e,t=`x`){let n=js(t),r=e.length,i=Array(r).fill(0),a=Array(r),o,s,c,l=As(e,0);for(o=0;o<r;++o)if(s=c,c=l,l=As(e,o+1),c){if(l){let e=l[t]-c[t];i[o]=e===0?0:(l[n]-c[n])/e}a[o]=s?l?Na(i[o-1])===Na(i[o])?(i[o-1]+i[o])/2:0:i[o-1]:i[o]}Ns(e,i,a),Ps(e,a,t)}function Is(e,t,n){return Math.max(Math.min(e,n),t)}function Ls(e,t){let n,r,i,a,o,s=Wo(e[0],t);for(n=0,r=e.length;n<r;++n)o=a,a=s,s=n<r-1&&Wo(e[n+1],t),a&&(i=e[n],o&&(i.cp1x=Is(i.cp1x,t.left,t.right),i.cp1y=Is(i.cp1y,t.top,t.bottom)),s&&(i.cp2x=Is(i.cp2x,t.left,t.right),i.cp2y=Is(i.cp2y,t.top,t.bottom)))}function Rs(e,t,n,r,i){let a,o,s,c;if(t.spanGaps&&(e=e.filter(e=>!e.skip)),t.cubicInterpolationMode===`monotone`)Fs(e,i);else{let n=r?e[e.length-1]:e[0];for(a=0,o=e.length;a<o;++a)s=e[a],c=Ms(n,s,e[Math.min(a+1,o-+!r)%o],t.tension),s.cp1x=c.previous.x,s.cp1y=c.previous.y,s.cp2x=c.next.x,s.cp2y=c.next.y,n=s}t.capBezierPoints&&Ls(e,n)}function zs(){return typeof window<`u`&&typeof document<`u`}function Bs(e){let t=e.parentNode;return t&&t.toString()===`[object ShadowRoot]`&&(t=t.host),t}function Vs(e,t,n){let r;return typeof e==`string`?(r=parseInt(e,10),e.indexOf(`%`)!==-1&&(r=r/100*t.parentNode[n])):r=e,r}var Hs=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function Us(e,t){return Hs(e).getPropertyValue(t)}var Ws=[`top`,`right`,`bottom`,`left`];function Gs(e,t,n){let r={};n=n?`-`+n:``;for(let i=0;i<4;i++){let a=Ws[i];r[a]=parseFloat(e[t+`-`+a+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}var Ks=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function qs(e,t){let n=e.touches,r=n&&n.length?n[0]:e,{offsetX:i,offsetY:a}=r,o=!1,s,c;if(Ks(i,a,e.target))s=i,c=a;else{let e=t.getBoundingClientRect();s=r.clientX-e.left,c=r.clientY-e.top,o=!0}return{x:s,y:c,box:o}}function Js(e,t){if(`native`in e)return e;let{canvas:n,currentDevicePixelRatio:r}=t,i=Hs(n),a=i.boxSizing===`border-box`,o=Gs(i,`padding`),s=Gs(i,`border`,`width`),{x:c,y:l,box:u}=qs(e,n),d=o.left+(u&&s.left),f=o.top+(u&&s.top),{width:p,height:m}=t;return a&&(p-=o.width+s.width,m-=o.height+s.height),{x:Math.round((c-d)/p*n.width/r),y:Math.round((l-f)/m*n.height/r)}}function Ys(e,t,n){let r,i;if(t===void 0||n===void 0){let a=e&&Bs(e);if(!a)t=e.clientWidth,n=e.clientHeight;else{let e=a.getBoundingClientRect(),o=Hs(a),s=Gs(o,`border`,`width`),c=Gs(o,`padding`);t=e.width-c.width-s.width,n=e.height-c.height-s.height,r=Vs(o.maxWidth,a,`clientWidth`),i=Vs(o.maxHeight,a,`clientHeight`)}}return{width:t,height:n,maxWidth:r||Da,maxHeight:i||Da}}var Xs=e=>Math.round(e*10)/10;function Zs(e,t,n,r){let i=Hs(e),a=Gs(i,`margin`),o=Vs(i.maxWidth,e,`clientWidth`)||Da,s=Vs(i.maxHeight,e,`clientHeight`)||Da,c=Ys(e,t,n),{width:l,height:u}=c;if(i.boxSizing===`content-box`){let e=Gs(i,`border`,`width`),t=Gs(i,`padding`);l-=t.width+e.width,u-=t.height+e.height}return l=Math.max(0,l-a.width),u=Math.max(0,r?l/r:u-a.height),l=Xs(Math.min(l,o,c.maxWidth)),u=Xs(Math.min(u,s,c.maxHeight)),l&&!u&&(u=Xs(l/2)),(t!==void 0||n!==void 0)&&r&&c.height&&u>c.height&&(u=c.height,l=Xs(Math.floor(u*r))),{width:l,height:u}}function Qs(e,t,n){let r=t||1,i=Xs(e.height*r),a=Xs(e.width*r);e.height=Xs(e.height),e.width=Xs(e.width);let o=e.canvas;return o.style&&(n||!o.style.height&&!o.style.width)&&(o.style.height=`${e.height}px`,o.style.width=`${e.width}px`),e.currentDevicePixelRatio!==r||o.height!==i||o.width!==a?(e.currentDevicePixelRatio=r,o.height=i,o.width=a,e.ctx.setTransform(r,0,0,r,0,0),!0):!1}var $s=function(){let e=!1;try{let t={get passive(){return e=!0,!1}};zs()&&(window.addEventListener(`test`,null,t),window.removeEventListener(`test`,null,t))}catch{}return e}();function ec(e,t){let n=Us(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function tc(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function nc(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:r===`middle`?n<.5?e.y:t.y:r===`after`?n<1?e.y:t.y:n>0?t.y:e.y}}function rc(e,t,n,r){let i={x:e.cp2x,y:e.cp2y},a={x:t.cp1x,y:t.cp1y},o=tc(e,i,n),s=tc(i,a,n),c=tc(a,t,n);return tc(tc(o,s,n),tc(s,c,n),n)}var ic=function(e,t){return{x(n){return e+e+t-n},setWidth(e){t=e},textAlign(e){return e===`center`?e:e===`right`?`left`:`right`},xPlus(e,t){return e-t},leftForLtr(e,t){return e-t}}},ac=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function oc(e,t,n){return e?ic(t,n):ac()}function sc(e,t){let n,r;(t===`ltr`||t===`rtl`)&&(n=e.canvas.style,r=[n.getPropertyValue(`direction`),n.getPropertyPriority(`direction`)],n.setProperty(`direction`,t,`important`),e.prevTextDirection=r)}function cc(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty(`direction`,t[0],t[1]))}function lc(e){return e===`angle`?{between:Ja,compare:Ka,normalize:qa}:{between:Za,compare:(e,t)=>e-t,normalize:e=>e}}function uc({start:e,end:t,count:n,loop:r,style:i}){return{start:e%n,end:t%n,loop:r&&(t-e+1)%n===0,style:i}}function dc(e,t,n){let{property:r,start:i,end:a}=n,{between:o,normalize:s}=lc(r),c=t.length,{start:l,end:u,loop:d}=e,f,p;if(d){for(l+=c,u+=c,f=0,p=c;f<p&&o(s(t[l%c][r]),i,a);++f)l--,u--;l%=c,u%=c}return u<l&&(u+=c),{start:l,end:u,loop:d,style:e.style}}function fc(e,t,n){if(!n)return[e];let{property:r,start:i,end:a}=n,o=t.length,{compare:s,between:c,normalize:l}=lc(r),{start:u,end:d,loop:f,style:p}=dc(e,t,n),m=[],h=!1,g=null,_,v,y,b=()=>c(i,y,_)&&s(i,y)!==0,x=()=>s(a,_)===0||c(a,y,_),S=()=>h||b(),C=()=>!h||x();for(let e=u,n=u;e<=d;++e)v=t[e%o],!v.skip&&(_=l(v[r]),_!==y&&(h=c(_,i,a),g===null&&S()&&(g=s(_,i)===0?e:n),g!==null&&C()&&(m.push(uc({start:g,end:e,loop:f,count:o,style:p})),g=null),n=e,y=_));return g!==null&&m.push(uc({start:g,end:d,loop:f,count:o,style:p})),m}function pc(e,t){let n=[],r=e.segments;for(let i=0;i<r.length;i++){let a=fc(r[i],e.points,t);a.length&&n.push(...a)}return n}function mc(e,t,n,r){let i=0,a=t-1;if(n&&!r)for(;i<t&&!e[i].skip;)i++;for(;i<t&&e[i].skip;)i++;for(i%=t,n&&(a+=i);a>i&&e[a%t].skip;)a--;return a%=t,{start:i,end:a}}function hc(e,t,n,r){let i=e.length,a=[],o=t,s=e[t],c;for(c=t+1;c<=n;++c){let n=e[c%i];n.skip||n.stop?s.skip||(r=!1,a.push({start:t%i,end:(c-1)%i,loop:r}),t=o=n.stop?c:null):(o=c,s.skip&&(t=c)),s=n}return o!==null&&a.push({start:t%i,end:o%i,loop:r}),a}function gc(e,t){let n=e.points,r=e.options.spanGaps,i=n.length;if(!i)return[];let a=!!e._loop,{start:o,end:s}=mc(n,i,a,r);return r===!0?_c(e,[{start:o,end:s,loop:a}],n,t):_c(e,hc(n,o,s<o?s+i:s,!!e._fullLoop&&o===0&&s===i-1),n,t)}function _c(e,t,n,r){return!r||!r.setContext||!n?t:vc(e,t,n,r)}function vc(e,t,n,r){let i=e._chart.getContext(),a=yc(e.options),{_datasetIndex:o,options:{spanGaps:s}}=e,c=n.length,l=[],u=a,d=t[0].start,f=d;function p(e,t,r,i){let a=s?-1:1;if(e!==t){for(e+=c;n[e%c].skip;)e-=a;for(;n[t%c].skip;)t+=a;e%c!==t%c&&(l.push({start:e%c,end:t%c,loop:r,style:i}),u=i,d=t%c)}}for(let e of t){d=s?d:e.start;let t=n[d%c],a;for(f=d+1;f<=e.end;f++){let s=n[f%c];a=yc(r.setContext(ls(i,{type:`segment`,p0:t,p1:s,p0DataIndex:(f-1)%c,p1DataIndex:f%c,datasetIndex:o}))),bc(a,u)&&p(d,f-1,e.loop,u),t=s,u=a}d<f-1&&p(d,f-1,e.loop,u)}return l}function yc(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function bc(e,t){if(!t)return!1;let n=[],r=function(e,t){return yo(t)?(n.includes(t)||n.push(t),n.indexOf(t)):t};return JSON.stringify(e,r)!==JSON.stringify(t,r)}function xc(e,t,n){return e.options.clip?e[n]:t[n]}function Sc(e,t){let{xScale:n,yScale:r}=e;return n&&r?{left:xc(n,t,`left`),right:xc(n,t,`right`),top:xc(r,t,`top`),bottom:xc(r,t,`bottom`)}:t}function Cc(e,t){let n=t._clip;if(n.disabled)return!1;let r=Sc(t,e.chartArea);return{left:n.left===!1?0:r.left-(n.left===!0?0:n.left),right:n.right===!1?e.width:r.right+(n.right===!0?0:n.right),top:n.top===!1?0:r.top-(n.top===!0?0:n.top),bottom:n.bottom===!1?e.height:r.bottom+(n.bottom===!0?0:n.bottom)}}var wc=new class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,t,n,r){let i=t.listeners[r],a=t.duration;i.forEach(r=>r({chart:e,initial:t.initial,numSteps:a,currentStep:Math.min(n-t.start,a)}))}_refresh(){this._request||=(this._running=!0,oo.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 i=n.items,a=i.length-1,o=!1,s;for(;a>=0;--a)s=i[a],s._active?(s._total>n.duration&&(n.duration=s._total),s.tick(e),o=!0):(i[a]=i[i.length-1],i.pop());o&&(r.draw(),this._notify(r,n,e,`progress`)),i.length||(n.running=!1,this._notify(r,n,e,`complete`),n.initial=!1),t+=i.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((e,t)=>Math.max(e,t._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)}},Tc=`transparent`,Ec={boolean(e,t,n){return n>.5?t:e},color(e,t,n){let r=bo(e||Tc),i=r.valid&&bo(t||Tc);return i&&i.valid?i.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}},Dc=class{constructor(e,t,n,r){let i=t[n];r=ss([e.to,r,i,e.from]);let a=ss([e.from,i,r]);this._active=!0,this._fn=e.fn||Ec[e.type||typeof a],this._easing=vo[e.easing]||vo.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=a,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],i=n-this._start,a=this._duration-i;this._start=n,this._duration=Math.floor(Math.max(a,e.duration)),this._total+=i,this._loop=!!e.loop,this._to=ss([e.to,t,r,e.from]),this._from=ss([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,i=this._from,a=this._loop,o=this._to,s;if(this._active=i!==o&&(a||t<n),!this._active){this._target[r]=o,this._notify(!0);return}if(t<0){this._target[r]=i;return}s=t/n%2,s=a&&s>1?2-s:s,s=this._easing(Math.min(1,Math.max(0,s))),this._target[r]=this._fn(i,o,s)}wait(){let e=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 e=0;e<n.length;e++)n[e][t]()}},Oc=class{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!G(e))return;let t=Object.keys(Z.animation),n=this._properties;Object.getOwnPropertyNames(e).forEach(r=>{let i=e[r];if(!G(i))return;let a={};for(let e of t)a[e]=i[e];(W(i.properties)&&i.properties||[r]).forEach(e=>{(e===r||!n.has(e))&&n.set(e,a)})})}_animateOptions(e,t){let n=t.options,r=Ac(e,n);if(!r)return[];let i=this._createAnimations(r,n);return n.$shared&&kc(e.options.$animations,n).then(()=>{e.options=n},()=>{}),i}_createAnimations(e,t){let n=this._properties,r=[],i=e.$animations||={},a=Object.keys(t),o=Date.now(),s;for(s=a.length-1;s>=0;--s){let c=a[s];if(c.charAt(0)===`$`)continue;if(c===`options`){r.push(...this._animateOptions(e,t));continue}let l=t[c],u=i[c],d=n.get(c);if(u)if(d&&u.active()){u.update(d,l,o);continue}else u.cancel();if(!d||!d.duration){e[c]=l;continue}i[c]=u=new Dc(d,e,c,l),r.push(u)}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 wc.add(this._chart,n),!0}};function kc(e,t){let n=[],r=Object.keys(t);for(let t=0;t<r.length;t++){let i=e[r[t]];i&&i.active()&&n.push(i.wait())}return Promise.all(n)}function Ac(e,t){if(!t)return;let n=e.options;if(!n){e.options=t;return}return n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function jc(e,t){let n=e&&e.options||{},r=n.reverse,i=n.min===void 0?t:0,a=n.max===void 0?t:0;return{start:r?a:i,end:r?i:a}}function Mc(e,t,n){if(n===!1)return!1;let r=jc(e,n),i=jc(t,n);return{top:i.end,right:r.end,bottom:i.start,left:r.start}}function Nc(e){let t,n,r,i;return G(e)?(t=e.top,n=e.right,r=e.bottom,i=e.left):t=n=r=i=e,{top:t,right:n,bottom:r,left:i,disabled:e===!1}}function Pc(e,t){let n=[],r=e._getSortedDatasetMetas(t),i,a;for(i=0,a=r.length;i<a;++i)n.push(r[i].index);return n}function Fc(e,t,n,r={}){let i=e.keys,a=r.mode===`single`,o,s,c,l;if(t===null)return;let u=!1;for(o=0,s=i.length;o<s;++o){if(c=+i[o],c===n){if(u=!0,r.all)continue;break}l=e.values[c],K(l)&&(a||t===0||Na(t)===Na(l))&&(t+=l)}return!u&&!r.all?0:t}function Ic(e,t){let{iScale:n,vScale:r}=t,i=n.axis===`x`?`x`:`y`,a=r.axis===`x`?`x`:`y`,o=Object.keys(e),s=Array(o.length),c,l,u;for(c=0,l=o.length;c<l;++c)u=o[c],s[c]={[i]:u,[a]:e[u]};return s}function Lc(e,t){let n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function Rc(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function zc(e){let{min:t,max:n,minDefined:r,maxDefined:i}=e.getUserBounds();return{min:r?t:-1/0,max:i?n:1/0}}function Bc(e,t,n){let r=e[t]||(e[t]={});return r[n]||(r[n]={})}function Vc(e,t,n,r){for(let i of t.getMatchingVisibleMetas(r).reverse()){let t=e[i.index];if(n&&t>0||!n&&t<0)return i.index}return null}function Hc(e,t){let{chart:n,_cachedMeta:r}=e,i=n._stacks||={},{iScale:a,vScale:o,index:s}=r,c=a.axis,l=o.axis,u=Rc(a,o,r),d=t.length,f;for(let e=0;e<d;++e){let n=t[e],{[c]:a,[l]:d}=n,p=n._stacks||={};f=p[l]=Bc(i,u,a),f[s]=d,f._top=Vc(f,o,!0,r.type),f._bottom=Vc(f,o,!1,r.type);let m=f._visualValues||={};m[s]=d}}function Uc(e,t){let n=e.scales;return Object.keys(n).filter(e=>n[e].axis===t).shift()}function Wc(e,t){return ls(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:`default`,type:`dataset`})}function Gc(e,t,n){return ls(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:`default`,type:`data`})}function Kc(e,t){let n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t||=e._parsed;for(let e of t){let t=e._stacks;if(!t||t[r]===void 0||t[r][n]===void 0)return;delete t[r][n],t[r]._visualValues!==void 0&&t[r]._visualValues[n]!==void 0&&delete t[r]._visualValues[n]}}}var qc=e=>e===`reset`||e===`none`,Jc=(e,t)=>t?e:Object.assign({},e),Yc=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:Pc(n,!0),values:null},Xc=class{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(e,t){this.chart=e,this._ctx=e.ctx,this.index=t,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 e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=Lc(e.vScale,e),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(e){this.index!==e&&Kc(this._cachedMeta),this.index=e}linkScales(){let e=this.chart,t=this._cachedMeta,n=this.getDataset(),r=(e,t,n,r)=>e===`x`?t:e===`r`?r:n,i=t.xAxisID=q(n.xAxisID,Uc(e,`x`)),a=t.yAxisID=q(n.yAxisID,Uc(e,`y`)),o=t.rAxisID=q(n.rAxisID,Uc(e,`r`)),s=t.indexAxis,c=t.iAxisID=r(s,i,a,o),l=t.vAxisID=r(s,a,i,o);t.xScale=this.getScaleForId(i),t.yScale=this.getScaleForId(a),t.rScale=this.getScaleForId(o),t.iScale=this.getScaleForId(c),t.vScale=this.getScaleForId(l)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){let t=this._cachedMeta;return e===t.iScale?t.vScale:t.iScale}reset(){this._update(`reset`)}_destroy(){let e=this._cachedMeta;this._data&&io(this._data,this),e._stacked&&Kc(e)}_dataCheck(){let e=this.getDataset(),t=e.data||=[],n=this._data;if(G(t)){let e=this._cachedMeta;this._data=Ic(t,e)}else if(n!==t){if(n){io(n,this);let e=this._cachedMeta;Kc(e),e._parsed=[]}t&&Object.isExtensible(t)&&ro(t,this),this._syncList=[],this._data=t}}addElements(){let e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){let t=this._cachedMeta,n=this.getDataset(),r=!1;this._dataCheck();let i=t._stacked;t._stacked=Lc(t.vScale,t),t.stack!==n.stack&&(r=!0,Kc(t),t.stack=n.stack),this._resyncElements(e),(r||i!==t._stacked)&&(Hc(this,t._parsed),t._stacked=Lc(t.vScale,t))}configure(){let e=this.chart.config,t=e.datasetScopeKeys(this._type),n=e.getOptionScopes(this.getDataset(),t,!0);this.options=e.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,t){let{_cachedMeta:n,_data:r}=this,{iScale:i,_stacked:a}=n,o=i.axis,s=e===0&&t===r.length?!0:n._sorted,c=e>0&&n._parsed[e-1],l,u,d;if(this._parsing===!1)n._parsed=r,n._sorted=!0,d=r;else{d=W(r[e])?this.parseArrayData(n,r,e,t):G(r[e])?this.parseObjectData(n,r,e,t):this.parsePrimitiveData(n,r,e,t);let i=()=>u[o]===null||c&&u[o]<c[o];for(l=0;l<t;++l)n._parsed[l+e]=u=d[l],s&&(i()&&(s=!1),c=u);n._sorted=s}a&&Hc(this,d)}parsePrimitiveData(e,t,n,r){let{iScale:i,vScale:a}=e,o=i.axis,s=a.axis,c=i.getLabels(),l=i===a,u=Array(r),d,f,p;for(d=0,f=r;d<f;++d)p=d+n,u[d]={[o]:l||i.parse(c[p],p),[s]:a.parse(t[p],p)};return u}parseArrayData(e,t,n,r){let{xScale:i,yScale:a}=e,o=Array(r),s,c,l,u;for(s=0,c=r;s<c;++s)l=s+n,u=t[l],o[s]={x:i.parse(u[0],l),y:a.parse(u[1],l)};return o}parseObjectData(e,t,n,r){let{xScale:i,yScale:a}=e,{xAxisKey:o=`x`,yAxisKey:s=`y`}=this._parsing,c=Array(r),l,u,d,f;for(l=0,u=r;l<u;++l)d=l+n,f=t[d],c[l]={x:i.parse(ya(f,o),d),y:a.parse(ya(f,s),d)};return c}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,t,n){let r=this.chart,i=this._cachedMeta,a=t[e.axis];return Fc({keys:Pc(r,!0),values:t._stacks[e.axis]._visualValues},a,i.index,{mode:n})}updateRangeFromParsed(e,t,n,r){let i=n[t.axis],a=i===null?NaN:i,o=r&&n._stacks[t.axis];r&&o&&(r.values=o,a=Fc(r,i,this._cachedMeta.index)),e.min=Math.min(e.min,a),e.max=Math.max(e.max,a)}getMinMax(e,t){let n=this._cachedMeta,r=n._parsed,i=n._sorted&&e===n.iScale,a=r.length,o=this._getOtherScale(e),s=Yc(t,n,this.chart),c={min:1/0,max:-1/0},{min:l,max:u}=zc(o),d,f;function p(){f=r[d];let t=f[o.axis];return!K(f[e.axis])||l>t||u<t}for(d=0;d<a&&!(!p()&&(this.updateRangeFromParsed(c,e,f,s),i));++d);if(i){for(d=a-1;d>=0;--d)if(!p()){this.updateRangeFromParsed(c,e,f,s);break}}return c}getAllParsedValues(e){let t=this._cachedMeta._parsed,n=[],r,i,a;for(r=0,i=t.length;r<i;++r)a=t[r][e.axis],K(a)&&n.push(a);return n}getMaxOverflow(){return!1}getLabelAndValue(e){let t=this._cachedMeta,n=t.iScale,r=t.vScale,i=this.getParsed(e);return{label:n?``+n.getLabelForValue(i[n.axis]):``,value:r?``+r.getLabelForValue(i[r.axis]):``}}_update(e){let t=this._cachedMeta;this.update(e||`default`),t._clip=Nc(q(this.options.clip,Mc(t.xScale,t.yScale,this.getMaxOverflow())))}update(e){}draw(){let e=this._ctx,t=this.chart,n=this._cachedMeta,r=n.data||[],i=t.chartArea,a=[],o=this._drawStart||0,s=this._drawCount||r.length-o,c=this.options.drawActiveElementsOnTop,l;for(n.dataset&&n.dataset.draw(e,i,o,s),l=o;l<o+s;++l){let t=r[l];t.hidden||(t.active&&c?a.push(t):t.draw(e,i))}for(l=0;l<a.length;++l)a[l].draw(e,i)}getStyle(e,t){let n=t?`active`:`default`;return e===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(n):this.resolveDataElementOptions(e||0,n)}getContext(e,t,n){let r=this.getDataset(),i;if(e>=0&&e<this._cachedMeta.data.length){let t=this._cachedMeta.data[e];i=t.$context||=Gc(this.getContext(),e,t),i.parsed=this.getParsed(e),i.raw=r.data[e],i.index=i.dataIndex=e}else i=this.$context||=Wc(this.chart.getContext(),this.index),i.dataset=r,i.index=i.datasetIndex=this.index;return i.active=!!t,i.mode=n,i}resolveDatasetElementOptions(e){return this._resolveElementOptions(this.datasetElementType.id,e)}resolveDataElementOptions(e,t){return this._resolveElementOptions(this.dataElementType.id,t,e)}_resolveElementOptions(e,t=`default`,n){let r=t===`active`,i=this._cachedDataOpts,a=e+`-`+t,o=i[a],s=this.enableOptionSharing&&xa(n);if(o)return Jc(o,s);let c=this.chart.config,l=c.datasetElementScopeKeys(this._type,e),u=r?[`${e}Hover`,`hover`,e,``]:[e,``],d=c.getOptionScopes(this.getDataset(),l),f=Object.keys(Z.elements[e]),p=c.resolveNamedOptions(d,f,()=>this.getContext(n,r,t),u);return p.$shared&&(p.$shared=s,i[a]=Object.freeze(Jc(p,s))),p}_resolveAnimations(e,t,n){let r=this.chart,i=this._cachedDataOpts,a=`animation-${t}`,o=i[a];if(o)return o;let s;if(r.options.animation!==!1){let r=this.chart.config,i=r.datasetAnimationScopeKeys(this._type,t),a=r.getOptionScopes(this.getDataset(),i);s=r.createResolver(a,this.getContext(e,n,t))}let c=new Oc(r,s&&s.animations);return s&&s._cacheable&&(i[a]=Object.freeze(c)),c}getSharedOptions(e){if(e.$shared)return this._sharedOptions||=Object.assign({},e)}includeOptions(e,t){return!t||qc(e)||this.chart._animationsDisabled}_getSharedOptions(e,t){let n=this.resolveDataElementOptions(e,t),r=this._sharedOptions,i=this.getSharedOptions(n),a=this.includeOptions(t,i)||i!==r;return this.updateSharedOptions(i,t,n),{sharedOptions:i,includeOptions:a}}updateElement(e,t,n,r){qc(r)?Object.assign(e,n):this._resolveAnimations(t,r).update(e,n)}updateSharedOptions(e,t,n){e&&!qc(t)&&this._resolveAnimations(void 0,t).update(e,n)}_setStyle(e,t,n,r){e.active=r;let i=this.getStyle(t,r);this._resolveAnimations(t,n,r).update(e,{options:!r&&this.getSharedOptions(i)||i})}removeHoverStyle(e,t,n){this._setStyle(e,n,`active`,!1)}setHoverStyle(e,t,n){this._setStyle(e,n,`active`,!0)}_removeDatasetHoverStyle(){let e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,`active`,!1)}_setDatasetHoverStyle(){let e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,`active`,!0)}_resyncElements(e){let t=this._data,n=this._cachedMeta.data;for(let[e,t,n]of this._syncList)this[e](t,n);this._syncList=[];let r=n.length,i=t.length,a=Math.min(i,r);a&&this.parse(0,a),i>r?this._insertElements(r,i-r,e):i<r&&this._removeElements(i,r-i)}_insertElements(e,t,n=!0){let r=this._cachedMeta,i=r.data,a=e+t,o,s=e=>{for(e.length+=t,o=e.length-1;o>=a;o--)e[o]=e[o-t]};for(s(i),o=e;o<a;++o)i[o]=new this.dataElementType;this._parsing&&s(r._parsed),this.parse(e,t),n&&this.updateElements(i,e,t,`reset`)}updateElements(e,t,n,r){}_removeElements(e,t){let n=this._cachedMeta;if(this._parsing){let r=n._parsed.splice(e,t);n._stacked&&Kc(n,r)}n.data.splice(e,t)}_sync(e){if(this._parsing)this._syncList.push(e);else{let[t,n,r]=e;this[t](n,r)}this.chart._dataChanges.push([this.index,...e])}_onDataPush(){let e=arguments.length;this._sync([`_insertElements`,this.getDataset().data.length-e,e])}_onDataPop(){this._sync([`_removeElements`,this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync([`_removeElements`,0,1])}_onDataSplice(e,t){t&&this._sync([`_removeElements`,e,t]);let n=arguments.length-2;n&&this._sync([`_insertElements`,e,n])}_onDataUnshift(){this._sync([`_insertElements`,0,arguments.length])}},Zc=class extends Xc{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(e){let t=this._cachedMeta,{dataset:n,data:r=[],_dataset:i}=t,a=this.chart._animationsDisabled,{start:o,count:s}=po(t,r,a);this._drawStart=o,this._drawCount=s,mo(t)&&(o=0,s=r.length),n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!i._decimated,n.points=r;let c=this.resolveDatasetElementOptions(e);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(n,void 0,{animated:!a,options:c},e),this.updateElements(r,o,s,e)}updateElements(e,t,n,r){let i=r===`reset`,{iScale:a,vScale:o,_stacked:s,_dataset:c}=this._cachedMeta,{sharedOptions:l,includeOptions:u}=this._getSharedOptions(t,r),d=a.axis,f=o.axis,{spanGaps:p,segment:m}=this.options,h=Ra(p)?p:1/0,g=this.chart._animationsDisabled||i||r===`none`,_=t+n,v=e.length,y=t>0&&this.getParsed(t-1);for(let n=0;n<v;++n){let p=e[n],v=g?p:{};if(n<t||n>=_){v.skip=!0;continue}let b=this.getParsed(n),x=U(b[f]),S=v[d]=a.getPixelForValue(b[d],n),C=v[f]=i||x?o.getBasePixel():o.getPixelForValue(s?this.applyStack(o,b,s):b[f],n);v.skip=isNaN(S)||isNaN(C)||x,v.stop=n>0&&Math.abs(b[d]-y[d])>h,m&&(v.parsed=b,v.raw=c.data[n]),u&&(v.options=l||this.resolveDataElementOptions(n,p.active?`active`:r)),g||this.updateElement(p,n,v,r),y=b}}getMaxOverflow(){let e=this._cachedMeta,t=e.dataset,n=t.options&&t.options.borderWidth||0,r=e.data||[];if(!r.length)return n;let i=r[0].size(this.resolveDataElementOptions(0)),a=r[r.length-1].size(this.resolveDataElementOptions(r.length-1));return Math.max(n,i,a)/2}draw(){let e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}};function Qc(){throw Error(`This method is not implemented: Check that a complete date adapter is provided.`)}var $c={_date:class e{static override(t){Object.assign(e.prototype,t)}options;constructor(e){this.options=e||{}}init(){}formats(){return Qc()}parse(){return Qc()}format(){return Qc()}add(){return Qc()}diff(){return Qc()}startOf(){return Qc()}endOf(){return Qc()}}};function el(e,t,n,r){let{controller:i,data:a,_sorted:o}=e,s=i._cachedMeta.iScale,c=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(s&&t===s.axis&&t!==`r`&&o&&a.length){let o=s._reversePixels?eo:$a;if(!r){let r=o(a,t,n);if(c){let{vScale:t}=i._cachedMeta,{_parsed:n}=e,a=n.slice(0,r.lo+1).reverse().findIndex(e=>!U(e[t.axis]));r.lo-=Math.max(0,a);let o=n.slice(r.hi).findIndex(e=>!U(e[t.axis]));r.hi+=Math.max(0,o)}return r}else if(i._sharedOptions){let e=a[0],r=typeof e.getRange==`function`&&e.getRange(t);if(r){let e=o(a,t,n-r),i=o(a,t,n+r);return{lo:e.lo,hi:i.hi}}}}return{lo:0,hi:a.length-1}}function tl(e,t,n,r,i){let a=e.getSortedVisibleDatasetMetas(),o=n[t];for(let e=0,n=a.length;e<n;++e){let{index:n,data:s}=a[e],{lo:c,hi:l}=el(a[e],t,o,i);for(let e=c;e<=l;++e){let t=s[e];t.skip||r(t,n,e)}}}function nl(e){let t=e.indexOf(`x`)!==-1,n=e.indexOf(`y`)!==-1;return function(e,r){let i=t?Math.abs(e.x-r.x):0,a=n?Math.abs(e.y-r.y):0;return Math.sqrt(i**2+a**2)}}function rl(e,t,n,r,i){let a=[];return!i&&!e.isPointInArea(t)||tl(e,n,t,function(n,o,s){!i&&!Wo(n,e.chartArea,0)||n.inRange(t.x,t.y,r)&&a.push({element:n,datasetIndex:o,index:s})},!0),a}function il(e,t,n,r){let i=[];function a(e,n,a){let{startAngle:o,endAngle:s}=e.getProps([`startAngle`,`endAngle`],r),{angle:c}=Wa(e,{x:t.x,y:t.y});Ja(c,o,s)&&i.push({element:e,datasetIndex:n,index:a})}return tl(e,n,t,a),i}function al(e,t,n,r,i,a){let o=[],s=nl(n),c=1/0;function l(n,l,u){let d=n.inRange(t.x,t.y,i);if(r&&!d)return;let f=n.getCenterPoint(i);if(!(a||e.isPointInArea(f))&&!d)return;let p=s(t,f);p<c?(o=[{element:n,datasetIndex:l,index:u}],c=p):p===c&&o.push({element:n,datasetIndex:l,index:u})}return tl(e,n,t,l),o}function ol(e,t,n,r,i,a){return!a&&!e.isPointInArea(t)?[]:n===`r`&&!r?il(e,t,n,i):al(e,t,n,r,i,a)}function sl(e,t,n,r,i){let a=[],o=n===`x`?`inXRange`:`inYRange`,s=!1;return tl(e,n,t,(e,r,c)=>{e[o]&&e[o](t[n],i)&&(a.push({element:e,datasetIndex:r,index:c}),s||=e.inRange(t.x,t.y,i))}),r&&!s?[]:a}var cl={evaluateInteractionItems:tl,modes:{index(e,t,n,r){let i=Js(t,e),a=n.axis||`x`,o=n.includeInvisible||!1,s=n.intersect?rl(e,i,a,r,o):ol(e,i,a,!1,r,o),c=[];return s.length?(e.getSortedVisibleDatasetMetas().forEach(e=>{let t=s[0].index,n=e.data[t];n&&!n.skip&&c.push({element:n,datasetIndex:e.index,index:t})}),c):[]},dataset(e,t,n,r){let i=Js(t,e),a=n.axis||`xy`,o=n.includeInvisible||!1,s=n.intersect?rl(e,i,a,r,o):ol(e,i,a,!1,r,o);if(s.length>0){let t=s[0].datasetIndex,n=e.getDatasetMeta(t).data;s=[];for(let e=0;e<n.length;++e)s.push({element:n[e],datasetIndex:t,index:e})}return s},point(e,t,n,r){return rl(e,Js(t,e),n.axis||`xy`,r,n.includeInvisible||!1)},nearest(e,t,n,r){let i=Js(t,e),a=n.axis||`xy`,o=n.includeInvisible||!1;return ol(e,i,a,n.intersect,r,o)},x(e,t,n,r){return sl(e,Js(t,e),`x`,n.intersect,r)},y(e,t,n,r){return sl(e,Js(t,e),`y`,n.intersect,r)}}},ll=[`left`,`top`,`right`,`bottom`];function ul(e,t){return e.filter(e=>e.pos===t)}function dl(e,t){return e.filter(e=>ll.indexOf(e.pos)===-1&&e.box.axis===t)}function fl(e,t){return e.sort((e,n)=>{let r=t?n:e,i=t?e:n;return r.weight===i.weight?r.index-i.index:r.weight-i.weight})}function pl(e){let t=[],n,r,i,a,o,s;for(n=0,r=(e||[]).length;n<r;++n)i=e[n],{position:a,options:{stack:o,stackWeight:s=1}}=i,t.push({index:n,box:i,pos:a,horizontal:i.isHorizontal(),weight:i.weight,stack:o&&a+o,stackWeight:s});return t}function ml(e){let t={};for(let n of e){let{stack:e,pos:r,stackWeight:i}=n;if(!e||!ll.includes(r))continue;let a=t[e]||(t[e]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=i}return t}function hl(e,t){let n=ml(e),{vBoxMaxWidth:r,hBoxMaxHeight:i}=t,a,o,s;for(a=0,o=e.length;a<o;++a){s=e[a];let{fullSize:o}=s.box,c=n[s.stack],l=c&&s.stackWeight/c.weight;s.horizontal?(s.width=l?l*r:o&&t.availableWidth,s.height=i):(s.width=r,s.height=l?l*i:o&&t.availableHeight)}return n}function gl(e){let t=pl(e),n=fl(t.filter(e=>e.box.fullSize),!0),r=fl(ul(t,`left`),!0),i=fl(ul(t,`right`)),a=fl(ul(t,`top`),!0),o=fl(ul(t,`bottom`)),s=dl(t,`x`),c=dl(t,`y`);return{fullSize:n,leftAndTop:r.concat(a),rightAndBottom:i.concat(c).concat(o).concat(s),chartArea:ul(t,`chartArea`),vertical:r.concat(i).concat(c),horizontal:a.concat(o).concat(s)}}function _l(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function vl(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function yl(e,t,n,r){let{pos:i,box:a}=n,o=e.maxPadding;if(!G(i)){n.size&&(e[i]-=n.size);let t=r[n.stack]||{size:0,count:1};t.size=Math.max(t.size,n.horizontal?a.height:a.width),n.size=t.size/t.count,e[i]+=n.size}a.getPadding&&vl(o,a.getPadding());let s=Math.max(0,t.outerWidth-_l(o,e,`left`,`right`)),c=Math.max(0,t.outerHeight-_l(o,e,`top`,`bottom`)),l=s!==e.w,u=c!==e.h;return e.w=s,e.h=c,n.horizontal?{same:l,other:u}:{same:u,other:l}}function bl(e){let t=e.maxPadding;function n(n){let r=Math.max(t[n]-e[n],0);return e[n]+=r,r}e.y+=n(`top`),e.x+=n(`left`),n(`right`),n(`bottom`)}function xl(e,t){let n=t.maxPadding;function r(e){let r={left:0,top:0,right:0,bottom:0};return e.forEach(e=>{r[e]=Math.max(t[e],n[e])}),r}return r(e?[`left`,`right`]:[`top`,`bottom`])}function Sl(e,t,n,r){let i=[],a,o,s,c,l,u;for(a=0,o=e.length,l=0;a<o;++a){s=e[a],c=s.box,c.update(s.width||t.w,s.height||t.h,xl(s.horizontal,t));let{same:o,other:d}=yl(t,n,s,r);l|=o&&i.length,u||=d,c.fullSize||i.push(s)}return l&&Sl(i,t,n,r)||u}function Cl(e,t,n,r,i){e.top=n,e.left=t,e.right=t+r,e.bottom=n+i,e.width=r,e.height=i}function wl(e,t,n,r){let i=n.padding,{x:a,y:o}=t;for(let s of e){let e=s.box,c=r[s.stack]||{count:1,placed:0,weight:1},l=s.stackWeight/c.weight||1;if(s.horizontal){let r=t.w*l,a=c.size||e.height;xa(c.start)&&(o=c.start),e.fullSize?Cl(e,i.left,o,n.outerWidth-i.right-i.left,a):Cl(e,t.left+c.placed,o,r,a),c.start=o,c.placed+=r,o=e.bottom}else{let r=t.h*l,o=c.size||e.width;xa(c.start)&&(a=c.start),e.fullSize?Cl(e,a,i.top,o,n.outerHeight-i.bottom-i.top):Cl(e,a,t.top+c.placed,o,r),c.start=a,c.placed+=r,a=e.right}}t.x=a,t.y=o}var Tl={addBox(e,t){e.boxes||=[],t.fullSize=t.fullSize||!1,t.position=t.position||`top`,t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},e.boxes.push(t)},removeBox(e,t){let n=e.boxes?e.boxes.indexOf(t):-1;n!==-1&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,r){if(!e)return;let i=Q(e.options.layout.padding),a=Math.max(t-i.width,0),o=Math.max(n-i.height,0),s=gl(e.boxes),c=s.vertical,l=s.horizontal;Y(e.boxes,e=>{typeof e.beforeLayout==`function`&&e.beforeLayout()});let u=c.reduce((e,t)=>t.box.options&&t.box.options.display===!1?e:e+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:i,availableWidth:a,availableHeight:o,vBoxMaxWidth:a/2/u,hBoxMaxHeight:o/2}),f=Object.assign({},i);vl(f,Q(r));let p=Object.assign({maxPadding:f,w:a,h:o,x:i.left,y:i.top},i),m=hl(c.concat(l),d);Sl(s.fullSize,p,d,m),Sl(c,p,d,m),Sl(l,p,d,m)&&Sl(c,p,d,m),bl(p),wl(s.leftAndTop,p,d,m),p.x+=p.w,p.y+=p.h,wl(s.rightAndBottom,p,d,m),e.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},Y(s.chartArea,t=>{let n=t.box;Object.assign(n,e.chartArea),n.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}},El=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||=e.height,{width:t,height:Math.max(0,r?Math.floor(t/r):n)}}isAttached(e){return!0}updateConfig(e){}},Dl=class extends El{acquireContext(e){return e&&e.getContext&&e.getContext(`2d`)||null}updateConfig(e){e.options.animation=!1}},Ol=`$chartjs`,kl={touchstart:`mousedown`,touchmove:`mousemove`,touchend:`mouseup`,pointerenter:`mouseenter`,pointerdown:`mousedown`,pointermove:`mousemove`,pointerup:`mouseup`,pointerleave:`mouseout`,pointerout:`mouseout`},Al=e=>e===null||e===``;function jl(e,t){let n=e.style,r=e.getAttribute(`height`),i=e.getAttribute(`width`);if(e[Ol]={initial:{height:r,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||`block`,n.boxSizing=n.boxSizing||`border-box`,Al(i)){let t=ec(e,`width`);t!==void 0&&(e.width=t)}if(Al(r))if(e.style.height===``)e.height=e.width/(t||2);else{let t=ec(e,`height`);t!==void 0&&(e.height=t)}return e}var Ml=$s?{passive:!0}:!1;function Nl(e,t,n){e&&e.addEventListener(t,n,Ml)}function Pl(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,Ml)}function Fl(e,t){let n=kl[e.type]||e.type,{x:r,y:i}=Js(e,t);return{type:n,chart:t,native:e,x:r===void 0?null:r,y:i===void 0?null:i}}function Il(e,t){for(let n of e)if(n===t||n.contains(t))return!0}function Ll(e,t,n){let r=e.canvas,i=new MutationObserver(e=>{let t=!1;for(let n of e)t||=Il(n.addedNodes,r),t&&=!Il(n.removedNodes,r);t&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function Rl(e,t,n){let r=e.canvas,i=new MutationObserver(e=>{let t=!1;for(let n of e)t||=Il(n.removedNodes,r),t&&=!Il(n.addedNodes,r);t&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}var zl=new Map,Bl=0;function Vl(){let e=window.devicePixelRatio;e!==Bl&&(Bl=e,zl.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function Hl(e,t){zl.size||window.addEventListener(`resize`,Vl),zl.set(e,t)}function Ul(e){zl.delete(e),zl.size||window.removeEventListener(`resize`,Vl)}function Wl(e,t,n){let r=e.canvas,i=r&&Bs(r);if(!i)return;let a=so((e,t)=>{let r=i.clientWidth;n(e,t),r<i.clientWidth&&n()},window),o=new ResizeObserver(e=>{let t=e[0],n=t.contentRect.width,r=t.contentRect.height;n===0&&r===0||a(n,r)});return o.observe(i),Hl(e,a),o}function Gl(e,t,n){n&&n.disconnect(),t===`resize`&&Ul(e)}function Kl(e,t,n){let r=e.canvas,i=so(t=>{e.ctx!==null&&n(Fl(t,e))},e);return Nl(r,t,i),i}var ql=class extends El{acquireContext(e,t){let n=e&&e.getContext&&e.getContext(`2d`);return n&&n.canvas===e?(jl(e,t),n):null}releaseContext(e){let t=e.canvas;if(!t[Ol])return!1;let n=t[Ol].initial;[`height`,`width`].forEach(e=>{let r=n[e];U(r)?t.removeAttribute(e):t.setAttribute(e,r)});let r=n.style||{};return Object.keys(r).forEach(e=>{t.style[e]=r[e]}),t.width=t.width,delete t[Ol],!0}addEventListener(e,t,n){this.removeEventListener(e,t);let r=e.$proxies||={};r[t]=({attach:Ll,detach:Rl,resize:Wl}[t]||Kl)(e,t,n)}removeEventListener(e,t){let n=e.$proxies||={},r=n[t];r&&(({attach:Gl,detach:Gl,resize:Gl}[t]||Pl)(e,t,r),n[t]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,n,r){return Zs(e,t,n,r)}isAttached(e){let t=e&&Bs(e);return!!(t&&t.isConnected)}};function Jl(e){return!zs()||typeof OffscreenCanvas<`u`&&e instanceof OffscreenCanvas?Dl:ql}var Yl=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 Ra(this.x)&&Ra(this.y)}getProps(e,t){let n=this.$animations;if(!t||!n)return this;let r={};return e.forEach(e=>{r[e]=n[e]&&n[e].active()?n[e]._to:this[e]}),r}};function Xl(e,t){let n=e.options.ticks,r=Zl(e),i=Math.min(n.maxTicksLimit||r,r),a=n.major.enabled?$l(t):[],o=a.length,s=a[0],c=a[o-1],l=[];if(o>i)return eu(t,l,a,o/i),l;let u=Ql(a,t,i);if(o>0){let e,n,r=o>1?Math.round((c-s)/(o-1)):null;for(tu(t,l,u,U(r)?0:s-r,s),e=0,n=o-1;e<n;e++)tu(t,l,u,a[e],a[e+1]);return tu(t,l,u,c,U(r)?t.length:c+r),l}return tu(t,l,u),l}function Zl(e){let t=e.options.offset,n=e._tickSize(),r=e._length/n+ +!t,i=e._maxLength/n;return Math.floor(Math.min(r,i))}function Ql(e,t,n){let r=nu(e),i=t.length/n;if(!r)return Math.max(i,1);let a=Ia(r);for(let e=0,t=a.length-1;e<t;e++){let t=a[e];if(t>i)return t}return Math.max(i,1)}function $l(e){let t=[],n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function eu(e,t,n,r){let i=0,a=n[0],o;for(r=Math.ceil(r),o=0;o<e.length;o++)o===a&&(t.push(e[o]),i++,a=n[i*r])}function tu(e,t,n,r,i){let a=q(r,0),o=Math.min(q(i,e.length),e.length),s=0,c,l,u;for(n=Math.ceil(n),i&&(c=i-r,n=c/Math.floor(c/n)),u=a;u<0;)s++,u=Math.round(a+s*n);for(l=Math.max(a,0);l<o;l++)l===u&&(t.push(e[l]),s++,u=Math.round(a+s*n))}function nu(e){let t=e.length,n,r;if(t<2)return!1;for(r=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==r)return!1;return r}var ru=e=>e===`left`?`right`:e===`right`?`left`:e,iu=(e,t,n)=>t===`top`||t===`left`?e[t]+n:e[t]-n,au=(e,t)=>Math.min(t||e,e);function ou(e,t){let n=[],r=e.length/t,i=e.length,a=0;for(;a<i;a+=r)n.push(e[Math.floor(a)]);return n}function su(e,t,n){let r=e.ticks.length,i=Math.min(t,r-1),a=e._startPixel,o=e._endPixel,s=1e-6,c=e.getPixelForTick(i),l;if(!(n&&(l=r===1?Math.max(c-a,o-c):t===0?(e.getPixelForTick(1)-c)/2:(c-e.getPixelForTick(i-1))/2,c+=i<t?l:-l,c<a-s||c>o+s)))return c}function cu(e,t){Y(e,e=>{let n=e.gc,r=n.length/2,i;if(r>t){for(i=0;i<r;++i)delete e.data[n[i]];n.splice(0,r)}})}function lu(e){return e.drawTicks?e.tickLength:0}function uu(e,t){if(!e.display)return 0;let n=$(e.font,t),r=Q(e.padding);return(W(e.text)?e.text.length:1)*n.lineHeight+r.height}function du(e,t){return ls(e,{scale:t,type:`scale`})}function fu(e,t,n){return ls(e,{tick:n,index:t,type:`tick`})}function pu(e,t,n){let r=lo(e);return(n&&t!==`right`||!n&&t===`right`)&&(r=ru(r)),r}function mu(e,t,n,r){let{top:i,left:a,bottom:o,right:s,chart:c}=e,{chartArea:l,scales:u}=c,d=0,f,p,m,h=o-i,g=s-a;if(e.isHorizontal()){if(p=uo(r,a,s),G(n)){let e=Object.keys(n)[0],r=n[e];m=u[e].getPixelForValue(r)+h-t}else m=n===`center`?(l.bottom+l.top)/2+h-t:iu(e,n,t);f=s-a}else{if(G(n)){let e=Object.keys(n)[0],r=n[e];p=u[e].getPixelForValue(r)-g+t}else p=n===`center`?(l.left+l.right)/2-g+t:iu(e,n,t);m=uo(r,o,i),d=n===`left`?-ka:ka}return{titleX:p,titleY:m,maxWidth:f,rotation:d}}var hu=class e extends Yl{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=sa(e,1/0),t=sa(t,-1/0),n=sa(n,1/0),r=sa(r,-1/0),{min:sa(e,n),max:sa(t,r),minDefined:K(e),maxDefined:K(t)}}getMinMax(e){let{min:t,max:n,minDefined:r,maxDefined:i}=this.getUserBounds(),a;if(r&&i)return{min:t,max:n};let o=this.getMatchingVisibleMetas();for(let s=0,c=o.length;s<c;++s)a=o[s].controller.getMinMax(this,e),r||(t=Math.min(t,a.min)),i||(n=Math.max(n,a.max));return t=i&&t>n?n:t,n=r&&t>n?t:n,{min:sa(t,sa(n,t)),max:sa(n,sa(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._computeLabelItems(e)}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){J(this.options.beforeUpdate,[this])}update(e,t,n){let{beginAtZero:r,grace:i,ticks:a}=this.options,o=a.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=cs(this,i,r),!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let s=o<this.ticks.length;this._convertTicksToLabels(s?ou(this.ticks,o):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source===`auto`)&&(this.ticks=Xl(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),s&&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(){J(this.options.afterUpdate,[this])}beforeSetDimensions(){J(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(){J(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),J(this.options[e],[this])}beforeDataLimits(){this._callHooks(`beforeDataLimits`)}determineDataLimits(){}afterDataLimits(){this._callHooks(`afterDataLimits`)}beforeBuildTicks(){this._callHooks(`beforeBuildTicks`)}buildTicks(){return[]}afterBuildTicks(){this._callHooks(`afterBuildTicks`)}beforeTickToLabelConversion(){J(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){let t=this.options.ticks,n,r,i;for(n=0,r=e.length;n<r;n++)i=e[n],i.label=J(t.callback,[i.value,n,e],this)}afterTickToLabelConversion(){J(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){J(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){let e=this.options,t=e.ticks,n=au(this.ticks.length,e.ticks.maxTicksLimit),r=t.minRotation||0,i=t.maxRotation,a=r,o,s,c;if(!this._isVisible()||!t.display||r>=i||n<=1||!this.isHorizontal()){this.labelRotation=r;return}let l=this._getLabelSizes(),u=l.widest.width,d=l.highest.height,f=Ya(this.chart.width-u,0,this.maxWidth);o=e.offset?this.maxWidth/n:f/(n-1),u+6>o&&(o=f/(n-(e.offset?.5:1)),s=this.maxHeight-lu(e.grid)-t.padding-uu(e.title,this.chart.options.font),c=Math.sqrt(u*u+d*d),a=Ha(Math.min(Math.asin(Ya((l.highest.height+6)/o,-1,1)),Math.asin(Ya(s/c,-1,1))-Math.asin(Ya(d/c,-1,1)))),a=Math.max(r,Math.min(i,a))),this.labelRotation=a}afterCalculateLabelRotation(){J(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){J(this.options.beforeFit,[this])}fit(){let e={width:0,height:0},{chart:t,options:{ticks:n,title:r,grid:i}}=this,a=this._isVisible(),o=this.isHorizontal();if(a){let a=uu(r,t.options.font);if(o?(e.width=this.maxWidth,e.height=lu(i)+a):(e.height=this.maxHeight,e.width=lu(i)+a),n.display&&this.ticks.length){let{first:t,last:r,widest:i,highest:a}=this._getLabelSizes(),s=n.padding*2,c=Va(this.labelRotation),l=Math.cos(c),u=Math.sin(c);if(o){let t=n.mirror?0:u*i.width+l*a.height;e.height=Math.min(this.maxHeight,e.height+t+s)}else{let t=n.mirror?0:l*i.width+u*a.height;e.width=Math.min(this.maxWidth,e.width+t+s)}this._calculatePadding(t,r,u,l)}}this._handleMargins(),o?(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:i,padding:a},position:o}=this.options,s=this.labelRotation!==0,c=o!==`top`&&this.axis===`x`;if(this.isHorizontal()){let o=this.getPixelForTick(0)-this.left,l=this.right-this.getPixelForTick(this.ticks.length-1),u=0,d=0;s?c?(u=r*e.width,d=n*t.height):(u=n*e.height,d=r*t.width):i===`start`?d=t.width:i===`end`?u=e.width:i!==`inner`&&(u=e.width/2,d=t.width/2),this.paddingLeft=Math.max((u-o+a)*this.width/(this.width-o),0),this.paddingRight=Math.max((d-l+a)*this.width/(this.width-l),0)}else{let n=t.height/2,r=e.height/2;i===`start`?(n=0,r=e.height):i===`end`&&(n=t.height,r=0),this.paddingTop=n+a,this.paddingBottom=r+a}}_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(){J(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=ou(n,t)),this._labelSizes=e=this._computeLabelSizes(n,n.length,this.options.ticks.maxTicksLimit)}return e}_computeLabelSizes(e,t,n){let{ctx:r,_longestTextCache:i}=this,a=[],o=[],s=Math.floor(t/au(t,n)),c=0,l=0,u,d,f,p,m,h,g,_,v,y,b;for(u=0;u<t;u+=s){if(p=e[u].label,m=this._resolveTickFontOptions(u),r.font=h=m.string,g=i[h]=i[h]||{data:{},gc:[]},_=m.lineHeight,v=y=0,!U(p)&&!W(p))v=Ro(r,g.data,g.gc,v,p),y=_;else if(W(p))for(d=0,f=p.length;d<f;++d)b=p[d],!U(b)&&!W(b)&&(v=Ro(r,g.data,g.gc,v,b),y+=_);a.push(v),o.push(y),c=Math.max(v,c),l=Math.max(y,l)}cu(i,t);let x=a.indexOf(c),S=o.indexOf(l),C=e=>({width:a[e]||0,height:o[e]||0});return{first:C(0),last:C(t-1),widest:C(x),highest:C(S),widths:a,heights:o}}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 Xa(this._alignToPixels?Bo(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||=fu(this.getContext(),e,n)}return this.$context||=du(this.chart.getContext(),this)}_tickSize(){let e=this.options.ticks,t=Va(this.labelRotation),n=Math.abs(Math.cos(t)),r=Math.abs(Math.sin(t)),i=this._getLabelSizes(),a=e.autoSkipPadding||0,o=i?i.widest.width+a:0,s=i?i.highest.height+a:0;return this.isHorizontal()?s*n>o*r?o/n:s/r:s*r<o*n?s/n:o/r}_isVisible(){let e=this.options.display;return e===`auto`?this.getMatchingVisibleMetas().length>0:!!e}_computeGridLineItems(e){let t=this.axis,n=this.chart,r=this.options,{grid:i,position:a,border:o}=r,s=i.offset,c=this.isHorizontal(),l=this.ticks.length+ +!!s,u=lu(i),d=[],f=o.setContext(this.getContext()),p=f.display?f.width:0,m=p/2,h=function(e){return Bo(n,e,p)},g,_,v,y,b,x,S,C,w,T,E,D;if(a===`top`)g=h(this.bottom),x=this.bottom-u,C=g-m,T=h(e.top)+m,D=e.bottom;else if(a===`bottom`)g=h(this.top),T=e.top,D=h(e.bottom)-m,x=g+m,C=this.top+u;else if(a===`left`)g=h(this.right),b=this.right-u,S=g-m,w=h(e.left)+m,E=e.right;else if(a===`right`)g=h(this.left),w=e.left,E=h(e.right)-m,b=g+m,S=this.left+u;else if(t===`x`){if(a===`center`)g=h((e.top+e.bottom)/2+.5);else if(G(a)){let e=Object.keys(a)[0],t=a[e];g=h(this.chart.scales[e].getPixelForValue(t))}T=e.top,D=e.bottom,x=g+m,C=x+u}else if(t===`y`){if(a===`center`)g=h((e.left+e.right)/2);else if(G(a)){let e=Object.keys(a)[0],t=a[e];g=h(this.chart.scales[e].getPixelForValue(t))}b=g-m,S=b-u,w=e.left,E=e.right}let ee=q(r.ticks.maxTicksLimit,l),O=Math.max(1,Math.ceil(l/ee));for(_=0;_<l;_+=O){let e=this.getContext(_),t=i.setContext(e),r=o.setContext(e),a=t.lineWidth,l=t.color,u=r.dash||[],f=r.dashOffset,p=t.tickWidth,m=t.tickColor,h=t.tickBorderDash||[],g=t.tickBorderDashOffset;v=su(this,_,s),v!==void 0&&(y=Bo(n,v,a),c?b=S=w=E=y:x=C=T=D=y,d.push({tx1:b,ty1:x,tx2:S,ty2:C,x1:w,y1:T,x2:E,y2:D,width:a,color:l,borderDash:u,borderDashOffset:f,tickWidth:p,tickColor:m,tickBorderDash:h,tickBorderDashOffset:g}))}return this._ticksLength=l,this._borderValue=g,d}_computeLabelItems(e){let t=this.axis,n=this.options,{position:r,ticks:i}=n,a=this.isHorizontal(),o=this.ticks,{align:s,crossAlign:c,padding:l,mirror:u}=i,d=lu(n.grid),f=d+l,p=u?-l:f,m=-Va(this.labelRotation),h=[],g,_,v,y,b,x,S,C,w,T,E,D,ee=`middle`;if(r===`top`)x=this.bottom-p,S=this._getXAxisLabelAlignment();else if(r===`bottom`)x=this.top+p,S=this._getXAxisLabelAlignment();else if(r===`left`){let e=this._getYAxisLabelAlignment(d);S=e.textAlign,b=e.x}else if(r===`right`){let e=this._getYAxisLabelAlignment(d);S=e.textAlign,b=e.x}else if(t===`x`){if(r===`center`)x=(e.top+e.bottom)/2+f;else if(G(r)){let e=Object.keys(r)[0],t=r[e];x=this.chart.scales[e].getPixelForValue(t)+f}S=this._getXAxisLabelAlignment()}else if(t===`y`){if(r===`center`)b=(e.left+e.right)/2-f;else if(G(r)){let e=Object.keys(r)[0],t=r[e];b=this.chart.scales[e].getPixelForValue(t)}S=this._getYAxisLabelAlignment(d).textAlign}t===`y`&&(s===`start`?ee=`top`:s===`end`&&(ee=`bottom`));let O=this._getLabelSizes();for(g=0,_=o.length;g<_;++g){v=o[g],y=v.label;let e=i.setContext(this.getContext(g));C=this.getPixelForTick(g)+i.labelOffset,w=this._resolveTickFontOptions(g),T=w.lineHeight,E=W(y)?y.length:1;let t=E/2,n=e.color,s=e.textStrokeColor,l=e.textStrokeWidth,d=S;a?(b=C,S===`inner`&&(d=g===_-1?this.options.reverse?`left`:`right`:g===0?this.options.reverse?`right`:`left`:`center`),D=r===`top`?c===`near`||m!==0?-E*T+T/2:c===`center`?-O.highest.height/2-t*T+T:-O.highest.height+T/2:c===`near`||m!==0?T/2:c===`center`?O.highest.height/2-t*T:O.highest.height-E*T,u&&(D*=-1),m!==0&&!e.showLabelBackdrop&&(b+=T/2*Math.sin(m))):(x=C,D=(1-E)*T/2);let f;if(e.showLabelBackdrop){let t=Q(e.backdropPadding),n=O.heights[g],r=O.widths[g],i=D-t.top,a=0-t.left;switch(ee){case`middle`:i-=n/2;break;case`bottom`:i-=n;break}switch(S){case`center`:a-=r/2;break;case`right`:a-=r;break;case`inner`:g===_-1?a-=r:g>0&&(a-=r/2);break}f={left:a,top:i,width:r+t.width,height:n+t.height,color:e.backdropColor}}h.push({label:y,font:w,textOffset:D,options:{rotation:m,color:n,strokeColor:s,strokeWidth:l,textAlign:d,textBaseline:ee,translation:[b,x],backdrop:f}})}return h}_getXAxisLabelAlignment(){let{position:e,ticks:t}=this.options;if(-Va(this.labelRotation))return e===`top`?`left`:`right`;let n=`center`;return t.align===`start`?n=`left`:t.align===`end`?n=`right`:t.align===`inner`&&(n=`inner`),n}_getYAxisLabelAlignment(e){let{position:t,ticks:{crossAlign:n,mirror:r,padding:i}}=this.options,a=this._getLabelSizes(),o=e+i,s=a.widest.width,c,l;return t===`left`?r?(l=this.right+i,n===`near`?c=`left`:n===`center`?(c=`center`,l+=s/2):(c=`right`,l+=s)):(l=this.right-o,n===`near`?c=`right`:n===`center`?(c=`center`,l-=s/2):(c=`left`,l=this.left)):t===`right`?r?(l=this.left+i,n===`near`?c=`right`:n===`center`?(c=`center`,l-=s/2):(c=`left`,l-=s)):(l=this.left+o,n===`near`?c=`left`:n===`center`?(c=`center`,l+=s/2):(c=`right`,l=this.right)):c=`right`,{textAlign:c,x:l}}_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:i,height:a}=this;t&&(e.save(),e.fillStyle=t,e.fillRect(n,r,i,a),e.restore())}getLineWidthForValue(e){let t=this.options.grid;if(!this._isVisible()||!t.display)return 0;let n=this.ticks.findIndex(t=>t.value===e);return n>=0?t.setContext(this.getContext(n)).lineWidth:0}drawGrid(e){let t=this.options.grid,n=this.ctx,r=this._gridLineItems||=this._computeGridLineItems(e),i,a,o=(e,t,r)=>{!r.width||!r.color||(n.save(),n.lineWidth=r.width,n.strokeStyle=r.color,n.setLineDash(r.borderDash||[]),n.lineDashOffset=r.borderDashOffset,n.beginPath(),n.moveTo(e.x,e.y),n.lineTo(t.x,t.y),n.stroke(),n.restore())};if(t.display)for(i=0,a=r.length;i<a;++i){let e=r[i];t.drawOnChartArea&&o({x:e.x1,y:e.y1},{x:e.x2,y:e.y2},e),t.drawTicks&&o({x:e.tx1,y:e.ty1},{x:e.tx2,y:e.ty2},{color:e.tickColor,width:e.tickWidth,borderDash:e.tickBorderDash,borderDashOffset:e.tickBorderDashOffset})}}drawBorder(){let{chart:e,ctx:t,options:{border:n,grid:r}}=this,i=n.setContext(this.getContext()),a=n.display?i.width:0;if(!a)return;let o=r.setContext(this.getContext(0)).lineWidth,s=this._borderValue,c,l,u,d;this.isHorizontal()?(c=Bo(e,this.left,a)-a/2,l=Bo(e,this.right,o)+o/2,u=d=s):(u=Bo(e,this.top,a)-a/2,d=Bo(e,this.bottom,o)+o/2,c=l=s),t.save(),t.lineWidth=i.width,t.strokeStyle=i.color,t.beginPath(),t.moveTo(c,u),t.lineTo(l,d),t.stroke(),t.restore()}drawLabels(e){if(!this.options.ticks.display)return;let t=this.ctx,n=this._computeLabelArea();n&&Go(t,n);let r=this.getLabelItems(e);for(let e of r){let n=e.options,r=e.font,i=e.label,a=e.textOffset;Qo(t,i,0,a,r,n)}n&&Ko(t)}drawTitle(){let{ctx:e,options:{position:t,title:n,reverse:r}}=this;if(!n.display)return;let i=$(n.font),a=Q(n.padding),o=n.align,s=i.lineHeight/2;t===`bottom`||t===`center`||G(t)?(s+=a.bottom,W(n.text)&&(s+=i.lineHeight*(n.text.length-1))):s+=a.top;let{titleX:c,titleY:l,maxWidth:u,rotation:d}=mu(this,s,t,o);Qo(e,n.text,0,0,i,{color:n.color,maxWidth:u,rotation:d,textAlign:pu(o,t,r),textBaseline:`middle`,translation:[c,l]})}draw(e){this._isVisible()&&(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){let t=this.options,n=t.ticks&&t.ticks.z||0,r=q(t.grid&&t.grid.z,-1),i=q(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==e.prototype.draw?[{z:n,draw:e=>{this.draw(e)}}]:[{z:r,draw:e=>{this.drawBackground(),this.drawGrid(e),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:n,draw:e=>{this.drawLabels(e)}}]}getMatchingVisibleMetas(e){let t=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+`AxisID`,r=[],i,a;for(i=0,a=t.length;i<a;++i){let a=t[i];a[n]===this.id&&(!e||a.type===e)&&r.push(a)}return r}_resolveTickFontOptions(e){return $(this.options.ticks.setContext(this.getContext(e)).font)}_maxDigits(){let e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}},gu=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;yu(t)&&(n=this.register(t));let r=this.items,i=e.id,a=this.scope+`.`+i;if(!i)throw Error(`class does not have id: `+e);return i in r?a:(r[i]=e,_u(e,a,n),this.override&&Z.override(e.id,e.overrides),a)}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 Z[r]&&(delete Z[r][n],this.override&&delete No[n])}};function _u(e,t,n){let r=pa(Object.create(null),[n?Z.get(n):{},Z.get(t),e.defaults]);Z.set(t,r),e.defaultRoutes&&vu(t,e.defaultRoutes),e.descriptors&&Z.describe(t,e.descriptors)}function vu(e,t){Object.keys(t).forEach(n=>{let r=n.split(`.`),i=r.pop(),a=[e].concat(r).join(`.`),o=t[n].split(`.`),s=o.pop(),c=o.join(`.`);Z.route(a,i,c,s)})}function yu(e){return`id`in e&&`defaults`in e}var bu=new class{constructor(){this.controllers=new gu(Xc,`datasets`,!0),this.elements=new gu(Yl,`elements`),this.plugins=new gu(Object,`plugins`),this.scales=new gu(hu,`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(t=>{let r=n||this._getRegistryForType(t);n||r.isForType(t)||r===this.plugins&&t.id?this._exec(e,r,t):Y(t,t=>{let r=n||this._getRegistryForType(t);this._exec(e,r,t)})})}_exec(e,t,n){let r=ba(e);J(n[`before`+r],[],n),t[e](n),J(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 Error(`"`+e+`" is not a registered `+n+`.`);return r}},xu=class{constructor(){this._init=void 0}notify(e,t,n,r){if(t===`beforeInit`&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,`install`)),this._init===void 0)return;let i=r?this._descriptors(e).filter(r):this._descriptors(e),a=this._notify(i,e,t,n);return t===`afterDestroy`&&(this._notify(i,e,`stop`),this._notify(this._init,e,`uninstall`),this._init=void 0),a}_notify(e,t,n,r){r||={};for(let i of e){let e=i.plugin,a=e[n];if(J(a,[t,r,i.options],e)===!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=q(n.options&&n.options.plugins,{}),i=Su(n);return r===!1&&!t?[]:wu(e,i,r,t)}_notifyStateChanges(e){let t=this._oldCache||[],n=this._cache,r=(e,t)=>e.filter(e=>!t.some(t=>e.plugin.id===t.plugin.id));this._notify(r(t,n),e,`stop`),this._notify(r(n,t),e,`start`)}};function Su(e){let t={},n=[],r=Object.keys(bu.plugins.items);for(let e=0;e<r.length;e++)n.push(bu.getPlugin(r[e]));let i=e.plugins||[];for(let e=0;e<i.length;e++){let r=i[e];n.indexOf(r)===-1&&(n.push(r),t[r.id]=!0)}return{plugins:n,localIds:t}}function Cu(e,t){return!t&&e===!1?null:e===!0?{}:e}function wu(e,{plugins:t,localIds:n},r,i){let a=[],o=e.getContext();for(let s of t){let t=s.id,c=Cu(r[t],i);c!==null&&a.push({plugin:s,options:Tu(e.config,{plugin:s,local:n[t]},c,o)})}return a}function Tu(e,{plugin:t,local:n},r,i){let a=e.pluginScopeKeys(t),o=e.getOptionScopes(r,a);return n&&t.defaults&&o.push(t.defaults),e.createResolver(o,i,[``],{scriptable:!1,indexable:!1,allKeys:!0})}function Eu(e,t){let n=Z.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||`x`}function Du(e,t){let n=e;return e===`_index_`?n=t:e===`_value_`&&(n=t===`x`?`y`:`x`),n}function Ou(e,t){return e===t?`_index_`:`_value_`}function ku(e){if(e===`x`||e===`y`||e===`r`)return e}function Au(e){if(e===`top`||e===`bottom`)return`x`;if(e===`left`||e===`right`)return`y`}function ju(e,...t){if(ku(e))return e;for(let n of t){let t=n.axis||Au(n.position)||e.length>1&&ku(e[0].toLowerCase());if(t)return t}throw Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function Mu(e,t,n){if(n[t+`AxisID`]===e)return{axis:t}}function Nu(e,t){if(t.data&&t.data.datasets){let n=t.data.datasets.filter(t=>t.xAxisID===e||t.yAxisID===e);if(n.length)return Mu(e,`x`,n[0])||Mu(e,`y`,n[0])}return{}}function Pu(e,t){let n=No[e.type]||{scales:{}},r=t.scales||{},i=Eu(e.type,t),a=Object.create(null);return Object.keys(r).forEach(t=>{let o=r[t];if(!G(o))return console.error(`Invalid scale configuration for scale: ${t}`);if(o._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${t}`);let s=ju(t,o,Nu(t,e),Z.scales[o.type]),c=Ou(s,i),l=n.scales||{};a[t]=ma(Object.create(null),[{axis:s},o,l[s],l[c]])}),e.data.datasets.forEach(n=>{let i=n.type||e.type,o=n.indexAxis||Eu(i,t),s=(No[i]||{}).scales||{};Object.keys(s).forEach(e=>{let t=Du(e,o),i=n[t+`AxisID`]||t;a[i]=a[i]||Object.create(null),ma(a[i],[{axis:t},r[i],s[e]])})}),Object.keys(a).forEach(e=>{let t=a[e];ma(t,[Z.scales[t.type],Z.scale])}),a}function Fu(e){let t=e.options||={};t.plugins=q(t.plugins,{}),t.scales=Pu(e,t)}function Iu(e){return e||={},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function Lu(e){return e||={},e.data=Iu(e.data),Fu(e),e}var Ru=new Map,zu=new Set;function Bu(e,t){let n=Ru.get(e);return n||(n=t(),Ru.set(e,n),zu.add(n)),n}var Vu=(e,t,n)=>{let r=ya(t,n);r!==void 0&&e.add(r)},Hu=class{constructor(e){this._config=Lu(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=Iu(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(),Fu(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return Bu(e,()=>[[`datasets.${e}`,``]])}datasetAnimationScopeKeys(e,t){return Bu(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,``]])}datasetElementScopeKeys(e,t){return Bu(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,``]])}pluginScopeKeys(e){let t=e.id,n=this.type;return Bu(`${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:i}=this,a=this._cachedScopes(e,n),o=a.get(t);if(o)return o;let s=new Set;t.forEach(t=>{e&&(s.add(e),t.forEach(t=>Vu(s,e,t))),t.forEach(e=>Vu(s,r,e)),t.forEach(e=>Vu(s,No[i]||{},e)),t.forEach(e=>Vu(s,Z,e)),t.forEach(e=>Vu(s,Po,e))});let c=Array.from(s);return c.length===0&&c.push(Object.create(null)),zu.has(t)&&a.set(t,c),c}chartOptionScopes(){let{options:e,type:t}=this;return[e,No[t]||{},Z.datasets[t]||{},{type:t},Z,Po]}resolveNamedOptions(e,t,n,r=[``]){let i={$shared:!0},{resolver:a,subPrefixes:o}=Uu(this._resolverCache,e,r),s=a;if(Gu(a,t)){i.$shared=!1,n=Sa(n)?n():n;let t=this.createResolver(e,n,o);s=ds(a,n,t)}for(let e of t)i[e]=s[e];return i}createResolver(e,t,n=[``],r){let{resolver:i}=Uu(this._resolverCache,e,n);return G(t)?ds(i,t,void 0,r):i}};function Uu(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));let i=n.join(),a=r.get(i);return a||(a={resolver:us(t,n),subPrefixes:n.filter(e=>!e.toLowerCase().includes(`hover`))},r.set(i,a)),a}var Wu=e=>G(e)&&Object.getOwnPropertyNames(e).some(t=>Sa(e[t]));function Gu(e,t){let{isScriptable:n,isIndexable:r}=fs(e);for(let i of t){let t=n(i),a=r(i),o=(a||t)&&e[i];if(t&&(Sa(o)||Wu(o))||a&&W(o))return!0}return!1}var Ku=`4.5.1`,qu=[`top`,`bottom`,`left`,`right`,`chartArea`];function Ju(e,t){return e===`top`||e===`bottom`||qu.indexOf(e)===-1&&t===`x`}function Yu(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function Xu(e){let t=e.chart,n=t.options.animation;t.notifyPlugins(`afterRender`),J(n&&n.onComplete,[e],t)}function Zu(e){let t=e.chart,n=t.options.animation;J(n&&n.onProgress,[e],t)}function Qu(e){return zs()&&typeof e==`string`?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}var $u={},ed=e=>{let t=Qu(e);return Object.values($u).filter(e=>e.canvas===t).pop()};function td(e,t,n){let r=Object.keys(e);for(let i of r){let r=+i;if(r>=t){let a=e[i];delete e[i],(n>0||r>t)&&(e[r+n]=a)}}}function nd(e,t,n,r){return!n||e.type===`mouseout`?null:r?t:e}var rd=class{static defaults=Z;static instances=$u;static overrides=No;static registry=bu;static version=Ku;static getChart=ed;static register(...e){bu.add(...e),id()}static unregister(...e){bu.remove(...e),id()}constructor(e,t){let n=this.config=new Hu(t),r=Qu(e),i=ed(r);if(i)throw Error(`Canvas is already in use. Chart with ID '`+i.id+`' must be destroyed before the canvas with ID '`+i.canvas.id+`' can be reused.`);let a=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||(Jl(r))),this.platform.updateConfig(n);let o=this.platform.acquireContext(r,a.aspectRatio),s=o&&o.canvas,c=s&&s.height,l=s&&s.width;if(this.id=oa(),this.ctx=o,this.canvas=s,this.width=l,this.height=c,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 xu,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=co(e=>this.update(e),a.resizeDelay||0),this._dataChanges=[],$u[this.id]=this,!o||!s){console.error(`Failed to create chart: can't acquire context from the given item`);return}wc.listen(this,`complete`,Xu),wc.listen(this,`progress`,Zu),this._initialize(),this.attached&&this.update()}get aspectRatio(){let{options:{aspectRatio:e,maintainAspectRatio:t},width:n,height:r,_aspectRatio:i}=this;return U(e)?t&&i?i:r?n/r:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return bu}_initialize(){return this.notifyPlugins(`beforeInit`),this.options.responsive?this.resize():Qs(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins(`afterInit`),this}clear(){return Vo(this.canvas,this.ctx),this}stop(){return wc.stop(this),this}resize(e,t){wc.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){let n=this.options,r=this.canvas,i=n.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(r,e,t,i),o=n.devicePixelRatio||this.platform.getDevicePixelRatio(),s=this.width?`resize`:`attach`;this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,Qs(this,o,!0)&&(this.notifyPlugins(`resize`,{size:a}),J(n.onResize,[this,a],this),this.attached&&this._doResize(s)&&this.render())}ensureScalesHaveIDs(){Y(this.options.scales||{},(e,t)=>{e.id=t})}buildOrUpdateScales(){let e=this.options,t=e.scales,n=this.scales,r=Object.keys(n).reduce((e,t)=>(e[t]=!1,e),{}),i=[];t&&(i=i.concat(Object.keys(t).map(e=>{let n=t[e],r=ju(e,n),i=r===`r`,a=r===`x`;return{options:n,dposition:i?`chartArea`:a?`bottom`:`left`,dtype:i?`radialLinear`:a?`category`:`linear`}}))),Y(i,t=>{let i=t.options,a=i.id,o=ju(a,i),s=q(i.type,t.dtype);(i.position===void 0||Ju(i.position,o)!==Ju(t.dposition))&&(i.position=t.dposition),r[a]=!0;let c=null;a in n&&n[a].type===s?c=n[a]:(c=new(bu.getScale(s))({id:a,type:s,ctx:this.ctx,chart:this}),n[c.id]=c),c.init(i,e)}),Y(r,(e,t)=>{e||delete n[t]}),Y(n,e=>{Tl.configure(this,e,e.options),Tl.addBox(this,e)})}_updateMetasets(){let e=this._metasets,t=this.data.datasets.length,n=e.length;if(e.sort((e,t)=>e.index-t.index),n>t){for(let e=t;e<n;++e)this._destroyDatasetMeta(e);e.splice(t,n-t)}this._sortedMetasets=e.slice(0).sort(Yu(`order`,`index`))}_removeUnreferencedMetasets(){let{_metasets:e,data:{datasets:t}}=this;e.length>t.length&&delete this._stacks,e.forEach((e,n)=>{t.filter(t=>t===e._dataset).length===0&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){let e=[],t=this.data.datasets,n,r;for(this._removeUnreferencedMetasets(),n=0,r=t.length;n<r;n++){let r=t[n],i=this.getDatasetMeta(n),a=r.type||this.config.type;if(i.type&&i.type!==a&&(this._destroyDatasetMeta(n),i=this.getDatasetMeta(n)),i.type=a,i.indexAxis=r.indexAxis||Eu(a,this.options),i.order=r.order||0,i.index=n,i.label=``+r.label,i.visible=this.isDatasetVisible(n),i.controller)i.controller.updateIndex(n),i.controller.linkScales();else{let t=bu.getController(a),{datasetElementType:r,dataElementType:o}=Z.datasets[a];Object.assign(t,{dataElementType:bu.getElement(o),datasetElementType:r&&bu.getElement(r)}),i.controller=new t(this,n),e.push(i.controller)}}return this._updateMetasets(),e}_resetElements(){Y(this.data.datasets,(e,t)=>{this.getDatasetMeta(t).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins(`reset`)}update(e){let t=this.config;t.update();let n=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),r=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins(`beforeUpdate`,{mode:e,cancelable:!0})===!1)return;let i=this.buildOrUpdateControllers();this.notifyPlugins(`beforeElementsUpdate`);let a=0;for(let e=0,t=this.data.datasets.length;e<t;e++){let{controller:t}=this.getDatasetMeta(e),n=!r&&i.indexOf(t)===-1;t.buildOrUpdateElements(n),a=Math.max(+t.getMaxOverflow(),a)}a=this._minPadding=n.layout.autoPadding?a:0,this._updateLayout(a),r||Y(i,e=>{e.reset()}),this._updateDatasets(e),this.notifyPlugins(`afterUpdate`,{mode:e}),this._layers.sort(Yu(`z`,`_idx`));let{_active:o,_lastEvent:s}=this;s?this._eventHandler(s,!0):o.length&&this._updateHoverStyles(o,o,!0),this.render()}_updateScales(){Y(this.scales,e=>{Tl.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){let e=this.options;(!Ca(new Set(Object.keys(this._listeners)),new Set(e.events))||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){let{_hiddenIndices:e}=this,t=this._getUniformDataChanges()||[];for(let{method:n,start:r,count:i}of t)td(e,r,n===`_removeElements`?-i:i)}_getUniformDataChanges(){let e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];let t=this.data.datasets.length,n=t=>new Set(e.filter(e=>e[0]===t).map((e,t)=>t+`,`+e.splice(1).join(`,`))),r=n(0);for(let e=1;e<t;e++)if(!Ca(r,n(e)))return;return Array.from(r).map(e=>e.split(`,`)).map(e=>({method:e[1],start:+e[2],count:+e[3]}))}_updateLayout(e){if(this.notifyPlugins(`beforeLayout`,{cancelable:!0})===!1)return;Tl.update(this,this.width,this.height,e);let t=this.chartArea,n=t.width<=0||t.height<=0;this._layers=[],Y(this.boxes,e=>{n&&e.position===`chartArea`||(e.configure&&e.configure(),this._layers.push(...e._layers()))},this),this._layers.forEach((e,t)=>{e._idx=t}),this.notifyPlugins(`afterLayout`)}_updateDatasets(e){if(this.notifyPlugins(`beforeDatasetsUpdate`,{mode:e,cancelable:!0})!==!1){for(let e=0,t=this.data.datasets.length;e<t;++e)this.getDatasetMeta(e).controller.configure();for(let t=0,n=this.data.datasets.length;t<n;++t)this._updateDataset(t,Sa(e)?e({datasetIndex:t}):e);this.notifyPlugins(`afterDatasetsUpdate`,{mode:e})}}_updateDataset(e,t){let n=this.getDatasetMeta(e),r={meta:n,index:e,mode:t,cancelable:!0};this.notifyPlugins(`beforeDatasetUpdate`,r)!==!1&&(n.controller._update(t),r.cancelable=!1,this.notifyPlugins(`afterDatasetUpdate`,r))}render(){this.notifyPlugins(`beforeRender`,{cancelable:!0})!==!1&&(wc.has(this)?this.attached&&!wc.running(this)&&wc.start(this):(this.draw(),Xu({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){let{width:e,height:t}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(e,t)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins(`beforeDraw`,{cancelable:!0})===!1)return;let t=this._layers;for(e=0;e<t.length&&t[e].z<=0;++e)t[e].draw(this.chartArea);for(this._drawDatasets();e<t.length;++e)t[e].draw(this.chartArea);this.notifyPlugins(`afterDraw`)}_getSortedDatasetMetas(e){let t=this._sortedMetasets,n=[],r,i;for(r=0,i=t.length;r<i;++r){let i=t[r];(!e||i.visible)&&n.push(i)}return n}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins(`beforeDatasetsDraw`,{cancelable:!0})===!1)return;let e=this.getSortedVisibleDatasetMetas();for(let t=e.length-1;t>=0;--t)this._drawDataset(e[t]);this.notifyPlugins(`afterDatasetsDraw`)}_drawDataset(e){let t=this.ctx,n={meta:e,index:e.index,cancelable:!0},r=Cc(this,e);this.notifyPlugins(`beforeDatasetDraw`,n)!==!1&&(r&&Go(t,r),e.controller.draw(),r&&Ko(t),n.cancelable=!1,this.notifyPlugins(`afterDatasetDraw`,n))}isPointInArea(e){return Wo(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,n,r){let i=cl.modes[t];return typeof i==`function`?i(this,e,n,r):[]}getDatasetMeta(e){let t=this.data.datasets[e],n=this._metasets,r=n.filter(e=>e&&e._dataset===t).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},n.push(r)),r}getContext(){return this.$context||=ls(null,{chart:this,type:`chart`})}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){let t=this.data.datasets[e];if(!t)return!1;let n=this.getDatasetMeta(e);return typeof n.hidden==`boolean`?!n.hidden:!t.hidden}setDatasetVisibility(e,t){let n=this.getDatasetMeta(e);n.hidden=!t}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,t,n){let r=n?`show`:`hide`,i=this.getDatasetMeta(e),a=i.controller._resolveAnimations(void 0,r);xa(t)?(i.data[t].hidden=!n,this.update()):(this.setDatasetVisibility(e,n),a.update(i,{visible:n}),this.update(t=>t.datasetIndex===e?r:void 0))}hide(e,t){this._updateVisibility(e,t,!1)}show(e,t){this._updateVisibility(e,t,!0)}_destroyDatasetMeta(e){let t=this._metasets[e];t&&t.controller&&t.controller._destroy(),delete this._metasets[e]}_stop(){let e,t;for(this.stop(),wc.remove(this),e=0,t=this.data.datasets.length;e<t;++e)this._destroyDatasetMeta(e)}destroy(){this.notifyPlugins(`beforeDestroy`);let{canvas:e,ctx:t}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),Vo(e,t),this.platform.releaseContext(t),this.canvas=null,this.ctx=null),delete $u[this.id],this.notifyPlugins(`afterDestroy`)}toBase64Image(...e){return this.canvas.toDataURL(...e)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){let e=this._listeners,t=this.platform,n=(n,r)=>{t.addEventListener(this,n,r),e[n]=r},r=(e,t,n)=>{e.offsetX=t,e.offsetY=n,this._eventHandler(e)};Y(this.options.events,e=>n(e,r))}bindResponsiveEvents(){this._responsiveListeners||={};let e=this._responsiveListeners,t=this.platform,n=(n,r)=>{t.addEventListener(this,n,r),e[n]=r},r=(n,r)=>{e[n]&&(t.removeEventListener(this,n,r),delete e[n])},i=(e,t)=>{this.canvas&&this.resize(e,t)},a,o=()=>{r(`attach`,o),this.attached=!0,this.resize(),n(`resize`,i),n(`detach`,a)};a=()=>{this.attached=!1,r(`resize`,i),this._stop(),this._resize(0,0),n(`attach`,o)},t.isAttached(this.canvas)?o():a()}unbindEvents(){Y(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},Y(this._responsiveListeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,n){let r=n?`set`:`remove`,i,a,o,s;for(t===`dataset`&&(i=this.getDatasetMeta(e[0].datasetIndex),i.controller[`_`+r+`DatasetHoverStyle`]()),o=0,s=e.length;o<s;++o){a=e[o];let t=a&&this.getDatasetMeta(a.datasetIndex).controller;t&&t[r+`HoverStyle`](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){let t=this._active||[],n=e.map(({datasetIndex:e,index:t})=>{let n=this.getDatasetMeta(e);if(!n)throw Error(`No dataset found at index `+e);return{datasetIndex:e,element:n.data[t],index:t}});la(n,t)||(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,t))}notifyPlugins(e,t,n){return this._plugins.notify(this,e,t,n)}isPluginEnabled(e){return this._plugins._cache.filter(t=>t.plugin.id===e).length===1}_updateHoverStyles(e,t,n){let r=this.options.hover,i=(e,t)=>e.filter(e=>!t.some(t=>e.datasetIndex===t.datasetIndex&&e.index===t.index)),a=i(t,e),o=n?e:i(e,t);a.length&&this.updateHoverStyle(a,r.mode,!1),o.length&&r.mode&&this.updateHoverStyle(o,r.mode,!0)}_eventHandler(e,t){let n={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},r=t=>(t.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins(`beforeEvent`,n,r)===!1)return;let i=this._handleEvent(e,t,n.inChartArea);return n.cancelable=!1,this.notifyPlugins(`afterEvent`,n,r),(i||n.changed)&&this.render(),this}_handleEvent(e,t,n){let{_active:r=[],options:i}=this,a=t,o=this._getActiveElements(e,r,n,a),s=wa(e),c=nd(e,this._lastEvent,n,s);n&&(this._lastEvent=null,J(i.onHover,[e,o,this],this),s&&J(i.onClick,[e,o,this],this));let l=!la(o,r);return(l||t)&&(this._active=o,this._updateHoverStyles(o,r,t)),this._lastEvent=c,l}_getActiveElements(e,t,n,r){if(e.type===`mouseout`)return[];if(!n)return t;let i=this.options.hover;return this.getElementsAtEventForMode(e,i.mode,i,r)}};function id(){return Y(rd.instances,e=>e._plugins.invalidate())}function ad(e,t,n=t){e.lineCap=q(n.borderCapStyle,t.borderCapStyle),e.setLineDash(q(n.borderDash,t.borderDash)),e.lineDashOffset=q(n.borderDashOffset,t.borderDashOffset),e.lineJoin=q(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=q(n.borderWidth,t.borderWidth),e.strokeStyle=q(n.borderColor,t.borderColor)}function od(e,t,n){e.lineTo(n.x,n.y)}function sd(e){return e.stepped?qo:e.tension||e.cubicInterpolationMode===`monotone`?Jo:od}function cd(e,t,n={}){let r=e.length,{start:i=0,end:a=r-1}=n,{start:o,end:s}=t,c=Math.max(i,o),l=Math.min(a,s),u=i<o&&a<o||i>s&&a>s;return{count:r,start:c,loop:t.loop,ilen:l<c&&!u?r+l-c:l-c}}function ld(e,t,n,r){let{points:i,options:a}=t,{count:o,start:s,loop:c,ilen:l}=cd(i,n,r),u=sd(a),{move:d=!0,reverse:f}=r||{},p,m,h;for(p=0;p<=l;++p)m=i[(s+(f?l-p:p))%o],!m.skip&&(d?(e.moveTo(m.x,m.y),d=!1):u(e,h,m,f,a.stepped),h=m);return c&&(m=i[(s+(f?l:0))%o],u(e,h,m,f,a.stepped)),!!c}function ud(e,t,n,r){let i=t.points,{count:a,start:o,ilen:s}=cd(i,n,r),{move:c=!0,reverse:l}=r||{},u=0,d=0,f,p,m,h,g,_,v=e=>(o+(l?s-e:e))%a,y=()=>{h!==g&&(e.lineTo(u,g),e.lineTo(u,h),e.lineTo(u,_))};for(c&&(p=i[v(0)],e.moveTo(p.x,p.y)),f=0;f<=s;++f){if(p=i[v(f)],p.skip)continue;let t=p.x,n=p.y,r=t|0;r===m?(n<h?h=n:n>g&&(g=n),u=(d*u+t)/++d):(y(),e.lineTo(t,n),m=r,d=0,h=g=n),_=n}y()}function dd(e){let t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!==`monotone`&&!t.stepped&&!n?ud:ld}function fd(e){return e.stepped?nc:e.tension||e.cubicInterpolationMode===`monotone`?rc:tc}function pd(e,t,n,r){let i=t._path;i||(i=t._path=new Path2D,t.path(i,n,r)&&i.closePath()),ad(e,t.options),e.stroke(i)}function md(e,t,n,r){let{segments:i,options:a}=t,o=dd(t);for(let s of i)ad(e,a,s.style),e.beginPath(),o(e,t,s,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}var hd=typeof Path2D==`function`;function gd(e,t,n,r){hd&&!t.options.segment?pd(e,t,n,r):md(e,t,n,r)}var _d=class extends Yl{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:e=>e!==`borderDash`&&e!==`fill`};constructor(e){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,e&&Object.assign(this,e)}updateControlPoints(e,t){let n=this.options;if((n.tension||n.cubicInterpolationMode===`monotone`)&&!n.stepped&&!this._pointsUpdated){let r=n.spanGaps?this._loop:this._fullLoop;Rs(this._points,n,e,r,t),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||=gc(this,this.options.segment)}first(){let e=this.segments,t=this.points;return e.length&&t[e[0].start]}last(){let e=this.segments,t=this.points,n=e.length;return n&&t[e[n-1].end]}interpolate(e,t){let n=this.options,r=e[t],i=this.points,a=pc(this,{property:t,start:r,end:r});if(!a.length)return;let o=[],s=fd(n),c,l;for(c=0,l=a.length;c<l;++c){let{start:l,end:u}=a[c],d=i[l],f=i[u];if(d===f){o.push(d);continue}let p=s(d,f,Math.abs((r-d[t])/(f[t]-d[t])),n.stepped);p[t]=e[t],o.push(p)}return o.length===1?o[0]:o}pathSegment(e,t,n){return dd(this)(e,this,t,n)}path(e,t,n){let r=this.segments,i=dd(this),a=this._loop;t||=0,n||=this.points.length-t;for(let o of r)a&=i(e,this,o,{start:t,end:t+n-1});return!!a}draw(e,t,n,r){let i=this.options||{};(this.points||[]).length&&i.borderWidth&&(e.save(),gd(e,this,n,r),e.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}};function vd(e,t,n,r){let i=e.options,{[n]:a}=e.getProps([n],r);return Math.abs(t-a)<i.radius+i.hitRadius}var yd=class extends Yl{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(e){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,t,n){let r=this.options,{x:i,y:a}=this.getProps([`x`,`y`],n);return(e-i)**2+(t-a)**2<(r.hitRadius+r.radius)**2}inXRange(e,t){return vd(this,e,`x`,t)}inYRange(e,t){return vd(this,e,`y`,t)}getCenterPoint(e){let{x:t,y:n}=this.getProps([`x`,`y`],e);return{x:t,y:n}}size(e){e=e||this.options||{};let t=e.radius||0;t=Math.max(t,t&&e.hoverRadius||0);let n=t&&e.borderWidth||0;return(t+n)*2}draw(e,t){let n=this.options;this.skip||n.radius<.1||!Wo(this,t,this.size(n)/2)||(e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.fillStyle=n.backgroundColor,Ho(e,n,this.x,this.y))}getRange(){let e=this.options||{};return e.radius+e.hitRadius}};function bd(e,t,n){let r=e.segments,i=e.points,a=t.points,o=[];for(let e of r){let{start:r,end:s}=e;s=Cd(r,s,i);let c=xd(n,i[r],i[s],e.loop);if(!t.segments){o.push({source:e,target:c,start:i[r],end:i[s]});continue}let l=pc(t,c);for(let t of l){let r=xd(n,a[t.start],a[t.end],t.loop),s=fc(e,i,r);for(let e of s)o.push({source:e,target:t,start:{[n]:wd(c,r,`start`,Math.max)},end:{[n]:wd(c,r,`end`,Math.min)}})}}return o}function xd(e,t,n,r){if(r)return;let i=t[e],a=n[e];return e===`angle`&&(i=qa(i),a=qa(a)),{property:e,start:i,end:a}}function Sd(e,t){let{x:n=null,y:r=null}=e||{},i=t.points,a=[];return t.segments.forEach(({start:e,end:t})=>{t=Cd(e,t,i);let o=i[e],s=i[t];r===null?n!==null&&(a.push({x:n,y:o.y}),a.push({x:n,y:s.y})):(a.push({x:o.x,y:r}),a.push({x:s.x,y:r}))}),a}function Cd(e,t,n){for(;t>e;t--){let e=n[t];if(!isNaN(e.x)&&!isNaN(e.y))break}return t}function wd(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function Td(e,t){let n=[],r=!1;return W(e)?(r=!0,n=e):n=Sd(e,t),n.length?new _d({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function Ed(e){return e&&e.fill!==!1}function Dd(e,t,n){let r=e[t].fill,i=[t],a;if(!n)return r;for(;r!==!1&&i.indexOf(r)===-1;){if(!K(r))return r;if(a=e[r],!a)return!1;if(a.visible)return r;i.push(r),r=a.fill}return!1}function Od(e,t,n){let r=Md(e);if(G(r))return isNaN(r.value)?!1:r;let i=parseFloat(r);return K(i)&&Math.floor(i)===i?kd(r[0],t,i,n):[`origin`,`start`,`end`,`stack`,`shape`].indexOf(r)>=0&&r}function kd(e,t,n,r){return(e===`-`||e===`+`)&&(n=t+n),n===t||n<0||n>=r?!1:n}function Ad(e,t){let n=null;return e===`start`?n=t.bottom:e===`end`?n=t.top:G(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function jd(e,t,n){let r;return r=e===`start`?n:e===`end`?t.options.reverse?t.min:t.max:G(e)?e.value:t.getBaseValue(),r}function Md(e){let t=e.options,n=t.fill,r=q(n&&n.target,n);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?`origin`:r}function Nd(e){let{scale:t,index:n,line:r}=e,i=[],a=r.segments,o=r.points,s=Pd(t,n);s.push(Td({x:null,y:t.bottom},r));for(let e=0;e<a.length;e++){let t=a[e];for(let e=t.start;e<=t.end;e++)Fd(i,o[e],s)}return new _d({points:i,options:{}})}function Pd(e,t){let n=[],r=e.getMatchingVisibleMetas(`line`);for(let e=0;e<r.length;e++){let i=r[e];if(i.index===t)break;i.hidden||n.unshift(i.dataset)}return n}function Fd(e,t,n){let r=[];for(let i=0;i<n.length;i++){let a=n[i],{first:o,last:s,point:c}=Id(a,t,`x`);if(!(!c||o&&s)){if(o)r.unshift(c);else if(e.push(c),!s)break}}e.push(...r)}function Id(e,t,n){let r=e.interpolate(t,n);if(!r)return{};let i=r[n],a=e.segments,o=e.points,s=!1,c=!1;for(let e=0;e<a.length;e++){let t=a[e],r=o[t.start][n],l=o[t.end][n];if(Za(i,r,l)){s=i===r,c=i===l;break}}return{first:s,last:c,point:r}}var Ld=class{constructor(e){this.x=e.x,this.y=e.y,this.radius=e.radius}pathSegment(e,t,n){let{x:r,y:i,radius:a}=this;return t||={start:0,end:Ta},e.arc(r,i,a,t.end,t.start,!0),!n.bounds}interpolate(e){let{x:t,y:n,radius:r}=this,i=e.angle;return{x:t+Math.cos(i)*r,y:n+Math.sin(i)*r,angle:i}}};function Rd(e){let{chart:t,fill:n,line:r}=e;if(K(n))return zd(t,n);if(n===`stack`)return Nd(e);if(n===`shape`)return!0;let i=Bd(e);return i instanceof Ld?i:Td(i,r)}function zd(e,t){let n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function Bd(e){return(e.scale||{}).getPointPositionForValue?Hd(e):Vd(e)}function Vd(e){let{scale:t={},fill:n}=e,r=Ad(n,t);if(K(r)){let e=t.isHorizontal();return{x:e?r:null,y:e?null:r}}return null}function Hd(e){let{scale:t,fill:n}=e,r=t.options,i=t.getLabels().length,a=r.reverse?t.max:t.min,o=jd(n,t,a),s=[];if(r.grid.circular){let e=t.getPointPositionForValue(0,a);return new Ld({x:e.x,y:e.y,radius:t.getDistanceFromCenterForValue(o)})}for(let e=0;e<i;++e)s.push(t.getPointPositionForValue(e,o));return s}function Ud(e,t,n){let r=Rd(t),{chart:i,index:a,line:o,scale:s,axis:c}=t,l=o.options,u=l.fill,d=l.backgroundColor,{above:f=d,below:p=d}=u||{},m=Cc(i,i.getDatasetMeta(a));r&&o.points.length&&(Go(e,n),Wd(e,{line:o,target:r,above:f,below:p,area:n,scale:s,axis:c,clip:m}),Ko(e))}function Wd(e,t){let{line:n,target:r,above:i,below:a,area:o,scale:s,clip:c}=t,l=n._loop?`angle`:t.axis;e.save();let u=a;a!==i&&(l===`x`?(Gd(e,r,o.top),qd(e,{line:n,target:r,color:i,scale:s,property:l,clip:c}),e.restore(),e.save(),Gd(e,r,o.bottom)):l===`y`&&(Kd(e,r,o.left),qd(e,{line:n,target:r,color:a,scale:s,property:l,clip:c}),e.restore(),e.save(),Kd(e,r,o.right),u=i)),qd(e,{line:n,target:r,color:u,scale:s,property:l,clip:c}),e.restore()}function Gd(e,t,n){let{segments:r,points:i}=t,a=!0,o=!1;e.beginPath();for(let s of r){let{start:r,end:c}=s,l=i[r],u=i[Cd(r,c,i)];a?(e.moveTo(l.x,l.y),a=!1):(e.lineTo(l.x,n),e.lineTo(l.x,l.y)),o=!!t.pathSegment(e,s,{move:o}),o?e.closePath():e.lineTo(u.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function Kd(e,t,n){let{segments:r,points:i}=t,a=!0,o=!1;e.beginPath();for(let s of r){let{start:r,end:c}=s,l=i[r],u=i[Cd(r,c,i)];a?(e.moveTo(l.x,l.y),a=!1):(e.lineTo(n,l.y),e.lineTo(l.x,l.y)),o=!!t.pathSegment(e,s,{move:o}),o?e.closePath():e.lineTo(n,u.y)}e.lineTo(n,t.first().y),e.closePath(),e.clip()}function qd(e,t){let{line:n,target:r,property:i,color:a,scale:o,clip:s}=t,c=bd(n,r,i);for(let{source:t,target:l,start:u,end:d}of c){let{style:{backgroundColor:c=a}={}}=t,f=r!==!0;e.save(),e.fillStyle=c,Jd(e,o,s,f&&xd(i,u,d)),e.beginPath();let p=!!n.pathSegment(e,t),m;if(f){p?e.closePath():Yd(e,r,d,i);let t=!!r.pathSegment(e,l,{move:p,reverse:!0});m=p&&t,m||Yd(e,r,u,i)}e.closePath(),e.fill(m?`evenodd`:`nonzero`),e.restore()}}function Jd(e,t,n,r){let i=t.chart.chartArea,{property:a,start:o,end:s}=r||{};if(a===`x`||a===`y`){let t,r,c,l;a===`x`?(t=o,r=i.top,c=s,l=i.bottom):(t=i.left,r=o,c=i.right,l=s),e.beginPath(),n&&(t=Math.max(t,n.left),c=Math.min(c,n.right),r=Math.max(r,n.top),l=Math.min(l,n.bottom)),e.rect(t,r,c-t,l-r),e.clip()}}function Yd(e,t,n,r){let i=t.interpolate(n,r);i&&e.lineTo(i.x,i.y)}var Xd={id:`filler`,afterDatasetsUpdate(e,t,n){let r=(e.data.datasets||[]).length,i=[],a,o,s,c;for(o=0;o<r;++o)a=e.getDatasetMeta(o),s=a.dataset,c=null,s&&s.options&&s instanceof _d&&(c={visible:e.isDatasetVisible(o),index:o,fill:Od(s,o,r),chart:e,axis:a.controller.options.indexAxis,scale:a.vScale,line:s}),a.$filler=c,i.push(c);for(o=0;o<r;++o)c=i[o],!(!c||c.fill===!1)&&(c.fill=Dd(i,o,n.propagate))},beforeDraw(e,t,n){let r=n.drawTime===`beforeDraw`,i=e.getSortedVisibleDatasetMetas(),a=e.chartArea;for(let t=i.length-1;t>=0;--t){let n=i[t].$filler;n&&(n.line.updateControlPoints(a,n.axis),r&&n.fill&&Ud(e.ctx,n,a))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!==`beforeDatasetsDraw`)return;let r=e.getSortedVisibleDatasetMetas();for(let t=r.length-1;t>=0;--t){let n=r[t].$filler;Ed(n)&&Ud(e.ctx,n,e.chartArea)}},beforeDatasetDraw(e,t,n){let r=t.meta.$filler;!Ed(r)||n.drawTime!==`beforeDatasetDraw`||Ud(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:`beforeDatasetDraw`}},Zd=(e,t)=>{let{boxHeight:n=t,boxWidth:r=t}=e;return e.usePointStyle&&(n=Math.min(n,t),r=e.pointStyleWidth||Math.min(r,t)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(t,n)}},Qd=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index,$d=class extends Yl{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=J(e.generateLabels,[this.chart],this)||[];e.filter&&(t=t.filter(t=>e.filter(t,this.chart.data))),e.sort&&(t=t.sort((t,n)=>e.sort(t,n,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=$(n.font),i=r.size,a=this._computeTitleHeight(),{boxWidth:o,itemHeight:s}=Zd(n,i),c,l;t.font=r.string,this.isHorizontal()?(c=this.maxWidth,l=this._fitRows(a,i,o,s)+10):(l=this.maxHeight,c=this._fitCols(a,r,o,s)+10),this.width=Math.min(c,e.maxWidth||this.maxWidth),this.height=Math.min(l,e.maxHeight||this.maxHeight)}_fitRows(e,t,n,r){let{ctx:i,maxWidth:a,options:{labels:{padding:o}}}=this,s=this.legendHitBoxes=[],c=this.lineWidths=[0],l=r+o,u=e;i.textAlign=`left`,i.textBaseline=`middle`;let d=-1,f=-l;return this.legendItems.forEach((e,p)=>{let m=n+t/2+i.measureText(e.text).width;(p===0||c[c.length-1]+m+2*o>a)&&(u+=l,c[c.length-(p>0?0:1)]=0,f+=l,d++),s[p]={left:0,top:f,row:d,width:m,height:r},c[c.length-1]+=m+o}),u}_fitCols(e,t,n,r){let{ctx:i,maxHeight:a,options:{labels:{padding:o}}}=this,s=this.legendHitBoxes=[],c=this.columnSizes=[],l=a-e,u=o,d=0,f=0,p=0,m=0;return this.legendItems.forEach((e,a)=>{let{itemWidth:h,itemHeight:g}=ef(n,t,i,e,r);a>0&&f+g+2*o>l&&(u+=d+o,c.push({width:d,height:f}),p+=d+o,m++,d=f=0),s[a]={left:p,top:f,col:m,width:h,height:g},d=Math.max(d,h),f+=g+o}),u+=d,c.push({width:d,height:f}),u}adjustHitBoxes(){if(!this.options.display)return;let e=this._computeTitleHeight(),{legendHitBoxes:t,options:{align:n,labels:{padding:r},rtl:i}}=this,a=oc(i,this.left,this.width);if(this.isHorizontal()){let i=0,o=uo(n,this.left+r,this.right-this.lineWidths[i]);for(let s of t)i!==s.row&&(i=s.row,o=uo(n,this.left+r,this.right-this.lineWidths[i])),s.top+=this.top+e+r,s.left=a.leftForLtr(a.x(o),s.width),o+=s.width+r}else{let i=0,o=uo(n,this.top+e+r,this.bottom-this.columnSizes[i].height);for(let s of t)s.col!==i&&(i=s.col,o=uo(n,this.top+e+r,this.bottom-this.columnSizes[i].height)),s.top=o,s.left+=this.left+r,s.left=a.leftForLtr(a.x(s.left),s.width),o+=s.height+r}}isHorizontal(){return this.options.position===`top`||this.options.position===`bottom`}draw(){if(this.options.display){let e=this.ctx;Go(e,this),this._draw(),Ko(e)}}_draw(){let{options:e,columnSizes:t,lineWidths:n,ctx:r}=this,{align:i,labels:a}=e,o=Z.color,s=oc(e.rtl,this.left,this.width),c=$(a.font),{padding:l}=a,u=c.size,d=u/2,f;this.drawTitle(),r.textAlign=s.textAlign(`left`),r.textBaseline=`middle`,r.lineWidth=.5,r.font=c.string;let{boxWidth:p,boxHeight:m,itemHeight:h}=Zd(a,u),g=function(e,t,n){if(isNaN(p)||p<=0||isNaN(m)||m<0)return;r.save();let i=q(n.lineWidth,1);if(r.fillStyle=q(n.fillStyle,o),r.lineCap=q(n.lineCap,`butt`),r.lineDashOffset=q(n.lineDashOffset,0),r.lineJoin=q(n.lineJoin,`miter`),r.lineWidth=i,r.strokeStyle=q(n.strokeStyle,o),r.setLineDash(q(n.lineDash,[])),a.usePointStyle)Uo(r,{radius:m*Math.SQRT2/2,pointStyle:n.pointStyle,rotation:n.rotation,borderWidth:i},s.xPlus(e,p/2),t+d,a.pointStyleWidth&&p);else{let a=t+Math.max((u-m)/2,0),o=s.leftForLtr(e,p),c=os(n.borderRadius);r.beginPath(),Object.values(c).some(e=>e!==0)?$o(r,{x:o,y:a,w:p,h:m,radius:c}):r.rect(o,a,p,m),r.fill(),i!==0&&r.stroke()}r.restore()},_=function(e,t,n){Qo(r,n.text,e,t+h/2,c,{strikethrough:n.hidden,textAlign:s.textAlign(n.textAlign)})},v=this.isHorizontal(),y=this._computeTitleHeight();f=v?{x:uo(i,this.left+l,this.right-n[0]),y:this.top+l+y,line:0}:{x:this.left+l,y:uo(i,this.top+y+l,this.bottom-t[0].height),line:0},sc(this.ctx,e.textDirection);let b=h+l;this.legendItems.forEach((o,u)=>{r.strokeStyle=o.fontColor,r.fillStyle=o.fontColor;let m=r.measureText(o.text).width,h=s.textAlign(o.textAlign||=a.textAlign),x=p+d+m,S=f.x,C=f.y;if(s.setWidth(this.width),v?u>0&&S+x+l>this.right&&(C=f.y+=b,f.line++,S=f.x=uo(i,this.left+l,this.right-n[f.line])):u>0&&C+b>this.bottom&&(S=f.x=S+t[f.line].width+l,f.line++,C=f.y=uo(i,this.top+y+l,this.bottom-t[f.line].height)),g(s.x(S),C,o),S=fo(h,S+p+d,v?S+x:this.right,e.rtl),_(s.x(S),C,o),v)f.x+=x+l;else if(typeof o.text!=`string`){let e=c.lineHeight;f.y+=rf(o,e)+l}else f.y+=b}),cc(this.ctx,e.textDirection)}drawTitle(){let e=this.options,t=e.title,n=$(t.font),r=Q(t.padding);if(!t.display)return;let i=oc(e.rtl,this.left,this.width),a=this.ctx,o=t.position,s=n.size/2,c=r.top+s,l,u=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),l=this.top+c,u=uo(e.align,u,this.right-d);else{let t=this.columnSizes.reduce((e,t)=>Math.max(e,t.height),0);l=c+uo(e.align,this.top,this.bottom-t-e.labels.padding-this._computeTitleHeight())}let f=uo(o,u,u+d);a.textAlign=i.textAlign(lo(o)),a.textBaseline=`middle`,a.strokeStyle=t.color,a.fillStyle=t.color,a.font=n.string,Qo(a,t.text,f,l,n)}_computeTitleHeight(){let e=this.options.title,t=$(e.font),n=Q(e.padding);return e.display?t.lineHeight+n.height:0}_getLegendItemAt(e,t){let n,r,i;if(Za(e,this.left,this.right)&&Za(t,this.top,this.bottom)){for(i=this.legendHitBoxes,n=0;n<i.length;++n)if(r=i[n],Za(e,r.left,r.left+r.width)&&Za(t,r.top,r.top+r.height))return this.legendItems[n]}return null}handleEvent(e){let t=this.options;if(!af(e.type,t))return;let n=this._getLegendItemAt(e.x,e.y);if(e.type===`mousemove`||e.type===`mouseout`){let r=this._hoveredItem,i=Qd(r,n);r&&!i&&J(t.onLeave,[e,r,this],this),this._hoveredItem=n,n&&!i&&J(t.onHover,[e,n,this],this)}else n&&J(t.onClick,[e,n,this],this)}};function ef(e,t,n,r,i){return{itemWidth:tf(r,e,t,n),itemHeight:nf(i,r,t.lineHeight)}}function tf(e,t,n,r){let i=e.text;return i&&typeof i!=`string`&&(i=i.reduce((e,t)=>e.length>t.length?e:t)),t+n.size/2+r.measureText(i).width}function nf(e,t,n){let r=e;return typeof t.text!=`string`&&(r=rf(t,n)),r}function rf(e,t){return t*(e.text?e.text.length:0)}function af(e,t){return!!((e===`mousemove`||e===`mouseout`)&&(t.onHover||t.onLeave)||t.onClick&&(e===`click`||e===`mouseup`))}var of={id:`legend`,_element:$d,start(e,t,n){let r=e.legend=new $d({ctx:e.ctx,options:n,chart:e});Tl.configure(e,r,n),Tl.addBox(e,r)},stop(e){Tl.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){let r=e.legend;Tl.configure(e,r,n),r.options=n},afterUpdate(e){let t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:`top`,align:`center`,fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){let r=t.datasetIndex,i=n.chart;i.isDatasetVisible(r)?(i.hide(r),t.hidden=!0):(i.show(r),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){let t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:i,color:a,useBorderRadius:o,borderRadius:s}}=e.legend.options;return e._getSortedDatasetMetas().map(e=>{let c=e.controller.getStyle(n?0:void 0),l=Q(c.borderWidth);return{text:t[e.index].label,fillStyle:c.backgroundColor,fontColor:a,hidden:!e.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(l.width+l.height)/4,strokeStyle:c.borderColor,pointStyle:r||c.pointStyle,rotation:c.rotation,textAlign:i||c.textAlign,borderRadius:o&&(s||c.borderRadius),datasetIndex:e.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:`center`,text:``}},descriptors:{_scriptable:e=>!e.startsWith(`on`),labels:{_scriptable:e=>![`generateLabels`,`filter`,`sort`].includes(e)}}},sf={average(e){if(!e.length)return!1;let t,n,r=new Set,i=0,a=0;for(t=0,n=e.length;t<n;++t){let n=e[t].element;if(n&&n.hasValue()){let e=n.tooltipPosition();r.add(e.x),i+=e.y,++a}}return a===0||r.size===0?!1:{x:[...r].reduce((e,t)=>e+t)/r.size,y:i/a}},nearest(e,t){if(!e.length)return!1;let n=t.x,r=t.y,i=1/0,a,o,s;for(a=0,o=e.length;a<o;++a){let n=e[a].element;if(n&&n.hasValue()){let e=Ga(t,n.getCenterPoint());e<i&&(i=e,s=n)}}if(s){let e=s.tooltipPosition();n=e.x,r=e.y}return{x:n,y:r}}};function cf(e,t){return t&&(W(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function lf(e){return(typeof e==`string`||e instanceof String)&&e.indexOf(`
2
2
  `)>-1?e.split(`
3
3
  `):e}function uf(e,t){let{element:n,datasetIndex:r,index:i}=t,a=e.getDatasetMeta(r).controller,{label:o,value:s}=a.getLabelAndValue(i);return{chart:e,label:o,parsed:a.getParsed(i),raw:e.data.datasets[r].data[i],formattedValue:s,dataset:a.getDataset(),dataIndex:i,datasetIndex:r,element:n}}function df(e,t){let n=e.chart.ctx,{body:r,footer:i,title:a}=e,{boxWidth:o,boxHeight:s}=t,c=$(t.bodyFont),l=$(t.titleFont),u=$(t.footerFont),d=a.length,f=i.length,p=r.length,m=Q(t.padding),h=m.height,g=0,_=r.reduce((e,t)=>e+t.before.length+t.lines.length+t.after.length,0);if(_+=e.beforeBody.length+e.afterBody.length,d&&(h+=d*l.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),_){let e=t.displayColors?Math.max(s,c.lineHeight):c.lineHeight;h+=p*e+(_-p)*c.lineHeight+(_-1)*t.bodySpacing}f&&(h+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let v=0,y=function(e){g=Math.max(g,n.measureText(e).width+v)};return n.save(),n.font=l.string,Y(e.title,y),n.font=c.string,Y(e.beforeBody.concat(e.afterBody),y),v=t.displayColors?o+2+t.boxPadding:0,Y(r,e=>{Y(e.before,y),Y(e.lines,y),Y(e.after,y)}),v=0,n.font=u.string,Y(e.footer,y),n.restore(),g+=m.width,{width:g,height:h}}function ff(e,t){let{y:n,height:r}=t;return n<r/2?`top`:n>e.height-r/2?`bottom`:`center`}function pf(e,t,n,r){let{x:i,width:a}=r,o=n.caretSize+n.caretPadding;if(e===`left`&&i+a+o>t.width||e===`right`&&i-a-o<0)return!0}function mf(e,t,n,r){let{x:i,width:a}=n,{width:o,chartArea:{left:s,right:c}}=e,l=`center`;return r===`center`?l=i<=(s+c)/2?`left`:`right`:i<=a/2?l=`left`:i>=o-a/2&&(l=`right`),pf(l,e,t,n)&&(l=`center`),l}function hf(e,t,n){let r=n.yAlign||t.yAlign||ff(e,n);return{xAlign:n.xAlign||t.xAlign||mf(e,t,n,r),yAlign:r}}function gf(e,t){let{x:n,width:r}=e;return t===`right`?n-=r:t===`center`&&(n-=r/2),n}function _f(e,t,n){let{y:r,height:i}=e;return t===`top`?r+=n:t===`bottom`?r-=i+n:r-=i/2,r}function vf(e,t,n,r){let{caretSize:i,caretPadding:a,cornerRadius:o}=e,{xAlign:s,yAlign:c}=n,l=i+a,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:p}=os(o),m=gf(t,s),h=_f(t,c,l);return c===`center`?s===`left`?m+=l:s===`right`&&(m-=l):s===`left`?m-=Math.max(u,f)+i:s===`right`&&(m+=Math.max(d,p)+i),{x:Ya(m,0,r.width-t.width),y:Ya(h,0,r.height-t.height)}}function yf(e,t,n){let r=Q(n.padding);return t===`center`?e.x+e.width/2:t===`right`?e.x+e.width-r.right:e.x+r.left}function bf(e){return cf([],lf(e))}function xf(e,t,n){return ls(e,{tooltip:t,tooltipItems:n,type:`tooltip`})}function Sf(e,t){let n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}var Cf={beforeTitle:aa,title(e){if(e.length>0){let t=e[0],n=t.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode===`dataset`)return t.dataset.label||``;if(t.label)return t.label;if(r>0&&t.dataIndex<r)return n[t.dataIndex]}return``},afterTitle:aa,beforeBody:aa,beforeLabel:aa,label(e){if(this&&this.options&&this.options.mode===`dataset`)return e.label+`: `+e.formattedValue||e.formattedValue;let t=e.dataset.label||``;t&&(t+=`: `);let n=e.formattedValue;return U(n)||(t+=n),t},labelColor(e){let t=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.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(e){let t=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:t.pointStyle,rotation:t.rotation}},afterLabel:aa,afterBody:aa,beforeFooter:aa,footer:aa,afterFooter:aa};function wf(e,t,n,r){let i=e[t].call(n,r);return i===void 0?Cf[t].call(n,r):i}var Tf=class extends Yl{static positioners=sf;constructor(e){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=e.chart,this.options=e.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(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){let e=this._cachedAnimations;if(e)return e;let t=this.chart,n=this.options.setContext(this.getContext()),r=n.enabled&&t.options.animation&&n.animations,i=new Oc(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(i)),i}getContext(){return this.$context||=xf(this.chart.getContext(),this,this._tooltipItems)}getTitle(e,t){let{callbacks:n}=t,r=wf(n,`beforeTitle`,this,e),i=wf(n,`title`,this,e),a=wf(n,`afterTitle`,this,e),o=[];return o=cf(o,lf(r)),o=cf(o,lf(i)),o=cf(o,lf(a)),o}getBeforeBody(e,t){return bf(wf(t.callbacks,`beforeBody`,this,e))}getBody(e,t){let{callbacks:n}=t,r=[];return Y(e,e=>{let t={before:[],lines:[],after:[]},i=Sf(n,e);cf(t.before,lf(wf(i,`beforeLabel`,this,e))),cf(t.lines,wf(i,`label`,this,e)),cf(t.after,lf(wf(i,`afterLabel`,this,e))),r.push(t)}),r}getAfterBody(e,t){return bf(wf(t.callbacks,`afterBody`,this,e))}getFooter(e,t){let{callbacks:n}=t,r=wf(n,`beforeFooter`,this,e),i=wf(n,`footer`,this,e),a=wf(n,`afterFooter`,this,e),o=[];return o=cf(o,lf(r)),o=cf(o,lf(i)),o=cf(o,lf(a)),o}_createItems(e){let t=this._active,n=this.chart.data,r=[],i=[],a=[],o=[],s,c;for(s=0,c=t.length;s<c;++s)o.push(uf(this.chart,t[s]));return e.filter&&(o=o.filter((t,r,i)=>e.filter(t,r,i,n))),e.itemSort&&(o=o.sort((t,r)=>e.itemSort(t,r,n))),Y(o,t=>{let n=Sf(e.callbacks,t);r.push(wf(n,`labelColor`,this,t)),i.push(wf(n,`labelPointStyle`,this,t)),a.push(wf(n,`labelTextColor`,this,t))}),this.labelColors=r,this.labelPointStyles=i,this.labelTextColors=a,this.dataPoints=o,o}update(e,t){let n=this.options.setContext(this.getContext()),r=this._active,i,a=[];if(!r.length)this.opacity!==0&&(i={opacity:0});else{let e=sf[n.position].call(this,r,this._eventPosition);a=this._createItems(n),this.title=this.getTitle(a,n),this.beforeBody=this.getBeforeBody(a,n),this.body=this.getBody(a,n),this.afterBody=this.getAfterBody(a,n),this.footer=this.getFooter(a,n);let t=this._size=df(this,n),o=Object.assign({},e,t),s=hf(this.chart,n,o),c=vf(n,o,s,this.chart);this.xAlign=s.xAlign,this.yAlign=s.yAlign,i={opacity:1,x:c.x,y:c.y,width:t.width,height:t.height,caretX:e.x,caretY:e.y}}this._tooltipItems=a,this.$context=void 0,i&&this._resolveAnimations().update(this,i),e&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,n,r){let i=this.getCaretPosition(e,n,r);t.lineTo(i.x1,i.y1),t.lineTo(i.x2,i.y2),t.lineTo(i.x3,i.y3)}getCaretPosition(e,t,n){let{xAlign:r,yAlign:i}=this,{caretSize:a,cornerRadius:o}=n,{topLeft:s,topRight:c,bottomLeft:l,bottomRight:u}=os(o),{x:d,y:f}=e,{width:p,height:m}=t,h,g,_,v,y,b;return i===`center`?(y=f+m/2,r===`left`?(h=d,g=h-a,v=y+a,b=y-a):(h=d+p,g=h+a,v=y-a,b=y+a),_=h):(g=r===`left`?d+Math.max(s,l)+a:r===`right`?d+p-Math.max(c,u)-a:this.caretX,i===`top`?(v=f,y=v-a,h=g-a,_=g+a):(v=f+m,y=v+a,h=g+a,_=g-a),b=v),{x1:h,x2:g,x3:_,y1:v,y2:y,y3:b}}drawTitle(e,t,n){let r=this.title,i=r.length,a,o,s;if(i){let c=oc(n.rtl,this.x,this.width);for(e.x=yf(this,n.titleAlign,n),t.textAlign=c.textAlign(n.titleAlign),t.textBaseline=`middle`,a=$(n.titleFont),o=n.titleSpacing,t.fillStyle=n.titleColor,t.font=a.string,s=0;s<i;++s)t.fillText(r[s],c.x(e.x),e.y+a.lineHeight/2),e.y+=a.lineHeight+o,s+1===i&&(e.y+=n.titleMarginBottom-o)}}_drawColorBox(e,t,n,r,i){let a=this.labelColors[n],o=this.labelPointStyles[n],{boxHeight:s,boxWidth:c}=i,l=$(i.bodyFont),u=yf(this,`left`,i),d=r.x(u),f=s<l.lineHeight?(l.lineHeight-s)/2:0,p=t.y+f;if(i.usePointStyle){let t={radius:Math.min(c,s)/2,pointStyle:o.pointStyle,rotation:o.rotation,borderWidth:1},n=r.leftForLtr(d,c)+c/2,l=p+s/2;e.strokeStyle=i.multiKeyBackground,e.fillStyle=i.multiKeyBackground,Ho(e,t,n,l),e.strokeStyle=a.borderColor,e.fillStyle=a.backgroundColor,Ho(e,t,n,l)}else{e.lineWidth=G(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,e.strokeStyle=a.borderColor,e.setLineDash(a.borderDash||[]),e.lineDashOffset=a.borderDashOffset||0;let t=r.leftForLtr(d,c),n=r.leftForLtr(r.xPlus(d,1),c-2),o=os(a.borderRadius);Object.values(o).some(e=>e!==0)?(e.beginPath(),e.fillStyle=i.multiKeyBackground,$o(e,{x:t,y:p,w:c,h:s,radius:o}),e.fill(),e.stroke(),e.fillStyle=a.backgroundColor,e.beginPath(),$o(e,{x:n,y:p+1,w:c-2,h:s-2,radius:o}),e.fill()):(e.fillStyle=i.multiKeyBackground,e.fillRect(t,p,c,s),e.strokeRect(t,p,c,s),e.fillStyle=a.backgroundColor,e.fillRect(n,p+1,c-2,s-2))}e.fillStyle=this.labelTextColors[n]}drawBody(e,t,n){let{body:r}=this,{bodySpacing:i,bodyAlign:a,displayColors:o,boxHeight:s,boxWidth:c,boxPadding:l}=n,u=$(n.bodyFont),d=u.lineHeight,f=0,p=oc(n.rtl,this.x,this.width),m=function(n){t.fillText(n,p.x(e.x+f),e.y+d/2),e.y+=d+i},h=p.textAlign(a),g,_,v,y,b,x,S;for(t.textAlign=a,t.textBaseline=`middle`,t.font=u.string,e.x=yf(this,h,n),t.fillStyle=n.bodyColor,Y(this.beforeBody,m),f=o&&h!==`right`?a===`center`?c/2+l:c+2+l:0,y=0,x=r.length;y<x;++y){for(g=r[y],_=this.labelTextColors[y],t.fillStyle=_,Y(g.before,m),v=g.lines,o&&v.length&&(this._drawColorBox(t,e,y,p,n),d=Math.max(u.lineHeight,s)),b=0,S=v.length;b<S;++b)m(v[b]),d=u.lineHeight;Y(g.after,m)}f=0,d=u.lineHeight,Y(this.afterBody,m),e.y-=i}drawFooter(e,t,n){let r=this.footer,i=r.length,a,o;if(i){let s=oc(n.rtl,this.x,this.width);for(e.x=yf(this,n.footerAlign,n),e.y+=n.footerMarginTop,t.textAlign=s.textAlign(n.footerAlign),t.textBaseline=`middle`,a=$(n.footerFont),t.fillStyle=n.footerColor,t.font=a.string,o=0;o<i;++o)t.fillText(r[o],s.x(e.x),e.y+a.lineHeight/2),e.y+=a.lineHeight+n.footerSpacing}}drawBackground(e,t,n,r){let{xAlign:i,yAlign:a}=this,{x:o,y:s}=e,{width:c,height:l}=n,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:p}=os(r.cornerRadius);t.fillStyle=r.backgroundColor,t.strokeStyle=r.borderColor,t.lineWidth=r.borderWidth,t.beginPath(),t.moveTo(o+u,s),a===`top`&&this.drawCaret(e,t,n,r),t.lineTo(o+c-d,s),t.quadraticCurveTo(o+c,s,o+c,s+d),a===`center`&&i===`right`&&this.drawCaret(e,t,n,r),t.lineTo(o+c,s+l-p),t.quadraticCurveTo(o+c,s+l,o+c-p,s+l),a===`bottom`&&this.drawCaret(e,t,n,r),t.lineTo(o+f,s+l),t.quadraticCurveTo(o,s+l,o,s+l-f),a===`center`&&i===`left`&&this.drawCaret(e,t,n,r),t.lineTo(o,s+u),t.quadraticCurveTo(o,s,o+u,s),t.closePath(),t.fill(),r.borderWidth>0&&t.stroke()}_updateAnimationTarget(e){let t=this.chart,n=this.$animations,r=n&&n.x,i=n&&n.y;if(r||i){let n=sf[e.position].call(this,this._active,this._eventPosition);if(!n)return;let a=this._size=df(this,e),o=Object.assign({},n,this._size),s=hf(t,e,o),c=vf(e,o,s,t);(r._to!==c.x||i._to!==c.y)&&(this.xAlign=s.xAlign,this.yAlign=s.yAlign,this.width=a.width,this.height=a.height,this.caretX=n.x,this.caretY=n.y,this._resolveAnimations().update(this,c))}}_willRender(){return!!this.opacity}draw(e){let t=this.options.setContext(this.getContext()),n=this.opacity;if(!n)return;this._updateAnimationTarget(t);let r={width:this.width,height:this.height},i={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;let a=Q(t.padding),o=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;t.enabled&&o&&(e.save(),e.globalAlpha=n,this.drawBackground(i,e,r,t),sc(e,t.textDirection),i.y+=a.top,this.drawTitle(i,e,t),this.drawBody(i,e,t),this.drawFooter(i,e,t),cc(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){let n=this._active,r=e.map(({datasetIndex:e,index:t})=>{let n=this.chart.getDatasetMeta(e);if(!n)throw Error(`Cannot find a dataset at index `+e);return{datasetIndex:e,element:n.data[t],index:t}}),i=!la(n,r),a=this._positionChanged(r,t);(i||a)&&(this._active=r,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,n=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;let r=this.options,i=this._active||[],a=this._getActiveElements(e,i,t,n),o=this._positionChanged(a,e),s=t||!la(a,i)||o;return s&&(this._active=a,(r.enabled||r.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),s}_getActiveElements(e,t,n,r){let i=this.options;if(e.type===`mouseout`)return[];if(!r)return t.filter(e=>this.chart.data.datasets[e.datasetIndex]&&this.chart.getDatasetMeta(e.datasetIndex).controller.getParsed(e.index)!==void 0);let a=this.chart.getElementsAtEventForMode(e,i.mode,i,n);return i.reverse&&a.reverse(),a}_positionChanged(e,t){let{caretX:n,caretY:r,options:i}=this,a=sf[i.position].call(this,e,t);return a!==!1&&(n!==a.x||r!==a.y)}},Ef={id:`tooltip`,_element:Tf,positioners:sf,afterInit(e,t,n){n&&(e.tooltip=new Tf({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){let t=e.tooltip;if(t&&t._willRender()){let n={tooltip:t};if(e.notifyPlugins(`beforeTooltipDraw`,{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins(`afterTooltipDraw`,n)}},afterEvent(e,t){if(e.tooltip){let n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:`average`,backgroundColor:`rgba(0,0,0,0.8)`,titleColor:`#fff`,titleFont:{weight:`bold`},titleSpacing:2,titleMarginBottom:6,titleAlign:`left`,bodyColor:`#fff`,bodySpacing:2,bodyFont:{},bodyAlign:`left`,footerColor:`#fff`,footerSpacing:2,footerMarginTop:6,footerFont:{weight:`bold`},footerAlign:`left`,padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:`#fff`,displayColors:!0,boxPadding:0,borderColor:`rgba(0,0,0,0)`,borderWidth:0,animation:{duration:400,easing:`easeOutQuart`},animations:{numbers:{type:`number`,properties:[`x`,`y`,`width`,`height`,`caretX`,`caretY`]},opacity:{easing:`linear`,duration:200}},callbacks:Cf},defaultRoutes:{bodyFont:`font`,footerFont:`font`,titleFont:`font`},descriptors:{_scriptable:e=>e!==`filter`&&e!==`itemSort`&&e!==`external`,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:`animation`}},additionalOptionScopes:[`interaction`]},Df=(e,t,n,r)=>(typeof t==`string`?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function Of(e,t,n,r){let i=e.indexOf(t);return i===-1?Df(e,t,n,r):i===e.lastIndexOf(t)?i:n}var kf=(e,t)=>e===null?null:Ya(Math.round(e),0,t);function Af(e){let t=this.getLabels();return e>=0&&e<t.length?t[e]:e}var jf=class extends hu{static id=`category`;static defaults={ticks:{callback:Af}};constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){let t=this._addedLabels;if(t.length){let e=this.getLabels();for(let{index:n,label:r}of t)e[n]===r&&e.splice(n,1);this._addedLabels=[]}super.init(e)}parse(e,t){if(U(e))return null;let n=this.getLabels();return t=isFinite(t)&&n[t]===e?t:Of(n,e,q(t,e),this._addedLabels),kf(t,n.length-1)}determineDataLimits(){let{minDefined:e,maxDefined:t}=this.getUserBounds(),{min:n,max:r}=this.getMinMax(!0);this.options.bounds===`ticks`&&(e||(n=0),t||(r=this.getLabels().length-1)),this.min=n,this.max=r}buildTicks(){let e=this.min,t=this.max,n=this.options.offset,r=[],i=this.getLabels();i=e===0&&t===i.length-1?i:i.slice(e,t+1),this._valueRange=Math.max(i.length-+!n,1),this._startValue=this.min-(n?.5:0);for(let n=e;n<=t;n++)r.push({value:n});return r}getLabelForValue(e){return Af.call(this,e)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(e){return typeof e!=`number`&&(e=this.parse(e)),e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getPixelForTick(e){let t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}};function Mf(e,t){let n=[],{bounds:r,step:i,min:a,max:o,precision:s,count:c,maxTicks:l,maxDigits:u,includeBounds:d}=e,f=i||1,p=l-1,{min:m,max:h}=t,g=!U(a),_=!U(o),v=!U(c),y=(h-m)/(u+1),b=Fa((h-m)/p/f)*f,x,S,C,w;if(b<1e-14&&!g&&!_)return[{value:m},{value:h}];w=Math.ceil(h/b)-Math.floor(m/b),w>p&&(b=Fa(w*b/p/f)*f),U(s)||(x=10**s,b=Math.ceil(b*x)/x),r===`ticks`?(S=Math.floor(m/b)*b,C=Math.ceil(h/b)*b):(S=m,C=h),g&&_&&i&&za((o-a)/i,b/1e3)?(w=Math.round(Math.min((o-a)/b,l)),b=(o-a)/w,S=a,C=o):v?(S=g?a:S,C=_?o:C,w=c-1,b=(C-S)/w):(w=(C-S)/b,w=Pa(w,Math.round(w),b/1e3)?Math.round(w):Math.ceil(w));let T=Math.max(Ua(b),Ua(S));x=10**(U(s)?T:s),S=Math.round(S*x)/x,C=Math.round(C*x)/x;let E=0;for(g&&(d&&S!==a?(n.push({value:a}),S<a&&E++,Pa(Math.round((S+E*b)*x)/x,a,Nf(a,y,e))&&E++):S<a&&E++);E<w;++E){let e=Math.round((S+E*b)*x)/x;if(_&&e>o)break;n.push({value:e})}return _&&d&&C!==o?n.length&&Pa(n[n.length-1].value,o,Nf(o,y,e))?n[n.length-1].value=o:n.push({value:o}):(!_||C===o)&&n.push({value:C}),n}function Nf(e,t,{horizontal:n,minRotation:r}){let i=Va(r),a=(n?Math.sin(i):Math.cos(i))||.001,o=.75*t*(``+e).length;return Math.min(t/a,o)}var Pf=class extends hu{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:i}=this,a=e=>r=t?r:e,o=e=>i=n?i:e;if(e){let e=Na(r),t=Na(i);e<0&&t<0?o(0):e>0&&t>0&&a(0)}if(r===i){let t=i===0?1:Math.abs(i*.05);o(i+t),e||a(r-t)}this.min=r,this.max=i}getTickLimit(){let{maxTicksLimit:e,stepSize:t}=this.options.ticks,n;return t?(n=Math.ceil(this.max/t)-Math.floor(this.min/t)+1,n>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${t} would result generating up to ${n} ticks. Limiting to 1000.`),n=1e3)):(n=this.computeTickLimit(),e||=11),e&&(n=Math.min(e,n)),n}computeTickLimit(){return 1/0}buildTicks(){let e=this.options,t=e.ticks,n=this.getTickLimit();n=Math.max(2,n);let r=Mf({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},this._range||this);return e.bounds===`ticks`&&Ba(r,this,`value`),e.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}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 Oo(e,this.chart.options.locale,this.options.ticks.format)}},Ff=class extends Pf{static id=`linear`;static defaults={ticks:{callback:jo.formatters.numeric}};determineDataLimits(){let{min:e,max:t}=this.getMinMax(!0);this.min=K(e)?e:0,this.max=K(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){let e=this.isHorizontal(),t=e?this.width:this.height,n=Va(this.options.ticks.minRotation),r=(e?Math.sin(n):Math.cos(n))||.001,i=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,i.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}},If=e=>Math.floor(Ma(e)),Lf=(e,t)=>10**(If(e)+t);function Rf(e){return e/10**If(e)==1}function zf(e,t,n){let r=10**n,i=Math.floor(e/r);return Math.ceil(t/r)-i}function Bf(e,t){let n=If(t-e);for(;zf(e,t,n)>10;)n++;for(;zf(e,t,n)<10;)n--;return Math.min(n,If(e))}function Vf(e,{min:t,max:n}){t=sa(e.min,t);let r=[],i=If(t),a=Bf(t,n),o=a<0?10**Math.abs(a):1,s=10**a,c=i>a?10**i:0,l=Math.round((t-c)*o)/o,u=Math.floor((t-c)/s/10)*s*10,d=Math.floor((l-u)/10**a),f=sa(e.min,Math.round((c+u+d*10**a)*o)/o);for(;f<n;)r.push({value:f,major:Rf(f),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(a++,d=2,o=a>=0?1:o),f=Math.round((c+u+d*10**a)*o)/o;let p=sa(e.max,f);return r.push({value:p,major:Rf(p),significand:d}),r}(class extends hu{static id=`logarithmic`;static defaults={ticks:{callback:jo.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=Pf.prototype.parse.apply(this,[e,t]);if(n===0){this._zero=!0;return}return K(n)&&n>0?n:null}determineDataLimits(){let{min:e,max:t}=this.getMinMax(!0);this.min=K(e)?Math.max(0,e):null,this.max=K(t)?Math.max(0,t):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!K(this._userMin)&&(this.min=e===Lf(this.min,0)?Lf(this.min,-1):Lf(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){let{minDefined:e,maxDefined:t}=this.getUserBounds(),n=this.min,r=this.max,i=t=>n=e?n:t,a=e=>r=t?r:e;n===r&&(n<=0?(i(1),a(10)):(i(Lf(n,-1)),a(Lf(r,1)))),n<=0&&i(Lf(r,-1)),r<=0&&a(Lf(n,1)),this.min=n,this.max=r}buildTicks(){let e=this.options,t=Vf({min:this._userMin,max:this._userMax},this);return e.bounds===`ticks`&&Ba(t,this,`value`),e.reverse?(t.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),t}getLabelForValue(e){return e===void 0?`0`:Oo(e,this.chart.options.locale,this.options.ticks.format)}configure(){let e=this.min;super.configure(),this._startValue=Ma(e),this._valueRange=Ma(this.max)-Ma(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(Ma(e)-this._startValue)/this._valueRange)}getValueForPixel(e){let t=this.getDecimalForPixel(e);return 10**(this._startValue+t*this._valueRange)}});function Hf(e){let t=e.ticks;if(t.display&&e.display){let e=Q(t.backdropPadding);return q(t.font&&t.font.size,Z.font.size)+e.height}return 0}function Uf(e,t,n){return n=W(n)?n:[n],{w:zo(e,t.string,n),h:n.length*t.lineHeight}}function Wf(e,t,n,r,i){return e===r||e===i?{start:t-n/2,end:t+n/2}:e<r||e>i?{start:t-n,end:t}:{start:t,end:t+n}}function Gf(e){let t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),r=[],i=[],a=e._pointLabels.length,o=e.options.pointLabels,s=o.centerPointLabels?X/a:0;for(let c=0;c<a;c++){let a=o.setContext(e.getPointLabelContext(c));i[c]=a.padding;let l=e.getPointPosition(c,e.drawingArea+i[c],s),u=$(a.font),d=Uf(e.ctx,u,e._pointLabels[c]);r[c]=d;let f=qa(e.getIndexAngle(c)+s),p=Math.round(Ha(f));Kf(n,t,f,Wf(p,l.x,d.w,0,180),Wf(p,l.y,d.h,90,270))}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=Yf(e,r,i)}function Kf(e,t,n,r,i){let a=Math.abs(Math.sin(n)),o=Math.abs(Math.cos(n)),s=0,c=0;r.start<t.l?(s=(t.l-r.start)/a,e.l=Math.min(e.l,t.l-s)):r.end>t.r&&(s=(r.end-t.r)/a,e.r=Math.max(e.r,t.r+s)),i.start<t.t?(c=(t.t-i.start)/o,e.t=Math.min(e.t,t.t-c)):i.end>t.b&&(c=(i.end-t.b)/o,e.b=Math.max(e.b,t.b+c))}function qf(e,t,n){let r=e.drawingArea,{extra:i,additionalAngle:a,padding:o,size:s}=n,c=e.getPointPosition(t,r+i+o,a),l=Math.round(Ha(qa(c.angle+ka))),u=Qf(c.y,s.h,l),d=Xf(l),f=Zf(c.x,s.w,d);return{visible:!0,x:c.x,y:u,textAlign:d,left:f,top:u,right:f+s.w,bottom:u+s.h}}function Jf(e,t){if(!t)return!0;let{left:n,top:r,right:i,bottom:a}=e;return!(Wo({x:n,y:r},t)||Wo({x:n,y:a},t)||Wo({x:i,y:r},t)||Wo({x:i,y:a},t))}function Yf(e,t,n){let r=[],i=e._pointLabels.length,a=e.options,{centerPointLabels:o,display:s}=a.pointLabels,c={extra:Hf(a)/2,additionalAngle:o?X/i:0},l;for(let a=0;a<i;a++){c.padding=n[a],c.size=t[a];let i=qf(e,a,c);r.push(i),s===`auto`&&(i.visible=Jf(i,l),i.visible&&(l=i))}return r}function Xf(e){return e===0||e===180?`center`:e<180?`left`:`right`}function Zf(e,t,n){return n===`right`?e-=t:n===`center`&&(e-=t/2),e}function Qf(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function $f(e,t,n){let{left:r,top:i,right:a,bottom:o}=n,{backdropColor:s}=t;if(!U(s)){let n=os(t.borderRadius),c=Q(t.backdropPadding);e.fillStyle=s;let l=r-c.left,u=i-c.top,d=a-r+c.width,f=o-i+c.height;Object.values(n).some(e=>e!==0)?(e.beginPath(),$o(e,{x:l,y:u,w:d,h:f,radius:n}),e.fill()):e.fillRect(l,u,d,f)}}function ep(e,t){let{ctx:n,options:{pointLabels:r}}=e;for(let i=t-1;i>=0;i--){let t=e._pointLabelItems[i];if(!t.visible)continue;let a=r.setContext(e.getPointLabelContext(i));$f(n,a,t);let o=$(a.font),{x:s,y:c,textAlign:l}=t;Qo(n,e._pointLabels[i],s,c+o.lineHeight/2,o,{color:a.color,textAlign:l,textBaseline:`middle`})}}function tp(e,t,n,r){let{ctx:i}=e;if(n)i.arc(e.xCenter,e.yCenter,t,0,Ta);else{let n=e.getPointPosition(0,t);i.moveTo(n.x,n.y);for(let a=1;a<r;a++)n=e.getPointPosition(a,t),i.lineTo(n.x,n.y)}}function np(e,t,n,r,i){let a=e.ctx,o=t.circular,{color:s,lineWidth:c}=t;!o&&!r||!s||!c||n<0||(a.save(),a.strokeStyle=s,a.lineWidth=c,a.setLineDash(i.dash||[]),a.lineDashOffset=i.dashOffset,a.beginPath(),tp(e,n,o,r),a.closePath(),a.stroke(),a.restore())}function rp(e,t,n){return ls(e,{label:n,index:t,type:`pointLabel`})}(class extends Pf{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:jo.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=Q(Hf(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=K(e)&&!isNaN(e)?e:0,this.max=K(t)&&!isNaN(t)?t:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Hf(this.options))}generateTickLabels(e){Pf.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map((e,t)=>{let n=J(this.options.pointLabels.callback,[e,t],this);return n||n===0?n:``}).filter((e,t)=>this.chart.getDataVisibility(t))}fit(){let e=this.options;e.display&&e.pointLabels.display?Gf(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=Ta/(this._pointLabels.length||1),n=this.options.startAngle||0;return qa(e*t+Va(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 rp(this.getContext(),e,n)}}getPointPosition(e,t,n=0){let r=this.getIndexAngle(e)-ka+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:i}=this._pointLabelItems[e];return{left:t,top:n,right:r,bottom:i}}drawBackground(){let{backgroundColor:e,grid:{circular:t}}=this.options;if(e){let n=this.ctx;n.save(),n.beginPath(),tp(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:i}=t,a=this._pointLabels.length,o,s,c;if(t.pointLabels.display&&ep(this,a),r.display&&this.ticks.forEach((e,t)=>{if(t!==0||t===0&&this.min<0){s=this.getDistanceFromCenterForValue(e.value);let n=this.getContext(t),o=r.setContext(n),c=i.setContext(n);np(this,o,s,a,c)}}),n.display){for(e.save(),o=a-1;o>=0;o--){let r=n.setContext(this.getPointLabelContext(o)),{color:i,lineWidth:a}=r;!a||!i||(e.lineWidth=a,e.strokeStyle=i,e.setLineDash(r.borderDash),e.lineDashOffset=r.borderDashOffset,s=this.getDistanceFromCenterForValue(t.reverse?this.min:this.max),c=this.getPointPosition(o,s),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),i,a;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(r),e.textAlign=`center`,e.textBaseline=`middle`,this.ticks.forEach((r,o)=>{if(o===0&&this.min>=0&&!t.reverse)return;let s=n.setContext(this.getContext(o)),c=$(s.font);if(i=this.getDistanceFromCenterForValue(this.ticks[o].value),s.showLabelBackdrop){e.font=c.string,a=e.measureText(r.label).width,e.fillStyle=s.backdropColor;let t=Q(s.backdropPadding);e.fillRect(-a/2-t.left,-i-c.size/2-t.top,a+t.width,c.size+t.height)}Qo(e,r.label,0,-i,c,{color:s.color,strokeColor:s.textStrokeColor,strokeWidth:s.textStrokeWidth})}),e.restore()}drawTitle(){}});var ip={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}},ap=Object.keys(ip);function op(e,t){return e-t}function sp(e,t){if(U(t))return null;let n=e._adapter,{parser:r,round:i,isoWeekday:a}=e._parseOpts,o=t;return typeof r==`function`&&(o=r(o)),K(o)||(o=typeof r==`string`?n.parse(o,r):n.parse(o)),o===null?null:(i&&(o=i===`week`&&(Ra(a)||a===!0)?n.startOf(o,`isoWeek`,a):n.startOf(o,i)),+o)}function cp(e,t,n,r){let i=ap.length;for(let a=ap.indexOf(e);a<i-1;++a){let e=ip[ap[a]],i=e.steps?e.steps:2**53-1;if(e.common&&Math.ceil((n-t)/(i*e.size))<=r)return ap[a]}return ap[i-1]}function lp(e,t,n,r,i){for(let a=ap.length-1;a>=ap.indexOf(n);a--){let n=ap[a];if(ip[n].common&&e._adapter.diff(i,r,n)>=t-1)return n}return ap[n?ap.indexOf(n):0]}function up(e){for(let t=ap.indexOf(e)+1,n=ap.length;t<n;++t)if(ip[ap[t]].common)return ap[t]}function dp(e,t,n){if(!n)e[t]=!0;else if(n.length){let{lo:r,hi:i}=Qa(n,t),a=n[r]>=t?n[r]:n[i];e[a]=!0}}function fp(e,t,n,r){let i=e._adapter,a=+i.startOf(t[0].value,r),o=t[t.length-1].value,s,c;for(s=a;s<=o;s=+i.add(s,1,r))c=n[s],c>=0&&(t[c].major=!0);return t}function pp(e,t,n){let r=[],i={},a=t.length,o,s;for(o=0;o<a;++o)s=t[o],i[s]=o,r.push({value:s,major:!1});return a===0||!n?r:fp(e,r,i,n)}var mp=class extends hu{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(e){super(e),this._cache={data:[],labels:[],all:[]},this._unit=`day`,this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(e,t={}){let n=e.time||={},r=this._adapter=new $c._date(e.adapters.date);r.init(t),ma(n.displayFormats,r.formats()),this._parseOpts={parser:n.parser,round:n.round,isoWeekday:n.isoWeekday},super.init(e),this._normalized=t.normalized}parse(e,t){return e===void 0?null:sp(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){let e=this.options,t=this._adapter,n=e.time.unit||`day`,{min:r,max:i,minDefined:a,maxDefined:o}=this.getUserBounds();function s(e){!a&&!isNaN(e.min)&&(r=Math.min(r,e.min)),!o&&!isNaN(e.max)&&(i=Math.max(i,e.max))}(!a||!o)&&(s(this._getLabelBounds()),(e.bounds!==`ticks`||e.ticks.source!==`labels`)&&s(this.getMinMax(!1))),r=K(r)&&!isNaN(r)?r:+t.startOf(Date.now(),n),i=K(i)&&!isNaN(i)?i:+t.endOf(Date.now(),n)+1,this.min=Math.min(r,i-1),this.max=Math.max(r+1,i)}_getLabelBounds(){let e=this.getLabelTimestamps(),t=1/0,n=-1/0;return e.length&&(t=e[0],n=e[e.length-1]),{min:t,max:n}}buildTicks(){let e=this.options,t=e.time,n=e.ticks,r=n.source===`labels`?this.getLabelTimestamps():this._generate();e.bounds===`ticks`&&r.length&&(this.min=this._userMin||r[0],this.max=this._userMax||r[r.length-1]);let i=this.min,a=this.max,o=to(r,i,a);return this._unit=t.unit||(n.autoSkip?cp(t.minUnit,this.min,this.max,this._getLabelCapacity(i)):lp(this,o.length,t.minUnit,this.min,this.max)),this._majorUnit=!n.major.enabled||this._unit===`year`?void 0:up(this._unit),this.initOffsets(r),e.reverse&&o.reverse(),pp(this,o,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+e.value))}initOffsets(e=[]){let t=0,n=0,r,i;this.options.offset&&e.length&&(r=this.getDecimalForValue(e[0]),t=e.length===1?1-r:(this.getDecimalForValue(e[1])-r)/2,i=this.getDecimalForValue(e[e.length-1]),n=e.length===1?i:(i-this.getDecimalForValue(e[e.length-2]))/2);let a=e.length<3?.5:.25;t=Ya(t,0,a),n=Ya(n,0,a),this._offsets={start:t,end:n,factor:1/(t+1+n)}}_generate(){let e=this._adapter,t=this.min,n=this.max,r=this.options,i=r.time,a=i.unit||cp(i.minUnit,t,n,this._getLabelCapacity(t)),o=q(r.ticks.stepSize,1),s=a===`week`?i.isoWeekday:!1,c=Ra(s)||s===!0,l={},u=t,d,f;if(c&&(u=+e.startOf(u,`isoWeek`,s)),u=+e.startOf(u,c?`day`:a),e.diff(n,t,a)>1e5*o)throw Error(t+` and `+n+` are too far apart with stepSize of `+o+` `+a);let p=r.ticks.source===`data`&&this.getDataTimestamps();for(d=u,f=0;d<n;d=+e.add(d,o,a),f++)dp(l,d,p);return(d===n||r.bounds===`ticks`||f===1)&&dp(l,d,p),Object.keys(l).sort(op).map(e=>+e)}getLabelForValue(e){let t=this._adapter,n=this.options.time;return n.tooltipFormat?t.format(e,n.tooltipFormat):t.format(e,n.displayFormats.datetime)}format(e,t){let n=this.options.time.displayFormats,r=this._unit,i=t||n[r];return this._adapter.format(e,i)}_tickFormatFunction(e,t,n,r){let i=this.options,a=i.ticks.callback;if(a)return J(a,[e,t,n],this);let o=i.time.displayFormats,s=this._unit,c=this._majorUnit,l=s&&o[s],u=c&&o[c],d=n[t],f=c&&u&&d&&d.major;return this._adapter.format(e,r||(f?u:l))}generateTickLabels(e){let t,n,r;for(t=0,n=e.length;t<n;++t)r=e[t],r.label=this._tickFormatFunction(r.value,t,e)}getDecimalForValue(e){return e===null?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){let t=this._offsets,n=this.getDecimalForValue(e);return this.getPixelForDecimal((t.start+n)*t.factor)}getValueForPixel(e){let t=this._offsets,n=this.getDecimalForPixel(e)/t.factor-t.end;return this.min+n*(this.max-this.min)}_getLabelSize(e){let t=this.options.ticks,n=this.ctx.measureText(e).width,r=Va(this.isHorizontal()?t.maxRotation:t.minRotation),i=Math.cos(r),a=Math.sin(r),o=this._resolveTickFontOptions(0).size;return{w:n*i+o*a,h:n*a+o*i}}_getLabelCapacity(e){let t=this.options.time,n=t.displayFormats,r=n[t.unit]||n.millisecond,i=this._tickFormatFunction(e,0,pp(this,[e],this._majorUnit),r),a=this._getLabelSize(i),o=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return o>0?o:1}getDataTimestamps(){let e=this._cache.data||[],t,n;if(e.length)return e;let r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(t=0,n=r.length;t<n;++t)e=e.concat(r[t].controller.getAllParsedValues(this));return this._cache.data=this.normalize(e)}getLabelTimestamps(){let e=this._cache.labels||[],t,n;if(e.length)return e;let r=this.getLabels();for(t=0,n=r.length;t<n;++t)e.push(sp(this,r[t]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return ao(e.sort(op))}};function hp(e,t,n){let r=0,i=e.length-1,a,o,s,c;n?(t>=e[r].pos&&t<=e[i].pos&&({lo:r,hi:i}=$a(e,`pos`,t)),{pos:a,time:s}=e[r],{pos:o,time:c}=e[i]):(t>=e[r].time&&t<=e[i].time&&({lo:r,hi:i}=$a(e,`time`,t)),{time:a,pos:s}=e[r],{time:o,pos:c}=e[i]);let l=o-a;return l?s+(c-s)*(t-a)/l:s}(class extends mp{static id=`timeseries`;static defaults=mp.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=hp(t,this.min),this._tableRange=hp(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){let{min:t,max:n}=this,r=[],i=[],a,o,s,c,l;for(a=0,o=e.length;a<o;++a)c=e[a],c>=t&&c<=n&&r.push(c);if(r.length<2)return[{time:t,pos:0},{time:n,pos:1}];for(a=0,o=r.length;a<o;++a)l=r[a+1],s=r[a-1],c=r[a],Math.round((l+s)/2)!==c&&i.push({time:c,pos:a/(o-1)});return i}_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((e,t)=>e-t)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;let t=this.getDataTimestamps(),n=this.getLabelTimestamps();return e=t.length&&n.length?this.normalize(t.concat(n)):t.length?t:n,e=this._cache.all=e,e}getDecimalForValue(e){return(hp(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){let t=this._offsets,n=this.getDecimalForPixel(e)/t.factor-t.end;return hp(this._table,n*this._tableRange+this._minPos,!0)}});var gp={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:`label`},updateMode:{type:String,default:void 0}},_p={ariaLabel:{type:String},ariaDescribedby:{type:String}},vp={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...gp,..._p},yp=(e,t)=>Object.assign(e,t);function bp(e){return c(e)?r(e):e}function xp(e){return c(arguments.length>1&&arguments[1]!==void 0?arguments[1]:e)?new Proxy(e,{}):e}function Sp(e,t){let n=e.options;n&&t&&Object.assign(n,t)}function Cp(e,t){e.labels=t}function wp(e,t,n){let r=[];e.datasets=t.map(t=>{let i=e.datasets.find(e=>e[n]===t[n]);return!i||!t.data||r.includes(i)?{...t}:(r.push(i),Object.assign(i,t),i)})}function Tp(e,t){let n={labels:[],datasets:[]};return Cp(n,e.labels),wp(n,e.datasets,t),n}var Ep=M({props:vp,setup(e,t){let{expose:n,slots:i}=t,a=R(null),o=h(null);n({chart:o});let c=()=>{if(!a.value)return;let{type:t,data:n,options:r,plugins:i,datasetIdKey:s}=e,c=xp(Tp(n,s),n);o.value=new rd(a.value,{type:t,data:c,options:{...r},plugins:i})},l=()=>{let t=r(o.value);t&&(e.destroyDelay>0?setTimeout(()=>{t.destroy(),o.value=null},e.destroyDelay):(t.destroy(),o.value=null))},u=t=>{t.update(e.updateMode)};return D(c),x(l),s([()=>e.options,()=>e.data],(t,n)=>{let[i,a]=t,[s,c]=n,l=r(o.value);if(!l)return;let d=!1;if(i){let e=bp(i),t=bp(s);e&&e!==t&&(Sp(l,e),d=!0)}if(a){let t=bp(a.labels),n=bp(c.labels),r=bp(a.datasets),i=bp(c.datasets);t!==n&&(Cp(l.config.data,t),d=!0),r&&r!==i&&(wp(l.config.data,r,e.datasetIdKey),d=!0)}d&&re(()=>{u(l)})},{deep:!0}),()=>ne(`canvas`,{role:`img`,"aria-label":e.ariaLabel,"aria-describedby":e.ariaDescribedby,ref:a},[ne(`p`,{},[i.default?i.default():``])])}});function Dp(e,t){return rd.register(t),M({props:gp,setup(t,n){let{expose:r}=n,i=h(null),a=e=>{i.value=e?.chart};return r({chart:i}),()=>ne(Ep,yp({ref:a},{type:e,...t}))}})}var Op=Dp(`line`,Zc),kp=1e3,Ap=86400,jp=Ap*kp,Mp=4,Np=60,Pp=10,Fp={"1h":3600,"5h":18e3,"6h":21600,"24h":86400,"7d":604800,"30d":2592e3,window:18e3,weekly:604800,monthly:2592e3};function Ip(e){return Math.max(Np,Math.round(e/Pp))}var Lp=Ap,Rp=5,zp=new Set([`7d`,`30d`,`weekly`,`monthly`]);function Bp(e){return e*kp}function Vp(e,t,n){return t!=null&&n!=null?n-t>Mp*jp?`day`:`time`:zp.has(e)?`day`:`time`}function Hp(e,t){return t===`day`?le(e):Ee(e)}function Up(e,t,n){let r=Fp[t]??Lp,i=Bp(Ip(n?(fe(n.endTime).getTime()-fe(n.startTime).getTime())/kp:r)),a,o;if(n)a=Math.floor(fe(n.startTime).getTime()/i)*i,o=Math.ceil(fe(n.endTime).getTime()/i)*i;else{let e=Fp[t]??Lp,n=Math.floor(new Date().getTime()/i)*i;a=n-e*kp,o=n}let s=Math.round((o-a)/i),c=Vp(t,a,o),l=new Map;for(let t of e){let e=fe(t.time_bucket),n=Math.floor(e.getTime()/i);l.set(n,t)}let u=[],d=[];for(let e=0;e<=s;e++){let t=a+e*i;u.push(Hp(new Date(t),c));let n=l.get(Math.floor(t/i));d.push(n&&n.avg_value!=null?n.avg_value:0)}return{labels:u,values:d}}function Wp(e){let t=new Set;if(e<=Rp){for(let n=0;n<e;n++)t.add(n);return t}for(let n=0;n<Rp;n++)t.add(Math.round(n*(e-1)/(Rp-1)));return t}function Gp(e){return function(t){let n=typeof t==`number`?t:parseInt(t,10);return e.has(n)?this.getLabelForValue(n):``}}function Kp(){return document.documentElement.classList.contains(`dark`)}function qp(){let e=Kp();return{gridColor:e?`oklch(1 0 0 / 10%)`:`oklch(0.922 0 0)`,tickColor:e?`oklch(0.708 0 0)`:`oklch(0.556 0 0)`}}function Jp(e){let t=Wp(e.length),n=qp();return{responsive:!0,maintainAspectRatio:!1,interaction:{mode:`index`,intersect:!1},plugins:{legend:{position:`top`,align:`start`,labels:{color:n.tickColor,usePointStyle:!0,pointStyle:`circle`,boxWidth:8,boxHeight:8,padding:16}}},scales:{x:{stacked:!0,grid:{display:!1},ticks:{maxRotation:0,autoSkip:!1,callback:Gp(t),color:n.tickColor}},y:{stacked:!0,beginAtZero:!0,grid:{color:n.gridColor},ticks:{color:n.tickColor}}}}}function Yp(e){let t=Wp(e.length),n=qp();return{responsive:!0,maintainAspectRatio:!1,interaction:{mode:`index`,intersect:!1},plugins:{legend:{display:!1},tooltip:{enabled:!0}},scales:{x:{display:!0,grid:{display:!1},ticks:{maxRotation:0,autoSkip:!1,callback:Gp(t),color:n.tickColor}},y:{display:!1,beginAtZero:!0}}}}var Xp=1e9,Zp=1e6,Qp=1e3,$p=10,em=10;function tm(e){if(e===0)return`0`;let t=Math.abs(e),n=e<0?`-`:``;return t>=Xp?n+nm(t/Xp)+`B`:t>=Zp?n+nm(t/Zp)+`M`:t>=Qp?n+nm(t/Qp)+`K`:n+Math.round(t).toString()}function nm(e){if(e<$p){let t=Math.round(e*em)/em;return Number.isInteger(t)?t.toString():t.toFixed(1)}return Math.round(e).toString()}function rm(e){return e===0?``:tm(e)}function im({selectedProvider:e,providers:n,t:r}){let i=R(`all`),a=R(`all`),o=R(`all`),s=R([]),c=l(()=>{let e=new Set;for(let t of n.value)if(t.is_active)for(let n of t.models)e.add(n.name);return[...e].sort()}),u=l(()=>{if(e.value){let t=n.value.find(t=>t.id===e.value);if(t){let e=new Set(t.models.map(e=>e.name));return c.value.filter(t=>e.has(t))}}return c.value}),d=l(()=>{let t={};return e.value&&(t.provider_id=e.value),i.value!==`all`&&(t.backend_model=i.value),a.value!==`all`&&(t.router_key_id=a.value),o.value!==`all`&&(t.client_type=o.value),t});function f(e){s.value=e}async function p(){try{s.value=(await t.getRouterKeys()).map(e=>({id:e.id,name:e.name}))}catch(e){console.error(`useDashboardFilters.loadFilterOptions:`,e),_e.error(te(e,r(`dashboard.loadFilterFailed`)))}}return{modelFilter:i,keyFilter:a,clientType:o,keyOptions:s,modelOptions:u,filterParams:d,initWithData:f,loadFilterOptions:p}}var am={teal:`oklch(0.58 0.14 175)`,tealFill:`oklch(0.58 0.14 175 / 0.3)`,tealFillLight:`oklch(0.58 0.14 175 / 0.1)`,indigo:`oklch(0.65 0.14 260)`,indigoFill:`oklch(0.65 0.14 260 / 0.3)`,green:`oklch(0.65 0.17 150)`,greenFill:`oklch(0.65 0.17 150 / 0.3)`,amber:`oklch(0.78 0.16 80)`,amberFill:`oklch(0.78 0.16 80 / 0.1)`},om=5e3;function sm({selectedProvider:e,filterParams:n,timeSelection:r,watchKey:i,t:a}){let o=R({totalRequests:0,successRate:0,avgTps:0,totalInputTokens:0,totalOutputTokens:0,startTime:null,endTime:null}),s=R(null),c=R(0),u=R({}),d=R(null),f=R(null),p=R(null),m=R(null),h=R({}),g=R(!1);function _(e,t,n){return{labels:e.labels,datasets:[{label:t,data:e.values,borderColor:n,backgroundColor:n.replace(`)`,` / 0.1)`),fill:!1,tension:.4,pointRadius:0}]}}function v(e,t,n,r){return{labels:e.labels,datasets:[{label:n,data:e.values,borderColor:am.teal,backgroundColor:am.tealFill,fill:`origin`,tension:.4,pointRadius:0},{label:r,data:t.values,borderColor:am.green,backgroundColor:am.greenFill,fill:`origin`,tension:.4,pointRadius:0}]}}let y=R(!1),b=``,x=0;function S(e){e.stats&&(o.value={totalRequests:e.stats.totalRequests,successRate:e.stats.successRate,avgTps:e.stats.avgTps,totalInputTokens:e.stats.totalInputTokens,totalOutputTokens:e.stats.totalOutputTokens,startTime:e.stats.startTime,endTime:e.stats.endTime}),s.value=e.prev_stats,c.value=e.cache_hit_rate??0,u.value=e.client_type_breakdown??{},h.value=e.provider_token_summary??{};let t=r.value,n=o.value.startTime&&o.value.endTime?{startTime:o.value.startTime,endTime:o.value.endTime}:{startTime:t.startTime,endTime:t.endTime},l=`window`,g=e.timeseries?.tps??[],y=e.timeseries?.input_tokens??[],S=e.timeseries?.output_tokens??[];g.length>0?d.value=_(Up(g,l,n),a(`dashboard.charts.tokenOutputSpeed`),am.indigo):d.value=null,y.length>0?f.value=_(Up(y,l,n),a(`dashboard.charts.inputLegend`),am.teal):f.value=null,S.length>0?p.value=_(Up(S,l,n),a(`dashboard.charts.outputLegend`),am.green):p.value=null,y.length>0&&S.length>0?m.value=v(Up(y,l,n),Up(S,l,n),a(`dashboard.charts.inputLegend`),a(`dashboard.charts.outputLegend`)):m.value=null,b=i.value,x=Date.now()}async function C(){if(!e.value)return;let l=i.value;if(!(l===b&&Date.now()-x<om)){g.value=!o.value.totalRequests&&!o.value.totalInputTokens;try{let e=r.value,i=n.value,l={start_time:e.startTime,end_time:e.endTime};i.provider_id&&(l.provider_id=i.provider_id),i.router_key_id&&(l.router_key_id=i.router_key_id),i.backend_model&&(l.backend_model=i.backend_model),i.client_type&&(l.client_type=i.client_type);let g=await t.getDashboardOverview(l);o.value={totalRequests:g.stats.totalRequests,successRate:g.stats.successRate,avgTps:g.stats.avgTps,totalInputTokens:g.stats.totalInputTokens,totalOutputTokens:g.stats.totalOutputTokens,startTime:g.stats.startTime,endTime:g.stats.endTime},s.value=g.prev_stats,c.value=g.cache_hit_rate,u.value=g.client_type_breakdown,h.value=g.provider_token_summary;let y=o.value.startTime&&o.value.endTime?{startTime:o.value.startTime,endTime:o.value.endTime}:{startTime:e.startTime,endTime:e.endTime},b=`window`,x=g.timeseries.tps,S=g.timeseries.input_tokens,C=g.timeseries.output_tokens;x.length>0?d.value=_(Up(x,b,y),a(`dashboard.charts.tokenOutputSpeed`),am.indigo):d.value=null,S.length>0?f.value=_(Up(S,b,y),a(`dashboard.charts.inputLegend`),am.teal):f.value=null,C.length>0?p.value=_(Up(C,b,y),a(`dashboard.charts.outputLegend`),am.green):p.value=null,S.length>0&&C.length>0?m.value=v(Up(S,b,y),Up(C,b,y),a(`dashboard.charts.inputLegend`),a(`dashboard.charts.outputLegend`)):m.value=null}catch(e){console.error(`useDashboardData.refresh:`,e),_e.error(te(e,a(`dashboard.loadDashboardFailed`)))}finally{g.value=!1,b=l,x=Date.now()}}}return{stats:o,prevStats:s,cacheHitRate:c,clientTypeBreakdown:u,providerTokenSummary:h,tpsChartData:d,inputTokensChartData:f,outputTokensChartData:p,tokenThroughputChartData:m,loading:g,loadError:y,initWithData:S,refresh:C,timeRangeText:l(()=>{let e=o.value.startTime,t=o.value.endTime;if(!e||!t)return`—`;try{return`${ce(e)} ~ ${ce(t)}`}catch{return`—`}})}}var cm=24,lm=36e5,um=cm*lm,dm=30,fm=2,pm=90,mm=5,hm=7,gm=30,_m=24,vm=1,ym={"5h":mm*lm,"24h":_m*lm,"7d":hm*um,"30d":gm*um},bm={"5h":0,"24h":vm,"7d":hm,"30d":gm},xm=lm,Sm=pm*um;function Cm(e){return e.toString().padStart(fm,`0`)}function wm(e,t){let n=new Intl.DateTimeFormat(void 0,{month:`short`}),r=n.format(e),i=n.format(t);return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()?`${r} ${e.getDate()} ${Cm(e.getHours())}:${Cm(e.getMinutes())} ~ ${Cm(t.getHours())}:${Cm(t.getMinutes())}`:`${r} ${e.getDate()} ${Cm(e.getHours())}:${Cm(e.getMinutes())} ~ ${i} ${t.getDate()} ${Cm(t.getHours())}:${Cm(t.getMinutes())}`}function Tm(e){let{t}=m(),n=R(`7d`),r=R(!1),i=R(new Date),a=R(new Date),o=R(``),s=R(null),c=l(()=>new Date(new Date().getTime()-dm*um)),u=l(()=>{let e=new Date;if(n.value===`custom`&&s.value)return{startTime:s.value.start,endTime:s.value.end,source:`custom`};if(n.value&&n.value!==`custom`){let t=n.value;return{startTime:new Date(e.getTime()-ym[t]),endTime:e,source:t}}return{startTime:new Date(e.getTime()-ym[`7d`]),endTime:e,source:`7d`}}),d=l(()=>{let e=u.value;return wm(e.startTime,e.endTime)});function f(e){n.value=e,r.value=!1,o.value=``}function p(){if(r.value=!r.value,r.value){let e=u.value;i.value=new Date(e.startTime),a.value=new Date(e.endTime),n.value=`custom`,o.value=``}else n.value===`custom`&&(n.value=`7d`)}function h(){o.value=``;let e=i.value,l=a.value;if(!(e instanceof Date)||!(l instanceof Date)){o.value=t(`dashboard.timeSelector.customError.format`);return}if(Number.isNaN(e.getTime())||Number.isNaN(l.getTime())){o.value=t(`dashboard.timeSelector.customError.format`);return}if(e.getTime()>=l.getTime()){o.value=t(`dashboard.timeSelector.customError.order`);return}let u=l.getTime()-e.getTime();if(u<xm){o.value=t(`dashboard.timeSelector.customError.tooShort`);return}if(u>Sm){o.value=t(`dashboard.timeSelector.customError.tooLong`);return}let d=Date.now();if(l.getTime()>d){o.value=t(`dashboard.timeSelector.customError.future`);return}if(e.getTime()<c.value.getTime()){o.value=t(`dashboard.timeSelector.customError.tooOld`);return}s.value={start:new Date(e),end:new Date(l)},n.value=`custom`,r.value=!1}return{activeRange:n,showCustom:r,customError:o,quickRangeDays:bm,totalRangeDays:dm,timeSelection:u,timeRangeLabel:d,selectQuickRange:f,toggleCustom:p,applyCustom:h,customStartDate:i,customEndDate:a}}var Em=300,Dm=100;function Om(){let{t:e}=m(),n=R([]),r=R(``),i=R(!1),a=im({selectedProvider:r,providers:n,t:e}),o=Tm({selectedProvider:r}),c=l(()=>{let e=new Map,t=h.providerTokenSummary.value;for(let[n,r]of Object.entries(t))e.set(n,rm(r));return e}),u=l(()=>{let e=h.providerTokenSummary.value;return[...n.value].sort((t,n)=>{let r=e[t.id]??0;return(e[n.id]??0)-r})}),d=l(()=>{let e=o.timeSelection.value;return{startTime:e.startTime.toISOString(),endTime:e.endTime.toISOString()}}),f=l(()=>{let e=o.timeSelection.value;return`${ce(e.startTime.toISOString())} ~ ${ce(e.endTime.toISOString())}`}),p=l(()=>JSON.stringify({selectedProvider:r.value,timeSelection:o.timeSelection.value,modelFilter:a.modelFilter.value,keyFilter:a.keyFilter.value,clientType:a.clientType.value})),h=sm({selectedProvider:r,filterParams:a.filterParams,timeSelection:d,watchKey:p,t:e}),g=l(()=>{let e=h.prevStats.value,t=h.stats.value;if(!e)return null;function n(e,t){if(t===0)return e>0?`+100.0`:`0.0`;let n=(e-t)/t*Dm,r=Math.abs(n).toFixed(1);return n>0?`+${r}`:r}return{totalRequests:n(t.totalRequests,e.totalRequests),successRate:n(t.successRate,e.successRate),avgTps:n(t.avgTps,e.avgTps),totalInputTokens:n(t.totalInputTokens,e.totalInputTokens),totalOutputTokens:n(t.totalOutputTokens,e.totalOutputTokens)}});function _(){let e=o.timeSelection.value,t=a.filterParams.value,n={start_time:e.startTime.toISOString(),end_time:e.endTime.toISOString()};return t.provider_id&&(n.provider_id=t.provider_id),t.router_key_id&&(n.router_key_id=t.router_key_id),t.backend_model&&(n.backend_model=t.backend_model),t.client_type&&(n.client_type=t.client_type),n}function v(e){e.providers&&(n.value=e.providers),e.router_keys&&a.initWithData(e.router_keys),h.initWithData(e),i.value=!1,h.loadError.value=!1}function y(){!r.value&&n.value.length>0&&(r.value=u.value[0].id)}let b=R(!1),S=!1;s(r,()=>{a.modelFilter.value!==`all`&&!a.modelOptions.value.includes(a.modelFilter.value)&&(a.modelFilter.value=`all`)}),s([r,o.timeSelection],async()=>{b.value&&(S=!0,await h.refresh())});let C=null;s([a.modelFilter,a.keyFilter,a.clientType],()=>{if(b.value){if(S){S=!1;return}C&&clearTimeout(C),C=setTimeout(async()=>{await h.refresh()},Em)}});let w=null;async function T(){try{let e=_();v(await t.getDashboardInit(e))}catch(t){console.error(`useDashboard.retry:`,t),i.value=!0,h.loadError.value=!0,_e.error(te(t,e(`dashboard.loadProvidersFailed`)));return}y()}return D(async()=>{try{let e=_();v(await t.getDashboardInit(e))}catch(t){console.error(`useDashboard.onMounted:`,t),i.value=!0,h.loadError.value=!0,_e.error(te(t,e(`dashboard.loadProvidersFailed`)));return}y(),b.value=!0,w=xe(()=>h.refresh())}),x(()=>{w&&w(),C&&clearTimeout(C)}),{providers:n,selectedProvider:r,sortedProviders:u,providerTokenLabels:c,activeRange:o.activeRange,timeSelection:o.timeSelection,timeRangeLabel:o.timeRangeLabel,showCustom:o.showCustom,customError:o.customError,totalRangeDays:o.totalRangeDays,selectQuickRange:o.selectQuickRange,toggleCustom:o.toggleCustom,applyCustom:o.applyCustom,customStartDate:o.customStartDate,customEndDate:o.customEndDate,windowTimeRange:f,modelFilter:a.modelFilter,keyFilter:a.keyFilter,clientType:a.clientType,modelOptions:a.modelOptions,keyOptions:a.keyOptions,stats:h.stats,loading:h.loading,loadError:h.loadError,cacheHitRate:h.cacheHitRate,clientTypeBreakdown:h.clientTypeBreakdown,tpsChartData:h.tpsChartData,inputTokensChartData:h.inputTokensChartData,outputTokensChartData:h.outputTokensChartData,tokenThroughputChartData:h.tokenThroughputChartData,timeRangeText:h.timeRangeText,deltaValues:g,retry:T}}var km=[`data-size`],Am=[`data-size`],jm=M({inheritAttrs:!1,__name:`NativeSelect`,props:{modelValue:{},class:{type:[Boolean,null,String,Object,Array]},size:{}},emits:[`update:modelValue`],setup(t,{emit:r}){let i=t,s=ee(i,`modelValue`,r,{passive:!0,defaultValue:``}),c=f(i,`class`,`size`);return(t,r)=>(I(),j(`div`,{class:`group/native-select relative w-fit has-[select:disabled]:opacity-50`,"data-slot":`native-select-wrapper`,"data-size":i.size??`default`},[o(e(`select`,N({...t.$attrs,...P(c)},{"onUpdate:modelValue":r[0]||=e=>n(s)?s.value=e:null,"data-slot":`native-select`,"data-size":i.size??`default`,class:P(F)(`border-input placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 dark:hover:bg-input/50 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 h-8 w-full min-w-0 appearance-none rounded-lg border bg-transparent py-1 pr-8 pl-2.5 text-sm transition-colors select-none focus-visible:ring-3 aria-invalid:ring-3 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] data-[size=sm]:py-0.5 outline-none disabled:pointer-events-none disabled:cursor-not-allowed`,i.class)}),[L(t.$slots,`default`)],16,Am),[[a,P(s)]]),S(P(Te),{class:`text-muted-foreground top-1/2 right-2.5 size-4 -translate-y-1/2 pointer-events-none absolute select-none`,"aria-hidden":`true`,"data-slot":`native-select-icon`})],8,km))}}),Mm=M({__name:`NativeSelectOption`,props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e;return(e,n)=>(I(),j(`option`,{"data-slot":`native-select-option`,class:b(P(F)(`bg-[Canvas] text-[CanvasText]`,t.class))},[L(e.$slots,`default`)],2))}}),Nm={class:`**:data-[slot=native-select-icon]:right-1`},Pm={class:`relative`},Fm={class:`absolute inset-0 flex h-full items-center text-sm pl-2 pointer-events-none`},Im={class:`**:data-[slot=native-select-icon]:right-1`},Lm={class:`relative`},Rm={class:`absolute inset-0 flex h-full items-center text-sm pl-2 pointer-events-none`},zm={class:`flex items-center gap-1 absolute top-0 inset-x-0 justify-between`},Bm={key:0,class:`flex items-center justify-center gap-1`},Vm={key:1,class:`flex items-center justify-center gap-1`},Hm={key:2,class:`flex items-center justify-center gap-1`},Um={class:`flex flex-col gap-y-4 mt-4 sm:flex-row sm:gap-x-4 sm:gap-y-0`},Wm=-100,Gm=10,Km=M({__name:`Calendar`,props:{defaultValue:{},defaultPlaceholder:{},placeholder:{},pagedNavigation:{type:Boolean},preventDeselect:{type:Boolean},weekStartsOn:{},weekdayFormat:{},calendarLabel:{},fixedWeeks:{type:Boolean},maxValue:{},minValue:{},locale:{},numberOfMonths:{},disabled:{type:Boolean},readonly:{type:Boolean},initialFocus:{type:Boolean},isDateDisabled:{},isDateUnavailable:{},dir:{},nextPage:{},prevPage:{},modelValue:{default:void 0},multiple:{type:Boolean},disableDaysOutsideCurrentView:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]},layout:{default:void 0},yearRange:{}},emits:[`update:modelValue`,`update:placeholder`],setup(t,{emit:i}){let a=t,o=i,s=f(a,`class`,`layout`,`placeholder`),c=ee(a,`placeholder`,o,{passive:!0,defaultValue:a.defaultPlaceholder??Qe(it())}),d=Ur(a.locale??`en`),p=l(()=>a.yearRange??Vr({start:a?.minValue??(r(a.placeholder)??a.defaultPlaceholder??Qe(it())).cycle(`year`,Wm),end:a?.maxValue??(r(a.placeholder)??a.defaultPlaceholder??Qe(it())).cycle(`year`,Gm)})),[m,h]=w(),[g,v]=w(),y=de(s,o);return(r,i)=>(I(),j(_,null,[S(P(m),null,{default:A(({date:t})=>[e(`div`,Nm,[e(`div`,Pm,[e(`div`,Fm,u(P(d).custom(P(H)(t),{month:`short`})),1),S(P(jm),{class:`text-xs h-8 pr-6 pl-2 text-transparent relative`,onChange:i[0]||=e=>{c.value=P(c).set({month:Number(e.target.value)})}},{default:A(()=>[(I(!0),j(_,null,C(P(zr)({dateObj:t}),e=>(I(),E(P(Mm),{key:e.toString(),value:e.month,selected:t.month===e.month},{default:A(()=>[k(u(P(d).custom(P(H)(e),{month:`short`})),1)]),_:2},1032,[`value`,`selected`]))),128))]),_:2},1024)])])]),_:1}),S(P(g),null,{default:A(({date:t})=>[e(`div`,Im,[e(`div`,Lm,[e(`div`,Rm,u(P(d).custom(P(H)(t),{year:`numeric`})),1),S(P(jm),{class:`text-xs h-8 pr-6 pl-2 text-transparent relative`,onChange:i[1]||=e=>{c.value=P(c).set({year:Number(e.target.value)})}},{default:A(()=>[(I(!0),j(_,null,C(p.value,e=>(I(),E(P(Mm),{key:e.toString(),value:e.year,selected:t.year===e.year},{default:A(()=>[k(u(P(d).custom(P(H)(e),{year:`numeric`})),1)]),_:2},1032,[`value`,`selected`]))),128))]),_:2},1024)])])]),_:1}),S(P(ni),N(P(y),{placeholder:P(c),"onUpdate:placeholder":i[2]||=e=>n(c)?c.value=e:null,"data-slot":`calendar`,class:P(F)(`p-2 [--cell-radius:var(--radius-md)] [--cell-size:1.75rem] group/calendar bg-background in-data-[slot=card-content]:bg-transparent in-data-[slot=popover-content]:bg-transparent`,a.class)}),{default:A(({grid:n,weekDays:i,date:a})=>[S(P(eh),{class:`pt-0`},{default:A(()=>[e(`nav`,zm,[S(P(rh),null,{default:A(()=>[L(r.$slots,`calendar-prev-icon`)]),_:3}),S(P(nh),null,{default:A(()=>[L(r.$slots,`calendar-next-icon`)]),_:3})]),L(r.$slots,`calendar-heading`,{date:a,month:P(h),year:P(v)},()=>[t.layout===`month-and-year`?(I(),j(`div`,Bm,[S(P(h),{date:a},null,8,[`date`]),S(P(v),{date:a},null,8,[`date`])])):t.layout===`month-only`?(I(),j(`div`,Vm,[S(P(h),{date:a},null,8,[`date`]),k(` `+u(P(d).custom(P(H)(a),{year:`numeric`})),1)])):t.layout===`year-only`?(I(),j(`div`,Hm,[k(u(P(d).custom(P(H)(a),{month:`short`}))+` `,1),S(P(v),{date:a},null,8,[`date`])])):(I(),E(P(th),{key:3}))])]),_:2},1024),e(`div`,Um,[(I(!0),j(_,null,C(n,e=>(I(),E(P(Ym),{key:e.value.toString()},{default:A(()=>[S(P(Zm),null,{default:A(()=>[S(P(Qm),null,{default:A(()=>[(I(!0),j(_,null,C(i,e=>(I(),E(P($m),{key:e},{default:A(()=>[k(u(e),1)]),_:2},1024))),128))]),_:2},1024)]),_:2},1024),S(P(Xm),null,{default:A(()=>[(I(!0),j(_,null,C(e.rows,(t,n)=>(I(),E(P(Qm),{key:`weekDate-${n}`,class:`mt-2 w-full`},{default:A(()=>[(I(!0),j(_,null,C(t,t=>(I(),E(P(qm),{key:t.toString(),date:t},{default:A(()=>[S(P(Jm),{day:t,month:e.value},null,8,[`day`,`month`])]),_:2},1032,[`date`]))),128))]),_:2},1024))),128))]),_:2},1024)]),_:2},1024))),128))])]),_:3},16,[`placeholder`,`class`])],64))}}),qm=M({__name:`CalendarCell`,props:{date:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=me(f(t,`class`));return(e,r)=>(I(),E(P(ri),N({"data-slot":`calendar-cell`,class:P(F)(`relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([data-selected])]:rounded-md [&:has([data-selected])]:bg-accent`,t.class)},P(n)),{default:A(()=>[L(e.$slots,`default`)]),_:3},16,[`class`]))}}),Jm=M({__name:`CalendarCellTrigger`,props:{day:{},month:{},asChild:{type:Boolean},as:{default:`button`},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=me(f(t,`class`));return(e,r)=>(I(),E(P(ii),N({"data-slot":`calendar-cell-trigger`,class:P(F)(P(ae)({variant:`ghost`}),`size-8 p-0 font-normal aria-selected:opacity-100 cursor-default`,`[&[data-today]:not([data-selected])]:bg-accent [&[data-today]:not([data-selected])]:text-accent-foreground`,`data-[selected]:bg-primary data-[selected]:text-primary-foreground data-[selected]:opacity-100 data-[selected]:hover:bg-primary data-[selected]:hover:text-primary-foreground data-[selected]:focus:bg-primary data-[selected]:focus:text-primary-foreground`,`data-[disabled]:text-muted-foreground data-[disabled]:opacity-50`,`data-[unavailable]:text-destructive-foreground data-[unavailable]:line-through`,`data-[outside-view]:text-muted-foreground`,t.class)},P(n)),{default:A(()=>[L(e.$slots,`default`)]),_:3},16,[`class`]))}}),Ym=M({__name:`CalendarGrid`,props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=me(f(t,`class`));return(e,r)=>(I(),E(P(ai),N({"data-slot":`calendar-grid`,class:P(F)(`w-full border-collapse space-x-1`,t.class)},P(n)),{default:A(()=>[L(e.$slots,`default`)]),_:3},16,[`class`]))}}),Xm=M({__name:`CalendarGridBody`,props:{asChild:{type:Boolean},as:{}},setup(e){let t=e;return(e,n)=>(I(),E(P(oi),N({"data-slot":`calendar-grid-body`},t),{default:A(()=>[L(e.$slots,`default`)]),_:3},16))}}),Zm=M({__name:`CalendarGridHead`,props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e;return(e,n)=>(I(),E(P(si),N({"data-slot":`calendar-grid-head`},t),{default:A(()=>[L(e.$slots,`default`)]),_:3},16))}}),Qm=M({__name:`CalendarGridRow`,props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=me(f(t,`class`));return(e,r)=>(I(),E(P(ci),N({"data-slot":`calendar-grid-row`,class:P(F)(`flex`,t.class)},P(n)),{default:A(()=>[L(e.$slots,`default`)]),_:3},16,[`class`]))}}),$m=M({__name:`CalendarHeadCell`,props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=me(f(t,`class`));return(e,r)=>(I(),E(P(li),N({"data-slot":`calendar-head-cell`,class:P(F)(`text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem]`,t.class)},P(n)),{default:A(()=>[L(e.$slots,`default`)]),_:3},16,[`class`]))}}),eh=M({__name:`CalendarHeader`,props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=me(f(t,`class`));return(e,r)=>(I(),E(P(ui),N({"data-slot":`calendar-header`,class:P(F)(`flex justify-center pt-1 relative items-center w-full px-8`,t.class)},P(n)),{default:A(()=>[L(e.$slots,`default`)]),_:3},16,[`class`]))}}),th=M({__name:`CalendarHeading`,props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=me(f(t,`class`));return(e,r)=>(I(),E(P(di),N({"data-slot":`calendar-heading`,class:P(F)(`text-sm font-medium`,t.class)},P(n)),{default:A(({headingValue:t})=>[L(e.$slots,`default`,{headingValue:t},()=>[k(u(t),1)])]),_:3},16,[`class`]))}}),nh=M({__name:`CalendarNextButton`,props:{nextPage:{type:Function},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=me(f(t,`class`));return(e,r)=>(I(),E(P(fi),N({"data-slot":`calendar-next-button`,class:P(F)(P(ae)({variant:`outline`}),`size-7 bg-transparent p-0 opacity-50 hover:opacity-100`,t.class)},P(n)),{default:A(()=>[L(e.$slots,`default`,{},()=>[S(P(z),{class:`cn-rtl-flip size-4`})])]),_:3},16,[`class`]))}}),rh=M({__name:`CalendarPrevButton`,props:{prevPage:{type:Function},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=me(f(t,`class`));return(e,r)=>(I(),E(P(pi),N({"data-slot":`calendar-prev-button`,class:P(F)(P(ae)({variant:`outline`}),`size-7 bg-transparent p-0 opacity-50 hover:opacity-100`,t.class)},P(n)),{default:A(()=>[L(e.$slots,`default`,{},()=>[S(P(Me),{class:`cn-rtl-flip size-4`})])]),_:3},16,[`class`]))}}),ih={class:`bg-card rounded-lg px-4 py-2.5 mb-3`},ah={class:`flex items-center justify-between`},oh={class:`flex items-center gap-3`},sh={class:`font-mono text-xs font-medium text-foreground`},ch={class:`flex gap-0.5`},lh={key:0,class:`mt-2 space-y-1.5`},uh={class:`flex flex-wrap items-center gap-2`},dh={class:`p-2`},fh={class:`flex items-center gap-1.5 px-2 pb-2 pt-1`},ph={class:`p-2`},mh={class:`flex items-center gap-1.5 px-2 pb-2 pt-1`},hh={key:0,class:`text-xs text-danger font-mono`,role:`alert`},gh=2,_h=M({__name:`TimeRangeSelector`,props:{timeRangeLabel:{},activeRange:{},showCustom:{type:Boolean},customStartDate:{},customEndDate:{},customError:{},selectQuickRange:{type:Function},toggleCustom:{type:Function},applyCustom:{type:Function}},emits:[`update:customStartDate`,`update:customEndDate`,`update:showCustom`,`update:activeRange`],setup(t,{emit:n}){let{t:r}=m(),i=n,a=[{value:`5h`,labelKey:`dashboard.timeSelector.quick.5h`},{value:`24h`,labelKey:`dashboard.timeSelector.quick.24h`},{value:`7d`,labelKey:`dashboard.timeSelector.quick.7d`},{value:`30d`,labelKey:`dashboard.timeSelector.quick.30d`}];function o(e){return e.toString().padStart(gh,`0`)}function s(e){return new V(e.getFullYear(),e.getMonth()+1,e.getDate())}function c(e){return`${e.getFullYear()}-${o(e.getMonth()+1)}-${o(e.getDate())} ${o(e.getHours())}:${o(e.getMinutes())}`}function l(e){if(!e)return;let t=Array.isArray(e)?e[0]:e;if(t)return new V(t.year,t.month,t.day)}let d=R(!1),f=R(!1),p=R(),h=R(`00`),g=R(`00`),v=R(),y=R(`00`),b=R(`00`);function x(){let e=t.customStartDate;p.value=s(e),h.value=o(e.getHours()),g.value=o(e.getMinutes())}function w(){let e=t.customEndDate;v.value=s(e),y.value=o(e.getHours()),b.value=o(e.getMinutes())}function T(e){p.value=l(e)}function E(e){v.value=l(e)}function D(){if(p.value){let e=parseInt(h.value,10)||0,t=parseInt(g.value,10)||0;i(`update:customStartDate`,new Date(p.value.year,p.value.month-1,p.value.day,e,t,0,0))}d.value=!1}function ee(){if(v.value){let e=parseInt(y.value,10)||0,t=parseInt(b.value,10)||0;i(`update:customEndDate`,new Date(v.value.year,v.value.month-1,v.value.day,e,t,0,0))}f.value=!1}return(n,i)=>(I(),j(`div`,ih,[e(`div`,ah,[e(`div`,oh,[e(`span`,sh,u(t.timeRangeLabel),1),e(`div`,ch,[(I(),j(_,null,C(a,e=>S(P(ie),{key:e.value,variant:t.activeRange===e.value?`secondary`:`ghost`,size:`sm`,class:`h-7 px-3 text-xs font-mono`,onClick:n=>t.selectQuickRange(e.value)},{default:A(()=>[k(u(P(r)(e.labelKey)),1)]),_:2},1032,[`variant`,`onClick`])),64)),S(P(ie),{variant:t.showCustom?`secondary`:`ghost`,size:`sm`,class:`h-7 px-3 text-xs font-mono`,onClick:t.toggleCustom},{default:A(()=>[k(u(P(r)(`dashboard.timeSelector.custom`)),1)]),_:1},8,[`variant`,`onClick`])])])]),t.showCustom?(I(),j(`div`,lh,[e(`div`,uh,[S(P(se),{class:`text-xs text-muted-foreground`},{default:A(()=>[k(u(P(r)(`dashboard.timeSelector.startDate`)),1)]),_:1}),S(P(De),{open:d.value,"onUpdate:open":[i[2]||=e=>d.value=e,i[3]||=e=>{e&&x()}]},{default:A(()=>[S(P(Oe),{"as-child":``},{default:A(()=>[S(P(ie),{variant:`outline`,size:`sm`,class:`h-7 px-2.5 text-xs font-mono`},{default:A(()=>[k(u(c(t.customStartDate)),1)]),_:1})]),_:1}),S(P(ve),{class:`w-auto p-0`,align:`start`},{default:A(()=>[e(`div`,dh,[S(P(Km),{"model-value":p.value,"onUpdate:modelValue":T},null,8,[`model-value`]),e(`div`,fh,[S(P(je),{modelValue:h.value,"onUpdate:modelValue":i[0]||=e=>h.value=e,class:`h-7 w-12 text-center text-xs font-mono`,placeholder:`HH`},null,8,[`modelValue`]),i[8]||=e(`span`,{class:`text-xs text-muted-foreground`},`:`,-1),S(P(je),{modelValue:g.value,"onUpdate:modelValue":i[1]||=e=>g.value=e,class:`h-7 w-12 text-center text-xs font-mono`,placeholder:`MM`},null,8,[`modelValue`]),S(P(ie),{size:`sm`,class:`h-7 ml-auto`,onClick:D},{default:A(()=>[k(u(P(r)(`common.ok`)),1)]),_:1})])])]),_:1})]),_:1},8,[`open`]),S(P(se),{class:`text-xs text-muted-foreground`},{default:A(()=>[k(u(P(r)(`dashboard.timeSelector.endDate`)),1)]),_:1}),S(P(De),{open:f.value,"onUpdate:open":[i[6]||=e=>f.value=e,i[7]||=e=>{e&&w()}]},{default:A(()=>[S(P(Oe),{"as-child":``},{default:A(()=>[S(P(ie),{variant:`outline`,size:`sm`,class:`h-7 px-2.5 text-xs font-mono`},{default:A(()=>[k(u(c(t.customEndDate)),1)]),_:1})]),_:1}),S(P(ve),{class:`w-auto p-0`,align:`start`},{default:A(()=>[e(`div`,ph,[S(P(Km),{"model-value":v.value,"onUpdate:modelValue":E},null,8,[`model-value`]),e(`div`,mh,[S(P(je),{modelValue:y.value,"onUpdate:modelValue":i[4]||=e=>y.value=e,class:`h-7 w-12 text-center text-xs font-mono`,placeholder:`HH`},null,8,[`modelValue`]),i[9]||=e(`span`,{class:`text-xs text-muted-foreground`},`:`,-1),S(P(je),{modelValue:b.value,"onUpdate:modelValue":i[5]||=e=>b.value=e,class:`h-7 w-12 text-center text-xs font-mono`,placeholder:`MM`},null,8,[`modelValue`]),S(P(ie),{size:`sm`,class:`h-7 ml-auto`,onClick:ee},{default:A(()=>[k(u(P(r)(`common.ok`)),1)]),_:1})])])]),_:1})]),_:1},8,[`open`]),S(P(ie),{size:`sm`,class:`h-7`,onClick:t.applyCustom},{default:A(()=>[k(u(P(r)(`dashboard.timeSelector.apply`)),1)]),_:1},8,[`onClick`])]),t.customError?(I(),j(`p`,hh,u(t.customError),1)):oe(``,!0)])):oe(``,!0)]))}}),vh={class:`page`},yh={class:`flex items-center gap-4 mb-3`},bh={class:`text-base font-semibold text-foreground shrink-0`},xh={class:`flex-1 overflow-x-auto flex gap-1 scrollbar-none`},Sh={key:0,class:`text-center py-20`},Ch={class:`text-muted-foreground mb-3`},wh={key:1,class:`text-center py-16`},Th={class:`text-muted-foreground`},Eh={key:2,class:`space-y-4`},Dh={class:`grid grid-cols-1 lg:grid-cols-[1fr_1.2fr] gap-4`},Oh={class:`space-y-3`},kh={class:`grid grid-cols-2 gap-2`},Ah={key:3},jh={class:`grid grid-cols-1 lg:grid-cols-[1fr_1.2fr] gap-4 mb-4`},Mh={class:`flex flex-col gap-4`},Nh={class:`bg-card rounded-lg px-5 py-4`},Ph={class:`text-xs text-muted-foreground`},Fh={class:`font-mono text-[32px] font-bold leading-none mt-1 text-teal`},Ih={key:1,class:`font-mono text-[11px] mt-1.5 text-muted-foreground`},Lh={class:`bg-card rounded-lg px-5 py-4`},Rh={class:`text-xs text-muted-foreground`},zh={class:`font-mono text-[32px] font-bold leading-none mt-1`},Bh={key:1,class:`font-mono text-[11px] mt-1.5 text-muted-foreground`},Vh={class:`grid grid-cols-2 gap-3`},Hh={class:`bg-card rounded-lg px-3.5 py-2.5`},Uh={class:`text-[11px] text-muted-foreground`},Wh={class:`font-mono text-lg font-semibold leading-none mt-0.5`},Gh={class:`bg-card rounded-lg px-3.5 py-2.5`},Kh={class:`text-[11px] text-muted-foreground`},qh={class:`font-mono text-lg font-semibold leading-none mt-0.5`},Jh={class:`flex gap-4 px-0.5`},Yh={class:`text-[11px] text-muted-foreground`},Xh={class:`font-mono text-[13px] font-medium text-foreground`},Zh={class:`text-[11px] text-muted-foreground`},Qh={class:`font-mono text-[13px] font-medium text-foreground`},$h={class:`text-[11px] text-muted-foreground`},eg={class:`font-mono text-[13px] font-medium text-foreground`},tg={class:`bg-card rounded-lg p-3.5 flex flex-col`},ng={class:`text-xs font-medium text-muted-foreground mb-2`},rg={class:`flex-1 min-h-[180px]`},ig={key:1,class:`flex items-center justify-center h-full text-muted-foreground text-sm`},ag={class:`grid grid-cols-1 gap-4 mb-4`},og={class:`bg-card rounded-lg p-3`},sg={class:`text-xs font-medium text-muted-foreground mb-1.5`},cg={class:`h-[140px]`},lg={key:1,class:`flex items-center justify-center h-full text-muted-foreground text-sm`},ug=M({__name:`Dashboard`,setup(t){rd.register(jf,Ff,yd,_d,Ef,of,Xd);let{providers:r,selectedProvider:i,sortedProviders:a,providerTokenLabels:o,modelFilter:s,keyFilter:c,clientType:d,modelOptions:f,keyOptions:h,stats:g,loading:v,loadError:y,cacheHitRate:x,tpsChartData:w,tokenThroughputChartData:T,deltaValues:D,windowTimeRange:ee,activeRange:O,timeRangeLabel:te,showCustom:ne,customStartDate:re,customEndDate:M,customError:N,selectQuickRange:F,toggleCustom:ae,applyCustom:L,retry:R}=Om(),{t:z}=m(),ce=l(()=>{let e=0;return s.value!==`all`&&e++,c.value!==`all`&&e++,d.value!==`all`&&e++,e}),le=l(()=>T.value?Jp(T.value.labels):{});function ue(e){return Yp(e)}return(t,l)=>{let m=p(`router-link`);return I(),j(`div`,vh,[e(`div`,yh,[e(`h2`,bh,u(P(z)(`dashboard.title`)),1),e(`div`,xh,[(I(!0),j(_,null,C(P(a),e=>(I(),E(P(ie),{key:e.id,variant:P(i)===e.id?`default`:`ghost`,size:`sm`,class:`h-[30px] px-3 text-[13px] gap-1.5 shrink-0`,onClick:t=>i.value=e.id},{default:A(()=>[k(u(e.name)+` `,1),P(o).get(e.id)?(I(),j(`span`,{key:0,class:b([`font-mono text-[11px] font-medium`,P(i)===e.id?`text-primary-foreground/60`:`text-muted-foreground`])},u(P(o).get(e.id)),3)):oe(``,!0)]),_:2},1032,[`variant`,`onClick`]))),128))]),S(P(De),null,{default:A(()=>[S(P(Oe),{"as-child":``},{default:A(()=>[S(P(ie),{variant:`outline`,size:`sm`,class:`h-[30px] px-2.5 text-[13px] gap-1.5 shrink-0`},{default:A(()=>[S(P(Ne),{class:`w-3.5 h-3.5`}),k(` `+u(P(z)(`dashboard.filters.button`))+` `,1),ce.value>0?(I(),E(P(Ae),{key:0,class:`h-4 min-w-4 px-1 text-[10px] font-mono font-semibold bg-primary text-primary-foreground`},{default:A(()=>[k(u(ce.value),1)]),_:1})):oe(``,!0)]),_:1})]),_:1}),S(P(ve),{align:`end`,class:`w-80 space-y-3`},{default:A(()=>[e(`div`,null,[S(P(se),{class:`text-xs text-muted-foreground mb-1 block`},{default:A(()=>[k(u(P(z)(`dashboard.filters.model`)),1)]),_:1}),S(P(we),{modelValue:P(s),"onUpdate:modelValue":l[0]||=e=>n(s)?s.value=e:null},{default:A(()=>[S(P(be),{class:`h-8 text-[13px]`},{default:A(()=>[S(P(Se),{placeholder:P(z)(`common.allModels`)},null,8,[`placeholder`])]),_:1}),S(P(ge),null,{default:A(()=>[S(P(ye),{value:`all`},{default:A(()=>[k(u(P(z)(`common.allModels`)),1)]),_:1}),(I(!0),j(_,null,C(P(f),e=>(I(),E(P(ye),{key:e,value:e},{default:A(()=>[k(u(e),1)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1},8,[`modelValue`])]),e(`div`,null,[S(P(se),{class:`text-xs text-muted-foreground mb-1 block`},{default:A(()=>[k(u(P(z)(`dashboard.filters.key`)),1)]),_:1}),S(P(we),{modelValue:P(c),"onUpdate:modelValue":l[1]||=e=>n(c)?c.value=e:null},{default:A(()=>[S(P(be),{class:`h-8 text-[13px]`},{default:A(()=>[S(P(Se),{placeholder:P(z)(`common.allKeys`)},null,8,[`placeholder`])]),_:1}),S(P(ge),null,{default:A(()=>[S(P(ye),{value:`all`},{default:A(()=>[k(u(P(z)(`common.allKeys`)),1)]),_:1}),(I(!0),j(_,null,C(P(h),e=>(I(),E(P(ye),{key:e.id,value:e.id},{default:A(()=>[k(u(e.name),1)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1},8,[`modelValue`])]),e(`div`,null,[S(P(se),{class:`text-xs text-muted-foreground mb-1 block`},{default:A(()=>[k(u(P(z)(`dashboard.filters.clientType`)),1)]),_:1}),S(P(we),{modelValue:P(d),"onUpdate:modelValue":l[2]||=e=>n(d)?d.value=e:null},{default:A(()=>[S(P(be),{class:`h-8 text-[13px]`},{default:A(()=>[S(P(Se),{placeholder:P(z)(`dashboard.clientType.all`)},null,8,[`placeholder`])]),_:1}),S(P(ge),null,{default:A(()=>[S(P(ye),{value:`all`},{default:A(()=>[k(u(P(z)(`dashboard.clientType.all`)),1)]),_:1}),S(P(ye),{value:`claude-code`},{default:A(()=>[k(u(P(z)(`dashboard.clientType.claude-code`)),1)]),_:1}),S(P(ye),{value:`codex`},{default:A(()=>[k(u(P(z)(`dashboard.clientType.codex`)),1)]),_:1}),S(P(ye),{value:`pi`},{default:A(()=>[k(u(P(z)(`dashboard.clientType.pi`)),1)]),_:1}),S(P(ye),{value:`openai-sdk`},{default:A(()=>[k(u(P(z)(`dashboard.clientType.openai-sdk`)),1)]),_:1}),S(P(ye),{value:`anthropic-sdk`},{default:A(()=>[k(u(P(z)(`dashboard.clientType.anthropic-sdk`)),1)]),_:1})]),_:1})]),_:1},8,[`modelValue`])])]),_:1})]),_:1})]),P(y)?(I(),j(`div`,Sh,[e(`p`,Ch,u(P(z)(`dashboard.loadError`)),1),S(P(ie),{variant:`outline`,size:`sm`,onClick:P(R)},{default:A(()=>[k(u(P(z)(`dashboard.retry`)),1)]),_:1},8,[`onClick`])])):P(r).length===0&&!P(v)?(I(),j(`div`,wh,[e(`p`,Th,u(P(z)(`dashboard.empty.noProvider`)),1),S(P(ie),{variant:`outline`,size:`sm`,class:`mt-3`,"as-child":``},{default:A(()=>[S(m,{to:`/providers`},{default:A(()=>[k(u(P(z)(`dashboard.empty.goToProviders`)),1)]),_:1})]),_:1})])):P(v)?(I(),j(`div`,Eh,[e(`div`,Dh,[e(`div`,Oh,[S(P(ke),{class:`h-24 w-full rounded-lg`}),S(P(ke),{class:`h-24 w-full rounded-lg`}),e(`div`,kh,[S(P(ke),{class:`h-16 rounded-lg`}),S(P(ke),{class:`h-16 rounded-lg`})])]),S(P(ke),{class:`h-64 rounded-lg`})])])):(I(),j(`div`,Ah,[S(_h,{"time-range-label":P(te),"active-range":P(O),"show-custom":P(ne),"custom-start-date":P(re),"custom-end-date":P(M),"custom-error":P(N),"select-quick-range":P(F),"toggle-custom":P(ae),"apply-custom":P(L),"onUpdate:customStartDate":l[3]||=e=>re.value=e,"onUpdate:customEndDate":l[4]||=e=>M.value=e},null,8,[`time-range-label`,`active-range`,`show-custom`,`custom-start-date`,`custom-end-date`,`custom-error`,`select-quick-range`,`toggle-custom`,`apply-custom`]),e(`div`,jh,[e(`div`,Mh,[e(`div`,Nh,[e(`div`,Ph,u(P(z)(`dashboard.stats.inputTokens`)),1),e(`div`,Fh,u(P(tm)(P(g).totalInputTokens)),1),P(D)?(I(),j(`div`,{key:0,class:b([`font-mono text-[11px] mt-1.5`,P(D).totalInputTokens.startsWith(`+`)?`text-success`:P(D).totalInputTokens.startsWith(`-`)?`text-danger`:`text-muted-foreground`])},u(P(D).totalInputTokens),3)):(I(),j(`div`,Ih,u(P(z)(`dashboard.delta.noPrev`)),1))]),e(`div`,Lh,[e(`div`,Rh,u(P(z)(`dashboard.stats.outputTokens`)),1),e(`div`,zh,u(P(tm)(P(g).totalOutputTokens)),1),P(D)?(I(),j(`div`,{key:0,class:b([`font-mono text-[11px] mt-1.5`,P(D).totalOutputTokens.startsWith(`+`)?`text-success`:P(D).totalOutputTokens.startsWith(`-`)?`text-danger`:`text-muted-foreground`])},u(P(D).totalOutputTokens),3)):(I(),j(`div`,Bh,u(P(z)(`dashboard.delta.noPrev`)),1))]),e(`div`,Vh,[e(`div`,Hh,[e(`div`,Uh,u(P(z)(`dashboard.stats.avgTps`)),1),e(`div`,Wh,[k(u(P(g).avgTps.toFixed(1)),1),l[5]||=e(`span`,{class:`text-xs font-normal text-muted-foreground ml-0.5`},`t/s`,-1)])]),e(`div`,Gh,[e(`div`,Kh,u(P(z)(`dashboard.stats.cacheHitRate`)),1),e(`div`,qh,[k(u(P(x).toFixed(1)),1),l[6]||=e(`span`,{class:`text-xs font-normal text-muted-foreground ml-0.5`},`%`,-1)])])]),e(`div`,Jh,[e(`span`,Yh,[k(u(P(z)(`dashboard.stats.totalRequests`))+` `,1),e(`span`,Xh,u(P(g).totalRequests.toLocaleString()),1)]),e(`span`,Zh,[k(u(P(z)(`dashboard.stats.successRate`))+` `,1),e(`span`,Qh,u(P(g).successRate===null?`--`:(P(g).successRate*100).toFixed(1)+`%`),1)]),e(`span`,$h,[k(u(P(z)(`dashboard.window.label`))+` `,1),e(`span`,eg,u(P(ee)),1)])])]),e(`div`,tg,[e(`div`,ng,u(P(z)(`dashboard.charts.tokenThroughput`)),1),e(`div`,rg,[P(T)?(I(),E(P(Op),{key:0,data:P(T),options:le.value},null,8,[`data`,`options`])):(I(),j(`div`,ig,u(P(z)(`common.noData`)),1))])])]),e(`div`,ag,[e(`div`,og,[e(`div`,sg,u(P(z)(`dashboard.charts.tps`)),1),e(`div`,cg,[P(w)?(I(),E(P(Op),{key:0,data:P(w),options:ue(P(w).labels)},null,8,[`data`,`options`])):(I(),j(`div`,lg,u(P(z)(`common.noData`)),1))])])])]))])}}});export{ug as default};