{"version":3,"file":"HoverImage.BUE4grAk.mjs","names":["useState","useRef"],"sources":["https:/framerusercontent.com/modules/hIdXS8AIOEAm2Eq31fh9/DIvpyUqYFmyr4RoX3Esr/HoverImage.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useEffect,useRef,useState}from\"react\";/**\n * alt fix 2026-10-10: Framer renders ONE DOM node per code instance and resolves the tablet/phone\n * REPLICA's control set; a replica-level override that holds a CMS binding resolves to \"\" at runtime,\n * and the plugin API cannot clear a replica override. 26 replicas carry such an \"Alt text\" override,\n * so `alt` arrives empty under 1200px. Fallback chain: `alt` -> `altFallback` (a second control that is\n * bound ONLY on the desktop primary, so every replica inherits the binding and it resolves) -> the first\n * heading / rich-text line of the enclosing CMS row, read from the DOM after mount (`altFromRow`).\n */function nearestRowText(el){let node=el;for(let i=0;node&&i<8;i++){node=node.parentElement;if(!node)break;const h=node.querySelector(\"h1,h2,h3,h4,h5,h6,p\");const t=h?.textContent?.replace(/\\s+/g,\" \").trim();if(t&&t.length>1&&t.length<160)return t;}return\"\";}/**\n * live-check 2026-10-08: ControlType.Image hands the component one full-size URL, so every plate\n * shipped at 2400x1600 (home page 6.8 MB). Framer's CDN resizes on demand with `scale-down-to`,\n * so build a srcset from the same URL. Non-Framer URLs pass through untouched.\n * live-check 2 2026-10-10: Framer composes the rendered `sizes` per breakpoint (\"(min-width: 1200px) <value>, ...\"),\n * so a value that is itself a media list becomes invalid and the browser fell back to 680px for every thumb\n * (200px rows loaded the 1024 variant). Keep `sizes` a single length: the default is 680px and the \"Sizes hint\"\n * control sets the rendered width per instance (200px thumbs, 100vw full-bleed leads).\n */export function responsiveSrcSet(url){if(!url||!/^https:\\/\\/framerusercontent\\.com\\/images\\//.test(url))return undefined;const base=url.split(\"?\")[0];return[512,1024,2048].map(w=>`${base}?scale-down-to=${w} ${w}w`).join(\", \")+`, ${base} 2400w`;}/**\n * HOVER IMAGE  (B&W → color)\n * Ports the shipped build's grayscale → color photo affordance\n * (shared.css: filter: grayscale(0.25..1) → grayscale(0) on hover, plus\n * card-lift + inner image scale). Used on listing cards, neighborhood\n * cards, gallery items, agent photo.\n *\n * Default grayscale start is 0.25 contrast 1.04 (matches the .card-photo\n * resting filter in shared.css line ~632). Set `startGray=1` for the\n * fully B&W → color treatment used on the credentials/logo strip.\n *\n * Reduced motion: image renders in color, no hover transform/filter\n * animation (transitions still defined but transforms gated by media\n * query in the inline <style>).\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function HoverImage(props){const{image,alt,startGray,contrast,innerScale,lift,shadow,shadowIntensity,borderRadius,transitionDuration,link,cursorViewLabel}=props;const[hover,setHover]=useState(false);const imgRef=useRef(null);const explicitAlt=(alt||props.altFallback||\"\").trim();const[rowAlt,setRowAlt]=useState(\"\");useEffect(()=>{if(explicitAlt||props.altFromRow===false)return;setRowAlt(nearestRowText(imgRef.current));},[explicitAlt,props.altFromRow,image]);const altText=explicitAlt||rowAlt;const content=/*#__PURE__*/_jsx(\"div\",{onMouseEnter:()=>setHover(true),onMouseLeave:()=>setHover(false),...cursorViewLabel?{\"data-cursor-image\":true}:{},style:{position:\"relative\",width:\"100%\",height:\"100%\",overflow:\"hidden\",borderRadius,boxShadow:shadow&&hover?`0 14px 44px rgba(31, 42, 55,${shadowIntensity})`:shadow?\"0 14px 44px rgba(31, 42, 55,0.06)\":\"none\",transform:hover?`translateY(${lift}px)`:\"translateY(0)\",transition:\"transform 0.4s cubic-bezier(0.25,0.46,0.45,0.94), box-shadow 0.4s ease\",cursor:link?\"pointer\":undefined},children:/*#__PURE__*/_jsx(\"img\",{ref:imgRef,src:image,srcSet:responsiveSrcSet(image),sizes:props.sizes||\"680px\",alt:altText,style:{width:\"100%\",height:\"100%\",objectFit:\"cover\",display:\"block\",filter:hover?\"grayscale(0) contrast(1)\":`grayscale(${startGray}) contrast(${contrast})`,transform:hover?`scale(${innerScale})`:\"scale(1)\",transition:`filter ${transitionDuration}s ease, transform ${transitionDuration+.4}s cubic-bezier(0.22,1,0.36,1)`}})});if(link){return /*#__PURE__*/_jsx(\"a\",{href:link,style:{display:\"block\",width:\"100%\",height:\"100%\",textDecoration:\"none\"},children:content});}return content;}HoverImage.defaultProps={image:\"\",alt:\"\",startGray:.25,contrast:1.04,innerScale:1.03,lift:-4,shadow:true,shadowIntensity:.12,borderRadius:0,transitionDuration:.5,link:\"\",cursorViewLabel:true,altFallback:\"\",altFromRow:true};addPropertyControls(HoverImage,{sizes:{type:ControlType.String,title:\"Sizes hint\",defaultValue:\"680px\",description:\"Rendered width for srcset selection, one length only (200px, 100vw).\"},image:{type:ControlType.Image,title:\"Image\"},alt:{type:ControlType.String,title:\"Alt text\",defaultValue:\"\"},altFallback:{type:ControlType.String,title:\"Alt fallback\",defaultValue:\"\",description:\"Used when Alt text is empty. Bind it on the desktop instance only; tablet/phone inherit.\"},altFromRow:{type:ControlType.Boolean,title:\"Alt from row\",defaultValue:true,description:\"If both alt fields are empty, use the first heading of the enclosing CMS row.\"},startGray:{type:ControlType.Number,title:\"Start grayscale\",min:0,max:1,step:.05,defaultValue:.25},contrast:{type:ControlType.Number,title:\"Rest contrast\",min:1,max:1.3,step:.01,defaultValue:1.04},innerScale:{type:ControlType.Number,title:\"Hover scale\",min:1,max:1.2,step:.01,defaultValue:1.03},lift:{type:ControlType.Number,title:\"Hover lift\",min:-40,max:0,step:1,defaultValue:-4},shadow:{type:ControlType.Boolean,title:\"Shadow\",defaultValue:true},shadowIntensity:{type:ControlType.Number,title:\"Hover shadow\",min:0,max:.4,step:.02,defaultValue:.12},borderRadius:{type:ControlType.Number,title:\"Radius\",min:0,max:40,step:1,defaultValue:0},transitionDuration:{type:ControlType.Number,title:\"Transition (s)\",min:.1,max:2,step:.1,defaultValue:.5},link:{type:ControlType.Link,title:\"Link\"},cursorViewLabel:{type:ControlType.Boolean,title:\"Cursor 'View' label\",defaultValue:true}});\nexport const __FramerMetadata__ = {\"exports\":{\"responsiveSrcSet\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"default\":{\"type\":\"reactComponent\",\"name\":\"HoverImage\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any\",\"framerSupportedLayoutWidth\":\"any\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./HoverImage.map"],"mappings":"wLAOG,SAAS,EAAe,EAAG,CAAC,IAAI,EAAK,EAAG,IAAI,IAAI,EAAE,EAAE,GAAM,EAAE,IAAO,EAAK,EAAK,cAAkB,GAAjC,IAAI,CAA0F,IAAM,EAAhD,EAAK,cAAc,qBAA+B,CAAC,EAAE,aAAa,QAAQ,OAAO,GAAG,CAAC,CAAC,KAAK,EAAE,GAAG,GAAG,EAAE,OAAO,GAAG,EAAE,OAAO,IAAI,OAAO,CAAE,CAAC,MAAM,EAAG,CAQjQ,SAAgB,EAAiB,EAAI,CAAC,GAAG,CAAC,GAAK,CAAC,8CAA8C,KAAK,CAAG,EAAE,OAAiB,IAAM,EAAK,EAAI,MAAM,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,IAAI,GAAG,GAAG,EAAK,iBAAiB,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC,KAAK,IAAI,EAAE,KAAK,EAAK,OAAQ,CAiBpP,SAAwB,EAAW,EAAM,CAAC,GAAK,CAAC,QAAM,MAAI,YAAU,WAAS,aAAW,OAAK,SAAO,kBAAgB,eAAa,qBAAmB,OAAK,mBAAiB,EAAW,CAAC,EAAM,GAAUA,EAAS,EAAK,EAAQ,EAAOC,EAAO,IAAI,EAAQ,GAAa,GAAK,EAAM,aAAa,GAAA,CAAI,KAAK,EAAO,CAAC,EAAO,GAAWD,EAAS,EAAE,EAAE,MAAc,CAAI,GAAa,EAAM,aAAa,IAAa,EAAU,EAAe,EAAO,OAAO,CAAC,CAAE,EAAE,CAAC,EAAY,EAAM,WAAW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