{"version":3,"file":"PageOverlay.F8CcppKk.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/BX1kvE4NPIMO0p7v4sI5/ymod7cqau8svsFxXjfg7/PageOverlay.js"],"sourcesContent":["// Auto-opening overlay with background blur and component slot\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useState,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{motion,AnimatePresence}from\"framer-motion\";/**\n * Auto-opening overlay with background blur and component slot\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function PageOverlay(props){const{children,backgroundColor,blurAmount,contentBackgroundColor,contentBorderRadius,contentMaxWidth,autoOpen,contentAreaBackgroundColor,border}=props;const[isOpen,setIsOpen]=useState(false);useEffect(()=>{if(autoOpen){startTransition(()=>setIsOpen(true));}},[autoOpen]);// Set up global openOverlay function\nuseEffect(()=>{if(typeof window!==\"undefined\"){window.openOverlay=()=>{startTransition(()=>setIsOpen(true));};return()=>{delete window.openOverlay;};}},[]);useEffect(()=>{if(typeof window!==\"undefined\"&&isOpen){// Prevent scrolling when overlay is open\ndocument.body.style.overflow=\"hidden\";return()=>{document.body.style.overflow=\"unset\";};}},[isOpen]);const handleClose=()=>{startTransition(()=>setIsOpen(false));};const handleBackdropClick=e=>{if(e.target===e.currentTarget){handleClose();}};if(!isOpen)return null;return /*#__PURE__*/_jsx(AnimatePresence,{children:isOpen&&/*#__PURE__*/_jsx(motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.5},style:{position:\"fixed\",top:0,left:0,width:\"100vw\",height:\"100dvh\",backgroundColor,backdropFilter:`blur(${blurAmount}px)`,WebkitBackdropFilter:`blur(${blurAmount}px)`,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",zIndex:9999,padding:\"20px\",boxSizing:\"border-box\"},onClick:handleBackdropClick,children:/*#__PURE__*/_jsx(motion.div,{initial:{opacity:0,y:40},animate:{opacity:1,y:0},exit:{opacity:0,y:40},transition:{duration:.5,delay:.2},style:{position:\"relative\",backgroundColor:contentBackgroundColor,borderRadius:contentBorderRadius,maxWidth:contentMaxWidth,maxHeight:\"80vh\",width:\"100%\",height:\"auto\",overflow:\"auto\",boxShadow:\"0 20px 40px rgba(0, 0, 0, 0.15)\",display:\"flex\",flexDirection:\"column\",...border},onClick:e=>e.stopPropagation(),children:/*#__PURE__*/_jsx(\"div\",{style:{flex:1,width:\"100%\",height:\"100%\",backgroundColor:contentAreaBackgroundColor},onClick:e=>{// Check if the clicked element or any parent has data-close-modal=\"true\"\nlet target=e.target;while(target&&target!==e.currentTarget){if(target.getAttribute(\"data-close-modal\")===\"true\"){handleClose();break;}target=target.parentElement;}},children:/*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\"},children:/*#__PURE__*/_jsxs(\"div\",{style:{width:\"100%\",height:\"100%\"},children:[/*#__PURE__*/_jsx(\"style\",{children:`\n                                        .overlay-content > * {\n                                            width: 100% !important;\n                                            height: 100% !important;\n                                        }\n                                        `}),/*#__PURE__*/_jsx(\"div\",{className:\"overlay-content\",style:{width:\"100%\",height:\"100%\"},children:children})]})})})})})});}addPropertyControls(PageOverlay,{children:{type:ControlType.Slot,title:\"Content\"},autoOpen:{type:ControlType.Boolean,title:\"Auto Open\",defaultValue:true,enabledTitle:\"Yes\",disabledTitle:\"No\"},backgroundColor:{type:ControlType.Color,title:\"Background Color\",defaultValue:\"rgba(0, 0, 0, 0.5)\"},blurAmount:{type:ControlType.Number,title:\"Background Blur\",defaultValue:8,min:0,max:20,step:1,unit:\"px\"},contentBackgroundColor:{type:ControlType.Color,title:\"Content Background\",defaultValue:\"#FFFFFF\"},contentAreaBackgroundColor:{type:ControlType.Color,title:\"Content Area Background\",defaultValue:\"transparent\"},contentBorderRadius:{type:ControlType.Number,title:\"Content Radius\",defaultValue:16,min:0,max:32,step:1,unit:\"px\"},contentMaxWidth:{type:ControlType.Number,title:\"Max Width\",defaultValue:600,min:200,max:1200,step:50,unit:\"px\"},border:{type:ControlType.Border,title:\"Border\",optional:true}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"PageOverlay\",\"slots\":[\"children\"],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerSupportedLayoutHeight\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./PageOverlay.map"],"mappings":"qQAMG,SAAwB,EAAY,EAAM,CAAC,GAAK,CAAC,WAAS,kBAAgB,aAAW,yBAAuB,sBAAoB,kBAAgB,WAAS,6BAA2B,UAAQ,EAAW,CAAC,EAAO,GAAWA,EAAS,GAAM,CAAC,MAAc,CAAI,GAAU,MAAoB,EAAU,GAAK,CAAC,EAAI,CAAC,EAAS,CAAC,CAC5T,MAAc,CAAC,GAAU,IAAS,OAA4E,MAA/D,GAAO,gBAAgB,CAAC,MAAoB,EAAU,GAAK,CAAC,MAAa,CAAC,OAAO,EAAO,cAAiB,EAAE,CAAC,CAAC,MAAc,CAAC,GAAU,IAAS,QAAa,EACrK,MAAtC,UAAS,KAAK,MAAM,SAAS,aAAmB,CAAC,SAAS,KAAK,MAAM,SAAS,UAAa,CAAC,EAAO,CAAC,CAAC,IAAM,MAAgB,CAAC,MAAoB,EAAU,GAAM,CAAC,EAAwG,OAAnB,EAAuC,EAAK,EAAgB,CAAC,SAAS,GAAqB,EAAK,EAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,WAAW,CAAC,SAAS,GAAG,CAAC,MAAM,CAAC,SAAS,QAAQ,IAAI,EAAE,KAAK,EAAE,MAAM,QAAQ,OAAO,SAAS,kBAAgB,eAAe,QAAQ,EAAW,KAAK,qBAAqB,QAAQ,EAAW,KAAK,QAAQ,OAAO,WAAW,SAAS,eAAe,SAAS,OAAO,KAAK,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