1document.addEventListener('DOMContentLoaded',function(){const accessToken=instagramSettings.accessToken;const instagramId=instagramSettings.instagramId;const loadingIndicator=document.getElementById('instagram-loading-indicator');async function fetchInstagramPosts(){if(!accessToken){console.error('Instagram Access Token não está definido.');if(loadingIndicator){loadingIndicator.textContent='Erro de configuração: Token de Acesso em falta.';} 2return;} 3const apiUrl=`https://graph.facebook.com/v23.0/${instagramId}/media?fields=id,media_type,media_url,permalink,thumbnail_url,caption&access_token=${accessToken}`;try{const response=await fetch(apiUrl);if(!response.ok){const errorData=await response.json();console.error('Dados do erro da API:',errorData);throw new Error(`Erro na API do Instagram: ${response.statusText}`);} 4const data=await response.json();if(!data.data||data.data.length===0){if(loadingIndicator){loadingIndicator.textContent='Nenhuma publicação encontrada.';} 5console.warn('Nenhuma publicação foi encontrada na conta do Instagram.');return;} 6if(loadingIndicator){loadingIndicator.style.display='none';} 7const slides=data.data.slice(0,10).map(post=>{return{permalink:post.permalink,media_url:post.media_type==='VIDEO'?post.thumbnail_url:post.media_url,};});renderSwiper(slides);}catch(error){console.error("Erro detalhado ao buscar posts do Instagram:",error);if(loadingIndicator){loadingIndicator.textContent='Erro ao carregar as publicações do Instagram.';}}}
8function renderSwiper(slides){const container=document.getElementById("instagram-slider");if(!container)return;container.innerHTML='';slides.forEach(slideData=>{const slide=document.createElement("div");slide.className="swiper-slide";slide.innerHTML=` 9 <a href="${slideData.permalink}" target="_blank" rel="noopener noreferrer"> 10 <div style="height: 635px; overflow: hidden;"> 11 <img src="${slideData.media_url}" alt="Instagram Post" style="width:100%; height: 100%; object-fit: cover;"> 12 </div> 13 </a> 14 `;container.appendChild(slide);});initializeSwiper();} 15function initializeSwiper(){if(window.swiperInstance){window.swiperInstance.destroy(true,true);} 16window.swiperInstance=new Swiper(".instagramSwiper",{loop:true,slidesPerView:3,spaceBetween:4,autoplay:{delay:4000,disableOnInteraction:false,pauseOnMouseEnter:true,},breakpoints:{1280:{slidesPerView:3,spaceBetween:4},1024:{slidesPerView:3,spaceBetween:4},768:{slidesPerView:2,spaceBetween:4},640:{slidesPerView:1,spaceBetween:0},320:{slidesPerView:1,spaceBetween:0}},pagination:false,navigation:false,});} 17fetchInstagramPosts();});
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.