{"version":3,"file":"UsePageVisibility.DFhyRL5e.mjs","names":["useState","__esmMin","init_npm_react_18_3_1","_e","ce","getBrowserVisibilityProp","isBrowser","getBrowserDocumentHiddenProp","getIsDocumentHidden","usePageVisibility","isVisible","setIsVisible","onVisibilityChange","visibilityChange","init_UsePageVisibility"],"sources":["https:/framerusercontent.com/modules/V9ryrjN5Am9WM1dJeyyJ/9mrJHeWj7rhvLTLu7Yzt/UsePageVisibility.js"],"sourcesContent":["import{useState,useEffect}from\"react\";export const isBrowser=()=>typeof document===\"object\";export function getBrowserVisibilityProp(){if(!isBrowser())return;if(typeof document.hidden!==\"undefined\"){// Opera 12.10 and Firefox 18 and later support\nreturn\"visibilitychange\";}else if(typeof document.msHidden!==\"undefined\"){return\"msvisibilitychange\";}else if(typeof document.webkitHidden!==\"undefined\"){return\"webkitvisibilitychange\";}}export function getBrowserDocumentHiddenProp(){if(!isBrowser())return;if(typeof document.hidden!==\"undefined\"){return\"hidden\";}else if(typeof document.msHidden!==\"undefined\"){return\"msHidden\";}else if(typeof document.webkitHidden!==\"undefined\"){return\"webkitHidden\";}}export function getIsDocumentHidden(){if(!isBrowser())return;return!document[getBrowserDocumentHiddenProp()];}export function usePageVisibility(){if(!isBrowser())return;const[isVisible,setIsVisible]=useState(getIsDocumentHidden());const onVisibilityChange=()=>setIsVisible(getIsDocumentHidden());useEffect(()=>{const visibilityChange=getBrowserVisibilityProp();document.addEventListener(visibilityChange,onVisibilityChange,false);return()=>{document.removeEventListener(visibilityChange,onVisibilityChange);};});return isVisible;}\nexport const __FramerMetadata__ = {\"exports\":{\"getBrowserVisibilityProp\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"getIsDocumentHidden\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"usePageVisibility\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"isBrowser\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"getBrowserDocumentHiddenProp\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./UsePageVisibility.map"],"mappings":"A,2GAA4F,SAAgBK,GAA0B,CAAC,GAAIC,EAAU,EAAS,IAAU,SAAS,SAAS,OAC1L,MAAM,mBAAyB,GAAU,SAAS,WAAW,OAAa,MAAM,qBAA2B,GAAU,SAAS,eAAe,OAAa,MAAM,wBAAA,CAA0B,CAAC,SAAgBC,GAA8B,CAAC,GAAID,EAAU,EAAS,IAAU,SAAS,SAAS,OAAa,MAAM,SAAe,GAAU,SAAS,WAAW,OAAa,MAAM,WAAiB,GAAU,SAAS,eAAe,OAAa,MAAM,cAAA,CAAgB,CAAC,SAAgBE,GAAqB,CAAC,GAAIF,EAAU,EAAS,MAAM,CAAC,SAASC,EAA6B,EAAG,CAAC,SAAgBE,GAAmB,CAAC,GAAG,CAACH,EAAU,EAAE,OAAO,GAAK,CAACI,EAAUC,GAAcX,EAASQ,EAAoB,CAAC,EAAQI,MAAuBD,EAAaH,EAAoB,CAAC,EAA0N,OAAxNJ,MAAc,CAAC,IAAMS,EAAiBR,EAAyB,EAAuE,OAArE,SAAS,iBAAiBQ,EAAiBD,EAAmB,EAAK,MAAY,CAAC,SAAS,oBAAoBC,EAAiBD,CAAkB,CAAE,CAAE,CAAC,EAASF,CAAU,C,wCADr6B,MAAc,OAAO,UAAW,Q"}