1/* global document, window */ 2 3(() => { 4 const cookieName = 'durak_cookie_consent'; 5 const copies = { 6 en: { 7 label: 'Cookie consent', 8 message: 9 'We use Google Analytics cookies to understand how this site is used. More information:', 10 privacy: 'privacy page', 11 decline: 'Decline', 12 accept: 'Accept', 13 }, 14 ru: { 15 label: 'СоглаÑие на иÑполÑзование Ñайлов cookie', 16 message: 17 'ÐÑ Ð¸ÑполÑзÑем ÑÐ°Ð¹Ð»Ñ cookie Google Analytics, ÑÑÐ¾Ð±Ñ Ð¿Ð¾Ð½Ð¸Ð¼Ð°ÑÑ, как иÑполÑзÑеÑÑÑ ÑÑÐ¾Ñ ÑайÑ. ÐодÑобнее:', 18 privacy: 'полиÑика конÑиденÑиалÑноÑÑи', 19 decline: 'ÐÑклониÑÑ', 20 accept: 'ÐÑинÑÑÑ', 21 }, 22 uk: { 23 label: 'Ðгода на викоÑиÑÑÐ°Ð½Ð½Ñ ÑайлÑв cookie', 24 message: 25 'Ðи викоÑиÑÑовÑÑмо Ñайли cookie Google Analytics, Ñоб ÑозÑмÑÑи, Ñк викоÑиÑÑовÑÑÑÑÑÑ Ñей ÑайÑ. ÐокладнÑÑе:', 26 privacy: 'полÑÑика конÑÑденÑÑйноÑÑÑ', 27 decline: 'ÐÑÐ´Ñ Ð¸Ð»Ð¸Ñи', 28 accept: 'ÐÑийнÑÑи', 29 }, 30 de: { 31 label: 'Cookie-Einwilligung', 32 message: 33 'Wir verwenden Google-Analytics-Cookies, um zu verstehen, wie diese Website genutzt wird. Weitere Informationen:', 34 privacy: 'Datenschutzerklärung', 35 decline: 'Ablehnen', 36 accept: 'Akzeptieren', 37 }, 38 pl: { 39 label: 'Zgoda na pliki cookie', 40 message: 41 'Używamy plików cookie Google Analytics, aby zrozumieÄ, jak używana jest ta strona. WiÄcej informacji:', 42 privacy: 'polityka prywatnoÅci', 43 decline: 'OdrzuÄ', 44 accept: 'Akceptuj', 45 }, 46 lv: { 47 label: 'PiekriÅ¡ana sÄ«kfailu izmantoÅ¡anai', 48 message: 49 'MÄs izmantojam Google Analytics sÄ«kfailus, lai saprastu, kÄ tiek izmantota šī vietne. PlaÅ¡Äka informÄcija:', 50 privacy: 'privÄtuma politika', 51 decline: 'NoraidÄ«t', 52 accept: 'Piekrist', 53 }, 54 lt: { 55 label: 'Sutikimas naudoti slapukus', 56 message: 57 'Naudojame Google Analytics slapukus, kad suprastume, kaip naudojama Å¡i svetainÄ. Daugiau informacijos:', 58 privacy: 'privatumo politika', 59 decline: 'Atmesti', 60 accept: 'Sutikti', 61 }, 62 tr: { 63 label: 'Ãerez izni', 64 message: 65 'Bu sitenin nasıl kullanıldıÄını anlamak için Google Analytics çerezlerini kullanıyoruz. Daha fazla bilgi:', 66 privacy: 'gizlilik politikası', 67 decline: 'Reddet', 68 accept: 'Kabul et', 69 }, 70 }; 71 const language = document.documentElement.lang.split('-')[0]; 72 const copy = copies[language] ?? copies.en; 73 const consent = document.cookie 74 .split('; ') 75 .find(cookie => cookie.startsWith(`${cookieName}=`)) 76 ?.split('=')[1]; 77 78 if (consent) { 79 return; 80 } 81 82 const banner = document.createElement('section'); 83 banner.className = 'cookie-banner'; 84 banner.setAttribute('aria-label', copy.label); 85 banner.setAttribute('role', 'dialog'); 86 banner.innerHTML = ` 87 <div class="cookie-banner__content"> 88 <p> 89 ${copy.message} 90 <a href="/privacy.html">${copy.privacy}</a>. 91 </p> 92 <div class="cookie-banner__actions"> 93 <button type="button" data-cookie-consent="declined">${copy.decline}</button> 94 <button type="button" class="cookie-banner__accept" data-cookie-consent="accepted">${copy.accept}</button> 95 </div> 96 </div> 97 `; 98 99 banner.addEventListener('click', event => { 100 const button = event.target.closest('[data-cookie-consent]'); 101 if (!button) { 102 return; 103 } 104 105 const choice = button.dataset.cookieConsent; 106 document.cookie = `${cookieName}=${choice}; Path=/; Max-Age=15552000; SameSite=Lax`; 107 window.gtag('consent', 'update', { 108 analytics_storage: choice === 'accepted' ? 'granted' : 'denied', 109 }); 110 banner.remove(); 111 }); 112 113 document.body.append(banner); 114})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.