PageSourceSearch

https://spmweb.unimedcampinas.com.br/_next/static/chunks/pages/ben…/atualizar-cadastro-0e7f7f6d78043d21.js

js unimedcampinas.com.br collected 2026-09-24 10:38:53 UTC 42,398 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4970],{75041:function(e,n,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/beneficiarios/editar/atualizar-cadastro",function(){return r(45250)}])},45250:function(e,n,r){"use strict";r.r(n),r.d(n,{default:function(){return eK}});var t=r(85893),i=r(72684),a=r(98839),o=r(25964),l=r(10019),s=r(97),d=r(16591),c=r(10629),u=r(485),m=r(74618),p=r(67294),v=r(82580),f=r(84462),x=r(62089),h=r(82713),g=r(3784),b=r(70717),j=r(68296),y=r(97883),C=r(88767),Z=r(31525),T=r(94454),_=r(10212);let S=e=>({value:(null==e?void 0:e.cod_classif_ender)||"",label:(0,_.Oo)((null==e?void 0:e.descricao)||"")});var q=async()=>{try{let e=await (0,T.F)({callId:"getAddressClassification",url:"".concat(T.QH,"/tipos/retornar-classifender"),method:"GET",needToken:!0,params:{}});if(!e.error&&e.request&&e.request.dados&&e.request.dados.length>0)return e.request.dados.map(S);return[]}catch(n){return[]}},w=r(28022);let P=e=>{let{...n}=e,{contract:r}=(0,Z.c)(),{data:i,isLoading:a}=(0,C.useQuery)(["address-classification",null==r?void 0:r.id],q),o=(0,p.useMemo)(()=>i||[],[i]);return(0,t.jsx)(w.Z,{data:o,label:"Classifica\xe7\xe3o",isLoading:a,...n})};var E=r(71085),I=r(24160),F=r(37098),N=r(92680),D=async e=>{try{let n=await (0,T.F)({callId:"getBeneficiaryPostalAddresses",url:"".concat(T.QH,"/wspm0005/obter-endereco-postal"),method:"GET",needToken:!0,params:{idUsrContr:e}});if(!n.error&&n.request&&n.request.data&&n.request.data.length>0)return n.request.data.map(N.nG);return[]}catch(r){return[]}},k=async e=>{let{personId:n,classification:r,zipcode:t,street:i,number:a,complement:o,neighborhood:l,state:s,city:d}=e;try{let c=await (0,T.F)({callId:"updateAddress",url:"".concat(T.QH,"/wspm0005/editar-endereco-postal"),method:"POST",needToken:!0,params:{cep:t.replace(/\D/g,""),logradouro:i,numero_logradouro:a,complemento:o,bairro:l,cidade:d,estado:s,codigo_classificacao:r,id_pessoa:Number(n)}});return c}catch(u){return{error:"server",request:!1}}},O=async e=>{try{let n=await (0,T.F)({callId:"checkIfBeneficiaryHasPendingChangesMessage",url:"".concat(T.QH,"/wspm0005/validar-dados-pendente-recadastramento"),method:"GET",needToken:!0,params:{idUsrContr:e}});if(!n.error&&n.request.data)return n.request.data;return null}catch(r){return null}};let G=(0,p.createContext)({}),A=e=>{let{children:n}
1=e,{beneficiaryId:r}=(0,m.t)(),[i,a]=(0,p.useState)([]),{data:o,refetch:l}=(0,C.useQuery)(["pending-changes-message",r],()=>O(r)),s=(0,p.useCallback)(e=>{a(n=>n.includes(e)?n.filter(n=>n!==e):[...n,e])},[]),d=(0,p.useMemo)(()=>({step:i,setStep:s,pendingChangeMessage:o,checkIFHasPendingChangesMessage:l}),[l,s,o,i]);return(0,t.jsx)(G.Provider,{value:d,children:n})},L=()=>{let e=(0,p.useContext)(G);if(!e)throw Error("useController must be used within an UseControllerProvider");return e},R=(0,p.createContext)({}),M=e=>{let{children:n}=e,{toastSuccessMessage:r,errorMessage:i}=(0,F.Z)(),{checkIFHasPendingChangesMessage:a}=L(),{beneficiary:o,beneficiaryId:l}=(0,m.t)(),[s,d]=(0,p.useState)("list"),[c,u]=(0,p.useState)(void 0),v=(0,p.useCallback)(e=>{u(e),d("form")},[]),f=(0,p.useCallback)(()=>{u(void 0),d("form")},[]),{data:x,isLoading:h,isRefetching:g,refetch:b}=(0,C.useQuery)(["beneficiary-postal-addresses",l],()=>D(l)),j=(0,C.useMutation)(k,{onSuccess:e=>e.error?i(e.errorMessage):(b(),a(),d("list"),r("Endere\xe7o salvo com sucesso!"))}),y=(0,p.useCallback)(e=>{j.mutate({...e,personId:(null==o?void 0:o.id)||""})},[null==o?void 0:o.id,j]),Z=(0,p.useMemo)(()=>({addresses:x||[],isLoadingAddresses:h||g,step:s,setStep:d,selectedAddress:c,handleEditAddress:v,handleAddAddress:f,isSavingAddress:j.isLoading,handleSaveAddress:y,isEditing:!!c}),[x,f,v,y,h,g,c,s,j.isLoading]);return(0,t.jsx)(R.Provider,{value:Z,children:n})},z=()=>{let e=(0,p.useContext)(R);if(!e)throw Error("useController must be used within an UseControllerProvider");return e};var B=r(74231);let Q=B.Ry().shape({classification:B.Z_().required()});var U=r(7297),H=r(186);function V(){let e=(0,U.Z)(["\n  max-width: 40rem;\n\n  @media (max-width: 991px) {\n    max-width: 100%;\n  }\n"]);return V=function(){return e},e}let X=H.ZP.form(V()),Y=()=>{let{setStep:e,selectedAddress:n,isSavingAddress:r,handleSaveAddress:i,isEditing:o}=z(),[l,s]=(0,p.useState)(!1),{values:d,setFieldValue:c,handleChange:m,handleBlur:C,handleSubmit:Z,errors:T,touched:_}=(0,v.TA)({initialValues:{classification:(null==n?void 0:n.classification)||"",zipcode:(null==n?void 0:n.zipcode)||"",street:(null==n?void 0:n.street)||"",number:(null==n?void 0:n.number)||"",complement:(null==n?void 0:n.complement)||"",neighborhood:(null==n?void 0:n.neighborhood)||"",state:(null==n?void 0:n.stateId)||"",city:(null==n?void 0:n.cityId)||""},validationSchema:Q,onSubmit:e=>i(e),enableReinitialize:!0}),S=(0,p.useCallback)(async e=>{if(c("zipcode",e),9===e.length)try{s(!0);let n=await (0,x.Z)(e);s(!1),(null==n?void 0:n.street)&&c("street",n.street),(null==n?void 0:n.neighborhood)&&c("neighborhood",n.neighborhood),(null==n?void 0:n.city)&&c("city",n.city.id),(null==n?void 0:n.state)&&c("state",n.state.id)}catch(r){s(!1)}},[c]);return(0,t.jsxs)(X,{onSubmit:Z,children:[(0,t.jsx)("p",{children:(0,t.jsx)("strong",{children:o?"Editar endere\xe7o":"Cadastrar novo endere\xe7o"})}),(0,t.jsxs)(j.X,{isFieldGrid:!0,columns:"2fr 1fr 1fr",children:[(0,t.jsx)(P,{id:"classification",value:d.classification,onChange:e=>c("classification",e.value),error:_.classification&&T.classification&&T.classification||void 0,isRequired:!0}),(0,t.jsx)(b.Z,{id:"zipcode",name:"zipcode",mask:"cep",label:"CEP",value:d.zipcode,onChange:e=>S(e.target.value),error:_.zipcode&&T.zipcode&&T.zipcode||void 0}),(0,t.jsx)(a.Z,{isVisible:l,children:(0,t.jsx)(f.eA,{children:(0,t.jsx)(y.Z,{})})},"zipcode-loader")]}),(0,t.jsxs)(j.X,{columns:"3fr 1fr",isFieldGrid:!0,children:[(0,t.jsx)(b.Z,{id:"street",name:"street",mask:"noSpecialChar",label:"Logradouro",value:d.street,onChange:m,onBlur:C,error:_.street&&T.street&&T.street||void 0}),(0,t.jsx)(b.Z,{id:"number",name:"number",mask:"noSpecialChar",label:"N\xfamero",value:d.number,onChange:m,onBlur:C,error:_.number&&T.number&&T.number||void 0})]}),(0,t.jsxs)(j.X,{columns:"1fr 1fr",isFieldGrid:!0,children:[(0,t.jsx)(b.Z,{id:"complement",name:"complement",label:"Complemento",mask:"noSpecialChar",value:d.complement,onChange:m,onBlur:C,error:_.complement&&T.complement&&T.complement||void 0,maxLength:20}),(0,t.jsx)(b.Z,{id:"neighborhood",name:"neighborhood",label:"Bairro",mask:"noSpecialChar",value:d.neighborhood,onChange:m,onBlur:C,error:_.neighborhood&&T.neighborhood&&T.neighborhood||void 0})]}),(0,t.jsxs)(j.X,{columns:"1fr 1fr",isFieldGrid:!0,mb:"1.5rem",children:[(0,t.jsx)(I.Z,{id:"state",label:"Estado",error:_.state&&T.state&&T.state||void 0,onChange(e){c("state",e.value),c("city","")},value:d.state,countryId:"BRASIL"}),(0,t.jsx)(E.Z,{id:"city",label:"Cidade",error:_.city&&T.city&&T.city||void 0,onChange:e=>c("city",e.value),value:d.city,stateId:d.state,countryId:"BRASIL"})]}),(0,t.jsxs)(u.aT,{children:[(0,t.jsx)(g.Z,{theme:"mainGreen",text:"Salvar",type:"submit",isLoading:r}),(0,t.jsx)(h.Z,{text:"Cancelar",onClick:()=>e("list")})]})]})};var J=r(65978),$=r(86726);function W(){let e=(0,U.Z)([""]);return W=function(){return e},e}let K=H.ZP.div(W()),ee=()=>{let{handleAddAddress:e,handleEditAddress:n,addresses:r}=z();return(0,t.jsxs)(K,{children:[(0,t.jsx)($.Z,{data:r,headerColumns:[{label:"Classifica\xe7\xe3o",field:"classification"}
1,{label:"CEP",field:"zipcode"},{label:"Logradouro",field:"street"},{label:"Cidade",field:"city"},{label:"N\xfamero",field:"number"},{label:"Bairro",field:"neighborhood"},{label:"Complemento",field:"complement"},{label:"Estado",field:"state"},{label:"",render:e=>(0,t.jsx)("div",{className:"row-buttons",children:(0,t.jsx)("button",{type:"button",onClick:()=>n(e),children:"editar"})})}],filterFunction:()=>r,defaultSortField:"classification",defaultSortOrder:"asc",disableFilter:!0,disablePagination:!0,perPage:9999}),(0,t.jsx)(u.aT,{children:(0,t.jsx)(J.Z,{onClick:()=>e(),children:" + inserir novo endere\xe7o"})})]})},en=()=>{let{step:e}=z(),n=(0,p.useCallback)(()=>{let n={form:(0,t.jsx)(Y,{}),list:(0,t.jsx)(ee,{})};return n[e]},[e]);return(0,t.jsx)(t.Fragment,{children:n()})},er=()=>(0,t.jsx)(M,{children:(0,t.jsx)(en,{})}),et=e=>({value:(null==e?void 0:e.id_tipo)||"",label:(0,_.Oo)((null==e?void 0:e.descricao)||"")});var ei=async()=>{try{let e=await (0,T.F)({callId:"getCommunicationAddressType",url:"".concat(T.QH,"/tipos/retornar-endercomunic"),method:"GET",needToken:!0,params:{}});if(!e.error&&e.request&&e.request.dados&&e.request.dados.length>0)return e.request.dados.map(et);return[]}catch(n){return[]}};let ea=e=>{let{...n}=e,{contract:r}=(0,Z.c)(),{data:i,isLoading:a}=(0,C.useQuery)(["communication-address-type",null==r?void 0:r.id],ei),o=(0,p.useMemo)(()=>i||[],[i]);return(0,t.jsx)(w.Z,{label:"Tipo",data:o,isLoading:a,...n})};var eo=async e=>{let{personId:n,classification:r,address:t,type:i}=e;try{let a=await (0,T.F)({callId:"addCommunicationAddress",url:"".concat(T.QH,"/wspm0005/editar-endereco-comunicacao"),method:"POST",needToken:!0,params:{endereco:t,codigo_classificacao:r,id_pessoa:Number(n),tipo:i}});return a}catch(o){return{error:"server",request:!1}}};let el=e=>({id:(null==e?void 0:e.id_endereco_comunicacao)||"",classification:(null==e?void 0:e.codigo_classificacao_endereco)||"",type:(null==e?void 0:e.tipo_endereco_comunicacao)||"",address:(null==e?void 0:e.endereco_comunicacao)||""});var es=async e=>{let{beneficiaryId:n}=e;try{let r=await (0,T.F)({callId:"getCommunicationAddresses",url:"".concat(T.QH,"/wspm0005/obter-endereco-comunicacao"),method:"GET",needToken:!0,params:{idUsrContr:n}});if(!r.error&&r.request&&r.request.data)return r.request.data.map(el);return[]}catch(t){return[]}},ed=async e=>{try{let n=await (0,T.F)({callId:"removeCommunicationAddress",url:"".concat(T.QH,"/wspm0005/exluir-endereco-comunicacao?idEnderecoComunicacao=").concat(e),method:"POST",needToken:!0});if(!n.error&&n.request)return{error:null,request:!0};return n}catch(r){return{error:"server",request:!1}}};let ec=(0,p.createContext)({}),eu=e=>{let{children:n}=e,{errorMessage:r,toastSuccessMessage:i,confirmMessage:a}=(0,F.Z)(),{beneficiaryId:o,beneficiary:l}=(0,m.t)(),{checkIFHasPendingChangesMessage:s}=L(),{data:d,isLoading:c,refetch:u}=(0,C.useQuery)(["communication-addresses",o],()=>es({beneficiaryId:o})),v=(0,C.useMutation)(eo,{onSuccess(e){if(e.error)return r(e.errorMessage);i("Endere\xe7o de Comunica\xe7\xe3o adicionado com sucesso!"),u()}}),f=(0,p.useCallback)(e=>{v.mutate({personId:(null==l?void 0:l.id)||"",...e})},[v,null==l?void 0:l.id]),x=(0,C.useMutation)(ed,{onSuccess(e){if(e.error)return r(e.errorMessage);i("Endere\xe7o de Comunica\xe7\xe3o removido com sucesso!"),u(),s()}}),h=(0,p.useCallback)(e=>{a({message:"Tem certeza que deseja remover este endere\xe7o de comunica\xe7\xe3o?",onYesCallback:()=>x.mutate(e)})},[a,x]),g=(0,p.useMemo)(()=>({isLoadingAddresses:c,addresses:d||[],addNewAddress:f,isSubmittingNewAddress:v.isLoading,removeAddress:h}),[f,d,c,v,h]);return(0,t.jsx)(ec.Provider,{value:g,children:n})},em=()=>{let e=(0,p.useContext)(ec);if(!e)throw Error("useController must be used within an UseControllerProvider");return e};var ep=r(51740),ev=r(63801),ef=r(32625);let ex=B.Ry().shape({classification:B.Z_().required(),type:B.Z_().required(),address:B.Z_().required().test({message:"Campo inv\xe1lido!",test(e){if(!e)return!1;let{type:n}=this.parent;try{if("EMAIL"===n)return(0,ef.Z)(e);if("CEL"===n)return(0,ev.h)(e,"BR").isValid();if("TEL"===n)return(0,ep.h)(e,"BR").isValid()}catch(r){return!1}return!0}})});function eh(){let e=(0,U.Z)([""]);return eh=function(){return e},e}let eg=H.ZP.form(eh()),eb=()=>{let{isSubmittingNewAddress:e,addNewAddress:n}=em(),{values:r,setFieldValue:i,handleChange:a,handleBlur:o,handleSubmit:l,errors:s,touched:d}=(0,v.TA)({initialValues:{address:"",classification:"",type:""},validationSchema:ex,onSubmit:n,enableReinitialize:!0}),c=(0,p.useMemo)(()=>{switch(r.type){case"CEL":return"cellphone";case"TEL":return"phone";default:return}},[r.type]);return(0,t.jsx)(eg,{onSubmit:l,children:(0,t.jsx)(j.X,{columns:"1fr 1fr",children:(0,t.jsxs)("div",{children:[(0,t.jsx)(P,{id:"classification",value:r.classification,onChange:e=>i("classification",e.value),error:d.classification&&s.classification&&s.classification||void 0}
1),(0,t.jsx)(ea,{id:"type",value:r.type,onChange(e){i("address",""),i("type",e.value)},error:d.type&&s.type&&s.type||void 0}),(0,t.jsx)(b.Z,{id:"address",name:"address",label:"Endere\xe7o",mask:c,value:r.address,onChange:a,onBlur:o,error:d.address&&s.address&&s.address||void 0}),(0,t.jsx)(u.aT,{children:(0,t.jsx)(g.Z,{text:"Adicionar",type:"submit",isLoading:e})})]})})})};function ej(){let e=(0,U.Z)([""]);return ej=function(){return e},e}let ey=H.ZP.div(ej()),eC=()=>{let{addresses:e,isLoadingAddresses:n,removeAddress:r}=em();return n?(0,t.jsx)(y.Z,{}):(0,t.jsx)($.Z,{data:e,headerColumns:[{label:"Classifica\xe7\xe3o",field:"classification"},{label:"Tipo",field:"type"},{label:"Endere\xe7o",field:"address"},{label:"",render:e=>(0,t.jsx)("div",{className:"row-buttons",children:(0,t.jsx)("button",{type:"button",onClick:()=>r(e.id),children:"excluir"})})}],filterFunction:()=>e,defaultSortField:"type",defaultSortOrder:"asc",disableFilter:!0,disablePagination:!0,perPage:9999})},eZ=()=>(0,t.jsxs)(ey,{children:[(0,t.jsx)(eb,{}),(0,t.jsx)(eC,{})]}),eT=()=>(0,t.jsx)(eu,{children:(0,t.jsx)(eZ,{})});var e_=r(95927);function eS(){let e=(0,U.Z)([""]);return eS=function(){return e},e}function eq(){let e=(0,U.Z)(["\n  header,\n  section {\n    grid-template-columns: repeat(5, 1fr);\n  }\n"]);return eq=function(){return e},e}let ew=H.ZP.div(eS());H.ZP.div(eq());let eP=()=>{let{pendingChangeMessage:e}=L();return e?(0,t.jsx)(ew,{children:(0,t.jsx)(e_._,{children:(0,t.jsx)("p",{children:e})})}):(0,t.jsx)(t.Fragment,{})};var eE=r(14177),eI=r(61642),eF=async e=>{let{beneficiaryId:n,beneficiaryPersonId:r,name:t,birthdate:i,motherName:a,cpf:o,civilStatus:l,scholarity:s,occupation:d,provingDocumentFile:c,fileType:u,nameSocial:m="",genderIdentity:p="",descrTipoIdentGenero:v=""}=e;try{let f={id_pessoa:Number(r),id_usr_contr:Number(n),cpf:o,nome:t.toUpperCase(),name_social:m.toUpperCase(),identidade_genero:p.toUpperCase(),descrTipoIdentGenero:v.toUpperCase(),dt_nasc:i?(0,eI.M7)(i):null};a&&(f.nome_mae=a.toUpperCase()),l&&(f.estado_civil=l),s&&(f.escolaridade=s),d&&(f.profissao=d),c&&(f.arquivos=[{nome:c.name,arquivo_base64:c.rawContent,tipo_arquivo:u}]);let x=await (0,T.F)({callId:"updatePersonalData",url:"".concat(T.QH,"/wspm0005/editar-dados-pessoais"),method:"POST",needToken:!0,params:f});return x}catch(h){return{error:"server",request:!1}}},eN=r(1874),eD=r(6063),ek=r(94508);let eO=e=>{let{type:n,...r}=e,{contract:i}=(0,Z.c)(),{data:a,isLoading:o}=(0,C.useQuery)(["document-type",n,null==i?void 0:i.id],()=>(0,ek.Z)({type:n})),l=(0,p.useMemo)(()=>a||[],[a]);return(0,t.jsx)(w.Z,{label:"Tipo Documento",data:l,isLoading:o,...r})};var eG=r(90607),eA=r(48085),eL=r(24157);let eR=B.Ry().shape({name:B.Z_().required(),birthdate:B.Z_().required(),cpf:B.Z_().required()});function eM(){let e=(0,U.Z)(["\n  max-width: 37.5rem;\n\n  @media (max-width: 991px) {\n    max-width: 100%;\n  }\n"]);return eM=function(){return e},e}let ez=H.ZP.div(eM()),eB=()=>{var e,n,r,i,a,o,l,s,d,c,f,x;let{errorMessage:h,successMessage:y}=(0,F.Z)(),{beneficiary:Z,beneficiaryId:T,refetchBeneficiaryData:_}=(0,m.t)(),{checkIFHasPendingChangesMessage:S}=L(),q=(0,C.useMutation)(eF,{onSuccess:e=>!e||e.error?h(e.errorMessage):(_(),S(),y("Altera\xe7\xe3o realizada com sucesso!"))}),w=(0,p.useCallback)(async e=>{var n,r,t;let i;return e.birthdate===(null==Z?void 0:null===(n=Z.personalData)||void 0===n?void 0:n.birthDateFormatted)||e.provingDocumentFile&&e.fileType?e.name===(null==Z?void 0:Z.name)||e.provingDocumentFile&&e.fileType?e.motherName===(null==Z?void 0:null===(r=Z.personalData)||void 0===r?void 0:r.motherName)||e.provingDocumentFile&&e.fileType?e.cpf===(null==Z?void 0:null===(t=Z.personalData)||void 0===t?void 0:t.cpf)||e.provingDocumentFile&&e.fileType?!e.provingDocumentFile||(i=await (0,eE.Z)(e.provingDocumentFile))?void q.mutate({...e,beneficiaryId:T,beneficiaryPersonId:(null==Z?void 0:Z.id)||"",provingDocumentFile:i}):h("Ocorreu um arro ao processar o arquivo!"):h("Para alterar o CPF \xe9 obrigat\xf3rio anexar o documento comprobat\xf3rio e selecionar o tipo do arquivo!"):h("Para alterar o Nome da M\xe3e \xe9 obrigat\xf3rio anexar o documento comprobat\xf3rio e selecionar o tipo do arquivo!"):h("Para alterar o Nome \xe9 obrigat\xf3rio anexar o documento comprobat\xf3rio e selecionar o tipo do arquivo!"):h("Para alterar a Data de Nascimento \xe9 obrigat\xf3rio anexar o documento comprobat\xf3rio e selecionar o tipo do arquivo!")},[null==Z?void 0:Z.id,null==Z?void 0:Z.name,null==Z?void 0:null===(e=Z.personalData)||void 0===e?void 0:e.b
1irthDateFormatted,null==Z?void 0:null===(n=Z.personalData)||void 0===n?void 0:n.cpf,null==Z?void 0:null===(r=Z.personalData)||void 0===r?void 0:r.motherName,T,h,q]);return(0,t.jsx)(ez,{children:(0,t.jsx)(v.J9,{initialValues:{name:(null==Z?void 0:Z.name)||"",nameSocial:(null==Z?void 0:null===(i=Z.personalData)||void 0===i?void 0:i.nameSocial)||"",genderIdentity:(null==Z?void 0:null===(a=Z.personalData)||void 0===a?void 0:a.genderIdentity)||"",descrTipoIdentGenero:(null==Z?void 0:null===(o=Z.personalData)||void 0===o?void 0:o.descrTipoIdentGenero)||"",birthdate:(null==Z?void 0:null===(l=Z.personalData)||void 0===l?void 0:l.birthDateFormatted)||"",motherName:(null==Z?void 0:null===(s=Z.personalData)||void 0===s?void 0:s.motherName)||"",cpf:(null==Z?void 0:null===(d=Z.personalData)||void 0===d?void 0:d.cpf)||"",civilStatus:(null==Z?void 0:null===(c=Z.personalData)||void 0===c?void 0:c.civilStatusCode)||"",scholarity:(null==Z?void 0:null===(f=Z.personalData)||void 0===f?void 0:f.scholarity)||"",occupation:(null==Z?void 0:null===(x=Z.personalData)||void 0===x?void 0:x.occupation)||"",provingDocumentFile:null,provingDocumentFileName:"",fileType:""},validationSchema:eR,onSubmit:w,enableReinitialize:!0,children(e){let{values:n,setFieldValue:r,handleChange:i,handleBlur:a,touched:o,errors:l,handleSubmit:s}=e;return(0,t.jsxs)("form",{onSubmit:s,children:[(0,t.jsx)(b.Z,{id:"name",name:"name",label:"Nome civil",mask:"noSpecialChar",value:n.name,onChange:i,onBlur:a,error:o.name&&l.name&&l.name||void 0,isRequired:!0}),(0,t.jsx)(b.Z,{id:"nameSocial",name:"nameSocial",label:"Nome social",mask:"noSpecialChar",value:n.nameSocial,onChange:i,onBlur:a,error:o.nameSocial&&l.nameSocial&&l.nameSocial||void 0,isRequired:!1}),(0,t.jsx)(eG.Z,{id:"genderIdentity",label:"Identidade de G\xeanero",value:n.genderIdentity,onChange:e=>r("genderIdentity",e.value),error:o.genderIdentity&&l.genderIdentity&&l.genderIdentity||void 0}),(0,t.jsx)(j.X,{isFieldGrid:!0,columns:"1fr 1fr",children:(0,t.jsx)(b.Z,{id:"birthdate",name:"birthdate",label:"Data de nascimento",mask:"date",value:n.birthdate,onChange:i,onBlur:a,error:o.birthdate&&l.birthdate&&l.birthdate||void 0,isRequired:!0})}),(0,t.jsx)(b.Z,{id:"motherName",name:"motherName",label:"Nome da m\xe3e",mask:"noSpecialChar",value:n.motherName,onChange:i,onBlur:a,error:o.motherName&&l.motherName&&l.motherName||void 0}),(0,t.jsx)(j.X,{isFieldGrid:!0,columns:"1fr 1fr",children:(0,t.jsxs)("div",{children:[(0,t.jsx)(b.Z,{id:"cpf",name:"cpf",label:"CPF",mask:"cpf",value:n.cpf,onChange:i,onBlur:a,error:o.cpf&&l.cpf&&l.cpf||void 0,isRequired:!0}),(0,t.jsx)(eD.Z,{id:"civilStatus",value:n.civilStatus,onChange:e=>r("civilStatus",e.value),error:o.civilStatus&&l.civilStatus&&l.civilStatus||void 0})]})}),(0,t.jsx)(eL.Z,{id:"scholarity",label:"Escolaridade",value:n.scholarity,onChange:e=>r("scholarity",e.value),error:o.scholarity&&l.scholarity&&l.scholarity||void 0}),(0,t.jsx)(eA.Z,{id:"occupation",label:"Profiss\xe3o",value:n.occupation,onChange:e=>r("occupation",e.value),error:o.occupation&&l.occupation&&l.occupation||void 0}),(0,t.jsxs)(e_._,{children:[(0,t.jsx)("p",{children:"Para atualizar os dados referentes aos campos de nome, data de nascimento, nome da m\xe3e e CPF \xe9 necess\xe1rio anexar um documento que comprove o dado informado."}),(0,t.jsx)("p",{children:"A altera\xe7\xe3o dos dados ser\xe1 realizada ap\xf3s a an\xe1lise do documento."})]}),(0,t.jsx)(eO,{id:"fileType",label:"Tipo Arquivo",error:o.fileType&&l.fileType&&l.fileType||void 0,onChange:e=>r("fileType",e.value),value:n.fileType,type:"RECAD"}),(0,t.jsx)(eN.Z,{id:"provingDocumentFile",name:"provingDocumentFile",emptyLabel:"Anexar documento comprobat\xf3rio",selectedLabel:"Documento",handleFileChange(e){r("provingDocumentFileName",e.name),r("provingDocumentFile",e)},error:o.provingDocumentFileName&&l.provingDocumentFileName&&l.provingDocumentFileName||void 0,allowedFileTypes:["PDF","DOC","JPG","ZIP"]}),(0,t.jsx)(u.aT,{children:(0,t.jsx)(g.Z,{theme:"mainGreen",text:"Salvar altera\xe7\xe3o",type:"submit",isLoading:q.isLoading})})]})}})})};var eQ=async e=>
1{let{beneficiaryId:n,beneficiaryPersonId:r,centerCost:t,department:i,matriculation:a,subsidiary:o}=e;try{let l=await (0,T.F)({callId:"updateProfessionalData",url:"".concat(T.QH,"/wspm0005/editar-dados-profissionais"),method:"POST",needToken:!0,params:{id_pessoa:Number(r),id_usr_contr:Number(n),codigo_matricula:a,codigo_centro_custo:t,departamento:i,codigo_filial:o}});if(l.request.data.dados_retorno)return{...l,successMessage:l.request.data.dados_retorno};return l}catch(s){return{error:"server",request:!1}}},eU=r(29552);let eH=B.Ry().shape({});function eV(){let e=(0,U.Z)(["\n  max-width: 37.5rem;\n\n  @media (max-width: 991px) {\n    max-width: 100%;\n  }\n"]);return eV=function(){return e},e}let eX=H.ZP.div(eV()),eY=()=>{var e,n,r,i;let{errorMessage:a,successMessage:o}=(0,F.Z)(),{beneficiary:l,beneficiaryId:s}=(0,m.t)(),{checkIFHasPendingChangesMessage:d}=L(),c=(0,C.useMutation)(eQ,{onSuccess:e=>!e||e.error?a(e.errorMessage):(d(),o(e.successMessage||"Altera\xe7\xe3o realizada com sucesso!"))}),f=(0,p.useCallback)(async e=>{c.mutate({...e,beneficiaryId:s,beneficiaryPersonId:(null==l?void 0:l.id)||""})},[null==l?void 0:l.id,s,c]);return(0,t.jsx)(eX,{children:(0,t.jsx)(v.J9,{initialValues:{matriculation:(null==l?void 0:null===(e=l.professional)||void 0===e?void 0:e.matriculation)||"",centerCost:(null==l?void 0:null===(n=l.professional)||void 0===n?void 0:n.centerCost)||"",department:(null==l?void 0:null===(r=l.professional)||void 0===r?void 0:r.department)||"",subsidiary:(null==l?void 0:null===(i=l.professional)||void 0===i?void 0:i.subsidiary)||""},validationSchema:eH,onSubmit:f,enableReinitialize:!0,children(e){let{values:n,setFieldValue:r,handleChange:i,handleBlur:a,touched:o,errors:l,handleSubmit:s}=e;return(0,t.jsxs)("form",{onSubmit:s,children:[(0,t.jsx)(j.X,{isFieldGrid:!0,columns:"1fr 1fr",children:(0,t.jsxs)("div",{children:[(0,t.jsx)(b.Z,{id:"matriculation",name:"matriculation",label:"Matr\xedcula",value:n.matriculation,onChange:i,onBlur:a,error:o.matriculation&&l.matriculation&&l.matriculation||void 0}),(0,t.jsx)(b.Z,{id:"centerCost",name:"centerCost",label:"Centro de custo",value:n.centerCost,onChange:i,onBlur:a,error:o.centerCost&&l.centerCost&&l.centerCost||void 0})]})}),(0,t.jsx)(b.Z,{id:"department",name:"department",label:"Departamento",value:n.department,onChange:i,onBlur:a,error:o.department&&l.department&&l.department||void 0}),(0,t.jsx)(j.X,{isFieldGrid:!0,columns:"1fr 1fr",children:(0,t.jsx)(eU.Z,{id:"subsidiary",value:n.subsidiary,onChange:e=>r("subsidiary",e.value),error:o.subsidiary&&l.subsidiary&&l.subsidiary||void 0})}),(0,t.jsx)(u.aT,{children:(0,t.jsx)(g.Z,{theme:"mainGreen",text:"Salvar altera\xe7\xe3o",type:"submit",isLoading:c.isLoading})})]})}})})},eJ=()=>{let{beneficiary:e}=(0,m.t)(),{step:n,setStep:r}=L();return e?(0,t.jsxs)(l._,{children:[(0,t.jsx)(s.V,{children:"Gerenciar cadastro - Atualizar"}),(0,t.jsx)(c.Z,{}),(0,t.jsx)(eP,{}),(0,t.jsx)(o.Z,{text:"Editar dados pessoais",isOpen:n.includes("personal"),onClick:()=>r("personal")}),(0,t.jsx)(a.Z,{isVisible:n.includes("personal"),children:(0,t.jsx)(eB,{})},"personal"),(0,t.jsx)(o.Z,{text:"Editar dados profissionais",isOpen:n.includes("professional"),onClick:()=>r("professional")}),(0,t.jsx)(a.Z,{isVisible:n.includes("professional"),children:(0,t.jsx)(eY,{})},"professional"),(0,t.jsx)(o.Z,{text:"Editar endere\xe7os",isOpen:n.includes("address"),onClick:()=>r("address")}),(0,t.jsx)(a.Z,{isVisible:n.includes("address"),children:(0,t.jsx)(er,{})},"address"),(0,t.jsx)(o.Z,{text:"Editar contato",isOpen:n.includes("contact"),onClick:()=>r("contact")}),(0,t.jsx)(a.Z,{isVisible:n.includes("contact"),children:(0,t.jsx)(eT,{})},"contact"),(0,t.jsx)(u.aT,{children:(0,t.jsx)(d.Z,{})})]}):(0,t.jsx)(t.Fragment,{})},e$=()=>(0,t.jsx)(A,{children:(0,t.jsx)(eJ,{})}),eW=()=>(0,t.jsx)(i.Z,{title:"Atualizar Cadastro",children:(0,t.jsx)(e$,{})});var eK=eW},94508:function(e,n,r){"use strict";r.d(n,{Z:function(){return o}});var t=r(94454),i=r(10212);let a=e=>({value:(null==e?void 0:e.id_tipo)||"",label:(0,i.Oo)((null==e?void 0:e.descricao)||"")});var o=async e=>{let{type:n}=e,r={};n&&(r.tipo=n);try{let i=await (0,t.F)({callId:"getDocumentsType",url:"".concat(t.QH,"/tipos/retornar-tipo-arquivo-documento"),method:"GET",needToken:!0,params:r});if(!i.error&&i.request&&i.request.data&&i.request.data.length>0)return i.request.data.map(a);return[]}catch(o){return[]}}},3009:function(e,n,r){"use strict";r.d(n,{Z:function(){return o}});var t=r(94454),i=r(10212);let a=e=>({value:(null==e?void 0:e.id_tipo)||"",label:(0,i.Oo)((null==e?void 0:e.descricao)||"")});var o=async e=>{let{type:n}=e;try{let r=await (0,t.F)({callId:"getTypeRelatedToUser",url:"".concat(t.QH,"/tipos/retornar-usuario"),method:"GET",needToken:!0,params:{tipo:n}});if(!r.error&&r.request&&r.request.dados&&r.request.dados.length>0)return r.request.dados.map(a);return[]}catch(i){return[]}}},65978:function(e,n,r){"use strict";r.d(n,{Z:function(){return d}});var t=r(85893),i=r(7297),a=r(186);function o(){let e=(0,i.Z)(["\n  button {\n    background-color: transparent;\n    border-width: 0;\n    padding: 0;\n\n    display: flex;\n    flex-direction: row;
1\n    align-items: center;\n    gap: 0.2rem;\n\n    margin-top: 1rem;\n\n    font-family: ",";\n    color: ",";\n    text-decoration: underline;\n    line-height: 200%;\n\n    svg {\n      color: ",";\n      width: 0.7rem;\n      height: 0.7rem;\n\n      margin-top: 0.1rem;\n    }\n  }\n"]);return o=function(){return e},e}let l=a.ZP.div(o(),e=>{let{theme:n}=e;return n.font.bold},e=>{let{theme:n}=e;return n.colors.mainGreen.regular.color},e=>{let{theme:n}=e;return n.colors.mainGreen.regular.color}),s=e=>{let{children:n,...r}=e;return(0,t.jsx)(l,{children:(0,t.jsx)("button",{...r,type:"button",children:n})})};var d=s},25964:function(e,n,r){"use strict";r.d(n,{Z:function(){return m}});var t=r(85893),i=r(73582),a=r(99603),o=r(70344),l=r(7297),s=r(186);function d(){let e=(0,l.Z)(["\n  background-color: transparent;\n  border-width: 0;\n\n  width: 100%;\n\n  display: flex;\n  flex-direction: row;\n  align-items: center;\n  gap: 1rem;\n\n  border-bottom: 1px solid ",";\n  padding: 1.5rem 0;\n\n  margin-bottom: 1.5rem;\n\n  svg {\n    width: 1rem;\n    height: 1rem;\n\n    color: ",";\n\n    transition: 0.3s;\n    transform: scale(",");\n  }\n\n  p {\n    margin: 0;\n\n    padding: 0;\n\n    font-family: ",";\n    color: ",";\n  }\n"]);return d=function(){return e},e}let c=s.ZP.button(d(),e=>{let{theme:n}=e;return n.colors.border},e=>{let{theme:n}=e;return n.colors.texts},e=>{let{isOpen:n}=e;return n?"-1":"1"},e=>{let{theme:n}=e;return n.font.bold},e=>{let{theme:n}=e;return n.colors.texts}),u=e=>{let{text:n,onClick:r,isOpen:l,isHTMLText:s=!1}=e;return(0,t.jsxs)(c,{className:"collapse-header-button",type:"button","aria-label":n,onClick:r,isOpen:l,children:[(0,t.jsx)("p",{children:s?(0,o.Z)(n):n}),(0,t.jsx)(a.G,{icon:i.ptq})]})};var m=u},1874:function(e,n,r){"use strict";r.d(n,{Z:function(){return h}});var t=r(85893),i=r(67294),a=r(73582),o=r(99603),l=r(37098),s=r(4787),d=[{id:"PDF",accept:["application/pdf","image/pdf"]},{id:"JPG",accept:["image/jpeg","image/jpg"]},{id:"PNG",accept:["image/png"]},{id:"DOC",accept:["application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"]},{id:"XLS",accept:["application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"]},{id:"CSV",accept:["text/csv"]},{id:"TXT",accept:["text/plain"]},{id:"ZIP",accept:["text/txt"]},{id:"GIF",accept:["image/gif"]}],c=r(7297),u=r(186);function m(){let e=(0,c.Z)(["\n  input[type='file'] {\n    display: none;\n  }\n\n  label {\n    display: inline-block;\n    cursor: pointer;\n\n    font-size: 1rem;\n    font-family: ",";\n    color: ",";\n\n    margin-bottom: 0.5rem;\n\n    span {\n      font-family: inherit;\n      font-size: inherit;\n\n      display: flex;\n      flex-direction: row;\n      align-items: center;\n      gap: 0.5rem;\n\n      .required {\n        color: ",";\n      }\n\n      svg {\n        width: 1rem;\n        height: 1rem;\n\n        margin-top: 0.2rem;\n      }\n    }\n  }\n"]);return m=function(){return e},e}function p(){let e=(0,c.Z)(["\n  font-family: ",";\n\n  span {\n    font-family: ",";\n  }\n\n  > span {\n    display: inline-flex;\n    flex-direction: row;\n    flex-wrap: wrap;\n    gap: 0.3rem;\n\n    margin-left: 0.4rem;\n\n    > span {\n      &:after {\n        content: ', ';\n        display: inline-block;\n      }\n    }\n\n    > span:nth-last-of-type(2) {\n      &:after {\n        content: 'e';\n        padding-left: 0.3rem;\n        display: inline-block;\n      }\n    }\n    > span:nth-last-of-type(1) {\n      &:after {\n        content: '.';\n        display: inline-block;\n      }\n    }\n  }\n"]);return p=function(){return e},e}let v=u.ZP.div(m(),e=>{let{theme:n}=e;return n.font.bold},e=>{let{theme:n}=e;return n.colors.mainGreen.regular.color},e=>{let{theme:n}=e;return n.colors.danger.color}),f=u.ZP.p(p(),e=>{let{theme:n}=e;return n.font.regularItalic},e=>{let{theme:n}=e;return n.font.regularItalic}),x=(0,i.forwardRef)((e,n)=>{let{emptyLabel:r,selectedLabel:c,lastFileName:u,id:m,name:p,defaultFileName:x,error:h,handleFileChange:g,allowedFileTypes:b=["PDF"],isRequired:j=!1}=e,{errorMessage:y}=(0,l.Z)(),[C,Z]=(0,i.useState)(void 0),T=(0,i.useRef)(null);(0,i.useImperativeHandle)(n,()=>({clear(){Z(void 0),T.current.value=""}})),(0,i.useEffect)(()=>{Z(x)},[x]);let _=(0,i.useMemo)(()=>C||u||null,[u,C]),S=(0,i.useMemo)(()=>
1{if(b&&b.length>0){let e=[];return b.forEach(n=>{let r=d.find(e=>e.id===n);r&&e.push(...r.accept)}),e}return["image/*"]},[b]),q=(0,i.useCallback)(e=>{if(!e)return;let n=e[0];if(n){if(!S.includes(n.type.toLocaleLowerCase()))return y("Formato de arquivo n\xe3o permitido.");Z(n.name),g(n)}},[S,y,g]);return(0,t.jsxs)(v,{children:[(0,t.jsx)("input",{ref:T,type:"file",onChange:e=>q(e.target.files),id:m||"",name:p,accept:S.join(",")}),(0,t.jsx)("label",{htmlFor:p,children:_?(0,t.jsxs)("span",{children:["".concat(c,": ").concat(_),(0,t.jsx)(o.G,{icon:a.T80}),j&&(0,t.jsx)("span",{className:"required",children:"*"})]}):(0,t.jsx)(t.Fragment,{children:"+ ".concat(r)})}),(0,t.jsxs)(f,{children:["Arquivos permitidos:",(0,t.jsx)("span",{children:b.map((e,n)=>(0,t.jsx)("span",{children:".".concat(e.toLocaleLowerCase())},n))})]}),h&&(0,t.jsx)(s.jj,{children:h})]})});var h=x},95927:function(e,n,r){"use strict";r.d(n,{_:function(){return l}});var t=r(7297),i=r(186);function a(){let e=(0,t.Z)(["\n      max-width: 38rem;\n\n      @media (max-width: 991px) {\n        max-width: 100%;\n      }\n    "]);return a=function(){return e},e}function o(){let e=(0,t.Z)(["\n  display: flex;\n  flex-direction: column;\n\n  padding: 1.5rem;\n  border-radius: 10px;\n  border: 1px solid ",";\n  margin-bottom: 2rem;\n\n  background: ",";\n  color: ",";\n\n  width: 100%;\n\n  ",";\n\n  p:nth-last-of-type(1) {\n    margin-bottom: 0;\n  }\n\n  a {\n    color: ",";\n    text-decoration: underline;\n  }\n"]);return o=function(){return e},e}let l=i.ZP.div.attrs({className:"message-box"})(o(),e=>{let{theme:n}=e;return n.colors.texts},e=>{let{theme:n}=e;return n.colors.message.color},e=>{let{theme:n}=e;return n.colors.message.contrast},e=>{let{halfSize:n}=e;return n&&(0,i.iv)(a())},e=>{let{theme:n}=e;return n.colors.texts})},6063:function(e,n,r){"use strict";r.d(n,{Z:function(){return p}});var t=r(85893),i=r(67294),a=r(88767),o=r(31525),l=r(94454),s=r(10212);let d=e=>({value:(null==e?void 0:e.id)||"",label:(0,s.Oo)((null==e?void 0:e.descricao)||"")});var c=async()=>{try{let e=await (0,l.F)({callId:"getCivilStatus",url:"".concat(l.QH,"/tipos/retornar-estadocivil"),method:"GET",needToken:!0,params:{}});if(!e.error&&e.request&&e.request.data&&e.request.data.length>0)return e.request.data.map(d);return[]}catch(n){return[]}},u=r(28022);let m=e=>{let{...n}=e,{contract:r}=(0,o.c)(),{data:l,isLoading:s}
1=(0,a.useQuery)(["civil-status",null==r?void 0:r.id],c),d=(0,i.useMemo)(()=>l||[],[l]);return(0,t.jsx)(u.Z,{label:"Estado Civil",data:d,isLoading:s,...n})};var p=m},90607:function(e,n,r){"use strict";var t=r(85893),i=r(67294),a=r(88767),o=r(42080),l=r(3009),s=r(28022);let d=e=>{let{...n}=e,{data:r,isLoading:d}=(0,a.useQuery)(["genderIdentity"],()=>(0,l.Z)({type:o.G.GENDERIDENTITY})),c=(0,i.useMemo)(()=>r||[],[r]);return(0,t.jsx)(s.Z,{label:"Identidade de G\xeanero",data:c,isLoading:d,...n})};n.Z=d},48085:function(e,n,r){"use strict";r.d(n,{Z:function(){return p}});var t=r(85893),i=r(67294),a=r(88767),o=r(31525),l=r(94454),s=r(10212);let d=e=>({value:(null==e?void 0:e.id_tipo)||"",label:(0,s.Oo)((null==e?void 0:e.descricao)||"")});var c=async()=>{try{let e=await (0,l.F)({callId:"getProfessions",url:"".concat(l.QH,"/tipos/retornar-profissoes"),method:"GET",needToken:!0,params:{}});if(!e.error&&e.request&&e.request.dados&&e.request.dados.length>0)return e.request.dados.map(d);return[]}catch(n){return[]}},u=r(28022);let m=e=>{let{...n}=e,{contract:r}=(0,o.c)(),{data:l,isLoading:s}
1=(0,a.useQuery)(["professions",null==r?void 0:r.id],c),d=(0,i.useMemo)(()=>l||[],[l]);return(0,t.jsx)(u.Z,{data:d,isLoading:s,...n})};var p=m},24157:function(e,n,r){"use strict";r.d(n,{Z:function(){return p}});var t=r(85893),i=r(67294),a=r(88767),o=r(31525),l=r(94454),s=r(10212);let d=e=>({value:(null==e?void 0:e.id_tipo)||"",label:(0,s.Oo)((null==e?void 0:e.descricao)||"")});var c=async()=>{try{let e=await (0,l.F)({callId:"getScholarity",url:"".concat(l.QH,"/tipos/retornar-escolaridade"),method:"GET",needToken:!0,params:{}});if(!e.error&&e.request&&e.request.data&&e.request.data.length>0)return e.request.data.map(d);return[]}catch(n){return[]}},u=r(28022);let m=e=>{let{...n}=e,{contract:r}=(0,o.c)(),{data:l,isLoading:s}=(0,a.useQuery)(["scholarity",null==r?void 0:r.id],c),d=(0,i.useMemo)(()=>l||[],[l]);return(0,t.jsx)(u.Z,{data:d,isLoading:s,...n})};var p=m},29552:function(e,n,r){"use strict";r.d(n,{Z:function(){return u}});var t=r(85893),i=r(67294),a=r(88767),o=r(94454);let l=e=>({value:e||"",label:e||""});var s=async()=>{try{let e=await (0,o.F)({callId:"getSubsidiaries",url:"".concat(o.QH,"/tipos/retornar-filiais"),method:"GET",needToken:!0,params:{}});if(!e.error&&e.request&&e.request.data&&e.request.data.length>0)return e.request.data.map(l);return[]}catch(n){return[]}},d=r(28022);let c=e=>{let{...n}=e,{data:r,isLoading:o}=(0,a.useQuery)(["subsidiaries"],s),l=(0,i.useMemo)(()=>r||[],[r]);return(0,t.jsx)(d.Z,{label:"Filial",data:l,isLoading:o,...n})};var u=c},42080:function(e,n,r){"use strict";var t,i;r.d(n,{G:function(){return t}}),(i=t||(t={})).EVENT="COD_TIPO_EVENTO",i.COMPANY_BOND="COD_TIPO_VINC_CONTRATANTE",i.RELATIONSHIP="COD_TIPO_PARENTESCO",i.USER="COD_TIPO_USR",i.GENDER="COD_TIPO_SEXO",i.GENDERIDENTITY="COD_TIPO_IDENT_GENERO",i.DESCR_TIPO_IDENT_GENERO="DESCR_TIPO_IDENT_GENERO",i.CLASSIFICATION="COD_CLASSIF_USR",i.STATUS="COD_STATUS_USR",i.COMPANY_CLASSIFICATION="COD_CLASSIF_USR_EMPRESA",i.EXCLUSION_TYPE="COD_TIPO_EXCL_USR_CONTR"},83921:function(e,n,r){"use strict";var t=r(85893),i=r(67294),a=r(97883),o=r(27743);let l=e=>{let{children:n,permissions:r,pushTo:l}=e,{restrictAccess:s,permissions:d,isLoading:c}=(0,o.T)();return((0,i.useEffect)(()=>{r&&0!==r.length&&d.length>0&&!c&&s(r,l)},[c,r,d.length,l,s]),0===d.length||c)?(0,t.jsx)(a.Z,{}):(0,t.jsx)(t.Fragment,{children:n})};n.Z=l},16591:function(e,n,r){"use strict";var t=r(85893),i=r(21194),a=r(82713),o=r(74618);let l=()=>{let{beneficiaryId:e}=(0,o.t)();return(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(a.Z,{href:i.Z.beneficiary().management(e).index,isLinkTag:!0})})};n.Z=l},10629:function(e,n,r){"use strict";r.d(n,{Z:function(){return c}});var t=r(85893),i=r(74618),a=r(7297),o=r(186);function l(){let e=(0,a.Z)(["\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n  gap: 1rem;\n\n  padding: 2rem;\n\n  margin-bottom: 2rem;\n  box-shadow: 0px 5px 25px rgba(0, 0, 0, 0.07);\n  border-radius: 10px;\n\n  @media (max-width: 991px) {\n    flex-direction: column;\n  }\n\n  p:nth-last-of-type(1) {\n    margin-bottom: 0;\n  }\n\n  button {\n    @media (max-width: 991px) {\n      text-transform: none;\n    }\n  }\n"]);return l=function(){return e},e}let s=o.ZP.div(l()),d=()=>{let{beneficiary:e}=(0,i.t)();return(0,t.jsx)(s,{children:(0,t.jsxs)("div",{children:[(0,t.jsxs)("p",{children:[(0,t.jsx)("strong",{children:"Benefici\xe1rio(a): "})," ",null==e?void 0:e.name]}),(0,t.jsxs)("p",{children:[(0,t.jsx)("strong",{children:"Nome Social: "})," ",null==e?void 0:e.nameSocial]}),(0,t.jsxs)("p",{children:[(0,t.jsx)("strong",{children:"C\xf3digo: "})," ",null==e?void 0:e.oldCode]})]})})};var c=d},485:function(e,n,r){"use strict";r.d(n,{aT:function(){return d}});var t=r(7297),i=r(186);function a(){let e=(0,t.Z)(["\n  button {\n    margin-bottom: 1rem;\n  }\n"]);return a=function(){return e},e}function o(){let e=(0,t.Z)(["\n  display: flex;\n  flex-direction: column;\n  padding: 1rem 1.5rem;\n  gap: 1rem;\n  margin-bottom: 2rem;\n\n  box-shadow: 0px 5px 25px rgba(0, 0, 0, 0.07);\n  border-radius: 10px;\n\n  strong {\n    color: ",";\n    margin-right: 0.5rem;\n  }\n\n  span {\n    color: ",";\n    font-size: 0.9rem;\n  }\n"]);return o=function(){return e},e}function l(){let e=(0,t.Z)(["\n  strong {\n    color: ",";\n  }\n\n  > div {\n    margin: 1rem 0 2rem 1rem;\n  }\n"]);return l=function(){return e},e}function s(){let e=(0,t.Z)(["\n  display: flex;\n  align-items: center;\n  gap: 0.3125rem;\n  margin: 2rem 0;\n\n  a {\n    font-weight: bold;\n    color: ",";\n    text-decoration: none;\n  }\n\n  svg {\n    width: 0.75rem;\n    height: 0.75rem;\n    color: ",";\n  }\n"]);return s=function(){return e},e}let d=i.ZP.div.attrs({className:"footer-buttons"})(a());i.ZP.div(o(),e=>{let{theme:n}=e;return n.colors.title},e=>{let{theme:n}=e;return n.colors.texts}),i.ZP.div(l(),e=>{let{theme:n}=e;return n.colors.title}),i.ZP.div(s(),e=>{let{theme:n}=e;return n.colors.texts},e=>{let{theme:n}=e;return n.colors.texts})},74618:function(e,n,r){"use strict";r.d(n,{B:function(){return j},t:function(){return y}});var t=r(85893),i=r(67294),a=r(88767),o=r(81794),l=r(97883),s=r(21194),d=r
1(3784),c=r(10019),u=r(97),m=r(7297),p=r(186);function v(){let e=(0,m.Z)([""]);return v=function(){return e},e}function f(){let e=(0,m.Z)(["\n  padding: 2rem;\n"]);return f=function(){return e},e}let x=p.ZP.div(v()),h=p.ZP.div(f()),g=()=>(0,t.jsx)(x,{children:(0,t.jsxs)(c._,{children:[(0,t.jsx)(u.V,{children:"Benefici\xe1rio n\xe3o encontrado"}),(0,t.jsxs)("p",{children:["N\xe3o foi poss\xedvel encontrar informa\xe7\xf5es do benefici\xe1rio selecionado.",(0,t.jsx)("br",{})," Verifique se o link que acessou est\xe1 correto, atualize a p\xe1gina ou realize uma nova consulta."]}),(0,t.jsx)(d.Z,{isLinkTag:!0,theme:"mainGreen",text:"Nova consulta",href:s.Z.beneficiary().consult})]})}),b=(0,i.createContext)({}),j=e=>{let{beneficiaryId:n,children:r}=e,{data:s,isLoading:d,refetch:c}=(0,a.useQuery)(["beneficiary-details",n],()=>(0,o.Z)({usrContrId:n}),{enabled:!!n}),u=(0,i.useMemo)(()=>({beneficiary:s||null,beneficiaryId:n,refetchBeneficiaryData:c}),[n,s,c]);return(0,t.jsx)(b.Provider,{value:u,children:d?(0,t.jsx)(h,{children:(0,t.jsx)(l.Z,{})}):(0,t.jsx)(t.Fragment,{children:s?(0,t.jsx)(t.Fragment,{children:r}):(0,t.jsx)(g,{})})})},y=()=>{let e=(0,i.useContext)(b);if(!e)throw Error("useBeneficiary must be used within an UseBeneficiaryProvider");return e}},45798:function(e,n,r){"use strict";var t=r(85893),i=r(5413),a=r(94050),o=r(68296),l=r(18061),s=r(29246),d=r(99188),c=r(59716),u=r(99890);let m=e=>{let{children:n}=e;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(u.W2,{className:"template-default",children:[(0,t.jsx)(u.xN,{children:(0,t.jsx)(d.Z,{})}),(0,t.jsxs)(u.VY,{children:[(0,t.jsx)(l.Z,{}),(0,t.jsx)(o.i,{children:(0,t.jsx)(i.Z,{children:n})}),(0,t.jsx)(u.$_,{children:(0,t.jsx)(a.Z,{})})]})]}),(0,t.jsx)(c.Z,{}),(0,t.jsx)(s.Z,{})]})};n.Z=m},72684:function(e,n,r){"use strict";var t=r(85893),i=r(2962),a=r(11163),o=r(45798),l=r(17751),s=r(74618),d=r(83921),c=r(21194),u=r(85944);let m=e=>{let{title:n,children:r,permissions:l}=e,m=(0,a.useRouter)(),p=String(m.query.id);return m.query.id?(0,t.jsxs)(d.Z,{permissions:l,children:[(0,t.jsx)(i.PB,{title:"".concat(u.Z.title," - Gerenciar - ").concat(n)}),(0,t.jsx)(o.Z,{children:(0,t.jsx)(s.B,{beneficiaryId:p,children:r})})]}):(m.push(c.Z.beneficiary().consult),(0,t.jsx)(t.Fragment,{}))};n.Z=(0,l.Z)(m)},14177:function(e,n,r){"use strict";var t=r(22920);n.Z=async(e,n)=>new Promise(r=>{try{let i=new FileReader;i.readAsDataURL(e),i.onloadend=()=>{let t=String(i.result);if(t){let[a,o]=t.split(";base64,"),l=e.name.includes(e.type)?e.name:"".concat(e.name,".").concat(e.type),s={mimeType:a,content:t,rawContent:o,extension:e.type,name:e.name,documentType:n,filename:l};return r(s)}return r(null)}}catch(a){console.log(a),t.Am.error("Ocorreu um erro desconhecido ao processar o seu arquivo. Por favor, selecione novamente o arquivo e tente de novo.",{position:"bottom-right",autoClose:5e3,hideProgressBar:!1,closeOnClick:!0,pauseOnHover:!0,draggable:!0,progress:void 0})}})},32625:function(e,n){"use strict";n.Z=e=>!!e.match(/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/)}},function(e){e.O(0,[3512,8051,2247,5726,3662,7691,9870,2679,1978,2425,1415,8172,4398,9805,757,8278,6726,6581,4937,9774,2888,179],function(){return e(e.s=75041)}),_N_E=e.O()}]);

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.