{"version":3,"file":"CMSLinkedImage.DOCyMHLz.mjs","names":["React.useMemo","__esmMin","pe","init_npm_react_18_3_1","c","init_jsx_runtime","addPropertyControls","init_framer_DymZktPS","ControlType","CMSLinkedImage","props","target","openInNewTab","computedRel","rel","normalizedImage","anyImage","image","srcFromProp","imageUrl","imgAlt","label","ariaLabel","containerStyle","border","style","imgStyle","fit","content","href","link","init_CMSLinkedImage"],"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":"A,0KAOG,SAAwBS,EAAe,EAAM,CAAC,GAAK,CAAC,QAAM,CAAC,IAAI,sEAAsE,IAAI,cAAc,EAAE,WAAS,OAAK,eAAa,MAAI,YAAU,MAAI,kBAAgB,eAAa,SAAO,SAAOC,EAAYC,EAAOC,EAAa,SAAS,IAAA,GAAgBC,EAAYb,MAAkB,CAAC,GAAIY,GAAcE,IAAM,OAAoE,OAAzCA,IAAM,OAAa,sBAA6BA,CAAI,EAAE,CAACF,EAAaE,CAAG,CAAC,EAAQC,EAAgBf,MAAkB,CAAC,IAAMgB,EAASC,EAAYC,EAAY,OAAOF,GAAW,SAASA,EAASA,GAAU,KAAKA,GAAU,IAAyL,MAAM,CAAC,KAAjLG,GAAU,KAAK,GAAGD,GAAa,GAAA,CAAI,KAAgJ,EAAE,OAA9H,OAAOF,GAAW,SAASA,GAAU,OAAO,IAAA,GAAyF,IAArE,OAAOA,GAAW,SAASA,GAAU,IAAI,IAAA,EAA+B,CAAE,EAAE,CAACC,EAAME,CAAQ,CAAC,EAAQC,EAAOL,EAAgB,KAAK,GAASM,EAAMC,GAAW,KAAK,EAAEA,EAAU,KAAK,EAAEF,GAAQ,KAAK,EAAEA,EAAO,KAAK,EAAE,QAAcG,EAAe,CAAC,SAAS,WAAW,MAAM,OAAO,OAAO,OAAO,SAAS,SAAS,eAAa,kBAAgB,GAAGC,GAAQ,CAAC,EAAE,GAAGC,GAAO,CAAC,CAAC,EAAQC,EAAS,CAAC,QAAQ,QAAQ,MAAM,OAAO,OAAO,OAAO,UAAUC,EAAI,WAAW,OAAO,iBAAiB,MAAM,EAAQC,EAAqB,gBAAK,MAAM,CAAC,IAAIb,EAAgB,IAAI,OAAOA,EAAgB,OAAO,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