import{Mn as e,Nr as t,Tr as n,ai as r,gr as i,hr as a,oi as o,pr as s,ri as c,ui as l,vr as u,yr as d}from"./KXnyWfWg.js";import{nt as f,rt as p}from"./BPCoDq-Y.js";var m=l(f(),1),h={class:`flex items-center gap-2 pt-1`},g={class:`h-2 flex-1 overflow-hidden rounded-full bg-base-content/15`},_={class:`flex items-center justify-center rounded-full bg-secondary px-2 py-0.5 text-xs font-semibold text-secondary-content`},v={class:`mt-1.5 flex flex-wrap items-center justify-between gap-2`},y={class:`text-sm text-base-content/60`},b={class:`text-sm text-base-content/60`},x=n({__name:`SubscriptionInfo`,props:{subscriptionInfo:{}},setup(n){let l=n,{t:f}=e(),x=a(()=>l.subscriptionInfo?p(l.subscriptionInfo.Total||0,{units:`iec`}).toString():`0 B`),S=a(()=>{if(!l.subscriptionInfo)return`0 B`;let{Download:e=0,Upload:t=0}=l.subscriptionInfo;return p(e+t,{units:`iec`}).toString()}),C=a(()=>{if(!l.subscriptionInfo?.Total)return 0;let{Download:e=0,Upload:t=0,Total:n=1}=l.subscriptionInfo;return Math.min(Number(((e+t)/n*100).toFixed(1)),999)}),w=a(()=>l.subscriptionInfo?.Expire?(0,m.default)(l.subscriptionInfo.Expire*1e3).format(`YYYY-MM-DD`):f(`noExpire`));return(e,a)=>n.subscriptionInfo?(t(),d(s,{key:0},[i(`div`,h,[i(`div`,g,[i(`div`,{class:`h-full rounded-full transition-[width] duration-500 ease-out`,style:r({width:`${c(C)}%`,background:`linear-gradient(90deg, var(--color-primary), var(--color-secondary))`})},null,4)]),i(`div`,_,o(c(C))+`% `,1)]),i(`div`,v,[i(`div`,y,o(c(S))+` / `+o(c(x)),1),i(`div`,b,o(c(f)(`expire`))+`: `+o(c(w)),1)])],64)):u(``,!0)}}),S=Object.assign(x,{__name:`SubscriptionInfo`});export{S as t};