/*! WAR.PE v1.0.0 - (C) 2025 - MIT license */ !function(){"use strict";const t={defaultConfig:{position:"right",color:"#4285F4",textColor:"#FFFFFF",btnColor:"#2B2B2B",message:"Mejora tu privacidad con WARP",buttonText:"Instalar WARP",showClose:!0,dismissDuration:864e5},FETCH_INTERVAL:3e5,LAST_FETCH_KEY:"cfTraceLastFetched",DISMISSED_KEY:"warpDismissed"},e=document.currentScript;function n(t){try{return decodeURIComponent(escape(t))}catch(e){return t}}t.config={position:e.getAttribute("data-position")||t.defaultConfig.position,color:e.getAttribute("data-color")||t.defaultConfig.color,textColor:e.getAttribute("data-text-color")||t.defaultConfig.textColor,btnColor:e.getAttribute("data-btn-color")||t.defaultConfig.btnColor,message:n(e.getAttribute("data-message")||t.defaultConfig.message),buttonText:n(e.getAttribute("data-button-text")||t.defaultConfig.buttonText),showClose:"false"!==e.getAttribute("data-show-close")};const o=parseInt(localStorage.getItem(t.DISMISSED_KEY),10);if(o&&Date.now(){if(document.getElementById("warpNotification"))return;const e=document.createElement("div");e.id="warpNotification",e.classList.add("warp-notification"),e.classList.add("left"===t.config.position?"warp-left":"warp-right");const n=document.createElement("div");n.classList.add("warp-content-container");const o=document.createElement("div");o.classList.add("warp-inner-content");const a=document.createElement("span");a.textContent=t.config.message,o.appendChild(a);const r=document.createElement("a");if(r.href=(()=>{const t="https://one.one.one.one/",e={es:"es-ES",fr:"fr-FR",pt:"pt-BR",it:"it-IT",de:"de-DE",pl:"pl-PL",id:"id-ID",nl:"nl-NL",ar:"ar-EG",fa:"fa-IR",he:"he-IL",ko:"ko-KR",uk:"uk-UA",tr:"tr-TR",ru:"ru-RU",ja:"ja-JP"},n=(navigator.language||navigator.userLanguage).slice(0,2);return e[n]?`${t}${e[n]}/`:t})(),r.target="_blank",r.textContent=t.config.buttonText,r.classList.add("warp-link"),o.appendChild(r),n.appendChild(o),t.config.showClose){const o=document.createElement("button");o.classList.add("warp-close-btn"),o.innerHTML="×",o.addEventListener("click",(()=>{e.remove(),localStorage.setItem(t.DISMISSED_KEY,Date.now()+t.defaultConfig.dismissDuration)})),n.appendChild(o)}e.appendChild(n),document.body.appendChild(e)};t.showNotification=()=>{"loading"!==document.readyState?a():document.addEventListener("DOMContentLoaded",a)},t.removeNotification=()=>{const t=document.getElementById("warpNotification");t&&t.remove()},t.fetchCloudflareTrace=async()=>{try{const e=await fetch("/cdn-cgi/trace");if(!e.ok)throw new Error("Error en la red");const n=await e.text();localStorage.setItem(t.LAST_FETCH_KEY,Date.now()),n.includes("warp=on")?(localStorage.setItem("warpStatus","on"),t.removeNotification()):(localStorage.setItem("warpStatus","off"),t.showNotification())}catch(e){t.showNotification(),console.log("WAR.PE: El sitio web no utiliza CloudFlare")}};const r=Date.now(),i=parseInt(localStorage.getItem(t.LAST_FETCH_KEY),10);if(!i||r-i>=t.FETCH_INTERVAL)t.fetchCloudflareTrace();else{"on"!==localStorage.getItem("warpStatus")&&t.showNotification()}}();