{"version":3,"file":"ProtectedVideoEmbed.DTbtDtpK.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/YV7BOimI3CBKtHQxUOoC/PE5U9JYO2oHWuBSAmhoh/ProtectedVideoEmbed.js"],"sourcesContent":["// Password protected frame for embedding video content\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * Password Protected Frame\n *\n * @framerIntrinsicWidth 800\n * @framerIntrinsicHeight 450\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function ProtectedVideoEmbed(props){const{password,embedCode='<iframe width=\"100%\" height=\"100%\" src=\"https://www.youtube.com/embed/dQw4w9WgXcQ\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen></iframe>',backgroundColor,inputBackgroundColor,inputTextColor,buttonColor,buttonTextColor,titleText,titleColor,placeholderText,buttonText,errorText,titleFont,inputFont,buttonFont,errorFont,borderRadius,style}=props;const[inputValue,setInputValue]=useState(\"\");const[isUnlocked,setIsUnlocked]=useState(false);const[showError,setShowError]=useState(false);const handleSubmit=e=>{e.preventDefault();if(inputValue===password){startTransition(()=>{setIsUnlocked(true);setShowError(false);});}else{startTransition(()=>{setShowError(true);});}};const handleInputChange=e=>{setInputValue(e.target.value);if(showError){startTransition(()=>setShowError(false));}};if(isUnlocked){return /*#__PURE__*/_jsx(\"div\",{style:{...style,width:\"100%\",height:\"100%\",position:\"relative\",overflow:\"hidden\",borderRadius,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",backgroundColor},children:/*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",width:\"100%\",height:\"100%\",maxWidth:\"177.78vh\",maxHeight:\"56.25vw\"},children:/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\"},dangerouslySetInnerHTML:{__html:embedCode}})})});}return /*#__PURE__*/_jsx(\"div\",{style:{...style,width:\"100%\",height:\"100%\",display:\"flex\",flexDirection:\"column\",alignItems:\"center\",justifyContent:\"center\",backgroundColor,borderRadius,padding:\"clamp(20px, 5vw, 40px)\",position:\"relative\"},children:/*#__PURE__*/_jsxs(\"form\",{onSubmit:handleSubmit,style:{display:\"flex\",flexDirection:\"column\",alignItems:\"center\",gap:20,width:\"100%\",maxWidth:400},children:[/*#__PURE__*/_jsx(\"h2\",{style:{margin:0,color:titleColor,...titleFont},children:titleText}),/*#__PURE__*/_jsx(\"input\",{type:\"password\",value:inputValue,onChange:handleInputChange,placeholder:placeholderText,style:{width:\"100%\",padding:\"12px 16px\",backgroundColor:inputBackgroundColor,color:inputTextColor,border:showError?\"2px solid #FF5588\":\"none\",borderRadius:borderRadius/2,outline:\"none\",...inputFont},\"aria-label\":\"Password input\",\"aria-invalid\":showError}),showError&&/*#__PURE__*/_jsx(\"p\",{style:{margin:0,color:\"#FF5588\",...errorFont},role:\"alert\",children:errorText}),/*#__PURE__*/_jsx(\"button\",{type:\"submit\",style:{width:\"100%\",padding:\"12px 24px\",backgroundColor:buttonColor,color:buttonTextColor,border:\"none\",borderRadius:borderRadius/2,cursor:\"pointer\",...buttonFont},children:buttonText})]})});}addPropertyControls(ProtectedVideoEmbed,{password:{type:ControlType.String,title:\"Password\",defaultValue:\"secret123\"},embedCode:{type:ControlType.String,title:\"Video Embed Code\",defaultValue:'<iframe width=\"100%\" height=\"100%\" src=\"https://www.youtube.com/embed/dQw4w9WgXcQ\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen></iframe>',displayTextArea:true},titleText:{type:ControlType.String,title:\"Title\",defaultValue:\"Protected Content\"},titleColor:{type:ControlType.Color,title:\"Title Color\",defaultValue:\"#000000\"},placeholderText:{type:ControlType.String,title:\"Placeholder\",defaultValue:\"Enter password\"},buttonText:{type:ControlType.String,title:\"Button Text\",defaultValue:\"Unlock\"},errorText:{type:ControlType.String,title:\"Error Message\",defaultValue:\"Incorrect password. Please try again.\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#FFFFFF\"},inputBackgroundColor:{type:ControlType.Color,title:\"Input Background\",defaultValue:\"#F5F5F5\"},inputTextColor:{type:ControlType.Color,title:\"Input Text\",defaultValue:\"#000000\"},buttonColor:{type:ControlType.Color,title:\"Button Color\",defaultValue:\"#000000\"},buttonTextColor:{type:ControlType.Color,title:\"Button Text\",defaultValue:\"#FFFFFF\"},titleFont:{type:ControlType.Font,title:\"Title Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"32px\",variant:\"Semibold\",letterSpacing:\"-0.03em\",lineHeight:\"1em\"}},inputFont:{type:ControlType.Font,title:\"Input Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"15px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1em\"}},buttonFont:{type:ControlType.Font,title:\"Button Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"14px\",variant:\"Semibold\",letterSpacing:\"-0.01em\",lineHeight:\"1em\"}},errorFont:{type:ControlType.Font,title:\"Error Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"14px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1.3em\"}},borderRadius:{type:ControlType.Number,title:\"Border Radius\",defaultValue:8,min:0,max:32}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ProtectedVideoEmbed\",\"slots\":[],\"annotations\":{\"framerIntrinsicHeight\":\"450\",\"framerSupportedLayoutWidth\":\"any\",\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"800\",\"framerSupportedLayoutHeight\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ProtectedVideoEmbed.map"],"mappings":"mLASG,SAAwB,EAAoB,EAAM,C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