import{S as c,N as p,A as d}from"./autoplay.uX1LFIaS.js";const g="https://cursoagenteinmobiliario.pe/blog-gestor/wp-json/wp/v2";async function m(){const i=await(await fetch(`${g}/posts?per_page=6&_embed`)).json(),t=document.getElementById("blog-swiper-wrapper");i.forEach(e=>{const a=e.title.rendered,n=e.excerpt.rendered.replace(/<[^>]+>/g,"").split(" ").slice(0,20).join(" ")+"...",r=e._embedded?.["wp:featuredmedia"]?.[0]?.source_url||"https://via.placeholder.com/300x200",o=e.slug,l=e._embedded?.["wp:term"]?.[0]?.[0]?.name||"Sin categoría",s=document.createElement("div");s.className="swiper-slide",s.innerHTML=`
        <div >
          <img src="${r}" alt="${a}" />
          <span class="blog-category">${l}</span>
        </div>
        <div class="blog-slide-content">
          <h4>${a}</h4>
          <p>${n}</p>
          <div class="btn-articulo">
            <a href="https://cursoagenteinmobiliario.pe/blog/${o}">Leer más</a>
          </div>
        </div>
      `,t.appendChild(s)}),new c(".blog-swiper",{modules:[p,d],navigation:{nextEl:".swiper-navigation-next",prevEl:".swiper-navigation-prev"},slidesPerView:1,spaceBetween:30,loop:!0,autoplay:{delay:3e3,disableOnInteraction:!1},breakpoints:{768:{slidesPerView:2},1024:{slidesPerView:3}}})}m();
