{"version":3,"file":"OverlayProvider.DR2GoP4K.mjs","names":["useContext","useState"],"sources":["https:/framerusercontent.com/modules/AVJUiPSu4vPLRPD6ToOy/A9QUr4MYxJZCJrpzWhwg/OverlayProvider.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{createContext,forwardRef,useContext,useEffect,useState}from\"react\";import{ControlType,addPropertyControls}from\"framer\";const OverlayContext=/*#__PURE__*/createContext(undefined);const disableScroll=()=>{if(typeof document!==\"undefined\"){document.querySelector(\"html\").style.overflow=\"hidden\";}};const enableScroll=()=>{if(typeof document!==\"undefined\"){document.querySelector(\"html\").style.overflow=\"auto\";}};export function useOverlay(){const context=useContext(OverlayContext);if(context===undefined){throw new Error(\"useOverlay must be used within a OverlayProvider\");}return context;}export function withProvider(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const[isOpen,setIsOpen]=useState(false);useEffect(()=>{if(isOpen){disableScroll();}else{enableScroll();}},[isOpen]);return /*#__PURE__*/_jsx(OverlayContext.Provider,{value:{isOpen,setIsOpen},children:/*#__PURE__*/_jsx(Component,{ref:ref,...props})});});}export function withZIndexBoost(Component){return /*#__PURE__*/forwardRef((props,ref)=>{props.className+=\" ingredients-popup\";return /*#__PURE__*/_jsx(Component,{ref:ref,...props});});}export function withWidthControl(Component){return /*#__PURE__*/forwardRef((props,ref)=>{props.className+=\" ingredients-popup-card\";return /*#__PURE__*/_jsx(Component,{ref:ref,...props});});}export function overlayOpen(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const{setIsOpen}=useOverlay();const handleOpenOverlay=()=>{setIsOpen(true);};return /*#__PURE__*/_jsx(Component,{ref:ref,onClick:handleOpenOverlay,...props});});}export function OverlayClose(){const{setIsOpen}=useOverlay();const handleCloseOverlay=()=>{setIsOpen(false);};return /*#__PURE__*/_jsx(\"div\",{onClick:handleCloseOverlay,style:{padding:\"0.75rem\"},children:/*#__PURE__*/_jsx(\"svg\",{xmlns:\"http://www.w3.org/2000/svg\",viewBox:\"0 0 256 256\",focusable:\"false\",color:\"rgb(26, 26, 26)\",style:{display:\"block\",margin:\"0\",userSelect:\"none\",width:\"1.5rem\",height:\"1.5rem\",fill:\"rgb(26, 26, 26)\",color:\"rgb(26, 26, 26)\"},children:/*#__PURE__*/_jsx(\"g\",{color:\"rgb(26, 26, 26)\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z\"})})})});}export default function OverlayComponent(props){const{isOpen,setIsOpen}=useOverlay();useEffect(()=>{if(typeof window!==\"undefined\"){const params=new URLSearchParams(window.location.search);if(params.get(\"ingredients\")===\"true\"){setIsOpen(true);}}},[setIsOpen]);const handleCloseOverlay=()=>{setIsOpen(false);};if(!isOpen)return /*#__PURE__*/_jsx(\"div\",{style:{display:\"none\"}});return /*#__PURE__*/_jsxs(\"div\",{style:{minHeight:\"100vh\",width:\"100%\",position:\"fixed\",zIndex:99,top:0,left:0,pointerEvents:\"auto\"},children:[/*#__PURE__*/_jsx(\"div\",{onClick:handleCloseOverlay,style:{position:\"absolute\",inset:0,background:\"rgba(0, 0, 0, 0.2)\"}}),/*#__PURE__*/_jsx(\"style\",{children:`\n            @media only screen and (max-width: 516px){\n                .popup_card{\n                    left: 0 !important;\n                }\n            }\n            `}),/*#__PURE__*/_jsx(\"div\",{className:\"popup_card\",style:{position:\"absolute\",right:0,top:0,bottom:0,height:\"100%\",display:\"flex\",alignItems:\"stretch\",justifyContent:\"flex-end\",overflow:\"auto\"},children:props.children})]});}addPropertyControls(OverlayComponent,{children:{type:ControlType.ComponentInstance,title:\"Children\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"withWidthControl\":{\"type\":\"reactHoc\",\"name\":\"withWidthControl\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"overlayOpen\":{\"type\":\"reactHoc\",\"name\":\"overlayOpen\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useOverlay\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"OverlayClose\":{\"type\":\"reactComponent\",\"name\":\"OverlayClose\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"withZIndexBoost\":{\"type\":\"reactHoc\",\"name\":\"withZIndexBoost\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withProvider\":{\"type\":\"reactHoc\",\"name\":\"withProvider\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"default\":{\"type\":\"reactComponent\",\"name\":\"OverlayComponent\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./OverlayProvider.map"],"mappings":"uNAAyd,SAAgB,GAAY,CAAC,IAAM,EAAQA,EAAW,EAAe,CAAC,GAAG,IAAU,IAAA,GAAW,MAAU,MAAM,mDAAmD,CAAE,OAAO,EAAS,SAAgB,EAAa,EAAU,CAAC,OAAoB,GAAY,EAAM,IAAM,CAAC,GAAK,CAAC,EAAO,GAAWC,EAAS,GAAM,CAA6E,OAA5E,MAAc,CAAI,EAAQ,GAAe,CAAO,GAAc,EAAI,CAAC,EAAO,CAAC,CAAqB,EAAK,EAAe,SAAS,CAAC,MAAM,CAAC,SAAO,YAAU,CAAC,SAAsB,EAAK,EAAU,CAAK,MAAI,GAAG,EAAM,CAAC,CAAC,CAAC,EAAG,CAAE,SAAgB,EAAgB,EAAU,CAAC,OAAoB,GAAY,EAAM,KAAO,EAAM,WAAW,qBAAyC,EAAK,EAAU,CAAK,MAAI,GAAG,EAAM,CAAC,EAAG,CAAE,SAAgB,EAAiB,EAAU,CAAC,OAAoB,GAAY,EAAM,KAAO,EAAM,WAAW,0BAA8C,EAAK,EAAU,CAAK,MAAI,GAAG,EAAM,CAAC,EAAG,CAAwP,SAAgB,GAAc,CAAC,GAAK,CAAC,aAAW,GAAY,CAAkD,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