document.addEventListener("DOMContentLoaded",function(){if(window.location.href.includes("thenorthfaceec.vtexlocal.com.br")||window.location.href.includes("thenorthface.com.ec")){console.log("entro");var currentUrl=window.location.pathname;function showPopup(config){console.log("config",config);var today=new Date,startDate=new Date(config.initialDate),endDate=new Date(config.finalDate);startDate<=today&&today<=endDate&&(startDate=localStorage.getItem("onSitePopupClosed"),console.log("isClosed",startDate),startDate||setTimeout(()=>{!function(config){const isMobile=window.innerWidth<=768,popupContainer=document.createElement("div"),backgroundColor=isMobile&&config.bgColorMobile||config.bgColor,title=isMobile&&config.titleMobile||config.title,description=isMobile&&config.descriptionMobile||config.description,colorText=isMobile&&config.colorTextMobile||config.colorText,textCta=isMobile&&config.textCtaMobile||config.textCta,bgCta=isMobile&&config.bgCtaMobile||config.bgCta,colorCta=isMobile&&config.colorCtaMobile||config.colorCta,descriptionFinal=isMobile&&config.descriptionfinalMobile||config.descriptionfinal,urlCta=isMobile&&config.urlCtaMobile||config.urlCta,showImageMobile=void 0===config.showImageMobile||config.showImageMobile,isCountdownActive=(popupContainer.style.backgroundColor=backgroundColor,popupContainer.classList.add("on-site-popup"),isMobile&&config.activeCountdownMobile||config.activeCountdown),closeButton=(popupContainer.innerHTML=` `,document.body.appendChild(popupContainer),popupContainer.querySelector(".close-popup"));{var countdownElement;closeButton.addEventListener("click",()=>{popupContainer.remove(),localStorage.setItem("onSitePopupClosed","true")}),isCountdownActive&&config.countdown&&(countdownElement=popupContainer.querySelector(".countdown"),function(endDate,countdownElement){const daysEl=countdownElement.querySelector(".days"),hoursEl=countdownElement.querySelector(".hours"),minutesEl=countdownElement.querySelector(".minutes"),secondsEl=countdownElement.querySelector(".seconds"),interval=setInterval(()=>{var time=function(endDate){var now=(new Date).getTime(),endDate=new Date(endDate).getTime()-now;if(endDate<0)return null;var now=Math.floor(endDate/864e5),hours=Math.floor(endDate%864e5/36e5),minutes=Math.floor(endDate%36e5/6e4),endDate=Math.floor(endDate%6e4/1e3);return{days:now,hours:hours,minutes:minutes,seconds:endDate}}(endDate);null===time?(clearInterval(interval),countdownElement.textContent="¡Oferta terminada!"):(daysEl.textContent=String(time.days).padStart(2,"0"),hoursEl.textContent=String(time.hours).padStart(2,"0"),minutesEl.textContent=String(time.minutes).padStart(2,"0"),secondsEl.textContent=String(time.seconds).padStart(2,"0"))},1e3)}(config.countdown,countdownElement))}}(config)},5e3))}url=currentUrl,fetch("/files/on-sites.json").then(response=>{if(response.ok)return response.json();throw new Error("Error al cargar la configuración del popup")}).then(data=>data[url]||null).catch(error=>{}).then(config=>{config&&showPopup(config)})}var url});