1import{r as l,f as b,a6 as z,j as e,X as C}from"./index-CpHwTPqd.js";import{l as S}from"./bodyScrollLock-B-ziv6ZA.js";import{A as E}from"./index-C-ZsiPIe.js";import{m as I}from"./proxy-B51j0wJM.js";import{C as P}from"./chevron-left-coDiOHYy.js";import{C as R}from"./chevron-right-BohKwO_r.js";function W({project:n,onClose:i}){const[a,c]=l.useState(0),[w,v]=l.useState(!0),s=(n==null?void 0:n.images)||[];l.useEffect(()=>{const t=setTimeout(()=>v(!1),2500);return()=>clearTimeout(t)},[]),l.useEffect(()=>S(),[]),l.useEffect(()=>{if(!s.length)return;const t=new Set;for(let o=1;o<=3;o++)t.add((a+o)%s.length);t.add((a-1+s.length)%s.length),t.forEach(o=>{var g;const f=(g=s[o])==null?void 0:g.url;if(f){const T=new window.Image;T.src=b(f,{w:1200,q:85})}})},[a,s]);const d=t=>{t==null||t.stopPropagation(),c(o=>o<s.length-1?o+1:0)},m=t=>{t==null||t.stopPropagation(),c(o=>o>0?o-1:s.length-1)},[u,k]=l.useState(null),[h,p]=l.useState(null),x=50,j=t=>{p(null),k(t.targetTouches[0].clientX)},y=t=>p(t.targetTouches[0].clientX),N=()=>{if(!u||!h)return;const t=u-h;t>x?d():t<-x&&m()};if(!s.length)return null;const r=s[a];return z.createPortal(e.jsx(E,{children:e.jsxs(I.div,{initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[9999] bg-black flex flex-col",onClick:i,onTouchStart:j,onTouchMove:y,onTouchEnd:N,children:[e.jsx("div",{className:"absolute top-0 left-0 right-0 h-1 flex gap-0.5 p-1 z-20",children:s.map((t,o)=>e.jsx("div",{className:`h-full flex-1 rounded-full transition-colors ${o===a?"bg-white":o<a?"bg-white/50":"bg-white/20"}`},o))}),e.jsx("button",{onClick:i,className:"absolute top-4 right-4 z-50 text-white/80 hover:text-white p-2 bg-black/20 backdrop-blur-md rounded-full",children:e.jsx(C,{className:"w-6 h-6"})}),e.jsxs("div",{className:"absolute top-6 left-6 md:top-8 md:left-8 z-40 text-white pointer-events-none",children:[e.jsx("h3",{className:"font-bold text-2xl md:text-4xl shadow-black drop-shadow-lg tracking-wide mb-1",children:n.title}),n.subtitle&&e.jsx("p",{className:"text-lg md:text-xl font-medium shadow-black drop-shadow-md opacity-90 mb-1",children:n.subtitle}),e.jsxs("p",{className:"text-sm md:text-base opacity-90 font-medium shadow-black drop-shadow-md tracking-wider",children:[a+1," ",e.jsx("span",{className:"opacity-60 mx-1",children:"/"})," ",s.length]})]}),e.jsxs("div",{className:"flex-1 flex items-center justify-center relative w-full min-h-0",children:[e.jsx("div",{className:"absolute left-0 top-0 bottom-0 w-[35%] z-30 cursor-pointer flex items-center justify-start pl-4 group outline-none",onClick:m,role:"button","aria-label":"Previous Image",style:{WebkitTapHighlightColor:"transparent"},children:e.jsx("div",{className:"relative z-50 bg-black/20 p-3 rounded-full backdrop-blur-md opacity-0 group-hover:opacity-100 transition-opacity duration-200 pointer-events-none",children:e.jsx(P,{className:"w-8 h-8 text-white"})})}),e.jsx("div",{className:"absolute right-0 top-0 bottom-0 w-[35%] z-30 cursor-pointer flex items-center justify-end pr-4 group outline-none",onClick:d,role:"button","aria-label":"Next Image",style:{WebkitTapHighlightColor:"transparent"},children:e.jsx("div",{className:`relative z-50 bg-black/20 p-3 rounded-full backdrop-blur-md transition-opacity duration-200 pointer-events-none ${w?"opacity-100":"opacity-0 group-hover:opacity-100"}`,children:e.jsx(R,{className:"w-8 h-8 text-white"})})}),e.jsx("div",{className:"relative w-full h-full flex items-center justify-center p-4 md:p-10",onClick:t=>t.stopPropagation(),children:e.jsx("img",{src:b(r.url,{w:1200,q:85}),alt:"",className:"max-h-full max-w-full object-contain rounded-md shadow-2xl",decoding:"async",loading:"eager"})})]}),r.caption&&e.jsx("div",{className:"absolute bottom-20 left-0 right-0 text-center p-4 z-20 pointer-events-none",children:e.jsx("p",{className:"text-white text-sm bg-black/50 inline-block px-3 py-1 rounded-full backdrop-blur-md",children:r.caption})}),e.jsx("button",{onClick:t=>{t.stopPropagation(),i()},className:"shrink-0 border-t border-white/10 p-3 sm:p-4 bg-black w-full hover:bg-zinc-900 transition-colors relative z-[60]",children:e.jsx("p",{className:"text-center text-xs sm:text-sm text-gray-400",children:"Tap to close"})})]})}),document.body)}export{W as default};
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.