1"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[1779],{1779:(N,v,d)=>{d.r(v),d.d(v,{ListaCadastrosPageModule:()=>z});var _=d(177),p=d(4341),l=d(4742),b=d(9415),u=d(467),F=d(5303),m=d(2643),x=d(7235),t=d(3953),y=d(930);function j(a,c){if(1&a){const i=t.RV6();t.j41(0,"ion-button",15),t.bIt("click",function(){t.eBV(i);const o=t.XpG().$implicit,n=t.XpG(2);return t.Njj(n.abrirArquivo(o.foto))}),t.EFF(1," \u{1f4c4} Ver foto "),t.k0s()}}function k(a,c){if(1&a){const i=t.RV6();t.j41(0,"ion-button",15),t.bIt("click",function(){t.eBV(i);const o=t.XpG(2).$implicit,n=t.XpG(2);return t.Njj(n.abrirArquivo(o.declaracaoMatricula))}),t.EFF(1," \u{1f4c4} Declara\xe7\xe3o "),t.k0s()}}function E(a,c){if(1&a){const i=t.RV6();t.j41(0,"ion-button",15),t.bIt("click",function(){t.eBV(i);const o=t.XpG(2).$implicit,n=t.XpG(2);return t.Njj(n.abrirArquivo(o.rgAtleta))}),t.EFF(1," \u{1f4c4} RG "),t.k0s()}}function M(a,c){if(1&a){const i=t.RV6();t.j41(0,"ion-button",15),t.bIt("click",function(){t.eBV(i);const o=t.XpG(2).$implicit,n=t.XpG(2);return t.Njj(n.abrirArquivo(o.termoResponsabilidade))}),t.EFF(1," \u{1f4c4} Termo "),t.k0s()}}function A(a,c){if(1&a&&(t.j41(0,"ion-col",16)(1,"div",17),t.DNE(2,k,2,0,"ion-button",12)(3,E,2,0,"ion-button",12)(4,M,2,0,"ion-button",12),t.k0s()()),2&a){const i=t.XpG().$implicit;t.R7$(2),t.Y8G("ngIf",i.declaracaoMatricula),t.R7$(),t.Y8G("ngIf",i.rgAtleta),t.R7$(),t.Y8G("ngIf",i.termoResponsabilidade)}}function R(a,c){if(1&a){const i=t.RV6();t.j41(0,"ion-row",11)(1,"ion-col",8),t.EFF(2),t.k0s(),t.j41(3,"ion-col",9),t.EFF(4),t.k0s(),t.j41(5,"ion-col",9),t.EFF(6),t.k0s(),t.j41(7,"ion-col",9),t.DNE(8,j,2,0,"ion-button",12),t.k0s(),t.j41(9,"ion-col",8),t.EFF(10," > "),t.j41(11,"ion-button",13),t.bIt("click",function(){const o=t.eBV(i).$implicit,n=t.XpG(2);return t.Njj(n.confirmarExcluir(o.id))}),t.EFF(12,"Excluir"),t.k0s()(),t.DNE(13,A,5,3,"ion-col",14),t.k0s()}if(2&a){const i=c.$implicit,e=c.index;t.R7$(2),t.Lme("",e+1,".",i.nome,""),t.R7$(2),t.JRh(i.cpf),t.R7$(2),t.JRh(null==i.modalidades?null:i.modalidades.join(", ")),t.R7$(2),t.Y8G("ngIf",i.declaracaoMatricula),t.R7$(5),t.Y8G("ngIf",i.declaracaoMatricula||i.rgAtleta||i.termoResponsabilidade)}}function D(a,c){if(1&a&&(t.j41(0,"ion-grid",6)(1,"ion-row",7)(2,"ion-col",8)(3,"strong"),t.EFF(4,"Nome"),t.k0s()(),t.j41(5,"ion-col",9)(6,"strong"),t.EFF(7,"CPF"),t.k0s()(),t.j41(8,"ion-col",9)(9,"strong"),t.EFF(10,"Modalidades"),t.k0s()(),t.j41(11,"ion-col",9)(12,"strong"),t.EFF(13,"Foto"),t.k0s()(),t.j41(14,"ion-col",8)(15,"strong"),t.EFF(16,"A\xe7\xf5es"),t.k0s()()(),t.DNE(17,R,14,6,"ion-row",10),t.k0s()),2&a){const i=t.XpG();t.R7$(17),t.Y8G("ngForOf",i.cadastrosFiltrados)}}function T(a,c){1&a&&(t.j41(0,"ion-text",18)(1,"p",19),t.EFF(2,"Nenhum cadastro encontrado."),t.k0s()())}const w=[{path:"",component:(()=>{var a;class c{constructor(e,o,n){this.formularioService=e,this.alertCtrl=o,this.toastCtrl=n,this.cadastros=[],this.cadastrosFiltrados=[],this.pesquisa="",this.pageSize=10,this.lastDoc=null,this.maisDisponivel=!0}ngOnInit(){this.user=F.Y.UserDataDecrypt(),this.carregarCadastros()}carregarCadastros(){var e;null!==(e=this.user)&&void 0!==e&&e.organizacaoID&&this.formularioService.listarFormularios(this.user.organizacaoID).subscribe(o=>{o.length<this.pageSize&&(this.maisDisponivel=!1),o.length>0&&(this.lastDoc=o[o.length-1].doc,this.cadastros.push(...o),this.cadastrosFiltrados=[...this.cadastros])})}carregarMais(){this.carregarCadastros()}filtrar(){const e=this.pesquisa.toLowerCase();this.cadastrosFiltrados=this.cadastros.filter(o=>{var n,r,s;return(null===(n=o.nome)||void 0===n?void 0:n.toLowerCase().includes(e))||(null===(r=o.rg)||void 0===r?void 0:r.toLowerCase().includes(e))||(null===(s=o.campus)||void 0===s?void 0:s.toLowerCase().includes(e))||Array.isArray(o.modalidades)&&o.modalidades.join(", ").toLowerCase().includes(e)})}confirmarExcluir(e){var o=this;return(0,u.A)(function*(){yield(yield o.alertCtrl.create({header:"Confirma\xe7\xe3o",message:"Tem certeza que deseja excluir este cadastro?",buttons:[{text:"Cancelar",role:"cancel"},{text:"Excluir",handler:()=>o.excluirCadastro(e)}]})).present()})()}excluirCadastro(e){var o=this;return(0,u.A)(function*(){try{yield o.formularioService.deletarFormulario(e),o.cadastros=o.cadastros.filter(n=>n.id!==e),o.cadastrosFiltrados=[...o.cadastros],o.mostrarToast("Cadastro exclu\xeddo com sucesso!","success")}catch(n){console.error("Erro ao excluir cadastro:",n),o.mostrarToast("Erro ao excluir cadastro.","danger")}})()}mostrarToast(e,o){var n=this;return(0,u.A)(function*(){yield(yield n.toastCtrl.create({message:e,duration:3e3,color:o,position:"bottom"})).present()})()}dividirEmLotes(e,o){const n=[];for(let r=0;r<e.length;r+=o)n.push(e.slice(r,r+o));return n}baixarCracha(e){const o="https://firebasestorage.googleapis.com/v0/b/vinver-90a4c.appspot.com/o/images%2Fimages.png?alt=media&token=3e9dedbb-8e18-45ea-a601-2e472a694c2d";m.vfs=x.vfs,Promise.all([this.converterImagemParaBase64(o),this.converterImagemParaBase64(e.foto?e.foto:o)]).then(([n,r])=>{console.log(n);const s={pageSize:{width:280,height:360},pageMargins:[10,10,10,10],content:[{table:{widths:["*"],body:[[{margin:[10,10,10,10],stack:[{image:n,width:50,alignment:"center",margin:[0,0,0,10]},{image:r,width:90,height:110,alignment:"center",margin:[0,0,0,10]},{text:e.nome,style:"nomeAtleta"},{text:`Nascimento: ${e.dataNascimento}`,style:"infoAtleta"},{text:`RG: ${e.rg}`,style:"infoAtleta"},{text:`Campus: ${e.campus}`,style:"infoAtleta"},{canvas:[{type:"rect",x:0,y:0,w:200,h:3,color:"green"}],margin:[0,10,0,10]},{text:Array.isArray(e.modalidades)?e.modalidades.join(", "):e.modalidades,style:"modalidade",alignment:"center",noWrap:!1},{text:"ATLETA",style:"rodapeCracha"}]}]]},layout:{hLineWidth:function(){return 1},vLineWidth:function(){return 1},hLineColor:function(){return"#CCCCCC"},vLineColor:function(){return"#CCCCCC"},paddingLeft:function(){return 5},paddingRight:function(){return 5},paddingTop:function(){return 5},paddingBottom:function(){return 5}}}],styles:{nomeAtleta:{fontSize:12,bold:!0,alignment:"center",margin:[0,5,0,5],color:"#333333"},infoAtleta:{fontSize:8,alignment:"center",color:"#555555",margin:[0,1,0,1]},modalidade:{fontSize:14,bold:!0,alignment:"center",color:"green",margin:[0,5,0,5]},rodapeCracha:{fontSize:10,bold:!0,alignment:"center",color:"#000000",margin:[0,5,0,0]}}};m.createPdf(s).open()})}baixarCrachaPorLote(e){var o=this;return(0,u.A)(function*(){m.vfs=x.vfs;const s=o.dividirEmLotes(o.cadastrosFiltrados,30)[e];if(!s)return void o.mostrarToast("Lote inv\xe1lido.","danger");const P=yield o.converterImagemParaBase64("https://firebasestorage.googleapis.com/v0/b/vinver-90a4c.appspot.com/o/images%2Fimages.png?alt=media&token=3e9dedbb-8e18-45ea-a601-2e472a694c2d"),f=[];for(const[S,g]of s.entries()){var h,C,L;const $=g.foto?yield o.converterImagemParaBase64(g.foto):P,B=null!==(h=g.dataNascimento)&&void 0!==h&&null!==(C=(L=h).toDate)&&void 0!==C&&C.call(L)?g.dataNascimento.toDate().toLocaleDateString("pt-BR"):g.dataNascimento,O={table:{widths:["*"],body:[[{margin:[10,10,10,10],stack:[{image:P,width:50,alignment:"center",margin:[0,0,0,10]},{image:$,width:90,height:110,alignment:"center",margin:[0,0,0,10]},{text:g.nome,style:"nomeAtleta"},{text:`Nascimento: ${B}`,style:"infoAtleta"},{text:`RG: ${g.rg}`,style:"infoAtleta"},{text:`Campus: ${g.campus}`,style:"infoAtleta"},{canvas:[{type:"rect",x:0,y:0,w:200,h:3,color:"green"}],margin:[0,10,0,10]},{text:Array.isArray(g.modalidades)?g.modalidades.join(", "):g.modalidades||"",style:"modalidade",alignment:"center"},{text:"ATLETA",style:"rodapeCracha"}]}]]},layout:{hLineWidth:()=>1,vLineWidth:()=>1,hLineColor:()=>"#CCCCCC",vLineColor:()=>"#CCCCCC",paddingLeft:()=>5,paddingRight:()=>5,paddingTop:()=>5,paddingBottom:()=>5}};f.push(O),S<s.length-1&&f.push({text:"",pageBreak:"after"})}const G={pageSize:{width:280,height:360},pageMargins:[10,10,10,10],content:f,styles:o.getPdfStyles()};m.createPdf(G).download(`crachas_lote_${e+1}.pdf`)})()}converterImagemParaBase64(e){return new Promise((o,n)=>{const r=new XMLHttpRequest;r.onload=function(){const s=new FileReader;s.onloadend=()=>o(s.result),s.readAsDataURL(r.response)},r.onerror=s=>n(s),r.open("GET",e),r.responseType="blob",r.send()})}abrirArquivo(e){if(!e)return;const o=e.includes("dl=1")?e:e.includes("?")?e+"&dl=1":e+"?dl=1";window.open(o,"_blank")}getPdfStyles(){return{nomeAtleta:{fontSize:12,bold:!0,alignment:"center",margin:[0,5,0,5],color:"#333333"},infoAtleta:{fontSize:8,alignment:"center",color:"#555555",margin:[0,1,0,1]},modalidade:{fontSize:14,bold:!0,alignment:"center",color:"green",margin:[0,5,0,5]},rodapeCracha:{fontSize:10,bold:!0,alignment:"center",color:"#000000",margin:[0,5,0,0]}}}}return(a=c).\u0275fac=function(e){return new(e||a)(t.rXU(y.f),t.rXU(l.hG),t.rXU(l.K_))},a.\u0275cmp=t.VBU({type:a,selectors:[["app-lista-cadastros"]],decls:11,vars:3,consts:[["vazio",""],[1,"ion-padding"],[1,"header-container"],["src","assets/logo.png","alt","Logo",1,"header-image"],["placeholder","Pesquisar por Nome, CPF ou Modalidade",3,"ngModelChange","ionInput","ngModel"],["class","ion-no-padding",4,"ngIf","ngIfElse"],[1,"ion-no-padding"],["color","light",1,"ion-text-center"],["size","3"],["size","2"],["class","ion-align-items-center","style","border-top: 1px solid #ccc; padding: 6px 0",4,"ngFor","ngForOf"],[1,"ion-align-items-center",2,"border-top","1px solid #ccc","padding","6px 0"],["size","small","fill","clear",3,"click",4,"ngIf"],["size","small","color","danger",3,"click"],["size","12",4,"ngIf"],["size","small","fill","clear",3,"click"],["size","12"],[2,"margin-top","4px","font-size","13px"],["color","medium"],[2,"text-align","center"]],template:function(e,o){if(1&e){const n=t.RV6();t.j41(0,"ion-header")(1,"ion-toolbar")(2,"ion-title"),t.EFF(3,"Lista de Cadastros"),t.k0s()()(),t.j41(4,"ion-content",1)(5,"div",2),t.nrm(6,"img",3),t.k0s(),t.j41(7,"ion-searchbar",4),t.mxI("ngModelChange",function(s){return t.eBV(n),t.DH7(o.pesquisa,s)||(o.pe
1squisa=s),t.Njj(s)}),t.bIt("ionInput",function(){return t.eBV(n),t.Njj(o.filtrar())}),t.k0s(),t.DNE(8,D,18,1,"ion-grid",5)(9,T,3,0,"ng-template",null,0,t.C5r),t.k0s()}if(2&e){const n=t.sdS(10);t.R7$(7),t.R50("ngModel",o.pesquisa),t.R7$(),t.Y8G("ngIf",o.cadastrosFiltrados.length>0)("ngIfElse",n)}},dependencies:[_.Sq,_.bT,p.BC,p.vS,l.Jm,l.hU,l.W9,l.lO,l.eU,l.ln,l.S1,l.IO,l.BC,l.ai,l.Gw],styles:['@charset "UTF-8";#container[_ngcontent-%COMP%]{text-align:center;position:absolute;left:0;right:0;top:50%;transform:translateY(-50%)}#container[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{font-size:20px;line-height:26px}#container[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{font-size:16px;line-height:22px;color:#8c8c8c;margin:0}#container[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{text-decoration:none}.custom-background[_ngcontent-%COMP%]{background:url(/assets/1.png) no-repeat center center/cover}.header-container[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;height:200px}.header-image[_ngcontent-%COMP%]{max-width:100%;height:auto}ion-row[_ngcontent-%COMP%]{border-bottom:1px solid #ddd;padding:6px 0}ion-col[_ngcontent-%COMP%]{font-size:14px}']}),c})()}];let I=(()=>{var a;class c{}return(a=c).\u0275fac=function(e){return new(e||a)},a.\u0275mod=t.$C({type:a}),a.\u0275inj=t.G2t({imports:[b.iI.forChild(w),b.iI]}),c})(),z=(()=>{var a;class c{}return(a=c).\u0275fac=function(e){return new(e||a)},a.\u0275mod=t.$C({type:a}),a.\u0275inj=t.G2t({imports:[_.MD,p.YN,l.bv,I]}),c})()}}]);
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.