1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7099],{7099:(o,a,e)=>{e.r(a),e.d(a,{FichaInscricaoItem:()=>I,default:()=>x});var n=e(37876),l=e(14232),i=e(55925),r=e(44480),t=e(21293),c=e(60312),d=e(90485),u=e(40313),s=e(67904),m=e(81082),p=e(81601),v=e(49580),g=e(30580);let C=o=>o===v.Gj.RecebimentoFichaAdesao?{Cor:p.gK.Afirmativo,Icone:r.G.faCircleCheck,Titulo:"Inclu\xeddo",Acao:"Editar",IconeAcao:r.G.faEdit}:o===v.Gj.InclusaoFichaAdesao?{Cor:p.gK.Secundario,Icone:r.G.faFileImport,Titulo:"Importado",Acao:"Editar",IconeAcao:r.G.faEdit}:{Cor:p.gK.Alerta,Icone:r.G.faPenToSquare,Titulo:"Rascunho",Acao:"Continuar",IconeAcao:r.G.faPenToSquare},h=(o,a)=>e=>{var n;null==e||null==(n=e.stopPropagation)||n.call(e),null==o||o(a)},A=async o=>{if(null==o?void 0:o.Id)try{let a=await (0,g.sN)("/gerencial/ficha-inscricao-orgao/anexos/baixar/".concat(o.Id));if(!(null==a?void 0:a.Dados))return void(0,m.Ay)({Mensagem:"N\xe3o foi poss\xedvel baixar o anexo.",Tipo:m.lF.Erro});let e=document.createElement("a");e.href="data:".concat(a.MimeType||"application/octet-stream",";base64,").concat(a.Dados),e.download=a.Nome||(null==o?void 0:o.Nome)||(null==o?void 0:o.Descricao)||"anexo_".concat(o.Id),document.body.appendChild(e),e.click(),e.remove()}catch(o){(0,m.Ay)({Mensagem:"Falha ao baixar o anexo.",Tipo:m.lF.Erro})}},I=o=>{var a;let{ficha:e,onEditar:v,onExcluir:I}=o,x=C(null==e?void 0:e.Status),P=(null==e?void 0:e.Matricula)?String(e.Matricula).padStart(10,"0"):"â",D=(null==e?void 0:e.QtdAnexos)>0||(null==e?void 0:e.PossuiAnexos),f=Number(null!=(a=null==e?void 0:e.QtdAnexos)?a:0)||+(null!=e&&!!e.PossuiAnexos),[N,T]=(0,l.useState)(!1),[F,S]=(0,l.useState)([]),[b,E]=(0,l.useState)(!1),y=async o=>{var a;if(null==o||null==(a=o.stopPropagation)||a.call(o),D){if(N)return void T(!1);if((T(!0),!(F.length>0))&&(null==e?void 0:e.IdNaoParticipante)){E(!0);try{let o=await (0,g.sN)("/gerencial/ficha-inscricao-orgao/anexos/listar",{IdNaoParticipante:e.IdNaoParticipante});S(Array.isArray(null==o?void 0:o.Itens)?o.Itens:[])}catch(o){(0,m.Ay)({Mensagem:"Falha ao carregar anexos.",Tipo:m.lF.Erro})}finally{E(!1)}}}},V=[{Texto:x.Acao,Icone:x.IconeAcao,Cor:p.gK.Principal,Variante:p.T_.Fantasma,Tamanho:p._$.Minusculo,Acao:h(v,e)},(null==e?void 0:e.Rascunho)&&{Texto:"Excluir",Icone:r.G.faTrash,Cor:p.gK.Negativo,Variante:p.T_.Fantasma,Tamanho:p._$.Minusculo,Acao:h(I,e)}];return(0,n.jsx)(d.S,{Icone:{Nome:x.Icone,Cor:x.Cor,Titulo:x.Titulo},Titulo:{Texto:x.Titulo,Cor:x.Cor,Tamanho:p._$.Pequeno},SubTitulo:{Texto:null==e?void 0:e.Nome,TituloTexto:null==e?void 0:e.Nome,Config:{display:"block",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxW:"100%",minW:0}},Acao:()=>null==v?void 0:v(e),Config:{h:"100%"},Corpo:(0,n.jsxs)(i.Ay,{gap:1.5,flex:1,justifyContent:"space-between",children:[(0,n.jsxs)(i.Hn,{alignItems:"center",justifyContent:"flex-end",gap:2,rowGap:1,flexWrap:"wrap",children:[(0,n.jsx)(u.I,{Icone:r.G.faIdCard,Cor:p.gK.Principal,Variante:p.hB.Contorno,Titulo:"CPF",Valor:(null==e?void 0:e.CPFFormatado)||"â"}),(0,n.jsx)(u.I,{Icone:r.G.faHashtag,Cor:p.gK.Principal,Variante:p.hB.Contorno,Titulo:"Matr\xedcula",Valor:P}),(0,n.jsx)(u.I,{Icone:r.G.faCalendarCheck,Cor:p.gK.Principal,Variante:p.hB.Contorno,Titulo:"Data ades\xe3o",Valor:(null==e?void 0:e.DataAdesaoFormatada)||"â"})]}),D&&N&&(0,n.jsxs)(i.Ay,{gap:1,pl:2,borderLeftWidth:2,borderLeftColor:"".concat(x.Cor,".300"),children:[b&&(0,n.jsx)(c.Ay,{Texto:"Carregando anexosâ¦",Tamanho:p._$.Pequeno}),!b&&0===F.length&&(0,n.jsx)(c.Ay,{Texto:"Nenhum anexo encontrado.",Tamanho:p._$.Pequeno}),!b&&F.map(o=>{var a,e,l;return(0,n.jsxs)(i.Hn,{alignItems:"center",justifyContent:"space-between",gap:2,children:[(0,n.jsx)(c.Ay,{Texto:null!=(l=null!=(e=null!=(a=null==o?void 0:o.Nome)?a:null==o?void 0:o.Descricao)?e:null==o?void 0:o.Caminho)?l:"Anexo ".concat(null==o?void 0:o.Id),Tamanho:p._$.Pequeno,Truncado:!0}),(0,n.jsx)(s.Ay,{Texto:"Baixar",Icone:r.G.faDownload,Variante:p.T_.Fantasma,Tamanho:p._$.Minusculo,Cor:p.gK.Principal,Acao:a=>{var e;null==a||null==(e=a.stopPropagation)||e.call(a),A(o)}})]},null==o?void 0:o.Id)})]}),(0,n.jsx)(t.Ay,{Divisor:!0,Informativo:(0,n.jsx)(t.Ay,{Itens:[{Texto:D?"".concat(f," ").concat(1===f?"anexo":"anexos").concat(N?" (ocultar)":""):"Sem anexos",Icone:D&&N?r.G.faChevronUp:r.G.faPaperclip,Cor:D?p.gK.Secundario:p.gK.Acentuado,Variante:p.T_.Fantasma,Tamanho:p._$.Minusculo,Desabilitado:!D,Acao:y}],Config:{justifyContent:"flex-start"}}),Itens:V})]})})},x=I},49580:(o,a,e)=>{e.d(a,{DB:()=>s,xX:()=>E,uk:()=>p,ps:()=>S,Vg:()=>d,VC:()=>u,kt:()=>F,SL:()=>f,hM:()=>N,Gj:()=>T});var n=e(4966),l=e(96851),i=e(1174),r=e(57008),t=e(72496),c=e(30580);let d=[{Codigo:"A",Titulo:"Acima do Teto INSS",Flag:"AcimaTetoINSS",Valor:"PercentualDescontoOpcaoA"},{Codigo:"B",Titulo:"Abaixo do Teto INSS (Facultativo)",Flag:"AbaixoTetoINSS",Valor:"PercentualDescontoOpcaoB"}
1,{Codigo:"C",Titulo:"Participante Ativo Anterior",Flag:"TetoAtivoAnterior",Valor:"PercentualDescontoOpcaoC"},{Codigo:"D",Titulo:"Comissionado ou Tempor\xe1rio",Flag:"Comissionado",Valor:"PercentualDescontoOpcaoD"},{Codigo:"E",Titulo:"Militar",Flag:"Militar",Valor:"PercentualDescontoOpcaoE"}],u=o=>{var a;let e=d.find(a=>!!(null==o?void 0:o[a.Flag]));return null!=(a=null==e?void 0:e.Codigo)?a:null},s=o=>{let a=[];return d.forEach(e=>{let n=e.Codigo===o;a.push({Campo:e.Flag,Valor:n}),n||a.push({Campo:e.Valor,Valor:0})}),a},m=(o,a,e)=>{let n=[];for(let l=o;l<=a+1e-4;l=+(l+e).toFixed(2))n.push(+l.toFixed(2));return n},p=Array.from(new Set([...m(0,50,.1),...m(55,100,5),...m(110,200,10),...m(250,500,50),.01,.21,.25,1.05,1.65])).sort((o,a)=>o-a).map((o,a)=>({Id:a+1,Valor:o,Descricao:"".concat(o.toFixed(2).replace(".",","),"%")})),v=o=>null==o||"string"==typeof o&&""===o.trim(),g=o=>v(o)||0===Number(o),C=o=>{var a;let e=[];return g((null!=(a=null==o?void 0:o.DadosCadastraisPrevidenciario)?a:{}).IdCNPB)&&e.push("CNPB / Plano \xe9 obrigat\xf3rio."),g(null==o?void 0:o.IdOrgao)&&e.push("\xd3rg\xe3o \xe9 obrigat\xf3rio."),v(null==o?void 0:o.CPF)?e.push("CPF \xe9 obrigat\xf3rio."):11!==String(o.CPF).replace(/\D+/g,"").length&&e.push("CPF deve ter 11 d\xedgitos."),v(null==o?void 0:o.Nome)&&e.push("Nome completo \xe9 obrigat\xf3rio."),v(null==o?void 0:o.RG)&&e.push("RG \xe9 obrigat\xf3rio."),v(null==o?void 0:o.DataDeNascimento)&&e.push("Data de nascimento \xe9 obrigat\xf3ria."),e},h=(o,a)=>{var e;let n=[];v(null==a?void 0:a.CEP)&&n.push("".concat(o,": CEP \xe9 obrigat\xf3rio.")),g(null==a?void 0:a.IdEnderecamentoPostal)&&n.push("".concat(o,": pesquise o CEP e selecione/cadastre o endere\xe7o.")),v(null==a?void 0:a.Logradouro)&&n.push("".concat(o,": Logradouro \xe9 obrigat\xf3rio.")),v(null==a?void 0:a.UF)&&n.push("".concat(o,": UF \xe9 obrigat\xf3rio."));let l=String(null!=(e=null==a?void 0:a.Numero)?e:"").trim();return l&&"0"!==l||n.push("".concat(o,": N\xfamero \xe9 obrigat\xf3rio.")),n},A=o=>{let a=[...h("Endere\xe7o residencial",null==o?void 0:o.DadosCadastraisEndereco)];return g(null==o?void 0:o.IdNacionalidade)&&a.push("Nacionalidade \xe9 obrigat\xf3ria."),g(null==o?void 0:o.IdNaturalidade)&&a.push("Cidade de naturalidade \xe9 obrigat\xf3ria."),a},I=[o=>[...C(o),...A(o)],o=>h("Endere\xe7o funcional",null==o?void 0:o.DadosCadastraisEmpregaticio),o=>{var a;let e=[],n=null!=(a=null==o?void 0:o.DadosCadastraisPrevidenciario)?a:{},l=u(n);if(l){let o=d.find(o=>o.Codigo===l);o&&0>=(Number(n[o.Valor])||0)&&e.push("Informe o percentual de desconto para a op\xe7\xe3o selecionada.")}else e.push("Selecione uma op\xe7\xe3o de contribui\xe7\xe3o mensal.");return v(n.DataAssinatura)&&e.push("Data da assinatura \xe9 obrigat\xf3ria."),e}],x=(o,a)=>{let e=I[o];return e?e(a):[]},P=o=>I.flatMap(a=>a(o)),D=o=>{if(!(null==o?void 0:o.length))return!1;let a=o.map(o=>o.replace(/\.$/,"").trim()).filter(Boolean);if(!a.length)return!1;let e=a.length>1?"".concat(a.slice(0,-1).join(", ")," e ").concat(a.at(-1)):a[0];return"Preencha antes de avan\xe7ar: ".concat(e,".")},f=(o,a)=>D(x(o,a)),N=o=>D(P(o));(0,i.JD)(async(o,a,e)=>{var i,r,d,u,s,m,p,v,g;let C=await (0,l.RV)(n.w.FichaInscricaoOrgao,null==o?void 0:o.req),h=null!=(u=null!=(d=null==o||null==(i=o.params)?void 0:i.id)?d:null==o||null==(r=o.query)?void 0:r.id)?u:"novo",A=String(Array.isArray(h)?h[0]:h),I="novo"===A?0:Number(A)||0,x=F();if(0===I){let a=Number(null!=(p=null==o||null==(s=o.query)?void 0:s.org)?p:0)||0,e=Number(null!=(v=null==o||null==(m=o.query)?void 0:m.plano)?v:0)||0;a>0&&(x.IdOrgao=a),e>0&&(x.DadosCadastraisPrevidenciario.IdCNPB=e)}if(I>0){let o=(0,t.YF)(null==e?void 0:e.Fundacao),a=await (0,c.k_)("dadosOrgaoFichaInscricao",null==o?void 0:o.Api,{IdNaoParticipante:I},null==e?void 0:e.Login);(null==a?void 0:a.Sucesso)&&(null==a?void 0:a.Ficha)&&(x={...a.Ficha,AnexosExistentes:null!=(g=a.Anexos)?g:[]})}return{...C,Dados:x}});var T=function(o){return o[o.Nenhum=0]="Nenhum",o[o.AguardandoFichaAdesao=1]="AguardandoFichaAdesao",o[o.InclusaoFichaAdesao=2]="InclusaoFichaAdesao",o[o.RecebimentoFichaAdesao=3]="RecebimentoFichaAdesao",o[o.Adesao=4]="Adesao",o[o.Elegiveis=5]="Elegiveis",o[o.Homologado=6]="Homologado",o[o.Indeferido=7]="Indeferido",o[o.InformadoPoliticamenteExposto=8]="InformadoPoliticamenteExposto",o[o.AcessoLiberado=9]="AcessoLiberado",o[o.Rascunho=10]="Rascunho",o[o.Cancelamento=11]="Cancelamento",o[o.IncluidoSite=12]="IncluidoSite",o[o.AguardandoAssinatura=13]="AguardandoAssinatura",o}({});let F=()=>({IdOrgaoCentralizador:0,IdOrgao:0,IdNaoParticipante:0,Status:0,CPF:"",Nome:"",DataDeNascimento:null,RG:"",Matricula:"",PV:0,Sexo:0,EstadoCivil:0,IdNacionalidade:0,IdNaturalidadeUF:0,IdNaturalidade:0,Email:"",NumeroDependentes:0,DadosCadastraisPrevidenciario:{IdCNPB:0,DataAssinatura:new Date().toISOString().slice(0,10),AcimaTetoINSS:!1,PercentualDescontoOpcaoA:0,DescricaoDescontoOpcaoA:"",AbaixoTetoINSS:!1,PercentualDescontoOpcaoB:0,DescricaoDescontoOpcaoB:"",TetoAtivoAnterior:!1,PercentualDescontoOpcaoC:0,DescricaoDescontoOpcaoC:"",Comissionado:!1,PercentualDescontoOpcaoD:0,DescricaoDescontoOpcaoD:"",Militar:!1,PercentualDescontoOpcaoE:0,DescricaoDescontoOpcaoE:""},DadosCadastraisPessoal:{OrgaoExpedidor:"",DtExpedicao:null,NomePai:"",NomeMae:"",NomeConjuge:""},DadosCadastraisEndereco:{IdEnderecamentoPostal:0,CEP:"",Logradouro:"",Numero:"",Complemento:"",Bairro:"",Cidade:"",UF:"",Pais:"",Celular:"",Residencial:"",TipoEnderecamento:1},DadosCadastraisEmpregaticio:{IdEnderecamentoPostal:0,CEP:"",Logradouro:"",Numero:"",Complemento:"",Bairro:"",Cidade:"",UF:"",Pais:"",Email:"",Comercial:"",TelefoneCelularComercial:"",Fax:"",CaixaPostal:"",OutrasInformacoes:"",IdCargo:0,Id
1Departamento:0,IdDiretoria:0,IdCentroDeCusto:0,IdSecao:0,TipoFormacao:0,Formacao:"",Poder:0,Renda:""},AnexosNovos:[],AnexosRemover:[]}),S=o=>{var a,e,n,l,i,r;return{Descricao:null!=(n=null!=(e=null!=(a=null==o?void 0:o.Descricao)?a:null==o?void 0:o.Nome)?e:null==o?void 0:o.name)?n:"anexo",Valor:null!=(r=null!=(i=null!=(l=null==o?void 0:o.Valor)?l:null==o?void 0:o.Base64Cache)?i:null==o?void 0:o.dataURI)?r:null}},b=o=>{switch(o){case 10:return"Rascunho";case 2:return"Importado";case 3:return"Inclu\xeddo";default:return""}},E=o=>(null!=o?o:[]).map(o=>{var a,e,n;let l=null!=(a=null==o?void 0:o.QtdAnexos)?a:+(null!=o&&!!o.PossuiAnexos);return{IdNaoParticipante:null==o?void 0:o.IdNaoParticipante,Nome:null==o?void 0:o.Nome,CPFFormatado:null==o?void 0:o.CPFFormatado,Matricula:null==o?void 0:o.Matricula,DataAdesaoFormatada:(null==o?void 0:o.DataAdesao)?(0,r.Formatada)(o.DataAdesao,"dd/MM/yyyy"):"â",AnexosTexto:l>0?"".concat(l," anexo").concat(l>1?"s":""):"â",QtdAnexos:l,IdPatrocinadoraLocal:null!=(e=null==o?void 0:o.IdPatrocinadoraLocal)?e:0,PatrocinadoraLocal:null!=(n=null==o?void 0:o.PatrocinadoraLocal)?n:"",DescricaoStatus:b(null==o?void 0:o.Status)||(null==o?void 0:o.DescricaoStatus)||"â",Status:null==o?void 0:o.Status,Rascunho:null==o?void 0:o.Rascunho,PossuiAnexos:null==o?void 0:o.PossuiAnexos,DataAdesao:null==o?void 0:o.DataAde
1sao}})}}]);
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.