(()=>{const h="https://www.qhl.hu/shop_ordered/15586/pic/hs-protect/hs-protect-unas-9acfa97a9889.css";if(!Array.from(document.querySelectorAll("link[data-hs-protect-runtime-css]")).some((l)=>l.href===h)){const l=document.createElement("link");l.rel="stylesheet";l.href=h;l.setAttribute("data-hs-protect-runtime-css","");document.head.appendChild(l)}})(); (()=>{"use strict"; const ROOT='[data-hs-protect-compiled="1"]'; const MOBILE_BREAKPOINT=960; const each=(root,selector,fn)=>root.querySelectorAll(selector).forEach(fn); const syncViewport=(root)=>root.style?.setProperty("--hs-client-width",String(document.documentElement?.clientWidth||globalThis.innerWidth||0)+"px"); const prepareHost=(root)=>{ syncViewport(root); root.closest(".page_content")?.setAttribute("data-hs-protect-content","1"); root.closest(".page_content_item")?.setAttribute("data-hs-protect-content-item","1"); const host=root.closest("main.main"); if(!host)return; host.setAttribute("data-hs-protect-host","1"); host.querySelectorAll(".main__title,.main-title").forEach(title=>{ if(title.closest("main.main")===host&&!root.contains(title))title.remove(); }); }; const initialize=(root)=>{ prepareHost(root); if(root.dataset.hsReady==="1")return; root.dataset.hsReady="1"; const header=root.querySelector("[data-hs-header]"); const toggle=root.querySelector("[data-hs-mobile-toggle]"); const nav=root.querySelector("[data-hs-mobile-nav]"); const main=root.querySelector("#hs-protect-main"); const footer=root.querySelector(".footer"); let previousOverflow=""; const setMenu=(open,focus=false,restoreVisibleFocus=false)=>{ if(!toggle||!nav)return; toggle.setAttribute("aria-expanded",String(open)); toggle.setAttribute("aria-label",open?"Menü bezárása":"Menü megnyitása"); nav.setAttribute("aria-hidden",String(!open)); nav.classList.toggle("mobileNavOpen",open); each(nav,"a",link=>{link.tabIndex=open?0:-1;}); if(main)main.inert=open; if(footer)footer.inert=open; if(open){ previousOverflow=document.body.style.overflow; document.body.style.overflow="hidden"; if(focus)nav.querySelector("a")?.focus(); }else{ document.body.style.overflow=previousOverflow; if(restoreVisibleFocus&&(nav.contains?.(document.activeElement)||document.activeElement===toggle)){ root.querySelector(".logo")?.focus(); } } }; const handleViewportChange=()=>{ syncViewport(root); if((document.documentElement?.clientWidth||globalThis.innerWidth||0)>MOBILE_BREAKPOINT&&toggle?.getAttribute("aria-expanded")==="true"){ setMenu(false,false,true); } }; globalThis.addEventListener?.("resize",handleViewportChange,{passive:true}); toggle?.addEventListener("click",()=>setMenu(toggle.getAttribute("aria-expanded")!=="true",true)); nav?.addEventListener("click",event=>{if(event.target.closest("a"))setMenu(false);}); document.addEventListener("pointerdown",event=>{ if(toggle?.getAttribute("aria-expanded")==="true"&&header&&!header.contains(event.target))setMenu(false); }); document.addEventListener("keydown",event=>{ if(toggle?.getAttribute("aria-expanded")!=="true")return; if(event.key==="Escape"){ setMenu(false); toggle.focus(); return; } if(event.key!=="Tab")return; const focusable=[toggle,...nav.querySelectorAll("a:not([tabindex='-1'])")]; const first=focusable[0],last=focusable[focusable.length-1]; if(event.shiftKey&&document.activeElement===first){event.preventDefault();last?.focus();} else if(!event.shiftKey&&document.activeElement===last){event.preventDefault();first?.focus();} }); each(root,"[data-hs-video-activate]",button=>{ const frame=button.closest("[data-hs-remote-video]"); const video=frame?.querySelector("video"); if(!video)return; button.addEventListener("click",()=>{ const source=button.dataset.hsVideoSrc; if(!source||video.getAttribute("src"))return; video.setAttribute("src",source); button.hidden=true; try{ video.load(); const playback=video.play(); playback?.catch?.(()=>{}); }catch{} }); }); each(root,"[data-hs-accordion]",group=>{ const triggers=[...group.querySelectorAll("[data-hs-accordion-trigger]")]; triggers.forEach((trigger,index)=>trigger.addEventListener("click",()=>{ const opening=trigger.getAttribute("aria-expanded")!=="true"; triggers.forEach((other,otherIndex)=>{ const article=other.closest("article"); const panel=document.getElementById(other.getAttribute("aria-controls")); const open=opening&&index===otherIndex; other.setAttribute("aria-expanded",String(open)); article?.classList.toggle("accordionOpen",open); if(panel)panel.hidden=!open; }); })); }); each(root,"[data-hs-image-accordion]",group=>{ const triggers=[...group.querySelectorAll("[data-hs-image-accordion-trigger]")]; triggers.forEach((trigger,index)=>trigger.addEventListener("click",()=>{ const opening=trigger.getAttribute("aria-pressed")!=="true"; triggers.forEach((other,otherIndex)=>{ const active=opening&&index===otherIndex; other.setAttribute("aria-pressed",String(active)); other.closest("article")?.classList.toggle("imageAccordionActive",active); }); })); }); each(root,"[data-hs-gallery]",gallery=>{ const filters=[...gallery.querySelectorAll("[data-hs-gallery-filter]")]; const figures=[...gallery.querySelectorAll("[data-hs-gallery-category]")]; const all=filters[0]?.dataset.hsGalleryFilter; filters.forEach(button=>button.addEventListener("click",()=>{ const selected=button.dataset.hsGalleryFilter; filters.forEach(other=>other.setAttribute("aria-pressed",String(other===button))); figures.forEach(figure=>{figure.hidden=selected!==all&&figure.dataset.hsGalleryCategory!==selected;}); })); }); each(root,"[data-hs-carousel]",carousel=>{ const slides=[...carousel.querySelectorAll("[data-hs-carousel-slide]")]; const status=carousel.querySelector("[data-hs-carousel-status]"); let index=0; const show=(next)=>{ index=(next+slides.length)%slides.length; slides.forEach((slide,itemIndex)=>{ const active=itemIndex===index; slide.hidden=!active; slide.setAttribute("aria-hidden",String(!active)); }); if(status)status.textContent=String(index+1)+" / "+String(slides.length)+". kép"; }; carousel.querySelector("[data-hs-carousel-prev]")?.addEventListener("click",()=>show(index-1)); carousel.querySelector("[data-hs-carousel-next]")?.addEventListener("click",()=>show(index+1)); carousel.addEventListener("keydown",event=>{ if(event.key==="ArrowLeft")show(index-1); if(event.key==="ArrowRight")show(index+1); }); show(0); }); }; const run=()=>document.querySelectorAll(ROOT).forEach(initialize); document.readyState==="loading"?document.addEventListener("DOMContentLoaded",run,{once:true}):run(); })();