void 0!==window.CSS&&"function"==typeof window.CSS.escape||(window.CSS=window.CSS||{},window.CSS.escape=function(e){return e.replace(/[^a-zA-Z0-9_\-]/g,"\\$&")}),document.addEventListener("click",function(e){var t=e.target.closest(".fb-query-pagination a");if(t){var a=t.closest(".wp-block-frontis-blocks-loop-builder.fb-loop-builder");if(a){var n=a.getAttribute("data-fb-block-id");if(n){var o=t.closest(".fb-query-pagination"),r=o&&o.dataset.pageParam?o.dataset.pageParam:"fb_paged_"+n.replace(/[^a-z0-9_\-]/gi,""),i=o&&o.dataset.baseUrl?o.dataset.baseUrl:window.location.href,c=o&&o.dataset.currentPage?parseInt(o.dataset.currentPage,10):1,s=o&&o.dataset.totalPages?parseInt(o.dataset.totalPages,10):1,l=function(e,t){try{var a=new URL(e,window.location.href).searchParams.get(t);return a?parseInt(a,10):null}catch(e){return null}}(t.getAttribute("href")||"",r);if(l||(t.classList.contains("fb-page-prev")?l=Math.max(1,c-1):t.classList.contains("fb-page-next")&&(l=Math.min(s,c+1))),l){e.preventDefault();var d,u,f,p=(d=r,u=l,(f=new URL(i,window.location.href)).searchParams.set(d,String(u)),f.toString());a.classList.add("is-loading"),fetch(p,{credentials:"same-origin"}).then(function(e){return e.text()}).then(function(e){var t=document.implementation.createHTMLDocument("");t.documentElement.innerHTML=e;var o="div.wp-block-frontis-blocks-loop-builder.fb-loop-builder."+CSS.escape(n),i=t.querySelector(o);i?(a.outerHTML=i.outerHTML,function(e){try{var t=new URL(window.location.href);t.searchParams.delete(e);var a=t.searchParams.toString();window.history.replaceState(null,"",t.pathname+(a?"?"+a:"")+t.hash)}catch(e){}}(r)):window.location.href=p}).catch(function(){window.location.href=p}).finally(function(){var e=document.querySelector("div.wp-block-frontis-blocks-loop-builder.fb-loop-builder."+CSS.escape(n));e&&e.classList.remove("is-loading")})}}}}},!0);