From 90494f9bec4ac5e51cde99d41ed3d54bbba7b86e Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 4 Jul 2024 11:26:24 +0000 Subject: [PATCH] Add webapp-schulverwaltung build fe13077f --- .../{chunk-RPNHXIUO.js => chunk-ONX2BRSQ.js} | 2 +- public/apps/webapp-schulverwaltung/main.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename public/apps/webapp-schulverwaltung/{chunk-RPNHXIUO.js => chunk-ONX2BRSQ.js} (75%) diff --git a/public/apps/webapp-schulverwaltung/chunk-RPNHXIUO.js b/public/apps/webapp-schulverwaltung/chunk-ONX2BRSQ.js similarity index 75% rename from public/apps/webapp-schulverwaltung/chunk-RPNHXIUO.js rename to public/apps/webapp-schulverwaltung/chunk-ONX2BRSQ.js index 70ee2060..ba810256 100644 --- a/public/apps/webapp-schulverwaltung/chunk-RPNHXIUO.js +++ b/public/apps/webapp-schulverwaltung/chunk-ONX2BRSQ.js @@ -1 +1 @@ -import{a as oi}from"./chunk-MGID7RWQ.js";import{a as di,b as pi}from"./chunk-RQFEXCIP.js";import{a as mi}from"./chunk-4EXGKTN3.js";import{a as ai}from"./chunk-JV3CBBGP.js";import"./chunk-U4HODSW3.js";import{a as tt,b as zt,c as qt,d as Yt,e as Kt,f as We,g as ze,h as Jt,i as Qt,j as Xt,k as Zt,l as ei,m as Ie,o as ti,p as me,s as ni,u as ri,v as qe}from"./chunk-W7ASLXRM.js";import"./chunk-PSXDSPKS.js";import"./chunk-C7XT5XXE.js";import"./chunk-YMJC6QZX.js";import{a as Nt}from"./chunk-Y4QYVF5K.js";import"./chunk-HII3S2DL.js";import{a as li}from"./chunk-K3EEKOGY.js";import{a as ci}from"./chunk-XLPJMZ3E.js";import"./chunk-24AFRN2G.js";import{a as Wt,d as ii}from"./chunk-RFO4NYUO.js";import"./chunk-5RDJZAUT.js";import"./chunk-DB66EACG.js";import{P as Vt,Y as si,t as jt}from"./chunk-ZK2MNT7Z.js";import{a as Ce,c as At,e as ye}from"./chunk-AW7CSGKI.js";import{a as Ut,b as Ue}from"./chunk-FTDG26ID.js";import{a as Q,b as Ht,c as Se}from"./chunk-SOHFFTKU.js";import{f as Ot,g as Gt,i as $t,j as Ft,p as Ve,u as Ne}from"./chunk-C56YGDXA.js";import{a as He}from"./chunk-UX5TA32W.js";import{$ as C,$a as u,$c as De,A as ot,Ab as l,B as dt,Bb as c,Bd as Dt,C as lt,Cb as G,E as ne,Eb as se,Fd as ie,G as K,Ga as f,Gb as bt,Gd as k,Hd as P,I as Ge,Ia as p,Id as Lt,J as pt,Ja as re,L as J,N as ct,O as D,Q as de,Qb as ae,Rb as ce,Sa as o,Sb as R,Ta as d,Ua as E,Va as W,Vb as j,Vc as _e,W as ge,Wa as z,Wb as $e,Ya as M,Yc as Be,Z as U,_a as _,_c as xe,a as B,ab as ht,ad as yt,b as H,ba as mt,bb as vt,ca as ut,cb as le,dc as Ct,dd as St,e as ee,ed as It,f as L,fd as Le,g as Ze,ga as fe,gd as Tt,ha as I,ia as T,ib as A,id as wt,jb as m,jd as Et,k as Y,ka as gt,kb as x,l as at,lb as h,m as b,mb as et,n as te,nd as Ae,oc as ve,od as je,pc as Fe,pd as kt,qa as ft,qc as Re,qd as Pt,ra as X,rc as oe,rd as be,sb as pe,sd as Mt,ta as ke,tb as y,ua as a,ub as _t,v as Oe,va as v,vb as O,w as Ee,wb as Pe,xb as he,yd as Rt,zb as xt,zd as Bt}from"./chunk-XTHSYQMN.js";var Ji=i=>[i,"tests"];function Qi(i,n){if(i&1&&(o(0,"span"),m(1),l(2,"date"),E(3,"wbr"),m(4),l(5,"date"),d()),i&2){let s=u();a(),h("",G(2,2,s.event.dateFrom,"dd.MM.yyyy"),"\u2013"),a(3),x(G(5,5,s.event.dateTo,"dd.MM.yyyy"))}}function Xi(i,n){if(i&1&&(o(0,"a",10)(1,"i",11),m(2,"arrow_right_alt"),d(),o(3,"span",12),m(4),d()()),i&2){let s=u(2);p("routerLink",O(2,Ji,s.event.id)),a(4),x(s.event.evaluationText)}}function Zi(i,n){if(i&1&&(o(0,"a",13)(1,"i",11),m(2,"arrow_right_alt"),d(),o(3,"span",12),m(4),d()()),i&2){let s=u(2);p("href",s.event.evaluationLink,ke),a(4),h("",s.event.evaluationText," ")}}function en(i,n){if(i&1&&(o(0,"div",7),f(1,Xi,5,4,"a",8)(2,Zi,5,2,"a",9),d()),i&2){let s=u();a(),p("ngIf",!s.event.evaluationLink),a(),p("ngIf",s.event.evaluationLink)}}var ui=(()=>{let n=class n{constructor(){this.withRatings=!0}};n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=C({type:n,selectors:[["bkd-events-list-entry"]],inputs:{event:"event",withRatings:"withRatings"},standalone:!0,features:[y],decls:11,vars:8,consts:[[1,"designation"],[3,"href"],[1,"date"],[4,"ngIf"],[1,"registrations"],[1,"registrations-label"],["class","rating",4,"ngIf"],[1,"rating"],["class","d-flex",3,"routerLink",4,"ngIf"],["class","d-flex",3,"href",4,"ngIf"],[1,"d-flex",3,"routerLink"],[1,"material-icons"],[1,"ps-1"],[1,"d-flex",3,"href"]],template:function(t,r){t&1&&(o(0,"div",0)(1,"a",1),m(2),d()(),o(3,"div",2),f(4,Qi,6,8,"span",3),d(),o(5,"div",4),m(6),o(7,"span",5),m(8),l(9,"translate"),d()(),f(10,en,3,2,"div",6)),t&2&&(a(),p("href",r.event.detailLink,ke),a(),x(r.event.designation),a(2),p("ngIf",r.event.dateFrom&&r.event.dateTo),a(2),h(" ",r.event.studentCount," "),a(2),x(c(9,6,r.event.studentCount===1?"events.registration":"events.registrations")),a(2),p("ngIf",r.withRatings&&r.event.evaluationText))},dependencies:[R,oe,$e,P,k],styles:['[_nghost-%COMP%]{display:grid;padding:1rem;border-bottom:1px solid #dee2e6;grid-template-areas:"designation date registrations rating";grid-template-columns:4fr 2fr 2fr 3fr}.designation[_ngcontent-%COMP%]{grid-area:designation;padding-right:1rem}.date[_ngcontent-%COMP%]{grid-area:date;padding-right:1rem}.registrations[_ngcontent-%COMP%]{grid-area:registrations;padding-right:1rem}.rating[_ngcontent-%COMP%]{grid-area:rating}.rating[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{text-decoration:none}.rating[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{text-decoration:underline}.rating[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:hover{text-decoration-color:#ea161f}.registrations-label[_ngcontent-%COMP%]{display:none}@media (max-width: 575.98px){.registrations-label[_ngcontent-%COMP%]{display:inline}.designation[_ngcontent-%COMP%], .date[_ngcontent-%COMP%], .registrations[_ngcontent-%COMP%]{padding-right:0}[_nghost-%COMP%]{grid-template-areas:"designation" "date" "registrations" "rating";grid-template-columns:1fr}}']});let i=n;return i})();var tn=10300,nn=10260,rn=10250,sn=14030,an=10350;function Ye(i){let{HasEvaluationStarted:n,EvaluationUntil:s,HasTestGrading:e}=i.EvaluationStatusRef;if(n===!0&&(i.StatusId===sn||i.StatusId===an))return{value:Z.Rating};if(n===!0&&e===!1){if(s)return{value:Z.RatingUntil};if(i.StatusId===tn)return{value:Z.IntermediateRating}}return n===!1&&e===!0&&i.StatusId!==nn&&i.StatusId!==rn?{value:Z.Tests}:n===!0&&e===!0?s?{value:Z.Tests,label:Z.RatingUntil}:{value:Z.Tests,label:Z.IntermediateRating}:null}function gi(i){return i.EvaluationStatusRef.HasEvaluationStarted===!0}function fi(i){return i.EvaluationStatusRef.HasReviewOfEvaluationStarted===!0&&!!i.FinalGrades?.length}function Ke(i){let n=i.Classes?i.Classes.map(s=>s.Number).join(", "):null;return n?i.Designation+", "+n:i.Designation}var Z=function(i){return i.Rating="rating",i.RatingUntil="rating-until",i.IntermediateRating="intermediate-rating",i.Tests="add-tests",i}(Z||{}),Te=(()=>{let n=class n{constructor(e,t,r,g,w,S){this.coursesRestService=e,this.eventsRestService=t,this.studyClassRestService=r,this.loadingService=g,this.translate=w,this.settings=S,this.loading$=this.loadingService.loading$,this.searchFields$=new L(["designation"]),this.searchSubject$=new L(""),this.search$=this.searchSubject$.asObservable(),this.roles$=new L(null),this.isClassTeacher$=this.roles$.pipe(b(F=>Nt(F,"ClassTeacherRole")),J(1)),this.withStudyCourses$=new L(!1),this.unratedCourses$=this.roles$.pipe(D(this.loadUnratedCourses.bind(this)),J(1)),this.studyCourses$=this.withStudyCourses$.pipe(D(this.loadStudyCourses.bind(this)),J(1)),this.formativeAssessments$=this.isClassTeacher$.pipe(D(this.loadFormativeAssessments.bind(this)),J(1)),this.studyClasses$=this.isClassTeacher$.pipe(D(this.loadStudyClasses.bind(this)),J(1)),this.events$=this.getEvents().pipe(J(1)),this.filteredEvents$=te([this.events$,this.searchFields$,this.search$]).pipe(b(ye(di)))}setSearch(e){this.searchSubject$.next(e)}setRoles(e){this.roles$.next(e)}setWithStudyCourses(e){this.withStudyCourses$.next(e)}setSearchFields(e){this.searchFields$.next(e)}getEntries(e=!1){return this.filteredEvents$.pipe(b(t=>e?t.filter(r=>r.evaluationText):t))}getEvents(){return this.loadingService.load(te([this.unratedCourses$,this.studyCourses$,this.formativeAssessments$,this.studyClasses$]),{stopOnFirstValue:!0}).pipe(b(ye(this.createAndSortEvents.bind(this))))}loadUnratedCourses(e){return this.coursesRestService.getExpandedCourses(e).pipe(b(t=>t.filter(r=>!fi(r))))}loadStudyCourses(e){return e?this.eventsRestService.getStudyCourseEvents():Y([])}loadFormativeAssessments(e){return e?this.studyClassRestService.getActiveFormativeAssessments():Y([])}loadStudyClasses(e){return e?this.studyClassRestService.getActive():Y([])}createAndSortEvents(e,t,r,g){let w=g.filter(S=>!r.map(F=>F.Id).includes(S.Id));return[...this.createFromCourses(e),...this.createFromStudyCourses(t),...this.createFromAssessments(r),...this.createFromStudyClasses(w)].sort((S,F)=>S.designation.localeCompare(F.designation))}createFromCourses(e){return e.map(t=>{let r=Ye(t);return{id:t.Id,designation:Ke(t),detailLink:this.buildLink(t.Id,"eventdetail"),studentCount:t.AttendanceRef.StudentCount||0,dateFrom:t.DateFrom,dateTo:t.DateTo,state:r?.value||null,evaluationText:this.getEvaluationText(r,t.EvaluationStatusRef.EvaluationUntil),evaluationLink:this.getEvaluationLink(r?.value,t)}})}createFromStudyCourses(e){return e.map(t=>({id:t.Id,designation:t.Designation,detailLink:this.buildLink(t.Id,"eventdetail"),studentCount:t.StudentCount,state:null}))}createFromAssessments(e){return this.createFromStudyClasses(e).map(r=>H(B({},r),{state:Z.Rating,evaluationText:this.translate.instant("events.state.rating"),evaluationLink:this.buildLink(r.id,"evaluation")}))}createFromStudyClasses(e){return e.map(t=>({id:t.Id,designation:t.Number,detailLink:this.buildLink(t.Id,"eventdetail"),studentCount:t.StudentCount,state:null}))}getEvaluationText(e,t){let r=e?.label||e?.value;return r?this.translate.instant(`events.state.${r}`)+(r===Z.RatingUntil?` ${t?jt(t,"dd.MM.yyyy"):""}`:""):""}getEvaluationLink(e,t){return e&&e!==Z.Tests?this.buildLink(t.Id,"evaluation"):null}buildLink(e,t){return(this.settings.eventlist[t]??"").replace(":id",String(e))}};n.\u0275fac=function(t){return new(t||n)(U(me),U(oi),U(mi),U(Ue),U(ie),U(_e))},n.\u0275prov=ge({token:n,factory:n.\u0275fac,providedIn:"root"});let i=n;return i})();var ln=i=>({events:i});function pn(i,n){i&1&&(o(0,"div",12),m(1),l(2,"translate"),d()),i&2&&(a(),h(" ",c(2,1,"events.rating")," "))}function cn(i,n){if(i&1&&E(0,"bkd-events-list-entry",13),i&2){let s=n.$implicit,e=u(4);p("event",s)("withRatings",e.withRatings)}}function mn(i,n){if(i&1&&(W(0),o(1,"div",6)(2,"div",7),m(3),l(4,"translate"),d(),o(5,"div",8),m(6),l(7,"translate"),d(),o(8,"div",9),m(9),l(10,"translate"),d(),f(11,pn,3,3,"div",10),d(),f(12,cn,1,2,"bkd-events-list-entry",11),z()),i&2){let s=u(2).bkdLet,e=u();a(3),x(c(4,5,"events.designation")),a(3),x(c(7,7,"events.date")),a(3),h(" ",c(10,9,"events.registrations")," "),a(2),p("ngIf",e.withRatings),a(),p("ngForOf",s.events)}}function un(i,n){i&1&&(o(0,"p",14),m(1),l(2,"translate"),d()),i&2&&(a(),x(c(2,1,"events.no-events")))}function gn(i,n){if(i&1&&(W(0),f(1,mn,13,11,"ng-container",5)(2,un,3,3,"ng-template",null,1,se),z()),i&2){let s=A(3),e=u().bkdLet;a(),p("ngIf",(e.events==null?null:e.events.length)>0)("ngIfElse",s)}}function fn(i,n){i&1&&E(0,"bkd-spinner")}function hn(i,n){if(i&1){let s=M();o(0,"div",3)(1,"bkd-resettable-input",4),l(2,"async"),l(3,"translate"),l(4,"translate"),_("valueChange",function(t){I(s);let r=u();return T(r.state.setSearch(t))}),d(),f(5,gn,4,2,"ng-container",5),l(6,"async"),f(7,fn,1,0,"ng-template",null,0,se),d()}if(i&2){let s=n.bkdLet,e=A(8),t=u();a(),p("value",c(2,6,t.state.search$))("placeholder",c(3,8,"events.search-by"))("label",c(4,10,"events.search"))("disabled",!s.events),a(4),p("ngIf",c(6,12,t.state.loading$)===!1)("ngIfElse",e)}}var hi=["designation"],vn=[...hi,"evaluationText"],Je=(()=>{let n=class n{constructor(e,t){this.state=e,this.storage=t,this.withStudyCourses=!1,this.withRatings=!0,this.state.setRoles(this.storage.getPayload()?.roles??null)}ngOnChanges(e){e.withStudyCourses&&this.state.setWithStudyCourses(e.withStudyCourses.currentValue),e.withRatings&&this.state.setSearchFields(e.withRatings.currentValue?vn:hi)}};n.\u0275fac=function(t){return new(t||n)(v(Te),v(Lt))},n.\u0275cmp=C({type:n,selectors:[["bkd-events-list"]],inputs:{withStudyCourses:"withStudyCourses",withRatings:"withRatings"},standalone:!0,features:[fe,y],decls:2,vars:5,consts:[["loading",""],["noEvents",""],["class","bkd-container",4,"bkdLet"],[1,"bkd-container"],[1,"d-flex","search",3,"valueChange","value","placeholder","label","disabled"],[4,"ngIf","ngIfElse"],[1,"event-header"],[1,"designation"],[1,"date"],[1,"registrations"],["class","rating",4,"ngIf"],[3,"event","withRatings",4,"ngFor","ngForOf"],[1,"rating"],[3,"event","withRatings"],[1,"mt-3"]],template:function(t,r){t&1&&(f(0,hn,9,14,"div",2),l(1,"async")),t&2&&p("bkdLet",O(3,ln,c(1,1,r.state.getEntries(r.withRatings))))},dependencies:[Q,pi,R,ce,Se,j,P,k,ui],styles:['.search[_ngcontent-%COMP%]{max-width:500px}.event-header[_ngcontent-%COMP%]{display:grid;padding:1rem;border-bottom:2px solid #dee2e6;grid-template-areas:"designation date registrations rating";grid-template-columns:4fr 2fr 2fr 3fr}@media (max-width: 575.98px){.event-header[_ngcontent-%COMP%]{display:none}}']});let i=n;return i})();var vi=(()=>{let n=class n{constructor(){}};n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=C({type:n,selectors:[["bkd-events-current"]],standalone:!0,features:[y],decls:4,vars:5,consts:[[3,"withStudyCourses","withRatings"]],template:function(t,r){t&1&&(o(0,"h1"),m(1),l(2,"translate"),d(),E(3,"bkd-events-list",0)),t&2&&(a(),x(c(2,3,"events.current.title")),a(2),p("withStudyCourses",!0)("withRatings",!1))},dependencies:[Je,P,k]});let i=n;return i})();var _i=(()=>{let n=class n{constructor(){}};n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=C({type:n,selectors:[["bkd-events-tests"]],standalone:!0,features:[y],decls:4,vars:4,consts:[[3,"withRatings"]],template:function(t,r){t&1&&(o(0,"h1"),m(1),l(2,"translate"),d(),E(3,"bkd-events-list",0)),t&2&&(a(),x(c(2,2,"events.title")),a(2),p("withRatings",!0))},dependencies:[Je,P,k]});let i=n;return i})();var xi=(()=>{let n=class n{constructor(){}};n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=C({type:n,selectors:[["bkd-events"]],standalone:!0,features:[pe([Te,Vt]),y],decls:1,vars:0,template:function(t,r){t&1&&E(0,"router-outlet")},dependencies:[Fe]});let i=n;return i})();function bi(i){return n=>{let s=Number(n.value);return s<=i?{greaterThan:{value:s,greaterThanValue:i}}:null}}function nt(i){return i.map(({finalGrade:n})=>n).filter(_n)}function _n(i){return i!==null}function Si(i,n,s,e){return i?.map(t=>({student:t,finalGrade:bn(t,s,e),grades:xn(t,n)}))}function xn(i,n){return n.map(s=>{if(s.Results===void 0||s.Results?.length===0)return{kind:"no-result",test:s};let e=s.Results?.find(t=>t.StudentId===i.Id);return e!==void 0?{kind:"grade",result:e,test:s}:{kind:"no-result",test:s}})}function bn(i,n,s){let e=n.find(r=>r.StudentId===i.Id),t=s.find(r=>r.StudentId===i.Id);return e?{id:e.Id,average:Cn(e),finalGradeId:e.GradeId,freeHandGrade:t?Number(t.Grade):null,canGrade:e.CanGrade}:null}function Cn(i){return i.AverageTestResult===0?null:i.AverageTestResult}var Ii=({key:i,ascending:n})=>(s,e)=>{let t=n?1:-1;switch(i){case"FullName":return t*s.student.FullName.localeCompare(e.student.FullName);case"FinalGrade":return!s.finalGrade?.finalGradeId||!e.finalGrade?.finalGradeId?t*-1:t*Ci(s.finalGrade.finalGradeId,e.finalGrade.finalGradeId);case"TestsMean":return!s.finalGrade?.average||!e.finalGrade?.average?t*-1:t*Ci(s.finalGrade.average,e.finalGrade.average)}return t*yn(i,s,e)},yn=(i,n,s)=>{let e=n.grades.filter(yi).find(r=>r.test.Id===i.Id),t=s.grades.filter(yi).find(r=>r.test.Id===i.Id);return i.IsPointGrading&&e?.result.GradeId===t?.result.GradeId?(e?.result.Points??0)-(t?.result.Points??0):((e?.result.GradeId??Number.POSITIVE_INFINITY)-(t?.result.GradeId??Number.POSITIVE_INFINITY))*-1};function Ci(i,n){return i===n?0:is.average).filter(s=>s!=null&&s!==0).map(Number);return tt(n)}function Ei(i,n){let s=i.map(t=>t.freeHandGrade).filter(t=>!!t),e=i.map(t=>t.finalGradeId).filter(t=>t!==null).map(t=>n.find(r=>r.Key===t)).filter(t=>t!==void 0).map(t=>t?.Value).filter(t=>t!==void 0).map(Number).filter(t=>!isNaN(t));return tt([...e,...s])}function rt(i,n){return[...n.filter(s=>s.Id!==i?.Id),i].filter(s=>s!=null)}function ki({id:i,selectedGradeId:n},s){return s.map(e=>e.Id!==i?e:H(B({},e),{GradeId:n}))}function Pi(i,n){switch(n.type){case"reset":return n.payload;case"updateResult":return i?H(B({},i),{Tests:qt(n.payload.testResult,i.Tests||[],n.payload.ignore),Gradings:n.payload.grading?rt(n.payload.grading,i.Gradings||[]):i.Gradings}):null;case"deleteResult":return i?H(B({},i),{Tests:Yt(n.payload.testId,n.payload.studentId,i.Tests||[]),Gradings:n.payload.grading?rt(n.payload.grading,i.Gradings||[]):i.Gradings||[]}):null;case"toggle-test-state":return i?H(B({},i),{Tests:Kt(n.payload,i.Tests||[])}):null;case"final-grade-overwritten":return i?H(B({},i),{Gradings:ki({id:n.payload.id,selectedGradeId:n.payload.selectedGradeId},i.Gradings||[])}):null;case"replace-grades":return i?H(B({},i),{Gradings:n.payload}):null;case"delete-test":return i?H(B({},i),{Tests:Jt(n.payload,i.Tests||[])}):null;default:return i}}var Mi=(()=>{let n=class n extends Ht{constructor(e,t){super(e,t,ti,"Gradings")}updateGrade(e,t){return this.http.put(`${this.baseUrl}/${e}`,{GradeId:t}).pipe(b(()=>e))}};n.\u0275fac=function(t){return new(t||n)(U(Ct),U(_e))},n.\u0275prov=ge({token:n,factory:n.\u0275fac,providedIn:"root"});let i=n;return i})();var st={onlyMine:!1,hidePublished:!1},V=(()=>{let n=class n{constructor(e,t,r,g,w){this.coursesRestService=e,this.gradingScalesRestService=t,this.gradingsRestService=r,this.loadingService=g,this.sortService=w,this.action$=new Ze(1),this.loading$=this.loadingService.loading$,this._courseId$=new Ze(1),this.courseId$=this._courseId$.asObservable(),this.fetchedCourse$=this._courseId$.pipe(D(S=>this.loadingService.load(this.coursesRestService.getExpandedCourse(S))),J(1)),this.course$=Oe(this.action$,this.fetchedCourse$.pipe(Ee(Ne),b(S=>({type:"reset",payload:S})))).pipe(pt(Pi,null),Ee(Ne),J(1)),this.tests$=this.course$.pipe(b(S=>S.Tests||[]),b(Qt)),this.hasTests$=this.tests$.pipe(b(S=>S.length>0)),this.filterSubject$=new L(st),this.filter$=this.filterSubject$.asObservable(),this.expandedHeaderSubject$=new L(!1),this.expandedHeader$=this.expandedHeaderSubject$.asObservable(),this.filteredTests$=te([this.tests$,this.filter$]).pipe(b(([S,F])=>S.filter(q=>(!F.onlyMine||q.IsOwner)&&(!F.hidePublished||!q.IsPublished)))),this.sorting$=this.sortService.sorting$,this.studentGrades$=te([this.course$,this.filteredTests$,this.sorting$]).pipe(b(ye(this.toStudentGrades.bind(this)))),this.canSetFinalGrade$=this.course$.pipe(b(gi)),this.gradingScaleIds$=this.course$.pipe(b(S=>Bt([...(S.Tests??[]).map(F=>F.GradingScaleId),S.GradingScaleId]).filter(Ne)),K(Rt),J(1)),this.gradingScales$=this.gradingScaleIds$.pipe(D(S=>this.gradingScalesRestService.getGradingScales(S)),J(1)),this.UNDEFINED_GRADINGSCALE_ID=-1,this.gradingScalesOptions$=this.gradingScales$.pipe(b(S=>S.map(F=>{let q=F?.Id||this.UNDEFINED_GRADINGSCALE_ID,we=F?.Grades.map(Me=>({Key:Me.Id,Value:Me.Designation}))||[];return{id:q,options:we}}).reduce((F,q)=>H(B({},F),{[q.id]:q.options}),{})),J(1)),this.meanOfStudentGradesForCourse$=this.studentGrades$.pipe(b(S=>wi(nt(S)))),this.meanOfFinalGradesForCourse$=te([this.gradingScalesOptions$,this.studentGrades$]).pipe(D(ye(this.meanOfOverwrittenGradesForCourse.bind(this))))}setCourseId(e){this._courseId$.next(e)}setFilter(e){this.filterSubject$.next(e)}gradingOptionsForTest$(e){return this.gradingOptions$(e.GradingScaleId)}gradingOptionsForCourse$(){return this.course$.pipe(D(e=>this.gradingOptions$(e.GradingScaleId)))}toStudentGrades(e,t=[],r){return Si(e.ParticipatingStudents??[],t,e.Gradings??[],e.FinalGrades??[]).sort(Ii(r))}setSorting(e){this.sortService.setSorting(e)}getSortingChar$(e){return this.sortService.getSortingChar$(e)}sortBy(e){this.sortService.toggleSorting(e)}toggleHeader(e){this.expandedHeaderSubject$.next(e)}optimisticallyUpdateGrade(e){return this.course$.pipe(ne(1),b(t=>{let{originalResult:r,updatedResult:g}=this.buildOptimisticResultUpdate(t,e);return this.updateTestResult(g,null),r}))}saveGrade(e,t){this.course$.pipe(ne(1),D(r=>this.coursesRestService.updateTestResult(r.Id,e).pipe(ot(g=>(t&&this.updateTestResult(B({},t),null),at(()=>g)))))).subscribe(({testResult:r,grading:g})=>this.updateOrDeleteTestResult(e.testId,e.studentId,r,g,"gradeId"in e?"grade":"points"))}publish(e){this.coursesRestService.publishTest(e.Id).subscribe(this.toggleTestPublishedState.bind(this))}unpublish(e){this.coursesRestService.unpublishTest(e.Id).subscribe(this.toggleTestPublishedState.bind(this))}deleteTest(e){this.action$.next({type:"delete-test",payload:e})}overwriteFinalGrade({id:e,selectedGradeId:t}){this.gradingsRestService.updateGrade(e,t).subscribe(()=>{this.action$.next({type:"final-grade-overwritten",payload:{id:e,selectedGradeId:t}})})}setAveragesAsFinalGrades(e){this.coursesRestService.setAverageAsFinalGrade(e).subscribe(t=>this.action$.next({type:"replace-grades",payload:t.Gradings}))}buildOptimisticResultUpdate(e,t){let r=zt(e,t.testId,t.studentId),g=r?B({},r):{Id:"",TestId:t.testId,StudentId:t.studentId,CourseRegistrationId:0,GradeId:null,GradeValue:null,GradeDesignation:null,Points:null};return g.GradeId="gradeId"in t?t.gradeId:r?.GradeId??null,g.Points="points"in t?t.points:r?.Points??null,{originalResult:r,updatedResult:g}}updateOrDeleteTestResult(e,t,r,g,w){r?this.updateTestResult(r,g,w):this.deleteTestResult(e,t,g)}updateTestResult(e,t,r){this.action$.next({type:"updateResult",payload:{testResult:e,grading:t??null,ignore:r}})}deleteTestResult(e,t,r){this.action$.next({type:"deleteResult",payload:{testId:e,studentId:t,grading:r}})}toggleTestPublishedState(e){this.action$.next({type:"toggle-test-state",payload:e})}gradingOptions$(e){return e===null?Y(null):this.gradingScalesOptions$.pipe(b(t=>t[e]),J(1))}meanOfOverwrittenGradesForCourse(e,t){return this.course$.pipe(b(r=>{if(r.GradingScaleId===null||e[r.GradingScaleId]===void 0)return null;let g=e[r.GradingScaleId];return Ei(nt(t),g)}))}};n.\u0275fac=function(t){return new(t||n)(U(me),U(ni),U(Mi),U(Ue),U(ci))},n.\u0275prov=ge({token:n,factory:n.\u0275fac});let i=n;return i})();var Tn=i=>({formGroup:i}),wn=i=>["/events",i,"tests"];function En(i,n){if(i&1&&(o(0,"div",31),m(1),l(2,"translate"),d()),i&2){let s=n.$implicit;a(),h(" ",G(2,1,"global.validation-errors."+s.error,s.params)," ")}}function kn(i,n){if(i&1&&(o(0,"div",31),m(1),l(2,"translate"),d()),i&2){let s=n.$implicit;a(),h(" ",G(2,1,"global.validation-errors."+s.error,s.params)," ")}}function Pn(i,n){if(i&1&&(o(0,"div",31),m(1),l(2,"translate"),d()),i&2){let s=n.$implicit;a(),h(" ",G(2,1,"global.validation-errors."+s.error,s.params)," ")}}function Mn(i,n){if(i&1&&(o(0,"div",31),m(1),l(2,"translate"),d()),i&2){let s=n.$implicit;a(),h(" ",G(2,1,"global.validation-errors."+s.error,s.params)," ")}}function On(i,n){if(i&1&&(o(0,"div",31),m(1),l(2,"translate"),d()),i&2){let s=n.$implicit;a(),h(" ",G(2,1,"global.validation-errors."+s.error,s.params)," ")}}function Gn(i,n){if(i&1&&(W(0),o(1,"div",32)(2,"div",33)(3,"div",17)(4,"label",34),m(5),l(6,"translate"),d(),o(7,"div",35),E(8,"input",36),l(9,"async"),f(10,Mn,3,4,"div",8),l(11,"async"),d()()(),o(12,"div",33)(13,"div",17)(14,"label",37),m(15),l(16,"translate"),d(),o(17,"div",35),E(18,"input",38),l(19,"async"),f(20,On,3,4,"div",8),l(21,"async"),d()()()(),o(22,"div",39),gt(),o(23,"math")(24,"mi"),m(25),l(26,"translate"),d(),o(27,"mo"),m(28,"="),d(),o(29,"mfrac")(30,"mrow")(31,"mi"),m(32),l(33,"translate"),d(),o(34,"mo"),m(35,"\xD7"),d(),o(36,"mn"),m(37,"5"),d()(),o(38,"mi"),m(39),l(40,"translate"),d()(),o(41,"mo"),m(42,"+"),d(),o(43,"mn"),m(44,"1"),d()()(),z()),i&2){let s,e,t=u(3);a(5),x(c(6,11,"tests.form.max-points")),a(3),re("is-invalid",((s=c(9,13,t.maxPointsErrors$))==null?null:s.length)||!1),a(2),p("ngForOf",c(11,15,t.maxPointsErrors$)),a(5),x(c(16,17,"tests.form.max-points-adjusted")),a(3),re("is-invalid",((e=c(19,19,t.maxPointsAdjustedErrors$))==null?null:e.length)||!1),a(2),p("ngForOf",c(21,21,t.maxPointsAdjustedErrors$)),a(5),h(" ",c(26,23,"tests.form.math.grade")," "),a(7),h(" ",c(33,25,"tests.form.math.points")," "),a(7),x(c(40,27,"tests.form.math.max-points"))}}function $n(i,n){i&1&&(o(0,"div",40)(1,"span",41),m(2,"Loading..."),d()())}function Fn(i,n){if(i&1){let s=M();o(0,"form",3),_("ngSubmit",function(){I(s);let t=u(2);return T(t.onSubmit())}),o(1,"div",4)(2,"div",5)(3,"label",6),m(4),l(5,"translate"),d(),E(6,"input",7),l(7,"async"),l(8,"translate"),f(9,En,3,4,"div",8),l(10,"async"),d(),o(11,"div",9)(12,"label",10),m(13),l(14,"translate"),d(),o(15,"div",11)(16,"span",12)(17,"i",13),m(18,"calendar_today"),d()(),o(19,"input",14,0),l(21,"async"),l(22,"translate"),_("click",function(){I(s);let t=A(20);return T(t.toggle())}),d(),f(23,kn,3,4,"div",8),l(24,"async"),d()()(),o(25,"div",15)(26,"label",16),m(27),l(28,"translate"),d(),o(29,"div",5)(30,"div",17)(31,"label",18),m(32),l(33,"translate"),d(),o(34,"div",19),E(35,"input",20),l(36,"async"),f(37,Pn,3,4,"div",8),l(38,"async"),d()()()(),o(39,"div")(40,"label",16),m(41),l(42,"translate"),d(),o(43,"div",21),E(44,"input",22),o(45,"label",23),m(46),l(47,"translate"),d()(),o(48,"div",21),E(49,"input",24),o(50,"label",25),m(51),l(52,"translate"),d()(),f(53,Gn,45,29,"ng-container",26),d(),o(54,"div",27)(55,"button",28),l(56,"async"),m(57),l(58,"translate"),d(),o(59,"button",29),m(60),l(61,"translate"),f(62,$n,3,0,"div",30),d()()()}if(i&2){let s,e,t,r=u().bkdLet,g=u();p("formGroup",r.formGroup),a(4),x(c(5,29,"tests.form.designation")),a(2),re("is-invalid",((s=c(7,31,g.designationErrors$))==null?null:s.length)||!1),p("placeholder",c(8,33,"tests.form.designation-placeholder")),a(3),p("ngForOf",c(10,35,g.designationErrors$)),a(4),x(c(14,37,"tests.form.date")),a(3),p("id",g.componentId),a(3),re("is-invalid",((e=c(21,39,g.dateErrors$))==null?null:e.length)||!1),p("placeholder",c(22,41,"shared.date-select.default-placeholder")),a(4),p("ngForOf",c(24,43,g.dateErrors$)),a(4),x(c(28,45,"tests.form.weight")),a(5),x(c(33,47,"tests.form.factor")),a(3),re("is-invalid",((t=c(36,49,g.weightErrors$))==null?null:t.length)||!1),a(2),p("ngForOf",c(38,51,g.weightErrors$)),a(4),x(c(42,53,"tests.form.grading-type")),a(3),p("value",!1),a(2),x(c(47,55,"tests.form.grades")),a(3),p("value",!0),a(2),x(c(52,57,"tests.form.points")),a(2),p("ngIf",r.formGroup.get("isPointGrading").value),a(2),p("disabled",g.saving)("routerLink",O(65,wn,c(56,59,g.courseId$))),a(2),h(" ",c(58,61,"tests.form.cancel")," "),a(2),p("disabled",g.saving),a(),h(" ",c(61,63,"tests.form.save")," "),a(2),p("ngIf",g.saving)}}function Rn(i,n){if(i&1&&(W(0),f(1,Fn,63,67,"form",2),z()),i&2){let s=n.bkdLet;a(),p("ngIf",s.formGroup)}}var Qe=(()=>{let n=class n{constructor(e,t,r){this.fb=e,this.translate=t,this.testStateService=r,this.test=null,this.saving=!1,this.save=new X,this.componentId=Dt("bkd-tests-edit-form"),this.formGroup=this.createFormGroup(),this.submitted$=new L(!1),this.destroy$=new ee,this.designationErrors$=Ce(Y(this.formGroup),this.submitted$,"designation"),this.dateErrors$=Ce(Y(this.formGroup),this.submitted$,"date"),this.maxPointsErrors$=Ce(Y(this.formGroup),this.submitted$,"maxPoints"),this.maxPointsAdjustedErrors$=Ce(Y(this.formGroup),this.submitted$,"maxPointsAdjusted"),this.weightErrors$=Ce(Y(this.formGroup),this.submitted$,"weight"),this.courseId$=this.testStateService.courseId$}ngOnInit(){this.test&&this.setInitialValues(this.test),At(Y(this.formGroup),"isPointGrading").pipe(de(this.destroy$)).subscribe(this.togglePointFieldsDisability.bind(this))}ngOnDestroy(){this.destroy$.next()}onSubmit(){this.submitted$.next(!0),this.formGroup.valid&&this.save.emit(this.formGroup.value)}createFormGroup(){return this.fb.group({designation:["",xe.required],date:[null,xe.required],weight:[1,xe.compose([xe.required,bi(0)])],isPointGrading:[!1],maxPoints:[{value:null,disabled:!0},xe.required],maxPointsAdjusted:[{value:null,disabled:!0},null]})}setInitialValues(e){this.formGroup.patchValue({designation:e.Designation,date:e.Date,weight:e.Weight,isPointGrading:e.IsPointGrading,maxPoints:e.MaxPoints,maxPointsAdjusted:e.MaxPointsAdjusted}),e.Results&&e.Results.length>0&&(this.formGroup.get("isPointGrading")?.disable(),this.formGroup.get("maxPoints")?.disable(),this.formGroup.get("maxPointsAdjusted")?.disable()),this.togglePointFieldsDisability()}togglePointFieldsDisability(){let e=this.formGroup.get("maxPoints"),t=this.formGroup.get("maxPointsAdjusted");this.formGroup.get("isPointGrading")?.value?(e?.enable(),t?.enable()):(e?.reset({value:this.test?.MaxPoints,disabled:!0}),t?.reset({value:this.test?.MaxPointsAdjusted,disabled:!0}))}};n.\u0275fac=function(t){return new(t||n)(v(Pt),v(ie),v(V))},n.\u0275cmp=C({type:n,selectors:[["bkd-tests-edit-form"]],inputs:{test:"test",saving:"saving"},outputs:{save:"save"},standalone:!0,features:[pe([{provide:Ot,useClass:Ft},{provide:Gt,useClass:li}]),y],decls:1,vars:3,consts:[["dp","ngbDatepicker"],[4,"bkdLet"],[3,"formGroup","ngSubmit",4,"ngIf"],[3,"ngSubmit","formGroup"],[1,"row","g-3","mb-3"],[1,"col-md-6"],["for","designation",1,"form-label"],["id","designation","name","designation","type","text","formControlName","designation","required","",1,"form-control",3,"placeholder"],["class","invalid-feedback",4,"ngFor","ngForOf"],[1,"col-md-6","mb-3"],["for","date",1,"form-label"],[1,"input-group"],[1,"input-group-text",3,"id"],[1,"material-icons"],["id","date","name","date","type","text","ngbDatepicker","","formControlName","date","required","",1,"form-control",3,"click","placeholder"],[1,"row","mb-3"],[1,"form-label"],[1,"row"],["for","factor",1,"form-label","col-3","col-sm-2"],[1,"col-9","col-sm-10"],["id","factor","name","factor","type","number","formControlName","weight","step","0.05","min","0","required","",1,"form-control"],[1,"form-check"],["type","radio","formControlName","isPointGrading","id","type-grades",1,"form-check-input",3,"value"],["for","type-grades",1,"form-check-label"],["type","radio","formControlName","isPointGrading","id","type-points",1,"form-check-input",3,"value"],["for","type-points",1,"form-check-label"],[4,"ngIf"],[1,"d-flex","justify-content-end","mt-4"],["type","button",1,"btn","btn-outline-secondary",3,"disabled","routerLink"],["type","submit",1,"btn","btn-primary","ms-2",3,"disabled"],["class","spinner-border spinner-border-sm align-middle","role","status",4,"ngIf"],[1,"invalid-feedback"],[1,"row","ms-4","mb-3","g-3"],[1,"col-sm-6","col-md-4"],["for","max-points",1,"ms-2","col-4","col-form-label"],[1,"col-6"],["type","number","name","maxPoints","id","max-points","formControlName","maxPoints","step","0.01","min","0","max","999","required","",1,"form-control"],["for","max-points-adjusted",1,"ms-2","col-4","col-form-label"],["type","number","name","maxPointsAdjusted","id","max-points-adjusted","formControlName","maxPointsAdjusted","step","0.01","min","0","max","999",1,"form-control"],[1,"ms-4","ps-3","py-3"],["role","status",1,"spinner-border","spinner-border-sm","align-middle"],[1,"visually-hidden"]],template:function(t,r){t&1&&f(0,Rn,2,1,"ng-container",1),t&2&&p("bkdLet",O(1,Tn,r.formGroup))},dependencies:[Q,R,be,It,Be,Le,Tt,De,yt,kt,je,Ae,Mt,wt,Et,ce,$t,oe,j,P,k],styles:["#factor[_ngcontent-%COMP%], #max-points[_ngcontent-%COMP%], #max-points-adjusted[_ngcontent-%COMP%]{width:5em}"]});let i=n;return i})();var Dn=(i,n)=>({courseId:i,saving:n});function Ln(i,n){if(i&1){let s=M();o(0,"div",1)(1,"bkd-tests-edit-form",2),_("save",function(t){I(s);let r=u();return T(r.save(t))}),d()()}if(i&2){let s=n.bkdLet;a(),p("saving",s.saving)}}var Gi=(()=>{let n=class n{constructor(e,t,r,g,w){this.route=e,this.courseService=t,this.toastService=r,this.translate=g,this.router=w,this.saving$=new L(!1),this.courseId$=this.route.paramMap.pipe(b(S=>Number(S.get("id"))),K())}save(e){this.saving$.next(!0);let{designation:t,date:r,weight:g,isPointGrading:w,maxPoints:S,maxPointsAdjusted:F}=e;this.courseId$.pipe(D(q=>this.courseService.add(q,r,t,g,w,S,F)),Ge(()=>this.saving$.next(!1))).subscribe(this.onSaveSuccess.bind(this))}onSaveSuccess(){this.toastService.success(this.translate.instant("tests.form.save-success")),this.navigateBack()}navigateBack(){this.courseId$.subscribe(e=>this.router.navigate(["events",e,"tests"]))}};n.\u0275fac=function(t){return new(t||n)(v(ve),v(me),v(He),v(ie),v(Re))},n.\u0275cmp=C({type:n,selectors:[["bkd-tests-add"]],standalone:!0,features:[y],decls:6,vars:11,consts:[["class","bkd-container bkd-container-limited",4,"bkdLet"],[1,"bkd-container","bkd-container-limited"],[3,"save","saving"]],template:function(t,r){t&1&&(o(0,"h1"),m(1),l(2,"translate"),d(),f(3,Ln,2,1,"div",0),l(4,"async"),l(5,"async")),t&2&&(a(),x(c(2,2,"tests.add-title")),a(2),p("bkdLet",Pe(8,Dn,c(4,4,r.courseId$),c(5,6,r.saving$))))},dependencies:[Q,Qe,j,P,k]});let i=n;return i})();var $i=(()=>{let n=class n{constructor(e){this.activeModal=e}get canDeleteTest(){return(this.test?.Results?.filter(t=>t.GradeId!==null||t.GradeValue!==null||t.Points!==null)||[]).length===0}};n.\u0275fac=function(t){return new(t||n)(v(Ve))},n.\u0275cmp=C({type:n,selectors:[["bkd-tests-delete"]],inputs:{test:"test"},standalone:!0,features:[y],decls:13,vars:10,consts:[[1,"modal-body"],["data-testid","confirmation-message"],[1,"modal-footer"],["data-testid","cancel-button","type","button",1,"btn","btn-outline-secondary",3,"click","hidden"],[1,"px-2"],["data-testid","confirm-button","type","button",1,"btn","btn-primary",3,"click"],[1,"px-3"]],template:function(t,r){t&1&&(o(0,"div",0)(1,"p",1),m(2),l(3,"translate"),d()(),o(4,"div",2)(5,"button",3),_("click",function(){return r.activeModal.dismiss()}),o(6,"span",4),m(7),l(8,"translate"),d()(),o(9,"button",5),_("click",function(){return r.activeModal.close(r.canDeleteTest?r.test:null)}),o(10,"span",6),m(11),l(12,"translate"),d()()()),t&2&&(a(2),h(" ",c(3,4,r.canDeleteTest?"tests.form.confirm":"tests.form.delete-not-allowed")," "),a(3),p("hidden",!r.canDeleteTest),a(2),h(" ",c(8,6,"tests.dialog.no")," "),a(4),h(" ",c(12,8,r.canDeleteTest?"tests.dialog.yes":"tests.dialog.ok")," "))},dependencies:[P,k]});let i=n;return i})();var Vn=(i,n,s)=>({courseId:i,test:n,saving:s}),Hn=i=>({test:i});function Nn(i,n){if(i&1){let s=M();W(0),o(1,"div",4)(2,"h1"),m(3),l(4,"translate"),d(),o(5,"button",5),_("click",function(){I(s);let t=u().bkdLet,r=u();return T(r.openDeleteModal(t.test))}),o(6,"i",6),m(7,"delete"),d()()(),o(8,"bkd-tests-edit-form",7),_("save",function(t){I(s);let r=u(2);return T(r.save(t))}),d(),z()}if(i&2){let s=u().bkdLet;a(3),h(" ",G(4,3,"tests.edit-title",O(6,Hn,s.test.Designation))," "),a(5),p("test",s.test)("saving",s.saving)}}function Un(i,n){i&1&&E(0,"bkd-spinner")}function Wn(i,n){if(i&1&&(o(0,"div",2),f(1,Nn,9,8,"ng-container",3),l(2,"async"),f(3,Un,1,0,"ng-template",null,0,se),d()),i&2){let s=A(4),e=u();a(),p("ngIf",c(2,2,e.state.loading$)===!1)("ngIfElse",s)}}var Fi=(()=>{let n=class n{constructor(e,t,r,g,w,S,F){this.state=e,this.courseService=t,this.route=r,this.toastService=g,this.translate=w,this.router=S,this.modalService=F,this.saving$=new L(!1),this.testId$=this.route.paramMap.pipe(b(q=>Number(q.get("testId"))),K()),this.test$=te([this.state.tests$,this.testId$]).pipe(b(([q,we])=>q.find(Me=>Me.Id===we)))}openDeleteModal(e){let t=this.modalService.open($i);t.componentInstance.test=e,t.result.then(r=>{r&&this.courseService.delete(e.CourseId,e.Id).subscribe(this.onDeleteSuccess.bind(this))},()=>{})}save(e){this.saving$.next(!0);let{designation:t,date:r,weight:g,isPointGrading:w,maxPoints:S,maxPointsAdjusted:F}=e;te([this.state.courseId$,this.testId$]).pipe(ne(1),D(([q,we])=>this.courseService.update(q,we,t,r,g,w,S,F)),Ge(()=>this.saving$.next(!1))).subscribe(this.onSaveSuccess.bind(this))}onSaveSuccess(){this.toastService.success(this.translate.instant("tests.form.save-success")),this.navigateBack()}onDeleteSuccess(e){this.toastService.success(this.translate.instant("tests.form.delete-success")),this.state.deleteTest(e),this.navigateBack()}navigateBack(){this.state.courseId$.pipe(ne(1)).subscribe(e=>this.router.navigate(["events",e,"tests"]))}};n.\u0275fac=function(t){return new(t||n)(v(V),v(me),v(ve),v(He),v(ie),v(Re),v(qe))},n.\u0275cmp=C({type:n,selectors:[["bkd-tests-edit"]],standalone:!0,features:[y],decls:4,vars:11,consts:[["loading",""],["class","bkd-container bkd-container-limited",4,"bkdLet"],[1,"bkd-container","bkd-container-limited"],[4,"ngIf","ngIfElse"],[1,"d-flex","justify-content-between","align-items-center"],["type","button",1,"btn","btn-primary","btn-icon",3,"click"],[1,"material-icons"],[3,"save","test","saving"]],template:function(t,r){t&1&&(f(0,Wn,5,4,"div",1),l(1,"async"),l(2,"async"),l(3,"async")),t&2&&p("bkdLet",he(7,Vn,c(1,1,r.state.courseId$),c(2,3,r.test$),c(3,5,r.saving$)))},dependencies:[Q,R,Qe,Se,j,P,k]});let i=n;return i})();var zn=i=>({designation:i}),Ri=(()=>{let n=class n{constructor(e){this.activeModal=e}};n.\u0275fac=function(t){return new(t||n)(v(Ve))},n.\u0275cmp=C({type:n,selectors:[["bkd-publish-test"]],inputs:{test:"test"},standalone:!0,features:[y],decls:11,vars:12,consts:[[1,"modal-body"],["data-testid","confirmation-message"],[1,"modal-footer"],["data-testid","cancel-button","type","button",1,"btn","btn-outline-secondary",3,"click"],["data-testid","confirm-button","type","button",1,"btn","btn-primary",3,"click"]],template:function(t,r){t&1&&(o(0,"div",0)(1,"p",1),m(2),l(3,"translate"),d()(),o(4,"div",2)(5,"button",3),_("click",function(){return r.activeModal.dismiss()}),m(6),l(7,"translate"),d(),o(8,"button",4),_("click",function(){return r.activeModal.close(!0)}),m(9),l(10,"translate"),d()()),t&2&&(a(2),h(" ",G(3,3,r.test.IsPublished?"tests.publishing.unpublish":"tests.publishing.publish",O(10,zn,r.test.Designation))," "),a(4),h(" ",c(7,6,"tests.publishing.cancel")," "),a(3),h(" ",c(10,8,"tests.publishing.confirm")," "))},dependencies:[P,k],encapsulation:2});let i=n;return i})();var qn=i=>({maxPoints:i});function Yn(i,n){if(i&1&&(o(0,"div",8),m(1),l(2,"translate"),d()),i&2){let s=u(2);a(),h(" ",G(2,1,"global.validation-errors.invalidPoints",O(4,qn,s.maxPoints))," ")}}function Kn(i,n){if(i&1){let s=M();o(0,"div",5)(1,"input",6,0),_("ngModelChange",function(){I(s);let t=A(2),r=u();return T(r.onPointsChange(t.value))}),d(),f(3,Yn,3,6,"div",7),d()}if(i&2){let s=A(2),e=u();a(),re("is-invalid",s.errors),le("max",e.maxPoints),le("tabindex",e.tabIndex),p("disabled",e.grade.test.IsPublished)("ngModel",e.grade.kind==="grade"?e.grade.result.Points:null),a(2),p("ngIf",s.errors)}}var Jn=1250,Bi=(()=>{let n=class n{constructor(e){this.state=e,this.maxPoints=0,this.pointsSubject$=new ee,this.gradeSubject$=new ee,this.gradingScaleDisabledSubject$=new L(!0),this.gradingScaleDisabled$=this.gradingScaleDisabledSubject$.asObservable(),this.destroy$=new ee}ngOnInit(){this.gradingScaleDisabledSubject$.next(this.disableGradingScale()),this.maxPoints=Ti(this.grade),this.initSave(this.pointsSubject$.pipe(Ee(this.isValid.bind(this)),b(e=>({studentId:this.student.Id,testId:this.grade.test.Id,points:e?Number(e):null})))),this.initSave(this.gradeSubject$.pipe(b(e=>({studentId:this.student.Id,testId:this.grade.test.Id,gradeId:e}))))}ngOnChanges(){this.gradingScaleDisabledSubject$.next(this.disableGradingScale())}ngOnDestroy(){this.destroy$.next()}onPointsChange(e){this.pointsSubject$.next(e),this.gradingScaleDisabledSubject$.next(!(e===null||e===""))}onGradeChange(e){this.gradeSubject$.next(e)}isValid(e){return e===""||e===null?!0:isNaN(Number(e))?!1:!(Number(e)<0||Number(e)>this.maxPoints)}initSave(e){e.pipe(dt(t=>this.state.optimisticallyUpdateGrade(t).pipe(b(r=>({params:t,originalResult:r})))),lt(Jn),de(this.destroy$)).subscribe(({params:t,originalResult:r})=>this.state.saveGrade(t,r))}disableGradingScale(){return this.grade.test.IsPublished?!0:this.grade.kind==="no-result"?!1:this.grade.result.Points!=null&&this.grade.test.IsPointGrading}};n.\u0275fac=function(t){return new(t||n)(v(V))},n.\u0275cmp=C({type:n,selectors:[["bkd-grade"]],inputs:{grade:"grade",student:"student",tabIndex:"tabIndex",gradeOptions:"gradeOptions"},standalone:!0,features:[fe,y],decls:5,vars:8,consts:[["points","ngModel"],[1,"d-flex","flex-column","w-100"],[1,"d-flex","flex-row"],["class","point-input-container me-2 me-md-3",4,"ngIf"],["data-testid","grade-select",1,"grade-select",3,"valueChange","options","allowEmpty","value","disabled","tabindex"],[1,"point-input-container","me-2","me-md-3"],["type","number","step","0.01","min","0","data-testid","point-input",1,"form-control",3,"ngModelChange","max","disabled","tabindex","ngModel"],["class","invalid-feedback","data-testid","validation-error-message",4,"ngIf"],["data-testid","validation-error-message",1,"invalid-feedback"]],template:function(t,r){t&1&&(o(0,"div",1)(1,"div",2),f(2,Kn,4,7,"div",3),o(3,"bkd-select",4),l(4,"async"),_("valueChange",function(w){return r.onGradeChange(w)}),d()()()),t&2&&(a(2),p("ngIf",r.grade.test.IsPointGrading),a(),p("options",r.gradeOptions)("allowEmpty",!0)("value",r.grade.kind==="grade"?r.grade.result.GradeId:null)("disabled",c(4,6,r.gradingScaleDisabled$))("tabindex",r.tabIndex))},dependencies:[R,be,Be,Le,De,je,Ae,St,Ie,j,P,k],styles:[".point-input-container[_ngcontent-%COMP%]{width:4em}[_nghost-%COMP%] select{min-width:13ch}@media (min-width: 576px){.point-input-container[_ngcontent-%COMP%]{width:5em}}"]});let i=n;return i})();function Qn(i,n){if(i&1&&(o(0,"span",3),m(1),d()),i&2){let s=u();a(),x(s.calculatePointsAverage(s.test))}}var Di=(()=>{let n=class n{constructor(e){this.locale=e}calculatePointsAverage(e){return this.safeAverage(e,2,We)}calculateGradeAverage(e){return this.safeAverage(e,3,ze)}safeAverage(e,t,r){try{return ei(r(e),this.locale,t)}catch{return Xt}}};n.\u0275fac=function(t){return new(t||n)(v(bt))},n.\u0275cmp=C({type:n,selectors:[["bkd-average-grades"]],inputs:{test:"test"},standalone:!0,features:[y],decls:4,vars:2,consts:[[1,"d-flex","flex-row","w-100"],["class","mr-2 mr-md-3 average-points","data-testid","average-points",4,"ngIf"],["data-testid","average-grade"],["data-testid","average-points",1,"mr-2","mr-md-3","average-points"]],template:function(t,r){t&1&&(o(0,"div",0),f(1,Qn,2,1,"span",1),o(2,"span",2),m(3),d()()),t&2&&(a(),p("ngIf",r.test.IsPointGrading),a(2),x(r.calculateGradeAverage(r.test)))},dependencies:[R],styles:[".average-points[_ngcontent-%COMP%]{min-width:4.5em}@media (min-width: 576px){.average-points[_ngcontent-%COMP%]{min-width:6em}}"]});let i=n;return i})();var Li=(()=>{let n=class n{constructor(){this.disabled=!1,this.width="13ch",this.gradeIdSelected=new X}onGradeChange(e){this.gradeId?.valueOf()!==void 0&&this.gradeIdSelected.emit({id:this.gradeId?.valueOf(),selectedGradeId:e})}};n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=C({type:n,selectors:[["bkd-grade-select"]],inputs:{options:"options",valueId:"valueId",gradeId:"gradeId",disabled:"disabled",width:"width"},outputs:{gradeIdSelected:"gradeIdSelected"},standalone:!0,features:[y],decls:1,vars:5,consts:[["data-testid","grade-select",3,"valueChange","options","allowEmpty","value","disabled","width"]],template:function(t,r){t&1&&(o(0,"bkd-select",0),_("valueChange",function(w){return r.onGradeChange(w)}),d()),t&2&&p("options",r.options)("allowEmpty",!0)("value",r.valueId)("disabled",r.disabled)("width",r.width)},dependencies:[Ie]});let i=n;return i})();var Xn=576,Ai=(()=>{let n=class n{constructor(e,t){this.portal=e,this.state=t,this.destroy$=new ee,this.handleWindowScroll=()=>{this.updateStickyVisibility(),this.updateStickyTopOffset()},this.handleWindowResize=()=>{this.updateStickyWidth(),this.updateStickyVisibility(),this.updateStickyTopOffset()},this.handleTableScroll=()=>{this.updateStickyLeftOffset()}}ngOnInit(){te([this.state.filteredTests$,this.state.expandedHeader$]).pipe(de(this.destroy$)).subscribe(()=>setTimeout(()=>this.updateStickyWidth()))}ngAfterViewInit(){this.handleWindowScroll(),this.handleTableScroll(),this.handleWindowResize(),this.window.addEventListener("scroll",this.handleWindowScroll),this.getTableScrollContainer()?.addEventListener("scroll",this.handleTableScroll),this.window.addEventListener("resize",this.handleWindowResize)}ngOnDestroy(){this.window.removeEventListener("scroll",this.handleWindowScroll),this.getTableScrollContainer()?.removeEventListener("scroll",this.handleTableScroll),this.window.removeEventListener("resize",this.handleWindowResize)}get window(){return this.portal.window??window}getTableScrollContainer(){return document.querySelector(".table-responsive-wrapper")??null}updateStickyVisibility(){if(this.isSmallBreakpointDown())return;let e=this.inlineHeader.getTop()+this.getIframeScrollY();this.stickyHeader.shown=this.getScrollTop()>e}updateStickyTopOffset(){this.isSmallBreakpointDown()||this.stickyHeader.setTopOffset(this.portal.inIframe?this.getScrollTop():0)}updateStickyLeftOffset(){this.isSmallBreakpointDown()||this.stickyHeader.setLeftOffset(this.inlineHeader.getLeft())}updateStickyWidth(){this.isSmallBreakpointDown()||(this.stickyHeader.setWidth(this.inlineHeader.getWidth()),this.stickyHeader.setColumnWidths(this.inlineHeader.getColumnWidths()),this.stickyHeader.setStickyColumnHeights(this.inlineHeader.getStickyColumnsHeights()))}getScrollTop(){return this.window.scrollY-this.portal.getIframeTop()}getIframeScrollY(){return window.scrollY}isSmallBreakpointDown(){return window.innerWidth({"btn-primary":i,"btn-outline-secondary":n}),Vi=(()=>{let n=class n{constructor(){this.filter=st,this.filterChange=new X}showOnlyMine(){this.filterChange.next(H(B({},this.filter),{onlyMine:!0}))}showAll(){this.filterChange.next(H(B({},this.filter),{onlyMine:!1}))}onHidePublishedChange(e){let t=(e.target&&e.target instanceof HTMLInputElement&&e.target?.checked)??!1;this.filterChange.next(H(B({},this.filter),{hidePublished:t}))}};n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=C({type:n,selectors:[["bkd-test-table-filter"]],inputs:{filter:"filter"},outputs:{filterChange:"filterChange"},standalone:!0,features:[y],decls:13,vars:18,consts:[[1,"only-mine-buttons"],["type","button",1,"btn","desktop",3,"click","ngClass"],["type","button",1,"btn","ms-2","desktop",3,"click","ngClass"],[1,"hide-published"],[1,"form-check"],["id","hide-published","type","checkbox",1,"form-check-input",3,"change","checked"],["for","hide-published",1,"form-check-label"]],template:function(t,r){t&1&&(o(0,"div",0)(1,"button",1),_("click",function(){return r.showAll()}),m(2),l(3,"translate"),d(),o(4,"button",2),_("click",function(){return r.showOnlyMine()}),m(5),l(6,"translate"),d()(),o(7,"div",3)(8,"div",4)(9,"input",5),_("change",function(w){return r.onHidePublishedChange(w)}),d(),o(10,"label",6),m(11),l(12,"translate"),d()()()),t&2&&(a(),p("ngClass",Pe(12,ji,!r.filter.onlyMine,r.filter.onlyMine)),a(),h(" ",c(3,6,"tests.all-tests")," "),a(2),p("ngClass",Pe(15,ji,r.filter.onlyMine,!r.filter.onlyMine)),a(),h(" ",c(6,8,"tests.owned-tests")," "),a(4),p("checked",r.filter.hidePublished),a(2),h(" ",c(12,10,"tests.hide-published")," "))},dependencies:[ae,be,P,k],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;justify-content:space-between;height:100%}.only-mine-buttons[_ngcontent-%COMP%]{display:flex;align-items:center;height:3.625rem}.hide-published[_ngcontent-%COMP%]{display:flex;align-items:center;height:2.375rem;margin-bottom:1rem}.hide-published[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{font-weight:300}.hide-published[_ngcontent-%COMP%] .form-check[_ngcontent-%COMP%]{margin-bottom:0}"]});let i=n;return i})();var Zn=["*"],Hi=(()=>{let n=class n{};n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=C({type:n,selectors:[["bkd-preserve-line-height"]],standalone:!0,features:[y],ngContentSelectors:Zn,decls:3,vars:0,template:function(t,r){t&1&&(ht(),o(0,"div"),vt(1),m(2,"\xA0"),d())},encapsulation:2});let i=n;return i})();var Ni=(()=>{let n=class n{constructor(e){this.translate=e}transform(e){return`${e.Weight} (${e.WeightPercent}%)${this.getPoints(e)}`}getPoints(e){return e.IsPointGrading?`, ${e.MaxPointsAdjusted??e.MaxPoints} ${this.translate.instant("tests.summary.points")}`:""}};n.\u0275fac=function(t){return new(t||n)(v(ie,16))},n.\u0275pipe=ut({name:"testSummaryShort",type:n,pure:!0,standalone:!0});let i=n;return i})();var er=i=>[i,"edit"];function tr(i,n){i&1&&(o(0,"i",12),m(1,"edit"),d())}function ir(i,n){if(i&1&&(o(0,"div",8)(1,"div",9)(2,"bkd-preserve-line-height"),m(3),l(4,"date"),d(),o(5,"a",10),f(6,tr,2,0,"i",11),d()(),o(7,"bkd-preserve-line-height"),m(8),l(9,"testSummaryShort"),d(),o(10,"bkd-preserve-line-height"),m(11),d()()),i&2){let s=u();a(3),x(G(4,5,s.test.Date,"dd.MM.yyyy")),a(2),p("routerLink",O(10,er,s.test.Id)),a(),p("ngIf",s.test.IsOwner&&s.test.IsPublished===!1),a(2),h(" ",c(9,8,s.test)," "),a(3),x(s.test.Owner)}}function nr(i,n){if(i&1){let s=M();o(0,"div",13)(1,"a",14),l(2,"translate"),_("click",function(){I(s);let t=u();return T(t.unpublishTest())}),o(3,"i",15),m(4,"lock"),d(),o(5,"span"),m(6),l(7,"translate"),d()(),o(8,"bkd-caret",16),_("click",function(){I(s);let t=u();return T(t.toggleHeader())}),d()()}if(i&2){let s=u();a(),le("title",c(2,3,"tests.edit")),a(5),x(c(7,5,"tests.published")),a(2),p("expanded",s.expanded)}}function rr(i,n){if(i&1){let s=M();o(0,"div",13)(1,"a",17),l(2,"translate"),_("click",function(){I(s);let t=u();return T(t.publishTest())}),o(3,"i",15),m(4,"lock_open"),d(),o(5,"span"),m(6),l(7,"translate"),d()(),o(8,"bkd-caret",16),_("click",function(){I(s);let t=u();return T(t.toggleHeader())}),d()()}if(i&2){let s=u();a(),le("title",c(2,3,"tests.publish")),a(5),x(c(7,5,"tests.not-published")),a(2),p("expanded",s.expanded)}}var Ui=(()=>{let n=class n{constructor(){this.toggle=new X,this.publish=new X,this.unpublish=new X}toggleHeader(){this.toggle.emit(!this.expanded)}publishTest(){this.publish.emit(this.test)}unpublishTest(){this.unpublish.emit(this.test)}};n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=C({type:n,selectors:[["bkd-test-table-header"]],inputs:{test:"test",expanded:"expanded"},outputs:{toggle:"toggle",publish:"publish",unpublish:"unpublish"},standalone:!0,features:[y],decls:10,vars:6,consts:[["notPublished",""],[1,"d-flex","flex-column","h-100","justify-content-between"],["role","button",1,"test-designation","d-flex","flex-row","my-3","align-items-end","justify-content-between",3,"click"],[3,"ngClass"],[1,"align-self-start",3,"expanded"],[1,"d-flex","flex-column"],["class","d-flex flex-column mb-3",4,"ngIf"],["class","d-flex align-items-center justify-content-between test-status",4,"ngIf","ngIfElse"],[1,"d-flex","flex-column","mb-3"],[1,"d-flex","flex-row","justify-content-between"],[1,"btn","btn-link","p-0","edit",3,"routerLink"],["class","material-icons",4,"ngIf"],[1,"material-icons"],[1,"d-flex","align-items-center","justify-content-between","test-status"],[1,"d-flex","btn","btn-link","ps-0","edit",3,"click","title"],[1,"material-icons","me-1"],[1,"expand-mobile",3,"click","expanded"],[1,"d-flex","btn","btn-link","ps-0",3,"click","title"]],template:function(t,r){if(t&1){let g=M();o(0,"div",1)(1,"div",2),_("click",function(){return I(g),T(r.toggleHeader())}),o(2,"div",3),m(3),d(),E(4,"bkd-caret",4),d(),o(5,"div",5),f(6,ir,12,12,"div",6)(7,nr,9,7,"div",7)(8,rr,9,7,"ng-template",null,0,se),d()()}if(t&2){let g=A(9);a(2),p("ngClass",r.expanded?"expanded":"collapsed"),a(),h(" ",r.test.Designation," "),a(),p("expanded",r.expanded),a(2),p("ngIf",r.expanded),a(),p("ngIf",r.test.IsPublished)("ngIfElse",g)}},dependencies:[ae,Wt,R,Hi,oe,$e,P,k,Ni],styles:["[_nghost-%COMP%]{font-weight:300}.collapsed[_ngcontent-%COMP%]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.test-designation[_ngcontent-%COMP%]{display:none!important}.test-status[_ngcontent-%COMP%]{order:-1;padding-bottom:1rem}.test-status[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{text-decoration:none}.test-status[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{color:#000}.test-status[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{text-decoration:underline}.test-status[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:hover{text-decoration-color:#ea161f}.edit[_ngcontent-%COMP%]{color:#00000080;text-decoration:none}@media (min-width: 811px){.test-designation[_ngcontent-%COMP%]{display:inherit!important}.test-status[_ngcontent-%COMP%]{order:initial}.expand-mobile[_ngcontent-%COMP%]{display:none!important}}"]});let i=n;return i})();var sr=["bkdTestEditGradesHeader",""],ar=(i,n,s)=>({tests:i,filter:n,expanded:s}),or=i=>({selected:i});function dr(i,n){if(i&1){let s=M();o(0,"th",13)(1,"bkd-test-table-header",14),_("toggle",function(t){I(s);let r=u(2);return T(r.state.toggleHeader(t))})("publish",function(t){I(s);let r=u(2);return T(r.publish.emit(t))})("unpublish",function(t){I(s);let r=u(2);return T(r.unpublish.emit(t))}),d()()}if(i&2){let s=n.$implicit,e=u().bkdLet,t=u();p("ngClass",s.Id===(t.selectedTest==null?null:t.selectedTest.Id)?"selected":""),a(),p("test",s)("expanded",e.expanded)}}function lr(i,n){if(i&1){let s=M();o(0,"th",15)(1,"bkd-test-table-header",14),_("toggle",function(t){I(s);let r=u(2);return T(r.state.toggleHeader(t))})("publish",function(t){I(s);let r=u(2);return T(r.publish.emit(t))})("unpublish",function(t){I(s);let r=u(2);return T(r.unpublish.emit(t))}),d()()}if(i&2){let s=n.$implicit,e=u().bkdLet,t=u();p("ngClass",s.Id===(t.selectedTest==null?null:t.selectedTest.Id)?"selected":""),a(),p("test",s)("expanded",e.expanded)}}function pr(i,n){if(i&1){let s=M();o(0,"div",19)(1,"span",18),_("click",function(){I(s);let t=u().$implicit,r=u(2);return T(r.state.sortBy(t))}),m(2),l(3,"translate"),d()()}i&2&&(a(2),h("",c(3,1,"tests.points")," "))}function cr(i,n){if(i&1){let s=M();o(0,"th",16)(1,"div",7),f(2,pr,4,3,"div",17),o(3,"div",8)(4,"span",18),_("click",function(){let t=I(s).$implicit,r=u(2);return T(r.state.sortBy(t))}),m(5),l(6,"translate"),d()(),o(7,"div",9),m(8),l(9,"async"),d()()()}if(i&2){let s=n.$implicit,e=u(2);p("ngClass",s.Id===(e.selectedTest==null?null:e.selectedTest.Id)?"selected":""),a(2),p("ngIf",s.IsPointGrading),a(3),x(c(6,4,"tests.grade")),a(3),h(" ",c(9,6,e.state.getSortingChar$(s))," ")}}function mr(i,n){if(i&1){let s=M();W(0),o(1,"tr",1)(2,"th",2)(3,"bkd-test-table-filter",3),_("filterChange",function(t){I(s);let r=u();return T(r.state.setFilter(t))}),d()(),f(4,dr,2,3,"th",4)(5,lr,2,3,"th",5),d(),o(6,"tr")(7,"th",6),_("click",function(){I(s);let t=u();return T(t.state.sortBy("FullName"))}),o(8,"div",7)(9,"div",8),m(10),l(11,"translate"),d(),o(12,"div",9),m(13),l(14,"async"),d()()(),o(15,"th",10),_("click",function(){I(s);let t=u();return T(t.state.sortBy("FinalGrade"))}),o(16,"div",7)(17,"div",8),m(18),l(19,"translate"),d(),o(20,"div",9),m(21),l(22,"async"),d()()(),o(23,"th",11),_("click",function(){I(s);let t=u();return T(t.state.sortBy("TestsMean"))}),o(24,"div",7)(25,"div",8),m(26),l(27,"translate"),d(),o(28,"div",9),m(29),l(30,"async"),d()()(),f(31,cr,10,8,"th",12),d(),z()}if(i&2){let s=n.bkdLet,e=u();a(3),p("filter",s.filter),a(),p("ngForOf",s.tests),a(),p("ngForOf",s.tests),a(5),h(" ",c(11,11,"tests.student.name")," "),a(3),h(" ",c(14,13,e.state.getSortingChar$("FullName"))," "),a(2),p("ngClass",O(23,or,e.selectedTest===void 0)),a(3),h(" ",c(19,15,"tests.grade")," "),a(3),h(" ",c(22,17,e.state.getSortingChar$("FinalGrade"))," "),a(5),h(" ",c(27,19,"tests.mean")," "),a(3),h(" ",c(30,21,e.state.getSortingChar$("TestsMean"))," "),a(2),p("ngForOf",s.tests)}}var Wi=(()=>{let n=class n{set shown(e){let t=this.element.nativeElement.classList;e?t.add("shown"):t.remove("shown")}constructor(e,t){this.state=e,this.element=t,this.sticky=!1,this.publish=new X,this.unpublish=new X}getTop(){return this.element.nativeElement.getBoundingClientRect().top}getLeft(){return this.element.nativeElement.getBoundingClientRect().left}setTopOffset(e){this.element.nativeElement.style.top=`${e}px`}setLeftOffset(e){this.element.nativeElement.style.left=`${e}px`}getWidth(){return this.element.nativeElement.getBoundingClientRect().width}setWidth(e){this.element.nativeElement.style.width=`${e}px`}getColumnWidths(){return this.getRowsAndColumns().map(e=>e.map(t=>t.getBoundingClientRect().width))}setColumnWidths(e){let t=this.getRowsAndColumns();if(t.length!==e.length||!t.every((r,g)=>r.length===e[g].length))throw new Error("Given column widths do not match number of header rows/columns");t.forEach((r,g)=>r.forEach((w,S)=>{w.style.width=`${e[g][S]}px`,w.style.minWidth=`${e[g][S]}px`}))}getStickyColumnsHeights(){return this.getRowsAndColumns(".sticky").map(e=>e.map(t=>t.getBoundingClientRect().height))}setStickyColumnHeights(e){let t=this.getRowsAndColumns(".sticky");if(t.length!==e.length||!t.every((r,g)=>r.length===e[g].length))throw new Error("Given column heights do not match number of sticky header columns");t.forEach((r,g)=>r.forEach((w,S)=>{w.style.height=`${e[g][S]}px`})),this.getRows().forEach((r,g)=>{let w=e[g].reduce((S,F)=>Math.max(S,F),0);r.style.height=`${w}px`})}getRowsAndColumns(e){return this.getRows().map(t=>Array.from(t.querySelectorAll(`th:not(.header-mobile)${e??""}`)))}getRows(){return Array.from(this.element.nativeElement.querySelectorAll("tr"))}};n.\u0275fac=function(t){return new(t||n)(v(V),v(ft))},n.\u0275cmp=C({type:n,selectors:[["thead","bkdTestEditGradesHeader",""]],hostVars:2,hostBindings:function(t,r){t&2&&re("sticky",r.sticky)},inputs:{selectedTest:"selectedTest",sticky:"sticky",shown:"shown"},outputs:{publish:"publish",unpublish:"unpublish"},standalone:!0,features:[y],attrs:sr,decls:4,vars:11,consts:[[4,"bkdLet"],[1,"header-collapsible"],["colspan","3",1,"desktop","sticky"],[3,"filterChange","filter"],["container","body","class","test-grade grade test-info-desktop",3,"ngClass",4,"ngFor","ngForOf"],["container","body","class","test-grade header-mobile test-info-mobile","colspan","3",3,"ngClass",4,"ngFor","ngForOf"],[1,"sticky","student-name",3,"click"],[1,"d-flex"],[1,"column-title"],[1,"sort-direction","ms-1"],[1,"sticky","student-grade","desktop",3,"click","ngClass"],[1,"border-end","sticky","student-average","desktop",3,"click"],["container","body","class","test-grade",3,"ngClass",4,"ngFor","ngForOf"],["container","body",1,"test-grade","grade","test-info-desktop",3,"ngClass"],[3,"toggle","publish","unpublish","test","expanded"],["container","body","colspan","3",1,"test-grade","header-mobile","test-info-mobile",3,"ngClass"],["container","body",1,"test-grade",3,"ngClass"],["class","column-title me-3 point-input-container",4,"ngIf"],[3,"click"],[1,"column-title","me-3","point-input-container"]],template:function(t,r){t&1&&(f(0,mr,32,25,"ng-container",0),l(1,"async"),l(2,"async"),l(3,"async")),t&2&&p("bkdLet",he(7,ar,c(1,1,r.state.filteredTests$),c(2,3,r.state.filter$),c(3,5,r.state.expandedHeader$)))},dependencies:[Q,j,ae,ce,R,P,k,Vi,Ui],styles:["[_nghost-%COMP%]{--student-name-column-width: 225px;--student-grade-column-width: 147px;--student-average-column-width: 100px;--test-grade-column-width: 300px;--point-input-size: 4em;--student-grade-column-offset: var(--student-name-column-width);--student-average-column-offset: calc( var(--student-grade-column-offset) + var(--student-grade-column-width) );--test-columns-offset: calc( var(--student-average-column-offset) + var(--student-average-column-width) )}@media (min-width: 1000px){[_nghost-%COMP%]{--student-name-column-width: 275px}}th[_ngcontent-%COMP%], td[_ngcontent-%COMP%]{padding:1rem}td[_ngcontent-%COMP%]{vertical-align:middle}@media (min-width: 576px){[_nghost-%COMP%]{--point-input-size: 5em}}tr[_ngcontent-%COMP%]:not(.header-collapsible) th.test-grade[_ngcontent-%COMP%]{width:calc(var(--point-input-size) + 13ch + 3rem)}@media (max-width: 810px){.desktop[_ngcontent-%COMP%]:not(.selected), .student-grade[_ngcontent-%COMP%]:not(.selected), .student-average[_ngcontent-%COMP%], .test-grade[_ngcontent-%COMP%]:not(.selected){display:none}table[_ngcontent-%COMP%], tbody[_ngcontent-%COMP%], thead[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:100%}th[_ngcontent-%COMP%], tr[_ngcontent-%COMP%]{display:flex;width:100%}.student-name[_ngcontent-%COMP%]{flex:1;display:block}.test-grade[_ngcontent-%COMP%]{flex:none;display:block}}@media (min-width: 811px){.mobile[_ngcontent-%COMP%]{display:none}.student-name[_ngcontent-%COMP%]{width:var(--student-name-column-width);min-width:var(--student-name-column-width);max-width:var(--student-name-column-width)}.student-grade[_ngcontent-%COMP%]{width:var(--student-grade-column-width);min-width:var(--student-grade-column-width);max-width:var(--student-grade-column-width)}.student-average[_ngcontent-%COMP%]{width:var(--student-average-column-width);min-width:var(--student-average-column-width);max-width:var(--student-average-column-width)}.test-grade[_ngcontent-%COMP%]{min-width:var(--test-grade-column-width);max-width:var(--test-grade-column-width)}th.sticky[_ngcontent-%COMP%], td.sticky[_ngcontent-%COMP%]{position:sticky;left:0;background-color:#fff}th.sticky.student-grade[_ngcontent-%COMP%], td.sticky.student-grade[_ngcontent-%COMP%]{left:var(--student-grade-column-offset)}th.sticky.student-average[_ngcontent-%COMP%], td.sticky.student-average[_ngcontent-%COMP%]{left:var(--student-average-column-offset)}}@media (max-width: 1200px){[_nghost-%COMP%]{--student-average-column-width: 1px}.student-average[_ngcontent-%COMP%]{padding:0;overflow:hidden}}@media (min-width: 1201px){.student-average-inline[_ngcontent-%COMP%]{display:none}}.sticky[_nghost-%COMP%]{position:fixed;top:0;left:0;z-index:1000;display:none}tr[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{border-top:none;vertical-align:top}.header-collapsible[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{border-bottom:1px solid #dee2e6;padding:0 1rem}tr[_ngcontent-%COMP%] th.test-info-desktop[_ngcontent-%COMP%]{display:none!important}@media (min-width: 811px){.sticky.shown[_nghost-%COMP%]{display:table-header-group}tr[_ngcontent-%COMP%] th.test-info-mobile[_ngcontent-%COMP%]{display:none!important}tr[_ngcontent-%COMP%] th.test-info-desktop[_ngcontent-%COMP%]{display:table-cell!important}tr[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{border-top:none;padding-top:.25rem;padding-bottom:.25rem;border-top:initial}.sticky[_nghost-%COMP%]{margin-left:var(--test-columns-offset)}.sticky[_nghost-%COMP%] th.sticky[_ngcontent-%COMP%]{position:fixed}}"],changeDetection:0});let i=n;return i})();var ur=(i,n,s)=>({tests:i,hasTests:n,studentGrades:s}),zi=i=>({selected:i}),gr=i=>["student",i,"grades"],fr=i=>({"visible-on-mobile":i});function hr(i,n){if(i&1){let s=M();o(0,"bkd-grade-select",22),l(1,"async"),l(2,"async"),_("gradeIdSelected",function(t){I(s);let r=u(3);return T(r.state.overwriteFinalGrade(t))}),d()}if(i&2){let s=u().$implicit,e=u(2);p("options",c(1,4,e.state.gradingOptionsForCourse$()))("valueId",s.finalGrade.finalGradeId)("gradeId",s.finalGrade.id)("disabled",c(2,6,e.isEditFinalGradesAllowed(s))===!1)}}function vr(i,n){if(i&1&&(o(0,"div"),m(1),d()),i&2){let s=u().$implicit;a(),h(" ",s.finalGrade.freeHandGrade," ")}}function _r(i,n){if(i&1&&(o(0,"td",23),E(1,"bkd-grade",24),l(2,"async"),d()),i&2){let s=n.$implicit,e=n.index,t=u(),r=t.$implicit,g=t.index,w=u(2);p("ngClass",w.selectedTest!==void 0&&s.test.Id===w.selectedTest.Id?"selected":""),a(),p("grade",s)("gradeOptions",c(2,5,w.state.gradingOptionsForTest$(s.test)))("student",r.student)("tabIndex",(1+e)*1e3+g)}}function xr(i,n){if(i&1&&(o(0,"tr")(1,"td",8)(2,"a",16)(3,"div"),m(4),d(),o(5,"div",10),m(6),l(7,"translate"),l(8,"decimalOrDash"),d()()(),o(9,"td",17),f(10,hr,3,8,"bkd-grade-select",18)(11,vr,2,1,"div",19),d(),o(12,"td",20),m(13),l(14,"decimalOrDash"),d(),f(15,_r,3,7,"td",21),d()),i&2){let s=n.$implicit,e=u(2);a(2),p("routerLink",O(18,gr,s.student.Id)),a(2),x(s.student.FullName),a(2),et(" ",c(7,10,"tests.mean"),": ",G(8,12,s.finalGrade==null?null:s.finalGrade.average,"1-3")," "),a(3),p("ngClass",O(20,zi,e.selectedTest===void 0)),a(),p("ngIf",s.finalGrade&&!s.finalGrade.freeHandGrade),a(),p("ngIf",s.finalGrade&&s.finalGrade.freeHandGrade),a(2),h(" ",G(14,15,s.finalGrade==null?null:s.finalGrade.average,"1-3")," "),a(2),p("ngForOf",s.grades)("ngForTrackBy",e.trackGradeOf(s.student))}}function br(i,n){if(i&1&&(o(0,"td",23),E(1,"bkd-average-grades",25),d()),i&2){let s=n.$implicit,e=u(2);p("ngClass",s.Id===(e.selectedTest==null?null:e.selectedTest.Id)||s.Id===(e.selectedTest==null?null:e.selectedTest.Id)?"selected":""),a(),p("test",s)}}function Cr(i,n){if(i&1){let s=M();o(0,"button",26),_("click",function(){I(s);let t=u(2);return T(t.setAverageAsFinalGrade())}),m(1),l(2,"translate"),d()}if(i&2){let s=u().bkdLet,e=u();p("ngClass",O(4,fr,!s.hasTests||!e.selectedTest)),a(),h(" ",c(2,2,"tests.set-final-grade")," ")}}function yr(i,n){if(i&1){let s=M();W(0),o(1,"div",3)(2,"table",4)(3,"thead",5,0),_("publish",function(t){I(s);let r=u();return T(r.publish(t))})("unpublish",function(t){I(s);let r=u();return T(r.unpublish(t))}),d(),o(5,"thead",6,1),_("publish",function(t){I(s);let r=u();return T(r.publish(t))})("unpublish",function(t){I(s);let r=u();return T(r.unpublish(t))}),d(),o(7,"tbody"),f(8,xr,16,22,"tr",7),o(9,"tr")(10,"td",8)(11,"div",9)(12,"div"),m(13),l(14,"translate"),d(),o(15,"div",10),m(16),l(17,"translate"),l(18,"async"),l(19,"decimalOrDash"),d()()(),o(20,"td",11),m(21),l(22,"async"),l(23,"decimalOrDash"),d(),o(24,"td",12),m(25),l(26,"async"),l(27,"decimalOrDash"),d(),f(28,br,2,2,"td",13),d()()(),o(29,"div",14),f(30,Cr,3,6,"button",15),l(31,"async"),d()(),z()}if(i&2){let s=n.bkdLet,e=A(4),t=A(6),r=u();a(2),p("inlineHeader",e)("stickyHeader",t),a(),p("selectedTest",r.selectedTest),a(2),p("sticky",!0)("selectedTest",r.selectedTest),a(3),p("ngForOf",s.studentGrades)("ngForTrackBy",r.trackStudentGrade),a(5),x(c(14,15,"tests.average")),a(3),et(" ",c(17,17,"tests.mean"),": ",G(19,21,c(18,19,r.state.meanOfStudentGradesForCourse$),"1-3")," "),a(4),p("ngClass",O(36,zi,r.selectedTest===void 0)),a(),h(" ",G(23,26,c(22,24,r.state.meanOfFinalGradesForCourse$),"1-3")," "),a(4),h(" ",G(27,31,c(26,29,r.state.meanOfStudentGradesForCourse$),"1-3")," "),a(3),p("ngForOf",s.tests),a(2),p("ngIf",c(31,34,r.state.canSetFinalGrade$))}}var qi=(()=>{let n=class n{constructor(e,t){this.state=e,this.modalService=t}ngOnInit(){this.state.setSorting({key:"FullName",ascending:!0})}setAverageAsFinalGrade(){this.state.course$.pipe(ne(1)).subscribe(e=>this.state.setAveragesAsFinalGrades({CourseIds:[e.Id]}))}isEditFinalGradesAllowed(e){return this.state.course$.pipe(b(t=>!!(Ye(t)?.value&&e.finalGrade?.canGrade)))}publish(e){let t=this.openModal(e);this.onCloseModal(t,()=>this.state.publish(e))}unpublish(e){let t=this.openModal(e);this.onCloseModal(t,()=>this.state.unpublish(e))}trackStudentGrade(e){return e}trackGradeOf(e){return function(t,r){return`${e.Id}_${r.test.Id}`}}calculatePointsAverage(e){return this.safeAverage(e,We)}calculateGradeAverage(e){return this.safeAverage(e,ze)}safeAverage(e,t){try{return t(e).toString()}catch{return"\u2013"}}openModal(e){let t=this.modalService.open(Ri);return t.componentInstance.test=e,t}onCloseModal(e,t){e.result.then(r=>{r&&t()},()=>{})}};n.\u0275fac=function(t){return new(t||n)(v(V),v(qe))},n.\u0275cmp=C({type:n,selectors:[["bkd-test-edit-grades"]],inputs:{selectedTest:"selectedTest"},standalone:!0,features:[pe([Te]),y],decls:4,vars:11,consts:[["inlineHeader",""],["stickyHeader",""],[4,"bkdLet"],[1,"table-responsive-wrapper"],["bkdTestEditGradesHeaderSticky","",1,"table","table-hover","h-100",3,"inlineHeader","stickyHeader"],["bkdTestEditGradesHeader","",3,"publish","unpublish","selectedTest"],["bkdTestEditGradesHeader","",3,"publish","unpublish","sticky","selectedTest"],[4,"ngFor","ngForOf","ngForTrackBy"],[1,"sticky","student-name"],[1,"d-flex","flex-column"],[1,"student-average-inline"],[1,"desktop","sticky","student-grade",3,"ngClass"],[1,"desktop","border-end","sticky","student-average"],["class","test-grade",3,"ngClass",4,"ngFor","ngForOf"],[1,"action-buttons"],["data-testId","apply-average-button","class","apply-average-button btn btn-primary m-3","type","button",3,"ngClass","click",4,"ngIf"],[3,"routerLink"],[1,"sticky","student-grade",3,"ngClass"],[3,"options","valueId","gradeId","disabled","gradeIdSelected",4,"ngIf"],[4,"ngIf"],[1,"border-end","sticky","student-average"],["class","test-grade",3,"ngClass",4,"ngFor","ngForOf","ngForTrackBy"],[3,"gradeIdSelected","options","valueId","gradeId","disabled"],[1,"test-grade",3,"ngClass"],[3,"grade","gradeOptions","student","tabIndex"],[3,"test"],["data-testId","apply-average-button","type","button",1,"apply-average-button","btn","btn-primary","m-3",3,"click","ngClass"]],template:function(t,r){t&1&&(f(0,yr,32,38,"ng-container",2),l(1,"async"),l(2,"async"),l(3,"async")),t&2&&p("bkdLet",he(7,ur,c(1,1,r.state.filteredTests$),c(2,3,r.state.hasTests$),c(3,5,r.state.studentGrades$)))},dependencies:[Q,ae,ce,R,oe,Li,Bi,Di,j,P,k,Zt,Ai,Wi],styles:["[_nghost-%COMP%]{--student-name-column-width: 225px;--student-grade-column-width: 147px;--student-average-column-width: 100px;--test-grade-column-width: 300px;--point-input-size: 4em;--student-grade-column-offset: var(--student-name-column-width);--student-average-column-offset: calc( var(--student-grade-column-offset) + var(--student-grade-column-width) );--test-columns-offset: calc( var(--student-average-column-offset) + var(--student-average-column-width) )}@media (min-width: 1000px){[_nghost-%COMP%]{--student-name-column-width: 275px}}th[_ngcontent-%COMP%], td[_ngcontent-%COMP%]{padding:1rem}td[_ngcontent-%COMP%]{vertical-align:middle}@media (min-width: 576px){[_nghost-%COMP%]{--point-input-size: 5em}}tr[_ngcontent-%COMP%]:not(.header-collapsible) th.test-grade[_ngcontent-%COMP%]{width:calc(var(--point-input-size) + 13ch + 3rem)}@media (max-width: 810px){.desktop[_ngcontent-%COMP%]:not(.selected), .student-grade[_ngcontent-%COMP%]:not(.selected), .student-average[_ngcontent-%COMP%], .test-grade[_ngcontent-%COMP%]:not(.selected){display:none}table[_ngcontent-%COMP%], tbody[_ngcontent-%COMP%], thead[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:100%}th[_ngcontent-%COMP%], tr[_ngcontent-%COMP%]{display:flex;width:100%}.student-name[_ngcontent-%COMP%]{flex:1;display:block}.test-grade[_ngcontent-%COMP%]{flex:none;display:block}}@media (min-width: 811px){.mobile[_ngcontent-%COMP%]{display:none}.student-name[_ngcontent-%COMP%]{width:var(--student-name-column-width);min-width:var(--student-name-column-width);max-width:var(--student-name-column-width)}.student-grade[_ngcontent-%COMP%]{width:var(--student-grade-column-width);min-width:var(--student-grade-column-width);max-width:var(--student-grade-column-width)}.student-average[_ngcontent-%COMP%]{width:var(--student-average-column-width);min-width:var(--student-average-column-width);max-width:var(--student-average-column-width)}.test-grade[_ngcontent-%COMP%]{min-width:var(--test-grade-column-width);max-width:var(--test-grade-column-width)}th.sticky[_ngcontent-%COMP%], td.sticky[_ngcontent-%COMP%]{position:sticky;left:0;background-color:#fff}th.sticky.student-grade[_ngcontent-%COMP%], td.sticky.student-grade[_ngcontent-%COMP%]{left:var(--student-grade-column-offset)}th.sticky.student-average[_ngcontent-%COMP%], td.sticky.student-average[_ngcontent-%COMP%]{left:var(--student-average-column-offset)}}@media (max-width: 1200px){[_nghost-%COMP%]{--student-average-column-width: 1px}.student-average[_ngcontent-%COMP%]{padding:0;overflow:hidden}}@media (min-width: 1201px){.student-average-inline[_ngcontent-%COMP%]{display:none}}tbody[_ngcontent-%COMP%] td.student-name[_ngcontent-%COMP%]{padding-right:0}tbody[_ngcontent-%COMP%] td.student-name[_ngcontent-%COMP%], tbody[_ngcontent-%COMP%] td.student-name[_ngcontent-%COMP%] *[_ngcontent-%COMP%]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}tbody[_ngcontent-%COMP%] td.student-name[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{text-decoration:none}tbody[_ngcontent-%COMP%] td.student-name[_ngcontent-%COMP%] a[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:first-child{text-decoration:underline}tbody[_ngcontent-%COMP%] td.student-name[_ngcontent-%COMP%] a[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:first-child:hover{text-decoration-color:#ea161f}.student-average-inline[_ngcontent-%COMP%]{color:#4e4e4ef2;font-size:.875rem;line-height:1}@media (min-width: 811px){.table-responsive-wrapper[_ngcontent-%COMP%]{display:block;overflow-x:auto}table[_ngcontent-%COMP%]{border-collapse:separate;border-spacing:0}.action-buttons[_ngcontent-%COMP%]{position:sticky;left:0}}@media (max-width: 810px){.apply-average-button[_ngcontent-%COMP%]:not(.visible-on-mobile){display:none!important}}"]});let i=n;return i})();var Sr=()=>["/events"],Ir=i=>({count:i});function Tr(i,n){if(i&1&&(o(0,"div",8),m(1),l(2,"translate"),d()),i&2){let s=u();a(),h(" ",G(2,1,s.course.ParticipatingStudents.length===1?"courses.registration":"courses.registrations",O(4,Ir,s.course.ParticipatingStudents.length))," ")}}var Yi=(()=>{let n=class n{constructor(e){this.reportsService=e,this.course$=new L(null),this.reports$=this.course$.pipe(b(t=>t?.Id),K(),D(t=>t?this.reportsService.getCourseReports(t):Y([])),ct([]))}ngOnChanges(e){e.course&&this.course$.next(e.course.currentValue)}getDesignation(){return Ke(this.course)}};n.\u0275fac=function(t){return new(t||n)(v(ii))},n.\u0275cmp=C({type:n,selectors:[["bkd-tests-header"]],inputs:{course:"course"},standalone:!0,features:[fe,y],decls:12,vars:7,consts:[[3,"link"],[1,"d-flex"],["routerLink","add",1,"edit","btn","btn-primary","btn-icon","ms-2"],[1,"material-icons"],[1,"ms-2",3,"reports"],["id","excel-import"],[1,"d-flex","flex-column","header"],["class","additional-info",4,"ngIf"],[1,"additional-info"]],template:function(t,r){t&1&&(o(0,"bkd-backlink",0)(1,"div",1)(2,"a",2)(3,"i",3),m(4,"add"),d()(),E(5,"bkd-reports-link",4),l(6,"async"),E(7,"div",5),d()(),o(8,"div",6)(9,"h1"),m(10),d(),f(11,Tr,3,6,"div",7),d()),t&2&&(p("link",_t(6,Sr)),a(5),p("reports",c(6,4,r.reports$)),a(5),x(r.getDesignation()),a(),p("ngIf",r.course.ParticipatingStudents))},dependencies:[si,oe,Ut,R,j,P,k],styles:[".header[_ngcontent-%COMP%]{padding-bottom:1rem;border-bottom:1px solid #dee2e6}h1[_ngcontent-%COMP%]{margin-bottom:0}.additional-info[_ngcontent-%COMP%]{color:#adb5bd}"]});let i=n;return i})();var wr=(i,n,s,e,t,r)=>({course:i,tests:n,hasTests:s,testOptions:e,selectedTestId:t,selectedTest:r}),Er=i=>({"visible-on-mobile":i});function kr(i,n){if(i&1){let s=M();W(0),o(1,"bkd-select",7),_("valueChange",function(t){I(s);let r=u(3);return T(t&&r.testSelected(t))}),d(),E(2,"bkd-test-edit-grades",8),z()}if(i&2){let s=u(2).bkdLet;a(),p("options",s.testOptions)("value",s.selectedTestId)("allowEmpty",!1),a(),p("selectedTest",s.selectedTest)}}function Pr(i,n){if(i&1&&(o(0,"a",9),l(1,"async"),o(2,"i",10),m(3,"arrow_right_alt"),d(),o(4,"span",11),m(5),l(6,"translate"),d()()),i&2){let s=u(2).bkdLet,e=u();le("href",c(1,3,e.buildLinkToRatingOverview()),ke),p("ngClass",O(7,Er,!s.hasTests||!s.selectedTest)),a(5),x(c(6,5,"tests.link-to-rating-overview"))}}function Mr(i,n){if(i&1&&(W(0),E(1,"bkd-tests-header",5),f(2,kr,3,4,"ng-container",4)(3,Pr,7,9,"a",6),l(4,"async"),z()),i&2){let s=u().bkdLet,e=u(),t=A(9);a(),p("course",s.course),a(),p("ngIf",s.tests.length>0)("ngIfElse",t),a(),p("ngIf",c(4,4,e.state.canSetFinalGrade$))}}function Or(i,n){if(i&1&&(W(0),f(1,Mr,5,6,"ng-container",4),l(2,"async"),z()),i&2){let s=u(),e=A(11);a(),p("ngIf",c(2,2,s.state.loading$)===!1)("ngIfElse",e)}}function Gr(i,n){i&1&&(o(0,"p",12),m(1),l(2,"translate"),d()),i&2&&(a(),x(c(2,1,"tests.no-tests")))}function $r(i,n){i&1&&E(0,"bkd-spinner")}var Ki=(()=>{let n=class n{constructor(e,t,r){this.settings=e,this.state=t,this.translate=r,this.selectTest$=new ee,this.testOptions$=this.state.tests$.pipe(b(g=>[{Key:-1,Value:this.translate.instant("tests.grade")},...g.map(w=>({Key:w.Id,Value:w.Designation}))]),K()),this.selectedTestId$=Oe(this.selectTest$,this.state.tests$.pipe(ne(1),b(g=>g[0]?.Id))).pipe(K()),this.selectedTest$=this.selectedTestId$.pipe(D(g=>this.state.tests$.pipe(b(w=>w.find(S=>S.Id===g)))),K())}testSelected(e){this.selectTest$.next(e)}buildLinkToRatingOverview(){return this.state.course$.pipe(ne(1),b(e=>this.settings.eventlist.evaluation.replace(":id",String(e.Id))))}};n.\u0275fac=function(t){return new(t||n)(v(_e),v(V),v(ie))},n.\u0275cmp=C({type:n,selectors:[["bkd-tests-list"]],standalone:!0,features:[y],decls:12,vars:20,consts:[["noTests",""],["loading",""],[1,"bkd-container"],[4,"bkdLet"],[4,"ngIf","ngIfElse"],[3,"course"],["class","rating-overview d-flex justify-content-end pe-3 border-top pt-3",3,"ngClass","href",4,"ngIf"],["width","100%",1,"tests-dropdown",3,"valueChange","options","value","allowEmpty"],[3,"selectedTest"],[1,"rating-overview","d-flex","justify-content-end","pe-3","border-top","pt-3",3,"ngClass","href"],[1,"material-icons","fw-bold"],[1,"ps-1"],[1,"mt-3","px-3"]],template:function(t,r){t&1&&(o(0,"div",2),f(1,Or,3,4,"ng-container",3),l(2,"async"),l(3,"async"),l(4,"async"),l(5,"async"),l(6,"async"),l(7,"async"),f(8,Gr,3,3,"ng-template",null,0,se)(10,$r,1,0,"ng-template",null,1,se),d()),t&2&&(a(),p("bkdLet",xt(13,wr,c(2,1,r.state.course$),c(3,3,r.state.tests$),c(4,5,r.state.hasTests$),c(5,7,r.testOptions$),c(6,9,r.selectedTestId$),c(7,11,r.selectedTest$))))},dependencies:[Q,R,Yi,Ie,qi,ae,Se,j,P,k],styles:[".tests-dropdown[_ngcontent-%COMP%]{display:block;padding:1rem 0}@media (min-width: 811px){.tests-dropdown[_ngcontent-%COMP%]{display:none}}a.rating-overview[_ngcontent-%COMP%]{text-decoration:none}a.rating-overview[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{text-decoration:underline}a.rating-overview[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:hover{text-decoration-color:#ea161f}@media (max-width: 810px){a.rating-overview[_ngcontent-%COMP%]:not(.visible-on-mobile){display:none!important}}"]});let i=n;return i})();var Xe=(()=>{let n=class n{constructor(e,t){this.state=e,this.route=t,this.courseId$=this.route.paramMap.pipe(b(r=>Number(r.get("id"))),K()),this.destroy$=new ee}ngOnInit(){this.courseId$.pipe(de(this.destroy$)).subscribe(e=>this.state.setCourseId(e))}ngOnDestroy(){this.destroy$.next()}};n.\u0275fac=function(t){return new(t||n)(v(V),v(ve))},n.\u0275cmp=C({type:n,selectors:[["bkd-tests"]],standalone:!0,features:[pe([V]),y],decls:1,vars:0,template:function(t,r){t&1&&E(0,"router-outlet")},dependencies:[Fe]});let i=n;return i})();var kd=[{path:"",component:xi,children:[{path:"",component:_i},{path:"current",component:vi},{path:":id",component:Xe,children:[{path:"tests",component:Ki}]},{path:":id/tests/:testId/edit",component:Xe,children:[{path:"",component:Fi}]},{path:":id/tests/add",component:Xe,children:[{path:"",component:Gi}]},{path:":id/tests",children:[ai]}]}];export{kd as EVENTS_ROUTES}; +import{a as oi}from"./chunk-MGID7RWQ.js";import{a as di,b as pi}from"./chunk-RQFEXCIP.js";import{a as mi}from"./chunk-4EXGKTN3.js";import{a as ai}from"./chunk-JV3CBBGP.js";import"./chunk-U4HODSW3.js";import{a as tt,b as zt,c as qt,d as Yt,e as Kt,f as We,g as ze,h as Jt,i as Qt,j as Xt,k as Zt,l as ei,m as Ie,o as ti,p as me,s as ni,u as ri,v as qe}from"./chunk-W7ASLXRM.js";import"./chunk-PSXDSPKS.js";import"./chunk-C7XT5XXE.js";import"./chunk-YMJC6QZX.js";import{a as Nt}from"./chunk-Y4QYVF5K.js";import"./chunk-HII3S2DL.js";import{a as li}from"./chunk-K3EEKOGY.js";import{a as ci}from"./chunk-XLPJMZ3E.js";import"./chunk-24AFRN2G.js";import{a as Wt,d as ii}from"./chunk-RFO4NYUO.js";import"./chunk-5RDJZAUT.js";import"./chunk-DB66EACG.js";import{P as Vt,Y as si,t as jt}from"./chunk-ZK2MNT7Z.js";import{a as Ce,c as At,e as ye}from"./chunk-AW7CSGKI.js";import{a as Ut,b as Ue}from"./chunk-FTDG26ID.js";import{a as Q,b as Ht,c as Se}from"./chunk-SOHFFTKU.js";import{f as Ot,g as Gt,i as $t,j as Ft,p as Ve,u as Ne}from"./chunk-C56YGDXA.js";import{a as He}from"./chunk-UX5TA32W.js";import{$ as C,$a as u,$c as De,A as ot,Ab as l,B as dt,Bb as c,Bd as Dt,C as lt,Cb as G,E as ne,Eb as se,Fd as ie,G as K,Ga as f,Gb as bt,Gd as k,Hd as P,I as Ge,Ia as p,Id as Lt,J as pt,Ja as re,L as J,N as ct,O as D,Q as de,Qb as ae,Rb as ce,Sa as o,Sb as R,Ta as d,Ua as E,Va as W,Vb as j,Vc as _e,W as ge,Wa as z,Wb as $e,Ya as M,Yc as Be,Z as U,_a as _,_c as xe,a as B,ab as ht,ad as yt,b as H,ba as mt,bb as vt,ca as ut,cb as le,dc as Ct,dd as St,e as ee,ed as It,f as L,fd as Le,g as Ze,ga as fe,gd as Tt,ha as I,ia as T,ib as A,id as wt,jb as m,jd as Et,k as Y,ka as gt,kb as x,l as at,lb as h,m as b,mb as et,n as te,nd as Ae,oc as ve,od as je,pc as Fe,pd as kt,qa as ft,qc as Re,qd as Pt,ra as X,rc as oe,rd as be,sb as pe,sd as Mt,ta as ke,tb as y,ua as a,ub as _t,v as Oe,va as v,vb as O,w as Ee,wb as Pe,xb as he,yd as Rt,zb as xt,zd as Bt}from"./chunk-XTHSYQMN.js";var Ji=i=>[i,"tests"];function Qi(i,n){if(i&1&&(o(0,"span"),m(1),l(2,"date"),E(3,"wbr"),m(4),l(5,"date"),d()),i&2){let s=u();a(),h("",G(2,2,s.event.dateFrom,"dd.MM.yyyy"),"\u2013"),a(3),x(G(5,5,s.event.dateTo,"dd.MM.yyyy"))}}function Xi(i,n){if(i&1&&(o(0,"a",10)(1,"i",11),m(2,"arrow_right_alt"),d(),o(3,"span",12),m(4),d()()),i&2){let s=u(2);p("routerLink",O(2,Ji,s.event.id)),a(4),x(s.event.evaluationText)}}function Zi(i,n){if(i&1&&(o(0,"a",13)(1,"i",11),m(2,"arrow_right_alt"),d(),o(3,"span",12),m(4),d()()),i&2){let s=u(2);p("href",s.event.evaluationLink,ke),a(4),h("",s.event.evaluationText," ")}}function en(i,n){if(i&1&&(o(0,"div",7),f(1,Xi,5,4,"a",8)(2,Zi,5,2,"a",9),d()),i&2){let s=u();a(),p("ngIf",!s.event.evaluationLink),a(),p("ngIf",s.event.evaluationLink)}}var ui=(()=>{let n=class n{constructor(){this.withRatings=!0}};n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=C({type:n,selectors:[["bkd-events-list-entry"]],inputs:{event:"event",withRatings:"withRatings"},standalone:!0,features:[y],decls:11,vars:8,consts:[[1,"designation"],[3,"href"],[1,"date"],[4,"ngIf"],[1,"registrations"],[1,"registrations-label"],["class","rating",4,"ngIf"],[1,"rating"],["class","d-flex",3,"routerLink",4,"ngIf"],["class","d-flex",3,"href",4,"ngIf"],[1,"d-flex",3,"routerLink"],[1,"material-icons"],[1,"ps-1"],[1,"d-flex",3,"href"]],template:function(t,r){t&1&&(o(0,"div",0)(1,"a",1),m(2),d()(),o(3,"div",2),f(4,Qi,6,8,"span",3),d(),o(5,"div",4),m(6),o(7,"span",5),m(8),l(9,"translate"),d()(),f(10,en,3,2,"div",6)),t&2&&(a(),p("href",r.event.detailLink,ke),a(),x(r.event.designation),a(2),p("ngIf",r.event.dateFrom&&r.event.dateTo),a(2),h(" ",r.event.studentCount," "),a(2),x(c(9,6,r.event.studentCount===1?"events.registration":"events.registrations")),a(2),p("ngIf",r.withRatings&&r.event.evaluationText))},dependencies:[R,oe,$e,P,k],styles:['[_nghost-%COMP%]{display:grid;padding:1rem;border-bottom:1px solid #dee2e6;grid-template-areas:"designation date registrations rating";grid-template-columns:4fr 2fr 2fr 3fr}.designation[_ngcontent-%COMP%]{grid-area:designation;padding-right:1rem}.date[_ngcontent-%COMP%]{grid-area:date;padding-right:1rem}.registrations[_ngcontent-%COMP%]{grid-area:registrations;padding-right:1rem}.rating[_ngcontent-%COMP%]{grid-area:rating}.rating[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{text-decoration:none}.rating[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{text-decoration:underline}.rating[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:hover{text-decoration-color:#ea161f}.registrations-label[_ngcontent-%COMP%]{display:none}@media (max-width: 575.98px){.registrations-label[_ngcontent-%COMP%]{display:inline}.designation[_ngcontent-%COMP%], .date[_ngcontent-%COMP%], .registrations[_ngcontent-%COMP%]{padding-right:0}[_nghost-%COMP%]{grid-template-areas:"designation" "date" "registrations" "rating";grid-template-columns:1fr}}']});let i=n;return i})();var tn=10300,nn=10260,rn=10250,sn=14030,an=10350;function Ye(i){let{HasEvaluationStarted:n,EvaluationUntil:s,HasTestGrading:e}=i.EvaluationStatusRef;if(n===!0&&(i.StatusId===sn||i.StatusId===an))return{value:Z.Rating};if(n===!0&&e===!1){if(s)return{value:Z.RatingUntil};if(i.StatusId===tn)return{value:Z.IntermediateRating}}return n===!1&&e===!0&&i.StatusId!==nn&&i.StatusId!==rn?{value:Z.Tests}:n===!0&&e===!0?s?{value:Z.Tests,label:Z.RatingUntil}:{value:Z.Tests,label:Z.IntermediateRating}:null}function gi(i){return i.EvaluationStatusRef.HasEvaluationStarted===!0}function fi(i){return i.EvaluationStatusRef.HasReviewOfEvaluationStarted===!0&&!!i.FinalGrades?.length}function Ke(i){let n=i.Classes?i.Classes.map(s=>s.Number).join(", "):null;return n?i.Designation+", "+n:i.Designation}var Z=function(i){return i.Rating="rating",i.RatingUntil="rating-until",i.IntermediateRating="intermediate-rating",i.Tests="add-tests",i}(Z||{}),Te=(()=>{let n=class n{constructor(e,t,r,g,w,S){this.coursesRestService=e,this.eventsRestService=t,this.studyClassRestService=r,this.loadingService=g,this.translate=w,this.settings=S,this.loading$=this.loadingService.loading$,this.searchFields$=new L(["designation"]),this.searchSubject$=new L(""),this.search$=this.searchSubject$.asObservable(),this.roles$=new L(null),this.isClassTeacher$=this.roles$.pipe(b(F=>Nt(F,"ClassTeacherRole")),J(1)),this.withStudyCourses$=new L(!1),this.unratedCourses$=this.roles$.pipe(D(this.loadUnratedCourses.bind(this)),J(1)),this.studyCourses$=this.withStudyCourses$.pipe(D(this.loadStudyCourses.bind(this)),J(1)),this.formativeAssessments$=this.isClassTeacher$.pipe(D(this.loadFormativeAssessments.bind(this)),J(1)),this.studyClasses$=this.isClassTeacher$.pipe(D(this.loadStudyClasses.bind(this)),J(1)),this.events$=this.getEvents().pipe(J(1)),this.filteredEvents$=te([this.events$,this.searchFields$,this.search$]).pipe(b(ye(di)))}setSearch(e){this.searchSubject$.next(e)}setRoles(e){this.roles$.next(e)}setWithStudyCourses(e){this.withStudyCourses$.next(e)}setSearchFields(e){this.searchFields$.next(e)}getEntries(e=!1){return this.filteredEvents$.pipe(b(t=>e?t.filter(r=>r.evaluationText):t))}getEvents(){return this.loadingService.load(te([this.unratedCourses$,this.studyCourses$,this.formativeAssessments$,this.studyClasses$]),{stopOnFirstValue:!0}).pipe(b(ye(this.createAndSortEvents.bind(this))))}loadUnratedCourses(e){return this.coursesRestService.getExpandedCourses(e).pipe(b(t=>t.filter(r=>!fi(r))))}loadStudyCourses(e){return e?this.eventsRestService.getStudyCourseEvents():Y([])}loadFormativeAssessments(e){return e?this.studyClassRestService.getActiveFormativeAssessments():Y([])}loadStudyClasses(e){return e?this.studyClassRestService.getActive():Y([])}createAndSortEvents(e,t,r,g){let w=g.filter(S=>!r.map(F=>F.Id).includes(S.Id));return[...this.createFromCourses(e),...this.createFromStudyCourses(t),...this.createFromAssessments(r),...this.createFromStudyClasses(w)].sort((S,F)=>S.designation.localeCompare(F.designation))}createFromCourses(e){return e.map(t=>{let r=Ye(t);return{id:t.Id,designation:Ke(t),detailLink:this.buildLink(t.Id,"eventdetail"),studentCount:t.AttendanceRef.StudentCount||0,dateFrom:t.DateFrom,dateTo:t.DateTo,state:r?.value||null,evaluationText:this.getEvaluationText(r,t.EvaluationStatusRef.EvaluationUntil),evaluationLink:this.getEvaluationLink(r?.value,t)}})}createFromStudyCourses(e){return e.map(t=>({id:t.Id,designation:t.Designation,detailLink:this.buildLink(t.Id,"eventdetail"),studentCount:t.StudentCount,state:null}))}createFromAssessments(e){return this.createFromStudyClasses(e).map(r=>H(B({},r),{state:Z.Rating,evaluationText:this.translate.instant("events.state.rating"),evaluationLink:this.buildLink(r.id,"evaluation")}))}createFromStudyClasses(e){return e.map(t=>({id:t.Id,designation:t.Number,detailLink:this.buildLink(t.Id,"eventdetail"),studentCount:t.StudentCount,state:null}))}getEvaluationText(e,t){let r=e?.label||e?.value;return r?this.translate.instant(`events.state.${r}`)+(r===Z.RatingUntil?` ${t?jt(t,"dd.MM.yyyy"):""}`:""):""}getEvaluationLink(e,t){return e&&e!==Z.Tests?this.buildLink(t.Id,"evaluation"):null}buildLink(e,t){return(this.settings.eventlist[t]??"").replace(":id",String(e))}};n.\u0275fac=function(t){return new(t||n)(U(me),U(oi),U(mi),U(Ue),U(ie),U(_e))},n.\u0275prov=ge({token:n,factory:n.\u0275fac,providedIn:"root"});let i=n;return i})();var ln=i=>({events:i});function pn(i,n){i&1&&(o(0,"div",12),m(1),l(2,"translate"),d()),i&2&&(a(),h(" ",c(2,1,"events.rating")," "))}function cn(i,n){if(i&1&&E(0,"bkd-events-list-entry",13),i&2){let s=n.$implicit,e=u(4);p("event",s)("withRatings",e.withRatings)}}function mn(i,n){if(i&1&&(W(0),o(1,"div",6)(2,"div",7),m(3),l(4,"translate"),d(),o(5,"div",8),m(6),l(7,"translate"),d(),o(8,"div",9),m(9),l(10,"translate"),d(),f(11,pn,3,3,"div",10),d(),f(12,cn,1,2,"bkd-events-list-entry",11),z()),i&2){let s=u(2).bkdLet,e=u();a(3),x(c(4,5,"events.designation")),a(3),x(c(7,7,"events.date")),a(3),h(" ",c(10,9,"events.registrations")," "),a(2),p("ngIf",e.withRatings),a(),p("ngForOf",s.events)}}function un(i,n){i&1&&(o(0,"p",14),m(1),l(2,"translate"),d()),i&2&&(a(),x(c(2,1,"events.no-events")))}function gn(i,n){if(i&1&&(W(0),f(1,mn,13,11,"ng-container",5)(2,un,3,3,"ng-template",null,1,se),z()),i&2){let s=A(3),e=u().bkdLet;a(),p("ngIf",(e.events==null?null:e.events.length)>0)("ngIfElse",s)}}function fn(i,n){i&1&&E(0,"bkd-spinner")}function hn(i,n){if(i&1){let s=M();o(0,"div",3)(1,"bkd-resettable-input",4),l(2,"async"),l(3,"translate"),l(4,"translate"),_("valueChange",function(t){I(s);let r=u();return T(r.state.setSearch(t))}),d(),f(5,gn,4,2,"ng-container",5),l(6,"async"),f(7,fn,1,0,"ng-template",null,0,se),d()}if(i&2){let s=n.bkdLet,e=A(8),t=u();a(),p("value",c(2,6,t.state.search$))("placeholder",c(3,8,"events.search-by"))("label",c(4,10,"events.search"))("disabled",!s.events),a(4),p("ngIf",c(6,12,t.state.loading$)===!1)("ngIfElse",e)}}var hi=["designation"],vn=[...hi,"evaluationText"],Je=(()=>{let n=class n{constructor(e,t){this.state=e,this.storage=t,this.withStudyCourses=!1,this.withRatings=!0,this.state.setRoles(this.storage.getPayload()?.roles??null)}ngOnChanges(e){e.withStudyCourses&&this.state.setWithStudyCourses(e.withStudyCourses.currentValue),e.withRatings&&this.state.setSearchFields(e.withRatings.currentValue?vn:hi)}};n.\u0275fac=function(t){return new(t||n)(v(Te),v(Lt))},n.\u0275cmp=C({type:n,selectors:[["bkd-events-list"]],inputs:{withStudyCourses:"withStudyCourses",withRatings:"withRatings"},standalone:!0,features:[fe,y],decls:2,vars:5,consts:[["loading",""],["noEvents",""],["class","bkd-container",4,"bkdLet"],[1,"bkd-container"],[1,"d-flex","search",3,"valueChange","value","placeholder","label","disabled"],[4,"ngIf","ngIfElse"],[1,"event-header"],[1,"designation"],[1,"date"],[1,"registrations"],["class","rating",4,"ngIf"],[3,"event","withRatings",4,"ngFor","ngForOf"],[1,"rating"],[3,"event","withRatings"],[1,"mt-3"]],template:function(t,r){t&1&&(f(0,hn,9,14,"div",2),l(1,"async")),t&2&&p("bkdLet",O(3,ln,c(1,1,r.state.getEntries(r.withRatings))))},dependencies:[Q,pi,R,ce,Se,j,P,k,ui],styles:['.search[_ngcontent-%COMP%]{max-width:500px}.event-header[_ngcontent-%COMP%]{display:grid;padding:1rem;border-bottom:2px solid #dee2e6;grid-template-areas:"designation date registrations rating";grid-template-columns:4fr 2fr 2fr 3fr}@media (max-width: 575.98px){.event-header[_ngcontent-%COMP%]{display:none}}']});let i=n;return i})();var vi=(()=>{let n=class n{constructor(){}};n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=C({type:n,selectors:[["bkd-events-current"]],standalone:!0,features:[y],decls:4,vars:5,consts:[[3,"withStudyCourses","withRatings"]],template:function(t,r){t&1&&(o(0,"h1"),m(1),l(2,"translate"),d(),E(3,"bkd-events-list",0)),t&2&&(a(),x(c(2,3,"events.current.title")),a(2),p("withStudyCourses",!0)("withRatings",!1))},dependencies:[Je,P,k]});let i=n;return i})();var _i=(()=>{let n=class n{constructor(){}};n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=C({type:n,selectors:[["bkd-events-tests"]],standalone:!0,features:[y],decls:4,vars:4,consts:[[3,"withRatings"]],template:function(t,r){t&1&&(o(0,"h1"),m(1),l(2,"translate"),d(),E(3,"bkd-events-list",0)),t&2&&(a(),x(c(2,2,"events.title")),a(2),p("withRatings",!0))},dependencies:[Je,P,k]});let i=n;return i})();var xi=(()=>{let n=class n{constructor(){}};n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=C({type:n,selectors:[["bkd-events"]],standalone:!0,features:[pe([Te,Vt]),y],decls:1,vars:0,template:function(t,r){t&1&&E(0,"router-outlet")},dependencies:[Fe]});let i=n;return i})();function bi(i){return n=>{let s=Number(n.value);return s<=i?{greaterThan:{value:s,greaterThanValue:i}}:null}}function nt(i){return i.map(({finalGrade:n})=>n).filter(_n)}function _n(i){return i!==null}function Si(i,n,s,e){return i?.map(t=>({student:t,finalGrade:bn(t,s,e),grades:xn(t,n)}))}function xn(i,n){return n.map(s=>{if(s.Results===void 0||s.Results?.length===0)return{kind:"no-result",test:s};let e=s.Results?.find(t=>t.StudentId===i.Id);return e!==void 0?{kind:"grade",result:e,test:s}:{kind:"no-result",test:s}})}function bn(i,n,s){let e=n.find(r=>r.StudentId===i.Id),t=s.find(r=>r.StudentId===i.Id);return e?{id:e.Id,average:Cn(e),finalGradeId:e.GradeId,freeHandGrade:t?Number(t.Grade):null,canGrade:e.CanGrade}:null}function Cn(i){return i.AverageTestResult===0?null:i.AverageTestResult}var Ii=({key:i,ascending:n})=>(s,e)=>{let t=n?1:-1;switch(i){case"FullName":return t*s.student.FullName.localeCompare(e.student.FullName);case"FinalGrade":return!s.finalGrade?.finalGradeId||!e.finalGrade?.finalGradeId?t*-1:t*Ci(s.finalGrade.finalGradeId,e.finalGrade.finalGradeId);case"TestsMean":return!s.finalGrade?.average||!e.finalGrade?.average?t*-1:t*Ci(s.finalGrade.average,e.finalGrade.average)}return t*yn(i,s,e)},yn=(i,n,s)=>{let e=n.grades.filter(yi).find(r=>r.test.Id===i.Id),t=s.grades.filter(yi).find(r=>r.test.Id===i.Id);return i.IsPointGrading&&e?.result.GradeId===t?.result.GradeId?(e?.result.Points??0)-(t?.result.Points??0):((e?.result.GradeId??Number.POSITIVE_INFINITY)-(t?.result.GradeId??Number.POSITIVE_INFINITY))*-1};function Ci(i,n){return i===n?0:is.average).filter(s=>s!=null&&s!==0).map(Number);return tt(n)}function Ei(i,n){let s=i.map(t=>t.freeHandGrade).filter(t=>!!t),e=i.map(t=>t.finalGradeId).filter(t=>t!==null).map(t=>n.find(r=>r.Key===t)).filter(t=>t!==void 0).map(t=>t?.Value).filter(t=>t!==void 0).map(Number).filter(t=>!isNaN(t));return tt([...e,...s])}function rt(i,n){return[...n.filter(s=>s.Id!==i?.Id),i].filter(s=>s!=null)}function ki({id:i,selectedGradeId:n},s){return s.map(e=>e.Id!==i?e:H(B({},e),{GradeId:n}))}function Pi(i,n){switch(n.type){case"reset":return n.payload;case"updateResult":return i?H(B({},i),{Tests:qt(n.payload.testResult,i.Tests||[],n.payload.ignore),Gradings:n.payload.grading?rt(n.payload.grading,i.Gradings||[]):i.Gradings}):null;case"deleteResult":return i?H(B({},i),{Tests:Yt(n.payload.testId,n.payload.studentId,i.Tests||[]),Gradings:n.payload.grading?rt(n.payload.grading,i.Gradings||[]):i.Gradings||[]}):null;case"toggle-test-state":return i?H(B({},i),{Tests:Kt(n.payload,i.Tests||[])}):null;case"final-grade-overwritten":return i?H(B({},i),{Gradings:ki({id:n.payload.id,selectedGradeId:n.payload.selectedGradeId},i.Gradings||[])}):null;case"replace-grades":return i?H(B({},i),{Gradings:n.payload}):null;case"delete-test":return i?H(B({},i),{Tests:Jt(n.payload,i.Tests||[])}):null;default:return i}}var Mi=(()=>{let n=class n extends Ht{constructor(e,t){super(e,t,ti,"Gradings")}updateGrade(e,t){return this.http.put(`${this.baseUrl}/${e}`,{GradeId:t}).pipe(b(()=>e))}};n.\u0275fac=function(t){return new(t||n)(U(Ct),U(_e))},n.\u0275prov=ge({token:n,factory:n.\u0275fac,providedIn:"root"});let i=n;return i})();var st={onlyMine:!1,hidePublished:!1},V=(()=>{let n=class n{constructor(e,t,r,g,w){this.coursesRestService=e,this.gradingScalesRestService=t,this.gradingsRestService=r,this.loadingService=g,this.sortService=w,this.action$=new Ze(1),this.loading$=this.loadingService.loading$,this._courseId$=new Ze(1),this.courseId$=this._courseId$.asObservable(),this.fetchedCourse$=this._courseId$.pipe(D(S=>this.loadingService.load(this.coursesRestService.getExpandedCourse(S))),J(1)),this.course$=Oe(this.action$,this.fetchedCourse$.pipe(Ee(Ne),b(S=>({type:"reset",payload:S})))).pipe(pt(Pi,null),Ee(Ne),J(1)),this.tests$=this.course$.pipe(b(S=>S.Tests||[]),b(Qt)),this.hasTests$=this.tests$.pipe(b(S=>S.length>0)),this.filterSubject$=new L(st),this.filter$=this.filterSubject$.asObservable(),this.expandedHeaderSubject$=new L(!1),this.expandedHeader$=this.expandedHeaderSubject$.asObservable(),this.filteredTests$=te([this.tests$,this.filter$]).pipe(b(([S,F])=>S.filter(q=>(!F.onlyMine||q.IsOwner)&&(!F.hidePublished||!q.IsPublished)))),this.sorting$=this.sortService.sorting$,this.studentGrades$=te([this.course$,this.filteredTests$,this.sorting$]).pipe(b(ye(this.toStudentGrades.bind(this)))),this.canSetFinalGrade$=this.course$.pipe(b(gi)),this.gradingScaleIds$=this.course$.pipe(b(S=>Bt([...(S.Tests??[]).map(F=>F.GradingScaleId),S.GradingScaleId]).filter(Ne)),K(Rt),J(1)),this.gradingScales$=this.gradingScaleIds$.pipe(D(S=>this.gradingScalesRestService.getGradingScales(S)),J(1)),this.UNDEFINED_GRADINGSCALE_ID=-1,this.gradingScalesOptions$=this.gradingScales$.pipe(b(S=>S.map(F=>{let q=F?.Id||this.UNDEFINED_GRADINGSCALE_ID,we=F?.Grades.map(Me=>({Key:Me.Id,Value:Me.Designation}))||[];return{id:q,options:we}}).reduce((F,q)=>H(B({},F),{[q.id]:q.options}),{})),J(1)),this.meanOfStudentGradesForCourse$=this.studentGrades$.pipe(b(S=>wi(nt(S)))),this.meanOfFinalGradesForCourse$=te([this.gradingScalesOptions$,this.studentGrades$]).pipe(D(ye(this.meanOfOverwrittenGradesForCourse.bind(this))))}setCourseId(e){this._courseId$.next(e)}setFilter(e){this.filterSubject$.next(e)}gradingOptionsForTest$(e){return this.gradingOptions$(e.GradingScaleId)}gradingOptionsForCourse$(){return this.course$.pipe(D(e=>this.gradingOptions$(e.GradingScaleId)))}toStudentGrades(e,t=[],r){return Si(e.ParticipatingStudents??[],t,e.Gradings??[],e.FinalGrades??[]).sort(Ii(r))}setSorting(e){this.sortService.setSorting(e)}getSortingChar$(e){return this.sortService.getSortingChar$(e)}sortBy(e){this.sortService.toggleSorting(e)}toggleHeader(e){this.expandedHeaderSubject$.next(e)}optimisticallyUpdateGrade(e){return this.course$.pipe(ne(1),b(t=>{let{originalResult:r,updatedResult:g}=this.buildOptimisticResultUpdate(t,e);return this.updateTestResult(g,null),r}))}saveGrade(e,t){this.course$.pipe(ne(1),D(r=>this.coursesRestService.updateTestResult(r.Id,e).pipe(ot(g=>(t&&this.updateTestResult(B({},t),null),at(()=>g)))))).subscribe(({testResult:r,grading:g})=>this.updateOrDeleteTestResult(e.testId,e.studentId,r,g,"gradeId"in e?"grade":"points"))}publish(e){this.coursesRestService.publishTest(e.Id).subscribe(this.toggleTestPublishedState.bind(this))}unpublish(e){this.coursesRestService.unpublishTest(e.Id).subscribe(this.toggleTestPublishedState.bind(this))}deleteTest(e){this.action$.next({type:"delete-test",payload:e})}overwriteFinalGrade({id:e,selectedGradeId:t}){this.gradingsRestService.updateGrade(e,t).subscribe(()=>{this.action$.next({type:"final-grade-overwritten",payload:{id:e,selectedGradeId:t}})})}setAveragesAsFinalGrades(e){this.coursesRestService.setAverageAsFinalGrade(e).subscribe(t=>this.action$.next({type:"replace-grades",payload:t.Gradings}))}buildOptimisticResultUpdate(e,t){let r=zt(e,t.testId,t.studentId),g=r?B({},r):{Id:"",TestId:t.testId,StudentId:t.studentId,CourseRegistrationId:0,GradeId:null,GradeValue:null,GradeDesignation:null,Points:null};return g.GradeId="gradeId"in t?t.gradeId:r?.GradeId??null,g.Points="points"in t?t.points:r?.Points??null,{originalResult:r,updatedResult:g}}updateOrDeleteTestResult(e,t,r,g,w){r?this.updateTestResult(r,g,w):this.deleteTestResult(e,t,g)}updateTestResult(e,t,r){this.action$.next({type:"updateResult",payload:{testResult:e,grading:t??null,ignore:r}})}deleteTestResult(e,t,r){this.action$.next({type:"deleteResult",payload:{testId:e,studentId:t,grading:r}})}toggleTestPublishedState(e){this.action$.next({type:"toggle-test-state",payload:e})}gradingOptions$(e){return e===null?Y(null):this.gradingScalesOptions$.pipe(b(t=>t[e]),J(1))}meanOfOverwrittenGradesForCourse(e,t){return this.course$.pipe(b(r=>{if(r.GradingScaleId===null||e[r.GradingScaleId]===void 0)return null;let g=e[r.GradingScaleId];return Ei(nt(t),g)}))}};n.\u0275fac=function(t){return new(t||n)(U(me),U(ni),U(Mi),U(Ue),U(ci))},n.\u0275prov=ge({token:n,factory:n.\u0275fac});let i=n;return i})();var Tn=i=>({formGroup:i}),wn=i=>["/events",i,"tests"];function En(i,n){if(i&1&&(o(0,"div",31),m(1),l(2,"translate"),d()),i&2){let s=n.$implicit;a(),h(" ",G(2,1,"global.validation-errors."+s.error,s.params)," ")}}function kn(i,n){if(i&1&&(o(0,"div",31),m(1),l(2,"translate"),d()),i&2){let s=n.$implicit;a(),h(" ",G(2,1,"global.validation-errors."+s.error,s.params)," ")}}function Pn(i,n){if(i&1&&(o(0,"div",31),m(1),l(2,"translate"),d()),i&2){let s=n.$implicit;a(),h(" ",G(2,1,"global.validation-errors."+s.error,s.params)," ")}}function Mn(i,n){if(i&1&&(o(0,"div",31),m(1),l(2,"translate"),d()),i&2){let s=n.$implicit;a(),h(" ",G(2,1,"global.validation-errors."+s.error,s.params)," ")}}function On(i,n){if(i&1&&(o(0,"div",31),m(1),l(2,"translate"),d()),i&2){let s=n.$implicit;a(),h(" ",G(2,1,"global.validation-errors."+s.error,s.params)," ")}}function Gn(i,n){if(i&1&&(W(0),o(1,"div",32)(2,"div",33)(3,"div",17)(4,"label",34),m(5),l(6,"translate"),d(),o(7,"div",35),E(8,"input",36),l(9,"async"),f(10,Mn,3,4,"div",8),l(11,"async"),d()()(),o(12,"div",33)(13,"div",17)(14,"label",37),m(15),l(16,"translate"),d(),o(17,"div",35),E(18,"input",38),l(19,"async"),f(20,On,3,4,"div",8),l(21,"async"),d()()()(),o(22,"div",39),gt(),o(23,"math")(24,"mi"),m(25),l(26,"translate"),d(),o(27,"mo"),m(28,"="),d(),o(29,"mfrac")(30,"mrow")(31,"mi"),m(32),l(33,"translate"),d(),o(34,"mo"),m(35,"\xD7"),d(),o(36,"mn"),m(37,"5"),d()(),o(38,"mi"),m(39),l(40,"translate"),d()(),o(41,"mo"),m(42,"+"),d(),o(43,"mn"),m(44,"1"),d()()(),z()),i&2){let s,e,t=u(3);a(5),x(c(6,11,"tests.form.max-points")),a(3),re("is-invalid",((s=c(9,13,t.maxPointsErrors$))==null?null:s.length)||!1),a(2),p("ngForOf",c(11,15,t.maxPointsErrors$)),a(5),x(c(16,17,"tests.form.max-points-adjusted")),a(3),re("is-invalid",((e=c(19,19,t.maxPointsAdjustedErrors$))==null?null:e.length)||!1),a(2),p("ngForOf",c(21,21,t.maxPointsAdjustedErrors$)),a(5),h(" ",c(26,23,"tests.form.math.grade")," "),a(7),h(" ",c(33,25,"tests.form.math.points")," "),a(7),x(c(40,27,"tests.form.math.max-points"))}}function $n(i,n){i&1&&(o(0,"div",40)(1,"span",41),m(2,"Loading..."),d()())}function Fn(i,n){if(i&1){let s=M();o(0,"form",3),_("ngSubmit",function(){I(s);let t=u(2);return T(t.onSubmit())}),o(1,"div",4)(2,"div",5)(3,"label",6),m(4),l(5,"translate"),d(),E(6,"input",7),l(7,"async"),l(8,"translate"),f(9,En,3,4,"div",8),l(10,"async"),d(),o(11,"div",9)(12,"label",10),m(13),l(14,"translate"),d(),o(15,"div",11)(16,"span",12)(17,"i",13),m(18,"calendar_today"),d()(),o(19,"input",14,0),l(21,"async"),l(22,"translate"),_("click",function(){I(s);let t=A(20);return T(t.toggle())}),d(),f(23,kn,3,4,"div",8),l(24,"async"),d()()(),o(25,"div",15)(26,"label",16),m(27),l(28,"translate"),d(),o(29,"div",5)(30,"div",17)(31,"label",18),m(32),l(33,"translate"),d(),o(34,"div",19),E(35,"input",20),l(36,"async"),f(37,Pn,3,4,"div",8),l(38,"async"),d()()()(),o(39,"div")(40,"label",16),m(41),l(42,"translate"),d(),o(43,"div",21),E(44,"input",22),o(45,"label",23),m(46),l(47,"translate"),d()(),o(48,"div",21),E(49,"input",24),o(50,"label",25),m(51),l(52,"translate"),d()(),f(53,Gn,45,29,"ng-container",26),d(),o(54,"div",27)(55,"button",28),l(56,"async"),m(57),l(58,"translate"),d(),o(59,"button",29),m(60),l(61,"translate"),f(62,$n,3,0,"div",30),d()()()}if(i&2){let s,e,t,r=u().bkdLet,g=u();p("formGroup",r.formGroup),a(4),x(c(5,29,"tests.form.designation")),a(2),re("is-invalid",((s=c(7,31,g.designationErrors$))==null?null:s.length)||!1),p("placeholder",c(8,33,"tests.form.designation-placeholder")),a(3),p("ngForOf",c(10,35,g.designationErrors$)),a(4),x(c(14,37,"tests.form.date")),a(3),p("id",g.componentId),a(3),re("is-invalid",((e=c(21,39,g.dateErrors$))==null?null:e.length)||!1),p("placeholder",c(22,41,"shared.date-select.default-placeholder")),a(4),p("ngForOf",c(24,43,g.dateErrors$)),a(4),x(c(28,45,"tests.form.weight")),a(5),x(c(33,47,"tests.form.factor")),a(3),re("is-invalid",((t=c(36,49,g.weightErrors$))==null?null:t.length)||!1),a(2),p("ngForOf",c(38,51,g.weightErrors$)),a(4),x(c(42,53,"tests.form.grading-type")),a(3),p("value",!1),a(2),x(c(47,55,"tests.form.grades")),a(3),p("value",!0),a(2),x(c(52,57,"tests.form.points")),a(2),p("ngIf",r.formGroup.get("isPointGrading").value),a(2),p("disabled",g.saving)("routerLink",O(65,wn,c(56,59,g.courseId$))),a(2),h(" ",c(58,61,"tests.form.cancel")," "),a(2),p("disabled",g.saving),a(),h(" ",c(61,63,"tests.form.save")," "),a(2),p("ngIf",g.saving)}}function Rn(i,n){if(i&1&&(W(0),f(1,Fn,63,67,"form",2),z()),i&2){let s=n.bkdLet;a(),p("ngIf",s.formGroup)}}var Qe=(()=>{let n=class n{constructor(e,t,r){this.fb=e,this.translate=t,this.testStateService=r,this.test=null,this.saving=!1,this.save=new X,this.componentId=Dt("bkd-tests-edit-form"),this.formGroup=this.createFormGroup(),this.submitted$=new L(!1),this.destroy$=new ee,this.designationErrors$=Ce(Y(this.formGroup),this.submitted$,"designation"),this.dateErrors$=Ce(Y(this.formGroup),this.submitted$,"date"),this.maxPointsErrors$=Ce(Y(this.formGroup),this.submitted$,"maxPoints"),this.maxPointsAdjustedErrors$=Ce(Y(this.formGroup),this.submitted$,"maxPointsAdjusted"),this.weightErrors$=Ce(Y(this.formGroup),this.submitted$,"weight"),this.courseId$=this.testStateService.courseId$}ngOnInit(){this.test&&this.setInitialValues(this.test),At(Y(this.formGroup),"isPointGrading").pipe(de(this.destroy$)).subscribe(this.togglePointFieldsDisability.bind(this))}ngOnDestroy(){this.destroy$.next()}onSubmit(){this.submitted$.next(!0),this.formGroup.valid&&this.save.emit(this.formGroup.value)}createFormGroup(){return this.fb.group({designation:["",xe.required],date:[null,xe.required],weight:[1,xe.compose([xe.required,bi(0)])],isPointGrading:[!1],maxPoints:[{value:null,disabled:!0},xe.required],maxPointsAdjusted:[{value:null,disabled:!0},null]})}setInitialValues(e){this.formGroup.patchValue({designation:e.Designation,date:e.Date,weight:e.Weight,isPointGrading:e.IsPointGrading,maxPoints:e.MaxPoints,maxPointsAdjusted:e.MaxPointsAdjusted}),e.Results&&e.Results.length>0&&(this.formGroup.get("isPointGrading")?.disable(),this.formGroup.get("maxPoints")?.disable(),this.formGroup.get("maxPointsAdjusted")?.disable()),this.togglePointFieldsDisability()}togglePointFieldsDisability(){let e=this.formGroup.get("maxPoints"),t=this.formGroup.get("maxPointsAdjusted");this.formGroup.get("isPointGrading")?.value?(e?.enable(),t?.enable()):(e?.reset({value:this.test?.MaxPoints,disabled:!0}),t?.reset({value:this.test?.MaxPointsAdjusted,disabled:!0}))}};n.\u0275fac=function(t){return new(t||n)(v(Pt),v(ie),v(V))},n.\u0275cmp=C({type:n,selectors:[["bkd-tests-edit-form"]],inputs:{test:"test",saving:"saving"},outputs:{save:"save"},standalone:!0,features:[pe([{provide:Ot,useClass:Ft},{provide:Gt,useClass:li}]),y],decls:1,vars:3,consts:[["dp","ngbDatepicker"],[4,"bkdLet"],[3,"formGroup","ngSubmit",4,"ngIf"],[3,"ngSubmit","formGroup"],[1,"row","g-3","mb-3"],[1,"col-md-6"],["for","designation",1,"form-label"],["id","designation","name","designation","type","text","formControlName","designation","required","",1,"form-control",3,"placeholder"],["class","invalid-feedback",4,"ngFor","ngForOf"],[1,"col-md-6","mb-3"],["for","date",1,"form-label"],[1,"input-group"],[1,"input-group-text",3,"id"],[1,"material-icons"],["id","date","name","date","type","text","ngbDatepicker","","formControlName","date","required","",1,"form-control",3,"click","placeholder"],[1,"row","mb-3"],[1,"form-label"],[1,"row"],["for","factor",1,"form-label","col-3","col-sm-2"],[1,"col-9","col-sm-10"],["id","factor","name","factor","type","number","formControlName","weight","step","0.05","min","0","required","",1,"form-control"],[1,"form-check"],["type","radio","formControlName","isPointGrading","id","type-grades",1,"form-check-input",3,"value"],["for","type-grades",1,"form-check-label"],["type","radio","formControlName","isPointGrading","id","type-points",1,"form-check-input",3,"value"],["for","type-points",1,"form-check-label"],[4,"ngIf"],[1,"d-flex","justify-content-end","mt-4"],["type","button",1,"btn","btn-outline-secondary",3,"disabled","routerLink"],["type","submit",1,"btn","btn-primary","ms-2",3,"disabled"],["class","spinner-border spinner-border-sm align-middle","role","status",4,"ngIf"],[1,"invalid-feedback"],[1,"row","ms-4","mb-3","g-3"],[1,"col-sm-6","col-md-4"],["for","max-points",1,"ms-2","col-4","col-form-label"],[1,"col-6"],["type","number","name","maxPoints","id","max-points","formControlName","maxPoints","step","0.01","min","0","max","999","required","",1,"form-control"],["for","max-points-adjusted",1,"ms-2","col-4","col-form-label"],["type","number","name","maxPointsAdjusted","id","max-points-adjusted","formControlName","maxPointsAdjusted","step","0.01","min","0","max","999",1,"form-control"],[1,"ms-4","ps-3","py-3"],["role","status",1,"spinner-border","spinner-border-sm","align-middle"],[1,"visually-hidden"]],template:function(t,r){t&1&&f(0,Rn,2,1,"ng-container",1),t&2&&p("bkdLet",O(1,Tn,r.formGroup))},dependencies:[Q,R,be,It,Be,Le,Tt,De,yt,kt,je,Ae,Mt,wt,Et,ce,$t,oe,j,P,k],styles:["#factor[_ngcontent-%COMP%], #max-points[_ngcontent-%COMP%], #max-points-adjusted[_ngcontent-%COMP%]{width:5em}"]});let i=n;return i})();var Dn=(i,n)=>({courseId:i,saving:n});function Ln(i,n){if(i&1){let s=M();o(0,"div",1)(1,"bkd-tests-edit-form",2),_("save",function(t){I(s);let r=u();return T(r.save(t))}),d()()}if(i&2){let s=n.bkdLet;a(),p("saving",s.saving)}}var Gi=(()=>{let n=class n{constructor(e,t,r,g,w){this.route=e,this.courseService=t,this.toastService=r,this.translate=g,this.router=w,this.saving$=new L(!1),this.courseId$=this.route.paramMap.pipe(b(S=>Number(S.get("id"))),K())}save(e){this.saving$.next(!0);let{designation:t,date:r,weight:g,isPointGrading:w,maxPoints:S,maxPointsAdjusted:F}=e;this.courseId$.pipe(D(q=>this.courseService.add(q,r,t,g,w,S,F)),Ge(()=>this.saving$.next(!1))).subscribe(this.onSaveSuccess.bind(this))}onSaveSuccess(){this.toastService.success(this.translate.instant("tests.form.save-success")),this.navigateBack()}navigateBack(){this.courseId$.subscribe(e=>this.router.navigate(["events",e,"tests"]))}};n.\u0275fac=function(t){return new(t||n)(v(ve),v(me),v(He),v(ie),v(Re))},n.\u0275cmp=C({type:n,selectors:[["bkd-tests-add"]],standalone:!0,features:[y],decls:6,vars:11,consts:[["class","bkd-container bkd-container-limited",4,"bkdLet"],[1,"bkd-container","bkd-container-limited"],[3,"save","saving"]],template:function(t,r){t&1&&(o(0,"h1"),m(1),l(2,"translate"),d(),f(3,Ln,2,1,"div",0),l(4,"async"),l(5,"async")),t&2&&(a(),x(c(2,2,"tests.add-title")),a(2),p("bkdLet",Pe(8,Dn,c(4,4,r.courseId$),c(5,6,r.saving$))))},dependencies:[Q,Qe,j,P,k]});let i=n;return i})();var $i=(()=>{let n=class n{constructor(e){this.activeModal=e}get canDeleteTest(){return(this.test?.Results?.filter(t=>t.GradeId!==null||t.GradeValue!==null||t.Points!==null)||[]).length===0}};n.\u0275fac=function(t){return new(t||n)(v(Ve))},n.\u0275cmp=C({type:n,selectors:[["bkd-tests-delete"]],inputs:{test:"test"},standalone:!0,features:[y],decls:13,vars:10,consts:[[1,"modal-body"],["data-testid","confirmation-message"],[1,"modal-footer"],["data-testid","cancel-button","type","button",1,"btn","btn-outline-secondary",3,"click","hidden"],[1,"px-2"],["data-testid","confirm-button","type","button",1,"btn","btn-primary",3,"click"],[1,"px-3"]],template:function(t,r){t&1&&(o(0,"div",0)(1,"p",1),m(2),l(3,"translate"),d()(),o(4,"div",2)(5,"button",3),_("click",function(){return r.activeModal.dismiss()}),o(6,"span",4),m(7),l(8,"translate"),d()(),o(9,"button",5),_("click",function(){return r.activeModal.close(r.canDeleteTest?r.test:null)}),o(10,"span",6),m(11),l(12,"translate"),d()()()),t&2&&(a(2),h(" ",c(3,4,r.canDeleteTest?"tests.form.confirm":"tests.form.delete-not-allowed")," "),a(3),p("hidden",!r.canDeleteTest),a(2),h(" ",c(8,6,"tests.dialog.no")," "),a(4),h(" ",c(12,8,r.canDeleteTest?"tests.dialog.yes":"tests.dialog.ok")," "))},dependencies:[P,k]});let i=n;return i})();var Vn=(i,n,s)=>({courseId:i,test:n,saving:s}),Hn=i=>({test:i});function Nn(i,n){if(i&1){let s=M();W(0),o(1,"div",4)(2,"h1"),m(3),l(4,"translate"),d(),o(5,"button",5),_("click",function(){I(s);let t=u().bkdLet,r=u();return T(r.openDeleteModal(t.test))}),o(6,"i",6),m(7,"delete"),d()()(),o(8,"bkd-tests-edit-form",7),_("save",function(t){I(s);let r=u(2);return T(r.save(t))}),d(),z()}if(i&2){let s=u().bkdLet;a(3),h(" ",G(4,3,"tests.edit-title",O(6,Hn,s.test.Designation))," "),a(5),p("test",s.test)("saving",s.saving)}}function Un(i,n){i&1&&E(0,"bkd-spinner")}function Wn(i,n){if(i&1&&(o(0,"div",2),f(1,Nn,9,8,"ng-container",3),l(2,"async"),f(3,Un,1,0,"ng-template",null,0,se),d()),i&2){let s=A(4),e=u();a(),p("ngIf",c(2,2,e.state.loading$)===!1)("ngIfElse",s)}}var Fi=(()=>{let n=class n{constructor(e,t,r,g,w,S,F){this.state=e,this.courseService=t,this.route=r,this.toastService=g,this.translate=w,this.router=S,this.modalService=F,this.saving$=new L(!1),this.testId$=this.route.paramMap.pipe(b(q=>Number(q.get("testId"))),K()),this.test$=te([this.state.tests$,this.testId$]).pipe(b(([q,we])=>q.find(Me=>Me.Id===we)))}openDeleteModal(e){let t=this.modalService.open($i);t.componentInstance.test=e,t.result.then(r=>{r&&this.courseService.delete(e.CourseId,e.Id).subscribe(this.onDeleteSuccess.bind(this))},()=>{})}save(e){this.saving$.next(!0);let{designation:t,date:r,weight:g,isPointGrading:w,maxPoints:S,maxPointsAdjusted:F}=e;te([this.state.courseId$,this.testId$]).pipe(ne(1),D(([q,we])=>this.courseService.update(q,we,t,r,g,w,S,F)),Ge(()=>this.saving$.next(!1))).subscribe(this.onSaveSuccess.bind(this))}onSaveSuccess(){this.toastService.success(this.translate.instant("tests.form.save-success")),this.navigateBack()}onDeleteSuccess(e){this.toastService.success(this.translate.instant("tests.form.delete-success")),this.state.deleteTest(e),this.navigateBack()}navigateBack(){this.state.courseId$.pipe(ne(1)).subscribe(e=>this.router.navigate(["events",e,"tests"]))}};n.\u0275fac=function(t){return new(t||n)(v(V),v(me),v(ve),v(He),v(ie),v(Re),v(qe))},n.\u0275cmp=C({type:n,selectors:[["bkd-tests-edit"]],standalone:!0,features:[y],decls:4,vars:11,consts:[["loading",""],["class","bkd-container bkd-container-limited",4,"bkdLet"],[1,"bkd-container","bkd-container-limited"],[4,"ngIf","ngIfElse"],[1,"d-flex","justify-content-between","align-items-center"],["type","button",1,"btn","btn-primary","btn-icon",3,"click"],[1,"material-icons"],[3,"save","test","saving"]],template:function(t,r){t&1&&(f(0,Wn,5,4,"div",1),l(1,"async"),l(2,"async"),l(3,"async")),t&2&&p("bkdLet",he(7,Vn,c(1,1,r.state.courseId$),c(2,3,r.test$),c(3,5,r.saving$)))},dependencies:[Q,R,Qe,Se,j,P,k]});let i=n;return i})();var zn=i=>({designation:i}),Ri=(()=>{let n=class n{constructor(e){this.activeModal=e}};n.\u0275fac=function(t){return new(t||n)(v(Ve))},n.\u0275cmp=C({type:n,selectors:[["bkd-publish-test"]],inputs:{test:"test"},standalone:!0,features:[y],decls:11,vars:12,consts:[[1,"modal-body"],["data-testid","confirmation-message"],[1,"modal-footer"],["data-testid","cancel-button","type","button",1,"btn","btn-outline-secondary",3,"click"],["data-testid","confirm-button","type","button",1,"btn","btn-primary",3,"click"]],template:function(t,r){t&1&&(o(0,"div",0)(1,"p",1),m(2),l(3,"translate"),d()(),o(4,"div",2)(5,"button",3),_("click",function(){return r.activeModal.dismiss()}),m(6),l(7,"translate"),d(),o(8,"button",4),_("click",function(){return r.activeModal.close(!0)}),m(9),l(10,"translate"),d()()),t&2&&(a(2),h(" ",G(3,3,r.test.IsPublished?"tests.publishing.unpublish":"tests.publishing.publish",O(10,zn,r.test.Designation))," "),a(4),h(" ",c(7,6,"tests.publishing.cancel")," "),a(3),h(" ",c(10,8,"tests.publishing.confirm")," "))},dependencies:[P,k],encapsulation:2});let i=n;return i})();var qn=i=>({maxPoints:i});function Yn(i,n){if(i&1&&(o(0,"div",8),m(1),l(2,"translate"),d()),i&2){let s=u(2);a(),h(" ",G(2,1,"global.validation-errors.invalidPoints",O(4,qn,s.maxPoints))," ")}}function Kn(i,n){if(i&1){let s=M();o(0,"div",5)(1,"input",6,0),_("ngModelChange",function(){I(s);let t=A(2),r=u();return T(r.onPointsChange(t.value))}),d(),f(3,Yn,3,6,"div",7),d()}if(i&2){let s=A(2),e=u();a(),re("is-invalid",s.errors),le("max",e.maxPoints),le("tabindex",e.tabIndex),p("disabled",e.grade.test.IsPublished)("ngModel",e.grade.kind==="grade"?e.grade.result.Points:null),a(2),p("ngIf",s.errors)}}var Jn=1250,Bi=(()=>{let n=class n{constructor(e){this.state=e,this.maxPoints=0,this.pointsSubject$=new ee,this.gradeSubject$=new ee,this.gradingScaleDisabledSubject$=new L(!0),this.gradingScaleDisabled$=this.gradingScaleDisabledSubject$.asObservable(),this.destroy$=new ee}ngOnInit(){this.gradingScaleDisabledSubject$.next(this.disableGradingScale()),this.maxPoints=Ti(this.grade),this.initSave(this.pointsSubject$.pipe(Ee(this.isValid.bind(this)),b(e=>({studentId:this.student.Id,testId:this.grade.test.Id,points:e?Number(e):null})))),this.initSave(this.gradeSubject$.pipe(b(e=>({studentId:this.student.Id,testId:this.grade.test.Id,gradeId:e}))))}ngOnChanges(){this.gradingScaleDisabledSubject$.next(this.disableGradingScale())}ngOnDestroy(){this.destroy$.next()}onPointsChange(e){this.pointsSubject$.next(e),this.gradingScaleDisabledSubject$.next(!(e===null||e===""))}onGradeChange(e){this.gradeSubject$.next(e)}isValid(e){return e===""||e===null?!0:isNaN(Number(e))?!1:!(Number(e)<0||Number(e)>this.maxPoints)}initSave(e){e.pipe(dt(t=>this.state.optimisticallyUpdateGrade(t).pipe(b(r=>({params:t,originalResult:r})))),lt(Jn),de(this.destroy$)).subscribe(({params:t,originalResult:r})=>this.state.saveGrade(t,r))}disableGradingScale(){return this.grade.test.IsPublished?!0:this.grade.kind==="no-result"?!1:this.grade.result.Points!=null&&this.grade.test.IsPointGrading}};n.\u0275fac=function(t){return new(t||n)(v(V))},n.\u0275cmp=C({type:n,selectors:[["bkd-grade"]],inputs:{grade:"grade",student:"student",tabIndex:"tabIndex",gradeOptions:"gradeOptions"},standalone:!0,features:[fe,y],decls:5,vars:8,consts:[["points","ngModel"],[1,"d-flex","flex-column","w-100"],[1,"d-flex","flex-row"],["class","point-input-container me-2 me-md-3",4,"ngIf"],["data-testid","grade-select",1,"grade-select",3,"valueChange","options","allowEmpty","value","disabled","tabindex"],[1,"point-input-container","me-2","me-md-3"],["type","number","step","0.01","min","0","data-testid","point-input",1,"form-control",3,"ngModelChange","max","disabled","tabindex","ngModel"],["class","invalid-feedback","data-testid","validation-error-message",4,"ngIf"],["data-testid","validation-error-message",1,"invalid-feedback"]],template:function(t,r){t&1&&(o(0,"div",1)(1,"div",2),f(2,Kn,4,7,"div",3),o(3,"bkd-select",4),l(4,"async"),_("valueChange",function(w){return r.onGradeChange(w)}),d()()()),t&2&&(a(2),p("ngIf",r.grade.test.IsPointGrading),a(),p("options",r.gradeOptions)("allowEmpty",!0)("value",r.grade.kind==="grade"?r.grade.result.GradeId:null)("disabled",c(4,6,r.gradingScaleDisabled$))("tabindex",r.tabIndex))},dependencies:[R,be,Be,Le,De,je,Ae,St,Ie,j,P,k],styles:[".point-input-container[_ngcontent-%COMP%]{width:4em}[_nghost-%COMP%] select{min-width:13ch}@media (min-width: 576px){.point-input-container[_ngcontent-%COMP%]{width:5em}}"]});let i=n;return i})();function Qn(i,n){if(i&1&&(o(0,"span",3),m(1),d()),i&2){let s=u();a(),x(s.calculatePointsAverage(s.test))}}var Di=(()=>{let n=class n{constructor(e){this.locale=e}calculatePointsAverage(e){return this.safeAverage(e,2,We)}calculateGradeAverage(e){return this.safeAverage(e,3,ze)}safeAverage(e,t,r){try{return ei(r(e),this.locale,t)}catch{return Xt}}};n.\u0275fac=function(t){return new(t||n)(v(bt))},n.\u0275cmp=C({type:n,selectors:[["bkd-average-grades"]],inputs:{test:"test"},standalone:!0,features:[y],decls:4,vars:2,consts:[[1,"d-flex","flex-row","w-100"],["class","mr-2 mr-md-3 average-points","data-testid","average-points",4,"ngIf"],["data-testid","average-grade"],["data-testid","average-points",1,"mr-2","mr-md-3","average-points"]],template:function(t,r){t&1&&(o(0,"div",0),f(1,Qn,2,1,"span",1),o(2,"span",2),m(3),d()()),t&2&&(a(),p("ngIf",r.test.IsPointGrading),a(2),x(r.calculateGradeAverage(r.test)))},dependencies:[R],styles:[".average-points[_ngcontent-%COMP%]{min-width:4.5em}@media (min-width: 576px){.average-points[_ngcontent-%COMP%]{min-width:6em}}"]});let i=n;return i})();var Li=(()=>{let n=class n{constructor(){this.disabled=!1,this.width="13ch",this.gradeIdSelected=new X}onGradeChange(e){this.gradeId?.valueOf()!==void 0&&this.gradeIdSelected.emit({id:this.gradeId?.valueOf(),selectedGradeId:e})}};n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=C({type:n,selectors:[["bkd-grade-select"]],inputs:{options:"options",valueId:"valueId",gradeId:"gradeId",disabled:"disabled",width:"width"},outputs:{gradeIdSelected:"gradeIdSelected"},standalone:!0,features:[y],decls:1,vars:5,consts:[["data-testid","grade-select",3,"valueChange","options","allowEmpty","value","disabled","width"]],template:function(t,r){t&1&&(o(0,"bkd-select",0),_("valueChange",function(w){return r.onGradeChange(w)}),d()),t&2&&p("options",r.options)("allowEmpty",!0)("value",r.valueId)("disabled",r.disabled)("width",r.width)},dependencies:[Ie]});let i=n;return i})();var Xn=576,Ai=(()=>{let n=class n{constructor(e,t){this.portal=e,this.state=t,this.destroy$=new ee,this.handleWindowScroll=()=>{this.updateStickyVisibility(),this.updateStickyTopOffset()},this.handleWindowResize=()=>{this.updateStickyWidth(),this.updateStickyVisibility(),this.updateStickyTopOffset()},this.handleTableScroll=()=>{this.updateStickyLeftOffset()}}ngOnInit(){te([this.state.filteredTests$,this.state.expandedHeader$]).pipe(de(this.destroy$)).subscribe(()=>setTimeout(()=>this.updateStickyWidth()))}ngAfterViewInit(){this.handleWindowScroll(),this.handleTableScroll(),this.handleWindowResize(),this.window.addEventListener("scroll",this.handleWindowScroll),this.getTableScrollContainer()?.addEventListener("scroll",this.handleTableScroll),this.window.addEventListener("resize",this.handleWindowResize)}ngOnDestroy(){this.window.removeEventListener("scroll",this.handleWindowScroll),this.getTableScrollContainer()?.removeEventListener("scroll",this.handleTableScroll),this.window.removeEventListener("resize",this.handleWindowResize)}get window(){return this.portal.window??window}getTableScrollContainer(){return document.querySelector(".table-responsive-wrapper")??null}updateStickyVisibility(){if(this.isSmallBreakpointDown())return;let e=this.inlineHeader.getTop()+this.getIframeScrollY();this.stickyHeader.shown=this.getScrollTop()>e}updateStickyTopOffset(){this.isSmallBreakpointDown()||this.stickyHeader.setTopOffset(this.portal.inIframe?this.getScrollTop():0)}updateStickyLeftOffset(){this.isSmallBreakpointDown()||this.stickyHeader.setLeftOffset(this.inlineHeader.getLeft())}updateStickyWidth(){this.isSmallBreakpointDown()||(this.stickyHeader.setWidth(this.inlineHeader.getWidth()),this.stickyHeader.setColumnWidths(this.inlineHeader.getColumnWidths()),this.stickyHeader.setStickyColumnHeights(this.inlineHeader.getStickyColumnsHeights()))}getScrollTop(){return this.window.scrollY-this.portal.getIframeTop()}getIframeScrollY(){return window.scrollY}isSmallBreakpointDown(){return window.innerWidth({"btn-primary":i,"btn-outline-secondary":n}),Vi=(()=>{let n=class n{constructor(){this.filter=st,this.filterChange=new X}showOnlyMine(){this.filterChange.next(H(B({},this.filter),{onlyMine:!0}))}showAll(){this.filterChange.next(H(B({},this.filter),{onlyMine:!1}))}onHidePublishedChange(e){let t=(e.target&&e.target instanceof HTMLInputElement&&e.target?.checked)??!1;this.filterChange.next(H(B({},this.filter),{hidePublished:t}))}};n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=C({type:n,selectors:[["bkd-test-table-filter"]],inputs:{filter:"filter"},outputs:{filterChange:"filterChange"},standalone:!0,features:[y],decls:13,vars:18,consts:[[1,"only-mine-buttons"],["type","button",1,"btn","desktop",3,"click","ngClass"],["type","button",1,"btn","ms-2","desktop",3,"click","ngClass"],[1,"hide-published"],[1,"form-check"],["id","hide-published","type","checkbox",1,"form-check-input",3,"change","checked"],["for","hide-published",1,"form-check-label"]],template:function(t,r){t&1&&(o(0,"div",0)(1,"button",1),_("click",function(){return r.showAll()}),m(2),l(3,"translate"),d(),o(4,"button",2),_("click",function(){return r.showOnlyMine()}),m(5),l(6,"translate"),d()(),o(7,"div",3)(8,"div",4)(9,"input",5),_("change",function(w){return r.onHidePublishedChange(w)}),d(),o(10,"label",6),m(11),l(12,"translate"),d()()()),t&2&&(a(),p("ngClass",Pe(12,ji,!r.filter.onlyMine,r.filter.onlyMine)),a(),h(" ",c(3,6,"tests.all-tests")," "),a(2),p("ngClass",Pe(15,ji,r.filter.onlyMine,!r.filter.onlyMine)),a(),h(" ",c(6,8,"tests.owned-tests")," "),a(4),p("checked",r.filter.hidePublished),a(2),h(" ",c(12,10,"tests.hide-published")," "))},dependencies:[ae,be,P,k],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;justify-content:space-between;height:100%}.only-mine-buttons[_ngcontent-%COMP%]{display:flex;align-items:center;height:3.625rem}.hide-published[_ngcontent-%COMP%]{display:flex;align-items:center;height:2.375rem;margin-bottom:1rem}.hide-published[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{font-weight:300}.hide-published[_ngcontent-%COMP%] .form-check[_ngcontent-%COMP%]{margin-bottom:0}"]});let i=n;return i})();var Zn=["*"],Hi=(()=>{let n=class n{};n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=C({type:n,selectors:[["bkd-preserve-line-height"]],standalone:!0,features:[y],ngContentSelectors:Zn,decls:3,vars:0,template:function(t,r){t&1&&(ht(),o(0,"div"),vt(1),m(2,"\xA0"),d())},encapsulation:2});let i=n;return i})();var Ni=(()=>{let n=class n{constructor(e){this.translate=e}transform(e){return`${e.Weight} (${e.WeightPercent}%)${this.getPoints(e)}`}getPoints(e){return e.IsPointGrading?`, ${e.MaxPointsAdjusted??e.MaxPoints} ${this.translate.instant("tests.summary.points")}`:""}};n.\u0275fac=function(t){return new(t||n)(v(ie,16))},n.\u0275pipe=ut({name:"testSummaryShort",type:n,pure:!0,standalone:!0});let i=n;return i})();var er=i=>[i,"edit"];function tr(i,n){i&1&&(o(0,"i",12),m(1,"edit"),d())}function ir(i,n){if(i&1&&(o(0,"div",8)(1,"div",9)(2,"bkd-preserve-line-height"),m(3),l(4,"date"),d(),o(5,"a",10),f(6,tr,2,0,"i",11),d()(),o(7,"bkd-preserve-line-height"),m(8),l(9,"testSummaryShort"),d(),o(10,"bkd-preserve-line-height"),m(11),d()()),i&2){let s=u();a(3),x(G(4,5,s.test.Date,"dd.MM.yyyy")),a(2),p("routerLink",O(10,er,s.test.Id)),a(),p("ngIf",s.test.IsOwner&&s.test.IsPublished===!1),a(2),h(" ",c(9,8,s.test)," "),a(3),x(s.test.Owner)}}function nr(i,n){if(i&1){let s=M();o(0,"div",13)(1,"a",14),l(2,"translate"),_("click",function(){I(s);let t=u();return T(t.unpublishTest())}),o(3,"i",15),m(4,"lock"),d(),o(5,"span"),m(6),l(7,"translate"),d()(),o(8,"bkd-caret",16),_("click",function(){I(s);let t=u();return T(t.toggleHeader())}),d()()}if(i&2){let s=u();a(),le("title",c(2,3,"tests.edit")),a(5),x(c(7,5,"tests.published")),a(2),p("expanded",s.expanded)}}function rr(i,n){if(i&1){let s=M();o(0,"div",13)(1,"a",17),l(2,"translate"),_("click",function(){I(s);let t=u();return T(t.publishTest())}),o(3,"i",15),m(4,"lock_open"),d(),o(5,"span"),m(6),l(7,"translate"),d()(),o(8,"bkd-caret",16),_("click",function(){I(s);let t=u();return T(t.toggleHeader())}),d()()}if(i&2){let s=u();a(),le("title",c(2,3,"tests.publish")),a(5),x(c(7,5,"tests.not-published")),a(2),p("expanded",s.expanded)}}var Ui=(()=>{let n=class n{constructor(){this.toggle=new X,this.publish=new X,this.unpublish=new X}toggleHeader(){this.toggle.emit(!this.expanded)}publishTest(){this.publish.emit(this.test)}unpublishTest(){this.unpublish.emit(this.test)}};n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=C({type:n,selectors:[["bkd-test-table-header"]],inputs:{test:"test",expanded:"expanded"},outputs:{toggle:"toggle",publish:"publish",unpublish:"unpublish"},standalone:!0,features:[y],decls:10,vars:6,consts:[["notPublished",""],[1,"d-flex","flex-column","h-100","justify-content-between"],["role","button",1,"test-designation","d-flex","flex-row","my-3","align-items-end","justify-content-between",3,"click"],[3,"ngClass"],[1,"align-self-start",3,"expanded"],[1,"d-flex","flex-column"],["class","d-flex flex-column mb-3",4,"ngIf"],["class","d-flex align-items-center justify-content-between test-status",4,"ngIf","ngIfElse"],[1,"d-flex","flex-column","mb-3"],[1,"d-flex","flex-row","justify-content-between"],[1,"btn","btn-link","p-0","edit",3,"routerLink"],["class","material-icons",4,"ngIf"],[1,"material-icons"],[1,"d-flex","align-items-center","justify-content-between","test-status"],[1,"d-flex","btn","btn-link","ps-0","edit",3,"click","title"],[1,"material-icons","me-1"],[1,"expand-mobile",3,"click","expanded"],[1,"d-flex","btn","btn-link","ps-0",3,"click","title"]],template:function(t,r){if(t&1){let g=M();o(0,"div",1)(1,"div",2),_("click",function(){return I(g),T(r.toggleHeader())}),o(2,"div",3),m(3),d(),E(4,"bkd-caret",4),d(),o(5,"div",5),f(6,ir,12,12,"div",6)(7,nr,9,7,"div",7)(8,rr,9,7,"ng-template",null,0,se),d()()}if(t&2){let g=A(9);a(2),p("ngClass",r.expanded?"expanded":"collapsed"),a(),h(" ",r.test.Designation," "),a(),p("expanded",r.expanded),a(2),p("ngIf",r.expanded),a(),p("ngIf",r.test.IsPublished)("ngIfElse",g)}},dependencies:[ae,Wt,R,Hi,oe,$e,P,k,Ni],styles:["[_nghost-%COMP%]{font-weight:300}.collapsed[_ngcontent-%COMP%]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.test-designation[_ngcontent-%COMP%]{display:none!important}.test-status[_ngcontent-%COMP%]{order:-1;padding-bottom:1rem}.test-status[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{text-decoration:none}.test-status[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{color:#000}.test-status[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{text-decoration:underline}.test-status[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:hover{text-decoration-color:#ea161f}.edit[_ngcontent-%COMP%]{color:#00000080;text-decoration:none}@media (min-width: 811px){.test-designation[_ngcontent-%COMP%]{display:inherit!important}.test-status[_ngcontent-%COMP%]{order:initial}.expand-mobile[_ngcontent-%COMP%]{display:none!important}}"]});let i=n;return i})();var sr=["bkdTestEditGradesHeader",""],ar=(i,n,s)=>({tests:i,filter:n,expanded:s}),or=i=>({selected:i});function dr(i,n){if(i&1){let s=M();o(0,"th",13)(1,"bkd-test-table-header",14),_("toggle",function(t){I(s);let r=u(2);return T(r.state.toggleHeader(t))})("publish",function(t){I(s);let r=u(2);return T(r.publish.emit(t))})("unpublish",function(t){I(s);let r=u(2);return T(r.unpublish.emit(t))}),d()()}if(i&2){let s=n.$implicit,e=u().bkdLet,t=u();p("ngClass",s.Id===(t.selectedTest==null?null:t.selectedTest.Id)?"selected":""),a(),p("test",s)("expanded",e.expanded)}}function lr(i,n){if(i&1){let s=M();o(0,"th",15)(1,"bkd-test-table-header",14),_("toggle",function(t){I(s);let r=u(2);return T(r.state.toggleHeader(t))})("publish",function(t){I(s);let r=u(2);return T(r.publish.emit(t))})("unpublish",function(t){I(s);let r=u(2);return T(r.unpublish.emit(t))}),d()()}if(i&2){let s=n.$implicit,e=u().bkdLet,t=u();p("ngClass",s.Id===(t.selectedTest==null?null:t.selectedTest.Id)?"selected":""),a(),p("test",s)("expanded",e.expanded)}}function pr(i,n){if(i&1){let s=M();o(0,"div",19)(1,"span",18),_("click",function(){I(s);let t=u().$implicit,r=u(2);return T(r.state.sortBy(t))}),m(2),l(3,"translate"),d()()}i&2&&(a(2),h("",c(3,1,"tests.points")," "))}function cr(i,n){if(i&1){let s=M();o(0,"th",16)(1,"div",7),f(2,pr,4,3,"div",17),o(3,"div",8)(4,"span",18),_("click",function(){let t=I(s).$implicit,r=u(2);return T(r.state.sortBy(t))}),m(5),l(6,"translate"),d()(),o(7,"div",9),m(8),l(9,"async"),d()()()}if(i&2){let s=n.$implicit,e=u(2);p("ngClass",s.Id===(e.selectedTest==null?null:e.selectedTest.Id)?"selected":""),a(2),p("ngIf",s.IsPointGrading),a(3),x(c(6,4,"tests.grade")),a(3),h(" ",c(9,6,e.state.getSortingChar$(s))," ")}}function mr(i,n){if(i&1){let s=M();W(0),o(1,"tr",1)(2,"th",2)(3,"bkd-test-table-filter",3),_("filterChange",function(t){I(s);let r=u();return T(r.state.setFilter(t))}),d()(),f(4,dr,2,3,"th",4)(5,lr,2,3,"th",5),d(),o(6,"tr")(7,"th",6),_("click",function(){I(s);let t=u();return T(t.state.sortBy("FullName"))}),o(8,"div",7)(9,"div",8),m(10),l(11,"translate"),d(),o(12,"div",9),m(13),l(14,"async"),d()()(),o(15,"th",10),_("click",function(){I(s);let t=u();return T(t.state.sortBy("FinalGrade"))}),o(16,"div",7)(17,"div",8),m(18),l(19,"translate"),d(),o(20,"div",9),m(21),l(22,"async"),d()()(),o(23,"th",11),_("click",function(){I(s);let t=u();return T(t.state.sortBy("TestsMean"))}),o(24,"div",7)(25,"div",8),m(26),l(27,"translate"),d(),o(28,"div",9),m(29),l(30,"async"),d()()(),f(31,cr,10,8,"th",12),d(),z()}if(i&2){let s=n.bkdLet,e=u();a(3),p("filter",s.filter),a(),p("ngForOf",s.tests),a(),p("ngForOf",s.tests),a(5),h(" ",c(11,11,"tests.student.name")," "),a(3),h(" ",c(14,13,e.state.getSortingChar$("FullName"))," "),a(2),p("ngClass",O(23,or,e.selectedTest===void 0)),a(3),h(" ",c(19,15,"tests.grade")," "),a(3),h(" ",c(22,17,e.state.getSortingChar$("FinalGrade"))," "),a(5),h(" ",c(27,19,"tests.mean")," "),a(3),h(" ",c(30,21,e.state.getSortingChar$("TestsMean"))," "),a(2),p("ngForOf",s.tests)}}var Wi=(()=>{let n=class n{set shown(e){let t=this.element.nativeElement.classList;e?t.add("shown"):t.remove("shown")}constructor(e,t){this.state=e,this.element=t,this.sticky=!1,this.publish=new X,this.unpublish=new X}getTop(){return this.element.nativeElement.getBoundingClientRect().top}getLeft(){return this.element.nativeElement.getBoundingClientRect().left}setTopOffset(e){this.element.nativeElement.style.top=`${e}px`}setLeftOffset(e){this.element.nativeElement.style.left=`${e}px`}getWidth(){return this.element.nativeElement.getBoundingClientRect().width}setWidth(e){this.element.nativeElement.style.width=`${e}px`}getColumnWidths(){return this.getRowsAndColumns().map(e=>e.map(t=>t.getBoundingClientRect().width))}setColumnWidths(e){let t=this.getRowsAndColumns();if(t.length!==e.length||!t.every((r,g)=>r.length===e[g].length))throw new Error("Given column widths do not match number of header rows/columns");t.forEach((r,g)=>r.forEach((w,S)=>{w.style.width=`${e[g][S]}px`,w.style.minWidth=`${e[g][S]}px`}))}getStickyColumnsHeights(){return this.getRowsAndColumns(".sticky").map(e=>e.map(t=>t.getBoundingClientRect().height))}setStickyColumnHeights(e){let t=this.getRowsAndColumns(".sticky");if(t.length!==e.length||!t.every((r,g)=>r.length===e[g].length))throw new Error("Given column heights do not match number of sticky header columns");t.forEach((r,g)=>r.forEach((w,S)=>{w.style.height=`${e[g][S]}px`})),this.getRows().forEach((r,g)=>{let w=e[g].reduce((S,F)=>Math.max(S,F),0);r.style.height=`${w}px`})}getRowsAndColumns(e){return this.getRows().map(t=>Array.from(t.querySelectorAll(`th:not(.header-mobile)${e??""}`)))}getRows(){return Array.from(this.element.nativeElement.querySelectorAll("tr"))}};n.\u0275fac=function(t){return new(t||n)(v(V),v(ft))},n.\u0275cmp=C({type:n,selectors:[["thead","bkdTestEditGradesHeader",""]],hostVars:2,hostBindings:function(t,r){t&2&&re("sticky",r.sticky)},inputs:{selectedTest:"selectedTest",sticky:"sticky",shown:"shown"},outputs:{publish:"publish",unpublish:"unpublish"},standalone:!0,features:[y],attrs:sr,decls:4,vars:11,consts:[[4,"bkdLet"],[1,"header-collapsible"],["colspan","3",1,"desktop","sticky"],[3,"filterChange","filter"],["container","body","class","test-grade grade test-info-desktop",3,"ngClass",4,"ngFor","ngForOf"],["container","body","class","test-grade header-mobile test-info-mobile","colspan","3",3,"ngClass",4,"ngFor","ngForOf"],[1,"sticky","student-name",3,"click"],[1,"d-flex"],[1,"column-title"],[1,"sort-direction","ms-1"],[1,"sticky","student-grade","desktop",3,"click","ngClass"],[1,"border-end","sticky","student-average","desktop",3,"click"],["container","body","class","test-grade",3,"ngClass",4,"ngFor","ngForOf"],["container","body",1,"test-grade","grade","test-info-desktop",3,"ngClass"],[3,"toggle","publish","unpublish","test","expanded"],["container","body","colspan","3",1,"test-grade","header-mobile","test-info-mobile",3,"ngClass"],["container","body",1,"test-grade",3,"ngClass"],["class","column-title me-3 point-input-container",4,"ngIf"],[3,"click"],[1,"column-title","me-3","point-input-container"]],template:function(t,r){t&1&&(f(0,mr,32,25,"ng-container",0),l(1,"async"),l(2,"async"),l(3,"async")),t&2&&p("bkdLet",he(7,ar,c(1,1,r.state.filteredTests$),c(2,3,r.state.filter$),c(3,5,r.state.expandedHeader$)))},dependencies:[Q,j,ae,ce,R,P,k,Vi,Ui],styles:["[_nghost-%COMP%]{--student-name-column-width: 225px;--student-grade-column-width: 147px;--student-average-column-width: 100px;--test-grade-column-width: 300px;--point-input-size: 4em;--student-grade-column-offset: var(--student-name-column-width);--student-average-column-offset: calc( var(--student-grade-column-offset) + var(--student-grade-column-width) );--test-columns-offset: calc( var(--student-average-column-offset) + var(--student-average-column-width) )}@media (min-width: 1000px){[_nghost-%COMP%]{--student-name-column-width: 275px}}th[_ngcontent-%COMP%], td[_ngcontent-%COMP%]{padding:1rem}td[_ngcontent-%COMP%]{vertical-align:middle}@media (min-width: 576px){[_nghost-%COMP%]{--point-input-size: 5em}}tr[_ngcontent-%COMP%]:not(.header-collapsible) th.test-grade[_ngcontent-%COMP%], td.test-grade[_ngcontent-%COMP%], th.student-grade[_ngcontent-%COMP%], td.student-grade[_ngcontent-%COMP%]{width:calc(var(--point-input-size) + 13ch + 3rem)}@media (max-width: 810px){.desktop[_ngcontent-%COMP%]:not(.selected), .student-grade[_ngcontent-%COMP%]:not(.selected), .student-average[_ngcontent-%COMP%], .test-grade[_ngcontent-%COMP%]:not(.selected){display:none}table[_ngcontent-%COMP%], tbody[_ngcontent-%COMP%], thead[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:100%}th[_ngcontent-%COMP%], tr[_ngcontent-%COMP%]{display:flex;width:100%}.student-name[_ngcontent-%COMP%]{flex:1;display:block}.test-grade[_ngcontent-%COMP%]{flex:none;display:block}}@media (min-width: 811px){.mobile[_ngcontent-%COMP%]{display:none}.student-name[_ngcontent-%COMP%]{width:var(--student-name-column-width);min-width:var(--student-name-column-width);max-width:var(--student-name-column-width)}.student-grade[_ngcontent-%COMP%]{width:var(--student-grade-column-width);min-width:var(--student-grade-column-width);max-width:var(--student-grade-column-width)}.student-average[_ngcontent-%COMP%]{width:var(--student-average-column-width);min-width:var(--student-average-column-width);max-width:var(--student-average-column-width)}.test-grade[_ngcontent-%COMP%]{min-width:var(--test-grade-column-width);max-width:var(--test-grade-column-width)}th.sticky[_ngcontent-%COMP%], td.sticky[_ngcontent-%COMP%]{position:sticky;left:0;background-color:#fff}th.sticky.student-grade[_ngcontent-%COMP%], td.sticky.student-grade[_ngcontent-%COMP%]{left:var(--student-grade-column-offset)}th.sticky.student-average[_ngcontent-%COMP%], td.sticky.student-average[_ngcontent-%COMP%]{left:var(--student-average-column-offset)}}@media (max-width: 1200px){[_nghost-%COMP%]{--student-average-column-width: 1px}.student-average[_ngcontent-%COMP%]{padding:0;overflow:hidden}}@media (min-width: 1201px){.student-average-inline[_ngcontent-%COMP%]{display:none}}.sticky[_nghost-%COMP%]{position:fixed;top:0;left:0;z-index:1000;display:none}tr[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{border-top:none;vertical-align:top}.header-collapsible[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{border-bottom:1px solid #dee2e6;padding:0 1rem}tr[_ngcontent-%COMP%] th.test-info-desktop[_ngcontent-%COMP%]{display:none!important}@media (min-width: 811px){.sticky.shown[_nghost-%COMP%]{display:table-header-group}tr[_ngcontent-%COMP%] th.test-info-mobile[_ngcontent-%COMP%]{display:none!important}tr[_ngcontent-%COMP%] th.test-info-desktop[_ngcontent-%COMP%]{display:table-cell!important}tr[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{border-top:none;padding-top:.25rem;padding-bottom:.25rem;border-top:initial}.sticky[_nghost-%COMP%]{margin-left:var(--test-columns-offset)}.sticky[_nghost-%COMP%] th.sticky[_ngcontent-%COMP%]{position:fixed}}"],changeDetection:0});let i=n;return i})();var ur=(i,n,s)=>({tests:i,hasTests:n,studentGrades:s}),zi=i=>({selected:i}),gr=i=>["student",i,"grades"],fr=i=>({"visible-on-mobile":i});function hr(i,n){if(i&1){let s=M();o(0,"bkd-grade-select",22),l(1,"async"),l(2,"async"),_("gradeIdSelected",function(t){I(s);let r=u(3);return T(r.state.overwriteFinalGrade(t))}),d()}if(i&2){let s=u().$implicit,e=u(2);p("options",c(1,4,e.state.gradingOptionsForCourse$()))("valueId",s.finalGrade.finalGradeId)("gradeId",s.finalGrade.id)("disabled",c(2,6,e.isEditFinalGradesAllowed(s))===!1)}}function vr(i,n){if(i&1&&(o(0,"div"),m(1),d()),i&2){let s=u().$implicit;a(),h(" ",s.finalGrade.freeHandGrade," ")}}function _r(i,n){if(i&1&&(o(0,"td",23),E(1,"bkd-grade",24),l(2,"async"),d()),i&2){let s=n.$implicit,e=n.index,t=u(),r=t.$implicit,g=t.index,w=u(2);p("ngClass",w.selectedTest!==void 0&&s.test.Id===w.selectedTest.Id?"selected":""),a(),p("grade",s)("gradeOptions",c(2,5,w.state.gradingOptionsForTest$(s.test)))("student",r.student)("tabIndex",(1+e)*1e3+g)}}function xr(i,n){if(i&1&&(o(0,"tr")(1,"td",8)(2,"a",16)(3,"div"),m(4),d(),o(5,"div",10),m(6),l(7,"translate"),l(8,"decimalOrDash"),d()()(),o(9,"td",17),f(10,hr,3,8,"bkd-grade-select",18)(11,vr,2,1,"div",19),d(),o(12,"td",20),m(13),l(14,"decimalOrDash"),d(),f(15,_r,3,7,"td",21),d()),i&2){let s=n.$implicit,e=u(2);a(2),p("routerLink",O(18,gr,s.student.Id)),a(2),x(s.student.FullName),a(2),et(" ",c(7,10,"tests.mean"),": ",G(8,12,s.finalGrade==null?null:s.finalGrade.average,"1-3")," "),a(3),p("ngClass",O(20,zi,e.selectedTest===void 0)),a(),p("ngIf",s.finalGrade&&!s.finalGrade.freeHandGrade),a(),p("ngIf",s.finalGrade&&s.finalGrade.freeHandGrade),a(2),h(" ",G(14,15,s.finalGrade==null?null:s.finalGrade.average,"1-3")," "),a(2),p("ngForOf",s.grades)("ngForTrackBy",e.trackGradeOf(s.student))}}function br(i,n){if(i&1&&(o(0,"td",23),E(1,"bkd-average-grades",25),d()),i&2){let s=n.$implicit,e=u(2);p("ngClass",s.Id===(e.selectedTest==null?null:e.selectedTest.Id)||s.Id===(e.selectedTest==null?null:e.selectedTest.Id)?"selected":""),a(),p("test",s)}}function Cr(i,n){if(i&1){let s=M();o(0,"button",26),_("click",function(){I(s);let t=u(2);return T(t.setAverageAsFinalGrade())}),m(1),l(2,"translate"),d()}if(i&2){let s=u().bkdLet,e=u();p("ngClass",O(4,fr,!s.hasTests||!e.selectedTest)),a(),h(" ",c(2,2,"tests.set-final-grade")," ")}}function yr(i,n){if(i&1){let s=M();W(0),o(1,"div",3)(2,"table",4)(3,"thead",5,0),_("publish",function(t){I(s);let r=u();return T(r.publish(t))})("unpublish",function(t){I(s);let r=u();return T(r.unpublish(t))}),d(),o(5,"thead",6,1),_("publish",function(t){I(s);let r=u();return T(r.publish(t))})("unpublish",function(t){I(s);let r=u();return T(r.unpublish(t))}),d(),o(7,"tbody"),f(8,xr,16,22,"tr",7),o(9,"tr")(10,"td",8)(11,"div",9)(12,"div"),m(13),l(14,"translate"),d(),o(15,"div",10),m(16),l(17,"translate"),l(18,"async"),l(19,"decimalOrDash"),d()()(),o(20,"td",11),m(21),l(22,"async"),l(23,"decimalOrDash"),d(),o(24,"td",12),m(25),l(26,"async"),l(27,"decimalOrDash"),d(),f(28,br,2,2,"td",13),d()()(),o(29,"div",14),f(30,Cr,3,6,"button",15),l(31,"async"),d()(),z()}if(i&2){let s=n.bkdLet,e=A(4),t=A(6),r=u();a(2),p("inlineHeader",e)("stickyHeader",t),a(),p("selectedTest",r.selectedTest),a(2),p("sticky",!0)("selectedTest",r.selectedTest),a(3),p("ngForOf",s.studentGrades)("ngForTrackBy",r.trackStudentGrade),a(5),x(c(14,15,"tests.average")),a(3),et(" ",c(17,17,"tests.mean"),": ",G(19,21,c(18,19,r.state.meanOfStudentGradesForCourse$),"1-3")," "),a(4),p("ngClass",O(36,zi,r.selectedTest===void 0)),a(),h(" ",G(23,26,c(22,24,r.state.meanOfFinalGradesForCourse$),"1-3")," "),a(4),h(" ",G(27,31,c(26,29,r.state.meanOfStudentGradesForCourse$),"1-3")," "),a(3),p("ngForOf",s.tests),a(2),p("ngIf",c(31,34,r.state.canSetFinalGrade$))}}var qi=(()=>{let n=class n{constructor(e,t){this.state=e,this.modalService=t}ngOnInit(){this.state.setSorting({key:"FullName",ascending:!0})}setAverageAsFinalGrade(){this.state.course$.pipe(ne(1)).subscribe(e=>this.state.setAveragesAsFinalGrades({CourseIds:[e.Id]}))}isEditFinalGradesAllowed(e){return this.state.course$.pipe(b(t=>!!(Ye(t)?.value&&e.finalGrade?.canGrade)))}publish(e){let t=this.openModal(e);this.onCloseModal(t,()=>this.state.publish(e))}unpublish(e){let t=this.openModal(e);this.onCloseModal(t,()=>this.state.unpublish(e))}trackStudentGrade(e){return e}trackGradeOf(e){return function(t,r){return`${e.Id}_${r.test.Id}`}}calculatePointsAverage(e){return this.safeAverage(e,We)}calculateGradeAverage(e){return this.safeAverage(e,ze)}safeAverage(e,t){try{return t(e).toString()}catch{return"\u2013"}}openModal(e){let t=this.modalService.open(Ri);return t.componentInstance.test=e,t}onCloseModal(e,t){e.result.then(r=>{r&&t()},()=>{})}};n.\u0275fac=function(t){return new(t||n)(v(V),v(qe))},n.\u0275cmp=C({type:n,selectors:[["bkd-test-edit-grades"]],inputs:{selectedTest:"selectedTest"},standalone:!0,features:[pe([Te]),y],decls:4,vars:11,consts:[["inlineHeader",""],["stickyHeader",""],[4,"bkdLet"],[1,"table-responsive-wrapper"],["bkdTestEditGradesHeaderSticky","",1,"table","table-hover","h-100",3,"inlineHeader","stickyHeader"],["bkdTestEditGradesHeader","",3,"publish","unpublish","selectedTest"],["bkdTestEditGradesHeader","",3,"publish","unpublish","sticky","selectedTest"],[4,"ngFor","ngForOf","ngForTrackBy"],[1,"sticky","student-name"],[1,"d-flex","flex-column"],[1,"student-average-inline"],[1,"desktop","sticky","student-grade",3,"ngClass"],[1,"desktop","border-end","sticky","student-average"],["class","test-grade",3,"ngClass",4,"ngFor","ngForOf"],[1,"action-buttons"],["data-testId","apply-average-button","class","apply-average-button btn btn-primary m-3","type","button",3,"ngClass","click",4,"ngIf"],[3,"routerLink"],[1,"sticky","student-grade",3,"ngClass"],[3,"options","valueId","gradeId","disabled","gradeIdSelected",4,"ngIf"],[4,"ngIf"],[1,"border-end","sticky","student-average"],["class","test-grade",3,"ngClass",4,"ngFor","ngForOf","ngForTrackBy"],[3,"gradeIdSelected","options","valueId","gradeId","disabled"],[1,"test-grade",3,"ngClass"],[3,"grade","gradeOptions","student","tabIndex"],[3,"test"],["data-testId","apply-average-button","type","button",1,"apply-average-button","btn","btn-primary","m-3",3,"click","ngClass"]],template:function(t,r){t&1&&(f(0,yr,32,38,"ng-container",2),l(1,"async"),l(2,"async"),l(3,"async")),t&2&&p("bkdLet",he(7,ur,c(1,1,r.state.filteredTests$),c(2,3,r.state.hasTests$),c(3,5,r.state.studentGrades$)))},dependencies:[Q,ae,ce,R,oe,Li,Bi,Di,j,P,k,Zt,Ai,Wi],styles:["[_nghost-%COMP%]{--student-name-column-width: 225px;--student-grade-column-width: 147px;--student-average-column-width: 100px;--test-grade-column-width: 300px;--point-input-size: 4em;--student-grade-column-offset: var(--student-name-column-width);--student-average-column-offset: calc( var(--student-grade-column-offset) + var(--student-grade-column-width) );--test-columns-offset: calc( var(--student-average-column-offset) + var(--student-average-column-width) )}@media (min-width: 1000px){[_nghost-%COMP%]{--student-name-column-width: 275px}}th[_ngcontent-%COMP%], td[_ngcontent-%COMP%]{padding:1rem}td[_ngcontent-%COMP%]{vertical-align:middle}@media (min-width: 576px){[_nghost-%COMP%]{--point-input-size: 5em}}tr[_ngcontent-%COMP%]:not(.header-collapsible) th.test-grade[_ngcontent-%COMP%], td.test-grade[_ngcontent-%COMP%], th.student-grade[_ngcontent-%COMP%], td.student-grade[_ngcontent-%COMP%]{width:calc(var(--point-input-size) + 13ch + 3rem)}@media (max-width: 810px){.desktop[_ngcontent-%COMP%]:not(.selected), .student-grade[_ngcontent-%COMP%]:not(.selected), .student-average[_ngcontent-%COMP%], .test-grade[_ngcontent-%COMP%]:not(.selected){display:none}table[_ngcontent-%COMP%], tbody[_ngcontent-%COMP%], thead[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:100%}th[_ngcontent-%COMP%], tr[_ngcontent-%COMP%]{display:flex;width:100%}.student-name[_ngcontent-%COMP%]{flex:1;display:block}.test-grade[_ngcontent-%COMP%]{flex:none;display:block}}@media (min-width: 811px){.mobile[_ngcontent-%COMP%]{display:none}.student-name[_ngcontent-%COMP%]{width:var(--student-name-column-width);min-width:var(--student-name-column-width);max-width:var(--student-name-column-width)}.student-grade[_ngcontent-%COMP%]{width:var(--student-grade-column-width);min-width:var(--student-grade-column-width);max-width:var(--student-grade-column-width)}.student-average[_ngcontent-%COMP%]{width:var(--student-average-column-width);min-width:var(--student-average-column-width);max-width:var(--student-average-column-width)}.test-grade[_ngcontent-%COMP%]{min-width:var(--test-grade-column-width);max-width:var(--test-grade-column-width)}th.sticky[_ngcontent-%COMP%], td.sticky[_ngcontent-%COMP%]{position:sticky;left:0;background-color:#fff}th.sticky.student-grade[_ngcontent-%COMP%], td.sticky.student-grade[_ngcontent-%COMP%]{left:var(--student-grade-column-offset)}th.sticky.student-average[_ngcontent-%COMP%], td.sticky.student-average[_ngcontent-%COMP%]{left:var(--student-average-column-offset)}}@media (max-width: 1200px){[_nghost-%COMP%]{--student-average-column-width: 1px}.student-average[_ngcontent-%COMP%]{padding:0;overflow:hidden}}@media (min-width: 1201px){.student-average-inline[_ngcontent-%COMP%]{display:none}}tbody[_ngcontent-%COMP%] td.student-name[_ngcontent-%COMP%]{padding-right:0}tbody[_ngcontent-%COMP%] td.student-name[_ngcontent-%COMP%], tbody[_ngcontent-%COMP%] td.student-name[_ngcontent-%COMP%] *[_ngcontent-%COMP%]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}tbody[_ngcontent-%COMP%] td.student-name[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{text-decoration:none}tbody[_ngcontent-%COMP%] td.student-name[_ngcontent-%COMP%] a[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:first-child{text-decoration:underline}tbody[_ngcontent-%COMP%] td.student-name[_ngcontent-%COMP%] a[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:first-child:hover{text-decoration-color:#ea161f}.student-average-inline[_ngcontent-%COMP%]{color:#4e4e4ef2;font-size:.875rem;line-height:1}@media (min-width: 811px){.table-responsive-wrapper[_ngcontent-%COMP%]{display:block;overflow-x:auto}table[_ngcontent-%COMP%]{border-collapse:separate;border-spacing:0}.action-buttons[_ngcontent-%COMP%]{position:sticky;left:0}}@media (max-width: 810px){.apply-average-button[_ngcontent-%COMP%]:not(.visible-on-mobile){display:none!important}}"]});let i=n;return i})();var Sr=()=>["/events"],Ir=i=>({count:i});function Tr(i,n){if(i&1&&(o(0,"div",8),m(1),l(2,"translate"),d()),i&2){let s=u();a(),h(" ",G(2,1,s.course.ParticipatingStudents.length===1?"courses.registration":"courses.registrations",O(4,Ir,s.course.ParticipatingStudents.length))," ")}}var Yi=(()=>{let n=class n{constructor(e){this.reportsService=e,this.course$=new L(null),this.reports$=this.course$.pipe(b(t=>t?.Id),K(),D(t=>t?this.reportsService.getCourseReports(t):Y([])),ct([]))}ngOnChanges(e){e.course&&this.course$.next(e.course.currentValue)}getDesignation(){return Ke(this.course)}};n.\u0275fac=function(t){return new(t||n)(v(ii))},n.\u0275cmp=C({type:n,selectors:[["bkd-tests-header"]],inputs:{course:"course"},standalone:!0,features:[fe,y],decls:12,vars:7,consts:[[3,"link"],[1,"d-flex"],["routerLink","add",1,"edit","btn","btn-primary","btn-icon","ms-2"],[1,"material-icons"],[1,"ms-2",3,"reports"],["id","excel-import"],[1,"d-flex","flex-column","header"],["class","additional-info",4,"ngIf"],[1,"additional-info"]],template:function(t,r){t&1&&(o(0,"bkd-backlink",0)(1,"div",1)(2,"a",2)(3,"i",3),m(4,"add"),d()(),E(5,"bkd-reports-link",4),l(6,"async"),E(7,"div",5),d()(),o(8,"div",6)(9,"h1"),m(10),d(),f(11,Tr,3,6,"div",7),d()),t&2&&(p("link",_t(6,Sr)),a(5),p("reports",c(6,4,r.reports$)),a(5),x(r.getDesignation()),a(),p("ngIf",r.course.ParticipatingStudents))},dependencies:[si,oe,Ut,R,j,P,k],styles:[".header[_ngcontent-%COMP%]{padding-bottom:1rem;border-bottom:1px solid #dee2e6}h1[_ngcontent-%COMP%]{margin-bottom:0}.additional-info[_ngcontent-%COMP%]{color:#adb5bd}"]});let i=n;return i})();var wr=(i,n,s,e,t,r)=>({course:i,tests:n,hasTests:s,testOptions:e,selectedTestId:t,selectedTest:r}),Er=i=>({"visible-on-mobile":i});function kr(i,n){if(i&1){let s=M();W(0),o(1,"bkd-select",7),_("valueChange",function(t){I(s);let r=u(3);return T(t&&r.testSelected(t))}),d(),E(2,"bkd-test-edit-grades",8),z()}if(i&2){let s=u(2).bkdLet;a(),p("options",s.testOptions)("value",s.selectedTestId)("allowEmpty",!1),a(),p("selectedTest",s.selectedTest)}}function Pr(i,n){if(i&1&&(o(0,"a",9),l(1,"async"),o(2,"i",10),m(3,"arrow_right_alt"),d(),o(4,"span",11),m(5),l(6,"translate"),d()()),i&2){let s=u(2).bkdLet,e=u();le("href",c(1,3,e.buildLinkToRatingOverview()),ke),p("ngClass",O(7,Er,!s.hasTests||!s.selectedTest)),a(5),x(c(6,5,"tests.link-to-rating-overview"))}}function Mr(i,n){if(i&1&&(W(0),E(1,"bkd-tests-header",5),f(2,kr,3,4,"ng-container",4)(3,Pr,7,9,"a",6),l(4,"async"),z()),i&2){let s=u().bkdLet,e=u(),t=A(9);a(),p("course",s.course),a(),p("ngIf",s.tests.length>0)("ngIfElse",t),a(),p("ngIf",c(4,4,e.state.canSetFinalGrade$))}}function Or(i,n){if(i&1&&(W(0),f(1,Mr,5,6,"ng-container",4),l(2,"async"),z()),i&2){let s=u(),e=A(11);a(),p("ngIf",c(2,2,s.state.loading$)===!1)("ngIfElse",e)}}function Gr(i,n){i&1&&(o(0,"p",12),m(1),l(2,"translate"),d()),i&2&&(a(),x(c(2,1,"tests.no-tests")))}function $r(i,n){i&1&&E(0,"bkd-spinner")}var Ki=(()=>{let n=class n{constructor(e,t,r){this.settings=e,this.state=t,this.translate=r,this.selectTest$=new ee,this.testOptions$=this.state.tests$.pipe(b(g=>[{Key:-1,Value:this.translate.instant("tests.grade")},...g.map(w=>({Key:w.Id,Value:w.Designation}))]),K()),this.selectedTestId$=Oe(this.selectTest$,this.state.tests$.pipe(ne(1),b(g=>g[0]?.Id))).pipe(K()),this.selectedTest$=this.selectedTestId$.pipe(D(g=>this.state.tests$.pipe(b(w=>w.find(S=>S.Id===g)))),K())}testSelected(e){this.selectTest$.next(e)}buildLinkToRatingOverview(){return this.state.course$.pipe(ne(1),b(e=>this.settings.eventlist.evaluation.replace(":id",String(e.Id))))}};n.\u0275fac=function(t){return new(t||n)(v(_e),v(V),v(ie))},n.\u0275cmp=C({type:n,selectors:[["bkd-tests-list"]],standalone:!0,features:[y],decls:12,vars:20,consts:[["noTests",""],["loading",""],[1,"bkd-container"],[4,"bkdLet"],[4,"ngIf","ngIfElse"],[3,"course"],["class","rating-overview d-flex justify-content-end pe-3 border-top pt-3",3,"ngClass","href",4,"ngIf"],["width","100%",1,"tests-dropdown",3,"valueChange","options","value","allowEmpty"],[3,"selectedTest"],[1,"rating-overview","d-flex","justify-content-end","pe-3","border-top","pt-3",3,"ngClass","href"],[1,"material-icons","fw-bold"],[1,"ps-1"],[1,"mt-3","px-3"]],template:function(t,r){t&1&&(o(0,"div",2),f(1,Or,3,4,"ng-container",3),l(2,"async"),l(3,"async"),l(4,"async"),l(5,"async"),l(6,"async"),l(7,"async"),f(8,Gr,3,3,"ng-template",null,0,se)(10,$r,1,0,"ng-template",null,1,se),d()),t&2&&(a(),p("bkdLet",xt(13,wr,c(2,1,r.state.course$),c(3,3,r.state.tests$),c(4,5,r.state.hasTests$),c(5,7,r.testOptions$),c(6,9,r.selectedTestId$),c(7,11,r.selectedTest$))))},dependencies:[Q,R,Yi,Ie,qi,ae,Se,j,P,k],styles:[".tests-dropdown[_ngcontent-%COMP%]{display:block;padding:1rem 0}@media (min-width: 811px){.tests-dropdown[_ngcontent-%COMP%]{display:none}}a.rating-overview[_ngcontent-%COMP%]{text-decoration:none}a.rating-overview[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{text-decoration:underline}a.rating-overview[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:hover{text-decoration-color:#ea161f}@media (max-width: 810px){a.rating-overview[_ngcontent-%COMP%]:not(.visible-on-mobile){display:none!important}}"]});let i=n;return i})();var Xe=(()=>{let n=class n{constructor(e,t){this.state=e,this.route=t,this.courseId$=this.route.paramMap.pipe(b(r=>Number(r.get("id"))),K()),this.destroy$=new ee}ngOnInit(){this.courseId$.pipe(de(this.destroy$)).subscribe(e=>this.state.setCourseId(e))}ngOnDestroy(){this.destroy$.next()}};n.\u0275fac=function(t){return new(t||n)(v(V),v(ve))},n.\u0275cmp=C({type:n,selectors:[["bkd-tests"]],standalone:!0,features:[pe([V]),y],decls:1,vars:0,template:function(t,r){t&1&&E(0,"router-outlet")},dependencies:[Fe]});let i=n;return i})();var kd=[{path:"",component:xi,children:[{path:"",component:_i},{path:"current",component:vi},{path:":id",component:Xe,children:[{path:"tests",component:Ki}]},{path:":id/tests/:testId/edit",component:Xe,children:[{path:"",component:Fi}]},{path:":id/tests/add",component:Xe,children:[{path:"",component:Gi}]},{path:":id/tests",children:[ai]}]}];export{kd as EVENTS_ROUTES}; diff --git a/public/apps/webapp-schulverwaltung/main.js b/public/apps/webapp-schulverwaltung/main.js index 67e9aa43..1b6b0d35 100644 --- a/public/apps/webapp-schulverwaltung/main.js +++ b/public/apps/webapp-schulverwaltung/main.js @@ -1 +1 @@ -import{b as Ps}from"./chunk-PSXDSPKS.js";import{c as Ms}from"./chunk-5RDJZAUT.js";import{a as ws,b as As}from"./chunk-DB66EACG.js";import{r as _s}from"./chunk-C56YGDXA.js";import{a as _e}from"./chunk-UX5TA32W.js";import{$ as J,$a as ot,A as Ht,Aa as Zt,Ab as ge,Ba as ke,Bb as ye,Cd as Es,Ed as vs,Fd as Ts,Ga as be,Gd as $e,Hd as Se,Ia as oe,Id as bs,Ka as es,Lb as ns,Pb as lt,Rb as Ie,Sa as U,Sb as rs,Ta as Y,U as v,Ua as ts,Uc as ys,Vb as os,Vc as Z,W,Y as Gt,Ya as ss,Z as j,_ as H,_a as is,a as Re,c as Qt,cc as as,da as xt,dc as ls,ec as cs,fc as us,gc as hs,ha as Wt,hc as ds,ia as Jt,j as Vt,jb as ae,kb as at,lb as Oe,oa as Yt,pc as fs,qc as Le,rc as ms,sa as rt,tb as X,tc as ps,ua as q,uc as gs,va as re,vd as Ss,ya as Xt}from"./chunk-XTHSYQMN.js";function Ei(n){let e=n,t=Math.floor(Math.abs(n)),s=n.toString().replace(/^[^.]*\.?/,"").length;return t===1&&s===0?1:5}var Ds=["de-CH",[["AM","PM"],void 0,void 0],void 0,[["S","M","D","M","D","F","S"],["So.","Mo.","Di.","Mi.","Do.","Fr.","Sa."],["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],["So","Mo","Di","Mi","Do","Fr","Sa"]],[["S","M","D","M","D","F","S"],["So","Mo","Di","Mi","Do","Fr","Sa"],["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],["So.","Mo.","Di.","Mi.","Do.","Fr.","Sa."]],[["J","F","M","A","M","J","J","A","S","O","N","D"],["Jan.","Feb.","M\xE4rz","Apr.","Mai","Juni","Juli","Aug.","Sept.","Okt.","Nov.","Dez."],["Januar","Februar","M\xE4rz","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"]],[["J","F","M","A","M","J","J","A","S","O","N","D"],["Jan","Feb","M\xE4r","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],["Januar","Februar","M\xE4rz","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"]],[["v. Chr.","n. Chr."],void 0,void 0],1,[6,0],["dd.MM.yy","dd.MM.y","d. MMMM y","EEEE, d. MMMM y"],["HH:mm","HH:mm:ss","HH:mm:ss z","HH:mm:ss zzzz"],["{1}, {0}",void 0,"{1} 'um' {0}",void 0],[".","\u2019",";","%","+","-","E","\xB7","\u2030","\u221E","NaN",":"],["#,##0.###","#,##0%","\xA4\xA0#,##0.00;\xA4-#,##0.00","#E0"],"CHF","CHF","Schweizer Franken",{ATS:["\xF6S"],AUD:["AU$","$"],BGM:["BGK"],BGO:["BGJ"],BYN:[void 0,"\u0440."],CUC:[void 0,"Cub$"],DEM:["DM"],EUR:[],FKP:[void 0,"Fl\xA3"],GHS:[void 0,"\u20B5"],GNF:[void 0,"F.G."],KMF:[void 0,"FC"],PHP:[void 0,"\u20B1"],RON:[void 0,"L"],RUR:[void 0,"\u0440."],RWF:[void 0,"F.Rw"],SYP:[],THB:["\u0E3F"],TWD:["NT$"],XXX:[],ZMW:[void 0,"K"]},"ltr",Ei];function vi(n){let e=n,t=Math.floor(Math.abs(n)),s=n.toString().replace(/^[^.]*\.?/,"").length,i=parseInt(n.toString().replace(/^[^e]*(e([-+]?\d+))?/,"$2"))||0;return t===0||t===1?1:i===0&&t!==0&&t%1e6===0&&s===0||!(i>=0&&i<=5)?4:5}var Ns=["fr-CH",[["AM","PM"],void 0,void 0],void 0,[["D","L","M","M","J","V","S"],["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],["di","lu","ma","me","je","ve","sa"]],void 0,[["J","F","M","A","M","J","J","A","S","O","N","D"],["janv.","f\xE9vr.","mars","avr.","mai","juin","juil.","ao\xFBt","sept.","oct.","nov.","d\xE9c."],["janvier","f\xE9vrier","mars","avril","mai","juin","juillet","ao\xFBt","septembre","octobre","novembre","d\xE9cembre"]],void 0,[["av. J.-C.","ap. J.-C."],void 0,["avant J\xE9sus-Christ","apr\xE8s J\xE9sus-Christ"]],1,[6,0],["dd.MM.yy","d MMM y","d MMMM y","EEEE, d MMMM y"],["HH:mm","HH:mm:ss","HH:mm:ss z","HH.mm:ss 'h' zzzz"],["{1} {0}","{1}, {0}","{1} '\xE0' {0}",void 0],[",","\u202F",";","%","+","-","E","\xD7","\u2030","\u221E","NaN",":","."],["#,##0.###","#,##0%","#,##0.00\xA0\xA4","#E0"],"CHF","CHF","franc suisse",{ARS:["$AR","$"],AUD:["$AU","$"],BEF:["FB"],BMD:["$BM","$"],BND:["$BN","$"],BYN:[void 0,"\u0440."],BZD:["$BZ","$"],CAD:["$CA","$"],CLP:["$CL","$"],CNY:[void 0,"\xA5"],COP:["$CO","$"],CYP:["\xA3CY"],EGP:[void 0,"\xA3E"],FJD:["$FJ","$"],FKP:["\xA3FK","\xA3"],FRF:["F"],GBP:["\xA3GB","\xA3"],GIP:["\xA3GI","\xA3"],HKD:[void 0,"$"],IEP:["\xA3IE"],ILP:["\xA3IL"],ITL:["\u20A4IT"],JPY:[void 0,"\xA5"],KMF:[void 0,"FC"],LBP:["\xA3LB","\xA3L"],MTP:["\xA3MT"],MXN:["$MX","$"],NAD:["$NA","$"],NIO:[void 0,"$C"],NZD:["$NZ","$"],PHP:[void 0,"\u20B1"],RHD:["$RH"],RON:[void 0,"L"],RWF:[void 0,"FR"],SBD:["$SB","$"],SGD:["$SG","$"],SRD:["$SR","$"],TOP:[void 0,"$T"],TTD:["$TT","$"],TWD:[void 0,"NT$"],USD:["$US","$"],UYU:["$UY","$"],WST:["$WS"],XCD:[void 0,"$"],XPF:["FCFP"],ZMW:[void 0,"Kw"]},"ltr",vi];function Ti(n,e){if(n&1&&(U(0,"i",4),ae(1),Y()),n&2){let t=ot().$implicit;q(),at(t.icon)}}function bi(n,e){if(n&1){let t=ss();U(0,"ngb-toast",1),is("hidden",function(){let i=Wt(t).$implicit,r=ot();return Jt(r.toastService.remove(i))}),U(1,"div",2),be(2,Ti,2,1,"i",3),U(3,"span"),ae(4),Y()()()}if(n&2){let t=e.$implicit;es(t.classname),oe("header",t.header||"")("autohide",!0),q(2),oe("ngIf",t.icon),q(2),at(t.message)}}var Fs=(()=>{let e=class e{constructor(s){this.toastService=s}};e.\u0275fac=function(i){return new(i||e)(re(_e))},e.\u0275cmp=J({type:e,selectors:[["bkd-toast"]],standalone:!0,features:[X],decls:2,vars:3,consts:[[3,"header","class","autohide","hidden",4,"ngFor","ngForOf"],[3,"hidden","header","autohide"],[1,"d-flex","gap-2"],["class","material-icons",4,"ngIf"],[1,"material-icons"]],template:function(i,r){i&1&&(be(0,bi,5,6,"ngb-toast",0),ge(1,"async")),i&2&&oe("ngForOf",ye(1,1,r.toastService.toasts$))},dependencies:[Ie,_s,rs,os],styles:["[_nghost-%COMP%]{position:fixed;top:0;right:0;margin:.5em;z-index:1200}[_nghost-%COMP%] > *[_ngcontent-%COMP%]{font-size:medium}"]});let n=e;return n})();var Rs=new Gt("Navigator API",{providedIn:"root",factory:()=>navigator});var ks=(()=>{let e=class e{constructor(s,i,r,o){this.toastService=i,this.settings=r,this.navigator=o,s.initialize(),this.checkSettings()}checkSettings(){Es(ys)(this.settings).pipe(Ht(s=>(console.error(String(s)),this.toastService.error("Please check the contents of the settings.js file (see Console output for more details).","Invalid Settings"),Vt))).subscribe()}};e.\u0275fac=function(i){return new(i||e)(re(As),re(_e),re(Z),re(Rs))},e.\u0275cmp=J({type:e,selectors:[["bkd-app"]],standalone:!0,features:[X],decls:2,vars:0,consts:[["aria-live","polite","aria-atomic","true"]],template:function(i,r){i&1&&ts(0,"bkd-toast",0)(1,"router-outlet")},dependencies:[Fs,fs],styles:["[_nghost-%COMP%]{width:100%}"],changeDetection:0});let n=e;return n})();var _=function(n){return n[n.State=0]="State",n[n.Transition=1]="Transition",n[n.Sequence=2]="Sequence",n[n.Group=3]="Group",n[n.Animate=4]="Animate",n[n.Keyframes=5]="Keyframes",n[n.Style=6]="Style",n[n.Trigger=7]="Trigger",n[n.Reference=8]="Reference",n[n.AnimateChild=9]="AnimateChild",n[n.AnimateRef=10]="AnimateRef",n[n.Query=11]="Query",n[n.Stagger=12]="Stagger",n}(_||{}),Q="*";function Os(n,e=null){return{type:_.Sequence,steps:n,options:e}}function ct(n){return{type:_.Style,styles:n,offset:null}}var ee=class{constructor(e=0,t=0){this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._originalOnDoneFns=[],this._originalOnStartFns=[],this._started=!1,this._destroyed=!1,this._finished=!1,this._position=0,this.parentPlayer=null,this.totalTime=e+t}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}onStart(e){this._originalOnStartFns.push(e),this._onStartFns.push(e)}onDone(e){this._originalOnDoneFns.push(e),this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}hasStarted(){return this._started}init(){}play(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}triggerMicrotask(){queueMicrotask(()=>this._onFinish())}_onStart(){this._onStartFns.forEach(e=>e()),this._onStartFns=[]}pause(){}restart(){}finish(){this._onFinish()}destroy(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}reset(){this._started=!1,this._finished=!1,this._onStartFns=this._originalOnStartFns,this._onDoneFns=this._originalOnDoneFns}setPosition(e){this._position=this.totalTime?e*this.totalTime:1}getPosition(){return this.totalTime?this._position/this.totalTime:1}triggerCallback(e){let t=e=="start"?this._onStartFns:this._onDoneFns;t.forEach(s=>s()),t.length=0}},we=class{constructor(e){this._onDoneFns=[],this._onStartFns=[],this._finished=!1,this._started=!1,this._destroyed=!1,this._onDestroyFns=[],this.parentPlayer=null,this.totalTime=0,this.players=e;let t=0,s=0,i=0,r=this.players.length;r==0?queueMicrotask(()=>this._onFinish()):this.players.forEach(o=>{o.onDone(()=>{++t==r&&this._onFinish()}),o.onDestroy(()=>{++s==r&&this._onDestroy()}),o.onStart(()=>{++i==r&&this._onStart()})}),this.totalTime=this.players.reduce((o,a)=>Math.max(o,a.totalTime),0)}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}init(){this.players.forEach(e=>e.init())}onStart(e){this._onStartFns.push(e)}_onStart(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach(e=>e()),this._onStartFns=[])}onDone(e){this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}hasStarted(){return this._started}play(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach(e=>e.play())}pause(){this.players.forEach(e=>e.pause())}restart(){this.players.forEach(e=>e.restart())}finish(){this._onFinish(),this.players.forEach(e=>e.finish())}destroy(){this._onDestroy()}_onDestroy(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach(e=>e.destroy()),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}reset(){this.players.forEach(e=>e.reset()),this._destroyed=!1,this._finished=!1,this._started=!1}setPosition(e){let t=e*this.totalTime;this.players.forEach(s=>{let i=s.totalTime?Math.min(1,t/s.totalTime):1;s.setPosition(i)})}getPosition(){let e=this.players.reduce((t,s)=>t===null||s.totalTime>t.totalTime?s:t,null);return e!=null?e.getPosition():0}beforeDestroy(){this.players.forEach(e=>{e.beforeDestroy&&e.beforeDestroy()})}triggerCallback(e){let t=e=="start"?this._onStartFns:this._onDoneFns;t.forEach(s=>s()),t.length=0}},ze="!";function Is(n){return new v(3e3,!1)}function wi(){return new v(3100,!1)}function Ai(){return new v(3101,!1)}function Mi(n){return new v(3001,!1)}function Pi(n){return new v(3003,!1)}function Di(n){return new v(3004,!1)}function Ni(n,e){return new v(3005,!1)}function Ci(){return new v(3006,!1)}function Fi(){return new v(3007,!1)}function Ri(n,e){return new v(3008,!1)}function ki(n){return new v(3002,!1)}function Oi(n,e,t,s,i){return new v(3010,!1)}function Ii(){return new v(3011,!1)}function Li(){return new v(3012,!1)}function $i(){return new v(3200,!1)}function zi(){return new v(3202,!1)}function Bi(){return new v(3013,!1)}function Ki(n){return new v(3014,!1)}function ji(n){return new v(3015,!1)}function qi(n){return new v(3016,!1)}function Ui(n,e){return new v(3404,!1)}function Qi(n){return new v(3502,!1)}function Vi(n){return new v(3503,!1)}function Hi(){return new v(3300,!1)}function Gi(n){return new v(3504,!1)}function xi(n){return new v(3301,!1)}function Wi(n,e){return new v(3302,!1)}function Ji(n){return new v(3303,!1)}function Yi(n,e){return new v(3400,!1)}function Xi(n){return new v(3401,!1)}function Zi(n){return new v(3402,!1)}function en(n,e){return new v(3505,!1)}function te(n){switch(n.length){case 0:return new ee;case 1:return n[0];default:return new we(n)}}function Ws(n,e,t=new Map,s=new Map){let i=[],r=[],o=-1,a=null;if(e.forEach(l=>{let c=l.get("offset"),h=c==o,u=h&&a||new Map;l.forEach((S,y)=>{let f=y,g=S;if(y!=="offset")switch(f=n.normalizePropertyName(f,i),g){case ze:g=t.get(y);break;case Q:g=s.get(y);break;default:g=n.normalizeStyleValue(y,f,g,i);break}u.set(f,g)}),h||r.push(u),a=u,o=c}),i.length)throw Qi(i);return r}function Rt(n,e,t,s){switch(e){case"start":n.onStart(()=>s(t&&ut(t,"start",n)));break;case"done":n.onDone(()=>s(t&&ut(t,"done",n)));break;case"destroy":n.onDestroy(()=>s(t&&ut(t,"destroy",n)));break}}function ut(n,e,t){let s=t.totalTime,i=!!t.disabled,r=kt(n.element,n.triggerName,n.fromState,n.toState,e||n.phaseName,s??n.totalTime,i),o=n._data;return o!=null&&(r._data=o),r}function kt(n,e,t,s,i="",r=0,o){return{element:n,triggerName:e,fromState:t,toState:s,phaseName:i,totalTime:r,disabled:!!o}}function O(n,e,t){let s=n.get(e);return s||n.set(e,s=t),s}function Ls(n){let e=n.indexOf(":"),t=n.substring(1,e),s=n.slice(e+1);return[t,s]}var tn=typeof document>"u"?null:document.documentElement;function Ot(n){let e=n.parentNode||n.host||null;return e===tn?null:e}function sn(n){return n.substring(1,6)=="ebkit"}var ce=null,$s=!1;function nn(n){ce||(ce=rn()||{},$s=ce.style?"WebkitAppearance"in ce.style:!1);let e=!0;return ce.style&&!sn(n)&&(e=n in ce.style,!e&&$s&&(e="Webkit"+n.charAt(0).toUpperCase()+n.slice(1)in ce.style)),e}function rn(){return typeof document<"u"?document.body:null}function Js(n,e){for(;e;){if(e===n)return!0;e=Ot(e)}return!1}function Ys(n,e,t){if(t)return Array.from(n.querySelectorAll(e));let s=n.querySelector(e);return s?[s]:[]}var It=(()=>{let e=class e{validateStyleProperty(s){return nn(s)}containsElement(s,i){return Js(s,i)}getParentElement(s){return Ot(s)}query(s,i,r){return Ys(s,i,r)}computeStyle(s,i,r){return r||""}animate(s,i,r,o,a,l=[],c){return new ee(r,o)}};e.\u0275fac=function(i){return new(i||e)},e.\u0275prov=W({token:e,factory:e.\u0275fac});let n=e;return n})(),Bt=class Bt{};Bt.NOOP=new It;var de=Bt,fe=class{};var on=1e3,Xs="{{",an="}}",Zs="ng-enter",gt="ng-leave",Be="ng-trigger",Qe=".ng-trigger",zs="ng-animating",yt=".ng-animating";function G(n){if(typeof n=="number")return n;let e=n.match(/^(-?[\.\d]+)(m?s)/);return!e||e.length<2?0:_t(parseFloat(e[1]),e[2])}function _t(n,e){switch(e){case"s":return n*on;default:return n}}function Ve(n,e,t){return n.hasOwnProperty("duration")?n:ln(n,e,t)}function ln(n,e,t){let s=/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i,i,r=0,o="";if(typeof n=="string"){let a=n.match(s);if(a===null)return e.push(Is(n)),{duration:0,delay:0,easing:""};i=_t(parseFloat(a[1]),a[2]);let l=a[3];l!=null&&(r=_t(parseFloat(l),a[4]));let c=a[5];c&&(o=c)}else i=n;if(!t){let a=!1,l=e.length;i<0&&(e.push(wi()),a=!0),r<0&&(e.push(Ai()),a=!0),a&&e.splice(l,0,Is(n))}return{duration:i,delay:r,easing:o}}function cn(n){return n.length?n[0]instanceof Map?n:n.map(e=>new Map(Object.entries(e))):[]}function V(n,e,t){e.forEach((s,i)=>{let r=Lt(i);t&&!t.has(i)&&t.set(i,n.style[r]),n.style[r]=s})}function he(n,e){e.forEach((t,s)=>{let i=Lt(s);n.style[i]=""})}function Ae(n){return Array.isArray(n)?n.length==1?n[0]:Os(n):n}function un(n,e,t){let s=e.params||{},i=ei(n);i.length&&i.forEach(r=>{s.hasOwnProperty(r)||t.push(Mi(r))})}var St=new RegExp(`${Xs}\\s*(.+?)\\s*${an}`,"g");function ei(n){let e=[];if(typeof n=="string"){let t;for(;t=St.exec(n);)e.push(t[1]);St.lastIndex=0}return e}function Pe(n,e,t){let s=`${n}`,i=s.replace(St,(r,o)=>{let a=e[o];return a==null&&(t.push(Pi(o)),a=""),a.toString()});return i==s?n:i}var hn=/-+([a-z0-9])/g;function Lt(n){return n.replace(hn,(...e)=>e[1].toUpperCase())}function dn(n,e){return n===0||e===0}function fn(n,e,t){if(t.size&&e.length){let s=e[0],i=[];if(t.forEach((r,o)=>{s.has(o)||i.push(o),s.set(o,r)}),i.length)for(let r=1;ro.set(a,$t(n,a)))}}return e}function k(n,e,t){switch(e.type){case _.Trigger:return n.visitTrigger(e,t);case _.State:return n.visitState(e,t);case _.Transition:return n.visitTransition(e,t);case _.Sequence:return n.visitSequence(e,t);case _.Group:return n.visitGroup(e,t);case _.Animate:return n.visitAnimate(e,t);case _.Keyframes:return n.visitKeyframes(e,t);case _.Style:return n.visitStyle(e,t);case _.Reference:return n.visitReference(e,t);case _.AnimateChild:return n.visitAnimateChild(e,t);case _.AnimateRef:return n.visitAnimateRef(e,t);case _.Query:return n.visitQuery(e,t);case _.Stagger:return n.visitStagger(e,t);default:throw Di(e.type)}}function $t(n,e){return window.getComputedStyle(n)[e]}var mn=new Set(["width","height","minWidth","minHeight","maxWidth","maxHeight","left","top","bottom","right","fontSize","outlineWidth","outlineOffset","paddingTop","paddingLeft","paddingBottom","paddingRight","marginTop","marginLeft","marginBottom","marginRight","borderRadius","borderWidth","borderTopWidth","borderLeftWidth","borderRightWidth","borderBottomWidth","textIndent","perspective"]),He=class extends fe{normalizePropertyName(e,t){return Lt(e)}normalizeStyleValue(e,t,s,i){let r="",o=s.toString().trim();if(mn.has(t)&&s!==0&&s!=="0")if(typeof s=="number")r="px";else{let a=s.match(/^[+-]?[\d\.]+([a-z]*)$/);a&&a[1].length==0&&i.push(Ni(e,s))}return o+r}};var Ge="*";function pn(n,e){let t=[];return typeof n=="string"?n.split(/\s*,\s*/).forEach(s=>gn(s,t,e)):t.push(n),t}function gn(n,e,t){if(n[0]==":"){let l=yn(n,t);if(typeof l=="function"){e.push(l);return}n=l}let s=n.match(/^(\*|[-\w]+)\s*()\s*(\*|[-\w]+)$/);if(s==null||s.length<4)return t.push(ji(n)),e;let i=s[1],r=s[2],o=s[3];e.push(Bs(i,o));let a=i==Ge&&o==Ge;r[0]=="<"&&!a&&e.push(Bs(o,i))}function yn(n,e){switch(n){case":enter":return"void => *";case":leave":return"* => void";case":increment":return(t,s)=>parseFloat(s)>parseFloat(t);case":decrement":return(t,s)=>parseFloat(s) *"}}var Ke=new Set(["true","1"]),je=new Set(["false","0"]);function Bs(n,e){let t=Ke.has(n)||je.has(n),s=Ke.has(e)||je.has(e);return(i,r)=>{let o=n==Ge||n==i,a=e==Ge||e==r;return!o&&t&&typeof i=="boolean"&&(o=i?Ke.has(n):je.has(n)),!a&&s&&typeof r=="boolean"&&(a=r?Ke.has(e):je.has(e)),o&&a}}var ti=":self",_n=new RegExp(`s*${ti}s*,?`,"g");function si(n,e,t,s){return new Et(n).build(e,t,s)}var Ks="",Et=class{constructor(e){this._driver=e}build(e,t,s){let i=new vt(t);return this._resetContextStyleTimingState(i),k(this,Ae(e),i)}_resetContextStyleTimingState(e){e.currentQuerySelector=Ks,e.collectedStyles=new Map,e.collectedStyles.set(Ks,new Map),e.currentTime=0}visitTrigger(e,t){let s=t.queryCount=0,i=t.depCount=0,r=[],o=[];return e.name.charAt(0)=="@"&&t.errors.push(Ci()),e.definitions.forEach(a=>{if(this._resetContextStyleTimingState(t),a.type==_.State){let l=a,c=l.name;c.toString().split(/\s*,\s*/).forEach(h=>{l.name=h,r.push(this.visitState(l,t))}),l.name=c}else if(a.type==_.Transition){let l=this.visitTransition(a,t);s+=l.queryCount,i+=l.depCount,o.push(l)}else t.errors.push(Fi())}),{type:_.Trigger,name:e.name,states:r,transitions:o,queryCount:s,depCount:i,options:null}}visitState(e,t){let s=this.visitStyle(e.styles,t),i=e.options&&e.options.params||null;if(s.containsDynamicStyles){let r=new Set,o=i||{};s.styles.forEach(a=>{a instanceof Map&&a.forEach(l=>{ei(l).forEach(c=>{o.hasOwnProperty(c)||r.add(c)})})}),r.size&&t.errors.push(Ri(e.name,[...r.values()]))}return{type:_.State,name:e.name,style:s,options:i?{params:i}:null}}visitTransition(e,t){t.queryCount=0,t.depCount=0;let s=k(this,Ae(e.animation),t),i=pn(e.expr,t.errors);return{type:_.Transition,matchers:i,animation:s,queryCount:t.queryCount,depCount:t.depCount,options:ue(e.options)}}visitSequence(e,t){return{type:_.Sequence,steps:e.steps.map(s=>k(this,s,t)),options:ue(e.options)}}visitGroup(e,t){let s=t.currentTime,i=0,r=e.steps.map(o=>{t.currentTime=s;let a=k(this,o,t);return i=Math.max(i,t.currentTime),a});return t.currentTime=i,{type:_.Group,steps:r,options:ue(e.options)}}visitAnimate(e,t){let s=Tn(e.timings,t.errors);t.currentAnimateTimings=s;let i,r=e.styles?e.styles:ct({});if(r.type==_.Keyframes)i=this.visitKeyframes(r,t);else{let o=e.styles,a=!1;if(!o){a=!0;let c={};s.easing&&(c.easing=s.easing),o=ct(c)}t.currentTime+=s.duration+s.delay;let l=this.visitStyle(o,t);l.isEmptyStep=a,i=l}return t.currentAnimateTimings=null,{type:_.Animate,timings:s,style:i,options:null}}visitStyle(e,t){let s=this._makeStyleAst(e,t);return this._validateStyleAst(s,t),s}_makeStyleAst(e,t){let s=[],i=Array.isArray(e.styles)?e.styles:[e.styles];for(let a of i)typeof a=="string"?a===Q?s.push(a):t.errors.push(ki(a)):s.push(new Map(Object.entries(a)));let r=!1,o=null;return s.forEach(a=>{if(a instanceof Map&&(a.has("easing")&&(o=a.get("easing"),a.delete("easing")),!r)){for(let l of a.values())if(l.toString().indexOf(Xs)>=0){r=!0;break}}}),{type:_.Style,styles:s,easing:o,offset:e.offset,containsDynamicStyles:r,options:null}}_validateStyleAst(e,t){let s=t.currentAnimateTimings,i=t.currentTime,r=t.currentTime;s&&r>0&&(r-=s.duration+s.delay),e.styles.forEach(o=>{typeof o!="string"&&o.forEach((a,l)=>{let c=t.collectedStyles.get(t.currentQuerySelector),h=c.get(l),u=!0;h&&(r!=i&&r>=h.startTime&&i<=h.endTime&&(t.errors.push(Oi(l,h.startTime,h.endTime,r,i)),u=!1),r=h.startTime),u&&c.set(l,{startTime:r,endTime:i}),t.options&&un(a,t.options,t.errors)})})}visitKeyframes(e,t){let s={type:_.Keyframes,styles:[],options:null};if(!t.currentAnimateTimings)return t.errors.push(Ii()),s;let i=1,r=0,o=[],a=!1,l=!1,c=0,h=e.steps.map(w=>{let A=this._makeStyleAst(w,t),N=A.offset!=null?A.offset:vn(A.styles),P=0;return N!=null&&(r++,P=A.offset=N),l=l||P<0||P>1,a=a||P0&&r{let N=S>0?A==y?1:S*A:o[A],P=N*T;t.currentTime=f+g.delay+P,g.duration=P,this._validateStyleAst(w,t),w.offset=N,s.styles.push(w)}),s}visitReference(e,t){return{type:_.Reference,animation:k(this,Ae(e.animation),t),options:ue(e.options)}}visitAnimateChild(e,t){return t.depCount++,{type:_.AnimateChild,options:ue(e.options)}}visitAnimateRef(e,t){return{type:_.AnimateRef,animation:this.visitReference(e.animation,t),options:ue(e.options)}}visitQuery(e,t){let s=t.currentQuerySelector,i=e.options||{};t.queryCount++,t.currentQuery=e;let[r,o]=Sn(e.selector);t.currentQuerySelector=s.length?s+" "+r:r,O(t.collectedStyles,t.currentQuerySelector,new Map);let a=k(this,Ae(e.animation),t);return t.currentQuery=null,t.currentQuerySelector=s,{type:_.Query,selector:r,limit:i.limit||0,optional:!!i.optional,includeSelf:o,animation:a,originalSelector:e.selector,options:ue(e.options)}}visitStagger(e,t){t.currentQuery||t.errors.push(Bi());let s=e.timings==="full"?{duration:0,delay:0,easing:"full"}:Ve(e.timings,t.errors,!0);return{type:_.Stagger,animation:k(this,Ae(e.animation),t),timings:s,options:null}}};function Sn(n){let e=!!n.split(/\s*,\s*/).find(t=>t==ti);return e&&(n=n.replace(_n,"")),n=n.replace(/@\*/g,Qe).replace(/@\w+/g,t=>Qe+"-"+t.slice(1)).replace(/:animating/g,yt),[n,e]}function En(n){return n?Re({},n):null}var vt=class{constructor(e){this.errors=e,this.queryCount=0,this.depCount=0,this.currentTransition=null,this.currentQuery=null,this.currentQuerySelector=null,this.currentAnimateTimings=null,this.currentTime=0,this.collectedStyles=new Map,this.options=null,this.unsupportedCSSPropertiesFound=new Set}};function vn(n){if(typeof n=="string")return null;let e=null;if(Array.isArray(n))n.forEach(t=>{if(t instanceof Map&&t.has("offset")){let s=t;e=parseFloat(s.get("offset")),s.delete("offset")}});else if(n instanceof Map&&n.has("offset")){let t=n;e=parseFloat(t.get("offset")),t.delete("offset")}return e}function Tn(n,e){if(n.hasOwnProperty("duration"))return n;if(typeof n=="number"){let r=Ve(n,e).duration;return ht(r,0,"")}let t=n;if(t.split(/\s+/).some(r=>r.charAt(0)=="{"&&r.charAt(1)=="{")){let r=ht(0,0,"");return r.dynamic=!0,r.strValue=t,r}let i=Ve(t,e);return ht(i.duration,i.delay,i.easing)}function ue(n){return n?(n=Re({},n),n.params&&(n.params=En(n.params))):n={},n}function ht(n,e,t){return{duration:n,delay:e,easing:t}}function zt(n,e,t,s,i,r,o=null,a=!1){return{type:1,element:n,keyframes:e,preStyleProps:t,postStyleProps:s,duration:i,delay:r,totalTime:i+r,easing:o,subTimeline:a}}var De=class{constructor(){this._map=new Map}get(e){return this._map.get(e)||[]}append(e,t){let s=this._map.get(e);s||this._map.set(e,s=[]),s.push(...t)}has(e){return this._map.has(e)}clear(){this._map.clear()}},bn=1,wn=":enter",An=new RegExp(wn,"g"),Mn=":leave",Pn=new RegExp(Mn,"g");function ii(n,e,t,s,i,r=new Map,o=new Map,a,l,c=[]){return new Tt().buildKeyframes(n,e,t,s,i,r,o,a,l,c)}var Tt=class{buildKeyframes(e,t,s,i,r,o,a,l,c,h=[]){c=c||new De;let u=new bt(e,t,c,i,r,h,[]);u.options=l;let S=l.delay?G(l.delay):0;u.currentTimeline.delayNextStep(S),u.currentTimeline.setStyles([o],null,u.errors,l),k(this,s,u);let y=u.timelines.filter(f=>f.containsAnimation());if(y.length&&a.size){let f;for(let g=y.length-1;g>=0;g--){let T=y[g];if(T.element===t){f=T;break}}f&&!f.allowOnlyTimelineStyles()&&f.setStyles([a],null,u.errors,l)}return y.length?y.map(f=>f.buildKeyframes()):[zt(t,[],[],[],0,S,"",!1)]}visitTrigger(e,t){}visitState(e,t){}visitTransition(e,t){}visitAnimateChild(e,t){let s=t.subInstructions.get(t.element);if(s){let i=t.createSubContext(e.options),r=t.currentTimeline.currentTime,o=this._visitSubInstructions(s,i,i.options);r!=o&&t.transformIntoNewTimeline(o)}t.previousNode=e}visitAnimateRef(e,t){let s=t.createSubContext(e.options);s.transformIntoNewTimeline(),this._applyAnimationRefDelays([e.options,e.animation.options],t,s),this.visitReference(e.animation,s),t.transformIntoNewTimeline(s.currentTimeline.currentTime),t.previousNode=e}_applyAnimationRefDelays(e,t,s){for(let i of e){let r=i?.delay;if(r){let o=typeof r=="number"?r:G(Pe(r,i?.params??{},t.errors));s.delayNextStep(o)}}}_visitSubInstructions(e,t,s){let r=t.currentTimeline.currentTime,o=s.duration!=null?G(s.duration):null,a=s.delay!=null?G(s.delay):null;return o!==0&&e.forEach(l=>{let c=t.appendInstructionToTimeline(l,o,a);r=Math.max(r,c.duration+c.delay)}),r}visitReference(e,t){t.updateOptions(e.options,!0),k(this,e.animation,t),t.previousNode=e}visitSequence(e,t){let s=t.subContextCount,i=t,r=e.options;if(r&&(r.params||r.delay)&&(i=t.createSubContext(r),i.transformIntoNewTimeline(),r.delay!=null)){i.previousNode.type==_.Style&&(i.currentTimeline.snapshotCurrentStyles(),i.previousNode=xe);let o=G(r.delay);i.delayNextStep(o)}e.steps.length&&(e.steps.forEach(o=>k(this,o,i)),i.currentTimeline.applyStylesToKeyframe(),i.subContextCount>s&&i.transformIntoNewTimeline()),t.previousNode=e}visitGroup(e,t){let s=[],i=t.currentTimeline.currentTime,r=e.options&&e.options.delay?G(e.options.delay):0;e.steps.forEach(o=>{let a=t.createSubContext(e.options);r&&a.delayNextStep(r),k(this,o,a),i=Math.max(i,a.currentTimeline.currentTime),s.push(a.currentTimeline)}),s.forEach(o=>t.currentTimeline.mergeTimelineCollectedStyles(o)),t.transformIntoNewTimeline(i),t.previousNode=e}_visitTiming(e,t){if(e.dynamic){let s=e.strValue,i=t.params?Pe(s,t.params,t.errors):s;return Ve(i,t.errors)}else return{duration:e.duration,delay:e.delay,easing:e.easing}}visitAnimate(e,t){let s=t.currentAnimateTimings=this._visitTiming(e.timings,t),i=t.currentTimeline;s.delay&&(t.incrementTime(s.delay),i.snapshotCurrentStyles());let r=e.style;r.type==_.Keyframes?this.visitKeyframes(r,t):(t.incrementTime(s.duration),this.visitStyle(r,t),i.applyStylesToKeyframe()),t.currentAnimateTimings=null,t.previousNode=e}visitStyle(e,t){let s=t.currentTimeline,i=t.currentAnimateTimings;!i&&s.hasCurrentStyleProperties()&&s.forwardFrame();let r=i&&i.easing||e.easing;e.isEmptyStep?s.applyEmptyStep(r):s.setStyles(e.styles,r,t.errors,t.options),t.previousNode=e}visitKeyframes(e,t){let s=t.currentAnimateTimings,i=t.currentTimeline.duration,r=s.duration,a=t.createSubContext().currentTimeline;a.easing=s.easing,e.styles.forEach(l=>{let c=l.offset||0;a.forwardTime(c*r),a.setStyles(l.styles,l.easing,t.errors,t.options),a.applyStylesToKeyframe()}),t.currentTimeline.mergeTimelineCollectedStyles(a),t.transformIntoNewTimeline(i+r),t.previousNode=e}visitQuery(e,t){let s=t.currentTimeline.currentTime,i=e.options||{},r=i.delay?G(i.delay):0;r&&(t.previousNode.type===_.Style||s==0&&t.currentTimeline.hasCurrentStyleProperties())&&(t.currentTimeline.snapshotCurrentStyles(),t.previousNode=xe);let o=s,a=t.invokeQuery(e.selector,e.originalSelector,e.limit,e.includeSelf,!!i.optional,t.errors);t.currentQueryTotal=a.length;let l=null;a.forEach((c,h)=>{t.currentQueryIndex=h;let u=t.createSubContext(e.options,c);r&&u.delayNextStep(r),c===t.element&&(l=u.currentTimeline),k(this,e.animation,u),u.currentTimeline.applyStylesToKeyframe();let S=u.currentTimeline.currentTime;o=Math.max(o,S)}),t.currentQueryIndex=0,t.currentQueryTotal=0,t.transformIntoNewTimeline(o),l&&(t.currentTimeline.mergeTimelineCollectedStyles(l),t.currentTimeline.snapshotCurrentStyles()),t.previousNode=e}visitStagger(e,t){let s=t.parentContext,i=t.currentTimeline,r=e.timings,o=Math.abs(r.duration),a=o*(t.currentQueryTotal-1),l=o*t.currentQueryIndex;switch(r.duration<0?"reverse":r.easing){case"reverse":l=a-l;break;case"full":l=s.currentStaggerTime;break}let h=t.currentTimeline;l&&h.delayNextStep(l);let u=h.currentTime;k(this,e.animation,t),t.previousNode=e,s.currentStaggerTime=i.currentTime-u+(i.startTime-s.currentTimeline.startTime)}},xe={},bt=class n{constructor(e,t,s,i,r,o,a,l){this._driver=e,this.element=t,this.subInstructions=s,this._enterClassName=i,this._leaveClassName=r,this.errors=o,this.timelines=a,this.parentContext=null,this.currentAnimateTimings=null,this.previousNode=xe,this.subContextCount=0,this.options={},this.currentQueryIndex=0,this.currentQueryTotal=0,this.currentStaggerTime=0,this.currentTimeline=l||new We(this._driver,t,0),a.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(e,t){if(!e)return;let s=e,i=this.options;s.duration!=null&&(i.duration=G(s.duration)),s.delay!=null&&(i.delay=G(s.delay));let r=s.params;if(r){let o=i.params;o||(o=this.options.params={}),Object.keys(r).forEach(a=>{(!t||!o.hasOwnProperty(a))&&(o[a]=Pe(r[a],o,this.errors))})}}_copyOptions(){let e={};if(this.options){let t=this.options.params;if(t){let s=e.params={};Object.keys(t).forEach(i=>{s[i]=t[i]})}}return e}createSubContext(e=null,t,s){let i=t||this.element,r=new n(this._driver,i,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(i,s||0));return r.previousNode=this.previousNode,r.currentAnimateTimings=this.currentAnimateTimings,r.options=this._copyOptions(),r.updateOptions(e),r.currentQueryIndex=this.currentQueryIndex,r.currentQueryTotal=this.currentQueryTotal,r.parentContext=this,this.subContextCount++,r}transformIntoNewTimeline(e){return this.previousNode=xe,this.currentTimeline=this.currentTimeline.fork(this.element,e),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(e,t,s){let i={duration:t??e.duration,delay:this.currentTimeline.currentTime+(s??0)+e.delay,easing:""},r=new wt(this._driver,e.element,e.keyframes,e.preStyleProps,e.postStyleProps,i,e.stretchStartingKeyframe);return this.timelines.push(r),i}incrementTime(e){this.currentTimeline.forwardTime(this.currentTimeline.duration+e)}delayNextStep(e){e>0&&this.currentTimeline.delayNextStep(e)}invokeQuery(e,t,s,i,r,o){let a=[];if(i&&a.push(this.element),e.length>0){e=e.replace(An,"."+this._enterClassName),e=e.replace(Pn,"."+this._leaveClassName);let l=s!=1,c=this._driver.query(this.element,e,l);s!==0&&(c=s<0?c.slice(c.length+s,c.length):c.slice(0,s)),a.push(...c)}return!r&&a.length==0&&o.push(Ki(t)),a}},We=class n{constructor(e,t,s,i){this._driver=e,this.element=t,this.startTime=s,this._elementTimelineStylesLookup=i,this.duration=0,this.easing=null,this._previousKeyframe=new Map,this._currentKeyframe=new Map,this._keyframes=new Map,this._styleSummary=new Map,this._localTimelineStyles=new Map,this._pendingStyles=new Map,this._backFill=new Map,this._currentEmptyStepKeyframe=null,this._elementTimelineStylesLookup||(this._elementTimelineStylesLookup=new Map),this._globalTimelineStyles=this._elementTimelineStylesLookup.get(t),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(t,this._localTimelineStyles)),this._loadKeyframe()}containsAnimation(){switch(this._keyframes.size){case 0:return!1;case 1:return this.hasCurrentStyleProperties();default:return!0}}hasCurrentStyleProperties(){return this._currentKeyframe.size>0}get currentTime(){return this.startTime+this.duration}delayNextStep(e){let t=this._keyframes.size===1&&this._pendingStyles.size;this.duration||t?(this.forwardTime(this.currentTime+e),t&&this.snapshotCurrentStyles()):this.startTime+=e}fork(e,t){return this.applyStylesToKeyframe(),new n(this._driver,e,t||this.currentTime,this._elementTimelineStylesLookup)}_loadKeyframe(){this._currentKeyframe&&(this._previousKeyframe=this._currentKeyframe),this._currentKeyframe=this._keyframes.get(this.duration),this._currentKeyframe||(this._currentKeyframe=new Map,this._keyframes.set(this.duration,this._currentKeyframe))}forwardFrame(){this.duration+=bn,this._loadKeyframe()}forwardTime(e){this.applyStylesToKeyframe(),this.duration=e,this._loadKeyframe()}_updateStyle(e,t){this._localTimelineStyles.set(e,t),this._globalTimelineStyles.set(e,t),this._styleSummary.set(e,{time:this.currentTime,value:t})}allowOnlyTimelineStyles(){return this._currentEmptyStepKeyframe!==this._currentKeyframe}applyEmptyStep(e){e&&this._previousKeyframe.set("easing",e);for(let[t,s]of this._globalTimelineStyles)this._backFill.set(t,s||Q),this._currentKeyframe.set(t,Q);this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(e,t,s,i){t&&this._previousKeyframe.set("easing",t);let r=i&&i.params||{},o=Dn(e,this._globalTimelineStyles);for(let[a,l]of o){let c=Pe(l,r,s);this._pendingStyles.set(a,c),this._localTimelineStyles.has(a)||this._backFill.set(a,this._globalTimelineStyles.get(a)??Q),this._updateStyle(a,c)}}applyStylesToKeyframe(){this._pendingStyles.size!=0&&(this._pendingStyles.forEach((e,t)=>{this._currentKeyframe.set(t,e)}),this._pendingStyles.clear(),this._localTimelineStyles.forEach((e,t)=>{this._currentKeyframe.has(t)||this._currentKeyframe.set(t,e)}))}snapshotCurrentStyles(){for(let[e,t]of this._localTimelineStyles)this._pendingStyles.set(e,t),this._updateStyle(e,t)}getFinalKeyframe(){return this._keyframes.get(this.duration)}get properties(){let e=[];for(let t in this._currentKeyframe)e.push(t);return e}mergeTimelineCollectedStyles(e){e._styleSummary.forEach((t,s)=>{let i=this._styleSummary.get(s);(!i||t.time>i.time)&&this._updateStyle(s,t.value)})}buildKeyframes(){this.applyStylesToKeyframe();let e=new Set,t=new Set,s=this._keyframes.size===1&&this.duration===0,i=[];this._keyframes.forEach((a,l)=>{let c=new Map([...this._backFill,...a]);c.forEach((h,u)=>{h===ze?e.add(u):h===Q&&t.add(u)}),s||c.set("offset",l/this.duration),i.push(c)});let r=[...e.values()],o=[...t.values()];if(s){let a=i[0],l=new Map(a);a.set("offset",0),l.set("offset",1),i=[a,l]}return zt(this.element,i,r,o,this.duration,this.startTime,this.easing,!1)}},wt=class extends We{constructor(e,t,s,i,r,o,a=!1){super(e,t,o.delay),this.keyframes=s,this.preStyleProps=i,this.postStyleProps=r,this._stretchStartingKeyframe=a,this.timings={duration:o.duration,delay:o.delay,easing:o.easing}}containsAnimation(){return this.keyframes.length>1}buildKeyframes(){let e=this.keyframes,{delay:t,duration:s,easing:i}=this.timings;if(this._stretchStartingKeyframe&&t){let r=[],o=s+t,a=t/o,l=new Map(e[0]);l.set("offset",0),r.push(l);let c=new Map(e[0]);c.set("offset",js(a)),r.push(c);let h=e.length-1;for(let u=1;u<=h;u++){let S=new Map(e[u]),y=S.get("offset"),f=t+y*s;S.set("offset",js(f/o)),r.push(S)}s=o,t=0,i="",e=r}return zt(this.element,e,this.preStyleProps,this.postStyleProps,s,t,i,!0)}};function js(n,e=3){let t=Math.pow(10,e-1);return Math.round(n*t)/t}function Dn(n,e){let t=new Map,s;return n.forEach(i=>{if(i==="*"){s??=e.keys();for(let r of s)t.set(r,Q)}else for(let[r,o]of i)t.set(r,o)}),t}function qs(n,e,t,s,i,r,o,a,l,c,h,u,S){return{type:0,element:n,triggerName:e,isRemovalTransition:i,fromState:t,fromStyles:r,toState:s,toStyles:o,timelines:a,queriedElements:l,preStyleProps:c,postStyleProps:h,totalTime:u,errors:S}}var dt={},Je=class{constructor(e,t,s){this._triggerName=e,this.ast=t,this._stateStyles=s}match(e,t,s,i){return Nn(this.ast.matchers,e,t,s,i)}buildStyles(e,t,s){let i=this._stateStyles.get("*");return e!==void 0&&(i=this._stateStyles.get(e?.toString())||i),i?i.buildStyles(t,s):new Map}build(e,t,s,i,r,o,a,l,c,h){let u=[],S=this.ast.options&&this.ast.options.params||dt,y=a&&a.params||dt,f=this.buildStyles(s,y,u),g=l&&l.params||dt,T=this.buildStyles(i,g,u),w=new Set,A=new Map,N=new Map,P=i==="void",me={params:ni(g,S),delay:this.ast.options?.delay},B=h?[]:ii(e,t,this.ast.animation,r,o,f,T,me,c,u),C=0;return B.forEach(F=>{C=Math.max(F.duration+F.delay,C)}),u.length?qs(t,this._triggerName,s,i,P,f,T,[],[],A,N,C,u):(B.forEach(F=>{let se=F.element,pe=O(A,se,new Set);F.preStyleProps.forEach(ie=>pe.add(ie));let Kt=O(N,se,new Set);F.postStyleProps.forEach(ie=>Kt.add(ie)),se!==t&&w.add(se)}),qs(t,this._triggerName,s,i,P,f,T,B,[...w.values()],A,N,C))}};function Nn(n,e,t,s,i){return n.some(r=>r(e,t,s,i))}function ni(n,e){let t=Re({},e);return Object.entries(n).forEach(([s,i])=>{i!=null&&(t[s]=i)}),t}var At=class{constructor(e,t,s){this.styles=e,this.defaultParams=t,this.normalizer=s}buildStyles(e,t){let s=new Map,i=ni(e,this.defaultParams);return this.styles.styles.forEach(r=>{typeof r!="string"&&r.forEach((o,a)=>{o&&(o=Pe(o,i,t));let l=this.normalizer.normalizePropertyName(a,t);o=this.normalizer.normalizeStyleValue(a,l,o,t),s.set(a,o)})}),s}};function Cn(n,e,t){return new Mt(n,e,t)}var Mt=class{constructor(e,t,s){this.name=e,this.ast=t,this._normalizer=s,this.transitionFactories=[],this.states=new Map,t.states.forEach(i=>{let r=i.options&&i.options.params||{};this.states.set(i.name,new At(i.style,r,s))}),Us(this.states,"true","1"),Us(this.states,"false","0"),t.transitions.forEach(i=>{this.transitionFactories.push(new Je(e,i,this.states))}),this.fallbackTransition=Fn(e,this.states,this._normalizer)}get containsQueries(){return this.ast.queryCount>0}matchTransition(e,t,s,i){return this.transitionFactories.find(o=>o.match(e,t,s,i))||null}matchStyles(e,t,s){return this.fallbackTransition.buildStyles(e,t,s)}};function Fn(n,e,t){let s=[(o,a)=>!0],i={type:_.Sequence,steps:[],options:null},r={type:_.Transition,animation:i,matchers:s,options:null,queryCount:0,depCount:0};return new Je(n,r,e)}function Us(n,e,t){n.has(e)?n.has(t)||n.set(t,n.get(e)):n.has(t)&&n.set(e,n.get(t))}var Rn=new De,Pt=class{constructor(e,t,s){this.bodyNode=e,this._driver=t,this._normalizer=s,this._animations=new Map,this._playersById=new Map,this.players=[]}register(e,t){let s=[],i=[],r=si(this._driver,t,s,i);if(s.length)throw Vi(s);i.length&&void 0,this._animations.set(e,r)}_buildPlayer(e,t,s){let i=e.element,r=Ws(this._normalizer,e.keyframes,t,s);return this._driver.animate(i,r,e.duration,e.delay,e.easing,[],!0)}create(e,t,s={}){let i=[],r=this._animations.get(e),o,a=new Map;if(r?(o=ii(this._driver,t,r,Zs,gt,new Map,new Map,s,Rn,i),o.forEach(h=>{let u=O(a,h.element,new Map);h.postStyleProps.forEach(S=>u.set(S,null))})):(i.push(Hi()),o=[]),i.length)throw Gi(i);a.forEach((h,u)=>{h.forEach((S,y)=>{h.set(y,this._driver.computeStyle(u,y,Q))})});let l=o.map(h=>{let u=a.get(h.element);return this._buildPlayer(h,new Map,u)}),c=te(l);return this._playersById.set(e,c),c.onDestroy(()=>this.destroy(e)),this.players.push(c),c}destroy(e){let t=this._getPlayer(e);t.destroy(),this._playersById.delete(e);let s=this.players.indexOf(t);s>=0&&this.players.splice(s,1)}_getPlayer(e){let t=this._playersById.get(e);if(!t)throw xi(e);return t}listen(e,t,s,i){let r=kt(t,"","","");return Rt(this._getPlayer(e),s,r,i),()=>{}}command(e,t,s,i){if(s=="register"){this.register(e,i[0]);return}if(s=="create"){let o=i[0]||{};this.create(e,t,o);return}let r=this._getPlayer(e);switch(s){case"play":r.play();break;case"pause":r.pause();break;case"reset":r.reset();break;case"restart":r.restart();break;case"finish":r.finish();break;case"init":r.init();break;case"setPosition":r.setPosition(parseFloat(i[0]));break;case"destroy":this.destroy(e);break}}},Qs="ng-animate-queued",kn=".ng-animate-queued",ft="ng-animate-disabled",On=".ng-animate-disabled",In="ng-star-inserted",Ln=".ng-star-inserted",$n=[],ri={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},zn={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},$="__ng_removed",Ne=class{get params(){return this.options.params}constructor(e,t=""){this.namespaceId=t;let s=e&&e.hasOwnProperty("value"),i=s?e.value:e;if(this.value=Kn(i),s){let r=e,{value:o}=r,a=Qt(r,["value"]);this.options=a}else this.options={};this.options.params||(this.options.params={})}absorbOptions(e){let t=e.params;if(t){let s=this.options.params;Object.keys(t).forEach(i=>{s[i]==null&&(s[i]=t[i])})}}},Me="void",mt=new Ne(Me),Dt=class{constructor(e,t,s){this.id=e,this.hostElement=t,this._engine=s,this.players=[],this._triggers=new Map,this._queue=[],this._elementListeners=new Map,this._hostClassName="ng-tns-"+e,L(t,this._hostClassName)}listen(e,t,s,i){if(!this._triggers.has(t))throw Wi(s,t);if(s==null||s.length==0)throw Ji(t);if(!jn(s))throw Yi(s,t);let r=O(this._elementListeners,e,[]),o={name:t,phase:s,callback:i};r.push(o);let a=O(this._engine.statesByElement,e,new Map);return a.has(t)||(L(e,Be),L(e,Be+"-"+t),a.set(t,mt)),()=>{this._engine.afterFlush(()=>{let l=r.indexOf(o);l>=0&&r.splice(l,1),this._triggers.has(t)||a.delete(t)})}}register(e,t){return this._triggers.has(e)?!1:(this._triggers.set(e,t),!0)}_getTrigger(e){let t=this._triggers.get(e);if(!t)throw Xi(e);return t}trigger(e,t,s,i=!0){let r=this._getTrigger(t),o=new Ce(this.id,t,e),a=this._engine.statesByElement.get(e);a||(L(e,Be),L(e,Be+"-"+t),this._engine.statesByElement.set(e,a=new Map));let l=a.get(t),c=new Ne(s,this.id);if(!(s&&s.hasOwnProperty("value"))&&l&&c.absorbOptions(l.options),a.set(t,c),l||(l=mt),!(c.value===Me)&&l.value===c.value){if(!Qn(l.params,c.params)){let g=[],T=r.matchStyles(l.value,l.params,g),w=r.matchStyles(c.value,c.params,g);g.length?this._engine.reportError(g):this._engine.afterFlush(()=>{he(e,T),V(e,w)})}return}let S=O(this._engine.playersByElement,e,[]);S.forEach(g=>{g.namespaceId==this.id&&g.triggerName==t&&g.queued&&g.destroy()});let y=r.matchTransition(l.value,c.value,e,c.params),f=!1;if(!y){if(!i)return;y=r.fallbackTransition,f=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:t,transition:y,fromState:l,toState:c,player:o,isFallbackTransition:f}),f||(L(e,Qs),o.onStart(()=>{Ee(e,Qs)})),o.onDone(()=>{let g=this.players.indexOf(o);g>=0&&this.players.splice(g,1);let T=this._engine.playersByElement.get(e);if(T){let w=T.indexOf(o);w>=0&&T.splice(w,1)}}),this.players.push(o),S.push(o),o}deregister(e){this._triggers.delete(e),this._engine.statesByElement.forEach(t=>t.delete(e)),this._elementListeners.forEach((t,s)=>{this._elementListeners.set(s,t.filter(i=>i.name!=e))})}clearElementCache(e){this._engine.statesByElement.delete(e),this._elementListeners.delete(e);let t=this._engine.playersByElement.get(e);t&&(t.forEach(s=>s.destroy()),this._engine.playersByElement.delete(e))}_signalRemovalForInnerTriggers(e,t){let s=this._engine.driver.query(e,Qe,!0);s.forEach(i=>{if(i[$])return;let r=this._engine.fetchNamespacesByElement(i);r.size?r.forEach(o=>o.triggerLeaveAnimation(i,t,!1,!0)):this.clearElementCache(i)}),this._engine.afterFlushAnimationsDone(()=>s.forEach(i=>this.clearElementCache(i)))}triggerLeaveAnimation(e,t,s,i){let r=this._engine.statesByElement.get(e),o=new Map;if(r){let a=[];if(r.forEach((l,c)=>{if(o.set(c,l.value),this._triggers.has(c)){let h=this.trigger(e,c,Me,i);h&&a.push(h)}}),a.length)return this._engine.markElementAsRemoved(this.id,e,!0,t,o),s&&te(a).onDone(()=>this._engine.processLeaveNode(e)),!0}return!1}prepareLeaveAnimationListeners(e){let t=this._elementListeners.get(e),s=this._engine.statesByElement.get(e);if(t&&s){let i=new Set;t.forEach(r=>{let o=r.name;if(i.has(o))return;i.add(o);let l=this._triggers.get(o).fallbackTransition,c=s.get(o)||mt,h=new Ne(Me),u=new Ce(this.id,o,e);this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:o,transition:l,fromState:c,toState:h,player:u,isFallbackTransition:!0})})}}removeNode(e,t){let s=this._engine;if(e.childElementCount&&this._signalRemovalForInnerTriggers(e,t),this.triggerLeaveAnimation(e,t,!0))return;let i=!1;if(s.totalAnimations){let r=s.players.length?s.playersByQueriedElement.get(e):[];if(r&&r.length)i=!0;else{let o=e;for(;o=o.parentNode;)if(s.statesByElement.get(o)){i=!0;break}}}if(this.prepareLeaveAnimationListeners(e),i)s.markElementAsRemoved(this.id,e,!1,t);else{let r=e[$];(!r||r===ri)&&(s.afterFlush(()=>this.clearElementCache(e)),s.destroyInnerAnimations(e),s._onRemovalComplete(e,t))}}insertNode(e,t){L(e,this._hostClassName)}drainQueuedTransitions(e){let t=[];return this._queue.forEach(s=>{let i=s.player;if(i.destroyed)return;let r=s.element,o=this._elementListeners.get(r);o&&o.forEach(a=>{if(a.name==s.triggerName){let l=kt(r,s.triggerName,s.fromState.value,s.toState.value);l._data=e,Rt(s.player,a.phase,l,a.callback)}}),i.markedForDestroy?this._engine.afterFlush(()=>{i.destroy()}):t.push(s)}),this._queue=[],t.sort((s,i)=>{let r=s.transition.ast.depCount,o=i.transition.ast.depCount;return r==0||o==0?r-o:this._engine.driver.containsElement(s.element,i.element)?1:-1})}destroy(e){this.players.forEach(t=>t.destroy()),this._signalRemovalForInnerTriggers(this.hostElement,e)}},Nt=class{_onRemovalComplete(e,t){this.onRemovalComplete(e,t)}constructor(e,t,s){this.bodyNode=e,this.driver=t,this._normalizer=s,this.players=[],this.newHostElements=new Map,this.playersByElement=new Map,this.playersByQueriedElement=new Map,this.statesByElement=new Map,this.disabledNodes=new Set,this.totalAnimations=0,this.totalQueuedPlayers=0,this._namespaceLookup={},this._namespaceList=[],this._flushFns=[],this._whenQuietFns=[],this.namespacesByHostElement=new Map,this.collectedEnterElements=[],this.collectedLeaveElements=[],this.onRemovalComplete=(i,r)=>{}}get queuedPlayers(){let e=[];return this._namespaceList.forEach(t=>{t.players.forEach(s=>{s.queued&&e.push(s)})}),e}createNamespace(e,t){let s=new Dt(e,t,this);return this.bodyNode&&this.driver.containsElement(this.bodyNode,t)?this._balanceNamespaceList(s,t):(this.newHostElements.set(t,s),this.collectEnterElement(t)),this._namespaceLookup[e]=s}_balanceNamespaceList(e,t){let s=this._namespaceList,i=this.namespacesByHostElement;if(s.length-1>=0){let o=!1,a=this.driver.getParentElement(t);for(;a;){let l=i.get(a);if(l){let c=s.indexOf(l);s.splice(c+1,0,e),o=!0;break}a=this.driver.getParentElement(a)}o||s.unshift(e)}else s.push(e);return i.set(t,e),e}register(e,t){let s=this._namespaceLookup[e];return s||(s=this.createNamespace(e,t)),s}registerTrigger(e,t,s){let i=this._namespaceLookup[e];i&&i.register(t,s)&&this.totalAnimations++}destroy(e,t){e&&(this.afterFlush(()=>{}),this.afterFlushAnimationsDone(()=>{let s=this._fetchNamespace(e);this.namespacesByHostElement.delete(s.hostElement);let i=this._namespaceList.indexOf(s);i>=0&&this._namespaceList.splice(i,1),s.destroy(t),delete this._namespaceLookup[e]}))}_fetchNamespace(e){return this._namespaceLookup[e]}fetchNamespacesByElement(e){let t=new Set,s=this.statesByElement.get(e);if(s){for(let i of s.values())if(i.namespaceId){let r=this._fetchNamespace(i.namespaceId);r&&t.add(r)}}return t}trigger(e,t,s,i){if(qe(t)){let r=this._fetchNamespace(e);if(r)return r.trigger(t,s,i),!0}return!1}insertNode(e,t,s,i){if(!qe(t))return;let r=t[$];if(r&&r.setForRemoval){r.setForRemoval=!1,r.setForMove=!0;let o=this.collectedLeaveElements.indexOf(t);o>=0&&this.collectedLeaveElements.splice(o,1)}if(e){let o=this._fetchNamespace(e);o&&o.insertNode(t,s)}i&&this.collectEnterElement(t)}collectEnterElement(e){this.collectedEnterElements.push(e)}markElementAsDisabled(e,t){t?this.disabledNodes.has(e)||(this.disabledNodes.add(e),L(e,ft)):this.disabledNodes.has(e)&&(this.disabledNodes.delete(e),Ee(e,ft))}removeNode(e,t,s){if(qe(t)){let i=e?this._fetchNamespace(e):null;i?i.removeNode(t,s):this.markElementAsRemoved(e,t,!1,s);let r=this.namespacesByHostElement.get(t);r&&r.id!==e&&r.removeNode(t,s)}else this._onRemovalComplete(t,s)}markElementAsRemoved(e,t,s,i,r){this.collectedLeaveElements.push(t),t[$]={namespaceId:e,setForRemoval:i,hasAnimation:s,removedBeforeQueried:!1,previousTriggersValues:r}}listen(e,t,s,i,r){return qe(t)?this._fetchNamespace(e).listen(t,s,i,r):()=>{}}_buildInstruction(e,t,s,i,r){return e.transition.build(this.driver,e.element,e.fromState.value,e.toState.value,s,i,e.fromState.options,e.toState.options,t,r)}destroyInnerAnimations(e){let t=this.driver.query(e,Qe,!0);t.forEach(s=>this.destroyActiveAnimationsForElement(s)),this.playersByQueriedElement.size!=0&&(t=this.driver.query(e,yt,!0),t.forEach(s=>this.finishActiveQueriedAnimationOnElement(s)))}destroyActiveAnimationsForElement(e){let t=this.playersByElement.get(e);t&&t.forEach(s=>{s.queued?s.markedForDestroy=!0:s.destroy()})}finishActiveQueriedAnimationOnElement(e){let t=this.playersByQueriedElement.get(e);t&&t.forEach(s=>s.finish())}whenRenderingDone(){return new Promise(e=>{if(this.players.length)return te(this.players).onDone(()=>e());e()})}processLeaveNode(e){let t=e[$];if(t&&t.setForRemoval){if(e[$]=ri,t.namespaceId){this.destroyInnerAnimations(e);let s=this._fetchNamespace(t.namespaceId);s&&s.clearElementCache(e)}this._onRemovalComplete(e,t.setForRemoval)}e.classList?.contains(ft)&&this.markElementAsDisabled(e,!1),this.driver.query(e,On,!0).forEach(s=>{this.markElementAsDisabled(s,!1)})}flush(e=-1){let t=[];if(this.newHostElements.size&&(this.newHostElements.forEach((s,i)=>this._balanceNamespaceList(s,i)),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(let s=0;ss()),this._flushFns=[],this._whenQuietFns.length){let s=this._whenQuietFns;this._whenQuietFns=[],t.length?te(t).onDone(()=>{s.forEach(i=>i())}):s.forEach(i=>i())}}reportError(e){throw Zi(e)}_flushAnimations(e,t){let s=new De,i=[],r=new Map,o=[],a=new Map,l=new Map,c=new Map,h=new Set;this.disabledNodes.forEach(d=>{h.add(d);let m=this.driver.query(d,kn,!0);for(let p=0;p{let p=Zs+g++;f.set(m,p),d.forEach(E=>L(E,p))});let T=[],w=new Set,A=new Set;for(let d=0;dw.add(E)):A.add(m))}let N=new Map,P=Gs(S,Array.from(w));P.forEach((d,m)=>{let p=gt+g++;N.set(m,p),d.forEach(E=>L(E,p))}),e.push(()=>{y.forEach((d,m)=>{let p=f.get(m);d.forEach(E=>Ee(E,p))}),P.forEach((d,m)=>{let p=N.get(m);d.forEach(E=>Ee(E,p))}),T.forEach(d=>{this.processLeaveNode(d)})});let me=[],B=[];for(let d=this._namespaceList.length-1;d>=0;d--)this._namespaceList[d].drainQueuedTransitions(t).forEach(p=>{let E=p.player,M=p.element;if(me.push(E),this.collectedEnterElements.length){let D=M[$];if(D&&D.setForMove){if(D.previousTriggersValues&&D.previousTriggersValues.has(p.triggerName)){let ne=D.previousTriggersValues.get(p.triggerName),I=this.statesByElement.get(p.element);if(I&&I.has(p.triggerName)){let Fe=I.get(p.triggerName);Fe.value=ne,I.set(p.triggerName,Fe)}}E.destroy();return}}let K=!u||!this.driver.containsElement(u,M),R=N.get(M),x=f.get(M),b=this._buildInstruction(p,s,x,R,K);if(b.errors&&b.errors.length){B.push(b);return}if(K){E.onStart(()=>he(M,b.fromStyles)),E.onDestroy(()=>V(M,b.toStyles)),i.push(E);return}if(p.isFallbackTransition){E.onStart(()=>he(M,b.fromStyles)),E.onDestroy(()=>V(M,b.toStyles)),i.push(E);return}let Ut=[];b.timelines.forEach(D=>{D.stretchStartingKeyframe=!0,this.disabledNodes.has(D.element)||Ut.push(D)}),b.timelines=Ut,s.append(M,b.timelines);let Si={instruction:b,player:E,element:M};o.push(Si),b.queriedElements.forEach(D=>O(a,D,[]).push(E)),b.preStyleProps.forEach((D,ne)=>{if(D.size){let I=l.get(ne);I||l.set(ne,I=new Set),D.forEach((Fe,nt)=>I.add(nt))}}),b.postStyleProps.forEach((D,ne)=>{let I=c.get(ne);I||c.set(ne,I=new Set),D.forEach((Fe,nt)=>I.add(nt))})});if(B.length){let d=[];B.forEach(m=>{d.push(en(m.triggerName,m.errors))}),me.forEach(m=>m.destroy()),this.reportError(d)}let C=new Map,F=new Map;o.forEach(d=>{let m=d.element;s.has(m)&&(F.set(m,m),this._beforeAnimationBuild(d.player.namespaceId,d.instruction,C))}),i.forEach(d=>{let m=d.element;this._getPreviousPlayers(m,!1,d.namespaceId,d.triggerName,null).forEach(E=>{O(C,m,[]).push(E),E.destroy()})});let se=T.filter(d=>xs(d,l,c)),pe=new Map;Hs(pe,this.driver,A,c,Q).forEach(d=>{xs(d,l,c)&&se.push(d)});let ie=new Map;y.forEach((d,m)=>{Hs(ie,this.driver,new Set(d),l,ze)}),se.forEach(d=>{let m=pe.get(d),p=ie.get(d);pe.set(d,new Map([...m?.entries()??[],...p?.entries()??[]]))});let it=[],jt=[],qt={};o.forEach(d=>{let{element:m,player:p,instruction:E}=d;if(s.has(m)){if(h.has(m)){p.onDestroy(()=>V(m,E.toStyles)),p.disabled=!0,p.overrideTotalTime(E.totalTime),i.push(p);return}let M=qt;if(F.size>1){let R=m,x=[];for(;R=R.parentNode;){let b=F.get(R);if(b){M=b;break}x.push(R)}x.forEach(b=>F.set(b,M))}let K=this._buildAnimation(p.namespaceId,E,C,r,ie,pe);if(p.setRealPlayer(K),M===qt)it.push(p);else{let R=this.playersByElement.get(M);R&&R.length&&(p.parentPlayer=te(R)),i.push(p)}}else he(m,E.fromStyles),p.onDestroy(()=>V(m,E.toStyles)),jt.push(p),h.has(m)&&i.push(p)}),jt.forEach(d=>{let m=r.get(d.element);if(m&&m.length){let p=te(m);d.setRealPlayer(p)}}),i.forEach(d=>{d.parentPlayer?d.syncPlayerEvents(d.parentPlayer):d.destroy()});for(let d=0;d!K.destroyed);M.length?qn(this,m,M):this.processLeaveNode(m)}return T.length=0,it.forEach(d=>{this.players.push(d),d.onDone(()=>{d.destroy();let m=this.players.indexOf(d);this.players.splice(m,1)}),d.play()}),it}afterFlush(e){this._flushFns.push(e)}afterFlushAnimationsDone(e){this._whenQuietFns.push(e)}_getPreviousPlayers(e,t,s,i,r){let o=[];if(t){let a=this.playersByQueriedElement.get(e);a&&(o=a)}else{let a=this.playersByElement.get(e);if(a){let l=!r||r==Me;a.forEach(c=>{c.queued||!l&&c.triggerName!=i||o.push(c)})}}return(s||i)&&(o=o.filter(a=>!(s&&s!=a.namespaceId||i&&i!=a.triggerName))),o}_beforeAnimationBuild(e,t,s){let i=t.triggerName,r=t.element,o=t.isRemovalTransition?void 0:e,a=t.isRemovalTransition?void 0:i;for(let l of t.timelines){let c=l.element,h=c!==r,u=O(s,c,[]);this._getPreviousPlayers(c,h,o,a,t.toState).forEach(y=>{let f=y.getRealPlayer();f.beforeDestroy&&f.beforeDestroy(),y.destroy(),u.push(y)})}he(r,t.fromStyles)}_buildAnimation(e,t,s,i,r,o){let a=t.triggerName,l=t.element,c=[],h=new Set,u=new Set,S=t.timelines.map(f=>{let g=f.element;h.add(g);let T=g[$];if(T&&T.removedBeforeQueried)return new ee(f.duration,f.delay);let w=g!==l,A=Un((s.get(g)||$n).map(C=>C.getRealPlayer())).filter(C=>{let F=C;return F.element?F.element===g:!1}),N=r.get(g),P=o.get(g),me=Ws(this._normalizer,f.keyframes,N,P),B=this._buildPlayer(f,me,A);if(f.subTimeline&&i&&u.add(g),w){let C=new Ce(e,a,g);C.setRealPlayer(B),c.push(C)}return B});c.forEach(f=>{O(this.playersByQueriedElement,f.element,[]).push(f),f.onDone(()=>Bn(this.playersByQueriedElement,f.element,f))}),h.forEach(f=>L(f,zs));let y=te(S);return y.onDestroy(()=>{h.forEach(f=>Ee(f,zs)),V(l,t.toStyles)}),u.forEach(f=>{O(i,f,[]).push(y)}),y}_buildPlayer(e,t,s){return t.length>0?this.driver.animate(e.element,t,e.duration,e.delay,e.easing,s):new ee(e.duration,e.delay)}},Ce=class{constructor(e,t,s){this.namespaceId=e,this.triggerName=t,this.element=s,this._player=new ee,this._containsRealPlayer=!1,this._queuedCallbacks=new Map,this.destroyed=!1,this.parentPlayer=null,this.markedForDestroy=!1,this.disabled=!1,this.queued=!0,this.totalTime=0}setRealPlayer(e){this._containsRealPlayer||(this._player=e,this._queuedCallbacks.forEach((t,s)=>{t.forEach(i=>Rt(e,s,void 0,i))}),this._queuedCallbacks.clear(),this._containsRealPlayer=!0,this.overrideTotalTime(e.totalTime),this.queued=!1)}getRealPlayer(){return this._player}overrideTotalTime(e){this.totalTime=e}syncPlayerEvents(e){let t=this._player;t.triggerCallback&&e.onStart(()=>t.triggerCallback("start")),e.onDone(()=>this.finish()),e.onDestroy(()=>this.destroy())}_queueEvent(e,t){O(this._queuedCallbacks,e,[]).push(t)}onDone(e){this.queued&&this._queueEvent("done",e),this._player.onDone(e)}onStart(e){this.queued&&this._queueEvent("start",e),this._player.onStart(e)}onDestroy(e){this.queued&&this._queueEvent("destroy",e),this._player.onDestroy(e)}init(){this._player.init()}hasStarted(){return this.queued?!1:this._player.hasStarted()}play(){!this.queued&&this._player.play()}pause(){!this.queued&&this._player.pause()}restart(){!this.queued&&this._player.restart()}finish(){this._player.finish()}destroy(){this.destroyed=!0,this._player.destroy()}reset(){!this.queued&&this._player.reset()}setPosition(e){this.queued||this._player.setPosition(e)}getPosition(){return this.queued?0:this._player.getPosition()}triggerCallback(e){let t=this._player;t.triggerCallback&&t.triggerCallback(e)}};function Bn(n,e,t){let s=n.get(e);if(s){if(s.length){let i=s.indexOf(t);s.splice(i,1)}s.length==0&&n.delete(e)}return s}function Kn(n){return n??null}function qe(n){return n&&n.nodeType===1}function jn(n){return n=="start"||n=="done"}function Vs(n,e){let t=n.style.display;return n.style.display=e??"none",t}function Hs(n,e,t,s,i){let r=[];t.forEach(l=>r.push(Vs(l)));let o=[];s.forEach((l,c)=>{let h=new Map;l.forEach(u=>{let S=e.computeStyle(c,u,i);h.set(u,S),(!S||S.length==0)&&(c[$]=zn,o.push(c))}),n.set(c,h)});let a=0;return t.forEach(l=>Vs(l,r[a++])),o}function Gs(n,e){let t=new Map;if(n.forEach(a=>t.set(a,[])),e.length==0)return t;let s=1,i=new Set(e),r=new Map;function o(a){if(!a)return s;let l=r.get(a);if(l)return l;let c=a.parentNode;return t.has(c)?l=c:i.has(c)?l=s:l=o(c),r.set(a,l),l}return e.forEach(a=>{let l=o(a);l!==s&&t.get(l).push(a)}),t}function L(n,e){n.classList?.add(e)}function Ee(n,e){n.classList?.remove(e)}function qn(n,e,t){te(t).onDone(()=>n.processLeaveNode(e))}function Un(n){let e=[];return oi(n,e),e}function oi(n,e){for(let t=0;ti.add(r)):e.set(n,s),t.delete(n),!0}var Te=class{constructor(e,t,s){this._driver=t,this._normalizer=s,this._triggerCache={},this.onRemovalComplete=(i,r)=>{},this._transitionEngine=new Nt(e.body,t,s),this._timelineEngine=new Pt(e.body,t,s),this._transitionEngine.onRemovalComplete=(i,r)=>this.onRemovalComplete(i,r)}registerTrigger(e,t,s,i,r){let o=e+"-"+i,a=this._triggerCache[o];if(!a){let l=[],c=[],h=si(this._driver,r,l,c);if(l.length)throw Ui(i,l);c.length&&void 0,a=Cn(i,h,this._normalizer),this._triggerCache[o]=a}this._transitionEngine.registerTrigger(t,i,a)}register(e,t){this._transitionEngine.register(e,t)}destroy(e,t){this._transitionEngine.destroy(e,t)}onInsert(e,t,s,i){this._transitionEngine.insertNode(e,t,s,i)}onRemove(e,t,s){this._transitionEngine.removeNode(e,t,s)}disableAnimations(e,t){this._transitionEngine.markElementAsDisabled(e,t)}process(e,t,s,i){if(s.charAt(0)=="@"){let[r,o]=Ls(s),a=i;this._timelineEngine.command(r,t,o,a)}else this._transitionEngine.trigger(e,t,s,i)}listen(e,t,s,i,r){if(s.charAt(0)=="@"){let[o,a]=Ls(s);return this._timelineEngine.listen(o,t,a,r)}return this._transitionEngine.listen(e,t,s,i,r)}flush(e=-1){this._transitionEngine.flush(e)}get players(){return[...this._transitionEngine.players,...this._timelineEngine.players]}whenRenderingDone(){return this._transitionEngine.whenRenderingDone()}afterFlushAnimationsDone(e){this._transitionEngine.afterFlushAnimationsDone(e)}};function Vn(n,e){let t=null,s=null;return Array.isArray(e)&&e.length?(t=pt(e[0]),e.length>1&&(s=pt(e[e.length-1]))):e instanceof Map&&(t=pt(e)),t||s?new Ct(n,t,s):null}var ve=class ve{constructor(e,t,s){this._element=e,this._startStyles=t,this._endStyles=s,this._state=0;let i=ve.initialStylesByElement.get(e);i||ve.initialStylesByElement.set(e,i=new Map),this._initialStyles=i}start(){this._state<1&&(this._startStyles&&V(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(V(this._element,this._initialStyles),this._endStyles&&(V(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(ve.initialStylesByElement.delete(this._element),this._startStyles&&(he(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(he(this._element,this._endStyles),this._endStyles=null),V(this._element,this._initialStyles),this._state=3)}};ve.initialStylesByElement=new WeakMap;var Ct=ve;function pt(n){let e=null;return n.forEach((t,s)=>{Hn(s)&&(e=e||new Map,e.set(s,t))}),e}function Hn(n){return n==="display"||n==="position"}var Ye=class{constructor(e,t,s,i){this.element=e,this.keyframes=t,this.options=s,this._specialStyles=i,this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._initialized=!1,this._finished=!1,this._started=!1,this._destroyed=!1,this._originalOnDoneFns=[],this._originalOnStartFns=[],this.time=0,this.parentPlayer=null,this.currentSnapshot=new Map,this._duration=s.duration,this._delay=s.delay||0,this.time=this._duration+this._delay}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}init(){this._buildPlayer(),this._preparePlayerBeforeStart()}_buildPlayer(){if(this._initialized)return;this._initialized=!0;let e=this.keyframes;this.domPlayer=this._triggerWebAnimation(this.element,e,this.options),this._finalKeyframe=e.length?e[e.length-1]:new Map;let t=()=>this._onFinish();this.domPlayer.addEventListener("finish",t),this.onDestroy(()=>{this.domPlayer.removeEventListener("finish",t)})}_preparePlayerBeforeStart(){this._delay?this._resetDomPlayerState():this.domPlayer.pause()}_convertKeyframesToObject(e){let t=[];return e.forEach(s=>{t.push(Object.fromEntries(s))}),t}_triggerWebAnimation(e,t,s){return e.animate(this._convertKeyframesToObject(t),s)}onStart(e){this._originalOnStartFns.push(e),this._onStartFns.push(e)}onDone(e){this._originalOnDoneFns.push(e),this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}play(){this._buildPlayer(),this.hasStarted()||(this._onStartFns.forEach(e=>e()),this._onStartFns=[],this._started=!0,this._specialStyles&&this._specialStyles.start()),this.domPlayer.play()}pause(){this.init(),this.domPlayer.pause()}finish(){this.init(),this._specialStyles&&this._specialStyles.finish(),this._onFinish(),this.domPlayer.finish()}reset(){this._resetDomPlayerState(),this._destroyed=!1,this._finished=!1,this._started=!1,this._onStartFns=this._originalOnStartFns,this._onDoneFns=this._originalOnDoneFns}_resetDomPlayerState(){this.domPlayer&&this.domPlayer.cancel()}restart(){this.reset(),this.play()}hasStarted(){return this._started}destroy(){this._destroyed||(this._destroyed=!0,this._resetDomPlayerState(),this._onFinish(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}setPosition(e){this.domPlayer===void 0&&this.init(),this.domPlayer.currentTime=e*this.time}getPosition(){return+(this.domPlayer.currentTime??0)/this.time}get totalTime(){return this._delay+this._duration}beforeDestroy(){let e=new Map;this.hasStarted()&&this._finalKeyframe.forEach((s,i)=>{i!=="offset"&&e.set(i,this._finished?s:$t(this.element,i))}),this.currentSnapshot=e}triggerCallback(e){let t=e==="start"?this._onStartFns:this._onDoneFns;t.forEach(s=>s()),t.length=0}},Xe=class{validateStyleProperty(e){return!0}validateAnimatableStyleProperty(e){return!0}containsElement(e,t){return Js(e,t)}getParentElement(e){return Ot(e)}query(e,t,s){return Ys(e,t,s)}computeStyle(e,t,s){return $t(e,t)}animate(e,t,s,i,r,o=[]){let a=i==0?"both":"forwards",l={duration:s,delay:i,fill:a};r&&(l.easing=r);let c=new Map,h=o.filter(y=>y instanceof Ye);dn(s,i)&&h.forEach(y=>{y.currentSnapshot.forEach((f,g)=>c.set(g,f))});let u=cn(t).map(y=>new Map(y));u=fn(e,u,c);let S=Vn(e,u);return new Ye(e,u,l,S)}};var Ue="@",ai="@.disabled",Ze=class{constructor(e,t,s,i){this.namespaceId=e,this.delegate=t,this.engine=s,this._onDestroy=i,this.\u0275type=0}get data(){return this.delegate.data}destroyNode(e){this.delegate.destroyNode?.(e)}destroy(){this.engine.destroy(this.namespaceId,this.delegate),this.engine.afterFlushAnimationsDone(()=>{queueMicrotask(()=>{this.delegate.destroy()})}),this._onDestroy?.()}createElement(e,t){return this.delegate.createElement(e,t)}createComment(e){return this.delegate.createComment(e)}createText(e){return this.delegate.createText(e)}appendChild(e,t){this.delegate.appendChild(e,t),this.engine.onInsert(this.namespaceId,t,e,!1)}insertBefore(e,t,s,i=!0){this.delegate.insertBefore(e,t,s),this.engine.onInsert(this.namespaceId,t,e,i)}removeChild(e,t,s){this.engine.onRemove(this.namespaceId,t,this.delegate)}selectRootElement(e,t){return this.delegate.selectRootElement(e,t)}parentNode(e){return this.delegate.parentNode(e)}nextSibling(e){return this.delegate.nextSibling(e)}setAttribute(e,t,s,i){this.delegate.setAttribute(e,t,s,i)}removeAttribute(e,t,s){this.delegate.removeAttribute(e,t,s)}addClass(e,t){this.delegate.addClass(e,t)}removeClass(e,t){this.delegate.removeClass(e,t)}setStyle(e,t,s,i){this.delegate.setStyle(e,t,s,i)}removeStyle(e,t,s){this.delegate.removeStyle(e,t,s)}setProperty(e,t,s){t.charAt(0)==Ue&&t==ai?this.disableAnimations(e,!!s):this.delegate.setProperty(e,t,s)}setValue(e,t){this.delegate.setValue(e,t)}listen(e,t,s){return this.delegate.listen(e,t,s)}disableAnimations(e,t){this.engine.disableAnimations(e,t)}},Ft=class extends Ze{constructor(e,t,s,i,r){super(t,s,i,r),this.factory=e,this.namespaceId=t}setProperty(e,t,s){t.charAt(0)==Ue?t.charAt(1)=="."&&t==ai?(s=s===void 0?!0:!!s,this.disableAnimations(e,s)):this.engine.process(this.namespaceId,e,t.slice(1),s):this.delegate.setProperty(e,t,s)}listen(e,t,s){if(t.charAt(0)==Ue){let i=Gn(e),r=t.slice(1),o="";return r.charAt(0)!=Ue&&([r,o]=xn(r)),this.engine.listen(this.namespaceId,i,r,o,a=>{let l=a._data||-1;this.factory.scheduleListenerCallback(l,s,a)})}return this.delegate.listen(e,t,s)}};function Gn(n){switch(n){case"body":return document.body;case"document":return document;case"window":return window;default:return n}}function xn(n){let e=n.indexOf("."),t=n.substring(0,e),s=n.slice(e+1);return[t,s]}var et=class{constructor(e,t,s){this.delegate=e,this.engine=t,this._zone=s,this._currentId=0,this._microtaskId=1,this._animationCallbacksBuffer=[],this._rendererCache=new Map,this._cdRecurDepth=0,t.onRemovalComplete=(i,r)=>{let o=r?.parentNode(i);o&&r.removeChild(o,i)}}createRenderer(e,t){let s="",i=this.delegate.createRenderer(e,t);if(!e||!t?.data?.animation){let c=this._rendererCache,h=c.get(i);if(!h){let u=()=>c.delete(i);h=new Ze(s,i,this.engine,u),c.set(i,h)}return h}let r=t.id,o=t.id+"-"+this._currentId;this._currentId++,this.engine.register(o,e);let a=c=>{Array.isArray(c)?c.forEach(a):this.engine.registerTrigger(r,o,e,c.name,c)};return t.data.animation.forEach(a),new Ft(this,o,i,this.engine)}begin(){this._cdRecurDepth++,this.delegate.begin&&this.delegate.begin()}_scheduleCountTask(){queueMicrotask(()=>{this._microtaskId++})}scheduleListenerCallback(e,t,s){if(e>=0&&et(s));return}let i=this._animationCallbacksBuffer;i.length==0&&queueMicrotask(()=>{this._zone.run(()=>{i.forEach(r=>{let[o,a]=r;o(a)}),this._animationCallbacksBuffer=[]})}),i.push([t,s])}end(){this._cdRecurDepth--,this._cdRecurDepth==0&&this._zone.runOutsideAngular(()=>{this._scheduleCountTask(),this.engine.flush(this._microtaskId)}),this.delegate.end&&this.delegate.end()}whenRenderingDone(){return this.engine.whenRenderingDone()}};var Jn=(()=>{let e=class e extends Te{constructor(s,i,r){super(s,i,r)}ngOnDestroy(){this.flush()}};e.\u0275fac=function(i){return new(i||e)(j(ns),j(de),j(fe))},e.\u0275prov=W({token:e,factory:e.\u0275fac});let n=e;return n})();function Yn(){return new He}function Xn(n,e,t){return new et(n,e,t)}var li=[{provide:fe,useFactory:Yn},{provide:Te,useClass:Jn},{provide:Xt,useFactory:Xn,deps:[hs,Te,ke]}],Zn=[{provide:de,useFactory:()=>new Xe},{provide:rt,useValue:"BrowserAnimations"},...li],Ir=[{provide:de,useClass:It},{provide:rt,useValue:"NoopAnimations"},...li];function ci(){return Zt("NgEagerAnimations"),[...Zn]}var tt=class{http;prefix;suffix;constructor(e,t="/assets/i18n/",s=".json"){this.http=e,this.prefix=t,this.suffix=s}getTranslation(e){return this.http.get(`${this.prefix}${e}${this.suffix}`)}};function er(n,e){if(n&1&&(U(0,"li")(1,"h2")(2,"a",2),ae(3),ge(4,"translate"),Y()()()),n&2){let t,s=e.$implicit;q(2),oe("routerLink","/"+s.path),q(),Oe(" ",ye(4,2,((t=s.name)!==null&&t!==void 0?t:s.path)+".title")," ")}}var hi=(()=>{let e=class e{constructor(){this.sections=[{path:"dashboard"},{path:"presence-control"},{path:"open-absences"},{path:"edit-absences"},{path:"evaluate-absences"},{path:"events"},{path:"events/current",name:"events.current"},{path:"my-absences"},{path:"my-profile"},{path:"my-grades"},{path:"my-settings"}]}};e.\u0275fac=function(i){return new(i||e)},e.\u0275cmp=J({type:e,selectors:[["bkd-home"]],standalone:!0,features:[X],decls:2,vars:1,consts:[[1,"mt-3"],[4,"ngFor","ngForOf"],[3,"routerLink"]],template:function(i,r){i&1&&(U(0,"ul",0),be(1,er,5,4,"li",1),Y()),i&2&&(q(),oe("ngForOf",r.sections))},dependencies:[Ie,ms,Se,$e],changeDetection:0});let n=e;return n})();var di=(()=>{let e=class e{constructor(){}};e.\u0275fac=function(i){return new(i||e)},e.\u0275cmp=J({type:e,selectors:[["bkd-unauthenticated"]],standalone:!0,features:[X],decls:4,vars:3,consts:[[1,"bkd-container"],[1,"alert","alert-danger","my-3"]],template:function(i,r){i&1&&(U(0,"div",0)(1,"div",1),ae(2),ge(3,"translate"),Y()()),i&2&&(q(2),Oe(" ",ye(3,1,"unauthenticated.message")," "))},dependencies:[Se,$e],encapsulation:2});let n=e;return n})();var st=(()=>{let e=class e{constructor(s){this.storage=s}get isAuthenticated(){return!!this.accessToken}get accessToken(){return this.storage.getAccessToken()}};e.\u0275fac=function(i){return new(i||e)(j(bs))},e.\u0275prov=W({token:e,factory:e.\u0275fac,providedIn:"root"});let n=e;return n})();function z(){return()=>{let n=H(st),e=H(Le);return n.isAuthenticated?!0:(e.navigate(["/unauthenticated"]),!1)}}var fi=[{path:"dashboard",canActivate:[z()],loadChildren:()=>import("./chunk-WNMIKIML.js").then(n=>n.DASHBOARD_ROUTES)},{path:"presence-control",canActivate:[z()],loadChildren:()=>import("./chunk-VJ6UATSE.js").then(n=>n.PRESENCE_CONTROL_ROUTES)},{path:"open-absences",canActivate:[z()],loadChildren:()=>import("./chunk-SVAHLOZE.js").then(n=>n.OPEN_ABSENCES_ROUTES)},{path:"edit-absences",canActivate:[z()],loadChildren:()=>import("./chunk-GTCR4WGM.js").then(n=>n.EDIT_ABSENCES_ROUTES)},{path:"evaluate-absences",canActivate:[z()],loadChildren:()=>import("./chunk-ELVM3VWW.js").then(n=>n.EVALUATE_ABSENCES_ROUTES)},{path:"events",canActivate:[z()],loadChildren:()=>import("./chunk-RPNHXIUO.js").then(n=>n.EVENTS_ROUTES)},{path:"my-absences",canActivate:[z()],loadChildren:()=>import("./chunk-KNS2BM7M.js").then(n=>n.MY_ABSENCES_ROUTES)},{path:"my-profile",canActivate:[z()],loadChildren:()=>import("./chunk-7T3G7FUV.js").then(n=>n.MY_PROFILE_ROUTES)},{path:"my-grades",canActivate:[z()],loadChildren:()=>import("./chunk-PMU42JF5.js").then(n=>n.MY_GRADES_ROUTES)},{path:"my-settings",canActivate:[z()],loadChildren:()=>import("./chunk-S2U6O7J2.js").then(n=>n.MY_SETTINGS_ROUTES)},{path:"unauthenticated",component:di},{path:"",component:hi,pathMatch:"full"}];function mi(){return(n,e)=>{let t=H(st),s=H(Z);if(n.url.startsWith(s.apiUrl)&&t.accessToken){let i=n.headers.set("Authorization",`Bearer ${t.accessToken}`);return e(n.clone({headers:i}))}return e(n)}}function pi(){return(n,e)=>{let t=H(Z);if(!n.headers.has("X-Role-Restriction")&&t.headerRoleRestriction){let s=tr();if(s&&t.headerRoleRestriction[s]){let i=n.headers.set("X-Role-Restriction",t.headerRoleRestriction[s]);return e(n.clone({headers:i}))}}return e(n)}}function tr(){let n=H(Le),e=n.url?Ms(n.url):null;return e?Ss(e):null}function gi(){return[{provide:Yt,useClass:sr}]}var sr=(()=>{let e=class e{constructor(s,i,r){this.ngZone=s,this.translate=i,this.toastService=r}handleError(s){console.error(String(s)),s instanceof as||this.notifyError()}notifyError(){this.ngZone.run(()=>{this.toastService.error(this.translate.instant("global.app-errors.exception-message"),this.translate.instant("global.app-errors.exception-title"))})}};e.\u0275fac=function(i){return new(i||e)(j(ke),j(Ts),j(_e))},e.\u0275prov=W({token:e,factory:e.\u0275fac});let n=e;return n})();function ir(n,e){return new tt(n,`${e.scriptsAndAssetsPath}/assets/locales/`,".json")}var yi={providers:[ps(fi,gs()),cs(us([Ps(),mi(),pi()])),ci(),gi(),xt(Se.forRoot({loader:{provide:vs,useFactory:ir,deps:[ls,Z]}})),ws()]};var _i={production:!0};_i.production&&void 0;lt(Ds);lt(Ns);ds(ks,yi).catch(n=>console.error(n)); +import{b as Ps}from"./chunk-PSXDSPKS.js";import{c as Ms}from"./chunk-5RDJZAUT.js";import{a as ws,b as As}from"./chunk-DB66EACG.js";import{r as _s}from"./chunk-C56YGDXA.js";import{a as _e}from"./chunk-UX5TA32W.js";import{$ as J,$a as ot,A as Ht,Aa as Zt,Ab as ge,Ba as ke,Bb as ye,Cd as Es,Ed as vs,Fd as Ts,Ga as be,Gd as $e,Hd as Se,Ia as oe,Id as bs,Ka as es,Lb as ns,Pb as lt,Rb as Ie,Sa as U,Sb as rs,Ta as Y,U as v,Ua as ts,Uc as ys,Vb as os,Vc as Z,W,Y as Gt,Ya as ss,Z as j,_ as H,_a as is,a as Re,c as Qt,cc as as,da as xt,dc as ls,ec as cs,fc as us,gc as hs,ha as Wt,hc as ds,ia as Jt,j as Vt,jb as ae,kb as at,lb as Oe,oa as Yt,pc as fs,qc as Le,rc as ms,sa as rt,tb as X,tc as ps,ua as q,uc as gs,va as re,vd as Ss,ya as Xt}from"./chunk-XTHSYQMN.js";function Ei(n){let e=n,t=Math.floor(Math.abs(n)),s=n.toString().replace(/^[^.]*\.?/,"").length;return t===1&&s===0?1:5}var Ds=["de-CH",[["AM","PM"],void 0,void 0],void 0,[["S","M","D","M","D","F","S"],["So.","Mo.","Di.","Mi.","Do.","Fr.","Sa."],["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],["So","Mo","Di","Mi","Do","Fr","Sa"]],[["S","M","D","M","D","F","S"],["So","Mo","Di","Mi","Do","Fr","Sa"],["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],["So.","Mo.","Di.","Mi.","Do.","Fr.","Sa."]],[["J","F","M","A","M","J","J","A","S","O","N","D"],["Jan.","Feb.","M\xE4rz","Apr.","Mai","Juni","Juli","Aug.","Sept.","Okt.","Nov.","Dez."],["Januar","Februar","M\xE4rz","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"]],[["J","F","M","A","M","J","J","A","S","O","N","D"],["Jan","Feb","M\xE4r","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],["Januar","Februar","M\xE4rz","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"]],[["v. Chr.","n. Chr."],void 0,void 0],1,[6,0],["dd.MM.yy","dd.MM.y","d. MMMM y","EEEE, d. MMMM y"],["HH:mm","HH:mm:ss","HH:mm:ss z","HH:mm:ss zzzz"],["{1}, {0}",void 0,"{1} 'um' {0}",void 0],[".","\u2019",";","%","+","-","E","\xB7","\u2030","\u221E","NaN",":"],["#,##0.###","#,##0%","\xA4\xA0#,##0.00;\xA4-#,##0.00","#E0"],"CHF","CHF","Schweizer Franken",{ATS:["\xF6S"],AUD:["AU$","$"],BGM:["BGK"],BGO:["BGJ"],BYN:[void 0,"\u0440."],CUC:[void 0,"Cub$"],DEM:["DM"],EUR:[],FKP:[void 0,"Fl\xA3"],GHS:[void 0,"\u20B5"],GNF:[void 0,"F.G."],KMF:[void 0,"FC"],PHP:[void 0,"\u20B1"],RON:[void 0,"L"],RUR:[void 0,"\u0440."],RWF:[void 0,"F.Rw"],SYP:[],THB:["\u0E3F"],TWD:["NT$"],XXX:[],ZMW:[void 0,"K"]},"ltr",Ei];function vi(n){let e=n,t=Math.floor(Math.abs(n)),s=n.toString().replace(/^[^.]*\.?/,"").length,i=parseInt(n.toString().replace(/^[^e]*(e([-+]?\d+))?/,"$2"))||0;return t===0||t===1?1:i===0&&t!==0&&t%1e6===0&&s===0||!(i>=0&&i<=5)?4:5}var Ns=["fr-CH",[["AM","PM"],void 0,void 0],void 0,[["D","L","M","M","J","V","S"],["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],["di","lu","ma","me","je","ve","sa"]],void 0,[["J","F","M","A","M","J","J","A","S","O","N","D"],["janv.","f\xE9vr.","mars","avr.","mai","juin","juil.","ao\xFBt","sept.","oct.","nov.","d\xE9c."],["janvier","f\xE9vrier","mars","avril","mai","juin","juillet","ao\xFBt","septembre","octobre","novembre","d\xE9cembre"]],void 0,[["av. J.-C.","ap. J.-C."],void 0,["avant J\xE9sus-Christ","apr\xE8s J\xE9sus-Christ"]],1,[6,0],["dd.MM.yy","d MMM y","d MMMM y","EEEE, d MMMM y"],["HH:mm","HH:mm:ss","HH:mm:ss z","HH.mm:ss 'h' zzzz"],["{1} {0}","{1}, {0}","{1} '\xE0' {0}",void 0],[",","\u202F",";","%","+","-","E","\xD7","\u2030","\u221E","NaN",":","."],["#,##0.###","#,##0%","#,##0.00\xA0\xA4","#E0"],"CHF","CHF","franc suisse",{ARS:["$AR","$"],AUD:["$AU","$"],BEF:["FB"],BMD:["$BM","$"],BND:["$BN","$"],BYN:[void 0,"\u0440."],BZD:["$BZ","$"],CAD:["$CA","$"],CLP:["$CL","$"],CNY:[void 0,"\xA5"],COP:["$CO","$"],CYP:["\xA3CY"],EGP:[void 0,"\xA3E"],FJD:["$FJ","$"],FKP:["\xA3FK","\xA3"],FRF:["F"],GBP:["\xA3GB","\xA3"],GIP:["\xA3GI","\xA3"],HKD:[void 0,"$"],IEP:["\xA3IE"],ILP:["\xA3IL"],ITL:["\u20A4IT"],JPY:[void 0,"\xA5"],KMF:[void 0,"FC"],LBP:["\xA3LB","\xA3L"],MTP:["\xA3MT"],MXN:["$MX","$"],NAD:["$NA","$"],NIO:[void 0,"$C"],NZD:["$NZ","$"],PHP:[void 0,"\u20B1"],RHD:["$RH"],RON:[void 0,"L"],RWF:[void 0,"FR"],SBD:["$SB","$"],SGD:["$SG","$"],SRD:["$SR","$"],TOP:[void 0,"$T"],TTD:["$TT","$"],TWD:[void 0,"NT$"],USD:["$US","$"],UYU:["$UY","$"],WST:["$WS"],XCD:[void 0,"$"],XPF:["FCFP"],ZMW:[void 0,"Kw"]},"ltr",vi];function Ti(n,e){if(n&1&&(U(0,"i",4),ae(1),Y()),n&2){let t=ot().$implicit;q(),at(t.icon)}}function bi(n,e){if(n&1){let t=ss();U(0,"ngb-toast",1),is("hidden",function(){let i=Wt(t).$implicit,r=ot();return Jt(r.toastService.remove(i))}),U(1,"div",2),be(2,Ti,2,1,"i",3),U(3,"span"),ae(4),Y()()()}if(n&2){let t=e.$implicit;es(t.classname),oe("header",t.header||"")("autohide",!0),q(2),oe("ngIf",t.icon),q(2),at(t.message)}}var Fs=(()=>{let e=class e{constructor(s){this.toastService=s}};e.\u0275fac=function(i){return new(i||e)(re(_e))},e.\u0275cmp=J({type:e,selectors:[["bkd-toast"]],standalone:!0,features:[X],decls:2,vars:3,consts:[[3,"header","class","autohide","hidden",4,"ngFor","ngForOf"],[3,"hidden","header","autohide"],[1,"d-flex","gap-2"],["class","material-icons",4,"ngIf"],[1,"material-icons"]],template:function(i,r){i&1&&(be(0,bi,5,6,"ngb-toast",0),ge(1,"async")),i&2&&oe("ngForOf",ye(1,1,r.toastService.toasts$))},dependencies:[Ie,_s,rs,os],styles:["[_nghost-%COMP%]{position:fixed;top:0;right:0;margin:.5em;z-index:1200}[_nghost-%COMP%] > *[_ngcontent-%COMP%]{font-size:medium}"]});let n=e;return n})();var Rs=new Gt("Navigator API",{providedIn:"root",factory:()=>navigator});var ks=(()=>{let e=class e{constructor(s,i,r,o){this.toastService=i,this.settings=r,this.navigator=o,s.initialize(),this.checkSettings()}checkSettings(){Es(ys)(this.settings).pipe(Ht(s=>(console.error(String(s)),this.toastService.error("Please check the contents of the settings.js file (see Console output for more details).","Invalid Settings"),Vt))).subscribe()}};e.\u0275fac=function(i){return new(i||e)(re(As),re(_e),re(Z),re(Rs))},e.\u0275cmp=J({type:e,selectors:[["bkd-app"]],standalone:!0,features:[X],decls:2,vars:0,consts:[["aria-live","polite","aria-atomic","true"]],template:function(i,r){i&1&&ts(0,"bkd-toast",0)(1,"router-outlet")},dependencies:[Fs,fs],styles:["[_nghost-%COMP%]{width:100%}"],changeDetection:0});let n=e;return n})();var _=function(n){return n[n.State=0]="State",n[n.Transition=1]="Transition",n[n.Sequence=2]="Sequence",n[n.Group=3]="Group",n[n.Animate=4]="Animate",n[n.Keyframes=5]="Keyframes",n[n.Style=6]="Style",n[n.Trigger=7]="Trigger",n[n.Reference=8]="Reference",n[n.AnimateChild=9]="AnimateChild",n[n.AnimateRef=10]="AnimateRef",n[n.Query=11]="Query",n[n.Stagger=12]="Stagger",n}(_||{}),Q="*";function Os(n,e=null){return{type:_.Sequence,steps:n,options:e}}function ct(n){return{type:_.Style,styles:n,offset:null}}var ee=class{constructor(e=0,t=0){this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._originalOnDoneFns=[],this._originalOnStartFns=[],this._started=!1,this._destroyed=!1,this._finished=!1,this._position=0,this.parentPlayer=null,this.totalTime=e+t}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}onStart(e){this._originalOnStartFns.push(e),this._onStartFns.push(e)}onDone(e){this._originalOnDoneFns.push(e),this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}hasStarted(){return this._started}init(){}play(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}triggerMicrotask(){queueMicrotask(()=>this._onFinish())}_onStart(){this._onStartFns.forEach(e=>e()),this._onStartFns=[]}pause(){}restart(){}finish(){this._onFinish()}destroy(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}reset(){this._started=!1,this._finished=!1,this._onStartFns=this._originalOnStartFns,this._onDoneFns=this._originalOnDoneFns}setPosition(e){this._position=this.totalTime?e*this.totalTime:1}getPosition(){return this.totalTime?this._position/this.totalTime:1}triggerCallback(e){let t=e=="start"?this._onStartFns:this._onDoneFns;t.forEach(s=>s()),t.length=0}},we=class{constructor(e){this._onDoneFns=[],this._onStartFns=[],this._finished=!1,this._started=!1,this._destroyed=!1,this._onDestroyFns=[],this.parentPlayer=null,this.totalTime=0,this.players=e;let t=0,s=0,i=0,r=this.players.length;r==0?queueMicrotask(()=>this._onFinish()):this.players.forEach(o=>{o.onDone(()=>{++t==r&&this._onFinish()}),o.onDestroy(()=>{++s==r&&this._onDestroy()}),o.onStart(()=>{++i==r&&this._onStart()})}),this.totalTime=this.players.reduce((o,a)=>Math.max(o,a.totalTime),0)}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}init(){this.players.forEach(e=>e.init())}onStart(e){this._onStartFns.push(e)}_onStart(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach(e=>e()),this._onStartFns=[])}onDone(e){this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}hasStarted(){return this._started}play(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach(e=>e.play())}pause(){this.players.forEach(e=>e.pause())}restart(){this.players.forEach(e=>e.restart())}finish(){this._onFinish(),this.players.forEach(e=>e.finish())}destroy(){this._onDestroy()}_onDestroy(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach(e=>e.destroy()),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}reset(){this.players.forEach(e=>e.reset()),this._destroyed=!1,this._finished=!1,this._started=!1}setPosition(e){let t=e*this.totalTime;this.players.forEach(s=>{let i=s.totalTime?Math.min(1,t/s.totalTime):1;s.setPosition(i)})}getPosition(){let e=this.players.reduce((t,s)=>t===null||s.totalTime>t.totalTime?s:t,null);return e!=null?e.getPosition():0}beforeDestroy(){this.players.forEach(e=>{e.beforeDestroy&&e.beforeDestroy()})}triggerCallback(e){let t=e=="start"?this._onStartFns:this._onDoneFns;t.forEach(s=>s()),t.length=0}},ze="!";function Is(n){return new v(3e3,!1)}function wi(){return new v(3100,!1)}function Ai(){return new v(3101,!1)}function Mi(n){return new v(3001,!1)}function Pi(n){return new v(3003,!1)}function Di(n){return new v(3004,!1)}function Ni(n,e){return new v(3005,!1)}function Ci(){return new v(3006,!1)}function Fi(){return new v(3007,!1)}function Ri(n,e){return new v(3008,!1)}function ki(n){return new v(3002,!1)}function Oi(n,e,t,s,i){return new v(3010,!1)}function Ii(){return new v(3011,!1)}function Li(){return new v(3012,!1)}function $i(){return new v(3200,!1)}function zi(){return new v(3202,!1)}function Bi(){return new v(3013,!1)}function Ki(n){return new v(3014,!1)}function ji(n){return new v(3015,!1)}function qi(n){return new v(3016,!1)}function Ui(n,e){return new v(3404,!1)}function Qi(n){return new v(3502,!1)}function Vi(n){return new v(3503,!1)}function Hi(){return new v(3300,!1)}function Gi(n){return new v(3504,!1)}function xi(n){return new v(3301,!1)}function Wi(n,e){return new v(3302,!1)}function Ji(n){return new v(3303,!1)}function Yi(n,e){return new v(3400,!1)}function Xi(n){return new v(3401,!1)}function Zi(n){return new v(3402,!1)}function en(n,e){return new v(3505,!1)}function te(n){switch(n.length){case 0:return new ee;case 1:return n[0];default:return new we(n)}}function Ws(n,e,t=new Map,s=new Map){let i=[],r=[],o=-1,a=null;if(e.forEach(l=>{let c=l.get("offset"),h=c==o,u=h&&a||new Map;l.forEach((S,y)=>{let f=y,g=S;if(y!=="offset")switch(f=n.normalizePropertyName(f,i),g){case ze:g=t.get(y);break;case Q:g=s.get(y);break;default:g=n.normalizeStyleValue(y,f,g,i);break}u.set(f,g)}),h||r.push(u),a=u,o=c}),i.length)throw Qi(i);return r}function Rt(n,e,t,s){switch(e){case"start":n.onStart(()=>s(t&&ut(t,"start",n)));break;case"done":n.onDone(()=>s(t&&ut(t,"done",n)));break;case"destroy":n.onDestroy(()=>s(t&&ut(t,"destroy",n)));break}}function ut(n,e,t){let s=t.totalTime,i=!!t.disabled,r=kt(n.element,n.triggerName,n.fromState,n.toState,e||n.phaseName,s??n.totalTime,i),o=n._data;return o!=null&&(r._data=o),r}function kt(n,e,t,s,i="",r=0,o){return{element:n,triggerName:e,fromState:t,toState:s,phaseName:i,totalTime:r,disabled:!!o}}function O(n,e,t){let s=n.get(e);return s||n.set(e,s=t),s}function Ls(n){let e=n.indexOf(":"),t=n.substring(1,e),s=n.slice(e+1);return[t,s]}var tn=typeof document>"u"?null:document.documentElement;function Ot(n){let e=n.parentNode||n.host||null;return e===tn?null:e}function sn(n){return n.substring(1,6)=="ebkit"}var ce=null,$s=!1;function nn(n){ce||(ce=rn()||{},$s=ce.style?"WebkitAppearance"in ce.style:!1);let e=!0;return ce.style&&!sn(n)&&(e=n in ce.style,!e&&$s&&(e="Webkit"+n.charAt(0).toUpperCase()+n.slice(1)in ce.style)),e}function rn(){return typeof document<"u"?document.body:null}function Js(n,e){for(;e;){if(e===n)return!0;e=Ot(e)}return!1}function Ys(n,e,t){if(t)return Array.from(n.querySelectorAll(e));let s=n.querySelector(e);return s?[s]:[]}var It=(()=>{let e=class e{validateStyleProperty(s){return nn(s)}containsElement(s,i){return Js(s,i)}getParentElement(s){return Ot(s)}query(s,i,r){return Ys(s,i,r)}computeStyle(s,i,r){return r||""}animate(s,i,r,o,a,l=[],c){return new ee(r,o)}};e.\u0275fac=function(i){return new(i||e)},e.\u0275prov=W({token:e,factory:e.\u0275fac});let n=e;return n})(),Bt=class Bt{};Bt.NOOP=new It;var de=Bt,fe=class{};var on=1e3,Xs="{{",an="}}",Zs="ng-enter",gt="ng-leave",Be="ng-trigger",Qe=".ng-trigger",zs="ng-animating",yt=".ng-animating";function G(n){if(typeof n=="number")return n;let e=n.match(/^(-?[\.\d]+)(m?s)/);return!e||e.length<2?0:_t(parseFloat(e[1]),e[2])}function _t(n,e){switch(e){case"s":return n*on;default:return n}}function Ve(n,e,t){return n.hasOwnProperty("duration")?n:ln(n,e,t)}function ln(n,e,t){let s=/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i,i,r=0,o="";if(typeof n=="string"){let a=n.match(s);if(a===null)return e.push(Is(n)),{duration:0,delay:0,easing:""};i=_t(parseFloat(a[1]),a[2]);let l=a[3];l!=null&&(r=_t(parseFloat(l),a[4]));let c=a[5];c&&(o=c)}else i=n;if(!t){let a=!1,l=e.length;i<0&&(e.push(wi()),a=!0),r<0&&(e.push(Ai()),a=!0),a&&e.splice(l,0,Is(n))}return{duration:i,delay:r,easing:o}}function cn(n){return n.length?n[0]instanceof Map?n:n.map(e=>new Map(Object.entries(e))):[]}function V(n,e,t){e.forEach((s,i)=>{let r=Lt(i);t&&!t.has(i)&&t.set(i,n.style[r]),n.style[r]=s})}function he(n,e){e.forEach((t,s)=>{let i=Lt(s);n.style[i]=""})}function Ae(n){return Array.isArray(n)?n.length==1?n[0]:Os(n):n}function un(n,e,t){let s=e.params||{},i=ei(n);i.length&&i.forEach(r=>{s.hasOwnProperty(r)||t.push(Mi(r))})}var St=new RegExp(`${Xs}\\s*(.+?)\\s*${an}`,"g");function ei(n){let e=[];if(typeof n=="string"){let t;for(;t=St.exec(n);)e.push(t[1]);St.lastIndex=0}return e}function Pe(n,e,t){let s=`${n}`,i=s.replace(St,(r,o)=>{let a=e[o];return a==null&&(t.push(Pi(o)),a=""),a.toString()});return i==s?n:i}var hn=/-+([a-z0-9])/g;function Lt(n){return n.replace(hn,(...e)=>e[1].toUpperCase())}function dn(n,e){return n===0||e===0}function fn(n,e,t){if(t.size&&e.length){let s=e[0],i=[];if(t.forEach((r,o)=>{s.has(o)||i.push(o),s.set(o,r)}),i.length)for(let r=1;ro.set(a,$t(n,a)))}}return e}function k(n,e,t){switch(e.type){case _.Trigger:return n.visitTrigger(e,t);case _.State:return n.visitState(e,t);case _.Transition:return n.visitTransition(e,t);case _.Sequence:return n.visitSequence(e,t);case _.Group:return n.visitGroup(e,t);case _.Animate:return n.visitAnimate(e,t);case _.Keyframes:return n.visitKeyframes(e,t);case _.Style:return n.visitStyle(e,t);case _.Reference:return n.visitReference(e,t);case _.AnimateChild:return n.visitAnimateChild(e,t);case _.AnimateRef:return n.visitAnimateRef(e,t);case _.Query:return n.visitQuery(e,t);case _.Stagger:return n.visitStagger(e,t);default:throw Di(e.type)}}function $t(n,e){return window.getComputedStyle(n)[e]}var mn=new Set(["width","height","minWidth","minHeight","maxWidth","maxHeight","left","top","bottom","right","fontSize","outlineWidth","outlineOffset","paddingTop","paddingLeft","paddingBottom","paddingRight","marginTop","marginLeft","marginBottom","marginRight","borderRadius","borderWidth","borderTopWidth","borderLeftWidth","borderRightWidth","borderBottomWidth","textIndent","perspective"]),He=class extends fe{normalizePropertyName(e,t){return Lt(e)}normalizeStyleValue(e,t,s,i){let r="",o=s.toString().trim();if(mn.has(t)&&s!==0&&s!=="0")if(typeof s=="number")r="px";else{let a=s.match(/^[+-]?[\d\.]+([a-z]*)$/);a&&a[1].length==0&&i.push(Ni(e,s))}return o+r}};var Ge="*";function pn(n,e){let t=[];return typeof n=="string"?n.split(/\s*,\s*/).forEach(s=>gn(s,t,e)):t.push(n),t}function gn(n,e,t){if(n[0]==":"){let l=yn(n,t);if(typeof l=="function"){e.push(l);return}n=l}let s=n.match(/^(\*|[-\w]+)\s*()\s*(\*|[-\w]+)$/);if(s==null||s.length<4)return t.push(ji(n)),e;let i=s[1],r=s[2],o=s[3];e.push(Bs(i,o));let a=i==Ge&&o==Ge;r[0]=="<"&&!a&&e.push(Bs(o,i))}function yn(n,e){switch(n){case":enter":return"void => *";case":leave":return"* => void";case":increment":return(t,s)=>parseFloat(s)>parseFloat(t);case":decrement":return(t,s)=>parseFloat(s) *"}}var Ke=new Set(["true","1"]),je=new Set(["false","0"]);function Bs(n,e){let t=Ke.has(n)||je.has(n),s=Ke.has(e)||je.has(e);return(i,r)=>{let o=n==Ge||n==i,a=e==Ge||e==r;return!o&&t&&typeof i=="boolean"&&(o=i?Ke.has(n):je.has(n)),!a&&s&&typeof r=="boolean"&&(a=r?Ke.has(e):je.has(e)),o&&a}}var ti=":self",_n=new RegExp(`s*${ti}s*,?`,"g");function si(n,e,t,s){return new Et(n).build(e,t,s)}var Ks="",Et=class{constructor(e){this._driver=e}build(e,t,s){let i=new vt(t);return this._resetContextStyleTimingState(i),k(this,Ae(e),i)}_resetContextStyleTimingState(e){e.currentQuerySelector=Ks,e.collectedStyles=new Map,e.collectedStyles.set(Ks,new Map),e.currentTime=0}visitTrigger(e,t){let s=t.queryCount=0,i=t.depCount=0,r=[],o=[];return e.name.charAt(0)=="@"&&t.errors.push(Ci()),e.definitions.forEach(a=>{if(this._resetContextStyleTimingState(t),a.type==_.State){let l=a,c=l.name;c.toString().split(/\s*,\s*/).forEach(h=>{l.name=h,r.push(this.visitState(l,t))}),l.name=c}else if(a.type==_.Transition){let l=this.visitTransition(a,t);s+=l.queryCount,i+=l.depCount,o.push(l)}else t.errors.push(Fi())}),{type:_.Trigger,name:e.name,states:r,transitions:o,queryCount:s,depCount:i,options:null}}visitState(e,t){let s=this.visitStyle(e.styles,t),i=e.options&&e.options.params||null;if(s.containsDynamicStyles){let r=new Set,o=i||{};s.styles.forEach(a=>{a instanceof Map&&a.forEach(l=>{ei(l).forEach(c=>{o.hasOwnProperty(c)||r.add(c)})})}),r.size&&t.errors.push(Ri(e.name,[...r.values()]))}return{type:_.State,name:e.name,style:s,options:i?{params:i}:null}}visitTransition(e,t){t.queryCount=0,t.depCount=0;let s=k(this,Ae(e.animation),t),i=pn(e.expr,t.errors);return{type:_.Transition,matchers:i,animation:s,queryCount:t.queryCount,depCount:t.depCount,options:ue(e.options)}}visitSequence(e,t){return{type:_.Sequence,steps:e.steps.map(s=>k(this,s,t)),options:ue(e.options)}}visitGroup(e,t){let s=t.currentTime,i=0,r=e.steps.map(o=>{t.currentTime=s;let a=k(this,o,t);return i=Math.max(i,t.currentTime),a});return t.currentTime=i,{type:_.Group,steps:r,options:ue(e.options)}}visitAnimate(e,t){let s=Tn(e.timings,t.errors);t.currentAnimateTimings=s;let i,r=e.styles?e.styles:ct({});if(r.type==_.Keyframes)i=this.visitKeyframes(r,t);else{let o=e.styles,a=!1;if(!o){a=!0;let c={};s.easing&&(c.easing=s.easing),o=ct(c)}t.currentTime+=s.duration+s.delay;let l=this.visitStyle(o,t);l.isEmptyStep=a,i=l}return t.currentAnimateTimings=null,{type:_.Animate,timings:s,style:i,options:null}}visitStyle(e,t){let s=this._makeStyleAst(e,t);return this._validateStyleAst(s,t),s}_makeStyleAst(e,t){let s=[],i=Array.isArray(e.styles)?e.styles:[e.styles];for(let a of i)typeof a=="string"?a===Q?s.push(a):t.errors.push(ki(a)):s.push(new Map(Object.entries(a)));let r=!1,o=null;return s.forEach(a=>{if(a instanceof Map&&(a.has("easing")&&(o=a.get("easing"),a.delete("easing")),!r)){for(let l of a.values())if(l.toString().indexOf(Xs)>=0){r=!0;break}}}),{type:_.Style,styles:s,easing:o,offset:e.offset,containsDynamicStyles:r,options:null}}_validateStyleAst(e,t){let s=t.currentAnimateTimings,i=t.currentTime,r=t.currentTime;s&&r>0&&(r-=s.duration+s.delay),e.styles.forEach(o=>{typeof o!="string"&&o.forEach((a,l)=>{let c=t.collectedStyles.get(t.currentQuerySelector),h=c.get(l),u=!0;h&&(r!=i&&r>=h.startTime&&i<=h.endTime&&(t.errors.push(Oi(l,h.startTime,h.endTime,r,i)),u=!1),r=h.startTime),u&&c.set(l,{startTime:r,endTime:i}),t.options&&un(a,t.options,t.errors)})})}visitKeyframes(e,t){let s={type:_.Keyframes,styles:[],options:null};if(!t.currentAnimateTimings)return t.errors.push(Ii()),s;let i=1,r=0,o=[],a=!1,l=!1,c=0,h=e.steps.map(w=>{let A=this._makeStyleAst(w,t),N=A.offset!=null?A.offset:vn(A.styles),P=0;return N!=null&&(r++,P=A.offset=N),l=l||P<0||P>1,a=a||P0&&r{let N=S>0?A==y?1:S*A:o[A],P=N*T;t.currentTime=f+g.delay+P,g.duration=P,this._validateStyleAst(w,t),w.offset=N,s.styles.push(w)}),s}visitReference(e,t){return{type:_.Reference,animation:k(this,Ae(e.animation),t),options:ue(e.options)}}visitAnimateChild(e,t){return t.depCount++,{type:_.AnimateChild,options:ue(e.options)}}visitAnimateRef(e,t){return{type:_.AnimateRef,animation:this.visitReference(e.animation,t),options:ue(e.options)}}visitQuery(e,t){let s=t.currentQuerySelector,i=e.options||{};t.queryCount++,t.currentQuery=e;let[r,o]=Sn(e.selector);t.currentQuerySelector=s.length?s+" "+r:r,O(t.collectedStyles,t.currentQuerySelector,new Map);let a=k(this,Ae(e.animation),t);return t.currentQuery=null,t.currentQuerySelector=s,{type:_.Query,selector:r,limit:i.limit||0,optional:!!i.optional,includeSelf:o,animation:a,originalSelector:e.selector,options:ue(e.options)}}visitStagger(e,t){t.currentQuery||t.errors.push(Bi());let s=e.timings==="full"?{duration:0,delay:0,easing:"full"}:Ve(e.timings,t.errors,!0);return{type:_.Stagger,animation:k(this,Ae(e.animation),t),timings:s,options:null}}};function Sn(n){let e=!!n.split(/\s*,\s*/).find(t=>t==ti);return e&&(n=n.replace(_n,"")),n=n.replace(/@\*/g,Qe).replace(/@\w+/g,t=>Qe+"-"+t.slice(1)).replace(/:animating/g,yt),[n,e]}function En(n){return n?Re({},n):null}var vt=class{constructor(e){this.errors=e,this.queryCount=0,this.depCount=0,this.currentTransition=null,this.currentQuery=null,this.currentQuerySelector=null,this.currentAnimateTimings=null,this.currentTime=0,this.collectedStyles=new Map,this.options=null,this.unsupportedCSSPropertiesFound=new Set}};function vn(n){if(typeof n=="string")return null;let e=null;if(Array.isArray(n))n.forEach(t=>{if(t instanceof Map&&t.has("offset")){let s=t;e=parseFloat(s.get("offset")),s.delete("offset")}});else if(n instanceof Map&&n.has("offset")){let t=n;e=parseFloat(t.get("offset")),t.delete("offset")}return e}function Tn(n,e){if(n.hasOwnProperty("duration"))return n;if(typeof n=="number"){let r=Ve(n,e).duration;return ht(r,0,"")}let t=n;if(t.split(/\s+/).some(r=>r.charAt(0)=="{"&&r.charAt(1)=="{")){let r=ht(0,0,"");return r.dynamic=!0,r.strValue=t,r}let i=Ve(t,e);return ht(i.duration,i.delay,i.easing)}function ue(n){return n?(n=Re({},n),n.params&&(n.params=En(n.params))):n={},n}function ht(n,e,t){return{duration:n,delay:e,easing:t}}function zt(n,e,t,s,i,r,o=null,a=!1){return{type:1,element:n,keyframes:e,preStyleProps:t,postStyleProps:s,duration:i,delay:r,totalTime:i+r,easing:o,subTimeline:a}}var De=class{constructor(){this._map=new Map}get(e){return this._map.get(e)||[]}append(e,t){let s=this._map.get(e);s||this._map.set(e,s=[]),s.push(...t)}has(e){return this._map.has(e)}clear(){this._map.clear()}},bn=1,wn=":enter",An=new RegExp(wn,"g"),Mn=":leave",Pn=new RegExp(Mn,"g");function ii(n,e,t,s,i,r=new Map,o=new Map,a,l,c=[]){return new Tt().buildKeyframes(n,e,t,s,i,r,o,a,l,c)}var Tt=class{buildKeyframes(e,t,s,i,r,o,a,l,c,h=[]){c=c||new De;let u=new bt(e,t,c,i,r,h,[]);u.options=l;let S=l.delay?G(l.delay):0;u.currentTimeline.delayNextStep(S),u.currentTimeline.setStyles([o],null,u.errors,l),k(this,s,u);let y=u.timelines.filter(f=>f.containsAnimation());if(y.length&&a.size){let f;for(let g=y.length-1;g>=0;g--){let T=y[g];if(T.element===t){f=T;break}}f&&!f.allowOnlyTimelineStyles()&&f.setStyles([a],null,u.errors,l)}return y.length?y.map(f=>f.buildKeyframes()):[zt(t,[],[],[],0,S,"",!1)]}visitTrigger(e,t){}visitState(e,t){}visitTransition(e,t){}visitAnimateChild(e,t){let s=t.subInstructions.get(t.element);if(s){let i=t.createSubContext(e.options),r=t.currentTimeline.currentTime,o=this._visitSubInstructions(s,i,i.options);r!=o&&t.transformIntoNewTimeline(o)}t.previousNode=e}visitAnimateRef(e,t){let s=t.createSubContext(e.options);s.transformIntoNewTimeline(),this._applyAnimationRefDelays([e.options,e.animation.options],t,s),this.visitReference(e.animation,s),t.transformIntoNewTimeline(s.currentTimeline.currentTime),t.previousNode=e}_applyAnimationRefDelays(e,t,s){for(let i of e){let r=i?.delay;if(r){let o=typeof r=="number"?r:G(Pe(r,i?.params??{},t.errors));s.delayNextStep(o)}}}_visitSubInstructions(e,t,s){let r=t.currentTimeline.currentTime,o=s.duration!=null?G(s.duration):null,a=s.delay!=null?G(s.delay):null;return o!==0&&e.forEach(l=>{let c=t.appendInstructionToTimeline(l,o,a);r=Math.max(r,c.duration+c.delay)}),r}visitReference(e,t){t.updateOptions(e.options,!0),k(this,e.animation,t),t.previousNode=e}visitSequence(e,t){let s=t.subContextCount,i=t,r=e.options;if(r&&(r.params||r.delay)&&(i=t.createSubContext(r),i.transformIntoNewTimeline(),r.delay!=null)){i.previousNode.type==_.Style&&(i.currentTimeline.snapshotCurrentStyles(),i.previousNode=xe);let o=G(r.delay);i.delayNextStep(o)}e.steps.length&&(e.steps.forEach(o=>k(this,o,i)),i.currentTimeline.applyStylesToKeyframe(),i.subContextCount>s&&i.transformIntoNewTimeline()),t.previousNode=e}visitGroup(e,t){let s=[],i=t.currentTimeline.currentTime,r=e.options&&e.options.delay?G(e.options.delay):0;e.steps.forEach(o=>{let a=t.createSubContext(e.options);r&&a.delayNextStep(r),k(this,o,a),i=Math.max(i,a.currentTimeline.currentTime),s.push(a.currentTimeline)}),s.forEach(o=>t.currentTimeline.mergeTimelineCollectedStyles(o)),t.transformIntoNewTimeline(i),t.previousNode=e}_visitTiming(e,t){if(e.dynamic){let s=e.strValue,i=t.params?Pe(s,t.params,t.errors):s;return Ve(i,t.errors)}else return{duration:e.duration,delay:e.delay,easing:e.easing}}visitAnimate(e,t){let s=t.currentAnimateTimings=this._visitTiming(e.timings,t),i=t.currentTimeline;s.delay&&(t.incrementTime(s.delay),i.snapshotCurrentStyles());let r=e.style;r.type==_.Keyframes?this.visitKeyframes(r,t):(t.incrementTime(s.duration),this.visitStyle(r,t),i.applyStylesToKeyframe()),t.currentAnimateTimings=null,t.previousNode=e}visitStyle(e,t){let s=t.currentTimeline,i=t.currentAnimateTimings;!i&&s.hasCurrentStyleProperties()&&s.forwardFrame();let r=i&&i.easing||e.easing;e.isEmptyStep?s.applyEmptyStep(r):s.setStyles(e.styles,r,t.errors,t.options),t.previousNode=e}visitKeyframes(e,t){let s=t.currentAnimateTimings,i=t.currentTimeline.duration,r=s.duration,a=t.createSubContext().currentTimeline;a.easing=s.easing,e.styles.forEach(l=>{let c=l.offset||0;a.forwardTime(c*r),a.setStyles(l.styles,l.easing,t.errors,t.options),a.applyStylesToKeyframe()}),t.currentTimeline.mergeTimelineCollectedStyles(a),t.transformIntoNewTimeline(i+r),t.previousNode=e}visitQuery(e,t){let s=t.currentTimeline.currentTime,i=e.options||{},r=i.delay?G(i.delay):0;r&&(t.previousNode.type===_.Style||s==0&&t.currentTimeline.hasCurrentStyleProperties())&&(t.currentTimeline.snapshotCurrentStyles(),t.previousNode=xe);let o=s,a=t.invokeQuery(e.selector,e.originalSelector,e.limit,e.includeSelf,!!i.optional,t.errors);t.currentQueryTotal=a.length;let l=null;a.forEach((c,h)=>{t.currentQueryIndex=h;let u=t.createSubContext(e.options,c);r&&u.delayNextStep(r),c===t.element&&(l=u.currentTimeline),k(this,e.animation,u),u.currentTimeline.applyStylesToKeyframe();let S=u.currentTimeline.currentTime;o=Math.max(o,S)}),t.currentQueryIndex=0,t.currentQueryTotal=0,t.transformIntoNewTimeline(o),l&&(t.currentTimeline.mergeTimelineCollectedStyles(l),t.currentTimeline.snapshotCurrentStyles()),t.previousNode=e}visitStagger(e,t){let s=t.parentContext,i=t.currentTimeline,r=e.timings,o=Math.abs(r.duration),a=o*(t.currentQueryTotal-1),l=o*t.currentQueryIndex;switch(r.duration<0?"reverse":r.easing){case"reverse":l=a-l;break;case"full":l=s.currentStaggerTime;break}let h=t.currentTimeline;l&&h.delayNextStep(l);let u=h.currentTime;k(this,e.animation,t),t.previousNode=e,s.currentStaggerTime=i.currentTime-u+(i.startTime-s.currentTimeline.startTime)}},xe={},bt=class n{constructor(e,t,s,i,r,o,a,l){this._driver=e,this.element=t,this.subInstructions=s,this._enterClassName=i,this._leaveClassName=r,this.errors=o,this.timelines=a,this.parentContext=null,this.currentAnimateTimings=null,this.previousNode=xe,this.subContextCount=0,this.options={},this.currentQueryIndex=0,this.currentQueryTotal=0,this.currentStaggerTime=0,this.currentTimeline=l||new We(this._driver,t,0),a.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(e,t){if(!e)return;let s=e,i=this.options;s.duration!=null&&(i.duration=G(s.duration)),s.delay!=null&&(i.delay=G(s.delay));let r=s.params;if(r){let o=i.params;o||(o=this.options.params={}),Object.keys(r).forEach(a=>{(!t||!o.hasOwnProperty(a))&&(o[a]=Pe(r[a],o,this.errors))})}}_copyOptions(){let e={};if(this.options){let t=this.options.params;if(t){let s=e.params={};Object.keys(t).forEach(i=>{s[i]=t[i]})}}return e}createSubContext(e=null,t,s){let i=t||this.element,r=new n(this._driver,i,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(i,s||0));return r.previousNode=this.previousNode,r.currentAnimateTimings=this.currentAnimateTimings,r.options=this._copyOptions(),r.updateOptions(e),r.currentQueryIndex=this.currentQueryIndex,r.currentQueryTotal=this.currentQueryTotal,r.parentContext=this,this.subContextCount++,r}transformIntoNewTimeline(e){return this.previousNode=xe,this.currentTimeline=this.currentTimeline.fork(this.element,e),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(e,t,s){let i={duration:t??e.duration,delay:this.currentTimeline.currentTime+(s??0)+e.delay,easing:""},r=new wt(this._driver,e.element,e.keyframes,e.preStyleProps,e.postStyleProps,i,e.stretchStartingKeyframe);return this.timelines.push(r),i}incrementTime(e){this.currentTimeline.forwardTime(this.currentTimeline.duration+e)}delayNextStep(e){e>0&&this.currentTimeline.delayNextStep(e)}invokeQuery(e,t,s,i,r,o){let a=[];if(i&&a.push(this.element),e.length>0){e=e.replace(An,"."+this._enterClassName),e=e.replace(Pn,"."+this._leaveClassName);let l=s!=1,c=this._driver.query(this.element,e,l);s!==0&&(c=s<0?c.slice(c.length+s,c.length):c.slice(0,s)),a.push(...c)}return!r&&a.length==0&&o.push(Ki(t)),a}},We=class n{constructor(e,t,s,i){this._driver=e,this.element=t,this.startTime=s,this._elementTimelineStylesLookup=i,this.duration=0,this.easing=null,this._previousKeyframe=new Map,this._currentKeyframe=new Map,this._keyframes=new Map,this._styleSummary=new Map,this._localTimelineStyles=new Map,this._pendingStyles=new Map,this._backFill=new Map,this._currentEmptyStepKeyframe=null,this._elementTimelineStylesLookup||(this._elementTimelineStylesLookup=new Map),this._globalTimelineStyles=this._elementTimelineStylesLookup.get(t),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(t,this._localTimelineStyles)),this._loadKeyframe()}containsAnimation(){switch(this._keyframes.size){case 0:return!1;case 1:return this.hasCurrentStyleProperties();default:return!0}}hasCurrentStyleProperties(){return this._currentKeyframe.size>0}get currentTime(){return this.startTime+this.duration}delayNextStep(e){let t=this._keyframes.size===1&&this._pendingStyles.size;this.duration||t?(this.forwardTime(this.currentTime+e),t&&this.snapshotCurrentStyles()):this.startTime+=e}fork(e,t){return this.applyStylesToKeyframe(),new n(this._driver,e,t||this.currentTime,this._elementTimelineStylesLookup)}_loadKeyframe(){this._currentKeyframe&&(this._previousKeyframe=this._currentKeyframe),this._currentKeyframe=this._keyframes.get(this.duration),this._currentKeyframe||(this._currentKeyframe=new Map,this._keyframes.set(this.duration,this._currentKeyframe))}forwardFrame(){this.duration+=bn,this._loadKeyframe()}forwardTime(e){this.applyStylesToKeyframe(),this.duration=e,this._loadKeyframe()}_updateStyle(e,t){this._localTimelineStyles.set(e,t),this._globalTimelineStyles.set(e,t),this._styleSummary.set(e,{time:this.currentTime,value:t})}allowOnlyTimelineStyles(){return this._currentEmptyStepKeyframe!==this._currentKeyframe}applyEmptyStep(e){e&&this._previousKeyframe.set("easing",e);for(let[t,s]of this._globalTimelineStyles)this._backFill.set(t,s||Q),this._currentKeyframe.set(t,Q);this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(e,t,s,i){t&&this._previousKeyframe.set("easing",t);let r=i&&i.params||{},o=Dn(e,this._globalTimelineStyles);for(let[a,l]of o){let c=Pe(l,r,s);this._pendingStyles.set(a,c),this._localTimelineStyles.has(a)||this._backFill.set(a,this._globalTimelineStyles.get(a)??Q),this._updateStyle(a,c)}}applyStylesToKeyframe(){this._pendingStyles.size!=0&&(this._pendingStyles.forEach((e,t)=>{this._currentKeyframe.set(t,e)}),this._pendingStyles.clear(),this._localTimelineStyles.forEach((e,t)=>{this._currentKeyframe.has(t)||this._currentKeyframe.set(t,e)}))}snapshotCurrentStyles(){for(let[e,t]of this._localTimelineStyles)this._pendingStyles.set(e,t),this._updateStyle(e,t)}getFinalKeyframe(){return this._keyframes.get(this.duration)}get properties(){let e=[];for(let t in this._currentKeyframe)e.push(t);return e}mergeTimelineCollectedStyles(e){e._styleSummary.forEach((t,s)=>{let i=this._styleSummary.get(s);(!i||t.time>i.time)&&this._updateStyle(s,t.value)})}buildKeyframes(){this.applyStylesToKeyframe();let e=new Set,t=new Set,s=this._keyframes.size===1&&this.duration===0,i=[];this._keyframes.forEach((a,l)=>{let c=new Map([...this._backFill,...a]);c.forEach((h,u)=>{h===ze?e.add(u):h===Q&&t.add(u)}),s||c.set("offset",l/this.duration),i.push(c)});let r=[...e.values()],o=[...t.values()];if(s){let a=i[0],l=new Map(a);a.set("offset",0),l.set("offset",1),i=[a,l]}return zt(this.element,i,r,o,this.duration,this.startTime,this.easing,!1)}},wt=class extends We{constructor(e,t,s,i,r,o,a=!1){super(e,t,o.delay),this.keyframes=s,this.preStyleProps=i,this.postStyleProps=r,this._stretchStartingKeyframe=a,this.timings={duration:o.duration,delay:o.delay,easing:o.easing}}containsAnimation(){return this.keyframes.length>1}buildKeyframes(){let e=this.keyframes,{delay:t,duration:s,easing:i}=this.timings;if(this._stretchStartingKeyframe&&t){let r=[],o=s+t,a=t/o,l=new Map(e[0]);l.set("offset",0),r.push(l);let c=new Map(e[0]);c.set("offset",js(a)),r.push(c);let h=e.length-1;for(let u=1;u<=h;u++){let S=new Map(e[u]),y=S.get("offset"),f=t+y*s;S.set("offset",js(f/o)),r.push(S)}s=o,t=0,i="",e=r}return zt(this.element,e,this.preStyleProps,this.postStyleProps,s,t,i,!0)}};function js(n,e=3){let t=Math.pow(10,e-1);return Math.round(n*t)/t}function Dn(n,e){let t=new Map,s;return n.forEach(i=>{if(i==="*"){s??=e.keys();for(let r of s)t.set(r,Q)}else for(let[r,o]of i)t.set(r,o)}),t}function qs(n,e,t,s,i,r,o,a,l,c,h,u,S){return{type:0,element:n,triggerName:e,isRemovalTransition:i,fromState:t,fromStyles:r,toState:s,toStyles:o,timelines:a,queriedElements:l,preStyleProps:c,postStyleProps:h,totalTime:u,errors:S}}var dt={},Je=class{constructor(e,t,s){this._triggerName=e,this.ast=t,this._stateStyles=s}match(e,t,s,i){return Nn(this.ast.matchers,e,t,s,i)}buildStyles(e,t,s){let i=this._stateStyles.get("*");return e!==void 0&&(i=this._stateStyles.get(e?.toString())||i),i?i.buildStyles(t,s):new Map}build(e,t,s,i,r,o,a,l,c,h){let u=[],S=this.ast.options&&this.ast.options.params||dt,y=a&&a.params||dt,f=this.buildStyles(s,y,u),g=l&&l.params||dt,T=this.buildStyles(i,g,u),w=new Set,A=new Map,N=new Map,P=i==="void",me={params:ni(g,S),delay:this.ast.options?.delay},B=h?[]:ii(e,t,this.ast.animation,r,o,f,T,me,c,u),C=0;return B.forEach(F=>{C=Math.max(F.duration+F.delay,C)}),u.length?qs(t,this._triggerName,s,i,P,f,T,[],[],A,N,C,u):(B.forEach(F=>{let se=F.element,pe=O(A,se,new Set);F.preStyleProps.forEach(ie=>pe.add(ie));let Kt=O(N,se,new Set);F.postStyleProps.forEach(ie=>Kt.add(ie)),se!==t&&w.add(se)}),qs(t,this._triggerName,s,i,P,f,T,B,[...w.values()],A,N,C))}};function Nn(n,e,t,s,i){return n.some(r=>r(e,t,s,i))}function ni(n,e){let t=Re({},e);return Object.entries(n).forEach(([s,i])=>{i!=null&&(t[s]=i)}),t}var At=class{constructor(e,t,s){this.styles=e,this.defaultParams=t,this.normalizer=s}buildStyles(e,t){let s=new Map,i=ni(e,this.defaultParams);return this.styles.styles.forEach(r=>{typeof r!="string"&&r.forEach((o,a)=>{o&&(o=Pe(o,i,t));let l=this.normalizer.normalizePropertyName(a,t);o=this.normalizer.normalizeStyleValue(a,l,o,t),s.set(a,o)})}),s}};function Cn(n,e,t){return new Mt(n,e,t)}var Mt=class{constructor(e,t,s){this.name=e,this.ast=t,this._normalizer=s,this.transitionFactories=[],this.states=new Map,t.states.forEach(i=>{let r=i.options&&i.options.params||{};this.states.set(i.name,new At(i.style,r,s))}),Us(this.states,"true","1"),Us(this.states,"false","0"),t.transitions.forEach(i=>{this.transitionFactories.push(new Je(e,i,this.states))}),this.fallbackTransition=Fn(e,this.states,this._normalizer)}get containsQueries(){return this.ast.queryCount>0}matchTransition(e,t,s,i){return this.transitionFactories.find(o=>o.match(e,t,s,i))||null}matchStyles(e,t,s){return this.fallbackTransition.buildStyles(e,t,s)}};function Fn(n,e,t){let s=[(o,a)=>!0],i={type:_.Sequence,steps:[],options:null},r={type:_.Transition,animation:i,matchers:s,options:null,queryCount:0,depCount:0};return new Je(n,r,e)}function Us(n,e,t){n.has(e)?n.has(t)||n.set(t,n.get(e)):n.has(t)&&n.set(e,n.get(t))}var Rn=new De,Pt=class{constructor(e,t,s){this.bodyNode=e,this._driver=t,this._normalizer=s,this._animations=new Map,this._playersById=new Map,this.players=[]}register(e,t){let s=[],i=[],r=si(this._driver,t,s,i);if(s.length)throw Vi(s);i.length&&void 0,this._animations.set(e,r)}_buildPlayer(e,t,s){let i=e.element,r=Ws(this._normalizer,e.keyframes,t,s);return this._driver.animate(i,r,e.duration,e.delay,e.easing,[],!0)}create(e,t,s={}){let i=[],r=this._animations.get(e),o,a=new Map;if(r?(o=ii(this._driver,t,r,Zs,gt,new Map,new Map,s,Rn,i),o.forEach(h=>{let u=O(a,h.element,new Map);h.postStyleProps.forEach(S=>u.set(S,null))})):(i.push(Hi()),o=[]),i.length)throw Gi(i);a.forEach((h,u)=>{h.forEach((S,y)=>{h.set(y,this._driver.computeStyle(u,y,Q))})});let l=o.map(h=>{let u=a.get(h.element);return this._buildPlayer(h,new Map,u)}),c=te(l);return this._playersById.set(e,c),c.onDestroy(()=>this.destroy(e)),this.players.push(c),c}destroy(e){let t=this._getPlayer(e);t.destroy(),this._playersById.delete(e);let s=this.players.indexOf(t);s>=0&&this.players.splice(s,1)}_getPlayer(e){let t=this._playersById.get(e);if(!t)throw xi(e);return t}listen(e,t,s,i){let r=kt(t,"","","");return Rt(this._getPlayer(e),s,r,i),()=>{}}command(e,t,s,i){if(s=="register"){this.register(e,i[0]);return}if(s=="create"){let o=i[0]||{};this.create(e,t,o);return}let r=this._getPlayer(e);switch(s){case"play":r.play();break;case"pause":r.pause();break;case"reset":r.reset();break;case"restart":r.restart();break;case"finish":r.finish();break;case"init":r.init();break;case"setPosition":r.setPosition(parseFloat(i[0]));break;case"destroy":this.destroy(e);break}}},Qs="ng-animate-queued",kn=".ng-animate-queued",ft="ng-animate-disabled",On=".ng-animate-disabled",In="ng-star-inserted",Ln=".ng-star-inserted",$n=[],ri={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},zn={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},$="__ng_removed",Ne=class{get params(){return this.options.params}constructor(e,t=""){this.namespaceId=t;let s=e&&e.hasOwnProperty("value"),i=s?e.value:e;if(this.value=Kn(i),s){let r=e,{value:o}=r,a=Qt(r,["value"]);this.options=a}else this.options={};this.options.params||(this.options.params={})}absorbOptions(e){let t=e.params;if(t){let s=this.options.params;Object.keys(t).forEach(i=>{s[i]==null&&(s[i]=t[i])})}}},Me="void",mt=new Ne(Me),Dt=class{constructor(e,t,s){this.id=e,this.hostElement=t,this._engine=s,this.players=[],this._triggers=new Map,this._queue=[],this._elementListeners=new Map,this._hostClassName="ng-tns-"+e,L(t,this._hostClassName)}listen(e,t,s,i){if(!this._triggers.has(t))throw Wi(s,t);if(s==null||s.length==0)throw Ji(t);if(!jn(s))throw Yi(s,t);let r=O(this._elementListeners,e,[]),o={name:t,phase:s,callback:i};r.push(o);let a=O(this._engine.statesByElement,e,new Map);return a.has(t)||(L(e,Be),L(e,Be+"-"+t),a.set(t,mt)),()=>{this._engine.afterFlush(()=>{let l=r.indexOf(o);l>=0&&r.splice(l,1),this._triggers.has(t)||a.delete(t)})}}register(e,t){return this._triggers.has(e)?!1:(this._triggers.set(e,t),!0)}_getTrigger(e){let t=this._triggers.get(e);if(!t)throw Xi(e);return t}trigger(e,t,s,i=!0){let r=this._getTrigger(t),o=new Ce(this.id,t,e),a=this._engine.statesByElement.get(e);a||(L(e,Be),L(e,Be+"-"+t),this._engine.statesByElement.set(e,a=new Map));let l=a.get(t),c=new Ne(s,this.id);if(!(s&&s.hasOwnProperty("value"))&&l&&c.absorbOptions(l.options),a.set(t,c),l||(l=mt),!(c.value===Me)&&l.value===c.value){if(!Qn(l.params,c.params)){let g=[],T=r.matchStyles(l.value,l.params,g),w=r.matchStyles(c.value,c.params,g);g.length?this._engine.reportError(g):this._engine.afterFlush(()=>{he(e,T),V(e,w)})}return}let S=O(this._engine.playersByElement,e,[]);S.forEach(g=>{g.namespaceId==this.id&&g.triggerName==t&&g.queued&&g.destroy()});let y=r.matchTransition(l.value,c.value,e,c.params),f=!1;if(!y){if(!i)return;y=r.fallbackTransition,f=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:t,transition:y,fromState:l,toState:c,player:o,isFallbackTransition:f}),f||(L(e,Qs),o.onStart(()=>{Ee(e,Qs)})),o.onDone(()=>{let g=this.players.indexOf(o);g>=0&&this.players.splice(g,1);let T=this._engine.playersByElement.get(e);if(T){let w=T.indexOf(o);w>=0&&T.splice(w,1)}}),this.players.push(o),S.push(o),o}deregister(e){this._triggers.delete(e),this._engine.statesByElement.forEach(t=>t.delete(e)),this._elementListeners.forEach((t,s)=>{this._elementListeners.set(s,t.filter(i=>i.name!=e))})}clearElementCache(e){this._engine.statesByElement.delete(e),this._elementListeners.delete(e);let t=this._engine.playersByElement.get(e);t&&(t.forEach(s=>s.destroy()),this._engine.playersByElement.delete(e))}_signalRemovalForInnerTriggers(e,t){let s=this._engine.driver.query(e,Qe,!0);s.forEach(i=>{if(i[$])return;let r=this._engine.fetchNamespacesByElement(i);r.size?r.forEach(o=>o.triggerLeaveAnimation(i,t,!1,!0)):this.clearElementCache(i)}),this._engine.afterFlushAnimationsDone(()=>s.forEach(i=>this.clearElementCache(i)))}triggerLeaveAnimation(e,t,s,i){let r=this._engine.statesByElement.get(e),o=new Map;if(r){let a=[];if(r.forEach((l,c)=>{if(o.set(c,l.value),this._triggers.has(c)){let h=this.trigger(e,c,Me,i);h&&a.push(h)}}),a.length)return this._engine.markElementAsRemoved(this.id,e,!0,t,o),s&&te(a).onDone(()=>this._engine.processLeaveNode(e)),!0}return!1}prepareLeaveAnimationListeners(e){let t=this._elementListeners.get(e),s=this._engine.statesByElement.get(e);if(t&&s){let i=new Set;t.forEach(r=>{let o=r.name;if(i.has(o))return;i.add(o);let l=this._triggers.get(o).fallbackTransition,c=s.get(o)||mt,h=new Ne(Me),u=new Ce(this.id,o,e);this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:o,transition:l,fromState:c,toState:h,player:u,isFallbackTransition:!0})})}}removeNode(e,t){let s=this._engine;if(e.childElementCount&&this._signalRemovalForInnerTriggers(e,t),this.triggerLeaveAnimation(e,t,!0))return;let i=!1;if(s.totalAnimations){let r=s.players.length?s.playersByQueriedElement.get(e):[];if(r&&r.length)i=!0;else{let o=e;for(;o=o.parentNode;)if(s.statesByElement.get(o)){i=!0;break}}}if(this.prepareLeaveAnimationListeners(e),i)s.markElementAsRemoved(this.id,e,!1,t);else{let r=e[$];(!r||r===ri)&&(s.afterFlush(()=>this.clearElementCache(e)),s.destroyInnerAnimations(e),s._onRemovalComplete(e,t))}}insertNode(e,t){L(e,this._hostClassName)}drainQueuedTransitions(e){let t=[];return this._queue.forEach(s=>{let i=s.player;if(i.destroyed)return;let r=s.element,o=this._elementListeners.get(r);o&&o.forEach(a=>{if(a.name==s.triggerName){let l=kt(r,s.triggerName,s.fromState.value,s.toState.value);l._data=e,Rt(s.player,a.phase,l,a.callback)}}),i.markedForDestroy?this._engine.afterFlush(()=>{i.destroy()}):t.push(s)}),this._queue=[],t.sort((s,i)=>{let r=s.transition.ast.depCount,o=i.transition.ast.depCount;return r==0||o==0?r-o:this._engine.driver.containsElement(s.element,i.element)?1:-1})}destroy(e){this.players.forEach(t=>t.destroy()),this._signalRemovalForInnerTriggers(this.hostElement,e)}},Nt=class{_onRemovalComplete(e,t){this.onRemovalComplete(e,t)}constructor(e,t,s){this.bodyNode=e,this.driver=t,this._normalizer=s,this.players=[],this.newHostElements=new Map,this.playersByElement=new Map,this.playersByQueriedElement=new Map,this.statesByElement=new Map,this.disabledNodes=new Set,this.totalAnimations=0,this.totalQueuedPlayers=0,this._namespaceLookup={},this._namespaceList=[],this._flushFns=[],this._whenQuietFns=[],this.namespacesByHostElement=new Map,this.collectedEnterElements=[],this.collectedLeaveElements=[],this.onRemovalComplete=(i,r)=>{}}get queuedPlayers(){let e=[];return this._namespaceList.forEach(t=>{t.players.forEach(s=>{s.queued&&e.push(s)})}),e}createNamespace(e,t){let s=new Dt(e,t,this);return this.bodyNode&&this.driver.containsElement(this.bodyNode,t)?this._balanceNamespaceList(s,t):(this.newHostElements.set(t,s),this.collectEnterElement(t)),this._namespaceLookup[e]=s}_balanceNamespaceList(e,t){let s=this._namespaceList,i=this.namespacesByHostElement;if(s.length-1>=0){let o=!1,a=this.driver.getParentElement(t);for(;a;){let l=i.get(a);if(l){let c=s.indexOf(l);s.splice(c+1,0,e),o=!0;break}a=this.driver.getParentElement(a)}o||s.unshift(e)}else s.push(e);return i.set(t,e),e}register(e,t){let s=this._namespaceLookup[e];return s||(s=this.createNamespace(e,t)),s}registerTrigger(e,t,s){let i=this._namespaceLookup[e];i&&i.register(t,s)&&this.totalAnimations++}destroy(e,t){e&&(this.afterFlush(()=>{}),this.afterFlushAnimationsDone(()=>{let s=this._fetchNamespace(e);this.namespacesByHostElement.delete(s.hostElement);let i=this._namespaceList.indexOf(s);i>=0&&this._namespaceList.splice(i,1),s.destroy(t),delete this._namespaceLookup[e]}))}_fetchNamespace(e){return this._namespaceLookup[e]}fetchNamespacesByElement(e){let t=new Set,s=this.statesByElement.get(e);if(s){for(let i of s.values())if(i.namespaceId){let r=this._fetchNamespace(i.namespaceId);r&&t.add(r)}}return t}trigger(e,t,s,i){if(qe(t)){let r=this._fetchNamespace(e);if(r)return r.trigger(t,s,i),!0}return!1}insertNode(e,t,s,i){if(!qe(t))return;let r=t[$];if(r&&r.setForRemoval){r.setForRemoval=!1,r.setForMove=!0;let o=this.collectedLeaveElements.indexOf(t);o>=0&&this.collectedLeaveElements.splice(o,1)}if(e){let o=this._fetchNamespace(e);o&&o.insertNode(t,s)}i&&this.collectEnterElement(t)}collectEnterElement(e){this.collectedEnterElements.push(e)}markElementAsDisabled(e,t){t?this.disabledNodes.has(e)||(this.disabledNodes.add(e),L(e,ft)):this.disabledNodes.has(e)&&(this.disabledNodes.delete(e),Ee(e,ft))}removeNode(e,t,s){if(qe(t)){let i=e?this._fetchNamespace(e):null;i?i.removeNode(t,s):this.markElementAsRemoved(e,t,!1,s);let r=this.namespacesByHostElement.get(t);r&&r.id!==e&&r.removeNode(t,s)}else this._onRemovalComplete(t,s)}markElementAsRemoved(e,t,s,i,r){this.collectedLeaveElements.push(t),t[$]={namespaceId:e,setForRemoval:i,hasAnimation:s,removedBeforeQueried:!1,previousTriggersValues:r}}listen(e,t,s,i,r){return qe(t)?this._fetchNamespace(e).listen(t,s,i,r):()=>{}}_buildInstruction(e,t,s,i,r){return e.transition.build(this.driver,e.element,e.fromState.value,e.toState.value,s,i,e.fromState.options,e.toState.options,t,r)}destroyInnerAnimations(e){let t=this.driver.query(e,Qe,!0);t.forEach(s=>this.destroyActiveAnimationsForElement(s)),this.playersByQueriedElement.size!=0&&(t=this.driver.query(e,yt,!0),t.forEach(s=>this.finishActiveQueriedAnimationOnElement(s)))}destroyActiveAnimationsForElement(e){let t=this.playersByElement.get(e);t&&t.forEach(s=>{s.queued?s.markedForDestroy=!0:s.destroy()})}finishActiveQueriedAnimationOnElement(e){let t=this.playersByQueriedElement.get(e);t&&t.forEach(s=>s.finish())}whenRenderingDone(){return new Promise(e=>{if(this.players.length)return te(this.players).onDone(()=>e());e()})}processLeaveNode(e){let t=e[$];if(t&&t.setForRemoval){if(e[$]=ri,t.namespaceId){this.destroyInnerAnimations(e);let s=this._fetchNamespace(t.namespaceId);s&&s.clearElementCache(e)}this._onRemovalComplete(e,t.setForRemoval)}e.classList?.contains(ft)&&this.markElementAsDisabled(e,!1),this.driver.query(e,On,!0).forEach(s=>{this.markElementAsDisabled(s,!1)})}flush(e=-1){let t=[];if(this.newHostElements.size&&(this.newHostElements.forEach((s,i)=>this._balanceNamespaceList(s,i)),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(let s=0;ss()),this._flushFns=[],this._whenQuietFns.length){let s=this._whenQuietFns;this._whenQuietFns=[],t.length?te(t).onDone(()=>{s.forEach(i=>i())}):s.forEach(i=>i())}}reportError(e){throw Zi(e)}_flushAnimations(e,t){let s=new De,i=[],r=new Map,o=[],a=new Map,l=new Map,c=new Map,h=new Set;this.disabledNodes.forEach(d=>{h.add(d);let m=this.driver.query(d,kn,!0);for(let p=0;p{let p=Zs+g++;f.set(m,p),d.forEach(E=>L(E,p))});let T=[],w=new Set,A=new Set;for(let d=0;dw.add(E)):A.add(m))}let N=new Map,P=Gs(S,Array.from(w));P.forEach((d,m)=>{let p=gt+g++;N.set(m,p),d.forEach(E=>L(E,p))}),e.push(()=>{y.forEach((d,m)=>{let p=f.get(m);d.forEach(E=>Ee(E,p))}),P.forEach((d,m)=>{let p=N.get(m);d.forEach(E=>Ee(E,p))}),T.forEach(d=>{this.processLeaveNode(d)})});let me=[],B=[];for(let d=this._namespaceList.length-1;d>=0;d--)this._namespaceList[d].drainQueuedTransitions(t).forEach(p=>{let E=p.player,M=p.element;if(me.push(E),this.collectedEnterElements.length){let D=M[$];if(D&&D.setForMove){if(D.previousTriggersValues&&D.previousTriggersValues.has(p.triggerName)){let ne=D.previousTriggersValues.get(p.triggerName),I=this.statesByElement.get(p.element);if(I&&I.has(p.triggerName)){let Fe=I.get(p.triggerName);Fe.value=ne,I.set(p.triggerName,Fe)}}E.destroy();return}}let K=!u||!this.driver.containsElement(u,M),R=N.get(M),x=f.get(M),b=this._buildInstruction(p,s,x,R,K);if(b.errors&&b.errors.length){B.push(b);return}if(K){E.onStart(()=>he(M,b.fromStyles)),E.onDestroy(()=>V(M,b.toStyles)),i.push(E);return}if(p.isFallbackTransition){E.onStart(()=>he(M,b.fromStyles)),E.onDestroy(()=>V(M,b.toStyles)),i.push(E);return}let Ut=[];b.timelines.forEach(D=>{D.stretchStartingKeyframe=!0,this.disabledNodes.has(D.element)||Ut.push(D)}),b.timelines=Ut,s.append(M,b.timelines);let Si={instruction:b,player:E,element:M};o.push(Si),b.queriedElements.forEach(D=>O(a,D,[]).push(E)),b.preStyleProps.forEach((D,ne)=>{if(D.size){let I=l.get(ne);I||l.set(ne,I=new Set),D.forEach((Fe,nt)=>I.add(nt))}}),b.postStyleProps.forEach((D,ne)=>{let I=c.get(ne);I||c.set(ne,I=new Set),D.forEach((Fe,nt)=>I.add(nt))})});if(B.length){let d=[];B.forEach(m=>{d.push(en(m.triggerName,m.errors))}),me.forEach(m=>m.destroy()),this.reportError(d)}let C=new Map,F=new Map;o.forEach(d=>{let m=d.element;s.has(m)&&(F.set(m,m),this._beforeAnimationBuild(d.player.namespaceId,d.instruction,C))}),i.forEach(d=>{let m=d.element;this._getPreviousPlayers(m,!1,d.namespaceId,d.triggerName,null).forEach(E=>{O(C,m,[]).push(E),E.destroy()})});let se=T.filter(d=>xs(d,l,c)),pe=new Map;Hs(pe,this.driver,A,c,Q).forEach(d=>{xs(d,l,c)&&se.push(d)});let ie=new Map;y.forEach((d,m)=>{Hs(ie,this.driver,new Set(d),l,ze)}),se.forEach(d=>{let m=pe.get(d),p=ie.get(d);pe.set(d,new Map([...m?.entries()??[],...p?.entries()??[]]))});let it=[],jt=[],qt={};o.forEach(d=>{let{element:m,player:p,instruction:E}=d;if(s.has(m)){if(h.has(m)){p.onDestroy(()=>V(m,E.toStyles)),p.disabled=!0,p.overrideTotalTime(E.totalTime),i.push(p);return}let M=qt;if(F.size>1){let R=m,x=[];for(;R=R.parentNode;){let b=F.get(R);if(b){M=b;break}x.push(R)}x.forEach(b=>F.set(b,M))}let K=this._buildAnimation(p.namespaceId,E,C,r,ie,pe);if(p.setRealPlayer(K),M===qt)it.push(p);else{let R=this.playersByElement.get(M);R&&R.length&&(p.parentPlayer=te(R)),i.push(p)}}else he(m,E.fromStyles),p.onDestroy(()=>V(m,E.toStyles)),jt.push(p),h.has(m)&&i.push(p)}),jt.forEach(d=>{let m=r.get(d.element);if(m&&m.length){let p=te(m);d.setRealPlayer(p)}}),i.forEach(d=>{d.parentPlayer?d.syncPlayerEvents(d.parentPlayer):d.destroy()});for(let d=0;d!K.destroyed);M.length?qn(this,m,M):this.processLeaveNode(m)}return T.length=0,it.forEach(d=>{this.players.push(d),d.onDone(()=>{d.destroy();let m=this.players.indexOf(d);this.players.splice(m,1)}),d.play()}),it}afterFlush(e){this._flushFns.push(e)}afterFlushAnimationsDone(e){this._whenQuietFns.push(e)}_getPreviousPlayers(e,t,s,i,r){let o=[];if(t){let a=this.playersByQueriedElement.get(e);a&&(o=a)}else{let a=this.playersByElement.get(e);if(a){let l=!r||r==Me;a.forEach(c=>{c.queued||!l&&c.triggerName!=i||o.push(c)})}}return(s||i)&&(o=o.filter(a=>!(s&&s!=a.namespaceId||i&&i!=a.triggerName))),o}_beforeAnimationBuild(e,t,s){let i=t.triggerName,r=t.element,o=t.isRemovalTransition?void 0:e,a=t.isRemovalTransition?void 0:i;for(let l of t.timelines){let c=l.element,h=c!==r,u=O(s,c,[]);this._getPreviousPlayers(c,h,o,a,t.toState).forEach(y=>{let f=y.getRealPlayer();f.beforeDestroy&&f.beforeDestroy(),y.destroy(),u.push(y)})}he(r,t.fromStyles)}_buildAnimation(e,t,s,i,r,o){let a=t.triggerName,l=t.element,c=[],h=new Set,u=new Set,S=t.timelines.map(f=>{let g=f.element;h.add(g);let T=g[$];if(T&&T.removedBeforeQueried)return new ee(f.duration,f.delay);let w=g!==l,A=Un((s.get(g)||$n).map(C=>C.getRealPlayer())).filter(C=>{let F=C;return F.element?F.element===g:!1}),N=r.get(g),P=o.get(g),me=Ws(this._normalizer,f.keyframes,N,P),B=this._buildPlayer(f,me,A);if(f.subTimeline&&i&&u.add(g),w){let C=new Ce(e,a,g);C.setRealPlayer(B),c.push(C)}return B});c.forEach(f=>{O(this.playersByQueriedElement,f.element,[]).push(f),f.onDone(()=>Bn(this.playersByQueriedElement,f.element,f))}),h.forEach(f=>L(f,zs));let y=te(S);return y.onDestroy(()=>{h.forEach(f=>Ee(f,zs)),V(l,t.toStyles)}),u.forEach(f=>{O(i,f,[]).push(y)}),y}_buildPlayer(e,t,s){return t.length>0?this.driver.animate(e.element,t,e.duration,e.delay,e.easing,s):new ee(e.duration,e.delay)}},Ce=class{constructor(e,t,s){this.namespaceId=e,this.triggerName=t,this.element=s,this._player=new ee,this._containsRealPlayer=!1,this._queuedCallbacks=new Map,this.destroyed=!1,this.parentPlayer=null,this.markedForDestroy=!1,this.disabled=!1,this.queued=!0,this.totalTime=0}setRealPlayer(e){this._containsRealPlayer||(this._player=e,this._queuedCallbacks.forEach((t,s)=>{t.forEach(i=>Rt(e,s,void 0,i))}),this._queuedCallbacks.clear(),this._containsRealPlayer=!0,this.overrideTotalTime(e.totalTime),this.queued=!1)}getRealPlayer(){return this._player}overrideTotalTime(e){this.totalTime=e}syncPlayerEvents(e){let t=this._player;t.triggerCallback&&e.onStart(()=>t.triggerCallback("start")),e.onDone(()=>this.finish()),e.onDestroy(()=>this.destroy())}_queueEvent(e,t){O(this._queuedCallbacks,e,[]).push(t)}onDone(e){this.queued&&this._queueEvent("done",e),this._player.onDone(e)}onStart(e){this.queued&&this._queueEvent("start",e),this._player.onStart(e)}onDestroy(e){this.queued&&this._queueEvent("destroy",e),this._player.onDestroy(e)}init(){this._player.init()}hasStarted(){return this.queued?!1:this._player.hasStarted()}play(){!this.queued&&this._player.play()}pause(){!this.queued&&this._player.pause()}restart(){!this.queued&&this._player.restart()}finish(){this._player.finish()}destroy(){this.destroyed=!0,this._player.destroy()}reset(){!this.queued&&this._player.reset()}setPosition(e){this.queued||this._player.setPosition(e)}getPosition(){return this.queued?0:this._player.getPosition()}triggerCallback(e){let t=this._player;t.triggerCallback&&t.triggerCallback(e)}};function Bn(n,e,t){let s=n.get(e);if(s){if(s.length){let i=s.indexOf(t);s.splice(i,1)}s.length==0&&n.delete(e)}return s}function Kn(n){return n??null}function qe(n){return n&&n.nodeType===1}function jn(n){return n=="start"||n=="done"}function Vs(n,e){let t=n.style.display;return n.style.display=e??"none",t}function Hs(n,e,t,s,i){let r=[];t.forEach(l=>r.push(Vs(l)));let o=[];s.forEach((l,c)=>{let h=new Map;l.forEach(u=>{let S=e.computeStyle(c,u,i);h.set(u,S),(!S||S.length==0)&&(c[$]=zn,o.push(c))}),n.set(c,h)});let a=0;return t.forEach(l=>Vs(l,r[a++])),o}function Gs(n,e){let t=new Map;if(n.forEach(a=>t.set(a,[])),e.length==0)return t;let s=1,i=new Set(e),r=new Map;function o(a){if(!a)return s;let l=r.get(a);if(l)return l;let c=a.parentNode;return t.has(c)?l=c:i.has(c)?l=s:l=o(c),r.set(a,l),l}return e.forEach(a=>{let l=o(a);l!==s&&t.get(l).push(a)}),t}function L(n,e){n.classList?.add(e)}function Ee(n,e){n.classList?.remove(e)}function qn(n,e,t){te(t).onDone(()=>n.processLeaveNode(e))}function Un(n){let e=[];return oi(n,e),e}function oi(n,e){for(let t=0;ti.add(r)):e.set(n,s),t.delete(n),!0}var Te=class{constructor(e,t,s){this._driver=t,this._normalizer=s,this._triggerCache={},this.onRemovalComplete=(i,r)=>{},this._transitionEngine=new Nt(e.body,t,s),this._timelineEngine=new Pt(e.body,t,s),this._transitionEngine.onRemovalComplete=(i,r)=>this.onRemovalComplete(i,r)}registerTrigger(e,t,s,i,r){let o=e+"-"+i,a=this._triggerCache[o];if(!a){let l=[],c=[],h=si(this._driver,r,l,c);if(l.length)throw Ui(i,l);c.length&&void 0,a=Cn(i,h,this._normalizer),this._triggerCache[o]=a}this._transitionEngine.registerTrigger(t,i,a)}register(e,t){this._transitionEngine.register(e,t)}destroy(e,t){this._transitionEngine.destroy(e,t)}onInsert(e,t,s,i){this._transitionEngine.insertNode(e,t,s,i)}onRemove(e,t,s){this._transitionEngine.removeNode(e,t,s)}disableAnimations(e,t){this._transitionEngine.markElementAsDisabled(e,t)}process(e,t,s,i){if(s.charAt(0)=="@"){let[r,o]=Ls(s),a=i;this._timelineEngine.command(r,t,o,a)}else this._transitionEngine.trigger(e,t,s,i)}listen(e,t,s,i,r){if(s.charAt(0)=="@"){let[o,a]=Ls(s);return this._timelineEngine.listen(o,t,a,r)}return this._transitionEngine.listen(e,t,s,i,r)}flush(e=-1){this._transitionEngine.flush(e)}get players(){return[...this._transitionEngine.players,...this._timelineEngine.players]}whenRenderingDone(){return this._transitionEngine.whenRenderingDone()}afterFlushAnimationsDone(e){this._transitionEngine.afterFlushAnimationsDone(e)}};function Vn(n,e){let t=null,s=null;return Array.isArray(e)&&e.length?(t=pt(e[0]),e.length>1&&(s=pt(e[e.length-1]))):e instanceof Map&&(t=pt(e)),t||s?new Ct(n,t,s):null}var ve=class ve{constructor(e,t,s){this._element=e,this._startStyles=t,this._endStyles=s,this._state=0;let i=ve.initialStylesByElement.get(e);i||ve.initialStylesByElement.set(e,i=new Map),this._initialStyles=i}start(){this._state<1&&(this._startStyles&&V(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(V(this._element,this._initialStyles),this._endStyles&&(V(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(ve.initialStylesByElement.delete(this._element),this._startStyles&&(he(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(he(this._element,this._endStyles),this._endStyles=null),V(this._element,this._initialStyles),this._state=3)}};ve.initialStylesByElement=new WeakMap;var Ct=ve;function pt(n){let e=null;return n.forEach((t,s)=>{Hn(s)&&(e=e||new Map,e.set(s,t))}),e}function Hn(n){return n==="display"||n==="position"}var Ye=class{constructor(e,t,s,i){this.element=e,this.keyframes=t,this.options=s,this._specialStyles=i,this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._initialized=!1,this._finished=!1,this._started=!1,this._destroyed=!1,this._originalOnDoneFns=[],this._originalOnStartFns=[],this.time=0,this.parentPlayer=null,this.currentSnapshot=new Map,this._duration=s.duration,this._delay=s.delay||0,this.time=this._duration+this._delay}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}init(){this._buildPlayer(),this._preparePlayerBeforeStart()}_buildPlayer(){if(this._initialized)return;this._initialized=!0;let e=this.keyframes;this.domPlayer=this._triggerWebAnimation(this.element,e,this.options),this._finalKeyframe=e.length?e[e.length-1]:new Map;let t=()=>this._onFinish();this.domPlayer.addEventListener("finish",t),this.onDestroy(()=>{this.domPlayer.removeEventListener("finish",t)})}_preparePlayerBeforeStart(){this._delay?this._resetDomPlayerState():this.domPlayer.pause()}_convertKeyframesToObject(e){let t=[];return e.forEach(s=>{t.push(Object.fromEntries(s))}),t}_triggerWebAnimation(e,t,s){return e.animate(this._convertKeyframesToObject(t),s)}onStart(e){this._originalOnStartFns.push(e),this._onStartFns.push(e)}onDone(e){this._originalOnDoneFns.push(e),this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}play(){this._buildPlayer(),this.hasStarted()||(this._onStartFns.forEach(e=>e()),this._onStartFns=[],this._started=!0,this._specialStyles&&this._specialStyles.start()),this.domPlayer.play()}pause(){this.init(),this.domPlayer.pause()}finish(){this.init(),this._specialStyles&&this._specialStyles.finish(),this._onFinish(),this.domPlayer.finish()}reset(){this._resetDomPlayerState(),this._destroyed=!1,this._finished=!1,this._started=!1,this._onStartFns=this._originalOnStartFns,this._onDoneFns=this._originalOnDoneFns}_resetDomPlayerState(){this.domPlayer&&this.domPlayer.cancel()}restart(){this.reset(),this.play()}hasStarted(){return this._started}destroy(){this._destroyed||(this._destroyed=!0,this._resetDomPlayerState(),this._onFinish(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}setPosition(e){this.domPlayer===void 0&&this.init(),this.domPlayer.currentTime=e*this.time}getPosition(){return+(this.domPlayer.currentTime??0)/this.time}get totalTime(){return this._delay+this._duration}beforeDestroy(){let e=new Map;this.hasStarted()&&this._finalKeyframe.forEach((s,i)=>{i!=="offset"&&e.set(i,this._finished?s:$t(this.element,i))}),this.currentSnapshot=e}triggerCallback(e){let t=e==="start"?this._onStartFns:this._onDoneFns;t.forEach(s=>s()),t.length=0}},Xe=class{validateStyleProperty(e){return!0}validateAnimatableStyleProperty(e){return!0}containsElement(e,t){return Js(e,t)}getParentElement(e){return Ot(e)}query(e,t,s){return Ys(e,t,s)}computeStyle(e,t,s){return $t(e,t)}animate(e,t,s,i,r,o=[]){let a=i==0?"both":"forwards",l={duration:s,delay:i,fill:a};r&&(l.easing=r);let c=new Map,h=o.filter(y=>y instanceof Ye);dn(s,i)&&h.forEach(y=>{y.currentSnapshot.forEach((f,g)=>c.set(g,f))});let u=cn(t).map(y=>new Map(y));u=fn(e,u,c);let S=Vn(e,u);return new Ye(e,u,l,S)}};var Ue="@",ai="@.disabled",Ze=class{constructor(e,t,s,i){this.namespaceId=e,this.delegate=t,this.engine=s,this._onDestroy=i,this.\u0275type=0}get data(){return this.delegate.data}destroyNode(e){this.delegate.destroyNode?.(e)}destroy(){this.engine.destroy(this.namespaceId,this.delegate),this.engine.afterFlushAnimationsDone(()=>{queueMicrotask(()=>{this.delegate.destroy()})}),this._onDestroy?.()}createElement(e,t){return this.delegate.createElement(e,t)}createComment(e){return this.delegate.createComment(e)}createText(e){return this.delegate.createText(e)}appendChild(e,t){this.delegate.appendChild(e,t),this.engine.onInsert(this.namespaceId,t,e,!1)}insertBefore(e,t,s,i=!0){this.delegate.insertBefore(e,t,s),this.engine.onInsert(this.namespaceId,t,e,i)}removeChild(e,t,s){this.engine.onRemove(this.namespaceId,t,this.delegate)}selectRootElement(e,t){return this.delegate.selectRootElement(e,t)}parentNode(e){return this.delegate.parentNode(e)}nextSibling(e){return this.delegate.nextSibling(e)}setAttribute(e,t,s,i){this.delegate.setAttribute(e,t,s,i)}removeAttribute(e,t,s){this.delegate.removeAttribute(e,t,s)}addClass(e,t){this.delegate.addClass(e,t)}removeClass(e,t){this.delegate.removeClass(e,t)}setStyle(e,t,s,i){this.delegate.setStyle(e,t,s,i)}removeStyle(e,t,s){this.delegate.removeStyle(e,t,s)}setProperty(e,t,s){t.charAt(0)==Ue&&t==ai?this.disableAnimations(e,!!s):this.delegate.setProperty(e,t,s)}setValue(e,t){this.delegate.setValue(e,t)}listen(e,t,s){return this.delegate.listen(e,t,s)}disableAnimations(e,t){this.engine.disableAnimations(e,t)}},Ft=class extends Ze{constructor(e,t,s,i,r){super(t,s,i,r),this.factory=e,this.namespaceId=t}setProperty(e,t,s){t.charAt(0)==Ue?t.charAt(1)=="."&&t==ai?(s=s===void 0?!0:!!s,this.disableAnimations(e,s)):this.engine.process(this.namespaceId,e,t.slice(1),s):this.delegate.setProperty(e,t,s)}listen(e,t,s){if(t.charAt(0)==Ue){let i=Gn(e),r=t.slice(1),o="";return r.charAt(0)!=Ue&&([r,o]=xn(r)),this.engine.listen(this.namespaceId,i,r,o,a=>{let l=a._data||-1;this.factory.scheduleListenerCallback(l,s,a)})}return this.delegate.listen(e,t,s)}};function Gn(n){switch(n){case"body":return document.body;case"document":return document;case"window":return window;default:return n}}function xn(n){let e=n.indexOf("."),t=n.substring(0,e),s=n.slice(e+1);return[t,s]}var et=class{constructor(e,t,s){this.delegate=e,this.engine=t,this._zone=s,this._currentId=0,this._microtaskId=1,this._animationCallbacksBuffer=[],this._rendererCache=new Map,this._cdRecurDepth=0,t.onRemovalComplete=(i,r)=>{let o=r?.parentNode(i);o&&r.removeChild(o,i)}}createRenderer(e,t){let s="",i=this.delegate.createRenderer(e,t);if(!e||!t?.data?.animation){let c=this._rendererCache,h=c.get(i);if(!h){let u=()=>c.delete(i);h=new Ze(s,i,this.engine,u),c.set(i,h)}return h}let r=t.id,o=t.id+"-"+this._currentId;this._currentId++,this.engine.register(o,e);let a=c=>{Array.isArray(c)?c.forEach(a):this.engine.registerTrigger(r,o,e,c.name,c)};return t.data.animation.forEach(a),new Ft(this,o,i,this.engine)}begin(){this._cdRecurDepth++,this.delegate.begin&&this.delegate.begin()}_scheduleCountTask(){queueMicrotask(()=>{this._microtaskId++})}scheduleListenerCallback(e,t,s){if(e>=0&&et(s));return}let i=this._animationCallbacksBuffer;i.length==0&&queueMicrotask(()=>{this._zone.run(()=>{i.forEach(r=>{let[o,a]=r;o(a)}),this._animationCallbacksBuffer=[]})}),i.push([t,s])}end(){this._cdRecurDepth--,this._cdRecurDepth==0&&this._zone.runOutsideAngular(()=>{this._scheduleCountTask(),this.engine.flush(this._microtaskId)}),this.delegate.end&&this.delegate.end()}whenRenderingDone(){return this.engine.whenRenderingDone()}};var Jn=(()=>{let e=class e extends Te{constructor(s,i,r){super(s,i,r)}ngOnDestroy(){this.flush()}};e.\u0275fac=function(i){return new(i||e)(j(ns),j(de),j(fe))},e.\u0275prov=W({token:e,factory:e.\u0275fac});let n=e;return n})();function Yn(){return new He}function Xn(n,e,t){return new et(n,e,t)}var li=[{provide:fe,useFactory:Yn},{provide:Te,useClass:Jn},{provide:Xt,useFactory:Xn,deps:[hs,Te,ke]}],Zn=[{provide:de,useFactory:()=>new Xe},{provide:rt,useValue:"BrowserAnimations"},...li],Ir=[{provide:de,useClass:It},{provide:rt,useValue:"NoopAnimations"},...li];function ci(){return Zt("NgEagerAnimations"),[...Zn]}var tt=class{http;prefix;suffix;constructor(e,t="/assets/i18n/",s=".json"){this.http=e,this.prefix=t,this.suffix=s}getTranslation(e){return this.http.get(`${this.prefix}${e}${this.suffix}`)}};function er(n,e){if(n&1&&(U(0,"li")(1,"h2")(2,"a",2),ae(3),ge(4,"translate"),Y()()()),n&2){let t,s=e.$implicit;q(2),oe("routerLink","/"+s.path),q(),Oe(" ",ye(4,2,((t=s.name)!==null&&t!==void 0?t:s.path)+".title")," ")}}var hi=(()=>{let e=class e{constructor(){this.sections=[{path:"dashboard"},{path:"presence-control"},{path:"open-absences"},{path:"edit-absences"},{path:"evaluate-absences"},{path:"events"},{path:"events/current",name:"events.current"},{path:"my-absences"},{path:"my-profile"},{path:"my-grades"},{path:"my-settings"}]}};e.\u0275fac=function(i){return new(i||e)},e.\u0275cmp=J({type:e,selectors:[["bkd-home"]],standalone:!0,features:[X],decls:2,vars:1,consts:[[1,"mt-3"],[4,"ngFor","ngForOf"],[3,"routerLink"]],template:function(i,r){i&1&&(U(0,"ul",0),be(1,er,5,4,"li",1),Y()),i&2&&(q(),oe("ngForOf",r.sections))},dependencies:[Ie,ms,Se,$e],changeDetection:0});let n=e;return n})();var di=(()=>{let e=class e{constructor(){}};e.\u0275fac=function(i){return new(i||e)},e.\u0275cmp=J({type:e,selectors:[["bkd-unauthenticated"]],standalone:!0,features:[X],decls:4,vars:3,consts:[[1,"bkd-container"],[1,"alert","alert-danger","my-3"]],template:function(i,r){i&1&&(U(0,"div",0)(1,"div",1),ae(2),ge(3,"translate"),Y()()),i&2&&(q(2),Oe(" ",ye(3,1,"unauthenticated.message")," "))},dependencies:[Se,$e],encapsulation:2});let n=e;return n})();var st=(()=>{let e=class e{constructor(s){this.storage=s}get isAuthenticated(){return!!this.accessToken}get accessToken(){return this.storage.getAccessToken()}};e.\u0275fac=function(i){return new(i||e)(j(bs))},e.\u0275prov=W({token:e,factory:e.\u0275fac,providedIn:"root"});let n=e;return n})();function z(){return()=>{let n=H(st),e=H(Le);return n.isAuthenticated?!0:(e.navigate(["/unauthenticated"]),!1)}}var fi=[{path:"dashboard",canActivate:[z()],loadChildren:()=>import("./chunk-WNMIKIML.js").then(n=>n.DASHBOARD_ROUTES)},{path:"presence-control",canActivate:[z()],loadChildren:()=>import("./chunk-VJ6UATSE.js").then(n=>n.PRESENCE_CONTROL_ROUTES)},{path:"open-absences",canActivate:[z()],loadChildren:()=>import("./chunk-SVAHLOZE.js").then(n=>n.OPEN_ABSENCES_ROUTES)},{path:"edit-absences",canActivate:[z()],loadChildren:()=>import("./chunk-GTCR4WGM.js").then(n=>n.EDIT_ABSENCES_ROUTES)},{path:"evaluate-absences",canActivate:[z()],loadChildren:()=>import("./chunk-ELVM3VWW.js").then(n=>n.EVALUATE_ABSENCES_ROUTES)},{path:"events",canActivate:[z()],loadChildren:()=>import("./chunk-ONX2BRSQ.js").then(n=>n.EVENTS_ROUTES)},{path:"my-absences",canActivate:[z()],loadChildren:()=>import("./chunk-KNS2BM7M.js").then(n=>n.MY_ABSENCES_ROUTES)},{path:"my-profile",canActivate:[z()],loadChildren:()=>import("./chunk-7T3G7FUV.js").then(n=>n.MY_PROFILE_ROUTES)},{path:"my-grades",canActivate:[z()],loadChildren:()=>import("./chunk-PMU42JF5.js").then(n=>n.MY_GRADES_ROUTES)},{path:"my-settings",canActivate:[z()],loadChildren:()=>import("./chunk-S2U6O7J2.js").then(n=>n.MY_SETTINGS_ROUTES)},{path:"unauthenticated",component:di},{path:"",component:hi,pathMatch:"full"}];function mi(){return(n,e)=>{let t=H(st),s=H(Z);if(n.url.startsWith(s.apiUrl)&&t.accessToken){let i=n.headers.set("Authorization",`Bearer ${t.accessToken}`);return e(n.clone({headers:i}))}return e(n)}}function pi(){return(n,e)=>{let t=H(Z);if(!n.headers.has("X-Role-Restriction")&&t.headerRoleRestriction){let s=tr();if(s&&t.headerRoleRestriction[s]){let i=n.headers.set("X-Role-Restriction",t.headerRoleRestriction[s]);return e(n.clone({headers:i}))}}return e(n)}}function tr(){let n=H(Le),e=n.url?Ms(n.url):null;return e?Ss(e):null}function gi(){return[{provide:Yt,useClass:sr}]}var sr=(()=>{let e=class e{constructor(s,i,r){this.ngZone=s,this.translate=i,this.toastService=r}handleError(s){console.error(String(s)),s instanceof as||this.notifyError()}notifyError(){this.ngZone.run(()=>{this.toastService.error(this.translate.instant("global.app-errors.exception-message"),this.translate.instant("global.app-errors.exception-title"))})}};e.\u0275fac=function(i){return new(i||e)(j(ke),j(Ts),j(_e))},e.\u0275prov=W({token:e,factory:e.\u0275fac});let n=e;return n})();function ir(n,e){return new tt(n,`${e.scriptsAndAssetsPath}/assets/locales/`,".json")}var yi={providers:[ps(fi,gs()),cs(us([Ps(),mi(),pi()])),ci(),gi(),xt(Se.forRoot({loader:{provide:vs,useFactory:ir,deps:[ls,Z]}})),ws()]};var _i={production:!0};_i.production&&void 0;lt(Ds);lt(Ns);ds(ks,yi).catch(n=>console.error(n));