{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/ju2ISRnQv7ewDFX8PhkF/eTKYiGGR3wkGN6A8LPfB/PasswordProtectionNotRemembered.js"],
  "sourcesContent": ["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";const sha256=str=>{const encoder=new TextEncoder;const data=encoder.encode(str);return crypto.subtle.digest(\"SHA-256\",data).then(hashArray=>{const hashHex=Array.from(new Uint8Array(hashArray)).map(byte=>byte.toString(16).padStart(2,\"0\")).join(\"\");return hashHex;});};export function withPasswordProtection(Component){const hashedCorrectPassword=\"ccf39d6d51abe7a8d6befe50b85d723e84429ca4f7a1350fc644bb78b1d5993a\"// Encrypt your desired password using this link https://workat.tech/developer-tools/sha256-hash-generator than replace its value above, do not remove the double quotes\n;return function WithPasswordProtection(props){const[password,setPassword]=useState(\"\");const[showContent,setShowContent]=useState(false);const[showForm,setShowForm]=useState(false);useEffect(()=>{setShowForm(true);},[]);const handleSubmit=async event=>{event.preventDefault();const hashedPassword=await sha256(password);if(hashedPassword===hashedCorrectPassword){setShowContent(true);console.log(\"Password validation successful\");}else{console.log(\"Incorrect password\");}};const formStyle={display:\"flex\",justifyContent:\"center\",alignItems:\"center\",height:\"100vh\",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\",\nbackground:\"#2C714C\",//color: \"#fff\",\ncolor:\"#F7F7F7\",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\"};return /*#__PURE__*/_jsx(_Fragment,{children:showContent?/*#__PURE__*/_jsx(Component,{...props}):/*#__PURE__*/_jsx(\"form\",{onSubmit:handleSubmit,style:formStyle,children:/*#__PURE__*/_jsxs(\"div\",{style:wrapperStyle,children:[/*#__PURE__*/_jsx(\"input\",{type:\"password\",placeholder:\"Enter password\",style:inputStyle,value:password,onChange:e=>setPassword(e.target.value)}),/*#__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=./PasswordProtectionNotRemembered.map"],
  "mappings": "uGAAqH,IAAMA,EAAOC,GAAK,CAA+B,IAAMC,EAAtB,IAAI,cAA+B,OAAOD,CAAG,EAAE,OAAO,OAAO,OAAO,OAAO,UAAUC,CAAI,EAAE,KAAKC,GAA0B,MAAM,KAAK,IAAI,WAAWA,CAAS,CAAC,EAAE,IAAIC,GAAMA,EAAK,SAAS,EAAE,EAAE,SAAS,EAAE,GAAG,CAAC,EAAE,KAAK,EAAE,CAAkB,CAAE,EAAS,SAASC,EAAuBC,EAAU,CAAC,IAAMC,EAAsB,mEAC7c,OAAO,SAAgCC,EAAM,CAAC,GAAK,CAACC,EAASC,CAAW,EAAEC,EAAS,EAAE,EAAO,CAACC,EAAYC,CAAc,EAAEF,EAAS,EAAK,EAAO,CAACG,EAASC,CAAW,EAAEJ,EAAS,EAAK,EAAE,OAAAK,EAAU,IAAI,CAACD,EAAY,EAAI,CAAE,EAAE,CAAC,CAAC,EAEkJE,EAAKC,EAAU,CAAC,SAASN,EAAyBK,EAAKX,EAAU,CAAC,GAAGE,CAAK,CAAC,EAAeS,EAAK,OAAO,CAAC,SAFpO,MAAME,GAAO,CAACA,EAAM,eAAe,EAAuB,MAAMnB,EAAOS,CAAQ,IAAsBF,GAAuBM,EAAe,EAAI,EAAE,QAAQ,IAAI,gCAAgC,GAAQ,QAAQ,IAAI,oBAAoB,CAAG,EAEkB,MAFA,CAAC,QAAQ,OAAO,eAAe,SAAS,WAAW,SAAS,OAAO,QAAQ,QAAQC,EAAS,EAAE,EAAE,WAAW,kBAAkB,MAAM,MAAM,EAEzH,SAAsBM,EAAM,MAAM,CAAC,MAAzb,CAAC,UAAU,qNAAqN,aAAa,MAAM,EAAyN,SAAS,CAAcH,EAAK,QAAQ,CAAC,KAAK,WAAW,YAAY,iBAAiB,MAFI,CAAC,QAAQ,OAAO,aAAa,gBAAgB,OAAO,iBAAiB,YAAY,OAAO,SAAS,OAAO,MAAM,QAAQ,SAAS,OAAO,OAAO,OAAO,QAAQ,MAAM,EAErJ,MAAMR,EAAS,SAASY,GAAGX,EAAYW,EAAE,OAAO,KAAK,CAAC,CAAC,EAAeJ,EAAK,SAAS,CAAC,KAAK,SAAS,MAFsE,CAAC,QAAQ,YAAY,aAAa,gBAAgB,OAAO,OACr3B,WAAW,UACX,MAAM,UAAU,SAAS,OAAO,OAAO,UAAU,UAAU,OAAO,OAAO,MAAM,EAAyrB,SAAS,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAE,CAAE",
  "names": ["sha256", "str", "data", "hashArray", "byte", "withPasswordProtection", "Component", "hashedCorrectPassword", "props", "password", "setPassword", "ye", "showContent", "setShowContent", "showForm", "setShowForm", "ue", "p", "l", "event", "u", "e"]
}
