{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/WA2UKyINvJBL7mZx0itK/am0fM5ue8oyymibamaJl/PageLoad.js"],
  "sourcesContent": ["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";const useStore=createStore({randomNumber:null,loadState:0});export function handleImageLoading(ref,setStore){if(ref.current){document.body.style.overflow=\"hidden\";const images=ref.current.querySelectorAll(\"img\");let loadedCount=0;const totalImages=images.length;const handleLoad=()=>{loadedCount+=1;if(loadedCount===totalImages||totalImages===0){setTimeout(()=>{document.body.style.overflow=\"scroll\";setStore({loadState:1});},300);}};const handleError=()=>{loadedCount+=1;if(loadedCount===totalImages||totalImages===0){setTimeout(()=>{document.body.style.overflow=\"scroll\";setStore({loadState:1});},300);}};if(totalImages===0){handleLoad();}else{images.forEach(img=>{if(img.complete){handleLoad();}else{img.onload=handleLoad;img.onerror=handleError;}});}// Cleanup function to remove event listeners\nreturn()=>{document.body.style.overflow=\"scroll\";images.forEach(img=>{img.onload=null;img.onerror=null;});};}}export function withSetLoadComplete(Component){return props=>{const[store]=useStore();const loadComplete=store.loadState===1||store.loadState===2;return /*#__PURE__*/_jsx(Component,{...props,loadComplete:loadComplete});};}export function withSetLoader(Component){return props=>{const[store,setStore]=useStore();const loadComplete=store.loadState===1||store.loadState===2;useEffect(()=>{setStore({loadState:0});return()=>{setStore({loadState:0});};},[]);return /*#__PURE__*/_jsx(Component,{...props,variant:loadComplete?\"Complete\":\"Loading\"});};}export function withSetLoaderState(Component){return props=>{const[store,setStore]=useStore();const loadComplete=store.loadState===1||store.loadState===2;useEffect(()=>{setTimeout(()=>{setStore({loadState:1});},300);},[]);return /*#__PURE__*/_jsx(Component,{...props,variant:loadComplete?\"Complete\":\"Loading\"});};}export function withShuffleHeroImage(Component){return props=>{const[store,setStore]=useStore();const componentRef=useRef(null);useEffect(()=>{const randomNumber=Math.floor(Math.random()*5)+1// Generates a random number between 1 and 5\n;setStore({randomNumber});setTimeout(()=>{handleImageLoading(componentRef,setStore);},1);},[componentRef,setStore]);const loadComplete=store.loadState===1||store.loadState===2;return /*#__PURE__*/_jsx(Component,{...props,ref:componentRef,heroVisible:loadComplete,bgImgPrimaryVisible:!loadComplete||store.randomNumber===1,bgImg2Visible:!loadComplete||store.randomNumber===2,bgImg3Visible:!loadComplete||store.randomNumber===3,bgImg4Visible:!loadComplete||store.randomNumber===4,bgImg5Visible:!loadComplete||store.randomNumber===5});};}export function withAnimateHero(Component){return props=>{const[store,setStore]=useStore();const componentRef=useRef(null);useEffect(()=>{handleImageLoading(componentRef,setStore);},[componentRef,setStore]);return /*#__PURE__*/_jsx(Component,{...props,ref:componentRef,heroVisible:store.loadState===1||store.loadState===2});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withSetLoader\":{\"type\":\"reactHoc\",\"name\":\"withSetLoader\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withSetLoadComplete\":{\"type\":\"reactHoc\",\"name\":\"withSetLoadComplete\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withAnimateHero\":{\"type\":\"reactHoc\",\"name\":\"withAnimateHero\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"handleImageLoading\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withShuffleHeroImage\":{\"type\":\"reactHoc\",\"name\":\"withShuffleHeroImage\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withSetLoaderState\":{\"type\":\"reactHoc\",\"name\":\"withSetLoaderState\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./PageLoad.map"],
  "mappings": "gGAAoJ,IAAMA,EAASC,EAAY,CAAC,aAAa,KAAK,UAAU,CAAC,CAAC,EAAS,SAASC,EAAmBC,EAAIC,EAAS,CAAC,GAAGD,EAAI,QAAQ,CAAC,SAAS,KAAK,MAAM,SAAS,SAAS,IAAME,EAAOF,EAAI,QAAQ,iBAAiB,KAAK,EAAMG,EAAY,EAAQC,EAAYF,EAAO,OAAaG,EAAW,IAAI,CAACF,GAAa,GAAKA,IAAcC,GAAaA,IAAc,IAAG,WAAW,IAAI,CAAC,SAAS,KAAK,MAAM,SAAS,SAASH,EAAS,CAAC,UAAU,CAAC,CAAC,CAAE,EAAE,GAAG,CAAG,EAAQK,EAAY,IAAI,CAACH,GAAa,GAAKA,IAAcC,GAAaA,IAAc,IAAG,WAAW,IAAI,CAAC,SAAS,KAAK,MAAM,SAAS,SAASH,EAAS,CAAC,UAAU,CAAC,CAAC,CAAE,EAAE,GAAG,CAAG,EAAE,OAAGG,IAAc,EAAGC,EAAW,EAAQH,EAAO,QAAQK,GAAK,CAAIA,EAAI,SAAUF,EAAW,GAAQE,EAAI,OAAOF,EAAWE,EAAI,QAAQD,EAAa,CAAC,EAC73B,IAAI,CAAC,SAAS,KAAK,MAAM,SAAS,SAASJ,EAAO,QAAQK,GAAK,CAACA,EAAI,OAAO,KAAKA,EAAI,QAAQ,IAAK,CAAC,CAAE,CAAE,CAAC,CACgb,SAASC,EAAgBC,EAAU,CAAC,OAAOC,GAAO,CAAC,GAAK,CAACC,EAAMC,CAAQ,EAAEC,EAAS,EAAQC,EAAaC,EAAO,IAAI,EAAE,OAAAC,EAAU,IAAI,CAACC,EAAmBH,EAAaF,CAAQ,CAAE,EAAE,CAACE,EAAaF,CAAQ,CAAC,EAAsBM,EAAKT,EAAU,CAAC,GAAGC,EAAM,IAAII,EAAa,YAAYH,EAAM,YAAY,GAAGA,EAAM,YAAY,CAAC,CAAC,CAAE,CAAE",
  "names": ["useStore", "createStore", "handleImageLoading", "ref", "setStore", "images", "loadedCount", "totalImages", "handleLoad", "handleError", "img", "withAnimateHero", "Component", "props", "store", "setStore", "useStore", "componentRef", "pe", "ue", "handleImageLoading", "p"]
}
