{"version":3,"file":"PasscodeGate.CpaaFhxO.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/87OTsi4OZM6ub06ta4hk/r054ohUoDT3fnz3rq5bO/PasscodeGate.js"],"sourcesContent":["/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n * @framerIntrinsicWidth 400\n * @framerIntrinsicHeight 400\n */// FRAMER CODE COMPONENT — overlay-style passcode gate. Place this as its\n// own layer ON TOP of your existing case-study content (pin it to fill the\n// frame/page). It shows a lock screen until the right passcode is entered,\n// then hides itself. NOTE: this does not remove your real content from the\n// page -- it's still there underneath, just visually covered, so a visitor\n// who inspects the page source/devtools can find it before unlocking. This\n// is a conscious, temporary tradeoff for speed; treat it as a stopgap.\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useState,useEffect}from\"react\";const REMEMBER_DAYS={\"1\":1,\"7\":7,\"14\":14,\"30\":30};function isFramerCanvas(){if(typeof window===\"undefined\")return false;return Boolean(window.FramerDesignTimeModeEnabled);}function storageKey(passcode){let hash=0;for(let i=0;i<passcode.length;i++){hash=hash*31+passcode.charCodeAt(i)|0;}return`protect_${hash}`;}function isUnlocked(passcode,remember){if(typeof window===\"undefined\"||!passcode)return false;if(remember===\"always\")return false;if(remember===\"session\"){return window.sessionStorage.getItem(storageKey(passcode))===\"1\";}const raw=window.localStorage.getItem(storageKey(passcode));if(!raw)return false;const expiry=parseInt(raw,10);return!isNaN(expiry)&&Date.now()<expiry;}function setUnlocked(passcode,remember){if(remember===\"always\")return;if(remember===\"session\"){window.sessionStorage.setItem(storageKey(passcode),\"1\");return;}const days=REMEMBER_DAYS[remember]??30;const ttlMs=days*24*60*60*1e3;window.localStorage.setItem(storageKey(passcode),String(Date.now()+ttlMs));}export default function PasscodeGate(props){const{enabled,passcode,remember,backgroundColor,copy,input,button,backLink}=props;const[unlocked,setUnlockedState]=useState(false);const[checked,setChecked]=useState(false);const[value,setValue]=useState(\"\");const[showError,setShowError]=useState(false);const[buttonHovered,setButtonHovered]=useState(false);const[backLinkHovered,setBackLinkHovered]=useState(false);useEffect(()=>{setUnlockedState(isUnlocked(passcode,remember));setChecked(true);},[passcode,remember]);// Never show the gate while designing in Framer itself.\nif(isFramerCanvas())return null;if(!enabled||!passcode)return null;if(checked&&unlocked)return null;function handleSubmit(e){e.preventDefault();if(value===passcode){setUnlocked(passcode,remember);setUnlockedState(true);setShowError(false);}else{setShowError(true);}}return /*#__PURE__*/_jsx(\"div\",{style:{position:\"fixed\",top:0,left:0,right:0,bottom:0,width:\"100%\",height:\"100%\",zIndex:9999,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",background:backgroundColor,fontFamily:\"-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif\"},children:/*#__PURE__*/_jsxs(\"form\",{onSubmit:handleSubmit,style:{width:\"100%\",maxWidth:340,padding:32,textAlign:\"center\"},children:[/*#__PURE__*/_jsx(\"h1\",{style:{margin:\"0 0 6px\",color:copy.headerFontColor,...copy.headerFont},children:copy.titleText}),/*#__PURE__*/_jsx(\"p\",{style:{margin:\"0 0 24px\",color:copy.subtitleFontColor,...copy.subtitleFont},children:copy.subtitleText}),showError&&/*#__PURE__*/_jsx(\"div\",{style:{color:\"#ff6b6b\",fontSize:13,marginBottom:14},children:button.errorText}),/*#__PURE__*/_jsx(\"input\",{type:\"password\",value:value,onChange:e=>setValue(e.target.value),autoFocus:true,style:{width:\"100%\",padding:\"14px 16px\",letterSpacing:4,textAlign:\"center\",border:`1px solid ${input.borderColor}`,borderRadius:10,background:input.backgroundColor,color:input.fontColor,marginBottom:14,boxSizing:\"border-box\",outline:\"none\",...input.font}}),/*#__PURE__*/_jsx(\"button\",{type:\"submit\",onMouseEnter:()=>setButtonHovered(true),onMouseLeave:()=>setButtonHovered(false),style:{width:\"100%\",padding:13,border:\"none\",borderRadius:10,cursor:\"pointer\",background:buttonHovered?button.colorHover:button.color,color:buttonHovered?button.fontColorHover:button.fontColor,transition:\"background-color .15s ease, color .15s ease\",...button.font},children:button.text}),backLink.enabled&&backLink.text&&/*#__PURE__*/_jsx(\"a\",{href:backLink.href||\"/\",onMouseEnter:()=>setBackLinkHovered(true),onMouseLeave:()=>setBackLinkHovered(false),style:{display:\"inline-block\",marginTop:backLink.marginTop,color:backLinkHovered?backLink.fontColorHover:backLink.fontColor,textDecoration:backLink.underline===\"always\"||backLink.underline===\"hover\"&&backLinkHovered?\"underline\":\"none\",textUnderlineOffset:`${backLink.underlineOffset}px`,cursor:\"pointer\",transition:\"color .15s ease\",...backLink.font},children:backLink.text})]})});}addPropertyControls(PasscodeGate,{enabled:{type:ControlType.Boolean,title:\"Gated\",enabledTitle:\"Yes\",disabledTitle:\"No\",defaultValue:true},passcode:{type:ControlType.String,title:\"Passcode\",placeholder:\"Type a passcode\",defaultValue:\"\"},remember:{type:ControlType.Enum,title:\"Remember Me\",options:[\"always\",\"session\",\"1\",\"7\",\"14\",\"30\"],optionTitles:[\"Every page load\",\"Until browser closed\",\"1 day\",\"7 days\",\"14 days\",\"30 days\"],defaultValue:\"30\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#11190C\"},copy:{type:ControlType.Object,title:\"Copy\",controls:{titleText:{type:ControlType.String,title:\"Title\",defaultValue:\"Private Case Study\"},headerFont:{type:ControlType.Font,title:\"Header Font\",controls:\"extended\",defaultValue:{fontFamily:\"PP Agrandir\",fontWeight:700,fontSize:\"24px\",lineHeight:\"1.35em\",letterSpacing:\"0em\"}},headerFontColor:{type:ControlType.Color,title:\"Header Color\",defaultValue:\"#ffffff\"},subtitleText:{type:ControlType.String,title:\"Subtitle\",defaultValue:\"This project is under NDA — enter the passcode I shared with you.\"},subtitleFont:{type:ControlType.Font,title:\"Subtitle Font\",controls:\"extended\",defaultValue:{fontFamily:\"Inter\",fontWeight:400,fontSize:\"16px\",lineHeight:\"1.5em\",letterSpacing:\"0em\"}},subtitleFontColor:{type:ControlType.Color,title:\"Subtitle Color\",defaultValue:\"#ffffff\"}}},input:{type:ControlType.Object,title:\"Input\",controls:{backgroundColor:{type:ControlType.Color,title:\"Color\",defaultValue:\"#11190C\"},borderColor:{type:ControlType.Color,title:\"Line\",defaultValue:\"#F3F1EE\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultValue:{fontFamily:\"Inter\",fontWeight:400,fontSize:\"18px\",lineHeight:\"1em\",letterSpacing:\"0em\"}},fontColor:{type:ControlType.Color,title:\"Font Color\",defaultValue:\"#F3F1EE\"}}},button:{type:ControlType.Object,title:\"Button\",controls:{text:{type:ControlType.String,title:\"Text\",defaultValue:\"Unlock\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultValue:{fontFamily:\"PP Agrandir\",fontWeight:700,fontSize:\"18px\",lineHeight:\"1.35em\",letterSpacing:\"0em\"}},fontColor:{type:ControlType.Color,title:\"Font Color\",defaultValue:\"#11190C\"},fontColorHover:{type:ControlType.Color,title:\"Font Color Hover\",defaultValue:\"#11190C\"},color:{type:ControlType.Color,title:\"Color\",defaultValue:\"#F3F1EE\"},colorHover:{type:ControlType.Color,title:\"Color Hover\",defaultValue:\"#DCFD00\"},errorText:{type:ControlType.String,title:\"Error\",defaultValue:\"Incorrect passcode — try again.\"}}},backLink:{type:ControlType.Object,title:\"Back Link\",controls:{enabled:{type:ControlType.Boolean,title:\"Show\",enabledTitle:\"Yes\",disabledTitle:\"No\",defaultValue:true},text:{type:ControlType.String,title:\"Text\",defaultValue:\"← Back to homepage\"},href:{type:ControlType.String,title:\"URL\",defaultValue:\"/\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultValue:{fontFamily:\"Inter\",fontWeight:400,fontSize:\"14px\",lineHeight:\"1.4em\",letterSpacing:\"0em\"}},fontColor:{type:ControlType.Color,title:\"Font Color\",defaultValue:\"#F3F1EE\"},fontColorHover:{type:ControlType.Color,title:\"Font Color Hover\",defaultValue:\"#DCFD00\"},underline:{type:ControlType.Enum,title:\"Underline\",options:[\"always\",\"hover\"],optionTitles:[\"Always\",\"On hover only\"],defaultValue:\"always\"},underlineOffset:{type:ControlType.Number,title:\"Underline Gap\",min:0,max:20,step:1,defaultValue:4,unit:\"px\"},marginTop:{type:ControlType.Number,title:\"Distance From Button\",min:0,max:120,step:1,defaultValue:20,unit:\"px\"}}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"PasscodeGate\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./PasscodeGate.map"],"mappings":"4LAYqM,SAAS,GAAgB,CAA6C,OAAlC,IAAS,QAAgC,EAAQ,EAAO,2BAA6B,CAAC,SAAS,EAAW,EAAS,CAAC,IAAI,EAAK,EAAE,IAAI,IAAI,EAAE,EAAE,EAAE,EAAS,OAAO,IAAK,EAAK,EAAK,GAAG,EAAS,WAAW,CAAC,EAAE,EAAG,MAAM,WAAW,GAAO,CAAC,SAAS,EAAW,EAAS,EAAS,CAAwD,GAA7C,IAAS,QAAa,CAAC,GAAyB,IAAW,SAAS,MAAO,GAAM,GAAG,IAAW,UAAW,OAAO,EAAO,eAAe,QAAQ,EAAW,CAAQ,CAAC,IAAI,IAAK,IAAM,EAAI,EAAO,aAAa,QAAQ,EAAW,CAAQ,CAAC,EAAE,GAAG,CAAC,EAAI,MAAO,GAAM,IAAM,EAAO,SAAS,EAAI,EAAE,EAAE,MAAM,CAAC,MAAM,CAAM,GAAG,KAAK,IAAI,EAAE,CAAO,CAAC,SAAS,EAAY,EAAS,EAAS,CAAC,GAAG,IAAW,SAAS,OAAO,GAAG,IAAW,UAAU,CAAC,EAAO,eAAe,QAAQ,EAAW,CAAQ,EAAE,GAAG,EAAE,MAAO,CAAwC,IAAM,GAAlC,EAAc,IAAW,IAAoB,GAAG,GAAG,GAAG,IAAI,EAAO,aAAa,QAAQ,EAAW,CAAQ,EAAE,OAAO,KAAK,IAAI,EAAE,CAAK,C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