function escapeAttr(t){return String(t).replace(/&/g,"&amp;").replace(/"/g,"&quot;")}document.addEventListener("DOMContentLoaded",function(){const t=document.querySelectorAll(".thumbnail-btn"),e=document.getElementById("main-image-container");t.length>0&&e&&(t[0].querySelector(".selected-ring").classList.add("ring-brand-500"),t[0].classList.add("ring-2","ring-brand-500"),t.forEach(function(n){n.addEventListener("click",function(){const n=this.getAttribute("data-type"),c=(this.getAttribute("data-image-id"),this.getAttribute("data-video-src")),i=this.getAttribute("data-poster");if("image"===n){const t=this.querySelector("span.absolute.inset-0");if(t){const n=t.querySelector("img");if(n&&n.src){const t=n.src.replace(/-\d+x\d+(\.\w+)$/,"$1"),c=this.getAttribute("data-full-src")||t;e.innerHTML='<img id="main-image" tabindex="0" class="h-full w-full object-contain object-center sm:rounded-lg" src="'+t+'" alt="'+escapeAttr(n.alt||"")+'" data-full-src="'+escapeAttr(c)+'">'}}}else if("video"===n||"url"===n){const t=i?' poster="'+i+'"':"";e.innerHTML='<video id="main-video" class="h-full w-full object-contain object-center sm:rounded-lg" controls preload="metadata" src="'+c+'"'+t+"></video>"}const s=e.closest(".pg-gallery-stage");s&&s.classList.toggle("is-zoomable","image"===n),t.forEach(function(t){t.classList.remove("ring-2","ring-brand-500"),t.querySelector(".selected-ring").classList.remove("ring-brand-500")}),this.classList.add("ring-2","ring-brand-500"),this.querySelector(".selected-ring").classList.add("ring-brand-500")})}));const n=document.querySelector(".pg-gallery-stage");if(n&&e){const c={close:n.getAttribute("data-label-close")||"Close",prev:n.getAttribute("data-label-prev")||"Previous",next:n.getAttribute("data-label-next")||"Next"},i=[];if(t.forEach(function(t){"image"===t.getAttribute("data-type")&&t.getAttribute("data-full-src")&&i.push({src:t.getAttribute("data-full-src"),alt:t.getAttribute("data-full-alt")||""})}),!i.length){const t=e.querySelector("img");t&&t.getAttribute("data-full-src")&&i.push({src:t.getAttribute("data-full-src"),alt:t.alt||""})}if(i.length){let t=null,n=null,s=0,a=null,r=0;const o=function(t){s=(t+i.length)%i.length,n.src=i[s].src,n.alt=i[s].alt},l=function(){t&&(t.hidden=!0,document.body.classList.remove("pg-lightbox-open"),a&&a.focus&&a.focus())},d=function(e){t&&!t.hidden&&("Escape"===e.key?l():"ArrowLeft"===e.key?o(s-1):"ArrowRight"===e.key&&o(s+1))},u=function(){t=document.createElement("div"),t.className="pg-lightbox",t.setAttribute("role","dialog"),t.setAttribute("aria-modal","true"),t.hidden=!0;const e=i.length>1?'<button type="button" class="pg-lightbox-nav pg-lightbox-prev" aria-label="'+escapeAttr(c.prev)+'">&#8249;</button><button type="button" class="pg-lightbox-nav pg-lightbox-next" aria-label="'+escapeAttr(c.next)+'">&#8250;</button>':"";t.innerHTML='<button type="button" class="pg-lightbox-close" aria-label="'+escapeAttr(c.close)+'">&times;</button>'+e+'<img class="pg-lightbox-image" src="" alt="">',document.body.appendChild(t),n=t.querySelector(".pg-lightbox-image"),t.querySelector(".pg-lightbox-close").addEventListener("click",l),t.addEventListener("click",function(e){e.target===t&&l()});const a=t.querySelector(".pg-lightbox-prev"),u=t.querySelector(".pg-lightbox-next");a&&a.addEventListener("click",function(){o(s-1)}),u&&u.addEventListener("click",function(){o(s+1)}),t.addEventListener("touchstart",function(t){r=t.changedTouches[0].clientX},{passive:!0}),t.addEventListener("touchend",function(t){if(t.changedTouches.length>1)return;const e=t.changedTouches[0].clientX-r;Math.abs(e)>50&&i.length>1&&o(e>0?s-1:s+1)},{passive:!0}),document.addEventListener("keydown",d)},g=function(n){t||u(),a=n;const c=e.querySelector("img"),s=c?c.getAttribute("data-full-src"):"";let r=0;i.forEach(function(t,e){t.src===s&&(r=e)}),o(r),t.hidden=!1,document.body.classList.add("pg-lightbox-open"),t.querySelector(".pg-lightbox-close").focus()};e.addEventListener("click",function(t){"IMG"===t.target.tagName&&g(t.target)}),e.addEventListener("keydown",function(t){if("Enter"!==t.key&&" "!==t.key)return;const n=e.querySelector("img");n&&t.target===n&&(t.preventDefault(),g(n))});const b=e.querySelector("img");b&&b.setAttribute("tabindex","0")}}document.querySelectorAll('[data-toggle^="spec-"]').forEach(function(t){t.addEventListener("click",function(){const t=this.getAttribute("data-toggle"),e=document.getElementById(t),n=this.closest(".spec-group");if(e&&n){e.classList.contains("hidden")?(e.classList.remove("hidden"),n.classList.add("group-expanded")):(e.classList.add("hidden"),n.classList.remove("group-expanded"))}})});const c=document.querySelector('[data-toggle="spec-0"]'),i=document.getElementById("spec-0");if(c&&i){const t=c.closest(".spec-group");i.classList.remove("hidden"),t&&t.classList.add("group-expanded")}});