document.addEventListener('DOMContentLoaded', function (){
const notice=document.getElementById('tcn-cookie-notice');
if(!notice) return;
const button=notice.querySelector('.tcn-accept');
if(!button) return;
const storageKey='tcn_cookie_notice_accepted';
const days=30;
function isAccepted(){
const stored=localStorage.getItem(storageKey);
if(!stored) return false;
const expiry=parseInt(stored, 10);
return Date.now() < expiry;
}
function showNotice(){
notice.style.display='flex';
}
function hideNotice(){
notice.style.display='none';
}
if(!isAccepted()){
showNotice();
}
button.addEventListener('click', function (){
const expiryTime=Date.now() + days * 24 * 60 * 60 * 1000;
localStorage.setItem(storageKey, expiryTime.toString());
hideNotice();
});
});