import{S as e,s as t,q as i,o as a,r as l,t as s,aQ as r,A as n,aR as o,x as c}from"./index-Bsa08q3G.js";import{j as d,r as p}from"./react-B_SyE9nW.js";import{F as f,P as u,C as x,a as m}from"./PhotoUpIco-VrBg5PKd.js";import{F as j}from"./FldAutocomplete-DK5JkVCG.js";import{F as h}from"./FldDate-BmnzLXUy.js";import{F as g}from"./FldText-bz1C9lOl.js";import{F as C}from"./FldTextSelect-BRvoNpeC.js";import{M,a as z,I as b,d as v}from"./index-Q-rq5f01.js";import{B as I}from"./BlogIco-DIveLCPX.js";import{U as y}from"./ItemLoading-CviUxP69.js";import{u as S}from"./GenericAvatarHeader-qd2O3Vlm.js";import{E as F}from"./EditIco-BTGnplM_.js";import{P as N,A as E}from"./styles-BFmIwUsb.js";import{S as O}from"./Stack-CG9G4ebx.js";function A(t){return d.jsxs(e,{...t,children:[d.jsx("circle",{cx:"12",cy:"12",r:"11.5",fill:"#c30"}),d.jsx("path",{fill:"#000",d:"M18.5 11.96c-.33-.21-.29-.19-.2-.56.1-.42.3-.58.71-.49.16.03.21-.06.2-.21-.01-.26-.01-.51 0-.77.04-1.36-1.05-3.86-4.17-3.83-.32 0-.61-.05-.9-.19-.93-.47-1.93-.66-2.96-.63-.51.01-.51.03-.52-.46.12-1.24-.88-3.37-3.28-3.49C5.71 1.23 4.3 2.51 4 3.85c-.4 1.76.37 3.28 1.85 3.94.23.1.27.16.12.39-2.17 3.32-.9 7.77 2.69 9.43.2.09.38.21.54.36 3.26 2.95 7.68 1.08 8.7-2.14.05-.16.14-.23.29-.29.74-.31 1.19-.86 1.27-1.66.09-.82-.25-1.48-.96-1.92z"}),d.jsx("path",{fill:"#fff",d:"M7.57 12.2c.44-.09.88-.07 1.32.03 1.16.26 2.18-.76 1.95-1.92-.06-.31.05-.18.08-.16.72.51 1.52.75 2.4.75h3.06c.14 0 .24.02.33.14 2.22 3.11.6 6.94-2.62 7.78-2.37.73-5.17-.85-5.83-3.2-.1-.36.01-.37-.36-.42-.67-.09-1.22-.59-1.34-1.25-.12-.66.23-1.44 1.01-1.75zM18.12 13.4c-.06-.36-.14-.83-.26-1.18.54.06 1.02.57 1.13 1.17.12.66-.18 1.31-.74 1.6-.03.03-.06.03-.09.01-.09-.03.03-.07-.04-1.6z"}),d.jsx("path",{fill:"#fe7f09",d:"M14.52 15.64c-.36.03-.71.08-1.06-.03-.29-.17-.3-.44-.25-.72.16-.83.33-1.67.5-2.5.04-.2.14-.44.38-.44.25 0 .34.23.38.46.07.24.26 1.86.34 2.48.05.42-.09.74-.29.75z"}),d.jsx("path",{fill:"#000",d:"M12.17 16.36c-.12-.11-.21-.23-.09-.38.14-.16.27-.08.4.03.81.68 1.76.68 2.58 0 .12-.1.25-.19.38-.05.14.15.06.29-.07.4-.94.86-2.34.82-3.2 0zM15.28 12.89a.569.569 0 01-.55-.55c0-.31.27-.55.59-.54.31.01.55.27.54.56a.57.57 0 01-.58.53zM12.46 12.93a.569.569 0 01-.55-.55c0-.31.27-.55.59-.54.31.01.55.27.54.56-.01.3-.28.54-.58.53z"})]})}function P(t){return d.jsxs(e,{...t,children:[d.jsx("circle",{cx:"12",cy:"12",r:"11.5",fill:"#c30"}),d.jsx("path",{fill:"#000",d:"M19.47 13.89c-.08.8-.52 1.36-1.27 1.66-.15.06-.24.13-.29.29-1.03 3.21-5.45 5.09-8.7 2.14-.17-.15-.34-.27-.54-.36a6.438 6.438 0 01-3.74-5.5c-.02-.12-.02-.25-.02-.38V1.6h8.52c2.93 0 5.3 2.38 5.3 5.31v5.22c.55.43.81 1.03.74 1.76z"}),d.jsx("path",{fill:"#fff",d:"M7.57 12.21c.44-.09.88-.07 1.33.03 1.16.26 2.45-.42 1.87-2.04l5.15.04c.14 0 .71.68.79.8 2.22 3.11.6 6.94-2.62 7.78-2.37.73-5.17-.85-5.83-3.2-.1-.36.01-.37-.36-.42a1.55 1.55 0 01-1.34-1.25c-.12-.66.23-1.44 1.01-1.74 0-.01 0 0 0 0zM18.12 13.41c-.06-.36-.14-.82-.26-1.18.54.06 1.02.57 1.13 1.17.12.66-.18 1.31-.74 1.6-.03.03-.05.03-.09.01-.08-.04.03-.08-.04-1.6z"}),d.jsx("path",{fill:"#fe7f09",d:"M14.52 15.64c-.36.03-.71.08-1.06-.03-.29-.17-.3-.44-.25-.72.16-.83.33-1.67.5-2.5.04-.2.14-.44.38-.44.25 0 .34.23.38.46.07.24.26 1.86.34 2.48.05.42-.09.74-.29.75z"}),d.jsx("path",{fill:"#000",d:"M12.18 16.37c-.12-.11-.21-.23-.08-.38.14-.16.27-.08.4.03.81.68 1.76.68 2.58 0 .12-.1.25-.19.38-.05.14.15.06.28-.07.4-.96.85-2.35.81-3.21 0zM12.34 12.9a.558.558 0 01-.53-.55.545.545 0 111.09.02c-.02.29-.27.53-.56.53zm2.94 0a.569.569 0 01-.55-.55c0-.31.27-.55.59-.54.3.01.55.27.54.56-.01.29-.28.53-.58.53z"})]})}function w(t){return d.jsxs(e,{...t,children:[d.jsx("circle",{cx:"12",cy:"12",r:"11.5",fill:"#C30"}),d.jsx("path",{fill:"#000",d:"M20.62 13.2a1.9 1.9 0 01-1.27 1.66c-.15.06-.24.13-.29.29a5.32 5.32 0 01-8.7 2.14 2.12 2.12 0 00-.54-.36 6.44 6.44 0 01-3.74-5.5c0-.02-.05-.77-.02-1.53a.82.82 0 01-.37-.2L.98 9.18C.87 9.17.8 9.07.81 8.96l.04-.33c.01-.11.11-.18.22-.17l4.61.51a7.15 7.15 0 015.62-6.28l-.01-.06c-.01-.24.32-.45.74-.48.41-.03.75.14.78.36h.15a7.2 7.2 0 017.31 7.07c0 .06-.12.13-.35.19.08.03.12.06.1.08.06.2.1.41.1.62 0 .32-.08.63-.23.94v.03c.54.43.8 1.03.73 1.76z"}),d.jsx("path",{fill:"#FFF",d:"M8.72 11.52c.44-.09.88-.07 1.33.03 1.16.26 2.45-.42 1.87-2.04l5.15.04c.14 0 .71.68.79.8a4.92 4.92 0 01-2.62 7.78 4.85 4.85 0 01-5.83-3.2c-.1-.36.01-.37-.36-.42a1.55 1.55 0 01-1.34-1.25 1.58 1.58 0 011.01-1.74c0-.01 0 0 0 0zm10.59 2.8c.04.02.06.02.09-.01.56-.29.86-.94.74-1.6-.11-.59-.59-1.1-1.13-1.17.12.35.2.82.26 1.18.07 1.52-.04 1.56.04 1.6z"}),d.jsx("path",{fill:"#FE7F09",d:"M15.67 14.95c-.36.03-.71.08-1.06-.03-.29-.17-.3-.44-.25-.72l.5-2.5c.04-.2.14-.44.38-.44.25 0 .34.23.38.46.07.24.26 1.86.34 2.48.05.42-.09.74-.29.75z"}),d.jsx("path",{fill:"#000",d:"M13.33 15.68c-.12-.11-.21-.23-.08-.38.14-.16.27-.08.4.03.81.68 1.76.68 2.58 0 .12-.1.25-.19.38-.05.14.15.06.28-.07.4-.96.85-2.36.82-3.21 0zM13.49 12.21a.56.56 0 01-.53-.55.54.54 0 111.09.02.57.57 0 01-.56.53zM16.43 12.21a.57.57 0 01-.55-.55c0-.31.27-.55.59-.54.3.01.55.27.54.56-.01.29-.28.53-.58.53z"})]})}function L(t){return d.jsxs(e,{...t,children:[d.jsx("circle",{cx:"12",cy:"12",r:"11.5",fill:"#c30"}),d.jsx("path",{fill:"#000",d:"M19.47 13.89c-.02.18-.07.82-.69 1.32v5.36s-1.15-.04-2.86-1.33a6.898 6.898 0 01-4.09 1.33c-1.51 0-2.9-.48-4.04-1.3-1.87 1.39-2.9 1.3-2.9 1.3l.01-8.78c.11-3.18 2.88-6.98 6.99-6.99.97 0 3.14.27 4.92 2.31 1.57.42 2.41 1.19 2.44 1.89.02.37-.05.82-.73 1.29.06.2.28 1.05.26 1.88.52.43.76 1.01.69 1.72z"}),d.jsx("path",{fill:"#fff",d:"M7.57 12.21c.44-.09.88-.07 1.33.03 1.16.26 2.18-.76 1.95-1.92-.06-.31.05-.18.08-.16.72.51 1.52.75 2.4.75h3.06c.14 0 .24.02.33.15 2.22 3.11.6 6.94-2.62 7.78-2.37.73-5.17-.85-5.83-3.2-.1-.36.01-.37-.36-.42a1.55 1.55 0 01-1.34-1.25c-.13-.68.22-1.46 1-1.76 0-.01 0 0 0 0zm10.59 2.8c.04.02.06.02.09-.01.56-.29.86-.94.74-1.6-.11-.59-.59-1.1-1.13-1.17.12.35.2.82.26 1.18.07 1.52-.04 1.56.04 1.6z"}),d.jsx("path",{fill:"#fe7f09",d:"M14.52 15.64c-.36.03-.71.08-1.06-.03-.29-.17-.3-.44-.25-.72.16-.83.33-1.67.5-2.5.04-.2.14-.44.38-.44.25 0 .34.23.38.46.07.24.26 1.86.34 2.48.05.42-.09.74-.29.75z"}),d.jsx("path",{fill:"#000",d:"M12.18 16.37c-.12-.11-.21-.23-.08-.38.14-.16.27-.08.4.03.81.68 1.76.68 2.58 0 .12-.1.25-.19.38-.05.14.15.06.28-.07.4-.96.85-2.35.81-3.21 0zm.71-4.01a.551.551 0 00-.52-.56.544.544 0 10.52.56zm2.97 0a.554.554 0 00-.54-.56.562.562 0 00-.59.54c0 .3.25.55.55.55.3.01.57-.23.58-.53z"})]})}function B(t){return d.jsxs(e,{...t,children:[d.jsx("circle",{cx:"12",cy:"12",r:"11.5",fill:"#c30"}),d.jsx("path",{fill:"#000",d:"M21.13 10.41c0 5.46-4.42 9.88-9.88 9.88-5.45 0-9.88-4.42-9.88-9.88 0-4.42 3.35-9.88 9.88-9.88 5.46 0 9.88 4.42 9.88 9.88z"}),d.jsx("path",{fill:"#fff",d:"M8.26 15.63c-.12-.35.01-.44-.37-.42-1.33.07-2.09-2.29-.33-3.01.44-.09.88-.07 1.32.03 1.02.23 1.93-.53 1.98-1.52.8.62 2.2.43 2.67-.08 1.09.83 2.35.26 2.35.26.15.71.74 1.25 1.47 1.33 2.29 6.39-6.91 9.72-9.09 3.41z"}),d.jsx("path",{fill:"#fe7f09",d:"M14.52 15.64c-.36.03-.71.08-1.06-.03-.29-.17-.3-.44-.25-.72.16-.83.33-1.67.5-2.5.04-.2.14-.44.38-.44.25 0 .34.23.38.46.07.24.26 1.86.34 2.48.05.42-.09.74-.29.75z"}),d.jsx("path",{fill:"#000",d:"M12.18 16.37c-.12-.11-.21-.23-.08-.38.14-.16.27-.08.4.03.81.68 1.76.68 2.58 0 .12-.1.25-.19.38-.05.14.15.06.28-.07.4-.96.85-2.35.81-3.21 0zm.71-4.01a.551.551 0 00-.52-.56.544.544 0 10.52.56zm2.97 0a.554.554 0 00-.54-.56.562.562 0 00-.59.54c0 .3.25.55.55.55.3.01.57-.23.58-.53z"})]})}const _={"user1.jpg":d.jsx(A,{}),"user2.jpg":d.jsx(P,{}),"user3.jpg":d.jsx(w,{}),"user4.jpg":d.jsx(L,{}),"user5.jpg":d.jsx(B,{})},k=t("div")`
display: grid;
grid-template-columns: 1fr 1fr;
justify-content: space-evenly;
justify-items: center;
align-content: space-evenly;
align-items: center;
width: fit-content;
gap: 24px;
margin: auto;
& {
.MuiButtonBase-root {
width: 100px;
height: 100px;
padding: 0;
&:first-child {
border: 1px solid ${i.brownLight};
width: 96px;
height: 96px;
& label {
position: absolute;
border-radius: 50%;
width: 96px;
height: 96px;
}
& .MuiSvgIcon-root {
width: 35px;
height: 35px;
fill: ${i.brownLight};
}
}
&:not(:first-child) {
.MuiSvgIcon-root {
width: 100%;
height: auto;
}
}
}
}
`;const D=a((function(){const e=p.useContext(y),{getCropperStore:{onHandleUploadClick:t},onHandleImgClick:i}=e;return d.jsxs(M,{open:e.isProfilePicture,onClose:l,PaperProps:{"data-test":"enj-form-signup-picture-selection"},children:[d.jsx(z,{size:"small",color:"black",weight:"bold",maxWidth:"180px",text:s("profilePicture")}),d.jsx(z,{size:"mini",color:"lightGray",margin:"10px 0",text:s("selectPicture")}),d.jsxs(k,{"data-test":"enj-form-signup-picture-area",children:[d.jsx(f,{id:"enj-btn-profile-img-upload",onChange:i=>{e.setImageChanged(!0),t(i,1)},children:d.jsx(b,{component:"span",children:d.jsx(u,{})})}),e.getAvatars.map((({url:t,name:a})=>d.jsx(b,{onClick:()=>(async(t,a="")=>{const l=await r(t);await i(l,!0),e.setDefaultPictureName(a),e.setImageChanged(!0),n()})(t,a),children:_[a]},a)))]})]})})),R=t("img")`
width: 100%;
height: 100%;
object-fit: cover;
`;const T=a((function({register:e=!0}){const t=p.useContext(y),[i,a]=p.useState(""),{onClickEditPicture:l,form:{picture:s}}=t;return p.useEffect((()=>{const e=(null==s?void 0:s.value)??"";e instanceof File?o(e,a):a(e)}),[null==s?void 0:s.value]),d.jsxs(N,{className:e?"":"enj-avatar",children:[d.jsx(E,{className:e?"":"enj-avatar",children:i?d.jsx(R,{loading:"lazy",src:i||"",alt:"user picture"}):d.jsx(L,{})}),d.jsx(b,{"data-test":"enj-form-signup-picture-edit",onClick:l,disabled:!t.isSecondStep&&e,children:d.jsx(F,{})})]})})),U=[{value:"COMMUNICATION_GENDER_NEUTRAL",label:s("communicationNeutral")},{value:"COMMUNICATION_GENDER_MASCULINE",label:s("communicationMasculine")},{value:"COMMUNICATION_GENDER_FEMENINE",label:s("communicationFeminine")}],q=e=>e?{}:{"& .MuiOutlinedInput-notchedOutline":{borderColor:i.red},"& .MuiFormLabel-root":{color:i.red}};const H=a((function(){const e=p.useContext(y),{form:{first_name:t,last_name:i,birth_date:a,picture:l,country:r,city:n,web_url:o,profile_name:f},onCitiesChanged:u,getCropperStore:M,onHandleImgClick:b}=e,{getCurrentCropImage:F,getImgsToCrop:N,setCurrentCropImage:E,deleteImageFromCrops:A,onHandleCropImage:P,onHandleDeleteAllImages:w}=M,L=p.useMemo((()=>c({city:"",setCity(e=""){this.city=e}})),[]),B=()=>{L.setCity()};p.useEffect((()=>{const t=null==l?void 0:l.value;if(t&&!(t instanceof File)){const i="string"==typeof t?t:S;i&&e.onHandleImgClick(i,!0)}}),[]);const _=p.useMemo((()=>N.find((e=>e.id===F))),[F,N]);return d.jsxs(d.Fragment,{children:[d.jsxs(O,{sx:{alignItems:"center",p:"0 1em"},children:[d.jsx(z,{color:"lightGray",alignSelf:"flex-start",size:"mini",margin:"0 0 0 14px",text:s("pictureProfile")}),d.jsx(T,{register:!1}),d.jsx(g,{required:!0,validateOnBlur:!0,fieldState:f,hiddenLabel:!1,label:s("profileName"),sx:q(f.value)}),d.jsx(g,{required:!0,validateOnBlur:!0,fieldState:t,hiddenLabel:!1,label:s("firstname"),sx:q(t.value)}),d.jsx(g,{required:!0,validateOnBlur:!0,fieldState:i,hiddenLabel:!1,label:s("lastname"),sx:q(i.value)}),d.jsx(h,{required:!0,validateOnBlur:!0,fieldState:a,hiddenLabel:!1,label:s("birthdate"),placeholder:"dd/mm/aaaa",sx:q(a.value)}),d.jsx(C,{required:!0,validateOnBlur:!0,fieldState:r,hiddenLabel:!1,label:s("country"),options:e.countries,sx:q(r.value)}),d.jsx(j,{required:!0,validateOnBlur:!0,hiddenLabel:!1,label:s("city"),fieldState:n,options:e.cities,filterOptions:e=>e,renderOption:(e,t)=>d.jsx("li",{...e,children:d.jsxs(v,{gutterBottom:!0,sx:{"&":{fontSize:"13px"}},children:[t.label," (",t.data,")"]})}),onChangeInput:(e,t)=>{L.setCity("input"===t?e:""),u(e)},open:!!L.city,onBlur:B,onChange:B,placeholder:s("writeYourCity"),sx:q(n.value)}),d.jsx(g,{fieldState:o,label:s("webBlog"),hiddenLabel:!1,placeholder:"https://miblog.com",InputProps:{endAdornment:d.jsx(I,{})}})]}),d.jsx(D,{}),d.jsx(x,{onClickAccept:()=>{b((null==_?void 0:_.croppedImage)??(null==_?void 0:_.image),!1,(()=>e.setImageChanged(!0)))},src:_,extension:e.getExtension,aspectRatio:m.NORMAL,changeAspectRatioAction:!1,images:N,onDelete:A,onChange:E,onCropImage:P,onClose:w,limit:1,forProfile:!0,forOneImage:!0})]})}));export{T as A,D as P,H as a,U as c,q as g};