File: /var/www/web.enelar.com.co/dist/browser/chunk-73VCJWRN.js
import{b as ie}from"./chunk-FN4BVT7F.js";import{a as q,b as G}from"./chunk-M2XGXZBH.js";import{d as J,e as K,f as Q,j as X}from"./chunk-YZB5RIY6.js";import{a as u}from"./chunk-J5MNQ3LA.js";import{n as Z,o as x,p as ee,t as te}from"./chunk-3PWCL6RG.js";import{A as U,n as H}from"./chunk-VJI6KQJL.js";import{A as y,Ab as V,C as S,D as F,Fa as m,Ga as h,I as W,J as $,Ja as M,Ka as j,La as I,Oa as P,Y as p,Ya as g,Za as T,_a as _,h as f,ha as A,ja as c,ma as B,na as Y,pa as a,qa as r,ra as l,tb as N,ub as O,va as z,vb as w,wa as k,x as b,xa as L,y as D,yb as R}from"./chunk-MDSVL5BJ.js";var d=class i{static fromApiToDomain(e){return{data:Array.isArray(e.data)?e.data.map(s=>i.dataMapper(s)):i.dataMapper(e.data),message:e.message,summary:e.summary,totalRecords:e.totalRecords,rows:e.rows}}static dataMapper(e){return{_id:e._id,categoria:e.categoria,nombre:e.nombre,descripcion:e.descripcion,fechaApertura:e.fechaApertura,estado:e.estado,objeto:e.objeto,cuantia:e.cuantia,plazo:e.plazo,porcentaje:e.porcentaje,beneficiarios:e.beneficiarios,fuenteFinanciacion:e.fuenteFinanciacion,archivos:e.archivos,fechas:e.fechas,createdAt:e.createdAt}}static fromDomainToApi(e){return{_id:e._id,categoria:e.categoria,nombre:e.nombre,descripcion:e.descripcion,fechaApertura:e.fechaApertura,estado:e.estado,objeto:e.objeto,cuantia:e.cuantia,plazo:e.plazo,porcentaje:e.porcentaje,beneficiarios:e.beneficiarios,fuenteFinanciacion:e.fuenteFinanciacion,createdAt:e.createdAt}}};var ne=(()=>{let e=class e{constructor(n){this.http=n}addContrato(n){let o=d.fromDomainToApi(n);return this.http.post(`${u.apiDevWeb}contratacion`,o).pipe(f(d.fromApiToDomain))}getContratos(n,o,t=!1){let E=new R().set("page",n.toString()).set("pageSize",o.toString());return this.http.get(`${u.apiDevWeb}${t?"public/":""}contratacion`,{params:E}).pipe(f(d.fromApiToDomain))}getContrato(n){return this.http.get(`${u.apiDevWeb}contratacion/${n}`).pipe(f(d.fromApiToDomain))}updateContrato(n,o){let t=d.fromDomainToApi(n);return this.http.put(`${u.apiDevWeb}contratacion/${o}`,t).pipe(f(d.fromApiToDomain))}deleteOneContrato(n){return this.http.delete(`${u.apiDevWeb}contratacion/${n}`).pipe(f(d.fromApiToDomain))}deleteMultiContratos(n){return this.http.post(`${u.apiDevWeb}contratacion/eliminar-varios`,n).pipe(f(d.fromApiToDomain))}detalleContrato(n,o=!1){return this.http.get(`${u.apiDevWeb}${o?"public/":""}contratacion/detalleContrato/${n}`).pipe(f(d.fromApiToDomain))}};e.\u0275fac=function(o){return new(o||e)(y(V))},e.\u0275prov=b({token:e,factory:e.\u0275fac,providedIn:"root"});let i=e;return i})();var ye=(()=>{let e=class e{constructor(n){this.contratacionService=n}addContrato(n){return this.contratacionService.addContrato(n)}getContratos(n,o,t){return this.contratacionService.getContratos(n,o,t)}getContrato(n){return this.contratacionService.getContrato(n)}updateContrato(n,o){return this.contratacionService.updateContrato(n,o)}deleteOneContrato(n){return this.contratacionService.deleteOneContrato(n)}deleteMultiContratos(n){return this.contratacionService.deleteMultiContratos(n)}};e.\u0275fac=function(o){return new(o||e)(y(ne))},e.\u0275prov=b({token:e,factory:e.\u0275fac,providedIn:"root"});let i=e;return i})();var oe=(()=>{let e=class e{};e.\u0275fac=function(o){return new(o||e)},e.\u0275cmp=S({type:e,selectors:[["app-descripcion-element"]],inputs:{descripcion:"descripcion",data:"data"},decls:5,vars:2,template:function(o,t){o&1&&(a(0,"span")(1,"b"),m(2),r(),a(3,"p"),m(4),r()()),o&2&&(p(2),h(t.descripcion),p(2),h(t.data))},encapsulation:2});let i=e;return i})();var re=(()=>{let e=class e{};e.\u0275fac=function(o){return new(o||e)},e.\u0275mod=F({type:e}),e.\u0275inj=D({imports:[w]});let i=e;return i})();var ae=()=>({"min-width":"45rem"});function ce(i,e){i&1&&(a(0,"div",18)(1,"h5",19),m(2,"Archivos"),r()())}function me(i,e){i&1&&(a(0,"tr")(1,"th",20),m(2,"Fecha "),l(3,"p-sortIcon",21),r(),a(4,"th",22),m(5,"Descripci\xF3n "),l(6,"p-sortIcon",23),r(),l(7,"th"),r())}function se(i,e){if(i&1){let s=z();a(0,"tr")(1,"td"),m(2),g(3,"date"),r(),a(4,"td"),m(5),r(),a(6,"td")(7,"i",24),g(8,"fileColorFormat"),g(9,"fileFormat"),g(10,"fileDetalleFormat"),k("click",function(){let o=W(s).$implicit,t=L();return $(t.verArchivo(o.archivo.path))}),r()()()}if(i&2){let s=e.$implicit;p(2),h(_(3,7,s.fecha,"dd/MM/YYYY")),p(3),h(s.descripcion),p(2),B(T(8,10,s.archivo.filename)),Y(T(9,12,s.archivo.filename)),c("pTooltip",T(10,14,s.archivo.filename))}}function de(i,e){i&1&&(a(0,"div",18)(1,"h5",19),m(2,"Fechas"),r()())}function ue(i,e){i&1&&(a(0,"tr")(1,"th",20),m(2,"Fecha "),l(3,"p-sortIcon",21),r(),a(4,"th",22),m(5,"Descripci\xF3n "),l(6,"p-sortIcon",23),r()())}function fe(i,e){if(i&1&&(a(0,"tr")(1,"td"),m(2),g(3,"date"),r(),a(4,"td"),m(5),r()()),i&2){let s=e.$implicit;p(2),h(_(3,2,s.fecha,"dd/MM/YYYY")),p(3),h(s.descripcion)}}var Be=(()=>{let e=class e{constructor(){this.isLoadingTable=!1,this.first=0,this.rows=5}verArchivo(n){window.open(`${u.apiDevWebStorage}${n}`,"_blank").focus()}};e.\u0275fac=function(o){return new(o||e)},e.\u0275cmp=S({type:e,selectors:[["app-dialog-detalle-contrato"]],inputs:{contrato:"contrato"},decls:39,vars:28,consts:[[1,"grid","p-fluid"],[1,"field","col-12","md:col-12"],["descripcion","Contrato",3,"data"],[1,"field","col-4","md:col-4"],["descripcion","Categoria",3,"data"],["descripcion","Estado",3,"data"],["descripcion","Fecha apertura",3,"data"],["descripcion","Fecha de cierre",3,"data"],["descripcion","Cuantia",3,"data"],["descripcion","Beneficiario",3,"data"],["descripcion","Fuente de financiaci\xF3n",3,"data"],["descripcion","Porcentaje",3,"data"],["descripcion","Objeto",3,"data"],["descripcion","Descripci\xF3n",3,"data"],[3,"firstChange","value","rows","first","showCurrentPageReport","tableStyle","loading"],["pTemplate","caption"],["pTemplate","header"],["pTemplate","body"],[1,"flex","align-items-center","justify-content-between"],[1,"m-0"],["pSortableColumn","fehca"],["field","fecha"],["pSortableColumn","descripcion"],["field","descripcion"],[1,"icon-hover","mt-2",2,"font-size","2rem",3,"click","pTooltip"]],template:function(o,t){o&1&&(a(0,"div")(1,"div",0)(2,"div",1),l(3,"app-descripcion-element",2),r()(),a(4,"div",0)(5,"div",3),l(6,"app-descripcion-element",4),r(),a(7,"div",3),l(8,"app-descripcion-element",5),r(),a(9,"div",3),l(10,"app-descripcion-element",6),r()(),a(11,"div",0)(12,"div",3),l(13,"app-descripcion-element",7),r(),a(14,"div",3),l(15,"app-descripcion-element",8),g(16,"currency"),r(),a(17,"div",3),l(18,"app-descripcion-element",9),r()(),a(19,"div",0)(20,"div",3),l(21,"app-descripcion-element",10),r(),a(22,"div",3),l(23,"app-descripcion-element",11),r()(),a(24,"div",0)(25,"div",1),l(26,"app-descripcion-element",12),r()(),a(27,"div",0)(28,"div",1),l(29,"app-descripcion-element",13),r()(),a(30,"p-table",14),I("firstChange",function(v){return j(t.first,v)||(t.first=v),v}),A(31,ce,3,0,"ng-template",15)(32,me,8,0,"ng-template",16)(33,se,11,16,"ng-template",17),r(),l(34,"p-divider"),a(35,"p-table",14),I("firstChange",function(v){return j(t.first,v)||(t.first=v),v}),A(36,de,3,0,"ng-template",15)(37,ue,7,0,"ng-template",16)(38,fe,6,5,"ng-template",17),r()()),o&2&&(p(3),c("data",t.contrato==null?null:t.contrato.nombre),p(3),c("data",t.contrato==null||t.contrato.categoria==null?null:t.contrato.categoria.nombre),p(2),c("data",t.contrato==null||t.contrato.estado==null?null:t.contrato.estado.nombre),p(2),c("data",t.contrato==null?null:t.contrato.fechaApertura),p(3),c("data",t.contrato==null?null:t.contrato.plazo),p(2),c("data",_(16,23,t.contrato==null?null:t.contrato.cuantia,"USD")),p(3),c("data",t.contrato==null?null:t.contrato.beneficiarios),p(3),c("data",t.contrato==null?null:t.contrato.fuenteFinanciacion),p(2),c("data",(t.contrato==null?null:t.contrato.porcentaje)+" %"),p(3),c("data",t.contrato==null?null:t.contrato.objeto),p(3),c("data",t.contrato==null?null:t.contrato.descripcion),p(),c("value",t.contrato==null?null:t.contrato.archivos)("rows",t.rows),M("first",t.first),c("showCurrentPageReport",!0)("tableStyle",P(26,ae))("loading",t.isLoadingTable),p(5),c("value",t.contrato==null?null:t.contrato.fechas)("rows",t.rows),M("first",t.first),c("showCurrentPageReport",!0)("tableStyle",P(27,ae))("loading",t.isLoadingTable))},dependencies:[oe,Z,H,x,ee,q,O,N,J,K,Q],encapsulation:2});let i=e;return i})();var qe=(()=>{let e=class e{};e.\u0275fac=function(o){return new(o||e)},e.\u0275mod=F({type:e}),e.\u0275inj=D({imports:[w,ie,re,te,G,U,X]});let i=e;return i})();export{ne as a,ye as b,oe as c,Be as d,re as e,qe as f};