!function(){function t(){document.querySelectorAll(".fb-image-gallery-items").forEach(function(t){var e=t.getAttribute("data-id"),n=t.querySelectorAll(".fb-image-gallery-item"),i=Array.from(n),o=0;i.forEach(function(t,n){t.addEventListener("click",function(t){t.preventDefault(),function(t){o=t;var n=document.createElement("div");function r(){n.remove(),document.removeEventListener("keydown",u)}function c(){o=(o+1)%i.length,a()}function l(){o=(o-1+i.length)%i.length,a()}function a(){var t=i[o].getAttribute("href");n.querySelector(".lightbox-image-container img").src=t,n.querySelector(".lightbox-counter").textContent=`${o+1} / ${i.length}`,n.querySelectorAll(".thumbnail").forEach(function(t,e){t.classList.toggle("active",e===o)})}function u(t){"ArrowRight"===t.key?c():"ArrowLeft"===t.key?l():"Escape"===t.key&&r()}n.classList.add("lightbox",e),n.innerHTML=`\n                    <div class="lightbox-content">\n                        <button class="lightbox-close">&times;</button>\n                        <div class="lightbox-counter">${o+1} / ${i.length}</div>\n                        <button class="lightbox-prev">&#10094;</button>\n                        <button class="lightbox-next">&#10095;</button>\n                        <div class="lightbox-image-container">\n                            <img src="${i[o].getAttribute("href")}" alt="">\n                        </div>\n                        <div class="lightbox-thumbnails">\n                            ${i.map(function(t,e){return`\n                                    <img src="${t.getAttribute("href")}" \n                                         class="thumbnail ${e===o?"active":""}" \n                                         data-index="${e}" />\n                                `}).join("")}\n                        </div>\n                    </div>\n                `,document.body.appendChild(n),n.querySelector(".lightbox-close").addEventListener("click",r),n.querySelector(".lightbox-prev").addEventListener("click",l),n.querySelector(".lightbox-next").addEventListener("click",c),n.querySelectorAll(".thumbnail").forEach(function(t){t.addEventListener("click",function(t){o=parseInt(t.target.getAttribute("data-index")),a()})}),document.addEventListener("keydown",u)}(n)})})})}var e=!1;!function(){if(!e&&(e=!0,"complete"===document.readyState||"interactive"===document.readyState?setTimeout(t,100):document.addEventListener("DOMContentLoaded",function(){setTimeout(t,100)}),"undefined"!=typeof window)){var n=window.location.href;new MutationObserver(function(){n!==window.location.href&&(n=window.location.href,setTimeout(t,300))}).observe(document.body,{childList:!0,subtree:!0})}}(),window.reinitImageGallery=t}();