1 2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="a97cb137-f1d4-519a-b3a1-040ad3044843")}catch(e){}}(); 3(self.webpackChunkangular_io_example=self.webpackChunkangular_io_example||[]).push([[6671],{76671:(Ct,Je,f)=>{"use strict";f.r(Je),f.d(Je,{TeacherModule:()=>gg});var G=f(62593),Le=f(3703),_e=f(82465),_=f(81221),F=f(48836),u=f(60316),e=f(68559),m=f(48503),w=f(54285),y=f(84205),V=f(14600),R=f(70271),j=f(61873),D=f(61318),x=f(59452),le=f(98764),Z=f(36647),pe=f(77919),I=f(33900),L=f(10402),C=f(78603),E=f(84175),X=f(4419);const te=(t,o)=>({loading:t,hasError:o}),fe=t=>({loading:t});let Te=(()=>{var t;class o{constructor(){this.toastrService=(0,e.WQX)(w.tw),this.translateService=(0,e.WQX)(m.c$),this.dependencyLoaded=new e.bkB,this.color=(0,e.hFB)("accent"),this.label=(0,e.hFB)("exportToPdf"),this.debounce=!1,this.isLoading=!1,this.hasError=!1,this.destroy$=new y.B}loadDependencies(){if(this.debounce)return;this.debounce=!0,this.isLoading=!0,this.hasError=!1;const i=(0,V.H)(f.e(330).then(f.t.bind(f,330,23))).pipe((0,R.T)(r=>(null==r?void 0:r.default)||r)),a=(0,V.H)(f.e(5360).then(f.t.bind(f,55360,23))).pipe((0,R.T)(r=>(null==r?void 0:r.default)||r)),s=f(70887);(0,j.p)([i,a]).pipe((0,D.W)(r=>(0,x.of)(r)),(0,le.M)(()=>this.isLoading=!1),(0,Z.n)(r=>{if(r instanceof Error)return(0,pe.$)(()=>r);const[l,p]=Array.isArray(r)&&r||[],d=h=>!!h&&"object"==typeof h&&!Array.isArray(h);return d(l)&&d(p)?(l.vfs=p,(0,x.of)(l)):(0,pe.$)(()=>new Error("Something went wrong when loading PDF dependencies"))}),(0,I.Q)(this.destroy$)).subscribe({next:r=>{this.resetError(),this.dependencyLoaded.emit({pdfMake:r,htmlToPdfmake:s})},error:r=>{this.handleError(r)}})}handleError(i){(0,C.L)().handleError(i),this.hasError=!0;const a=this.translateService.instant("errorGeneratingPDF");this.toastrService.error(a,null,{timeOut:3e3}).onHidden.pipe((0,I.Q)(this.destroy$)).subscribe(s=>this.resetError())}resetError(){this.hasError=!1,this.debounce=!1}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}}return(t=o).\u0275fac=function(i){return new(i||t)},t.\u0275cmp=e.VBU({type:t,selectors:[["app-export-to-pdf-button"]],inputs:{color:[1,"color"],label:[1,"label"]},outputs:{dependencyLoaded:"dependencyLoaded"},standalone:!0,features:[e.aNF],decls:9,vars:16,consts:[["type","button","mat-raised-button","",1,"text-uppercase",3,"click","disabled","color"],[1,"text-nowrap"],[1,"icon-container","overflow-hidden","position-relative","d-inline-flex","justify-content-center","align-items-center","mr-2"],[1,"pdf-icon","fa-solid","fa-file-arrow-down",3,"ngClass"],[1,"pdf-error-icon","fa-solid","fa-exclamation-triangle",3,"ngClass"],[1,"loading-indicator",3,"ngClass"],[1,"position-relative"]],template:function(i,a){1&i&&(e.j41(0,"button",0),e.bIt("click",function(){return a.loadDependencies()}),e.j41(1,"div",1)(2,"span",2),e.nrm(3,"i",3)(4,"i",4),e.j41(5,"div",5),e.nrm(6,"app-inner-loader",6),e.k0s()(),e.EFF(7),e.nI1(8,"translate"),e.k0s()()),2&i&&(e.Y8G("disabled",a.debounce)("color",a.hasError?"danger":a.color()),e.R7$(3),e.Y8G("ngClass",e.l_i(8,te,a.isLoading,a.hasError)),e.R7$(),e.Y8G("ngClass",e.l_i(11,te,a.isLoading,a.hasError)),e.R7$(),e.Y8G("ngClass",e.eq3(14,fe,a.isLoading)),e.R7$(2),e.SpI(" ",e.bMT(8,6,a.label())," "))},dependencies:[m.D9,L.G,E.$z,u.YU,_.G,X.H],styles:[".icon-container[_ngcontent-%COMP%]{width:var(--size-24px);height:var(--size-24px)}.pdf-error-icon[_ngcontent-%COMP%], .loading-indicator[_ngcontent-%COMP%]{position:absolute}.loading-indicator[_ngcontent-%COMP%]{width:var(--size-100-percent);height:var(--size-100-percent)}.pdf-icon[_ngcontent-%COMP%], .pdf-error-icon[_ngcontent-%COMP%], .loading-indicator[_ngcontent-%COMP%]{transition:var(--transition-property-transform) var(--duration-300) var(--behavior-function-ease)}.loading.pdf-icon[_ngcontent-%COMP%], .hasError.pdf-icon[_ngcontent-%COMP%]{transform:var(--transform-translate-0-negative-200)}.pdf-error-icon[_ngcontent-%COMP%], .loading-indicator[_ngcontent-%COMP%]{transform:var(--transform-translate-0-200)}.hasError.pdf-error-icon[_ngcontent-%COMP%], .loading.loading-indicator[_ngcontent-%COMP%]{transform:var(--transform-translate-0)}\n\n/*# sourceMappingURL=export-to-pdf-button.component.ts-angular-inline--11.css.map*/"]}),o})();var O=f(11624),Qe=f(306),Ye=f(56547),$e=f(27243),Ve=f(80792),Pe=f(26611),de=f(95062),g=f(90954),b=f(77697),ke=f(1365),oe=f(71920),Y=f(51360),me=f(21675),c=f(34456),B=f(87941),ue=f(46443),ce=f(75797),P=f(32496),Ce=f(28404),N=f(62849),q=f(88701),T=f(39593),S=f(66643);let W=(()=>{var t;class o{constructor(){this.http=(0,e.WQX)(ue.Qq),this.translateService=(0,e.WQX)(m.c$),this.teacherService=(0,e.WQX)(S.O),this.configService=(0,e.WQX)(Ce.w),this.notificationService=(0,e.WQX)(q.J),this.CDO_URL="".concat(this.configService.getCdoUrl(),"api/"),this.listSubject=ne
3w ce.t(null),this.currentItem=new ce.t(null),this.currentQuestion=new ce.t(null),this.questionListSubject=new ce.t(null),this.resultListSubject=new ce.t(null),this.initialEvaluationListValue={examSatuses:[],students:[],exams:[],evaluations:[],pagination:{}},this.currentEvaluationPageUrl=null,this.currentEvaluationSearchTerm="",this.evaluationsHaveType=!1,this.evaluationListSubject$=new ce.t(this.initialEvaluationListValue),this.samePageNavigationSubject$=new ce.t(null)}setType(i){this.type=i,this.translatedType=this.translateService.instant(i),this.teacherService.setBackBtnText("evaluation.".concat(i,"AndEvaluation"))}getType(){return this.type}getTranslatedType(){return this.translatedType}getCapitalizedType(){return"".concat(this.type.charAt(0).toUpperCase()).concat(this.type.slice(1))}getPluralType(){switch(this.type){case"exercise":return"exercises";case"task":return"tasks";default:return"exams"}}setListSubject(i){this.listSubject.next(i)}getListSubject(){return this.listSubject.asObservable()}addAssignmentToList(i){const a=this.listSubject.getValue();if(this.isExercise()){const s=this.getExerciseType(i.type),[r]=a;r?r[s]=r[s]&&r[s].length?[...r[s],i]:[i]:a[0]={[s]:[i]},this.setListSubject([...a])}else this.setListSubject(a&&a.length?[...a,i]:[i])}updateAssignmentInList(i){const a=this.listSubject.getValue();if(this.isExercise()){const{type:s}=i,r=this.getExerciseType(s),[l]=a;if(l[r].find(d=>d.id===i.id))l[r]=l[r].map(d=>d.id===i.id?i:d);else{const d=this.getParallelType(s);l[r]=[...l[r],i],l[d]=l[d].filter(h=>h.id!==i.id)}this.setListSubject([...a])}else this.setListSubject([...a.map(s=>s.id===i.id?i:s)])}removeAssignmentFromList(i){const a=this.listSubject.getValue();if(this.isExercise()){const s=this.getExerciseType(i.type),[r]=a;r[s]=r[s].filter(({id:l})=>+l!=+i.id),this.setListSubject([...a])}else{const s=this.listSubject.value.filter(({id:r})=>r!==+i.id);this.setListSubject(s)}}resetListSubject(){this.listSubject.next(null)}setChapterList(i){this.chapterList=null!=i&&i.length?i:[]}getChapterList(){return this.chapterList}setCurrentItem(i){this.currentItem.next(i)}getCurrentItem(){return this.currentItem.asObservable()}resetCurrentItem(){this.currentItem.next(null)}getItemFromList(i){let a=this.listSubject.getValue();if(this.isExercise()){const r=this.listSubject.getValue();a=Object.values(r[0]).reduce((p,d)=>[...p,...d],[])}const s=a.find(r=>+r.id==+i);return this.currentItem.next(s),s}setQuestionList(i){this.questionListSubject.next(i)}getQuestionList(){return this.questionListSubject.asObservable()}getQuestion(){return this.currentQuestion.asObservable()}setQuestion(i){this.currentQuestion.next(i)}addQuestionToQuestionList(i){this.questionListSubject.next([...this.questionListSubject.getValue(),i])}updateQuestionInQuestionList(i){this.questionListSubject.next(this.questionListSubject.getValue().map(a=>a.id!==i.question_id?a:(0,g.A)((0,g.A)({},a),i)))}removeQuestionFromQuestionList(i){this.questionListSubject.next(this.questionListSubject.getValue().filter(a=>a.id!==i))}emptyQuestionList(){this.questionListSubject.next(null)}getModuleList(i){const{type:a}=this,s="".concat(this.CDO_URL).concat(a,"?course_id=").concat(i);return this.http.get(s,{observe:"response"})}createAssignment(i){const{type:a}=this,s="".concat(this.CDO_URL).concat(a);return this.http.post(s,i,{observe:"response"})}deleteAssignment(i){const{type:a}=this,s="".concat(this.CDO_URL).concat(a,"/").concat(i);return this.http.delete(s,{observe:"response"})}updateQuestionListOrder(i,a){const s="".concat(this.CDO_URL).concat(this.type,"/").concat(i,"/questions_order");return this.http.put(s,{order:a},{observe:"response"})}getCourseChapters(i){const a="".concat(this.CDO_URL,"chapter/?course_id=").concat(i);return this.http.get(a,{observe:"response"})}getExerciseType(i){return"open"===i?"openExercises":"autoExercises"}getParallelType(i){return"open"===i?"autoExercises":"openExercises"}isExercise(){return this.type===T.Eq.exercise}setEvaluations(i,a,s,r,l,p){const d="exam"===a,h=d?"point":"solving",v=a?"".concat(a,"/"):"";this.evaluationsHaveType=!!a;
3const $=i||"".concat(this.CDO_URL).concat(v).concat(h).concat(d?"/".concat(l):"");let k=new ue.Nl;return i||(l&&!d&&(k=k.append("course_id",l)),s&&(k=k.append("page",s)),r&&(k=k.append("page_length",r)),p&&(k=k.append("search",p)),a||(k=k.append("corrected",!1))),this.http.get($,{params:k,observe:"response"}).pipe((0,R.T)(M=>{var J;return this.currentEvaluationPageUrl=null==M?void 0:M.url,204===M.status?this.initialEvaluationListValue:(null==M||null===(J=M.body)||void 0===J?void 0:J.data)||null}),(0,D.W)(M=>(this.evaluationListSubject$.next(this.initialEvaluationListValue),(0,x.of)(!1))),(0,R.T)(M=>{var J,se,re,Q;return M&&(!d||null!=M&&null!==(J=M.students)&&void 0!==J&&J.length)&&(d||null!=M&&null!==(se=M.evaluations)&&void 0!==se&&se.length)?(d?M.students=M.students.map(K=>{var U;return K.fullName="".concat(K.firstName," ").concat(K.lastName),K.examInfo&&null!==(U=K.examInfo)&&void 0!==U&&U.length&&(K.examInfo=K.examInfo.map(ae=>{var z;return ae.events&&null!==(z=ae.events)&&void 0!==z&&z.length&&(ae.events=ae.events.reverse()),ae})),K}):(M.evaluations=this.addPropertiesToEvaluations(M.evaluations,!!a),a||null===(re=M.pagination)||void 0===re||null===(re=re.meta)||void 0===re||!re.total||p||this.notificationService.updateOpenEvaluationCounter(null===(Q=M.pagination)||void 0===Q||null===(Q=Q.meta)||void 0===Q?void 0:Q.total)),this.evaluationListSubject$.next(M),!0):(this.evaluationListSubject$.next(this.initialEvaluationListValue),!1)}))}addPropertiesToEvaluations(i,a){return i.map(s=>{const{student:r,exercise:l,task:p,points:d,maxPoints:h,submissionDate:v,correctionDate:$,solvingType:k}=s||{},{firstName:M,lastName:J}=r;s.student.fullName="".concat(M," ").concat(J),s.title=(null==p?void 0:p.taskName)||(null==l?void 0:l.exerciseName),s.assignmentId=(null==l?void 0:l.exerciseId)||(null==p?void 0:p.taskId),s.solvingTypeTranslated=this.translateService.instant((null!=p&&p.obligedForExam?"obligedTask":p?k:null)||("auto"===(null==l?void 0:l.type)?"autoCorrectExercise":l?"openExercise":null)||k);const U=null!==h&&+h>=0;if(s.pointsString=null!==d&&+d>=0&&U?"".concat(+d," / ").concat(+h):U?"- / ".concat(h):"",v){const ae=(0,N.I1)(v,P.x.iso.date).format(P.x.display.date);if(s.submissionDateString=ae,!a&&!$){const z=(0,N.I1)(),be=(0,N.I1)(v,P.x.iso.date),Ge=z.diff(be,P.$.day);s.waitingDays=Ge}}if($){const ae=(0,N.I1)($,P.x.iso.date).format(P.x.display.date);s.correctionDateString=ae}return s})}getCurrentEvaluationPageUrl(){return this.currentEvaluationPageUrl}setCurrentEvaluationSearchTerm(i){this.currentEvaluationSearchTerm=i}getCurrentEvaluationSearchTerm(){return this.currentEvaluationSearchTerm}navigateToSamePage(){return this.samePageNavigationSubject$.asObservable()}getEvaluationList(){return this.evaluationListSubject$.asObservable()}updateStudentAssignmentEvaluation(i,a,s){if(!this.evaluationsHaveType)return void this.samePageNavigationSubject$.next(this.currentEvaluationPageUrl);const{value:r}=this.evaluationListSubject$;if(!r)return;const{evaluations:l}=r||{};if(!l||null==l||!l.length)return;const p=l.find(v=>+v.assignmentId==+a&&+v.solvingId==+s);if(!p)return;const{maxPoints:d}=p;if("number"==typeof i){const v=null!==d&&+d>=0;p.points=i,p.pointsString=v?"".concat(+i," / ").concat(+d):""}const h=(0,N.I1)().format(P.x.display.date);p.correctionDate=h,p.correctionDateString=h,this.evaluationListSubject$.next(r)}getAssignment(i,a,s){const r="".concat(this.CDO_URL).concat(i,"/").concat(a,"/solving/").concat(s);return this.http.get(r)}getExamInfo(){return this.evaluationListSubject$.asObservable().pipe((0,R.T)(i=>{const{exams:a,examStatuses:s}=i||{};return a&&s?{exams:a,examStatuses:s}:null}))}getStudentEvaluation(i){return this.evaluationListSubject$.asObservable().pipe((0,R.T)(a=>{const{students:s}=a||{};return s&&null!=s&&s.length?s.find(r=>+r.id==+i):null}))}clearEvaluations(){this.currentEvaluationPageUrl=null,this.evaluationListSubject$.next(this.initialEvaluationListValue),this.setCurrentEvaluationSearchTerm("")}patchAssignmentEvaluation(i,a,s,r){const l="".concat(this.CDO_URL).concat(i,"/").concat(s,"/solving/").concat(r),p=new ue.Lr({Version:"1","X-Http-Method-Override":"PATCH"});return this.http.post(l,a,{headers:p}).pipe((0,R.T)(d=>{const h=(null==d?void 0:d.data)||null;if(!h)return null;const{points:v}=h||{};return this.updateStudentAssignmentEvaluation(v,s,r),h}),(0,D.W)(d=>(0,x.of)(null)))}postStudentEvaluation(i,a,s,r,l,p){const d="".concat(this.CDO_URL,"exam/point/").concat(l);return p={points:[(0,g.A)({},p)]},this.http.post(d,p,{observe:"response"}).pipe((0,R.T)(h=>{var v;return(null==h||null===(v=h.body)||void 0===v?void 0:v.data)||null}),(0,D.W)(h=>(0,x.of)(null)),(0,R.T)(h=>!!h&&(this.updateEvaluationSubject(i,a,s,h[r]),!0)))}patchStudentEvaluation(i,a,s,r,l){const p="".concat(this.CDO_URL,"exam/point/").concat(r);return l={points:[(0,g.A)({},l)]},this.http.patch(p,l,{observe:"response"}).pipe((0,R.T)(d=>{var h;return(null==d||null===(h=d.body)||void 0===h?void 0:h.data)||null}),(0,D.W)(d=>(0,x.of)(null)),(0,R.T)(d=>!!d&&(this.updateEvaluationSubject(i,a,s,d),!0)))}updateEvaluationSubject(i,a,s,r){r.points=parseFloat(r.point),r.pointId=r.id,delete r.point,delete r.id;const l=this.evaluationListSubject$.value;if(l&&l.students&&l.students.length){var p;const h=(l.students.find(k=>+k.id==+i)||{examInfo:[]}).examInfo.find(k=>+k.id==+a)||{events:[]},$=(null==h?void 0:h.events)&&(null==h||null===(p=h.events)||void 0===p?void 0:p.length)&&h.events.find(k=>+k.eventId==+s)||null;$?$.points=(0,g.A)((0,g.A)({},$.points),r):h.events=[{points:(0,g.A)({},r)}]}this.evaluationListSubject$.next(l)}clearAssignmentData(){this.type=null,this.clearEvaluations()}}return(t=o).\u0275fac=function(i){return new(i||t)},t.\u0275prov=e.jDH({token:t,factory:t.\u0275fac,providedIn:"root"}),o})();var ee=f(99235),ne=f(95541),A=f(24950),Me=f(69940),xe=f(25175),Ie=f(85060),Xe=f(97024),xt=f(53804),he=f(71517),ze=f(44317),Be=f(2238);const _n=["uploader"],hn=t=>({"mt-4":t}),fn=t=>({"mt-1":t}),It=t=>({value:t});function gn(t,o){1&t&&e.nrm(0,"app-spinner")}function vn(t,o){1&t&&(e.j41(0,"mat-error"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"formValidation.teacher.exam.questionTitle")," "))}function bn(t,o){1&t&&(e.j41(0,"mat-error"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"formValidation.teacher.exam.question")," "))}function Tn(t,o){1&t&&(e.j41(0,"mat-hint"),e.nrm(1,"span",23),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.Y8G("innerHTML",e.bMT(2,1,"useThreeDots"),e.npT))}function Cn(t,o){if(1&t&&(e.j41(0,"div",24)(1,"div",25),e.nrm(2,"app-file-upload",26,2),e.k0s()()),2&t){const n=e.XpG();e.R7$(2),e.Y8G("uploadIcon",!0)("maxFiles",n.isExam?1:3)("multiple",!n.isExam)("showFileNames",!1)("showUploader",n.showUploader)("files",n.hadFiles&&n.editQuestion.attachments)("allowedFileTypes",n.ALLOWED_FILE_TYPES)}}function xn(t,o){1&t&&e.nrm(0,"hr")}function In(t,o){1&t&&(e.j41(0,"mat-error"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"formValidation.teacher.exam.questionAnswer")," "))}function Rn(t,o){if(1&t&&(e.j41(0,"mat-form-field",25)(1,"mat-label"),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.nrm(4,"input",36),e.k0s()),2&t){const n=e.XpG().index,i=e.XpG(2);e.R7$(2),e.JRh(e.bMT(3,2,"commentForAnswer")),e.R7$(2),e.Y8G("formControl",i.comments.controls[n])}}function Fn(t,o){if(1&t){const n=e.RV6();e.j41(0,"div",24)(1,"mat-form-field",29)(2,"button",30),e.bIt("click",function(){const a=e.eBV(n).index,s=e.XpG(2);return e.Njj(s.deleteAnswer(a))}),e.nrm(3,"i",31),e.k0s(),e.j41(4,"mat-label"),e.EFF(5),e.nI1(6,"translate"),e.k0s(),e.nrm(7,"input",32),e.DNE(8,In,3,3,"mat-error",4),e.k0s(),e.j41(9,"div",33),e.nrm(10,"mat-checkbox",34),e.k0s(),e.DNE(11,Rn,5,4,"mat-form-field",35),e.k0s()}if(2&t){const n=o.index,i=e.XpG(2);e.R7$(5),e.JRh(e.bMT(6,5,"teacherExamAnswer")),e.R7$(2),e.Y8G("formControl",i.answers.controls[n]),e.R7$(),e.Y8G("ngIf",i.answers.controls[n].invalid&&(i.answers.controls[n].dirty||i.answers.controls[n].touched)),e.R7$(2),e.Y8G("formControl",i.correctAnswers.controls[n]),e.R7$(),e.Y8G("ngIf",i.isAutoExercise)}}function kn(t,o){1&t&&(e.j41(0,"div",24)(1,"div",25)(2,"p",37),e.EFF(3),e.nI1(4,"translate"),e.k0s()()()),2&t&&(e.R7$(3),e.SpI(" ",e.bMT(4,1,"selectCorrectAnswerBeforeS")," "))}function yn(t,o){if(1&t&&(e.qex(0),e.eu8(1,27),e.j41(2,"div",24)(3,"div",25),e.DNE(4,Fn,12,7,"div",28),e.k0s()(),e.DNE(5,kn,5,3,"div",10),e.bVm()),2&t){const n=e.XpG(),i=e.sdS(45);e.R7$(),e.Y8G("ngTemplateOutlet",i),e.R7$(3),e.Y8G("ngForOf",n.answers.controls),e.R7$(),e.Y8G("ngIf",!n.selectedCorrectAns)}}function En(t,o){1&t&&(e.j41(0,"mat-error"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"formValidation.teacher.exam.questionAnswer")," "))}function Sn(t,o){if(1&t&&(e.j41(0,"mat-form-field")(1,"mat-label"),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.nrm(4,"input",41),e.k0s()),2&t){const n=e.XpG().index,i=e.XpG(2);e.R7$(2),e.JRh(e.bMT(3,2,"commentForAnswer")),e.R7$(2),e.Y8G("formControl",i.comments.controls[n])}}function $n(t,o){if(1&t){const n=e.RV6();e.j41(0,"div",25)(1,"div",24)(2,"div",29)(3,"mat-form-field")(4,"button",30),e.bIt("click",function(){const a=e.eBV(n).index,s=e.XpG(2);return e.Njj(s.deleteAnswer(a))}),e.nrm(5,"i",31),e.k0s(),e.j41(6,"mat-label"),e.EFF(7),e.nI1(8,"translate"),e.k0s(),e.nrm(9,"input",32),e.DNE(10,En,3,3,"mat-error",4),e.k0s()(),e.j41(11,"div",33),e.nrm(12,"mat-radio-button",40),e.k0s()(),e.DNE(13,Sn,5,4,"mat-form-field",4),e.k0s()}if(2&t){const n=o.index,i=e.XpG(2);e.R7$(7),e.JRh(e.bMT(8,7,"teacherExamAnswer")),e.R7$(2),e.Y8G("formControl",i.answers.controls[n]),e.R7$(),e.Y8G("ngIf",i.answers.controls[n].invalid&&(i.answers.controls[n].dirty||i.answers.controls[n].touched)),e.R7$(2),e.Mz_("id","corFormAnswer-",n,""),e.Y8G("value",n),e.R7$(),e.Y8G("ngIf",i.isAutoExercise)}}function Mn(t,o){if(1&t&&(e.qex(0),e.eu8(1,27),e.j41(2,"mat-radio-group",38),e.DNE(3,$n,14,9,"div",39),e.k0s(),e.bVm()),2&t){const n=e.XpG(),i=e.sdS(45);e.R7$(),e.Y8G("ngTemplateOutlet",i),e.R7$(),e.Y8G("formControl",n.correctAnswers.controls[0]),e.R7$(),e.Y8G("ngForOf",n.answers.controls)}}function wn(t,o){if(1&t&&(e.j41(0,"mat-form-field")(1,"mat-label"),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.nrm(4,"input",41),e.k0s()),2&t){const n=e.XpG(2);e.R7$(2),e.JRh(e.bMT(3,2,"commentForAnswer")),e.R7$(2),e.Y8G("formControl",n.comments.controls[0])}}function jn(t,o){if(1&t&&(e.j41(0,"mat-form-field")(1,"mat-label"),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.nrm(4,"input",41),e.k0s()),2&t){const n=e.XpG(2);e.R7$(2),e.JRh(e.bMT(3,2,"commentForAnswer")),e.R7$(2),e.Y8G("formControl",n.comments.controls[1])}}function Gn(t,o){if(1&t&&(e.qex(0),e.j41(1,"div",24),e.eu8(2,27),e.j41(3,"div",42)(4,"mat-radio-group",43)(5,"mat-radio-button",44),e.EFF(6),e.nI1(7,"translate"),e.k0s(),e.DNE(8,wn,5,4,"mat-form-field",4),e.j41(9,"mat-radio-button",44),e.EFF(10),e.nI1(11,"translate"),e.k0s(),e.DNE(12,jn,5,4,"mat-form-field",4),e.k0s()()(),e.bVm()),2&t){const n=e.XpG(),i=e.sdS(47);e.R7$(2),e.Y8G("ngTemplateOutlet",i),e.R7$(2),e.Y8G("formControl",n.correctAnswers.controls[0]),e.R7$(),e.Y8G("value",0),e.R7$(),e.JRh(e.bMT(7,8,"false")),e.R7$(2),e.Y8G("ngIf",n.isAutoExercise),e.R7$(),e.Y8G("value",1),e.R7$(),e.JRh(e.bMT(11,10,"true")),e.R7$(2),e.Y8G("ngIf",n.isAutoExercise)}}function Dn(t,o){1&t&&(e.j41(0,"mat-error"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"formValidation.teacher.exam.questionAnswer")," "))}function On(t,o){1&t&&(e.j41(0,"mat-hint"),e.nrm(1,"span",23),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.Y8G("innerHTML",e.bMT(2,1,"separateWithComma"),e.npT))}function An(t,o){if(1&t&&(e.j41(0,"div",25)(1,"mat-form-field")(2,"mat-label"),e.EFF(3),e.nI1(4,"translate"),e.k0s(),e.nrm(5,"input",41),e.k0s()()),2&t){const n=e.XpG(2);e.R7$(3),e.JRh(e.bMT(4,2,"commentForAnswer")),e.R7$(2),e.Y8G("formControl",n.comments.controls[0])}}function Nn(t,o){if(1&t&&(e.qex(0),e.j41(1,"div",24)(2,"div",42)(3,"mat-form-field")(4,"mat-label"),e.EFF(5),e.nI1(6,"translate"),e.k0s(),e.nrm(7,"input",32),e.DNE(8,Dn,3,3,"mat-error",4)(9,On,3,3,"mat-hint",4),e.k0s()(),e.DNE(10,An,6,4,"div",35),e.k0s(),e.bVm()),2&t){const n=e.XpG();e.R7$(5),e.JRh(e.bMT(6,5,"correctAnswer")),e.R7$(2),e.Y8G("formControl",n.correctAnswers.controls[0]),e.R7$(),e.Y8G("ngIf",n.correctAnswers.controls[0].invalid&&(n.correctAnswers.controls[0].dirty||n.correctAnswers.controls[0].touched)),e.R7$(),e.Y8G("ngIf",n.extraNote),e.R7$(),e.Y8G("ngIf",n.isAutoExercise)}}function Ln(t,o){1&t&&(e.j41(0,"mat-error"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"formValidation.teacher.exam.questionAnswer")," "))}function Yn(t,o){1&t&&(e.j41(0,"mat-error"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"formValidation.teacher.exam.questionAnswer")," "))}function Vn(t,o){if(1&t&&(e.j41(0,"div",25)(1,"div",24)(2,"mat-form-field",50)(3,"mat-label"),e.EFF(4),e.nI1(5,"translate"),e.k0s(),e.nrm(6,"input",41),e.k0s()()()),2&t){const n=e.XpG().index,i=e.XpG(2);e.R7$(2),e.Y8G("ngClass",e.eq3(5,fn,!(i.answers.controls[n].invalid&&(i.answers.controls[n].dirty||i.answers.controls[n].touched))
3)),e.R7$(2),e.JRh(e.bMT(5,3,"commentForAnswer")),e.R7$(2),e.Y8G("formControl",i.comments.controls[n])}}function Pn(t,o){if(1&t){const n=e.RV6();e.j41(0,"div",47)(1,"div",48)(2,"mat-form-field")(3,"button",30),e.bIt("click",function(){const a=e.eBV(n).index,s=e.XpG(2);return e.Njj(s.deleteAnswer(a))}),e.nrm(4,"i",31),e.k0s(),e.j41(5,"mat-label"),e.EFF(6),e.nI1(7,"translate"),e.k0s(),e.nrm(8,"input",32),e.DNE(9,Ln,3,3,"mat-error",4),e.k0s()(),e.j41(10,"div",49)(11,"mat-form-field")(12,"mat-label"),e.EFF(13),e.nI1(14,"translate"),e.k0s(),e.nrm(15,"input",32),e.DNE(16,Yn,3,3,"mat-error",4),e.k0s()(),e.DNE(17,Vn,7,7,"div",35),e.k0s()}if(2&t){const n=o.index,i=e.XpG(2);e.R7$(6),e.Lme("",i.stringRef.fromCharCode(65+n),"",e.bMT(7,9,"typography.colon"),""),e.R7$(2),e.Y8G("formControl",i.answers.controls[n]),e.R7$(),e.Y8G("ngIf",i.answers.controls[n].invalid&&(i.answers.controls[n].dirty||i.answers.controls[n].touched)),e.R7$(4),e.Lme("",n+1,"",e.bMT(14,11,"typography.colon"),""),e.R7$(2),e.Y8G("formControl",i.correctAnswers.controls[n]),e.R7$(),e.Y8G("ngIf",i.correctAnswers.controls[n].invalid&&(i.correctAnswers.controls[n].dirty||i.c
3orrectAnswers.controls[n].touched)),e.R7$(),e.Y8G("ngIf",i.isAutoExercise)}}function Xn(t,o){if(1&t&&(e.qex(0),e.j41(1,"div",24)(2,"div",45),e.EFF(3),e.nI1(4,"translate"),e.k0s(),e.j41(5,"div",25),e.DNE(6,Pn,18,13,"div",46),e.k0s()(),e.bVm()),2&t){const n=e.XpG();e.R7$(3),e.SpI(" ",e.bMT(4,2,"teacherQuestionMatchCorrect")," * "),e.R7$(3),e.Y8G("ngForOf",n.answers.controls)}}function Bn(t,o){1&t&&(e.qex(0),e.j41(1,"p"),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.bVm()),2&t&&(e.R7$(2),e.JRh(e.bMT(3,1,"uploadOneOrMoreFiles")))}function qn(t,o){1&t&&(e.j41(0,"mat-error"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"formValidation.teacher.exam.questionAnswer")," "))}function Un(t,o){if(1&t){const n=e.RV6();e.j41(0,"mat-form-field")(1,"button",30),e.bIt("click",function(){const a=e.eBV(n).index,s=e.XpG(2);return e.Njj(s.deleteAnswer(a))}),e.nrm(2,"i",31),e.k0s(),e.nrm(3,"input",32),e.DNE(4,qn,3,3,"mat-error",4),e.k0s()}if(2&t){const n=o.index,i=e.XpG(2);e.R7$(3),e.Y8G("formControl",i.answers.controls[n]),e.R7$(),e.Y8G("ngIf",i.answers.controls[n].invalid&&(i.answers.controls[n].dirty||i.answers.controls[n].touched))}}function Jn(t,o){if(1&t&&(e.qex(0),e.j41(1,"div",24),e.eu8(2,27),e.j41(3,"div",51),e.DNE(4,Un,5,2,"mat-form-field",52),e.k0s()(),e.bVm()),2&t){const n=e.XpG(),i=e.sdS(47);e.R7$(2),e.Y8G("ngTemplateOutlet",i),e.R7$(2),e.Y8G("ngForOf",n.answers.controls)}}function Qn(t,o){1&t&&(e.qex(0),e.EFF(1),e.nI1(2,"translate"),e.bVm()),2&t&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"formValidation.teacher.exam.questionOnlyOneWord")," "))}function zn(t,o){1&t&&(e.EFF(0),e.nI1(1,"translate")),2&t&&e.SpI(" ",e.bMT(1,1,"formValidation.teacher.exam.questionAnswer")," ")}function Wn(t,o){if(1&t&&(e.j41(0,"mat-error"),e.DNE(1,Qn,3,3,"ng-container",55)(2,zn,2,3,"ng-template",null,3,e.C5r),e.k0s()),2&t){const n=e.sdS(3),i=e.XpG(2);e.R7$(),e.Y8G("ngIf",i.correctAnswers.controls[0].errors.pattern)("ngIfElse",n)}}function Hn(t,o){if(1&t&&(e.j41(0,"div",25)(1,"mat-form-field")(2,"mat-label"),e.EFF(3),e.nI1(4,"translate"),e.k0s(),e.nrm(5,"input",41),e.k0s()()),2&t){const n=e.XpG(2);e.R7$(3),e.JRh(e.bMT(4,2,"commentForAnswer")),e.R7$(2),e.Y8G("formControl",n.comments.controls[0])}}function Kn(t,o){if(1&t&&(e.qex(0),e.j41(1,"div",24)(2,"div",25)(3,"mat-form-field",53)(4,"mat-label"),e.EFF(5),e.nI1(6,"translate"),e.k0s(),e.nrm(7,"input",54),e.DNE(8,Wn,4,2,"mat-error",4),e.k0s()(),e.DNE(9,Hn,6,4,"div",35),e.k0s(),e.bVm()),2&t){const n=e.XpG();e.R7$(5),e.JRh(e.bMT(6,4,"correctAnswer")),e.R7$(2),e.Y8G("formControl",n.correctAnswers.controls[0]),e.R7$(),e.Y8G("ngIf",n.correctAnswers.controls[0].invalid&&(n.correctAnswers.controls[0].dirty||n.correctAnswers.controls[0].touched)),e.R7$(),e.Y8G("ngIf",n.isAutoExercise)}}function Zn(t,o){if(1&t){const n=e.RV6();e.j41(0,"div",56)(1,"div",45)(2,"button",57),e.bIt("click",function(){e.eBV(n);const a=e.XpG();return e.Njj(a.addAnswer())}),e.nrm(3,"i",58),e.EFF(4),e.nI1(5,"translate"),e.k0s()()()}if(2&t){const n=e.XpG();e.R7$(2),e.Y8G("disabled",n.answers.controls.length>=n.maxMatchOptions),e.R7$(),e.Y8G("ngClass",n.answers.controls.length>=n.maxMatchOptions?"fa-ban":"fa-circle-plus"),e.R7$(),e.SpI("",e.bMT(5,3,n.answers.controls.length>=n.maxMatchOptions?"teacherAssignmentMaxAnswers":"teacherExamAdd")," ")}}function ei(t,o){1&t&&(e.j41(0,"div",59)(1,"div",25)(2,"p",60),e.EFF(3),e.nI1(4,"translate"),e.k0s()(),e.j41(5,"div",25)(6,"mat-radio-group",61)(7,"mat-radio-button",62),e.EFF(8),e.nI1(9,"translate"),e.k0s(),e.j41(10,"mat-radio-button",63),e.EFF(11),e.nI1(12,"translate"),e.k0s()()()()),2&t&&(e.R7$(3),e.JRh(e.bMT(4,3,"evaluation.evaluation")),e.R7$(5),e.JRh(e.bMT(9,5,"teacherExamPointAll")),e.R7$(3),e.JRh(e.bMT(12,7,"teacherExamPointEach")))}function ti(t,o){if(1&t&&(e.qex(0),e.EFF(1),e.nI1(2,"translate"),e.bVm()),2&t){const n=e.XpG(3);e.R7$(),e.SpI(" ",e.i5U(2,1,"formValidation.numberToHigh",e.eq3(4,It,n.maxPoints.errors.max.max))," ")}}function ni(t,o){if(1&t&&(e.qex(0),e.EFF(1),e.nI1(2,"translate"),e.bVm()),2&t){const n=e.XpG(3);e.R7$(),e.SpI(" ",e.i5U(2,1,"formValidation.numberToLow",e.eq3(4,It,n.maxPoints.errors.min.min))," ")}}function ii(t,o){1&t&&(e.qex(0),e.EFF(1),e.nI1(2,"translate"),e.bVm()),2&t&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"formValidation.teacher.exam.questionPoints")," "))}function ai(t,o){if(1&t&&(e.j41(0,"mat-error"),e.DNE(1,ti,3,6,"ng-container",4)(2,ni,3,6,"ng-container",4)(3,ii,3,3,"ng-container",4),e.k0s()),2&t){const n=e.XpG(2);e.R7$(),e.Y8G("ngIf",null==n.maxPoints||null==n.maxPoints.errors?null:n.maxPoints.errors.max),e.R7$(),e.Y8G("ngIf",null==n.maxPoints||null==n.maxPoints.errors?null:n.maxPoints.errors.min),e.R7$(),e.Y8G("ngIf",!(null!=n.maxPoints&&null!=n.maxPoints.errors&&n.maxPoints.errors.max||null!=n.maxPoints&&null!=n.maxPoints.errors&&n.maxPoints.errors.min))}}function oi(t,o){if(1&t&&(e.j41(0,"div",24)(1,"div",64)(2,"mat-form-field")(3,"mat-label"),e.EFF(4),e.nI1(5,"translate"),e.k0s(),e.nrm(6,"input",65),e.DNE(7,ai,4,3,"mat-error",4),e.k0s()()()),2&t){const n=e.XpG();e.R7$(4),e.JRh(e.bMT(5,3,"maxPointsForQuestion")),e.R7$(2),e.Y8G("formControl",n.maxPoints),e.R7$(),e.Y8G("ngIf",n.maxPoints.invalid&&(n.maxPoints.dirty||n.maxPoints.touched))}}function si(t,o){if(1&t&&(e.j41(0,"mat-option",66),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t){const n=o.$implicit;e.Y8G("value",n.value),e.R7$(),e.SpI(" ",e.bMT(2,2,n.label)," ")}}function ri(t,o){1&t&&(e.j41(0,"mat-error"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"formValidation.teacher.exam.questionDifficulty")," "))}function li(t,o){1&t&&(e.j41(0,"div",24)(1,"div",67),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.j41(4,"div",68),e.EFF(5),e.nI1(6,"translate"),e.k0s()()),2&t&&(e.R7$(2),e.SpI(" ",e.bMT(3,2,"teacherExamAnswer")," "),e.R7$(3),e.SpI(" ",e.bMT(6,4,"teacherExamCorrect")," "))}function ci(t,o){1&t&&(e.j41(0,"div",45),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"teacherExamCorrect")," * "))}let mi=(()=>{var t;class o{constructor(){this.formBuilder=(0,e.WQX)(c.ze),this.toastrService=(0,e.WQX)(w.tw),this.translateService=(0,e.WQX)(m.c$),this.teacherEloService=(0,e.WQX)(W),this.teacherQuestionsService=(0,e.WQX)(ee.d),this.cdr=(0,e.WQX)(e.gRc),this.dialogRef=(0,e.WQX)(B.CP),this.data=(0,e.WQX)(me.y2),this.module=this.data.module,this.type=this.data.type,this.canAddAnswers=!1,this.canUpload=!1,this.extraNote=!1,this.hasEvaluation=!1,this.hasPointInput=!1,this.isAutoExercise=!1,this.isEditing=!1,this.isExam=!1,this.isLoading=!1,this.multipleComments=!1,this.selectedCorrectAns=!0,this.submitted=!1,this.stringRef=String,this.fileError="",this.showUploader=!0,this.maxMatchOptions=Y.k9,this.ALLOWED_FILE_TYPES=Y.i_,this.hadFiles=!1,this.destroy$=new y.B}ngOnInit(){this.optionsSelect=Y.bm,this.sub$=this.teacherEloService.getQuestion().pipe((0,ke.Z)(i=>this.teacherEloService.getCurrentItem().pipe((0,R.T)(a=>[i,a])))).subscribe(([i,a])=>{var s;if(this.assignmentData=a,i){const{type:r,module:l}=i;this.editQuestion=i,this.type=r,this.module=l,this.isEditing=!0}this.isAutoExercise=this.module===T.Eq.exercise&&(!!this.assignmentData&&"auto"===this.assignmentData.type||!!this.editQuestion&&"auto"===(null===(s=this.editQuestion)||void 0===s?void 0:s.type)),this.canUpload=this.module===T.Eq.exam||T.bN.includes(this.type),this.isExam=this.module===T.Eq.exam,this.multipleComments=this.isAutoExercise&&T.gO.includes(this.type),this.generateQuestionForm(),i&&this.loadAnswers(),T.yA.includes(this.type)&&(this.extraNote=!0),this.type===Y.k4.oneAnswer&&this.correctAnswers.valueChanges.subscribe(([r])=>{this.submitted=!1===r})})}ngAfterViewInit(){this.uploader&&this.uploader.filesToUpload.pipe((0,I.Q)(this.destroy$)).subscribe(i=>{this.showUploader=this.canUpload&&!(this.isExam&&1===(null==i?void 0:i.length)),this.cdr.detectChanges()})}get title(){return this.questionForm.get("formTitle")}get difficulty(){return this.questionForm.get("formDifficulty")}get question(){return this.questionForm.get("formQuestion")}get answers(){return this.questionForm.controls.answers}get correctAnswers(){return this.questionForm.controls.formCorrectAnswers}get evaluation(){return this.questionForm.get("formEvaluation")}get maxPoints(){return this.questionForm.get("maxPoints")}get comments(){return this.questionForm.controls.comments}generateQuestionForm(){if(this.questionForm=this.formBuilder.group({formTitle:["",c.k0.required],formDifficulty:["",c.k0.required],formQuestion:["",c.k0.required],attachments:this.formBuilder.array([])}),this.isAutoExercise&&!this.isEditing&&(this.questionForm.addControl("comments",this.formBuilder.array([new c.hs("")])),this.type===Y.k4.trueFalse&&this.comments.push(new c.hs(""))),T.CQ.includes(this.type)&&(this.questionForm.addControl("answers",this.formBuilder.array([])),this.editQuestion||this.answers.push(new c.hs(""))),T.f1.includes(this.type))if(this.questionForm.addControl("formCorrectAnswers",this.formBuilder.array([])),T.$0.includes(this.type)){const a=this.type===Y.k4.trueFalse?1:"";let s=[c.k0.required];this.type===Y.k4.openOneWord&&(s=[...s,c.k0.pattern(/^[^\s]+$/)]),this.correctAnswers.push(new c.hs(a,[...s]))}else T.T6.includes(this.type)?this.correctAnswers.push(new c.hs("")):this.correctAnswers.push(new c.hs(!1));T.DL.includes(this.type)&&(this.hasEvaluation=!0,this.questionForm.addControl("formEvaluation",new c.hs("all"))),T.NV.includes(this.type)&&(this.canAddAnswers=!0),T._7.includes(this.type)&&(this.hasPointInput=!0,this.questionForm.addControl("maxPoints",this.formBuilder.control(10,[c.k0.max(100),c.k0.min(1)])))}addAnswer(){this.answers.push(new c.hs(""));const i=T.T6.includes(this.type);this.correctAnswers.push(new c.hs(!!i&&"")),this.isAutoExercise&&this.comments.push(new c.hs("")),this.questionForm.updateValueAndValidity(),this.cdr.detectChanges()}deleteAnswer(i){this.type===Y.k4.oneAnswer&&this.correctAnswers.controls[0].patchValue(!1),this.answers.removeAt(i),this.correctAnswers.removeAt(i),this.isAutoExercise&&this.comments.removeAt(i),T.CQ.includes(this.type)&&!this.correctAnswers.controls.length&&this.correctAnswers.setErrors({invalid:!0}),this.cdr.detectChanges()}loadAnswers(){var i;if(this.questionForm.patchValue({formTitle:this.editQuestion.title,formQuestion:this.editQuestion.question,formDifficulty:"".concat(this.editQuestion.difficulty),formEvaluation:this.editQuestion.evaluation}),this.isAutoExercise){let a=this.editQuestion.comments;
3"string"==typeof a&&(a=[a]),this.type===Y.k4.match&&(a=Object.entries(a).map(([s,r])=>r)),this.questionForm.addControl("comments",this.formBuilder.array([])),a&&a.length?a.forEach(s=>this.comments.push(new c.hs(s))):T.LW.includes(this.type)?this.comments.push(new c.hs("")):this.editQuestion.answers.forEach(s=>{this.comments.push(new c.hs(""))})}if(null!==(i=this.editQuestion)&&void 0!==i&&null!==(i=i.attachments)&&void 0!==i&&i.length&&(this.hadFiles=!0),this.type===Y.k4.match){const{answers:a,correctAnswer:s}=this.editQuestion,{corAnswers:r,unShuffledQuestions:l}=this.teacherQuestionsService.unShuffleMatchAnswers(a,s);return this.correctAnswers.removeAt(0),void l.forEach((p,d)=>{this.answers.push(new c.hs(p)),this.correctAnswers.push(new c.hs(r[d]))})}if(T.CQ.includes(this.type)&&this.editQuestion.answers.forEach(a=>{this.answers.push(new c.hs(a))}),T.f1.includes(this.type)){const{correctAnswer:a}=this.editQuestion;if(this.type===Y.k4.fill)return void this.correctAnswers.controls[0].patchValue(a);if(this.type===Y.k4.trueFalse)return void this.correctAnswers.controls[0].patchValue(+a);if(this.type===Y.k4.openOneWord)return void this.correctAnswers.controls[0].patchValue(a);this.correctAnswers.removeAt(0),this.editQuestion.answers.forEach(s=>{this.correctAnswers.push(new c.hs)})}if(this.type===Y.k4.oneAnswer&&this.correctAnswers.controls[0].patchValue(+this.editQuestion.correctAnswer),T._7.includes(this.type)&&this.questionForm.controls.maxPoints.patchValue(this.editQuestion.maxPoints),this.type===Y.k4.moreAnswers){const a=[...this.editQuestion.correctAnswer].map(s=>+s);this.correctAnswers.controls.forEach((s,r)=>{a.includes(r)&&this.correctAnswers.controls[r].patchValue(!0)})}}onSubmit(){var i;if(!this.submitted){if(!this.questionForm.valid)return void this.toastrService.error(this.translateService.instant("formValidation.fieldsObligated"));if(this.type===Y.k4.oneAnswer&&(null===(i=this.answers)||void 0===i?void 0:i.length)<=1)return void this.toastrService.error(this.translateService.instant("formValidation.teacher.exam.questionToFewAnswers"));this.submitted=!0,this.selectedCorrectAns=!0,this.handleQuestionUpload()}}handleQuestionUpload(){this.isLoading=!0;const{formTitle:i,formQuestion:a,answers:s,formDifficulty:r,formEvaluation:p="one"}=this.questionForm.value;
3let d={title:i,type:this.type,question:a,answers:s,correctAnswer:null,evaluation:p,difficulty:+r,template:0,source:null};if(T.o5.includes(this.module)&&T._7.includes(this.type)){const{maxPoints:$}=this.questionForm.value;d=(0,g.A)((0,g.A)({},d),{},{maxPoints:$})}if(this.uploader){const $=this.uploader.filesToUpload.getValue();$.length&&(d.attachments=$.map(k=>k.hasOwnProperty("file")?null==k?void 0:k.file:k)),this.hadFiles&&!$.length&&(d.attachments=[null])}if(this.type===Y.k4.moreAnswers){const $=this.questionForm.value.formCorrectAnswers.map((k,M)=>{if(k)return M}).filter(k=>k>=0);if($.length<1)return this.selectedCorrectAns=!1,this.submitted=!1,void(this.isLoading=!1);d.correctAnswer=$}if(T.F.includes(this.type)&&(d.correctAnswer=this.questionForm.value.formCorrectAnswers[0]),this.type===Y.k4.fill){d.answers=null;const{formCorrectAnswers:$}=this.questionForm.value;d.correctAnswer=$.join(",")}if(this.type===Y.k4.match){const{formCorrectAnswers:$}=this.questionForm.value,{answerArray:k,correctState:M}=this.teacherQuestionsService.shuffleMatchAnswers(s,$);d.answers=k,d.correctAnswer=M}T.CQ.includes(this.type)||delete d.answers,this.isEditing&&(d.question_id=this.editQuestion.id),this.isAutoExercise&&(d.comments=this.type===Y.k4.match?this.questionForm.value.comments.map(($,k)=>["".concat(String.fromCharCode(65+k)),$]):this.questionForm.value.comments);const{courseId:h,id:v}=this.assignmentData;this.teacherQuestionsService.createQuestion(this.module,+v,+h,d,this.isEditing).subscribe($=>{const{status:k,body:{data:M}}=$;201===k||200===k?(this.isEditing?this.teacherEloService.updateQuestionInQuestionList(M):this.teacherEloService.addQuestionToQuestionList(M),this.questionForm.reset(),this.dialogRef.close(),this.submitted=!1,this.isLoading=!1,this.toastrService.success(this.translateService.instant("successLabel"))):(this.isLoading=!1,this.submitted=!1,this.toastrService.error(this.translateService.instant("errorLabel")))})}ngOnDestroy(){this.sub$&&this.sub$.unsubscribe(),this.destroy$.next(),this.destroy$.complete()}}return(t=o).\u0275fac=function(i){return new(i||t)},t.\u0275cmp=e.VBU({type:t,selectors:[["app-teacher-assignment-question"]],viewQuery:function(i,a){if(1&i&&e.GBs(_n,5),2&i){let s;e.mGM(s=e.lsd())&&(a.uploader=s.first)}},decls:48,vars:39,consts:[["answerAndCorrectLabel",""],["correctLabel",""],["uploader",""],["otherError",""],[4,"ngIf"],[3,"ngSubmit","formGroup"],["mat-dialog-content","",1,"question-dialog"],["matInput","","type","text","formControlName","formTitle","required",""],[1,"mb-4"],["matInput","","cdkTextareaAutosize","","cdkAutosizeMinRows","4","type","text","formControlName","formQuestion","required",""],["class","row",4,"ngIf"],[3,"ngSwitch"],[4,"ngSwitchCase"],["class","row pt-4",4,"ngIf"],["class","row text-left pt-3",4,"ngIf"],[1,"row","text-left"],[1,"col-md-12","mx-auto",3,"ngClass"],["appearance","fill"],["appRemoveAriaOwns",""],["formControlName","formDifficulty"],[3,"value",4,"ngFor","ngForOf"],["mat-dialog-actions","","align","end"],["mat-raised-button","","color","primary","type","submit",3,"disabled"],[3,"innerHTML"],[1,"row"],[1,"col-12"],["placeholder","examFileUploadPlaceholder","buttonText","uploadFile",3,"uploadIcon","maxFiles","multiple","showFileNames","showUploader","files","allowedFileTypes"],[3,"ngTemplateOutlet"],["class","row",4,"ngFor","ngForOf"],[1,"col-10","col-md-11"],["mat-icon-button","","color","danger-inverted","type","button","matPrefix","",1,"small-icon-button",3,"click"],[1,"fa-solid","fa-circle-minus","c-p"],["matInput","","type","text","required","",3,"formControl"],[1,"col-2","col-md-1","d-flex","flex-column","justify-content-center","align-items-center"],[3,"formControl"],["class","col-12",4,"ngIf"],["matInput","","type","text","id","formAnswerComment",3,"formControl"],[1,"text-danger"],["color","primary",1,"row",3,"formControl"],["class","col-12",4,"ngFor","ngForOf"],["required","",3,"id","value"],["matInput","","type","text",3,"formControl"],["formArrayName","formCorrectAnswers",1,"col-12"],["aria-label","Select an option","color","primary",1,"d-flex","flex-column",3,"formControl"],[1,"no-left-padding",3,"value"],[1,"col-12","text-left"],["class","row my-3",4,"ngFor","ngForOf"],[1,"row","my-3"],[1,"col-12","col-sm-6"],["formArrayName","formCorrectAnswers",1,"col-12","col-sm-6"],[1,"col-12",3,"ngClass"],["formArrayName","answers",1,"col-12"],[4,"ngFor","ngForOf"],["formArrayName","formCorrectAnswers"],["matInput","","type","text","id","maxPoints","required","",3,"formControl"],[4,"ngIf","ngIfElse"],[1,"row","pt-4"],["mat-flat-button","","color","accent-inverted","type","button","role","button",1,"px-1",3,"click","disabled"],[1,"fa-solid","f-s","mr-2",3,"ngClass"],[1,"row","text-left","pt-3"],[1,"mb-0"],["aria-label","Select an option","color","primary","formControlName","formEvaluation",1,"d-flex","flex-column"],["value","all"],["value","one"],[1,"col-12","col-md-6","col-xl-4"],["matInput","","type","number","min","1","max","100","required","",3,"formControl"],[3,"value"],[1,"col-6","text-left"],[1,"col-6","text-right"]],template:function(i,a){if(1&i){const s=e.RV6();e.DNE(0,gn,1,0,"app-spinner",4),e.j41(1,"form",5),e.bIt("ngSubmit",function(){return e.eBV(s),e.Njj(a.onSubmit())}),e.j41(2,"div",6)(3,"mat-form-field")(4,"mat-label"),e.EFF(5),e.nI1(6,"translate"),e.k0s(),e.nrm(7,"input",7),e.DNE(8,vn,3,3,"mat-error",4),e.k0s(),e.j41(9,"mat-form-field",8)(10,"mat-label"),e.EFF(11),e.nI1(12,"translate"),e.nI1(13,"titlecase"),e.k0s(),e.nrm(14,"textarea",9),e.DNE(15,bn,3,3,"mat-error",4)(16,Tn,3,3,"mat-hint",4),e.k0s(),e.DNE(17,Cn,4,7,"div",10)(18,xn,1,0,"hr",4),e.qex(19,11),e.DNE(20,yn,6,3,"ng-container",12)(21,Mn,4,3,"ng-container",12)(22,Gn,13,12,"ng-container",12)(23,Nn,11,7,"ng-container",12)(24,Xn,7,4,"ng-container",12)(25,Bn,4,3,"ng-container",12)(26,Jn,5,2,"ng-container",12)(27,Kn,10,6,"ng-container",12),e.bVm(),e.DNE(28,Zn,6,5,"div",13)(29,ei,13,9,"div",14)(30,oi,8,5,"div",10),e.j41(31,"div",15)(32,"div",16)(33,"mat-form-field",17)(34,"mat-label",18),e.EFF(35),e.nI1(36,"translate"),e.k0s(),e.j41(37,"mat-select",19),e.DNE(38,si,3,4,"mat-option",20),e.k0s(),e.DNE(39,ri,3,3,"mat-error",4),e.k0s()()()(),e.j41(40,"div",21)(41,"button",22),e.EFF(42),e.nI1(43,"translate"),e.k0s()()(),e.DNE(44,li,7,6,"ng-template",null,0,e.C5r)(46,ci,3,3,"ng-template",null,1,e.C5r)}2&i&&(e.Y8G("ngIf",a.isLoading),e.R7$(),e.Y8G("formGroup",a.questionForm),e.R7$(4),e.JRh(e.bMT(6,27,"teacherExamTitle")),e.R7$(3),e.Y8G("ngIf",a.title.invali
3d&&(a.title.dirty||a.title.touched)),e.R7$(3),e.JRh(e.bMT(13,31,e.bMT(12,29,"teacherExamQuestion"))),e.R7$(4),e.Y8G("ngIf",a.question.invalid&&(a.question.dirty||a.question.touched)),e.R7$(),e.Y8G("ngIf",a.extraNote),e.R7$(),e.Y8G("ngIf",a.canUpload),e.R7$(),e.Y8G("ngIf",a.canUpload),e.R7$(),e.Y8G("ngSwitch",a.type),e.R7$(),e.Y8G("ngSwitchCase","moreAnswers"),e.R7$(),e.Y8G("ngSwitchCase","oneAnswer"),e.R7$(),e.Y8G("ngSwitchCase","trueFalse"),e.R7$(),e.Y8G("ngSwitchCase","fill"),e.R7$(),e.Y8G("ngSwitchCase","match"),e.R7$(),e.Y8G("ngSwitchCase","openBox"),e.R7$(),e.Y8G("ngSwitchCase","openOrder"),e.R7$(),e.Y8G("ngSwitchCase","openOneWord"),e.R7$(),e.Y8G("ngIf",a.canAddAnswers),e.R7$(),e.Y8G("ngIf",a.hasEvaluation),e.R7$(),e.Y8G("ngIf",a.hasPointInput),e.R7$(2),e.Y8G("ngClass",e.eq3(37,hn,!a.hasPointInput)),e.R7$(3),e.JRh(e.bMT(36,33,"teacherExamChooseDifficulty")),e.R7$(3),e.Y8G("ngForOf",a.optionsSelect),e.R7$(),e.Y8G("ngIf",a.difficulty.invalid&&(a.difficulty.dirty||a.difficulty.touched)),e.R7$(2),e.Y8G("disabled",a.questionForm.invalid||a.submitted),e.R7$(),e.SpI(" ",e.bMT(43,35,"teacherExamSave")," "))},dependencies:[u.YU,u.Sq,u.bT,u.T3,u.ux,u.e1,c.qT,c.me,c.Q0,c.BC,c.cb,c.YS,c.VZ,c.zX,c.l_,c.j4,c.JD,c.v8,E.$z,E.iY,ne.fg,A.rl,A.nJ,A.MV,A.TL,A.JW,Me.xb,xe.VO,Ie.wT,B.E7,B.Yi,Xe.So,xt.VT,xt._g,he.t,ze.P,Be.K,u.PV,m.D9],styles:[".mat-mdc-dialog-content.question-dialog[_ngcontent-%COMP%]{max-height:var(--size-initial)}\n\n/*# sourceMappingURL=teacher-assignment-question.component.css.map*/"]}),o})();const Rt=["type","title","question","difficulty","points"],Ft=[{label:"type",columnRef:"type",property:"type"},{label:"title",columnRef:"title",property:"title"},{label:"question",columnRef:"question",property:"question"},{label:"difficulty",columnRef:"difficulty",property:"difficulty"},{label:"points",columnRef:"points",property:"maxPoints"}],pi={columns:["number",...Rt,"edit","delete"],table:[{label:"#",columnRef:"number",property:""},...Ft,{label:"edit",columnRef:"edit",property:"edit"},{label:"delete",columnRef:"delete",property:"delete"}]},di={columns:["add",...Rt],table:[{label:"toAdd",columnRef:"add",property:""},...Ft]};var kt=f(35027),De=f(20209),We=f(86571),ui=f(87912),ge=f(50565),Re=f(80640),He=f(93631),Fe=f(51731);const _i=t=>({"mt-3":t}),hi=()=>({content:""}),yt=t=>({title:t}),fi=t=>({"min-height.px":t}),Et=t=>({number:t}),St=t=>({value:t});function gi(t,o){if(1&t&&(e.qex(0),e.j41(1,"div",19)(2,"strong"),e.eu8(3,20),e.k0s()(),e.bVm()),2&t){const n=o.$implicit;e.XpG(2);const i=e.sdS(15),a=e.sdS(17);e.R7$(3),e.Y8G("ngTemplateOutlet",n.indexOf("Translate")>-1?a:i)("ngTemplateOutletContext",e.eq3(2,yt,n))}}function vi(t,o){if(1&t&&(e.j41(0,"div",16)(1,"div",17)(2,"strong"),e.EFF(3),e.nI1(4,"translate"),e.k0s()(),e.DNE(5,gi,4,4,"ng-container",18),e.k0s()),2&t){const n=e.XpG();e.R7$(3),e.JRh(e.i5U(4,2,"typography.number_sign",e.lJ4(5,hi))),e.R7$(2),e.Y8G("ngForOf",n.fieldsToShow)}}function bi(t,o){if(1&t&&e.nrm(0,"div",24),2&t){const n=e.XpG(2);e.Y8G("ngStyle",e.eq3(1,fi,n.placeholderHeight))}}function Ti(t,o){if(1&t&&(e.j41(0,"p")(1,"span",29),e.eu8(2,20),e.k0s(),e.eu8(3,20),e.k0s()),2&t){const n=e.XpG().$implicit,i=e.XpG(3),a=e.sdS(15),s=e.sdS(17),r=e.sdS(21),l=e.sdS(23);e.R7$(2),e.Y8G("ngTemplateOutlet",n.key.indexOf("Translate")>-1?s:a)("ngTemplateOutletContext",e.eq3(4,yt,n.key)),e.R7$(),e.Y8G("ngTemplateOutlet",n.value.length<i.longTextThreshold?r:l)("ngTemplateOutletContext",e.eq3(6,St,n.value))}}function Ci(t,o){if(1&t&&(e.qex(0),e.DNE(1,Ti,4,8,"p",28),e.bVm()),2&t){const n=o.$implicit,i=e.XpG(3);e.R7$(),e.Y8G("ngIf",i.fieldsToShow.includes(n.key))}}function xi(t,o){if(1&t&&(e.qex(0),e.j41(1,"div",25)(2,"div",7)(3,"div",26),e.eu8(4,20),e.k0s(),e.j41(5,"div",27),e.DNE(6,Ci,2,1,"ng-container",18),e.nI1(7,"keyvalue"),e.k0s()()(),e.bVm()),2&t){const n=e.XpG(),i=n.$implicit,a=n.index,s=e.XpG(),r=e.sdS(19);e.R7$(4),e.Y8G("ngTemplateOutlet",r)("ngTemplateOutletContext",e.eq3(6,Et,a+1)),e.R7$(2),e.Y8G("ngForOf",e.i5U(7,3,i,s.originalOrder))}}function Ii(t,o){if(1&t&&(e.j41(0,"div",19),e.eu8(1,20),e.k0s()),2&t){const n=e.XpG().$implicit,i=e.XpG(3),a=e.sdS(21
3),s=e.sdS(23);e.R7$(),e.Y8G("ngTemplateOutlet",n.value.length<i.longTextThreshold?a:s)("ngTemplateOutletContext",e.eq3(2,St,n.value))}}function Ri(t,o){if(1&t&&(e.qex(0),e.DNE(1,Ii,2,4,"div",31),e.bVm()),2&t){const n=o.$implicit,i=e.XpG(3);e.R7$(),e.Y8G("ngIf",i.fieldsToShow.includes(n.key))}}function Fi(t,o){if(1&t&&(e.j41(0,"div",30),e.eu8(1,20),e.k0s(),e.DNE(2,Ri,2,1,"ng-container",18),e.nI1(3,"keyvalue")),2&t){const n=e.XpG(),i=n.$implicit,a=n.index,s=e.XpG(),r=e.sdS(19);e.R7$(),e.Y8G("ngTemplateOutlet",r)("ngTemplateOutletContext",e.eq3(6,Et,a+1)),e.R7$(),e.Y8G("ngForOf",e.i5U(3,3,i,s.originalOrder))}}function ki(t,o){if(1&t){const n=e.RV6();e.j41(0,"div",21),e.bIt("cdkDragStarted",function(a){e.eBV(n);const s=e.XpG();return e.Njj(s.cdkDragStarted(a))}),e.DNE(1,bi,1,3,"div",22),e.j41(2,"div",23),e.DNE(3,xi,8,8,"ng-container",15)(4,Fi,4,8,"ng-template",null,6,e.C5r),e.k0s()()}if(2&t){const n=e.sdS(5),i=e.XpG();e.Y8G("cdkDragStartDelay",i.isMobile||i.isTabletLandscape?100:null),e.R7$(3),e.Y8G("ngIf",i.isMobile)("ngIfElse",n)}}function yi(t,o){1&t&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.JRh(e.bMT(2,1,"cancel")))}function Ei(t,o){1&t&&e.nrm(0,"i",36)}function Si(t,o){1&t&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.JRh(e.bMT(2,1,"save")))}function $i(t,o){1&t&&e.nrm(0,"i",37)}function Mi(t,o){if(1&t){const n=e.RV6();e.qex(0),e.j41(1,"button",32),e.nI1(2,"translate"),e.bIt("click",function(){e.eBV(n);const a=e.XpG();return e.Njj(a.onCancelSort())}),e.DNE(3,yi,3,3,"span",28)(4,Ei,1,0,"i",33),e.k0s(),e.j41(5,"button",34),e.nI1(6,"translate"),e.bIt("click",function(){e.eBV(n);const a=e.XpG();return e.Njj(a.onSaveData())}),e.DNE(7,Si,3,3,"span",28)(8,$i,1,0,"i",35),e.k0s(),e.bVm()}if(2&t){const n=e.XpG();e.R7$(),e.Y8G("matTooltip",e.bMT(2,7,"cancel")),e.R7$(2),e.Y8G("ngIf",!n.isMobile),e.R7$(),e.Y8G("ngIf",n.isMobile),e.R7$(),e.Y8G("matTooltip",e.bMT(6,9,"save"))("disabled",n.isTouched),e.R7$(2),e.Y8G("ngIf",!n.isMobile),e.R7$(),e.Y8G("ngIf",n.isMobile)}}function wi(t,o){1&t&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.JRh(e.bMT(2,1,"cancel")))}function ji(t,o){1&t&&e.nrm(0,"i",36)}function Gi(t,o){1&t&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.JRh(e.bMT(2,1,"save")))}function Di(t,o){1&t&&e.nrm(0,"i",37)}function Oi(t,o){if(1&t){const n=e.RV6();e.j41(0,"button",38),e.nI1(1,"translate"),e.bIt("click",function(){e.eBV(n);const a=e.XpG();return e.Njj(a.onCancelSort())}),e.DNE(2,wi,3,3,"span",28)(3,ji,1,0,"i",33),e.k0s(),e.j41(4,"button",39),e.nI1(5,"translate"),e.bIt("click",function(){e.eBV(n);const a=e.XpG();return e.Njj(a.onSaveData())}),e.DNE(6,Gi,3,3,"span",28)(7,Di,1,0,"i",35),e.k0s()}if(2&t){const n=e.XpG();e.Y8G("matTooltip",e.bMT(1,7,"cancel")),e.R7$(2),e.Y8G("ngIf",!n.isMobile),e.R7$(),e.Y8G("ngIf",n.isMobile),e.R7$(),e.Y8G("matTooltip",e.bMT(5,9,"save"))("disabled",n.isTouched),e.R7$(2),e.Y8G("ngIf",!n.isMobile),e.R7$(),e.Y8G("ngIf",n.isMobile)}}function Ai(t,o){1&t&&(e.EFF(0),e.nI1(1,"translate"),e.nI1(2,"titleCaseFirstWord"),e.nI1(3,"translate")),2&t&&e.Lme("",e.bMT(2,4,e.bMT(1,2,o.title)),"",e.bMT(3,6,"typography.colon"),"")}function Ni(t,o){1&t&&(e.EFF(0),e.nI1(1,"translate"),e.nI1(2,"titleCaseFirstWord"),e.nI1(3,"translate")),2&t&&e.Lme("",e.bMT(2,4,e.bMT(1,2,o.title.replace("Translate",""))),"",e.bMT(3,6,"typography.colon"),"")}function Li(t,o){if(1&t&&(e.nrm(0,"i",40),e.j41(1,"p",41),e.EFF(2),e.k0s()),2&t){const n=o.number;e.R7$(2),e.SpI(" ",n," ")}}function Yi(t,o){if(1&t&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t){const n=o.value;e.R7$(),e.SpI(" ",e.bMT(2,1,n)," ")}}function Vi(t,o){1&t&&e.nrm(0,"app-read-more-less",42),2&t&&e.Y8G("text",o.value)("characters",80)("icon",!0)}let Pi=(()=>{var t;class o{constructor(i,a){this.breakpointObserver=i,this.deviceService=a,this.longTextThreshold=150,this.save=new e.bkB,this.cancel=new e.bkB,this.isMobile=!1,this.isTouched=!0,this.originalOrder=(s,r)=>0}ngOnInit(){this.isMobile=this.deviceService.isTablet()||this.deviceService.isMobile(),this.isMobile||(this.breakPoint$=this.breakpointObserver.observe(["(max-width: 768px)"]).subscribe(i=>{const{matches:a}=i;this.isMobile=a||!1}))}handleOnDrop(i){this.isTouched&&(this.isTouched=!1),(0,We.HD)(this.data,i.previousIndex,i.currentIndex)}cdkDragStarted(i){const{offsetHeight:a}=i.source.element.nativeElement;this.placeholderHeight=a}onCancelSort(){this.cancel.emit(null)}onSaveData(){this.save.emit(this.data)}ngOnDestroy(){this.breakPoint$&&this.breakPoint$.unsubscribe()}}return(t=o).\u0275fac=function(i){return new(i||t)(e.rXU(ui.QP),e.rXU(ge.Kg))},t.\u0275cmp=e.VBU({type:t,selectors:[["app-table-drag-and-drop"]],inputs:{data:"data",fieldsToShow:"fieldsToShow",longTextThreshold:"longTextThreshold"},outputs:{save:"save",cancel:"cancel"},decls:24,vars:12,consts:[["desktopCta",""],["translateTitle",""],["replaceTitle",""],["rowNumber",""],["normalText",""],["longText",""],["desktop",""],[1,"row"],[1,"col-12","py-2"],[1,"fa-solid","fa-circle-info","mr-2"],["class","row mb-2 dnd-titles",4,"ngIf"],["cdkDropList","",1,"dnd-list",3,"cdkDropListDropped","cdkDropListData"],["class","dnd-box","cdkDrag","","cdkDragPreviewContainer","parent",3,"cdkDragStartDelay","cdkDragStarted",4,"ngFor","ngForOf"],[1,"d-flex",3,"ngClass"],[1,"button-container","justify-content-end",3,"ngClass"],[4,"ngIf","ngIfElse"],[1,"row","mb-2","dnd-titles"],[1,"col-1","text-center"],[4,"ngFor","ngForOf"],[1,"col"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],["cdkDrag","","cdkDragPreviewContainer","parent",1,"dnd-box",3,"cdkDragStarted","cdkDragStartDelay"],["class","dnd-placeholder w-100",3,"ngStyle",4,"cdkDragPlaceholder"],[1,"row","dnd-item"],[1,"dnd-placeholder","w-100",3,"ngStyle"],[1,"col-12","item"],[1,"col-2","dnd-item_first","d-flex","flex-row","justify-content-center","align-items-center","pr-0"],[1,"col-10"],[4,"ngIf"],[1,"dnd-title"],[1,"col-1","dnd-item_first","d-flex","flex-row","justify-content-center","align-items-center"],["class","col",4,"ngIf"],["mat-fab","","color","accent","placement","top","type","button",3,"click","matTooltip"],["class","fa-solid fa-ban",4,"ngIf"],["mat-fab","","color","primary","placement","top","type","button",3,"click","matTooltip","disabled"],["class","fa-solid fa-floppy-disk",4,"ngIf"],[1,"fa-solid","fa-ban"],[1,"fa-solid","fa-floppy-disk"],["mat-raised-button","","color","accent","placement","top","type","button",1,"text-uppercase",3,"click","matTooltip"],["mat-raised-button","","color","primary","placement","top","type","button",1,"text-uppercase",3,"click","matTooltip","disabled"],[1,"fa-solid","fa-sort","mr-2"],[1,"count"],[1,"d-inline-block",3,"text","characters","icon"]],template:function(i,a){if(1&i){const s=e.RV6();e.j41(0,"div",7)(1,"div",8)(2,"p"),e.nrm(3,"i",9),e.EFF(4),e.nI1(5,"translate"),e.k0s()()(),e.DNE(6,vi,6,6,"div",10),e.j41(7,"div",11),e.bIt("cdkDropListDropped",function(l){return e.eBV(s),e.Njj(a.handleOnDrop(l))}),e.DNE(8,ki,6,3,"div",12),e.k0s(),e.j41(9,"div",13)(10,"div",14),e.DNE(11,Mi,9,11,"ng-container",15)(12,Oi,8,11,"ng-template",null,0,e.C5r),e.k0s()(),e.DNE(14,Ai,4,8,"ng-template",null,1,e.C5r)(16,Ni,4,8,"ng-template",null,2,e.C5r)(18,Li,3,1,"ng-template",null,3,e.C5r)(20,Yi,3,3,"ng-template",null,4,e.C5r)(22,Vi,1,3,"ng-template",null,5,e.C5r)}if(2&i){const s=e.sdS(13);e.R7$(4),e.JRh(e.bMT(5,8,"reorderInfo")),e.R7$(2),e.Y8G("ngIf",!a.isMobile),e.R7$(),e.Y8G("cdkDropListData",a.data),e.R7$(),e.Y8G("ngForOf",a.data),e.R7$(),e.Y8G("ngClass",a.isMobile?"f
3ixed-action-btn flex-row":"col-12 justify-content-end py-2"),e.R7$(),e.Y8G("ngClass",e.eq3(10,_i,!a.isMobile)),e.R7$(),e.Y8G("ngIf",a.isMobile)("ngIfElse",s)}},dependencies:[u.YU,u.Sq,u.bT,u.T3,u.B3,We.O7,We.T1,We.EM,E.$z,E.Sr,Re.oV,He.K,u.lG,m.D9,Fe.p],styles:['.dnd-titles[_ngcontent-%COMP%]:after{content:"";width:var(--size-100-percent);margin:var(--space-0) var(--space-15px);padding-top:var(--space-15px);border-bottom:var(--border-xxs-solid-tint-4)}.dnd-list[_ngcontent-%COMP%] .item[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{text-align:left}.dnd-box[_ngcontent-%COMP%]{border-bottom:var(--border-xxs-solid-tint-4);cursor:move}.dnd-box[_ngcontent-%COMP%]:nth-child(1) .dnd-item[_ngcontent-%COMP%]{padding-top:var(--space-0)}.dnd-item[_ngcontent-%COMP%]{padding:var(--space-5px) var(--space-0)}.dnd-item_first[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{display:none}.dnd-list.cdk-drop-list-dragging[_ngcontent-%COMP%] .cdk-drag-preview[_ngcontent-%COMP%] .dnd-item[_ngcontent-%COMP%] .dnd-item_first[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{display:block;padding-left:var(--space-15px)}.item[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:var(--space-0);padding:var(--space-4px) var(--space-0)}.item[_ngcontent-%COMP%] .dnd-title[_ngcontent-%COMP%]{font-weight:var(--font-weight-bold)}.dnd-placeholder[_ngcontent-%COMP%]{background:var(--color-tint-5);transition:var(--transition-property-transform) var(--duration-250) var(--behavior-function-cubic-1);min-height:var(--size-60px);border:var(--border-sm-dotted-tint-7);cursor:move}.cdk-drag-preview[_ngcontent-%COMP%]{background:var(--color-tint-1);border:var(--border-style-none);border-radius:var(--border-radius-xs);cursor:move;box-shadow:var(--shadow-lg)}.cdk-drag-animating[_ngcontent-%COMP%]{transition:var(--transition-property-transform) var(--duration-250) var(--behavior-function-cubic-1)}.dnd-list.cdk-drop-list-dragging[_ngcontent-%COMP%] .dnd-box[_ngcontent-%COMP%]:not(.cdk-drag-placeholder){transition:var(--transition-property-transform) var(--duration-250) var(--behavior-function-cubic-1)}.dnd-box[_ngcontent-%COMP%]:active{box-shadow:var(--shadow-lg)}.numbering[_ngcontent-%COMP%]{width:var(--size-icon-md)}.count[_ngcontent-%COMP%]{min-width:var(--size-icon-md);text-align:center;margin:var(--space-0)}.fixed-action-btn[_ngcontent-%COMP%]{bottom:var(--space-0);right:var(--space-0);padding:var(--space-15px)}.btn-floating[_ngcontent-%COMP%]{border:var(--border-style-none);display:flex;flex-direction:row;align-items:center;justify-content:center}\n\n/*# sourceMappingURL=table-drag-and-drop.component.css.map*/']}),o})();var ve=f(24624),Oe=f(31034),Ae=f(55327);const Xi=t=>({"px-0":t}),Bi=t=>({"no-modal-footer":t}),qi=t=>({type:t}),Ui=t=>({min:t});function Ji(t,o){if(1&t&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"translate"),e.nI1(3,"titleCaseFirstWord"),e.k0s()),2&t){const n=e.XpG(2);e.R7$(),e.SpI(" ",e.bMT(3,4,e.i5U(2,1,"formValidation.teacher.exam.nameError",e.eq3(6,qi,n.singleType)))," ")}}function Qi(t,o){if(1&t&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t){const n=e.XpG(2);e.R7$(),e.SpI(" ",e.i5U(2,1,"formValidation.tooShort",e.eq3(4,Ui,null==n.name.errors||null==n.name.errors.minlength?null:n.name.errors.minlength.requiredLength))," ")}}function zi(t,o){if(1&t&&(e.j41(0,"mat-error"),e.DNE(1,Ji,4,8,"span",5)(2,Qi,3,6,"span",5),e.k0s()),2&t){const n=e.XpG();e.R7$(),e.Y8G("ngIf",null==n.name||null==n.name.errors?null:n.name.errors.required),e.R7$(),e.Y8G("ngIf",null==n.name||null==n.name.errors?null:n.name.errors.minlength)}}function Wi(t,o){if(1&t&&(e.j41(0,"mat-option",15),e.EFF(1),e.k0s()),2&t){const n=o.$implicit;e.Y8G("value",n.value),e.R7$(),e.SpI(" ",n.label," ")}}function Hi(t,o){if(1&t&&(e.j41(0,"mat-form-field",3)(1,"mat-label",12),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.j41(4,"mat-select",13),e.DNE(5,Wi,2,2,"mat-option",14),e.k0s()()),2&t){const n=e.XpG();e.R7$(2),e.JRh(e.bMT(3,2,"time")),e.R7$(3),e.Y8G("ngForOf",n.optionsTime)}
3}function Ki(t,o){1&t&&(e.j41(0,"mat-form-field",3)(1,"mat-label",12),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.j41(4,"mat-select",16)(5,"mat-option",15),e.EFF(6),e.nI1(7,"translate"),e.k0s(),e.j41(8,"mat-option",15),e.EFF(9),e.nI1(10,"translate"),e.k0s()()()),2&t&&(e.R7$(2),e.JRh(e.bMT(3,5,"taskObliged")),e.R7$(3),e.Y8G("value",1),e.R7$(),e.SpI(" ",e.bMT(7,7,"yes")," "),e.R7$(2),e.Y8G("value",0),e.R7$(),e.SpI(" ",e.bMT(10,9,"no")," "))}function Zi(t,o){if(1&t&&(e.j41(0,"mat-option",15),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t){const n=o.$implicit;e.Y8G("value",n.value),e.R7$(),e.SpI(" ",e.bMT(2,2,n.label)," ")}}function ea(t,o){if(1&t){const n=e.RV6();e.j41(0,"button",19),e.bIt("click",function(){e.eBV(n);const a=e.XpG(2);return e.Njj(null==a.createForm||null==a.createForm.controls||null==a.createForm.controls.chapter?null:a.createForm.controls.chapter.patchValue(""))}),e.nrm(1,"i",20),e.k0s()}}function ta(t,o){if(1&t&&(e.j41(0,"mat-form-field",3)(1,"mat-label",12),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.j41(4,"mat-select",17),e.DNE(5,Zi,3,4,"mat-option",14),e.k0s(),e.DNE(6,ea,2,0,"button",18),e.k0s()),2&t){const n=e.XpG();e.R7$(2),e.JRh(e.bMT(3,3,"chapter")),e.R7$(3),e.Y8G("ngForOf",n.optionsChapters),e.R7$(),e.Y8G("ngIf",null==n.createForm||null==n.createForm.controls||null==n.createForm.controls.chapter?null:n.createForm.controls.chapter.value)}}function na(t,o){if(1&t&&(e.j41(0,"mat-option",15),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t){const n=o.$implicit;e.Y8G("value",n.value),e.R7$(),e.SpI(" ",e.bMT(2,2,n.label)," ")}}function ia(t,o){if(1&t&&(e.j41(0,"mat-form-field",3)(1,"mat-label",12),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.j41(4,"mat-select",21),e.DNE(5,na,3,4,"mat-option",14),e.k0s()()),2&t){const n=e.XpG();e.R7$(2),e.JRh(e.bMT(3,2,"type")),e.R7$(3),e.Y8G("ngForOf",n.isExam?n.optionsExamType:n.optionsExercises)}}function aa(t,o){if(1&t){const n=e.RV6();e.j41(0,"button",22),e.bIt("click",function(){e.eBV(n);const a=e.XpG();return e.Njj(a.onCloseModal())}),e.EFF(1),e.nI1(2,"translate"),e.k0s()}if(2&t){const n=e.XpG();e.Y8G("disabled",n.isFormSubmitting),e.R7$(),e.SpI(" ",e.bMT(2,2,"closeBtnTxt")," ")}}function oa(t,o){1&t&&e.nrm(0,"app-inner-loader",26),2&t&&e.Y8G("inline",!0)}function sa(t,o){if(1&t&&(e.j41(0,"button",23),e.DNE(1,oa,1,1,"app-inner-loader",24),e.EFF(2),e.nI1(3,"translate"),e.nrm(4,"i",25),e.k0s()),2&t){const n=e.XpG(),i=e.sdS(16);e.Y8G("matMenuTriggerFor",i)("disabled",n.isCopying)("disabled",n.isCopying),e.R7$(),e.Y8G("ngIf",n.isCopying),e.R7$(),e.SpI(" ",e.bMT(3,5,"copy"+n.typeCapitalized)," ")}}function ra(t,o){if(1&t){const n=e.RV6();e.j41(0,"button",27),e.bIt("click",function(){const a=e.eBV(n).$implicit,s=e.XpG();return e.Njj(s.copyTo(a.id))}),e.EFF(1),e.k0s()}if(2&t){const n=o.$implicit;e.R7$(),e.E5c(" ",n.courseName," (",n.type,") (",n.id,") ")}}let $t=(()=>{var t;class o{get name(){return this.createForm.controls.name}get time(){return this.createForm.controls.time}get obliged(){return this.createForm.controls.obliged}get type(){return this.createForm.controls.type}get chapter(){return this.createForm.controls.chapter}constructor(i,a,s,r,l,p,d,h){this.formBuilder=i,this.teacherEloService=a,this.translateService=s,this.toastrService=r,this.websiteService=l,this.teacherQuestionsService=p,this.route=d,this.teacherService=h,this.closeModal=new e.bkB(null),this.isFormSubmitting=!1,this.isExam=!1,this.isTask=!1,this.isExercise=!1,this.optionsTime=T.Bp,this.optionsExamType=T.Oh,this.optionsExercises=T.$_,this.optionsChapters=[],this.copyArray=[],this.disableCopyExam=!1,this.isCopying=!0}ngOnInit(){if(this.module=this.teacherEloService.getType(),this.typeCapitalized=this.teacherEloService.getCapitalizedType(),this.formTitle=this.translateService.instant("teacher".concat(this.typeCapitalized,"CreateTitle")),this.isExam=this.module===T.Eq.exam,this.isTask=this.module===T.Eq.task,this.isExercise=this.module===T.Eq.exercise,this.singleType=this.translateService.instant(this.teacherEloService.getType()),this.setupForm(),!this.isModal)if(this.isExam){const{id:i}=this.route.snapshot.params;this.teacherQuestionsService.getModuleQuestions(this.module,i,this.courseId).pipe((0,R.T)(a=>{var s;return(null==a||null===(s=a.body)||void 0===s?void 0:s.data)||{questions:[]}}),(0,Z.n)(({questions:a})=>a&&a.length&&a.find(s=>s.type!==Y.k4.moreAnswers)?this.teacherService.getTeacherCourses().pipe((0,R.T)(s=>{var r;return(null==s||null===(r=s.body)||void 0===r?void 0:r.data)||[]})):(0,x.of)([]))).subscribe(a=>
3this.handleOnloadSuccessResponse(a),a=>this.handleOnloadErrorResponse())}else this.teacherService.getTeacherCourses().pipe((0,R.T)(i=>{var a;return(null==i||null===(a=i.body)||void 0===a?void 0:a.data)||[]})).subscribe(i=>this.handleOnloadSuccessResponse(i),i=>this.handleOnloadErrorResponse())}setupForm(){if(this.createForm=this.formBuilder.group({name:["",[c.k0.required,c.k0.minLength(6)]]}),this.assignment&&this.createForm.patchValue((0,g.A)((0,g.A)({},this.createForm),{},{name:this.assignment.name})),(this.isTask||this.isExam)&&(this.createForm.addControl("time",this.formBuilder.control("120",c.k0.required)),this.assignment&&this.createForm.patchValue((0,g.A)((0,g.A)({},this.createForm),{},{time:"".concat(this.assignment.time)}))),this.isTask){this.createForm.addControl("obliged",this.formBuilder.control(0,c.k0.required));const i={value:"0",label:this.translateService.instant("unlimited")};this.optionsTime=[...this.optionsTime,i],this.assignment&&this.createForm.patchValue((0,g.A)((0,g.A)({},this.createForm),{},{obliged:this.assignment.obligedForExam}))}if(this.isExam&&(this.createForm.addControl("type",this.formBuilder.control(this.optionsExamType[0].value,c.k0.required)),this.assignment&&this.createForm.patchValue((0,g.A)((0,g.A)({},this.createForm),{},{type:this.assignment.variant}))),this.isExercise){this.createForm.addControl("type",this.formBuilder.control(this.optionsExercises[0].value,c.k0.required)),this.createForm.addControl("chapter",this.formBuilder.control(null));const i=this.teacherEloService.getChapterList();i.length&&(this.optionsChapters=i.map(a=>({label:a.name,value:"".concat(a.id)}))),this.assignment&&(this.createForm.patchValue((0,g.A)((0,g.A)({},this.createForm),{},{type:this.assignment.type})),this.assignment.chapterId&&this.createForm.patchValue((0,g.A)((0,g.A)({},this.createForm),{},{chapter:"".concat(this.assignment.chapterId)})))}}submitForm(){if(this.createForm.invalid)return;this.createForm.markAsPristine(),this.isFormSubmitting=!0;const{value:{name:i}}=this.createForm;let a={name:i,active:this.assignment?this.assignment.active:0,course_id:+this.courseId};if(this.assignment&&(a=(0,g.A)((0,g.A)({},a),{},{id:this.assignment.id})),this.isExam){const{value:{time:s,type:r}}=this.createForm;a=(0,g.A)((0,g.A)({},a),{},{time:+s,variant:r})}if(this.isTask){const{value:{time:s,obliged:r}}=this.createForm;a=(0,g.A)((0,g.A)({},a),{},{time:+s,obligedForExam:+r})}if(this.isExercise){const{value:{type:s,chapter:r}}=this.createForm;a=(0,g.A)((0,g.A)({},a),{},{type:s,chapterId:null!==r?+r:null})}this.teacherEloService.createAssignment(a).subscribe(s=>this.handleResponse(s),s=>this.handleResponseError(s))}onCloseModal(){this.closeModal.emit()}copyTo(i){if(this.isModal)return;this.isCopying=!0;const{id:a}=this.assignment;this.teacherService.copyRecordToCourse(this.module,{destination:i,id:a}).pipe((0,D.W)(r=>(0,x.of)(r))).subscribe(r=>{const{status:l}=r;if(400===l){const{fields:p}=r.error;if(p){const d=this.translateService.instant(p.hasOwnProperty("id")?"copyFailId":"copyFailDestination");this.toastrService.error(d)}else this.toastrService.error(r.error.message)}if(403===l&&this.toastrService.error(this.translateService.instant("teacherMediaErrorAccessDenied")),r.success){const p="".concat(this.singleType," ").concat(this.translateService.instant("dataCopySuccess")," id: ").concat(i);this.toastrService.success(p)}this.isCopying=!1})}handleOnloadSuccessResponse(i){this.copyArray=i,this.isCopying=!1}handleOnloadErrorResponse(){this.copyArray=[],this.isCopying=!1}handleResponse(i){const{status:a,body:{data:s}}=i;let r=this.translateService.instant("teacher".concat(this.typeCapitalized,"CreateSuccess"));201===a&&this.teacherEloService.addAssignmentToList(s),200===a&&(r=this.translateService.instant("teacher".concat(this.typeCapitalized,"UpdateSuccess")),this.teacherEloService.updateAssignmentInList(s)),this.isFormSubmitting=!1,this.toastrService.success(r),this.isModal&&this.onCloseModal()}handleResponseError(i){var a,s;if(this.isFormSubmitting=!1,403===i.status)return void this.toastrService.error(this.translateService.instant("teacherMediaErrorAccessDenied"));const{error:r}=i;let l="errorLabel";null!=r&&null!==(a=r.fields)&&void 0!==a&&a.active&&(l="activeStatusRestriction"),null!=r&&null!==(s=r.fields)&&void 0!==s&&s.variant&&(l="examVariantHasExamsTaken"),this.toastrService.error(this.translateService.instant(l),"",{timeOut:15e3})}}return(t=o).\u0275fac=function(i){return new(i||t)(e.rXU(c.ze),e.rXU(W),e.rXU(m.c$),e.rXU(w.tw),e.rXU(Ae.j),e.rXU(ee.d),e.rXU(O.nX),e.rXU(S.O))},t.\u0275cmp=e.VBU({type:t,selectors:[["app-teacher-assignment-create"]],inputs:{isModal:"isModal",courseId:"courseId",assignment:"assignment"},outputs:{closeModal:"closeModal"},decls:21,vars:22,consts:[["menu","matMenu"],["mat-dialog-content","",1,"w-100",3,"ngSubmit","formGroup"],[1,"pt-2",3,"ngClass"],["appearance","fill"],["matInput","","type","text","id","name","formControlName","name"],[4,"ngIf"],["appearance","fill",4,"ngIf"],["mat-dialog-actions","","align","end",3,"ngClass"],["type","button","mat-raised-button","","color","primary-inverted","class","mr-2","aria-label","Close",3,"disabled","click",4,"ngIf"],["mat-raised-button","","color","accent","type","button","class","mr-2",3,"matMenuTriggerFor","disabled",4,"ngIf"],["mat-menu-item","",3,"click",4,"ngFor","ngForOf"],["type","submit","mat-raised-button","","color","primary",3,"disabled"],["appRemoveAriaOwns",""],["formControlName","time"],["class","disable-checkbox",3,"value",4,"ngFor","ngForOf"],[1,"disable-checkbox",3,"value"],["formControlName","obliged"],["formControlName","chapter","appAllowClear",""],["input-action","","matSuffix","","mat-icon-button","","aria-label","Clear",3,"click",4,"ngIf"],["input-action","","matSuffix","","mat-icon-button","","aria-label","Clear",3,"click"],[1,"fas","fa-xmark","text-color"],["formControlName","type"],["type","button","mat-raised-button","","color","primary-inverted","aria-label","Close",1,"mr-2",3,"click","disabled"],["mat-raised-button","","color","accent","type","button",1,"mr-2",3,"matMenuTriggerFor","disabled"],[3,"inline",4,"ngIf"],[1,"fa-solid","fa-caret-down","ml-1","text-white"],[3,"inline"],["mat-menu-item","",3,"click"]],template:function(i,a){if(1&i){const s=e.RV6();e.j41(0,"form",1),e.bIt("ngSubmit",function(){return e.eBV(s),e.Njj(a.submitForm(
3))}),e.j41(1,"div",2)(2,"mat-form-field",3)(3,"mat-label"),e.EFF(4),e.nI1(5,"translate"),e.k0s(),e.nrm(6,"input",4),e.DNE(7,zi,3,2,"mat-error",5),e.k0s(),e.DNE(8,Hi,6,4,"mat-form-field",6)(9,Ki,11,11,"mat-form-field",6)(10,ta,7,5,"mat-form-field",6)(11,ia,6,4,"mat-form-field",6),e.k0s(),e.j41(12,"div",7),e.DNE(13,aa,3,4,"button",8)(14,sa,5,7,"button",9),e.j41(15,"mat-menu",null,0),e.DNE(17,ra,2,3,"button",10),e.k0s(),e.j41(18,"button",11),e.EFF(19),e.nI1(20,"translate"),e.k0s()()()}2&i&&(e.Y8G("formGroup",a.createForm),e.R7$(),e.Y8G("ngClass",e.eq3(18,Xi,!a.isModal)),e.R7$(3),e.JRh(e.bMT(5,14,"title")),e.R7$(3),e.Y8G("ngIf",a.name.invalid&&(a.name.dirty||a.name.touched)),e.R7$(),e.Y8G("ngIf",a.isTask||a.isExam),e.R7$(),e.Y8G("ngIf",a.isTask),e.R7$(),e.Y8G("ngIf",a.isExercise&&a.optionsChapters.length),e.R7$(),e.Y8G("ngIf",a.isExam||a.isExercise),e.R7$(),e.Y8G("ngClass",e.eq3(20,Bi,!a.isModal)),e.R7$(),e.Y8G("ngIf",a.isModal),e.R7$(),e.Y8G("ngIf",!a.isModal),e.R7$(3),e.Y8G("ngForOf",a.copyArray),e.R7$(),e.Y8G("disabled",a.createForm.invalid||a.createForm.pristine),e.R7$(),e.SpI(" ",e.bMT(20,16,"save")," "))},dependencies:[u.YU,u.Sq,u.bT,c.qT,c.me,c.BC,c.cb,c.j4,c.JD,Oe.kk,Oe.fb,Oe.Cp,E.$z,E.iY,ne.fg,A.rl,A.nJ,A.TL,A.yw,xe.VO,Ie.wT,B.E7,B.Yi,X.H,Be.K,m.D9,Fe.p]}),o})();var rt=f(63315);const la=["paginatorQuestions"],ca=["paginatorTemplateQuestions"],Mt=t=>({hide:t}),ma=t=>({custom_striped:t}),pa=t=>({"text-black-50":t}),da=t=>({custom_striped:t});function ua(t,o){1&t&&e.nrm(0,"app-spinner")}function _a(t,o){if(1&t){const n=e.RV6();e.j41(0,"button",32),e.bIt("click",function(){e.eBV(n);const a=e.XpG();return e.Njj(a.openTeacherExamManual())}),e.nrm(1,"i",33),e.j41(2,"h5",34),e.EFF(3),e.nI1(4,"translate"),e.nI1(5,"titlecase"),e.k0s()()}if(2&t){const n=e.XpG();e.Y8G("hidden",n.isSorting),e.R7$(3),e.SpI(" ",e.bMT(5,4,e.bMT(4,2,"manual")),"")}}function ha(t,o){if(1&t&&(e.j41(0,"div",35)(1,"div",36),e.nrm(2,"app-teacher-assignment-create",37),e.k0s()()),2&t){const n=e.XpG();e.Y8G("hidden",n.isSorting),e.R7$(2),e.Y8G("courseId",n.courseId)("assignment",n.selectedExam)}}function fa(t,o){if(1&t){const n=e.RV6();e.j41(0,"div",42)(1,"app-export-to-pdf-button",43),e.bIt("dependencyLoaded",function(a){e.eBV(n);const s=e.XpG(2);return e.Njj(s.exportAsPdf(a))}),e.k0s()()}}function ga(t,o){if(1&t){const n=e.RV6();e.j41(0,"div",38)(1,"div",22)(2,"div",39)(3,"mat-form-field")(4,"mat-label"),e.EFF(5),e.nI1(6,"translate"),e.k0s(),e.nrm(7,"i",40),e.j41(8,"input",41,2),e.bIt("keyup",function(a){e.eBV(n);const s=e.XpG();return e.Njj(s.searchQuestions(a))}),e.k0s()()(),e.DNE(10,fa,2,0,"div",42),e.k0s()()}if(2&t){const n=e.XpG();e.Y8G("hidden",n.isSorting),e.R7$(5),e.JRh(e.bMT(6,3,"editExamSearchQuestions")),e.R7$(5),e.vxM(n.isExam&&null!=n.questions&&null!=n.questions.data&&n.questions.data.length?10:-1)}}function va(t,o){if(1&t&&(e.j41(0,"th",47),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t){const n=e.XpG().$implicit;e.R7$(),e.JRh(e.bMT(2,1,n.label))}}function ba(t,o){if(1&t&&(e.qex(0),e.EFF(1),e.bVm()),2&t){const n=e.XpG().index;e.XpG(2);const i=e.sdS(17);e.R7$(),e.SpI(" ",0===i.pageIndex?n+1:1+n+i.pageIndex*i.pageSize," ")}}function Ta(t,o){if(1&t&&(e.qex(0),e.EFF(1),e.nI1(2,"translate"),e.bVm()),2&t){const n=e.XpG().$implicit;e.R7$(),e.SpI(" ",e.bMT(2,1,n.type)," ")}}function Ca(t,o){if(1&t&&(e.qex(0),e.nrm(1,"app-read-more-less",52),e.bVm()),2&t){const n=e.XpG().$implicit;e.R7$(),e.Y8G("text",n.question)("characters",80)("icon",!0)}}function xa(t,o){1&t&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.JRh(e.bMT(2,1,"exDTeasy")))}function Ia(t,o){1&t&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.JRh(e.bMT(2,1,"exDTModerate")))}function Ra(t,o){1&t&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.JRh(e.bMT(2,1,"exDTDifficult")))}function Fa(t,o){if(1&t&&(e.qex(0)(1,49),e.DNE(2,xa,3,3,"span",50)(3,Ia,3,3,"span",50)(4,Ra,3,3,"span",50),e.bVm()()),2&t){const n=e.XpG().$implicit;e.R7$(),e.Y8G("ngSwitch",+n.difficulty),e.R7$(),e.Y8G("ngSwitchCase",1),e.R7$(),e.Y8G("ngSwitchCase",2),e.R7$(),e.Y8G("ngSwitchCase",3)}}function ka(t,o){if(1&t){const n=e.RV6();e.qex(0),e.j41(1,"button",53),e.bIt("click",function(){e.eBV(n);const a=e.XpG().$implicit,s=e.XpG(2);return e.Njj(s.editQuestionModal(a))}),e.nrm(2,"i",54),e.k0s(),e.bVm()}}function ya(t,o){if(1&t){const n=e.RV6();e.qex(0),e.j41(1,"button",53),e.bIt("click",function(){e.eBV(n);const a=e.XpG().$implicit,s=e.XpG(2);return e.Njj(s.openDeleteQuestionModal(a))}),e.nrm(2,"i",55),e.k0s(),e.bVm()}}function Ea(t,o){if(1&t&&(e.qex(0),e.EFF(1),e.nI1(2,"propSelector"),e.bVm()),2&t){const n=e.XpG().$implicit,i=e.XpG().$implicit;e.R7$(),e.SpI(" ",e.i5U(2,1,n,i.property)," ")}}function Sa(t,o){if(1&t&&(e.j41(0,"td",48),e.qex(1,49),e.DNE(2,ba,2,1,"ng-container",50)(3,Ta,3,3,"ng-container",50)(4,Ca,2,3,"ng-container",50)(5,Fa,5,4,"ng-container",50)(6,ka,3,0,"ng-container",50)(7,ya,3,0,"ng-container",50)(8,Ea,3,4,"ng-container",51),e.bVm(),e.k0s()),2&t){const n=e.XpG().$implicit;e.R7$(),e.Y8G("ngSwitch",n.columnRef),e.R7$(),e.Y8G("ngSwitchCase","number"),e.R7$(),e.Y8G("ngSwitchCase","type"),e.R7$(),e.Y8G("ngSwitchCase","question"),e.R7$(),e.Y8G("ngSwitchCase","difficulty"),e.R7$(),e.Y8G("ngSwitchCase","edit"),e.R7$(),e.Y8G("ngSwitchCase","delete")}}function $a(t,o){1&t&&(e.qex(0,44),e.DNE(1,va,3,3,"th",45)(2,Sa,9,7,"td",46),e.bVm()),2&t&&e.Y8G("matColumnDef",o.$implicit.columnRef)}function Ma(t,o){1&t&&e.nrm(0,"tr",56)}function wa(t,o){1&t&&e.nrm(0,"tr",57),2&t&&e.Y8G("ngClass",e.eq3(1,ma,o.dataIndex%2==0))}function ja(t,o){if(1&t&&(e.j41(0,"p",58),e.nrm(1,"i",59),e.j41(2,"span",60),e.EFF(3),e.nI1(4,"translate"),e.k0s()()),2&t){const n=e.XpG();e.R7$(3),e.JRh(n.teacherExamQuestionsEmpty||e.bMT(4,1,n.translateQuestionsEmpty))}}function Ga(t,o){if(1&t){const n=e.RV6();e.j41(0,"app-table-drag-and-drop",61),e.bIt("cancel",function(a){e.eBV(n);const s=e.XpG();return e.Njj(s.cancelSort(a))})("save",function(a){e.eBV(n);const s=e.XpG();return e.Njj(s.saveSort(a))}),e.k0s()}if(2&t){const n=e.XpG();e.Y8G("data",n.sortData)("fieldsToShow",n.tableHeaders)}}function Da(t,o){if(1&t&&(e.j41(0,"p"),e.EFF(1),e.nI1(2,"translate"),e.j41(3,"span"),e.EFF(4),e.k0s()()),2&t){const n=e.XpG();e.R7$(),e.SpI("",e.bMT(2,2,"teacherExamQuestionLength")," "),e.R7$(3),e.JRh(n.totalQuestions)}}function Oa(t,o){if(1&t&&(e.j41(0,"p"),e.EFF(1),e.nI1(2,"translate"),e.j41(3,"span"),e.EFF(4),e.k0s()()),2&t){const n=e.XpG();e.R7$(),e.SpI("",e.bMT(2,2,"teacherExamPointsLength")," "),e.R7$(3),e.JRh(n.totalPoints)}}function Aa(t,o){if(1&t){const n=e.RV6();e.j41(0,"button",70),e.bIt("click",function(){const a=e.eBV(n).$implicit,s=e.XpG(2);return e.Njj(s.loadQuestionsFromTemplate(+a.value))}),e.EFF(1),e.nI1(2,"translate"),e.k0s()}if(2&t){const n=o.$implicit;e.R7$(),e.SpI(" ",e.bMT(2,1,n.label)," ")}}function Na(t,o){if(1&t){const n=e.RV6();e.j41(0,"button",70),e.bIt("click",function(){const a=e.eBV(n).$implicit,s=e.XpG(2);return e.Njj(s.editQuestionModal(a.type))}),e.EFF(1),e.nI1(2,"translate"),e.k0s()}if(2&t){const n=o.$implicit;e.R7$(),e.SpI(" ",e.bMT(2,1,n.translationKey)," ")}}function La(t,o){if(1&t){const n=e.RV6();e.j41(0,"div",62)(1,"button",63),e.bIt("click",function(){e.eBV(n);const a=e.XpG();return e.Njj(a.enableSort())}),e.EFF(2),e.nI1(3,"translate"),e.nrm(4,"i",64),e.k0s(),e.j41(5,"button",65),e.EFF(6),e.nI1(7,"translate"),e.nrm(8,"i",66),e.k0s(),e.j41(9,"mat-menu",null,3),e.DNE(11,Aa,3,3,"button",67),e.k0s(),e.j41(12,"button",68),e.EFF(13),e.nI1(14,"translate"),e.nrm(15,"i",66),e.k0s(),e.j41(16,"mat-menu",69,4),e.DNE(18,Na,3,3,"button",67),e.k0s()()}if(2&t){const n=e.sdS(10),i=e.sdS(17),a=e.XpG();e.R7$(),e.Y8G("disabled",!!a.questions&&a.questions.length<=1),e.R7$(),e.SpI(" ",e.bMT(3,8,"reorderQuestions"),""),e.R7$(3),e.Y8G("matMenuTriggerFor",n),e.R7$(),e.SpI(" ",e.bMT(7,10,"addFromTemplate")," "),e.R7$(5),e.Y8G("ngForOf",a.difficulties),e.R7$(),e.Y8G("matMenuTriggerFor",i),e.R7$(),e.SpI(" ",e.bMT(14,12,"addQuestion")," "),e.R7$(5),e.Y8G("ngForOf",a.questionTypes)}}function Ya(t,o){if(1&t&&(e.j41(0,"div",10)(1,"div",71)(2,"p",58),e.nrm(3,"i",59),e.j41(4,"span",60),e.EFF(5),e.nI1(6,"translate"),e.k0s()()()()),2&t){const n=e.XpG();e.R7$(5),e.JRh(e.bMT(6,1,"teacher"+n.capitalizedType+"NotFound"))}}function Va(t,o){if(1&t&&(e.j41(0,"th",47),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t){const n=e.XpG().$implicit;e.R7$(),e.JRh(e.bMT(2,1,n.label))}}function Pa(t,o){if(1&t){const n=e.RV6();e.qex(0),e.j41(1,"button",53),e.bIt("click",function(){e.eBV(n);const a=e.XpG().$implicit,s=e.XpG(2);return e.Njj(!a.disableAdd&&s.addQuestionFromTemplate(a))}),e.nrm(2,"i",72),e.k0s(),e.bVm()}if(2&t){const n=e.XpG().$implicit;e.R7$(2),e.Y8G("ngClass",e.eq3(1,pa,n.disableAdd))}}function Xa(t,o){if(1&t&&(e.qex(0),e.EFF(1),e.nI1(2,"translate"),e.bVm()),2&t){const n=e.XpG().$implicit;e.R7$(),e.SpI(" ",e.bMT(2,1,n.type)," ")}}function Ba(t,o){if(1&t&&(e.qex(0),e.nrm(1,"app-read-more-less",52),e.bVm()),2&t){const n=e.XpG().$implicit;e.R7$(),e.Y8G("text",n.question)("characters",80)("icon",!0)}}function qa(t,o){1&t&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.JRh(e.bMT(2,1,"exDTeasy")))}function Ua(t,o){1&t&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.JRh(e.bMT(2,1,"exDTModerate")))}function Ja(t,o){1&t&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.JRh(e.bMT(2,1,"exDTDifficult")))}function Qa(t,o){if(1&t&&(e.qex(0)(1,49),e.DNE(2,qa,3,3,"span",50)(3,Ua,3,3,"span",50)(4,Ja,3,3,"span",50),e.bVm()()),2&t){const n=e.XpG().$implicit;e.R7$(),e.Y8G("ngSwitch",+n.difficulty),e.R7$(),e.Y8G("ngSwitchCase",1),e.R7$(),e.Y8G("ngSwitchCase",2),e.R7$(),e.Y8G("ngSwitchCase",3)}}function za(t,o){if(1&t&&(e.qex(0),e.EFF(1),e.nI1(2,"propSelector"),e.bVm()),2&t){const n=e.XpG().$implicit,i=e.XpG().$implicit;e.R7$(),e.SpI(" ",e.i5U(2,1,n,i.property)," ")}}function Wa(t,o){if(1&t&&(e.j41(0,"td",48),e.qex(1,49),e.DNE(2,Pa,3,3,"ng-container",50)(3,Xa,3,3,"ng-container",50)(4,Ba,2,3,"ng-container",50)(5,Qa,5,4,"ng-container",50)(6,za,3,4,"ng-container",51),e.bVm(),e.k0s()),2&t){const n=e.XpG().$implicit;e.R7$(),e.Y8G("ngSwitch",n.columnRef),e.R7$(),e.Y8G("ngSwitchCase","add"),e.R7$(),e.Y8G("ngSwitchCase","type"),e.R7$(),e.Y8G("ngSwitchCase","question"),e.R7$(),e.Y8G("ngSwitchCase","difficulty")}}function Ha(t,o){1&t&&(e.qex(0,44),e.DNE(1,Va,3,3,"th",45)(2,Wa,7,5,"td",46),e.bVm()),2&t&&e.Y8G("matColumnDef",o.$implicit.columnRef)}function Ka(t,o){1&t&&e.nrm(0,"tr",56)}function Za(t,o){1&t&&e.nrm(0,"tr",57),2&t&&e.Y8G("ngClass",e.eq3(1,da,o.dataIndex%2==0))}let lt=(()=>{var t;class o{set matPaginatorQuestions(i){this.paginatorQuestions=i,this.questions&&(this.questions.paginator=this.paginatorQuestions)}set matPaginatorTemplateQuestions(i){this.paginatorTemplateQuestions=i,this.templateQuestions&&(this.templateQuestions.paginator=this.paginatorTemplateQuestions)}constructor(i,a,s,r,l,p,d,h,v,$,k){this.route=i,this.teacherExamService=a,this.toastService=s,this.translateService=r,this.teacherService=l,this.sanitizeAllPipe=p,this.teacherEloService=d,this.teacherQuestionsService=h,this.toastrService=v,this.router=$,this.dialog=k,this.designTokenService=(0,e.WQX)(kt.R),this.isLoading=!0,this.contentLoaded=!1,this.selectedExam=null,this.difficulties=Y.bm,this.isSorting=!1,this.sortData=[],this.tableHeaders=[],this.isExam=!1,this.isExercise=!1,this.totalPoints=0,this.totalQuestions=0,this.MAX_VISIBLE_ITEMS=10,this.questionsTemp=[],this.teacherExamQuestionsEmpty=null,this.questionsTableData=pi,this.templateTableData=di,this.destroy$=new y.B,this.filterQuestions=M=>{const{previous:J}=this,se=[this.translateService.instant("true"),this.translateService.instant("false")],re=J.filter(Q=>Q.title.toUpperCase().includes(M.toUpperCase())||Q.question.toUpperCase().includes(M.toUpperCase())||Q.answers&&Q.answers.length&&Q.answers.some(K=>K.toUpperCase().includes(M.toUpperCase()))||se.some(K=>K.toUpperCase().includes(M.toUpperCase()))&&"trueFalse"===Q.type);this.questions=new b.I6(re),this.teacherExamQuestionsEmpty=this.questions&&!this.questions.data.length?"".concat(this.translateService.instant("teacherExamNoQuestionsFound")):null},this.resetQuestionFilter=()=>{this.questions=new b.I6(this.previous)}}ngOnInit(){this.moduleType=this.teacherEloService.getType(),this.teacherService.getCurrentCourse().pipe((0,R.T)(i=>i),(0,ke.Z)(i=>this.route.params.pipe((0,R.T)(({id:a})=>({moduleId:a,course:i})))),(0,ke.Z)(({moduleId:i,course:a})=>(this.moduleId=i,this.teacherQuestionsService.getModuleQuestions(this.moduleType,i,a.id).pipe((0,R.T)(s=>{var r;return{questions:(null==s||null===(r=s.body)||void 0===r||null===(r=r.data)||void 0===r?void 0:r.questions)||[],exam:this.teacherEloService.getItemFromList(i),course:a}})))),(0,I.Q)(this.destroy$)).subscribe(({questions:i,course:a,exam:s})=>{if(this.capitalizedType=this.teacherEloService.getCapitalizedType(),this.isExam=this.moduleType===T.Eq.exam,this.isExercise=this.moduleType===T.Eq.exercise,this.title="".concat(this.translateService.instant("edit")," ").concat(this.translateService.instant(this.moduleType)),this.translateQuestionsEmpty="teacher".concat(this.capitalizedType,"QuestionsEmpty"),this.isExam)this.questionTypes=[...T.Q1.filter(r=>r.isAvailableForExam)],this.questionsTableData=(0,g.A)((0,g.A)({},this.questionsTableData),{},{columns:this.questionsTableData.columns.filter(r=>"points"!==r)});else if(this.isExercise){const{type:r}=s;this.questionTypes="open"===r?[...T.Q1.filter(l=>l.isAvailableForOpenExercise)]:[...T.Q1.filter(l=>l.isAvailableForAutoExercise)]}else this.questionTypes=[...T.Q1];this.courseId=+a.id,this.course=a,this.teacherService.setFullScreen(!0),this.teacherService.setBackBtnRoute(["/teacher/ecampus/".concat(this.moduleType),this.courseId]),this.selectedExam=s,this.teacherEloService.setQuestionList(i),this.teacherEloService.getQuestionList().pipe((0,I.Q)(this.destroy$)).subscribe(r=>{this.questions=new b.I6(r),this.isLoading=!1,this.contentLoaded=!0,this.loadQuestions()})},()=>
3{const i=this.route.snapshot.parent.params.id,a=this.teacherEloService.getCapitalizedType();this.toastService.error(this.translateService.instant("teacher".concat(a,"NotFound")));const s="teacher/ecampus/".concat(this.moduleType,"/").concat(i);this.router.navigate([s])})}loadQuestionsFromTemplate(i){this.isLoading=!0,this.teacherQuestionsService.getModuleQuestions(this.moduleType,this.moduleId,this.courseId,i).pipe((0,R.T)(a=>{var s;return(null==a||null===(s=a.body)||void 0===s?void 0:s.data)||{questions:[]}}),(0,I.Q)(this.destroy$)).subscribe(({questions:a})=>{if(this.isLoading=!1,a.length){if(this.templateQuestions=new b.I6(a),this.isExam){const s=a.map(r=>(0,g.A)((0,g.A)({},r),{},{disableAdd:r.type===Y.k4.moreAnswers}));this.templateQuestions=new b.I6(s)}}else this.toastService.error(this.translateService.instant("teacherExamNoTemplateQuestions"))},a=>{this.isLoading=!1})}searchQuestions(i){const a=i.target.value;a?this.filterQuestions(a):this.resetQuestionFilter()}editQuestionModal(i){const a="string"==typeof i;this.teacherEloService.setQuestion(a?null:i);const s=a?i:i.type,r=T.Q1.find($=>$.type===s),p=this.translateService.instant(r?r.translationKey:"teacherExamQuestion").toLowerCase(),d=this.translateService.instant(a?"create":"teacherExamEdit");let v={data:{header:"".concat(d," ").concat(p),component:mi},width:"var(--size-90-percent)",maxWidth:"var(--size-teacher-assignment-edit-dialog-width)",autoF
3ocus:!1,panelClass:["material-modal"]};a&&(v.data.componentData={type:i,module:this.moduleType}),this.dialog.open(oe.m,v)}openDeleteQuestionModal({id:i}){const a={data:{content:this.translateService.instant("qExamDoUWant"),type:me.m6.confirm},autoFocus:!1};this.dialog.open(oe.m,a).afterClosed().pipe((0,I.Q)(this.destroy$)).subscribe(r=>{r&&this.teacherQuestionsService.deleteQuestion(this.moduleType,this.selectedExam.id,i).pipe((0,R.T)(l=>(null==l?void 0:l.status)||!1),(0,D.W)(()=>(0,pe.$)(!0)),(0,I.Q)(this.destroy$)).subscribe({next:l=>{if(400===l)return this.toastService.error(this.translateService.instant("teacherExamQuestionNotFound"));if(this.teacherEloService.removeQuestionFromQuestionList(i),this.toastrService.success(this.translateService.instant("questionDeleteSuccess")),!this.questions.data.length){const p=(0,g.A)((0,g.A)({},this.selectedExam),{},{course_id:this.course.id,active:0});this.teacherEloService.createAssignment(p).pipe((0,I.Q)(this.destroy$)).subscribe(d=>{const{status:h,body:{data:v}}=d;200===h&&(this.teacherEloService.updateAssignmentInList(v),this.isLoading=!1)})}this.isLoading=!1},error:l=>{this.toastService.error(this.translateService.instant("teacherExamQuestionNotFound")),this.isLoading=!1}})})}addQuestionFromTemplate(i){const{title:a,type:s,question:r,answers:l,correctAnswer:p,evaluation:d,difficulty:h,maxPoints:v}=i,$={title:a,type:s,question:r,answers:l,correctAnswer:p,evaluation:d,difficulty:h,maxPoints:v,source:"template",template:0};if(s===Y.k4.match){const k=l,{corAnswers:M,unShuffledQuestions:J}=this.teacherQuestionsService.unShuffleMatchAnswers(k,p),{answerArray:se,correctState:re}=this.teacherQuestionsService.shuffleMatchAnswers(J,M);$.answers=se,$.correctAnswer=re}this.teacherQuestionsService.createQuestion(this.moduleType,this.moduleId,this.courseId,$).pipe((0,I.Q)(this.destroy$)).subscribe(k=>{const{status:M,body:{data:J}}=k;201===M||200===M?(this.teacherEloService.addQuestionToQuestionList(J),this.toastrService.success(this.translateService.instant("successLabel"))):this.toastrService.error(this.translateService.instant("errorLabel"))})}openTeacherExamManual(){this.teacherExamService.openExamManual()}exportAsPdf(i){const{pdfMake:a,htmlToPdfmake:s}=i,{courseCode:r,courseName:l,id:p}=this.course,{name:d}=this.selectedExam,h=this.selectedExam.hasOwnProperty("variant")?this.selectedExam.variant:"",v=this.designTokenService.getDesignTokenValues(["--size-100-percent","--border-xxs-solid-accent"]),M={content:s('\n <p style="width: '.concat(v["--size-100-percent"],';">\n <em>').concat(p," ").concat(r," ").concat(l,"</em>\n <br />\n <em>").concat(d,"</em>\n <br />\n <em>").concat(this.translateService.instant("type")).concat(this.translateService.instant("typography.colon")).concat(this.translateService.instant(h),'</em>\n </p>\n <table>\n <thead>\n <tr style="border: ').concat(v["--border-xxs-solid-accent"],';">\n <th>').concat(this.translateService.instant("type"),"</th>\n <th>").concat(this.translateService.instant("title"),"</th>\n <th>").concat(this.translateService.instant("question"),"</th>\n <th>").concat(this.translateService.instant("correctAnswer"),"</th>\n <th>").concat(this.translateService.instant("difficulty"),"</th>\n <th>").concat(this.translateService.instant("points"),"</th>\n </tr>\n </thead>\n <tbody>\n ").concat(this.questions.data.map(({type:J,title:se,question:re,correctAnswer:Q,answers:K,difficulty:U,maxPoints:ae})=>'\n <tr style="border: '.concat(v["--border-xxs-solid-accent"],';">\n <td>').concat(this.translateService.instant(this.getTypeString(J)),"</td>\n <td>").concat(se,"</td>\n <td>").concat(this.getSanitizedHtml(re),"</td>\n <td>").concat(this.getSanitizedHtml(K[Q]),"</td>\n <td>").concat(this.translateService.instant(this.getDifficultyString(+U)),"</td>\n <td>").concat(ae,"</td>\n </tr>\n ")).join(""),"\n </tbody>\n </table>\n "),{tableAutoSize:!0}),pageOrientation:"landscape"};a.createPdf(M).download("".concat(this.translateService.instant("exam")," ").concat(this.course.courseName," ").concat(this.course.id))}enableSort(){this.tableHeaders=["type","title","question","difficultyTranslate"],this.sortData=this.questions.data.map(i=>(0,g.A)((0,g.A)({},i),{},{difficultyTranslate:this.getDifficultyString(+i.difficulty)})),this.toggleSort()}saveSort(i){if(this.isSorting){this.isLoading=!0,this.questions=new b.I6(i);const a=this.questions.data.map(({id:s})=>s);this.teacherEloService.updateQuestionListOrder(this.selectedExam.id,a).pipe((0,I.Q)(this.destroy$)).subscribe(({status:s})=>{204===s&&(this.toastService.success(this.translateService.instant("questionOrderSuccess")),this.isLoading=!1)},()=>{this.toastService.error(this.translateService.instant("somethingWentWrongTryAgain")),this.isLoading=!1})}this.toggleSort()}cancelSort(){this.toggleSort()}loadQuestions(){const i=this.questions.data.length;if(this.isExam){const a=this.questions.data.filter(s=>"moreAnswers"!==s.type);this.questions=new b.I6(a)}this.totalPoints=this.questions.data.reduce((a,s)=>a+Number(s.maxPoints),0),this.totalQuestions=i,this.previous=[...this.questions.data]}getSanitizedHtml(i){return this.sanitizeAllPipe.transform(i).changingThisBreaksApplicationSecurity}getTypeString(i){switch(i){case"oneAnswer":return"qtypeOneAnswer";case"trueFalse":return"qtypetrueFalse";default:return"qtypeMoreAnswers"}}getDifficultyString(i){return this.difficulties.find(a=>+a.value==+i).label}toggleSort(){this.isSorting=!this.isSorting,window.scrollTo(0,0)}ngOnDestroy(){this.teacherExamService.emptyQuestionList(),this.teacherService.setFullScreen(!1),this.teacherService.setBackBtnRoute(null),this.teacherExamService.unsubscribeFromExamList(),this.destroy$.next(),this.destroy$.complete()}}return(t=o).\u0275fac=function(i){return new(i||t)(e.rXU(O.nX),e.rXU(De.V),e.rXU(w.tw),e.rXU(m.c$),e.rXU(S.O),e.rXU(_e.v),e.rXU(W),e.rXU(ee.d),e.rXU(w.tw),e.rXU(O.Ix),e.rXU(B.bZ))},t.\u0275cmp=e.VBU({type:t,selectors:[["app-teacher-assignment-edit"]],viewQuery:function(i,a){if(1&i&&(e.GBs(la,5),e.GBs(ca,5)),2&i){let s;e.mGM(s=e.lsd())&&(a.matPaginatorQuestions=s.first),e.mGM(s=e.lsd())&&(a.matPaginatorTemplateQuestions=s.first)}},decls:37,vars:29,consts:[["paginatorQuestions",""],["paginatorTemplateQuestions",""],["questionSearch",""],["difficultyMenu","matMenu"],["questionMenu","matMenu"],[4,"ngIf"],[1,"row","py-3","mb-2"],[1,"col-12","d-flex","justify-content-between","align-items-center"],[1,"mb-0","text-main-color","font-weight-bold"],["mat-raised-button","","color","main",3,"hidden","click",4,"ngIf"],[1,"row","pb-4"],["class","col-12 mt-3",3,"hidden",4,"ngIf"],["class","col-12 mb-3",3,"hidden",4,"ngIf"],[1,"col-12","mb-3","questions-box",3,"hidden"],[1,"table-container","mat-elevation-z3",3,"ngClass"],["mat-table","",1,"mat-table-hover","striped",3,"dataSource"],[3,"matColumnDef",4,"ngFor","ngForOf"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",3,"ngClass",4,"matRowDef","matRowDefColumns"],["pageSize","10","hidePageSize","","showFirstLastButtons",""],["class","text-center",4,"ngIf"],[1,"container"],[1,"row"],[1,"col-12"],[3,"data","fieldsToShow","cancel","save",4,"ngIf"],[1,"col-12","text-right","font-weight-bold",3,"hidden"],["class","col-12 d-flex flex-column flex-md-row justify-content-end",4,"ngIf"],["class","row pb-4",4,"ngIf"],[1,"row",3,"ngClass"],[1,"col-12","mb-3"],[1,"table-container","mat-elevation-z3"],["mat-table","",1,"striped","mat-table-hover",3,"dataSource"],["mat-raised-button","","color","main",3,"click","hidden"],[1,"fas","fa-question-circle","mr-1"],[1,"m-0","d-inline"],[1,"col-12","mt-3",3,"hidden"],[1,"mat-elevation-z3","p-3","mb-4"],[3,"courseId","assignment"],[1,"col-12","mb-3",3,"hidden"],[1,"col-12","col-md-6"],["matPrefix","",1,"fa-search","fas","text-color"],["matInput","","type","text","id","questionSearchInput",3,"keyup"],[1,"col-12","col-md-6","d-flex","flex-column","justify-content-center","align-items-end"],["label","exportExamToPdf",3,"dependencyLoaded"],[3,"matColumnDef"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["mat-header-cell",""],["mat-cell",""],[3,"ngSwitch"],[4,"ngSwitchCase"],[4,"ngSwitchDefault"],[3,"text","characters","icon"],["mat-icon-button","","role","button","type","button",1,"td-btn","icon-color",3,"click"],[1,"fa-pen-square","icon-list","fas"],[1,"fa-solid","fa-tras
3h-can"],["mat-header-row",""],["mat-row","",3,"ngClass"],[1,"text-center"],[1,"fas","fa-exclamation-circle","mr-2"],[1,"uppercase-first-letter"],[3,"cancel","save","data","fieldsToShow"],[1,"col-12","d-flex","flex-column","flex-md-row","justify-content-end"],["mat-raised-button","","color","accent","type","button",1,"text-uppercase","mb-2","mb-md-0","mr-md-2",3,"click","disabled"],[1,"fa-solid","fa-sort","ml-2","text-white"],["mat-raised-button","","color","accent","type","button",1,"mb-2","mb-md-0","mr-md-2","text-uppercase",3,"matMenuTriggerFor"],[1,"fa-solid","fa-caret-up","ml-1"],["mat-menu-item","",3,"click",4,"ngFor","ngForOf"],["mat-raised-button","","color","primary","type","button",1,"text-uppercase",3,"matMenuTriggerFor"],[1,"panel-fit"],["mat-menu-item","",3,"click"],[1,"col-12","my-3"],[1,"fa-plus-circle","fas","c-p",3,"ngClass"]],template:function(i,a){1&i&&(e.DNE(0,ua,1,0,"app-spinner",5),e.j41(1,"div",6)(2,"div",7)(3,"h5",8),e.EFF(4),e.nI1(5,"translate"),e.k0s(),e.DNE(6,_a,6,6,"button",9),e.k0s()(),e.j41(7,"div",10),e.DNE(8,ha,3,3,"div",11)(9,ga,11,5,"div",12),e.j41(10,"div",13)(11,"div",14)(12,"table",15),e.DNE(13,$a,3,1,"ng-container",16)(14,Ma,1,0,"tr",17)(15,wa,1,3,"tr",18),e.k0s(),e.nrm(16,"mat-paginator",19,0),e.k0s(),e.DNE(18,ja,5,3,"p",20),e.k0s(),e.j41(19,"div",21)(20,"div",22)(21,"div",23),e.DNE(22,Ga,1,2,"app-table-drag-and-drop",24),e.k0s()()(),e.j41(23,"div",25),e.DNE(24,Da,5,4,"p",5)(25,Oa,5,4,"p",5),e.k0s(),e.DNE(26,La,19,14,"div",26),e.k0s(),e.DNE(27,Ya,7,3,"div",27),e.j41(28,"div",28)(29,"div",29)(30,"div",30)(31,"table",31),e.DNE(32,Ha,3,1,"ng-container",16)(33,Ka,1,0,"tr",17)(34,Za,1,3,"tr",18),e.k0s(),e.nrm(35,"mat-paginator",19,1),e.k0s()()()),2&i&&(e.Y8G("ngIf",a.isLoading),e.R7$(4),e.JRh(a.isSorting?e.bMT(5,23,"reorderQuestions"):a.title),e.R7$(2),e.Y8G("ngIf",a.isExam),e.R7$(2),e.Y8G("ngIf",a.contentLoaded),e.R7$(),e.Y8G("ngIf",!(null==a.questions||null==a.questions.data||!a.questions.data.length)||a.teacherExamQuestionsEmpty),e.R7$(),e.Y8G("hidden",a.isSorting),e.R7$(),e.Y8G("ngClass",e.eq3(25,Mt,!!a.questions&&!a.questions.data.length)),e.R7$(),e.Y8G("dataSource",a.questions),e.R7$(),e.Y8G("ngForOf",null==a.questionsTableData?null:a.questionsTableData.table),e.R7$(),e.Y8G("matHeaderRowDef",null==a.questionsTableData?null:a.questionsTableData.columns),e.R7$(),e.Y8G("matRowDefColumns",null==a.questionsTableData?null:a.questionsTableData.columns),e.R7$(3),e.Y8G("ngIf",!(a.questions&&a.questions.data.length||a.isLoading)),e.R7$(4),e.Y8G("ngIf",a.sortData.length&&a.isSorting),e.R7$(),e.Y8G("hidden",a.isSorting),e.R7$(),e.Y8G("ngIf",a.totalQuestions),e.R7$(),e.Y8G("ngIf","exam"!==a.moduleType&&a.totalPoints),e.R7$(),e.Y8G("ngIf",!a.isSorting),e.R7$(),e.Y8G("ngIf",!(a.selectedExam||null!=a.questions&&null!=a.questions.data&&a.questions.data.length||a.isLoading)),e.R7$(),e.Y8G("ngClass",e.eq3(27,Mt,!(null!=a.templateQuestions&&null!=a.templateQuestions.data&&a.templateQuestions.data.length))),e.R7$(3),e.Y8G("dataSource",a.templateQuestions),e.R7$(),e.Y8G("ngForOf",null==a.templateTableData?null:a.templateTableData.table),e.R7$(),e.Y8G("matHeaderRowDef",null==a.templateTableData?null:a.templateTableData.columns),e.R7$(),e.Y8G("matRowDefColumns",null==a.templateTableData?null:a.templateTableData.columns))},dependencies:[u.YU,u.Sq,u.bT,u.ux,u.e1,u.fG,Pi,b.Zl,b.tL,b.ji,b.cC,b.YV,b.iL,b.KS,b.$R,b.YZ,b.NB,ve.iy,Oe.kk,Oe.fb,Oe.Cp,E.$z,E.iY,ne.fg,A.rl,A.nJ,A.JW,He.K,he.t,Te,$t,u.PV,m.D9,rt.v],styles:[".hide[_ngcontent-%COMP%]{display:none}.open-manual-button[_ngcontent-%COMP%]{padding:var(--space-0_5rem) var(--space-1rem);border-radius:var(--border-radius-xxs)}.open-manual-button[_ngcontent-%COMP%] h5[_ngcontent-%COMP%]{display:flex;gap:var(--space-1rem);justify-content:center;align-items:center}.table-container[_ngcontent-%COMP%]{max-width:var(--size-100-percent);overflow-x:auto}.numbering[_ngcontent-%COMP%]{width:var(--size-icon-md)}.td-btn[_ngcontent-%COMP%]{border:var(--border-style-none);background:var(--color-black-transparency-1);padding:var(--space-0);margin:var(--space-0)}.td-btn[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:var(--font-size-131);color:var(--color-icons)!important}.mat-column-add[_ngcontent-%COMP%], .mat-column-number[_ngcontent-%COMP%], .mat-column-difficulty[_ngcontent-%COMP%], .mat-column-points[_ngcontent-%COMP%], .mat-column-edit[_ngcontent-%COMP%], .mat-column-delete[_ng
3content-%COMP%]{text-align:center}\n\n/*# sourceMappingURL=teacher-assignment-edit.component.css.map*/"]}),o})();var eo=f(52575),to=f(91817),ye=f(91033);const no={columns:["picture","student","type","title","points","submission","evaluated","evaluate","expand"],table:[{label:null,columnRef:"picture",property:"student.picture",headerClasses:"py-3 px-2",columnClasses:"py-3 px-2",shouldFold:!1,foldClasses:null},{label:"student",columnRef:"student",property:null,headerClasses:"py-3 px-2 th-w-md font-weight-bold",columnClasses:"py-3 px-2 align-middle",shouldFold:!1,foldClasses:null},{label:"type",columnRef:"type",property:"solvingTypeTranslated",headerClasses:"py-3 px-2 th-w-sm font-weight-bold d-none d-sm-table-cell",columnClasses:"py-3 px-2 align-middle d-none d-sm-table-cell text-nowrap",shouldFold:!0,foldClasses:"pb-3 d-sm-none"},{label:"title",columnRef:"title",property:"title",headerClasses:"py-3 px-2 th-w-sm font-weight-bold d-none d-lg-table-cell",columnClasses:"py-3 px-2 align-middle d-none d-lg-table-cell",shouldFold:!0,foldClasses:"pb-3 d-lg-none"},{label:"points",columnRef:"points",property:"pointsString",headerClasses:"py-3 px-2 th-w-sm font-weight-bold d-none d-lg-table-cell",columnClasses:"py-3 px-2 align-middle d-none d-lg-table-cell text-nowrap",shouldFold:!0,foldClasses:"pb-3 d-lg-none"},{label:"evaluation.submission",columnRef:"submission",property:"submissionDateString",headerClasses:"py-3 px-2 th-w-sm font-weight-bold d-none d-xl-table-cell",columnClasses:"py-3 px-2 align-middle d-none d-xl-table-cell text-nowrap",shouldFold:!0,foldClasses:"pb-3 d-xl-none"},{label:"evaluation.evaluated",columnRef:"evaluated",property:"correctionDateString",headerClasses:"py-3 px-2 th-w-sm font-weight-bold d-none d-xl-table-cell",columnClasses:"py-3 px-2 align-middle d-none d-xl-table-cell text-nowrap",shouldFold:!0,foldClasses:"pb-3 d-xl-none"},{label:"evaluate",columnRef:"evaluate",property:"evaluate",headerClasses:"py-3 px-2 th-w-sm font-weight-bold text-center text-sm-right d-none d-sm-table-cell",columnClasses:"py-3 px-2 text-nowrap align-middle text-center text-sm-right d-none d-sm-table-cell",shouldFold:!0,foldClasses:"d-sm-none"},{label:null,columnRef:"expand",property:"expand",headerClasses:"py-3 px-2 d-table-cell d-xl-none",columnClasses:"py-3 px-2 text-nowrap align-middle text-center d-table-cell d-xl-none cursor-pointer",shouldFold:!1,foldClasses:null}],shouldOverflow:!0,overflowClasses:"d-table-row d-xl-none expanding-row"},io={columns:["picture","id","fullName","evaluate","expand"],table:[{label:null,columnRef:"picture",property:"picture",headerClasses:"",columnClasses:"",shouldFold:!1,foldClasses:null},{label:"ID",columnRef:"id",property:"id",headerClasses:"th-w-md font-weight-bold",columnClasses:"text-nowrap align-middle",shouldFold:!1,foldClasses:null},{label:"student",columnRef:"fullName",property:"fullName",headerClasses:"th-w-md font-weight-bold",columnClasses:"align-middle",shouldFold:!1,foldClasses:null},{label:"evaluate",columnRef:"evaluate",property:"evaluate",headerClasses:"th-w-sm font-weight-bold text-center text-sm-right d-none d-sm-table-cell",columnClasses:"text-nowrap align-middle text-center text-sm-right d-none d-sm-table-cell",shouldFold:!0,foldClasses:"d-sm-none"},{label:null,columnRef:"expand",property:"expand",headerClasses:"d-table-cell d-sm-none",columnClasses:"text-nowrap align-middle text-center d-table-cell d-sm-none cursor-pointer",shouldFold:!1,foldClasses:null}],shouldOverflow:!0,overflowClasses:"d-table-row d-sm-none expanding-row"},ao={columns:["picture","student","type","title","points","submission","evaluated","evaluate","expand"],table:[{label:null,columnRef:"picture",property:"student.picture",headerClasses:"py-3 px-2",columnClasses:"py-3 px-2",shouldFold:!1,foldClasses:null},{label:"student",columnRef:"student",property:null,headerClasses:"py-3 px-2 th-w-md font-weight-bold",columnClasses:"py-3 px-2 align-middle",shouldFold:!1,foldClasses:null},{label:"type",columnRef:"type",property:"solvingTypeTranslated",headerClasses:"py-3 px-2 th-w-sm font-weight-bold d-none d-md-table-cell",columnClasses:"py-3 px-2 align-middle d-none d-md-table-cell text-nowrap",shouldFold:!0,foldClasse
3s:"pb-3 d-md-none"},{label:"title",columnRef:"title",property:"title",headerClasses:"py-3 px-2 th-w-sm font-weight-bold d-none d-lg-table-cell",columnClasses:"py-3 px-2 align-middle d-none d-lg-table-cell",shouldFold:!0,foldClasses:"pb-3 d-lg-none"},{label:"points",columnRef:"points",property:"pointsString",headerClasses:"py-3 px-2 th-w-sm font-weight-bold d-none d-lg-table-cell",columnClasses:"py-3 px-2 align-middle d-none d-lg-table-cell text-nowrap",shouldFold:!0,foldClasses:"pb-3 d-lg-none"},{label:"evaluation.submission",columnRef:"submission",property:"submissionDateString",headerClasses:"py-3 px-2 th-w-sm font-weight-bold d-none d-xl-table-cell",columnClasses:"py-3 px-2 align-middle d-none d-xl-table-cell text-nowrap",shouldFold:!0,foldClasses:"pb-3 d-xl-none"},{label:"evaluation.evaluated",columnRef:"evaluated",property:"correctionDateString",headerClasses:"py-3 px-2 th-w-sm font-weight-bold d-none d-xl-table-cell",columnClasses:"py-3 px-2 align-middle d-none d-xl-table-cell text-nowrap",shouldFold:!0,foldClasses:"pb-3 d-xl-none"},{label:"evaluate",columnRef:"evaluate",property:"evaluate",headerClasses:"py-3 px-2 th-w-sm font-weight-bold text-center text-sm-right d-none d-sm-table-cell",columnClasses:"py-3 px-2 text-nowrap align-middle text-center text-sm-right d-none d-sm-table-cell",shouldFold:!0,foldClasses:"d-sm-none"},{label:null,columnRef:"expand",property:"expand",headerClasses:"py-3 px-2 d-table-cell d-xl-none",columnClasses:"py-3 px-2 text-nowrap align-middle text-center d-table-cell d-xl-none cursor-pointer",shouldFold:!1,foldClasses:null}],shouldOverflow:!0,overflowClasses:"d-table-row d-xl-none expanding-row"},oo={columns:["picture","student","type","course","title","points","submission","waitingDays","evaluate","expand"],table:[{label:"",columnRef:"picture",property:"student.picture",headerClasses:"py-3 px-2",columnClasses:"py-3 px-2",shouldFold:!1,foldClasses:null},{label:"student",columnRef:"student",property:null,headerClasses:"py-3 px-2 th-w-md font-weight-bold",columnClasses:"py-3 px-2 align-middle",shouldFold:!1,foldClasses:null},{label:"type",columnRef:"type",property:"solvingTypeTranslated",headerClasses:"py-3 px-2 th-w-sm font-weight-bold d-none d-md-table-cell",columnClasses:"py-3 px-2 align-middle d-none d-md-table-cell text-nowrap",shouldFold:!0,foldClasses:"pb-3 d-md-none"},{label:"course.singular",columnRef:"course",property:"course.courseCode",headerClasses:"py-3 px-2 th-w-sm font-weight-bold d-none d-md-table-cell",columnClasses:"py-3 px-2 align-middle d-none d-md-table-cell",shouldFold:!0,foldClasses:"pb-3 d-md-none"},{label:"title",columnRef:"title",property:"title",headerClasses:"py-3 px-2 th-w-sm font-weight-bold d-none d-lg-table-cell",columnClasses:"py-3 px-2 align-middle d-none d-lg-table-cell",shouldFold:!0,foldClasses:"pb-3 d-lg-none"},{label:"points",columnRef:"points",property:"pointsString",headerClasses:"py-3 px-2 th-w-sm font-weight-bold d-none d-lg-table-cell",columnClasses:"py-3 px-2 align-middle d-none d-lg-table-cell text-nowrap",shouldFold:!0,foldClasses:"pb-3 d-lg-none"},{label:"evaluation.submission",columnRef:"submission",property:"submissionDateString",headerClasses:"py-3 px-2 th-w-sm font-weight-bold d-none d-xl-table-cell",columnClasses:"py-3 px-2 align-middle d-none d-xl-table-cell text-nowrap",shouldFold:!0,foldClasses:"pb-3 d-xl-none"},{label:"evaluation.waitingDays",columnRef:"waitingDays",property:"waitingDays",headerClasses:"py-3 px-2 th-w-sm font-weight-bold text-center d-none d-xl-table-cell",columnClasses:"py-3 px-2 text-center d-none d-xl-table-cell align-middle text-nowrap",shouldFold:!0,foldClasses:"pb-3 d-xl-none"},{label:"evaluate",columnRef:"evaluate",property:"evaluate",headerClasses:"py-3 px-2 th-w-sm font-weight-bold text-center text-sm-right d-none d-sm-table-cell",columnClasses:"py-3 px-2 text-nowrap align-middle text-center text-sm-right d-none d-sm-table-cell",shouldFold:!0,foldClasses:"d-sm-none"},{label:"",columnRef:"expand",property:"expand",headerClasses:"py-3 px-2 d-table-cell d-xl-none",columnClasses:"py-3 px-2 text-nowrap align-middle text-center d-table-cell d-xl-none cursor-pointer",shouldFold:!1,foldClasse
3s:null}],shouldOverflow:!0,overflowClasses:"d-table-row d-xl-none expanding-row"};var wt=f(73222),Ee=f(40982);const so=["first_link","last_link","next_link","prev_link"],ro=(t,o,n)=>({startIndex:t,endIndex:o,length:n});function lo(t,o){if(1&t&&(e.j41(0,"div",6),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t){const n=e.XpG();e.R7$(),e.SpI(" ",e.i5U(2,1,"paginator.rangeLabelMultiplePages",e.sMw(4,ro,n.from,n.to,n.total))," ")}}function co(t,o){if(1&t){const n=e.RV6();e.j41(0,"button",7),e.nI1(1,"translate"),e.nI1(2,"translate"),e.bIt("click",function(){const a=e.eBV(n).$implicit,s=e.XpG();return e.Njj(a.link?s.navigate(a.link):null)}),e.qSk(),e.j41(3,"svg",8),e.nrm(4,"path"),e.k0s()()}if(2&t){const n=o.$implicit;e.HbH(n.classes),e.Y8G("disabled",!n.link)("matTooltip",e.bMT(1,7,n.label)),e.BMQ("aria-label",e.bMT(2,9,n.label)),e.R7$(4),e.BMQ("d",n.icon)}}let mo=(()=>{var t;class o{constructor(){this.helperService=(0,e.WQX)(Ee.w),this.pagination=null,this.meta=null,this.pageChange=new e.bkB,this.pages=null,this.controls=[]}ngOnChanges(i){this.loadPages()}loadPages(){const{current_page:i,from:a,last_page:s,path:r,per_page:l,to:p,total:d}=this.meta||{},h=this.pagination||{},{first_link:v,last_link:$,next_link:k,prev_link:M}=h,J=(0,wt.A)(h,so);this.currentPage=i,this.from=+a+1,this.lastPage=s,this.path=r,this.perPage=l,this.to=p,this.total=d,this.controls=[{link:v,label:"paginator.firstPageLabel",icon:"M240-240v-480h80v480h-80Zm440 0L440-480l240-240 56 56-184 184 184 184-56 56Z",classes:"mat-mdc-paginator-navigation-first"},{link:M,label:"paginator.previousPageLabel",icon:"M560-240 320-480l240-240 56 56-184 184 184 184-56 56Z",classes:"mat-mdc-paginator-navigation-previous"},{link:k,label:"paginator.nextPageLabel",icon:"M504-480 320-664l56-56 240 240-240 240-56-56 184-184Z",classes:"mat-mdc-paginator-navigation-next"},{link:$,label:"paginator.lastPageLabel",icon:"m280-240-56-56 184-184-184-184 56-56 240 240-240 240Zm360 0v-480h80v480h-80Z",classes:"mat-mdc-paginator-navigation-last"}],this.pages=this.helperService.isEmptyObj(J)?null:J}navigate(i){this.pageChange.emit(i)}}return(t=o).\u0275fac=function(i){return new(i||t)},t.\u0275cmp=e.VBU({type:t,selectors:[["app-async-paginator"]],inputs:{pagination:"pagination",meta:"meta"},outputs:{pageChange:"pageChange"},features:[e.OA$],decls:7,vars:5,consts:[["role","group",1,"mat-mdc-paginator"],[1,"mat-mdc-paginator-outer-container"],[1,"mat-mdc-paginator-container"],[1,"mat-mdc-paginator-range-actions"],["aria-live","polite","class","mat-mdc-paginator-range-label",4,"ngIf"],["mat-icon-button","","matTooltipPosition","above",3,"disabled","matTooltip","class","click",4,"ngFor","ngForOf"],["aria-live","polite",1,"mat-mdc-paginator-range-label"],["mat-icon-button","","matTooltipPosition","above",3,"click","disabled","matTooltip"],["xmlns","http://www.w3.org/2000/svg","height","24","viewBox","0 -960 960 960","width","24"]],template:function(i,a){1&i&&(e.j41(0,"div",0),e.nI1(1,"translate"),e.j41(2,"div",1)(3,"div",2)(4,"div",3),e.DNE(5,lo,3,8,"div",4)(6,co,5,11,"button",5),e.k0s()()()()),2&i&&(e.BMQ("aria-label",e.bMT(1,3,"selectPage")),e.R7$(5),e.Y8G("ngIf",a.from&&a.to),e.R7$(),e.Y8G("ngForOf",a.controls))},dependencies:[u.Sq,u.bT,E.iY,Re.oV,m.D9],encapsulation:2}),o})();var H=f(90353),Ne=f(8432);const jt=()=>({exact:!0}),po=(t,o)=>["/teacher/ecampus/",t,o,"evaluation"],uo=(t,o)=>["/teacher/ecampus/",t,o];let Gt=(()=>{var t;class o{constructor(){this.teacherService=(0,e.WQX)(S.O),this.teacherEloService=(0,e.WQX)(W)}ngOnInit(){this.courseId=this.teacherService.getCurrentCourseId(),this.type=this.teacherEloService.getType(),this.plural=this.teacherEloService.getPluralType()}}return(t=o).\u0275fac=function(i){return new(i||t)},t.\u0275cmp=e.VBU({type:t,selectors:[["app-teacher-assignment-navigation"]],decls:11,vars:18,consts:[[1,"container","p-0"],[1,"row"],[1,"col-12","mb-4"],[1,"button-container"],["mat-raised-button","","color","primary","routerLinkActive","active",1,"exam-nav-item",3,"routerLinkActiveOptions","routerLink"]],template:function(i,a){1&i&&(e.j41(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"a",4),e.EFF(5),e.nI1(6,"translate"),e.k0s(),e.j41(7,"a",4),e.EFF(8),e.nI1(9,"translate"),e.k0s()()()(),e.nrm(10,"router-outlet"),e.k0s()),2&i&&(e.R7$(4),e.Y8G("routerLinkActiveOptions",e.lJ4(10,jt))("routerLink",e.l_i(11,po,a.type,a.courseId)),e.R7$(),e.SpI(" ",e.bMT(6,6,"evaluation.evaluation")," "),e.R7$(2),e.Y8G("routerLinkActiveOptions",e.lJ4(14,jt))("routerLink",e.l_i(15,uo,a.type,a.courseId)),e.R7$(),e.SpI(" ",e.bMT(9,8,a.plural)," "))},dependencies:[E.It,O.n3,O.Wk,O.wQ,m.D9],styles:[".exam-nav-item[_ngcontent-%COMP%]{opacity:var(--opacity-65)}.exam-nav-item.active[_ngcontent-%COMP%]{opacity:var(--opacity-100)}\n\n/*# sourceMappingURL=teacher-assignment-navigation.component.css.map*/"]}),o})();var _o=f(64486),ct=f(17077);const ho=t=>({published:t}),Dt=t=>({minPercent:t}),fo=()=>({value:0}),Ot=t=>({value:t}),go=t=>({min:t}),vo=t=>({examType:t});function bo(t,o){1&t&&e.nrm(0,"app-spinner")}function To(t,o){1&t&&(e.qex(0),e.EFF(1,"*"),e.bVm())}function Co(t,o){if(1&t&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t){const n=e.XpG(2);e.R7$(),e.SpI(" ",e.i5U(2,1,"evaluation.minPercent",e.eq3(4,Dt,n.minPercent)),"")}}function xo(t,o){1&t&&(e.qex(0),e.EFF(1,"*"),e.bVm())}function Io(t,o){if(1&t&&(e.j41(0,"div",18)(1,"div",7)(2,"div",6)(3,"div",19)(4,"p",20)(5,"strong"),e.EFF(6),e.nI1(7,"translate"),e.DNE(8,To,2,0,"ng-container",0),e.k0s()()(),e.j41(9,"div",19)(10,"p",20)(11,"strong"),e.EFF(12),e.nI1(13,"translate"),e.k0s()()(),e.j41(14,"div",19)(15,"p",20)(16,"strong"),e.EFF(17),e.nI1(18,"translate"),e.DNE(19,Co,3,6,"span",0)(20,xo,2,0,"ng-container",0),e.k0s()()()(),e.nrm(21,"hr"),e.k0s()()),2&t){const n=e.XpG();e.R7$(6),e.JRh(e.bMT(7,6,"points")),e.R7$(2),e.Y8G("ngIf",n.editMode&&n.canEditValues&&n.pointsRequired),e.R7$(4),e.JRh(e.bMT(13,8,"percentage")),e.R7$(5),e.JRh(e.bMT(18,10,n.noExamType?"examPassedStatus.present":"evaluation.passed")),e.R7$(2),e.Y8G("ngIf",n.minPercent),e.R7$(),e.Y8G("ngIf",n.editMode&&n.canEditValues)}}function Ro(t,o){1&t&&(e.qex(0),e.EFF(1,"*"),e.bVm())}function Fo(t,o){1&t&&(e.qex(0),e.EFF(1),e.nI1(2,"translate"),e.bVm()),2&t&&(e.R7$(),e.JRh(e.i5U(2,1,"formValidation.numberToLow",e.lJ4(4,fo))))}function ko(t,o){1&t&&(e.qex(0),e.EFF(1),e.nI1(2,"translate"),e.bVm()),2&t&&(e.R7$(),e.JRh(e.bMT(2,1,"formValidation.teacher.evaluation.requirePoints")))}function yo(t,o){if(1&t&&(e.qex(0),e.EFF(1),e.nI1(2,"translate"),e.bVm()),2&t){const n=e.XpG(4);e.R7$(),e.JRh(e.i5U(2,1,"formValidation.numberToHigh",e.eq3(4,Ot,n.maxValue)))}}function Eo(t,o){if(1&t&&(e.j41(0,"mat-error"),e.DNE(1,Fo,3,5,"ng-container",0)(2,ko,3,3,"ng-container",0)(3,yo,3,6,"ng-container",0),e.k0s()),2&t){const n=e.XpG(3);e.R7$(),e.Y8G("ngIf",null==n.points||null==n.points.errors?null:n.points.errors.min),e.R7$(),e.Y8G("ngIf",null==n.points||null==n.points.errors?null:n.points.errors.required),e.R7$(),e.Y8G("ngIf",null==n.points||null==n.points.errors?null:n.points.errors.max)}}function So(t,o){if(1&t&&(e.qex(0),e.j41(1,"div",29)(2,"mat-form-field",30),e.nrm(3,"input",31),e.k0s(),e.j41(4,"span",32),e.EFF(5),e.k0s()(),e.DNE(6,Eo,4,3,"mat-error",0),e.bVm()),2&t){const n=e.XpG(2);e.R7$(3),e.Y8G("max",n.maxValue),e.R7$(2),e.SpI("\xa0/\xa0",n.maxValue,""),e.R7$(),e.Y8G("ngIf",n.editMode&&((null==n.points?null:n.points.touched)||
3!(null!=n.points&&n.points.pristine))&&(null==n.points?null:n.points.errors))}}function $o(t,o){if(1&t&&(e.qex(0),e.j41(1,"p",33),e.EFF(2),e.k0s(),e.bVm()),2&t){const n=e.XpG(2);e.R7$(2),e.Lme("",null==n.points?null:n.points.value,"/",n.maxValue,"")}}function Mo(t,o){if(1&t&&(e.j41(0,"p"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t){const n=e.XpG(2);e.R7$(),e.SpI(" ",e.i5U(2,1,"typography.percent",e.eq3(4,Ot,n.pointsPercentage))," ")}}function wo(t,o){1&t&&(e.qex(0),e.EFF(1,"*"),e.bVm())}function jo(t,o){if(1&t&&(e.j41(0,"mat-option",37),e.EFF(1),e.k0s()),2&t){const n=o.$implicit;e.Y8G("disabled",n.disabled)("value",n.value),e.R7$(),e.SpI(" ",n.label," ")}}function Go(t,o){if(1&t&&(e.j41(0,"mat-form-field",34)(1,"mat-select",35),e.DNE(2,jo,2,3,"mat-option",36),e.k0s()()),2&t){const n=e.XpG(2);e.R7$(2),e.Y8G("ngForOf",n.examStatuses)}}function Do(t,o){if(1&t&&(e.qex(0),e.EFF(1),e.bVm()),2&t){const n=e.XpG().$implicit;e.R7$(),e.JRh(n.label)}}function Oo(t,o){if(1&t&&(e.qex(0),e.DNE(1,Do,2,1,"ng-container",0),e.bVm()),2&t){const n=o.$implicit,i=e.XpG(3);e.R7$(),e.Y8G("ngIf",n.value===i.examPassed)}}function Ao(t,o){if(1&t&&(e.j41(0,"p",33),e.DNE(1,Oo,2,1,"ng-container",38),e.k0s()),2&t){const n=e.XpG(2);e.R7$(),e.Y8G("ngForOf",n.examStatuses)}}function No(t,o){if(1&t&&(e.j41(0,"div",21)(1,"div",22)(2,"div",6)(3,"div",23)(4,"p",24)(5,"strong"),e.EFF(6),e.nI1(7,"translate"),e.DNE(8,Ro,2,0,"ng-container",0),e.k0s()()(),e.j41(9,"div",25)(10,"div",26),e.DNE(11,So,7,3,"ng-container",0)(12,$o,3,2,"ng-container",0),e.k0s()()()(),e.j41(13,"div",22)(14,"div",27)(15,"div",23)(16,"p",24)(17,"strong"),e.EFF(18),e.nI1(19,"translate"),e.k0s()()(),e.j41(20,"div",25),e.DNE(21,Mo,3,6,"p",0),e.k0s()()(),e.j41(22,"div",22)(23,"div",6)(24,"div",23)(25,"p",24)(26,"strong"),e.EFF(27),e.nI1(28,"translate"),e.DNE(29,wo,2,0,"ng-container",0),e.k0s()()(),e.j41(30,"div",28),e.DNE(31,Go,3,1,"mat-form-field",10)(32,Ao,2,1,"p",9),e.k0s()()()()),2&t){const n=e.XpG();e.R7$(6),e.JRh(e.bMT(7,10,"points")),e.R7$(2),e.Y8G("ngIf",n.editMode&&n.canEditValues&&n.pointsRequired),e.R7$(3),e.Y8G("ngIf",n.editMode&&n.canEditValues),e.R7$(),e.Y8G("ngIf",(!n.editMode||!n.canEditValues)&&((null==n.points?null:n.points.value)>0||0===(null==n.points?null:n.points.value))&&(n.maxValue>0||0===n.maxValue)),e.R7$(6),e.JRh(e.bMT(19,12,"percentage")),e.R7$(3),e.Y8G("ngIf",n.pointsPercentage>0||0===n.pointsPercentage),e.R7$(6),e.JRh(e.i5U(28,14,n.noExamType?"examPassedStatus.present":"evaluation.passed",e.eq3(17,Dt,n.minPercent))),e.R7$(2),e.Y8G("ngIf",n.editMode&&n.canEditValues),e.R7$(2),e.Y8G("ngIf",n.editMode&&n.canEditValues),e.R7$(),e.Y8G("ngIf",(!n.editMode||!n.canEditValues)&&(null==n.examStatuses?null:n.examStatuses.length))}}function Lo(t,o){1&t&&(e.j41(0,"p",33),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.SpI("",e.bMT(2,1,"evaluation.add"),"*"))}function Yo(t,o){1&t&&(e.qex(0),e.EFF(1),e.nI1(2,"translate"),e.bVm()),2&t&&(e.R7$(),e.JRh(e.bMT(2,1,"formValidation.required")))}function Vo(t,o){if(1&t&&(e.qex(0),e.EFF(1),e.nI1(2,"translate"),e.bVm()),2&t){const n=e.XpG(3);e.R7$(),e.JRh(e.i5U(2,1,"formValidation.tooShort",e.eq3(4,go,n.feedbackMinLength)))}}function Po(t,o){if(1&t&&(e.j41(0,"mat-error"),e.DNE(1,Yo,3,3,"ng-container",0)(2,Vo,3,6,"ng-container",0),e.k0s()),2&t){const n=e.XpG(2);e.R7$(),e.Y8G("ngIf",null==n.feedback||null==n.feedback.errors?null:n.feedback.errors.required),e.R7$(),e.Y8G("ngIf",null==n.feedback||null==n.feedback.errors?null:n.feedback.errors.minlength)}}function Xo(t,o){if(1&t&&(e.j41(0,"mat-form-field",34),e.nrm(1,"textarea",39),e.DNE(2,Po,3,2,"mat-error",0),e.k0s()),2&t){const n=e.XpG();e.R7$(2),e.Y8G("ngIf",n.editMode&&((null==n.feedback?null:n.feedback.touched)||!(null!=n.feedback&&n.feedback.pristine))&&(null==n.feedback?null:n.feedback.errors))}}function Bo(t,o){if(1&t&&e.nrm(0,"app-read-more-less",40),2&t){const n=e.XpG();e.Y8G("text",n.feedback.value)("characters",250)}}function qo(t,o){1&t&&(e.j41(0,"div",41)(1,"p"),e.EFF(2),e.nI1(3,"translate"),e.k0s()()),2&t&&(e.R7$(2),e.JRh(e.bMT(3,1,"formValidation.fieldsObligated")))}function Uo(t,o){if(1&t){const n=e.RV6();e.j41(0,"button",42),e.bIt("click",function(){e.eBV(n);const a=e.XpG();return e.Njj(a.cancelEditMode())}),e.EFF(1),e.nI1(2,"translate"),e.k0s()}2&t&&(e.R7$(),e.JRh(e.bMT(2,1,"cancel")))}function Jo(t,o){if(1&t&&(e.j41(0,"button",43),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t){const n=e.XpG();
3e.Y8G("disabled",n.submitting||n.evaluationForm.invalid||!n.editMode&&(!n.evaluationForm.dirty||!n.evaluationForm.touched)),e.R7$(),e.SpI(" ",e.bMT(2,2,"save")," ")}}function Qo(t,o){if(1&t){const n=e.RV6();e.j41(0,"button",44),e.bIt("click",function(){e.eBV(n);const a=e.XpG();return e.Njj(a.toggleEditMode(!0))}),e.nrm(1,"i",45),e.EFF(2),e.nI1(3,"translate"),e.k0s()}2&t&&(e.R7$(2),e.SpI(" ",e.bMT(3,1,"edit")," "))}function zo(t,o){if(1&t&&(e.j41(0,"p",48),e.nrm(1,"i",49),e.j41(2,"span",50),e.EFF(3),e.nI1(4,"translate"),e.k0s()()),2&t){const n=e.XpG(2);e.R7$(3),e.JRh(e.i5U(4,1,"evaluation.noExamFound",e.eq3(4,vo,null==n.module?null:n.module.type)))}}function Wo(t,o){if(1&t&&(e.j41(0,"div",46),e.DNE(1,zo,5,6,"p",47),e.k0s()),2&t){const n=e.XpG();e.R7$(),e.Y8G("ngIf",!n.allCourses&&!n.isLoading)}}let Ho=(()=>{var t;class o{constructor(){this.formBuilder=(0,e.WQX)(c.ok),this.helperService=(0,e.WQX)(Ee.w),this.teacherEloService=(0,e.WQX)(W),this.teacherService=(0,e.WQX)(S.O),this.toastrService=(0,e.WQX)(w.tw),this.translateService=(0,e.WQX)(m.c$),this.moduleId=null,this.eventId=null,this.courseId=null,this.courseCode=null,this.courseType=null,this.pointId=null,this.editMode=!0,this.noExamType=!1,this.canEditValues=!0,this.typeHasPoints=!0,this.examTypeId=null,this.examType="",this.evaluated=!1,this.examPassed=0,this.isPointInsertPossibleCurrentCase=!1,this.pointsInsertionAutomatic=!1,this.pointsInsertionManual=!1,this.passedShouldUpdateAutomatically=!0,this.pointsRequired=!0,this.maxValue=null,this.minPercent=null,this.pointsPercentage=null,this.submitting=!1,this.feedbackMinLength=5,this.noExamFound=!1,this.destroy$=new y.B}get points(){return this.evaluationForm.get("points")}get passed(){return this.evaluationForm.get("passed")}get feedback(){return this.evaluationForm.get("feedback")}ngOnChanges(i){this.initForm()}initForm(){var i;this.courseId=this.teacherService.getCurrentCourseId(),this.courseType=this.teacherService.getCurrentCourseType();const{pointsInsertionAutomatic:a,pointsInsertionManual:s,isPointInsertPossibleCurrentCase:r,courseCode:l,maxPoints:p,examTypeId:d,id:h}=this.module||{},{evaluated:v,eventId:$}=this.event||{},{points:k,feedback:M,passed:J,date:se,pointId:re}=(null===(i=this.event)||void 0===i?void 0:i.points)||{};this.moduleId=h,this.date=se,this.pointId=re||null,this.examTypeId=d,this.courseCode=l,this.eventId=$,this.evaluated=v,this.isPointInsertPossibleCurrentCase=r,this.pointsInsertionAutomatic=a,this.pointsInsertionManual=s,this.examPassed=+J||0,this.feedbackMinLength=5,this.canEditValues=!J,this.toggleEditMode(!v),ye.Y3.noExam===+this.examTypeId&&(this.passedShouldUpdateAutomatically=!1,this.noExamType=!0,this.pointsRequired=!1),this.teacherEloService.getExamInfo().pipe((0,I.Q)(this.destroy$)).subscribe(Q=>{var K,U;if(!Q)return this.noExamFound=!0;const z=((null==Q?void 0:Q.exams)||[]).find(st=>+st.examTypeId==+this.examTypeId);this.examInfo=z,this.maxValue=null!=z&&z.points?parseFloat(null==z?void 0:z.points):null,this.minPercent=z?+z.minPercent:null,this.examType=null==z?void 0:z.type;const be=!(!(null!==(K=this.event)&&void 0!==K&&null!==(K=K.points)&&void 0!==K&&K.points||0==+(null===(U=this.event)||void 0===U||null===(U=U.points)||void 0===U?void 0:U.points))||null==z||!z.points);this.typeHasPoints=be||!!p,this.examStatuses=(this.noExamType?ye.rI:ye.wN).map(st=>(0,g.A)((0,g.A)({},st),{},{label:this.translateService.instant(st.label)}))}),this.evaluationForm=this.formBuilder.group({feedback:[M||"",[c.k0.required,
3c.k0.minLength(this.feedbackMinLength),(0,ct.e)()]]}),this.typeHasPoints&&(this.evaluationForm.addControl("points",new c.MJ(+k||0,[c.k0.min(0),c.k0.max(this.maxValue),c.k0.pattern(_o.CY)])),this.evaluationForm.addControl("passed",new c.MJ(this.examPassed,[c.k0.required,c.k0.min(1)])),this.pointsRequired&&this.points.addValidators([c.k0.required]),this.processInputPoints(+k),this.points.valueChanges.pipe((0,I.Q)(this.destroy$)).subscribe(Q=>{this.processInputPoints(+Q)}),this.passed.valueChanges.pipe((0,I.Q)(this.destroy$)).subscribe(Q=>{this.noExamType||(3===Q?(this.points.markAsPristine(),this.points.markAsUntouched(),this.points.removeValidators([c.k0.required]),this.points.patchValue(null),this.pointsRequired=!1):(this.points.addValidators([c.k0.required]),this.pointsRequired=!0),this.points.updateValueAndValidity({emitEvent:!1}))}))}processInputPoints(i){"number"!=typeof i||isNaN(i)?this.pointsPercentage=null:(this.maxValue<i&&(this.points.patchValue(this.maxValue,{emitEvent:!1}),i=this.maxValue),i<0&&(this.points.patchValue(Math.abs(i),{emitEvent:!1}),i=Math.abs(i)),this.pointsPercentage=this.roundNumber(i/this.maxValue*100,2),this.canEditValues&&this.passedShouldUpdateAutomatically&&!this.points.pristine&&this.passed.patchValue(this.pointsPercentage>=this.minPercent?1:2))}roundNumber(i,a){const r=Math.pow(10,a);return Math.round(i*r)/r}onSubmit(){if(!this.editMode)return;if(this.evaluationForm.pristine)return void this.initForm();let i=this.evaluationForm.getRawValue(),a={};const{feedback:s,passed:r}=i;if(this.typeHasPoints){let{points:l}=i;l=3===r?(0).toFixed(2):(null!=l?l:0).toFixed(2),a=(0,g.A)((0,g.A)({},a),{},{point:l,passed:r})}a=(0,g.A)((0,g.A)({},a),{},{date:this.date,feedback:this.helperService.stripHtmlTagsFromString(s)}),this.submitting=!0,this.pointId?this.teacherEloService.patchStudentEvaluation(this.studentId,this.moduleId,this.eventId,this.pointId,a).pipe((0,I.Q)(this.destroy$)).subscribe(l=>{this.resetStates(l)}):(a=(0,g.A)((0,g.A)({},a),{},{date:(0,N.I1)().format(P.x.iso.date),type:+this.examTypeId,courseCode:this.courseCode,courseType:this.courseType,customerId:this.studentId}),this.teacherEloService.postStudentEvaluation(this.studentId,this.moduleId,this.eventId,this.examTypeId,this.courseId,a).pipe((0,I.Q)(this.destroy$)).subscribe(l=>{this.resetStates(l)}))}
3resetStates(i){i||this.toastrService.error(this.translateService.instant("errorLabel")),this.submitting=!1,this.initForm()}toggleEditMode(i){this.editMode=!!i,this.canEditValues=this.isPointInsertPossibleCurrentCase}cancelEditMode(){this.editMode=!1,this.initForm()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}}return(t=o).\u0275fac=function(i){return new(i||t)},t.\u0275cmp=e.VBU({type:t,selectors:[["app-teacher-exam-module-review"]],inputs:{module:"module",event:"event",studentId:"studentId"},features:[e.OA$],decls:19,vars:16,consts:[[4,"ngIf"],["id","module-evaluation",1,"module-evaluation","bg-light-grey",3,"hidden","ngClass"],[1,"w-100","my-3","d-inline-block",3,"ngSubmit","formGroup"],[1,"container"],["class","row d-none d-md-block",4,"ngIf"],["class","row mb-5",4,"ngIf"],[1,"row"],[1,"col-12"],[1,"md-form","mt-0"],["class","m-0",4,"ngIf"],["appearance","fill",4,"ngIf"],["class","mb-4","data-cy","important-message",3,"text","characters",4,"ngIf"],["class","col-12 text-right",4,"ngIf"],["s","",1,"col-12","button-container","justify-content-end"],["mat-raised-button","","color","main-inverted","type","button",3,"click",4,"ngIf"],["mat-raised-button","","color","accent","type","submit",3,"disabled",4,"ngIf"],["type","button","mat-raised-button","","color","dgrey",3,"click",4,"ngIf"],["class","bg-light-grey",4,"ngIf"],[1,"row","d-none","d-md-block"],[1,"col-6","col-md-4"],[1,"text-dark","m-0"],[1,"row","mb-5"],[1,"col-12","col-md-4"],[1,"col-6","col-md-12","d-block","d-md-none"],[1,"text-dark"],[1,"col-6","col-md-12"],[1,"mt-0","position-relative","d-flex","flex-wrap"],[1,"row","md-form","mt-0"],[1,"col-6","col-md-12","mt-0"],[1,"points-input-grid","w-100"],["appearance","fill",1,"point-input"],["matInput","","min","0","size","4","type","number","formControlName","points","name","points","id","points",3,"max"],[1,"mt-3"],[1,"m-0"],["appearance","fill"],["formControlName","passed","id","passed",1,"w-100"],[3,"disabled","value",4,"ngFor","ngForOf"],[3,"disabled","value"],[4,"ngFor","ngForOf"],["matInput","","formControlName","feedback","name","feedback","id","feedback","cols","30","rows","4",1,"w-100"],["data-cy","important-message",1,"mb-4",3,"text","characters"],[1,"col-12","text-right"],["mat-raised-button","","color","main-inverted","type","button",3,"click"],["mat-raised-button","","color","accent","type","submit",3,"disabled"],["type","button","mat-raised-button","","color","dgrey",3,"click"],[1,"fas","fa-square-pen","text-white"],[1,"bg-light-grey"],["class","m-0 p-3",4,"ngIf"],[1,"m-0","p-3"],[1,"fas","fa-exclamation-circle","mr-2"],[1,"uppercase-first-letter"]],template:function(i,a){1&i&&(e.DNE(0,bo,1,0,"app-spinner",0),e.j41(1,"div",1)(2,"form",2),e.bIt("ngSubmit",function(){return a.onSubmit()}),e.j41(3,"div",3),e.DNE(4,Io,22,12,"div",4)(5,No,33,19,"div",5),e.j41(6,"div",6)(7,"div",7)(8,"div",8),e.DNE(9,Lo,3,3,"p",9)(10,Xo,3,1,"mat-form-field",10),e.k0s(),e.DNE(11,Bo,1,2,"app-read-more-less",11),e.k0s()(),e.j41(12,"div",6),e.DNE(13,qo,4,3,"div",12),e.j41(14,"div",13),e.DNE(15,Uo,3,3,"button",14)(16,Jo,3,4,"button",15)(17,Qo,4,3,"button",16),e.k0s()()()()(),e.DNE(18,Wo,2,1,"div",17)),2&i&&(e.Y8G("ngIf",a.submitting),e.R7$(),e.Y8G("hidden",a.noExamFound)("ngClass",e.eq3(14,ho,!a.editMode)),e.R7$(),e.Y8G("formGroup",a.evaluationForm),e.R7$(2),e.Y8G("ngIf",a.typeHasPoints),e.R7$(),e.Y8G("ngIf",a.typeHasPoints),e.R7$(4),e.Y8G("ngIf",a.editMode),e.R7$(),e.Y8G("ngIf",a.editMode),e.R7$(),e.Y8G("ngIf",!a.editMode&&a.feedback.value),e.R7$(2),e.Y8G("ngIf",a.editMode),e.R7$(2),e.Y8G("ngIf",a.evaluated&&a.editMode&&a.pointId),e.R7$(),e.Y8G("ngIf",a.editMode),e.R7$(),e.Y8G("ngIf",!a.editMode),e.R7$(),e.Y8G("ngIf",a.noExamFound))},dependencies:[u.YU,u.Sq,u.bT,c.qT,c.me,c.Q0,c.BC,c.cb,c.VZ,c.zX,c.j4,c.JD,E.$z,ne.fg,A.rl,A.TL,xe.VO,Ie.wT,He.K,he.t,m.D9],styles:[".button-reset[_ngcontent-%COMP%]{outline:var(--outline-none);border:var(--border-style-none);background:none}.published[_ngcontent-%COMP%]{background:var(--color-tint-4)!important}#feedback[_ngcontent-%COMP%]{border-top:var(--border-style-none);border-right:var(--border-style-none);border-left:var(--border-style-none)}.file-list[_ngcontent-%COMP%]{pointer-events:none;cursor:initial;display:flex;align-items:center;justify-content:flex-start}.delete-row[_ngcontent-%COMP%]{gap:var(--space-1rem)}
3.delete_file[_ngcontent-%COMP%]{border:var(--border-style-none);border-radius:var(--border-radius-full);padding:var(--space-5px) var(--space-10px)}.delete_file[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:var(--color-tint-1)}.file-error[_ngcontent-%COMP%]{top:var(--space-50px)!important}.points-input-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:5rem 1fr}\n\n/*# sourceMappingURL=teacher-exam-module-review.component.css.map*/"]}),o})();const Ko=(t,o)=>({id:t,name:o}),Zo=t=>({examType:t});function es(t,o){if(1&t&&(e.j41(0,"div",4)(1,"h3"),e.nrm(2,"strong",5),e.nI1(3,"translate"),e.k0s()()),2&t){const n=e.XpG(2);e.R7$(2),e.Y8G("innerHTML",e.i5U(3,1,"evaluation.title",e.l_i(4,Ko,null==n.student?null:n.student.id,null==n.student?null:n.student.fullName)),e.npT)}}function ts(t,o){if(1&t&&e.nrm(0,"app-teacher-exam-module-review",12),2&t){const n=e.XpG().$implicit,i=e.XpG(3);e.Y8G("module",n)("event",null==n?null:n.currentEvent)("studentId",null==i.student?null:i.student.id)}}function ns(t,o){if(1&t&&(e.j41(0,"p",15),e.nrm(1,"i",16),e.j41(2,"span",17),e.EFF(3),e.nI1(4,"translate"),e.k0s()()),2&t){const n=e.XpG(2).$implicit;e.R7$(3),e.JRh(e.i5U(4,1,"evaluation.notEvaluatable",e.eq3(4,Zo,null==n?null:n.type)))}}function is(t,o){if(1&t&&(e.j41(0,"div",13),e.DNE(1,ns,5,6,"p",14),e.k0s()),2&t){const n=e.XpG(4);e.R7$(),e.Y8G("ngIf",!n.allCourses)}}function as(t,o){if(1&t&&(e.qex(0),e.j41(1,"div")(2,"h5",8)(3,"strong")(4,"u"),e.EFF(5),e.nI1(6,"titleCaseFirstWord"),e.k0s()()(),e.j41(7,"div",9),e.DNE(8,ts,1,3,"app-teacher-exam-module-review",10)(9,is,2,1,"div",11),e.k0s()(),e.bVm()),2&t){const n=o.$implicit;e.R7$(5),e.JRh(e.bMT(6,3,(null==n?null:n.type)||"")),e.R7$(3),e.Y8G("ngIf",!n.notEvaluatable),e.R7$(),e.Y8G("ngIf",n.notEvaluatable)}}function os(t,o){if(1&t&&(e.j41(0,"div",6),e.DNE(1,as,10,5,"ng-container",7),e.k0s()),2&t){const n=e.XpG(2);e.R7$(),e.Y8G("ngForOf",n.modules)}}function ss(t,o){if(1&t&&(e.qex(0),e.j41(1,"div",1),e.DNE(2,es,4,7,"div",2),e.k0s(),e.nrm(3,"hr"),e.DNE(4,os,2,1,"div",3),e.bVm()),2&t){const n=e.XpG();e.R7$(2),e.Y8G("ngIf",n.student),e.R7$(2),e.Y8G("ngIf",n.studentHasExams)}}function rs(t,o){1&t&&(e.qex(0),e.j41(1,"div",1)(2,"div",18)(3,"p",19),e.nrm(4,"i",16),e.j41(5,"span",17),e.EFF(6),e.nI1(7,"translate"),e.k0s()()()(),e.bVm()),2&t&&(e.R7$(6),e.JRh(e.bMT(7,1,"evaluation.noEvaluationForStudent")))}let ls=(()=>{var t;class o{constructor(){this.teacherService=(0,e.WQX)(S.O),this.router=(0,e.WQX)(O.Ix),this.toastrService=(0,e.WQX)(w.tw),this.translateService=(0,e.WQX)(m.c$),this.modules=[],this.studentHasExams=!1}ngOnInit(){const i=this.teacherService.getCurrentCourseId();if(this.teacherService.setFullScreen(!0),this.teacherService.setBackBtnText("evaluation.examAndEvaluation"),this.teacherService.setBackBtnRoute(null),!this.student)return this.toastrService.error(this.translateService.instant("evaluation.studentEvaluationNotFound")),this.router.navigate(["/teacher/ecampus/exam/".concat(i,"/evaluation")]);this.modules=this.student.examInfo,this.modules&&this.modules.length&&(this.studentHasExams=!0)}ngOnDestroy(){this.teacherService.setFullScreen(!1),this.teacherService.setBackBtnText(null)}}return(t=o).\u0275fac=function(i){return new(i||t)},t.\u0275cmp=e.VBU({type:t,selectors:[["app-teacher-exam-student-evaluation"]],inputs:{student:"student"},decls:2,vars:2,consts:[[4,"ngIf"],[1,"row"],["class","col-12 py-4",4,"ngIf"],["class","py-3 d-flex flex-column evaluation-container",4,"ngIf"],[1,"col-12","py-4"],[3,"innerHTML"],[1,"py-3","d-flex","flex-column","evaluation-container"],[4,"ngFor","ngForOf"],[1,"mb-3","text-dark"],[1,"d-flex","flex-column","evaluation-container"],[3,"module","event","studentId",4,"ngIf"],["class","bg-light-grey",4,"ngIf"],[3,"module","event","studentId"],[1,"bg-light-grey"],["class","m-0 p-3",4,"ngIf"],[1,"m-0","p-3"],[1,"fas","fa-exclamation-circle","mr-2"],[1,"uppercase-first-letter"],[1,"col-12","my-5"],[1,"text-center","m-0"]],template:function(i,a){1&i&&e.DNE(0,ss,5,2,"ng-container",0)(1,rs,8,3,"ng-container",0),2&i&&(e.Y8G("ngIf",a.student&&a.studentHasExams),e.R7$(),e.Y8G("ngIf",!a.studentHasExams))},dependencies:[u.Sq,u.bT,Ho,m.D9,Fe.p],styles:[".evaluation-container[_ngcontent-%COMP%]{gap:var(--space-24px)}\n\n/*# sourceMappingURL=teacher-exam-student-evaluation.component.css.map*/"]}),o})();var Ke=f(19168);const cs=()=>["expandedDetail"],ms=t=>({collapsed:t}),At=t=>({evaluation:t}),ps=(t,o)=>[t,o],ds=(t,o,n)=>[t,o,n];function us(t,o){if(1&t){const n=e.RV6();e.j41(0,"button",12),e.bIt("click",function(){e.eBV(n);const a=e.XpG();return e.Njj(a.openTeacherExamManual())}),e.nrm(1,"i",13),e.j41(2,"h5",14),e.EFF(3),e.nI1(4,"translate"),e.nI1(5,"titlecase"),e.k0s()()}2&t&&(e.R7$(3),e.SpI(" ",e.bMT(5,3,e.bMT(4,1,"manual"))," "))}function _s(t,o){1&t&&e.nrm(0,"app-teacher-assignment-navigation")}function hs(t,o){1&t&&e.nrm(0,"app-inner-loader",15)}function fs(t,o){if(1&t&&(e.j41(0,"div",16)(1,"mat-form-field",17),e.nrm(2,"i",18),e.j41(3,"mat-label",19),e.EFF(4),e.nI1(5,"translate"),e.k0s(),e.nrm(6,"input",20),e.k0s()()),2&t){const n=e.XpG();e.R7$(4),e.JRh(e.bMT(5,3,n.hasType?"searchStudent":"searchStudentOrCourse")),e.R7$(2),e.Y8G("formControl",n.searchControl)("value",n.searchTerm)}}function gs(t,o){if(1&t&&(e.j41(0,"th",36),e.EFF(1),e.nI1(2,"translate"),e.nI1(3,"titleCaseFirstWord"),e.k0s()),2&t){const n=e.XpG().$implicit;e.HbH(n.headerClasses),e.R7$(),e.SpI(" ",e.bMT(3,6,e.bMT(2,4,n.label))," ")}}function vs(t,o){if(1&t&&(e.nrm(0,"img",43),e.nI1(1,"propSelector"),e.nI1(2,"generateFastImage")),2&t){const n=e.XpG().$implicit,i=e.XpG().$implicit;e.Y8G("src",e.bMT(2,4,e.i5U(1,1,n,i.property)),e.B4B)}}function bs(t,o){if(1&t){const n=e.RV6();e.j41(0,"button",44),e.bIt("click",function(){e.eBV(n);const a=e.XpG().$implicit,s=e.XpG(4);
3return e.Njj(s.expandedElement=s.expandedElement===a?null:a)}),e.nrm(1,"i",45),e.k0s()}if(2&t){const n=e.XpG().$implicit,i=e.XpG(4);e.Y8G("ngClass",e.eq3(1,ms,i.expandedElement===n))}}function Ts(t,o){}function Cs(t,o){1&t&&e.DNE(0,Ts,0,0,"ng-template")}function xs(t,o){if(1&t&&(e.qex(0),e.DNE(1,Cs,1,0,null,46),e.bVm()),2&t){const n=e.XpG().$implicit;e.XpG(4);const i=e.sdS(14);e.R7$(),e.Y8G("ngTemplateOutlet",i)("ngTemplateOutletContext",e.eq3(2,At,n))}}function Is(t,o){if(1&t&&(e.j41(0,"div")(1,"div",47),e.nrm(2,"b",48),e.k0s(),e.j41(3,"div"),e.EFF(4),e.nI1(5,"translate"),e.nI1(6,"translate"),e.k0s()()),2&t){const n=e.XpG().$implicit;e.R7$(2),e.Y8G("innerHTML",null==n||null==n.student?null:n.student.fullName,e.npT),e.R7$(2),e.E5c("",e.bMT(5,4,"id"),"",e.bMT(6,6,"typography.colon"),"",null==n||null==n.student?null:n.student.id,"")}}function Rs(t,o){if(1&t&&(e.qex(0),e.EFF(1),e.nI1(2,"propSelector"),e.bVm()),2&t){const n=e.XpG().$implicit,i=e.XpG().$implicit;e.R7$(),e.SpI(" ",e.i5U(2,1,n,i.property)," ")}}function Fs(t,o){if(1&t&&(e.j41(0,"td",37),e.qex(1,38),e.DNE(2,vs,3,6,"img",39)(3,bs,2,3,"button",40)(4,xs,2,4,"ng-container",41)(5,Is,7,8,"div",41)(6,Rs,3,4,"ng-container",42),e.bVm(),e.k0s()),2&t){const n=e.XpG().$implicit;e.HbH(n.columnClasses),e.R7$(),e.Y8G("ngSwitch",n.columnRef),e.R7$(),e.Y8G("ngSwitchCase","picture"),e.R7$(),e.Y8G("ngSwitchCase","expand"),e.R7$(),e.Y8G("ngSwitchCase","evaluate"),e.R7$(),e.Y8G("ngSwitchCase","student")}}function ks(t,o){1&t&&(e.qex(0,33),e.DNE(1,gs,4,8,"th",34)(2,Fs,7,8,"td",35),e.bVm()),2&t&&e.Y8G("matColumnDef",o.$implicit.columnRef)}function ys(t,o){}function Es(t,o){1&t&&e.DNE(0,ys,0,0,"ng-template")}function Ss(t,o){if(1&t&&(e.j41(0,"div")(1,"div",56),e.DNE(2,Es,1,0,null,46),e.k0s()()),2&t){const n=e.XpG(2).$implicit,i=e.XpG().$implicit;e.XpG(3);const a=e.sdS(14);e.ZvI("row ",n.foldClasses,""),e.R7$(2),e.Y8G("ngTemplateOutlet",a)("ngTemplateOutletContext",e.eq3(5,At,i))}}function $s(t,o){if(1&t&&(e.j41(0,"div")(1,"div",57)(2,"strong"),e.EFF(3),e.nI1(4,"translate"),e.k0s()(),e.j41(5,"div",57),e.EFF(6),e.nI1(7,"propSelector"),e.k0s()()),2&t){const n=e.XpG(2).$implicit,i=e.XpG().$implicit;e.ZvI("row ",n.foldClasses,""),e.R7$(3),e.JRh(e.bMT(4,5,n.label)),e.R7$(3),e.SpI(" ",e.i5U(7,7,i,n.property)," ")}}function Ms(t,o){if(1&t&&(e.qex(0,38),e.DNE(1,Ss,3,7,"div",54)(2,$s,8,10,"div",55),e.bVm()),2&t){const n=e.XpG().$implicit;e.Y8G("ngSwitch",n.columnRef),e.R7$(),e.Y8G("ngSwitchCase","evaluate")}}function ws(t,o){if(1&t&&(e.qex(0),e.DNE(1,Ms,3,2,"ng-container",53),e.bVm()),2&t){const n=o.$implicit;e.R7$(),e.Y8G("ngIf",n.shouldFold)}}function js(t,o){if(1&t&&(e.j41(0,"td",49)(1,"mat-accordion",50)(2,"mat-expansion-panel",51),e.DNE(3,ws,2,1,"ng-container",52),e.k0s()()()),2&t){const n=o.$implicit,i=e.XpG(3);e.R7$(2),e.Y8G("disabled",i.isDisabled)("expanded",n===i.expandedElement),e.R7$(),e.Y8G("ngForOf",null==i.tableStructure?null:i.tableStructure.table)}}function Gs(t,o){1&t&&e.nrm(0,"tr",58)}function Ds(t,o){1&t&&e.nrm(0,"tr",59)}function Os(t,o){if(1&t&&e.nrm(0,"tr",59),2&t){const n=e.XpG(3);e.HbH(n.tableStructure.overflowClasses)}}function As(t,o){if(1&t&&(e.j41(0,"table",26),e.DNE(1,ks,3,1,"ng-container",27),e.qex(2,28),e.DNE(3,js,4,3,"td",29),e.bVm(),e.DNE(4,Gs,1,0,"tr",30)(5,Ds,1,0,"tr",31)(6,Os,1,3,"tr",32),e.k0s()),2&t){const n=e.XpG(2);e.Y8G("hidden",!n.initialLoadCompleted||n.noStudents)("dataSource",n.evaluationOverview),e.R7$(),e.Y8G("ngForOf",null==n.tableStructure?null:n.tableStructure.table),e.R7$(3),e.Y8G("matHeaderRowDef",null==n.tableStructure?null:n.tableStructure.columns),e.R7$(),e.Y8G("matRowDefColumns",null==n.tableStructure?null:n.tableStructure.columns),e.R7$(),e.Y8G("matRowDefColumns",e.lJ4(6,cs))}}function Ns(t,o){if(1&t&&(e.j41(0,"div",60)(1,"div",61)(2,"p",62),e.nrm(3,"i",63),e.j41(4,"span",64),e.EFF(5),e.nI1(6,"translate"),e.k0s()()()()),2&t){const n=e.XpG(2);e.R7$(5),e.JRh(e.bMT(6,1,n.searching?"evaluation.noStudentsWhenFiltering":n.hasType?"evaluation.noStudents":"evaluation.noEvaluations"))}}function Ls(t,o){1&t&&e.nrm(0,"app-inner-loader",65)}function Ys(t,o){if(1&t){const n=e.RV6();e.j41(0,"div",21),e.DNE(1,As,7,7,"table",22),e.j41(2,"app-async-paginator",23),e.bIt("pageChange",function(a){e.eBV(n);const s=e.XpG();return e.Njj(s.navigate(a))}),e.k0s(),e.DNE(3,Ns,7,3,"div",24)(4,Ls,1,0,"app-inner-loader",25),e.k0s()}if(2&t){const n=e.XpG();e.R7$(),e.Y8G("ngIf",!n.evaluating),e.R7$(),e.Y8G("hidden",n.noStudents)("pagination",n.paginationLinks)("meta",n.paginationMeta),e.R7$(),e.Y8G("ngIf",n.noStudents),e.R7$(),e.Y8G("ngIf",n.isLoading&&n.initialLoadCompleted)}}function Vs(t,o){if(1&t&&e.nrm(0,"app-teacher-exam-student-evaluation",67),2&t){const n=e.XpG(2);e.Y8G("student",n.targetEvaluation)}}function Ps(t,o){if(1&t&&(e.qex(0),e.DNE(1,Vs,1,1,"app-teacher-exam-student-evaluation",66),e.bVm()),2&t){const n=e.XpG();e.R7$(),e.Y8G("ngIf",n.isExam)}}function Xs(t,o){if(1&t){const n=e.RV6();e.j41(0,"button",70),e.bIt("click",function(){e.eBV(n);const a=e.XpG().evaluation,s=e.XpG();return e.Njj(null!=a&&a.canEvaluate?s.evaluateSolving(a):null)}),e.EFF(1),e.nI1(2,"translate"),e.k0s()}if(2&t){const n=e.XpG().evaluation,i=e.XpG();e.Y8G("disabled",i.isLoading||!(null!=n&&n.canEvaluate)),e.R7$(),e.SpI(" ",e.bMT(2,2,null!=n&&n.canEvaluate&&null!=n&&n.evaluated?"evaluation.reevaluate":"evaluate")," ")}}function Bs(t,o){if(1&t&&(e.j41(0,"a",71),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t){const n=e.XpG().evaluation,i=e.XpG();e.Y8G("disabled",i.isLoading||!(null!=n&&n.assignmentId)||!(null!=n&&n.solvingId))("routerLink",i.hasType?e.l_i(5,ps,null==n?null:n.assignmentId,null==n?null:n.solvingId):e.sMw(8,ds,null==n?null:n.solvingType,null==n?null:n.assignmentId,null==n?null:n.solvingId)),e.R7$(),e.SpI(" ",e.bMT(2,3,"evaluate")," ")}}function qs(t,o){if(1&t&&e.DNE(0,Xs,3,4,"button",68)(1,Bs,3,12,"a",69),2&t){const n=e.XpG();e.Y8G("ngIf",n.isExam),e.R7$(),e.Y8G("ngIf",!n.isExam)}}let Ze=(()=>{var t;class o{constructor(){this.teacherEloService=(0,e.WQX)(W),this.teacherService=(0,e.WQX)(S.O),this.translateService=(0,e.WQX)(m.c$),this.teacherExamService=(0,e.WQX)(De.V),this.title="",this.courseId=null,this.type="",this.evaluationOverview=[],this.noStudents=!1,this.searchTerm=this.teacherEloService.getCurrentEvaluationSearchTerm(),this.searching=!1,this.isLoading=!1,this.initialLoadCompleted=!1,this.evaluating=!1,this.currentPageUrl=null,this.isExam=!1,this.hasType=!1,this.tableStructure=null,this.maxVisibleItems=10,this.initialPage=1,this.searchControl=new c.MJ(this.searchTerm),this.destroy$=new y.B}ngOnInit(){switch(this.type=this.teacherEloService.getType(),this.hasType=!!this.type,this.courseId=this.teacherService.getCurrentCourseId(),this.title=this.translateService.instant(this.hasType?"evaluation.".concat(this.t
3ype,"AndEvaluation"):"correctionJob"),this.type){case"exam":this.isExam=!0,this.tableStructure=io;break;case"exercise":this.tableStructure=no;break;case"task":this.tableStructure=ao;break;default:this.tableStructure=oo}this.teacherEloService.navigateToSamePage().pipe((0,I.Q)(this.destroy$)).subscribe(i=>{i&&!this.hasType&&this.setEvaluationList(i)}),this.currentPageUrl=this.teacherEloService.getCurrentEvaluationPageUrl(),this.initialLoadCompleted=!!this.currentPageUrl,this.currentPageUrl||this.setEvaluationList(null),this.teacherEloService.getEvaluationList().pipe((0,I.Q)(this.destroy$)).subscribe(i=>{this.processData(i)}),this.teacherService.getBackBtnClicked().pipe((0,I.Q)(this.destroy$)).subscribe(i=>{i&&(this.evaluating=!1)}),this.searchControl.valueChanges.pipe((0,eo.B)(500),(0,to.F)(),(0,le.M)(()=>this.isLoading=!0),(0,Z.n)(i=>(this.searching=!!i,this.searchTerm=i,this.teacherEloService.setCurrentEvaluationSearchTerm(i),this.teacherEloService.setEvaluations(null,this.type,this.initialPage,this.maxVisibleItems,this.courseId,this.searchTerm))),(0,I.Q)(this.destroy$)).subscribe(i=>{this.isLoading=!1})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}setEvaluationList(i){this.isLoading=!0,this.teacherEloService.setEvaluations(i,this.type,this.initialPage,this.maxVisibleItems,this.courseId,this.searchTerm).pipe((0,I.Q)(this.destroy$)).subscribe(a=>{this.initialLoadCompleted=!0,this.isLoading=!1})}processData(i){var a;if(!i)return void(this.noStudents=!0);const{evaluations:s,pagination:r,students:l}=i||{},{links:p,meta:d}=r||{};this.paginationLinks=p,this.paginationMeta=d,this.noStudents=!(null!==(a=s||l)&&void 0!==a&&a.length),this.evaluationOverview=this.noStudents?[]:this.isExam?this.processStudentsForExams(l):s}processStudentsForExams(i){return i.map(a=>{var s;if(a.examInfo&&null!==(s=a.examInfo)&&void 0!==s&&s.length){a.examInfo=a.examInfo.reduce((d,h)=>{var v,$,k;const M=ye.uU.includes(+h.examTypeId)&&!h.AtLeastOneBookingFlagSet&&h.isPointInsertPossibleCurrentCase&&(!h.events||!(null!==(v=h.events)&&void 0!==v&&v.length));if(M)return[...d,h];const J=!h.events||!(null!==($=h.events)&&void 0!==$&&$.length);if(ye.Y3.internOnline===+h.examTypeId)return d;if(J&&!M)return h.notEvaluatable=!0,[...d,h];const re=ye.UZ,Q=ye.mV.failed,K=ye.wO;let U=h.events.find(Ge=>!re.includes(+Ge.statusId)&&!K.includes(+Ge.statusId)||+Ge.statusId===Q);var ae,z,be;return U&&U.points&&!h.isPointInsertPossibleCurrentCase||U&&h.isPointInsertPossibleCurrentCase?(U=(0,g.A)((0,g.A)({},U),{},{canEvaluate:!0}),U=h.maxPoints&&(null!==(ae=U)&&void 0!==ae&&null!==(ae=ae.points)&&void 0!==ae&&ae.points||0===(null===(z=U)||void 0===z||null===(z=z.points)||void 0===z?void 0:z.points))&&null!==(be=U)&&void 0!==be&&null!==(be=be.points)&&void 0!==be&&be.feedback?(0,g.A)((0,g.A)({},U),{},{evaluated:!0}):(0,g.A)((0,g.A)({},U),{},{evaluated:!1}),h.currentEvent=U):!h.isPointInsertPossibleCurrentCase&&(null===(k=U)||void 0===k||!k.points)&&(h.notEvaluatable=!0),[...d,h]},[]),a.canEvaluate=a.examInfo.some(d=>{var h;return d.currentEvent||!d.AtLeastOneBookingFlagSet&&d.isPointInsertPossibleCurrentCase&&(!d.events||!(null!==(h=d.events)&&void 0!==h&&h.length))});const r=a.examInfo.filter(d=>d.currentEvent),p=!(null==r||!r.length)&&r.every(d=>d.currentEvent&&d.currentEvent.evaluated);a.evaluated=p}else a.canEvaluate=!1;return a})}openTeacherExamManual(){this.teacherExamService.openExamManual()}evaluateSolving(i,a,s){window.scrollTo(0,0),this.targetAssignmentId=a,this.targetSolvingId=s,this.targetEvaluation=i,this.targetType=(null==i?void 0:i.solvingType)||this.type,this.evaluating=!0}navigate(i){this.setEvaluationList(i)}}return(t=o).\u0275fac=function(i){return new(i||t)},t.\u0275cmp=e.VBU({type:t,selectors:[["app-teacher-assignment-evaluation-overview"]],decls:15,vars:8,consts:[["evaluateLink",""],[3,"hidden"],[1,"row","py-3","mb-3","background-color"],[1,"col-12","d-flex","justify-content-between","align-items-center"],[1,"mb-0","text-white"],["type","button","mat-button","","color","background",3,"click",4,"ngIf"],[4,"ngIf"],["class","loader p-3 mb-3 bg-light-grey position-relative",4,"ngIf"],[1,"position-relative"],[1,"row"],["class","col-12",4,"ngIf"],["class","table-container position-relative",4,"ngIf"],["type","button","mat-button","","color","background",3,"click"],[1,"fas","fa-question-circle"],[1,"m-0","d-inline"],[1,"loader","p-3","mb-3","bg-light-grey","position-relative"],[1,"col-12"],["appearance","fill",1,"m-0","mb-5"],["matPrefix","",1,"fa-search","mr-3","fas","text-color"],["for","studentSearchInput"],["matInput","","type","text","id","studentSearchInput",3,"formControl","value"],[1,"table-container","position-relative"],["mat-table","","multiTemplateDataRows","",3,"hidden","dataSource",4,"ngIf"],[3,"pageChange","hidden","pagination","meta"],["class","row pb-4",4,"ngIf"],["class","loader pagination-loader",4,"ngIf"],["mat-table","","multiTemplateDataRows","",3,"hidden","dataSource"],[3,"matColumnDef",4,"ngFor","ngForOf"],["matColumnDef","expandedDetail"],["mat-cell","","colspan","10","class","p-0","style","z-index: var(--z-index-layer-0)",4,"matCellDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mat-row","",3,"class",4,"matRowDef","matRowDefColumns"],[3,"matColumnDef"],["mat-header-cell","",3,"class",4,"matHeaderCellDef"],["mat-cell","",3,"class",4,"matCellDef"],["mat-header-cell",""],["mat-cell",""],[3,"ngSwitch"],["alt","","class","student-picture","appOnErrorImage","","imgType","user",3,"src",4,"ngSwitchCase"],["type","button","class","collapse-button",3,"ngClass","click",4,"ngSwitchCase"],[4,"ngSwitchCase"],[4,"ngSwitchDefault"],["alt","","appOnErrorImage","","imgType","user",1,"student-picture",3,"src"],["type","button",1,"collapse-button",3,"click","ngClass"],[1,"fas","fa-chevron-down"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"mb-1"],[3,"innerHTML"],["mat-cell","","colspan","10",1,"p-0",2,"z-index","var(--z-index-layer-0)"],[1,"container","d-block"],[1,"mat-elevation-z",3,"disabled","expanded"],[4,"ngFor","ngForOf"],[3,"ngSwitch",4,"ngIf"],[3,"class",4,"ngSwitchCase"],[3,"class",4,"ngSwitchDefault"],[1,"col-12","text-right"],[1,"col-6"],["mat-header-row",""],["mat-row",""],[1,"row","pb-4"],[1,"col-12","my-3"],[1,"text-center","m-0"],[1,"fas","fa-exclamation-circle","mr-2"],[1,"uppercase-first-letter"],[1,"loader","pagination-loader"],[3,"student",4,"ngIf"],[3,"student"],["type","button","mat-raised-button","","color","accent",3,"disabled","click",4,"ngIf"],["mat-raised-button","","color","accent",3,"disabled","routerLink",4,"ngIf"],["type","button","mat-raised-button","","color","accent",3,"click","disabled"],["mat-raised-button","","color","accent",3,"disabled","routerLink"]],template:function(i,a){1&i&&(e.j41(0,"div",1)(1,"div",2)(2,"div",3)(3,"h5",4),e.EFF(4),e.k0s(),e.DNE(5,us,6,5,"button",5),e.k0s()(),e.DNE(6,_s,1,0,"app-teacher-assignment-navigation",6)(7,hs,1,0,"app-inner-loader",7),e.j41(8,"div",8)(9,"div",9),e.DNE(10,fs,7,5,"div",10),e.k0s(),e.DNE(11,Ys,5,6,"div",11),e.k0s()(),e.DNE(12,Ps,2,1,"ng-container",6)(13,qs,2,2,"ng-template",null,0,e.C5r)),2&i&&(e.Y8G("hidden",a.evaluating),e.R7$(4),e.JRh(a.title),e.R7$(),e.Y8G("ngIf",a.isExam),e.R7$(),e.Y8G("ngIf",a.type),e.R7$(),e.Y8G("ngIf",a.isLoading&&!a.initialLoadCompleted),e.R7$(3),e.Y8G("ngIf",a.initialLoadCompleted&&!a.noStudents||a.searching),e.R7$(),e.Y8G("ngIf",a.initialLoadCompleted),e.R7$(),e.Y8G("ngIf",a.evaluating))},dependencies:[u.YU,u.Sq,u.bT,u.T3,u.ux,u.e1,u.fG,c.me,c.BC,c.l_,mo,b.Zl,b.tL,b.ji,b.cC,b.YV,b.iL,b.KS,b.$R,b.YZ,b.NB,H.BS,H.GK,E.It,E.$z,ne.fg,A.rl,A.nJ,A.JW,X.H,Ne.e,O.Wk,Gt,ls,u.PV,m.D9,rt.v,Ke.l,Fe.p],styles:[".print-to-pdf[_ngcontent-%COMP%], .fa-print[_ngcontent-%COMP%], table[_ngcontent-%COMP%] td[_ngcontent-%COMP%], .fa-chevron-down[_ngcontent-%COMP%]{color:var(--color-tint-11)}.expanding-row[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{border:var(--border-style-none)}.student-picture[_ngcontent-%COMP%]{height:var(--size-profile-circle-xs);width:var(--size-profile-circle-xs);border-radius:var(--border-radius-full);object-fit:cover}table[_ngcontent-%COMP%] td[_ngcontent-%COMP%], .fa-chevron-down[_ngcontent-%COMP%]{font-size:var(--font-size-100)}.cursor-pointer[_ngcontent-%COMP%]{cursor:pointer}.pagination-item[_ngcontent-%COMP%]{padding:var(--space-0_5rem) var(--space-0_75rem)}.pagination-item[disabled][_ngcontent-%COMP%]{cursor:default}.fa-chevron-down[_ngcontent-%COMP%]{pointer-events:none;transition:var(--transition-property-transform) var(--duration-300) var(--behavior-function-ease);transform:var(--transform-rotate-0)}.collapse-button[_ngcontent-%COMP%]{border:var(--border-style-none);background:none}.collapsed[_ngcontent-%COMP%] .fa-chevron-down[_ngcontent-%COMP%]{transform:var(--transform-rotate-180)}.collapsing-content[_ngcontent-%COMP%]{padding:var(--space-20px) var(--space-16px)}.responsive-table-item[_ngcontent-%COMP%]{display:none}.loader[_ngcontent-%COMP%]{z-index:var(--z-index-layer-0)}.pagination-loader[_ngcontent-%COMP%]{top:var(--space-0);left:var(--space-0);background-color:var(--color-light-transparency-3)!important}@media (max-width: 576px){table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:var(--space-0_5rem)}}@media (min-width: 992px){.responsive-table-item[_ngcontent-%COMP%]{display:table-cell}}\n\n/*# sourceMappingURL=teacher-assignment-evaluation-overview.component.css.map*/"]}),o})();var Us=f(10401);const Js=["uploader"],Qs=(t,o)=>({id:t,name:o}),Nt=(t,o)=>({left:t,right:o}),Lt=t=>({value:t}),zs=(t,o)=>({"mt-3":t,"mb-3":o}),Ws=t=>({left:" ",right:t}),Hs=()=>({value:0}),Ks=t=>({min:t});function Zs(t,o){if(1&t&&(e.j41(0,"div",5)(1,"h3"),e.nrm(2,"strong",6),e.nI1(3,"translate"),e.k0s()()),2&t){const n=e.XpG();e.R7$(2),e.Y8G("innerHTML",e.i5U(3,1,"evaluation.title",e.l_i(4,Qs,null==n.studentInfo?null:n.studentInfo.id,null==n.studentInfo?null:n.studentInfo.fullName)),e.npT)}}function er(t,o){1&t&&(e.j41(0,"div",1)(1,"div",7),e.nrm(2,"app-inner-loader",8),e.k0s()())}function tr(t,o){1&t&&(e.j41(0,"span"),e.EFF(1,"*"),e.k0s())}function nr(t,o){1&t&&(e.j41(0,"span"),e.EFF(1,"*"),e.k0s())}function ir(t,o){1&t&&(e.qex(0),e.EFF(1),e.nI1(2,"translate"),e.bVm()),2&t&&(e.R7$(),e.SpI(" ",e.i5U(2,1,"formValidation.numberToLow",e.lJ4(4,Hs))," "))}function ar(t,o){1&t&&(e.qex(0),e.EFF(1),e.nI1(2,"translate"),e.bVm()),2&t&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"formValidation.teacher.evaluation.requirePoints")," "))}function or(t,o){if(1&t&&(e.qex(0),e.EFF(1),e.nI1(2,"translate"),e.bVm()),2&t){const n=e.XpG(3).$implicit;e.R7$(),e.SpI(" ",e.i5U(2,1,"formValidation.numberToHigh",e.eq3(4,Lt,n.maxPoints))," ")}}function sr(t,o){1&t&&(e.qex(0),e.EFF(1),e.nI1(2,"translate"),e.bVm()),2&t&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"formValidation.roundedPoints")," "))}function rr(t,o){if(1&t&&(e.j41(0,"mat-error"),e.DNE(1,ir,3,5,"ng-container",4)(2,ar,3,3,"ng-container",4)(3,or,3,6,"ng-container",4)(4,sr,3,3,"ng-container",4),e.k0s()),2&t){let n,i,a,s;const r=e.XpG(2).$implicit,l=e.XpG(2);e.R7$(),e.Y8G("ngIf",null==(n=l.getControl(r.id))||null==n.errors?null:n.errors.min),e.R7$(),e.Y8G("ngIf",null==(i=l.getControl(r.id))||null==i.errors?null:i.errors.required),e.R7$(),e.Y8G("ngIf",null==(a=l.getControl(r.id))||null==a.errors?null:a.errors.max),e.R7$(),e.Y8G("ngIf",null==(s=l.getControl(r.id))||null==s.errors?null:s.errors.pattern)}}
3function lr(t,o){if(1&t&&(e.j41(0,"mat-form-field",38),e.nrm(1,"input",39),e.j41(2,"span",40),e.EFF(3),e.nI1(4,"translate"),e.k0s(),e.DNE(5,rr,5,4,"mat-error",4),e.k0s()),2&t){let n;const i=e.XpG().$implicit,a=e.XpG(2);e.R7$(),e.Y8G("max",i.maxPoints)("id",i.id),e.R7$(2),e.SpI(" ",e.i5U(4,4,"typography.slash",e.eq3(7,Ws,i.maxPoints))," "),e.R7$(2),e.Y8G("ngIf",null==(n=a.getControl(i.id))?null:n.errors)}}function cr(t,o){if(1&t&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t){const n=e.XpG().$implicit;e.R7$(),e.SpI(" ",e.i5U(2,1,"typography.slash",e.l_i(4,Nt,n.points,n.maxPoints))," ")}}function mr(t,o){1&t&&(e.j41(0,"div",18)(1,"mat-form-field")(2,"mat-label"),e.EFF(3),e.nI1(4,"translate"),e.k0s(),e.nrm(5,"textarea",41),e.k0s()()),2&t&&(e.R7$(3),e.JRh(e.bMT(4,1,"feedback")))}function pr(t,o){1&t&&(e.j41(0,"div",22),e.nrm(1,"hr"),e.k0s())}function dr(t,o){if(1&t&&(e.j41(0,"div",29)(1,"div",30),e.nrm(2,"app-assignment-evaluation",31),e.j41(3,"div",32)(4,"div",1)(5,"div",14)(6,"div",1)(7,"div",15)(8,"p",16)(9,"strong"),e.EFF(10),e.nI1(11,"translate"),e.DNE(12,tr,2,0,"span",4),e.k0s()()()(),e.nrm(13,"hr"),e.k0s(),e.j41(14,"div",33)(15,"p",16)(16,"strong"),e.EFF(17),e.nI1(18,"translate"),e.DNE(19,nr,2,0,"span",4),e.k0s()()(),e.j41(20,"div",34),e.DNE(21,lr,6,9,"mat-form-field",35)(22,cr,3,7,"span",4),e.k0s(),e.DNE(23,mr,6,3,"div",36),e.k0s()()(),e.DNE(24,pr,2,0,"div",37),e.k0s()),2&t){const n=o.$implicit,i=o.index,a=o.first,s=o.last,r=e.XpG(2);e.R7$(),e.Y8G("ngClass",e.l_i(18,zs,!a,!s)),e.R7$(),e.Y8G("type",r.type)("question",n)("questionIndex",i+1)("showResult",!1),e.R7$(),e.Y8G("formGroupName",n.id),e.R7$(7),e.SpI(" ",e.bMT(11,14,"points")," "),e.R7$(2),e.Y8G("ngIf",n.canEvaluate),e.R7$(5),e.SpI(" ",e.bMT(18,16,"points")," "),e.R7$(2),e.Y8G("ngIf",n.canEvaluate),e.R7$(2),e.Y8G("ngIf",n.canEvaluate),e.R7$(),e.Y8G("ngIf",!n.canEvaluate),e.R7$(),e.Y8G("ngIf","exercise"===r.type),e.R7$(),e.Y8G("ngIf",!s)}}function ur(t,o){1&t&&(e.qex(0),e.EFF(1),e.nI1(2,"translate"),e.bVm()),2&t&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"formValidation.noOnlyWhiteSpaces")," "))}function _r(t,o){if(1&t&&(e.qex(0),e.EFF(1),e.nI1(2,"translate"),e.bVm()),2&t){const n=e.XpG(3);e.R7$(),e.SpI(" ",e.i5U(2,1,"formValidation.tooShort",e.eq3(4,Ks,n.feedbackMinLength))," ")}}function hr(t,o){if(1&t&&(e.j41(0,"mat-error",42)(1,"p",43),e.DNE(2,ur,3,3,"ng-container",4)(3,_r,3,6,"ng-container",4),e.k0s()()),2&t){const n=e.XpG(2);e.R7$(2),e.Y8G("ngIf",null==n.feedback||null==n.feedback.errors?null:n.feedback.errors.emptyOrWhitespace),e.R7$(),e.Y8G("ngIf",null==n.feedback||null==n.feedback.errors?null:n.feedback.errors.minlength)}}function fr(t,o){1&t&&(e.j41(0,"div",7)(1,"mat-checkbox",44),e.EFF(2),e.nI1(3,"translate"),e.k0s()()),2&t&&(e.R7$(2),e.SpI(" ",e.bMT(3,1,"makeAgain.teacher")," "))}function gr(t,o){1&t&&(e.j41(0,"div",26)(1,"p"),e.EFF(2),e.nI1(3,"translate"),e.k0s()()),2&t&&(e.R7$(2),e.JRh(e.bMT(3,1,"formValidation.fieldsObligated")))}function vr(t,o){1&t&&e.nrm(0,"app-inner-loader",45),2&t&&e.Y8G("inline",!0)}function br(t,o){if(1&t){const n=e.RV6();e.qex(0),e.j41(1,"form",9),e.DNE(2,dr,25,21,"div",10),e.nrm(3,"hr"),e.j41(4,"div",1)(5,"div",11)(6,"div",12)(7,"div",13)(8,"div",14)(9,"div",1)(10,"div",15)(11,"p",16)(12,"strong"),e.EFF(13),e.nI1(14,"translate"),e.k0s()()(),e.j41(15,"div",15)(16,"p",16)(17,"strong"),e.EFF(18),e.nI1(19,"translate"),e.k0s()()()(),e.nrm(20,"hr"),e.k0s(),e.j41(21,"div",17)(22,"p",16)(23,"strong"),e.EFF(24),e.nI1(25,"translate"),e.k0s()()(),e.j41(26,"div",15),e.EFF(27),e.nI1(28,"translate"),e.k0s(),e.j41(29,"div",17)(30,"p",16)(31,"strong"),e.EFF(32),e.nI1(33,"translate"),e.k0s()()(),e.j41(34,"div",15)(35,"span"),e.EFF(36),e.nI1(37,"translate"),e.k0s()(),e.j41(38,"div",18)(39,"mat-form-field",19)(40,"mat-label"),e.EFF(41),e.nI1(42,"translate"),e.k0s(),e.nrm(43,"textarea",20),e.DNE(44,hr,4,2,"mat-error",21),e.k0s()(),e.j41(45,"div",22)(46,"app-file-upload",23,0),e.bIt("fileSelected",function(){e.eBV(n);const a=e.XpG();return e.Njj(a.attachments.markAsDirty())})("fileRemoved",function(){e.eBV(n);const a=e.XpG();return e.Njj(a.attachments.markAsDirty())}),e.k0s()(),e.nrm(48,"hr"),e.DNE(49,fr,4,3,"div",24)(50,gr,4,3,"div",25),e.j41(51,"div",26),e.DNE(52,vr,1,1,"app-inner-loader",27),e.j41(53,"button",28),e.bIt("click",function(){e.eBV(n);const a=e.XpG();return e.Njj(a.submit())}),e.EFF(54),e.nI1(55,"translate"),e.k0s()()()()()()(),e.bVm()}if(2&t){let n;const i=e.XpG();e.R7$(),e.Y8G("formGroup",i.evaluationForm),e.R7$(),e.Y8G("ngForOf",i.questions),e.R7$(11),e.JRh(e.bMT(14,20,"points")),e.R7$(5),e.JRh(e.bMT(19,22,"percentage")),e.R7$(6),e.JRh(e.bMT(25,24,"points")),e.R7$(3),e.SpI(" ",e.i5U(28,26,"typography.slash",e.l_i(38,Nt,null!==(n=i.allPoints)&&void 0!==n?n:0,null!==(n=i.totalPoints)&&void 0!==n?n:" "))," "),e.R7$(5),e.JRh(e.bMT(33,29,"percentage")),e.R7$(4),e.JRh(e.i5U(37,31,"typography.percent",e.eq3(41,Lt,
3i.evaluation))),e.R7$(5),e.JRh(e.bMT(42,34,"feedback")),e.R7$(3),e.Y8G("ngIf",!(null!=i.feedback&&i.feedback.pristine)&&(null==i.feedback?null:i.feedback.errors)),e.R7$(2),e.Y8G("multiple",!0)("uploadIcon",!0)("showAsLink",!0)("isSubmitting",i.submitting||i.filesLoading)("files",i.hasFiles&&i.files),e.R7$(3),e.Y8G("ngIf","task"===i.type),e.R7$(),e.Y8G("ngIf",i.hasRequiredControls),e.R7$(2),e.Y8G("ngIf",i.submitting),e.R7$(),e.Y8G("disabled",i.submitting||i.evaluationForm.invalid||i.evaluationForm.pristine),e.R7$(),e.SpI(" ",e.bMT(55,36,"save")," ")}}function Tr(t,o){1&t&&(e.qex(0),e.j41(1,"div",1)(2,"div",46)(3,"p",47),e.nrm(4,"i",48),e.j41(5,"span",49),e.EFF(6),e.nI1(7,"translate"),e.k0s()()()(),e.bVm()),2&t&&(e.R7$(6),e.JRh(e.bMT(7,1,"evaluation.noEvaluationForStudent")))}let mt=(()=>{var t;class o{constructor(){this.teacherEloService=(0,e.WQX)(W),this.translateService=(0,e.WQX)(m.c$),this.teacherService=(0,e.WQX)(S.O),this.formBuilder=(0,e.WQX)(c.ok),this.helperService=(0,e.WQX)(Ee.w),this.toastrService=(0,e.WQX)(w.tw),this.teacherQuestionsService=(0,e.WQX)(ee.d),this.route=(0,e.WQX)(O.nX),this.router=(0,e.WQX)(O.Ix),this.studentInfo=null,this.hasType=!1,this.routeBack=[],this.isLoading=!0,this.filesLoading=!1,this.submitting=!1,this.questions=[],this.solving={},this.feedbackMinLength=5,this.hasRequiredControls=!1,this.evaluationForm=this.formBuilder.group({feedback:[""],points:this.formBuilder.group({}),attachments:this.formBuilder.array([])}),this.hasFiles=!1,this.fileData=[],this.MAX_SINGLE_SIZE=Y.PI,this.MAX_COMBINED_SHORT=Y.eS,this.ALL_ALLOWED_FILE_TYPES=Y.yO.join(", "),this.fileSizes=[],this.destroy$=new y.B}get feedback(){return this.evaluationForm.get("feedback")}get attachments(){return this.evaluationForm.get("attachments")}ngOnInit(){if(this.courseId=this.teacherService.getCurrentCourseId(),this.type=this.teacherEloService.getType(),this.hasType=!!this.type,this.route.params.pipe((0,I.Q)(this.destroy$)).subscribe(({assignmentType:a,assignmentId:s,solvingId:r})=>
3{this.type||(this.type=a),this.assignmentId=s,this.solvingId=r}),!this.type||!this.assignmentId||!this.solvingId)return void this.notEvaluatableError();const i=this.translateService.instant(this.hasType?"evaluation.".concat(this.type,"AndEvaluation"):"correctionJob");this.routeBack=[this.hasType?"/teacher/ecampus/".concat(this.type,"/").concat(this.courseId,"/evaluation"):"/teacher/correction"],this.teacherService.setFullScreen(!0),this.teacherService.setBackBtnText(i),this.teacherService.setBackBtnRoute(this.routeBack),this.teacherEloService.getAssignment(this.type,this.assignmentId,this.solvingId).pipe((0,R.T)(a=>(null==a?void 0:a.data)||{}),(0,D.W)(a=>(0,x.of)({})),(0,I.Q)(this.destroy$)).subscribe(({solving:a,questions:s,student:r})=>{if(this.isLoading=!1,!a||null==s||!s.length)return void this.notEvaluatableError();this.studentInfo=(0,g.A)((0,g.A)({},r),{},{fullName:"".concat(r.firstName," ").concat(r.lastName)}),this.solving=a;const{exerciseType:l}=a,p="auto"===l;this.questions=s.map(h=>(h.canEvaluate=!p&&Y.TC.includes(h.type),h));const d=this.questions.filter(h=>!h.canEvaluate);this.basePoints=d.reduce((h,v)=>h+v.points,0),this.evaluationForm=this.initForm()})}ngOnDestroy(){this.teacherService.setFullScreen(!1),this.teacherService.setBackBtnText(null),this.teacherService.setBackBtnRoute(null),this.destroy$.next(),this.destroy$.complete()}notEvaluatableError(){this.toastrService.error(this.translateService.instant("evaluation.studentEvaluationNotFound")),this.router.navigate(this.routeBack)}initForm(){const{allPoints:i,totalPoints:a,evaluation:s,comment:r,attachments:l,again:p}=this.solving||{};this.allPoints=+i,this.totalPoints=+a,this.evaluation=+s;const d=this.formBuilder.group({feedback:[null!=r?r:"",[(0,ct.FV)(this.feedbackMinLength)]],points:this.formBuilder.group({}),attachments:this.formBuilder.array(l&&l.length?l:[])});return this.setFiles(l),this.questions&&this.questions.length&&this.questions.forEach(h=>{const{maxPoints:v,points:$,answerComment:k,id:M}=h,J=this.formBuilder.group({});
3if(h.canEvaluate){const se=new c.MJ(+$,[c.k0.required,c.k0.min(0),c.k0.max(v),c.k0.pattern(/^\d+$/)]);this.hasRequiredControls=!0,J.addControl("point",se)}if("exercise"===this.type){const se=new c.MJ(k||"");J.addControl("comment",se)}d.controls.points.addControl(M,J)}),"task"===this.type&&d.addControl("again",new c.MJ(!!+p)),d.get("points").valueChanges.pipe((0,I.Q)(this.destroy$)).subscribe(h=>{const v=Object.values(h).map(({point:$})=>$);this.updateTotalValues(v)}),d}getControl(i){var a;return null===(a=this.evaluationForm.get("points"))||void 0===a||null===(a=a.controls[i])||void 0===a?void 0:a.get("point")}setFiles(i){if(this.attachments.clear(),this.fileData=[],this.fileSizes=[],null!=i&&i.length){this.hasFiles=!0,this.files=i;const a=i.map(s=>{this.attachments.push(this.formBuilder.control(s)),this.fileData=[...this.fileData,s];const r=(0,N.I1)().unix(),l=r+Math.floor(Math.random()*r);return this.teacherQuestionsService.getImage("".concat(s.path,"?fileSize=").concat(l))});this.filesLoading=!0,(0,j.p)([...a]).pipe((0,I.Q)(this.destroy$)).subscribe(s=>{this.filesLoading=!1,s.forEach(r=>{const l=r.headers.get("Content-Length");this.fileSizes=[...this.fileSizes,+l]})})}}resetForm(i,a,s,r,l){this.feedback.patchValue("string"==typeof i?i:"",{emitEvent:!1}),this.evaluation=+a||0,this.allPoints=+s||0,this.setFiles(r),"task"===this.type&&this.evaluationForm.get("again").patchValue(!!l),this.evaluationForm.reset(this.evaluationForm.value),this.fileError=""}updateTotalValues(i){const a=i.filter(Boolean).reduce((r,l)=>r+l,0);this.allPoints=this.basePoints+ +a,this.evaluation=this.roundNumber(this.allPoints/this.totalPoints*100,2)}roundNumber(i,a){const r=Math.pow(10,a);return Math.round(i*r)/r}onSelectFile(i){const{files:a}=i.target,s=[a[0]],r=this.checkFile(s);r&&r.length&&s.forEach(l=>{this.addFile(l),this.fileError=""})}checkFile(i){const a=i.reduce((d,h)=>{const v=this.helperService.isFileAllowed(h,Y.yO);return v.status?d:d=[...d,v]},[]);if(a.length)this.fileError=a[0].error.type;else if(i.reduce((d,h)=>d+ +h.size,0)+this.fileSizes.reduce((d,h)=>d+h,0)>Y.Nd)this.fileError=this.translateService.instant("errorTotalFileSize",{size:5,sizeType:"Mb"});else{if(!i.reduce((d,h)=>[...d,...this.fileData.filter(({name:$})=>$===h.name)],[]).length)return i;this.fileError="errorFileName"}}addFile(i){this.fileSizes=[...this.fileSizes,+i.size];const a=new FileReader;a.readAsDataURL(i),a.onload=s=>{this.fileData=[...this.fileData,{name:i.name,path:s.target.result}],this.attachments.push(new c.hs(i)),this.attachments.markAsDirty()}}removeFile(i){this.fileData=this.fileData.filter(s=>s.name!==i.name);const a=this.attachments.controls.findIndex(s=>{var r;return(null==s||null===(r=s.value)||void 0===r?void 0:r.name)===i.name});this.attachments.removeAt(a),this.fileSizes=this.fileSizes.filter((s,r)=>r!==a),this.fileError="",this.attachments.markAsDirty()}submit(){if(this.evaluationForm.invalid||this.evaluationForm.pristine)return;this.submitting=!0;const{feedback:i,points:a,again:s}=this.evaluationForm.getRawValue(),r=new FormData,l=this.uploader.filesToUpload.getValue();null!=l&&l.length&&l.forEach(p=>{let d=null!=p&&p.file?p.file:p;d instanceof File||(d=JSON.stringify(d)),r.append("attachments[]",d)}),"task"===this.type&&r.append("again",s?"1":"0"),i.trim()&&r.append("feedback",i.trim()),Object.entries(a).forEach(([p,d])=>{const{point:h,comment:v}=d||{};"number"==typeof h&&r.append("points[".concat(p,"][point]"),h.toFixed(0)),"exercise"===this.type&&r.append("points[".concat(p,"][comment]"),(null==v?void 0:v.trim())||"")}),this.evaluationForm.disable(),this.teacherEloService.patchAssignmentEvaluation(this.type,r,this.assignmentId,this.solvingId).pipe((0,I.Q)(this.destroy$)).subscribe(p=>{this.submitting=!1,this.evaluationForm.enable(),this.handleResponse(p)})}handleResponse(i){if(!i)return void this.toastrService.error(this.translateService.instant("evaluation.assignmentUpdated.error"));const{comment:a,evaluation:s,points:r,attachments:l,again:p}=i||{};this.resetForm(a,s,r,l,p),this.toastrService.success(this.translateService.instant("evaluation.assignmentUpdated.success"))}}return(t=o).\u0275fac=function(i){return new(i||t)},t.\u0275cmp=e.VBU({type:t,selectors:[["app-teacher-solving-evaluation"]],viewQuery:function(i,a){if(1&i&&e.GBs(Js,5),2&i){let s;e.mGM(s=e.lsd())&&(a.uploader=s.first)}},decls:5,vars:4,consts:[["uploader",""],[1,"row"],["class","col-12 py-4",4,"ngIf"],["class","row",4,"ngIf"],[4,"ngIf"],[1,"col-12","py-4"],[3,"innerHTML"],[1,"col-12","my-3"],[1,"p-3","bg-light-grey","position-relative"],["id","evaluation-form",3,"formGroup"],["class","row question-row",4,"ngFor","ngForOf"],[1,"col-12","pb-3"],[1,"container","bg-light-grey"],[1,"row","py-3"],[1,"col-12","d-none","d-md-block"],[1,"col-6","col-md-4"],[1,"m-0","text-dark"],[1,"col-6","pb-3","d-block","d-md-none"],[1,"col-12","mt-4","evaluation-input"],["appearance","fill"],["matInput","","cdkTextareaAutosize","","cdkAutosizeMinRows","5","name","comment","id","comment","type","text","formControlName","feedback"],["class","feedback-error w-100",4,"ngIf"],[1,"col-12"],["placeholder","examFileUploadPlaceholder","buttonText","uploadFile",3,"fileSelected","fileRemoved","multiple","uploadIcon","showAsLink","isSubmitting","files"],["class","col-12 my-3",4,"ngIf"],["class","col-12 text-right",4,"ngIf"],[1,"col-12","text-right"],["class","mr-3",3,"inline",4,"ngIf"],["mat-raised-button","","color","accent","type","button","role","button",1,"text-uppercase",3,"click","disabled"],[1,"row","question-row"],["formArrayName","points",1,"col-12",3,"ngClass"],[3,"type","question","questionIndex","showResult"],[1,"container","mt-3","py-3","bg-light-grey",3,"formGroupName"],[1,"col-6","d-block","d-md-none"],[1,"col-6","col-md-2","evaluation-input"],["class","number-width",4,"ngIf"],["class","col-12 mt-4 evaluation-input",4,"ngIf"],["class","col-12",4,"ngIf"],[1,"number-width"],["matInput","","type","number","min","0","size","4","step","1","formControlName","point",3,"max","id"],["matTextSuffix",""],["matInput","","cdkTextareaAutosize","","cdkAutosizeMinRows","5","name","comment","id","comment","type","text","formControlName","comment"],[1,"feedback-error","w-100"],[1,"m-0","text-danger"],["formControlName","again","id","again"],[1,"mr-3",3,"inline"],[1,"col-12","my-5"],[1,"text-center","m-0"],[1,"fas","fa-exclamation-circle","mr-2"],[1,"uppercase-first-letter"]],template:function(i,a){1&i&&(e.j41(0,"div",1),e.DNE(1,Zs,4,7,"div",2),e.k0s(),e.DNE(2,er,3,0,"div",3)(3,br,56,43,"ng-container",4)(4,Tr,8,3,"ng-container",4)),2&i&&(e.R7$(),e.Y8G("ngIf",a.studentInfo&&a.questions&&a.questions.length),e.R7$(),e.Y8G("ngIf",a.isLoading),e.R7$(),e.Y8G("ngIf",a.questions&&a.questions.length),e.R7$(),e.Y8G("ngIf",!(a.isLoading||a.questions&&a.questions.length)))}
3,dependencies:[u.YU,u.Sq,u.bT,c.qT,c.me,c.Q0,c.BC,c.cb,c.VZ,c.zX,c.j4,c.JD,c.$R,c.v8,Us.T,E.$z,ne.fg,A.rl,A.nJ,A.TL,A.yw,Me.xb,Xe.So,X.H,ze.P,m.D9],styles:["#evaluation-form[_ngcontent-%COMP%] .feedback-error[_ngcontent-%COMP%]{bottom:var(--space-negative-25px)}#evaluation-form[_ngcontent-%COMP%] .input-field[_ngcontent-%COMP%]{position:relative}#evaluation-form[_ngcontent-%COMP%] .evaluation-error[_ngcontent-%COMP%]{top:var(--space-100-percent)!important}.point-input[_ngcontent-%COMP%]{width:var(--size-48px);padding:var(--space-0)!important;display:inline}.file-error[_ngcontent-%COMP%]{top:var(--space-50px)!important}.file-list[_ngcontent-%COMP%]{pointer-events:none;cursor:initial;display:flex;align-items:center;justify-content:flex-start}.delete_file[_ngcontent-%COMP%]{color:var(--color-tint-1);border:var(--border-style-none);border-radius:var(--border-radius-full);padding:var(--space-5px) var(--space-10px);font-size:var(--font-size-inherit)!important}.file-button[_ngcontent-%COMP%]{background-color:var(--color-button-secondary);color:var(--color-tint-1);font-size:var(--font-size-100);padding:var(--space-5px) var(--space-10px)}.fa-cloud-arrow-up[_ngcontent-%COMP%]{font-size:var(--font-size-125)}.number-width[_ngcontent-%COMP%]{max-width:var(--size-110px)} .evaluation-input .mat-mdc-text-field-wrapper{padding:var(--space-0)} .evaluation-input .mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:var(--color-tint-3)!important}\n\n/*# sourceMappingURL=teacher-solving-evaluation.component.css.map*/"]}),o})(),et=(()=>{var t;class o{constructor(){this.teacherEloService=(0,e.WQX)(W)}ngOnDestroy(){this.teacherEloService.clearEvaluations()}}return(t=o).\u0275fac=function(i){return new(i||t)},t.\u0275cmp=e.VBU({type:t,selectors:[["app-teacher-assignment-evaluation"]],decls:1,vars:0,template:function(i,a){1&i&&e.nrm(0,"router-outlet")},dependencies:[O.n3],encapsulation:2}),o})(),Cr=(()=>{var t;class o{constructor(){this.dialogData=(0,e.WQX)(me.y2)}closeModal(){this.dialogData.dialogRef.close()}}return(t=o).\u0275fac=function(i){return new(i||t)},t.\u0275cmp=e.VBU({type:t,selectors:[["app-teacher-assignment-create-dialog"]],decls:1,vars:2,consts:[[3,"closeModal","isModal","courseId"]],template:function(i,a){1&i&&(e.j41(0,"app-teacher-assignment-create",0),e.bIt("closeModal",function(){return a.closeModal()}),e.k0s()),2&i&&e.Y8G("isModal",!0)("courseId",null==a.dialogData?null:a.dialogData.courseId)},dependencies:[$t],encapsulation:2}),o})();var we=f(44231),qe=f(22047),Yt=f(97978),Ir=f(24248);const Rr=t=>["results",t],Fr=t=>["edit",t],kr=t=>["preview/",t];function yr(t,o){if(1&t&&(e.j41(0,"th",18),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t){const n=e.XpG(2).$implicit;e.R7$(),e.JRh(e.bMT(2,1,n.label))}}function Er(t,o){1&t&&(e.qex(0),e.DNE(1,yr,3,3,"th",17),e.bVm())}function Sr(t,o){if(1&t&&(e.j41(0,"th",20),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t){const n=e.XpG(2).$implicit;e.R7$(),e.JRh(e.bMT(2,1,n.label))}}function $r(t,o){1&t&&e.DNE(0,Sr,3,3,"th",19)}function Mr(t,o){if(1&t&&(e.qex(0),e.j41(1,"span"),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.bVm()),2&t){const n=e.XpG(2).$implicit;e.R7$(2),e.JRh(e.bMT(3,1,n.variant))}}function wr(t,o){if(1&t&&(e.qex(0),e.j41(1,"span"),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.bVm()),2&t){const n=e.XpG(2).$implicit;e.R7$(2),e.JRh(e.bMT(3,1,n.obligedForExam?"yes":"no"))}}function jr(t,o){if(1&t&&(e.qex(0),e.j41(1,"span"),e.EFF(2),e.k0s(),e.bVm()),2&t){const n=e.XpG(2).$implicit;e.R7$(2),e.JRh(n.chapterName)}}function Gr(t,o){if(1&t&&(e.qex(0),e.DNE(1,Mr,4,3,"ng-container",25)(2,wr,4,3,"ng-container",25)(3,jr,3,1,"ng-container",25),e.bVm()),2&t){const n=e.XpG(3);e.R7$(),e.Y8G("ngIf",n.isExam),e.R7$(),e.Y8G("ngIf",n.isTask),e.R7$(),e.Y8G("ngIf",n.isExercise)}}function Dr(t,o){if(1&t){const n=e.RV6();e.j41(0,"span",28),e.nI1(1,"translate"),e.bIt("click",function(){e.eBV(n);const a=e.XpG(2).$implicit,s=e.XpG(2);return e.Njj(s.onStatusChange(a))}),e.EFF(2),e.nI1(3,"translate"),e.nI1(4,"titlecase"),e.k0s()}if(2&t){const n=e.XpG(4);e.FS9("matTooltip",e.bMT(1,2,n.module+"ActiveTooltip")),e.R7$(2),e.JRh(e.bMT(4,6,e.bMT(3,4,"active")))}}function Or(t,o){if(1&t){const n=e.RV6();e.j41(0,"span",29),e.nI1(1,"translate"),e.bIt("click",function(){e.eBV(n);const a=e.XpG(2).$implicit,s=e.XpG(2);return e.Njj(s.onStatusChange(a))}),e.EFF(2),e.nI1(3,"translate"),e.nI1(4,"titlecase"),e.k0s()}if(2&t){const n=e.XpG(4);e.FS9("matTooltip",e.bMT(1,2,n.module+"InactiveTooltip")),e.R7$(2),e.JRh(e.bMT(4,6,e.bMT(3,4,"examDeactivate")))}}
3function Ar(t,o){if(1&t&&(e.qex(0),e.DNE(1,Dr,5,8,"span",26)(2,Or,5,8,"span",27),e.bVm()),2&t){const n=e.XpG().$implicit;e.R7$(),e.Y8G("ngIf",1===n.active),e.R7$(),e.Y8G("ngIf",0===n.active)}}function Nr(t,o){if(1&t&&(e.qex(0),e.j41(1,"button",30),e.nrm(2,"i",31),e.k0s(),e.bVm()),2&t){const n=e.XpG().$implicit;e.R7$(),e.Y8G("routerLink",e.eq3(1,Rr,n.id))}}function Lr(t,o){if(1&t&&(e.qex(0),e.j41(1,"button",30),e.nrm(2,"i",32),e.k0s(),e.bVm()),2&t){const n=e.XpG().$implicit;e.R7$(),e.Y8G("routerLink",e.eq3(1,Fr,n.id))}}function Yr(t,o){if(1&t&&(e.j41(0,"a",34),e.nrm(1,"i",35),e.k0s()),2&t){const n=e.XpG(2).$implicit;e.Y8G("routerLink",e.eq3(1,kr,n.id))}}function Vr(t,o){if(1&t){const n=e.RV6();e.j41(0,"button",36),e.bIt("click",function(){e.eBV(n);const a=e.XpG(2).$implicit,s=e.XpG(2);return e.Njj(s.initPreview(a.id))}),e.nrm(1,"i",35),e.k0s()}}function Pr(t,o){if(1&t&&(e.qex(0),e.DNE(1,Yr,2,3,"a",33)(2,Vr,2,0,"ng-template",null,2,e.C5r),e.bVm()),2&t){const n=e.sdS(3),i=e.XpG(3);e.R7$(),e.Y8G("ngIf",i.isExam)("ngIfElse",n)}}function Xr(t,o){if(1&t){const n=e.RV6();e.qex(0),e.j41(1,"button",36),e.bIt("click",function(){e.eBV(n);const a=e.XpG().$implicit,s=e.XpG(2);return e.Njj(s.onDelete(a))}),e.nrm(2,"i",37),e.k0s(),e.bVm()}}function Br(t,o){if(1&t&&(e.qex(0),e.EFF(1),e.nI1(2,"propSelector"),e.bVm()),2&t){const n=e.XpG().$implicit,i=e.XpG().$implicit;e.R7$(),e.SpI(" ",e.i5U(2,1,n,i.property)," ")}}function qr(t,o){if(1&t&&(e.j41(0,"td",21),e.qex(1,22),e.DNE(2,Gr,4,3,"ng-container",23)(3,Ar,3,2,"ng-container",23)(4,Nr,3,3,"ng-container",23)(5,Lr,3,3,"ng-container",23)(6,Pr,4,2,"ng-container",23)(7,Xr,3,0,"ng-container",23)(8,Br,3,4,"ng-container",24),e.bVm(),e.k0s()),2&t){const n=e.XpG().$implicit;e.R7$(),e.Y8G("ngSwitch",n.columnRef),e.R7$(),e.Y8G("ngSwitchCase","module"),e.R7$(),e.Y8G("ngSwitchCase","status"),e.R7$(),e.Y8G("ngSwitchCase","result"),e.R7$(),e.Y8G("ngSwitchCase","edit"),e.R7$(),e.Y8G("ngSwitchCase","preview"),e.R7$(),e.Y8G("ngSwitchCase","delete")}}function Ur(t,o){if(1&t&&(e.qex(0,14),e.DNE(1,Er,2,0,"ng-container",15)(2,$r,1,0,"ng-template",null,1,e.C5r)(4,qr,9,7,"td",16),e.bVm()),2&t){const n=o.$implicit,i=e.sdS(3);e.Y8G("matColumnDef",n.columnRef),e.R7$(),e.Y8G("ngIf",n.hasSort)("ngIfElse",i)}}function Jr(t,o){1&t&&e.nrm(0,"tr",38)}function Qr(t,o){1&t&&e.nrm(0,"tr",39)}function zr(t,o){if(1&t){const n=e.RV6();e.j41(0,"app-ecampus-assignment",40),e.bIt("goToAllEx",function(){e.eBV(n);const a=e.XpG();return e.Njj(a.initPreview())}),e.k0s()}if(2&t){const n=e.XpG();e.Y8G("preview",n.previewData)}}function Wr(t,o){if(1&t){const n=e.RV6();e.j41(0,"button",41),e.bIt("click",function(){e.eBV(n);const a=e.XpG();return e.Njj(a.initPreview())}),e.EFF(1),e.nI1(2,"translate"),e.k0s()}2&t&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"closePreview")," "))}let Hr=(()=>{var t;class o{constructor(i,a,s,r,l){this.teacherEloService=i,this.teacherService=a,this.teacherQuestionService=s,this.toastrService=r,this.translateService=l,this.data=[],this.deleteAssignment=new e.bkB,this.editStatus=new e.bkB,this.isExam=!1,this.isTask=!1,this.isExercise=!1,this.maxVisibleItems=8}ngOnInit(){this.doingAssignment=!1,this.setTypeHeading(),this.createTableData(this.data),this.isIsolated=this.teacherService.getAssignmentPreviewIsolation()}ngOnChanges(i){let a=i.data;const{currentValue:s}=a;this.createTableData(s)}onDelete(i){this.deleteAssignment.emit(i)}onStatusChange(i){this.editStatus.emit(i)}initPreview(i=null){if(i){const a=this.teacherEloService.getType();this.teacherCourse$=this.teacherService.getCurrentCourse().pipe((0,ke.Z)(s=>{const r=this.teacherQuestionService.getModuleQuestions(a,i,s.id).pipe((0,R.T)(l=>{var p;return(null==l||null===(p=l.body)||void 0===p?void 0:p.data)||{questions:[]}}));return(0,j.p)([(0,x.of)(s),r])})).subscribe(([s,{questions:r}])=>{if(r.length)this.previewData={course:s,moduleId:i,moduleType:a,questions:r},this.teacherService.setAssignmentPreviewIsolation(!0),this.doingAssignment=!0;else{const l=this.translateService.instant("teacherExamNoQuestionsFound"),p=this.translateService.instant("teacherAddQuestions"),d="".concat(l,". ").concat(p);this.toastrService.error(d),this.teacherService.setAssignmentPreviewIsolation(!1),this.doingAssignment=!1}})}else this.teacherService.setAssignmentPreviewIsolation(!1),this.doingAssignment=!1}setTypeHeading(){const{module:i}=this;return i===T.Eq.exam?(this.moduleHeading="type",void(this.isExam=!0)):i===T.Eq.task?(this.moduleHeading="taskObliged",void(this.isTask=!0)):i===T.Eq.exercise?(this.moduleHeading="chapter",void(this.isExercise=!0)):void 0}createTableData(i){this.tableConfig=(()=>{let n={columns:["name","module","status","result","edit","preview","delete"],table:[{label:"title",columnRef:"name",property:"name",hasSort:!0},{label:this.moduleHeading,columnRef:"module",property:"",hasSort:!1},{label:"status",columnRef:"status",property:"active",hasSort:!1},{label:"examResultT",columnRef:"result",property:"",hasSort:!1},{label:"edit",columnRef:"edit",property:"",hasSort:!1},{label:"preview",columnRef:"preview",property:"",hasSort:!1},{label:"delete",columnRef:"delete",property:"",hasSort:!1}]};return this.isExam||(n=(0,g.A)((0,g.A)({},n),{},{columns:n.columns.filter(i=>"result"!==i)})),n})(),this.tableData=new Yt.p(i),this.tableData.paginator=this.paginator,this.tableData.sort=this.sort}ngOnDestroy(){this.teacherService.setAssignmentPreviewIsolation(!1),this.teacherCourse$&&this.teacherCourse$.unsubscribe()}}return(t=o).\u0275fac=function(i){return new(i||t)(e.rXU(W),e.rXU(S.O),e.rXU(ee.d),e.rXU(w.tw),e.rXU(m.c$))},t.\u0275cmp=e.VBU({type:t,selectors:[["app-teacher-assignment-list-table"]],viewQuery:function(i,a){if(1&i&&(e.GBs(ve.iy,7),e.GBs(qe.B4,7)),2&i){let s;e.mGM(s=e.lsd())&&(a.paginator=s.first),e.mGM(s=e.lsd())&&(a.sort=s.first)}},inputs:{data:"data",module:"module"},outputs:{deleteAssignment:"deleteAssignment",editStatus:"editStatus"},features:[e.OA$],decls:13,vars:10,consts:[["paginator",""],["noSort",""],["preview",""],[1,"table-container","mat-elevation-z3",3,"hidden"],["mat-table","","matSort","","matSortActive","name","matSortDirection","asc",1,"mat-table-hover",3,"dataSource"],[3,"matColumnDef",4,"ngFor","ngForOf"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["hidePageSize","","showFirstLastButtons","",3,"pageSize"],[3,"preview","goToAllEx",4,"ngIf"],[1,"container"],[1,"row"],[1,"col-12","text-right"],["mat-raised-button","","color","accent","role","button","type","button","class","text-uppercase",3,"click",4,"ngIf"],[3,"matColumnDef"],[4,"ngIf","ngIfElse"],["mat-cell","",4,"matCellDef"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-header-cell","","mat-sort-header",""],["mat-header-cell","",4,"matHeaderCellDef"],["mat-header-cell",""],["mat-cell",""],[3,"ngSwitch"],[4,"ngSwitchCase"],[4,"ngSwitchDefault"],[4,"ngIf"],["class","c-p text-success font-weight-bold",3,"matTooltip","click",4,"ngIf"],["class","c-p text-danger font-weight-bold",3,"matTooltip","click",4,"ngIf"],[1,"c-p","text-success","font-weight-bold",3,"click","matTooltip"],[1,"c-p","text-danger","font-weight-bold",3,"click","matTooltip"],["mat-icon-button","","role","button","type","button",3,"routerLink"],[1,"fa-solid","fa-list"],[1,"fa-solid","fa-square-pen"],["mat-icon-button","",3,"routerLink",4,"ngIf","ngIfElse"],["mat-icon-button","",3,"routerLink"],[1,"fa-solid","fa-eye"],["mat-icon-button","","role","button","type","button",3,"click"],[1,"fa-solid","fa-tras
3h-can"],["mat-header-row",""],["mat-row",""],[3,"goToAllEx","preview"],["mat-raised-button","","color","accent","role","button","type","button",1,"text-uppercase",3,"click"]],template:function(i,a){1&i&&(e.j41(0,"div",3),e.nI1(1,"async"),e.j41(2,"table",4),e.DNE(3,Ur,5,3,"ng-container",5)(4,Jr,1,0,"tr",6)(5,Qr,1,0,"tr",7),e.k0s(),e.nrm(6,"mat-paginator",8,0),e.k0s(),e.DNE(8,zr,1,1,"app-ecampus-assignment",9),e.j41(9,"div",10)(10,"div",11)(11,"div",12),e.DNE(12,Wr,3,3,"button",13),e.k0s()()()),2&i&&(e.Y8G("hidden",!0===e.bMT(1,8,a.isIsolated)),e.R7$(2),e.Y8G("dataSource",a.tableData),e.R7$(),e.Y8G("ngForOf",null==a.tableConfig?null:a.tableConfig.table),e.R7$(),e.Y8G("matHeaderRowDef",null==a.tableConfig?null:a.tableConfig.columns),e.R7$(),e.Y8G("matRowDefColumns",null==a.tableConfig?null:a.tableConfig.columns),e.R7$(),e.Y8G("pageSize",a.maxVisibleItems),e.R7$(2),e.Y8G("ngIf",a.doingAssignment),e.R7$(4),e.Y8G("ngIf",a.doingAssignment))},dependencies:[u.Sq,u.bT,u.ux,u.e1,u.fG,Ir.B,b.Zl,b.tL,b.ji,b.cC,b.YV,b.iL,b.KS,b.$R,b.YZ,b.NB,ve.iy,E.$z,E.pQ,E.iY,qe.B4,qe.aE,Re.oV,O.Wk,u.Jj,u.PV,m.D9,rt.v],styles:[".table-container[_ngcontent-%COMP%]{max-width:var(--size-100-percent);overflow-x:auto}.mat-column-status[_ngcontent-%COMP%], .mat-column-result[_ngcontent-%COMP%], .mat-column-edit[_ngcontent-%COMP%], .mat-column-preview[_ngcontent-%COMP%], .mat-column-delete[_ngcontent-%COMP%]{text-align:center}.mat-column-result[_ngcontent-%COMP%], .mat-column-edit[_ngcontent-%COMP%], .mat-column-preview[_ngcontent-%COMP%], .mat-column-delete[_ngcontent-%COMP%]{min-width:var(--size-64px);width:var(--size-10-percent)}a[mat-icon-button][_ngcontent-%COMP%] i[_ngcontent-%COMP%], button[mat-icon-button][_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:var(--color-icons)!important;font-size:var(--font-size-112)}\n\n/*# sourceMappingURL=teacher-assignment-list-table.component.css.map*/"]}),o})();const Kr=()=>({title:"autoCorrectExercise",helperText:"teacherAutoCorrectText"}),Zr=()=>({title:"openExercise",helperText:"openExerciseTeacherText"}),el=t=>({type:t});function tl(t,o){1&t&&e.nrm(0,"app-spinner")}function nl(t,o){if(1&t){const n=e.RV6();e.j41(0,"button",14),e.bIt("click",function(){e.eBV(n);const a=e.XpG(2);return e.Njj(a.openTeacherExamManual())}),e.nrm(1,"i",15),e.j41(2,"h5",16),e.EFF(3),e.nI1(4,"translate"),e.nI1(5,"titlecase"),e.k0s()()}2&t&&(e.R7$(3),e.SpI(" ",e.bMT(5,3,e.bMT(4,1,"manual"))," "))}function il(t,o){if(1&t&&(e.j41(0,"div",10)(1,"div",11)(2,"h5",12),e.EFF(3),e.nI1(4,"translate"),e.k0s(),e.DNE(5,nl,6,5,"button",13),e.k0s()()),2&t){const n=e.XpG();e.R7$(3),e.JRh(e.bMT(4,2,n.pageTitle)),e.R7$(2),e.Y8G("ngIf",n.isExam)}}function al(t,o){1&t&&e.nrm(0,"app-teacher-assignment-navigation")}function ol(t,o){if(1&t&&(e.j41(0,"div",5)(1,"p"),e.EFF(2),e.nI1(3,"translate"),e.k0s()()),2&t){const n=e.XpG();e.R7$(2),e.JRh(e.bMT(3,1,n.pageIntro))}}function sl(t,o){if(1&t){const n=e.RV6();e.j41(0,"div",5)(1,"app-teacher-assignment-list-table",17),e.bIt("deleteAssignment",function(a){e.eBV(n);const s=e.XpG();return e.Njj(s.deleteAssignmentModal(a))})("editStatus",function(a){e.eBV(n);const s=e.XpG();return e.Njj(s.editActive(a))}),e.k0s()()}if(2&t){const n=e.XpG();e.R7$(),e.Y8G("data",n.assignmentList)("module",n.type)}}
3function rl(t,o){if(1&t&&e.eu8(0,20),2&t){e.XpG(2);const n=e.sdS(16);e.Y8G("ngTemplateOutlet",n)("ngTemplateOutletContext",e.lJ4(2,Kr))}}function ll(t,o){if(1&t){const n=e.RV6();e.j41(0,"div",18),e.DNE(1,rl,1,3,"ng-container",19),e.nI1(2,"async"),e.j41(3,"app-teacher-assignment-list-table",17),e.bIt("deleteAssignment",function(a){e.eBV(n);const s=e.XpG();return e.Njj(s.deleteAssignmentModal(a))})("editStatus",function(a){e.eBV(n);const s=e.XpG();return e.Njj(s.editActive(a))}),e.k0s()()}if(2&t){const n=e.XpG();e.R7$(),e.Y8G("ngIf",!1===e.bMT(2,3,n.isIsolated)),e.R7$(2),e.Y8G("data",n.autoExercises)("module",n.type)}}function cl(t,o){if(1&t&&e.eu8(0,20),2&t){e.XpG(2);const n=e.sdS(16);e.Y8G("ngTemplateOutlet",n)("ngTemplateOutletContext",e.lJ4(2,Zr))}}function ml(t,o){if(1&t){const n=e.RV6();e.j41(0,"div",18),e.DNE(1,cl,1,3,"ng-container",19),e.nI1(2,"async"),e.j41(3,"app-teacher-assignment-list-table",17),e.bIt("deleteAssignment",function(a){e.eBV(n);const s=e.XpG();return e.Njj(s.deleteAssignmentModal(a))})("editStatus",function(a){e.eBV(n);const s=e.XpG();return e.Njj(s.editActive(a))}),e.k0s()()}if(2&t){const n=e.XpG();e.R7$(),e.Y8G("ngIf",!1===e.bMT(2,3,n.isIsolated)),e.R7$(2),e.Y8G("data",n.openExercises)("module",n.type)}}function pl(t,o){if(1&t&&(e.j41(0,"div",21)(1,"p",22),e.nrm(2,"i",23),e.j41(3,"span",24),e.EFF(4),e.nI1(5,"lowercase"),e.nI1(6,"translate"),e.k0s()()()),2&t){const n=e.XpG();e.R7$(4),e.JRh(e.i5U(6,3,"teacherExamListEmpty",e.eq3(6,el,e.bMT(5,1,n.translatedType))))}}function dl(t,o){if(1&t){const n=e.RV6();e.j41(0,"div",25)(1,"button",26),e.bIt("click",function(){e.eBV(n);const a=e.XpG();return e.Njj(a.createExamModal())}),e.EFF(2),e.nI1(3,"translate"),e.nI1(4,"translate"),e.k0s()()}if(2&t){const n=e.XpG();e.R7$(2),e.Lme("",e.bMT(3,2,"create")," ",e.bMT(4,4,n.pageTitle),"")}}function ul(t,o){if(1&t&&(e.j41(0,"div",6)(1,"div",27)(2,"h3"),e.EFF(3),e.nI1(4,"translate"),e.k0s(),e.j41(5,"p"),e.EFF(6),e.nI1(7,"translate"),e.k0s()()()),2&t){const n=o.title,i=o.helperText;e.R7$(3),e.JRh(e.bMT(4,2,n)),e.R7$(3),e.JRh(e.bMT(7,4,i))}}let pt=(()=>{var t;class o{constructor(){this.translateService=(0,e.WQX)(m.c$),this.teacherExamService=(0,e.WQX)(De.V),this.toastrService=(0,e.WQX)(w.tw),this.teacherService=(0,e.WQX)(S.O),this.teacherEloService=(0,e.WQX)(W),this.teacherQuestionService=(0,e.WQX)(ee.d),this.dialogService=(0,e.WQX)(B.bZ),this.assignmentList=[],this.autoExercises=[],this.openExercises=[],this.isLoading=!1,this.isExercise=!1,this.isExam=!1,this.destroy$=new y.B}ngOnInit(){this.courseId=this.teacherService.getCurrentCourseId(),this.pageTitle=this.teacherEloService.getPluralType(),this.pageIntro="teacher".concat(this.teacherEloService.getCapitalizedType(),"OverviewIntro"),this.type=this.teacherEloService.getType(),this.translatedType=this.translateService.instant(this.pageTitle),this.isExercise=this.type===T.Eq.exercise,this.isExam=this.t
3ype===T.Eq.exam,this.teacherEloService.getListSubject().pipe((0,I.Q)(this.destroy$)).subscribe(i=>{if(i&&!i.length)this.assignmentList=[],this.autoExercises=[],this.openExercises=[];else if(this.isExercise){if(i[0]){const[{autoExercises:a=[],openExercises:s=[]}]=i;this.autoExercises=this.addChapterName(a),this.openExercises=this.addChapterName(s)}}else this.assignmentList=i}),this.isIsolated=this.teacherService.getAssignmentPreviewIsolation()}createExamModal(){const i=this.teacherEloService.getCapitalizedType(),a={data:{header:this.translateService.instant("teacher".concat(i,"CreateTitle")),component:Cr,componentData:{courseId:this.courseId}},disableClose:!0,autoFocus:!1,panelClass:["material-modal","col-12","col-md-8","col-lg-6","col-xl-4"]};this.dialogService.open(oe.m,a)}editActive(i){this.isLoading=!0,this.teacherQuestionService.getModuleQuestions(this.type,i.id,i.courseId).pipe((0,R.T)(a=>{var s;return(null==a||null===(s=a.body)||void 0===s?void 0:s.data)||{questions:[]}}),(0,Z.n)(({questions:a})=>{if(a.length){const s=(0,g.A)((0,g.A)({},i),{},{course_id:i.courseId,active:i.active?0:1});return this.teacherEloService.createAssignment(s)}return(0,x.of)([])}),(0,D.W)(({error:a})=>{var s;return null!=a&&null!==(s=a.fields)&&void 0!==s&&s.active?(0,x.of)("activeStatusRestriction"):(0,x.of)("errorLabel")}),(0,I.Q)(this.destroy$)).subscribe(a=>{if(this.isLoading=!1,!Array.isArray(a)&&a.hasOwnProperty("body"))return void this.handleUpdateResponse(a);if("string"==typeof a)return void this.toastrService.error(this.translateService.instant(a),"",{timeOut:15e3});const s=this.translateService.instant(this.type).toLowerCase(),r=this.translateService.instant("teacherSetAssignmentActiveError",{type:s});this.toastrService.error(r)})}deleteAssignmentModal(i){const a={data:{content:this.translateService.instant("qExamDoUWant"),type:me.m6.confirm},autoFocus:!1,disableClose:!0};this.dialogService.open(oe.m,a).afterClosed().pipe((0,I.Q)(this.destroy$)).subscribe(r=>{if(r){const{id:l}=i;this.isLoading=!0,this.teacherEloService.deleteAssignment(l).pipe((0,R.T)(p=>null==p?void 0:p.status),(0,I.Q)(this.destroy$)).subscribe(p=>this.handleDeleteResponse(p,i))}})}openTeacherExamManual(){this.teacherExamService.openExamManual()}handleUpdateResponse(i){const{status:a,body:{data:s}}=i;if(200===a){const r=this.teacherEloService.getCapitalizedType();this.toastrService.success(this.translateService.instant("teacher".concat(r,"UpdateSuccess"))),this.teacherEloService.updateAssignmentInList(s),this.isLoading=!1}}handleDeleteResponse(i,a){if(200===i){this.teacherEloService.removeAssignmentFromList(a);const s=this.teacherEloService.getCapitalizedType();this.toastrService.success(this.translateService.instant("teacher".concat(s,"DeleteSuccess")))}this.isLoading=!1}addChapterName(i){const a=this.teacherEloService.getChapterList();return i.map(s=>{if(null!==(null==s?void 0:s.chapterId)){const r=a.find(l=>l.id===s.chapterId);return(0,g.A)((0,g.A)({},s),{},{chapterName:null==r?void 0:r.name})}return s})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}}return(t=o).\u0275fac=function(i){return new(i||t)},t.\u0275cmp=e.VBU({type:t,selectors:[["app-teacher-assignment-list"]],decls:17,vars:15,consts:[["exerciseTitle",""],[4,"ngIf"],["class","row py-3 mb-3","appBgColor","",4,"ngIf"],[1,"row","pb-4"],["class","col-12",4,"ngIf"],[1,"col-12"],[1,"row"],["class","col-12 py-3",4,"ngIf"],["class","col-12 pt-5",4,"ngIf"],["class","col-12 pt-3 text-right",4,"ngIf"],["appBgColor","",1,"row","py-3","mb-3"],[1,"col-12","d-flex","justify-content-between","align-items-center"],[1,"mb-0","text-white"],["mat-button","","color","background",3,"click",4,"ngIf"],["mat-button","","color","background",3,"click"],[1,"fas","fa-question-circle"],[1,"m-0","d-inline"],[3,"deleteAssignment","editStatus","data","module"],[1,"col-12","py-3"],[3,"ngTemplateOutlet","ngTemplateOutletContext",4,"ngIf"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"col-12","pt-5"],[1,"text-center"],[1,"fas","fa-exclamation-circle","mr-2"],[1,"uppercase-first-letter"],[1,"col-12","pt-3","text-right"],["mat-raised-button","","color","primary",3,"click"],[1,"col-12","pb-2"]],template:function(i,a){1&i&&(e.DNE(0,tl,1,0,"app-spinner",1)(1,il,6,4,"div",2),e.nI1(2,"async"),e.DNE(3,al,1,0,"app-teacher-assignment-navigation",1),e.j41(4,"div",3),e.DNE(
35,ol,4,3,"div",4),e.nI1(6,"async"),e.j41(7,"div",5)(8,"div",6),e.DNE(9,sl,2,2,"div",4)(10,ll,4,5,"div",7)(11,ml,4,5,"div",7)(12,pl,7,8,"div",8)(13,dl,5,6,"div",9),e.nI1(14,"async"),e.k0s()()(),e.DNE(15,ul,8,6,"ng-template",null,0,e.C5r)),2&i&&(e.Y8G("ngIf",a.isLoading),e.R7$(),e.Y8G("ngIf",!1===e.bMT(2,9,a.isIsolated)),e.R7$(2),e.Y8G("ngIf",a.assignmentList),e.R7$(2),e.Y8G("ngIf",!1===e.bMT(6,11,a.isIsolated)),e.R7$(4),e.Y8G("ngIf",a.assignmentList&&a.assignmentList.length),e.R7$(),e.Y8G("ngIf",a.isExercise&&a.autoExercises&&a.autoExercises.length),e.R7$(),e.Y8G("ngIf",a.isExercise&&a.openExercises&&a.openExercises.length),e.R7$(),e.Y8G("ngIf",!a.assignmentList.length&&!a.autoExercises.length&&!a.openExercises.length),e.R7$(),e.Y8G("ngIf",!1===e.bMT(14,13,a.isIsolated)))},dependencies:[u.bT,u.T3,we.k,E.$z,he.t,Hr,Gt,u.Jj,u.GH,u.PV,m.D9],styles:[".teacher-exam[_ngcontent-%COMP%] .sticky-top[_ngcontent-%COMP%]{z-index:var(--z-index-layer-1)}.hide[_ngcontent-%COMP%]{display:none}i[_ngcontent-%COMP%]{font-style:var(--font-style-normal)}.menu-list[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{max-width:var(--size-170px)}.menu-list[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{padding:var(--space-7px) var(--space-0);font-weight:var(--font-weight-normal);display:block;cursor:pointer;font-size:var(--font-size-87);text-align:center}.overflow-visible[_ngcontent-%COMP%]{overflow:visible}\n\n/*# sourceMappingURL=teacher-assignment-list.component.css.map*/"]}),o})();function _l(t,o){1&t&&e.nrm(0,"app-spinner")}function hl(t,o){1&t&&(e.qex(0),e.nrm(1,"router-outlet"),e.bVm())}let dt=(()=>{var t;class o{constructor(i,a,s){this.teacherService=i,this.teacherEloService=a,this.route=s,this.isLoading=!0}ngOnInit(){this.sub$=this.route.data.pipe((0,R.T)(({state:i})=>{this.currentModule=i,this.teacherEloService.setType(i)}),(0,Z.n)(()=>this.teacherService.getCurrentCourse()),(0,Z.n)(({id:i})=>{if(this.currentModule!==T.Eq.exercise)return this.teacherEloService.getModuleList(i).pipe((0,R.T)(r=>{var l;return(null==r||null===(l=r.body)||void 0===l?void 0:l.data)||[]}));const a=this.teacherEloService.getCourseChapters(i).pipe((0,R.T)(r=>{var l;return(null==r||null===(l=r.body)||void 0===l?void 0:l.data)||[]})),s=this.teacherEloService.getModuleList(i).pipe((0,R.T)(r=>{var l;return(null==r||null===(l=r.body)||void 0===l?void 0:l.data)||[]}));return(0,j.p)([a,s]).pipe((0,R.T)(([r,l])=>({chapterList:r,moduleList:l})))})).subscribe(i=>{this.currentModule===T.Eq.exercise?(this.teacherEloService.setChapterList(i.chapterList),this.teacherEloService.setListSubject([i.moduleList])):this.teacherEloService.setListSubject(i),this.isLoading=!1})}ngOnDestroy(){this.sub$.unsubscribe(),this.teacherEloService.clearAssignmentData()}}return(t=o).\u0275fac=function(i){return new(i||t)(e.rXU(S.O),e.rXU(W),e.rXU(O.nX))},t.\u0275cmp=e.VBU({type:t,selectors:[["app-assignments"]],decls:2,vars:2,consts:[[4,"ngIf"]],template:function(i,a){1&i&&e.DNE(0,_l,1,0,"app-spinner",0)(1,hl,2,0,"ng-container",0),2&i&&(e.Y8G("ngIf",a.isLoading),e.R7$(),e.Y8G("ngIf",!a.isLoading))},dependencies:[u.bT,he.t,O.n3],encapsulation:2}),o})();var je=f(19603);const fl=["studentListSort"],gl=["studentListPaginator"],vl=["mobileStudentDialog"],bl=t=>({hide:t}),Tl=t=>({"text-underline":t}),Cl=t=>({"fa-lg":t}),xl=(t,o,n)=>({"fas present-green":t,"far text-black-50":o,"pr-3":n});function Il(t,o){1&t&&e.nrm(0,"app-spinner")}function Rl(t,o){if(1&t&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"dateformat"),e.k0s()),2&t){const n=e.XpG(2);e.R7$(),e.JRh(e.bMT(2,1,n.attendantsListDate))}}function Fl(t,o){1&t&&(e.j41(0,"th",34),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.JRh(e.bMT(2,1,"photoVT")))}function kl(t,o){if(1&t&&(e.j41(0,"td",35),e.nrm(1,"img",36),e.nI1(2,"generateFastImage"),e.k0s()),2&t){const n=o.$implicit;e.R7$(),e.FS9("alt",n.firstName),e.Y8G("src",e.bMT(2,2,n.picture),e.B4B)}}function yl(t,o){1&t&&(e.j41(0,"th",37),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.JRh(e.bMT(2,1,"studentIDVT")))}function El(t,o){if(1&t&&(e.j41(0,"td",35),e.EFF(1),e.k0s()),2&t){const n=o.$implicit;e.R7$(),e.JRh(n.id)}}function Sl(t,o){1&t&&(e.j41(0,"th",37),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.JRh(e.bMT(2,1,"name")))}function $l(t,o){1&t&&(e.nrm(0,"i",40),e.nI1(1,"translate")),2&t&&e.FS9("matTooltip",e.bMT(1,1,"willNotBePresent"))}
3function Ml(t,o){if(1&t){const n=e.RV6();e.j41(0,"td",38),e.bIt("click",function(){const a=e.eBV(n).$implicit,s=e.XpG(2);return e.Njj(s.mobileUser&&s.showStudentModal(a.id))}),e.EFF(1),e.DNE(2,$l,2,3,"i",39),e.k0s()}if(2&t){const n=o.$implicit,i=e.XpG(2);e.Y8G("ngClass",e.eq3(3,Tl,i.mobileUser)),e.R7$(),e.SpI(" ",n.fullname," "),e.R7$(),e.Y8G("ngIf","will_not_present"===n.attends)}}function wl(t,o){1&t&&(e.j41(0,"th",37),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.JRh(e.bMT(2,1,"city")))}function jl(t,o){if(1&t&&(e.j41(0,"td",35),e.EFF(1),e.k0s()),2&t){const n=o.$implicit;e.R7$(),e.JRh(n.city)}}function Gl(t,o){1&t&&(e.j41(0,"th",37),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.JRh(e.bMT(2,1,"dateOfBirth")))}function Dl(t,o){if(1&t&&(e.qex(0),e.EFF(1),e.nI1(2,"dateformat"),e.bVm()),2&t){const n=e.XpG().$implicit;e.R7$(),e.JRh(e.bMT(2,1,n.dateOfBirth))}}function Ol(t,o){1&t&&(e.EFF(0),e.nI1(1,"translate")),2&t&&e.JRh(e.bMT(1,1,"noData"))}function Al(t,o){if(1&t&&(e.j41(0,"td",35),e.DNE(1,Dl,3,3,"ng-container",41)(2,Ol,2,3,"ng-template",null,3,e.C5r),e.k0s()),2&t){const n=o.$implicit,i=e.sdS(3);e.R7$(),e.Y8G("ngIf",n.dateOfBirth)("ngIfElse",i)}}function Nl(t,o){1&t&&(e.j41(0,"th",34),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.JRh(e.bMT(2,1,"presentVT")))}function Ll(t,o){if(1&t){const n=e.RV6();e.j41(0,"td",42)(1,"i",43),e.bIt("click",function(){const a=e.eBV(n).$implicit,s=e.XpG(2);return e.Njj("present"!==a.attends&&s.setStudentStatus(a.id,"present"))}),e.k0s(),e.j41(2,"i",44),e.bIt("click",function(){const a=e.eBV(n).$implicit,s=e.XpG(2);return e.Njj("not_present"!==a.attends&&s.setStudentStatus(a.id,"not_present"))}),e.k0s()()}if(2&t){const n=o.$implicit,i=e.XpG(2);e.Y8G("ngClass",e.eq3(3,Cl,i.mobileUser)),e.R7$(),e.Y8G("ngClass",e.sMw(5,xl,"present"===n.attends,"present"!==n.attends,!i.mobileUser)),e.R7$(),e.Y8G("ngClass","not_present"===n.attends?"fas not-present-red":"far text-black-50")}}function Yl(t,o){1&t&&e.nrm(0,"tr",45)}function Vl(t,o){1&t&&e.nrm(0,"tr",46)}function Pl(t,o){if(1&t){const n=e.RV6();e.j41(0,"div",6)(1,"div",7)(2,"h3",8)(3,"button",9),e.bIt("click",function(){e.eBV(n);const a=e.XpG();return e.Njj(a.showPrevious())}),e.nrm(4,"i",10),e.k0s(),e.j41(5,"strong",11),e.EFF(6),e.nI1(7,"translate"),e.DNE(8,Rl,3,3,"span",4),e.k0s(),e.j41(9,"button",9),e.bIt("click",function(){e.eBV(n);const a=e.XpG();return e.Njj(a.showNext())}),e.nrm(10,"i",12),e.k0s()(),e.nrm(11,"p",13),e.nI1(12,"translate"),e.k0s(),e.j41(13,"div",14)(14,"mat-form-field",15)(15,"mat-label"),e.EFF(16),e.nI1(17,"translate"),e.k0s(),e.j41(18,"input",16),e.mxI("ngModelChange",function(a){e.eBV(n);const s=e.XpG();return e.DH7(s.searchTextM,a)||(s.searchTextM=a),e.Njj(a)}),e.bIt("keyup",function(){e.eBV(n);const a=e.XpG();return e.Njj(a.searchItems())}),e.k0s()()(),e.j41(19,"div",17)(20,"div",18)(21,"table",19,1),e.qex(23,20),e.DNE(24,Fl,3,3,"th",21)(25,kl,3,4,"td",22),e.bVm(),e.qex(26,23),e.DNE(27,yl,3,3,"th",24)(28,El,2,1,"td",22),e.bVm(),e.qex(29,25),e.DNE(30,Sl,3,3,"th",24)(31,Ml,3,5,"td",26),e.bVm(),e.qex(32,27),e.DNE(33,wl,3,3,"th",24)(34,jl,2,1,"td",22),e.bVm(),e.qex(35,28),e.DNE(36,Gl,3,3,"th",24)(37,Al,4,2,"td",22),e.bVm(),e.qex(38,29),e.DNE(39,Nl,3,3,"th",21)(40,Ll,3,9,"td",30),e.bVm(),e.DNE(41,Yl,1,0,"tr",31)(42,Vl,1,0,"tr",32),e.k0s(),e.nrm(43,"mat-paginator",33,2),e.k0s()()()}if(2&t){const n=e.XpG();e.R7$(5),e.Y8G("ngClass",n.mobileUser?"title-mobile":""),e.R7$(),e.SpI("",e.bMT(7,12,"attendanceListTitle")," "),e.R7$(2),e.Y8G("ngIf",n.attendantsListDate),e.R7$(3),e.Y8G("innerHTML",e.bMT(12,14,"attendanceListTextTeacher"),e.npT),e.R7$(5),e.JRh(e.bMT(17,16,"search")),e.R7$(2),e.R50("ngModel",n.searchTextM),e.R7$(2),e.Y8G("ngClass",e.eq3(18,bl,(null==n.studentListDataSource?null:n.studentListDataSource.data.length)<1)),e.R7$(),e.Y8G("dataSource",n.studentListDataSource),e.R7$(20),e.Y8G("matHeaderRowDef",n.studentListColumns),e.R7$(),e.Y8G("matRowDefColumns",n.studentListColumns),e.R7$(),e.Y8G("pageSize",6)("hidePageSize",!0)}}function Xl(t,o){if(1&t&&(e.j41(0,"div",47)(1,"div",48),e.nrm(2,"img",49),e.nI1(3,"generateFastImage"),e.k0s(),e.j41(4,"div",50)(5,"h5",51),e.EFF(6),e.k0s(),e.j41(7,"p",52),e.EFF(8),e.nI1(9,"translate"),e.nI1(10,"translate"),e.k0s()(),e.nrm(11,"hr"),e.j41(12,"div",53)(13,"p",54),e.nrm(14,"i",55),e.EFF(15),e.k0s(),e.j41(16,"p",54),e.nrm(17,"i",56),e.EFF(18),e.nI1(19,"dateformat"),e.k0s()()()),2&t){const n=e.XpG();e.R7$(2),e.Y8G("src",e.bMT(3,7,n.modalStudent.picture),e.B4B),e.R7$(4),e.JRh(n.modalStudent.fullname),e.R7$(2),e.E5c("",e.bMT(9,9,"id"),"",e.bMT(10,11,"typography.colon"),"",n.modalStudent.id,""),e.R7$(7),e.SpI(" ",n.modalStudent.city,""),e.R7$(3),e.SpI(" ",e.bMT(19,13,n.modalStudent.dateOfBirth),"")}}let Bl=(()=>{var t;class o{constructor(i,a,s,r,l){this.teacherService=i,this.translationService=a,this.toastrService=s,this.helperService=r,this.dialogService=l,this.mobileUser=!1,this.defaultLesson=0,this.isLoading=!1,this.students=[],this.currentLesson=0,this.attendanciesEditable=!1,this.modalStudent={},this.maxVisibleItems=20,this.searchTextM="",this.showTable=!1,this.studentListColumns=["photo","id","fullname","city","dateOfBirth","present"]}ngOnInit(){this.courseSub$=this.teacherService.getCurrentCourse().subscribe(i=>{if(this.course=i,i.lessons){if(this.lessons=i.lessons.map((a,s)=>(0,g.A)((0,g.A)({},a),{},{lessonNumber:s+1})),this.helperService.isEmptyObj(i.nextClass)){const[a]=this.lessons.slice(-1);this.currentLesson=+a.id}else this.currentLesson=this.lessons.find(a=>+a.id==+i.nextClass.id).id;this.loadAttendantsList(this.currentLesson),this.showTable=!0}}),this.mobileUser&&(this.studentListColumns=["fullname","present"])}loadAttendantsList(i){this.teacherService.getTeacherPresenceList(+i).subscribe(({status:a=200,body:s})=>
3{if(200===a){const{data:r}=s;this.attendantsListDate=this.course.lessons.find(p=>+p.id==+i).date,this.attendanciesEditable=(0,N.I1)().format(P.x.iso.date)===this.attendantsListDate;const l=r.map(p=>(0,g.A)((0,g.A)({},p),{},{fullname:"".concat(p.firstName," ").concat(p.lastName),city:p.city||this.translationService.instant("noData"),dateOfBirth:p.dateOfBirth}));this.studentListDataSource=new Yt.p(l),this.studentListDataSource.paginator=this.studentListPaginator,this.studentListDataSource.sort=this.studentListSort,this.searchTextM&&(this.studentListDataSource.filter=this.searchTextM)}})}showPrevious(){const{currentLesson:i,lessons:a}=this,r=a.findIndex(l=>+l.id==+i)-1;a[r]?(this.currentLesson=a[r].id,this.loadAttendantsList(this.currentLesson)):(this.currentLesson=a[a.length-1].id,this.loadAttendantsList(this.currentLesson))}showNext(){const{currentLesson:i,lessons:a}=this,r=a.findIndex(l=>+l.id==+i)+1;a[r]?(this.currentLesson=a[r].id,this.loadAttendantsList(this.currentLesson)):(this.currentLesson=a[0].id,this.loadAttendantsList(this.currentLesson))}setStudentStatus(i,a){this.attendanciesEditable?(this.isLoading=!0,this.teacherService.patchAttendancy(+this.currentLesson,i,a).subscribe(s=>{this.isLoading=!1;const{success:r=!1}=s;r?(this.studentListDataSource.data.find(l=>+l.id==+i).attends=a,this.toastrService.success(this.translationService.instant("successLabel"))):this.toastrService.error(this.translationService.instant("somethingWentWrongTryAgain"))},()=>{this.toastrService.error(this.translationService.instant("somethingWentWrongTryAgain")),this.isLoading=!1})):this.toastrService.info(this.translationService.instant("attendancyNotEditableText"))}searchItems(){this.studentListDataSource.filter=this.searchTextM?this.searchTextM:null}showStudentModal(i){this.modalStudent=this.studentListDataSource.data.find(r=>+r.id==+i);const s={data:{type:me.m6.info,template:this.mobileStudentDialog},panelClass:"material-modal"};"will_not_present"===this.modalStudent.attends&&(s.data.header=this.translationService.instant("willNotBePresent"),s.data.headerClasses="notpresent-modal-flag"),this.dialogService.open(oe.m,s)}ngOnDestroy(){this.courseSub$.unsubscribe()}}return(t=o).\u0275fac=function(i){return new(i||t)(e.rXU(S.O),e.rXU(m.c$),e.rXU(w.tw),e.rXU(Ee.w),e.rXU(B.bZ))},t.\u0275cmp=e.VBU({type:t,selectors:[["app-attendance-list-table"]],viewQuery:function(i,a){if(1&i&&(e.GBs(fl,5),e.GBs(gl,5),e.GBs(vl,7)),2&i){let s;e.mGM(s=e.lsd())&&(a.studentListSort=s.first),e.mGM(s=e.lsd())&&(a.studentListPaginator=s.first),e.mGM(s=e.lsd())&&(a.mobileStudentDialog=s.first)}},inputs:{lessons:"lessons",mobileUser:"mobileUser",defaultLesson:"defaultLesson"},decls:4,vars:2,consts:[["mobileStudentDialog",""],["studentListSort","matSort"],["studentListPaginator",""],["noDateOfBirth",""],[4,"ngIf"],["class","row",4,"ngIf"],[1,"row"],[1,"col-12","text-center"],[1,"title","d-flex","justify-content-center","align-items-center"],["type","button","mat-raised-button","","color","lightgrey",1,"listnavbutton",3,"click"],[1,"fa-chevron-left","fas"],[3,"ngClass"],[1,"fa-chevron-right","fas","fa-1x"],[3,"innerHTML"],[1,"col-12","col-md-4"],["id","search-attendance-list-form-field","appearance","fill"],["type","text","matInput","",1,"mb-2",3,"ngModelChange","keyup","ngModel"],[1,"col-12"],[1,"mat-elevation-z4","mb-3",3,"ngClass"],["mat-table","","matSort","",3,"dataSource"],["matColumnDef","photo"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","id"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["matColumnDef","fullname"],["mat-cell","",3,"ngClass","click",4,"matCellDef"],["matColumnDef","city"],["matColumnDef","dateOfBirth"],["matColumnDef","present"],["mat-cell","",3,"ngClass",4,"matCellDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["showFirstLastButtons","",3,"pageSize","hidePageSize"],["mat-header-cell",""],["mat-cell",""],["width","60px","height","60px","appOnErrorImage","","imgType","user",1,"img-at-list",3,"src","alt"],["mat-header-cell","","mat-sort-header",""],["mat-cell","",3,"click","ngClass"],["matTooltipPosition","above","class","text-danger presentexclamation fa-exclamation fas ml-1",3,"matTooltip",4,"ngIf"],["matTooltipPosition","above",1,"text-danger","presentexclamation","fa-exclamation","fas","ml-1",3,"matTooltip"],[4,"ngIf","ngIfElse"],["mat-cell","",3,"ngClass"],[1,"fa-check-circle","fa-2x","pr-2",3,"click","ngClass"],[1,"fa-times-circle","fa-2x",3,"click","ngClass"],["mat-header-row",""],["mat-row",""],["mat-dialog-content",""],[1,"avatar","studentimg","mx-auto","white"],["alt","","appOnErrorImage","","imgType","user",1,"rounded-circle","img-fluid",3,"src"],[1,"row","text-center","mt-4"],[1,"mb-0","col-12","text-center","modalstudentname"],[1,"text-center","col-12"],[1,"row","mt-4"],[1,"col-6","text-center"],[1,"fa-map-marker-alt","fas"],[1,"fa-calendar-alt","far"]],template:function(i,a){1&i&&e.DNE(0,Il,1,0,"app-spinner",4)(1,Pl,45,20,"div",5)(2,Xl,20,15,"ng-template",null,0,e.C5r),2&i&&(e.Y8G("ngIf",a.isLoading),e.R7$(),e.Y8G("ngIf",a.showTable))},dependencies:[u.YU,u.bT,c.me,c.BC,c.vS,b.Zl,b.tL,b.ji,b.cC,b.YV,b.iL,b.KS,b.$R,b.YZ,b.NB,ve.iy,E.$z,ne.fg,A.rl,A.nJ,qe.B4,qe.aE,Re.oV,B.Yi,he.t,Ne.e,m.D9,je.O,Ke.l],styles:[".sticky-top[_ngcontent-%COMP%]{z-index:var(--z-auto)}.img-at-list[_ngcontent-%COMP%]{border-radius:var(--border-radius-full);image-rendering:-moz-crisp-edges;image-rendering:pixelated;object-fit:cover}.img-at-list-box[_ngcontent-%COMP%]{padding:var(--space-3px) var(--space-0)}.present-col[_ngcontent-%COMP%]{width:var(--size-90px)}.check-list-but[_ngcontent-%COMP%], .attBtn[_ngcontent-%COMP%]{cursor:pointer}.container[_ngcontent-%COMP%]{min-width:var(--size-100-percent)}.listnavbutton[_ngcontent-%COMP%]{width:var(--size-50px)!important;min-width:var(--size-50px);max-width:var(--size-100-percent)!important;max-height:var(--size-100-percent)!important;height:var(--size-50px)!important;text-align:center;padding:var(--space-0);font-size:var(--font-size-75)}.listnavbutton-mobile[_ngcontent-%COMP%]{width:var(--size-30px)!important;max-width:var(--size-100-percent)!important;max-height:var(--size-100-percent)!important;height:var(--size-30px)!important;text-align:center;padding:var(--space-0);font-size:var(--font-size-75)}.title-mobile[_ngcontent-%COMP%]{font-size:var(--font-size-100)!important}.presentexclamation[_ngcontent-%COMP%]{font-size:var(--font-size-150)!important;vertical-align:middle!important}.w-300[_ngcontent-%COMP%]{min-width:var(--size-300px)!important}.present-green[_ngcontent-%COMP%]{color:var(--color-green)!important}.not-present-red[_ngcontent-%COMP%]{color:var(--color-danger-1)!important}.attendancetable[_ngcontent-%COMP%] td[_ngcontent-%COMP%], .attendancetable[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{font-size:var(--font-size-100)!important}.text-underline[_ngcontent-%COMP%]{-webkit-text-decoration:var(--text-decoration-underline)!important;text-decoration:var(--text-decoration-underline)!important}.mobilestudentmodalheader[_ngcontent-%COMP%]{padding-top:var(--space-0);padding-left:var(--space-0);border-bottom:var(--border-style-none)} .notpresent-modal-flag h5{border-bottom-right-radius:var(--border-radius-xl);font-size:var(--font-size-100);background-color:var(--color-danger-1);padding:var(--space-0_5rem);color:var(--color-tint-1)!important;margin-left:var(--space-negative-15px)!important;padding-left:var(--space-15px);max-width:var(--size-80-percent)}.studentimg[_ngcontent-%COMP%]{padding-left:var(--space-20-percent);padding-right:var(--space-20-percent)}.modalstudentname[_ngcontent-%COMP%]{font-weight:var(--font-weight-extrabold)}
3.avatar[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{border-radius:var(--border-radius-full)!important;object-fit:cover!important;width:var(--size-160px)!important;min-width:var(--size-160px)!important;max-width:var(--size-100-percent)!important;max-height:var(--size-100-percent)!important;height:var(--size-160px)!important} #search-attendance-list-form-field .mat-mdc-form-field-infix{padding-bottom:var(--space-0)}.listnavbutton[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:var(--color-icons)!important}\n\n/*# sourceMappingURL=attendance-list-table.component.css.map*/"]}),o})(),ql=(()=>{var t;class o{constructor(i){this.deviceDetectorService=i,this.mobileUser=!1}ngOnInit(){this.mobileUser=this.deviceDetectorService.isMobile()}}return(t=o).\u0275fac=function(i){return new(i||t)(e.rXU(ge.Kg))},t.\u0275cmp=e.VBU({type:t,selectors:[["app-teacher-attend-list"]],decls:8,vars:4,consts:[["appBgColor","",1,"row","py-3","mb-3"],[1,"col-12","col-md-6"],[1,"mb-0","text-white"],[1,"row","pb-4"],[1,"col-12"],[3,"mobileUser"]],template:function(i,a){1&i&&(e.j41(0,"div",0)(1,"div",1)(2,"h5",2),e.EFF(3),e.nI1(4,"translate"),e.k0s()()(),e.j41(5,"div",3)(6,"div",4),e.nrm(7,"app-attendance-list-table",5),e.k0s()()),2&i&&(e.R7$(3),e.JRh(e.bMT(4,2,"attendanceListTitle")),e.R7$(4),e.Y8G("mobileUser",a.mobileUser))},dependencies:[we.k,Bl,m.D9],styles:[".container[_ngcontent-%COMP%]{min-width:var(--size-100-percent)}\n\n/*# sourceMappingURL=teacher-attend-list.component.css.map*/"]}),o})(),Ul=(()=>{var t;class o{}return(t=o).\u0275fac=function(i){return new(i||t)},t.\u0275cmp=e.VBU({type:t,selectors:[["app-teacher-corrections"]],decls:4,vars:0,consts:[[1,"container","mat-elevation-z3","sm-no-shadow","mb-0","mb-sm-5"],[1,"row"],[1,"col-12"]],template:function(i,a){1&i&&(e.j41(0,"div",0)(1,"div",1)(2,"div",2),e.nrm(3,"router-outlet"),e.k0s()()())},dependencies:[O.n3],encapsulation:2}),o})(),Vt=(()=>{var t;class o{constructor(i,a){this.configService=i,this.http=a,this.CDO_URL=this.configService.getCdoUrl()}getMaterialsList(i){const a="".concat(this.CDO_URL,"api/material/list?courseId=").concat(i);return this.http.get(a,{observe:"response"})}getStudentsBoughtByMaterial(i,a){const s="".concat(this.CDO_URL,"api/material/").concat(a,"/students?courseId=").concat(i);return this.http.get(s,{observe:"response"})}getMaterialReviewsList(i,a){const s="".concat(this.CDO_URL,"api/material/").concat(a,"/reviews?courseId=").concat(i);return this.http.get(s,{observe:"response"})}addReviewToMaterial(i){const{productId:a=0,feedback:s=""}=i,r={materialId:a,review:s},l="".concat(this.CDO_URL,"api/material/").concat(a,"/reviews");return this.http.post(l,r,{observe:"response"})}}return(t=o).\u0275fac=function(i){return new(i||t)(e.KVO(Ce.w),e.KVO(ue.Qq))},t.\u0275prov=e.jDH({token:t,factory:t.\u0275fac,providedIn:"root"}),o})();var Pt=f(97230);const Jl=["studentsWhoBoughtDialog"],Ql=["feedbackDialog"],Xt=()=>["photo","product_name","price","amountWhoBought","feedback","website"],Bt=(t,o)=>({left:t,right:o}),qt=()=>["expand"],Ut=()=>["photo","given_review"],Jt=()=>["photo","firstname","lastname","given_review","order_date"],Qt=()=>["photo","student_number","firstname","lastname","promocodeUsed"],zt=()=>["photo","student","promocodeUsed"];function zl(t,o){1&t&&e.nrm(0,"div")}function Wl(t,o){1&t&&(e.j41(0,"th",27),e.EFF(1),e.nI1(2,"translate"),e.nI1(3,"titleCaseFirstWord"),e.k0s()),2&t&&(e.R7$(),e.JRh(e.bMT(3,3,e.bMT(2,1,"photoVT"))))}function Hl(t,o){if(1&t&&(e.j41(0,"td",28),e.nrm(1,"img",29),e.k0s()),2&t){const n=o.$implicit;e.R7$(),e.Y8G("src",n.product_image,e.B4B)}}function Kl(t,o){1&t&&(e.j41(0,"th",27),e.EFF(1),e.nI1(2,"translate"),e.nI1(3,"titleCaseFirstWord"),e.k0s()),2&t&&(e.R7$(),e.JRh(e.bMT(3,3,e.bMT(2,1,"priceLabel"))))}function Zl(t,o){if(1&t&&(e.j41(0,"td",30),e.EFF(1),e.nI1(2,"localeCurrency"),e.k0s()),2&t){const n=o.$implicit;e.R7$(),e.SpI(" ",e.bMT(2,1,n.product_price)," ")}}function ec(t,o){1&t&&(e.j41(0,"th",27),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.JRh(e.bMT(2,1,"amountWhoBought")))}function tc(t,o){if(1&t){const n=e.RV6();e.j41(0,"td",31)(1,"a",32),e.bIt("click",function(){const a=e.eBV(n).$implicit,s=e.XpG(3);return e.Njj(s.showStudentsBought(a.product_id))}),e.EFF(2),e.nI1(3,"translate"),e.k0s()()}if(2&t){const n=o.$implicit;e.R7$(2),e.SpI(" ",e.i5U(3,1,"typography.slash",e.l_i(4,Bt,n.amount_bought,n.amount_subscribed))," ")}}function nc(t,o){1&t&&(e.j41(0,"th",33),e.EFF(1),e.nI1(2,"translate"),e.nI1(3,"titleCaseFirstWord"),e.k0s()),2&t&&(e.R7$(),e.JRh(e.bMT(3,3,e.bMT(2,1,"feedback"))))}function ic(t,o){if(1&t){const n=e.RV6();e.j41(0,"td",34)(1,"a",35),e.bIt("click",function(){const a=e.eBV(n).$implicit,s=e.XpG(3);return e.Njj(s.showFeedback(a.product_id))}),e.nrm(2,"i",36),e.k0s()()}}function ac(t,o){1&t&&(e.j41(0,"th",33),e.EFF(1),e.nI1(2,"translate"),e.nI1(3,"titleCaseFirstWord"),e.k0s()),2&t&&(e.R7$(),e.JRh(e.bMT(3,3,e.bMT(2,1,"website"))))}function oc(t,o){if(1&t&&(e.j41(0,"td",37)(1,"a",38),e.nrm(2,"i",39),e.k0s()()),2&t){const n=o.$implicit;e.R7$(),e.BMQ("href",n.product_link,e.B4B)}}function sc(t,o){1&t&&e.nrm(0,"tr",40)}function rc(t,o){1&t&&e.nrm(0,"tr",41)}function lc(t,o){if(1&t&&(e.j41(0,"table",11),e.qex(1,12),e.DNE(2,Wl,4,5,"th",13)(3,Hl,2,1,"td",14),e.bVm(),e.nrm(4,"mat-text-column",15),e.nI1(5,"translate"),e.nI1(6,"titleCaseFirstWord"),e.qex(7,16),e.DNE(8,Kl,4,5,"th",13)(9,Zl,3,3,"td",17),e.bVm(),e.qex(10,18),e.DNE(11,ec,3,3,"th",13)(12,tc,4,7,"td",19),e.bVm(),e.qex(13,20),e.DNE(14,nc,4,5,"th",21)(15,ic,3,0,"td",22),e.bVm(),e.qex(16,23),e.DNE(17,ac,4,5,"th",21)(18,oc,3,1,"td",24),e.bVm(),e.DNE(19,sc,1,0,"tr",25)(20,rc,1,0,"tr",26),e.k0s()),2&t){const n=e.XpG(2);e.Y8G("dataSource",n.items),e.R7$(4),e.Y8G("headerText",e.bMT(6,6,e.bMT(5,4,"product"))),e.R7$(15),e.Y8G("matHeaderRowDef",e.lJ4(8,Xt)),e.R7$(),e.Y8G("matRowDefColumns",e.lJ4(9,Xt))}}function cc(t,o){if(1&t&&e.DNE(0,lc,21,10,"table",10),2&t){const n=e.XpG(),i=e.sdS(14);e.Y8G("ngIf",!!n.items&&n.items.length>0)("ngIfElse",i)}}function mc(t,o){1&t&&(e.j41(0,"th",45)(1,"span",46),e.EFF(2),e.nI1(3,"translate"),e.nI1(4,"titleCaseFirstWord"),e.k0s(),e.j41(5,"span",47),e.EFF(6),e.nI1(7,"translate"),e.nI1(8,"titleCaseFirstWord"),e.k0s()()),2&t&&(e.R7$(2),e.JRh(e.bMT(4,4,e.bMT(3,2,"photoVT"))),e.R7$(4),e.JRh(e.bMT(8,8,e.bMT(7,6,"product"))))}function pc(t,o){if(1&t){const n=e.RV6();e.j41(0,"td",48)(1,"mat-accordion")(2,"mat-expansion-panel")(3,"mat-expansion-panel-header",49)(4,"mat-panel-title"),e.nrm(5,"img",50),e.j41(6,"span",51),e.EFF(7),e.k0s()()(),e.j41(8,"table",52)(9,"tbody")(10,"tr")(11,"td",53),e.EFF(12),e.nI1(13,"translate"),e.nI1(14,"titleCaseFirstWord"),e.k0s(),e.j41(15,"td",54),e.
3EFF(16),e.nI1(17,"localeCurrency"),e.k0s()(),e.j41(18,"tr")(19,"td",53),e.EFF(20),e.nI1(21,"translate"),e.k0s(),e.j41(22,"td",54)(23,"a",32),e.bIt("click",function(){const a=e.eBV(n).$implicit,s=e.XpG(3);return e.Njj(s.showStudentsBought(a.product_id))}),e.EFF(24),e.nI1(25,"translate"),e.k0s()()(),e.j41(26,"tr")(27,"td",55),e.EFF(28),e.nI1(29,"translate"),e.k0s(),e.j41(30,"td",54)(31,"a",56),e.bIt("click",function(){const a=e.eBV(n).$implicit,s=e.XpG(3);return e.Njj(s.showFeedback(a.product_id))}),e.nrm(32,"i",57),e.k0s()()(),e.j41(33,"tr")(34,"td",55),e.EFF(35),e.nI1(36,"translate"),e.k0s(),e.j41(37,"td",54)(38,"a",58),e.nrm(39,"i",39),e.k0s()()()()()()()()}if(2&t){const n=o.$implicit;e.R7$(5),e.Y8G("src",n.product_image,e.B4B),e.R7$(2),e.JRh(n.product_name),e.R7$(5),e.JRh(e.bMT(14,11,e.bMT(13,9,"priceLabel"))),e.R7$(4),e.JRh(e.bMT(17,13,n.product_price)),e.R7$(4),e.JRh(e.bMT(21,15,"amountWhoBought")),e.R7$(4),e.SpI(" ",e.i5U(25,17,"typography.slash",e.l_i(24,Bt,n.amount_bought,n.amount_subscribed))," "),e.R7$(4),e.JRh(e.bMT(29,20,"feedback")),e.R7$(7),e.JRh(e.bMT(36,22,"website")),e.R7$(3),e.BMQ("href",n.product_link,e.B4B)}}function dc(t,o){1&t&&e.nrm(0,"tr",40)}function uc(t,o){1&t&&e.nrm(0,"tr",41)}function _c(t,o){if(1&t&&(e.j41(0,"table",11),e.qex(1,42),e.DNE(2,mc,9,10,"th",43)(3,pc,40,27,"td",44),e.bVm(),e.DNE(4,dc,1,0,"tr",25)(5,uc,1,0,"tr",26),e.k0s()),2&t){const n=e.XpG(2);e.Y8G("dataSource",n.items),e.R7$(4),e.Y8G("matHeaderRowDef",e.lJ4(3,qt)),e.R7$(),e.Y8G("matRowDefColumns",e.lJ4(4,qt))}}function hc(t,o){if(1&t&&e.DNE(0,_c,6,5,"table",10),2&t){const n=e.XpG(),i=e.sdS(14);e.Y8G("ngIf",!!n.items&&n.items.length>0)("ngIfElse",i)}}function fc(t,o){if(1&t&&e.nrm(0,"img",63),2&t){const n=e.XpG(2);e.Y8G("src",n.studentsWhoBoughtModalImage,e.B4B)}}function gc(t,o){if(1&t&&(e.j41(0,"div",59)(1,"div",60),e.DNE(2,fc,1,1,"img",61),e.k0s(),e.eu8(3,62),e.k0s()),2&t){const n=e.XpG(),i=e.sdS(16),a=e.sdS(18);e.R7$(2),e.Y8G("ngIf",!!n.studentsWhoBoughtModalImage),e.R7$(),e.Y8G("ngTemplateOutlet",n.mobileView?a:i)}}function vc(t,o){1&t&&(e.j41(0,"th",27),e.EFF(1),e.nI1(2,"translate"),e.nI1(3,"titleCaseFirstWord"),e.k0s()),2&t&&(e.R7$(),e.JRh(e.bMT(3,3,e.bMT(2,1,"photoVT"))))}function bc(t,o){if(1&t&&(e.j41(0,"td",78),e.nrm(1,"img",79),e.k0s()),2&t){const n=o.$implicit;e.R7$(),e.Y8G("src",n.student_photo,e.B4B)}}function Tc(t,o){1&t&&e.nrm(0,"tr",40)}function Cc(t,o){1&t&&e.nrm(0,"tr",41)}function xc(t,o){if(1&t&&(e.j41(0,"table",72),e.qex(1,12),e.DNE(2,vc,4,5,"th",13)(3,bc,2,1,"td",73),e.bVm(),e.nrm(4,"mat-text-column",74),e.nI1(5,"translate"),e.nI1(6,"titleCaseFirstWord"),e.nrm(7,"mat-text-column",75),e.nI1(8,"translate"),e.nrm(9,"mat-text-column",76),e.nI1(10,"translate"),e.nrm(11,"mat-text-column",77),e.nI1(12,"translate"),e.DNE(13,Tc,1,0,"tr",25)(14,Cc,1,0,"tr",26),e.k0s()),2&t){const n=e.XpG(2);e.Y8G("dataSource",n.studentFeedback),e.R7$(4),e.Y8G("headerText",e.bMT(6,9,e.bMT(5,7,"firstName"))),e.R7$(3),e.Y8G("headerText",e.bMT(8,11,"lastName")),e.R7$(2),e.Y8G("headerText",e.bMT(10,13,"cpTestimonialsHeading")),e.R7$(2),e.Y8G("headerText",e.bMT(12,15,"cmpDate")),e.R7$(2),e.Y8G("matHeaderRowDef",n.mobileView?e.lJ4(17,Ut):e.lJ4(18,Jt)),e.R7$(),e.Y8G("matRowDefColumns",n.mobileView?e.lJ4(19,Ut):e.lJ4(20,Jt))}}function Ic(t,o){if(1&t){const n=e.RV6();e.j41(0,"div",59)(1,"h4",64),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.DNE(4,xc,15,21,"table",65),e.j41(5,"div",66)(6,"h4",67),e.EFF(7),e.nI1(8,"translate"),e.k0s(),e.j41(9,"form",68),e.bIt("ngSubmit",function(){e.eBV(n);const a=e.XpG();return e.Njj(a.addReview())}),e.j41(10,"mat-form-field",69)(11,"mat-label"),e.EFF(12),e.nI1(13,"translate"),e.k0s(),e.nrm(14,"textarea",70),e.k0s(),e.j41(15,"button",71),e.EFF(16),e.nI1(17,"translate"),e.k0s()()()()}if(2&t){const n=e.XpG(),i=e.sdS(12);e.R7$(2),e.SpI(" ",e.bMT(3,8,"feedback")," "),e.R7$(2),e.Y8G("ngIf",!!n.studentFeedback&&n.studentFeedback.length>0)("ngIfElse",i),e.R7$(3),e.JRh(e.bMT(8,10,"addNewRemark")),e.R7$(2),e.Y8G("formGroup",n.addFeedbackForm),e.R7$(3),e.JRh(e.bMT(13,12,"remark")),e.R7$(3),e.Y8G("disabled",!n.addFeedbackForm.valid),e.R7$(),e.SpI(" ",e.bMT(17,14,"saveRemark")," ")}}function Rc(t,o){1&t&&(e.j41(0,"div",60)(1,"p",80),e.nrm(2,"i",81),e.EFF(3),e.nI1(4,"translate"),e.k0s()()),2&t&&(e.R7$(3),e.SpI(" ",e.bMT(4,1,"noStudentsBought"),""))}function Fc(t,o){1&t&&(e.j41(0,"div",60)(1,"p",80),e.nrm(2,"i",81),e.EFF(3),e.nI1(4,"translate"),e.k0s()()),2&t&&(e.R7$(3),e.SpI(" ",e.bMT(4,1,"noMaterialFeedback"),""))}function kc(t,o){1&t&&(e.j41(0,"div",82)(1,"p",80),e.nrm(2,"i",81),e.EFF(3),e.nI1(4,"translate"),e.k0s()()),2&t&&(e.R7$(3),e.SpI(" ",e.bMT(4,1,"noMaterialsFound"),""))}function yc(t,o){1&t&&(e.j41(0,"th",27),e.EFF(1),e.nI1(2,"translate"),e.nI1(3,"titleCaseFirstWord"),e.k0s()),2&t&&(e.R7$(),e.JRh(e.bMT(3,3,e.bMT(2,1,"photoVT"))))}function Ec(t,o){if(1&t&&(e.j41(0,"td",28),e.nrm(1,"img",79),e.k0s()),2&t){const n=o.$implicit;e.R7$(),e.Y8G("src",n.student_photo,e.B4B)}}function Sc(t,o){1&t&&(e.j41(0,"th",27),e.EFF(1),e.nI1(2,"translate"),e.nI1(3,"titleCaseFirstWord"),e.k0s()),2&t&&(e.R7$(),e.JRh(e.bMT(3,3,e.bMT(2,1,"promocodeUsed"))))}function $c(t,o){1&t&&(e.j41(0,"p",89),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.JRh(e.bMT(2,1,"yes")))}function Mc(t,o){1&t&&(e.j41(0,"p",90),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.JRh(e.bMT(2,1,"no")))}function wc(t,o){if(1&t&&(e.j41(0,"td",28),e.DNE(1,$c,3,3,"p",87)(2,Mc,3,3,"p",88),e.k0s()),2&t){const n=o.$implicit;e.R7$(),e.Y8G("ngIf",n.promo_code_used),e.R7$(),e.Y8G("ngIf",!n.promo_code_used)}}function jc(t,o){1&t&&e.nrm(0,"tr",40)}function Gc(t,o){1&t&&e.nrm(0,"tr",41)}function Dc(t,o){if(1&t&&(e.j41(0,"table",84),e.qex(1,12),e.DNE(2,yc,4,5,"th",13)(3,Ec,2,1,"td",14),e.bVm(),e.nrm(4,"mat-text-column",85),e.nI1(5,"translate"),e.nI1(6,"titleCaseFirstWord"),e.nrm(7,"mat-text-column",74),e.nI1(8,"translate"),e.nI1(9,"t
3itleCaseFirstWord"),e.nrm(10,"mat-text-column",75),e.nI1(11,"translate"),e.nI1(12,"titleCaseFirstWord"),e.qex(13,86),e.DNE(14,Sc,4,5,"th",13)(15,wc,3,2,"td",14),e.bVm(),e.DNE(16,jc,1,0,"tr",25)(17,Gc,1,0,"tr",26),e.k0s()),2&t){const n=e.XpG(2);e.Y8G("dataSource",n.studentsWhoBought),e.R7$(4),e.Y8G("headerText",e.bMT(6,8,e.bMT(5,6,"examStudentId"))),e.R7$(3),e.Y8G("headerText",e.bMT(9,12,e.bMT(8,10,"firstName"))),e.R7$(3),e.Y8G("headerText",e.bMT(12,16,e.bMT(11,14,"lastName"))),e.R7$(6),e.Y8G("matHeaderRowDef",e.lJ4(18,Qt)),e.R7$(),e.Y8G("matRowDefColumns",e.lJ4(19,Qt))}}function Oc(t,o){if(1&t&&e.DNE(0,Dc,18,20,"table",83),2&t){const n=e.XpG(),i=e.sdS(10);e.Y8G("ngIf",!!n.studentsWhoBought&&n.studentsWhoBought.length>0)("ngIfElse",i)}}function Ac(t,o){1&t&&(e.j41(0,"th",27),e.EFF(1),e.nI1(2,"translate"),e.nI1(3,"titleCaseFirstWord"),e.k0s()),2&t&&(e.R7$(),e.JRh(e.bMT(3,3,e.bMT(2,1,"photoVT"))))}function Nc(t,o){if(1&t&&(e.j41(0,"td",78),e.nrm(1,"img",79),e.k0s()),2&t){const n=o.$implicit;e.R7$(),e.Y8G("src",n.student_photo,e.B4B)}}function Lc(t,o){1&t&&(e.j41(0,"th",27),e.EFF(1),e.nI1(2,"translate"),e.nI1(3,"titleCaseFirstWord"),e.k0s()),2&t&&(e.R7$(),e.JRh(e.bMT(3,3,e.bMT(2,1,"student"))))}function Yc(t,o){if(1&t&&(e.j41(0,"td",78),e.EFF(1),e.nrm(2,"br"),e.EFF(3),e.k0s()),2&t){const n=o.$implicit;e.R7$(),e.SpI(" ",n.student_number,""),e.R7$(2),e.Lme("",n.firstname," ",n.lastname," ")}}function Vc(t,o){1&t&&(e.j41(0,"th",27),e.EFF(1),e.nI1(2,"translate"),e.nI1(3,"titleCaseFirstWord"),e.k0s()),2&t&&(e.R7$(),e.JRh(e.bMT(3,3,e.bMT(2,1,"promocodeUsed"))))}function Pc(t,o){1&t&&(e.j41(0,"p",89),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.JRh(e.bMT(2,1,"yes")))}function Xc(t,o){1&t&&(e.j41(0,"p",90),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.JRh(e.bMT(2,1,"no")))}function Bc(t,o){if(1&t&&(e.j41(0,"td",78),e.DNE(1,Pc,3,3,"p",87)(2,Xc,3,3,"p",88),e.k0s()),2&t){const n=o.$implicit;e.R7$(),e.Y8G("ngIf",n.promo_code_used),e.R7$(),e.Y8G("ngIf",!n.promo_code_used)}}function qc(t,o){1&t&&e.nrm(0,"tr",40)}function Uc(t,o){1&t&&e.nrm(0,"tr",41)}function Jc(t,o){if(1&t&&(e.j41(0,"table",84),e.qex(1,12),e.DNE(2,Ac,4,5,"th",13)(3,Nc,2,1,"td",73),e.bVm(),e.qex(4,91),e.DNE(5,Lc,4,5,"th",13)(6,Yc,4,3,"td",73),e.bVm(),e.qex(7,86),e.DNE(8,Vc,4,5,"th",13)(9,Bc,3,2,"td",73),e.bVm(),e.DNE(10,qc,1,0,"tr",25)(11,Uc,1,0,"tr",26),e.k0s()),2&t){const n=e.XpG(2);e.Y8G("dataSource",n.studentsWhoBought),e.R7$(10),e.Y8G("matHeaderRowDef",e.lJ4(3,zt)),e.R7$(),e.Y8G("matRowDefColumns",e.lJ4(4,zt))}}function Qc(t,o){if(1&t&&e.DNE(0,Jc,12,5,"table",83),2&t){const n=e.XpG(),i=e.sdS(10);e.Y8G("ngIf",!!n.studentsWhoBought&&n.studentsWhoBought.length>0)("ngIfElse",i)}}let zc=(()=>{var t;class o{constructor(){this.materialsService=(0,e.WQX)(Vt),this.toastrService=(0,e.WQX)(w.tw),this.translationService=(0,e.WQX)(m.c$),this.dialogService=(0,e.WQX)(B.bZ)}ngOnInit(){this.studentsWhoBought=[],this.addFeedbackForm=new c.J3({feedback:new c.hs(""),productId:new c.hs("")})}showFeedback(i){this.studentFeedback=[],this.addFeedbackForm.setValue({productId:i,feedback:""}),this.materialsService.getMaterialReviewsList(this.courseId,i).subscribe(({status:a,body:{data:s=[]}})=>{200===a?(this.studentFeedback=s.map(r=>(r.order_date=(0,N.I1)(r.order_date,P.x.iso.dateTimeShort).format(P.x.display.dateTime),r)),this.openFeedbackDialog()):404===a&&(this.studentFeedback=[],this.openFeedbackDialog())},a=>{this.studentFeedback=[],this.openFeedbackDialog()})}showStudentsBought(i){this.studentsWhoBought=[],this.materialsService.getStudentsBoughtByMaterial(this.courseId,i).subscribe(({status:a,body:{data:s=[]}})=>{const{product_name:r="",product_image:l=""}=this.items.find(p=>+p.product_id==+i);this.studentsWhoBoughtModalTitle=r,this.studentsWhoBoughtModalImage=l,200===a?this.studentsWhoBought=s:404===a&&(this.studentsWhoBought=[]),this.openStudentWhoBoughtDialog()},a=>{const{product_name:s="",product_image:r=""}=this.items.find(l=>+l.product_id==+i);this.studentsWhoBoughtModalTitle=s,this.studentsWhoBoughtModalImage=r,this.studentsWhoBought=[],this.openStudentWhoBoughtDialog()})}addReview(){this.materialsService.addReviewToMaterial(this.addFeedbackForm.value).subscribe(({status:i,body:{data:{coursematerial_id:a=0}}})=>{200===i&&+a>
30&&(this.showFeedback(+a),this.dialogRef.close())},i=>{this.toastrService.error(this.translationService.instant("errorLabel"),"Error")})}openFeedbackDialog(){this.dialogRef=this.dialogService.open(oe.m,{data:{type:me.m6.info,template:this.feedbackDialog},panelClass:["material-modal","col-12","col-lg-6"],autoFocus:!1})}openStudentWhoBoughtDialog(){const i={data:{header:this.translationService.instant("studentsWhoBoughtTitle",{item:this.studentsWhoBoughtModalTitle}),template:this.studentsWhoBoughtDialog},panelClass:["material-modal","col-12","col-lg-6"]};this.dialogService.open(oe.m,i)}}return(t=o).\u0275fac=function(i){return new(i||t)},t.\u0275cmp=e.VBU({type:t,selectors:[["app-teacher-coursematerials-table"]],viewQuery:function(i,a){if(1&i&&(e.GBs(Jl,7),e.GBs(Ql,7)),2&i){let s;e.mGM(s=e.lsd())&&(a.studentsWhoBoughtDialog=s.first),e.mGM(s=e.lsd())&&(a.feedbackDialog=s.first)}},inputs:{items:"items",courseId:"courseId",mobileView:"mobileView"},decls:19,vars:3,consts:[["desktop",""],["mobile",""],["studentsWhoBoughtDialog",""],["feedbackDialog",""],["noStudentsBought",""],["noReviews",""],["noItems",""],["studentsWhoBoughtmodalDesktop",""],["studentsWhoBoughtmodalMobile",""],[4,"ngIf","ngIfThen","ngIfElse"],["mat-table","","class","borderless",3,"dataSource",4,"ngIf","ngIfElse"],["mat-table","",1,"borderless",3,"dataSource"],["matColumnDef","photo"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","","width","15%",4,"matCellDef"],["name","product_name",3,"headerText"],["matColumnDef","price"],["mat-cell","","width","25%",4,"matCellDef"],["matColumnDef","amountWhoBought"],["mat-cell","","width","20%",4,"matCellDef"],["matColumnDef","feedback"],["mat-header-cell","","class","text-center",4,"matHeaderCellDef"],["mat-cell","","class","text-center",4,"matCellDef"],["matColumnDef","website"],["mat-cell","","class","text-center","width","10%",4,"matCellDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mat-header-cell",""],["mat-cell","","width","15%"],["alt","thumbnail","appOnErrorImage","",2,"width","var(--size-150px)",3,"src"],["mat-cell","","width","25%"],["mat-cell","","width","20%"],[1,"underline",3,"click"],["mat-header-cell","",1,"text-center"],["mat-cell","",1,"text-center"],["width","10%",3,"click"],[1,"fas","fa-comment","fa-2x"],["mat-cell","","width","10%",1,"text-center"],["target","_blank",1,"text-center"],[1,"fa-globe-europe","fas","fa-2x"],["mat-header-row",""],["mat-row",""],["matColumnDef","expand"],["mat-header-cell","","class","row",4,"matHeaderCellDef"],["mat-cell","","colspan","3","class","px-0",4,"matCellDef"],["mat-header-cell","",1,"row"],[1,"col-6"],[1,"col-4","pl-0"],["mat-cell","","colspan","3",1,"px-0"],[1,"px-0","pr-2"],["alt","thumbnail","appOnErrorImage","",1,"col-6",2,"width","var(--size-100px)",3,"src"],[1,"col-4","mr-5","mobileAccordionHeader"],[1,"my-3"],[1,"pl-0","w-50"],[1,"px-0","py-3","pl-3"],[1,"pl-0","w-50","uppercase-first-letter"],[3,"click"],[1,"fa-comment","fas","fa-2x"],["target","_blank",1,"text-reset"],["mat-dialog-content",""],[1,"row"],["alt","","class","rounded float-left","height","200px","appOnErrorImage","",3,"src",4,"ngIf"],[3,"ngTemplateOutlet"],["alt","","height","200px","appOnErrorImage","",1,"rounded","float-left",3,"src"],[1,"font-weight-bold","title-color","uppercase-first-letter"],["mat-table","","class","table-striped",3,"dataSource",4,"ngIf","ngIfElse"],[1,"feedBackAddForm"],["id","myModalLabel",1,"modal-title","w-100","font-weight-bold","title-color"],[3,"ngSubmit","formGroup"],["appearance","fill"],["matInput","","required","","formControlName","feedback"],["mat-raised-button","","color","primary","type","submit",1,"pull-right",3,"disabled"],["mat-table","",1,"table-striped",3,"dataSource"],["mat-cell","",4,"matCellDef"],["name","firstname",3,"headerText"],["name","lastname",3,"headerText"],["name","given_review",3,"headerText"],["name","order_date",3,"headerText"],["mat-cell",""],["alt","thumbnail","appOnErrorImage","","imgType","user",1,"rounded-circle",2,"width","var(--size-65px)","height","var(--size-65px)",3,"src"],[1,"pl-5","noStudentsBoughttext"],[1,"fa-info-circle","fas"],[1,"row","noItemsFound"],["mat-table","",3,"dataSource",4,"ngIf","ngIfElse"],["mat-table","",3,"dataSource"],["name","student_number",3,"headerText"],["matColumnDef","promocodeUsed"],["class","text-success align-middle mb-0 font-weight-bold",4,"ngIf"],["class","text-danger align-middle mb-0 font-weight-bold",4,"ngIf"],[1,"text-success","align-middle","mb-0","font-weight-bold"],[1,"text-danger","align-middle","mb-0","font-weight-bold"],["matColumnDef","student"]],template:function(i,a){if(1&i&&e.DNE(0,zl,1,0,"div",9)(1,cc,1,2,"ng-template",null,0,e.C5r)(3,hc,1,2,"ng-template",null,1,e.C5r)(5,gc,4,2,"ng-template",null,2,e.C5r)(7,Ic,18,16,"ng-template",null,3,e.C5r)(9,Rc,5,3,"ng-template",null,4,e.C5r)(11,Fc,5,3,"ng-template",null,5,e.C5r)(13,kc,5,3,"ng-template",null,6,e.C5r)(15,Oc,1,2,"ng-template",null,7,e.C5r)(17,Qc,1,2,"ng-template",null,8,e.C5r),2&i){const s=e.sdS(2),r=e.sdS(4);e.Y8G("ngIf",a.mobileView)("ngIfThen",r)("ngIfElse",s)}},dependencies:[u.bT,u.T3,c.qT,c.me,c.BC,c.cb,c.YS,c.j4,c.JD,b.Zl,b.tL,b.ji,b.cC,b.YV,b.iL,b.KS,b.$R,b.YZ,b.NB,b.Ez,H.BS,H.GK,H.Z2,H.WN,E.$z,ne.fg,A.rl,A.nJ,B.Yi,Ne.e,m.D9,Pt.u,Fe.p],styles:[".studentsBoughtModalContainer[_ngcontent-%COMP%], .feedBackModalContainer[_ngcontent-%COMP%]{min-width:var(--size-fit-content)!important}.no-border[_ngcontent-%COMP%]{border-bottom:var(--border-style-none)!important}.pull-right[_ngcontent-%COMP%]{float:right!important}.materialstable[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .materialstable[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{font-size:var(--font-size-100)!important}.underline[_ngcontent-%COMP%]{-webkit-text-decoration:var(--text-decoration-underline)!important;text-decoration:var(--text-decoration-underline)!important}.noStudentsBoughttext[_ngcontent-%COMP%]{font-size:var(--font-size-100)!important}.noStudentsBoughttext[_ngcontent-%COMP%]{margin-left:var(--space-auto)!important;margin-right:var(--space-auto)!important}.mobileAccordionHeader[_ngcontent-%COMP%]{font-weight:var(--font-weight-normal)!important;font-size:var(--font-size-100)!important;color:var(--color-title)}.fixPadding[_ngcontent-%COMP%]{padding-left:var(--space-3rem)}\n\n/*# sourceMappingURL=teacher-coursematerials-table.component.css.map*/"]}),o})();const Se=()=>[];function Wc(t,o){1&t&&e.nrm(0,"div")}function Hc(t,o){if(1&t&&(e.j41(0,"div",10)(1,"div",6)(2,"h4",11),e.EFF(3),e.nI1(4,"translate"),e.nI1(5,"titleCaseFirstWord"),e.k0s(),e.j41(6,"div",12)(7,"h5",13),e.EFF(8),e.nI1(9,"translate"),e.nI1(10,"titleCaseFirstWord"),e.k0s(),e.nrm(11,"app-teacher-coursematerials-table",14),e.k0s()(),e.j41(12,"div",6)(13,"h4",11),e.EFF(14),e.nI1(15,"translate"),e.nI1(16,"titleCaseFirstWord"),e.k0s(),e.j41(17,"div",12)(18,"h5",13),e.EFF(19),e.nI1(20,"translate"),e.nI1(21,"titleCaseFirstWord"),e.k0s(),e.nrm(22,"app-teacher-coursematerials-table",14),e.k0s(),e.j41(23,"div",12)(24,"h5",13),e.EFF(25),e.nI1(26,"translate"),e.nI1(27,"titleCaseFirstWord"),e.k0s(),e.nrm(28,"app-teacher-coursematerials-table",14),e.k0s(),e.j41(29,"div",12)(30,"h5",13),e.EFF(31),e.nI1(32,"translate"),e.nI1(33,"titleCaseFirstWord"),e.k0s(),e.nrm(34,"app-teacher-coursematerials-table",14),e.k0s()()()),2&t){const n=e.XpG(2);e.R7$(3),e.JRh(e.bMT(5,20,e.bMT(4,18,"mandatory"))),e.R7$(5),e.JRh(e.bMT(10,24,e.bMT(9,22,"beforehand"))),e.R7$(3),e.Y8G("mobileView",n.mobileUser)("courseId",n.courseId)("items",n.materialsList.MANDATORY_BEFORE_COURSE||e.lJ4(42,Se)),e.R7$(3),e.JRh(e.bMT(16,28,e.bMT(15,26,"optional"))),e.R7$(5),e.JRh(e.bMT(21,32,e.bMT(20,30,"beforehand"))),e.R7$(3),e.Y8G("mobileView",n.mobileUser)("courseId",n.courseId)("items",n.materialsList.OPTIONAL_BEFORE_COURSE||e.lJ4(43,Se)),e.R7$(3),e.JRh(e.bMT(27,36,e.bMT(26,34,"during"))),e.R7$(3),e.Y8G("mobileView",n.mobileUser)("courseId",n.courseId)("items",n.materialsList.OPTIONAL_DURING_COURSE||e.lJ4(44,Se)),e.R7$(3),e.JRh(e.bMT(33,40,e.bMT(32,38,"after"))),e.R7$(3),e.Y8G("mobileView",n.mobileUser)("courseId",n.courseId)("items",n.materialsList.OPTIONAL_AFTER_COURSE||e.lJ4(45,Se))}}function Kc(t,o){if(1&t&&e.DNE(0,Hc,35,46,"div",9),2&t){const n=e.XpG();e.Y8G("ngIf",n.materialsLoaded)}}function Zc(t,o){if(1&t&&(e.j41(0,"div",10)(1,"mat-accordion",15)(2,"mat-expansion-panel")(3,"mat-expansion-panel-header",16)(4,"span",17),e.EFF(5),e.nI1(6,"translate"),e.nI1(7,"titleCaseFirstWord"),e.k0s()(),e.j41(8,"div",18)(9,"h5",19),e.EFF(10),e.nI1(11,"translate"),e.nI1(12,"titleCaseFirstWord"),e.k0s(),e.nrm(13,"app-teacher-coursematerials-table",20),e.k0s()(),e.j41(14,"mat-expansion-panel")(15,"mat-expansion-panel-header",16)(16,"span",17),e.EFF(17),e.nI1(18,"translate"),e.nI1(19,"titleCaseFirstWord"),e.k0s()(),e.j41(20,"div",18)(21,"h5",19),e.EFF(22),e.nI1(23,"translate"),e.nI1(24,"titleCaseFirstWord"),e.k0s(),e.nrm(25,"app-teacher-coursematerials-table",20),e.k0s(),e.j41(26,"div",18)(27,"h5",19),e.EFF(28),e.nI1(29,"translate"),e.nI1(30,"titleCaseFirstWord"),e.k0s(),e.nrm(31,"app-teacher-coursematerials-table",20),e.k0s(),e.j41(32,"div",18)(33,"h5",19),e.EFF(34),e.nI1(35,"translate"),e.nI1(36,"titleCaseFirstWord"),e.k0s(),e.nrm(37,"app-teacher-coursematerials-table",20),e.k0s()()()()),2&t){const n=e.XpG(2);e.R7$(5),e.JRh(e.bMT(7,20,e.bMT(6,18,"mandatory"))),e.R7$(5),e.JRh(e.bMT(12,24,e.bMT(11,22,"beforehand"))),e.R7$(3),e.Y8G("mobileView",n.mobileUser)("courseId",n.courseId)("items",n.materialsList.MANDATORY_BEFORE_COURSE||e.lJ4(42,Se)),e.R7$(4),e.JRh(e.bMT(19,28,e.bMT(18,26,"optional"))),e.R7$(5),e.JRh(e.bMT(24,32,e.bMT(23,30,"beforehand"))),e.R7$(3),e.Y8G("mobileView",n.mobileUser)("courseId",n.courseId)("items",n.materialsList.OPTIONAL_BEFORE_COURSE||e.lJ4(43,Se)),e.R7$(3),e.JRh(e.bMT(30,36,e.bMT(29,34,"during"))),e.R7$(3),e.Y8G("mobileView",n.mobileUser)("courseId",n.courseId)("items",n.materialsList.OPTIONAL_DURING_COURSE||e.lJ4(44,Se)),e.R7$(3),e.JRh(e.bMT(36,40,e.bMT(35,38,"after"))),e.R7$(3),e.Y8G("mobileView",n.mobileUser)("courseId",n.courseId)("items",n.materialsList.OPTIONAL_AFTER_COURSE||e.lJ4(45,Se))}}function em(t,o){if(1&t&&e.DNE(0,Zc,38,46,"div",9),2&t){const n=e.XpG();e.Y8G("ngIf",n.materialsLoaded)}}let tm=(()=>{var t;class o{constructor(i,a,s,r){this.materialsService=i,this.configService=a,this.deviceService=s,this.teacherService=r,this.materialsLoaded=!1,this.mobileUser=!1}ngOnInit(){this.courseSub$=this.teacherService.getCurrentCourse().subscribe(i=>{this.courseId=i.id,this.courseName=i.courseName,this.loadMaterialsList()}),this.mobileUser=!this.deviceService.isDesktop()}loadMaterialsList(){this.materialsService.getMaterialsList(this.courseId).subscribe(({status:i,body:{data:a=[]}})=>{200===i&&(this.materialsList=a.reduce((s,r)=>{const l=r.type;return r.product_image="".concat(this.configService.getFastcrmUrl()).concat(r.product_image),s["".concat(l)]?s["".concat(l)]=[...s["".concat(l)],r]:s["".concat(l)]=[r],s},{}),this.materialsLoaded=!0)},({status:i=400})=>{404===i&&(this.materialsLoaded=!0,this.materialsList={MANDATORY_BEFORE_COURSE:[],OPTIONAL_AFTER_COURSE:[],OPTIONAL_BEFORE_COURSE:[],OPTIONAL_DURING_COURSE:[]})})}ngOnDestroy(){this.courseSub$.unsubscribe()}}return(t=o).\u0275fac=function(i){return new(i||t)(e.rXU(Vt),e.rXU(Ce.w
3),e.rXU(ge.Kg),e.rXU(S.O))},t.\u0275cmp=e.VBU({type:t,selectors:[["app-teacher-coursematerials"]],decls:16,vars:11,consts:[["desktop",""],["mobile",""],[1,"row","py-3","mb-3","background-color"],[1,"col-12","col-md-6"],[1,"mb-0","text-white"],[1,"row","pb-4"],[1,"col-12"],[1,"pl-5","pr-5"],[4,"ngIf","ngIfThen","ngIfElse"],["ngClass","materialsList",4,"ngIf"],["ngClass","materialsList"],[1,"font-weight-bold","mb-3"],[1,"col-12","row"],[1,"ecampus-title","d-inline-block"],["ngClass","col-12",3,"mobileView","courseId","items"],["multi","",1,"col-12","pl-0","pr-0"],[1,"text-dark"],[1,"font-weight-bold"],[1,"col-12","row","pl-0","pr-0"],[1,"ml-3","ecampus-title","d-inline-block"],["ngClass","col-12 pl-0 pr-0",3,"mobileView","courseId","items"]],template:function(i,a){if(1&i&&(e.j41(0,"div",2)(1,"div",3)(2,"h5",4),e.EFF(3),e.nI1(4,"translate"),e.nI1(5,"titleCaseFirstWord"),e.k0s()()(),e.j41(6,"div",5)(7,"div",6)(8,"p",7),e.EFF(9),e.nI1(10,"translate"),e.k0s(),e.DNE(11,Wc,1,0,"div",8)(12,Kc,1,1,"ng-template",null,0,e.C5r)(14,em,1,1,"ng-template",null,1,e.C5r),e.k0s()()),2&i){const s=e.sdS(13),r=e.sdS(15);e.R7$(3),e.JRh(e.bMT(5,7,e.bMT(4,5,"courseMaterials"))),e.R7$(6),e.SpI(" ",e.bMT(10,9,"teacherCourseMaterialIntroText")," "),e.R7$(2),e.Y8G("ngIf",a.mobileUser)("ngIfThen",r)("ngIfElse",s)}},dependencies:[u.YU,u.bT,H.BS,H.GK,H.Z2,zc,m.D9,Fe.p],styles:[".materialsList[_ngcontent-%COMP%]{min-width:var(--size-100-percent)}\n\n/*# sourceMappingURL=teacher-coursematerials.component.css.map*/"]}),o})();const nm=()=>({header:"bookingResponsible",email:"[email protected]"}),im=()=>({header:"invoices.invoices",email:"[email protected]"});function am(t,o){if(1&t){const n=e.RV6();e.j41(0,"div",3)(1,"p",4),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.j41(4,"div",7)(5,"a",5),e.nI1(6,"translate"),e.EFF(7),e.k0s(),e.j41(8,"i",8),e.nI1(9,"translate"),e.bIt("click",function(){const a=e.eBV(n).email,s=e.XpG();return e.Njj(s.copyEmail(a))}),e.k0s()()()}if(2&t){const n=o.header,i=o.email;e.R7$(2),e.JRh(e.bMT(3,5,n)),e.R7$(3),e.Y8G("href","mailto:"+i,e.B4B)("matTooltip",e.bMT(6,7,"contactUsEcampus")),e.R7$(2),e.SpI(" ",i," "),e.R7$(),e.Y8G("matTooltip",e.bMT(9,9,"cpCopyLinkButton"))}}let om=(()=>{var t;class o{constructor(){this.toastrService=(0,e.WQX)(w.tw),this.translateService=(0,e.WQX)(m.c$),this.websiteService=(0,e.WQX)(Ae.j),this.phoneNumber=this.websiteService.getWebsitePhoneNumber()}copyEmail(i){navigator&&navigator.clipboard&&navigator.clipboard.writeText&&(navigator.clipboard.writeText(i),this.toastrService.success(this.translateService.instant("copied")))}}return(t=o).\u0275fac=function(i){return new(i||t)},t.\u0275cmp=e.VBU({type:t,selectors:[["app-contact-info"]],decls:13,vars:15,consts:[["email",""],[1,"container"],[1,"row"],[1,"col-12","my-2"],[1,"m-0"],[1,"underline",3,"href","matTooltip"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"d-flex","justify-content-between"],[1,"fa-regular","fa-copy","c-p",3,"click","matTooltip"]],template:function(i,a){if(1&i&&(e.j41(0,"div",1)(1,"div",2)(2,"div",3)(3,"p",4),e.EFF(4),e.nI1(5,"translate"),e.k0s(),e.j41(6,"a",5),e.nI1(7,"translate"),e.EFF(8),e.k0s()(),e.eu8(9,6)(10,6),e.DNE(11,am,10,11,"ng-template",null,0,e.C5r),e.k0s()()),2&i){const s=e.sdS(12);e.R7$(4),e.JRh(e.bMT(5,9,"office")),e.R7$(2),e.Mz_("href","tel:",a.phoneNumber,"",e.B4B),e.Y8G("matTooltip",e.bMT(7,11,"callTheSecretariat")),e.R7$(2),e.SpI(" ",a.phoneNumber," "),e.R7$(),e.Y8G("ngTemplateOutlet",s)("ngTemplateOutletContext",e.lJ4(13,nm)),e.R7$(),e.Y8G("ngTemplateOutlet",s)("ngTemplateOutletContext",e.lJ4(14,im))}},dependencies:[u.T3,Re.oV,m.D9],encapsulation:2}),o})();var sm=f(48384),rm=f(99353);const lm=t=>({"text-danger":t}),cm=t=>({max:t}),mm=t=>({min:t});
3function pm(t,o){if(1&t&&(e.j41(0,"span",14),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t){const n=e.XpG(2);e.R7$(),e.SpI(" ",e.i5U(2,1,"formValidation.tooLong",e.eq3(4,cm,n.maxMessageLength))," ")}}function dm(t,o){if(1&t&&(e.j41(0,"span",14),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t){const n=e.XpG(2);e.R7$(),e.SpI(" ",e.i5U(2,1,"formValidation.tooShort",e.eq3(4,mm,n.minMessageLength))," ")}}function um(t,o){1&t&&(e.j41(0,"span",14),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"formValidation.noOnlyWhiteSpaces")," "))}function _m(t,o){if(1&t&&(e.qex(0),e.j41(1,"mat-error",12),e.DNE(2,pm,3,6,"span",13)(3,dm,3,6,"span",13)(4,um,3,3,"span",13),e.k0s(),e.bVm()),2&t){const n=e.XpG();e.R7$(2),e.Y8G("ngIf",n.message.value.length>n.maxMessageLength),e.R7$(),e.Y8G("ngIf",n.message.value.length<n.minMessageLength),e.R7$(),e.Y8G("ngIf",n.message.errors.actualLength)}}let hm=(()=>{var t;class o{constructor(){var i;this.formBuilder=(0,e.WQX)(c.ze),this.helperService=(0,e.WQX)(Ee.w),this.translateService=(0,e.WQX)(m.c$),this.teacherService=(0,e.WQX)(S.O),this.toastrService=(0,e.WQX)(w.tw),this.data=(0,e.WQX)(me.y2),this.importantMessage=null,this.minMessageLength=25,this.maxMessageLength=2e3,this.isFormSubmitting=!1,this.importantMessageForm=this.formBuilder.group({message:[(null===(i=this.importantMessage)||void 0===i?void 0:i.message)||"",[c.k0.required,
3c.k0.minLength(this.minMessageLength),c.k0.maxLength(this.maxMessageLength),(0,ct.e)()]]}),this.destroy$=new y.B}get message(){return this.importantMessageForm.get("message")}ngOnInit(){this.importantMessage=this.data,!this.helperService.isEmptyObj(this.importantMessage)&&this.importantMessage.message&&this.importantMessageForm.patchValue({message:this.importantMessage.message})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}submitForm(){const{message:i}=this.importantMessageForm.value,{courseId:a,id:s}=this.importantMessage;this.isFormSubmitting=!0,this.importantMessage.edit?this.teacherService.patchImportantMessage(a,s,i).pipe((0,I.Q)(this.destroy$)).subscribe(r=>this.handleResponse(r)):this.teacherService.postImportantMessage(a,i).pipe((0,I.Q)(this.destroy$)).subscribe(r=>this.handleResponse(r))}handleResponse(i){if(this.isFormSubmitting=!1,!i||i.success)return this.importantMessage.dialogRef.close(),void this.toastrService.success(this.translateService.instant("successLabel"));this.toastrService.error(i.error.message)}}return(t=o).\u0275fac=function(i){return new(i||t)},t.\u0275cmp=e.VBU({type:t,selectors:[["app-edit-important-message"]],decls:17,vars:13,consts:[["mat-dialog-content",""],[1,"row"],[1,"col-12",3,"formGroup"],[1,"col-12","my-3"],["controlName","message",3,"form"],[1,"col-12"],[1,"form-errors"],[1,"text-right","position-relative",3,"ngClass"],[4,"ngIf"],["mat-dialog-actions","","align","end"],["type","button","mat-raised-button","","color","primary-inverted","aria-label","Close","matDialogClose",""],["type","button","mat-raised-button","","color","primary","aria-label","Close","data-cy","important-message-submit",1,"text-white",3,"click","disabled"],[1,"w-100","text-right","text-danger","wysiwyg-errors"],["class","m-0",4,"ngIf"],[1,"m-0"]],template:function(i,a){1&i&&(e.j41(0,"div",0)(1,"div",1)(2,"form",2)(3,"div",1)(4,"div",3),e.nrm(5,"app-wysiwyg-editor",4),e.k0s(),e.j41(6,"div",5)(7,"div",6)(8,"p",7),e.DNE(9,_m,5,3,"ng-container",8),e.k0s()()()()()()(),e.j41(10,"div",9)(11,"button",10),e.EFF(12),e.nI1(13,"translate"),e.k0s(),e.j41(14,"button",11),e.bIt("click",function(){return a.submitForm()}),e.EFF(15),e.nI1(16,"translate"),e.k0s()()),2&i&&(e.R7$(2),e.Y8G("formGroup",a.importantMessageForm),e.R7$(3),e.Y8G("form",a.importantMessageForm),e.R7$(3),e.Y8G("ngClass",e.eq3(11,lm,a.importantMessageForm.invalid||a.message.value.length>a.maxMessageLength||a.message.value.length<a.minMessageLength)),e.R7$(),e.Y8G("ngIf",a.importantMessageForm.invalid&&(a.importantMessageForm.dirty||a.importantMessageForm.touched)),e.R7$(3),e.SpI(" ",e.bMT(13,7,"cancel")," "),e.R7$(2),e.Y8G("disabled",a.isFormSubmitting||a.importantMessageForm.invalid||a.importantMessageForm.pristine),e.R7$(),e.SpI(" ",e.bMT(16,9,"save")," "))},dependencies:[u.YU,u.bT,c.qT,c.cb,c.j4,E.$z,A.TL,B.tx,B.E7,B.Yi,rm.e,m.D9],styles:[".wysiwyg-errors[_ngcontent-%COMP%]{position:relative;top:var(--space-0)}\n\n/*# sourceMappingURL=edit-important-message.component.css.map*/"]}),o})();var fm=f(33285),gm=f(86241),vm=f(39917),tt=f(86060),bm=f(55731),Wt=f(33753);const Tm=(t,o,n)=>[t,o,n],Cm=t=>({"p-3":t}),xm=(t,o)=>({"c-p":t,"bg-light-grey not-allowed":o}),Im=(t,o)=>[t,o],Rm=t=>["/teacher/ecampus/virtual-room/",t],Ht=t=>({"delete-loading":t}),Fm=t=>[t];function km(t,o){1&t&&e.nrm(0,"app-spinner")}function ym(t,o){if(1&t&&(e.j41(0,"span"),e.EFF(1),e.k0s()),2&t){const n=e.XpG(3);e.R7$(),e.E5c("",null==n.course||null==n.course.campus?null:n.course.campus.address," ",null==n.course||null==n.course.campus?null:n.course.campus.addressNumber," ",null==n.course||null==n.course.campus?null:n.course.campus.city,"")}}function Em(t,o){if(1&t&&e.EFF(0),2&t){const n=e.XpG(3);e.SpI(" ",null==n.course||null==n.course.campus?null:n.course.campus.city," ")}}function Sm(t,o){if(1&t&&(e.j41(0,"p"),e.nrm(1,"i",34),e.j41(2,"strong"),e.EFF(3),e.nI1(4,"translate"),e.nI1(5,"translate"),e.k0s(),e.j41(6,"a",35),e.nI1(7,"routeT"),e.DNE(8,ym,2,3,"span",36)(9,Em,1,1,"ng-template",null,1,e.C5r),e.k0s()()),2&t){const n=e.sdS(10),i=e.XpG(2);e.R7$(3),e.Lme("",e.bMT(4,6,"address"),"",e.bMT(5,8,"typography.colon"),""),e.R7$(3),e.Y8G("routerLink","virtual"!==i.course.subtype?e.l_i(12,Im,e.bMT(7,10,"/campus"),null==i.course||null==i.course.campus?null:i.course.campus.id):e.eq3(15,Rm,i.course.id))("target","virtual"!==i.course.subtype&&"_blank"),e.R7$(2),e.Y8G("ngIf","virtual"!==i.course.subtype)("ngIfElse",n)}}function $m(t,o){if(1&t&&(e.j41(0,"p"),e.nrm(1,"i",37),e.j41(2,"strong"),e.EFF(3),e.nI1(4,"translate"),e.nI1(5,"translate"),e.k0s(),e.j41(6,"span"),e.EFF(7),e.k0s()()),2&t){const n=e.XpG(3);e.R7$(3),e.Lme("",e.bMT(4,3,"local"),"",e.bMT(5,5,"typography.colon"),""),e.R7$(4),e.SpI(" ",n.course.nextClass.classRoomName," ")}}
3function Mm(t,o){if(1&t&&(e.qex(0),e.DNE(1,$m,8,7,"p",4),e.bVm()),2&t){const n=e.XpG(2);e.R7$(),e.Y8G("ngIf",n.course.nextClass.classRoomName)}}function wm(t,o){if(1&t&&(e.qex(0),e.j41(1,"strong"),e.EFF(2),e.nI1(3,"translate"),e.nI1(4,"translate"),e.k0s(),e.j41(5,"span"),e.EFF(6),e.nI1(7,"localeDateString"),e.nI1(8,"titleCaseFirstWord"),e.k0s(),e.bVm()),2&t){const n=e.XpG(3);e.R7$(2),e.Lme("",e.bMT(3,3,"nextLesson"),"",e.bMT(4,5,"typography.colon"),""),e.R7$(4),e.SpI(" ",e.bMT(8,9,e.bMT(7,7,n.course.nextClass.date))," ")}}function jm(t,o){if(1&t&&(e.qex(0),e.j41(1,"strong"),e.EFF(2),e.nI1(3,"translate"),e.nI1(4,"translate"),e.k0s(),e.j41(5,"span"),e.EFF(6),e.nI1(7,"localeDateString"),e.nI1(8,"titleCaseFirstWord"),e.k0s(),e.bVm()),2&t){const n=e.XpG(4);e.R7$(2),e.Lme("",e.bMT(3,3,"startingDateLabel"),"",e.bMT(4,5,"typography.colon"),""),e.R7$(4),e.SpI(" ",e.bMT(8,9,e.bMT(7,7,n.course.startDate))," ")}}function Gm(t,o){if(1&t&&e.DNE(0,jm,9,11,"ng-container",4),2&t){const n=e.XpG(3);e.Y8G("ngIf",!n.course.courseStarted)}}function Dm(t,o){1&t&&(e.qex(0),e.j41(1,"strong"),e.EFF(2),e.nI1(3,"translate"),e.nI1(4,"translate"),e.k0s(),e.j41(5,"strong",39),e.EFF(6),e.nI1(7,"translate"),e.k0s(),e.bVm()),2&t&&(e.R7$(2),e.Lme("",e.bMT(3,3,"nextLesson"),"",e.bMT(4,5,"typography.colon"),""),e.R7$(4),e.JRh(e.bMT(7,7,"lessonsHasEnded")))}function Om(t,o){if(1&t&&(e.j41(0,"p"),e.nrm(1,"i",38),e.DNE(2,wm,9,11,"ng-container",36)(3,Gm,1,1,"ng-template",null,2,e.C5r)(5,Dm,8,9,"ng-container",4),e.k0s()),2&t){const n=e.sdS(4),i=e.XpG(2);e.R7$(2),e.Y8G("ngIf",null==i.course||null==i.course.nextClass?null:i.course.nextClass.date)("ngIfElse",n),e.R7$(3),e.Y8G("ngIf",i.course.courseEnded)}}function Am(t,o){if(1&t&&(e.j41(0,"p"),e.nrm(1,"i",40),e.j41(2,"strong"),e.EFF(3),e.nI1(4,"translate"),e.nI1(5,"translate"),e.nI1(6,"translate"),e.k0s(),e.j41(7,"span"),e.EFF(8),e.k0s()()),2&t){const n=e.XpG(2);e.R7$(3),e.E5c("",e.bMT(4,4,"cmpTotal")," ",e.bMT(5,6,"students"),"",e.bMT(6,8,"typography.colon"),""),e.R7$(5),e.SpI(" ",n.course.coursenumberOfStudents," ")}}function Nm(t,o){if(1&t){const n=e.RV6();e.j41(0,"div",41)(1,"div",42)(2,"div",43)(3,"h5")(4,"strong"),e.EFF(5),e.nI1(6,"translate"),e.k0s()()(),e.j41(7,"div",43)(8,"div",44),e.EFF(9),e.nI1(10,"dateformat"),e.j41(11,"button",45),e.nI1(12,"translate"),e.bIt("click",function(){e.eBV(n);const a=e.XpG(2);
3return e.Njj(a.setImportantMessage(a.importantMessage))}),e.nrm(13,"i",46),e.j41(14,"span"),e.EFF(15),e.nI1(16,"translate"),e.k0s()(),e.j41(17,"button",47,3),e.nI1(19,"translate"),e.bIt("click",function(){e.eBV(n);const a=e.XpG(2);return e.Njj(a.promptRemoveMessage(a.importantMessage))}),e.nrm(20,"i",48)(21,"div",49),e.k0s()()(),e.j41(22,"div",50),e.nrm(23,"app-read-more-less",51),e.k0s()()()}if(2&t){const n=e.XpG(2);e.R7$(5),e.SpI(" ",e.bMT(6,11,"importantMessage.message")," "),e.R7$(4),e.SpI(" ",e.bMT(10,13,null==n.importantMessage?null:n.importantMessage.dateCreated)," "),e.R7$(2),e.FS9("matTooltip",e.bMT(12,15,"edit")),e.Y8G("disabled",n.deleteLoading),e.R7$(4),e.JRh(e.bMT(16,17,"edit")),e.R7$(2),e.FS9("matTooltip",e.bMT(19,19,"delete")),e.Y8G("disabled",n.deleteLoading),e.R7$(3),e.Y8G("ngClass",e.eq3(21,Ht,n.deleteLoading)),e.R7$(),e.Y8G("ngClass",e.eq3(23,Ht,n.deleteLoading)),e.R7$(2),e.Y8G("text",n.importantMessage.message)("characters",250)}}function Lm(t,o){1&t&&e.nrm(0,"i",52)}function Ym(t,o){1&t&&e.nrm(0,"i",53)}function Vm(t,o){if(1&t&&(e.j41(0,"div",6)(1,"section"),e.qex(2),e.j41(3,"h4",17),e.EFF(4),e.nI1(5,"translate"),e.k0s(),e.nrm(6,"app-lesson-table",54),e.bVm(),e.k0s()()),2&t){const n=e.XpG(2);e.R7$(4),e.SpI(" ",e.bMT(5,4,"lessonDays")," "),e.R7$(2),e.Y8G("courseDatesOfClasses",n.course.lessons)("nextClass",n.course.nextClass)("activeOnline",1===n.course.activeOnline||"virtual"===n.course.subtype)}}function Pm(t,o){1&t&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.JRh(e.bMT(2,1,"typography.comma")))}function Xm(t,o){if(1&t&&(e.j41(0,"span")(1,"a",59),e.nI1(2,"translate"),e.nI1(3,"lowercase"),e.nI1(4,"lowercase"),e.EFF(5),e.k0s(),e.DNE(6,Pm,3,3,"span",4),e.k0s()),2&t){const n=o.$implicit,i=o.last,a=e.XpG(4);e.R7$(),e.Y8G("href",e.eq3(9,Fm,"/"+e.bMT(3,5,e.bMT(2,3,"courseFilter"))+"/"+e.bMT(4,7,n.CourseName)+"/"+n.courseCode),e.B4B),e.R7$(4),e.SpI(" ",n.CourseName," "),e.R7$(),e.Y8G("ngIf",(null==a.course?null:a.course.partOfAllround.length)>1&&!i)}}function Bm(t,o){if(1&t&&(e.j41(0,"p")(1,"strong",57),e.EFF(2),e.nI1(3,"translate"),e.nI1(4,"titleCaseFirstWord"),e.k0s(),e.DNE(5,Xm,7,11,"span",58),e.k0s()),2&t){const n=e.XpG(3);e.R7$(2),e.JRh(e.bMT(4,4,e.bMT(3,2,"partOfAllround"))),e.R7$(3),e.Y8G("ngForOf",n.course.partOfAllround)}}function qm(t,o){if(1&t&&(e.j41(0,"div",6)(1,"section")(2,"h4",17),e.EFF(3),e.nI1(4,"translate"),e.nI1(5,"translate"),e.k0s(),e.j41(6,"div",55),e.nrm(7,"p",56),e.nI1(8,"sanitize"),e.DNE(9,Bm,6,6,"p",4),e.k0s()()()),2&t){const n=e.XpG(2);e.R7$(3),e.Lme("",e.bMT(4,4,"recSkill"),"",e.bMT(5,6,"typography.question_mark"),""),e.R7$(4),e.Y8G("innerHTML",e.bMT(8,8,n.course.courseContent),e.npT),e.R7$(2),e.Y8G("ngIf",null==n.course?null:n.course.partOfAllround)}}function Um(t,o){if(1&t&&(e.j41(0,"div",6)(1,"section")(2,"h4",17),e.EFF(3),e.nI1(4,"translate"),e.k0s(),e.j41(5,"div",55)(6,"strong"),e.EFF(7),e.nI1(8,"translate"),e.k0s(),e.nrm(9,"p",56),e.nI1(10,"sanitize"),e.k0s()()()),2&t){const n=e.XpG(2);e.R7$(3),e.SpI(" ",e.bMT(4,3,"courseMaterials")," "),e.R7$(4),e.SpI(" ",e.bMT(8,5,"studentShouldBring")," "),e.R7$(2),e.Y8G("innerHTML",e.bMT(10,7,n.course.material),e.npT)}}function Jm(t,o){if(1&t&&(e.j41(0,"div",6)(1,"section")(2,"h4",17),e.EFF(3),e.nI1(4,"translate"),e.k0s(),e.j41(5,"div",55),e.nrm(6,"app-course-materials-list",60),e.j41(7,"a",61),e.EFF(8),e.nI1(9,"translate"),e.k0s()()()()),2&t){const n=e.XpG(2);e.R7$(3),e.SpI(" ",e.bMT(4,4,"courseMaterial")," "),e.R7$(3),e.Y8G("materials",n.course.materials),e.R7$(),e.FS9("href",n.shopLink,e.B4B),e.R7$(),e.SpI(" ",e.bMT(9,6,"goToShop")," ")}}function Qm(t,o){if(1&t&&(e.j41(0,"div",6)(1,"section")(2,"h4",17),e.EFF(3),e.nI1(4,"translate"),e.k0s(),e.j41(5,"div",55),e.nrm(6,"p",56),e.nI1(7,"sanitize"),e.k0s()()()),2&t){const n=e.XpG(2);e.R7$(3),e.SpI(" ",e.bMT(4,2,"internship")," "),e.R7$(3),e.Y8G("innerHTML",e.bMT(7,4,n.course.internshipText),e.npT)}}function zm(t,o){if(1&t&&(e.j41(0,"div",6)(1,"section")(2,"h4",17),e.EFF(3),e.nI1(4,"translate"),e.k0s(),e.j41(5,"div",55),e.nrm(6,"p",56),e.nI1(7,"sanitize"),e.k0s()()()),2&t){const n=e.XpG(2);e.R7$(3),e.SpI(" ",e.bMT(4,2,"future")," "),e.R7$(3),e.Y8G("innerHTML",e.bMT(7,4,n.course.carreerOportunties),e.npT)}}function Wm(t,o){if(1&t){const n=e.RV6();e.j41(0,"div",9)(1,"div",10)(2,"div",11)(3,"div",6)(4,"div",12)(5,"div",13)(6,"figure",14),e.nrm(7,"img",15),e.nI1(8,"generateImage"),e.k0s()(),e.j41(9,"div",16)(10,"h4",17),e.EFF(11),e.nI1(12,"translate"),e.k0s(),e.DNE(13,Sm,11,17,"p",4)(14,Mm,2,1,"ng-container",4)(15,Om,6,3,"p",4)(16,Am,9,10,"p",4),e.j41(17,"p"),e.nrm(18,"i",18),e.j41(19,"strong"),e.EFF(20),e.nI1(21,"translate"),e.nI1(22,"translate"),e.k0s(),e.j41(23,"span"),e.EFF(24),e.k0s()(),e.j41(25,"div",19)(26,"button",20),e.bIt("click",function(){e.eBV(n);const a=e.XpG();return e.Njj(a.openCourseBook())}),e.EFF(27),e.nI1(28,"translate"),e.k0s(),e.j41(29,"button",20),e.bIt("click",function(){e.eBV(n);const a=e.XpG();return e.Njj(a.openFreeChapter())}),e.EFF(30),e.nI1(31,"translate"),e.k0s(),e.j41(32,"a",21),e.nI1(33,"routeT"),e.nI1(34,"lowercase"),e.EFF(35),e.nI1(36,"translate"),e.k0s(),e.j41(37,"button",22),e.bIt("click",function(){e.eBV(n);const a=e.XpG();return e.Njj(a.contact())}),e.EFF(38),e.nI1(39,"translate"),e.k0s()()()()(),e.j41(40,"div",23)(41,"div",11)(42,"div",24)(43,"div",25),e.DNE(44,Nm,24,25,"div",26),e.j41(45,"div",27)(46,"button",28),e.bIt("click",function(){e.eBV(n);const a=e.XpG();return e.Njj(a.newImportantMessageAllowed?a.setImportantMessage():null)}),e.DNE(47,Lm,1,0,"i",29)(48,Ym,1,0,"i",30),e.nrm(49,"span",31),e.nI1(50,"translate"),e.k0s()()()(),e.DNE(51,Vm,7,6,"div",32),e.j41(52,"div",6)(53,"section")(54,"h4",17,0),e.EFF(56),e.nI1(57,"translate"),e.k0s(),e.nrm(58,"app-exam-table",33),e.k0s()(),e.DNE(59,qm,10,10,"div",32)(60,Um,11,9,"div",32)(61,Jm,10,8,"div",32)(62,Qm,8,6,"div",32)(63,zm,8,6,"div",32),e.k0s()()()()()}if(2&t){const n=e.XpG();e.R7$(7),e.Y8G("src",e.bMT(8,29,n.course),e.B4B)("alt",null==n.course||null==n.course.photo?null:n.course.photo.description),e.R7$(4),e.JRh(e.bMT(12,31,"generalInfo")),e.R7$(2),e.Y8G("ngIf","groep"===n.course.type),e.R7$(),e.Y8G("ngIf","groep"===n.course.type),e.R7$(),e.Y8G("ngIf","groep"===n.course.type),e.R7$(),e.Y8G("ngIf",null==n.course?null:n.course.coursenumberOfStudents),e.R7$(4),e.Lme("",e.bMT(21,33,"language"),"",e.bMT(22,35,"typography.colon"),""),e.R7$(4),e.SpI(" ",n.course.language," "),e.R7$(3),e.SpI(" ",e.bMT(28,37,"courseBook")," "),e.R7$(3),e.SpI(" ",e.bMT(31,39,"mhFreeChapter")," "),e.R7$(2),e.Y8G("routerLink",e.sMw(53,Tm,e.bMT(33,41,"/course"),e.bMT(34,43,n.course.courseName),n.course.courseCode)),e.R7$(3),e.SpI(" ",e.bMT(36,45,"goToCoursePage")," "),e.R7$(3),e.SpI(" ",e.bMT(39,47,"contact")," "),e.R7$(6),e.Y8G("ngIf",n.importantMessage),e.R7$(),e.Y8G("ngClass",e.eq3(57,Cm,n.importantMessage)),e.R7$(),e.Y8G("ngClass",e.l_i(59,xm,n.newImportantMessageAllowed,!n.newImportantMessageAllowed)),e.R7$(),e.Y8G("ngIf",n.newImportantMessageAllowed),e.R7$(),e.Y8G("ngIf",!n.newImportantMessageAllowed),e.R7$(),e.Y8G("innerHTML",e.bMT(50,49,n.newImportantMessageAllowed?"importantMessage.clickToAdd":"importantMessage.disabled"),e.npT),e.R7$(2),e.Y8G("ngIf","groep"===n.course.type),e.R7$(5),e.SpI(" ",e.bMT(57,51,"exam")," "),e.R7$(2),e.Y8G("examInfo",n.course.examInfo),e.R7$(),e.Y8G("ngIf",n.course.courseContent),e.R7$(),e.Y8G("ngIf",n.course.material),e.R7$(),e.Y8G("ngIf",(null==n.course.materials?null:n.course.materials.length)>0),e.R7$(),e.Y8G("ngIf",n.course.internshipText),e.R7$(),e.Y8G("ngIf",n.course.carreerOportunties)}}let Hm=(()=>{var t;class o{constructor(){this.teacherService=(0,e.WQX)(S.O),this.coursesService=(0,e.WQX)(sm._),this.toastrService=(0,e.WQX)(w.tw),this.translateService=(0,e.WQX)(m.c$),this.configService=(0,e.WQX)(Ce.w),this.dialogService=(0,e.WQX)(B.bZ),this.isSpinnerVisible=!0,this.deleteLoading=!1,this.destroy$=new y.B}ngOnInit(){this.teacherService.getCurrentCourse().pipe((0,I.Q)(this.destroy$)).subscribe(i=>{this.course=i,this.checkMessages(),this.isSpinnerVisible=!1;const a=(0,N.I1)().startOf(P.$.day),s=(0,N.I1)(this.course.startDate),r=(0,N.I1)(this.course.endDate);this.course.courseEnded=a.isAfter(r),this.course.courseStarted=a.isAfter(s)}),this.shopLink=this.configService.getBeautyblueUrl()}checkMessages(){var i;const[a]=(null===(i=this.course)||void 0===i?void 0:i.importantMessages)||[];return this.importantMessage=a,this.newImportantMessageAllowed=!a}setImportantMessage(i=null){const a=!!i;let s={edit:!!i,courseId:this.course.id};const r=this.translateService.instant(a?"edit":"toAdd"),l=this.translateService.instant("importantMessage.message"),p="".concat(r," ").concat(l.toLowerCase());if(a){const{message:h,id:v}=i;s=(0,g.A)((0,g.A)({},s),{},{message:h,id:v})}this.dialogService.open(oe.m,{data:{header:p,component:hm,componentData:s},panelClass:["col-12","col-xl-6","material-modal"],maxHeight:"90vh",autoFocus:!1})}promptRemoveMessage({id:i}
3){const a={data:{content:this.translateService.instant("qExamDoUWant"),type:me.m6.confirm}};this.dialogService.open(oe.m,a).afterClosed().pipe((0,I.Q)(this.destroy$)).subscribe(r=>{r&&this.removeMessage(i)})}removeMessage(i){this.deleteLoading=!0,this.teacherService.deleteImportantMessage(this.course.id,i).pipe((0,I.Q)(this.destroy$)).subscribe(a=>{if(this.deleteLoading=!1,a.success)return this.toastrService.success(this.translateService.instant("successLabel")),void this.checkMessages();this.toastrService.error(a.error.message)})}contact(){const i={data:{type:me.m6.info,header:this.translateService.instant("contact"),component:om},panelClass:["col-12","col-md-4","material-modal"]};this.dialogService.open(oe.m,i)}openCourseBook(){this.coursesService.openCourseBookOrChapter(this.course.courseCode)}openFreeChapter(){this.coursesService.openCourseBookOrChapter(this.course.courseCode,!0)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}}return(t=o).\u0275fac=function(i){return new(i||t)},t.\u0275cmp=e.VBU({type:t,selectors:[["app-teacher-course-details"]],decls:7,vars:5,consts:[["exam",""],["virtualLink",""],["startDate",""],["removeImportantMessageButton",""],[4,"ngIf"],["appBgColor","",1,"row","py-3","mb-3"],[1,"col-12"],[1,"mb-0","text-white"],["class","row pb-4",4,"ngIf"],[1,"row","pb-4"],[1,"col-12","course-card"],[1,"row"],[1,"row","mb-3"],[1,"card-image","col-12","col-md-5","mb-3","mb-md-0"],[1,"figure"],["appOnErrorImage","",1,"figure-img","img-fluid","mat-elevation-z3",3,"src","alt"],[1,"card-content","col-12","col-md-7","py-0"],[1,"ecampus-title"],[1,"fas","fa-globe-europe"],[1,"mt-3","button-container","g-05"],["type","button","mat-raised-button","","color","primary",1,"course-btn","text-uppercase",3,"click"],["target","_blank","mat-raised-button","","color","primary",1,"course-btn","text-uppercase",3,"routerLink"],["type","button","mat-raised-button","","color","accent",1,"course-btn","text-uppercase",3,"click"],[1,"col-12","course-info-body"],[1,"col-12","mb-3"],[1,"important-message"],["class","important-message-body-container",4,"ngIf"],[1,"important-message-add-container",3,"ngClass"],["type","button","role","alert","data-cy","important-messages-add",1,"alert","important-message-add","w-100","text-left","m-0",3,"click","ngClass"],["class","fas fa-exclamation-triangle mr-2",4,"ngIf"],["class","fas fa-exclamation-circle mr-2",4,"ngIf"],[3,"innerHTML"],["class","col-12",4,"ngIf"],[3,"examInfo"],[1,"fas","fa-map-marker-alt"],[3,"routerLink","target"],[4,"ngIf","ngIfElse"],[1,"far","fa-building"],[1,"far","fa-calendar-alt"],[1,"text-success"],[1,"fas","fa-users"],[1,"important-message-body-container"],[1,"row","px-3","important-message-body","py-3","pl-0","pl-md-3"],[1,"col-12","col-md-6"],[1,"title-color","m-0","button-container","justify-content-end","align-items-center"],["type","button","size","sm","mat-raised-button","","color","accent","data-cy","important-messages-edit",1,"text-uppercase",3,"click","disabled","matTooltip"],[1,"fas","fa-edit","mr-2","text-white"],["type","button","color","danger","size","sm","mat-raised-button","","color","danger","data-cy","important-messages-remove",1,"text-uppercase",3,"click","disabled","matTooltip"],[1,"delete-button-icon","fas","fa-trash-alt","text-white","m-0",3,"ngClass"],[1,"delete-loading-spinner",3,"ngClass"],[1,"col-12","mt-3"],["data-cy","important-message",3,"text","characters"],[1,"fas","fa-exclamation-triangle","mr-2"],[1,"fas","fa-exclamation-circle","mr-2"],[3,"courseDatesOfClasses","nextClass","activeOnline"],[1,"section-content"],[1,"course-content",3,"innerHTML"],[1,"mr-1"],[4,"ngFor","ngForOf"],["target","_blank",1,"underline","d-inline-block",3,"href"],[3,"materials"],["target","_blank","mat-raised-button","","color","primary",1,"text-uppercase",3,"href"]],template:function(i,a){1&i&&(e.DNE(0,km,1,0,"app-spinner",4),e.j41(1,"div",5)(2,"div",6)(3,"h5",7),e.EFF(4),e.nI1(5,"translate"),e.k0s()()(),e.DNE(6,Wm,64,62,"div",8)),2&i&&(e.Y8G("ngIf",a.isSpinnerVisible),e.R7$(4),e.JRh(e.bMT(5,3,"courseInfo")),e.R7$(2),e.Y8G("ngIf",!a.isSpinnerVisible))},dependencies:[u.YU,u.Sq,u.bT,we.k,fm.g,gm.V,vm.P,E.It,E.$z,Re.oV,He.K,he.t,Ne.e,O.Wk,u.GH,m.D9,je.O,_e.v,tt.s,bm.z,Fe.p,Wt.E],styles:[".card-content[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{min-width:var(--size-icon-sm);margin-right:var(--space-5px);text-align:center}.card-content[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{font-size:var(--font-size-93);margin-bottom:var(--space-0_3rem)} .course-content ul{margin-bottom:var(--space-0)}.important-message[_ngcontent-%COMP%], .important-message-add[_ngcontent-%COMP%]{background-color:var(--color-info-2)}.important-message-add[_ngcontent-%COMP%]{transition:var(--transition-property-background) var(--duration-600) var(--behavior-function-ease),opacity var(--duration-300) var(--behavior-function-ease)}.important-message-add-container[_ngcontent-%COMP%]{padding:var(--space-0);transition:var(--transition-property-padding) var(--duration-300) var(--behavior-function-ease)}.delete-loading.delete-button-icon[_ngcontent-%COMP%]{opacity:var(--opacity-0)}.delete-loading-spinner[_ngcontent-%COMP%]{display:none;position:absolute;top:var(--space-50-percent);left:var(--space-50-percent);padding:var(--space-0_5rem);animation:loading var(--duration-1000) var(--animation-iteration-infinite) var(--behavior-function-linear);border:var(--border-xs-solid-black-transparency-1);border-bottom:var(--border-xs-solid-tint-1);border-radius:var(--border-radius-full);transform:var(--transform-rotate-0-translate-negative-50-negative-50);transform-origin:var(--transform-origin-0-0)}.delete-loading.delete-loading-spinner[_ngcontent-%COMP%]{display:block}.not-allowed[_ngcontent-%COMP%]{pointer-events:none;opacity:var(--opacity-80)}.not-allowed[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{filter:grayscale(1)}section[_ngcontent-%COMP%]{margin-bottom:var(--space-2_5rem)}section[_ngcontent-%COMP%] .section-content[_ngcontent-%COMP%]{padding-top:var(--space-1rem);padding-left:var(--space-1rem);padding-right:var(--space-1rem)}.course-content[_ngcontent-%COMP%] ul{padding-left:var(--space-1rem)}p.course-content[_ngcontent-%COMP%]{margin-bottom:var(--space-0)}.card-image[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center}figure[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:var(--size-100-percent);min-height:var(--size-230px);margin-bottom:var(--space-0)}.course-btn[_ngcontent-%COMP%]{width:var(--size-100-percent)}@media (min-width: 330px){.course-btn[_ngcontent-%COMP%]{width:var(--size-auto)}}@media (min-width: 1441px){figure[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:var(--size-510px)}}\n\n/*# sourceMappingURL=teacher-course-details.component.css.map*/"]}),o})();var Km=f(12006),Kt=f(23657),Zm=f(53360);const ep=t=>({"ml-0":t});function tp(t,o){if(1&t&&e.nrm(0,"app-courses-overview",5),2&t){const n=e.XpG();e.Y8G("courses",n)("entity","teacher")("trackBy","id")}}function np(t,o){1&t&&(e.j41(0,"div",6)(1,"div",8),e.nrm(2,"p",9),e.nI1(3,"translate"),e.j41(4,"a",10)(5,"span"),e.EFF(6),e.nI1(7,"translate"),e.k0s()()()()),2&t&&(e.R7$(2),e.Y8G("innerHTML",e.bMT(3,3,"noTeachingCourses"),e.npT),e.R7$(2),e.Y8G("routerLink","/teacher/profile"),e.R7$(2),e.JRh(e.bMT(7,5,"myProfile")))}function ip(t,o){if(1&t&&(e.j41(0,"div",0)(1,"div",1)(2,"div",2)(3,"h3",3),e.EFF(4),e.nI1(5,"translate"),e.k0s(),e.j41(6,"div",4),e.nrm(7,"app-course-overview-status-toggle"),e.k0s()()(),e.DNE(8,tp,1,3,"app-courses-overview",5)(9,np,8,7,"div",6),e.nrm(10,"hr",7),e.j41(11,"div",1)(12,"div",8),e.nrm(13,"p",9),e.nI1(14,"translate"),e.j41(15,"a",10),e.EFF(16),e.nI1(17,"translate"),e.k0s()()()()),2&t){const n=e.XpG();e.R7$(3),e.Y8G("ngClass",e.eq3(12,ep,!n.isDesktop)),e.R7$(),e.JRh(e.bMT(5,6,"myCourses")),e.R7$(4),e.vxM(o.length&&n.hasActiveCourses?8:n.hasActiveCourses?-1:9),e.R7$(5),e.Y8G("innerHTML",e.bMT(14,8,"teachM
3oreCourses"),e.npT),e.R7$(2),e.Y8G("routerLink","/application-form"),e.R7$(),e.SpI(" ",e.bMT(17,10,"ccpApplyNowButton")," ")}}let ap=(()=>{var t;class o{constructor(){this.helperService=(0,e.WQX)(Ee.w),this.teacherService=(0,e.WQX)(S.O),this.loaderService=(0,e.WQX)(Kt.Z),this.deviceDetectorService=(0,e.WQX)(ge.Kg),this.courseOverviewFilterService=(0,e.WQX)(Km.A),this.isDesktop=this.deviceDetectorService.isDesktop(),this.hasActiveCourses=!1}ngOnInit(){this.loaderService.setIsLoading(!0),this.courseOverviewFilterService.setFilters(Y.Ed.teacher),this.coursesSub$=this.teacherService.getTeacherCourses().pipe((0,R.T)(i=>{var a;return(null==i||null===(a=i.body)||void 0===a?void 0:a.data)||[]}),(0,D.W)(()=>(0,x.of)([])),(0,R.T)(i=>(i&&this.teacherService.setCourses(i),i.map(a=>(this.checkIfCourseHasStarted(a),a)))),(0,Z.n)(i=>this.courseOverviewFilterService.getActiveFilter().pipe((0,R.T)(a=>(this.hasActiveCourses=!!i.length,"active"===a?i:[])))),(0,le.M)(()=>this.loaderService.setIsLoading(!1)))}checkIfCourseHasStarted(i){var a;if(this.helperService.isEmptyObj(i.nextClass)&&i.type!==Y.q1.home&&(i.courseEnded=!0),i.courseStarted=(0,N.I1)().isSameOrAfter((0,N.I1)(i.startDate)),null!=i&&null!==(a=i.nextClass)&&void 0!==a&&a.id&&i.subtype===Y.q1.virtual){const{date:s,startTime:r}=i.nextClass,l=(0,N.I1)("".concat(s," ").concat(r),P.x.iso.dateTimeShortNoSeconds),p=N.I1.duration(l.diff((0,N.I1)())).asMinutes();i.startsWithin15Minutes=p<=15}}}return(t=o).\u0275fac=function(i){return new(i||t)},t.\u0275cmp=e.VBU({type:t,selectors:[["app-teacher-courses-overview"]],decls:2,vars:3,consts:[[1,"container","mb-5"],[1,"row"],[1,"col-12","d-flex","flex-column","flex-md-row","justify-content-start","justify-content-md-between","align-items-start"],[1,"mb-0","fs-22","font-weight-bold",3,"ngClass"],[1,"mb-3","align-self-end"],[3,"courses","entity","trackBy"],[1,"row","mt-md-4","pt-md-4"],[1,"my-5"],[1,"col-12","col-md-6","offset-md-3","text-center"],[3,"innerHTML"],["mat-button","","color","accent",3,"routerLink"]],template:function(i,a){if(1&i&&(e.DNE(0,ip,18,14,"div",0),e.nI1(1,"async")),2&i){let s;e.vxM((s=e.bMT(1,1,a.coursesSub$))?0:-1,s)}},dependencies:[u.YU,E.It,O.Wk,Zm.P,F.C,u.Jj,m.D9],styles:["hr[_ngcontent-%COMP%]{margin:var(--space-100px) var(--space-0)}\n\n/*# sourceMappingURL=teacher-courses-overview.component.css.map*/"]}),o})();var op=f(88044),sp=f(29443),ut=f(61977),Zt=f(38223),en=f(64992);const rp=["from","to"],lp=["resumeUploader"],cp=["motivationUploader"],Ue=()=>({standalone:!0}),tn=t=>({value:t});function mp(t,o){1&t&&e.nrm(0,"app-spinner")}function pp(t,o){if(1&t&&(e.j41(0,"mat-option",77),e.EFF(1),e.k0s()),2&t){const n=o.$implicit;e.Y8G("value",n.value),e.R7$(),e.SpI(" ",n.label," ")}}function dp(t,o){if(1&t){const n=e.RV6();e.j41(0,"i",78),e.bIt("click",function(){e.eBV(n);const a=e.XpG().index,s=e.XpG();return e.Njj(s.deleteCompany(a))}),e.k0s()}}function up(t,o){if(1&t){const n=e.RV6();e.j41(0,"section",65)(1,"div",15)(2,"div",25)(3,"mat-form-field")(4,"mat-label"),e.EFF(5),e.nI1(6,"translate"),e.k0s(),e.nrm(7,"i",66)(8,"input",67),e.k0s()(),e.j41(9,"div",25)(10,"mat-form-field",26)(11,"mat-label",27),e.EFF(12),e.nI1(13,"translate"),e.k0s(),e.nrm(14,"i",66),e.j41(15,"mat-select",68),e.DNE(16,pp,2,2,"mat-option",30),e.k0s()()()(),e.j41(17,"div",15)(18,"div",69)(19,"div",15)(20,"div",70)(21,"mat-form-field",26)(22,"mat-label"),e.EFF(23),e.nI1(24,"translate"),e.k0s(),e.nrm(25,"i",71),e.j41(26,"input",72),e.bIt("click",function(){e.eBV(n);const a=e.sdS(29);return e.Njj(null==a?null:a.open())})("focus",function(){e.eBV(n);const a=e.sdS(29);return e.Njj(null==a?null:a.open())}),e.k0s(),e.nrm(27,"mat-datepicker-toggle",73)(28,"mat-datepicker",74,3),e.j41(30,"mat-hint"),e.EFF(31),e.k0s()()(),e.j41(32,"div",70)(33,"mat-form-field",26)(34,"mat-label"),e.EFF(35),e.nI1(36,"translate"),e.k0s(),e.j41(37,"input",75),e.bIt("click",function(){e.eBV(n);const a=e.sdS(40);return e.Njj(null==a?null:a.open())})("focus",function(){e.eBV(n);const a=e.sdS(40);return e.Njj(null==a?null:a.open())}),e.k0s(),e.nrm(38,"mat-datepicker-toggle",73)(39,"mat-datepicker",74,4),e.j41(41,"mat-hint"),e.EFF(42),e.k0s()()()()()(),e.DNE(43,dp,1,0,"i",76),e.k0s()}if(2&t){const n=o.index,i=e.sdS(29),a=e.sdS(40),s=e.XpG();e.Y8G("formGroupName",n),e.R7$(5),e.JRh(e.bMT(6,21,"CVcompanyName")),e.R7$(3),e.Mz_("id","companyName",n,""),e.R7$(4),e.JRh(e.bMT(13,23,"CVFunction")),e.R7$(4),e.Y8G("ngForOf",s.employmentSelect),e.R7$(7),e.JRh(e.bMT(24,25,"CVFrom")),e.R7$(3),e.Y8G("matDatepicker",i)("min",s.datePickerOptions.minSelectableDate)("max",s.datePickerOptions.maxSelectableDate),e.R7$(),e.Y8G("for",i),e.R7$(),e.Y8G("touchUi",s.datePickerOptions.enableTouch),e.R7$(3),e.JRh(s.DATEFORMATS.display.date),e.R7$(4),e.JRh(e.bMT(36,27,"CVTo")),e.R7$(2),e.Y8G("matDatepicker",a)("min",s.datePickerOptions.minSelectableDate)("max",s.datePickerOptions.maxSelectableDate),e.R7$(),e.Y8G("for",a),e.R7$(),e.Y8G("touchUi",s.datePickerOptions.enableTouch),e.R7$(3),e.JRh(s.DATEFORMATS.display.date),e.R7$(),e.Y8G("ngIf",0!==n)}}function _p(t,o){if(1&t&&(e.j41(0,"div",79)(1,"mat-form-field")(2,"mat-label"),e.EFF(3),e.nI1(4,"translate"),e.k0s(),e.nrm(5,"i",19)(6,"input",80),e.k0s()()),2&t){const n=o.$implicit,i=o.index;e.Y8G("formGroupName",i),e.R7$(3),e.Lme("",e.bMT(4,5,"CVlinkTo")," ",n.get("name").value,""),e.R7$(3),e.Mz_("id","socialMediaLink",i,"")}}function hp(t,o){if(1&t&&(e.j41(0,"mat-option",77),e.EFF(1),e.k0s()),2&t){const n=o.$implicit;e.Y8G("value",n.value),e.R7$(),e.SpI(" ",n.label," ")}}function fp(t,o){if(1&t){const n=e.RV6();e.j41(0,"i",78),e.bIt("click",function(){e.eBV(n);const a=e.XpG().index,s=e.XpG();return e.Njj(s.deleteSecondTabCompany(a))}),e.k0s()}}function gp(t,o){if(1&t){const n=e.RV6();e.j41(0,"section",81)(1,"div",15)(2,"div",25)(3,"mat-form-field")(4,"mat-label"),e.EFF(5),e.nI1(6,"translate"),e.k0s(),e.nrm(7,"i",66)(8,"input",67),e.k0s()(),e.j41(9,"div",25)(10,"mat-form-field",26)(11,"mat-label",27),e.EFF(12),e.nI1(13,"translate"),e.k0s(),e.nrm(14,"i",66),e.j41(15,"mat-select",68),e.DNE(16,hp,2,2,"mat-option",30),e.k0s()()()(),e.j41(17,"div",15)(18,"div",25)(19,"mat-form-field")(20,"mat-label"),e.EFF(21),e.nI1(22,"translate"),e.nI1(23,"titlecase"),e.k0s(),e.nrm(24,"i",66)(25,"textarea",82),e.k0s()(),e.j41(26,"div",69)(27,"div",15)(28,"div",69)(29,"mat-form-field",26)(30,"mat-label"),e.EFF(31),e.nI1(32,"translate"),e.k0s(),e.nrm(33,"i",71),e.j41(34,"input",72),e.bIt("click",function(){e.eBV(n);const a=e.sdS(37);return e.Njj(null==a?null:a.open())})("focus",function(){e.eBV(n);const a=e.sdS(37);return e.Njj(null==a?null:a.open())}),e.k0s(),e.nrm(35,"mat-datepicker-toggle",73)(36,"mat-datepicker",74,3),e.j41(38,"mat-hint"),e.EFF(39),e.k0s()()(),e.j41(40,"div",69)(41,"mat-form-field",26)(42,"mat-label"),e.EFF(43),e.nI1(44,"translate"),e.k0s(),e.j41(45,"input",75),e.bIt("click",function(){e.eBV(n);const a=e.sdS(48);return e.Njj(null==a?null:a.open())})("focus",function(){e.eBV(n);const a=e.sdS(48);return e.Njj(null==a?null:a.open())}),e.k0s(),e.nrm(46,"mat-datepicker-toggle",73)(47,"mat-datepicker",74,4),e.j41(49,"mat-hint"),e.EFF(50),e.k0s()()()()()(),e.j41(51,"div",15)(52,"div",25)(53,"mat-form-field")(54,"mat-label"),e.EFF(55),e.nI1(56,"translate"),e.k0s(),e.nrm(57,"i",28)(58,"input",83),e.k0s()(),e.j41(59,"div",25)(60,"mat-form-field")(61,"mat-label"),e.EFF(62),e.nI1(63,"translate"),e.k0s(),e.nrm(64,"i",28)(65,"input",84),e.k0s()(),e.j41(66,"div",25)(67,"mat-form-field")(68,"mat-label"),e.EFF(69),e.nI1(70,"translate"),e.k0s(),e.nrm(71,"i",85)(72,"input",86),e.k0s()(),e.j41(73,"div",25)(74,"mat-form-field")(75,"mat-label"),e.EFF(76),e.nI1(77,"translate"),e.k0s(),e.nrm(78,"i",87)(79,"input",88),e.k0s()()(),e.DNE(80,fp,1,0,"i",76),e.nrm(81,"hr",89),e.k0s()}if(2&t){const n=o.index,i=e.sdS(37),a=e.sdS(48),s=e.XpG();e.Y8G("ngClass",0!==n?"mt-5":"")("formGroupName",n),e.R7$(5),e.JRh(e.bMT(6,37,"CVcompanyName")),e.R7$(3),e.Mz_("id","companyName",n,"2"),e.R7$(4),e.JRh(e.bMT(13,39,"CVFunction")),e.R7$(4),e.Y8G("ngForOf",s.employmentSecondTabSelect),e.R7$(5),e.JRh(e.bMT(23,43,e.bMT(22,41,"CVjobDescription"))),e.R7$(4),e.Mz_("id","companyName",n,"2"),e.R7$(6),e.JRh(e.bMT(32,45,"CVFrom")),e.R7$(3),e.Y8G("matDatepicker",i)("min",s.datePickerOptions.minSelectableDate)("max",s.datePickerOptions.maxSelectableDate),e.R7$(),e.Y8G("for",i),e.R7$(),e.Y8G("touchUi",s.datePickerOptions.enableTouch),e.R7$(3),e.JRh(s.DATEFORMATS.display.date),e.R7$(4),e.JRh(e.bMT(44,47,"CVTo")),e.R7$(2),e.Y8G("matDatepicker",a)("min",s.datePickerOptions.minSelectableDate)("max",s.datePickerOptions.maxSelectableDate),e.R7$(),e.Y8G("for",a),e.R7$(),e.Y8G("touchUi",s.datePickerOptions.enableTouch),e.R7$(3),e.JRh(s.DATEFORMATS.display.date),e.R7$(5),e.JRh(e.bMT(56,49,"CVreferralName")),e.R7$(3),e.Mz_("id","referenceName",n,""),e.R7$(4),e.JRh(e.bMT(63,51,"CVreferralFunction")),e.R7$(3),e.Mz_("id","referenceFunction",n,""),e.R7$(4),e.JRh(e.bMT(70,53,"CVreferralEmail")),e.R7$(3),e.Mz_("id","referenceEmail",n,""),e.R7$(4),e.JRh(e.bMT(77,55,"CVreferralPhone")),e.R7$(3),e.Mz_("id","referencePhoneNumber",n,""),e.R7$(),e.Y8G("ngIf",0!==n)}}function vp(t,o){if(1&t&&(e.j41(0,"mat-option",77),e.EFF(1),e.k0s()),2&t){const n=o.$implicit;e.Y8G("value",n.value),e.R7$(),e.SpI(" ",n.label," ")}}function bp(t,o){1&t&&(e.j41(0,"span",90)(1,"span"),e.nrm(2,"i",91),e.EFF(3),e.nI1(4,"translate"),e.k0s()()),2&t&&(e.R7$(3),e.SpI(" ",e.bMT(4,1,"CVinvalidTeacherId"),""))}function Tp(t,o){if(1&t&&(e.j41(0,"mat-option",77),e.EFF(1),e.k0s()),2&t){const n=o.$implicit;e.Y8G("value",n.value),e.R7$(),e.SpI(" ",n.label," ")}}function Cp(t,o){if(1&t){const n=e.RV6();e.j41(0,"i",78),e.bIt("click",function(){e.eBV(n);const a=e.XpG().index,s=e.XpG();
3return e.Njj(s.deleteDegree(a))}),e.k0s()}}function xp(t,o){if(1&t){const n=e.RV6();e.j41(0,"section",65)(1,"div",15)(2,"div",25)(3,"mat-form-field",26)(4,"mat-label",27),e.EFF(5),e.nI1(6,"translate"),e.k0s(),e.nrm(7,"i",92),e.j41(8,"mat-select",93),e.DNE(9,Tp,2,2,"mat-option",30),e.k0s()()(),e.j41(10,"div",25)(11,"mat-form-field")(12,"mat-label"),e.EFF(13),e.nI1(14,"translate"),e.k0s(),e.nrm(15,"i",92)(16,"input",94),e.k0s()()(),e.j41(17,"div",15)(18,"div",69)(19,"div",15)(20,"div",69)(21,"mat-form-field",26)(22,"mat-label"),e.EFF(23),e.nI1(24,"translate"),e.k0s(),e.nrm(25,"i",71),e.j41(26,"input",72),e.bIt("click",function(){e.eBV(n);const a=e.sdS(29);return e.Njj(null==a?null:a.open())})("focus",function(){e.eBV(n);const a=e.sdS(29);return e.Njj(null==a?null:a.open())}),e.k0s(),e.nrm(27,"mat-datepicker-toggle",73)(28,"mat-datepicker",74,3),e.j41(30,"mat-hint"),e.EFF(31),e.k0s()()(),e.j41(32,"div",69)(33,"mat-form-field",26)(34,"mat-label"),e.EFF(35),e.nI1(36,"translate"),e.k0s(),e.j41(37,"input",75),e.bIt("click",function(){e.eBV(n);const a=e.sdS(40);return e.Njj(null==a?null:a.open())})("focus",function(){e.eBV(n);const a=e.sdS(40);return e.Njj(null==a?null:a.open())}),e.k0s(),e.nrm(38,"mat-datepicker-toggle",73)(39,"mat-datepicker",74,4),e.j41(41,"mat-hint"),e.EFF(42),e.k0s()()()()()(),e.DNE(43,Cp,1,0,"i",76),e.k0s()}if(2&t){const n=o.index,i=e.sdS(29),a=e.sdS(40),s=e.XpG();e.Y8G("formGroupName",n),e.R7$(5),e.JRh(e.bMT(6,21,"CVdegreeLevel")),e.R7$(4),e.Y8G("ngForOf",s.degreesSelect),e.R7$(4),e.JRh(e.bMT(14,23,"CVcourse")),e.R7$(3),e.Mz_("id","name",n,""),e.R7$(7),e.JRh(e.bMT(24,25,"CVFrom")),e.R7$(3),e.Y8G("matDatepicker",i)("min",s.datePickerOptions.minSelectableDate)("max",s.datePickerOptions.maxSelectableDate),e.R7$(),e.Y8G("for",i),e.R7$(),e.Y8G("touchUi",s.datePickerOptions.enableTouch),e.R7$(3),e.JRh(s.DATEFORMATS.display.date),e.R7$(4),e.JRh(e.bMT(36,27,"CVTo")),e.R7$(2),e.Y8G("matDatepicker",a)("min",s.datePickerOptions.minSelectableDate)("max",s.datePickerOptions.maxSelectableDate),e.R7$(),e.Y8G("for",a),e.R7$(),e.Y8G("touchUi",s.datePickerOptions.enableTouch),e.R7$(3),e.JRh(s.DATEFORMATS.display.date),e.R7$(),e.Y8G("ngIf",0!==n)}}function Ip(t,o){if(1&t&&(e.j41(0,"mat-option",77),e.EFF(1),e.k0s()),2&t){const n=o.$implicit;e.Y8G("value",n.value),e.R7$(),e.SpI(" ",n.label," ")}}function Rp(t,o){1&t&&(e.j41(0,"span",90)(1,"span"),e.nrm(2,"i",91),e.EFF(3),e.nI1(4,"translate"),e.k0s()()),2&t&&(e.R7$(3),e.SpI(" ",e.bMT(4,1,"CVinvalidStudentID"),""))}function Fp(t,o){if(1&t&&(e.j41(0,"mat-option",77),e.EFF(1),e.k0s()),2&t){const n=o.$implicit;e.Y8G("value",n.value),e.R7$(),e.SpI(" ",n.label," ")}}function kp(t,o){if(1&t&&(e.j41(0,"mat-option",77),e.EFF(1),e.k0s()),2&t){const n=o.$implicit;e.Y8G("value",n.value),e.R7$(),e.SpI(" ",n.label," ")}}function yp(t,o){if(1&t&&(e.j41(0,"mat-option",77),e.EFF(1),e.k0s()),2&t){const n=o.$implicit;e.Y8G("value",n.value),e.R7$(),e.SpI(" ",n.label," ")}}function Ep(t,o){if(1&t){const n=e.RV6();e.j41(0,"i",78),e.bIt("click",function(){e.eBV(n);const a=e.XpG().index,s=e.XpG();return e.Njj(s.deleteCity(a))}),e.k0s()}}function Sp(t,o){if(1&t&&(e.j41(0,"section",65)(1,"div",15)(2,"div",95)(3,"mat-form-field",26)(4,"mat-label",27),e.EFF(5),e.nI1(6,"translate"),e.k0s(),e.nrm(7,"i",39),e.j41(8,"mat-select",96),e.DNE(9,yp,2,2,"mat-option",30),e.k0s()()(),e.j41(10,"div",95)(11,"div",97)(12,"span",98),e.EFF(13),e.nI1(14,"translate"),e.k0s(),e.j41(15,"mat-slider",99),e.nrm(16,"input",100),e.k0s(),e.j41(17,"span",101),e.EFF(18),e.nI1(19,"translate"),e.k0s()()()(),e.DNE(20,Ep,1,0,"i",76),e.k0s()),2&t){const n=o.index,i=e.XpG();e.Y8G("formGroupName",n),e.R7$(5),e.JRh(e.bMT(6,10,"CVteachIn")),e.R7$(4),e.Y8G("ngForOf",i.citiesSelect),e.R7$(4),e.JRh(e.i5U(14,12,"distance_units.km",e.eq3(18,tn,i.min))),e.R7$(2),e.Y8G("min",i.min)("max",i.max),e.R7$(),e.Mz_("id","range",n,""),e.R7$(2),e.JRh(e.i5U(19,15,"distance_units.km",e.eq3(20,tn,i.max))),e.R7$(2),e.Y8G("ngIf",0!==n)}}function $p(t,o){if(1&t&&(e.j41(0,"mat-option",77),e.EFF(1),e.k0s()),2&t){const n=o.$implicit;e.Y8G("value",n.value),e.R7$(),e.SpI(" ",n.label," ")}}function Mp(t,o){if(1&t&&(e.j41(0,"mat-option",77),e.EFF(1),e.k0s()),2&t){const n=o.$implicit;e.Y8G("value",n.value),e.R7$(),e.SpI(" ",n.label," ")}}function wp(t,o){if(1&t&&(e.j41(0,"mat-option",77),e.EFF(1),e.k0s()),2&t){const n=o.$implicit;e.Y8G("value",n.value),e.R7$(),e.SpI(" ",n.label," ")}}function jp(t,o){if(1&t){const n=e.RV6();e.j41(0,"i",78),e.bIt("click",function(){e.eBV(n);const a=e.XpG().index,s=e.XpG();return e.Njj(s.deleteLanguage(a))}),e.k0s()}}function Gp(t,o){if(1&t&&(e.j41(0,"section",65)(1,"div",15)(2,"div",25)(3,"mat-form-field",26)(4,"mat-label",27),e.EFF(5),e.nI1(6,"translate"),e.k0s(),e.nrm(7,"i",102),e.j41(8,"mat-select",103),e.DNE(9,Mp,2,2,"mat-option",30),e.k0s()()(),e.j41(10,"div",25)(11,"mat-form-field",26)(12,"mat-label",27),e.EFF(13),e.nI1(14,"translate"),e.k0s(),e.nrm(15,"i",102),e.j41(16,"mat-select",104),e.DNE(17,wp,2,2,"mat-option",30),e.k0s()()()(),e.DNE(18,jp,1,0,"i",76),e.k0s()),2&t){const n=o.index,i=e.XpG();e.Y8G("formGroupName",n),e.R7$(5),e.JRh(e.bMT(6,6,"CVlanguageSkills")),e.R7$(4),e.Y8G("ngForOf",i.languagesSelect),e.R7$(4),e.JRh(e.bMT(14,8,"CVLevel")),e.R7$(4),e.Y8G("ngForOf",i.levelSelect),e.R7$(),e.Y8G("ngIf",0!==n)}}let Dp=(()=>{var t;class o{onRangeValueChange(i){this.range=i.value}constructor(i,a,s,r,l,p,d,h){this.websiteService=i,this.teacherService=a,this.formBuilder=s,this.translateService=r,this.recruitmentService=l,this.campusService=p,this.toastrService=d,this.deviceDetectorService=h,this.DATEFORMATS=P.x,this.currentDate=new Date,this.employmentSelect=[],this.employmentSecondTabSelect=[],this.degreesSelect=[],this.citiesSelect=[],this.languagesSelect=[],this.levelSelect=[],this.yesNoSelect=[],this.yesNoValueTeacher=0,this.yesNoValueStudent=0,this.yesNoValueLicense=0,this.yesNoValueCar=0,this.yesNoValueTeachOnline=0,this.invalidTeacherId=!1,this.invalidStudentId=!1,this.visible=!1,this.allowedFileTypes=["pdf"],this.range=0,this.min=0,this.max=100,this.destroy$=new y.B,this.firstTab=this.formBuilder.group({workExperience:this.formBuilder.array([],c.k0.maxLength(5)),socialMedia:this.formBuilder.array([]),website:this.formBuilder.group({description:[""],id:[""]})}),this.secondTab=this.formBuilder.group({knownTeacher:["",[c.k0.required]],workExperience:this.formBuilder.array([])}),this.thirdTab=this.formBuilder.group({degree:this.formBuilder.array([]),knownStudent:["",[c.k0.required]]}),this.fourthTab=this.formBuilder.group({cities:this.formBuilder.array([]),driversLicense:["",[c.k0.required]],iCanTeachOnline:["",[c.k0.required]],possessionOfACar:["",[c.k0.required]],languageSkills:this.formBuilder.array([]),times:this.formBuilder.group({monday:this.formBuilder.group({morning:!1,afternoon:!1,evening:!1}),tuesday:this.formBuilder.group({morning:!1,afternoon:!1,evening:!1}),wednesday:this.formBuilder.group({morning:!1,afternoon:!1,evening:!1}),thursday:this.formBuilder.group({morning:!1,afternoon:!1,evening:!1}),friday:this.formBuilder.group({morning:!1,afternoon:!1,evening:!1}),saturday:this.formBuilder.group({morning:!1,afternoon:!1,evening:!1}),sunday:this.formBuilder.group({morning:!1,afternoon:!1,evening:!1})})}),this.fifthTab=this.formBuilder.group({motivationalLetterText:["",[c.k0.required]],presentationDraftText:["",[c.k0.required]]}),this.CVForm=this.formBuilder.group({cv:[null]}),this.portfolioForm=this.formBuilder.group({portfolio:[null]})}ngOnInit(){this.datePickerOptions={minSelectableDate:(0,N.I1)().subtract(100,P.$.year),maxSelectableDate:(0,N.I1)(),enableTouchUI:!this.deviceDetectorService.isDesktop()},this.recruitmentService.getLanguagesTranslated().subscribe(i=>{i&&(this.addDropdownData(i.data,4),this.yesNoSelect=[...this.yesNoSelect,{value:0,label:this.translateService.instant("no")}],this.yesNoSelect=[...this.yesNoSelect,{value:1,label:this.translateService.instant("yes")}],this.successMessage=this.translateService.instant("CVdataUpdatedSuccess"),this.errorMessage=this.translateService.instant("CVdataUpdatedError"))}),this.campusService.getCities().subscribe(i=>{i&&this.addDropdownData(i.data,5)}),this.recruitmentService.getLanguageLevels().subscribe(i=>{i&&this.addDropdownData(i.data,6)}),this.teacherService.getCVTab(1,"get").subscribe(i=>
3{if(this.setBackgroundColor(),200===i.status){if(this.firstScreenObject=i.body.data,this.firstScreenObject.workExperienceTypes&&this.firstScreenObject.workExperienceTypes.length>0&&this.addDropdownData(this.firstScreenObject.workExperienceTypes,1),this.firstScreenObject.workExperience&&this.firstScreenObject.workExperience.length>0)for(var a=0;a<this.firstScreenObject.workExperience.length;a++)this.addCompany(this.firstScreenObject.workExperience[a]);else this.addCompany();if(this.firstScreenObject.socialMedia)for(a=0;a<this.firstScreenObject.socialMedia.length;a++){let r=this.firstScreenObject.socialMedia[a].id;(1==r||2==r||6==r)&&this.addSocial(this.firstScreenObject.socialMedia[a])}this.firstScreenObject.website&&(this.website.controls.description.setValue(this.firstScreenObject.website.description),this.website.controls.id.setValue(this.firstScreenObject.website.id))}}),this.teacherService.getCVTab(2,"get").subscribe(i=>{if(200===i.status&&(this.secondScreenObject=i.body.data),this.secondScreenObject.workExperience&&this.secondScreenObject.workExperience.length>0)for(var a=0;a<this.secondScreenObject.workExperience.length;a++)this.addSecondTabCompany(this.secondScreenObject.workExperience[a]);else this.addSecondTabCompany();this.secondScreenObject.workExperienceTypes&&this.addDropdownData(this.secondScreenObject.workExperienceTypes,2),this.secondScreenObject.knownTeacher&&(this.secondTab.controls.knownTeacher.setValue(this.secondScreenObject.knownTeacher),this.yesNoValueTeacher=1)}),this.teacherService.getCVTab(3,"get").subscribe(i=>{if(200===i.status&&(this.thirdScreenObject=i.body.data),this.thirdScreenObject.degree&&this.thirdScreenObject.degree.length>0)for(var a=0;a<this.thirdScreenObject.degree.length;a++)this.addDegree(this.thirdScreenObject.degree[a]);else this.addDegree();this.thirdScreenObject.knownStudent&&(this.thirdTab.controls.knownStudent.setValue(this.thirdScreenObject.knownStudent),this.yesNoValueStudent=1),this.thirdScreenObject.degreeTypes&&this.addDropdownData(this.thirdScreenObject.degreeTypes,3)}),this.teacherService.getCVTab(4,"get").subscribe(i=>{if(200===i.status&&(this.fourthScreenObject=i.body.data),this.fourthScreenObject.driversLicense&&(this.fourthTab.controls.driversLicense.setValue(this.fourthScreenObject.driversLicense),this.yesNoValueLicense=parseInt(this.fourthScreenObject.driversLicense)),this.fourthScreenObject.possessionOfACar&&(this.fourthTab.controls.possessionOfACar.setValue(this.fourthScreenObject.possessionOfACar),this.yesNoValueCar=parseInt(this.fourthScreenObject.possessionOfACar)),this.fourthScreenObject.iCanTeachOnline&&(this.fourthTab.controls.iCanTeachOnline.setValue(this.fourthScreenObject.iCanTeachOnline),this.yesNoValueTeachOnline=parseInt(this.fourthScreenObject.iCanTeachOnline)),this.fourthScreenObject.cities&&this.fourthScreenObject.cities.length>0)for(var a=0;a<this.fourthScreenObject.cities.length;a++)this.addCity(this.fourthScreenObject.cities[a]);else this.addCity();if(this.fourthScreenObject.languageSkills&&this.fourthScreenObject.languageSkills.length>0)for(a=0;a<this.fourthScreenObject.languageSkills.length;a++)this.addLanguage(this.fourthScreenObject.languageSkills[a]);else this.addLanguage();if(this.fourthScreenObject.times)for(let s in this.fourthScreenObject.times)this.addWeekDaysOccupation(s)}),this.teacherService.getCVTab(5,"get").subscribe(i=>{200===i.status&&(this.fifthScreenObject=i.body.data),this.fifthScreenObject.motivationalLetterText&&this.fifthTab.controls.motivationalLetterText.setValue(this.fifthScreenObject.motivationalLetterText),this.fifthScreenObject.presentationDraftText&&this.fifthTab.controls.presentationDraftText.setValue(this.fifthScreenObject.presentationDraftText)})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}get companies(){return this.firstTab.get("workExperience")}get socials(){return this.firstTab.get("socialMedia")}get website(){return this.firstTab.get("website")}get companiesSecondTab(){return this.secondTab.get("workExperience")}get degrees(){return this.thirdTab.get("degree")}get languages(){return this.fourthTab.get("languageSkills")}get cities(){return this.fourthTab.get("cities")}get times(){return this.fourthTab.get("times")}addCompany(i){this.companies.push(this.formBuilder.group(i?{id:[i.id],companyName:[i.c
3ompanyName,[c.k0.required,c.k0.maxLength(50)]],position:[i.position,[c.k0.required]],from:[(0,N.I1)(i.from,P.x.iso.date),[c.k0.required]],to:[(0,N.I1)(i.to,P.x.iso.date)]}:{id:[""],companyName:["",[c.k0.required]],position:["",[c.k0.required]],from:["",[c.k0.required]],to:[""]}))}addSecondTabCompany(i){this.companiesSecondTab.push(this.formBuilder.group(i?{id:[i.id],companyName:[i.companyName,[c.k0.required,c.k0.maxLength(50)]],position:[i.position,[c.k0.required]],from:[(0,N.I1)(i.from,P.x.iso.date),[c.k0.required]],to:[(0,N.I1)(i.to,P.x.iso.date)],jobDescription:[i.jobDescription,[c.k0.maxLength(300)]],referenceEmail:[i.referenceEmail,[c.k0.email,c.k0.maxLength(50),c.k0.pattern("[A-Za-z0-9._%-]+@[A-Za-z0-9._%-]+\\.[a-z]{2,16}")]],referenceFunction:i.referenceFunction,referenceName:[i.referenceName,[c.k0.maxLength(50)]],referencePhoneNumber:[i.referencePhoneNumber,[c.k0.maxLength(20)]]}:{id:[""],companyName:["",[c.k0.required,c.k0.maxLength(50)]],position:["",[c.k0.required]],from:["",[c.k0.required]],to:[""],jobDescription:["",[c.k0.maxLength(300)]],referenceEmail:["",[c.k0.email,c.k0.maxLength(50),c.k0.pattern("[A-Za-z0-9._%-]+@[A-Za-z0-9._%-]+\\.[a-z]{2,16}")]],referenceFunction:[""],referenceName:["",[c.k0.maxLength(50)]],referencePhoneNumber:["",[c.k0.maxLength(20)]]}))}addSocial(i){i&&this.socials.push(this.formBuilder.group({name:[i.name],id:[i.id],socialMediaLink:[i.socialMediaLink]}))}addDegree(i){this.degrees.push(this.formBuilder.group(i?{degree:[i.degree,[c.k0.required]],from:[(0,N.I1)(i.from,P.x.iso.date),[c.k0.required]],id:[i.id],label:[i.label],name:[i.name,[c.k0.required]],to:[(0,N.I1)(i.to,P.x.iso.date)]}:{degree:["",[c.k0.required]],from:["",[c.k0.required]],id:[""],label:[""],name:["",[c.k0.required]],to:[""]}))}addLanguage(i){this.languages.push(this.formBuilder.group(i?{isoLang:[i.isoLang,[c.k0.required]],levelId:[i.levelId,[c.k0.required]]}:{isoLang:["",[c.k0.required]],levelId:["",[c.k0.required]]}))}addCity(i){this.cities.push(this.formBuilder.group(i?{cityId:[i.cityId.toString(),[c.k0.required]],availableRadius:[i.availableRadius]}:{cityId:["",[c.k0.required]],availableRadius:[""]}))}addWeekDaysOccupation(i){switch(i){case"monday":this.times.controls.monday.get("morning").setValue(this.fourthScreenObject.times.monday.morning),this.times.controls.monday.get("afternoon").setValue(this.fourthScreenObject.times.monday.afternoon),this.times.controls.monday.get("evening").setValue(this.fourthScreenObject.times.monday.evening);break;case"tuesday":this.times.controls.tuesday.get("morning").setValue(this.fourthScreenObject.times.tuesday.morning),this.times.controls.tuesday.get("afternoon").setValue(this.fourthScreenObject.times.tuesday.afternoon),this.times.controls.tuesday.get("evening").setValue(this.fourthScreenObject.times.tuesday.evening);break;case"wednesday":this.times.controls.wednesday.get("morning").setValue(this.fourthScreenObject.times.wednesday.morning),this.times.controls.wednesday.get("afternoon").setValue(this.fourthScreenObject.times.wednesday.afternoon),this.times.controls.wednesday.get("evening").setValue(this.fourthScreenObject.times.wednesday.evening);break;case"thursday":this.times.controls.thursday.get("morning").setValue(this.fourthScreenObject.times.thursday.morning),this.times.controls.thursday.get("afternoon").setValue(this.fourthScreenObject.times.thursday.afternoon),this.times.controls.thursday.get("evening").setValue(this.fourthScreenObject.times.thursday.evening);break;case"friday":this.times.controls.friday.get("morning").setValue(this.fourthScreenObject.times.friday.morning),this.times.controls.friday.get("afternoon").setValue(this.fourthScreenObject.times.friday.afternoon),this.times.controls.friday.get("evening").setValue(this.fourthScreenObject.times.friday.evening);break;case"saturday":this.times.controls.saturday.get("morning").setValue(this.fourthScreenObject.times.saturday.morning),this.times.controls.saturday.get("afternoon").setValue(this.fourthScreenObject.times.saturday.afternoon),this.times.controls.saturday.get("evening").setValue(this.fourthScreenObject.times.saturday.evening);break;case"sunday":this.times.controls.sunday.get("morning").setValue(this.fourthScreenObject.times.sunday.morning),this.times.controls.sunday.get("afternoon").setValue(this.fourthScreenObject.times.sunday.afternoon),this.times.controls.sunday.get("evening").setValue(this.fourthScreenObject.times.sunday.evening)}}deleteCompany(i){this.companies.removeAt(i)}deleteSecondTabCompany(i){this.companiesSecondTab.removeAt(i)}deleteDegree(i){this.degrees.removeAt(i)}deleteLanguage(i){this.languages.removeAt(i)}deleteCity(i){this.cities.removeAt(i)}
3setBackgroundColor(){const i=document.getElementsByClassName("app-bc-color");0!==i.length&&(i[0].style.backgroundColor=this.websiteService.getBackgroundColor())}getValue(i,a){"teacher"==i?this.yesNoValueTeacher=a:"student"==i?this.yesNoValueStudent=a:"license"==i?(this.yesNoValueLicense=a,this.fourthTab.controls.driversLicense.setValue(a.toString())):"car"==i?(this.yesNoValueCar=a,this.fourthTab.controls.possessionOfACar.setValue(a.toString())):"online"==i&&(this.yesNoValueTeachOnline=a,this.fourthTab.controls.iCanTeachOnline.setValue(a.toString()))}addDropdownData(i,a){let s=[];if(i)if(1==a||2==a)["CVOwner","CVManager","CVEmployee"].forEach(p=>{i.forEach(d=>{-1!==p.toLowerCase().indexOf(d)&&(s=[...s,{value:d,label:this.translateService.instant(p)}])})}),1==a?this.employmentSelect=s:this.employmentSecondTabSelect=s;else if(3==a){for(var r=0;r<i.length;r++)s=[...s,{value:i[r].id,label:i[r].label}];this.degreesSelect=s}else if(4==a){for(let l in i)s=[...s,{value:l,label:i[l]}];this.languagesSelect=s}else if(5==a||6==a){for(r=0;r<i.length;r++)s=[...s,{value:i[r].id,label:i[r].name}];5==a?this.citiesSelect=s:(this.levelSelect=s,this.levelSelect.sort(this.sortOptions))}}sortOptions(i,a){return i.value>a.value?-1:i.value<a.value?1:0}markControlsTouched(i){Object.keys(i.controls).forEach(a=>{const s=i.controls[a];s instanceof c.J3||s instanceof c.Bm?this.markControlsTouched(s):s.markAsTouched()})}firstTabSubmit(){this.firstTab.valid?(this.firstTabSubmitData=this.firstTab.getRawValue(),this.firstTabSubmitData.workExperience=this.getFormattedDates(this.firstTabSubmitData.workExperience),this.visible=!0,this.teacherService.getCVTab(1,"put",this.firstTabSubmitData).subscribe(i=>{this.visible=!1,this.toastrService.success(this.successMessage)},i=>{this.visible=!1,this.toastrService.error(this.errorMessage)})):this.markControlsTouched(this.firstTab)}secondTabSubmit(){1==this.yesNoValueTeacher?this.secondTab.get("knownTeacher").enable():(this.secondTab.controls.knownTeacher.setValue(""),this.secondTab.get("knownTeacher").disable()),this.secondTab.valid?(this.secondTabSubmitData=this.secondTab.getRawValue(),this.secondTabSubmitData.workExperience=this.getFormattedDates(this.secondTabSubmitData.workExperience),this.visible=!0,this.teacherService.getCVTab(2,"put",this.secondTabSubmitData).subscribe(i=>{this.invalidTeacherId=!1,this.visible=!1,this.toastrService.success(this.successMessage)},i=>{i.error.fields&&i.error.fields.length>0&&-1!==i.error.fields[0].indexOf("Known user")&&(this.secondTab.get("knownTeacher").setErrors({incorrect:!0}),this.invalidTeacherId=!0),this.visible=!1,this.toastrService.error(this.errorMessage)})):this.markControlsTouched(this.secondTab)}thirdTabSubmit(){1==this.yesNoValueStudent?this.thirdTab.get("knownStudent").enable():(this.thirdTab.controls.knownStudent.setValue(""),this.thirdTab.get("knownStudent").disable()),this.thirdTab.valid?(this.thirdTabSubmitData=this.thirdTab.getRawValue(),this.thirdTabSubmitData.degree=this.getFormattedDates(this.thirdTabSubmitData.degree),this.visible=!0,this.teacherService.getCVTab(3,"put",this.thirdTabSubmitData).subscribe(i=>{this.invalidStudentId=!1,this.visible=!1,this.toastrService.success(this.successMessage)},i=>{i.error.fields&&i.error.fields.length>0&&-1!==i.error.fields[0].indexOf("Known student")&&(this.thirdTab.get("knownStudent").setErrors({incorrect:!0}),this.invalidStudentId=!0),this.visible=!1,this.toastrService.error(this.errorMessage)})):this.markControlsTouched(this.thirdTab)}fourthTabSubmit(){this.fourthTab.valid?(this.fourthTabSubmitData=this.fourthTab.getRawValue(),this.visible=!0,this.teacherService.getCVTab(4,"put",this.fourthTabSubmitData).subscribe(i=>{this.visible=!1,this.toastrService.success(this.successMessage)},i=>{this.visible=!1,this.toastrService.error(this.errorMessage)})):this.markControlsTouched(this.fourthTab)}fifthTabSubmit(){this.fifthTab.valid?(this.fifthTabSubmitData=this.fifthTab.getRawValue(),this.visible=!0,this.teacherService.getCVTab(5,"put",this.fifthTabSubmitData).subscribe(i=>{this.visible=!1,this.toastrService.success(this.successMessage)},i=>{this.visible=!1,this.toastrService.error(this.errorMessage)}
3)):this.markControlsTouched(this.fifthTab)}submitFiles(i=!1){var a=new FormData;if(i){var s;const[l]=this.resumeUploader.filesToUpload.getValue(),p=null!==(s=null==l?void 0:l.file)&&void 0!==s?s:l;a.append("cv",p)}else{var r;const[l]=this.motivationUploader.filesToUpload.getValue(),p=null!==(r=null==l?void 0:l.file)&&void 0!==r?r:l;a.append("portfolio",p)}this.teacherService.getCVTab(6,"post",a).pipe((0,I.Q)(this.destroy$)).subscribe({next:l=>{this.visible=!1,this.toastrService.success(this.successMessage)},error:l=>{this.visible=!1,this.toastrService.error(this.errorMessage)}})}getFormattedDates(i){return i.map(a=>{let{from:s,to:r}=a,l=(0,wt.A)(a,rp);return(0,g.A)((0,g.A)({},l),{},{from:N.I1.isDateWrapper(s)?s.format(P.x.iso.date):s,to:N.I1.isDateWrapper(r)?r.format(P.x.iso.date):r})})}}return(t=o).\u0275fac=function(i){return new(i||t)(e.rXU(Ae.j),e.rXU(S.O),e.rXU(c.ze),e.rXU(m.c$),e.rXU(op.W),e.rXU(sp.$),e.rXU(w.tw),e.rXU(ge.Kg))},t.\u0275cmp=e.VBU({type:t,selectors:[["app-teacher-cv"]],viewQuery:function(i,a){if(1&i&&(e.GBs(lp,5),e.GBs(cp,5)),2&i){let s;e.mGM(s=e.lsd())&&(a.resumeUploader=s.first),e.mGM(s=e.lsd())&&(a.motivationUploader=s.first)}},decls:299,vars:231,consts:[["alert",""],["resumeUploader",""],["motivationUploader",""],["date_picker_from",""],["date_picker_to",""],[4,"ngIf"],["id","teacher-profile",1,"container","mat-elevation-z3","sm-no-shadow","p-0","mb-0","mb-sm-5"],["backgroundColor","primary","stretchTabs","true",3,"dynamicHeight"],["bodyClass","px-3 px-md-0",3,"label"],[3,"ngSubmit","formGroup"],["formArrayName","workExperience",1,"container","py-1","px-1","px-sm-5","py-sm-4","companyContainer"],["class","position-relative",3,"formGroupName",4,"ngFor","ngForOf"],["type","button","mat-raised-button","","color","accent-inverted",1,"flat",3,"click","disabled"],[1,"fa-solid","fa-circle-plus"],[1,"container","py-1","px-1","px-sm-5","py-sm-4","socialMediaContainer"],[1,"row"],["formArrayName","socialMedia"],["class","col-lg-6 col-md-12",3,"formGroupName",4,"ngFor","ngForOf"],["formGroupName","website",1,"col-lg-6","col-md-12"],["matPrefix","",1,"fa-solid","fa-link"],["matInput","","type","text","id","description","formControlName","description"],[1,"container","py-1","px-1","px-sm-5","py-sm-4"],[1,"col-12","text-right"],["mat-raised-button","","color","primary","type","submit",3,"disabled"],["class","position-relative",3,"ngClass","formGroupName",4,"ngFor","ngForOf"],[1,"col-lg-6","col-md-12"],["appearance","fill"],["appRemoveAriaOwns",""],["matPrefix","",1,"fa-solid","fa-user"],["required","",3,"ngModelChange","ngModel","ngModelOptions"],["class","disable-checkbox",3,"value",4,"ngFor","ngForOf"],[1,"col-lg-6","col-md-12",3,"ngClass"],["matInput","","type","text","id","knownTeacher","formControlName","knownTeacher","required",""],[1,"col-12","text-right","mt-1"],["class","alert alert-warning d-inline-block",4,"ngIf"],["formArrayName","degree",1,"container","py-1","px-1","px-sm-5","py-sm-4","degreeContainer"],["matInput","","type","text","id","knownStudent","formControlName","knownStudent","required",""],["role","alert",1,"col-12","text-right","mt-1"],[1,"font-weight-bold","fs-20"],["matPrefix","",1,"fa-solid","fa-car"],["formArrayName","cities",1,"container","py-0","px-1","px-sm-5"],["matPrefix","",1,"fa-solid","fa-chalkboard-user"],["formArrayName","languageSkills",1,"container","py-1","px-1","px-sm-5","py-sm-4"],[1,"font-weight-bold","mt-3","fs-20"],["formGroupName","times",1,"container","py-1","px-1","px-sm-5","py-sm-4","timesContainer"],["formGroupName","monday"],[1,"font-weight-bold","mb-0"],["formControlName","morning"],["formControlName","afternoon",1,"pl-0","pl-md-5"],["formControlName","evening",1,"pl-0","pl-md-5"],["formGroupName","tuesday"],["formGroupName","wednesday"],["formGroupName","thursday"],["formGroupName","friday"],["formGroupName","saturday"],["formGroupName","sunday"],[1,"container","py-1","px-1","px-sm-5","py-sm-4","presentationContainer"],[1,"col-12"],["matPrefix","",1,"fa-solid","fa-envelope-open-text"],["matInput","","cdkTextareaAutosize","","cdkAutosizeMinRows","4","type","text","formControlName","motivationalLetterText","required",""],["matInput","","cdkTextareaAutosize","","cdkAutosizeMinRows","4","type","text","formControlName","presentationDraftText","required",""],[1,"row","my-4"],["placeholder","CVUploadCv",3,"maxFiles","withFab","uploadIcon","allowedFileTypes"],["mat-raised-button","","color","primary","type","button",3,"click"],["placeholder","CVUploadPortfolio",3,"maxFiles","withFab","uploadIcon","allowedFileTypes"],[1,"position-relative",3,"formGroupName"],["matPrefix","",1,"fa-solid","fa-building"],["matInput","","type","text","formControlName","companyName","required","",3,"id"],["formControlName","position"],[1,"col-12","col-lg-6"],[1,"col-12","col-md-6"],["matPrefix","",1,"fa-solid","fa-calendar-days"],["matInput","","formControlName","from","readonly","",3,"click","focus","matDatepicker","min","max"],["matIconSuffix","",3,"for"],[3,"touchUi"],["matInput","","formControlName","to","readonly","",3,"click","focus","matDatepicker","min","max"],["class","fa-solid fa-tras
3h position-absolute deleteIcon",3,"click",4,"ngIf"],[1,"disable-checkbox",3,"value"],[1,"fa-solid","fa-trash","position-absolute","deleteIcon",3,"click"],[1,"col-lg-6","col-md-12",3,"formGroupName"],["matInput","","type","text","formControlName","socialMediaLink",3,"id"],[1,"position-relative",3,"ngClass","formGroupName"],["matInput","","cdkTextareaAutosize","","cdkAutosizeMinRows","4","type","text","formControlName","jobDescription","required","",3,"id"],["matInput","","type","text","formControlName","referenceName","required","",3,"id"],["matInput","","type","text","formControlName","referenceFunction","required","",3,"id"],["matPrefix","",1,"fa-solid","fa-envelope"],["matInput","","type","email","formControlName","referenceEmail","required","",3,"id"],["matPrefix","",1,"fa-solid","fa-mobile-screen-button"],["matInput","","type","number","formControlName","referencePhoneNumber","required","",3,"id"],[2,"margin-top","var(--space-36px)"],[1,"alert","alert-warning","d-inline-block"],[1,"fa-solid","fa-triangle-exclamation"],["matPrefix","",1,"fa-solid","fa-graduation-cap"],["formControlName","degree","required",""],["matInput","","type","text","formControlName","name","required","",3,"id"],[1,"col-lg-3","col-md-6"],["formControlName","cityId","required",""],[1,"d-flex","justify-content-center","align-items-center","my-4"],[1,"font-weight-bold","km","mr-0","title-color"],["color","accent","discrete","",3,"min","max"],["formControlName","availableRadius","matSliderThumb","",3,"id"],[1,"font-weight-bold","km","ml-2","title-color"],["matPrefix","",1,"fa-solid","fa-earth-europe"],["formControlName","isoLang","required",""],["formControlName","levelId","required",""]],template:function(i,a){if(1&i){const s=e.RV6();e.DNE(0,mp,1,0,"app-spinner",5),e.j41(1,"div",6)(2,"mat-tab-group",7)(3,"mat-tab",8),e.nI1(4,"translate"),e.j41(5,"form",9),e.bIt("ngSubmit",function(){return e.eBV(s),e.Njj(a.firstTabSubmit())}),e.j41(6,"div",10),e.DNE(7,up,44,29,"section",11),e.nrm(8,"br"),e.j41(9,"button",12),e.bIt("click",function(){return e.eBV(s),e.Njj(a.addCompany())}),e.nrm(10,"i",13),e.EFF(11),e.nI1(12,"translate"),e.k0s()(),e.j41(13,"div",14)(14,"div",15),e.qex(15,16),e.DNE(16,_p,7,7,"div",17),e.bVm(),e.j41(17,"div",18)(18,"mat-form-field")(19,"mat-label"),e.EFF(20),e.nI1(21,"translate"),e.nI1(22,"translate"),e.k0s(),e.nrm(23,"i",19)(24,"input",20),e.k0s()()()(),e.j41(25,"div",21)(26,"div",15)(27,"div",22)(28,"button",23),e.EFF(29),e.nI1(30,"translate"),e.k0s()()()()()(),e.j41(31,"mat-tab",8),e.nI1(32,"translate"),e.j41(33,"form",9),e.bIt("ngSubmit",function(){return e.eBV(s),e.Njj(a.secondTabSubmit())}),e.j41(34,"div",10),e.DNE(35,gp,82,57,"section",24),e.nrm(36,"br"),e.j41(37,"button",12),e.bIt("click",function(){return e.eBV(s),e.Njj(a.addSecondTabCompany())}),e.nrm(38,"i",13),e.EFF(39),e.nI1(40,"translate"),e.k0s()(),e.j41(41,"div",21)(42,"div",15)(43,"div",25)(44,"mat-form-field",26)(45,"mat-label",27),e.EFF(46),e.nI1(47,"translate"),e.k0s(),e.nrm(48,"i",28),e.j41(49,"mat-select",29),e.mxI("ngModelChange",function(l){return e.eBV(s),e.DH7(a.yesNoValueTeacher,l)||(a.yesNoValueTeacher=l),e.Njj(l)}),e.bIt("ngModelChange",function(l){return e.eBV(s),e.Njj(a.getValue("teacher",l))}),e.DNE(50,vp,2,2,"mat-option",30),e.k0s()()(),e.j41(51,"div",31)(52,"mat-form-field")(53,"mat-label"),e.EFF(54),e.nI1(55,"translate"),e.k0s(),e.nrm(56,"i",28)(57,"input",32),e.k0s()()()(),e.j41(58,"div",21)(59,"div",15)(60,"div",22)(61,"button",23),e.EFF(62),e.nI1(63,"translate"),e.k0s()(),e.j41(64,"div",33),e.DNE(65,bp,5,3,"span",34),e.k0s()()()()(),e.j41(66,"mat-tab",8),e.nI1(67,"translate"),e.j41(68,"form",9),e.bIt("ngSubmit",function(){return e.eBV(s),e.Njj(a.thirdTabSubmit())}),e.j41(69,"div",35),e.DNE(70,xp,44,29,"section",11),e.nrm(71,"br"),e.j41(72,"button",12),e.bIt("click",function(){return e.eBV(s),e.Njj(a.addDegree())}),e.nrm(73,"i",13),e.EFF(74),e.nI1(75,"translate"),e.k0s()(),e.j41(76,"div",21)(77,"div",15)(78,"div",25)(79,"mat-form-field",26)(80,"mat-label",27),e.EFF(81),e.nI1(82,"translate"),e.k0s(),e.nrm(83,"i",28),e.j41(84,"mat-select",29),e.mxI("ngModelChange",function(l){return e.eBV(s),e.DH7(a.yesNoValueStudent,l)||(a.yesNoValueStudent=l),e.Njj(l)}),e.bIt("ngModelChange",function(l){return e.eBV(s),e.Njj(a.getValue("student",l))}),e.DNE(85,Ip,2,2,"mat-option",30),e.k0s()()(),e.j41(86,"div",31)(87,"mat-form-field")(88,"mat-label"),e.EFF(89),e.nI1(90,"translate"),e.k0s(),e.nrm(91,"i",28)(92,"input",36),e.k0s()()()(),e.j41(93,"div",21)(94,"div",15)(95,"div",22)(96,"button",23),e.EFF(97),e.nI1(98,"translate"),e.k0s()(),e.j41(99,"div",37,0),e.DNE(101,Rp,5,3,"
3span",34),e.k0s()()()()(),e.j41(102,"mat-tab",8),e.nI1(103,"translate"),e.j41(104,"form",9),e.bIt("ngSubmit",function(){return e.eBV(s),e.Njj(a.fourthTabSubmit())}),e.j41(105,"div",21)(106,"p",38),e.EFF(107),e.nI1(108,"translate"),e.k0s(),e.j41(109,"div",15)(110,"div",25)(111,"mat-form-field",26)(112,"mat-label",27),e.EFF(113),e.nI1(114,"translate"),e.k0s(),e.nrm(115,"i",39),e.j41(116,"mat-select",29),e.mxI("ngModelChange",function(l){return e.eBV(s),e.DH7(a.yesNoValueLicense,l)||(a.yesNoValueLicense=l),e.Njj(l)}),e.bIt("ngModelChange",function(l){return e.eBV(s),e.Njj(a.getValue("license",l))}),e.DNE(117,Fp,2,2,"mat-option",30),e.k0s()()(),e.j41(118,"div",25)(119,"mat-form-field",26)(120,"mat-label",27),e.EFF(121),e.nI1(122,"translate"),e.k0s(),e.nrm(123,"i",39),e.j41(124,"mat-select",29),e.mxI("ngModelChange",function(l){return e.eBV(s),e.DH7(a.yesNoValueCar,l)||(a.yesNoValueCar=l),e.Njj(l)}),e.bIt("ngModelChange",function(l){return e.eBV(s),e.Njj(a.getValue("car",l))}),e.DNE(125,kp,2,2,"mat-option",30),e.k0s()()()()(),e.j41(126,"div",40),e.DNE(127,Sp,21,22,"section",11),e.j41(128,"button",12),e.bIt("click",function(){return e.eBV(s),e.Njj(a.addCity())}),e.nrm(129,"i",13),e.EFF(130),e.nI1(131,"translate"),e.k0s()(),e.j41(132,"div",21)(133,"div",15)(134,"div",25)(135,"mat-form-field",26)(136,"mat-label",27),e.EFF(137),e.nI1(138,"translate"),e.k0s(),e.nrm(139,"i",41),e.j41(140,"mat-select",29),e.mxI("ngModelChange",function(l){return e.eBV(s),e.DH7(a.yesNoValueTeachOnline,l)||(a.yesNoValueTeachOnline=l),e.Njj(l)}),e.bIt("ngModelChange",function(l){return e.eBV(s),e.Njj(a.getValue("online",l))}),e.DNE(141,$p,2,2,"mat-option",30),e.k0s()()()()(),e.j41(142,"div",42)(143,"p",43),e.EFF(144),e.nI1(145,"translate"),e.k0s(),e.DNE(146,Gp,19,10,"section",11),e.j41(147,"button",12),e.bIt("click",function(){return e.eBV(s),e.Njj(a.addLanguage())}),e.nrm(148,"i",13),e.EFF(149),e.nI1(150,"translate"),e.k0s()(),e.j41(151,"div",44)(152,"p",38),e.EFF(153),e.nI1(154,"translate"),e.k0s(),e.j41(155,"div",45)(156,"h6",46),e.EFF(157),e.nI1(158,"translate"),e.k0s(),e.j41(159,"mat-checkbox",47),e.EFF(160),e.nI1(161,"translate"),e.k0s(),e.j41(162,"mat-checkbox",48),e.EFF(163),e.nI1(164,"translate"),e.k0s(),e.j41(165,"mat-checkbox",49),e.EFF(166),e.nI1(167,"translate"),e.k0s()(),e.j41(168,"div",50)(169,"h6",46),e.EFF(170),e.nI1(171,"translate"),e.k0s(),e.j41(172,"mat-checkbox",47),e.EFF(173),e.nI1(174,"translate"),e.k0s(),e.j41(175,"mat-checkbox",48),e.EFF(176),e.nI1(177,"translate"),e.k0s(),e.j41(178,"mat-checkbox",49),e.EFF(179),e.nI1(180,"translate"),e.k0s()(),e.j41(181,"div",51)(182,"h6",46),e.EFF(183),e.nI1(184,"translate"),e.k0s(),e.j41(185,"mat-checkbox",47),e.EFF(186),e.nI1(187,"translate"),e.k0s(),e.j41(188,"mat-checkbox",48),e.EFF(189),e.nI1(190,"translate"),e.k0s(),e.j41(191,"mat-checkbox",49),e.EFF(192),e.nI1(193,"translate"),e.k0s()(),e.j41(194,"div",52)(195,"h6",46),e.EFF(196),e.nI1(197,"translate"),e.k0s(),e.j41(198,"mat-checkbox",47),e.EFF(199),e.nI1(200,"translate"),e.k0s(),e.j41(201,"mat-checkbox",48),e.EFF(202),e.nI1(203,"translate"),e.k0s(),e.j41(204,"mat-checkbox",49),e.EFF(205),e.nI1(206,"translate"),e.k0s()(),e.j41(207,"div",53)(208,"h6",46),e.EFF(209),e.nI1(210,"translate"),e.k0s(),e.j41(211,"mat-checkbox",47),e.EFF(212),e.nI1(213,"translate"),e.k0s(),e.j41(214,"mat-checkbox",48),e.EFF(215),e.nI1(216,"translate"),e.k0s(),e.j41(217,"mat-checkbox",49),e.EFF(218),e.nI1(219,"translate"),e.k0s()(),e.j41(220,"div",54)(221,"h6",46),e.EFF(222),e.nI1(223,"translate"),e.k0s(),e.j41(224,"mat-checkbox",47),e.EFF(225),e.nI1(226,"translate"),e.k0s(),e.j41(227,"mat-checkbox",48),e.EFF(228),e.nI1(229,"translate"),e.k0s(),e.j41(230,"mat-checkbox",49),e.EFF(231),e.nI1(232,"translate"),e.k0s()(),e.j41(233,"div",55)(234,"h6",46),e.EFF(235),e.nI1(236,"translate"),e.k0s(),e.j41(237,"mat-checkbox",47),e.EFF(238),e.nI1(239,"translate"),e.k0s(),e.j41(240,"mat-checkbox",48),e.EFF(241),e.nI1(242,"translate"),e.k0s(),e.j41(243,"mat-checkbox",49),e.EFF(244),e.nI1(245,"translate"),e.k0s()()(),e.j41(246,"div",21)(247,"div",15)(248,"div",22)(249,"button",23),e.EFF(250),e.nI1(251,"translate"),e.k0s()()()()()(),e.j41(252,"mat-tab",8),e.nI1(253,"translate"),e.j41(254,"form",9),e.bIt("ngSubmit",function(){return e.eBV(s),e.Njj(a.fifthTabSubmit())}),e.j41(255,"div",56)(256,"div",15)(257,"div",57)(258,"mat-form-field")(259,"mat-label"),e.EFF(260),e.nI1(261,"translate"),e.nI1(262,"titlecase"),e.k0s(),e.nrm(263,"i",58)(264,"textarea",59),e.k0s()(),e.j41(265,"div",57)(266,"mat-form-field")(267,"mat-label"),e.EFF(268),e.nI1(269,"translate"),e.nI1(270,"titlecase"),e.k0s(),e.nrm(271,"i",58)(272,"textarea",60),e.k0s()()()(),e.j41(273,"div",21)(274,"div",15)(275,"div",22)(276,"button",23),e.EFF(277),e.nI1(278,"translate"),e.k0s()()()()(),e.j41(279,"div",56)(280,"div",15)(281,"div",25)(282,"div",61)(283,"div",57),e.nrm(284,"app-file-upload",62,1),e.k0s(),e.j41(286,"div",57)(287,"button",63),e.bIt("click",function(){return e.eBV(s),e.Njj(a.submitFiles(!0))}),e.EFF(288),e.nI1(289,"translate"),e.k0s()()()(),e.j41(290,"div",25)(291,"div",61)(292,"div",57),e.nrm(293,"app-file-upload",64,2),e.k0s(),e.j41(295,"div",57)(296,"button",63),e.bIt("click",function(){return e.eBV(s),e.Njj(a.submitFiles())}),e.EFF(297),e.nI1(298,"translate"),e.k0s()()()()()()()()()}2&i&&(e.Y8G("ngIf",a.visible),e.R7$(2),e.Y8G("dynamicHeight",!0),e.R7$(),e.Y8G("label",e.bMT(4,104,"CVmyExperienceAsEntrepreneur")),e.R7$(2),e.Y8G("formGroup",a.firstTab),e.R7$(2),e.Y8G("ngForOf",a.companies.controls),e.R7$(2),e.Y8G("disabled",a.companies.length>29||null),e.R7$(2),e.SpI(" ",e.bMT(12,106,"CVaddEnterpreneurialExperience")," "),e.R7$(5),e.Y8G("ngForOf",a.socials.controls),e.R7$(4),e.Lme("",e.bMT(21,108,"CVlinkTo")," ",e.bMT(22,110,"website"),""),e.R7$(9),e.JRh(e.bMT(30,112,"save")),e.R7$(2),e.Y8G("label",e.bMT(32,114,"CVmyExperience")),e.R7$(2),e.Y8G("formGroup",a.secondTab),e.R7$(2),e.Y8G("ngForOf",a.companiesSecondTab.controls),e.R7$(2),e.Y8G("disabled",a.companiesSecondTab.length>29||null),e.R7$(2),e.SpI(" ",e.bMT(40,116,"CvaddExperience")," "),e.R7$(7),e.JRh(e.bMT(47,118,"CVexistingTeacher")),e.R7$(3),e.R50("ngModel",a.yesNoValueTeacher),e.Y8G("ngModelOptions",e.lJ4(226,Ue)),e.R7$(),e.Y8G("ngForOf",a.yesNoSelect),e.R7$(),e.Y8G("ngClass",0==a.yesNoValueTeacher?"d-none":"d-block"),e.R7$(3),e.JRh(e.bMT(55,120,"CVteacherID")),e.R7$(8),e.JRh(e.bMT(63,122,"save")),e.R7$(3),e.Y8G("ngIf",a.invalidTeacherId),e.R7$(),e.Y8G("label",e.bMT(67,124,"CVmyTraining")),e.R7$(2),e.Y8G("formGroup",a.thirdTab),e.R7$(2),e.Y8G("ngForOf",a.degrees.controls),e.R7$(2),e.Y8G("disabled",a.degrees.length>29||null),e.R7$(2),e.SpI(" ",e.bMT(75,126,"CVaddCourse")," "),e.R7$(7),e.JRh(e.bMT(82,128,"CVexistingStudent")),e.R7$(3),e.R50("ngModel",a.yesNoValueStudent),e.Y8G("ngModelOptions",e.lJ4(227,Ue)),e.R7$(),e.Y8G("ngForOf",a.yesNoSelect),e.R7$(),e.Y8G("ngClass",0==a.yesNoValueStudent?"d-none":"d-block"),e.R7$(3),e.JRh(e.bMT(90,130,"CVstudentID")),e.R7$(8),e.JRh(e.bMT(98,132,"save")),e.R7$(4),e.Y8G("ngIf",a.invalidStudentId),e.R7$(),e.Y8G("label",e.bMT(103,134,"CVadditionalInfo")),e.R7$(2),e.Y8G("formGroup",a.fourthTab),e.R7$(3),e.JRh(e.bMT(108,136,"CVadditionalData")),e.R7$(6),e.JRh(e.bMT(114,138,"CVdriversLicense")),e.R7$(3),e.R50("ngModel",a.yesNoValueLicense),e.Y8G("ngModelOptions",e.lJ4(228,Ue)),e.R7$(),e.Y8G("ngForOf",a.yesNoSelect),e.R7$(4),e.JRh(e.bMT(122,140,"CVpersonalVehicle")),e.R7$(3),e.R50("ngModel",a.yesNoValueCar),e.Y8G("ngModelOptions",e.lJ4(229,Ue)),e.R7$(),e.Y8G("ngForOf",a.yesNoSelect),e.R7$(2),e.Y8G("ngForOf",a.cities.controls),e.R7$(),e.Y8G("disabled",a.cities.length>29||null),e.R7$(2),e.SpI(" ",e.bMT(131,142,"CVaddCity")," "),e.R7$(7),e.JRh(e.bMT(138,144,"CVteachOnline")),e.R7$(3),e.R50("ngModel",a.yesNoValueTeachOnline),e.Y8G("ngModelOptions",e.lJ4(230,Ue)),e.R7$(),e.Y8G("ngForOf",a.yesNoSelect),e.R7$(3),e.JRh(e.bMT(145,146,"CVlanguageSkills")),e.R7$(2),e.Y8G("ngForOf",a.languages.controls),e.R7$(),e.Y8G("disabled",a.languages.length>29||null),e.R7$(2),e.SpI(" ",e.bMT(150,148,"CVaddLanguage")," "),e.R7$(4),e.JRh(e.bMT(154,150,"CVavailability")),e.R7$(4),e.JRh(e.bMT(158,152,"monday")),e.R7$(3),e.JRh(e.bMT(161,154,"CVMorning")),e.R7$(3),e.JRh(e.bMT(164,156,"CVAfternoon")),e.R7$(3),e.JRh(e.bMT(167,158,"CVEvening")),e.R7$(4),e.JRh(e.bMT(171,160,"tuesday")),e.R7$(3),e.JRh(e.bMT(174,162,"CVMorning")),e.R7$(3),e.JRh(e.bMT(177,164,"CVAfternoon")),e.R7$(3),e.JRh(e.bMT(180,166,"CVEvening")),e.R7$(4),e.JRh(e.bMT(184,168,"wednesday")),e.R7$(3),e.JRh(e.bMT(187,170,"CVMorning")),e.R7$(3),e.JRh(e.bMT(190,172,"CVAfternoon")),e.R7$(3),e.JRh(e.bMT(193,174,"CVEvening")),e.R7$(4),e.JRh(e.bMT(197,176,"thursday")),e.R7$(3),e.JRh(e.bMT(200,178,"CVMorning")),e.R7$(3),e.JRh(e.bMT(203,180,"CVAfternoon")),e.R7$(3),e.JRh(e.bMT(206,182,"CVEvening")),e.R7$(4),e.JRh(e.bMT(210,184,"friday")),e.R7$(3),e.JRh(e.bMT(213,186,"CVMorning")),e.R7$(3),e.JRh(e.bMT(216,188,"CVAfternoon")),e.R7$(3),e.JRh(e.bMT(219,190,"CVEvening")),e.R7$(4),e.JRh(e.bMT(223,192,"saturday")),e.R7$(3),e.JRh(e.bMT(226,194,"CVMorning")),e.R7$(3),e.JRh(e.bMT(229,196,"CVAfternoon")),e.R7$(3),e.JRh(e.bMT(232,198,"CVEvening")),e.R7$(4),e.JRh(e.bMT(236,200,"sunday")),e.R7$(3),e.JRh(e.bMT(239,202,"CVMorning")),e.R7$(3),e.JRh(e.bMT(242,204,"CVAfternoon")),e.R7$(3),e.JRh(e.bMT(245,206,"CVEvening")),e.R7$(6),e.JRh(e.bMT(251,208,"save")),e.R7$(2),e.Y8G("label",e.bMT(253,210,"CVPresentationLabel")),e.R7$(2),e.Y8G("formGroup",a.fifthTab),e.R7$(6),e.JRh(e.bMT(262,214,e.bMT(261,212,"CVmotivationalLetter"))),e.R7$(8),e.JRh(e.bMT(270,218,e.bMT(269,216,"CVPresentation"))),e.R7$(9),e.JRh(e.bMT(278,220,"save")),e.R7$(7),e.Y8G("maxFiles",1)("withFab",!0)("uploadIcon",!0)("allowedFileTypes",a.allowedFileTypes),e.R7$(4),e.SpI(" ",e.bMT(289,222,"CVUploadCv")," "),e.R7$(5),e.Y8G("maxFiles",1)("withFab",!0)("uploadIcon",!0)("allowedFileTypes",a.allowedFileTypes),e.R7$(4),e.SpI(" ",e.bMT(298,224,"CVUploadPortfolio")," "))}
3,dependencies:[u.YU,u.Sq,u.bT,c.qT,c.me,c.Q0,c.BC,c.cb,c.YS,c.vS,c.j4,c.JD,c.$R,c.v8,E.$z,ne.fg,A.rl,A.nJ,A.MV,A.JW,A.yw,Me.xb,xe.VO,Ie.wT,ut.Vh,ut.bZ,ut.bU,Xe.So,Zt.mq,Zt.T8,en.IV,en.OU,he.t,ze.P,Be.K,u.PV,m.D9],styles:["#teacher-profile[_ngcontent-%COMP%]{overflow:hidden}#teacher-profile[_ngcontent-%COMP%] .deleteIcon[_ngcontent-%COMP%]{top:var(--space-25px)!important;right:var(--space-negative-25px)!important;cursor:pointer}.km[_ngcontent-%COMP%]{min-width:var(--size-55px)!important}\n\n/*# sourceMappingURL=teacher-cv.component.css.map*/"]}),o})();var Op=f(79462);let Ap=(()=>{var t;class o{constructor(i,a){this.teacherService=i,this.elRef=a}ngOnInit(){this.sub$=this.teacherService.getFullScreen().subscribe(i=>{this.isFullscreen=i,this.elRef.nativeElement.style.display=this.isFullscreen?"none":"block"})}ngOnDestroy(){this.sub$&&this.sub$.unsubscribe()}}return(t=o).\u0275fac=function(i){return new(i||t)(e.rXU(S.O),e.rXU(e.aKT))},t.\u0275dir=e.FsC({type:t,selectors:[["","appComponentFullscreen",""]]}),o})();const Np=t=>({"active-header":t});function Lp(t,o){if(1&t){const n=e.RV6();e.j41(0,"div",1)(1,"div",2)(2,"div",3)(3,"a",4),e.bIt("click",function(){e.eBV(n);const a=e.XpG();return e.Njj(a.route?null:a.handleClick())})("keydown.enter",function(){e.eBV(n);const a=e.XpG();return e.Njj(a.route?null:a.handleClick())}),e.nrm(4,"i",5),e.j41(5,"strong"),e.EFF(6),e.nI1(7,"translate"),e.k0s()()()()()}if(2&t){const n=e.XpG();e.Y8G("ngClass",e.eq3(6,Np,n.isDesktop)),e.R7$(3),e.Y8G("routerLink",n.route?n.route:null)("flat",!0),e.R7$(3),e.JRh(e.bMT(7,4,n.text))}}let nn=(()=>{var t;class o{constructor(i,a){this.teacherService=i,this.deviceService=a,this.isDesktop=this.deviceService.isDesktop()}ngOnInit(){this.fullscreen$=this.teacherService.getFullScreen().subscribe(i=>this.isFullscreen=i),this.text$=this.teacherService.getBackBtnText().subscribe(i=>this.text=i),this.route$=this.teacherService.getBackBtnRoute().subscribe(i=>this.route=i)}handleClick(){this.teacherService.setBackBtnClicked(!0)}ngOnDestroy(){this.teacherService.setFullScreen(!1),this.teacherService.setBackBtnRoute(null),this.fullscreen$&&this.fullscreen$.unsubscribe(),this.text$&&this.text$.unsubscribe(),this.route$&&this.route$.unsubscribe()}}return(t=o).\u0275fac=function(i){return new(i||t)(e.rXU(S.O),e.rXU(ge.Kg))},t.\u0275cmp=e.VBU({type:t,selectors:[["app-close-fullscreen"]],decls:1,vars:1,consts:[[3,"ngClass",4,"ngIf"],[3,"ngClass"],[1,"container"],[1,"row"],["mat-flat-button","","color","primary-inverted","id","backBtn","type","button",1,"mb-2",3,"click","keydown.enter","routerLink","flat"],[1,"fas","fa-angle-left","mr-1"]],template:function(i,a){1&i&&e.DNE(0,Lp,8,8,"div",0),2&i&&e.Y8G("ngIf",a.isFullscreen)},dependencies:[u.YU,u.bT,E.It,O.Wk,m.D9],styles:["#backBtn[_ngcontent-%COMP%]{text-transform:var(--text-transform-none)}\n\n/*# sourceMappingURL=close-fullscreen.component.css.map*/"]}),o})();const Yp=()=>["/teacher/courses"],Vp=t=>({"desktop-margin":t}),Pp=t=>({container:t}),Xp=(t,o)=>({"mat-elevation-z3 sm-no-shadow":t,"row mb-0 mb-sm-5":o}),Bp=t=>({"col-12":t});function qp(t,o){1&t&&e.nrm(0,"app-spinner")}function Up(t,o){if(1&t&&(e.j41(0,"div")(1,"div",6)(2,"div",6),e.nrm(3,"app-ecampus-navigation",1),e.j41(4,"div",6),e.nrm(5,"router-outlet"),e.k0s()()()()),2&t){const n=e.XpG();e.R7$(),e.Y8G("ngClass",e.eq3(4,Pp,!n.isolation)),e.R7$(),e.Y8G("ngClass",e.l_i(6,Xp,!n.isolation,!n.isolation)),e.R7$(),e.Y8G("hidden",n.isolation),e.R7$(),e.Y8G("ngClass",e.eq3(9,Bp,!n.isolation))}}let Jp=(()=>{var t;class o{constructor(i,a,s,r,l){this.route=i,this.teacherService=a,this.websiteService=s,this.deviceService=r,this.cdRef=l,this.isVisible=!1,this.isDesktop=this.deviceService.isDesktop()||this.deviceService.isTablet(),this.isolation=!1,this.destroy$=new y.B}ngOnInit(){this.websiteService.getIsolation().pipe((0,I.Q)(this.destroy$)).subscribe(i=>{this.isolation=i}),this.id=+this.route.snapshot.firstChild.params.id,this.teacherService.getTeacherCourseDetails(this.id).pipe((0,R.T)(i=>i.body.data),(0,I.Q)(this.destroy$)).subscribe(i=>{this.courseData=i,this.teacherService.setCurrentCourse(this.courseData),this.isVisible=!0})}ngAfterContentChecked(){this.cdRef.detectChanges()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),this.teacherService.resetCurrentCourse()}}return(t=o).\u0275fac=function(i){return new(i||t)(e.rXU(O.nX),e.rXU(S.O),e.rXU(Ae.j),e.rXU(ge.Kg),e.rXU(e.gRc))},t.\u0275cmp=e.VBU({type:t,selectors:[["app-teacher-ecampus"]],decls:10,vars:12,consts:[[4,"ngIf"],["appComponentFullscreen","",3,"hidden"],[1,"container","p-0"],["mat-flat-button","","color","primary-inverted","id","backToCourseBtn","type","button",1,"mb-2",3,"routerLink","ngClass"],[1,"fas","fa-angle-left","mr-1"],[3,"hidden"],[3,"ngClass"]],template:function(i,a){1&i&&(e.DNE(0,qp,1,0,"app-spinner",0),e.j41(1,"div",1)(2,"div",2)(3,"a",3),e.nrm(4,"i",4),e.j41(5,"strong"),e.EFF(6),e.nI1(7,"translate"),e.k0s()()()(),e.nrm(8,"app-close-fullscreen",5),e.DNE(9,Up,6,11,"div",0)),2&i&&(e.Y8G("ngIf",!a.isVisible),e.R7$(),e.Y8G("hidden",a.isolation),e.R7$(2),e.Y8G("routerLink",e.lJ4(9,Yp))("ngClass",e.eq3(10,Vp,a.isDesktop)),e.R7$(3),e.JRh(e.bMT(7,7,"myCourses")),e.R7$(2),e.Y8G("hidden",a.isolation),e.R7$(),e.Y8G("ngIf",a.isVisible))},dependencies:[u.YU,u.bT,Op.O,E.It,he.t,O.n3,O.Wk,Ap,nn,m.D9],styles:["#backToCourseBtn[_ngcontent-%COMP%]{text-transform:var(--text-transform-none)}\n\n/*# sourceMappingURL=teacher-ecampus.component.css.map*/"]}),o})();var _t=f(10682);let an=(()=>{var t;class o{constructor(){this.configService=(0,e.WQX)(Ce.w),this.http=(0,e.WQX)(ue.Qq),this.websiteService=(0,e.WQX)(Ae.j),this.router=(0,e.WQX)(O.Ix),this.loaderService=(0,e.WQX)(Kt.Z),this.CDO_API="".concat(this.configService.getCdoUrl(),"api"),this.CDO_API_TEACHER="".concat(this.CDO_API,"/teacher")}getTeacherInvitations(){const i="".concat(this.CDO_API_TEACHER,"/invitations"),a=new ue.Lr({"Accept-Language":this.websiteService.getLang()});return this.get(i,a)}getTeacherAvailablePlannings(){const i="".concat(this.CDO_API,"/recruitment/available_plannings");return this.get(i)}getPlanningInfoInvitation(i){const a="".concat(this.CDO_API,"/course/planning/").concat(i),s=new ue.Lr({"Accept-Language":this.websiteService.getLang()});return this.get(a,s)}postTeacherAvailablePlannings(i){const a="".concat(this.CDO_API,"/recruitment/available_plannings");return this.post(a,i)}patchInvitationStatus(i){const a="".concat(this.CDO_API,"/teacher/invitation");return this.http.patch(a,JSON.stringify(i),{observe:"response"})}reload(){this.loaderService.setIsLoading(!1);const i=this.router.url;this.router.navigateByUrl("/",{skipLocationChange:!0}).then(()=>{this.router.navigate([i])})}get(i,a){return this.http.get(i,{headers:a,observe:"response"})}post(i,a,s){return this.http.post(i,a,{headers:s,observe:"response"})}}return(t=o).\u0275fac=function(i){return new(i||t)},t.\u0275prov=e.jDH({token:t,factory:t.\u0275fac,providedIn:"root"}),o})();var Qp=f(14102),zp=f(2634),Wp=f(64615);const Hp=["acceptDialog"],Kp=["infoDialog"],Zp=t=>({"mt-2":t}),nt=(t,o)=>({left:t,right:o}),ed=t=>
3({item:t,isTable:!0}),ht=(t,o,n)=>[t,o,n],on=t=>({item:t}),sn=t=>({item:t,isTable:!1}),td=(t,o)=>[t,o],it=t=>({success:t}),nd=(t,o)=>({"text-success fa-check":t,"text-danger fa-times":o}),id=t=>({"flex-column flex-md-row":t});function ad(t,o){1&t&&e.nrm(0,"app-spinner")}function od(t,o){if(1&t&&(e.j41(0,"p",7),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t){const n=e.XpG();e.Y8G("ngClass",e.eq3(4,Zp,"applicant"===n.invitationsType&&n.planningInvitations.length)),e.R7$(),e.SpI(" ",e.bMT(2,2,"teacher"===n.invitationsType?"bookingShortIntro":"invAvailableIntro")," ")}}function sd(t,o){1&t&&(e.j41(0,"th",28),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.JRh(e.bMT(2,1,"courseNameLabel")))}function rd(t,o){if(1&t&&(e.j41(0,"td",29),e.EFF(1),e.k0s()),2&t){const n=o.$implicit;e.R7$(),e.JRh(null==n?null:n.courseName)}}function ld(t,o){1&t&&(e.j41(0,"th",28),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.JRh(e.bMT(2,1,"lessonDay")))}function cd(t,o){if(1&t&&(e.j41(0,"td",29),e.EFF(1),e.k0s()),2&t){const n=o.$implicit;e.R7$(),e.JRh(null==n?null:n.weekDay)}}function md(t,o){1&t&&(e.j41(0,"th",28),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.JRh(e.bMT(2,1,"firstLesson")))}function pd(t,o){if(1&t&&(e.j41(0,"td",29),e.EFF(1),e.k0s()),2&t){const n=o.$implicit;e.R7$(),e.JRh(null==n?null:n.startDate)}}function dd(t,o){1&t&&(e.j41(0,"th",28),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.JRh(e.bMT(2,1,"lastLesson")))}function ud(t,o){if(1&t&&(e.j41(0,"td",29),e.EFF(1),e.k0s()),2&t){const n=o.$implicit;e.R7$(),e.JRh(null==n?null:n.endDate)}}function _d(t,o){1&t&&(e.j41(0,"th",28),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.JRh(e.bMT(2,1,"cityStartdata")))}function hd(t,o){if(1&t&&(e.j41(0,"td",29),e.EFF(1),e.k0s()),2&t){const n=o.$implicit;e.R7$(),e.JRh(null==n?null:n.city)}}function fd(t,o){1&t&&(e.j41(0,"th",28),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.JRh(e.bMT(2,1,"allLessons")))}function gd(t,o){if(1&t&&(e.j41(0,"td",29),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t){const n=o.$implicit;e.R7$(),e.JRh(e.i5U(2,1,"typography.dash",e.l_i(4,nt,null==n?null:n.startTime,null==n?null:n.endTime)))}}function vd(t,o){1&t&&(e.j41(0,"th",28),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.JRh(e.bMT(2,1,"moreInfo")))}function bd(t,o){if(1&t){const n=e.RV6();e.j41(0,"td",29)(1,"button",30),e.bIt("click",function(){const a=e.eBV(n).$implicit,s=e.XpG(2);return e.Njj(s.getPlanningInfo(a))}),e.nrm(2,"i",31),e.k0s()()}}function Td(t,o){if(1&t&&(e.j41(0,"th",28)(1,"span"),e.EFF(2),e.nI1(3,"translate"),e.k0s()()),2&t){const n=e.XpG(2);e.R7$(2),e.JRh(e.bMT(3,1,"teacher"===n.invitationsType?"approved":"invAvailable"))}}function Cd(t,o){if(1&t&&(e.j41(0,"td",29)(1,"div",32),e.eu8(2,33),e.k0s()()),2&t){const n=o.$implicit;e.XpG(2);const i=e.sdS(9);e.R7$(2),e.Y8G("ngTemplateOutlet",i)("ngTemplateOutletContext",e.eq3(2,ed,n))}}function xd(t,o){1&t&&e.nrm(0,"tr",34)}function Id(t,o){1&t&&e.nrm(0,"tr",35)}function Rd(t,o){if(1&t&&(e.j41(0,"div",8)(1,"div",10)(2,"p",11),e.EFF(3),e.nI1(4,"translate"),e.k0s()(),e.j41(5,"div",12)(6,"div",13)(7,"table",14),e.qex(8,15),e.DNE(9,sd,3,3,"th",16)(10,rd,2,1,"td",17),e.bVm(),e.qex(11,18),e.DNE(12,ld,3,3,"th",16)(13,cd,2,1,"td",17),e.bVm(),e.qex(14,19),e.DNE(15,md,3,3,"th",16)(16,pd,2,1,"td",17),e.bVm(),e.qex(17,20),e.DNE(18,dd,3,3,"th",16)(19,ud,2,1,"td",17),e.bVm(),e.qex(20,21),e.DNE(21,_d,3,3,"th",16)(22,hd,2,1,"td",17),e.bVm(),e.qex(23,22),e.DNE(24,fd,3,3,"th",16)(25,gd,3,7,"td",17),e.bVm(),e.qex(26,23),e.DNE(27,vd,3,3,"th",16)(28,bd,3,0,"td",17),e.bVm(),e.qex(29,24),e.DNE(30,Td,4,3,"th",16)(31,Cd,3,4,"td",17),e.bVm(),e.DNE(32,xd,1,0,"tr",25)(33,Id,1,0,"tr",26),e.k0s(),e.nrm(34,"mat-paginator",27,4),e.k0s()()()),2&t){const n=e.XpG();e.FS9("id",n.invitationsType),e.R7$(3),e.JRh(e.bMT(4,8,"startdataLabel")),e.R7$(4),e.Mz_("id","",n.invitationsType,"PlanningTable"),e.Y8G("dataSource",n.tableData),e.R7$(25),e.Y8G("matHeaderRowDef",n.baseTableColumns),e.R7$(),e.Y8G("matRowDefColumns",n.baseTableColumns),e.R7$(),e.Y8G("pageSize",n.maxVisibleItems)}}function Fd(t,o){if(1&t&&(e.j41(0,"p",46),e.nrm(1,"app-course-duration-info",50),e.k0s()),2&t){const n=e.XpG(2).$implicit;e.R7$(),e.Y8G("numClasses",n.numClasses)("type",null==n?null:n.type)("subtype",null==n?null:n.subtype)}}function kd(t,o){1&t&&(e.nrm(0,"i",56),e.nI1(1,"translate")),2&t&&e.Y8G("matTooltip",e.bMT(1,1,"vacancies_urgent"))}function yd(t,o){if(1&t){const n=e.RV6();e.j41(0,"div",49)(1,"div",10)(2,"div",51)(3,"div",52)(4,"p",53)(5,"span",54),e.
3EFF(6),e.nI1(7,"translate"),e.nI1(8,"translate"),e.k0s(),e.EFF(9),e.k0s(),e.j41(10,"p",53)(11,"span",54),e.EFF(12),e.nI1(13,"translate"),e.nI1(14,"translate"),e.k0s(),e.EFF(15),e.k0s(),e.j41(16,"p",53)(17,"span",54),e.EFF(18),e.nI1(19,"translate"),e.nI1(20,"translate"),e.k0s(),e.EFF(21),e.k0s(),e.j41(22,"p",53)(23,"span",54),e.EFF(24),e.nI1(25,"translate"),e.nI1(26,"translate"),e.k0s(),e.EFF(27),e.k0s(),e.j41(28,"p",53)(29,"span",54),e.EFF(30),e.nI1(31,"translate"),e.nI1(32,"translate"),e.k0s(),e.EFF(33),e.nI1(34,"translate"),e.k0s()(),e.j41(35,"div",55)(36,"button",30),e.bIt("click",function(){const a=e.eBV(n).$implicit,s=e.XpG(4);return e.Njj(s.getPlanningInfo(a))}),e.nrm(37,"i",31),e.k0s(),e.DNE(38,kd,2,3,"i",56),e.k0s()(),e.j41(39,"div",57),e.eu8(40,33),e.k0s()()()}if(2&t){const n=o.$implicit;e.XpG(4);const i=e.sdS(9);e.R7$(6),e.Lme("",e.bMT(7,18,"lessonDay"),"",e.bMT(8,20,"typography.colon"),""),e.R7$(3),e.SpI(" ",n.weekDay," "),e.R7$(3),e.Lme("",e.bMT(13,22,"firstLesson"),"",e.bMT(14,24,"typography.colon"),""),e.R7$(3),e.SpI(" ",n.startDate," "),e.R7$(3),e.Lme("",e.bMT(19,26,"lastLesson"),"",e.bMT(20,28,"typography.colon"),""),e.R7$(3),e.SpI(" ",n.endDate," "),e.R7$(3),e.Lme("",e.bMT(25,30,"city"),"",e.bMT(26,32,"typography.colon"),""),e.R7$(3),e.SpI(" ",n.city," "),e.R7$(3),e.Lme("",e.bMT(31,34,"allLessons"),"",e.bMT(32,36,"typography.colon"),""),e.R7$(3),e.SpI(" ",e.i5U(34,38,"typography.dash",e.l_i(41,nt,n.startTime,n.endTime))," "),e.R7$(5),e.vxM(1==+n.urgent?38:-1),e.R7$(2),e.Y8G("ngTemplateOutlet",i)("ngTemplateOutletContext",e.eq3(44,sn,n))}}function Ed(t,o){if(1&t&&(e.j41(0,"mat-accordion",37)(1,"mat-expansion-panel",38,5)(3,"mat-expansion-panel-header",39)(4,"div",40)(5,"div",41)(6,"a",42),e.nI1(7,"routeT"),e.nI1(8,"seoFriendlyFormat"),e.nI1(9,"seoFriendlyFormat"),e.j41(10,"h5",43),e.eu8(11,33),e.k0s()(),e.j41(12,"button",44),e.nrm(13,"i",45),e.k0s()(),e.DNE(14,Fd,2,3,"p",46),e.k0s()(),e.j41(15,"div",47),e.nrm(16,"mat-divider",48),e.Z7z(17,yd,41,46,"div",49,e.Vm6),e.k0s()()()),2&t){const n=e.sdS(2),i=e.XpG().$implicit;e.XpG(2);const a=e.sdS(11);e.R7$(),e.Y8G("hideToggle",!0)("expanded",n.expanded),e.R7$(5),e.Y8G("routerLink",e.sMw(13,ht,e.bMT(7,7,"/course"),e.bMT(8,9,i.courseName),e.bMT(9,11,i.code))),e.R7$(5),e.Y8G("ngTemplateOutlet",a)("ngTemplateOutletContext",e.eq3(17,on,i)),e.R7$(2),e.Y8G("ngClass",n.expanded?"fa-minus":"fa-plus"),e.R7$(),e.vxM(null!=i&&i.numClasses?14:-1),e.R7$(3),e.Dyx(null==i?null:i.invitations)}}function Sd(t,o){if(1&t&&(e.j41(0,"div",36),e.DNE(1,Ed,19,19,"mat-accordion",37),e.k0s()),2&t){const n=o.$implicit;e.R7$(),e.vxM(null!=n&&n.invitations&&null!=n&&n.invitations.length?1:-1)}}function $d(t,o){if(1&t&&(e.j41(0,"div",9)(1,"div",10),e.Z7z(2,Sd,2,1,"div",36,e.Vm6),e.k0s()()),2&t){const n=e.XpG();e.R7$(2),e.Dyx(n.planningInvitations)}}function Md(t,o){1&t&&(e.j41(0,"th",28),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.JRh(e.bMT(2,1,"bookingCoursePart")))}function wd(t,o){if(1&t&&(e.j41(0,"td",29),e.EFF(1),e.k0s()),2&t){const n=o.index;e.R7$(),e.JRh(n+1)}}function jd(t,o){1&t&&(e.j41(0,"th",28),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.JRh(e.bMT(2,1,"lessonDay")))}function Gd(t,o){if(1&t&&(e.j41(0,"td",29),e.EFF(1),e.nI1(2,"localeDateString"),e.k0s()),2&t){const n=o.$implicit;e.R7$(),e.JRh(e.bMT(2,1,n.date))}}function Dd(t,o){1&t&&(e.j41(0,"th",28),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.JRh(e.bMT(2,1,"allLessons")))}function Od(t,o){if(1&t&&(e.j41(0,"td",29),e.EFF(1),e.nI1(2,"slice"),e.nI1(3,"slice"),e.nI1(4,"translate"),e.k0s()),2&t){const n=o.$implicit;e.R7$(),e.SpI(" ",e.i5U(4,9,"typography.dash",e.l_i(12,nt,e.brH(2,1,n.startTime,0,5),e.brH(3,5,n.endTime,0,5)))," ")}}function Ad(t,o){1&t&&(e.j41(0,"th",28),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.JRh(e.bMT(2,1,"locationFilter")))}function Nd(t,o){if(1&t&&(e.j41(0,"td",29),e.EFF(1),e.k0s()),2&t){const n=e.XpG(4);e.R7$(),e.JRh(n.popupInfo.CampName)}}function Ld(t,o){1&t&&(e.j41(0,"th",28),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.JRh(e.bMT(2,1,"classroom")))}function Yd(t,o){if(1&t&&(e.j41(0,"td",29),e.EFF(1),e.k0s()),2&t){const n=o.$implicit;e.R7$(),e.JRh(n.classRoomName)}}function Vd(t,o){1&t&&(e.j41(0,"th",28),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.JRh(e.bMT(2,1,"teacherLabel")))}function Pd(t,o){1&t&&(e.j41(0,"button",85),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.JRh(e.bMT(2,1,"bookingPending")))}function Xd(t,o){if(1&t&&(e.j41(0,"span"),e.EFF(1),e.k0s()),2&t){const n=e.XpG(5);e.R7$(),e.Lme("",n.popupInfo.Firstname," ",n.popupInfo.Lastname,"")}}function Bd(t,o){1&t&&(e.j41(0,"button",86),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.JRh(e.bMT(2,1,"bookingWanted")))}function qd(t,o){if(1&t&&(e.j41(0,"td",29),e.DNE(1,Pd,3,3,"button",85)(2,Xd,2,2,"span")(3,Bd,3,3,"button",86),e.k0s()),2&t){let n;const i=e.XpG(4);e.R7$(),e.vxM("pending"===(n=i.popupInfo.status)?1:"booked"===n?2:3)}}function Ud(t,o){1&t&&e.nrm(0,"tr",34)}function Jd(t,o){1&t&&e.nrm(0,"tr",35)}function Qd(t,o){if(1&t&&(e.j41(0,"div",77)(1,"div",13)(2,"table",79),e.qex(3,80),e.DNE(4,Md,3,3,"th",16)(5,wd,2,1,"td",17),e.bVm(),e.qex(6,81),e.DNE(7,jd,3,3,"th",16)(8,Gd,3,3,"td",17),e.bVm(),e.qex(9,22),e.DNE(10,Dd,3,3,"th",16)(11,Od,5,15,"td",17),e.bVm(),e.qex(12,82),e.DNE(13,Ad,3,3,"th",16)(14,Nd,2,1,"td",17),e.bVm(),e.qex(15,83),e.DNE(16,Ld,3,3,"th",16)(17,Yd,2,1,"td",17),e.bVm(),e.qex(18,84),e.DNE(19,Vd,3,3,"th",16)(20,qd,4,1,"td",17),e.bVm(),e.DNE(21,Ud,1,0,"tr",25)(22,Jd,1,0,"tr",26),e.k0s()()()),2&t){const n=e.XpG(3);e.R7$(2),e.Y8G("dataSource",n.popupTable),e.R7$(19),e.Y8G("matHeaderRowDef",n.popupTableColumns),e.R7$(),e.Y8G("matRowDefColumns",n.popupTableColumns)}}function zd(t,o){if(1&t&&(e.j41(0,"div",87)(1,"div",10)(2,"p",88),e.EFF(3),e.nI1(4,"translate"),e.k0s()(),e.j41(5,"div",89)(6,"p",90),e.EFF(7),e.k0s()(),e.j41(8,"div",89)(9,"p",91),e.EFF(10),e.nI1(11,"slice"),e.nI1(12,"slice"),e.nI1(13,"translate"),e.k0s()(),e.j41(14,"div",89)(15,"p",92),e.EFF(16),e.k0s()(),e.j41(17,"div",89)(18,"p",91),e.EFF(19),e.k0s()()()),2&t){const n=o.$implicit,i=o.$index,a=o.$count,s=e.XpG(4);e.Y8G("ngClass",i!==a-1?"border-row":""),e.R7$(3),e.Lme("",e.bMT(4,7,"bookingCoursePart")," ",i+1,""),e.R7$(4),e.JRh(n.stringDate),e.R7$(3),e.SpI(" ",e.i5U(13,17,"typography.dash",e.l_i(20,nt,e.brH(11,9,n.startTime,0,5),e.brH(12,13,n.endTime,0,5)))," "),e.R7$(6),e.JRh(s.popupInfo.CampName),e.R7$(3),e.JRh(n.classRoomName)}}function Wd(t,o){if(1&t&&(e.j41(0,"div",78),e.Z7z(1,zd,20,23,"div",87,e.Vm6),e.k0s()),2&t){const n=e.XpG(3);e.R7$(),e.Dyx(n.popupInfo.lessons)}}function Hd(t,o){if(1&t&&(e.j41(0,"div",68)(1,"p",69),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.j41(4,"div",76),e.DNE(5,Qd,23,3,"div",77)(6,Wd,3,0,"div",78),e.k0s()()),2&t){const n=e.XpG(2);e.R7$(2),e.JRh(e.bMT(3,2,"planning")),e.R7$(3),e.vxM(n.isMobile?6:5)}}function Kd(t,o){if(1&t&&e.nrm(0,"i",93),2&t){const n=o.success;e.Y8G("ngClass",e.l_i(1,nd,n,!n))}}function Zd(t,o){if(1&t&&(e.j41(0,"div",62),e.nrm(1,"img",63),e.nI1(2,"generateFastImage"),e.j41(3,"h6",94),e.EFF(4),e.k0s(),e.nrm(5,"a",95),e.k0s()),2&t){const n=o.$implicit;e.R7$(),e.Y8G("src",e.bMT(2,3,null==n?null:n.picture),e.B4B),e.R7$(3),e.JRh(n.name),e.R7$(),e.FS9("href",n.shopLink,e.B4B)}}function eu(t,o){if(1&t&&(e.j41(0,"div",68)(1,"p",69),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.j41(4,"div",49),e.Z7z(5,Zd,6,5,"div",62,e.Vm6),e.k0s()()),2&t){const n=e.XpG(2);e.R7$(2),e.JRh(e.bMT(3,1,"bookingMaterials")),e.R7$(3),e.Dyx(n.popupInfo.materials)}}function tu(t,o){if(1&t&&(e.j41(0,"div",58)(1,"h3",59)(2,"a",42),e.nI1(3,"routeT"),e.nI1(4,"seoFriendlyFormat"),e.nI1(5,"seoFriendlyFormat"),e.eu8(6,33),e.k0s()(),e.nrm(7,"i",60),e.k0s(),e.j41(8,"div",61)(9,"div",49)(10,"div",62),e.nrm(11,"img",63),e.k0s(),e.j41(12,"div",64)(13,"p",65)(14,"span",66),e.EFF(15),e.nI1(16,"translate"),e.nI1(17,"translate"),e.k0s(),e.j41(18,"span",67),e.EFF(19),e.k0s()(),e.j41(20,"p",65)(21,"span",66),e.EFF(22),e.nI1(23,"translate"),e.nI1(24,"translate"),e.k0s(),e.j41(25,"span",67),e.EFF(26),e.k0s()(),e.j41(27,"p",65)(28,"span",66),e.EFF(29),e.nI1(30,"translate"),e.nI1(31,"translate"),e.k0s(),e.j41(32,"span",67),e.EFF(33),e.k0s()(),e.j41(34,"p",65)(35,"span",66),e.EFF(36),e.nI1(37,"translate"),e.nI1(38,"translate"),e.k0s(),e.j41(39,"span",67),e.EFF(40),e.k0s()()(),e.DNE(41,Hd,7,4,"div",68),e.j41(42,"div",68)(43,"p",69),e.EFF(44),e.nI1(45,"translate"),e.k0s(),e.j41(46,"div",49)(47,"div",62),e.nrm(48,"img",63),e.nI1(49,"generateFastImage"),e.k0s(),e.j41(50,"div",64)(51,"p",70)(52,"a",42),e.nI1(53,"routeT"),e.EFF(54),e.k0s()(),e.j41(55,"p")(56,"span",71),e.eu8(57,33),e.EFF(58),e.nI1(59,"translate"),e.k0s(),e.j41(60,"span",71),e.eu8(61,33),e.EFF(62),e.nI1(63,"translate"),e.k0s(),e.j41(64,"span",71),e.eu8(65,33),e.EFF(66),e.nI1(67,"translate"),e.k0s(),e.j41(68,"span",71),e.eu8(69,33),e.EFF(70),e.nI1(71,"translate"),e.k0s(),e.DNE(72,Kd,1,4,"ng-template",null,6,e.C5r),e.k0s()()(),e.j41(74,"div",72)(75,"div",10)(76,"p",65)(77,"span",66),e.EFF(78),e.nI1(79,"translate"),e.nI1(80,"translate"),e.k0s(),e.j41(81,"span",67),e.EFF(82),e.k0s()(),e.j41(83,"p",65)(84,"span",66),e.EFF(85),e.nI1(86,"translate"),e.nI1(87,"translate"),e.k0s(),e.j41(88,"span",67),e.EFF(89),e.k0s()(),e.j41(90,"p",65)(91,"span",66),e.EFF(92),e.nI1(93,"translate"),e.nI1(94,"translate"),e.k0s(),e.j41(95,"span",67),e.EFF(96),e.k0s()(),e.j41(97,"p",65)(98,"span",66),e.EFF(99),e.nI1(100,"translate"),e.nI1(101,"translate"),e.nI1(102,"translate"),e.k0s(),e.j41(103,"span",67),e.EFF(104),e.k0s()(),e.j41(105,"p",65)(106,"span",66),e.EFF(107),e.nI1(108,"translate"),e.nI1(109,"translate"),e.nI1(110,"translate"),e.k0s(),e.j41(111,"span",67),e.EFF(112),e.k0s()()()()(),e.DNE(113,eu,7,3,"div",68),e.k0s()(),e.j41(114,"div",73)(115,"div",74),e.eu8(116,33),e.j41(117,"a",75),e.nI1(118,"routeT"),e.nI1(119,"seoFriendlyFormat"),e.nI1(120,"seoFriendlyFormat"),e.EFF(121),e.nI1(122,"translate"),e.k0s()()()),2&t){const n=e.sdS(73),i=e.XpG(),a=e.sdS(9),s=e.sdS(11);e.R7$(2),e.Y8G("routerLink",e.sMw(127,ht,e.bMT(3,59,"/course"),e.bMT(4,61,i.popupInfo.courseName),e.bMT(5,63,i.popupInfo.courseCode))),e.R7$(4),e.Y8G("ngTemplateOutlet",s)("ngTemplateOutletContext",e.eq3(131,on,i.popupInfo)),e.R7$(),e.ZvI("text-color fa-solid fa-xmark ",null==i.dialogOptions?null:i.dialogOptions.titleClasses,""),e.R7$(4),e.Y8G("src",i.popupInfo.photo,e.B4B),e.R7$(4),e.Lme("",e.bMT(16,65,"bookingResponsible"),"",e.bMT(17,67,"typography.colon"),""),e.R7$(4),e.Lme("",i.popupInfo.courseRespFn," ",i.popupInfo.courseRespLn,""),e.R7$(3),e.Lme("",e.bMT(23,69,"bookingPhone"),"",e.bMT(24,71,"typography.colon"),""),e.R7$(4),e.JRh(i.popupInfo.courseRespPhone),e.R7$(3),e.Lme("",e.bMT(30,73,"bookingAdvisor"),"",e.bMT(31,75,"typography.colon"),""),e.R7$(4),e.JRh(i.popupInfo.ghostEmployeeName),e.R7$(3),e.Lme("",e.bMT(37,77,"bookingPhone"),"",e.bMT(38,79,"typography.colon"),""),e.R7$(4),e.JRh(i.popupInfo.companyPhone),e.R7$(),e.vxM(null!=i.popupInfo&&null!=i.popupInfo.lessons&&i.popupInfo.lessons.length?41:-1),e.R7$(3),e.JRh(e.bMT(45,81,"bookingLocationInfo")),e.R7$(4),e.Y8G("src",e.bMT(49,83,null==i.popupInfo?null:i.popupInfo.CampusPhoto),e.B4B),e.R7$(4),e.Y8G("routerLink",e.l_i(133,td,e.bMT(53,85,"/campus"),i.popupInfo.CampusId)),e.R7$(2),e.JRh(i.popupInfo.CampName),e.R7$(3),e.Y8G("ngTemplateOutlet",n)("ngTemplateOutletContext",e.eq3(136,it,+i.popupInfo.hasProjector)),e.R7$(),e.SpI(" ",e.bMT(59,87,"bookingProjector")," "),e.R7$(3),e.Y8G("ngTemplateOutlet",n)("ngTemplateOutletContext",e.eq3(138,it,+i.popupInfo.hasAlaram)),e.R7$(),e.SpI(" ",e.bMT(63,89,"bookingAlarm")," "),e.R7$(3),e.Y8G("ngTemplateOutlet",n)("ngTemplateOutletContext",e.eq3(140,it,+i.popupInfo.hasKeyBox)),e.R7$(),e.SpI(" ",e.bMT(67,91,"bookingKeyBox")," "),e.R7$(3),e.Y8G("ngTemplateOutlet",n)("ngTemplateOutletContext",e.eq3(142,it,+i.popupInfo.hasParkingTeacher)),e.R7$(),e.SpI(" ",e.bMT(71,93,"bookingParking")," "),e.R7$(8),e.Lme("",e.bMT(79,95,"classroom"),"",e.bMT(80,97,"typography.colon"),""),e.R7$(4),e.JRh(i.popupInfo.classRoom),e.R7$(3),e.Lme("",e.bMT(86,99,"bookingCampResponsible"),"",e.bMT(87,101,"typography.colon"),""),e.R7$(4),e.JRh(i.popupInfo.campResponsible),e.R7$(3),e.Lme("",e.bMT(93,103,"phoneNumber"),"",e.bMT(94,105,"typography.colon"),""),e.R7$(4),e.JRh(i.popupInfo.campResponsiblePhone),e.R7$(3),e.E5c("",e.bMT(100,107,"bookingCampResponsible")," ",e.bMT(101,109,"bookingNight"),"",e.bMT(102,111,"typography.colon"),""),e.R7$(5),e.JRh(i.popupInfo.campResponsibleNight),e.R7$(3),e.E5c("",e.bMT(108,113,"phoneNumber")," ",e.bMT(109,115,"bookingNight"),"",e.bMT(110,117,"typography.colon"),""),e.R7$(5),e.JRh(i.popupInfo.campResponsiblePhoneNight),e.R7$(),e.vxM(null!=i.popupInfo&&null!=i.popupInfo.materials&&i.popupInfo.materials.length?113:-1),e.R7$(3),e.Y8G("ngTemplateOutlet",a)("ngTemplateOutletContext",e.eq3(144,sn,i.popupInfo)),e.R7$(),e.Y8G("routerLink",e.sMw(146,ht,e.bMT(118,119,"/course"),e.bMT(119,121,i.popupInfo.courseName),e.bMT(120,123,i.popupInfo.courseCode))),e.R7$(4),e.SpI(" ",e.bMT(122,125,"courseInfo")," ")}}function nu(t,o){if(1&t){const n=e.RV6();e.j41(0,"div",96)(1,"p"),e.EFF(2),e.nI1(3,"translate"),e.nI1(4,"translate"),e.nI1(5,"translate"),e.nI1(6,"translate"),e.k0s(),e.j41(7,"p")(8,"strong"),e.EFF(9),e.nI1(10,"translate"),e.k0s()(),e.j41(11,"p"),e.EFF(12),e.nI1(13,"translate"),e.k0s()(),e.j41(14,"div",97)(15,"a",98),e.bIt("click",function(){e.eBV(n);const a=e.XpG();return e.Njj(a.updateInvitationStatus(a.popupData.id,"true"))}),e.EFF(16),e.nI1(17,"translate"),e.k0s()()}if(2&t){const n=e.XpG();e.R7$(2),e.Ld(" ",e.bMT(3,11,"bookingPopup1")," ",n.popupData.teacherName,"",e.bMT(4,13,"bookingPopup2")," ",n.popupData.courseName," ",e.bMT(5,15,"bookingPopup3")," ",n.popupData.startDate," ",e.bMT(6,17,n.popupData.campusName?"bookingPopup4":"")," ",n.popupData.campusName,". "),e.R7$(7),e.JRh(e.bMT(10,19,"bookingPopup5")),e.R7$(3),e.JRh(e.bMT(13,21,"bookingPopup6")),e.R7$(4),e.JRh(e.bMT(17,23,"bookingApproved"))}}function iu(t,o){1&t&&(e.j41(0,"button",100),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.JRh(e.bMT(2,1,"bookingPending")))}function au(t,o){1&t&&(e.j41(0,"button",101),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.JRh(e.bMT(2,1,"bookingBooked")))}
3function ou(t,o){if(1&t){const n=e.RV6();e.j41(0,"button",102),e.bIt("click",function(){e.eBV(n);const a=e.XpG(3).item,s=e.XpG();return e.Njj(s.openTermsDialog(a.invitationId))}),e.nrm(1,"i",103),e.k0s(),e.j41(2,"button",104),e.bIt("click",function(){e.eBV(n);const a=e.XpG(3).item,s=e.XpG();return e.Njj(s.updateInvitationStatus(a.invitationId,"false"))}),e.nrm(3,"i",105),e.k0s()}if(2&t){const n=e.XpG(3).item;e.Y8G("color","declined"===n.status?"grey-inverted":"success"),e.R7$(2),e.Y8G("disabled","declined"===n.status)}}function su(t,o){if(1&t){const n=e.RV6();e.j41(0,"button",106),e.bIt("click",function(){e.eBV(n);const a=e.XpG(3).item,s=e.XpG();return e.Njj(s.openTermsDialog(a.invitationId))}),e.j41(1,"span"),e.nrm(2,"i",103),e.EFF(3),e.nI1(4,"translate"),e.k0s()(),e.j41(5,"button",107),e.bIt("click",function(){e.eBV(n);const a=e.XpG(3).item,s=e.XpG();return e.Njj(s.updateInvitationStatus(a.invitationId,"false"))}),e.j41(6,"span"),e.nrm(7,"i",105),e.EFF(8),e.nI1(9,"translate"),e.k0s()()}if(2&t){const n=e.XpG(3).item;e.Y8G("color","declined"===n.status?"grey-inverted":"success"),e.R7$(3),e.SpI(" ",e.bMT(4,4,"bookingAccept")," "),e.R7$(2),e.Y8G("disabled","declined"===n.status),e.R7$(3),e.SpI(" ",e.bMT(9,6,"bookingDecline")," ")}}function ru(t,o){if(1&t&&e.DNE(0,ou,4,2)(1,su,10,8),2&t){const n=e.XpG(2).isTable;e.vxM(n?0:1)}}function lu(t,o){if(1&t&&e.DNE(0,iu,3,3,"button",100)(1,au,3,3,"button",101)(2,ru,2,1),2&t){let n;const i=e.XpG().item;e.vxM("pending"===(n=i.status)?0:"booked"===n?1:2)}}function cu(t,o){if(1&t&&(e.j41(0,"button",108),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t){const n=e.XpG(2).isTable;e.Y8G("color",n?"lightgrey":"grey-inverted"),e.R7$(),e.SpI(" ",e.bMT(2,2,"bookingPending")," ")}}function mu(t,o){if(1&t){const n=e.RV6();e.j41(0,"button",110),e.bIt("click",function(){e.eBV(n);const a=e.XpG(2).item,s=e.XpG();return e.Njj(s.markAsAvailable(a))}),e.EFF(1),e.nI1(2,"translate"),e.k0s()}2&t&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"invAvailable")," "))}function pu(t,o){if(1&t&&e.DNE(0,cu,3,4,"button",108)(1,mu,3,3,"button",109),2&t){const n=e.XpG().item;e.vxM(n.available?0:1)}}function du(t,o){if(1&t&&(e.j41(0,"div",99),e.DNE(1,lu,3,1)(2,pu,2,1),e.k0s()),2&t){const n=o.isTable,i=e.XpG();e.Y8G("ngClass",e.eq3(3,id,!n)),e.R7$(),e.vxM("teacher"===i.invitationsType?1:-1),e.R7$(),e.vxM("applicant"===i.invitationsType?2:-1)}}function uu(t,o){1&t&&(e.EFF(0),e.nI1(1,"translate"),e.nI1(2,"lowercase")),2&t&&e.SpI(" (",e.bMT(2,3,e.bMT(1,1,"virtual")),") ")}function _u(t,o){1&t&&(e.EFF(0),e.nI1(1,"translate"),e.nI1(2,"lowercase")),2&t&&e.SpI(" (",e.bMT(2,3,e.bMT(1,1,"courseTypeG2")),") ")}function hu(t,o){if(1&t&&e.DNE(0,uu,3,5)(1,_u,3,5),2&t){const n=e.XpG().item;e.vxM("virtual"===n.subtype?0:1)}}function fu(t,o){1&t&&(e.EFF(0),e.nI1(1,"translate"),e.nI1(2,"lowercase")),2&t&&e.SpI(" (",e.bMT(2,3,e.bMT(1,1,"courseTypeH")),") ")}function gu(t,o){if(1&t&&(e.EFF(0),e.DNE(1,hu,2,1)(2,fu,3,5)),2&t){let n;const i=o.item;e.SpI(" ",i.courseName," "),e.R7$(),e.vxM("groep"===(n=i.type)?1:2)}}let vu=(()=>{var t;class o{constructor(){this.deviceService=(0,e.WQX)(ge.Kg),this.dialogService=(0,e.WQX)(B.bZ),this.authService=(0,e.WQX)(_t.k),this.teacherInvitationService=(0,e.WQX)(an),this.popupInfo=void 0,this.maxVisibleItems=5,this.baseTableColumns=["courseName","weekDay","startDate","endDate","city","allLessons","moreInfo","status"],this.popupTableColumns=["bookingCoursePart","lessonDay","allLessons","locationFilter","classroom","teacherLabel"],this.destroy$=new y.B}set matPaginator(i){this.paginator=i,this.setDataSourceAttributes()}ngOnInit(){this.isMobile=this.deviceService.isMobile(),this.isMobile?this.transformDataForMobile(this.invitations):this.planningInvitations=this.invitations,this.tableData=new b.I6(this.planningInvitations)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}transformDataForMobile(i){const a=i.reduce((s,r)=>{const{courseCode:l}=r;return s[l]||(s[l]=[]),s[l].push(r),s},{});this.planningInvitations=Object.values(a).map(s=>{const[r]=s,{courseName:l,courseCode:p,type:d,subtype:h,numClasses:v}=r;return{courseName:l,code:p,type:d,subtype:h,numClasses:v,invitations:s}})}getPlanningInfo(i){this.popupInfo=void 0,this.isLoading=!0,this.teacherInvitationService.getPlanningInfoInvitation(i.planningId).pipe((0,I.Q)(this.destroy$)).subscribe(a=>{var s;if(this.popupInfo=a.body.data,this.isLoading=!1,"teacher"===this.invitationsType){const{inv
3itationId:r,status:l,urgent:p}=i;this.popupInfo=(0,g.A)((0,g.A)({},this.popupInfo),{},{invitationId:r,status:l,urgent:p})}else{const{planningId:r,available:l}=i;this.popupInfo=(0,g.A)((0,g.A)({},this.popupInfo),{},{planningId:r,available:l})}this.popupTable=new b.I6(null===(s=this.popupInfo)||void 0===s?void 0:s.lessons),this.showInfoDialog()})}openTermsDialog(i){const{firstName:a="",lastName:s=""}=this.authService.getCurrentUser()||{},{campusName:r="",startDate:l="",courseName:p=""}=this.planningInvitations.find(h=>+h.invitationId==+i)||{};this.popupData={teacherName:"".concat(a," ").concat(s),id:i,courseName:p,startDate:l,campusName:r},this.termsDialogRef=this.dialogService.open(oe.m,{data:{header:"bookingInvitation",template:this.acceptDialog},panelClass:["material-modal","col-lg-4"]})}showInfoDialog(){this.infoDialogRef=this.dialogService.open(oe.m,{data:{template:this.infoDialog},panelClass:["dialog-responsive"],autoFocus:!1})}markAsAvailable(i){this.teacherInvitationService.postTeacherAvailablePlannings({planningId:i.planningId,available:!0}).pipe((0,I.Q)(this.destroy$)).subscribe(s=>{this.closeDialogs(),this.teacherInvitationService.reload()})}updateInvitationStatus(i,a){this.teacherInvitationService.patchInvitationStatus({invitationId:i,action:a}).pipe((0,I.Q)(this.destroy$)).subscribe(r=>{this.teacherInvitationService.reload(),this.closeDialogs()})}closeDialogs(){this.termsDialogRef&&this.termsDialogRef.close(),this.infoDialogRef&&this.infoDialogRef.close()}setDataSourceAttributes(){this.tableData&&(this.tableData.paginator=this.paginator)}}return(t=o).\u0275fac=function(i){return new(i||t)},t.\u0275cmp=e.VBU({type:t,selectors:[["app-invitations-helper"]],viewQuery:function(i,a){if(1&i&&(e.GBs(Hp,7),e.GBs(Kp,7),e.GBs(ve.iy,5)),2&i){let s;e.mGM(s=e.lsd())&&(a.acceptDialog=s.first),e.mGM(s=e.lsd())&&(a.infoDialog=s.first),e.mGM(s=e.lsd())&&(a.matPaginator=s.first)}},inputs:{invitationsType:"invitationsType",invitations:"invitations"},decls:12,vars:3,consts:[["infoDialog",""],["acceptDialog",""],["actionButtons",""],["courseType",""],["paginator",""],["panel",""],["icon",""],[1,"mb-0",3,"ngClass"],[1,"row","planning","d-flex",3,"id"],[1,"row","m-0","mt-3","w-100","planning-mobile","d-flex"],[1,"col-12"],[1,"fs-20","pt-4","font-weight-bold"],[1,"col-12","mb-3"],[1,"mat-elevation-z3","table-responsive"],["mat-table","",3,"dataSource","id"],["matColumnDef","courseName"],["mat-header-cell","","class","grey-text font-weight-normal",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","weekDay"],["matColumnDef","startDate"],["matColumnDef","endDate"],["matColumnDef","city"],["matColumnDef","allLessons"],["matColumnDef","moreInfo"],["matColumnDef","status"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["hidePageSize","","showFirstLastButtons","",3,"pageSize"],["mat-header-cell","",1,"grey-text","font-weight-normal"],["mat-cell",""],["mat-icon-button","","color","accent","type","button",1,"small-icon-button",3,"click"],["data-toggle","modal","data-target","#courseModal",1,"fa-solid","fa-info"],[1,"button-container"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],["mat-header-row",""],["mat-row",""],[1,"row","mb-3","mat-elevation-z3"],[1,"w-100"],[3,"hideToggle","expanded"],[1,"d-block","h-100","p-0"],[1,"col-sm-12","p-3"],[1,"d-flex","flex-row","justify-content-between"],[3,"routerLink"],[1,"font-weight-bold","mb-2","d-inline"],["mat-icon-button","","color","accent","type","button",1,"small-icon-button"],[1,"fa-solid",3,"ngClass"],[1,"mb-2"],[1,"col-sm-12","mb-3"],[1,"my-3"],[1,"row"],[3,"numClasses","type","subtype"],[1,"row","entry"],[1,"col-11"],[1,"mb-1"],[1,"d-inline-block"],[1,"col-1","p-0","d-flex","flex-column","justify-content-between","align-items-end"],[1,"fas","fa-exclamation-triangle",3,"matTooltip"],[1,"my-3","button-container","align-items-center","justify-content-center"],["mat-dialog-title",""],[1,"font-weight-bolder"],["matDialogClose",""],["mat-dialog-content","",1,"mt-2"],[1,"col-sm-12","col-md-2"],["alt","","appOnErrorImage","",1,"popup-image","mat-elevation-z3","w-100",3,"src"],[1,"col-sm-12","col-md-10"],[1,"d-flex","flex-column","flex-md-row","mb-2"],[1,"font-weight-bolder","company-info_title"],[1,"flex-1"],[1,"col-12","mt-4"],[1,"fs-18","font-weight-bold"],[1,"fs-18","mb-3","font-weight-bolder"],[1,"fs-16","mr-4","d-block","d-sm-inline-block"],[1,"row","mt-4"],["mat-dialog-actions",""],[1,"w-100","d-flex","flex-column","flex-md-row","justify-content-between"],["mat-raised-button","","color","primary","type","button",1,"text-uppercase","mt-2","mt-md-0",3,"routerLink"],[1,"row","w-100","m-0"],[1,"col-12","p-1"],[1,"col-12","mobile-planning"],["mat-table","",3,"dataSource"],["matColumnDef","bookingCoursePart"],["matColumnDef","lessonDay"],["matColumnDef","locationFilter"],["matColumnDef","classroom"],["matColumnDef","teacherLabel"],["disabled","","mat-raised-button","","color","lightgrey","type","button",1,"text-dark","text-uppercase"],["disabled","","mat-raised-button","","color","primary","type","button",1,"text-uppercase"],[1,"row","py-3",3,"ngClass"],[1,"font-weight-bold","w-100","mb-2","fs-15"],[1,"col-12","col-sm-6"],[1,"mb-2","fs-15","font-weight-bolder","text-capitalize"],[1,"mb-2","fs-15"],[1,"mb-2","fs-15","font-weight-bolder"],[1,"mr-1","fas",3,"ngClass"],[1,"mt-3","fs-16","font-weight-bolder"],[1,"position-absolute","w-100","h-100",2,"to
3p","var(--space-0)",3,"href"],["mat-dialog-content",""],["mat-dialog-actions","","align","center"],["mat-raised-button","","color","primary",3,"click"],[1,"d-flex","justify-content-between","action-buttons",3,"ngClass"],["disabled","","mat-raised-button","","color","lightgrey","type","button",1,"text-uppercase"],["disabled","","mat-raised-button","","color","success","type","button",1,"text-uppercase"],["mat-icon-button","","type","button",1,"small-icon-button",3,"click","color"],[1,"fas","fa-check"],["mat-icon-button","","type","button","color","danger",1,"small-icon-button","ml-0","ml-md-2",3,"click","disabled"],[1,"fas","fa-times"],["mat-raised-button","","type","button",1,"text-uppercase",3,"click","color"],["mat-raised-button","","type","button","color","danger",1,"ml-0","ml-md-2","text-uppercase",3,"click","disabled"],["mat-raised-button","","type","button","disabled","",1,"text-uppercase",3,"color"],["mat-raised-button","","type","button","color","accent-inverted",1,"text-success"],["mat-raised-button","","type","button","color","accent-inverted",1,"text-success",3,"click"]],template:function(i,a){1&i&&e.DNE(0,ad,1,0,"app-spinner")(1,od,3,6,"p",7)(2,Rd,36,10,"div",8)(3,$d,4,0,"div",9)(4,tu,123,150,"ng-template",null,0,e.C5r)(6,nu,18,25,"ng-template",null,1,e.C5r)(8,du,3,5,"ng-template",null,2,e.C5r)(10,gu,3,2,"ng-template",null,3,e.C5r),2&i&&(e.vxM(a.isLoading?0:-1),e.R7$(),e.vxM(null!=a.planningInvitations&&a.planningInvitations.length?1:-1),e.R7$(),e.vxM(!a.isMobile&&a.planningInvitations.length?2:3))},dependencies:[u.YU,u.T3,b.Zl,b.tL,b.ji,b.cC,b.YV,b.iL,b.KS,b.$R,b.YZ,b.NB,ve.iy,H.BS,H.GK,H.Z2,E.It,E.$z,E.iY,Re.oV,B.tx,B.BI,B.E7,B.Yi,Qp.q,zp.t,he.t,Ne.e,O.Wk,u.GH,u.P9,m.D9,tt.s,Wp.w,Ke.l,Wt.E],styles:[".mat-column-moreInfo[_ngcontent-%COMP%], .mat-column-status[_ngcontent-%COMP%]{text-align:center}.popup-image[_ngcontent-%COMP%]{object-fit:cover;max-height:var(--size-130px)}td[_ngcontent-%COMP%]{vertical-align:middle}td[_ngcontent-%COMP%]:first-child{width:var(--size-20-percent)}.mobile-planning[_ngcontent-%COMP%]{border:var(--border-xxs-solid-tint-3);word-break:break-word}.border-row[_ngcontent-%COMP%]{border-bottom:var(--border-xxs-solid-tint-3)}.button-container[_ngcontent-%COMP%]{display:inline-block}.action-buttons.d-flex[_ngcontent-%COMP%]{gap:var(--space-10px)}.entry[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{min-width:var(--size-100px)}.fa-exclamation-triangle[_ngcontent-%COMP%]{font-size:var(--font-size-187);color:var(--color-yellow)}table[_ngcontent-%COMP%], .mobile-planning[_ngcontent-%COMP%]{border-top:var(--border-md-solid-border-top)}@media only screen and (max-width: 800px){.popup-image[_ngcontent-%COMP%]{max-height:var(--size-200px);margin-bottom:var(--space-20px)}}.company-info_title[_ngcontent-%COMP%]{min-width:var(--size-280px)}\n\n/*# sourceMappingURL=invitations-helper.component.css.map*/"]}),o})();function bu(t,o){1&t&&e.nrm(0,"app-spinner")}function Tu(t,o){1&t&&(e.j41(0,"p"),e.EFF(1),e.nI1(2,"translate"),e.nI1(3,"translate"),e.k0s()),2&t&&(e.R7$(),e.Lme("",e.bMT(2,2,"invNoPending"),"",e.bMT(3,4,"typography.period"),""))}function Cu(t,o){if(1&t&&e.nrm(0,"app-invitations-helper",4),2&t){const n=e.XpG();e.Y8G("invitationsType","teacher")("invitations",n.teacherInvitations)}}function xu(t,o){if(1&t&&e.nrm(0,"app-invitations-helper",4),2&t){const n=e.XpG();e.Y8G("invitationsType","applicant")("invitations",n.applicantInvitations)}}function Iu(t,o){if(1&t&&(e.j41(0,"div",0)(1,"div",1)(2,"div",2)(3,"h3",3),e.EFF(4),e.nI1(5,"translate"),e.k0s(),e.DNE(6,Tu,4,6,"p"),e.k0s()(),e.DNE(7,Cu,1,2,"app-invitations-helper",4)(8,xu,1,2,"app-invitations-helper",4),e.k0s()),2&t){const n=o;e.R7$(4),e.JRh(e.bMT(5,4,"bookingModule")),e.R7$(2),e.vxM(n.teacherInvitations.length||n.applicantInvitations.length?-1:6),e.R7$(),e.vxM(n.teacherInvitations.length?7:-1),e.R7$(),e.vxM(n.applicantInvitations.length?8:-1)}}let Ru=(()=>{var t;class o{constructor(){this.teacherInvitationService=(0,e.WQX)(an),this.authService=(0,e.WQX)(_t.k),this.isLoading=!0}ngOnInit(){const i=this.authService.getCurrentUserStatuses(),a=this.createInvitationStream(i,"DOC",()=>this.teacherInvitationService.getTeacherInvitations()),s=this.createInvitationStream(i,"CANDTEACH",()=>this.teacherInvitationService.getTeacherAvailablePlannings());this.invitations$=(0,j.p)({teacherInvitations:a,applicantInvitations:s}).pipe((0,le.M)(()=>this.isLoading=!1))}createInvitationStream(i,a,s){return i.includes(a)?s().pipe((0,R.T)(r=>{var l;return(null==r||null===(l=r.body)||void 0===l?void 0:l.data)||[]}),(0,D.W)(()=>(0,x.of)([]))):(0,x.of)([])}}return(t=o).\u0275fac=function(i){return new(i||t)},t.\u0275cmp=e.VBU({type:t,selectors:[["app-teacher-invitations"]],decls:3,vars:4,consts:[[1,"container","mb-0","mb-sm-5","mat-elevation-z3","sm-no-shadow","teacher-invitations"],[1,"row"],[1,"col-12"],[1,"fs-20","pt-3","font-weight-bold"],[3,"invitationsType","invitations"]],template:function(i,a){if(1&i&&(e.DNE(0,bu,1,0,"app-spinner")(1,Iu,9,6,"div",0),e.nI1(2,"async")),2&i){let s;
3e.vxM(a.isLoading?0:-1),e.R7$(),e.vxM((s=e.bMT(2,2,a.invitations$))?1:-1,s)}},dependencies:[he.t,vu,u.Jj,m.D9],encapsulation:2}),o})();var Fu=f(19999);let at=(()=>{var t;class o{constructor(){this.http=(0,e.WQX)(ue.Qq),this.configService=(0,e.WQX)(Ce.w),this.authService=(0,e.WQX)(_t.k),this.CDO_URL=this.configService.getCdoUrl(),this.ELO_URL="".concat(this.CDO_URL,"api"),this.ELO_TEACHER_URL="".concat(this.ELO_URL,"/teacher"),this.invoiceCache={},this.invoiceList=null,this.selfBillingCache=null}getTeacherInvoiceList(){if(this.invoiceList&&this.invoiceList.length)return(0,x.of)(this.invoiceList);const i="".concat(this.ELO_TEACHER_URL,"/invoices/index"),a=new ue.Lr({"user-status":this.authService.getCurrentUserStatus()});return this.http.get(i,{headers:a,observe:"response"}).pipe((0,R.T)(s=>{var r;return(null==s||null===(r=s.body)||void 0===r?void 0:r.data)||[]}),(0,D.W)(s=>(0,x.of)([])),(0,R.T)(s=>(s&&s.length&&(s=s.map(r=>(r.datesList=r.datesList.reverse(),r)),this.invoiceList=s.sort((r,l)=>{const[p,d]=[r,l].map(({datesList:h})=>Math.max(...h));return d-p})),s)))}getTeacherInvoices(i,a){if(this.invoiceCache[i]&&this.invoiceCache[i][a])return(0,x.of)(this.invoiceCache[i][a]);const s="".concat(this.ELO_TEACHER_URL,"/invoices");let r=new ue.Nl;return r=r.append("year",i),a&&(r=r.append("courseCode",a)),this.http.get(s,{params:r,observe:"response"}).pipe((0,R.T)(l=>{var p;return(null==l||null===(p=l.body)||void 0===p?void 0:p.data)||[]}),(0,D.W)(l=>(0,x.of)([])),(0,R.T)(l=>(this.invoiceCache[i]?this.invoiceCache[i][a]=l:this.invoiceCache[i]={[a]:l},l)))}getTeacherInvoice(i){return this.http.get(i,{observe:"response"}).pipe((0,R.T)(s=>{var r;return(null==s||null===(r=s.body)||void 0===r?void 0:r.data)||null}))}postTeacherInvoice(i,a){return this.http.post(a,{readInvoiceToken:i},{observe:"response",responseType:"arraybuffer"})}getTeacherSelfbilling(){if(this.selfBillingCache)return(0,x.of)(this.selfBillingCache);const i="".concat(this.ELO_TEACHER_URL,"/selfbilling");return this.http.get(i,{observe:"response"}).pipe((0,R.T)(a=>{var s;return(null==a||null===(s=a.body)||void 0===s?void 0:s.data)||null}),(0,D.W)(a=>(0,x.of)(null)),(0,R.T)(a=>(a&&(this.selfBillingCache=a),a)))}
3putTeacherSelfbilling(i){const a="".concat(this.ELO_TEACHER_URL,"/selfbilling");return this.http.put(a,i,{observe:"response"}).pipe((0,R.T)(s=>(null!=s&&s.ok&&(this.selfBillingCache=(0,g.A)((0,g.A)({},this.selfBillingCache),i)),s)),(0,D.W)(s=>(0,x.of)(this.selfBillingCache)))}clearInvoiceCache(){this.invoiceCache={},this.invoiceList=null,this.selfBillingCache=null}}return(t=o).\u0275fac=function(i){return new(i||t)},t.\u0275prov=e.jDH({token:t,factory:t.\u0275fac,providedIn:"root"}),o})();var ku=f(8827);const yu=()=>["/teacher/invoices"],Eu=t=>({setting:"invoices.tinCoutryT",state:t}),Su=t=>({setting:"invoices.company",state:t}),$u=t=>({setting:"invoices.tinCourseActive",state:t}),Mu=t=>({setting:"invoices.selfbill",state:t}),wu=t=>({setting:"invoices.tinSelfBillType",state:t}),ju=t=>({setting:"invoices.tinAuthorBook",state:t}),Gu=t=>({setting:"invoices.tinAmountExVat",price:t}),Du=t=>({setting:"invoices.tinAmountVat",price:t}),Ou=t=>({setting:"invoices.tinAmountInVat",price:t}),Au=t=>({setting:"invoices.tinRoyalties",price:t}),Nu=()=>["invoices.tinDiscInv","invoices.tinDiscInvText"],Lu=(t,o)=>({setting:"invoices.tinRemuneration",price:t,buttonKeys:o}),Yu=()=>["invoices.tinDiscBTW","invoices.tinDiscBTWText"],Vu=(t,o)=>({setting:"invoices.tinVatRule",state:t,buttonKeys:o}),Pu=()=>({symbol:!1}),Xu=t=>({price:t});function Bu(t,o){1&t&&e.nrm(0,"app-inner-loader",12)}function qu(t,o){1&t&&(e.j41(0,"div",13),e.nrm(1,"app-inner-loader",14),e.k0s())}function Uu(t,o){1&t&&e.eu8(0)}function Ju(t,o){if(1&t&&(e.qex(0),e.DNE(1,Uu,1,0,"ng-container",27),e.bVm()),2&t){e.XpG
3();const n=e.sdS(30),i=e.XpG();e.R7$(),e.Y8G("ngTemplateOutlet",n)("ngTemplateOutletContext",e.eq3(2,Eu,i.settings.companyCountry))}}function Qu(t,o){1&t&&e.eu8(0)}function zu(t,o){1&t&&e.eu8(0)}function Wu(t,o){1&t&&e.eu8(0)}function Hu(t,o){1&t&&e.eu8(0)}function Ku(t,o){1&t&&e.eu8(0)}function Zu(t,o){1&t&&e.eu8(0)}function e1(t,o){1&t&&e.eu8(0)}function t1(t,o){1&t&&e.eu8(0)}function n1(t,o){1&t&&e.eu8(0)}function i1(t,o){1&t&&e.eu8(0)}function a1(t,o){1&t&&e.eu8(0)}function o1(t,o){if(1&t){const n=e.RV6();e.j41(0,"mat-expansion-panel",null,0)(2,"mat-expansion-panel-header")(3,"mat-panel-title"),e.EFF(4),e.k0s(),e.j41(5,"mat-panel-description")(6,"span",28),e.EFF(7),e.nI1(8,"translate"),e.k0s()()(),e.DNE(9,Qu,1,0,"ng-container",27)(10,zu,1,0,"ng-container",27)(11,Wu,1,0,"ng-container",27)(12,Hu,1,0,"ng-container",27)(13,Ku,1,0,"ng-container",27),e.j41(14,"div",29)(15,"div",30)(16,"span"),e.EFF(17),e.nI1(18,"translate"),e.k0s(),e.j41(19,"p",31),e.EFF(20),e.nI1(21,"dateformat"),e.k0s(),e.nrm(22,"hr",32),e.k0s(),e.j41(23,"div",30)(24,"span"),e.EFF(25),e.nI1(26,"translate"),e.k0s(),e.j41(27,"p",31),e.EFF(28),e.nI1(29,"dateformat"),e.k0s(),e.nrm(30,"hr",32),e.k0s()(),e.DNE(31,Zu,1,0,"ng-container",27)(32,e1,1,0,"ng-container",27)(33,t1,1,0,"ng-container",27)(34,n1,1,0,"ng-container",27)(35,i1,1,0,"ng-container",27)(36,a1,1,0,"ng-container",27),e.nI1(37,"translate"),e.j41(38,"div",29)(39,"div",13),e.EFF(40),e.nI1(41,"translate"),e.j41(42,"button",19),e.bIt("click",function(){e.eBV(n);const a=e.XpG(2);return e.Njj(a.openModal("invoices.tinDiscSelf","invoices.tinDiscSelfText"))}),e.nrm(43,"i",20),e.k0s()(),e.j41(44,"div",30)(45,"p",31),e.EFF(46),e.k0s(),e.nrm(47,"hr",32),e.k0s()()()}if(2&t){const n=o.$implicit;e.XpG();const i=e.sdS(30);e.R7$(4),e.SpI(" ",n.courseName," "),e.R7$(3),e.E5c("(",n.type,"",e.bMT(8,32,"typography.comma"),"",n.courseCode,")"),e.R7$(2),e.Y8G("ngTemplateOutlet",i)("ngTemplateOutletContext",e.eq3(46,Su,n.companyCode)),e.R7$(),e.Y8G("ngTemplateOutlet",i)("ngTemplateOutletContext",e.eq3(48,$u,n.isActive?"yes":"no")),e.R7$(),e.Y8G("ngTemplateOutlet",i)("ngTemplateOutletContext",e.eq3(50,Mu,n.isSelfBilling?"yes":"no")),e.R7$(),e.Y8G("ngTemplateOutlet",i)("ngTemplateOutletContext",e.eq3(52,wu,n.courseEducationType)),e.R7$(),e.Y8G("ngTemplateOutlet",i)("ngTemplateOutletContext",e.eq3(54,ju,n.isAuthorOfTheBook?"yes":"no")),e.R7$(4),e.JRh(e.bMT(18,34,"invoices.tinCreationDate")),e.R7$(3),e.JRh(e.bMT(21,36,n.bookCreationDate)||"\xa0"),e.R7$(5),e.JRh(e.bMT(26,38,"invoices.tinDateLastReview")),e.R7$(3),e.JRh(e.bMT(29,40,n.bookLastReviewedDate)||"\xa0"),e.R7$(3),e.Y8G("ngTemplateOutlet",i)("ngTemplateOutletContext",e.eq3(56,Gu,n.pricePerCourseExcludingVAT)),e.R7$(),e.Y8G("ngTemplateOutlet",i)("ngTemplateOutletContext",e.eq3(58,Du,n.valueVATPerCourse)),e.R7$(),e.Y8G("ngTemplateOutlet",i)("ngTemplateOutletContext",e.eq3(60,Ou,n.pricePerCourseIncludingVAT)),e.R7$(),e.Y8G("ngTemplateOutlet",i)("ngTemplateOutletContext",e.eq3(62,Au,n.royalties)),e.R7$(),e.Y8G("ngTemplateOutlet",i)("ngTemplateOutletContext",e.l_i(65,Lu,n.totalPriceMonth,e.lJ4(64,Nu))),e.R7$(),e.Y8G("ngTemplateOutlet",i)("ngTemplateOutletContext",e.l_i(69,Vu,n.descriptionVAT+e.bMT(37,42,"invoices.company"),e.lJ4(68,Yu))),e.R7$(4),e.SpI(" ",e.bMT(41,44,"invoices.tinSelfNotes")," "),e.R7$(6),e.JRh(n.selfBillNotes||"\xa0")}}function s1(t,o){if(1&t){const n=e.RV6();e.j41(0,"button",19),e.bIt("click",function(){e.eBV(n);const a=e.XpG().buttonKeys,s=e.XpG(2);return e.Njj(s.openModal(a[0],a[1]))}),e.nrm(1,"i",20),e.k0s()}}function r1(t,o){if(1&t&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t){const n=e.XpG().state;e.R7$(),e.SpI(" ",e.bMT(2,1,n)," ")}}function l1(t,o){if(1&t&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"localeCurrency"),e.nI1(3,"translate"),e.k0s()),2&t){const n=e.XpG().price;
3e.R7$(),e.SpI(" ",e.i5U(3,4,"invoices.tinEuroStudent",e.eq3(8,Xu,e.i5U(2,1,n,e.lJ4(7,Pu))))," ")}}function c1(t,o){if(1&t&&(e.j41(0,"div",29)(1,"div",23),e.EFF(2),e.nI1(3,"translate"),e.DNE(4,s1,2,0,"button",33),e.k0s(),e.j41(5,"div",21),e.DNE(6,r1,3,3,"span",25)(7,l1,4,10,"span",25),e.k0s()()),2&t){const n=o.setting,i=o.price,a=o.state,s=o.buttonKeys;e.R7$(2),e.SpI(" ",e.bMT(3,4,n)," "),e.R7$(2),e.Y8G("ngIf",s&&2===s.length),e.R7$(2),e.Y8G("ngIf",a&&!i),e.R7$(),e.Y8G("ngIf",i&&!a)}}function m1(t,o){if(1&t){const n=e.RV6();e.j41(0,"div",13)(1,"mat-accordion",15)(2,"mat-expansion-panel",null,0)(4,"mat-expansion-panel-header")(5,"mat-panel-title"),e.EFF(6),e.nI1(7,"translate"),e.k0s(),e.j41(8,"mat-panel-description")(9,"i"),e.EFF(10),e.nI1(11,"translate"),e.k0s()()(),e.j41(12,"form",16)(13,"div",17)(14,"div",18),e.EFF(15),e.nI1(16,"translate"),e.j41(17,"button",19),e.bIt("click",function(){e.eBV(n);const a=e.XpG();return e.Njj(a.openModal("invoices.tinDiscCRKBO","invoices.tinDiscCRKBOText"))}),e.nrm(18,"i",20),e.k0s()(),e.j41(19,"div",21),e.nrm(20,"mat-slide-toggle",22),e.k0s()(),e.j41(21,"div",17)(22,"div",23),e.EFF(23),e.nI1(24,"translate"),e.k0s(),e.j41(25,"div",21),e.nrm(26,"mat-slide-toggle",24),e.k0s()()(),e.DNE(27,Ju,2,4,"ng-container",25),e.k0s(),e.DNE(28,o1,48,72,"mat-expansion-panel",26),e.k0s(),e.DNE(29,c1,8,6,"ng-template",null,1,e.C5r),e.k0s()}if(2&t){const n=e.XpG();e.R7$(),e.Y8G("multi",!1),e.R7$(5),e.SpI(" ",e.bMT(7,8,"general")," "),e.R7$(4),e.JRh(e.bMT(11,10,"invoices.validForAllCourses")),e.R7$(2),e.Y8G("formGroup",n.settingsForm),e.R7$(3),e.SpI(" ",e.bMT(16,12,"invoices.crkbo")," "),e.R7$(8),e.JRh(e.bMT(24,14,"invoices.selfbill")),e.R7$(4),e.Y8G("ngIf",n.settings.companyCountry),e.R7$(),e.Y8G("ngForOf",n.settings.courseInfo)}}function p1(t,o){1&t&&(e.j41(0,"div",13)(1,"div",34),e.nrm(2,"i",35),e.j41(3,"span",36),e.EFF(4),e.nI1(5,"translate"),e.k0s()()()),2&t&&(e.R7$(4),e.JRh(e.bMT(5,1,"invoices.error.loadingInvoiceSetting")))}let d1=(()=>{var t;class o{constructor(){this.teacherInvoiceService=(0,e.WQX)(at),this.toastrService=(0,e.WQX)(w.tw),this.translateService=(0,e.WQX)(m.c$),this.formBuilder=(0,e.WQX)(c.ok),this.dialogService=(0,e.WQX)(B.bZ),this.isLoading=!0,this.settingsLoading=!1,this.settings=null,this.settingsForm=this.formBuilder.group({CRKBO:[null],isSelfBilling:[null]}),this.destroy$=new y.B}get CRKBO(){return this.settingsForm.get("CRKBO")}get isSelfBilling(){return this.settingsForm.get("isSelfBilling")}ngOnInit(){this.teacherInvoiceService.getTeacherSelfbilling().pipe((0,I.Q)(this.destroy$)).subscribe(i=>{if(this.isLoading=!1,i){i.courseInfo&&(i=(0,g.A)((0,g.A)({},i),{},{courseInfo:i.courseInfo.map(r=>{const{bookCreationDate:l,bookLastReviewedDate:p}=r;return(0,g.A)((0,g.A)({},r),{},{bookCreationDate:this.validateDate(l),bookLastReviewedDate:this.validateDate(p)})})})),this.settings=i;const{CRKBO:a,isSelfBilling:s}=i;this.CRKBO.patchValue(a,{emitEvent:!1}),this.isSelfBilling.patchValue(s,{emitEvent:!1})}}),this.settingsForm.valueChanges.pipe((0,ke.Z)(i=>(this.settingsLoading=!0,(0,Fu.z)([(0,x.of)(i),this.teacherInvoiceService.putTeacherSelfbilling(i).pipe((0,D.W)(a=>(0,x.of)(null)))]))),(0,I.Q)(this.destroy$)).subscribe(([i,a])=>{if(this.settingsLoading=!1,null==a||!a.ok)return this.toastrService.error(this.translateService.instant("invoices.error.invoiceSetting")),this.CRKBO.patchValue(this.settings.CRKBO,{emitEvent:!1}),void this.isSelfBilling.patchValue(this.settings.isSelfBilling,{emitEvent:!1});this.settings=(0,g.A)((0,g.A)({},this.settings),i)})}openModal(i,a){const s={disableClose:!0,data:{type:me.m6.info,header:this.translateService.instant(i),content:this.translateService.instant(a)},panelClass:["col-12","col-md-4","material-modal"]};this.dialogService.open(oe.m,s)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}validateDate(i){return i&&(0,N.I1)(i,P.x.iso.date).isValid()?i:null}}return(t=o).\u0275fac=function(i){return new(i||t)},t.\u0275cmp=e.VBU({type:t,selectors:[["app-teacher-invoices-settings"]],decls:16,vars:12,consts:[["panel",""],["settingRow",""],[1,"container","mat-elevation-z3","pb-3","pt-3","mb-4","teacher-invoice","position-relative"],["style","left: var(--space-0); top: var(--space-0)",4,"ngIf"],[1,"row","settings-list"],[1,"col-12","row","mx-0","mb-3"],[1,"col-6","pl-0"],[1,"title","mb-3"],[1,"col-6","pr-0","text-right"],["mat-button","","color","primary",1,"py-2","px-3",3,"routerLink"],[1,"fas","fa-angle-left","text-white"],["class","col-12",4,"ngIf"],[2,"left","var(--space-0)","top","var(--space-0)"],[1,"col-12"],[1,"inner-loader","position-relative","bg-light-grey","p-3"],[1,"w-100",3,"multi"],[3,"formGroup"],[1,"row","my-3"],[1,"col-8"],["type","button","tabindex","0",1,"button-reset",3,"click"],[1,"fas","fa-info-circle"],[1,"col","text-right"],["formControlName","CRKBO","color","var(--color-main)"],[1,"col"],["formControlName","isSelfBilling","color","var(--color-main)"],[4,"ngIf"],[4,"ngFor","ngForOf"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"text-color"],[1,"row","my-2"],[1,"col-12","my-1"],[1,"m-0"],[1,"mt-2","mb-0"],["type","button","class","button-reset","tabindex","0",3,"click",4,"ngIf"],["role","alert",1,"alert","alert-primary","p-3","m-0"],[1,"fas","fa-exclamation-circle","mr-2"],[1,"uppercase-first-letter"]],template:function(i,a){1&i&&(e.j41(0,"div",2),e.DNE(1,Bu,1,0,"app-inner-loader",3),e.j41(2,"div",4)(3,"div",5)(4,"div",6)(5,"h3",7),e.EFF(6),e.nI1(7,"translate"),e.k0s()(),e.j41(8,"div",8)(9,"a",9),e.nrm(10,"i",10),e.EFF(11),e.nI1(12,"translate"),e.k0s()()(),e.DNE(13,qu,2,0,"div",11)(14,m1,31,16,"div",11)(15,p1,6,3,"div",11),e.k0s()()),2&i&&(e.R7$(),e.Y8G("ngIf",a.settingsLoading),e.R7$(5),e.JRh(e.bMT(7,7,"invoices.settings")),e.R7$(3),e.Y8G("routerLink",e.lJ4(11,yu)),e.R7$(2),e.SpI(" ",e.bMT(12,9,"invoices.goBack")," "),e.R7$(2),e.Y8G("ngIf",a.isLoading),e.R7$(),e.Y8G("ngIf",!a.isLoading&&a.settings),e.R7$(),e.Y8G("ngIf",!a.isLoading&&!a.settings))},dependencies:[u.Sq,u.bT,u.T3,c.qT,c.BC,c.cb,c.j4,c.JD,H.BS,H.GK,H.Z2,H.WN,H.Q6,E.It,ku.sG,X.H,O.Wk,m.D9,je.O,Pt.u],styles:[".inner-loader[_ngcontent-%COMP%]{z-index:var(--z-index-layer-0)}.settings-title[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:var(--font-size-87);font-weight:var(--font-weight-normal);margin-left:var(--space-20px)}.title[_ngcontent-%COMP%]{font-size:var(--font-size-125);font-weight:var(--font-weight-bold)}.button-reset[_ngcontent-%COMP%]{outline:var(--outline-none);border:var(--border-style-none);background:none;padding:var(--space-0);text-align:left;color:inherit;font-weight:var(--font-weight-inherit)}\n\n/*# sourceMappingURL=teacher-invoices-settings.component.css.map*/"]}),o})();const u1=()=>({key:"invoices.final"}),_1=()=>({prop:"finals"}
3),ft=t=>({name:t}),h1=()=>({key:"invoices.proforma"}),f1=()=>({prop:"proforma"});function g1(t,o){1&t&&e.nrm(0,"app-inner-loader",7)}function v1(t,o){1&t&&e.eu8(0)}function b1(t,o){1&t&&e.eu8(0)}function T1(t,o){if(1&t){const n=e.RV6();e.j41(0,"div",23)(1,"div",24),e.EFF(2),e.k0s(),e.j41(3,"div",25)(4,"button",26),e.bIt("click",function(){const a=e.eBV(n).$implicit,s=e.XpG(6);return e.Njj(s.showInvoice(a.name,a.url))}),e.j41(5,"span",27),e.EFF(6),e.k0s()()(),e.j41(7,"div",28)(8,"button",29),e.bIt("click",function(){const a=e.eBV(n).$implicit,s=e.XpG(6);return e.Njj(s.showInvoice(a.name,a.url))}),e.DNE(9,b1,1,0,"ng-container",20),e.k0s()()()}if(2&t){const n=o.$implicit;e.XpG(2);const i=e.sdS(19),a=e.XpG(4);e.R7$(2),e.JRh(n.companyName),e.R7$(2),e.Y8G("disabled",a.invoiceLoading[n.name]),e.R7$(2),e.SpI(" ",n.name," "),e.R7$(2),e.Y8G("disabled",a.invoiceLoading[n.name]),e.R7$(),e.Y8G("ngTemplateOutlet",i)("ngTemplateOutletContext",e.eq3(6,ft,n.name))}}function C1(t,o){1&t&&e.eu8(0)}function x1(t,o){if(1&t&&(e.qex(0),e.DNE(1,v1,1,0,"ng-container",20)(2,T1,10,8,"div",21),e.j41(3,"div",22),e.DNE(4,C1,1,0,"ng-container",20),e.k0s(),e.bVm()),2&t){e.XpG
3();const n=e.sdS(17),i=e.sdS(21),a=e.XpG().$implicit;e.R7$(),e.Y8G("ngTemplateOutlet",n)("ngTemplateOutletContext",e.lJ4(5,u1)),e.R7$(),e.Y8G("ngForOf",a.finals),e.R7$(2),e.Y8G("ngTemplateOutlet",i)("ngTemplateOutletContext",e.lJ4(6,_1))}}function I1(t,o){1&t&&e.eu8(0)}function R1(t,o){1&t&&e.eu8(0)}function F1(t,o){if(1&t){const n=e.RV6();e.j41(0,"div",23)(1,"div",24),e.EFF(2),e.k0s(),e.j41(3,"div",25)(4,"button",26),e.bIt("click",function(){const a=e.eBV(n).$implicit,s=e.XpG(6);return e.Njj(s.showInvoice(a.name,a.url))}),e.j41(5,"span",27),e.EFF(6),e.k0s()()(),e.j41(7,"div",28)(8,"button",29),e.bIt("click",function(){const a=e.eBV(n).$implicit,s=e.XpG(6);return e.Njj(s.showInvoice(a.name,a.url))}),e.DNE(9,R1,1,0,"ng-container",20),e.k0s()()()}if(2&t){const n=o.$implicit;e.XpG(2);const i=e.sdS(19),a=e.XpG(4);e.R7$(2),e.JRh(n.companyName),e.R7$(2),e.Y8G("disabled",a.invoiceLoading[n.name]),e.R7$(2),e.SpI(" ",n.name," "),e.R7$(2),e.Y8G("disabled",a.invoiceLoading[n.name]),e.R7$(),e.Y8G("ngTemplateOutlet",i)("ngTemplateOutletContext",e.eq3(6,ft,n.name))}}function k1(t,o){1&t&&e.eu8(0)}function y1(t,o){if(1&t&&(e.qex(0),e.DNE(1,I1,1,0,"ng-container",20)(2,F1,10,8,"div",21),e.j41(3,"div",22),e.DNE(4,k1,1,0,"ng-container",20),e.k0s(),e.bVm()),2&t){e.XpG
3();const n=e.sdS(17),i=e.sdS(21),a=e.XpG().$implicit;e.R7$(),e.Y8G("ngTemplateOutlet",n)("ngTemplateOutletContext",e.lJ4(5,h1)),e.R7$(),e.Y8G("ngForOf",a.proforma),e.R7$(2),e.Y8G("ngTemplateOutlet",i)("ngTemplateOutletContext",e.lJ4(6,f1))}}function E1(t,o){if(1&t&&(e.j41(0,"p",30)(1,"strong"),e.EFF(2),e.nI1(3,"translate"),e.nI1(4,"translate"),e.k0s()()),2&t){const n=o.key;e.R7$(2),e.Lme("",e.bMT(3,2,n),"",e.bMT(4,4,"typography.colon"),"")}}function S1(t,o){1&t&&e.nrm(0,"i",34)}function $1(t,o){1&t&&e.nrm(0,"app-inner-loader",35)}function M1(t,o){if(1&t&&(e.j41(0,"div",31),e.DNE(1,S1,1,0,"i",32)(2,$1,1,0,"app-inner-loader",33),e.k0s()),2&t){const n=o.name,i=e.XpG(5);e.R7$(),e.Y8G("ngIf",!i.invoiceLoading[n]),e.R7$(),e.Y8G("ngIf",i.invoiceLoading[n])}}function w1(t,o){1&t&&e.eu8(0)}function j1(t,o){if(1&t){const n=e.RV6();e.j41(0,"button",37),e.bIt("click",function(){const a=e.eBV(n).$implicit,s=e.XpG(6);return e.Njj(s.showInvoice(a.name,a.url))}),e.j41(1,"span",27),e.EFF(2),e.k0s(),e.j41(3,"span",38),e.DNE(4,w1,1,0,"ng-container",20),e.k0s()()}if(2&t){const n=o.$implicit;e.XpG(2);const i=e.sdS(19),a=e.XpG(4);e.Y8G("disabled",a.invoiceLoading[n.name]),e.R7$(2),e.SpI(" ",n.name," "),e.R7$(2),e.Y8G("ngTemplateOutlet",i)("ngTemplateOutletContext",e.eq3(4,ft,n.name))}}function G1(t,o){if(1&t&&e.DNE(0,j1,5,6,"button",36),2&t){const n=o.prop,i=e.XpG(2).$implicit;e.Y8G("ngForOf",i[n])}}function D1(t,o){if(1&t&&(e.qex(0),e.j41(1,"div",17)(2,"div",18)(3,"strong"),e.EFF(4),e.nI1(5,"translate"),e.k0s()(),e.j41(6,"div",18)(7,"strong"),e.EFF(8),e.nI1(9,"translate"),e.k0s()(),e.j41(10,"div",19)(11,"strong"),e.EFF(12),e.nI1(13,"translate"),e.k0s()()(),e.DNE(14,x1,5,7,"ng-container",6)(15,y1,5,7,"ng-container",6)(16,E1,5,6,"ng-template",null,2,e.C5r)(18,M1,3,2,"ng-template",null,3,e.C5r)(20,G1,1,1,"ng-template",null,4,e.C5r),e.bVm()),2&t){const n=e.XpG().$implicit;e.R7$(4),e.JRh(e.bMT(5,5,"companyName")),e.R7$(4),e.JRh(e.bMT(9,7,"examName")),e.R7$(4),e.JRh(e.bMT(13,9,"download")),e.R7$(2),e.Y8G("ngIf",n.finals&&n.finals.length),e.R7$(),e.Y8G("ngIf",n.proforma&&n.proforma.length)}}function O1(t,o){if(1&t&&(e.j41(0,"mat-expansion-panel",16,1)(2,"mat-expansion-panel-header")(3,"mat-panel-title")(4,"div"),e.EFF(5),e.k0s()()(),e.DNE(6,D1,22,11,"ng-container",6),e.k0s()),2&t){const n=o.$implicit;e.Y8G("expanded",!1),e.R7$(5),e.Lme("",n.monthName," ",n.year,""),e.R7$(),e.Y8G("ngIf",n.finals&&n.finals.length||n.proforma&&n.proforma.length)}}function A1(t,o){1&t&&e.eu8(0)}function N1(t,o){if(1&t&&(e.j41(0,"div",39),e.DNE(1,A1,1,0,"ng-container",40),e.k0s()),2&t){e.XpG
3(3);const n=e.sdS(3);e.R7$(),e.Y8G("ngTemplateOutlet",n)}}function L1(t,o){if(1&t&&(e.j41(0,"div",11)(1,"div",12)(2,"mat-accordion",13),e.DNE(3,O1,7,4,"mat-expansion-panel",14),e.k0s()(),e.DNE(4,N1,2,1,"div",15),e.k0s()),2&t){const n=o.$implicit;e.R7$(2),e.Y8G("multi",!1),e.R7$(),e.Y8G("ngForOf",n.invoices),e.R7$(),e.Y8G("ngIf",!n.invoices||!n.invoices.length)}}function Y1(t,o){1&t&&e.eu8(0)}function V1(t,o){if(1&t&&(e.j41(0,"div",41),e.DNE(1,Y1,1,0,"ng-container",40),e.k0s()),2&t){e.XpG(2);const n=e.sdS(3);e.R7$(),e.Y8G("ngTemplateOutlet",n)}}function P1(t,o){if(1&t&&(e.qex(0),e.j41(1,"div",8),e.DNE(2,L1,5,3,"div",9)(3,V1,2,1,"div",10),e.k0s(),e.bVm()),2&t){const n=e.XpG();e.R7$(2),e.Y8G("ngForOf",n.courses),e.R7$(),e.Y8G("ngIf",!n.courses||!n.courses.length)}}function X1(t,o){1&t&&(e.j41(0,"div",43),e.nrm(1,"i",44),e.j41(2,"span",45),e.EFF(3),e.nI1(4,"translate"),e.k0s()()),2&t&&(e.R7$(3),e.JRh(e.bMT(4,1,"invoices.noInvoicesText")))}function B1(t,o){if(1&t&&e.DNE(0,X1,5,3,"div",42),2&t){const n=e.XpG();e.Y8G("ngIf",!n.isLoading&&!n.settings)}}let q1=(()=>{var t;class o{constructor(){this.teacherInvoiceService=(0,e.WQX)(at),this.toastrService=(0,e.WQX)(w.tw),this.translateService=(0,e.WQX)(m.c$),this.year=null,this.courseCode=null,this.isLoading=!0,this.invoiceLoading={},this.destroy$=new y.B}ngOnInit(){this.year?this.teacherInvoiceService.getTeacherInvoices(this.year,this.courseCode).pipe((0,I.Q)(this.destroy$)).subscribe(i=>{this.isLoading=!1,i=i.map(a=>(a.invoices&&a.invoices.length&&(a.invoices=a.invoices.map(s=>(s.data&&s.data.length&&(s.finals=[],s.proforma=[],s.data.forEach(r=>{"final"===r.type?s.finals=[...s.finals,r]:s.proforma=[...s.proforma,r]})),s))),a)),this.courses=i}):this.isLoading=!1}showInvoice(i,a){const s=()=>this.toastrService.error(this.translateService.instant("invoices.error.loadingInvoice"));this.invoiceLoading[i]=!0,this.teacherInvoiceService.getTeacherInvoice(a).pipe((0,Z.n)(r=>{if(r){const{readInvoiceToken:l,url:p}=r;return this.teacherInvoiceService.postTeacherInvoice(l,p).pipe((0,D.W)(d=>(0,x.of)(null)))}return s(),null}),(0,D.W)(r=>(0,x.of)(null)),(0,I.Q)(this.destroy$)).subscribe(r=>{if(delete this.invoiceLoading[i],!r)return void s();const{body:l}=r||{},p=new Uint8Array(l),d=new Blob([p],{type:"application/pdf"});if(d.size){const h=URL.createObjectURL(d);window.open(h,"_blank")}else s()})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}}return(t=o).\u0275fac=function(i){return new(i||t)},t.\u0275cmp=e.VBU({type:t,selectors:[["app-teacher-invoices-overview"]],inputs:{year:"year",courseCode:"courseCode"},decls:4,vars:2,consts:[["noInvoices",""],["panel",""],["type",""],["finalDownloadIndicator",""],["mobileDownloadButton",""],["class","inner-loader position-relative p-3",4,"ngIf"],[4,"ngIf"],[1,"inner-loader","position-relative","p-3"],["id","invoice-container",1,"container"],["class","row invoice-month-list",4,"ngFor","ngForOf"],["class","row m-0",4,"ngIf"],[1,"row","invoice-month-list"],[1,"invoice","col-12","px-0"],[1,"w-100",3,"multi"],[3,"expanded",4,"ngFor","ngForOf"],["class","bg-light-grey",4,"ngIf"],[3,"expanded"],[1,"row","pt-3","d-none","d-md-flex"],[1,"col-5"],[1,"col-2","text-center"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["class","row py-3 d-none d-md-flex invoice-list-item",4,"ngFor","ngForOf"],[1,"d-block","d-md-none"],[1,"row","py-3","d-none","d-md-flex","invoice-list-item"],[1,"col-5","d-md-block","d-none"],[1,"col-10","col-md-5"],["type","button","tabindex","0",1,"button-reset","link-color",3,"click","disabled"],[1,"invoice-title"],[1,"col-2","col-md-2","d-none","d-md-block","text-center"],["type","button","tabindex","0",1,"button-reset",3,"click","disabled"],[1,"mt-3","my-0","my-md-3"],[1,"download-icon"],["class","fas fa-arrow-alt-circle-down fa-lg",4,"ngIf"],["class","inner-loader inline-loader w-100 bg-white",4,"ngIf"],[1,"fas","fa-arrow-alt-circle-down","fa-lg"],[1,"inner-loader","inline-loader","w-100","bg-white"],["type","button","tabindex","0","class","button-reset invoice-download-button link-color py-3",3,"disabled","click",4,"ngFor","ngForOf"],["type","button","tabindex","0",1,"button-reset","invoice-download-button","link-color","py-3",3,"click","disabled"],[1,"d-inline-block","d-md-none","ml-2"],[1,"bg-light-grey"],[4,"ngTemplateOutlet"],[1,"row","m-0"],["class","col-12 alert alert-primary","role","alert",4,"ngIf"],["role","alert",1,"col-12","alert","alert-primary"],[1,"fas","fa-exclamation-circle","mr-2"],[1,"uppercase-first-letter"]],template:function(i,a){1&i&&e.DNE(0,g1,1,0,"app-inner-loader",5)(1,P1,4,2,"ng-container",6)(2,B1,1,1,"ng-template",null,0,e.C5r),2&i&&(e.Y8G("ngIf",a.isLoading),e.R7$(),e.Y8G("ngIf",!a.isLoading))},dependencies:[u.Sq,u.bT,u.T3,H.BS,H.GK,H.Z2,H.WN,X.H,m.D9],styles:["#invoice-container .mat-expansion-panel-content{border-top:var(--border-xs-solid-tint-3)}.inner-loader[_ngcontent-%COMP%]{z-index:var(--z-index-layer-0)}.title[_ngcontent-%COMP%]{font-size:var(--font-size-125);font-weight:var(--font-weight-bold)}.invoice-list-item[_ngcontent-%COMP%]{border-top:var(--border-xs-solid-tint-3)}.button-reset[_ngcontent-%COMP%]{outline:var(--outline-none);border:var(--border-style-none);background:none;padding:var(--space-0);text-align:left;max-width:var(--size-100-percent);font-weight:var(--font-weight-inherit)}[disabled][_ngcontent-%COMP%]{opacity:var(--opacity-50)}.inline-loader[_ngcontent-%COMP%]{top:var(--space-0);left:var(--space-0)}.download-icon[_ngcontent-%COMP%]{display:inline-block;width:var(--size-16px)}.invoice-download-button[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr auto;width:var(--size-100-percent);gap:var(--space-1rem)}.invoice-title[_ngcontent-%COMP%]{max-width:var(--size-100-percent);overflow:auto}.hide[_ngcontent-%COMP%]{display:none}.invoice-grid[_ngcontent-%COMP%], .invoice-grid-row[_ngcontent-%COMP%], .invoice-month-row[_ngcontent-%COMP%]{display:grid}.invoice-grid[_ngcontent-%COMP%]{grid-template-columns:1fr;gap:var(--space-1rem)}.invoice-grid-row[_ngcontent-%COMP%]{grid-template-columns:1fr auto}.invoice-month-row[_ngcontent-%COMP%]{grid-template-columns:auto 1fr;gap:var(--space-1rem)}.invoice-month[_ngcontent-%COMP%]{padding-top:var(--space-0_5rem)}.invoice-button[_ngcontent-%COMP%]{width:var(--size-100-percent);padding:var(--space-0_5rem);transition:var(--transition-property-background) var(--duration-300) var(--behavior-function-ease);border-radius:var(--border-radius-sm)}.invoice-button[_ngcontent-%COMP%]:not(.invoice-button:last-child){margin-bottom:var(--space-0_5rem)}.invoice-button[_ngcontent-%COMP%]:hover{background:var(--color-background)}@media (max-width: 576px){.proforma[_ngcontent-%COMP%]{font-size:var(--font-size-87)}}\n\n/*# sourceMappingURL=teacher-invoices-overview.component.css.map*/"]}),o})();function U1(t,o){1&t&&(e.j41(0,"div",11),e.nrm(1,"app-inner-loader",12),e.k0s())}function J1(t,o){if(1&t&&e.nrm(0,"app-teacher-invoices-overview",19),2&t){const n=e.XpG().$implicit,i=e.XpG().$implicit;e.Y8G("year",n)("courseCode",i.courseCode)}}function Q1(t,o){if(1&t&&(e.j41(0,"mat-expansion-panel",null,0)(2,"mat-expansion-panel-header")(3,"mat-panel-title"),e.EFF(4),e.k0s()(),e.DNE(5,J1,1,2,"ng-template",18),e.k0s()),2&t){const n=o.$implicit;e.R7$(4),e.JRh(n)}}function z1(t,o){if(1&t&&(e.j41(0,"div",14)(1,"div",2)(2,"div",11)(3,"h4",5),e.EFF(4),e.nI1(5,"translate"),e.k0s()(),e.j41(6,"div",15)(7,"mat-accordion",16),e.DNE(8,Q1,6,1,"mat-expansion-panel",17),e.k0s()()()()),2&t){const n=o.$implicit;e.R7$(4),e.LHq("",n.courseName," (",n.type,"",e.bMT(5,6,"typography.comma"),"",n.courseCode,")"),e.R7$(3),e.Y8G("multi",!1),e.R7$(),e.Y8G("ngForOf",n.datesList)}}function W1(t,o){1&t&&(e.j41(0,"div",11)(1,"div",20),e.nrm(2,"i",21),e.j41(3,"span",22),e.EFF(4),e.nI1(5,"translate"),e.k0s()()()),2&t&&(e.R7$(4),e.JRh(e.bMT(5,1,"invoices.noInvoicesText")))}function H1(t,o){if(1&t&&(e.qex(0),e.DNE(1,z1,9,8,"div",13)(2,W1,6,3,"div",9),e.bVm()),2&t){const n=e.XpG();e.R7$(),e.Y8G("ngForOf",n.invoiceList),e.R7$(),e.Y8G("ngIf",!(null!=n.invoiceList&&n.invoiceList.length))}}let K1=(()=>{var t;class o{constructor(){this.teacherInvoiceService=(0,e.WQX)(at),this.isLoading=!0,this.invoiceList=[],this.destroy$=new y.B}ngOnInit(){this.teacherInvoiceService.getTeacherInvoiceList().pipe((0,I.Q)(this.destroy$)).subscribe(i=>{this.isLoading=!1,null!=i&&i.length&&(this.invoiceList=i)})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}}return(t=o).\u0275fac=function(i){return new(i||t)},t.\u0275cmp=e.VBU({type:t,selectors:[["app-teacher-invoices-year-overview"]],decls:14,vars:9,consts:[["panel",""],[1,"container","mat-elevation-z3","sm-no-shadow","pb-3","pt-3","mb-4"],[1,"row"],[1,"col-12","row","mx-0","mb-3"],[1,"col-6","pl-0"],[1,"title","mb-3"],[1,"col-6","pr-0","text-right"],["mat-button","","color","primary",1,"py-2","px-3",3,"routerLink"],[1,"fas","fa-user-cog","text-white"],["class","col-12",4,"ngIf"],[4,"ngIf"],[1,"col-12"],[1,"inner-loader","position-relative","bg-light-grey","p-3"],["class","container invoice-course-list",4,"ngFor","ngForOf"],[1,"container","invoice-course-list"],[1,"col-12","mb-3"],[1,"w-100",3,"multi"],[4,"ngFor","ngForOf"],["matExpansionPanelContent",""],[3,"year","courseCode"],["role","alert",1,"alert","alert-primary","p-3","m-0"],[1,"fas","fa-exclamation-circle","mr-2"],[1,"uppercase-first-letter"]],template:function(i,a){1&i&&(e.j41(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"h3",5),e.EFF(5),e.nI1(6,"translate"),e.k0s()(),e.j41(7,"div",6)(8,"a",7),e.nrm(9,"i",8),e.EFF(10),e.nI1(11,"translate"),e.k0s()()(),e.DNE(12,U1,2,0,"div",9)(13,H1,3,2,"ng-container",10),e.k0s()()),2&i&&(e.R7$(5),e.JRh(e.bMT(6,5,"invoices.myInvoices")),e.R7$(3),e.Y8G("routerLink","settings"),e.R7$(2),e.SpI(" ",e.bMT(11,7,"invoices.settings")," "),e.R7$(2),e.Y8G("ngIf",a.isLoading),e.R7$(),e.Y8G("ngIf",!a.isLoading))},dependencies:[u.Sq,u.bT,H.BS,H.GK,H.Z2,H.WN,H.LR,E.It,X.H,O.Wk,q1,m.D9],styles:[".inner-loader[_ngcontent-%COMP%]{z-index:var(--z-index-layer-0)}.button-reset[_ngcontent-%COMP%]{outline:var(--outline-none);border:var(--border-style-none);background:none;padding:var(--space-0);text-align:left;color:inherit;font-weight:var(--font-weight-inherit)}.title[_ngcontent-%COMP%]{font-size:var(--font-size-125);font-weight:var(--font-weight-bold)}\n\n/*# sourceMappingURL=teacher-invoices-year-overview.component.css.map*/"]}),o})(),Z1=(()=>{var t;class o{constructor(){this.teacherInvoiceService=(0,e.WQX)(at)}ngOnDestroy(){this.teacherInvoiceService.clearInvoiceCache()}}return(t=o).\u0275fac=function(i){return new(i||t)},t.\u0275cmp=e.VBU({type:t,selectors:[["app-teacher-invoices"]],decls:1,vars:0,template:function(i,a){1&i&&e.nrm(0,"router-outlet")},dependencies:[O.n3],styles:["main[_ngcontent-%COMP%]{padding-top:var(--space-30px)}\n\n/*# sourceMappingURL=teacher-invoices.component.ts-angular-inline--12.css.map*/"]}),o})();const e_=["mediaModal"],t_=["uploader"],n_=t=>({hidden:t}),i_=t=>({"overflow-visible":t}),gt=t=>({"text-danger":t}),vt=(t,o)=>({left:t,right:o}),a_=(t,o,n)=>({"media-card-weblink":t,"media-card-folder":o,"media-card-document":n}),o_=t=>({"text-success":t}),s_=t=>({ext:t}),r_=t=>({"extra-margin":t});function l_(t,o){1&t&&e.nrm(0,"i",26)}function c_(t,o){if(1&t){const n=e.RV6();e.j41(0,"button",18),e.nI1(1,"translate"),e.bIt("click",function(){e.eBV(n);const a=e.XpG().$implicit,s=e.XpG(2);return e.Njj(s.navigateFolder("navigateToFolderId",a.folderId))}),e.j41(2,"div",19),e.nrm(3,"i",23),e.DNE(4,l_,1,0,"i",24),e.j41(5,"span",25),e.EFF(6),e.k0s()()()}if(2&t){const n=e.XpG(),i=n.$implicit,a=n.last;e.FCK("matTooltip","",e.bMT(1,6,"teacherMediaReturn")," ",i.label,""),e.Y8G("dynamicPosition",!1),e.R7$(4),e.Y8G("ngIf",!a),e.R7$(2),e.JRh(i.label)}}function m_(t,o){1&t&&e.nrm(0,"i",31)}
3function p_(t,o){if(1&t&&(e.j41(0,"button",27)(1,"div",19),e.nrm(2,"i",28),e.DNE(3,m_,1,0,"i",29),e.j41(4,"span",30),e.EFF(5),e.k0s()()()),2&t){const n=e.XpG(),i=n.$implicit,a=n.last;e.FS9("matTooltip",i.label),e.Y8G("dynamicPosition",!1),e.R7$(3),e.Y8G("ngIf",a),e.R7$(2),e.JRh(i.label)}}function d_(t,o){if(1&t&&(e.qex(0),e.DNE(1,c_,7,8,"button",21)(2,p_,6,4,"button",22),e.bVm()),2&t){const n=o.last;e.R7$(),e.Y8G("ngIf",!n),e.R7$(),e.Y8G("ngIf",n)}}function u_(t,o){if(1&t){const n=e.RV6();e.qex(0),e.j41(1,"div",5)(2,"div",16)(3,"div",17)(4,"button",18),e.nI1(5,"translate"),e.bIt("click",function(){e.eBV(n);const a=e.XpG();return e.Njj(a.handleBack())}),e.j41(6,"div",19),e.nrm(7,"i",20),e.EFF(8),e.k0s()(),e.DNE(9,d_,3,2,"ng-container",13),e.k0s()()(),e.bVm()}if(2&t){const n=e.XpG();e.R7$(4),e.FCK("matTooltip","",e.bMT(5,6,"teacherMediaReturn")," ",n.mainFolderName,""),e.Y8G("dynamicPosition",!1),e.R7$(4),e.SpI(" ",n.mainFolderName," "),e.R7$(),e.Y8G("ngForOf",n.breadcrumbs)}}function __(t,o){if(1&t&&(e.qex(0),e.j41(1,"p",32),e.nrm(2,"i",33),e.EFF(3),e.nI1(4,"translate"),e.k0s(),e.bVm()),2&t){const n=e.XpG();e.R7$(3),e.SpI(" ",e.bMT(4,1,n.globalError),"")}}function h_(t,o){if(1&t&&(e.qex(0),e.j41(1,"div",5)(2,"div",6)(3,"p"),e.EFF(4),e.nI1(5,"translate"),e.nI1(6,"titleCaseFirstWord"),e.k0s()()(),e.bVm()),2&t){const n=e.XpG(2);e.R7$(4),e.JRh(e.bMT(6,3,e.bMT(5,1,n.isDocuments?"teacherDocumentsInfo":"teacherMediaWeblinksInfo")))}}function f_(t,o){1&t&&(e.j41(0,"mat-error")(1,"span"),e.EFF(2),e.nI1(3,"translate"),e.k0s()()),2&t&&(e.R7$(2),e.JRh(e.bMT(3,1,"formValidation.required")))}function g_(t,o){if(1&t&&(e.j41(0,"p",42),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t){const n=e.XpG(3);e.Y8G("ngClass",e.eq3(5,gt,n.folderForm.get("name").value.length>n.requestMaxNameLength)),e.R7$(),e.SpI(" ",e.i5U(2,2,"typography.slash",e.l_i(7,vt,n.folderForm.get("name").value.length,n.requestMaxNameLength))," ")}}function v_(t,o){if(1&t&&(e.qex(0),e.j41(1,"form",35)(2,"div",5)(3,"mat-form-field",36)(4,"mat-label"),e.EFF(5),e.nI1(6,"translate"),e.k0s(),e.nrm(7,"input",37),e.DNE(8,f_,4,3,"mat-error",9),e.k0s(),e.j41(9,"div",6),e.DNE(10,g_,3,10,"p",38),e.k0s(),e.j41(11,"div",6)(12,"mat-checkbox",39)(13,"span"),e.EFF(14),e.nI1(15,"translate"),e.nI1(16,"titleCaseFirstWord"),e.nrm(17,"i",40),e.nI1(18,"translate"),e.k0s()()()()(),e.j41(19,"div",5)(20,"div",41),e.nrm(21,"hr"),e.k0s()(),e.bVm()),2&t){const n=e.XpG(2);e.R7$(),e.Y8G("formGroup",n.folderForm),e.R7$(4),e.JRh(e.bMT(6,6,"title")),e.R7$(3),e.Y8G("ngIf",null==n.folderForm||null==n.folderForm.controls||null==n.folderForm.controls.name||null==n.folderForm.controls.name.errors?null:n.folderForm.controls.name.errors.required),e.R7$(2),e.Y8G("ngIf",n.folderName),e.R7$(4),e.SpI(" ",e.bMT(16,10,e.bMT(15,8,"active"))," "),e.R7$(3),e.FS9("matTooltip",e.bMT(18,12,"teacherMediaVisibilityForStudents"))}}function b_(t,o){if(1&t){const n=e.RV6();e.j41(0,"div",45)(1,"div",46)(2,"button",47),e.bIt("click",function(){e.eBV(n);const a=e.XpG(3);return e.Njj(a.navigateFolder("add",a.requestFolderId))}),e.EFF(3),e.nI1(4,"translate"),e.nI1(5,"titleCaseFirstWord"),e.k0s(),e.j41(6,"button",47),e.bIt("click",function(){e.eBV(n);const a=e.XpG(3);return e.Njj(a.openMediaModal("weblink","add"))}),e.EFF(7),e.nI1(8,"translate"),e.nI1(9,"titleCaseFirstWord"),e.k0s()()()}if(2&t){const n=e.XpG(3);e.R7$(2),e.Y8G("disabled",n.creatingFolder&&n.breadcrumbs.length<=n.maximumAllowedLevels||n.breadcrumbs.length>=n.maximumAllowedLevels),e.R7$(),e.SpI(" ",e.bMT(5,6,e.bMT(4,4,"teacherMediaAddFolder"))," "),e.R7$(3),e.Y8G("disabled",n.creatingFolder),e.R7$(),e.SpI(" ",e.bMT(9,10,e.bMT(8,8,n.isDocuments?"teacherDocumentsAdd":"teacherMediaLinkAdd"))," ")}}function T_(t,o){if(1&t&&(e.j41(0,"div",43),e.DNE(1,b_,10,12,"div",44),e.k0s()),2&t){const n=e.XpG(2);e.R7$(),e.Y8G("ngIf",!n.isReadonly)}}function C_(t,o){if(1&t&&(e.qex(0),e.DNE(1,h_,7,5,"ng-container",9)(2,v_,22,14,"ng-container",9)(3,T_,2,1,"div",34),e.bVm()),2&t){const n=e.XpG();e.R7$(),e.Y8G("ngIf",!n.editingFolder),e.R7$(),e.Y8G("ngIf",n.editingFolder&&!n.isReadonly),e.R7$(),e.Y8G("ngIf",!n.globalError&&!n.isReadonly)}}function x_(t,o){1&t&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"translate"),e.nI1(3,"titleCaseFirstWord"),e.k0s()),2&t&&(e.R7$(),e.SpI("",e.bMT(3,3,e.bMT(2,1,"teacherMediaNoLinks"))," "))}function I_(t,o){1&t&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"teacherNoDocumentsAvailable")," "))}
3function R_(t,o){if(1&t&&(e.j41(0,"p",32),e.nrm(1,"i",33),e.EFF(2,"\xa0"),e.DNE(3,x_,4,5,"span",49)(4,I_,3,3,"ng-template",null,2,e.C5r),e.k0s()),2&t){const n=e.sdS(5),i=e.XpG(2);e.R7$(3),e.Y8G("ngIf",!i.isDocuments)("ngIfElse",n)}}function F_(t,o){1&t&&(e.j41(0,"p",32),e.nrm(1,"i",33),e.EFF(2),e.nI1(3,"translate"),e.nI1(4,"titleCaseFirstWord"),e.k0s()),2&t&&(e.R7$(2),e.SpI("\xa0",e.bMT(4,3,e.bMT(3,1,"teacherMediaFolderEmpty"))," "))}function k_(t,o){1&t&&(e.j41(0,"p",32),e.nrm(1,"i",33),e.EFF(2),e.nI1(3,"translate"),e.k0s()),2&t&&(e.R7$(2),e.SpI("\xa0",e.bMT(3,1,"teacherMediaReadOnlyFolder"),""))}function y_(t,o){if(1&t&&(e.qex(0),e.DNE(1,R_,6,2,"p",48)(2,F_,5,5,"p",48)(3,k_,4,3,"p",48),e.bVm()),2&t){const n=e.XpG();e.R7$(),e.Y8G("ngIf",!n.contentAvailable&&!n.editingFolder),e.R7$(),e.Y8G("ngIf",!n.contentAvailable&&(n.editingFolder||n.creatingFolder)),e.R7$(),e.Y8G("ngIf",n.isReadonly)}}function E_(t,o){1&t&&e.nrm(0,"i",63)}function S_(t,o){1&t&&e.nrm(0,"i",69)}function $_(t,o){1&t&&e.nrm(0,"i",70)}function M_(t,o){1&t&&e.nrm(0,"i",70)}function w_(t,o){1&t&&e.nrm(0,"i",71)}function j_(t,o){1&t&&e.nrm(0,"i",71)}function G_(t,o){1&t&&e.nrm(0,"i",72)}function D_(t,o){if(1&t&&(e.qex(0,64),e.DNE(1,S_,1,0,"i",65)(2,$_,1,0,"i",66)(3,M_,1,0,"i",66)(4,w_,1,0,"i",67)(5,j_,1,0,"i",67)(6,G_,1,0,"i",68),e.bVm()),2&t){const n=e.XpG(3).$implicit;e.Y8G("ngSwitch",n.ext),e.R7$(),e.Y8G("ngSwitchCase","pdf"),e.R7$(),e.Y8G("ngSwitchCase","doc"),e.R7$(),e.Y8G("ngSwitchCase","docx"),e.R7$(),e.Y8G("ngSwitchCase","xls"),e.R7$(),e.Y8G("ngSwitchCase","xlsx")}}function O_(t,o){if(1&t&&(e.j41(0,"p")(1,"em"),e.EFF(2),e.nI1(3,"translate"),e.nI1(4,"translate"),e.nI1(5,"translate"),e.k0s()()),2&t){const n=e.XpG(3).$implicit;e.R7$(2),e.E5c("",e.bMT(3,3,"fileType"),"",e.bMT(4,5,"typography.colon"),"",e.i5U(5,7,"fileExtension",e.eq3(10,s_,n.ext)),"")}}function A_(t,o){if(1&t&&(e.qex(0),e.j41(1,"a",60),e.DNE(2,E_,1,0,"i",61)(3,D_,7,6,"ng-container",62),e.j41(4,"span")(5,"h4"),e.EFF(6),e.k0s()()(),e.DNE(7,O_,6,12,"p",9),e.bVm()),2&t){const n=e.XpG(2).$implicit,i=e.XpG();e.R7$(),e.FS9("href",i.isDocuments?n.path.path:n.url,e.B4B),e.R7$(),e.Y8G("ngIf",!i.isDocuments),e.R7$(),e.Y8G("ngIf",i.isDocuments),e.R7$(3),e.JRh(n.name),e.R7$(),e.Y8G("ngIf",i.isDocuments)}}function N_(t,o){if(1&t&&(e.j41(0,"span",73)(1,"h4"),e.nrm(2,"i",74),e.EFF(3),e.k0s()()),2&t){const n=e.XpG(2).$implicit;e.R7$(3),e.JRh(n.name)}}function L_(t,o){if(1&t&&(e.qex(0),e.j41(1,"p",75),e.EFF(2),e.k0s(),e.bVm()),2&t){const n=e.XpG(2).$implicit;e.R7$(2),e.SpI(" ",n.description," ")}}function Y_(t,o){if(1&t){const n=e.RV6();e.j41(0,"button",76),e.bIt("click",function(){e.eBV(n);const a=e.XpG(2).$implicit,s=e.XpG();return e.Njj(s.openMediaModal(a.type,"remove",a))}),e.EFF(1),e.nI1(2,"translate"),e.nI1(3,"titleCaseFirstWord"),e.k0s()}2&t&&(e.R7$(),e.JRh(e.bMT(3,3,e.bMT(2,1,"delete"))))}function V_(t,o){if(1&t){const n=e.RV6();e.j41(0,"button",77),e.bIt("click",function(){e.eBV(n);const a=e.XpG(2).$implicit,s=e.XpG();return e.Njj(s.openMediaModal(a.type,"edit",a))}),e.EFF(1),e.nI1(2,"translate"),e.nI1(3,"titleCaseFirstWord"),e.k0s()}if(2&t){const n=e.XpG(2).$implicit;e.R7$(),e.SpI(" ",e.bMT(3,3,e.bMT(2,1,n.readonly?"view":"edit"))," ")}}function P_(t,o){if(1&t){const n=e.RV6();e.j41(0,"button",78),e.bIt("click",function(){e.eBV(n);const a=e.XpG(2).$implicit,s=e.XpG();return e.Njj(s.navigateFolder("edit",a.id))}),e.EFF(1),e.nI1(2,"translate"),e.nI1(3,"titleCaseFirstWord"),e.k0s()}if(2&t){const n=e.XpG(2).$implicit;e.R7$(),e.SpI(" ",e.bMT(3,3,e.bMT(2,1,n.readonly?"view":"edit"))," ")}}function X_(t,o){1&t&&(e.qex(0),e.j41(1,"div",79),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.bVm()),2&t&&(e.R7$(2),e.SpI(" ",e.bMT(3,1,"teacherMediaAddedByHeadTeacher")," "))}function B_(t,o){if(1&t&&(e.j41(0,"div",51)(1,"div",52)(2,"div",53),e.qex(3),e.j41(4,"span",54),e.EFF(5),e.nI1(6,"dateformat"),e.k0s(),e.bVm(),e.qex(7),e.j41(8,"span",55),e.EFF(9),e.nI1(10,"translate"),e.k0s(),e.bVm(),e.k0s(),e.DNE(11,A_,8,5,"ng-container",49)(12,N_,4,1,"ng-template",null,3,e.C5r)(14,L_,3,1,"ng-container",9),e.j41(15,"div",56),e.DNE(16,Y_,4,5,"button",57)(17,V_,4,5,"button",58)(18,P_,4,5,"button",59),e.k0s()(),e.DNE(19,X_,4,3,"ng-container",9),e.k0s()),2&t){const n=e.sdS(13),i=e.XpG().$implicit,a=e.XpG();
3e.Y8G("ngClass",e.sMw(15,a_,"weblink"===i.type,"document-folder"===i.type,"document"===i.type)),e.R7$(5),e.SpI(" ",e.bMT(6,11,i.dateCreated)," "),e.R7$(3),e.Y8G("ngClass",e.eq3(19,o_,i.public)),e.R7$(),e.SpI(" ",e.bMT(10,13,i.public?a.isDocuments?"teacherMediaVisibilityForStudents":"active":"private")," "),e.R7$(2),e.Y8G("ngIf","weblink"===i.type)("ngIfElse",n),e.R7$(3),e.Y8G("ngIf",i.description),e.R7$(2),e.Y8G("ngIf",!i.readonly),e.R7$(),e.Y8G("ngIf","weblink"===i.type&&!i.readonly),e.R7$(),e.Y8G("ngIf","weblink"!==i.type),e.R7$(),e.Y8G("ngIf",i.readonly)}}function q_(t,o){if(1&t&&(e.qex(0),e.DNE(1,B_,20,21,"div",50),e.bVm()),2&t){const n=o.index,i=e.XpG();e.R7$(),e.Y8G("ngIf",n>=i.pageIndex*i.maxVisibleItems&&n<(i.pageIndex+1)*i.maxVisibleItems)}}function U_(t,o){if(1&t&&(e.qex(0),e.j41(1,"div",83)(2,"p",84),e.EFF(3),e.k0s()(),e.bVm()),2&t){const n=e.XpG(2);e.R7$(3),e.JRh(n.requestFolderError)}}function J_(t,o){if(1&t){const n=e.RV6();e.j41(0,"button",85),e.bIt("click",function(){e.eBV(n);const a=e.XpG(2);return e.Njj(a.editFolder(a.requestState,a.folderForm))}),e.EFF(1),e.nI1(2,"translate"),e.k0s()}if(2&t){const n=e.XpG(2);e.Y8G("disabled",(n.requestProcessing||"edit"===n.requestState||n.creatingFolder)&&n.folderName.errors||n.folderForm.pristine),e.R7$(),e.SpI(" ",e.bMT(2,2,"save")," ")}}function Q_(t,o){if(1&t){const n=e.RV6();e.qex(0),e.DNE(1,U_,4,1,"ng-container",9),e.j41(2,"div",80)(3,"button",81),e.bIt("click",function(){e.eBV(n);const a=e.XpG();return e.Njj(a.navigateFolder("navigateToParent",a.requestParentId))}),e.EFF(4),e.nI1(5,"translate"),e.nI1(6,"titleCaseFirstWord"),e.k0s(),e.DNE(7,J_,3,4,"button",82),e.k0s(),e.bVm()}if(2&t){const n=e.XpG();e.R7$(),e.Y8G("ngIf",n.requestFolderError),e.R7$(3),e.JRh(e.bMT(6,5,e.bMT(5,3,"cancel"))),e.R7$(3),e.Y8G("ngIf",!n.isReadonly)}}function z_(t,o){if(1&t&&(e.j41(0,"span",101),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t){const n=e.XpG(3);e.Y8G("ngClass",e.eq3(5,gt,n.mediaForm.get("name").value.length>n.requestMaxNameLength)),e.R7$(),e.SpI(" ",e.i5U(2,2,"typography.slash",e.l_i(7,vt,n.mediaForm.get("name").value.length,n.requestMaxNameLength))," ")}}function W_(t,o){1&t&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"teacherMediaFormInputName")," "))}function H_(t,o){if(1&t&&(e.j41(0,"mat-error"),e.DNE(1,W_,3,3,"span",9),e.k0s()),2&t){const n=e.XpG(3);e.R7$(),e.Y8G("ngIf",n.name.hasError("required"))}}function K_(t,o){if(1&t&&(e.j41(0,"span",104),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t){const n=e.XpG(4);e.Y8G("ngClass",e.eq3(5,gt,n.mediaForm.get("description").value.length>n.requestMaxDescriptionLength)),e.R7$(),e.SpI(" ",e.i5U(2,2,"typography.slash",e.l_i(7,vt,n.mediaForm.get("description").value.length,n.requestMaxDescriptionLength))," ")}}function Z_(t,o){1&t&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"teacherMediaFormInputDescription")," "))}function eh(t,o){if(1&t&&(e.j41(0,"mat-error"),e.DNE(1,Z_,3,3,"span",9),e.k0s()),2&t){const n=e.XpG(4);e.R7$(),e.Y8G("ngIf",n.description.hasError("required"))}}function th(t,o){if(1&t&&(e.j41(0,"mat-form-field")(1,"mat-label"),e.EFF(2),e.nI1(3,"translate"),e.nI1(4,"titleCaseFirstWord"),e.k0s(),e.nrm(5,"textarea",102),e.DNE(6,K_,3,10,"span",103)(7,eh,2,1,"mat-error",9),e.k0s()),2&t){const n=e.XpG(3);e.R7$(2),e.JRh(e.bMT(4,5,e.bMT(3,3,"teacherMediaDescription"))),e.R7$(4),e.Y8G("ngIf",n.description),e.R7$(),e.Y8G("ngIf",n.description.invalid&&(n.description.dirty||n.description.touched))}}function nh(t,o){1&t&&(e.j41(0,"mat-error"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"teacherMediaFormInputUrl")," "))}function ih(t,o){if(1&t&&(e.j41(0,"mat-form-field",105)(1,"mat-label"),e.EFF(2),e.nI1(3,"translate"),e.nI1(4,"titleCaseFirstWord"),e.k0s(),e.nrm(5,"input",106),e.DNE(6,nh,3,3,"mat-error",9),e.j41(7,"mat-hint"),e.EFF(8),e.nI1(9,"translate"),e.k0s()()),2&t){const n=e.XpG(3);e.R7$(2),e.JRh(e.bMT(4,5,e.bMT(3,3,"teacherMediaUrl"))),e.R7$(4),e.Y8G("ngIf",n.url.invalid&&(n.url.dirty||n.url.touched)),e.R7$(2),e.JRh(e.bMT(9,7,"teacherMediaHint"))}}function ah(t,o){if(1&t){const n=e.RV6();e.j41(0,"app-file-upload",107,4),e.bIt("fileSelected",function(a){e.eBV(n);const s=e.XpG(3);return e.Njj(s.onFileSelect(a))}),e.k0s()}if(2&t){const n=e.XpG(3);e.Y8G("uploadIcon",!0)("withFab",!0)("canRemove",!1)("files",n.files.length&&n.files)}}function oh(t,o){if(1&t&&(e.j41(0,"mat-option",112),e.EFF(1),e.k0s()),2&t){const n=o.$implicit;e.Y8G("value",n.value),e.R7$(),e.SpI(" ",n.label," ")}}function sh(t,o){if(1&t&&(e.j41(0,"mat-form-field",108)(1,"mat-label",109),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.j41(4,"mat-select",110),e.DNE(5,oh,2,2,"mat-option",111),e.k0s()()),2&t){const n=e.XpG(3);e.Y8G("ngClass",e.eq3(5,r_,n.isDocuments)),e.R7$(2),e.JRh(e.bMT(3,3,"teacherMediaFolder")),e.R7$(3),e.Y8G("ngForOf",n.folderNames)}}function rh(t,o){if(1&t&&(e.j41(0,"mat-option",112),e.EFF(1),e.k0s()),2&t){const n=o.$implicit;e.Y8G("value",n.value),e.R7$(),e.SpI(" ",n.label," ")}}function lh(t,o){if(1&t&&(e.j41(0,"mat-form-field",113)(1,"mat-label",109),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.j41(4,"mat-select",114),e.DNE(
35,rh,2,2,"mat-option",111),e.k0s()()),2&t){const n=e.XpG(3);e.R7$(2),e.JRh(e.bMT(3,2,"teacherMediaCopyTo")),e.R7$(3),e.Y8G("ngForOf",n.courseList)}}function ch(t,o){if(1&t&&(e.j41(0,"div",115),e.EFF(1),e.k0s()),2&t){const n=e.XpG(3);e.R7$(),e.JRh(n.requestFormError)}}function mh(t,o){if(1&t){const n=e.RV6();e.j41(0,"form",87),e.bIt("ngSubmit",function(){e.eBV(n);const a=e.XpG(2);return e.Njj(a.editMedia(a.mediaForm))}),e.j41(1,"div",88)(2,"mat-form-field")(3,"mat-label"),e.EFF(4),e.nI1(5,"translate"),e.nI1(6,"titleCaseFirstWord"),e.k0s(),e.nrm(7,"input",89),e.DNE(8,z_,3,10,"span",90)(9,H_,2,1,"mat-error",9),e.k0s(),e.DNE(10,th,8,7,"mat-form-field",9)(11,ih,10,9,"mat-form-field",91)(12,ah,2,4,"app-file-upload",92)(13,sh,6,7,"mat-form-field",93)(14,lh,6,4,"mat-form-field",94),e.j41(15,"div")(16,"mat-checkbox",39)(17,"span"),e.EFF(18),e.nI1(19,"translate"),e.nI1(20,"titleCaseFirstWord"),e.nrm(21,"i",95),e.nI1(22,"translate"),e.k0s()()(),e.DNE(23,ch,2,1,"div",96),e.k0s(),e.j41(24,"div",97)(25,"div",98)(26,"button",99),e.bIt("click",function(){e.eBV(n);const a=e.XpG(2);return e.Njj(a.closeModal())}),e.EFF(27),e.nI1(28,"translate"),e.nI1(29,"titleCaseFirstWord"),e.k0s(),e.j41(30,"button",100),e.EFF(31),e.nI1(32,"translate"),e.k0s()()()()}if(2&t){const n=e.XpG(2);e.Y8G("formGroup",n.mediaForm),e.R7$(4),e.JRh(e.bMT(6,17,e.bMT(5,15,"title"))),e.R7$(4),e.Y8G("ngIf",n.name),e.R7$(),e.Y8G("ngIf",n.name.invalid&&(n.name.dirty||n.name.touched)),e.R7$(),e.Y8G("ngIf",!n.isDocuments),e.R7$(),e.Y8G("ngIf",!n.isDocuments),e.R7$(),e.Y8G("ngIf",n.isDocuments),e.R7$(),e.Y8G("ngIf","edit"===n.requestState&&n.folderNames&&n.folderNames.length>1),e.R7$(),e.Y8G("ngIf","edit"===n.requestState&&n.courseList&&n.courseList.length>=1),e.R7$(4),e.SpI(" ",e.bMT(20,21,e.bMT(19,19,"active"))," "),e.R7$(3),e.FS9("matTooltip",e.bMT(22,23,"teacherMediaVisibilityForStudents")),e.R7$(2),e.Y8G("ngIf",n.requestFormError),e.R7$(4),e.SpI(" ",e.bMT(29,27,e.bMT(28,25,"cancel"))," "),e.R7$(3),e.Y8G("disabled",n.requestProcessing||"edit"===n.requestState&&""===n.mediaForm.value.name||n.mediaForm.invalid||n.mediaForm.pristine),e.R7$(),e.SpI(" ",e.bMT(32,29,"
3save")," ")}}function ph(t,o){if(1&t&&(e.j41(0,"div",115),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t){const n=e.XpG(3);e.R7$(),e.SpI(" ",e.bMT(2,1,n.requestFormError)," ")}}function dh(t,o){if(1&t){const n=e.RV6();e.qex(0),e.j41(1,"div",88)(2,"span"),e.EFF(3),e.nI1(4,"translate"),e.nI1(5,"titleCaseFirstWord"),e.j41(6,"strong"),e.EFF(7),e.k0s()(),e.DNE(8,ph,3,3,"div",96),e.k0s(),e.j41(9,"div",97)(10,"button",99),e.bIt("click",function(){e.eBV(n);const a=e.XpG(2);return e.Njj(a.closeModal())}),e.EFF(11),e.nI1(12,"translate"),e.nI1(13,"titleCaseFirstWord"),e.k0s(),e.j41(14,"button",116),e.bIt("click",function(){e.eBV(n);const a=e.XpG(2);return e.Njj(a.removeMedia())}),e.EFF(15),e.nI1(16,"translate"),e.nI1(17,"titleCaseFirstWord"),e.k0s()(),e.bVm()}if(2&t){const n=e.XpG(2);e.R7$(3),e.SpI(" ",e.bMT(5,8,e.bMT(4,6,"teacherMediaDeleteConfirmation"))," "),e.R7$(4),e.JRh(n.requestMediaBody.name||n.requestFolderBody.name),e.R7$(),e.Y8G("ngIf",n.requestFormError),e.R7$(3),e.SpI(" ",e.bMT(13,12,e.bMT(12,10,"cancel"))," "),e.R7$(3),e.Y8G("disabled",n.requestProcessing),e.R7$(),e.SpI(" ",e.bMT(17,16,e.bMT(16,14,"delete"))," ")}}function uh(t,o){if(1&t&&e.DNE(0,mh,33,31,"form",86)(1,dh,18,18,"ng-container",9),2&t){const n=e.XpG();e.Y8G("ngIf",n.modalOpen&&("edit"===n.requestState||"add"===n.requestState)),e.R7$(),e.Y8G("ngIf",n.modalOpen&&"remove"===n.requestState)}}let rn=(()=>{var t;class o{constructor(i,a,s,r,l,p,d,h,v,$){this.formBuilder=i,this.teacherService=a,this.deviceService=s,this.translateService=r,this.router=l,this.helperService=p,this.elRef=d,this.toastrService=h,this.titleCasePipe=v,this.dialogService=$,this.maxVisibleItems=3,this.isDesktop=this.deviceService.isDesktop(),this.contentAvailable=!1,this.editingFolder=!1,this.creatingFolder=!1,this.globalError=null,this.breadcrumbs=[],this.maximumAllowedLevels=2,this.mainFolderName=null,this.media=[],this.courseList=null,this.modalOpen=!1,this.folderNames=null,this.requestState="",this.requestProcessing=!1,this.requestFolderId=null,this.requestMoveToFolder=null,this.requestCopyToCourse=null,this.requestParentId=null,this.requestMaxDescriptionLength=300,this.requestMaxNameLength=255,this.requestFormError=null,this.requestFolderError=null,this.requestFolderBody={name:null,public:null},this.requestMediaBody={name:null,description:null,url:null,public:null},this.fileError={type:null},this.requestType="",this.pageIndex=0,this.files=[],this.linkList=[],this.courseId=null,this.folderList=[],this.allFolders=[],this.requestId=null,this.INITIAL_IMAGEDATA={name:"",path:""},this.fileData=this.INITIAL_IMAGEDATA,this.subs$=[],this.destroy$=new y.B}get name(){return this.mediaForm.get("name")}get description(){return this.mediaForm.get("description")}get url(){return this.mediaForm.get("url")}get public(){return this.mediaForm.get("public")}get file(){return this.mediaForm.controls.file}get folderName(){return this.folderForm.get("name")}get folderPublic(){return this.folderForm.get("public")}ngOnInit(){const i=this.teacherService.getCurrentCourse().subscribe(r=>{this.courseId=+r.id,this.mainFolderName=this.translateService.instant("mainFolder"),this.isDocuments="documents"===this.router.url.split("/")[3],this.type=this.isDocuments?"file":"link",this.assetType=this.isDocuments?"document":"weblink",this.load(),this.teacherService.setBackBtnText(this.isDocuments?"documents":"links")}),a=this.router.events.subscribe(r=>{"popstate"===r.navigationTrigger&&this.teacherService.setFullScreen(!1)}),s=this.teacherService.getBackBtnClicked().subscribe(r=>{r&&(this.handleBack(),this.teacherService.setBackBtnClicked(!1))});this.subs$.push(i,a,s)}setTeacherCourseListForDrowndown(){const i=this.teacherService.getCourses();i?this.createCoursesSelectList(i):this.teacherService.getTeacherCourses().pipe((0,R.T)(a=>{var s;return(null==a||null===(s=a.body)||void 0===s?void 0:s.data)||[]})).subscribe(a=>{this.createCoursesSelectList(a)})}createCoursesSelectList(i){this.courseList=i.reduce((a,{id:s,courseName:r,type:l})=>{const p={label:"".concat(r," (").concat(l,") (").concat(s,")"),value:+s};return+s===this.courseId?a:[...a,p]},[])}load(){this.teacherService.getTeacherFolders(this.courseId,this.type).pipe((0,R.T)(i=>{var a;return(null==i||null===(a=i.body)||void 0===a?void 0:a.data)||[]})).subscribe(i=>{if(i){this.allFolders=i;for(const a of this.allFolders)this.addParentIds(a,null);this.navigateFolder("rootFolder")}},({status:i})=>{403===i&&(this.requestFormError="teacherMediaErrorAccessDenied"),404===i&&(this.requestFormError="teacherMediaErrorInvalidCourseId")})}updateBreadcrumbs(i){let a=[];const s=r=>{let l=this.getFolderById(r);a.unshift({label:l.name,folderId:l.id}),l.parentId&&s(l.parentId)};s(i),this.breadcrumbs=a}getFolderContents(i){this.teacherService.getTeacherFolderContents(this.courseId,i,this.type).pipe((0,R.T)(a=>{var s;return null==a||null===(s=a.body)||void 0===s?void 0:s.data})).subscribe(({folders:a,links:s,files:r})=>{this.linkList=s.length?s:r,this.folderList=a.map(l=>(this.checkIfFolderExists(l.id)||(l=(0,g.A)((0,g.A)({},l),{},{parentId:this.requestFolderId||null,readonly:l.readonly||+l.courseId!==this.courseId}),this.requestFolderId?this.recursivelyAddFolder(this.allFolders,this.requestFolderId,l):(l.folders=[],this.allFolders=[...this.allFolders,l])),l)),this.requestParentId=i?this.getFolderById(i).parentId:null,this.setTableData(),this.requestFolderId?this.updateBreadcrumbs(i):this.breadcrumbs=[]})}setTableData(){this.media=[...this.folderList.map(s=>{const r=this.getFolderById(s.id);return(0,g.A)((0,g.A)({},s),{},{type:"document-folder",readonly:r?r.readonly:+s.courseId!==this.courseId})}),...this.linkList.map(s=>(0,g.A)((0,g.A)({},s),{},{type:"weblink",readonly:s.readonly||+s.courseId!==this.courseId}))],this.contentAvailable=!!this.media.length;const i=Math.ceil(this.media.length/this.maxVisibleItems);i-1<this.pageIndex&&i&&(this.pageIndex=this.pageIndex-1)}navigateFolder(i,a,s){window.scroll(0,0);const r="add"===i||!!a;switch(this.teacherService.setFullScreen(r),this.editingFolder=r,i){case"add":this.requestState=i,this.requestParentId=a,this.createFolderForm(),this.creatingFolder=!0;break;case"edit":this.creatingFolder=!1,this.requestState=i,this.requestFolderId=a,this.createFolderForm(
3a),s&&this.requestFolderId!==this.requestParentId&&this.folderForm.patchValue({name:s}),this.getFolderContents(a),this.isReadonly=this.isFolderReadOnly(a),this.pageIndex=0;break;case"navigateToParent":this.requestFolderId=this.requestParentId,this.folderNavigationActions(a);break;case"navigateToFolderId":this.requestFolderId=a,this.folderNavigationActions(a);break;case"rootFolder":this.creatingFolder=!1,this.requestFolderId=null,this.getFolderContents(this.requestFolderId),this.isReadonly=!1,this.requestState=null}}folderNavigationActions(i){this.creatingFolder=!1,this.requestState="edit",i&&this.createFolderForm(this.requestFolderId),this.getFolderContents(this.requestFolderId),this.isReadonly=this.isFolderReadOnly(i),this.pageIndex=0}isFolderReadOnly(i){return i&&this.getFolderById(i).readonly||!1}openMediaModal(i,a,s){s&&s.hasOwnProperty("path")?this.fileData=s.path:this.files=[],this.requestType=i,this.requestState=a,this.modalOpen=!0,this.requestId=s&&s.id,this.createMediaForm(s&&s.id);let r="";switch(a){case"add":r=this.isDocuments?"teacherDocumentsAdd":"teacherMediaLinkAdd";break;case"edit":r=this.isDocuments?"teacherDocumentsEdit":"teacherMediaLinkEdit";break;case"remove":r="document-folder"===i?"teacherMediaFolderRemove":this.isDocuments?"teacherDocumentsRemove":"teacherMediaLinkRemove"}this.dialogRef=this.dialogService.open(oe.m,{data:{header:r,template:this.mediaModal},maxHeight:"var(--size-100vh)",panelClass:["material-modal","col-12","remove"===a?"col-lg-4":"col-lg-6"],autoFocus:!1})}closeFolderEditor(){this.editingFolder=!1}closeModal(){var i;null===(i=this.dialogRef)||void 0===i||i.close(),this.modalOpen=!1,this.requestType=null,this.requestState=null,this.requestMoveToFolder=null,this.requestCopyToCourse=null,this.requestProcessing=!1,this.requestFolderError=null,this.requestFormError=null,this.fileData=this.INITIAL_IMAGEDATA}createFolderForm(i){this.requestFolderError=null;const a=i&&this.getFolderById(i)||null;this.folderForm=this.formBuilder.group(a?{name:[a.name,[c.k0.required,
3c.k0.maxLength(this.requestMaxNameLength)]],public:[+a.public]}:{name:["",[c.k0.required,c.k0.maxLength(this.requestMaxNameLength)]],public:[1]}),this.requestFolderBody=this.folderForm.value}createMediaForm(i){this.requestFormError=null,this.requestMoveToFolder=+this.requestFolderId,this.requestCopyToCourse=this.courseId;const a=i&&this.media.find(r=>r.id===i)||null;!this.courseList&&a&&this.setTeacherCourseListForDrowndown(),this.folderNames=[{value:0,label:this.mainFolderName},...this.flattenFolders().filter(r=>!r.readonly).map(r=>({label:r.name,value:+r.id}))],a?(this.mediaForm=this.formBuilder.group({name:[a.name||"",[c.k0.required,c.k0.maxLength(this.requestMaxNameLength)]],public:[a.public],description:[a.description||"",c.k0.maxLength(this.requestMaxDescriptionLength)],url:[a.url||"",c.k0.required],folder:[this.requestMoveToFolder||0],copyTo:[this.requestCopyToCourse]}),this.isDocuments&&(this.files=[a.path],this.mediaForm.addControl("file",new c.hs(a.path)),delete this.mediaForm.controls.url,this.fileData=a.path)):(this.mediaForm=this.formBuilder.group({name:["",[c.k0.required,
3c.k0.maxLength(this.requestMaxNameLength)]],public:[1],description:["",c.k0.maxLength(this.requestMaxDescriptionLength)],url:["",c.k0.required]}),this.isDocuments&&this.mediaForm.addControl("file",new c.hs(""))),this.requestMediaBody={name:this.mediaForm.value.name,description:this.mediaForm.value.description,url:this.mediaForm.value.url,public:this.mediaForm.value.public}}editMedia(i){this.requestProcessing=!0,this.requestMediaBody=i.value,0===i.value.folder&&(i.value.folder=null);const{copyTo:a}=i.value;if(this.isDocuments){var s;const{name:r,public:l,folder:p}=i.value,[d]=this.uploader.filesToUpload.getValue();let h=null!=d&&d.file?d.file:d;const v=new FormData;let $=this.courseId;h instanceof File&&v.append("file[]",h),v.append("courseId",this.courseId),v.append("folderId",null!==(s=this.requestFolderId)&&void 0!==s?s:null),v.append("public",+l),v.append("name",r),"edit"===this.requestState&&this.requestId&&(v.append("id",this.requestId),p&&p!==this.requestFolderId&&v.set("folderId",p),p||v.set("folderId",null)),this.teacherService.postDocument(v,$).subscribe(()=>{a&&a!==this.courseId?this.handleCopy(a):this.onRequestSuccess(this.requestType,this.requestState)},({status:k})=>{this.onRequestError(k,"modalForm")})}else"weblink"===this.requestType&&"add"===this.requestState?(this.requestMediaBody=(0,g.A)((0,g.A)({},this.requestMediaBody),{},{folderId:this.requestFolderId}),this.teacherService.addTeacherMedia(this.courseId,this.requestMediaBody).subscribe(()=>{this.onRequestSuccess(this.requestType,this.requestState)},({status:r})=>{this.onRequestError(r,"modalForm")})):(this.requestMediaBody=(0,g.A)((0,g.A)({},this.requestMediaBody),{},{folderId:i.value.folder}),this.teacherService.patchTeacherMedia(this.courseId,this.requestId,this.requestMediaBody).subscribe(()=>{a&&a!==this.courseId?this.handleCopy(a):this.onRequestSuccess(this.requestType,this.requestState)},({status:r})=>{this.onRequestError(r,"modalForm")}))}handleCopy(i){this.teacherService.copyRecordToCourse(this.assetType,{destination:i,id:this.requestId}).pipe((0,D.W)(a=>(0,x.of)(a))).subscribe(a=>{a.status>300?this.handleCopyFail(a.error):this.onRequestSuccess(this.requestType,"copy")})}handleCopyFail({fields:i=null,message:a}){this.requestFormError=i?this.translateService.instant(i.hasOwnProperty("id")?"copyFailId":"copyFailDestination"):a,this.requestProcessing=!1;const s=this.elRef.nativeElement.querySelector("#teacher-media-modal");s.classList.add("animateBounce"),setTimeout(()=>{s.classList.remove("animateBounce")},600)}removeMedia(){this.requestProcessing=!0,"weblink"===this.requestType?this.isDocuments?this.teacherService.deleteDocument(this.courseId,this.requestId).subscribe(()=>{this.onRequestSuccess(this.requestType,this.requestState)},({status:i})=>{this.onRequestError(i,"modalForm")}):this.teacherService.removeTeacherMedia(this.courseId,this.requestId).subscribe(()=>{this.onRequestSuccess(this.requestType,this.requestState)},({status:i})=>{this.onRequestError(i,"modalForm")}):this.teacherService.removeTeacherFolder(this.courseId,this.requestId).subscribe(()=>{this.removeFolderFromAllFolders(this.requestId),this.onRequestSuccess(this.requestType,this.requestState)},({status:i})=>{this.onRequestError(i,"modalForm")})}editFolder(i,a){this.requestProcessing=!0,this.requestFolderBody=a.value,"add"===i&&(this.requestFolderBody=(0,g.A)((0,g.A)({},this.requestFolderBody),{}
3,{type:this.type,parentId:this.requestFolderId}),this.teacherService.addTeacherFolder(this.courseId,this.requestFolderBody).pipe((0,R.T)(s=>{var r;return null==s||null===(r=s.body)||void 0===r?void 0:r.data})).subscribe(s=>{this.addFolderToAllFolders(s),this.onRequestSuccess("document-folder",i)},({status:s})=>{this.onRequestError(s,"folderForm")})),"edit"===i&&this.teacherService.patchTeacherFolder(this.courseId,this.requestFolderId,this.requestFolderBody).subscribe(()=>{this.updateFolderInAllFolders(),this.onRequestSuccess("document-folder",i)},({status:s})=>{this.onRequestError(s,"folderForm")})}onRequestSuccess(i,a){this.closeModal();let r,s=this.titleCasePipe.transform(this.translateService.instant("document-folder"===i?"folder":"link"===this.type?"link":"document"));if("add"===a&&(r="dataAddedSuccess"),"edit"===a&&(r="dataUpdatedSuccess"),"copy"===a&&(s+=" ".concat(this.translateService.instant("dataCopySuccess")," id: ").concat(this.mediaForm.get("copyTo").value)),"remove"===a&&(r="removed"),"document-folder"===i){for(const l of this.allFolders)this.addParentIds(l,null);("add"===a||"edit"===a)&&(this.folderForm.markAsPristine(),this.navigateFolder("edit",this.requestFolderId,this.folderName.value))}r&&(s+=" ".concat(this.translateService.instant(r))),this.toastrService.success(s),this.getFolderContents(this.requestFolderId)}onRequestError(i,a){if(this.requestProcessing=!1,400===i){const r=this.translateService.instant("teacherMediaError");return void("modalForm"===a?this.requestFormError=r:this.requestFolderError=r)}if(403===i){const r=this.translateService.instant("teacherMediaErrorAccessDenied");return void("modalForm"===a?this.requestFormError=r:this.requestFolderError=r)}if(404===i)return void("modalForm"===a?this.requestFormError=this.translateService.instant("teacherMediaErrorInvalidWeblinkId"):this.requestFolderError=this.translateService.instant("teacherMediaErrorInvalidFolderId"));const s=this.translateService.instant("somethingWentWrongTryAgain");"modalForm"===a?this.requestFormError=s:this.requestFolderError=s}addParentIds(i,a){i.hasOwnProperty("parentId")||(i.folders.length&&i.folders.forEach(s=>this.addParentIds(s,i.id)),i.parentId=a)}getFolderById(i){return this.allFolders?this.flattenFolders().find(s=>+s.id==+i):void 0}flattenFolders(){return null==this?void 0:this.allFolders.reduce((i,a)=>(a.folders&&a.folders.length&&(i=[...i,...a.folders]),[...i,a]),[])}addFolderToAllFolders(i){const{courseId:a,id:s,name:r,parentId:l,public:p,type:d}=i,h={courseId:a,id:s,name:r,public:+p,folders:[],type:d,dateCreated:(0,N.I1)().format(P.x.misc.slashesYearDate)};if(l){const v=this.recursivelyAddFolder(this.allFolders,+l,i);this.allFolders=v}else{const v=[...this.allFolders,h];this.allFolders=v}}updateFolderInAllFolders(){this.allFolders=this.allFolders.map(i=>{const{name:a,public:s}=this.folderForm.value;if(+i.id==+this.requestFolderId)return(0,g.A)((0,g.A)({},i),{},{name:a,public:s});if(i.folders&&i.folders.length){const r=i.folders.map(l=>+l.id==+this.requestFolderId?(0,g.A)((0,g.A)({},l),{},{name:a,public:s}):l);return i.folders=r,i}return i})}checkIfFolderExists(i){return this.flattenFolders().some(a=>+a.id==+i)}recursivelyAddFolder(i,a,s){return i.map(r=>(r.folders&&r.folders.length&&(r.folders=this.recursivelyAddFolder(r.folders,+a,s)),+r.id===a&&(r.folders=[...r.folders,s]),r))}removeFolderFromAllFolders(i){this.allFolders=this.recursivelyRemoveFolder(this.allFolders,+i)}recursivelyRemoveFolder(i,a){return i.map(s=>(0,g.A)({},s)).filter(s=>(s.folders&&s.folders.length&&(s.folders=this.recursivelyRemoveFolder(s.folders,+a)),+s.id!==a))}onFileSelect(i){i?(this.mediaForm.markAsDirty(),this.documentUploadFormPatch()):(this.mediaForm.markAsPristine(),this.mediaForm.controls.description.patchValue(!1),this.mediaForm.controls.url.patchValue(!1),!this.requestFolderId&&delete this.mediaForm.controls.folderId)}documentUploadFormPatch(){var i;this.mediaForm.controls.description.patchValue(!0),null===(i=this.mediaForm.controls.url)||void 0===i||i.patchValue(!0),!this.requestFolderId&&delete this.mediaForm.controls.folderId}documentUploadFormReset(){this.mediaForm.controls.description.patchValue(!1),this.mediaForm.controls.url.patchValue(!1)}handleBack(){this.navigateFolder("rootFolder")}ngOnDestroy(){this.subs$.length&&this.subs$.forEach(i=>
3i.unsubscribe()),this.destroy$.next(),this.destroy$.complete(),this.teacherService.setFullScreen(!1)}pageChange(i){const{pageIndex:a}=i||{};"number"==typeof a&&(this.pageIndex=a)}}return(t=o).\u0275fac=function(i){return new(i||t)(e.rXU(c.ze),e.rXU(S.O),e.rXU(ge.Kg),e.rXU(m.c$),e.rXU(O.Ix),e.rXU(Ee.w),e.rXU(e.aKT),e.rXU(w.tw),e.rXU(u.PV),e.rXU(B.bZ))},t.\u0275cmp=e.VBU({type:t,selectors:[["app-media-weblinks"]],viewQuery:function(i,a){if(1&i&&(e.GBs(e_,7),e.GBs(t_,5)),2&i){let s;e.mGM(s=e.lsd())&&(a.mediaModal=s.first),e.mGM(s=e.lsd())&&(a.uploader=s.first)}},features:[e.Jv_([u.PV])],decls:24,vars:21,consts:[["paginator",""],["mediaModal",""],["noDocs",""],["folder",""],["uploader",""],[1,"row"],[1,"col-12"],[1,"row","py-3","mb-4","background-color"],[1,"mb-0","text-white"],[4,"ngIf"],[1,"row","pb-2",3,"ngClass"],[1,"col-12",3,"ngClass"],[1,"card-container"],[4,"ngFor","ngForOf"],["showFirstLastButtons","",3,"page","hidePageSize","pageSize","length","pageIndex"],[1,"row","pb-3"],[1,"col-12","ng-star-inserted"],[1,"breadcrumbs-container","pb-2","pt-2"],[1,"button-reset","folder-breadcrumb",3,"click","dynamicPosition","matTooltip"],[1,"pointer-events-none","breadcrumb-flex"],[1,"fas","fa-home","fs-24","breadcrumb-icon"],["class","button-reset folder-breadcrumb",3,"dynamicPosition","matTooltip","click",4,"ngIf"],["class","button-reset folder-breadcrumb active",3,"dynamicPosition","matTooltip",4,"ngIf"],[1,"fas","fa-angle-left","breadcrumb-arrow-back"],["class","fas fa-folder fs-24 breadcrumb-icon",4,"ngIf"],[1,"breadcrumb-label"],[1,"fas","fa-folder","fs-24","breadcrumb-icon"],[1,"button-reset","folder-breadcrumb","active",3,"dynamicPosition","matTooltip"],[1,"fas","fa-angle-left","accent-color","breadcrumb-arrow-back"],["class","fas fa-folder-open fs-24 accent-color breadcrumb-icon",4,"ngIf"],[1,"breadcrumb-label","text-color"],[1,"fas","fa-folder-open","fs-24","accent-color","breadcrumb-icon"],[1,"text-center"],[1,"fas","fa-exclamation-circle","mr-2"],["class","row mb-4",4,"ngIf"],[3,"formGroup"],["appearance","fill",1,"col-12"],["matInput","","formControlName","name","matValidate",""],["class","text-right",3,"ngClass",4,"ngIf"],["formControlName","public"],[1,"ml-1","mr-1","pdfIconTable","text-dark","fas","fa-info-circle",3,"matTooltip"],[1,"col-12","p-0"],[1,"text-right",3,"ngClass"],[1,"row","mb-4"],["class","col-12 folder-actions",4,"ngIf"],[1,"col-12","folder-actions"],[1,"folder-actions_cta","button-container","justify-content-end"],["mat-raised-button","","color","primary",3,"click","disabled"],["class","text-center",4,"ngIf"],[4,"ngIf","ngIfElse"],["class","card media-card",3,"ngClass",4,"ngIf"],[1,"card","media-card",3,"ngClass"],[1,"media-card-body"],[1,"media-card-header","mb-3"],[1,"date"],[1,"public",3,"ngClass"],[1,"media-card-button-container","button-container","justify-content-end"],["type","button","mat-raised-button","","color","accent-inverted",3,"click",4,"ngIf"],["type","button","mat-raised-button","","color","accent","class","relative",3,"click",4,"ngIf"],["mat-raised-button","","color","accent","class","relative",3,"click",4,"ngIf"],["target","_blank","rel","noopener",1,"media-link","media-card-title",3,"href"],["class","fas mr-3 fa-link",4,"ngIf"],[3,"ngSwitch",4,"ngIf"],[1,"fas","mr-3","fa-link"],[3,"ngSwitch"],["class","fas mr-3 fa-file-pdf",4,"ngSwitchCase"],["class","fas mr-3 fa-file-word",4,"ngSwitchCase"],["class","fas mr-3 fa-file-excel",4,"ngSwitchCase"],["class","fas mr-3 fa-image",4,"ngSwitchDefault"],[1,"fas","mr-3","fa-file-pdf"],[1,"fas","mr-3","fa-file-word"],[1,"fas","mr-3","fa-file-excel"],[1,"fas","mr-3","fa-image"],[1,"media-card-title"],[1,"fas","fa-folder-open","mr-3"],[1,"media-description","mb-4"],["type","button","mat-raised-button","","color","accent-inverted",3,"click"],["type","button","mat-raised-button","","color","accent",1,"relative",3,"click"],["mat-raised-button","","color","accent",1,"relative",3,"click"],[1,"media-card-headteacher","text-white","font-italic","text-center","bg-success"],[1,"col-12","button-container","justify-content-end"],["type","button","mat-raised-button","","color","main-inverted","role","button",3,"click"],["type","button","mat-raised-button","","color","main",3,"disabled","click",4,"ngIf"],[1,"col-12","text-right"],[1,"text-danger","mb-3"],["type","button","mat-raised-button","","color","main",3,"click","disabled"],["id","teacher-media-modal",3,"formGroup","ngSubmit",4,"ngIf"],["id","teacher-media-modal",3,"ngSubmit","formGroup"],["mat-dialog-content",""],["matInput","","type","text","formControlName","name","required",""],["matSuffix","","class","text-right m-0",3,"ngClass",4,"ngIf"],["class","mb-4",4,"ngIf"],[3,"uploadIcon","withFab","canRemove","files","fileSelected",4,"ngIf"],["appearance","fill",3,"ngClass",4,"ngIf"],["appearance","fill",4,"ngIf"],[1,"fa-solid","fa-circle-info","ml-1","pdfIconTable","text-dark",3,"matTooltip"],["class","form-text text-danger",4,"ngIf"],["mat-dialog-actions","","align","end"],[1,"text-right"],["type","button","mat-raised-button","","color","primary-inverted",3,"click"],["type","button","type","submit","mat-raised-button","","color","primary",3,"disabled"],["matSuffix","",1,"text-right","m-0",3,"ngClass"],["type","text","formControlName","description","id","formMediaDescription","rows","4","matInput","","required",""],["matSuffix","",3,"ngClass",4,"ngIf"],["matSuffix","",3,"ngClass"],[1,"mb-4"],["type","text","formControlName","url","id","formMediaUrl","matInput","","required",""],[3,"fileSelected","uploadIcon","withFab","canRemove","files"],["appearance","fill",3,"ngClass"],["appRemoveAriaOwns",""],["formControlName","folder"],["class","disable-checkbox",3,"value",4,"ngFor","ngForOf"],[1,"disable-checkbox",3,"value"],["appearance","fill"],["formControlName","copyTo"],[1,"form-text","text-danger"],["type","button","mat-raised-button","","color","primary",3,"click","disabled"]],template:function(i,a){if(1&i){const s=e.RV6();e.j41(0,"div",5)(1,"div",6)(2,"div",7)(3,"div",6)(4,"h5",8),e.EFF(5),e.nI1(6,"translate"),e.nI1(7,"titleCaseFirstWord"),e.k0s()()()()(),e.DNE(8,u_,10,8,"
3ng-container",9)(9,__,5,3,"ng-container",9)(10,C_,4,3,"ng-container",9),e.j41(11,"div",5)(12,"div",6),e.DNE(13,y_,4,3,"ng-container",9),e.j41(14,"div",10)(15,"div",11)(16,"div",12),e.DNE(17,q_,2,1,"ng-container",13),e.k0s(),e.j41(18,"mat-paginator",14,0),e.bIt("page",function(l){return e.eBV(s),e.Njj(a.pageChange(l))}),e.k0s()()()()(),e.j41(20,"div",15),e.DNE(21,Q_,8,7,"ng-container",9),e.k0s(),e.DNE(22,uh,2,2,"ng-template",null,1,e.C5r)}2&i&&(e.R7$(5),e.SpI(" ",e.bMT(7,15,e.bMT(6,13,a.editingFolder?"add"===a.requestState?"teacherMediaAddFolder":"teacherMediaEditingFolder":a.isDocuments?"documents":"links"))," "),e.R7$(3),e.Y8G("ngIf",a.editingFolder),e.R7$(),e.Y8G("ngIf",a.globalError),e.R7$(),e.Y8G("ngIf",!a.globalError),e.R7$(3),e.Y8G("ngIf",!a.contentAvailable||a.isReadonly),e.R7$(),e.Y8G("ngClass",e.eq3(17,n_,!a.contentAvailable||"add"===a.requestState&&"weblink"!==a.requestType)),e.R7$(),e.Y8G("ngClass",e.eq3(19,i_,a.isDesktop)),e.R7$(2),e.Y8G("ngForOf",a.media),e.R7$(),e.Y8G("hidePageSize",!0)("pageSize",a.maxVisibleItems)("length",null==a.media?null:a.media.length)("pageIndex",a.pageIndex),e.R7$(3),e.Y8G("ngIf",a.editingFolder))},dependencies:[u.YU,u.Sq,u.bT,u.ux,u.e1,u.fG,c.qT,c.me,c.BC,c.cb,c.YS,c.j4,c.JD,ve.iy,E.$z,ne.fg,A.rl,A.nJ,A.MV,A.TL,A.yw,xe.VO,Ie.wT,Re.oV,B.E7,B.Yi,Xe.So,ze.P,Be.K,m.D9,je.O,Fe.p],styles:['[_nghost-%COMP%] .btn[_ngcontent-%COMP%]{border-radius:var(--border-radius-xxs)}[_nghost-%COMP%] i.fa-exclamation-circle[_ngcontent-%COMP%], [_nghost-%COMP%] i.fa-info-circle[_ngcontent-%COMP%]{color:var(--color-text)!important}.pointer-events-none[_ngcontent-%COMP%]{pointer-events:none}.button-reset[_ngcontent-%COMP%]{outline:var(--outline-none);border:var(--border-style-none);background:none}.btn[_ngcontent-%COMP%]:not(.btn:hover, .btn[_ngcontent-%COMP%]:focus).button-reset{box-shadow:var(--shadow-none)}#teacher-media-modal[_ngcontent-%COMP%] #formMediaDescription[_ngcontent-%COMP%]{resize:none}.media-card-header[_ngcontent-%COMP%], .media-card-body[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{color:var(--color-text)}#teacher-media-modal[_ngcontent-%COMP%] .form-hint[_ngcontent-%COMP%]{color:var(--color-tint-11);font-size:var(--font-size-81)}.hint-sm[_ngcontent-%COMP%]{display:inline}.hint-md[_ngcontent-%COMP%], .hidden[_ngcontent-%COMP%]{display:none}.card-container[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr;gap:var(--space-0)}.media-card[_ngcontent-%COMP%]{box-shadow:var(--shadow-md);border:var(--border-style-none);margin:var(--space-1rem) var(--space-auto);width:var(--size-100-percent)}.media-card-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.media-card-body[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:var(--size-100-percent);padding:var(--space-1rem)}.media-card[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:var(--font-size-162);color:var(--color-text)}.media-card[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{display:inline-block;font-size:var(--font-size-162);font-weight:var(--font-weight-bold)}.media-description[_ngcontent-%COMP%]{max-height:var(--size-69px);line-height:var(--font-size-143);overflow:hidden;text-overflow:ellipsis}.media-card-button-container[_ngcontent-%COMP%]{margin-top:var(--space-auto)}.media-card[_ngcontent-%COMP%] .public[_ngcontent-%COMP%]{font-weight:var(--font-weight-bold)}.media-card-headteacher[_ngcontent-%COMP%]{padding:var(--space-2px) var(--space-0)}.breadcrumbs-container[_ngcontent-%COMP%]{overflow-x:auto;display:flex}.folder-breadcrumb[_ngcontent-%COMP%]{position:relative;color:var(--color-text);white-space:nowrap;padding:var(--space-0_5rem);margin:var(--space-0) var(--space-1rem) var(--space-0) var(--space-0)}.breadcrumb-flex[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center}.folder-breadcrumb[_ngcontent-%COMP%]:before{content:"";pointer-events:none;position:absolute;top:var(--space-0);left:var(--space-0);bottom:var(--space-0);right:var(--space-0);border-radius:var(--border-radius-sm);background:var(--color-text);opacity:var(--opacity-0);transition:var(--transition-property-opacity) var(--duration-300) var(--behavior-function-ease);z-index:var(--z-index-layer-negative-1)}.folder-breadcrumb[_ngcontent-%COMP%]:not(.folder-breadcrumb.active):hover:before, .folder-breadcrumb[_ngcontent-%COMP%]:not(.folder-breadcrumb.active):focus:before{opacity:var(--opacity-10)}.folder-breadcrumb[_ngcontent-%COMP%] .breadcrumb-arrow-back[_ngcontent-%COMP%]{margin-right:var(--space-0_5rem)}.breadcrumb-icon[_ngcontent-%COMP%]{padding:var(--space-0) var(--space-0_5rem) var(--space-0) var(--space-0)}.breadcrumb-label[_ngcontent-%COMP%]{cursor:pointer;max-width:var(--size-160px);text-overflow:ellipsis;overflow:hidden;display:inline-block}.form-check-label[_ngcontent-%COMP%]{font-weight:var(--font-weight-bold)}@media (min-width: 768px){#teacher-media-modal[_ngcontent-%COMP%] .modal
3-dialog[_ngcontent-%COMP%]{max-width:var(--size-teacher-media-dialog)}.hint-sm[_ngcontent-%COMP%]{display:none}.hint-md[_ngcontent-%COMP%]{display:inline}}@media (min-width: 992px){.card-container[_ngcontent-%COMP%]{grid-template-columns:1fr 1fr 1fr;gap:var(--space-2rem)}}.file-path-wrapper[_ngcontent-%COMP%]{flex-direction:column}.file-error[_ngcontent-%COMP%]{top:var(--space-60px);padding-left:var(--space-77px)}.extra-margin[_ngcontent-%COMP%]{margin-left:var(--space-10px);margin-right:var(--space-10px)}.folder-actions[_ngcontent-%COMP%]{width:var(--size-100-percent);display:flex;flex-direction:row;justify-content:flex-end}.folder-actions_cta[_ngcontent-%COMP%]{align-self:flex-end}.text-area_error[_ngcontent-%COMP%] > .error-message[_ngcontent-%COMP%]{top:var(--space-0)!important}.animateBounce[_ngcontent-%COMP%]{animation-duration:var(--duration-500);animation-name:bounce}[_nghost-%COMP%] .mat-mdc-paginator[_ngcontent-%COMP%]{border:var(--border-style-none)!important}\n\n/*# sourceMappingURL=media-weblinks.component.css.map*/']}),o})();var bt=f(975);const _h=["tutorialModal"],hh=t=>({hidden:t}),fh=t=>({"overflow-visible":t}),gh=t=>({"text-success":t}),ln=t=>({"text-danger":t}),cn=(t,o)=>({left:t,right:o});function vh(t,o){1&t&&(e.j41(0,"p",16),e.nrm(1,"i",17),e.EFF(2),e.nI1(3,"translate"),e.nI1(4,"titleCaseFirstWord"),e.k0s()),2&t&&(e.R7$(2),e.SpI(" ",e.bMT(4,3,e.bMT(3,1,"teacherMediaNoTutorials")),""))}function bh(t,o){if(1&t&&(e.qex(0),e.DNE(1,vh,5,5,"p",15),e.bVm()),2&t){const n=e.XpG();e.R7$(),e.Y8G("ngIf",!n.contentAvailable)}}function Th(t,o){if(1&t&&(e.qex(0),e.j41(1,"div",26),e.nrm(2,"app-embedded-video",27),e.k0s(),e.bVm()),2&t){const n=e.XpG(2).$implicit;e.R7$(2),e.Y8G("video",n.absoluteEmbedUrl)}}function Ch(t,o){if(1&t&&(e.qex(0),e.j41(1,"p",28),e.EFF(2),e.k0s(),e.bVm()),2&t){const n=e.XpG(2).$implicit;e.R7$(2),e.SpI(" ",n.description," ")}}function xh(t,o){if(1&t){const n=e.RV6();e.j41(0,"div",29)(1,"button",30),e.bIt("click",function(){e.eBV(n);const a=e.XpG(2).$implicit,s=e.XpG();return e.Njj(s.openTutorialModal("remove",a.id))}),e.EFF(2),e.nI1(3,"translate"),e.nI1(4,"titleCaseFirstWord"),e.k0s(),e.j41(5,"button",31),e.bIt("click",function(){e.eBV(n);const a=e.XpG(2).$implicit,s=e.XpG();return e.Njj(s.openTutorialModal("edit",a.id))}),e.EFF(6),e.nI1(7,"translate"),e.nI1(8,"titleCaseFirstWord"),e.k0s()()}2&t&&(e.R7$(2),e.JRh(e.bMT(4,4,e.bMT(3,2,"delete"))),e.R7$(4),e.SpI(" ",e.bMT(8,8,e.bMT(7,6,"edit"))," "))}function Ih(t,o){1&t&&(e.qex(0),e.j41(1,"div",32),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.bVm()),2&t&&(e.R7$(2),e.SpI(" ",e.bMT(3,1,"teacherMediaAddedByHeadTeacher")," "))}function Rh(t,o){if(1&t&&(e.j41(0,"div",19),e.DNE(1,Th,3,1,"ng-container",9),e.j41(2,"div",20)(3,"div",21)(4,"span",22),e.EFF(5),e.nI1(6,"dateformat"),e.k0s(),e.j41(7,"span",23),e.EFF(8),e.nI1(9,"translate"),e.nI1(10,"titlecase"),e.k0s()(),e.j41(11,"a",24)(12,"h4"),e.EFF(13),e.k0s()(),e.DNE(14,Ch,3,1,"ng-container",9)(15,xh,9,10,"div",25),e.k0s(),e.DNE(16,Ih,4,3,"ng-container",9),e.k0s()),2&t){const n=e.XpG().$implicit;e.R7$(),e.Y8G("ngIf",n.url),e.R7$(4),e.SpI(" ",e.bMT(6,9,n.date)," "),e.R7$(2),e.Y8G("ngClass",e.eq3(15,gh,"1"===n.public)),e.R7$(),e.SpI(" ",e.bMT(10,13,e.bMT(9,11,"1"===n.public?"active":"private"))," "),e.R7$(3),e.FS9("href",n.url,e.B4B),e.R7$(2),e.JRh(n.title),e.R7$(),e.Y8G("ngIf",n.description),e.R7$(),e.Y8G("ngIf",!n.readonly),e.R7$(),e.Y8G("ngIf",n.readonly)}}function Fh(t,o){if(1&t&&(e.qex(0),e.DNE(1,Rh,17,17,"div",18),e.bVm()),2&t){const n=o.index,i=e.XpG();e.R7$(),e.Y8G("ngIf",n>=i.pageIndex*i.maxVisibleItems&&n<(i.pageIndex+1)*i.maxVisibleItems)}}function kh(t,o){if(1&t&&(e.j41(0,"span",46),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t){const n=e.XpG(3);e.Y8G("ngClass",e.eq3(5,ln,n.tutorialForm.get("title").value.length>n.requestMaxTitleLength)),e.R7$(),e.SpI(" ",e.i5U(2,2,"typography.slash",e.l_i(7,cn,n.tutorialForm.get("title").value.length,n.requestMaxTitleLength))," ")}}function yh(t,o){1&t&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"teacherMediaFormInputTitle")," "))}function Eh(t,o){if(1&t&&(e.j41(0,"mat-error"),e.DNE(1,yh,3,3,"span",9),e.k0s()),2&t){const n=e.XpG(3);e.R7$(),e.Y8G("ngIf",n.title.hasError("required"))}}function Sh(t,o){if(1&t&&(e.j41(0,"span",49),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t){const n=e.XpG(4);e.Y8G("ngClass",e.eq3(5,ln,n.tutorialForm.get("description").value.length>n.requestMaxDescriptionLength)),e.R7$(),e.SpI(" ",e.i5U(2,2,"typography.slash",e.l_i(7,cn,n.tutorialForm.get("description").value.length,n.requestMaxDescriptionLength))," ")}}function $h(t,o){1&t&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"teacherMediaFormInputDescription")," "))}function Mh(t,o){if(1&t&&(e.j41(0,"mat-error"),e.DNE(1,$h,3,3,"span",9),e.k0s()),2&t){const n=e.XpG(4);e.R7$(),e.Y8G("ngIf",n.description.hasError("required"))}}function wh(t,o){if(1&t&&(e.j41(0,"mat-form-field")(1,"mat-label"),e.EFF(2),e.nI1(3,"translate"),e.nI1(4,"titleCaseFirstWord"),e.k0s(),e.nrm(5,"textarea",47),e.DNE(6,Sh,3,10,"span",48)(7,Mh,2,1,"mat-error",9),e.k0s()),2&t){const n=e.XpG(3);e.R7$(2),e.JRh(e.bMT(4,5,e.bMT(3,3,"teacherMediaDescription"))),e.R7$(4),e.Y8G("ngIf",n.description),e.R7$(),e.Y8G("ngIf",n.description.invalid&&(n.description.dirty||n.description.touched))}}function jh(t,o){1&t&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"teacherMediaFormInputUrl")," "))}function Gh(t,o){1&t&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"teacherMediaFormTutorialSourceUrl")," "))}function Dh(t,o){1&t&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"teacherMediaFormTutorialInvalidVideo")," "))}function Oh(t,o){1&t&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"teacherMediaFormTutorialInvalidSourceUrl")," "))}function Ah(t,o){if(1&t&&(e.j41(0,"mat-error"),e.DNE(1,jh,3,3,"span",9)(2,Gh,3,3,"span",9)(3,Dh,3,3,"span",9)(4,Oh,3,3,"span",9),e.k0s()),2&t){const n=e.XpG(3);e.R7$(),e.Y8G("ngIf",n.url.hasError("required")),e.R7$(),e.Y8G("ngIf",n.url.hasError("invalidSource")&&""!==n.url.value),e.R7$(),e.Y8G("ngIf",n.url.hasError("invalidVideo")&&""!==n.url.value),e.R7$(),e.Y8G("ngIf",n.url.hasError("invalidUrl")&&""!==n.url.value)}}
3function Nh(t,o){if(1&t&&(e.j41(0,"mat-option",54),e.EFF(1),e.k0s()),2&t){const n=o.$implicit;e.Y8G("value",n.value),e.R7$(),e.SpI(" ",n.label," ")}}function Lh(t,o){if(1&t&&(e.j41(0,"mat-form-field",50)(1,"mat-label",51),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.j41(4,"mat-select",52),e.DNE(5,Nh,2,2,"mat-option",53),e.k0s()()),2&t){const n=e.XpG(3);e.R7$(2),e.JRh(e.bMT(3,2,"teacherMediaCopyTo")),e.R7$(3),e.Y8G("ngForOf",n.courseList)}}function Yh(t,o){if(1&t&&(e.j41(0,"div",55),e.EFF(1),e.k0s()),2&t){const n=e.XpG(3);e.R7$(),e.SpI(" ",n.requestError," ")}}function Vh(t,o){if(1&t){const n=e.RV6();e.j41(0,"form",34),e.bIt("ngSubmit",function(){e.eBV(n);const a=e.XpG(2);return e.Njj(a.editTutorial(a.tutorialForm))}),e.j41(1,"div",35)(2,"mat-form-field")(3,"mat-label"),e.EFF(4),e.nI1(5,"translate"),e.nI1(6,"titleCaseFirstWord"),e.k0s(),e.nrm(7,"input",36),e.DNE(8,kh,3,10,"span",37)(9,Eh,2,1,"mat-error",9),e.k0s(),e.DNE(10,wh,8,7,"mat-form-field",9),e.j41(11,"mat-form-field")(12,"mat-label"),e.EFF(13),e.nI1(14,"translate"),e.nI1(15,"titleCaseFirstWord"),e.k0s(),e.nrm(16,"input",38),e.DNE(17,Ah,5,4,"mat-error",9),e.j41(18,"mat-hint"),e.EFF(19),e.nI1(20,"translate"),e.k0s()(),e.DNE(21,Lh,6,4,"mat-form-field",39),e.j41(22,"div")(23,"mat-checkbox",40)(24,"span"),e.EFF(25),e.nI1(26,"translate"),e.nI1(27,"titleCaseFirstWord"),e.nrm(28,"i",41),e.nI1(29,"translate"),e.k0s()()(),e.DNE(30,Yh,2,1,"div",42),e.k0s(),e.j41(31,"div",43)(32,"button",44),e.bIt("click",function(){e.eBV(n);const a=e.XpG(2);return e.Njj(a.closeModal())}),e.EFF(33),e.nI1(34,"translate"),e.nI1(35,"titleCaseFirstWord"),e.k0s(),e.j41(36,"button",45),e.EFF(37),e.nI1(38,"translate"),e.nI1(39,"titleCaseFirstWord"),e.k0s()()()}if(2&t){const n=e.XpG(2);e.Y8G("formGroup",n.tutorialForm),e.R7$(4),e.JRh(e.bMT(6,17,e.bMT(5,15,"title"))),e.R7$(4),e.Y8G("ngIf",n.title),e.R7$(),e.Y8G("ngIf",n.title.invalid&&(n.title.dirty||n.title.touched)),e.R7$(),e.Y8G("ngIf",!n.isDocuments),e.R7$(3),e.JRh(e.bMT(15,21,e.bMT(14,19,"teacherMediaVideo"))),e.R7$(4),e.Y8G("ngIf",n.url.invalid&&(n.url.dirty||n.url.touched)),e.R7$(2),e.JRh(e.bMT(20,23,"teacherMediaHint")),e.R7$(2),e.Y8G("ngIf","edit"===n.requestState&&n.courseList&&n.courseList.length),e.R7$(4),e.SpI(" ",e.bMT(27,27,e.bMT(26,25,"active"))," "),e.R7$(3),e.FS9("matTooltip",e.bMT(29,29,"teacherMediaVisibilityForStudents")),e.R7$(2),e.Y8G("ngIf",n.requestError),e.R7$(3),e.SpI(" ",e.bMT(35,33,e.bMT(34,31,"cancel"))," "),e.R7$(3),e.Y8G("disabled",(n.requestProcessing||"edit"===n.requestState||"add"===n.requestState)&&(""===n.tutorialForm.value.title||n.tutorialForm.invali
3d||n.tutorialForm.pristine)),e.R7$(),e.SpI(" ",e.bMT(39,37,e.bMT(38,35,"save"))," ")}}function Ph(t,o){if(1&t&&(e.j41(0,"div",55),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t){const n=e.XpG(3);e.R7$(),e.SpI(" ",e.bMT(2,1,n.requestError)," ")}}function Xh(t,o){if(1&t){const n=e.RV6();e.qex(0),e.j41(1,"div",35)(2,"span"),e.EFF(3),e.nI1(4,"translate"),e.nI1(5,"titleCaseFirstWord"),e.j41(6,"strong"),e.EFF(7),e.k0s()(),e.DNE(8,Ph,3,3,"div",42),e.k0s(),e.j41(9,"div",43)(10,"button",44),e.bIt("click",function(){e.eBV(n);const a=e.XpG(2);return e.Njj(a.closeModal())}),e.EFF(11),e.nI1(12,"translate"),e.nI1(13,"titleCaseFirstWord"),e.k0s(),e.j41(14,"button",56),e.bIt("click",function(){e.eBV(n);const a=e.XpG(2);return e.Njj(a.removeTutorial())}),e.EFF(15),e.nI1(16,"translate"),e.nI1(17,"titleCaseFirstWord"),e.k0s()(),e.bVm()}if(2&t){const n=e.XpG(2);e.R7$(3),e.SpI("",e.bMT(5,8,e.bMT(4,6,"teacherMediaDeleteConfirmation"))," "),e.R7$(4),e.JRh(n.requestBody.title),e.R7$(),e.Y8G("ngIf",n.requestError),e.R7$(3),e.JRh(e.bMT(13,12,e.bMT(12,10,"cancel"))),e.R7$(3),e.Y8G("disabled",n.requestProcessing),e.R7$(),e.SpI(" ",e.bMT(17,16,e.bMT(16,14,"delete"))," ")}}function Bh(t,o){if(1&t&&e.DNE(0,Vh,40,39,"form",33)(1,Xh,18,18,"ng-container",9),2&t){const n=e.XpG();e.Y8G("ngIf",n.modalOpen&&("edit"===n.requestState||"add"===n.requestState)),e.R7$(),e.Y8G("ngIf",n.modalOpen&&"remove"===n.requestState)}}let qh=(()=>{var t;class o{constructor(i,a,s,r,l){this.formBuilder=i,this.teacherService=a,this.deviceService=s,this.translateService=r,this.dialogService=l,this.maxVisibleItems=3,this.courseId=null,this.isDesktop=this.deviceService.isDesktop(),this.contentAvailable=!1,this.tutorials=[],this.courseList=null,this.modalOpen=!1,this.requestState="",this.requestProcessing=!1,this.requestId=0,this.requestCopyToCourseId=null,this.requestMaxDescriptionLength=300,this.requestMaxTitleLength=255,this.requestError=null,this.requestBody={title:null,description:null,url:null,public:null},this.pageIndex=0}get title(){return this.tutorialForm.get("title")}get description(){return this.tutorialForm.get("description")}get url(){return this.tutorialForm.get("url")}get public(){return this.tutorialForm.get("public")}get copyTo(){return this.tutorialForm.get("copyTo")}ngOnInit(){this.course$=this.teacherService.getCurrentCourse().subscribe(i=>{this.courseId=+i.id,this.fetchData()})}setTeacherCourseListForDrowndown(){this.teacherService.getTeacherCourses().pipe((0,R.T)(i=>{var a;return null==i||null===(a=i.body)||void 0===a?void 0:a.data})).subscribe(i=>{this.courseList=i.reduce((a,s)=>{const r={label:"".concat(s.courseName," (").concat(s.type,") (").concat(s.id,")"),value:+s.id};return+this.courseId==+s.id?a:[...a,r]},[])})}fetchData(){this.teacherService.getTeacherTutorials(this.courseId).pipe((0,R.T)(i=>{var a;return(null==i||null===(a=i.body)||void 0===a?void 0:a.data)||[]})).subscribe(i=>{this.tutorials=i,this.setTableData()})}setTableData(){var i;let a=this.tutorials;a=a.map(l=>{const p=l.embedUrl&&l.embedUrl.match.length>0?l.embedUrl.match(/<.*?src='(.*?)'/g)[0].replace(/.*src='([^"]*)'.*/,"$1"):"";return(0,g.A)((0,g.A)({},l),{},{absoluteEmbedUrl:p,type:"tutorial",order:+l.order})}),this.tutorials=a;const s=Math.ceil((null===(i=a)||void 0===i?void 0:i.length)/this.maxVisibleItems);s-1<this.pageIndex&&s&&(this.pageIndex=this.pageIndex-1),this.contentAvailable=!!this.tutorials.length}openTutorialModal(i,a){this.requestState=i,this.modalOpen=!0,this.requestId=a,this.createTutorialForm(a),this.dialogRef=this.dialogService.open(oe.m,{data:{header:"teacherMediaEditTutorial",template:this.tutorialModal},maxHeight:"var(--size-100vh)",panelClass:["material-modal","col-12","remove"===i?"col-lg-4":"col-lg-6"],autoFocus:!1})}closeModal(){this.dialogRef.close(),this.requestState=null,this.requestError=null,this.modalOpen=!1,this.requestProcessing=!1}createTutorialForm(i){const a=i&&this.tutorials.find(s=>s.id===i)||null;this.requestCopyToCourseId=this.courseId,!this.courseList&&a&&this.setTeacherCourseListForDrowndown(),a?(this.currentItem=a,this.tutorialForm=this.formBuilder.group({title:[a.title,[c.k0.required,
3c.k0.maxLength(this.requestMaxTitleLength)]],public:["1"===a.public],description:[a.description,c.k0.maxLength(this.requestMaxDescriptionLength)],url:[a.url,[c.k0.required,this.urlValidator()]],copyTo:[this.requestCopyToCourseId]})):this.tutorialForm=this.formBuilder.group({title:["",[c.k0.required,c.k0.maxLength(this.requestMaxTitleLength)]],public:[!0],description:["",c.k0.maxLength(this.requestMaxDescriptionLength)],url:["",[c.k0.required,this.urlValidator()]]}),this.requestBody=this.tutorialForm.value}editTutorial(i){this.requestProcessing=!0,this.requestBody=(0,g.A)((0,g.A)({},i.value),{},{url:i.value.url.trim(),public:i.value.public?"1":"0"});const{copyTo:a}=i.value;"add"===this.requestState&&this.teacherService.addTeacherTutorial(this.courseId,this.requestBody).subscribe(()=>{this.onRequestSuccess()},({status:s,error:r})=>{this.onRequestError(s,r)}),"edit"===this.requestState&&this.teacherService.patchTeacherTutorial(this.courseId,this.requestId,this.requestBody).subscribe(()=>{a&&a!==this.courseId?this.teacherService.copyRecordToCourse("media",{destination:a,id:this.currentItem.id}).subscribe(()=>{this.onRequestSuccess()}):this.onRequestSuccess()},({status:s,error:r})=>{this.onRequestError(s,r)})}removeTutorial(){this.requestProcessing=!0,"remove"===this.requestState&&this.teacherService.removeTeacherTutorial(this.courseId,this.requestId).subscribe(()=>{this.onRequestSuccess()},({status:i,error:a})=>{this.onRequestError(i,a)})}onRequestSuccess(){this.closeModal(),this.fetchData()}onRequestError(i,a){this.requestProcessing=!1;const s=a.fields.url?"teacherMediaErrorInvalidUrl":null;return 400===i&&s?this.requestError=this.translateService.instant(s):400===i?this.requestError=this.translateService.instant("teacherMediaError"):403===i?this.requestError=this.translateService.instant("teacherMediaErrorAccessDenied"):404===i?this.requestError=this.translateService.instant("teacherMediaErrorTutorialNotFound"):void 0}urlValidator(){return i=>{const s=i.value.trim(),r=[{regex:/(^\b(http?(s)?)\:\/\/)?[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]/g,shouldMatch:!0,error:"invalidUrl"},{regex:/(http(s)?\:\/\/)(.*?)((http(s)?\:(\/\/)?((www\.)?.+\.)?))/g,shouldMatch:!1,error:"invalidUrl"},{regex:/(youtube\.com|youtu\.be|vimeo\.com)/g,shouldMatch:!0,error:"invalidSource"},{regex:/^(?:https?:\/\/)?(?:m\.|www\.)?((?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=)((\w|-){11}))|((?:vimeo\.com\/))((\w|-){8}))(?:\S+)?$/g,shouldMatch:!0,error:"invalidVideo"}].find(l=>{const p=l.shouldMatch,d=l.error,h=new RegExp(l.regex),v=s.match(h);if(p&&!v||!p&&v)return{[d]:{value:s}}});return r?{[r.error]:{value:s}}:null}}ngOnDestroy(){this.course$&&this.course$.unsubscribe()}pageChange(i){const{pageIndex:a}=i||{};"number"==typeof a&&(this.pageIndex=a)}}return(t=o).\u0275fac=function(i){return new(i||t)(e.rXU(c.ze),e.rXU(S.O),e.rXU(ge.Kg),e.rXU(m.c$),e.rXU(B.bZ))},t.\u0275cmp=e.VBU({type:t,selectors:[["app-media-tutorials"]],viewQuery:function(i,a){if(1&i&&e.GBs(_h,7),2&i){let s;e.mGM(s=e.lsd())&&(a.tutorialModal=s.first)}},decls:30,vars:25,consts:[["paginator",""],["tutorialModal",""],[1,"row"],[1,"col-12"],[1,"row","py-3","mb-4","background-color"],[1,"mb-0","text-white"],[1,"row","mb-4"],[1,"col-12","text-right"],["mat-raised-button","","color","primary",3,"click"],[4,"ngIf"],[1,"row",3,"ngClass"],[1,"col-12",3,"ngClass"],[1,"card-container"],[4,"ngFor","ngForOf"],["showFirstLastButtons","",3,"page","hidePageSize","pageSize","length","pageIndex"],["class","text-center",4,"ngIf"],[1,"text-center"],[1,"fas","fa-exclamation-circle","mr-2"],["class","card media-card media-card-tutorial",4,"ngIf"],[1,"card","media-card","media-card-tutorial"],[1,"media-card-body"],[1,"media-card-header","mb-3"],[1,"date"],[1,"public",3,"ngClass"],["target","_blank","rel","noopener",1,"media-link","media-card-title",3,"href"],["class","text-right media-card-button-container button-container justify-content-end",4,"ngIf"],[1,"media-card-video","mb-3"],[3,"video"],[1,"media-description","mb-4"],[1,"text-right","media-card-button-container","button-container","justify-content-end"],["mat-raised-button","","color","accent-inverted",3,"click"],["type","button","mat-raised-button","","color","accent",3,"click"],[1,"media-card-headteacher","text-white","font-italic","text-center","bg-success"],["id","teacher-tutorial-modal",3,"formGroup","ngSubmit",4,"ngIf"],["id","teacher-tutorial-modal",3,"ngSubmit","formGroup"],["mat-dialog-content",""],["matInput","","type","text","formControlName","title","required",""],["matSuffix","","class","text-right m-0",3,"ngClass",4,"ngIf"],["matInput","","type","text","formControlName","url","required",""],["appearance","fill",4,"ngIf"],["formControlName","public"],[1,"ml-1","mr-1","pdfIconTable","text-dark","fas","fa-info-circle",3,"matTooltip"],["class","form-text text-danger",4,"ngIf"],["mat-dialog-actions","","align","end"],["mat-raised-button","","color","primary-inverted",3,"click"],["type","submit","mat-raised-button","","color","primary",3,"disabled"],["matSuffix","",1,"text-right","m-0",3,"ngClass"],["type","text","formControlName","description","id","formMediaDescription","rows","4","matInput","","required",""],["matSuffix","",3,"ngClass",4,"ngIf"],["matSuffix","",3,"ngClass"],["appearance","fill"],["appRemoveAriaOwns",""],["formControlName","copyTo"],["class","disable-checkbox",3,"value",4,"ngFor","ngForOf"],[1,"disable-checkbox",3,"value"],[1,"form-text","text-danger"],["mat-raised-button","","color","primary",3,"click","disabled"]],template:function(i,a){if(1&i){const s=e.RV6();e.j41(0,"div",2)(1,"div",3)(2,"div",4)(3,"div",3)(4,"h5",5),e.EFF(5),e.nI1(6,"translate"),e.k0s()()()()(),e.j41(7,"div",2)(8,"div",3)(9,"p"),e.EFF(10),e.nI1(11,"translate"),e.nI1(12,"titleCaseFirstWord"),e.k0s()()(),e.j41(13,"div",6)(14,"div",7)(1
35,"button",8),e.bIt("click",function(){return e.eBV(s),e.Njj(a.openTutorialModal("add"))}),e.EFF(16),e.nI1(17,"translate"),e.nI1(18,"titleCaseFirstWord"),e.k0s()()(),e.j41(19,"div",2)(20,"div",3),e.DNE(21,bh,2,1,"ng-container",9),e.j41(22,"div",10)(23,"div",11)(24,"div",12),e.DNE(25,Fh,2,1,"ng-container",13),e.k0s(),e.j41(26,"mat-paginator",14,0),e.bIt("page",function(l){return e.eBV(s),e.Njj(a.pageChange(l))}),e.k0s()()()()(),e.DNE(28,Bh,2,2,"ng-template",null,1,e.C5r)}2&i&&(e.R7$(5),e.SpI(" ",e.bMT(6,11,"tutorials")," "),e.R7$(5),e.JRh(e.bMT(12,15,e.bMT(11,13,"teacherMediaTutorialsInfo"))),e.R7$(6),e.JRh(e.bMT(18,19,e.bMT(17,17,"teacherMediaAddTutorial"))),e.R7$(5),e.Y8G("ngIf",!a.contentAvailable),e.R7$(),e.Y8G("ngClass",e.eq3(21,hh,!a.contentAvailable)),e.R7$(),e.Y8G("ngClass",e.eq3(23,fh,a.isDesktop)),e.R7$(2),e.Y8G("ngForOf",a.tutorials),e.R7$(),e.Y8G("hidePageSize",!0)("pageSize",a.maxVisibleItems)("length",null==a.tutorials?null:a.tutorials.length)("pageIndex",a.pageIndex))},dependencies:[u.YU,u.Sq,u.bT,c.qT,c.me,c.BC,c.cb,c.YS,c.j4,c.JD,ve.iy,E.$z,ne.fg,A.rl,A.nJ,A.MV,A.TL,A.yw,xe.VO,Ie.wT,Re.oV,B.E7,B.Yi,Xe.So,bt.j,Be.K,u.PV,m.D9,je.O,Fe.p],styles:["[_nghost-%COMP%] .btn[_ngcontent-%COMP%]{border-radius:var(--border-radius-xxs)}.fa-exclamation-circle[_ngcontent-%COMP%], .fa-info-circle[_ngcontent-%COMP%]{color:var(--color-text)}.button-reset[_ngcontent-%COMP%]{outline:var(--outline-none);border:var(--border-style-none);background:none}.btn[_ngcontent-%COMP%]:not(.btn:hover, .btn[_ngcontent-%COMP%]:focus).button-reset{box-shadow:var(--shadow-none)}#teacher-tutorial-modal[_ngcontent-%COMP%] #formMediaDescription[_ngcontent-%COMP%]{resize:none}#teacher-tutorial-modal[_ngcontent-%COMP%] .form-hint[_ngcontent-%COMP%]{color:var(--color-tint-11);font-size:var(--font-size-81);margin-top:var(--space-1rem)}.hint-sm[_ngcontent-%COMP%]{display:inline}.hint-md[_ngcontent-%COMP%]{display:none}.media-card-header[_ngcontent-%COMP%], .media-card-body[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{color:var(--color-text)}.hidden[_ngcontent-%COMP%]{display:none}.card-container[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr;gap:var(--space-0)}.media-card[_ngcontent-%COMP%]{box-shadow:var(--shadow-md);border:var(--border-style-none);margin:var(--space-1rem) var(--space-auto);width:var(--size-100-percent)}.media-card-video[_ngcontent-%COMP%]{position:relative;padding-bottom:var(--space-56_25-percent);height:var(--size-none)}.media-card-video[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{position:absolute;top:var(--space-0);left:var(--space-0);width:var(--size-100-percent);height:var(--size-100-percent)}.media-card-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.media-card-body[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:var(--size-100-percent);padding:var(--space-1rem)}.media-card[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:var(--font-size-162);color:var(--color-text)}.media-card[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{display:inline-block;font-size:var(--font-size-162);font-weight:var(--font-weight-bold)}.media-description[_ngcontent-%COMP%]{max-height:var(--size-69px);line-height:var(--font-size-143);overflow:hidden;text-overflow:ellipsis}.media-card[_ngcontent-%COMP%] .public[_ngcontent-%COMP%]{font-weight:var(--font-weight-bold)}.media-card-button-container[_ngcontent-%COMP%]{margin-top:var(--space-auto)}.media-card-headteacher[_ngcontent-%COMP%]{padding:var(--space-2px) var(--space-0)}@media (min-width: 768px){#teacher-tutorial-modal[_ngcontent-%COMP%] .modal-dialog[_ngcontent-%COMP%]{max-width:var(--size-teacher-media-dialog)}.hint-sm[_ngcontent-%COMP%]{display:none}.hint-md[_ngcontent-%COMP%]{display:inline}}@media (min-width: 992px){.card-container[_ngcontent-%COMP%]{grid-template-columns:1fr 1fr 1fr;gap:var(--space-2rem)}}[_nghost-%COMP%] .mat-mdc-paginator[_ngcontent-%COMP%]{border:var(--border-style-none)!important}\n\n/*# sourceMappingURL=media-tutorials.component.css.map*/"]}),o})();function Uh(t,o){1&t&&e.nrm(0,"app-media-tutorials")}let Jh=(()=>{var t;class o{constructor(i){this.teacherService=i}ngOnInit(){this.teacherService.getFullScreen().subscribe(i=>this.isFullscreen=i)}ngOnDestroy(){this.fullscreen$&&this.fullscreen$.unsubscribe()}}return(t=o).\u0275fac=function(i){return new(i||t)(e.rXU(S.O))},t.\u0275cmp=e.VBU({type:t,selectors:[["app-teacher-media"]],decls:4,vars:1,consts:[[1,"row"],[1,"col-12"],[4,"ngIf"]],template:function(i,a){1&i&&(e.j41(0,"div",0)(1,"div",1),e.DNE(2,Uh,1,0,"app-media-tutorials",2),e.nrm(3,"app-media-weblinks"),e.k0s()()),2&i&&(e.R7$(2),e.Y8G("ngIf",!a.isFullscreen))},dependencies:[u.bT,rn,qh]}),o})();function Qh(t,o){1&t&&(e.j41(0,"div",2)(1,"div",1),e.nrm(2,"div",7),e.j41(3,"div",8)(4,"p"),e.EFF(5),e.nI1(6,"translate"),e.k0s()(),e.j41(7,"div",8)(8,"p"),e.EFF(9),e.nI1(10,"translate"),e.k0s()()()()),2&t&&(e.R7$(5),e.SpI(" ",e.bMT(6,2,"applied")," "),e.R7$(4),e.SpI(" ",e.bMT(10,4,"approved")," "))}function zh(t,o){1&t&&e.nrm(0,"i",28)}function Wh(t,o){1&t&&e.nrm(0,"i",29)}function Hh(t,o){1&t&&e.nrm(0,"i",30)}
3function Kh(t,o){if(1&t&&(e.j41(0,"li",22)(1,"div",23),e.EFF(2),e.k0s(),e.j41(3,"div",24),e.DNE(4,zh,1,0,"i",25)(5,Wh,1,0,"i",26),e.k0s(),e.j41(6,"div",24),e.DNE(7,Hh,1,0,"i",27),e.k0s()()),2&t){const n=o.$implicit;e.R7$(2),e.JRh(n.courseName),e.R7$(2),e.Y8G("ngIf",!n.applied),e.R7$(),e.Y8G("ngIf",n.applied),e.R7$(2),e.Y8G("ngIf",n.approved)}}function Zh(t,o){if(1&t&&(e.j41(0,"ul"),e.DNE(1,Kh,8,4,"li",21),e.k0s()),2&t){const n=e.XpG(2).$implicit;e.R7$(),e.Y8G("ngForOf",n.courses)}}function ef(t,o){if(1&t&&e.DNE(0,Zh,2,1,"ul",20),2&t){const n=e.XpG().$implicit;e.Y8G("ngIf",n.courses)}}function tf(t,o){if(1&t){const n=e.RV6();e.j41(0,"li")(1,"div",18),e.bIt("click",function(){const a=e.eBV(n).$implicit,s=e.XpG(5);return e.Njj(s.showSubCategory(a.categoryName))}),e.nrm(2,"i",13),e.j41(3,"span",19),e.EFF(4),e.k0s()(),e.DNE(5,ef,1,1,"ng-template",14),e.k0s()}if(2&t){const n=o.$implicit,i=e.XpG(5);e.R7$(2),e.Y8G("ngClass",i.showSubcat===n.categoryName?"fa-angle-down":"fa-angle-right"),e.R7$(),e.Y8G("ngClass",i.showSubcat===n.categoryName?"title-color":null),e.R7$(),e.SpI(" ",n.categoryName," "),e.R7$(),e.Y8G("ngIf",i.showSubcat===n.categoryName)}}function nf(t,o){if(1&t&&(e.j41(0,"ul",16),e.DNE(1,tf,6,4,"li",17),e.k0s()),2&t){const n=e.XpG(2).$implicit;e.R7$(),e.Y8G("ngForOf",n.subcategories)}}function af(t,o){if(1&t&&e.DNE(0,nf,2,1,"ul",15),2&t){const n=e.XpG().$implicit;e.Y8G("ngIf",n.subcategories)}}function of(t,o){if(1&t){const n=e.RV6();e.j41(0,"li",10)(1,"div",11),e.bIt("click",function(){const a=e.eBV(n).$implicit,s=e.XpG(2);return e.Njj(s.showCategory(a.categoryName))}),e.j41(2,"p",12),e.EFF(3),e.k0s(),e.nrm(4,"i",13),e.k0s(),e.DNE(5,af,1,1,"ng-template",14),e.k0s()}if(2&t){const n=o.$implicit,i=e.XpG(2);e.R7$(3),e.SpI(" ",n.categoryName," "),e.R7$(),e.Y8G("ngClass",i.showCat===n.categoryName?"fa-angle-up":"fa-angle-down"),e.R7$(),e.Y8G("ngIf",i.showCat===n.categoryName)}}function sf(t,o){if(1&t&&(e.j41(0,"div",2)(1,"ul"),e.DNE(2,of,6,3,"li",9),e.k0s()()),2&t){const n=e.XpG();e.R7$(2),e.Y8G("ngForOf",n.categories)}}let rf=(()=>{var t;class o{constructor(i){this.teacherService=i}ngOnInit(){this.teacherService.getTeacherPreferences().subscribe(i=>{200===i.status&&(this.categories=i.body.data)})}showCategory(i){this.showCat=this.showCat!==i&&i}showSubCategory(i){this.showSubcat=this.showSubcat!==i&&i}}return(t=o).\u0275fac=function(i){return new(i||t)(e.rXU(S.O))},t.\u0275cmp=e.VBU({type:t,selectors:[["app-teacher-preferences"]],decls:18,vars:14,consts:[[1,"container","mat-elevation-z3","sm-no-shadow","mb-0","mb-sm-5","teacher-profile"],[1,"row"],[1,"col-12"],[1,"title","my-3"],["class","col-12",4,"ngIf"],[1,"col-12","mb-3"],["mat-raised-button","","color","primary","routerLink","/application-form"],[1,"col-6","col-md-8"],[1,"col-3","col-md-2","text-center","text-label"],["class","my-2",4,"ngFor","ngForOf"],[1,"my-2"],[1,"col","py-2","category-title","d-flex","justify-content-between","align-items-center",3,"click"],[1,"m-0"],[1,"fas",3,"ngClass"],[3,"ngIf"],["class","category-box",4,"ngIf"],[1,"category-box"],[4,"ngFor","ngForOf"],[1,"col","py-1","subcategory-title",3,"click"],[3,"ngClass"],[4,"ngIf"],["class","row py-2 ml-3 mr-0",4,"ngFor","ngForOf"],[1,"row","py-2","ml-3","mr-0"],[1,"col-8"],[1,"col-2","text-center"],["class","far fa-square",4,"ngIf"],["class","far fa-check-square",4,"ngIf"],["class","fas fa-check text-success",4,"ngIf"],[1,"far","fa-square"],[1,"far","fa-check-square"],[1,"fas","fa-check","text-success"]],template:function(i,a){1&i&&(e.j41(0,"div",0)(1,"div",1)(2,"div",2)(3,"h3",3),e.EFF(4),e.nI1(5,"translate"),e.k0s(),e.j41(6,"p"),e.EFF(7),e.nI1(8,"translate"),e.k0s(),e.j41(9,"p"),e.EFF(10),e.nI1(11,"translate"),e.k0s()(),e.DNE(12,Qh,11,6,"div",4)(13,sf,3,1,"div",4),e.j41(14,"div",5)(15,"button",6),e.EFF(16),e.nI1(17,"translate"),e.k0s()()()()),2&i&&(e.R7$(4),e.SpI(" ",e.bMT(5,6,"myClassPreference")," "),e.R7$(3),e.JRh(e.bMT(8,8,"myCPtext")),e.R7$(3),e.JRh(e.bMT(11,10,"myCPtex2")),e.R7$(2),e.Y8G("ngIf",a.categories),e.R7$(),e.Y8G("ngIf",a.categories),e.R7$(3),e.SpI(" ",e.bMT(17,12,"addPreferences")," "))},dependencies:[u.YU,u.Sq,u.bT,E.$z,O.Wk,m.D9],styles:["main[_ngcontent-%COMP%]{padding-top:var(--space-30px)}.title[_ngcontent-%COMP%]{font-size:var(--font-size-125);font-weight:var(--font-weight-bold)}.category-box[_ngcontent-%COMP%]{border-bottom:var(--border-xs-solid-tint-3);border-left:var(--border-xs-solid-tint-3);border-right:var(--border-xs-solid-tint-3)}ul[_ngcontent-%COMP%], li[_ngcontent-%COMP%]{padding-left:var(--space-0);margin-left:var(--space-0);list-style-type:none;font-weight:var(--font-weight-normal)}.category-title[_ngcontent-%COMP%]{background:var(--color-tint-3)}.category-title[_ngcontent-%COMP%], .subcategory-title[_ngcontent-%COMP%]{cursor:pointer}@media (max-width: 768px){.text-label[_ngcontent-%COMP%]{font-size:var(--font-size-81)}}\n\n/*# sourceMappingURL=teacher-preferences.component.css.map*/"]}),o})();var lf=f(20892);let cf=(()=>{var t;class o{}return(t=o).\u0275fac=function(i){return new(i||t)},t.\u0275cmp=e.VBU({type:t,selectors:[["app-teacher-profile"]],decls:1,vars:0,template:function(i,a){1&i&&e.nrm(0,"app-user-profile")},dependencies:[lf.W],encapsulation:2}),o})();const mf=t=>[t];let pf=(()=>{var t;class o{constructor(i){this.websiteService=i,this.userLang=this.websiteService.getLang()}ngOnInit(){}}return(t=o).\u0275fac=function(i){return new(i||t)(e.rXU(Ae.j))},t.\u0275cmp=e.VBU({type:t,selectors:[["app-teacher-virtual-room-empty"]],decls:27,vars:21,consts:[[1,"container","mat-elevation-z3","sm-no-shadow","mb-0","mb-sm-5","teacher-virtual-room"],[1,"row"],[1,"col-12"],["appBgColor","",1,"row","row","py-3","mb-3"],[1,"col-12","col-md-6"],[1,"mb-0","text-white"],[1,"col-12","row","content"],[1,"go-to-vac",3,"routerLink"],[1,"col-12","row",2,"justify-content","center"],[1,"text-center"],[3,"vr"],[1,"col-12","text-center","my-3"]],template:function(i,a){1&i&&(e.j41(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"h5",5),e.EFF(6),e.nI1(7,"translate"),e.k0s()()()(),e.j41(8,"div",2)(9,"div",6)(10,"div",2)(11,"p"),e.EFF(12),e.nI1(13,"translate"),e.j41(14,"a",7),e.nI1(15,"routeT"),e.EFF(16),e.nI1(17,"translate"),e.k0s()()(),e.j41(18,"div",8)(19,"div",4)(20,"h3",9),e.EFF(21),e.nI1(22,"translate"),e.k0s(),e.nrm(23,"app-embedded-video",10),e.j41(24,"p",11),e.EFF(25),e.nI1(26,"translate"),e.k0s()()()()()()()),2&i&&(e.R7$(6),e.JRh(e.bMT(7,7,"virtualRoom")),e.R7$(6),e.SpI(" ",e.bMT(13,9,"virtualRoomEmText1")," "),e.R7$(2),e.Y8G("routerLink",e.eq3(19,mf,e.bMT(15,11,"/careers-teachers"))),e.R7$(2),e.JRh(e.bMT(17,13,"virtualRoomEmText2")),e.R7$(5),e.JRh(e.bMT(22,15,"vcTitle2")),e.R7$(2),e.Y8G("vr",!0),e.R7$(2),e.SpI(" ",e.bMT(26,17,"vcText6")," "))},dependencies:[we.k,bt.j,O.Wk,m.D9,tt.s],styles:["main[_ngcontent-%COMP%]{padding-top:var(--space-30px)}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:center;align-items:center;padding:var(--space-26px) var(--space-0)}.go-to-vac[_ngcontent-%COMP%]{-webkit-text-decoration:var(--text-decoration-underline);text-decoration:var(--text-decoration-underline)}\n\n/*# sourceMappingURL=teacher-virtual-room-empty.component.css.map*/"]}),o})();var df=f(74581),uf=f(11249),mn=f(18250),_f=f(97705);const hf=(t,o)=>({lessonNumber:t,lesson:o,needsBreak:!0}),ff=(t,o)=>({lessonNumber:t,lesson:o,needsBreak:!1}),gf=t=>[t],vf=t=>({amount:t,type:"tense"}),bf=(t,o,n,i,a,s)=>({lessonNumber:t,takesPlace:o,lessonDate:n,lessonStartTime:i,lessonEndTime:a,teacherName:s});function Tf(t,o){if(1&t&&(e.j41(0,"p"),e.EFF(1),e.nI1(2,"translate"),e.nI1(3,"translate"),e.j41(4,"span",19),e.EFF(5),e.nI1(6,"async"),e.k0s(),e.nrm(7,"br"),e.EFF(8),e.nI1(9,"translate"),e.nI1(10,"translate"),e.k0s()),2&t){const n=e.XpG(3);e.R7$(),e.E5c(" ",e.bMT(2,7,"vcLes")," ",n.nextLesson," ",e.bMT(3,9,"vcText3")," "),e.R7$(4),e.JRh(e.bMT(6,11,n.countdown$)),e.R7$(3),e.E5c(" (",e.bMT(9,13,"teacherLabel"),"",e.bMT(10,15,"typography.colon"),"",n.nextClass.teacherNames,") ")}}function Cf(t,o){1&t&&(e.j41(0,"p",16),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"virtualZoomRoomAcc")," "))}function xf(t,o){if(1&t&&e.eu8(0,17),2&t){const n=e.XpG(3),i=e.sdS(8);e.Y8G("ngTemplateOutlet",i)("ngTemplateOutletContext",e.l_i(2,hf,n.nextLesson,n.nextClass))}}function If(t,o){if(1&t&&e.nrm(0,"app-start-zoom-class",18),2&t){const n=e.XpG(3);e.Y8G("lesson",n.nextClass)("btnClasses","m-0 btn button-primary-color text-white")}}function Rf(t,o){if(1&t&&(e.j41(0,"div",9)(1,"div",13),e.nrm(2,"img",14),e.nI1(3,"generateFastImage"),e.k0s(),e.j41(4,"h4",15)(5,"strong"),e.EFF(6),e.k0s()(),e.DNE(7,Tf,11,17,"p")(8,Cf,3,3,"p",16)(9,xf,1,5,"ng-container",17)(10,If,1,2,"app-start-zoom-class",18),e.k0s()),2&t){const n=e.XpG(2);e.R7$(2),e.Y8G("src",e.bMT(3,5,n.nextClass.teacherPhoto),e.B4B),e.R7$(4),e.SpI(" ",n.course.courseName," "),e.R7$(),e.vxM(!n.nextClass.hasOwnProperty("started")||n.nextClass.started||n.nextClass.ended?-1:7),e.R7$(),e.vxM(n.nextClass.ended?9:8),e.R7$(2),e.vxM(n.nextClass?10:-1)}}function Ff(t,o){if(1&t&&(e.j41(0,"div",20),e.nrm(1,"img",21),e.nI1(2,"generateFastImage"),e.k0s(),e.j41(3,"div",22),e.eu8(4,17),e.k0s()),2&t){const n=e.XpG().$implicit;e.XpG(2);const i=e.sdS(8);e.R7$(),e.Y8G("src",e.bMT(2,3,n.teacherPhoto),e.B4B),e.R7$(3),e.Y8G("ngTemplateOutlet",i)("ngTemplateOutletContext",e.l_i(5,ff,n.lessonNumber,n))}}function kf(t,o){if(1&t&&(e.j41(0,"li",12),e.DNE(1,Ff,5,8),e.k0s()),2&t){const n=o.$implicit,i=e.XpG(2);
3e.R7$(),e.vxM(i.nextClass&&n.id===i.nextClass.id?-1:1)}}function yf(t,o){if(1&t&&(e.j41(0,"div",4)(1,"div",5)(2,"h3",6)(3,"strong"),e.EFF(4),e.nI1(5,"translate"),e.k0s()()(),e.j41(6,"div",5)(7,"div",7)(8,"div",8),e.DNE(9,Rf,11,7,"div",9),e.j41(10,"div",10)(11,"ul",11),e.Z7z(12,kf,2,1,"li",12,e.fX1),e.k0s()()()()()()),2&t){const n=e.XpG();e.R7$(4),e.SpI(" ",e.bMT(5,4,"vcTitle")," "),e.R7$(4),e.xc7("justify-content","flex-start"),e.R7$(),e.vxM(n.nextClass?9:-1),e.R7$(3),e.Dyx(n.courseLessons)}}function Ef(t,o){1&t&&(e.j41(0,"div",5)(1,"div",7)(2,"div",5)(3,"p"),e.EFF(4),e.nI1(5,"translate"),e.j41(6,"a",23),e.nI1(7,"routeT"),e.EFF(8),e.nI1(9,"translate"),e.k0s()()(),e.j41(10,"div",24)(11,"div",2)(12,"h3",25),e.EFF(13),e.nI1(14,"translate"),e.k0s(),e.nrm(15,"app-embedded-video",26),e.j41(16,"p",27),e.EFF(17),e.nI1(18,"translate"),e.k0s()()()()()),2&t&&(e.R7$(4),e.SpI(" ",e.bMT(5,6,"virtualRoomEmText1")," "),e.R7$(2),e.Y8G("routerLink",e.eq3(16,gf,e.bMT(7,8,"/careers-teachers"))),e.R7$(2),e.JRh(e.bMT(9,10,"virtualRoomEmText2")),e.R7$(5),e.JRh(e.bMT(14,12,"vcTitle2")),e.R7$(2),e.Y8G("vr",!0),e.R7$(2),e.SpI(" ",e.bMT(18,14,"vcText6")," "))}function Sf(t,o){if(1&t&&(e.nrm(0,"p",28),e.nI1(1,"i18nSelector"),e.nI1(2,"translate"),e.nI1(3,"dateformat"),e.nI1(4,"translate")),2&t){const i=o.lesson,a=o.needsBreak;e.Y8G("innerHTML",e.i5U(4,8,"virtualLessonInfo",e.l4e(13,bf,o.lessonNumber,e.bMT(2,4,e.i5U(1,1,"takesPlace",e.eq3(11,vf,+i.ended))),e.bMT(3,6,i.date),i.startTime,i.endTime+(a?"<br />":""),i.teacherNames&&" "!==i.teacherNames?i.teacherNames:"/")),e.npT)}}let $f=(()=>{var t;class o{constructor(){this.teacherService=(0,e.WQX)(S.O),this.helperService=(0,e.WQX)(Ee.w),this.translateService=(0,e.WQX)(m.c$),this.i18nSelectorPipe=(0,e.WQX)(mn.C),this.destroy$=new y.B}ngOnInit(){this.teacherService.getCurrentCourse().pipe((0,I.Q)(this.destroy$)).subscribe(i=>{var a,s;this.course=i,this.nextClass=i.nextClass,this.helperService.isEmptyObj(this.nextClass)?(this.nextClass=null===(a=this.course)||void 0===a?void 0:a.lessons[this.course.lessons.length-1],this.nextLesson=null===(s=this.course)||void 0===s?void 0:s.lessons.length,this.loadLessons()):(this.nextLesson=this.checkLessonsNumber(),this.loadLessons(),this.nextClass.date&&this.nextClass.startTime&&(this.nextClassDate=(0,N.I1)("".concat(this.nextClass.date," ").concat(this.nextClass.startTime)),this.countdown$=(0,df.O)(0,1e3).pipe((0,R.T)(()=>this.calculateCountdown()),(0,uf.v)(r=>!!r)),this.countdown$.pipe((0,I.Q)(this.destroy$)).subscribe()))})}calculateCountdown(){const i=(0,N.I1)(),a=N.I1.duration(this.nextClassDate.diff(i));if(a.asMilliseconds()<=0){var s;if(this.nextClass.started=1,null===(s=this.course)||void 0===s||!s.lessons.length||!this.nextClass.hasOwnProperty("id"))return null;{const{lessons:r,nextClass:l}=this.course,p=(0,N.I1)().format(P.x.misc.time);if((0,N.I1)(p,P.x.misc.time).isAfter((0,N.I1)(l.endTime,P.x.misc.time).subtract(1,P.$.minute))){const d=r.findIndex(k=>k.id===l.id);let h=r[d+1],v=!1;if(h||(h=r[r.length-1],h.ended=!0,v=!0),this.nextClassDate=(0,N.I1)("".concat(h.date," ").concat(h.startTime)),this.nextClass=h,this.nextLesson=this.checkLessonsNumber(),this.loadLessons(),v)return null;const $=N.I1.duration(this.nextClassDate.diff(i));return this.createNextLessonString($)}}}return this.createNextLessonString(a)}createNextLessonString(i){const a=Math.floor(i.asDays()),s=Math.floor(i.hours()),r=Math.floor(i.minutes());let l="";const p=this.translateService.instant("and");return a&&(l="".concat(a," ").concat(this.getI18nKey("day",a))),a&&s&&(l=r?"".concat(l,", "):"".concat(l," ").concat(p," ")),s&&(l="".concat(l).concat(s," ").concat(this.getI18nKey("hour",s))),r&&((a||s)&&(l="".concat(l," ").concat(p," ")),l="".concat(l).concat(r," ").concat(this.getI18nKey("minute",r))),l}getI18nKey(i,a=0){const s=this.i18nSelectorPipe.transform(i,{amount:a});return this.translateService.instant(s)}checkLessonsNumber(){return this.course.lessons.findIndex(a=>this.nextClass&&this.nextClass.id===a.id)+1||null}loadLessons(){const{lessons:i}=this.course;i&&(this.courseLessons=i.map((a,s)=>(0,g.A)((0,g.A)({},a),{},{lessonNumber:s+1})).filter(({id:a})=>a!==this.nextClass.id))}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}}return(t=o).\u0275fac=function(i){return new(i||t)},t.\u0275cmp=e.VBU({type:t,selectors:[["app-teacher-virtual-room"]],decls:9,vars:4,consts:[["lessonString",""],["appBgColor","",1,"row","py-3","mb-3"],[1,"col-12","col-md-6"],[1,"mb-0","text-white"],[1,"row","pb-4"],[1,"col-12"],[1,"col-12","text-center"],[1,"col-12","row","content"],[1,"col-12","row"],[1,"lesson_current","col-12","col-md-6"],[1,"col-12","col-md-6","mt-3","mt-md-0"],[1,"lessons"],[1,"lesson"],[1,"box","col-12"],["alt","","appOnErrorImage","","imgType","user",3,"src"],[1,"title-color","pt-4","pb-2","text-left"],[1,"text-left"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],["id","teacher-start-zoom-class",1,"d-inline-block",3,"lesson","btnClasses"],[1,"text-lowercase"],[1,"img_holder"],["alt","","appOnErrorImage","","imgType","user","objectFit","cover",3,"src"],[1,"list_content"],[1,"go-to-vac",3,"routerLink"],[1,"col-12","row",2,"justify-content","center"],[1,"text-center"],[3,"vr"],[1,"col-12","text-center","my-3"],[1,"m-0",3,"innerHTML"]],template:function(i,a){1&i&&(e.j41(0,"div",1)(1,"div",2)(2,"h5",3),e.EFF(3),e.nI1(4,"translate"),e.k0s()()(),e.DNE(5,yf,14,6,"div",4)(6,Ef,19,18,"div",5)(7,Sf,5,20,"ng-template",null,0,e.C5r)),2&i&&(e.R7$(3),e.JRh(e.bMT(4,2,"virtualRoom")),e.R7$(2),e.vxM(null!=a.c
3ourse.lessons&&a.course.lessons.length?5:6))},dependencies:[u.T3,we.k,bt.j,_f.h,Ne.e,O.Wk,u.Jj,m.D9,je.O,mn.C,tt.s,Ke.l],styles:[".content[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:center;align-items:center;padding:var(--space-26px) var(--space-0)}.box[_ngcontent-%COMP%]{background-color:var(--color-background);height:var(--size-236px);width:var(--size-50-percent);display:flex;flex-direction:column;justify-content:center;align-items:center;box-shadow:var(--shadow-md)}.box[_ngcontent-%COMP%] > img[_ngcontent-%COMP%]{object-fit:cover;background-color:var(--color-tint-9);height:var(--size-174px);width:var(--size-174px);border-radius:var(--border-radius-full);display:block}.lesson_current[_ngcontent-%COMP%]{flex:1}.lesson_current[_ngcontent-%COMP%] > .box[_ngcontent-%COMP%]{width:var(--size-100-percent)}.lesson_current[_ngcontent-%COMP%] p[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{-webkit-text-decoration:var(--text-transform-none);text-decoration:var(--text-transform-none);font-weight:var(--font-weight-bold);color:var(--color-tint-12);text-transform:var(--text-transform-capitalize)}.lesson_current[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{font-weight:var(--font-weight-bold)}.lessons[_ngcontent-%COMP%]{list-style:none;padding:var(--space-0)}.lesson[_ngcontent-%COMP%]{display:flex;flex-direction:row;box-shadow:var(--shadow-virtualroom);padding:var(--space-15px) var(--space-0)}.lesson[_ngcontent-%COMP%]:first-child{padding-top:var(--space-0)}.lesson[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:nth-child(1){display:flex;flex:2;background-color:var(--color-background);align-items:center;justify-content:center;flex-direction:column}.lesson[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:nth-child(2){flex:5;padding-left:var(--space-15px)}.lesson[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{object-fit:cover;display:block;width:var(--size-60px);height:var(--size-60px);border-radius:var(--border-radius-full);background-color:var(--color-tint-9)}.list_content[_ngcontent-%COMP%]{text-align:left}.list_content[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{font-size:var(--font-size-100);color:var(--color-tint-9);font-weight:var(--font-weight-normal);padding:var(--space-15px) var(--space-0)}\n\n/*# sourceMappingURL=teacher-virtual-room.component.css.map*/"]}),o})();const ie=(t,o,n,i)=>{const a=(0,e.WQX)(q.J),s=a.unreadInboxMessageCountSubject.getValue(),r=a.openEvaluationCountSubject.getValue(),{url:l}=i;return l.includes("teacher")&&(s||a.updateUnreadCounter(),r||a.updateOpenEvaluationCounter()),!0};var Mf=f(9736);let wf=(()=>{var t;class o{constructor(i,a){this.route=i,this.teacherService=a,this.teacherExamPreview={courseId:0,examId:0,preview:!0,duration:0}}ngOnInit(){this.course$=this.teacherService.getCurrentCourse().subscribe(i=>{this.teacherExamPreview.courseId=+i.id}),this.route.params.subscribe(({examId:i})=>{this.teacherExamPreview.examId=i})}ngOnDestroy(){this.course$&&this.course$.unsubscribe()}}return(t=o).\u0275fac=function(i){return new(i||t)(e.rXU(O.nX),e.rXU(S.O))},t.\u0275cmp=e.VBU({type:t,selectors:[["app-teacher-exam-preview"]],decls:1,vars:1,consts:[[3,"teacherExamPreview"]],template:function(i,a){1&i&&e.nrm(0,"app-exam",0),2&i&&e.Y8G("teacherExamPreview",a.teacherExamPreview)},dependencies:[Mf.H]}),o})();var jf=f(80436);const Gf=t=>["/teacher/ecampus/exam",t],Df=t=>({hide:t}),pn=t=>[t],Of=t=>({formats:t}),Af=t=>({value:t});function Nf(t,o){if(1&t){const n=e.RV6();e.j41(0,"app-export-to-pdf-button",28),e.bIt("dependencyLoaded",function(a){e.eBV(n);const s=e.XpG();return e.Njj(s.exportAsPdf(a))}),e.k0s()}}function Lf(t,o){1&t&&(e.j41(0,"th",29),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.JRh(e.bMT(2,1,"id")))}function Yf(t,o){if(1&t&&(e.j41(0,"td",30),e.EFF(1),e.k0s()),2&t){const n=o.$implicit;e.R7$(),e.SpI(" ",n.studentId," ")}}function Vf(t,o){1&t&&(e.j41(0,"th",29),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.JRh(e.bMT(2,1,"name")))}function Pf(t,o){if(1&t&&(e.j41(0,"td",30),e.nrm(1,"span",31),e.k0s()),2&t){const n=o.$implicit;e.R7$(),e.Y8G("innerHTML",n.fullName,e.npT)}}function Xf(t,o){1&t&&(e.j41(0,"th",29),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.JRh(e.bMT(2,1,"date")))}function Bf(t,o){if(1&t&&(e.EFF(0),e.nI1(1,"dateformat")),2&t){const n=e.XpG().$implicit,i=e.XpG();e.SpI(" ",e.i5U(1,1,n.startStudentTime,e.eq3(6,Of,e.eq3(4,pn,i.DATEFORMATS.iso.dateTimeShort)))," ")}}function qf(t,o){if(1&t&&(e.j41(0,"td",30),e.DNE(1,Bf,2,8),e.k0s()),2&t){const n=o.$implicit;e.R7$(),e.vxM(n.startStudentTime?1:-1)}}function Uf(t,o){1&t&&(e.j41(0,"th",29),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.JRh(e.bMT(2,1,"evaluation.evaluation")))}function Jf(t,o){if(1&t&&(e.j41(0,"td",30),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t){const n=o.$implicit;e.R7$(),e.SpI(" ",e.i5U(2,1,"typography.percent",e.eq3(4,Af,n.evaluation))," ")}}function Qf(t,o){1&t&&(e.j41(0,"th",29),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.JRh(e.bMT(2,1,"points")))}
3function zf(t,o){if(1&t&&(e.j41(0,"td",30),e.EFF(1),e.k0s()),2&t){const n=o.$implicit;e.R7$(),e.SpI(" ",n.points+"/"+n.totalPoints," ")}}function Wf(t,o){1&t&&(e.j41(0,"th",29),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.JRh(e.bMT(2,1,"question")))}function Hf(t,o){if(1&t&&(e.j41(0,"td",30),e.EFF(1),e.k0s()),2&t){const n=o.$implicit;e.R7$(),e.SpI(" ",n.numberCorrectAnsweredQuestions+"/"+n.numberQuestions," ")}}function Kf(t,o){1&t&&e.nrm(0,"th",29)}function Zf(t,o){if(1&t&&(e.j41(0,"td",30)(1,"a",32),e.nrm(2,"i",33),e.k0s()()),2&t){const n=o.$implicit;e.R7$(),e.Y8G("routerLink",e.eq3(1,pn,n.solvingId))}}function eg(t,o){1&t&&e.nrm(0,"tr",34)}function tg(t,o){1&t&&e.nrm(0,"tr",35)}function ng(t,o){1&t&&(e.j41(0,"p",36),e.nrm(1,"i",37),e.j41(2,"span",38),e.EFF(3),e.nI1(4,"translate"),e.k0s()()),2&t&&(e.R7$(3),e.JRh(e.bMT(4,1,"teacherExamResultsEmpty")))}let dn=(()=>{var t;class o{set matPaginator(i){this.paginator=i,this.setDataSourceAttributes()}constructor(i,a,s,r,l,p,d){this.teacherExamService=i,this.teacherService=a,this.titleService=s,this.translateService=r,this.route=l,this.cdRef=p,this.teacherEloService=d,this.designTokenService=(0,e.WQX)(kt.R),this.DATEFORMATS=P.x,this.selectedExam=null,this.maxVisibleItems=10,this.results=new b.I6([]),this.displayedColumns=["id","name","date","evaluation.evaluation","points","question","preview"],this.destroy$=new y.B}ngOnInit(){this.targetExamId=+this.route.snapshot.params.examId,this.selectedExam=this.teacherEloService.getItemFromList(this.targetExamId),this.teacherService.getCurrentCourse().pipe((0,I.Q)(this.destroy$)).subscribe(i=>{this.course=i,this.courseId=+i.id,this.teacherService.setBackBtnRoute(["ecampus/exam",+i.id])})}ngAfterViewInit(){this.teacherExamService.getExamResults().pipe((0,I.Q)(this.destroy$)).subscribe(i=>{i&&(i=i.map(a=>(0,g.A)((0,g.A)({},a),{},{fullName:"".concat(a.firstName," ").concat(a.lastName)})),this.results.data=i)}),this.cdRef.detectChanges()}exportAsPdf(i){const{pdfMake:a,htmlToPdfmake:s}=i||{},p={content:s(this.generateResultTable(),{tableAutoSize:!0})};a.createPdf(p).download("".concat(this.translateService.instant("examResults")," ").concat(this.course.courseName," ").concat(this.course.id))}generateResultTable(){var i;if(null===(i=this.results)||void 0===i||!i.data)return;switch(this.selectedExam.variant){case"re_exam":this.exVariantTitle="firstReExam";break;case"second_re_exam":this.exVariantTitle="secondReExam";break;default:this.exVariantTitle="initialExam"}const a=this.designTokenService.getDesignTokenValues(["--size-100-percent","--border-xxs-solid-tint-4"]);return'\n <p style="width: '.concat(a["--size-100-percent"],';">\n <em>').concat(this.course.id," ").concat(this.course.courseCode," ").concat(this.course.courseName,"</em>\n <br />\n <em>").concat(this.selectedExam.name,"</em>\n <br />\n <em>").concat(this.translateService.instant("type")).concat(this.translateService.instant("typography.colon")).concat(this.translateService.instant(this.exVariantTitle),'</em>\n </p>\n <table>\n <thead>\n <tr style="border: ').concat(a["--border-xxs-solid-tint-4"],';">\n <th>ID</th>\n <th>').concat(this.translateService.instant("name"),"</th>\n <th>").concat(this.translateService.instant("date"),"</th>\n <th>").concat(this.translateService.instant("evaluation.evaluation"),"</th>\n <th>").concat(this.translateService.instant("points"),"</th>\n <th>").concat(this.translateService.instant("question"),"</th>\n </tr>\n </thead>\n <tbody>\n ").concat(this.results.data.map(s=>'\n <tr style="border: '.concat(a["--border-xxs-solid-tint-4"],';">\n <td>').concat(s.studentId,"</td>\n <td>").concat(s.firstName," ").concat(s.lastName,"</td>\n <td>").concat((0,N.I1)(s.startStudentTime).format(P.x.display.date),"</td>\n <td>").concat(this.translateService.instant("typography.percent",{value:s.evaluation}),"</td>\n <td>").concat(s.points,"/").concat(s.totalPoints,"</td>\n <td>").concat(s.numberCorrectAnsweredQuestions,"/").concat(s.numberQuestions,"</td>\n </tr>\n ")).join(""),"\n </tbody>\n </table>\n ")}openTeacherExamManual(){this.teacherExamService.openExamManual()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),this.teacherService.setBackBtnRoute(null),this.titleService.setTitle(this.translateService.instant("teacher"))}setDataSourceAttributes(){this.results&&(this.results.paginator=this.paginator)}}return(t=o).\u0275fac=function(i){return new(i||t)(e.rXU(De.V),e.rXU(S.O),e.rXU(jf.hE),e.rXU(m.c$),e.rXU(O.nX),e.rXU(e.gRc),e.rXU(W))},t.\u0275cmp=e.VBU({type:t,selectors:[["app-teacher-exam-results-overview"]],viewQuery:function(i,a){if(1&i&&e.GBs(ve.iy,5),2&i){let s;e.mGM(s=e.lsd())&&(a.matPaginator=s.first)}},decls:47,vars:25,consts:[["paginator",""],["appBgColor","",1,"row","py-3","mb-3"],[1,"col-12","d-flex","justify-content-between","align-items-center"],[1,"mb-0","text-white"],["mat-button","","color","background",3,"click"],[1,"fas","fa-question-circle"],[1,"m-0","d-inline"],[1,"row","pb-4"],[1,"col-12","d-flex","flex-column","flex-md-row","justify-content-between","pb-3","mb-2"],["type","button","mat-raised-button","","color","primary",1,"text-uppercase","mb-3","mb-md-0",3,"routerLink"],[1,"fa-solid","fa-angle-left","mr-2"],["label","exportResultsToPdf"],[1,"col-12","questions-box"],[1,"table-container","mat-elevation-z3",3,"ngClass"],["mat-table","",3,"dataSource"],["matColumnDef","id"],["mat-header-cell","",4,"matHeaderCellDef"],["class","align-top","mat-cell","",4,"matCellDef"],["matColumnDef","name"],["matColumnDef","date"],["matColumnDef","evaluation.evaluation"],["matColumnDef","points"],["matColumnDef","question"],["matColumnDef","preview"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],[3,"hidePageSize","showFirstLastButtons","pageSize"],["class","text-center",4,"ngIf"],["label","exportResultsToPdf",3,"dependencyLoaded"],["mat-header-cell",""],["mat-cell","",1,"align-top"],[3,"innerHTML"],[3,"routerLink"],[1,"c-p","fas","fa-eye"],["mat-header-row",""],["mat-row",""],[1,"text-center"],[1,"fas","fa-exclamation-circle","mr-2"],[1,"uppercase-first-letter"]],template:function(i,a){if(1&i){const s=e.RV6();e.j41(0,"div",1)(1,"div",2)(2,"h5",3),e.EFF(3),e.nI1(4,"translate"),e.k0s(),e.j41(5,"button",4),e.bIt("click",function(){return e.eBV(s),e.Njj(a.openTeacherExamManual())}),e.nrm(6,"i",5),e.j41(7,"h5",6),e.EFF(8),e.nI1(9,"translate"),e.nI1(10,"titlecase"),e.k0s()()()(),e.j41(11,"div",7)(12,"div",8)(13,"a",9),e.nrm(14,"i",10),e.EFF(15),e.nI1(16,"translate"),e.k0s(),e.DNE(17,Nf,1,0,"app-export-to-pdf-button",11),e.k0s(),e.j41(18,"div",12)(19,"div",13)(20,"table",14),e.qex(21,15),e.DNE(22,Lf,3,3,"th",16)(23,Yf,2,1,"td",17),e.bVm(),e.qex(24,18),e.DNE(25,Vf,3,3,"th",16)(26,Pf,2,1,"td",17),e.bVm(),e.qex(27,19),e.DNE(28,Xf,3,3,"th",16)(29,qf,2,1,"td",17),e.bVm(),e.qex(30,20),e.DNE(31,Uf,3,3,"th",16)(32,Jf,3,6,"td",17),e.bVm(),e.qex(33,21),e.DNE(34,Qf,3,3,"th",16)(35,zf,2,1,"td",17),e.bVm(),e.qex(36,22),e.DNE(37,Wf,3,3,"th",16)(38,Hf,2,1,"td",17),e.bVm(),e.qex(39,23),e.DNE(40,Kf,1,0,"th",16)(41,Zf,3,3,"td",17),e.bVm(),e.DNE(42,eg,1,0,"tr",24)(43,tg,1,0,"tr",25),e.k0s(),e.nrm(44,"mat-paginator",26,0),e.k0s(),e.DNE(46,ng,5,3,"p",27),e.k0s()()}2&i&&(e.R7$(3),e.JRh(e.bMT(4,13,"evaluation.examAndEvaluation")),e.R7$(5),e.SpI(" ",e.bMT(10,17,e.bMT(9,15,"manual"))," "),e.R7$(5),e.Y8G("routerLink",e.eq3(21,Gf,a.courseId)),e.R7$(2),e.SpI(" ",e.bMT(16,19,"backToOverview")," "),e.R7$(2),e.vxM(null!=a.results&&null!=a.results.data&&a.results.data.length?17:-1),e.R7$(2),e.Y8G("ngClass",e.eq3(23,Df,!(null!=a.results&&null!=a.results.data&&a.results.data.length))),e.R7$(),e.Y8G("dataSource",a.results),e.R7$(22),e.Y8G("matHeaderRowDef",a.displayedColumns),e.R7$(),e.Y8G("matRowDefColumns",a.displayedColumns),e.R7$(),e.Y8G("hidePageSize",!0)("showFirstLastButtons",!0)("pageSize",a.maxVisibleItems),e.R7$(2),e.Y8G("ngIf",!(null!=a.results&&null!=a.results.data&&a.results.data.length)))},dependencies:[u.YU,u.bT,we.k,b.Zl,b.tL,b.ji,b.cC,b.YV,b.iL,b.KS,b.$R,b.YZ,b.NB,ve.iy,E.It,E.$z,O.Wk,Te,u.PV,m.D9,je.O],styles:[".task-h-150[_ngcontent-%COMP%]{width:var(--size-150
3px)}.back-to[_ngcontent-%COMP%]{cursor:pointer;font-size:var(--font-size-112)}.hide[_ngcontent-%COMP%]{display:none}.c-p[_ngcontent-%COMP%]{cursor:pointer}.table-container[_ngcontent-%COMP%]{max-width:var(--size-100-percent);overflow-x:auto}\n\n/*# sourceMappingURL=teacher-exam-results-overview.component.css.map*/"]}),o})(),ig=(()=>{var t;class o{constructor(i,a,s,r,l){this.teacherExamService=i,this.teacherService=a,this.route=s,this.toastrService=r,this.translateService=l}ngOnInit(){this.targetExamId=+this.route.snapshot.firstChild.params.examId,this.targetExamId||this.toastrService.error(this.translateService.instant("teacherExamInvalidId")),this.course$=this.teacherService.getCurrentCourse().subscribe(i=>{this.courseId=+i.id}),this.targetExamId&&this.teacherExamService.setExamResults(this.courseId,this.targetExamId)}ngOnDestroy(){this.course$&&this.course$.unsubscribe(),this.teacherExamService.emptyResultList(),this.teacherExamService.unsubscribeFromExamList()}}return(t=o).\u0275fac=function(i){return new(i||t)(e.rXU(De.V),e.rXU(S.O),e.rXU(O.nX),e.rXU(w.tw),e.rXU(m.c$))},t.\u0275cmp=e.VBU({type:t,selectors:[["app-teacher-exam-results"]],decls:1,vars:0,template:function(i,a){1&i&&e.nrm(0,"router-outlet")},dependencies:[O.n3]}),o})();var ot=f(53777),ag=f(89323);const un=(t,o)=>["/teacher/ecampus/exam/",t,"results",o],og=t=>({left:t,right:""}),Tt=(t,o)=>({left:t,right:o});function sg(t,o){if(1&t&&(e.j41(0,"div")(1,"app-assignment-check-answer",29),e.nrm(2,"span",30),e.k0s()()),2&t){const n=o.$implicit;e.R7$(),e.Y8G("checked",n.checked),e.R7$(),e.Y8G("innerHTML",n.label,e.npT)}}function rg(t,o){if(1&t&&(e.j41(0,"div")(1,"app-assignment-check-answer",29),e.nrm(2,"span",31),e.k0s()()),2&t){const n=o.$implicit;e.R7$(),e.Y8G("checked",!0),e.R7$(),e.Y8G("innerHTML",n,e.npT)}}function lg(t,o){if(1&t&&(e.j41(0,"div")(1,"mat-card",19)(2,"mat-card-header",20)(3,"div",21)(4,"span",22),e.EFF(5),e.nI1(6,"translate"),e.nI1(7,"translate"),e.nrm(8,"span",23),e.k0s(),e.j41(9,"span",24),e.EFF(10),e.k0s()()(),e.j41(11,"mat-card-content",25)(12,"p")(13,"strong",26),e.EFF(14),e.nI1(15,"translate"),e.nI1(16,"translate"),e.k0s()(),e.j41(17,"div",27),e.DNE(18,sg,3,2,"div",13),e.k0s(),e.j41(19,"div",28)(20,"div",26)(21,"p")(22,"strong"),e.EFF(23),e.nI1(24,"translate"),e.nI1(25,"translate"),e.k0s()(),e.DNE(26,rg,3,2,"div",13),e.k0s()()(),e.nrm(27,"hr",16),e.j41(28,"mat-card-footer",25)(29,"p",16)(30,"strong"),e.EFF(31),e.nI1(32,"translate"),e.nI1(33,"translate"),e.k0s(),e.EFF(34),e.nI1(35,"translate"),e.nI1(36,"translate"),e.k0s()()()()),2&t){const n=o.$implicit,i=o.index;e.R7$(5),e.Lme(" ",e.bMT(6,15,"question")," ",e.i5U(7,17,"typography.dash",e.eq3(37,og,i+1)),""),e.R7$(3),e.Y8G("innerHTML",n.question,e.npT),e.R7$(2),e.SpI(" ",n.title," "),e.R7$(4),e.Lme("",e.bMT(15,20,"answerStudent"),"",e.bMT(16,22,"typography.colon"),""),e.R7$(4),e.Y8G("ngForOf",n.answers),e.R7$(5),e.Lme("",e.bMT(24,24,"correctAnswer"),"",e.bMT(25,26,"typography.colon"),""),e.R7$(3),e.Y8G("ngForOf",n.correctAnswer),e.R7$(5),e.E5c("",e.bMT(32,28,"score")," ",e.bMT(33,30,"question")," ",i+1,""),e.R7$(3),e.Lme("",e.bMT(35,32,"typography.colon"),"",e.i5U(36,34,"typography.slash",e.l_i(39,Tt,n.answerPoints,n.maxPoints))," ")}}function cg(t,o){if(1&t&&(e.j41(0,"mat-card-content",25)(1,"p")(2,"strong"),e.EFF(3),e.nI1(4,"translate"),e.nI1(5,"translate"),e.k0s(),e.EFF(6),e.nI1(7,"translate"),e.k0s(),e.j41(8,"p")(9,"strong"),e.EFF(10),e.nI1(11,"translate"),e.nI1(12,"translate"),e.k0s(),e.EFF(13),e.nI1(14,"translate"),e.k0s()()),2&t){const n=e.XpG(2);e.R7$(3),e.Lme("",e.bMT(4,6,"studentPoints"),"",e.bMT(5,8,"typography.colon"),""),e.R7$(3),e.SpI(" ",e.i5U(7,10,"typography.slash",e.l_i(20,Tt,n.studentResult.allPoints,n.studentResult.totalPoints))," "),e.R7$(4),e.Lme("",e.bMT(11,13,"questions"),"",e.bMT(12,15,"typography.colon"),""),e.R7$(3),e.SpI(" ",e.i5U(14,17,"typography.slash",e.l_i(23,Tt,n.studentResult.numberCorrectAnsweredQuestions,n.studentResult.numberQuestions))," ")}}function mg(t,o){if(1&t&&(e.j41(0,"div",12),e.DNE(1,lg,37,42,"div",13),e.j41(2,"div")(3,"mat-card",14)(4,"mat-card-header",15),e.EFF(5),e.nI1(6,"translate"),e.k0s(),e.nrm(7,"hr",16),e.DNE(8,cg,15,26,"mat-card-content",17),e.k0s()(),e.j41(9,"a",8),e.nrm(10,"i",18),e.EFF(11),e.nI1(12,"translate"),e.k0s()()),2&t){const n=e.XpG();
3e.R7$(),e.Y8G("ngForOf",n.studentResult.answers),e.R7$(4),e.JRh(e.bMT(6,5,"evaluation.evaluation")),e.R7$(3),e.Y8G("ngIf",n.studentResult),e.R7$(),e.Y8G("routerLink",e.l_i(9,un,n.courseId,n.targetExamId)),e.R7$(2),e.SpI(" ",e.bMT(12,7,"backToOverview")," ")}}function pg(t,o){1&t&&(e.j41(0,"p",32),e.nrm(1,"i",33),e.j41(2,"span",34),e.EFF(3),e.nI1(4,"translate"),e.k0s()()),2&t&&(e.R7$(3),e.JRh(e.bMT(4,1,"teacherExamResultsEmpty")))}const _g=[{path:"",component:Pe.w,children:[{path:"",redirectTo:"profile",canDeactivate:[ie],pathMatch:"full"},{path:"profile",component:cf,canDeactivate:[ie]},{path:"cv",component:Dp,canDeactivate:[ie]},{path:"courses",component:ap,canDeactivate:[ie]},{path:"ecampus",component:Jp,children:[{path:"",pathMatch:"full",redirectTo:"courses"},{path:":id",component:Hm,canDeactivate:[ie]},{path:"attend/:id",component:ql,canDeactivate:[ie]},{path:"virtual-room/:id",component:$f,canDeactivate:[ie]},{path:"exam/:id",component:dt,canDeactivate:[ie],data:{state:"exam"},children:[{path:"",component:pt,pathMatch:"full"},{path:"edit/:id",component:lt},{path:"results",component:ig,children:[{path:"",component:dn,pathMatch:"full"},{path:":examId",component:dn},{path:":examId/:solvingId",component:(()=>{var t;class o{constructor(i,a,s,r){this.teacherExamService=i,this.teacherService=a,this.route=s,this.translateService=r,this.studentResult=null}ngOnInit(){this.examId$=this.route.params.subscribe(i=>{i.examId&&(this.targetExamId=+i.examId),i.solvingId&&(this.solvingId=+i.solvingId)}),this.course$=this.teacherService.getCurrentCourse().subscribe(i=>{this.courseId=+i.id,this.teacherService.setBackBtnRoute(["/teacher/ecampus/exam/",this.courseId,"results",this.targetExamId])}),this.currentExam$=this.teacherExamService.getExamFromCurrentExamList(this.targetExamId).subscribe(i=>{i&&(this.selectedExam=i)}),this.teacherExamService.getExamResult(this.solvingId,this.courseId,this.targetExamId).pipe((0,R.T)(i=>{var a;return(null==i||null===(a=i.body)||void 0===a?void 0:a.data)||null})).subscribe(i=>{if(!i)return this.studentResult=i;i&&i.answers&&i.answers.length&&(i.answers=i.answers.map(a=>("trueFalse"===a.type&&(a.answers=a.answers.map(s=>this.translateService.instant(s.toLowerCase()))),a.correctAnswer=a.correctAnswer&&a.correctAnswer.length?[].concat(a.correctAnswer).map(s=>a.answers[parseInt(s)]):[],a.studentAnswer=a.studentAnswer&&a.studentAnswer.length?[].concat(a.studentAnswer).map(s=>parseInt(s)):[],a.answers=a.answers&&a.answers.length?a.answers.map((s,r)=>({label:s,checked:!!a.studentAnswer.includes(r)})):[],a))),this.studentResult=i}),this.subs$=[this.examId$,this.currentExam$,this.course$]}openTeacherExamManual(){this.teacherExamService.openExamManual()}ngOnDestroy(){this.subs$&&this.subs$.length&&this.subs$.forEach(i=>i.unsubscribe())}}return(t=o).\u0275fac=function(i){return new(i||t)(e.rXU(De.V),e.rXU(S.O),e.rXU(O.nX),e.rXU(m.c$))},t.\u0275cmp=e.VBU({type:t,selectors:[["app-teacher-exam-student-results"]],decls:19,vars:17,consts:[["appBgColor","",1,"row","py-3","mb-3"],[1,"col-12","d-flex","justify-content-between","align-items-center"],[1,"mb-0","text-white"],["mat-button","","color","background",3,"click"],[1,"fas","fa-question-circle"],[1,"m-0","d-inline"],[1,"row","pb-4"],[1,"col-12"],["type","button","mat-raised-button","","color","primary",1,"mb-3","text-uppercase",3,"routerLink"],[1,"fa-solid","fa-angle-left","mr-2"],["class","examResult",4,"ngIf"],["class","text-center",4,"ngIf"],[1,"examResult"],[4,"ngFor","ngForOf"],[1,"my-3","evaluation-box"],[1,"title-color","font-weight-bold","p-3"],[1,"m-0"],["class","p-3",4,"ngIf"],[1,"mr-2","fas","fa-angle-left","text-white"],[1,"my-3"],["appBgColor","",1,"p-3"],[1,"question-header"],[1,"question-title","text-white"],[1,"pre-wrap",3,"innerHTML"],[1,"question-text","text-white"],[1,"p-3"],[1,"mt-3"],[1,"answers-box"],[1,"correct-box"],[3,"checked"],[1,"answer-content",3,"innerHTML"],[3,"innerHTML"],[1,"text-center"],[1,"fas","fa-exclamation-circle","mr-2"],[1,"uppercase-first-letter"]],template:function(i,a){1&i&&(e.j41(0,"div",0)(1,"div",1)(2,"h5",2),e.EFF(3),e.nI1(4,"translate"),e.k0s(),e.j41(5,"button",3),e.bIt("click",function(){return a.openTeacherExamManual()}),e.nrm(6,"i",4),e.j41(7,"h5",5),e.EFF(8),e.nI1(9,"translate"),e.nI1(10,"titlecase"),e.k0s()()()(),e.j41(11,"div",6)(12,"div",7)(13,"a",8),e.nrm(14,"i",9),e.EFF(15),e.nI1(16,"translate"),e.k0s(),e.DNE(17,mg,13,12,"div",10)(18,pg,5,3,"p",11),e.k0s()()),2&i&&(e.R7$(3),e.JRh(e.bMT(4,6,"evaluation.examAndEvaluation")),e.R7$(5),e.SpI(" ",e.bMT(10,10,e.bMT(9,8,"manual"))," "),e.R7$(5),e.Y8G("routerLink",e.l_i(14,un,a.courseId,a.targetExamId)),e.R7$(2),e.SpI(" ",e.bMT(16,12,"backToOverview")," "),e.R7$(2),e.Y8G("ngIf",!!a.studentResult&&!(null==a.studentResult||!a.studentResult.answers
3)&&!(null==a.studentResult||!a.studentResult.answers.length)),e.R7$(),e.Y8G("ngIf",!a.studentResult||!!a.studentResult.answers&&!a.studentResult.answers.length))},dependencies:[u.Sq,u.bT,we.k,E.It,E.$z,ot.RN,ot.m2,ot.WQ,ot.MM,ag.z,O.Wk,u.PV,m.D9],styles:[".open-manual-link[_ngcontent-%COMP%] h5[_ngcontent-%COMP%]{display:flex;gap:var(--space-1rem);justify-content:center;align-items:center}.evaluation-box[_ngcontent-%COMP%]{background:var(--color-tint-4)}.question-header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:var(--space-1rem)}\n\n/*# sourceMappingURL=teacher-exam-student-results.component.css.map*/"]}),o})()}]},{path:"",component:et,children:[{path:"preview/:examId",component:wf},{path:"evaluation",component:Ze}]}]},{path:"task/:id",component:dt,canDeactivate:[ie],data:{state:"task"},children:[{path:"",component:pt,pathMatch:"full"},{path:"",component:et,children:[{path:"evaluation",component:Ze},{path:"evaluation/:assignmentId/:solvingId",component:mt}]},{path:"edit/:id",component:lt}]},{path:"exercise/:id",component:dt,canDeactivate:[ie],data:{state:"exercise"},children:[{path:"",component:pt,pathMatch:"full"},{path:"",component:et,children:[{path:"evaluation",component:Ze},{path:"evaluation/:assignmentId/:solvingId",component:mt}]},{path:"edit/:id",component:lt}]},{path:"materials/:id",component:tm,canDeactivate:[ie]},{path:"documents/:id",component:rn,canDeactivate:[ie]},{path:"tutorials/:id",component:Jh,canDeactivate:[ie]}]},{path:"preferences",component:rf,canDeactivate:[ie]},{path:"virtual-room-empty",component:pf,canDeactivate:[ie]},{path:"invoices",component:Z1,canDeactivate:[ie],children:[{path:"",component:K1},{path:"settings",component:d1}]},{path:"invitations",component:Ru,canDeactivate:[ie]},{path:"agenda",component:Qe.S,canDeactivate:[ie],data:{type:"teacher"}},{path:"communication",component:Ve.y,children:[{path:"",component:$e.p,pathMatch:"full"},{path:de.G.sent,component:$e.p,data:{activeTab:de.G.sent}},{path:"message/:messageId",component:Ye.w},{path:"message/sent/:messageId",component:Ye.w,data:{messageType:de.G.sent}},{path:"companymessage/:messageId",component:Ye.w,data:{messageType:de.G.newsletter}}]},{path:"",component:(()=>{var t;class o{}return(t=o).\u0275fac=function(i){return new(i||t)},t.\u0275cmp=e.VBU({type:t,selectors:[["app-fullscreen-layout"]],decls:2,vars:0,template:function(i,a){1&i&&e.nrm(0,"app-close-fullscreen")(1,"router-outlet")},dependencies:[O.n3,nn],encapsulation:2}),o})(),children:[{path:"correction",canDeactivate:[ie],component:Ul,children:[{path:"",component:et,children:[{path:"",component:Ze},{path:":assignmentType/:assignmentId/:solvingId",component:mt}]}]}]}]},{path:"**",redirectTo:"courses"}];let hg=(()=>{var t;class o{}return(t=o).\u0275fac=function(i){return new(i||t)},t.\u0275mod=e.$C({type:t}),t.\u0275inj=e.G2t({imports:[O.iI.forChild(_g),O.iI]}),o})();const fg=[Te,F.C];let gg=(()=>{var t;class o{}return(t=o).\u0275fac=function(i){return new(i||t)},t.\u0275mod=e.$C({type:t}),t.\u0275inj=e.G2t({providers:[_e.v],imports:[_.G,hg,G.r,Le.n,fg]}),o})()},70887:Ct=>{function Je(f,G){"use strict";this.wndw=G&&G.window?G.window:window,this.tableAutoSize=!(!G||"boolean"!=typeof G.tableAutoSize)&&G.tableAutoSize,this.imagesByReference=!(!G||"boolean"!=typeof G.imagesByReference)&&G.imagesByReference,this.removeExtraBlanks=!(!G||"boolean"!=typeof G.removeExtraBlanks)&&G.removeExtraBlanks,this.showHidden=!(!G||"boolean"!=typeof G.showHidden)&&G.showHidden,this.removeTagClasses=!(!G||"boolean"!=typeof G.removeTagClasses)&&G.removeTagClasses,this.ignoreStyles=G&&Array.isArray(G.ignoreStyles)?G.ignoreStyles:[];var Le=Math.random().toString(36).slice(2,8);this.fontSizes=G&&Array.isArray(G.fontSizes)?G.fontSizes:[10,14,16,18,20,24,28],this.defaultStyles={b:{bold:!0},strong:{bold:!0},u:{decoration:"underline"},del:{decoration:"lineThrough"},s:{decoration:"lineThrough"},em:{italics:!0},i:{italics:!0},h1:{fontSize:24,bold:!0,marginBottom:5},h2:{fontSize:22,bold:!0,marginBottom:5},h3:{fontSize:20,bold:!0,marginBottom:5},h4:{fontSize:18,bold:!0,marginBottom:5},h5:{fontSize:16,bold:!0,marginBottom:5},h6:{fontSize:14,bold:!0,marginBottom:5},a:{color:"blue",decoration:"underline"},strike:{decoration:"lineThrough"},p:{margin:[0,5,0,10]},ul:{marginBottom:5,marginLeft:5},table:{marginBottom:5},th:{bold:!0,fillColor:"#EEEEEE"}},this.imagesRef=[],this.changeDefaultStyles=function(){for(var _ in G.defaultStyles)if(this.defaultStyles.hasOwnProperty(_))if(G.defaultStyles.hasOwnProperty(_)&&!G.defaultStyles[_])delete this.defaultStyles[_];else for(var F in G.defaultStyles[_])""===G.defaultStyles[_][F]?delete this.defaultStyles[_][F]:this.defaultStyles[_][F]=G.defaultStyles[_][F];else for(var u in this.defaultStyles[_]={},G.defaultStyles[_])this.defaultStyles[_][u]=G.defaultStyles[_][u]},G&&G.defaultStyles&&this.changeDefaultStyles(),this.convertHtml=function(_){var F=new this.wndw.DOMParser;this.removeExtraBlanks&&(_=_.replace(/(<\/?(div|p|h1|h2|h3|h4|h5|h6|ol|ul|li)([^>]+)?>)\s+(<\/?(div|p|h1|h2|h3|h4|h5|h6|ol|ul|li))/gi,"$1$4").replace(/(<\/?(div|p|h1|h2|h3|h4|h5|h6|ol|ul|li)([^>]+)?>)\s+(<\/?(div|p|h1|h2|h3|h4|h5|h6|ol|ul|li))/gi,"$1$4").replace(/(<td([^>]+)?>)\s+(<table)/gi,"$1$3").replace(/(<\/table>)\s+(<\/td>)/gi,"$1$2"));var u=F.parseFromString(_,"text/html"),e=this.parseElement(u.body,[]);return e.stack||e.text},this.parseElement=function(_,F){var w,V,R,j,u=_.nodeName.toUpperCase(),e=u.toLowerCase(),m={text:[]},D=this;if(["COLGROUP","COL"].indexOf(u)>-1)return"";switch(_.nodeType){case 3:if(_.textContent){w=_.textContent;var x=this.parseStyle(F[F.length-1],!0),le=F.findIndex(function(q){return"PRE"===q.nodeName})>-1;for(R=0;R<x.length;R++)if("preserveLeadingSpaces"===x[R].key){le=x[R].value;break}if(le||(w=w.replace(/\s*\n\s*/g," ")),G&&"function"==typeof G.replaceText&&(w=G.replaceText(w,F)),["TABLE","THEAD","TBODY","TFOOT","TR","UL","OL"].indexOf(F[F.length-1].nodeName)>-1&&(w=w.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")),w)return m=this.applyStyle({ret:m={text:w},parents:F})}return"";case 1:if(!this.showHidden&&_.style.display&&"none"===_.style.display||_.style.visibility&&"hidden"===_.style.visibility)return;switch(m.nodeName=u,_.id&&(m.id=_.id),F.push(_),_.childNodes&&_.childNodes.length>0&&([].forEach.call(_.childNodes,function(q){var T=D.parseElement(q,F);T&&(Array.isArray(T.text)&&0===T.text.length&&(T.text=""),m.text.push(T))}),this.searchForStack(m)?(m.stack=m.text.slice(0),delete m.text):m=this.applyStyle({ret:m,parents:F})),F.pop(),u){case"TABLE":var Z;m.table={body:[]};var pe=m.stack||m.text;if(Array.isArray(pe)){Z=0;var I=!1;if(pe.forEach(function(q){var T=q.stack||q.text;Array.isArray(T)&&T.forEach(function(S){var W=S.stack||S.text;Array.isArray(W)&&(m.table.body[Z]=[],W.forEach(function(ee){if(m.table.body[Z].push(ee),ee.colSpan>1)for(R=ee.colSpan;--R>0;)m.table.body[Z].push({text:""});ee.rowSpan>1&&(I=!0)}),Z++)})}),I){var L=m.table.body[0];if(Array.isArray(L))for(var C=L.length,E=m.table.body.length,X=0;X<C;X++)for(var te=0;te<E;te++){var fe=m.table.body[te];if(Array.isArray(fe)){var Te=fe[X];if(Te.rowSpan>1){for(var Qe,O=Te.rowSpan,Ye=Te.colSpan?Te.colSpan:1,$e=1;$e<=O-1;$e++)if(Qe=Ye,m.table.body[te+$e])for(;Qe--;)m.table.body[te+$e].splice(X,0,{text:""});else Te.rowSpan--;te+=O-1}}}}}if(delete m.stack,delete m.text,m=this.applyStyle({ret:m,parents:F.concat([_])}),this.tableAutoSize){var Ve=[],Pe=[],de=[],g=[],b="100%"===_.getAttribute("width")||"100%"===_.style.width,ke=_.getAttribute("width")||"",oe=(_.style.width||ke).endsWith("%");if(oe)var Y=(_.style.width||ke).replace(/[^0-9.]/g,"");for(var me=!1,c=-1,B=0;B<_.children.length;B++)me||c++,"COLGROUP"===_.children[B].nodeName.toUpperCase()&&(me=!0);
3m.table.body.forEach(function(q,T){Ve.push([]),Pe.push([]),q.forEach(function(S,W){var ee=typeof S.width<"u"?S.width:"auto";"*"===ee&&(ee="auto");var ne=typeof S.height<"u"?S.height:"auto";if("*"===ne&&(ne="auto"),"auto"!==ee&&S.colSpan>1&&(isNaN(ee)?ee="auto":ee/=S.colSpan),"auto"!==ne&&S.rowSpan>1&&(isNaN(ne)?ne="auto":ne/=S.rowSpan),me){var Me=_.children[c].children[W];if(Me){var xe=Me.getAttribute("width")||"",Ie=Me.style.width;(xe||Ie).endsWith("%")&&(ee=xe||Ie)}}Ve[T].push(ee),Pe[T].push(ne)})}),Ve.forEach(function(q){q.forEach(function(T,S){var W=typeof de[S];if("undefined"===W||"auto"!==T&&"number"===W&&T>de[S]||"auto"!==T&&"auto"===de[S]){if(oe){var ee="auto"===T?Y/q.length:T.toString().replace("%","")*Y/100;T=String(ee)+"%"}de[S]=T}})}),Pe.forEach(function(q,T){q.forEach(function(S){var W=typeof g[T];("undefined"===W||"auto"!==S&&"number"===W&&S>g[T]||"auto"!==S&&"auto"===g[T])&&(g[T]=S)})}),de.length>0&&(b&&(de=de.map(function(q){return"auto"===q?"*":q})),m.table.widths=de),g.length>0&&(m.table.heights=g)}if(_.dataset&&_.dataset.pdfmake){V=_.dataset.pdfmake.replace(/'/g,'"');try{for(j in V=JSON.parse(V))"layout"===j?m.layout=V[j]:m.table[j]=V[j]}catch(q){console.error(q)}}break;case"TH":case"TD":_.getAttribute("rowspan")&&(m.rowSpan=1*_.getAttribute("rowspan")),_.getAttribute("colspan")&&(m.colSpan=1*_.getAttribute("colspan")),m=this.applyStyle({ret:m,parents:F.concat([_])});break;case"SVG":m={svg:_.outerHTML.replace(/\n(\s+)?/g,""),nodeName:"SVG"},this.removeTagClasses||(m.style=["html-svg"]);break;case"BR":m.text=[{text:"\n"}];break;case"SUB":case"SUP":m[u.toLowerCase()]={offset:"30%",fontSize:8};break;case"HR":var ce={width:514,type:"line",margin:[0,12,0,12],thickness:.5,color:"#000000",left:0};if(_.dataset&&_.dataset.pdfmake){V=_.dataset.pdfmake.replace(/'/g,'"');try{for(j in V=JSON.parse(V))ce[j]=V[j]}catch(q){console.error(q)}}m.margin=ce.margin,m.canvas=[{type:ce.type,x1:ce.left,y1:0,x2:ce.width,y2:0,lineWidth:ce.thickness,lineColor:ce.color}],delete m.text;break;case"OL":case"UL":switch(m[e]=(m.stack||m.text).slice(0),delete m.stack,delete m.text,m=this.applyStyle({ret:m,parents:F.concat([_])}),_.getAttribute("start")&&(m.start=1*_.getAttribute("start")),_.getAttribute("type")){case"A":m.type="upper-alpha";break;case"a":m.type="lower-alpha";break;case"I":m.type="upper-roman";break;case"i":m.type="lower-roman"}(m.listStyle||m.listStyleType)&&(m.type=m.listStyle||m.listStyleType);break;case"LI":m.stack&&!m.stack[m.stack.length-1].text&&(w=m.stack.slice(0,-1),m=[Array.isArray(w)&&w.filter(function(q){return!q.text}).length>0?{stack:w}:{text:w},m.stack[m.stack.length-1]]),Array.isArray(m)&&(m={stack:m});break;case"PRE":m.preserveLeadingSpaces=!0;break;case"IMG":if(this.imagesByReference){var P=_.getAttribute("data-src")||_.getAttribute("src"),Ce=this.imagesRef.indexOf(P);Ce>-1?m.image="img_ref_"+Le+Ce:(m.image="img_ref_"+Le+this.imagesRef.length,this.imagesRef.push(P))}else m.image=_.getAttribute("src");delete m.stack,delete m.text,m=this.applyStyle({ret:m,parents:F.concat([_])});break;case"A":_.getAttribute("href")&&(m=function q(T,S){return T=T||{text:""},Array.isArray(T.text)?(T.text=T.text.map(function(W){return q(W,S)}),T):Array.isArray(T.stack)?(T.stack=T.stack.map(function(W){return q(W,S)}),T):(0===S.indexOf("#")?T.linkToDestination=S.slice(1):T.link=S,T)}(m,_.getAttribute("href")),Array.isArray(m.text)&&1===m.text.length&&(m=m.text[0]),m.nodeName="A");break;default:"DIV"===u&&_.dataset&&"columns"===_.dataset.pdfmakeType&&m.stack&&(m.columns=m.stack,delete m.stack)}if(G&&"function"==typeof G.customTag&&(m=G.customTag.call(this,{element:_,parents:F,ret:m})),Array.isArray(m.text)&&1===m.text.length&&m.text[0].text&&!m.text[0].nodeName&&(m.text=m.text[0].text),(F.length>0&&"LI"===F[F.length-1].nodeName||"LI"===u)&&(Array.isArray(m.text)&&0===m.text.length||"string"==typeof m.text&&""===m.text)&&(m.text=" "),-1===["HR","TABLE"].indexOf(u)&&_.dataset&&_.dataset.pdfmake){V=_.dataset.pdfmake.replace(/'/g,'"');try{for(j in V=JSON.parse(V))m[j]=V[j]}catch(q){console.error(q)}}return m}},this.searchForStack=function(_){if(Array.isArray(_.text))for(var F=0;F<_.text.length;F++)if(_.text[F].stack||["P","DIV","TABLE","SVG","UL","OL","IMG","H1","H2","H3","H4","H5","H6"].indexOf(_.text[F].nodeName)>-1||!0===this.searchForStack(_.text[F]))return!0;return!1},this.applyStyle=function(_){var F=[],u=_.parents.length-1,e=this;
3return _.parents.forEach(function(m,w){var y=m.nodeName.toLowerCase();if(!e.removeTagClasses){var V="html-"+y;"html-body"!==V&&-1===F.indexOf(V)&&F.unshift(V)}(m.getAttribute("class")||"").split(" ").forEach(function(x){x&&F.push(x)});var j,D=w!==u;if(e.defaultStyles[y])for(j in e.defaultStyles[y])e.defaultStyles[y].hasOwnProperty(j)&&(!D||D&&-1===j.indexOf("margin")&&-1===j.indexOf("border"))&&("decoration"===j?(Array.isArray(_.ret[j])||(_.ret[j]=[]),e.defaultStyles[y][j]&&-1===_.ret[j].indexOf(e.defaultStyles[y][j])&&_.ret[j].push(e.defaultStyles[y][j])):_.ret[j]=JSON.parse(JSON.stringify(e.defaultStyles[y][j])));"tr"===y&&(D=!1),(j=e.parseStyle(m,D)).forEach(function(x){if("decoration"===x.key)Array.isArray(_.ret[x.key])||(_.ret[x.key]=[]),_.ret[x.key].push(x.value);else if(!["UL","OL"].includes(_.ret.nodeName)||"alignment"!==x.key)if(_.ret.margin&&0===x.key.indexOf("margin"))switch(x.key){case"marginLeft":_.ret.margin[0]=x.value;break;case"marginTop":_.ret.margin[1]=x.value;break;case"marginRight":_.ret.margin[2]=x.value;break;case"marginBottom":_.ret.margin[3]=x.value}else _.ret[x.key]=x.value})}),F.length>0&&(_.ret.style=F),_.ret},this.borderValueRearrange=function(_){try{var F=_.split(" ");if(3!==F.length)return _;var u="0px",e="none",m="transparent",w=["dotted","dashed","solid","double","groove","ridge","inset","outset","none","hidden","mix"];return F.forEach(function(y){y.match(/^\d/)?u=y:w.indexOf(y)>-1?e=y:m=y}),u+" "+e+" "+m}catch(y){return _}},this.parseStyle=function(_,F){var u=_.getAttribute("style")||"",e=[];u=u.replace(/!important/g,"").split(";");var m=_.getAttribute("width"),w=_.getAttribute("height");m&&u.unshift("width:"+this.convertToUnit(m+(isNaN(m)?"":"px"))),w&&u.unshift("height:"+this.convertToUnit(w+(isNaN(w)?"":"px")));var y=_.getAttribute("color");y&&e.push({key:"color",value:this.parseColor(y).color});var V=_.getAttribute("size");null!==V&&(V=Math.min(Math.max(1,parseInt(V)),7),e.push({key:"fontSize",value:Math.max(this.fontSizes[0],this.fontSizes[V-1])}));var R=u.map(function(I){return I.toLowerCase().split(":")}),j=[],D=_.nodeName.toUpperCase(),x=this;if(R.forEach(function(I){if(2===I.length){var E,L=I[0].trim().toLowerCase(),C=I[1].trim();if(-1===x.ignoreStyles.indexOf(L))switch(L){case"margin":if(F)break;1===(C=C.split(" ")).length?C=[C[0],C[0],C[0],C[0]]:2===C.length?C=[C[1],C[0]]:3===C.length?C=[C[1],C[0],C[1],C[2]]:4===C.length&&(C=[C[3],C[0],C[1],C[2]]),C.forEach(function(te,fe){C[fe]="auto"===te?"":x.convertToUnit(te)}),-1===C.indexOf(!1)&&e.push({key:L,value:C});break;case"line-height":C="string"==typeof C&&"%"===C.slice(-1)?C.slice(0,-1)/100:x.convertToUnit(C),e.push({key:"lineHeight",value:C});break;case"text-align":e.push({key:"alignment",value:C});break;case"font-weight":e.push("bold"===C||C>=700?{key:"bold",value:!0}:{key:"bold",value:!1});break;case"text-decoration":C=x.toCamelCase(C),["underline","lineThrough","overline"].includes(C)&&e.push({key:"decoration",value:C});break;case"font-style":"italic"===C&&e.push({key:"italics",value:!0});break;case"font-family":e.push({key:"font",value:C.split(",")[0].replace(/"|^'|^\s*|\s*$|'$/g,"").replace(/^([a-z])/g,function(te){return te[0].toUpperCase()}).replace(/ ([a-z])/g,function(te){return te[1].toUpperCase()})});break;case"color":E=x.parseColor(C),e.push({key:"color",value:E.color}),E.opacity<1&&e.push({key:"opacity",value:E.opacity});break;case"background-color":"transparent"!==(E=x.parseColor(C)).color&&(e.push({key:"TD"===D||"TH"===D?"fillColor":"background",value:E.color}),E.opacity<1&&e.push({key:"TD"===D||"TH"===D?"fillOpacity":"opacity",value:E.opacity}));break;case"text-indent":e.push({key:"leadingIndent",value:x.convertToUnit(C)});break;case"white-space":e.push("nowrap"===C?{key:"noWrap",value:!0}:{key:"preserveLeadingSpaces",value:"break-spaces"===C||"pre"===C.slice(0,3)});break;default:if(0===L.indexOf("border"))F||j.push({key:L,value:C});else{if(F&&(0===L.indexOf("margin-")||"width"===L||"height"===L))break;if("IMG"===D&&("width"===L||"height"===L)){e.push({key:L,value:x.convertToUnit(C)});break}if(0===L.indexOf("padding"))break;if(L.indexOf("-")>-1&&(L=x.toCamelCase(L)),C){var X=x.convertToUnit(C);if("fontSize"===L&&!1===X){if(!["xx-small","x-small","small","medium","large","x-large","xx-large","xxx-large"].includes(C))break;switch(C){case"xx-small":C=7.2;break;case"x-small":C=9;break;case"small":C=10.7;break;case"medium":C=12;break;case"large":C=14.4;break;case"x-large":C=18;break;case"xx-large":C=24;break;case"xxx-large":C=36}}if(0===L.indexOf("margin")&&"auto"===C)break;e.push({key:L,value:!1===X?C:X})}}}}}),j.length>0){var le=[],Z=[];
3j.forEach(function(I){var C,L=-1;I.key.indexOf("-left")>-1?L=0:I.key.indexOf("-top")>-1?L=1:I.key.indexOf("-right")>-1?L=2:I.key.indexOf("-bottom")>-1&&(L=3);var X,te,E=I.key.split("-");if(1===E.length||2===E.length&&L>=0){if(I.value=x.borderValueRearrange(I.value),te=(X=I.value.split(" "))[0].replace(/(\d*)(\.\d+)?([^\d]+)/g,"$1$2 ").trim(),L>-1)le[L]=te>0;else for(C=0;C<4;C++)le[C]=te>0;if(X.length>2){var fe=X.slice(2).join(" ");if(L>-1)Z[L]=x.parseColor(fe).color;else for(C=0;C<4;C++)Z[C]=x.parseColor(fe).color}}else L>=0&&"color"===E[2]?Z[L]=x.parseColor(I.value).color:L>=0&&"width"===E[2]?le[L]=!/^0[a-z%]*$/.test(String(I.value)):"border-color"===I.key?(X=x.topRightBottomLeftToObject(I.value),Z=[x.parseColor(X.left).color,x.parseColor(X.top).color,x.parseColor(X.right).color,x.parseColor(X.bottom).color]):"border-width"===I.key&&(X=x.topRightBottomLeftToObject(I.value),le=[!/^0[a-z%]*$/.test(X.left),!/^0[a-z%]*$/.test(X.top),!/^0[a-z%]*$/.test(X.right),!/^0[a-z%]*$/.test(X.bottom)])});for(var pe=0;pe<4;pe++)le.length>0&&typeof le[pe]>"u"&&(le[pe]=!0),Z.length>0&&typeof Z[pe]>"u"&&(Z[pe]="#000000");le.length>0&&e.push({key:"border",value:le}),Z.length>0&&e.push({key:"borderColor",value:Z})}return e},this.toCamelCase=function(_){return _.replace(/-([a-z])/g,function(F){return F[1].toUpperCase()})},this.topRightBottomLeftToObject=function(_){var u=_.match(/#[0-9a-fA-F]{3,6}|\b(?:rgba?|hsla?)\([^)]*\)|\b[a-zA-Z]+\b/g)||[],e=u[0],m=u[1],w=u[2],y=u[3];switch(u.length){case 1:m=w=y=e;break;case 2:w=e,y=m;break;case 3:y=m}return{top:e,right:m,bottom:w,left:y}},this.hsl2rgb=function(_,F,u){var e=F*Math.min(u,1-u),m=function(y){var V=(y+_/30)%12;return Math.min(Math.floor(256*(u-e*Math.max(Math.min(V-3,9-V,1),-1))),255)};return"rgb("+m(0)+","+m(8)+","+m(4)+")"},this.parseColor=function(_){var y,V,R,F=1,u=new RegExp("^#([0-9a-f]{3}|[0-9a-f]{6})$","i"),e=/^rgba?\(\s*(\d+(\.\d+)?%?),\s*(\d+(\.\d+)?%?),\s*(\d+(\.\d+)?%?)(,\s*\d+(\.\d+)?)?\)$/,m=new RegExp("^hsl\\((\\d+(\\.\\d+)?%?),\\s*(\\d+(\\.\\d+)?%?),\\s*(\\d+(\\.\\d+)?%?)\\)$"),w=new RegExp("^[a-z]+$","i"),j=[];return u.test(_)?{color:_,opacity:F}:(m.test(_)&&(V=(y=m.exec(_).slice(1))[0].endsWith("%")?360*y[0].slice(0,-1)/100:1*y[0],j.push(V),j.push(y[2].slice(0,-1)/100),j.push(y[4].slice(0,-1)/100),_=this.hsl2rgb(j[0],j[1],j[2]),j=[]),e.test(_)?((y=e.exec(_).slice(1).filter(function(D,x){return x%2==0&&typeof D<"u"})).forEach(function(D,x){3===x?F=1*D.slice(1):(D.endsWith("%")?D=Math.round(255*D.slice(0,-1)/100):D*=1,D>255&&(D=255),R=(R="0"+D.toString(16)).slice(-2),j.push(R))}),{color:"#"+j.join(""),opacity:F}):(w.test(_)||console.error('Could not parse color "'+_+'"'),{color:_,opacity:F}))},this.convertToUnit=function(_){if(!isNaN(parseFloat(_))&&isFinite(_))return 1*_;var F=(_+"").trim().match(/^(-?\d*(\.\d+)?)(pt|px|r?em|cm|in)$/);if(!F)return!1;switch(_=F[1],F[3]){case"px":_=Math.round(.75292857248934*_);break;case"em":case"rem":_*=12;break;case"cm":_=Math.round(28.34646*_);break;case"in":_*=72}return 1*_};var _e=this.convertHtml(f);return"string"==typeof _e&&(_e={text:_e}),this.imagesByReference&&(_e={content:_e,images:{}},this.imagesRef.forEach(function(_,F){_e.images["img_ref_"+Le+F]=_.startsWith("{")?JSON.parse(_):_})),_e}Ct.exports=function(f,G){return new Je(f,G)}}}]); 4//# sourceMappingURL=6671.c91a7ecf8b392d8f.js.map 5//# debugId=a97cb137-f1d4-519a-b3a1-040ad3044843
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.