Wczytuję dane...
Zaawansowane szukanie
(() => { 'use strict'; const ID = 'ai-visualizations-notice'; const STYLE_ID = 'ai-visualizations-style'; const DATA_MINIMALNA = Date.UTC(2026, 7, 1); const TEKST = 'Niektóre wizualizacje aranżacyjne zostały stworzone z wykorzystaniem sztucznej inteligencji. Produkt odwzorowano na podstawie jego rzeczywistego wyglądu, kolorystyki i wymiarów. Postacie oraz elementy otoczenia mają charakter ilustracyjny.'; const WZOR_DATY = /(^|[^d])(0?[1-9]|[12]d|3[01])s*([./-])s*(0?[1-9]|1[0-2])s*3s*(d{4})(?=$|[^d])/g; const poprawnaData = (dzien, miesiac, rok) => { const d = Number(dzien); const m = Number(miesiac); const r = Number(rok); const czas = Date.UTC(r, m - 1, d); const data = new Date(czas); return ( data.getUTCDate() === d && data.getUTCMonth() === m - 1 && data.getUTCFullYear() === r && czas >= DATA_MINIMALNA ); }; const znajdzDate = element => { WZOR_DATY.lastIndex = 0; for (const wynik of element.textContent.matchAll(WZOR_DATY)) { if (poprawnaData(wynik[2], wynik[4], wynik[5])) { return true; } } return false; }; const usunDaty = element => { const walker = document.createTreeWalker( element, NodeFilter.SHOW_TEXT ); const wezly = []; while (walker.nextNode()) { wezly.push(walker.currentNode); } wezly.forEach(wezel => { WZOR_DATY.lastIndex = 0; wezel.nodeValue = wezel.nodeValue.replace( WZOR_DATY, (calosc, prefiks, dzien, separator, miesiac, rok) => poprawnaData(dzien, miesiac, rok) ? prefiks : calosc ); const rodzic = wezel.parentElement; if ( rodzic && rodzic.matches('p, span') && !rodzic.textContent.trim() && !rodzic.children.length ) { rodzic.remove(); } }); }; const uruchom = () => { const galeria = document.querySelector('#gallery'); const opisy = [ ...new Set( document.querySelectorAll( '.product-description, #tab-1 [itemprop="description"], .descriptionSpace [itemprop="description"]' ) ) ]; if (!galeria || !opisy.length) return false; if (!opisy.some(znajdzDate)) return false; document.getElementById(ID)?.remove(); document.getElementById(STYLE_ID)?.remove(); const style = document.createElement('style'); style.id = STYLE_ID; style.textContent = ` #${ID} { position: relative; display: inline-flex; align-items: center; gap: 4px; margin: 7px 0 10px; padding: 0; border: 0; background: transparent; color: #777; font: 400 11px/1.3 Arial, sans-serif; cursor: help; outline: none; } #${ID}:hover, #${ID}:focus { color: #333; } #${ID} .ai-info { display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px; border: 1px solid currentColor; border-radius: 50%; font-size: 9px; line-height: 1; box-sizing: border-box; } #${ID} .ai-tooltip { position: absolute; z-index: 10000; left: 0; bottom: calc(100% + 7px); width: 290px; max-width: calc(100vw - 40px); padding: 9px 11px; border-radius: 5px; background: #222; color: #fff; font: 400 12px/1.45 Arial, sans-serif; text-align: left; box-shadow: 0 4px 14px rgba(0, 0, 0, .18); opacity: 0; visibility: hidden; transform: translateY(4px); transition: opacity .15s, visibility .15s, transform .15s; pointer-events: none; } #${ID} .ai-tooltip::after { content: ""; position: absolute; top: 100%; left: 24px; border: 5px solid transparent; border-top-color: #222; } #${ID}:hover .ai-tooltip, #${ID}:focus .ai-tooltip { opacity: 1; visibility: visible; transform: translateY(0); } @media (max-width: 767px) { #${ID} { margin-left: 4px; } #${ID} .ai-tooltip { width: 260px; } } `; document.head.appendChild(style); const powiadomienie = document.createElement('div'); powiadomienie.id = ID; powiadomienie.tabIndex = 0; powiadomienie.setAttribute('role', 'note'); powiadomienie.setAttribute('aria-label', TEKST); const etykieta = document.createElement('span'); etykieta.textContent = 'Wizualizacje AI'; const ikona = document.createElement('span'); ikona.className = 'ai-info'; ikona.textContent = 'i'; ikona.setAttribute('aria-hidden', 'true'); const podpowiedz = document.createElement('span'); podpowiedz.className = 'ai-tooltip'; podpowiedz.textContent = TEKST; podpowiedz.setAttribute('role', 'tooltip'); powiadomienie.append(etykieta, ikona, podpowiedz); galeria.insertAdjacentElement('afterend', powiadomienie); opisy.forEach(usunDaty); return true; }; if (!uruchom()) { const obserwator = new MutationObserver(() => { if (uruchom()) obserwator.disconnect(); }); obserwator.observe(document.body, { childList: true, subtree: true }); setTimeout(() => obserwator.disconnect(), 15000); } })();