{"version":3,"file":"ImageDisplay.DWmWDFx3.mjs","names":["useMemo","useState"],"sources":["https:/framerusercontent.com/modules/w4S7nBgmdDSpDaU1uoC1/FdMY77O86sxwAp6vTY22/ImageDisplay.js"],"sourcesContent":["// Component that takes an image URL as input and displays the image\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useState,useMemo,useEffect}from\"react\";/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function ImageDisplay(props){const{imageUrl=\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt=\"Image\",objectFit=\"cover\",borderRadius=0,loadingColor=\"#F5F5F5\",thumbnailMode=false}=props;// Generate optimized URLs\nconst optimizedImageUrl=useMemo(()=>{if(!thumbnailMode){return imageUrl;}// For Framer images, optimize for web\nif(imageUrl.includes(\"framerusercontent.com\")){const url=new URL(imageUrl);url.searchParams.set(\"format\",\"webp\");url.searchParams.set(\"quality\",\"85\");url.searchParams.set(\"width\",\"800\");return url.toString();}return imageUrl;},[imageUrl,thumbnailMode]);const[isLoaded,setIsLoaded]=useState(false);const[hasError,setHasError]=useState(false);// Reset states when URL changes\nuseEffect(()=>{setIsLoaded(false);setHasError(false);},[optimizedImageUrl]);return /*#__PURE__*/_jsxs(\"div\",{style:{width:\"100%\",height:\"100%\",position:\"relative\",overflow:\"hidden\",borderRadius:`${borderRadius}px`,backgroundColor:!isLoaded&&!hasError?loadingColor:\"transparent\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\"},children:[!hasError&&/*#__PURE__*/_jsx(\"img\",{src:optimizedImageUrl,alt:alt,style:{width:\"100%\",height:\"100%\",objectFit:objectFit,display:\"block\"},loading:\"eager\",decoding:\"async\",draggable:\"false\",onLoad:()=>setIsLoaded(true),onError:()=>setHasError(true)}),hasError&&/*#__PURE__*/_jsx(\"div\",{style:{color:\"#999\",fontSize:\"14px\",textAlign:\"center\",padding:\"20px\"},children:\"Failed to load image\"})]});}addPropertyControls(ImageDisplay,{imageUrl:{type:ControlType.String,title:\"Image URL\",defaultValue:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",placeholder:\"Enter image URL...\"},alt:{type:ControlType.String,title:\"Alt Text\",defaultValue:\"Image\",placeholder:\"Describe the image...\"},objectFit:{type:ControlType.Enum,title:\"Object Fit\",options:[\"cover\",\"contain\",\"fill\",\"scale-down\",\"none\"],optionTitles:[\"Cover\",\"Contain\",\"Fill\",\"Scale Down\",\"None\"],defaultValue:\"cover\"},borderRadius:{type:ControlType.Number,title:\"Border Radius\",defaultValue:0,min:0,max:50,step:1,unit:\"px\"},loadingColor:{type:ControlType.Color,title:\"Loading Color\",defaultValue:\"#F5F5F5\"},thumbnailMode:{type:ControlType.Boolean,title:\"Thumbnail Mode\",defaultValue:false,enabledTitle:\"Compressed\",disabledTitle:\"Full Quality\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ImageDisplay\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ImageDisplay.map"],"mappings":"+LAIG,SAAwB,EAAa,EAAM,CAAC,GAAK,CAAC,WAAS,sEAAsE,MAAI,QAAQ,YAAU,QAAQ,eAAa,EAAE,eAAa,UAAU,gBAAc,IAAO,EACvN,EAAkBA,MAAY,CAAC,GAAG,CAAC,EAAe,OAAO,EAC/D,GAAG,EAAS,SAAS,wBAAwB,CAAC,CAAC,IAAM,EAAI,IAAI,IAAI,EAAS,CAAgH,OAA/G,EAAI,aAAa,IAAI,SAAS,OAAO,CAAC,EAAI,aAAa,IAAI,UAAU,KAAK,CAAC,EAAI,aAAa,IAAI,QAAQ,MAAM,CAAQ,EAAI,UAAU,CAAE,OAAO,GAAW,CAAC,EA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