{"version":3,"file":"PasswordProtection.iEkWs7QH.mjs","names":["useState","_Fragment"],"sources":["https:/framerusercontent.com/modules/cbsEuQQRlXYQyzCkbtqJ/SGF2rSrrnrLdYZvIddE4/PasswordProtection.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";export function withPasswordProtection(Component){const correctPassword=\"adventure\"// Replace with your desired password\n;return function WithPasswordProtection(props){const[password,setPassword]=useState(\"\");const[showContent,setShowContent]=useState(false);const[showForm,setShowForm]=useState(false);useEffect(()=>{const userPassword=localStorage.getItem(\"userPassword\");if(userPassword===correctPassword){setShowContent(true);console.log(\"Password validation successful\");}else{console.log(\"Incorrect password\");}setShowForm(true);},[]);const handlePasswordChange=event=>{setPassword(event.target.value);};const handleSubmit=event=>{event.preventDefault();if(password===correctPassword){setShowContent(true);console.log(\"Password validation successful\");localStorage.setItem(\"userPassword\",password);}else{console.log(\"Incorrect password\");}};const formStyle={height:\"fit-content\",opacity:showForm?1:0,transition:\"opacity 1s ease\",width:\"100%\"};const inputStyle={padding:\"10px\",borderRadius:\"10px 0 0 10px\",border:\"1px solid #ccc\",borderRight:\"none\",fontSize:\"16px\",width:\"200px\",maxWidth:\"100%\",height:\"45px\",outline:\"none\"};const buttonStyle={padding:\"11px 20px\",borderRadius:\"0 10px 10px 0\",border:\"none\",background:\"#000\",color:\"#fff\",fontSize:\"16px\",cursor:\"pointer\",boxShadow:\"none\",height:\"45px\"};const wrapperStyle={boxShadow:\"rgba(0, 0, 0, 0.26) 0px 0.637473px 1.147451px -1.125px, rgba(0, 0, 0, 0.24) 0px 1.930942px 3.475695px -2.25px, rgba(0, 0, 0, 0.192) 0px 5.104227px 9.187608px -3.375px, rgba(0, 0, 0, 0.03) 0px 16px 28.8px -4.5px\",borderRadius:\"10px\",width:\"fit-content\"};const textStyle={display:\"block\",justifyContent:\"center\",alignItems:\"center\",height:\"fit-content\",opacity:showForm?1:0,transition:\"opacity 1s ease\",width:\"100%\",paddingBottom:\"20px\"};const paragraphStyle={fontWeight:\"bold\",fontSize:\"initial\",color:\"#595959\"};return /*#__PURE__*/_jsx(_Fragment,{children:showContent?/*#__PURE__*/_jsx(Component,{...props}):/*#__PURE__*/_jsxs(\"form\",{onSubmit:handleSubmit,style:formStyle,children:[/*#__PURE__*/_jsx(\"div\",{style:textStyle,children:/*#__PURE__*/_jsx(\"p\",{style:paragraphStyle,children:\"Enter the password provided by S3 to access your Adventure KBYG:\"})}),/*#__PURE__*/_jsxs(\"div\",{style:wrapperStyle,children:[/*#__PURE__*/_jsx(\"input\",{type:\"password\",placeholder:\"Enter password\",style:inputStyle,value:password,onChange:handlePasswordChange}),/*#__PURE__*/_jsx(\"button\",{type:\"submit\",style:buttonStyle,children:\"Submit\"})]})]})});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withPasswordProtection\":{\"type\":\"reactHoc\",\"name\":\"withPasswordProtection\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./PasswordProtection.map"],"mappings":"uIAAqH,SAAgB,EAAuB,EAAU,CAAC,IAAM,EAAgB,YAC5L,OAAO,SAAgC,EAAM,CAAC,GAAK,CAAC,EAAS,GAAaA,EAAS,EAAE,EAAO,CAAC,EAAY,GAAgBA,EAAS,EAAK,EAAO,CAAC,EAAS,GAAaA,EAAS,EAAK,EAA8gD,OAA5gD,MAAc,CAAoB,aAAa,QAAQ,cAA8B,IAAI,GAAiB,EAAe,EAAI,EAAE,QAAQ,IAAI,gCAAgC,GAAQ,QAAQ,IAAI,oBAAoB,EAAG,EAAY,EAAI,CAAE,EAAE,CAAC,CAAC,EAAozC,EAAKC,EAAU,CAAC,SAAS,EAAyB,EAAK,EAAU,CAAC,GAAG,CAAK,CAAC,EAAe,EAAM,OAAO,CAAC,SAAl0C,GAAO,CAAC,EAAM,eAAe,EAAK,IAAW,GAAiB,EAAe,EAAI,EAAE,QAAQ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