{"version":3,"file":"Lightbox.BISCgBGr.mjs","names":["useState","useRef","__esmMin","le","init_ssg_sandbox_shims","init_npm_react_18_3_1","Ha","ce","init_jsx_runtime","init_npm_react_dom_18_3_1","p","_e","de","window","Lightbox","zoomed","setZoomed","scroller","box","closeBtn","anchor","prevFocus","prevOverflow","onKey","e","onClose","a","sc","b","fit","aspect","width","label","FONT","CSS","r","z","ZoomBadge","style","init_Lightbox"],"sources":["https:/framerusercontent.com/modules/uN0KlH9q8Ntc03FxZ0FX/ElrW6APlwh1WWQZ1M7Vd/Lightbox.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useLayoutEffect,useRef,useState}from\"react\";import{createPortal}from\"react-dom\";const FONT='\"Inter\", system-ui, -apple-system, \"Segoe UI\", Roboto, Arial, sans-serif';const ZOOM=2.4;const CSS=`\n@keyframes wl-lb-in { from { opacity: 0 } to { opacity: 1 } }\n@keyframes wl-lb-pop { from { opacity: 0; transform: scale(.94) } to { opacity: 1; transform: none } }\n@media (prefers-reduced-motion: reduce) { .wl-lb, .wl-lb-box { animation: none !important } }\n`;/**\n * Full-screen viewer. Tap the image to zoom in (and again to zoom out), drag to look around,\n * tap the dark area, the close button or press Esc to close. Rendered in a portal on document.body\n * so page transforms and overflow settings cannot clip it.\n */export function Lightbox({onClose,aspect,label,children}){const[zoomed,setZoomed]=useState(false);const scroller=useRef(null);const box=useRef(null);const closeBtn=useRef(null);const anchor=useRef(null);useEffect(()=>{const prevFocus=document.activeElement;const prevOverflow=document.body.style.overflow;document.body.style.overflow=\"hidden\";closeBtn.current?.focus({preventScroll:true});const onKey=e=>{if(e.key===\"Escape\"){e.stopPropagation();onClose();}};window.addEventListener(\"keydown\",onKey,true);return()=>{window.removeEventListener(\"keydown\",onKey,true);document.body.style.overflow=prevOverflow;try{prevFocus?.focus({preventScroll:true});}catch(e){}};// eslint-disable-next-line react-hooks/exhaustive-deps\n},[]);// Keep the point that was tapped under the finger when the zoom level changes.\nuseLayoutEffect(()=>{const a=anchor.current;const sc=scroller.current;const b=box.current;if(!a||!sc||!b)return;anchor.current=null;const r=b.getBoundingClientRect();sc.scrollLeft+=r.left+a.fx*r.width-a.cx;sc.scrollTop+=r.top+a.fy*r.height-a.cy;},[zoomed]);const fit=\"min(100vw - 24px, (100dvh - 128px) * \"+aspect+\")\";const width=zoomed?\"calc(\"+fit+\" * \"+ZOOM+\")\":\"calc(\"+fit+\")\";const toggle=e=>{const b=box.current;if(!b)return;const r=b.getBoundingClientRect();anchor.current={fx:(e.clientX-r.left)/r.width,fy:(e.clientY-r.top)/r.height,cx:e.clientX,cy:e.clientY};setZoomed(z=>!z);};if(typeof document===\"undefined\")return null;return /*#__PURE__*/createPortal(/*#__PURE__*/_jsxs(\"div\",{className:\"wl-lb\",role:\"dialog\",\"aria-modal\":\"true\",\"aria-label\":label,style:{position:\"fixed\",inset:0,zIndex:2147483e3,background:\"rgba(5,5,6,0.95)\",color:\"#fff\",fontFamily:FONT,animation:\"wl-lb-in .25s ease\",boxSizing:\"border-box\"},children:[/*#__PURE__*/_jsx(\"style\",{children:CSS}),/*#__PURE__*/_jsx(\"div\",{ref:scroller,onClick:e=>{if(e.target===e.currentTarget)onClose();},style:{position:\"absolute\",inset:0,display:\"flex\",overflow:zoomed?\"auto\":\"hidden\",padding:\"60px 12px 68px\",boxSizing:\"border-box\",overscrollBehavior:\"contain\",touchAction:zoomed?\"pan-x pan-y\":\"none\",WebkitOverflowScrolling:\"touch\"},children:/*#__PURE__*/_jsx(\"div\",{ref:box,className:\"wl-lb-box\",onClick:toggle,style:{position:\"relative\",flex:\"none\",margin:\"auto\",width,aspectRatio:String(aspect),borderRadius:4,overflow:\"hidden\",background:\"#0b0b0d\",cursor:zoomed?\"zoom-out\":\"zoom-in\",animation:\"wl-lb-pop .3s cubic-bezier(.2,.7,.2,1)\",boxShadow:\"0 30px 90px -30px rgba(0,0,0,.9)\"},children:/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",inset:0},children:children})})}),/*#__PURE__*/_jsx(\"button\",{ref:closeBtn,type:\"button\",\"aria-label\":\"Close\",onClick:onClose,style:{position:\"absolute\",top:\"max(12px, env(safe-area-inset-top))\",right:12,width:44,height:44,borderRadius:22,border:\"1px solid rgba(255,255,255,0.22)\",background:\"rgba(255,255,255,0.12)\",color:\"#fff\",display:\"grid\",placeItems:\"center\",cursor:\"pointer\",backdropFilter:\"blur(10px)\",WebkitBackdropFilter:\"blur(10px)\"},children:/*#__PURE__*/_jsx(\"svg\",{width:\"18\",height:\"18\",viewBox:\"0 0 24 24\",fill:\"none\",stroke:\"currentColor\",strokeWidth:\"2.4\",strokeLinecap:\"round\",\"aria-hidden\":\"true\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M5 5l14 14M19 5L5 19\"})})}),/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",left:0,right:0,bottom:\"max(16px, env(safe-area-inset-bottom))\",textAlign:\"center\",fontSize:12,letterSpacing:\"0.14em\",textTransform:\"uppercase\",color:\"rgba(255,255,255,0.6)\",pointerEvents:\"none\"},children:zoomed?\"Drag to look around \\xb7 Tap to zoom out\":\"Tap image to zoom in\"})]}),document.body);}/** Small magnifier badge that sits on a preview to show it can be opened. */export function ZoomBadge({style}){return /*#__PURE__*/_jsx(\"span\",{\"aria-hidden\":\"true\",style:{position:\"absolute\",right:10,bottom:10,width:34,height:34,borderRadius:17,display:\"grid\",placeItems:\"center\",color:\"#fff\",background:\"rgba(10,10,12,0.55)\",border:\"1px solid rgba(255,255,255,0.25)\",backdropFilter:\"blur(8px)\",WebkitBackdropFilter:\"blur(8px)\",pointerEvents:\"none\",...style},children:/*#__PURE__*/_jsxs(\"svg\",{width:\"17\",height:\"17\",viewBox:\"0 0 24 24\",fill:\"none\",stroke:\"currentColor\",strokeWidth:\"2.2\",strokeLinecap:\"round\",strokeLinejoin:\"round\",children:[/*#__PURE__*/_jsx(\"circle\",{cx:\"11\",cy:\"11\",r:\"6.5\"}),/*#__PURE__*/_jsx(\"path\",{d:\"M20 20l-4.2-4.2M11 8.5v5M8.5 11h5\"})]})});}\nexport const __FramerMetadata__ = {\"exports\":{\"ZoomBadge\":{\"type\":\"reactComponent\",\"name\":\"ZoomBadge\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"Lightbox\":{\"type\":\"reactComponent\",\"name\":\"Lightbox\",\"slots\":[\"children\"],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Lightbox.map"],"mappings":"A,0KAQG,SAAgBc,EAAS,CAAC,UAAQ,SAAO,QAAM,YAAU,CAAC,GAAK,CAACC,EAAOC,GAAWhB,EAAS,EAAK,EAAQiB,EAAShB,EAAO,IAAI,EAAQiB,EAAIjB,EAAO,IAAI,EAAQkB,EAASlB,EAAO,IAAI,EAAQmB,EAAOnB,EAAO,IAAI,EAAEM,MAAc,CAAC,IAAMc,EAAU,SAAS,cAAoBC,EAAa,SAAS,KAAK,MAAM,SAAS,SAAS,KAAK,MAAM,SAAS,SAASH,EAAS,SAAS,MAAM,CAAC,cAAc,EAAI,CAAC,EAAE,IAAMI,EAAM,GAAG,CAAIC,EAAE,MAAM,WAAUA,EAAE,gBAAgB,EAAEC,EAAQ,EAAG,EAAgD,OAA9CZ,EAAO,iBAAiB,UAAUU,EAAM,EAAI,MAAY,CAACV,EAAO,oBAAoB,UAAUU,EAAM,EAAI,EAAE,SAAS,KAAK,MAAM,SAASD,EAAa,GAAG,CAACD,GAAW,MAAM,CAAC,cAAc,EAAI,CAAC,CAAE,MAAS,CAAC,CAAC,CACxpB,EAAE,CAAC,CAAC,EACJlB,MAAoB,CAAC,IAAMuB,EAAEN,EAAO,QAAcO,EAAGV,EAAS,QAAcW,EAAEV,EAAI,QAAQ,GAAG,CAACQ,GAAG,CAACC,GAAI,CAACC,EAAE,OAAO,EAAO,QAAQ,KAAK,IAAM,EAAEA,EAAE,sBAAsB,EAAE,EAAG,Y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