PageSourceSearch

https://www.cbomeco.com/3707.f50352142134b702.js

js cbomeco.com collected 2026-09-24 14:43:19 UTC 34,232 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[3707],{7657:(F,b,n)=>{n.d(b,{v:()=>_t});var g=n(10467),C=n(60177),t=n(73664),p=n(89417),T=n(84412),y=n(7673),M=n(54843),x=n(68020),R=n(1460),w=n(27544),d=n(61448),s=n(6961),A=n(26742),D=n(573),k=n(25615),K=n(68010),W=n(60152),j=n(49189),X=n(35745),V=n(62470),N=n(7553),G=n(54107),H=n(19348),Q=n(48749),z=n(10971),U=n(50230),J=n(74418),S=n(2615),Y=n(75281),q=n(36229),Z=n(94474),_=n(95416),O=n(13443),r=n(82966),l=n(19735),u=n(96814),v=n(71660),E=n(89902),I=n(80954),B=n(5900),L=n(68018);const ot=m=>({required:m,placeholder:"module.athleteReports.visibility"}),nt=()=>["jpg","png","jpeg","xls","xlsx","pdf","csv","doc","docx"],rt=m=>({athleteFirstName:m}),at=m=>({id:"notify",name:m,hover:!1});function it(m,$){1&m&&t.nrm(0,"app-skeleton-block")}function lt(m,$){if(1&m&&(t.nrm(0,"app-clupik-user-select",2),t.nI1(1,"translate")),2&m){const e=t.XpG(2);t.Y8G("user",e.selectedUser$)("searchConfiguration",e.searchConfiguration)("placeholder",t.bMT(1,4,"module.athleteReports.select_athlete"))("admitMultiple",!1)}}function st(m,$){if(1&m&&(t.nrm(0,"app-input",5),t.nI1(1,"translate")),2&m){const e=t.XpG(2);t.Y8G("checkboxConfig",t.eq3(6,at,t.i5U(1,1,e.notifyLabelKey,t.eq3(4,rt,e.athleteFirstName))))}}function ct(m,$){1&m&&(t.j41(0,"div",11),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&m&&(t.R7$(),t.JRh(t.bMT(2,1,"global.validator.required")))}function dt(m,$){if(1&m){const e=t.RV6();t.j41(0,"form",1),t.nVh(1,lt,2,6,"app-clupik-user-select",2),t.j41(2,"app-form-row",3),t.nrm(3,"app-input",4),t.k0s(),t.nVh(4,st,2,8,"app-input",5),t.nrm(5,"app-form-section",6),t.j41(6,"app-clupik-upload-document",7),t.bIt("downloacAction",function(a){S.eBV(e);const i=t.XpG();return S.Njj(i.downloadDocument(a))}),t.k0s(),t.j41(7,"div",8)(8,"div",9),t.nrm(9,"div",10),t.k0s(),t.nVh(10,ct,3,3,"div",11),t.k0s()()}if(2&m){const e=t.XpG();t.Y8G("formGroup",e.reportForm),t.R7$(),t.vxM(e.selectAthlete?1:-1),t.R7$(),t.Y8G("items",1),t.R7$(),t.Y8G("isSelectMultiple",!1)("select",t.eq3(12,ot,e.reportForm.get("visibility").hasValidator(e.isRequired)))("selectOptions",e.visibilities),t.R7$(),t.vxM("athlete"===e.reportForm.get("visibility").value?4:-1),t.R7$(2),t.Y8G("documents",e.documents$)("admitMultiple",!0)("fileTypes",t.lJ4(14,nt)),t.R7$(3),t.Y8G("id",e.quillId),t.R7$(),t.vxM(e.reportForm.get("body").touched&&e.reportForm.get("body").hasError("required")?10:-1)}}let _t=(()=>{class m{globalVars;apiAthleteReportsService;apiUsersService;apiTeamsService;apiSeasonsService;modalCtrl;dialog;platformId;modalsService;snackBar;translationService;userService;authService;clubsService;imagesService;userId;reportId;title="module.athleteReports.new_report";isEdit=!1;loading=!0;saving=!1;reportForm;report=null;attachments=[];visibilities=[{id:"private",title:"module.athleteReports.private"},{id:"athlete",title:"module.athleteReports.athlete"}];isRequired=p.k0.required;athleteFirstName="";selectAthlete=!1;users=[];athleteHasTutors=!1;quillId="quill-athlete-report-"+Date.now()+"-"+Math.random().toString(36).substr(2,5);documents$=new T.t([]);selectedUser$=new T.t(null);coachAthletesCache=new Map;coachTeamIds=[];isLoadingCache=!1;isAdmin=!1;searchConfiguration={source:e=>!e||e.length<2?(0,y.of)([]):this.isAdmin?this.apiUsersService.usersSearch(e,!1,!1):this.coachTeamIds.length>0&&this.coachAthletesCache.size>0?this.getAthletesByCoachTeams(e):(0,y.of)([]),mapeo:e=>({id:e.id,name:`${e.firstName||""} ${e.lastName||""} ${e.secondSurname||""}`.trim(),description:e.email||e.username||"",avatar:this.imagesService.getUserClubLogoThumbnailUrl(e.id),active:!0,...e})};savedReportId=null;quillEditor;_quillEvent;quillInitialized=!1;constructor(e,o,a,i,c,h,f,P,tt,et,pt,ut,ht,mt,gt){this.globalVars=e,this.apiAthleteReportsService=o,this.apiUsersService=a,this.apiTeamsService=i,this.apiSeasonsService=c,this.modalCtrl=h,this.dialog=f,this.platformId=P,this.modalsService=tt,this.snackBar=et,this.translationService=pt,this.userService=ut,this.authService=ht,this.clubsService=mt,this.imagesService=gt}get notifyLabelKey(){return this.athleteHasTutors?"module.athleteReports.notify_with_tutors":"module.athleteReports.notify_athlete"}ngOnInit(){var e=this;return(0,g.A)(function*(){const o=e.userService.getData();if(e.athleteFirstName=null!=o&&null!=o.firstName?o.firstName:"",yield e.loadCoachData(),e.reportForm=new p.gE({body:new p.MJ("",p.k0.required),visibility:new p.MJ("private",p.k0.required),notify:new p.MJ({value:!1,disabled:!0}),userId:new p.MJ("")}),e.documents$.subscribe(i=>{for(const c of i)if(c.new&&c.file&&!e.attachments.some(f=>f.name===c.filename)){const f=e.dataUrlToFile(c.file,c.filename);f&&(console.log("\u{1f4ce} [SUBSCRIBE] Nuevo documento detectado:",f.name),e.addFileToQueue(f))}}),e.selectedUser$.subscribe(i=>{i&&(e.reportForm.get("userId").setValue(i.id),e.athleteFirstName=i.name||"",e.apiAthleteReportsService.getAthleteReportsMeta(i.id).subscribe({next:c=>{e.athleteHasTutors=c?.athleteHasTutors||!1},error:()=>{e.athleteHasTutors=!1}}))}),null==e.userId&&null==e.reportId&&(e.selectAthlete=!0),e.reportForm.get("visibility").valueChanges.subscribe(i=>{const c=e.reportForm.get("notify");e.isEdit||"athlete"!==i?(c.reset(!1,{emitEvent:!1}),c.disable({emitEvent:!1})):c.enable({emitEvent:!1})}),null!=e.reportId){e.isEdit=!0,e.title="module.athleteReports.edit_report",e.savedReportId=String(e.reportId);try{e.report=yield(0,M._)(e.apiAthleteReportsService.getAthleteReport(e.savedReportId)),e.reportForm.patchValue({body:e.report.body,visibility:e.report.visibility||"private"}),e.report.attachments&&e.report.attachments.length>0&&e.documents$.next(e.report.attachments.map(i=>({id:i.id,title:i.document?.name||i.name||"Documento",name:i.document?.name||i.name,filename:i.document?.name||i.name,documentId:i.documentId,type:i.document?.type||i.type,new:!1,deleted:!1,keep:!0})))}catch{return e.snackBar.open(yield e.translationService.getTranslation("module.athleteReports.load_error"),"X",{duration:4e3}),void e.modalCtrl.dismiss({success:!1})}}else if(null!=e.userId)try{const i=yield(0,M._)(e.apiAthleteReportsService.getAthleteReportsMeta(String(e.userId)
1));e.athleteHasTutors=null!=i&&!0===i.athleteHasTutors}catch{e.athleteHasTutors=!1}e.loading=!1,(0,C.UE)(e.platformId)&&setTimeout(()=>{e.initQuill()},500)})()}loadCoachData(){var e=this;return(0,g.A)(function*(){try{const o=e.authService.getMe();if(!o?.id)return e.coachTeamIds=[],void(e.isAdmin=!1);if(e.isAdmin=e.authService.isAdministrator()||e.authService.isSuperAdmin(),e.isAdmin)return void(e.coachTeamIds=[]);const i=(yield e.apiSeasonsService.getCurrentSeason())?.id||"-1",c=yield(0,M._)(e.apiUsersService.getTeamsByRol(["COA","COO"],o.id,i));e.coachTeamIds=c&&Array.isArray(c)&&c.length>0?c.map(h=>"string"==typeof h?h:String(h.id||h.team?.id||h)).filter(h=>h&&"undefined"!==h&&"null"!==h):[],e.coachTeamIds.length>0&&(yield e.loadAthletesCache())}catch(o){e.coachTeamIds=[],e.isAdmin=!1,console.warn("Error loading coach data:",o)}})()}loadAthletesCache(){var e=this;return(0,g.A)(function*(){if(!e.isLoadingCache){e.isLoadingCache=!0;try{e.clubsService.getClubId();for(const a of e.coachTeamIds)if(a&&"undefined"!==a&&"null"!==a)try{const i=yield(0,M._)(e.apiTeamsService.getTeamPlayers(a));e.coachAthletesCache.set(a,i||[])}catch(i){console.warn(`Error loading players for team ${a}:`,i),e.coachAthletesCache.set(a,[])}else console.warn(`\u23ed\ufe0f Saltando teamId inv\xe1lido: ${a}`)}catch(o){console.warn("Error loading athletes cache:",o)}finally{e.isLoadingCache=!1}}})()}getAthletesByCoachTeams(e){const o=[];for(const[f,P]of this.coachAthletesCache)P&&Array.isArray(P)&&o.push(...P);const a=new Map;o.forEach(f=>{a.has(f.id)||a.set(f.id,f)});const i=Array.from(a.values()),c=e.toLowerCase(),h=i.filter(f=>{const P=`${f.firstName||""} ${f.lastName||""} ${f.secondSurname||""}`.toLowerCase(),tt=(f.email||"").toLowerCase(),et=(f.username||"").toLowerCase();return P.includes(c)||tt.includes(c)||et.includes(c)});return(0,y.of)(h)}initQuill(){if(!this.quillInitialized&&(0,C.UE)(this.platformId))try{if(!document.getElementById(this.quillId))return console.warn("\u26a0\ufe0f Elemento Quill no encontrado, reintentando..."),void setTimeout(()=>this.initQuill(),300);const o=this.globalVars.getQuillPageToolbarReduced(!0,!1);if("function"!=typeof o)return void console.error("\u274c getQuillPageToolbarReduced no devolvi\xf3 una funci\xf3n");this.quillEditor=o("#"+this.quillId,this.reportForm.get("body").value||""),this.quillEditor&&(this.quillEditor.root.setAttribute("data-placeholder","A\xf1ade notas al informe"),this._quillEvent=this.quillEditor.on("text-change",()=>{this.reportForm.get("body").setValue(this.quillEditor.root.innerHTML)}),this.quillInitialized=!0)}catch(e){console.error("\u274c Error inicializando Quill:",e),setTimeout(()=>this.initQuill(),1e3)}}ngOnDestroy(){if(this._quillEvent&&this.quillEditor)try{this.quillEditor.off("text-change",this._quillEvent)}catch{}if(this.quillEditor)try{this.quillEditor.destroy()}catch{}if((0,C.UE)(this.platformId)){const e=document.getElementById(this.quillId);e&&(e.innerHTML="")}}onCancel(){var e=this;return(0,g.A)(function*(){const o=yield e.modalCtrl.create({...e.globalVars.desktop?{...e.globalVars.modalConfigDesktop}:{...e.globalVars.modalConfig},component:J.D,componentProps:{question:"module.shared.dialog.confirm.close_publication",description:"module.shared.dialog.confirm.close_publication_info"}});yield o.present(),(yield o.onDidDismiss()).data&&e.globalVars.closeModal({success:!1,cancelled:!0})})()}onConfirmForm(){var e=this;return(0,g.A)(function*(){if(e.saving)return;if(!e.reportForm.valid){for(const h in e.reportForm.controls)e.reportForm.controls[h].markAsTouched();return}e.saving=!0;const o=e.reportForm.get("body").value,a=e.reportForm.get("visibility").value,i=e.selectAthlete?e.reportForm.get("userId").value:e.userId,c=!e.isEdit&&e.reportForm.get("notify").enabled&&!0===e.reportForm.get("notify").value;try{const h=e.isEdit?yield(0,M._)(e.apiAthleteReportsService.editAthleteReport(e.savedReportId,{body:o,visibility:a})):yield(0,M._)(e.apiAthleteReportsService.createAthleteReport({userId:String(i),body:o,visibility:a,...c?{notify:!0}:{}}));if(e.savedReportId=h.id,yield e.processQueue(),e.hasFailedAttachments())return e.isEdit=!0,e.title="module.athleteReports.edit_report",e.saving=!1,void e.snackBar.open(yield e.translationService.getTranslation("module.athleteReports.attachment_partial_error"),"X",{duration:4e3});e.modalCtrl.dismiss({success:!0,data:h})}catch{e.saving=!1,e.snackBar.open(yield e.translationService.getTranslation("module.athleteReports.save_error"),"X",{duration:4e3})}})()}openFilesImportDialog(){var e=this;return(0,g.A)(function*(){if(!(0,C.UE)(e.platformId)||e.saving)return;const o=yield e.modalsService.openModal({component:D.y,modalSize:"lg",data:{data:{fileTypes:U.mk,maxSize:U.kz,multipleFiles:!0,title:"module.athleteReports.attachment_select"}},options:{}}),a=null!=o&&null!=o.data?o.data.gallery:null;if(null!=a)for(const i of a){const c=e.dataUrlToFile(i.value,i.title);null!=c&&(yield e.addFileToQueue(c))}})()}dataUrlToFile(e,o){if(!(0,C.UE)(this.platformId)||null==e)return null;const a=/^data:(.*?);base64,(.*)$/.exec(e);if(null==a)return null;const[,i,c]=a,h=atob(c),f=new Uint8Array(h.length);for(let P=0;P<h.length;
1P++)f[P]=h.charCodeAt(P);return new File([f],o,{type:i})}addFileToQueue(e){var o=this;return(0,g.A)(function*(){if(!(0,C.UE)(o.platformId)||null==e)return;const a=o.validateAttachment(e);if(null!=a)return void o.attachments.push({file:null,name:e.name,status:"error",errorKey:a});const i={file:e,name:e.name,status:"pending"};o.attachments.push(i),o.loadPreview(i),null!=o.savedReportId&&(yield o.processQueue())})()}loadPreview(e){if(null==e.file||!(e.file.type||"").startsWith("image/"))return;const o=new FileReader;o.onload=a=>{e.previewUrl=a.target.result},o.readAsDataURL(e.file)}retryAttachment(e){var o=this;return(0,g.A)(function*(){null==e.file||"error"!==e.status||(e.status="pending",e.errorKey=null,null!=o.savedReportId&&(yield o.processQueue()))})()}downloadDocument(e){e.new||this.downloadAttachmentFromId(e.id)}downloadAttachmentFromId(e){var o=this;return(0,g.A)(function*(){try{const a=yield(0,M._)(o.apiAthleteReportsService.downloadAttachment(o.savedReportId,e)),i=window.URL.createObjectURL(a),c=document.createElement("a");c.href=i;const h=o.documents$.value.find(f=>f.id===e);c.download=h?.filename||"documento",c.click(),window.URL.revokeObjectURL(i)}catch{o.snackBar.open(yield o.translationService.getTranslation("module.athleteReports.download_error"),"X",{duration:4e3})}})()}addDocumentToUI(e){this.documents$.next([...this.documents$.value,{id:e.id,title:e.document?.name||e.name||"Documento",name:e.document?.name||e.name,filename:e.document?.name||e.name,documentId:e.documentId,type:e.document?.type||e.type,new:!1,deleted:!1,keep:!0}])}downloadAttachment(e){var o=this;return(0,g.A)(function*(){if((0,C.UE)(o.platformId)&&null!=e.attachment&&null!=o.savedReportId)try{const a=yield(0,M._)(o.apiAthleteReportsService.downloadAttachment(o.savedReportId,e.attachment.id)),i=window.URL.createObjectURL(a),c=document.createElement("a");c.href=i,c.download=o.attachmentName(e.attachment)||e.name,c.click(),window.URL.revokeObjectURL(i)}catch(a){o.snackBar.open(yield o.translationService.getTranslation(o.uploadErrorKey(a)),"X",{duration:4e3})}})()}processQueue(){var e=this;return(0,g.A)(function*(){for(const o of e.attachments)if("pending"===o.status&&null!=o.file){o.status="uploading";try{o.attachment=yield(0,M._)(e.apiAthleteReportsService.uploadAttachment(e.savedReportId,o.file)),o.status="done",o.attachment&&e.addDocumentToUI(o.attachment)}catch(a){o.status="error",o.errorKey=e.uploadErrorKey(a)}}})()}removeAttachment(e){"done"===e.status||"uploading"===e.status||(this.attachments=this.attachments.filter(o=>o!==e))}hasFailedAttachments(){return this.attachments.some(e=>"error"===e.status&&null!=e.file||"pending"===e.status)}toPersistedQueueItem(e){return{file:null,name:this.attachmentName(e)||e.documentId,status:"done",attachment:e}}attachmentName(e){return null==e?null:e.name||(e.document?e.document.name:null)}validateAttachment(e){const o=(e.name||"").split(".").pop().toLowerCase();return U.mk.includes(o)?e.size>U.kz?"module.athleteReports.attachment_size_error":null:"module.athleteReports.attachment_type_error"}uploadErrorKey(e){switch(e&&e.status){case 400:return"module.athleteReports.attachment_type_error";case 413:return"module.athleteReports.attachment_size_error";case 503:return"module.athleteReports.attachment_storage_error";default:return"module.athleteReports.attachment_upload_error"}}static \u0275fac=function(o){return new(o||m)(t.rXU(k.Y),t.rXU(x.W),t.rXU(R.K),t.rXU(d.k),t.rXU(w.o),t.rXU(Y.ModalController),t.rXU(q.h),t.rXU(t.Agw),t.rXU(Z.M),t.rXU(_.UG),t.rXU(s.T),t.rXU(O.D),t.rXU(K.u),t.rXU(W.X),t.rXU(A.M))};static \u0275cmp=t.VBU({type:m,selectors:[["app-athlete-report-form-dialog"]],inputs:{userId:"userId",reportId:"reportId"},decls:3,vars:9,consts:[[3,"mainAction","secondaryAction","cancelAction","modalTitle","hasMainButton","mainButtonValue","mainButtonDisabled","hasSecondaryButton","secondaryButtonValue","hasCancelAction"],[1,"full-width-form","athlete-report-form",3,"formGroup"],[3,"user","searchConfiguration","placeholder","admitMultiple"],[3,"items"],["type","select","formControlName","visibility","popoverSize","cover","inputSize","default",3,"isSelectMultiple","select","selectOptions"],["type","checkbox","formControlName","notify",3,"checkboxConfig"],["mainTitle","module.athleteReports.attachments","titleClass","h5"],[3,"downloacAction","documents","admitMultiple","fileTypes"],[1,"form-row","body-row"],[1,"clupik-quill","clean"],[3,"id"],[1,"text","sm","body-error"]],template:function(o,a){1&o&&(t.j41(0,"app-clupik-modal",0),t.bIt("mainAction",function(){return a.onConfirmForm()})("secondaryAction",function(){return a.onCancel()})("cancelAction",function(){return a.onCancel()}),t.nVh(1,it,1,0,"app-skeleton-block"),t.nVh(2,dt,11,15,"form",1),t.k0s()),2&o&&(t.Y8G("modalTitle",a.title)("hasMainButton",!0)("mainButtonValue",a.saving?"global.button.loading":"global.common.save")("mainButtonDisabled",a.saving||a.loading)("hasSecondaryButton",!0)("secondaryButtonValue","global.common.cancel")("hasCancelAction",!0),t.R7$(),t.vxM(a.loading?1:-1),t.R7$(),t.vxM(a.loading?-1:2))},dependencies:[j.G,p.qT,p.BC,p.cb,p.j4,p.JD,r.K,X.C,V.k,l.$,N.y,u.x,G.D,v.s,H.x,E.S,Q.P,I.Y,z.m,B.t,p.X1,L.D9],styles:['@charset "UTF-8";.athlete-report-form[_ngcontent-%COMP%]{width:100%}.athlete-report-form[_ngcontent-%COMP%]   .body-row[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:4px;margin-bottom:16px}.athlete-report-form[_ngcontent-%COMP%]   .body-row[_ngcontent-%COMP%]   .clupik-quill[_ngcontent-%COMP%]{width:100%}.athlete-report-form[_ngcontent-%COMP%]   .body-row[_ngcontent-%COMP%]   .clupik-quill[_ngcontent-%COMP%]   .ql-toolbar[_ngcontent-%COMP%]{border:none!important;border-bottom:1px solid #e0e0e0!important;background:transparent!important;padding:4px 0 8px!important}.athlete-report-form[_ngcontent-%COMP%]   .body-row[_ngcontent-%COMP%]   .clupik-quill[_ngcontent-%COMP%]   .ql-toolbar[_ngcontent-%COMP%]   .ql-formats[_ngcontent-%COMP%]{margin-right:4px}.athlete-report-form[_ngcontent-%COMP%]   .body-row[_ngcontent-%COMP%]   .clupik-quill[_ngcontent-%COMP%]   .ql-toolbar[_ngcontent-%COMP%]   .ql-formats[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]:hover{background:#f0f0f0;border-radius:4px}.athlete-report-form[_ngcontent-%COMP%]   .body-row[_ngcontent-%COMP%]   .clupik-quill[_ngcontent-%COMP%]   .ql-toolbar[_ngcontent-%COMP%]   button.ql-file[_ngcontent-%COMP%]{display:none!important}.athlete-report-form[_ngcontent-%COMP%]   .body-row[_ngcontent-%COMP%]   .clupik-quill[_ngcontent-%COMP%]   .ql-container[_ngcontent-%COMP%]{border:none!important;min-height:200px;background:transparent!important}.athlete-report-form[_ngcontent-%COMP%]   .body-row[_ngcontent-%COMP%]   .clupik-quill[_ngcontent-%COMP%]   .ql-container[_ngcontent-%COMP%]   .ql-editor[_ng
1content-%COMP%]{min-height:200px;font-size:16px;line-height:1.6;color:#333;padding:8px 0}.athlete-report-form[_ngcontent-%COMP%]   .body-row[_ngcontent-%COMP%]   .clupik-quill[_ngcontent-%COMP%]   .ql-container[_ngcontent-%COMP%]   .ql-editor[_ngcontent-%COMP%]:before{content:"A\\f1 ade notas al informe";color:#999;font-style:italic}.athlete-report-form[_ngcontent-%COMP%]   .body-row[_ngcontent-%COMP%]   .clupik-quill[_ngcontent-%COMP%]   .ql-container[_ngcontent-%COMP%]   .ql-editor[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{margin:0 0 1em}.athlete-report-form[_ngcontent-%COMP%]   .body-row[_ngcontent-%COMP%]   .clupik-quill[_ngcontent-%COMP%]   .ql-container[_ngcontent-%COMP%]   .ql-editor[_ngcontent-%COMP%]   img[_ngcontent-%COMP%]{max-width:100%;height:auto}.athlete-report-form[_ngcontent-%COMP%]   .body-row[_ngcontent-%COMP%]   .clupik-quill[_ngcontent-%COMP%]:focus-within   .ql-toolbar[_ngcontent-%COMP%]{border-bottom-color:#1976d2!important}.athlete-report-form[_ngcontent-%COMP%]   .body-row[_ngcontent-%COMP%]   .body-error[_ngcontent-%COMP%]{color:#f44336}app-clupik-user-select[_ngcontent-%COMP%]{width:100%}app-clupik-user-select[_ngcontent-%COMP%]   .clupik-input[_ngcontent-%COMP%]{width:100%}app-clupik-user-select[_ngcontent-%COMP%]   ion-item[_ngcontent-%COMP%]{--padding-start: 0;--inner-padding-end: 0;width:100%}app-clupik-user-select[_ngcontent-%COMP%]   ion-input[_ngcontent-%COMP%]{--padding-start: 0;--padding-end: 0;width:100%}']})}return m})()},50230:(F,b,n)=>{n.d(b,{KM:()=>t,kz:()=>g,mk:()=>C});const g=10485760,C=["png","jpg","gif","pdf","jpeg","csv","txt","xls","xlsx","doc","docx"],t=["png","jpg","jpeg","gif"]},68020:(F,b,n)=>{n.d(b,{W:()=>x});var g=n(29330),C=n(18810),t=n(96354),p=n(99437),T=n(60152),y=n(45312),M=n(2615);let x=(()=>{class R{http;clubsService;apiUrl=y.c.api.URL+"/clubs/";jsonHeaders=new g.Lr({"Content-Type":"application/json","Access-Control-Allow-Origin":"*"});constructor(d,s){this.http=d,this.clubsService=s}createAthleteReport(d){return this.http.post(`${this.apiUrl}${this.clubsService.getClubId()}/athlete_reports`,d,{headers:this.jsonHeaders}).pipe((0,t.T)(s=>this.extractData(s)),(0,p.W)(this.handleError))}getClubAthleteReports(){return this.http.get(`${this.apiUrl}${this.clubsService.getClubId()}/athlete_reports`,{headers:this.jsonHeaders}).pipe((0,t.T)(d=>this.extractData(d)),(0,p.W)(this.handleError))}getAthleteReportsByAthlete(d){return this.http.get(`${this.apiUrl}${this.clubsService.getClubId()}/users/${d}/athlete_reports`,{headers:this.jsonHeaders}).pipe((0,t.T)(s=>this.extractData(s)),(0,p.W)(this.handleError))}getAthleteReportsMeta(d){return this.http.get(`${this.apiUrl}${this.clubsService.getClubId()}/users/${d}/athlete_reports_meta`,{headers:this.jsonHeaders}).pipe((0,t.T)(s=>this.extractData(s)),(0,p.W)(this.handleError))}getAthleteReport(d){return this.http.get(`${this.apiUrl}${this.clubsService.getClubId()}/athlete_reports/${d}`,{headers:this.jsonHeaders}).pipe((0,t.T)(s=>this.extractData(s)),(0,p.W)(this.handleError))}editAthleteReport(d,s){return this.http.put(`${this.apiUrl}${this.clubsService.getClubId()}/athlete_reports/${d}`,s,{headers:this.jsonHeaders}).pipe((0,t.T)(A=>this.extractData(A)),(0,p.W)(this.handleError))}deleteAthleteReport(d){return this.http.delete(`${this.apiUrl}${this.clubsService.getClubId()}/athlete_reports/${d}`,{headers:this.jsonHeaders}).pipe((0,t.T)(s=>this.extractData(s)),(0,p.W)(this.handleError))}uploadAttachment(d,s){const A=new FormData;return A.append("file",s,s.name),this.http.post(`${this.apiUrl}${this.clubsService.getClubId()}/athlete_reports/${d}/attachments`,A).pipe((0,t.T)(D=>this.extractData(D)),(0,p.W)(this.handleError))}downloadAttachment(d,s){return this.http.get(`${this.apiUrl}${this.clubsService.getClubId()}/athlete_reports/${d}/attachments/${s}`,{responseType:"blob"}).pipe((0,p.W)(this.handleError))}getSharedAthleteReports(d){return this.http.get(`${this.apiUrl}${this.clubsService.getClubId()}/users/${d}/shared_athlete_reports`,{headers:this.jsonHeaders}).pipe((0,t.T)(s=>this.extractData(s)),(0,p.W)(this.handleError))}getSharedAthleteReport(d){return this.http.get(`${this.apiUrl}${this.clubsService.getClubId()}/shared_athlete_reports/${d}`,{headers:this.jsonHeaders}).pipe((0,t.T)(s=>this.extractData(s)),(0,p.W)(this.handleError))}downloadSharedAttachment(d,s){return this.http.get(`${this.apiUrl}${this.clubsService.getClubId()}/shared_athlete_reports/${d}/attachments/${s}`,{responseType:"blob"}).pipe((0,p.W)(this.handleError))}extractData(d){return d||{}}handleError(d){return console.error("An error occurred",d),(0,C.$)(d)}static \u0275fac=function(s){return new(s||R)(M.KVO(g.Qq),M.KVO(T.X))};static \u0275prov=M.jDH({token:R,factory:R.\u0275fac,providedIn:"root"})}return R})()},84639:(F,b,n)=>{n.d(b,{r:()=>Z});var g=n(10467),C=n(60177),t=n(73664),p=n(54843),T=n(68020),y=n(69915),M=n(6961),x=n(25615),R=n(50230),w=n(49189),d=n(35745),s=n(2615),A=n(95416),D=n(72200),k=n(23768),K=n(82966),W=n(6688),j=n(13779),X=n(68018);const V=(_,O)=>O.id;function N(_,O){1&_&&(t.j41(0,"div",5),t.nrm(1,"app-skeleton-block"),t.k0s())}function G(_,O){if(1&_&&(t.j41(0,"div",9)(1,"div",11),t.EFF(2),t.nI1(3,"translate"),t.k0s(),t.j41(4,"div",12),t.EFF(5),t.k0s()()),2&_){const r=t.XpG(2);t.R7$(2),t.JRh(t.bMT(3,2,"module.athleteReports.athlete_label")),t.R7$(3),t.JRh(r.athleteName)}}function H(_,O){1&_&&t.nrm(0,"i",21)}function Q(_,O){1&_&&t.nrm(0,"i",22)}function z(_,O){if(1&_){const r=t.RV6();t.j41(0,"button",25),t.nI1(1,"translate"),t.bIt("click",function(u){s.eBV(r);const v=t.XpG().$implicit;return t.XpG(3).openAttachment(v),s.Njj(u.stopPropagation())}),t.nrm(2,"i",26),t.k0s()}2&_&&t.BMQ("aria-label",t.bMT(1,1,"module.athleteReports.attachment_view"))}function U(_,O){if(1&_){const r=t.RV6();t.j41(0,"button",25),t.nI1(1,"translate"),t.bIt("click",function(u){s.eBV(r);const v=t.XpG().$implicit;return t.XpG(3).downloadAttachment(v),s.Njj(u.stopPropagation())}),t.nrm(2,"i",27),t.k0s()}2&_&&t.BMQ("aria-label",t.bMT(1,1,"module.athleteReports.attachment_download"))}function J(_,O){if(1&_){const r=t.RV6();t.j41(0,"div",20),t.bIt("click",function(){const u=s.eBV(r).$implicit,v=t.XpG(3);return s.Njj(v.openAttachment(u))}),t.nVh(1,H,1,0,"i",21)(2,Q,1,0,"i",22),t.j41(3,"div",23),t.EFF(4),t.k0s(),t.nVh(5,z,3,3,"button",24)(6,U,3,3,"button",24),t.k0s()}if(2&_){const r=O.$implicit,l=t.XpG(3);t.R7$(),t.vxM(l.isImageAttachment(r)?1:2),t.R7$(3),t.JRh(l.attachmentName(r)),t.R7$(),t.vxM(l.isImageAttachment(r)?5:6)}}function S(_,O){if(1&_&&(t.j41(0,"div",18)(1,"div",11),t.EFF(2),t.nI1(3,"translate"),t.k0s(),t.Z7z(4,J,7,3,"div",19,V),t.k0s()),2&_){const r=t.XpG(2);t.R7$(2),t.JRh(t.bMT(3,1,"module.athleteReports.attachments")),t.R7$(2),t.Dyx(r.report.attachments)}}function Y(_,O){if(1&_&&(t.j41(0,"div",6)(1,"div",8),t.nVh(2,G,6,4,"div",9),t.j41(3,"div",10)(4,"div",11),t.EFF(5),t.nI1(6,"translate"),t.k0s(),t.j41(7,"div",12),t.EFF(8),t.k0s()(),t.j41(9,"div",13)(10,"div",11),t.EFF(11),t.nI1(12,"translate"),t.k0s(),t.j41(13,"div",12),t.EFF(14),t.nI1(15,"date"),t.k0s()(),t.j41(16,"div",14)(17,"div",11),t.EFF(18),t.nI1(19,"translate"),t.k0s(),t.j41(20,"div",15),t.nrm(21,"i",16),t.j41(22,"span"),t.EFF(23),t.nI1(24,"translate"),t.k0s()()()(),t.nrm(25,"div",17),t.nI1(26,"safe"),t.nVh(27,S,6,3,"div",18),t.k0s()),2&_){const r=t.XpG();t.R7$(2),t.vxM(r.athleteName?2:-1),t.R7$(3),t.JRh(t.bMT(6,10,"module.athleteReports.author_label")),t.R7$(3),t.JRh(r.authorName),t.R7$(3),t.JRh(t.bMT(12,12,"module.athleteReports.created_at_label")),t.R7$(3),t.JRh(t.i5U(15,14,r.report.createdAt,"short")),t.R7$(4),t.JRh(t.bMT(19,17,"module.athleteReports.visibility")),t.R7$(3),t.Y8G("ngClass",r.visibilityIcon),t.R7$(2),t.JRh(t.bMT(24,19,r.visibilityLabelKey)),t.R7$(2),t.Y8G("innerHTML",t.bMT(26,21,r.report.body),t.npT),t.R7$(2),t.vxM(null!=r.report.attachments&&r.report.attachments.length>0?27:-1)}}function q(_,O){if(1&_){const r=t.RV6();t.j41(0,"div",7)(1,"app-button-main",28),t.bIt("buttonAction",function(){s.eBV(r);const u=t.XpG();return s.Njj(u.edit())}),t.k0s()()}2&_&&(t.R7$(),t.Y8G("isMain",!0)("value","module.athleteReports.edit")("size","modal"))}let Z=(()=>{class _{globalVars;apiAthleteReportsService;appService;platformId;snackBar;translationService;reportId;athleteName;canEdit;userId;loading=!0;report=null;imageObjectUrls=new Map;constructor(r,l,u,v,E,I){this.globalVars=r,this.apiAthleteReportsService=l,this.appService=u,this.platformId=v,this.snackBar=E,this.translationService=I}ngOnDestroy(){(0,C.UE)(this.platformId)&&this.imageObjectUrls.forEac
1h(r=>window.URL.revokeObjectURL(r))}ngOnInit(){var r=this;return(0,g.A)(function*(){try{r.report=yield(0,p._)(r.apiAthleteReportsService.getAthleteReport(String(r.reportId)))}catch{return r.snackBar.open(yield r.translationService.getTranslation("module.athleteReports.load_error"),"X",{duration:4e3}),void r.close()}r.loading=!1})()}close(){this.globalVars.closeSidenav()}get authorName(){const r=null!=this.report?this.report.author:null;if(null==r)return"-";const l=[r.firstName,r.lastName,r.secondSurname].filter(u=>null!=u&&""!==`${u}`.trim()).join(" ");return""!==l?l:"-"}get visibilityIcon(){return null!=this.report&&"athlete"===this.report.visibility?"fa-eye":"fa-lock"}get visibilityLabelKey(){return`module.athleteReports.${null!=this.report?this.report.visibility:"private"}`}attachmentName(r){return null==r?"":r.name||(r.document?r.document.name:null)||r.documentId}attachmentType(r){return null==r?"":(r.type||(r.document?r.document.type:null)||"").toLowerCase()}isImageAttachment(r){return R.KM.includes(this.attachmentType(r))}openAttachment(r){var l=this;return(0,g.A)(function*(){l.isImageAttachment(r)?yield l.openImageGallery(r):yield l.downloadAttachment(r)})()}downloadAttachment(r){var l=this;return(0,g.A)(function*(){if((0,C.UE)(l.platformId)&&null!=r&&null!=l.report)try{const u=yield(0,p._)(l.apiAthleteReportsService.downloadAttachment(String(l.report.id),r.id)),v=window.URL.createObjectURL(u),E=document.createElement("a");E.href=v,E.download=l.attachmentName(r),E.click(),window.URL.revokeObjectURL(v)}catch{l.snackBar.open(yield l.translationService.getTranslation("module.athleteReports.download_error"),"X",{duration:4e3})}})()}openImageGallery(r){var l=this;return(0,g.A)(function*(){if(!(0,C.UE)(l.platformId)||null==l.report)return;const u=(l.report.attachments||[]).filter(v=>l.isImageAttachment(v));try{const v=yield Promise.all(u.map(function(){var I=(0,g.A)(function*(B){const L=yield l.getImageObjectUrl(B);return{html:`<img class="image" src="${L}"></img><div class="bottom-actions"><div class="publication-info"></div><div class="gallery-actions"><a target="_new" href="${L}" download><span class="fa fa-download"></span></a></div></div>`}});return function(B){return I.apply(this,arguments)}}())),E=u.findIndex(I=>I.id===r.id);l.appService.broadcast("openModal",{open:!0,imagesModal:v,imagePointer:E>=0?E:0})}catch{l.snackBar.open(yield l.translationService.getTranslation("module.athleteReports.download_error"),"X",{duration:4e3})}})()}getImageObjectUrl(r){var l=this;return(0,g.A)(function*(){const u=l.imageObjectUrls.get(r.id);if(null!=u)return u;const v=yield(0,p._)(l.apiAthleteReportsService.downloadAttachment(String(l.report.id),r.id)),E=window.URL.createObjectURL(v);return l.imageObjectUrls.set(r.id,E),E})()}edit(){this.appService.broadcast("athleteReportSheetEdit",{reportId:this.reportId,userId:this.userId}),this.close()}static \u0275fac=function(l){return new(l||_)(t.rXU(x.Y),t.rXU(T.W),t.rXU(y.d),t.rXU(t.Agw),t.rXU(A.UG),t.rXU(M.T))};static \u0275cmp=t.VBU({type:_,selectors:[["app-athlete-report-detail-sheet"]],inputs:{reportId:"reportId",athleteName:"athleteName",canEdit:"canEdit",userId:"userId"},decls:11,vars:9,consts:[[1,"athlete-report-detail-sheet"],[1,"sheet-header"],[1,"text","lg","sheet-title"],["type","button","mat-icon-button","",1,"sheet-close",3,"click"],[1,"fa-regular","fa-xmark"],[1,"sheet-content","sheet-loading"],[1,"sheet-content"],[1,"sheet-footer"],[1,"sheet-meta"],[1,"sheet-row","sheet-athlete"],[1,"sheet-row","sheet-author"],[1,"text","sm","gray","sheet-label"],[1,"text","md","sheet-value"],[1,"sheet-row","sheet-date"],[1,"sheet-row","sheet-visibility"],[1,"text","md","sheet-value","visibility-value"],[1,"fa-solid",3,"ngClass"],[1,"sheet-body",3,"innerHTML"],[1,"sheet-attachments"],[1,"attachment-row"],[1,"attachment-row",3,"click"],[1,"fa-solid","fa-image","attachment-file-icon"],[1,"fa-solid","fa-file","attachment-file-icon"],[1,"text","md","attachment-name"],["mat-icon-button","","type","button",1,"attachment-download"],["mat-icon-button","","type","button",1,"attachment-download",3,"click"],[1,"fa-solid","fa-expand"],[1,"fa-solid","fa-download"],[1,"sheet-edit",3,"buttonAction","isMain","value","size"]],template:function(l,u){1&l&&(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.nI1(6,"translate"),t.bIt("click",function(){return u.close()}),t.nrm(7,"i",4),t.k0s()(),t.nVh(8,N,2,0,"div",5),t.nVh(9,Y,28,23,"div",6),t.nVh(10,q,2,3,"div",7),t.k0s()),2&l&&(t.R7$(3),t.JRh(t.bMT(4,5,"module.athleteReports.report_detail")),t.R7$(2),t.BMQ("aria-label",t.bMT(6,7,"global.common.close")),t.R7$(3),t.vxM(u.loading?8:-1),t.R7$(),t.vxM(u.loading||null==u.report?-1:9),t.R7$(),t.vxM(u.canEdit?10:-1))},dependencies:[w.G,D.YU,k.M,K.K,d.C,W.H,D.vh,j.m,X.D9],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%}.athlete-report-detail-sheet[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;overflow:hidden}.athlete-report-detail-sheet[_ngcontent-%COMP%]   .sheet-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;flex:0 0 auto;padding:20px 24px;border-bottom:1px solid rgba(0,0,0,.08)}.athlete-report-detail-sheet[_ngcontent-%COMP%]   .sheet-header[_ngcontent-%COMP%]   .sheet-title[_ngcontent-%COMP%]{font-weight:600}.athlete-report-detail-sheet[_ngcontent-%COMP%]   .sheet-header[_ngcontent-%COMP%]   .sheet-close[_ngcontent-%COMP%]{flex:0 0 auto}.athlete-report-detail-sheet[_ngcontent-%COMP%]   .sheet-content[_ngcontent-%COMP%]{flex:1 1 auto;overflow-y:auto;padding:20px 24px}.athlete-report-detail-sheet[_ngcontent-%COMP%]   .sheet-content.sheet-loading[_ngcontent-%COMP%]{display:flex;align-items:flex-start;justify-content:center;padding-top:40px}.athlete-report-detail-sheet[_ngcontent-%COMP%]   .sheet-meta[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:12px;padding-bottom:16px;margin-bottom:16px;border-bottom:1px solid rgba(0,0,0,.08)}.athlete-report-detail-sheet[_ngcontent-%COMP%]   .sheet-meta[_ngcontent-%COMP%]   .sheet-row[_ngcontent-%COMP%]{display:flex;align-items:baseline;gap:8px}.athlete-report-detail-sheet[_ngcontent-%COMP%]   .sheet-meta[_ngcontent-%COMP%]   .sheet-row[_ngcontent-%COMP%]   .sheet-label[_ngcontent-%COMP%]{min-width:130px}.athlete-report-detail-sheet[_ngcontent-%COMP%]   .sheet-meta[_ngcontent-%COMP%]   .sheet-row[_ngcontent-%COMP%]   .visibility-value[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px}.athlete-report-detail-sheet[_ngcontent-%COMP%]   .sheet-body[_ngcontent-%COMP%]{overflow-wrap:break-word}.athlete-report-detail-sheet[_ngcontent-%COMP%]   .sheet-body[_ngcontent-%COMP%]     img{max-width:100%}.athlete-report-detail-sheet[_ngcontent-%COMP%]   .sheet-attachments[_ngcontent-%COMP%]{margin-top:16px;padding-top:16px;border-top:1px solid rgba(0,0,0,.08)}.athlete-report-detail-sheet[_ngcontent-%COMP%]   .sheet-attachments[_ngcontent-%COMP%]   .attachment-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;padding:6px 0;cursor:pointer}.athlete-report-detail-sheet[_ngcontent-%COMP%]   .sheet-attachments[_ngcontent-%COMP%]   .attachment-row[_ngcontent-%COMP%]   .attachment-name[_ng
1content-%COMP%]{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.athlete-report-detail-sheet[_ngcontent-%COMP%]   .sheet-footer[_ngcontent-%COMP%]{flex:0 0 auto;padding:16px 24px;border-top:1px solid rgba(0,0,0,.08)}.athlete-report-detail-sheet[_ngcontent-%COMP%]   .sheet-footer[_ngcontent-%COMP%]   .sheet-edit[_ngcontent-%COMP%]{width:100%}"]})}return _})()}}]);

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.