function toggleWhatsAppDiv(){let e=document.querySelector(".fixed-whatsapp");window.innerWidth<575&&window.scrollY<905?e.style.display="none":e.style.display="flex"}function closeModal(){document.getElementById("modal").style.display="none",document.body.style.overflow="auto"}window.addEventListener("scroll",toggleWhatsAppDiv),window.addEventListener("resize",toggleWhatsAppDiv),toggleWhatsAppDiv(),window.addEventListener("scroll",function(){var e=window.pageYOffset;"true"!==localStorage.getItem("lgpd_close")&&e>650&&(document.getElementById("privacy-warning").style.display="block")}),document.querySelector("#privacy-warning button").addEventListener("click",function(){localStorage.setItem("lgpd_close","true"),document.getElementById("privacy-warning").style.display="none"}),"true"===localStorage.getItem("lgpd_close")&&(document.getElementById("privacy-warning").style.display="none"),document.querySelectorAll('a[href="#modal"]').forEach(function(e){e.addEventListener("click",function(e){e.preventDefault(),document.getElementById("modal").style.display="block",document.body.style.overflow="hidden"})});var modalOverlay=document.querySelector(".modal_overlay");modalOverlay&&modalOverlay.addEventListener("click",closeModal);var modalClose=document.querySelector(".modal_close");function SPMaskBehavior(e){return 11===e.replace(/\D/g,"").length?"(00) 00000-0000":"(00) 0000-00009"}function maskInput(e){var t=e.target,l=t.value.replace(/\D/g,""),a=applyMask(l,SPMaskBehavior(l));t.value=a}function applyMask(e,t){for(var l="",a=0,r=0;r<e.length&&!(a>=t.length);r++)"0"===t[a]||"9"===t[a]?(l+=e[r],a++):(l+=t[a++],r--);return l}function initializeVideoLightbox(e,t){let l=document.querySelector(".iframe-lightbox"),a=document.querySelector(".iframe-lightbox_overlay"),r=document.querySelector(".iframe-lightbox_close"),i=document.querySelector(".iframe-lightbox_responsive-embed"),o=null,n=Array.from(document.querySelectorAll(`.${e} .${t}`));function s(){l.style.display="none",document.body.style.overflow="",o&&(o.src="")}n.forEach(e=>{e.addEventListener("click",t=>{t.preventDefault(),o||((o=document.createElement("iframe")).className="iframe-lightbox_video p-abs abs-0 w-100 h-100",o.setAttribute("frameborder","0"),o.setAttribute("allowfullscreen",""),o.setAttribute("allow","accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"),i.appendChild(o));let a=new URL(e.href),r=a.searchParams.get("v");o.src=`https://www.youtube.com/embed/${r}`,l.style.display="flex",document.body.style.overflow="hidden"})}),a.addEventListener("click",()=>s()),r.addEventListener("click",()=>s())}modalClose&&modalClose.addEventListener("click",closeModal),document.querySelectorAll(".form_mask-phone").forEach(function(e){e.addEventListener("input",maskInput)}),initializeVideoLightbox("video_swiper","video_link"),initializeVideoLightbox("testimony_slide","testimony_card"),document.querySelectorAll(".points_item").forEach(e=>{e.addEventListener("mouseenter",()=>document.getElementById("marcadores").classList.add("markers_invisible")),e.addEventListener("mouseleave",()=>document.getElementById("marcadores").classList.remove("markers_invisible"))}),["venda","distribuicao","assistencia","representantes"].forEach(e=>{document.querySelectorAll(`.points_item.${e}`).forEach(t=>{t.addEventListener("mouseenter",()=>document.querySelectorAll(`.${e}`).forEach(t=>t.classList.add(`${e}_active`))),t.addEventListener("mouseleave",()=>document.querySelectorAll(`.${e}`).forEach(t=>t.classList.remove(`${e}_active`)))})});const addActiveClass=function(e,t){let l=function(){document.querySelectorAll(e).forEach(e=>{let l=e.getBoundingClientRect(),a=l.top+window.pageYOffset,r=l.bottom+window.pageYOffset,i=window.pageYOffset+window.innerHeight,o=window.pageYOffset;i>a&&o<r&&i-a>.08*window.innerHeight&&(e.classList.add("differentials-global_map-active"),document.querySelectorAll(t).forEach(e=>{e.classList.add("differentials-global_map-active")}))})};window.addEventListener("scroll",l),l()};addActiveClass(".map_country-europe",".indicator_country-europe"),addActiveClass(".map_country-brazil",".indicator_country-brazil"),addActiveClass(".map_country-corea",".indicator_country-corea");