// The map is the only external embed; never loads before a visitor's explicit click. for (const button of document.querySelectorAll('[data-load-map]')) { button.addEventListener('click', () => { const shell = button.closest('[data-map]'); const url = new URL(button.dataset.src); if (url.origin !== 'https://www.google.com' || url.pathname !== '/maps/embed') return; const frame = document.createElement('iframe'); frame.src = url.href; frame.title = 'Mapa do endereço do escritório na Avenida Paranaguá, 2028'; frame.referrerPolicy = 'no-referrer'; frame.loading = 'lazy'; shell.querySelector('[data-map-target]').replaceChildren(frame); shell.querySelector('.map-placeholder').hidden = true; shell.querySelector('[role="status"]').textContent = 'Mapa solicitado ao Google. Se não aparecer, utilize o link de endereço abaixo.'; const fallback = document.createElement('a'); fallback.href = 'https://www.google.com/maps/search/?api=1&query=Avenida+Paranagua+2028+Sao+Paulo'; fallback.textContent = 'Abrir endereço no Google Maps ↗'; fallback.className = 'arrow'; fallback.target = '_blank'; fallback.rel = 'noopener noreferrer'; shell.append(fallback); }, {once: true}); }