document.addEventListener("DOMContentLoaded",function(){const e=document.querySelectorAll(".wp-block-cryzel-live-clock-date");e.length&&e.forEach(e=>{const t=e.dataset.displayMode||"both",o=e.dataset.timeFormat||"12",n=e.dataset.dateFormat||"long",a=e.dataset.timezone||"browser",r=e.dataset.customTimezone||"UTC",i=e.dataset.separator||"colon",c="true"===e.dataset.showSeconds,d="true"===e.dataset.showWeekday,s=e.classList.contains("blinking-separator"),l=e.querySelector(".clock-time"),m=e.querySelector(".clock-date");function g(){const e=new Date;if(l&&("time"===t||"both"===t)){const t={hour:"2-digit",minute:"2-digit",...c&&{second:"2-digit"},hour12:"12"===o,timeZone:"browser"===a?void 0:r};let n=e.toLocaleTimeString("en-US",t);const d="dot"===i?"·":":";s?(n=n.replace(/:/g,d),n=n.replace(new RegExp(d.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),`<span class="time-separator">${d}</span>`),l.innerHTML=n):("dot"===i&&(n=n.replace(/:/g,"·")),l.textContent=n)}if(m&&("date"===t||"both"===t)){const t={timeZone:"browser"===a?void 0:r};let o;o="long"===n?e.toLocaleDateString("en-US",{...t,weekday:d?"long":void 0,year:"numeric",month:"long",day:"numeric"}):"short"===n?e.toLocaleDateString("en-US",{...t,year:"numeric",month:"short",day:"numeric"}):"numeric"===n?e.toLocaleDateString("en-US",{...t,year:"numeric",month:"2-digit",day:"2-digit"}):e.toLocaleDateString("en-US",t),m.textContent=o}}g();const u=setInterval(g,1e3);window.addEventListener("beforeunload",function(){clearInterval(u)})})});