{"version":3,"file":"shared-lib.ffVVQ4Oc.mjs","names":["useState","useCallback","useMemo"],"sources":["https:/framerusercontent.com/modules/bryCKbbo47hVsPwv7JDB/eDjgwhNkfTQSlMC7XRxE/CookieConsentBanner.js","https:/framerusercontent.com/modules/kio4RPkbJr5Etsm2mbBi/mXKHKU5WRpKWwF2j3ASm/siteMetadata.js"],"sourcesContent":["// Request: Create a compact, accessible cookie-consent banner for the Climate Venture Exchange website that is fixed to the bottom of the viewport, persists consent via localStorage, does not return after selection/reload, matches dark navy styling with white text/subtle border/16px radius/green accent, includes configurable policy link, uses equal-weight accept/reject actions, stays responsive (horizontal on wide screens, stacked full-width on phones), and uses only React/Framer APIs.\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{startTransition,useCallback,useEffect,useMemo,useState}from\"react\";import{addPropertyControls,ControlType,Link}from\"framer\";const STORAGE_KEY=\"cvx-cookie-consent\";/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function CookieConsentBanner(props){const{title,message,acceptLabel,rejectLabel,policyLabel,policyPath,accentColor,surfaceColor,textColor,borderColor}=props;const[isVisible,setIsVisible]=useState(false);const[isPhone,setIsPhone]=useState(false);useEffect(()=>{if(typeof window!==\"undefined\"){try{const storedValue=window.localStorage.getItem(STORAGE_KEY);startTransition(()=>setIsVisible(storedValue===null));}catch(_error){startTransition(()=>setIsVisible(true));}}else{startTransition(()=>setIsVisible(false));}},[]);useEffect(()=>{if(typeof window!==\"undefined\"){const updateLayout=()=>{startTransition(()=>setIsPhone(window.innerWidth<640));};updateLayout();window.addEventListener(\"resize\",updateLayout);return()=>window.removeEventListener(\"resize\",updateLayout);}else{startTransition(()=>setIsPhone(false));}},[]);const saveChoice=useCallback(value=>{if(typeof window!==\"undefined\"){try{window.localStorage.setItem(STORAGE_KEY,value);}catch(_error){// Ignore storage failures and still dismiss.\n}}startTransition(()=>setIsVisible(false));},[]);const handleAccept=useCallback(()=>{saveChoice(\"accept_all\");},[saveChoice]);const handleReject=useCallback(()=>{saveChoice(\"reject_optional\");},[saveChoice]);const handlePolicyClick=useCallback(event=>{event.stopPropagation();const isModifiedClick=event.metaKey||event.altKey||event.ctrlKey||event.shiftKey||event.button!==0||event.currentTarget.target===\"_blank\";if(isModifiedClick)return;if(typeof window!==\"undefined\"){const rawPath=`${policyPath||\"\"}`.trim();if(!rawPath)return;try{const targetUrl=new URL(rawPath,window.location.href);const isInternalRoute=targetUrl.origin===window.location.origin;if(!isInternalRoute)return;event.preventDefault();const currentUrl=new URL(window.location.href);const isSameRoute=currentUrl.pathname===targetUrl.pathname&&currentUrl.search===targetUrl.search&&currentUrl.hash===targetUrl.hash;if(isSameRoute)return;window.history.pushState({},\"\",targetUrl.toString());window.dispatchEvent(new PopStateEvent(\"popstate\"));}catch(_error){window.location.assign(rawPath);}}},[policyPath]);const actionRowStyle=useMemo(()=>({display:\"flex\",flexDirection:isPhone?\"column\":\"row\",gap:8,width:isPhone?\"100%\":\"auto\",alignItems:\"stretch\",justifyContent:\"flex-end\",flexShrink:0}),[isPhone]);if(!isVisible)return /*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",width:\"100%\",height:\"100%\"}});return /*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",width:\"100%\",height:\"100%\",pointerEvents:\"none\",fontFamily:`\"IBM Plex Sans\",\"Inter\",\"Inter var\",system-ui,-apple-system,BlinkMacSystemFont,\"Segoe UI\",sans-serif`},children:/*#__PURE__*/_jsxs(\"aside\",{role:\"dialog\",\"aria-live\":\"polite\",\"aria-label\":title,style:{position:\"fixed\",left:16,right:16,bottom:16,margin:\"0 auto\",maxWidth:980,background:surfaceColor,color:textColor,border:`1px solid ${borderColor}`,borderRadius:16,boxSizing:\"border-box\",pointerEvents:\"auto\",zIndex:9999,padding:14,display:\"flex\",flexDirection:isPhone?\"column\":\"row\",alignItems:isPhone?\"stretch\":\"center\",gap:12},children:[/*#__PURE__*/_jsx(\"div\",{\"aria-hidden\":true,style:{width:isPhone?\"100%\":3,height:isPhone?3:\"100%\",minHeight:isPhone?3:44,borderRadius:999,background:accentColor,flexShrink:0}}),/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",flexDirection:\"column\",gap:6,flex:1,minWidth:0},children:[/*#__PURE__*/_jsx(\"p\",{style:{margin:0,fontSize:15,lineHeight:1.2,fontWeight:600,letterSpacing:\"-0.01em\"},children:title}),/*#__PURE__*/_jsx(\"p\",{style:{margin:0,fontSize:14,lineHeight:1.35,fontWeight:500,letterSpacing:\"-0.01em\",opacity:.95},children:message}),/*#__PURE__*/_jsx(Link,{href:policyPath,children:/*#__PURE__*/_jsx(\"a\",{href:policyPath,onClick:handlePolicyClick,style:{color:accentColor,fontSize:12,lineHeight:1.2,textDecoration:\"underline\",textUnderlineOffset:2,width:\"max-content\"},children:policyLabel})})]}),/*#__PURE__*/_jsxs(\"div\",{style:actionRowStyle,children:[/*#__PURE__*/_jsx(\"button\",{type:\"button\",onClick:handleReject,style:{appearance:\"none\",border:`1px solid ${borderColor}`,background:\"transparent\",color:textColor,borderRadius:10,height:38,padding:\"0 14px\",fontSize:13,fontWeight:600,letterSpacing:\"-0.01em\",cursor:\"pointer\",whiteSpace:\"nowrap\",width:isPhone?\"100%\":\"auto\"},children:rejectLabel}),/*#__PURE__*/_jsx(\"button\",{type:\"button\",onClick:handleAccept,style:{appearance:\"none\",border:`1px solid ${accentColor}`,background:accentColor,color:\"#00110A\",borderRadius:10,height:38,padding:\"0 14px\",fontSize:13,fontWeight:600,letterSpacing:\"-0.01em\",cursor:\"pointer\",whiteSpace:\"nowrap\",width:isPhone?\"100%\":\"auto\"},children:acceptLabel})]})]})});}addPropertyControls(CookieConsentBanner,{title:{type:ControlType.String,defaultValue:\"Cookie preferences\"},message:{type:ControlType.String,displayTextArea:true,defaultValue:\"We use essential cookies to keep the site working and optional analytics cookies to understand how it’s used. You can accept analytics cookies or continue with essential cookies only.\"},acceptLabel:{type:ControlType.String,defaultValue:\"Accept all cookies\"},rejectLabel:{type:ControlType.String,defaultValue:\"Reject optional cookies\"},policyLabel:{type:ControlType.String,defaultValue:\"Read privacy policy\"},policyPath:{type:ControlType.Link,defaultValue:\"/privacy\"},accentColor:{type:ControlType.Color,defaultValue:\"#4AC97A\"},surfaceColor:{type:ControlType.Color,defaultValue:\"#0B1530\"},textColor:{type:ControlType.Color,defaultValue:\"#FFFFFF\"},borderColor:{type:ControlType.Color,defaultValue:\"rgba(255,255,255,0.18)\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CookieConsentBanner\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CookieConsentBanner.map","// Generated by Framer (80f113d)\nexport default function metadata(params,activeLocale){return{description:\"A project funded through the Scottish Government Ecosystem fund designed to bridge the gap between climate tech ventures and the capital they need to grow.\",favicon:\"https://framerusercontent.com/assets/DbyLxCwyltemQSWoaPgkP57KfFw.png\",robots:\"max-image-preview:large\",title:\"Climate Venture Exchange\"};}export const metadataVersion=1;\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"metadataVersion\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],"mappings":"kOAIG,SAAwB,EAAoB,EAAM,CAAC,GAAK,CAAC,QAAM,UAAQ,cAAY,cAAY,cAAY,aAAW,cAAY,eAAa,YAAU,eAAa,EAAW,CAAC,EAAU,GAAcA,EAAS,EAAK,EAAO,CAAC,EAAQ,GAAYA,EAAS,EAAK,EAAE,MAAc,CAAC,GAAU,IAAS,OAAa,GAAG,CAAC,IAAM,EAAY,EAAO,aAAa,QAAQ,CAAW,EAAE,MAAoB,EAAa,I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