{"version":3,"file":"Password_Auth.CPdvaU8F.mjs","names":["useState","useRef"],"sources":["https:/framerusercontent.com/modules/mo1CoI148YCloIemGnhc/CDRuNTEj25wsn2eR0Ivz/Password_Auth.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useRef,useState}from\"react\";const SESSION_KEY=\"framer_auth_session\";const ALLOWED_PASSWORDS=[\"muppetlabs\",\"MUPPETLABS\",\"MuppetLabs\"];const RETURN_URL=\"https://www.yvonnedollux.com/work\";/**\n * @framerDisableUnlink\n */export function requireAuth(Component){return function Authenticated(props){const[authenticated,setAuthenticated]=useState(false);const[showPassword,setShowPassword]=useState(false);const[errorMessage,setErrorMessage]=useState(\"\");const[loading,setLoading]=useState(true);const passwordRef=useRef(null);useEffect(()=>{const ok=typeof window!==\"undefined\"&&localStorage.getItem(SESSION_KEY)===\"authenticated\";setAuthenticated(Boolean(ok));setLoading(false);if(!ok)passwordRef.current?.focus();},[]);const validateAuth=e=>{e.preventDefault();const form=e.currentTarget;const input=form.elements.namedItem(\"password\");if(ALLOWED_PASSWORDS.includes(input.value)){setAuthenticated(true);localStorage.setItem(SESSION_KEY,\"authenticated\");setErrorMessage(\"\");}else{setAuthenticated(false);setErrorMessage(\"Incorrect passcode. Please try again.\");}input.value=\"\";};if(loading)return null;if(!authenticated){return /*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",flexDirection:\"column\",alignItems:\"center\",justifyContent:\"center\",minHeight:\"100vh\",backgroundColor:\"#f7fcf8\",fontFamily:\"Inter Display, sans-serif\",color:\"#242424\",padding:12},children:[/*#__PURE__*/_jsx(\"img\",{src:\"https://framerusercontent.com/images/TxsO4sIH7QejFEX6BAMoxoq05i0.svg\",alt:\"Logo\",style:{width:80,height:\"auto\",marginBottom:12}}),/*#__PURE__*/_jsx(\"h1\",{style:{fontSize:37,fontWeight:700,fontFamily:\"Blitarian Liberty, sans-serif\",marginBottom:8},children:\"PRIVATE CONTENT\"}),/*#__PURE__*/_jsxs(\"p\",{style:{fontSize:13,lineHeight:1.6,maxWidth:400},children:[\"This one's under wraps—just to keep my client's confidential work safe and sound.\",\" \",/*#__PURE__*/_jsx(\"a\",{href:\"mailto:hello@ydoll.me?subject=Portfolio%20Password%20Request\",style:{color:\"#000\",textDecoration:\"underline\"},children:\"Request a password↗\"})]}),/*#__PURE__*/_jsxs(\"form\",{onSubmit:validateAuth,style:{width:\"100%\",maxWidth:400,marginTop:24},children:[/*#__PURE__*/_jsxs(\"div\",{style:{position:\"relative\"},children:[/*#__PURE__*/_jsx(\"input\",{type:showPassword?\"text\":\"password\",name:\"password\",ref:passwordRef,autoComplete:\"new-password\",style:{width:\"100%\",fontSize:16,padding:12,paddingRight:56,border:errorMessage?\"1px solid #D8512A\":\"1px solid #CCCCCC\",borderRadius:8,outline:\"none\"}}),/*#__PURE__*/_jsx(\"button\",{type:\"button\",onClick:()=>setShowPassword(v=>!v),style:{position:\"absolute\",right:12,top:\"50%\",transform:\"translateY(-50%)\",background:\"none\",border:\"none\",cursor:\"pointer\"},children:showPassword?\"Hide\":\"Show\"})]}),errorMessage?/*#__PURE__*/_jsx(\"p\",{style:{color:\"#D8512A\",marginTop:12,fontSize:14},children:errorMessage}):null,/*#__PURE__*/_jsx(\"button\",{type:\"submit\",style:{width:\"100%\",padding:12,marginTop:24,fontSize:20,color:\"#fff\",backgroundColor:\"#242424\",border:\"none\",borderRadius:8,cursor:\"pointer\"},children:\"Unlock\"})]}),/*#__PURE__*/_jsx(\"button\",{onClick:()=>{if(typeof window!==\"undefined\"){window.location.href=RETURN_URL;}},style:{marginTop:48,background:\"none\",border:\"none\",cursor:\"pointer\",fontSize:14,color:\"#242424\"},children:\"Return to Projects\"})]});}return /*#__PURE__*/_jsx(Component,{...props});};}\nexport const __FramerMetadata__ = {\"exports\":{\"requireAuth\":{\"type\":\"reactHoc\",\"name\":\"requireAuth\",\"annotations\":{\"framerDisableUnlink\":\"\",\"framerContractVersion\":\"1\"}},\"__Fram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