{"version":3,"file":"Passwordprotect.ByPZEG1m.mjs","names":["useState","EyeSlash","Eye"],"sources":["https:/framerusercontent.com/modules/tiyvBQN4QX6XI6IDAJhI/nRWdbfdB0jNQPEB31fFH/Passwordprotect.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";import{Eye,EyeSlash}from\"phosphor-react\";const brandColor=\"#0CB3B3\";const PASSWORDS=[\"ak123\",\"password2\"];const LOCAL_STORAGE_KEY=\"authenticated\";export function withPasswordProtection(Component){return props=>{const[authenticated,setAuthenticated]=useState(false);const[showPassword,setShowPassword]=useState(false);useEffect(()=>{const isAuthenticated=localStorage.getItem(LOCAL_STORAGE_KEY);if(isAuthenticated===\"true\"){setAuthenticated(true);}},[]);const handlePasswordSubmit=e=>{e.preventDefault();const inputPassword=e.target.elements.password.value;if(PASSWORDS.includes(inputPassword)){setAuthenticated(true);localStorage.setItem(LOCAL_STORAGE_KEY,\"true\");}else{alert(\"Incorrect password\");}};if(!authenticated){return /*#__PURE__*/_jsx(\"div\",{style:{display:\"flex\",justifyContent:\"center\",alignItems:\"center\",height:\"100vh\",flexDirection:\"column\"},children:/*#__PURE__*/_jsxs(\"form\",{onSubmit:handlePasswordSubmit,style:{display:\"flex\",flexDirection:\"column\",width:\"250px\",gap:\"10px\",position:\"relative\"},children:[/*#__PURE__*/_jsx(\"label\",{style:{fontSize:\"16px\",color:\"white\"},children:\"Password:\"}),/*#__PURE__*/_jsxs(\"div\",{style:{position:\"relative\",display:\"flex\",alignItems:\"center\"},children:[/*#__PURE__*/_jsx(\"input\",{type:showPassword?\"text\":\"password\",name:\"password\",style:{padding:\"12px\",fontSize:\"16px\",borderRadius:\"4px\",border:\"1px solid #ccc\",width:\"100%\"}}),/*#__PURE__*/_jsx(\"button\",{type:\"button\",onClick:()=>setShowPassword(!showPassword),style:{position:\"absolute\",right:\"10px\",background:\"none\",border:\"none\",cursor:\"pointer\"},children:showPassword?/*#__PURE__*/_jsx(EyeSlash,{size:20,color:brandColor,weight:\"bold\"}):/*#__PURE__*/_jsx(Eye,{size:20,color:brandColor,weight:\"bold\"})})]}),/*#__PURE__*/_jsx(\"button\",{type:\"submit\",style:{padding:\"8px\",fontSize:\"16px\",fontFamily:\"Geist\",borderRadius:\"4px\",border:\"none\",backgroundColor:brandColor,color:\"white\",cursor:\"pointer\"},children:\"Submit\"}),/*#__PURE__*/_jsx(\"label\",{style:{fontSize:\"16px\",color:\"#757575\"},children:\"If you're a recruiter, you'll find the password on my resume.\"})]})});}return /*#__PURE__*/_jsx(Component,{...props});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withPasswordProtection\":{\"type\":\"reactHoc\",\"name\":\"withPasswordProtection\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Passwordprotect.map"],"mappings":"2LAAiP,SAAgB,EAAuB,EAAU,CAAC,MAAO,IAAO,CAAC,GAAK,CAAC,EAAc,GAAkBA,EAAS,GAAM,CAAM,CAAC,EAAa,GAAiBA,EAAS,GAAM,CAAouD,OAAnuD,MAAc,CAAuB,aAAa,QAAQ,EAAkB,GAAsB,QAAQ,EAAiB,GAAK,EAAI,EAAE,CAAC,CAA6P,EAAm3C,EAAK,EAAU,CAAC,GAAG,EAAM,CAAC,CAA12C,EAAK,MAAM,CAAC,MAAM,CAAC,QAAQ,OAAO,eAAe,SAAS,WAAW,SAAS,OAAO,QAAQ,cAAc,SAAS,CAAC,SAAsB,EAAM,OAAO,CAAC,SAA7Z,GAAG,CAAC,EAAE,gBAAgB,CAAC,IAAM,EAAc,EAAE,OAAO,SAAS,SAAS,MAAS,EAAU,SAAS,EAAc,EAAE,EAAiB,GAAK,CAAC,aAAa,QAAQ,EAAkB,OAAO,EAAO,MAAM,qBAAqB,EAAkO,MAAM,CAAC,QAAQ,OAAO,cAAc,SAAS,MAAM,QAAQ,IAAI,OAAO,SAAS,WAAW,CAAC,SAAS,C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