import{S as c,N as p}from"./navigation.1wJW8ksF.js";const d="https://cursoagenteinmobiliario.pe/blog-gestor/wp-json/wp/v2";async function g(){const a=await(await fetch(`${d}/posts?per_page=6&_embed`)).json(),t=document.getElementById("blog-swiper-wrapper");a.forEach(e=>{const i=e.title.rendered,r=e.excerpt.rendered.replace(/<[^>]+>/g,"").split(" ").slice(0,20).join(" ")+"...",n=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 class="blog-card-image">
          <img src="${n}" alt="${i}" />
          <span class="blog-category">${l}</span>
        </div>
        <div class="blog-slide-content">
          <h4>${i}</h4>
          <p>${r}</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],navigation:{nextEl:".swiper-navigation-next",prevEl:".swiper-navigation-prev"},slidesPerView:1,spaceBetween:30,loop:!0,breakpoints:{768:{slidesPerView:2},1024:{slidesPerView:3,spaceBetween:46},1536:{slidesPerView:3,spaceBetween:46}}})}g();
