File: /var/www/vhost/disk-apps/pwa.sports-crowd.com/www/9561.81292fb3ae17169a.js
"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[9561,5553,7934,315],{55553:(f,u,n)=>{n.d(u,{h:()=>E});var e=n(77897),t=n(56610),p=n(41683),c=n(13721),m=n(22882),s=n(37222),_=n(36594),g=n(2978);let E=(()=>{class l{static#e=this.\u0275fac=function(i){return new(i||l)};static#t=this.\u0275mod=g.$C({type:l});static#n=this.\u0275inj=g.G2t({imports:[t.MD,e.bv,c.h,p.Y,m.h.forChild(),s.YN,_.rJ]})}return l})()},56261:(f,u,n)=>{n.d(u,{I:()=>E});var e=n(2978),t=n(22882),p=n(56610),c=n(77897),m=n(37222);function s(l,h){if(1&l&&(e.j41(0,"ion-select-option",7),e.EFF(1),e.k0s()),2&l){const a=h.$implicit;e.Y8G("value",a),e.R7$(1),e.JRh(a)}}function _(l,h){if(1&l&&(e.j41(0,"ion-select-option",7),e.EFF(1),e.k0s()),2&l){const a=h.$implicit,i=e.XpG();e.Y8G("value",i.allMonths.indexOf(a)),e.R7$(1),e.JRh(a)}}function g(l,h){if(1&l&&(e.j41(0,"ion-select-option",7),e.EFF(1),e.k0s()),2&l){const a=h.$implicit;e.Y8G("value",a),e.R7$(1),e.JRh(a)}}let E=(()=>{class l{constructor(a){this.translateService=a,this.defaultDate=[],this.date=new e.bkB,this.days=[],this.allMonths=[],this.months=[],this.years=[],this.currentYear=(new Date).getFullYear(),this.yearRange=100}ngOnInit(){this.setDays(),this.setMonths(),this.setYears()}ngOnChanges(a){if(a.defaultDate&&a.defaultDate.currentValue){let i=this.defaultDate.split(this.defaultDate.includes("-")?"-":"/");this.year=Number(i[0]),this.month=Number(i[1])-1,this.day=Number(i[2])}a.minDate&&a.minDate.currentValue&&(this.yearRange=this.currentYear-this.minDate.getFullYear()),this.setDays(),this.setMonths(),this.setYears()}setDays(a=1){this.days=this.buildNumberArray(a,31)}setMonths(a=0){this.allMonths=Array.from({length:12},(i,o)=>new Date(0,o).toLocaleString(window.navigator.language,{month:"long"})),this.months=this.allMonths.slice(a,12)}setYears(){const a=this.minDate?this.minDate.getFullYear():this.currentYear-this.yearRange,i=this.maxDate?this.maxDate.getFullYear():this.currentYear;this.years=this.buildNumberArray(a,i).reverse()}buildNumberArray(a,i){return[...Array(i-a+1).keys()].map(o=>o+a)}changeDate(){this.day&&null!=this.month&&this.year&&this.date.emit(new Date(this.year+"/"+(this.month+1)+"/"+this.day).toJSON().slice(0,10).replace(/-/g,"/"))}changeYear(){this.minDate&&this.minDate.getFullYear()==this.year&&this.setMonths(this.minDate.getMonth()),this.changeDate()}changeMonth(){this.minDate&&this.minDate.getMonth()==this.month&&this.setDays(this.minDate.getDate()),this.changeDate()}static#e=this.\u0275fac=function(i){return new(i||l)(e.rXU(t.c$))};static#t=this.\u0275cmp=e.VBU({type:l,selectors:[["app-date-picker"]],inputs:{defaultDate:"defaultDate",minDate:"minDate",maxDate:"maxDate"},outputs:{date:"date"},features:[e.OA$],decls:23,vars:33,consts:[[1,"ion-no-padding","ion-no-margin"],["lines","none",1,"ion-no-padding","ion-no-margin"],["interface","popover","name","year","required","",1,"ion-text-center","placeholder-select",3,"placeholder","okText","cancelText","ngModel","ngModelChange","ionChange"],[3,"value",4,"ngFor","ngForOf"],["interface","popover","name","month","required","",1,"ion-text-center","placeholder-select",3,"placeholder","okText","cancelText","ngModel","ngModelChange","ionChange"],["lines","none",1,"ion-no-padding","ion-no-margin","no-inner-padding"],["interface","popover","name","day","required","",1,"ion-text-center","placeholder-select",3,"placeholder","okText","cancelText","ngModel","ngModelChange","ionChange"],[3,"value"]],template:function(i,o){1&i&&(e.j41(0,"ion-grid",0)(1,"ion-row",0)(2,"ion-col",0)(3,"ion-item",1)(4,"ion-select",2),e.bIt("ngModelChange",function(d){return o.year=d})("ionChange",function(){return o.changeYear()}),e.nI1(5,"translate"),e.nI1(6,"translate"),e.nI1(7,"translate"),e.DNE(8,s,2,2,"ion-select-option",3),e.k0s()()(),e.j41(9,"ion-col",0)(10,"ion-item",1)(11,"ion-select",4),e.bIt("ngModelChange",function(d){return o.month=d})("ionChange",function(){return o.changeMonth()}),e.nI1(12,"translate"),e.nI1(13,"translate"),e.nI1(14,"translate"),e.DNE(15,_,2,2,"ion-select-option",3),e.k0s()()(),e.j41(16,"ion-col",0)(17,"ion-item",5)(18,"ion-select",6),e.bIt("ngModelChange",function(d){return o.day=d})("ionChange",function(){return o.changeDate()}),e.nI1(19,"translate"),e.nI1(20,"translate"),e.nI1(21,"translate"),e.DNE(22,g,2,2,"ion-select-option",3),e.k0s()()()()()),2&i&&(e.R7$(4),e.FS9("placeholder",e.bMT(5,15,"YEAR")),e.FS9("okText",e.bMT(6,17,"TEXT_OK_SELECT")),e.FS9("cancelText",e.bMT(7,19,"TEXT_CANCEL_SELECT")),e.Y8G("ngModel",o.year),e.R7$(4),e.Y8G("ngForOf",o.years),e.R7$(3),e.FS9("placeholder",e.bMT(12,21,"MONTH")),e.FS9("okText",e.bMT(13,23,"TEXT_OK_SELECT")),e.FS9("cancelText",e.bMT(14,25,"TEXT_CANCEL_SELECT")),e.Y8G("ngModel",o.month),e.R7$(4),e.Y8G("ngForOf",o.months),e.R7$(3),e.FS9("placeholder",e.bMT(19,27,"DAY")),e.FS9("okText",e.bMT(20,29,"TEXT_OK_SELECT")),e.FS9("cancelText",e.bMT(21,31,"TEXT_CANCEL_SELECT")),e.Y8G("ngModel",o.day),e.R7$(4),e.Y8G("ngForOf",o.days))},dependencies:[p.Sq,c.hU,c.lO,c.uz,c.ln,c.Nm,c.Ip,c.Je,m.BC,m.YS,m.vS,t.D9],styles:[".placeholder-select[_ngcontent-%COMP%]{border:1px solid #dedede;border-radius:5px;width:-webkit-fill-available;font-size:14px!important;text-align:justify!important;--padding-start: 15px;--placeholder-opacity: .5}.no-inner-padding[_ngcontent-%COMP%]{--inner-padding-end: 0px}"]})}return l})()},49561:(f,u,n)=>{n.r(u),n.d(u,{AcademyPaymentSupportPageModule:()=>h});var e=n(56610),t=n(37222),p=n(77897),c=n(36075),m=n(54777),s=n(2978);const _=[{path:"",component:m.V}];let g=(()=>{class a{static#e=this.\u0275fac=function(r){return new(r||a)};static#t=this.\u0275mod=s.$C({type:a});static#n=this.\u0275inj=s.G2t({imports:[c.iI.forChild(_),c.iI]})}return a})();var E=n(22882),l=n(55553);let h=(()=>{class a{static#e=this.\u0275fac=function(r){return new(r||a)};static#t=this.\u0275mod=s.$C({type:a});static#n=this.\u0275inj=s.G2t({imports:[e.MD,t.YN,p.bv,g,E.h,l.h]})}return a})()},54777:(f,u,n)=>{n.d(u,{V:()=>l});var e=n(73308),t=n(2978),p=n(22882),c=n(54171),m=n(57992),s=n(77897),_=n(37222),g=n(56261),E=n(13797);let l=(()=>{class h{constructor(i,o,r,d){this.translateService=i,this.utilsService=o,this.academyService=r,this.modalCtrl=d,this.document={name:""}}ngOnInit(){}saveFile(i){this.file=i,this.document.link=i}setDate(i){this.date=i}uploadSupport(i){var o=this;let r=i.value;r.file=this.file,r.payment_date=this.date,r.purchase_id=this.academyPurchase.id,this.validateData(r)&&this.utilsService.presentLoading(this.translateService.instant("all.loading")).then(()=>{this.academyService.uploadPaymentSupport(r).then(function(){var d=(0,e.A)(function*(D){D.r&&(o.utilsService.presentToast(4e3,"success","top",D.m),o.cancel(!1)),o.utilsService.dismissLoading()});return function(D){return d.apply(this,arguments)}}(),d=>{console.log("error enrollmentAcademy: ",d),this.utilsService.dismissLoading()})})}validateData(i){return i.file?i.payment_date?!!i.reference||(this.showWarning("REFERENCE_REQUIRED"),!1):(this.showWarning("PAYMENT_DATE_REQUIRED"),!1):(this.showWarning("SUPPORT_FILE_REQUIRED"),!1)}showWarning(i){this.utilsService.presentToast(3e3,"warning","top",this.translateService.instant(i))}cancel(i,o){this.modalCtrl.dismiss({status:i,valueOrder:o})}static#e=this.\u0275fac=function(o){return new(o||h)(t.rXU(p.c$),t.rXU(c.T),t.rXU(m.k),t.rXU(s.W3))};static#t=this.\u0275cmp=t.VBU({type:h,selectors:[["app-academy-payment-support"]],decls:36,vars:19,consts:[[1,"responsive-text"],["slot","end"],["strong","","color","light",3,"click"],["size","6","offset","3"],[3,"document","file"],[3,"ngSubmit"],["form","ngForm"],["position","stacked",1,"form-field-label"],["lines","none",1,"inputBorderRadius","ion-margin-bottom"],[2,"width","100%",3,"date"],["type","text","placeholder","","ngModel","","name","reference","required","","maxlength","191",1,"ion-text-center"],["reference","ngModel"],["lines","none",1,"inputBorderRadius"],["type","text","placeholder","","ngModel","","name","comment","required","","maxlength","191",1,"ion-text-center"],["comment","ngModel"],["type","submit","color","primary","shape","round","expand","block","fill","solid",1,"ion-margin"]],template:function(o,r){if(1&o){const d=t.RV6();t.j41(0,"ion-header")(1,"ion-toolbar")(2,"ion-title",0),t.EFF(3),t.nI1(4,"translate"),t.k0s(),t.j41(5,"ion-buttons",1)(6,"ion-button",2),t.bIt("click",function(){return r.cancel(!1)}),t.EFF(7),t.nI1(8,"translate"),t.k0s()()()(),t.j41(9,"ion-content")(10,"ion-grid")(11,"ion-row")(12,"ion-col",3)(13,"app-upload-file",4),t.bIt("file",function(M){return r.saveFile(M)}),t.k0s()()()(),t.j41(14,"form",5,6),t.bIt("ngSubmit",function(){t.eBV(d);const M=t.sdS(15);return t.Njj(r.uploadSupport(M))}),t.j41(16,"ion-label",7),t.EFF(17),t.nI1(18,"translate"),t.k0s(),t.j41(19,"ion-item",8)(20,"app-date-picker",9),t.bIt("date",function(M){return r.setDate(M)}),t.k0s()(),t.j41(21,"ion-label",7),t.EFF(22),t.nI1(23,"translate"),t.k0s(),t.j41(24,"ion-item",8),t.nrm(25,"ion-input",10,11),t.k0s(),t.j41(27,"ion-label",7),t.EFF(28),t.nI1(29,"translate"),t.k0s(),t.j41(30,"ion-item",12),t.nrm(31,"ion-input",13,14),t.k0s(),t.j41(33,"ion-button",15),t.EFF(34),t.nI1(35,"translate"),t.k0s()()()}2&o&&(t.R7$(3),t.JRh(t.bMT(4,7,"PAYMENT_SUPPORT")),t.R7$(4),t.JRh(t.bMT(8,9,"all.close")),t.R7$(6),t.Y8G("document",r.document),t.R7$(4),t.JRh(t.bMT(18,11,"PAYMENT_DATE")),t.R7$(5),t.JRh(t.bMT(23,13,"PAYMENT_REFERENCE")),t.R7$(6),t.JRh(t.bMT(29,15,"COMMENT")),t.R7$(6),t.SpI(" ",t.bMT(35,17,"UPLOAD_SUPORT")," "))},dependencies:[_.qT,_.BC,_.cb,_.YS,_.tU,_.vS,_.cV,s.Jm,s.QW,s.hU,s.W9,s.lO,s.eU,s.$w,s.uz,s.he,s.ln,s.BC,s.ai,s.Gw,g.I,E.V,p.D9]})}return h})()}}]);