document.addEventListener("DOMContentLoaded",function(){const e=new URLSearchParams(window.location.search).get("lang");let t;t=e||navigator.language,console.log("Browser language:",t);const o=document.querySelectorAll(".bonus__item"),n=document.querySelector(".popup__container"),c=document.querySelector(".left"),s=document.querySelector(".right"),r=document.createElement("link");r.setAttribute("rel","stylesheet"),r.setAttribute("class","custom-css");(document.head||document.getElementsByTagName("head")[0]).appendChild(r),document.querySelector(".custom-css").href="css/cr_bonus.css",o.forEach(e=>{e.addEventListener("click",()=>{e.style.background="url('./img/win/box-win.webp') center center/contain no-repeat",n.style.visibility="visible",c.classList.add("confetti-animation"),s.classList.add("confetti-animation")})});const a="cr_bonus";let i=window.location.search;""===i?i="?show_popup_reg=1&lp="+a:i+="&show_popup_reg=1&lp="+a;let l="https://"+window.location.hostname.replace("promo.","")+i;document.querySelector(".popup__button").href=l,document.querySelector(".popup__button").addEventListener("click",function(){document.cookie="offer_last_point="+i+"; max-age=2592000"})});