{"version":3,"file":"Image_Component.CsPvstlF.mjs","names":["React.useMemo"],"sources":["https:/framerusercontent.com/modules/VHY8N4JV6CQeZZGncXnp/tOLDpXi3MchK7iTuaG7v/Image_Component.js"],"sourcesContent":["// A Framer Code Component that behaves like the built‑in Video (URL) component—but for images.\n// Drop this into your Framer project (Code → New File), then add it from the Insert panel.\n// It respects parent size, layout, constraints, and border radius.\nimport{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";export default function ExternalImage(props){const{src,alt,fit,positionX,positionY,referrerPolicy,decoding,loading,autoFormat,widthHint,heightHint,cornerRadius}=props;// Build a Bunny-friendly URL with optional format/size hints (non-breaking if not supported)\nconst url=React.useMemo(()=>{if(!src)return\"\";try{const u=new URL(src);const params=u.searchParams;if(autoFormat)params.set(\"format\",\"auto\");if(widthHint>0)params.set(\"width\",String(Math.round(widthHint)));if(heightHint>0)params.set(\"height\",String(Math.round(heightHint)));u.search=params.toString();return u.toString();}catch{// If src isn't a valid absolute URL, just pass it through\nreturn src;}},[src,autoFormat,widthHint,heightHint]);// Wrap in a container that inherits border radius from the Framer layer\n// and prevents overflow, so it obeys parent borders/rounding.\nreturn /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",overflow:\"hidden\",borderRadius:cornerRadius>=0?`${Math.round(cornerRadius)}px`:\"inherit\",// Ensure it participates nicely in stacks/auto layout\ndisplay:\"block\"},children:url?/*#__PURE__*/_jsx(\"img\",{src:url,alt:alt,referrerPolicy:referrerPolicy,decoding:decoding,loading:loading,style:{width:\"100%\",height:\"100%\",objectFit:fit,objectPosition:`${positionX}% ${positionY}%`,display:\"block\"}}):/*#__PURE__*/_jsx(Placeholder,{})});}function Placeholder(){return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",display:\"grid\",placeItems:\"center\",borderRadius:\"inherit\",background:\"rgba(0,0,0,0.04)\",fontSize:12,color:\"rgba(0,0,0,0.5)\"},children:\"Paste an image URL in the right panel →\"});}ExternalImage.defaultProps={src:\"https://fifthdimension.b-cdn.net/Static/7o3w2jfra3ZXxx2DPHVLCxb8gnA.jpg\",alt:\"\",fit:\"cover\",positionX:50,positionY:50,referrerPolicy:\"no-referrer\",decoding:\"async\",loading:\"lazy\",autoFormat:true,widthHint:0,heightHint:0,cornerRadius:-1};addPropertyControls(ExternalImage,{src:{type:ControlType.String,title:\"Image URL\",placeholder:\"https://…\"},alt:{type:ControlType.String,title:\"Alt text\",placeholder:\"\"},fit:{type:ControlType.Enum,title:\"Fit\",options:[\"cover\",\"contain\",\"fill\",\"scale-down\",\"none\"],optionTitles:[\"Cover\",\"Contain\",\"Fill\",\"Scale‑down\",\"None\"]},positionX:{type:ControlType.Number,title:\"Focus X\",min:0,max:100,displayStepper:true},positionY:{type:ControlType.Number,title:\"Focus Y\",min:0,max:100,displayStepper:true},autoFormat:{type:ControlType.Boolean,title:\"Auto format\",enabledTitle:\"On\",disabledTitle:\"Off\"},widthHint:{type:ControlType.Number,title:\"Width hint\",min:0,max:4096,displayStepper:true},heightHint:{type:ControlType.Number,title:\"Height hint\",min:0,max:4096,displayStepper:true},cornerRadius:{type:ControlType.Number,title:\"Radius\",min:-1,max:96,displayStepper:true},referrerPolicy:{type:ControlType.Enum,title:\"Referrer\",options:[\"no-referrer\",\"strict-origin-when-cross-origin\",\"origin-when-cross-origin\",\"no-referrer-when-downgrade\",\"same-origin\",\"origin\",\"unsafe-url\"],optionTitles:[\"No referrer\",\"Strict origin\",\"Origin when cross\",\"No downgrade\",\"Same origin\",\"Origin\",\"Unsafe URL\"]},decoding:{type:ControlType.Enum,title:\"Decoding\",options:[\"auto\",\"async\",\"sync\"],optionTitles:[\"Auto\",\"Async\",\"Sync\"]},loading:{type:ControlType.Enum,title:\"Loading\",options:[\"lazy\",\"eager\"],optionTitles:[\"Lazy\",\"Eager\"]}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ExternalImage\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