(()=>{"use strict";function t(t){const e=t=>String(t).padStart(2,"0"),r=Math.floor(t/86400),n=Math.floor(t/3600),o=Math.floor(t/60),a=t;return{days:e(r),hours:e(n),minutes:e(o),seconds:e(a)}}window.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll(".single-counter.front").forEach(e=>{!function(e){if(!e)return null;const r=e.dataset.enddate,n=e.dataset.format||"seconds";if(!r)return null;let o=function(t){const e=new Date,r=new Date(t);if(Number.isNaN(r.getTime()))return 0;const n=r.getTime()-e.getTime();return n<=0?0:Math.floor(n/1e3)}(r);if(0==o)return null;const a=e.querySelector(".single-counter-value");if(!a)return null;let l=setInterval(()=>{if(o<1)try{return e.setAttribute("data-show_finished_message","true"),clearInterval(l)}catch(t){return clearInterval(l)}o-=1;let r=t(o);a.innerText=Intl.NumberFormat().format(r[n])},1e3),u=t(o);a.innerText=Intl.NumberFormat().format(u[n])}(e),e.classList.remove("hide")})})})();