From 1e9167029677a40be2fdca0dfd1764e8bed919cd Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 25 Jun 2024 12:57:14 +0000 Subject: [PATCH] Add webapp-schulverwaltung build d3839710 --- .../{chunk-GD4YO4IV.js => chunk-4EXGKTN3.js} | 2 +- public/apps/webapp-schulverwaltung/chunk-5CY7K6UY.js | 1 - public/apps/webapp-schulverwaltung/chunk-7LCBKZQT.js | 2 -- .../{chunk-ON6N652E.js => chunk-ELVM3VWW.js} | 2 +- public/apps/webapp-schulverwaltung/chunk-EZ6BEJIE.js | 1 + .../{chunk-WMKWXTQE.js => chunk-GTCR4WGM.js} | 2 +- .../{chunk-GXZYLK4L.js => chunk-JV3CBBGP.js} | 2 +- .../{chunk-XYF73IOS.js => chunk-MGID7RWQ.js} | 2 +- .../{chunk-EO6OESLF.js => chunk-PMU42JF5.js} | 2 +- .../{chunk-TPZAD5BA.js => chunk-VJ6UATSE.js} | 2 +- public/apps/webapp-schulverwaltung/chunk-W7ASLXRM.js | 2 ++ .../{chunk-XHR5YBGK.js => chunk-WNMIKIML.js} | 2 +- public/apps/webapp-schulverwaltung/main.js | 2 +- 13 files changed, 12 insertions(+), 12 deletions(-) rename public/apps/webapp-schulverwaltung/{chunk-GD4YO4IV.js => chunk-4EXGKTN3.js} (91%) delete mode 100644 public/apps/webapp-schulverwaltung/chunk-5CY7K6UY.js delete mode 100644 public/apps/webapp-schulverwaltung/chunk-7LCBKZQT.js rename public/apps/webapp-schulverwaltung/{chunk-ON6N652E.js => chunk-ELVM3VWW.js} (98%) create mode 100644 public/apps/webapp-schulverwaltung/chunk-EZ6BEJIE.js rename public/apps/webapp-schulverwaltung/{chunk-WMKWXTQE.js => chunk-GTCR4WGM.js} (99%) rename public/apps/webapp-schulverwaltung/{chunk-GXZYLK4L.js => chunk-JV3CBBGP.js} (99%) rename public/apps/webapp-schulverwaltung/{chunk-XYF73IOS.js => chunk-MGID7RWQ.js} (90%) rename public/apps/webapp-schulverwaltung/{chunk-EO6OESLF.js => chunk-PMU42JF5.js} (97%) rename public/apps/webapp-schulverwaltung/{chunk-TPZAD5BA.js => chunk-VJ6UATSE.js} (99%) create mode 100644 public/apps/webapp-schulverwaltung/chunk-W7ASLXRM.js rename public/apps/webapp-schulverwaltung/{chunk-XHR5YBGK.js => chunk-WNMIKIML.js} (99%) diff --git a/public/apps/webapp-schulverwaltung/chunk-GD4YO4IV.js b/public/apps/webapp-schulverwaltung/chunk-4EXGKTN3.js similarity index 91% rename from public/apps/webapp-schulverwaltung/chunk-GD4YO4IV.js rename to public/apps/webapp-schulverwaltung/chunk-4EXGKTN3.js index 9189c41f..f9300101 100644 --- a/public/apps/webapp-schulverwaltung/chunk-GD4YO4IV.js +++ b/public/apps/webapp-schulverwaltung/chunk-4EXGKTN3.js @@ -1 +1 @@ -import{n as e}from"./chunk-7LCBKZQT.js";import{b as l}from"./chunk-24AFRN2G.js";import{Dd as a,O as s,Vc as p,W as n,Z as o,dc as m}from"./chunk-XTHSYQMN.js";var R=(()=>{let t=class t extends l{constructor(c,i){super(c,i,e,"StudyClasses","Number")}getActive(){return this.http.get(`${this.baseUrl}/?filter.IsActive==true`,{headers:{"X-Role-Restriction":"ClassTeacherRole"}}).pipe(s(a(e)))}getActiveFormativeAssessments(){return this.http.get(`${this.baseUrl}/FormativeAssessments?filter.IsActive==true`,{headers:{"X-Role-Restriction":"ClassTeacherRole"}}).pipe(s(a(e)))}};t.\u0275fac=function(i){return new(i||t)(o(m),o(p))},t.\u0275prov=n({token:t,factory:t.\u0275fac,providedIn:"root"});let r=t;return r})();export{R as a}; +import{n as e}from"./chunk-W7ASLXRM.js";import{b as l}from"./chunk-24AFRN2G.js";import{Dd as a,O as s,Vc as p,W as n,Z as o,dc as m}from"./chunk-XTHSYQMN.js";var R=(()=>{let t=class t extends l{constructor(c,i){super(c,i,e,"StudyClasses","Number")}getActive(){return this.http.get(`${this.baseUrl}/?filter.IsActive==true`,{headers:{"X-Role-Restriction":"ClassTeacherRole"}}).pipe(s(a(e)))}getActiveFormativeAssessments(){return this.http.get(`${this.baseUrl}/FormativeAssessments?filter.IsActive==true`,{headers:{"X-Role-Restriction":"ClassTeacherRole"}}).pipe(s(a(e)))}};t.\u0275fac=function(i){return new(i||t)(o(m),o(p))},t.\u0275prov=n({token:t,factory:t.\u0275fac,providedIn:"root"});let r=t;return r})();export{R as a}; diff --git a/public/apps/webapp-schulverwaltung/chunk-5CY7K6UY.js b/public/apps/webapp-schulverwaltung/chunk-5CY7K6UY.js deleted file mode 100644 index 03f33e51..00000000 --- a/public/apps/webapp-schulverwaltung/chunk-5CY7K6UY.js +++ /dev/null @@ -1 +0,0 @@ -import{a as oi}from"./chunk-XYF73IOS.js";import{a as di,b as pi}from"./chunk-RQFEXCIP.js";import{a as mi}from"./chunk-GD4YO4IV.js";import{a as ai}from"./chunk-GXZYLK4L.js";import"./chunk-U4HODSW3.js";import{a as tt,b as qt,c as zt,d as Yt,e as Kt,f as We,g as qe,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 ze}from"./chunk-7LCBKZQT.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 At,Y as si,t as Vt}from"./chunk-ZK2MNT7Z.js";import{a as Ce,c as jt,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 Ae,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 xt,Gd as w,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 F,Ta as d,Ua as E,Va as W,Vb as V,Vc as ve,W as ge,Wa as q,Wb as $e,Ya as M,Yc as Re,Z as U,_a as v,_c as be,a as R,ab as ht,ad as yt,b as H,ba as mt,bb as _t,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 S,ia as I,ib as j,id as kt,jb as m,jd as Et,k as Y,ka as gt,kb as b,l as at,lb as h,m as x,mb as et,n as te,nd as je,oc as _e,od as Ve,pc as Fe,pd as wt,qa as ft,qc as Be,qd as Pt,ra as X,rc as oe,rd as xe,sb as pe,sd as Mt,ta as we,tb as y,ua as a,ub as vt,v as Oe,va as _,vb as O,w as Ee,wb as Pe,xb as he,yd as Bt,zb as bt,zd as Rt}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),b(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),b(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,we),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,we),a(),b(r.event.designation),a(2),p("ngIf",r.event.dateFrom&&r.event.dateTo),a(2),h(" ",r.event.studentCount," "),a(2),b(c(9,6,r.event.studentCount===1?"events.registration":"events.registrations")),a(2),p("ngIf",r.withRatings&&r.event.evaluationText))},dependencies:[F,oe,$e,P,w],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,k,T){this.coursesRestService=e,this.eventsRestService=t,this.studyClassRestService=r,this.loadingService=g,this.translate=k,this.settings=T,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(x(B=>Nt(B,"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(x(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(x(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(x(ye(this.createAndSortEvents.bind(this))))}loadUnratedCourses(e){return this.coursesRestService.getExpandedCourses(e).pipe(x(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 k=g.filter(T=>!r.map(B=>B.Id).includes(T.Id));return[...this.createFromCourses(e),...this.createFromStudyCourses(t),...this.createFromAssessments(r),...this.createFromStudyClasses(k)].sort((T,B)=>T.designation.localeCompare(B.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(R({},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?Vt(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(ve))},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),q()),i&2){let s=u(2).bkdLet,e=u();a(3),b(c(4,5,"events.designation")),a(3),b(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(),b(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),q()),i&2){let s=j(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"),v("valueChange",function(t){S(s);let r=u();return I(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=j(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"],_n=[...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?_n:hi)}};n.\u0275fac=function(t){return new(t||n)(_(Te),_(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,F,ce,Se,V,P,w,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 _i=(()=>{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(),b(c(2,3,"events.current.title")),a(2),p("withStudyCourses",!0)("withRatings",!1))},dependencies:[Je,P,w]});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-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(),b(c(2,2,"events.title")),a(2),p("withRatings",!0))},dependencies:[Je,P,w]});let i=n;return i})();var bi=(()=>{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,At]),y],decls:1,vars:0,template:function(t,r){t&1&&E(0,"router-outlet")},dependencies:[Fe]});let i=n;return i})();function xi(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(vn)}function vn(i){return i!==null}function Si(i,n,s,e){return i?.map(t=>({student:t,finalGrade:xn(t,s,e),grades:bn(t,n)}))}function bn(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 xn(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 wi({id:i,selectedGradeId:n},s){return s.map(e=>e.Id!==i?e:H(R({},e),{GradeId:n}))}function Pi(i,n){switch(n.type){case"reset":return n.payload;case"updateResult":return i?H(R({},i),{Tests:zt(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(R({},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(R({},i),{Tests:Kt(n.payload,i.Tests||[])}):null;case"final-grade-overwritten":return i?H(R({},i),{Gradings:wi({id:n.payload.id,selectedGradeId:n.payload.selectedGradeId},i.Gradings||[])}):null;case"replace-grades":return i?H(R({},i),{Gradings:n.payload}):null;case"delete-test":return i?H(R({},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(x(()=>e))}};n.\u0275fac=function(t){return new(t||n)(U(Ct),U(ve))},n.\u0275prov=ge({token:n,factory:n.\u0275fac,providedIn:"root"});let i=n;return i})();var st={onlyMine:!1,hidePublished:!1},A=(()=>{let n=class n{constructor(e,t,r,g,k){this.coursesRestService=e,this.gradingScalesRestService=t,this.gradingsRestService=r,this.loadingService=g,this.sortService=k,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(T=>this.loadingService.load(this.coursesRestService.getExpandedCourse(T))),J(1)),this.course$=Oe(this.action$,this.fetchedCourse$.pipe(Ee(Ne),x(T=>({type:"reset",payload:T})))).pipe(pt(Pi,null),Ee(Ne),J(1)),this.tests$=this.course$.pipe(x(T=>T.Tests||[]),x(Qt)),this.hasTests$=this.tests$.pipe(x(T=>T.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(x(([T,B])=>T.filter(z=>(!B.onlyMine||z.IsOwner)&&(!B.hidePublished||!z.IsPublished)))),this.sorting$=this.sortService.sorting$,this.studentGrades$=te([this.course$,this.filteredTests$,this.sorting$]).pipe(x(ye(this.toStudentGrades.bind(this)))),this.canSetFinalGrade$=this.course$.pipe(x(gi)),this.gradingScaleIds$=this.course$.pipe(x(T=>Rt([...(T.Tests??[]).map(B=>B.GradingScaleId),T.GradingScaleId]).filter(Ne)),K(Bt),J(1)),this.gradingScales$=this.gradingScaleIds$.pipe(D(T=>this.gradingScalesRestService.getGradingScales(T)),J(1)),this.UNDEFINED_GRADINGSCALE_ID=-1,this.gradingScalesOptions$=this.gradingScales$.pipe(x(T=>T.map(B=>{let z=B?.Id||this.UNDEFINED_GRADINGSCALE_ID,ke=B?.Grades.map(Me=>({Key:Me.Id,Value:Me.Designation}))||[];return{id:z,options:ke}}).reduce((B,z)=>H(R({},B),{[z.id]:z.options}),{})),J(1)),this.meanOfStudentGradesForCourse$=this.studentGrades$.pipe(x(T=>ki(nt(T)))),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),x(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(R({},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=qt(e,t.testId,t.studentId),g=r?R({},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,k){r?this.updateTestResult(r,g,k):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(x(t=>t[e]),J(1))}meanOfOverwrittenGradesForCourse(e,t){return this.course$.pipe(x(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}),kn=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 wn(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()()(),q()),i&2){let s,e,t=u(3);a(5),b(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),b(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),b(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),v("ngSubmit",function(){S(s);let t=u(2);return I(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"),v("click",function(){S(s);let t=j(20);return I(t.toggle())}),d(),f(23,wn,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),b(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),b(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),b(c(28,45,"tests.form.weight")),a(5),b(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),b(c(42,53,"tests.form.grading-type")),a(3),p("value",!1),a(2),b(c(47,55,"tests.form.grades")),a(3),p("value",!0),a(2),b(c(52,57,"tests.form.points")),a(2),p("ngIf",r.formGroup.get("isPointGrading").value),a(2),p("disabled",g.saving)("routerLink",O(65,kn,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 Bn(i,n){if(i&1&&(W(0),f(1,Fn,63,67,"form",2),q()),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),jt(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:["",be.required],date:[null,be.required],weight:[1,be.compose([be.required,xi(0)])],isPointGrading:[!1],maxPoints:[{value:null,disabled:!0},be.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)(_(Pt),_(ie),_(A))},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,Bn,2,1,"ng-container",1),t&2&&p("bkdLet",O(1,Tn,r.formGroup))},dependencies:[Q,F,xe,It,Re,Le,Tt,De,yt,wt,Ve,je,Mt,kt,Et,ce,$t,oe,V,P,w],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),v("save",function(t){S(s);let r=u();return I(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,k){this.route=e,this.courseService=t,this.toastService=r,this.translate=g,this.router=k,this.saving$=new L(!1),this.courseId$=this.route.paramMap.pipe(x(T=>Number(T.get("id"))),K())}save(e){this.saving$.next(!0);let{designation:t,date:r,weight:g,isPointGrading:k,maxPoints:T,maxPointsAdjusted:B}=e;this.courseId$.pipe(D(z=>this.courseService.add(z,r,t,g,k,T,B)),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)(_(_e),_(me),_(He),_(ie),_(Be))},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(),b(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,V,P,w]});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)(_(Ae))},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),v("click",function(){return r.activeModal.dismiss()}),o(6,"span",4),m(7),l(8,"translate"),d()(),o(9,"button",5),v("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,w]});let i=n;return i})();var An=(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),v("click",function(){S(s);let t=u().bkdLet,r=u();return I(r.openDeleteModal(t.test))}),o(6,"i",6),m(7,"delete"),d()()(),o(8,"bkd-tests-edit-form",7),v("save",function(t){S(s);let r=u(2);return I(r.save(t))}),d(),q()}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=j(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,k,T,B){this.state=e,this.courseService=t,this.route=r,this.toastService=g,this.translate=k,this.router=T,this.modalService=B,this.saving$=new L(!1),this.testId$=this.route.paramMap.pipe(x(z=>Number(z.get("testId"))),K()),this.test$=te([this.state.tests$,this.testId$]).pipe(x(([z,ke])=>z.find(Me=>Me.Id===ke)))}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:k,maxPoints:T,maxPointsAdjusted:B}=e;te([this.state.courseId$,this.testId$]).pipe(ne(1),D(([z,ke])=>this.courseService.update(z,ke,t,r,g,k,T,B)),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)(_(A),_(me),_(_e),_(He),_(ie),_(Be),_(ze))},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,An,c(1,1,r.state.courseId$),c(2,3,r.test$),c(3,5,r.saving$)))},dependencies:[Q,F,Qe,Se,V,P,w]});let i=n;return i})();var qn=i=>({designation:i}),Bi=(()=>{let n=class n{constructor(e){this.activeModal=e}};n.\u0275fac=function(t){return new(t||n)(_(Ae))},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),v("click",function(){return r.activeModal.dismiss()}),m(6),l(7,"translate"),d(),o(8,"button",4),v("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,qn,r.test.Designation))," "),a(4),h(" ",c(7,6,"tests.publishing.cancel")," "),a(3),h(" ",c(10,8,"tests.publishing.confirm")," "))},dependencies:[P,w],encapsulation:2});let i=n;return i})();var zn=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,zn,s.maxPoints))," ")}}function Kn(i,n){if(i&1){let s=M();o(0,"div",5)(1,"input",6,0),v("ngModelChange",function(){S(s);let t=j(2),r=u();return I(r.onPointsChange(t.value))}),d(),f(3,Yn,3,6,"div",7),d()}if(i&2){let s=j(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,Ri=(()=>{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)),x(e=>({studentId:this.student.Id,testId:this.grade.test.Id,points:e?Number(e):null})))),this.initSave(this.gradeSubject$.pipe(x(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(x(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)(_(A))},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"),v("valueChange",function(k){return r.onGradeChange(k)}),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:[F,xe,Re,Le,De,Ve,je,St,Ie,V,P,w],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(),b(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,qe)}safeAverage(e,t,r){try{return ei(r(e),this.locale,t)}catch{return Xt}}};n.\u0275fac=function(t){return new(t||n)(_(xt))},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),b(r.calculateGradeAverage(r.test)))},dependencies:[F],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.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"},outputs:{gradeIdSelected:"gradeIdSelected"},standalone:!0,features:[y],decls:1,vars:4,consts:[["data-testid","grade-select",3,"valueChange","options","allowEmpty","value","disabled"]],template:function(t,r){t&1&&(o(0,"bkd-select",0),v("valueChange",function(k){return r.onGradeChange(k)}),d()),t&2&&p("options",r.options)("allowEmpty",!0)("value",r.valueId)("disabled",r.disabled)},dependencies:[Ie],styles:["[_nghost-%COMP%] select{min-width:13ch}"]});let i=n;return i})();var Xn=576,ji=(()=>{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}),Ai=(()=>{let n=class n{constructor(){this.filter=st,this.filterChange=new X}showOnlyMine(){this.filterChange.next(H(R({},this.filter),{onlyMine:!0}))}showAll(){this.filterChange.next(H(R({},this.filter),{onlyMine:!1}))}onHidePublishedChange(e){let t=(e.target&&e.target instanceof HTMLInputElement&&e.target?.checked)??!1;this.filterChange.next(H(R({},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),v("click",function(){return r.showAll()}),m(2),l(3,"translate"),d(),o(4,"button",2),v("click",function(){return r.showOnlyMine()}),m(5),l(6,"translate"),d()(),o(7,"div",3)(8,"div",4)(9,"input",5),v("change",function(k){return r.onHidePublishedChange(k)}),d(),o(10,"label",6),m(11),l(12,"translate"),d()()()),t&2&&(a(),p("ngClass",Pe(12,Vi,!r.filter.onlyMine,r.filter.onlyMine)),a(),h(" ",c(3,6,"tests.all-tests")," "),a(2),p("ngClass",Pe(15,Vi,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,xe,P,w],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"),_t(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)(_(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),b(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),b(s.test.Owner)}}function nr(i,n){if(i&1){let s=M();o(0,"div",13)(1,"a",14),l(2,"translate"),v("click",function(){S(s);let t=u();return I(t.unpublishTest())}),o(3,"i",15),m(4,"lock"),d(),o(5,"span"),m(6),l(7,"translate"),d()(),o(8,"bkd-caret",16),v("click",function(){S(s);let t=u();return I(t.toggleHeader())}),d()()}if(i&2){let s=u();a(),le("title",c(2,3,"tests.edit")),a(5),b(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"),v("click",function(){S(s);let t=u();return I(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),v("click",function(){S(s);let t=u();return I(t.toggleHeader())}),d()()}if(i&2){let s=u();a(),le("title",c(2,3,"tests.publish")),a(5),b(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),v("click",function(){return S(g),I(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=j(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,F,Hi,oe,$e,P,w,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: 750px){.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),v("toggle",function(t){S(s);let r=u(2);return I(r.state.toggleHeader(t))})("publish",function(t){S(s);let r=u(2);return I(r.publish.emit(t))})("unpublish",function(t){S(s);let r=u(2);return I(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),v("toggle",function(t){S(s);let r=u(2);return I(r.state.toggleHeader(t))})("publish",function(t){S(s);let r=u(2);return I(r.publish.emit(t))})("unpublish",function(t){S(s);let r=u(2);return I(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),v("click",function(){S(s);let t=u().$implicit,r=u(2);return I(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),v("click",function(){let t=S(s).$implicit,r=u(2);return I(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),b(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),v("filterChange",function(t){S(s);let r=u();return I(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),v("click",function(){S(s);let t=u();return I(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),v("click",function(){S(s);let t=u();return I(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),v("click",function(){S(s);let t=u();return I(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(),q()}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.getColumns().map(e=>e.map(t=>t.getBoundingClientRect().width))}setColumnWidths(e){let t=this.getColumns();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((k,T)=>{k.style.width=`${e[g][T]}px`,k.style.minWidth=`${e[g][T]}px`}))}getStickyColumnsHeights(){return this.getColumns(".sticky").map(e=>e.map(t=>t.getBoundingClientRect().height))}setStickyColumnHeights(e){let t=this.getColumns(".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((k,T)=>{k.style.height=`${e[g][T]}px`}))}getColumns(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)(_(A),_(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","grade h-100 test-info-desktop",3,"ngClass",4,"ngFor","ngForOf"],["container","body","class","grade h-100 header-mobile test-info-mobile","colspan","3",3,"ngClass",4,"ngFor","ngForOf"],[1,"primary-column-width","sticky",3,"click"],[1,"d-flex"],[1,"column-title"],[1,"sort-direction","ms-1"],[1,"secondary-column-width","sticky","sticky-col-2","desktop",3,"click","ngClass"],[1,"secondary-column-width","border-end","sticky","sticky-col-3","desktop",3,"click"],["container","body","class","grade h-100",3,"ngClass",4,"ngFor","ngForOf"],["container","body",1,"grade","h-100","test-info-desktop",3,"ngClass"],[3,"toggle","publish","unpublish","test","expanded"],["container","body","colspan","3",1,"grade","h-100","header-mobile","test-info-mobile",3,"ngClass"],["container","body",1,"grade","h-100",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,V,ae,ce,F,P,w,Ai,Ui],styles:["th.grade.selected[_ngcontent-%COMP%], td.grade.selected[_ngcontent-%COMP%]{display:table-cell!important}th.grade[_ngcontent-%COMP%], td.grade[_ngcontent-%COMP%], .desktop[_ngcontent-%COMP%]{display:none!important}.desktop.selected[_ngcontent-%COMP%]{display:table-cell!important}.mobile[_ngcontent-%COMP%]{display:block!important}th[_ngcontent-%COMP%], td[_ngcontent-%COMP%]{padding:1rem}@media (min-width: 576px){th.grade[_ngcontent-%COMP%], td.grade[_ngcontent-%COMP%], .desktop[_ngcontent-%COMP%]{display:table-cell!important}.mobile[_ngcontent-%COMP%]{display:none!important}.primary-column-width[_ngcontent-%COMP%]{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;min-width:300px;max-width:300px}.secondary-column-width[_ngcontent-%COMP%]{min-width:100px;max-width:100px}}.sticky[_nghost-%COMP%]{position:fixed;top:0;left:0;z-index:1000;display:none}@media (min-width: 576px){.sticky.shown[_nghost-%COMP%]{display:table-header-group}}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}.point-input-container[_ngcontent-%COMP%]{width:5em}@media (min-width: 576px){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;min-width:100px;max-width:100px}tr[_ngcontent-%COMP%] th.grade[_ngcontent-%COMP%]{min-width:300px;max-width:300px}th.sticky[_ngcontent-%COMP%]{position:sticky;left:0;background-color:#fff}th.sticky.sticky-col-2[_ngcontent-%COMP%]{left:300px}th.sticky.sticky-col-3[_ngcontent-%COMP%]{left:447px}.sticky[_nghost-%COMP%]{margin-left:547px}.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}),qi=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",23),l(1,"async"),l(2,"async"),v("gradeIdSelected",function(t){S(s);let r=u(3);return I(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 _r(i,n){if(i&1&&(o(0,"div"),m(1),d()),i&2){let s=u().$implicit;a(),h(" ",s.finalGrade.freeHandGrade," ")}}function vr(i,n){if(i&1&&(o(0,"td",24),E(1,"bkd-grade",25),l(2,"async"),d()),i&2){let s=n.$implicit,e=n.index,t=u(),r=t.$implicit,g=t.index,k=u(2);p("ngClass",k.selectedTest!==void 0&&s.test.Id===k.selectedTest.Id?"selected":""),a(),p("grade",s)("gradeOptions",c(2,5,k.state.gradingOptionsForTest$(s.test)))("student",r.student)("tabIndex",(1+e)*1e3+g)}}function br(i,n){if(i&1&&(o(0,"tr")(1,"td",16)(2,"a",17)(3,"span"),m(4),d(),o(5,"span",10),m(6),l(7,"translate"),l(8,"decimalOrDash"),d()()(),o(9,"td",18),f(10,hr,3,8,"bkd-grade-select",19)(11,_r,2,1,"div",20),d(),o(12,"td",21),m(13),l(14,"decimalOrDash"),d(),f(15,vr,3,7,"td",22),d()),i&2){let s=n.$implicit,e=u(2);a(2),p("routerLink",O(18,gr,s.student.Id)),a(2),b(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,qi,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 xr(i,n){if(i&1&&(o(0,"td",24),E(1,"bkd-average-grades",26),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",27),v("click",function(){S(s);let t=u(2);return I(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),v("publish",function(t){S(s);let r=u();return I(r.publish(t))})("unpublish",function(t){S(s);let r=u();return I(r.unpublish(t))}),d(),o(5,"thead",6,1),v("publish",function(t){S(s);let r=u();return I(r.publish(t))})("unpublish",function(t){S(s);let r=u();return I(r.unpublish(t))}),d(),o(7,"tbody"),f(8,br,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,xr,2,2,"td",13),d()()(),o(29,"div",14),f(30,Cr,3,6,"button",15),l(31,"async"),d()(),q()}if(i&2){let s=n.bkdLet,e=j(4),t=j(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),b(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,qi,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 zi=(()=>{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(x(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,qe)}safeAverage(e,t){try{return t(e).toString()}catch{return"\u2013"}}openModal(e){let t=this.modalService.open(Bi);return t.componentInstance.test=e,t}onCloseModal(e,t){e.result.then(r=>{r&&t()},()=>{})}};n.\u0275fac=function(t){return new(t||n)(_(A),_(ze))},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"],[1,"d-flex","flex-column"],[1,"mobile","mean"],[1,"desktop","sticky","sticky-col-2",3,"ngClass"],[1,"desktop","border-end","sticky","sticky-col-3"],["class","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"],[1,"primary-column-width","sticky","name"],[3,"routerLink"],[1,"grade","sticky","sticky-col-2",3,"ngClass"],[3,"options","valueId","gradeId","disabled","gradeIdSelected",4,"ngIf"],[4,"ngIf"],[1,"grade","border-end","sticky","sticky-col-3"],["class","grade",3,"ngClass",4,"ngFor","ngForOf","ngForTrackBy"],[3,"gradeIdSelected","options","valueId","gradeId","disabled"],[1,"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,F,oe,Li,Ri,Di,V,P,w,Zt,ji,Wi],styles:["th.grade.selected[_ngcontent-%COMP%], td.grade.selected[_ngcontent-%COMP%]{display:table-cell!important}th.grade[_ngcontent-%COMP%], td.grade[_ngcontent-%COMP%], .desktop[_ngcontent-%COMP%]{display:none!important}.desktop.selected[_ngcontent-%COMP%]{display:table-cell!important}.mobile[_ngcontent-%COMP%]{display:block!important}th[_ngcontent-%COMP%], td[_ngcontent-%COMP%]{padding:1rem}@media (min-width: 576px){th.grade[_ngcontent-%COMP%], td.grade[_ngcontent-%COMP%], .desktop[_ngcontent-%COMP%]{display:table-cell!important}.mobile[_ngcontent-%COMP%]{display:none!important}.primary-column-width[_ngcontent-%COMP%]{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;min-width:300px;max-width:300px}.secondary-column-width[_ngcontent-%COMP%]{min-width:100px;max-width:100px}}.mean[_ngcontent-%COMP%]{color:#4e4e4ef2;font-size:.875rem;line-height:1}td.name[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{text-decoration:none}td.name[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:first-child{text-decoration:underline}td.name[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:first-child:hover{text-decoration-color:#ea161f}tbody[_ngcontent-%COMP%] td.name[_ngcontent-%COMP%], tbody[_ngcontent-%COMP%] td.average[_ngcontent-%COMP%]{max-width:18ch;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding-right:0}@media (min-width: 576px){.table-responsive-wrapper[_ngcontent-%COMP%]{display:block;overflow-x:auto}table[_ngcontent-%COMP%]{border-collapse:separate;border-spacing:0}tbody[_ngcontent-%COMP%] td.name[_ngcontent-%COMP%]{max-width:auto;overflow:visible}tbody[_ngcontent-%COMP%] td.sticky[_ngcontent-%COMP%]{position:sticky;left:0;background-color:#fff}tbody[_ngcontent-%COMP%] td.sticky.sticky-col-2[_ngcontent-%COMP%]{left:300px}tbody[_ngcontent-%COMP%] td.sticky.sticky-col-3[_ngcontent-%COMP%]{left:447px}.action-buttons[_ngcontent-%COMP%]{position:sticky;left:0}}@media (max-width: 575.98px){.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(x(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)(_(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",vt(6,Sr)),a(5),p("reports",c(6,4,r.reports$)),a(5),b(r.getDesignation()),a(),p("ngIf",r.course.ParticipatingStudents))},dependencies:[si,oe,Ut,F,V,P,w],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 kr=(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 wr(i,n){if(i&1){let s=M();W(0),o(1,"bkd-select",7),v("valueChange",function(t){S(s);let r=u(3);return I(t&&r.testSelected(t))}),d(),E(2,"bkd-test-edit-grades",8),q()}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()),we),p("ngClass",O(7,Er,!s.hasTests||!s.selectedTest)),a(5),b(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,wr,3,4,"ng-container",4)(3,Pr,7,9,"a",6),l(4,"async"),q()),i&2){let s=u().bkdLet,e=u(),t=j(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"),q()),i&2){let s=u(),e=j(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(),b(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(x(g=>[{Key:-1,Value:this.translate.instant("tests.grade")},...g.map(k=>({Key:k.Id,Value:k.Designation}))]),K()),this.selectedTestId$=Oe(this.selectTest$,this.state.tests$.pipe(ne(1),x(g=>g[0]?.Id))).pipe(K()),this.selectedTest$=this.selectedTestId$.pipe(D(g=>this.state.tests$.pipe(x(k=>k.find(T=>T.Id===g)))),K())}testSelected(e){this.selectTest$.next(e)}buildLinkToRatingOverview(){return this.state.course$.pipe(ne(1),x(e=>this.settings.eventlist.evaluation.replace(":id",String(e.Id))))}};n.\u0275fac=function(t){return new(t||n)(_(ve),_(A),_(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"],[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",bt(13,kr,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,F,Yi,Ie,zi,ae,Se,V,P,w],styles:[".tests-dropdown[_ngcontent-%COMP%]{display:block;padding:1rem 0}@media (min-width: 576px){.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: 575.98px){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(x(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)(_(A),_(_e))},n.\u0275cmp=C({type:n,selectors:[["bkd-tests"]],standalone:!0,features:[pe([A]),y],decls:1,vars:0,template:function(t,r){t&1&&E(0,"router-outlet")},dependencies:[Fe]});let i=n;return i})();var wd=[{path:"",component:bi,children:[{path:"",component:vi},{path:"current",component:_i},{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{wd as EVENTS_ROUTES}; diff --git a/public/apps/webapp-schulverwaltung/chunk-7LCBKZQT.js b/public/apps/webapp-schulverwaltung/chunk-7LCBKZQT.js deleted file mode 100644 index 2e8ddcb6..00000000 --- a/public/apps/webapp-schulverwaltung/chunk-7LCBKZQT.js +++ /dev/null @@ -1,2 +0,0 @@ -import{a as Te}from"./chunk-Y4QYVF5K.js";import{a as ye}from"./chunk-HII3S2DL.js";import{b as _e,c as Ge,d as we}from"./chunk-RFO4NYUO.js";import{b as Ee}from"./chunk-FTDG26ID.js";import{a as Tt,b as dt}from"./chunk-SOHFFTKU.js";import{A as yt,a as he,b as Ie,c as be,d as Se,e as ve,p as xe,q as Ce,u as Ct}from"./chunk-C56YGDXA.js";import{$,$a as v,$c as St,Ab as g,Ac as a,Bb as b,Bc as R,C as $t,Cb as K,Cd as ot,Db as Zt,Dd as z,Eb as nt,Ec as E,Fc as C,Fd as xt,G as Xt,Ga as T,Gb as te,Gc as bt,Gd as k,Hd as j,Ia as m,Ic as Ot,J as Jt,Ja as Rt,L as Dt,Mc as o,O as G,Ob as ee,Q as Mt,Rb as rt,Rc as at,Sa as p,Sb as F,Ta as l,Tc as re,Ua as et,Va as ft,Vb as H,Vc as q,W as O,Wa as ht,Wb as ie,Xb as ne,Ya as it,Yc as se,Z as y,_a as A,_c as Ft,a as L,b as U,c as Wt,ca as Y,cb as It,cd as ae,dc as st,dd as oe,e as mt,f as N,fd as de,g as pt,ga as W,ha as Z,hd as le,ia as tt,ib as V,jb as u,k as Pt,kb as w,kd as pe,l as Kt,lb as x,ld as ce,m as I,md as ue,n as ct,nd as me,od as ge,r as gt,ra as Qt,rd as vt,sd as fe,tb as M,ua as d,v as qt,va as D,vb as Yt,w as zt,zc as c}from"./chunk-XTHSYQMN.js";function si(i,e){if(i&1&&(p(0,"option",3),u(1),g(2,"translate"),l()),i&2){let r=v();m("ngValue",null),d(),x(" ",b(2,2,r.emptyLabel)," ")}}function ai(i,e){if(i&1&&(p(0,"option",3),u(1),l()),i&2){let r=e.$implicit;m("ngValue",r),d(),x(" ",r.Value," ")}}var Pe=(()=>{let e=class e{constructor(){this.options=[],this.allowEmpty=!0,this.emptyLabel="",this.value=null,this.disabled=!1,this.tabindex=0,this.valueChange=new Qt,this.options$=new N([]),this.rawValue$=new N(null),this.value$=ct([this.rawValue$,this.options$]).pipe(I(([t,n])=>n&&n.find(s=>s.Key===t)||null))}ngOnChanges(t){t.value&&this.rawValue$.next(t.value.currentValue),t.options&&this.options$.next(t.options.currentValue)}};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=$({type:e,selectors:[["bkd-select"]],inputs:{options:"options",allowEmpty:"allowEmpty",emptyLabel:"emptyLabel",value:"value",disabled:"disabled",tabindex:"tabindex"},outputs:{valueChange:"valueChange"},standalone:!0,features:[W,M],decls:5,vars:7,consts:[[1,"form-select",3,"ngModelChange","tabindex","disabled","ngModel"],[3,"ngValue",4,"ngIf"],[3,"ngValue",4,"ngFor","ngForOf"],[3,"ngValue"]],template:function(n,s){n&1&&(p(0,"select",0),g(1,"async"),A("ngModelChange",function(_){return s.valueChange.emit(_&&_.Key)}),T(2,si,3,4,"option",1)(3,ai,2,2,"option",2),u(4,` > -`),l()),n&2&&(It("tabindex",s.tabindex),m("disabled",s.disabled)("ngModel",b(1,5,s.value$)),d(2),m("ngIf",s.allowEmpty),d(),m("ngForOf",s.options))},dependencies:[vt,ce,ue,pe,St,oe,F,rt,H,j,k],changeDetection:0});let i=e;return i})();var $e=C({Id:a,Designation:c,StudentCount:a,Number:c});var kt=C({Id:c,TestId:a,CourseRegistrationId:a,GradeId:o(a),GradeValue:o(a),GradeDesignation:o(c),Points:o(a),StudentId:a});var De=C({Id:a,CourseId:a,Date:at,Designation:c,Weight:a,WeightPercent:a,IsPointGrading:R,MaxPoints:o(a),MaxPointsAdjusted:o(a),IsPublished:R,IsOwner:R,Owner:o(c),GradingScaleId:o(a),Results:o(E(kt))});var Me=C({Id:a}),Re=bt({HRef:o(c)}),oi=bt({HasEvaluationStarted:R,EvaluationUntil:o(at),HasReviewOfEvaluationStarted:R,HasTestGrading:R,Id:a}),di=Ot([Me,Re,oi]),li=bt({Id:a,StudentCount:a}),pi=Ot([Me,Re,li]),ci=C({Grade:c,AverageTestResult:a,Id:a,StudentId:a}),jt=C({AverageTestResult:a,CanGrade:R,EventId:a,GradeId:o(a),GradeValue:o(a),Id:a,StudentId:a}),lt=C({HRef:c,Id:a,Number:c,Designation:c,DateFrom:o(at),DateTo:o(at),StatusId:a,GradingScaleId:o(a),FinalGrades:o(E(ci)),Gradings:o(E(jt)),Tests:o(E(De)),EvaluationStatusRef:di,AttendanceRef:pi,ParticipatingStudents:o(E(Ge)),Classes:o(E($e))}),Oe=C({TestResults:E(kt),Gradings:E(jt)}),Fe=C({Gradings:E(jt)});var _t=(()=>{let e=class e extends dt{constructor(t,n){super(t,n,lt,"Courses"),this.statusCodec=C(re(this.codec.props,["Id","StatusId","EvaluationStatusRef"]))}getNumberOfCoursesForRating(){return this.http.get(`${this.baseUrl}/?expand=EvaluationStatusRef&fields=Id,StatusId,EvaluationStatusRef&filter.StatusId=;10300;10240`,{headers:{"X-Role-Restriction":"TeacherRole"}}).pipe(G(z(this.statusCodec)),I(t=>t.filter(n=>n.EvaluationStatusRef.HasEvaluationStarted===!0)),I(t=>t.length))}getExpandedCourses(t){return Te(t,"TeacherRole")?this.http.get(`${this.baseUrl}/?expand=EvaluationStatusRef,AttendanceRef,Classes,FinalGrades&filter.StatusId=;${this.settings.eventlist.statusfilter}`,{headers:{"X-Role-Restriction":"TeacherRole"}}).pipe(G(z(lt))):Pt([])}getExpandedCourse(t){return this.http.get(`${this.baseUrl}/${t}?expand=ParticipatingStudents,EvaluationStatusRef,Tests,Gradings,FinalGrades,Classes`).pipe(G(ot(lt)))}getExpandedCoursesForDossier(){return this.http.get(`${this.baseUrl}/?expand=Tests,Gradings,FinalGrades,EvaluationStatusRef,ParticipatingStudents,Classes&filter.StatusId=;${this.settings.eventlist.statusfilter}`).pipe(G(z(lt)))}getExpandedCoursesForStudent(){return this.http.get(`${this.baseUrl}/?expand=Tests,Gradings,FinalGrades&filter.StatusId=;${this.settings.eventlist.statusfilter}`,{headers:{"X-Role-Restriction":"StudentRole"}}).pipe(G(z(lt)))}add(t,n,s,f,_,B,h){let S={Tests:[{Date:n,Designation:s,Weight:f,IsPointGrading:_,MaxPoints:B,MaxPointsAdjusted:h}]};return this.http.put(`${this.baseUrl}/${t}/Tests/New`,S).pipe(I(()=>{}))}update(t,n,s,f,_,B,h,S){let Q={Tests:[{Id:n,Designation:s,Date:f,Weight:_,IsPointGrading:B,MaxPoints:h,MaxPointsAdjusted:S}]};return this.http.put(`${this.baseUrl}/${t}/Tests/Update`,Q).pipe(I(()=>{}))}delete(t,n){let s={TestIds:[n]};return this.http.put(`${this.baseUrl}/${t}/Tests/Delete`,s).pipe(I(()=>n))}updateTestResult(t,n){let S=n,{studentId:s,testId:f}=S,_=Wt(S,["studentId","testId"]),B={StudentIds:[s],TestId:f},h="gradeId"in _?U(L({},B),{GradeId:_.gradeId}):U(L({},B),{Points:_.points});return this.http.put(`${this.baseUrl}/${t}/SetTestResult`,h).pipe(G(ot(Oe)),G(({TestResults:Q,Gradings:Ut})=>Q.length<=1&&Ut.length===1?Pt({courseId:t,testResult:Q[0]??null,grading:Ut[0]}):Kt(()=>new Error("`TestResults` or `Gradings` does not contain a single value"))))}setAverageAsFinalGrade(t){return this.http.put(`${this.baseUrl}/SetAverageTestResult`,t).pipe(G(ot(Fe)))}publishTest(t){let n={TestIds:[t]};return this.http.put(`${this.baseUrl}/PublishTest`,n).pipe(I(()=>t))}unpublishTest(t){let n={TestIds:[t]};return this.http.put(`${this.baseUrl}/UnpublishTest`,n).pipe(I(()=>t))}};e.\u0275fac=function(n){return new(n||e)(y(st),y(q))},e.\u0275prov=O({token:e,factory:e.\u0275fac,providedIn:"root"});let i=e;return i})();function Be(i){return i.length===0?0:Bt(i.map(({value:e,weight:r})=>e*r))/Bt(i.map(({weight:e})=>e))}function Nt(i){return i.length===0?0:Number(Bt(i)/i.length)}function Bt(i){return i.reduce(ui,0)}function ui(i,e){return i+e}function Sn(i,e,r){return i?i.Tests?.reduce((t,n)=>t||n.Id===e&&n.Results?.find(s=>s.TestId===e&&s.StudentId===r)||null,null)??null:null}function vn(i,e,r){return e.map(t=>t.Id===i.TestId?Vt(i,t,r):t)}function xn(i,e,r){return r.map(t=>t.Id===i?mi(e,t):t)}function Cn(i,e){return e.map(r=>r.Id===i?U(L({},r),{IsPublished:!r.IsPublished}):r)}function yn(i){let e=fi(i);if(e.length===0)throw new Error("unable to calculate averages without results");return Nt(e)}function At(i){return i.MaxPointsAdjusted||i.MaxPoints}function Tn(i){let e=gi(i);if(e.length===0)throw new Error("unable to calculate averages without results");return Nt(e)}function J(i,e){return e.Results?.find(r=>r.StudentId===i)}function _n(i,e){return e===null?null:e.filter(r=>r.Id!==i)}function Vt(i,e,r){let t=r&&e.Results?.find(s=>s.TestId===i.TestId&&s.StudentId===i.StudentId),n=e.Results?.filter(s=>!(s.TestId===i.TestId&&s.StudentId===i.StudentId))||[];return t&&r==="grade"?i.GradeId=t.GradeId:t&&r==="points"&&(i.Points=t.Points),U(L({},e),{Results:[...n,i]})}function Ae(i){return i.slice().sort((e,r)=>r.Date.getTime()-e.Date.getTime())}function Gt(i,e){return e?.find(r=>r.Id===i.GradingScaleId)||null}function mi(i,e){return U(L({},e),{Results:e.Results?.filter(r=>r.StudentId!==i)||[]})}function gi(i){return i.Results?.filter(e=>e.GradeDesignation!==null).map(e=>Number(e.GradeDesignation)).filter(e=>!isNaN(e))||[]}function fi(i){return i.Results?.map(e=>e.Points!==null?e.Points:Ne).filter(e=>e>Ne)||[]}var Ne=-1;var Ht=C({Id:c,SubscriptionId:a,VssId:a,EventId:a,DropdownItems:o(E(ye)),IdPerson:a,ShowAsRadioButtons:R,Value:o(c)}),Ve=C({Id:a,CurrentWorkProgressId:o(c||o(a)),EventId:o(a),PersonId:o(a),Status:c,StatusId:o(a),IsOkay:o(R),IsQueued:o(R),EventDesignation:o(c),EventInformation:o(c||a),EventNotes:o(c||a),CheckPersonalInformation:o(R),CorrespondencePersonId:o(a),CorrespondenceAddressTypeId:o(c||a),Billing1PersonId:o(a),Billing1AddressTypeId:o(c||a),Billing2PersonId:o(c||a),Billing2AddressTypeId:o(c||a),KindOfPaymentId1:o(c||a),KindOfPaymentEmail1:o(c||a),KindOfPaymentId2:o(c||a),KindOfPaymentEmail2:o(c||a),IdObject:o(a),IdSubscription:o(a),IdStatus:o(a),AnsweredQuestions:o(c||a),Messages:o(c||a),SubscriptionDetails:o(E(Ht)),HRef:o(c)});var He=(()=>{let e=class e extends dt{constructor(t,n){super(t,n,Ht,"Subscriptions")}getIdSubscriptionsByStudentAndCourse(t,n){return this.http.get(`${this.settings.apiUrl}/Subscriptions/?filter.PersonId==${t}&filter.EventId=;${n}`).pipe(G(z(Ve)))}};e.\u0275fac=function(n){return new(n||e)(y(st),y(q))},e.\u0275prov=O({token:e,factory:e.\u0275fac,providedIn:"root"});let i=e;return i})();var Ii=C({Id:a,Designation:c}),Lt=C({Id:a,Grades:E(Ii)});var Le=(()=>{let e=class e extends dt{constructor(t,n){super(t,n,Lt,"GradingScales")}getGradingScale(t){return this.http.get(`${this.baseUrl}/${t}`).pipe(G(ot(Lt)))}getGradingScales(t){return gt(t.map(this.getGradingScale.bind(this)))}};e.\u0275fac=function(n){return new(n||e)(y(st),y(q))},e.\u0275prov=O({token:e,factory:e.\u0275fac,providedIn:"root"});let i=e;return i})();var Et=(()=>{let e=class e{constructor(t,n,s,f,_,B){this.coursesRestService=t,this.subscriptionRestService=n,this.reportsService=s,this.loadingService=f,this.gradingScalesRestService=_,this.settings=B,this.studentId$=new pt(1),this.initialStudentCourses$=this.studentId$.pipe(Xt(),G(this.loadCourses.bind(this)),I(h=>h.sort((S,Q)=>S.Designation.localeCompare(Q.Designation))),Dt(1)),this.action$=new pt(1),this.studentCourses$=qt(this.action$,this.initialStudentCourses$.pipe(I(h=>({type:"initializeCourses",payload:h})))).pipe(Jt(this.coursesReducer.bind(this),[]),Dt(1)),this.loading$=this.loadingService.loading$,this.studentCourseIds$=this.studentCourses$.pipe(I(h=>h.flatMap(S=>S.Id))),this.idSubscriptions$=ct([this.studentId$,this.studentCourseIds$]).pipe(G(([h,S])=>this.subscriptionRestService.getIdSubscriptionsByStudentAndCourse(h,S))),this.ids$=this.idSubscriptions$.pipe(I(h=>h.map(S=>S.Id))),this.testReports$=this.ids$.pipe(I(h=>this.reportsService.getTeacherSubscriptionReports(h))),this.tests$=this.studentCourses$.pipe(I(h=>h.flatMap(S=>S.Tests).filter(Ct))),this.gradingScaleIdsFromTests$=this.tests$.pipe(I(h=>[...h.map(S=>S.GradingScaleId)].filter(Ct).filter(yt))),this.gradingScaleIdsFromCourses$=this.studentCourses$.pipe(I(h=>h.flatMap(S=>S.GradingScaleId).filter(Ct).filter(yt))),this.gradingScaleIds$=ct([this.gradingScaleIdsFromCourses$,this.gradingScaleIdsFromTests$]).pipe(I(([h,S])=>h.concat(S).filter(yt))),this.gradingScales$=this.gradingScaleIds$.pipe(G(h=>gt(h.map(S=>this.gradingScalesRestService.getGradingScale(S)))))}setStudentId(t){this.studentId$.next(t)}getFinalGradeForStudent(t,n){return t?.FinalGrades?.find(s=>s.StudentId===n)}getGradingForStudent(t,n){return t?.Gradings?.find(s=>s.StudentId===n)}getGradingScaleOfCourse(t,n){return n?.find(s=>s.Id===t.GradingScaleId)}getGradesForStudent(t,n,s){return t.Tests?.flatMap(f=>({value:Number(Gt(f,s)?.Grades.find(B=>B.Id===J(n,f)?.GradeId)?.Designation),weight:f.Weight})).filter(({value:f})=>!!f)||[]}updateStudentCourses(t){this.action$.next({type:"updateCourses",payload:t})}loadCourses(t){return this.loadingService.load(this.coursesRestService.getExpandedCoursesForDossier().pipe(I(n=>n.filter(s=>s.ParticipatingStudents?.find(f=>f.Id===t)))))}coursesReducer(t,n){switch(n.type){case"initializeCourses":return n.payload;case"updateCourses":return this.updateCourses([...t],n.payload);default:return t}}updateCourses(t,n){return t.map(s=>U(L({},s),{Tests:s.Tests!==null?s.Tests.map(f=>f.Id===n.Id?n:f):null}))}};e.\u0275fac=function(n){return new(n||e)(y(_t),y(He),y(we),y(Ee),y(Le),y(q))},e.\u0275prov=O({token:e,factory:e.\u0275fac});let i=e;return i})();var We=(()=>{let e=class e{constructor(){}get inIframe(){return window.parent!==window}get window(){return this.inIframe?window.parent:null}get document(){return this.window?.document.documentElement??null}querySelector(t){return this.window?.document?.querySelector("bkd-portal")?.shadowRoot?.querySelector(t)??null}getIframeElement(){return this.querySelector("bkd-content")?.shadowRoot?.querySelector("iframe")??null}getIframeTop(){return this.getIframeElement()?.offsetTop??0}getIFrameBottom(){let t=this.getIframeElement();return t?t.offsetTop+t.offsetHeight:0}};e.\u0275fac=function(n){return new(n||e)},e.\u0275prov=O({token:e,factory:e.\u0275fac,providedIn:"root"});let i=e;return i})();var Ke=(()=>{let e=class e{constructor(t,n){this.modal=t,this.portal=n}open(...t){let n=this.modal.open(...t);return this.applyPortalOffsetAndMaxHeight(n),this.disablePortalScrolling(n),n}get activeInstances(){return this.modal.activeInstances}dismissAll(...t){return this.modal.dismissAll(...t)}hasOpenModals(...t){return this.modal.hasOpenModals(...t)}applyPortalOffsetAndMaxHeight(t){let n=this.getModalWindowElement(t);if(!n){console.warn("Trying to apply portal offset to , but element is not present!");return}this.portal.window&&(n.style.top=`${this.getModalIframeOffset()}px`,n.style.maxHeight=`${this.getModalHeight()}px`)}disablePortalScrolling(t){if(this.portal.window&&this.portal.document){let n=this.portal.window.innerWidth-this.portal.document.clientWidth;this.portal.document.style.paddingRight=`${n}px`,this.portal.document.style.overflow="hidden"}t.hidden.subscribe(()=>{this.portal.document&&(this.portal.document.style.paddingRight="0px",this.portal.document.style.overflow="auto")})}getModalWindowElement(t){return t._windowCmptRef?.instance?._elRef?.nativeElement??null}getModalIframeOffset(){return Math.max(this.getViewportTop()-this.portal.getIframeTop(),0)}getModalTop(){return Math.max(this.getViewportTop(),this.portal.getIframeTop())}getModalBottom(){return Math.min(this.getViewportBottom(),this.portal.getIFrameBottom())}getModalHeight(){return this.getModalBottom()-this.getModalTop()}getViewportTop(){return this.portal.window?.scrollY??0}getViewportBottom(){return this.getViewportTop()+this.getViewportHeight()}getViewportHeight(){return this.portal.window?.innerHeight??0}};e.\u0275fac=function(n){return new(n||e)(y(Ce),y(We))},e.\u0275prov=O({token:e,factory:e.\u0275fac,providedIn:"root"});let i=e;return i})();function wt(i,e,r){return e?e.Grade:Ci(i,r)||i?.GradeValue}function Ci(i,e){return e?.Grades.find(r=>r.Id===i?.GradeId)?.Designation}var yi="1-3",ze="\u2013",Xe=(()=>{let e=class e{constructor(t){this.locale=t}transform(t,n,s){let f=Number(t??null);return isNaN(f)?ze:Ti(Number(t??null),s??this.locale,n)}};e.\u0275fac=function(n){return new(n||e)(D(te,16))},e.\u0275pipe=Y({name:"decimalOrDash",type:e,pure:!0,standalone:!0});let i=e;return i})();function Ti(i,e,r){return i===0?ze:ee(i,e,`1.${_i(r)}`)}function _i(i){return i?String(i).includes("-")?String(i):`${i}-${i}`:yi}var Je=(()=>{let e=class e{constructor(){}getGradeForStudent(){return wt(this.grading,this.finalGrade,this.gradingScale)}};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=$({type:e,selectors:[["bkd-dossier-grades-final-grade"]],inputs:{finalGrade:"finalGrade",grading:"grading",gradingScale:"gradingScale",average:"average"},standalone:!0,features:[M],decls:14,vars:11,consts:[[1,"final-entry"],["data-testid","final-grade"],["data-testid","average-test-results"]],template:function(n,s){n&1&&(p(0,"div",0)(1,"div"),u(2),g(3,"translate"),l(),p(4,"div",1)(5,"span"),u(6),l()(),p(7,"div"),u(8),g(9,"translate"),l(),p(10,"div",2)(11,"span"),u(12),g(13,"decimalOrDash"),l()()()),n&2&&(d(2),w(b(3,4,"dossier.grade")),d(4),w(s.getGradeForStudent()||"\u2013"),d(2),w(b(9,6,"dossier.average")),d(4),w(K(13,8,s.average,"1-3")))},dependencies:[j,k,Xe],styles:[".final-entry[_ngcontent-%COMP%]{padding:1rem;display:grid;grid-template-columns:repeat(2,1fr)}span[_ngcontent-%COMP%]{margin-left:2em}"]});let i=e;return i})();var Qe=(()=>{let e=class e{constructor(t){this.translate=t}transform(t,n,s,f="tests.points"){return t.IsPointGrading&&(t.IsPublished||s)?`${J(n,t)?.Points||"\u2013"} / ${t.MaxPointsAdjusted||t.MaxPoints} ${this.translate.instant(f)}`:""}};e.\u0275fac=function(n){return new(n||e)(D(xt,16))},e.\u0275pipe=Y({name:"bkdTestPoints",type:e,pure:!0,standalone:!0});let i=e;return i})();var Ye=(()=>{let e=class e{constructor(t){this.translate=t}transform(t){return`${this.translate.instant("tests.factor")} ${t.Weight} (${t.WeightPercent}%)`}};e.\u0275fac=function(n){return new(n||e)(D(xt,16))},e.\u0275pipe=Y({name:"bkdTestWeight",type:e,pure:!0,standalone:!0});let i=e;return i})();var Gi=i=>({maxPoints:i});function Ei(i,e){if(i&1&&(p(0,"div",15),u(1),g(2,"translate"),l()),i&2){let r=v(2);d(),x(" ",K(2,1,"global.validation-errors.invalidPoints",Yt(4,Gi,r.maxPoints))," ")}}function wi(i,e){if(i&1){let r=it();p(0,"div",11)(1,"label",12),u(2),g(3,"translate"),l(),p(4,"div",6)(5,"input",13,0),A("input",function(){Z(r);let n=V(6),s=v();return tt(s.onPointsChange(n.value))}),l()(),T(7,Ei,3,6,"div",14),l()}if(i&2){let r=v();d(2),w(b(3,8,"dossier.dialog.points")),d(2),Rt("is-invalid",r.pointsInput.errors),d(),Rt("is-invalid",r.pointsInput.errors),It("max",r.maxPoints),m("formControl",r.pointsInput),d(2),m("ngIf",r.pointsInput.errors)}}var Ze=500,ti=(()=>{let e=class e{constructor(t,n){this.activeModal=t,this.courseService=n,this.maxPoints=0,this.gradeSubject$=new mt,this.pointsSubject$=new mt,this.closeButtonDisabled$=new N(!1),this.gradingScaleDisabled$=new N(!0),this.grade$=this.gradeSubject$.pipe($t(Ze)),this.points$=this.pointsSubject$.pipe($t(Ze),zt(this.isValid.bind(this)),I(Number)),this.destroy$=new mt}ngOnInit(){this.maxPoints=At(this.test),this.pointsInput=new ae({value:this.points,disabled:!1},[Ft.min(0),Ft.pattern("[0-9]+([\\.][0-9]+)?"),this.maxPointValidator()]),this.gradingScaleDisabled$.next(this.test.IsPointGrading&&this.points>0),this.points$.pipe(Mt(this.destroy$)).subscribe(t=>this.updateTestResult({studentId:this.studentId,testId:this.test.Id,points:t})),this.grade$.pipe(Mt(this.destroy$)).subscribe(t=>this.updateTestResult({studentId:this.studentId,testId:this.test.Id,gradeId:t}))}onGradeChange(t){this.gradeSubject$.next(t)}onPointsChange(t){this.pointsSubject$.next(t),this.gradingScaleDisabled$.next(t.length>0)}updateTestResult(t){this.closeButtonDisabled$.next(!0),this.courseService.updateTestResult(this.test.CourseId,t).subscribe(({testResult:n})=>{this.gradeId=n?.GradeId??null,this.updatedTestResult=n,this.closeButtonDisabled$.next(!1)})}isValid(t){return t===""||isNaN(Number(t))?!1:!(Number(t)<0||Number(t)>this.maxPoints)}maxPointValidator(){return t=>Number(t.value)>At(this.test)?{customMax:!0}:null}};e.\u0275fac=function(n){return new(n||e)(D(xe),D(_t))},e.\u0275cmp=$({type:e,selectors:[["bkd-dossier-grades-edit"]],inputs:{test:"test",gradeId:"gradeId",gradeOptions:"gradeOptions",points:"points",studentId:"studentId"},standalone:!0,features:[M],decls:19,vars:20,consts:[["pointInput",""],[1,"modal-body"],[1,"mb-4"],["class","form-group row",4,"ngIf"],[1,"form-group","row","mt-2"],["for","grade",1,"col-6","col-form-label"],[1,"col-6"],["id","grade",3,"valueChange","options","value","allowEmpty","disabled"],[1,"text-muted","mt-4"],[1,"modal-footer"],["type","button",1,"btn","btn-primary",3,"click","disabled"],[1,"form-group","row"],["for","points",1,"col-6","col-form-label"],["id","points","type","number","step","0.01","min","0",1,"form-control",3,"input","max","formControl"],["class","invalid-feedback col-6 offset-6","data-testid","validation-error-message",4,"ngIf"],["data-testid","validation-error-message",1,"invalid-feedback","col-6","offset-6"]],template:function(n,s){n&1&&(p(0,"div",1)(1,"p",2),u(2),l(),T(3,wi,8,10,"div",3),p(4,"div",4)(5,"label",5),u(6),g(7,"translate"),l(),p(8,"div",6)(9,"bkd-select",7),g(10,"async"),A("valueChange",function(_){return _&&s.onGradeChange(_)}),l()()(),p(11,"p",8),u(12),g(13,"translate"),l()(),p(14,"div",9)(15,"button",10),g(16,"async"),A("click",function(){return s.activeModal.close(s.updatedTestResult)}),u(17),g(18,"translate"),l()()),n&2&&(d(2),w(s.test.Designation),d(),m("ngIf",s.test.IsPointGrading),d(3),w(b(7,10,"dossier.dialog.grade")),d(3),m("options",s.gradeOptions)("value",s.gradeId)("allowEmpty",!1)("disabled",b(10,12,s.gradingScaleDisabled$)),d(3),x(" ",b(13,14,s.test.IsPointGrading?"dossier.dialog.hint.points":"dossier.dialog.hint.grade")," "),d(3),m("disabled",b(16,16,s.closeButtonDisabled$)),d(2),x(" ",b(18,18,"dossier.dialog.close")," "))},dependencies:[F,vt,se,de,St,ge,me,fe,le,Pe,H,j,k]});let i=e;return i})();function Pi(i,e){if(i&1){let r=it();p(0,"a",11),A("click",function(){Z(r);let n=v().bkdLet,s=v();return tt(s.editGrading(n))}),p(1,"i",12),u(2,"edit"),l(),p(3,"span",13),u(4),g(5,"async"),l()()}if(i&2){let r=v(2);d(4),w(b(5,1,r.grading$))}}function $i(i,e){if(i&1&&(p(0,"span",13),u(1),g(2,"async"),l()),i&2){let r=v(2);d(),w(b(2,1,r.grading$))}}function Di(i,e){if(i&1&&(p(0,"div",14),u(1),g(2,"translate"),l()),i&2){let r=v().bkdLet;d(),x(" ",b(2,1,r.IsPublished?"tests.published":"tests.not-published")," ")}}function Mi(i,e){if(i&1&&(p(0,"div",2)(1,"div",3),u(2),l(),p(3,"div",4),u(4),g(5,"date"),l(),p(6,"div",5),T(7,Pi,6,3,"a",6)(8,$i,3,3,"ng-template",null,0,nt),l(),p(10,"div",7),u(11),g(12,"bkdTestWeight"),l(),p(13,"div",8)(14,"span"),u(15),g(16,"bkdTestPoints"),l()(),p(17,"div",9),u(18),l(),T(19,Di,3,3,"div",10),l()),i&2){let r=e.bkdLet,t=V(9),n=v();d(2),x(" ",r.Designation," "),d(2),x(" ",K(5,8,r.Date,"dd.MM.yyyy")," "),d(3),m("ngIf",n.isEditable&&r.IsOwner)("ngIfElse",t),d(4),x(" ",b(12,11,r)," "),d(4),w(Zt(16,13,r,n.studentId,n.isEditable,"dossier.points")),d(3),x(" ",r.Owner," "),d(),m("ngIf",n.isEditable)}}var ei=(()=>{let e=class e{constructor(t,n){this.gradeService=t,this.modalService=n,this.test$=new pt(1),this.grading$=this.test$.pipe(I(this.getGrading.bind(this)))}ngOnChanges(t){t.test&&this.test$.next(this.test)}editGrading(t){let n=this.modalService.open(ti,{backdrop:"static"});n.componentInstance.test=t,n.componentInstance.gradeId=this.getGradeId(t),n.componentInstance.gradeOptions=e.mapToOptions(this.gradingScale),n.componentInstance.studentId=this.studentId,n.componentInstance.points=this.getPoints(t),n.result.then(s=>{s&&this.updateStudentGrade(s,t)},()=>{})}updateStudentGrade(t,n){let s=Vt(t,n);this.gradeService.updateStudentCourses(s)}getGrading(t){return this.gradingScale?.Grades.find(n=>n.Id===this.getGradeId(t))?.Designation||"\u2013"}getGradeId(t){return J(this.studentId,t)?.GradeId||null}getPoints(t){return J(this.studentId,t)?.Points||null}static mapToOptions(t){return t?.Grades.map(n=>({Key:n.Id,Value:n.Designation}))||null}};e.\u0275fac=function(n){return new(n||e)(D(Et),D(Ke))},e.\u0275cmp=$({type:e,selectors:[["bkd-dossier-single-test"]],inputs:{test:"test",studentId:"studentId",gradingScale:"gradingScale",isEditable:"isEditable"},standalone:!0,features:[W,M],decls:2,vars:3,consts:[["notEditable",""],["class","test-entry",4,"bkdLet"],[1,"test-entry"],["data-testid","test-designation",1,"designation"],["data-testid","test-date",1,"date"],[1,"grade"],["class","btn btn-link","aria-label","edit grade",3,"click",4,"ngIf","ngIfElse"],["data-testid","test-factor",1,"factor"],["data-testid","test-points",1,"points"],["data-testid","test-teacher",1,"teacher"],["class","state","data-testid","test-status",4,"ngIf"],["aria-label","edit grade",1,"btn","btn-link",3,"click"],["data-testid","test-grade-edit-icon",1,"material-icons"],["data-testid","test-grade"],["data-testid","test-status",1,"state"]],template:function(n,s){n&1&&(T(0,Mi,20,18,"div",1),g(1,"async")),n&2&&m("bkdLet",b(1,1,s.test$))},dependencies:[Tt,F,H,ie,j,k,Qe,Ye],styles:['.test-entry[_ngcontent-%COMP%]{border-top:1px solid #dee2e6;padding:1rem;display:grid;grid-template-areas:"designation designation grade factor" "date date points ." "teacher teacher . ." "state state . .";grid-template-columns:repeat(4,1fr)}span[_ngcontent-%COMP%]{margin-left:2em}.designation[_ngcontent-%COMP%]{grid-area:designation}.date[_ngcontent-%COMP%]{grid-area:date}.grade[_ngcontent-%COMP%]{grid-area:grade}.grade[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{display:flex;color:#000;padding:0;text-decoration:none}.grade[_ngcontent-%COMP%] a[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{text-decoration:underline}.grade[_ngcontent-%COMP%] a[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:hover{text-decoration-color:#ea161f}.grade[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{margin-right:-1em;color:#00000080}.points[_ngcontent-%COMP%]{grid-area:points;color:#00000080}.teacher[_ngcontent-%COMP%]{grid-area:teacher}.state[_ngcontent-%COMP%]{grid-area:state}@media (max-width: 575.98px){.test-entry[_ngcontent-%COMP%]{grid-template-areas:"designation designation" "date grade" "factor points" "teacher teacher" "state state";grid-template-columns:repeat(2,1fr)}}']});let i=e;return i})();function Ri(i,e){if(i&1&&et(0,"bkd-dossier-single-test",5),i&2){let r=e.$implicit,t=v(3);m("test",r)("studentId",t.studentId)("gradingScale",t.getGradingScaleOfTest(r))("isEditable",t.isEditable)}}function Oi(i,e){if(i&1&&(p(0,"div"),et(1,"bkd-dossier-grades-final-grade",3),T(2,Ri,1,4,"bkd-dossier-single-test",4),l()),i&2){let r=v().bkdLet,t=v();d(),m("finalGrade",t.decoratedCourse.finalGrade)("grading",t.decoratedCourse.grading)("gradingScale",t.decoratedCourse.gradingScale)("average",t.decoratedCourse.average),d(),m("ngForOf",r)}}function Fi(i,e){i&1&&(p(0,"p",6),u(1),g(2,"translate"),l()),i&2&&(d(),x(" ",b(2,1,"dossier.no-tests")," "))}function ki(i,e){if(i&1&&(ft(0),T(1,Oi,3,5,"div",2)(2,Fi,3,3,"ng-template",null,0,nt),ht()),i&2){let r=e.bkdLet,t=V(3);d(),m("ngIf",r.length>0)("ngIfElse",t)}}var ii=(()=>{let e=class e{ngOnChanges(t){t.decoratedCourse&&this.sortedTests$.next(this.sortedTests())}constructor(){this.sortedTests$=new N([])}sortedTests(){return this.decoratedCourse.course.Tests?Ae(this.decoratedCourse.course.Tests):[]}getGradingScaleOfTest(t){return Gt(t,this.gradingScales)}};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=$({type:e,selectors:[["bkd-dossier-course-tests"]],inputs:{studentId:"studentId",decoratedCourse:"decoratedCourse",gradingScales:"gradingScales",isEditable:"isEditable"},standalone:!0,features:[W,M],decls:2,vars:3,consts:[["noTests",""],[4,"bkdLet"],[4,"ngIf","ngIfElse"],[3,"finalGrade","grading","gradingScale","average"],[3,"test","studentId","gradingScale","isEditable",4,"ngFor","ngForOf"],[3,"test","studentId","gradingScale","isEditable"],["data-testid","message-no-tests",1,"p-3"]],template:function(n,s){n&1&&(T(0,ki,4,2,"ng-container",1),g(1,"async")),n&2&&m("bkdLet",b(1,1,s.sortedTests$))},dependencies:[Tt,F,Je,rt,ei,H,j,k]});let i=e;return i})();function ji(i,e){if(i&1&&(p(0,"span",2),u(1),l()),i&2){let r=v();d(),x(" (",r.grade,")")}}function Bi(i,e){if(i&1&&(p(0,"span",3),u(1),g(2,"number"),l()),i&2){let r=v();d(),x(" (",K(2,1,r.average,"1.1-3"),")")}}var ni=(()=>{let e=class e{constructor(){}get grade(){return this.getGradeForStudent()}getGradeForStudent(){return wt(this.grading,this.finalGrade,this.gradingScale)}};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=$({type:e,selectors:[["bkd-dossier-grades-course-header"]],inputs:{designation:"designation",finalGrade:"finalGrade",grading:"grading",gradingScale:"gradingScale",average:"average"},standalone:!0,features:[M],decls:3,vars:3,consts:[["class","grade","data-testId","grade",4,"ngIf"],["class","average","data-testId","average",4,"ngIf"],["data-testId","grade",1,"grade"],["data-testId","average",1,"average"]],template:function(n,s){n&1&&(u(0),T(1,ji,2,1,"span",0)(2,Bi,3,4,"span",1)),n&2&&(w(s.designation),d(),m("ngIf",s.grade),d(),m("ngIf",!s.grade&&s.average))},dependencies:[F,ne],styles:[".average[_ngcontent-%COMP%]{color:#00000080}"]});let i=e;return i})();function Ni(i,e){if(i&1&&et(0,"bkd-dossier-course-tests",11),i&2){let r=v().$implicit,t=v(2);m("decoratedCourse",r)("studentId",t.studentId)("gradingScales",t.gradingScales)("isEditable",t.isEditable)}}function Ai(i,e){if(i&1){let r=it();p(0,"div")(1,"div",4)(2,"div",5,1)(4,"div",6)(5,"bkd-student-dossier-entry-header",7),A("click",function(){Z(r);let n=V(3);return tt(n.toggle())}),et(6,"bkd-dossier-grades-course-header",8),l()(),p(7,"div",9)(8,"div",10),T(9,Ni,1,4,"ng-template"),l()()()()()}if(i&2){let r=e.$implicit,t=V(3);d(5),m("opened",!t.collapsed),d(),m("designation",r.course.Designation)("finalGrade",r.finalGrade)("grading",r.grading)("gradingScale",r.gradingScale)("average",r.average)}}function Vi(i,e){if(i&1&&(ft(0),T(1,Ai,10,6,"div",3),g(2,"async"),ht()),i&2){let r=v();d(),m("ngForOf",b(2,2,r.decoratedCoursesSubject$))("ngForTrackBy",r.trackByCourseId)}}function Hi(i,e){i&1&&(p(0,"p",12),u(1),g(2,"translate"),l()),i&2&&(d(),x(" ",b(2,1,"dossier.no-courses")," "))}var Hr=(()=>{let e=class e{constructor(t){this.dossierGradeService=t,this.isEditable=!0,this.decoratedCoursesSubject$=new N([])}ngOnChanges(){this.decoratedCoursesSubject$.next(this.decorateCourses())}trackByCourseId(t,n){return n.course.Id}decorateCourses(){return this.courses?.map(t=>{let n=this.dossierGradeService.getFinalGradeForStudent(t,this.studentId),s=this.dossierGradeService.getGradesForStudent(t,this.studentId,this.gradingScales);return{course:t,finalGrade:n,grading:this.dossierGradeService.getGradingForStudent(t,this.studentId),gradingScale:this.dossierGradeService.getGradingScaleOfCourse(t,this.gradingScales),average:n?.AverageTestResult||Be(s)}})}};e.\u0275fac=function(n){return new(n||e)(D(Et))},e.\u0275cmp=$({type:e,selectors:[["bkd-dossier-grades-view"]],inputs:{courses:"courses",studentId:"studentId",gradingScales:"gradingScales",isEditable:"isEditable"},standalone:!0,features:[W,M],decls:3,vars:2,consts:[["noCourses",""],["courses","ngbAccordionItem"],[4,"ngIf","ngIfElse"],[4,"ngFor","ngForOf","ngForTrackBy"],["ngbAccordion",""],["ngbAccordionItem",""],["ngbAccordionHeader",""],[3,"click","opened"],[3,"designation","finalGrade","grading","gradingScale","average"],["ngbAccordionCollapse",""],["ngbAccordionBody",""],[3,"decoratedCourse","studentId","gradingScales","isEditable"],["data-testid","message-no-courses",1,"py-3"]],template:function(n,s){if(n&1&&T(0,Vi,3,4,"ng-container",2)(1,Hi,3,3,"ng-template",null,0,nt),n&2){let f,_=V(2);m("ngIf",((f=s.courses==null?null:s.courses.length)!==null&&f!==void 0?f:0)>0)("ngIfElse",_)}},dependencies:[F,rt,ve,Se,be,_e,ni,Ie,he,ii,H,j,k]});let i=e;return i})();export{Nt as a,Sn as b,vn as c,xn as d,Cn as e,yn as f,Tn as g,_n as h,Ae as i,ze as j,Xe as k,Ti as l,Pe as m,$e as n,jt as o,_t as p,Ht as q,He as r,Le as s,Et as t,We as u,Ke as v,Hr as w}; diff --git a/public/apps/webapp-schulverwaltung/chunk-ON6N652E.js b/public/apps/webapp-schulverwaltung/chunk-ELVM3VWW.js similarity index 98% rename from public/apps/webapp-schulverwaltung/chunk-ON6N652E.js rename to public/apps/webapp-schulverwaltung/chunk-ELVM3VWW.js index b1ec364e..e4ae1360 100644 --- a/public/apps/webapp-schulverwaltung/chunk-ON6N652E.js +++ b/public/apps/webapp-schulverwaltung/chunk-ELVM3VWW.js @@ -1 +1 @@ -import{a as Ee,b as ke,c as Ie}from"./chunk-SOH5T2AJ.js";import{a as ye}from"./chunk-NYTDIO5P.js";import{a as Te}from"./chunk-GD4YO4IV.js";import{a as be}from"./chunk-GXZYLK4L.js";import"./chunk-U4HODSW3.js";import"./chunk-7LCBKZQT.js";import"./chunk-PSXDSPKS.js";import{b as pe,e as O}from"./chunk-C7XT5XXE.js";import"./chunk-YMJC6QZX.js";import"./chunk-Y4QYVF5K.js";import"./chunk-HII3S2DL.js";import{a as Ce,b as Se}from"./chunk-UP3NEN2H.js";import{a as he}from"./chunk-DZZC2YX2.js";import{a as xe}from"./chunk-XLPJMZ3E.js";import{c as fe}from"./chunk-24AFRN2G.js";import{d as ge}from"./chunk-RFO4NYUO.js";import"./chunk-5RDJZAUT.js";import"./chunk-DB66EACG.js";import{P as de,T as _e}from"./chunk-ZK2MNT7Z.js";import"./chunk-AW7CSGKI.js";import{a as me,b as ve}from"./chunk-FTDG26ID.js";import{a as ce,c as ue}from"./chunk-SOHFFTKU.js";import{s as le}from"./chunk-C56YGDXA.js";import"./chunk-UX5TA32W.js";import{$ as E,$a as _,Ab as p,Bb as d,E as q,Eb as L,Ga as v,Gd as j,Ha as J,Hd as M,Ia as c,L as U,Mb as Z,O as N,Q as G,Qb as ee,Rb as te,Sa as s,Sb as ne,Ta as l,Ua as x,Va as F,Vb as ie,Vc as se,W as X,Wa as w,Ya as A,Z as S,_a as y,ha as I,ia as T,ib as P,jb as u,kb as h,lb as g,m as W,oc as ae,pb as R,pc as re,qb as B,ra as z,rb as $,rc as oe,sb as K,tb as k,ua as o,ub as Q,va as f,vb as V,xb as Y}from"./chunk-XTHSYQMN.js";var Ae=(()=>{let n=class n{constructor(t,i,r){this.studentsService=t,this.educationalEventsService=i,this.studyClassesService=r,this.filter={student:null,educationalEvent:null,studyClass:null},this.filterChange=new z,this.classesHttpFilter={params:{fields:"IsActive","filter.IsActive":"=true"}}}show(){this.filterChange.emit(this.filter)}};n.\u0275fac=function(i){return new(i||n)(f(fe),f(Ie),f(Te))},n.\u0275cmp=E({type:n,selectors:[["bkd-evaluate-absences-header"]],inputs:{filter:"filter"},outputs:{filterChange:"filterChange"},standalone:!0,features:[k],decls:20,vars:19,consts:[[1,"row","g-3","align-items-end"],[1,"col-sm-12","col-md"],[1,"form-label"],[3,"valueChange","typeaheadService","value"],[3,"valueChange","typeaheadService","value","additionalHttpParams"],[1,"col-auto"],["type","button",1,"btn","btn-primary",3,"click"]],template:function(i,r){i&1&&(s(0,"div",0)(1,"div",1)(2,"label",2),u(3),p(4,"translate"),l(),s(5,"bkd-typeahead",3),$("valueChange",function(m){return B(r.filter.student,m)||(r.filter.student=m),m}),l()(),s(6,"div",1)(7,"label",2),u(8),p(9,"translate"),l(),s(10,"bkd-typeahead",3),$("valueChange",function(m){return B(r.filter.educationalEvent,m)||(r.filter.educationalEvent=m),m}),l()(),s(11,"div",1)(12,"label",2),u(13),p(14,"translate"),l(),s(15,"bkd-typeahead",4),$("valueChange",function(m){return B(r.filter.studyClass,m)||(r.filter.studyClass=m),m}),l()(),s(16,"div",5)(17,"button",6),y("click",function(){return r.show()}),u(18),p(19,"translate"),l()()()),i&2&&(o(3),h(d(4,11,"evaluate-absences.header.student")),o(2),c("typeaheadService",r.studentsService),R("value",r.filter.student),o(3),h(d(9,13,"evaluate-absences.header.module-instance")),o(2),c("typeaheadService",r.educationalEventsService),R("value",r.filter.educationalEvent),o(3),h(d(14,15,"evaluate-absences.header.study-class")),o(2),c("typeaheadService",r.studyClassesService),R("value",r.filter.studyClass),c("additionalHttpParams",r.classesHttpFilter),o(3),g(" ",d(19,17,"evaluate-absences.header.show")," "))},dependencies:[ye,M,j],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;padding:1rem 1rem 1rem 0;border-bottom:1px solid #dee2e6}"],changeDetection:0});let e=n;return e})();var C=(()=>{let n=class n extends Se{constructor(t,i,r,b,m){super(t,i,m,r,"/evaluate-absences"),this.lessonPresenceService=b,this.queryParamsString$.pipe(G(this.destroy$)).subscribe(D=>this.confirmBackLinkParams={returnparams:D})}updateAfterConfirm(){this.resetEntries()}getInitialFilter(){return{student:null,educationalEvent:null,studyClass:null}}isValidFilter(t){return!!(t.student||t.educationalEvent||t.studyClass)}getInitialSorting(){return{key:"StudentFullName",ascending:!0}}loadEntries(t,i,r){return this.loadingService.load(this.lessonPresenceService.getStatistics(t,i,r),Ce)}buildParamsFromFilter(t){return Ee(t)}};n.\u0275fac=function(i){return new(i||n)(S(Z),S(ve),S(se),S(O),S(xe))},n.\u0275prov=X({token:n,factory:n.\u0275fac});let e=n;return e})();var Be=(e,n,a)=>({entries:e,hasMore:n,loadingPage:a}),$e=()=>[],je=e=>["student",e,"absences"],Me=e=>({returnparams:e});function Oe(e,n){if(e&1){let a=A();s(0,"th",16),y("click",function(){let i=I(a).$implicit,r=_(5);return T(r.state.sortService.toggleSorting(i.key))}),s(1,"div",17)(2,"div",18),p(3,"translate"),u(4),p(5,"translate"),l(),s(6,"div",19),u(7),p(8,"async"),l()()()}if(e&2){let a=n.$implicit,t=_(5);c("ngClass",a.label),o(2),c("ngbTooltip",d(3,4,"evaluate-absences.list.header."+a.label)),o(2),g(" ",d(5,6,"evaluate-absences.list.header."+a.label)," "),o(3),g(" ",d(8,8,t.state.sortService.getSortingChar$(a.key))," ")}}function De(e,n){if(e&1&&(s(0,"a",22),p(1,"async"),u(2),l()),e&2){let a=_().$implicit,t=_().$implicit,i=_(6);c("routerLink",V(5,je,t.StudentRef.Id))("queryParams",V(7,Me,d(1,3,i.profileReturnParams$))),o(2),g(" ",t[a.key]," ")}}function Ne(e,n){if(e&1&&u(0),e&2){let a=_().$implicit,t=_().$implicit;g(" ",t[a.key]," ")}}function Ve(e,n){if(e&1&&(s(0,"td"),p(1,"translate"),v(2,De,3,9,"a",21)(3,Ne,1,1,"ng-template",null,3,L),l()),e&2){let a=n.$implicit,t=P(4);J("data-label",d(1,3,"evaluate-absences.list.header."+a.label)),o(2),c("ngIf",a.key==="StudentFullName")("ngIfElse",t)}}function He(e,n){if(e&1&&(s(0,"tr"),v(1,Ve,5,5,"td",20),l()),e&2){let a=_(6);o(),c("ngForOf",a.columns)}}function We(e,n){if(e&1&&(s(0,"tbody"),v(1,He,2,1,"tr",20),l()),e&2){let a=_(4).bkdLet;o(),c("ngForOf",a.entries)}}function qe(e,n){e&1&&x(0,"bkd-spinner",23)}function Ue(e,n){if(e&1){let a=A();s(0,"button",24),y("click",function(){I(a);let i=_(5);return T(i.state.nextPage())}),u(1),p(2,"translate"),l()}e&2&&(o(),g(" ",d(2,1,"global.pagination.load-more")," "))}function Ge(e,n){if(e&1){let a=A();s(0,"div",8)(1,"div",9),x(2,"bkd-reports-link",10),p(3,"async"),l(),s(4,"table",11),y("scrolled",function(){I(a);let i=_(4);return T(i.onScroll())}),s(5,"thead")(6,"tr"),v(7,Oe,9,10,"th",12),l()(),v(8,We,2,1,"tbody",13),l(),v(9,qe,1,0,"bkd-spinner",14)(10,Ue,3,3,"button",15),l()}if(e&2){let a,t=_(3).bkdLet,i=_();o(2),c("reports",(a=d(3,5,i.reports$))!==null&&a!==void 0?a:Q(7,$e)),o(5),c("ngForOf",i.columns),o(),c("ngIf",t.entries&&t.entries.length>0),o(),c("ngIf",t.loadingPage),o(),c("ngIf",t.hasMore&&!t.loadingPage)}}function Xe(e,n){e&1&&(s(0,"p",25),u(1),p(2,"translate"),l()),e&2&&(o(),g(" ",d(2,1,"evaluate-absences.no-entries")," "))}function ze(e,n){if(e&1&&(F(0),v(1,Ge,11,8,"div",7)(2,Xe,3,3,"ng-template",null,2,L),w()),e&2){let a=P(3),t=_(2).bkdLet;o(),c("ngIf",t.entries&&t.entries.length>0||t.loadingPage)("ngIfElse",a)}}function Je(e,n){e&1&&x(0,"bkd-spinner")}function Ke(e,n){if(e&1&&(F(0),v(1,ze,4,2,"ng-container",6),p(2,"async"),v(3,Je,1,0,"ng-template",null,1,L),w()),e&2){let a=P(4),t=_(2);o(),c("ngIf",d(2,2,t.state.loading$)===!1)("ngIfElse",a)}}function Qe(e,n){e&1&&(s(0,"p",25),u(1),p(2,"translate"),l()),e&2&&(o(),h(d(2,1,"evaluate-absences.no-filter")))}function Ye(e,n){if(e&1){let a=A();F(0),s(1,"bkd-evaluate-absences-header",5),p(2,"async"),y("filterChange",function(i){I(a);let r=_();return T(r.state.setFilter(i))}),l(),v(3,Ke,5,4,"ng-container",6),p(4,"async"),v(5,Qe,3,3,"ng-template",null,0,L),w()}if(e&2){let a=P(6),t=_();o(),c("filter",d(2,3,t.filterFromParams$)),o(2),c("ngIf",d(4,5,t.state.isFilterValid$))("ngIfElse",a)}}var Le=(()=>{let n=class n{constructor(t,i,r,b,m,D){this.state=t,this.scrollPosition=i,this.route=r,this.presenceTypesService=b,this.reportsService=m,this.lessonPresencesService=D,this.reports$=this.loadReports(),this.columns=[{key:"StudentFullName",label:"student"},{key:"TotalAbsences",label:"total"},{key:"TotalAbsencesValidExcuse",label:"valid-excuse"},{key:"TotalAbsencesWithoutExcuse",label:"without-excuse"},{key:"TotalAbsencesUnconfirmed",label:"unconfirmed"},{key:"TotalAbsencesUnchecked",label:"unchecked"},{key:"TotalIncidents",label:"incident"}],this.filterFromParams$=this.route.queryParams.pipe(W(Ze)),this.profileReturnParams$=this.state.queryParamsString$}ngOnInit(){this.filterFromParams$.pipe(q(1)).subscribe(t=>this.state.setFilter(t)),this.presenceTypesService.halfDayActive$.subscribe(t=>{t&&(this.columns=[...this.columns,{key:"TotalHalfDays",label:"halfday"}])})}ngAfterViewInit(){this.scrollPosition.restore()}onScroll(){this.state.nextPage()}loadReports(){return this.state.validFilter$.pipe(N(t=>this.lessonPresencesService.getLessonRefs(t)),N(t=>t.length>0?this.reportsService.getEvaluateAbsencesReports(this.getReportRecordIds(t)):[]),U(1))}getReportRecordIds(t){return t.map(i=>`${i.LessonRef.Id}_${i.RegistrationRef.Id}`)}};n.\u0275fac=function(i){return new(i||n)(f(C),f(he),f(ae),f(_e),f(ge),f(O))},n.\u0275cmp=E({type:n,selectors:[["bkd-evaluate-absences-list"]],standalone:!0,features:[k],decls:7,vars:14,consts:[["noFilter",""],["loading",""],["noEntries",""],["noLink",""],[4,"bkdLet"],[3,"filterChange","filter"],[4,"ngIf","ngIfElse"],["class","py-3",4,"ngIf","ngIfElse"],[1,"py-3"],[1,"buttons"],[1,"mb-2",3,"reports"],["infiniteScroll","",1,"table","table-striped","table-fixed",3,"scrolled"],["scope","col",3,"ngClass","click",4,"ngFor","ngForOf"],[4,"ngIf"],["class","inline",4,"ngIf"],["type","button","class","btn btn-outline-secondary btn-sm d-block mx-auto",3,"click",4,"ngIf"],["scope","col",3,"click","ngClass"],[1,"d-flex"],[1,"column-title",3,"ngbTooltip"],[1,"sort-direction"],[4,"ngFor","ngForOf"],["class","student",3,"routerLink","queryParams",4,"ngIf","ngIfElse"],[1,"student",3,"routerLink","queryParams"],[1,"inline"],["type","button",1,"btn","btn-outline-secondary","btn-sm","d-block","mx-auto",3,"click"],[1,"mt-3"]],template:function(i,r){i&1&&(s(0,"h1"),u(1),p(2,"translate"),l(),v(3,Ye,7,7,"ng-container",4),p(4,"async"),p(5,"async"),p(6,"async")),i&2&&(o(),h(d(2,2,"evaluate-absences.title")),o(2),c("bkdLet",Y(10,Be,d(4,4,r.state.entries$),d(5,6,r.state.hasMore$),d(6,8,r.state.loadingPage$))))},dependencies:[ce,Ae,ne,me,ke,te,ee,le,oe,ue,ie,M,j],styles:["th[_ngcontent-%COMP%]{cursor:pointer}th.student[_ngcontent-%COMP%]{width:30%}.column-title[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.buttons[_ngcontent-%COMP%]{display:flex;justify-content:flex-end}"],changeDetection:0});let e=n;return e})();function Ze(e){return{student:e.student?Number(e.student):null,educationalEvent:e.educationalEvent?Number(e.educationalEvent):null,studyClass:e.studyClass?Number(e.studyClass):null}}var Fe=(()=>{let n=class n{constructor(t){this.state=t}};n.\u0275fac=function(i){return new(i||n)(f(C))},n.\u0275cmp=E({type:n,selectors:[["bkd-evaluate-absences"]],standalone:!0,features:[K([C,{provide:pe,useExisting:C},de]),k],decls:1,vars:0,template:function(i,r){i&1&&x(0,"router-outlet")},dependencies:[re],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0});let e=n;return e})();var Vt=[{path:"",component:Fe,children:[{path:"",component:Le,data:{restoreScrollPositionFrom:["/evaluate-absences/student/:id"]}},be]}];export{Vt as EVALUATE_ABSENCES_ROUTES}; +import{a as Ee,b as ke,c as Ie}from"./chunk-SOH5T2AJ.js";import{a as ye}from"./chunk-NYTDIO5P.js";import{a as Te}from"./chunk-4EXGKTN3.js";import{a as be}from"./chunk-JV3CBBGP.js";import"./chunk-U4HODSW3.js";import"./chunk-W7ASLXRM.js";import"./chunk-PSXDSPKS.js";import{b as pe,e as O}from"./chunk-C7XT5XXE.js";import"./chunk-YMJC6QZX.js";import"./chunk-Y4QYVF5K.js";import"./chunk-HII3S2DL.js";import{a as Ce,b as Se}from"./chunk-UP3NEN2H.js";import{a as he}from"./chunk-DZZC2YX2.js";import{a as xe}from"./chunk-XLPJMZ3E.js";import{c as fe}from"./chunk-24AFRN2G.js";import{d as ge}from"./chunk-RFO4NYUO.js";import"./chunk-5RDJZAUT.js";import"./chunk-DB66EACG.js";import{P as de,T as _e}from"./chunk-ZK2MNT7Z.js";import"./chunk-AW7CSGKI.js";import{a as me,b as ve}from"./chunk-FTDG26ID.js";import{a as ce,c as ue}from"./chunk-SOHFFTKU.js";import{s as le}from"./chunk-C56YGDXA.js";import"./chunk-UX5TA32W.js";import{$ as E,$a as _,Ab as p,Bb as d,E as q,Eb as L,Ga as v,Gd as j,Ha as J,Hd as M,Ia as c,L as U,Mb as Z,O as N,Q as G,Qb as ee,Rb as te,Sa as s,Sb as ne,Ta as l,Ua as x,Va as F,Vb as ie,Vc as se,W as X,Wa as w,Ya as A,Z as S,_a as y,ha as I,ia as T,ib as P,jb as u,kb as h,lb as g,m as W,oc as ae,pb as R,pc as re,qb as B,ra as z,rb as $,rc as oe,sb as K,tb as k,ua as o,ub as Q,va as f,vb as V,xb as Y}from"./chunk-XTHSYQMN.js";var Ae=(()=>{let n=class n{constructor(t,i,r){this.studentsService=t,this.educationalEventsService=i,this.studyClassesService=r,this.filter={student:null,educationalEvent:null,studyClass:null},this.filterChange=new z,this.classesHttpFilter={params:{fields:"IsActive","filter.IsActive":"=true"}}}show(){this.filterChange.emit(this.filter)}};n.\u0275fac=function(i){return new(i||n)(f(fe),f(Ie),f(Te))},n.\u0275cmp=E({type:n,selectors:[["bkd-evaluate-absences-header"]],inputs:{filter:"filter"},outputs:{filterChange:"filterChange"},standalone:!0,features:[k],decls:20,vars:19,consts:[[1,"row","g-3","align-items-end"],[1,"col-sm-12","col-md"],[1,"form-label"],[3,"valueChange","typeaheadService","value"],[3,"valueChange","typeaheadService","value","additionalHttpParams"],[1,"col-auto"],["type","button",1,"btn","btn-primary",3,"click"]],template:function(i,r){i&1&&(s(0,"div",0)(1,"div",1)(2,"label",2),u(3),p(4,"translate"),l(),s(5,"bkd-typeahead",3),$("valueChange",function(m){return B(r.filter.student,m)||(r.filter.student=m),m}),l()(),s(6,"div",1)(7,"label",2),u(8),p(9,"translate"),l(),s(10,"bkd-typeahead",3),$("valueChange",function(m){return B(r.filter.educationalEvent,m)||(r.filter.educationalEvent=m),m}),l()(),s(11,"div",1)(12,"label",2),u(13),p(14,"translate"),l(),s(15,"bkd-typeahead",4),$("valueChange",function(m){return B(r.filter.studyClass,m)||(r.filter.studyClass=m),m}),l()(),s(16,"div",5)(17,"button",6),y("click",function(){return r.show()}),u(18),p(19,"translate"),l()()()),i&2&&(o(3),h(d(4,11,"evaluate-absences.header.student")),o(2),c("typeaheadService",r.studentsService),R("value",r.filter.student),o(3),h(d(9,13,"evaluate-absences.header.module-instance")),o(2),c("typeaheadService",r.educationalEventsService),R("value",r.filter.educationalEvent),o(3),h(d(14,15,"evaluate-absences.header.study-class")),o(2),c("typeaheadService",r.studyClassesService),R("value",r.filter.studyClass),c("additionalHttpParams",r.classesHttpFilter),o(3),g(" ",d(19,17,"evaluate-absences.header.show")," "))},dependencies:[ye,M,j],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;padding:1rem 1rem 1rem 0;border-bottom:1px solid #dee2e6}"],changeDetection:0});let e=n;return e})();var C=(()=>{let n=class n extends Se{constructor(t,i,r,b,m){super(t,i,m,r,"/evaluate-absences"),this.lessonPresenceService=b,this.queryParamsString$.pipe(G(this.destroy$)).subscribe(D=>this.confirmBackLinkParams={returnparams:D})}updateAfterConfirm(){this.resetEntries()}getInitialFilter(){return{student:null,educationalEvent:null,studyClass:null}}isValidFilter(t){return!!(t.student||t.educationalEvent||t.studyClass)}getInitialSorting(){return{key:"StudentFullName",ascending:!0}}loadEntries(t,i,r){return this.loadingService.load(this.lessonPresenceService.getStatistics(t,i,r),Ce)}buildParamsFromFilter(t){return Ee(t)}};n.\u0275fac=function(i){return new(i||n)(S(Z),S(ve),S(se),S(O),S(xe))},n.\u0275prov=X({token:n,factory:n.\u0275fac});let e=n;return e})();var Be=(e,n,a)=>({entries:e,hasMore:n,loadingPage:a}),$e=()=>[],je=e=>["student",e,"absences"],Me=e=>({returnparams:e});function Oe(e,n){if(e&1){let a=A();s(0,"th",16),y("click",function(){let i=I(a).$implicit,r=_(5);return T(r.state.sortService.toggleSorting(i.key))}),s(1,"div",17)(2,"div",18),p(3,"translate"),u(4),p(5,"translate"),l(),s(6,"div",19),u(7),p(8,"async"),l()()()}if(e&2){let a=n.$implicit,t=_(5);c("ngClass",a.label),o(2),c("ngbTooltip",d(3,4,"evaluate-absences.list.header."+a.label)),o(2),g(" ",d(5,6,"evaluate-absences.list.header."+a.label)," "),o(3),g(" ",d(8,8,t.state.sortService.getSortingChar$(a.key))," ")}}function De(e,n){if(e&1&&(s(0,"a",22),p(1,"async"),u(2),l()),e&2){let a=_().$implicit,t=_().$implicit,i=_(6);c("routerLink",V(5,je,t.StudentRef.Id))("queryParams",V(7,Me,d(1,3,i.profileReturnParams$))),o(2),g(" ",t[a.key]," ")}}function Ne(e,n){if(e&1&&u(0),e&2){let a=_().$implicit,t=_().$implicit;g(" ",t[a.key]," ")}}function Ve(e,n){if(e&1&&(s(0,"td"),p(1,"translate"),v(2,De,3,9,"a",21)(3,Ne,1,1,"ng-template",null,3,L),l()),e&2){let a=n.$implicit,t=P(4);J("data-label",d(1,3,"evaluate-absences.list.header."+a.label)),o(2),c("ngIf",a.key==="StudentFullName")("ngIfElse",t)}}function He(e,n){if(e&1&&(s(0,"tr"),v(1,Ve,5,5,"td",20),l()),e&2){let a=_(6);o(),c("ngForOf",a.columns)}}function We(e,n){if(e&1&&(s(0,"tbody"),v(1,He,2,1,"tr",20),l()),e&2){let a=_(4).bkdLet;o(),c("ngForOf",a.entries)}}function qe(e,n){e&1&&x(0,"bkd-spinner",23)}function Ue(e,n){if(e&1){let a=A();s(0,"button",24),y("click",function(){I(a);let i=_(5);return T(i.state.nextPage())}),u(1),p(2,"translate"),l()}e&2&&(o(),g(" ",d(2,1,"global.pagination.load-more")," "))}function Ge(e,n){if(e&1){let a=A();s(0,"div",8)(1,"div",9),x(2,"bkd-reports-link",10),p(3,"async"),l(),s(4,"table",11),y("scrolled",function(){I(a);let i=_(4);return T(i.onScroll())}),s(5,"thead")(6,"tr"),v(7,Oe,9,10,"th",12),l()(),v(8,We,2,1,"tbody",13),l(),v(9,qe,1,0,"bkd-spinner",14)(10,Ue,3,3,"button",15),l()}if(e&2){let a,t=_(3).bkdLet,i=_();o(2),c("reports",(a=d(3,5,i.reports$))!==null&&a!==void 0?a:Q(7,$e)),o(5),c("ngForOf",i.columns),o(),c("ngIf",t.entries&&t.entries.length>0),o(),c("ngIf",t.loadingPage),o(),c("ngIf",t.hasMore&&!t.loadingPage)}}function Xe(e,n){e&1&&(s(0,"p",25),u(1),p(2,"translate"),l()),e&2&&(o(),g(" ",d(2,1,"evaluate-absences.no-entries")," "))}function ze(e,n){if(e&1&&(F(0),v(1,Ge,11,8,"div",7)(2,Xe,3,3,"ng-template",null,2,L),w()),e&2){let a=P(3),t=_(2).bkdLet;o(),c("ngIf",t.entries&&t.entries.length>0||t.loadingPage)("ngIfElse",a)}}function Je(e,n){e&1&&x(0,"bkd-spinner")}function Ke(e,n){if(e&1&&(F(0),v(1,ze,4,2,"ng-container",6),p(2,"async"),v(3,Je,1,0,"ng-template",null,1,L),w()),e&2){let a=P(4),t=_(2);o(),c("ngIf",d(2,2,t.state.loading$)===!1)("ngIfElse",a)}}function Qe(e,n){e&1&&(s(0,"p",25),u(1),p(2,"translate"),l()),e&2&&(o(),h(d(2,1,"evaluate-absences.no-filter")))}function Ye(e,n){if(e&1){let a=A();F(0),s(1,"bkd-evaluate-absences-header",5),p(2,"async"),y("filterChange",function(i){I(a);let r=_();return T(r.state.setFilter(i))}),l(),v(3,Ke,5,4,"ng-container",6),p(4,"async"),v(5,Qe,3,3,"ng-template",null,0,L),w()}if(e&2){let a=P(6),t=_();o(),c("filter",d(2,3,t.filterFromParams$)),o(2),c("ngIf",d(4,5,t.state.isFilterValid$))("ngIfElse",a)}}var Le=(()=>{let n=class n{constructor(t,i,r,b,m,D){this.state=t,this.scrollPosition=i,this.route=r,this.presenceTypesService=b,this.reportsService=m,this.lessonPresencesService=D,this.reports$=this.loadReports(),this.columns=[{key:"StudentFullName",label:"student"},{key:"TotalAbsences",label:"total"},{key:"TotalAbsencesValidExcuse",label:"valid-excuse"},{key:"TotalAbsencesWithoutExcuse",label:"without-excuse"},{key:"TotalAbsencesUnconfirmed",label:"unconfirmed"},{key:"TotalAbsencesUnchecked",label:"unchecked"},{key:"TotalIncidents",label:"incident"}],this.filterFromParams$=this.route.queryParams.pipe(W(Ze)),this.profileReturnParams$=this.state.queryParamsString$}ngOnInit(){this.filterFromParams$.pipe(q(1)).subscribe(t=>this.state.setFilter(t)),this.presenceTypesService.halfDayActive$.subscribe(t=>{t&&(this.columns=[...this.columns,{key:"TotalHalfDays",label:"halfday"}])})}ngAfterViewInit(){this.scrollPosition.restore()}onScroll(){this.state.nextPage()}loadReports(){return this.state.validFilter$.pipe(N(t=>this.lessonPresencesService.getLessonRefs(t)),N(t=>t.length>0?this.reportsService.getEvaluateAbsencesReports(this.getReportRecordIds(t)):[]),U(1))}getReportRecordIds(t){return t.map(i=>`${i.LessonRef.Id}_${i.RegistrationRef.Id}`)}};n.\u0275fac=function(i){return new(i||n)(f(C),f(he),f(ae),f(_e),f(ge),f(O))},n.\u0275cmp=E({type:n,selectors:[["bkd-evaluate-absences-list"]],standalone:!0,features:[k],decls:7,vars:14,consts:[["noFilter",""],["loading",""],["noEntries",""],["noLink",""],[4,"bkdLet"],[3,"filterChange","filter"],[4,"ngIf","ngIfElse"],["class","py-3",4,"ngIf","ngIfElse"],[1,"py-3"],[1,"buttons"],[1,"mb-2",3,"reports"],["infiniteScroll","",1,"table","table-striped","table-fixed",3,"scrolled"],["scope","col",3,"ngClass","click",4,"ngFor","ngForOf"],[4,"ngIf"],["class","inline",4,"ngIf"],["type","button","class","btn btn-outline-secondary btn-sm d-block mx-auto",3,"click",4,"ngIf"],["scope","col",3,"click","ngClass"],[1,"d-flex"],[1,"column-title",3,"ngbTooltip"],[1,"sort-direction"],[4,"ngFor","ngForOf"],["class","student",3,"routerLink","queryParams",4,"ngIf","ngIfElse"],[1,"student",3,"routerLink","queryParams"],[1,"inline"],["type","button",1,"btn","btn-outline-secondary","btn-sm","d-block","mx-auto",3,"click"],[1,"mt-3"]],template:function(i,r){i&1&&(s(0,"h1"),u(1),p(2,"translate"),l(),v(3,Ye,7,7,"ng-container",4),p(4,"async"),p(5,"async"),p(6,"async")),i&2&&(o(),h(d(2,2,"evaluate-absences.title")),o(2),c("bkdLet",Y(10,Be,d(4,4,r.state.entries$),d(5,6,r.state.hasMore$),d(6,8,r.state.loadingPage$))))},dependencies:[ce,Ae,ne,me,ke,te,ee,le,oe,ue,ie,M,j],styles:["th[_ngcontent-%COMP%]{cursor:pointer}th.student[_ngcontent-%COMP%]{width:30%}.column-title[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.buttons[_ngcontent-%COMP%]{display:flex;justify-content:flex-end}"],changeDetection:0});let e=n;return e})();function Ze(e){return{student:e.student?Number(e.student):null,educationalEvent:e.educationalEvent?Number(e.educationalEvent):null,studyClass:e.studyClass?Number(e.studyClass):null}}var Fe=(()=>{let n=class n{constructor(t){this.state=t}};n.\u0275fac=function(i){return new(i||n)(f(C))},n.\u0275cmp=E({type:n,selectors:[["bkd-evaluate-absences"]],standalone:!0,features:[K([C,{provide:pe,useExisting:C},de]),k],decls:1,vars:0,template:function(i,r){i&1&&x(0,"router-outlet")},dependencies:[re],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0});let e=n;return e})();var Vt=[{path:"",component:Fe,children:[{path:"",component:Le,data:{restoreScrollPositionFrom:["/evaluate-absences/student/:id"]}},be]}];export{Vt as EVALUATE_ABSENCES_ROUTES}; diff --git a/public/apps/webapp-schulverwaltung/chunk-EZ6BEJIE.js b/public/apps/webapp-schulverwaltung/chunk-EZ6BEJIE.js new file mode 100644 index 00000000..f6e32ee9 --- /dev/null +++ b/public/apps/webapp-schulverwaltung/chunk-EZ6BEJIE.js @@ -0,0 +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 qt,c as zt,d as Yt,e as Kt,f as We,g as qe,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 ze}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 q,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),q()),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),q()),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:zt(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(z=>(!F.onlyMine||z.IsOwner)&&(!F.hidePublished||!z.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 z=F?.Id||this.UNDEFINED_GRADINGSCALE_ID,we=F?.Grades.map(Me=>({Key:Me.Id,Value:Me.Designation}))||[];return{id:z,options:we}}).reduce((F,z)=>H(B({},F),{[z.id]:z.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=qt(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()()(),q()),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),q()),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(z=>this.courseService.add(z,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(),q()}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(z=>Number(z.get("testId"))),K()),this.test$=te([this.state.tests$,this.testId$]).pipe(b(([z,we])=>z.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(([z,we])=>this.courseService.update(z,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(ze))},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 qn=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,qn,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 zn=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,zn,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,qe)}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(),q()}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;--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 (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}.student-name[_ngcontent-%COMP%]{max-width:var(--student-name-column-width)}}@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}),qi=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,qi,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()(),q()}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,qi,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 zi=(()=>{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,qe)}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(ze))},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;--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 (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}.student-name[_ngcontent-%COMP%]{max-width:var(--student-name-column-width)}}@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%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding-right:0}tbody[_ngcontent-%COMP%] td.student-name[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{text-decoration:none}tbody[_ngcontent-%COMP%] td.student-name[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:first-child{text-decoration:underline}tbody[_ngcontent-%COMP%] td.student-name[_ngcontent-%COMP%] span[_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),q()}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"),q()),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"),q()),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,zi,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/chunk-WMKWXTQE.js b/public/apps/webapp-schulverwaltung/chunk-GTCR4WGM.js similarity index 99% rename from public/apps/webapp-schulverwaltung/chunk-WMKWXTQE.js rename to public/apps/webapp-schulverwaltung/chunk-GTCR4WGM.js index 0db33969..f8664a40 100644 --- a/public/apps/webapp-schulverwaltung/chunk-WMKWXTQE.js +++ b/public/apps/webapp-schulverwaltung/chunk-GTCR4WGM.js @@ -1,2 +1,2 @@ -import{a as Di}from"./chunk-ZROJU7EX.js";import{a as Vi,b as Ni,c as ji}from"./chunk-SOH5T2AJ.js";import{a as ki}from"./chunk-NYTDIO5P.js";import{a as $i}from"./chunk-GD4YO4IV.js";import{a as Ai}from"./chunk-GXZYLK4L.js";import"./chunk-U4HODSW3.js";import"./chunk-7LCBKZQT.js";import"./chunk-PSXDSPKS.js";import{a as hi,b as _i,e as Si}from"./chunk-C7XT5XXE.js";import{a as We}from"./chunk-YMJC6QZX.js";import"./chunk-Y4QYVF5K.js";import"./chunk-HII3S2DL.js";import{a as Ri}from"./chunk-DDSXVC6O.js";import{a as Li,b as Pi}from"./chunk-UP3NEN2H.js";import{a as Bi}from"./chunk-DZZC2YX2.js";import{a as Oi}from"./chunk-K3EEKOGY.js";import{a as Mi}from"./chunk-XLPJMZ3E.js";import{b as xi,c as wi}from"./chunk-24AFRN2G.js";import"./chunk-RFO4NYUO.js";import{a as Ii}from"./chunk-5RDJZAUT.js";import"./chunk-DB66EACG.js";import{L as vi,M as pt,P as Ei,Q as mt,R as ht,S as qe,T as Ue,U as Ci,j as gi,v as bi,w as ut}from"./chunk-ZK2MNT7Z.js";import{a as He,c as dt,e as yi}from"./chunk-AW7CSGKI.js";import{b as Fi}from"./chunk-FTDG26ID.js";import{a as Ge,c as Ti}from"./chunk-SOHFFTKU.js";import{f as li,g as ci,j as di,w as we,y as fi}from"./chunk-C56YGDXA.js";import{a as pi}from"./chunk-UX5TA32W.js";import{$ as j,$a as f,$c as Re,Ab as u,Ac as lt,Ba as Pt,Bb as m,C as It,Cb as ie,Dd as mi,E as ee,Eb as Z,Fa as Le,Fc as zt,Fd as $e,Ga as b,Gd as de,Ha as q,Hb as Mt,Hd as ue,I as xt,Ia as p,Ib as k,Ja as $,Jb as Ie,L as pe,Lb as Nt,Lc as ct,Ma as Xe,Mb as Rt,N as wt,Na as U,O as Se,Q as M,Qa as et,Qb as jt,R as Ft,Ra as tt,Rb as Ee,Sa as c,Sb as Me,Ta as d,Ua as D,Ub as at,V as At,Va as ge,Vb as Ce,Vc as ce,W,Wa as be,Wb as $t,Wc as Qt,X as kt,Xa as it,Xc as Kt,Y as Dt,Ya as V,Yb as Ht,Yc as Yt,Z as R,_a as x,_c as xe,a as _e,aa as Ot,ab as nt,ad as Zt,b as ke,ba as H,bb as st,cb as me,db as rt,dc as Gt,dd as Jt,e as se,eb as G,ed as Xt,f as Ze,fb as he,ga as Te,gb as O,gd as ei,h as Ct,ha as C,hb as B,i as yt,ia as y,ib as N,id as ti,jb as h,jd as ii,k as St,kb as T,kd as ni,la as Bt,lb as E,ld as si,m as S,ma as Je,mb as ve,md as ri,n as De,oc as Ne,pb as z,pc as Wt,qa as re,qb as Q,qc as qt,qd as ai,ra as A,rb as K,rc as Ut,rd as je,s as ye,sb as le,sd as oi,tb as te,ua as l,v as Oe,va as _,vb as Y,w as Be,wb as Vt,xa as I,xb as Pe,yb as Ve,z as Tt,za as Lt,zc as ot,zd as ui}from"./chunk-XTHSYQMN.js";var L=function(i){return i.Absent="absent",i.Dispensation="dispensation",i.HalfDay="half-day",i.Incident="incident",i.Present="present",i}(L||{}),Gi=(()=>{let t=class t{constructor(e,n){this.updateService=e,this.settings=n}update(e,n,r,a,o,g){let v=[];switch(r){case L.Present:v=this.createResetBulkRequests(e);break;case L.Absent:v=this.createAbsentEditBulkRequests(e,n,a,o);break;case L.Dispensation:v=this.createEditBulkRequests(e,null,this.settings.dispensationPresenceTypeId);break;case L.HalfDay:v=this.createEditBulkRequests(e,null,this.settings.halfDayPresenceTypeId);break;case L.Incident:v=this.createEditBulkRequests(e,null,g);break}return De(v).pipe(S(()=>{}))}createAbsentEditBulkRequests(e,n,r,a){return r===this.settings.excusedAbsenceStateId?this.createEditBulkRequests(e,r,a):r===this.settings.unexcusedAbsenceStateId?this.createEditBulkRequests(e,r,this.settings.absencePresenceTypeId):[...this.createEditBulkRequests(e.filter(Hi(n,this.settings)),r,this.settings.absencePresenceTypeId),...this.createEditBulkRequests(e.filter(we(Hi(n,this.settings))),r,null)]}createResetBulkRequests(e){return pt(e).map(({lessonIds:n,personIds:r})=>this.updateService.removeLessonPresences(n,r))}createEditBulkRequests(e,n,r){return pt(e).map(({lessonIds:a,personIds:o})=>this.updateService.editLessonPresences(a,o,r||void 0,n||void 0))}};t.\u0275fac=function(n){return new(n||t)(R(Ci),R(ce))},t.\u0275prov=W({token:t,factory:t.\u0275fac,providedIn:"root"});let i=t;return i})();function Hi(i,t){return s=>{let e=i.find(n=>n.Id===s.TypeRef.Id);return!e||e.Id===t.dispensationPresenceTypeId||e.Id===t.halfDayPresenceTypeId||e.IsIncident}}var X=(()=>{let t=class t extends Pi{constructor(e,n,r,a,o,g,v){super(e,n,r,a,"/edit-absences"),this.lessonPresencesService=o,this.presenceTypesService=g,this.dropDownItemsService=v,this.presenceTypes$=this.loadPresenceTypes().pipe(pe(1)),this.absenceConfirmationStates$=this.loadAbsenceConfirmationStates().pipe(S(hi),pe(1)),this.presenceControlEntries$=De([this.entries$,this.presenceTypes$,this.absenceConfirmationStates$]).pipe(S(yi(Di)),pe(1)),this.selected=[],this.queryParamsString$.pipe(M(this.destroy$)).subscribe(F=>this.confirmBackLinkParams={returnparams:F})}resetSelection(){this.selected=[]}updateAfterConfirm(){this.resetEntries()}getInitialFilter(){return{student:null,educationalEvent:null,studyClass:null,teacher:null,dateFrom:null,dateTo:null,presenceTypes:null,confirmationStates:null,incidentTypes:null}}isValidFilter(e){return!!(e.student||e.educationalEvent||e.studyClass||e.teacher||e.dateFrom||e.dateTo||e.presenceTypes||e.confirmationStates||e.incidentTypes)}loadEntries(e,n,r){let a={sort:"StudentFullName.asc,LessonDateTimeFrom.asc"};return this.loadingService.load(this.lessonPresencesService.getFilteredList(e,r,a),Li)}buildParamsFromFilter(e){return Vi(e)}loadPresenceTypes(){return this.loadingService.load(this.presenceTypesService.activePresenceTypes$)}loadAbsenceConfirmationStates(){return this.loadingService.load(this.dropDownItemsService.getAbsenceConfirmationStates())}};t.\u0275fac=function(n){return new(n||t)(R(Rt),R(Fi),R(Mi),R(ce),R(Si),R(Ue),R(We))},t.\u0275prov=W({token:t,factory:t.\u0275fac});let i=t;return i})();var _n=(i,t,s)=>({confirmationStates:i,categories:t,formGroup:s});function gn(i,t){if(i&1&&(c(0,"div",11),h(1),u(2,"translate"),d()),i&2){let s=t.$implicit;l(),E(" ",ie(2,1,"global.validation-errors."+s.error,s.params)," ")}}function bn(i,t){if(i&1&&(c(0,"option",23),h(1),d()),i&2){let s=t.$implicit;p("ngValue",s.Id),l(),E(" ",s.Designation," ")}}function vn(i,t){if(i&1&&(c(0,"select",22),u(1,"async"),c(2,"option",23),h(3),u(4,"translate"),d(),b(5,bn,2,2,"option",24),u(6,"async"),d()),i&2){let s,e=f(6);$("is-invalid",((s=m(1,5,e.absenceTypeIdErrors$))==null?null:s.length)||!1),l(2),p("ngValue",null),l(),E(" ",m(4,7,"edit-absences.edit.absence-type-placeholder")," "),l(2),p("ngForOf",m(6,9,e.absenceTypes$))}}function En(i,t){if(i&1&&(c(0,"div",25),h(1),u(2,"translate"),d()),i&2){let s=t.$implicit;l(),E(" ",ie(2,1,"global.validation-errors."+s.error,s.params)," ")}}function Cn(i,t){if(i&1&&(c(0,"div",18),D(1,"input",19),c(2,"label",14),h(3),d(),b(4,vn,7,11,"select",20)(5,En,3,4,"div",21),u(6,"async"),d()),i&2){let s=t.$implicit,e=f(5);l(),p("id","state-"+s.Key)("value",s.Key),l(),me("for","state-"+s.Key),l(),E(" ",s.Value," "),l(),p("ngIf",e.isExcused(s)),l(),p("ngForOf",m(6,6,e.absenceTypeIdErrors$))}}function yn(i,t){if(i&1&&(c(0,"div",16),b(1,Cn,7,8,"div",17),d()),i&2){let s=f(3).bkdLet;l(),p("ngForOf",s.confirmationStates)}}function Sn(i,t){if(i&1&&(c(0,"option",23),h(1),d()),i&2){let s=t.$implicit;p("ngValue",s.Id),l(),E(" ",s.Designation," ")}}function Tn(i,t){if(i&1&&(c(0,"div",25),h(1),u(2,"translate"),d()),i&2){let s=t.$implicit;l(),E(" ",ie(2,1,"global.validation-errors."+s.error,s.params)," ")}}function In(i,t){if(i&1&&(c(0,"div",16)(1,"select",26),u(2,"async"),c(3,"option",23),h(4),u(5,"translate"),d(),b(6,Sn,2,2,"option",24),u(7,"async"),d(),b(8,Tn,3,4,"div",21),u(9,"async"),d()),i&2){let s,e=f(4);l(),$("is-invalid",((s=m(2,6,e.incidentIdErrors$))==null?null:s.length)||!1),l(2),p("ngValue",null),l(),E(" ",m(5,8,"edit-absences.edit.incident-placeholder")," "),l(2),p("ngForOf",m(7,10,e.incidents$)),l(2),p("ngForOf",m(9,12,e.incidentIdErrors$))}}function xn(i,t){if(i&1&&(c(0,"div",12),D(1,"input",13),c(2,"label",14),h(3),u(4,"translate"),d(),b(5,yn,2,1,"div",15)(6,In,10,14,"div",15),d()),i&2){let s=t.$implicit,e=f(3);l(),p("id","category-"+s)("value",s),l(),me("for","category-"+s),l(),E(" ",m(4,6,"edit-absences.edit.categories."+s)," "),l(2),p("ngIf",e.isAbsent(s)),l(),p("ngIf",e.isIncident(s))}}function wn(i,t){i&1&&(c(0,"div",27)(1,"span",28),h(2,"Loading..."),d()())}function Fn(i,t){if(i&1){let s=V();c(0,"form",3),x("ngSubmit",function(){C(s);let n=f(2);return y(n.onSubmit())}),b(1,gn,3,4,"div",4),u(2,"async"),c(3,"div",5),b(4,xn,7,8,"div",6),d(),c(5,"div",7)(6,"button",8),u(7,"async"),x("click",function(){C(s);let n=f(2);return y(n.cancel())}),h(8),u(9,"translate"),d(),c(10,"button",9),u(11,"async"),h(12),u(13,"translate"),b(14,wn,3,0,"div",10),u(15,"async"),d()()()}if(i&2){let s=f().bkdLet,e=f();p("formGroup",s.formGroup),l(),p("ngForOf",m(2,8,e.formErrors$)),l(3),p("ngForOf",s.categories),l(2),p("disabled",m(7,10,e.saving$)),l(2),E(" ",m(9,12,"edit-absences.edit.cancel")," "),l(2),p("disabled",m(11,14,e.saving$)),l(2),E(" ",m(13,16,"edit-absences.edit.save")," "),l(2),p("ngIf",m(15,18,e.saving$))}}function An(i,t){if(i&1&&(c(0,"div",1),b(1,Fn,16,20,"form",2),d()),i&2){let s=t.bkdLet;l(),p("ngIf",s.formGroup&&s.confirmationStates)}}var Wi=(()=>{let t=class t{constructor(e,n,r,a,o,g,v,F,P,oe){this.fb=e,this.router=n,this.route=r,this.toastService=a,this.translate=o,this.state=g,this.dropDownItemsService=v,this.presenceTypesService=F,this.updateService=P,this.settings=oe,this.absenceTypes$=this.presenceTypesService.confirmationTypes$,this.incidents$=this.presenceTypesService.incidentTypes$,this.formGroup$=this.createFormGroup(),this.saving$=new Ze(!1),this.submitted$=new Ze(!1),this.formErrors$=He(this.formGroup$,this.submitted$),this.absenceTypeIdErrors$=He(this.formGroup$,this.submitted$,"absenceTypeId"),this.incidentIdErrors$=He(this.formGroup$,this.submitted$,"incidentId"),this.availableCategories=[L.Absent,L.Dispensation,L.HalfDay,L.Incident,L.Present],this.confirmationStates$=this.dropDownItemsService.getAbsenceConfirmationStates().pipe(S(this.sortAbsenceConfirmationStates.bind(this)),pe(1)),this.activeCategories$=this.presenceTypesService.halfDayActive$.pipe(S(J=>J?this.availableCategories:this.availableCategories.filter(fe=>fe!==L.HalfDay))),this.destroy$=new se}ngOnInit(){this.state.selected.length===0&&this.navigateBack(),dt(this.formGroup$,"category").pipe(M(this.destroy$)).subscribe(this.updateConfirmationValueDisabled.bind(this)),dt(this.formGroup$,"confirmationValue").pipe(M(this.destroy$)).subscribe(this.updateAbsenceTypeIdDisabled.bind(this))}ngOnDestroy(){this.destroy$.next()}isAbsent(e){return e===L.Absent}isExcused(e){return e.Key===this.settings.excusedAbsenceStateId}isIncident(e){return e===L.Incident}onSubmit(){this.submitted$.next(!0),this.formGroup$.pipe(ee(1)).subscribe(e=>{e.valid&&this.save(e)})}cancel(){this.navigateBack()}createFormGroup(){return this.getInitialAbsenceTypeId().pipe(S(e=>this.fb.group({category:[L.Absent,xe.required],confirmationValue:[this.settings.excusedAbsenceStateId,xe.required],absenceTypeId:[e,xe.required],incidentId:[{value:null,disabled:!0},xe.required]})),pe(1))}getInitialAbsenceTypeId(){return this.absenceTypes$.pipe(ee(1),S(e=>{let n=e.map(a=>a.Id),r=ui(this.state.selected.map(a=>a.TypeRef.Id));return r.length===1&&r[0]!=null&&n.includes(r[0])?r[0]:null}))}updateConfirmationValueDisabled(){this.formGroup$.pipe(ee(1)).subscribe(e=>{let n=e.get("category"),r=e.get("confirmationValue"),a=e.get("absenceTypeId"),o=e.get("incidentId");n&&r&&a&&o&&(n.value===L.Absent?(r.enable(),this.updateAbsenceTypeIdDisabled()):(r.disable(),a.disable()),n.value===L.Incident?o.enable():o.disable())})}updateAbsenceTypeIdDisabled(){this.formGroup$.pipe(ee(1)).subscribe(e=>{let n=e.get("confirmationValue"),r=e.get("absenceTypeId");n&&r&&(n.value===this.settings.excusedAbsenceStateId?r.enable():r.disable())})}save(e){this.saving$.next(!0);let{category:n,confirmationValue:r,absenceTypeId:a,incidentId:o}=e.value;this.presenceTypesService.presenceTypes$.pipe(Se(g=>this.updateService.update(this.state.selected,g,n,r,a,o)),xt(()=>this.saving$.next(!1))).subscribe(this.onSaveSuccess.bind(this))}onSaveSuccess(){this.state.resetSelection(),this.toastService.success(this.translate.instant("edit-absences.edit.save-success")),this.navigateBack(!0)}navigateBack(e){this.route.queryParams.pipe(ee(1)).subscribe(n=>{this.router.navigate(["/edit-absences"],{queryParams:ke(_e({},Ii(n.returnparams)),{reload:e})})})}sortAbsenceConfirmationStates(e){return e.slice().sort((n,r)=>n.Key===this.settings.excusedAbsenceStateId?-1:r.Key===this.settings.excusedAbsenceStateId?1:n.Value.localeCompare(r.Value))}};t.\u0275fac=function(n){return new(n||t)(_(ai),_(qt),_(Ne),_(pi),_($e),_(X),_(We),_(Ue),_(Gi),_(ce))},t.\u0275cmp=j({type:t,selectors:[["bkd-edit-absences-edit"]],standalone:!0,features:[te],decls:7,vars:14,consts:[["class","bkd-container bkd-container-limited",4,"bkdLet"],[1,"bkd-container","bkd-container-limited"],[3,"formGroup","ngSubmit",4,"ngIf"],[3,"ngSubmit","formGroup"],["class","alert alert-danger",4,"ngFor","ngForOf"],[1,"form-group","pb-4"],["class","form-check mt-2 mb-3",4,"ngFor","ngForOf"],[1,"d-flex","justify-content-end"],["type","button",1,"btn","btn-outline-secondary",3,"click","disabled"],["type","submit",1,"btn","btn-primary","ms-2",3,"disabled"],["class","spinner-border spinner-border-sm align-middle","role","status",4,"ngIf"],[1,"alert","alert-danger"],[1,"form-check","mt-2","mb-3"],["type","radio","formControlName","category",1,"form-check-input",3,"id","value"],[1,"form-check-label",3,"for"],["class","ms-5",4,"ngIf"],[1,"ms-5"],["class","form-check mt-2 mb-2",4,"ngFor","ngForOf"],[1,"form-check","mt-2","mb-2"],["type","radio","formControlName","confirmationValue",1,"form-check-input",3,"id","value"],["class","form-select mt-1","formControlName","absenceTypeId",3,"is-invalid",4,"ngIf"],["class","invalid-feedback",4,"ngFor","ngForOf"],["formControlName","absenceTypeId",1,"form-select","mt-1"],[3,"ngValue"],[3,"ngValue",4,"ngFor","ngForOf"],[1,"invalid-feedback"],["formControlName","incidentId",1,"form-select","mt-1"],["role","status",1,"spinner-border","spinner-border-sm","align-middle"],[1,"visually-hidden"]],template:function(n,r){n&1&&(c(0,"h1"),h(1),u(2,"translate"),d(),b(3,An,2,1,"div",0),u(4,"async"),u(5,"async"),u(6,"async")),n&2&&(l(),T(m(2,2,"edit-absences.title")),l(2),p("bkdLet",Pe(10,_n,m(4,4,r.confirmationStates$),m(5,6,r.activeCategories$),m(6,8,r.formGroup$))))},dependencies:[Ge,Me,je,Xt,si,ri,Yt,ni,ei,Re,Zt,oi,ti,ii,Ee,Ce,ue,de],changeDetection:0});let i=t;return i})();var Qe=(()=>{let t=class t extends vi{};t.\u0275fac=(()=>{let e;return function(r){return(e||(e=Bt(t)))(r||t)}})(),t.\u0275prov=W({token:t,factory:t.\u0275fac});let i=t;return i})();var Dn=["content"],On=["scroll"],Bn=["padding"],zi=["*"],Ae=i=>({searchTerm:i});function Ln(i,t){if(i&1&&(c(0,"div",3),it(1,6),d()),i&2){let s=f();l(),p("ngTemplateOutlet",s.headerTemplate)("ngTemplateOutletContext",Y(2,Ae,s.filterValue))}}function Pn(i,t){if(i&1&&(c(0,"div",5),it(1,6),d()),i&2){let s=f();l(),p("ngTemplateOutlet",s.footerTemplate)("ngTemplateOutletContext",Y(2,Ae,s.filterValue))}}var Vn=["searchInput"],Mn=["clearButton"],Nn=(i,t,s)=>({item:i,clear:t,label:s}),Rn=(i,t)=>({items:i,clear:t}),jn=(i,t,s,e)=>({item:i,item$:t,index:s,searchTerm:e});function $n(i,t){if(i&1){let s=V();c(0,"span",21),x("click",function(){C(s);let n=f().$implicit,r=f(2);return y(r.unselect(n))}),h(1,"\xD7"),d(),D(2,"span",22)}if(i&2){let s=f().$implicit,e=f(2);l(2),p("ngItemLabel",s.label)("escape",e.escapeHTML)}}function Hn(i,t){}function Gn(i,t){if(i&1&&(c(0,"div",20),b(1,$n,3,2,"ng-template",null,1,Z)(3,Hn,0,0,"ng-template",12),d()),i&2){let s=t.$implicit,e=N(2),n=f(2);$("ng-value-disabled",s.disabled),l(3),p("ngTemplateOutlet",n.labelTemplate||e)("ngTemplateOutletContext",Pe(4,Nn,s.value,n.clearItem,s.label))}}function Wn(i,t){if(i&1&&et(0,Gn,4,8,"div",19,Xe().trackByOption,!0),i&2){let s=f();tt(s.selectedItems)}}function qn(i,t){}function Un(i,t){if(i&1&&b(0,qn,0,0,"ng-template",12),i&2){let s=f();p("ngTemplateOutlet",s.multiLabelTemplate)("ngTemplateOutletContext",Vt(2,Rn,s.selectedValues,s.clearItem))}}function zn(i,t){i&1&&D(0,"div",24)}function Qn(i,t){}function Kn(i,t){if(i&1&&b(0,zn,1,0,"ng-template",null,2,Z)(2,Qn,0,0,"ng-template",23),i&2){let s=N(1),e=f();l(2),p("ngTemplateOutlet",e.loadingSpinnerTemplate||s)}}function Yn(i,t){if(i&1&&(c(0,"span",15,3)(2,"span",25),h(3,"\xD7"),d()()),i&2){let s=f();me("title",s.clearAllText)}}function Zn(i,t){if(i&1&&D(0,"span",30),i&2){let s=f().$implicit,e=f(2);p("ngItemLabel",s.label)("escape",e.escapeHTML)}}function Jn(i,t){}function Xn(i,t){if(i&1){let s=V();c(0,"div",29),x("click",function(){let n=C(s).$implicit,r=f(2);return y(r.toggleItem(n))})("mouseover",function(){let n=C(s).$implicit,r=f(2);return y(r.onItemHover(n))}),b(1,Zn,1,2,"ng-template",null,4,Z)(3,Jn,0,0,"ng-template",12),d()}if(i&2){let s=t.$implicit,e=N(2),n=f(2);$("ng-option-disabled",s.disabled)("ng-option-selected",s.selected)("ng-optgroup",s.children)("ng-option",!s.children)("ng-option-child",!!s.parent)("ng-option-marked",s===n.itemsList.markedItem),q("role",s.children?"group":"option")("aria-selected",s.selected)("id",s==null?null:s.htmlId),l(3),p("ngTemplateOutlet",s.children?n.optgroupTemplate||e:n.optionTemplate||e)("ngTemplateOutletContext",Ve(17,jn,s.value,s,s.index,n.searchTerm))}}function es(i,t){if(i&1&&(c(0,"span")(1,"span",32),h(2),d(),h(3),d()),i&2){let s=f(3);l(2),T(s.addTagText),l(),E('"',s.searchTerm,'"')}}function ts(i,t){}function is(i,t){if(i&1){let s=V();c(0,"div",31),x("mouseover",function(){C(s);let n=f(2);return y(n.itemsList.unmarkItem())})("click",function(){C(s);let n=f(2);return y(n.selectTag())}),b(1,es,4,2,"ng-template",null,5,Z)(3,ts,0,0,"ng-template",12),d()}if(i&2){let s=N(2),e=f(2);$("ng-option-marked",!e.itemsList.markedItem),l(3),p("ngTemplateOutlet",e.tagTemplate||s)("ngTemplateOutletContext",Y(4,Ae,e.searchTerm))}}function ns(i,t){if(i&1&&(c(0,"div",33),h(1),d()),i&2){let s=f(3);l(),T(s.notFoundText)}}function ss(i,t){}function rs(i,t){if(i&1&&b(0,ns,2,1,"ng-template",null,6,Z)(2,ss,0,0,"ng-template",12),i&2){let s=N(1),e=f(2);l(2),p("ngTemplateOutlet",e.notFoundTemplate||s)("ngTemplateOutletContext",Y(2,Ae,e.searchTerm))}}function as(i,t){if(i&1&&(c(0,"div",33),h(1),d()),i&2){let s=f(3);l(),T(s.typeToSearchText)}}function os(i,t){}function ls(i,t){if(i&1&&b(0,as,2,1,"ng-template",null,7,Z)(2,os,0,0,"ng-template",23),i&2){let s=N(1),e=f(2);l(2),p("ngTemplateOutlet",e.typeToSearchTemplate||s)}}function cs(i,t){if(i&1&&(c(0,"div",33),h(1),d()),i&2){let s=f(3);l(),T(s.loadingText)}}function ds(i,t){}function us(i,t){if(i&1&&b(0,cs,2,1,"ng-template",null,8,Z)(2,ds,0,0,"ng-template",12),i&2){let s=N(1),e=f(2);l(2),p("ngTemplateOutlet",e.loadingTextTemplate||s)("ngTemplateOutletContext",Y(2,Ae,e.searchTerm))}}function ps(i,t){if(i&1){let s=V();c(0,"ng-dropdown-panel",26),x("update",function(n){C(s);let r=f();return y(r.viewPortItems=n)})("scroll",function(n){C(s);let r=f();return y(r.scroll.emit(n))})("scrollToEnd",function(n){C(s);let r=f();return y(r.scrollToEnd.emit(n))})("outsideClick",function(){C(s);let n=f();return y(n.close())}),ge(1),et(2,Xn,4,22,"div",27,Xe().trackByOption,!0),b(4,is,4,6,"div",28),be(),b(5,rs,3,4)(6,ls,3,1)(7,us,3,4),d()}if(i&2){let s=f();$("ng-select-multiple",s.multiple),p("virtualScroll",s.virtualScroll)("bufferAmount",s.bufferAmount)("appendTo",s.appendTo)("position",s.dropdownPosition)("headerTemplate",s.headerTemplate)("footerTemplate",s.footerTemplate)("filterValue",s.searchTerm)("items",s.itemsList.filteredItems)("markedItem",s.itemsList.markedItem)("ngClass",s.appendTo?s.classes:null)("id",s.dropdownId),l(2),tt(s.viewPortItems),l(2),U(s.showAddTag?4:-1),l(),U(s.showNoItemsFound()?5:-1),l(),U(s.showTypeToSearch()?6:-1),l(),U(s.loading&&s.itemsList.filteredItems.length===0?7:-1)}}var Qi=/[&<>"']/g,ms=RegExp(Qi.source),hs={"&":"&","<":"<",">":">",'"':""","'":"'"};function fs(i){return i&&ms.test(i)?i.replace(Qi,t=>hs[t]):i}function w(i){return i!=null}function Fe(i){return typeof i=="object"&&w(i)}function _s(i){return i instanceof Promise}function Ye(i){return i instanceof Function}var gs=(()=>{let t=class t{constructor(e){this.element=e,this.escape=!0}ngOnChanges(e){this.element.nativeElement.innerHTML=this.escape?fs(this.ngItemLabel):this.ngItemLabel}};t.\u0275fac=function(n){return new(n||t)(_(re))},t.\u0275dir=H({type:t,selectors:[["","ngItemLabel",""]],inputs:{ngItemLabel:"ngItemLabel",escape:"escape"},features:[Te]});let i=t;return i})(),bt=(()=>{let t=class t{constructor(e){this.template=e}};t.\u0275fac=function(n){return new(n||t)(_(I))},t.\u0275dir=H({type:t,selectors:[["","ng-option-tmp",""]]});let i=t;return i})(),vt=(()=>{let t=class t{constructor(e){this.template=e}};t.\u0275fac=function(n){return new(n||t)(_(I))},t.\u0275dir=H({type:t,selectors:[["","ng-optgroup-tmp",""]]});let i=t;return i})(),bs=(()=>{let t=class t{constructor(e){this.template=e}};t.\u0275fac=function(n){return new(n||t)(_(I))},t.\u0275dir=H({type:t,selectors:[["","ng-label-tmp",""]]});let i=t;return i})(),Et=(()=>{let t=class t{constructor(e){this.template=e}};t.\u0275fac=function(n){return new(n||t)(_(I))},t.\u0275dir=H({type:t,selectors:[["","ng-multi-label-tmp",""]]});let i=t;return i})(),vs=(()=>{let t=class t{constructor(e){this.template=e}};t.\u0275fac=function(n){return new(n||t)(_(I))},t.\u0275dir=H({type:t,selectors:[["","ng-header-tmp",""]]});let i=t;return i})(),Es=(()=>{let t=class t{constructor(e){this.template=e}};t.\u0275fac=function(n){return new(n||t)(_(I))},t.\u0275dir=H({type:t,selectors:[["","ng-footer-tmp",""]]});let i=t;return i})(),Cs=(()=>{let t=class t{constructor(e){this.template=e}};t.\u0275fac=function(n){return new(n||t)(_(I))},t.\u0275dir=H({type:t,selectors:[["","ng-notfound-tmp",""]]});let i=t;return i})(),ys=(()=>{let t=class t{constructor(e){this.template=e}};t.\u0275fac=function(n){return new(n||t)(_(I))},t.\u0275dir=H({type:t,selectors:[["","ng-typetosearch-tmp",""]]});let i=t;return i})(),Ss=(()=>{let t=class t{constructor(e){this.template=e}};t.\u0275fac=function(n){return new(n||t)(_(I))},t.\u0275dir=H({type:t,selectors:[["","ng-loadingtext-tmp",""]]});let i=t;return i})(),Ts=(()=>{let t=class t{constructor(e){this.template=e}};t.\u0275fac=function(n){return new(n||t)(_(I))},t.\u0275dir=H({type:t,selectors:[["","ng-tag-tmp",""]]});let i=t;return i})(),Is=(()=>{let t=class t{constructor(e){this.template=e}};t.\u0275fac=function(n){return new(n||t)(_(I))},t.\u0275dir=H({type:t,selectors:[["","ng-loadingspinner-tmp",""]]});let i=t;return i})();function Ki(){return"axxxxxxxxxxx".replace(/[x]/g,()=>(Math.random()*16|0).toString(16))}var xs={"\u24B6":"A",\uFF21:"A",\u00C0:"A",\u00C1:"A",\u00C2:"A",\u1EA6:"A",\u1EA4:"A",\u1EAA:"A",\u1EA8:"A",\u00C3:"A",\u0100:"A",\u0102:"A",\u1EB0:"A",\u1EAE:"A",\u1EB4:"A",\u1EB2:"A",\u0226:"A",\u01E0:"A",\u00C4:"A",\u01DE:"A",\u1EA2:"A",\u00C5:"A",\u01FA:"A",\u01CD:"A",\u0200:"A",\u0202:"A",\u1EA0:"A",\u1EAC:"A",\u1EB6:"A",\u1E00:"A",\u0104:"A","\u023A":"A","\u2C6F":"A","\uA732":"AA",\u00C6:"AE",\u01FC:"AE",\u01E2:"AE","\uA734":"AO","\uA736":"AU","\uA738":"AV","\uA73A":"AV","\uA73C":"AY","\u24B7":"B",\uFF22:"B",\u1E02:"B",\u1E04:"B",\u1E06:"B","\u0243":"B",\u0182:"B",\u0181:"B","\u24B8":"C",\uFF23:"C",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u00C7:"C",\u1E08:"C",\u0187:"C","\u023B":"C","\uA73E":"C","\u24B9":"D",\uFF24:"D",\u1E0A:"D",\u010E:"D",\u1E0C:"D",\u1E10:"D",\u1E12:"D",\u1E0E:"D",\u0110:"D",\u018B:"D",\u018A:"D",\u0189:"D","\uA779":"D",\u01F1:"DZ",\u01C4:"DZ",\u01F2:"Dz",\u01C5:"Dz","\u24BA":"E",\uFF25:"E",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u1EC0:"E",\u1EBE:"E",\u1EC4:"E",\u1EC2:"E",\u1EBC:"E",\u0112:"E",\u1E14:"E",\u1E16:"E",\u0114:"E",\u0116:"E",\u00CB:"E",\u1EBA:"E",\u011A:"E",\u0204:"E",\u0206:"E",\u1EB8:"E",\u1EC6:"E",\u0228:"E",\u1E1C:"E",\u0118:"E",\u1E18:"E",\u1E1A:"E",\u0190:"E",\u018E:"E","\u24BB":"F",\uFF26:"F",\u1E1E:"F",\u0191:"F","\uA77B":"F","\u24BC":"G",\uFF27:"G",\u01F4:"G",\u011C:"G",\u1E20:"G",\u011E:"G",\u0120:"G",\u01E6:"G",\u0122:"G",\u01E4:"G",\u0193:"G","\uA7A0":"G","\uA77D":"G","\uA77E":"G","\u24BD":"H",\uFF28:"H",\u0124:"H",\u1E22:"H",\u1E26:"H",\u021E:"H",\u1E24:"H",\u1E28:"H",\u1E2A:"H",\u0126:"H","\u2C67":"H","\u2C75":"H","\uA78D":"H","\u24BE":"I",\uFF29:"I",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u0128:"I",\u012A:"I",\u012C:"I",\u0130:"I",\u00CF:"I",\u1E2E:"I",\u1EC8:"I",\u01CF:"I",\u0208:"I",\u020A:"I",\u1ECA:"I",\u012E:"I",\u1E2C:"I",\u0197:"I","\u24BF":"J",\uFF2A:"J",\u0134:"J","\u0248":"J","\u24C0":"K",\uFF2B:"K",\u1E30:"K",\u01E8:"K",\u1E32:"K",\u0136:"K",\u1E34:"K",\u0198:"K","\u2C69":"K","\uA740":"K","\uA742":"K","\uA744":"K","\uA7A2":"K","\u24C1":"L",\uFF2C:"L",\u013F:"L",\u0139:"L",\u013D:"L",\u1E36:"L",\u1E38:"L",\u013B:"L",\u1E3C:"L",\u1E3A:"L",\u0141:"L","\u023D":"L","\u2C62":"L","\u2C60":"L","\uA748":"L","\uA746":"L","\uA780":"L",\u01C7:"LJ",\u01C8:"Lj","\u24C2":"M",\uFF2D:"M",\u1E3E:"M",\u1E40:"M",\u1E42:"M","\u2C6E":"M",\u019C:"M","\u24C3":"N",\uFF2E:"N",\u01F8:"N",\u0143:"N",\u00D1:"N",\u1E44:"N",\u0147:"N",\u1E46:"N",\u0145:"N",\u1E4A:"N",\u1E48:"N","\u0220":"N",\u019D:"N","\uA790":"N","\uA7A4":"N",\u01CA:"NJ",\u01CB:"Nj","\u24C4":"O",\uFF2F:"O",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u1ED2:"O",\u1ED0:"O",\u1ED6:"O",\u1ED4:"O",\u00D5:"O",\u1E4C:"O",\u022C:"O",\u1E4E:"O",\u014C:"O",\u1E50:"O",\u1E52:"O",\u014E:"O",\u022E:"O",\u0230:"O",\u00D6:"O",\u022A:"O",\u1ECE:"O",\u0150:"O",\u01D1:"O",\u020C:"O",\u020E:"O",\u01A0:"O",\u1EDC:"O",\u1EDA:"O",\u1EE0:"O",\u1EDE:"O",\u1EE2:"O",\u1ECC:"O",\u1ED8:"O",\u01EA:"O",\u01EC:"O",\u00D8:"O",\u01FE:"O",\u0186:"O",\u019F:"O","\uA74A":"O","\uA74C":"O",\u01A2:"OI","\uA74E":"OO",\u0222:"OU","\u24C5":"P",\uFF30:"P",\u1E54:"P",\u1E56:"P",\u01A4:"P","\u2C63":"P","\uA750":"P","\uA752":"P","\uA754":"P","\u24C6":"Q",\uFF31:"Q","\uA756":"Q","\uA758":"Q","\u024A":"Q","\u24C7":"R",\uFF32:"R",\u0154:"R",\u1E58:"R",\u0158:"R",\u0210:"R",\u0212:"R",\u1E5A:"R",\u1E5C:"R",\u0156:"R",\u1E5E:"R","\u024C":"R","\u2C64":"R","\uA75A":"R","\uA7A6":"R","\uA782":"R","\u24C8":"S",\uFF33:"S","\u1E9E":"S",\u015A:"S",\u1E64:"S",\u015C:"S",\u1E60:"S",\u0160:"S",\u1E66:"S",\u1E62:"S",\u1E68:"S",\u0218:"S",\u015E:"S","\u2C7E":"S","\uA7A8":"S","\uA784":"S","\u24C9":"T",\uFF34:"T",\u1E6A:"T",\u0164:"T",\u1E6C:"T",\u021A:"T",\u0162:"T",\u1E70:"T",\u1E6E:"T",\u0166:"T",\u01AC:"T",\u01AE:"T","\u023E":"T","\uA786":"T","\uA728":"TZ","\u24CA":"U",\uFF35:"U",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u0168:"U",\u1E78:"U",\u016A:"U",\u1E7A:"U",\u016C:"U",\u00DC:"U",\u01DB:"U",\u01D7:"U",\u01D5:"U",\u01D9:"U",\u1EE6:"U",\u016E:"U",\u0170:"U",\u01D3:"U",\u0214:"U",\u0216:"U",\u01AF:"U",\u1EEA:"U",\u1EE8:"U",\u1EEE:"U",\u1EEC:"U",\u1EF0:"U",\u1EE4:"U",\u1E72:"U",\u0172:"U",\u1E76:"U",\u1E74:"U","\u0244":"U","\u24CB":"V",\uFF36:"V",\u1E7C:"V",\u1E7E:"V",\u01B2:"V","\uA75E":"V","\u0245":"V","\uA760":"VY","\u24CC":"W",\uFF37:"W",\u1E80:"W",\u1E82:"W",\u0174:"W",\u1E86:"W",\u1E84:"W",\u1E88:"W","\u2C72":"W","\u24CD":"X",\uFF38:"X",\u1E8A:"X",\u1E8C:"X","\u24CE":"Y",\uFF39:"Y",\u1EF2:"Y",\u00DD:"Y",\u0176:"Y",\u1EF8:"Y",\u0232:"Y",\u1E8E:"Y",\u0178:"Y",\u1EF6:"Y",\u1EF4:"Y",\u01B3:"Y","\u024E":"Y","\u1EFE":"Y","\u24CF":"Z",\uFF3A:"Z",\u0179:"Z",\u1E90:"Z",\u017B:"Z",\u017D:"Z",\u1E92:"Z",\u1E94:"Z",\u01B5:"Z",\u0224:"Z","\u2C7F":"Z","\u2C6B":"Z","\uA762":"Z","\u24D0":"a",\uFF41:"a",\u1E9A:"a",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u1EA7:"a",\u1EA5:"a",\u1EAB:"a",\u1EA9:"a",\u00E3:"a",\u0101:"a",\u0103:"a",\u1EB1:"a",\u1EAF:"a",\u1EB5:"a",\u1EB3:"a",\u0227:"a",\u01E1:"a",\u00E4:"a",\u01DF:"a",\u1EA3:"a",\u00E5:"a",\u01FB:"a",\u01CE:"a",\u0201:"a",\u0203:"a",\u1EA1:"a",\u1EAD:"a",\u1EB7:"a",\u1E01:"a",\u0105:"a","\u2C65":"a",\u0250:"a","\uA733":"aa",\u00E6:"ae",\u01FD:"ae",\u01E3:"ae","\uA735":"ao","\uA737":"au","\uA739":"av","\uA73B":"av","\uA73D":"ay","\u24D1":"b",\uFF42:"b",\u1E03:"b",\u1E05:"b",\u1E07:"b",\u0180:"b",\u0183:"b",\u0253:"b","\u24D2":"c",\uFF43:"c",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u00E7:"c",\u1E09:"c",\u0188:"c","\u023C":"c","\uA73F":"c","\u2184":"c","\u24D3":"d",\uFF44:"d",\u1E0B:"d",\u010F:"d",\u1E0D:"d",\u1E11:"d",\u1E13:"d",\u1E0F:"d",\u0111:"d",\u018C:"d",\u0256:"d",\u0257:"d","\uA77A":"d",\u01F3:"dz",\u01C6:"dz","\u24D4":"e",\uFF45:"e",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u1EC1:"e",\u1EBF:"e",\u1EC5:"e",\u1EC3:"e",\u1EBD:"e",\u0113:"e",\u1E15:"e",\u1E17:"e",\u0115:"e",\u0117:"e",\u00EB:"e",\u1EBB:"e",\u011B:"e",\u0205:"e",\u0207:"e",\u1EB9:"e",\u1EC7:"e",\u0229:"e",\u1E1D:"e",\u0119:"e",\u1E19:"e",\u1E1B:"e","\u0247":"e",\u025B:"e",\u01DD:"e","\u24D5":"f",\uFF46:"f",\u1E1F:"f",\u0192:"f","\uA77C":"f","\u24D6":"g",\uFF47:"g",\u01F5:"g",\u011D:"g",\u1E21:"g",\u011F:"g",\u0121:"g",\u01E7:"g",\u0123:"g",\u01E5:"g",\u0260:"g","\uA7A1":"g","\u1D79":"g","\uA77F":"g","\u24D7":"h",\uFF48:"h",\u0125:"h",\u1E23:"h",\u1E27:"h",\u021F:"h",\u1E25:"h",\u1E29:"h",\u1E2B:"h",\u1E96:"h",\u0127:"h","\u2C68":"h","\u2C76":"h",\u0265:"h",\u0195:"hv","\u24D8":"i",\uFF49:"i",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u0129:"i",\u012B:"i",\u012D:"i",\u00EF:"i",\u1E2F:"i",\u1EC9:"i",\u01D0:"i",\u0209:"i",\u020B:"i",\u1ECB:"i",\u012F:"i",\u1E2D:"i",\u0268:"i",\u0131:"i","\u24D9":"j",\uFF4A:"j",\u0135:"j",\u01F0:"j","\u0249":"j","\u24DA":"k",\uFF4B:"k",\u1E31:"k",\u01E9:"k",\u1E33:"k",\u0137:"k",\u1E35:"k",\u0199:"k","\u2C6A":"k","\uA741":"k","\uA743":"k","\uA745":"k","\uA7A3":"k","\u24DB":"l",\uFF4C:"l",\u0140:"l",\u013A:"l",\u013E:"l",\u1E37:"l",\u1E39:"l",\u013C:"l",\u1E3D:"l",\u1E3B:"l",\u017F:"l",\u0142:"l",\u019A:"l",\u026B:"l","\u2C61":"l","\uA749":"l","\uA781":"l","\uA747":"l",\u01C9:"lj","\u24DC":"m",\uFF4D:"m",\u1E3F:"m",\u1E41:"m",\u1E43:"m",\u0271:"m",\u026F:"m","\u24DD":"n",\uFF4E:"n",\u01F9:"n",\u0144:"n",\u00F1:"n",\u1E45:"n",\u0148:"n",\u1E47:"n",\u0146:"n",\u1E4B:"n",\u1E49:"n",\u019E:"n",\u0272:"n",\u0149:"n","\uA791":"n","\uA7A5":"n",\u01CC:"nj","\u24DE":"o",\uFF4F:"o",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u1ED3:"o",\u1ED1:"o",\u1ED7:"o",\u1ED5:"o",\u00F5:"o",\u1E4D:"o",\u022D:"o",\u1E4F:"o",\u014D:"o",\u1E51:"o",\u1E53:"o",\u014F:"o",\u022F:"o",\u0231:"o",\u00F6:"o",\u022B:"o",\u1ECF:"o",\u0151:"o",\u01D2:"o",\u020D:"o",\u020F:"o",\u01A1:"o",\u1EDD:"o",\u1EDB:"o",\u1EE1:"o",\u1EDF:"o",\u1EE3:"o",\u1ECD:"o",\u1ED9:"o",\u01EB:"o",\u01ED:"o",\u00F8:"o",\u01FF:"o",\u0254:"o","\uA74B":"o","\uA74D":"o",\u0275:"o",\u01A3:"oi",\u0223:"ou","\uA74F":"oo","\u24DF":"p",\uFF50:"p",\u1E55:"p",\u1E57:"p",\u01A5:"p","\u1D7D":"p","\uA751":"p","\uA753":"p","\uA755":"p","\u24E0":"q",\uFF51:"q","\u024B":"q","\uA757":"q","\uA759":"q","\u24E1":"r",\uFF52:"r",\u0155:"r",\u1E59:"r",\u0159:"r",\u0211:"r",\u0213:"r",\u1E5B:"r",\u1E5D:"r",\u0157:"r",\u1E5F:"r","\u024D":"r",\u027D:"r","\uA75B":"r","\uA7A7":"r","\uA783":"r","\u24E2":"s",\uFF53:"s",\u00DF:"s",\u015B:"s",\u1E65:"s",\u015D:"s",\u1E61:"s",\u0161:"s",\u1E67:"s",\u1E63:"s",\u1E69:"s",\u0219:"s",\u015F:"s","\u023F":"s","\uA7A9":"s","\uA785":"s",\u1E9B:"s","\u24E3":"t",\uFF54:"t",\u1E6B:"t",\u1E97:"t",\u0165:"t",\u1E6D:"t",\u021B:"t",\u0163:"t",\u1E71:"t",\u1E6F:"t",\u0167:"t",\u01AD:"t",\u0288:"t","\u2C66":"t","\uA787":"t","\uA729":"tz","\u24E4":"u",\uFF55:"u",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u0169:"u",\u1E79:"u",\u016B:"u",\u1E7B:"u",\u016D:"u",\u00FC:"u",\u01DC:"u",\u01D8:"u",\u01D6:"u",\u01DA:"u",\u1EE7:"u",\u016F:"u",\u0171:"u",\u01D4:"u",\u0215:"u",\u0217:"u",\u01B0:"u",\u1EEB:"u",\u1EE9:"u",\u1EEF:"u",\u1EED:"u",\u1EF1:"u",\u1EE5:"u",\u1E73:"u",\u0173:"u",\u1E77:"u",\u1E75:"u",\u0289:"u","\u24E5":"v",\uFF56:"v",\u1E7D:"v",\u1E7F:"v",\u028B:"v","\uA75F":"v",\u028C:"v","\uA761":"vy","\u24E6":"w",\uFF57:"w",\u1E81:"w",\u1E83:"w",\u0175:"w",\u1E87:"w",\u1E85:"w",\u1E98:"w",\u1E89:"w","\u2C73":"w","\u24E7":"x",\uFF58:"x",\u1E8B:"x",\u1E8D:"x","\u24E8":"y",\uFF59:"y",\u1EF3:"y",\u00FD:"y",\u0177:"y",\u1EF9:"y",\u0233:"y",\u1E8F:"y",\u00FF:"y",\u1EF7:"y",\u1E99:"y",\u1EF5:"y",\u01B4:"y","\u024F":"y","\u1EFF":"y","\u24E9":"z",\uFF5A:"z",\u017A:"z",\u1E91:"z",\u017C:"z",\u017E:"z",\u1E93:"z",\u1E95:"z",\u01B6:"z",\u0225:"z","\u0240":"z","\u2C6C":"z","\uA763":"z",\u0386:"\u0391",\u0388:"\u0395",\u0389:"\u0397",\u038A:"\u0399",\u03AA:"\u0399",\u038C:"\u039F",\u038E:"\u03A5",\u03AB:"\u03A5",\u038F:"\u03A9",\u03AC:"\u03B1",\u03AD:"\u03B5",\u03AE:"\u03B7",\u03AF:"\u03B9",\u03CA:"\u03B9",\u0390:"\u03B9",\u03CC:"\u03BF",\u03CD:"\u03C5",\u03CB:"\u03C5",\u03B0:"\u03C5",\u03C9:"\u03C9",\u03C2:"\u03C3"};function Ke(i){let t=s=>xs[s]||s;return i.replace(/[^\u0000-\u007E]/g,t)}var _t=class{constructor(t,s){this._ngSelect=t,this._selectionModel=s,this._items=[],this._filteredItems=[],this._markedIndex=-1}get items(){return this._items}get filteredItems(){return this._filteredItems}get markedIndex(){return this._markedIndex}get selectedItems(){return this._selectionModel.value}get markedItem(){return this._filteredItems[this._markedIndex]}get noItemsToSelect(){return this._ngSelect.hideSelected&&this._items.length===this.selectedItems.length}get maxItemsSelected(){return this._ngSelect.multiple&&this._ngSelect.maxSelectedItems<=this.selectedItems.length}get lastSelectedItem(){let t=this.selectedItems.length-1;for(;t>=0;t--){let s=this.selectedItems[t];if(!s.disabled)return s}return null}setItems(t){this._items=t.map((s,e)=>this.mapItem(s,e)),this._ngSelect.groupBy?(this._groups=this._groupBy(this._items,this._ngSelect.groupBy),this._items=this._flatten(this._groups)):(this._groups=new Map,this._groups.set(void 0,this._items)),this._filteredItems=[...this._items]}select(t){if(t.selected||this.maxItemsSelected)return;let s=this._ngSelect.multiple;s||this.clearSelected(),this._selectionModel.select(t,s,this._ngSelect.selectableGroupAsModel),this._ngSelect.hideSelected&&this._hideSelected(t)}unselect(t){t.selected&&(this._selectionModel.unselect(t,this._ngSelect.multiple),this._ngSelect.hideSelected&&w(t.index)&&this._ngSelect.multiple&&this._showSelected(t))}findItem(t){let s;return this._ngSelect.compareWith?s=e=>this._ngSelect.compareWith(e.value,t):this._ngSelect.bindValue?s=e=>!e.children&&this.resolveNested(e.value,this._ngSelect.bindValue)===t:s=e=>e.value===t||!e.children&&e.label&&e.label===this.resolveNested(t,this._ngSelect.bindLabel),this._items.find(e=>s(e))}addItem(t){let s=this.mapItem(t,this._items.length);return this._items.push(s),this._filteredItems.push(s),s}clearSelected(t=!1){this._selectionModel.clear(t),this._items.forEach(s=>{s.selected=t&&s.selected&&s.disabled,s.marked=!1}),this._ngSelect.hideSelected&&this.resetFilteredItems()}findByLabel(t){return t=Ke(t).toLocaleLowerCase(),this.filteredItems.find(s=>Ke(s.label).toLocaleLowerCase().substr(0,t.length)===t)}filter(t){if(!t){this.resetFilteredItems();return}this._filteredItems=[],t=this._ngSelect.searchFn?t:Ke(t).toLocaleLowerCase();let s=this._ngSelect.searchFn||this._defaultSearchFn,e=this._ngSelect.hideSelected;for(let n of Array.from(this._groups.keys())){let r=[];for(let a of this._groups.get(n)){if(e&&(a.parent&&a.parent.selected||a.selected))continue;let o=this._ngSelect.searchFn?a.value:a;s(t,o)&&r.push(a)}if(r.length>0){let[a]=r.slice(-1);if(a.parent){let o=this._items.find(g=>g===a.parent);this._filteredItems.push(o)}this._filteredItems.push(...r)}}}resetFilteredItems(){this._filteredItems.length!==this._items.length&&(this._ngSelect.hideSelected&&this.selectedItems.length>0?this._filteredItems=this._items.filter(t=>!t.selected):this._filteredItems=this._items)}unmarkItem(){this._markedIndex=-1}markNextItem(){this._stepToItem(1)}markPreviousItem(){this._stepToItem(-1)}markItem(t){this._markedIndex=this._filteredItems.indexOf(t)}markSelectedOrDefault(t){if(this._filteredItems.length===0)return;let s=this._getLastMarkedIndex();s>-1?this._markedIndex=s:this._markedIndex=t?this.filteredItems.findIndex(e=>!e.disabled):-1}resolveNested(t,s){if(!Fe(t))return t;if(s.indexOf(".")===-1)return t[s];{let e=s.split("."),n=t;for(let r=0,a=e.length;rthis.selectedItems.indexOf(s)===-1))}_showSelected(t){if(this._filteredItems.push(t),t.parent){let s=t.parent;this._filteredItems.find(n=>n===s)||this._filteredItems.push(s)}else if(t.children)for(let s of t.children)s.selected=!1,this._filteredItems.push(s);this._filteredItems=[...this._filteredItems.sort((s,e)=>s.index-e.index)]}_hideSelected(t){this._filteredItems=this._filteredItems.filter(s=>s!==t),t.parent?t.parent.children.every(e=>e.selected)&&(this._filteredItems=this._filteredItems.filter(e=>e!==t.parent)):t.children&&(this._filteredItems=this.filteredItems.filter(s=>s.parent!==t))}_defaultSearchFn(t,s){return Ke(s.label).toLocaleLowerCase().indexOf(t)>-1}_getNextItemIndex(t){return t>0?this._markedIndex>=this._filteredItems.length-1?0:this._markedIndex+1:this._markedIndex<=0?this._filteredItems.length-1:this._markedIndex-1}_stepToItem(t){this._filteredItems.length===0||this._filteredItems.every(s=>s.disabled)||(this._markedIndex=this._getNextItemIndex(t),this.markedItem.disabled&&this._stepToItem(t))}_getLastMarkedIndex(){if(this._ngSelect.hideSelected||this._markedIndex>-1&&this.markedItem===void 0)return-1;let t=this._filteredItems.indexOf(this.lastSelectedItem);return this.lastSelectedItem&&t<0?-1:Math.max(this.markedIndex,t)}_groupBy(t,s){let e=new Map;if(t.length===0)return e;if(Array.isArray(t[0].value[s])){for(let a of t){let o=(a.value[s]||[]).map((g,v)=>this.mapItem(g,v));e.set(a,o)}return e}let n=Ye(this._ngSelect.groupBy),r=a=>{let o=n?s(a.value):a.value[s];return w(o)?o:void 0};for(let a of t){let o=r(a),g=e.get(o);g?g.push(a):e.set(o,[a])}return e}_flatten(t){let s=Ye(this._ngSelect.groupBy),e=[];for(let n of Array.from(t.keys())){let r=e.length;if(n===void 0){let P=t.get(void 0)||[];e.push(...P.map(oe=>(oe.index=r++,oe)));continue}let a=Fe(n),o={label:a?"":String(n),children:void 0,parent:null,index:r++,disabled:!this._ngSelect.selectableGroup,htmlId:Ki()},g=s?this._ngSelect.bindLabel:this._ngSelect.groupBy,v=this._ngSelect.groupValue||(()=>a?n.value:{[g]:n}),F=t.get(n).map(P=>(P.parent=o,P.children=void 0,P.index=r++,P));o.children=F,o.value=v(n,F.map(P=>P.value)),e.push(o),e.push(...F)}return e}},ne=function(i){return i[i.Tab=9]="Tab",i[i.Enter=13]="Enter",i[i.Esc=27]="Esc",i[i.Space=32]="Space",i[i.ArrowUp=38]="ArrowUp",i[i.ArrowDown=40]="ArrowDown",i[i.Backspace=8]="Backspace",i}(ne||{}),Yi=(()=>{let t=class t{constructor(){this._dimensions={itemHeight:0,panelHeight:0,itemsPerViewport:0}}get dimensions(){return this._dimensions}calculateItems(e,n,r){let a=this._dimensions,o=a.itemHeight*n,v=Math.max(0,e)/o*n,F=Math.min(n,Math.ceil(v)+(a.itemsPerViewport+1)),oe=Math.max(0,F-a.itemsPerViewport),J=Math.min(oe,Math.floor(v)),fe=a.itemHeight*Math.ceil(J)-a.itemHeight*Math.min(J,r);return fe=isNaN(fe)?0:fe,J=isNaN(J)?-1:J,F=isNaN(F)?-1:F,J-=r,J=Math.max(0,J),F+=r,F=Math.min(n,F),{topPadding:fe,scrollHeight:o,start:J,end:F}}setDimensions(e,n){let r=Math.max(1,Math.floor(n/e));this._dimensions={itemHeight:e,panelHeight:n,itemsPerViewport:r}}getScrollTo(e,n,r){let{panelHeight:a}=this.dimensions,o=e+n,g=r,v=g+a;return a>=o&&r===e?null:o>v?g+o-v:e<=g?e:null}};t.\u0275fac=function(n){return new(n||t)},t.\u0275prov=W({token:t,factory:t.\u0275fac});let i=t;return i})(),qi=["top","right","bottom","left"],ws=typeof requestAnimationFrame<"u"?yt:Ct,Ui=(()=>{let t=class t{constructor(e,n,r,a,o){this._renderer=e,this._zone=n,this._panelService=r,this._document=o,this.items=[],this.position="auto",this.virtualScroll=!1,this.filterValue=null,this.update=new A,this.scroll=new A,this.scrollToEnd=new A,this.outsideClick=new A,this._destroy$=new se,this._scrollToEndFired=!1,this._updateScrollHeight=!1,this._lastScrollPosition=0,this._dropdown=a.nativeElement}get currentPosition(){return this._currentPosition}get itemsLength(){return this._itemsLength}set itemsLength(e){e!==this._itemsLength&&(this._itemsLength=e,this._onItemsLengthChanged())}get _startOffset(){if(this.markedItem){let{itemHeight:e,panelHeight:n}=this._panelService.dimensions,r=this.markedItem.index*e;return n>r?0:r}return 0}ngOnInit(){this._select=this._dropdown.parentElement,this._virtualPadding=this.paddingElementRef.nativeElement,this._scrollablePanel=this.scrollElementRef.nativeElement,this._contentPanel=this.contentElementRef.nativeElement,this._handleScroll(),this._handleOutsideClick(),this._appendDropdown(),this._setupMousedownListener()}ngOnChanges(e){if(e.items){let n=e.items;this._onItemsChange(n.currentValue,n.firstChange)}}ngOnDestroy(){this._destroy$.next(),this._destroy$.complete(),this._destroy$.unsubscribe(),this.appendTo&&this._renderer.removeChild(this._dropdown.parentNode,this._dropdown)}scrollTo(e,n=!1){if(!e)return;let r=this.items.indexOf(e);if(r<0||r>=this.itemsLength)return;let a;if(this.virtualScroll){let o=this._panelService.dimensions.itemHeight;a=this._panelService.getScrollTo(r*o,o,this._lastScrollPosition)}else{let o=this._dropdown.querySelector(`#${e.htmlId}`),g=n?o.offsetTop:this._lastScrollPosition;a=this._panelService.getScrollTo(o.offsetTop,o.clientHeight,g)}w(a)&&(this._scrollablePanel.scrollTop=a)}scrollToTag(){let e=this._scrollablePanel;e.scrollTop=e.scrollHeight-e.clientHeight}adjustPosition(){this._updateYPosition()}_handleDropdownPosition(){this._currentPosition=this._calculateCurrentPosition(this._dropdown),qi.includes(this._currentPosition)?this._updateDropdownClass(this._currentPosition):this._updateDropdownClass("bottom"),this.appendTo&&this._updateYPosition(),this._dropdown.style.opacity="1"}_updateDropdownClass(e){qi.forEach(r=>{let a=`ng-select-${r}`;this._renderer.removeClass(this._dropdown,a),this._renderer.removeClass(this._select,a)});let n=`ng-select-${e}`;this._renderer.addClass(this._dropdown,n),this._renderer.addClass(this._select,n)}_handleScroll(){this._zone.runOutsideAngular(()=>{ye(this.scrollElementRef.nativeElement,"scroll").pipe(M(this._destroy$),Tt(0,ws)).subscribe(e=>{let n=e.path||e.composedPath&&e.composedPath();if(!n||n.length===0&&!e.target)return;let r=!n||n.length===0?e.target.scrollTop:n[0].scrollTop;this._onContentScrolled(r)})})}_handleOutsideClick(){this._document&&this._zone.runOutsideAngular(()=>{Oe(ye(this._document,"touchstart",{capture:!0}),ye(this._document,"click",{capture:!0})).pipe(M(this._destroy$)).subscribe(e=>this._checkToClose(e))})}_checkToClose(e){if(this._select.contains(e.target)||this._dropdown.contains(e.target))return;let n=e.path||e.composedPath&&e.composedPath();e.target&&e.target.shadowRoot&&n&&n[0]&&this._select.contains(n[0])||this._zone.run(()=>this.outsideClick.emit())}_onItemsChange(e,n){this.items=e||[],this._scrollToEndFired=!1,this.itemsLength=e.length,this.virtualScroll?this._updateItemsRange(n):(this._setVirtualHeight(),this._updateItems(n))}_updateItems(e){this.update.emit(this.items),e!==!1&&this._zone.runOutsideAngular(()=>{Promise.resolve().then(()=>{let n=this._scrollablePanel.clientHeight;this._panelService.setDimensions(0,n),this._handleDropdownPosition(),this.scrollTo(this.markedItem,e)})})}_updateItemsRange(e){this._zone.runOutsideAngular(()=>{this._measureDimensions().then(()=>{e?(this._renderItemsRange(this._startOffset),this._handleDropdownPosition()):this._renderItemsRange()})})}_onContentScrolled(e){this.virtualScroll&&this._renderItemsRange(e),this._lastScrollPosition=e,this._fireScrollToEnd(e)}_updateVirtualHeight(e){this._updateScrollHeight&&(this._virtualPadding.style.height=`${e}px`,this._updateScrollHeight=!1)}_setVirtualHeight(){this._virtualPadding&&(this._virtualPadding.style.height="0px")}_onItemsLengthChanged(){this._updateScrollHeight=!0}_renderItemsRange(e=null){if(e&&this._lastScrollPosition===e)return;e=e||this._scrollablePanel.scrollTop;let n=this._panelService.calculateItems(e,this.itemsLength,this.bufferAmount);this._updateVirtualHeight(n.scrollHeight),this._contentPanel.style.transform=`translateY(${n.topPadding}px)`,this._zone.run(()=>{this.update.emit(this.items.slice(n.start,n.end)),this.scroll.emit({start:n.start,end:n.end})}),w(e)&&this._lastScrollPosition===0&&(this._scrollablePanel.scrollTop=e,this._lastScrollPosition=e)}_measureDimensions(){if(this._panelService.dimensions.itemHeight>0||this.itemsLength===0)return Promise.resolve(this._panelService.dimensions);let[e]=this.items;return this.update.emit([e]),Promise.resolve().then(()=>{let r=this._dropdown.querySelector(`#${e.htmlId}`).clientHeight;this._virtualPadding.style.height=`${r*this.itemsLength}px`;let a=this._scrollablePanel.clientHeight;return this._panelService.setDimensions(r,a),this._panelService.dimensions})}_fireScrollToEnd(e){if(this._scrollToEndFired||e===0)return;let n=this.virtualScroll?this._virtualPadding:this._contentPanel;e+this._dropdown.clientHeight>=n.clientHeight-1&&(this._zone.run(()=>this.scrollToEnd.emit()),this._scrollToEndFired=!0)}_calculateCurrentPosition(e){if(this.position!=="auto")return this.position;let n=this._select.getBoundingClientRect(),r=document.documentElement.scrollTop||document.body.scrollTop,a=n.top+window.pageYOffset,o=n.height,g=e.getBoundingClientRect().height;return a+o+g>r+document.documentElement.clientHeight?"top":"bottom"}_appendDropdown(){if(this.appendTo){if(this._parent=document.querySelector(this.appendTo),!this._parent)throw new Error(`appendTo selector ${this.appendTo} did not found any parent element`);this._updateXPosition(),this._parent.appendChild(this._dropdown)}}_updateXPosition(){let e=this._select.getBoundingClientRect(),n=this._parent.getBoundingClientRect(),r=e.left-n.left;this._dropdown.style.left=r+"px",this._dropdown.style.width=e.width+"px",this._dropdown.style.minWidth=e.width+"px"}_updateYPosition(){let e=this._select.getBoundingClientRect(),n=this._parent.getBoundingClientRect(),r=e.height;if(this._currentPosition==="top"){let a=n.bottom-e.bottom;this._dropdown.style.bottom=a+r+"px",this._dropdown.style.top="auto"}else if(this._currentPosition==="bottom"){let a=e.top-n.top;this._dropdown.style.top=a+r+"px",this._dropdown.style.bottom="auto"}}_setupMousedownListener(){this._zone.runOutsideAngular(()=>{ye(this._dropdown,"mousedown").pipe(M(this._destroy$)).subscribe(e=>{e.target.tagName!=="INPUT"&&e.preventDefault()})})}};t.\u0275fac=function(n){return new(n||t)(_(Lt),_(Pt),_(Yi),_(re),_(Nt,8))},t.\u0275cmp=j({type:t,selectors:[["ng-dropdown-panel"]],viewQuery:function(n,r){if(n&1&&(he(Dn,7,re),he(On,7,re),he(Bn,7,re)),n&2){let a;O(a=B())&&(r.contentElementRef=a.first),O(a=B())&&(r.scrollElementRef=a.first),O(a=B())&&(r.paddingElementRef=a.first)}},inputs:{items:"items",markedItem:"markedItem",position:"position",appendTo:"appendTo",bufferAmount:"bufferAmount",virtualScroll:[2,"virtualScroll","virtualScroll",k],headerTemplate:"headerTemplate",footerTemplate:"footerTemplate",filterValue:"filterValue"},outputs:{update:"update",scroll:"scroll",scrollToEnd:"scrollToEnd",outsideClick:"outsideClick"},features:[Le,Te],ngContentSelectors:zi,decls:9,vars:6,consts:[["scroll",""],["padding",""],["content",""],[1,"ng-dropdown-header"],["role","listbox",1,"ng-dropdown-panel-items","scroll-host"],[1,"ng-dropdown-footer"],[3,"ngTemplateOutlet","ngTemplateOutletContext"]],template:function(n,r){n&1&&(nt(),b(0,Ln,2,4,"div",3),c(1,"div",4,0),D(3,"div",null,1),c(5,"div",null,2),st(7),d()(),b(8,Pn,2,4,"div",5)),n&2&&(U(r.headerTemplate?0:-1),l(3),$("total-padding",r.virtualScroll),l(2),$("scrollable-content",r.virtualScroll&&r.items.length),l(3),U(r.footerTemplate?8:-1))},dependencies:[at],encapsulation:2,changeDetection:0});let i=t;return i})(),Fs=(()=>{let t=class t{constructor(e){this.elementRef=e,this.disabled=!1,this.stateChange$=new se}get label(){return(this.elementRef.nativeElement.textContent||"").trim()}ngOnChanges(e){e.disabled&&this.stateChange$.next({value:this.value,disabled:this.disabled})}ngAfterViewChecked(){this.label!==this._previousLabel&&(this._previousLabel=this.label,this.stateChange$.next({value:this.value,disabled:this.disabled,label:this.elementRef.nativeElement.innerHTML}))}ngOnDestroy(){this.stateChange$.complete()}};t.\u0275fac=function(n){return new(n||t)(_(re))},t.\u0275cmp=j({type:t,selectors:[["ng-option"]],inputs:{value:"value",disabled:[2,"disabled","disabled",k]},features:[Le,Te],ngContentSelectors:zi,decls:1,vars:0,template:function(n,r){n&1&&(nt(),st(0))},encapsulation:2,changeDetection:0});let i=t;return i})(),As=(()=>{let t=class t{constructor(){this.notFoundText="No items found",this.typeToSearchText="Type to search",this.addTagText="Add item",this.loadingText="Loading...",this.clearAllText="Clear all",this.disableVirtualScroll=!0,this.openOnEnter=!0,this.appearance="underline"}};t.\u0275fac=function(n){return new(n||t)},t.\u0275prov=W({token:t,factory:t.\u0275fac,providedIn:"root"});let i=t;return i})(),ks=(()=>{let t=class t{warn(e){console.warn(e)}};t.\u0275fac=function(n){return new(n||t)},t.\u0275prov=W({token:t,factory:t.\u0275fac,providedIn:"root"});let i=t;return i})(),Zi=new Dt("ng-select-selection-model"),Ji=(()=>{let t=class t{get items(){return this._items}set items(e){this._itemsAreUsed=!0,this._items=e??[]}get compareWith(){return this._compareWith}set compareWith(e){if(e!=null&&!Ye(e))throw Error("`compareWith` must be a function.");this._compareWith=e}get clearSearchOnAdd(){return w(this._clearSearchOnAdd)?this._clearSearchOnAdd:w(this.config.clearSearchOnAdd)?this.config.clearSearchOnAdd:this.closeOnSelect}set clearSearchOnAdd(e){this._clearSearchOnAdd=e}get deselectOnClick(){return w(this._deselectOnClick)?this._deselectOnClick:w(this.config.deselectOnClick)?this.config.deselectOnClick:this.multiple}set deselectOnClick(e){this._deselectOnClick=e}get disabled(){return this.readonly||this._disabled}get filtered(){return!!this.searchTerm&&this.searchable||this._isComposing}get single(){return!this.multiple}get _editableSearchTerm(){return this.editableSearchTerm&&!this.multiple}constructor(e,n,r,a,o,g,v){this.classes=e,this.autoFocus=n,this.config=r,this._cd=g,this._console=v,this.markFirst=!0,this.dropdownPosition="auto",this.loading=!1,this.closeOnSelect=!0,this.hideSelected=!1,this.selectOnTab=!1,this.bufferAmount=4,this.selectableGroup=!1,this.selectableGroupAsModel=!0,this.searchFn=null,this.trackByFn=null,this.clearOnBackspace=!0,this.labelForId=null,this.inputAttrs={},this.readonly=!1,this.searchWhileComposing=!0,this.minTermLength=0,this.editableSearchTerm=!1,this.keyDownFn=F=>!0,this.multiple=!1,this.addTag=!1,this.searchable=!0,this.clearable=!0,this.isOpen=!1,this.blurEvent=new A,this.focusEvent=new A,this.changeEvent=new A,this.openEvent=new A,this.closeEvent=new A,this.searchEvent=new A,this.clearEvent=new A,this.addEvent=new A,this.removeEvent=new A,this.scroll=new A,this.scrollToEnd=new A,this.useDefaultClass=!0,this.viewPortItems=[],this.searchTerm=null,this.dropdownId=Ki(),this.escapeHTML=!0,this._items=[],this._defaultLabel="label",this._pressedKeys=[],this._isComposing=!1,this._destroy$=new se,this._keyPress$=new se,this._onChange=F=>{},this._onTouched=()=>{},this.clearItem=F=>{let P=this.selectedItems.find(oe=>oe.value===F);this.unselect(P)},this.trackByOption=(F,P)=>this.trackByFn?this.trackByFn(P.value):P,this._mergeGlobalConfig(r),this.itemsList=new _t(this,a()),this.element=o.nativeElement}get selectedItems(){return this.itemsList.selectedItems}get selectedValues(){return this.selectedItems.map(e=>e.value)}get hasValue(){return this.selectedItems.length>0}get currentPanelPosition(){if(this.dropdownPanel)return this.dropdownPanel.currentPosition}ngOnInit(){this._handleKeyPresses(),this._setInputAttributes()}ngOnChanges(e){e.multiple&&this.itemsList.clearSelected(),e.items&&this._setItems(e.items.currentValue||[]),e.isOpen&&(this._manualOpen=w(e.isOpen.currentValue))}ngAfterViewInit(){this._itemsAreUsed||(this.escapeHTML=!1,this._setItemsFromNgOptions()),w(this.autoFocus)&&this.focus()}ngOnDestroy(){this._destroy$.next(),this._destroy$.complete()}handleKeyDown(e){if(ne[e.which]){if(this.keyDownFn(e)===!1)return;this.handleKeyCode(e)}else e.key&&e.key.length===1&&this._keyPress$.next(e.key.toLocaleLowerCase())}handleKeyCode(e){let n=e.target;this.clearButton&&this.clearButton.nativeElement===n?this.handleKeyCodeClear(e):this.handleKeyCodeInput(e)}handleKeyCodeInput(e){switch(e.which){case ne.ArrowDown:this._handleArrowDown(e);break;case ne.ArrowUp:this._handleArrowUp(e);break;case ne.Space:this._handleSpace(e);break;case ne.Enter:this._handleEnter(e);break;case ne.Tab:this._handleTab(e);break;case ne.Esc:this.close(),e.preventDefault();break;case ne.Backspace:this._handleBackspace();break}}handleKeyCodeClear(e){switch(e.which){case ne.Enter:this.handleClearClick(),e.preventDefault();break}}handleMousedown(e){let n=e.target;if(n.tagName!=="INPUT"&&e.preventDefault(),n.classList.contains("ng-clear-wrapper")){this.handleClearClick();return}if(n.classList.contains("ng-arrow-wrapper")){this.handleArrowClick();return}n.classList.contains("ng-value-icon")||(this.focused||this.focus(),this.searchable?this.open():this.toggle())}handleArrowClick(){this.isOpen?this.close():this.open()}handleClearClick(){this.hasValue&&(this.itemsList.clearSelected(!0),this._updateNgModel()),this._clearSearch(),this.focus(),this.clearEvent.emit(),this._onSelectionChanged()}clearModel(){this.clearable&&(this.itemsList.clearSelected(),this._updateNgModel())}writeValue(e){this.itemsList.clearSelected(),this._handleWriteValue(e),this._cd.markForCheck()}registerOnChange(e){this._onChange=e}registerOnTouched(e){this._onTouched=e}setDisabledState(e){this._disabled=e,this._cd.markForCheck()}toggle(){this.isOpen?this.close():this.open()}open(){this.disabled||this.isOpen||this._manualOpen||!this._isTypeahead&&!this.addTag&&this.itemsList.noItemsToSelect||(this.isOpen=!0,this.itemsList.markSelectedOrDefault(this.markFirst),this.openEvent.emit(),this.searchTerm||this.focus(),this.detectChanges())}close(){!this.isOpen||this._manualOpen||(this.isOpen=!1,this._isComposing=!1,this._editableSearchTerm?this.itemsList.resetFilteredItems():this._clearSearch(),this.itemsList.unmarkItem(),this._onTouched(),this.closeEvent.emit(),this._cd.markForCheck())}toggleItem(e){!e||e.disabled||this.disabled||(this.deselectOnClick&&e.selected?this.unselect(e):this.select(e),this._editableSearchTerm&&this._setSearchTermFromItems(),this._onSelectionChanged())}select(e){e.selected||(this.itemsList.select(e),this.clearSearchOnAdd&&!this._editableSearchTerm&&this._clearSearch(),this._updateNgModel(),this.multiple&&this.addEvent.emit(e.value)),(this.closeOnSelect||this.itemsList.noItemsToSelect)&&this.close()}focus(){this.searchInput.nativeElement.focus()}blur(){this.searchInput.nativeElement.blur()}unselect(e){e&&(this.itemsList.unselect(e),this.focus(),this._updateNgModel(),this.removeEvent.emit(e.value))}selectTag(){let e;Ye(this.addTag)?e=this.addTag(this.searchTerm):e=this._primitive?this.searchTerm:{[this.bindLabel]:this.searchTerm};let n=r=>this._isTypeahead||!this.isOpen?this.itemsList.mapItem(r,null):this.itemsList.addItem(r);_s(e)?e.then(r=>this.select(n(r))).catch(()=>{}):e&&this.select(n(e))}showClear(){return this.clearable&&(this.hasValue||this.searchTerm)&&!this.disabled}focusOnClear(){this.blur(),this.clearButton&&this.clearButton.nativeElement.focus()}get showAddTag(){if(!this._validTerm)return!1;let e=this.searchTerm.toLowerCase().trim();return this.addTag&&!this.itemsList.filteredItems.some(n=>n.label.toLowerCase()===e)&&(!this.hideSelected&&this.isOpen||!this.selectedItems.some(n=>n.label.toLowerCase()===e))&&!this.loading}showNoItemsFound(){let e=this.itemsList.filteredItems.length===0;return(e&&!this._isTypeahead&&!this.loading||e&&this._isTypeahead&&this._validTerm&&!this.loading)&&!this.showAddTag}showTypeToSearch(){return this.itemsList.filteredItems.length===0&&this._isTypeahead&&!this._validTerm&&!this.loading}onCompositionStart(){this._isComposing=!0}onCompositionEnd(e){this._isComposing=!1,!this.searchWhileComposing&&this.filter(e)}filter(e){this._isComposing&&!this.searchWhileComposing||(this.searchTerm=e,this._isTypeahead&&(this._validTerm||this.minTermLength===0)&&this.typeahead.next(e),this._isTypeahead||(this.itemsList.filter(this.searchTerm),this.isOpen&&this.itemsList.markSelectedOrDefault(this.markFirst)),this.searchEvent.emit({term:e,items:this.itemsList.filteredItems.map(n=>n.value)}),this.open())}onInputFocus(e){this.focused||(this._editableSearchTerm&&this._setSearchTermFromItems(),this.element.classList.add("ng-select-focused"),this.focusEvent.emit(e),this.focused=!0)}onInputBlur(e){this.element.classList.remove("ng-select-focused"),this.blurEvent.emit(e),!this.isOpen&&!this.disabled&&this._onTouched(),this._editableSearchTerm&&this._setSearchTermFromItems(),this.focused=!1}onItemHover(e){e.disabled||this.itemsList.markItem(e)}detectChanges(){this._cd.destroyed||this._cd.detectChanges()}_setSearchTermFromItems(){let e=this.selectedItems&&this.selectedItems[0];this.searchTerm=e&&e.label||null}_setItems(e){let n=e[0];this.bindLabel=this.bindLabel||this._defaultLabel,this._primitive=w(n)?!Fe(n):this._primitive||this.bindLabel===this._defaultLabel,this.itemsList.setItems(e),e.length>0&&this.hasValue&&this.itemsList.mapSelectedItems(),this.isOpen&&w(this.searchTerm)&&!this._isTypeahead&&this.itemsList.filter(this.searchTerm),(this._isTypeahead||this.isOpen)&&this.itemsList.markSelectedOrDefault(this.markFirst)}_setItemsFromNgOptions(){let e=r=>{this.items=r.map(a=>({$ngOptionValue:a.value,$ngOptionLabel:a.elementRef.nativeElement.innerHTML,disabled:a.disabled})),this.itemsList.setItems(this.items),this.hasValue&&this.itemsList.mapSelectedItems(),this.detectChanges()},n=()=>{let r=Oe(this.ngOptions.changes,this._destroy$);Oe(...this.ngOptions.map(a=>a.stateChange$)).pipe(M(r)).subscribe(a=>{let o=this.itemsList.findItem(a.value);o.disabled=a.disabled,o.label=a.label||o.label,this._cd.detectChanges()})};this.ngOptions.changes.pipe(wt(this.ngOptions),M(this._destroy$)).subscribe(r=>{this.bindLabel=this._defaultLabel,e(r),n()})}_isValidWriteValue(e){if(!w(e)||this.multiple&&e===""||Array.isArray(e)&&e.length===0)return!1;let n=r=>!w(this.compareWith)&&Fe(r)&&this.bindValue?(this._console.warn(`Setting object(${JSON.stringify(r)}) as your model with bindValue is not allowed unless [compareWith] is used.`),!1):!0;return this.multiple?Array.isArray(e)?e.every(r=>n(r)):(this._console.warn("Multiple select ngModel should be array."),!1):n(e)}_handleWriteValue(e){if(!this._isValidWriteValue(e))return;let n=r=>{let a=this.itemsList.findItem(r);if(a)this.itemsList.select(a);else{let o=Fe(r),g=!o&&!this.bindValue;o||g?this.itemsList.select(this.itemsList.mapItem(r,null)):this.bindValue&&(a={[this.bindLabel]:null,[this.bindValue]:r},this.itemsList.select(this.itemsList.mapItem(a,null)))}};this.multiple?e.forEach(r=>n(r)):n(e)}_handleKeyPresses(){this.searchable||this._keyPress$.pipe(M(this._destroy$),Ft(e=>this._pressedKeys.push(e)),It(200),Be(()=>this._pressedKeys.length>0),S(()=>this._pressedKeys.join(""))).subscribe(e=>{let n=this.itemsList.findByLabel(e);n&&(this.isOpen?(this.itemsList.markItem(n),this._scrollToMarked(),this._cd.markForCheck()):this.select(n)),this._pressedKeys=[]})}_setInputAttributes(){let e=this.searchInput.nativeElement,n=_e({type:"text",autocorrect:"off",autocapitalize:"off",autocomplete:this.labelForId?"off":this.dropdownId},this.inputAttrs);for(let r of Object.keys(n))e.setAttribute(r,n[r])}_updateNgModel(){let e=[];for(let r of this.selectedItems)if(this.bindValue){let a=null;if(r.children){let o=this.groupValue?this.bindValue:this.groupBy;a=r.value[o||this.groupBy]}else a=this.itemsList.resolveNested(r.value,this.bindValue);e.push(a)}else e.push(r.value);let n=this.selectedItems.map(r=>r.value);this.multiple?(this._onChange(e),this.changeEvent.emit(n)):(this._onChange(w(e[0])?e[0]:null),this.changeEvent.emit(n[0])),this._cd.markForCheck()}_clearSearch(){this.searchTerm&&(this._changeSearch(null),this.itemsList.resetFilteredItems())}_changeSearch(e){this.searchTerm=e,this._isTypeahead&&this.typeahead.next(e)}_scrollToMarked(){!this.isOpen||!this.dropdownPanel||this.dropdownPanel.scrollTo(this.itemsList.markedItem)}_scrollToTag(){!this.isOpen||!this.dropdownPanel||this.dropdownPanel.scrollToTag()}_onSelectionChanged(){this.isOpen&&this.deselectOnClick&&this.appendTo&&(this._cd.detectChanges(),this.dropdownPanel.adjustPosition())}_handleTab(e){if(this.isOpen===!1){if(this.showClear()&&!e.shiftKey)this.focusOnClear(),e.preventDefault();else if(!this.addTag)return}this.selectOnTab?this.itemsList.markedItem?(this.toggleItem(this.itemsList.markedItem),e.preventDefault()):this.showAddTag?(this.selectTag(),e.preventDefault()):this.close():this.close()}_handleEnter(e){if(this.isOpen||this._manualOpen)this.itemsList.markedItem?this.toggleItem(this.itemsList.markedItem):this.showAddTag&&this.selectTag();else if(this.openOnEnter)this.open();else return;e.preventDefault()}_handleSpace(e){this.isOpen||this._manualOpen||(this.open(),e.preventDefault())}_handleArrowDown(e){this._nextItemIsTag(1)?(this.itemsList.unmarkItem(),this._scrollToTag()):(this.itemsList.markNextItem(),this._scrollToMarked()),this.open(),e.preventDefault()}_handleArrowUp(e){this.isOpen&&(this._nextItemIsTag(-1)?(this.itemsList.unmarkItem(),this._scrollToTag()):(this.itemsList.markPreviousItem(),this._scrollToMarked()),e.preventDefault())}_nextItemIsTag(e){let n=this.itemsList.markedIndex+e;return this.addTag&&this.searchTerm&&this.itemsList.markedItem&&(n<0||n===this.itemsList.filteredItems.length)}_handleBackspace(){this.searchTerm||!this.clearable||!this.clearOnBackspace||!this.hasValue||(this.multiple?this.unselect(this.itemsList.lastSelectedItem):this.clearModel())}get _isTypeahead(){return this.typeahead&&this.typeahead.observers.length>0}get _validTerm(){let e=this.searchTerm&&this.searchTerm.trim();return e&&e.length>=this.minTermLength}_mergeGlobalConfig(e){this.placeholder=this.placeholder||e.placeholder,this.notFoundText=this.notFoundText||e.notFoundText,this.typeToSearchText=this.typeToSearchText||e.typeToSearchText,this.addTagText=this.addTagText||e.addTagText,this.loadingText=this.loadingText||e.loadingText,this.clearAllText=this.clearAllText||e.clearAllText,this.virtualScroll=w(this.virtualScroll)?this.virtualScroll:w(e.disableVirtualScroll)?!e.disableVirtualScroll:!1,this.openOnEnter=w(this.openOnEnter)?this.openOnEnter:e.openOnEnter,this.appendTo=this.appendTo||e.appendTo,this.bindValue=this.bindValue||e.bindValue,this.bindLabel=this.bindLabel||e.bindLabel,this.appearance=this.appearance||e.appearance}};t.\u0275fac=function(n){return new(n||t)(Je("class"),Je("autofocus"),_(As),_(Zi),_(re),_(Mt),_(ks))},t.\u0275cmp=j({type:t,selectors:[["ng-select"]],contentQueries:function(n,r,a){if(n&1&&(G(a,bt,5,I),G(a,vt,5,I),G(a,bs,5,I),G(a,Et,5,I),G(a,vs,5,I),G(a,Es,5,I),G(a,Cs,5,I),G(a,ys,5,I),G(a,Ss,5,I),G(a,Ts,5,I),G(a,Is,5,I),G(a,Fs,5)),n&2){let o;O(o=B())&&(r.optionTemplate=o.first),O(o=B())&&(r.optgroupTemplate=o.first),O(o=B())&&(r.labelTemplate=o.first),O(o=B())&&(r.multiLabelTemplate=o.first),O(o=B())&&(r.headerTemplate=o.first),O(o=B())&&(r.footerTemplate=o.first),O(o=B())&&(r.notFoundTemplate=o.first),O(o=B())&&(r.typeToSearchTemplate=o.first),O(o=B())&&(r.loadingTextTemplate=o.first),O(o=B())&&(r.tagTemplate=o.first),O(o=B())&&(r.loadingSpinnerTemplate=o.first),O(o=B())&&(r.ngOptions=o)}},viewQuery:function(n,r){if(n&1&&(he(Ui,5),he(Vn,7),he(Mn,5)),n&2){let a;O(a=B())&&(r.dropdownPanel=a.first),O(a=B())&&(r.searchInput=a.first),O(a=B())&&(r.clearButton=a.first)}},hostVars:20,hostBindings:function(n,r){n&1&&x("keydown",function(o){return r.handleKeyDown(o)}),n&2&&$("ng-select-typeahead",r.typeahead)("ng-select-multiple",r.multiple)("ng-select-taggable",r.addTag)("ng-select-searchable",r.searchable)("ng-select-clearable",r.clearable)("ng-select-opened",r.isOpen)("ng-select",r.useDefaultClass)("ng-select-disabled",r.disabled)("ng-select-filtered",r.filtered)("ng-select-single",r.single)},inputs:{bindLabel:"bindLabel",bindValue:"bindValue",markFirst:[2,"markFirst","markFirst",k],placeholder:"placeholder",notFoundText:"notFoundText",typeToSearchText:"typeToSearchText",addTagText:"addTagText",loadingText:"loadingText",clearAllText:"clearAllText",appearance:"appearance",dropdownPosition:"dropdownPosition",appendTo:"appendTo",loading:[2,"loading","loading",k],closeOnSelect:[2,"closeOnSelect","closeOnSelect",k],hideSelected:[2,"hideSelected","hideSelected",k],selectOnTab:[2,"selectOnTab","selectOnTab",k],openOnEnter:[2,"openOnEnter","openOnEnter",k],maxSelectedItems:[2,"maxSelectedItems","maxSelectedItems",Ie],groupBy:"groupBy",groupValue:"groupValue",bufferAmount:[2,"bufferAmount","bufferAmount",Ie],virtualScroll:[2,"virtualScroll","virtualScroll",k],selectableGroup:[2,"selectableGroup","selectableGroup",k],selectableGroupAsModel:[2,"selectableGroupAsModel","selectableGroupAsModel",k],searchFn:"searchFn",trackByFn:"trackByFn",clearOnBackspace:[2,"clearOnBackspace","clearOnBackspace",k],labelForId:"labelForId",inputAttrs:"inputAttrs",tabIndex:[2,"tabIndex","tabIndex",Ie],readonly:[2,"readonly","readonly",k],searchWhileComposing:[2,"searchWhileComposing","searchWhileComposing",k],minTermLength:[2,"minTermLength","minTermLength",Ie],editableSearchTerm:[2,"editableSearchTerm","editableSearchTerm",k],keyDownFn:"keyDownFn",typeahead:"typeahead",multiple:[2,"multiple","multiple",k],addTag:"addTag",searchable:[2,"searchable","searchable",k],clearable:[2,"clearable","clearable",k],isOpen:[2,"isOpen","isOpen",k],items:"items",compareWith:"compareWith",clearSearchOnAdd:"clearSearchOnAdd",deselectOnClick:"deselectOnClick"},outputs:{blurEvent:"blur",focusEvent:"focus",changeEvent:"change",openEvent:"open",closeEvent:"close",searchEvent:"search",clearEvent:"clear",addEvent:"add",removeEvent:"remove",scroll:"scroll",scrollToEnd:"scrollToEnd"},features:[le([{provide:Qt,useExisting:At(()=>t),multi:!0},Yi]),Le,Te],decls:14,vars:19,consts:[["searchInput",""],["defaultLabelTemplate",""],["defaultLoadingSpinnerTemplate",""],["clearButton",""],["defaultOptionTemplate",""],["defaultTagTemplate",""],["defaultNotFoundTemplate",""],["defaultTypeToSearchTemplate",""],["defaultLoadingTextTemplate",""],[1,"ng-select-container",3,"mousedown"],[1,"ng-value-container"],[1,"ng-placeholder"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],["role","combobox","aria-haspopup","listbox",1,"ng-input"],["aria-autocomplete","list",3,"input","compositionstart","compositionend","focus","blur","change","readOnly","disabled","value"],["tabindex","0",1,"ng-clear-wrapper",3,"title"],[1,"ng-arrow-wrapper"],[1,"ng-arrow"],["role","listbox","aria-label","Options list",1,"ng-dropdown-panel",3,"virtualScroll","bufferAmount","appendTo","position","headerTemplate","footerTemplate","filterValue","items","markedItem","ng-select-multiple","ngClass","id"],[1,"ng-value",3,"ng-value-disabled"],[1,"ng-value"],["aria-hidden","true",1,"ng-value-icon","left",3,"click"],[1,"ng-value-label",3,"ngItemLabel","escape"],[3,"ngTemplateOutlet"],[1,"ng-spinner-loader"],["aria-hidden","true",1,"ng-clear"],["role","listbox","aria-label","Options list",1,"ng-dropdown-panel",3,"update","scroll","scrollToEnd","outsideClick","virtualScroll","bufferAmount","appendTo","position","headerTemplate","footerTemplate","filterValue","items","markedItem","ngClass","id"],[1,"ng-option",3,"ng-option-disabled","ng-option-selected","ng-optgroup","ng-option","ng-option-child","ng-option-marked"],["role","option",1,"ng-option",3,"ng-option-marked"],[1,"ng-option",3,"click","mouseover"],[1,"ng-option-label",3,"ngItemLabel","escape"],["role","option",1,"ng-option",3,"mouseover","click"],[1,"ng-tag-label"],[1,"ng-option","ng-option-disabled"]],template:function(n,r){if(n&1){let a=V();c(0,"div",9),x("mousedown",function(g){return C(a),y(r.handleMousedown(g))}),c(1,"div",10)(2,"div",11),h(3),d(),b(4,Wn,2,0)(5,Un,1,5,null,12),c(6,"div",13)(7,"input",14,0),x("input",function(){C(a);let g=N(8);return y(r.filter(g.value))})("compositionstart",function(){return C(a),y(r.onCompositionStart())})("compositionend",function(){C(a);let g=N(8);return y(r.onCompositionEnd(g.value))})("focus",function(g){return C(a),y(r.onInputFocus(g))})("blur",function(g){return C(a),y(r.onInputBlur(g))})("change",function(g){return C(a),y(g.stopPropagation())}),d()()(),b(9,Kn,3,1)(10,Yn,4,1,"span",15),c(11,"span",16),D(12,"span",17),d()(),b(13,ps,8,17,"ng-dropdown-panel",18)}n&2&&($("ng-appearance-outline",r.appearance==="outline")("ng-has-value",r.hasValue),l(3),T(r.placeholder),l(),U((!r.multiLabelTemplate||!r.multiple)&&r.selectedItems.length>0?4:-1),l(),U(r.multiple&&r.multiLabelTemplate&&r.selectedValues.length>0?5:-1),l(),q("aria-expanded",r.isOpen)("aria-owns",r.isOpen?r.dropdownId:null),l(),p("readOnly",!r.searchable||r.itemsList.maxItemsSelected)("disabled",r.disabled)("value",r.searchTerm?r.searchTerm:""),q("id",r.labelForId)("tabindex",r.tabIndex)("aria-activedescendant",r.isOpen?r.itemsList==null||r.itemsList.markedItem==null?null:r.itemsList.markedItem.htmlId:null)("aria-controls",r.isOpen?r.dropdownId:null),l(2),U(r.loading?9:-1),l(),U(r.showClear()?10:-1),l(3),U(r.isOpen?13:-1))},dependencies:[jt,at,Ui,gs],styles:[`@charset "UTF-8";.ng-select{position:relative;display:block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.ng-select div,.ng-select input,.ng-select span{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.ng-select [hidden]{display:none}.ng-select.ng-select-searchable .ng-select-container .ng-value-container .ng-input{opacity:1}.ng-select.ng-select-opened .ng-select-container{z-index:1001}.ng-select.ng-select-disabled .ng-select-container .ng-value-container .ng-placeholder,.ng-select.ng-select-disabled .ng-select-container .ng-value-container .ng-value{-webkit-user-select:none;user-select:none;cursor:default}.ng-select.ng-select-disabled .ng-arrow-wrapper{cursor:default}.ng-select.ng-select-filtered .ng-placeholder{display:none}.ng-select .ng-select-container{cursor:default;display:flex;outline:none;overflow:hidden;position:relative;width:100%}.ng-select .ng-select-container .ng-value-container{display:flex;flex:1}.ng-select .ng-select-container .ng-value-container .ng-input{opacity:0}.ng-select .ng-select-container .ng-value-container .ng-input>input{box-sizing:content-box;background:none transparent;border:0 none;box-shadow:none;outline:none;padding:0;cursor:default;width:100%}.ng-select .ng-select-container .ng-value-container .ng-input>input::-ms-clear{display:none}.ng-select .ng-select-container .ng-value-container .ng-input>input[readonly]{-webkit-user-select:none;user-select:none;width:0;padding:0}.ng-select.ng-select-single.ng-select-filtered .ng-select-container .ng-value-container .ng-value{visibility:hidden}.ng-select.ng-select-single .ng-select-container .ng-value-container,.ng-select.ng-select-single .ng-select-container .ng-value-container .ng-value{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ng-select.ng-select-single .ng-select-container .ng-value-container .ng-value .ng-value-icon{display:none}.ng-select.ng-select-single .ng-select-container .ng-value-container .ng-input{position:absolute;left:0;width:100%}.ng-select.ng-select-multiple.ng-select-disabled>.ng-select-container .ng-value-container .ng-value .ng-value-icon{display:none}.ng-select.ng-select-multiple .ng-select-container .ng-value-container{flex-wrap:wrap}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-placeholder{position:absolute}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value{white-space:nowrap}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value.ng-value-disabled .ng-value-icon{display:none}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value .ng-value-icon{cursor:pointer}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-input{flex:1;z-index:2}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-placeholder{z-index:1}.ng-select .ng-clear-wrapper{cursor:pointer;position:relative;width:17px;-webkit-user-select:none;user-select:none}.ng-select .ng-clear-wrapper .ng-clear{display:inline-block;font-size:18px;line-height:1;pointer-events:none}.ng-select .ng-spinner-loader{border-radius:50%;width:17px;height:17px;margin-right:5px;font-size:10px;position:relative;text-indent:-9999em;border-top:2px solid rgba(66,66,66,.2);border-right:2px solid rgba(66,66,66,.2);border-bottom:2px solid rgba(66,66,66,.2);border-left:2px solid #424242;transform:translateZ(0);animation:load8 .8s infinite linear}.ng-select .ng-spinner-loader:after{border-radius:50%;width:17px;height:17px}@-webkit-keyframes load8{0%{-webkit-transform:rotate(0deg);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes load8{0%{-webkit-transform:rotate(0deg);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.ng-select .ng-arrow-wrapper{cursor:pointer;position:relative;text-align:center;-webkit-user-select:none;user-select:none}.ng-select .ng-arrow-wrapper .ng-arrow{pointer-events:none;display:inline-block;height:0;width:0;position:relative}.ng-dropdown-panel{box-sizing:border-box;position:absolute;opacity:0;width:100%;z-index:1050;-webkit-overflow-scrolling:touch}.ng-dropdown-panel .ng-dropdown-panel-items{display:block;height:auto;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;max-height:240px;overflow-y:auto}.ng-dropdown-panel .ng-dropdown-panel-items .ng-optgroup{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option{box-sizing:border-box;cursor:pointer;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option .ng-option-label:empty:before{content:"\\200b"}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option .highlighted{font-weight:700;text-decoration:underline}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option.disabled{cursor:default}.ng-dropdown-panel .scroll-host{overflow:hidden;overflow-y:auto;position:relative;display:block;-webkit-overflow-scrolling:touch}.ng-dropdown-panel .scrollable-content{top:0;left:0;width:100%;height:100%;position:absolute}.ng-dropdown-panel .total-padding{width:1px;opacity:0} +import{a as Di}from"./chunk-ZROJU7EX.js";import{a as Vi,b as Ni,c as ji}from"./chunk-SOH5T2AJ.js";import{a as ki}from"./chunk-NYTDIO5P.js";import{a as $i}from"./chunk-4EXGKTN3.js";import{a as Ai}from"./chunk-JV3CBBGP.js";import"./chunk-U4HODSW3.js";import"./chunk-W7ASLXRM.js";import"./chunk-PSXDSPKS.js";import{a as hi,b as _i,e as Si}from"./chunk-C7XT5XXE.js";import{a as We}from"./chunk-YMJC6QZX.js";import"./chunk-Y4QYVF5K.js";import"./chunk-HII3S2DL.js";import{a as Ri}from"./chunk-DDSXVC6O.js";import{a as Li,b as Pi}from"./chunk-UP3NEN2H.js";import{a as Bi}from"./chunk-DZZC2YX2.js";import{a as Oi}from"./chunk-K3EEKOGY.js";import{a as Mi}from"./chunk-XLPJMZ3E.js";import{b as xi,c as wi}from"./chunk-24AFRN2G.js";import"./chunk-RFO4NYUO.js";import{a as Ii}from"./chunk-5RDJZAUT.js";import"./chunk-DB66EACG.js";import{L as vi,M as pt,P as Ei,Q as mt,R as ht,S as qe,T as Ue,U as Ci,j as gi,v as bi,w as ut}from"./chunk-ZK2MNT7Z.js";import{a as He,c as dt,e as yi}from"./chunk-AW7CSGKI.js";import{b as Fi}from"./chunk-FTDG26ID.js";import{a as Ge,c as Ti}from"./chunk-SOHFFTKU.js";import{f as li,g as ci,j as di,w as we,y as fi}from"./chunk-C56YGDXA.js";import{a as pi}from"./chunk-UX5TA32W.js";import{$ as j,$a as f,$c as Re,Ab as u,Ac as lt,Ba as Pt,Bb as m,C as It,Cb as ie,Dd as mi,E as ee,Eb as Z,Fa as Le,Fc as zt,Fd as $e,Ga as b,Gd as de,Ha as q,Hb as Mt,Hd as ue,I as xt,Ia as p,Ib as k,Ja as $,Jb as Ie,L as pe,Lb as Nt,Lc as ct,Ma as Xe,Mb as Rt,N as wt,Na as U,O as Se,Q as M,Qa as et,Qb as jt,R as Ft,Ra as tt,Rb as Ee,Sa as c,Sb as Me,Ta as d,Ua as D,Ub as at,V as At,Va as ge,Vb as Ce,Vc as ce,W,Wa as be,Wb as $t,Wc as Qt,X as kt,Xa as it,Xc as Kt,Y as Dt,Ya as V,Yb as Ht,Yc as Yt,Z as R,_a as x,_c as xe,a as _e,aa as Ot,ab as nt,ad as Zt,b as ke,ba as H,bb as st,cb as me,db as rt,dc as Gt,dd as Jt,e as se,eb as G,ed as Xt,f as Ze,fb as he,ga as Te,gb as O,gd as ei,h as Ct,ha as C,hb as B,i as yt,ia as y,ib as N,id as ti,jb as h,jd as ii,k as St,kb as T,kd as ni,la as Bt,lb as E,ld as si,m as S,ma as Je,mb as ve,md as ri,n as De,oc as Ne,pb as z,pc as Wt,qa as re,qb as Q,qc as qt,qd as ai,ra as A,rb as K,rc as Ut,rd as je,s as ye,sb as le,sd as oi,tb as te,ua as l,v as Oe,va as _,vb as Y,w as Be,wb as Vt,xa as I,xb as Pe,yb as Ve,z as Tt,za as Lt,zc as ot,zd as ui}from"./chunk-XTHSYQMN.js";var L=function(i){return i.Absent="absent",i.Dispensation="dispensation",i.HalfDay="half-day",i.Incident="incident",i.Present="present",i}(L||{}),Gi=(()=>{let t=class t{constructor(e,n){this.updateService=e,this.settings=n}update(e,n,r,a,o,g){let v=[];switch(r){case L.Present:v=this.createResetBulkRequests(e);break;case L.Absent:v=this.createAbsentEditBulkRequests(e,n,a,o);break;case L.Dispensation:v=this.createEditBulkRequests(e,null,this.settings.dispensationPresenceTypeId);break;case L.HalfDay:v=this.createEditBulkRequests(e,null,this.settings.halfDayPresenceTypeId);break;case L.Incident:v=this.createEditBulkRequests(e,null,g);break}return De(v).pipe(S(()=>{}))}createAbsentEditBulkRequests(e,n,r,a){return r===this.settings.excusedAbsenceStateId?this.createEditBulkRequests(e,r,a):r===this.settings.unexcusedAbsenceStateId?this.createEditBulkRequests(e,r,this.settings.absencePresenceTypeId):[...this.createEditBulkRequests(e.filter(Hi(n,this.settings)),r,this.settings.absencePresenceTypeId),...this.createEditBulkRequests(e.filter(we(Hi(n,this.settings))),r,null)]}createResetBulkRequests(e){return pt(e).map(({lessonIds:n,personIds:r})=>this.updateService.removeLessonPresences(n,r))}createEditBulkRequests(e,n,r){return pt(e).map(({lessonIds:a,personIds:o})=>this.updateService.editLessonPresences(a,o,r||void 0,n||void 0))}};t.\u0275fac=function(n){return new(n||t)(R(Ci),R(ce))},t.\u0275prov=W({token:t,factory:t.\u0275fac,providedIn:"root"});let i=t;return i})();function Hi(i,t){return s=>{let e=i.find(n=>n.Id===s.TypeRef.Id);return!e||e.Id===t.dispensationPresenceTypeId||e.Id===t.halfDayPresenceTypeId||e.IsIncident}}var X=(()=>{let t=class t extends Pi{constructor(e,n,r,a,o,g,v){super(e,n,r,a,"/edit-absences"),this.lessonPresencesService=o,this.presenceTypesService=g,this.dropDownItemsService=v,this.presenceTypes$=this.loadPresenceTypes().pipe(pe(1)),this.absenceConfirmationStates$=this.loadAbsenceConfirmationStates().pipe(S(hi),pe(1)),this.presenceControlEntries$=De([this.entries$,this.presenceTypes$,this.absenceConfirmationStates$]).pipe(S(yi(Di)),pe(1)),this.selected=[],this.queryParamsString$.pipe(M(this.destroy$)).subscribe(F=>this.confirmBackLinkParams={returnparams:F})}resetSelection(){this.selected=[]}updateAfterConfirm(){this.resetEntries()}getInitialFilter(){return{student:null,educationalEvent:null,studyClass:null,teacher:null,dateFrom:null,dateTo:null,presenceTypes:null,confirmationStates:null,incidentTypes:null}}isValidFilter(e){return!!(e.student||e.educationalEvent||e.studyClass||e.teacher||e.dateFrom||e.dateTo||e.presenceTypes||e.confirmationStates||e.incidentTypes)}loadEntries(e,n,r){let a={sort:"StudentFullName.asc,LessonDateTimeFrom.asc"};return this.loadingService.load(this.lessonPresencesService.getFilteredList(e,r,a),Li)}buildParamsFromFilter(e){return Vi(e)}loadPresenceTypes(){return this.loadingService.load(this.presenceTypesService.activePresenceTypes$)}loadAbsenceConfirmationStates(){return this.loadingService.load(this.dropDownItemsService.getAbsenceConfirmationStates())}};t.\u0275fac=function(n){return new(n||t)(R(Rt),R(Fi),R(Mi),R(ce),R(Si),R(Ue),R(We))},t.\u0275prov=W({token:t,factory:t.\u0275fac});let i=t;return i})();var _n=(i,t,s)=>({confirmationStates:i,categories:t,formGroup:s});function gn(i,t){if(i&1&&(c(0,"div",11),h(1),u(2,"translate"),d()),i&2){let s=t.$implicit;l(),E(" ",ie(2,1,"global.validation-errors."+s.error,s.params)," ")}}function bn(i,t){if(i&1&&(c(0,"option",23),h(1),d()),i&2){let s=t.$implicit;p("ngValue",s.Id),l(),E(" ",s.Designation," ")}}function vn(i,t){if(i&1&&(c(0,"select",22),u(1,"async"),c(2,"option",23),h(3),u(4,"translate"),d(),b(5,bn,2,2,"option",24),u(6,"async"),d()),i&2){let s,e=f(6);$("is-invalid",((s=m(1,5,e.absenceTypeIdErrors$))==null?null:s.length)||!1),l(2),p("ngValue",null),l(),E(" ",m(4,7,"edit-absences.edit.absence-type-placeholder")," "),l(2),p("ngForOf",m(6,9,e.absenceTypes$))}}function En(i,t){if(i&1&&(c(0,"div",25),h(1),u(2,"translate"),d()),i&2){let s=t.$implicit;l(),E(" ",ie(2,1,"global.validation-errors."+s.error,s.params)," ")}}function Cn(i,t){if(i&1&&(c(0,"div",18),D(1,"input",19),c(2,"label",14),h(3),d(),b(4,vn,7,11,"select",20)(5,En,3,4,"div",21),u(6,"async"),d()),i&2){let s=t.$implicit,e=f(5);l(),p("id","state-"+s.Key)("value",s.Key),l(),me("for","state-"+s.Key),l(),E(" ",s.Value," "),l(),p("ngIf",e.isExcused(s)),l(),p("ngForOf",m(6,6,e.absenceTypeIdErrors$))}}function yn(i,t){if(i&1&&(c(0,"div",16),b(1,Cn,7,8,"div",17),d()),i&2){let s=f(3).bkdLet;l(),p("ngForOf",s.confirmationStates)}}function Sn(i,t){if(i&1&&(c(0,"option",23),h(1),d()),i&2){let s=t.$implicit;p("ngValue",s.Id),l(),E(" ",s.Designation," ")}}function Tn(i,t){if(i&1&&(c(0,"div",25),h(1),u(2,"translate"),d()),i&2){let s=t.$implicit;l(),E(" ",ie(2,1,"global.validation-errors."+s.error,s.params)," ")}}function In(i,t){if(i&1&&(c(0,"div",16)(1,"select",26),u(2,"async"),c(3,"option",23),h(4),u(5,"translate"),d(),b(6,Sn,2,2,"option",24),u(7,"async"),d(),b(8,Tn,3,4,"div",21),u(9,"async"),d()),i&2){let s,e=f(4);l(),$("is-invalid",((s=m(2,6,e.incidentIdErrors$))==null?null:s.length)||!1),l(2),p("ngValue",null),l(),E(" ",m(5,8,"edit-absences.edit.incident-placeholder")," "),l(2),p("ngForOf",m(7,10,e.incidents$)),l(2),p("ngForOf",m(9,12,e.incidentIdErrors$))}}function xn(i,t){if(i&1&&(c(0,"div",12),D(1,"input",13),c(2,"label",14),h(3),u(4,"translate"),d(),b(5,yn,2,1,"div",15)(6,In,10,14,"div",15),d()),i&2){let s=t.$implicit,e=f(3);l(),p("id","category-"+s)("value",s),l(),me("for","category-"+s),l(),E(" ",m(4,6,"edit-absences.edit.categories."+s)," "),l(2),p("ngIf",e.isAbsent(s)),l(),p("ngIf",e.isIncident(s))}}function wn(i,t){i&1&&(c(0,"div",27)(1,"span",28),h(2,"Loading..."),d()())}function Fn(i,t){if(i&1){let s=V();c(0,"form",3),x("ngSubmit",function(){C(s);let n=f(2);return y(n.onSubmit())}),b(1,gn,3,4,"div",4),u(2,"async"),c(3,"div",5),b(4,xn,7,8,"div",6),d(),c(5,"div",7)(6,"button",8),u(7,"async"),x("click",function(){C(s);let n=f(2);return y(n.cancel())}),h(8),u(9,"translate"),d(),c(10,"button",9),u(11,"async"),h(12),u(13,"translate"),b(14,wn,3,0,"div",10),u(15,"async"),d()()()}if(i&2){let s=f().bkdLet,e=f();p("formGroup",s.formGroup),l(),p("ngForOf",m(2,8,e.formErrors$)),l(3),p("ngForOf",s.categories),l(2),p("disabled",m(7,10,e.saving$)),l(2),E(" ",m(9,12,"edit-absences.edit.cancel")," "),l(2),p("disabled",m(11,14,e.saving$)),l(2),E(" ",m(13,16,"edit-absences.edit.save")," "),l(2),p("ngIf",m(15,18,e.saving$))}}function An(i,t){if(i&1&&(c(0,"div",1),b(1,Fn,16,20,"form",2),d()),i&2){let s=t.bkdLet;l(),p("ngIf",s.formGroup&&s.confirmationStates)}}var Wi=(()=>{let t=class t{constructor(e,n,r,a,o,g,v,F,P,oe){this.fb=e,this.router=n,this.route=r,this.toastService=a,this.translate=o,this.state=g,this.dropDownItemsService=v,this.presenceTypesService=F,this.updateService=P,this.settings=oe,this.absenceTypes$=this.presenceTypesService.confirmationTypes$,this.incidents$=this.presenceTypesService.incidentTypes$,this.formGroup$=this.createFormGroup(),this.saving$=new Ze(!1),this.submitted$=new Ze(!1),this.formErrors$=He(this.formGroup$,this.submitted$),this.absenceTypeIdErrors$=He(this.formGroup$,this.submitted$,"absenceTypeId"),this.incidentIdErrors$=He(this.formGroup$,this.submitted$,"incidentId"),this.availableCategories=[L.Absent,L.Dispensation,L.HalfDay,L.Incident,L.Present],this.confirmationStates$=this.dropDownItemsService.getAbsenceConfirmationStates().pipe(S(this.sortAbsenceConfirmationStates.bind(this)),pe(1)),this.activeCategories$=this.presenceTypesService.halfDayActive$.pipe(S(J=>J?this.availableCategories:this.availableCategories.filter(fe=>fe!==L.HalfDay))),this.destroy$=new se}ngOnInit(){this.state.selected.length===0&&this.navigateBack(),dt(this.formGroup$,"category").pipe(M(this.destroy$)).subscribe(this.updateConfirmationValueDisabled.bind(this)),dt(this.formGroup$,"confirmationValue").pipe(M(this.destroy$)).subscribe(this.updateAbsenceTypeIdDisabled.bind(this))}ngOnDestroy(){this.destroy$.next()}isAbsent(e){return e===L.Absent}isExcused(e){return e.Key===this.settings.excusedAbsenceStateId}isIncident(e){return e===L.Incident}onSubmit(){this.submitted$.next(!0),this.formGroup$.pipe(ee(1)).subscribe(e=>{e.valid&&this.save(e)})}cancel(){this.navigateBack()}createFormGroup(){return this.getInitialAbsenceTypeId().pipe(S(e=>this.fb.group({category:[L.Absent,xe.required],confirmationValue:[this.settings.excusedAbsenceStateId,xe.required],absenceTypeId:[e,xe.required],incidentId:[{value:null,disabled:!0},xe.required]})),pe(1))}getInitialAbsenceTypeId(){return this.absenceTypes$.pipe(ee(1),S(e=>{let n=e.map(a=>a.Id),r=ui(this.state.selected.map(a=>a.TypeRef.Id));return r.length===1&&r[0]!=null&&n.includes(r[0])?r[0]:null}))}updateConfirmationValueDisabled(){this.formGroup$.pipe(ee(1)).subscribe(e=>{let n=e.get("category"),r=e.get("confirmationValue"),a=e.get("absenceTypeId"),o=e.get("incidentId");n&&r&&a&&o&&(n.value===L.Absent?(r.enable(),this.updateAbsenceTypeIdDisabled()):(r.disable(),a.disable()),n.value===L.Incident?o.enable():o.disable())})}updateAbsenceTypeIdDisabled(){this.formGroup$.pipe(ee(1)).subscribe(e=>{let n=e.get("confirmationValue"),r=e.get("absenceTypeId");n&&r&&(n.value===this.settings.excusedAbsenceStateId?r.enable():r.disable())})}save(e){this.saving$.next(!0);let{category:n,confirmationValue:r,absenceTypeId:a,incidentId:o}=e.value;this.presenceTypesService.presenceTypes$.pipe(Se(g=>this.updateService.update(this.state.selected,g,n,r,a,o)),xt(()=>this.saving$.next(!1))).subscribe(this.onSaveSuccess.bind(this))}onSaveSuccess(){this.state.resetSelection(),this.toastService.success(this.translate.instant("edit-absences.edit.save-success")),this.navigateBack(!0)}navigateBack(e){this.route.queryParams.pipe(ee(1)).subscribe(n=>{this.router.navigate(["/edit-absences"],{queryParams:ke(_e({},Ii(n.returnparams)),{reload:e})})})}sortAbsenceConfirmationStates(e){return e.slice().sort((n,r)=>n.Key===this.settings.excusedAbsenceStateId?-1:r.Key===this.settings.excusedAbsenceStateId?1:n.Value.localeCompare(r.Value))}};t.\u0275fac=function(n){return new(n||t)(_(ai),_(qt),_(Ne),_(pi),_($e),_(X),_(We),_(Ue),_(Gi),_(ce))},t.\u0275cmp=j({type:t,selectors:[["bkd-edit-absences-edit"]],standalone:!0,features:[te],decls:7,vars:14,consts:[["class","bkd-container bkd-container-limited",4,"bkdLet"],[1,"bkd-container","bkd-container-limited"],[3,"formGroup","ngSubmit",4,"ngIf"],[3,"ngSubmit","formGroup"],["class","alert alert-danger",4,"ngFor","ngForOf"],[1,"form-group","pb-4"],["class","form-check mt-2 mb-3",4,"ngFor","ngForOf"],[1,"d-flex","justify-content-end"],["type","button",1,"btn","btn-outline-secondary",3,"click","disabled"],["type","submit",1,"btn","btn-primary","ms-2",3,"disabled"],["class","spinner-border spinner-border-sm align-middle","role","status",4,"ngIf"],[1,"alert","alert-danger"],[1,"form-check","mt-2","mb-3"],["type","radio","formControlName","category",1,"form-check-input",3,"id","value"],[1,"form-check-label",3,"for"],["class","ms-5",4,"ngIf"],[1,"ms-5"],["class","form-check mt-2 mb-2",4,"ngFor","ngForOf"],[1,"form-check","mt-2","mb-2"],["type","radio","formControlName","confirmationValue",1,"form-check-input",3,"id","value"],["class","form-select mt-1","formControlName","absenceTypeId",3,"is-invalid",4,"ngIf"],["class","invalid-feedback",4,"ngFor","ngForOf"],["formControlName","absenceTypeId",1,"form-select","mt-1"],[3,"ngValue"],[3,"ngValue",4,"ngFor","ngForOf"],[1,"invalid-feedback"],["formControlName","incidentId",1,"form-select","mt-1"],["role","status",1,"spinner-border","spinner-border-sm","align-middle"],[1,"visually-hidden"]],template:function(n,r){n&1&&(c(0,"h1"),h(1),u(2,"translate"),d(),b(3,An,2,1,"div",0),u(4,"async"),u(5,"async"),u(6,"async")),n&2&&(l(),T(m(2,2,"edit-absences.title")),l(2),p("bkdLet",Pe(10,_n,m(4,4,r.confirmationStates$),m(5,6,r.activeCategories$),m(6,8,r.formGroup$))))},dependencies:[Ge,Me,je,Xt,si,ri,Yt,ni,ei,Re,Zt,oi,ti,ii,Ee,Ce,ue,de],changeDetection:0});let i=t;return i})();var Qe=(()=>{let t=class t extends vi{};t.\u0275fac=(()=>{let e;return function(r){return(e||(e=Bt(t)))(r||t)}})(),t.\u0275prov=W({token:t,factory:t.\u0275fac});let i=t;return i})();var Dn=["content"],On=["scroll"],Bn=["padding"],zi=["*"],Ae=i=>({searchTerm:i});function Ln(i,t){if(i&1&&(c(0,"div",3),it(1,6),d()),i&2){let s=f();l(),p("ngTemplateOutlet",s.headerTemplate)("ngTemplateOutletContext",Y(2,Ae,s.filterValue))}}function Pn(i,t){if(i&1&&(c(0,"div",5),it(1,6),d()),i&2){let s=f();l(),p("ngTemplateOutlet",s.footerTemplate)("ngTemplateOutletContext",Y(2,Ae,s.filterValue))}}var Vn=["searchInput"],Mn=["clearButton"],Nn=(i,t,s)=>({item:i,clear:t,label:s}),Rn=(i,t)=>({items:i,clear:t}),jn=(i,t,s,e)=>({item:i,item$:t,index:s,searchTerm:e});function $n(i,t){if(i&1){let s=V();c(0,"span",21),x("click",function(){C(s);let n=f().$implicit,r=f(2);return y(r.unselect(n))}),h(1,"\xD7"),d(),D(2,"span",22)}if(i&2){let s=f().$implicit,e=f(2);l(2),p("ngItemLabel",s.label)("escape",e.escapeHTML)}}function Hn(i,t){}function Gn(i,t){if(i&1&&(c(0,"div",20),b(1,$n,3,2,"ng-template",null,1,Z)(3,Hn,0,0,"ng-template",12),d()),i&2){let s=t.$implicit,e=N(2),n=f(2);$("ng-value-disabled",s.disabled),l(3),p("ngTemplateOutlet",n.labelTemplate||e)("ngTemplateOutletContext",Pe(4,Nn,s.value,n.clearItem,s.label))}}function Wn(i,t){if(i&1&&et(0,Gn,4,8,"div",19,Xe().trackByOption,!0),i&2){let s=f();tt(s.selectedItems)}}function qn(i,t){}function Un(i,t){if(i&1&&b(0,qn,0,0,"ng-template",12),i&2){let s=f();p("ngTemplateOutlet",s.multiLabelTemplate)("ngTemplateOutletContext",Vt(2,Rn,s.selectedValues,s.clearItem))}}function zn(i,t){i&1&&D(0,"div",24)}function Qn(i,t){}function Kn(i,t){if(i&1&&b(0,zn,1,0,"ng-template",null,2,Z)(2,Qn,0,0,"ng-template",23),i&2){let s=N(1),e=f();l(2),p("ngTemplateOutlet",e.loadingSpinnerTemplate||s)}}function Yn(i,t){if(i&1&&(c(0,"span",15,3)(2,"span",25),h(3,"\xD7"),d()()),i&2){let s=f();me("title",s.clearAllText)}}function Zn(i,t){if(i&1&&D(0,"span",30),i&2){let s=f().$implicit,e=f(2);p("ngItemLabel",s.label)("escape",e.escapeHTML)}}function Jn(i,t){}function Xn(i,t){if(i&1){let s=V();c(0,"div",29),x("click",function(){let n=C(s).$implicit,r=f(2);return y(r.toggleItem(n))})("mouseover",function(){let n=C(s).$implicit,r=f(2);return y(r.onItemHover(n))}),b(1,Zn,1,2,"ng-template",null,4,Z)(3,Jn,0,0,"ng-template",12),d()}if(i&2){let s=t.$implicit,e=N(2),n=f(2);$("ng-option-disabled",s.disabled)("ng-option-selected",s.selected)("ng-optgroup",s.children)("ng-option",!s.children)("ng-option-child",!!s.parent)("ng-option-marked",s===n.itemsList.markedItem),q("role",s.children?"group":"option")("aria-selected",s.selected)("id",s==null?null:s.htmlId),l(3),p("ngTemplateOutlet",s.children?n.optgroupTemplate||e:n.optionTemplate||e)("ngTemplateOutletContext",Ve(17,jn,s.value,s,s.index,n.searchTerm))}}function es(i,t){if(i&1&&(c(0,"span")(1,"span",32),h(2),d(),h(3),d()),i&2){let s=f(3);l(2),T(s.addTagText),l(),E('"',s.searchTerm,'"')}}function ts(i,t){}function is(i,t){if(i&1){let s=V();c(0,"div",31),x("mouseover",function(){C(s);let n=f(2);return y(n.itemsList.unmarkItem())})("click",function(){C(s);let n=f(2);return y(n.selectTag())}),b(1,es,4,2,"ng-template",null,5,Z)(3,ts,0,0,"ng-template",12),d()}if(i&2){let s=N(2),e=f(2);$("ng-option-marked",!e.itemsList.markedItem),l(3),p("ngTemplateOutlet",e.tagTemplate||s)("ngTemplateOutletContext",Y(4,Ae,e.searchTerm))}}function ns(i,t){if(i&1&&(c(0,"div",33),h(1),d()),i&2){let s=f(3);l(),T(s.notFoundText)}}function ss(i,t){}function rs(i,t){if(i&1&&b(0,ns,2,1,"ng-template",null,6,Z)(2,ss,0,0,"ng-template",12),i&2){let s=N(1),e=f(2);l(2),p("ngTemplateOutlet",e.notFoundTemplate||s)("ngTemplateOutletContext",Y(2,Ae,e.searchTerm))}}function as(i,t){if(i&1&&(c(0,"div",33),h(1),d()),i&2){let s=f(3);l(),T(s.typeToSearchText)}}function os(i,t){}function ls(i,t){if(i&1&&b(0,as,2,1,"ng-template",null,7,Z)(2,os,0,0,"ng-template",23),i&2){let s=N(1),e=f(2);l(2),p("ngTemplateOutlet",e.typeToSearchTemplate||s)}}function cs(i,t){if(i&1&&(c(0,"div",33),h(1),d()),i&2){let s=f(3);l(),T(s.loadingText)}}function ds(i,t){}function us(i,t){if(i&1&&b(0,cs,2,1,"ng-template",null,8,Z)(2,ds,0,0,"ng-template",12),i&2){let s=N(1),e=f(2);l(2),p("ngTemplateOutlet",e.loadingTextTemplate||s)("ngTemplateOutletContext",Y(2,Ae,e.searchTerm))}}function ps(i,t){if(i&1){let s=V();c(0,"ng-dropdown-panel",26),x("update",function(n){C(s);let r=f();return y(r.viewPortItems=n)})("scroll",function(n){C(s);let r=f();return y(r.scroll.emit(n))})("scrollToEnd",function(n){C(s);let r=f();return y(r.scrollToEnd.emit(n))})("outsideClick",function(){C(s);let n=f();return y(n.close())}),ge(1),et(2,Xn,4,22,"div",27,Xe().trackByOption,!0),b(4,is,4,6,"div",28),be(),b(5,rs,3,4)(6,ls,3,1)(7,us,3,4),d()}if(i&2){let s=f();$("ng-select-multiple",s.multiple),p("virtualScroll",s.virtualScroll)("bufferAmount",s.bufferAmount)("appendTo",s.appendTo)("position",s.dropdownPosition)("headerTemplate",s.headerTemplate)("footerTemplate",s.footerTemplate)("filterValue",s.searchTerm)("items",s.itemsList.filteredItems)("markedItem",s.itemsList.markedItem)("ngClass",s.appendTo?s.classes:null)("id",s.dropdownId),l(2),tt(s.viewPortItems),l(2),U(s.showAddTag?4:-1),l(),U(s.showNoItemsFound()?5:-1),l(),U(s.showTypeToSearch()?6:-1),l(),U(s.loading&&s.itemsList.filteredItems.length===0?7:-1)}}var Qi=/[&<>"']/g,ms=RegExp(Qi.source),hs={"&":"&","<":"<",">":">",'"':""","'":"'"};function fs(i){return i&&ms.test(i)?i.replace(Qi,t=>hs[t]):i}function w(i){return i!=null}function Fe(i){return typeof i=="object"&&w(i)}function _s(i){return i instanceof Promise}function Ye(i){return i instanceof Function}var gs=(()=>{let t=class t{constructor(e){this.element=e,this.escape=!0}ngOnChanges(e){this.element.nativeElement.innerHTML=this.escape?fs(this.ngItemLabel):this.ngItemLabel}};t.\u0275fac=function(n){return new(n||t)(_(re))},t.\u0275dir=H({type:t,selectors:[["","ngItemLabel",""]],inputs:{ngItemLabel:"ngItemLabel",escape:"escape"},features:[Te]});let i=t;return i})(),bt=(()=>{let t=class t{constructor(e){this.template=e}};t.\u0275fac=function(n){return new(n||t)(_(I))},t.\u0275dir=H({type:t,selectors:[["","ng-option-tmp",""]]});let i=t;return i})(),vt=(()=>{let t=class t{constructor(e){this.template=e}};t.\u0275fac=function(n){return new(n||t)(_(I))},t.\u0275dir=H({type:t,selectors:[["","ng-optgroup-tmp",""]]});let i=t;return i})(),bs=(()=>{let t=class t{constructor(e){this.template=e}};t.\u0275fac=function(n){return new(n||t)(_(I))},t.\u0275dir=H({type:t,selectors:[["","ng-label-tmp",""]]});let i=t;return i})(),Et=(()=>{let t=class t{constructor(e){this.template=e}};t.\u0275fac=function(n){return new(n||t)(_(I))},t.\u0275dir=H({type:t,selectors:[["","ng-multi-label-tmp",""]]});let i=t;return i})(),vs=(()=>{let t=class t{constructor(e){this.template=e}};t.\u0275fac=function(n){return new(n||t)(_(I))},t.\u0275dir=H({type:t,selectors:[["","ng-header-tmp",""]]});let i=t;return i})(),Es=(()=>{let t=class t{constructor(e){this.template=e}};t.\u0275fac=function(n){return new(n||t)(_(I))},t.\u0275dir=H({type:t,selectors:[["","ng-footer-tmp",""]]});let i=t;return i})(),Cs=(()=>{let t=class t{constructor(e){this.template=e}};t.\u0275fac=function(n){return new(n||t)(_(I))},t.\u0275dir=H({type:t,selectors:[["","ng-notfound-tmp",""]]});let i=t;return i})(),ys=(()=>{let t=class t{constructor(e){this.template=e}};t.\u0275fac=function(n){return new(n||t)(_(I))},t.\u0275dir=H({type:t,selectors:[["","ng-typetosearch-tmp",""]]});let i=t;return i})(),Ss=(()=>{let t=class t{constructor(e){this.template=e}};t.\u0275fac=function(n){return new(n||t)(_(I))},t.\u0275dir=H({type:t,selectors:[["","ng-loadingtext-tmp",""]]});let i=t;return i})(),Ts=(()=>{let t=class t{constructor(e){this.template=e}};t.\u0275fac=function(n){return new(n||t)(_(I))},t.\u0275dir=H({type:t,selectors:[["","ng-tag-tmp",""]]});let i=t;return i})(),Is=(()=>{let t=class t{constructor(e){this.template=e}};t.\u0275fac=function(n){return new(n||t)(_(I))},t.\u0275dir=H({type:t,selectors:[["","ng-loadingspinner-tmp",""]]});let i=t;return i})();function Ki(){return"axxxxxxxxxxx".replace(/[x]/g,()=>(Math.random()*16|0).toString(16))}var xs={"\u24B6":"A",\uFF21:"A",\u00C0:"A",\u00C1:"A",\u00C2:"A",\u1EA6:"A",\u1EA4:"A",\u1EAA:"A",\u1EA8:"A",\u00C3:"A",\u0100:"A",\u0102:"A",\u1EB0:"A",\u1EAE:"A",\u1EB4:"A",\u1EB2:"A",\u0226:"A",\u01E0:"A",\u00C4:"A",\u01DE:"A",\u1EA2:"A",\u00C5:"A",\u01FA:"A",\u01CD:"A",\u0200:"A",\u0202:"A",\u1EA0:"A",\u1EAC:"A",\u1EB6:"A",\u1E00:"A",\u0104:"A","\u023A":"A","\u2C6F":"A","\uA732":"AA",\u00C6:"AE",\u01FC:"AE",\u01E2:"AE","\uA734":"AO","\uA736":"AU","\uA738":"AV","\uA73A":"AV","\uA73C":"AY","\u24B7":"B",\uFF22:"B",\u1E02:"B",\u1E04:"B",\u1E06:"B","\u0243":"B",\u0182:"B",\u0181:"B","\u24B8":"C",\uFF23:"C",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u00C7:"C",\u1E08:"C",\u0187:"C","\u023B":"C","\uA73E":"C","\u24B9":"D",\uFF24:"D",\u1E0A:"D",\u010E:"D",\u1E0C:"D",\u1E10:"D",\u1E12:"D",\u1E0E:"D",\u0110:"D",\u018B:"D",\u018A:"D",\u0189:"D","\uA779":"D",\u01F1:"DZ",\u01C4:"DZ",\u01F2:"Dz",\u01C5:"Dz","\u24BA":"E",\uFF25:"E",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u1EC0:"E",\u1EBE:"E",\u1EC4:"E",\u1EC2:"E",\u1EBC:"E",\u0112:"E",\u1E14:"E",\u1E16:"E",\u0114:"E",\u0116:"E",\u00CB:"E",\u1EBA:"E",\u011A:"E",\u0204:"E",\u0206:"E",\u1EB8:"E",\u1EC6:"E",\u0228:"E",\u1E1C:"E",\u0118:"E",\u1E18:"E",\u1E1A:"E",\u0190:"E",\u018E:"E","\u24BB":"F",\uFF26:"F",\u1E1E:"F",\u0191:"F","\uA77B":"F","\u24BC":"G",\uFF27:"G",\u01F4:"G",\u011C:"G",\u1E20:"G",\u011E:"G",\u0120:"G",\u01E6:"G",\u0122:"G",\u01E4:"G",\u0193:"G","\uA7A0":"G","\uA77D":"G","\uA77E":"G","\u24BD":"H",\uFF28:"H",\u0124:"H",\u1E22:"H",\u1E26:"H",\u021E:"H",\u1E24:"H",\u1E28:"H",\u1E2A:"H",\u0126:"H","\u2C67":"H","\u2C75":"H","\uA78D":"H","\u24BE":"I",\uFF29:"I",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u0128:"I",\u012A:"I",\u012C:"I",\u0130:"I",\u00CF:"I",\u1E2E:"I",\u1EC8:"I",\u01CF:"I",\u0208:"I",\u020A:"I",\u1ECA:"I",\u012E:"I",\u1E2C:"I",\u0197:"I","\u24BF":"J",\uFF2A:"J",\u0134:"J","\u0248":"J","\u24C0":"K",\uFF2B:"K",\u1E30:"K",\u01E8:"K",\u1E32:"K",\u0136:"K",\u1E34:"K",\u0198:"K","\u2C69":"K","\uA740":"K","\uA742":"K","\uA744":"K","\uA7A2":"K","\u24C1":"L",\uFF2C:"L",\u013F:"L",\u0139:"L",\u013D:"L",\u1E36:"L",\u1E38:"L",\u013B:"L",\u1E3C:"L",\u1E3A:"L",\u0141:"L","\u023D":"L","\u2C62":"L","\u2C60":"L","\uA748":"L","\uA746":"L","\uA780":"L",\u01C7:"LJ",\u01C8:"Lj","\u24C2":"M",\uFF2D:"M",\u1E3E:"M",\u1E40:"M",\u1E42:"M","\u2C6E":"M",\u019C:"M","\u24C3":"N",\uFF2E:"N",\u01F8:"N",\u0143:"N",\u00D1:"N",\u1E44:"N",\u0147:"N",\u1E46:"N",\u0145:"N",\u1E4A:"N",\u1E48:"N","\u0220":"N",\u019D:"N","\uA790":"N","\uA7A4":"N",\u01CA:"NJ",\u01CB:"Nj","\u24C4":"O",\uFF2F:"O",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u1ED2:"O",\u1ED0:"O",\u1ED6:"O",\u1ED4:"O",\u00D5:"O",\u1E4C:"O",\u022C:"O",\u1E4E:"O",\u014C:"O",\u1E50:"O",\u1E52:"O",\u014E:"O",\u022E:"O",\u0230:"O",\u00D6:"O",\u022A:"O",\u1ECE:"O",\u0150:"O",\u01D1:"O",\u020C:"O",\u020E:"O",\u01A0:"O",\u1EDC:"O",\u1EDA:"O",\u1EE0:"O",\u1EDE:"O",\u1EE2:"O",\u1ECC:"O",\u1ED8:"O",\u01EA:"O",\u01EC:"O",\u00D8:"O",\u01FE:"O",\u0186:"O",\u019F:"O","\uA74A":"O","\uA74C":"O",\u01A2:"OI","\uA74E":"OO",\u0222:"OU","\u24C5":"P",\uFF30:"P",\u1E54:"P",\u1E56:"P",\u01A4:"P","\u2C63":"P","\uA750":"P","\uA752":"P","\uA754":"P","\u24C6":"Q",\uFF31:"Q","\uA756":"Q","\uA758":"Q","\u024A":"Q","\u24C7":"R",\uFF32:"R",\u0154:"R",\u1E58:"R",\u0158:"R",\u0210:"R",\u0212:"R",\u1E5A:"R",\u1E5C:"R",\u0156:"R",\u1E5E:"R","\u024C":"R","\u2C64":"R","\uA75A":"R","\uA7A6":"R","\uA782":"R","\u24C8":"S",\uFF33:"S","\u1E9E":"S",\u015A:"S",\u1E64:"S",\u015C:"S",\u1E60:"S",\u0160:"S",\u1E66:"S",\u1E62:"S",\u1E68:"S",\u0218:"S",\u015E:"S","\u2C7E":"S","\uA7A8":"S","\uA784":"S","\u24C9":"T",\uFF34:"T",\u1E6A:"T",\u0164:"T",\u1E6C:"T",\u021A:"T",\u0162:"T",\u1E70:"T",\u1E6E:"T",\u0166:"T",\u01AC:"T",\u01AE:"T","\u023E":"T","\uA786":"T","\uA728":"TZ","\u24CA":"U",\uFF35:"U",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u0168:"U",\u1E78:"U",\u016A:"U",\u1E7A:"U",\u016C:"U",\u00DC:"U",\u01DB:"U",\u01D7:"U",\u01D5:"U",\u01D9:"U",\u1EE6:"U",\u016E:"U",\u0170:"U",\u01D3:"U",\u0214:"U",\u0216:"U",\u01AF:"U",\u1EEA:"U",\u1EE8:"U",\u1EEE:"U",\u1EEC:"U",\u1EF0:"U",\u1EE4:"U",\u1E72:"U",\u0172:"U",\u1E76:"U",\u1E74:"U","\u0244":"U","\u24CB":"V",\uFF36:"V",\u1E7C:"V",\u1E7E:"V",\u01B2:"V","\uA75E":"V","\u0245":"V","\uA760":"VY","\u24CC":"W",\uFF37:"W",\u1E80:"W",\u1E82:"W",\u0174:"W",\u1E86:"W",\u1E84:"W",\u1E88:"W","\u2C72":"W","\u24CD":"X",\uFF38:"X",\u1E8A:"X",\u1E8C:"X","\u24CE":"Y",\uFF39:"Y",\u1EF2:"Y",\u00DD:"Y",\u0176:"Y",\u1EF8:"Y",\u0232:"Y",\u1E8E:"Y",\u0178:"Y",\u1EF6:"Y",\u1EF4:"Y",\u01B3:"Y","\u024E":"Y","\u1EFE":"Y","\u24CF":"Z",\uFF3A:"Z",\u0179:"Z",\u1E90:"Z",\u017B:"Z",\u017D:"Z",\u1E92:"Z",\u1E94:"Z",\u01B5:"Z",\u0224:"Z","\u2C7F":"Z","\u2C6B":"Z","\uA762":"Z","\u24D0":"a",\uFF41:"a",\u1E9A:"a",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u1EA7:"a",\u1EA5:"a",\u1EAB:"a",\u1EA9:"a",\u00E3:"a",\u0101:"a",\u0103:"a",\u1EB1:"a",\u1EAF:"a",\u1EB5:"a",\u1EB3:"a",\u0227:"a",\u01E1:"a",\u00E4:"a",\u01DF:"a",\u1EA3:"a",\u00E5:"a",\u01FB:"a",\u01CE:"a",\u0201:"a",\u0203:"a",\u1EA1:"a",\u1EAD:"a",\u1EB7:"a",\u1E01:"a",\u0105:"a","\u2C65":"a",\u0250:"a","\uA733":"aa",\u00E6:"ae",\u01FD:"ae",\u01E3:"ae","\uA735":"ao","\uA737":"au","\uA739":"av","\uA73B":"av","\uA73D":"ay","\u24D1":"b",\uFF42:"b",\u1E03:"b",\u1E05:"b",\u1E07:"b",\u0180:"b",\u0183:"b",\u0253:"b","\u24D2":"c",\uFF43:"c",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u00E7:"c",\u1E09:"c",\u0188:"c","\u023C":"c","\uA73F":"c","\u2184":"c","\u24D3":"d",\uFF44:"d",\u1E0B:"d",\u010F:"d",\u1E0D:"d",\u1E11:"d",\u1E13:"d",\u1E0F:"d",\u0111:"d",\u018C:"d",\u0256:"d",\u0257:"d","\uA77A":"d",\u01F3:"dz",\u01C6:"dz","\u24D4":"e",\uFF45:"e",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u1EC1:"e",\u1EBF:"e",\u1EC5:"e",\u1EC3:"e",\u1EBD:"e",\u0113:"e",\u1E15:"e",\u1E17:"e",\u0115:"e",\u0117:"e",\u00EB:"e",\u1EBB:"e",\u011B:"e",\u0205:"e",\u0207:"e",\u1EB9:"e",\u1EC7:"e",\u0229:"e",\u1E1D:"e",\u0119:"e",\u1E19:"e",\u1E1B:"e","\u0247":"e",\u025B:"e",\u01DD:"e","\u24D5":"f",\uFF46:"f",\u1E1F:"f",\u0192:"f","\uA77C":"f","\u24D6":"g",\uFF47:"g",\u01F5:"g",\u011D:"g",\u1E21:"g",\u011F:"g",\u0121:"g",\u01E7:"g",\u0123:"g",\u01E5:"g",\u0260:"g","\uA7A1":"g","\u1D79":"g","\uA77F":"g","\u24D7":"h",\uFF48:"h",\u0125:"h",\u1E23:"h",\u1E27:"h",\u021F:"h",\u1E25:"h",\u1E29:"h",\u1E2B:"h",\u1E96:"h",\u0127:"h","\u2C68":"h","\u2C76":"h",\u0265:"h",\u0195:"hv","\u24D8":"i",\uFF49:"i",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u0129:"i",\u012B:"i",\u012D:"i",\u00EF:"i",\u1E2F:"i",\u1EC9:"i",\u01D0:"i",\u0209:"i",\u020B:"i",\u1ECB:"i",\u012F:"i",\u1E2D:"i",\u0268:"i",\u0131:"i","\u24D9":"j",\uFF4A:"j",\u0135:"j",\u01F0:"j","\u0249":"j","\u24DA":"k",\uFF4B:"k",\u1E31:"k",\u01E9:"k",\u1E33:"k",\u0137:"k",\u1E35:"k",\u0199:"k","\u2C6A":"k","\uA741":"k","\uA743":"k","\uA745":"k","\uA7A3":"k","\u24DB":"l",\uFF4C:"l",\u0140:"l",\u013A:"l",\u013E:"l",\u1E37:"l",\u1E39:"l",\u013C:"l",\u1E3D:"l",\u1E3B:"l",\u017F:"l",\u0142:"l",\u019A:"l",\u026B:"l","\u2C61":"l","\uA749":"l","\uA781":"l","\uA747":"l",\u01C9:"lj","\u24DC":"m",\uFF4D:"m",\u1E3F:"m",\u1E41:"m",\u1E43:"m",\u0271:"m",\u026F:"m","\u24DD":"n",\uFF4E:"n",\u01F9:"n",\u0144:"n",\u00F1:"n",\u1E45:"n",\u0148:"n",\u1E47:"n",\u0146:"n",\u1E4B:"n",\u1E49:"n",\u019E:"n",\u0272:"n",\u0149:"n","\uA791":"n","\uA7A5":"n",\u01CC:"nj","\u24DE":"o",\uFF4F:"o",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u1ED3:"o",\u1ED1:"o",\u1ED7:"o",\u1ED5:"o",\u00F5:"o",\u1E4D:"o",\u022D:"o",\u1E4F:"o",\u014D:"o",\u1E51:"o",\u1E53:"o",\u014F:"o",\u022F:"o",\u0231:"o",\u00F6:"o",\u022B:"o",\u1ECF:"o",\u0151:"o",\u01D2:"o",\u020D:"o",\u020F:"o",\u01A1:"o",\u1EDD:"o",\u1EDB:"o",\u1EE1:"o",\u1EDF:"o",\u1EE3:"o",\u1ECD:"o",\u1ED9:"o",\u01EB:"o",\u01ED:"o",\u00F8:"o",\u01FF:"o",\u0254:"o","\uA74B":"o","\uA74D":"o",\u0275:"o",\u01A3:"oi",\u0223:"ou","\uA74F":"oo","\u24DF":"p",\uFF50:"p",\u1E55:"p",\u1E57:"p",\u01A5:"p","\u1D7D":"p","\uA751":"p","\uA753":"p","\uA755":"p","\u24E0":"q",\uFF51:"q","\u024B":"q","\uA757":"q","\uA759":"q","\u24E1":"r",\uFF52:"r",\u0155:"r",\u1E59:"r",\u0159:"r",\u0211:"r",\u0213:"r",\u1E5B:"r",\u1E5D:"r",\u0157:"r",\u1E5F:"r","\u024D":"r",\u027D:"r","\uA75B":"r","\uA7A7":"r","\uA783":"r","\u24E2":"s",\uFF53:"s",\u00DF:"s",\u015B:"s",\u1E65:"s",\u015D:"s",\u1E61:"s",\u0161:"s",\u1E67:"s",\u1E63:"s",\u1E69:"s",\u0219:"s",\u015F:"s","\u023F":"s","\uA7A9":"s","\uA785":"s",\u1E9B:"s","\u24E3":"t",\uFF54:"t",\u1E6B:"t",\u1E97:"t",\u0165:"t",\u1E6D:"t",\u021B:"t",\u0163:"t",\u1E71:"t",\u1E6F:"t",\u0167:"t",\u01AD:"t",\u0288:"t","\u2C66":"t","\uA787":"t","\uA729":"tz","\u24E4":"u",\uFF55:"u",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u0169:"u",\u1E79:"u",\u016B:"u",\u1E7B:"u",\u016D:"u",\u00FC:"u",\u01DC:"u",\u01D8:"u",\u01D6:"u",\u01DA:"u",\u1EE7:"u",\u016F:"u",\u0171:"u",\u01D4:"u",\u0215:"u",\u0217:"u",\u01B0:"u",\u1EEB:"u",\u1EE9:"u",\u1EEF:"u",\u1EED:"u",\u1EF1:"u",\u1EE5:"u",\u1E73:"u",\u0173:"u",\u1E77:"u",\u1E75:"u",\u0289:"u","\u24E5":"v",\uFF56:"v",\u1E7D:"v",\u1E7F:"v",\u028B:"v","\uA75F":"v",\u028C:"v","\uA761":"vy","\u24E6":"w",\uFF57:"w",\u1E81:"w",\u1E83:"w",\u0175:"w",\u1E87:"w",\u1E85:"w",\u1E98:"w",\u1E89:"w","\u2C73":"w","\u24E7":"x",\uFF58:"x",\u1E8B:"x",\u1E8D:"x","\u24E8":"y",\uFF59:"y",\u1EF3:"y",\u00FD:"y",\u0177:"y",\u1EF9:"y",\u0233:"y",\u1E8F:"y",\u00FF:"y",\u1EF7:"y",\u1E99:"y",\u1EF5:"y",\u01B4:"y","\u024F":"y","\u1EFF":"y","\u24E9":"z",\uFF5A:"z",\u017A:"z",\u1E91:"z",\u017C:"z",\u017E:"z",\u1E93:"z",\u1E95:"z",\u01B6:"z",\u0225:"z","\u0240":"z","\u2C6C":"z","\uA763":"z",\u0386:"\u0391",\u0388:"\u0395",\u0389:"\u0397",\u038A:"\u0399",\u03AA:"\u0399",\u038C:"\u039F",\u038E:"\u03A5",\u03AB:"\u03A5",\u038F:"\u03A9",\u03AC:"\u03B1",\u03AD:"\u03B5",\u03AE:"\u03B7",\u03AF:"\u03B9",\u03CA:"\u03B9",\u0390:"\u03B9",\u03CC:"\u03BF",\u03CD:"\u03C5",\u03CB:"\u03C5",\u03B0:"\u03C5",\u03C9:"\u03C9",\u03C2:"\u03C3"};function Ke(i){let t=s=>xs[s]||s;return i.replace(/[^\u0000-\u007E]/g,t)}var _t=class{constructor(t,s){this._ngSelect=t,this._selectionModel=s,this._items=[],this._filteredItems=[],this._markedIndex=-1}get items(){return this._items}get filteredItems(){return this._filteredItems}get markedIndex(){return this._markedIndex}get selectedItems(){return this._selectionModel.value}get markedItem(){return this._filteredItems[this._markedIndex]}get noItemsToSelect(){return this._ngSelect.hideSelected&&this._items.length===this.selectedItems.length}get maxItemsSelected(){return this._ngSelect.multiple&&this._ngSelect.maxSelectedItems<=this.selectedItems.length}get lastSelectedItem(){let t=this.selectedItems.length-1;for(;t>=0;t--){let s=this.selectedItems[t];if(!s.disabled)return s}return null}setItems(t){this._items=t.map((s,e)=>this.mapItem(s,e)),this._ngSelect.groupBy?(this._groups=this._groupBy(this._items,this._ngSelect.groupBy),this._items=this._flatten(this._groups)):(this._groups=new Map,this._groups.set(void 0,this._items)),this._filteredItems=[...this._items]}select(t){if(t.selected||this.maxItemsSelected)return;let s=this._ngSelect.multiple;s||this.clearSelected(),this._selectionModel.select(t,s,this._ngSelect.selectableGroupAsModel),this._ngSelect.hideSelected&&this._hideSelected(t)}unselect(t){t.selected&&(this._selectionModel.unselect(t,this._ngSelect.multiple),this._ngSelect.hideSelected&&w(t.index)&&this._ngSelect.multiple&&this._showSelected(t))}findItem(t){let s;return this._ngSelect.compareWith?s=e=>this._ngSelect.compareWith(e.value,t):this._ngSelect.bindValue?s=e=>!e.children&&this.resolveNested(e.value,this._ngSelect.bindValue)===t:s=e=>e.value===t||!e.children&&e.label&&e.label===this.resolveNested(t,this._ngSelect.bindLabel),this._items.find(e=>s(e))}addItem(t){let s=this.mapItem(t,this._items.length);return this._items.push(s),this._filteredItems.push(s),s}clearSelected(t=!1){this._selectionModel.clear(t),this._items.forEach(s=>{s.selected=t&&s.selected&&s.disabled,s.marked=!1}),this._ngSelect.hideSelected&&this.resetFilteredItems()}findByLabel(t){return t=Ke(t).toLocaleLowerCase(),this.filteredItems.find(s=>Ke(s.label).toLocaleLowerCase().substr(0,t.length)===t)}filter(t){if(!t){this.resetFilteredItems();return}this._filteredItems=[],t=this._ngSelect.searchFn?t:Ke(t).toLocaleLowerCase();let s=this._ngSelect.searchFn||this._defaultSearchFn,e=this._ngSelect.hideSelected;for(let n of Array.from(this._groups.keys())){let r=[];for(let a of this._groups.get(n)){if(e&&(a.parent&&a.parent.selected||a.selected))continue;let o=this._ngSelect.searchFn?a.value:a;s(t,o)&&r.push(a)}if(r.length>0){let[a]=r.slice(-1);if(a.parent){let o=this._items.find(g=>g===a.parent);this._filteredItems.push(o)}this._filteredItems.push(...r)}}}resetFilteredItems(){this._filteredItems.length!==this._items.length&&(this._ngSelect.hideSelected&&this.selectedItems.length>0?this._filteredItems=this._items.filter(t=>!t.selected):this._filteredItems=this._items)}unmarkItem(){this._markedIndex=-1}markNextItem(){this._stepToItem(1)}markPreviousItem(){this._stepToItem(-1)}markItem(t){this._markedIndex=this._filteredItems.indexOf(t)}markSelectedOrDefault(t){if(this._filteredItems.length===0)return;let s=this._getLastMarkedIndex();s>-1?this._markedIndex=s:this._markedIndex=t?this.filteredItems.findIndex(e=>!e.disabled):-1}resolveNested(t,s){if(!Fe(t))return t;if(s.indexOf(".")===-1)return t[s];{let e=s.split("."),n=t;for(let r=0,a=e.length;rthis.selectedItems.indexOf(s)===-1))}_showSelected(t){if(this._filteredItems.push(t),t.parent){let s=t.parent;this._filteredItems.find(n=>n===s)||this._filteredItems.push(s)}else if(t.children)for(let s of t.children)s.selected=!1,this._filteredItems.push(s);this._filteredItems=[...this._filteredItems.sort((s,e)=>s.index-e.index)]}_hideSelected(t){this._filteredItems=this._filteredItems.filter(s=>s!==t),t.parent?t.parent.children.every(e=>e.selected)&&(this._filteredItems=this._filteredItems.filter(e=>e!==t.parent)):t.children&&(this._filteredItems=this.filteredItems.filter(s=>s.parent!==t))}_defaultSearchFn(t,s){return Ke(s.label).toLocaleLowerCase().indexOf(t)>-1}_getNextItemIndex(t){return t>0?this._markedIndex>=this._filteredItems.length-1?0:this._markedIndex+1:this._markedIndex<=0?this._filteredItems.length-1:this._markedIndex-1}_stepToItem(t){this._filteredItems.length===0||this._filteredItems.every(s=>s.disabled)||(this._markedIndex=this._getNextItemIndex(t),this.markedItem.disabled&&this._stepToItem(t))}_getLastMarkedIndex(){if(this._ngSelect.hideSelected||this._markedIndex>-1&&this.markedItem===void 0)return-1;let t=this._filteredItems.indexOf(this.lastSelectedItem);return this.lastSelectedItem&&t<0?-1:Math.max(this.markedIndex,t)}_groupBy(t,s){let e=new Map;if(t.length===0)return e;if(Array.isArray(t[0].value[s])){for(let a of t){let o=(a.value[s]||[]).map((g,v)=>this.mapItem(g,v));e.set(a,o)}return e}let n=Ye(this._ngSelect.groupBy),r=a=>{let o=n?s(a.value):a.value[s];return w(o)?o:void 0};for(let a of t){let o=r(a),g=e.get(o);g?g.push(a):e.set(o,[a])}return e}_flatten(t){let s=Ye(this._ngSelect.groupBy),e=[];for(let n of Array.from(t.keys())){let r=e.length;if(n===void 0){let P=t.get(void 0)||[];e.push(...P.map(oe=>(oe.index=r++,oe)));continue}let a=Fe(n),o={label:a?"":String(n),children:void 0,parent:null,index:r++,disabled:!this._ngSelect.selectableGroup,htmlId:Ki()},g=s?this._ngSelect.bindLabel:this._ngSelect.groupBy,v=this._ngSelect.groupValue||(()=>a?n.value:{[g]:n}),F=t.get(n).map(P=>(P.parent=o,P.children=void 0,P.index=r++,P));o.children=F,o.value=v(n,F.map(P=>P.value)),e.push(o),e.push(...F)}return e}},ne=function(i){return i[i.Tab=9]="Tab",i[i.Enter=13]="Enter",i[i.Esc=27]="Esc",i[i.Space=32]="Space",i[i.ArrowUp=38]="ArrowUp",i[i.ArrowDown=40]="ArrowDown",i[i.Backspace=8]="Backspace",i}(ne||{}),Yi=(()=>{let t=class t{constructor(){this._dimensions={itemHeight:0,panelHeight:0,itemsPerViewport:0}}get dimensions(){return this._dimensions}calculateItems(e,n,r){let a=this._dimensions,o=a.itemHeight*n,v=Math.max(0,e)/o*n,F=Math.min(n,Math.ceil(v)+(a.itemsPerViewport+1)),oe=Math.max(0,F-a.itemsPerViewport),J=Math.min(oe,Math.floor(v)),fe=a.itemHeight*Math.ceil(J)-a.itemHeight*Math.min(J,r);return fe=isNaN(fe)?0:fe,J=isNaN(J)?-1:J,F=isNaN(F)?-1:F,J-=r,J=Math.max(0,J),F+=r,F=Math.min(n,F),{topPadding:fe,scrollHeight:o,start:J,end:F}}setDimensions(e,n){let r=Math.max(1,Math.floor(n/e));this._dimensions={itemHeight:e,panelHeight:n,itemsPerViewport:r}}getScrollTo(e,n,r){let{panelHeight:a}=this.dimensions,o=e+n,g=r,v=g+a;return a>=o&&r===e?null:o>v?g+o-v:e<=g?e:null}};t.\u0275fac=function(n){return new(n||t)},t.\u0275prov=W({token:t,factory:t.\u0275fac});let i=t;return i})(),qi=["top","right","bottom","left"],ws=typeof requestAnimationFrame<"u"?yt:Ct,Ui=(()=>{let t=class t{constructor(e,n,r,a,o){this._renderer=e,this._zone=n,this._panelService=r,this._document=o,this.items=[],this.position="auto",this.virtualScroll=!1,this.filterValue=null,this.update=new A,this.scroll=new A,this.scrollToEnd=new A,this.outsideClick=new A,this._destroy$=new se,this._scrollToEndFired=!1,this._updateScrollHeight=!1,this._lastScrollPosition=0,this._dropdown=a.nativeElement}get currentPosition(){return this._currentPosition}get itemsLength(){return this._itemsLength}set itemsLength(e){e!==this._itemsLength&&(this._itemsLength=e,this._onItemsLengthChanged())}get _startOffset(){if(this.markedItem){let{itemHeight:e,panelHeight:n}=this._panelService.dimensions,r=this.markedItem.index*e;return n>r?0:r}return 0}ngOnInit(){this._select=this._dropdown.parentElement,this._virtualPadding=this.paddingElementRef.nativeElement,this._scrollablePanel=this.scrollElementRef.nativeElement,this._contentPanel=this.contentElementRef.nativeElement,this._handleScroll(),this._handleOutsideClick(),this._appendDropdown(),this._setupMousedownListener()}ngOnChanges(e){if(e.items){let n=e.items;this._onItemsChange(n.currentValue,n.firstChange)}}ngOnDestroy(){this._destroy$.next(),this._destroy$.complete(),this._destroy$.unsubscribe(),this.appendTo&&this._renderer.removeChild(this._dropdown.parentNode,this._dropdown)}scrollTo(e,n=!1){if(!e)return;let r=this.items.indexOf(e);if(r<0||r>=this.itemsLength)return;let a;if(this.virtualScroll){let o=this._panelService.dimensions.itemHeight;a=this._panelService.getScrollTo(r*o,o,this._lastScrollPosition)}else{let o=this._dropdown.querySelector(`#${e.htmlId}`),g=n?o.offsetTop:this._lastScrollPosition;a=this._panelService.getScrollTo(o.offsetTop,o.clientHeight,g)}w(a)&&(this._scrollablePanel.scrollTop=a)}scrollToTag(){let e=this._scrollablePanel;e.scrollTop=e.scrollHeight-e.clientHeight}adjustPosition(){this._updateYPosition()}_handleDropdownPosition(){this._currentPosition=this._calculateCurrentPosition(this._dropdown),qi.includes(this._currentPosition)?this._updateDropdownClass(this._currentPosition):this._updateDropdownClass("bottom"),this.appendTo&&this._updateYPosition(),this._dropdown.style.opacity="1"}_updateDropdownClass(e){qi.forEach(r=>{let a=`ng-select-${r}`;this._renderer.removeClass(this._dropdown,a),this._renderer.removeClass(this._select,a)});let n=`ng-select-${e}`;this._renderer.addClass(this._dropdown,n),this._renderer.addClass(this._select,n)}_handleScroll(){this._zone.runOutsideAngular(()=>{ye(this.scrollElementRef.nativeElement,"scroll").pipe(M(this._destroy$),Tt(0,ws)).subscribe(e=>{let n=e.path||e.composedPath&&e.composedPath();if(!n||n.length===0&&!e.target)return;let r=!n||n.length===0?e.target.scrollTop:n[0].scrollTop;this._onContentScrolled(r)})})}_handleOutsideClick(){this._document&&this._zone.runOutsideAngular(()=>{Oe(ye(this._document,"touchstart",{capture:!0}),ye(this._document,"click",{capture:!0})).pipe(M(this._destroy$)).subscribe(e=>this._checkToClose(e))})}_checkToClose(e){if(this._select.contains(e.target)||this._dropdown.contains(e.target))return;let n=e.path||e.composedPath&&e.composedPath();e.target&&e.target.shadowRoot&&n&&n[0]&&this._select.contains(n[0])||this._zone.run(()=>this.outsideClick.emit())}_onItemsChange(e,n){this.items=e||[],this._scrollToEndFired=!1,this.itemsLength=e.length,this.virtualScroll?this._updateItemsRange(n):(this._setVirtualHeight(),this._updateItems(n))}_updateItems(e){this.update.emit(this.items),e!==!1&&this._zone.runOutsideAngular(()=>{Promise.resolve().then(()=>{let n=this._scrollablePanel.clientHeight;this._panelService.setDimensions(0,n),this._handleDropdownPosition(),this.scrollTo(this.markedItem,e)})})}_updateItemsRange(e){this._zone.runOutsideAngular(()=>{this._measureDimensions().then(()=>{e?(this._renderItemsRange(this._startOffset),this._handleDropdownPosition()):this._renderItemsRange()})})}_onContentScrolled(e){this.virtualScroll&&this._renderItemsRange(e),this._lastScrollPosition=e,this._fireScrollToEnd(e)}_updateVirtualHeight(e){this._updateScrollHeight&&(this._virtualPadding.style.height=`${e}px`,this._updateScrollHeight=!1)}_setVirtualHeight(){this._virtualPadding&&(this._virtualPadding.style.height="0px")}_onItemsLengthChanged(){this._updateScrollHeight=!0}_renderItemsRange(e=null){if(e&&this._lastScrollPosition===e)return;e=e||this._scrollablePanel.scrollTop;let n=this._panelService.calculateItems(e,this.itemsLength,this.bufferAmount);this._updateVirtualHeight(n.scrollHeight),this._contentPanel.style.transform=`translateY(${n.topPadding}px)`,this._zone.run(()=>{this.update.emit(this.items.slice(n.start,n.end)),this.scroll.emit({start:n.start,end:n.end})}),w(e)&&this._lastScrollPosition===0&&(this._scrollablePanel.scrollTop=e,this._lastScrollPosition=e)}_measureDimensions(){if(this._panelService.dimensions.itemHeight>0||this.itemsLength===0)return Promise.resolve(this._panelService.dimensions);let[e]=this.items;return this.update.emit([e]),Promise.resolve().then(()=>{let r=this._dropdown.querySelector(`#${e.htmlId}`).clientHeight;this._virtualPadding.style.height=`${r*this.itemsLength}px`;let a=this._scrollablePanel.clientHeight;return this._panelService.setDimensions(r,a),this._panelService.dimensions})}_fireScrollToEnd(e){if(this._scrollToEndFired||e===0)return;let n=this.virtualScroll?this._virtualPadding:this._contentPanel;e+this._dropdown.clientHeight>=n.clientHeight-1&&(this._zone.run(()=>this.scrollToEnd.emit()),this._scrollToEndFired=!0)}_calculateCurrentPosition(e){if(this.position!=="auto")return this.position;let n=this._select.getBoundingClientRect(),r=document.documentElement.scrollTop||document.body.scrollTop,a=n.top+window.pageYOffset,o=n.height,g=e.getBoundingClientRect().height;return a+o+g>r+document.documentElement.clientHeight?"top":"bottom"}_appendDropdown(){if(this.appendTo){if(this._parent=document.querySelector(this.appendTo),!this._parent)throw new Error(`appendTo selector ${this.appendTo} did not found any parent element`);this._updateXPosition(),this._parent.appendChild(this._dropdown)}}_updateXPosition(){let e=this._select.getBoundingClientRect(),n=this._parent.getBoundingClientRect(),r=e.left-n.left;this._dropdown.style.left=r+"px",this._dropdown.style.width=e.width+"px",this._dropdown.style.minWidth=e.width+"px"}_updateYPosition(){let e=this._select.getBoundingClientRect(),n=this._parent.getBoundingClientRect(),r=e.height;if(this._currentPosition==="top"){let a=n.bottom-e.bottom;this._dropdown.style.bottom=a+r+"px",this._dropdown.style.top="auto"}else if(this._currentPosition==="bottom"){let a=e.top-n.top;this._dropdown.style.top=a+r+"px",this._dropdown.style.bottom="auto"}}_setupMousedownListener(){this._zone.runOutsideAngular(()=>{ye(this._dropdown,"mousedown").pipe(M(this._destroy$)).subscribe(e=>{e.target.tagName!=="INPUT"&&e.preventDefault()})})}};t.\u0275fac=function(n){return new(n||t)(_(Lt),_(Pt),_(Yi),_(re),_(Nt,8))},t.\u0275cmp=j({type:t,selectors:[["ng-dropdown-panel"]],viewQuery:function(n,r){if(n&1&&(he(Dn,7,re),he(On,7,re),he(Bn,7,re)),n&2){let a;O(a=B())&&(r.contentElementRef=a.first),O(a=B())&&(r.scrollElementRef=a.first),O(a=B())&&(r.paddingElementRef=a.first)}},inputs:{items:"items",markedItem:"markedItem",position:"position",appendTo:"appendTo",bufferAmount:"bufferAmount",virtualScroll:[2,"virtualScroll","virtualScroll",k],headerTemplate:"headerTemplate",footerTemplate:"footerTemplate",filterValue:"filterValue"},outputs:{update:"update",scroll:"scroll",scrollToEnd:"scrollToEnd",outsideClick:"outsideClick"},features:[Le,Te],ngContentSelectors:zi,decls:9,vars:6,consts:[["scroll",""],["padding",""],["content",""],[1,"ng-dropdown-header"],["role","listbox",1,"ng-dropdown-panel-items","scroll-host"],[1,"ng-dropdown-footer"],[3,"ngTemplateOutlet","ngTemplateOutletContext"]],template:function(n,r){n&1&&(nt(),b(0,Ln,2,4,"div",3),c(1,"div",4,0),D(3,"div",null,1),c(5,"div",null,2),st(7),d()(),b(8,Pn,2,4,"div",5)),n&2&&(U(r.headerTemplate?0:-1),l(3),$("total-padding",r.virtualScroll),l(2),$("scrollable-content",r.virtualScroll&&r.items.length),l(3),U(r.footerTemplate?8:-1))},dependencies:[at],encapsulation:2,changeDetection:0});let i=t;return i})(),Fs=(()=>{let t=class t{constructor(e){this.elementRef=e,this.disabled=!1,this.stateChange$=new se}get label(){return(this.elementRef.nativeElement.textContent||"").trim()}ngOnChanges(e){e.disabled&&this.stateChange$.next({value:this.value,disabled:this.disabled})}ngAfterViewChecked(){this.label!==this._previousLabel&&(this._previousLabel=this.label,this.stateChange$.next({value:this.value,disabled:this.disabled,label:this.elementRef.nativeElement.innerHTML}))}ngOnDestroy(){this.stateChange$.complete()}};t.\u0275fac=function(n){return new(n||t)(_(re))},t.\u0275cmp=j({type:t,selectors:[["ng-option"]],inputs:{value:"value",disabled:[2,"disabled","disabled",k]},features:[Le,Te],ngContentSelectors:zi,decls:1,vars:0,template:function(n,r){n&1&&(nt(),st(0))},encapsulation:2,changeDetection:0});let i=t;return i})(),As=(()=>{let t=class t{constructor(){this.notFoundText="No items found",this.typeToSearchText="Type to search",this.addTagText="Add item",this.loadingText="Loading...",this.clearAllText="Clear all",this.disableVirtualScroll=!0,this.openOnEnter=!0,this.appearance="underline"}};t.\u0275fac=function(n){return new(n||t)},t.\u0275prov=W({token:t,factory:t.\u0275fac,providedIn:"root"});let i=t;return i})(),ks=(()=>{let t=class t{warn(e){console.warn(e)}};t.\u0275fac=function(n){return new(n||t)},t.\u0275prov=W({token:t,factory:t.\u0275fac,providedIn:"root"});let i=t;return i})(),Zi=new Dt("ng-select-selection-model"),Ji=(()=>{let t=class t{get items(){return this._items}set items(e){this._itemsAreUsed=!0,this._items=e??[]}get compareWith(){return this._compareWith}set compareWith(e){if(e!=null&&!Ye(e))throw Error("`compareWith` must be a function.");this._compareWith=e}get clearSearchOnAdd(){return w(this._clearSearchOnAdd)?this._clearSearchOnAdd:w(this.config.clearSearchOnAdd)?this.config.clearSearchOnAdd:this.closeOnSelect}set clearSearchOnAdd(e){this._clearSearchOnAdd=e}get deselectOnClick(){return w(this._deselectOnClick)?this._deselectOnClick:w(this.config.deselectOnClick)?this.config.deselectOnClick:this.multiple}set deselectOnClick(e){this._deselectOnClick=e}get disabled(){return this.readonly||this._disabled}get filtered(){return!!this.searchTerm&&this.searchable||this._isComposing}get single(){return!this.multiple}get _editableSearchTerm(){return this.editableSearchTerm&&!this.multiple}constructor(e,n,r,a,o,g,v){this.classes=e,this.autoFocus=n,this.config=r,this._cd=g,this._console=v,this.markFirst=!0,this.dropdownPosition="auto",this.loading=!1,this.closeOnSelect=!0,this.hideSelected=!1,this.selectOnTab=!1,this.bufferAmount=4,this.selectableGroup=!1,this.selectableGroupAsModel=!0,this.searchFn=null,this.trackByFn=null,this.clearOnBackspace=!0,this.labelForId=null,this.inputAttrs={},this.readonly=!1,this.searchWhileComposing=!0,this.minTermLength=0,this.editableSearchTerm=!1,this.keyDownFn=F=>!0,this.multiple=!1,this.addTag=!1,this.searchable=!0,this.clearable=!0,this.isOpen=!1,this.blurEvent=new A,this.focusEvent=new A,this.changeEvent=new A,this.openEvent=new A,this.closeEvent=new A,this.searchEvent=new A,this.clearEvent=new A,this.addEvent=new A,this.removeEvent=new A,this.scroll=new A,this.scrollToEnd=new A,this.useDefaultClass=!0,this.viewPortItems=[],this.searchTerm=null,this.dropdownId=Ki(),this.escapeHTML=!0,this._items=[],this._defaultLabel="label",this._pressedKeys=[],this._isComposing=!1,this._destroy$=new se,this._keyPress$=new se,this._onChange=F=>{},this._onTouched=()=>{},this.clearItem=F=>{let P=this.selectedItems.find(oe=>oe.value===F);this.unselect(P)},this.trackByOption=(F,P)=>this.trackByFn?this.trackByFn(P.value):P,this._mergeGlobalConfig(r),this.itemsList=new _t(this,a()),this.element=o.nativeElement}get selectedItems(){return this.itemsList.selectedItems}get selectedValues(){return this.selectedItems.map(e=>e.value)}get hasValue(){return this.selectedItems.length>0}get currentPanelPosition(){if(this.dropdownPanel)return this.dropdownPanel.currentPosition}ngOnInit(){this._handleKeyPresses(),this._setInputAttributes()}ngOnChanges(e){e.multiple&&this.itemsList.clearSelected(),e.items&&this._setItems(e.items.currentValue||[]),e.isOpen&&(this._manualOpen=w(e.isOpen.currentValue))}ngAfterViewInit(){this._itemsAreUsed||(this.escapeHTML=!1,this._setItemsFromNgOptions()),w(this.autoFocus)&&this.focus()}ngOnDestroy(){this._destroy$.next(),this._destroy$.complete()}handleKeyDown(e){if(ne[e.which]){if(this.keyDownFn(e)===!1)return;this.handleKeyCode(e)}else e.key&&e.key.length===1&&this._keyPress$.next(e.key.toLocaleLowerCase())}handleKeyCode(e){let n=e.target;this.clearButton&&this.clearButton.nativeElement===n?this.handleKeyCodeClear(e):this.handleKeyCodeInput(e)}handleKeyCodeInput(e){switch(e.which){case ne.ArrowDown:this._handleArrowDown(e);break;case ne.ArrowUp:this._handleArrowUp(e);break;case ne.Space:this._handleSpace(e);break;case ne.Enter:this._handleEnter(e);break;case ne.Tab:this._handleTab(e);break;case ne.Esc:this.close(),e.preventDefault();break;case ne.Backspace:this._handleBackspace();break}}handleKeyCodeClear(e){switch(e.which){case ne.Enter:this.handleClearClick(),e.preventDefault();break}}handleMousedown(e){let n=e.target;if(n.tagName!=="INPUT"&&e.preventDefault(),n.classList.contains("ng-clear-wrapper")){this.handleClearClick();return}if(n.classList.contains("ng-arrow-wrapper")){this.handleArrowClick();return}n.classList.contains("ng-value-icon")||(this.focused||this.focus(),this.searchable?this.open():this.toggle())}handleArrowClick(){this.isOpen?this.close():this.open()}handleClearClick(){this.hasValue&&(this.itemsList.clearSelected(!0),this._updateNgModel()),this._clearSearch(),this.focus(),this.clearEvent.emit(),this._onSelectionChanged()}clearModel(){this.clearable&&(this.itemsList.clearSelected(),this._updateNgModel())}writeValue(e){this.itemsList.clearSelected(),this._handleWriteValue(e),this._cd.markForCheck()}registerOnChange(e){this._onChange=e}registerOnTouched(e){this._onTouched=e}setDisabledState(e){this._disabled=e,this._cd.markForCheck()}toggle(){this.isOpen?this.close():this.open()}open(){this.disabled||this.isOpen||this._manualOpen||!this._isTypeahead&&!this.addTag&&this.itemsList.noItemsToSelect||(this.isOpen=!0,this.itemsList.markSelectedOrDefault(this.markFirst),this.openEvent.emit(),this.searchTerm||this.focus(),this.detectChanges())}close(){!this.isOpen||this._manualOpen||(this.isOpen=!1,this._isComposing=!1,this._editableSearchTerm?this.itemsList.resetFilteredItems():this._clearSearch(),this.itemsList.unmarkItem(),this._onTouched(),this.closeEvent.emit(),this._cd.markForCheck())}toggleItem(e){!e||e.disabled||this.disabled||(this.deselectOnClick&&e.selected?this.unselect(e):this.select(e),this._editableSearchTerm&&this._setSearchTermFromItems(),this._onSelectionChanged())}select(e){e.selected||(this.itemsList.select(e),this.clearSearchOnAdd&&!this._editableSearchTerm&&this._clearSearch(),this._updateNgModel(),this.multiple&&this.addEvent.emit(e.value)),(this.closeOnSelect||this.itemsList.noItemsToSelect)&&this.close()}focus(){this.searchInput.nativeElement.focus()}blur(){this.searchInput.nativeElement.blur()}unselect(e){e&&(this.itemsList.unselect(e),this.focus(),this._updateNgModel(),this.removeEvent.emit(e.value))}selectTag(){let e;Ye(this.addTag)?e=this.addTag(this.searchTerm):e=this._primitive?this.searchTerm:{[this.bindLabel]:this.searchTerm};let n=r=>this._isTypeahead||!this.isOpen?this.itemsList.mapItem(r,null):this.itemsList.addItem(r);_s(e)?e.then(r=>this.select(n(r))).catch(()=>{}):e&&this.select(n(e))}showClear(){return this.clearable&&(this.hasValue||this.searchTerm)&&!this.disabled}focusOnClear(){this.blur(),this.clearButton&&this.clearButton.nativeElement.focus()}get showAddTag(){if(!this._validTerm)return!1;let e=this.searchTerm.toLowerCase().trim();return this.addTag&&!this.itemsList.filteredItems.some(n=>n.label.toLowerCase()===e)&&(!this.hideSelected&&this.isOpen||!this.selectedItems.some(n=>n.label.toLowerCase()===e))&&!this.loading}showNoItemsFound(){let e=this.itemsList.filteredItems.length===0;return(e&&!this._isTypeahead&&!this.loading||e&&this._isTypeahead&&this._validTerm&&!this.loading)&&!this.showAddTag}showTypeToSearch(){return this.itemsList.filteredItems.length===0&&this._isTypeahead&&!this._validTerm&&!this.loading}onCompositionStart(){this._isComposing=!0}onCompositionEnd(e){this._isComposing=!1,!this.searchWhileComposing&&this.filter(e)}filter(e){this._isComposing&&!this.searchWhileComposing||(this.searchTerm=e,this._isTypeahead&&(this._validTerm||this.minTermLength===0)&&this.typeahead.next(e),this._isTypeahead||(this.itemsList.filter(this.searchTerm),this.isOpen&&this.itemsList.markSelectedOrDefault(this.markFirst)),this.searchEvent.emit({term:e,items:this.itemsList.filteredItems.map(n=>n.value)}),this.open())}onInputFocus(e){this.focused||(this._editableSearchTerm&&this._setSearchTermFromItems(),this.element.classList.add("ng-select-focused"),this.focusEvent.emit(e),this.focused=!0)}onInputBlur(e){this.element.classList.remove("ng-select-focused"),this.blurEvent.emit(e),!this.isOpen&&!this.disabled&&this._onTouched(),this._editableSearchTerm&&this._setSearchTermFromItems(),this.focused=!1}onItemHover(e){e.disabled||this.itemsList.markItem(e)}detectChanges(){this._cd.destroyed||this._cd.detectChanges()}_setSearchTermFromItems(){let e=this.selectedItems&&this.selectedItems[0];this.searchTerm=e&&e.label||null}_setItems(e){let n=e[0];this.bindLabel=this.bindLabel||this._defaultLabel,this._primitive=w(n)?!Fe(n):this._primitive||this.bindLabel===this._defaultLabel,this.itemsList.setItems(e),e.length>0&&this.hasValue&&this.itemsList.mapSelectedItems(),this.isOpen&&w(this.searchTerm)&&!this._isTypeahead&&this.itemsList.filter(this.searchTerm),(this._isTypeahead||this.isOpen)&&this.itemsList.markSelectedOrDefault(this.markFirst)}_setItemsFromNgOptions(){let e=r=>{this.items=r.map(a=>({$ngOptionValue:a.value,$ngOptionLabel:a.elementRef.nativeElement.innerHTML,disabled:a.disabled})),this.itemsList.setItems(this.items),this.hasValue&&this.itemsList.mapSelectedItems(),this.detectChanges()},n=()=>{let r=Oe(this.ngOptions.changes,this._destroy$);Oe(...this.ngOptions.map(a=>a.stateChange$)).pipe(M(r)).subscribe(a=>{let o=this.itemsList.findItem(a.value);o.disabled=a.disabled,o.label=a.label||o.label,this._cd.detectChanges()})};this.ngOptions.changes.pipe(wt(this.ngOptions),M(this._destroy$)).subscribe(r=>{this.bindLabel=this._defaultLabel,e(r),n()})}_isValidWriteValue(e){if(!w(e)||this.multiple&&e===""||Array.isArray(e)&&e.length===0)return!1;let n=r=>!w(this.compareWith)&&Fe(r)&&this.bindValue?(this._console.warn(`Setting object(${JSON.stringify(r)}) as your model with bindValue is not allowed unless [compareWith] is used.`),!1):!0;return this.multiple?Array.isArray(e)?e.every(r=>n(r)):(this._console.warn("Multiple select ngModel should be array."),!1):n(e)}_handleWriteValue(e){if(!this._isValidWriteValue(e))return;let n=r=>{let a=this.itemsList.findItem(r);if(a)this.itemsList.select(a);else{let o=Fe(r),g=!o&&!this.bindValue;o||g?this.itemsList.select(this.itemsList.mapItem(r,null)):this.bindValue&&(a={[this.bindLabel]:null,[this.bindValue]:r},this.itemsList.select(this.itemsList.mapItem(a,null)))}};this.multiple?e.forEach(r=>n(r)):n(e)}_handleKeyPresses(){this.searchable||this._keyPress$.pipe(M(this._destroy$),Ft(e=>this._pressedKeys.push(e)),It(200),Be(()=>this._pressedKeys.length>0),S(()=>this._pressedKeys.join(""))).subscribe(e=>{let n=this.itemsList.findByLabel(e);n&&(this.isOpen?(this.itemsList.markItem(n),this._scrollToMarked(),this._cd.markForCheck()):this.select(n)),this._pressedKeys=[]})}_setInputAttributes(){let e=this.searchInput.nativeElement,n=_e({type:"text",autocorrect:"off",autocapitalize:"off",autocomplete:this.labelForId?"off":this.dropdownId},this.inputAttrs);for(let r of Object.keys(n))e.setAttribute(r,n[r])}_updateNgModel(){let e=[];for(let r of this.selectedItems)if(this.bindValue){let a=null;if(r.children){let o=this.groupValue?this.bindValue:this.groupBy;a=r.value[o||this.groupBy]}else a=this.itemsList.resolveNested(r.value,this.bindValue);e.push(a)}else e.push(r.value);let n=this.selectedItems.map(r=>r.value);this.multiple?(this._onChange(e),this.changeEvent.emit(n)):(this._onChange(w(e[0])?e[0]:null),this.changeEvent.emit(n[0])),this._cd.markForCheck()}_clearSearch(){this.searchTerm&&(this._changeSearch(null),this.itemsList.resetFilteredItems())}_changeSearch(e){this.searchTerm=e,this._isTypeahead&&this.typeahead.next(e)}_scrollToMarked(){!this.isOpen||!this.dropdownPanel||this.dropdownPanel.scrollTo(this.itemsList.markedItem)}_scrollToTag(){!this.isOpen||!this.dropdownPanel||this.dropdownPanel.scrollToTag()}_onSelectionChanged(){this.isOpen&&this.deselectOnClick&&this.appendTo&&(this._cd.detectChanges(),this.dropdownPanel.adjustPosition())}_handleTab(e){if(this.isOpen===!1){if(this.showClear()&&!e.shiftKey)this.focusOnClear(),e.preventDefault();else if(!this.addTag)return}this.selectOnTab?this.itemsList.markedItem?(this.toggleItem(this.itemsList.markedItem),e.preventDefault()):this.showAddTag?(this.selectTag(),e.preventDefault()):this.close():this.close()}_handleEnter(e){if(this.isOpen||this._manualOpen)this.itemsList.markedItem?this.toggleItem(this.itemsList.markedItem):this.showAddTag&&this.selectTag();else if(this.openOnEnter)this.open();else return;e.preventDefault()}_handleSpace(e){this.isOpen||this._manualOpen||(this.open(),e.preventDefault())}_handleArrowDown(e){this._nextItemIsTag(1)?(this.itemsList.unmarkItem(),this._scrollToTag()):(this.itemsList.markNextItem(),this._scrollToMarked()),this.open(),e.preventDefault()}_handleArrowUp(e){this.isOpen&&(this._nextItemIsTag(-1)?(this.itemsList.unmarkItem(),this._scrollToTag()):(this.itemsList.markPreviousItem(),this._scrollToMarked()),e.preventDefault())}_nextItemIsTag(e){let n=this.itemsList.markedIndex+e;return this.addTag&&this.searchTerm&&this.itemsList.markedItem&&(n<0||n===this.itemsList.filteredItems.length)}_handleBackspace(){this.searchTerm||!this.clearable||!this.clearOnBackspace||!this.hasValue||(this.multiple?this.unselect(this.itemsList.lastSelectedItem):this.clearModel())}get _isTypeahead(){return this.typeahead&&this.typeahead.observers.length>0}get _validTerm(){let e=this.searchTerm&&this.searchTerm.trim();return e&&e.length>=this.minTermLength}_mergeGlobalConfig(e){this.placeholder=this.placeholder||e.placeholder,this.notFoundText=this.notFoundText||e.notFoundText,this.typeToSearchText=this.typeToSearchText||e.typeToSearchText,this.addTagText=this.addTagText||e.addTagText,this.loadingText=this.loadingText||e.loadingText,this.clearAllText=this.clearAllText||e.clearAllText,this.virtualScroll=w(this.virtualScroll)?this.virtualScroll:w(e.disableVirtualScroll)?!e.disableVirtualScroll:!1,this.openOnEnter=w(this.openOnEnter)?this.openOnEnter:e.openOnEnter,this.appendTo=this.appendTo||e.appendTo,this.bindValue=this.bindValue||e.bindValue,this.bindLabel=this.bindLabel||e.bindLabel,this.appearance=this.appearance||e.appearance}};t.\u0275fac=function(n){return new(n||t)(Je("class"),Je("autofocus"),_(As),_(Zi),_(re),_(Mt),_(ks))},t.\u0275cmp=j({type:t,selectors:[["ng-select"]],contentQueries:function(n,r,a){if(n&1&&(G(a,bt,5,I),G(a,vt,5,I),G(a,bs,5,I),G(a,Et,5,I),G(a,vs,5,I),G(a,Es,5,I),G(a,Cs,5,I),G(a,ys,5,I),G(a,Ss,5,I),G(a,Ts,5,I),G(a,Is,5,I),G(a,Fs,5)),n&2){let o;O(o=B())&&(r.optionTemplate=o.first),O(o=B())&&(r.optgroupTemplate=o.first),O(o=B())&&(r.labelTemplate=o.first),O(o=B())&&(r.multiLabelTemplate=o.first),O(o=B())&&(r.headerTemplate=o.first),O(o=B())&&(r.footerTemplate=o.first),O(o=B())&&(r.notFoundTemplate=o.first),O(o=B())&&(r.typeToSearchTemplate=o.first),O(o=B())&&(r.loadingTextTemplate=o.first),O(o=B())&&(r.tagTemplate=o.first),O(o=B())&&(r.loadingSpinnerTemplate=o.first),O(o=B())&&(r.ngOptions=o)}},viewQuery:function(n,r){if(n&1&&(he(Ui,5),he(Vn,7),he(Mn,5)),n&2){let a;O(a=B())&&(r.dropdownPanel=a.first),O(a=B())&&(r.searchInput=a.first),O(a=B())&&(r.clearButton=a.first)}},hostVars:20,hostBindings:function(n,r){n&1&&x("keydown",function(o){return r.handleKeyDown(o)}),n&2&&$("ng-select-typeahead",r.typeahead)("ng-select-multiple",r.multiple)("ng-select-taggable",r.addTag)("ng-select-searchable",r.searchable)("ng-select-clearable",r.clearable)("ng-select-opened",r.isOpen)("ng-select",r.useDefaultClass)("ng-select-disabled",r.disabled)("ng-select-filtered",r.filtered)("ng-select-single",r.single)},inputs:{bindLabel:"bindLabel",bindValue:"bindValue",markFirst:[2,"markFirst","markFirst",k],placeholder:"placeholder",notFoundText:"notFoundText",typeToSearchText:"typeToSearchText",addTagText:"addTagText",loadingText:"loadingText",clearAllText:"clearAllText",appearance:"appearance",dropdownPosition:"dropdownPosition",appendTo:"appendTo",loading:[2,"loading","loading",k],closeOnSelect:[2,"closeOnSelect","closeOnSelect",k],hideSelected:[2,"hideSelected","hideSelected",k],selectOnTab:[2,"selectOnTab","selectOnTab",k],openOnEnter:[2,"openOnEnter","openOnEnter",k],maxSelectedItems:[2,"maxSelectedItems","maxSelectedItems",Ie],groupBy:"groupBy",groupValue:"groupValue",bufferAmount:[2,"bufferAmount","bufferAmount",Ie],virtualScroll:[2,"virtualScroll","virtualScroll",k],selectableGroup:[2,"selectableGroup","selectableGroup",k],selectableGroupAsModel:[2,"selectableGroupAsModel","selectableGroupAsModel",k],searchFn:"searchFn",trackByFn:"trackByFn",clearOnBackspace:[2,"clearOnBackspace","clearOnBackspace",k],labelForId:"labelForId",inputAttrs:"inputAttrs",tabIndex:[2,"tabIndex","tabIndex",Ie],readonly:[2,"readonly","readonly",k],searchWhileComposing:[2,"searchWhileComposing","searchWhileComposing",k],minTermLength:[2,"minTermLength","minTermLength",Ie],editableSearchTerm:[2,"editableSearchTerm","editableSearchTerm",k],keyDownFn:"keyDownFn",typeahead:"typeahead",multiple:[2,"multiple","multiple",k],addTag:"addTag",searchable:[2,"searchable","searchable",k],clearable:[2,"clearable","clearable",k],isOpen:[2,"isOpen","isOpen",k],items:"items",compareWith:"compareWith",clearSearchOnAdd:"clearSearchOnAdd",deselectOnClick:"deselectOnClick"},outputs:{blurEvent:"blur",focusEvent:"focus",changeEvent:"change",openEvent:"open",closeEvent:"close",searchEvent:"search",clearEvent:"clear",addEvent:"add",removeEvent:"remove",scroll:"scroll",scrollToEnd:"scrollToEnd"},features:[le([{provide:Qt,useExisting:At(()=>t),multi:!0},Yi]),Le,Te],decls:14,vars:19,consts:[["searchInput",""],["defaultLabelTemplate",""],["defaultLoadingSpinnerTemplate",""],["clearButton",""],["defaultOptionTemplate",""],["defaultTagTemplate",""],["defaultNotFoundTemplate",""],["defaultTypeToSearchTemplate",""],["defaultLoadingTextTemplate",""],[1,"ng-select-container",3,"mousedown"],[1,"ng-value-container"],[1,"ng-placeholder"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],["role","combobox","aria-haspopup","listbox",1,"ng-input"],["aria-autocomplete","list",3,"input","compositionstart","compositionend","focus","blur","change","readOnly","disabled","value"],["tabindex","0",1,"ng-clear-wrapper",3,"title"],[1,"ng-arrow-wrapper"],[1,"ng-arrow"],["role","listbox","aria-label","Options list",1,"ng-dropdown-panel",3,"virtualScroll","bufferAmount","appendTo","position","headerTemplate","footerTemplate","filterValue","items","markedItem","ng-select-multiple","ngClass","id"],[1,"ng-value",3,"ng-value-disabled"],[1,"ng-value"],["aria-hidden","true",1,"ng-value-icon","left",3,"click"],[1,"ng-value-label",3,"ngItemLabel","escape"],[3,"ngTemplateOutlet"],[1,"ng-spinner-loader"],["aria-hidden","true",1,"ng-clear"],["role","listbox","aria-label","Options list",1,"ng-dropdown-panel",3,"update","scroll","scrollToEnd","outsideClick","virtualScroll","bufferAmount","appendTo","position","headerTemplate","footerTemplate","filterValue","items","markedItem","ngClass","id"],[1,"ng-option",3,"ng-option-disabled","ng-option-selected","ng-optgroup","ng-option","ng-option-child","ng-option-marked"],["role","option",1,"ng-option",3,"ng-option-marked"],[1,"ng-option",3,"click","mouseover"],[1,"ng-option-label",3,"ngItemLabel","escape"],["role","option",1,"ng-option",3,"mouseover","click"],[1,"ng-tag-label"],[1,"ng-option","ng-option-disabled"]],template:function(n,r){if(n&1){let a=V();c(0,"div",9),x("mousedown",function(g){return C(a),y(r.handleMousedown(g))}),c(1,"div",10)(2,"div",11),h(3),d(),b(4,Wn,2,0)(5,Un,1,5,null,12),c(6,"div",13)(7,"input",14,0),x("input",function(){C(a);let g=N(8);return y(r.filter(g.value))})("compositionstart",function(){return C(a),y(r.onCompositionStart())})("compositionend",function(){C(a);let g=N(8);return y(r.onCompositionEnd(g.value))})("focus",function(g){return C(a),y(r.onInputFocus(g))})("blur",function(g){return C(a),y(r.onInputBlur(g))})("change",function(g){return C(a),y(g.stopPropagation())}),d()()(),b(9,Kn,3,1)(10,Yn,4,1,"span",15),c(11,"span",16),D(12,"span",17),d()(),b(13,ps,8,17,"ng-dropdown-panel",18)}n&2&&($("ng-appearance-outline",r.appearance==="outline")("ng-has-value",r.hasValue),l(3),T(r.placeholder),l(),U((!r.multiLabelTemplate||!r.multiple)&&r.selectedItems.length>0?4:-1),l(),U(r.multiple&&r.multiLabelTemplate&&r.selectedValues.length>0?5:-1),l(),q("aria-expanded",r.isOpen)("aria-owns",r.isOpen?r.dropdownId:null),l(),p("readOnly",!r.searchable||r.itemsList.maxItemsSelected)("disabled",r.disabled)("value",r.searchTerm?r.searchTerm:""),q("id",r.labelForId)("tabindex",r.tabIndex)("aria-activedescendant",r.isOpen?r.itemsList==null||r.itemsList.markedItem==null?null:r.itemsList.markedItem.htmlId:null)("aria-controls",r.isOpen?r.dropdownId:null),l(2),U(r.loading?9:-1),l(),U(r.showClear()?10:-1),l(3),U(r.isOpen?13:-1))},dependencies:[jt,at,Ui,gs],styles:[`@charset "UTF-8";.ng-select{position:relative;display:block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.ng-select div,.ng-select input,.ng-select span{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.ng-select [hidden]{display:none}.ng-select.ng-select-searchable .ng-select-container .ng-value-container .ng-input{opacity:1}.ng-select.ng-select-opened .ng-select-container{z-index:1001}.ng-select.ng-select-disabled .ng-select-container .ng-value-container .ng-placeholder,.ng-select.ng-select-disabled .ng-select-container .ng-value-container .ng-value{-webkit-user-select:none;user-select:none;cursor:default}.ng-select.ng-select-disabled .ng-arrow-wrapper{cursor:default}.ng-select.ng-select-filtered .ng-placeholder{display:none}.ng-select .ng-select-container{cursor:default;display:flex;outline:none;overflow:hidden;position:relative;width:100%}.ng-select .ng-select-container .ng-value-container{display:flex;flex:1}.ng-select .ng-select-container .ng-value-container .ng-input{opacity:0}.ng-select .ng-select-container .ng-value-container .ng-input>input{box-sizing:content-box;background:none transparent;border:0 none;box-shadow:none;outline:none;padding:0;cursor:default;width:100%}.ng-select .ng-select-container .ng-value-container .ng-input>input::-ms-clear{display:none}.ng-select .ng-select-container .ng-value-container .ng-input>input[readonly]{-webkit-user-select:none;user-select:none;width:0;padding:0}.ng-select.ng-select-single.ng-select-filtered .ng-select-container .ng-value-container .ng-value{visibility:hidden}.ng-select.ng-select-single .ng-select-container .ng-value-container,.ng-select.ng-select-single .ng-select-container .ng-value-container .ng-value{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ng-select.ng-select-single .ng-select-container .ng-value-container .ng-value .ng-value-icon{display:none}.ng-select.ng-select-single .ng-select-container .ng-value-container .ng-input{position:absolute;left:0;width:100%}.ng-select.ng-select-multiple.ng-select-disabled>.ng-select-container .ng-value-container .ng-value .ng-value-icon{display:none}.ng-select.ng-select-multiple .ng-select-container .ng-value-container{flex-wrap:wrap}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-placeholder{position:absolute}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value{white-space:nowrap}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value.ng-value-disabled .ng-value-icon{display:none}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value .ng-value-icon{cursor:pointer}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-input{flex:1;z-index:2}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-placeholder{z-index:1}.ng-select .ng-clear-wrapper{cursor:pointer;position:relative;width:17px;-webkit-user-select:none;user-select:none}.ng-select .ng-clear-wrapper .ng-clear{display:inline-block;font-size:18px;line-height:1;pointer-events:none}.ng-select .ng-spinner-loader{border-radius:50%;width:17px;height:17px;margin-right:5px;font-size:10px;position:relative;text-indent:-9999em;border-top:2px solid rgba(66,66,66,.2);border-right:2px solid rgba(66,66,66,.2);border-bottom:2px solid rgba(66,66,66,.2);border-left:2px solid #424242;transform:translateZ(0);animation:load8 .8s infinite linear}.ng-select .ng-spinner-loader:after{border-radius:50%;width:17px;height:17px}@-webkit-keyframes load8{0%{-webkit-transform:rotate(0deg);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes load8{0%{-webkit-transform:rotate(0deg);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.ng-select .ng-arrow-wrapper{cursor:pointer;position:relative;text-align:center;-webkit-user-select:none;user-select:none}.ng-select .ng-arrow-wrapper .ng-arrow{pointer-events:none;display:inline-block;height:0;width:0;position:relative}.ng-dropdown-panel{box-sizing:border-box;position:absolute;opacity:0;width:100%;z-index:1050;-webkit-overflow-scrolling:touch}.ng-dropdown-panel .ng-dropdown-panel-items{display:block;height:auto;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;max-height:240px;overflow-y:auto}.ng-dropdown-panel .ng-dropdown-panel-items .ng-optgroup{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option{box-sizing:border-box;cursor:pointer;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option .ng-option-label:empty:before{content:"\\200b"}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option .highlighted{font-weight:700;text-decoration:underline}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option.disabled{cursor:default}.ng-dropdown-panel .scroll-host{overflow:hidden;overflow-y:auto;position:relative;display:block;-webkit-overflow-scrolling:touch}.ng-dropdown-panel .scrollable-content{top:0;left:0;width:100%;height:100%;position:absolute}.ng-dropdown-panel .total-padding{width:1px;opacity:0} `],encapsulation:2,changeDetection:0});let i=t;return i})();function Ds(){return new gt}var gt=class{constructor(){this._selected=[]}get value(){return this._selected}select(t,s,e){if(t.selected=!0,(!t.children||!s&&e)&&this._selected.push(t),s)if(t.parent){let n=t.parent.children.length,r=t.parent.children.filter(a=>a.selected).length;t.parent.selected=n===r}else t.children&&(this._setChildrenSelectedState(t.children,!0),this._removeChildren(t),e&&this._activeChildren(t)?this._selected=[...this._selected.filter(n=>n.parent!==t),t]:this._selected=[...this._selected,...t.children.filter(n=>!n.disabled)])}unselect(t,s){if(this._selected=this._selected.filter(e=>e!==t),t.selected=!1,s)if(t.parent&&t.parent.selected){let e=t.parent.children;this._removeParent(t.parent),this._removeChildren(t.parent),this._selected.push(...e.filter(n=>n!==t&&!n.disabled)),t.parent.selected=!1}else t.children&&(this._setChildrenSelectedState(t.children,!1),this._removeChildren(t))}clear(t){this._selected=t?this._selected.filter(s=>s.disabled):[]}_setChildrenSelectedState(t,s){for(let e of t)e.disabled||(e.selected=s)}_removeChildren(t){this._selected=[...this._selected.filter(s=>s.parent!==t),...t.children.filter(s=>s.parent===t&&s.disabled&&s.selected)]}_removeParent(t){this._selected=this._selected.filter(s=>s!==t)}_activeChildren(t){return t.children.every(s=>!s.disabled||s.selected)}},Xi=(()=>{let t=class t{};t.\u0275fac=function(n){return new(n||t)},t.\u0275mod=Ot({type:t}),t.\u0275inj=kt({providers:[{provide:Zi,useValue:Ds}],imports:[Ht]});let i=t;return i})();function Bs(i,t){if(i&1){let s=V();c(0,"div",5),h(1),c(2,"span",6),x("click",function(){let n=C(s).$implicit,r=f().clear;return y(r(n))}),h(3,"\xD7"),d()()}if(i&2){let s=t.$implicit;l(),E(" ",s.Value," ")}}function Ls(i,t){if(i&1&&b(0,Bs,4,1,"div",4),i&2){let s=t.items;p("ngForOf",s)}}function Ps(i,t){if(i&1&&(D(0,"input",7),h(1)),i&2){let s=t.item,e=t.item$,n=t.index;rt("id","item-",n,""),p("ngModel",e.selected),l(),E(" ",s.Group," ")}}function Vs(i,t){if(i&1&&(D(0,"input",7),h(1)),i&2){let s=t.item,e=t.item$,n=t.index;rt("id","item-",n,""),p("ngModel",e.selected),l(),E(" ",s.Value," ")}}var en=(()=>{let t=class t{constructor(){this.options=[],this.values=[],this.valuesChange=new A}itemsChanged(){this.valuesChange.emit(this.values)}};t.\u0275fac=function(n){return new(n||t)},t.\u0275cmp=j({type:t,selectors:[["bkd-multiselect"]],inputs:{options:"options",values:"values"},outputs:{valuesChange:"valuesChange"},standalone:!0,features:[te],decls:5,vars:10,consts:[["groupBy","Group","bindValue","Key","bindLabel","Value","dropdownPosition","bottom",1,"multiselect",3,"ngModelChange","click","clear","items","multiple","selectableGroup","selectableGroupAsModel","closeOnSelect","ngModel","placeholder","clearable"],["ng-multi-label-tmp",""],["ng-optgroup-tmp",""],["ng-option-tmp",""],["class","ng-value",4,"ngFor","ngForOf"],[1,"ng-value"],["aria-hidden","true",1,"ng-value-icon","right",3,"click"],["type","checkbox",3,"id","ngModel"]],template:function(n,r){n&1&&(c(0,"ng-select",0),u(1,"translate"),K("ngModelChange",function(o){return Q(r.values,o)||(r.values=o),o}),x("click",function(){return r.itemsChanged()})("clear",function(){return r.itemsChanged()}),b(2,Ls,1,1,"ng-template",1)(3,Ps,2,4,"ng-template",2)(4,Vs,2,4,"ng-template",3),d()),n&2&&(me("placeholder",m(1,8,"shared.select.empty-option")),p("items",r.options)("multiple",!0)("selectableGroup",!0)("selectableGroupAsModel",!1)("closeOnSelect",!1),z("ngModel",r.values),p("clearable",!0))},dependencies:[Xi,Ji,vt,bt,Et,je,Kt,Re,Jt,Ee,ue,de]});let i=t;return i})();var tn=zt({HRef:ot,Id:lt,TeacherId:lt,FullName:ot});var nn=(()=>{let t=class t extends xi{constructor(e,n){super(e,n,tn,"TeacherResources","FullName","FullName")}getTypeaheadItemByKey(e){return this.http.get(`${this.baseUrl}/`,{params:{fields:[this.keyAttr,this.labelAttr].join(","),[`filter.${this.labelAttr}`]:`~*${e}*`}}).pipe(Se(mi(this.typeaheadCodec)),Se(n=>St({Key:n[0].FullName,Value:`${n[0].FullName}`})))}};t.\u0275fac=function(n){return new(n||t)(R(Gt),R(ce))},t.\u0275prov=W({token:t,factory:t.\u0275fac,providedIn:"root"});let i=t;return i})();var rn=(()=>{let t=class t{constructor(e,n,r,a,o,g){this.studentsService=e,this.educationalEventsService=n,this.studyClassService=r,this.teacherResourcesService=a,this.state=o,this.translate=g,this.filter={student:null,educationalEvent:null,studyClass:null,teacher:null,dateFrom:null,dateTo:null,presenceTypes:null,confirmationStates:null,incidentTypes:null},this.filterChange=new A,this.absenceConfirmationStatesGrouped$=this.state.absenceConfirmationStates$.pipe(S(v=>qe(v,this.translate.instant("shared.multiselect.all-option")))),this.presenceTypesGrouped$=this.state.presenceTypes$.pipe(S(v=>v.filter(we(bi)).filter(we(ut))),S(mt),S(ht),S(v=>qe(v,this.translate.instant("shared.multiselect.all-option")))),this.incidentTypesGrouped$=this.state.presenceTypes$.pipe(S(v=>v.filter(ut)),S(mt),S(ht),S(v=>qe(v,this.translate.instant("shared.multiselect.all-option")))),this.classesHttpFilter={params:{fields:"IsActive","filter.IsActive":"=true"}}}show(){this.filterChange.emit(ke(_e({},this.filter),{dateFrom:sn(this.filter.dateFrom),dateTo:sn(this.filter.dateTo)}))}};t.\u0275fac=function(n){return new(n||t)(_(wi),_(ji),_($i),_(nn),_(X),_($e))},t.\u0275cmp=j({type:t,selectors:[["bkd-edit-absences-header"]],inputs:{filter:"filter"},outputs:{filterChange:"filterChange"},standalone:!0,features:[le([{provide:li,useClass:di},{provide:ci,useClass:Oi}]),te],decls:54,vars:53,consts:[[1,"row","g-3","mb-5"],[1,"col-md-6","col-lg-3"],[1,"form-label"],[3,"valueChange","typeaheadService","value"],[3,"valueChange","typeaheadService","value","additionalHttpParams"],[3,"valueChange","value"],[1,"row","g-3","align-items-end"],[1,"col-sm-12","col-md"],[3,"valuesChange","options","values"],[1,"col-auto"],["type","button",1,"btn","btn-primary",3,"click"]],template:function(n,r){n&1&&(c(0,"div",0)(1,"div",1)(2,"label",2),h(3),u(4,"translate"),d(),c(5,"bkd-typeahead",3),K("valueChange",function(o){return Q(r.filter.student,o)||(r.filter.student=o),o}),d()(),c(6,"div",1)(7,"label",2),h(8),u(9,"translate"),d(),c(10,"bkd-typeahead",3),K("valueChange",function(o){return Q(r.filter.educationalEvent,o)||(r.filter.educationalEvent=o),o}),d()(),c(11,"div",1)(12,"label",2),h(13),u(14,"translate"),d(),c(15,"bkd-typeahead",4),K("valueChange",function(o){return Q(r.filter.studyClass,o)||(r.filter.studyClass=o),o}),d()(),c(16,"div",1)(17,"label",2),h(18),u(19,"translate"),d(),c(20,"bkd-typeahead",3),K("valueChange",function(o){return Q(r.filter.teacher,o)||(r.filter.teacher=o),o}),d()(),c(21,"div",1)(22,"label",2),h(23),u(24,"translate"),d(),c(25,"bkd-date-select",5),K("valueChange",function(o){return Q(r.filter.dateFrom,o)||(r.filter.dateFrom=o),o}),d()(),c(26,"div",1)(27,"label",2),h(28),u(29,"translate"),d(),c(30,"bkd-date-select",5),K("valueChange",function(o){return Q(r.filter.dateTo,o)||(r.filter.dateTo=o),o}),d()()(),c(31,"div",6)(32,"div",7)(33,"label",2),h(34),u(35,"translate"),d(),c(36,"bkd-multiselect",8),u(37,"async"),K("valuesChange",function(o){return Q(r.filter.confirmationStates,o)||(r.filter.confirmationStates=o),o}),d()(),c(38,"div",7)(39,"label",2),h(40),u(41,"translate"),d(),c(42,"bkd-multiselect",8),u(43,"async"),K("valuesChange",function(o){return Q(r.filter.presenceTypes,o)||(r.filter.presenceTypes=o),o}),d()(),c(44,"div",7)(45,"label",2),h(46),u(47,"translate"),d(),c(48,"bkd-multiselect",8),u(49,"async"),K("valuesChange",function(o){return Q(r.filter.incidentTypes,o)||(r.filter.incidentTypes=o),o}),d()(),c(50,"div",9)(51,"button",10),x("click",function(){return r.show()}),h(52),u(53,"translate"),d()()()),n&2&&(l(3),T(m(4,27,"edit-absences.header.student")),l(2),p("typeaheadService",r.studentsService),z("value",r.filter.student),l(3),T(m(9,29,"edit-absences.header.module-instance")),l(2),p("typeaheadService",r.educationalEventsService),z("value",r.filter.educationalEvent),l(3),T(m(14,31,"edit-absences.header.study-class")),l(2),p("typeaheadService",r.studyClassService),z("value",r.filter.studyClass),p("additionalHttpParams",r.classesHttpFilter),l(3),T(m(19,33,"edit-absences.header.teacher")),l(2),p("typeaheadService",r.teacherResourcesService),z("value",r.filter.teacher),l(3),T(m(24,35,"edit-absences.header.date-from")),l(2),z("value",r.filter.dateFrom),l(3),T(m(29,37,"edit-absences.header.date-to")),l(2),z("value",r.filter.dateTo),l(4),T(m(35,39,"edit-absences.header.confirmation-state")),l(2),p("options",m(37,41,r.absenceConfirmationStatesGrouped$)),z("values",r.filter.confirmationStates),l(4),T(m(41,43,"edit-absences.header.presence-type")),l(2),p("options",m(43,45,r.presenceTypesGrouped$)),z("values",r.filter.presenceTypes),l(4),T(m(47,47,"edit-absences.header.incident")),l(2),p("options",m(49,49,r.incidentTypesGrouped$)),z("values",r.filter.incidentTypes),l(4),E(" ",m(53,51,"edit-absences.header.show")," "))},dependencies:[ki,Ri,en,Ce,ue,de],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;padding:0 1rem 1rem 0;border-bottom:1px solid #dee2e6}"],changeDetection:0});let i=t;return i})();function sn(i){return i?gi(i):null}var Ns=(i,t,s,e)=>({selection:i,entries:t,hasMore:s,loadingPage:e}),an=i=>({count:i}),on=i=>({returnparams:i}),Rs=i=>["student",i,"absences"];function js(i,t){if(i&1&&(c(0,"div",13)(1,"div",14),h(2),u(3,"async"),u(4,"translate"),u(5,"translate"),d(),c(6,"a",15),u(7,"async"),c(8,"i",16),h(9,"edit"),d()()()),i&2){let s=f(4).bkdLet,e=f();l(2),ve(" ",ie(4,7,"edit-absences.list.total",Y(15,an,m(3,5,e.state.total$)||0)),", ",ie(5,10,"edit-absences.list.selected",Y(17,an,s.selection.length))," "),l(4),$("disabled",s.selection.length===0),p("queryParams",Y(19,on,m(7,13,e.state.queryParamsString$)))}}function $s(i,t){if(i&1){let s=V();c(0,"tr")(1,"td",21),x("click",function(n){C(s);let r=N(3),a=f(6);return y(a.onCheckboxCellClick(n,r))}),c(2,"input",18,3),u(4,"async"),x("change",function(){let n=C(s).$implicit,r=f(6);return y(r.selectionService.toggle(n.lessonPresence))}),d()(),c(5,"td",19),u(6,"translate"),c(7,"span",22)(8,"i",16),h(9),d()()(),c(10,"td"),u(11,"translate"),c(12,"a",23),u(13,"async"),h(14),d(),D(15,"br"),h(16),d(),c(17,"td"),u(18,"translate"),h(19),u(20,"date"),d(),c(21,"td"),u(22,"translate"),h(23),u(24,"date"),u(25,"date"),d(),c(26,"td"),u(27,"translate"),h(28),d(),c(29,"td",24),u(30,"translate"),h(31),d(),c(32,"td"),u(33,"translate"),h(34),d()()}if(i&2){let s=t.$implicit,e=f(6);l(2),p("checked",m(4,21,e.selectionService.isSelected$(s.lessonPresence))),l(3),q("data-label",m(6,23,"edit-absences.list.header.presence")),l(2),p("className",s.presenceCategory),l(2),T(s.presenceCategoryIcon),l(),q("data-label",m(11,25,"edit-absences.list.header.mobil-student-module-instance-study-class")),l(2),p("routerLink",Y(48,Rs,s.lessonPresence.StudentRef.Id))("queryParams",Y(50,on,m(13,27,e.profileReturnParams$))),l(2),E(" ",s.lessonPresence.StudentFullName," "),l(2),ve(" ",s.lessonPresence.EventDesignation,", ",s.lessonPresence.StudyClassNumber," "),l(),q("data-label",m(18,29,"edit-absences.list.header.date")),l(2),E(" ",ie(20,31,s.lessonPresence.LessonDateTimeFrom,"mediumDate")," "),l(2),q("data-label",m(22,34,"edit-absences.list.header.time")),l(2),ve(" ",ie(24,36,s.lessonPresence.LessonDateTimeFrom,"shortTime"),"\u2013",ie(25,39,s.lessonPresence.LessonDateTimeTo,"shortTime")," "),l(3),q("data-label",m(27,42,"edit-absences.list.header.confirmation-state")),l(2),E(" ",s.confirmationState==null?null:s.confirmationState.Value," "),l(),q("data-label",m(30,44,"edit-absences.list.header.mobil-presence-type-incident")),l(2),E(" ",s.presenceType==null?null:s.presenceType.Designation," "),l(),q("data-label",m(33,46,"edit-absences.list.header.teacher")),l(2),E(" ",s.lessonPresence.TeacherInformation," ")}}function Hs(i,t){if(i&1){let s=V();c(0,"table",17)(1,"thead")(2,"tr")(3,"th")(4,"input",18),x("change",function(n){C(s);let r=f(5);return y(r.toggleAll(n.currentTarget==null?null:n.currentTarget.checked))}),d()(),c(5,"th",19),h(6),u(7,"translate"),d(),c(8,"th"),h(9),u(10,"translate"),D(11,"br"),h(12),u(13,"translate"),u(14,"translate"),d(),c(15,"th"),h(16),u(17,"translate"),d(),c(18,"th"),h(19),u(20,"translate"),d(),c(21,"th"),h(22),u(23,"translate"),d(),c(24,"th"),h(25),u(26,"translate"),u(27,"translate"),d(),c(28,"th"),h(29),u(30,"translate"),d()()(),c(31,"tbody"),b(32,$s,35,52,"tr",20),d()()}if(i&2){let s=f(4).bkdLet;l(4),p("checked",s.selection.length===s.entries.length),l(2),E(" ",m(7,12,"edit-absences.list.header.presence")," "),l(3),E(" ",m(10,14,"edit-absences.list.header.student")," "),l(3),ve(" ",m(13,16,"edit-absences.list.header.module-instance"),", ",m(14,18,"edit-absences.list.header.study-class")," "),l(4),E(" ",m(17,20,"edit-absences.list.header.date")," "),l(3),T(m(20,22,"edit-absences.list.header.time")),l(3),E(" ",m(23,24,"edit-absences.list.header.confirmation-state")," "),l(3),ve(" ",m(26,26,"edit-absences.list.header.presence-type")," / ",m(27,28,"edit-absences.list.header.incident")," "),l(4),T(m(30,30,"edit-absences.list.header.teacher")),l(3),p("ngForOf",s.entries)}}function Gs(i,t){i&1&&D(0,"bkd-spinner",25)}function Ws(i,t){if(i&1){let s=V();c(0,"button",26),x("click",function(){C(s);let n=f(5);return y(n.state.nextPage())}),h(1),u(2,"translate"),d()}i&2&&(l(),E(" ",m(2,1,"global.pagination.load-more")," "))}function qs(i,t){if(i&1){let s=V();c(0,"div",8),x("scrolled",function(){C(s);let n=f(4);return y(n.onScroll())}),b(1,js,10,21,"div",9)(2,Hs,33,32,"table",10)(3,Gs,1,0,"bkd-spinner",11)(4,Ws,3,3,"button",12),d()}if(i&2){let s=f(3).bkdLet;l(),p("ngIf",s.entries&&s.entries.length>0),l(),p("ngIf",s.entries&&s.entries.length>0),l(),p("ngIf",s.loadingPage),l(),p("ngIf",s.hasMore&&!s.loadingPage)}}function Us(i,t){i&1&&(c(0,"p",27),h(1),u(2,"translate"),d()),i&2&&(l(),T(m(2,1,"edit-absences.no-entries")))}function zs(i,t){if(i&1&&(ge(0),b(1,qs,5,4,"div",7)(2,Us,3,3,"ng-template",null,2,Z),be()),i&2){let s=N(3),e=f(2).bkdLet;l(),p("ngIf",e.entries&&e.entries.length>0||e.loadingPage)("ngIfElse",s)}}function Qs(i,t){i&1&&D(0,"bkd-spinner")}function Ks(i,t){if(i&1&&(ge(0),b(1,zs,4,2,"ng-container",6),u(2,"async"),b(3,Qs,1,0,"ng-template",null,1,Z),be()),i&2){let s=N(4),e=f(2);l(),p("ngIf",m(2,2,e.state.loading$)===!1)("ngIfElse",s)}}function Ys(i,t){i&1&&(c(0,"p",27),h(1),u(2,"translate"),d()),i&2&&(l(),T(m(2,1,"edit-absences.no-filter")))}function Zs(i,t){if(i&1){let s=V();ge(0),c(1,"bkd-edit-absences-header",5),u(2,"async"),x("filterChange",function(n){C(s);let r=f();return y(r.state.setFilter(n))}),d(),b(3,Ks,5,4,"ng-container",6),u(4,"async"),b(5,Ys,3,3,"ng-template",null,0,Z),be()}if(i&2){let s=N(6),e=f();l(),p("filter",m(2,3,e.filterFromParams$)),l(2),p("ngIf",m(4,5,e.state.isFilterValid$))("ngIfElse",s)}}var ln=(()=>{let t=class t{constructor(e,n,r,a){this.state=e,this.selectionService=n,this.scrollPosition=r,this.route=a,this.filterFromParams$=this.route.queryParams.pipe(S(Js)),this.profileReturnParams$=this.state.queryParamsString$,this.destroy$=new se}ngOnInit(){this.filterFromParams$.pipe(ee(1)).subscribe(e=>this.state.setFilter(e)),this.state.validFilter$.pipe(M(this.destroy$)).subscribe(()=>this.selectionService.clear()),this.selectionService.selection$.pipe(M(this.destroy$)).subscribe(e=>this.state.selected=e),this.route.queryParams.pipe(ee(1),S(({reload:e})=>e),Be(fi)).subscribe(()=>this.state.resetEntries())}ngAfterViewInit(){this.scrollPosition.restore()}ngOnDestroy(){this.destroy$.next()}toggleAll(e){this.state.entries$.pipe(ee(1)).subscribe(n=>this.selectionService.clear(e?n:null))}onCheckboxCellClick(e,n){e.target!==n&&n.click()}onScroll(){this.state.nextPage()}};t.\u0275fac=function(n){return new(n||t)(_(X),_(Qe),_(Bi),_(Ne))},t.\u0275cmp=j({type:t,selectors:[["bkd-edit-absences-list"]],standalone:!0,features:[le([Qe]),te],decls:8,vars:17,consts:[["noFilter",""],["loading",""],["noEntries",""],["checkbox",""],[4,"bkdLet"],[3,"filterChange","filter"],[4,"ngIf","ngIfElse"],["class","py-3","infiniteScroll","",3,"scrolled",4,"ngIf","ngIfElse"],["infiniteScroll","",1,"py-3",3,"scrolled"],["class","d-flex align-items-center justify-content-between",4,"ngIf"],["class","table table-striped",4,"ngIf"],["class","inline",4,"ngIf"],["type","button","class","btn btn-outline-secondary btn-sm d-block mx-auto",3,"click",4,"ngIf"],[1,"d-flex","align-items-center","justify-content-between"],[1,"total"],["routerLink","/edit-absences/edit",1,"edit","btn","btn-primary","btn-icon","mt-1","mb-2",3,"queryParams"],[1,"material-icons"],[1,"table","table-striped"],["type","checkbox",3,"change","checked"],[1,"presence-category"],[4,"ngFor","ngForOf"],[1,"edit-absences-checkbox",3,"click"],[3,"className"],[1,"student",3,"routerLink","queryParams"],[1,"designation-incident"],[1,"inline"],["type","button",1,"btn","btn-outline-secondary","btn-sm","d-block","mx-auto",3,"click"],[1,"mt-3"]],template:function(n,r){n&1&&(c(0,"h1"),h(1),u(2,"translate"),d(),b(3,Zs,7,7,"ng-container",4),u(4,"async"),u(5,"async"),u(6,"async"),u(7,"async")),n&2&&(l(),T(m(2,2,"edit-absences.title")),l(2),p("bkdLet",Ve(12,Ns,m(4,4,r.selectionService.selection$),m(5,6,r.state.presenceControlEntries$),m(6,8,r.state.hasMore$),m(7,10,r.state.loadingPage$))))},dependencies:[Ge,rn,Me,Ni,Ut,Ee,Ti,Ce,$t,ue,de],styles:[".presence-category[_ngcontent-%COMP%]{text-align:center}.presence-category[_ngcontent-%COMP%] .absent[_ngcontent-%COMP%]{color:#ea161f}.presence-category[_ngcontent-%COMP%] .present[_ngcontent-%COMP%]{color:#3d8608}.presence-category[_ngcontent-%COMP%] .unapproved[_ngcontent-%COMP%]{color:#ffa814}.designation-incident[_ngcontent-%COMP%]{max-width:50ch}@media screen and (max-width: 820px){.edit-absences-checkbox[_ngcontent-%COMP%]{text-align:left}.presence-category[_ngcontent-%COMP%]{text-align:right}.designation-incident[_ngcontent-%COMP%]{max-width:initial}}"],changeDetection:0});let i=t;return i})();function Js(i){return{student:i.student?Number(i.student):null,educationalEvent:i.educationalEvent?Number(i.educationalEvent):null,studyClass:i.studyClass?Number(i.studyClass):null,teacher:i.teacher??null,dateFrom:i.dateFrom?ct(i.dateFrom):null,dateTo:i.dateTo?ct(i.dateTo):null,presenceTypes:i.presenceTypes?i.presenceTypes.split(",").map(Number):null,confirmationStates:i.confirmationStates?i.confirmationStates.split(",").map(Number):null,incidentTypes:i.incidentTypes?i.incidentTypes.split(",").map(Number):null}}var cn=(()=>{let t=class t{constructor(e){this.state=e}};t.\u0275fac=function(n){return new(n||t)(_(X))},t.\u0275cmp=j({type:t,selectors:[["bkd-edit-absences"]],standalone:!0,features:[le([X,{provide:_i,useExisting:X},Ei]),te],decls:1,vars:0,template:function(n,r){n&1&&D(0,"router-outlet")},dependencies:[Wt],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0});let i=t;return i})();var lo=[{path:"",component:cn,children:[{path:"",component:ln,data:{restoreScrollPositionFrom:["/edit-absences/edit","/edit-absences/student/:id/addresses","/edit-absences/student/:id/absences","/edit-absences/student/:id/grades"]}},{path:"edit",component:Wi},Ai]}];export{lo as EDIT_ABSENCES_ROUTES}; diff --git a/public/apps/webapp-schulverwaltung/chunk-GXZYLK4L.js b/public/apps/webapp-schulverwaltung/chunk-JV3CBBGP.js similarity index 99% rename from public/apps/webapp-schulverwaltung/chunk-GXZYLK4L.js rename to public/apps/webapp-schulverwaltung/chunk-JV3CBBGP.js index 2e604015..fb4d317d 100644 --- a/public/apps/webapp-schulverwaltung/chunk-GXZYLK4L.js +++ b/public/apps/webapp-schulverwaltung/chunk-JV3CBBGP.js @@ -1 +1 @@ -import{a as je,b as Ne,c as Me,d as Ve,e as Oe}from"./chunk-U4HODSW3.js";import{t as V,w as Re}from"./chunk-7LCBKZQT.js";import{d as Ee,e as Le}from"./chunk-C7XT5XXE.js";import{b as te}from"./chunk-RFO4NYUO.js";import{a as Fe}from"./chunk-5RDJZAUT.js";import{P as Pe,T as Z,X as Be,Y as Ge}from"./chunk-ZK2MNT7Z.js";import{a as we}from"./chunk-FTDG26ID.js";import{a as E,c as ee}from"./chunk-SOHFFTKU.js";import{a as Y,b as z,c as J,d as K,e as X}from"./chunk-C56YGDXA.js";import{a as $e}from"./chunk-UX5TA32W.js";import{$ as x,$a as l,Ab as m,Bb as _,Cb as xe,Eb as ce,Fd as Te,Ga as c,Gd as N,Hd as M,Ia as o,Ja as ge,K as ue,L as fe,N as oe,O as L,Q as H,Rb as W,Sa as d,Sb as I,Ta as p,Ua as b,Va as v,Vb as P,Vc as De,W as U,Wa as h,Wb as Ce,Ya as j,Z as T,_a as k,a as B,ab as be,b as F,bb as ve,e as q,f as pe,g as re,ha as C,ia as S,ib as f,j as le,jb as u,k as me,kb as G,lb as g,m as $,n as _e,oc as Se,pc as ke,rc as Ae,sb as Q,sc as Ie,tb as A,ua as r,ub as ae,va as y,vb as w,xb as he,yb as ye}from"./chunk-XTHSYQMN.js";var ne=(()=>{let t=class t{constructor(i,s,a,O,se){this.settings=i,this.lessonPresencesService=s,this.presenceTypesService=a,this.toastService=O,this.translate=se,this.studentId$=new re(1),this.checkableAbsences$=this.getAbsences(this.loadCheckableAbsences.bind(this)),this.openAbsences$=this.getAbsences(this.loadOpenAbsences.bind(this)),this.excusedAbsences$=this.getAbsences(this.loadExcusedAbsences.bind(this)),this.unexcusedAbsences$=this.getAbsences(this.loadUnexcusedAbsences.bind(this)),this.incidents$=this.getAbsences(this.loadIncidents.bind(this)),this.halfDays$=this.getAbsences(this.loadHalfDays.bind(this)),this.counts$=this.getCounts()}setStudentId(i){this.studentId$.next(i)}getAbsences(i){return this.studentId$.pipe(L(i),oe(null),ue({connector:()=>new re(1)}))}getCounts(){return this.studentId$.pipe(L(i=>_e([this.loadStatistics(i).pipe(oe(null)),this.openAbsences$.pipe($(s=>s?.length??null)),this.checkableAbsences$.pipe($(s=>s?.length??null))])),$(([i,s,a])=>({openAbsences:s,checkableAbsences:a,excusedAbsences:i?.TotalAbsencesValidExcuse??null,unexcusedAbsences:i?.TotalAbsencesWithoutExcuse??null,incidents:i?.TotalIncidents??null,halfDays:i?.TotalHalfDays??null})))}loadStatistics(i){return this.lessonPresencesService.getStatistics({student:i,educationalEvent:null,studyClass:null},null,0).pipe(L(({entries:s})=>s.length>0?me(s[0]):(this.toastService.error(this.translate.instant("global.rest-errors.notfound-message"),this.translate.instant("global.rest-errors.notfound-title")),le)))}loadOpenAbsences(i){return this.lessonPresencesService.getListOfUnconfirmed(this.getBaseParams(i))}loadCheckableAbsences(i){return this.lessonPresencesService.getList({params:F(B({},this.getBaseParams(i)),{"filter.ConfirmationStateId":`=${this.settings.checkableAbsenceStateId}`})})}loadExcusedAbsences(i){return this.lessonPresencesService.getList({params:F(B({},this.getBaseParams(i)),{"filter.ConfirmationStateId":`=${this.settings.excusedAbsenceStateId}`})})}loadUnexcusedAbsences(i){return this.lessonPresencesService.getList({params:F(B({},this.getBaseParams(i)),{"filter.ConfirmationStateId":`=${this.settings.unexcusedAbsenceStateId}`})})}loadIncidents(i){return this.presenceTypesService.incidentTypes$.pipe($(s=>F(B({},this.getBaseParams(i)),{"filter.TypeRef":`;${s.map(a=>a.Id).join(";")}`})),L(s=>this.lessonPresencesService.getList({params:s})))}loadHalfDays(i){return this.lessonPresencesService.getList({params:F(B({},this.getBaseParams(i)),{"filter.TypeRef":`=${this.settings.halfDayPresenceTypeId}`})})}getBaseParams(i){return{sort:"LessonDateTimeFrom.asc","filter.StudentRef":`=${i}`}}};t.\u0275fac=function(s){return new(s||t)(T(De),T(Le),T(Z),T($e),T(Te))},t.\u0275prov=U({token:t,factory:t.\u0275fac});let e=t;return e})();var D=(()=>{let t=class t{constructor(i,s){this.profileService=i,this.route=s,this.currentDossier$=new pe("addresses"),this.studentId$=this.route.paramMap.pipe($(a=>Number(a.get("id")))),this.profile$=this.studentId$.pipe(L(a=>this.profileService.getProfile(a)),fe(1)),this.returnParams$=this.route.queryParams.pipe($(({returnparams:a})=>a)),this.backlinkQueryParams$=this.returnParams$.pipe($(Fe)),this.loading$=this.profileService.loading$}};t.\u0275fac=function(s){return new(s||t)(T(je),T(Se))},t.\u0275prov=U({token:t,factory:t.\u0275fac});let e=t;return e})();var Ke=e=>({absenceCounts:e});function Xe(e,t){if(e&1&&(v(0),u(1),h()),e&2){let n=l().bkdLet;r(),g("(",n.absenceCounts.checkableAbsences,") ")}}function Ze(e,t){if(e&1&&b(0,"bkd-student-dossier-absences",15),e&2){let n=l(2);o("absences$",n.absencesService.checkableAbsences$)}}function et(e,t){if(e&1&&(v(0),u(1),h()),e&2){let n=l().bkdLet;r(),g("(",n.absenceCounts.openAbsences,") ")}}function tt(e,t){if(e&1&&b(0,"bkd-student-dossier-absences",16),e&2){let n=l(2);o("absences$",n.absencesService.openAbsences$)("selectionService",n.absencesSelectionService)}}function nt(e,t){if(e&1&&(v(0),u(1),h()),e&2){let n=l().bkdLet;r(),g("(",n.absenceCounts.excusedAbsences,") ")}}function it(e,t){if(e&1&&b(0,"bkd-student-dossier-absences",15),e&2){let n=l(2);o("absences$",n.absencesService.excusedAbsences$)}}function st(e,t){if(e&1&&(v(0),u(1),h()),e&2){let n=l().bkdLet;r(),g("(",n.absenceCounts.unexcusedAbsences,") ")}}function rt(e,t){if(e&1&&b(0,"bkd-student-dossier-absences",17),e&2){let n=l(2);o("absences$",n.absencesService.unexcusedAbsences$)("displayPresenceType",!1)}}function ot(e,t){if(e&1&&(v(0),u(1),h()),e&2){let n=l().bkdLet;r(),g("(",n.absenceCounts.incidents,") ")}}function at(e,t){if(e&1&&b(0,"bkd-student-dossier-absences",15),e&2){let n=l(2);o("absences$",n.absencesService.incidents$)}}function ct(e,t){if(e&1&&(v(0),u(1),h()),e&2){let n=l(2).bkdLet;r(),g("(",n.absenceCounts.halfDays,") ")}}function dt(e,t){if(e&1&&b(0,"bkd-student-dossier-absences",17),e&2){let n=l(3);o("absences$",n.absencesService.halfDays$)("displayPresenceType",!1)}}function pt(e,t){if(e&1){let n=j();d(0,"div",18,5)(2,"div",9)(3,"bkd-student-dossier-entry-header",10),k("click",function(){C(n);let s=f(1);return S(s.toggle())}),u(4),m(5,"translate"),c(6,ct,2,1,"ng-container",11),p()(),d(7,"div",12)(8,"div",13),c(9,dt,1,2,"ng-template"),p()()()}if(e&2){let n=f(1),i=l().bkdLet;r(3),o("opened",!n.collapsed),r(),g(" ",_(5,3,"shared.profile.half-days")," "),r(2),o("ngIf",i.absenceCounts.halfDays!==null)}}function lt(e,t){if(e&1){let n=j();v(0),d(1,"div",7)(2,"div",8,0)(4,"div",9)(5,"bkd-student-dossier-entry-header",10),k("click",function(){C(n);let s=f(3);return S(s.toggle())}),u(6),m(7,"translate"),c(8,Xe,2,1,"ng-container",11),p()(),d(9,"div",12)(10,"div",13),c(11,Ze,1,1,"ng-template"),p()()(),d(12,"div",8,1)(14,"div",9)(15,"bkd-student-dossier-entry-header",10),k("click",function(){C(n);let s=f(13);return S(s.toggle())}),u(16),m(17,"translate"),c(18,et,2,1,"ng-container",11),p()(),d(19,"div",12)(20,"div",13),c(21,tt,1,2,"ng-template"),p()()(),d(22,"div",8,2)(24,"div",9)(25,"bkd-student-dossier-entry-header",10),k("click",function(){C(n);let s=f(23);return S(s.toggle())}),u(26),m(27,"translate"),c(28,nt,2,1,"ng-container",11),p()(),d(29,"div",12)(30,"div",13),c(31,it,1,1,"ng-template"),p()()(),d(32,"div",8,3)(34,"div",9)(35,"bkd-student-dossier-entry-header",10),k("click",function(){C(n);let s=f(33);return S(s.toggle())}),u(36),m(37,"translate"),c(38,st,2,1,"ng-container",11),p()(),d(39,"div",12)(40,"div",13),c(41,rt,1,2,"ng-template"),p()()(),d(42,"div",8,4)(44,"div",9)(45,"bkd-student-dossier-entry-header",10),k("click",function(){C(n);let s=f(43);return S(s.toggle())}),u(46),m(47,"translate"),c(48,ot,2,1,"ng-container",11),p()(),d(49,"div",12)(50,"div",13),c(51,at,1,1,"ng-template"),p()()(),c(52,pt,10,5,"div",14),m(53,"async"),p(),h()}if(e&2){let n=t.bkdLet,i=f(3),s=f(13),a=f(23),O=f(33),se=f(43),Ye=l();r(5),o("opened",!i.collapsed),r(),g(" ",_(7,16,"shared.profile.checkable-absences")," "),r(2),o("ngIf",n.absenceCounts.checkableAbsences!==null),r(7),o("opened",!s.collapsed),r(),g(" ",_(17,18,"shared.profile.open-absences")," "),r(2),o("ngIf",n.absenceCounts.openAbsences!==null),r(7),o("opened",!a.collapsed),r(),g(" ",_(27,20,"shared.profile.excused-absences")," "),r(2),o("ngIf",n.absenceCounts.excusedAbsences!==null),r(7),o("opened",!O.collapsed),r(),g(" ",_(37,22,"shared.profile.unexcused-absences")," "),r(2),o("ngIf",n.absenceCounts.unexcusedAbsences!==null),r(7),o("opened",!se.collapsed),r(),g(" ",_(47,24,"shared.profile.incidents")," "),r(2),o("ngIf",n.absenceCounts.incidents!==null),r(4),o("ngIf",_(53,26,Ye.halfDayActive$))}}var qe=(()=>{let t=class t{constructor(i,s,a,O){this.state=i,this.presenceTypesService=s,this.absencesService=a,this.absencesSelectionService=O,this.halfDayActive$=this.presenceTypesService.halfDayActive$,this.destroy$=new q,this.state.currentDossier$.next("absences")}ngOnInit(){this.state.studentId$.pipe(H(this.destroy$)).subscribe(i=>this.absencesService.setStudentId(i))}ngOnDestroy(){this.destroy$.next()}};t.\u0275fac=function(s){return new(s||t)(y(D),y(Z),y(ne),y(Pe))},t.\u0275cmp=x({type:t,selectors:[["bkd-dossier-absences"]],standalone:!0,features:[Q([ne]),A],decls:2,vars:5,consts:[["checkableAbsences","ngbAccordionItem"],["openAbsences","ngbAccordionItem"],["excusedAbsences","ngbAccordionItem"],["unexcusedAbsences","ngbAccordionItem"],["incidents","ngbAccordionItem"],["halfDays","ngbAccordionItem"],[4,"bkdLet"],["ngbAccordion",""],["ngbAccordionItem",""],["ngbAccordionHeader",""],[3,"click","opened"],[4,"ngIf"],["ngbAccordionCollapse",""],["ngbAccordionBody",""],["ngbAccordionItem","","id","half-days",4,"ngIf"],[3,"absences$"],[3,"absences$","selectionService"],[3,"absences$","displayPresenceType"],["ngbAccordionItem","","id","half-days"]],template:function(s,a){s&1&&(c(0,lt,54,28,"ng-container",6),m(1,"async")),s&2&&o("bkdLet",w(3,Ke,_(1,1,a.absencesService.counts$)))},dependencies:[E,X,K,J,te,I,z,Y,Be,P,M,N],changeDetection:0});let e=t;return e})();var mt=e=>({profile:e});function _t(e,t){if(e&1&&b(0,"bkd-student-dossier-legal-representative",13),e&2){let n=t.$implicit;o("person",n)}}function ut(e,t){if(e&1&&c(0,_t,1,1,"bkd-student-dossier-legal-representative",12),e&2){let n=l(2).bkdLet;o("ngForOf",n.profile.legalRepresentativePersons)}}function ft(e,t){if(e&1){let n=j();d(0,"div",7,0)(2,"div",8)(3,"bkd-student-dossier-entry-header",9),k("click",function(){C(n);let s=f(1);return S(s.toggle())}),u(4),m(5,"translate"),p()(),d(6,"div",10)(7,"div",11),c(8,ut,1,1,"ng-template"),p()()()}if(e&2){let n=f(1);r(3),o("opened",!n.collapsed),r(),g(" ",_(5,2,"shared.profile.legal-representation")," ")}}function gt(e,t){if(e&1&&(v(0),u(1),h()),e&2){let n=l().index;r(),g("",n+1," ")}}function bt(e,t){if(e&1&&b(0,"bkd-student-dossier-apprenticeship-company",15),e&2){let n=l().$implicit;o("company",n)}}function vt(e,t){if(e&1){let n=j();d(0,"div",7,1)(2,"div",8)(3,"bkd-student-dossier-entry-header",9),k("click",function(){C(n);let s=f(1);return S(s.toggle())}),u(4),m(5,"translate"),c(6,gt,2,1,"ng-container",14),p()(),d(7,"div",10)(8,"div",11),c(9,bt,1,1,"ng-template"),p()()()}if(e&2){let n=f(1),i=l().bkdLet;r(3),o("opened",!n.collapsed),r(),g(" ",_(5,3,"shared.profile.apprenticeship-company")," "),r(2),o("ngIf",i.profile.apprenticeshipCompanies.length>1)}}function ht(e,t){if(e&1&&(v(0),b(1,"bkd-student-dossier-address",3),d(2,"div",4),c(3,ft,9,4,"div",5)(4,vt,10,5,"div",6),p(),h()),e&2){let n=t.bkdLet;r(),o("student",n.profile.student),r(2),o("ngIf",n.profile.legalRepresentativePersons.length>0),r(),o("ngForOf",n.profile.apprenticeshipCompanies)}}var He=(()=>{let t=class t{constructor(i){this.state=i,this.state.currentDossier$.next("addresses")}};t.\u0275fac=function(s){return new(s||t)(y(D))},t.\u0275cmp=x({type:t,selectors:[["bkd-dossier-addresses"]],standalone:!0,features:[A],decls:2,vars:5,consts:[["legalRepresentatives","ngbAccordionItem"],["apprenticeshipCompanies","ngbAccordionItem"],[4,"bkdLet"],[1,"profile-entry",3,"student"],["ngbAccordion",""],["ngbAccordionItem","",4,"ngIf"],["ngbAccordionItem","",4,"ngFor","ngForOf"],["ngbAccordionItem",""],["ngbAccordionHeader",""],[3,"click","opened"],["ngbAccordionCollapse",""],["ngbAccordionBody",""],["class","profile-entry",3,"person",4,"ngFor","ngForOf"],[1,"profile-entry",3,"person"],[4,"ngIf"],[1,"profile-entry",3,"company"]],template:function(s,a){s&1&&(c(0,ht,5,3,"ng-container",2),m(1,"async")),s&2&&o("bkdLet",w(3,mt,_(1,1,a.state.profile$)))},dependencies:[E,Ne,X,I,K,J,te,z,Y,W,Ve,Me,P,M,N],styles:[".profile-entry[_ngcontent-%COMP%]{display:block;padding:0 1rem}"],changeDetection:0});let e=t;return e})();var xt=(e,t,n,i)=>({studentId:e,loading:t,courses:n,gradingScales:i});function Ct(e,t){if(e&1&&b(0,"bkd-dossier-grades-view",3),e&2){let n=l().bkdLet;o("courses",n.courses)("studentId",n.studentId)("gradingScales",n.gradingScales)}}function St(e,t){e&1&&(v(0),b(1,"bkd-spinner"),h())}function kt(e,t){if(e&1&&(v(0),c(1,Ct,1,3,"bkd-dossier-grades-view",1)(2,St,2,0,"ng-container",2),h()),e&2){let n=t.bkdLet;r(),o("ngIf",!n.loading),r(),o("ngIf",n.loading)}}var Ue=(()=>{let t=class t{constructor(i,s){this.state=i,this.dossierGradesService=s,this.destroy$=new q}ngOnInit(){this.state.currentDossier$.next("grades"),this.state.studentId$.pipe(H(this.destroy$)).subscribe(i=>this.dossierGradesService.setStudentId(i))}ngOnDestroy(){this.destroy$.next()}};t.\u0275fac=function(s){return new(s||t)(y(D),y(V))},t.\u0275cmp=x({type:t,selectors:[["bkd-dossier-grades"]],standalone:!0,features:[A],decls:5,vars:14,consts:[[4,"bkdLet"],[3,"courses","studentId","gradingScales",4,"ngIf"],[4,"ngIf"],[3,"courses","studentId","gradingScales"]],template:function(s,a){s&1&&(c(0,kt,3,2,"ng-container",0),m(1,"async"),m(2,"async"),m(3,"async"),m(4,"async")),s&2&&o("bkdLet",ye(9,xt,_(1,1,a.state.studentId$),_(2,3,a.dossierGradesService.loading$),_(3,5,a.dossierGradesService.studentCourses$),_(4,7,a.dossierGradesService.gradingScales$)))},dependencies:[E,I,Re,ee,P]});let e=t;return e})();var At=["*"];function It(e,t){if(e&1&&(d(0,"div",6)(1,"span",7),u(2),m(3,"date"),p(),d(4,"span",8),u(5),p()()),e&2){let n=l();r(2),G(xe(3,2,n.student.Birthdate,"dd.MM.yyyy")),r(3),g("(",n.student.Gender,")")}}var Qe=(()=>{let t=class t{constructor(){this.link="/"}};t.\u0275fac=function(s){return new(s||t)},t.\u0275cmp=x({type:t,selectors:[["bkd-student-backlink"]],inputs:{link:"link",queryParams:"queryParams",studentId:"studentId",studentName:"studentName",student:"student"},standalone:!0,features:[A],ngContentSelectors:At,decls:9,vars:5,consts:[[1,"d-flex","flex-column","w-100"],[3,"link","params"],[1,"d-flex","flex-row","align-items-start"],[1,"me-3","medium",3,"studentId"],[1,"d-flex","flex-column"],["class","additional-info",4,"ngIf"],[1,"additional-info"],[1,"birthday"],[1,"gender"]],template:function(s,a){s&1&&(be(),d(0,"div",0)(1,"bkd-backlink",1),ve(2),p(),d(3,"div",2),b(4,"bkd-avatar",3),d(5,"div",4)(6,"h1"),u(7),p(),c(8,It,6,5,"div",5),p()()()),s&2&&(r(),o("link",a.link)("params",a.queryParams),r(3),o("studentId",a.studentId),r(3),G(a.student?a.student.FullName:a.studentName),r(),o("ngIf",a.student))},dependencies:[Ge,Oe,I,Ce],styles:["[_nghost-%COMP%]{display:flex;align-items:center;width:100%}h1[_ngcontent-%COMP%]{margin:-3px 0 0;display:flex;align-items:baseline;line-height:1}.additional-info[_ngcontent-%COMP%]{color:#adb5bd}.gender[_ngcontent-%COMP%]{margin-left:.8ch}"],changeDetection:0});let e=t;return e})();var Dt=(e,t,n)=>({profile:e,currentDossierSection:t,reports:n}),$t=()=>["addresses","absences","grades"],Tt=()=>[],Pt=e=>({returnparams:e}),Et=e=>[e];function Lt(e,t){if(e&1&&b(0,"bkd-reports-link",10),e&2){let n,i=l(2).bkdLet;o("reports",(n=i.reports)!==null&&n!==void 0?n:ae(1,Tt))}}function wt(e,t){if(e&1&&(d(0,"a",11),m(1,"async"),d(2,"button",12,2),u(4),m(5,"translate"),p()()),e&2){let n=t.$implicit,i=f(3),s=l(3);o("queryParams",w(9,Pt,_(1,5,s.state.returnParams$)))("routerLink",w(11,Et,n)),r(2),ge("btn-outline-secondary",!i.isActive),r(2),g(" ",_(5,7,"dossier."+n)," ")}}function Bt(e,t){e&1&&(d(0,"div"),b(1,"router-outlet"),p())}function Ft(e,t){e&1&&(d(0,"p"),u(1),m(2,"translate"),p()),e&2&&(r(),G(_(2,1,"shared.profile.no-profile")))}function jt(e,t){if(e&1&&(v(0),d(1,"bkd-student-backlink",6),m(2,"async"),m(3,"async"),c(4,Lt,1,2,"bkd-reports-link",7),p(),d(5,"div",8),c(6,wt,6,13,"a",9),p(),c(7,Bt,2,0,"div",5)(8,Ft,3,3,"ng-template",null,1,ce),h()),e&2){let n=f(9),i=l().bkdLet,s=l();r(),o("link","../..")("queryParams",_(2,8,s.state.backlinkQueryParams$))("studentId",_(3,10,s.state.studentId$))("student",i.profile&&i.profile.student),r(3),o("ngIf",i.currentDossierSection==="grades"),r(2),o("ngForOf",ae(12,$t)),r(),o("ngIf",i.profile)("ngIfElse",n)}}function Nt(e,t){e&1&&b(0,"bkd-spinner")}function Mt(e,t){if(e&1&&(v(0),c(1,jt,10,13,"ng-container",5),m(2,"async"),c(3,Nt,1,0,"ng-template",null,0,ce),h()),e&2){let n=f(4),i=l();r(),o("ngIf",_(2,2,i.state.loading$)===!1)("ngIfElse",n)}}var We=(()=>{let t=class t{constructor(i,s){this.state=i,this.dossierGradesService=s,this.state.currentDossier$.next("addresses")}};t.\u0275fac=function(s){return new(s||t)(y(D),y(V))},t.\u0275cmp=x({type:t,selectors:[["bkd-student-dossier"]],standalone:!0,features:[Q([D,V]),A],decls:5,vars:11,consts:[["loading",""],["noProfile",""],["rla","routerLinkActive"],[1,"bkd-container","bkd-container-limited"],[4,"bkdLet"],[4,"ngIf","ngIfElse"],[1,"mb-2",3,"link","queryParams","studentId","student"],["class","ms-2",3,"reports",4,"ngIf"],[1,"d-flex","flex-row","py-3","flex-wrap"],["class","me-1 mt-1 me-sm-2",3,"queryParams","routerLink",4,"ngFor","ngForOf"],[1,"ms-2",3,"reports"],[1,"me-1","mt-1","me-sm-2",3,"queryParams","routerLink"],["data-test-id","dossier-section-button","type","button","routerLinkActive","btn-primary",1,"btn","btn-outline-secondary"]],template:function(s,a){s&1&&(d(0,"div",3),c(1,Mt,5,4,"ng-container",4),m(2,"async"),m(3,"async"),m(4,"async"),p()),s&2&&(r(),o("bkdLet",he(7,Dt,_(2,1,a.state.profile$),_(3,3,a.state.currentDossier$),_(4,5,a.dossierGradesService.testReports$))))},dependencies:[E,I,Qe,we,W,Ae,Ie,ke,ee,P,M,N],changeDetection:0});let e=t;return e})();var Gn={path:"student/:id",children:[{path:"",component:We,children:[{path:"addresses",component:He},{path:"absences",component:qe},{path:"grades",component:Ue}]},{path:"absences/confirm",component:Ee}]};export{Gn as a}; +import{a as je,b as Ne,c as Me,d as Ve,e as Oe}from"./chunk-U4HODSW3.js";import{t as V,w as Re}from"./chunk-W7ASLXRM.js";import{d as Ee,e as Le}from"./chunk-C7XT5XXE.js";import{b as te}from"./chunk-RFO4NYUO.js";import{a as Fe}from"./chunk-5RDJZAUT.js";import{P as Pe,T as Z,X as Be,Y as Ge}from"./chunk-ZK2MNT7Z.js";import{a as we}from"./chunk-FTDG26ID.js";import{a as E,c as ee}from"./chunk-SOHFFTKU.js";import{a as Y,b as z,c as J,d as K,e as X}from"./chunk-C56YGDXA.js";import{a as $e}from"./chunk-UX5TA32W.js";import{$ as x,$a as l,Ab as m,Bb as _,Cb as xe,Eb as ce,Fd as Te,Ga as c,Gd as N,Hd as M,Ia as o,Ja as ge,K as ue,L as fe,N as oe,O as L,Q as H,Rb as W,Sa as d,Sb as I,Ta as p,Ua as b,Va as v,Vb as P,Vc as De,W as U,Wa as h,Wb as Ce,Ya as j,Z as T,_a as k,a as B,ab as be,b as F,bb as ve,e as q,f as pe,g as re,ha as C,ia as S,ib as f,j as le,jb as u,k as me,kb as G,lb as g,m as $,n as _e,oc as Se,pc as ke,rc as Ae,sb as Q,sc as Ie,tb as A,ua as r,ub as ae,va as y,vb as w,xb as he,yb as ye}from"./chunk-XTHSYQMN.js";var ne=(()=>{let t=class t{constructor(i,s,a,O,se){this.settings=i,this.lessonPresencesService=s,this.presenceTypesService=a,this.toastService=O,this.translate=se,this.studentId$=new re(1),this.checkableAbsences$=this.getAbsences(this.loadCheckableAbsences.bind(this)),this.openAbsences$=this.getAbsences(this.loadOpenAbsences.bind(this)),this.excusedAbsences$=this.getAbsences(this.loadExcusedAbsences.bind(this)),this.unexcusedAbsences$=this.getAbsences(this.loadUnexcusedAbsences.bind(this)),this.incidents$=this.getAbsences(this.loadIncidents.bind(this)),this.halfDays$=this.getAbsences(this.loadHalfDays.bind(this)),this.counts$=this.getCounts()}setStudentId(i){this.studentId$.next(i)}getAbsences(i){return this.studentId$.pipe(L(i),oe(null),ue({connector:()=>new re(1)}))}getCounts(){return this.studentId$.pipe(L(i=>_e([this.loadStatistics(i).pipe(oe(null)),this.openAbsences$.pipe($(s=>s?.length??null)),this.checkableAbsences$.pipe($(s=>s?.length??null))])),$(([i,s,a])=>({openAbsences:s,checkableAbsences:a,excusedAbsences:i?.TotalAbsencesValidExcuse??null,unexcusedAbsences:i?.TotalAbsencesWithoutExcuse??null,incidents:i?.TotalIncidents??null,halfDays:i?.TotalHalfDays??null})))}loadStatistics(i){return this.lessonPresencesService.getStatistics({student:i,educationalEvent:null,studyClass:null},null,0).pipe(L(({entries:s})=>s.length>0?me(s[0]):(this.toastService.error(this.translate.instant("global.rest-errors.notfound-message"),this.translate.instant("global.rest-errors.notfound-title")),le)))}loadOpenAbsences(i){return this.lessonPresencesService.getListOfUnconfirmed(this.getBaseParams(i))}loadCheckableAbsences(i){return this.lessonPresencesService.getList({params:F(B({},this.getBaseParams(i)),{"filter.ConfirmationStateId":`=${this.settings.checkableAbsenceStateId}`})})}loadExcusedAbsences(i){return this.lessonPresencesService.getList({params:F(B({},this.getBaseParams(i)),{"filter.ConfirmationStateId":`=${this.settings.excusedAbsenceStateId}`})})}loadUnexcusedAbsences(i){return this.lessonPresencesService.getList({params:F(B({},this.getBaseParams(i)),{"filter.ConfirmationStateId":`=${this.settings.unexcusedAbsenceStateId}`})})}loadIncidents(i){return this.presenceTypesService.incidentTypes$.pipe($(s=>F(B({},this.getBaseParams(i)),{"filter.TypeRef":`;${s.map(a=>a.Id).join(";")}`})),L(s=>this.lessonPresencesService.getList({params:s})))}loadHalfDays(i){return this.lessonPresencesService.getList({params:F(B({},this.getBaseParams(i)),{"filter.TypeRef":`=${this.settings.halfDayPresenceTypeId}`})})}getBaseParams(i){return{sort:"LessonDateTimeFrom.asc","filter.StudentRef":`=${i}`}}};t.\u0275fac=function(s){return new(s||t)(T(De),T(Le),T(Z),T($e),T(Te))},t.\u0275prov=U({token:t,factory:t.\u0275fac});let e=t;return e})();var D=(()=>{let t=class t{constructor(i,s){this.profileService=i,this.route=s,this.currentDossier$=new pe("addresses"),this.studentId$=this.route.paramMap.pipe($(a=>Number(a.get("id")))),this.profile$=this.studentId$.pipe(L(a=>this.profileService.getProfile(a)),fe(1)),this.returnParams$=this.route.queryParams.pipe($(({returnparams:a})=>a)),this.backlinkQueryParams$=this.returnParams$.pipe($(Fe)),this.loading$=this.profileService.loading$}};t.\u0275fac=function(s){return new(s||t)(T(je),T(Se))},t.\u0275prov=U({token:t,factory:t.\u0275fac});let e=t;return e})();var Ke=e=>({absenceCounts:e});function Xe(e,t){if(e&1&&(v(0),u(1),h()),e&2){let n=l().bkdLet;r(),g("(",n.absenceCounts.checkableAbsences,") ")}}function Ze(e,t){if(e&1&&b(0,"bkd-student-dossier-absences",15),e&2){let n=l(2);o("absences$",n.absencesService.checkableAbsences$)}}function et(e,t){if(e&1&&(v(0),u(1),h()),e&2){let n=l().bkdLet;r(),g("(",n.absenceCounts.openAbsences,") ")}}function tt(e,t){if(e&1&&b(0,"bkd-student-dossier-absences",16),e&2){let n=l(2);o("absences$",n.absencesService.openAbsences$)("selectionService",n.absencesSelectionService)}}function nt(e,t){if(e&1&&(v(0),u(1),h()),e&2){let n=l().bkdLet;r(),g("(",n.absenceCounts.excusedAbsences,") ")}}function it(e,t){if(e&1&&b(0,"bkd-student-dossier-absences",15),e&2){let n=l(2);o("absences$",n.absencesService.excusedAbsences$)}}function st(e,t){if(e&1&&(v(0),u(1),h()),e&2){let n=l().bkdLet;r(),g("(",n.absenceCounts.unexcusedAbsences,") ")}}function rt(e,t){if(e&1&&b(0,"bkd-student-dossier-absences",17),e&2){let n=l(2);o("absences$",n.absencesService.unexcusedAbsences$)("displayPresenceType",!1)}}function ot(e,t){if(e&1&&(v(0),u(1),h()),e&2){let n=l().bkdLet;r(),g("(",n.absenceCounts.incidents,") ")}}function at(e,t){if(e&1&&b(0,"bkd-student-dossier-absences",15),e&2){let n=l(2);o("absences$",n.absencesService.incidents$)}}function ct(e,t){if(e&1&&(v(0),u(1),h()),e&2){let n=l(2).bkdLet;r(),g("(",n.absenceCounts.halfDays,") ")}}function dt(e,t){if(e&1&&b(0,"bkd-student-dossier-absences",17),e&2){let n=l(3);o("absences$",n.absencesService.halfDays$)("displayPresenceType",!1)}}function pt(e,t){if(e&1){let n=j();d(0,"div",18,5)(2,"div",9)(3,"bkd-student-dossier-entry-header",10),k("click",function(){C(n);let s=f(1);return S(s.toggle())}),u(4),m(5,"translate"),c(6,ct,2,1,"ng-container",11),p()(),d(7,"div",12)(8,"div",13),c(9,dt,1,2,"ng-template"),p()()()}if(e&2){let n=f(1),i=l().bkdLet;r(3),o("opened",!n.collapsed),r(),g(" ",_(5,3,"shared.profile.half-days")," "),r(2),o("ngIf",i.absenceCounts.halfDays!==null)}}function lt(e,t){if(e&1){let n=j();v(0),d(1,"div",7)(2,"div",8,0)(4,"div",9)(5,"bkd-student-dossier-entry-header",10),k("click",function(){C(n);let s=f(3);return S(s.toggle())}),u(6),m(7,"translate"),c(8,Xe,2,1,"ng-container",11),p()(),d(9,"div",12)(10,"div",13),c(11,Ze,1,1,"ng-template"),p()()(),d(12,"div",8,1)(14,"div",9)(15,"bkd-student-dossier-entry-header",10),k("click",function(){C(n);let s=f(13);return S(s.toggle())}),u(16),m(17,"translate"),c(18,et,2,1,"ng-container",11),p()(),d(19,"div",12)(20,"div",13),c(21,tt,1,2,"ng-template"),p()()(),d(22,"div",8,2)(24,"div",9)(25,"bkd-student-dossier-entry-header",10),k("click",function(){C(n);let s=f(23);return S(s.toggle())}),u(26),m(27,"translate"),c(28,nt,2,1,"ng-container",11),p()(),d(29,"div",12)(30,"div",13),c(31,it,1,1,"ng-template"),p()()(),d(32,"div",8,3)(34,"div",9)(35,"bkd-student-dossier-entry-header",10),k("click",function(){C(n);let s=f(33);return S(s.toggle())}),u(36),m(37,"translate"),c(38,st,2,1,"ng-container",11),p()(),d(39,"div",12)(40,"div",13),c(41,rt,1,2,"ng-template"),p()()(),d(42,"div",8,4)(44,"div",9)(45,"bkd-student-dossier-entry-header",10),k("click",function(){C(n);let s=f(43);return S(s.toggle())}),u(46),m(47,"translate"),c(48,ot,2,1,"ng-container",11),p()(),d(49,"div",12)(50,"div",13),c(51,at,1,1,"ng-template"),p()()(),c(52,pt,10,5,"div",14),m(53,"async"),p(),h()}if(e&2){let n=t.bkdLet,i=f(3),s=f(13),a=f(23),O=f(33),se=f(43),Ye=l();r(5),o("opened",!i.collapsed),r(),g(" ",_(7,16,"shared.profile.checkable-absences")," "),r(2),o("ngIf",n.absenceCounts.checkableAbsences!==null),r(7),o("opened",!s.collapsed),r(),g(" ",_(17,18,"shared.profile.open-absences")," "),r(2),o("ngIf",n.absenceCounts.openAbsences!==null),r(7),o("opened",!a.collapsed),r(),g(" ",_(27,20,"shared.profile.excused-absences")," "),r(2),o("ngIf",n.absenceCounts.excusedAbsences!==null),r(7),o("opened",!O.collapsed),r(),g(" ",_(37,22,"shared.profile.unexcused-absences")," "),r(2),o("ngIf",n.absenceCounts.unexcusedAbsences!==null),r(7),o("opened",!se.collapsed),r(),g(" ",_(47,24,"shared.profile.incidents")," "),r(2),o("ngIf",n.absenceCounts.incidents!==null),r(4),o("ngIf",_(53,26,Ye.halfDayActive$))}}var qe=(()=>{let t=class t{constructor(i,s,a,O){this.state=i,this.presenceTypesService=s,this.absencesService=a,this.absencesSelectionService=O,this.halfDayActive$=this.presenceTypesService.halfDayActive$,this.destroy$=new q,this.state.currentDossier$.next("absences")}ngOnInit(){this.state.studentId$.pipe(H(this.destroy$)).subscribe(i=>this.absencesService.setStudentId(i))}ngOnDestroy(){this.destroy$.next()}};t.\u0275fac=function(s){return new(s||t)(y(D),y(Z),y(ne),y(Pe))},t.\u0275cmp=x({type:t,selectors:[["bkd-dossier-absences"]],standalone:!0,features:[Q([ne]),A],decls:2,vars:5,consts:[["checkableAbsences","ngbAccordionItem"],["openAbsences","ngbAccordionItem"],["excusedAbsences","ngbAccordionItem"],["unexcusedAbsences","ngbAccordionItem"],["incidents","ngbAccordionItem"],["halfDays","ngbAccordionItem"],[4,"bkdLet"],["ngbAccordion",""],["ngbAccordionItem",""],["ngbAccordionHeader",""],[3,"click","opened"],[4,"ngIf"],["ngbAccordionCollapse",""],["ngbAccordionBody",""],["ngbAccordionItem","","id","half-days",4,"ngIf"],[3,"absences$"],[3,"absences$","selectionService"],[3,"absences$","displayPresenceType"],["ngbAccordionItem","","id","half-days"]],template:function(s,a){s&1&&(c(0,lt,54,28,"ng-container",6),m(1,"async")),s&2&&o("bkdLet",w(3,Ke,_(1,1,a.absencesService.counts$)))},dependencies:[E,X,K,J,te,I,z,Y,Be,P,M,N],changeDetection:0});let e=t;return e})();var mt=e=>({profile:e});function _t(e,t){if(e&1&&b(0,"bkd-student-dossier-legal-representative",13),e&2){let n=t.$implicit;o("person",n)}}function ut(e,t){if(e&1&&c(0,_t,1,1,"bkd-student-dossier-legal-representative",12),e&2){let n=l(2).bkdLet;o("ngForOf",n.profile.legalRepresentativePersons)}}function ft(e,t){if(e&1){let n=j();d(0,"div",7,0)(2,"div",8)(3,"bkd-student-dossier-entry-header",9),k("click",function(){C(n);let s=f(1);return S(s.toggle())}),u(4),m(5,"translate"),p()(),d(6,"div",10)(7,"div",11),c(8,ut,1,1,"ng-template"),p()()()}if(e&2){let n=f(1);r(3),o("opened",!n.collapsed),r(),g(" ",_(5,2,"shared.profile.legal-representation")," ")}}function gt(e,t){if(e&1&&(v(0),u(1),h()),e&2){let n=l().index;r(),g("",n+1," ")}}function bt(e,t){if(e&1&&b(0,"bkd-student-dossier-apprenticeship-company",15),e&2){let n=l().$implicit;o("company",n)}}function vt(e,t){if(e&1){let n=j();d(0,"div",7,1)(2,"div",8)(3,"bkd-student-dossier-entry-header",9),k("click",function(){C(n);let s=f(1);return S(s.toggle())}),u(4),m(5,"translate"),c(6,gt,2,1,"ng-container",14),p()(),d(7,"div",10)(8,"div",11),c(9,bt,1,1,"ng-template"),p()()()}if(e&2){let n=f(1),i=l().bkdLet;r(3),o("opened",!n.collapsed),r(),g(" ",_(5,3,"shared.profile.apprenticeship-company")," "),r(2),o("ngIf",i.profile.apprenticeshipCompanies.length>1)}}function ht(e,t){if(e&1&&(v(0),b(1,"bkd-student-dossier-address",3),d(2,"div",4),c(3,ft,9,4,"div",5)(4,vt,10,5,"div",6),p(),h()),e&2){let n=t.bkdLet;r(),o("student",n.profile.student),r(2),o("ngIf",n.profile.legalRepresentativePersons.length>0),r(),o("ngForOf",n.profile.apprenticeshipCompanies)}}var He=(()=>{let t=class t{constructor(i){this.state=i,this.state.currentDossier$.next("addresses")}};t.\u0275fac=function(s){return new(s||t)(y(D))},t.\u0275cmp=x({type:t,selectors:[["bkd-dossier-addresses"]],standalone:!0,features:[A],decls:2,vars:5,consts:[["legalRepresentatives","ngbAccordionItem"],["apprenticeshipCompanies","ngbAccordionItem"],[4,"bkdLet"],[1,"profile-entry",3,"student"],["ngbAccordion",""],["ngbAccordionItem","",4,"ngIf"],["ngbAccordionItem","",4,"ngFor","ngForOf"],["ngbAccordionItem",""],["ngbAccordionHeader",""],[3,"click","opened"],["ngbAccordionCollapse",""],["ngbAccordionBody",""],["class","profile-entry",3,"person",4,"ngFor","ngForOf"],[1,"profile-entry",3,"person"],[4,"ngIf"],[1,"profile-entry",3,"company"]],template:function(s,a){s&1&&(c(0,ht,5,3,"ng-container",2),m(1,"async")),s&2&&o("bkdLet",w(3,mt,_(1,1,a.state.profile$)))},dependencies:[E,Ne,X,I,K,J,te,z,Y,W,Ve,Me,P,M,N],styles:[".profile-entry[_ngcontent-%COMP%]{display:block;padding:0 1rem}"],changeDetection:0});let e=t;return e})();var xt=(e,t,n,i)=>({studentId:e,loading:t,courses:n,gradingScales:i});function Ct(e,t){if(e&1&&b(0,"bkd-dossier-grades-view",3),e&2){let n=l().bkdLet;o("courses",n.courses)("studentId",n.studentId)("gradingScales",n.gradingScales)}}function St(e,t){e&1&&(v(0),b(1,"bkd-spinner"),h())}function kt(e,t){if(e&1&&(v(0),c(1,Ct,1,3,"bkd-dossier-grades-view",1)(2,St,2,0,"ng-container",2),h()),e&2){let n=t.bkdLet;r(),o("ngIf",!n.loading),r(),o("ngIf",n.loading)}}var Ue=(()=>{let t=class t{constructor(i,s){this.state=i,this.dossierGradesService=s,this.destroy$=new q}ngOnInit(){this.state.currentDossier$.next("grades"),this.state.studentId$.pipe(H(this.destroy$)).subscribe(i=>this.dossierGradesService.setStudentId(i))}ngOnDestroy(){this.destroy$.next()}};t.\u0275fac=function(s){return new(s||t)(y(D),y(V))},t.\u0275cmp=x({type:t,selectors:[["bkd-dossier-grades"]],standalone:!0,features:[A],decls:5,vars:14,consts:[[4,"bkdLet"],[3,"courses","studentId","gradingScales",4,"ngIf"],[4,"ngIf"],[3,"courses","studentId","gradingScales"]],template:function(s,a){s&1&&(c(0,kt,3,2,"ng-container",0),m(1,"async"),m(2,"async"),m(3,"async"),m(4,"async")),s&2&&o("bkdLet",ye(9,xt,_(1,1,a.state.studentId$),_(2,3,a.dossierGradesService.loading$),_(3,5,a.dossierGradesService.studentCourses$),_(4,7,a.dossierGradesService.gradingScales$)))},dependencies:[E,I,Re,ee,P]});let e=t;return e})();var At=["*"];function It(e,t){if(e&1&&(d(0,"div",6)(1,"span",7),u(2),m(3,"date"),p(),d(4,"span",8),u(5),p()()),e&2){let n=l();r(2),G(xe(3,2,n.student.Birthdate,"dd.MM.yyyy")),r(3),g("(",n.student.Gender,")")}}var Qe=(()=>{let t=class t{constructor(){this.link="/"}};t.\u0275fac=function(s){return new(s||t)},t.\u0275cmp=x({type:t,selectors:[["bkd-student-backlink"]],inputs:{link:"link",queryParams:"queryParams",studentId:"studentId",studentName:"studentName",student:"student"},standalone:!0,features:[A],ngContentSelectors:At,decls:9,vars:5,consts:[[1,"d-flex","flex-column","w-100"],[3,"link","params"],[1,"d-flex","flex-row","align-items-start"],[1,"me-3","medium",3,"studentId"],[1,"d-flex","flex-column"],["class","additional-info",4,"ngIf"],[1,"additional-info"],[1,"birthday"],[1,"gender"]],template:function(s,a){s&1&&(be(),d(0,"div",0)(1,"bkd-backlink",1),ve(2),p(),d(3,"div",2),b(4,"bkd-avatar",3),d(5,"div",4)(6,"h1"),u(7),p(),c(8,It,6,5,"div",5),p()()()),s&2&&(r(),o("link",a.link)("params",a.queryParams),r(3),o("studentId",a.studentId),r(3),G(a.student?a.student.FullName:a.studentName),r(),o("ngIf",a.student))},dependencies:[Ge,Oe,I,Ce],styles:["[_nghost-%COMP%]{display:flex;align-items:center;width:100%}h1[_ngcontent-%COMP%]{margin:-3px 0 0;display:flex;align-items:baseline;line-height:1}.additional-info[_ngcontent-%COMP%]{color:#adb5bd}.gender[_ngcontent-%COMP%]{margin-left:.8ch}"],changeDetection:0});let e=t;return e})();var Dt=(e,t,n)=>({profile:e,currentDossierSection:t,reports:n}),$t=()=>["addresses","absences","grades"],Tt=()=>[],Pt=e=>({returnparams:e}),Et=e=>[e];function Lt(e,t){if(e&1&&b(0,"bkd-reports-link",10),e&2){let n,i=l(2).bkdLet;o("reports",(n=i.reports)!==null&&n!==void 0?n:ae(1,Tt))}}function wt(e,t){if(e&1&&(d(0,"a",11),m(1,"async"),d(2,"button",12,2),u(4),m(5,"translate"),p()()),e&2){let n=t.$implicit,i=f(3),s=l(3);o("queryParams",w(9,Pt,_(1,5,s.state.returnParams$)))("routerLink",w(11,Et,n)),r(2),ge("btn-outline-secondary",!i.isActive),r(2),g(" ",_(5,7,"dossier."+n)," ")}}function Bt(e,t){e&1&&(d(0,"div"),b(1,"router-outlet"),p())}function Ft(e,t){e&1&&(d(0,"p"),u(1),m(2,"translate"),p()),e&2&&(r(),G(_(2,1,"shared.profile.no-profile")))}function jt(e,t){if(e&1&&(v(0),d(1,"bkd-student-backlink",6),m(2,"async"),m(3,"async"),c(4,Lt,1,2,"bkd-reports-link",7),p(),d(5,"div",8),c(6,wt,6,13,"a",9),p(),c(7,Bt,2,0,"div",5)(8,Ft,3,3,"ng-template",null,1,ce),h()),e&2){let n=f(9),i=l().bkdLet,s=l();r(),o("link","../..")("queryParams",_(2,8,s.state.backlinkQueryParams$))("studentId",_(3,10,s.state.studentId$))("student",i.profile&&i.profile.student),r(3),o("ngIf",i.currentDossierSection==="grades"),r(2),o("ngForOf",ae(12,$t)),r(),o("ngIf",i.profile)("ngIfElse",n)}}function Nt(e,t){e&1&&b(0,"bkd-spinner")}function Mt(e,t){if(e&1&&(v(0),c(1,jt,10,13,"ng-container",5),m(2,"async"),c(3,Nt,1,0,"ng-template",null,0,ce),h()),e&2){let n=f(4),i=l();r(),o("ngIf",_(2,2,i.state.loading$)===!1)("ngIfElse",n)}}var We=(()=>{let t=class t{constructor(i,s){this.state=i,this.dossierGradesService=s,this.state.currentDossier$.next("addresses")}};t.\u0275fac=function(s){return new(s||t)(y(D),y(V))},t.\u0275cmp=x({type:t,selectors:[["bkd-student-dossier"]],standalone:!0,features:[Q([D,V]),A],decls:5,vars:11,consts:[["loading",""],["noProfile",""],["rla","routerLinkActive"],[1,"bkd-container","bkd-container-limited"],[4,"bkdLet"],[4,"ngIf","ngIfElse"],[1,"mb-2",3,"link","queryParams","studentId","student"],["class","ms-2",3,"reports",4,"ngIf"],[1,"d-flex","flex-row","py-3","flex-wrap"],["class","me-1 mt-1 me-sm-2",3,"queryParams","routerLink",4,"ngFor","ngForOf"],[1,"ms-2",3,"reports"],[1,"me-1","mt-1","me-sm-2",3,"queryParams","routerLink"],["data-test-id","dossier-section-button","type","button","routerLinkActive","btn-primary",1,"btn","btn-outline-secondary"]],template:function(s,a){s&1&&(d(0,"div",3),c(1,Mt,5,4,"ng-container",4),m(2,"async"),m(3,"async"),m(4,"async"),p()),s&2&&(r(),o("bkdLet",he(7,Dt,_(2,1,a.state.profile$),_(3,3,a.state.currentDossier$),_(4,5,a.dossierGradesService.testReports$))))},dependencies:[E,I,Qe,we,W,Ae,Ie,ke,ee,P,M,N],changeDetection:0});let e=t;return e})();var Gn={path:"student/:id",children:[{path:"",component:We,children:[{path:"addresses",component:He},{path:"absences",component:qe},{path:"grades",component:Ue}]},{path:"absences/confirm",component:Ee}]};export{Gn as a}; diff --git a/public/apps/webapp-schulverwaltung/chunk-XYF73IOS.js b/public/apps/webapp-schulverwaltung/chunk-MGID7RWQ.js similarity index 90% rename from public/apps/webapp-schulverwaltung/chunk-XYF73IOS.js rename to public/apps/webapp-schulverwaltung/chunk-MGID7RWQ.js index 1d6c18bd..3011f844 100644 --- a/public/apps/webapp-schulverwaltung/chunk-XYF73IOS.js +++ b/public/apps/webapp-schulverwaltung/chunk-MGID7RWQ.js @@ -1 +1 @@ -import{q as b}from"./chunk-7LCBKZQT.js";import{b as l}from"./chunk-SOHFFTKU.js";import{$b as m,Ac as n,Dd as d,Fc as f,O as s,Vc as u,W as p,Z as o,dc as a,zc as c}from"./chunk-XTHSYQMN.js";var h=f({Id:n,Designation:c,StudentCount:n});var T=(()=>{let t=class t extends l{constructor(r,i){super(r,i,h,"Events")}getStudyCourseEvents(){let r=new m().set("filter.EventTypeId=","1");return this.getList({params:r})}getSubscriptionDetailsDefinitions(r){return this.http.get(`${this.baseUrl}/${r}/SubscriptionDetails`).pipe(s(d(b)))}};t.\u0275fac=function(i){return new(i||t)(o(a),o(u))},t.\u0275prov=p({token:t,factory:t.\u0275fac,providedIn:"root"});let e=t;return e})();export{T as a}; +import{q as b}from"./chunk-W7ASLXRM.js";import{b as l}from"./chunk-SOHFFTKU.js";import{$b as m,Ac as n,Dd as d,Fc as f,O as s,Vc as u,W as p,Z as o,dc as a,zc as c}from"./chunk-XTHSYQMN.js";var h=f({Id:n,Designation:c,StudentCount:n});var T=(()=>{let t=class t extends l{constructor(r,i){super(r,i,h,"Events")}getStudyCourseEvents(){let r=new m().set("filter.EventTypeId=","1");return this.getList({params:r})}getSubscriptionDetailsDefinitions(r){return this.http.get(`${this.baseUrl}/${r}/SubscriptionDetails`).pipe(s(d(b)))}};t.\u0275fac=function(i){return new(i||t)(o(a),o(u))},t.\u0275prov=p({token:t,factory:t.\u0275fac,providedIn:"root"});let e=t;return e})();export{T as a}; diff --git a/public/apps/webapp-schulverwaltung/chunk-EO6OESLF.js b/public/apps/webapp-schulverwaltung/chunk-PMU42JF5.js similarity index 97% rename from public/apps/webapp-schulverwaltung/chunk-EO6OESLF.js rename to public/apps/webapp-schulverwaltung/chunk-PMU42JF5.js index b910c5f7..de8bed9b 100644 --- a/public/apps/webapp-schulverwaltung/chunk-EO6OESLF.js +++ b/public/apps/webapp-schulverwaltung/chunk-PMU42JF5.js @@ -1 +1 @@ -import{p as X,r as Z,s as te,t as ie,w as re}from"./chunk-7LCBKZQT.js";import"./chunk-Y4QYVF5K.js";import"./chunk-HII3S2DL.js";import{d as ee}from"./chunk-RFO4NYUO.js";import{a as K,b as W}from"./chunk-FTDG26ID.js";import{a as z,c as Q}from"./chunk-SOHFFTKU.js";import{A as w,u as _}from"./chunk-C56YGDXA.js";import{$ as g,$a as O,Ab as d,Bb as p,Ga as j,Gd as k,Hd as R,Ia as f,Id as Y,L as B,O as T,Sa as C,Sb as J,Ta as S,Ua as l,Va as A,Vb as M,Vc as V,W as L,Wa as N,Z as m,g as E,jb as b,kb as $,m as a,n as F,pc as U,r as P,sb as G,tb as h,ua as u,ub as q,va as I,yb as H}from"./chunk-XTHSYQMN.js";var v=(()=>{let e=class e{constructor(n,r,o,y,de,pe,ce){this.storageService=n,this.loadingService=r,this.coursesRestService=o,this.subscriptionRestService=y,this.reportsService=de,this.gradingScalesRestService=pe,this.settings=ce,this.studentId$=new E(1),this.loading$=this.loadingService.loading$,this.studentCourses$=this.loadCourses().pipe(B(1)),this.studentCoursesSorted$=this.studentCourses$.pipe(a(i=>i.slice().sort((s,me)=>s.Designation.localeCompare(me.Designation)))),this.studentCourseIds$=this.studentCourses$.pipe(a(i=>i.flatMap(s=>s.Id))),this.idSubscriptions$=F([this.studentId$,this.studentCourseIds$]).pipe(T(([i,s])=>this.subscriptionRestService.getIdSubscriptionsByStudentAndCourse(i,s))),this.ids$=this.idSubscriptions$.pipe(a(i=>i.map(s=>s.Id))),this.testReports$=this.ids$.pipe(a(i=>this.reportsService.getStudentSubscriptionReports(i))),this.tests$=this.studentCourses$.pipe(a(i=>i.flatMap(s=>s.Tests).filter(_))),this.gradingScaleIdsFromTests$=this.tests$.pipe(a(i=>[...i.map(s=>s.GradingScaleId)].filter(_).filter(w))),this.gradingScaleIdsFromCourses$=this.studentCourses$.pipe(a(i=>i.flatMap(s=>s.GradingScaleId).filter(_).filter(w))),this.gradingScaleIds$=F([this.gradingScaleIdsFromCourses$,this.gradingScaleIdsFromTests$]).pipe(a(([i,s])=>i.concat(s).filter(w))),this.gradingScales$=this.gradingScaleIds$.pipe(T(i=>P(i.map(s=>this.gradingScalesRestService.getGradingScale(s)))));let D=this.storageService.getPayload()?.id_person;D&&this.studentId$.next(Number(D))}loadCourses(){return this.loadingService.load(this.coursesRestService.getExpandedCoursesForStudent())}};e.\u0275fac=function(r){return new(r||e)(m(Y),m(W),m(X),m(Z),m(ee),m(te),m(V))},e.\u0275prov=L({token:e,factory:e.\u0275fac});let t=e;return t})();var ue=()=>[],ne=(()=>{let e=class e{constructor(n){this.myGradesService=n}};e.\u0275fac=function(r){return new(r||e)(I(v))},e.\u0275cmp=g({type:e,selectors:[["bkd-my-grades-header"]],standalone:!0,features:[h],decls:7,vars:7,consts:[[1,"d-flex","justify-content-between","header"],[3,"reports"]],template:function(r,o){if(r&1&&(C(0,"div",0)(1,"div"),b(2),d(3,"translate"),S(),C(4,"div"),l(5,"bkd-reports-link",1),d(6,"async"),S()()),r&2){let y;u(2),$(p(3,2,"my-grades.header")),u(3),f("reports",(y=p(6,4,o.myGradesService.testReports$))!==null&&y!==void 0?y:q(6,ue))}},dependencies:[K,M,R,k],styles:[".header[_ngcontent-%COMP%]{padding-bottom:1rem}.report[_ngcontent-%COMP%]{margin-left:1rem}"]});let t=e;return t})();var fe=(t,e,c,n)=>({loading:t,studentId:e,courses:c,gradingScales:n});function ge(t,e){if(t&1&&l(0,"bkd-dossier-grades-view",4),t&2){let c=O().bkdLet;f("courses",c.courses)("studentId",c.studentId)("gradingScales",c.gradingScales)("isEditable",!1)}}function Se(t,e){t&1&&(A(0),l(1,"bkd-spinner"),N())}function he(t,e){if(t&1&&(C(0,"div",1)(1,"h1"),b(2),d(3,"translate"),S(),l(4,"bkd-my-grades-header"),j(5,ge,1,4,"bkd-dossier-grades-view",2)(6,Se,2,0,"ng-container",3),S()),t&2){let c=e.bkdLet;u(2),$(p(3,3,"my-grades.title")),u(3),f("ngIf",!c.loading),u(),f("ngIf",c.loading)}}var oe=(()=>{let e=class e{constructor(n){this.myGradesService=n}};e.\u0275fac=function(r){return new(r||e)(I(v))},e.\u0275cmp=g({type:e,selectors:[["bkd-my-grades-show"]],standalone:!0,features:[G([ie]),h],decls:5,vars:14,consts:[["class","bkd-container bkd-container-limited",4,"bkdLet"],[1,"bkd-container","bkd-container-limited"],[3,"courses","studentId","gradingScales","isEditable",4,"ngIf"],[4,"ngIf"],[3,"courses","studentId","gradingScales","isEditable"]],template:function(r,o){r&1&&(j(0,he,7,5,"div",0),d(1,"async"),d(2,"async"),d(3,"async"),d(4,"async")),r&2&&f("bkdLet",H(9,fe,p(1,1,o.myGradesService.loading$),p(2,3,o.myGradesService.studentId$),p(3,5,o.myGradesService.studentCoursesSorted$),p(4,7,o.myGradesService.gradingScales$)))},dependencies:[z,ne,J,re,Q,M,R,k]});let t=e;return t})();var ae=(()=>{let e=class e{constructor(){}};e.\u0275fac=function(r){return new(r||e)},e.\u0275cmp=g({type:e,selectors:[["bkd-my-grades"]],standalone:!0,features:[G([v]),h],decls:1,vars:0,template:function(r,o){r&1&&l(0,"router-outlet")},dependencies:[U]});let t=e;return t})();var Je=[{path:"",component:ae,children:[{path:"",component:oe}]}];export{Je as MY_GRADES_ROUTES}; +import{p as X,r as Z,s as te,t as ie,w as re}from"./chunk-W7ASLXRM.js";import"./chunk-Y4QYVF5K.js";import"./chunk-HII3S2DL.js";import{d as ee}from"./chunk-RFO4NYUO.js";import{a as K,b as W}from"./chunk-FTDG26ID.js";import{a as z,c as Q}from"./chunk-SOHFFTKU.js";import{A as w,u as _}from"./chunk-C56YGDXA.js";import{$ as g,$a as O,Ab as d,Bb as p,Ga as j,Gd as k,Hd as R,Ia as f,Id as Y,L as B,O as T,Sa as C,Sb as J,Ta as S,Ua as l,Va as A,Vb as M,Vc as V,W as L,Wa as N,Z as m,g as E,jb as b,kb as $,m as a,n as F,pc as U,r as P,sb as G,tb as h,ua as u,ub as q,va as I,yb as H}from"./chunk-XTHSYQMN.js";var v=(()=>{let e=class e{constructor(n,r,o,y,de,pe,ce){this.storageService=n,this.loadingService=r,this.coursesRestService=o,this.subscriptionRestService=y,this.reportsService=de,this.gradingScalesRestService=pe,this.settings=ce,this.studentId$=new E(1),this.loading$=this.loadingService.loading$,this.studentCourses$=this.loadCourses().pipe(B(1)),this.studentCoursesSorted$=this.studentCourses$.pipe(a(i=>i.slice().sort((s,me)=>s.Designation.localeCompare(me.Designation)))),this.studentCourseIds$=this.studentCourses$.pipe(a(i=>i.flatMap(s=>s.Id))),this.idSubscriptions$=F([this.studentId$,this.studentCourseIds$]).pipe(T(([i,s])=>this.subscriptionRestService.getIdSubscriptionsByStudentAndCourse(i,s))),this.ids$=this.idSubscriptions$.pipe(a(i=>i.map(s=>s.Id))),this.testReports$=this.ids$.pipe(a(i=>this.reportsService.getStudentSubscriptionReports(i))),this.tests$=this.studentCourses$.pipe(a(i=>i.flatMap(s=>s.Tests).filter(_))),this.gradingScaleIdsFromTests$=this.tests$.pipe(a(i=>[...i.map(s=>s.GradingScaleId)].filter(_).filter(w))),this.gradingScaleIdsFromCourses$=this.studentCourses$.pipe(a(i=>i.flatMap(s=>s.GradingScaleId).filter(_).filter(w))),this.gradingScaleIds$=F([this.gradingScaleIdsFromCourses$,this.gradingScaleIdsFromTests$]).pipe(a(([i,s])=>i.concat(s).filter(w))),this.gradingScales$=this.gradingScaleIds$.pipe(T(i=>P(i.map(s=>this.gradingScalesRestService.getGradingScale(s)))));let D=this.storageService.getPayload()?.id_person;D&&this.studentId$.next(Number(D))}loadCourses(){return this.loadingService.load(this.coursesRestService.getExpandedCoursesForStudent())}};e.\u0275fac=function(r){return new(r||e)(m(Y),m(W),m(X),m(Z),m(ee),m(te),m(V))},e.\u0275prov=L({token:e,factory:e.\u0275fac});let t=e;return t})();var ue=()=>[],ne=(()=>{let e=class e{constructor(n){this.myGradesService=n}};e.\u0275fac=function(r){return new(r||e)(I(v))},e.\u0275cmp=g({type:e,selectors:[["bkd-my-grades-header"]],standalone:!0,features:[h],decls:7,vars:7,consts:[[1,"d-flex","justify-content-between","header"],[3,"reports"]],template:function(r,o){if(r&1&&(C(0,"div",0)(1,"div"),b(2),d(3,"translate"),S(),C(4,"div"),l(5,"bkd-reports-link",1),d(6,"async"),S()()),r&2){let y;u(2),$(p(3,2,"my-grades.header")),u(3),f("reports",(y=p(6,4,o.myGradesService.testReports$))!==null&&y!==void 0?y:q(6,ue))}},dependencies:[K,M,R,k],styles:[".header[_ngcontent-%COMP%]{padding-bottom:1rem}.report[_ngcontent-%COMP%]{margin-left:1rem}"]});let t=e;return t})();var fe=(t,e,c,n)=>({loading:t,studentId:e,courses:c,gradingScales:n});function ge(t,e){if(t&1&&l(0,"bkd-dossier-grades-view",4),t&2){let c=O().bkdLet;f("courses",c.courses)("studentId",c.studentId)("gradingScales",c.gradingScales)("isEditable",!1)}}function Se(t,e){t&1&&(A(0),l(1,"bkd-spinner"),N())}function he(t,e){if(t&1&&(C(0,"div",1)(1,"h1"),b(2),d(3,"translate"),S(),l(4,"bkd-my-grades-header"),j(5,ge,1,4,"bkd-dossier-grades-view",2)(6,Se,2,0,"ng-container",3),S()),t&2){let c=e.bkdLet;u(2),$(p(3,3,"my-grades.title")),u(3),f("ngIf",!c.loading),u(),f("ngIf",c.loading)}}var oe=(()=>{let e=class e{constructor(n){this.myGradesService=n}};e.\u0275fac=function(r){return new(r||e)(I(v))},e.\u0275cmp=g({type:e,selectors:[["bkd-my-grades-show"]],standalone:!0,features:[G([ie]),h],decls:5,vars:14,consts:[["class","bkd-container bkd-container-limited",4,"bkdLet"],[1,"bkd-container","bkd-container-limited"],[3,"courses","studentId","gradingScales","isEditable",4,"ngIf"],[4,"ngIf"],[3,"courses","studentId","gradingScales","isEditable"]],template:function(r,o){r&1&&(j(0,he,7,5,"div",0),d(1,"async"),d(2,"async"),d(3,"async"),d(4,"async")),r&2&&f("bkdLet",H(9,fe,p(1,1,o.myGradesService.loading$),p(2,3,o.myGradesService.studentId$),p(3,5,o.myGradesService.studentCoursesSorted$),p(4,7,o.myGradesService.gradingScales$)))},dependencies:[z,ne,J,re,Q,M,R,k]});let t=e;return t})();var ae=(()=>{let e=class e{constructor(){}};e.\u0275fac=function(r){return new(r||e)},e.\u0275cmp=g({type:e,selectors:[["bkd-my-grades"]],standalone:!0,features:[G([v]),h],decls:1,vars:0,template:function(r,o){r&1&&l(0,"router-outlet")},dependencies:[U]});let t=e;return t})();var Je=[{path:"",component:ae,children:[{path:"",component:oe}]}];export{Je as MY_GRADES_ROUTES}; diff --git a/public/apps/webapp-schulverwaltung/chunk-TPZAD5BA.js b/public/apps/webapp-schulverwaltung/chunk-VJ6UATSE.js similarity index 99% rename from public/apps/webapp-schulverwaltung/chunk-TPZAD5BA.js rename to public/apps/webapp-schulverwaltung/chunk-VJ6UATSE.js index 49102ebd..9e9f2af4 100644 --- a/public/apps/webapp-schulverwaltung/chunk-TPZAD5BA.js +++ b/public/apps/webapp-schulverwaltung/chunk-VJ6UATSE.js @@ -1 +1 @@ -import{a as Cn,b as vn}from"./chunk-673RVEOB.js";import{a as me,b as we}from"./chunk-KDAC4GJ5.js";import{b as bn}from"./chunk-ZROJU7EX.js";import{a as yn}from"./chunk-XYF73IOS.js";import{a as Pn,b as xn}from"./chunk-RQFEXCIP.js";import{a as _n}from"./chunk-GXZYLK4L.js";import{e as fn}from"./chunk-U4HODSW3.js";import{q as gn,v as Ie}from"./chunk-7LCBKZQT.js";import{a as at}from"./chunk-PSXDSPKS.js";import{b as Jt,e as ze}from"./chunk-C7XT5XXE.js";import{a as rn}from"./chunk-YMJC6QZX.js";import"./chunk-Y4QYVF5K.js";import"./chunk-HII3S2DL.js";import{a as In}from"./chunk-DZZC2YX2.js";import{a as Sn}from"./chunk-K3EEKOGY.js";import{a as pt,d as un}from"./chunk-24AFRN2G.js";import{a as cn}from"./chunk-RFO4NYUO.js";import{a as an,b as pn}from"./chunk-5RDJZAUT.js";import"./chunk-DB66EACG.js";import{E as en,F as tn,L as nn,P as on,T as Se,U as sn,W as ct,Y as hn,j as Xt,t as Yt,y as Zt,z as Qe}from"./chunk-ZK2MNT7Z.js";import{d as st,e as ae}from"./chunk-AW7CSGKI.js";import{b as pe}from"./chunk-FTDG26ID.js";import{a as ce,b as Ke,c as xe,g as ln,h as dn,i as mn}from"./chunk-SOHFFTKU.js";import{f as Rt,g as Nt,h as He,i as Gt,j as Ut,k as Ht,m as qt,n as Wt,o as Ee,p as se,u as zt,w as We}from"./chunk-C56YGDXA.js";import{a as Pe}from"./chunk-UX5TA32W.js";import{$ as L,$a as u,$c as Vt,A as ht,Ab as l,B as _t,Bb as m,C as nt,Cb as U,Dd as Qt,E as D,Eb as _e,Fd as Q,G as Ve,Ga as v,Gd as F,Hd as j,Ia as g,Id as Kt,J as Ct,Ja as K,K as vt,Ka as Pt,L as B,La as Re,Lc as Ft,M as it,Mb as Et,N as Ae,O as T,Q as q,Qb as Dt,Rb as N,Sa as c,Sb as ie,Ta as p,Ua as W,Va as Z,Vb as oe,Vc as H,W as R,Wa as ee,Wb as Ce,Ya as M,Yc as jt,Z as y,_a as b,a as ue,ad as ve,b as ge,bc as ot,bd as be,db as z,dc as Ne,dd as At,e as $,ed as ye,f as fe,fb as St,g as Te,ga as bt,gb as xt,ha as P,hb as It,ia as S,ib as te,jb as d,k as J,kb as w,la as yt,lb as x,m as f,mb as wt,n as O,nb as Mt,ob as kt,oc as Ge,pc as Bt,r as $e,ra as Y,rc as Ue,rd as re,sb as he,t as ft,tb as E,td as rt,ua as s,ub as Ot,v as X,va as _,vb as ne,w as Le,wb as Tt,xb as $t,yb as Lt,yd as qe,zd as De}from"./chunk-XTHSYQMN.js";function wn(n,i){let r=st(n),e=st(i);return+r==+e}function Mn(n,i,r){let e=i.map(o=>({eventId:o,group:n})),t=r.map(o=>e.find(a=>a.eventId===o.eventId)||o);return[...new Set([...t,...e])].filter(o=>o.group!==null)}var Je=(()=>{let i=class i extends nn{};i.\u0275fac=(()=>{let e;return function(o){return(e||(e=yt(i)))(o||i)}})(),i.\u0275prov=R({token:i,factory:i.\u0275fac});let n=i;return n})();function kn(n,i){return[...n].sort(ei(i))}function ei(n){return(i,r)=>{switch(n.primarySortKey){case"name":{let e=i.name.localeCompare(r.name);return n.ascending?e*-1:e}case"group":{let e=(i.detail.Value||"").localeCompare(r.detail.Value||"");return n.ascending?e*-1:e}}}}function On(n,i){return n.map(r=>ti(r,i))}function ti(n,i){return{id:n.IdPerson,name:i.find(r=>r.StudentRef.Id===n.IdPerson)?.StudentFullName||"",group:n.Value,detail:n}}function Tn(n,i){return n.filter(r=>r.VssId===i.subscriptionDetailGroupId)}function lt(n,i){return n.find(r=>r.VssId===i.subscriptionDetailGroupId)}function ni(n,i){if(n&1){let r=M();c(0,"div",5)(1,"input",6),b("change",function(){let t=P(r).$implicit,o=u();return S(o.onSelectionChange(t))}),p(),c(2,"label",7),d(3),p()()}if(n&2){let r=i.$implicit,e=i.index,t=u();s(),z("id","group-",e,""),g("checked",r.id===t.selected.id)("value",r.id),s(),z("for","group-",e,""),s(),x(" ",r.label," ")}}var Be=function(n){return n.Select="select",n.Assign="assign",n}(Be||{}),$n=(()=>{let i=class i{constructor(e,t){this.activeModal=e,this.translate=t,this.groupOptions=[]}ngOnInit(){this.title=`presence-control.groups.${this.dialogMode}.title`;let e=this.createEmtpyOption();this.groupOptions=this.createGroupOptions(this.subscriptionDetailsDefinitions),this.groupOptions.unshift(e),this.selected=this.groupOptions.find(t=>t.id===this.group)||e}createEmtpyOption(){let e=this.dialogMode===Be.Select?"presence-control.groups.all":"presence-control.groups.none";return{id:null,label:this.translate.instant(e)}}createGroupOptions(e){return e.DropdownItems?e.DropdownItems.map(t=>({id:t.Key,label:`${this.translate.instant("presence-control.groups.group")} ${t.Value}`})):[]}getSelectedGroup(){return this.selected}onSelectionChange(e){this.selected=e}};i.\u0275fac=function(t){return new(t||i)(_(se),_(Q))},i.\u0275cmp=L({type:i,selectors:[["bkd-presence-control-group-dialog"]],inputs:{dialogMode:"dialogMode",subscriptionDetailsDefinitions:"subscriptionDetailsDefinitions",group:"group"},standalone:!0,features:[E],decls:13,vars:10,consts:[[1,"modal-body"],["class","form-check",4,"ngFor","ngForOf"],[1,"modal-footer"],["type","button",1,"btn","btn-outline-secondary",3,"click"],["type","button",1,"btn","btn-primary",3,"click"],[1,"form-check"],["type","radio","name","groups",1,"form-check-input",3,"change","id","checked","value"],[1,"form-check-label",3,"for"]],template:function(t,o){t&1&&(c(0,"div",0)(1,"p"),d(2),l(3,"translate"),p(),c(4,"form"),v(5,ni,4,7,"div",1),p()(),c(6,"div",2)(7,"button",3),b("click",function(){return o.activeModal.dismiss()}),d(8),l(9,"translate"),p(),c(10,"button",4),b("click",function(){return o.activeModal.close(o.getSelectedGroup())}),d(11),l(12,"translate"),p()()),t&2&&(s(2),x(" ",m(3,4,o.title)," "),s(3),g("ngForOf",o.groupOptions),s(3),x(" ",m(9,6,"presence-control.groups.cancel")," "),s(3),x(" ",m(12,8,"presence-control.groups.save")," "))},dependencies:[re,ye,ve,be,N,j,F]});let n=i;return n})();function Ln(n,i,r,e){return n.map(t=>{let o=i.find(a=>ii(a.presence,t));if(o){let a;return!o.newPresenceTypeId&&t.Comment?a=r.find(h=>h.IsComment)||null:a=r.find(h=>h.Id===o.newPresenceTypeId)||null,ge(ue({},t),{TypeRef:oi(a),Date:null,Type:a?a.Designation:null,ConfirmationStateId:Qe(a,e)})}return t})}function ii(n,i){return n.LessonRef.Id===i.LessonRef.Id&&n.StudentRef.Id===i.StudentRef.Id}function oi(n){return{Id:n?n.Id:null,HRef:null}}function Ye(n){return i=>i.reduce((r,e)=>r+(e.presenceCategory===n?1:0),0)}function En(){return n=>n.reduce((i,r)=>i+(r.precedingAbsences&&r.precedingAbsences.length>0?1:0),0)}var Dn=(()=>{let i=class i extends Ke{constructor(e,t){super(e,t,pt,"LessonTeachers")}loadOtherTeachersLessonAbsences(e,t,o){let a=`${this.baseUrl}/except/${e}/LessonAbsences?expand=LessonRef`;return t&&t.length>0&&(a=a.concat("&filter.StudentRef=;"+t.join(";"))),this.http.get(a,{params:o}).pipe(T(Qt(pt)))}};i.\u0275fac=function(t){return new(t||i)(y(Ne),y(H))},i.\u0275prov=R({token:i,factory:i.\u0275fac,providedIn:"root"});let n=i;return n})();var Ze=(()=>{let i=class i extends Ke{constructor(e,t){super(e,t,gn,"SubscriptionDetails")}getListForEvent(e){return this.getList({params:{IdEvent:String(e)}})}update(e,t){let o={IdPerson:t.IdPerson,EventId:t.EventId,Value:e};return this.http.put(`${this.baseUrl}/${t.Id}`,o).pipe(f(()=>{}))}};i.\u0275fac=function(t){return new(t||i)(y(Ne),y(H))},i.\u0275prov=R({token:i,factory:i.\u0275fac,providedIn:"root"});let n=i;return n})();var Fn="presence-control-group",de=(()=>{let i=class i{constructor(e,t,o,a,h){this.userSettings=e,this.eventService=t,this.subscriptionDetailsService=o,this.loadingService=a,this.settings=h,this.selectGroup$=new $,this.selectedLesson$=new Te,this.lessonPresences$=new Te,this.reloadSubscriptionDetails$=new $,this.defaultGroup=null,this.savedGroup$=this.selectedLesson$.pipe(T(C=>this.userSettings.getPresenceControlGroupView().pipe(f(k=>this.findGroupByLesson(k,C))))),this.group$=X(this.selectGroup$,this.savedGroup$).pipe(Ae(this.defaultGroup),B(1)),this.loading$=this.loadingService.loading(Fn),this.subscriptionDetailsDefinitions$=this.selectedLesson$.pipe(f(C=>C?.getEventIds()||[]),T(C=>$e(C.map(k=>this.eventService.getSubscriptionDetailsDefinitions(k)))),B(1)),this.groupsAvailability$=this.subscriptionDetailsDefinitions$.pipe(f(C=>C.every(k=>lt(k,this.settings))),B(1)),this.subscriptionDetails$=O([this.selectedLesson$,this.groupsAvailability$,this.reloadSubscriptionDetails$.pipe(f(()=>!1),Ae(!0))]).pipe(T(([C,k,V])=>C&&k?this.loadSubscriptionDetailsForLesson(C,V):J([])),f(C=>Tn(C,this.settings)),B(1)),this.subscriptionDetailPersonIds$=O([this.group$,this.subscriptionDetails$]).pipe(f(([C,k])=>k.filter(V=>V.Value===C).map(V=>V.IdPerson)),Ae([]))}selectGroup(e){this.selectGroup$.next(e)}setSelectedLesson(e){this.selectedLesson$.next(e)}setLessonPresences(e){this.lessonPresences$.next(e)}getSubscriptionDetailsDefinitions(){return this.subscriptionDetailsDefinitions$.pipe(f(rt),f(e=>lt(e,this.settings)))}getSubscriptionDetailsForStudents(){return O([this.subscriptionDetails$,this.lessonPresences$]).pipe(f(ae(On)))}reloadSubscriptionDetails(){this.reloadSubscriptionDetails$.next(void 0)}loadSubscriptionDetailsForLesson(e,t=!0){return this.loadingService.load($e(De(e.getEventIds()).map(o=>this.subscriptionDetailsService.getListForEvent(o))),t?void 0:Fn).pipe(f(rt))}findGroupByLesson(e,t){return e.find(a=>a.eventId===t?.getEventIds()[0])?.group||this.defaultGroup}};i.\u0275fac=function(t){return new(t||i)(y(we),y(yn),y(Ze),y(pe),y(H))},i.\u0275prov=R({token:i,factory:i.\u0275fac});let n=i;return n})();var An=Object.values(me),G=(()=>{let i=class i{constructor(e,t,o,a,h,C,k,V,Me,ke){this.userSettings=e,this.lessonPresencesService=t,this.lessonTeacherService=o,this.presenceTypesService=a,this.groupService=h,this.dropDownItemsService=C,this.loadingService=k,this.storageService=V,this.settings=Me,this.location=ke,this.selectedDateSubject$=new fe(new Date),this.selectedDate$=this.selectedDateSubject$.asObservable().pipe(f(Xt),Ve(qe)),this.viewModeSubject$=new $,this.viewMode$=X(this.viewModeSubject$,this.userSettings.getPresenceControlViewMode().pipe(D(1))),this.lessons$=this.selectedDate$.pipe(T(I=>this.loadLessonsByDate(I)),B(1)),this.selectLessonId$=new $,this.selectLesson$=this.selectLessonId$.pipe(T(I=>this.getLessonById(I))),this.selectedLesson$=O([ln(this.selectLesson$.pipe(Ve((I,Oe)=>qe(I,Oe))),dn(this.settings.lessonPresencesRefreshTime)),this.lessons$]).pipe(f(([I,Oe])=>Oe.find(Yn=>Yn.id===I.id)?I:null),B(1)),this.studyClassCount$=this.selectedLesson$.pipe(f(I=>I?.lessons.length||0)),this.updateLessonPresences$=new $,this.reloadLessonPresences$=new $,this.lessonPresences$=X(mn(this.selectedLesson$,this.reloadLessonPresences$).pipe(T(I=>I?this.loadLessonPresencesByLesson(I):J([]))),this.updateLessonPresences$).pipe(B(1)),this.presenceTypes$=this.loadPresenceTypes().pipe(B(1)),this.reloadStudentIdsWithUnconfirmedAbsences$=new $,this.studentIdsWithUnconfirmedAbsences$=X(this.selectedDate$,this.selectedLesson$.pipe(it(1)),this.reloadStudentIdsWithUnconfirmedAbsences$).pipe(T(()=>this.loadStudentIdsWithUnconfirmedAbsences()),B(1)),this.loading$=this.loadingService.loading$,this.absenceConfirmationStates$=this.dropDownItemsService.getAbsenceConfirmationStates().pipe(B(1)),this.studentIds$=this.lessonPresences$.pipe(f(I=>De(I.map(Oe=>Oe.StudentRef.Id))),B(1)),this.otherTeachersAbsences$=this.studentIds$.pipe(Ve(qe),T(I=>I.length>0?this.lessonTeacherService.loadOtherTeachersLessonAbsences(this.getMyself(),I):J([])),B(1)),this.groupsAvailability$=this.groupService.groupsAvailability$,this.presenceControlEntries$=O([this.selectedLesson$,this.lessonPresences$,this.presenceTypes$,this.absenceConfirmationStates$,this.otherTeachersAbsences$]).pipe(f(ae(en))),this.presenceControlEntriesByGroup$=O([this.groupService.group$,this.presenceControlEntries$,this.groupService.subscriptionDetailPersonIds$]).pipe(f(ae(bn)),B(1)),this.presentCount$=this.presenceControlEntriesByGroup$.pipe(f(Ye("present"))),this.absentCount$=this.presenceControlEntriesByGroup$.pipe(f(Ye("absent"))),this.unapprovedCount$=this.presenceControlEntriesByGroup$.pipe(f(Ye("unapproved"))),this.absentPrecedingCount$=this.presenceControlEntriesByGroup$.pipe(f(En())),this.queryParamsString$=O([this.selectedDate$,this.selectedLesson$,this.viewMode$]).pipe(f(ae(this.buildQueryParams.bind(this))),f(pn)),this.destroy$=new $,this.queryParamsString$.pipe(q(this.destroy$)).subscribe(I=>{this.location.replaceState("/presence-control",I),this.confirmBackLinkParams={returnparams:I}}),this.viewMode$.pipe(it(1),T(I=>this.userSettings.savePresenceControlViewMode(I)),q(this.destroy$)).subscribe(),this.selectedLesson$.pipe(q(this.destroy$)).subscribe(I=>{this.groupService.setSelectedLesson(I)}),this.lessonPresences$.pipe(q(this.destroy$)).subscribe(I=>this.groupService.setLessonPresences(I))}ngOnDestroy(){this.destroy$.next()}setDate(e){this.selectedDateSubject$.next(e)}setLessonId(e){this.selectLessonId$.next(e)}setViewMode(e){this.viewModeSubject$.next(e)}updateLessonPresencesTypes(e){O([this.lessonPresences$.pipe(D(1)),this.presenceTypes$.pipe(D(1))]).pipe(f(([t,o])=>Ln(t,e,o,this.settings))).subscribe(t=>this.updateLessonPresences$.next(t))}getNextPresenceType(e){return this.presenceTypes$.pipe(D(1),f(t=>e.getNextPresenceType(t)))}hasUnconfirmedAbsences(e){return this.studentIdsWithUnconfirmedAbsences$.pipe(f(t=>t.includes(e.lessonPresence.StudentRef.Id)))}updateAfterConfirm(){this.reloadLessonPresences$.next(),this.reloadStudentIdsWithUnconfirmedAbsences$.next()}loadLessonPresencesByLesson(e){return this.loadingService.load(this.lessonPresencesService.getListByLessons(e.lessons))}loadLessonsByDate(e){return this.loadingService.load(this.lessonPresencesService.getLessonsByDate(e)).pipe(f(Cn))}loadPresenceTypes(){return this.loadingService.load(this.presenceTypesService.presenceTypes$)}loadStudentIdsWithUnconfirmedAbsences(){return ft(0,this.settings.unconfirmedAbsencesRefreshTime||-1).pipe(T(()=>this.lessonPresencesService.getListOfUnconfirmed()),f(e=>De(e.map(t=>t.StudentRef.Id))))}buildQueryParams(e,t,o){let a={date:Yt(e,"yyyy-MM-dd"),viewMode:o};return t&&(a.lesson=String(t.id)),a}getLessonById(e){let t=String(e);return this.lessons$.pipe(f(o=>t&&o.find(a=>a.id===t)||vn(o)),Le(Boolean))}getMyself(){let e=this.storageService.getPayload();return Number(e?.holder_id||e?.id_person)}};i.\u0275fac=function(t){return new(t||i)(y(we),y(ze),y(Dn),y(Se),y(de),y(rn),y(pe),y(Kt),y(H),y(Et))},i.\u0275prov=R({token:i,factory:i.\u0275fac});let n=i;return n})();var pi=(n,i,r,e)=>({sortCriteria:n,sortedEntries:i,selection:r,group:e}),li=()=>["/presence-control"];function di(n,i){if(n&1){let r=M();c(0,"div",14),b("click",function(){let t=P(r).$implicit,o=u(2);return S(o.toggleSort(t))}),d(1),l(2,"translate"),c(3,"span",15),d(4),p()()}if(n&2){let r=i.$implicit,e=u().bkdLet,t=u();g("className",r),s(),x(" ",m(2,3,"presence-control.groups.list.header."+r)," "),s(3),w(t.getSortDirectionCharacter(e.sortCriteria,r))}}function mi(n,i){n&1&&W(0,"bkd-spinner",23)}function ui(n,i){if(n&1){let r=M();Z(0),c(1,"div",17)(2,"div",18)(3,"input",19,1),l(5,"async"),b("change",function(){let t=P(r).$implicit,o=u(3);return S(o.selectionService.toggle(t))}),p()(),c(6,"div",20),d(7),p(),c(8,"div",21)(9,"span"),d(10),p(),v(11,mi,1,0,"bkd-spinner",22),l(12,"async"),p()(),ee()}if(n&2){let r=i.$implicit,e=u(3);s(3),g("checked",m(5,4,e.selectionService.isSelected$(r))),s(4),x(" ",r.name," "),s(3),w(r.group?r.group:""),s(),g("ngIf",m(12,6,e.groupService.loading$))}}function gi(n,i){if(n&1&&(Z(0),v(1,ui,13,8,"ng-container",16),ee()),n&2){let r=u().bkdLet;s(),g("ngForOf",r.sortedEntries)}}function fi(n,i){n&1&&W(0,"bkd-spinner")}function hi(n,i){if(n&1){let r=M();c(0,"div"),W(1,"bkd-backlink",3),l(2,"async"),c(3,"h1"),d(4),l(5,"translate"),p(),c(6,"div",4)(7,"div",5)(8,"span",6),d(9),l(10,"translate"),p(),c(11,"button",7),b("click",function(){P(r);let t=u();return S(t.selectGroup())}),d(12),l(13,"translate"),l(14,"translate"),p()(),c(15,"a",8),b("click",function(){P(r);let t=u();return S(t.assignGroup())}),c(16,"i",9),d(17,"edit"),p()()(),c(18,"div",10)(19,"div",11),v(20,di,5,5,"div",12),p(),v(21,gi,2,1,"ng-container",13),l(22,"async"),v(23,fi,1,0,"ng-template",null,0,_e),p()()}if(n&2){let r=i.bkdLet,e=te(24),t=u();s(),g("link",Ot(22,li))("params",m(2,10,t.backlinkQueryParams$)),s(3),w(m(5,12,"presence-control.groups.title")),s(5),w(m(10,14,"presence-control.groups.show")),s(3),x(" ",r.group?m(13,16,"presence-control.groups.group")+" "+r.group:m(14,18,"presence-control.groups.all")," "),s(3),K("disabled",r.selection.length===0),s(5),g("ngForOf",t.primarySortKeys),s(),g("ngIf",m(22,20,t.state.loading$)===!1)("ngIfElse",e)}}var Gn=(()=>{let i=class i{constructor(e,t,o,a,h,C,k,V,Me){this.route=e,this.state=t,this.selectionService=o,this.groupService=a,this.userSettings=h,this.subscriptionDetailService=C,this.toastService=k,this.translate=V,this.modalService=Me,this.primarySortKeys=["name","group"],this.backlinkQueryParams$=this.route.queryParams.pipe(f(({returnparams:ke})=>ke),f(an)),this.eventIds$=this.state.selectedLesson$.pipe(f(ke=>ke?.getEventIds()||[])),this.sortCriteriaSubject$=new fe({primarySortKey:"name",ascending:!1}),this.sortCriteria$=this.sortCriteriaSubject$.asObservable(),this.sortedEntries$=O([this.groupService.getSubscriptionDetailsForStudents(),this.sortCriteria$]).pipe(f(ae(kn))),this.selected=[]}ngOnInit(){this.selectionService.selection$.subscribe(e=>this.selected=e)}selectGroup(){this.openGroupModal(Be.Select,this.selectCallback.bind(this))}assignGroup(){this.openGroupModal(Be.Assign,this.assignCallback.bind(this))}openGroupModal(e,t){O([this.groupService.getSubscriptionDetailsDefinitions(),this.groupService.group$]).pipe(D(1)).subscribe(([o,a])=>{let h=this.modalService.open($n);h.componentInstance.dialogMode=e,h.componentInstance.subscriptionDetailsDefinitions=o,h.componentInstance.group=a,h.result.then(C=>{t(C)},()=>{})})}selectCallback(e){O([this.eventIds$,this.userSettings.getPresenceControlGroupView()]).pipe(D(1),T(([t,o])=>this.userSettings.savePresenceControlGroupView(Mn(e.id,t,o))),f(()=>e.id)).subscribe(t=>this.groupService.selectGroup(t))}assignCallback(e){$e(this.selected.map(t=>this.subscriptionDetailService.update(e.id,t.detail))).subscribe(this.onSaveSuccess.bind(this))}onSaveSuccess(){this.groupService.reloadSubscriptionDetails(),this.selectionService.clear(),this.toastService.success(this.translate.instant("presence-control.groups.notifications.save-success"))}getSortDirectionCharacter(e,t){return e.primarySortKey!==t?"":e.ascending?"\u2193":"\u2191"}toggleSort(e){this.sortCriteriaSubject$.pipe(D(1)).subscribe(t=>{t.primarySortKey===e?this.sortCriteriaSubject$.next({primarySortKey:e,ascending:!t.ascending}):this.sortCriteriaSubject$.next({primarySortKey:e,ascending:e==="name"})})}};i.\u0275fac=function(t){return new(t||i)(_(Ge),_(G),_(Je),_(de),_(we),_(Ze),_(Pe),_(Q),_(Ie))},i.\u0275cmp=L({type:i,selectors:[["bkd-presence-control-group"]],standalone:!0,features:[he([Je]),E],decls:5,vars:14,consts:[["loading",""],["checkbox",""],[4,"bkdLet"],[3,"link","params"],[1,"group-header","mb-2","d-flex","justify-content-between"],[1,"d-flex","align-items-baseline"],[1,"ps-3"],["type","button",1,"show","btn","btn-link",3,"click"],["aria-label","edit",1,"btn","btn-primary","btn-icon","me-2",3,"click"],[1,"material-icons"],[1,"group-list"],[1,"group-list-header"],[3,"className","click",4,"ngFor","ngForOf"],[4,"ngIf","ngIfElse"],[3,"click","className"],[1,"sort-direction"],[4,"ngFor","ngForOf"],[1,"group-list-entry"],[1,"checkbox"],["type","checkbox",1,"form-check-input",3,"change","checked"],[1,"name","pe-2"],[1,"group","d-flex","justify-content-between"],["class","inline small",4,"ngIf"],[1,"inline","small"]],template:function(t,o){t&1&&(v(0,hi,25,23,"div",2),l(1,"async"),l(2,"async"),l(3,"async"),l(4,"async")),t&2&&g("bkdLet",Lt(9,pi,m(1,1,o.sortCriteria$),m(2,3,o.sortedEntries$),m(3,5,o.selectionService.selection$),m(4,7,o.groupService.group$)))},dependencies:[ce,hn,N,ie,xe,oe,j,F],styles:['[_nghost-%COMP%]{display:block}.group-header[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{color:#000;font-weight:300;text-decoration:underline;padding-left:.5rem}.group-header[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover{text-decoration-color:#ea161f}.group-list-header[_ngcontent-%COMP%]{cursor:pointer;padding:1rem;display:grid;grid-template-areas:"name group";grid-template-columns:3fr 2fr;border-top:1px solid #dee2e6;border-bottom:2px solid #dee2e6}.group-list-entry[_ngcontent-%COMP%]{padding:1rem;border-bottom:1px solid #dee2e6;display:grid;grid-template-areas:"checkbox name group";grid-template-columns:min-content 3fr 2fr}.checkbox[_ngcontent-%COMP%]{grid-area:checkbox;margin:0;padding:.3rem 1rem 0 0}.checkbox[_ngcontent-%COMP%] input.form-check-input[_ngcontent-%COMP%]{position:static!important;margin:0!important;display:block}.name[_ngcontent-%COMP%]{grid-area:name;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.group[_ngcontent-%COMP%]{grid-area:group}@media (max-width: 750px){.group-list[_ngcontent-%COMP%]{padding-left:0;padding-right:0}.group-list-header[_ngcontent-%COMP%]{grid-template-columns:3fr 1fr}.group-list-entry[_ngcontent-%COMP%]{grid-template-columns:min-content 3fr 1fr}}'],changeDetection:0});let n=i;return n})();function _i(n,i){if(n&1){let r=M();c(0,"div",3)(1,"input",4),b("change",function(){let t=P(r).$implicit;return S(t.selected=!t.selected)}),p(),c(2,"label",5)(3,"i"),d(4),p(),c(5,"div",6),d(6),l(7,"date"),l(8,"date"),p()()()}if(n&2){let r=i.$implicit,e=i.index,t=u();s(),z("id","lesson-presence-",e,""),g("checked",r.selected),s(),K("fw-bold",t.isCurrentLesson(r)),z("for","lesson-presence-",e,""),s(),Re("",r.entry.presenceCategory," material-icons pe-2"),s(),w(r.entry.presenceCategoryIcon),s(2),Mt(" ",U(7,14,r.entry.lessonPresence.LessonDateTimeFrom,"HH:mm"),"\u2013",U(8,17,r.entry.lessonPresence.LessonDateTimeTo,"HH:mm")," ",r.entry.lessonPresence.EventDesignation," ")}}function Ci(n,i){if(n&1){let r=M();c(0,"div",7)(1,"button",8),b("click",function(){P(r);let t=u();return S(t.activeModal.close())}),d(2),l(3,"translate"),p(),c(4,"button",9),b("click",function(){let t=P(r).bkdLet,o=u();return S(o.activeModal.close(t))}),d(5),l(6,"translate"),p()()}if(n&2){let r=i.bkdLet;s(2),x(" ",m(3,3,"presence-control.block-lesson.cancel")," "),s(2),g("disabled",r.length===0),s(),x(" ",m(6,5,"presence-control.block-lesson.save")," ")}}var Un=(()=>{let i=class i{constructor(e){this.activeModal=e,this.blockLessonOptions=[]}ngOnInit(){this.blockLessonOptions=this.buildLessonPresenceOptions()}getSelectedEntries(){return this.blockLessonOptions.filter(({selected:e})=>e).map(({entry:e})=>e)}isCurrentLesson(e){return wn(e.entry.lessonPresence.LessonDateTimeFrom,this.entry.lessonPresence.LessonDateTimeFrom)}buildLessonPresenceOptions(){return this.blockPresenceControlEntries.map(e=>({entry:e,selected:this.entry.confirmationState===e.confirmationState}))}};i.\u0275fac=function(t){return new(t||i)(_(se))},i.\u0275cmp=L({type:i,selectors:[["bkd-presence-control-block-lesson-component"]],inputs:{entry:"entry",blockPresenceControlEntries:"blockPresenceControlEntries"},standalone:!0,features:[E],decls:7,vars:5,consts:[[1,"modal-body"],["class","form-check",4,"ngFor","ngForOf"],["class","modal-footer",4,"bkdLet"],[1,"form-check"],["type","checkbox",1,"form-check-input",3,"change","id","checked"],[1,"form-check-label","d-flex",3,"for"],[1,"d-block","text-truncate"],[1,"modal-footer"],["type","button",1,"btn","btn-outline-secondary",3,"click"],["type","button",1,"btn","btn-primary",3,"click","disabled"]],template:function(t,o){t&1&&(c(0,"div",0)(1,"p"),d(2),l(3,"translate"),p(),c(4,"form"),v(5,_i,9,20,"div",1),p()(),v(6,Ci,7,7,"div",2)),t&2&&(s(2),x(" ",m(3,3,"presence-control.block-lesson.text")," "),s(3),g("ngForOf",o.blockLessonOptions),s(),g("bkdLet",o.getSelectedEntries()))},dependencies:[re,ye,ve,be,N,ce,Ce,j,F],styles:[".checkbox[_ngcontent-%COMP%] input.form-check-input[_ngcontent-%COMP%]{position:static!important;margin:0!important;display:block}.absent[_ngcontent-%COMP%]{color:#ea161f}.present[_ngcontent-%COMP%]{color:#3d8608}.unapproved[_ngcontent-%COMP%]{color:#ffa814}"]});let n=i;return n})();var vi=30;function gt(n){return`blockLesson${n.lessonPresence.Id}`}var et=(()=>{let i=class i{constructor(e,t,o,a){this.state=e,this.lessonPresencesService=t,this.loadingService=o,this.settings=a}getBlockLessonPresenceControlEntries(e){return O([this.state.lessons$.pipe(D(1)),this.loadChangeableLessonPresences(e),this.state.presenceTypes$.pipe(D(1)),this.state.absenceConfirmationStates$.pipe(D(1)),this.state.otherTeachersAbsences$.pipe(D(1))]).pipe(f(([t,o,a,h,C])=>this.filterBlockLessonPresences(e,o).map(k=>tn(t.find(V=>V.id===k.LessonRef.Id.toString()),k,a,h,C))))}filterBlockLessonPresences(e,t){return[...t].sort((o,a)=>o.LessonDateTimeFrom>a.LessonDateTimeFrom?1:-1).reduce((o,a)=>{let h=o[o.length-1];return this.isWithinBlockTime(a,h)?(o.push(a),o):o.find(C=>C.Id===e.lessonPresence.Id)?o:[a]},[])}isWithinBlockTime(e,t){return t?e.LessonDateTimeFrom.getTime()-t.LessonDateTimeTo.getTime()<=vi*60*1e3:!0}loadChangeableLessonPresences(e){return O([this.loadLessonPresences(e),this.state.presenceTypes$.pipe(D(1))]).pipe(f(([t,o])=>t.filter(a=>Zt(a,o.find(h=>h.Id===a.TypeRef.Id)||null,this.settings))))}loadLessonPresences(e){return this.loadingService.load(this.lessonPresencesService.getListByDateStudentClass(e.lessonPresence.LessonDateTimeFrom,e.lessonPresence.StudentRef.Id,e.lessonPresence.StudyClassRef.Id??void 0).pipe(f(t=>t.filter(o=>o.TeacherInformation===e.lessonPresence.TeacherInformation))),gt(e))}};i.\u0275fac=function(t){return new(t||i)(y(G),y(ze),y(pe),y(H))},i.\u0275prov=R({token:i,factory:i.\u0275fac});let n=i;return n})();function yi(n,i){if(n&1&&(c(0,"div"),d(1),l(2,"date"),l(3,"date"),l(4,"addSpace"),p()),n&2){let r=i.$implicit;s(),kt(" ",U(2,5,r.LessonRef.From,"HH:mm"),"\u2013",U(3,8,r.LessonRef.To,"HH:mm")," ",r.LessonRef.EventDesignation,"",U(4,11,":",":")," ",r.Type," ")}}var Hn=(()=>{let i=class i{constructor(e){this.activeModal=e}};i.\u0275fac=function(t){return new(t||i)(_(se))},i.\u0275cmp=L({type:i,selectors:[["bkd-presence-control-preceding-absence"]],inputs:{precedingAbsences:"precedingAbsences"},standalone:!0,features:[E],decls:9,vars:7,consts:[[1,"modal-body"],[4,"ngFor","ngForOf"],[1,"modal-footer"],["type","button",1,"btn","btn-outline-secondary",3,"click"]],template:function(t,o){t&1&&(c(0,"div",0)(1,"p"),d(2),l(3,"translate"),p(),v(4,yi,5,14,"div",1),p(),c(5,"div",2)(6,"button",3),b("click",function(){return o.activeModal.dismiss()}),d(7),l(8,"translate"),p()()),t&2&&(s(2),x(" ",m(3,3,"presence-control.preceding-absence.text")," "),s(2),g("ngForOf",o.precedingAbsences),s(3),x(" ",m(8,5,"presence-control.preceding-absence.cancel")," "))},dependencies:[N,Ce,j,F,un]});let n=i;return n})();var Pi=n=>["student",n,"absences"],Si=n=>["/presence-control/student",n,"absences"];function xi(n,i){if(n&1&&(W(0,"bkd-avatar",9),l(1,"async")),n&2){let r=u();g("studentId",m(1,3,r.studentId$))("link",ne(5,Si,r.entry.lessonPresence.StudentRef.Id.toString()))("linkParams",r.profileReturnParams)}}function Ii(n,i){if(n&1&&(c(0,"span"),d(1),p()),n&2){let r=u(2);s(),w(r.entry.presenceType==null?null:r.entry.presenceType.Designation)}}function wi(n,i){if(n&1){let r=M();c(0,"button",10),b("click",function(){P(r);let t=u();return S(t.updatePresenceType(t.entry))}),v(1,Ii,2,1,"span",11),p()}if(n&2){let r=u();s(),g("ngIf",!(r.entry.presenceType!=null&&r.entry.presenceType.IsIncident))}}function Mi(n,i){n&1&&W(0,"bkd-spinner",16)}function ki(n,i){if(n&1){let r=M();c(0,"button",12),b("click",function(){P(r);let t=u();return S(t.updatePresenceType(t.entry))}),c(1,"div",13)(2,"i",14),d(3),p(),v(4,Mi,1,0,"bkd-spinner",15),p()()}if(n&2){let r=i.bkdLet,e=u();g("disabled",r),s(2),K("invisible",r),s(),w(e.entry.presenceCategoryIcon),s(),g("ngIf",r)}}function Oi(n,i){if(n&1){let r=M();c(0,"button",17),b("click",function(){P(r);let t=u();return S(t.showPrecedingAbsences(t.entry))}),c(1,"i",18),d(2,"info"),p()()}}function Ti(n,i){if(n&1&&(c(0,"span",19),d(1),p()),n&2){let r=u();s(),x(" ",r.entry.lessonPresence.StudyClassNumber," ")}}function $i(n,i){if(n&1){let r=M();c(0,"a",20),b("click",function(){P(r);let t=u();return S(t.updateIncident(t.entry))}),c(1,"i",14),d(2,"edit"),p(),c(3,"span"),d(4),l(5,"translate"),p()()}if(n&2){let r=u();s(4),w(m(5,1,(r.entry.presenceType==null?null:r.entry.presenceType.IsIncident)&&(r.entry.presenceType==null?null:r.entry.presenceType.Designation)||"presence-control.entry.incident"))}}var qn=(()=>{let i=class i{get classNames(){return[this.entry.presenceCategory,this.viewMode].join(" ")}constructor(e,t,o,a){this.toastService=e,this.translate=t,this.modalService=o,this.loadingService=a,this.hasUnconfirmedAbsences=!1,this.showClassName=!1,this.togglePresenceType=new Y,this.changeIncident=new Y,this.entry$=new Te(1),this.studentId$=this.entry$.pipe(f(({lessonPresence:h})=>h.StudentRef.Id)),this.loading$=this.entry$.pipe(T(h=>this.loadingService.loading(gt(h))))}ngOnChanges(e){e.entry&&this.entry$.next(e.entry.currentValue)}get isListViewMode(){return this.viewMode===me.List}updatePresenceType(e){e.canChangePresenceType?this.togglePresenceType.emit(e):this.toastService.warning(this.translate.instant("presence-control.entry.update-warning"))}updateIncident(e){e.canChangeIncident&&this.changeIncident.emit(e)}showPrecedingAbsences(e){let t=this.modalService.open(Hn);t.componentInstance.precedingAbsences=e.precedingAbsences}};i.\u0275fac=function(t){return new(t||i)(_(Pe),_(Q),_(Ie),_(pe))},i.\u0275cmp=L({type:i,selectors:[["bkd-presence-control-entry"]],hostVars:2,hostBindings:function(t,o){t&2&&Pt(o.classNames)},inputs:{entry:"entry",hasUnconfirmedAbsences:"hasUnconfirmedAbsences",viewMode:"viewMode",showClassName:"showClassName",profileReturnParams:"profileReturnParams"},outputs:{togglePresenceType:"togglePresenceType",changeIncident:"changeIncident"},standalone:!0,features:[bt,E],decls:13,vars:16,consts:[["class","avatar large",3,"studentId","link","linkParams",4,"ngIf"],["type","button","class","presence-category designation btn btn-link",3,"click",4,"ngIf"],["type","button","class","presence-category status btn btn-link",3,"disabled","click",4,"bkdLet"],["type","button","class","previously-absent d-flex btn btn-link",3,"click",4,"ngIf"],[1,"student-info",3,"routerLink","queryParams"],[1,"student-name","text-truncate"],["class","study-class text-truncate",4,"ngIf"],[1,"unconfirmed-absences"],["class","incident btn btn-link",3,"click",4,"ngIf"],[1,"avatar","large",3,"studentId","link","linkParams"],["type","button",1,"presence-category","designation","btn","btn-link",3,"click"],[4,"ngIf"],["type","button",1,"presence-category","status","btn","btn-link",3,"click","disabled"],[1,"position-relative"],[1,"material-icons"],["class","inline small",4,"ngIf"],[1,"inline","small"],["type","button",1,"previously-absent","d-flex","btn","btn-link",3,"click"],[1,"material-icons-outlined"],[1,"study-class","text-truncate"],[1,"incident","btn","btn-link",3,"click"]],template:function(t,o){t&1&&(v(0,xi,2,7,"bkd-avatar",0)(1,wi,2,1,"button",1)(2,ki,5,5,"button",2),l(3,"async"),v(4,Oi,3,0,"button",3),c(5,"a",4)(6,"span",5),d(7),p(),v(8,Ti,2,1,"span",6),c(9,"span",7),d(10),l(11,"translate"),p()(),v(12,$i,6,3,"a",8)),t&2&&(g("ngIf",!o.isListViewMode),s(),g("ngIf",o.entry.showDesignation),s(),g("bkdLet",m(3,10,o.loading$)),s(2),g("ngIf",(o.entry.precedingAbsences==null?null:o.entry.precedingAbsences.length)||!1),s(),g("routerLink",ne(14,Pi,o.entry.lessonPresence.StudentRef.Id))("queryParams",o.profileReturnParams),s(2),w(o.entry.lessonPresence.StudentFullName),s(),g("ngIf",o.isListViewMode&&o.showClassName),s(2),x(" ",o.hasUnconfirmedAbsences?m(11,12,"presence-control.entry.unconfirmed-absences"):""," "),s(2),g("ngIf",o.entry.canChangeIncident))},dependencies:[ie,fn,ce,xe,Ue,oe,j,F],styles:['[_nghost-%COMP%]{padding:2rem 1rem;background-color:#fff;display:grid;grid-template-areas:"avatar status designation previously-absent" "avatar student-info student-info student-info" "avatar incident incident incident";grid-template-columns:min-content min-content 3fr min-content}[_nghost-%COMP%] > *[_ngcontent-%COMP%]{align-self:center}.presence-category[_ngcontent-%COMP%]{text-decoration:none}.presence-category[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{top:.1875rem}.absent[_nghost-%COMP%] .presence-category[_ngcontent-%COMP%]{color:#ea161f}.present[_nghost-%COMP%] .presence-category[_ngcontent-%COMP%]{color:#3d8608}.unapproved[_nghost-%COMP%] .presence-category[_ngcontent-%COMP%]{color:#ffa814}.presence-category[_ngcontent-%COMP%] bkd-spinner[_ngcontent-%COMP%]{color:#000;position:absolute;top:4px;left:5px}.designation[_ngcontent-%COMP%], .student-info[_ngcontent-%COMP%], a.incident[_ngcontent-%COMP%], .incident[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.avatar[_ngcontent-%COMP%]{grid-area:avatar;margin-right:1.5rem}.status[_ngcontent-%COMP%]{grid-area:status}.status[_ngcontent-%COMP%] .material-icons[_ngcontent-%COMP%]{font-size:2rem}.designation[_ngcontent-%COMP%]{grid-area:designation;text-align:left;line-height:2.375rem}.previously-absent[_ngcontent-%COMP%]{grid-area:previously-absent;text-decoration:none;color:#00000080;justify-self:end}.student-info[_ngcontent-%COMP%]{grid-area:student-info;display:flex;flex-direction:column;text-decoration:none}.student-info[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:first-child{text-decoration:underline}.student-info[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:first-child:hover{text-decoration-color:#ea161f}.unconfirmed-absences[_ngcontent-%COMP%]{color:#ea161f;font-size:.875rem;line-height:1}.study-class[_ngcontent-%COMP%]{font-size:.875rem;line-height:1}.incident[_ngcontent-%COMP%]{color:#00000080;padding-right:1.5rem;grid-area:incident;display:flex;text-decoration:none}.incident[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{text-decoration:underline}.incident[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:hover{text-decoration-color:#ea161f}.incident[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{margin-right:.3em}.grid[_nghost-%COMP%] .status[_ngcontent-%COMP%], .grid[_nghost-%COMP%] .designation[_ngcontent-%COMP%]{align-self:start;margin-left:-1.5rem;margin-top:-.375rem}.grid[_nghost-%COMP%] .incident[_ngcontent-%COMP%]{align-self:end;margin-left:-1.5rem;margin-bottom:-.375rem}.grid[_nghost-%COMP%] .previously-absent[_ngcontent-%COMP%]{padding-right:0;align-self:start}.grid[_nghost-%COMP%] .unconfirmed-absences[_ngcontent-%COMP%]{height:.875rem}.list[_nghost-%COMP%]{grid-template-areas:"student-info status incidentordesignation previously-absent";grid-template-columns:3fr min-content 4fr 3em;padding:.5rem 1rem}.list[_nghost-%COMP%] .status[_ngcontent-%COMP%]{justify-self:start}.list[_nghost-%COMP%] .student-name[_ngcontent-%COMP%]{line-height:1;margin-bottom:.5rem}.list[_nghost-%COMP%] .incident[_ngcontent-%COMP%], .list[_nghost-%COMP%] .designation[_ngcontent-%COMP%]{grid-area:incidentordesignation}.list[_nghost-%COMP%] .previously-absent[_ngcontent-%COMP%]{padding-right:0}@media (max-width: 750px){.list[_nghost-%COMP%]{grid-template-areas:"student-info student-info student-info previously-absent" "status incidentordesignation incidentordesignation incidentordesignation";grid-template-columns:min-content 1fr 1fr min-content;row-gap:1rem}.list[_nghost-%COMP%] .status[_ngcontent-%COMP%]{padding-left:0;padding-right:0}.list[_nghost-%COMP%] .student-name[_ngcontent-%COMP%]{margin-top:.5rem}.list[_nghost-%COMP%] .previously-absent[_ngcontent-%COMP%]{align-self:start}}']});let n=i;return n})();var Li=(n,i)=>({"btn-link":n,"btn-danger":i}),Ei=n=>["groups",n],Di=n=>({returnparams:n});function Bi(n,i){if(n&1){let r=M();c(0,"div",22),b("click",function(){P(r);let t=u();return S(t.lessonDropdown==null?null:t.lessonDropdown.toggle())}),d(1),l(2,"date"),c(3,"span",23),d(4),l(5,"date"),p()()}if(n&2){let r=u();s(),x(" ",U(2,2,r.selectedLesson.LessonDateTimeFrom,"HH:mm"),"\u2013"),s(3),w(U(5,5,r.selectedLesson.LessonDateTimeTo,"HH:mm"))}}function Fi(n,i){if(n&1){let r=M();c(0,"div",29),b("click",function(){let t=P(r).$implicit,o=u(2);return S(o.selectLessonChange.emit(t))}),c(1,"div",30)(2,"div"),d(3),l(4,"date"),l(5,"date"),p(),c(6,"div",26),d(7),p(),c(8,"div",26),d(9),p()()()}if(n&2){let r=i.$implicit,e=u(2);K("active",r.id===e.selectedLesson.id),s(3),wt(" ",U(4,6,r.LessonDateTimeFrom,"HH:mm"),"\u2013",U(5,9,r.LessonDateTimeTo,"HH:mm")," "),s(4),w(r.eventDesignations),s(2),w(r.studyClassNumbers)}}function ji(n,i){if(n&1&&(c(0,"div",24)(1,"div",25)(2,"div",26),d(3),p(),c(4,"div",26),d(5),p()(),c(6,"div",27),v(7,Fi,10,12,"div",28),p()()),n&2){let r=u();s(3),w(r.selectedLesson.eventDesignations),s(2),w(r.selectedLesson.studyClassNumbers),s(2),g("ngForOf",r.lessons)}}function Vi(n,i){if(n&1){let r=M();c(0,"bkd-caret",31),b("click",function(){P(r);let t=u();return S(t.lessonDropdown==null?null:t.lessonDropdown.toggle())}),p()}if(n&2){let r=u();g("expanded",(r.lessonDropdown==null?null:r.lessonDropdown.isOpen())||!1)}}function Ai(n,i){if(n&1&&(c(0,"a",32),l(1,"async"),l(2,"async"),l(3,"async"),c(4,"i",33),d(5,"groups"),p()()),n&2){let r=u();g("ngClass",Tt(9,Li,m(1,3,r.isGroupSelected$)===!1,m(2,5,r.isGroupSelected$)))("routerLink",ne(12,Ei,r.selectedLesson.id))("queryParams",ne(14,Di,m(3,7,r.state.queryParamsString$)))}}function Ri(n,i){if(n&1){let r=M();c(0,"button",34),b("click",function(){let t=P(r).$implicit,o=u();return S(o.viewModeChange.emit(t.viewMode))}),c(1,"i",33),d(2),p()()}if(n&2){let r=i.$implicit,e=u();K("btn-outline-secondary",r.viewMode===e.viewMode)("btn-link",r.viewMode!==e.viewMode)("active",r.viewMode===e.viewMode),g("disabled",!e.selectedLesson),s(2),w(r.icon)}}var Ni=Ee.prototype._positionMenu;Ee.prototype._positionMenu=function(...i){let r=Ni.apply(this,i);if(this._anchor.nativeElement.id==="lesson-dropdown"){let e=this._bodyContainer||this._menu.nativeElement,t=e.style.transform?.match(/translate\(([0-9-.]+)px, ([0-9-.]+)px\)/);t&&parseFloat(t[1])<0&&(e.style.transform=`translate(0px, ${t[2]}px)`)}return r};var Wn=(()=>{let i=class i{constructor(e,t,o){this.state=e,this.groupService=t,this.presentCount=null,this.absentCount=null,this.unapprovedCount=null,this.absentPrecedingCount=null,this.search="",this.selectLessonChange=new Y,this.selectDateChange=new Y,this.searchChange=new Y,this.viewModeChange=new Y,this.viewModeOptions=[{viewMode:me.List,icon:"list"},{viewMode:me.Grid,icon:"view_module"}],this.isGroupSelected$=this.groupService.group$.pipe(f(zt)),o.popperOptions=a=>ge(ue({},a),{modifiers:a.modifiers?.map(h=>(h.name==="offset"&&(h.options={offset:({placement:C,reference:k,popper:V})=>C==="bottom-start"?[(window.innerWidth-V.width)/2-k.x,0]:[]}),h))})}};i.\u0275fac=function(t){return new(t||i)(_(G),_(de),_(He))},i.\u0275cmp=L({type:i,selectors:[["bkd-presence-control-header"]],viewQuery:function(t,o){if(t&1&&St(Ee,5),t&2){let a;xt(a=It())&&(o.lessonDropdown=a.first)}},inputs:{selectedLesson:"selectedLesson",lessons:"lessons",presentCount:"presentCount",absentCount:"absentCount",unapprovedCount:"unapprovedCount",absentPrecedingCount:"absentPrecedingCount",viewMode:"viewMode",selectDate:"selectDate",search:"search"},outputs:{selectLessonChange:"selectLessonChange",selectDateChange:"selectDateChange",searchChange:"searchChange",viewModeChange:"viewModeChange"},standalone:!0,features:[he([He,{provide:Rt,useClass:Ut},{provide:Nt,useClass:Sn}]),E],decls:40,vars:20,consts:[["d","ngbDatepicker"],[1,"navigation"],[1,"lesson-date"],["type","button",1,"btn","btn-link",3,"click"],[1,"material-icons"],["positionTarget",".lesson-date-input","ngbDatepicker","","placement","bottom-start",1,"lesson-date-input",3,"ngModelChange","ngModel"],["class","lesson-time",3,"click",4,"ngIf"],["ngbDropdown","","class","lesson-description","container","body","display","dynamic","placement","bottom",4,"ngIf"],["class","dropdown-caret",3,"expanded","click",4,"ngIf"],[1,"states"],[1,"state","present"],[1,"count"],[1,"state","absent"],[1,"state","unapproved"],[1,"state","previously-absent"],[1,"material-icons-outlined"],[1,"search-and-views"],[1,"search",3,"valueChange","value","disabled","placeholder","label"],[1,"group-and-views","d-flex","align-items-center"],["type","button","class","group btn me-2 me-sm-4",3,"ngClass","routerLink","queryParams",4,"ngIf"],[1,"views"],["type","button","class","view btn btn-primary btn-icon",3,"disabled","btn-outline-secondary","btn-link","active","click",4,"ngFor","ngForOf"],[1,"lesson-time",3,"click"],[1,"lesson-time-to"],["ngbDropdown","","container","body","display","dynamic","placement","bottom",1,"lesson-description"],["id","lesson-dropdown","ngbDropdownToggle",""],[1,"text-truncate"],["ngbDropdownMenu","","aria-labelledby","lesson-dropdown"],["ngbDropdownItem","",3,"active","click",4,"ngFor","ngForOf"],["ngbDropdownItem","",3,"click"],[1,"lesson-entry"],[1,"dropdown-caret",3,"click","expanded"],["type","button",1,"group","btn","me-2","me-sm-4",3,"ngClass","routerLink","queryParams"],[1,"material-icons","align-middle"],["type","button",1,"view","btn","btn-primary","btn-icon",3,"click","disabled"]],template:function(t,o){if(t&1){let a=M();c(0,"div",1)(1,"div",2)(2,"button",3),b("click",function(){P(a);let C=te(6);return S(C.toggle())}),c(3,"i",4),d(4,"calendar_today"),p()(),c(5,"input",5,0),b("ngModelChange",function(C){return P(a),S(o.selectDateChange.emit(C))}),p()(),v(7,Bi,6,8,"div",6)(8,ji,8,3,"div",7)(9,Vi,1,1,"bkd-caret",8),p(),c(10,"div",9)(11,"div",10)(12,"i",4),d(13,"check_circle"),p(),c(14,"span",11),d(15),p()(),c(16,"div",12)(17,"i",4),d(18,"cancel"),p(),c(19,"span",11),d(20),p()(),c(21,"div",13)(22,"i",4),d(23,"help"),p(),c(24,"span",11),d(25),p()(),c(26,"div",14)(27,"i",15),d(28,"info"),p(),c(29,"span",11),d(30),p()()(),c(31,"div",16)(32,"bkd-resettable-input",17),l(33,"translate"),l(34,"translate"),b("valueChange",function(C){return P(a),S(o.searchChange.emit(C))}),p(),c(35,"div",18),v(36,Ai,6,16,"a",19),l(37,"async"),c(38,"div",20),v(39,Ri,3,8,"button",21),p()()()}t&2&&(s(5),g("ngModel",o.selectDate),s(2),g("ngIf",o.selectedLesson),s(),g("ngIf",o.selectedLesson),s(),g("ngIf",o.lessons.length>0),s(6),w(o.presentCount!==null?o.presentCount:"?"),s(5),w(o.absentCount!==null?o.absentCount:"?"),s(5),w(o.unapprovedCount!==null?o.unapprovedCount:"?"),s(5),w(o.absentPrecedingCount!==null?o.absentPrecedingCount:"?"),s(2),g("value",o.search)("disabled",!o.selectedLesson)("placeholder",m(33,14,"presence-control.header.search-by-name"))("label",m(34,16,"presence-control.header.search")),s(4),g("ngIf",m(37,18,o.selectedLesson&&o.state.groupsAvailability$)),s(3),g("ngForOf",o.viewModeOptions))},dependencies:[Gt,re,jt,Vt,At,ie,Ee,Wt,qt,N,Ht,cn,xn,Dt,Ue,oe,Ce,j,F],styles:['[_nghost-%COMP%]{display:flex;flex-direction:column;padding:.75rem 0}.navigation[_ngcontent-%COMP%]{display:grid;grid-template-areas:". date time dropdown-caret" ". description description dropdown-caret";grid-template-columns:1fr auto auto 1fr;align-items:center}.lesson-date[_ngcontent-%COMP%]{grid-area:date;justify-self:end;display:flex;align-items:center;justify-content:flex-end}.lesson-date[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{padding:0 .5ch 0 0}.lesson-date[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#000;position:relative}.lesson-date-input[_ngcontent-%COMP%]{font-weight:600;background:transparent;border:none;width:11ch}.lesson-time[_ngcontent-%COMP%]{grid-area:time;cursor:pointer}.lesson-description[_ngcontent-%COMP%]{grid-area:description;overflow:hidden;text-align:center;cursor:pointer}.dropdown-toggle[_ngcontent-%COMP%]{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.dropdown-toggle[_ngcontent-%COMP%]:after{display:none}.dropdown-caret[_ngcontent-%COMP%]{grid-area:dropdown-caret;line-height:100%;text-align:left;color:#000}.dropdown-menu[_ngcontent-%COMP%]{width:50ch;padding:0;box-shadow:2px 2px 3px -1px #0003}@media (max-width: 800px){.dropdown-menu[_ngcontent-%COMP%]{width:100vw}}.dropdown-item[_ngcontent-%COMP%]{padding:1rem;border-bottom:1px solid #dee2e6}.states[_ngcontent-%COMP%]{margin:.75rem 0;display:flex;justify-content:center}.state[_ngcontent-%COMP%]{margin-right:7%;display:flex}.state[_ngcontent-%COMP%]:last-child{margin-right:0}@media (min-width: 1000px){.state[_ngcontent-%COMP%]{margin-right:4rem}}.state.present[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#3d8608}.state.absent[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#ea161f}.state.unapproved[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#ffa814}.state.previously-absent[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#00000080}.state[_ngcontent-%COMP%] .count[_ngcontent-%COMP%]{margin-left:.3em;margin-top:1px}.search-and-views[_ngcontent-%COMP%]{padding-top:.75rem;display:flex;justify-content:space-between;border-top:1px solid #dee2e6}.search[_ngcontent-%COMP%]{flex:auto;max-width:300px;margin-right:1rem}.views[_ngcontent-%COMP%]{display:flex}.view[_ngcontent-%COMP%]{color:#4e4e4ef2;background-color:#fff}.view.active[_ngcontent-%COMP%]{color:#fff;background-color:#4e4e4ef2;border:none}.group[_ngcontent-%COMP%], .view[_ngcontent-%COMP%]{text-decoration:none;padding-left:0;padding-right:0;aspect-ratio:1/1;width:calc(.75rem + 2 * var(--bs-border-width) + 1.625rem);border-radius:50%}.group.btn-link[_ngcontent-%COMP%]{color:#000}@media (max-width: 380px){[_nghost-%COMP%]{padding-left:.5rem;padding-right:.5rem}#search-addon[_ngcontent-%COMP%]{padding-left:.5rem;padding-right:.5rem}}@media (max-width: 365px){.lesson-time[_ngcontent-%COMP%]{line-height:1}.lesson-time-to[_ngcontent-%COMP%]{display:block}.dropdown-caret[_ngcontent-%COMP%]{padding-left:0}}']});let n=i;return n})();function Gi(n,i){if(n&1){let r=M();c(0,"div",5)(1,"input",6),b("change",function(){let t=P(r).$implicit,o=u();return S(o.onSelectionChange(t))}),p(),c(2,"label",7),d(3),p()()}if(n&2){let r=i.$implicit,e=i.index,t=u();s(),z("id","incident-",e,""),g("checked",r.id===t.selected.id)("value",r.id),s(),z("for","incident-",e,""),s(),x(" ",r.label," ")}}var Qn=(()=>{let i=class i{constructor(e,t){this.activeModal=e,this.translate=t,this.incidentOptions=[]}ngOnInit(){let e=this.createIncidentOption();this.incidentOptions=this.incidentTypes.map(t=>this.createIncidentOption(t)),this.incidentOptions.unshift(e),this.selected=this.incidentOptions.find(t=>t.id===this.incident?.Id)||e}createIncidentOption(e){return{id:e?e.Id:null,label:e?e.Designation:this.translate.instant("presence-control.incident.no-incident")}}onSelectionChange(e){this.selected=e}getSelectedIncident(){return this.incidentTypes.find(e=>e.Id===this.selected?.id)||null}};i.\u0275fac=function(t){return new(t||i)(_(se),_(Q))},i.\u0275cmp=L({type:i,selectors:[["bkd-presence-control-incident"]],inputs:{incident:"incident",incidentTypes:"incidentTypes"},standalone:!0,features:[E],decls:13,vars:10,consts:[[1,"modal-body"],["class","form-check",4,"ngFor","ngForOf"],[1,"modal-footer"],["type","button",1,"btn","btn-outline-secondary",3,"click"],["type","button",1,"btn","btn-primary",3,"click"],[1,"form-check"],["type","radio","name","incident",1,"form-check-input",3,"change","id","checked","value"],[1,"form-check-label",3,"for"]],template:function(t,o){t&1&&(c(0,"div",0)(1,"p"),d(2),l(3,"translate"),p(),c(4,"form"),v(5,Gi,4,7,"div",1),p()(),c(6,"div",2)(7,"button",3),b("click",function(){return o.activeModal.dismiss()}),d(8),l(9,"translate"),p(),c(10,"button",4),b("click",function(){return o.activeModal.close(o.getSelectedIncident())}),d(11),l(12,"translate"),p()()),t&2&&(s(2),x(" ",m(3,4,"presence-control.incident.text")," "),s(3),g("ngForOf",o.incidentOptions),s(3),x(" ",m(9,6,"presence-control.incident.cancel")," "),s(3),x(" ",m(12,8,"presence-control.incident.save")," "))},dependencies:[re,ye,ve,be,N,j,F],styles:["form[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]:first-child{border-bottom:1px solid #dee2e6;padding-bottom:1rem;margin-bottom:1rem}"]});let n=i;return n})();var Ui=20,Hi=100,je=function(n){return n.AddUpdateAction="ADD",n.RemoveUpdateAction="REMOVE",n}(je||{}),tt=(()=>{let i=class i{constructor(e,t,o,a,h){this.toastService=e,this.translate=t,this.restService=o,this.presenceTypesService=a,this.settings=h,this.destroy$=new $,this.action$=new $,this.pendingUpdates$=this.action$.pipe(Ct(this.reduceUpdates.bind(this),[]),vt()),this.revertUpdates$=new $,this.performUpdates$=this.pendingUpdates$.pipe(nt(Hi),Le(We(ct)),_t(this.performUpdates.bind(this))),this.stateUpdates$=X(this.pendingUpdates$,this.revertUpdates$).pipe(nt(Ui),Le(We(ct))),this.performUpdates$.pipe(q(this.destroy$)).subscribe()}ngOnDestroy(){this.destroy$.next()}updatePresenceType(e,t=null){this.dispatchAddUpdate(e.lessonPresence,t)}performUpdates(e){let t=this.groupUpdates(e);return O(Object.keys(t).reduce((o,a)=>{let h=t[a];return Object.keys(h).forEach(C=>{let k=h[C];o.push(this.performUpdateForGroup(k))}),o},[])).pipe(f(()=>t))}performUpdateForGroup(e){return e.forEach(t=>this.dispatchRemoveUpdate(t.presence)),this.performLessonPresencesUpdatesByIds(e[0].presence.LessonRef.Id,e.map(t=>t.presence.StudentRef.Id),e[0].newPresenceTypeId).pipe(ht(t=>this.revertUpdatesAfterError(e,t)))}performLessonPresencesUpdatesByIds(e,t,o=null){return o?(o?this.presenceTypesService.getPresenceType(o):J(null)).pipe(T(h=>this.restService.editLessonPresences([e],t,h?.Id,Qe(h,this.settings)||void 0,{context:new ot().set(at,{disableErrorHandling:!0})}))):this.restService.removeLessonPresences([e],t,{context:new ot().set(at,{disableErrorHandling:!0})})}revertUpdatesAfterError(e,t){return console.error("Bulk-update of lesson presences failed"),console.error(t),this.toastService.error(this.translate.instant("shared.lesson-presences-update.error")),this.revertUpdates$.next(e.map(o=>ge(ue({},o),{newPresenceTypeId:o.presence.TypeRef.Id}))),J(void 0)}groupUpdates(e){return e.reduce((t,o)=>{let a=String(o.newPresenceTypeId&&o.newPresenceTypeId);return t[a]||(t[a]={}),Array.isArray(t[a][o.presence.LessonRef.Id])||(t[a][o.presence.LessonRef.Id]=[]),t[a][o.presence.LessonRef.Id].push(o),t},{})}reduceUpdates(e,t){switch(t.type){case je.AddUpdateAction:{let{presence:o,newPresenceTypeId:a}=t.payload,h=e.findIndex(Kn(o));return h===-1?[...e,{presence:o,newPresenceTypeId:a}]:[...e.slice(0,h),{presence:e[h].presence,newPresenceTypeId:a},...e.slice(h+1)]}case je.RemoveUpdateAction:return e.filter(We(Kn(t.payload)));default:return e}}dispatchAddUpdate(e,t){this.action$.next({type:je.AddUpdateAction,payload:{presence:e,newPresenceTypeId:t}})}dispatchRemoveUpdate(e){this.action$.next({type:je.RemoveUpdateAction,payload:e})}};i.\u0275fac=function(t){return new(t||i)(y(Pe),y(Q),y(sn),y(Se),y(H))},i.\u0275prov=R({token:i,factory:i.\u0275fac,providedIn:"root"});let n=i;return n})();function Kn(n){return i=>i.presence.LessonRef.Id===n.LessonRef.Id&&i.presence.StudentRef.Id===n.StudentRef.Id}var qi=(n,i,r)=>({lesson:n,lessons:i,entries:r}),Wi=n=>({returnparams:n});function Qi(n,i){if(n&1){let r=M();c(0,"bkd-presence-control-entry",7),l(1,"async"),l(2,"async"),l(3,"async"),l(4,"async"),b("togglePresenceType",function(t){P(r);let o=u(5);return S(o.togglePresenceType(t))})("changeIncident",function(t){P(r);let o=u(5);return S(o.changeIncident(t))}),p()}if(n&2){let r,e=i.$implicit,t=u(5);g("entry",e)("hasUnconfirmedAbsences",m(1,5,t.state.hasUnconfirmedAbsences(e)))("viewMode",m(2,7,t.state.viewMode$))("showClassName",((r=m(3,9,t.state.studyClassCount$))!==null&&r!==void 0?r:0)>1)("profileReturnParams",ne(13,Wi,m(4,11,t.state.queryParamsString$)))}}function Ki(n,i){if(n&1&&(Z(0),c(1,"div"),l(2,"async"),v(3,Qi,5,15,"bkd-presence-control-entry",6),p(),ee()),n&2){let r=u(3).bkdLet,e=u();s(),Re("default-entries entries view-mode-",m(2,4,e.state.viewMode$),""),s(2),g("ngForOf",r.entries)}}function zi(n,i){n&1&&(c(0,"p",8),d(1),l(2,"translate"),p()),n&2&&(s(),x(" ",m(2,1,"presence-control.no-lesson-presences")," "))}function Ji(n,i){if(n&1&&(Z(0),v(1,Ki,4,6,"ng-container",4)(2,zi,3,3,"ng-template",null,2,_e),ee()),n&2){let r=te(3),e=u(2).bkdLet;s(),g("ngIf",(e.entries==null?null:e.entries.length)>0)("ngIfElse",r)}}function Xi(n,i){n&1&&(c(0,"p",8),d(1),l(2,"translate"),p()),n&2&&(s(),w(m(2,1,"presence-control.no-lessons")))}function Yi(n,i){if(n&1){let r=M();Z(0),c(1,"bkd-presence-control-header",5),l(2,"async"),l(3,"async"),l(4,"async"),l(5,"async"),l(6,"async"),l(7,"async"),l(8,"async"),b("searchChange",function(t){P(r);let o=u(2);return S(o.search$.next(t))})("viewModeChange",function(t){P(r);let o=u(2);return S(o.state.setViewMode(t))})("selectDateChange",function(t){P(r);let o=u(2);return S(o.state.setDate(t))})("selectLessonChange",function(t){P(r);let o=u(2);return S(o.state.setLessonId(t.id))}),p(),v(9,Ji,4,2,"ng-container",4)(10,Xi,3,3,"ng-template",null,1,_e),ee()}if(n&2){let r=te(11),e=u().bkdLet,t=u();s(),g("selectedLesson",e.lesson)("lessons",e.lessons)("presentCount",m(2,11,t.state.presentCount$))("absentCount",m(3,13,t.state.absentCount$))("unapprovedCount",m(4,15,t.state.unapprovedCount$))("absentPrecedingCount",m(5,17,t.state.absentPrecedingCount$))("viewMode",m(6,19,t.state.viewMode$))("selectDate",m(7,21,t.state.selectedDate$))("search",m(8,23,t.search$)),s(8),g("ngIf",e.lesson)("ngIfElse",r)}}function Zi(n,i){n&1&&W(0,"bkd-spinner")}function eo(n,i){if(n&1&&(Z(0),v(1,Yi,12,25,"ng-container",4),l(2,"async"),v(3,Zi,1,0,"ng-template",null,0,_e),ee()),n&2){let r=te(4),e=u();s(),g("ngIf",m(2,2,e.state.loading$)===!1)("ngIfElse",r)}}var to=["studentFullName"],Jn=(()=>{let i=class i{constructor(e,t,o,a,h,C,k){this.state=e,this.blockLessons=t,this.lessonPresencesUpdateService=o,this.presenceTypesService=a,this.modalService=h,this.scrollPosition=C,this.route=k,this.search$=new fe(""),this.entries$=O([this.state.presenceControlEntriesByGroup$,this.search$]).pipe(f(([V,Me])=>Pn(V,to,Me)),B(1)),this.destroy$=new $}ngOnInit(){this.route.queryParams.pipe(q(this.destroy$)).subscribe(this.restoreStateFromParams.bind(this))}ngAfterViewInit(){this.scrollPosition.restore()}ngOnDestroy(){this.destroy$.next()}doTogglePresenceType(e){e.forEach(t=>this.state.getNextPresenceType(t).subscribe(o=>this.lessonPresencesUpdateService.updatePresenceType(t,o?o.Id:null)))}togglePresenceType(e){this.blockLessons.getBlockLessonPresenceControlEntries(e).pipe(D(1)).subscribe(t=>{if(t.length===1){let o=t[0];this.doTogglePresenceType([o])}else{let o=this.modalService.open(Un);o.componentInstance.entry=e,o.componentInstance.blockPresenceControlEntries=t,o.result.then(a=>{a&&this.doTogglePresenceType(a)},()=>{})}})}updateIncident(e,t){this.lessonPresencesUpdateService.updatePresenceType(e,t)}changeIncident(e){this.presenceTypesService.incidentTypes$.subscribe(t=>{let o=this.modalService.open(Qn);o.componentInstance.incident=t.find(a=>a.Id===e.presenceType?.Id)||null,o.componentInstance.incidentTypes=t,o.result.then(a=>{this.updateIncident(e,a?.Id||null)},()=>{})})}restoreStateFromParams(e){e.date&&this.state.setDate(Ft(e.date));let t=String(e.lesson);t&&this.state.setLessonId(t),e.viewMode&&An.includes(e.viewMode)&&this.state.setViewMode(e.viewMode)}};i.\u0275fac=function(t){return new(t||i)(_(G),_(et),_(tt),_(Se),_(Ie),_(In),_(Ge))},i.\u0275cmp=L({type:i,selectors:[["bkd-presence-control-list"]],standalone:!0,features:[E],decls:7,vars:14,consts:[["loading",""],["noLessons",""],["noLessonPresences",""],[4,"bkdLet"],[4,"ngIf","ngIfElse"],[3,"searchChange","viewModeChange","selectDateChange","selectLessonChange","selectedLesson","lessons","presentCount","absentCount","unapprovedCount","absentPrecedingCount","viewMode","selectDate","search"],[3,"entry","hasUnconfirmedAbsences","viewMode","showClassName","profileReturnParams","togglePresenceType","changeIncident",4,"ngFor","ngForOf"],[3,"togglePresenceType","changeIncident","entry","hasUnconfirmedAbsences","viewMode","showClassName","profileReturnParams"],[1,"mt-3"]],template:function(t,o){t&1&&(c(0,"h1"),d(1),l(2,"translate"),p(),v(3,eo,5,4,"ng-container",3),l(4,"async"),l(5,"async"),l(6,"async")),t&2&&(s(),w(m(2,2,"presence-control.title")),s(2),g("bkdLet",$t(10,qi,m(4,4,o.state.selectedLesson$),m(5,6,o.state.lessons$),m(6,8,o.entries$))))},dependencies:[ce,ie,Wn,N,qn,xe,oe,j,F],styles:["bkd-presence-control-entry[_ngcontent-%COMP%]{border-bottom:1px solid #dee2e6}.entries.view-mode-grid[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap}.entries.view-mode-grid[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{width:100%}@media (min-width: 400px){.entries.view-mode-grid[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{width:100%;border-right:1px solid #dee2e6}}@media (min-width: 800px){.entries.view-mode-grid[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{width:50%;border-right:1px solid #dee2e6}}@media (min-width: 1200px){.entries.view-mode-grid[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{width:33.3333333333%;border-right:1px solid #dee2e6}}@media (min-width: 1600px){.entries.view-mode-grid[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{width:25%;border-right:1px solid #dee2e6}}@media (min-width: 2000px){.entries.view-mode-grid[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{width:20%;border-right:1px solid #dee2e6}}@media (min-width: 2400px){.entries.view-mode-grid[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{width:16.6666666667%;border-right:1px solid #dee2e6}}[_nghost-%COMP%]{display:block;overflow:hidden;width:100%}.entries.view-mode-grid[_ngcontent-%COMP%]{width:calc(100% + 1px)}"],changeDetection:0});let n=i;return n})();var Xn=(()=>{let i=class i{constructor(e,t){this.state=e,this.lessonPresencesUpdateService=t,this.destroy$=new $}ngOnInit(){this.lessonPresencesUpdateService.stateUpdates$.pipe(q(this.destroy$)).subscribe(e=>this.state.updateLessonPresencesTypes(e))}ngOnDestroy(){this.destroy$.next()}};i.\u0275fac=function(t){return new(t||i)(_(G),_(tt))},i.\u0275cmp=L({type:i,selectors:[["bkd-presence-control"]],standalone:!0,features:[he([G,et,de,on,{provide:Jt,useExisting:G}]),E],decls:1,vars:0,template:function(t,o){t&1&&W(0,"router-outlet")},dependencies:[Bt],changeDetection:0});let n=i;return n})();var Qs=[{path:"",component:Xn,children:[{path:"",component:Jn,data:{restoreScrollPositionFrom:["/presence-control/student/:id/addresses","/presence-control/student/:id/absences","/presence-control/student/:id/grades"]}},_n,{path:"groups/:id",component:Gn}]}];export{Qs as PRESENCE_CONTROL_ROUTES}; +import{a as Cn,b as vn}from"./chunk-673RVEOB.js";import{a as me,b as we}from"./chunk-KDAC4GJ5.js";import{b as bn}from"./chunk-ZROJU7EX.js";import{a as yn}from"./chunk-MGID7RWQ.js";import{a as Pn,b as xn}from"./chunk-RQFEXCIP.js";import{a as _n}from"./chunk-JV3CBBGP.js";import{e as fn}from"./chunk-U4HODSW3.js";import{q as gn,v as Ie}from"./chunk-W7ASLXRM.js";import{a as at}from"./chunk-PSXDSPKS.js";import{b as Jt,e as ze}from"./chunk-C7XT5XXE.js";import{a as rn}from"./chunk-YMJC6QZX.js";import"./chunk-Y4QYVF5K.js";import"./chunk-HII3S2DL.js";import{a as In}from"./chunk-DZZC2YX2.js";import{a as Sn}from"./chunk-K3EEKOGY.js";import{a as pt,d as un}from"./chunk-24AFRN2G.js";import{a as cn}from"./chunk-RFO4NYUO.js";import{a as an,b as pn}from"./chunk-5RDJZAUT.js";import"./chunk-DB66EACG.js";import{E as en,F as tn,L as nn,P as on,T as Se,U as sn,W as ct,Y as hn,j as Xt,t as Yt,y as Zt,z as Qe}from"./chunk-ZK2MNT7Z.js";import{d as st,e as ae}from"./chunk-AW7CSGKI.js";import{b as pe}from"./chunk-FTDG26ID.js";import{a as ce,b as Ke,c as xe,g as ln,h as dn,i as mn}from"./chunk-SOHFFTKU.js";import{f as Rt,g as Nt,h as He,i as Gt,j as Ut,k as Ht,m as qt,n as Wt,o as Ee,p as se,u as zt,w as We}from"./chunk-C56YGDXA.js";import{a as Pe}from"./chunk-UX5TA32W.js";import{$ as L,$a as u,$c as Vt,A as ht,Ab as l,B as _t,Bb as m,C as nt,Cb as U,Dd as Qt,E as D,Eb as _e,Fd as Q,G as Ve,Ga as v,Gd as F,Hd as j,Ia as g,Id as Kt,J as Ct,Ja as K,K as vt,Ka as Pt,L as B,La as Re,Lc as Ft,M as it,Mb as Et,N as Ae,O as T,Q as q,Qb as Dt,Rb as N,Sa as c,Sb as ie,Ta as p,Ua as W,Va as Z,Vb as oe,Vc as H,W as R,Wa as ee,Wb as Ce,Ya as M,Yc as jt,Z as y,_a as b,a as ue,ad as ve,b as ge,bc as ot,bd as be,db as z,dc as Ne,dd as At,e as $,ed as ye,f as fe,fb as St,g as Te,ga as bt,gb as xt,ha as P,hb as It,ia as S,ib as te,jb as d,k as J,kb as w,la as yt,lb as x,m as f,mb as wt,n as O,nb as Mt,ob as kt,oc as Ge,pc as Bt,r as $e,ra as Y,rc as Ue,rd as re,sb as he,t as ft,tb as E,td as rt,ua as s,ub as Ot,v as X,va as _,vb as ne,w as Le,wb as Tt,xb as $t,yb as Lt,yd as qe,zd as De}from"./chunk-XTHSYQMN.js";function wn(n,i){let r=st(n),e=st(i);return+r==+e}function Mn(n,i,r){let e=i.map(o=>({eventId:o,group:n})),t=r.map(o=>e.find(a=>a.eventId===o.eventId)||o);return[...new Set([...t,...e])].filter(o=>o.group!==null)}var Je=(()=>{let i=class i extends nn{};i.\u0275fac=(()=>{let e;return function(o){return(e||(e=yt(i)))(o||i)}})(),i.\u0275prov=R({token:i,factory:i.\u0275fac});let n=i;return n})();function kn(n,i){return[...n].sort(ei(i))}function ei(n){return(i,r)=>{switch(n.primarySortKey){case"name":{let e=i.name.localeCompare(r.name);return n.ascending?e*-1:e}case"group":{let e=(i.detail.Value||"").localeCompare(r.detail.Value||"");return n.ascending?e*-1:e}}}}function On(n,i){return n.map(r=>ti(r,i))}function ti(n,i){return{id:n.IdPerson,name:i.find(r=>r.StudentRef.Id===n.IdPerson)?.StudentFullName||"",group:n.Value,detail:n}}function Tn(n,i){return n.filter(r=>r.VssId===i.subscriptionDetailGroupId)}function lt(n,i){return n.find(r=>r.VssId===i.subscriptionDetailGroupId)}function ni(n,i){if(n&1){let r=M();c(0,"div",5)(1,"input",6),b("change",function(){let t=P(r).$implicit,o=u();return S(o.onSelectionChange(t))}),p(),c(2,"label",7),d(3),p()()}if(n&2){let r=i.$implicit,e=i.index,t=u();s(),z("id","group-",e,""),g("checked",r.id===t.selected.id)("value",r.id),s(),z("for","group-",e,""),s(),x(" ",r.label," ")}}var Be=function(n){return n.Select="select",n.Assign="assign",n}(Be||{}),$n=(()=>{let i=class i{constructor(e,t){this.activeModal=e,this.translate=t,this.groupOptions=[]}ngOnInit(){this.title=`presence-control.groups.${this.dialogMode}.title`;let e=this.createEmtpyOption();this.groupOptions=this.createGroupOptions(this.subscriptionDetailsDefinitions),this.groupOptions.unshift(e),this.selected=this.groupOptions.find(t=>t.id===this.group)||e}createEmtpyOption(){let e=this.dialogMode===Be.Select?"presence-control.groups.all":"presence-control.groups.none";return{id:null,label:this.translate.instant(e)}}createGroupOptions(e){return e.DropdownItems?e.DropdownItems.map(t=>({id:t.Key,label:`${this.translate.instant("presence-control.groups.group")} ${t.Value}`})):[]}getSelectedGroup(){return this.selected}onSelectionChange(e){this.selected=e}};i.\u0275fac=function(t){return new(t||i)(_(se),_(Q))},i.\u0275cmp=L({type:i,selectors:[["bkd-presence-control-group-dialog"]],inputs:{dialogMode:"dialogMode",subscriptionDetailsDefinitions:"subscriptionDetailsDefinitions",group:"group"},standalone:!0,features:[E],decls:13,vars:10,consts:[[1,"modal-body"],["class","form-check",4,"ngFor","ngForOf"],[1,"modal-footer"],["type","button",1,"btn","btn-outline-secondary",3,"click"],["type","button",1,"btn","btn-primary",3,"click"],[1,"form-check"],["type","radio","name","groups",1,"form-check-input",3,"change","id","checked","value"],[1,"form-check-label",3,"for"]],template:function(t,o){t&1&&(c(0,"div",0)(1,"p"),d(2),l(3,"translate"),p(),c(4,"form"),v(5,ni,4,7,"div",1),p()(),c(6,"div",2)(7,"button",3),b("click",function(){return o.activeModal.dismiss()}),d(8),l(9,"translate"),p(),c(10,"button",4),b("click",function(){return o.activeModal.close(o.getSelectedGroup())}),d(11),l(12,"translate"),p()()),t&2&&(s(2),x(" ",m(3,4,o.title)," "),s(3),g("ngForOf",o.groupOptions),s(3),x(" ",m(9,6,"presence-control.groups.cancel")," "),s(3),x(" ",m(12,8,"presence-control.groups.save")," "))},dependencies:[re,ye,ve,be,N,j,F]});let n=i;return n})();function Ln(n,i,r,e){return n.map(t=>{let o=i.find(a=>ii(a.presence,t));if(o){let a;return!o.newPresenceTypeId&&t.Comment?a=r.find(h=>h.IsComment)||null:a=r.find(h=>h.Id===o.newPresenceTypeId)||null,ge(ue({},t),{TypeRef:oi(a),Date:null,Type:a?a.Designation:null,ConfirmationStateId:Qe(a,e)})}return t})}function ii(n,i){return n.LessonRef.Id===i.LessonRef.Id&&n.StudentRef.Id===i.StudentRef.Id}function oi(n){return{Id:n?n.Id:null,HRef:null}}function Ye(n){return i=>i.reduce((r,e)=>r+(e.presenceCategory===n?1:0),0)}function En(){return n=>n.reduce((i,r)=>i+(r.precedingAbsences&&r.precedingAbsences.length>0?1:0),0)}var Dn=(()=>{let i=class i extends Ke{constructor(e,t){super(e,t,pt,"LessonTeachers")}loadOtherTeachersLessonAbsences(e,t,o){let a=`${this.baseUrl}/except/${e}/LessonAbsences?expand=LessonRef`;return t&&t.length>0&&(a=a.concat("&filter.StudentRef=;"+t.join(";"))),this.http.get(a,{params:o}).pipe(T(Qt(pt)))}};i.\u0275fac=function(t){return new(t||i)(y(Ne),y(H))},i.\u0275prov=R({token:i,factory:i.\u0275fac,providedIn:"root"});let n=i;return n})();var Ze=(()=>{let i=class i extends Ke{constructor(e,t){super(e,t,gn,"SubscriptionDetails")}getListForEvent(e){return this.getList({params:{IdEvent:String(e)}})}update(e,t){let o={IdPerson:t.IdPerson,EventId:t.EventId,Value:e};return this.http.put(`${this.baseUrl}/${t.Id}`,o).pipe(f(()=>{}))}};i.\u0275fac=function(t){return new(t||i)(y(Ne),y(H))},i.\u0275prov=R({token:i,factory:i.\u0275fac,providedIn:"root"});let n=i;return n})();var Fn="presence-control-group",de=(()=>{let i=class i{constructor(e,t,o,a,h){this.userSettings=e,this.eventService=t,this.subscriptionDetailsService=o,this.loadingService=a,this.settings=h,this.selectGroup$=new $,this.selectedLesson$=new Te,this.lessonPresences$=new Te,this.reloadSubscriptionDetails$=new $,this.defaultGroup=null,this.savedGroup$=this.selectedLesson$.pipe(T(C=>this.userSettings.getPresenceControlGroupView().pipe(f(k=>this.findGroupByLesson(k,C))))),this.group$=X(this.selectGroup$,this.savedGroup$).pipe(Ae(this.defaultGroup),B(1)),this.loading$=this.loadingService.loading(Fn),this.subscriptionDetailsDefinitions$=this.selectedLesson$.pipe(f(C=>C?.getEventIds()||[]),T(C=>$e(C.map(k=>this.eventService.getSubscriptionDetailsDefinitions(k)))),B(1)),this.groupsAvailability$=this.subscriptionDetailsDefinitions$.pipe(f(C=>C.every(k=>lt(k,this.settings))),B(1)),this.subscriptionDetails$=O([this.selectedLesson$,this.groupsAvailability$,this.reloadSubscriptionDetails$.pipe(f(()=>!1),Ae(!0))]).pipe(T(([C,k,V])=>C&&k?this.loadSubscriptionDetailsForLesson(C,V):J([])),f(C=>Tn(C,this.settings)),B(1)),this.subscriptionDetailPersonIds$=O([this.group$,this.subscriptionDetails$]).pipe(f(([C,k])=>k.filter(V=>V.Value===C).map(V=>V.IdPerson)),Ae([]))}selectGroup(e){this.selectGroup$.next(e)}setSelectedLesson(e){this.selectedLesson$.next(e)}setLessonPresences(e){this.lessonPresences$.next(e)}getSubscriptionDetailsDefinitions(){return this.subscriptionDetailsDefinitions$.pipe(f(rt),f(e=>lt(e,this.settings)))}getSubscriptionDetailsForStudents(){return O([this.subscriptionDetails$,this.lessonPresences$]).pipe(f(ae(On)))}reloadSubscriptionDetails(){this.reloadSubscriptionDetails$.next(void 0)}loadSubscriptionDetailsForLesson(e,t=!0){return this.loadingService.load($e(De(e.getEventIds()).map(o=>this.subscriptionDetailsService.getListForEvent(o))),t?void 0:Fn).pipe(f(rt))}findGroupByLesson(e,t){return e.find(a=>a.eventId===t?.getEventIds()[0])?.group||this.defaultGroup}};i.\u0275fac=function(t){return new(t||i)(y(we),y(yn),y(Ze),y(pe),y(H))},i.\u0275prov=R({token:i,factory:i.\u0275fac});let n=i;return n})();var An=Object.values(me),G=(()=>{let i=class i{constructor(e,t,o,a,h,C,k,V,Me,ke){this.userSettings=e,this.lessonPresencesService=t,this.lessonTeacherService=o,this.presenceTypesService=a,this.groupService=h,this.dropDownItemsService=C,this.loadingService=k,this.storageService=V,this.settings=Me,this.location=ke,this.selectedDateSubject$=new fe(new Date),this.selectedDate$=this.selectedDateSubject$.asObservable().pipe(f(Xt),Ve(qe)),this.viewModeSubject$=new $,this.viewMode$=X(this.viewModeSubject$,this.userSettings.getPresenceControlViewMode().pipe(D(1))),this.lessons$=this.selectedDate$.pipe(T(I=>this.loadLessonsByDate(I)),B(1)),this.selectLessonId$=new $,this.selectLesson$=this.selectLessonId$.pipe(T(I=>this.getLessonById(I))),this.selectedLesson$=O([ln(this.selectLesson$.pipe(Ve((I,Oe)=>qe(I,Oe))),dn(this.settings.lessonPresencesRefreshTime)),this.lessons$]).pipe(f(([I,Oe])=>Oe.find(Yn=>Yn.id===I.id)?I:null),B(1)),this.studyClassCount$=this.selectedLesson$.pipe(f(I=>I?.lessons.length||0)),this.updateLessonPresences$=new $,this.reloadLessonPresences$=new $,this.lessonPresences$=X(mn(this.selectedLesson$,this.reloadLessonPresences$).pipe(T(I=>I?this.loadLessonPresencesByLesson(I):J([]))),this.updateLessonPresences$).pipe(B(1)),this.presenceTypes$=this.loadPresenceTypes().pipe(B(1)),this.reloadStudentIdsWithUnconfirmedAbsences$=new $,this.studentIdsWithUnconfirmedAbsences$=X(this.selectedDate$,this.selectedLesson$.pipe(it(1)),this.reloadStudentIdsWithUnconfirmedAbsences$).pipe(T(()=>this.loadStudentIdsWithUnconfirmedAbsences()),B(1)),this.loading$=this.loadingService.loading$,this.absenceConfirmationStates$=this.dropDownItemsService.getAbsenceConfirmationStates().pipe(B(1)),this.studentIds$=this.lessonPresences$.pipe(f(I=>De(I.map(Oe=>Oe.StudentRef.Id))),B(1)),this.otherTeachersAbsences$=this.studentIds$.pipe(Ve(qe),T(I=>I.length>0?this.lessonTeacherService.loadOtherTeachersLessonAbsences(this.getMyself(),I):J([])),B(1)),this.groupsAvailability$=this.groupService.groupsAvailability$,this.presenceControlEntries$=O([this.selectedLesson$,this.lessonPresences$,this.presenceTypes$,this.absenceConfirmationStates$,this.otherTeachersAbsences$]).pipe(f(ae(en))),this.presenceControlEntriesByGroup$=O([this.groupService.group$,this.presenceControlEntries$,this.groupService.subscriptionDetailPersonIds$]).pipe(f(ae(bn)),B(1)),this.presentCount$=this.presenceControlEntriesByGroup$.pipe(f(Ye("present"))),this.absentCount$=this.presenceControlEntriesByGroup$.pipe(f(Ye("absent"))),this.unapprovedCount$=this.presenceControlEntriesByGroup$.pipe(f(Ye("unapproved"))),this.absentPrecedingCount$=this.presenceControlEntriesByGroup$.pipe(f(En())),this.queryParamsString$=O([this.selectedDate$,this.selectedLesson$,this.viewMode$]).pipe(f(ae(this.buildQueryParams.bind(this))),f(pn)),this.destroy$=new $,this.queryParamsString$.pipe(q(this.destroy$)).subscribe(I=>{this.location.replaceState("/presence-control",I),this.confirmBackLinkParams={returnparams:I}}),this.viewMode$.pipe(it(1),T(I=>this.userSettings.savePresenceControlViewMode(I)),q(this.destroy$)).subscribe(),this.selectedLesson$.pipe(q(this.destroy$)).subscribe(I=>{this.groupService.setSelectedLesson(I)}),this.lessonPresences$.pipe(q(this.destroy$)).subscribe(I=>this.groupService.setLessonPresences(I))}ngOnDestroy(){this.destroy$.next()}setDate(e){this.selectedDateSubject$.next(e)}setLessonId(e){this.selectLessonId$.next(e)}setViewMode(e){this.viewModeSubject$.next(e)}updateLessonPresencesTypes(e){O([this.lessonPresences$.pipe(D(1)),this.presenceTypes$.pipe(D(1))]).pipe(f(([t,o])=>Ln(t,e,o,this.settings))).subscribe(t=>this.updateLessonPresences$.next(t))}getNextPresenceType(e){return this.presenceTypes$.pipe(D(1),f(t=>e.getNextPresenceType(t)))}hasUnconfirmedAbsences(e){return this.studentIdsWithUnconfirmedAbsences$.pipe(f(t=>t.includes(e.lessonPresence.StudentRef.Id)))}updateAfterConfirm(){this.reloadLessonPresences$.next(),this.reloadStudentIdsWithUnconfirmedAbsences$.next()}loadLessonPresencesByLesson(e){return this.loadingService.load(this.lessonPresencesService.getListByLessons(e.lessons))}loadLessonsByDate(e){return this.loadingService.load(this.lessonPresencesService.getLessonsByDate(e)).pipe(f(Cn))}loadPresenceTypes(){return this.loadingService.load(this.presenceTypesService.presenceTypes$)}loadStudentIdsWithUnconfirmedAbsences(){return ft(0,this.settings.unconfirmedAbsencesRefreshTime||-1).pipe(T(()=>this.lessonPresencesService.getListOfUnconfirmed()),f(e=>De(e.map(t=>t.StudentRef.Id))))}buildQueryParams(e,t,o){let a={date:Yt(e,"yyyy-MM-dd"),viewMode:o};return t&&(a.lesson=String(t.id)),a}getLessonById(e){let t=String(e);return this.lessons$.pipe(f(o=>t&&o.find(a=>a.id===t)||vn(o)),Le(Boolean))}getMyself(){let e=this.storageService.getPayload();return Number(e?.holder_id||e?.id_person)}};i.\u0275fac=function(t){return new(t||i)(y(we),y(ze),y(Dn),y(Se),y(de),y(rn),y(pe),y(Kt),y(H),y(Et))},i.\u0275prov=R({token:i,factory:i.\u0275fac});let n=i;return n})();var pi=(n,i,r,e)=>({sortCriteria:n,sortedEntries:i,selection:r,group:e}),li=()=>["/presence-control"];function di(n,i){if(n&1){let r=M();c(0,"div",14),b("click",function(){let t=P(r).$implicit,o=u(2);return S(o.toggleSort(t))}),d(1),l(2,"translate"),c(3,"span",15),d(4),p()()}if(n&2){let r=i.$implicit,e=u().bkdLet,t=u();g("className",r),s(),x(" ",m(2,3,"presence-control.groups.list.header."+r)," "),s(3),w(t.getSortDirectionCharacter(e.sortCriteria,r))}}function mi(n,i){n&1&&W(0,"bkd-spinner",23)}function ui(n,i){if(n&1){let r=M();Z(0),c(1,"div",17)(2,"div",18)(3,"input",19,1),l(5,"async"),b("change",function(){let t=P(r).$implicit,o=u(3);return S(o.selectionService.toggle(t))}),p()(),c(6,"div",20),d(7),p(),c(8,"div",21)(9,"span"),d(10),p(),v(11,mi,1,0,"bkd-spinner",22),l(12,"async"),p()(),ee()}if(n&2){let r=i.$implicit,e=u(3);s(3),g("checked",m(5,4,e.selectionService.isSelected$(r))),s(4),x(" ",r.name," "),s(3),w(r.group?r.group:""),s(),g("ngIf",m(12,6,e.groupService.loading$))}}function gi(n,i){if(n&1&&(Z(0),v(1,ui,13,8,"ng-container",16),ee()),n&2){let r=u().bkdLet;s(),g("ngForOf",r.sortedEntries)}}function fi(n,i){n&1&&W(0,"bkd-spinner")}function hi(n,i){if(n&1){let r=M();c(0,"div"),W(1,"bkd-backlink",3),l(2,"async"),c(3,"h1"),d(4),l(5,"translate"),p(),c(6,"div",4)(7,"div",5)(8,"span",6),d(9),l(10,"translate"),p(),c(11,"button",7),b("click",function(){P(r);let t=u();return S(t.selectGroup())}),d(12),l(13,"translate"),l(14,"translate"),p()(),c(15,"a",8),b("click",function(){P(r);let t=u();return S(t.assignGroup())}),c(16,"i",9),d(17,"edit"),p()()(),c(18,"div",10)(19,"div",11),v(20,di,5,5,"div",12),p(),v(21,gi,2,1,"ng-container",13),l(22,"async"),v(23,fi,1,0,"ng-template",null,0,_e),p()()}if(n&2){let r=i.bkdLet,e=te(24),t=u();s(),g("link",Ot(22,li))("params",m(2,10,t.backlinkQueryParams$)),s(3),w(m(5,12,"presence-control.groups.title")),s(5),w(m(10,14,"presence-control.groups.show")),s(3),x(" ",r.group?m(13,16,"presence-control.groups.group")+" "+r.group:m(14,18,"presence-control.groups.all")," "),s(3),K("disabled",r.selection.length===0),s(5),g("ngForOf",t.primarySortKeys),s(),g("ngIf",m(22,20,t.state.loading$)===!1)("ngIfElse",e)}}var Gn=(()=>{let i=class i{constructor(e,t,o,a,h,C,k,V,Me){this.route=e,this.state=t,this.selectionService=o,this.groupService=a,this.userSettings=h,this.subscriptionDetailService=C,this.toastService=k,this.translate=V,this.modalService=Me,this.primarySortKeys=["name","group"],this.backlinkQueryParams$=this.route.queryParams.pipe(f(({returnparams:ke})=>ke),f(an)),this.eventIds$=this.state.selectedLesson$.pipe(f(ke=>ke?.getEventIds()||[])),this.sortCriteriaSubject$=new fe({primarySortKey:"name",ascending:!1}),this.sortCriteria$=this.sortCriteriaSubject$.asObservable(),this.sortedEntries$=O([this.groupService.getSubscriptionDetailsForStudents(),this.sortCriteria$]).pipe(f(ae(kn))),this.selected=[]}ngOnInit(){this.selectionService.selection$.subscribe(e=>this.selected=e)}selectGroup(){this.openGroupModal(Be.Select,this.selectCallback.bind(this))}assignGroup(){this.openGroupModal(Be.Assign,this.assignCallback.bind(this))}openGroupModal(e,t){O([this.groupService.getSubscriptionDetailsDefinitions(),this.groupService.group$]).pipe(D(1)).subscribe(([o,a])=>{let h=this.modalService.open($n);h.componentInstance.dialogMode=e,h.componentInstance.subscriptionDetailsDefinitions=o,h.componentInstance.group=a,h.result.then(C=>{t(C)},()=>{})})}selectCallback(e){O([this.eventIds$,this.userSettings.getPresenceControlGroupView()]).pipe(D(1),T(([t,o])=>this.userSettings.savePresenceControlGroupView(Mn(e.id,t,o))),f(()=>e.id)).subscribe(t=>this.groupService.selectGroup(t))}assignCallback(e){$e(this.selected.map(t=>this.subscriptionDetailService.update(e.id,t.detail))).subscribe(this.onSaveSuccess.bind(this))}onSaveSuccess(){this.groupService.reloadSubscriptionDetails(),this.selectionService.clear(),this.toastService.success(this.translate.instant("presence-control.groups.notifications.save-success"))}getSortDirectionCharacter(e,t){return e.primarySortKey!==t?"":e.ascending?"\u2193":"\u2191"}toggleSort(e){this.sortCriteriaSubject$.pipe(D(1)).subscribe(t=>{t.primarySortKey===e?this.sortCriteriaSubject$.next({primarySortKey:e,ascending:!t.ascending}):this.sortCriteriaSubject$.next({primarySortKey:e,ascending:e==="name"})})}};i.\u0275fac=function(t){return new(t||i)(_(Ge),_(G),_(Je),_(de),_(we),_(Ze),_(Pe),_(Q),_(Ie))},i.\u0275cmp=L({type:i,selectors:[["bkd-presence-control-group"]],standalone:!0,features:[he([Je]),E],decls:5,vars:14,consts:[["loading",""],["checkbox",""],[4,"bkdLet"],[3,"link","params"],[1,"group-header","mb-2","d-flex","justify-content-between"],[1,"d-flex","align-items-baseline"],[1,"ps-3"],["type","button",1,"show","btn","btn-link",3,"click"],["aria-label","edit",1,"btn","btn-primary","btn-icon","me-2",3,"click"],[1,"material-icons"],[1,"group-list"],[1,"group-list-header"],[3,"className","click",4,"ngFor","ngForOf"],[4,"ngIf","ngIfElse"],[3,"click","className"],[1,"sort-direction"],[4,"ngFor","ngForOf"],[1,"group-list-entry"],[1,"checkbox"],["type","checkbox",1,"form-check-input",3,"change","checked"],[1,"name","pe-2"],[1,"group","d-flex","justify-content-between"],["class","inline small",4,"ngIf"],[1,"inline","small"]],template:function(t,o){t&1&&(v(0,hi,25,23,"div",2),l(1,"async"),l(2,"async"),l(3,"async"),l(4,"async")),t&2&&g("bkdLet",Lt(9,pi,m(1,1,o.sortCriteria$),m(2,3,o.sortedEntries$),m(3,5,o.selectionService.selection$),m(4,7,o.groupService.group$)))},dependencies:[ce,hn,N,ie,xe,oe,j,F],styles:['[_nghost-%COMP%]{display:block}.group-header[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{color:#000;font-weight:300;text-decoration:underline;padding-left:.5rem}.group-header[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover{text-decoration-color:#ea161f}.group-list-header[_ngcontent-%COMP%]{cursor:pointer;padding:1rem;display:grid;grid-template-areas:"name group";grid-template-columns:3fr 2fr;border-top:1px solid #dee2e6;border-bottom:2px solid #dee2e6}.group-list-entry[_ngcontent-%COMP%]{padding:1rem;border-bottom:1px solid #dee2e6;display:grid;grid-template-areas:"checkbox name group";grid-template-columns:min-content 3fr 2fr}.checkbox[_ngcontent-%COMP%]{grid-area:checkbox;margin:0;padding:.3rem 1rem 0 0}.checkbox[_ngcontent-%COMP%] input.form-check-input[_ngcontent-%COMP%]{position:static!important;margin:0!important;display:block}.name[_ngcontent-%COMP%]{grid-area:name;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.group[_ngcontent-%COMP%]{grid-area:group}@media (max-width: 750px){.group-list[_ngcontent-%COMP%]{padding-left:0;padding-right:0}.group-list-header[_ngcontent-%COMP%]{grid-template-columns:3fr 1fr}.group-list-entry[_ngcontent-%COMP%]{grid-template-columns:min-content 3fr 1fr}}'],changeDetection:0});let n=i;return n})();function _i(n,i){if(n&1){let r=M();c(0,"div",3)(1,"input",4),b("change",function(){let t=P(r).$implicit;return S(t.selected=!t.selected)}),p(),c(2,"label",5)(3,"i"),d(4),p(),c(5,"div",6),d(6),l(7,"date"),l(8,"date"),p()()()}if(n&2){let r=i.$implicit,e=i.index,t=u();s(),z("id","lesson-presence-",e,""),g("checked",r.selected),s(),K("fw-bold",t.isCurrentLesson(r)),z("for","lesson-presence-",e,""),s(),Re("",r.entry.presenceCategory," material-icons pe-2"),s(),w(r.entry.presenceCategoryIcon),s(2),Mt(" ",U(7,14,r.entry.lessonPresence.LessonDateTimeFrom,"HH:mm"),"\u2013",U(8,17,r.entry.lessonPresence.LessonDateTimeTo,"HH:mm")," ",r.entry.lessonPresence.EventDesignation," ")}}function Ci(n,i){if(n&1){let r=M();c(0,"div",7)(1,"button",8),b("click",function(){P(r);let t=u();return S(t.activeModal.close())}),d(2),l(3,"translate"),p(),c(4,"button",9),b("click",function(){let t=P(r).bkdLet,o=u();return S(o.activeModal.close(t))}),d(5),l(6,"translate"),p()()}if(n&2){let r=i.bkdLet;s(2),x(" ",m(3,3,"presence-control.block-lesson.cancel")," "),s(2),g("disabled",r.length===0),s(),x(" ",m(6,5,"presence-control.block-lesson.save")," ")}}var Un=(()=>{let i=class i{constructor(e){this.activeModal=e,this.blockLessonOptions=[]}ngOnInit(){this.blockLessonOptions=this.buildLessonPresenceOptions()}getSelectedEntries(){return this.blockLessonOptions.filter(({selected:e})=>e).map(({entry:e})=>e)}isCurrentLesson(e){return wn(e.entry.lessonPresence.LessonDateTimeFrom,this.entry.lessonPresence.LessonDateTimeFrom)}buildLessonPresenceOptions(){return this.blockPresenceControlEntries.map(e=>({entry:e,selected:this.entry.confirmationState===e.confirmationState}))}};i.\u0275fac=function(t){return new(t||i)(_(se))},i.\u0275cmp=L({type:i,selectors:[["bkd-presence-control-block-lesson-component"]],inputs:{entry:"entry",blockPresenceControlEntries:"blockPresenceControlEntries"},standalone:!0,features:[E],decls:7,vars:5,consts:[[1,"modal-body"],["class","form-check",4,"ngFor","ngForOf"],["class","modal-footer",4,"bkdLet"],[1,"form-check"],["type","checkbox",1,"form-check-input",3,"change","id","checked"],[1,"form-check-label","d-flex",3,"for"],[1,"d-block","text-truncate"],[1,"modal-footer"],["type","button",1,"btn","btn-outline-secondary",3,"click"],["type","button",1,"btn","btn-primary",3,"click","disabled"]],template:function(t,o){t&1&&(c(0,"div",0)(1,"p"),d(2),l(3,"translate"),p(),c(4,"form"),v(5,_i,9,20,"div",1),p()(),v(6,Ci,7,7,"div",2)),t&2&&(s(2),x(" ",m(3,3,"presence-control.block-lesson.text")," "),s(3),g("ngForOf",o.blockLessonOptions),s(),g("bkdLet",o.getSelectedEntries()))},dependencies:[re,ye,ve,be,N,ce,Ce,j,F],styles:[".checkbox[_ngcontent-%COMP%] input.form-check-input[_ngcontent-%COMP%]{position:static!important;margin:0!important;display:block}.absent[_ngcontent-%COMP%]{color:#ea161f}.present[_ngcontent-%COMP%]{color:#3d8608}.unapproved[_ngcontent-%COMP%]{color:#ffa814}"]});let n=i;return n})();var vi=30;function gt(n){return`blockLesson${n.lessonPresence.Id}`}var et=(()=>{let i=class i{constructor(e,t,o,a){this.state=e,this.lessonPresencesService=t,this.loadingService=o,this.settings=a}getBlockLessonPresenceControlEntries(e){return O([this.state.lessons$.pipe(D(1)),this.loadChangeableLessonPresences(e),this.state.presenceTypes$.pipe(D(1)),this.state.absenceConfirmationStates$.pipe(D(1)),this.state.otherTeachersAbsences$.pipe(D(1))]).pipe(f(([t,o,a,h,C])=>this.filterBlockLessonPresences(e,o).map(k=>tn(t.find(V=>V.id===k.LessonRef.Id.toString()),k,a,h,C))))}filterBlockLessonPresences(e,t){return[...t].sort((o,a)=>o.LessonDateTimeFrom>a.LessonDateTimeFrom?1:-1).reduce((o,a)=>{let h=o[o.length-1];return this.isWithinBlockTime(a,h)?(o.push(a),o):o.find(C=>C.Id===e.lessonPresence.Id)?o:[a]},[])}isWithinBlockTime(e,t){return t?e.LessonDateTimeFrom.getTime()-t.LessonDateTimeTo.getTime()<=vi*60*1e3:!0}loadChangeableLessonPresences(e){return O([this.loadLessonPresences(e),this.state.presenceTypes$.pipe(D(1))]).pipe(f(([t,o])=>t.filter(a=>Zt(a,o.find(h=>h.Id===a.TypeRef.Id)||null,this.settings))))}loadLessonPresences(e){return this.loadingService.load(this.lessonPresencesService.getListByDateStudentClass(e.lessonPresence.LessonDateTimeFrom,e.lessonPresence.StudentRef.Id,e.lessonPresence.StudyClassRef.Id??void 0).pipe(f(t=>t.filter(o=>o.TeacherInformation===e.lessonPresence.TeacherInformation))),gt(e))}};i.\u0275fac=function(t){return new(t||i)(y(G),y(ze),y(pe),y(H))},i.\u0275prov=R({token:i,factory:i.\u0275fac});let n=i;return n})();function yi(n,i){if(n&1&&(c(0,"div"),d(1),l(2,"date"),l(3,"date"),l(4,"addSpace"),p()),n&2){let r=i.$implicit;s(),kt(" ",U(2,5,r.LessonRef.From,"HH:mm"),"\u2013",U(3,8,r.LessonRef.To,"HH:mm")," ",r.LessonRef.EventDesignation,"",U(4,11,":",":")," ",r.Type," ")}}var Hn=(()=>{let i=class i{constructor(e){this.activeModal=e}};i.\u0275fac=function(t){return new(t||i)(_(se))},i.\u0275cmp=L({type:i,selectors:[["bkd-presence-control-preceding-absence"]],inputs:{precedingAbsences:"precedingAbsences"},standalone:!0,features:[E],decls:9,vars:7,consts:[[1,"modal-body"],[4,"ngFor","ngForOf"],[1,"modal-footer"],["type","button",1,"btn","btn-outline-secondary",3,"click"]],template:function(t,o){t&1&&(c(0,"div",0)(1,"p"),d(2),l(3,"translate"),p(),v(4,yi,5,14,"div",1),p(),c(5,"div",2)(6,"button",3),b("click",function(){return o.activeModal.dismiss()}),d(7),l(8,"translate"),p()()),t&2&&(s(2),x(" ",m(3,3,"presence-control.preceding-absence.text")," "),s(2),g("ngForOf",o.precedingAbsences),s(3),x(" ",m(8,5,"presence-control.preceding-absence.cancel")," "))},dependencies:[N,Ce,j,F,un]});let n=i;return n})();var Pi=n=>["student",n,"absences"],Si=n=>["/presence-control/student",n,"absences"];function xi(n,i){if(n&1&&(W(0,"bkd-avatar",9),l(1,"async")),n&2){let r=u();g("studentId",m(1,3,r.studentId$))("link",ne(5,Si,r.entry.lessonPresence.StudentRef.Id.toString()))("linkParams",r.profileReturnParams)}}function Ii(n,i){if(n&1&&(c(0,"span"),d(1),p()),n&2){let r=u(2);s(),w(r.entry.presenceType==null?null:r.entry.presenceType.Designation)}}function wi(n,i){if(n&1){let r=M();c(0,"button",10),b("click",function(){P(r);let t=u();return S(t.updatePresenceType(t.entry))}),v(1,Ii,2,1,"span",11),p()}if(n&2){let r=u();s(),g("ngIf",!(r.entry.presenceType!=null&&r.entry.presenceType.IsIncident))}}function Mi(n,i){n&1&&W(0,"bkd-spinner",16)}function ki(n,i){if(n&1){let r=M();c(0,"button",12),b("click",function(){P(r);let t=u();return S(t.updatePresenceType(t.entry))}),c(1,"div",13)(2,"i",14),d(3),p(),v(4,Mi,1,0,"bkd-spinner",15),p()()}if(n&2){let r=i.bkdLet,e=u();g("disabled",r),s(2),K("invisible",r),s(),w(e.entry.presenceCategoryIcon),s(),g("ngIf",r)}}function Oi(n,i){if(n&1){let r=M();c(0,"button",17),b("click",function(){P(r);let t=u();return S(t.showPrecedingAbsences(t.entry))}),c(1,"i",18),d(2,"info"),p()()}}function Ti(n,i){if(n&1&&(c(0,"span",19),d(1),p()),n&2){let r=u();s(),x(" ",r.entry.lessonPresence.StudyClassNumber," ")}}function $i(n,i){if(n&1){let r=M();c(0,"a",20),b("click",function(){P(r);let t=u();return S(t.updateIncident(t.entry))}),c(1,"i",14),d(2,"edit"),p(),c(3,"span"),d(4),l(5,"translate"),p()()}if(n&2){let r=u();s(4),w(m(5,1,(r.entry.presenceType==null?null:r.entry.presenceType.IsIncident)&&(r.entry.presenceType==null?null:r.entry.presenceType.Designation)||"presence-control.entry.incident"))}}var qn=(()=>{let i=class i{get classNames(){return[this.entry.presenceCategory,this.viewMode].join(" ")}constructor(e,t,o,a){this.toastService=e,this.translate=t,this.modalService=o,this.loadingService=a,this.hasUnconfirmedAbsences=!1,this.showClassName=!1,this.togglePresenceType=new Y,this.changeIncident=new Y,this.entry$=new Te(1),this.studentId$=this.entry$.pipe(f(({lessonPresence:h})=>h.StudentRef.Id)),this.loading$=this.entry$.pipe(T(h=>this.loadingService.loading(gt(h))))}ngOnChanges(e){e.entry&&this.entry$.next(e.entry.currentValue)}get isListViewMode(){return this.viewMode===me.List}updatePresenceType(e){e.canChangePresenceType?this.togglePresenceType.emit(e):this.toastService.warning(this.translate.instant("presence-control.entry.update-warning"))}updateIncident(e){e.canChangeIncident&&this.changeIncident.emit(e)}showPrecedingAbsences(e){let t=this.modalService.open(Hn);t.componentInstance.precedingAbsences=e.precedingAbsences}};i.\u0275fac=function(t){return new(t||i)(_(Pe),_(Q),_(Ie),_(pe))},i.\u0275cmp=L({type:i,selectors:[["bkd-presence-control-entry"]],hostVars:2,hostBindings:function(t,o){t&2&&Pt(o.classNames)},inputs:{entry:"entry",hasUnconfirmedAbsences:"hasUnconfirmedAbsences",viewMode:"viewMode",showClassName:"showClassName",profileReturnParams:"profileReturnParams"},outputs:{togglePresenceType:"togglePresenceType",changeIncident:"changeIncident"},standalone:!0,features:[bt,E],decls:13,vars:16,consts:[["class","avatar large",3,"studentId","link","linkParams",4,"ngIf"],["type","button","class","presence-category designation btn btn-link",3,"click",4,"ngIf"],["type","button","class","presence-category status btn btn-link",3,"disabled","click",4,"bkdLet"],["type","button","class","previously-absent d-flex btn btn-link",3,"click",4,"ngIf"],[1,"student-info",3,"routerLink","queryParams"],[1,"student-name","text-truncate"],["class","study-class text-truncate",4,"ngIf"],[1,"unconfirmed-absences"],["class","incident btn btn-link",3,"click",4,"ngIf"],[1,"avatar","large",3,"studentId","link","linkParams"],["type","button",1,"presence-category","designation","btn","btn-link",3,"click"],[4,"ngIf"],["type","button",1,"presence-category","status","btn","btn-link",3,"click","disabled"],[1,"position-relative"],[1,"material-icons"],["class","inline small",4,"ngIf"],[1,"inline","small"],["type","button",1,"previously-absent","d-flex","btn","btn-link",3,"click"],[1,"material-icons-outlined"],[1,"study-class","text-truncate"],[1,"incident","btn","btn-link",3,"click"]],template:function(t,o){t&1&&(v(0,xi,2,7,"bkd-avatar",0)(1,wi,2,1,"button",1)(2,ki,5,5,"button",2),l(3,"async"),v(4,Oi,3,0,"button",3),c(5,"a",4)(6,"span",5),d(7),p(),v(8,Ti,2,1,"span",6),c(9,"span",7),d(10),l(11,"translate"),p()(),v(12,$i,6,3,"a",8)),t&2&&(g("ngIf",!o.isListViewMode),s(),g("ngIf",o.entry.showDesignation),s(),g("bkdLet",m(3,10,o.loading$)),s(2),g("ngIf",(o.entry.precedingAbsences==null?null:o.entry.precedingAbsences.length)||!1),s(),g("routerLink",ne(14,Pi,o.entry.lessonPresence.StudentRef.Id))("queryParams",o.profileReturnParams),s(2),w(o.entry.lessonPresence.StudentFullName),s(),g("ngIf",o.isListViewMode&&o.showClassName),s(2),x(" ",o.hasUnconfirmedAbsences?m(11,12,"presence-control.entry.unconfirmed-absences"):""," "),s(2),g("ngIf",o.entry.canChangeIncident))},dependencies:[ie,fn,ce,xe,Ue,oe,j,F],styles:['[_nghost-%COMP%]{padding:2rem 1rem;background-color:#fff;display:grid;grid-template-areas:"avatar status designation previously-absent" "avatar student-info student-info student-info" "avatar incident incident incident";grid-template-columns:min-content min-content 3fr min-content}[_nghost-%COMP%] > *[_ngcontent-%COMP%]{align-self:center}.presence-category[_ngcontent-%COMP%]{text-decoration:none}.presence-category[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{top:.1875rem}.absent[_nghost-%COMP%] .presence-category[_ngcontent-%COMP%]{color:#ea161f}.present[_nghost-%COMP%] .presence-category[_ngcontent-%COMP%]{color:#3d8608}.unapproved[_nghost-%COMP%] .presence-category[_ngcontent-%COMP%]{color:#ffa814}.presence-category[_ngcontent-%COMP%] bkd-spinner[_ngcontent-%COMP%]{color:#000;position:absolute;top:4px;left:5px}.designation[_ngcontent-%COMP%], .student-info[_ngcontent-%COMP%], a.incident[_ngcontent-%COMP%], .incident[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.avatar[_ngcontent-%COMP%]{grid-area:avatar;margin-right:1.5rem}.status[_ngcontent-%COMP%]{grid-area:status}.status[_ngcontent-%COMP%] .material-icons[_ngcontent-%COMP%]{font-size:2rem}.designation[_ngcontent-%COMP%]{grid-area:designation;text-align:left;line-height:2.375rem}.previously-absent[_ngcontent-%COMP%]{grid-area:previously-absent;text-decoration:none;color:#00000080;justify-self:end}.student-info[_ngcontent-%COMP%]{grid-area:student-info;display:flex;flex-direction:column;text-decoration:none}.student-info[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:first-child{text-decoration:underline}.student-info[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:first-child:hover{text-decoration-color:#ea161f}.unconfirmed-absences[_ngcontent-%COMP%]{color:#ea161f;font-size:.875rem;line-height:1}.study-class[_ngcontent-%COMP%]{font-size:.875rem;line-height:1}.incident[_ngcontent-%COMP%]{color:#00000080;padding-right:1.5rem;grid-area:incident;display:flex;text-decoration:none}.incident[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{text-decoration:underline}.incident[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:hover{text-decoration-color:#ea161f}.incident[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{margin-right:.3em}.grid[_nghost-%COMP%] .status[_ngcontent-%COMP%], .grid[_nghost-%COMP%] .designation[_ngcontent-%COMP%]{align-self:start;margin-left:-1.5rem;margin-top:-.375rem}.grid[_nghost-%COMP%] .incident[_ngcontent-%COMP%]{align-self:end;margin-left:-1.5rem;margin-bottom:-.375rem}.grid[_nghost-%COMP%] .previously-absent[_ngcontent-%COMP%]{padding-right:0;align-self:start}.grid[_nghost-%COMP%] .unconfirmed-absences[_ngcontent-%COMP%]{height:.875rem}.list[_nghost-%COMP%]{grid-template-areas:"student-info status incidentordesignation previously-absent";grid-template-columns:3fr min-content 4fr 3em;padding:.5rem 1rem}.list[_nghost-%COMP%] .status[_ngcontent-%COMP%]{justify-self:start}.list[_nghost-%COMP%] .student-name[_ngcontent-%COMP%]{line-height:1;margin-bottom:.5rem}.list[_nghost-%COMP%] .incident[_ngcontent-%COMP%], .list[_nghost-%COMP%] .designation[_ngcontent-%COMP%]{grid-area:incidentordesignation}.list[_nghost-%COMP%] .previously-absent[_ngcontent-%COMP%]{padding-right:0}@media (max-width: 750px){.list[_nghost-%COMP%]{grid-template-areas:"student-info student-info student-info previously-absent" "status incidentordesignation incidentordesignation incidentordesignation";grid-template-columns:min-content 1fr 1fr min-content;row-gap:1rem}.list[_nghost-%COMP%] .status[_ngcontent-%COMP%]{padding-left:0;padding-right:0}.list[_nghost-%COMP%] .student-name[_ngcontent-%COMP%]{margin-top:.5rem}.list[_nghost-%COMP%] .previously-absent[_ngcontent-%COMP%]{align-self:start}}']});let n=i;return n})();var Li=(n,i)=>({"btn-link":n,"btn-danger":i}),Ei=n=>["groups",n],Di=n=>({returnparams:n});function Bi(n,i){if(n&1){let r=M();c(0,"div",22),b("click",function(){P(r);let t=u();return S(t.lessonDropdown==null?null:t.lessonDropdown.toggle())}),d(1),l(2,"date"),c(3,"span",23),d(4),l(5,"date"),p()()}if(n&2){let r=u();s(),x(" ",U(2,2,r.selectedLesson.LessonDateTimeFrom,"HH:mm"),"\u2013"),s(3),w(U(5,5,r.selectedLesson.LessonDateTimeTo,"HH:mm"))}}function Fi(n,i){if(n&1){let r=M();c(0,"div",29),b("click",function(){let t=P(r).$implicit,o=u(2);return S(o.selectLessonChange.emit(t))}),c(1,"div",30)(2,"div"),d(3),l(4,"date"),l(5,"date"),p(),c(6,"div",26),d(7),p(),c(8,"div",26),d(9),p()()()}if(n&2){let r=i.$implicit,e=u(2);K("active",r.id===e.selectedLesson.id),s(3),wt(" ",U(4,6,r.LessonDateTimeFrom,"HH:mm"),"\u2013",U(5,9,r.LessonDateTimeTo,"HH:mm")," "),s(4),w(r.eventDesignations),s(2),w(r.studyClassNumbers)}}function ji(n,i){if(n&1&&(c(0,"div",24)(1,"div",25)(2,"div",26),d(3),p(),c(4,"div",26),d(5),p()(),c(6,"div",27),v(7,Fi,10,12,"div",28),p()()),n&2){let r=u();s(3),w(r.selectedLesson.eventDesignations),s(2),w(r.selectedLesson.studyClassNumbers),s(2),g("ngForOf",r.lessons)}}function Vi(n,i){if(n&1){let r=M();c(0,"bkd-caret",31),b("click",function(){P(r);let t=u();return S(t.lessonDropdown==null?null:t.lessonDropdown.toggle())}),p()}if(n&2){let r=u();g("expanded",(r.lessonDropdown==null?null:r.lessonDropdown.isOpen())||!1)}}function Ai(n,i){if(n&1&&(c(0,"a",32),l(1,"async"),l(2,"async"),l(3,"async"),c(4,"i",33),d(5,"groups"),p()()),n&2){let r=u();g("ngClass",Tt(9,Li,m(1,3,r.isGroupSelected$)===!1,m(2,5,r.isGroupSelected$)))("routerLink",ne(12,Ei,r.selectedLesson.id))("queryParams",ne(14,Di,m(3,7,r.state.queryParamsString$)))}}function Ri(n,i){if(n&1){let r=M();c(0,"button",34),b("click",function(){let t=P(r).$implicit,o=u();return S(o.viewModeChange.emit(t.viewMode))}),c(1,"i",33),d(2),p()()}if(n&2){let r=i.$implicit,e=u();K("btn-outline-secondary",r.viewMode===e.viewMode)("btn-link",r.viewMode!==e.viewMode)("active",r.viewMode===e.viewMode),g("disabled",!e.selectedLesson),s(2),w(r.icon)}}var Ni=Ee.prototype._positionMenu;Ee.prototype._positionMenu=function(...i){let r=Ni.apply(this,i);if(this._anchor.nativeElement.id==="lesson-dropdown"){let e=this._bodyContainer||this._menu.nativeElement,t=e.style.transform?.match(/translate\(([0-9-.]+)px, ([0-9-.]+)px\)/);t&&parseFloat(t[1])<0&&(e.style.transform=`translate(0px, ${t[2]}px)`)}return r};var Wn=(()=>{let i=class i{constructor(e,t,o){this.state=e,this.groupService=t,this.presentCount=null,this.absentCount=null,this.unapprovedCount=null,this.absentPrecedingCount=null,this.search="",this.selectLessonChange=new Y,this.selectDateChange=new Y,this.searchChange=new Y,this.viewModeChange=new Y,this.viewModeOptions=[{viewMode:me.List,icon:"list"},{viewMode:me.Grid,icon:"view_module"}],this.isGroupSelected$=this.groupService.group$.pipe(f(zt)),o.popperOptions=a=>ge(ue({},a),{modifiers:a.modifiers?.map(h=>(h.name==="offset"&&(h.options={offset:({placement:C,reference:k,popper:V})=>C==="bottom-start"?[(window.innerWidth-V.width)/2-k.x,0]:[]}),h))})}};i.\u0275fac=function(t){return new(t||i)(_(G),_(de),_(He))},i.\u0275cmp=L({type:i,selectors:[["bkd-presence-control-header"]],viewQuery:function(t,o){if(t&1&&St(Ee,5),t&2){let a;xt(a=It())&&(o.lessonDropdown=a.first)}},inputs:{selectedLesson:"selectedLesson",lessons:"lessons",presentCount:"presentCount",absentCount:"absentCount",unapprovedCount:"unapprovedCount",absentPrecedingCount:"absentPrecedingCount",viewMode:"viewMode",selectDate:"selectDate",search:"search"},outputs:{selectLessonChange:"selectLessonChange",selectDateChange:"selectDateChange",searchChange:"searchChange",viewModeChange:"viewModeChange"},standalone:!0,features:[he([He,{provide:Rt,useClass:Ut},{provide:Nt,useClass:Sn}]),E],decls:40,vars:20,consts:[["d","ngbDatepicker"],[1,"navigation"],[1,"lesson-date"],["type","button",1,"btn","btn-link",3,"click"],[1,"material-icons"],["positionTarget",".lesson-date-input","ngbDatepicker","","placement","bottom-start",1,"lesson-date-input",3,"ngModelChange","ngModel"],["class","lesson-time",3,"click",4,"ngIf"],["ngbDropdown","","class","lesson-description","container","body","display","dynamic","placement","bottom",4,"ngIf"],["class","dropdown-caret",3,"expanded","click",4,"ngIf"],[1,"states"],[1,"state","present"],[1,"count"],[1,"state","absent"],[1,"state","unapproved"],[1,"state","previously-absent"],[1,"material-icons-outlined"],[1,"search-and-views"],[1,"search",3,"valueChange","value","disabled","placeholder","label"],[1,"group-and-views","d-flex","align-items-center"],["type","button","class","group btn me-2 me-sm-4",3,"ngClass","routerLink","queryParams",4,"ngIf"],[1,"views"],["type","button","class","view btn btn-primary btn-icon",3,"disabled","btn-outline-secondary","btn-link","active","click",4,"ngFor","ngForOf"],[1,"lesson-time",3,"click"],[1,"lesson-time-to"],["ngbDropdown","","container","body","display","dynamic","placement","bottom",1,"lesson-description"],["id","lesson-dropdown","ngbDropdownToggle",""],[1,"text-truncate"],["ngbDropdownMenu","","aria-labelledby","lesson-dropdown"],["ngbDropdownItem","",3,"active","click",4,"ngFor","ngForOf"],["ngbDropdownItem","",3,"click"],[1,"lesson-entry"],[1,"dropdown-caret",3,"click","expanded"],["type","button",1,"group","btn","me-2","me-sm-4",3,"ngClass","routerLink","queryParams"],[1,"material-icons","align-middle"],["type","button",1,"view","btn","btn-primary","btn-icon",3,"click","disabled"]],template:function(t,o){if(t&1){let a=M();c(0,"div",1)(1,"div",2)(2,"button",3),b("click",function(){P(a);let C=te(6);return S(C.toggle())}),c(3,"i",4),d(4,"calendar_today"),p()(),c(5,"input",5,0),b("ngModelChange",function(C){return P(a),S(o.selectDateChange.emit(C))}),p()(),v(7,Bi,6,8,"div",6)(8,ji,8,3,"div",7)(9,Vi,1,1,"bkd-caret",8),p(),c(10,"div",9)(11,"div",10)(12,"i",4),d(13,"check_circle"),p(),c(14,"span",11),d(15),p()(),c(16,"div",12)(17,"i",4),d(18,"cancel"),p(),c(19,"span",11),d(20),p()(),c(21,"div",13)(22,"i",4),d(23,"help"),p(),c(24,"span",11),d(25),p()(),c(26,"div",14)(27,"i",15),d(28,"info"),p(),c(29,"span",11),d(30),p()()(),c(31,"div",16)(32,"bkd-resettable-input",17),l(33,"translate"),l(34,"translate"),b("valueChange",function(C){return P(a),S(o.searchChange.emit(C))}),p(),c(35,"div",18),v(36,Ai,6,16,"a",19),l(37,"async"),c(38,"div",20),v(39,Ri,3,8,"button",21),p()()()}t&2&&(s(5),g("ngModel",o.selectDate),s(2),g("ngIf",o.selectedLesson),s(),g("ngIf",o.selectedLesson),s(),g("ngIf",o.lessons.length>0),s(6),w(o.presentCount!==null?o.presentCount:"?"),s(5),w(o.absentCount!==null?o.absentCount:"?"),s(5),w(o.unapprovedCount!==null?o.unapprovedCount:"?"),s(5),w(o.absentPrecedingCount!==null?o.absentPrecedingCount:"?"),s(2),g("value",o.search)("disabled",!o.selectedLesson)("placeholder",m(33,14,"presence-control.header.search-by-name"))("label",m(34,16,"presence-control.header.search")),s(4),g("ngIf",m(37,18,o.selectedLesson&&o.state.groupsAvailability$)),s(3),g("ngForOf",o.viewModeOptions))},dependencies:[Gt,re,jt,Vt,At,ie,Ee,Wt,qt,N,Ht,cn,xn,Dt,Ue,oe,Ce,j,F],styles:['[_nghost-%COMP%]{display:flex;flex-direction:column;padding:.75rem 0}.navigation[_ngcontent-%COMP%]{display:grid;grid-template-areas:". date time dropdown-caret" ". description description dropdown-caret";grid-template-columns:1fr auto auto 1fr;align-items:center}.lesson-date[_ngcontent-%COMP%]{grid-area:date;justify-self:end;display:flex;align-items:center;justify-content:flex-end}.lesson-date[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{padding:0 .5ch 0 0}.lesson-date[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#000;position:relative}.lesson-date-input[_ngcontent-%COMP%]{font-weight:600;background:transparent;border:none;width:11ch}.lesson-time[_ngcontent-%COMP%]{grid-area:time;cursor:pointer}.lesson-description[_ngcontent-%COMP%]{grid-area:description;overflow:hidden;text-align:center;cursor:pointer}.dropdown-toggle[_ngcontent-%COMP%]{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.dropdown-toggle[_ngcontent-%COMP%]:after{display:none}.dropdown-caret[_ngcontent-%COMP%]{grid-area:dropdown-caret;line-height:100%;text-align:left;color:#000}.dropdown-menu[_ngcontent-%COMP%]{width:50ch;padding:0;box-shadow:2px 2px 3px -1px #0003}@media (max-width: 800px){.dropdown-menu[_ngcontent-%COMP%]{width:100vw}}.dropdown-item[_ngcontent-%COMP%]{padding:1rem;border-bottom:1px solid #dee2e6}.states[_ngcontent-%COMP%]{margin:.75rem 0;display:flex;justify-content:center}.state[_ngcontent-%COMP%]{margin-right:7%;display:flex}.state[_ngcontent-%COMP%]:last-child{margin-right:0}@media (min-width: 1000px){.state[_ngcontent-%COMP%]{margin-right:4rem}}.state.present[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#3d8608}.state.absent[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#ea161f}.state.unapproved[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#ffa814}.state.previously-absent[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#00000080}.state[_ngcontent-%COMP%] .count[_ngcontent-%COMP%]{margin-left:.3em;margin-top:1px}.search-and-views[_ngcontent-%COMP%]{padding-top:.75rem;display:flex;justify-content:space-between;border-top:1px solid #dee2e6}.search[_ngcontent-%COMP%]{flex:auto;max-width:300px;margin-right:1rem}.views[_ngcontent-%COMP%]{display:flex}.view[_ngcontent-%COMP%]{color:#4e4e4ef2;background-color:#fff}.view.active[_ngcontent-%COMP%]{color:#fff;background-color:#4e4e4ef2;border:none}.group[_ngcontent-%COMP%], .view[_ngcontent-%COMP%]{text-decoration:none;padding-left:0;padding-right:0;aspect-ratio:1/1;width:calc(.75rem + 2 * var(--bs-border-width) + 1.625rem);border-radius:50%}.group.btn-link[_ngcontent-%COMP%]{color:#000}@media (max-width: 380px){[_nghost-%COMP%]{padding-left:.5rem;padding-right:.5rem}#search-addon[_ngcontent-%COMP%]{padding-left:.5rem;padding-right:.5rem}}@media (max-width: 365px){.lesson-time[_ngcontent-%COMP%]{line-height:1}.lesson-time-to[_ngcontent-%COMP%]{display:block}.dropdown-caret[_ngcontent-%COMP%]{padding-left:0}}']});let n=i;return n})();function Gi(n,i){if(n&1){let r=M();c(0,"div",5)(1,"input",6),b("change",function(){let t=P(r).$implicit,o=u();return S(o.onSelectionChange(t))}),p(),c(2,"label",7),d(3),p()()}if(n&2){let r=i.$implicit,e=i.index,t=u();s(),z("id","incident-",e,""),g("checked",r.id===t.selected.id)("value",r.id),s(),z("for","incident-",e,""),s(),x(" ",r.label," ")}}var Qn=(()=>{let i=class i{constructor(e,t){this.activeModal=e,this.translate=t,this.incidentOptions=[]}ngOnInit(){let e=this.createIncidentOption();this.incidentOptions=this.incidentTypes.map(t=>this.createIncidentOption(t)),this.incidentOptions.unshift(e),this.selected=this.incidentOptions.find(t=>t.id===this.incident?.Id)||e}createIncidentOption(e){return{id:e?e.Id:null,label:e?e.Designation:this.translate.instant("presence-control.incident.no-incident")}}onSelectionChange(e){this.selected=e}getSelectedIncident(){return this.incidentTypes.find(e=>e.Id===this.selected?.id)||null}};i.\u0275fac=function(t){return new(t||i)(_(se),_(Q))},i.\u0275cmp=L({type:i,selectors:[["bkd-presence-control-incident"]],inputs:{incident:"incident",incidentTypes:"incidentTypes"},standalone:!0,features:[E],decls:13,vars:10,consts:[[1,"modal-body"],["class","form-check",4,"ngFor","ngForOf"],[1,"modal-footer"],["type","button",1,"btn","btn-outline-secondary",3,"click"],["type","button",1,"btn","btn-primary",3,"click"],[1,"form-check"],["type","radio","name","incident",1,"form-check-input",3,"change","id","checked","value"],[1,"form-check-label",3,"for"]],template:function(t,o){t&1&&(c(0,"div",0)(1,"p"),d(2),l(3,"translate"),p(),c(4,"form"),v(5,Gi,4,7,"div",1),p()(),c(6,"div",2)(7,"button",3),b("click",function(){return o.activeModal.dismiss()}),d(8),l(9,"translate"),p(),c(10,"button",4),b("click",function(){return o.activeModal.close(o.getSelectedIncident())}),d(11),l(12,"translate"),p()()),t&2&&(s(2),x(" ",m(3,4,"presence-control.incident.text")," "),s(3),g("ngForOf",o.incidentOptions),s(3),x(" ",m(9,6,"presence-control.incident.cancel")," "),s(3),x(" ",m(12,8,"presence-control.incident.save")," "))},dependencies:[re,ye,ve,be,N,j,F],styles:["form[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]:first-child{border-bottom:1px solid #dee2e6;padding-bottom:1rem;margin-bottom:1rem}"]});let n=i;return n})();var Ui=20,Hi=100,je=function(n){return n.AddUpdateAction="ADD",n.RemoveUpdateAction="REMOVE",n}(je||{}),tt=(()=>{let i=class i{constructor(e,t,o,a,h){this.toastService=e,this.translate=t,this.restService=o,this.presenceTypesService=a,this.settings=h,this.destroy$=new $,this.action$=new $,this.pendingUpdates$=this.action$.pipe(Ct(this.reduceUpdates.bind(this),[]),vt()),this.revertUpdates$=new $,this.performUpdates$=this.pendingUpdates$.pipe(nt(Hi),Le(We(ct)),_t(this.performUpdates.bind(this))),this.stateUpdates$=X(this.pendingUpdates$,this.revertUpdates$).pipe(nt(Ui),Le(We(ct))),this.performUpdates$.pipe(q(this.destroy$)).subscribe()}ngOnDestroy(){this.destroy$.next()}updatePresenceType(e,t=null){this.dispatchAddUpdate(e.lessonPresence,t)}performUpdates(e){let t=this.groupUpdates(e);return O(Object.keys(t).reduce((o,a)=>{let h=t[a];return Object.keys(h).forEach(C=>{let k=h[C];o.push(this.performUpdateForGroup(k))}),o},[])).pipe(f(()=>t))}performUpdateForGroup(e){return e.forEach(t=>this.dispatchRemoveUpdate(t.presence)),this.performLessonPresencesUpdatesByIds(e[0].presence.LessonRef.Id,e.map(t=>t.presence.StudentRef.Id),e[0].newPresenceTypeId).pipe(ht(t=>this.revertUpdatesAfterError(e,t)))}performLessonPresencesUpdatesByIds(e,t,o=null){return o?(o?this.presenceTypesService.getPresenceType(o):J(null)).pipe(T(h=>this.restService.editLessonPresences([e],t,h?.Id,Qe(h,this.settings)||void 0,{context:new ot().set(at,{disableErrorHandling:!0})}))):this.restService.removeLessonPresences([e],t,{context:new ot().set(at,{disableErrorHandling:!0})})}revertUpdatesAfterError(e,t){return console.error("Bulk-update of lesson presences failed"),console.error(t),this.toastService.error(this.translate.instant("shared.lesson-presences-update.error")),this.revertUpdates$.next(e.map(o=>ge(ue({},o),{newPresenceTypeId:o.presence.TypeRef.Id}))),J(void 0)}groupUpdates(e){return e.reduce((t,o)=>{let a=String(o.newPresenceTypeId&&o.newPresenceTypeId);return t[a]||(t[a]={}),Array.isArray(t[a][o.presence.LessonRef.Id])||(t[a][o.presence.LessonRef.Id]=[]),t[a][o.presence.LessonRef.Id].push(o),t},{})}reduceUpdates(e,t){switch(t.type){case je.AddUpdateAction:{let{presence:o,newPresenceTypeId:a}=t.payload,h=e.findIndex(Kn(o));return h===-1?[...e,{presence:o,newPresenceTypeId:a}]:[...e.slice(0,h),{presence:e[h].presence,newPresenceTypeId:a},...e.slice(h+1)]}case je.RemoveUpdateAction:return e.filter(We(Kn(t.payload)));default:return e}}dispatchAddUpdate(e,t){this.action$.next({type:je.AddUpdateAction,payload:{presence:e,newPresenceTypeId:t}})}dispatchRemoveUpdate(e){this.action$.next({type:je.RemoveUpdateAction,payload:e})}};i.\u0275fac=function(t){return new(t||i)(y(Pe),y(Q),y(sn),y(Se),y(H))},i.\u0275prov=R({token:i,factory:i.\u0275fac,providedIn:"root"});let n=i;return n})();function Kn(n){return i=>i.presence.LessonRef.Id===n.LessonRef.Id&&i.presence.StudentRef.Id===n.StudentRef.Id}var qi=(n,i,r)=>({lesson:n,lessons:i,entries:r}),Wi=n=>({returnparams:n});function Qi(n,i){if(n&1){let r=M();c(0,"bkd-presence-control-entry",7),l(1,"async"),l(2,"async"),l(3,"async"),l(4,"async"),b("togglePresenceType",function(t){P(r);let o=u(5);return S(o.togglePresenceType(t))})("changeIncident",function(t){P(r);let o=u(5);return S(o.changeIncident(t))}),p()}if(n&2){let r,e=i.$implicit,t=u(5);g("entry",e)("hasUnconfirmedAbsences",m(1,5,t.state.hasUnconfirmedAbsences(e)))("viewMode",m(2,7,t.state.viewMode$))("showClassName",((r=m(3,9,t.state.studyClassCount$))!==null&&r!==void 0?r:0)>1)("profileReturnParams",ne(13,Wi,m(4,11,t.state.queryParamsString$)))}}function Ki(n,i){if(n&1&&(Z(0),c(1,"div"),l(2,"async"),v(3,Qi,5,15,"bkd-presence-control-entry",6),p(),ee()),n&2){let r=u(3).bkdLet,e=u();s(),Re("default-entries entries view-mode-",m(2,4,e.state.viewMode$),""),s(2),g("ngForOf",r.entries)}}function zi(n,i){n&1&&(c(0,"p",8),d(1),l(2,"translate"),p()),n&2&&(s(),x(" ",m(2,1,"presence-control.no-lesson-presences")," "))}function Ji(n,i){if(n&1&&(Z(0),v(1,Ki,4,6,"ng-container",4)(2,zi,3,3,"ng-template",null,2,_e),ee()),n&2){let r=te(3),e=u(2).bkdLet;s(),g("ngIf",(e.entries==null?null:e.entries.length)>0)("ngIfElse",r)}}function Xi(n,i){n&1&&(c(0,"p",8),d(1),l(2,"translate"),p()),n&2&&(s(),w(m(2,1,"presence-control.no-lessons")))}function Yi(n,i){if(n&1){let r=M();Z(0),c(1,"bkd-presence-control-header",5),l(2,"async"),l(3,"async"),l(4,"async"),l(5,"async"),l(6,"async"),l(7,"async"),l(8,"async"),b("searchChange",function(t){P(r);let o=u(2);return S(o.search$.next(t))})("viewModeChange",function(t){P(r);let o=u(2);return S(o.state.setViewMode(t))})("selectDateChange",function(t){P(r);let o=u(2);return S(o.state.setDate(t))})("selectLessonChange",function(t){P(r);let o=u(2);return S(o.state.setLessonId(t.id))}),p(),v(9,Ji,4,2,"ng-container",4)(10,Xi,3,3,"ng-template",null,1,_e),ee()}if(n&2){let r=te(11),e=u().bkdLet,t=u();s(),g("selectedLesson",e.lesson)("lessons",e.lessons)("presentCount",m(2,11,t.state.presentCount$))("absentCount",m(3,13,t.state.absentCount$))("unapprovedCount",m(4,15,t.state.unapprovedCount$))("absentPrecedingCount",m(5,17,t.state.absentPrecedingCount$))("viewMode",m(6,19,t.state.viewMode$))("selectDate",m(7,21,t.state.selectedDate$))("search",m(8,23,t.search$)),s(8),g("ngIf",e.lesson)("ngIfElse",r)}}function Zi(n,i){n&1&&W(0,"bkd-spinner")}function eo(n,i){if(n&1&&(Z(0),v(1,Yi,12,25,"ng-container",4),l(2,"async"),v(3,Zi,1,0,"ng-template",null,0,_e),ee()),n&2){let r=te(4),e=u();s(),g("ngIf",m(2,2,e.state.loading$)===!1)("ngIfElse",r)}}var to=["studentFullName"],Jn=(()=>{let i=class i{constructor(e,t,o,a,h,C,k){this.state=e,this.blockLessons=t,this.lessonPresencesUpdateService=o,this.presenceTypesService=a,this.modalService=h,this.scrollPosition=C,this.route=k,this.search$=new fe(""),this.entries$=O([this.state.presenceControlEntriesByGroup$,this.search$]).pipe(f(([V,Me])=>Pn(V,to,Me)),B(1)),this.destroy$=new $}ngOnInit(){this.route.queryParams.pipe(q(this.destroy$)).subscribe(this.restoreStateFromParams.bind(this))}ngAfterViewInit(){this.scrollPosition.restore()}ngOnDestroy(){this.destroy$.next()}doTogglePresenceType(e){e.forEach(t=>this.state.getNextPresenceType(t).subscribe(o=>this.lessonPresencesUpdateService.updatePresenceType(t,o?o.Id:null)))}togglePresenceType(e){this.blockLessons.getBlockLessonPresenceControlEntries(e).pipe(D(1)).subscribe(t=>{if(t.length===1){let o=t[0];this.doTogglePresenceType([o])}else{let o=this.modalService.open(Un);o.componentInstance.entry=e,o.componentInstance.blockPresenceControlEntries=t,o.result.then(a=>{a&&this.doTogglePresenceType(a)},()=>{})}})}updateIncident(e,t){this.lessonPresencesUpdateService.updatePresenceType(e,t)}changeIncident(e){this.presenceTypesService.incidentTypes$.subscribe(t=>{let o=this.modalService.open(Qn);o.componentInstance.incident=t.find(a=>a.Id===e.presenceType?.Id)||null,o.componentInstance.incidentTypes=t,o.result.then(a=>{this.updateIncident(e,a?.Id||null)},()=>{})})}restoreStateFromParams(e){e.date&&this.state.setDate(Ft(e.date));let t=String(e.lesson);t&&this.state.setLessonId(t),e.viewMode&&An.includes(e.viewMode)&&this.state.setViewMode(e.viewMode)}};i.\u0275fac=function(t){return new(t||i)(_(G),_(et),_(tt),_(Se),_(Ie),_(In),_(Ge))},i.\u0275cmp=L({type:i,selectors:[["bkd-presence-control-list"]],standalone:!0,features:[E],decls:7,vars:14,consts:[["loading",""],["noLessons",""],["noLessonPresences",""],[4,"bkdLet"],[4,"ngIf","ngIfElse"],[3,"searchChange","viewModeChange","selectDateChange","selectLessonChange","selectedLesson","lessons","presentCount","absentCount","unapprovedCount","absentPrecedingCount","viewMode","selectDate","search"],[3,"entry","hasUnconfirmedAbsences","viewMode","showClassName","profileReturnParams","togglePresenceType","changeIncident",4,"ngFor","ngForOf"],[3,"togglePresenceType","changeIncident","entry","hasUnconfirmedAbsences","viewMode","showClassName","profileReturnParams"],[1,"mt-3"]],template:function(t,o){t&1&&(c(0,"h1"),d(1),l(2,"translate"),p(),v(3,eo,5,4,"ng-container",3),l(4,"async"),l(5,"async"),l(6,"async")),t&2&&(s(),w(m(2,2,"presence-control.title")),s(2),g("bkdLet",$t(10,qi,m(4,4,o.state.selectedLesson$),m(5,6,o.state.lessons$),m(6,8,o.entries$))))},dependencies:[ce,ie,Wn,N,qn,xe,oe,j,F],styles:["bkd-presence-control-entry[_ngcontent-%COMP%]{border-bottom:1px solid #dee2e6}.entries.view-mode-grid[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap}.entries.view-mode-grid[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{width:100%}@media (min-width: 400px){.entries.view-mode-grid[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{width:100%;border-right:1px solid #dee2e6}}@media (min-width: 800px){.entries.view-mode-grid[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{width:50%;border-right:1px solid #dee2e6}}@media (min-width: 1200px){.entries.view-mode-grid[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{width:33.3333333333%;border-right:1px solid #dee2e6}}@media (min-width: 1600px){.entries.view-mode-grid[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{width:25%;border-right:1px solid #dee2e6}}@media (min-width: 2000px){.entries.view-mode-grid[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{width:20%;border-right:1px solid #dee2e6}}@media (min-width: 2400px){.entries.view-mode-grid[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{width:16.6666666667%;border-right:1px solid #dee2e6}}[_nghost-%COMP%]{display:block;overflow:hidden;width:100%}.entries.view-mode-grid[_ngcontent-%COMP%]{width:calc(100% + 1px)}"],changeDetection:0});let n=i;return n})();var Xn=(()=>{let i=class i{constructor(e,t){this.state=e,this.lessonPresencesUpdateService=t,this.destroy$=new $}ngOnInit(){this.lessonPresencesUpdateService.stateUpdates$.pipe(q(this.destroy$)).subscribe(e=>this.state.updateLessonPresencesTypes(e))}ngOnDestroy(){this.destroy$.next()}};i.\u0275fac=function(t){return new(t||i)(_(G),_(tt))},i.\u0275cmp=L({type:i,selectors:[["bkd-presence-control"]],standalone:!0,features:[he([G,et,de,on,{provide:Jt,useExisting:G}]),E],decls:1,vars:0,template:function(t,o){t&1&&W(0,"router-outlet")},dependencies:[Bt],changeDetection:0});let n=i;return n})();var Qs=[{path:"",component:Xn,children:[{path:"",component:Jn,data:{restoreScrollPositionFrom:["/presence-control/student/:id/addresses","/presence-control/student/:id/absences","/presence-control/student/:id/grades"]}},_n,{path:"groups/:id",component:Gn}]}];export{Qs as PRESENCE_CONTROL_ROUTES}; diff --git a/public/apps/webapp-schulverwaltung/chunk-W7ASLXRM.js b/public/apps/webapp-schulverwaltung/chunk-W7ASLXRM.js new file mode 100644 index 00000000..87629e69 --- /dev/null +++ b/public/apps/webapp-schulverwaltung/chunk-W7ASLXRM.js @@ -0,0 +1,2 @@ +import{a as _e}from"./chunk-Y4QYVF5K.js";import{a as Te}from"./chunk-HII3S2DL.js";import{b as Ge,c as Ee,d as Pe}from"./chunk-RFO4NYUO.js";import{b as we}from"./chunk-FTDG26ID.js";import{a as _t,b as dt}from"./chunk-SOHFFTKU.js";import{A as Tt,a as Ie,b as be,c as Se,d as ve,e as xe,p as Ce,q as ye,u as yt}from"./chunk-C56YGDXA.js";import{$,$a as v,$c as vt,Ab as g,Ac as a,Bb as b,Bc as R,C as Dt,Cb as K,Cd as ot,Db as Zt,Dd as z,Eb as nt,Ec as E,Fc as C,Fd as Ct,G as Jt,Ga as T,Gb as te,Gc as St,Gd as k,Hd as j,Ia as m,Ic as Ot,J as Qt,Ja as Ft,L as Mt,Mc as o,O as G,Ob as ee,Q as Rt,Rb as rt,Rc as at,Sa as p,Sb as O,Ta as l,Tb as ie,Tc as se,Ua as et,Va as ft,Vb as H,Vc as q,W as F,Wa as ht,Wb as ne,Xb as re,Ya as it,Yc as ae,Z as y,_a as A,_c as kt,a as L,b as U,c as Kt,ca as Y,cb as It,cd as oe,dc as st,dd as de,e as mt,f as N,fd as le,g as pt,ga as W,ha as Z,hd as pe,ia as tt,ib as V,jb as u,k as $t,kb as w,kd as ce,l as qt,lb as x,ld as ue,m as I,md as me,n as ct,nd as ge,od as fe,r as gt,ra as Yt,rd as xt,sd as he,tb as M,ua as d,v as zt,va as D,vb as bt,w as Xt,zc as c}from"./chunk-XTHSYQMN.js";var ai=i=>({width:i});function oi(i,e){if(i&1&&(p(0,"option",3),u(1),g(2,"translate"),l()),i&2){let r=v();m("ngValue",null),d(),x(" ",b(2,2,r.emptyLabel)," ")}}function di(i,e){if(i&1&&(p(0,"option",3),u(1),l()),i&2){let r=e.$implicit;m("ngValue",r),d(),x(" ",r.Value," ")}}var $e=(()=>{let e=class e{constructor(){this.options=[],this.allowEmpty=!0,this.emptyLabel="",this.value=null,this.disabled=!1,this.tabindex=0,this.width="auto",this.valueChange=new Yt,this.options$=new N([]),this.rawValue$=new N(null),this.value$=ct([this.rawValue$,this.options$]).pipe(I(([t,n])=>n&&n.find(s=>s.Key===t)||null))}ngOnChanges(t){t.value&&this.rawValue$.next(t.value.currentValue),t.options&&this.options$.next(t.options.currentValue)}};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=$({type:e,selectors:[["bkd-select"]],inputs:{options:"options",allowEmpty:"allowEmpty",emptyLabel:"emptyLabel",value:"value",disabled:"disabled",tabindex:"tabindex",width:"width"},outputs:{valueChange:"valueChange"},standalone:!0,features:[W,M],decls:5,vars:10,consts:[[1,"form-select",3,"ngModelChange","tabindex","ngStyle","disabled","ngModel"],[3,"ngValue",4,"ngIf"],[3,"ngValue",4,"ngFor","ngForOf"],[3,"ngValue"]],template:function(n,s){n&1&&(p(0,"select",0),g(1,"async"),A("ngModelChange",function(_){return s.valueChange.emit(_&&_.Key)}),T(2,oi,3,4,"option",1)(3,di,2,2,"option",2),u(4,` > +`),l()),n&2&&(It("tabindex",s.tabindex),m("ngStyle",bt(8,ai,s.width))("disabled",s.disabled)("ngModel",b(1,6,s.value$)),d(2),m("ngIf",s.allowEmpty),d(),m("ngForOf",s.options))},dependencies:[xt,ue,me,ce,vt,de,O,rt,H,ie,j,k],changeDetection:0});let i=e;return i})();var De=C({Id:a,Designation:c,StudentCount:a,Number:c});var jt=C({Id:c,TestId:a,CourseRegistrationId:a,GradeId:o(a),GradeValue:o(a),GradeDesignation:o(c),Points:o(a),StudentId:a});var Me=C({Id:a,CourseId:a,Date:at,Designation:c,Weight:a,WeightPercent:a,IsPointGrading:R,MaxPoints:o(a),MaxPointsAdjusted:o(a),IsPublished:R,IsOwner:R,Owner:o(c),GradingScaleId:o(a),Results:o(E(jt))});var Re=C({Id:a}),Fe=St({HRef:o(c)}),li=St({HasEvaluationStarted:R,EvaluationUntil:o(at),HasReviewOfEvaluationStarted:R,HasTestGrading:R,Id:a}),pi=Ot([Re,Fe,li]),ci=St({Id:a,StudentCount:a}),ui=Ot([Re,Fe,ci]),mi=C({Grade:c,AverageTestResult:a,Id:a,StudentId:a}),Bt=C({AverageTestResult:a,CanGrade:R,EventId:a,GradeId:o(a),GradeValue:o(a),Id:a,StudentId:a}),lt=C({HRef:c,Id:a,Number:c,Designation:c,DateFrom:o(at),DateTo:o(at),StatusId:a,GradingScaleId:o(a),FinalGrades:o(E(mi)),Gradings:o(E(Bt)),Tests:o(E(Me)),EvaluationStatusRef:pi,AttendanceRef:ui,ParticipatingStudents:o(E(Ee)),Classes:o(E(De))}),Oe=C({TestResults:E(jt),Gradings:E(Bt)}),ke=C({Gradings:E(Bt)});var Gt=(()=>{let e=class e extends dt{constructor(t,n){super(t,n,lt,"Courses"),this.statusCodec=C(se(this.codec.props,["Id","StatusId","EvaluationStatusRef"]))}getNumberOfCoursesForRating(){return this.http.get(`${this.baseUrl}/?expand=EvaluationStatusRef&fields=Id,StatusId,EvaluationStatusRef&filter.StatusId=;10300;10240`,{headers:{"X-Role-Restriction":"TeacherRole"}}).pipe(G(z(this.statusCodec)),I(t=>t.filter(n=>n.EvaluationStatusRef.HasEvaluationStarted===!0)),I(t=>t.length))}getExpandedCourses(t){return _e(t,"TeacherRole")?this.http.get(`${this.baseUrl}/?expand=EvaluationStatusRef,AttendanceRef,Classes,FinalGrades&filter.StatusId=;${this.settings.eventlist.statusfilter}`,{headers:{"X-Role-Restriction":"TeacherRole"}}).pipe(G(z(lt))):$t([])}getExpandedCourse(t){return this.http.get(`${this.baseUrl}/${t}?expand=ParticipatingStudents,EvaluationStatusRef,Tests,Gradings,FinalGrades,Classes`).pipe(G(ot(lt)))}getExpandedCoursesForDossier(){return this.http.get(`${this.baseUrl}/?expand=Tests,Gradings,FinalGrades,EvaluationStatusRef,ParticipatingStudents,Classes&filter.StatusId=;${this.settings.eventlist.statusfilter}`).pipe(G(z(lt)))}getExpandedCoursesForStudent(){return this.http.get(`${this.baseUrl}/?expand=Tests,Gradings,FinalGrades&filter.StatusId=;${this.settings.eventlist.statusfilter}`,{headers:{"X-Role-Restriction":"StudentRole"}}).pipe(G(z(lt)))}add(t,n,s,f,_,B,h){let S={Tests:[{Date:n,Designation:s,Weight:f,IsPointGrading:_,MaxPoints:B,MaxPointsAdjusted:h}]};return this.http.put(`${this.baseUrl}/${t}/Tests/New`,S).pipe(I(()=>{}))}update(t,n,s,f,_,B,h,S){let Q={Tests:[{Id:n,Designation:s,Date:f,Weight:_,IsPointGrading:B,MaxPoints:h,MaxPointsAdjusted:S}]};return this.http.put(`${this.baseUrl}/${t}/Tests/Update`,Q).pipe(I(()=>{}))}delete(t,n){let s={TestIds:[n]};return this.http.put(`${this.baseUrl}/${t}/Tests/Delete`,s).pipe(I(()=>n))}updateTestResult(t,n){let S=n,{studentId:s,testId:f}=S,_=Kt(S,["studentId","testId"]),B={StudentIds:[s],TestId:f},h="gradeId"in _?U(L({},B),{GradeId:_.gradeId}):U(L({},B),{Points:_.points});return this.http.put(`${this.baseUrl}/${t}/SetTestResult`,h).pipe(G(ot(Oe)),G(({TestResults:Q,Gradings:Wt})=>Q.length<=1&&Wt.length===1?$t({courseId:t,testResult:Q[0]??null,grading:Wt[0]}):qt(()=>new Error("`TestResults` or `Gradings` does not contain a single value"))))}setAverageAsFinalGrade(t){return this.http.put(`${this.baseUrl}/SetAverageTestResult`,t).pipe(G(ot(ke)))}publishTest(t){let n={TestIds:[t]};return this.http.put(`${this.baseUrl}/PublishTest`,n).pipe(I(()=>t))}unpublishTest(t){let n={TestIds:[t]};return this.http.put(`${this.baseUrl}/UnpublishTest`,n).pipe(I(()=>t))}};e.\u0275fac=function(n){return new(n||e)(y(st),y(q))},e.\u0275prov=F({token:e,factory:e.\u0275fac,providedIn:"root"});let i=e;return i})();function Ne(i){return i.length===0?0:Nt(i.map(({value:e,weight:r})=>e*r))/Nt(i.map(({weight:e})=>e))}function At(i){return i.length===0?0:Number(Nt(i)/i.length)}function Nt(i){return i.reduce(gi,0)}function gi(i,e){return i+e}function xn(i,e,r){return i?i.Tests?.reduce((t,n)=>t||n.Id===e&&n.Results?.find(s=>s.TestId===e&&s.StudentId===r)||null,null)??null:null}function Cn(i,e,r){return e.map(t=>t.Id===i.TestId?Ht(i,t,r):t)}function yn(i,e,r){return r.map(t=>t.Id===i?fi(e,t):t)}function Tn(i,e){return e.map(r=>r.Id===i?U(L({},r),{IsPublished:!r.IsPublished}):r)}function _n(i){let e=Ii(i);if(e.length===0)throw new Error("unable to calculate averages without results");return At(e)}function Vt(i){return i.MaxPointsAdjusted||i.MaxPoints}function Gn(i){let e=hi(i);if(e.length===0)throw new Error("unable to calculate averages without results");return At(e)}function J(i,e){return e.Results?.find(r=>r.StudentId===i)}function En(i,e){return e===null?null:e.filter(r=>r.Id!==i)}function Ht(i,e,r){let t=r&&e.Results?.find(s=>s.TestId===i.TestId&&s.StudentId===i.StudentId),n=e.Results?.filter(s=>!(s.TestId===i.TestId&&s.StudentId===i.StudentId))||[];return t&&r==="grade"?i.GradeId=t.GradeId:t&&r==="points"&&(i.Points=t.Points),U(L({},e),{Results:[...n,i]})}function Ve(i){return i.slice().sort((e,r)=>r.Date.getTime()-e.Date.getTime())}function Et(i,e){return e?.find(r=>r.Id===i.GradingScaleId)||null}function fi(i,e){return U(L({},e),{Results:e.Results?.filter(r=>r.StudentId!==i)||[]})}function hi(i){return i.Results?.filter(e=>e.GradeDesignation!==null).map(e=>Number(e.GradeDesignation)).filter(e=>!isNaN(e))||[]}function Ii(i){return i.Results?.map(e=>e.Points!==null?e.Points:Ae).filter(e=>e>Ae)||[]}var Ae=-1;var Lt=C({Id:c,SubscriptionId:a,VssId:a,EventId:a,DropdownItems:o(E(Te)),IdPerson:a,ShowAsRadioButtons:R,Value:o(c)}),He=C({Id:a,CurrentWorkProgressId:o(c||o(a)),EventId:o(a),PersonId:o(a),Status:c,StatusId:o(a),IsOkay:o(R),IsQueued:o(R),EventDesignation:o(c),EventInformation:o(c||a),EventNotes:o(c||a),CheckPersonalInformation:o(R),CorrespondencePersonId:o(a),CorrespondenceAddressTypeId:o(c||a),Billing1PersonId:o(a),Billing1AddressTypeId:o(c||a),Billing2PersonId:o(c||a),Billing2AddressTypeId:o(c||a),KindOfPaymentId1:o(c||a),KindOfPaymentEmail1:o(c||a),KindOfPaymentId2:o(c||a),KindOfPaymentEmail2:o(c||a),IdObject:o(a),IdSubscription:o(a),IdStatus:o(a),AnsweredQuestions:o(c||a),Messages:o(c||a),SubscriptionDetails:o(E(Lt)),HRef:o(c)});var Le=(()=>{let e=class e extends dt{constructor(t,n){super(t,n,Lt,"Subscriptions")}getIdSubscriptionsByStudentAndCourse(t,n){return this.http.get(`${this.settings.apiUrl}/Subscriptions/?filter.PersonId==${t}&filter.EventId=;${n}`).pipe(G(z(He)))}};e.\u0275fac=function(n){return new(n||e)(y(st),y(q))},e.\u0275prov=F({token:e,factory:e.\u0275fac,providedIn:"root"});let i=e;return i})();var Si=C({Id:a,Designation:c}),Ut=C({Id:a,Grades:E(Si)});var Ue=(()=>{let e=class e extends dt{constructor(t,n){super(t,n,Ut,"GradingScales")}getGradingScale(t){return this.http.get(`${this.baseUrl}/${t}`).pipe(G(ot(Ut)))}getGradingScales(t){return gt(t.map(this.getGradingScale.bind(this)))}};e.\u0275fac=function(n){return new(n||e)(y(st),y(q))},e.\u0275prov=F({token:e,factory:e.\u0275fac,providedIn:"root"});let i=e;return i})();var wt=(()=>{let e=class e{constructor(t,n,s,f,_,B){this.coursesRestService=t,this.subscriptionRestService=n,this.reportsService=s,this.loadingService=f,this.gradingScalesRestService=_,this.settings=B,this.studentId$=new pt(1),this.initialStudentCourses$=this.studentId$.pipe(Jt(),G(this.loadCourses.bind(this)),I(h=>h.sort((S,Q)=>S.Designation.localeCompare(Q.Designation))),Mt(1)),this.action$=new pt(1),this.studentCourses$=zt(this.action$,this.initialStudentCourses$.pipe(I(h=>({type:"initializeCourses",payload:h})))).pipe(Qt(this.coursesReducer.bind(this),[]),Mt(1)),this.loading$=this.loadingService.loading$,this.studentCourseIds$=this.studentCourses$.pipe(I(h=>h.flatMap(S=>S.Id))),this.idSubscriptions$=ct([this.studentId$,this.studentCourseIds$]).pipe(G(([h,S])=>this.subscriptionRestService.getIdSubscriptionsByStudentAndCourse(h,S))),this.ids$=this.idSubscriptions$.pipe(I(h=>h.map(S=>S.Id))),this.testReports$=this.ids$.pipe(I(h=>this.reportsService.getTeacherSubscriptionReports(h))),this.tests$=this.studentCourses$.pipe(I(h=>h.flatMap(S=>S.Tests).filter(yt))),this.gradingScaleIdsFromTests$=this.tests$.pipe(I(h=>[...h.map(S=>S.GradingScaleId)].filter(yt).filter(Tt))),this.gradingScaleIdsFromCourses$=this.studentCourses$.pipe(I(h=>h.flatMap(S=>S.GradingScaleId).filter(yt).filter(Tt))),this.gradingScaleIds$=ct([this.gradingScaleIdsFromCourses$,this.gradingScaleIdsFromTests$]).pipe(I(([h,S])=>h.concat(S).filter(Tt))),this.gradingScales$=this.gradingScaleIds$.pipe(G(h=>gt(h.map(S=>this.gradingScalesRestService.getGradingScale(S)))))}setStudentId(t){this.studentId$.next(t)}getFinalGradeForStudent(t,n){return t?.FinalGrades?.find(s=>s.StudentId===n)}getGradingForStudent(t,n){return t?.Gradings?.find(s=>s.StudentId===n)}getGradingScaleOfCourse(t,n){return n?.find(s=>s.Id===t.GradingScaleId)}getGradesForStudent(t,n,s){return t.Tests?.flatMap(f=>({value:Number(Et(f,s)?.Grades.find(B=>B.Id===J(n,f)?.GradeId)?.Designation),weight:f.Weight})).filter(({value:f})=>!!f)||[]}updateStudentCourses(t){this.action$.next({type:"updateCourses",payload:t})}loadCourses(t){return this.loadingService.load(this.coursesRestService.getExpandedCoursesForDossier().pipe(I(n=>n.filter(s=>s.ParticipatingStudents?.find(f=>f.Id===t)))))}coursesReducer(t,n){switch(n.type){case"initializeCourses":return n.payload;case"updateCourses":return this.updateCourses([...t],n.payload);default:return t}}updateCourses(t,n){return t.map(s=>U(L({},s),{Tests:s.Tests!==null?s.Tests.map(f=>f.Id===n.Id?n:f):null}))}};e.\u0275fac=function(n){return new(n||e)(y(Gt),y(Le),y(Pe),y(we),y(Ue),y(q))},e.\u0275prov=F({token:e,factory:e.\u0275fac});let i=e;return i})();var Ke=(()=>{let e=class e{constructor(){}get inIframe(){return window.parent!==window}get window(){return this.inIframe?window.parent:null}get document(){return this.window?.document.documentElement??null}querySelector(t){return this.window?.document?.querySelector("bkd-portal")?.shadowRoot?.querySelector(t)??null}getIframeElement(){return this.querySelector("bkd-content")?.shadowRoot?.querySelector("iframe")??null}getIframeTop(){return this.getIframeElement()?.offsetTop??0}getIFrameBottom(){let t=this.getIframeElement();return t?t.offsetTop+t.offsetHeight:0}};e.\u0275fac=function(n){return new(n||e)},e.\u0275prov=F({token:e,factory:e.\u0275fac,providedIn:"root"});let i=e;return i})();var qe=(()=>{let e=class e{constructor(t,n){this.modal=t,this.portal=n}open(...t){let n=this.modal.open(...t);return this.applyPortalOffsetAndMaxHeight(n),this.disablePortalScrolling(n),n}get activeInstances(){return this.modal.activeInstances}dismissAll(...t){return this.modal.dismissAll(...t)}hasOpenModals(...t){return this.modal.hasOpenModals(...t)}applyPortalOffsetAndMaxHeight(t){let n=this.getModalWindowElement(t);if(!n){console.warn("Trying to apply portal offset to , but element is not present!");return}this.portal.window&&(n.style.top=`${this.getModalIframeOffset()}px`,n.style.maxHeight=`${this.getModalHeight()}px`)}disablePortalScrolling(t){if(this.portal.window&&this.portal.document){let n=this.portal.window.innerWidth-this.portal.document.clientWidth;this.portal.document.style.paddingRight=`${n}px`,this.portal.document.style.overflow="hidden"}t.hidden.subscribe(()=>{this.portal.document&&(this.portal.document.style.paddingRight="0px",this.portal.document.style.overflow="auto")})}getModalWindowElement(t){return t._windowCmptRef?.instance?._elRef?.nativeElement??null}getModalIframeOffset(){return Math.max(this.getViewportTop()-this.portal.getIframeTop(),0)}getModalTop(){return Math.max(this.getViewportTop(),this.portal.getIframeTop())}getModalBottom(){return Math.min(this.getViewportBottom(),this.portal.getIFrameBottom())}getModalHeight(){return this.getModalBottom()-this.getModalTop()}getViewportTop(){return this.portal.window?.scrollY??0}getViewportBottom(){return this.getViewportTop()+this.getViewportHeight()}getViewportHeight(){return this.portal.window?.innerHeight??0}};e.\u0275fac=function(n){return new(n||e)(y(ye),y(Ke))},e.\u0275prov=F({token:e,factory:e.\u0275fac,providedIn:"root"});let i=e;return i})();function Pt(i,e,r){return e?e.Grade:Ti(i,r)||i?.GradeValue}function Ti(i,e){return e?.Grades.find(r=>r.Id===i?.GradeId)?.Designation}var _i="1-3",Xe="\u2013",Je=(()=>{let e=class e{constructor(t){this.locale=t}transform(t,n,s){let f=Number(t??null);return isNaN(f)?Xe:Gi(Number(t??null),s??this.locale,n)}};e.\u0275fac=function(n){return new(n||e)(D(te,16))},e.\u0275pipe=Y({name:"decimalOrDash",type:e,pure:!0,standalone:!0});let i=e;return i})();function Gi(i,e,r){return i===0?Xe:ee(i,e,`1.${Ei(r)}`)}function Ei(i){return i?String(i).includes("-")?String(i):`${i}-${i}`:_i}var Qe=(()=>{let e=class e{constructor(){}getGradeForStudent(){return Pt(this.grading,this.finalGrade,this.gradingScale)}};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=$({type:e,selectors:[["bkd-dossier-grades-final-grade"]],inputs:{finalGrade:"finalGrade",grading:"grading",gradingScale:"gradingScale",average:"average"},standalone:!0,features:[M],decls:14,vars:11,consts:[[1,"final-entry"],["data-testid","final-grade"],["data-testid","average-test-results"]],template:function(n,s){n&1&&(p(0,"div",0)(1,"div"),u(2),g(3,"translate"),l(),p(4,"div",1)(5,"span"),u(6),l()(),p(7,"div"),u(8),g(9,"translate"),l(),p(10,"div",2)(11,"span"),u(12),g(13,"decimalOrDash"),l()()()),n&2&&(d(2),w(b(3,4,"dossier.grade")),d(4),w(s.getGradeForStudent()||"\u2013"),d(2),w(b(9,6,"dossier.average")),d(4),w(K(13,8,s.average,"1-3")))},dependencies:[j,k,Je],styles:[".final-entry[_ngcontent-%COMP%]{padding:1rem;display:grid;grid-template-columns:repeat(2,1fr)}span[_ngcontent-%COMP%]{margin-left:2em}"]});let i=e;return i})();var Ye=(()=>{let e=class e{constructor(t){this.translate=t}transform(t,n,s,f="tests.points"){return t.IsPointGrading&&(t.IsPublished||s)?`${J(n,t)?.Points||"\u2013"} / ${t.MaxPointsAdjusted||t.MaxPoints} ${this.translate.instant(f)}`:""}};e.\u0275fac=function(n){return new(n||e)(D(Ct,16))},e.\u0275pipe=Y({name:"bkdTestPoints",type:e,pure:!0,standalone:!0});let i=e;return i})();var Ze=(()=>{let e=class e{constructor(t){this.translate=t}transform(t){return`${this.translate.instant("tests.factor")} ${t.Weight} (${t.WeightPercent}%)`}};e.\u0275fac=function(n){return new(n||e)(D(Ct,16))},e.\u0275pipe=Y({name:"bkdTestWeight",type:e,pure:!0,standalone:!0});let i=e;return i})();var wi=i=>({maxPoints:i});function Pi(i,e){if(i&1&&(p(0,"div",15),u(1),g(2,"translate"),l()),i&2){let r=v(2);d(),x(" ",K(2,1,"global.validation-errors.invalidPoints",bt(4,wi,r.maxPoints))," ")}}function $i(i,e){if(i&1){let r=it();p(0,"div",11)(1,"label",12),u(2),g(3,"translate"),l(),p(4,"div",6)(5,"input",13,0),A("input",function(){Z(r);let n=V(6),s=v();return tt(s.onPointsChange(n.value))}),l()(),T(7,Pi,3,6,"div",14),l()}if(i&2){let r=v();d(2),w(b(3,8,"dossier.dialog.points")),d(2),Ft("is-invalid",r.pointsInput.errors),d(),Ft("is-invalid",r.pointsInput.errors),It("max",r.maxPoints),m("formControl",r.pointsInput),d(2),m("ngIf",r.pointsInput.errors)}}var ti=500,ei=(()=>{let e=class e{constructor(t,n){this.activeModal=t,this.courseService=n,this.maxPoints=0,this.gradeSubject$=new mt,this.pointsSubject$=new mt,this.closeButtonDisabled$=new N(!1),this.gradingScaleDisabled$=new N(!0),this.grade$=this.gradeSubject$.pipe(Dt(ti)),this.points$=this.pointsSubject$.pipe(Dt(ti),Xt(this.isValid.bind(this)),I(Number)),this.destroy$=new mt}ngOnInit(){this.maxPoints=Vt(this.test),this.pointsInput=new oe({value:this.points,disabled:!1},[kt.min(0),kt.pattern("[0-9]+([\\.][0-9]+)?"),this.maxPointValidator()]),this.gradingScaleDisabled$.next(this.test.IsPointGrading&&this.points>0),this.points$.pipe(Rt(this.destroy$)).subscribe(t=>this.updateTestResult({studentId:this.studentId,testId:this.test.Id,points:t})),this.grade$.pipe(Rt(this.destroy$)).subscribe(t=>this.updateTestResult({studentId:this.studentId,testId:this.test.Id,gradeId:t}))}onGradeChange(t){this.gradeSubject$.next(t)}onPointsChange(t){this.pointsSubject$.next(t),this.gradingScaleDisabled$.next(t.length>0)}updateTestResult(t){this.closeButtonDisabled$.next(!0),this.courseService.updateTestResult(this.test.CourseId,t).subscribe(({testResult:n})=>{this.gradeId=n?.GradeId??null,this.updatedTestResult=n,this.closeButtonDisabled$.next(!1)})}isValid(t){return t===""||isNaN(Number(t))?!1:!(Number(t)<0||Number(t)>this.maxPoints)}maxPointValidator(){return t=>Number(t.value)>Vt(this.test)?{customMax:!0}:null}};e.\u0275fac=function(n){return new(n||e)(D(Ce),D(Gt))},e.\u0275cmp=$({type:e,selectors:[["bkd-dossier-grades-edit"]],inputs:{test:"test",gradeId:"gradeId",gradeOptions:"gradeOptions",points:"points",studentId:"studentId"},standalone:!0,features:[M],decls:19,vars:20,consts:[["pointInput",""],[1,"modal-body"],[1,"mb-4"],["class","form-group row",4,"ngIf"],[1,"form-group","row","mt-2"],["for","grade",1,"col-6","col-form-label"],[1,"col-6"],["id","grade",3,"valueChange","options","value","allowEmpty","disabled"],[1,"text-muted","mt-4"],[1,"modal-footer"],["type","button",1,"btn","btn-primary",3,"click","disabled"],[1,"form-group","row"],["for","points",1,"col-6","col-form-label"],["id","points","type","number","step","0.01","min","0",1,"form-control",3,"input","max","formControl"],["class","invalid-feedback col-6 offset-6","data-testid","validation-error-message",4,"ngIf"],["data-testid","validation-error-message",1,"invalid-feedback","col-6","offset-6"]],template:function(n,s){n&1&&(p(0,"div",1)(1,"p",2),u(2),l(),T(3,$i,8,10,"div",3),p(4,"div",4)(5,"label",5),u(6),g(7,"translate"),l(),p(8,"div",6)(9,"bkd-select",7),g(10,"async"),A("valueChange",function(_){return _&&s.onGradeChange(_)}),l()()(),p(11,"p",8),u(12),g(13,"translate"),l()(),p(14,"div",9)(15,"button",10),g(16,"async"),A("click",function(){return s.activeModal.close(s.updatedTestResult)}),u(17),g(18,"translate"),l()()),n&2&&(d(2),w(s.test.Designation),d(),m("ngIf",s.test.IsPointGrading),d(3),w(b(7,10,"dossier.dialog.grade")),d(3),m("options",s.gradeOptions)("value",s.gradeId)("allowEmpty",!1)("disabled",b(10,12,s.gradingScaleDisabled$)),d(3),x(" ",b(13,14,s.test.IsPointGrading?"dossier.dialog.hint.points":"dossier.dialog.hint.grade")," "),d(3),m("disabled",b(16,16,s.closeButtonDisabled$)),d(2),x(" ",b(18,18,"dossier.dialog.close")," "))},dependencies:[O,xt,ae,le,vt,fe,ge,he,pe,$e,H,j,k]});let i=e;return i})();function Di(i,e){if(i&1){let r=it();p(0,"a",11),A("click",function(){Z(r);let n=v().bkdLet,s=v();return tt(s.editGrading(n))}),p(1,"i",12),u(2,"edit"),l(),p(3,"span",13),u(4),g(5,"async"),l()()}if(i&2){let r=v(2);d(4),w(b(5,1,r.grading$))}}function Mi(i,e){if(i&1&&(p(0,"span",13),u(1),g(2,"async"),l()),i&2){let r=v(2);d(),w(b(2,1,r.grading$))}}function Ri(i,e){if(i&1&&(p(0,"div",14),u(1),g(2,"translate"),l()),i&2){let r=v().bkdLet;d(),x(" ",b(2,1,r.IsPublished?"tests.published":"tests.not-published")," ")}}function Fi(i,e){if(i&1&&(p(0,"div",2)(1,"div",3),u(2),l(),p(3,"div",4),u(4),g(5,"date"),l(),p(6,"div",5),T(7,Di,6,3,"a",6)(8,Mi,3,3,"ng-template",null,0,nt),l(),p(10,"div",7),u(11),g(12,"bkdTestWeight"),l(),p(13,"div",8)(14,"span"),u(15),g(16,"bkdTestPoints"),l()(),p(17,"div",9),u(18),l(),T(19,Ri,3,3,"div",10),l()),i&2){let r=e.bkdLet,t=V(9),n=v();d(2),x(" ",r.Designation," "),d(2),x(" ",K(5,8,r.Date,"dd.MM.yyyy")," "),d(3),m("ngIf",n.isEditable&&r.IsOwner)("ngIfElse",t),d(4),x(" ",b(12,11,r)," "),d(4),w(Zt(16,13,r,n.studentId,n.isEditable,"dossier.points")),d(3),x(" ",r.Owner," "),d(),m("ngIf",n.isEditable)}}var ii=(()=>{let e=class e{constructor(t,n){this.gradeService=t,this.modalService=n,this.test$=new pt(1),this.grading$=this.test$.pipe(I(this.getGrading.bind(this)))}ngOnChanges(t){t.test&&this.test$.next(this.test)}editGrading(t){let n=this.modalService.open(ei,{backdrop:"static"});n.componentInstance.test=t,n.componentInstance.gradeId=this.getGradeId(t),n.componentInstance.gradeOptions=e.mapToOptions(this.gradingScale),n.componentInstance.studentId=this.studentId,n.componentInstance.points=this.getPoints(t),n.result.then(s=>{s&&this.updateStudentGrade(s,t)},()=>{})}updateStudentGrade(t,n){let s=Ht(t,n);this.gradeService.updateStudentCourses(s)}getGrading(t){return this.gradingScale?.Grades.find(n=>n.Id===this.getGradeId(t))?.Designation||"\u2013"}getGradeId(t){return J(this.studentId,t)?.GradeId||null}getPoints(t){return J(this.studentId,t)?.Points||null}static mapToOptions(t){return t?.Grades.map(n=>({Key:n.Id,Value:n.Designation}))||null}};e.\u0275fac=function(n){return new(n||e)(D(wt),D(qe))},e.\u0275cmp=$({type:e,selectors:[["bkd-dossier-single-test"]],inputs:{test:"test",studentId:"studentId",gradingScale:"gradingScale",isEditable:"isEditable"},standalone:!0,features:[W,M],decls:2,vars:3,consts:[["notEditable",""],["class","test-entry",4,"bkdLet"],[1,"test-entry"],["data-testid","test-designation",1,"designation"],["data-testid","test-date",1,"date"],[1,"grade"],["class","btn btn-link","aria-label","edit grade",3,"click",4,"ngIf","ngIfElse"],["data-testid","test-factor",1,"factor"],["data-testid","test-points",1,"points"],["data-testid","test-teacher",1,"teacher"],["class","state","data-testid","test-status",4,"ngIf"],["aria-label","edit grade",1,"btn","btn-link",3,"click"],["data-testid","test-grade-edit-icon",1,"material-icons"],["data-testid","test-grade"],["data-testid","test-status",1,"state"]],template:function(n,s){n&1&&(T(0,Fi,20,18,"div",1),g(1,"async")),n&2&&m("bkdLet",b(1,1,s.test$))},dependencies:[_t,O,H,ne,j,k,Ye,Ze],styles:['.test-entry[_ngcontent-%COMP%]{border-top:1px solid #dee2e6;padding:1rem;display:grid;grid-template-areas:"designation designation grade factor" "date date points ." "teacher teacher . ." "state state . .";grid-template-columns:repeat(4,1fr)}span[_ngcontent-%COMP%]{margin-left:2em}.designation[_ngcontent-%COMP%]{grid-area:designation}.date[_ngcontent-%COMP%]{grid-area:date}.grade[_ngcontent-%COMP%]{grid-area:grade}.grade[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{display:flex;color:#000;padding:0;text-decoration:none}.grade[_ngcontent-%COMP%] a[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{text-decoration:underline}.grade[_ngcontent-%COMP%] a[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:hover{text-decoration-color:#ea161f}.grade[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{margin-right:-1em;color:#00000080}.points[_ngcontent-%COMP%]{grid-area:points;color:#00000080}.teacher[_ngcontent-%COMP%]{grid-area:teacher}.state[_ngcontent-%COMP%]{grid-area:state}@media (max-width: 575.98px){.test-entry[_ngcontent-%COMP%]{grid-template-areas:"designation designation" "date grade" "factor points" "teacher teacher" "state state";grid-template-columns:repeat(2,1fr)}}']});let i=e;return i})();function Oi(i,e){if(i&1&&et(0,"bkd-dossier-single-test",5),i&2){let r=e.$implicit,t=v(3);m("test",r)("studentId",t.studentId)("gradingScale",t.getGradingScaleOfTest(r))("isEditable",t.isEditable)}}function ki(i,e){if(i&1&&(p(0,"div"),et(1,"bkd-dossier-grades-final-grade",3),T(2,Oi,1,4,"bkd-dossier-single-test",4),l()),i&2){let r=v().bkdLet,t=v();d(),m("finalGrade",t.decoratedCourse.finalGrade)("grading",t.decoratedCourse.grading)("gradingScale",t.decoratedCourse.gradingScale)("average",t.decoratedCourse.average),d(),m("ngForOf",r)}}function ji(i,e){i&1&&(p(0,"p",6),u(1),g(2,"translate"),l()),i&2&&(d(),x(" ",b(2,1,"dossier.no-tests")," "))}function Bi(i,e){if(i&1&&(ft(0),T(1,ki,3,5,"div",2)(2,ji,3,3,"ng-template",null,0,nt),ht()),i&2){let r=e.bkdLet,t=V(3);d(),m("ngIf",r.length>0)("ngIfElse",t)}}var ni=(()=>{let e=class e{ngOnChanges(t){t.decoratedCourse&&this.sortedTests$.next(this.sortedTests())}constructor(){this.sortedTests$=new N([])}sortedTests(){return this.decoratedCourse.course.Tests?Ve(this.decoratedCourse.course.Tests):[]}getGradingScaleOfTest(t){return Et(t,this.gradingScales)}};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=$({type:e,selectors:[["bkd-dossier-course-tests"]],inputs:{studentId:"studentId",decoratedCourse:"decoratedCourse",gradingScales:"gradingScales",isEditable:"isEditable"},standalone:!0,features:[W,M],decls:2,vars:3,consts:[["noTests",""],[4,"bkdLet"],[4,"ngIf","ngIfElse"],[3,"finalGrade","grading","gradingScale","average"],[3,"test","studentId","gradingScale","isEditable",4,"ngFor","ngForOf"],[3,"test","studentId","gradingScale","isEditable"],["data-testid","message-no-tests",1,"p-3"]],template:function(n,s){n&1&&(T(0,Bi,4,2,"ng-container",1),g(1,"async")),n&2&&m("bkdLet",b(1,1,s.sortedTests$))},dependencies:[_t,O,Qe,rt,ii,H,j,k]});let i=e;return i})();function Ni(i,e){if(i&1&&(p(0,"span",2),u(1),l()),i&2){let r=v();d(),x(" (",r.grade,")")}}function Ai(i,e){if(i&1&&(p(0,"span",3),u(1),g(2,"number"),l()),i&2){let r=v();d(),x(" (",K(2,1,r.average,"1.1-3"),")")}}var ri=(()=>{let e=class e{constructor(){}get grade(){return this.getGradeForStudent()}getGradeForStudent(){return Pt(this.grading,this.finalGrade,this.gradingScale)}};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=$({type:e,selectors:[["bkd-dossier-grades-course-header"]],inputs:{designation:"designation",finalGrade:"finalGrade",grading:"grading",gradingScale:"gradingScale",average:"average"},standalone:!0,features:[M],decls:3,vars:3,consts:[["class","grade","data-testId","grade",4,"ngIf"],["class","average","data-testId","average",4,"ngIf"],["data-testId","grade",1,"grade"],["data-testId","average",1,"average"]],template:function(n,s){n&1&&(u(0),T(1,Ni,2,1,"span",0)(2,Ai,3,4,"span",1)),n&2&&(w(s.designation),d(),m("ngIf",s.grade),d(),m("ngIf",!s.grade&&s.average))},dependencies:[O,re],styles:[".average[_ngcontent-%COMP%]{color:#00000080}"]});let i=e;return i})();function Vi(i,e){if(i&1&&et(0,"bkd-dossier-course-tests",11),i&2){let r=v().$implicit,t=v(2);m("decoratedCourse",r)("studentId",t.studentId)("gradingScales",t.gradingScales)("isEditable",t.isEditable)}}function Hi(i,e){if(i&1){let r=it();p(0,"div")(1,"div",4)(2,"div",5,1)(4,"div",6)(5,"bkd-student-dossier-entry-header",7),A("click",function(){Z(r);let n=V(3);return tt(n.toggle())}),et(6,"bkd-dossier-grades-course-header",8),l()(),p(7,"div",9)(8,"div",10),T(9,Vi,1,4,"ng-template"),l()()()()()}if(i&2){let r=e.$implicit,t=V(3);d(5),m("opened",!t.collapsed),d(),m("designation",r.course.Designation)("finalGrade",r.finalGrade)("grading",r.grading)("gradingScale",r.gradingScale)("average",r.average)}}function Li(i,e){if(i&1&&(ft(0),T(1,Hi,10,6,"div",3),g(2,"async"),ht()),i&2){let r=v();d(),m("ngForOf",b(2,2,r.decoratedCoursesSubject$))("ngForTrackBy",r.trackByCourseId)}}function Ui(i,e){i&1&&(p(0,"p",12),u(1),g(2,"translate"),l()),i&2&&(d(),x(" ",b(2,1,"dossier.no-courses")," "))}var Ur=(()=>{let e=class e{constructor(t){this.dossierGradeService=t,this.isEditable=!0,this.decoratedCoursesSubject$=new N([])}ngOnChanges(){this.decoratedCoursesSubject$.next(this.decorateCourses())}trackByCourseId(t,n){return n.course.Id}decorateCourses(){return this.courses?.map(t=>{let n=this.dossierGradeService.getFinalGradeForStudent(t,this.studentId),s=this.dossierGradeService.getGradesForStudent(t,this.studentId,this.gradingScales);return{course:t,finalGrade:n,grading:this.dossierGradeService.getGradingForStudent(t,this.studentId),gradingScale:this.dossierGradeService.getGradingScaleOfCourse(t,this.gradingScales),average:n?.AverageTestResult||Ne(s)}})}};e.\u0275fac=function(n){return new(n||e)(D(wt))},e.\u0275cmp=$({type:e,selectors:[["bkd-dossier-grades-view"]],inputs:{courses:"courses",studentId:"studentId",gradingScales:"gradingScales",isEditable:"isEditable"},standalone:!0,features:[W,M],decls:3,vars:2,consts:[["noCourses",""],["courses","ngbAccordionItem"],[4,"ngIf","ngIfElse"],[4,"ngFor","ngForOf","ngForTrackBy"],["ngbAccordion",""],["ngbAccordionItem",""],["ngbAccordionHeader",""],[3,"click","opened"],[3,"designation","finalGrade","grading","gradingScale","average"],["ngbAccordionCollapse",""],["ngbAccordionBody",""],[3,"decoratedCourse","studentId","gradingScales","isEditable"],["data-testid","message-no-courses",1,"py-3"]],template:function(n,s){if(n&1&&T(0,Li,3,4,"ng-container",2)(1,Ui,3,3,"ng-template",null,0,nt),n&2){let f,_=V(2);m("ngIf",((f=s.courses==null?null:s.courses.length)!==null&&f!==void 0?f:0)>0)("ngIfElse",_)}},dependencies:[O,rt,xe,ve,Se,Ge,ri,be,Ie,ni,H,j,k]});let i=e;return i})();export{At as a,xn as b,Cn as c,yn as d,Tn as e,_n as f,Gn as g,En as h,Ve as i,Xe as j,Je as k,Gi as l,$e as m,De as n,Bt as o,Gt as p,Lt as q,Le as r,Ue as s,wt as t,Ke as u,qe as v,Ur as w}; diff --git a/public/apps/webapp-schulverwaltung/chunk-XHR5YBGK.js b/public/apps/webapp-schulverwaltung/chunk-WNMIKIML.js similarity index 99% rename from public/apps/webapp-schulverwaltung/chunk-XHR5YBGK.js rename to public/apps/webapp-schulverwaltung/chunk-WNMIKIML.js index 381b24a2..2b5ddc5b 100644 --- a/public/apps/webapp-schulverwaltung/chunk-XHR5YBGK.js +++ b/public/apps/webapp-schulverwaltung/chunk-WNMIKIML.js @@ -1,2 +1,2 @@ -import{c as Ue}from"./chunk-673RVEOB.js";import{b as J}from"./chunk-KDAC4GJ5.js";import{a as ze}from"./chunk-NYTDIO5P.js";import{a as Ne}from"./chunk-GXZYLK4L.js";import"./chunk-U4HODSW3.js";import{p as Fe}from"./chunk-7LCBKZQT.js";import"./chunk-PSXDSPKS.js";import{e as Y}from"./chunk-C7XT5XXE.js";import{b as we}from"./chunk-YMJC6QZX.js";import"./chunk-Y4QYVF5K.js";import"./chunk-HII3S2DL.js";import{c as U,d as je}from"./chunk-24AFRN2G.js";import"./chunk-RFO4NYUO.js";import"./chunk-5RDJZAUT.js";import"./chunk-DB66EACG.js";import{P as Le,c as Re,j as re,t as Ae,u as Oe}from"./chunk-ZK2MNT7Z.js";import"./chunk-AW7CSGKI.js";import"./chunk-FTDG26ID.js";import{a as W,b as Be,c as Z}from"./chunk-SOHFFTKU.js";import{u as Ee}from"./chunk-C56YGDXA.js";import"./chunk-UX5TA32W.js";import{$ as y,$a as b,Ab as r,Ac as De,Bb as c,Cb as O,Eb as L,Fc as $e,Ga as m,Gd as D,Ha as te,Hd as $,Ia as s,Id as Me,Ja as he,L as x,N as de,O as I,R as pe,Rb as ve,Sa as l,Sb as k,Ta as d,Ua as f,Ub as Se,Va as ie,Vb as B,Vc as w,W as V,Wa as ne,Wb as K,Xa as ae,Ya as be,Z as P,_a as z,ab as ue,bb as fe,ca as le,dc as Ce,f as ee,g as ce,ha as G,ia as q,ib as A,ic as xe,ja as me,jb as h,k as j,kb as T,lb as S,m as u,mb as oe,n as H,nb as ge,pc as Te,qc as Ie,rc as Pe,sb as _e,ta as F,tb as v,ua as o,ub as N,va as _,yb as ye,zc as ke}from"./chunk-XTHSYQMN.js";var at=["*"];function ot(e,t){e&1&&ae(0)}function rt(e,t){if(e&1&&(l(0,"a",4),m(1,ot,1,0,"ng-container",5),d()),e&2){let a=b(),i=A(3);s("routerLink",a.link)("queryParams",a.linkParams),o(),s("ngTemplateOutlet",i)}}function st(e,t){e&1&&ae(0)}function ct(e,t){if(e&1&&(l(0,"a",6),m(1,st,1,0,"ng-container",5),d()),e&2){let a=b(),i=A(3);s("href",a.externalLink,F),o(),s("ngTemplateOutlet",i)}}function dt(e,t){if(e&1&&(l(0,"span",9),h(1),d()),e&2){let a=b(2);o(),T(a.count)}}function pt(e,t){e&1&&(me(),l(0,"svg",10),f(1,"path",11),d())}function lt(e,t){if(e&1&&(l(0,"span",7),h(1),r(2,"translate"),d(),l(3,"div"),fe(4),m(5,dt,2,1,"span",8)(6,pt,2,0,"ng-template",null,1,L),d()),e&2){let a=A(7),i=b();o(),T(c(2,3,i.label)),o(4),s("ngIf",i.hasCount(i.count))("ngIfElse",a)}}var He=(()=>{let t=class t{constructor(){}hasCount(i){return typeof i=="number"&&i>=0}};t.\u0275fac=function(n){return new(n||t)},t.\u0275cmp=y({type:t,selectors:[["bkd-dashboard-action"]],inputs:{label:"label",count:"count",link:"link",linkParams:"linkParams",externalLink:"externalLink"},standalone:!0,features:[v],ngContentSelectors:at,decls:4,vars:2,consts:[["actionContent",""],["icon",""],[3,"routerLink","queryParams",4,"ngIf"],[3,"href",4,"ngIf"],[3,"routerLink","queryParams"],[4,"ngTemplateOutlet"],[3,"href"],[1,"label"],["class","count",4,"ngIf","ngIfElse"],[1,"count"],["xmlns","http://www.w3.org/2000/svg","width","24","height","24","fill","none"],["fill","currentColor","d","m12 20-1.425-1.4 5.6-5.6H4v-2h12.175l-5.6-5.6L12 4l8 8-8 8Z"]],template:function(n,p){n&1&&(ue(),m(0,rt,2,3,"a",2)(1,ct,2,2,"a",3)(2,lt,8,5,"ng-template",null,0,L)),n&2&&(s("ngIf",!p.externalLink),o(),s("ngIf",p.externalLink))},dependencies:[k,Pe,Se,$,D],styles:["a[_ngcontent-%COMP%]{display:flex;gap:1rem;justify-content:space-between;align-items:center;padding:1rem 1.5rem;background:#f7e9d2;text-decoration:none;line-height:1}a[_ngcontent-%COMP%]:hover{background:#f2e0c3}a[_ngcontent-%COMP%]:focus-visible{outline-width:2px;outline-offset:-2px}div[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:1rem}.label[_ngcontent-%COMP%]{font-weight:400}.count[_ngcontent-%COMP%]{font-size:1.5rem}"]});let e=t;return e})();var Ve=(()=>{let t=class t{constructor(){}};t.\u0275fac=function(n){return new(n||t)},t.\u0275cmp=y({type:t,selectors:[["bkd-dashboard-deadline"]],inputs:{count:"count"},standalone:!0,features:[v],decls:3,vars:8,template:function(n,p){n&1&&(h(0),r(1,"translate"),r(2,"addSpace")),n&2&&ge("",c(1,3,"dashboard.actions.deadline"),"",O(2,5,": ",":"),"",p.count,` +import{c as Ue}from"./chunk-673RVEOB.js";import{b as J}from"./chunk-KDAC4GJ5.js";import{a as ze}from"./chunk-NYTDIO5P.js";import{a as Ne}from"./chunk-JV3CBBGP.js";import"./chunk-U4HODSW3.js";import{p as Fe}from"./chunk-W7ASLXRM.js";import"./chunk-PSXDSPKS.js";import{e as Y}from"./chunk-C7XT5XXE.js";import{b as we}from"./chunk-YMJC6QZX.js";import"./chunk-Y4QYVF5K.js";import"./chunk-HII3S2DL.js";import{c as U,d as je}from"./chunk-24AFRN2G.js";import"./chunk-RFO4NYUO.js";import"./chunk-5RDJZAUT.js";import"./chunk-DB66EACG.js";import{P as Le,c as Re,j as re,t as Ae,u as Oe}from"./chunk-ZK2MNT7Z.js";import"./chunk-AW7CSGKI.js";import"./chunk-FTDG26ID.js";import{a as W,b as Be,c as Z}from"./chunk-SOHFFTKU.js";import{u as Ee}from"./chunk-C56YGDXA.js";import"./chunk-UX5TA32W.js";import{$ as y,$a as b,Ab as r,Ac as De,Bb as c,Cb as O,Eb as L,Fc as $e,Ga as m,Gd as D,Ha as te,Hd as $,Ia as s,Id as Me,Ja as he,L as x,N as de,O as I,R as pe,Rb as ve,Sa as l,Sb as k,Ta as d,Ua as f,Ub as Se,Va as ie,Vb as B,Vc as w,W as V,Wa as ne,Wb as K,Xa as ae,Ya as be,Z as P,_a as z,ab as ue,bb as fe,ca as le,dc as Ce,f as ee,g as ce,ha as G,ia as q,ib as A,ic as xe,ja as me,jb as h,k as j,kb as T,lb as S,m as u,mb as oe,n as H,nb as ge,pc as Te,qc as Ie,rc as Pe,sb as _e,ta as F,tb as v,ua as o,ub as N,va as _,yb as ye,zc as ke}from"./chunk-XTHSYQMN.js";var at=["*"];function ot(e,t){e&1&&ae(0)}function rt(e,t){if(e&1&&(l(0,"a",4),m(1,ot,1,0,"ng-container",5),d()),e&2){let a=b(),i=A(3);s("routerLink",a.link)("queryParams",a.linkParams),o(),s("ngTemplateOutlet",i)}}function st(e,t){e&1&&ae(0)}function ct(e,t){if(e&1&&(l(0,"a",6),m(1,st,1,0,"ng-container",5),d()),e&2){let a=b(),i=A(3);s("href",a.externalLink,F),o(),s("ngTemplateOutlet",i)}}function dt(e,t){if(e&1&&(l(0,"span",9),h(1),d()),e&2){let a=b(2);o(),T(a.count)}}function pt(e,t){e&1&&(me(),l(0,"svg",10),f(1,"path",11),d())}function lt(e,t){if(e&1&&(l(0,"span",7),h(1),r(2,"translate"),d(),l(3,"div"),fe(4),m(5,dt,2,1,"span",8)(6,pt,2,0,"ng-template",null,1,L),d()),e&2){let a=A(7),i=b();o(),T(c(2,3,i.label)),o(4),s("ngIf",i.hasCount(i.count))("ngIfElse",a)}}var He=(()=>{let t=class t{constructor(){}hasCount(i){return typeof i=="number"&&i>=0}};t.\u0275fac=function(n){return new(n||t)},t.\u0275cmp=y({type:t,selectors:[["bkd-dashboard-action"]],inputs:{label:"label",count:"count",link:"link",linkParams:"linkParams",externalLink:"externalLink"},standalone:!0,features:[v],ngContentSelectors:at,decls:4,vars:2,consts:[["actionContent",""],["icon",""],[3,"routerLink","queryParams",4,"ngIf"],[3,"href",4,"ngIf"],[3,"routerLink","queryParams"],[4,"ngTemplateOutlet"],[3,"href"],[1,"label"],["class","count",4,"ngIf","ngIfElse"],[1,"count"],["xmlns","http://www.w3.org/2000/svg","width","24","height","24","fill","none"],["fill","currentColor","d","m12 20-1.425-1.4 5.6-5.6H4v-2h12.175l-5.6-5.6L12 4l8 8-8 8Z"]],template:function(n,p){n&1&&(ue(),m(0,rt,2,3,"a",2)(1,ct,2,2,"a",3)(2,lt,8,5,"ng-template",null,0,L)),n&2&&(s("ngIf",!p.externalLink),o(),s("ngIf",p.externalLink))},dependencies:[k,Pe,Se,$,D],styles:["a[_ngcontent-%COMP%]{display:flex;gap:1rem;justify-content:space-between;align-items:center;padding:1rem 1.5rem;background:#f7e9d2;text-decoration:none;line-height:1}a[_ngcontent-%COMP%]:hover{background:#f2e0c3}a[_ngcontent-%COMP%]:focus-visible{outline-width:2px;outline-offset:-2px}div[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:1rem}.label[_ngcontent-%COMP%]{font-weight:400}.count[_ngcontent-%COMP%]{font-size:1.5rem}"]});let e=t;return e})();var Ve=(()=>{let t=class t{constructor(){}};t.\u0275fac=function(n){return new(n||t)},t.\u0275cmp=y({type:t,selectors:[["bkd-dashboard-deadline"]],inputs:{count:"count"},standalone:!0,features:[v],decls:3,vars:8,template:function(n,p){n&1&&(h(0),r(1,"translate"),r(2,"addSpace")),n&2&&ge("",c(1,3,"dashboard.actions.deadline"),"",O(2,5,": ",":"),"",p.count,` `)},dependencies:[$,D,je],styles:["[_nghost-%COMP%]{background:#ea161f;color:#fff;white-space:nowrap;font-weight:500;font-size:.875rem;min-height:1.5rem;display:flex;padding:.375rem .5rem;align-items:center;border-radius:2.5rem}"]});let e=t;return e})();var Ge=$e({Id:De,Holder:ke});var qe=(()=>{let t=class t extends Be{constructor(i,n){super(i,n,Ge,"TeacherSubstitutions")}getTeacherSubstitution(i){return this.getList({params:{"filter.Id":`=${i}`}}).pipe(u(n=>n[0]||null))}};t.\u0275fac=function(n){return new(n||t)(P(Ce),P(w))},t.\u0275prov=V({token:t,factory:t.\u0275fac,providedIn:"root"});let e=t;return e})();var ut=["LessonTeacherRole","ClassTeacherRole","TeacherRole","AbsenceAdministratorRole"],ft=["LessonTeacherRole","TeacherRole","StudentRole","SubstituteAdministratorRole"],gt=["LessonTeacherRole","StudentRole"],E=(()=>{let t=class t{constructor(i,n,p,C,R,tt,it,nt){this.settingsService=i,this.lessonPresencesService=n,this.studentsService=p,this.courseService=C,this.teacherSubstitutionService=R,this.personService=tt,this.storageService=it,this.settings=nt,this.rolesAndPermissions$=this.settingsService.getRolesAndPermissions(),this.studentId$=new ce(1),this.lessonAbsences$=this.studentId$.pipe(I(g=>this.studentsService.getLessonAbsences(g)),x(1)),this.lessonIncidents$=this.studentId$.pipe(I(g=>this.studentsService.getLessonIncidents(g)),x(1)),this.loading$=this.rolesAndPermissions$.pipe(u(g=>g==null)),this.hasSearch$=this.rolesAndPermissions$.pipe(u(this.hasRoles(ut))),this.hasActions$=this.rolesAndPermissions$.pipe(u(this.hasRoles(ft))),this.hasTimetable$=this.rolesAndPermissions$.pipe(u(this.hasRoles(gt))),this.hasLessonTeacherRole$=this.rolesAndPermissions$.pipe(u(this.hasRoles(["LessonTeacherRole"])),x(1)),this.hasTeacherRole$=this.rolesAndPermissions$.pipe(u(this.hasRoles(["TeacherRole"])),x(1)),this.hasStudentRole$=this.rolesAndPermissions$.pipe(u(this.hasRoles(["StudentRole"])),x(1)),this.hasSubstituteAdministratorRole$=this.rolesAndPermissions$.pipe(u(this.hasRoles(["SubstituteAdministratorRole"])),x(1)),this.editAbsencesCount$=this.hasLessonTeacherRole$.pipe(I(g=>g?this.lessonPresencesService.checkableAbsencesCount():j(!1)),x(1)),this.openAbsencesCount$=this.rolesAndPermissions$.pipe(u(this.hasRoles(["LessonTeacherRole","ClassTeacherRole"])),I(g=>g?this.lessonPresencesService.getListOfUnconfirmed():j([])),u(g=>g.length),x(1)),this.myAbsencesCount$=this.hasStudentRole$.pipe(I(g=>g?this.getMyAbsences():j([])),u(this.getMyAbsencesCount.bind(this)),x(1)),this.coursesToRateCount$=this.courseService.getNumberOfCoursesForRating().pipe(de(0),x(1)),this.hasPresenceControl$=this.hasLessonTeacherRole$.pipe(I(g=>g?this.lessonPresencesService.hasLessonsLessonTeacher():j(!1)),x(1)),this.hasOpenAbsences$=this.openAbsencesCount$.pipe(u(g=>g>0),x(1)),this.editAbsencesParams$=this.getFullName().pipe(u(g=>({confirmationStates:this.settings.checkableAbsenceStateId,teacher:g})),x(1));let se=this.storageService.getPayload()?.id_person;se&&this.studentId$.next(Number(se))}hasRoles(i){return n=>(n??[]).some(p=>i.includes(p))}getMyAbsences(){return H([this.studentId$,this.lessonAbsences$,this.lessonIncidents$]).pipe(I(([i,n,p])=>this.loadTimetableEntries(i,n,p).pipe(u(C=>[...n,...p].map(R=>this.withTimetableEntry(R,C)).filter(Ee)))))}getMyAbsencesCount(i){return i?.filter(n=>("ConfirmationStateId"in n?n.ConfirmationStateId:null)===this.settings.unconfirmedAbsenceStateId).length||0}getFullName(){let i=Number(this.storageService.getPayload()?.substitution_id)||null;return i?this.teacherSubstitutionService.getTeacherSubstitution(i).pipe(u(n=>n?.Holder)):this.personService.getMyself().pipe(u(n=>n.FullName))}withTimetableEntry(i,n){return n.find(p=>p.Id===i.LessonRef.Id)?i:null}loadTimetableEntries(i,n,p){return this.studentsService.getTimetableEntries(i,{"filter.Id":`;${[...n,...p].map(C=>C.LessonRef.Id).join(";")}`})}};t.\u0275fac=function(n){return new(n||t)(P(J),P(Y),P(U),P(Fe),P(qe),P(we),P(Me),P(w))},t.\u0275prov=V({token:t,factory:t.\u0275fac});let e=t;return e})();var _t=()=>["/presence-control"],yt=()=>["/edit-absences"],vt=()=>["/open-absences"],St=()=>["/events"],Ct=()=>["/my-absences","report"],xt=()=>["/my-absences"];function Tt(e,t){e&1&&f(0,"bkd-dashboard-action",4),e&2&&s("label","dashboard.actions.presence-control")("link",N(2,_t))}function It(e,t){if(e&1&&(f(0,"bkd-dashboard-action",5),r(1,"async"),r(2,"async")),e&2){let a=b();s("label","dashboard.actions.edit-absences")("link",N(8,yt))("linkParams",c(1,4,a.dashboardService.editAbsencesParams$))("count",c(2,6,a.dashboardService.editAbsencesCount$))}}function Pt(e,t){if(e&1&&(f(0,"bkd-dashboard-action",6),r(1,"async")),e&2){let a=b();s("label","dashboard.actions.open-absences")("link",N(5,vt))("count",c(1,3,a.dashboardService.openAbsencesCount$))}}function kt(e,t){if(e&1&&(f(0,"bkd-dashboard-deadline",8),r(1,"async")),e&2){let a=b(2);s("count",c(1,1,a.dashboardService.coursesToRateCount$))}}function Dt(e,t){if(e&1&&(l(0,"bkd-dashboard-action",4),m(1,kt,2,3,"bkd-dashboard-deadline",7),r(2,"async"),d()),e&2){let a,i=b();s("label","dashboard.actions.tests")("link",N(5,St)),o(),s("ngIf",(a=c(2,3,i.dashboardService.coursesToRateCount$))!==null&&a!==void 0?a:!1)}}function $t(e,t){e&1&&f(0,"bkd-dashboard-action",4),e&2&&s("label","dashboard.actions.my-absences-report")("link",N(2,Ct))}function Mt(e,t){if(e&1&&(f(0,"bkd-dashboard-action",6),r(1,"async")),e&2){let a=b();s("label","dashboard.actions.my-absences")("link",N(5,xt))("count",c(1,3,a.dashboardService.myAbsencesCount$))}}function Et(e,t){if(e&1&&f(0,"bkd-dashboard-action",9),e&2){let a=b();s("label","dashboard.actions.substitutions")("externalLink",a.substitutionsAdminLink)}}var We=(()=>{let t=class t{constructor(i,n){this.dashboardService=i,this.settings=n}get substitutionsAdminLink(){return this.settings.dashboard.substitutionsAdminLink}};t.\u0275fac=function(n){return new(n||t)(_(E),_(w))},t.\u0275cmp=y({type:t,selectors:[["bkd-dashboard-actions"]],standalone:!0,features:[v],decls:15,vars:23,consts:[[3,"label","link",4,"ngIf"],[3,"label","link","linkParams","count",4,"ngIf"],[3,"label","link","count",4,"ngIf"],[3,"label","externalLink",4,"ngIf"],[3,"label","link"],[3,"label","link","linkParams","count"],[3,"label","link","count"],[3,"count",4,"ngIf"],[3,"count"],[3,"label","externalLink"]],template:function(n,p){n&1&&(m(0,Tt,1,3,"bkd-dashboard-action",0),r(1,"async"),m(2,It,3,9,"bkd-dashboard-action",1),r(3,"async"),r(4,"async"),m(5,Pt,2,6,"bkd-dashboard-action",2),r(6,"async"),m(7,Dt,3,6,"bkd-dashboard-action",0),r(8,"async"),m(9,$t,1,3,"bkd-dashboard-action",0),r(10,"async"),m(11,Mt,2,6,"bkd-dashboard-action",2),r(12,"async"),m(13,Et,1,2,"bkd-dashboard-action",3),r(14,"async")),n&2&&(s("ngIf",c(1,7,p.dashboardService.hasPresenceControl$)),o(2),s("ngIf",c(3,9,p.dashboardService.hasLessonTeacherRole$)&&c(4,11,p.dashboardService.editAbsencesParams$)),o(3),s("ngIf",c(6,13,p.dashboardService.hasOpenAbsences$)),o(2),s("ngIf",c(8,15,p.dashboardService.hasTeacherRole$)),o(2),s("ngIf",c(10,17,p.dashboardService.hasStudentRole$)),o(2),s("ngIf",c(12,19,p.dashboardService.hasStudentRole$)),o(2),s("ngIf",c(14,21,p.dashboardService.hasSubstituteAdministratorRole$)))},dependencies:[k,He,Ve,B],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:.5rem}"]});let e=t;return e})();var Ye=(()=>{let t=class t{constructor(i,n){this.studentsRestService=i,this.router=n}navigateToDossier(i){let n=Number(i);this.router.navigate(["dashboard","student",n,"addresses"])}};t.\u0275fac=function(n){return new(n||t)(_(U),_(Ie))},t.\u0275cmp=y({type:t,selectors:[["bkd-dashboard-search"]],standalone:!0,features:[v],decls:1,vars:2,consts:[[3,"valueChange","typeaheadService","placeholder"]],template:function(n,p){n&1&&(l(0,"bkd-typeahead",0),z("valueChange",function(R){return R&&p.navigateToDossier(R)}),d()),n&2&&s("typeaheadService",p.studentsRestService)("placeholder","dashboard.search.placeholder")},dependencies:[ze],styles:["[_nghost-%COMP%]{display:block;padding:.75rem;background:#f7e9d2}"]});let e=t;return e})();var Ze=(()=>{let t=class t{constructor(i){this.sanitizer=i}transform(i,n){switch(n){case"html":return this.sanitizer.bypassSecurityTrustHtml(i);case"style":return this.sanitizer.bypassSecurityTrustStyle(i);case"script":return this.sanitizer.bypassSecurityTrustScript(i);case"url":return this.sanitizer.bypassSecurityTrustUrl(i);case"resourceUrl":return this.sanitizer.bypassSecurityTrustResourceUrl(i);default:throw new Error(`Invalid safe type specified: ${n}`)}}};t.\u0275fac=function(n){return new(n||t)(_(xe,16))},t.\u0275pipe=le({name:"safe",type:t,pure:!0,standalone:!0});let e=t;return e})();function Rt(e,t){e&1&&(l(0,"th"),h(1),r(2,"translate"),d()),e&2&&(o(),S(" ",c(2,1,"dashboard.timetable.table.teacher")," "))}function At(e,t){e&1&&(l(0,"th"),h(1),r(2,"translate"),d()),e&2&&(o(),S(" ",c(2,1,"dashboard.timetable.table.room")," "))}function Ot(e,t){if(e&1&&(l(0,"a",12),h(1),l(2,"span",13),h(3),d()()),e&2){let a=b().$implicit,i=b(2);s("href",i.buildLink(a.eventId),F),o(),S(" ",a.subject,""),o(2),S(", ",a.studyClass,"")}}function Lt(e,t){if(e&1&&h(0),e&2){let a=b().$implicit;S(" ",a.subject," ")}}function Bt(e,t){if(e&1&&(l(0,"td",14),h(1),r(2,"translate"),d()),e&2){let a=b().$implicit;o(),oe(" ",c(2,2,"dashboard.timetable.table.study-class"),": ",a.studyClass," ")}}function wt(e,t){if(e&1&&(l(0,"td",15),h(1),d()),e&2){let a=b().$implicit;o(),S(" ",a.teacher," ")}}function jt(e,t){e&1&&(l(0,"span",18),h(1),r(2,"translate"),d()),e&2&&(o(),T(c(2,1,"dashboard.timetable.table.room")))}function Ft(e,t){if(e&1&&(l(0,"td",16),m(1,jt,3,3,"span",17),h(2),d()),e&2){let a=b().$implicit;o(),s("ngIf",a.room),o(),S(" ",a.room," ")}}function Nt(e,t){if(e&1&&(l(0,"tr")(1,"td",6),h(2),r(3,"date"),r(4,"date"),d(),l(5,"td",7),m(6,Ot,4,3,"a",8),r(7,"async"),m(8,Lt,1,1,"ng-template",null,1,L),d(),m(10,Bt,3,4,"td",9),r(11,"async"),m(12,wt,2,1,"td",10),r(13,"async"),m(14,Ft,3,2,"td",11),r(15,"async"),d()),e&2){let a=t.$implicit,i=A(9),n=b(2);o(2),oe(" ",O(3,7,a.from,"HH:mm"),"\u2013",O(4,10,a.until,"HH:mm")," "),o(4),s("ngIf",c(7,13,n.isTeacher$))("ngIfElse",i),o(4),s("ngIf",c(11,15,n.isTeacher$)),o(2),s("ngIf",c(13,17,n.isStudent$)),o(2),s("ngIf",c(15,19,n.isStudent$))}}function zt(e,t){if(e&1&&(l(0,"table",3)(1,"thead")(2,"tr")(3,"th"),h(4),r(5,"translate"),d(),l(6,"th"),h(7),r(8,"translate"),d(),m(9,Rt,3,3,"th",4),r(10,"async"),m(11,At,3,3,"th",4),r(12,"async"),d()(),l(13,"tbody"),m(14,Nt,16,21,"tr",5),d()()),e&2){let a=b();o(4),T(c(5,5,"dashboard.timetable.table.time")),o(3),T(c(8,7,"dashboard.timetable.table.subject")),o(2),s("ngIf",c(10,9,a.isStudent$)),o(2),s("ngIf",c(12,11,a.isStudent$)),o(3),s("ngForOf",a.entries)}}function Ut(e,t){e&1&&(l(0,"p"),h(1),r(2,"translate"),d()),e&2&&(o(),T(c(2,1,"dashboard.timetable.no-entries")))}var Je=(()=>{let t=class t{constructor(i,n){this.dashboardService=i,this.settings=n,this.entries=[],this.isStudent$=this.dashboardService.hasStudentRole$,this.isTeacher$=this.dashboardService.hasLessonTeacherRole$}buildLink(i){return this.settings.eventlist.eventdetail.replace(":id",String(i))}};t.\u0275fac=function(n){return new(n||t)(_(E),_(w))},t.\u0275cmp=y({type:t,selectors:[["bkd-dashboard-timetable-table"]],inputs:{entries:"entries"},standalone:!0,features:[v],decls:3,vars:2,consts:[["noEntries",""],["noLink",""],["class","table",4,"ngIf","ngIfElse"],[1,"table"],[4,"ngIf"],[4,"ngFor","ngForOf"],[1,"time"],[1,"subject"],["target","_parent",3,"href",4,"ngIf","ngIfElse"],["class","study-class",4,"ngIf"],["class","teacher",4,"ngIf"],["class","room",4,"ngIf"],["target","_parent",3,"href"],[1,"subject-study-class"],[1,"study-class"],[1,"teacher"],[1,"room"],["class","room-label",4,"ngIf"],[1,"room-label"]],template:function(n,p){if(n&1&&m(0,zt,15,13,"table",2)(1,Ut,3,3,"ng-template",null,0,L),n&2){let C=A(2);s("ngIf",p.entries.length>0)("ngIfElse",C)}},dependencies:[k,ve,B,K,$,D],styles:['td[_ngcontent-%COMP%], th[_ngcontent-%COMP%]{padding:1rem 1.75rem}.room-label[_ngcontent-%COMP%], td.study-class[_ngcontent-%COMP%]{display:none}@media (max-width: 767.98px){table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%]{display:none}table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%]{border-top:1px solid var(--bs-border-color)}table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;grid-template-areas:"time room" "subject subject" "study-class study-class" "teacher teacher";gap:.5rem;padding:1rem;border-bottom:1px solid var(--bs-border-color)}table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{border-bottom:0;padding:0}table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td.time[_ngcontent-%COMP%]{grid-area:time;font-size:.875rem;line-height:1.125rem;font-weight:300}table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td.subject[_ngcontent-%COMP%]{grid-area:subject;font-size:1rem;line-height:1.25rem;font-weight:400}table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td.teacher[_ngcontent-%COMP%]{grid-area:teacher;font-size:.8125rem;line-height:1.0625rem;font-weight:300}table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td.room[_ngcontent-%COMP%]{grid-area:room;text-align:right;font-size:.875rem;line-height:1.125rem;font-weight:300}table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td.study-class[_ngcontent-%COMP%]{grid-area:study-class;font-size:.8125rem;line-height:1.0625rem;font-weight:300}td.study-class[_ngcontent-%COMP%]{display:block}.subject-study-class[_ngcontent-%COMP%]{display:none}.room-label[_ngcontent-%COMP%]{display:inline}}']});let e=t;return e})();function Ht(e,t){if(e&1&&(l(0,"a",9),r(1,"safe"),h(2),r(3,"translate"),d()),e&2){let a=t.ngIf;s("href",O(1,2,a,"url"),F),o(2),S(" ",c(3,5,"dashboard.timetable.subscribe-calendar")," ")}}function Vt(e,t){if(e&1&&(l(0,"a",13),r(1,"safe"),h(2),r(3,"translate"),d()),e&2){let a=t.ngIf;s("href",O(1,2,a,"url"),F),o(2),S(" ",c(3,5,"dashboard.timetable.subscribe-calendar")," ")}}function Gt(e,t){if(e&1&&(ie(0),f(1,"bkd-dashboard-timetable-table",11),m(2,Vt,4,7,"a",12),r(3,"async"),ne()),e&2){let a=b().bkdLet,i=b();o(),s("entries",a),o(),s("ngIf",c(3,2,i.getSubscribeCalendarUrl()))}}function qt(e,t){if(e&1&&(ie(0),m(1,Gt,4,4,"ng-container",10),r(2,"async"),ne()),e&2){let a=b(),i=A(21);o(),s("ngIf",c(2,2,a.loading$)===!1)("ngIfElse",i)}}function Kt(e,t){e&1&&f(0,"bkd-spinner")}var Wt="cal",Qe=(()=>{let t=class t{constructor(i,n,p,C){this.studentsService=i,this.lessonPresencesService=n,this.userSettings=p,this.dashboardService=C,this.studentId$=this.dashboardService.studentId$,this.isTeacher$=this.dashboardService.hasLessonTeacherRole$,this.isStudent$=this.dashboardService.hasStudentRole$,this.date$=new ee(re(new Date)),this.loading$=new ee(!0),this.timetableEntries$=this.loadTimetableEntries()}gotoToday(){this.loading$.next(!0),this.date$.next(re(new Date))}gotoPreviousDay(){this.loading$.next(!0),this.date$.next(Oe(this.date$.getValue(),1))}gotoNextDay(){this.loading$.next(!0),this.date$.next(Re(this.date$.getValue(),1))}getSubscribeCalendarUrl(){return this.userSettings.getSetting(Wt)}loadTimetableEntries(){return H([this.isTeacher$,this.isStudent$]).pipe(I(([i,n])=>i?this.loadTeacherTimetableEntries():n?this.loadStudentTimetableEntries():j([])),pe(()=>this.loading$.next(!1)))}loadTeacherTimetableEntries(){return this.date$.pipe(I(i=>this.lessonPresencesService.getLessonsByDate(i)),u(Ue),u(i=>i.map(this.convertLesson.bind(this))))}loadStudentTimetableEntries(){return H([this.studentId$,this.date$]).pipe(I(([i,n])=>this.studentsService.getTimetableEntries(i,{"filter.From":`=${Ae(n,"yyyy-MM-dd")}`,sort:"From,To"})),u(i=>i.map(this.convertTimetableEntry.bind(this))))}convertLesson(i){return{id:i.LessonRef.Id,from:i.LessonDateTimeFrom,until:i.LessonDateTimeTo,eventId:i.EventRef.Id,subject:i.EventDesignation,studyClass:i.StudyClassNumber}}convertTimetableEntry(i){return{id:i.Id,from:i.From,until:i.To,eventId:i.EventId,subject:i.EventDesignation,room:i.EventLocation||void 0,teacher:i.EventManagerInformation||void 0}}};t.\u0275fac=function(n){return new(n||t)(_(U),_(Y),_(J),_(E))},t.\u0275cmp=y({type:t,selectors:[["bkd-dashboard-timetable"]],standalone:!0,features:[v],decls:22,vars:21,consts:[["loading",""],[1,"header"],["type","button",1,"btn","btn-primary","today",3,"click"],["type","button",1,"btn","btn-secondary","previous-day",3,"click"],[1,"material-icons"],["type","button",1,"btn","btn-secondary","next-day",3,"click"],[1,"date"],["target","_parent","class","btn btn-secondary subscribe-calendar-header",3,"href",4,"ngIf"],[4,"bkdLet"],["target","_parent",1,"btn","btn-secondary","subscribe-calendar-header",3,"href"],[4,"ngIf","ngIfElse"],[3,"entries"],["target","_parent","class","btn btn-secondary subscribe-calendar-bottom",3,"href",4,"ngIf"],["target","_parent",1,"btn","btn-secondary","subscribe-calendar-bottom",3,"href"]],template:function(n,p){if(n&1){let C=be();l(0,"div",1)(1,"button",2),z("click",function(){return G(C),q(p.gotoToday())}),h(2),r(3,"translate"),d(),l(4,"button",3),r(5,"translate"),z("click",function(){return G(C),q(p.gotoPreviousDay())}),l(6,"span",4),h(7,"chevron_left"),d()(),l(8,"button",5),r(9,"translate"),z("click",function(){return G(C),q(p.gotoNextDay())}),l(10,"span",4),h(11,"chevron_right"),d()(),l(12,"div",6),h(13),r(14,"async"),r(15,"date"),d(),m(16,Ht,4,7,"a",7),r(17,"async"),d(),m(18,qt,3,4,"ng-container",8),r(19,"async"),m(20,Kt,1,0,"ng-template",null,0,L)}n&2&&(o(2),S(" ",c(3,6,"dashboard.timetable.today")," "),o(2),te("aria-label",c(5,8,"dashboard.timetable.previousDay")),o(4),te("aria-label",c(9,10,"dashboard.timetable.nextDay")),o(5),T(O(15,14,c(14,12,p.date$),"E, dd. MMMM yyyy")),o(3),s("ngIf",c(17,17,p.getSubscribeCalendarUrl())),o(2),s("bkdLet",c(19,19,p.timetableEntries$)))},dependencies:[k,W,Je,Z,B,K,$,D,Ze],styles:["[_nghost-%COMP%]{display:block;margin-bottom:1rem}.header[_ngcontent-%COMP%]{margin-top:1rem;margin-bottom:2rem;display:flex;align-items:center;gap:1rem}.previous-day[_ngcontent-%COMP%], .next-day[_ngcontent-%COMP%]{padding-left:.375rem;padding-right:.375rem}.date[_ngcontent-%COMP%]{font-size:1.25rem;font-weight:600}.subscribe-calendar-header[_ngcontent-%COMP%]{margin-left:auto}.subscribe-calendar-bottom[_ngcontent-%COMP%]{display:none}a.btn[_ngcontent-%COMP%]{text-decoration:none}@media (max-width: 767.98px){.subscribe-calendar-header[_ngcontent-%COMP%]{display:none}.subscribe-calendar-bottom[_ngcontent-%COMP%]{display:block;margin-top:2rem}}@media (max-width: 767.98px) and (max-width: 575.98px){.header[_ngcontent-%COMP%]{flex-wrap:wrap-reverse}.header[_ngcontent-%COMP%] .date[_ngcontent-%COMP%]{width:100%}}"]});let e=t;return e})();var Yt=(e,t,a,i)=>({loading:e,hasSearch:t,hasActions:a,hasTimetable:i});function Zt(e,t){e&1&&f(0,"bkd-spinner")}function Jt(e,t){e&1&&(l(0,"p"),h(1),r(2,"translate"),d()),e&2&&(o(),S(" ",c(2,1,"dashboard.no-access")," "))}function Qt(e,t){e&1&&(l(0,"div")(1,"h2"),h(2),r(3,"translate"),d(),f(4,"bkd-dashboard-search"),d()),e&2&&(o(2),T(c(3,1,"dashboard.search.title")))}function Xt(e,t){e&1&&(l(0,"div")(1,"h2"),h(2),r(3,"translate"),d(),f(4,"bkd-dashboard-actions"),d()),e&2&&(o(2),T(c(3,1,"dashboard.actions.title")))}function ei(e,t){if(e&1&&(l(0,"div",5),m(1,Qt,5,3,"div",1)(2,Xt,5,3,"div",1),d()),e&2){let a=b().bkdLet;o(),s("ngIf",a.hasSearch),o(),s("ngIf",a.hasActions)}}function ti(e,t){e&1&&(l(0,"div",6)(1,"h2"),h(2),r(3,"translate"),d(),f(4,"bkd-dashboard-timetable"),d()),e&2&&(o(2),T(c(3,1,"dashboard.timetable.title")))}function ii(e,t){if(e&1&&(l(0,"div")(1,"h1"),h(2),r(3,"translate"),d(),m(4,Zt,1,0,"bkd-spinner",1)(5,Jt,3,3,"p",1),l(6,"div",2),m(7,ei,3,2,"div",3)(8,ti,5,3,"div",4),d()()),e&2){let a=t.bkdLet;o(),he("visually-hidden",a.loading||a.hasSearch||a.hasActions||a.hasTimetable),o(),S(" ",c(3,7,"dashboard.heading")," "),o(2),s("ngIf",a.loading),o(),s("ngIf",!a.loading&&!a.hasSearch&&!a.hasActions&&!a.hasTimetable),o(2),s("ngIf",a.hasSearch||a.hasActions),o(),s("ngIf",a.hasTimetable)}}var Xe=(()=>{let t=class t{constructor(i){this.dashboardService=i}};t.\u0275fac=function(n){return new(n||t)(_(E))},t.\u0275cmp=y({type:t,selectors:[["bkd-dashboard-layout"]],standalone:!0,features:[v],decls:5,vars:14,consts:[[4,"bkdLet"],[4,"ngIf"],[1,"columns"],["class","search-actions-column",4,"ngIf"],["class","timetable-column",4,"ngIf"],[1,"search-actions-column"],[1,"timetable-column"]],template:function(n,p){n&1&&(m(0,ii,9,9,"div",0),r(1,"async"),r(2,"async"),r(3,"async"),r(4,"async")),n&2&&s("bkdLet",ye(9,Yt,c(1,1,p.dashboardService.loading$),c(2,3,p.dashboardService.hasSearch$),c(3,5,p.dashboardService.hasActions$),c(4,7,p.dashboardService.hasTimetable$)))},dependencies:[W,k,Z,Ye,We,Qe,B,$,D],styles:[".columns[_ngcontent-%COMP%]{display:flex;flex-direction:column}.columns[_ngcontent-%COMP%], .search-actions-column[_ngcontent-%COMP%]{gap:3rem}.search-actions-column[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;max-width:40rem}.timetable-column[_ngcontent-%COMP%]{flex:2}@media (min-width: 992px){.columns[_ngcontent-%COMP%]{flex-direction:row;gap:1.5rem}.search-actions-column[_ngcontent-%COMP%]{max-width:33%}}"],changeDetection:0});let e=t;return e})();var et=(()=>{let t=class t{constructor(){}};t.\u0275fac=function(n){return new(n||t)},t.\u0275cmp=y({type:t,selectors:[["bkd-dashboard"]],standalone:!0,features:[_e([E,Le]),v],decls:1,vars:0,template:function(n,p){n&1&&f(0,"router-outlet")},dependencies:[Te],changeDetection:0});let e=t;return e})();var dn=[{path:"",component:et,children:[{path:"",component:Xe},Ne]}];export{dn as DASHBOARD_ROUTES}; diff --git a/public/apps/webapp-schulverwaltung/main.js b/public/apps/webapp-schulverwaltung/main.js index 9716d38d..f019b7fa 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-XHR5YBGK.js").then(n=>n.DASHBOARD_ROUTES)},{path:"presence-control",canActivate:[z()],loadChildren:()=>import("./chunk-TPZAD5BA.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-WMKWXTQE.js").then(n=>n.EDIT_ABSENCES_ROUTES)},{path:"evaluate-absences",canActivate:[z()],loadChildren:()=>import("./chunk-ON6N652E.js").then(n=>n.EVALUATE_ABSENCES_ROUTES)},{path:"events",canActivate:[z()],loadChildren:()=>import("./chunk-5CY7K6UY.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-EO6OESLF.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-EZ6BEJIE.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));