1"use strict";(self.webpackChunksite_bep_js_webapp=self.webpackChunksite_bep_js_webapp||[]).push([[4944],{54944:(ie,b,r)=>{r.r(b),r.d(b,{ModalSelectPurchasesComponent:()=>se});var C=r(10467),x=r(96354),D=r(74450),f=r(19747),I=r(57358),c=r(63400),T=r(2295),M=r(30675),p=r(51680),O=r(45312),y=r(95330),A=r(35034);let E=(()=>{var a;class u{}return(a=u).LABEL_MODAL_SELECT_PURCHASES={selectPurchases:"Selecciona las compras que quieres diferir",maximumAmount:"Monto m\xe1ximo",total:"Total",minimumAmountWarning:"El monto no puede ser menor a"},a.ERROR_STRING_ALERT_NO_AVAILABLE="Lo sentimos, en este momento no cumples con los requisitos para obtener un cr\xe9dito difiere tus compras con nosotros. Esperamos poder atender tu solicitud m\xe1s adelante",u})();var e=r(73664),l=r(2615),F=r(26250),L=r(61789),N=r(58431),j=r(84412),$=r(46089);class B{constructor(u){this.data=u}get endpoint(){return $.Z.DeferCredit}}var G=r(75703),V=r(57909),U=r(74198),Y=r(57291),w=r(15491);let k=(()=>{var a;class u{constructor(t,n,o,s){this.accountInfoService=t,this.accountCardService=n,this.storageService=o,this.baseService=s,this._dataDefault=[],this._dataDeferPurchases=new j.t(this._dataDefault)}get deferPurchasesArray$(){return this._dataDeferPurchases.asObservable()}get deferPurchasesArray(){return this._dataDeferPurchases.getValue()}set deferPurchasesArray(t){this._dataDeferPurchases.next(t)}clearDeferPurchases(){this._dataDeferPurchases.next(this._dataDefault)}addShops(t){const o=[...this.deferPurchasesArray,...t];o.sort((d,h)=>{const m=new Date(d.fechaAplicacion.split("".concat(f.do.Slash)).reverse().join("".concat(f.do.MiddleDash)));return new Date(h.fechaAplicacion.split("".concat(f.do.Slash)).reverse().join("".concat(f.do.MiddleDash))).getTime()-m.getTime()}),o.forEach((d,h)=>{var m;d.referenceIndex=null!==(m=null==d?void 0:d.referenceIndex)&&void 0!==m?m:"".concat(d.numeroReferencia).concat(h.toString())}),this._dataDeferPurchases.next(o)}getPurchases(t){var n=this;return(0,C.A)(function*(){const o=n.accountCardService.selectedAccountCard.cardNumber===p.D.EMPTY?n.accountInfoService.account.numeroCuenta:n.accountCardService.selectedAccountCard.accountNumber,s=n.accountCardService.selectedAccountCard.productId===c.FQ.Zero?n.accountInfoService.account.idCuentaProducto:n.accountCardService.selectedAccountCard.productId,d=t===c.FQ.One?O.c.contract.deferPurchases.firstPagination:O.c.contract.deferPurchases.paginationElements,h=new B({idSesion:n.storageService.getSession(),idCuentaProducto:s,numeroCuenta:o,numPagina:t,numRegistros:d}),m=yield n.baseService.genericPost(h,{isSOA:!0});if(!m&&!m.datos)throw new G.H(p.D.SERVICES.UnexpectedMsg,f.YM.UNEXPECTED_CODE);return m.datos=m.datos.map(S=>({...S,selectedItem:!1,availability:!0})),m})()}}return(a=u).\u0275fac=function(t){return new(t||a)(l.KVO(V.h),l.KVO(U.h),l.KVO(Y.n),l.KVO(w.a))},a.\u0275prov=l.jDH({token:a,factory:a.\u0275fac,providedIn:"root"}),u})();var Q=r(99332),X=r(67749),z=r(19982),Z=r(55576),P=r(72200),H=r(84576),W=r(98590),J=r(79524),K=r(43469),q=r(17553);const _=a=>({"red-color":a}),ee=a=>({"disabled-btn":a}),R=a=>({"disabled-color":a}),te=a=>({"disabled-color-check":a});function ne(a,u){if(1&a&&(e.j41(0,"div",20)(1,"div",21),e.EFF(2),e.nI1(3,"currency"),e.k0s()()),2&a){const i=e.XpG(2);e.R7$(2),e.Lme(" ",i.templateModalSelect.minimumAmountWarning," ",e.bMT(3,2,i.minimumPurchaseAmount)," ")}}function ae(a,u){if(1&a&&(e.j41(0,"span",31),e.EFF(1),e.nI1(2,"customDate"),e.k0s()),2&a){const i=e.XpG().$implicit;e.R7$(),e.JRh(e.bMT(2,1,i.fechaAplicacion))}}function re(a,u){if(1&a){const t=e.RV6();e.j41(0,"div")(1,"div",22),e.DNE(2,ae,3,3,"span",23),e.k0s(),e.j41(3,"div",24),e.bIt("keydown.enter",function(o){return l.eBV(t),l.Njj(o.preventDefault())}),e.j41(4,"div",25)(5,"span",26),e.EFF(6),e.k0s(),e.j41(7,"span",27),e.EFF(8),e.nI1(9,"currency"),e.k0s()(),e.j41(10,"div")(11,"div",28),e.nrm(12,"label",29),e.j41(13,"input",30),e.bIt("keydown.enter",function(o){return l.eBV(t),l.Njj(o.preventDefault())})("click",function(){const o=l.eBV(t).$implicit,s=e.XpG(2);return l.Njj(s.shopOptionsOnClick(o))}),e.k0s()()()()()}if(2&a){var i;const t=u.$implicit,n=u.index,o=e.XpG(2);e.R7$(2),e.Y8G("ngIf",o.validateDate(t.fechaAplicacion,n)),e.R7$(3),e.Y8G("ngClass",e.eq3(14,R,
1!t.availability)),e.R7$(),e.SpI(" ",null!==(i=t.descripcion)&&void 0!==i?i:t.numeroReferencia),e.R7$(),e.Y8G("ngClass",e.eq3(16,R,!t.availability)),e.R7$(),e.SpI(" ",e.bMT(9,12,t.monto)),e.R7$(4),e.Y8G("for",e.mNQ("checkBoxShop"+n)),e.R7$(),e.Y8G("id",e.mNQ("checkBoxShop"+n))("ngClass",e.eq3(18,te,!t.availability))("disabled",!t.availability)("checked",t.selectedItem)}}function oe(a,u){if(1&a){const i=e.RV6();e.qex(0),e.j41(1,"div",1)(2,"div",2)(3,"div",3),e.EFF(4),e.k0s(),e.j41(5,"div",4),e.EFF(6),e.nI1(7,"currency"),e.k0s(),e.j41(8,"div",5)(9,"app-search-component",6),e.bIt("dataFromSearch",function(n){l.eBV(i);const o=e.XpG();return l.Njj(o.receiveDataFromSearch(n))}),e.k0s()(),e.j41(10,"div",7)(11,"div",8),e.EFF(12),e.k0s(),e.j41(13,"div"),e.EFF(14),e.nI1(15,"currency"),e.k0s()(),e.DNE(16,ne,4,4,"div",9),e.j41(17,"div",10)(18,"div",11),e.DNE(19,re,14,20,"div",12),e.nI1(20,"async"),e.j41(21,"div",13),e.nrm(22,"app-pagination"),e.k0s()()(),e.j41(23,"footer",14)(24,"div",15)(25,"button",16),e.bIt("keypress",function(n){return l.eBV(i),l.Njj(n.preventDefault())})("click",function(){l.eBV(i);const n=e.XpG();return l.Njj(n.openCardAccountModal())}),e.EFF(26),e.nrm(27,"img",17),e.nI1(28,"cdnImage"),e.k0s()(),e.j41(29,"div",18)(30,"button",19),e.bIt("keypress",function(n){return l.eBV(i),l.Njj(n.preventDefault())})("click",function(){l.eBV(i);const n=e.XpG();return l.Njj(n.closeModal())}),e.EFF(31),e.k0s()()()()(),e.bVm()}if(2&a){const i=u.ngIf,t=e.XpG();e.R7$(4),e.SpI(" ",t.templateModalSelect.selectPurchases," "),e.R7$(),e.Y8G("ngClass",e.eq3(25,_,t.isMaximumErrorAmount)),e.R7$(),e.Lme(" ",t.templateModalSelect.maximumAmount," ",e.bMT(7,17,t.amountMax)," "),e.R7$(3),e.Y8G("idSearch",t.pageOneSearch),e.R7$(),e.Y8G("ngClass",e.eq3(27,_,t.isMaximumErrorAmount)),e.R7$(2),e.JRh(t.templateModalSelect.total),e.R7$(2),e.JRh(e.bMT(15,19,t.amountTotal)),e.R7$(2),e.Y8G("ngIf",t.isErrorMinAmount),e.R7$(2),e.AVh("size-space-shops",i.breakpoints.mobile),e.R7$(),e.Y8G("ngForOf",e.bMT(20,21,t.dataMovements$)),e.R7$(6),e.Y8G("ngClass",e.eq3(29,ee,!t.validDataAccountSelected||t.isMaximumErrorAmount||t.isErrorMinAmount))("disabled",!t.validDataAccountSelected||t.isMaximumErrorAmount||t.isErrorMinAmount),e.R7$(),e.SpI(" ",t.lblContinue," "),e.R7$(),e.Y8G("src",e.bMT(28,23,t.chevronImage),e.B4B),e.R7$(4),e.SpI(" ",t.lblCancelButton," ")}}let se=(()=>{var a;class u{constructor(t,n,o,s,d,h,m,S,v){this.scrollPaginationService=t,this.creditStateService=n,this.responsiveService=o,this.paginationService=s,this.deferPurchasesService=d,this.alertService=h,this.loaderService=m,this.modalService=S,this.router=v,this.movements$=this.getSetupMovements,this.isMobile=!1,this.screenWidth=c.FQ.Zero,this.startDate=p.D.EMPTY,this.closeCircleBlue=M.E.CLOSE_CIRCLE_BLUE,this.currentSearchFilter=p.D.EMPTY,this.pageSize=c.FQ.Five,this.chevronImage=M.E.SHAPE_CONTINUE,this.validDataAccountSelected=!1,this.isMaximumErrorAmount=!1,this.amountMax=c.FQ.Zero,this.purchaseAmountMin=O.c.contract.deferPurchases.purchaseAmountMin,this.minimumPurchaseAmount=c.FQ.Zero,this.isErrorMinAmount=!1,this.labelsButtons=p.D.BUTTONS,this.templateModalSelect=E.LABEL_MODAL_SELECT_PURCHASES,this.lblContinue=f.YM.POPUP_CONTINUE_BUTTON,this.lblCancelButton=f.YM.CANCEL_BUTTON,this.pageOneSearch=y.V.PAGE_ONE_SEARCH,this.dataAccountSelected=[],this.amountTotal=c.FQ.Zero,this.totalPurchases=c.FQ.Zero,this.vm$=this.responsiveService.observe.pipe((0,x.T)(g=>(this.modalInstance.update({centered:!0,size:f.YM.MODAL_OPTIONS.SizeMd,modalDialogClass:I.VT.MODAL_OPTIONS.HiddenModal}),this.isMobile=g.mobile,this.loaderService.showLoader(),this.paginationService.clear(),this.getDataDeferPurchases(),{breakpoints:g}))),this.dataMovements=[],this.dataMovements$=this.paginationService.pagination.pipe((0,x.T)(g=>g.data))}ngOnInit(){var t=this;return(0,C.A)(function*(){try{t.loaderService.showLoader(),t.deferPurchasesService.clearDeferPurchases(),t.screenWidth=window.innerWidth}catch(n){t.modalService.close();const o=A.A.getErrorMsg(n);t.alertService.showPopupAlert({header:p.D.MODAL_EXCEPTIONS_POINTS.Service.Header,imgHead:M.E.CLOSE_ICON_RED,message:A.A.SERVICE_ERROR_MSG(o.msg,o.code),btnExit:!1},{onSuccess:()=>t.modalInstance.dismiss()})}})()}getDataDeferPurchases(){var t=this;return(0,C.A)(function*(n=c.FQ.One){try{const o=yield t.deferPurchasesService.getPurchases(n);t.dataMovements=[],t.totalPurchases===c.RU.Empty&&(t.totalPurchases=o.totalPagos),t.amountMax===c.FQ.Zero&&(t.amountMax=o.montoMaximo);const s=o.datos;t.minimumPurchaseAmount=o.montoMinimo,t.deferPurchasesService.addShops(s),t.dataMovements=t.deferPurchasesService.deferPurchasesArray.filter(h=>Math.abs(h.monto)>=t.purchaseAmountMin&&Math.abs(h.monto)<=t.amountMax),t.showModalSelectDefer(n),t.deferPurchasesService.deferPurchasesArray.length<c.RU.Empty&&(n++,t.getDataDeferPurchases(n)),t.paginationService.setInitialData(t.dataMovements,t.isMobile?t.deferPurchasesService.deferPurchasesArray.length:c.FQ.Five)}catch(o){if(t.deferPurchasesService.deferPurchasesArray.length>c.RU.Empty)return;const s=A.A.getErrorMsg(o);t.modalInstance.close();const d=s.msg.includes(E.ERROR_STRING_ALERT_NO_AVAILABLE)?"".concat(E.ERROR_STRING_ALERT_NO_AVAILABLE).concat(f.do.Dot):A.A.SERVICE_ERROR_MSG(s.msg,s.code);t.showAlertMessage(s.msg!==E.ERROR_STRING_ALERT_NO_AVAILABLE,d)}}).apply(this,arguments)}get getCurrentPaginationService(){return this.isMobile?this.scrollPaginationService:this.paginationService}get getSetupMovements(){return this.getCurrentPaginationService.pagination.pipe((0,x.T)(t=>t))}receiveDataFromSearch(t){var n=this;return(0,C.A)(function*(){n.currentSearchFilter=t,n.paginationService.searchAndFilter(n.search,{searchFn:n.search,currentSearchFilter:n.currentSearchFilter})})()}search(t,{currentSearchFilter:n}){return t.filter(o=>{var s;const d=(null!==(s=o.descripcion)&&void 0!==s?s:o.numeroReferencia)||p.D.EMPTY,h="".concat(d).concat(o.monto.toString()),m=n||p.D.EMPTY;return h.trim().toLowerCase().includes(m.trim().toLowerCase())})}changeFormatCurrency(t){return this.creditStateService.changeFormatCurrency(t,this.screenWidth)}openCardAccountModal(){this.totalPurchases=this.deferPurchasesService.deferPurchasesArray.length,this.modalService.close(),this.router.navigate([T.g.FormDeferPurchases],{state:{dataSelectedBuys:this.dataAccountSelected}})}validateDate(t,n){return!(n&&this.startDate===t||(this.startDate=t,0))}closeModal(){this.totalPurchases=this.deferPurchasesService.deferPurchasesArray.length,this.modalService.close()}shopOptionsOnClick(t){var n;
1this.dataMovements.forEach(v=>v.availability=!1);const o=this.dataMovements.find(v=>v.referenceIndex===t.referenceIndex),s=this.dataAccountSelected.findIndex(v=>v.referenceIndex===t.referenceIndex);s!==y.V.NEGATIVE_ONE?(this.dataAccountSelected.splice(s,c.FQ.One),o.selectedItem=!1):(this.dataAccountSelected.push(t),o.selectedItem=!0);const d=this.dataAccountSelected.reduce((v,g)=>v+g.monto,c.FQ.Zero);this.amountTotal=d;const h=this.amountMax-this.amountTotal;this.dataMovements.forEach(v=>{v.availability=!!v.selectedItem||v.monto<=h}),this.deferPurchasesService.deferPurchasesArray=this.dataMovements;const m=this.dataAccountSelected,S=null!==(n=null==m?void 0:m.reduce((v,g)=>v+(g.monto||c.FQ.Zero),c.FQ.Zero))&&void 0!==n?n:c.FQ.Zero;this.validDataAccountSelected=this.dataAccountSelected.length>c.FQ.Zero&&S>=this.purchaseAmountMin,this.isErrorMinAmount=this.dataAccountSelected.length>c.RU.Empty&&this.minimumPurchaseAmount>this.amountTotal,this.isMaximumErrorAmount=this.amountTotal>this.amountMax}showAlertMessage(t=!1,n=p.D.EMPTY){this.alertService.showPopupAlert({header:p.D.LOAD_FILE.HeaderModal,imgHead:t?M.E.CLOSE_ICON_RED:M.E.CIRCLE_INFO_LIGHT_BLUE,message:n,btnExit:!1,imgClass:y.V.CLASS_IMG_ICON_INFO_MODIFY},{onSuccess:()=>this.modalService.close()})}showModalSelectDefer(t){t===c.FQ.One&&(this.modalInstance.update({centered:!0,size:f.YM.MODAL_OPTIONS.SizeMd,modalDialogClass:I.VT.MODAL_OPTIONS.ModalSelectPurchases}),this.loaderService.hideLoader())}}return(a=u).\u0275fac=function(t){return new(t||a)(e.rXU(F.$),e.rXU(L.U),e.rXU(N.c),e.rXU(D.m),e.rXU(k),e.rXU(Q.u),e.rXU(X.Z),e.rXU(z.B),e.rXU(Z.Ix))},a.\u0275cmp=e.VBU({type:a,selectors:[["app-modal-select-purchases"]],standalone:!1,features:[e.Jv_([D.m])],decls:2,vars:3,consts:[[4,"ngIf"],[1,"d-flex","flex-column","text-center","acc-cancel","margin-content"],["tabindex","-1",1,"d-flex","flex-column","acc-cancel","overflow"],[1,"title","header-m","mb-10-px","color-title-header","text-align-left"],[1,"subtitle","mb-16-px",3,"ngClass"],[1,"p-search"],[3,"dataFromSearch","idSearch"],[1,"movement","header-s","text-amount-count","mb-1",3,"ngClass"],[1,"movement-detail","amount-title"],["class","movement text-amount-count mb-3",4,"ngIf"],[1,"d-flex","flex-row","align-items-center"],[1,"is-expand-movements","w-100"],[4,"ngFor","ngForOf"],[1,"w-100"],[1,"mt-4"],[1,"d-flex","justify-content-center","flex-column","align-items-center"],[1,"colored-auto-btn","modals-btn-payroll","button-m","mb-primary-footer","btn-defer-purchases",3,"keypress","click","ngClass","disabled"],["width","auto","height","auto","alt",">",1,"size-img-btn",3,"src"],[1,"btn-container","d-flex","justify-content-center","flex-column","align-items-center","gap-2"],[1,"outline-auto-btn","modals-btn-payroll","btn-defer-purchases","button-m",3,"keypress","click"],[1,"movement","text-amount-count","mb-3"],[1,"movement-detail","amount-title","alert-min-amount"],[1,"date","pt-1","pb-2","detail-m-date"],["type","date","class","detail-m color-text-movements-title",4,"ngIf"],[1,"movement","py-2","cursor-pointer",3,"keydown.enter"],[1,"movement-detail"],[1,"detail-m-text","word-wrap","wrap-text","detail-transaction",3,"ngClass"],[1,"header-xs","text-overflow-ellipsis","h-100","detail-m-date",3,"ngClass"],[1,"d-flex","align-items-center","input-label"],["hidden","",3,"for"],["role","button","name","checlBoxFilter","type","checkbox",1,"form-check-input","m-0","border-color-check",3,"keydown.enter","click","ngClass","id","disabled","checked"],["type","date",1,"detail-m","color-text-movements-title"]],template:function(t,n){1&t&&(e.DNE(0,oe,32,31,"ng-container",0),e.nI1(1,"async")),2&t&&e.Y8G("ngIf",e.bMT(1,1,n.vm$))},dependencies:[P.YU,P.Sq,P.bT,H.e,W.L,J.b,P.Jj,P.oe,K.D,q.e],styles:[".movement-detail[_ngcontent-%COMP%]{display:grid;grid-template-rows:1fr auto;max-width:100%}.amount-title[_ngcontent-%COMP%], .detail-m-date[_ngcontent-%COMP%]{text-align:left}.movement[_ngcontent-%COMP%]{display:grid;grid-template-columns:32px 1fr auto;gap:0 1em}.detail-transaction[_ngcontent-%COMP%]{text-align:left}.form-check-input[_ngcontent-%COMP%]{border-radius:0!important;border-width:4px;width:22px;height:22px}.form-check-input[_ngcontent-%COMP%]:checked{background-color:var(--primary-1000);border-width:1px}@media screen and (max-width: 767.99px){.movement[_ngcontent-%COMP%]{grid-template-columns:1fr auto;gap:0 1em;display:grid;justify-content:space-between}}@media screen and (min-width: 768px){.movement[_ngcontent-%COMP%]{grid-template-columns:1fr auto;gap:0 1em;display:grid;justify-content:space-between}}.detail-m-text[_ngcontent-%COMP%]{font-family:var(--font-family-secondary);font-size:var(--font-size-03);color:var(--secondary-800);line-height:var(--spacing-07);font-weight:var(--font-weight-semibold)}.btn-close-m[_ngcontent-%COMP%]{width:24px;align-self:end}.subtitle[_ngcontent-%COMP%]{display:flex;color:var(--secondary-700);flex:none;order:0;flex-grow:0;font-family:var(--font-family-secondary)}.text-amount-count[_ngcontent-%COMP%]{color:var(--info-800)}.color-title-header[_ngcontent-%COMP%]{color:var(--secondary-800)}.margin-content[_ngcontent-%COMP%]{margin:24px}.mb-primary-footer[_ngcontent-%COMP%]{margin-bottom:8px}.border-color-check[_ngcontent-%COMP%]{border-color:var(--secondary-1000)}select[_ngcontent-%COMP%]:focus, .border-input[_ngcontent-%COMP%], input[_ngcontent-%COMP%]:focus{box-shadow:none!important;border-color:var(--secondary-1000)!important}.text-align-left[_ngcontent-%COMP%]{text-align:left}.mb-10-px[_ngcontent-%COMP%], .mb-16-px[_ngcontent-%COMP%]{margin-bottom:10px}.btn-defer-purchases[_ngcontent-%COMP%]{font-size:16px}.red-color[_ngcontent-%COMP%]{color:red}.disabled-color[_ngcontent-%COMP%]{color:var(--bs-gray-600)}.disabled-color-check[_ngcontent-%COMP%]{border-color:var(--bs-gray-600)}.size-space-shops[_ngcontent-%COMP%]{max-height:40vh;overflow-y:auto;scrollbar-width:none;-ms-overflow-style:none}.size-img-btn[_ngcontent-%COMP%]{width:16px;height:16px}
1.alert-min-amount[_ngcontent-%COMP%]{font-family:var(--font-family-secondary);color:var(--negative-700);font-size:var(--font-size-03)} app-modal-alerts img.icon-info-payroll{width:2.5rem}"],changeDetection:0}),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.