PageSourceSearch

https://www.cbcareba.es/4332.74c2d3e54bab025d.js

js cbcareba.es collected 2026-10-10 02:07:53 UTC 72,381 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[4332],{4332:(L,M,a)=>{a.r(M),a.d(M,{SponsorModule:()=>uo});var g=a(72200),R=a(69915),S=a(85491),T=a(60152),x=a(45312),I=a(25615),t=a(73664),l=a(2615),c=a(89417),h=a(88834),F=a(5951),A=a(30450),b=a(91438),E=a(82966),p=a(49255),m=a(68018);function _(o,r){1&o&&(t.nrm(0,"app-alerts",3),t.nI1(1,"translate")),2&o&&t.Y8G("mensaje",t.bMT(1,1,"module.sponsors.configuration_saved"))}function V(o,r){1&o&&t.nrm(0,"app-skeleton-block")}function ut(o,r){1&o&&(t.j41(0,"div",20),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&o&&(t.R7$(),t.JRh(t.bMT(2,1,"module.sponsors.warning_visibility")))}function gt(o,r){if(1&o&&(t.j41(0,"div",21),t.nrm(1,"img",22),t.j41(2,"div",23)(3,"mat-radio-button",24),t.EFF(4),t.nI1(5,"translate"),t.k0s(),t.j41(6,"span",25),t.nI1(7,"translate"),t.nrm(8,"i",26),t.k0s()()()),2&o){const e=t.XpG(2);t.R7$(),t.Y8G("src",e.sponsorImages.stack,t.B4B),t.R7$(3),t.JRh(t.bMT(5,3,"module.sponsors.vertical_blocks")),t.R7$(2),t.Y8G("matTooltip",t.bMT(7,5,"module.sponsors.tooltip_stack"))}}function ft(o,r){if(1&o&&(t.j41(0,"div",21),t.nrm(1,"img",27),t.j41(2,"div",23)(3,"mat-radio-button",28),t.EFF(4),t.nI1(5,"translate"),t.k0s(),t.j41(6,"span",25),t.nI1(7,"translate"),t.nrm(8,"i",26),t.k0s()()()),2&o){const e=t.XpG(2);t.R7$(),t.Y8G("src",e.sponsorImages.swiper,t.B4B),t.R7$(3),t.JRh(t.bMT(5,3,"module.sponsors.carrousel_horizontal")),t.R7$(2),t.Y8G("matTooltip",t.bMT(7,5,"module.sponsors.tooltip_swiper"))}}function ht(o,r){if(1&o&&(t.j41(0,"div",29),t.nrm(1,"img",30),t.j41(2,"div",23)(3,"mat-radio-button",31),t.EFF(4),t.nI1(5,"translate"),t.k0s(),t.j41(6,"span",25),t.nI1(7,"translate"),t.nrm(8,"i",26),t.k0s()()()),2&o){const e=t.XpG(2);t.R7$(),t.Y8G("src",e.sponsorImages.stack,t.B4B),t.R7$(3),t.JRh(t.bMT(5,3,"module.sponsors.list")),t.R7$(2),t.Y8G("matTooltip",t.bMT(7,5,"module.sponsors.tooltip_list"))}}function bt(o,r){1&o&&(t.j41(0,"span"),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&o&&(t.R
17$(),t.JRh(t.bMT(2,1,"global.button.save")))}function _t(o,r){1&o&&(t.j41(0,"div",32)(1,"span",33),t.EFF(2),t.nI1(3,"translate"),t.k0s()()),2&o&&(t.R7$(2),t.SpI("",t.bMT(3,1,"global.button.saving"),"..."))}function vt(o,r){if(1&o){const e=t.RV6();t.j41(0,"form",4),t.bIt("ngSubmit",function(){l.eBV(e);const i=t.XpG();return l.Njj(i.onSubmit(i.configForm))}),t.DNE(1,ut,3,3,"div",5),t.j41(2,"div",6)(3,"div",7)(4,"div",8),t.EFF(5),t.nI1(6,"translate"),t.k0s()(),t.j41(7,"div",9)(8,"div",10)(9,"mat-slide-toggle",11)(10,"span"),t.EFF(11),t.nI1(12,"translate"),t.k0s()()(),t.j41(13,"div",10)(14,"mat-slide-toggle",12)(15,"span"),t.EFF(16),t.nI1(17,"translate"),t.k0s()()()(),t.j41(18,"div",7)(19,"div",8),t.EFF(20),t.nI1(21,"translate"),t.k0s()(),t.j41(22,"mat-radio-group",13)(23,"div",14),t.DNE(24,gt,9,7,"div",15)(25,ft,9,7,"div",15)(26,ht,9,7,"div",16),t.k0s()(),t.j41(27,"div",17)(28,"button",18),t.DNE(29,bt,3,3,"span",1)(30,_t,4,3,"div",19),t.k0s()()()()}if(2&o){const e=t.XpG();t.Y8G("formGroup",e.configForm),t.R7$(),t.Y8G("ngIf",!e.configForm.value.visible),t.R7$(4),t.JRh(t.bMT(6,12,"global.common.visibility")),t.R7$(6),t.JRh(t.bMT(12,14,"module.sponsors.visible_web")),t.R7$(5),t.JRh(t.bMT(17,16,"module.sponsors.show_category_names")),t.R7$(4),t.JRh(t.bMT(21,18,"module.sponsors.footer_design")),t.R7$(4),t.Y8G("ngIf",!e.isUFE),t.R7$(),t.Y8G("ngIf",!e.isUFE),t.R7$(),t.Y8G("ngIf",e.isUFE),t.R7$(2),t.Y8G("disabled",e.isSubmiting),t.R7$(),t.Y8G("ngIf",!e.isSubmiting),t.R7$(),t.Y8G("ngIf",e.isSubmiting)}}let J=(()=>{class o{formConstructor;appService;_clubService;globalVars;apiSponsorsService;clubsService;dataLoaded=!1;saveCompleted=!1;isSubmiting=!1;configForm;isUFE=!1;sponsorImages={stack:"",swiper:""};constructor(e,n,i,s,d,u){this.formConstructor=e,this.appService=n,this._clubService=i,this.globalVars=s,this.apiSponsorsService=d,this.clubsService=u}
1ngOnInit(){this.isUFE="UFE"===this.clubsService.getClubData().type,this.sponsorImages={stack:`${x.c.buckets.base}img/sponsors-config-stack.png`,swiper:`${x.c.buckets.base}img/sponsors-config-swiper.png`},this.apiSponsorsService.getSponsorConfig().subscribe(e=>{this.configForm=this.formConstructor.group({visible:[e.visibility],showCategory:[e.showCategory],type:[e.displayType]}),this.dataLoaded=!0})}onSubmit({value:e}){this.saveCompleted=!1,this.isSubmiting=!0,this.apiSponsorsService.updateSponsorConfig(e).subscribe({next:i=>{let s=this.clubsService.getClubData();s.sponsorshipConfig=i;let d=this.globalVars.mergeDeep(this.clubsService.getClubData(),s);this.clubsService.setClubData(d),this.appService.broadcast("refreshData",{}),this.saveCompleted=!0,this.isSubmiting=!1},error:i=>{this.saveCompleted=!1,this.isSubmiting=!1}})}static \u0275fac=function(n){return new(n||o)(t.rXU(c.ok),t.rXU(R.d),t.rXU(T.X),t.rXU(I.Y),t.rXU(S.L),t.rXU(T.X))};static \u0275cmp=t.VBU({type:o,selectors:[["app-sponsor-config"]],standalone:!1,decls:3,vars:3,consts:[["dismissable","true","type","success",3,"mensaje",4,"ngIf"],[4,"ngIf"],["class","full-width-form",3,"formGroup","ngSubmit",4,"ngIf"],["dismissable","true","type","success",3,"mensaje"],[1,"full-width-form",3,"ngSubmit","formGroup"],["class","alert-warning",4,"ngIf"],[1,"form-content","no-margin"],[1,"subsection-header"],[1,"title"],[1,"form-boxed","footer-visibility-form"],[1,"footer-visibility-option"],["formControlName","visible"],["formControlName","showCategory"],["formControlName","type",1,"row-layout"],[1,"row","footer-design-form"],["class","col-6 footer-design-option",4,"ngIf"],["class","col-12 footer-design-option",4,"ngIf"],[1,"actions-right","fixed-actions"],["mat-raised-button","mat-raised-button","type","submit",1,"btn-primary",3,"disabled"],["class","spinner-xxs",4,"ngIf"],[1,"alert-warning"],[1,"col-6","footer-design-option"],["alt","Stack",3,"src"],[1,"footer-design-check"],["value","stack"],[3,"matTooltip"],["aria-hidden","true",1,"fa-solid","fa-question-circle"],["alt","Swiper",3,"src"],["value","swipe"],[1,"col-12","footer-design-option"],["alt","List",3,"src"],["value","list"],[1,"spinner-xxs"],[1,"message"]],template:function(n,i){1&n&&t.DNE(0,_,2,3,"app-alerts",0)(1,V,1,0,"app-skeleton-block",1)(2,vt,31,20,"form",2),2&n&&(t.Y8G("ngIf",i.saveCompleted),t.R7$(),t.Y8G("ngIf",!i.dataLoaded),t.R7$(),t.Y8G("ngIf",i.dataLoaded))},dependencies:[g.bT,h.$z,F.VT,F._g,A.sG,b.e,c.qT,c.BC,c.cb,c.j4,c.JD,E.K,p.Z,m.D9],styles:[".form-content.no-margin[_ngcontent-%COMP%]   .footer-design-form[_ngcontent-%COMP%]{display:flex}.form-content.no-margin[_ngcontent-%COMP%]   .footer-design-form[_ngcontent-%COMP%]   .footer-design-option[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin-bottom:1em;align-items:center;width:fit-content}@media (max-width: 991px){.form-content.no-margin[_ngcontent-%COMP%]   .footer-design-form[_ngcontent-%COMP%]   .footer-design-option[_ngcontent-%COMP%]{align-items:flex-start}}.form-content.no-margin[_ngcontent-%COMP%]   .footer-design-form[_ngcontent-%COMP%]   .footer-design-option[_ngcontent-%COMP%]:last-child{margin-right:0}.form-content.no-margin[_ngcontent-%COMP%]   .footer-design-form[_ngcontent-%COMP%]   .footer-design-option[_ngcontent-%COMP%]   img[_ngcontent-%COMP%]{width:fit-content;margin-bottom:1em}.form-content.no-margin[_ngcontent-%COMP%]   .footer-design-form[_ngcontent-%COMP%]   .footer-design-option[_ngcontent-%COMP%]   .footer-design-check[_ngcontent-%COMP%]{text-align:center}@media (max-width: 991px){.form-content.no-margin[_ngcontent-%COMP%]   .footer-design-form[_ngcontent-%COMP%]   .footer-design-option[_ngcontent-%COMP%]   .footer-design-check[_ngcontent-%COMP%]{text-align:left}}.form-content.no-margin[_ngcontent-%COMP%]   .footer-design-form[_ngcontent-%COMP%]   .footer-design-option[_ngcontent-%COMP%]   .footer-design-check[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{padding-left:.8em;color:gray}.footer-visibility-form[_ngcontent-%COMP%]{display:flex;flex-direction:column}"]})}return o})();var y=a(10467),z=a(96732),St=a(7044),D=a(67201),H=a(74173),K=a(13961),W=a(6961),Y=a(4693),X=a(84412),Q=a(80954),Z=a(89902),q=a(15449),tt=a(19735),B=a(85340);const yt=(o,r)=>({required:o,placeholder:"global.common.name",inputType:"text",error:r,errorText:"global.validator.required"}),Ct=()=>({id:"footerVisibility",name:"Footer"}),Tt=()=>({id:"sponsorPageVisibility",name:"module.sponsor.sponsorPageVisibility"});function It(o,r){1&o&&(t.j41(0,"div",5),t.nrm(1,"app-skeleton-block"),t.k0s())}function Rt(o,r){1&o&&t.eu8(0)}function Gt(o,r){if(1&o&&(t.j41(0,"div",8),t.DNE(1,Rt,1,0,"ng-container",9),t.k0s()),2&o){t.XpG(3);const e=t.sdS(3);t.R7$(),t.Y8G("ngTemplateOutlet",e)}}function kt(o,r){if(1&o){const e=t.RV6();t.j41(0,"div",10)(1,"app-list-item",11),t.bIt("listAction",function(){l.eBV(e);const i=t.XpG(3);return l.Njj(i.selectVisibility())}),t.k0s(),t.j41(2,"form",12)(3,"app-form-row",13),t.nrm(4,"app-input",14),t.k0s()()()}if(2&o){const e=t.XpG(3);t.R7$(),t.Y8G("subtitle",e.getVisibility)("hasHover",e.globalVars.desktop)("iconLeft",e.visbilityIcon),t.R7$(),t.Y8G("formGroup",e.form),t.R7$(),t.Y8G("items",1)("destacado",!1),t.R7$(),t.Y8G("inputSize","default")("input",t.l_i(8,yt,null==e.form?null:e.form.get("name").hasValidator(e.isRequired),(null==e.form?null:e.form.get("name").touched)&&(null==e.form?null:e.form.get("name").hasError("required"))))}}function xt(o,r){if(1&o&&(t.qex(0),t.DNE(1,Gt,2,1,"div",6)(2,kt,5,11,"div",7),t.bVm()),2&o){const e=t.XpG().ngIf;t.R7$(),t.Y8G("ngIf","vista"===e),t.R7$(),t.Y8G("ngIf","general"===e)}}function At(o,r){1&o&&t.eu8(0)}function Vt(o,r){if(1&o){const e=t.RV6();t.j41(0,"app-clupik-button",20),t.bIt("buttonAction",function(){l.eBV(e);const i=t.XpG(3);return l.Njj(i.modalConfig.vista.cancel())}),t.k0s()}if(2&o){const e=t.XpG(3);t.Y8G("label",e.modalConfig.vista.cancelTitle)}}function jt(o,r){if(1&o){const e=t.RV6();t.j41(0,"app-clupik-modal-down",15)(1,"div",16),t.DNE(2,At,1,0,"ng-container",9),t.k0s(),t.j41(3,"div",17),t.DNE(4,Vt,1,1,"app-clupik-button",18),t.j41(5,"app-clupik-button",19),t.bIt("buttonAction",function(){l.eBV(e);const i=t.XpG(2);return l.Njj(i.modalConfig.vista.action())}),t.k0s()()()}if(2&o){const e=t.XpG(2),n=t.sdS(3);t.Y8G("mainTitle",e.modalConfig.vista.responsiveTitle),t.R7$(2),t.Y8G("ngTemplateOutlet",n),t.R7$(2),t.Y8G("ngIf",e.modalConfig.vista.hasCancel()),t.R7$(),t.Y8G("label",e.modalConfig.vista.acceptTitle)}}function Mt(o,r){if(1&o){const e=t.RV6();t.qex(0),t.j41(1,"app-clupik-modal",2),t.bIt("mainAction",function(){const i=l.eBV(e).ngIf,s=t.XpG();return l.Njj(s.modalConfig[i].action())})("secondaryAction",function(){const i=l.eBV(e).ngIf,s=t.XpG();return l.Njj(s.modalConfig[i].cancel())})("cancelAction",function(){l.eBV(e);const i=t.XpG();return l.Njj(i.changeView("cancel"))}),t.DNE(2,It,2,0,"div",3)(3,xt,3,2,"ng-container",1)(4,jt,6,4,"app-clupik-modal-down",4),t.k0s(),t.bVm()}
1if(2&o){const e=r.ngIf,n=t.XpG();t.R7$(),t.Y8G("modalTitle",n.modalConfig[e].title())("showDivider",n.modalConfig[e].showDivider())("closeDisabled",n.modalConfig[e].closeDisabled())("hasMainButton",n.modalConfig[e].hasMainButton())("mainButtonValue",n.modalConfig[e].acceptTitle)("mainHasIcon",null!==n.modalConfig[e].buttonIcon&&"left")("mainButtonIcon",n.modalConfig[e].buttonIcon)("mainButtonDisabled",n.modalConfig[e].mainDisabled())("secondaryButtonValue",n.modalConfig[e].cancelTitle)("hasSecondaryButton",n.modalConfig[e].hasCancel())("hasCancelAction",!0),t.R7$(),t.Y8G("ngIf",n.loading),t.R7$(),t.Y8G("ngIf",!n.loading),t.R7$(),t.Y8G("ngIf",n.globalVars.responsive)}}function wt(o,r){if(1&o&&(t.j41(0,"form",12),t.nrm(1,"app-input",22)(2,"app-input",23),t.k0s()),2&o){const e=t.XpG(2);t.Y8G("formGroup",e.auxform),t.R7$(),t.Y8G("checkboxConfig",t.lJ4(3,Ct)),t.R7$(),t.Y8G("checkboxConfig",t.lJ4(4,Tt))}}function Et(o,r){if(1&o&&t.DNE(0,wt,3,5,"form",21),2&o){const e=t.XpG();t.Y8G("ngIf",e.auxform&&!e.loading)}}let et=(()=>{class o{globalVars;_apiSponsors;_translate;sheet;category=null;isRequired=c.k0.required;activeView$=new X.t("general");loading=!0;modalConfig={general:{title:()=>null!==this.category?"module.sponsors.edit_category":"module.store.add_category",responsiveTitle:"module.store.add_category",buttonIcon:null,hasMainButton:()=>!this.loading,mainDisabled:()=>!1,acceptTitle:"global.common.save",action:()=>this.submit(),cancelTitle:"",hasCancel:()=>!1,cancel:()=>this.globalVars.closeModal(),preparation:()=>{this.form||(this.form=new c.gE({name:new c.MJ(null!==this.category?this.category?.name:"",c.k0.required),sectionId:new c.MJ(null),visible:new c.MJ(!1),sponsorPageVisibility:new c.MJ(null===this.category||this.category?.sponsorPageVisibility),footerVisibility:new c.MJ(null===this.category||this.category?.footerVisibility)})),this.loading=!1},closeDisabled:()=>{},showDivider:()=>!this.loading},vista:{title:()=>null!==this.category?"module.sponsors.edit_category":"module.store.add_category",responsiveTitle:"global.common.visibility",buttonIcon:null,hasMainButton:()=>!0,mainDisabled:()=>!1,acceptTitle:"global.common.save",action:()=>this.saveVista(),cancelTitle:"global.common.back",hasCancel:()=>!0,cancel:()=>{this.globalVars.responsive?this.sheet?.close("cat-visibility"):this.changeView("general")},preparation:()=>{this.auxform=new c.gE({sponsorPageVisibility:new c.MJ(this.form.get("sponsorPageVisibility").value),footerVisibility:new c.MJ(this.form.get("footerVisibility").value)}),this.loading=!1},closeDisabled:()=>{},showDivider:()=>!0}};form;auxform;get getVisibility(){let e=[];return this.form.get("sponsorPageVisibility").value&&e.push(this.translations.sponsorPageVisibility),this.form.get("footerVisibility").value&&e.push(this.translations.footerVisibility),e.length?e.join(", "):"global.common.hide"}get visbilityIcon(){return this.form.get("sponsorPageVisibility").value||this.form.get("footerVisibility").value?"fa-light fa-eye":"fa-light fa-eye-slash"}translations={sponsorPageVisibility:"",footerVisibility:"Footer"};constructor(e,n,i){this.globalVars=e,this._apiSponsors=n,this._translate=i,this.getTranslations()}getTranslations(){var e=this;return(0,y.A)(function*(){e.translations.sponsorPageVisibility=yield e._translate.getTranslation("module.sponsor.sponsorPageVisibility"),e.translations.footerVisibility="Footer"})()}ngAfterViewInit(){this.modalConfig.general.preparation()}selectVisibility(){this.globalVars.responsive?(this.loading=!0,this.modalConfig.vista.preparation(),this.sheet?.open("cat-visibility")):this.changeView("vista")}changeView(e){this.loading=!0,this.activeView$.next(e),this.modalConfig[e].preparation()}saveVista(){this.form.get("sponsorPageVisibility").setValue(this.auxform.get("sponsorPageVisibility").value),this.form.get("footerVisibility").setValue(this.auxform.get("footerVisibility").value),this.globalVars.responsive?this.sheet?.close("cat-visibility"):this.changeView("general")}submit(){const{value:e,valid:n}=this.form;if(this.loading=!0,n){e.visible=e.footerVisibility||e.sponsorPageVisibility;let i=null;i=this.category?this._apiSponsors.updateCategory(e,this.category.id):this._apiSponsors.createNewSponsorCategory(e),i.subscribe({next:s=>{this.globalVars.closeModal(s.sponsor)},error:s=>{this.loading=!1,console.error("Error creating/updating sponsor category: ",s)}})}else{this.loading=!1;for(let i in this.form.controls)this.form.controls[i].markAsTouched()}}static \u0275fac=function(n){return new(n||o)(t.rXU(I.Y),t.rXU(S.L),t.rXU(W.T))};static \u0275cmp=t.VBU({type:o,selectors:[["app-add-sponsor-category"]],viewQuery:function(n,i){if
1(1&n&&t.GBs(Y.N,5),2&n){let s;t.mGM(s=t.lsd())&&(i.sheet=s.first)}},inputs:{category:"category"},standalone:!1,decls:4,vars:3,consts:[["commonVista",""],[4,"ngIf"],[3,"mainAction","secondaryAction","cancelAction","modalTitle","showDivider","closeDisabled","hasMainButton","mainButtonValue","mainHasIcon","mainButtonIcon","mainButtonDisabled","secondaryButtonValue","hasSecondaryButton","hasCancelAction"],["class","loading-block",4,"ngIf"],["id","cat-visibility",3,"mainTitle",4,"ngIf"],[1,"loading-block"],["class","view_vista",4,"ngIf"],["class","view_general",4,"ngIf"],[1,"view_vista"],[4,"ngTemplateOutlet"],[1,"view_general"],["mainTitle","module.teams.add_modal.visibility","iconRight","fa-light fa-chevron-right",3,"listAction","subtitle","hasHover","iconLeft"],[3,"formGroup"],[3,"items","destacado"],["type","normal","formControlName","name",3,"inputSize","input"],["id","cat-visibility",3,"mainTitle"],[1,"modal_down_fix"],[1,"modal-down-actions"],["type","button","config","outlined","size","md",3,"label","buttonAction",4,"ngIf"],["type","button","config","main","size","md",3,"buttonAction","label"],["type","button","config","outlined","size","md",3,"buttonAction","label"],[3,"formGroup",4,"ngIf"],["type","checkbox","formControlName","footerVisibility",3,"checkboxConfig"],["type","checkbox","formControlName","sponsorPageVisibility",3,"checkboxConfig"]],template:function(n,i){1&n&&(t.DNE(0,Mt,5,14,"ng-container",1),t.nI1(1,"async"),t.DNE(2,Et,1,1,"ng-template",null,0,t.C5r)),2&n&&t.Y8G("ngIf",t.bMT(1,1,i.activeView$))},dependencies:[g.bT,g.T3,c.qT,c.BC,c.cb,c.j4,c.JD,E.K,Q.Y,Z.S,q.P,tt.$,Y.N,B.U,g.Jj],encapsulation:2})}return o})();var Dt=a(11056);const $t=["uploader"],Ft=()=>[".jpg",".png"],Yt=(o,r)=>({required:o,placeholder:"global.common.name",inputType:"text",error:r,errorText:"global.validator.required"}),Xt=(o,r)=>({required:o,placeholder:"module.sponsors.link_to_site",inputType:"text",error:r,errorText:"global.validator.required"}),Bt=(o,r)=>({required:o,placeholder:"module.sponsor.sponsor_cat",error:r,errorText:"global.validator.required"});function Pt(o,r){1&o&&(t.j41(0,"div",6),t.nrm(1,"app-skeleton-block"),t.k0s())}function Ut(o,r){1&o&&t.eu8(0)}function Ot(o,r){if(1&o&&(t.j41(0,"div",9),t.DNE(1,Ut,1,0,"ng-container",10),t.k0s()),2&o){t.XpG(3);const e=t.sdS(3);t.R7$(),t.Y8G("ngTemplateOutlet",e)}}function Nt(o,r){if(1&o){const e=t.RV6();t.j41(0,"app-form-row",16)(1,"app-form-image",20),t.bIt("click",function(){l.eBV(e);const i=t.XpG(4);return l.Njj(i.selectPrimaryImage())}),t.k0s()()}if(2&o){const e=t.XpG(4);t.Y8G("items",1)("destacado",!1),t.R7$(),t.Y8G("isRequired",null==e.form?null:e.form.get("img").hasValidator(e.isRequired))("hasError",e.needsImage)}}function Lt(o,r){if(1&o){const e=t.RV6();t.j41(0,"app-form-row",16)(1,"figure",21),t.nrm(2,"img",22),t.j41(3,"app-clupik-button",23),t.bIt("buttonAction",function(){l.eBV(e);const i=t.XpG(4);return l.Njj(i.deleteImage())}),t.k0s()()()}if(2&o){const e=r.ngIf;t.Y8G("items",1)("destacado",!0),t.R7$(2),t.Y8G("src",null==e?null:e.src,t.B4B),t.R7$(),t.Y8G("icon","fa-light fa-trash")}}function Jt(o,r){if(1&o){const e=t.RV6();t.j41(0,"div",11)(1,"app-list-item",12),t.bIt("listAction",function(){l.eBV(e);const i=t.XpG(3);return l.Njj(i.selectVisibility())}),t.k0s(),t.DNE(2,Nt,2,4,"app-form-row",13),t.nI1(3,"async"),t.j41(4,"input",14,1),t.bIt("change",function(i){l.eBV(e);const s=t.XpG(3);return l.Njj(s.onFileInput(i))}),t.k0s(),t.DNE(6,Lt,4,4,"app-form-row",13),t.nI1(7,"async"),t.j41(8,"form",15)(9,"app-form-row",16),t.nrm(10,"app-input",17),t.k0s(),t.j41(11,"app-form-row",16),t.nrm(12,"app-input",18),t.k0s(),t.j41(13,"app-form-row",16),t.nrm(14,"app-input",19),t.k0s()()()}if(2&o){const e=t.XpG(3);t.R7$(),t.Y8G("subtitle",e.getVisibility)("hasHover",e.globalVars.desktop)("iconLeft",e.visbilityIcon),t.R7$(),t.Y8G("ngIf",!t.bMT(3,20,e.configImage$)),t.R7$(2),t.Y8G("accept",t.lJ4(24,Ft)),t.R7$(2),t.Y8G("ngIf",t.bMT(7,22,e.configImage$)),t.R7$(2),t.Y8G("formGroup",e.form),t.R7$(),t.Y8G("items",1)("destacado",!1),t.R7$(),t.Y8G("inputSize","default")("input",t.l_i(25,Yt,null==e.form?null:e.form.get("name").hasValidator(e.isRequired),(null==e.form?null:e.form.get("name").touched)&&(null==e.form?null:e.form.get("name").hasError("required")))),t.R7$(),t.Y8G("items",1)("destacado",!1),t.R7$(),t.Y8G("inputSize","default")("input",t.l_i(28,Xt,null==e.form?null:e.form.get("url").hasValidator(e.isRequired),(null==e.form?null:e.form.get("url").touched)&&(null==e.form?null:e.form.get("url").hasError("required")))),t.R7$(),t.Y8G("items",1)("destacado",!1),t.R7$(),t.Y8G("selectOptions",e.categories)("isSelectMultiple",!1)("select",t.l_i(31,Bt,null==e.form?null:e.form.get("category").hasValidator(e.isRequired),(null==e.form?null:e.form.get("category").touched)&&(null==e.form?null:e.form.get("category").hasError("required"))))}}function zt(o,r){if(1&o&&(t.qex(0),t.DNE(1,Ot,2,1,"div",7)(2,Jt,15,34,"div",8),t.bVm()),2&o){const e=t.XpG().ngIf;t.R7$(),t.Y8G("ngIf","vista"===e),t.R7$(),t.Y8G("ngIf","general"===e)}}function Ht(o,r){1&o&&t.eu8(0)}function Kt(o,r){if(1&o){const e=t.RV6();t.j41(0,"app-clupik-button",29),t.bIt("buttonAction",function(){l.eBV(e);const i=t.XpG(3);return l.Njj(i.modalConfig.vista.cancel())}),t.k0s()}if(2&o){const e=t.XpG(3);t.Y8G("label",e.modalConfig.vista.cancelTitle)}}function Wt(o,r){if(1&o){const e=t.RV6();t.j41(0,"app-clupik-modal-down",24)(1,"div",25),t.DNE(2,Ht,1,0,"ng-container",10),t.k0s(),t.j41(3,"div",26),t.DNE(4,Kt,1,1,"app-clupik-button",27),t.j41(5,"app-clupik-button",28),t.bIt("buttonAction",function(){l.eBV(e);const i=t.XpG(2);return l.Njj(i.modalConfig.vista.action())}),t.k0s()()()}if(2&o){const e=t.XpG(2),n=t.sdS(3);t.Y8G("mainTitle",e.modalConfig.vista.responsiveTitle),t.R7$(2),t.Y8G("ngTemplateOutlet",n),t.R7$(2),t.Y8G("ngIf",e.modalConfig.vista.hasCancel()),t.R7$(),t.Y8G("label",e.modalConfig.vista.acceptTitle)}}
1function Qt(o,r){if(1&o){const e=t.RV6();t.qex(0),t.j41(1,"app-clupik-modal",3),t.bIt("mainAction",function(){const i=l.eBV(e).ngIf,s=t.XpG();return l.Njj(s.modalConfig[i].action())})("secondaryAction",function(){const i=l.eBV(e).ngIf,s=t.XpG();return l.Njj(s.modalConfig[i].cancel())})("cancelAction",function(){l.eBV(e);const i=t.XpG();return l.Njj(i.changeView("cancel"))}),t.DNE(2,Pt,2,0,"div",4)(3,zt,3,2,"ng-container",2)(4,Wt,6,4,"app-clupik-modal-down",5),t.k0s(),t.bVm()}if(2&o){const e=r.ngIf,n=t.XpG();t.R7$(),t.Y8G("modalTitle",n.modalConfig[e].title())("showDivider",n.modalConfig[e].showDivider())("closeDisabled",n.modalConfig[e].closeDisabled())("hasMainButton",n.modalConfig[e].hasMainButton())("mainButtonValue",n.modalConfig[e].acceptTitle)("mainHasIcon",null!==n.modalConfig[e].buttonIcon&&"left")("mainButtonIcon",n.modalConfig[e].buttonIcon)("mainButtonDisabled",n.modalConfig[e].mainDisabled())("secondaryButtonValue",n.modalConfig[e].cancelTitle)("hasSecondaryButton",n.modalConfig[e].hasCancel())("hasCancelAction",!0),t.R7$(),t.Y8G("ngIf",n.loading),t.R7$(),t.Y8G("ngIf",!n.loading),t.R7$(),t.Y8G("ngIf",n.globalVars.responsive)}}function Zt(o,r){if(1&o&&(t.j41(0,"form",15),t.nrm(1,"app-input",31),t.k0s()),2&o){const e=t.XpG(2);t.Y8G("formGroup",e.auxform),t.R7$(),t.Y8G("allowEmptySelection",!1)("options",e.visibilityOptions)}}function qt(o,r){if(1&o&&t.DNE(0,Zt,2,3,"form",30),2&o){const e=t.XpG();t.Y8G("ngIf",e.auxform&&!e.loading)}}let ot=(()=>{class o{globalVars;_apiSponsors;activeView$=new X.t("general");loading=!0;sheet;sponsor=null;get isEdit(){return null!==this.sponsor}categories=null;fileInput;form;auxform;needsImage=!1;_configImage$=new X.t(null);get configImage$(){return this._configImage$}get configImage(){return this._configImage$.value}set configImage(e){this._configImage$.next(e)}isRequired=c.k0.required;modalConfig={general:{title:()=>this.isEdit?"global.title.edit_sponsor":"global.title.create_sponsor",responsiveTitle:"global.title.create_sponsor",buttonIcon:null,hasMainButton:()=>!this.loading,mainDisabled:()=>!1,acceptTitle:"global.common.save",action:()=>this.submit(),cancelTitle:"",hasCancel:()=>!1,cancel:()=>this.globalVars.closeModal(),preparation:()=>{this.form||(this.form=new c.gE({name:new c.MJ(this.isEdit?this.sponsor?.name:null,c.k0.required),url:new c.MJ(this.isEdit?this.sponsor?.url:""),img:new c.MJ(this.isEdit?this.sponsor?.img:null,c.k0.required),category:new c.MJ(this.isEdit?this.sponsor?.catId:null,c.k0.required),visibility:new c.MJ(!this.isEdit||this.sponsor?.visibility)})),this.isEdit&&(this.configImage={src:this._apiSponsors.getSponsorImage(this.sponsor.id)}),this.loading=!1},closeDisabled:()=>{},showDivider:()=>!this.loading},vista:{title:()=>this.isEdit?"global.title.edit_sponsor":"global.title.create_sponsor",responsiveTitle:"global.common.visibility",buttonIcon:null,hasMainButton:()=>!0,mainDisabled:()=>!1,acceptTitle:"global.common.save",action:()=>this.saveVista(),cancelTitle:"global.common.back",hasCancel:()=>!0,cancel:()=>{this.globalVars.responsive?this.sheet?.close("sp-vis"):this.changeView("general")},preparation:()=>{this.auxform=new c.gE({visibility:new c.MJ(this.form.get("visibility").value)}),this.loading=!1},closeDisabled:()=>{},showDivider:()=>!0}};visibilityOptions=[{id:!0,value:!0,name:"global.button.show",icon:"fa-light fa-eye",description:"",allowed:!0},{id:!1,value:!1,name:"global.common.hide",icon:"fa-light fa-eye-slash",description:"",allowed:!0}];get getVisibility(){return this.form.get("visibility").value?"global.button.show":"global.common.hide"}get visbilityIcon(){return this.form.get("visibility").value?"fa-light fa-eye":"fa-light fa-eye-slash"}constructor(e,n){this.globalVars=e,this._apiSponsors=n}ngAfterViewInit(){this.changeView("general")}selectVisibility(){this.globalVars.responsive?(this.loading=!0,this.modalConfig.vista.preparation(),this.sheet?.open("sp-vis")):this.changeView("vista")}changeView(e){this.loading=!0,this.activeView$.next(e),this.modalConfig[e].preparation()}saveVista(){this.form.get("visibility").setValue(this.auxform.get("visibility").value),this.form.get("visibility").markAsDirty(),this.globalVars.responsive?this.sheet?.close("sp-vis"):this.changeView("general")}selectPrimaryImage(){this.fileInput.nativeElement.click()}onFileInput(e){const i=e.target.files;if(null==i||0==i.length)return null;this.onFileUpload(i)}onFileUpload(e){var n=this;let i=[];for(let s=0;s<e.length;s++){const d=e.item(s);i.push(new Promise((u,v)=>{const f=new FileReader;
1f.readAsDataURL(d);const w=G=>{const k={src:G.target.result,name:e.item(0).name};u(k)};null!=f.addEventListener?f.addEventListener("load",w.bind(this)):f.onload=w.bind(this)}))}Promise.all(i).then(function(){var s=(0,y.A)(function*(d){const u=d[0];n.configImage=u,n.form.get("img").setValue(u.src),n.form.get("img").markAsDirty()});return function(d){return s.apply(this,arguments)}}())}deleteImage(){this.configImage=null,this.form.get("img").setValue(null),this.form.get("img").markAsDirty()}submit(){const{value:e,valid:n}=this.form;let i,s=null;if(this.needsImage=!1,this.loading=!0,this.configImage)if(n)this.isEdit?(s={...this.form.get("img").dirty&&{img:this.form.get("img").value},...this.form.get("name").dirty&&{name:this.form.get("name").value},...this.form.get("url").dirty&&{url:this.form.get("url").value},...this.form.get("visibility").dirty&&{visibility:this.form.get("visibility").value},...this.form.get("category").dirty&&{category:this.form.get("category").value}},i=this._apiSponsors.updateSponsor(s,this.sponsor.id)):i=this._apiSponsors.createSponsor(e),i.subscribe({next:d=>{let u=d;this.isEdit&&(u=d.sponsor),u.visibility=this.form.get("visibility").value,u.catId=this.form.get("category").value,this.globalVars.closeModal(u)},error:d=>{this.loading=!1,console.error("Error creating/updating sponsor: ",d)}});else{this.loading=!1;for(let d in this.form.controls)this.form.controls[d].markAsTouched()}else{this.needsImage=!0;for(let d in this.form.controls)this.form.controls[d].markAsTouched();this.loading=!1}}static \u0275fac=function(n){return new(n||o)(t.rXU(I.Y),t.rXU(S.L))};static \u0275cmp=t.VBU({type:o,selectors:[["app-add-sponsor"]],viewQuery:function(n,i){if(1&n&&(t.GBs(Y.N,5),t.GBs($t,5)),2&n){let s;t.mGM(s=t.lsd())&&(i.sheet=s.first),t.mGM(s=t.lsd())&&(i.fileInput=s.first)}},inputs:{sponsor:"sponsor",categories:"categories"},standalone:!1,decls:4,vars:3,consts:[["commonVista",""],["uploader",""],[4,"ngIf"],[3,"mainAction","secondaryAction","cancelAction","modalTitle","showDivider","closeDisabled","hasMainButton","mainButtonValue","mainHasIcon","mainButtonIcon","mainButtonDisabled","secondaryButtonValue","hasSecondaryButton","hasCancelAction"],["class","loading-block",4,"ngIf"],["id","sp-vis",3,"mainTitle",4,"ngIf"],[1,"loading-block"],["class","view_vista",4,"ngIf"],["class","view_general",4,"ngIf"],[1,"view_vista"],[4,"ngTemplateOutlet"],[1,"view_general"],["mainTitle","module.teams.add_modal.visibility","iconRight","fa-light fa-chevron-right",3,"listAction","subtitle","hasHover","iconLeft"],[3,"items","destacado",4,"ngIf"],["type","file",1,"force-hidden",3,"change","accept"],[3,"formGroup"],[3,"items","destacado"],["type","normal","formControlName","name",3,"inputSize","input"],["type","normal","formControlName","url",3,"inputSize","input"],["formControlName","category","type","select","inputSize","default","popoverSize","cover",3,"selectOptions","isSelectMultiple","select"],["placeholder","module.publications.primary_image",3,"click","isRequired","hasError"],[1,"selected-image"],["alt","Imagen de patrocinador",3,"src"],["type","icon","config","main","size","sm",1,"corner-button",3,"buttonAction","icon"],["id","sp-vis",3,"mainTitle"],[1,"modal_down_fix"],[1,"modal-down-actions"],["type","button","config","outlined","size","md",3,"label","buttonAction",4,"ngIf"],["type","button","config","main","size","md",3,"buttonAction","label"],["type","button","config","outlined","size","md",3,"buttonAction","label"],[3,"formGroup",4,"ngIf"],["type","radiobutton","formControlName","visibility",3,"allowEmptySelection","options"]],template:function(n,i){1&n&&(t.DNE(0,Qt,5,14,"ng-container",2),t.nI1(1,"async"),t.DNE(2,qt,1,1,"ng-template",null,0,t.C5r)),2&n&&t.Y8G("ngIf",t.bMT(1,1,i.activeView$))},dependencies:[g.bT,g.T3,c.qT,c.BC,c.cb,c.j4,c.JD,E.K,Dt.b,Q.Y,Z.S,q.P,tt.$,Y.N,B.U,g.Jj],styles:["figure.selected-image[_ngcontent-%COMP%]{width:fit-content;margin:0 auto;position:relative}figure.selected-image[_ngcontent-%COMP%]   img[_ngcontent-%COMP%]{max-width:100%;min-width:300px;max-height:300px;object-fit:contain;object-position:center}@media (max-width: 991px){figure.selected-image[_ngcontent-%COMP%]   img[_ngcontent-%COMP%]{max-width:100dvw;min-width:50dvw}}figure.selected-image[_ngcontent-%COMP%]   .corner-button[_ngcontent-%COMP%]{cursor:pointer;z-index:10;position:absolute;top:calc(var(--module) / 4);right:calc(var(--module) / 4)}figure.selected-image[_ngcontent-%COMP%]   .edit-view[_ngcontent-%COMP%]{overflow-y:scroll;max-height:80vh}"]})}return o}
1)();var $=a(91029),P=a(94474),C=a(36229),te=a(95064),ee=a(15686),oe=a(11630),ne=a(69415),ie=a(47649);const se=o=>({tooltip:o,icon:"fa-solid fa-plus"}),ae=()=>["module.sponsor.nothing","module.sponsor.nothing_desc"];function re(o,r){1&o&&t.nrm(0,"app-skeleton-table")}function le(o,r){if(1&o){const e=t.RV6();t.qex(0),t.j41(1,"app-clupik-button",5),t.nI1(2,"translate"),t.bIt("click",function(){l.eBV(e);const i=t.XpG(2);return l.Njj(i.order())}),t.k0s(),t.j41(3,"app-clupik-button",6),t.bIt("buttonAction",function(){l.eBV(e);const i=t.XpG(2);return l.Njj(i.addCategoryModal())}),t.k0s(),t.j41(4,"app-clupik-button",7),t.bIt("buttonAction",function(){l.eBV(e);const i=t.XpG(2);return l.Njj(i.addSponsorModal())}),t.k0s(),t.bVm()}if(2&o){const e=t.XpG(2);t.R7$(),t.Y8G("iconLeft",!0)("icon","fa-regular fa-sort-alt"),t.BMQ("aria-label",t.bMT(2,9,"module.sponsors.order_it_cats")),t.R7$(2),t.Y8G("tooltip","module.sponsors.add_category")("iconLeft",!0)("icon","fa-regular fa-tag"),t.R7$(),t.Y8G("label",e.isUFE?"module.sponsors.add_federation":"module.sponsors.add_sponsor")("iconLeft",!0)("icon","fa-solid fa-plus")}}function ce(o,r){if(1&o){const e=t.RV6();t.qex(0),t.j41(1,"app-empty-space",8),t.bIt("buttonAction",function(){l.eBV(e);const i=t.XpG(2);return l.Njj(i.addCategoryModal())}),t.k0s(),t.bVm()}2&o&&(t.R7$(),t.Y8G("size","default")("textArray",t.lJ4(5,ae))("noButton",!1)("buttonText","module.sponsors.add_category")("icon","fa-regular fa-tag"))}function pe(o,r){1&o&&(t.j41(0,"div",17),t.nrm(1,"div",18),t.k0s())}function de(o,r){if(1&o){const e=t.RV6();t.j41(0,"div",11)(1,"div",12),t.DNE(2,pe,2,0,"div",13),t.j41(3,"app-navbar-resume",14)(4,"app-dropdown-menu",15),t.bIt("click",function(i){return l.eBV(e),l.Njj(i.stopPropagation())}),t.k0s()()(),t.j41(5,"app-clupik-table",16),t.bIt("onSelectAllActionClicked",function(i){l.eBV(e);const s=t.XpG(3);return l.Njj(s.selectMultipleAction(i))})("onRowClicked",function(i){l.eBV(e);const s=t.XpG(3);return l.Njj(s.editSponsor(null,i))}),t.k0s()()}if(2&o){const e=r.$implicit,n=t.XpG(3);t.R7$(2),t.Y8G("ngIf",!e.footerVisibility&&!e.sponsorPageVisibility),t.R7$(),t.Y8G("descriptionNumber",e.children.length)("customActions",!0)("titleClass","h4")("mainTitle",e.name)("description",n.description(e))("hasPaddingLeft",!1),t.R7$(),t.Y8G("hasSections",!0)("sectionOptions",n.sponsorTableDropDownOption)("value",e),t.R7$(),t.Y8G("settings",e.table)("source",e.children)}}function me(o,r){if(1&o&&(t.j41(0,"div",9),t.DNE(1,de,6,12,"div",10),t.k0s()),2&o){const e=t.XpG(2);t.R7$(),t.Y8G("ngForOf",e.sponsorTable)}}function ue(o,r){if(1&o){const e=t.RV6();t.qex(0),t.j41(1,"div",2)(2,"app-clupik-button",3),t.bIt("buttonAction",function(){l.eBV(e);const i=t.XpG();return l.Njj(i.globalVars.openChat())}),t.k0s(),t.DNE(3,le,5,11,"ng-container",0),t.k0s(),t.DNE(4,ce,2,6,"ng-container",0)(5,me,2,1,"div",4),t.bVm()}if(2&o){const e=t.XpG();t.R7$(2),t.Y8G("tooltip","global.common.ia")("icon","fa-regular fa-wand-magic-sparkles"),t.R7$(),t.Y8G("ngIf",(null==e.sponsorTable?null:e.sponsorTable.length)>0),t.R7$(),t.Y8G("ngIf",0===(null==e.sponsorTable?null:e.sponsorTable.length)),t.R7$(),t.Y8G("ngIf",(null==e.sponsorTable?null:e.sponsorTable.length)>0)}}let ge=(()=>{class o{clubsService;apiSponsorsService;appService;activatedRoute;router;globalVars;_modalService;modalService;_translate;dialog;sponsorTable;isUFE;notFoundMesasage="module.sponsors.no_sponsors";alertType="success";saved=!1;message="module.sponsors.saved";loading=!0;sectionId=-1;tableView=!0;multipleActionsSubscription=new K.yU;subscription=new K.yU;tables;messageTypes={sponsor:"module.sponsors.saved",category:"module.sponsors.category_saved",federation:"module.sponsors.federation_saved"};onMessage;tableSettings={title:"sponsors",noDataMessage:"no_sponsors_found",paginator:{size:30,paginatorType:"vertical",verticalButton:!1},class:"max-height-table",showTotalResults:!1,serverFiltered:!1,showFilters:!1,rowClickEvent:!0,buttonsDesktop:[{type:"filter"}],multipleSelect:{showMultipleSelect:!0,selectAllMessage:"users",sections:[{title:"quick_actions",actions:[{type:"custom",text:"global.common.show",broadcastKey:"show"},{type:"custom",text:"global.common.hide",broadcastKey:"hide"},{type:"custom",text:"global.common.remove",broadcastKey:"remove"}]}]},columns:{actions:{stickedFront:!0,hideSticky:!0,noExport:!0,title:"",type:"custom",renderComponent:St.H,actionsData:{actions:[{icon:"fa-light fa-eye-slash",text:"global.common.hide",condition:(e,n)=>e.visibility,disabled:(e,n)=>!1,event:(e,n)=>this.disableSponsor(e,n,!1)},{icon:"fa-light fa-eye",text:"global.common.show",condition:(e,n)=>!e.visibility,disabled:(e,n)=>!1,event:(e,n)=>this.disableSponsor(e,n,!0)},{icon:"fa-light fa-edit",text:"global.common.edit",condition:(e,n)=>!0,disabled:(e,n)=>!1,event:(e,n)=>this.editSponsor(e,n)},{icon:"fa-light fa-trash",text:"global.common.remove",condition:(e,n)=>!0,disabled:(e,n)=>!1,event:(e,n)=>this.deleteSponsor(n)}]}},visibility:{title:"",type:"visibility",sort:!1,filter:!1,class:"column-xxs"},name:{title:"name",type:"text",sort:!0,filter:!0},url:{title:"link",type:"text",sort:!0,filter:!0,class:"column-25"}}};constructor(e,n,i,s,d,u,v,f,w,G){this.clubsService=e,this.apiSponsorsService=n,this.appService=i,this.activatedRoute=s,this.router=d,this.globalVars=u,this._modalService=v,this.modalService=f,this._translate=w,this.dialog=G,this.getTranslations(),this.subscription.add(this.appService.subscribe("deleteSponsor",k=>{this.deleteSponsor(k)}
1)),this.subscription.add(this.appService.subscribe("delete-sponsor-category",k=>{this.apiSponsorsService.deleteSponsorCategory(k.id).subscribe(So=>{this.appService.broadcast("refreshData",{});const mt=this.sponsorTable.findIndex(go=>go.id===k.id);mt>-1&&this.sponsorTable.splice(mt,1),this.showAlert("success","module.sponsors.deleted_category"),this.appService.broadcast("close-modal")})})),this.subscription.add(this.appService.subscribe("updateSponsor",()=>{this.showAlert("success","module.publications.changes_saved"),this.updateSponsorTablesAfterDialogClose()}))}translations={sponsors:"Sponsors",sponsorPageVisibility:"",footerVisibility:"",hidden:""};getTranslations(){var e=this;return(0,y.A)(function*(){e.translations.sponsors=yield e._translate.getTranslation("global.common.sponsors"),e.translations.sponsorPageVisibility=yield e._translate.getTranslation("module.sponsor.sponsorPageVisibility"),e.translations.hidden=yield e._translate.getTranslation("global.common.hidden"),e.translations.footerVisibility="Footer"})()}sponsorTableDropDownOption=[{title:"",condition:()=>!0,opts:[{label:"global.common.edit",icon:"fa-light fa-edit",action:e=>this.editCategory(e),condition:e=>!0,disabled:e=>!1},{label:"module.sponsors.order_it_sponsors",icon:"fa-light fa-arrow-up-arrow-down",action:e=>this.orderSponsors(e),condition:e=>!0,disabled:e=>!1}]},{title:"",condition:()=>!0,opts:[{label:"global.common.remove",icon:"fa-light fa-trash",action:e=>
1this.deleteCategory(e),condition:e=>!0,disabled:e=>e.children.length>0}]}];ngOnDestroy(){this.multipleActionsSubscription.unsubscribe(),this.subscription.unsubscribe()}ngOnInit(){if(this.loading=!0,this.isUFE="UFE"===this.clubsService.getClubData().type,this.isUFE&&(this.notFoundMesasage="module.sponsors.no_federation"),this.activatedRoute.snapshot.queryParams.saved){this.saved=!0;let e=this.activatedRoute.snapshot.queryParams.saved;this.isUFE&&"sponsor"==this.activatedRoute.snapshot.queryParams.saved&&(e="federation"),this.message=this.messageTypes[e]}this.getData()}getData(){var e=this;return(0,y.A)(function*(){let n=yield e.apiSponsorsService.getSponsorTable(e.sectionId);e.sponsorTable=n,e.sponsorTable.forEach(i=>{i.table={...e.tableSettings,id:i.id,multipleSelect:{...e.tableSettings.multipleSelect}},i.children.forEach(s=>{delete s.footerVisibility,delete s.sponsorPageVisibility,s.catId=i.id})}),e.loading=!1})()}showAlert(e,n){this.alertType=e,this.message=n,this.appService.broadcast("showAlert",{state:e,mainTitle:n,autoHide:!0})}addCategoryModal(){var e=this;return(0,y.A)(function*(){(yield e.modalService.openModal({component:et,modalSize:"medium",data:{},options:{}})).data&&(e.showAlert("success","module.sponsors.category-created"),e.updateSponsorTablesAfterDialogClose())})()}editCategory(e){var n=this;return(0,y.A)(function*(){let i=yield n.modalService.openModal({component:et,modalSize:"medium",data:{category:e},options:{}});if(i.data){n.showAlert("success","module.publications.changes_saved");let s={children:e.children,table:e.table,...i.data};n.sponsorTable=n.sponsorTable.map(d=>d.id===e.id?s:d)}})()}order(){var e=this;return(0,y.A)(function*(){let n=yield e._modalService.openModal({component:z.c,modalSize:"lg",data:{tableRows:e.sponsorTable.map(i=>({...i,children:[]})),canHaveChildren:!1},options:{}});n.data&&(e.sponsorTable=n.data.map(i=>({...i,children:e.sponsorTable.find(s=>s.id===i.id).children,table:e.sponsorTable.find(s=>s.id===i.id).table})),e.changeCategoryOrder())})()}changeCategoryOrder(){let e=[];this.sponsorTable.forEach((n,i)=>{e.push({id:n.id,order:i+1})}),this.apiSponsorsService.updateCategoryOrder(e,this.sectionId).subscribe(n=>{this.clubsService.updateSponsorsList(e),this.showAlert("success","module.sponsors.updated"),this.appService.broadcast("refreshData",{})})}deleteCategory(e){0==e.children.length&&this.dialog.open(D.w,{panelClass:"modal-md",data:{type:"delete-sponsor",wait:!0,broadcast:"delete-sponsor-category",rows:e}})}updateSponsorTablesAfterDialogClose(){this.loading=!0,this.getData()}addSponsorModal(){var e=this;return(0,y.A)(function*(){(yield e.modalService.openModal({component:ot,modalSize:"medium",data:{categories:e.sponsorTable},options:{}})).data&&(e.showAlert("success","module.sponsors.created"),e.updateSponsorTablesAfterDialogClose())})()}orderSponsors(e){var n=this;return(0,y.A)(function*(){let i=yield n._modalService.openModal({component:z.c,modalSize:"lg",data:{tableRows:e.children,canHaveChildren:!1},options:{}});i.data&&(e.children=i.data,n.sponsorTable=n.sponsorTable.map(s=>s.id===e?e:s),n.changeSponsorOrders())})()}changeSponsorOrders(){let e=[];this.sponsorTable.forEach(n=>{let i={children:[],id:n.id};n.children.forEach((s,d)=>{i.children.push({order:d,id:s.id})}),e.push(i)}),this.apiSponsorsService.updateSponsorList(e,this.sectionId).subscribe(n=>{this.appService.broadcast("refreshData",{}),this.showAlert("success","module.sponsors.updated")})}changeSponsorVisible(e,n,i){let s="show"==n;e.visibility=s,this.apiSponsorsService.setSponsorVisible(s,e.id).subscribe(d=>{this.appService.broadcast("refreshData",{}),this.showAlert("success","module.sponsors.updated")})}deleteSponsor(e){this.dialog.open(D.w,{panelClass:"modal-md",data:{type:"remove-sponsors"}}).afterClosed().subscribe(i=>{1==i&&this.remove([e])})}selectMultipleAction(e){var n=this;return(0,y.A)(function*({key:i,rows:s}){let d=null;switch(i){case"show":d=n.dialog.open(D.w,{panelClass:"modal-md",data:{type:"show-sponsors",wait:!0}}),d.afterClosed().subscribe(()=>{null!=n.multipleActionsSubscription&&n.multipleActionsSubscription.unsubscribe()}),n.multipleActionsSubscription=n.appService.subscribe("show-sponsors",u=>n.changeVisibility(s,!0));break;case"hide":d=n.dialog.open(D.w,{panelClass:"modal-md",data:{type:"hide-sponsors",wait:!0}}),d.afterClosed().subscribe(()=>{null!=n.multipleActionsSubscription&&n.multipleActionsSubscription.unsubscribe()}),n.multipleActionsSubscription=n.appService.subscribe("hide-sponsors",u=>n.changeVisibility(s,!1));break;case"remove":d=n.dialog.open(D.w,{panelClass:"modal-md",data:{type:"remove-sponsors",wait:!0}}),d.afterClosed().subscribe(()=>{null!=n.multipleActionsSubscription&&n.multipleActionsSubscription.unsubscribe()}),n.multipleActionsSubscription=n.appService.subscribe("remove-sponsors",u=>n.remove(s))}}).apply(this,arguments)}changeVisibility(e,n){this.apiSponsorsService.setSponsorVisible(n,e.map(i=>i.id)).subscribe(i=>{let s=this.tables.find(d=>d.tableData.includes(e[0]));for(let d of e){let u=s.tableData.find(G=>
1G.id===d.id),v={...u};v.visibility=n,s.tableDataSource.update(u,v),this.sponsorTable.find(G=>null!=G.children.find(k=>k.id===d.id)).children.find(G=>G.id===d.id).visibility=n}this.appService.broadcast("close-modal",null),null!=this.multipleActionsSubscription&&this.multipleActionsSubscription.unsubscribe(),this.showAlert("success","module.sponsors.updated")})}remove(e){let n=this.tables.find(i=>i.tableData.includes(e[0]));this.apiSponsorsService.deleteSponsor(e.map(i=>i.id)).subscribe(i=>{n.tableDataSource.removeSome(e);for(let s of e){let d=this.sponsorTable.find(v=>null!=v.children.find(f=>f.id===s.id)),u=d.children.find(v=>v.id===s.id);d.children.splice(d.children.indexOf(u),1)}this.appService.broadcast("refreshData",{}),this.appService.broadcast("close-modal",null),null!=this.multipleActionsSubscription&&this.multipleActionsSubscription.unsubscribe(),this.showAlert("success",this.isUFE?"module.sponsors.federation_deleted":"module.sponsors.deleted")})}editSponsor(e,n){var i=this;return(0,y.A)(function*(){let s=yield i.modalService.openModal({component:ot,modalSize:"medium",data:{sponsor:n,categories:i.sponsorTable},options:{}});if(s.data){let d=s.data;if(d.listId=n.id,d.catId!==n.catId){let u=i.sponsorTable.find(f=>f.id===n.catId);u&&(u.children=u.children.filter(f=>f.id!==n.id)),i.sponsorTable=i.sponsorTable.map(f=>f.id===u.id?u:f);let v=i.sponsorTable.find(f=>f.id===d.catId);v&&(v.children=[d,...v.children]),i.sponsorTable=i.sponsorTable.map(f=>f.id===v.id?v:f)}else i.upDateRow(n,d);i.appService.broadcast("showAlert",{state:"success",mainTitle:"",autoHide:!0})}})()}upDateRow(e,n){let i=this.sponsorTable.find(s=>s.id===e.catId);i&&(i.children=i.children.map(s=>s.id===e.id?n:s),this.sponsorTable=this.sponsorTable.map(s=>s.id===i.id?i:s)),this.appService.broadcast("showAlert",{state:"success",mainTitle:"",autoHide:!0})}disableSponsor(e,n,i){this.apiSponsorsService.setSponsorVisible(i,n.id).subscribe({next:s=>{let d=n;d.visibility=i,this.upDateRow(n,d)}})}description(e){let n=[];return e.sponsorPageVisibility&&n.push(this.translations?.sponsorPageVisibility),e.footerVisibility&&n.push(this.translations?.footerVisibility),!e.footerVisibility&&!e.sponsorPageVisibility&&n.push("Oculto"),[this.translations?.sponsors,n.join(", ")].join(" - ")}static \u0275fac=function(n){return new(n||o)(t.rXU(T.X),t.rXU(S.L),t.rXU(R.d),t.rXU($.nX),t.rXU($.Ix),t.rXU(I.Y),t.rXU(P.M),t.rXU(P.M),t.rXU(W.T),t.rXU(C.h))};static \u0275cmp=t.VBU({type:o,selectors:[["app-sponsor-list"]],viewQuery:function(n,i){if(1&n&&t.GBs(H.YT,5),2&n){let s;t.mGM(s=t.lsd())&&(i.tables=s)}},standalone:!1,decls:5,vars:10,consts:[[4,"ngIf"],[3,"click","button"],[1,"admin-actions"],["type","icon","config","onlyicon","size","sm",3,"buttonAction","tooltip","icon"],["class","tables",4,"ngIf"],["tooltip","module.sponsors.order_it_cats","type","icon","config","onlyicon","size","sm",3,"click","iconLeft","icon"],["type","icon","config","onlyicon","size","sm",3,"buttonAction","tooltip","iconLeft","icon"],["type","button","config","main","size","sm",1,"hidden-sm",3,"buttonAction","label","iconLeft","icon"],["svgImage","file-searching","buttonType","button","buttonConfig","main",3,"buttonAction","size","textArray","noButton","buttonText","icon"],[1,"tables"],["class","sponsor-table",4,"ngFor","ngForOf"],[1,"sponsor-table"],[1,"each-table-header"],["class","icon",4,"ngIf"],[3,"descriptionNumber","customActions","titleClass","mainTitle","description","hasPaddingLeft"],[3,"click","hasSections","sectionOptions","value"],[3,"onSelectAllActionClicked","onRowClicked","settings","source"],[1,"icon"],[1,"fa-light","fa-eye-slash"]],template:function(n,i){1&n&&(t.DNE(0,re,1,0,"app-skeleton-table",0)(1,ue,6,5,"ng-container",0),t.j41(2,"app-clupik-floating-button",1),t.nI1(3,"translate"),t.nI1(4,"translate"),t.bIt("click",function(){return i.addSponsorModal()}),t.k0s()),2&n&&(t.Y8G("ngIf",i.loading),t.R7$(),t.Y8G("ngIf",!i.loading),t.R7$(),t.Y8G("button",t.eq3(8,se,i.isUFE?"module.sponsors.add_federation":"module.sponsors.add_sponsor")),t.BMQ("aria-label",i.isUFE?t.bMT(4,6,"module.sponsors.add_federation"):t.bMT(3,4,"module.sponsors.add_sponsor")))}
1,dependencies:[g.Sq,g.bT,H.YT,te.X,B.U,ee.q,oe.q,ne.p,ie.P,m.D9],styles:[".admin-actions[_ngcontent-%COMP%]{display:flex;align-items:center;padding:12px 0;justify-content:flex-end}.tables[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start}.tables[_ngcontent-%COMP%]   .sponsor-table[_ngcontent-%COMP%]{width:100%;margin-bottom:calc(var(--module) * 1.5)}.tables[_ngcontent-%COMP%]   .sponsor-table[_ngcontent-%COMP%]   app-clupik-state-bar[_ngcontent-%COMP%]{display:block;margin-top:var(--module)}.tables[_ngcontent-%COMP%]   .sponsor-table[_ngcontent-%COMP%]   .each-table-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px}.tables[_ngcontent-%COMP%]   .sponsor-table[_ngcontent-%COMP%]   .each-table-header[_ngcontent-%COMP%]   .icon[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:28px;min-width:28px;max-width:28px;height:28px}.tables[_ngcontent-%COMP%]   .sponsor-table[_ngcontent-%COMP%]   .each-table-header[_ngcontent-%COMP%]   .icon[_ngcontent-%COMP%]   .fa-light[_ngcontent-%COMP%]{color:var(--text-medium, #555b6d);font-size:24px;line-height:28px;display:flex;align-items:center;justify-content:center}"]})}return o})();var fe=a(573),he=a(93692),nt=a(33746),j=a(23620),be=a(3543),_e=a(53986);function ve(o,r){1&o&&t.nrm(0,"app-skeleton-block")}function Se(o,r){if(1&o){const e=t.RV6();t.j41(0,"div",23),t.nrm(1,"img",24),t.j41(2,"div",25)(3,"button",26),t.bIt("click",function(){l.eBV(e);const i=t.XpG(2);return l.Njj(i.deleteImage())}),t.nrm(4,"i",27),t.k0s(),t.j41(5,"button",28),t.bIt("click",function(i){l.eBV(e);const s=t.XpG(2);return l.Njj(s.addImage(i))}),t.nrm(6,"i",29),t.k0s()()()}if(2&o){const e=t.XpG(2);t.R7$(),t.Y8G("src",e.image.value,t.B4B)}}function ye(o,r){if(1&o){const e=t.RV6();t.j41(0,"button",30),t.nI1(1,"translate"),t.bIt("click",function(i){l.eBV(e);const s=t.XpG(2);return l.Njj(s.addImage(i))}),t.nrm(2,"i",31),t.j41(3,"span"),t.EFF(4),t.nI1(5,"translate"),t.k0s()()}2&o&&(t.BMQ("aria-label",t.bMT(1,2,"global.common.upload_image")),t.R7$(4),t.JRh(t.bMT(5,4,"global.button.upload_image")))}function Ce(o,r){1&o&&(t.j41(0,"span"),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&o&&(t.R
17$(),t.JRh(t.bMT(2,1,"global.validator.required")))}function Te(o,r){if(1&o&&(t.j41(0,"mat-error",32),t.DNE(1,Ce,3,3,"span",5),t.k0s()),2&o){const e=t.XpG(2);t.R7$(),t.Y8G("ngIf",e.formGroup.get("name").hasError("required"))}}function Ie(o,r){if(1&o&&(t.j41(0,"mat-option",36),t.EFF(1),t.k0s()),2&o){const e=r.$implicit;t.Y8G("value",e.id),t.R7$(),t.JRh(null==e?null:e.name)}}function Re(o,r){1&o&&(t.j41(0,"span"),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&o&&(t.R7$(),t.JRh(t.bMT(2,1,"global.validator.required")))}function Ge(o,r){if(1&o&&(t.j41(0,"mat-error",32),t.DNE(1,Re,3,3,"span",5),t.k0s()),2&o){const e=t.XpG(3);t.R7$(),t.Y8G("ngIf",e.formGroup.get("category").hasError("required"))}}function ke(o,r){if(1&o&&(t.j41(0,"div",33)(1,"mat-form-field",18)(2,"mat-label"),t.EFF(3),t.nI1(4,"translate"),t.k0s(),t.j41(5,"mat-select",34),t.nI1(6,"translate"),t.DNE(7,Ie,2,2,"mat-option",35),t.k0s(),t.DNE(8,Ge,2,1,"mat-error",20),t.k0s()()),2&o){const e=t.XpG(2);t.R7$(3),t.JRh(t.bMT(4,4,"global.placeholder.category")),t.R7$(2),t.Y8G("placeholder",t.bMT(6,6,"global.placeholder.category")),t.R7$(2),t.Y8G("ngForOf",e.categories),t.R7$(),t.Y8G("ngIf",e.formGroup.get("category").touched||e.isSubmitted)}}function xe(o,r){if(1&o){const e=t.RV6();t.j41(0,"form",11)(1,"div",12)(2,"div",13),t.DNE(3,Se,7,1,"div",14)(4,ye,6,6,"button",15),t.k0s()(),t.j41(5,"mat-slide-toggle",16),t.bIt("change",function(i){l.eBV(e);const s=t.XpG();return l.Njj(s.changeVisibility(i))}),t.EFF(6),t.nI1(7,"translate"),t.nI1(8,"translate"),t.k0s(),t.j41(9,"div",17)(10,"mat-form-field",18)(11,"mat-label"),t.EFF(12),t.nI1(13,"translate"),t.k0s(),t.nrm(14,"input",19),t.nI1(15,"translate"),t.DNE(16,Te,2,1,"mat-error",20),t.k0s()(),t.j41(17,"div",17)(18,"mat-form-field",18)(19,"mat-label"),t.EFF(20),t.nI1(21,"translate"),t.k0s(),t.nrm(22,"input",21),t.nI1(23,"translate"),t.k0s()(),t.DNE(24,ke,9,8,"div",22),t.k0s()}if(2&o){const e=t.XpG();t.Y8G("formGroup",e.formGroup),t.R7$(3),t.Y8G("ngIf",null!=e.image.value&&""!=e.image.value),t.R7$(),t.Y8G("ngIf",null==e.image.value||""==e.image.value),t.R7$(2),t.JRh("Sponsor "+(e.sponsorVisible?t.bMT(8,12,"global.common.visible"):t.bMT(7,10,"global.common.hidden"))),t.R7$(6),t.JRh(t.bMT(13,14,"global.placeholder.name")),t.R7$(2),t.Y8G("placeholder",t.bMT(15,16,"global.placeholder.name")),t.R7$(2),t.Y8G("ngIf",e.formGroup.get("name").touched||e.isSubmitted),t.R7$(4),t.JRh(t.bMT(21,18,"module.sponsors.link_to_site")),t.R7$(2),t.Y8G("placeholder",t.bMT(23,20,"module.sponsors.link_to_site")),t.R7$(2),t.Y8G("ngIf",!e.edit)}}function Ae(o,r){1&o&&(t.j41(0,"span"),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&o&&(t.R
17$(),t.JRh(t.bMT(2,1,"global.button.save")))}function Ve(o,r){1&o&&(t.j41(0,"span"),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&o&&(t.R7$(),t.SpI("",t.bMT(2,1,"global.button.saving")," ..."))}let it=(()=>{class o{imageDocument;apiSponsorsService;clubsService;formBuilder;data;appService;modalService;dialogRef;loadSponsor=!1;title="global.title.create_sponsor";formGroup;edit=!1;categories;sending=!1;sponsorVisible=!1;image={value:"",hasImage:!1};literalKey="notUFE";sponsor;editId;isUFE;literals={UFE:{new:"global.title.create_federation",edit:"global.title.edit_federation",image:"module.federation.federation_image"},notUFE:{new:"global.title.create_sponsor",edit:"global.title.edit_sponsor",image:"module.sponsors.sponsor_image"}};constructor(e,n,i,s,d,u,v,f){this.imageDocument=e,this.apiSponsorsService=n,this.clubsService=i,this.formBuilder=s,this.data=d,this.appService=u,this.modalService=v,this.dialogRef=f}ngOnInit(){var e=this;return(0,y.A)(function*(){e.isUFE="UFE"===e.clubsService.getClubData().type,e.isUFE&&(e.literalKey="UFE"),e.data.id?(e.title=e.literals[e.literalKey].edit,e.editId=e.data.id,e.edit=!0,e.sponsor=e.data.sponsor,e.image.value=e.apiSponsorsService.getSponsorImage(e.editId),e.image.hasImage=!0):e.title=e.literals[e.literalKey].new,e.sponsor||(e.sponsor={}),e.formGroup=e.formBuilder.group({name:[e.sponsor.name||"",c.k0.required],url:[e.sponsor.url||""],img:[e.sponsor.img||"",c.k0.required],category:[e.edit?-1:"",c.k0.required],visibility:[e.sponsor.visibility||!1]}),e.sponsorVisible=e.sponsor.visibility,e.categories=yield e.apiSponsorsService.getSponsorTable(),e.loadSponsor=!0})()}cancelEdit(){this.dialogRef.close(!1)}changeVisibility(e){this.sponsorVisible=e.checked}onEndForm({value:e,valid:n}){if(n)this.sending=!0,this.edit?(delete e.category,this.apiSponsorsService.updateSponsor(e,this.editId).subscribe({next:i=>{let s=i.sponsor;s.visibility=e.visibility,this.changeVisbility(s)},error:i=>{this.sending=!1}})):this.apiSponsorsService.createSponsor(e).subscribe({next:i=>{let s=i.sponsor;s.visibility=e.visibility,this.editId=s.id,this.changeVisbility(s)},error:i=>{this.sending=!1}});else for(let i in this.formGroup.controls)this.formGroup.controls[i].markAsTouched()}changeVisbility(e){this.apiSponsorsService.setSponsorVisible(e.visibility,this.editId).subscribe({next:()=>{this.appService.broadcast("showAlert",{state:"success",mainTitle:"",autoHide:!0}),this.dialogRef.close(e)}})}addImage(){var e=this;return(0,y.A)(function*(){let n=yield e.modalService.openModal({component:fe.y,modalSize:"lg",data:{data:{fileTypes:["jpg","jpeg","png"],title:"module.shared.files_import.select_image_message"}},options:{}});n.data&&(e.image.value=n.data.base64,e.image.hasImage=!0,e.formGroup.get("img").setValue(e.image.value))})()}deleteImage(){this.image.hasImage=!1,this.image.value="",this.formGroup.get("img").setValue(this.image.value)}static \u0275fac=function(n){return new(n||o)(t.rXU(C.h),t.rXU(S.L),t.rXU(T.X),t.rXU(c.ok),t.rXU(C.e),t.rXU(R.d),t.rXU(P.M),t.rXU(C.k))};static \u0275cmp=t.VBU({type:o,selectors:[["app-sponsor-add"]],standalone:!1,decls:24,vars:17,consts:[[1,"modal-clupik"],["mat-dialog-title","mat-dialog-title"],[1,"title"],["mat-button","mat-button","mat-dialog-close","mat-dialog-close",1,"exit-button"],[1,"fix-content"],[4,"ngIf"],[3,"formGroup",4,"ngIf"],[1,"actions-right","modal-fixed-actions"],[1,"btn-close",3,"click"],["mat-raised-button","mat-raised-button","type","button",1,"btn-primary-outline",3,"click"],["mat-raised-button","mat-raised-button",1,"btn-primary",3,"click","disabled"],[3,"formGroup"],[1,"form-row"],[1,"sponsor-image-container"],["class","sponsor-image",4,"ngIf"],["class","upload-image-btn","type","button",3,"click",4,"ngIf"],["formControlName","visibility",3,"change"],[1,"form-row-outlined"],["appearance","outline"],["id","name","matInput","matInput","formControlName","name","required","required",3,"placeholder"],["align","start",4,"ngIf"],["id","name","matInput","matInput","formControlName","url",3,"placeholder"],["class","form-row-outlined select-row",4,"ngIf"],[1,"sponsor-image"],["appLazyLoadImage","appLazyLoadImage","type","default",3,"src"],[1,"image-actions"],[1,"btn-image-edit",3,"click"],[1,"fa-solid","fa-tras
1h"],["type","button",1,"btn-image-edit",3,"click"],[1,"fa-solid","fa-edit"],["type","button",1,"upload-image-btn",3,"click"],[1,"fa-solid","fa-image"],["align","start"],[1,"form-row-outlined","select-row"],["id","category-select","formControlName","category","required","required",3,"placeholder"],[3,"value",4,"ngFor","ngForOf"],[3,"value"]],template:function(n,i){1&n&&(t.j41(0,"div",0)(1,"div",1)(2,"div",2),t.EFF(3),t.nI1(4,"translate"),t.k0s(),t.j41(5,"button",3),t.EFF(6,"\xd7"),t.k0s()(),t.j41(7,"mat-dialog-content",4),t.DNE(8,ve,1,0,"app-skeleton-block",5)(9,xe,25,22,"form",6),t.k0s()(),t.j41(10,"div",7)(11,"button",8),t.bIt("click",function(){return i.cancelEdit()}),t.EFF(12),t.nI1(13,"translate"),t.k0s(),t.j41(14,"div",2),t.EFF(15),t.nI1(16,"translate"),t.k0s(),t.j41(17,"button",9),t.bIt("click",function(){return i.cancelEdit()}),t.j41(18,"span"),t.EFF(19),t.nI1(20,"translate"),t.k0s()(),t.j41(21,"button",10),t.bIt("click",function(){return i.onEndForm(i.formGroup)}),t.DNE(22,Ae,3,3,"span",5)(23,Ve,3,3,"span",5),t.k0s()()),2&n&&(t.R7$(3),t.JRh(t.bMT(4,9,i.title)),t.R7$(5),t.Y8G("ngIf",!i.loadSponsor),t.R7$(),t.Y8G("ngIf",i.loadSponsor),t.R7$(3),t.JRh(t.bMT(13,11,"global.common.cancel")),t.R7$(3),t.JRh(t.bMT(16,13,i.title)),t.R7$(4),t.JRh(t.bMT(20,15,"global.button.cancel")),t.R7$(2),t.Y8G("disabled",i.sending),t.R7$(),t.Y8G("ngIf",!i.sending),t.R7$(),t.Y8G("ngIf",i.sending))},dependencies:[g.Sq,g.bT,he.M,h.$z,C.a,C.b,C.c,nt.fg,j.j,j.M,j.b,be.g,A.sG,c.qT,c.me,c.BC,c.cb,c.YS,c.j4,c.JD,_e.J,E.K,m.D9],styles:[".form-row[_ngcontent-%COMP%], .actions-left[_ngcontent-%COMP%]{margin-bottom:.75em}.sponsor-image-container[_ngcontent-%COMP%]{min-height:200px;width:100%;display:flex;align-items:center;justify-content:center;position:relative}.sponsor-image-container[_ngcontent-%COMP%]   .sponsor-image[_ngcontent-%COMP%], .sponsor-image-container[_ngcontent-%COMP%]   .sponsor-image[_ngcontent-%COMP%]   img[_ngcontent-%COMP%]{width:100%}.sponsor-image-container[_ngcontent-%COMP%]   .sponsor-image[_ngcontent-%COMP%]   .image-actions[_ngcontent-%COMP%]{display:flex;position:absolute;bottom:0;right:0;padding:1em}"]})}return o})();var je=a(54423),Me=a(62467),we=a(29605);const Ee=()=>["sponsorship"];function De(o,r){if(1&o&&(t.nrm(0,"app-alerts",4),t.nI1(1,"translate")),2&o){const e=t.XpG();t.Y8G("mensaje",t.bMT(1,1,e.warningVisible))}}let $e=(()=>{class o{apiSponsorsService;globalVars;apiSubscriptionService;clubsService;noVisible=!1;isUFE=!1;warningVisible="module.sponsors.warning_visibility";constructor(e,n,i,s){this.apiSponsorsService=e,this.globalVars=n,this.apiSubscriptionService=i,this.clubsService=s}ngOnInit(){this.isUFE="UFE"===this.clubsService.getClubData().type,this.apiSponsorsService.getSponsorConfig().subscribe(e=>{this.noVisible=!e.visibility}),setTimeout(()=>{this.globalVars.navbarTop.title=this.isUFE?"global.title.federations":"global.title.sponsors"})}static \u0275fac=function(n){return new(n||o)(t.rXU(S.L),t.rXU(I.Y),t.rXU(je.P),t.rXU(T.X))};static \u0275cmp=t.VBU({type:o,selectors:[["app-sponsor-general"]],standalone:!1,decls:5,vars:3,consts:[[3,"features"],[1,"dashboard"],["navbar","navbarSponsor"],["dismissable","true","type","warning",3,"mensaje",4,"ngIf"],["dismissable","true","type","warning",3,"mensaje"]],template:function(n,i){1&n&&(t.j41(0,"app-clupik-feature-lock",0)(1,"div",1),t.nrm(2,"app-navbar-tabs",2),t.DNE(3,De,2,3,"app-alerts",3),t.nrm(4,"router-outlet"),t.k0s()()),2&n&&(t.Y8G("features",t.lJ4(2,Ee)),t.R7$(3),t.Y8G("ngIf",i.noVisible))},dependencies:[g.bT,Me.O,$.n3,p.Z,we.n,m.D9],styles:[".actions-only-mobile[_ngcontent-%COMP%]{margin-bottom:5px;margin-right:10px}"]})}return o})();var Fe=a(18594);const Ye=(o,r,e)=>({topbar:o,bread:r,topbread:e});let Xe=(()=>{class o{globalVars;clubService;activatedRoute;breadCrumbs;appService;constructor(e,n,i,s,d){this.globalVars=e,this.clubService=n,this.activatedRoute=i,this.breadCrumbs=s,this.appService=d}ngOnInit(){}static \u0275fac=function(n){return new(n||o)(t.rXU(I.Y),t.rXU(T.X),t.rXU($.nX),t.rXU(Fe.E),t.rXU(R.d))};static \u0275cmp=t.VBU({type:o,selectors:[["app-sponsor"]],standalone:!1,decls:2,vars:5,consts:[[1,"navtabs-dashboard",3,"ngClass"]],template:function(n,i){1&n&&(t.j41(0,"div",0),t.nrm(1,"router-outlet"),t.k0s()),2&n&&t.Y8G("ngClass",t.sMw(1,Ye,i.clubService.isTopBar()&&!i.breadCrumbs.hasBreadcrumbs(),i.breadCrumbs.hasBreadcrumbs()&&i.clubService.onlyBread(),i.breadCrumbs.hasBreadcrumbs()&&i.clubService.isTopBar()))},dependencies:[g.YU,$.n3],encapsulation:2})}return o}
1)();var Be=a(38968),st=a(54843);const Pe=(o,r)=>({"ios-browser":o,"android-browser":r}),Ue=()=>({length:30});function Oe(o,r){1&o&&t.nrm(0,"app-skeleton-block")}function Ne(o,r){1&o&&(t.j41(0,"span"),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&o&&(t.R7$(),t.JRh(t.bMT(2,1,"global.validator.required")))}function Le(o,r){1&o&&(t.j41(0,"span"),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&o&&(t.R7$(),t.JRh(t.i5U(2,1,"global.validator.max_length",t.lJ4(4,Ue))))}function Je(o,r){if(1&o&&(t.j41(0,"mat-error",19),t.DNE(1,Ne,3,3,"span",5)(2,Le,3,5,"span",5),t.k0s()),2&o){const e=t.XpG(2);t.R7$(),t.Y8G("ngIf",e.formGroup.get("name").hasError("required")),t.R7$(),t.Y8G("ngIf",e.formGroup.get("name").hasError("maxlength"))}}function ze(o,r){if(1&o&&(t.j41(0,"form",11)(1,"div",12)(2,"mat-form-field",13)(3,"mat-label"),t.EFF(4),t.nI1(5,"translate"),t.k0s(),t.nrm(6,"input",14),t.nI1(7,"translate"),t.j41(8,"mat-hint",15),t.EFF(9),t.k0s(),t.DNE(10,Je,3,2,"mat-error",16),t.k0s()(),t.j41(11,"div",17)(12,"mat-slide-toggle",18)(13,"span"),t.EFF(14),t.nI1(15,"translate"),t.k0s()()()()),2&o){const e=t.XpG();t.Y8G("formGroup",e.formGroup),t.R7$(4),t.JRh(t.bMT(5,6,"global.placeholder.name")),t.R7$(2),t.Y8G("placeholder",t.bMT(7,8,"global.placeholder.name")),t.R7$(3),t.SpI("",e.formGroup.get("name").value.length," / 50"),t.R7$(),t.Y8G("ngIf",e.formGroup.get("name").touched||e.isSubmitted),t.R7$(4),t.JRh(t.bMT(15,10,"module.sponsors.visible_web"))}}function He(o,r){1&o&&(t.j41(0,"span"),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&o&&(t.R
17$(),t.JRh(t.bMT(2,1,"global.button.save")))}function Ke(o,r){1&o&&(t.j41(0,"span"),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&o&&(t.R7$(),t.SpI("",t.bMT(2,1,"global.button.saving")," ..."))}let U=(()=>{class o{apiSectionsService;apiSponsorsService;appService;formBuilder;data;dialogRef;loadCategory=!1;title;sections;formGroup;edit=!1;editId;category;sending=!1;constructor(e,n,i,s,d,u){this.apiSectionsService=e,this.apiSponsorsService=n,this.appService=i,this.formBuilder=s,this.data=d,this.dialogRef=u}ngOnInit(){var e=this;return(0,y.A)(function*(){e.title="module.sponsors.create_category",e.data&&(e.title="module.sponsors.edit_category",e.editId=e.data.category.id,e.edit=!0,e.category=yield(0,st._)(e.apiSponsorsService.getSponsorCategory(e.editId))),e.category||(e.category={}),e.sections=yield(0,st._)(e.apiSectionsService.getAllSections()),e.formGroup=e.formBuilder.group({name:[e.category.name||"",[c.k0.required,c.k0.maxLength(30)]],visible:[e.category.visibility||!1]}),e.loadCategory=!0})()}cancelEdit(){this.dialogRef.close(!1)}onEndForm({value:e,valid:n}){if(n)this.sending=!0,e.sectionId=-1,this.edit?this.apiSponsorsService.updateSponsorCategory(e,this.editId).subscribe(i=>{this.dialogRef.close(i)}):this.apiSponsorsService.createSponsorCategory(e).subscribe(i=>{this.dialogRef.close(i)});else for(let i in this.formGroup.controls)this.formGroup.controls[i].markAsTouched()}static \u0275fac=function(n){return new(n||o)(t.rXU(Be.k),t.rXU(S.L),t.rXU(R.d),t.rXU(c.ok),t.rXU(C.e),t.rXU(C.k))};static \u0275cmp=t.VBU({type:o,selectors:[["app-sponsor-category-add"]],standalone:!1,decls:24,vars:21,consts:[[1,"modal-clupik"],["mat-dialog-title","mat-dialog-title"],[1,"title"],["mat-button","mat-button","mat-dialog-close","mat-dialog-close",1,"exit-button"],[1,"fix-content",3,"ngClass"],[4,"ngIf"],[3,"formGroup",4,"ngIf"],[1,"actions-right","modal-fixed-actions"],[1,"btn-close",3,"click"],["mat-raised-button","mat-raised-button","type","button",1,"btn-primary-outline",3,"click"],["mat-raised-button","mat-raised-button",1,"btn-primary",3,"click","disabled"],[3,"formGroup"],[1,"form-row-outlined"],["appearance","outline"],["id","name","matInput","matInput","formControlName","name","required","required",3,"placeholder"],["align","end"],["align","start",4,"ngIf"],[1,"form-row"],["formControlName","visible"],["align","start"]],template:function(n,i){1&n&&(t.j41(0,"div",0)(1,"div",1)(2,"div",2),t.EFF(3),t.nI1(4,"translate"),t.k0s(),t.j41(5,"button",3),t.EFF(6,"\xd7"),t.k0s()(),t.j41(7,"mat-dialog-content",4),t.DNE(8,Oe,1,0,"app-skeleton-block",5)(9,ze,16,12,"form",6),t.k0s()(),t.j41(10,"div",7)(11,"button",8),t.bIt("click",function(){return i.cancelEdit()}),t.EFF(12),t.nI1(13,"translate"),t.k0s(),t.j41(14,"div",2),t.EFF(15),t.nI1(16,"translate"),t.k0s(),t.j41(17,"button",9),t.bIt("click",function(){return i.cancelEdit()}),t.j41(18,"span"),t.EFF(19),t.nI1(20,"translate"),t.k0s()(),t.j41(21,"button",10),t.bIt("click",function(){return i.onEndForm(i.formGroup)}),t.DNE(22,He,3,3,"span",5)(23,Ke,3,3,"span",5),t.k0s()()),2&n&&(t.R7$(3),t.JRh(t.bMT(4,10,i.title)),t.R7$(4),t.Y8G("ngClass",t.l_i(18,Pe,null==i.appService?null:i.appService.isIosBrowser,null==i.appService?null:i.appService.isAndroidBrowser)),t.R7$(),t.Y8G("ngIf",!i.loadCategory),t.R7$(),t.Y8G("ngIf",i.loadCategory),t.R7$(3),t.JRh(t.bMT(13,12,"global.common.cancel")),t.R7$(3),t.JRh(t.bMT(16,14,i.title)),t.R7$(4),t.JRh(t.bMT(20,16,"global.button.cancel")),t.R7$(2),t.Y8G("disabled",i.sending),t.R7$(),t.Y8G("ngIf",!i.sending),t.R7$(),t.Y8G("ngIf",i.sending))},dependencies:[g.YU,g.bT,h.$z,C.a,C.b,C.c,nt.fg,j.j,j.M,j.c,j.b,A.sG,c.qT,c.me,c.BC,c.cb,c.YS,c.j4,c.JD,E.K,m.D9],encapsulation:2})}return o})();var at=a(38132);const We=[{path:"",component:Xe,children:[{path:"",component:$e,children:[{path:"",redirectTo:"list",pathMatch:"full"},{path:"config",component:J},{path:"list",component:ge}]},{path:"add",component:it},{path:":id",component:J},{path:"edit/:id",component:it},{path:"category/add",component:U},{path:"category/:id",component:U},{path:"category/edit/:id",component:U}]}];let rt=(()=>{class o{static \u0275fac=function(n){return new(n||o)};static \u0275mod=t.$C({type:o});
1static \u0275inj=l.G2t({imports:[at.iI.forChild(We),at.iI]})}return o})();var O=a(49189),Qe=a(11890),Ze=a(50630),qe=a(10290),to=a(8986),eo=a(99012),oo=a(97184),N=a(21867),no=a(56216),io=a(66456),so=a(32777),ao=a(481),ro=a(7030),lo=a(53803),lt=a(52280),ct=a(66124),pt=a(62470),dt=a(46536);let co=(()=>{class o{static \u0275fac=function(n){return new(n||o)};static \u0275mod=t.$C({type:o});static \u0275inj=l.G2t({imports:[g.MD,O.G,lt.s,ct.M,pt.k,dt.K,N.v]})}return o})(),po=(()=>{class o{static \u0275fac=function(n){return new(n||o)};static \u0275mod=t.$C({type:o});static \u0275inj=l.G2t({imports:[g.MD,O.G,lt.s,ct.M,pt.k,dt.K,N.v]})}return o})();var mo=a(6212);let uo=(()=>{class o{static \u0275fac=function(n){return new(n||o)};static \u0275mod=t.$C({type:o});static \u0275inj=l.G2t({providers:[S.L],imports:[g.MD,qe.P,eo.F,oo.l,O.G,Qe.g,to.z,Ze.j,c.YN,c.X1,no.S,io.c,rt,N.v,so.h,ao.R,ro.g,lo.j,co,po,mo.m,rt]})}return o})()},8986:(L,M,a)=>{a.d(M,{z:()=>c});var g=a(49189),R=a(85491),S=a(72200),T=a(73664),x=a(2615);let I=(()=>{class h{static \u0275fac=function(b){return new(b||h)};static \u0275mod=T.$C({type:h});static \u0275inj=x.G2t({providers:[R.L],imports:[S.MD,g.G,S.MD,g.G]})}return h})();var t=a(66456);a(20050);let c=(()=>{class h{static \u0275fac=function(b){return new(b||h)};static \u0275mod=T.$C({type:h});static \u0275inj=x.G2t({imports:[I,t.c]})}return h})()},85491:(L,M,a)=>{a.d(M,{L:()=>A});var g=a(10467),R=a(60152),S=a(29330),T=a(71985),x=a(18810),I=a(97647),t=a(96354),l=a(99437),c=a(45312),h=a(2615);let F=(()=>{class b{sponsors=null;constructor(){}setSponsors(p){this.sponsors=p}getSponsors(){return this.sponsors}static \u0275fac=function(m){return new(m||b)};static \u0275prov=h.jDH({token:b,factory:b.\u0275fac,providedIn:"root"})}return b})(),A=(()=>{class b{sponsorsService;http;clubsService;jsonHeaders=new S.Lr({"Content-Type":"application/json","Access-Control-Allow-Origin":"*"});apiUrl=c.c.api.URL+"/clubs";jsonHeadersNoCache=new S.Lr({"Content-Type":"application/json","clupik-cache":"no-cache"});constructor(p,m,_){this.sponsorsService=p,this.http=m,this.clubsService=_}getSponsors(){var p=this;return(0,g.A)(function*(){return null==p.sponsorsService.getSponsors()?yield p.getSponsorTable("-1",!0):p.sponsorsService.getSponsors()})()}getSponsorConfig(p=!1){return!p&&this.clubsService.getClubData().sponsorshipConfig?new T.c(m=>{m.next(this.clubsService.getClubData().sponsorshipConfig),m.complete()}):this.http.get(this.apiUrl+"/"+this.clubsService.getClubId()+"/sponsor/config",{headers:this.jsonHeaders}).pipe((0,I.u)(),(0,t.T)(m=>{const _=this.extractData(m),V=this.clubsService.getClubData();return V.sponsorshipConfig=_,this.clubsService.setClubData(V),_}),(0,l.W)(this.handleError))}updateSponsorConfig(p){return this.http.post(this.apiUrl+"/"+this.clubsService.getClubId()+"/sponsor/config",p,{headers:this.jsonHeaders}).pipe((0,t.T)(m=>{const _=this.extractData(m);return this.clubsService.getClubData().sponsorshipConfig=_,_}),(0,l.W)(this.handleError))}getSponsorTable(){var p=this;return(0,g.A)(function*(m=-1,_=!1){let V=yield p.http.get(`${p.apiUrl}/${p.clubsService.getClubId()}/sponsors/table?sectionId=${m}&publicView=${_}`,{headers:p.jsonHeaders}).pipe((0,t.T)(p.extractData),(0,l.W)(p.handleError)).toPromise();return V&&p.sponsorsService.setSponsors(V),p.sponsorsService.getSponsors()}).apply(this,arguments)}createSponsor(p){return this.http.post(this.apiUrl+"/"+this.clubsService.getClubId()+"/sponsor",p,{headers:this.jsonHeaders}).pipe((0,t.T)(this.extractData),(0,l.W)(this.handleError))}getSponsor(p){return this.http.get(this.apiUrl+"/"+this.clubsService.getClubId()+"/sponsor/"+p,{headers:this.jsonHeaders}).pipe((0,t.T)(m=>this.extractData(m)),(0,l.W)(this.handleError))}getSponsorCategory(p){return this.http.get(this.apiUrl+"/"+this.clubsService.getClubId()+"/sponsor/category/"+p,{headers:this.jsonHeaders}).pipe((0,t.T)(m=>this.extractData(m)),(0,l.W)(this.handleError))}createSponsorCategory(p){return(!p.section||-1==p.sectionId)&&(p.sectionId=null),this.http.post(this.apiUrl+"/"+this.clubsService.getClubId()+"/sponsor/category",p,{headers:this.jsonHeaders}).pipe((0,t.T)(this.extractData),(0,l.W)(this.handleError))}createNewSponsorCategory(p){return this.http.post(this.apiUrl+"/"+this.clubsService.getClubId()+"/sponsor/category",p,{headers:this.jsonHeaders})}updateCategoryOrder(p,m){return this.http.post(this.apiUrl+"/"+this.clubsService.getClubId()+"/sponsor/table/category?sectionId="+m,p,{headers:this.jsonHeaders}).pipe((0,t.T)(this.extractData),(0,l.W)(this.handleError))}updateSponsorList(p,m){return this.http.post(this.apiUrl+"/"+this.clubsService.getClubId()+"/sponsor/table?sectionId="+m,p,{headers:this.jsonHeaders}).pipe((0,t.T)(this.extractData),(0,l.W)(this.handleError))}updateSponsor(p,m){return this.http.patch(this.apiUrl+"/"+this.clubsService.getClubId()+"/sponsor_id/"+m,p,{headers:this.jsonHeaders}).pipe((0,t.T)(this.extractData),(0,l.W)(this.handleError))}getSponsorImage(p){return this.apiUrl+"/"+this.clubsService.getClubId()+"/sponsor/image/"+p}setSponsorCategoryVisible(p,m){const _={visible:p};return this.http.patch(this.apiUrl+"/"+this.clubsService.getClubId()+"/sponsor/category/visible?id="+m,_,{headers:this.jsonHeaders}).pipe((0,t.T)(this.extractData),(0,l.W)(this.handleError))}setSponsorVisible(p,m){const _={visible:p};return this.http.patch(this.apiUrl+"/"+this.clubsService.getClubId()+"/sponsor/visibility?id="+m,_,{headers:this.jsonHeaders}).pipe((0,t.T)(this.extractData),(0,l.W)(this.handleError))}updateSponsorCategory(p,m){return this.http.patch(this.apiUrl+"/"+this.clubsService.getClubId()+"/sponsor/category?id="+m,p,{headers:this.jsonHeaders}).pipe((0,t.T)(this.extractData),(0,l.W)(this.handleError))}updateCategory(p,m){return this.http.patch(this.apiUrl+"/"+this.clubsService.getClubId()+"/sponsor/category?id="+m,p,{headers:this.jsonHeaders})}deleteSponsor(p){return this.http.delete(this.apiUrl+"/"+this.clubsService.getClubId()+"/sponsor/"+p,{headers:this.jsonHeaders}).pipe((0,t.T)(this.extractData),(0,l.W)(this.handleError))}deleteSponsorCategory(p){return this.http.delete(this.apiUrl+"/"+this.clubsService.getClubId()+"/sponsor/category/"+p,{headers:this.jsonHeaders}).pipe((0,t.T)(this.extractData),(0,l.W)(this.handleError))}extractData(p){return p||{}}handleError(p){return console.error("An error occurred",p),(0,x.$)(p)}static \u0275fac=function(m){return new(m||b)(h.KVO(F),h.KVO(S.Qq),h.KVO(R.X))};static \u0275prov=h.jDH({token:b,factory:b.\u0275fac,providedIn:"root"})}return b})()}}]);

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.