mirror of
https://github.com/WGDashboard/WGDashboard.git
synced 2026-08-04 06:53:00 +00:00
20 lines
217 KiB
JavaScript
20 lines
217 KiB
JavaScript
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/deleteConfiguration-D6kJ0AZV.js","assets/index-B53nMcWP.js","assets/index-BdzpqjNP.css","assets/localeText-DIDebWt2.js","assets/configurationBackupRestore-XI__b3sa.js","assets/dayjs.min-DwaFDThg.js","assets/configurationBackupRestore-BeBqyCqt.css","assets/selectPeers-ChsKtHWN.js","assets/selectPeers-Wjnh8YUZ.css","assets/editConfiguration-DFemTQNi.js","assets/editConfiguration-Oqrarw_V.css","assets/peerShareLinkModal-BayvlUUA.js","assets/vue-datepicker-BHeRBPDW.js","assets/peerJobsLogsModal-CE2J-3k5.js","assets/peerJobsAllModal-BwhThYLH.js","assets/schedulePeerJob-Iq8Y_Bm4.js","assets/schedulePeerJob--V7cpve7.css","assets/peerJobs-B6EQrnEx.js","assets/peerJobs-voXURBEt.css","assets/peerCreate-BIjpwtn7.js","assets/peerCreate-BpTNoL68.css","assets/peerQRCode-D6iSwgkc.js","assets/browser-CjSdxGTc.js","assets/peerConfigurationFile-ly0pawo0.js","assets/peerConfigurationFile-CNB9RKjb.css","assets/peerSettings-BgY1EFxp.js","assets/peerSettings-DCod994Y.css"])))=>i.map(i=>d[i]);
|
|
import{_ as Kt,D as Ns,W as Ws,G as ft,y as _e,g as we,a as D,c as E,b as g,d as C,t as B,F as Zt,h as ks,e as W,j as N,J as Uo,K as Yo,C as Ko,H as On,r as Ut,n as Ct,w as G,T as Z,f as Dt,i as j,L as Tn,M as An,N as Ps,O as Xo,o as Ln,P as Go,Q as Ms,R as Jo,U as In,p as Rn,V as En,m as Fn,z as Qo,X as ot,v as qo,k as Zo,Y as rt}from"./index-B53nMcWP.js";import{L as Ae}from"./localeText-DIDebWt2.js";import{d as ri}from"./dayjs.min-DwaFDThg.js";import{_ as tr}from"./protocolBadge-Cyz0W1QZ.js";const er={name:"peerSearch",components:{LocaleText:Ae},setup(){const s=Ns(),t=Ws();return{store:s,wireguardConfigurationStore:t}},props:{configuration:Object},data(){return{sort:{status:ft("Status"),name:ft("Name"),allowed_ip:ft("Allowed IPs"),restricted:ft("Restricted")},interval:{5e3:ft("5 Seconds"),1e4:ft("10 Seconds"),3e4:ft("30 Seconds"),6e4:ft("1 Minutes")},searchString:"",searchStringTimeout:void 0,showDisplaySettings:!1,showMoreSettings:!1}},methods:{debounce(){this.searchStringTimeout?(clearTimeout(this.searchStringTimeout),this.searchStringTimeout=setTimeout(()=>{this.wireguardConfigurationStore.searchString=this.searchString},300)):this.searchStringTimeout=setTimeout(()=>{this.wireguardConfigurationStore.searchString=this.searchString},300)},updateSort(s){_e("/api/updateDashboardConfigurationItem",{section:"Server",key:"dashboard_sort",value:s},t=>{t.status&&this.store.getConfiguration()})},updateRefreshInterval(s){_e("/api/updateDashboardConfigurationItem",{section:"Server",key:"dashboard_refresh_interval",value:s},t=>{t.status&&this.store.getConfiguration()})},downloadAllPeer(){we(`/api/downloadAllPeers/${this.configuration.Name}`,{},s=>{console.log(s),window.wireguard.generateZipFiles(s,this.configuration.Name)})}},computed:{searchBarPlaceholder(){return ft("Search Peers...")}}},sr={class:"d-flex flex-column gap-2 my-4"},ir={class:"d-flex gap-2 peerSearchContainer"},nr={class:"dropdown"},or={"data-bs-toggle":"dropdown",class:"btn w-100 btn-sm text-primary-emphasis bg-primary-subtle rounded-3 border-1 border-primary-subtle position-relative"},rr={class:"badge text-bg-primary ms-2"},ar={class:"dropdown-menu rounded-3"},lr=["onClick"],cr={class:"ms-auto"},hr={key:0,class:"bi bi-check-circle-fill"},dr={class:"dropdown"},ur={"data-bs-toggle":"dropdown",class:"btn btn-sm w-100 text-primary-emphasis bg-primary-subtle rounded-3 border-1 border-primary-subtle position-relative"},fr={class:"badge text-bg-primary ms-2"},gr={class:"dropdown-menu rounded-3"},pr=["onClick"],mr={class:"ms-auto"},br={key:0,class:"bi bi-check-circle-fill"};function _r(s,t,e,i,n,o){const r=N("LocaleText");return D(),E("div",sr,[g("div",ir,[g("div",nr,[g("button",or,[t[4]||(t[4]=g("i",{class:"bi bi-sort-up me-2"},null,-1)),C(r,{t:"Sort By"}),g("span",rr,B(this.sort[i.store.Configuration.Server.dashboard_sort]),1)]),g("ul",ar,[(D(!0),E(Zt,null,ks(this.sort,(a,l)=>(D(),E("li",null,[g("button",{class:"dropdown-item d-flex align-items-center",onClick:c=>this.updateSort(l)},[g("small",null,B(a),1),g("small",cr,[i.store.Configuration.Server.dashboard_sort===l?(D(),E("i",hr)):W("",!0)])],8,lr)]))),256))])]),g("div",dr,[g("button",ur,[t[5]||(t[5]=g("i",{class:"bi bi-arrow-repeat me-2"},null,-1)),C(r,{t:"Refresh Interval"}),g("span",fr,B(this.interval[i.store.Configuration.Server.dashboard_refresh_interval]),1)]),g("ul",gr,[(D(!0),E(Zt,null,ks(this.interval,(a,l)=>(D(),E("li",null,[g("button",{class:"dropdown-item d-flex align-items-center",onClick:c=>this.updateRefreshInterval(l)},[g("small",null,B(a),1),g("small",mr,[i.store.Configuration.Server.dashboard_refresh_interval===l?(D(),E("i",br)):W("",!0)])],8,pr)]))),256))])]),g("button",{class:"btn btn-sm text-primary-emphasis bg-primary-subtle rounded-3 border-1 border-primary-subtle ms-lg-auto",onClick:t[0]||(t[0]=a=>this.$emit("search"))},[t[6]||(t[6]=g("i",{class:"bi bi-search me-2"},null,-1)),C(r,{t:"Search"})]),g("button",{class:"btn btn-sm text-primary-emphasis bg-primary-subtle rounded-3 border-1 border-primary-subtle",onClick:t[1]||(t[1]=a=>this.downloadAllPeer())},[t[7]||(t[7]=g("i",{class:"bi bi-download me-2"},null,-1)),C(r,{t:"Download All"})]),g("button",{class:"btn btn-sm text-primary-emphasis bg-primary-subtle rounded-3 border-1 border-primary-subtle",onClick:t[2]||(t[2]=a=>this.$emit("selectPeers"))},[t[8]||(t[8]=g("i",{class:"bi bi-check2-all me-2"},null,-1)),C(r,{t:"Select Peers"})]),g("button",{class:"btn btn-sm text-primary-emphasis bg-primary-subtle rounded-3 border-1 border-primary-subtle",onClick:t[3]||(t[3]=a=>this.$emit("jobsAll")),type:"button","aria-expanded":"false"},[t[9]||(t[9]=g("i",{class:"bi bi-person-walking me-2"},null,-1)),C(r,{t:"Active Jobs"})])])])}const xr=Kt(er,[["render",_r],["__scopeId","data-v-069dfdd9"]]);function yr(s){return Uo()?(Yo(s),!0):!1}function Bn(s){return typeof s=="function"?s():Ko(s)}const zn=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const vr=Object.prototype.toString,Sr=s=>vr.call(s)==="[object Object]",qe=()=>{},wr=kr();function kr(){var s,t;return zn&&((s=window?.navigator)==null?void 0:s.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((t=window?.navigator)==null?void 0:t.maxTouchPoints)>2&&/iPad|Macintosh/.test(window?.navigator.userAgent))}function ge(s){var t;const e=Bn(s);return(t=e?.$el)!=null?t:e}const $n=zn?window:void 0;function ds(...s){let t,e,i,n;if(typeof s[0]=="string"||Array.isArray(s[0])?([e,i,n]=s,t=$n):[t,e,i,n]=s,!t)return qe;Array.isArray(e)||(e=[e]),Array.isArray(i)||(i=[i]);const o=[],r=()=>{o.forEach(h=>h()),o.length=0},a=(h,d,u,f)=>(h.addEventListener(d,u,f),()=>h.removeEventListener(d,u,f)),l=On(()=>[ge(t),Bn(n)],([h,d])=>{if(r(),!h)return;const u=Sr(d)?{...d}:d;o.push(...e.flatMap(f=>i.map(p=>a(h,f,p,u))))},{immediate:!0,flush:"post"}),c=()=>{l(),r()};return yr(c),c}let ai=!1;function Hn(s,t,e={}){const{window:i=$n,ignore:n=[],capture:o=!0,detectIframe:r=!1}=e;if(!i)return qe;wr&&!ai&&(ai=!0,Array.from(i.document.body.children).forEach(u=>u.addEventListener("click",qe)),i.document.documentElement.addEventListener("click",qe));let a=!0;const l=u=>n.some(f=>{if(typeof f=="string")return Array.from(i.document.querySelectorAll(f)).some(p=>p===u.target||u.composedPath().includes(p));{const p=ge(f);return p&&(u.target===p||u.composedPath().includes(p))}}),h=[ds(i,"click",u=>{const f=ge(s);if(!(!f||f===u.target||u.composedPath().includes(f))){if(u.detail===0&&(a=!l(u)),!a){a=!0;return}t(u)}},{passive:!0,capture:o}),ds(i,"pointerdown",u=>{const f=ge(s);a=!l(u)&&!!(f&&!u.composedPath().includes(f))},{passive:!0}),r&&ds(i,"blur",u=>{setTimeout(()=>{var f;const p=ge(s);((f=i.document.activeElement)==null?void 0:f.tagName)==="IFRAME"&&!p?.contains(i.document.activeElement)&&t(u)},0)})].filter(Boolean);return()=>h.forEach(u=>u())}const Pr={key:0,class:"position-absolute d-block p-1 px-2 bg-body text-body rounded-3 border shadow"},Mr={__name:"peerSettingsDropdownTool",props:{icon:String,title:String},emits:["click"],setup(s,{emit:t}){const e=t,i=Ut(!1);return(n,o)=>(D(),E("a",{class:"dropdown-item text-center px-0 rounded-3 position-relative",role:"button",onMouseenter:o[0]||(o[0]=r=>i.value=!0),onMouseleave:o[1]||(o[1]=r=>i.value=!1),onClick:o[2]||(o[2]=r=>e("click"))},[g("i",{class:Ct(["me-auto bi",s.icon])},null,2),C(Z,{name:"zoomReversed"},{default:G(()=>[i.value?(D(),E("span",Pr,[g("small",null,B(s.title),1)])):W("",!0)]),_:1})],32))}},Cr=Kt(Mr,[["__scopeId","data-v-2d66aeb6"]]),Dr={name:"peerSettingsDropdown",components:{PeerSettingsDropdownTool:Cr,LocaleText:Ae},setup(){return{dashboardStore:Ns()}},props:{Peer:Object},data(){return{deleteBtnDisabled:!1,restrictBtnDisabled:!1,allowAccessBtnDisabled:!1,confirmDelete:!1}},methods:{downloadPeer(){we("/api/downloadPeer/"+this.$route.params.id,{id:this.Peer.id},s=>{if(s.status){const t=new Blob([s.data.file],{type:"text/plain"}),e=URL.createObjectURL(t),i=`${s.data.fileName}.conf`,n=document.createElement("a");n.href=e,n.download=i,n.click(),this.dashboardStore.newMessage("WGDashboard","Peer download started","success")}else this.dashboardStore.newMessage("Server",s.message,"danger")})},downloadQRCode(s){we("/api/downloadPeer/"+this.$route.params.id,{id:this.Peer.id},t=>{t.status?this.$emit(s,t.data.file):this.dashboardStore.newMessage("Server",t.message,"danger")})},deletePeer(){this.deleteBtnDisabled=!0,_e(`/api/deletePeers/${this.$route.params.id}`,{peers:[this.Peer.id]},s=>{this.dashboardStore.newMessage("Server",s.message,s.status?"success":"danger"),this.$emit("refresh"),this.deleteBtnDisabled=!1})},restrictPeer(){this.restrictBtnDisabled=!0,_e(`/api/restrictPeers/${this.$route.params.id}`,{peers:[this.Peer.id]},s=>{this.dashboardStore.newMessage("Server",s.message,s.status?"success":"danger"),this.$emit("refresh"),this.restrictBtnDisabled=!1})},allowAccessPeer(){this.allowAccessBtnDisabled=!0,_e(`/api/allowAccessPeers/${this.$route.params.id}`,{peers:[this.Peer.id]},s=>{this.dashboardStore.newMessage("Server",s.message,s.status?"success":"danger"),this.$emit("refresh"),this.allowAccessBtnDisabled=!1})}}},Or={class:"dropdown-menu mt-2 shadow-lg d-block rounded-3",style:{"max-width":"200px"}},Tr={style:{"font-size":"0.8rem","padding-left":"var(--bs-dropdown-item-padding-x)","padding-right":"var(--bs-dropdown-item-padding-x)"}},Ar={class:"text-body d-flex"},Lr={class:"ms-auto"},Ir={key:1},Rr={class:"w-100 dropdown-item text-muted",style:{"white-space":"break-spaces","font-size":"0.7rem"}},Er={key:2},Fr={class:"d-flex",style:{"padding-left":"var(--bs-dropdown-item-padding-x)","padding-right":"var(--bs-dropdown-item-padding-x)"}},Br={key:1,class:"confirmDelete"},zr={style:{"white-space":"break-spaces"},class:"mb-2 d-block fw-bold"},$r={class:"d-flex w-100 gap-2"},Hr=["disabled"],Nr=["disabled"],Wr={key:1};function Vr(s,t,e,i,n,o){const r=N("LocaleText"),a=N("PeerSettingsDropdownTool");return D(),E("ul",Or,[this.Peer.restricted?(D(),E("li",Wr,[g("a",{class:Ct(["dropdown-item d-flex text-warning",{disabled:this.allowAccessBtnDisabled}]),onClick:t[10]||(t[10]=l=>this.allowAccessPeer()),role:"button"},[t[22]||(t[22]=g("i",{class:"me-auto bi bi-unlock"},null,-1)),this.allowAccessBtnDisabled?(D(),j(r,{key:1,t:"Allowing Access..."})):(D(),j(r,{key:0,t:"Allow Access"}))],2)])):(D(),E(Zt,{key:0},[this.confirmDelete?(D(),E("li",Br,[g("p",zr,[C(r,{t:"Are you sure to delete this peer?"})]),g("div",$r,[g("button",{onClick:t[8]||(t[8]=l=>this.deletePeer()),disabled:this.deleteBtnDisabled,class:"flex-grow-1 ms-auto btn btn-sm bg-danger"},[C(r,{t:"Yes"})],8,Hr),g("button",{disabled:this.deleteBtnDisabled,onClick:t[9]||(t[9]=l=>this.confirmDelete=!1),class:"flex-grow-1 btn btn-sm bg-secondary-subtle text-secondary-emphasis border border-secondary-subtle"},[C(r,{t:"No"})],8,Nr)])])):(D(),E(Zt,{key:0},[this.Peer.status==="running"?(D(),E(Zt,{key:0},[g("li",Tr,[g("span",Ar,[t[11]||(t[11]=g("i",{class:"bi bi-box-arrow-in-right"},null,-1)),g("span",Lr,B(this.Peer.endpoint),1)])]),t[12]||(t[12]=g("li",null,[g("hr",{class:"dropdown-divider"})],-1))],64)):W("",!0),this.Peer.private_key?(D(),E("li",Er,[t[13]||(t[13]=g("div",{class:"text-center text-muted"},null,-1)),g("div",Fr,[C(a,{icon:"bi-download",title:"Download",onClick:t[0]||(t[0]=l=>this.downloadPeer())}),C(a,{icon:"bi-qr-code",title:"QR Code",onClick:t[1]||(t[1]=l=>this.downloadQRCode("qrcode"))}),C(a,{icon:"bi-body-text",title:"Configuration File",onClick:t[2]||(t[2]=l=>this.downloadQRCode("configurationFile"))}),C(a,{icon:"bi-share",title:"Share",onClick:t[3]||(t[3]=l=>this.$emit("share"))})])])):(D(),E("li",Ir,[g("small",Rr,[C(r,{t:"Download & QR Code is not available due to no private key set for this peer"})])])),t[20]||(t[20]=g("li",null,[g("hr",{class:"dropdown-divider"})],-1)),g("li",null,[g("a",{class:"dropdown-item d-flex",role:"button",onClick:t[4]||(t[4]=l=>this.$emit("setting"))},[t[14]||(t[14]=g("i",{class:"me-auto bi bi-pen"},null,-1)),t[15]||(t[15]=Dt()),C(r,{t:"Peer Settings"})])]),g("li",null,[g("a",{class:"dropdown-item d-flex",role:"button",onClick:t[5]||(t[5]=l=>this.$emit("jobs"))},[t[16]||(t[16]=g("i",{class:"me-auto bi bi-app-indicator"},null,-1)),t[17]||(t[17]=Dt()),C(r,{t:"Schedule Jobs"})])]),t[21]||(t[21]=g("li",null,[g("hr",{class:"dropdown-divider"})],-1)),g("li",null,[g("a",{class:Ct(["dropdown-item d-flex text-warning",{disabled:this.restrictBtnDisabled}]),onClick:t[6]||(t[6]=l=>this.restrictPeer()),role:"button"},[t[18]||(t[18]=g("i",{class:"me-auto bi bi-lock"},null,-1)),this.restrictBtnDisabled?(D(),j(r,{key:1,t:"Restricting..."})):(D(),j(r,{key:0,t:"Restrict Access"}))],2)]),g("li",null,[g("a",{class:Ct(["dropdown-item d-flex fw-bold text-danger",{disabled:this.deleteBtnDisabled}]),onClick:t[7]||(t[7]=l=>this.confirmDelete=!0),role:"button"},[t[19]||(t[19]=g("i",{class:"me-auto bi bi-trash"},null,-1)),this.deleteBtnDisabled?(D(),j(r,{key:1,t:"Deleting..."})):(D(),j(r,{key:0,t:"Delete"}))],2)])],64))],64))])}const Nn=Kt(Dr,[["render",Vr],["__scopeId","data-v-c4e10919"]]),jr={name:"peer",components:{LocaleText:Ae,PeerSettingsDropdown:Nn},props:{Peer:Object},data(){return{}},setup(){const s=Ut(null),t=Ut(!1);return Hn(s,e=>{t.value=!1}),{target:s,subMenuOpened:t}},computed:{getLatestHandshake(){return this.Peer.latest_handshake.includes(",")?this.Peer.latest_handshake.split(",")[0]:this.Peer.latest_handshake}}},Ur={key:0,class:"card-header bg-transparent d-flex align-items-center gap-2 border-0"},Yr={style:{"font-size":"0.8rem"},class:"ms-auto d-flex gap-2"},Kr={class:"text-primary"},Xr={class:"text-success"},Gr={key:0,class:"text-secondary"},Jr={key:1,class:"border-0 card-header bg-transparent text-warning fw-bold",style:{"font-size":"0.8rem"}},Qr={class:"card-body pt-1",style:{"font-size":"0.9rem"}},qr={class:"mb-1"},Zr={class:"text-muted"},ta={class:"d-block"},ea={class:"text-muted"},sa={class:"d-block"},ia={key:0},na={class:"text-muted"},oa={class:"d-block"},ra={class:"d-flex align-items-end"};function aa(s,t,e,i,n,o){const r=N("LocaleText"),a=N("PeerSettingsDropdown");return D(),E("div",{class:Ct(["card shadow-sm rounded-3 peerCard bg-transparent",{"border-warning":e.Peer.restricted}])},[g("div",null,[e.Peer.restricted?(D(),E("div",Jr,[t[12]||(t[12]=g("i",{class:"bi-lock-fill me-2"},null,-1)),C(r,{t:"Access Restricted"})])):(D(),E("div",Ur,[g("div",{class:Ct(["dot ms-0",{active:e.Peer.status==="running"}])},null,2),g("div",Yr,[g("span",Kr,[t[7]||(t[7]=g("i",{class:"bi bi-arrow-down"},null,-1)),g("strong",null,B((e.Peer.cumu_receive+e.Peer.total_receive).toFixed(4)),1),t[8]||(t[8]=Dt(" GB "))]),g("span",Xr,[t[9]||(t[9]=g("i",{class:"bi bi-arrow-up"},null,-1)),g("strong",null,B((e.Peer.cumu_sent+e.Peer.total_sent).toFixed(4)),1),t[10]||(t[10]=Dt(" GB "))]),e.Peer.latest_handshake!=="No Handshake"?(D(),E("span",Gr,[t[11]||(t[11]=g("i",{class:"bi bi-arrows-angle-contract"},null,-1)),Dt(" "+B(o.getLatestHandshake)+" ago ",1)])):W("",!0)])]))]),g("div",Qr,[g("h6",null,B(e.Peer.name?e.Peer.name:"Untitled Peer"),1),g("div",qr,[g("small",Zr,[C(r,{t:"Public Key"})]),g("small",ta,[g("samp",null,B(e.Peer.id),1)])]),g("div",null,[g("small",ea,[C(r,{t:"Allowed IPs"})]),g("small",sa,[g("samp",null,B(e.Peer.allowed_ip),1)])]),e.Peer.advanced_security?(D(),E("div",ia,[g("small",na,[C(r,{t:"Advanced Security"})]),g("small",oa,[g("samp",null,B(e.Peer.advanced_security),1)])])):W("",!0),g("div",ra,[g("div",{class:Ct(["ms-auto px-2 rounded-3 subMenuBtn",{active:this.subMenuOpened}])},[g("a",{role:"button",class:"text-body",onClick:t[0]||(t[0]=l=>this.subMenuOpened=!0)},t[13]||(t[13]=[g("h5",{class:"mb-0"},[g("i",{class:"bi bi-three-dots"})],-1)])),C(Z,{name:"slide-fade"},{default:G(()=>[this.subMenuOpened?(D(),j(a,{key:0,onQrcode:t[1]||(t[1]=l=>this.$emit("qrcode",l)),onConfigurationFile:t[2]||(t[2]=l=>this.$emit("configurationFile",l)),onSetting:t[3]||(t[3]=l=>this.$emit("setting")),onJobs:t[4]||(t[4]=l=>this.$emit("jobs")),onRefresh:t[5]||(t[5]=l=>this.$emit("refresh")),onShare:t[6]||(t[6]=l=>this.$emit("share")),Peer:e.Peer,ref:"target"},null,8,["Peer"])):W("",!0)]),_:1})],2)])])],2)}const la=Kt(jr,[["render",aa],["__scopeId","data-v-e00283b9"]]);/*!
|
|
* @kurkle/color v0.3.2
|
|
* https://github.com/kurkle/color#readme
|
|
* (c) 2023 Jukka Kurkela
|
|
* Released under the MIT License
|
|
*/function Le(s){return s+.5|0}const Pt=(s,t,e)=>Math.max(Math.min(s,e),t);function pe(s){return Pt(Le(s*2.55),0,255)}function Ot(s){return Pt(Le(s*255),0,255)}function St(s){return Pt(Le(s/2.55)/100,0,1)}function li(s){return Pt(Le(s*100),0,100)}const at={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},Cs=[..."0123456789ABCDEF"],ca=s=>Cs[s&15],ha=s=>Cs[(s&240)>>4]+Cs[s&15],Be=s=>(s&240)>>4===(s&15),da=s=>Be(s.r)&&Be(s.g)&&Be(s.b)&&Be(s.a);function ua(s){var t=s.length,e;return s[0]==="#"&&(t===4||t===5?e={r:255&at[s[1]]*17,g:255&at[s[2]]*17,b:255&at[s[3]]*17,a:t===5?at[s[4]]*17:255}:(t===7||t===9)&&(e={r:at[s[1]]<<4|at[s[2]],g:at[s[3]]<<4|at[s[4]],b:at[s[5]]<<4|at[s[6]],a:t===9?at[s[7]]<<4|at[s[8]]:255})),e}const fa=(s,t)=>s<255?t(s):"";function ga(s){var t=da(s)?ca:ha;return s?"#"+t(s.r)+t(s.g)+t(s.b)+fa(s.a,t):void 0}const pa=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Wn(s,t,e){const i=t*Math.min(e,1-e),n=(o,r=(o+s/30)%12)=>e-i*Math.max(Math.min(r-3,9-r,1),-1);return[n(0),n(8),n(4)]}function ma(s,t,e){const i=(n,o=(n+s/60)%6)=>e-e*t*Math.max(Math.min(o,4-o,1),0);return[i(5),i(3),i(1)]}function ba(s,t,e){const i=Wn(s,1,.5);let n;for(t+e>1&&(n=1/(t+e),t*=n,e*=n),n=0;n<3;n++)i[n]*=1-t-e,i[n]+=t;return i}function _a(s,t,e,i,n){return s===n?(t-e)/i+(t<e?6:0):t===n?(e-s)/i+2:(s-t)/i+4}function Vs(s){const e=s.r/255,i=s.g/255,n=s.b/255,o=Math.max(e,i,n),r=Math.min(e,i,n),a=(o+r)/2;let l,c,h;return o!==r&&(h=o-r,c=a>.5?h/(2-o-r):h/(o+r),l=_a(e,i,n,h,o),l=l*60+.5),[l|0,c||0,a]}function js(s,t,e,i){return(Array.isArray(t)?s(t[0],t[1],t[2]):s(t,e,i)).map(Ot)}function Us(s,t,e){return js(Wn,s,t,e)}function xa(s,t,e){return js(ba,s,t,e)}function ya(s,t,e){return js(ma,s,t,e)}function Vn(s){return(s%360+360)%360}function va(s){const t=pa.exec(s);let e=255,i;if(!t)return;t[5]!==i&&(e=t[6]?pe(+t[5]):Ot(+t[5]));const n=Vn(+t[2]),o=+t[3]/100,r=+t[4]/100;return t[1]==="hwb"?i=xa(n,o,r):t[1]==="hsv"?i=ya(n,o,r):i=Us(n,o,r),{r:i[0],g:i[1],b:i[2],a:e}}function Sa(s,t){var e=Vs(s);e[0]=Vn(e[0]+t),e=Us(e),s.r=e[0],s.g=e[1],s.b=e[2]}function wa(s){if(!s)return;const t=Vs(s),e=t[0],i=li(t[1]),n=li(t[2]);return s.a<255?`hsla(${e}, ${i}%, ${n}%, ${St(s.a)})`:`hsl(${e}, ${i}%, ${n}%)`}const ci={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"},hi={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 ka(){const s={},t=Object.keys(hi),e=Object.keys(ci);let i,n,o,r,a;for(i=0;i<t.length;i++){for(r=a=t[i],n=0;n<e.length;n++)o=e[n],a=a.replace(o,ci[o]);o=parseInt(hi[r],16),s[a]=[o>>16&255,o>>8&255,o&255]}return s}let ze;function Pa(s){ze||(ze=ka(),ze.transparent=[0,0,0,0]);const t=ze[s.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const Ma=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Ca(s){const t=Ma.exec(s);let e=255,i,n,o;if(t){if(t[7]!==i){const r=+t[7];e=t[8]?pe(r):Pt(r*255,0,255)}return i=+t[1],n=+t[3],o=+t[5],i=255&(t[2]?pe(i):Pt(i,0,255)),n=255&(t[4]?pe(n):Pt(n,0,255)),o=255&(t[6]?pe(o):Pt(o,0,255)),{r:i,g:n,b:o,a:e}}}function Da(s){return s&&(s.a<255?`rgba(${s.r}, ${s.g}, ${s.b}, ${St(s.a)})`:`rgb(${s.r}, ${s.g}, ${s.b})`)}const us=s=>s<=.0031308?s*12.92:Math.pow(s,1/2.4)*1.055-.055,Qt=s=>s<=.04045?s/12.92:Math.pow((s+.055)/1.055,2.4);function Oa(s,t,e){const i=Qt(St(s.r)),n=Qt(St(s.g)),o=Qt(St(s.b));return{r:Ot(us(i+e*(Qt(St(t.r))-i))),g:Ot(us(n+e*(Qt(St(t.g))-n))),b:Ot(us(o+e*(Qt(St(t.b))-o))),a:s.a+e*(t.a-s.a)}}function $e(s,t,e){if(s){let i=Vs(s);i[t]=Math.max(0,Math.min(i[t]+i[t]*e,t===0?360:1)),i=Us(i),s.r=i[0],s.g=i[1],s.b=i[2]}}function jn(s,t){return s&&Object.assign(t||{},s)}function di(s){var t={r:0,g:0,b:0,a:255};return Array.isArray(s)?s.length>=3&&(t={r:s[0],g:s[1],b:s[2],a:255},s.length>3&&(t.a=Ot(s[3]))):(t=jn(s,{r:0,g:0,b:0,a:1}),t.a=Ot(t.a)),t}function Ta(s){return s.charAt(0)==="r"?Ca(s):va(s)}class ke{constructor(t){if(t instanceof ke)return t;const e=typeof t;let i;e==="object"?i=di(t):e==="string"&&(i=ua(t)||Pa(t)||Ta(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=jn(this._rgb);return t&&(t.a=St(t.a)),t}set rgb(t){this._rgb=di(t)}rgbString(){return this._valid?Da(this._rgb):void 0}hexString(){return this._valid?ga(this._rgb):void 0}hslString(){return this._valid?wa(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,n=t.rgb;let o;const r=e===o?.5:e,a=2*r-1,l=i.a-n.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;o=1-c,i.r=255&c*i.r+o*n.r+.5,i.g=255&c*i.g+o*n.g+.5,i.b=255&c*i.b+o*n.b+.5,i.a=r*i.a+(1-r)*n.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=Oa(this._rgb,t._rgb,e)),this}clone(){return new ke(this.rgb)}alpha(t){return this._rgb.a=Ot(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=Le(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){const e=this._rgb;return e.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return $e(this._rgb,2,t),this}darken(t){return $e(this._rgb,2,-t),this}saturate(t){return $e(this._rgb,1,t),this}desaturate(t){return $e(this._rgb,1,-t),this}rotate(t){return Sa(this._rgb,t),this}}/*!
|
|
* Chart.js v4.4.4
|
|
* https://www.chartjs.org
|
|
* (c) 2024 Chart.js Contributors
|
|
* Released under the MIT License
|
|
*/function xt(){}const Aa=(()=>{let s=0;return()=>s++})();function $(s){return s===null||typeof s>"u"}function K(s){if(Array.isArray&&Array.isArray(s))return!0;const t=Object.prototype.toString.call(s);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function R(s){return s!==null&&Object.prototype.toString.call(s)==="[object Object]"}function ct(s){return(typeof s=="number"||s instanceof Number)&&isFinite(+s)}function ut(s,t){return ct(s)?s:t}function I(s,t){return typeof s>"u"?t:s}const La=(s,t)=>typeof s=="string"&&s.endsWith("%")?parseFloat(s)/100*t:+s;function H(s,t,e){if(s&&typeof s.call=="function")return s.apply(e,t)}function F(s,t,e,i){let n,o,r;if(K(s))for(o=s.length,n=0;n<o;n++)t.call(e,s[n],n);else if(R(s))for(r=Object.keys(s),o=r.length,n=0;n<o;n++)t.call(e,s[r[n]],r[n])}function es(s,t){let e,i,n,o;if(!s||!t||s.length!==t.length)return!1;for(e=0,i=s.length;e<i;++e)if(n=s[e],o=t[e],n.datasetIndex!==o.datasetIndex||n.index!==o.index)return!1;return!0}function ss(s){if(K(s))return s.map(ss);if(R(s)){const t=Object.create(null),e=Object.keys(s),i=e.length;let n=0;for(;n<i;++n)t[e[n]]=ss(s[e[n]]);return t}return s}function Un(s){return["__proto__","prototype","constructor"].indexOf(s)===-1}function Ia(s,t,e,i){if(!Un(s))return;const n=t[s],o=e[s];R(n)&&R(o)?Pe(n,o,i):t[s]=ss(o)}function Pe(s,t,e){const i=K(t)?t:[t],n=i.length;if(!R(s))return s;e=e||{};const o=e.merger||Ia;let r;for(let a=0;a<n;++a){if(r=i[a],!R(r))continue;const l=Object.keys(r);for(let c=0,h=l.length;c<h;++c)o(l[c],s,r,e)}return s}function xe(s,t){return Pe(s,t,{merger:Ra})}function Ra(s,t,e){if(!Un(s))return;const i=t[s],n=e[s];R(i)&&R(n)?xe(i,n):Object.prototype.hasOwnProperty.call(t,s)||(t[s]=ss(n))}const ui={"":s=>s,x:s=>s.x,y:s=>s.y};function Ea(s){const t=s.split("."),e=[];let i="";for(const n of t)i+=n,i.endsWith("\\")?i=i.slice(0,-1)+".":(e.push(i),i="");return e}function Fa(s){const t=Ea(s);return e=>{for(const i of t){if(i==="")break;e=e&&e[i]}return e}}function se(s,t){return(ui[t]||(ui[t]=Fa(t)))(s)}function Ys(s){return s.charAt(0).toUpperCase()+s.slice(1)}const Me=s=>typeof s<"u",Tt=s=>typeof s=="function",fi=(s,t)=>{if(s.size!==t.size)return!1;for(const e of s)if(!t.has(e))return!1;return!0};function Ba(s){return s.type==="mouseup"||s.type==="click"||s.type==="contextmenu"}const X=Math.PI,bt=2*X,za=bt+X,is=Number.POSITIVE_INFINITY,$a=X/180,dt=X/2,Et=X/4,gi=X*2/3,Ds=Math.log10,_t=Math.sign;function ye(s,t,e){return Math.abs(s-t)<e}function pi(s){const t=Math.round(s);s=ye(s,t,s/1e3)?t:s;const e=Math.pow(10,Math.floor(Ds(s))),i=s/e;return(i<=1?1:i<=2?2:i<=5?5:10)*e}function Ha(s){const t=[],e=Math.sqrt(s);let i;for(i=1;i<e;i++)s%i===0&&(t.push(i),t.push(s/i));return e===(e|0)&&t.push(e),t.sort((n,o)=>n-o).pop(),t}function Ce(s){return!isNaN(parseFloat(s))&&isFinite(s)}function Na(s,t){const e=Math.round(s);return e-t<=s&&e+t>=s}function Wa(s,t,e){let i,n,o;for(i=0,n=s.length;i<n;i++)o=s[i][e],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function Nt(s){return s*(X/180)}function Va(s){return s*(180/X)}function mi(s){if(!ct(s))return;let t=1,e=0;for(;Math.round(s*t)/t!==s;)t*=10,e++;return e}function ja(s,t){const e=t.x-s.x,i=t.y-s.y,n=Math.sqrt(e*e+i*i);let o=Math.atan2(i,e);return o<-.5*X&&(o+=bt),{angle:o,distance:n}}function Os(s,t){return Math.sqrt(Math.pow(t.x-s.x,2)+Math.pow(t.y-s.y,2))}function Ua(s,t){return(s-t+za)%bt-X}function kt(s){return(s%bt+bt)%bt}function Yn(s,t,e,i){const n=kt(s),o=kt(t),r=kt(e),a=kt(o-n),l=kt(r-n),c=kt(n-o),h=kt(n-r);return n===o||n===r||i&&o===r||a>l&&c<h}function it(s,t,e){return Math.max(t,Math.min(e,s))}function Ya(s){return it(s,-32768,32767)}function Wt(s,t,e,i=1e-6){return s>=Math.min(t,e)-i&&s<=Math.max(t,e)+i}function Ks(s,t,e){e=e||(r=>s[r]<t);let i=s.length-1,n=0,o;for(;i-n>1;)o=n+i>>1,e(o)?n=o:i=o;return{lo:n,hi:i}}const Vt=(s,t,e,i)=>Ks(s,e,i?n=>{const o=s[n][t];return o<e||o===e&&s[n+1][t]===e}:n=>s[n][t]<e),Ka=(s,t,e)=>Ks(s,e,i=>s[i][t]>=e);function Xa(s,t,e){let i=0,n=s.length;for(;i<n&&s[i]<t;)i++;for(;n>i&&s[n-1]>e;)n--;return i>0||n<s.length?s.slice(i,n):s}const Kn=["push","pop","shift","splice","unshift"];function Ga(s,t){if(s._chartjs){s._chartjs.listeners.push(t);return}Object.defineProperty(s,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),Kn.forEach(e=>{const i="_onData"+Ys(e),n=s[e];Object.defineProperty(s,e,{configurable:!0,enumerable:!1,value(...o){const r=n.apply(this,o);return s._chartjs.listeners.forEach(a=>{typeof a[i]=="function"&&a[i](...o)}),r}})})}function bi(s,t){const e=s._chartjs;if(!e)return;const i=e.listeners,n=i.indexOf(t);n!==-1&&i.splice(n,1),!(i.length>0)&&(Kn.forEach(o=>{delete s[o]}),delete s._chartjs)}function Xn(s){const t=new Set(s);return t.size===s.length?s:Array.from(t)}const Gn=function(){return typeof window>"u"?function(s){return s()}:window.requestAnimationFrame}();function Jn(s,t){let e=[],i=!1;return function(...n){e=n,i||(i=!0,Gn.call(window,()=>{i=!1,s.apply(t,e)}))}}function Ja(s,t){let e;return function(...i){return t?(clearTimeout(e),e=setTimeout(s,t,i)):s.apply(this,i),t}}const Xs=s=>s==="start"?"left":s==="end"?"right":"center",J=(s,t,e)=>s==="start"?t:s==="end"?e:(t+e)/2,Qa=(s,t,e,i)=>s===(i?"left":"right")?e:s==="center"?(t+e)/2:t;function qa(s,t,e){const i=t.length;let n=0,o=i;if(s._sorted){const{iScale:r,_parsed:a}=s,l=r.axis,{min:c,max:h,minDefined:d,maxDefined:u}=r.getUserBounds();d&&(n=it(Math.min(Vt(a,l,c).lo,e?i:Vt(t,l,r.getPixelForValue(c)).lo),0,i-1)),u?o=it(Math.max(Vt(a,r.axis,h,!0).hi+1,e?0:Vt(t,l,r.getPixelForValue(h),!0).hi+1),n,i)-n:o=i-n}return{start:n,count:o}}function Za(s){const{xScale:t,yScale:e,_scaleRanges:i}=s,n={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!i)return s._scaleRanges=n,!0;const o=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==e.min||i.ymax!==e.max;return Object.assign(i,n),o}const He=s=>s===0||s===1,_i=(s,t,e)=>-(Math.pow(2,10*(s-=1))*Math.sin((s-t)*bt/e)),xi=(s,t,e)=>Math.pow(2,-10*s)*Math.sin((s-t)*bt/e)+1,ve={linear:s=>s,easeInQuad:s=>s*s,easeOutQuad:s=>-s*(s-2),easeInOutQuad:s=>(s/=.5)<1?.5*s*s:-.5*(--s*(s-2)-1),easeInCubic:s=>s*s*s,easeOutCubic:s=>(s-=1)*s*s+1,easeInOutCubic:s=>(s/=.5)<1?.5*s*s*s:.5*((s-=2)*s*s+2),easeInQuart:s=>s*s*s*s,easeOutQuart:s=>-((s-=1)*s*s*s-1),easeInOutQuart:s=>(s/=.5)<1?.5*s*s*s*s:-.5*((s-=2)*s*s*s-2),easeInQuint:s=>s*s*s*s*s,easeOutQuint:s=>(s-=1)*s*s*s*s+1,easeInOutQuint:s=>(s/=.5)<1?.5*s*s*s*s*s:.5*((s-=2)*s*s*s*s+2),easeInSine:s=>-Math.cos(s*dt)+1,easeOutSine:s=>Math.sin(s*dt),easeInOutSine:s=>-.5*(Math.cos(X*s)-1),easeInExpo:s=>s===0?0:Math.pow(2,10*(s-1)),easeOutExpo:s=>s===1?1:-Math.pow(2,-10*s)+1,easeInOutExpo:s=>He(s)?s:s<.5?.5*Math.pow(2,10*(s*2-1)):.5*(-Math.pow(2,-10*(s*2-1))+2),easeInCirc:s=>s>=1?s:-(Math.sqrt(1-s*s)-1),easeOutCirc:s=>Math.sqrt(1-(s-=1)*s),easeInOutCirc:s=>(s/=.5)<1?-.5*(Math.sqrt(1-s*s)-1):.5*(Math.sqrt(1-(s-=2)*s)+1),easeInElastic:s=>He(s)?s:_i(s,.075,.3),easeOutElastic:s=>He(s)?s:xi(s,.075,.3),easeInOutElastic(s){return He(s)?s:s<.5?.5*_i(s*2,.1125,.45):.5+.5*xi(s*2-1,.1125,.45)},easeInBack(s){return s*s*((1.70158+1)*s-1.70158)},easeOutBack(s){return(s-=1)*s*((1.70158+1)*s+1.70158)+1},easeInOutBack(s){let t=1.70158;return(s/=.5)<1?.5*(s*s*(((t*=1.525)+1)*s-t)):.5*((s-=2)*s*(((t*=1.525)+1)*s+t)+2)},easeInBounce:s=>1-ve.easeOutBounce(1-s),easeOutBounce(s){return s<1/2.75?7.5625*s*s:s<2/2.75?7.5625*(s-=1.5/2.75)*s+.75:s<2.5/2.75?7.5625*(s-=2.25/2.75)*s+.9375:7.5625*(s-=2.625/2.75)*s+.984375},easeInOutBounce:s=>s<.5?ve.easeInBounce(s*2)*.5:ve.easeOutBounce(s*2-1)*.5+.5};function Gs(s){if(s&&typeof s=="object"){const t=s.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function yi(s){return Gs(s)?s:new ke(s)}function fs(s){return Gs(s)?s:new ke(s).saturate(.5).darken(.1).hexString()}const tl=["x","y","borderWidth","radius","tension"],el=["color","borderColor","backgroundColor"];function sl(s){s.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),s.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),s.set("animations",{colors:{type:"color",properties:el},numbers:{type:"number",properties:tl}}),s.describe("animations",{_fallback:"animation"}),s.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function il(s){s.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const vi=new Map;function nl(s,t){t=t||{};const e=s+JSON.stringify(t);let i=vi.get(e);return i||(i=new Intl.NumberFormat(s,t),vi.set(e,i)),i}function Qn(s,t,e){return nl(t,e).format(s)}const qn={values(s){return K(s)?s:""+s},numeric(s,t,e){if(s===0)return"0";const i=this.chart.options.locale;let n,o=s;if(e.length>1){const c=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(c<1e-4||c>1e15)&&(n="scientific"),o=ol(s,e)}const r=Ds(Math.abs(o)),a=isNaN(r)?1:Math.max(Math.min(-1*Math.floor(r),20),0),l={notation:n,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),Qn(s,i,l)},logarithmic(s,t,e){if(s===0)return"0";const i=e[t].significand||s/Math.pow(10,Math.floor(Ds(s)));return[1,2,3,5,10,15].includes(i)||t>.8*e.length?qn.numeric.call(this,s,t,e):""}};function ol(s,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&s!==Math.floor(s)&&(e=s-Math.floor(s)),e}var Zn={formatters:qn};function rl(s){s.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Zn.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),s.route("scale.ticks","color","","color"),s.route("scale.grid","color","","borderColor"),s.route("scale.border","color","","borderColor"),s.route("scale.title","color","","color"),s.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),s.describe("scales",{_fallback:"scale"}),s.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const Yt=Object.create(null),Ts=Object.create(null);function Se(s,t){if(!t)return s;const e=t.split(".");for(let i=0,n=e.length;i<n;++i){const o=e[i];s=s[o]||(s[o]=Object.create(null))}return s}function gs(s,t,e){return typeof t=="string"?Pe(Se(s,t),e):Pe(Se(s,""),t)}class al{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=i=>i.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(i,n)=>fs(n.backgroundColor),this.hoverBorderColor=(i,n)=>fs(n.borderColor),this.hoverColor=(i,n)=>fs(n.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return gs(this,t,e)}get(t){return Se(this,t)}describe(t,e){return gs(Ts,t,e)}override(t,e){return gs(Yt,t,e)}route(t,e,i,n){const o=Se(this,t),r=Se(this,i),a="_"+e;Object.defineProperties(o,{[a]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[a],c=r[n];return R(l)?Object.assign({},c,l):I(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(e=>e(this))}}var U=new al({_scriptable:s=>!s.startsWith("on"),_indexable:s=>s!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[sl,il,rl]);function ll(s){return!s||$(s.size)||$(s.family)?null:(s.style?s.style+" ":"")+(s.weight?s.weight+" ":"")+s.size+"px "+s.family}function Si(s,t,e,i,n){let o=t[n];return o||(o=t[n]=s.measureText(n).width,e.push(n)),o>i&&(i=o),i}function Ft(s,t,e){const i=s.currentDevicePixelRatio,n=e!==0?Math.max(e/2,.5):0;return Math.round((t-n)*i)/i+n}function wi(s,t){!t&&!s||(t=t||s.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,s.width,s.height),t.restore())}function As(s,t,e,i){to(s,t,e,i,null)}function to(s,t,e,i,n){let o,r,a,l,c,h,d,u;const f=t.pointStyle,p=t.rotation,m=t.radius;let b=(p||0)*$a;if(f&&typeof f=="object"&&(o=f.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){s.save(),s.translate(e,i),s.rotate(b),s.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),s.restore();return}if(!(isNaN(m)||m<=0)){switch(s.beginPath(),f){default:n?s.ellipse(e,i,n/2,m,0,0,bt):s.arc(e,i,m,0,bt),s.closePath();break;case"triangle":h=n?n/2:m,s.moveTo(e+Math.sin(b)*h,i-Math.cos(b)*m),b+=gi,s.lineTo(e+Math.sin(b)*h,i-Math.cos(b)*m),b+=gi,s.lineTo(e+Math.sin(b)*h,i-Math.cos(b)*m),s.closePath();break;case"rectRounded":c=m*.516,l=m-c,r=Math.cos(b+Et)*l,d=Math.cos(b+Et)*(n?n/2-c:l),a=Math.sin(b+Et)*l,u=Math.sin(b+Et)*(n?n/2-c:l),s.arc(e-d,i-a,c,b-X,b-dt),s.arc(e+u,i-r,c,b-dt,b),s.arc(e+d,i+a,c,b,b+dt),s.arc(e-u,i+r,c,b+dt,b+X),s.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*m,h=n?n/2:l,s.rect(e-h,i-l,2*h,2*l);break}b+=Et;case"rectRot":d=Math.cos(b)*(n?n/2:m),r=Math.cos(b)*m,a=Math.sin(b)*m,u=Math.sin(b)*(n?n/2:m),s.moveTo(e-d,i-a),s.lineTo(e+u,i-r),s.lineTo(e+d,i+a),s.lineTo(e-u,i+r),s.closePath();break;case"crossRot":b+=Et;case"cross":d=Math.cos(b)*(n?n/2:m),r=Math.cos(b)*m,a=Math.sin(b)*m,u=Math.sin(b)*(n?n/2:m),s.moveTo(e-d,i-a),s.lineTo(e+d,i+a),s.moveTo(e+u,i-r),s.lineTo(e-u,i+r);break;case"star":d=Math.cos(b)*(n?n/2:m),r=Math.cos(b)*m,a=Math.sin(b)*m,u=Math.sin(b)*(n?n/2:m),s.moveTo(e-d,i-a),s.lineTo(e+d,i+a),s.moveTo(e+u,i-r),s.lineTo(e-u,i+r),b+=Et,d=Math.cos(b)*(n?n/2:m),r=Math.cos(b)*m,a=Math.sin(b)*m,u=Math.sin(b)*(n?n/2:m),s.moveTo(e-d,i-a),s.lineTo(e+d,i+a),s.moveTo(e+u,i-r),s.lineTo(e-u,i+r);break;case"line":r=n?n/2:Math.cos(b)*m,a=Math.sin(b)*m,s.moveTo(e-r,i-a),s.lineTo(e+r,i+a);break;case"dash":s.moveTo(e,i),s.lineTo(e+Math.cos(b)*(n?n/2:m),i+Math.sin(b)*m);break;case!1:s.closePath();break}s.fill(),t.borderWidth>0&&s.stroke()}}function De(s,t,e){return e=e||.5,!t||s&&s.x>t.left-e&&s.x<t.right+e&&s.y>t.top-e&&s.y<t.bottom+e}function Js(s,t){s.save(),s.beginPath(),s.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),s.clip()}function Qs(s){s.restore()}function cl(s,t,e,i,n){if(!t)return s.lineTo(e.x,e.y);if(n==="middle"){const o=(t.x+e.x)/2;s.lineTo(o,t.y),s.lineTo(o,e.y)}else n==="after"!=!!i?s.lineTo(t.x,e.y):s.lineTo(e.x,t.y);s.lineTo(e.x,e.y)}function hl(s,t,e,i){if(!t)return s.lineTo(e.x,e.y);s.bezierCurveTo(i?t.cp1x:t.cp2x,i?t.cp1y:t.cp2y,i?e.cp2x:e.cp1x,i?e.cp2y:e.cp1y,e.x,e.y)}function dl(s,t){t.translation&&s.translate(t.translation[0],t.translation[1]),$(t.rotation)||s.rotate(t.rotation),t.color&&(s.fillStyle=t.color),t.textAlign&&(s.textAlign=t.textAlign),t.textBaseline&&(s.textBaseline=t.textBaseline)}function ul(s,t,e,i,n){if(n.strikethrough||n.underline){const o=s.measureText(i),r=t-o.actualBoundingBoxLeft,a=t+o.actualBoundingBoxRight,l=e-o.actualBoundingBoxAscent,c=e+o.actualBoundingBoxDescent,h=n.strikethrough?(l+c)/2:c;s.strokeStyle=s.fillStyle,s.beginPath(),s.lineWidth=n.decorationWidth||2,s.moveTo(r,h),s.lineTo(a,h),s.stroke()}}function fl(s,t){const e=s.fillStyle;s.fillStyle=t.color,s.fillRect(t.left,t.top,t.width,t.height),s.fillStyle=e}function Oe(s,t,e,i,n,o={}){const r=K(t)?t:[t],a=o.strokeWidth>0&&o.strokeColor!=="";let l,c;for(s.save(),s.font=n.string,dl(s,o),l=0;l<r.length;++l)c=r[l],o.backdrop&&fl(s,o.backdrop),a&&(o.strokeColor&&(s.strokeStyle=o.strokeColor),$(o.strokeWidth)||(s.lineWidth=o.strokeWidth),s.strokeText(c,e,i,o.maxWidth)),s.fillText(c,e,i,o.maxWidth),ul(s,e,i,c,o),i+=Number(n.lineHeight);s.restore()}function ns(s,t){const{x:e,y:i,w:n,h:o,radius:r}=t;s.arc(e+r.topLeft,i+r.topLeft,r.topLeft,1.5*X,X,!0),s.lineTo(e,i+o-r.bottomLeft),s.arc(e+r.bottomLeft,i+o-r.bottomLeft,r.bottomLeft,X,dt,!0),s.lineTo(e+n-r.bottomRight,i+o),s.arc(e+n-r.bottomRight,i+o-r.bottomRight,r.bottomRight,dt,0,!0),s.lineTo(e+n,i+r.topRight),s.arc(e+n-r.topRight,i+r.topRight,r.topRight,0,-dt,!0),s.lineTo(e+r.topLeft,i)}const gl=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,pl=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function ml(s,t){const e=(""+s).match(gl);if(!e||e[1]==="normal")return t*1.2;switch(s=+e[2],e[3]){case"px":return s;case"%":s/=100;break}return t*s}const bl=s=>+s||0;function eo(s,t){const e={},i=R(t),n=i?Object.keys(t):t,o=R(s)?i?r=>I(s[r],s[t[r]]):r=>s[r]:()=>s;for(const r of n)e[r]=bl(o(r));return e}function so(s){return eo(s,{top:"y",right:"x",bottom:"y",left:"x"})}function te(s){return eo(s,["topLeft","topRight","bottomLeft","bottomRight"])}function ht(s){const t=so(s);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Q(s,t){s=s||{},t=t||U.font;let e=I(s.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let i=I(s.style,t.style);i&&!(""+i).match(pl)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const n={family:I(s.family,t.family),lineHeight:ml(I(s.lineHeight,t.lineHeight),e),size:e,style:i,weight:I(s.weight,t.weight),string:""};return n.string=ll(n),n}function Ne(s,t,e,i){let n,o,r;for(n=0,o=s.length;n<o;++n)if(r=s[n],r!==void 0&&r!==void 0)return r}function _l(s,t,e){const{min:i,max:n}=s,o=La(t,(n-i)/2),r=(a,l)=>e&&a===0?0:a+l;return{min:r(i,-Math.abs(o)),max:r(n,o)}}function Xt(s,t){return Object.assign(Object.create(s),t)}function qs(s,t=[""],e,i,n=()=>s[0]){const o=e||s;typeof i>"u"&&(i=ro("_fallback",s));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:s,_rootScopes:o,_fallback:i,_getTarget:n,override:a=>qs([a,...s],t,o,i)};return new Proxy(r,{deleteProperty(a,l){return delete a[l],delete a._keys,delete s[0][l],!0},get(a,l){return no(a,l,()=>Ml(l,t,s,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(s[0])},has(a,l){return Pi(a).includes(l)},ownKeys(a){return Pi(a)},set(a,l,c){const h=a._storage||(a._storage=n());return a[l]=h[l]=c,delete a._keys,!0}})}function ie(s,t,e,i){const n={_cacheable:!1,_proxy:s,_context:t,_subProxy:e,_stack:new Set,_descriptors:io(s,i),setContext:o=>ie(s,o,e,i),override:o=>ie(s.override(o),t,e,i)};return new Proxy(n,{deleteProperty(o,r){return delete o[r],delete s[r],!0},get(o,r,a){return no(o,r,()=>yl(o,r,a))},getOwnPropertyDescriptor(o,r){return o._descriptors.allKeys?Reflect.has(s,r)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(s,r)},getPrototypeOf(){return Reflect.getPrototypeOf(s)},has(o,r){return Reflect.has(s,r)},ownKeys(){return Reflect.ownKeys(s)},set(o,r,a){return s[r]=a,delete o[r],!0}})}function io(s,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:i=t.indexable,_allKeys:n=t.allKeys}=s;return{allKeys:n,scriptable:e,indexable:i,isScriptable:Tt(e)?e:()=>e,isIndexable:Tt(i)?i:()=>i}}const xl=(s,t)=>s?s+Ys(t):t,Zs=(s,t)=>R(t)&&s!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function no(s,t,e){if(Object.prototype.hasOwnProperty.call(s,t)||t==="constructor")return s[t];const i=e();return s[t]=i,i}function yl(s,t,e){const{_proxy:i,_context:n,_subProxy:o,_descriptors:r}=s;let a=i[t];return Tt(a)&&r.isScriptable(t)&&(a=vl(t,a,s,e)),K(a)&&a.length&&(a=Sl(t,a,s,r.isIndexable)),Zs(t,a)&&(a=ie(a,n,o&&o[t],r)),a}function vl(s,t,e,i){const{_proxy:n,_context:o,_subProxy:r,_stack:a}=e;if(a.has(s))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+s);a.add(s);let l=t(o,r||i);return a.delete(s),Zs(s,l)&&(l=ti(n._scopes,n,s,l)),l}function Sl(s,t,e,i){const{_proxy:n,_context:o,_subProxy:r,_descriptors:a}=e;if(typeof o.index<"u"&&i(s))return t[o.index%t.length];if(R(t[0])){const l=t,c=n._scopes.filter(h=>h!==l);t=[];for(const h of l){const d=ti(c,n,s,h);t.push(ie(d,o,r&&r[s],a))}}return t}function oo(s,t,e){return Tt(s)?s(t,e):s}const wl=(s,t)=>s===!0?t:typeof s=="string"?se(t,s):void 0;function kl(s,t,e,i,n){for(const o of t){const r=wl(e,o);if(r){s.add(r);const a=oo(r._fallback,e,n);if(typeof a<"u"&&a!==e&&a!==i)return a}else if(r===!1&&typeof i<"u"&&e!==i)return null}return!1}function ti(s,t,e,i){const n=t._rootScopes,o=oo(t._fallback,e,i),r=[...s,...n],a=new Set;a.add(i);let l=ki(a,r,e,o||e,i);return l===null||typeof o<"u"&&o!==e&&(l=ki(a,r,o,l,i),l===null)?!1:qs(Array.from(a),[""],n,o,()=>Pl(t,e,i))}function ki(s,t,e,i,n){for(;e;)e=kl(s,t,e,i,n);return e}function Pl(s,t,e){const i=s._getTarget();t in i||(i[t]={});const n=i[t];return K(n)&&R(e)?e:n||{}}function Ml(s,t,e,i){let n;for(const o of t)if(n=ro(xl(o,s),e),typeof n<"u")return Zs(s,n)?ti(e,i,s,n):n}function ro(s,t){for(const e of t){if(!e)continue;const i=e[s];if(typeof i<"u")return i}}function Pi(s){let t=s._keys;return t||(t=s._keys=Cl(s._scopes)),t}function Cl(s){const t=new Set;for(const e of s)for(const i of Object.keys(e).filter(n=>!n.startsWith("_")))t.add(i);return Array.from(t)}const Dl=Number.EPSILON||1e-14,ne=(s,t)=>t<s.length&&!s[t].skip&&s[t],ao=s=>s==="x"?"y":"x";function Ol(s,t,e,i){const n=s.skip?t:s,o=t,r=e.skip?t:e,a=Os(o,n),l=Os(r,o);let c=a/(a+l),h=l/(a+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const d=i*c,u=i*h;return{previous:{x:o.x-d*(r.x-n.x),y:o.y-d*(r.y-n.y)},next:{x:o.x+u*(r.x-n.x),y:o.y+u*(r.y-n.y)}}}function Tl(s,t,e){const i=s.length;let n,o,r,a,l,c=ne(s,0);for(let h=0;h<i-1;++h)if(l=c,c=ne(s,h+1),!(!l||!c)){if(ye(t[h],0,Dl)){e[h]=e[h+1]=0;continue}n=e[h]/t[h],o=e[h+1]/t[h],a=Math.pow(n,2)+Math.pow(o,2),!(a<=9)&&(r=3/Math.sqrt(a),e[h]=n*r*t[h],e[h+1]=o*r*t[h])}}function Al(s,t,e="x"){const i=ao(e),n=s.length;let o,r,a,l=ne(s,0);for(let c=0;c<n;++c){if(r=a,a=l,l=ne(s,c+1),!a)continue;const h=a[e],d=a[i];r&&(o=(h-r[e])/3,a[`cp1${e}`]=h-o,a[`cp1${i}`]=d-o*t[c]),l&&(o=(l[e]-h)/3,a[`cp2${e}`]=h+o,a[`cp2${i}`]=d+o*t[c])}}function Ll(s,t="x"){const e=ao(t),i=s.length,n=Array(i).fill(0),o=Array(i);let r,a,l,c=ne(s,0);for(r=0;r<i;++r)if(a=l,l=c,c=ne(s,r+1),!!l){if(c){const h=c[t]-l[t];n[r]=h!==0?(c[e]-l[e])/h:0}o[r]=a?c?_t(n[r-1])!==_t(n[r])?0:(n[r-1]+n[r])/2:n[r-1]:n[r]}Tl(s,n,o),Al(s,o,t)}function We(s,t,e){return Math.max(Math.min(s,e),t)}function Il(s,t){let e,i,n,o,r,a=De(s[0],t);for(e=0,i=s.length;e<i;++e)r=o,o=a,a=e<i-1&&De(s[e+1],t),o&&(n=s[e],r&&(n.cp1x=We(n.cp1x,t.left,t.right),n.cp1y=We(n.cp1y,t.top,t.bottom)),a&&(n.cp2x=We(n.cp2x,t.left,t.right),n.cp2y=We(n.cp2y,t.top,t.bottom)))}function Rl(s,t,e,i,n){let o,r,a,l;if(t.spanGaps&&(s=s.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")Ll(s,n);else{let c=i?s[s.length-1]:s[0];for(o=0,r=s.length;o<r;++o)a=s[o],l=Ol(c,a,s[Math.min(o+1,r-(i?0:1))%r],t.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,c=a}t.capBezierPoints&&Il(s,e)}function ei(){return typeof window<"u"&&typeof document<"u"}function si(s){let t=s.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function os(s,t,e){let i;return typeof s=="string"?(i=parseInt(s,10),s.indexOf("%")!==-1&&(i=i/100*t.parentNode[e])):i=s,i}const ls=s=>s.ownerDocument.defaultView.getComputedStyle(s,null);function El(s,t){return ls(s).getPropertyValue(t)}const Fl=["top","right","bottom","left"];function jt(s,t,e){const i={};e=e?"-"+e:"";for(let n=0;n<4;n++){const o=Fl[n];i[o]=parseFloat(s[t+"-"+o+e])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const Bl=(s,t,e)=>(s>0||t>0)&&(!e||!e.shadowRoot);function zl(s,t){const e=s.touches,i=e&&e.length?e[0]:s,{offsetX:n,offsetY:o}=i;let r=!1,a,l;if(Bl(n,o,s.target))a=n,l=o;else{const c=t.getBoundingClientRect();a=i.clientX-c.left,l=i.clientY-c.top,r=!0}return{x:a,y:l,box:r}}function zt(s,t){if("native"in s)return s;const{canvas:e,currentDevicePixelRatio:i}=t,n=ls(e),o=n.boxSizing==="border-box",r=jt(n,"padding"),a=jt(n,"border","width"),{x:l,y:c,box:h}=zl(s,e),d=r.left+(h&&a.left),u=r.top+(h&&a.top);let{width:f,height:p}=t;return o&&(f-=r.width+a.width,p-=r.height+a.height),{x:Math.round((l-d)/f*e.width/i),y:Math.round((c-u)/p*e.height/i)}}function $l(s,t,e){let i,n;if(t===void 0||e===void 0){const o=s&&si(s);if(!o)t=s.clientWidth,e=s.clientHeight;else{const r=o.getBoundingClientRect(),a=ls(o),l=jt(a,"border","width"),c=jt(a,"padding");t=r.width-c.width-l.width,e=r.height-c.height-l.height,i=os(a.maxWidth,o,"clientWidth"),n=os(a.maxHeight,o,"clientHeight")}}return{width:t,height:e,maxWidth:i||is,maxHeight:n||is}}const Ve=s=>Math.round(s*10)/10;function Hl(s,t,e,i){const n=ls(s),o=jt(n,"margin"),r=os(n.maxWidth,s,"clientWidth")||is,a=os(n.maxHeight,s,"clientHeight")||is,l=$l(s,t,e);let{width:c,height:h}=l;if(n.boxSizing==="content-box"){const u=jt(n,"border","width"),f=jt(n,"padding");c-=f.width+u.width,h-=f.height+u.height}return c=Math.max(0,c-o.width),h=Math.max(0,i?c/i:h-o.height),c=Ve(Math.min(c,r,l.maxWidth)),h=Ve(Math.min(h,a,l.maxHeight)),c&&!h&&(h=Ve(c/2)),(t!==void 0||e!==void 0)&&i&&l.height&&h>l.height&&(h=l.height,c=Ve(Math.floor(h*i))),{width:c,height:h}}function Mi(s,t,e){const i=t||1,n=Math.floor(s.height*i),o=Math.floor(s.width*i);s.height=Math.floor(s.height),s.width=Math.floor(s.width);const r=s.canvas;return r.style&&(e||!r.style.height&&!r.style.width)&&(r.style.height=`${s.height}px`,r.style.width=`${s.width}px`),s.currentDevicePixelRatio!==i||r.height!==n||r.width!==o?(s.currentDevicePixelRatio=i,r.height=n,r.width=o,s.ctx.setTransform(i,0,0,i,0,0),!0):!1}const Nl=function(){let s=!1;try{const t={get passive(){return s=!0,!1}};ei()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return s}();function Ci(s,t){const e=El(s,t),i=e&&e.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function $t(s,t,e,i){return{x:s.x+e*(t.x-s.x),y:s.y+e*(t.y-s.y)}}function Wl(s,t,e,i){return{x:s.x+e*(t.x-s.x),y:i==="middle"?e<.5?s.y:t.y:i==="after"?e<1?s.y:t.y:e>0?t.y:s.y}}function Vl(s,t,e,i){const n={x:s.cp2x,y:s.cp2y},o={x:t.cp1x,y:t.cp1y},r=$t(s,n,e),a=$t(n,o,e),l=$t(o,t,e),c=$t(r,a,e),h=$t(a,l,e);return $t(c,h,e)}const jl=function(s,t){return{x(e){return s+s+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,i){return e-i},leftForLtr(e,i){return e-i}}},Ul=function(){return{x(s){return s},setWidth(s){},textAlign(s){return s},xPlus(s,t){return s+t},leftForLtr(s,t){return s}}};function ee(s,t,e){return s?jl(t,e):Ul()}function lo(s,t){let e,i;(t==="ltr"||t==="rtl")&&(e=s.canvas.style,i=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),s.prevTextDirection=i)}function co(s,t){t!==void 0&&(delete s.prevTextDirection,s.canvas.style.setProperty("direction",t[0],t[1]))}function ho(s){return s==="angle"?{between:Yn,compare:Ua,normalize:kt}:{between:Wt,compare:(t,e)=>t-e,normalize:t=>t}}function Di({start:s,end:t,count:e,loop:i,style:n}){return{start:s%e,end:t%e,loop:i&&(t-s+1)%e===0,style:n}}function Yl(s,t,e){const{property:i,start:n,end:o}=e,{between:r,normalize:a}=ho(i),l=t.length;let{start:c,end:h,loop:d}=s,u,f;if(d){for(c+=l,h+=l,u=0,f=l;u<f&&r(a(t[c%l][i]),n,o);++u)c--,h--;c%=l,h%=l}return h<c&&(h+=l),{start:c,end:h,loop:d,style:s.style}}function Kl(s,t,e){if(!e)return[s];const{property:i,start:n,end:o}=e,r=t.length,{compare:a,between:l,normalize:c}=ho(i),{start:h,end:d,loop:u,style:f}=Yl(s,t,e),p=[];let m=!1,b=null,_,x,S;const P=()=>l(n,S,_)&&a(n,S)!==0,v=()=>a(o,_)===0||l(o,S,_),M=()=>m||P(),w=()=>!m||v();for(let k=h,y=h;k<=d;++k)x=t[k%r],!x.skip&&(_=c(x[i]),_!==S&&(m=l(_,n,o),b===null&&M()&&(b=a(_,n)===0?k:y),b!==null&&w()&&(p.push(Di({start:b,end:k,loop:u,count:r,style:f})),b=null),y=k,S=_));return b!==null&&p.push(Di({start:b,end:d,loop:u,count:r,style:f})),p}function Xl(s,t){const e=[],i=s.segments;for(let n=0;n<i.length;n++){const o=Kl(i[n],s.points,t);o.length&&e.push(...o)}return e}function Gl(s,t,e,i){let n=0,o=t-1;if(e&&!i)for(;n<t&&!s[n].skip;)n++;for(;n<t&&s[n].skip;)n++;for(n%=t,e&&(o+=n);o>n&&s[o%t].skip;)o--;return o%=t,{start:n,end:o}}function Jl(s,t,e,i){const n=s.length,o=[];let r=t,a=s[t],l;for(l=t+1;l<=e;++l){const c=s[l%n];c.skip||c.stop?a.skip||(i=!1,o.push({start:t%n,end:(l-1)%n,loop:i}),t=r=c.stop?l:null):(r=l,a.skip&&(t=l)),a=c}return r!==null&&o.push({start:t%n,end:r%n,loop:i}),o}function Ql(s,t){const e=s.points,i=s.options.spanGaps,n=e.length;if(!n)return[];const o=!!s._loop,{start:r,end:a}=Gl(e,n,o,i);if(i===!0)return Oi(s,[{start:r,end:a,loop:o}],e,t);const l=a<r?a+n:a,c=!!s._fullLoop&&r===0&&a===n-1;return Oi(s,Jl(e,r,l,c),e,t)}function Oi(s,t,e,i){return!i||!i.setContext||!e?t:ql(s,t,e,i)}function ql(s,t,e,i){const n=s._chart.getContext(),o=Ti(s.options),{_datasetIndex:r,options:{spanGaps:a}}=s,l=e.length,c=[];let h=o,d=t[0].start,u=d;function f(p,m,b,_){const x=a?-1:1;if(p!==m){for(p+=l;e[p%l].skip;)p-=x;for(;e[m%l].skip;)m+=x;p%l!==m%l&&(c.push({start:p%l,end:m%l,loop:b,style:_}),h=_,d=m%l)}}for(const p of t){d=a?d:p.start;let m=e[d%l],b;for(u=d+1;u<=p.end;u++){const _=e[u%l];b=Ti(i.setContext(Xt(n,{type:"segment",p0:m,p1:_,p0DataIndex:(u-1)%l,p1DataIndex:u%l,datasetIndex:r}))),Zl(b,h)&&f(d,u-1,p.loop,h),m=_,h=b}d<u-1&&f(d,u-1,p.loop,h)}return c}function Ti(s){return{backgroundColor:s.backgroundColor,borderCapStyle:s.borderCapStyle,borderDash:s.borderDash,borderDashOffset:s.borderDashOffset,borderJoinStyle:s.borderJoinStyle,borderWidth:s.borderWidth,borderColor:s.borderColor}}function Zl(s,t){if(!t)return!1;const e=[],i=function(n,o){return Gs(o)?(e.includes(o)||e.push(o),e.indexOf(o)):o};return JSON.stringify(s,i)!==JSON.stringify(t,i)}/*!
|
|
* Chart.js v4.4.4
|
|
* https://www.chartjs.org
|
|
* (c) 2024 Chart.js Contributors
|
|
* Released under the MIT License
|
|
*/class tc{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,n){const o=e.listeners[n],r=e.duration;o.forEach(a=>a({chart:t,initial:e.initial,numSteps:r,currentStep:Math.min(i-e.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=Gn.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,n)=>{if(!i.running||!i.items.length)return;const o=i.items;let r=o.length-1,a=!1,l;for(;r>=0;--r)l=o[r],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),a=!0):(o[r]=o[o.length-1],o.pop());a&&(n.draw(),this._notify(n,i,t,"progress")),o.length||(i.running=!1,this._notify(n,i,t,"complete"),i.initial=!1),e+=o.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((i,n)=>Math.max(i,n._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let n=i.length-1;for(;n>=0;--n)i[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var yt=new tc;const Ai="transparent",ec={boolean(s,t,e){return e>.5?t:s},color(s,t,e){const i=yi(s||Ai),n=i.valid&&yi(t||Ai);return n&&n.valid?n.mix(i,e).hexString():t},number(s,t,e){return s+(t-s)*e}};class sc{constructor(t,e,i,n){const o=e[i];n=Ne([t.to,n,o,t.from]);const r=Ne([t.from,o,n]);this._active=!0,this._fn=t.fn||ec[t.type||typeof r],this._easing=ve[t.easing]||ve.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=r,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const n=this._target[this._prop],o=i-this._start,r=this._duration-o;this._start=i,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=Ne([t.to,e,n,t.from]),this._from=Ne([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,n=this._prop,o=this._from,r=this._loop,a=this._to;let l;if(this._active=o!==a&&(r||e<i),!this._active){this._target[n]=a,this._notify(!0);return}if(e<0){this._target[n]=o;return}l=e/i%2,l=r&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[n]=this._fn(o,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let n=0;n<i.length;n++)i[n][e]()}}class uo{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!R(t))return;const e=Object.keys(U.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(n=>{const o=t[n];if(!R(o))return;const r={};for(const a of e)r[a]=o[a];(K(o.properties)&&o.properties||[n]).forEach(a=>{(a===n||!i.has(a))&&i.set(a,r)})})}_animateOptions(t,e){const i=e.options,n=nc(t,i);if(!n)return[];const o=this._createAnimations(n,i);return i.$shared&&ic(t.options.$animations,i).then(()=>{t.options=i},()=>{}),o}_createAnimations(t,e){const i=this._properties,n=[],o=t.$animations||(t.$animations={}),r=Object.keys(e),a=Date.now();let l;for(l=r.length-1;l>=0;--l){const c=r[l];if(c.charAt(0)==="$")continue;if(c==="options"){n.push(...this._animateOptions(t,e));continue}const h=e[c];let d=o[c];const u=i.get(c);if(d)if(u&&d.active()){d.update(u,h,a);continue}else d.cancel();if(!u||!u.duration){t[c]=h;continue}o[c]=d=new sc(u,t,c,h),n.push(d)}return n}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const i=this._createAnimations(t,e);if(i.length)return yt.add(this._chart,i),!0}}function ic(s,t){const e=[],i=Object.keys(t);for(let n=0;n<i.length;n++){const o=s[i[n]];o&&o.active()&&e.push(o.wait())}return Promise.all(e)}function nc(s,t){if(!t)return;let e=s.options;if(!e){s.options=t;return}return e.$shared&&(s.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function Li(s,t){const e=s&&s.options||{},i=e.reverse,n=e.min===void 0?t:0,o=e.max===void 0?t:0;return{start:i?o:n,end:i?n:o}}function oc(s,t,e){if(e===!1)return!1;const i=Li(s,e),n=Li(t,e);return{top:n.end,right:i.end,bottom:n.start,left:i.start}}function rc(s){let t,e,i,n;return R(s)?(t=s.top,e=s.right,i=s.bottom,n=s.left):t=e=i=n=s,{top:t,right:e,bottom:i,left:n,disabled:s===!1}}function fo(s,t){const e=[],i=s._getSortedDatasetMetas(t);let n,o;for(n=0,o=i.length;n<o;++n)e.push(i[n].index);return e}function Ii(s,t,e,i={}){const n=s.keys,o=i.mode==="single";let r,a,l,c;if(t!==null){for(r=0,a=n.length;r<a;++r){if(l=+n[r],l===e){if(i.all)continue;break}c=s.values[l],ct(c)&&(o||t===0||_t(t)===_t(c))&&(t+=c)}return t}}function ac(s,t){const{iScale:e,vScale:i}=t,n=e.axis==="x"?"x":"y",o=i.axis==="x"?"x":"y",r=Object.keys(s),a=new Array(r.length);let l,c,h;for(l=0,c=r.length;l<c;++l)h=r[l],a[l]={[n]:h,[o]:s[h]};return a}function Ri(s,t){const e=s&&s.options.stacked;return e||e===void 0&&t.stack!==void 0}function lc(s,t,e){return`${s.id}.${t.id}.${e.stack||e.type}`}function cc(s){const{min:t,max:e,minDefined:i,maxDefined:n}=s.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:n?e:Number.POSITIVE_INFINITY}}function hc(s,t,e){const i=s[t]||(s[t]={});return i[e]||(i[e]={})}function Ei(s,t,e,i){for(const n of t.getMatchingVisibleMetas(i).reverse()){const o=s[n.index];if(e&&o>0||!e&&o<0)return n.index}return null}function Fi(s,t){const{chart:e,_cachedMeta:i}=s,n=e._stacks||(e._stacks={}),{iScale:o,vScale:r,index:a}=i,l=o.axis,c=r.axis,h=lc(o,r,i),d=t.length;let u;for(let f=0;f<d;++f){const p=t[f],{[l]:m,[c]:b}=p,_=p._stacks||(p._stacks={});u=_[c]=hc(n,h,m),u[a]=b,u._top=Ei(u,r,!0,i.type),u._bottom=Ei(u,r,!1,i.type);const x=u._visualValues||(u._visualValues={});x[a]=b}}function ps(s,t){const e=s.scales;return Object.keys(e).filter(i=>e[i].axis===t).shift()}function dc(s,t){return Xt(s,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function uc(s,t,e){return Xt(s,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function ce(s,t){const e=s.controller.index,i=s.vScale&&s.vScale.axis;if(i){t=t||s._parsed;for(const n of t){const o=n._stacks;if(!o||o[i]===void 0||o[i][e]===void 0)return;delete o[i][e],o[i]._visualValues!==void 0&&o[i]._visualValues[e]!==void 0&&delete o[i]._visualValues[e]}}}const ms=s=>s==="reset"||s==="none",Bi=(s,t)=>t?s:Object.assign({},s),fc=(s,t,e)=>s&&!t.hidden&&t._stacked&&{keys:fo(e,!0),values:null};class ii{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Ri(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&ce(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),n=(d,u,f,p)=>d==="x"?u:d==="r"?p:f,o=e.xAxisID=I(i.xAxisID,ps(t,"x")),r=e.yAxisID=I(i.yAxisID,ps(t,"y")),a=e.rAxisID=I(i.rAxisID,ps(t,"r")),l=e.indexAxis,c=e.iAxisID=n(l,o,r,a),h=e.vAxisID=n(l,r,o,a);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(r),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(c),e.vScale=this.getScaleForId(h)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&bi(this._data,this),t._stacked&&ce(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(R(e)){const n=this._cachedMeta;this._data=ac(e,n)}else if(i!==e){if(i){bi(i,this);const n=this._cachedMeta;ce(n),n._parsed=[]}e&&Object.isExtensible(e)&&Ga(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let n=!1;this._dataCheck();const o=e._stacked;e._stacked=Ri(e.vScale,e),e.stack!==i.stack&&(n=!0,ce(e),e.stack=i.stack),this._resyncElements(t),(n||o!==e._stacked)&&Fi(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:n}=this,{iScale:o,_stacked:r}=i,a=o.axis;let l=t===0&&e===n.length?!0:i._sorted,c=t>0&&i._parsed[t-1],h,d,u;if(this._parsing===!1)i._parsed=n,i._sorted=!0,u=n;else{K(n[t])?u=this.parseArrayData(i,n,t,e):R(n[t])?u=this.parseObjectData(i,n,t,e):u=this.parsePrimitiveData(i,n,t,e);const f=()=>d[a]===null||c&&d[a]<c[a];for(h=0;h<e;++h)i._parsed[h+t]=d=u[h],l&&(f()&&(l=!1),c=d);i._sorted=l}r&&Fi(this,u)}parsePrimitiveData(t,e,i,n){const{iScale:o,vScale:r}=t,a=o.axis,l=r.axis,c=o.getLabels(),h=o===r,d=new Array(n);let u,f,p;for(u=0,f=n;u<f;++u)p=u+i,d[u]={[a]:h||o.parse(c[p],p),[l]:r.parse(e[p],p)};return d}parseArrayData(t,e,i,n){const{xScale:o,yScale:r}=t,a=new Array(n);let l,c,h,d;for(l=0,c=n;l<c;++l)h=l+i,d=e[h],a[l]={x:o.parse(d[0],h),y:r.parse(d[1],h)};return a}parseObjectData(t,e,i,n){const{xScale:o,yScale:r}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(n);let h,d,u,f;for(h=0,d=n;h<d;++h)u=h+i,f=e[u],c[h]={x:o.parse(se(f,a),u),y:r.parse(se(f,l),u)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const n=this.chart,o=this._cachedMeta,r=e[t.axis],a={keys:fo(n,!0),values:e._stacks[t.axis]._visualValues};return Ii(a,r,o.index,{mode:i})}updateRangeFromParsed(t,e,i,n){const o=i[e.axis];let r=o===null?NaN:o;const a=n&&i._stacks[e.axis];n&&a&&(n.values=a,r=Ii(n,o,this._cachedMeta.index)),t.min=Math.min(t.min,r),t.max=Math.max(t.max,r)}getMinMax(t,e){const i=this._cachedMeta,n=i._parsed,o=i._sorted&&t===i.iScale,r=n.length,a=this._getOtherScale(t),l=fc(e,i,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:d}=cc(a);let u,f;function p(){f=n[u];const m=f[a.axis];return!ct(f[t.axis])||h>m||d<m}for(u=0;u<r&&!(!p()&&(this.updateRangeFromParsed(c,t,f,l),o));++u);if(o){for(u=r-1;u>=0;--u)if(!p()){this.updateRangeFromParsed(c,t,f,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let n,o,r;for(n=0,o=e.length;n<o;++n)r=e[n][t.axis],ct(r)&&i.push(r);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,n=e.vScale,o=this.getParsed(t);return{label:i?""+i.getLabelForValue(o[i.axis]):"",value:n?""+n.getLabelForValue(o[n.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=rc(I(this.options.clip,oc(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,n=i.data||[],o=e.chartArea,r=[],a=this._drawStart||0,l=this._drawCount||n.length-a,c=this.options.drawActiveElementsOnTop;let h;for(i.dataset&&i.dataset.draw(t,o,a,l),h=a;h<a+l;++h){const d=n[h];d.hidden||(d.active&&c?r.push(d):d.draw(t,o))}for(h=0;h<r.length;++h)r[h].draw(t,o)}getStyle(t,e){const i=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const n=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const r=this._cachedMeta.data[t];o=r.$context||(r.$context=uc(this.getContext(),t,r)),o.parsed=this.getParsed(t),o.raw=n.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=dc(this.chart.getContext(),this.index)),o.dataset=n,o.index=o.datasetIndex=this.index;return o.active=!!e,o.mode=i,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){const n=e==="active",o=this._cachedDataOpts,r=t+"-"+e,a=o[r],l=this.enableOptionSharing&&Me(i);if(a)return Bi(a,l);const c=this.chart.config,h=c.datasetElementScopeKeys(this._type,t),d=n?[`${t}Hover`,"hover",t,""]:[t,""],u=c.getOptionScopes(this.getDataset(),h),f=Object.keys(U.elements[t]),p=()=>this.getContext(i,n,e),m=c.resolveNamedOptions(u,f,p,d);return m.$shared&&(m.$shared=l,o[r]=Object.freeze(Bi(m,l))),m}_resolveAnimations(t,e,i){const n=this.chart,o=this._cachedDataOpts,r=`animation-${e}`,a=o[r];if(a)return a;let l;if(n.options.animation!==!1){const h=this.chart.config,d=h.datasetAnimationScopeKeys(this._type,e),u=h.getOptionScopes(this.getDataset(),d);l=h.createResolver(u,this.getContext(t,i,e))}const c=new uo(n,l&&l.animations);return l&&l._cacheable&&(o[r]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||ms(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),n=this._sharedOptions,o=this.getSharedOptions(i),r=this.includeOptions(e,o)||o!==n;return this.updateSharedOptions(o,e,i),{sharedOptions:o,includeOptions:r}}updateElement(t,e,i,n){ms(n)?Object.assign(t,i):this._resolveAnimations(e,n).update(t,i)}updateSharedOptions(t,e,i){t&&!ms(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,n){t.active=n;const o=this.getStyle(e,n);this._resolveAnimations(e,i,n).update(t,{options:!n&&this.getSharedOptions(o)||o})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const n=i.length,o=e.length,r=Math.min(o,n);r&&this.parse(0,r),o>n?this._insertElements(n,o-n,t):o<n&&this._removeElements(o,n-o)}_insertElements(t,e,i=!0){const n=this._cachedMeta,o=n.data,r=t+e;let a;const l=c=>{for(c.length+=e,a=c.length-1;a>=r;a--)c[a]=c[a-e]};for(l(o),a=t;a<r;++a)o[a]=new this.dataElementType;this._parsing&&l(n._parsed),this.parse(t,e),i&&this.updateElements(o,t,e,"reset")}updateElements(t,e,i,n){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const n=i._parsed.splice(t,e);i._stacked&&ce(i,n)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,n]=t;this[e](i,n)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function gc(s,t){if(!s._cache.$bar){const e=s.getMatchingVisibleMetas(t);let i=[];for(let n=0,o=e.length;n<o;n++)i=i.concat(e[n].controller.getAllParsedValues(s));s._cache.$bar=Xn(i.sort((n,o)=>n-o))}return s._cache.$bar}function pc(s){const t=s.iScale,e=gc(t,s.type);let i=t._length,n,o,r,a;const l=()=>{r===32767||r===-32768||(Me(a)&&(i=Math.min(i,Math.abs(r-a)||i)),a=r)};for(n=0,o=e.length;n<o;++n)r=t.getPixelForValue(e[n]),l();for(a=void 0,n=0,o=t.ticks.length;n<o;++n)r=t.getPixelForTick(n),l();return i}function mc(s,t,e,i){const n=e.barThickness;let o,r;return $(n)?(o=t.min*e.categoryPercentage,r=e.barPercentage):(o=n*i,r=1),{chunk:o/i,ratio:r,start:t.pixels[s]-o/2}}function bc(s,t,e,i){const n=t.pixels,o=n[s];let r=s>0?n[s-1]:null,a=s<n.length-1?n[s+1]:null;const l=e.categoryPercentage;r===null&&(r=o-(a===null?t.end-t.start:a-o)),a===null&&(a=o+o-r);const c=o-(o-Math.min(r,a))/2*l;return{chunk:Math.abs(a-r)/2*l/i,ratio:e.barPercentage,start:c}}function _c(s,t,e,i){const n=e.parse(s[0],i),o=e.parse(s[1],i),r=Math.min(n,o),a=Math.max(n,o);let l=r,c=a;Math.abs(r)>Math.abs(a)&&(l=a,c=r),t[e.axis]=c,t._custom={barStart:l,barEnd:c,start:n,end:o,min:r,max:a}}function go(s,t,e,i){return K(s)?_c(s,t,e,i):t[e.axis]=e.parse(s,i),t}function zi(s,t,e,i){const n=s.iScale,o=s.vScale,r=n.getLabels(),a=n===o,l=[];let c,h,d,u;for(c=e,h=e+i;c<h;++c)u=t[c],d={},d[n.axis]=a||n.parse(r[c],c),l.push(go(u,d,o,c));return l}function bs(s){return s&&s.barStart!==void 0&&s.barEnd!==void 0}function xc(s,t,e){return s!==0?_t(s):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function yc(s){let t,e,i,n,o;return s.horizontal?(t=s.base>s.x,e="left",i="right"):(t=s.base<s.y,e="bottom",i="top"),t?(n="end",o="start"):(n="start",o="end"),{start:e,end:i,reverse:t,top:n,bottom:o}}function vc(s,t,e,i){let n=t.borderSkipped;const o={};if(!n){s.borderSkipped=o;return}if(n===!0){s.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:r,end:a,reverse:l,top:c,bottom:h}=yc(s);n==="middle"&&e&&(s.enableBorderRadius=!0,(e._top||0)===i?n=c:(e._bottom||0)===i?n=h:(o[$i(h,r,a,l)]=!0,n=c)),o[$i(n,r,a,l)]=!0,s.borderSkipped=o}function $i(s,t,e,i){return i?(s=Sc(s,t,e),s=Hi(s,e,t)):s=Hi(s,t,e),s}function Sc(s,t,e){return s===t?e:s===e?t:s}function Hi(s,t,e){return s==="start"?t:s==="end"?e:s}function wc(s,{inflateAmount:t},e){s.inflateAmount=t==="auto"?e===1?.33:0:t}class po extends ii{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(t,e,i,n){return zi(t,e,i,n)}parseArrayData(t,e,i,n){return zi(t,e,i,n)}parseObjectData(t,e,i,n){const{iScale:o,vScale:r}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=o.axis==="x"?a:l,h=r.axis==="x"?a:l,d=[];let u,f,p,m;for(u=i,f=i+n;u<f;++u)m=e[u],p={},p[o.axis]=o.parse(se(m,c),u),d.push(go(se(m,h),p,r,u));return d}updateRangeFromParsed(t,e,i,n){super.updateRangeFromParsed(t,e,i,n);const o=i._custom;o&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,o.min),t.max=Math.max(t.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:i,vScale:n}=e,o=this.getParsed(t),r=o._custom,a=bs(r)?"["+r.start+", "+r.end+"]":""+n.getLabelForValue(o[n.axis]);return{label:""+i.getLabelForValue(o[i.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,i,n){const o=n==="reset",{index:r,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),c=a.isHorizontal(),h=this._getRuler(),{sharedOptions:d,includeOptions:u}=this._getSharedOptions(e,n);for(let f=e;f<e+i;f++){const p=this.getParsed(f),m=o||$(p[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(f),b=this._calculateBarIndexPixels(f,h),_=(p._stacks||{})[a.axis],x={horizontal:c,base:m.base,enableBorderRadius:!_||bs(p._custom)||r===_._top||r===_._bottom,x:c?m.head:b.center,y:c?b.center:m.head,height:c?b.size:Math.abs(m.size),width:c?Math.abs(m.size):b.size};u&&(x.options=d||this.resolveDataElementOptions(f,t[f].active?"active":n));const S=x.options||t[f].options;vc(x,S,_,r),wc(x,S,h.ratio),this.updateElement(t[f],f,x,n)}}_getStacks(t,e){const{iScale:i}=this._cachedMeta,n=i.getMatchingVisibleMetas(this._type).filter(h=>h.controller.options.grouped),o=i.options.stacked,r=[],a=this._cachedMeta.controller.getParsed(e),l=a&&a[i.axis],c=h=>{const d=h._parsed.find(f=>f[i.axis]===l),u=d&&d[h.vScale.axis];if($(u)||isNaN(u))return!0};for(const h of n)if(!(e!==void 0&&c(h))&&((o===!1||r.indexOf(h.stack)===-1||o===void 0&&h.stack===void 0)&&r.push(h.stack),h.index===t))break;return r.length||r.push(void 0),r}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){const n=this._getStacks(t,i),o=e!==void 0?n.indexOf(e):-1;return o===-1?n.length-1:o}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,n=[];let o,r;for(o=0,r=e.data.length;o<r;++o)n.push(i.getPixelForValue(this.getParsed(o)[i.axis],o));const a=t.barThickness;return{min:a||pc(e),pixels:n,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i,index:n},options:{base:o,minBarLength:r}}=this,a=o||0,l=this.getParsed(t),c=l._custom,h=bs(c);let d=l[e.axis],u=0,f=i?this.applyStack(e,l,i):d,p,m;f!==d&&(u=f-d,f=d),h&&(d=c.barStart,f=c.barEnd-c.barStart,d!==0&&_t(d)!==_t(c.barEnd)&&(u=0),u+=d);const b=!$(o)&&!h?o:u;let _=e.getPixelForValue(b);if(this.chart.getDataVisibility(t)?p=e.getPixelForValue(u+f):p=_,m=p-_,Math.abs(m)<r){m=xc(m,e,a)*r,d===a&&(_-=m/2);const x=e.getPixelForDecimal(0),S=e.getPixelForDecimal(1),P=Math.min(x,S),v=Math.max(x,S);_=Math.max(Math.min(_,v),P),p=_+m,i&&!h&&(l._stacks[e.axis]._visualValues[n]=e.getValueForPixel(p)-e.getValueForPixel(_))}if(_===e.getPixelForValue(a)){const x=_t(m)*e.getLineWidthForValue(a)/2;_+=x,m-=x}return{size:m,base:_,head:p,center:p+m/2}}_calculateBarIndexPixels(t,e){const i=e.scale,n=this.options,o=n.skipNull,r=I(n.maxBarThickness,1/0);let a,l;if(e.grouped){const c=o?this._getStackCount(t):e.stackCount,h=n.barThickness==="flex"?bc(t,e,n,c):mc(t,e,n,c),d=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0);a=h.start+h.chunk*d+h.chunk/2,l=Math.min(r,h.chunk*h.ratio)}else a=i.getPixelForValue(this.getParsed(t)[i.axis],t),l=Math.min(r,e.min*e.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){const t=this._cachedMeta,e=t.vScale,i=t.data,n=i.length;let o=0;for(;o<n;++o)this.getParsed(o)[e.axis]!==null&&!i[o].hidden&&i[o].draw(this._ctx)}}class mo extends ii{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:n=[],_dataset:o}=e,r=this.chart._animationsDisabled;let{start:a,count:l}=qa(e,n,r);this._drawStart=a,this._drawCount=l,Za(e)&&(a=0,l=n.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!o._decimated,i.points=n;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(i,void 0,{animated:!r,options:c},t),this.updateElements(n,a,l,t)}updateElements(t,e,i,n){const o=n==="reset",{iScale:r,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:h,includeOptions:d}=this._getSharedOptions(e,n),u=r.axis,f=a.axis,{spanGaps:p,segment:m}=this.options,b=Ce(p)?p:Number.POSITIVE_INFINITY,_=this.chart._animationsDisabled||o||n==="none",x=e+i,S=t.length;let P=e>0&&this.getParsed(e-1);for(let v=0;v<S;++v){const M=t[v],w=_?M:{};if(v<e||v>=x){w.skip=!0;continue}const k=this.getParsed(v),y=$(k[f]),A=w[u]=r.getPixelForValue(k[u],v),T=w[f]=o||y?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,k,l):k[f],v);w.skip=isNaN(A)||isNaN(T)||y,w.stop=v>0&&Math.abs(k[u]-P[u])>b,m&&(w.parsed=k,w.raw=c.data[v]),d&&(w.options=h||this.resolveDataElementOptions(v,M.active?"active":n)),_||this.updateElement(M,v,w,n),P=k}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return i;const o=n[0].size(this.resolveDataElementOptions(0)),r=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,o,r)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}function Bt(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class ni{static override(t){Object.assign(ni.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return Bt()}parse(){return Bt()}format(){return Bt()}add(){return Bt()}diff(){return Bt()}startOf(){return Bt()}endOf(){return Bt()}}var kc={_date:ni};function Pc(s,t,e,i){const{controller:n,data:o,_sorted:r}=s,a=n._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&r&&o.length){const l=a._reversePixels?Ka:Vt;if(i){if(n._sharedOptions){const c=o[0],h=typeof c.getRange=="function"&&c.getRange(t);if(h){const d=l(o,t,e-h),u=l(o,t,e+h);return{lo:d.lo,hi:u.hi}}}}else return l(o,t,e)}return{lo:0,hi:o.length-1}}function Ie(s,t,e,i,n){const o=s.getSortedVisibleDatasetMetas(),r=e[t];for(let a=0,l=o.length;a<l;++a){const{index:c,data:h}=o[a],{lo:d,hi:u}=Pc(o[a],t,r,n);for(let f=d;f<=u;++f){const p=h[f];p.skip||i(p,c,f)}}}function Mc(s){const t=s.indexOf("x")!==-1,e=s.indexOf("y")!==-1;return function(i,n){const o=t?Math.abs(i.x-n.x):0,r=e?Math.abs(i.y-n.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(r,2))}}function _s(s,t,e,i,n){const o=[];return!n&&!s.isPointInArea(t)||Ie(s,e,t,function(a,l,c){!n&&!De(a,s.chartArea,0)||a.inRange(t.x,t.y,i)&&o.push({element:a,datasetIndex:l,index:c})},!0),o}function Cc(s,t,e,i){let n=[];function o(r,a,l){const{startAngle:c,endAngle:h}=r.getProps(["startAngle","endAngle"],i),{angle:d}=ja(r,{x:t.x,y:t.y});Yn(d,c,h)&&n.push({element:r,datasetIndex:a,index:l})}return Ie(s,e,t,o),n}function Dc(s,t,e,i,n,o){let r=[];const a=Mc(e);let l=Number.POSITIVE_INFINITY;function c(h,d,u){const f=h.inRange(t.x,t.y,n);if(i&&!f)return;const p=h.getCenterPoint(n);if(!(!!o||s.isPointInArea(p))&&!f)return;const b=a(t,p);b<l?(r=[{element:h,datasetIndex:d,index:u}],l=b):b===l&&r.push({element:h,datasetIndex:d,index:u})}return Ie(s,e,t,c),r}function xs(s,t,e,i,n,o){return!o&&!s.isPointInArea(t)?[]:e==="r"&&!i?Cc(s,t,e,n):Dc(s,t,e,i,n,o)}function Ni(s,t,e,i,n){const o=[],r=e==="x"?"inXRange":"inYRange";let a=!1;return Ie(s,e,t,(l,c,h)=>{l[r]&&l[r](t[e],n)&&(o.push({element:l,datasetIndex:c,index:h}),a=a||l.inRange(t.x,t.y,n))}),i&&!a?[]:o}var Oc={evaluateInteractionItems:Ie,modes:{index(s,t,e,i){const n=zt(t,s),o=e.axis||"x",r=e.includeInvisible||!1,a=e.intersect?_s(s,n,o,i,r):xs(s,n,o,!1,i,r),l=[];return a.length?(s.getSortedVisibleDatasetMetas().forEach(c=>{const h=a[0].index,d=c.data[h];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:h})}),l):[]},dataset(s,t,e,i){const n=zt(t,s),o=e.axis||"xy",r=e.includeInvisible||!1;let a=e.intersect?_s(s,n,o,i,r):xs(s,n,o,!1,i,r);if(a.length>0){const l=a[0].datasetIndex,c=s.getDatasetMeta(l).data;a=[];for(let h=0;h<c.length;++h)a.push({element:c[h],datasetIndex:l,index:h})}return a},point(s,t,e,i){const n=zt(t,s),o=e.axis||"xy",r=e.includeInvisible||!1;return _s(s,n,o,i,r)},nearest(s,t,e,i){const n=zt(t,s),o=e.axis||"xy",r=e.includeInvisible||!1;return xs(s,n,o,e.intersect,i,r)},x(s,t,e,i){const n=zt(t,s);return Ni(s,n,"x",e.intersect,i)},y(s,t,e,i){const n=zt(t,s);return Ni(s,n,"y",e.intersect,i)}}};const bo=["left","top","right","bottom"];function he(s,t){return s.filter(e=>e.pos===t)}function Wi(s,t){return s.filter(e=>bo.indexOf(e.pos)===-1&&e.box.axis===t)}function de(s,t){return s.sort((e,i)=>{const n=t?i:e,o=t?e:i;return n.weight===o.weight?n.index-o.index:n.weight-o.weight})}function Tc(s){const t=[];let e,i,n,o,r,a;for(e=0,i=(s||[]).length;e<i;++e)n=s[e],{position:o,options:{stack:r,stackWeight:a=1}}=n,t.push({index:e,box:n,pos:o,horizontal:n.isHorizontal(),weight:n.weight,stack:r&&o+r,stackWeight:a});return t}function Ac(s){const t={};for(const e of s){const{stack:i,pos:n,stackWeight:o}=e;if(!i||!bo.includes(n))continue;const r=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});r.count++,r.weight+=o}return t}function Lc(s,t){const e=Ac(s),{vBoxMaxWidth:i,hBoxMaxHeight:n}=t;let o,r,a;for(o=0,r=s.length;o<r;++o){a=s[o];const{fullSize:l}=a.box,c=e[a.stack],h=c&&a.stackWeight/c.weight;a.horizontal?(a.width=h?h*i:l&&t.availableWidth,a.height=n):(a.width=i,a.height=h?h*n:l&&t.availableHeight)}return e}function Ic(s){const t=Tc(s),e=de(t.filter(c=>c.box.fullSize),!0),i=de(he(t,"left"),!0),n=de(he(t,"right")),o=de(he(t,"top"),!0),r=de(he(t,"bottom")),a=Wi(t,"x"),l=Wi(t,"y");return{fullSize:e,leftAndTop:i.concat(o),rightAndBottom:n.concat(l).concat(r).concat(a),chartArea:he(t,"chartArea"),vertical:i.concat(n).concat(l),horizontal:o.concat(r).concat(a)}}function Vi(s,t,e,i){return Math.max(s[e],t[e])+Math.max(s[i],t[i])}function _o(s,t){s.top=Math.max(s.top,t.top),s.left=Math.max(s.left,t.left),s.bottom=Math.max(s.bottom,t.bottom),s.right=Math.max(s.right,t.right)}function Rc(s,t,e,i){const{pos:n,box:o}=e,r=s.maxPadding;if(!R(n)){e.size&&(s[n]-=e.size);const d=i[e.stack]||{size:0,count:1};d.size=Math.max(d.size,e.horizontal?o.height:o.width),e.size=d.size/d.count,s[n]+=e.size}o.getPadding&&_o(r,o.getPadding());const a=Math.max(0,t.outerWidth-Vi(r,s,"left","right")),l=Math.max(0,t.outerHeight-Vi(r,s,"top","bottom")),c=a!==s.w,h=l!==s.h;return s.w=a,s.h=l,e.horizontal?{same:c,other:h}:{same:h,other:c}}function Ec(s){const t=s.maxPadding;function e(i){const n=Math.max(t[i]-s[i],0);return s[i]+=n,n}s.y+=e("top"),s.x+=e("left"),e("right"),e("bottom")}function Fc(s,t){const e=t.maxPadding;function i(n){const o={left:0,top:0,right:0,bottom:0};return n.forEach(r=>{o[r]=Math.max(t[r],e[r])}),o}return i(s?["left","right"]:["top","bottom"])}function me(s,t,e,i){const n=[];let o,r,a,l,c,h;for(o=0,r=s.length,c=0;o<r;++o){a=s[o],l=a.box,l.update(a.width||t.w,a.height||t.h,Fc(a.horizontal,t));const{same:d,other:u}=Rc(t,e,a,i);c|=d&&n.length,h=h||u,l.fullSize||n.push(a)}return c&&me(n,t,e,i)||h}function je(s,t,e,i,n){s.top=e,s.left=t,s.right=t+i,s.bottom=e+n,s.width=i,s.height=n}function ji(s,t,e,i){const n=e.padding;let{x:o,y:r}=t;for(const a of s){const l=a.box,c=i[a.stack]||{count:1,placed:0,weight:1},h=a.stackWeight/c.weight||1;if(a.horizontal){const d=t.w*h,u=c.size||l.height;Me(c.start)&&(r=c.start),l.fullSize?je(l,n.left,r,e.outerWidth-n.right-n.left,u):je(l,t.left+c.placed,r,d,u),c.start=r,c.placed+=d,r=l.bottom}else{const d=t.h*h,u=c.size||l.width;Me(c.start)&&(o=c.start),l.fullSize?je(l,o,n.top,u,e.outerHeight-n.bottom-n.top):je(l,o,t.top+c.placed,u,d),c.start=o,c.placed+=d,o=l.right}}t.x=o,t.y=r}var lt={addBox(s,t){s.boxes||(s.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},s.boxes.push(t)},removeBox(s,t){const e=s.boxes?s.boxes.indexOf(t):-1;e!==-1&&s.boxes.splice(e,1)},configure(s,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(s,t,e,i){if(!s)return;const n=ht(s.options.layout.padding),o=Math.max(t-n.width,0),r=Math.max(e-n.height,0),a=Ic(s.boxes),l=a.vertical,c=a.horizontal;F(s.boxes,m=>{typeof m.beforeLayout=="function"&&m.beforeLayout()});const h=l.reduce((m,b)=>b.box.options&&b.box.options.display===!1?m:m+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:e,padding:n,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/h,hBoxMaxHeight:r/2}),u=Object.assign({},n);_o(u,ht(i));const f=Object.assign({maxPadding:u,w:o,h:r,x:n.left,y:n.top},n),p=Lc(l.concat(c),d);me(a.fullSize,f,d,p),me(l,f,d,p),me(c,f,d,p)&&me(l,f,d,p),Ec(f),ji(a.leftAndTop,f,d,p),f.x+=f.w,f.y+=f.h,ji(a.rightAndBottom,f,d,p),s.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},F(a.chartArea,m=>{const b=m.box;Object.assign(b,s.chartArea),b.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class xo{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,n){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):i)}}isAttached(t){return!0}updateConfig(t){}}class Bc extends xo{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Ze="$chartjs",zc={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Ui=s=>s===null||s==="";function $c(s,t){const e=s.style,i=s.getAttribute("height"),n=s.getAttribute("width");if(s[Ze]={initial:{height:i,width:n,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",Ui(n)){const o=Ci(s,"width");o!==void 0&&(s.width=o)}if(Ui(i))if(s.style.height==="")s.height=s.width/(t||2);else{const o=Ci(s,"height");o!==void 0&&(s.height=o)}return s}const yo=Nl?{passive:!0}:!1;function Hc(s,t,e){s&&s.addEventListener(t,e,yo)}function Nc(s,t,e){s&&s.canvas&&s.canvas.removeEventListener(t,e,yo)}function Wc(s,t){const e=zc[s.type]||s.type,{x:i,y:n}=zt(s,t);return{type:e,chart:t,native:s,x:i!==void 0?i:null,y:n!==void 0?n:null}}function rs(s,t){for(const e of s)if(e===t||e.contains(t))return!0}function Vc(s,t,e){const i=s.canvas,n=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||rs(a.addedNodes,i),r=r&&!rs(a.removedNodes,i);r&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}function jc(s,t,e){const i=s.canvas,n=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||rs(a.removedNodes,i),r=r&&!rs(a.addedNodes,i);r&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}const Te=new Map;let Yi=0;function vo(){const s=window.devicePixelRatio;s!==Yi&&(Yi=s,Te.forEach((t,e)=>{e.currentDevicePixelRatio!==s&&t()}))}function Uc(s,t){Te.size||window.addEventListener("resize",vo),Te.set(s,t)}function Yc(s){Te.delete(s),Te.size||window.removeEventListener("resize",vo)}function Kc(s,t,e){const i=s.canvas,n=i&&si(i);if(!n)return;const o=Jn((a,l)=>{const c=n.clientWidth;e(a,l),c<n.clientWidth&&e()},window),r=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,h=l.contentRect.height;c===0&&h===0||o(c,h)});return r.observe(n),Uc(s,o),r}function ys(s,t,e){e&&e.disconnect(),t==="resize"&&Yc(s)}function Xc(s,t,e){const i=s.canvas,n=Jn(o=>{s.ctx!==null&&e(Wc(o,s))},s);return Hc(i,t,n),n}class Gc extends xo{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?($c(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[Ze])return!1;const i=e[Ze].initial;["height","width"].forEach(o=>{const r=i[o];$(r)?e.removeAttribute(o):e.setAttribute(o,r)});const n=i.style||{};return Object.keys(n).forEach(o=>{e.style[o]=n[o]}),e.width=e.width,delete e[Ze],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),r={attach:Vc,detach:jc,resize:Kc}[e]||Xc;n[e]=r(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),n=i[e];if(!n)return;({attach:ys,detach:ys,resize:ys}[e]||Nc)(t,e,n),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,n){return Hl(t,e,i,n)}isAttached(t){const e=t&&si(t);return!!(e&&e.isConnected)}}function Jc(s){return!ei()||typeof OffscreenCanvas<"u"&&s instanceof OffscreenCanvas?Bc:Gc}class At{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return Ce(this.x)&&Ce(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const n={};return t.forEach(o=>{n[o]=i[o]&&i[o].active()?i[o]._to:this[o]}),n}}function Qc(s,t){const e=s.options.ticks,i=qc(s),n=Math.min(e.maxTicksLimit||i,i),o=e.major.enabled?th(t):[],r=o.length,a=o[0],l=o[r-1],c=[];if(r>n)return eh(t,c,o,r/n),c;const h=Zc(o,t,n);if(r>0){let d,u;const f=r>1?Math.round((l-a)/(r-1)):null;for(Ue(t,c,h,$(f)?0:a-f,a),d=0,u=r-1;d<u;d++)Ue(t,c,h,o[d],o[d+1]);return Ue(t,c,h,l,$(f)?t.length:l+f),c}return Ue(t,c,h),c}function qc(s){const t=s.options.offset,e=s._tickSize(),i=s._length/e+(t?0:1),n=s._maxLength/e;return Math.floor(Math.min(i,n))}function Zc(s,t,e){const i=sh(s),n=t.length/e;if(!i)return Math.max(n,1);const o=Ha(i);for(let r=0,a=o.length-1;r<a;r++){const l=o[r];if(l>n)return l}return Math.max(n,1)}function th(s){const t=[];let e,i;for(e=0,i=s.length;e<i;e++)s[e].major&&t.push(e);return t}function eh(s,t,e,i){let n=0,o=e[0],r;for(i=Math.ceil(i),r=0;r<s.length;r++)r===o&&(t.push(s[r]),n++,o=e[n*i])}function Ue(s,t,e,i,n){const o=I(i,0),r=Math.min(I(n,s.length),s.length);let a=0,l,c,h;for(e=Math.ceil(e),n&&(l=n-i,e=l/Math.floor(l/e)),h=o;h<0;)a++,h=Math.round(o+a*e);for(c=Math.max(o,0);c<r;c++)c===h&&(t.push(s[c]),a++,h=Math.round(o+a*e))}function sh(s){const t=s.length;let e,i;if(t<2)return!1;for(i=s[0],e=1;e<t;++e)if(s[e]-s[e-1]!==i)return!1;return i}const ih=s=>s==="left"?"right":s==="right"?"left":s,Ki=(s,t,e)=>t==="top"||t==="left"?s[t]+e:s[t]-e,Xi=(s,t)=>Math.min(t||s,s);function Gi(s,t){const e=[],i=s.length/t,n=s.length;let o=0;for(;o<n;o+=i)e.push(s[Math.floor(o)]);return e}function nh(s,t,e){const i=s.ticks.length,n=Math.min(t,i-1),o=s._startPixel,r=s._endPixel,a=1e-6;let l=s.getPixelForTick(n),c;if(!(e&&(i===1?c=Math.max(l-o,r-l):t===0?c=(s.getPixelForTick(1)-l)/2:c=(l-s.getPixelForTick(n-1))/2,l+=n<t?c:-c,l<o-a||l>r+a)))return l}function oh(s,t){F(s,e=>{const i=e.gc,n=i.length/2;let o;if(n>t){for(o=0;o<n;++o)delete e.data[i[o]];i.splice(0,n)}})}function ue(s){return s.drawTicks?s.tickLength:0}function Ji(s,t){if(!s.display)return 0;const e=Q(s.font,t),i=ht(s.padding);return(K(s.text)?s.text.length:1)*e.lineHeight+i.height}function rh(s,t){return Xt(s,{scale:t,type:"scale"})}function ah(s,t,e){return Xt(s,{tick:e,index:t,type:"tick"})}function lh(s,t,e){let i=Xs(s);return(e&&t!=="right"||!e&&t==="right")&&(i=ih(i)),i}function ch(s,t,e,i){const{top:n,left:o,bottom:r,right:a,chart:l}=s,{chartArea:c,scales:h}=l;let d=0,u,f,p;const m=r-n,b=a-o;if(s.isHorizontal()){if(f=J(i,o,a),R(e)){const _=Object.keys(e)[0],x=e[_];p=h[_].getPixelForValue(x)+m-t}else e==="center"?p=(c.bottom+c.top)/2+m-t:p=Ki(s,e,t);u=a-o}else{if(R(e)){const _=Object.keys(e)[0],x=e[_];f=h[_].getPixelForValue(x)-b+t}else e==="center"?f=(c.left+c.right)/2-b+t:f=Ki(s,e,t);p=J(i,r,n),d=e==="left"?-dt:dt}return{titleX:f,titleY:p,maxWidth:u,rotation:d}}class oe extends At{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:n}=this;return t=ut(t,Number.POSITIVE_INFINITY),e=ut(e,Number.NEGATIVE_INFINITY),i=ut(i,Number.POSITIVE_INFINITY),n=ut(n,Number.NEGATIVE_INFINITY),{min:ut(t,i),max:ut(e,n),minDefined:ct(t),maxDefined:ct(e)}}getMinMax(t){let{min:e,max:i,minDefined:n,maxDefined:o}=this.getUserBounds(),r;if(n&&o)return{min:e,max:i};const a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)r=a[l].controller.getMinMax(this,t),n||(e=Math.min(e,r.min)),o||(i=Math.max(i,r.max));return e=o&&e>i?i:e,i=n&&e>i?e:i,{min:ut(e,ut(i,e)),max:ut(i,ut(e,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){H(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:n,grace:o,ticks:r}=this.options,a=r.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=_l(this,o,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?Gi(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||r.source==="auto")&&(this.ticks=Qc(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,i;this.isHorizontal()?(e=this.left,i=this.right):(e=this.top,i=this.bottom,t=!t),this._startPixel=e,this._endPixel=i,this._reversePixels=t,this._length=i-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){H(this.options.afterUpdate,[this])}beforeSetDimensions(){H(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(){H(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),H(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){H(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,n,o;for(i=0,n=t.length;i<n;i++)o=t[i],o.label=H(e.callback,[o.value,i,t],this)}afterTickToLabelConversion(){H(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){H(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=Xi(this.ticks.length,t.ticks.maxTicksLimit),n=e.minRotation||0,o=e.maxRotation;let r=n,a,l,c;if(!this._isVisible()||!e.display||n>=o||i<=1||!this.isHorizontal()){this.labelRotation=n;return}const h=this._getLabelSizes(),d=h.widest.width,u=h.highest.height,f=it(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/i:f/(i-1),d+6>a&&(a=f/(i-(t.offset?.5:1)),l=this.maxHeight-ue(t.grid)-e.padding-Ji(t.title,this.chart.options.font),c=Math.sqrt(d*d+u*u),r=Va(Math.min(Math.asin(it((h.highest.height+6)/a,-1,1)),Math.asin(it(l/c,-1,1))-Math.asin(it(u/c,-1,1)))),r=Math.max(n,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){H(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){H(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:n,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){const l=Ji(n,e.options.font);if(a?(t.width=this.maxWidth,t.height=ue(o)+l):(t.height=this.maxHeight,t.width=ue(o)+l),i.display&&this.ticks.length){const{first:c,last:h,widest:d,highest:u}=this._getLabelSizes(),f=i.padding*2,p=Nt(this.labelRotation),m=Math.cos(p),b=Math.sin(p);if(a){const _=i.mirror?0:b*d.width+m*u.height;t.height=Math.min(this.maxHeight,t.height+_+f)}else{const _=i.mirror?0:m*d.width+b*u.height;t.width=Math.min(this.maxWidth,t.width+_+f)}this._calculatePadding(c,h,b,m)}}this._handleMargins(),a?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,n){const{ticks:{align:o,padding:r},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const h=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let u=0,f=0;l?c?(u=n*t.width,f=i*e.height):(u=i*t.height,f=n*e.width):o==="start"?f=e.width:o==="end"?u=t.width:o!=="inner"&&(u=t.width/2,f=e.width/2),this.paddingLeft=Math.max((u-h+r)*this.width/(this.width-h),0),this.paddingRight=Math.max((f-d+r)*this.width/(this.width-d),0)}else{let h=e.height/2,d=t.height/2;o==="start"?(h=0,d=t.height):o==="end"&&(h=e.height,d=0),this.paddingTop=h+r,this.paddingBottom=d+r}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){H(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,i;for(e=0,i=t.length;e<i;e++)$(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let i=this.ticks;e<i.length&&(i=Gi(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){const{ctx:n,_longestTextCache:o}=this,r=[],a=[],l=Math.floor(e/Xi(e,i));let c=0,h=0,d,u,f,p,m,b,_,x,S,P,v;for(d=0;d<e;d+=l){if(p=t[d].label,m=this._resolveTickFontOptions(d),n.font=b=m.string,_=o[b]=o[b]||{data:{},gc:[]},x=m.lineHeight,S=P=0,!$(p)&&!K(p))S=Si(n,_.data,_.gc,S,p),P=x;else if(K(p))for(u=0,f=p.length;u<f;++u)v=p[u],!$(v)&&!K(v)&&(S=Si(n,_.data,_.gc,S,v),P+=x);r.push(S),a.push(P),c=Math.max(S,c),h=Math.max(P,h)}oh(o,e);const M=r.indexOf(c),w=a.indexOf(h),k=y=>({width:r[y]||0,height:a[y]||0});return{first:k(0),last:k(e-1),widest:k(M),highest:k(w),widths:r,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return Ya(this._alignToPixels?Ft(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const i=e[t];return i.$context||(i.$context=ah(this.getContext(),t,i))}return this.$context||(this.$context=rh(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=Nt(this.labelRotation),i=Math.abs(Math.cos(e)),n=Math.abs(Math.sin(e)),o=this._getLabelSizes(),r=t.autoSkipPadding||0,a=o?o.widest.width+r:0,l=o?o.highest.height+r:0;return this.isHorizontal()?l*i>a*n?a/i:l/n:l*n<a*i?l/i:a/n}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=this.chart,n=this.options,{grid:o,position:r,border:a}=n,l=o.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),u=ue(o),f=[],p=a.setContext(this.getContext()),m=p.display?p.width:0,b=m/2,_=function(Y){return Ft(i,Y,m)};let x,S,P,v,M,w,k,y,A,T,L,q;if(r==="top")x=_(this.bottom),w=this.bottom-u,y=x-b,T=_(t.top)+b,q=t.bottom;else if(r==="bottom")x=_(this.top),T=t.top,q=_(t.bottom)-b,w=x+b,y=this.top+u;else if(r==="left")x=_(this.right),M=this.right-u,k=x-b,A=_(t.left)+b,L=t.right;else if(r==="right")x=_(this.left),A=t.left,L=_(t.right)-b,M=x+b,k=this.left+u;else if(e==="x"){if(r==="center")x=_((t.top+t.bottom)/2+.5);else if(R(r)){const Y=Object.keys(r)[0],nt=r[Y];x=_(this.chart.scales[Y].getPixelForValue(nt))}T=t.top,q=t.bottom,w=x+b,y=w+u}else if(e==="y"){if(r==="center")x=_((t.left+t.right)/2);else if(R(r)){const Y=Object.keys(r)[0],nt=r[Y];x=_(this.chart.scales[Y].getPixelForValue(nt))}M=x-b,k=M-u,A=t.left,L=t.right}const V=I(n.ticks.maxTicksLimit,d),z=Math.max(1,Math.ceil(d/V));for(S=0;S<d;S+=z){const Y=this.getContext(S),nt=o.setContext(Y),Re=a.setContext(Y),Ee=nt.lineWidth,Gt=nt.color,Fe=Re.dash||[],Jt=Re.dashOffset,ae=nt.tickWidth,It=nt.tickColor,le=nt.tickBorderDash||[],Rt=nt.tickBorderDashOffset;P=nh(this,S,l),P!==void 0&&(v=Ft(i,P,Ee),c?M=k=A=L=v:w=y=T=q=v,f.push({tx1:M,ty1:w,tx2:k,ty2:y,x1:A,y1:T,x2:L,y2:q,width:Ee,color:Gt,borderDash:Fe,borderDashOffset:Jt,tickWidth:ae,tickColor:It,tickBorderDash:le,tickBorderDashOffset:Rt}))}return this._ticksLength=d,this._borderValue=x,f}_computeLabelItems(t){const e=this.axis,i=this.options,{position:n,ticks:o}=i,r=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:h,mirror:d}=o,u=ue(i.grid),f=u+h,p=d?-h:f,m=-Nt(this.labelRotation),b=[];let _,x,S,P,v,M,w,k,y,A,T,L,q="middle";if(n==="top")M=this.bottom-p,w=this._getXAxisLabelAlignment();else if(n==="bottom")M=this.top+p,w=this._getXAxisLabelAlignment();else if(n==="left"){const z=this._getYAxisLabelAlignment(u);w=z.textAlign,v=z.x}else if(n==="right"){const z=this._getYAxisLabelAlignment(u);w=z.textAlign,v=z.x}else if(e==="x"){if(n==="center")M=(t.top+t.bottom)/2+f;else if(R(n)){const z=Object.keys(n)[0],Y=n[z];M=this.chart.scales[z].getPixelForValue(Y)+f}w=this._getXAxisLabelAlignment()}else if(e==="y"){if(n==="center")v=(t.left+t.right)/2-f;else if(R(n)){const z=Object.keys(n)[0],Y=n[z];v=this.chart.scales[z].getPixelForValue(Y)}w=this._getYAxisLabelAlignment(u).textAlign}e==="y"&&(l==="start"?q="top":l==="end"&&(q="bottom"));const V=this._getLabelSizes();for(_=0,x=a.length;_<x;++_){S=a[_],P=S.label;const z=o.setContext(this.getContext(_));k=this.getPixelForTick(_)+o.labelOffset,y=this._resolveTickFontOptions(_),A=y.lineHeight,T=K(P)?P.length:1;const Y=T/2,nt=z.color,Re=z.textStrokeColor,Ee=z.textStrokeWidth;let Gt=w;r?(v=k,w==="inner"&&(_===x-1?Gt=this.options.reverse?"left":"right":_===0?Gt=this.options.reverse?"right":"left":Gt="center"),n==="top"?c==="near"||m!==0?L=-T*A+A/2:c==="center"?L=-V.highest.height/2-Y*A+A:L=-V.highest.height+A/2:c==="near"||m!==0?L=A/2:c==="center"?L=V.highest.height/2-Y*A:L=V.highest.height-T*A,d&&(L*=-1),m!==0&&!z.showLabelBackdrop&&(v+=A/2*Math.sin(m))):(M=k,L=(1-T)*A/2);let Fe;if(z.showLabelBackdrop){const Jt=ht(z.backdropPadding),ae=V.heights[_],It=V.widths[_];let le=L-Jt.top,Rt=0-Jt.left;switch(q){case"middle":le-=ae/2;break;case"bottom":le-=ae;break}switch(w){case"center":Rt-=It/2;break;case"right":Rt-=It;break;case"inner":_===x-1?Rt-=It:_>0&&(Rt-=It/2);break}Fe={left:Rt,top:le,width:It+Jt.width,height:ae+Jt.height,color:z.backdropColor}}b.push({label:P,font:y,textOffset:L,options:{rotation:m,color:nt,strokeColor:Re,strokeWidth:Ee,textAlign:Gt,textBaseline:q,translation:[v,M],backdrop:Fe}})}return b}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-Nt(this.labelRotation))return t==="top"?"left":"right";let n="center";return e.align==="start"?n="left":e.align==="end"?n="right":e.align==="inner"&&(n="inner"),n}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:n,padding:o}}=this.options,r=this._getLabelSizes(),a=t+o,l=r.widest.width;let c,h;return e==="left"?n?(h=this.right+o,i==="near"?c="left":i==="center"?(c="center",h+=l/2):(c="right",h+=l)):(h=this.right-a,i==="near"?c="right":i==="center"?(c="center",h-=l/2):(c="left",h=this.left)):e==="right"?n?(h=this.left+o,i==="near"?c="right":i==="center"?(c="center",h-=l/2):(c="left",h-=l)):(h=this.left+a,i==="near"?c="left":i==="center"?(c="center",h+=l/2):(c="right",h=this.right)):c="right",{textAlign:c,x:h}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:n,width:o,height:r}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,n,o,r),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const n=this.ticks.findIndex(o=>o.value===t);return n>=0?e.setContext(this.getContext(n)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,r;const a=(l,c,h)=>{!h.width||!h.color||(i.save(),i.lineWidth=h.width,i.strokeStyle=h.color,i.setLineDash(h.borderDash||[]),i.lineDashOffset=h.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(c.x,c.y),i.stroke(),i.restore())};if(e.display)for(o=0,r=n.length;o<r;++o){const l=n[o];e.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),e.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:i,grid:n}}=this,o=i.setContext(this.getContext()),r=i.display?o.width:0;if(!r)return;const a=n.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,h,d,u;this.isHorizontal()?(c=Ft(t,this.left,r)-r/2,h=Ft(t,this.right,a)+a/2,d=u=l):(d=Ft(t,this.top,r)-r/2,u=Ft(t,this.bottom,a)+a/2,c=h=l),e.save(),e.lineWidth=o.width,e.strokeStyle=o.color,e.beginPath(),e.moveTo(c,d),e.lineTo(h,u),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,n=this._computeLabelArea();n&&Js(i,n);const o=this.getLabelItems(t);for(const r of o){const a=r.options,l=r.font,c=r.label,h=r.textOffset;Oe(i,c,0,h,l,a)}n&&Qs(i)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:n}}=this;if(!i.display)return;const o=Q(i.font),r=ht(i.padding),a=i.align;let l=o.lineHeight/2;e==="bottom"||e==="center"||R(e)?(l+=r.bottom,K(i.text)&&(l+=o.lineHeight*(i.text.length-1))):l+=r.top;const{titleX:c,titleY:h,maxWidth:d,rotation:u}=ch(this,l,e,a);Oe(t,i.text,0,0,o,{color:i.color,maxWidth:d,rotation:u,textAlign:lh(a,e,n),textBaseline:"middle",translation:[c,h]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,i=I(t.grid&&t.grid.z,-1),n=I(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==oe.prototype.draw?[{z:e,draw:o=>{this.draw(o)}}]:[{z:i,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:n,draw:()=>{this.drawBorder()}},{z:e,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",n=[];let o,r;for(o=0,r=e.length;o<r;++o){const a=e[o];a[i]===this.id&&(!t||a.type===t)&&n.push(a)}return n}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return Q(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Ye{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let i;uh(e)&&(i=this.register(e));const n=this.items,o=t.id,r=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in n||(n[o]=t,hh(t,r,i),this.override&&U.override(t.id,t.overrides)),r}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,n=this.scope;i in e&&delete e[i],n&&i in U[n]&&(delete U[n][i],this.override&&delete Yt[i])}}function hh(s,t,e){const i=Pe(Object.create(null),[e?U.get(e):{},U.get(t),s.defaults]);U.set(t,i),s.defaultRoutes&&dh(t,s.defaultRoutes),s.descriptors&&U.describe(t,s.descriptors)}function dh(s,t){Object.keys(t).forEach(e=>{const i=e.split("."),n=i.pop(),o=[s].concat(i).join("."),r=t[e].split("."),a=r.pop(),l=r.join(".");U.route(o,n,l,a)})}function uh(s){return"id"in s&&"defaults"in s}class fh{constructor(){this.controllers=new Ye(ii,"datasets",!0),this.elements=new Ye(At,"elements"),this.plugins=new Ye(Object,"plugins"),this.scales=new Ye(oe,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(n=>{const o=i||this._getRegistryForType(n);i||o.isForType(n)||o===this.plugins&&n.id?this._exec(t,o,n):F(n,r=>{const a=i||this._getRegistryForType(r);this._exec(t,a,r)})})}_exec(t,e,i){const n=Ys(t);H(i["before"+n],[],i),e[t](i),H(i["after"+n],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const n=e.get(t);if(n===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return n}}var pt=new fh;class gh{constructor(){this._init=[]}notify(t,e,i,n){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const o=n?this._descriptors(t).filter(n):this._descriptors(t),r=this._notify(o,t,e,i);return e==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall")),r}_notify(t,e,i,n){n=n||{};for(const o of t){const r=o.plugin,a=r[i],l=[e,n,o.options];if(H(a,l,r)===!1&&n.cancelable)return!1}return!0}invalidate(){$(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const i=t&&t.config,n=I(i.options&&i.options.plugins,{}),o=ph(i);return n===!1&&!e?[]:bh(t,o,n,e)}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,n=(o,r)=>o.filter(a=>!r.some(l=>a.plugin.id===l.plugin.id));this._notify(n(e,i),t,"stop"),this._notify(n(i,e),t,"start")}}function ph(s){const t={},e=[],i=Object.keys(pt.plugins.items);for(let o=0;o<i.length;o++)e.push(pt.getPlugin(i[o]));const n=s.plugins||[];for(let o=0;o<n.length;o++){const r=n[o];e.indexOf(r)===-1&&(e.push(r),t[r.id]=!0)}return{plugins:e,localIds:t}}function mh(s,t){return!t&&s===!1?null:s===!0?{}:s}function bh(s,{plugins:t,localIds:e},i,n){const o=[],r=s.getContext();for(const a of t){const l=a.id,c=mh(i[l],n);c!==null&&o.push({plugin:a,options:_h(s.config,{plugin:a,local:e[l]},c,r)})}return o}function _h(s,{plugin:t,local:e},i,n){const o=s.pluginScopeKeys(t),r=s.getOptionScopes(i,o);return e&&t.defaults&&r.push(t.defaults),s.createResolver(r,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Ls(s,t){const e=U.datasets[s]||{};return((t.datasets||{})[s]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function xh(s,t){let e=s;return s==="_index_"?e=t:s==="_value_"&&(e=t==="x"?"y":"x"),e}function yh(s,t){return s===t?"_index_":"_value_"}function Qi(s){if(s==="x"||s==="y"||s==="r")return s}function vh(s){if(s==="top"||s==="bottom")return"x";if(s==="left"||s==="right")return"y"}function Is(s,...t){if(Qi(s))return s;for(const e of t){const i=e.axis||vh(e.position)||s.length>1&&Qi(s[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${s}' axis. Please provide 'axis' or 'position' option.`)}function qi(s,t,e){if(e[t+"AxisID"]===s)return{axis:t}}function Sh(s,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(i=>i.xAxisID===s||i.yAxisID===s);if(e.length)return qi(s,"x",e[0])||qi(s,"y",e[0])}return{}}function wh(s,t){const e=Yt[s.type]||{scales:{}},i=t.scales||{},n=Ls(s.type,t),o=Object.create(null);return Object.keys(i).forEach(r=>{const a=i[r];if(!R(a))return console.error(`Invalid scale configuration for scale: ${r}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);const l=Is(r,a,Sh(r,s),U.scales[a.type]),c=yh(l,n),h=e.scales||{};o[r]=xe(Object.create(null),[{axis:l},a,h[l],h[c]])}),s.data.datasets.forEach(r=>{const a=r.type||s.type,l=r.indexAxis||Ls(a,t),h=(Yt[a]||{}).scales||{};Object.keys(h).forEach(d=>{const u=xh(d,l),f=r[u+"AxisID"]||u;o[f]=o[f]||Object.create(null),xe(o[f],[{axis:u},i[f],h[d]])})}),Object.keys(o).forEach(r=>{const a=o[r];xe(a,[U.scales[a.type],U.scale])}),o}function So(s){const t=s.options||(s.options={});t.plugins=I(t.plugins,{}),t.scales=wh(s,t)}function wo(s){return s=s||{},s.datasets=s.datasets||[],s.labels=s.labels||[],s}function kh(s){return s=s||{},s.data=wo(s.data),So(s),s}const Zi=new Map,ko=new Set;function Ke(s,t){let e=Zi.get(s);return e||(e=t(),Zi.set(s,e),ko.add(e)),e}const fe=(s,t,e)=>{const i=se(t,e);i!==void 0&&s.add(i)};let Ph=class{constructor(t){this._config=kh(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=wo(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),So(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Ke(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return Ke(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return Ke(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,i=this.type;return Ke(`${i}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let n=i.get(t);return(!n||e)&&(n=new Map,i.set(t,n)),n}getOptionScopes(t,e,i){const{options:n,type:o}=this,r=this._cachedScopes(t,i),a=r.get(e);if(a)return a;const l=new Set;e.forEach(h=>{t&&(l.add(t),h.forEach(d=>fe(l,t,d))),h.forEach(d=>fe(l,n,d)),h.forEach(d=>fe(l,Yt[o]||{},d)),h.forEach(d=>fe(l,U,d)),h.forEach(d=>fe(l,Ts,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),ko.has(e)&&r.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,Yt[e]||{},U.datasets[e]||{},{type:e},U,Ts]}resolveNamedOptions(t,e,i,n=[""]){const o={$shared:!0},{resolver:r,subPrefixes:a}=tn(this._resolverCache,t,n);let l=r;if(Ch(r,e)){o.$shared=!1,i=Tt(i)?i():i;const c=this.createResolver(t,i,a);l=ie(r,i,c)}for(const c of e)o[c]=l[c];return o}createResolver(t,e,i=[""],n){const{resolver:o}=tn(this._resolverCache,t,i);return R(e)?ie(o,e,void 0,n):o}};function tn(s,t,e){let i=s.get(t);i||(i=new Map,s.set(t,i));const n=e.join();let o=i.get(n);return o||(o={resolver:qs(t,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},i.set(n,o)),o}const Mh=s=>R(s)&&Object.getOwnPropertyNames(s).some(t=>Tt(s[t]));function Ch(s,t){const{isScriptable:e,isIndexable:i}=io(s);for(const n of t){const o=e(n),r=i(n),a=(r||o)&&s[n];if(o&&(Tt(a)||Mh(a))||r&&K(a))return!0}return!1}var Dh="4.4.4";const Oh=["top","bottom","left","right","chartArea"];function en(s,t){return s==="top"||s==="bottom"||Oh.indexOf(s)===-1&&t==="x"}function sn(s,t){return function(e,i){return e[s]===i[s]?e[t]-i[t]:e[s]-i[s]}}function nn(s){const t=s.chart,e=t.options.animation;t.notifyPlugins("afterRender"),H(e&&e.onComplete,[s],t)}function Th(s){const t=s.chart,e=t.options.animation;H(e&&e.onProgress,[s],t)}function Po(s){return ei()&&typeof s=="string"?s=document.getElementById(s):s&&s.length&&(s=s[0]),s&&s.canvas&&(s=s.canvas),s}const ts={},on=s=>{const t=Po(s);return Object.values(ts).filter(e=>e.canvas===t).pop()};function Ah(s,t,e){const i=Object.keys(s);for(const n of i){const o=+n;if(o>=t){const r=s[n];delete s[n],(e>0||o>t)&&(s[o+e]=r)}}}function Lh(s,t,e,i){return!e||s.type==="mouseout"?null:i?t:s}function Xe(s,t,e){return s.options.clip?s[e]:t[e]}function Ih(s,t){const{xScale:e,yScale:i}=s;return e&&i?{left:Xe(e,t,"left"),right:Xe(e,t,"right"),top:Xe(i,t,"top"),bottom:Xe(i,t,"bottom")}:t}let cs=class{static defaults=U;static instances=ts;static overrides=Yt;static registry=pt;static version=Dh;static getChart=on;static register(...t){pt.add(...t),rn()}static unregister(...t){pt.remove(...t),rn()}constructor(t,e){const i=this.config=new Ph(e),n=Po(t),o=on(n);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const r=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||Jc(n)),this.platform.updateConfig(i);const a=this.platform.acquireContext(n,r.aspectRatio),l=a&&a.canvas,c=l&&l.height,h=l&&l.width;if(this.id=Aa(),this.ctx=a,this.canvas=l,this.width=h,this.height=c,this._options=r,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new gh,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Ja(d=>this.update(d),r.resizeDelay||0),this._dataChanges=[],ts[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}yt.listen(this,"complete",nn),yt.listen(this,"progress",Th),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:n,_aspectRatio:o}=this;return $(t)?e&&o?o:n?i/n:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return pt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Mi(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return wi(this.canvas,this.ctx),this}stop(){return yt.stop(this),this}resize(t,e){yt.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,n=this.canvas,o=i.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(n,t,e,o),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,Mi(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),H(i.onResize,[this,r],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};F(e,(i,n)=>{i.id=n})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,n=Object.keys(i).reduce((r,a)=>(r[a]=!1,r),{});let o=[];e&&(o=o.concat(Object.keys(e).map(r=>{const a=e[r],l=Is(r,a),c=l==="r",h=l==="x";return{options:a,dposition:c?"chartArea":h?"bottom":"left",dtype:c?"radialLinear":h?"category":"linear"}}))),F(o,r=>{const a=r.options,l=a.id,c=Is(l,a),h=I(a.type,r.dtype);(a.position===void 0||en(a.position,c)!==en(r.dposition))&&(a.position=r.dposition),n[l]=!0;let d=null;if(l in i&&i[l].type===h)d=i[l];else{const u=pt.getScale(h);d=new u({id:l,type:h,ctx:this.ctx,chart:this}),i[d.id]=d}d.init(a,t)}),F(n,(r,a)=>{r||delete i[a]}),F(i,r=>{lt.configure(this,r,r.options),lt.addBox(this,r)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((n,o)=>n.index-o.index),i>e){for(let n=e;n<i;++n)this._destroyDatasetMeta(n);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(sn("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((i,n)=>{e.filter(o=>o===i._dataset).length===0&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,n;for(this._removeUnreferencedMetasets(),i=0,n=e.length;i<n;i++){const o=e[i];let r=this.getDatasetMeta(i);const a=o.type||this.config.type;if(r.type&&r.type!==a&&(this._destroyDatasetMeta(i),r=this.getDatasetMeta(i)),r.type=a,r.indexAxis=o.indexAxis||Ls(a,this.options),r.order=o.order||0,r.index=i,r.label=""+o.label,r.visible=this.isDatasetVisible(i),r.controller)r.controller.updateIndex(i),r.controller.linkScales();else{const l=pt.getController(a),{datasetElementType:c,dataElementType:h}=U.datasets[a];Object.assign(l,{dataElementType:pt.getElement(h),datasetElementType:c&&pt.getElement(c)}),r.controller=new l(this,i),t.push(r.controller)}}return this._updateMetasets(),t}_resetElements(){F(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let c=0,h=this.data.datasets.length;c<h;c++){const{controller:d}=this.getDatasetMeta(c),u=!n&&o.indexOf(d)===-1;d.buildOrUpdateElements(u),r=Math.max(+d.getMaxOverflow(),r)}r=this._minPadding=i.layout.autoPadding?r:0,this._updateLayout(r),n||F(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(sn("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){F(this.scales,t=>{lt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!fi(e,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:n,count:o}of e){const r=i==="_removeElements"?-o:o;Ah(t,n,r)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=o=>new Set(t.filter(r=>r[0]===o).map((r,a)=>a+","+r.splice(1).join(","))),n=i(0);for(let o=1;o<e;o++)if(!fi(n,i(o)))return;return Array.from(n).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;lt.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],F(this.boxes,n=>{i&&n.position==="chartArea"||(n.configure&&n.configure(),this._layers.push(...n._layers()))},this),this._layers.forEach((n,o)=>{n._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,i=this.data.datasets.length;e<i;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,Tt(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),n={meta:i,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",n)!==!1&&(i.controller._update(e),n.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",n))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(yt.has(this)?this.attached&&!yt.running(this)&&yt.start(this):(this.draw(),nn({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:i,height:n}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(i,n)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,i=[];let n,o;for(n=0,o=e.length;n<o;++n){const r=e[n];(!t||r.visible)&&i.push(r)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i=t._clip,n=!i.disabled,o=Ih(t,this.chartArea),r={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(n&&Js(e,{left:i.left===!1?0:o.left-i.left,right:i.right===!1?this.width:o.right+i.right,top:i.top===!1?0:o.top-i.top,bottom:i.bottom===!1?this.height:o.bottom+i.bottom}),t.controller.draw(),n&&Qs(e),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return De(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,n){const o=Oc.modes[e];return typeof o=="function"?o(this,t,i,n):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let n=i.filter(o=>o&&o._dataset===e).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(n)),n}getContext(){return this.$context||(this.$context=Xt(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!e.hidden}setDatasetVisibility(t,e){const i=this.getDatasetMeta(t);i.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const n=i?"show":"hide",o=this.getDatasetMeta(t),r=o.controller._resolveAnimations(void 0,n);Me(e)?(o.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),r.update(o,{visible:i}),this.update(a=>a.datasetIndex===t?n:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),yt.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),wi(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete ts[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,i=(o,r)=>{e.addEventListener(this,o,r),t[o]=r},n=(o,r,a)=>{o.offsetX=r,o.offsetY=a,this._eventHandler(o)};F(this.options.events,o=>i(o,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},n=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let r;const a=()=>{n("attach",a),this.attached=!0,this.resize(),i("resize",o),i("detach",r)};r=()=>{this.attached=!1,n("resize",o),this._stop(),this._resize(0,0),i("attach",a)},e.isAttached(this.canvas)?a():r()}unbindEvents(){F(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},F(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const n=i?"set":"remove";let o,r,a,l;for(e==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+n+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){r=t[a];const c=r&&this.getDatasetMeta(r.datasetIndex).controller;c&&c[n+"HoverStyle"](r.element,r.datasetIndex,r.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map(({datasetIndex:o,index:r})=>{const a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[r],index:r}});!es(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,i){const n=this.options.hover,o=(l,c)=>l.filter(h=>!c.some(d=>h.datasetIndex===d.datasetIndex&&h.index===d.index)),r=o(e,t),a=i?t:o(t,e);r.length&&this.updateHoverStyle(r,n.mode,!1),a.length&&n.mode&&this.updateHoverStyle(a,n.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},n=r=>(r.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,n)===!1)return;const o=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,n),(o||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:n=[],options:o}=this,r=e,a=this._getActiveElements(t,n,i,r),l=Ba(t),c=Lh(t,this._lastEvent,i,l);i&&(this._lastEvent=null,H(o.onHover,[t,a,this],this),l&&H(o.onClick,[t,a,this],this));const h=!es(a,n);return(h||e)&&(this._active=a,this._updateHoverStyles(a,n,e)),this._lastEvent=c,h}_getActiveElements(t,e,i,n){if(t.type==="mouseout")return[];if(!i)return e;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,n)}};function rn(){return F(cs.instances,s=>s._plugins.invalidate())}function Mo(s,t,e=t){s.lineCap=I(e.borderCapStyle,t.borderCapStyle),s.setLineDash(I(e.borderDash,t.borderDash)),s.lineDashOffset=I(e.borderDashOffset,t.borderDashOffset),s.lineJoin=I(e.borderJoinStyle,t.borderJoinStyle),s.lineWidth=I(e.borderWidth,t.borderWidth),s.strokeStyle=I(e.borderColor,t.borderColor)}function Rh(s,t,e){s.lineTo(e.x,e.y)}function Eh(s){return s.stepped?cl:s.tension||s.cubicInterpolationMode==="monotone"?hl:Rh}function Co(s,t,e={}){const i=s.length,{start:n=0,end:o=i-1}=e,{start:r,end:a}=t,l=Math.max(n,r),c=Math.min(o,a),h=n<r&&o<r||n>a&&o>a;return{count:i,start:l,loop:t.loop,ilen:c<l&&!h?i+c-l:c-l}}function Fh(s,t,e,i){const{points:n,options:o}=t,{count:r,start:a,loop:l,ilen:c}=Co(n,e,i),h=Eh(o);let{move:d=!0,reverse:u}=i||{},f,p,m;for(f=0;f<=c;++f)p=n[(a+(u?c-f:f))%r],!p.skip&&(d?(s.moveTo(p.x,p.y),d=!1):h(s,m,p,u,o.stepped),m=p);return l&&(p=n[(a+(u?c:0))%r],h(s,m,p,u,o.stepped)),!!l}function Bh(s,t,e,i){const n=t.points,{count:o,start:r,ilen:a}=Co(n,e,i),{move:l=!0,reverse:c}=i||{};let h=0,d=0,u,f,p,m,b,_;const x=P=>(r+(c?a-P:P))%o,S=()=>{m!==b&&(s.lineTo(h,b),s.lineTo(h,m),s.lineTo(h,_))};for(l&&(f=n[x(0)],s.moveTo(f.x,f.y)),u=0;u<=a;++u){if(f=n[x(u)],f.skip)continue;const P=f.x,v=f.y,M=P|0;M===p?(v<m?m=v:v>b&&(b=v),h=(d*h+P)/++d):(S(),s.lineTo(P,v),p=M,d=0,m=b=v),_=v}S()}function Rs(s){const t=s.options,e=t.borderDash&&t.borderDash.length;return!s._decimated&&!s._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?Bh:Fh}function zh(s){return s.stepped?Wl:s.tension||s.cubicInterpolationMode==="monotone"?Vl:$t}function $h(s,t,e,i){let n=t._path;n||(n=t._path=new Path2D,t.path(n,e,i)&&n.closePath()),Mo(s,t.options),s.stroke(n)}function Hh(s,t,e,i){const{segments:n,options:o}=t,r=Rs(t);for(const a of n)Mo(s,o,a.style),s.beginPath(),r(s,t,a,{start:e,end:e+i-1})&&s.closePath(),s.stroke()}const Nh=typeof Path2D=="function";function Wh(s,t,e,i){Nh&&!t.options.segment?$h(s,t,e,i):Hh(s,t,e,i)}class Vh extends At{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"};constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const n=i.spanGaps?this._loop:this._fullLoop;Rl(this._points,i,t,n,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Ql(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,n=t[e],o=this.points,r=Xl(this,{property:e,start:n,end:n});if(!r.length)return;const a=[],l=zh(i);let c,h;for(c=0,h=r.length;c<h;++c){const{start:d,end:u}=r[c],f=o[d],p=o[u];if(f===p){a.push(f);continue}const m=Math.abs((n-f[e])/(p[e]-f[e])),b=l(f,p,m,i.stepped);b[e]=t[e],a.push(b)}return a.length===1?a[0]:a}pathSegment(t,e,i){return Rs(this)(t,this,e,i)}path(t,e,i){const n=this.segments,o=Rs(this);let r=this._loop;e=e||0,i=i||this.points.length-e;for(const a of n)r&=o(t,this,a,{start:e,end:e+i-1});return!!r}draw(t,e,i,n){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),Wh(t,this,i,n),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function an(s,t,e,i){const n=s.options,{[e]:o}=s.getProps([e],i);return Math.abs(t-o)<n.radius+n.hitRadius}class jh extends At{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,i){const n=this.options,{x:o,y:r}=this.getProps(["x","y"],i);return Math.pow(t-o,2)+Math.pow(e-r,2)<Math.pow(n.hitRadius+n.radius,2)}inXRange(t,e){return an(this,t,"x",e)}inYRange(t,e){return an(this,t,"y",e)}getCenterPoint(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}size(t){t=t||this.options||{};let e=t.radius||0;e=Math.max(e,e&&t.hoverRadius||0);const i=e&&t.borderWidth||0;return(e+i)*2}draw(t,e){const i=this.options;this.skip||i.radius<.1||!De(this,e,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,As(t,i,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function Do(s,t){const{x:e,y:i,base:n,width:o,height:r}=s.getProps(["x","y","base","width","height"],t);let a,l,c,h,d;return s.horizontal?(d=r/2,a=Math.min(e,n),l=Math.max(e,n),c=i-d,h=i+d):(d=o/2,a=e-d,l=e+d,c=Math.min(i,n),h=Math.max(i,n)),{left:a,top:c,right:l,bottom:h}}function Mt(s,t,e,i){return s?0:it(t,e,i)}function Uh(s,t,e){const i=s.options.borderWidth,n=s.borderSkipped,o=so(i);return{t:Mt(n.top,o.top,0,e),r:Mt(n.right,o.right,0,t),b:Mt(n.bottom,o.bottom,0,e),l:Mt(n.left,o.left,0,t)}}function Yh(s,t,e){const{enableBorderRadius:i}=s.getProps(["enableBorderRadius"]),n=s.options.borderRadius,o=te(n),r=Math.min(t,e),a=s.borderSkipped,l=i||R(n);return{topLeft:Mt(!l||a.top||a.left,o.topLeft,0,r),topRight:Mt(!l||a.top||a.right,o.topRight,0,r),bottomLeft:Mt(!l||a.bottom||a.left,o.bottomLeft,0,r),bottomRight:Mt(!l||a.bottom||a.right,o.bottomRight,0,r)}}function Kh(s){const t=Do(s),e=t.right-t.left,i=t.bottom-t.top,n=Uh(s,e/2,i/2),o=Yh(s,e/2,i/2);return{outer:{x:t.left,y:t.top,w:e,h:i,radius:o},inner:{x:t.left+n.l,y:t.top+n.t,w:e-n.l-n.r,h:i-n.t-n.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(n.t,n.l)),topRight:Math.max(0,o.topRight-Math.max(n.t,n.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(n.b,n.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(n.b,n.r))}}}}function vs(s,t,e,i){const n=t===null,o=e===null,a=s&&!(n&&o)&&Do(s,i);return a&&(n||Wt(t,a.left,a.right))&&(o||Wt(e,a.top,a.bottom))}function Xh(s){return s.topLeft||s.topRight||s.bottomLeft||s.bottomRight}function Gh(s,t){s.rect(t.x,t.y,t.w,t.h)}function Ss(s,t,e={}){const i=s.x!==e.x?-t:0,n=s.y!==e.y?-t:0,o=(s.x+s.w!==e.x+e.w?t:0)-i,r=(s.y+s.h!==e.y+e.h?t:0)-n;return{x:s.x+i,y:s.y+n,w:s.w+o,h:s.h+r,radius:s.radius}}class Jh extends At{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:i,backgroundColor:n}}=this,{inner:o,outer:r}=Kh(this),a=Xh(r.radius)?ns:Gh;t.save(),(r.w!==o.w||r.h!==o.h)&&(t.beginPath(),a(t,Ss(r,e,o)),t.clip(),a(t,Ss(o,-e,r)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),a(t,Ss(o,e)),t.fillStyle=n,t.fill(),t.restore()}inRange(t,e,i){return vs(this,t,e,i)}inXRange(t,e){return vs(this,t,null,e)}inYRange(t,e){return vs(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:n,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(e+n)/2:e,y:o?i:(i+n)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}const ln=(s,t)=>{let{boxHeight:e=t,boxWidth:i=t}=s;return s.usePointStyle&&(e=Math.min(e,t),i=s.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:e,itemHeight:Math.max(t,e)}},Qh=(s,t)=>s!==null&&t!==null&&s.datasetIndex===t.datasetIndex&&s.index===t.index;class cn extends At{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=H(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(i=>t.filter(i,this.chart.data))),t.sort&&(e=e.sort((i,n)=>t.sort(i,n,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const i=t.labels,n=Q(i.font),o=n.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=ln(i,o);let c,h;e.font=n.string,this.isHorizontal()?(c=this.maxWidth,h=this._fitRows(r,o,a,l)+10):(h=this.maxHeight,c=this._fitCols(r,n,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,n){const{ctx:o,maxWidth:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],h=n+a;let d=t;o.textAlign="left",o.textBaseline="middle";let u=-1,f=-h;return this.legendItems.forEach((p,m)=>{const b=i+e/2+o.measureText(p.text).width;(m===0||c[c.length-1]+b+2*a>r)&&(d+=h,c[c.length-(m>0?0:1)]=0,f+=h,u++),l[m]={left:0,top:f,row:u,width:b,height:n},c[c.length-1]+=b+a}),d}_fitCols(t,e,i,n){const{ctx:o,maxHeight:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],h=r-t;let d=a,u=0,f=0,p=0,m=0;return this.legendItems.forEach((b,_)=>{const{itemWidth:x,itemHeight:S}=qh(i,e,o,b,n);_>0&&f+S+2*a>h&&(d+=u+a,c.push({width:u,height:f}),p+=u+a,m++,u=f=0),l[_]={left:p,top:f,col:m,width:x,height:S},u=Math.max(u,x),f+=S+a}),d+=u,c.push({width:u,height:f}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:n},rtl:o}}=this,r=ee(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=J(i,this.left+n,this.right-this.lineWidths[a]);for(const c of e)a!==c.row&&(a=c.row,l=J(i,this.left+n,this.right-this.lineWidths[a])),c.top+=this.top+t+n,c.left=r.leftForLtr(r.x(l),c.width),l+=c.width+n}else{let a=0,l=J(i,this.top+t+n,this.bottom-this.columnSizes[a].height);for(const c of e)c.col!==a&&(a=c.col,l=J(i,this.top+t+n,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+n,c.left=r.leftForLtr(r.x(c.left),c.width),l+=c.height+n}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Js(t,this),this._draw(),Qs(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:n}=this,{align:o,labels:r}=t,a=U.color,l=ee(t.rtl,this.left,this.width),c=Q(r.font),{padding:h}=r,d=c.size,u=d/2;let f;this.drawTitle(),n.textAlign=l.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=c.string;const{boxWidth:p,boxHeight:m,itemHeight:b}=ln(r,d),_=function(M,w,k){if(isNaN(p)||p<=0||isNaN(m)||m<0)return;n.save();const y=I(k.lineWidth,1);if(n.fillStyle=I(k.fillStyle,a),n.lineCap=I(k.lineCap,"butt"),n.lineDashOffset=I(k.lineDashOffset,0),n.lineJoin=I(k.lineJoin,"miter"),n.lineWidth=y,n.strokeStyle=I(k.strokeStyle,a),n.setLineDash(I(k.lineDash,[])),r.usePointStyle){const A={radius:m*Math.SQRT2/2,pointStyle:k.pointStyle,rotation:k.rotation,borderWidth:y},T=l.xPlus(M,p/2),L=w+u;to(n,A,T,L,r.pointStyleWidth&&p)}else{const A=w+Math.max((d-m)/2,0),T=l.leftForLtr(M,p),L=te(k.borderRadius);n.beginPath(),Object.values(L).some(q=>q!==0)?ns(n,{x:T,y:A,w:p,h:m,radius:L}):n.rect(T,A,p,m),n.fill(),y!==0&&n.stroke()}n.restore()},x=function(M,w,k){Oe(n,k.text,M,w+b/2,c,{strikethrough:k.hidden,textAlign:l.textAlign(k.textAlign)})},S=this.isHorizontal(),P=this._computeTitleHeight();S?f={x:J(o,this.left+h,this.right-i[0]),y:this.top+h+P,line:0}:f={x:this.left+h,y:J(o,this.top+P+h,this.bottom-e[0].height),line:0},lo(this.ctx,t.textDirection);const v=b+h;this.legendItems.forEach((M,w)=>{n.strokeStyle=M.fontColor,n.fillStyle=M.fontColor;const k=n.measureText(M.text).width,y=l.textAlign(M.textAlign||(M.textAlign=r.textAlign)),A=p+u+k;let T=f.x,L=f.y;l.setWidth(this.width),S?w>0&&T+A+h>this.right&&(L=f.y+=v,f.line++,T=f.x=J(o,this.left+h,this.right-i[f.line])):w>0&&L+v>this.bottom&&(T=f.x=T+e[f.line].width+h,f.line++,L=f.y=J(o,this.top+P+h,this.bottom-e[f.line].height));const q=l.x(T);if(_(q,L,M),T=Qa(y,T+p+u,S?T+A:this.right,t.rtl),x(l.x(T),L,M),S)f.x+=A+h;else if(typeof M.text!="string"){const V=c.lineHeight;f.y+=Oo(M,V)+h}else f.y+=v}),co(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=Q(e.font),n=ht(e.padding);if(!e.display)return;const o=ee(t.rtl,this.left,this.width),r=this.ctx,a=e.position,l=i.size/2,c=n.top+l;let h,d=this.left,u=this.width;if(this.isHorizontal())u=Math.max(...this.lineWidths),h=this.top+c,d=J(t.align,d,this.right-u);else{const p=this.columnSizes.reduce((m,b)=>Math.max(m,b.height),0);h=c+J(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const f=J(a,d,d+u);r.textAlign=o.textAlign(Xs(a)),r.textBaseline="middle",r.strokeStyle=e.color,r.fillStyle=e.color,r.font=i.string,Oe(r,e.text,f,h,i)}_computeTitleHeight(){const t=this.options.title,e=Q(t.font),i=ht(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,n,o;if(Wt(t,this.left,this.right)&&Wt(e,this.top,this.bottom)){for(o=this.legendHitBoxes,i=0;i<o.length;++i)if(n=o[i],Wt(t,n.left,n.left+n.width)&&Wt(e,n.top,n.top+n.height))return this.legendItems[i]}return null}handleEvent(t){const e=this.options;if(!ed(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const n=this._hoveredItem,o=Qh(n,i);n&&!o&&H(e.onLeave,[t,n,this],this),this._hoveredItem=i,i&&!o&&H(e.onHover,[t,i,this],this)}else i&&H(e.onClick,[t,i,this],this)}}function qh(s,t,e,i,n){const o=Zh(i,s,t,e),r=td(n,i,t.lineHeight);return{itemWidth:o,itemHeight:r}}function Zh(s,t,e,i){let n=s.text;return n&&typeof n!="string"&&(n=n.reduce((o,r)=>o.length>r.length?o:r)),t+e.size/2+i.measureText(n).width}function td(s,t,e){let i=s;return typeof t.text!="string"&&(i=Oo(t,e)),i}function Oo(s,t){const e=s.text?s.text.length:0;return t*e}function ed(s,t){return!!((s==="mousemove"||s==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(s==="click"||s==="mouseup"))}var sd={id:"legend",_element:cn,start(s,t,e){const i=s.legend=new cn({ctx:s.ctx,options:e,chart:s});lt.configure(s,i,e),lt.addBox(s,i)},stop(s){lt.removeBox(s,s.legend),delete s.legend},beforeUpdate(s,t,e){const i=s.legend;lt.configure(s,i,e),i.options=e},afterUpdate(s){const t=s.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(s,t){t.replay||s.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(s,t,e){const i=t.datasetIndex,n=e.chart;n.isDatasetVisible(i)?(n.hide(i),t.hidden=!0):(n.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:s=>s.chart.options.color,boxWidth:40,padding:10,generateLabels(s){const t=s.data.datasets,{labels:{usePointStyle:e,pointStyle:i,textAlign:n,color:o,useBorderRadius:r,borderRadius:a}}=s.legend.options;return s._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),h=ht(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:c.borderColor,pointStyle:i||c.pointStyle,rotation:c.rotation,textAlign:n||c.textAlign,borderRadius:r&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:s=>s.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:s=>!s.startsWith("on"),labels:{_scriptable:s=>!["generateLabels","filter","sort"].includes(s)}}};class To extends At{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const n=K(i.text)?i.text.length:1;this._padding=ht(i.padding);const o=n*Q(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:i,bottom:n,right:o,options:r}=this,a=r.align;let l=0,c,h,d;return this.isHorizontal()?(h=J(a,i,o),d=e+t,c=o-i):(r.position==="left"?(h=i+t,d=J(a,n,e),l=X*-.5):(h=o-t,d=J(a,e,n),l=X*.5),c=n-e),{titleX:h,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=Q(e.font),o=i.lineHeight/2+this._padding.top,{titleX:r,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(o);Oe(t,e.text,0,0,i,{color:e.color,maxWidth:l,rotation:c,textAlign:Xs(e.align),textBaseline:"middle",translation:[r,a]})}}function id(s,t){const e=new To({ctx:s.ctx,options:t,chart:s});lt.configure(s,e,t),lt.addBox(s,e),s.titleBlock=e}var nd={id:"title",_element:To,start(s,t,e){id(s,e)},stop(s){const t=s.titleBlock;lt.removeBox(s,t),delete s.titleBlock},beforeUpdate(s,t,e){const i=s.titleBlock;lt.configure(s,i,e),i.options=e},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const be={average(s){if(!s.length)return!1;let t,e,i=new Set,n=0,o=0;for(t=0,e=s.length;t<e;++t){const a=s[t].element;if(a&&a.hasValue()){const l=a.tooltipPosition();i.add(l.x),n+=l.y,++o}}return o===0||i.size===0?!1:{x:[...i].reduce((a,l)=>a+l)/i.size,y:n/o}},nearest(s,t){if(!s.length)return!1;let e=t.x,i=t.y,n=Number.POSITIVE_INFINITY,o,r,a;for(o=0,r=s.length;o<r;++o){const l=s[o].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),h=Os(t,c);h<n&&(n=h,a=l)}}if(a){const l=a.tooltipPosition();e=l.x,i=l.y}return{x:e,y:i}}};function gt(s,t){return t&&(K(t)?Array.prototype.push.apply(s,t):s.push(t)),s}function vt(s){return(typeof s=="string"||s instanceof String)&&s.indexOf(`
|
|
`)>-1?s.split(`
|
|
`):s}function od(s,t){const{element:e,datasetIndex:i,index:n}=t,o=s.getDatasetMeta(i).controller,{label:r,value:a}=o.getLabelAndValue(n);return{chart:s,label:r,parsed:o.getParsed(n),raw:s.data.datasets[i].data[n],formattedValue:a,dataset:o.getDataset(),dataIndex:n,datasetIndex:i,element:e}}function hn(s,t){const e=s.chart.ctx,{body:i,footer:n,title:o}=s,{boxWidth:r,boxHeight:a}=t,l=Q(t.bodyFont),c=Q(t.titleFont),h=Q(t.footerFont),d=o.length,u=n.length,f=i.length,p=ht(t.padding);let m=p.height,b=0,_=i.reduce((P,v)=>P+v.before.length+v.lines.length+v.after.length,0);if(_+=s.beforeBody.length+s.afterBody.length,d&&(m+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),_){const P=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;m+=f*P+(_-f)*l.lineHeight+(_-1)*t.bodySpacing}u&&(m+=t.footerMarginTop+u*h.lineHeight+(u-1)*t.footerSpacing);let x=0;const S=function(P){b=Math.max(b,e.measureText(P).width+x)};return e.save(),e.font=c.string,F(s.title,S),e.font=l.string,F(s.beforeBody.concat(s.afterBody),S),x=t.displayColors?r+2+t.boxPadding:0,F(i,P=>{F(P.before,S),F(P.lines,S),F(P.after,S)}),x=0,e.font=h.string,F(s.footer,S),e.restore(),b+=p.width,{width:b,height:m}}function rd(s,t){const{y:e,height:i}=t;return e<i/2?"top":e>s.height-i/2?"bottom":"center"}function ad(s,t,e,i){const{x:n,width:o}=i,r=e.caretSize+e.caretPadding;if(s==="left"&&n+o+r>t.width||s==="right"&&n-o-r<0)return!0}function ld(s,t,e,i){const{x:n,width:o}=e,{width:r,chartArea:{left:a,right:l}}=s;let c="center";return i==="center"?c=n<=(a+l)/2?"left":"right":n<=o/2?c="left":n>=r-o/2&&(c="right"),ad(c,s,t,e)&&(c="center"),c}function dn(s,t,e){const i=e.yAlign||t.yAlign||rd(s,e);return{xAlign:e.xAlign||t.xAlign||ld(s,t,e,i),yAlign:i}}function cd(s,t){let{x:e,width:i}=s;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function hd(s,t,e){let{y:i,height:n}=s;return t==="top"?i+=e:t==="bottom"?i-=n+e:i-=n/2,i}function un(s,t,e,i){const{caretSize:n,caretPadding:o,cornerRadius:r}=s,{xAlign:a,yAlign:l}=e,c=n+o,{topLeft:h,topRight:d,bottomLeft:u,bottomRight:f}=te(r);let p=cd(t,a);const m=hd(t,l,c);return l==="center"?a==="left"?p+=c:a==="right"&&(p-=c):a==="left"?p-=Math.max(h,u)+n:a==="right"&&(p+=Math.max(d,f)+n),{x:it(p,0,i.width-t.width),y:it(m,0,i.height-t.height)}}function Ge(s,t,e){const i=ht(e.padding);return t==="center"?s.x+s.width/2:t==="right"?s.x+s.width-i.right:s.x+i.left}function fn(s){return gt([],vt(s))}function dd(s,t,e){return Xt(s,{tooltip:t,tooltipItems:e,type:"tooltip"})}function gn(s,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?s.override(e):s}const Ao={beforeTitle:xt,title(s){if(s.length>0){const t=s[0],e=t.chart.data.labels,i=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex<i)return e[t.dataIndex]}return""},afterTitle:xt,beforeBody:xt,beforeLabel:xt,label(s){if(this&&this.options&&this.options.mode==="dataset")return s.label+": "+s.formattedValue||s.formattedValue;let t=s.dataset.label||"";t&&(t+=": ");const e=s.formattedValue;return $(e)||(t+=e),t},labelColor(s){const e=s.chart.getDatasetMeta(s.datasetIndex).controller.getStyle(s.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(s){const e=s.chart.getDatasetMeta(s.datasetIndex).controller.getStyle(s.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:xt,afterBody:xt,beforeFooter:xt,footer:xt,afterFooter:xt};function tt(s,t,e,i){const n=s[t].call(e,i);return typeof n>"u"?Ao[t].call(e,i):n}class pn extends At{static positioners=be;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),n=i.enabled&&e.options.animation&&i.animations,o=new uo(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=dd(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,n=tt(i,"beforeTitle",this,t),o=tt(i,"title",this,t),r=tt(i,"afterTitle",this,t);let a=[];return a=gt(a,vt(n)),a=gt(a,vt(o)),a=gt(a,vt(r)),a}getBeforeBody(t,e){return fn(tt(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,n=[];return F(t,o=>{const r={before:[],lines:[],after:[]},a=gn(i,o);gt(r.before,vt(tt(a,"beforeLabel",this,o))),gt(r.lines,tt(a,"label",this,o)),gt(r.after,vt(tt(a,"afterLabel",this,o))),n.push(r)}),n}getAfterBody(t,e){return fn(tt(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,n=tt(i,"beforeFooter",this,t),o=tt(i,"footer",this,t),r=tt(i,"afterFooter",this,t);let a=[];return a=gt(a,vt(n)),a=gt(a,vt(o)),a=gt(a,vt(r)),a}_createItems(t){const e=this._active,i=this.chart.data,n=[],o=[],r=[];let a=[],l,c;for(l=0,c=e.length;l<c;++l)a.push(od(this.chart,e[l]));return t.filter&&(a=a.filter((h,d,u)=>t.filter(h,d,u,i))),t.itemSort&&(a=a.sort((h,d)=>t.itemSort(h,d,i))),F(a,h=>{const d=gn(t.callbacks,h);n.push(tt(d,"labelColor",this,h)),o.push(tt(d,"labelPointStyle",this,h)),r.push(tt(d,"labelTextColor",this,h))}),this.labelColors=n,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=a,a}update(t,e){const i=this.options.setContext(this.getContext()),n=this._active;let o,r=[];if(!n.length)this.opacity!==0&&(o={opacity:0});else{const a=be[i.position].call(this,n,this._eventPosition);r=this._createItems(i),this.title=this.getTitle(r,i),this.beforeBody=this.getBeforeBody(r,i),this.body=this.getBody(r,i),this.afterBody=this.getAfterBody(r,i),this.footer=this.getFooter(r,i);const l=this._size=hn(this,i),c=Object.assign({},a,l),h=dn(this.chart,i,c),d=un(i,c,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,o={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=r,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,n){const o=this.getCaretPosition(t,i,n);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(t,e,i){const{xAlign:n,yAlign:o}=this,{caretSize:r,cornerRadius:a}=i,{topLeft:l,topRight:c,bottomLeft:h,bottomRight:d}=te(a),{x:u,y:f}=t,{width:p,height:m}=e;let b,_,x,S,P,v;return o==="center"?(P=f+m/2,n==="left"?(b=u,_=b-r,S=P+r,v=P-r):(b=u+p,_=b+r,S=P-r,v=P+r),x=b):(n==="left"?_=u+Math.max(l,h)+r:n==="right"?_=u+p-Math.max(c,d)-r:_=this.caretX,o==="top"?(S=f,P=S-r,b=_-r,x=_+r):(S=f+m,P=S+r,b=_+r,x=_-r),v=S),{x1:b,x2:_,x3:x,y1:S,y2:P,y3:v}}drawTitle(t,e,i){const n=this.title,o=n.length;let r,a,l;if(o){const c=ee(i.rtl,this.x,this.width);for(t.x=Ge(this,i.titleAlign,i),e.textAlign=c.textAlign(i.titleAlign),e.textBaseline="middle",r=Q(i.titleFont),a=i.titleSpacing,e.fillStyle=i.titleColor,e.font=r.string,l=0;l<o;++l)e.fillText(n[l],c.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+a,l+1===o&&(t.y+=i.titleMarginBottom-a)}}_drawColorBox(t,e,i,n,o){const r=this.labelColors[i],a=this.labelPointStyles[i],{boxHeight:l,boxWidth:c}=o,h=Q(o.bodyFont),d=Ge(this,"left",o),u=n.x(d),f=l<h.lineHeight?(h.lineHeight-l)/2:0,p=e.y+f;if(o.usePointStyle){const m={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},b=n.leftForLtr(u,c)+c/2,_=p+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,As(t,m,b,_),t.strokeStyle=r.borderColor,t.fillStyle=r.backgroundColor,As(t,m,b,_)}else{t.lineWidth=R(r.borderWidth)?Math.max(...Object.values(r.borderWidth)):r.borderWidth||1,t.strokeStyle=r.borderColor,t.setLineDash(r.borderDash||[]),t.lineDashOffset=r.borderDashOffset||0;const m=n.leftForLtr(u,c),b=n.leftForLtr(n.xPlus(u,1),c-2),_=te(r.borderRadius);Object.values(_).some(x=>x!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,ns(t,{x:m,y:p,w:c,h:l,radius:_}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),ns(t,{x:b,y:p+1,w:c-2,h:l-2,radius:_}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(m,p,c,l),t.strokeRect(m,p,c,l),t.fillStyle=r.backgroundColor,t.fillRect(b,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:n}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:h}=i,d=Q(i.bodyFont);let u=d.lineHeight,f=0;const p=ee(i.rtl,this.x,this.width),m=function(k){e.fillText(k,p.x(t.x+f),t.y+u/2),t.y+=u+o},b=p.textAlign(r);let _,x,S,P,v,M,w;for(e.textAlign=r,e.textBaseline="middle",e.font=d.string,t.x=Ge(this,b,i),e.fillStyle=i.bodyColor,F(this.beforeBody,m),f=a&&b!=="right"?r==="center"?c/2+h:c+2+h:0,P=0,M=n.length;P<M;++P){for(_=n[P],x=this.labelTextColors[P],e.fillStyle=x,F(_.before,m),S=_.lines,a&&S.length&&(this._drawColorBox(e,t,P,p,i),u=Math.max(d.lineHeight,l)),v=0,w=S.length;v<w;++v)m(S[v]),u=d.lineHeight;F(_.after,m)}f=0,u=d.lineHeight,F(this.afterBody,m),t.y-=o}drawFooter(t,e,i){const n=this.footer,o=n.length;let r,a;if(o){const l=ee(i.rtl,this.x,this.width);for(t.x=Ge(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=l.textAlign(i.footerAlign),e.textBaseline="middle",r=Q(i.footerFont),e.fillStyle=i.footerColor,e.font=r.string,a=0;a<o;++a)e.fillText(n[a],l.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+i.footerSpacing}}drawBackground(t,e,i,n){const{xAlign:o,yAlign:r}=this,{x:a,y:l}=t,{width:c,height:h}=i,{topLeft:d,topRight:u,bottomLeft:f,bottomRight:p}=te(n.cornerRadius);e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.beginPath(),e.moveTo(a+d,l),r==="top"&&this.drawCaret(t,e,i,n),e.lineTo(a+c-u,l),e.quadraticCurveTo(a+c,l,a+c,l+u),r==="center"&&o==="right"&&this.drawCaret(t,e,i,n),e.lineTo(a+c,l+h-p),e.quadraticCurveTo(a+c,l+h,a+c-p,l+h),r==="bottom"&&this.drawCaret(t,e,i,n),e.lineTo(a+f,l+h),e.quadraticCurveTo(a,l+h,a,l+h-f),r==="center"&&o==="left"&&this.drawCaret(t,e,i,n),e.lineTo(a,l+d),e.quadraticCurveTo(a,l,a+d,l),e.closePath(),e.fill(),n.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,n=i&&i.x,o=i&&i.y;if(n||o){const r=be[t.position].call(this,this._active,this._eventPosition);if(!r)return;const a=this._size=hn(this,t),l=Object.assign({},r,this._size),c=dn(e,t,l),h=un(t,l,c,e);(n._to!==h.x||o._to!==h.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=r.x,this.caretY=r.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const n={width:this.width,height:this.height},o={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const r=ht(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=i,this.drawBackground(o,t,n,e),lo(t,e.textDirection),o.y+=r.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),co(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,n=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),o=!es(i,n),r=this._positionChanged(n,e);(o||r)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,o=this._active||[],r=this._getActiveElements(t,o,e,i),a=this._positionChanged(r,t),l=e||!es(r,o)||a;return l&&(this._active=r,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,i,n){const o=this.options;if(t.type==="mouseout")return[];if(!n)return e.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const r=this.chart.getElementsAtEventForMode(t,o.mode,o,i);return o.reverse&&r.reverse(),r}_positionChanged(t,e){const{caretX:i,caretY:n,options:o}=this,r=be[o.position].call(this,t,e);return r!==!1&&(i!==r.x||n!==r.y)}}var ud={id:"tooltip",_element:pn,positioners:be,afterInit(s,t,e){e&&(s.tooltip=new pn({chart:s,options:e}))},beforeUpdate(s,t,e){s.tooltip&&s.tooltip.initialize(e)},reset(s,t,e){s.tooltip&&s.tooltip.initialize(e)},afterDraw(s){const t=s.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(s.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(s.ctx),s.notifyPlugins("afterTooltipDraw",e)}},afterEvent(s,t){if(s.tooltip){const e=t.replay;s.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(s,t)=>t.bodyFont.size,boxWidth:(s,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Ao},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:s=>s!=="filter"&&s!=="itemSort"&&s!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const fd=(s,t,e,i)=>(typeof t=="string"?(e=s.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function gd(s,t,e,i){const n=s.indexOf(t);if(n===-1)return fd(s,t,e,i);const o=s.lastIndexOf(t);return n!==o?e:n}const pd=(s,t)=>s===null?null:it(Math.round(s),0,t);function mn(s){const t=this.getLabels();return s>=0&&s<t.length?t[s]:s}class md extends oe{static id="category";static defaults={ticks:{callback:mn}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const i=this.getLabels();for(const{index:n,label:o}of e)i[n]===o&&i.splice(n,1);this._addedLabels=[]}super.init(t)}parse(t,e){if($(t))return null;const i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:gd(i,t,I(e,t),this._addedLabels),pd(e,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:n}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),e||(n=this.getLabels().length-1)),this.min=i,this.max=n}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,n=[];let o=this.getLabels();o=t===0&&e===o.length-1?o:o.slice(t,e+1),this._valueRange=Math.max(o.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let r=t;r<=e;r++)n.push({value:r});return n}getLabelForValue(t){return mn.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function bd(s,t){const e=[],{bounds:n,step:o,min:r,max:a,precision:l,count:c,maxTicks:h,maxDigits:d,includeBounds:u}=s,f=o||1,p=h-1,{min:m,max:b}=t,_=!$(r),x=!$(a),S=!$(c),P=(b-m)/(d+1);let v=pi((b-m)/p/f)*f,M,w,k,y;if(v<1e-14&&!_&&!x)return[{value:m},{value:b}];y=Math.ceil(b/v)-Math.floor(m/v),y>p&&(v=pi(y*v/p/f)*f),$(l)||(M=Math.pow(10,l),v=Math.ceil(v*M)/M),n==="ticks"?(w=Math.floor(m/v)*v,k=Math.ceil(b/v)*v):(w=m,k=b),_&&x&&o&&Na((a-r)/o,v/1e3)?(y=Math.round(Math.min((a-r)/v,h)),v=(a-r)/y,w=r,k=a):S?(w=_?r:w,k=x?a:k,y=c-1,v=(k-w)/y):(y=(k-w)/v,ye(y,Math.round(y),v/1e3)?y=Math.round(y):y=Math.ceil(y));const A=Math.max(mi(v),mi(w));M=Math.pow(10,$(l)?A:l),w=Math.round(w*M)/M,k=Math.round(k*M)/M;let T=0;for(_&&(u&&w!==r?(e.push({value:r}),w<r&&T++,ye(Math.round((w+T*v)*M)/M,r,bn(r,P,s))&&T++):w<r&&T++);T<y;++T){const L=Math.round((w+T*v)*M)/M;if(x&&L>a)break;e.push({value:L})}return x&&u&&k!==a?e.length&&ye(e[e.length-1].value,a,bn(a,P,s))?e[e.length-1].value=a:e.push({value:a}):(!x||k===a)&&e.push({value:k}),e}function bn(s,t,{horizontal:e,minRotation:i}){const n=Nt(i),o=(e?Math.sin(n):Math.cos(n))||.001,r=.75*t*(""+s).length;return Math.min(t/o,r)}class _d extends oe{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return $(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:n,max:o}=this;const r=l=>n=e?n:l,a=l=>o=i?o:l;if(t){const l=_t(n),c=_t(o);l<0&&c<0?a(0):l>0&&c>0&&r(0)}if(n===o){let l=o===0?1:Math.abs(o*.05);a(o+l),t||r(n-l)}this.min=n,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:i}=t,n;return i?(n=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,n>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${n} ticks. Limiting to 1000.`),n=1e3)):(n=this.computeTickLimit(),e=e||11),e&&(n=Math.min(e,n)),n}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const n={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},o=this._range||this,r=bd(n,o);return t.bounds==="ticks"&&Wa(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const n=(i-e)/Math.max(t.length-1,1)/2;e-=n,i+=n}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return Qn(t,this.chart.options.locale,this.options.ticks.format)}}class xd extends _d{static id="linear";static defaults={ticks:{callback:Zn.formatters.numeric}};determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=ct(t)?t:0,this.max=ct(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=Nt(this.options.ticks.minRotation),n=(t?Math.sin(i):Math.cos(i))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/n))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}const hs={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},et=Object.keys(hs);function _n(s,t){return s-t}function xn(s,t){if($(t))return null;const e=s._adapter,{parser:i,round:n,isoWeekday:o}=s._parseOpts;let r=t;return typeof i=="function"&&(r=i(r)),ct(r)||(r=typeof i=="string"?e.parse(r,i):e.parse(r)),r===null?null:(n&&(r=n==="week"&&(Ce(o)||o===!0)?e.startOf(r,"isoWeek",o):e.startOf(r,n)),+r)}function yn(s,t,e,i){const n=et.length;for(let o=et.indexOf(s);o<n-1;++o){const r=hs[et[o]],a=r.steps?r.steps:Number.MAX_SAFE_INTEGER;if(r.common&&Math.ceil((e-t)/(a*r.size))<=i)return et[o]}return et[n-1]}function yd(s,t,e,i,n){for(let o=et.length-1;o>=et.indexOf(e);o--){const r=et[o];if(hs[r].common&&s._adapter.diff(n,i,r)>=t-1)return r}return et[e?et.indexOf(e):0]}function vd(s){for(let t=et.indexOf(s)+1,e=et.length;t<e;++t)if(hs[et[t]].common)return et[t]}function vn(s,t,e){if(!e)s[t]=!0;else if(e.length){const{lo:i,hi:n}=Ks(e,t),o=e[i]>=t?e[i]:e[n];s[o]=!0}}function Sd(s,t,e,i){const n=s._adapter,o=+n.startOf(t[0].value,i),r=t[t.length-1].value;let a,l;for(a=o;a<=r;a=+n.add(a,1,i))l=e[a],l>=0&&(t[l].major=!0);return t}function Sn(s,t,e){const i=[],n={},o=t.length;let r,a;for(r=0;r<o;++r)a=t[r],n[a]=r,i.push({value:a,major:!1});return o===0||!e?i:Sd(s,i,n,e)}class wn extends oe{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const i=t.time||(t.time={}),n=this._adapter=new kc._date(t.adapters.date);n.init(e),xe(i.displayFormats,n.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:xn(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:n,max:o,minDefined:r,maxDefined:a}=this.getUserBounds();function l(c){!r&&!isNaN(c.min)&&(n=Math.min(n,c.min)),!a&&!isNaN(c.max)&&(o=Math.max(o,c.max))}(!r||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),n=ct(n)&&!isNaN(n)?n:+e.startOf(Date.now(),i),o=ct(o)&&!isNaN(o)?o:+e.endOf(Date.now(),i)+1,this.min=Math.min(n,o-1),this.max=Math.max(n+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,n=i.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&n.length&&(this.min=this._userMin||n[0],this.max=this._userMax||n[n.length-1]);const o=this.min,r=this.max,a=Xa(n,o,r);return this._unit=e.unit||(i.autoSkip?yn(e.minUnit,this.min,this.max,this._getLabelCapacity(o)):yd(this,a.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:vd(this._unit),this.initOffsets(n),t.reverse&&a.reverse(),Sn(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,i=0,n,o;this.options.offset&&t.length&&(n=this.getDecimalForValue(t[0]),t.length===1?e=1-n:e=(this.getDecimalForValue(t[1])-n)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?i=o:i=(o-this.getDecimalForValue(t[t.length-2]))/2);const r=t.length<3?.5:.25;e=it(e,0,r),i=it(i,0,r),this._offsets={start:e,end:i,factor:1/(e+1+i)}}_generate(){const t=this._adapter,e=this.min,i=this.max,n=this.options,o=n.time,r=o.unit||yn(o.minUnit,e,i,this._getLabelCapacity(e)),a=I(n.ticks.stepSize,1),l=r==="week"?o.isoWeekday:!1,c=Ce(l)||l===!0,h={};let d=e,u,f;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":r),t.diff(i,e,r)>1e5*a)throw new Error(e+" and "+i+" are too far apart with stepSize of "+a+" "+r);const p=n.ticks.source==="data"&&this.getDataTimestamps();for(u=d,f=0;u<i;u=+t.add(u,a,r),f++)vn(h,u,p);return(u===i||n.bounds==="ticks"||f===1)&&vn(h,u,p),Object.keys(h).sort(_n).map(m=>+m)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const n=this.options.time.displayFormats,o=this._unit,r=e||n[o];return this._adapter.format(t,r)}_tickFormatFunction(t,e,i,n){const o=this.options,r=o.ticks.callback;if(r)return H(r,[t,e,i],this);const a=o.time.displayFormats,l=this._unit,c=this._majorUnit,h=l&&a[l],d=c&&a[c],u=i[e],f=c&&d&&u&&u.major;return this._adapter.format(t,n||(f?d:h))}generateTickLabels(t){let e,i,n;for(e=0,i=t.length;e<i;++e)n=t[e],n.label=this._tickFormatFunction(n.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,i=this.ctx.measureText(t).width,n=Nt(this.isHorizontal()?e.maxRotation:e.minRotation),o=Math.cos(n),r=Math.sin(n),a=this._resolveTickFontOptions(0).size;return{w:i*o+a*r,h:i*r+a*o}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,n=i[e.unit]||i.millisecond,o=this._tickFormatFunction(t,0,Sn(this,[t],this._majorUnit),n),r=this._getLabelSize(o),a=Math.floor(this.isHorizontal()?this.width/r.w:this.height/r.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],e,i;if(t.length)return t;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(e=0,i=n.length;e<i;++e)t=t.concat(n[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;const n=this.getLabels();for(e=0,i=n.length;e<i;++e)t.push(xn(this,n[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Xn(t.sort(_n))}}function Je(s,t,e){let i=0,n=s.length-1,o,r,a,l;e?(t>=s[i].pos&&t<=s[n].pos&&({lo:i,hi:n}=Vt(s,"pos",t)),{pos:o,time:a}=s[i],{pos:r,time:l}=s[n]):(t>=s[i].time&&t<=s[n].time&&({lo:i,hi:n}=Vt(s,"time",t)),{time:o,pos:a}=s[i],{time:r,pos:l}=s[n]);const c=r-o;return c?a+(l-a)*(t-o)/c:a}class tg extends wn{static id="timeseries";static defaults=wn.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Je(e,this.min),this._tableRange=Je(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,n=[],o=[];let r,a,l,c,h;for(r=0,a=t.length;r<a;++r)c=t[r],c>=e&&c<=i&&n.push(c);if(n.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(r=0,a=n.length;r<a;++r)h=n[r+1],l=n[r-1],c=n[r],Math.round((h+l)/2)!==c&&o.push({time:c,pos:r/(a-1)});return o}_generate(){const t=this.min,e=this.max;let i=super.getDataTimestamps();return(!i.includes(t)||!i.length)&&i.splice(0,0,t),(!i.includes(e)||i.length===1)&&i.push(e),i.sort((n,o)=>n-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return e.length&&i.length?t=this.normalize(e.concat(i)):t=e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(Je(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return Je(this._table,i*this._tableRange+this._minPos,!0)}}const Lo={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},wd={ariaLabel:{type:String},ariaDescribedby:{type:String}},kd={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...Lo,...wd},Pd=Xo[0]==="2"?(s,t)=>Object.assign(s,{attrs:t}):(s,t)=>Object.assign(s,t);function qt(s){return In(s)?Ms(s):s}function Md(s){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:s;return In(t)?new Proxy(s,{}):s}function Cd(s,t){const e=s.options;e&&t&&Object.assign(e,t)}function Io(s,t){s.labels=t}function Ro(s,t,e){const i=[];s.datasets=t.map(n=>{const o=s.datasets.find(r=>r[e]===n[e]);return!o||!n.data||i.includes(o)?{...n}:(i.push(o),Object.assign(o,n),o)})}function Dd(s,t){const e={labels:[],datasets:[]};return Io(e,s.labels),Ro(e,s.datasets,t),e}const Od=Tn({props:kd,setup(s,t){let{expose:e,slots:i}=t;const n=Ut(null),o=An(null);e({chart:o});const r=()=>{if(!n.value)return;const{type:c,data:h,options:d,plugins:u,datasetIdKey:f}=s,p=Dd(h,f),m=Md(p,h);o.value=new cs(n.value,{type:c,data:m,options:{...d},plugins:u})},a=()=>{const c=Ms(o.value);c&&(s.destroyDelay>0?setTimeout(()=>{c.destroy(),o.value=null},s.destroyDelay):(c.destroy(),o.value=null))},l=c=>{c.update(s.updateMode)};return Ln(r),Go(a),On([()=>s.options,()=>s.data],(c,h)=>{let[d,u]=c,[f,p]=h;const m=Ms(o.value);if(!m)return;let b=!1;if(d){const _=qt(d),x=qt(f);_&&_!==x&&(Cd(m,_),b=!0)}if(u){const _=qt(u.labels),x=qt(p.labels),S=qt(u.datasets),P=qt(p.datasets);_!==x&&(Io(m.config.data,_),b=!0),S&&S!==P&&(Ro(m.config.data,S,s.datasetIdKey),b=!0)}b&&Jo(()=>{l(m)})},{deep:!0}),()=>Ps("canvas",{role:"img",ariaLabel:s.ariaLabel,ariaDescribedby:s.ariaDescribedby,ref:n},[Ps("p",{},[i.default?i.default():""])])}});function Eo(s,t){return cs.register(t),Tn({props:Lo,setup(e,i){let{expose:n}=i;const o=An(null),r=a=>{o.value=a?.chart};return n({chart:o}),()=>Ps(Od,Pd({ref:r},{type:s,...e}))}})}const Td=Eo("bar",po),Ad=Eo("line",mo);function wt(s){return Array.isArray?Array.isArray(s):zo(s)==="[object Array]"}const Ld=1/0;function Id(s){if(typeof s=="string")return s;let t=s+"";return t=="0"&&1/s==-Ld?"-0":t}function Rd(s){return s==null?"":Id(s)}function mt(s){return typeof s=="string"}function Fo(s){return typeof s=="number"}function Ed(s){return s===!0||s===!1||Fd(s)&&zo(s)=="[object Boolean]"}function Bo(s){return typeof s=="object"}function Fd(s){return Bo(s)&&s!==null}function st(s){return s!=null}function ws(s){return!s.trim().length}function zo(s){return s==null?s===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(s)}const Bd="Incorrect 'index' type",zd=s=>`Invalid value for key ${s}`,$d=s=>`Pattern length exceeds max of ${s}.`,Hd=s=>`Missing ${s} property in key`,Nd=s=>`Property 'weight' in key '${s}' must be a positive integer`,kn=Object.prototype.hasOwnProperty;class Wd{constructor(t){this._keys=[],this._keyMap={};let e=0;t.forEach(i=>{let n=$o(i);this._keys.push(n),this._keyMap[n.id]=n,e+=n.weight}),this._keys.forEach(i=>{i.weight/=e})}get(t){return this._keyMap[t]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function $o(s){let t=null,e=null,i=null,n=1,o=null;if(mt(s)||wt(s))i=s,t=Pn(s),e=Es(s);else{if(!kn.call(s,"name"))throw new Error(Hd("name"));const r=s.name;if(i=r,kn.call(s,"weight")&&(n=s.weight,n<=0))throw new Error(Nd(r));t=Pn(r),e=Es(r),o=s.getFn}return{path:t,id:e,weight:n,src:i,getFn:o}}function Pn(s){return wt(s)?s:s.split(".")}function Es(s){return wt(s)?s.join("."):s}function Vd(s,t){let e=[],i=!1;const n=(o,r,a)=>{if(st(o))if(!r[a])e.push(o);else{let l=r[a];const c=o[l];if(!st(c))return;if(a===r.length-1&&(mt(c)||Fo(c)||Ed(c)))e.push(Rd(c));else if(wt(c)){i=!0;for(let h=0,d=c.length;h<d;h+=1)n(c[h],r,a+1)}else r.length&&n(c,r,a+1)}};return n(s,mt(t)?t.split("."):t,0),i?e:e[0]}const jd={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},Ud={isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(s,t)=>s.score===t.score?s.idx<t.idx?-1:1:s.score<t.score?-1:1},Yd={location:0,threshold:.6,distance:100},Kd={useExtendedSearch:!1,getFn:Vd,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};var O={...Ud,...jd,...Yd,...Kd};const Xd=/[^ ]+/g;function Gd(s=1,t=3){const e=new Map,i=Math.pow(10,t);return{get(n){const o=n.match(Xd).length;if(e.has(o))return e.get(o);const r=1/Math.pow(o,.5*s),a=parseFloat(Math.round(r*i)/i);return e.set(o,a),a},clear(){e.clear()}}}class oi{constructor({getFn:t=O.getFn,fieldNormWeight:e=O.fieldNormWeight}={}){this.norm=Gd(e,3),this.getFn=t,this.isCreated=!1,this.setIndexRecords()}setSources(t=[]){this.docs=t}setIndexRecords(t=[]){this.records=t}setKeys(t=[]){this.keys=t,this._keysMap={},t.forEach((e,i)=>{this._keysMap[e.id]=i})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,mt(this.docs[0])?this.docs.forEach((t,e)=>{this._addString(t,e)}):this.docs.forEach((t,e)=>{this._addObject(t,e)}),this.norm.clear())}add(t){const e=this.size();mt(t)?this._addString(t,e):this._addObject(t,e)}removeAt(t){this.records.splice(t,1);for(let e=t,i=this.size();e<i;e+=1)this.records[e].i-=1}getValueForItemAtKeyId(t,e){return t[this._keysMap[e]]}size(){return this.records.length}_addString(t,e){if(!st(t)||ws(t))return;let i={v:t,i:e,n:this.norm.get(t)};this.records.push(i)}_addObject(t,e){let i={i:e,$:{}};this.keys.forEach((n,o)=>{let r=n.getFn?n.getFn(t):this.getFn(t,n.path);if(st(r)){if(wt(r)){let a=[];const l=[{nestedArrIndex:-1,value:r}];for(;l.length;){const{nestedArrIndex:c,value:h}=l.pop();if(st(h))if(mt(h)&&!ws(h)){let d={v:h,i:c,n:this.norm.get(h)};a.push(d)}else wt(h)&&h.forEach((d,u)=>{l.push({nestedArrIndex:u,value:d})})}i.$[o]=a}else if(mt(r)&&!ws(r)){let a={v:r,n:this.norm.get(r)};i.$[o]=a}}}),this.records.push(i)}toJSON(){return{keys:this.keys,records:this.records}}}function Ho(s,t,{getFn:e=O.getFn,fieldNormWeight:i=O.fieldNormWeight}={}){const n=new oi({getFn:e,fieldNormWeight:i});return n.setKeys(s.map($o)),n.setSources(t),n.create(),n}function Jd(s,{getFn:t=O.getFn,fieldNormWeight:e=O.fieldNormWeight}={}){const{keys:i,records:n}=s,o=new oi({getFn:t,fieldNormWeight:e});return o.setKeys(i),o.setIndexRecords(n),o}function Qe(s,{errors:t=0,currentLocation:e=0,expectedLocation:i=0,distance:n=O.distance,ignoreLocation:o=O.ignoreLocation}={}){const r=t/s.length;if(o)return r;const a=Math.abs(i-e);return n?r+a/n:a?1:r}function Qd(s=[],t=O.minMatchCharLength){let e=[],i=-1,n=-1,o=0;for(let r=s.length;o<r;o+=1){let a=s[o];a&&i===-1?i=o:!a&&i!==-1&&(n=o-1,n-i+1>=t&&e.push([i,n]),i=-1)}return s[o-1]&&o-i>=t&&e.push([i,o-1]),e}const Ht=32;function qd(s,t,e,{location:i=O.location,distance:n=O.distance,threshold:o=O.threshold,findAllMatches:r=O.findAllMatches,minMatchCharLength:a=O.minMatchCharLength,includeMatches:l=O.includeMatches,ignoreLocation:c=O.ignoreLocation}={}){if(t.length>Ht)throw new Error($d(Ht));const h=t.length,d=s.length,u=Math.max(0,Math.min(i,d));let f=o,p=u;const m=a>1||l,b=m?Array(d):[];let _;for(;(_=s.indexOf(t,p))>-1;){let w=Qe(t,{currentLocation:_,expectedLocation:u,distance:n,ignoreLocation:c});if(f=Math.min(w,f),p=_+h,m){let k=0;for(;k<h;)b[_+k]=1,k+=1}}p=-1;let x=[],S=1,P=h+d;const v=1<<h-1;for(let w=0;w<h;w+=1){let k=0,y=P;for(;k<y;)Qe(t,{errors:w,currentLocation:u+y,expectedLocation:u,distance:n,ignoreLocation:c})<=f?k=y:P=y,y=Math.floor((P-k)/2+k);P=y;let A=Math.max(1,u-y+1),T=r?d:Math.min(u+y,d)+h,L=Array(T+2);L[T+1]=(1<<w)-1;for(let V=T;V>=A;V-=1){let z=V-1,Y=e[s.charAt(z)];if(m&&(b[z]=+!!Y),L[V]=(L[V+1]<<1|1)&Y,w&&(L[V]|=(x[V+1]|x[V])<<1|1|x[V+1]),L[V]&v&&(S=Qe(t,{errors:w,currentLocation:z,expectedLocation:u,distance:n,ignoreLocation:c}),S<=f)){if(f=S,p=z,p<=u)break;A=Math.max(1,2*u-p)}}if(Qe(t,{errors:w+1,currentLocation:u,expectedLocation:u,distance:n,ignoreLocation:c})>f)break;x=L}const M={isMatch:p>=0,score:Math.max(.001,S)};if(m){const w=Qd(b,a);w.length?l&&(M.indices=w):M.isMatch=!1}return M}function Zd(s){let t={};for(let e=0,i=s.length;e<i;e+=1){const n=s.charAt(e);t[n]=(t[n]||0)|1<<i-e-1}return t}class No{constructor(t,{location:e=O.location,threshold:i=O.threshold,distance:n=O.distance,includeMatches:o=O.includeMatches,findAllMatches:r=O.findAllMatches,minMatchCharLength:a=O.minMatchCharLength,isCaseSensitive:l=O.isCaseSensitive,ignoreLocation:c=O.ignoreLocation}={}){if(this.options={location:e,threshold:i,distance:n,includeMatches:o,findAllMatches:r,minMatchCharLength:a,isCaseSensitive:l,ignoreLocation:c},this.pattern=l?t:t.toLowerCase(),this.chunks=[],!this.pattern.length)return;const h=(u,f)=>{this.chunks.push({pattern:u,alphabet:Zd(u),startIndex:f})},d=this.pattern.length;if(d>Ht){let u=0;const f=d%Ht,p=d-f;for(;u<p;)h(this.pattern.substr(u,Ht),u),u+=Ht;if(f){const m=d-Ht;h(this.pattern.substr(m),m)}}else h(this.pattern,0)}searchIn(t){const{isCaseSensitive:e,includeMatches:i}=this.options;if(e||(t=t.toLowerCase()),this.pattern===t){let p={isMatch:!0,score:0};return i&&(p.indices=[[0,t.length-1]]),p}const{location:n,distance:o,threshold:r,findAllMatches:a,minMatchCharLength:l,ignoreLocation:c}=this.options;let h=[],d=0,u=!1;this.chunks.forEach(({pattern:p,alphabet:m,startIndex:b})=>{const{isMatch:_,score:x,indices:S}=qd(t,p,m,{location:n+b,distance:o,threshold:r,findAllMatches:a,minMatchCharLength:l,includeMatches:i,ignoreLocation:c});_&&(u=!0),d+=x,_&&S&&(h=[...h,...S])});let f={isMatch:u,score:u?d/this.chunks.length:1};return u&&i&&(f.indices=h),f}}class Lt{constructor(t){this.pattern=t}static isMultiMatch(t){return Mn(t,this.multiRegex)}static isSingleMatch(t){return Mn(t,this.singleRegex)}search(){}}function Mn(s,t){const e=s.match(t);return e?e[1]:null}class tu extends Lt{constructor(t){super(t)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(t){const e=t===this.pattern;return{isMatch:e,score:e?0:1,indices:[0,this.pattern.length-1]}}}class eu extends Lt{constructor(t){super(t)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(t){const i=t.indexOf(this.pattern)===-1;return{isMatch:i,score:i?0:1,indices:[0,t.length-1]}}}class su extends Lt{constructor(t){super(t)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(t){const e=t.startsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,this.pattern.length-1]}}}class iu extends Lt{constructor(t){super(t)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(t){const e=!t.startsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,t.length-1]}}}class nu extends Lt{constructor(t){super(t)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(t){const e=t.endsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[t.length-this.pattern.length,t.length-1]}}}class ou extends Lt{constructor(t){super(t)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(t){const e=!t.endsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,t.length-1]}}}class Wo extends Lt{constructor(t,{location:e=O.location,threshold:i=O.threshold,distance:n=O.distance,includeMatches:o=O.includeMatches,findAllMatches:r=O.findAllMatches,minMatchCharLength:a=O.minMatchCharLength,isCaseSensitive:l=O.isCaseSensitive,ignoreLocation:c=O.ignoreLocation}={}){super(t),this._bitapSearch=new No(t,{location:e,threshold:i,distance:n,includeMatches:o,findAllMatches:r,minMatchCharLength:a,isCaseSensitive:l,ignoreLocation:c})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(t){return this._bitapSearch.searchIn(t)}}class Vo extends Lt{constructor(t){super(t)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(t){let e=0,i;const n=[],o=this.pattern.length;for(;(i=t.indexOf(this.pattern,e))>-1;)e=i+o,n.push([i,e-1]);const r=!!n.length;return{isMatch:r,score:r?0:1,indices:n}}}const Fs=[tu,Vo,su,iu,ou,nu,eu,Wo],Cn=Fs.length,ru=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,au="|";function lu(s,t={}){return s.split(au).map(e=>{let i=e.trim().split(ru).filter(o=>o&&!!o.trim()),n=[];for(let o=0,r=i.length;o<r;o+=1){const a=i[o];let l=!1,c=-1;for(;!l&&++c<Cn;){const h=Fs[c];let d=h.isMultiMatch(a);d&&(n.push(new h(d,t)),l=!0)}if(!l)for(c=-1;++c<Cn;){const h=Fs[c];let d=h.isSingleMatch(a);if(d){n.push(new h(d,t));break}}}return n})}const cu=new Set([Wo.type,Vo.type]);class hu{constructor(t,{isCaseSensitive:e=O.isCaseSensitive,includeMatches:i=O.includeMatches,minMatchCharLength:n=O.minMatchCharLength,ignoreLocation:o=O.ignoreLocation,findAllMatches:r=O.findAllMatches,location:a=O.location,threshold:l=O.threshold,distance:c=O.distance}={}){this.query=null,this.options={isCaseSensitive:e,includeMatches:i,minMatchCharLength:n,findAllMatches:r,ignoreLocation:o,location:a,threshold:l,distance:c},this.pattern=e?t:t.toLowerCase(),this.query=lu(this.pattern,this.options)}static condition(t,e){return e.useExtendedSearch}searchIn(t){const e=this.query;if(!e)return{isMatch:!1,score:1};const{includeMatches:i,isCaseSensitive:n}=this.options;t=n?t:t.toLowerCase();let o=0,r=[],a=0;for(let l=0,c=e.length;l<c;l+=1){const h=e[l];r.length=0,o=0;for(let d=0,u=h.length;d<u;d+=1){const f=h[d],{isMatch:p,indices:m,score:b}=f.search(t);if(p){if(o+=1,a+=b,i){const _=f.constructor.type;cu.has(_)?r=[...r,...m]:r.push(m)}}else{a=0,o=0,r.length=0;break}}if(o){let d={isMatch:!0,score:a/o};return i&&(d.indices=r),d}}return{isMatch:!1,score:1}}}const Bs=[];function du(...s){Bs.push(...s)}function zs(s,t){for(let e=0,i=Bs.length;e<i;e+=1){let n=Bs[e];if(n.condition(s,t))return new n(s,t)}return new No(s,t)}const as={AND:"$and",OR:"$or"},$s={PATH:"$path",PATTERN:"$val"},Hs=s=>!!(s[as.AND]||s[as.OR]),uu=s=>!!s[$s.PATH],fu=s=>!wt(s)&&Bo(s)&&!Hs(s),Dn=s=>({[as.AND]:Object.keys(s).map(t=>({[t]:s[t]}))});function jo(s,t,{auto:e=!0}={}){const i=n=>{let o=Object.keys(n);const r=uu(n);if(!r&&o.length>1&&!Hs(n))return i(Dn(n));if(fu(n)){const l=r?n[$s.PATH]:o[0],c=r?n[$s.PATTERN]:n[l];if(!mt(c))throw new Error(zd(l));const h={keyId:Es(l),pattern:c};return e&&(h.searcher=zs(c,t)),h}let a={children:[],operator:o[0]};return o.forEach(l=>{const c=n[l];wt(c)&&c.forEach(h=>{a.children.push(i(h))})}),a};return Hs(s)||(s=Dn(s)),i(s)}function gu(s,{ignoreFieldNorm:t=O.ignoreFieldNorm}){s.forEach(e=>{let i=1;e.matches.forEach(({key:n,norm:o,score:r})=>{const a=n?n.weight:null;i*=Math.pow(r===0&&a?Number.EPSILON:r,(a||1)*(t?1:o))}),e.score=i})}function pu(s,t){const e=s.matches;t.matches=[],st(e)&&e.forEach(i=>{if(!st(i.indices)||!i.indices.length)return;const{indices:n,value:o}=i;let r={indices:n,value:o};i.key&&(r.key=i.key.src),i.idx>-1&&(r.refIndex=i.idx),t.matches.push(r)})}function mu(s,t){t.score=s.score}function bu(s,t,{includeMatches:e=O.includeMatches,includeScore:i=O.includeScore}={}){const n=[];return e&&n.push(pu),i&&n.push(mu),s.map(o=>{const{idx:r}=o,a={item:t[r],refIndex:r};return n.length&&n.forEach(l=>{l(o,a)}),a})}class re{constructor(t,e={},i){this.options={...O,...e},this.options.useExtendedSearch,this._keyStore=new Wd(this.options.keys),this.setCollection(t,i)}setCollection(t,e){if(this._docs=t,e&&!(e instanceof oi))throw new Error(Bd);this._myIndex=e||Ho(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(t){st(t)&&(this._docs.push(t),this._myIndex.add(t))}remove(t=()=>!1){const e=[];for(let i=0,n=this._docs.length;i<n;i+=1){const o=this._docs[i];t(o,i)&&(this.removeAt(i),i-=1,n-=1,e.push(o))}return e}removeAt(t){this._docs.splice(t,1),this._myIndex.removeAt(t)}getIndex(){return this._myIndex}search(t,{limit:e=-1}={}){const{includeMatches:i,includeScore:n,shouldSort:o,sortFn:r,ignoreFieldNorm:a}=this.options;let l=mt(t)?mt(this._docs[0])?this._searchStringList(t):this._searchObjectList(t):this._searchLogical(t);return gu(l,{ignoreFieldNorm:a}),o&&l.sort(r),Fo(e)&&e>-1&&(l=l.slice(0,e)),bu(l,this._docs,{includeMatches:i,includeScore:n})}_searchStringList(t){const e=zs(t,this.options),{records:i}=this._myIndex,n=[];return i.forEach(({v:o,i:r,n:a})=>{if(!st(o))return;const{isMatch:l,score:c,indices:h}=e.searchIn(o);l&&n.push({item:o,idx:r,matches:[{score:c,value:o,norm:a,indices:h}]})}),n}_searchLogical(t){const e=jo(t,this.options),i=(a,l,c)=>{if(!a.children){const{keyId:d,searcher:u}=a,f=this._findMatches({key:this._keyStore.get(d),value:this._myIndex.getValueForItemAtKeyId(l,d),searcher:u});return f&&f.length?[{idx:c,item:l,matches:f}]:[]}const h=[];for(let d=0,u=a.children.length;d<u;d+=1){const f=a.children[d],p=i(f,l,c);if(p.length)h.push(...p);else if(a.operator===as.AND)return[]}return h},n=this._myIndex.records,o={},r=[];return n.forEach(({$:a,i:l})=>{if(st(a)){let c=i(e,a,l);c.length&&(o[l]||(o[l]={idx:l,item:a,matches:[]},r.push(o[l])),c.forEach(({matches:h})=>{o[l].matches.push(...h)}))}}),r}_searchObjectList(t){const e=zs(t,this.options),{keys:i,records:n}=this._myIndex,o=[];return n.forEach(({$:r,i:a})=>{if(!st(r))return;let l=[];i.forEach((c,h)=>{l.push(...this._findMatches({key:c,value:r[h],searcher:e}))}),l.length&&o.push({idx:a,item:r,matches:l})}),o}_findMatches({key:t,value:e,searcher:i}){if(!st(e))return[];let n=[];if(wt(e))e.forEach(({v:o,i:r,n:a})=>{if(!st(o))return;const{isMatch:l,score:c,indices:h}=i.searchIn(o);l&&n.push({score:c,key:t,value:o,idx:r,norm:a,indices:h})});else{const{v:o,n:r}=e,{isMatch:a,score:l,indices:c}=i.searchIn(o);a&&n.push({score:l,key:t,value:o,norm:r,indices:c})}return n}}re.version="7.0.0";re.createIndex=Ho;re.parseIndex=Jd;re.config=O;re.parseQuery=jo;du(hu);const _u={class:"text-primary"},xu={class:"text-success"},yu={key:0,class:"text-secondary"},vu={key:1},Su={__name:"peerRow",props:["Peer"],emits:["qrcode","configurationFile","setting","jobs","refresh","share"],setup(s,{emit:t}){const e=s,i=Ut(!1),n=Rn(()=>e.Peer.latest_handshake.includes(",")?e.Peer.latest_handshake.split(",")[0]:e.Peer.latest_handshake),o=En("target");Hn(o,a=>{i.value=!1});const r=t;return(a,l)=>(D(),E("tr",null,[g("td",null,[g("small",null,B(s.Peer.name?s.Peer.name:"Untitled Peer"),1)]),g("td",null,[g("small",null,B(s.Peer.id),1)]),g("td",null,[g("small",null,B(s.Peer.allowed_ip),1)]),g("td",null,[g("small",_u,B((s.Peer.cumu_receive+s.Peer.total_receive).toFixed(4))+" GB ",1)]),g("td",null,[g("small",xu,B((s.Peer.cumu_sent+s.Peer.total_sent).toFixed(4))+" GB ",1)]),g("td",null,[s.Peer.latest_handshake!=="No Handshake"?(D(),E("small",yu,[l[7]||(l[7]=g("i",{class:"bi bi-arrows-angle-contract"},null,-1)),Dt(" "+B(n.value)+" ago ",1)])):(D(),E("small",vu,"N/A"))]),g("td",null,[g("a",{role:"button",class:"text-body",onClick:l[0]||(l[0]=c=>i.value=!0)},l[8]||(l[8]=[g("h5",{class:"mb-0"},[g("i",{class:"bi bi-three-dots"})],-1)])),C(Z,{name:"slide-fade"},{default:G(()=>[i.value?(D(),j(Nn,{key:0,onQrcode:l[1]||(l[1]=c=>r("qrcode",c)),onConfigurationFile:l[2]||(l[2]=c=>r("configurationFile",c)),onSetting:l[3]||(l[3]=c=>r("setting")),onJobs:l[4]||(l[4]=c=>r("jobs")),onRefresh:l[5]||(l[5]=c=>r("refresh")),onShare:l[6]||(l[6]=c=>r("share")),Peer:s.Peer,ref_key:"target",ref:o},null,8,["Peer"])):W("",!0)]),_:1})])]))}},wu=Kt(Su,[["__scopeId","data-v-1bcea9a9"]]),ku={class:"fixed-bottom w-100 bottom-0 z-2",style:{"z-index":"1"}},Pu={class:"container-fluid"},Mu={class:"row g-0"},Cu={class:"col-md-9 col-lg-10 d-flex justify-content-center py-2"},Du={class:"rounded-3 p-2 border shadow searchPeersContainer bg-body-tertiary"},Ou={class:"d-flex gap-1 align-items-center px-2"},Tu=["placeholder"],Au={__name:"peerSearchBar",emits:["close"],setup(s,{emit:t}){const e=Rn(()=>ft("Search Peers..."));let i;const n=Ut(""),o=Ws(),r=()=>{i?(clearTimeout(i),i=setTimeout(()=>{o.searchString=n.value},300)):i=setTimeout(()=>{o.searchString=n.value},300)},a=t,l=En("searchBar");return Ln(()=>{l.value.focus()}),(c,h)=>(D(),E("div",ku,[g("div",Pu,[g("div",Mu,[h[5]||(h[5]=g("div",{class:"col-md-3 col-lg-2"},null,-1)),g("div",Cu,[g("div",Du,[g("div",Ou,[h[4]||(h[4]=g("h6",{class:"mb-0 me-2"},[g("label",{for:"searchPeers"},[g("i",{class:"bi bi-search"})])],-1)),Fn(g("input",{ref:"searchBar",class:"form-control rounded-3 bg-secondary-subtle border-1 border-secondary-subtle",placeholder:e.value,id:"searchPeers",onKeyup:h[0]||(h[0]=d=>r()),"onUpdate:modelValue":h[1]||(h[1]=d=>n.value=d)},null,40,Tu),[[Qo,n.value]]),g("button",{onClick:h[2]||(h[2]=d=>a("close")),class:"btn btn-secondary rounded-3 d-flex align-items-center"},[h[3]||(h[3]=g("i",{class:"bi bi-x-circle-fill me-2"},null,-1)),C(Ae,{t:"Hide"})])])])])])])]))}},Lu=Kt(Au,[["__scopeId","data-v-8de5d984"]]);cs.register(Vh,Jh,po,mo,xd,sd,nd,ud,md,jh);const Iu={name:"peerList",components:{ProtocolBadge:tr,PeerSearchBar:Lu,PeerRow:wu,DeleteConfiguration:ot(()=>rt(()=>import("./deleteConfiguration-D6kJ0AZV.js"),__vite__mapDeps([0,1,2,3]))),ConfigurationBackupRestore:ot(()=>rt(()=>import("./configurationBackupRestore-XI__b3sa.js"),__vite__mapDeps([4,1,2,5,3,6]))),SelectPeers:ot(()=>rt(()=>import("./selectPeers-ChsKtHWN.js"),__vite__mapDeps([7,1,2,3,8]))),EditConfiguration:ot(()=>rt(()=>import("./editConfiguration-DFemTQNi.js"),__vite__mapDeps([9,1,2,3,10]))),LocaleText:Ae,PeerShareLinkModal:ot(()=>rt(()=>import("./peerShareLinkModal-BayvlUUA.js"),__vite__mapDeps([11,1,2,5,12,3]))),PeerJobsLogsModal:ot(()=>rt(()=>import("./peerJobsLogsModal-CE2J-3k5.js"),__vite__mapDeps([13,5,1,2,3]))),PeerJobsAllModal:ot(()=>rt(()=>import("./peerJobsAllModal-BwhThYLH.js"),__vite__mapDeps([14,15,1,2,12,5,3,16]))),PeerJobs:ot(()=>rt(()=>import("./peerJobs-B6EQrnEx.js"),__vite__mapDeps([17,15,1,2,12,5,3,16,18]))),PeerCreate:ot(()=>rt(()=>import("./peerCreate-BIjpwtn7.js"),__vite__mapDeps([19,1,2,3,20]))),PeerQRCode:ot(()=>rt(()=>import("./peerQRCode-D6iSwgkc.js"),__vite__mapDeps([21,22,3,1,2]))),PeerConfigurationFile:ot(()=>rt(()=>import("./peerConfigurationFile-ly0pawo0.js"),__vite__mapDeps([23,1,2,3,24]))),PeerSettings:ot(()=>rt(()=>import("./peerSettings-BgY1EFxp.js"),__vite__mapDeps([25,1,2,3,26]))),PeerSearch:xr,Peer:la,Line:Ad,Bar:Td},setup(){const s=Ns(),t=Ws(),e=Ut(void 0);return{dashboardConfigurationStore:s,wireguardConfigurationStore:t,interval:e}},data(){return{configurationToggling:!1,loading:!1,error:null,configurationInfo:[],configurationPeers:[],historyDataSentDifference:[],historyDataReceivedDifference:[],historySentData:{labels:[],datasets:[{label:"Data Sent",data:[],fill:!1,borderColor:"#198754",tension:0}]},historyReceiveData:{labels:[],datasets:[{label:"Data Received",data:[],fill:!1,borderColor:"#0d6efd",tension:0}]},peerSetting:{modalOpen:!1,selectedPeer:void 0},peerScheduleJobs:{modalOpen:!1,selectedPeer:void 0},peerQRCode:{modalOpen:!1,peerConfigData:void 0},peerConfigurationFile:{modalOpen:!1,peerConfigData:void 0},peerCreate:{modalOpen:!1},peerScheduleJobsAll:{modalOpen:!1},peerScheduleJobsLogs:{modalOpen:!1},peerShare:{modalOpen:!1,selectedPeer:void 0},editConfiguration:{modalOpen:!1},selectPeers:{modalOpen:!1},backupRestore:{modalOpen:!1},deleteConfiguration:{modalOpen:!1},peerSearchBarShow:!1,searchStringTimeout:void 0,searchString:""}},mounted(){},watch:{$route:{immediate:!0,handler(){clearInterval(this.dashboardConfigurationStore.Peers.RefreshInterval),this.loading=!0;let s=this.$route.params.id;this.configurationInfo=[],this.configurationPeers=[],s&&(this.getPeers(s),this.setPeerInterval())}},"dashboardConfigurationStore.Configuration.Server.dashboard_refresh_interval"(){clearInterval(this.dashboardConfigurationStore.Peers.RefreshInterval),this.setPeerInterval()}},beforeRouteLeave(){clearInterval(this.dashboardConfigurationStore.Peers.RefreshInterval)},methods:{toggle(){this.configurationToggling=!0,we("/api/toggleWireguardConfiguration/",{configurationName:this.configurationInfo.Name},s=>{s.status?this.dashboardConfigurationStore.newMessage("Server",`${this.configurationInfo.Name} ${s.data?"is on":"is off"}`,"success"):this.dashboardConfigurationStore.newMessage("Server",s.message,"danger"),this.configurationInfo.Status=s.data,this.configurationToggling=!1})},getPeers(s=this.$route.params.id){we("/api/getWireguardConfigurationInfo",{configurationName:s},t=>{if(this.configurationInfo=t.data.configurationInfo,this.configurationPeers=t.data.configurationPeers,this.configurationPeers.forEach(e=>{e.restricted=!1}),t.data.configurationRestrictedPeers.forEach(e=>{e.restricted=!0,this.configurationPeers.push(e)}),this.loading=!1,this.configurationPeers.length>0){const e=this.configurationPeers.map(n=>n.total_sent+n.cumu_sent).reduce((n,o)=>n+o).toFixed(4),i=this.configurationPeers.map(n=>n.total_receive+n.cumu_receive).reduce((n,o)=>n+o).toFixed(4);this.historyDataSentDifference[this.historyDataSentDifference.length-1]!==e&&(this.historyDataSentDifference.length>0&&(this.historySentData={labels:[...this.historySentData.labels,ri().format("HH:mm:ss A")],datasets:[{label:"Data Sent",data:[...this.historySentData.datasets[0].data,((e-this.historyDataSentDifference[this.historyDataSentDifference.length-1])*1e3).toFixed(4)],fill:!1,borderColor:"#198754",tension:0}]}),this.historyDataSentDifference.push(e)),this.historyDataReceivedDifference[this.historyDataReceivedDifference.length-1]!==i&&(this.historyDataReceivedDifference.length>0&&(this.historyReceiveData={labels:[...this.historyReceiveData.labels,ri().format("HH:mm:ss A")],datasets:[{label:"Data Received",data:[...this.historyReceiveData.datasets[0].data,((i-this.historyDataReceivedDifference[this.historyDataReceivedDifference.length-1])*1e3).toFixed(4)],fill:!1,borderColor:"#0d6efd",tension:0}]}),this.historyDataReceivedDifference.push(i))}})},setPeerInterval(){this.dashboardConfigurationStore.Peers.RefreshInterval=setInterval(()=>{this.getPeers()},parseInt(this.dashboardConfigurationStore.Configuration.Server.dashboard_refresh_interval))}},computed:{configurationSummary(){return{connectedPeers:this.configurationPeers.filter(s=>s.status==="running").length,totalUsage:this.configurationPeers.length>0?this.configurationPeers.filter(s=>!s.restricted).map(s=>s.total_data+s.cumu_data).reduce((s,t)=>s+t,0).toFixed(4):0,totalReceive:this.configurationPeers.length>0?this.configurationPeers.filter(s=>!s.restricted).map(s=>s.total_receive+s.cumu_receive).reduce((s,t)=>s+t,0).toFixed(4):0,totalSent:this.configurationPeers.length>0?this.configurationPeers.filter(s=>!s.restricted).map(s=>s.total_sent+s.cumu_sent).reduce((s,t)=>s+t,0).toFixed(4):0}},receiveData(){return this.historyReceiveData},sentData(){return this.historySentData},individualDataUsage(){return{labels:this.configurationPeers.map(s=>s.name?s.name:`Untitled Peer - ${s.id}`),datasets:[{label:"Total Data Usage",data:this.configurationPeers.map(s=>s.cumu_data+s.total_data),backgroundColor:this.configurationPeers.map(s=>"#0dcaf0"),tooltip:{callbacks:{label:s=>`${s.formattedValue} GB`}}}]}},individualDataUsageChartOption(){return{responsive:!0,plugins:{legend:{display:!1}},scales:{x:{ticks:{display:!1},grid:{display:!1}},y:{ticks:{callback:(s,t)=>`${s} GB`},grid:{display:!1}}}}},chartOptions(){return{responsive:!0,plugins:{legend:{display:!1},tooltip:{callbacks:{label:s=>`${s.formattedValue} MB/s`}}},scales:{x:{ticks:{display:!1},grid:{display:!1}},y:{ticks:{callback:(s,t)=>`${s} MB/s`},grid:{display:!1}}}}},searchPeers(){new re(this.configurationPeers,{keys:["name","id","allowed_ip"]});const s=this.wireguardConfigurationStore.searchString?this.configurationPeers.filter(t=>t.name.includes(this.wireguardConfigurationStore.searchString)||t.id.includes(this.wireguardConfigurationStore.searchString)||t.allowed_ip.includes(this.wireguardConfigurationStore.searchString)):this.configurationPeers;return this.dashboardConfigurationStore.Configuration.Server.dashboard_sort==="restricted"?s.slice().sort((t,e)=>t[this.dashboardConfigurationStore.Configuration.Server.dashboard_sort]<e[this.dashboardConfigurationStore.Configuration.Server.dashboard_sort]?1:t[this.dashboardConfigurationStore.Configuration.Server.dashboard_sort]>e[this.dashboardConfigurationStore.Configuration.Server.dashboard_sort]?-1:0):s.slice().sort((t,e)=>t[this.dashboardConfigurationStore.Configuration.Server.dashboard_sort]<e[this.dashboardConfigurationStore.Configuration.Server.dashboard_sort]?-1:t[this.dashboardConfigurationStore.Configuration.Server.dashboard_sort]>e[this.dashboardConfigurationStore.Configuration.Server.dashboard_sort]?1:0)}}},Ru={key:0,class:"container-md"},Eu={class:"d-flex align-items-sm-center flex-column flex-sm-row gap-3"},Fu={class:"text-muted d-flex align-items-center gap-2"},Bu={class:"mb-0"},zu={class:"d-flex align-items-center gap-3"},$u={class:"mb-0 display-4"},Hu={class:"ms-sm-auto d-flex gap-2 flex-column"},Nu={class:"card rounded-3 bg-transparent"},Wu={class:"card-body py-2 d-flex align-items-center"},Vu={class:"text-muted"},ju={class:"form-check form-switch mb-0 ms-auto pe-0 me-0"},Uu=["for"],Yu={key:2,class:"spinner-border spinner-border-sm ms-2","aria-hidden":"true"},Ku=["disabled","id"],Xu={class:"d-flex gap-2"},Gu={class:"row mt-3 gy-2 gx-2 mb-2"},Ju={class:"col-12 col-lg-3"},Qu={class:"card rounded-3 bg-transparent h-100"},qu={class:"card-body py-2 d-flex flex-column justify-content-center"},Zu={class:"mb-0 text-muted"},tf={class:"col-12 col-lg-3"},ef={class:"card rounded-3 bg-transparent h-100"},sf={class:"card-body py-2 d-flex flex-column justify-content-center"},nf={class:"mb-0 text-muted"},of={style:{"word-break":"break-all"},class:"col-12 col-lg-6"},rf={class:"card rounded-3 bg-transparent h-100"},af={class:"card-body py-2 d-flex flex-column justify-content-center"},lf={class:"mb-0 text-muted"},cf={class:"row gx-2 gy-2 mb-2"},hf={class:"col-12 col-lg-3"},df={class:"card rounded-3 bg-transparent h-100"},uf={class:"card-body d-flex"},ff={class:"mb-0 text-muted"},gf={class:"h4"},pf={class:"col-12 col-lg-3"},mf={class:"card rounded-3 bg-transparent h-100"},bf={class:"card-body d-flex"},_f={class:"mb-0 text-muted"},xf={class:"h4"},yf={class:"col-12 col-lg-3"},vf={class:"card rounded-3 bg-transparent h-100"},Sf={class:"card-body d-flex"},wf={class:"mb-0 text-muted"},kf={class:"h4 text-primary"},Pf={class:"col-12 col-lg-3"},Mf={class:"card rounded-3 bg-transparent h-100"},Cf={class:"card-body d-flex"},Df={class:"mb-0 text-muted"},Of={class:"h4 text-success"},Tf={class:"row gx-2 gy-2 mb-3"},Af={class:"col-12 col-lg-6"},Lf={class:"card rounded-3 bg-transparent",style:{height:"270px"}},If={class:"card-header bg-transparent border-0"},Rf={class:"text-muted"},Ef={class:"card-body pt-1"},Ff={class:"col-sm col-lg-3"},Bf={class:"card rounded-3 bg-transparent",style:{height:"270px"}},zf={class:"card-header bg-transparent border-0"},$f={class:"text-muted"},Hf={class:"card-body pt-1"},Nf={class:"col-sm col-lg-3"},Wf={class:"card rounded-3 bg-transparent",style:{height:"270px"}},Vf={class:"card-header bg-transparent border-0"},jf={class:"text-muted"},Uf={class:"card-body pt-1"},Yf={style:{"margin-bottom":"80px"}};function Kf(s,t,e,i,n,o){const r=N("ProtocolBadge"),a=N("LocaleText"),l=N("RouterLink"),c=N("Bar"),h=N("Line"),d=N("PeerSearch"),u=N("Peer"),f=N("PeerSearchBar"),p=N("PeerSettings"),m=N("PeerQRCode"),b=N("PeerJobs"),_=N("PeerJobsAllModal"),x=N("PeerJobsLogsModal"),S=N("PeerShareLinkModal"),P=N("EditConfiguration"),v=N("SelectPeers"),M=N("DeleteConfiguration"),w=N("ConfigurationBackupRestore"),k=N("PeerConfigurationFile");return this.loading?W("",!0):(D(),E("div",Ru,[g("div",Eu,[g("div",null,[g("div",Fu,[g("h5",Bu,[C(r,{protocol:this.configurationInfo.Protocol},null,8,["protocol"])])]),g("div",zu,[g("h1",$u,[g("samp",null,B(this.configurationInfo.Name),1)])])]),g("div",Hu,[g("div",Nu,[g("div",Wu,[g("small",Vu,[C(a,{t:"Status"})]),g("div",{class:Ct(["dot ms-2",{active:this.configurationInfo.Status}])},null,2),g("div",ju,[g("label",{class:"form-check-label",style:{cursor:"pointer"},for:"switch"+this.configurationInfo.id},[this.configurationInfo.Status&&!this.configurationToggling?(D(),j(a,{key:0,t:"On"})):!this.configurationInfo.Status&&!this.configurationToggling?(D(),j(a,{key:1,t:"Off"})):W("",!0),this.configurationToggling?(D(),E("span",Yu)):W("",!0)],8,Uu),Fn(g("input",{class:"form-check-input",style:{cursor:"pointer"},disabled:this.configurationToggling,type:"checkbox",role:"switch",id:"switch"+this.configurationInfo.id,onChange:t[0]||(t[0]=y=>this.toggle()),"onUpdate:modelValue":t[1]||(t[1]=y=>this.configurationInfo.Status=y)},null,40,Ku),[[qo,this.configurationInfo.Status]])])])]),g("div",Xu,[C(l,{to:"create",class:"titleBtn py-2 text-decoration-none btn text-primary-emphasis bg-primary-subtle rounded-3 border-1 border-primary-subtle"},{default:G(()=>[t[35]||(t[35]=g("i",{class:"bi bi-plus-lg me-2"},null,-1)),C(a,{t:"Peer"})]),_:1}),g("button",{class:"titleBtn py-2 text-decoration-none btn text-primary-emphasis bg-primary-subtle rounded-3 border-1 border-primary-subtle",onClick:t[2]||(t[2]=y=>n.editConfiguration.modalOpen=!0),type:"button","aria-expanded":"false"},[t[36]||(t[36]=g("i",{class:"bi bi-gear-fill me-2"},null,-1)),C(a,{t:"Configuration Settings"})])])])]),t[41]||(t[41]=g("hr",null,null,-1)),g("div",Gu,[g("div",Ju,[g("div",Qu,[g("div",qu,[g("p",Zu,[g("small",null,[C(a,{t:"Address"})])]),Dt(" "+B(this.configurationInfo.Address),1)])])]),g("div",tf,[g("div",ef,[g("div",sf,[g("p",nf,[g("small",null,[C(a,{t:"Listen Port"})])]),Dt(" "+B(this.configurationInfo.ListenPort),1)])])]),g("div",of,[g("div",rf,[g("div",af,[g("p",lf,[g("small",null,[C(a,{t:"Public Key"})])]),g("samp",null,B(this.configurationInfo.PublicKey),1)])])])]),g("div",cf,[g("div",hf,[g("div",df,[g("div",uf,[g("div",null,[g("p",ff,[g("small",null,[C(a,{t:"Connected Peers"})])]),g("strong",gf,B(o.configurationSummary.connectedPeers)+" / "+B(n.configurationPeers.length),1)]),t[37]||(t[37]=g("i",{class:"bi bi-ethernet ms-auto h2 text-muted"},null,-1))])])]),g("div",pf,[g("div",mf,[g("div",bf,[g("div",null,[g("p",_f,[g("small",null,[C(a,{t:"Total Usage"})])]),g("strong",xf,B(o.configurationSummary.totalUsage)+" GB",1)]),t[38]||(t[38]=g("i",{class:"bi bi-arrow-down-up ms-auto h2 text-muted"},null,-1))])])]),g("div",yf,[g("div",vf,[g("div",Sf,[g("div",null,[g("p",wf,[g("small",null,[C(a,{t:"Total Received"})])]),g("strong",kf,B(o.configurationSummary.totalReceive)+" GB",1)]),t[39]||(t[39]=g("i",{class:"bi bi-arrow-down ms-auto h2 text-muted"},null,-1))])])]),g("div",Pf,[g("div",Mf,[g("div",Cf,[g("div",null,[g("p",Df,[g("small",null,[C(a,{t:"Total Sent"})])]),g("strong",Of,B(o.configurationSummary.totalSent)+" GB",1)]),t[40]||(t[40]=g("i",{class:"bi bi-arrow-up ms-auto h2 text-muted"},null,-1))])])])]),g("div",Tf,[g("div",Af,[g("div",Lf,[g("div",If,[g("small",Rf,[C(a,{t:"Peers Data Usage"})])]),g("div",Ef,[C(c,{data:o.individualDataUsage,options:o.individualDataUsageChartOption,style:{width:"100%",height:"200px","max-height":"200px"}},null,8,["data","options"])])])]),g("div",Ff,[g("div",Bf,[g("div",zf,[g("small",$f,[C(a,{t:"Real Time Received Data Usage"})])]),g("div",Hf,[C(h,{options:o.chartOptions,data:o.receiveData,style:{width:"100%",height:"200px","max-height":"200px"}},null,8,["options","data"])])])]),g("div",Nf,[g("div",Wf,[g("div",Vf,[g("small",jf,[C(a,{t:"Real Time Sent Data Usage"})])]),g("div",Uf,[C(h,{options:o.chartOptions,data:o.sentData,style:{width:"100%",height:"200px","max-height":"200px"}},null,8,["options","data"])])])])]),t[42]||(t[42]=g("hr",null,null,-1)),g("div",Yf,[C(d,{onSearch:t[3]||(t[3]=y=>this.peerSearchBarShow=!0),onJobsAll:t[4]||(t[4]=y=>this.peerScheduleJobsAll.modalOpen=!0),onJobLogs:t[5]||(t[5]=y=>this.peerScheduleJobsLogs.modalOpen=!0),onEditConfiguration:t[6]||(t[6]=y=>this.editConfiguration.modalOpen=!0),onSelectPeers:t[7]||(t[7]=y=>this.selectPeers.modalOpen=!0),onBackupRestore:t[8]||(t[8]=y=>this.backupRestore.modalOpen=!0),onDeleteConfiguration:t[9]||(t[9]=y=>this.deleteConfiguration.modalOpen=!0),configuration:this.configurationInfo},null,8,["configuration"]),C(Zo,{name:"list",tag:"div",class:"row gx-2 gy-2 z-0"},{default:G(()=>[(D(!0),E(Zt,null,ks(this.searchPeers,y=>(D(),E("div",{class:"col-12 col-lg-6 col-xl-4",key:y.id},[C(u,{Peer:y,onShare:A=>{this.peerShare.selectedPeer=y.id,this.peerShare.modalOpen=!0},onRefresh:t[10]||(t[10]=A=>this.getPeers()),onJobs:A=>{n.peerScheduleJobs.modalOpen=!0,n.peerScheduleJobs.selectedPeer=this.configurationPeers.find(T=>T.id===y.id)},onSetting:A=>{n.peerSetting.modalOpen=!0,n.peerSetting.selectedPeer=this.configurationPeers.find(T=>T.id===y.id)},onQrcode:t[11]||(t[11]=A=>{this.peerQRCode.peerConfigData=A,this.peerQRCode.modalOpen=!0}),onConfigurationFile:t[12]||(t[12]=A=>{this.peerConfigurationFile.peerConfigData=A,this.peerConfigurationFile.modalOpen=!0})},null,8,["Peer","onShare","onJobs","onSetting"])]))),128))]),_:1})]),C(Z,{name:"slideUp"},{default:G(()=>[this.peerSearchBarShow?(D(),j(f,{key:0,onClose:t[13]||(t[13]=y=>n.peerSearchBarShow=!1)})):W("",!0)]),_:1}),C(Z,{name:"zoom"},{default:G(()=>[this.peerSetting.modalOpen?(D(),j(p,{key:"settings",selectedPeer:this.peerSetting.selectedPeer,onRefresh:t[14]||(t[14]=y=>this.getPeers()),onClose:t[15]||(t[15]=y=>this.peerSetting.modalOpen=!1)},null,8,["selectedPeer"])):W("",!0)]),_:1}),C(Z,{name:"zoom"},{default:G(()=>[n.peerQRCode.modalOpen?(D(),j(m,{peerConfigData:this.peerQRCode.peerConfigData,key:"qrcode",onClose:t[16]||(t[16]=y=>this.peerQRCode.modalOpen=!1)},null,8,["peerConfigData"])):W("",!0)]),_:1}),C(Z,{name:"zoom"},{default:G(()=>[this.peerScheduleJobs.modalOpen?(D(),j(b,{key:0,onRefresh:t[17]||(t[17]=y=>this.getPeers()),selectedPeer:this.peerScheduleJobs.selectedPeer,onClose:t[18]||(t[18]=y=>this.peerScheduleJobs.modalOpen=!1)},null,8,["selectedPeer"])):W("",!0)]),_:1}),C(Z,{name:"zoom"},{default:G(()=>[this.peerScheduleJobsAll.modalOpen?(D(),j(_,{key:0,onRefresh:t[19]||(t[19]=y=>this.getPeers()),onAllLogs:t[20]||(t[20]=y=>n.peerScheduleJobsLogs.modalOpen=!0),onClose:t[21]||(t[21]=y=>this.peerScheduleJobsAll.modalOpen=!1),configurationPeers:this.configurationPeers},null,8,["configurationPeers"])):W("",!0)]),_:1}),C(Z,{name:"zoom"},{default:G(()=>[this.peerScheduleJobsLogs.modalOpen?(D(),j(x,{key:0,onClose:t[22]||(t[22]=y=>this.peerScheduleJobsLogs.modalOpen=!1),configurationInfo:this.configurationInfo},null,8,["configurationInfo"])):W("",!0)]),_:1}),C(Z,{name:"zoom"},{default:G(()=>[this.peerShare.modalOpen?(D(),j(S,{key:0,onClose:t[23]||(t[23]=y=>{this.peerShare.modalOpen=!1,this.peerShare.selectedPeer=void 0}),peer:this.configurationPeers.find(y=>y.id===this.peerShare.selectedPeer)},null,8,["peer"])):W("",!0)]),_:1}),C(Z,{name:"zoom"},{default:G(()=>[this.editConfiguration.modalOpen?(D(),j(P,{key:0,onClose:t[24]||(t[24]=y=>this.editConfiguration.modalOpen=!1),onDataChanged:t[25]||(t[25]=y=>this.configurationInfo=y),onBackupRestore:t[26]||(t[26]=y=>this.backupRestore.modalOpen=!0),onDeleteConfiguration:t[27]||(t[27]=y=>this.deleteConfiguration.modalOpen=!0),configurationInfo:this.configurationInfo},null,8,["configurationInfo"])):W("",!0)]),_:1}),C(Z,{name:"zoom"},{default:G(()=>[this.selectPeers.modalOpen?(D(),j(v,{key:0,onRefresh:t[28]||(t[28]=y=>this.getPeers()),configurationPeers:this.configurationPeers,onClose:t[29]||(t[29]=y=>this.selectPeers.modalOpen=!1)},null,8,["configurationPeers"])):W("",!0)]),_:1}),C(Z,{name:"zoom"},{default:G(()=>[n.deleteConfiguration.modalOpen?(D(),j(M,{key:0,onBackup:t[30]||(t[30]=y=>n.backupRestore.modalOpen=!0),onClose:t[31]||(t[31]=y=>n.deleteConfiguration.modalOpen=!1)})):W("",!0)]),_:1}),C(Z,{name:"zoom"},{default:G(()=>[n.backupRestore.modalOpen?(D(),j(w,{key:0,onClose:t[32]||(t[32]=y=>n.backupRestore.modalOpen=!1),onRefreshPeersList:t[33]||(t[33]=y=>this.getPeers())})):W("",!0)]),_:1}),C(Z,{name:"zoom"},{default:G(()=>[n.peerConfigurationFile.modalOpen?(D(),j(k,{key:0,onClose:t[34]||(t[34]=y=>n.peerConfigurationFile.modalOpen=!1),configurationFile:n.peerConfigurationFile.peerConfigData},null,8,["configurationFile"])):W("",!0)]),_:1})]))}const eg=Kt(Iu,[["render",Kf],["__scopeId","data-v-1555674c"]]);export{eg as default};
|