1(self.webpackChunkchd_mirame_web=self.webpackChunkchd_mirame_web||[]).push([[6097],{319:(D,S,o)=>{"use strict";o.d(S,{S:()=>b});class b{constructor(h,c,v,t){this.pageNumber=h,this.pageSize=c,this.sortField=v,this.sortDirection=t}}},2260:(D,S,o)=>{"use strict";o.d(S,{o:()=>h});var b=o(7579),u=o(5e3);let h=(()=>{class c{constructor(){this.searchSubject$=new b.x}searchChange(t){this.searchSubject$.next(t)}}return c.\u0275fac=function(t){return new(t||c)},c.\u0275prov=u.Yz7({token:c,factory:c.\u0275fac,providedIn:"any"}),c})()},1250:(D,S,o)=>{"use strict";o.d(S,{O:()=>h});var b=o(1135),u=o(5e3);let h=(()=>{class c{constructor(){this.tabIndexSubject$=new b.X(0)}changeTab(t){this.tabIndexSubject$.next(t)}}return c.\u0275fac=function(t){return new(t||c)},c.\u0275prov=u.Yz7({token:c,factory:c.\u0275fac,providedIn:"any"}),c})()},8825:(D,S,o)=>{"use strict";o.d(S,{o:()=>b});class b{isErrorState(h,c){return!!(h&&h.invalid&&(h.dirty||h.touched||c&&c.submitted))}}},3287:(D,S,o)=>{"use strict";o.r(S),o.d(S,{HttpLoaderFactory:()=>j,PdfDownloadModule:()=>ot});var b=o(4486),u=o(4894),h=o(40),c=o(520),v=o(3932),t=o(5e3),_=o(7706);class E{constructor(d,e,n){this.newSearch=d,this.count=e,this.data=n}}var T=o(4327),i=o(7470),s=o(5625),g=o(262),l=o(3179),f=o(8914),L=o(4209);let F=(()=>{class a{constructor(e,n,r){this.http=e,this.configService=n,this.globalService=r,this.api_path="",this.mirame_path="",this.api_path_pdfs="",this.api_path_count_pdf="",this.api_path_descargar_pdf="",this.api_path=this.configService.getPublicPath(),this.mirame_path=this.configService.getPrivatePath(),this.api_path_pdfs=this.configService.getApi("descargapdf","search"),this.api_path_count_pdf=this.configService.getApi("descargapdf","count"),this.api_path_descargar_pdf=this.configService.getApi("descargapdf","descarga")}getListadoPDF(e,n,r,p,y){let w=new c.LE;return w=w.append("pageNumber",n||"0"),w=w.append("pageSize",r||"10"),w=w.append("tipoOrdenacion",p||l.C.TipoOrdenacion.ASCENDENTE),w=w.append("campoOrdenacion",y||"id"),this.http.post(this.mirame_path+this.api_path_pdfs,e,{params:w}).pipe((0,s.X)(1),(0,g.K)(this.globalService.handleError))}getListadoPDFCount(e){return this.http.post(this.mirame_path+this.api_path_count_pdf,e).pipe((0,s.X)(1),(0,g.K)(this.globalService.handleError))}descargar(e){return this.http.post(this.mirame_path+this.api_path_descargar_pdf,e,{observe:"response"}).pipe((0,s.X)(1),(0,g.K)(this.globalService.handleError))}}return a.\u0275fac=function(e){return new(e||a)(t.LFG(c.eN),t.LFG(f.E),t.LFG(L.U))},a.\u0275prov=t.Yz7({token:a,factory:a.\u0275fac,providedIn:"root"}),a})();var x=o(1250),A=o(4834),C=o(5861),m=o(3075),B=o(7579),I=o(2722),R=o(8825),N=o(2260),J=o(9547),Y=o(9027),P=o(7322),K=o(8833),Z=o(6856),O=o(60),M=o(7423),U=o(5397);function G(a,d){1&a&&(t.TgZ(0,"mat-error"),t._uU(1),t.ALo(2,"translate"),t.qZA()),2&a&&(t.xp6(1),t.Oqu(t.lcZ(2,1,"validacionForm.formatoFecha")))}function W(a,d){1&a&&(t.TgZ(0,"mat-error"),t._uU(1),t.ALo(2,"translate"),t.qZA()),2&a&&(t.xp6(1),t.Oqu(t.lcZ(2,1,"validacionForm.formatoFecha")))}function $(a,d){1&a&&t._UZ(0,"app-spinner")}let H=(()=>{class a{constructor(e,n,r,p){this.searchStatusService=e,this.temporaryStorageService=n,this.fb=r,this.rolesService=p,this.typeKey="",this.newSearchEvent=new t.vpe,this.disabledReportButton=!0,this.perfilUsuario="",this.stop$=new B.x,this.matcher=new R.o,this.rolesService.profile$.pipe((0,I.R)(this.stop$)).subscribe(y=>{this.perfilUsuario=y})}ngOnInit(){this.createForm(),this.temporaryStorage=this.temporaryStorageService.forKey(this.typeKey+"_search_form"),this.restoreFromTemporaryStorage()}createForm(){this.searchGroup=this.fb.group({fechaInicio:this.fb.control({value:"",disabled:!1},m.kI.required),fechaFin:this.fb.control({value:"",disabled:!1},m.kI.required)}),this.initialValues=this.searchGroup.value}onSubmit(){this.searchGroup.invalid||(this.sendNewSearch(this.searchGroup.value),this.searchStatusService.searchChange(!0),this.temporaryStorage.remove(),this.saveToTemporaryStorage(this.searchGroup.value))}sendNewSearch(e){this.newSearchEvent.emit(e)}restoreFromTemporaryStorage(){var e=this;return(0,C.Z)(function*(){var n;let r=yield e.temporaryStorage.get();if(r){for(const p in r){let y=r[p];null===(n=e.searchGroup.get(p))||void 0===n||n.setValue(y)}e.onSubmit()}})()}saveToTemporaryStorage(e){this.temporaryStorage.set(e)}resetForm(){this.searchGroup.reset(this.initialValues)}ngOnDestroy(){this.stop$.next(!0)}}return a.\u0275fac=function(e){return new(e||a)(t.Y36(N.o),t.Y36(J.x),t.Y36(m.qu),t.Y36(Y.f))},a.\u0275cmp=t.Xpm({type:a,selectors:[["app-pdf-download-search-form"]],inputs:{typeKey:"typeKey",disabledReportButton:"disabledReportButton"},outputs:{newSearchEvent:"newSearchEvent"},decls:37,vars:21,consts:[[3,"formGroup","ngSubmit"],["searchForm","ngForm"],[1,"container"],[1,"row"],[1,"col","col-xl-3"],["appearance","fill",1,"width-100"],["matInput","","type","text","name","fechaInicio","formControlName","fechaInicio",3,"matDatepicker","errorStateMatcher"],["matSuffix","",3,"for"],["picker1",""],[4,"ngIf"],["matInput","","type","text","name","fechaFin","formControlName","fechaFin",3,"matDatepicker","errorStateMatcher"],["picker2",""],[1,"row","mt-4"],[1,"col-md-12"],[1,"float-end"],["type","button","mat-flat-button","","color","primary",1,"btn-third",3,"click"],[1,"fa-solid","fa-lines-leaning"],["type","submit","mat-flat-button","","color","primary",1,"btn-first"],[1,"fa-solid","fa-magnifying-glass"],["loading",""]],template:function(e,n){if(1&e&&(t.TgZ(0,"form",0,1),t.NdJ("ngSubmit",function(){return n.onSubmit()}),t.TgZ(2,"div",2)(3,"div",3)(4,"div",4)(5,"mat-label"),t._uU(6),t.ALo(7,"translate"),t.qZA(),t.TgZ(8,"mat-form-field",5),t._UZ(9,"
1input",6)(10,"mat-datepicker-toggle",7)(11,"mat-datepicker",null,8),t.YNc(13,G,3,3,"mat-error",9),t.qZA()(),t.TgZ(14,"div",4)(15,"mat-label"),t._uU(16),t.ALo(17,"translate"),t.qZA(),t.TgZ(18,"mat-form-field",5),t._UZ(19,"input",10)(20,"mat-datepicker-toggle",7)(21,"mat-datepicker",null,11),t.YNc(23,W,3,3,"mat-error",9),t.qZA()()(),t.TgZ(24,"div",12)(25,"div",13)(26,"div",14)(27,"button",15),t.NdJ("click",function(){return n.resetForm()}),t._uU(28),t.ALo(29,"translate"),t._UZ(30,"i",16),t.qZA(),t.TgZ(31,"button",17),t._uU(32),t.ALo(33,"translate"),t._UZ(34,"i",18),t.qZA()()()()()(),t.YNc(35,$,1,0,"ng-template",null,19,t.W1O)),2&e){const r=t.MAs(12),p=t.MAs(22);let y,w;t.Q6J("formGroup",n.searchGroup),t.xp6(6),t.Oqu(t.lcZ(7,13,"formBusqueda.fechaInicio")),t.xp6(3),t.Q6J("matDatepicker",r)("errorStateMatcher",n.matcher),t.xp6(1),t.Q6J("for",r),t.xp6(3),t.Q6J("ngIf",null==(y=n.searchGroup.get("fechaInicio"))?null:y.hasError),t.xp6(3),t.Oqu(t.lcZ(17,15,"formBusqueda.fechaFin")),t.xp6(3),t.Q6J("matDatepicker",p)("errorStateMatcher",n.matcher),t.xp6(1),t.Q6J("for",p),t.xp6(3),t.Q6J("ngIf",null==(w=n.searchGroup.get("fechaFin"))?null:w.hasError),t.xp6(5),t.hij("",t.lcZ(29,17,"botones.limpiar")," "),t.xp6(4),t.hij("",t.lcZ(33,19,"botones.buscar")," ")}},directives:[m._Y,m.JL,m.sg,P.hX,P.KE,K.Nt,m.Fj,Z.hl,m.JJ,m.u,Z.nW,P.R9,Z.Mq,O.O5,P.TO,M.lW,U.O],pipes:[u.X$],styles:[".mat-checkbox[_ngcontent-%COMP%]{margin:0 8px 8px 0}"]}),a})();var Q=o(7278),X=o(4428);function z(a,d){if(1&a){const e=t.EpF();t.ynx(0),t.TgZ(1,"div",6)(2,"h3",7),t._uU(3),t.ALo(4,"translate"),t.qZA(),t.TgZ(5,"app-search-table-config",8),t.NdJ("changePageEvent",function(r){return t.CHM(e),t.oxw().updatePage(r)})("changePageEvent",function(r){return t.CHM(e),t.oxw().updatePage(r)})("newDownloadDocumentEvent",function(r){return t.CHM(e),t.oxw().descargarUno(r)})("newSelectEvent",function(r){return t.CHM(e),t.oxw().addSelection(r)}),t.qZA()(),t.TgZ(6,"div",9)(7,"div",10)(8,"div",11)(9,"button",12),t.NdJ("click",function(){return t.CHM(e),t.oxw().descargarVarios()}),t._uU(10),t.ALo(11,"translate"),t._UZ(12,"i",13),t.qZA(),t.TgZ(13,"button",14),t.NdJ("click",function(){return t.CHM(e),t.oxw().descargarTodos()}),t._uU(14),t.ALo(15,"translate"),t._UZ(16,"i",13),t.qZA()()()(),t.BQk()}if(2&a){const e=t.oxw();
1t.xp6(3),t.Oqu(t.lcZ(4,7,"formBusqueda.resultado")),t.xp6(2),t.Q6J("searchResult",e.pdfObj)("tableColumns",e.tableConfiguration)("visibleButtons",e.visibleButtonsSearch),t.xp6(4),t.Q6J("disabled",e.disableDescargaPdfSeleccionBtn),t.xp6(1),t.hij("",t.lcZ(11,9,"botones.descargarSeleccionados")," "),t.xp6(4),t.hij("",t.lcZ(15,11,"botones.descargarTodos")," ")}}function k(a,d){1&a&&(t.TgZ(0,"div")(1,"div",16)(2,"p"),t._uU(3),t.ALo(4,"translate"),t.qZA()()()),2&a&&(t.xp6(3),t.Oqu(t.lcZ(4,1,"formBusqueda.noResultados")))}function V(a,d){if(1&a&&t.YNc(0,k,5,3,"div",15),2&a){const e=t.oxw();t.Q6J("ngIf",e.pdfObj&&0===e.pdfObj.data.length)}}function q(a,d){1&a&&t._UZ(0,"app-spinner")}let tt=(()=>{class a{constructor(e,n,r){this.pdfDownloadService=e,this.translate=n,this.selectedTabService=r,this.pageSizeOptions=[5,10,20],this.visibleButtonsSearch={download:{active:!0}},this.selection=[],this.disableDescargaPdfSeleccionBtn=!0,this.formStorageType="pdfDownload",this.selectedTabService.changeTab(0)}ngOnInit(){this.tableConfiguration=this.getTableConfiguration()}getTableConfiguration(){return[{columnDef:"seleccion",header:"",cell:e=>""},{columnDef:"acciones",header:"",cell:e=>""},{columnDef:"informe",header:this.translate.instant("tablas.tablaPdfDownload.informe"),cell:e=>`${e.nombreInforme}`},{columnDef:"fechaSalida",header:this.translate.instant("tablas.tablaPdfDownload.fechaSalida"),cell:e=>`${e.fechaSalida}`},{columnDef:"nombreFichero",header:this.translate.instant("tablas.tablaPdfDownload.nombreFichero"),cell:e=>`${e.nombreFichero}`}]}search(e){this.searchFilter=e,this.pdfDownloadService.getListadoPDF(this.searchFilter).subscribe(n=>{this.pdfDownloadService.getListadoPDFCount(this.searchFilter).subscribe(r=>{this.count=r,this.pdfObj=new E(!0,this.count,n)})})}updatePage(e){this.getPdfsSort(e)}getPdfsSort(e){this.pdfDownloadService.getListadoPDF(this.searchFilter,e.pageNumber.toString(),e.pageSize.toString(),e.sortDirection,e.sortField).subscribe(n=>{this.pdfObj.newSearch=!1,this.pdfObj=new E(!1,this.count,n)})}descargarUno(e){this.descargar([e.id])}descargarVarios(){const e=Object.values(this.selection).map(n=>n.id);this.descargar(e)}descargarTodos(){const e=Object.values(this.pdfObj.data).map(n=>n.id);this.descargar(e)}descargar(e){this.pdfDownloadService.descargar(e).subscribe(n=>{let r=i.c.toArrayBuffer(n.body.contenido);const p=new Blob([r],{type:"application/zip"}),y=new File([p],n.body.nombre,{type:"application/zip"});(0,T.saveAs)(y)})}addSelection(e){this.disableDescargaPdfSeleccionBtn=0===e.length,this.selection=e}}return a.\u0275fac=function(e){return new(e||a)(t.Y36(F),t.Y36(u.sK),t.Y36(x.O))},a.\u0275cmp=t.Xpm({type:a,selectors:[["app-search-list"]],decls:11,vars:6,consts:[[1,"container-title"],[1,"mb-2"],[3,"typeKey","newSearchEvent"],[4,"ngIf","ngIfElse"],["noResultados",""],["loading",""],[1,"row"],["appBold",""],[3,"searchResult","tableColumns","visibleButtons","changePageEvent","newDownloadDocumentEvent","newSelectEvent"],[1,"row","mt-4"],[1,"col-md-12"],[1,"float-end"],["type","button","mat-flat-button","","color","primary",1,"btn-third",3,"disabled","click"],[1,"fa-solid","fa-lines-leaning"],["type","button","mat-flat-button","","color","primary",1,"btn-third",3,"click"],[4,"ngIf"],[1,"container-subtitle"]],template:function(e,n){if(1&e&&(t.TgZ(0,"div",0)(1,"h2"),t._uU(2),t.ALo(3,"translate"),t.qZA()(),t._UZ(4,"mat-divider",1),t.TgZ(5,"app-pdf-download-search-form",2),t.NdJ("newSearchEvent",function(p){return n.search(p)}),t.qZA(),t.YNc(6,z,17,13,"ng-container",3),t.YNc(7,V,1,1,"ng-template",null,4,t.W1O),t.YNc(9,q,1,0,"ng-template",null,5,t.W1O)),2&e){const r=t.MAs(8);t.xp6(2),t.Oqu(t.lcZ(3,4,"pdfDownload.busqueda.titulo")),t.xp6(3),t.Q6J("typeKey",n.formStorageType),t.xp6(1),t.Q6J("ngIf",null!=n.pdfObj&&n.pdfObj.data.length>0)("ngIfElse",r)}},directives:[A.d,H,O.O5,Q.M,X.N,M.lW,U.O],pipes:[u.X$],styles:[""]}),a})();const et=[{path:"",data:{breadcrumb:"bCPdfDownload"},component:(()=>{class a{constructor(e,n){this.translate=e,this.languageChangeService=n,this.languageChangeService.language$.subscribe(r=>{this.translate.currentLang="",this.translate.use(r)})}ngOnInit(){}}return a.\u0275fac=function(e){return new(e||a)(t.Y36(u.sK),t.Y36(_.
1S))},a.\u0275cmp=t.Xpm({type:a,selectors:[["app-pdf-download"]],decls:3,vars:0,consts:[[1,"row"],[1,"col","col-lg-8","col-xl"]],template:function(e,n){1&e&&(t.TgZ(0,"div",0)(1,"div",1),t._UZ(2,"app-search-list"),t.qZA()())},directives:[tt],styles:[""]}),a})()}];let at=(()=>{class a{}return a.\u0275fac=function(e){return new(e||a)},a.\u0275mod=t.oAB({type:a}),a.\u0275inj=t.cJS({imports:[[v.Bz.forChild(et)],v.Bz]}),a})();function j(a){return new h.w(a,"./assets/i18n/pdfDownload/",".json")}let ot=(()=>{class a{constructor(){}}return a.\u0275fac=function(e){return new(e||a)},a.\u0275mod=t.oAB({type:a}),a.\u0275inj=t.cJS({providers:[],imports:[[b.m,at,u.aw.forChild({defaultLanguage:l.C.defaultLanguage,loader:{provide:u.Zw,useFactory:j,deps:[c.eN]},isolate:!1,extend:!0})]]}),a})()},4327:function(D,S){var u;void 0!==(u=function(){"use strict";function c(i,s,g){var l=new XMLHttpRequest;l.open("GET",i),l.responseType="blob",l.onload=function(){T(l.response,s,g)},l.onerror=function(){console.error("could not download file")},l.send()}function v(i){var s=new XMLHttpRequest;s.open("HEAD",i,!1);try{s.send()}catch(g){}return 200<=s.status&&299>=s.status}function t(i){try{i.dispatchEvent(new MouseEvent("click"))}catch(g){var s=document.createEvent("MouseEvents");
1s.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),i.dispatchEvent(s)}}var _="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof global&&global.global===global?global:void 0,E=_.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),T=_.saveAs||("object"!=typeof window||window!==_?function(){}:"download"in HTMLAnchorElement.prototype&&!E?function(i,s,g){var l=_.URL||_.webkitURL,f=document.createElement("a");f.download=s=s||i.name||"download",f.rel="noopener","string"==typeof i?(f.href=i,f.origin===location.origin?t(f):v(f.href)?c(i,s,g):t(f,f.target="_blank")):(f.href=l.createObjectURL(i),setTimeout(function(){l.revokeObjectURL(f.href)},4e4),setTimeout(function(){t(f)},0))}:"msSaveOrOpenBlob"in navigator?function(i,s,g){if(s=s||i.name||"download","string"!=typeof i)navigator.msSaveOrOpenBlob(function h(i,s){return void 0===s?s={autoBom:!1}:"object"!=typeof s&&(console.warn("Deprecated: Expected third argument to be a object"),s={autoBom:!s}),s.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(i.type)?new Blob(["\ufeff",i],{type:i.type}):i}(i,g),s);else if(v(i))c(i,s,g);else{var l=document.createElement("a");l.href=i,l.target="_blank",setTimeout(function(){t(l)})}}:function(i,s,g,l){if((l=l||open("","_blank"))&&(l.document.title=l.document.body.innerText="downloading..."),"string"==typeof i)return c(i,s,g);var f="application/octet-stream"===i.type,L=/constructor/i.test(_.HTMLElement)||_.safari,F=/CriOS\/[\d]+/.test(navigator.userAgent);if((F||f&&L||E)&&"undefined"!=typeof FileReader){var x=new FileReader;x.onloadend=function(){var m=x.result;m=F?m:m.replace(/^data:[^;]*;/,"data:attachment/file;"),l?l.location.href=m:location=m,l=null},x.readAsDataURL(i)}else{var A=_.URL||_.webkitURL,C=A.createObjectURL(i);l?l.location=C:location.href=C,l=null,setTimeout(function(){A.revokeObjectURL(C)},4e4)}});_.saveAs=T.saveAs=T,D.exports=T}.apply(S,[]))&&(D.exports=u)}}]);
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.