{"version":3,"file":"CustomForm.Bjmx0fTG.mjs","names":["React.useState"],"sources":["https:/framerusercontent.com/modules/t4Fbkdolt3ba5r2tl7Wt/pJ5BYSczxvbqp1O9aqJE/CustomForm.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";export default function CustomForm(props){// 1. On stocke la valeur des champs\nconst[prenom,setPrenom]=React.useState(\"\");const[mobile,setMobile]=React.useState(\"\");const[invite,setInvite]=React.useState(\"\");// --- LOGIQUE DE VALIDATION ---\n// On vérifie si les prénoms sont différents (en ignorant les majuscules/minuscules)\nconst areNamesDifferent=prenom.trim().toLowerCase()!==invite.trim().toLowerCase();// On détermine si on doit afficher l'erreur\nconst showNameError=prenom.trim()!==\"\"&&invite.trim()!==\"\"&&!areNamesDifferent;// 2. Validation instantanée\nconst isValid=prenom.trim()!==\"\"&&mobile.trim()!==\"\"&&invite.trim()!==\"\"&&areNamesDifferent;// 3. La logique au moment du clic\nconst handleSubmit=e=>{e.preventDefault();if(!isValid)return;// Récupération des paramètres existants\nconst currentParams=new URLSearchParams(typeof window!==\"undefined\"?window.location.search:\"\");const data=Object.fromEntries(currentParams.entries());// Ajout de tes données\ndata[\"in\"]=prenom.trim();data[\"noin\"]=mobile.trim();data[\"pa\"]=invite.trim();// Préparation de l'URL de destination (App)\nconst params=new URLSearchParams(data);const targetAppUrl=`https://app.bulle.care/init?${params.toString()}`;// --- LA REDIRECTION INFAILLIBLE ---\n// Remplace l'historique : empêche l'utilisateur de faire \"Retour\" et de recharger le formulaire\nwindow.location.replace(targetAppUrl);};return /*#__PURE__*/_jsxs(\"form\",{onSubmit:handleSubmit,style:formContainerStyle,children:[/*#__PURE__*/_jsx(\"style\",{children:`\n                .custom-input::placeholder {\n                    color: #B8B8B8; \n                    opacity: 1; \n                }\n            `}),/*#__PURE__*/_jsxs(\"div\",{style:inputGroupStyle,children:[/*#__PURE__*/_jsx(\"label\",{style:labelStyle,children:\"Votre pr\\xe9nom\"}),/*#__PURE__*/_jsx(\"input\",{type:\"text\",className:\"custom-input\",placeholder:\"Vanessa\",value:prenom,onChange:e=>setPrenom(e.target.value),style:inputStyle})]}),/*#__PURE__*/_jsxs(\"div\",{style:inputGroupStyle,children:[/*#__PURE__*/_jsx(\"label\",{style:labelStyle,children:\"Votre n\\xb0 de mobile\"}),/*#__PURE__*/_jsx(\"input\",{type:\"tel\",className:\"custom-input\",placeholder:\"0623456789\",value:mobile,onChange:e=>setMobile(e.target.value),style:inputStyle}),/*#__PURE__*/_jsx(\"p\",{style:hintStyle,children:\"Pour confirmer votre inscription et conserver la session.\"})]}),/*#__PURE__*/_jsxs(\"div\",{style:inputGroupStyle,children:[/*#__PURE__*/_jsx(\"label\",{style:labelStyle,children:\"Qui souhaiterez-vous inviter ?\"}),/*#__PURE__*/_jsx(\"input\",{type:\"text\",className:\"custom-input\",placeholder:\"Simon\",value:invite,onChange:e=>setInvite(e.target.value),style:{...inputStyle,border:showNameError?\"2px solid #FF4D4D\":\"none\"}}),showNameError&&/*#__PURE__*/_jsx(\"p\",{style:errorStyle,children:\"Le pr\\xe9nom de l'invit\\xe9 doit \\xeatre diff\\xe9rent du v\\xf4tre.\"}),!showNameError&&/*#__PURE__*/_jsx(\"p\",{style:hintStyle,children:\"Votre invit\\xe9 ne sera contact\\xe9 qu'\\xe0 la suite de votre session de d\\xe9couverte.\"})]}),/*#__PURE__*/_jsx(\"button\",{type:\"submit\",disabled:!isValid,style:{...buttonStyle,opacity:isValid?1:.3,cursor:isValid?\"pointer\":\"not-allowed\"},children:\"D\\xc9MARRER\"})]});}// --- STYLES ---\nconst formContainerStyle={display:\"flex\",flexDirection:\"column\",alignItems:\"center\",gap:\"12px\",width:\"90%\",margin:\"0 auto\",fontFamily:\"font-familyInter, 'Inter Placeholder', sans-serif\",fontWeight:400};const inputGroupStyle={display:\"flex\",flexDirection:\"column\",gap:\"5px\",width:\"100%\"};const labelStyle={fontSize:\"18px\",color:\"#403A40\",textAlign:\"left\"};const inputStyle={padding:\"7px 15px\",borderRadius:\"100px\",border:\"none\",color:\"#403A40\",backgroundColor:\"#E8E8E8\",outline:\"none\",width:\"100%\",boxSizing:\"border-box\",fontSize:\"20px\",transition:\"border 0.2s ease\"};const hintStyle={color:\"#999999\",textAlign:\"center\",width:\"90%\",marginTop:\"0px\",fontStyle:\"italic\",fontSize:\"15px\",padding:\"0 0px\",alignSelf:\"center\"};// Style du message d'erreur\nconst errorStyle={color:\"#FF4D4D\",textAlign:\"center\",width:\"90%\",fontWeight:\"bold\",marginTop:\"0px\",fontSize:\"15px\",padding:\"0 0px\",alignSelf:\"center\"};const buttonStyle={padding:\"12px 20px\",borderRadius:\"100px\",border:\"none\",backgroundColor:\"#3A2B58\",color:\"white\",fontWeight:400,fontSize:\"20px\",marginTop:\"0px\",width:\"60%\",transition:\"opacity 0.2s ease\"};\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CustomForm\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CustomForm.map"],"mappings":"uIAAqF,SAAwB,EAAW,EAAM,CAC9H,GAAK,CAAC,EAAO,GAAWA,EAAe,GAAG,CAAM,CAAC,EAAO,GAAWA,EAAe,GAAG,CAAM,CAAC,EAAO,GAAWA,EAAe,GAAG,CAE1H,EAAkB,EAAO,MAAM,CAAC,aAAa,GAAG,EAAO,MAAM,CAAC,aAAa,CAC3E,EAAc,EAAO,MAAM,GAAG,IAAI,EAAO,MAAM,GAAG,IAAI,CAAC,EACvD,EAAQ,EAAO,MAAM,GAAG,IAAI,EAAO,MAAM,GAAG,IAAI,EAAO,MAAM,GAAG,IAAI,EAMlC,OAAoB,EAAM,OAAO,CAAC,SALvD,GAAG,CAAoB,GAAnB,EAAE,gBAAgB,CAAI,CAAC,EAAQ,OACtD,IAAM,EAAc,IAAI,gBAAuB,IAAS,OAAmC,GAAvB,EAAO,SA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