{"version":3,"file":"PreloaderPointerFix.DYO4tuNo.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/IIsbyH3Y8j5o7lDrjf87/Tpx4G8Zbv17X5Rpqq9DA/SmoothPreloader.js","https:/framerusercontent.com/modules/Pbpw76A2r3k2LQvesdXg/yi9tIPPYP2dzERFGwbK1/PreloaderPointerFix.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useState,startTransition}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{motion,AnimatePresence}from\"framer-motion\";/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n *\n * @framerIntrinsicWidth 1440\n * @framerIntrinsicHeight 900\n */function SmoothPreloader(props){const{logo={src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"Logo\"},logoSize,backgroundColor,counterColor,counterFont,duration,exitEffect,onComplete,style}=props;const[counter,setCounter]=useState(10);const[isVisible,setIsVisible]=useState(true);const isStatic=useIsStaticRenderer();const getExitAnimation=()=>{switch(exitEffect){case\"fade\":return{opacity:0};case\"slideUp\":return{y:\"-100%\"};case\"slideDown\":return{y:\"100%\"};default:return{opacity:0};}};// Counter animation (disabled in static mode)\nuseEffect(()=>{if(isStatic)return;const increment=90/(duration*1e3/50);const interval=setInterval(()=>{startTransition(()=>{setCounter(prev=>{const next=prev+increment;if(next>=100){clearInterval(interval);setTimeout(()=>{startTransition(()=>{setIsVisible(false);onComplete?.();});},200);return 100;}return next;});});},50);return()=>clearInterval(interval);},[duration,onComplete,isStatic]);// STATIC RENDER (Canvas / Export safe)\nif(isStatic){return /*#__PURE__*/_jsxs(\"div\",{style:{...style,width:\"100%\",height:\"100%\",backgroundColor,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",position:\"relative\",overflow:\"hidden\"},children:[/*#__PURE__*/_jsx(\"img\",{src:logo.src,alt:logo.alt,style:{maxWidth:`${logoSize}px`,maxHeight:`${logoSize}px`,objectFit:\"contain\"}}),/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",bottom:\"40px\",right:\"40px\",color:counterColor,...counterFont},children:\"55%\"})]});}return /*#__PURE__*/_jsx(\"div\",{style:{...style,width:\"100%\",height:\"100%\",position:\"relative\"},children:/*#__PURE__*/_jsx(AnimatePresence,{children:isVisible&&/*#__PURE__*/_jsxs(motion.div,{initial:{opacity:1},animate:{opacity:1},exit:{...getExitAnimation(),transition:{duration:.8,ease:[.6,.01,.05,.95]}},style:{position:\"fixed\",inset:0,backgroundColor,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",overflow:\"auto\",zIndex:9999},children:[/*#__PURE__*/_jsx(motion.img,{src:logo.src,alt:logo.alt,initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{delay:.3,duration:.6},style:{maxWidth:`${logoSize}px`,maxHeight:`${logoSize}px`,objectFit:\"contain\"}}),/*#__PURE__*/_jsxs(motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.5,duration:.4},style:{position:\"absolute\",bottom:\"40px\",right:\"40px\",color:counterColor,...counterFont},children:[Math.round(counter),\"%\"]})]})})});}addPropertyControls(SmoothPreloader,{logo:{type:ControlType.ResponsiveImage,title:\"Logo\"},logoSize:{type:ControlType.Number,title:\"Logo Size\",defaultValue:200,min:50,max:500},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#FFFFFF\"},counterColor:{type:ControlType.Color,title:\"Counter Color\",defaultValue:\"#000000\"},counterFont:{type:ControlType.Font,title:\"Counter Font\",controls:\"extended\",defaultValue:{fontSize:\"80px\",lineHeight:\"1em\",letterSpacing:\"-0.02em\"}},duration:{type:ControlType.Number,title:\"Duration\",defaultValue:3,min:1,max:10},exitEffect:{type:ControlType.Enum,title:\"Exit Effect\",options:[\"fade\",\"slideUp\",\"slideDown\"],optionTitles:[\"Fade\",\"Slide Up\",\"Slide Down\"],defaultValue:\"fade\"},onComplete:{type:ControlType.EventHandler}});export default SmoothPreloader;\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SmoothPreloader\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerIntrinsicHeight\":\"900\",\"framerIntrinsicWidth\":\"1440\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SmoothPreloader.map","import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useLayoutEffect}from\"react\";const SESSION_KEY=\"nik_preloader_shown\";const PLUGIN_ID=\"84d4c1\";const PRELOADER_DURATION_MS=4e3;const disablePreloader=hide=>{document.querySelectorAll(`[data-code-component-plugin-id=\"${PLUGIN_ID}\"]`).forEach(el=>{el.style.pointerEvents=\"none\";if(hide){el.style.opacity=\"0\";el.style.visibility=\"hidden\";}});};/**\n * PreloaderPointerFix + Once\n * Apply to Navigation component.\n *\n * - First visit of session: preloader plays normally, disabled after it finishes.\n * - Return visits: preloader hidden synchronously before paint via useLayoutEffect.\n */export function withPreloaderPointerFix(Component){return props=>{// Runs synchronously before browser paint — no flicker\nuseLayoutEffect(()=>{const alreadySeen=sessionStorage.getItem(SESSION_KEY);if(alreadySeen){disablePreloader(true);}},[]);useEffect(()=>{const alreadySeen=sessionStorage.getItem(SESSION_KEY);if(alreadySeen){// Belt-and-suspenders: also retry async in case of late mounts\nconst timers=[100,300,600].map(ms=>setTimeout(()=>disablePreloader(true),ms));return()=>timers.forEach(clearTimeout);}else{// First visit — let preloader play, then disable + write flag\nconst timer=setTimeout(()=>{sessionStorage.setItem(SESSION_KEY,\"1\");disablePreloader(false);},PRELOADER_DURATION_MS);return()=>clearTimeout(timer);}},[]);return /*#__PURE__*/_jsx(Component,{...props});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withPreloaderPointerFix\":{\"type\":\"re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