{"version":3,"file":"PreloaderConnector.BdGLvf_q.mjs","names":["React.useState","React.useEffect","_jsx","React.isValidElement","React.cloneElement","__esmMin","init_npm_react_18_3_1","ce","z","init_jsx_runtime","c","K","_e","addPropertyControls","RenderTarget","init_framer_ChujFWHC","ControlType","PreLoaderConnector","props","connectedFrame","renderKey","setRenderKey","isInteractive","setIsInteractive","handleVisibilityChange","prev","timer","containerStyle","frameWrapperStyle","frameStyle","safeFrames","hasFrames","frame","index","init_PreloaderConnector"],"sources":["https:/framerusercontent.com/modules/0OUu9M01UVJkN6MRMAgd/GB0PTr4iE64pXozOrkB6/PreloaderConnector.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";export function PreLoaderConnector(props){const{connectedFrame}=props;const[renderKey,setRenderKey]=React.useState(0);const[isInteractive,setIsInteractive]=React.useState(true);React.useEffect(()=>{if(RenderTarget.current()===RenderTarget.canvas)return;const handleVisibilityChange=()=>{if(document.visibilityState===\"visible\"){setRenderKey(prev=>prev+1);const timer=setTimeout(()=>{setIsInteractive(false);},2e3);document.removeEventListener(\"visibilitychange\",handleVisibilityChange);return()=>clearTimeout(timer);}};if(document.visibilityState===\"visible\"){const timer=setTimeout(()=>setIsInteractive(false),2e3);return()=>clearTimeout(timer);}else{document.addEventListener(\"visibilitychange\",handleVisibilityChange);}return()=>document.removeEventListener(\"visibilitychange\",handleVisibilityChange);},[]);if(RenderTarget.current()===RenderTarget.canvas){return null;}const containerStyle={position:\"fixed\",top:0,left:0,width:\"100vw\",height:\"100vh\",display:\"flex\",justifyContent:\"center\",alignItems:\"center\",zIndex:9999,background:\"transparent\",pointerEvents:isInteractive?\"all\":\"none\"};const frameWrapperStyle={position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",display:\"flex\",justifyContent:\"center\",alignItems:\"center\"};const frameStyle={width:\"100%\",height:\"100%\",objectFit:\"cover\"};const safeFrames=Array.isArray(connectedFrame)?connectedFrame:[];const hasFrames=safeFrames.length>0;return /*#__PURE__*/_jsx(\"div\",{style:containerStyle,children:hasFrames&&safeFrames.map((frame,index)=>{if(!/*#__PURE__*/React.isValidElement(frame))return null;return /*#__PURE__*/_jsx(\"div\",{style:frameWrapperStyle,children:/*#__PURE__*/React.cloneElement(frame,{style:frameStyle})},`frame-${index}-${renderKey}`);})});}addPropertyControls(PreLoaderConnector,{connectedFrame:{type:ControlType.Array,title:\"Connect Frame\",propertyControl:{type:ControlType.ComponentInstance}}});\nexport const __FramerMetadata__ = {\"exports\":{\"PreLoaderConnector\":{\"type\":\"reactComponent\",\"name\":\"PreLoaderConnector\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./PreloaderConnector.map"],"mappings":"A,uMAAwI,SAAgBiB,EAAmBC,EAAM,CAAC,GAAK,CAACC,kBAAgBD,EAAW,CAACE,EAAUC,GAAcrB,EAAe,CAAC,EAAO,CAACsB,EAAcC,GAAkBvB,EAAe,EAAI,EAA2nB,GAAznBC,MAAoB,CAAC,GAAGa,EAAa,QAAQ,IAAIA,EAAa,OAAO,OAAO,IAAMU,MAA2B,CAAC,GAAG,SAAS,kBAAkB,UAAU,CAACH,EAAaI,GAAMA,EAAK,CAAC,EAAE,IAAMC,EAAM,eAAe,CAACH,EAAiB,EAAK,CAAE,EAAE,GAAG,EAA0E,OAAxE,SAAS,oBAAoB,mBAAmBC,CAAsB,MAAY,aAAaE,CAAK,CAAE,CAAC,EAAE,GAAG,SAAS,kBAAkB,UAAU,CAAC,IAAMA,EAAM,eAAeH,EAAiB,EAAK,EAAE,GAAG,EAAE,UAAU,aAAaG,CAAK,CAAE,CAA4E,OAAtE,SAAS,iBAAiB,mBAAmBF,CAAsB,MAAa,SAAS,oBAAoB,mBAAmBA,CAAsB,CAAE,EAAE,CAAC,CAAC,EAAKV,EAAa,QAAQ,IAAIA,EAAa,OAAQ,OAAO,KAA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