1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[264],{76752:function(e,n,t){t.d(n,{N:function(){return MultiSelect}});var r=t(85893),i=t(67294),a=t(2777),l=t(81794),o=t(9882),s=t(79765),d=t(82729),c=t(85444);function _templateObject(){let e=(0,d._)(["\n display: grid;\n gap: 1.6rem;\n"]);return _templateObject=function(){return e},e}function _templateObject1(){let e=(0,d._)(["\n display: flex;\n align-items: center;\n *:first-child {\n flex: 1;\n }\n\n @media (max-width: 550px) {\n flex-direction: column;\n align-items: flex-end;\n gap: 1rem;\n }\n"]);return _templateObject1=function(){return e},e}function _templateObject2(){let e=(0,d._)(["\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n gap: 0.8rem;\n"]);return _templateObject2=function(){return e},e}let m=c.ZP.div.withConfig({componentId:"sc-e11a3118-0"})(_templateObject()),u=c.ZP.div.withConfig({componentId:"sc-e11a3118-1"})(_templateObject1()),p=c.ZP.div.withConfig({componentId:"sc-e11a3118-2"})(_templateObject2());function MultiSelect(e){var n,t;let[d,c]=i.useState((null===(n=e.initialValue)||void 0===n?void 0:n.length)>0?e.initialValue:[]),x=d.length===(null===(t=e.options)||void 0===t?void 0:t.length),unselect=e=>{c(n=>n.filter(n=>n.value!==e))},f=x?()=>{c([])}:()=>{c(e.options)};return i.useEffect(()=>{var n;null===(n=e.onChange)||void 0===n||n.call(e,d)},[d]),(0,r.jsxs)(m,{children:[(0,r.jsxs)(u,{children:[(0,r.jsx)(s.Z,{dropData:e.options,styleContainer:{marginLeft:"0rem",width:"98%",zIndex:e.containerZIndex},titleDropdown:e.title,titleDisabledOption:e.subTitle,handleOnChange:e=>{c(n=>n.some(n=>e.value===n.value)?n:[...n,e])},hasBorder:!0,hasTitle:!0}),e.enableSelectUnselectAll&&(0,r.jsx)(o.Z,{title:x?"Desselecionar todos":"Selecionar todos",textButton:x?"Nenhum":"Todos",onClick:f})]}),!!d.length&&(0,r.jsx)(p,{children:d.map(n=>(0,r.jsx)(o.Z,{Icon:a.q5L,colorIcon:l.w.white,textButton:n.label,title:"Clique para remover",onClick:()=>unselect(n.value),style:e.styleButton},n.value))})]})}},20264:function(e,n,t){t.d(n,{Z:function(){return ContentAddLead},G:function(){return el}});var r=t(85893),i=t(11163),a=t.n(i),l=t(72132),o=t(745),s=t(28931),d=t(9728),c=t(23296),m=t(74737),u=t(35506),p=t(2777),x=t(81794),f=t(82729),h=t(85444),g=t(69453);function _templateObject(){let e=(0,f._)(["\n display: flex;\n flex-direction: column;\n align-items: center;\n max-width: 81.6rem;\n margin: 5rem auto 10rem;\n width: 100%;\n"]);return _templateObject=function(){return e},e}function _templateObject1(){let e=(0,f._)(["\n width: 100%;\n\n > button {\n margin: 0 auto;\n\n @media (max-width: 620px) {\n margin-bottom: 3.2rem;\n }\n }\n"]);return _templateObject1=function(){return e},e}function _templateObject2(){let e=(0,f._)(["\n display: flex;\n flex-direction: column;\n align-items: center;\n background: ",";\n border-radius: 0.8rem;\n padding: 3.2rem;\n margin-bottom: 3.2rem;\n\n \n\n .dropdown {\n margin-top: 2rem;\n >
1 div:nth-child(1) {\n left:0;\n color: ",";\n }\n }\n\n @media (max-width: 620px) {\n padding: 2.4rem 1.6rem;\n }\n\n > span {\n width: 100%;\n display: flex;\n flex-direction: column;\n /* gap: 3rem; */\n\n .react-select__value-container {\n padding:0;\n }\n .react-select__placeholder {\n font: ",";\n color: ",";\n font-size: 16px;\n }\n .react-select__single-value {\n font: ",";\n color: ",";\n font-size: 16px;\n }\n\n > div {\n p {\n margin-bottom: 2rem;\n margin-left:0;\n }\n }\n\n > p {\n color: ",";\n margin-bottom: 3rem;\n margin-top:1rem;\n }\n }\n\n span.agent-partner {\n width: 100%;\n margin-top: 3rem;\n\n display: grid;\n grid-template-columns: 1fr auto;\n column-gap: 6rem;\n align-items: center;\n\n > button {\n @media (max-width: 550px) {\n display: none;\n }\n }\n\n @media (max-width: 550px) {\n display: flex;\n flex-direction: column;\n row-gap: 1rem;\n align-items: flex-end;\n }\n\n button.mobile {\n display: none;\n\n width: 3.5rem;\n height: 3.5rem;\n padding: 1rem;\n \n align-items: center;\n justify-content: center;\n\n > div {\n margin-left: 0;\n }\n\n @media (max-width: 550px) {\n display: flex;\n }\n }\n }\n"]);return _templateObject2=function(){return e},e}function _templateObject3(){let e=(0,f._)(["\n display: flex;\n flex-direction: column;\n gap: 1rem;\n width: 100%;\n margin-bottom: 3.2rem;\n\n @media (max-width: 620px) {\n h1 {\n font: ","\n }\n }\n"]);return _templateObject3=function(){return e},e}function _templateObject4(){let e=(0,f._)(["\n display: flex;\n flex-direction: column;\n width: 100%;\n\n h2 {\n font: ",";\n margin-bottom: 0.8rem;\n }\n\n main {\n display: flex;\n gap: 1.6rem;\n width: 100%;\n align-items: center;\n padding: 2.2rem 2.4rem;\n border-radius: 0.8rem;\n background: ",";\n\n h1 {\n font: ",";\n }\n\n > div {\n display: flex;\n align-items: center;\n gap: 1.6rem;\n }\n }\n \n section {\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n margin-left: auto;\n\n h3 {\n font: ",";\n color: ",";\n }\n\n aside {\n display: flex;\n align-items: center;\n width: max-content;\n\n h5 {\n font: ",";\n color: ",";\n margin-left: 1rem;\n }\n }\n }\n\n @media (max-width: 550px) {\n main {\n flex-direction: column;\n align-items: unset;\n }\n\n section {\n margin-left: 0;\n }\n }\n\n @media (max-width: 400px) {\n section {\n aside {\n width: 100%;\n overflow-x: auto;\n\n ::-webkit-scrollbar {\n height: 0.7rem;\n }\n\n ::-webkit-scrollbar-track {\n background: #F8F7FC;\n }\n\n ::-webkit-scrollbar-thumb {\n background: #BBB8D9;\n border-radius: 100px;\n cursor: pointer;\n }\n\n ::-webkit-scrollbar-thumb:hover {\n background: #ada9dd;\n cursor: pointer;\n }\n }\n }\n }\n"]);return _templateObject4=function(){return e},e}function _templateObject5(){let e=(0,f._)(["\n display: flex;\n flex-direction: column;\n align-items: center;\n height: 100%;\n width: 100%;\n\n h1 {\n font: ",";\n margin-bottom: 3.2rem;\n }\n\n h3 {\n font: ",";\n margin-bottom: 3.2rem;\n line-height: 130%;\n text-align: center;\n }\n"]);return _templateObject5=function(){return e},e}function _templateObject6(){let e=(0,f._)(["\n width: 100%;\n margin: 2.4rem;\n"]);return _templateObject6=function(){return e},e}function _templateObject7(){let e=(0,f._)(["\n .react-select__control {\n border-bottom: 2px solid "," !important;\n }\n "]);return _templateObject7=function(){return e},e}function _templateObject8(){let e=(0,f._)(["\n display: flex;\n flex-direction: column;\n\n ","\n"]);return _templateObject8=function(){return e},e}function _templateObject9(){let e=(0,f._)(["\n width: 100%;\n margin-top: 3rem;\n \n .react-select__control {\n width: 100%;\n }\n\n .DropdownSecondary__title {\n left: 0;\n color: ","\n }\n"]);return _templateObject9=function(){return e},e}
1function _templateObject10(){let e=(0,f._)(["\n display: flex;\n flex-direction: column;\n width: 500px;\n padding: 60px 15px;\n\n justify-content: center;\n align-items: center;\n\n > p {\n width: 85%;\n font: ",";\n font-size: 18px;\n text-align: center;\n }\n\n > span {\n display: flex;\n margin-top: 20px;\n gap: 15px;\n }\n\n @media (max-width: 520px){\n width: 85vw;\n\n > span {\n flex-direction: column ;\n width: 90%;\n > button {\n font-size: 12px;\n }\n }\n }\n"]);return _templateObject10=function(){return e},e}function _templateObject11(){let e=(0,f._)(["\n padding: 1.5rem;\n background-color: #fff2de;\n font: ",";\n color: "," !important;\n border-radius: 15px;\n width: 100%;\n text-align: center;\n margin-top: 1rem;\n"]);return _templateObject11=function(){return e},e}function _templateObject12(){let e=(0,f._)(["\n margin: 0 !important;\n color: "," !important;\n font: "," !important;\n"]);return _templateObject12=function(){return e},e}let _=h.ZP.div.withConfig({componentId:"sc-ddad17af-0"})(_templateObject()),b=h.ZP.form.withConfig({componentId:"sc-ddad17af-1"})(_templateObject1()),j=h.ZP.div.withConfig({componentId:"sc-ddad17af-2"})(_templateObject2(),x.w.bgWhite,x.w.textPrimary,g.F.text_MD_regular,x.w.textSecondary,g.F.text_MD_regular,x.w.textPrimary,x.w.error),O=h.ZP.div.withConfig({componentId:"sc-ddad17af-3"})(_templateObject3(),g.F.text_LG_bold),w=h.ZP.div.withConfig({componentId:"sc-ddad17af-4"})(_templateObject4(),g.F.text_SM_regular,x.w.bgGray,g.F.text_LG_bold,g.F.text_MD_regular,x.w.primary,g.F.text_MD_regular,x.w.textSecondary);h.ZP.div.withConfig({componentId:"sc-ddad17af-5"})(_templateObject5(),g.F.text_XL_bold,g.F.text_LG_regular),(0,h.iv)(_templateObject6());let v=h.ZP.div.withConfig({componentId:"sc-ddad17af-6"})(_templateObject8(),e=>{let{choiceAgentError:n}=e;return n&&(0,h.iv)(_templateObject7(),x.w.error)}),y=h.ZP.div.withConfig({componentId:"sc-ddad17af-7"})(_templateObject9(),x.w.textPrimary);h.ZP.div.withConfig({componentId:"sc-ddad17af-8"})(_templateObject10(),g.F.text_LG_regular);let A=h.ZP.p.withConfig({componentId:"sc-ddad17af-9"})(_templateObject11(),g.F.text_MD_regular,x.w.warningDark),C=h.ZP.p.withConfig({componentId:"sc-ddad17af-10"})(_templateObject12(),x.w.error,g.F.text_SM_regular);var I=t(67294),P=t(75486),N=t(87536),T=t(57492),E=t(74231),S=t(19309),Z=t(71034),D=t(3903),R=t(73409),F=t(31774),L=t(28650),k=t(35029),B=t(79765),M=t(26803),G=t(41664),$=t.n(G),z=t(76752),q=t(8993),V=t(76595),J=t(83253),H=t.n(J);function styles_templateObject(){let e=(0,f._)(["\n display: flex;\n flex-direction: column;\n gap: 1.5rem;\n padding: 1rem 0;\n"]);return styles_templateObject=function(){return e},e}function styles_templateObject1(){let e=(0,f._)(["\n font: ",";\n color: ",";\n text-align: center;\n margin: 0;\n margin-bottom: 1rem;\n"]);return styles_templateObject1=function(){return e},e}function styles_templateObject2(){let e=(0,f._)(["\n font: ",";\n color: ",";\n text-align: center;\n margin: 0;\n line-height: 1.5;\n"]);return styles_templateObject2=function(){return e},e}function styles_templateObject3(){let e=(0,f._)(["\n background: ",";\n border-radius: 12px;\n padding: 1rem;\n"]);return styles_templateObject3=function(){return e},e}function styles_templateObject4(){let e=(0,f._)(["\n display: flex;\n align-items: center;\n gap: 0.75rem;\n\n \n svg {\n color: ",";\n flex-shrink: 0;\n }\n \n span {\n font: ",";\n color: ",";\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n padding-right: 1rem;\n }\n"]);return styles_templateObject4=function(){return e},e}function styles_templateObject5(){let e=(0,f._)(["\n background: #FFF3CD;\n border: 1px solid #FFEAA7;\n border-radius: 12px;\n padding: 1rem;\n \n font: ",";\n color: #856404;\n text-align: center;\n line-height: 1.4;\n"]);return styles_templateObject5=function(){return e},e}function styles_templateObject6(){let e=(0,f._)(["\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n margin-top: 1rem;\n"]);
1return styles_templateObject6=function(){return e},e}let K=h.ZP.div.withConfig({componentId:"sc-4703290f-0"})(styles_templateObject()),U=h.ZP.h1.withConfig({componentId:"sc-4703290f-1"})(styles_templateObject1(),g.F.title_MD_bold,x.w.textPrimary),X=h.ZP.p.withConfig({componentId:"sc-4703290f-2"})(styles_templateObject2(),g.F.text_LG_regular,x.w.textSecondary),W=h.ZP.div.withConfig({componentId:"sc-4703290f-3"})(styles_templateObject3(),x.w["gray/surface"]),Q=h.ZP.div.withConfig({componentId:"sc-4703290f-4"})(styles_templateObject4(),x.w.textPrimary,g.F.text_LG_bold,x.w.textPrimary),Y=h.ZP.div.withConfig({componentId:"sc-4703290f-5"})(styles_templateObject5(),g.F.text_MD_regular),ee=h.ZP.div.withConfig({componentId:"sc-4703290f-6"})(styles_templateObject6()),en={overlay:{background:"rgba(48, 46, 69, 0.35)",zIndex:20},content:{top:"50%",left:"50%",right:"auto",bottom:"auto",marginRight:"-50%",transform:"translate(-50%, -50%)",padding:"32px",width:"100%",maxWidth:"376px",height:"auto",borderRadius:"16px",background:"#FFFFFF"}};function ModalLeadExists(e){let{modalIsOpen:n,afterOpenModal:t,closeModal:i,userType:a,leadName:l,onGoToProfile:s,onGoToListing:d}=e,c="internal"===a;return(0,r.jsxs)(H(),{isOpen:n,onAfterOpen:t,onRequestClose:i,ariaHideApp:!1,style:en,children:[(0,r.jsx)(p.q5L,{className:"closeIcon",size:24,onClick:i,style:{position:"absolute",top:"16px",right:"16px",cursor:"pointer",color:"#666"}}),(0,r.jsxs)(K,{children:[(0,r.jsx)(U,{children:"Lead j\xe1 existe na base"}),(0,r.jsx)(X,{children:c?"Encontramos um lead com as informa\xe7\xf5es que voc\xea inseriu. Confira abaixo os detalhes e escolha o que deseja fazer:":"Encontramos um lead com as informa\xe7\xf5es que voc\xea inseriu. Ele j\xe1 est\xe1 sendo acompanhado pelo nosso time interno."}),(0,r.jsx)(W,{children:(0,r.jsxs)(Q,{children:[(0,r.jsx)(p.fzv,{size:20}),(0,r.jsx)("span",{children:l})]})}),!c&&(0,r.jsx)(Y,{children:"Em caso de d\xfavidas, entre em contato com a secretaria de vendas."}),(0,r.jsx)(ee,{children:c?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(o.Z,{onClick:s,textButton:"Ir para o Perfil",styleProp:{width:"100%",marginBottom:"1rem"}}),(0,r.jsx)(o.Z,{onClick:d,textButton:"Ir para a Listagem",styleProp:{width:"100%"},category:"Outline"})]}):(0,r.jsx)(o.Z,{onClick:i,textButton:"Fechar",styleProp:{width:"100%"},category:"Outline"})})]})]})}var et=t(7884),er=t(59564),ei=t(13047);let ea=E.Ry().shape({full_name:E.Z_().required("Nome \xe9 obrigat\xf3rio").min(3,"Nome inv\xe1lido").test("full_nameValidation","Nome inv\xe1lido",e=>e.replace(/\s/g,"").length>=3).matches(V.yJ,"Nome inv\xe1lido"),phone:E.Z_().required("Numero obrigat\xf3rio").min(8,"Celular inv\xe1lido").test("phoneValidation","Celular inv\xe1lido",e=>!!e&&!(e.length<=2)&&("55"!==e.slice(0,2)||!(e.length<13))),email:E.Z_().email("Email inv\xe1lido"),hasAgentPartner:E.Z_(),enterprise:E.Z_(),interest_regions:E.IX(),source:E.Z_()}),el=[{value:"true",text:"Sim"},{value:"false",text:"N\xe3o"}],eo=new Set([k.e_.PHONE_CALL,k.e_.PHONE,k.e_.INDICATION,k.e_.BROKER_PORTFOLIO,k.e_.PROSPECTION]);function ContentAddLead(){var e,n;let[t,i]=(0,I.useState)(!1),[f,h]=(0,I.useState)(""),[g,E]=(0,I.useState)([]),[k,G]=(0,I.useState)([]),[V,J]=(0,I.useState)(null),[H,K]=(0,I.useState)([]),[U,X]=(0,I.useState)(!1),[W,Q]=(0,I.useState)(!1),[Y,ee]=(0,I.useState)(null),[en,es]=(0,I.useState)(null),[ed,ec]=(0,I.useState)(),[em,eu]=(0,I.useState)(),[ep,ex]=(0,I.useState)({isOpenModal:!1,userType:"internal",lead_name:"",lead_id:""}),[ef,eh]=(0,I.useState)("PF"),[eg,e_]=(0,I.useState)([]),[eb,ej]=(0,I.useState)(!1),[eO,ew]=(0,I.useState)(!1),{user:ev={}}=(0,L.a)(),{register:ey,handleSubmit:eA,clearErrors:eC,setValue:eI,watch:eP,getValues:eN,formState:{errors:eT,isSubmitting:eE}}=(0,N.cI)({resolver:(0,T.X)(ea)}),{isEmailAlreadyInUse:eS,debouncedSetEmail:eZ}=(0,et.$)({debounceTime:1500});(0,I.useEffect)(()=>{let e=eP((e,n)=>{let{name:t}=n;"email"===t&&eZ(e.email||"")});return()=>e.unsubscribe()},[eP,eZ]),(0,I.useEffect)(()=>{(0,S.QO)({additional_fields:["booth_coordinator","status"]}).then(e=>{let{enterprises:n}=e,t=n.map(e=>({value:e._id,text:e.name}));t.sort((e,n)=>{let t=e.text.toLowerCase(),r=n.text.toLowerCase();return t===r?0:t>r?1:-1}),G(t),E(n)}),(0,Z.SK)({role:"AGENT_PARTNER"}).then(e=>{let{users:n}=e,t=n.map(e=>({value:e._id,text:e.full_name}));K(t)}),eI("hasAgentPartner","false")},[eI]);let selectModal=e=>{h(e),i(!0)},handleFormSubmit=async e=>{var n;let t=g.find(n=>n._id===e.enterprise),r=null==ev?void 0:null===(n=ev.roles)||void 0===n?void 0:n.includes("AGENT_PARTNER");if(U&&!Y&&!eN("enterprise"))return ew(!0),ej(!0),l.Am.error("Informe o corretor parceiro"),l.Am.error("Selecione um empreendimento");if(U&&!Y)return ew(!0),l.Am.error("Informe o corretor parceiro");
1if(W&&!en)return l.Am.error("Informe o corretor patriani");if(U&&!eN("enterprise"))return ej(!0),l.Am.error("Selecione um empreendimento");if(U&&(null==t?void 0:t.status)!=="SHORT_RELEASE"&&(null==t?void 0:t.status)!=="RELEASE")return l.Am.error("Selecione um empreendimento que n\xe3o esteja em estoque");let i=(0,ei.A)(e.phone);if("PJ"!==ef)try{let n=await (0,D.wM)({phone:e.phone});if(n._id){ex({isOpenModal:!0,userType:r?"partner":"internal",lead_name:n.full_name,lead_id:n._id});return}}catch(e){}let o={full_name:e.full_name,email:e.email?e.email:void 0,phone:i,enterprise_id:e.enterprise,source:e.source,interest_regions:e.interest_regions?e.interest_regions:void 0,document_type:"PJ"===ef?"CNPJ":"CPF"};"PJ"===ef&&(delete o.phone,o.commercial_phone=i,o.document_type="CNPJ"),(null==ev?void 0:ev.roles.includes("AGENT_PARTNER"))?o.agent_id=null==ev?void 0:ev._id:(U&&(o.agent_id=Y.value._id),W&&(o.specialist_id=en.value._id)),e.email&&(o.email=e.email),eo.has(o.source)||(o.channel="MANUAL");try{let{data:e}=await (0,D.$D)({formData:o});if(selectModal("registrationConfirmed"),(0,F.oL)(ev.roles,["AGENT_PATRIANI_COORDINATOR","MARKETING","RELATIONSHIP_TEAM"])){a().push("/leads");return}a().push("/leads/profile/".concat(e.data._id,"?tab=signup&accordion=search"))}catch(e){l.Am.error((0,er.i)(e,"Falha, tente novamente!"))}};(0,I.useEffect)(()=>{(async()=>{if(ev.roles){let e=(0,F.oL)(ev.roles,"AGENT_PATRIANI_COORDINATOR"),{users:n}=await (0,Z.SK)({role:e?"AGENT_PATRIANI":"AGENT_PARTNER",limit:10});e?eu(n):ec(n)}})()},[ev]);let getAgentsList=async()=>ed,getAgentPatrianiList=async()=>em,getSearchAgentPatriani=async e=>{try{let{users:n}=await (0,Z.SK)({role:"AGENT_PATRIANI",limit:10,full_name:e,trade_name:e});return n}catch(e){return l.Am.error("Nenhum usu\xe1rio encontrado!"),[]}},getSearchAgents=async e=>{try{let{users:n}=await (0,Z.SK)({role:"AGENT_PARTNER",limit:10,full_name:e,trade_name:e});return n}catch(e){return l.Am.error("Nenhum usu\xe1rio encontrado!"),[]}};return(0,I.useEffect)(()=>{U&&(U&&eg.length||e_(g.filter(e=>"SHORT_RELEASE"===e.status||"RELEASE"===e.status).map(e=>({value:e._id,label:e.name}))))},[U,g,eg]),(0,r.jsxs)(_,{children:["registrationConfirmed"===f&&(0,r.jsx)(P.Z,{typeIcon:"Success",closeModal:()=>i(!1),modalIsOpen:t,afterOpenModal:()=>{},modalTitle:"Cadastro realizado",modalText:"Lead cadastrado com sucesso"}),(0,r.jsx)(ModalLeadExists,{modalIsOpen:ep.isOpenModal,closeModal:()=>ex(e=>({...e,isOpenModal:!1})),userType:ep.userType,leadName:ep.lead_name,onGoToProfile:()=>{a().push("/leads/profile/".concat(ep.lead_id))},onGoToListing:()=>{a().push("/leads")}}),(0,r.jsx)(b,{onSubmit:eA(handleFormSubmit),children:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(j,{children:[(0,r.jsx)(O,{children:(0,r.jsx)("h1",{children:"Informa\xe7\xf5es essenciais"})}),(0,r.jsxs)("span",{children:[(0,r.jsx)(d.Z,{titleDropdown:"Tipo de personalidade",dropdownData:q.m,handleChange:e=>{eh(e)},defaultValue:ef,styleContainer:{marginBottom:"3rem"}}),(0,r.jsx)(m.w,{titleInput:"Nome completo *",name:"full_name",...ey("full_name"),error:eT.full_name,autoFocus:!0,onClick:()=>eC("full_name")}),(0,r.jsx)(c.v,{titleInput:"Celular *",mask:"(+99) 99 99999-9999",name:"phone",error:eT.phone,type:"phone",handleOnChange:e=>eI("phone",e),onClick:()=>eC("phone"),styleContainer:{marginTop:"4.5rem"}}),(0,r.jsx)(B.Z,{dropData:M.LP.filter(e=>"INDICATION"!==e.value),hasBorder:!0,hasTitle:!0,titleDropdown:"Origem do lead",className:"dropdown",handleOnChange:e=>eI("source",e.value),error:eT.source}),(0,r.jsx)(m.w,{titleInput:"E-mail",name:"email",...ey("email"),error:eS?{message:"Esse e-mail j\xe1 est\xe1 vinculado a outro lead. Por favor, solicite um e-mail diferente ao cliente."}:eT.email,onClick:()=>eC("email"),styleContainer:{marginTop:"3.5rem"},placeholder:"Digite o email"})]})]}),(0,r.jsxs)(j,{children:[(0,r.jsx)(O,{children:(0,r.jsx)("h1",{children:"Informa\xe7\xf5es de atendimento"})}),(0,r.jsxs)("span",{children:[(null==ev?void 0:ev.roles)&&!(0,F.oL)(null==ev?void 0:ev.roles,"AGENT_PATRIANI_COORDINATOR")&&(0,r.jsx)(I.Fragment,{children:(0,F.oL)(null==ev?void 0:ev.roles,"AGENT_PARTNER")?(0,r.jsx)(I.Fragment,{children:V&&(0,r.jsxs)(w,{style:{marginTop:"2rem"},children:[(0,r.jsx)("h2",{children:"Coordenador respons\xe1vel"}),(0,r.jsxs)("main",{children:[(0,r.jsx)(u.Z,{heightImage:40,widthImage:40,imageUrl:null!==(e=V.image)&&void 0!==e?e:null}),(0,r.jsx)("h1",{children:V.full_name}),(0,r.jsxs)("section",{children:[(0,r.jsx)("h3",{children:V.phone}),(0,r.jsxs)("aside",{children:[(0,r.jsx)(p.C3L,{size:18,color:x.w.primary}),(0,r.jsx)("h5",{children:V.email})]})]})]})]})}):(0,r.jsx)(d.Z,{dropdownData:el,titleDropdown:"Corretor parceiro?",titleDisabledOption:U?"Sim":"N\xe3o",name:"hasAgentPartner",register:ey,setValue:eI,handleChange:e=>{X("true"===e)},styleContainer:!U&&{marginBottom:"3rem"}})}),U&&(0,r.jsx)(A,{children:"Corretores parceiros s\xf3 poderam ser vinculados a Empreendimentos que s\xe3o
1Estoque"}),(null==ev?void 0:ev.roles)&&(0,r.jsx)(r.Fragment,{children:!(0,F.oL)(null==ev?void 0:ev.roles,"AGENT_PARTNER")&&(0,r.jsx)(I.Fragment,{children:U&&(0,r.jsxs)(v,{choiceAgentError:eO,children:[(0,r.jsxs)("span",{className:"agent-partner",children:[(0,r.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:"0.5rem",marginBottom:"3rem"},children:[(0,r.jsx)(R.s,{hasTitle:!1,hasBorder:!0,getData:getAgentsList,getSearchData:getSearchAgents,setSelect:e=>{ee(e),ew(!1)},defaultValue:Y,value:Y,placeholder:"Corretor parceiro"}),eO&&(0,r.jsx)(C,{children:"Campo obrigat\xf3rio"})]}),(0,r.jsx)($(),{href:"/enterprises/contract/broker/registration",target:"_blank",children:(0,r.jsx)(s.Z,{Icon:p.OvN,colorIcon:x.w.white,textButton:"Adicionar",type:"button"})}),(0,r.jsx)($(),{href:"/enterprises/contract/broker/registration",target:"_blank",children:(0,r.jsx)(s.Z,{className:"mobile",textButton:"",type:"button",Icon:p.OvN})})]}),V&&(0,r.jsxs)(w,{style:{marginTop:"2rem"},children:[(0,r.jsx)("h2",{children:"Coordenador respons\xe1vel"}),(0,r.jsxs)("main",{children:[(0,r.jsx)(u.Z,{heightImage:40,widthImage:40,imageUrl:null!==(n=V.image)&&void 0!==n?n:null}),(0,r.jsx)("h1",{children:V.full_name}),(0,r.jsxs)("section",{children:[(0,r.jsx)("h3",{children:V.phone}),(0,r.jsxs)("aside",{children:[(0,r.jsx)(p.C3L,{size:18,color:x.w.primary}),(0,r.jsx)("h5",{children:V.email})]})]})]})]})]})})}),(0,r.jsx)(B.Z,{hasBorder:!0,hasTitle:!1,error:eb&&{message:"Campo obrigat\xf3rio"},dropData:U?eg:k.map(e=>({...e,label:e.text})),titleDisabledOption:"Empreendimento",handleOnChange:e=>{var n;eI("enterprise",e.value);let t=g.find(n=>n._id===e.value);J(null!==(n=null==t?void 0:t.booth_coordinator)&&void 0!==n?n:null),eC("enterprise"),ej(!1)}}),(null==ev?void 0:ev.roles)&&(0,F.oL)(null==ev?void 0:ev.roles,"AGENT_PATRIANI_COORDINATOR")&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(d.Z,{dropdownData:el,titleDropdown:"Agente patriani?",titleDisabledOption:W?"Sim":"N\xe3o",name:"hasAgentPatriani",register:ey,handleChange:e=>{Q("true"===e)}}),W&&(0,r.jsxs)("span",{className:"agent-partner",children:[(0,r.jsx)(R.s,{hasTitle:!1,hasBorder:!0,getData:getAgentPatrianiList,getSearchData:getSearchAgentPatriani,setSelect:es,defaultValue:en,value:en,placeholder:"Agente patriani"}),(0,r.jsx)($(),{href:"/signup/agent",target:"_blank",children:(0,r.jsx)(s.Z,{Icon:p.OvN,colorIcon:x.w.white,textButton:"Adicionar",type:"button"})}),(0,r.jsx)($(),{href:"/signup/agent",target:"_blank",children:(0,r.jsx)(s.Z,{className:"mobile",textButton:"",type:"button",Icon:p.OvN})})]})]}),!(0,F.oL)(null==ev?void 0:ev.roles,"AGENT_PATRIANI_COORDINATOR")&&(0,r.jsx)(y,{children:(0,r.jsx)(z.N,{options:M.Pn.sort((e,n)=>e.label.localeCompare(n.label)),title:"Regi\xe3o de interesse",subTitle:"Selecione",onChange:e=>{eI("interest_regions",e.length<=0?[]:e.map(e=>e.value).sort()),eC("interest_regions")}})})]})]}),(0,r.jsx)(o.Z,{textButton:"Cadastrar",loading:eE})]})})]})}},13047:function(e,n,t){t.d(n,{A:function(){return normalizeDigits}});function normalizeDigits(e){return String(e||"").replace(/\D/g,"")}},76595:function(e,n,t){function regexPhone(e){return e?e.replace(/\D/g,"").replace(/^(\d{2})\B/,"($1) ").replace(/(\d{1})?(\d{4})(\d{4})/,"$1$2-$3"):""}function regexDate(e){return e?e.replace(/\D/g,"").replace(/(\d{2})(\d)/,"$1/$2").replace(/(\d{2})(\d)/,"$1/$2").replace(/(\d{4})(\d)/,"$1"):""}function regexCPF(e){return e?e.replace(/\D/g,"").replace(/(\d{3})(\d)/,"$1.$2").replace(/(\d{3})(\d)/,"$1.$2").replace(/(\d{3})(\d{1,2})/,"$1-$2").replace(/(-\d{2})\d+?$/,"$1"):""}t.d(n,{BM:function(){return regexDate},BV:function(){return r},C3:function(){return regexPhone},EN:function(){return regexCPF},yJ:function(){return i}});let r=/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*&#])[A-Za-z\d@$!%*&#]{8,}$/,i=/^(?!-)(?!.*-$)[a-zA-Zà -úÃ-Ã\s]+(?:[-][a-zA-Zà -úÃ-Ã\s]+)*$/}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.