const fcn_lightbox=_$$$("fictioneer-lightbox"),fcn_lightboxTarget=fcn_lightbox.querySelector(".target");function fcn_showLightbox(e){let t=!1,o=null;if(fcn_lightboxTarget.innerHTML="",e.classList.add("lightbox-last-trigger"),"IMG"==e.tagName?(o=e.cloneNode(),t=!0):e.href&&(o=document.createElement("img"),o.src=e.href,t=!0),t&&o){o.removeAttribute("class"),o.removeAttribute("style"),o.removeAttribute("height"),o.removeAttribute("width"),fcn_lightboxTarget.appendChild(o),fcn_theBody.classList.add("no-scroll"),fcn_lightbox.classList.add("show");let e=fcn_lightbox.querySelector(".lightbox__close");e?.focus(),e?.blur()}}fcn_theBody.querySelectorAll("[data-lightbox]").forEach((e=>{e.addEventListener("click",(e=>{e.preventDefault(),fcn_showLightbox(e.currentTarget)})),e.addEventListener("keydown",(e=>{32!=e.keyCode&&13!=e.keyCode||(e.preventDefault(),fcn_showLightbox(e.currentTarget))}))})),document.querySelectorAll(".lightbox__close, .lightbox").forEach((e=>{e.addEventListener("click",(e=>{if("IMG"!=e.target.tagName){fcn_theBody.classList.remove("no-scroll"),fcn_lightbox.classList.remove("show");let e=_$(".lightbox-last-trigger");e?.focus(),e?.blur(),e?.classList.remove("lightbox-last-trigger")}}))}));