import{x as v,R as f,r as c,o as x,I as u,T as w,j as o,k as n,l as t,U as b,v as y,z as e,A as r,q as g}from"./DzNtMgUf.js";const h=window.setInterval,I={key:0,class:"flex flex-row gap-4"},k={class:"timer__unit-wrapper"},T={class:"text-lg font-bold card__timer-value"},j={class:"timer__unit-wrapper"},M={class:"text-lg font-bold card__timer-value"},O={class:"timer__unit-wrapper"},S={class:"text-lg font-bold card__timer-value"},q={class:"timer__unit-wrapper timer__unit-wrapper--secs"},z={class:"text-lg font-bold card__timer-value"},C=v({name:"FixtureCountdownTimer",__name:"index",props:{eventTime:{},label:{},theme:{}},setup(p){const _=p,m=f(),s=c(),i=c(),d=c();return x(()=>{i.value=u.fromISO(_.eventTime),d.value=h(()=>{const l=u.local();s.value=i.value.diff(l,["days","hours","minutes","seconds"]).toObject(),i.value.diff(l).as("seconds")<=0&&(s.value=null)},1e3)}),w(()=>clearInterval(d.value)),(l,a)=>(o(),n("section",null,[t(s)&&t(m).default?(o(),n("div",I,[b(l.$slots,"default",{remaining:t(s)})])):t(s)?(o(),n("div",{key:1,class:y(["flex flex-row gap-4",{"text-white":l.theme==="club"||l.theme==="dark","text-gray-900":l.theme==="light"}])},[e("div",k,[e("p",T,r(t(s).days),1),a[0]||(a[0]=e("p",{class:"opacity-70 card__timer-label"}," Days ",-1))]),e("div",j,[e("p",M,r(t(s).hours),1),a[1]||(a[1]=e("p",{class:"opacity-70 card__timer-units"}," Hours ",-1))]),e("div",O,[e("p",S,r(t(s).minutes),1),a[2]||(a[2]=e("p",{class:"opacity-70 card__timer-label"}," Mins ",-1))]),e("div",q,[e("p",z,r(Math.floor(t(s).seconds)),1),a[3]||(a[3]=e("p",{class:"opacity-70 card__timer-label"}," Secs ",-1))])],2)):g("",!0)]))}});export{C as _,h as s};