(()=>{"use strict";var e={5338:(e,s,t)=>{var o=t(5795);s.H=o.createRoot,o.hydrateRoot},5795:e=>{e.exports=window.ReactDOM}},s={};const t=window.React,o=window.wp.element,n=({targetDate:e=new Date,showLabels:s=!0,labels:n={years:"Years",months:"Months",weeks:"Weeks",days:"Days",hours:"Hours",minutes:"Minutes",seconds:"Seconds"},itemsVisibility:a={years:!1,months:!1,weeks:!1,days:!0,hours:!0,minutes:!0,seconds:!0},onEnd:r=null})=>{const u=e=>e.toString().padStart(2,"0"),d=()=>{const s=+new Date(e)-+new Date;let t={years:0,months:0,weeks:0,days:0,hours:0,minutes:0,seconds:0};return s>0&&(t={years:Math.floor(s/31536e6),months:Math.floor(s%31536e6/2592e6),weeks:Math.floor(s%2592e6/6048e5),days:Math.floor(s%6048e5/864e5),hours:Math.floor(s%864e5/36e5),minutes:Math.floor(s%36e5/6e4),seconds:Math.floor(s%6e4/1e3)},!a?.years&&t.years&&(t.months+=12*t.years,t.years=0),!a?.months&&t.months&&(t.weeks+=4*t.months,t.months=0),!a?.weeks&&t.weeks&&(t.days+=7*t.weeks,t.weeks=0),!a?.days&&t.days&&(t.hours+=24*t.days,t.days=0),!a?.hours&&t.hours&&(t.minutes+=60*t.hours,t.hours=0),!a?.minutes&&t.minutes&&(t.seconds+=60*t.minutes,t.minutes=0)),t.years=u(t.years),t.months=u(t.months),t.weeks=u(t.weeks),t.days=u(t.days),t.hours=u(t.hours),t.minutes=u(t.minutes),t.seconds=u(t.seconds),t},[c,m]=(0,o.useState)(d());(0,o.useEffect)((()=>{const e=setTimeout((()=>{m(d())}),1e3);return()=>clearTimeout(e)}));const i=(e,o)=>(0,t.createElement)("div",{className:"nexa-countdown-item"},(0,t.createElement)("div",{className:"nexa-countdown-face"},o),s&&(0,t.createElement)("div",{className:"nexa-countdown-label"},e));return(0,t.createElement)(t.Fragment,null,a?.years&&i(n?.years,c.years),a?.months&&i(n?.months,c.months),a?.weeks&&i(n?.weeks,c.weeks),a?.days&&i(n?.days,c.days),a?.hours&&i(n?.hours,c.hours),a?.minutes&&i(n?.minutes,c.minutes),a?.seconds&&i(n?.seconds,c.seconds))};var a=function t(o){var n=s[o];if(void 0!==n)return n.exports;var a=s[o]={exports:{}};return e[o](a,a.exports,t),a.exports}(5338);document.addEventListener("DOMContentLoaded",(()=>{const e=document.querySelectorAll(".wp-block-nexa-count-down");e.length>0&&e.forEach((e=>{const s=e.querySelector(".nexa-countdown-wrap");let o=s.dataset.countdate;const r=JSON.parse(s.dataset.itemsvisibility),u=JSON.parse(s.dataset.itemslabels),d=s.dataset.togglelabels,c=new Date(o);(0,a.H)(s).render((0,t.createElement)(n,{targetDate:c,itemsVisibility:r,showLabels:d,labels:u}))}))}))})();