{"version":3,"file":"CMSLinkedImage.DNXKvNkC.mjs","names":["React.useMemo"],"sources":["https:/framerusercontent.com/modules/wTYAHTxKDLWws2VTolMF/Aib7ubdVS3jQhngPd0jG/CMSLinkedImage.js"],"sourcesContent":["// Instructions: Créé un composant image compatible avec l'intégration sous forme de lien dans un CMS\nimport{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerIntrinsicWidth 320\n * @framerIntrinsicHeight 200\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function CMSLinkedImage(props){const{image={src:\"https://framerusercontent.com/images/f9RiWoNpmlCMqVRIHz8l8wYfeI.jpg\",alt:\"Linked image\"},imageUrl,link,openInNewTab,rel,ariaLabel,fit,backgroundColor,borderRadius,border,style}=props;const target=openInNewTab?\"_blank\":undefined;const computedRel=React.useMemo(()=>{if(!openInNewTab&&rel===\"auto\")return undefined;if(rel===\"auto\")return\"noopener noreferrer\";return rel;},[openInNewTab,rel]);const normalizedImage=React.useMemo(()=>{const anyImage=image;const srcFromProp=typeof anyImage===\"string\"?anyImage:anyImage?.src??anyImage?.url;const src=(imageUrl?.trim()||srcFromProp||\"\").trim();const srcSet=typeof anyImage===\"object\"?anyImage?.srcSet:undefined;const alt=typeof anyImage===\"object\"?anyImage?.alt:undefined;return{src,srcSet,alt};},[image,imageUrl]);const imgAlt=normalizedImage.alt??\"\";const label=ariaLabel?.trim()?ariaLabel.trim():imgAlt?.trim()?imgAlt.trim():\"Image\";const containerStyle={position:\"relative\",width:\"100%\",height:\"100%\",overflow:\"hidden\",borderRadius,backgroundColor,...border??{},...style??{}};const imgStyle={display:\"block\",width:\"100%\",height:\"100%\",objectFit:fit,userSelect:\"none\",WebkitUserSelect:\"none\"};const content=/*#__PURE__*/_jsx(\"img\",{src:normalizedImage.src,srcSet:normalizedImage.srcSet,alt:imgAlt,style:imgStyle,draggable:false,loading:\"lazy\"});const href=link?.trim();if(!href){return /*#__PURE__*/_jsx(\"div\",{style:containerStyle,children:content});}return /*#__PURE__*/_jsx(\"a\",{href:href,target:target,rel:computedRel,\"aria-label\":label,style:{...containerStyle,display:\"block\",textDecoration:\"none\",color:\"inherit\"},children:content});}addPropertyControls(CMSLinkedImage,{image:{type:ControlType.ResponsiveImage,title:\"Image\"},imageUrl:{type:ControlType.Link,title:\"Image URL (CMS)\",defaultValue:\"\"},link:{type:ControlType.Link,title:\"Lien\",defaultValue:\"\"},openInNewTab:{type:ControlType.Boolean,title:\"Nouvel onglet\",defaultValue:false},rel:{type:ControlType.Enum,title:\"Rel\",options:[\"auto\",\"noopener\",\"noreferrer\",\"nofollow\",\"noopener noreferrer\"],optionTitles:[\"Auto\",\"noopener\",\"noreferrer\",\"nofollow\",\"noopener noreferrer\"],defaultValue:\"auto\"},ariaLabel:{type:ControlType.String,title:\"ARIA label\",defaultValue:\"\",placeholder:\"Optionnel (sinon alt de l’image)\"},fit:{type:ControlType.Enum,title:\"Fit\",options:[\"cover\",\"contain\",\"fill\",\"none\",\"scale-down\"],optionTitles:[\"Cover\",\"Contain\",\"Fill\",\"None\",\"Scale-down\"],defaultValue:\"cover\",displaySegmentedControl:true},backgroundColor:{type:ControlType.Color,title:\"Fond\",defaultValue:\"#FFFFFF\"},borderRadius:{type:ControlType.BorderRadius,title:\"Rayon\",defaultValue:\"12px\"},border:{type:ControlType.Border,title:\"Bordure\",optional:true}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CMSLinkedImage\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerIntrinsicWidth\":\"320\",\"framerContractVersion\":\"1\",\"framerIntrinsicHeight\":\"200\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CMSLinkedImage.map"],"mappings":"0KAOG,SAAwB,EAAe,EAAM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