{"version":3,"file":"PreloaderConnection.KqdPaJI3.mjs","names":["React.useState","__esmMin","z","init_ssg_sandbox_shims","window","_e","init_jsx_runtime","c","init_npm_react_18_3_1","ce","addPropertyControls","init_framer_BCdLsbZT","RenderTarget","ControlType","PreloaderConnection","props","visible","setVisible","timer","duration","w","framesToShow","connectedFrameDesktop","connectedFrameMobile","connectedFrameTablet","frame","i","init_PreloaderConnection"],"sources":["https:/framerusercontent.com/modules/hTl0eZ8TUoz435wI1IcW/5BRkaXpkxygpndxXXD1i/PreloaderConnection.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"],"mappings":"A,8MAAwI,SAAgBc,EAAoB,EAAM,CAClL,GAAGF,EAAa,QAAQ,IAAIA,EAAa,OAAQ,OAAO,KAAM,GAAK,CAAC,WAAS,wBAAsB,uBAAqB,wBAAsBG,EAAW,CAACC,EAAQC,GAAYjB,EAAe,EAAI,EACrE,GAA5HS,MAAoB,CAAC,IAAMS,EAAM,eAAeD,EAAW,EAAK,EAAEE,EAAS,GAAG,EAAE,UAAU,aAAaD,CAAK,CAAE,EAAE,CAACC,CAAQ,CAAC,EAAK,CAACH,EAAQ,OAAO,KAC/I,IAAMI,EAAShB,IAAS,OAA4D,IAAhDA,EAAO,gBAAgB,OAAOA,EAAO,WAAwBiB,EAAaC,GAAuB,CAAC,EAAgK,OAA3JF,GAAG,KAAKG,GAAsB,OAAQ,EAAaA,EAA8BH,GAAG,MAAMI,GAAsB,SAAQ,EAAaA,GAA0C,gBAAK,MAAM,CAAC,MAAM,CAAC,SAAS,QAAQ,IAAI,EAAE,KAAK,EAAE,MAAM,QAAQ,OAAO,QAAQ,QAAQ,OAAO,eAAe,SAAS,WAAW,SAAS,OAAO,KAAK,WAAW,aAAa,EAAE,SAASH,EAAa,KAAK,EAAM,IAAiB,gBAAK,MAA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