'use strict';const browserLang=window.navigator.language;var field,email,title="IMPORTANTE: sobre tu Compra \u26D4",msg="\xBFTe avisamos cuando tu pedido sea enviado?",msgBtn1="No",msgBtn2="\xA1Quiero que me avisen! \uD83D\uDCF0";-1!=browserLang.indexOf("pt")&&(title="IMPORTANTE: sobre sua compra \u26D4",msg="N\xF3s o notificamos quando seu pedido \xE9 enviado?",msgBtn1="N\xE3o",msgBtn2="Quero ser notificado! \uD83D\uDCF0");function initCaptureEmailForm(){let a=earFormEmailEvent();return!!a&&void(field=a.querySelector("input[name='email']"),email=field.value,observeEmailNews(field))}function initCheckout(){changeBoxText(),setTimeout(()=>{nt.setSt()},6e3),field=captureEm(),email=field.value,localStorage.setItem("notBtEmTiendaNube",email),observeEm(field)}function captureEm(){let a=document.getElementsByTagName("input");for(var b={value:""},c=0;c{document.getElementById("notBtBoxTitle").innerHTML=title,document.getElementById("notBtBoxMsg").innerHTML=msg,document.getElementById("notBtLater").innerHTML=msgBtn1,document.getElementById("notBtAllow").innerHTML=msgBtn2,document.getElementById("notBtBoxUserEmail").value=localStorage.notBtEmTiendaNube})}function checkSubscriptionNtButton(){if(localStorage.removeItem("notBtWebId"),"granted"==localStorage.notBtPerm)nt.setUserId(localStorage.notBtEmTiendaNube),localStorage.removeItem("notBtEmTiendaNube");else{if(localStorage.notBtEmTiendaNubeAdded)return!1;if(-1==localStorage.notBtEmTiendaNube.search("@"))return!1;if(-1!=window.location.hostname.indexOf("daloiashoes"))return localStorage.removeItem("notBtEmTiendaNube"),!1;localStorage.setItem("notBtEmTiendaNubeAdded","true"),nt.siteConfig().then(a=>{nt.stConf=a,nt.notifyPermit("action").then(a=>{if("granted"==a.permission){let c={endpoint:a.response.subscriptor.endpoint,data:{uId:localStorage.notBtEmTiendaNube}};var b=new UserData;b.updateUserData(c),localStorage.removeItem("notBtEmTiendaNube")}})}).catch(()=>{console.log("Error init siteConfig on checkSubscriptionNtButton")})}}function observeEm(a){a.onkeyup=function(){email=a.value,localStorage.setItem("notBtEmTiendaNube",email)},a.onblur=function(){checkSubscriptionNtButton()}}function observeEmailNews(a){a.onkeyup=function(){email=a.value,localStorage.setItem("notBtEmNewsTiendaNube",email)}}function earFormEmailEvent(){let a,b=document.getElementsByTagName("form");for(let c=0;c{localStorage.setItem("notBtEmSendNewsForm",!0)}));return a}function sendFormEmailNotButton(){function a(){let a=nt.stConf.siteConfig.list.id,b=nt.stConf.siteConfig.ssl,c=localStorage.notBtEmNewsTiendaNube,d={endpoint:a+"-"+c,keys:{auth:"none",p256dh:"none"}};nt.userProfile={name:"",email:c},nt.getEndpoint().then(e=>{"not exist"==e.endpoint?nt.sendOnlyEmailSubscription("",b,a,d):sendUserProfile(endpoint,c),clearPrivateData()}).catch(()=>{console.log("ERROR GET SUBSCRIPTION"),nt.sendOnlyEmailSubscription("",b,a,d),clearPrivateData()})}localStorage.notBtEmNewsTiendaNube&&localStorage.notBtEmSendNewsForm&&(nt.stConf?a():nt.siteConfig().then(b=>{nt.stConf=b,a()}).catch(()=>{console.log("Error getting config for subscribe email form")}))}function sendUserProfile(a,b){let c={endpoint:a,data:nt.setProfileData({email:b})};nt.updateUserData(c,"notBtProfile","dayExpProfile")}function clearPrivateData(){localStorage.removeItem("notBtEmSendNewsForm"),localStorage.removeItem("notBtEmNewsTiendaNube")}function checkWhatsappClicks(){try{const a=new URL(window.location.href);if(!a.searchParams.has("wac"))return!1;if(12>a.searchParams.get("wac").length)return!1;setTimeout(()=>!!nt&&!!nt.stConf&&void(getBlockContentEmail(),saveWhatsappClicks(a.searchParams.get("wac"))),6e3)}catch(a){console.log("wc error: ",a)}}function getBlockContentEmail(){if(localStorage.notBtEmTiendaNube)return!1;let a=document.getElementById("reviewBlockContentEmail");localStorage.setItem("notBtEmTiendaNube",a.innerText)}async function saveWhatsappClicks(a){try{let b={email:localStorage.notBtEmTiendaNube,listId:nt.stConf.siteConfig.list.id,type:"cart",event:"click",url:window.location.href,nid:a},c=await fetch("https://notificationbutton.com/api/integrations/whatsapp/web/results",{method:"POST",headers:{"Content-Type":"application/json; charset=utf-8"},body:JSON.stringify(b)})}catch(a){console.log("wc save error: ",a)}}function setTags(){-1!=window.location.pathname.indexOf("/success/")&&nt.setTagId("03s6td"),setTimeout(()=>{let a=document.getElementsByClassName("cart"),b=document.getElementById("ajax-cart-submit-div"),c=0;for(;c{nt.setTagId("04s0nh")}),c++;b&&b.addEventListener("click",()=>{nt.setTagId("45g7jk")})},4e3)}function setAutoTagsProductCategory(){setTimeout(()=>{const a=getUrlCategoryFolder(window.location.pathname);a&&nt.setTagId(a)},3e4)}function getUrlCategoryFolder(a){if(["productos","produtos","search","account","register","login","checkout"].some(b=>a.includes(b)))return null;const b=a.split("/"),c=b.filter(a=>0{sendFormEmailNotButton()},5e3)):(initCheckout(),checkWhatsappClicks());