{"version":3,"file":"Password_Gate.BP7_BF_W.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/jeQwYmPjyEdIpJDBSXqu/9ewE9OriI97MpT80RvbU/Password_Gate.js"],"sourcesContent":["/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState}from\"react\";import{motion}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";export default function PasswordGate(props){const{accessKey,title,subtitle,hint,footerText,overlayColor,inputBg,inputTextColor,inputPlaceholder,buttonText,buttonBg,buttonTextColor,errorColor,redirectURL,darkMode}=props;const[enteredKey,setEnteredKey]=useState(\"\");const[isUnlocked,setIsUnlocked]=useState(false);const[error,setError]=useState(\"\");// Show only in Preview/Live\nconst isFramerEditor=()=>{if(typeof window===\"undefined\")return false;if(window.FramerDesignTimeModeEnabled!==undefined)return true;if(window.Framer?.CurrentContext?.isDesignTime)return true;if(document?.documentElement?.hasAttribute(\"data-framer-preview-mode\"))return false;const url=window.location.href;return url.includes(\"framer.com\")&&!url.includes(\"/preview\");};if(isFramerEditor())return null;const validateAccess=()=>{if(enteredKey===accessKey){setIsUnlocked(true);}else{setError(\"*Incorrect password. Please try again.\");setEnteredKey(\"\");}};if(isUnlocked)return null;const isDark=darkMode;const cardBg=isDark?\"#121212\":\"#ffffff\";const textColor=isDark?\"#f5f5f5\":\"#000000\";const footerColor=isDark?\"#999999\":\"#666666\";return /*#__PURE__*/_jsxs(\"div\",{style:{position:\"fixed\",inset:0,display:\"flex\",flexDirection:\"column\",alignItems:\"center\",justifyContent:\"center\",padding:20,zIndex:9999,backgroundColor:overlayColor,fontFamily:\"Montserrat, sans-serif\"},children:[/*#__PURE__*/_jsxs(motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.4},style:{maxWidth:480,width:\"100%\",backgroundColor:cardBg,borderRadius:12,padding:24,boxShadow:\"0 8px 40px rgba(0,0,0,0.1)\",display:\"flex\",flexDirection:\"column\",gap:16,color:textColor},children:[/*#__PURE__*/_jsx(\"h2\",{style:{fontSize:18,fontWeight:600,margin:0},children:title}),/*#__PURE__*/_jsx(\"p\",{style:{fontSize:14,margin:0,lineHeight:1.6,opacity:.9},children:subtitle}),/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",gap:8,flexWrap:\"wrap\"},children:[/*#__PURE__*/_jsx(\"input\",{type:\"password\",value:enteredKey,onChange:e=>setEnteredKey(e.target.value),onKeyDown:e=>e.key===\"Enter\"&&validateAccess(),placeholder:inputPlaceholder,style:{flex:1,padding:\"10px 14px\",fontSize:14,borderRadius:6,border:\"none\",backgroundColor:inputBg,color:inputTextColor,fontFamily:\"inherit\"}}),/*#__PURE__*/_jsx(\"button\",{onClick:validateAccess,style:{padding:\"10px 20px\",fontSize:14,borderRadius:6,border:\"none\",backgroundColor:buttonBg,color:buttonTextColor,cursor:\"pointer\",fontWeight:500,fontFamily:\"inherit\"},children:buttonText})]}),error&&/*#__PURE__*/_jsx(\"p\",{style:{fontSize:13,color:errorColor,margin:0},children:error}),hint&&/*#__PURE__*/_jsxs(\"p\",{style:{fontSize:13,opacity:.6,margin:0},children:[\"Hint: \",hint]}),/*#__PURE__*/_jsx(\"hr\",{style:{border:\"none\",borderTop:isDark?\"1px solid #333\":\"1px solid #eee\",margin:0}}),/*#__PURE__*/_jsx(\"p\",{style:{fontSize:12,color:footerColor,margin:0,lineHeight:1.6},children:footerText})]}),redirectURL&&/*#__PURE__*/_jsx(\"button\",{onClick:()=>window.location.href=redirectURL,style:{marginTop:16,fontSize:12,textDecoration:\"underline\",background:\"none\",border:\"none\",color:\"#555\",cursor:\"pointer\",fontFamily:\"inherit\"},children:\"Close\"})]});}PasswordGate.defaultProps={accessKey:\"secret123\",title:\"Access Required\",subtitle:\"This case study is protected due to confidentiality agreements and is intended only for professional viewing.\",hint:\"\",footerText:\"To request access, please email XYZ@gmail.com – I usually respond within 90min unless I’m asleep.\",overlayColor:\"rgba(255, 255, 255, 0.85)\",inputBg:\"#f1f1f1\",inputTextColor:\"#000000\",inputPlaceholder:\"Enter access key\",buttonText:\"Unlock\",buttonBg:\"#000000\",buttonTextColor:\"#ffffff\",errorColor:\"#e63946\",redirectURL:\"\",darkMode:false};addPropertyControls(PasswordGate,{accessKey:{type:ControlType.String,title:\"Access Key\"},title:{type:ControlType.String,title:\"Title\"},subtitle:{type:ControlType.String,title:\"Subtitle\",multiline:true},hint:{type:ControlType.String,title:\"Hint\"},footerText:{type:ControlType.String,title:\"Footer Text\",multiline:true},overlayColor:{type:ControlType.Color,title:\"Overlay Color\"},inputBg:{type:ControlType.Color,title:\"Input Background\"},inputTextColor:{type:ControlType.Color,title:\"Input Text Color\"},inputPlaceholder:{type:ControlType.String,title:\"Input Placeholder\"},buttonText:{type:ControlType.String,title:\"Button Text\"},buttonBg:{type:ControlType.Color,title:\"Button Background\"},buttonTextColor:{type:ControlType.Color,title:\"Button Text Color\"},errorColor:{type:ControlType.Color,title:\"Error Text Color\"},redirectURL:{type:ControlType.String,title:\"Close Button URL\"},darkMode:{type:ControlType.Boolean,title:\"Dark Mode\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"PasswordGate\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Password_Gate.map"],"mappings":"gPAG8K,SAAwB,EAAa,EAAM,CAAC,GAAK,CAAC,YAAU,QAAM,WAAS,OAAK,aAAW,eAAa,UAAQ,iBAAe,mBAAiB,aAAW,WAAS,kBAAgB,aAAW,cAAY,YAAU,EAAW,CAAC,EAAW,GAAeA,EAAS,GAAG,CAAM,CAAC,EAAW,GAAeA,EAAS,GAAM,CAAM,CAAC,EAAM,GAAUA,EAAS,GAAG,CACvJ,QAAxV,CAAC,GAAU,IAAS,OAAY,MAAO,GAAoE,GAA3D,EAAO,8BAA8B,IAAA,IAAyB,EA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