{"version":3,"file":"UsePageVisibility.CllWFuA1.mjs","names":["useState"],"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":"2GAA4F,SAAgB,GAA0B,CAAK,KAAU,EAAS,IAAU,SAAS,SAAS,OAC1L,MAAM,mBAAyB,GAAU,SAAS,WAAW,OAAa,MAAM,qBAA2B,GAAU,SAAS,eAAe,OAAa,MAAM,wBAAA,CAA0B,CAAC,SAAgB,GAA8B,CAAK,KAAU,EAAS,IAAU,SAAS,SAAS,OAAa,MAAM,SAAe,GAAU,SAAS,WAAW,OAAa,MAAM,WAAiB,GAAU,SAAS,eAAe,OAAa,MAAM,cAAA,CAAgB,CAAC,SAAgB,GAAqB,CAAK,KAAU,EAAS,MAAM,CAAC,SAAS,EAA6B,EAAG,CAAC,SAAgB,GAAmB,CAAC,GAAG,CAAC,EAAU,EAAE,OAAO,GAAK,CAAC,EAAU,GAAcA,EAAS,EAAoB,CAAC,EAAQ,MAAuB,EAAa,EAAoB,CAAC,EAA0N,OAAxN,MAAc,CAAC,IAAM,EAAiB,EAAyB,EAAuE,OAArE,SAAS,iBAAiB,EAAiB,EAAmB,EAAK,MAAY,CAAC,SAAS,oBAAoB,EAAiB,CAAkB,CAAE,CAAE,CAAC,EAAS,CAAU,mBADn7B,EAAc,MAAc,OAAO,UAAW"}