import{B as e,Bt as t,G as n,Gt as r,H as i,M as a,N as o,R as s,Tt as c,Ut as l,bt as u,j as d,ot as f,p,qt as m}from"./vue-3bs2-dMU.js";import{C as h,K as g,c as _,h as v,j as y}from"./stores-DmetsdTd.js";import{n as b,r as x}from"./speed-nWJlVDtZ.js";import{n as S,t as C}from"./StatSection-B3O0SUKs.js";n(),c(),l();var w={"data-testid":`card-value`,class:`text-title-medium font-weight-bold`},T={"data-testid":`card-unit`,class:`text-label-large ml-1`},E=e({__name:`SpeedCard`,props:{active:{type:Boolean},grow:{type:Boolean},title:{},icon:{},orientation:{},color:{},value:{}},setup(e){let n=e,s=v();return(e,c)=>(f(),o(S,r(i(n)),{default:u(({value:e})=>[a(`span`,w,m(t(x)(e,t(s).useBitSpeed)),1),a(`span`,T,m(t(b)(e,t(s).useBitSpeed)),1)]),_:1},16))}});n(),c();var D=e({__name:`CurrentSpeed`,setup(e){let{t:n}=g(),{serverState:r}=p(_()),{displayGraphLimits:i}=p(v()),{statusFilter:a}=p(h()),c=[y.DOWNLOADING,y.DL_FORCED],l=[y.UPLOADING,y.UL_FORCED];function m(){a.value=[]}function b(){a.value=c}function x(){a.value=l}let S=d(()=>c.every(e=>a.value.includes(e))&&c.length===a.value.length),w=d(()=>l.every(e=>a.value.includes(e))&&l.length===a.value.length),T=d(()=>!!r.value?.dl_rate_limit||!!r.value?.up_rate_limit),D=d(()=>i&&T.value&&r.value?.dl_rate_limit?[r.value?.dl_info_speed??0,r.value?.dl_rate_limit??0]:r.value?.dl_info_speed??0),O=d(()=>i&&T.value&&r.value?.up_rate_limit?[r.value?.up_info_speed??0,r.value?.up_rate_limit??0]:r.value?.up_info_speed??0);return(e,r)=>(f(),o(C,{title:t(n)(`navbar.side.current_speed.title`),columns:`2`},{default:u(()=>[s(E,{orientation:`row`,title:t(n)(`navbar.side.current_speed.download`),icon:`mdi-arrow-down`,color:`download`,value:D.value,active:S.value,onClick:r[0]||=e=>S.value?m():b()},null,8,[`title`,`value`,`active`]),s(E,{orientation:`row`,title:t(n)(`navbar.side.current_speed.upload`),icon:`mdi-arrow-up`,color:`upload`,value:O.value,active:w.value,onClick:r[1]||=e=>w.value?m():x()},null,8,[`title`,`value`,`active`])]),_:1},8,[`title`]))}});export{D as default};