1import{a as e}from"./CNC7AqOf.js";import{rt as t}from"./DBCZuFtn.js";import{An as n,Bn as r,Fn as i,I as a,Kn as o,_n as s,dn as c,fn as l,gn as u,hn as d,vn as f}from"./Cj3Ri-bZ.js";import{t as p}from"./C0aQe7Ii2.js";import{n as m,t as h}from"./C5KgTtL52.js";import{t as g}from"./DW3OcRNq2.js";import{$ as _,i as v,s as y}from"./YnJeFydF2.js";import{n as b}from"./DTbR38vj2.js";import{t as x}from"./_h4-IJJU2.js";import{d as S}from"./DqAwHJxc2.js";import{n as C,t as w}from"./8jpsEwka2.js";var T=e(m(),1),E=h();function D({until:e,onDone:t,style:n}){let{i18n:r}=g(),[i,a]=(0,T.useState)(null);return(0,T.useEffect)(()=>{let n=()=>{let n=Math.max(e.getTime()-new Date().getTime(),0);if(n<=0){a(null),t?.();return}a({days:Math.floor(n/(1e3*60*60*24)),hours:Math.floor(n%(1e3*60*60*24)/(1e3*60*60)),minutes:Math.floor(n%(1e3*60*60)/(1e3*60)),seconds:Math.floor(n%(1e3*60)/1e3)})};n();let r=setInterval(n,1e3);return()=>clearInterval(r)},[e,t]),i?(0,E.jsx)(`span`,{className:`tabular-nums`,children:new Intl.DurationFormat(r.language,{style:n||`long`}).format(i)}):null}function O({event:e,variant:t}){let{t:r}=g([`common`]);return e.soldOutFallback?(0,E.jsxs)(`div`,{children:[e.soldOutFallback.soldOutFallbackType===a.default&&(0,E.jsx)(n,{asChild:!0,variant:t,className:`w-full`,children:(0,E.jsx)(i,{to:o.index(),children:r(`viewOtherEvents`)})}),e.soldOutFallback.soldOutFallbackType===a.moreInformation&&(0,E.jsx)(n,{asChild:!0,variant:t,className:`w-full`,children:(0,E.jsxs)(`a`,{href:e.soldOutFallback.soldOutFallbackLink,target:`_blank`,rel:`nofollow noreferrer`,children:[r(`moreInformation`),(0,E.jsx)(`span`,{className:`sr-only`,children:r(`common:newTabHint`)})]})}),e.soldOutFallback.soldOutFallbackType===a.waitingList&&(0,E.jsx)(n,{asChild:!0,variant:t,className:`w-full`,children:(0,E.jsxs)(`a`,{href:e.soldOutFallback.soldOutFallbackLink,target:`_blank`,rel:`nofollow noreferrer`,children:[r(`joinWaitingList`),(0,E.jsx)(`span`,{className:`sr-only`,children:r(`common:newTabHint`)})]})})]}):null}function k(e){let{gallery:n,selectedIndex:i,open:a,onClose:o,onSelect:p}=e,{t:m}=g([`common`]),h=(0,T.useRef)(null),v=(0,T.useRef)(1),y=n?Math.max(0,Math.min(i,n.length-1)):0,D=_(e=>{p(e)});if((0,T.useEffect)(()=>{n&&i!==y&&D(y)},[n,i,y,D]),!n)return null;let O=()=>{v.current=-1,p((y-1+n.length)%n.length)},k=()=>{v.current=1,p((y+1)%n.length)},A=e=>{e.preventDefault(),h.current?.focus()},j=n[y];return j?(0,E.jsx)(s,{open:a,onOpenChange:e=>{e||o()},children:(0,E.jsxs)(u,{children:[(0,E.jsx)(d,{className:`fixed inset-0 bg-black z-modal data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`}),(0,E.jsxs)(l,{className:`isolate fixed inset-0 bg-black z-modal flex flex-col focus:outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,"aria-describedby":void 0,onOpenAutoFocus:A,onKeyDown:e=>{e.key===`ArrowLeft`?(e.preventDefault(),O()):e.key===`ArrowRight`&&(e.preventDefault(),k())},children:[(0,E.jsx)(f,{className:`sr-only`,children:m(`gallery.imageIndexOfLength`,{number:y+1,total:n.length})}),(0,E.jsx)(c,{className:`absolute top-4 right-4 z-10 p-2 text-white hover:bg-white/10 rounded-full transition-colors cursor-pointer focus-visible:outline-white`,"aria-label":m(`gallery.close`),children:(0,E.jsx)(r,{className:`w-8 h-8`})}),(0,E.jsx)(`div`,{className:`flex-1 flex items-center justify-center p-4 md:p-8 min-h-0`,children:(0,E.jsxs)(`div`,{className:`relative w-full h-full flex items-center justify-center overflow-hidden`,children:[(0,E.jsx)(C,{initial:!1,custom:v.current,children:(0,E.jsx)(w.div,{custom:v.current,variants:{enter:e=>({x:e>0?`100%`:`-100%`,opacity:1}),center:{x:0,opacity:1},exit:e=>({x:e>0?`-100%`:`100%`,opacity:0})},initial:`enter`,animate:`center`,exit:`exit`,transition:{type:`spring`,stiffness:600,damping:40,mass:.8},drag:`x`,dragConstraints:{left:0,right:0},dragElastic:.2,onDragEnd:(e,{offset:t})=>{t.x<-50?k():t.x>50&&O()},className:`absolute inset-0 flex items-center justify-center`,children:(0,E.jsx)(t,{src:j.image,width:2e3,alt:j.title||j.description||j.copyright||``,sizes:`100vw`,className:`max-w-full max-h-full object-contain rounded-lg overflow-hidden pointer-events-none`,objectFit:`contain`,loading:`eager`})},y)}),n.length>1&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(`button`,{onClick:O,className:`hidden md:flex absolute left-2 top-1/2 -translate-y-1/2 p-2 text-white hover:bg-white/10 rounded-full transition-colors cursor-pointer focus-visible:outline-white`,"aria-label":m(`gallery.previous`),children:(0,E.jsx)(x,{className:`w-8 h-8`})}),(0,E.jsx)(`button`,{ref:h,onClick:k,className:`hidden md:flex absolute right-2 top-1/2 -translate-y-1/2 p-2 text-white hover:bg-white/10 rounded-full transition-colors cursor-pointer focus-visible:outline-white`,"aria-label":m(`gallery.next`),children:(0,E.jsx)(S,{className:`w-8 h-8`})})]}),(j.title||j.description||j.copyright)&&(0,E.jsx)(`div`,{className:`absolute bottom-0 left-0 right-0 flex justify-center p-6 text-white/90`,children:(0,E.jsx)(`div`,{className:`bg-black/60 backdrop-blur-2xl p-4 px-6 border-1 border-white/5 rounded-lg max-w-prose`,children:(0,E.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[j.title&&(0,E.jsx)(`span`,{className:`text-sm font-semibold line-clamp-2 text-balance`,children:j.title}),j.description&&(0,E.jsx)(`span`,{className:`text-sm text-white/90 line-clamp-3 text-balance`,children:j.description}),j.copyright&&(0,E.jsxs)(`span`,{className:`text-xs text-white/70 line-clamp-1 text-balance`,children:[`© `,j.copyright]})]})})})]})}),(0,E.jsx)(`div`,{className:`p-4 flex justify-start lg:justify-center gap-2 overflow-x-auto flex-shrink-0 snap-x snap-mandatory scroll-px-4`,role:`list`,"data-testid":`horizontal-gallery-thumbn
1ails`,"aria-label":m(`gallery.galleryThumbnails`),children:n.map((e,n)=>(0,E.jsx)(`button`,{onClick:()=>p(n),className:b(`w-20 h-20 md:w-24 md:h-24 rounded-lg overflow-hidden shrink-0 transition-all focus-visible:outline-white cursor-pointer snap-start`,n===y?`ring-2 outline-white`:`opacity-60 hover:opacity-100`),"aria-label":m(`gallery.goToImage`,{number:n+1}),"aria-current":n===y?`true`:void 0,role:`listitem`,children:(0,E.jsx)(t,{src:e.image,width:96,alt:e.title||e.description||e.copyright||``,sizes:`(max-width: 768px) 80px, 96px`,className:`w-full h-full object-cover`,objectFit:`cover`})},e._id))})]})]})}):null}function A(e=`gallery`){let[t,n]=y(e,v);return{selectImage:e=>{n(e)},isOpen:t!==null,selectedIndex:t,close:()=>{n(null)}}}function j(e){let{i18n:t}=g(),n=_(()=>M(t.language,e.withForceRefresh));return(0,T.useEffect)(()=>{let e=setTimeout(n,2500),t=setInterval(n,3e4);return()=>{clearTimeout(e),clearInterval(t)}},[n]),null}function M(e,t){let n=p.getCookie(`vi_wq`),r=`/q/ping?host=`+window.location.host;n&&(r+=`&id=${n}`),fetch(r,{method:`POST`,headers:{"Content-Type":`application/json`},credentials:`same-origin`}).then(async n=>{let r=await n.json();if(r.id&&p.setCookie(`vi_wq`,r.id,1),t&&r.pq==1)try{let t=window.btoa(JSON.stringify({id:r.id,redirectUri:window.location.href}));window.location.href=`/room?lang=${e}#${t}`}catch{}}).catch(e=>{console.error(e)})}export{D as a,O as i,A as n,k as r,j as t};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.