{"version":3,"file":"Exit.DILhpbb5.mjs","names":["React","e"],"sources":["https:/framerusercontent.com/modules/xS6g7il51ApWPpBrfV5Z/HUsmtmCbqsYkmVAQUcv0/Exit.js"],"sourcesContent":["/*\n * ExitIntent by framer.today\n * v1.0.0\n * https://framer.today/license\n *\n */import{jsx as _jsx}from\"react/jsx-runtime\";import React from\"react\";import{motion}from\"framer-motion\";import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";const useStore=createStore({isOverlayVisible:false});export function withWindowLeaveOverlay(Component){return function WrappedComponent(props){const[store,setStore]=useStore();const[overlayDismissed,setOverlayDismissed]=React.useState(false);// Check session storage once and initialize overlay visibility\nReact.useEffect(()=>{const dismissed=sessionStorage.getItem(\"overlayDismissed\")===\"true\";setOverlayDismissed(dismissed);if(dismissed){setStore({isOverlayVisible:false});}},[]);// Listen for mouseout events to detect exit intent\nReact.useEffect(()=>{if(overlayDismissed)return;const handleMouseLeave=event=>{if(sessionStorage.getItem(\"overlayDismissed\")===\"true\")return;const{clientX,clientY,relatedTarget}=event;const{innerWidth,innerHeight}=window;if(!relatedTarget&&(clientY<=0||clientY>=innerHeight||clientX<=0||clientX>=innerWidth)){setStore({isOverlayVisible:true});}};document.addEventListener(\"mouseout\",handleMouseLeave);return()=>document.removeEventListener(\"mouseout\",handleMouseLeave);},[overlayDismissed,setStore]);const dismissOverlay=event=>{event.preventDefault();setStore({isOverlayVisible:false});sessionStorage.setItem(\"overlayDismissed\",\"true\");};if(!store.isOverlayVisible)return null;const overlayStyle={position:\"fixed\",top:0,left:0,right:0,bottom:0,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",backgroundColor:\"rgba(0, 0, 0, 0.8)\",zIndex:1e3};const motionStyle={initial:{y:25,opacity:0},animate:{y:0,opacity:1},exit:{y:25,opacity:0},transition:{type:\"spring\",stiffness:300,damping:45,mass:1.1}};return /*#__PURE__*/_jsx(\"div\",{style:overlayStyle,onClick:dismissOverlay,children:/*#__PURE__*/_jsx(motion.div,{...motionStyle,onClick:e=>e.stopPropagation(),children:/*#__PURE__*/_jsx(Component,{...props})})});};}export function withDismissOverlay(Component){return function WrappedComponent(props){const[,setStore]=useStore();const dismissOverlay=event=>{event.preventDefault();setStore({isOverlayVisible:false});sessionStorage.setItem(\"overlayDismissed\",\"true\");};return /*#__PURE__*/_jsx(Component,{...props,onClick:dismissOverlay});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withDismissOverlay\":{\"type\":\"reactHoc\",\"name\":\"withDismissOverlay\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withWindowLeaveOverlay\":{\"type\":\"reactHoc\",\"name\":\"withWindowLeaveOverlay\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Exit.map"],"mappings":"qOAKmO,SAAgB,EAAuB,EAAU,CAAC,OAAO,SAA0B,EAAM,CAAC,GAAK,CAAC,EAAM,GAAU,GAAU,CAAM,CAAC,EAAiB,GAAqBA,EAAM,SAAS,GAAM,CAE8kB,OAD7+B,EAAM,cAAc,CAAC,IAAM,EAAU,eAAe,QAAQ,mBAAmB,GAAG,OAAO,EAAoB,EAAU,CAAI,GAAW,EAAS,CAAC,iBAAiB,GAAM,CAAC,EAAI,EAAE,CAAC,CAC/K,EAAM,cAAc,CAAC,GAAG,EAAiB,OAAO,IAAM,EAAiB,GAAO,CAAC,GAAG,eAAe,QAAQ,mBAAmB,GAAG,OAAO,OAAO,GAAK,CAAC,UAAQ,UAAQ,iBAAe,EAAW,CAAC,aAAW,eAAa,EAAU,CAAC,IAAgB,GAAS,GAAG,GAAS,GAAa,GAAS,GAAG,GAAS,IAAa,EAAS,CAAC,iBAAiB,GAAK,CAAC,EAA2D,OAAvD,SAAS,iBAAiB,WAAW,EAAiB,KAAW,SAAS,oBAAoB,WAAW,EAAiB,EAAG,CAAC,EAAiB,EAAS,CAAC,CAAgJ,EAAM,iBAAwX,EAAK,MAAM,CAAC,MAApV,CAAC,SAAS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