(()=>{"use strict";const t=(t,e=!1)=>{const n=6048e5,i=864e5,o=36e5;let r=0,s=0,c=0,u=0,l=0;return e&&(r=Math.floor(t/n),t%=n),s=Math.floor(t/i),t%=i,c=Math.floor(t/o),t%=o,u=Math.floor(t/6e4),l=Math.floor(t%6e4/1e3),{weeks:r,days:s,hours:c,minutes:u,seconds:l}};window.addEventListener("load",()=>{document.querySelectorAll(".gkit-countdown").forEach(e=>{(e=>{if(!e)return;e.countdownTimer&&(clearInterval(e.countdownTimer),e.countdownTimer=null);const n=JSON.parse(e?.getAttribute("data-countdown")),i=n.dueDate,o=n.style,r=new Date(i).getTime(),s=(t,n,i=!0)=>{0===t&&i&&(e.querySelector(n).classList.add("gkit-flip"),".gkit-minutes"===n&&setTimeout(()=>{e.querySelector(n).classList.remove("gkit-flip")},800)),i||(e.querySelector(n).classList.add("gkit-flip"),setTimeout(()=>{e.querySelector(n).classList.remove("gkit-flip")},800))},c=(t,n)=>{const i=e.querySelector(`${n} .gkit-next.gkit-top`),o=e.querySelector(`${n} .gkit-next.gkit-bottom`),r=e.querySelector(`${n} .gkit-curr.gkit-top`),s=e.querySelector(`${n} .gkit-curr.gkit-bottom`);i&&(i.innerHTML=t),o&&(o.innerHTML=t),setTimeout(()=>{r&&(r.innerHTML=t),s&&(s.innerHTML=t)},250)},u=()=>{const t=(new Date).getTime(),i=r-t;if(i<0){clearInterval(e.countdownTimer),e.countdownTimer=null;const t=n.expireLabel||"Time's up!",i=n.expireDescription||"The countdown has ended.";return e.innerHTML=`\n\t\t\t\t\t<div class="gkit-countdown-expire">\n\t\t\t\t\t\t${t} <br />\n\t\t\t\t\t\t${i}\n\t\t\t\t\t</div>\n\t\t\t\t`,!1}return i};e.countdownTimer="style3"===o?setInterval(function(){const e=u();if(!e)return;const{weeks:n,days:i,hours:o,minutes:r,seconds:l}=t(e,!0);c(n,".gkit-weeks"),c(i,".gkit-days"),c(o,".gkit-hours"),c(r,".gkit-minutes"),c(l,".gkit-seconds"),s(l,".gkit-minutes"),s(r,".gkit-hours"),s(o,".gkit-days"),s(i,".gkit-weeks"),s(l,".gkit-seconds",!1)},1e3):setInterval(function(){const n=u();if(!n)return;const{days:i,hours:o,minutes:r,seconds:s}=t(n,!1),c=e.querySelector(".gkit-days .gkit-timer-count");c&&(c.innerHTML=i);const l=e.querySelector(".gkit-hours .gkit-timer-count");l&&(l.innerHTML=o);const d=e.querySelector(".gkit-minutes .gkit-timer-count");d&&(d.innerHTML=r);const k=e.querySelector(".gkit-seconds .gkit-timer-count");k&&(k.innerHTML=s)},1e3)})(e)})})})();