1import{U as m}from"./utils-BGIwY-9G.js";function b(){const s=document.querySelector("main.category-page");if(!s)return;const c=s.dataset.id,r=document.getElementById("more-posts-container"),t=document.querySelector(".load-more-btn"),n=document.getElementById("loading-indicator");if(!t||!r||!n||!c)return;const y=window.Habersoft?.routes?.ajax?.category_posts||"/front/ajax/category/:id/posts",u=f(),p=btoa(JSON.stringify(u));let l=1,i=!1;function f(){const o=[];return s.querySelectorAll("[data-post-id]").forEach(d=>{const e=parseInt(d.getAttribute("data-post-id"),10);!isNaN(e)&&!o.includes(e)&&o.push(e)}),o}t.addEventListener("click",async function(o){if(o.preventDefault(),i)return;i=!0,t.style.display="none",n.style.display="block";const d=y.replace(":id",c)+`?page=${l}&excluded=${p}`;try{const a=await(await m.customFetch(d,{headers:{Accept:"application/json"}})).json();!a.html||a.html.trim()===""?(n.style.display="none",r.insertAdjacentHTML("beforeend",`<div class="alert alert-secondary mt-3 mb-0 border-0 text-center rounded-0">${window.__("pagination.finish")}</div>`)):(r.insertAdjacentHTML("beforeend",a.html),l++,n.style.display="none",a.hasMore?t.style.display="":r.insertAdjacentHTML("beforeend",`<div class="alert alert-secondary mt-3 mb-0 border-0 text-center rounded-0">${window.__("pagination.finish")}</div>`))}catch(e){console.error("Category load-more error",e),window.showToast?.("danger",window.__("infinity.loading_error")),t.style.display="",n.style.display="none"}finally{i=!1}})}export{b as default};
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.