import{P as w}from"./assets/platform-ClhwlNlp.js";import{g as A,O as s}from"./assets/constants-TsWXPT9T.js";import{s as k}from"./assets/affiliate-9KeZEInw.js";import"./assets/http-client-D4foVYuJ.js";import"./assets/getCookie-CrwTE5-D.js";document.addEventListener("DOMContentLoaded",function(){var m;const l=window.location.pathname,o=(m=document.querySelector(".current-lang-marker"))==null?void 0:m.getAttribute("data-lang"),c=document.querySelectorAll(".download-by-platform"),h=document.querySelectorAll(".download-by-platform__platform-name"),u=document.querySelectorAll('a[href^="/link/platform"]'),r=o&&o!=="ru",i={windows:r?`/${o}/thanks/`:"/thanks/",linux:r?`/${o}/linux/`:"/linux/",macos:r?`/${o}/thanks/`:"/thanks/",android:"https://play.google.com/store/apps/details?id=com.freevpnplanet",ios:A(o||"ru"),huawei:"https://appgallery.huawei.com/app/C108022601",default:r?`/${o}/thanks/`:"/thanks/"},n=new w;n.init();let d=i[n.os.toLowerCase()]||i.default;const f=(()=>{const t=navigator.userAgent,a=/HUAWEI/i.test(t)||/HarmonyOS/i.test(t),e=/HONOR/i.test(t);return a||e})();if(f&&(d=i.huawei),c.forEach(t=>{if(t.getAttribute("data-affiliate")==="auto"&&typeof n<"u"&&n.os){let e="";n.os===s.MACOS?e="mac":e=n.os.toLowerCase(),t.setAttribute("data-affiliate",e)}t.setAttribute("href",d)}),document.querySelectorAll(".linux-dynamic-name").forEach(t=>{t.querySelectorAll(".download-by-platform").forEach(e=>{if(n.os===s.LINUX){const p=e.querySelector(".cta__name");p&&(p.textContent=localizedTexts.downloadText)}})}),h.forEach(t=>{f?t.textContent=s.ANDROID:t.textContent=n.currentOs}),l.includes(`/${o}/thanks/`)||o==="ru"&&l.includes("/thanks/")){const t=document.createElement("a");t.setAttribute("href",n.currentPlatformDownloadLink),t.setAttribute("download","download"),document.querySelector(".entry-content").append(t);let a="";n.os===s.MACOS?a="mac":a=n.os.toLowerCase(),setTimeout(()=>{k(a),t.click()},1e3),u.length&&u.forEach(e=>{e.setAttribute("href",n.currentPlatformDownloadLink)})}c.forEach(t=>{t.addEventListener("click",a=>{a.preventDefault();let e=t.getAttribute("href");e.startsWith("http")||o&&o!=="ru"&&(e=`/${o}${e}`),window.location.href=e})})});