{"version":3,"file":"Image_with_URL.CDIf2l2T.mjs","names":[],"sources":["https:/framerusercontent.com/modules/HCwU2SJR0c7zIklTppSs/nn76GlFttLPc7Xh9JCK4/Image_with_URL.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";export default function ImageComponent(props){const{src,alt,width,height,objectFit,borderRadius,opacity,style,cdnWidth}=props;const isSupportedFormat=url=>{if(!url)return false;const urlPath=url.split(\"?\")[0].split(\"#\")[0];const extension=urlPath.split(\".\").pop()?.toLowerCase();const supportedFormats=[\"jpg\",\"jpeg\",\"png\",\"gif\",\"webp\",\"svg\",\"heic\"];return supportedFormats.includes(extension);};const processedSrc=(()=>{if(!src)return src;if(src.includes(\"/cdn-cgi/image\")){return src;}if(!isSupportedFormat(src)){return src;}return`https://images.foxy.ai/cdn-cgi/image/quality=85,width=${cdnWidth}/${src}`;})();return /*#__PURE__*/_jsx(\"img\",{src:processedSrc,alt:alt,style:{...style,width:width===\"auto\"?\"auto\":\"100%\",height:height===\"auto\"?\"auto\":\"100%\",objectFit:objectFit,borderRadius:`${borderRadius}px`,opacity:opacity,display:\"block\"}});}ImageComponent.defaultProps={src:\"\",alt:\"Image\",width:\"100%\",height:\"100%\",objectFit:\"cover\",borderRadius:0,opacity:1,cdnWidth:512};addPropertyControls(ImageComponent,{src:{type:ControlType.String,title:\"Image URL\",defaultValue:\"\",placeholder:\"Enter image URL\"},alt:{type:ControlType.String,title:\"Alt Text\",defaultValue:\"Image\",placeholder:\"Describe the image\"},cdnWidth:{type:ControlType.Enum,title:\"CDN Width\",options:[24,80,128,256,512,720,1080],optionTitles:[\"24px\",\"80px\",\"128px\",\"256px\",\"512px\",\"720px\",\"1080px\"],defaultValue:512},width:{type:ControlType.Enum,title:\"Width\",options:[\"100%\",\"auto\"],optionTitles:[\"Full Width\",\"Auto\"],defaultValue:\"100%\"},height:{type:ControlType.Enum,title:\"Height\",options:[\"100%\",\"auto\"],optionTitles:[\"Full Height\",\"Auto\"],defaultValue:\"100%\"},objectFit:{type:ControlType.Enum,title:\"Object Fit\",options:[\"cover\",\"contain\",\"fill\",\"none\",\"scale-down\"],optionTitles:[\"Cover\",\"Contain\",\"Fill\",\"None\",\"Scale Down\"],defaultValue:\"cover\"},borderRadius:{type:ControlType.Number,title:\"Border Radius\",defaultValue:0,min:0,max:100,step:1,unit:\"px\"},opacity:{type:ControlType.Number,title:\"Opacity\",defaultValue:1,min:0,max:1,step:.1}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ImageComponent\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Image_with_URL.map"],"mappings":"4JAA+F,SAAwB,EAAe,EAAM,CAAC,GAAK,CAAC,MAAI,MAAI,QAAM,SAAO,YAAU,eAAa,UAAQ,QAAM,YAAU,EAAY,EAAkB,GAAK,CAAC,GAAG,CAAC,EAAI,MAAO,GAAoD,IAAM,EAAtC,EAAI,MAAM,IAAI,CAAC,GAAG,MAAM,IAAI,CAAC,GAA2B,MAAM,IAAI,CAAC,KAAK,EAAE,aAAa,CAAuE,MAA/C,CAAC,MAAM,OAAO,MAAM,MAAM,OAAO,MAAM,OAAO,CAAyB,SAAS,EAAU,EAA4N,OAAoB,EAAK,MAAM,CAAC,SAA7N,CAAC,GAAkB,EAAI,SAAS,iBAAiB,EAAiB,CAAC,EAAkB,EAAI,CAAS,EAAW,yDAAyD,EAAS,GAAG,MAAU,CAAsD,MAAI,MAAM,CAAC,GAAG,EAAM,MAAM,IAAQ,OAAO,OAAO,OAAO,OAAO,IAAS,OAAO,OAAO,OAAiB,YAAU,aAAa,GAAG,EAAa,IAAY,UAAQ,QAAQ,QAAQ,CAAC,CAAC,kBAAh4B,IAAoD,CAA80B,EAAe,aAAa,CAAC,IAAI,GAAG,IAAI,QAAQ,MAAM,OAAO,OAAO,OAAO,UAAU,QAAQ,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