{"version":3,"file":"Email_verification.M4SAY2C1.mjs","names":["useRef","useState"],"sources":["https:/framerusercontent.com/modules/arYoA9KZuI6l1oKwpukc/Ql4aPvXoybbMme9RZ2uj/Next.js","https:/framerusercontent.com/modules/URbHwDewkIR5snwGkaVT/pcz16FLk9gP3DDRrF4sc/Email_verification.js"],"sourcesContent":["// @ts-nocheck\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useRef,useState,useEffect}from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";/**\n * @framerDisableUnlink\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function Divider(props){const dividerRef=useRef(null);const formRef=useRef(null);const[blocks,setBlocks]=useState([]);const[currentBlock,setCurrentBlock]=useState(0);const[isHovered,setIsHovered]=useState(false);const[isPressed,setIsPressed]=useState(false);const isCanvas=RenderTarget.current()===RenderTarget.canvas;useEffect(()=>{if(isCanvas)return;const currentElement=dividerRef.current;let formElement=null;let element=currentElement;// Find the parent form\nwhile(element&&!formElement){element=element.parentElement;if(element&&element.tagName===\"FORM\"){formElement=element;}}if(formElement){formRef.current=formElement;// Initialize the form's current block index if not set\nif(!formElement.dataset.currentBlock){formElement.dataset.currentBlock=\"0\";}setCurrentBlock(parseInt(formElement.dataset.currentBlock));// Set up event listener for block changes\nconst handleBlockChange=e=>{setCurrentBlock(e.detail);};formElement.addEventListener(\"blockChange\",handleBlockChange);// Create blocks\nconst formChildren=Array.from(formElement.children);const dividerElements=formChildren.filter(el=>el.querySelector('[data-divider=\"true\"]'));if(dividerElements.length>0){const blockSections=[];const firstDividerIndex=formChildren.indexOf(dividerElements[0]);blockSections.push(formChildren.slice(0,firstDividerIndex+1));for(let i=0;i<dividerElements.length-1;i++){const startIndex=formChildren.indexOf(dividerElements[i])+1;const endIndex=formChildren.indexOf(dividerElements[i+1])+1;blockSections.push(formChildren.slice(startIndex,endIndex));}const lastDividerIndex=formChildren.indexOf(dividerElements[dividerElements.length-1]);if(lastDividerIndex<formChildren.length-1){blockSections.push(formChildren.slice(lastDividerIndex+1));}setBlocks(blockSections);showOnlyBlock(parseInt(formElement.dataset.currentBlock),blockSections);// Handle Enter key press\nconst handleKeyDown=e=>{if(e.key===\"Enter\"&&e.target.tagName!==\"TEXTAREA\"&&e.target.type!==\"submit\"&&props.handleEnterKey){e.preventDefault();const currentBlockIndex=parseInt(formElement.dataset.currentBlock||\"0\");if(currentBlockIndex<blockSections.length-1){handleClick();}}};formElement.addEventListener(\"keydown\",handleKeyDown);// Prevent form submission\nconst handleSubmit=e=>{const currentBlockIndex=parseInt(formElement.dataset.currentBlock||\"0\");if(props.preventSubmit&&currentBlockIndex<blockSections.length-1){e.preventDefault();handleClick();}};formElement.addEventListener(\"submit\",handleSubmit);return()=>{formElement.removeEventListener(\"blockChange\",handleBlockChange);formElement.removeEventListener(\"keydown\",handleKeyDown);formElement.removeEventListener(\"submit\",handleSubmit);};}}},[props.handleEnterKey,props.preventSubmit,isCanvas]);const showOnlyBlock=(index,blockList=blocks)=>{if(!blockList||blockList.length===0)return;// Hide all elements\nblockList.flat().forEach(element=>{element.style.display=\"none\";element.style.pointerEvents=\"none\";element.style.userSelect=\"none\";});// Show the selected block\nif(index<blockList.length){blockList[index].forEach(element=>{element.style.display=\"\";element.style.pointerEvents=\"\";element.style.userSelect=\"\";});}};const handleClick=()=>{if(formRef.current&&blocks.length>0){const current=parseInt(formRef.current.dataset.currentBlock);const currentBlockElements=blocks[current];// Find ALL form fields in the current block (not just required ones)\nconst allFields=currentBlockElements.flatMap(element=>Array.from(element.querySelectorAll(\"input, select, textarea\")));// Filter to only fields that have a value (non-empty) - we validate these\n// OR fields that are required (must be validated even if empty)\nconst fieldsToValidate=allFields.filter(field=>{const hasValue=field.value&&field.value.trim()!==\"\";const isRequired=field.required;return hasValue||isRequired;});// Check if all fields are valid\nconst allValid=fieldsToValidate.every(field=>field.checkValidity());if(allValid){const nextBlockIndex=current+1<blocks.length?current+1:current;formRef.current.dataset.currentBlock=nextBlockIndex.toString();showOnlyBlock(nextBlockIndex);formRef.current.dispatchEvent(new CustomEvent(\"blockChange\",{detail:nextBlockIndex}));}else{// Find the first invalid field and trigger the native validation tooltip\nconst firstInvalidField=fieldsToValidate.find(field=>!field.checkValidity());if(firstInvalidField){firstInvalidField.reportValidity();}}}};const getBgColor=()=>{if(isPressed){return props.colors.pressColor;}else if(isHovered){return props.colors.hoverColor;}else{return props.colors.backgroundColor;}};const getTextColor=()=>{if(isPressed){return props.colors.pressTextColor;}else if(isHovered){return props.colors.hoverTextColor;}else{return props.colors.textColor;}};return /*#__PURE__*/_jsx(\"div\",{ref:dividerRef,\"data-divider\":\"true\",onClick:handleClick,onMouseEnter:()=>setIsHovered(true),onMouseLeave:()=>{setIsHovered(false);setIsPressed(false);},onMouseDown:()=>setIsPressed(true),onMouseUp:()=>setIsPressed(false),style:{padding:props.padding,backgroundColor:getBgColor(),color:getTextColor(),border:props.border.borderWidth>0?`${props.border.borderWidth}px ${props.border.borderStyle} ${props.border.borderColor}`:\"none\",borderRadius:props.borderRadius,boxShadow:props.boxShadow,cursor:\"pointer\",...props.font,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",transition:props.transition},children:props.labelText});}Divider.defaultProps={labelText:\"Next Section\",padding:\"8px 16px\",borderRadius:\"4px\",boxShadow:\"0px 2px 4px rgba(0,0,0,0.1)\",transition:\"all 0.2s ease\",border:{borderWidth:0,borderStyle:\"solid\",borderColor:\"#e0e0e0\"},colors:{backgroundColor:\"#f0f0f0\",hoverColor:\"#e0e0e0\",pressColor:\"#d0d0d0\",textColor:\"#333333\",hoverTextColor:\"#333333\",pressTextColor:\"#333333\"},handleEnterKey:true,preventSubmit:true};addPropertyControls(Divider,{labelText:{type:ControlType.String,title:\"Label\",defaultValue:\"Next Section\"},padding:{type:ControlType.Padding,title:\"Padding\",defaultValue:\"8px 16px\"},borderRadius:{type:ControlType.BorderRadius,title:\"Border Radius\",defaultValue:\"4px\"},border:{type:ControlType.Border,title:\"Border\",defaultValue:{borderWidth:0,borderStyle:\"solid\",borderColor:\"#e0e0e0\"}},boxShadow:{type:ControlType.BoxShadow,title:\"Shadow\",defaultValue:\"0px 2px 4px rgba(0,0,0,0.1)\"},transition:{type:ControlType.Transition,title:\"Transition\",defaultValue:{type:\"tween\",duration:.2}},colors:{type:ControlType.Object,title:\"Colors\",controls:{backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#f0f0f0\"},hoverColor:{type:ControlType.Color,title:\"Hover\",defaultValue:\"#e0e0e0\"},pressColor:{type:ControlType.Color,title:\"Press\",defaultValue:\"#d0d0d0\"},textColor:{type:ControlType.Color,title:\"Text\",defaultValue:\"#333333\"},hoverTextColor:{type:ControlType.Color,title:\"Hover Text\",defaultValue:\"#333333\"},pressTextColor:{type:ControlType.Color,title:\"Press Text\",defaultValue:\"#333333\"}}},handleEnterKey:{type:ControlType.Boolean,title:\"Handle Enter Key\",defaultValue:true},preventSubmit:{type:ControlType.Boolean,title:\"Prevent Submit\",defaultValue:true},font:{type:ControlType.Font,controls:\"extended\",title:\"Font\",description:\"v1.5 \\n[via SegmentUI](https://www.segmentUI.com)\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Divider\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any\",\"framerContractVersion\":\"1\",\"framerDisableUnlink\":\"*\",\"framerSupportedLayoutHeight\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Next.map","import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef}from\"react\";import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";function isValidEmail(email){return/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(email);}const useStore=createStore({email:\"\",checked:false,showOverlay:false});export function withEmailInput(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const[store,setStore]=useStore();return /*#__PURE__*/_jsx(Component,{ref:ref,...props,value:store.email,onChange:value=>setStore({email:value})});});}export function withRequiredCheckbox(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const[store,setStore]=useStore();return /*#__PURE__*/_jsx(Component,{ref:ref,...props,checked:store.checked,onChange:value=>setStore({checked:value})});});}export function withSubmitButton(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const[store,setStore]=useStore();const canSubmit=isValidEmail(store.email)&&store.checked;return /*#__PURE__*/_jsx(Component,{ref:ref,...props,disabled:!canSubmit,onClick:()=>{if(!canSubmit)return;setStore({showOverlay:true});}});});}export function withOverlayToggle(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const[store,setStore]=useStore();return /*#__PURE__*/_jsx(Component,{ref:ref,...props,visible:store.showOverlay,onTap:()=>setStore({showOverlay:false})});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withEmailInput\":{\"type\":\"reactHoc\",\"name\":\"withEmailInput\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withSubmitButton\":{\"type\":\"reactHoc\",\"name\":\"withSubmitButton\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRequiredCheckbox\":{\"type\":\"reactHoc\",\"name\":\"withRequiredCheckbox\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withOverlayToggle\":{\"type\":\"reactHoc\",\"name\":\"withOverlayToggle\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Email_verification.map"],"mappings":"+PAMG,SAAwB,EAAQ,EAAM,CAAC,IAAM,EAAWA,EAAO,KAAK,CAAO,EAAQA,EAAO,KAAK,CAAM,CAAC,EAAO,GAAWC,EAAS,EAAE,CAAC,CAAM,CAAC,EAAa,GAAiBA,EAAS,EAAE,CAAM,CAAC,EAAU,GAAcA,EAAS,GAAM,CAAM,CAAC,EAAU,GAAcA,EAAS,GAAM,CAAO,EAAS,EAAa,SAAS,GAAG,EAAa,OAAO,MAAc,CAAC,GAAG,EAAS,OAAO,IAAM,EAAe,EAAW,QAA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