import{Cr as e,Dr as t,Ji as n,Oi as r,Si as i,Sr as a,Xi as o,Zi as s,fi as c,gi as l,hi as u,pi as d,ta as f,ui as p}from"./CWa6_HoJ.js";var m=f(a(),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=i({__name:`SubscriptionInfo`,props:{subscriptionInfo:{}},setup(i){let a=i,{t:f}=t(),x=c(()=>a.subscriptionInfo?e(a.subscriptionInfo.Total||0,{units:`iec`}).toString():`0 B`),S=c(()=>{if(!a.subscriptionInfo)return`0 B`;let{Download:t=0,Upload:n=0}=a.subscriptionInfo;return e(t+n,{units:`iec`}).toString()}),C=c(()=>{if(!a.subscriptionInfo?.Total)return 0;let{Download:e=0,Upload:t=0,Total:n=1}=a.subscriptionInfo;return Math.min(Number(((e+t)/n*100).toFixed(1)),999)}),w=c(()=>a.subscriptionInfo?.Expire?(0,m.default)(a.subscriptionInfo.Expire*1e3).format(`YYYY-MM-DD`):f(`noExpire`));return(e,t)=>i.subscriptionInfo?(r(),l(p,{key:0},[d(`div`,h,[d(`div`,g,[d(`div`,{class:`h-full rounded-full transition-[width] duration-500 ease-out`,style:o({width:`${n(C)}%`,background:`linear-gradient(90deg, var(--color-primary), var(--color-secondary))`})},null,4)]),d(`div`,_,s(n(C))+`% `,1)]),d(`div`,v,[d(`div`,y,s(n(S))+` / `+s(n(x)),1),d(`div`,b,s(n(f)(`expire`))+`: `+s(n(w)),1)])],64)):u(``,!0)}}),S=Object.assign(x,{__name:`SubscriptionInfo`});export{S as t};