(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5866],{52379:function(e,s,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/profile/security",function(){return a(88359)}])},62464:function(e,s){"use strict";s.Z={src:"/_next/static/media/lock.e3afddfc.svg",height:20,width:20,blurWidth:0,blurHeight:0}},39821:function(e,s,a){"use strict";var t=a(85893),i=a(42994),l=a(96260);s.Z=e=>{let{children:s}=e;return(0,t.jsxs)(l.Z,{children:[(0,t.jsxs)("div",{className:"max-sm:hidden flex bg-white max-sm:bg-transparent mt-8 rounded-[12px] shadow-lg max-sm:shadow-none",children:[(0,t.jsx)(i.Z,{}),(0,t.jsx)("div",{className:"w-full h-100 border-l-2 max-sm:hidden",children:s})]}),(0,t.jsx)("div",{className:"hidden max-sm:flex flex-col",children:s})]})}},24394:function(e,s,a){"use strict";var t=a(85893),i=a(11163),l=a(84295),r=a(18644);s.Z=e=>{let s=(0,i.useRouter)();return(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"hidden max-sm:flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)(l.Wuc,{onClick:()=>s.back(),color:"#1F2026"}),(0,t.jsx)("p",{className:"text-[#1F2026] bold text-[20px]",children:e.title})]}),(0,t.jsx)(r.bI9,{size:24,className:"cursor-pointer text-[#CDD0D9] hover:text-white max-sm:text-[#82848E]"})]}),(0,t.jsx)("p",{className:"max-sm:hidden text-[#1F2026] bold text-[20px]",children:e.title})]})}},42994:function(e,s,a){"use strict";a.d(s,{Z:function(){return A}});var t=a(85893),i=a(35653),l=a(87362),r=a(90512),n=a(25675),c=a.n(n),d=a(41664),o=a.n(d),x=a(11163),u={src:"/_next/static/media/call_hospital.7919c444.svg",height:18,width:18,blurWidth:0,blurHeight:0},m={src:"/_next/static/media/student card.175f42cd.svg",height:20,width:20,blurWidth:0,blurHeight:0},h={src:"/_next/static/media/student card_selected.a29f3128.svg",height:20,width:20,blurWidth:0,blurHeight:0},p={src:"/_next/static/media/shield-check.4659a9a3.svg",height:20,width:20,blurWidth:0,blurHeight:0},f={src:"/_next/static/media/shield-check_selected.da2a2fd0.svg",height:20,width:20,blurWidth:0,blurHeight:0},j=a(62464),v={src:"/_next/static/media/lock_selected.70223ac0.svg",height:20,width:20,blurWidth:0,blurHeight:0},g={src:"/_next/static/media/coin-dollar.d3248456.svg",height:20,width:20,blurWidth:0,blurHeight:0},w={src:"/_next/static/media/coin-dollar_selected.1d97cea1.svg",height:20,width:20,blurWidth:0,blurHeight:0},b=a(33299),N=a(28601),_=a(18644),A=()=>{let e=(0,x.useRouter)(),s=s=>{let a=e.pathname===s.path;return(0,t.jsxs)("div",{children:[(0,t.jsx)(o(),{href:s.path,prefetch:!1,className:"max-sm:hidden",children:(0,t.jsxs)("div",{className:(0,r.Z)((0,i.L)({className:(0,r.Z)("flex-row flex p-4 w-[280px] max-sm:min-w-full h-[60px] group rounded-none justify-start",a?"bg-[#111111]":"bg-white")})),children:[(0,t.jsx)(c(),{alt:"",src:a?s.selectedIcon:s.icon,width:32,height:32}),(0,t.jsx)("p",{className:(0,r.Z)("text-[16px]",a?"text-white":"text-[#1F2026]"),children:s.title}),(0,t.jsx)("div",{className:"h-[10px] w-full group-hover:bg-[#FF7B2E] rounded-full absolute bottom-[-5px]"})]})}),(0,t.jsxs)("div",{className:(0,r.Z)((0,i.L)({className:"hidden max-sm:flex flex-row p-4 w-[280px] max-sm:min-w-full h-[60px] group rounded-none justify-start bg-transparent border-b-2"})),onClick:()=>e.push(s.path),children:[(0,t.jsx)(c(),{alt:"",src:s.icon,width:32,height:32}),(0,t.jsx)("p",{className:(0,r.Z)("text-[16px] text-[#525359]"),children:s.title})]})]})};return(0,t.jsxs)("div",{className:"w-full max-w-[280px] max-sm:max-w-full",children:[(0,t.jsxs)("div",{className:"hidden max-sm:flex items-center justify-between px-6 mt-4",children:[(0,t.jsx)("div",{className:"flex items-center gap-4",children:(0,t.jsx)("p",{className:"text-[#1F2026] bold text-[20px]",children:"Perfil"})}),(0,t.jsx)(_.bI9,{size:24,className:"cursor-pointer text-[#CDD0D9] hover:text-white max-sm:text-[#82848E]"})]}),(0,t.jsx)("div",{className:"hidden max-sm:flex",children:(0,t.jsx)(N.Z,{})}),(0,t.jsx)("p",{className:"m-4 max-sm:mt-10 text-[#1F2026] semibold text-[20px]",children:"Configura\xe7\xf5es"}),(0,t.jsx)(s,{icon:m,path:"/profile/person-info",selectedIcon:h,title:"Informa\xe7\xf5es pessoais"}),(0,t.jsx)(s,{icon:j.Z,path:"/profile/password-change",selectedIcon:v,title:"Alterar senha"}),(0,t.jsx)(s,{icon:g,path:"/profile/financial-data",selectedIcon:w,title:"Dados financeiros"}),(0,t.jsx)(s,{icon:p,path:"/profile/security",selectedIcon:f,title:"Seguran\xe7a (2FA)"}),(0,t.jsx)(s,{icon:u,path:"/profile/help-center",selectedIcon:u,title:"Central de ajuda"}),(0,t.jsx)("div",{className:"p-4",children:(0,t.jsx)(l.A,{className:"w-full",variant:"bordered",onClick:()=>(0,b.signOut)(),children:(0,t.jsx)("p",{className:"semibold",children:"Logout"})})})]})}},28601:function(e,s,a){"use strict";var t=a(85893),i=a(26697),l=a(93093),r=a(20572),n=a(34863),c=a(87362),d=a(49559),o=a(47873),x=a(34210),u=a(21974),m=a(33299),h=a(67294),p=a(78773),f=a(55678),j=a(36207),v=a(25675),g=a.n(v),w=a(90512);s.Z=()=>{var e,s,a,v,b;let{update:N,data:_,status:A}=(0,m.useSession)(),{isPosting:D,abstractPost:C}=(0,l.Z)(),[k,y]=(0,h.useState)(null),{isOpen:P,onOpen:F,onClose:Z}=(0,r.q)();return(0,h.useEffect)(()=>{var e,s;(null==_?void 0:null===(s=_.userData)||void 0===s?void 0:null===(e=s.user_media)||void 0===e?void 0:e.profile_image_url)&&y(()=>{var e,s;return null==_?void 0:null===(s=_.userData)||void 0===s?void 0:null===(e=s.user_media)||void 0===e?void 0:e.profile_image_url})},[A]),(0,t.jsxs)("div",{className:"flex w-full gap-8 mt-4 items-center max-sm:p-4 max-sm:mt-0 max-sm:gap-2 overflow-x-hidden",children:[(0,t.jsxs)("div",{className:"relative",children:[D&&(0,t.jsx)(n.c,{color:"white",size:"lg",className:"absolute self-center top-10 left-10"}),k?(0,t.jsx)("img",{src:k,alt:"",className:(0,w.Z)("rounded-[100%] min-w-[160px] min-h-[160px] max-w-[160px] max-h-[160px] border-[#FF7B2E] border-3","max-sm:max-w-[60px] max-sm:max-h-[60px] max-sm:min-w-[60px] max-sm:min-h-[60px]"),style:{objectFit:"cover"}}):(0,t.jsx)(p.wzp,{className:(0,w.Z)("min-w-[160px] min-h-[160px] max-w-[160px] max-h-[160px] ","max-sm:max-w-[60px] max-sm:max-h-[60px] max-sm:min-w-[60px] max-sm:min-h-[60px]")})]}),(0,t.jsxs)("div",{className:"w-full max-sm:hidden",children:[(0,t.jsx)(c.A,{className:"rounded-[32px] px-8 bg-[#393A3F] text-white semibold",onPress:F,children:"Atualizar foto de perfil"}),(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsx)("p",{children:"Recomendado pelo menos 800x800px"}),(0,t.jsx)("p",{children:"Apenas JPG e PNG s\xe3o permitidos"})]})]}),(0,t.jsxs)("div",{className:"hidden max-sm:flex justify-between w-full",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("p",{className:"text-[#1F2026] semibold",children:[null==_?void 0:null===(e=_.userData.user)||void 0===e?void 0:e.first_name," ",null==_?void 0:null===(s=_.userData.user)||void 0===s?void 0:s.last_name]}),(0,t.jsx)("p",{className:"text-[12px]",children:null==_?void 0:null===(a=_.userData.user)||void 0===a?void 0:a.email})]}),(0,t.jsxs)(c.A,{className:"text-[12px] max-h-[32px] max-w-[110px]",startContent:(0,t.jsx)(g(),{alt:"",src:j.Z,style:{width:"20px",height:"20px"}}),children:[null==_?void 0:null===(b=_.userData.wallet)||void 0===b?void 0:null===(v=b.wallet_address)||void 0===v?void 0:v.slice(0,8),"..."]})]}),(0,t.jsx)(d.R,{size:"2xl",isOpen:P,onClose:Z,children:(0,t.jsx)(o.A,{className:"bg-white",children:e=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(x.k,{className:"flex flex-col gap-1",children:"Selecionar imagem"}),(0,t.jsx)(u.I,{children:(0,t.jsx)(i.xs,{onSaveImage:s=>{(function(e){if(e){let s=new FormData;s.append("file",e),C("/users/photo",s).then(e=>{200===e.status&&(_.userData.user_media.profile_image_url=e.data.profile_image_url,N(_),f.Am.success("Imagem atualizada!"))})}})(s),e()}})})]})})})]})}},88359:function(e,s,a){"use strict";a.r(s),a.d(s,{default:function(){return F}});var t=a(85893),i=a(67294),l=a(39821),r=a(20572),n=a(34863),c=a(48781),d=a(69443),o=a(16461),x=a(87362),u=a(49559),m=a(47873),h=a(34210),p=a(21974),f=a(39470),j=a(26697),v=a(87536),g=a(25675),w=a.n(g),b={src:"/_next/static/media/google.3fb48f8d.svg",height:56,width:184,blurWidth:0,blurHeight:0},N={src:"/_next/static/media/apple.f0a339e5.svg",height:56,width:183,blurWidth:0,blurHeight:0},_=a(93093),A=a(33299),D=a(55678),C=a(18644),k=a(24394),y=a(19222);let P=()=>{var e,s;let{data:a,status:l,update:g}=(0,A.useSession)(),{control:P,formState:{errors:F,isValid:Z},handleSubmit:I,reset:E}=(0,v.cI)(),{abstractPost:S,isPosting:z}=(0,_.Z)(),{isOpen:H,onOpen:W,onClose:R}=(0,r.q)(),[L,q]=(0,i.useState)(!1),[G,O]=(0,i.useState)(!1),[T,B]=(0,i.useState)("APP"),[X,J]=(0,i.useState)(!1),[Y,Q]=(0,i.useState)(""),[K,M]=(0,i.useState)(""),[U,V]=(0,i.useState)(""),$=(0,i.useRef)(Date.now()),ee=(0,i.useRef)(null);return(0,i.useEffect)(()=>((null==a?void 0:a.userData.user_auth.type)&&B(()=>a.userData.user_auth.type),(null==a?void 0:a.userData.user_auth.status)&&V(()=>a.userData.user_auth.status),window.addEventListener("keydown",e=>{var s;"Enter"===e.key&&Z&&(null===(s=ee.current)||void 0===s||s.click())}),()=>window.removeEventListener("keydown",()=>{})),[]),(0,i.useEffect)(()=>{"APP"===T&&"Inativo"===U&&S("/users/2af/generate",{type:"APP"}).then(e=>{200===e.status&&(Q(e.data.qrcode),M(e.data.secret))})},[T,G]),(0,t.jsxs)("div",{className:"flex-1 h-full p-4",children:[(0,t.jsx)(k.Z,{title:"Seguran\xe7a (2FA)"}),"loading"===l?(0,t.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,t.jsx)(n.c,{})}):(0,t.jsx)("div",{children:(null==a?void 0:null===(s=a.userData)||void 0===s?void 0:null===(e=s.user_auth)||void 0===e?void 0:e.status)==="Ativo"?(0,t.jsx)("div",{className:"flex-1 h-full p-4",children:(0,t.jsxs)("div",{className:"bg-gray-300 p-3 rounded-full w-1/2 max-sm:w-full flex justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(C.OYx,{size:24,color:"green"}),(0,t.jsx)("p",{children:"Autentica\xe7\xe3o por 2 fatores: Ativado"})]}),(0,t.jsx)(c.i,{color:"success",isSelected:!0,onChange:e=>O(()=>e.currentTarget.checked),onClick:W})]})}):(0,t.jsxs)("div",{className:"p-4 flex flex-col h-full gap-4",children:[(0,t.jsxs)("div",{className:"bg-gray-300 p-3 rounded-full w-1/2 max-sm:w-full flex justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)(C.OYx,{size:24}),(0,t.jsx)("p",{children:"Deseja habilitar a autentica\xe7\xe3o por 2 fatores?"})]}),(0,t.jsx)(c.i,{color:"success",checked:G,onChange:e=>O(e.currentTarget.checked)})]}),G&&(0,t.jsx)("div",{className:"",children:(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("p",{children:"Selecione a forma que deseja receber o c\xf3digo"}),(0,t.jsx)("div",{className:"flex flex-col gap-4 mt-2",children:(0,t.jsx)(d.X,{orientation:"horizontal",value:T,onChange:e=>B(e.currentTarget.value),children:(0,t.jsx)(o.J,{value:"APP",children:"Google Autenticator"})})}),"APP"===T&&(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsxs)("div",{className:"w-full flex flex-col gap-4 items-center",children:[(0,t.jsx)("p",{className:"bold text-[18px]",children:"Passo 1"}),(0,t.jsx)("p",{className:"text-center text-[14px]",children:"Fa\xe7a o download do Google Authenticator nos links abaixo para verifica\xe7\xe3o de dois fatores"}),(0,t.jsxs)("div",{className:"flex flex-col items-center",children:[(0,t.jsx)(x.A,{className:"h-[60px] w-[180px] border-0",variant:"ghost",children:(0,t.jsx)(w(),{alt:"",src:b})}),(0,t.jsx)(x.A,{className:"h-[60px] w-[180px] border-0",variant:"ghost",children:(0,t.jsx)(w(),{alt:"",src:N})})]})]}),(0,t.jsxs)("div",{className:"w-full flex flex-col items-center border-l-1 border-r-1 px-4",children:[(0,t.jsx)("p",{className:"bold text-[18px]",children:"Passo 2"}),(0,t.jsx)("p",{className:"text-[14px]",children:"Escaneie o c\xf3digo QR Code abaixo com o App do Google Authenticator e insira o c\xf3digo obtido pelo App "}),(0,t.jsx)("img",{alt:"",src:Y,width:170,height:170})]}),(0,t.jsxs)("div",{className:"flex flex-col w-full items-center px-4",children:[(0,t.jsx)("p",{className:"bold text-[18px]",children:"Passo 3"}),(0,t.jsx)("p",{className:"text-[14px]",children:"Para continuar com a verifica\xe7\xe3o em duas etapas em nossa plataforma, por favor, insira abaixo o c\xf3digo recebido atrav\xe9s do seu App Google Authenticator"}),(0,t.jsxs)("div",{className:"w-full",children:[(0,t.jsx)(j.oH,{control:P,errors:F,name:"code",validator:{required:!0},title:"C\xf3digo via Google Authenticator",label:"Insira o c\xf3digo",className:"mt-4 w-full",onChangeText:e=>J(6===e.length)}),(0,t.jsx)(x.A,{ref:ee,className:"semibold rounded-[32px] px-4 bg-[#FF7B2E] w-full max-sm:w-full",isDisabled:!X,onClick:I(function(e){S("/users/2af/confirm",{code:e.code,type:T}).then(e=>{200===e.status?(D.Am.success("2FA ativado com sucesso"),a.userData.user_auth.status="Ativo",a.userData.user_auth.type=T,g(a)):401===e.status&&D.Am.error("C\xf3digo incorreto")})}),isLoading:z,children:"Confirmar"})]})]})]})]})})]})}),L&&!z&&(null==a?void 0:a.userData.user_auth.status)==="Ativo"&&(0,t.jsxs)("div",{className:"flex flex-1 h-2/3 flex-col gap-4 items-center justify-center",children:[(0,t.jsx)("p",{children:"Digite o c\xf3digo do app de autentica\xe7\xe3o para confirmar."}),(0,t.jsxs)("div",{className:"flex flex-col gap-4 w-1/3 max-sm:w-[90%]",children:[(0,t.jsx)(j.oH,{control:P,errors:F,name:"code",validator:{required:!0},maxLength:6,title:"C\xf3digo do APP",label:"Insira o c\xf3digo de 6 d\xedgitos",maskFunction:(e,s)=>(0,y.Ch)(e),className:"w-full",customRightElement:(0,t.jsx)("div",{children:(0,t.jsx)(j.IT,{targetDate:$.current,finishedComponent:(0,t.jsx)("div",{className:"cursor-pointer text-[12px] text-nowrap",onClick:function(){},children:(0,t.jsx)("p",{className:"text-[#0D3C48] semibold",children:"Reenviar c\xf3digo"})})})})}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(x.A,{className:"semibold rounded-full flex-grow px-8 text-white",color:"success",onClick:I(function(e){S("/users/2af/desactivate",{code:e.code}).then(e=>{200===e.status&&(a.userData.user_auth.status="Inativo",g(a),D.Am.success("A autentica\xe7\xe3o por 2 fatores foi desabilitada"),q(!0),V("Inativo"),E())})}),isLoading:z,ref:ee,children:"Confirmar"}),(0,t.jsx)(x.A,{onClick:()=>q(!1),className:"semibold rounded-full px-8 flex-grow text-white bg-yellow-500",children:"Cancelar"})]})]})]}),L&&z&&(null==a?void 0:a.userData.user_auth.status)==="Ativo"&&(0,t.jsx)("div",{className:"flex flex-1 h-2/3 w-full justify-center items-center",children:(0,t.jsx)(n.c,{})}),(0,t.jsx)(u.R,{size:"md",isOpen:H,onClose:R,children:(0,t.jsx)(m.A,{className:"bg-white",children:e=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(h.k,{className:"flex flex-col gap-1",children:"Desabilitar autentica\xe7\xe3o por 2 fatores?"}),(0,t.jsx)(p.I,{children:(0,t.jsx)("p",{children:"Desabilitar a autentica\xe7\xe3o por 2 fatores far\xe1 com que voc\xea possa apenas visualizar informa\xe7\xf5es em nossa plataforma, n\xe3o podendo realizar transa\xe7\xf5es e editar informa\xe7\xf5es por exemplo. Deseja continuar?"})}),(0,t.jsxs)(f.R,{children:[(0,t.jsx)(x.A,{className:"semibold",color:"danger",variant:"light",onPress:e,children:"Cancelar"}),(0,t.jsx)(x.A,{className:"semibold",variant:"shadow",onPress:()=>{q(!0),e()},children:"Continuar"})]})]})})})]})};P.getLayout=function(e){return(0,t.jsx)(l.Z,{children:e})};var F=P}},function(e){e.O(0,[3365,4885,4838,4396,509,7473,5733,4143,5675,7739,1664,4691,9926,4822,1716,6260,6697,2888,9774,179],function(){return e(e.s=52379)}),_N_E=e.O()}]);