document.addEventListener("DOMContentLoaded", function() {
console.log("Age verification script by Sukesh is running...");
// Skip the gate entirely for known crawlers/bots
const botPattern = /GPTBot|ClaudeBot|anthropic-ai|ChatGPT-User|PerplexityBot|Googlebot|Bingbot|Google-Extended|CCBot|facebookexternalhit|Twitterbot|LinkedInBot|Applebot/i;
const isBot = botPattern.test(navigator.userAgent);
if (isBot) {
return; // don't show the popup at all for bots
}
if (sukeshGetCookie("ageVerified") !== "true") {
document.getElementById("age-verification-popup").style.display = "flex";
}
document.getElementById("age-yes").addEventListener("click", function() {
sukeshSetCookie("ageVerified", "true", 3);
document.getElementById("age-verification-popup").style.display = "none";
});
document.getElementById("age-no").addEventListener("click", function() {
const noButton = document.getElementById("age-no");
noButton.classList.add("active-no");
document.getElementById("age-error").style.display = "block";
});
});