{"version":3,"file":"SitePasswordGate.goecpy1E.mjs","names":["useRef","useMemo","useState","useCallback"],"sources":["https:/framerusercontent.com/modules/3yIgsjFRWMXeqjgkzfj2/sG1H8ZT6osCTO9urccFC/SitePasswordGate.js"],"sourcesContent":["// User request: Create a self-contained Framer code component named SitePasswordGate that renders a fixed full-viewport accessible password overlay, blocks clicks/scrolling until correct password, remembers access via a single origin-wide localStorage key, exposes password control with default cvaccess2026, uses a minimal premium dark style, supports Enter submit with accessible label/error feedback, prevents pre-mount interaction flash, is canvas/SSR safe, and works as a tiny layer on every page while overlay stays fixed full-screen.\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useCallback,useEffect,useLayoutEffect,useMemo,useRef,useState,startTransition}from\"react\";import{createPortal}from\"react-dom\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";const AUTH_KEY=\"sitePasswordGate:originUnlocked:v1\";const BLOCKER_ID=\"site-password-gate-blocker\";/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function SitePasswordGate(props){const{password=\"cvaccess2026\"}=props;const overlayRef=useRef(null);const inputRef=useRef(null);const isCanvas=useMemo(()=>{try{return RenderTarget.current()===RenderTarget.canvas;}catch(error){return false;}},[]);const hasStoredAccess=useMemo(()=>{if(typeof window===\"undefined\")return false;try{return window.localStorage.getItem(AUTH_KEY)===\"1\";}catch(error){return false;}},[]);const[inputValue,setInputValue]=useState(\"\");const[errorMessage,setErrorMessage]=useState(\"\");const[isUnlocked,setIsUnlocked]=useState(hasStoredAccess);const shouldGate=!isCanvas&&typeof window!==\"undefined\"&&typeof document!==\"undefined\"&&!isUnlocked;if(shouldGate){const body=document.body;if(!body.hasAttribute(\"data-site-password-gate-blocking\")){body.setAttribute(\"data-site-password-gate-blocking\",\"true\");body.__sitePasswordGateOriginalOverflow=body.style.overflow||\"\";body.__sitePasswordGateOriginalVisibility=body.style.visibility||\"\";body.style.overflow=\"hidden\";body.style.visibility=\"hidden\";}let blocker=document.getElementById(BLOCKER_ID);if(!blocker){blocker=document.createElement(\"div\");blocker.id=BLOCKER_ID;blocker.setAttribute(\"aria-hidden\",\"true\");blocker.style.position=\"fixed\";blocker.style.inset=\"0\";blocker.style.background=\"rgba(5, 5, 6, 1)\";blocker.style.zIndex=\"2147483646\";blocker.style.pointerEvents=\"auto\";document.body.appendChild(blocker);}}const clearBlockingLayer=useCallback(()=>{if(typeof document===\"undefined\")return;const body=document.body;const blocker=document.getElementById(BLOCKER_ID);if(blocker)blocker.remove();if(body.hasAttribute(\"data-site-password-gate-blocking\")){body.removeAttribute(\"data-site-password-gate-blocking\");const originalOverflow=body.__sitePasswordGateOriginalOverflow||\"\";const originalVisibility=body.__sitePasswordGateOriginalVisibility||\"\";body.style.overflow=originalOverflow;body.style.visibility=originalVisibility||\"visible\";delete body.__sitePasswordGateOriginalOverflow;delete body.__sitePasswordGateOriginalVisibility;}},[]);useLayoutEffect(()=>{if(!shouldGate){clearBlockingLayer();return;}if(overlayRef.current&&typeof document!==\"undefined\"){document.body.style.visibility=\"visible\";}},[shouldGate,clearBlockingLayer]);useEffect(()=>{return()=>{clearBlockingLayer();};},[clearBlockingLayer]);useEffect(()=>{if(shouldGate&&inputRef.current){inputRef.current.focus();}},[shouldGate]);const unlock=useCallback(()=>{if(inputValue===password){try{if(typeof window!==\"undefined\"){window.localStorage.setItem(AUTH_KEY,\"1\");}}catch(error){}clearBlockingLayer();startTransition(()=>{setErrorMessage(\"\");setIsUnlocked(true);});return;}startTransition(()=>{setErrorMessage(\"Incorrect password. Please try again.\");setInputValue(\"\");});if(inputRef.current)inputRef.current.focus();},[inputValue,password,clearBlockingLayer]);const onSubmit=useCallback(event=>{event.preventDefault();unlock();},[unlock]);const overlay=useMemo(()=>{if(!shouldGate||typeof document===\"undefined\")return null;return /*#__PURE__*/createPortal(/*#__PURE__*/_jsx(\"div\",{ref:overlayRef,style:{position:\"fixed\",inset:0,zIndex:2147483647,background:\"rgba(7, 7, 8, 0.94)\",backdropFilter:\"blur(2px)\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",padding:\"24px\",pointerEvents:\"auto\"},children:/*#__PURE__*/_jsxs(\"div\",{role:\"dialog\",\"aria-modal\":\"true\",\"aria-labelledby\":\"site-password-gate-heading\",\"aria-describedby\":\"site-password-gate-support\",style:{width:\"100%\",maxWidth:\"360px\",background:\"#0F1012\",border:\"1px solid rgba(255,255,255,0.10)\",borderRadius:\"14px\",boxSizing:\"border-box\",padding:\"22px\",color:\"#FFFFFF\",fontFamily:\"Satoshi, Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif\"},children:[/*#__PURE__*/_jsx(\"h2\",{id:\"site-password-gate-heading\",style:{margin:0,fontSize:\"18px\",lineHeight:1.2,fontWeight:500,color:\"rgba(255,255,255,0.95)\"},children:\"Access Required\"}),/*#__PURE__*/_jsx(\"p\",{id:\"site-password-gate-support\",style:{margin:\"8px 0 16px 0\",fontSize:\"13px\",lineHeight:1.45,color:\"rgba(255,255,255,0.62)\"},children:\"Enter the password to continue.\"}),/*#__PURE__*/_jsxs(\"form\",{onSubmit:onSubmit,children:[/*#__PURE__*/_jsx(\"label\",{htmlFor:\"site-password-gate-input\",style:{position:\"absolute\",width:1,height:1,padding:0,margin:-1,overflow:\"hidden\",clip:\"rect(0, 0, 0, 0)\",whiteSpace:\"nowrap\",border:0},children:\"Password\"}),/*#__PURE__*/_jsx(\"input\",{id:\"site-password-gate-input\",ref:inputRef,type:\"password\",autoComplete:\"current-password\",value:inputValue,\"aria-invalid\":errorMessage?true:false,\"aria-describedby\":errorMessage?\"site-password-gate-error\":\"site-password-gate-support\",onChange:event=>{const nextValue=event.target.value;startTransition(()=>{setInputValue(nextValue);if(errorMessage)setErrorMessage(\"\");});},style:{width:\"100%\",height:\"40px\",borderRadius:\"10px\",border:\"1px solid rgba(255,255,255,0.14)\",background:\"rgba(255,255,255,0.04)\",color:\"#FFFFFF\",padding:\"0 12px\",boxSizing:\"border-box\",outline:\"none\",fontSize:\"14px\",fontFamily:\"Satoshi, Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif\"},placeholder:\"Password\"}),/*#__PURE__*/_jsx(\"p\",{id:\"site-password-gate-error\",role:\"alert\",\"aria-live\":\"assertive\",style:{margin:\"8px 0 0 0\",minHeight:\"18px\",fontSize:\"12px\",lineHeight:1.4,color:\"rgba(255, 119, 119, 0.95)\",visibility:errorMessage?\"visible\":\"hidden\"},children:errorMessage||\"Incorrect password. Please try again.\"}),/*#__PURE__*/_jsx(\"button\",{type:\"submit\",style:{marginTop:\"10px\",width:\"100%\",height:\"38px\",borderRadius:\"10px\",border:\"1px solid rgba(255,255,255,0.85)\",background:\"#FFFFFF\",color:\"#0A0A0A\",fontWeight:600,fontSize:\"13px\",cursor:\"pointer\",fontFamily:\"Satoshi, Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif\"},children:\"Submit\"})]})]})}),document.body);},[errorMessage,inputValue,onSubmit,shouldGate]);return /*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",width:\"100%\",height:\"100%\"},\"aria-hidden\":\"true\",children:overlay});}addPropertyControls(SitePasswordGate,{password:{type:ControlType.String,title:\"Password\",defaultValue:\"cvaccess2026\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SitePasswordGate\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any\",\"framerSupportedLayoutWidth\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SitePasswordGate.map"],"mappings":"yPAIG,SAAwB,EAAiB,EAAM,CAAC,GAAK,CAAC,WAAS,gBAAgB,EAAY,EAAWA,EAAO,IAAI,EAAQ,EAASA,EAAO,IAAI,EAAQ,EAASC,MAAY,CAAC,GAAG,CAAC,OAAO,EAAa,QAAQ,IAAI,EAAa,MAAO,MAAa,CAAC,MAAO,EAAM,CAAC,EAAE,CAAC,CA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