{"version":3,"file":"FocalImage.ChrRTcfF.mjs","names":[],"sources":["https:/framerusercontent.com/modules/ettnc0HdJfFPfGG4yAmD/UWLvPdHuSPevxzHQrYnk/FocalImage.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";// Image or video that fills its frame and crops around a chosen focal point.\n// Bind Image and Focus to CMS fields so each project can set its own crop.\nconst POSITIONS={Center:\"50% 50%\",Top:\"50% 0%\",Bottom:\"50% 100%\",Left:\"0% 50%\",Right:\"100% 50%\",\"Top Left\":\"0% 0%\",\"Top Right\":\"100% 0%\",\"Bottom Left\":\"0% 100%\",\"Bottom Right\":\"100% 100%\"};/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function FocalImage({image,video,focus,focusX,focusY,zoom}){// A preset name (from the CMS dropdowns) wins; otherwise use the X/Y sliders.\nconst position=POSITIONS[focus]??`${focusX}% ${focusY}%`;const style={display:\"block\",width:\"100%\",height:\"100%\",objectFit:\"cover\",objectPosition:position,transform:zoom>1?`scale(${zoom})`:undefined,transformOrigin:position};// A video takes over the frame; the image becomes its poster while it loads.\nif(video){return /*#__PURE__*/_jsx(\"video\",{src:video,poster:image?.src,autoPlay:true,muted:true,loop:true,playsInline:true,preload:\"metadata\",style:style});}if(!image?.src)return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\"}});return /*#__PURE__*/_jsx(\"img\",{src:image.src,srcSet:image.srcSet,alt:image.alt??\"\",loading:\"lazy\",decoding:\"async\",style:style});}addPropertyControls(FocalImage,{image:{type:ControlType.ResponsiveImage,title:\"Image\"},video:{type:ControlType.File,title:\"Video\",allowedFileTypes:[\"mp4\",\"mov\",\"webm\"]},// Text so it can be bound to the CMS \"Focus\" dropdowns (Center, Top, Bottom, Left, Right, Top Left, ...).\nfocus:{type:ControlType.String,title:\"Preset\",defaultValue:\"\",placeholder:\"Center, Top, Bottom Left…\"},focusX:{type:ControlType.Number,title:\"Focus X\",defaultValue:50,min:0,max:100,step:1,unit:\"%\",displayStepper:true},focusY:{type:ControlType.Number,title:\"Focus Y\",defaultValue:50,min:0,max:100,step:1,unit:\"%\",displayStepper:true},zoom:{type:ControlType.Number,title:\"Zoom\",defaultValue:1,min:1,max:2,step:.05}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"FocalImage\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FocalImage.map"],"mappings":"4JAKG,SAAwB,EAAW,CAAC,QAAM,QAAM,QAAM,SAAO,SAAO,QAAM,CAC7E,IAAM,EAAS,EAAU,IAAQ,GAAG,EAAO,IAAI,EAAO,GAAS,EAAM,CAAC,QAAQ,QAAQ,MAAM,OAAO,OAAO,OAAO,UAAU,QAAQ,eAAe,EAAS,UAAU,EAAK,EAAE,SAAS,EAAK,GAAG,IAAA,GAAU,gBAAgB,CAAQ,EACmB,OAA/O,EAA2B,EAAK,QAAQ,CAAC,IAAI,EAAM,OAAO,GAAO,IAAI,SAAS,GAAK,MAAM,GAAK,KAAK,GAAK,YAAY,GAAK,QAAQ,WAAiB,OAAK,CAAC,EAAO,GAAO,IAA6F,EAAK,MAAM,CAAC,IAAI,EAAM,IAAI,OAAO,EAAM,OAAO,IAAI,EAAM,KAAK,GAAG,QAAQ,OAAO,SAAS,QAAc,OAAK,CAAC,EAAjL,EAAK,MAAM,CAAC,MAAM,CAAC,MAAM,OAAO,OAAO,MAAM,CAAC,CAAC,CAAoI,mBAP1U,IAAoD,EAExF,EAAU,CAAC,OAAO,UAAU,IAAI,SAAS,OAAO,WAAW,KAAK,SAAS,MAAM,WAAW,WAAW,QAAQ,YAAY,UAAU,cAAc,UAAU,eAAe,WAAW,EAK0L,EAAoB,EAAW,CAAC,MAAM,CAAC,KAA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