{"version":3,"file":"ProjectMediaSlot.k0Fvn0Iu.mjs","names":["React.forwardRef","useState","useMemo","useCallback","_Fragment","__esmMin","pe","init_npm_react_18_3_1","ne","init_ssg_sandbox_shims","window","te","l","_e","c","J","init_jsx_runtime","ce","motion","cx","init_framer_DxfB3JJo","RenderTarget","addPropertyControls","useSVGTemplate","withCSS","useIsStaticRenderer","ControlType","mask","Base","MotionSVG","SVG","svg","getProps","Icon","init_MxyYM8hHl","props","rest","animated","width1","color","restProps","href","className","P_DcoRcrY","JEeZYcamG","style","getInstagramUrls","value","input","match","rawType","shortcode","permalink","ProjectMediaSlot","isStaticRenderer","isLightboxOpen","setIsLightboxOpen","instagramData","instagramUrl","hasInstagram","hasImage","image","hasMedia","canvasLike","resolvedAspectRatio","aspectRatio","handleImageOpen","handleImageClose","onKeyDown","event","slotStyle","radius","fit","overlayColor","init_ProjectMediaSlot"],"sources":["https:/framerusercontent.com/modules/lF4UJOXPkJM9iqylBdRs/XiABZpqsUN1LZlfD4flx/MxyYM8hHl.js","https:/framerusercontent.com/modules/sSDevOIn7utcndLt8F5J/kAoM8xHQFOhgn4RDMKvK/ProjectMediaSlot.js"],"sourcesContent":["// Generated by Framer (85eaff3)\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,cx,motion,useSVGTemplate,withCSS}from\"framer\";import*as React from\"react\";import{forwardRef}from\"react\";const mask=\"var(--framer-icon-mask)\";const Base=/*#__PURE__*/forwardRef(function(props,ref){return /*#__PURE__*/_jsx(\"svg\",{...props,ref:ref,children:props.children});});const MotionSVG=motion.create(Base);const SVG=/*#__PURE__*/forwardRef((props,ref)=>{const{animated,layoutId,children,...rest}=props;return animated?/*#__PURE__*/_jsx(MotionSVG,{...rest,layoutId:layoutId,ref:ref,children:children}):/*#__PURE__*/_jsx(\"svg\",{...rest,ref:ref,children:children});});const svg='<svg display=\"block\" role=\"presentation\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M 0 2.001 C 0 1.284 0.383 0.623 1.004 0.266 C 1.625 -0.091 2.389 -0.088 3.008 0.273 L 15.005 7.271 C 15.621 7.628 16.001 8.286 16.001 8.999 C 16.002 9.711 15.624 10.37 15.008 10.729 L 3.008 17.729 C 2.389 18.09 1.625 18.092 1.004 17.735 C 0.383 17.379 0 16.717 0 16.001 Z\" fill=\"transparent\" height=\"18.001185518961545px\" id=\"hd_IIrmdu\" stroke-dasharray=\"\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"var(--js9iwy, 2)\" stroke=\"var(--1m973uw, rgb(0,0,0))\" transform=\"translate(5 2.999)\" width=\"16.001235864215374px\"/></svg>';const getProps=({color,height,id,width,width1,...props})=>{return{...props,JEeZYcamG:width1??props.JEeZYcamG??2,P_DcoRcrY:color??props.P_DcoRcrY??\"rgb(0, 0, 0)\"};};const Component=/*#__PURE__*/React.forwardRef(function(props,ref){const{style,className,layoutId,variant,P_DcoRcrY,JEeZYcamG,...restProps}=getProps(props);const href=useSVGTemplate(\"408949868\",svg);return /*#__PURE__*/_jsx(SVG,{...restProps,className:cx(\"framer-cp93Q\",className),layoutId:layoutId,ref:ref,role:\"presentation\",style:{\"--1m973uw\":P_DcoRcrY,\"--js9iwy\":JEeZYcamG,...style},viewBox:\"0 0 24 24\",children:/*#__PURE__*/_jsx(\"use\",{href:href})});});const css=[`.framer-cp93Q { -webkit-mask: ${mask}; aspect-ratio: 1; display: block; mask: ${mask}; width: 24px; }`];/**\n * This is a generated Framer component.\n * @framerIntrinsicWidth 24\n * @framerIntrinsicHeight 24\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n * @framerVariables {\"P_DcoRcrY\":\"color\",\"JEeZYcamG\":\"width1\"}\n * @framerImmutableVariables true\n * @framerVector {\"name\":\"Play\",\"color\":{\"type\":\"variable\",\"value\":\"1m973uw\"},\"set\":{\"localId\":\"vectorSet/ZsiCCGPvG\",\"id\":\"ZsiCCGPvG\",\"moduleId\":\"Y7SpbVH16cWqMhj75z1M\"}}\n */const Icon=withCSS(Component,css,\"framer-cp93Q\");Icon.displayName=\"Play\";export default Icon;addPropertyControls(Icon,{P_DcoRcrY:{defaultValue:\"rgb(0, 0, 0)\",hidden:false,title:\"Color\",type:ControlType.Color},JEeZYcamG:{defaultValue:2,displayStepper:true,hidden:false,max:16,min:1,title:\"Width\",type:ControlType.Number}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Icon\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerImmutableVariables\":\"true\",\"framerContractVersion\":\"1\",\"framerVector\":\"{\\\"name\\\":\\\"Play\\\",\\\"color\\\":{\\\"type\\\":\\\"variable\\\",\\\"value\\\":\\\"1m973uw\\\"},\\\"set\\\":{\\\"localId\\\":\\\"vectorSet/ZsiCCGPvG\\\",\\\"id\\\":\\\"ZsiCCGPvG\\\",\\\"moduleId\\\":\\\"Y7SpbVH16cWqMhj75z1M\\\"}}\",\"framerVariables\":\"{\\\"P_DcoRcrY\\\":\\\"color\\\",\\\"JEeZYcamG\\\":\\\"width1\\\"}\",\"framerIntrinsicWidth\":\"24\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerIntrinsicHeight\":\"24\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}","import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,RenderTarget,useIsStaticRenderer}from\"framer\";import{startTransition,useCallback,useEffect,useMemo,useState}from\"react\";function getInstagramUrls(input){const value=input.trim();if(!value)return null;const match=value.match(/(?:https?:\\/\\/)?(?:www\\.)?instagram\\.com\\/(p|reel|reels|tv)\\/([a-zA-Z0-9_-]+)(?:\\/|\\?|#|$)/i);if(!match)return null;const rawType=match[1].toLowerCase();const shortcode=match[2];const type=rawType===\"reels\"?\"reel\":rawType;const permalink=`https://www.instagram.com/${type}/${shortcode}/`;return{permalink,embed:`${permalink}embed`};}/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function ProjectMediaSlot(props){const{image,instagramUrl=\"\",aspectRatio=1.2,radius=\"20px\",backgroundColor=\"#111111\",overlayColor=\"rgba(0,0,0,0.92)\",fit=\"cover\",style}=props;const isStaticRenderer=useIsStaticRenderer();const[isLightboxOpen,setIsLightboxOpen]=useState(false);const instagramData=useMemo(()=>getInstagramUrls(instagramUrl),[instagramUrl]);const hasInstagram=Boolean(instagramData);const hasImage=Boolean(image?.src);const hasMedia=hasInstagram||hasImage;const canvasLike=RenderTarget.current()===RenderTarget.canvas||RenderTarget.current()===RenderTarget.export||RenderTarget.current()===RenderTarget.thumbnail;const resolvedAspectRatio=useMemo(()=>{if(!Number.isFinite(aspectRatio)||aspectRatio<=0)return 1.2;return aspectRatio;},[aspectRatio]);const handleImageOpen=useCallback(()=>{if(!hasImage||hasInstagram)return;startTransition(()=>setIsLightboxOpen(true));},[hasImage,hasInstagram]);const handleImageClose=useCallback(()=>{startTransition(()=>setIsLightboxOpen(false));},[]);useEffect(()=>{if(!isLightboxOpen)return;if(typeof window===\"undefined\"||typeof document===\"undefined\")return;const onKeyDown=event=>{if(event.key===\"Escape\"){startTransition(()=>setIsLightboxOpen(false));}};window.addEventListener(\"keydown\",onKeyDown);return()=>{window.removeEventListener(\"keydown\",onKeyDown);};},[isLightboxOpen]);if(!hasMedia&&!canvasLike&&!isStaticRenderer)return null;const slotStyle={position:\"relative\",width:\"100%\",height:\"100%\",minHeight:0,borderRadius:radius,overflow:\"hidden\",backgroundColor,...style??{}};if(style?.height===undefined||style?.height===\"auto\"){slotStyle.aspectRatio=`${hasInstagram?.72:resolvedAspectRatio}`;if(style?.height===undefined)slotStyle.height=\"auto\";}return /*#__PURE__*/_jsx(\"div\",{style:slotStyle,children:hasInstagram&&instagramData?/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",inset:0,overflow:\"hidden\",display:\"flex\",justifyContent:\"center\",alignItems:\"center\",backgroundColor},children:/*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",width:\"100%\",maxWidth:540,height:\"100%\",overflow:\"hidden\",borderRadius:radius,backgroundColor},children:/*#__PURE__*/_jsx(\"iframe\",{src:instagramData.embed,title:\"Instagram embed\",loading:\"lazy\",style:{width:\"100%\",height:\"100%\",border:\"0\",display:\"block\",backgroundColor}})})}):hasImage?/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"img\",{src:image?.src,srcSet:image?.srcSet,alt:image?.alt??\"\",onClick:handleImageOpen,style:{width:\"100%\",height:\"100%\",display:\"block\",objectFit:fit,objectPosition:\"center center\",cursor:\"pointer\",backgroundColor}}),isLightboxOpen?/*#__PURE__*/_jsx(\"div\",{role:\"dialog\",\"aria-modal\":\"true\",\"aria-label\":\"Image lightbox\",onClick:handleImageClose,style:{position:\"fixed\",inset:0,zIndex:9999,backgroundColor:overlayColor,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",padding:24},children:/*#__PURE__*/_jsx(\"img\",{src:image?.src,srcSet:image?.srcSet,alt:image?.alt??\"\",onClick:event=>event.stopPropagation(),style:{width:\"100%\",height:\"100%\",maxWidth:\"100%\",maxHeight:\"100%\",objectFit:\"contain\",objectPosition:\"center center\",display:\"block\",userSelect:\"none\"}})}):null]}):/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",inset:0,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",color:\"rgba(255,255,255,0.25)\",fontSize:12,letterSpacing:\"-0.01em\",backgroundColor},children:canvasLike||isStaticRenderer?\"Bind image or Instagram URL\":\"\"})});}addPropertyControls(ProjectMediaSlot,{image:{type:ControlType.ResponsiveImage,title:\"Image\"},instagramUrl:{type:ControlType.String,title:\"Instagram URL\",defaultValue:\"\",placeholder:\"https://www.instagram.com/p/...\"},aspectRatio:{type:ControlType.Number,title:\"Aspect Ratio\",defaultValue:1.2,min:.2,max:3,step:.01},radius:{type:ControlType.BorderRadius,title:\"Radius\",defaultValue:\"20px\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#111111\"},overlayColor:{type:ControlType.Color,title:\"Overlay\",defaultValue:\"rgba(0,0,0,0.92)\"},fit:{type:ControlType.Enum,title:\"Fit\",options:[\"cover\",\"contain\"],optionTitles:[\"Cover\",\"Contain\"],defaultValue:\"cover\",displaySegmentedControl:true}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ProjectMediaSlot\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ProjectMediaSlot.map"],"mappings":"A,iXACgM,EAAK,0BAAgC,EAAkB,gBAAW,SAAS,EAAM,EAAI,CAAC,MAAoB,gBAAK,MAAM,CAAC,GAAGmC,EAAU,MAAI,SAASA,EAAM,QAAQ,CAAC,CAAE,CAAC,EAAQ,EAAUjB,EAAO,OAAOU,CAAI,EAAQ,EAAiB,iBAAY,EAAM,IAAM,CAAC,GAAK,CAAC,WAAS,WAAS,WAAS,GAAGQ,GAAMD,EAAM,OAAOE,EAAsB,gBAAKR,EAAU,CAAC,GAAGO,EAAc,WAAa,MAAa,UAAQ,CAAC,EAAe,gBAAK,MAAM,CAAC,GAAGA,EAAS,MAAa,UAAQ,CAAC,CAAE,CAAC,EAAQ,EAAI,uoBAA6oB,GAAU,CAAC,QAAM,SAAO,KAAG,QAAM,SAAO,GAAGD,MAAgB,CAAC,GAAGA,EAAM,UAAUG,GAAQH,EAAM,WAAW,EAAE,UAAUI,GAAOJ,EAAM,WAAW,cAAc,GASn7C,EAAKX,EAT+8CxB,kBAAiB,SAAS,EAAM,EAAI,CAAC,GAAK,CAAC,QAAM,YAAU,WAAS,UAAQ,YAAU,YAAU,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