{"version":3,"file":"Override.DN6l3O2g.mjs","names":[],"sources":["https:/framerusercontent.com/modules/d2y8205raHH0EPklVdyl/K7j8V5g2s8xZ6dRbA4SU/Override.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,startTransition,useCallback,useEffect,useRef,useState}from\"react\";export function truncate3(Component){return props=>{const{style,...rest}=props;const styles=style||{};styles.WebkitBoxOrient=\"vertical\";styles.WebkitLineClamp=3;styles.overflow=\"hidden\";styles.textOverflow=\"ellipsis\";styles.maxWidth=\"100%\";styles.display=\"-webkit-box\";return /*#__PURE__*/_jsx(Component,{...rest,style:styles});};}export function truncate2(Component){return props=>{const{style,...rest}=props;const styles=style||{};styles.WebkitBoxOrient=\"vertical\";styles.WebkitLineClamp=2;styles.overflow=\"hidden\";styles.textOverflow=\"ellipsis\";styles.maxWidth=\"100%\";styles.display=\"-webkit-box\";return /*#__PURE__*/_jsx(Component,{...rest,style:styles});};}export function redirectToSignup(Component){return props=>{console.log(\"redirecting to https://app.lodasmarkets.com/signup\");useEffect(()=>{setTimeout(function(){window.location.href=\"https://app.lodasmarkets.com/signup\";},2e3);},[]);return /*#__PURE__*/_jsx(Component,{...props});};}export function redirectToLogin(Component){return props=>{console.log(\"redirecting to https://app.lodasmarkets.com/login\");useEffect(()=>{setTimeout(function(){window.location.href=\"https://app.lodasmarkets.com/login\";},2e3);},[]);return /*#__PURE__*/_jsx(Component,{...props});};}export function redirectToFeeSchedule(Component){return props=>{console.log(\"redirecting to Fee Schedule\");useEffect(()=>{setTimeout(function(){window.location.href=\"https://realto-public.s3.amazonaws.com/FeeSchedule-2023-01.pdf\";},2e3);},[]);return /*#__PURE__*/_jsx(Component,{...props});};}export function redirectToArticle(Component){return props=>{console.log(\"redirecting to original article\",props);// useEffect(() => {\n//     setTimeout(function () {\n//         window.location.href =\n//             \"https://realto-public.s3.amazonaws.com/FeeSchedule-2023-01.pdf\"\n//     }, 2000)\n// }, [])\nreturn /*#__PURE__*/_jsx(Component,{...props});};}export function collapseAnnouncementBarOnClose(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const wrapperRef=useRef(null);const[isClosed,setIsClosed]=useState(false);const[isCollapsing,setIsCollapsing]=useState(false);const[height,setHeight]=useState(\"auto\");const[opacity,setOpacity]=useState(1);const[marginTop,setMarginTop]=useState(\"0px\");const[marginBottom,setMarginBottom]=useState(\"0px\");const collapseStartedRef=useRef(false);const getNodeHeight=useCallback(()=>{const wrapper=wrapperRef.current;if(!wrapper)return 0;const rectHeight=wrapper.getBoundingClientRect().height;return rectHeight||wrapper.scrollHeight||0;},[]);const startCollapse=useCallback(()=>{if(collapseStartedRef.current)return;const wrapper=wrapperRef.current;if(!wrapper)return;collapseStartedRef.current=true;const measuredHeight=getNodeHeight();if(typeof window!==\"undefined\"){const computed=window.getComputedStyle(wrapper);startTransition(()=>{setMarginTop(computed.marginTop||\"0px\");setMarginBottom(computed.marginBottom||\"0px\");});}startTransition(()=>{setIsCollapsing(true);setHeight(measuredHeight>0?measuredHeight:\"auto\");setOpacity(1);});if(typeof window!==\"undefined\"){window.requestAnimationFrame(()=>{startTransition(()=>{setHeight(0);setOpacity(0);setMarginTop(0);setMarginBottom(0);});});}},[getNodeHeight]);const maybeCloseFromTarget=useCallback(event=>{if(collapseStartedRef.current)return;if(typeof window===\"undefined\")return;const target=event.target;if(!(target instanceof Element))return;const root=wrapperRef.current;if(!root||!root.contains(target))return;const patterns=/(close|dismiss|hide)/i;const isKeyboardEvent=event instanceof KeyboardEvent;const isMouseEvent=event instanceof MouseEvent;const activatedByKeyboard=isKeyboardEvent&&(event.key===\"Enter\"||event.key===\" \"||event.key===\"Spacebar\");const isButtonLikeElement=element=>{const tagName=element.tagName.toLowerCase();const role=element.getAttribute(\"role\")||\"\";const tabIndexAttr=element.getAttribute(\"tabindex\");return tagName===\"button\"||role===\"button\"||element.hasAttribute(\"onclick\")||tabIndexAttr!==null&&tabIndexAttr!==\"-1\";};const getButtonLikeControls=()=>{return Array.from(root.querySelectorAll('button, [role=\"button\"], [onclick], [tabindex]:not([tabindex=\"-1\"])')).filter(element=>!element.closest(\"a\"));};let current=target;while(current&&current!==root.parentElement){const ariaLabel=current.getAttribute(\"aria-label\")||\"\";const title=current.getAttribute(\"title\")||\"\";const className=typeof current.className===\"string\"?current.className:\"\";const dataAttr=[current.getAttribute(\"data-close\"),current.getAttribute(\"data-dismiss\"),current.getAttribute(\"data-hide\"),current.getAttribute(\"data-action\"),current.getAttribute(\"data-testid\")].filter(Boolean).join(\" \");const tagName=current.tagName.toLowerCase();const role=current.getAttribute(\"role\")||\"\";const maybeControl=tagName===\"button\"||tagName===\"a\"||role===\"button\"||current.hasAttribute(\"onclick\")||current.hasAttribute(\"tabindex\");if(maybeControl&&(patterns.test(ariaLabel)||patterns.test(title)||patterns.test(className)||patterns.test(dataAttr))){startCollapse();return;}// Fallback 1: if there is exactly one button-like control in the bar,\n// treat activation on it as close (covers plain \"X\" controls with no labels).\nconst isInsideLink=!!current.closest(\"a\");if(!isInsideLink&&isButtonLikeElement(current)&&(isMouseEvent||activatedByKeyboard)){const buttonLikeControls=getButtonLikeControls();if(buttonLikeControls.length===1){startCollapse();return;}// Fallback 2: conservative right-edge heuristic for button-like click targets.\nif(isMouseEvent){const rootRect=root.getBoundingClientRect();const currentRect=current.getBoundingClientRect();const clickX=event.clientX;const rightEdgeThreshold=72;const nearRightEdge=rootRect.right-clickX<=rightEdgeThreshold&&clickX>=currentRect.left&&clickX<=currentRect.right;if(nearRightEdge){startCollapse();return;}}}if(current===root)break;current=current.parentElement;}},[startCollapse]);useEffect(()=>{if(typeof window===\"undefined\")return;const root=wrapperRef.current;if(!root)return;const onClickCapture=event=>{maybeCloseFromTarget(event);};const onKeyDownCapture=event=>{if(event.key===\"Enter\"||event.key===\" \"){maybeCloseFromTarget(event);}};root.addEventListener(\"click\",onClickCapture,true);root.addEventListener(\"keydown\",onKeyDownCapture,true);return()=>{root.removeEventListener(\"click\",onClickCapture,true);root.removeEventListener(\"keydown\",onKeyDownCapture,true);};},[maybeCloseFromTarget]);useEffect(()=>{if(typeof window===\"undefined\")return;const root=wrapperRef.current;if(!root)return;let previousVisibleHeight=getNodeHeight();const evaluateAutoHidden=()=>{if(collapseStartedRef.current)return;const currentHeight=getNodeHeight();if(previousVisibleHeight>2&&currentHeight<=1){startCollapse();}else{previousVisibleHeight=Math.max(previousVisibleHeight,currentHeight);}};const resizeObserver=typeof ResizeObserver!==\"undefined\"?new ResizeObserver(()=>{evaluateAutoHidden();}):null;if(resizeObserver){resizeObserver.observe(root);Array.from(root.children).forEach(child=>resizeObserver.observe(child));}const mutationObserver=typeof MutationObserver!==\"undefined\"?new MutationObserver(()=>{evaluateAutoHidden();}):null;if(mutationObserver){mutationObserver.observe(root,{childList:true,subtree:true,attributes:true,attributeFilter:[\"style\",\"class\",\"hidden\",\"aria-hidden\"]});}return()=>{resizeObserver?.disconnect();mutationObserver?.disconnect();};},[getNodeHeight,startCollapse]);useEffect(()=>{if(!isCollapsing)return;if(typeof window===\"undefined\")return;const root=wrapperRef.current;if(!root)return;const finishClose=()=>{startTransition(()=>{setIsClosed(true);setHeight(0);setOpacity(0);});};root.addEventListener(\"transitionend\",finishClose,{once:true});return()=>root.removeEventListener(\"transitionend\",finishClose);},[isCollapsing]);return /*#__PURE__*/_jsx(\"div\",{ref:wrapperRef,style:{position:\"relative\",height,opacity,marginTop,marginBottom,overflow:isCollapsing||isClosed?\"hidden\":\"visible\",transition:isCollapsing?\"height 0.45s ease, opacity 0.45s ease, margin-top 0.45s ease, margin-bottom 0.45s ease\":undefined,pointerEvents:isClosed?\"none\":\"auto\"},children:/*#__PURE__*/_jsx(Component,{ref:ref,...props})});});}\nexport const __FramerMetadata__ = {\"exports\":{\"redirectToFeeSchedule\":{\"type\":\"reactHoc\",\"name\":\"redirectToFeeSchedule\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"collapseAnnouncementBarOnClose\":{\"type\":\"reactHoc\",\"name\":\"collapseAnnouncementBarOnClose\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"redirectToLogin\":{\"type\":\"reactHoc\",\"name\":\"redirectToLogin\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"redirectToSignup\":{\"type\":\"reactHoc\",\"name\":\"redirectToSignup\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"truncate2\":{\"type\":\"reactHoc\",\"name\":\"truncate2\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"redirectToArticle\":{\"type\":\"reactHoc\",\"name\":\"redirectToArticle\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"truncate3\":{\"type\":\"reactHoc\",\"name\":\"truncate3\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Override.map"],"mappings":"2HAA+H,SAAgB,EAAU,EAAU,CAAC,MAAO,IAAO,CAAC,GAAK,CAAC,QAAM,GAAG,GAAM,EAAY,EAAO,GAAO,CAAC,EAAyK,MAAvK,GAAO,gBAAgB,WAAW,EAAO,gBAAgB,EAAE,EAAO,SAAS,SAAS,EAAO,aAAa,WAAW,EAAO,SAAS,OAAO,EAAO,QAAQ,cAAkC,EAAK,EAAU,CAAC,GAAG,EAAK,MAAM,CAAM,CAAC,CAAE,CAAE,CAAC,SAAgB,EAAU,EAAU,CAAC,MAAO,IAAO,CAAC,GAAK,CAAC,QAAM,GAAG,GAAM,EAAY,EAAO,GAAO,CAAC,EAAyK,MAAvK,GAAO,gBAAgB,WAAW,EAAO,gBAAgB,EAAE,EAAO,SAAS,SAAS,EAAO,aAAa,WAAW,EAAO,SAAS,OAAO,EAAO,QAAQ,cAAkC,EAAK,EAAU,CAAC,GAAG,EAAK,MAAM,CAAM,CAAC,CAAE,CAAE,CAAC,SAAgB,EAAiB,EAAU,CAAC,MAAO,KAAQ,QAAQ,IAAI,oDAAoD,EAAE,MAAc,CAAC,WAAW,UAAU,CAAC,EAAO,SAAS,KAAK,qCAAsC,EAAE,GAAG,CAAE,EAAE,CAAC,CAAC,EAAsB,EAAK,EAAU,CAAC,GAAG,CAAK,CAAC,EAAI,CAAC,SAAgB,EAAgB,EAAU,CAAC,MAAO,KAAQ,QAAQ,IAAI,mDAAmD,EAAE,MAAc,CAAC,WAAW,UAAU,CAAC,EAAO,SAAS,KAAK,oCAAqC,EAAE,GAAG,CAAE,EAAE,CAAC,CAAC,EAAsB,EAAK,EAAU,CAAC,GAAG,CAAK,CAAC,EAAI,CAAC,SAAgB,EAAsB,EAAU,CAAC,MAAO,KAAQ,QAAQ,IAAI,6BAA6B,EAAE,MAAc,CAAC,WAAW,UAAU,CAAC,EAAO,SAAS,KAAK,gEAAiE,EAAE,GAAG,CAAE,EAAE,CAAC,CAAC,EAAsB,EAAK,EAAU,CAAC,GAAG,CAAK,CAAC,EAAI,qBAApkD,IAAoF"}