{"version":3,"file":"AvoidLayoutJumping_Prod.cPPlnFJe.mjs","names":["React.useState","useRef"],"sources":["https:/framerusercontent.com/modules/hTl0eZ8TUoz435wI1IcW/5BRkaXpkxygpndxXXD1i/PreloaderConnection.js","https:/framerusercontent.com/modules/h8ioHyt4BUxuvVCE1Q10/aTM6mEMGlM19JjX8exDe/AvoidLayoutJumping_Prod.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";export function PreloaderConnection(props){// 1️⃣ Bail out immediately in the Canvas editor\nif(RenderTarget.current()===RenderTarget.canvas){return null;}const{duration,connectedFrameDesktop,connectedFrameTablet,connectedFrameMobile}=props;const[visible,setVisible]=React.useState(true);// Hide after `duration` seconds\nReact.useEffect(()=>{const timer=setTimeout(()=>setVisible(false),duration*1e3);return()=>clearTimeout(timer);},[duration]);if(!visible)return null;// Pick the right set based on window.innerWidth (real device)\nconst w=typeof window!==\"undefined\"?window.visualViewport?.width||window.innerWidth:Infinity;let framesToShow=connectedFrameDesktop||[];if(w<=809&&connectedFrameMobile?.length){framesToShow=connectedFrameMobile;}else if(w<=1199&&connectedFrameTablet?.length){framesToShow=connectedFrameTablet;}return /*#__PURE__*/_jsx(\"div\",{style:{position:\"fixed\",top:0,left:0,width:\"100vw\",height:\"100vh\",display:\"flex\",justifyContent:\"center\",alignItems:\"center\",zIndex:9999,background:\"transparent\"},children:framesToShow.map((frame,i)=>/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",display:\"flex\",justifyContent:\"center\",alignItems:\"center\"},children:/*#__PURE__*/React.cloneElement(frame,{style:{width:\"100%\",height:\"100%\",objectFit:\"cover\"}})},i))});}PreloaderConnection.displayName=\"Preloader Connection\";addPropertyControls(PreloaderConnection,{duration:{type:ControlType.Number,title:\"Duration\",defaultValue:3,min:.5,max:10,step:.1,unit:\"s\",displayStepper:true},connectedFrameDesktop:{type:ControlType.Array,title:\"Desktop Frame\",propertyControl:{type:ControlType.ComponentInstance}},connectedFrameTablet:{type:ControlType.Array,title:\"Tablet Frame\",propertyControl:{type:ControlType.ComponentInstance}},connectedFrameMobile:{type:ControlType.Array,title:\"Mobile Frame\",propertyControl:{type:ControlType.ComponentInstance}}});\nexport const __FramerMetadata__ = {\"exports\":{\"PreloaderConnection\":{\"type\":\"reactComponent\",\"name\":\"PreloaderConnection\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./PreloaderConnection.map","import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{useEffect,useRef}from\"react\";/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n *\n * @framerDisableUnlink\n */export default function AvoidLayoutJumping({direction,style}){const isCanvas=RenderTarget.current()===RenderTarget.canvas;const ref=useRef(null);const rafId=useRef();const vertical=direction===\"vertical\"||direction===\"both\";const horizontal=direction===\"horizontal\"||direction===\"both\";useEffect(()=>{if(isCanvas)return;const parent=ref.current?.parentElement?.parentElement;if(!parent)return;const container=parent.parentElement;if(!container)return;const updateSize=()=>{const rect=parent.getBoundingClientRect();if(horizontal){container.style.width=`${rect.width}px`;}if(vertical){container.style.height=`${rect.height}px`;}rafId.current=requestAnimationFrame(updateSize);};// Start the RAF loop\nrafId.current=requestAnimationFrame(updateSize);return()=>{if(rafId.current){cancelAnimationFrame(rafId.current);}if(container){if(horizontal){container.style.width=\"\";}if(vertical){container.style.height=\"\";}}};},[direction]);return /*#__PURE__*/_jsx(\"div\",{ref:ref,style:{...style}});}AvoidLayoutJumping.displayName=\"Layout Jump Preventer\";addPropertyControls(AvoidLayoutJumping,{direction:{type:ControlType.Enum,defaultValue:\"vertical\",options:[\"vertical\",\"horizontal\",\"both\"],optionTitles:[\"Vertical\",\"Horizontal\",\"Both\"],displaySegmentedControl:true,segmentedControlDirection:\"vertical\",// @ts-ignore\noptionIcons:[\"direction-vertical\",\"direction-horizontal\",\"direction-all\"],description:\"More components at [Framer University](https://frameruni.link/cc).\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"AvoidLayoutJumping\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerDisableUnlink\":\"\",\"framerSupportedLayoutWidth\":\"auto\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./AvoidLayoutJumping_Prod.map"],"mappings":"oNAAwI,SAAgB,EAAoB,EAAM,CAClL,GAAG,EAAa,SAAS,GAAG,EAAa,OAAQ,OAAO,KAAM,GAAK,CAAC,WAAS,wBAAsB,uBAAqB,wBAAsB,EAAW,CAAC,EAAQ,GAAYA,EAAe,GAAK,CACtE,GAA5H,MAAoB,CAAC,IAAM,EAAM,eAAe,EAAW,GAAM,CAAC,EAAS,IAAI,CAAC,UAAU,aAAa,EAAM,EAAG,CAAC,EAAS,CAAC,CAAI,CAAC,EAAQ,OAAO,KAC/I,IAAM,EAAS,IAAS,OAA4D,IAAhD,EAAO,gBAAgB,OAAO,EAAO,WAAwB,EAAa,GAAuB,EAAE,CAA+J,OAA3J,GAAG,KAAK,GAAsB,OAAQ,EAAa,EAA8B,GAAG,MAAM,GAAsB,SAAQ,EAAa,GAA0C,EAAK,MAAM,CAAC,MAAM,CAAC,SAAS,QAAQ,IAAI,EAAE,KAAK,EAAE,MAAM,QAAQ,OAAO,QAAQ,QAAQ,OAAO,eAAe,SAAS,WAAW,SAAS,OAAO,KAAK,WAAW,cAAc,CAAC,SAAS,EAAa,KAAK,EAAM,IAAiB,EAAK,MAAM,CAAC,MAAM,CAAC,SAAS,WAAW,IAAI,EAAE,KAAK,EAAE,MAAM,OAAO,OAAO,OAAO,QAAQ,OAAO,eAAe,SAAS,WAAW,SAAS,CAAC,SAAsB,EAAmB,EAAM,CAAC,MA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