12 lines
11 KiB
JavaScript
12 lines
11 KiB
JavaScript
;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="d599c452-def3-07ce-aa15-2c837bf33fde")}catch(e){}}();
|
||
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,140802,e=>{"use strict";e.i(653782);var t=e.i(452797),r=e.i(907358),n=e.i(807464),i=e.i(134174),o=e.i(736986),l=e.i(370338),a=e.i(250438),s=r,u=e.i(753942);function c(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}class d extends s.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if((0,a.isHTMLElement)(t)&&e.isPresent&&!this.props.isPresent&&!1!==this.props.pop){let e=t.offsetParent,r=(0,a.isHTMLElement)(e)&&e.offsetWidth||0,n=(0,a.isHTMLElement)(e)&&e.offsetHeight||0,i=getComputedStyle(t),o=this.props.sizeRef.current;o.height=parseFloat(i.height),o.width=parseFloat(i.width),o.top=t.offsetTop,o.left=t.offsetLeft,o.right=r-o.width-o.left,o.bottom=n-o.height-o.top}return null}componentDidUpdate(){}render(){return this.props.children}}function f({children:e,isPresent:n,anchorX:i,anchorY:o,root:l,pop:a}){let f=(0,s.useId)(),h=(0,s.useRef)(null),p=(0,s.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:m}=(0,s.useContext)(u.MotionConfigContext),x=function(...e){return r.useCallback(function(...e){return t=>{let r=!1,n=e.map(e=>{let n=c(e,t);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let t=0;t<n.length;t++){let r=n[t];"function"==typeof r?r():c(e[t],null)}}}}(...e),e)}(h,e.props?.ref??e?.ref);return(0,s.useInsertionEffect)(()=>{let{width:e,height:t,top:r,left:s,right:u,bottom:c}=p.current;if(n||!1===a||!h.current||!e||!t)return;let d="left"===i?`left: ${s}`:`right: ${u}`,x="bottom"===o?`bottom: ${c}`:`top: ${r}`;h.current.dataset.motionPopId=f;let y=document.createElement("style");m&&(y.nonce=m);let g=l??document.head;return g.appendChild(y),y.sheet&&y.sheet.insertRule(`
|
||
[data-motion-pop-id="${f}"] {
|
||
position: absolute !important;
|
||
width: ${e}px !important;
|
||
height: ${t}px !important;
|
||
${d}px !important;
|
||
${x}px !important;
|
||
}
|
||
`),()=>{h.current?.removeAttribute("data-motion-pop-id"),g.contains(y)&&g.removeChild(y)}},[n]),(0,t.jsx)(d,{isPresent:n,childRef:h,sizeRef:p,pop:a,children:!1===a?e:s.cloneElement(e,{ref:x})})}let h=({children:e,initial:n,isPresent:o,onExitComplete:a,custom:s,presenceAffectsLayout:u,mode:c,anchorX:d,anchorY:h,root:m})=>{let x=(0,i.useConstant)(p),y=(0,r.useId)(),g=!0,v=(0,r.useMemo)(()=>(g=!1,{id:y,initial:n,isPresent:o,custom:s,onExitComplete:e=>{for(let t of(x.set(e,!0),x.values()))if(!t)return;a&&a()},register:e=>(x.set(e,!1),()=>x.delete(e))}),[o,x,a]);return u&&g&&(v={...v}),(0,r.useMemo)(()=>{x.forEach((e,t)=>x.set(t,!1))},[o]),r.useEffect(()=>{o||x.size||!a||a()},[o]),e=(0,t.jsx)(f,{pop:"popLayout"===c,isPresent:o,anchorX:d,anchorY:h,root:m,children:e}),(0,t.jsx)(l.PresenceContext.Provider,{value:v,children:e})};function p(){return new Map}var m=e.i(718015);let x=e=>e.key||"";function y(e){let t=[];return r.Children.forEach(e,e=>{(0,r.isValidElement)(e)&&t.push(e)}),t}let g=({children:e,custom:l,initial:a=!0,onExitComplete:s,presenceAffectsLayout:u=!0,mode:c="sync",propagate:d=!1,anchorX:f="left",anchorY:p="top",root:g})=>{let[v,b]=(0,m.usePresence)(d),w=(0,r.useMemo)(()=>y(e),[e]),j=d&&!v?[]:w.map(x),C=(0,r.useRef)(!0),E=(0,r.useRef)(w),P=(0,i.useConstant)(()=>new Map),N=(0,r.useRef)(new Set),[k,R]=(0,r.useState)(w),[S,L]=(0,r.useState)(w);(0,o.useIsomorphicLayoutEffect)(()=>{C.current=!1,E.current=w;for(let e=0;e<S.length;e++){let t=x(S[e]);j.includes(t)?(P.delete(t),N.current.delete(t)):!0!==P.get(t)&&P.set(t,!1)}},[S,j.length,j.join("-")]);let z=[];if(w!==k){let e=[...w];for(let t=0;t<S.length;t++){let r=S[t],n=x(r);j.includes(n)||(e.splice(t,0,r),z.push(r))}return"wait"===c&&z.length&&(e=z),L(y(e)),R(w),null}let{forceRender:A}=(0,r.useContext)(n.LayoutGroupContext);return(0,t.jsx)(t.Fragment,{children:S.map(e=>{let r=x(e),n=(!d||!!v)&&(w===S||j.includes(r));return(0,t.jsx)(h,{isPresent:n,initial:(!C.current||!!a)&&void 0,custom:l,presenceAffectsLayout:u,mode:c,root:g,onExitComplete:n?void 0:()=>{if(N.current.has(r)||!P.has(r))return;N.current.add(r),P.set(r,!0);let e=!0;P.forEach(t=>{t||(e=!1)}),e&&(A?.(),L(E.current),d&&b?.(),s&&s())},anchorX:f,anchorY:p,children:e},r)})})};e.s(["AnimatePresence",()=>g],140802)},843325,e=>{"use strict";var t=e.i(452797),r=e.i(907358),n=e.i(663067),i=e.i(910353);let o=(0,e.i(933112).createMotionProxy)();var l=e.i(247237),a=e.i(286091);function s({children:e,features:n,strict:i=!1}){let[,o]=(0,r.useState)(!u(n)),s=(0,r.useRef)(void 0);if(!u(n)){let{renderer:e,...t}=n;s.current=e,(0,a.loadFeatures)(t)}return(0,r.useEffect)(()=>{u(n)&&n().then(({renderer:e,...t})=>{(0,a.loadFeatures)(t),s.current=e,o(!0)})},[]),(0,t.jsx)(l.LazyContext.Provider,{value:{renderer:s.current,strict:i},children:e})}function u(e){return"function"==typeof e}var c=e.i(140802),d=e.i(976819);function f({isOpen:l,images:a,initialIndex:u,onClose:f}){let h=(0,d.useRouter)(),p=(0,d.useSearchParams)(),m=(0,d.usePathname)(),[x,y]=(0,r.useState)(u),[g,v]=(0,r.useState)(!1),b=(0,r.useRef)(null),w=(0,r.useRef)(null);(0,r.useEffect)(()=>(v(!0),()=>v(!1)),[]);let j=(0,r.useCallback)(e=>{let t=new URLSearchParams(p.toString());null!==e?t.set("photo",e.toString()):t.delete("photo"),h.replace(`${m}?${t.toString()}`,{scroll:!1})},[m,h,p]),C=(0,r.useCallback)(()=>{y(e=>{let t=0===e?a.length-1:e-1;return j(t),t})},[a.length,j]),E=(0,r.useCallback)(()=>{y(e=>{let t=e===a.length-1?0:e+1;return j(t),t})},[a.length,j]);(0,r.useEffect)(()=>{let e=p.get("photo");if(null!==e){let t=parseInt(e,10);!isNaN(t)&&t>=0&&t<a.length&&y(t)}},[p,a.length]);let P=(0,r.useCallback)(()=>{j(null),f()},[j,f]);return((0,r.useEffect)(()=>{l&&j(x)},[l,x,j]),(0,r.useEffect)(()=>{if(!l){w.current&&w.current.focus();return}w.current=document.activeElement,setTimeout(()=>b.current?.focus(),100);let e=e=>{if("Escape"===e.key&&P(),"ArrowLeft"===e.key&&C(),"ArrowRight"===e.key&&E(),"Tab"===e.key){let t=Array.from(document.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')).filter(e=>document.querySelector('[role="dialog"]')?.contains(e));if(0===t.length)return;let r=t[0],n=t[t.length-1];e.shiftKey?document.activeElement===r&&(n.focus(),e.preventDefault()):document.activeElement===n&&(r.focus(),e.preventDefault())}},t=window.getComputedStyle(document.body).overflow,r=window.getComputedStyle(document.documentElement).overflow;return document.documentElement.style.setProperty("overflow","hidden","important"),document.body.style.setProperty("overflow","hidden","important"),window.addEventListener("keydown",e),()=>{document.documentElement.style.overflow=r,document.body.style.overflow=t,window.removeEventListener("keydown",e)}},[l,C,E,P]),g)?(0,i.createPortal)((0,t.jsx)(s,{strict:!0,features:()=>e.A(215418).then(e=>e.default),children:(0,t.jsx)(c.AnimatePresence,{children:l&&(0,t.jsxs)("div",{className:"fixed inset-0 z-[99999] flex items-center justify-center",role:"dialog","aria-modal":"true",children:[(0,t.jsx)(o.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.5},className:"absolute inset-0 bg-primary/95 backdrop-blur-xl",onClick:P}),(0,t.jsx)(o.button,{initial:{opacity:0,scale:.5},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.5},transition:{delay:.1,duration:.4},ref:b,onClick:P,className:"absolute top-6 right-6 text-white/60 hover:text-white transition-all duration-500 z-[10000] rounded-full w-14 h-14 flex items-center justify-center hover:bg-white/5 group border border-white/10","aria-label":"Close lightbox",children:(0,t.jsx)("div",{className:"relative w-full h-full flex items-center justify-center group-hover:rotate-90 transition-transform duration-500",children:(0,t.jsx)("span",{className:"text-3xl font-extralight leading-none mb-1",children:"×"})})}),(0,t.jsx)(o.button,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},transition:{delay:.2,duration:.4},onClick:C,className:"absolute left-6 top-1/2 -translate-y-1/2 text-white/60 hover:text-white transition-all duration-500 w-14 h-14 flex items-center justify-center hover:bg-white/5 rounded-full z-[10000] group border border-white/10","aria-label":"Previous image",children:(0,t.jsx)("span",{className:"text-4xl font-extralight group-hover:-translate-x-1 transition-transform duration-500",children:"‹"})}),(0,t.jsx)(o.button,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:20},transition:{delay:.2,duration:.4},onClick:E,className:"absolute right-6 top-1/2 -translate-y-1/2 text-white/60 hover:text-white transition-all duration-500 w-14 h-14 flex items-center justify-center hover:bg-white/5 rounded-full z-[10000] group border border-white/10","aria-label":"Next image",children:(0,t.jsx)("span",{className:"text-4xl font-extralight group-hover:translate-x-1 transition-transform duration-500",children:"›"})}),(0,t.jsx)(o.div,{initial:{opacity:0,y:40,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:20,scale:.98},transition:{duration:.6,ease:[.25,.46,.45,.94]},className:"relative w-full h-full max-w-6xl max-h-[85vh] flex flex-col items-center justify-center p-4 md:p-12 z-20 pointer-events-none",children:(0,t.jsxs)("div",{className:"pointer-events-auto w-full h-full flex flex-col items-center justify-center",children:[(0,t.jsxs)("div",{className:"relative w-full h-full shadow-[0_40px_100px_-20px_rgba(0,0,0,0.6)] ring-1 ring-white/20 overflow-hidden bg-primary-dark/50 rounded-2xl flex items-center justify-center",children:[(0,t.jsx)(c.AnimatePresence,{mode:"wait",initial:!1,children:(0,t.jsx)(o.div,{initial:{opacity:0,scale:1.1,filter:"blur(10px)"},animate:{opacity:1,scale:1,filter:"blur(0px)"},exit:{opacity:0,scale:.9,filter:"blur(10px)"},transition:{duration:.7,ease:[.25,.46,.45,.94]},className:"relative w-full h-full",children:(0,t.jsx)(n.default,{src:a[x],alt:`Gallery image ${x+1}`,fill:!0,className:"object-cover transition-transform duration-1000 hover:scale-[1.03]",unoptimized:!0})},x)}),(0,t.jsx)("div",{className:"absolute inset-0 pointer-events-none opacity-[0.03] bg-[url('/grid.svg')] bg-repeat z-10"}),(0,t.jsx)("div",{className:"absolute inset-0 pointer-events-none bg-gradient-to-tr from-white/10 via-transparent to-transparent opacity-40 z-10"})]}),(0,t.jsxs)(o.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10},transition:{delay:.3,duration:.4},className:"mt-8 flex items-center gap-4",children:[(0,t.jsx)("div",{className:"h-px w-12 bg-white/20"}),(0,t.jsxs)("div",{className:"bg-white/5 backdrop-blur-2xl text-white px-6 py-2 rounded-full border border-white/10 text-[11px] font-bold tracking-[0.2em] uppercase",children:[x+1," ",(0,t.jsx)("span",{className:"text-accent mx-3",children:"/"})," ",a.length]}),(0,t.jsx)("div",{className:"h-px w-12 bg-white/20"})]})]})})]})})}),document.body):null}e.s(["default",()=>f],843325)},888085,e=>{e.n(e.i(843325))},215418,e=>{e.v(t=>Promise.all(["static/chunks/39ab1e7ab650e7f3.js"].map(t=>e.l(t))).then(()=>t(651725)))}]);
|
||
|
||
//# debugId=d599c452-def3-07ce-aa15-2c837bf33fde
|