{"version":3,"file":"ProjectMedia.aVGFu81d.mjs","names":["React.useState","_Fragment","React.useRef","__esmMin","init_npm_react_18_3_1","l","_e","p","c","init_jsx_runtime","de","init_framer_BisrWwwE","addPropertyControls","ControlType","MobileFullscreenButton","error","setError","openFullscreen","event","video","getVideo","ProjectMedia","videoRef","dimensions","intrinsicWidth","intrinsicHeight","style","mediaType","alt","image","init_ProjectMedia"],"sources":["https:/framerusercontent.com/modules/ELCl3WZa6wWCZEUpGOGr/H34KIgUqs7mbVWS3i3ry/ProjectMedia.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";function MobileFullscreenButton({getVideo}){const[error,setError]=React.useState(\"\");async function openFullscreen(event){event.preventDefault();event.stopPropagation();const video=getVideo();if(!video)return;setError(\"\");try{if(video.webkitEnterFullscreen)video.webkitEnterFullscreen();else if(video.requestFullscreen)await video.requestFullscreen();else setError(\"Fullscreen is unavailable in this browser.\");}catch{setError(\"Couldn't open fullscreen. Try the video controls.\");}}return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"style\",{dangerouslySetInnerHTML:{__html:`\n            .portfolio-video-fullscreen { display: none; }\n            @media (max-width: 809px) {\n                .portfolio-video-fullscreen { display: inline-flex; position: absolute; bottom: 12px; right: 12px; z-index: 2; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--token-57a586da-b9ae-4960-8a91-0dc986b31e8a, rgba(255,255,255,.5)); border-radius: 8px; background: var(--token-d518763b-793f-4153-817a-a8818d658658, rgba(0,0,0,.78)); color: var(--token-cf3ca2bc-b423-418e-b27e-42af75e55d74, #FFFFFF); font: 500 14px/1.2 Inter, sans-serif; cursor: pointer; touch-action: manipulation; }\n                .portfolio-video-fullscreen:focus-visible { outline: 2px solid var(--token-b1717e17-18d5-4be8-98c5-5e46561b539f, #fff); outline-offset: 3px; }\n            }\n        `}}),/*#__PURE__*/_jsx(\"button\",{type:\"button\",className:\"portfolio-video-fullscreen\",\"aria-label\":\"Open video in fullscreen\",onClick:openFullscreen,children:/*#__PURE__*/_jsx(\"svg\",{width:\"16\",height:\"16\",viewBox:\"0 0 24 24\",fill:\"none\",stroke:\"currentColor\",strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\",\"aria-hidden\":\"true\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M8 3H3v5M16 3h5v5M21 16v5h-5M8 21H3v-5\"})})}),error&&/*#__PURE__*/_jsx(\"span\",{role:\"status\",style:{position:\"absolute\",top:62,right:12,left:12,zIndex:2,padding:8,borderRadius:6,background:\"var(--token-64d421ee-4614-4971-b635-5409742fab33, rgba(0,0,0,.85))\",color:\"var(--token-cf3ca2bc-b423-418e-b27e-42af75e55d74, #FFFFFF)\",font:\"14px/1.4 Inter, sans-serif\"},children:error})]});}/**\n * @framerIntrinsicWidth 884\n * @framerIntrinsicHeight 500\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function ProjectMedia({mediaType=\"image\",image,video=\"\",alt=\"\",intrinsicWidth=0,intrinsicHeight=0,style}){const videoRef=React.useRef(null);const dimensions=intrinsicWidth>0&&intrinsicHeight>0?{width:intrinsicWidth,height:intrinsicHeight}:{};return /*#__PURE__*/_jsx(\"figure\",{style:{width:\"100%\",...style,height:\"auto\",minWidth:0,position:\"relative\",margin:0},children:mediaType.toLowerCase()===\"video\"?/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"video\",{ref:videoRef,src:video,autoPlay:true,loop:true,muted:true,controls:true,playsInline:true,preload:\"auto\",style:{display:\"block\",width:\"100%\",height:\"auto\"},\"aria-label\":alt||\"Project video\"}),/*#__PURE__*/_jsx(MobileFullscreenButton,{getVideo:()=>videoRef.current})]}):image?.src&&/*#__PURE__*/_jsx(\"img\",{src:image.src,srcSet:image.srcSet,alt:alt||image.alt||\"\",...dimensions,style:{display:\"block\",width:\"100%\",height:\"auto\"}})});}addPropertyControls(ProjectMedia,{mediaType:{type:ControlType.Enum,title:\"Type\",options:[\"image\",\"video\"],optionTitles:[\"Image\",\"Video\"],defaultValue:\"image\",displaySegmentedControl:true},image:{type:ControlType.ResponsiveImage,title:\"Image\",hidden:p=>p.mediaType===\"video\"},video:{type:ControlType.File,title:\"Video\",allowedFileTypes:[\"mp4\",\"webm\"],hidden:p=>p.mediaType!==\"video\"},alt:{type:ControlType.String,title:\"Alt text\",defaultValue:\"\"},intrinsicWidth:{type:ControlType.Number,title:\"Image width\",defaultValue:0,min:0,hidden:p=>p.mediaType===\"video\"},intrinsicHeight:{type:ControlType.Number,title:\"Image height\",defaultValue:0,min:0,hidden:p=>p.mediaType===\"video\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ProjectMedia\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerIntrinsicWidth\":\"884\",\"framerIntrinsicHeight\":\"500\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ProjectMedia.map"],"mappings":"A,+LAA+J,SAASc,EAAuB,CAAC,YAAU,CAAC,GAAK,CAACC,EAAMC,GAAUhB,EAAe,EAAE,EAAE,eAAeiB,EAAe,EAAM,CAACC,EAAM,eAAe,EAAEA,EAAM,gBAAgB,EAAE,IAAMC,EAAMC,EAAS,EAAE,GAAID,EAAa,GAAS,EAAE,EAAE,GAAG,CAAIA,EAAM,sBAAsBA,EAAM,sBAAsB,EAAUA,EAAM,kBAAkB,MAAMA,EAAM,kBAAkB,EAAOH,EAAS,4CAA4C,CAAE,MAAM,CAACA,EAAS,mDAAmD,CAAE,CAApQ,CAAqQ,CAAC,MAAoB,gBAAMf,EAAU,CAAC,SAAS,CAAc,gBAAK,QAAQ,CAAC,wBAAwB,CAAC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