let lightbox=GLightbox({selector:".image-popup",title:!1}),gridElement=document.getElementById("grid"),grid=null;if(grid=gridElement?new Muuri(gridElement,{dragEnabled:!0,layout:{rounding:!1}}):grid){let e=document.querySelector('input[name="search"]'),r=(e&&e.addEventListener("input",function(e){let t=e.target.value.toLowerCase();grid.filter(e=>e.getElement().textContent.toLowerCase().includes(t))}),document.querySelectorAll(".filter-buttons button"));0<r.length&&r.forEach(e=>{e.addEventListener("click",()=>{let t=e.dataset.filter;grid.filter(e=>{e=e.getElement().dataset.category;return!t||e===t}),r.forEach(e=>e.classList.remove("active")),e.classList.add("active")})})}