From 64472b11d9349c46b8998a874392a1ae48078361 Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 19 Dec 2024 15:38:43 +0000 Subject: [PATCH] Add webapp-schulverwaltung build b6079774 --- public/apps/webapp-schulverwaltung/assets/locales/de-CH.json | 4 +++- public/apps/webapp-schulverwaltung/assets/locales/fr-CH.json | 4 +++- public/apps/webapp-schulverwaltung/chunk-24V6FPDD.js | 2 ++ public/apps/webapp-schulverwaltung/chunk-2FW5UFUO.js | 2 -- .../{chunk-DKHMWL57.js => chunk-45PGF53G.js} | 2 +- .../{chunk-7KV2DHNF.js => chunk-5V4FYHUO.js} | 2 +- public/apps/webapp-schulverwaltung/chunk-A3CECLYB.js | 3 --- .../{chunk-VFFZAFLB.js => chunk-FHLJK5I2.js} | 2 +- .../{chunk-3K4NZPMP.js => chunk-GPCFUPHW.js} | 2 +- public/apps/webapp-schulverwaltung/chunk-LASWC23V.js | 3 +++ .../{chunk-U3A3T7IE.js => chunk-QRYQOPD4.js} | 2 +- .../{chunk-PUOIWHIP.js => chunk-RENI6OUS.js} | 2 +- .../{chunk-3HCVMNJA.js => chunk-THL2WTJD.js} | 2 +- .../{chunk-RTY26FN4.js => chunk-YQAWVQ54.js} | 2 +- .../{chunk-LHXVMKYN.js => chunk-ZCHQQKGF.js} | 2 +- public/apps/webapp-schulverwaltung/main.js | 2 +- 16 files changed, 21 insertions(+), 17 deletions(-) create mode 100644 public/apps/webapp-schulverwaltung/chunk-24V6FPDD.js delete mode 100644 public/apps/webapp-schulverwaltung/chunk-2FW5UFUO.js rename public/apps/webapp-schulverwaltung/{chunk-DKHMWL57.js => chunk-45PGF53G.js} (98%) rename public/apps/webapp-schulverwaltung/{chunk-7KV2DHNF.js => chunk-5V4FYHUO.js} (98%) delete mode 100644 public/apps/webapp-schulverwaltung/chunk-A3CECLYB.js rename public/apps/webapp-schulverwaltung/{chunk-VFFZAFLB.js => chunk-FHLJK5I2.js} (99%) rename public/apps/webapp-schulverwaltung/{chunk-3K4NZPMP.js => chunk-GPCFUPHW.js} (66%) create mode 100644 public/apps/webapp-schulverwaltung/chunk-LASWC23V.js rename public/apps/webapp-schulverwaltung/{chunk-U3A3T7IE.js => chunk-QRYQOPD4.js} (98%) rename public/apps/webapp-schulverwaltung/{chunk-PUOIWHIP.js => chunk-RENI6OUS.js} (99%) rename public/apps/webapp-schulverwaltung/{chunk-3HCVMNJA.js => chunk-THL2WTJD.js} (99%) rename public/apps/webapp-schulverwaltung/{chunk-RTY26FN4.js => chunk-YQAWVQ54.js} (91%) rename public/apps/webapp-schulverwaltung/{chunk-LHXVMKYN.js => chunk-ZCHQQKGF.js} (93%) diff --git a/public/apps/webapp-schulverwaltung/assets/locales/de-CH.json b/public/apps/webapp-schulverwaltung/assets/locales/de-CH.json index a433fd51..a3d89c30 100644 --- a/public/apps/webapp-schulverwaltung/assets/locales/de-CH.json +++ b/public/apps/webapp-schulverwaltung/assets/locales/de-CH.json @@ -265,7 +265,9 @@ } }, "study-course-detail": { - "status": "Status" + "status": "Status", + "yes": "Ja", + "no": "Nein" } }, "courses": { diff --git a/public/apps/webapp-schulverwaltung/assets/locales/fr-CH.json b/public/apps/webapp-schulverwaltung/assets/locales/fr-CH.json index 9dac00f2..a0d9d4d8 100644 --- a/public/apps/webapp-schulverwaltung/assets/locales/fr-CH.json +++ b/public/apps/webapp-schulverwaltung/assets/locales/fr-CH.json @@ -265,7 +265,9 @@ } }, "study-course-detail": { - "status": "Statut" + "status": "Statut", + "yes": "Oui", + "no": "Non" } }, "courses": { diff --git a/public/apps/webapp-schulverwaltung/chunk-24V6FPDD.js b/public/apps/webapp-schulverwaltung/chunk-24V6FPDD.js new file mode 100644 index 00000000..edffa8d8 --- /dev/null +++ b/public/apps/webapp-schulverwaltung/chunk-24V6FPDD.js @@ -0,0 +1,2 @@ +import{a as ct}from"./chunk-ZCHQQKGF.js";import{a as lt,b as pt}from"./chunk-QB4DIFWS.js";import{a as Ai}from"./chunk-YQAWVQ54.js";import{a as It}from"./chunk-THL2WTJD.js";import{e as Vi}from"./chunk-5WNFCBTP.js";import{a as Et,b as ki,c as Pi,d as Mi,e as Oi,f as st,g as at,h as $i,i as Gi,j as Li,k as Di,l as Fi,m as Be,o as Ri,p as he,r as je,s as Bi,u as ji,v as dt}from"./chunk-LASWC23V.js";import{e as xi}from"./chunk-746ASKQ4.js";import{b as rt}from"./chunk-DTTSX64G.js";import{a as yi}from"./chunk-Y4QYVF5K.js";import{a as Hi}from"./chunk-BIDSHCYH.js";import{a as mt,c as Ni}from"./chunk-4RZQAAPF.js";import{a as Ei,b as Ii}from"./chunk-Z4YBXGVO.js";import{a as bi,d as ot}from"./chunk-3L4RH6QP.js";import{a as Ti,d as wi}from"./chunk-DTYYCJHM.js";import{L as Si,U as Ve,p as _i}from"./chunk-SRCW6BUG.js";import{a as Re,c as Ci,l as xe}from"./chunk-GOGVGWFJ.js";import{a as nt,b as be}from"./chunk-OSOXMODN.js";import{a as it,b as ue}from"./chunk-PSYDBHTH.js";import{a as ei,b as se,h as pi,i as ci,k as mi,l as ui,r as et,w as me}from"./chunk-W4U7QKJF.js";import{a as tt}from"./chunk-AVBHFGIF.js";import{$ as At,$a as a,$b as pe,Ab as R,Ad as De,B as Ft,Bb as A,Bd as li,C as Rt,Cb as O,D as Bt,Db as ne,Ea as bt,Eb as Oe,F as ae,Fa as Pe,Fb as D,Ga as _,Gb as wt,H as Z,Hd as hi,Ia as Yt,Id as gi,J as qe,Ja as Kt,Jb as l,K as jt,Kb as c,Kd as fi,Lb as F,M as J,Md as vi,Na as T,O as Vt,Ob as Qt,Od as X,P as M,Pd as I,Qa as m,R as Ce,Ra as de,Rd as Fe,Sb as z,Tb as Xt,Va as y,X as oe,Xa as Me,Ya as H,Za as N,_ as $,_a as s,a as L,ab as x,b as j,ba as Ht,ca as Nt,cc as Y,cd as ce,da as ke,dc as $e,ea as w,eb as G,f as ie,fa as E,fd as Ke,g as q,gb as b,h as xt,ha as Ut,hb as u,hd as Le,ib as Zt,id as Ze,jb as Jt,jd as ti,ka as Wt,kb as le,l as U,lb as Tt,lc as Ye,m as Dt,ma as ee,md as ii,n as S,nd as ni,o as W,od as Je,pa as zt,pd as ri,qa as V,qb as Se,ra as qt,rb as p,rd as si,sb as f,sd as ai,tb as v,ub as Ue,w as ze,wa as _e,wc as re,wd as Qe,x as fe,xa as r,xb as we,xc as ye,xd as Xe,ya as C,yb as Ee,yc as Ge,yd as oi,zb as Ie,zc as Q,zd as di}from"./chunk-2W7IS4PN.js";var zn=t=>[t,"tests"];function qn(t,o){if(t&1&&(s(0,"span"),p(1),l(2,"date"),x(3,"wbr"),p(4),l(5,"date"),a()),t&2){let e=u();r(),v("",F(2,2,e.event().dateFrom,"dd.MM.yyyy"),"\u2013"),r(3),f(F(5,5,e.event().dateTo,"dd.MM.yyyy"))}}function Yn(t,o){if(t&1&&(s(0,"a",6)(1,"i",7),p(2,"arrow_right_alt"),a(),s(3,"span",8),p(4),a()()),t&2){let e=u(2);m("routerLink",D(2,zn,e.event().id)),r(4),f(e.event().evaluationText)}}function Kn(t,o){if(t&1&&(s(0,"a",6)(1,"i",7),p(2,"arrow_right_alt"),a(),s(3,"span",8),p(4),a()()),t&2){let e=u(2);m("routerLink",e.event().evaluationLink),r(4),v("",e.event().evaluationText," ")}}function Zn(t,o){if(t&1&&(s(0,"div",5),T(1,Yn,5,4,"a",6)(2,Kn,5,2,"a",6),a()),t&2){let e=u();r(),y(e.event().evaluationLink?-1:1),r(),y(e.event().evaluationLink?2:-1)}}var Ui=(()=>{class t{constructor(){this.event=V.required(),this.withRatings=V(!0),this.link=z(()=>wi(this.event().detailLink))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["bkd-events-list-entry"]],inputs:{event:[1,"event"],withRatings:[1,"withRatings"]},decls:11,vars:9,consts:[[1,"designation"],[3,"routerLink","queryParams"],[1,"date"],[1,"registrations"],[1,"registrations-label"],[1,"rating"],[1,"d-flex",3,"routerLink"],[1,"material-icons"],[1,"ps-1"]],template:function(i,n){i&1&&(s(0,"div",0)(1,"a",1),p(2),a()(),s(3,"div",2),T(4,qn,6,8,"span"),a(),s(5,"div",3),p(6),s(7,"span",4),p(8),l(9,"translate"),a()(),T(10,Zn,3,2,"div",5)),i&2&&(r(),m("routerLink",n.link().link)("queryParams",n.link().params),r(),f(n.event().designation),r(2),y(n.event().dateFrom&&n.event().dateTo?4:-1),r(2),v(" ",n.event().studentCount," "),r(2),f(c(9,7,n.event().studentCount===1?"events.registration":"events.registrations")),r(2),y(n.withRatings()&&n.event().evaluationText?10:-1))},dependencies:[Q,$e,I],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}}']})}}return t})();var Jn=10300,Qn=10260,Xn=10250,er=14030,tr=10350;function ut(t){let{HasEvaluationStarted:o,EvaluationUntil:e,HasTestGrading:i}=t.EvaluationStatusRef;if(o===!0&&(t.StatusId===er||t.StatusId===tr))return{value:te.Rating};if(o===!0&&i===!1){if(e)return{value:te.RatingUntil};if(t.StatusId===Jn)return{value:te.IntermediateRating}}return o===!1&&i===!0&&t.StatusId!==Qn&&t.StatusId!==Xn?{value:te.Tests}:o===!0&&i===!0?e?{value:te.Tests,label:te.RatingUntil}:{value:te.Tests,label:te.IntermediateRating}:null}function Wi(t){return t.EvaluationStatusRef.HasEvaluationStarted===!0}function zi(t){return t.EvaluationStatusRef.HasReviewOfEvaluationStarted===!0&&!!t.FinalGrades?.length}function ht(t){let o=t.Classes?t.Classes.map(e=>e.Number).join(", "):null;return o?t.Designation+", "+o:t.Designation}function qi(t,o){return t?(o.Leadership??"").split(",").some(e=>e.trim()===t.fullname):!1}function Yi(t,o){let e=new URLSearchParams({returnlink:o});return o.startsWith("/dashboard")?`/dashboard/students/${t}?${e}`:o.startsWith("/events/current")?`/events/current/${t}?${e}`:`/events/${t}/students?${e}`}function Ki(t){let o=t.ParticipatingStudents?.map(e=>({id:e.Id,name:e.FullName,email:e.DisplayEmail??void 0}))??[];return{eventId:t.Id,eventDesignation:t.Designation,studyClasses:(t.Classes??[]).map(e=>e.Designation).sort(),entries:o}}function kt(t,o){return j(L({},t),{entries:t.entries.map(e=>{let i=o.find(d=>d.StudentId===e.id),n=i?[i.CompanyName,i.CompanyNameAddition].filter(Boolean).join(" \u2013 "):void 0;return j(L({},e),{company:n})})})}function Pt(t,o,e,{emailFallback:i}={}){return{eventId:t,eventDesignation:e[0]?.EventDesignation??"",studyClasses:[],entries:o.map(n=>({id:n.Id,subscriptionId:e.find(d=>d.PersonId===n.Id)?.Id,name:n.FullName,email:(i?n.DisplayEmail??n.Email:n.DisplayEmail)??void 0,status:e.find(d=>d.PersonId===n.Id)?.Status}))}}function Zi(t,o){return j(L({},t),{entries:t.entries.map(e=>j(L({},e),{studyClass:o.find(i=>i.StudentRef.Id===e.id)?.StudyClassNumber}))})}var te=function(t){return t.Rating="rating",t.RatingUntil="rating-until",t.IntermediateRating="intermediate-rating",t.Tests="add-tests",t}(te||{}),Ne=(()=>{class t{constructor(e,i,n,d,h,g,P,B,ge){this.coursesRestService=e,this.eventsRestService=i,this.studyClassRestService=n,this.subscriptionsRestService=d,this.loadingService=h,this.storageService=g,this.translate=P,this.router=B,this.settings=ge,this.loading$=this.loadingService.loading$,this.searchFields$=new q(["designation"]),this.searchSubject$=new q(""),this.search$=this.searchSubject$.asObservable(),this.roles$=new q(null),this.isClassTeacher$=this.roles$.pipe(S(ve=>yi(ve,"ClassTeacherRole")),J(1)),this.withStudyCourses$=new q(!1),this.unratedCourses$=this.roles$.pipe(M(this.loadUnratedCourses.bind(this)),J(1)),this.studyCourses$=this.withStudyCourses$.pipe(M(this.loadStudyCourses.bind(this)),J(1)),this.formativeAssessments$=this.isClassTeacher$.pipe(M(this.loadFormativeAssessments.bind(this)),J(1)),this.studyClasses$=this.isClassTeacher$.pipe(M(this.loadStudyClasses.bind(this)),J(1)),this.events$=this.getEvents().pipe(J(1)),this.filteredEvents$=W([this.events$,this.searchFields$,this.search$]).pipe(S(xe(pt)))}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(S(i=>e?i.filter(n=>n.evaluationText):i))}getEvents(){return this.loadingService.load(W([this.unratedCourses$,this.studyCourses$,this.formativeAssessments$,this.studyClasses$]),{stopOnFirstValue:!0}).pipe(S(xe(this.createAndSortEvents.bind(this))))}loadUnratedCourses(e){return this.coursesRestService.getExpandedCourses(e).pipe(S(i=>i.filter(n=>!zi(n))))}loadStudyCourses(e){if(!e)return U([]);let i=this.storageService.getPayload();return this.eventsRestService.getStudyCourseEvents().pipe(S(n=>n.filter(d=>qi(i,d))),M(n=>this.subscriptionsRestService.getSubscriptionCountsByEvents(n.map(d=>d.Id)).pipe(S(d=>n.map(h=>j(L({},h),{StudentCount:d[h.Id]??0}))))))}loadFormativeAssessments(e){return e?this.studyClassRestService.getActiveFormativeAssessments():U([])}loadStudyClasses(e){return e?this.studyClassRestService.getActive():U([])}createAndSortEvents(e,i,n,d){let h=d.filter(g=>!n.map(P=>P.Id).includes(g.Id));return[...this.createFromCourses(e),...this.createFromStudyCourses(i),...this.createFromAssessments(n),...this.createFromStudyClasses(h)].sort((g,P)=>g.designation.localeCompare(P.designation))}createFromCourses(e){return e.map(i=>{let n=ut(i);return{id:i.Id,designation:ht(i),detailLink:this.buildStudentsLink(i.Id),studentCount:i.AttendanceRef.StudentCount||0,dateFrom:i.DateFrom,dateTo:i.DateTo,state:n?.value||null,evaluationText:this.getEvaluationText(n,i.EvaluationStatusRef.EvaluationUntil),evaluationLink:n?.value&&n?.value!==te.Tests?this.buildEvaluationLink(i.Id):null}})}createFromStudyCourses(e){return e.map(i=>({id:i.Id,designation:i.Designation,detailLink:this.buildStudentsLink(i.Id),studentCount:i.StudentCount,state:null}))}createFromAssessments(e){return this.createFromStudyClasses(e).map(n=>j(L({},n),{state:te.Rating,evaluationText:this.translate.instant("events.state.rating"),evaluationLink:this.buildEvaluationLink(n.id)}))}createFromStudyClasses(e){return e.map(i=>({id:i.Id,designation:i.Number,detailLink:this.buildStudentsLink(i.Id),studentCount:i.StudentCount,state:null}))}getEvaluationText(e,i){let n=e?.label||e?.value;return n?this.translate.instant(`events.state.${n}`)+(n===te.RatingUntil?` ${i?_i(i,"dd.MM.yyyy"):""}`:""):""}buildStudentsLink(e){return Yi(e,this.router.url)}buildEvaluationLink(e){return(this.settings.eventlist.evaluation??"").replace(":id",String(e))}static{this.\u0275fac=function(i){return new(i||t)($(he),$(ct),$(Ai),$(je),$(be),$(Fe),$(X),$(Ge),$(ce))}}static{this.\u0275prov=oe({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var rr=(t,o)=>o.id,sr=()=>[];function ar(t,o){t&1&&x(0,"bkd-spinner")}function or(t,o){t&1&&(s(0,"div",7),p(1),l(2,"translate"),a()),t&2&&(r(),v(" ",c(2,1,"events.rating")," "))}function dr(t,o){if(t&1&&x(0,"bkd-events-list-entry",8),t&2){let e=o.$implicit,i=u(3);m("event",e)("withRatings",i.withRatings)}}function lr(t,o){if(t&1&&(s(0,"div",3)(1,"div",4),p(2),l(3,"translate"),a(),s(4,"div",5),p(5),l(6,"translate"),a(),s(7,"div",6),p(8),l(9,"translate"),a(),T(10,or,3,3,"div",7),a(),H(11,dr,1,2,"bkd-events-list-entry",8,rr)),t&2){let e=u(2),i=O(0);r(2),f(c(3,4,"events.designation")),r(3),f(c(6,6,"events.date")),r(3),v(" ",c(9,8,"events.registrations")," "),r(2),y(e.withRatings?10:-1),r(),N(i)}}function pr(t,o){t&1&&(s(0,"p",2),p(1),l(2,"translate"),a()),t&2&&(r(),f(c(2,1,"events.no-events")))}function cr(t,o){if(t&1&&T(0,lr,13,10)(1,pr,3,3,"p",2),t&2){u();let e=O(0);y(e.length>0?0:1)}}var Xi=["designation"],mr=[...Xi,"evaluationText"],ft=(()=>{class t{constructor(e,i){this.state=e,this.storage=i,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?mr:Xi)}static{this.\u0275fac=function(i){return new(i||t)(C(Ne),C(Fe))}}static{this.\u0275cmp=_({type:t,selectors:[["bkd-events-list"]],inputs:{withStudyCourses:"withStudyCourses",withRatings:"withRatings"},features:[ke],decls:10,vars:17,consts:[[1,"bkd-container"],[1,"d-flex","search",3,"valueChange","value","placeholder","label","disabled"],[1,"mt-3"],[1,"event-header"],[1,"designation"],[1,"date"],[1,"registrations"],[1,"rating"],[3,"event","withRatings"]],template:function(i,n){if(i&1){let d=G();R(0),l(1,"async"),s(2,"div",0)(3,"bkd-resettable-input",1),l(4,"async"),l(5,"translate"),l(6,"translate"),b("valueChange",function(g){return w(d),E(n.state.setSearch(g))}),a(),T(7,ar,1,0,"bkd-spinner"),l(8,"async"),T(9,cr,2,1),a()}if(i&2){let d,h=A((d=c(1,5,n.state.getEntries(n.withRatings)))!==null&&d!==void 0?d:Oe(16,sr));r(3),m("value",c(4,8,n.state.search$))("placeholder",c(5,10,"events.search-by"))("label",c(6,12,"events.search"))("disabled",!h),r(4),y(c(8,14,n.state.loading$)?7:9)}},dependencies:[lt,ue,Y,I,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}}']})}}return t})();var en=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["bkd-events-current-list"]],decls:4,vars:5,consts:[[3,"withStudyCourses","withRatings"]],template:function(i,n){i&1&&(s(0,"h1"),p(1),l(2,"translate"),a(),x(3,"bkd-events-list",0)),i&2&&(r(),f(c(2,3,"events.current.title")),r(2),m("withStudyCourses",!0)("withRatings",!1))},dependencies:[ft,I],encapsulation:2,changeDetection:0})}}return t})();var tn=(()=>{class t{constructor(){}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["bkd-events-current"]],decls:1,vars:0,template:function(i,n){i&1&&x(0,"router-outlet")},dependencies:[ye],encapsulation:2})}}return t})();var nn=(()=>{class t{constructor(){this.entry=V.required(),this.multipleStudyClasses=V(!1),this.returnLink=V(null),this.link=z(()=>["student",this.entry().id,"addresses"]),this.linkParams=z(()=>{let e=this.returnLink();return e?{returnparams:new URLSearchParams({returnlink:e}).toString()}:{}})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["bkd-events-students-course-entry"]],inputs:{entry:[1,"entry"],multipleStudyClasses:[1,"multipleStudyClasses"],returnLink:[1,"returnLink"]},decls:7,vars:10,consts:[[1,"avatar","large",3,"studentId","link","linkParams"],[1,"name",3,"title","routerLink","queryParams"],[1,"study-class"],[1,"company",3,"title"]],template:function(i,n){i&1&&(x(0,"bkd-avatar",0),s(1,"a",1),p(2),a(),s(3,"div",2),p(4),a(),s(5,"div",3),p(6),a()),i&2&&(m("studentId",n.entry().id)("link",n.link())("linkParams",n.linkParams()),r(),m("title",n.entry().name)("routerLink",n.link())("queryParams",n.linkParams()),r(),f(n.entry().name),r(2),v(" ",n.multipleStudyClasses()?n.entry().studyClass:"",` +`),r(),m("title",n.entry().company),r(),f(n.entry().company))},dependencies:[Q,Vi],styles:['[_nghost-%COMP%]{display:grid;grid-template-columns:min-content 1fr;grid-template-rows:min-content min-content 1fr;grid-template-areas:"avatar name" "avatar study-class" "avatar company";padding:2rem 1rem}.avatar[_ngcontent-%COMP%]{grid-area:avatar;margin-right:1.5rem}.name[_ngcontent-%COMP%]{grid-area:name}.study-class[_ngcontent-%COMP%]{grid-area:study-class;font-size:.875rem}.company[_ngcontent-%COMP%]{grid-area:company;align-content:end;padding-bottom:1.5rem}.name[_ngcontent-%COMP%], .company[_ngcontent-%COMP%]{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}'],changeDetection:0})}}return t})();var ur=t=>({count:t});function hr(t,o){if(t&1&&(s(0,"div",0),p(1),l(2,"translate"),a()),t&2){u();let e=O(2);r(),v(" ",F(2,1,e===1?"events-students.registration":"events-students.registrations",D(4,ur,e))," ")}}var vt=(()=>{class t{constructor(){this.title=V.required(),this.count=V(null),this.searchTerm=Pe()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["bkd-events-students-header"]],inputs:{title:[1,"title"],count:[1,"count"],searchTerm:[1,"searchTerm"]},outputs:{searchTerm:"searchTermChange"},decls:7,vars:10,consts:[[1,"additional-info"],[1,"search",3,"valueChange","value","placeholder","label"]],template:function(i,n){if(i&1){let d=G();s(0,"h1"),p(1),a(),R(2),T(3,hr,3,6,"div",0),s(4,"bkd-resettable-input",1),l(5,"translate"),l(6,"translate"),b("valueChange",function(g){return w(d),E(n.searchTerm.set(g))}),a()}if(i&2){r(),f(n.title()),r();let d=A(n.count());r(),y(d!==null?3:-1),r(),m("value",n.searchTerm())("placeholder",c(5,6,"events-students.search-placeholder"))("label",c(6,8,"events-students.search"))}},dependencies:[I,lt],styles:["h1[_ngcontent-%COMP%]{margin-bottom:0}.search[_ngcontent-%COMP%]{margin-top:1rem;display:flex;max-width:300px}.additional-info[_ngcontent-%COMP%]{color:#adb5bd}"],changeDetection:0})}}return t})();var gr=(t,o)=>o.id;function fr(t,o){t&1&&(s(0,"p"),p(1),l(2,"translate"),a()),t&2&&(r(),f(c(2,1,"events-students.no-entries")))}function vr(t,o){if(t&1&&x(0,"bkd-events-students-course-entry",2),t&2){let e=o.$implicit,i=u();m("entry",e)("multipleStudyClasses",i.multipleStudyClasses())("returnLink",i.returnLink())}}var rn=(()=>{class t{constructor(){this.title=V.required(),this.count=V.required(),this.entries=V.required(),this.multipleStudyClasses=V(!1),this.returnLink=V(null),this.searchTerm=Pe()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["bkd-events-students-course-list"]],inputs:{title:[1,"title"],count:[1,"count"],entries:[1,"entries"],multipleStudyClasses:[1,"multipleStudyClasses"],returnLink:[1,"returnLink"],searchTerm:[1,"searchTerm"]},outputs:{searchTerm:"searchTermChange"},decls:5,vars:4,consts:[[3,"searchTermChange","title","count","searchTerm"],[1,"list"],[3,"entry","multipleStudyClasses","returnLink"]],template:function(i,n){i&1&&(s(0,"bkd-events-students-header",0),Ie("searchTermChange",function(h){return Ee(n.searchTerm,h)||(n.searchTerm=h),h}),a(),s(1,"section",1),T(2,fr,3,3,"p"),H(3,vr,1,3,"bkd-events-students-course-entry",2,gr),a()),i&2&&(m("title",n.title())("count",n.count()),we("searchTerm",n.searchTerm),r(2),y(n.entries().length===0?2:-1),r(),N(n.entries()))},dependencies:[I,vt,nn],styles:["[_nghost-%COMP%]{display:block;overflow:hidden}section.list[_ngcontent-%COMP%]{width:calc(100% + 1px);margin-top:1rem;display:grid;grid-template-columns:repeat(auto-fill,minmax(400px,1fr))}bkd-events-students-course-entry[_ngcontent-%COMP%]{border-bottom:1px solid #dee2e6;border-right:1px solid #dee2e6}"],changeDetection:0})}}return t})();var sn=(()=>{class t{constructor(){this.entry=V.required(),this.returnLink=V(null),this.link=z(()=>["study-course-student",this.entry().id]),this.linkParams=z(()=>{let e=this.returnLink();return e?{returnparams:new URLSearchParams({returnlink:e}).toString()}:{}})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["bkd-events-students-study-course-entry"]],inputs:{entry:[1,"entry"],returnLink:[1,"returnLink"]},decls:4,vars:4,consts:[[1,"name",3,"routerLink","queryParams"],[1,"status"]],template:function(i,n){i&1&&(s(0,"a",0),p(1),a(),s(2,"div",1),p(3),a()),i&2&&(m("routerLink",n.link())("queryParams",n.linkParams()),r(),f(n.entry().name),r(2),f(n.entry().status))},dependencies:[Q],styles:["[_nghost-%COMP%]{display:flex;flex-direction:row;align-items:stretch;border-bottom:1px solid #dee2e6}.name[_ngcontent-%COMP%], .status[_ngcontent-%COMP%]{padding:1rem}.name[_ngcontent-%COMP%]{flex:2;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.status[_ngcontent-%COMP%]{flex:1;padding-left:0}@media (max-width: 750px){[_nghost-%COMP%]{flex-direction:column}.name[_ngcontent-%COMP%]{padding-bottom:0}.status[_ngcontent-%COMP%]{padding-top:0;padding-left:1rem;font-size:.875rem}}"],changeDetection:0})}}return t})();var Cr=(t,o)=>o.id;function _r(t,o){if(t&1){let e=G();s(0,"div",2)(1,"div",4),b("click",function(){w(e);let n=u();return E(n.toggleSort.emit())}),p(2),l(3,"translate"),s(4,"span",5),p(5),a()()()}if(t&2){let e=u();r(),m("className",e.primarySortKey),r(),v(" ",c(3,3,"events-students.list.header."+e.primarySortKey)," "),r(3),f(e.getSortDirectionCharacter(e.sortCriteria()))}}function Sr(t,o){t&1&&(s(0,"p"),p(1),l(2,"translate"),a()),t&2&&(r(),f(c(2,1,"events-students.no-entries")))}function yr(t,o){if(t&1&&x(0,"bkd-events-students-study-course-entry",3),t&2){let e=o.$implicit,i=u();m("entry",e)("returnLink",i.returnLink())}}var an=(()=>{class t{constructor(){this.title=V.required(),this.count=V.required(),this.entries=V.required(),this.returnLink=V(null),this.sortCriteria=V.required(),this.toggleSort=zt(),this.searchTerm=Pe(),this.primarySortKey="name"}getSortDirectionCharacter(e){return e.ascending?"\u2191":"\u2193"}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["bkd-events-students-study-course-list"]],inputs:{title:[1,"title"],count:[1,"count"],entries:[1,"entries"],returnLink:[1,"returnLink"],sortCriteria:[1,"sortCriteria"],searchTerm:[1,"searchTerm"]},outputs:{toggleSort:"toggleSort",searchTerm:"searchTermChange"},features:[ne([])],decls:6,vars:4,consts:[[3,"searchTermChange","title","count","searchTerm"],[1,"list"],[1,"list-header"],[3,"entry","returnLink"],[1,"name",3,"click","className"],[1,"sort-direction"]],template:function(i,n){i&1&&(s(0,"bkd-events-students-header",0),Ie("searchTermChange",function(h){return Ee(n.searchTerm,h)||(n.searchTerm=h),h}),a(),s(1,"section",1),T(2,_r,6,5,"div",2)(3,Sr,3,3,"p"),H(4,yr,1,2,"bkd-events-students-study-course-entry",3,Cr),a()),i&2&&(m("title",n.title())("count",n.count()),we("searchTerm",n.searchTerm),r(2),y(n.entries().length>0?2:3),r(2),N(n.entries()))},dependencies:[I,vt,sn],styles:[".list-header[_ngcontent-%COMP%]{cursor:pointer;display:flex;align-items:center;border-bottom:2px solid #dee2e6}.name[_ngcontent-%COMP%]{padding:1rem}"],changeDetection:0})}}return t})();function on(t,o,e){o||Nt(t);let i=o??At(Wt);return e?Ht(i,e):i}function We(t,o){let e=on(We,o?.injector),i;return z(()=>(i||(i=Xt(()=>se(t,j(L({},o),{injector:e})))),i()))}var dn=(()=>{class t extends it{constructor(e,i){super(e,i,Ei,"ApprenticeshipContracts")}getCompaniesForStudents(e){let i=new Date,n={"filter.StudentId":`;${e.join(";")}`,"filter.ApprenticeshipDateFrom":`<${i.toISOString()}`,"filter.ApprenticeshipDateTo":`>${i.toISOString()}`,fields:"Id,StudentId,CompanyName,CompanyNameAddition"};return this.http.get(`${this.baseUrl}/`,{params:n}).pipe(M(vi(Ii)))}static{this.\u0275fac=function(i){return new(i||t)($(Ye),$(ce))}}static{this.\u0275prov=oe({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Ct=1;var ln=10,_t=(()=>{class t{constructor(e,i,n,d,h,g,P,B,ge){this.route=e,this.loadingService=i,this.eventsService=n,this.coursesService=d,this.subscriptionsService=h,this.personsService=g,this.apprenticeshipContractsService=P,this.lessonPresencesService=B,this.reportsService=ge,this.eventId$=W([this.route.paramMap,this.route.parent?.paramMap??U(null)]).pipe(S(([ve,Wn])=>Number(ve.get("id")||Wn?.get("id")))),this.eventTypeId$=this.eventId$.pipe(M(this.loadEventTypeId.bind(this))),this.eventTypeId=We(this.eventTypeId$,{initialValue:null}),this.studentEntries=We(this.loadStudentEntries(),{initialValue:null}),this.isStudyCourse=z(()=>this.eventTypeId()===Ct),this.loading=se(this.loadingService.loading(mt)),this.title=z(()=>this.getTitle(this.studentEntries())),this.multipleStudyClasses=z(()=>(this.studentEntries()?.studyClasses?.length??0)>1),this.searchTerm=bt(""),this.sortCriteria=bt({primarySortKey:"name",ascending:!0}),this.entries=z(()=>this.studentEntries()?.entries??[]),this.sortedEntries=z(()=>this.sortStudentEntries(this.entries(),this.sortCriteria())),this.filteredEntries=z(()=>pt(this.sortedEntries(),["name","status","company","studyClass"],this.searchTerm())),this.mailtoLink=z(()=>this.getMailtoLink(this.eventTypeId(),this.entries())),this.reports=We(W([this.eventId$,this.eventTypeId$.pipe(fe(me))]).pipe(M(xe(this.loadReports.bind(this)))),{initialValue:[]})}loadEventTypeId(e){return this.loadingService.load(this.eventsService.getEventTypeId(e),mt)}loadStudentEntries(){return W([this.eventId$,this.eventTypeId$]).pipe(M(([e,i])=>{let n=()=>{switch(i){case null:return U(null);case Ct:return this.loadStudyCourseStudents(e);case ln:return this.loadStudyClassStudents(e);default:return this.loadCourseStudents(e)}};return this.loadingService.load(n(),mt)}))}toggleSort(){this.sortCriteria.update(e=>j(L({},e),{ascending:!e.ascending}))}loadStudyCourseStudents(e){return this.subscriptionsService.getSubscriptionsByCourse(e).pipe(M(i=>this.personsService.getSummaries(i.map(({PersonId:n})=>n).filter(me)).pipe(S(n=>Pt(e,n,i)))))}loadStudyClassStudents(e){return this.subscriptionsService.getSubscriptionsByCourse(e,{"filter.IsOkay":"=1"}).pipe(M(i=>{let n=i.map(({PersonId:d})=>d).filter(me);return W([this.personsService.getSummaries(n),this.apprenticeshipContractsService.getCompaniesForStudents(n)]).pipe(S(([d,h])=>{let g=Pt(e,d,i,{emailFallback:!0});return kt(g,h)}))}))}loadCourseStudents(e){return this.coursesService.getExpandedCourseWithParticipants(e).pipe(S(Ki),M(i=>W([this.apprenticeshipContractsService.getCompaniesForStudents(i.entries.map(({id:n})=>n)),this.lessonPresencesService.getLessonStudyClassesByEvent(e)]).pipe(S(([n,d])=>{let h=kt(i,n);return Zi(h,d)}))))}getTitle(e){if(!e||!e.eventDesignation)return null;let{eventDesignation:i,studyClasses:n}=e;return[i,...n].join(", ")}getMailtoLink(e,i){if(e===null||e===Ct)return null;let n=i.map(d=>d.email).filter(Boolean);return n.length>0?`mailto:${n.join(";")}`:null}loadReports(e,i){switch(i){case null:case Ct:return U([]);case ln:return this.reportsService.getStudyClassStudentsReports(e);default:return this.reportsService.getCourseStudentsReports(e)}}sortStudentEntries(e,i){return[...e].sort(Er(i))}static{this.\u0275fac=function(i){return new(i||t)($(re),$(be),$(ct),$(he),$(je),$(rt),$(dn),$(xi),$(ot))}}static{this.\u0275prov=oe({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();function Er(t){return(o,e)=>t.ascending?o.name.localeCompare(e.name):e.name.localeCompare(o.name)}var kr=t=>[t];function Pr(t,o){if(t&1&&(s(0,"a",4)(1,"i",6),p(2,"mail"),a()()),t&2){let e=u(2);m("href",e.state.mailtoLink(),_e)}}function Mr(t,o){if(t&1&&(s(0,"bkd-backlink",0)(1,"div",3),T(2,Pr,3,1,"a",4),x(3,"bkd-reports-link",5),a()()),t&2){let e=u(),i=O(0);m("link",D(3,kr,i)),r(2),y(e.state.mailtoLink()?2:-1),r(),m("reports",e.state.reports())}}function Or(t,o){t&1&&x(0,"bkd-spinner")}function $r(t,o){t&1&&(s(0,"p"),p(1),l(2,"translate"),a()),t&2&&(r(),f(c(2,1,"events-students.no-entries")))}function Gr(t,o){if(t&1){let e=G();s(0,"bkd-events-students-study-course-list",7),b("toggleSort",function(){w(e);let n=u();return E(n.state.toggleSort())}),Ie("searchTermChange",function(n){w(e);let d=u();return Ee(d.state.searchTerm,n)||(d.state.searchTerm=n),E(n)}),a()}if(t&2){let e=u();m("title",e.state.title())("count",e.state.entries().length)("entries",e.state.filteredEntries())("returnLink",e.returnLink())("sortCriteria",e.state.sortCriteria()),we("searchTerm",e.state.searchTerm)}}function Lr(t,o){if(t&1){let e=G();s(0,"bkd-events-students-course-list",8),Ie("searchTermChange",function(n){w(e);let d=u();return Ee(d.state.searchTerm,n)||(d.state.searchTerm=n),E(n)}),a()}if(t&2){let e=u();m("title",e.state.title())("count",e.state.entries().length)("entries",e.state.filteredEntries())("multipleStudyClasses",e.state.multipleStudyClasses())("returnLink",e.returnLink()),we("searchTerm",e.state.searchTerm)}}var pn=(()=>{class t{constructor(e,i){this.state=e,this.route=i,this.returnLink=se(this.route.queryParams.pipe(S(({returnlink:n})=>n?decodeURIComponent(n):null)))}static{this.\u0275fac=function(i){return new(i||t)(C(_t),C(re))}}static{this.\u0275cmp=_({type:t,selectors:[["bkd-events-students-list"]],decls:6,vars:3,consts:[[3,"link"],[3,"title","count","entries","returnLink","sortCriteria","searchTerm"],[3,"title","count","entries","multipleStudyClasses","returnLink","searchTerm"],[1,"d-flex"],["target","_blank",1,"mail","btn","btn-primary","btn-icon","me-2",3,"href"],[1,"ms-2",3,"reports"],[1,"material-icons"],[3,"toggleSort","searchTermChange","title","count","entries","returnLink","sortCriteria","searchTerm"],[3,"searchTermChange","title","count","entries","multipleStudyClasses","returnLink","searchTerm"]],template:function(i,n){if(i&1&&(R(0),T(1,Mr,4,5,"bkd-backlink",0)(2,Or,1,0,"bkd-spinner")(3,$r,3,3,"p")(4,Gr,1,6,"bkd-events-students-study-course-list",1)(5,Lr,1,6,"bkd-events-students-course-list",2)),i&2){let d=A(n.returnLink());r(),y(d?1:-1),r(),y(n.state.loading()?2:n.state.entries().length===0?3:n.state.isStudyCourse()?4:5)}},dependencies:[I,ue,Ve,nt,rn,an],encapsulation:2,changeDetection:0})}}return t})();var Dr=(t,o)=>o.id;function Fr(t,o){if(t&1&&(p(0),l(1,"date")),t&2){u(2);let e=O(2);v(" ",F(1,1,e.Birthdate,"dd.MM.yyyy")," ")}}function Rr(t,o){if(t&1&&p(0),t&2){u(2);let e=O(2);v(" (",e.Gender,") ")}}function Br(t,o){if(t&1&&(p(0),x(1,"br")),t&2){u(2);let e=O(2);v(" ",e.AddressLine1,"")}}function jr(t,o){if(t&1&&(p(0),x(1,"br")),t&2){u(2);let e=O(2);Ue(" ",e.Zip," ",e.Location,"")}}function Vr(t,o){if(t&1&&(s(0,"a",4),p(1),a(),x(2,"br")),t&2){u(2);let e=O(2);Tt("href","tel:",e.PhonePrivate,"",_e),r(),f(e.PhonePrivate)}}function Ar(t,o){if(t&1&&(s(0,"a",4),p(1),a()),t&2){u(2);let e=O(2);Tt("href","tel:",e.PhoneMobile,"",_e),r(),f(e.PhoneMobile)}}function Hr(t,o){if(t&1&&(s(0,"h1"),p(1),a(),s(2,"span",3),T(3,Fr,2,4)(4,Rr,1,1),a(),s(5,"address"),T(6,Br,2,1)(7,jr,2,2)(8,Vr,3,3)(9,Ar,2,3,"a",4),a()),t&2){u();let e=O(2);r(),f(e.FullName),r(2),y(e.Birthdate?3:-1),r(),y(e.Gender?4:-1),r(2),y(e.AddressLine1?6:-1),r(),y(e.Zip&&e.Location?7:-1),r(),y(e.PhonePrivate?8:-1),r(),y(e.PhoneMobile?9:-1)}}function Nr(t,o){if(t&1&&(s(0,"div",2),p(1),l(2,"translate"),s(3,"span",5),p(4),a()()),t&2){u();let e=O(4);r(),v(" ",c(2,2,"events-students.study-course-detail.status"),": "),r(3),f(e)}}function Ur(t,o){if(t&1&&(s(0,"a",7),p(1),a()),t&2){let e=u(2).$implicit;le("href",e.file,_e),r(),f(e.value)}}function Wr(t,o){if(t&1&&p(0),t&2){let e=u(2).$implicit;v(" ",e.value," ")}}function zr(t,o){if(t&1&&(s(0,"div",6)(1,"div"),p(2),a(),T(3,Ur,2,2,"a",7)(4,Wr,1,1),a()),t&2){let e=u().$implicit;r(2),f(e.label),r(),y(e.file!==null?3:4)}}function qr(t,o){if(t&1&&T(0,zr,5,2,"div",6),t&2){let e=o.$implicit;y(e.value?0:-1)}}function Yr(t,o){t&1&&x(0,"bkd-spinner")}var cn=(()=>{class t{constructor(e,i,n,d,h,g,P){this.settings=e,this.route=i,this.personsService=n,this.subscriptionsService=d,this.storageService=h,this.loadingService=g,this.translate=P,this.eventId$=this.route.parent?.paramMap.pipe(S(B=>Number(B.get("id"))))??U(0),this.personId$=this.route.paramMap.pipe(S(B=>Number(B.get("id")))),this.person=se(this.personId$.pipe(M(B=>this.personsService.get(B))),{initialValue:null}),this.subscription=se(this.loadSubscription()),this.subscriptionId=z(()=>this.subscription()?.Id??null),this.subscriptionDetails=se(this.loadSubscriptionDetails(),{initialValue:[]}),this.backLink=se(this.route.queryParams.pipe(S(({returnparams:B})=>B),S(Ti))),this.loading=se(this.loadingService.loading$,{initialValue:!0})}loadSubscription(){return this.loadingService.load(W([this.eventId$,this.personId$]).pipe(M(([e,i])=>this.subscriptionsService.getSubscriptionsByCourse(e,{"filter.PersonId":`=${i}`})),S(e=>e[0]??null)),{stopOnFirstValue:!0})}loadSubscriptionDetails(){return this.loadingService.load(ei(this.subscriptionId).pipe(fe(me),M(e=>this.subscriptionsService.getSubscriptionDetailsById(e)),S(e=>e.map(i=>this.toSubscriptionDetailsEntry(i)))),{stopOnFirstValue:!0})}toSubscriptionDetailsEntry(e){let i=e.Value??"";return i=this.normalizeSubscriptionDetailsYesNoValue(e,i),i=this.normalizeSubscriptionDetailsDropdownValue(e,i),{id:e.Id,label:e.VssDesignation,value:i,file:this.buildFileUrl(e)}}normalizeSubscriptionDetailsYesNoValue(e,i){if((e.VssType==="isYes"||e.VssType==="isYesNo")&&e.ShowAsRadioButtons){if(i==="Ja")return this.translate.instant("events-students.study-course-detail.yes");if(i==="Nein")return this.translate.instant("events-students.study-course-detail.no")}return i}normalizeSubscriptionDetailsDropdownValue(e,i){return e.DropdownItems&&e.VssStyle!=="CB"?e.DropdownItems.find(n=>String(n.Key)===i)?.Value??i:i}buildFileUrl(e){if(e.VssStyle==="PD"||e.VssStyle==="PF"||e.VssStyle==="DA"){let i=this.storageService.getAccessToken()||"";return`${this.settings.apiUrl}/Files/SubscriptionDetails/${e.Id}?token=${i}`}return null}static{this.\u0275fac=function(i){return new(i||t)(C(ce),C(re),C(rt),C(je),C(Fe),C(be),C(X))}}static{this.\u0275cmp=_({type:t,selectors:[["bkd-events-students-study-course-detail"]],decls:9,vars:6,consts:[[1,"bkd-container","bkd-container-limited"],["link","../..",3,"params"],[1,"status"],[1,"additional-info"],[3,"href"],[1,"ms-2"],[1,"detail"],["target","_blank",3,"href"]],template:function(i,n){if(i&1&&(s(0,"div",0),x(1,"bkd-backlink",1),R(2),T(3,Hr,10,7),R(4),T(5,Nr,5,4,"div",2),H(6,qr,1,1,null,null,Dr),T(8,Yr,1,0,"bkd-spinner"),a()),i&2){let d;r(),m("params",n.backLink()),r();let h=A(n.person());r(),y(h?3:-1),r();let g=A((d=n.subscription())==null?null:d.Status);r(),y(g?5:-1),r(),N(n.subscriptionDetails()),r(2),y(n.loading()?8:-1)}},dependencies:[I,$e,Ve,ue],styles:["h1[_ngcontent-%COMP%]{margin-bottom:0}.additional-info[_ngcontent-%COMP%]{color:#adb5bd}address[_ngcontent-%COMP%]{margin:1rem 0}.status[_ngcontent-%COMP%]{display:flex;align-items:center;padding:1rem 0;border-top:1px solid #dee2e6;border-bottom:1px solid #dee2e6}.detail[_ngcontent-%COMP%]{max-width:70ch;padding-top:1rem}.detail[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{font-weight:400;color:#00000080}"],changeDetection:0})}}return t})();var mn=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["bkd-events-students"]],features:[ne([_t])],decls:1,vars:0,template:function(i,n){i&1&&x(0,"router-outlet")},dependencies:[ye],encapsulation:2,changeDetection:0})}}return t})();var un=(()=>{class t{constructor(){}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["bkd-events-tests"]],decls:4,vars:4,consts:[[3,"withRatings"]],template:function(i,n){i&1&&(s(0,"h1"),p(1),l(2,"translate"),a(),x(3,"bkd-events-list",0)),i&2&&(r(),f(c(2,2,"events.title")),r(2),m("withRatings",!0))},dependencies:[ft,I],encapsulation:2})}}return t})();var hn=(()=>{class t{constructor(){}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["bkd-events"]],features:[ne([Ne,Si])],decls:1,vars:0,template:function(i,n){i&1&&x(0,"router-outlet")},dependencies:[ye],encapsulation:2})}}return t})();function gn(t){return o=>{let e=Number(o.value);return e<=t?{greaterThan:{value:e,greaterThanValue:t}}:null}}function Ot(t){return t.map(({finalGrade:o})=>o).filter(Kr)}function Kr(t){return t!==null}function Cn(t,o,e,i){return t?.map(n=>({student:n,finalGrade:Jr(n,e,i),grades:Zr(n,o)}))}function Zr(t,o){return o.map(e=>{if(e.Results===void 0||e.Results?.length===0)return{kind:"no-result",test:e};let i=e.Results?.find(n=>n.StudentId===t.Id);return i!==void 0?{kind:"grade",result:i,test:e}:{kind:"no-result",test:e}})}function Jr(t,o,e){let i=o.find(d=>d.StudentId===t.Id),n=e.find(d=>d.StudentId===t.Id);return i?{id:i.Id,average:Qr(i),finalGradeId:i.GradeId,freeHandGrade:n?Number(n.Grade):null,canGrade:i.CanGrade}:null}function Qr(t){return t.AverageTestResult===0?null:t.AverageTestResult}var _n=({key:t,ascending:o})=>(e,i)=>{let n=o?1:-1;switch(t){case"FullName":return n*e.student.FullName.localeCompare(i.student.FullName);case"FinalGrade":return!e.finalGrade?.finalGradeId||!i.finalGrade?.finalGradeId?n*-1:n*fn(e.finalGrade.finalGradeId,i.finalGrade.finalGradeId);case"TestsMean":return!e.finalGrade?.average||!i.finalGrade?.average?n*-1:n*fn(e.finalGrade.average,i.finalGrade.average)}return n*Xr(t,e,i)},Xr=(t,o,e)=>{let i=o.grades.filter(vn).find(d=>d.test.Id===t.Id),n=e.grades.filter(vn).find(d=>d.test.Id===t.Id);return t.IsPointGrading&&i?.result.GradeId===n?.result.GradeId?(i?.result.Points??0)-(n?.result.Points??0):((i?.result.GradeId??Number.POSITIVE_INFINITY)-(n?.result.GradeId??Number.POSITIVE_INFINITY))*-1};function fn(t,o){return t===o?0:te.average).filter(e=>e!=null&&e!==0).map(Number);return Et(o)}function xn(t,o){let e=t.map(n=>n.freeHandGrade).filter(n=>!!n),i=t.map(n=>n.finalGradeId).filter(n=>n!==null).map(n=>o.find(d=>d.Key===n)).filter(n=>n!==void 0).map(n=>n?.Value).filter(n=>n!==void 0).map(Number).filter(n=>!isNaN(n));return Et([...i,...e])}function $t(t,o){return[...o.filter(e=>e.Id!==t?.Id),t].filter(e=>e!=null)}function bn({id:t,selectedGradeId:o},e){return e.map(i=>i.Id!==t?i:j(L({},i),{GradeId:o}))}function Tn(t,o){switch(o.type){case"reset":return o.payload;case"updateResult":return t?j(L({},t),{Tests:Pi(o.payload.testResult,t.Tests||[],o.payload.ignore),Gradings:o.payload.grading?$t(o.payload.grading,t.Gradings||[]):t.Gradings}):null;case"deleteResult":return t?j(L({},t),{Tests:Mi(o.payload.testId,o.payload.studentId,t.Tests||[]),Gradings:o.payload.grading?$t(o.payload.grading,t.Gradings||[]):t.Gradings||[]}):null;case"toggle-test-state":return t?j(L({},t),{Tests:Oi(o.payload,t.Tests||[])}):null;case"final-grade-overwritten":return t?j(L({},t),{Gradings:bn({id:o.payload.id,selectedGradeId:o.payload.selectedGradeId},t.Gradings||[])}):null;case"replace-grades":return t?j(L({},t),{Gradings:o.payload}):null;case"delete-test":return t?j(L({},t),{Tests:$i(o.payload,t.Tests||[])}):null;default:return t}}var wn=(()=>{class t extends it{constructor(e,i){super(e,i,Ri,"Gradings")}updateGrade(e,i){return this.http.put(`${this.baseUrl}/${e}`,{GradeId:i}).pipe(S(()=>e))}static{this.\u0275fac=function(i){return new(i||t)($(Ye),$(ce))}}static{this.\u0275prov=oe({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Gt={onlyMine:!1,hidePublished:!1},K=(()=>{class t{constructor(e,i,n,d,h){this.coursesRestService=e,this.gradingScalesRestService=i,this.gradingsRestService=n,this.loadingService=d,this.sortService=h,this.action$=new xt(1),this.loading$=this.loadingService.loading$,this._courseId$=new xt(1),this.courseId$=this._courseId$.asObservable(),this.fetchedCourse$=this._courseId$.pipe(M(g=>this.loadingService.load(this.coursesRestService.getExpandedCourse(g))),J(1)),this.course$=ze(this.action$,this.fetchedCourse$.pipe(fe(me),S(g=>({type:"reset",payload:g})))).pipe(jt(Tn,null),fe(me),J(1)),this.tests$=this.course$.pipe(S(g=>g.Tests||[]),S(Gi)),this.hasTests$=this.tests$.pipe(S(g=>g.length>0)),this.filterSubject$=new q(Gt),this.filter$=this.filterSubject$.asObservable(),this.expandedHeaderSubject$=new q(!1),this.expandedHeader$=this.expandedHeaderSubject$.asObservable(),this.filteredTests$=W([this.tests$,this.filter$]).pipe(S(([g,P])=>g.filter(B=>(!P.onlyMine||B.IsOwner)&&(!P.hidePublished||!B.IsPublished)))),this.sorting$=this.sortService.sorting$,this.studentGrades$=W([this.course$,this.filteredTests$,this.sorting$]).pipe(S(xe(this.toStudentGrades.bind(this)))),this.canSetFinalGrade$=this.course$.pipe(S(Wi)),this.gradingScaleIds$=this.course$.pipe(S(g=>gi([...(g.Tests??[]).map(P=>P.GradingScaleId),g.GradingScaleId]).filter(me)),Z(hi),J(1)),this.gradingScales$=this.gradingScaleIds$.pipe(M(g=>this.gradingScalesRestService.getGradingScales(g)),J(1)),this.UNDEFINED_GRADINGSCALE_ID=-1,this.gradingScalesOptions$=this.gradingScales$.pipe(S(g=>g.map(P=>{let B=P?.Id||this.UNDEFINED_GRADINGSCALE_ID,ge=P?.Grades.map(ve=>({Key:ve.Id,Value:ve.Designation}))||[];return{id:B,options:ge}}).reduce((P,B)=>j(L({},P),{[B.id]:B.options}),{})),J(1)),this.meanOfStudentGradesForCourse$=this.studentGrades$.pipe(S(g=>yn(Ot(g)))),this.meanOfFinalGradesForCourse$=W([this.gradingScalesOptions$,this.studentGrades$]).pipe(M(xe(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(M(e=>this.gradingOptions$(e.GradingScaleId)))}toStudentGrades(e,i=[],n){return Cn(e.ParticipatingStudents??[],i,e.Gradings??[],e.FinalGrades??[]).sort(_n(n))}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(ae(1),S(i=>{let{originalResult:n,updatedResult:d}=this.buildOptimisticResultUpdate(i,e);return this.updateTestResult(d,null),n}))}saveGrade(e,i){this.course$.pipe(ae(1),M(n=>this.coursesRestService.updateTestResult(n.Id,e).pipe(Ft(d=>(i&&this.updateTestResult(L({},i),null),Dt(()=>d)))))).subscribe(({testResult:n,grading:d})=>this.updateOrDeleteTestResult(e.testId,e.studentId,n,d,"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:i}){this.gradingsRestService.updateGrade(e,i).subscribe(()=>{this.action$.next({type:"final-grade-overwritten",payload:{id:e,selectedGradeId:i}})})}setAveragesAsFinalGrades(e){this.coursesRestService.setAverageAsFinalGrade(e).subscribe(i=>this.action$.next({type:"replace-grades",payload:i.Gradings}))}buildOptimisticResultUpdate(e,i){let n=ki(e,i.testId,i.studentId),d=n?L({},n):{Id:"",TestId:i.testId,StudentId:i.studentId,CourseRegistrationId:0,GradeId:null,GradeValue:null,GradeDesignation:null,Points:null};return d.GradeId="gradeId"in i?i.gradeId:n?.GradeId??null,d.Points="points"in i?i.points:n?.Points??null,{originalResult:n,updatedResult:d}}updateOrDeleteTestResult(e,i,n,d,h){n?this.updateTestResult(n,d,h):this.deleteTestResult(e,i,d)}updateTestResult(e,i,n){this.action$.next({type:"updateResult",payload:{testResult:e,grading:i??null,ignore:n}})}deleteTestResult(e,i,n){this.action$.next({type:"deleteResult",payload:{testId:e,studentId:i,grading:n}})}toggleTestPublishedState(e){this.action$.next({type:"toggle-test-state",payload:e})}gradingOptions$(e){return e===null?U(null):this.gradingScalesOptions$.pipe(S(i=>i[e]),J(1))}meanOfOverwrittenGradesForCourse(e,i){return this.course$.pipe(S(n=>{if(n.GradingScaleId===null||e[n.GradingScaleId]===void 0)return null;let d=e[n.GradingScaleId];return xn(Ot(i),d)}))}static{this.\u0275fac=function(i){return new(i||t)($(he),$(Bi),$(wn),$(be),$(Ni))}}static{this.\u0275prov=oe({token:t,factory:t.\u0275fac})}}return t})();var is=t=>["/events",t,"tests"];function ns(t,o){if(t&1&&(s(0,"div",7),p(1),l(2,"translate"),a()),t&2){let e=o.$implicit;r(),v(" ",F(2,1,"global.validation-errors."+e.error,e.params)," ")}}function rs(t,o){if(t&1&&(s(0,"div",7),p(1),l(2,"translate"),a()),t&2){let e=o.$implicit;r(),v(" ",F(2,1,"global.validation-errors."+e.error,e.params)," ")}}function ss(t,o){if(t&1&&(s(0,"div",7),p(1),l(2,"translate"),a()),t&2){let e=o.$implicit;r(),v(" ",F(2,1,"global.validation-errors."+e.error,e.params)," ")}}function as(t,o){if(t&1&&(s(0,"div",7),p(1),l(2,"translate"),a()),t&2){let e=o.$implicit;r(),v(" ",F(2,1,"global.validation-errors."+e.error,e.params)," ")}}function os(t,o){if(t&1&&(s(0,"div",7),p(1),l(2,"translate"),a()),t&2){let e=o.$implicit;r(),v(" ",F(2,1,"global.validation-errors."+e.error,e.params)," ")}}function ds(t,o){if(t&1&&(s(0,"div",29)(1,"div",30)(2,"div",16)(3,"label",31),p(4),l(5,"translate"),a(),s(6,"div",32),x(7,"input",33),l(8,"async"),H(9,as,3,4,"div",7,Me),l(11,"async"),a()()(),s(12,"div",30)(13,"div",16)(14,"label",34),p(15),l(16,"translate"),a(),s(17,"div",32),x(18,"input",35),l(19,"async"),H(20,os,3,4,"div",7,Me),l(22,"async"),a()()()(),s(23,"div",36),Ut(),s(24,"math")(25,"mi"),p(26),l(27,"translate"),a(),s(28,"mo"),p(29,"="),a(),s(30,"mfrac")(31,"mrow")(32,"mi"),p(33),l(34,"translate"),a(),s(35,"mo"),p(36,"\xD7"),a(),s(37,"mn"),p(38,"5"),a()(),s(39,"mi"),p(40),l(41,"translate"),a()(),s(42,"mo"),p(43,"+"),a(),s(44,"mn"),p(45,"1"),a()()()),t&2){let e,i,n=u(2);r(4),f(c(5,9,"tests.form.max-points")),r(3),de("is-invalid",((e=c(8,11,n.maxPointsErrors$))==null?null:e.length)||!1),r(2),N(c(11,13,n.maxPointsErrors$)),r(6),f(c(16,15,"tests.form.max-points-adjusted")),r(3),de("is-invalid",((i=c(19,17,n.maxPointsAdjustedErrors$))==null?null:i.length)||!1),r(2),N(c(22,19,n.maxPointsAdjustedErrors$)),r(6),v(" ",c(27,21,"tests.form.math.grade")," "),r(7),v(" ",c(34,23,"tests.form.math.points")," "),r(7),f(c(41,25,"tests.form.math.max-points"))}}function ls(t,o){t&1&&(s(0,"div",28)(1,"span",37),p(2,"Loading..."),a()())}function ps(t,o){if(t&1){let e=G();s(0,"form",2),b("ngSubmit",function(){w(e);let n=u();return E(n.onSubmit())}),s(1,"div",3)(2,"div",4)(3,"label",5),p(4),l(5,"translate"),a(),x(6,"input",6),l(7,"async"),l(8,"translate"),H(9,ns,3,4,"div",7,Me),l(11,"async"),a(),s(12,"div",8)(13,"label",9),p(14),l(15,"translate"),a(),s(16,"div",10)(17,"span",11)(18,"i",12),p(19,"calendar_today"),a()(),s(20,"input",13,0),l(22,"async"),l(23,"translate"),b("click",function(){w(e);let n=Se(21);return E(n.toggle())}),a(),H(24,rs,3,4,"div",7,Me),l(26,"async"),a()()(),s(27,"div",14)(28,"label",15),p(29),l(30,"translate"),a(),s(31,"div",4)(32,"div",16)(33,"label",17),p(34),l(35,"translate"),a(),s(36,"div",18),x(37,"input",19),l(38,"async"),H(39,ss,3,4,"div",7,Me),l(41,"async"),a()()()(),s(42,"div")(43,"label",15),p(44),l(45,"translate"),a(),s(46,"div",20),x(47,"input",21),s(48,"label",22),p(49),l(50,"translate"),a()(),s(51,"div",20),x(52,"input",23),s(53,"label",24),p(54),l(55,"translate"),a()(),T(56,ds,46,27),a(),s(57,"div",25)(58,"button",26),l(59,"async"),p(60),l(61,"translate"),a(),s(62,"button",27),p(63),l(64,"translate"),T(65,ls,3,0,"div",28),a()()()}if(t&2){let e,i,n,d,h=u();m("formGroup",h.formGroup),r(4),f(c(5,26,"tests.form.designation")),r(2),de("is-invalid",((e=c(7,28,h.designationErrors$))==null?null:e.length)||!1),m("placeholder",c(8,30,"tests.form.designation-placeholder")),r(3),N(c(11,32,h.designationErrors$)),r(5),f(c(15,34,"tests.form.date")),r(3),m("id",h.componentId),r(3),de("is-invalid",((i=c(22,36,h.dateErrors$))==null?null:i.length)||!1),m("placeholder",c(23,38,"shared.date-select.default-placeholder")),r(4),N(c(26,40,h.dateErrors$)),r(5),f(c(30,42,"tests.form.weight")),r(5),f(c(35,44,"tests.form.factor")),r(3),de("is-invalid",((n=c(38,46,h.weightErrors$))==null?null:n.length)||!1),r(2),N(c(41,48,h.weightErrors$)),r(5),f(c(45,50,"tests.form.grading-type")),r(3),m("value",!1),r(2),f(c(50,52,"tests.form.grades")),r(3),m("value",!0),r(2),f(c(55,54,"tests.form.points")),r(2),y((d=h.formGroup.get("isPointGrading"))!=null&&d.value?56:-1),r(2),m("disabled",h.saving)("routerLink",D(62,is,c(59,56,h.courseId$))),r(2),v(" ",c(61,58,"tests.form.cancel")," "),r(2),m("disabled",h.saving),r(),v(" ",c(64,60,"tests.form.save")," "),r(2),y(h.saving?65:-1)}}var St=(()=>{class t{constructor(e,i,n){this.fb=e,this.translate=i,this.testStateService=n,this.test=null,this.saving=!1,this.save=new ee,this.componentId=fi("bkd-tests-edit-form"),this.formGroup=this.createFormGroup(),this.submitted$=new q(!1),this.destroy$=new ie,this.designationErrors$=Re(U(this.formGroup),this.submitted$,"designation"),this.dateErrors$=Re(U(this.formGroup),this.submitted$,"date"),this.maxPointsErrors$=Re(U(this.formGroup),this.submitted$,"maxPoints"),this.maxPointsAdjustedErrors$=Re(U(this.formGroup),this.submitted$,"maxPointsAdjusted"),this.weightErrors$=Re(U(this.formGroup),this.submitted$,"weight"),this.courseId$=this.testStateService.courseId$}ngOnInit(){this.test&&this.setInitialValues(this.test),Ci(U(this.formGroup),"isPointGrading").pipe(Ce(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:["",Le.required],date:[null,Le.required],weight:[1,Le.compose([Le.required,gn(0)])],isPointGrading:[!1],maxPoints:[{value:null,disabled:!0},Le.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"),i=this.formGroup.get("maxPointsAdjusted");this.formGroup.get("isPointGrading")?.value?(e?.enable(),i?.enable()):(e?.reset({value:this.test?.MaxPoints,disabled:!0}),i?.reset({value:this.test?.MaxPointsAdjusted,disabled:!0}))}static{this.\u0275fac=function(i){return new(i||t)(C(di),C(X),C(K))}}static{this.\u0275cmp=_({type:t,selectors:[["bkd-tests-edit-form"]],inputs:{test:"test",saving:"saving"},outputs:{save:"save"},features:[ne([{provide:pi,useClass:ui},{provide:ci,useClass:Hi}])],decls:1,vars:1,consts:[["dp","ngbDatepicker"],[3,"formGroup"],[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"],[1,"invalid-feedback"],[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"],[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"],["role","status",1,"spinner-border","spinner-border-sm","align-middle"],[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"],[1,"visually-hidden"]],template:function(i,n){i&1&&T(0,ps,66,64,"form",1),i&2&&y(n.formGroup?0:-1)},dependencies:[De,ni,Ke,Je,ri,Ze,ti,oi,Xe,Qe,li,si,ai,mi,Q,Y,I],styles:["#factor[_ngcontent-%COMP%], #max-points[_ngcontent-%COMP%], #max-points-adjusted[_ngcontent-%COMP%]{width:5em}"]})}}return t})();var En=(()=>{class t{constructor(e,i,n,d,h){this.route=e,this.courseService=i,this.toastService=n,this.translate=d,this.router=h,this.saving$=new q(!1),this.courseId$=this.route.paramMap.pipe(S(g=>Number(g.get("id"))),Z())}save(e){this.saving$.next(!0);let{designation:i,date:n,weight:d,isPointGrading:h,maxPoints:g,maxPointsAdjusted:P}=e;this.courseId$.pipe(M(B=>this.courseService.add(B,n,i,d,h,g,P)),qe(()=>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=>void this.router.navigate(["events",e,"tests"]))}static{this.\u0275fac=function(i){return new(i||t)(C(re),C(he),C(tt),C(X),C(Ge))}}static{this.\u0275cmp=_({type:t,selectors:[["bkd-tests-add"]],decls:6,vars:6,consts:[[1,"bkd-container","bkd-container-limited"],[3,"save","saving"]],template:function(i,n){i&1&&(s(0,"h1"),p(1),l(2,"translate"),a(),s(3,"div",0)(4,"bkd-tests-edit-form",1),l(5,"async"),b("save",function(h){return n.save(h)}),a()()),i&2&&(r(),f(c(2,2,"tests.add-title")),r(3),m("saving",c(5,4,n.saving$)))},dependencies:[St,Y,I],encapsulation:2})}}return t})();var In=(()=>{class t{constructor(e){this.activeModal=e}get canDeleteTest(){return(this.test?.Results?.filter(i=>i.GradeId!==null||i.GradeValue!==null||i.Points!==null)||[]).length===0}static{this.\u0275fac=function(i){return new(i||t)(C(et))}}static{this.\u0275cmp=_({type:t,selectors:[["bkd-tests-delete"]],inputs:{test:"test"},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(i,n){i&1&&(s(0,"div",0)(1,"p",1),p(2),l(3,"translate"),a()(),s(4,"div",2)(5,"button",3),b("click",function(){return n.activeModal.dismiss()}),s(6,"span",4),p(7),l(8,"translate"),a()(),s(9,"button",5),b("click",function(){return n.activeModal.close(n.canDeleteTest?n.test:null)}),s(10,"span",6),p(11),l(12,"translate"),a()()()),i&2&&(r(2),v(" ",c(3,4,n.canDeleteTest?"tests.form.confirm":"tests.form.delete-not-allowed")," "),r(3),m("hidden",!n.canDeleteTest),r(2),v(" ",c(8,6,"tests.dialog.no")," "),r(4),v(" ",c(12,8,n.canDeleteTest?"tests.dialog.yes":"tests.dialog.ok")," "))},dependencies:[I],encapsulation:2})}}return t})();var hs=t=>({test:t});function gs(t,o){t&1&&x(0,"bkd-spinner")}function fs(t,o){if(t&1){let e=G();s(0,"div",1)(1,"h1"),p(2),l(3,"translate"),a(),s(4,"button",2),b("click",function(){w(e);let n=u(),d=O(0);return E(n.openDeleteModal(d))}),s(5,"i",3),p(6,"delete"),a()()(),s(7,"bkd-tests-edit-form",4),b("save",function(n){w(e);let d=u();return E(d.save(n))}),a()}if(t&2){u();let e=O(0),i=O(2);r(2),v(" ",F(3,3,"tests.edit-title",D(6,hs,e.Designation))," "),r(5),m("test",e)("saving",i)}}var kn=(()=>{class t{constructor(e,i,n,d,h,g,P){this.state=e,this.courseService=i,this.route=n,this.toastService=d,this.translate=h,this.router=g,this.modalService=P,this.saving$=new q(!1),this.testId$=this.route.paramMap.pipe(S(B=>Number(B.get("testId"))),Z()),this.test$=W([this.state.tests$,this.testId$]).pipe(S(([B,ge])=>B.find(ve=>ve.Id===ge)))}openDeleteModal(e){let i=this.modalService.open(In);i.componentInstance.test=e,i.result.then(n=>{n&&this.courseService.delete(e.CourseId,e.Id).subscribe(this.onDeleteSuccess.bind(this))},()=>{})}save(e){this.saving$.next(!0);let{designation:i,date:n,weight:d,isPointGrading:h,maxPoints:g,maxPointsAdjusted:P}=e;W([this.state.courseId$,this.testId$]).pipe(ae(1),M(([B,ge])=>this.courseService.update(B,ge,i,n,d,h,g,P)),qe(()=>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(ae(1)).subscribe(e=>void this.router.navigate(["events",e,"tests"]))}static{this.\u0275fac=function(i){return new(i||t)(C(K),C(he),C(re),C(tt),C(X),C(Ge),C(dt))}}static{this.\u0275cmp=_({type:t,selectors:[["bkd-tests-edit"]],decls:8,vars:9,consts:[[1,"bkd-container","bkd-container-limited"],[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(i,n){if(i&1&&(R(0),l(1,"async"),R(2),l(3,"async"),s(4,"div",0),T(5,gs,1,0,"bkd-spinner"),l(6,"async"),T(7,fs,8,8),a()),i&2){let d=A(c(1,1,n.test$));r(2),A(c(3,4,n.saving$)),r(3),y(c(6,7,n.state.loading$)?5:d?7:-1)}},dependencies:[St,ue,Y,I],encapsulation:2})}}return t})();var vs=t=>({designation:t}),Pn=(()=>{class t{constructor(e){this.activeModal=e}static{this.\u0275fac=function(i){return new(i||t)(C(et))}}static{this.\u0275cmp=_({type:t,selectors:[["bkd-publish-test"]],inputs:{test:"test"},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(i,n){i&1&&(s(0,"div",0)(1,"p",1),p(2),l(3,"translate"),a()(),s(4,"div",2)(5,"button",3),b("click",function(){return n.activeModal.dismiss()}),p(6),l(7,"translate"),a(),s(8,"button",4),b("click",function(){return n.activeModal.close(!0)}),p(9),l(10,"translate"),a()()),i&2&&(r(2),v(" ",F(3,3,n.test.IsPublished?"tests.publishing.unpublish":"tests.publishing.publish",D(10,vs,n.test.Designation))," "),r(4),v(" ",c(7,6,"tests.publishing.cancel")," "),r(3),v(" ",c(10,8,"tests.publishing.confirm")," "))},dependencies:[I],encapsulation:2})}}return t})();var Cs=t=>({maxPoints:t});function _s(t,o){if(t&1&&(s(0,"div",6),p(1),l(2,"translate"),a()),t&2){let e=u(2);r(),v(" ",F(2,1,"global.validation-errors.invalidPoints",D(4,Cs,e.maxPoints))," ")}}function Ss(t,o){if(t&1){let e=G();s(0,"div",3)(1,"input",5,0),b("ngModelChange",function(){w(e);let n=Se(2),d=u();return E(d.onPointsChange(n.value))}),a(),T(3,_s,3,6,"div",6),a()}if(t&2){let e=Se(2),i=u();r(),de("is-invalid",e.errors),le("max",i.maxPoints),le("tabindex",i.tabIndex),m("disabled",i.grade.test.IsPublished)("ngModel",i.grade.kind==="grade"?i.grade.result.Points:null),r(2),y(e.errors?3:-1)}}var ys=1250,Mn=(()=>{class t{constructor(e){this.state=e,this.maxPoints=0,this.pointsSubject$=new ie,this.gradeSubject$=new ie,this.gradingScaleDisabledSubject$=new q(!0),this.gradingScaleDisabled$=this.gradingScaleDisabledSubject$.asObservable(),this.destroy$=new ie}ngOnInit(){this.gradingScaleDisabledSubject$.next(this.disableGradingScale()),this.maxPoints=Sn(this.grade),this.initSave(this.pointsSubject$.pipe(fe(this.isValid.bind(this)),S(e=>({studentId:this.student.Id,testId:this.grade.test.Id,points:e?Number(e):null})))),this.initSave(this.gradeSubject$.pipe(S(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(Rt(i=>this.state.optimisticallyUpdateGrade(i).pipe(S(n=>({params:i,originalResult:n})))),Bt(ys),Ce(this.destroy$)).subscribe(({params:i,originalResult:n})=>this.state.saveGrade(i,n))}disableGradingScale(){return this.grade.test.IsPublished?!0:this.grade.kind==="no-result"?!1:this.grade.result.Points!=null&&this.grade.test.IsPointGrading}static{this.\u0275fac=function(i){return new(i||t)(C(K))}}static{this.\u0275cmp=_({type:t,selectors:[["bkd-grade"]],inputs:{grade:"grade",student:"student",tabIndex:"tabIndex",gradeOptions:"gradeOptions"},features:[ke],decls:5,vars:8,consts:[["points","ngModel"],[1,"d-flex","flex-column","w-100"],[1,"d-flex","flex-row"],[1,"point-input-container","me-2","me-md-3"],["data-testid","grade-select",1,"grade-select",3,"valueChange","options","allowEmpty","value","disabled","tabindex"],["type","number","step","0.01","min","0","data-testid","point-input",1,"form-control",3,"ngModelChange","max","disabled","tabindex","ngModel"],["data-testid","validation-error-message",1,"invalid-feedback"]],template:function(i,n){i&1&&(s(0,"div",1)(1,"div",2),T(2,Ss,4,7,"div",3),s(3,"bkd-select",4),l(4,"async"),b("valueChange",function(h){return n.onGradeChange(h)}),a()()()),i&2&&(r(2),y(n.grade.test.IsPointGrading?2:-1),r(),m("options",n.gradeOptions)("allowEmpty",!0)("value",n.grade.kind==="grade"?n.grade.result.GradeId:null)("disabled",c(4,6,n.gradingScaleDisabled$))("tabindex",n.tabIndex))},dependencies:[De,Ke,Je,Ze,Xe,Qe,ii,Be,Y,I],styles:[".point-input-container[_ngcontent-%COMP%]{width:4em}[_nghost-%COMP%] select{width:127px}@media (min-width: 576px){.point-input-container[_ngcontent-%COMP%]{width:5em}}"]})}}return t})();function xs(t,o){if(t&1&&(s(0,"span",1),p(1),a()),t&2){let e=u();r(),f(e.calculatePointsAverage(e.test))}}var On=(()=>{class t{constructor(e){this.locale=e}calculatePointsAverage(e){return this.safeAverage(e,2,st)}calculateGradeAverage(e){return this.safeAverage(e,3,at)}safeAverage(e,i,n){try{return Fi(n(e),this.locale,i)}catch{return Li}}static{this.\u0275fac=function(i){return new(i||t)(C(Qt))}}static{this.\u0275cmp=_({type:t,selectors:[["bkd-average-grades"]],inputs:{test:"test"},decls:4,vars:2,consts:[[1,"d-flex","flex-row","w-100"],["data-testid","average-points",1,"mr-2","mr-md-3","average-points"],["data-testid","average-grade"]],template:function(i,n){i&1&&(s(0,"div",0),T(1,xs,2,1,"span",1),s(2,"span",2),p(3),a()()),i&2&&(r(),y(n.test.IsPointGrading?1:-1),r(2),f(n.calculateGradeAverage(n.test)))},styles:[".average-points[_ngcontent-%COMP%]{min-width:4.5em}@media (min-width: 576px){.average-points[_ngcontent-%COMP%]{min-width:6em}}"]})}}return t})();var $n=(()=>{class t{constructor(){this.disabled=!1,this.width="127px",this.gradeIdSelected=new ee}onGradeChange(e){this.gradeId?.valueOf()!==void 0&&this.gradeIdSelected.emit({id:this.gradeId?.valueOf(),selectedGradeId:e})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["bkd-grade-select"]],inputs:{options:"options",valueId:"valueId",gradeId:"gradeId",disabled:"disabled",width:"width"},outputs:{gradeIdSelected:"gradeIdSelected"},decls:1,vars:5,consts:[["data-testid","grade-select",3,"valueChange","options","allowEmpty","value","disabled","width"]],template:function(i,n){i&1&&(s(0,"bkd-select",0),b("valueChange",function(h){return n.onGradeChange(h)}),a()),i&2&&m("options",n.options)("allowEmpty",!0)("value",n.valueId)("disabled",n.disabled)("width",n.width)},dependencies:[Be],encapsulation:2})}}return t})();var bs=576,Gn=(()=>{class t{constructor(e,i){this.portal=e,this.state=i,this.destroy$=new ie,this.handleWindowScroll=()=>{this.updateStickyVisibility(),this.updateStickyTopOffset()},this.handleWindowResize=()=>{this.updateStickyWidth(),this.updateStickyVisibility(),this.updateStickyTopOffset()},this.handleTableScroll=()=>{this.updateStickyLeftOffset()}}ngOnInit(){W([this.state.filteredTests$,this.state.expandedHeader$]).pipe(Ce(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":t,"btn-outline-secondary":o}),Dn=(()=>{class t{constructor(){this.filter=Gt,this.filterChange=new ee}showOnlyMine(){this.filterChange.next(j(L({},this.filter),{onlyMine:!0}))}showAll(){this.filterChange.next(j(L({},this.filter),{onlyMine:!1}))}onHidePublishedChange(e){let i=(e.target&&e.target instanceof HTMLInputElement&&e.target?.checked)??!1;this.filterChange.next(j(L({},this.filter),{hidePublished:i}))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["bkd-test-table-filter"]],inputs:{filter:"filter"},outputs:{filterChange:"filterChange"},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(i,n){i&1&&(s(0,"div",0)(1,"button",1),b("click",function(){return n.showAll()}),p(2),l(3,"translate"),a(),s(4,"button",2),b("click",function(){return n.showOnlyMine()}),p(5),l(6,"translate"),a()(),s(7,"div",3)(8,"div",4)(9,"input",5),b("change",function(h){return n.onHidePublishedChange(h)}),a(),s(10,"label",6),p(11),l(12,"translate"),a()()()),i&2&&(r(),m("ngClass",wt(12,Ln,!n.filter.onlyMine,n.filter.onlyMine)),r(),v(" ",c(3,6,"tests.all-tests")," "),r(2),m("ngClass",wt(15,Ln,n.filter.onlyMine,!n.filter.onlyMine)),r(),v(" ",c(6,8,"tests.owned-tests")," "),r(4),m("checked",n.filter.hidePublished),r(2),v(" ",c(12,10,"tests.hide-published")," "))},dependencies:[pe,De,I],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}"]})}}return t})();var Ts=["*"],Fn=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["bkd-preserve-line-height"]],ngContentSelectors:Ts,decls:3,vars:0,template:function(i,n){i&1&&(Zt(),s(0,"div"),Jt(1),p(2,"\xA0"),a())},encapsulation:2})}}return t})();var Rn=(()=>{class t{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")}`:""}static{this.\u0275fac=function(i){return new(i||t)(C(X,16))}}static{this.\u0275pipe=Kt({name:"testSummaryShort",type:t,pure:!0})}}return t})();var ws=t=>[t,"edit"];function Es(t,o){t&1&&(s(0,"i",9),p(1,"edit"),a())}function Is(t,o){if(t&1&&(s(0,"div",5)(1,"div",7)(2,"bkd-preserve-line-height"),p(3),l(4,"date"),a(),s(5,"a",8),T(6,Es,2,0,"i",9),a()(),s(7,"bkd-preserve-line-height"),p(8),l(9,"testSummaryShort"),a(),s(10,"bkd-preserve-line-height"),p(11),a()()),t&2){let e=u();r(3),f(F(4,5,e.test.Date,"dd.MM.yyyy")),r(2),m("routerLink",D(10,ws,e.test.Id)),r(),y(e.test.IsOwner&&e.test.IsPublished===!1?6:-1),r(2),v(" ",c(9,8,e.test)," "),r(3),f(e.test.Owner)}}function ks(t,o){if(t&1){let e=G();s(0,"div",6)(1,"a",10),l(2,"translate"),b("click",function(){w(e);let n=u();return E(n.unpublishTest())}),s(3,"i",11),p(4,"lock"),a(),s(5,"span"),p(6),l(7,"translate"),a()(),s(8,"bkd-caret",12),b("click",function(){w(e);let n=u();return E(n.emitToggleHeader())}),a()()}if(t&2){let e=u();r(),le("title",c(2,3,"tests.edit")),r(5),f(c(7,5,"tests.published")),r(2),m("expanded",e.expanded)}}function Ps(t,o){if(t&1){let e=G();s(0,"div",6)(1,"a",13),l(2,"translate"),b("click",function(){w(e);let n=u();return E(n.publishTest())}),s(3,"i",11),p(4,"lock_open"),a(),s(5,"span"),p(6),l(7,"translate"),a()(),s(8,"bkd-caret",12),b("click",function(){w(e);let n=u();return E(n.emitToggleHeader())}),a()()}if(t&2){let e=u();r(),le("title",c(2,3,"tests.publish")),r(5),f(c(7,5,"tests.not-published")),r(2),m("expanded",e.expanded)}}var Bn=(()=>{class t{constructor(){this.toggleHeader=new ee,this.publish=new ee,this.unpublish=new ee}emitToggleHeader(){this.toggleHeader.emit(!this.expanded)}publishTest(){this.publish.emit(this.test)}unpublishTest(){this.unpublish.emit(this.test)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["bkd-test-table-header"]],inputs:{test:"test",expanded:"expanded"},outputs:{toggleHeader:"toggleHeader",publish:"publish",unpublish:"unpublish"},decls:9,vars:5,consts:[[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"],[1,"d-flex","flex-column","mb-3"],[1,"d-flex","align-items-center","justify-content-between","test-status"],[1,"d-flex","flex-row","justify-content-between"],[1,"btn","btn-link","p-0","edit",3,"routerLink"],[1,"material-icons"],[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(i,n){i&1&&(s(0,"div",0)(1,"div",1),b("click",function(){return n.emitToggleHeader()}),s(2,"div",2),p(3),a(),x(4,"bkd-caret",3),a(),s(5,"div",4),T(6,Is,12,12,"div",5)(7,ks,9,7,"div",6)(8,Ps,9,7,"div",6),a()()),i&2&&(r(2),m("ngClass",n.expanded?"expanded":"collapsed"),r(),v(" ",n.test.Designation," "),r(),m("expanded",n.expanded),r(2),y(n.expanded?6:-1),r(),y(n.test.IsPublished?7:8))},dependencies:[pe,bi,Fn,Q,$e,I,Rn],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}}"]})}}return t})();var Ms=["bkdTestEditGradesHeader",""],Lt=(t,o)=>o.Id,Os=t=>({"test-point-grading":t}),$s=t=>({selected:t});function Gs(t,o){if(t&1){let e=G();s(0,"th",3)(1,"bkd-test-table-header",14),b("toggleHeader",function(n){w(e);let d=u();return E(d.state.toggleHeader(n))})("publish",function(n){w(e);let d=u();return E(d.publish.emit(n))})("unpublish",function(n){w(e);let d=u();return E(d.unpublish.emit(n))}),a()()}if(t&2){let e=o.$implicit,i=u(),n=O(4);m("ngClass",e.Id===(i.selectedTest==null?null:i.selectedTest.Id)?"selected":""),r(),m("test",e)("expanded",n)}}function Ls(t,o){if(t&1){let e=G();s(0,"th",4)(1,"bkd-test-table-header",14),b("toggleHeader",function(n){w(e);let d=u();return E(d.state.toggleHeader(n))})("publish",function(n){w(e);let d=u();return E(d.publish.emit(n))})("unpublish",function(n){w(e);let d=u();return E(d.unpublish.emit(n))}),a()()}if(t&2){let e=o.$implicit,i=u(),n=O(4);m("ngClass",e.Id===(i.selectedTest==null?null:i.selectedTest.Id)?"selected":""),r(),m("test",e)("expanded",n)}}function Ds(t,o){if(t&1){let e=G();s(0,"div",15)(1,"span",16),b("click",function(){w(e);let n=u().$implicit,d=u();return E(d.state.sortBy(n))}),p(2),l(3,"translate"),a()()}t&2&&(r(2),v("",c(3,1,"tests.points")," "))}function Fs(t,o){if(t&1){let e=G();s(0,"th",13)(1,"div",8),T(2,Ds,4,3,"div",15),s(3,"div",9)(4,"span",16),b("click",function(){let n=w(e).$implicit,d=u();return E(d.state.sortBy(n))}),p(5),l(6,"translate"),a()(),s(7,"div",10),p(8),l(9,"async"),a()()()}if(t&2){let e=o.$implicit,i=u();m("ngClass",e.Id===(i.selectedTest==null?null:i.selectedTest.Id)?"selected":""),r(2),y(e.IsPointGrading?2:-1),r(3),f(c(6,4,"tests.grade")),r(3),v(" ",c(9,6,i.state.getSortingChar$(e))," ")}}var jn=(()=>{class t{set shown(e){let i=this.element.nativeElement.classList;e?i.add("shown"):i.remove("shown")}constructor(e,i){this.state=e,this.element=i,this.sticky=!1,this.publish=new ee,this.unpublish=new ee}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(i=>i.getBoundingClientRect().width))}setColumnWidths(e){let i=this.getRowsAndColumns();if(i.length!==e.length||!i.every((n,d)=>n.length===e[d].length))throw new Error("Given column widths do not match number of header rows/columns");i.forEach((n,d)=>n.forEach((h,g)=>{h.style.width=`${e[d][g]}px`,h.style.minWidth=`${e[d][g]}px`}))}getStickyColumnsHeights(){return this.getRowsAndColumns(".sticky").map(e=>e.map(i=>i.getBoundingClientRect().height))}setStickyColumnHeights(e){let i=this.getRowsAndColumns(".sticky");if(i.length!==e.length||!i.every((n,d)=>n.length===e[d].length))throw new Error("Given column heights do not match number of sticky header columns");i.forEach((n,d)=>n.forEach((h,g)=>{h.style.height=`${e[d][g]}px`})),this.getRows().forEach((n,d)=>{let h=e[d].reduce((g,P)=>Math.max(g,P),0);n.style.height=`${h}px`})}getRowsAndColumns(e){return this.getRows().map(i=>Array.from(i.querySelectorAll(`th:not(.header-mobile)${e??""}`)))}getRows(){return Array.from(this.element.nativeElement.querySelectorAll("tr"))}static{this.\u0275fac=function(i){return new(i||t)(C(K),C(qt))}}static{this.\u0275cmp=_({type:t,selectors:[["thead","bkdTestEditGradesHeader",""]],hostVars:2,hostBindings:function(i,n){i&2&&de("sticky",n.sticky)},inputs:{selectedTest:"selectedTest",sticky:"sticky",shown:"shown"},outputs:{publish:"publish",unpublish:"unpublish"},attrs:Ms,decls:42,vars:32,consts:[[1,"header-collapsible"],["colspan","3",1,"desktop","sticky"],[3,"filterChange","filter"],["container","body",1,"test-grade","grade","test-info-desktop",3,"ngClass"],["container","body","colspan","3",1,"test-grade","header-mobile","test-info-mobile",3,"ngClass"],[1,"filler"],[3,"ngClass"],[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",1,"test-grade",3,"ngClass"],[3,"toggleHeader","publish","unpublish","test","expanded"],[1,"column-title","point-input-container","me-2","me-md-3"],[3,"click"]],template:function(i,n){if(i&1){let d=G();R(0),l(1,"async"),R(2),l(3,"async"),R(4),l(5,"async"),s(6,"tr",0)(7,"th",1)(8,"bkd-test-table-filter",2),b("filterChange",function(g){return w(d),E(n.state.setFilter(g))}),a()(),H(9,Gs,2,3,"th",3,Lt),H(11,Ls,2,3,"th",4,Lt),x(13,"th",5),a(),s(14,"tr",6)(15,"th",7),b("click",function(){return w(d),E(n.state.sortBy("FullName"))}),s(16,"div",8)(17,"div",9),p(18),l(19,"translate"),a(),s(20,"div",10),p(21),l(22,"async"),a()()(),s(23,"th",11),b("click",function(){return w(d),E(n.state.sortBy("FinalGrade"))}),s(24,"div",8)(25,"div",9),p(26),l(27,"translate"),a(),s(28,"div",10),p(29),l(30,"async"),a()()(),s(31,"th",12),b("click",function(){return w(d),E(n.state.sortBy("TestsMean"))}),s(32,"div",8)(33,"div",9),p(34),l(35,"translate"),a(),s(36,"div",10),p(37),l(38,"async"),a()()(),H(39,Fs,10,8,"th",13,Lt),x(41,"th",5),a()}if(i&2){let d=c(1,9,n.state.filteredTests$),h=c(3,11,n.state.filter$);r(4),A(c(5,13,n.state.expandedHeader$)),r(4),m("filter",h),r(),N(d),r(2),N(d),r(3),m("ngClass",D(28,Os,n.selectedTest==null?null:n.selectedTest.IsPointGrading)),r(4),v(" ",c(19,16,"tests.student.name")," "),r(3),v(" ",c(22,18,n.state.getSortingChar$("FullName"))," "),r(2),m("ngClass",D(30,$s,n.selectedTest===void 0)),r(3),v(" ",c(27,20,"tests.grade")," "),r(3),v(" ",c(30,22,n.state.getSortingChar$("FinalGrade"))," "),r(5),v(" ",c(35,24,"tests.mean")," "),r(3),v(" ",c(38,26,n.state.getSortingChar$("TestsMean"))," "),r(2),N(d)}},dependencies:[Y,pe,I,Dn,Bn],styles:["[_nghost-%COMP%]{--spacer: 16px;--point-input-size: 4em;--grade-input-size: 127px;--points-grade-gap: 1rem;--student-name-column-width: 225px;--student-grade-column-width: calc( var(--spacer) + var(--grade-input-size) + var(--spacer) );--student-average-column-width: 100px;--test-grade-column-width: calc( var(--spacer) + var(--point-input-size) + var(--points-grade-gap) + var(--grade-input-size) + var(--spacer) );--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}}@media (max-width: 767.98px){[_nghost-%COMP%]{--points-grade-gap: calc(.5 * var(--spacer))}}th[_ngcontent-%COMP%], td[_ngcontent-%COMP%]{padding:1rem}td[_ngcontent-%COMP%]{vertical-align:middle}@media (min-width: 576px){[_nghost-%COMP%]{--point-input-size: 5em}}tr[_ngcontent-%COMP%]:not(.header-collapsible) th.test-grade[_ngcontent-%COMP%], td.test-grade[_ngcontent-%COMP%]{width:var(--test-grade-column-width);min-width:var(--test-grade-column-width);max-width:var(--test-grade-column-width)}@media (max-width: 810px){tr[_ngcontent-%COMP%]:not(.header-collapsible):not(.test-point-grading) th.test-grade[_ngcontent-%COMP%], tr[_ngcontent-%COMP%]:not(.test-point-grading) th.student-grade[_ngcontent-%COMP%], table[_ngcontent-%COMP%]:not(.test-point-grading) td.test-grade[_ngcontent-%COMP%], table[_ngcontent-%COMP%]:not(.test-point-grading) td.student-grade[_ngcontent-%COMP%]{width:calc(var(--spacer) + var(--grade-input-size) + var(--spacer));min-width:calc(var(--spacer) + var(--grade-input-size) + var(--spacer));max-width:calc(var(--spacer) + var(--grade-input-size) + var(--spacer))}}th.filler[_ngcontent-%COMP%], .header-collapsible[_ngcontent-%COMP%] th.filler[_ngcontent-%COMP%], td.filler[_ngcontent-%COMP%]{padding:0;width:auto}@media (max-width: 810px){th.filler[_ngcontent-%COMP%], .header-collapsible[_ngcontent-%COMP%] th.filler[_ngcontent-%COMP%], td.filler[_ngcontent-%COMP%]{width:0}}th.test-grade[_ngcontent-%COMP%] .column-title.point-input-container[_ngcontent-%COMP%]{width:var(--point-input-size)}@media (max-width: 810px){.desktop[_ngcontent-%COMP%]:not(.selected), .student-grade[_ngcontent-%COMP%]:not(.selected), .student-average[_ngcontent-%COMP%], .test-grade[_ngcontent-%COMP%]:not(.selected){display:none}table[_ngcontent-%COMP%], tbody[_ngcontent-%COMP%], thead[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:100%}th[_ngcontent-%COMP%], tr[_ngcontent-%COMP%]{display:flex;width:100%}.student-name[_ngcontent-%COMP%]{flex:1;display:block;padding-right:0}.test-grade[_ngcontent-%COMP%]{flex:none;display:block}}@media (min-width: 811px){.mobile[_ngcontent-%COMP%]{display:none}.student-name[_ngcontent-%COMP%]{width:var(--student-name-column-width);min-width:var(--student-name-column-width);max-width:var(--student-name-column-width)}.student-grade[_ngcontent-%COMP%]{width:var(--student-grade-column-width);min-width:var(--student-grade-column-width);max-width:var(--student-grade-column-width)}.student-average[_ngcontent-%COMP%]{width:var(--student-average-column-width);min-width:var(--student-average-column-width);max-width:var(--student-average-column-width)}.test-grade[_ngcontent-%COMP%]{width:var(--test-grade-column-width);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})}}return t})();var Rs=(t,o)=>o.student.Id,Bs=(t,o)=>o.Id,js=(t,o)=>o.id,Vs=t=>({"test-point-grading":t}),Vn=t=>({selected:t}),As=t=>["student",t,"grades"],Hs=t=>({"visible-on-mobile":t});function Ns(t,o){if(t&1){let e=G();s(0,"bkd-grade-select",19),l(1,"async"),l(2,"async"),b("gradeIdSelected",function(n){w(e);let d=u(2);return E(d.state.overwriteFinalGrade(n))}),a()}if(t&2){let e=u().$implicit,i=u();m("options",c(1,4,i.state.gradingOptionsForCourse$()))("valueId",e.finalGrade.finalGradeId)("gradeId",e.finalGrade.id)("disabled",c(2,6,i.isEditFinalGradesAllowed(e))===!1)}}function Us(t,o){if(t&1&&(s(0,"div"),p(1),a()),t&2){let e=u().$implicit;r(),v(" ",e.finalGrade.freeHandGrade," ")}}function Ws(t,o){if(t&1&&(R(0),s(1,"td",11),x(2,"bkd-grade",20),l(3,"async"),a()),t&2){let e=o.$implicit,i=o.$index,n=u(),d=n.$implicit,h=n.$index,g=u(),P=e.grade;r(),m("ngClass",g.selectedTest!==void 0&&P.test.Id===g.selectedTest.Id?"selected":""),r(),m("grade",P)("gradeOptions",c(3,5,g.state.gradingOptionsForTest$(P.test)))("student",d.student)("tabIndex",(1+i)*1e3+h)}}function zs(t,o){if(t&1&&(s(0,"tr")(1,"td",6)(2,"a",15)(3,"div"),p(4),a(),s(5,"div",8),p(6),l(7,"translate"),l(8,"decimalOrDash"),a()()(),s(9,"td",16),T(10,Ns,3,8,"bkd-grade-select",17)(11,Us,2,1,"div"),a(),s(12,"td",18),p(13),l(14,"decimalOrDash"),a(),H(15,Ws,4,7,"td",11,js),x(17,"td",12),a()),t&2){let e=o.$implicit,i=u();r(2),m("routerLink",D(16,As,e.student.Id)),r(2),f(e.student.FullName),r(2),Ue(" ",c(7,8,"tests.mean"),": ",F(8,10,e.finalGrade==null?null:e.finalGrade.average,"1-3")," "),r(3),m("ngClass",D(18,Vn,i.selectedTest===void 0)),r(),y(e.finalGrade&&!e.finalGrade.freeHandGrade?10:-1),r(),y(e.finalGrade&&e.finalGrade.freeHandGrade?11:-1),r(2),v(" ",F(14,13,e.finalGrade==null?null:e.finalGrade.average,"1-3")," "),r(2),N(i.getGrades(e))}}function qs(t,o){if(t&1&&(s(0,"td",11),x(1,"bkd-average-grades",21),a()),t&2){let e=o.$implicit,i=u();m("ngClass",e.Id===(i.selectedTest==null?null:i.selectedTest.Id)||e.Id===(i.selectedTest==null?null:i.selectedTest.Id)?"selected":""),r(),m("test",e)}}function Ys(t,o){if(t&1){let e=G();s(0,"button",22),b("click",function(){w(e);let n=u();return E(n.setAverageAsFinalGrade())}),p(1),l(2,"translate"),a()}if(t&2){let e=u(),i=O(2);m("ngClass",D(4,Hs,!i||!e.selectedTest)),r(),v(" ",c(2,2,"tests.set-final-grade")," ")}}var An=(()=>{class t{constructor(e,i){this.state=e,this.modalService=i}ngOnInit(){this.state.setSorting({key:"FullName",ascending:!0})}setAverageAsFinalGrade(){this.state.course$.pipe(ae(1)).subscribe(e=>this.state.setAveragesAsFinalGrades({CourseIds:[e.Id]}))}isEditFinalGradesAllowed(e){return this.state.course$.pipe(S(i=>!!(ut(i)?.value&&e.finalGrade?.canGrade)))}getGrades(e){return e.grades.flatMap(i=>({id:`${e.student.Id}-${i.test.Id}`,grade:i}))}publish(e){let i=this.openModal(e);this.onCloseModal(i,()=>this.state.publish(e))}unpublish(e){let i=this.openModal(e);this.onCloseModal(i,()=>this.state.unpublish(e))}calculatePointsAverage(e){return this.safeAverage(e,st)}calculateGradeAverage(e){return this.safeAverage(e,at)}safeAverage(e,i){try{return i(e).toString()}catch{return"\u2013"}}openModal(e){let i=this.modalService.open(Pn);return i.componentInstance.test=e,i}onCloseModal(e,i){e.result.then(n=>{n&&i()},()=>{})}static{this.\u0275fac=function(i){return new(i||t)(C(K),C(dt))}}static{this.\u0275cmp=_({type:t,selectors:[["bkd-test-edit-grades"]],inputs:{selectedTest:"selectedTest"},features:[ne([Ne])],decls:40,vars:45,consts:[["inlineHeader",""],["stickyHeader",""],[1,"table-responsive-wrapper"],["bkdTestEditGradesHeaderSticky","",1,"table","table-hover","h-100",3,"ngClass","inlineHeader","stickyHeader"],["bkdTestEditGradesHeader","",3,"publish","unpublish","selectedTest"],["bkdTestEditGradesHeader","",3,"publish","unpublish","sticky","selectedTest"],[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"],[1,"test-grade",3,"ngClass"],[1,"filler"],[1,"action-buttons"],["data-testId","apply-average-button","type","button",1,"apply-average-button","btn","btn-primary","m-3",3,"ngClass"],[3,"routerLink"],[1,"sticky","student-grade",3,"ngClass"],[3,"options","valueId","gradeId","disabled"],[1,"border-end","sticky","student-average"],[3,"gradeIdSelected","options","valueId","gradeId","disabled"],[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(i,n){if(i&1){let d=G();R(0),l(1,"async"),R(2),l(3,"async"),R(4),l(5,"async"),s(6,"div",2)(7,"table",3)(8,"thead",4,0),b("publish",function(g){return w(d),E(n.publish(g))})("unpublish",function(g){return w(d),E(n.unpublish(g))}),a(),s(10,"thead",5,1),b("publish",function(g){return w(d),E(n.publish(g))})("unpublish",function(g){return w(d),E(n.unpublish(g))}),a(),s(12,"tbody"),H(13,zs,18,20,"tr",null,Rs),s(15,"tr")(16,"td",6)(17,"div",7)(18,"div"),p(19),l(20,"translate"),a(),s(21,"div",8),p(22),l(23,"translate"),l(24,"async"),l(25,"decimalOrDash"),a()()(),s(26,"td",9),p(27),l(28,"async"),l(29,"decimalOrDash"),a(),s(30,"td",10),p(31),l(32,"async"),l(33,"decimalOrDash"),a(),H(34,qs,2,2,"td",11,Bs),x(36,"td",12),a()()(),s(37,"div",13),T(38,Ys,3,6,"button",14),l(39,"async"),a()()}if(i&2){let d=Se(9),h=Se(11),g=c(1,13,n.state.filteredTests$);r(2),A(c(3,15,n.state.hasTests$));let P=c(5,18,n.state.studentGrades$);r(5),m("ngClass",D(41,Vs,n.selectedTest==null?null:n.selectedTest.IsPointGrading))("inlineHeader",d)("stickyHeader",h),r(),m("selectedTest",n.selectedTest),r(2),m("sticky",!0)("selectedTest",n.selectedTest),r(3),N(P),r(6),f(c(20,20,"tests.average")),r(3),Ue(" ",c(23,22,"tests.mean"),": ",F(25,26,c(24,24,n.state.meanOfStudentGradesForCourse$),"1-3")," "),r(4),m("ngClass",D(43,Vn,n.selectedTest===void 0)),r(),v(" ",F(29,31,c(28,29,n.state.meanOfFinalGradesForCourse$),"1-3")," "),r(4),v(" ",F(33,36,c(32,34,n.state.meanOfStudentGradesForCourse$),"1-3")," "),r(3),N(g),r(4),y(c(39,39,n.state.canSetFinalGrade$)?38:-1)}},dependencies:[pe,Q,$n,Mn,On,Y,I,Di,Gn,jn],styles:["[_nghost-%COMP%]{--spacer: 16px;--point-input-size: 4em;--grade-input-size: 127px;--points-grade-gap: 1rem;--student-name-column-width: 225px;--student-grade-column-width: calc( var(--spacer) + var(--grade-input-size) + var(--spacer) );--student-average-column-width: 100px;--test-grade-column-width: calc( var(--spacer) + var(--point-input-size) + var(--points-grade-gap) + var(--grade-input-size) + var(--spacer) );--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}}@media (max-width: 767.98px){[_nghost-%COMP%]{--points-grade-gap: calc(.5 * var(--spacer))}}th[_ngcontent-%COMP%], td[_ngcontent-%COMP%]{padding:1rem}td[_ngcontent-%COMP%]{vertical-align:middle}@media (min-width: 576px){[_nghost-%COMP%]{--point-input-size: 5em}}tr[_ngcontent-%COMP%]:not(.header-collapsible) th.test-grade[_ngcontent-%COMP%], td.test-grade[_ngcontent-%COMP%]{width:var(--test-grade-column-width);min-width:var(--test-grade-column-width);max-width:var(--test-grade-column-width)}@media (max-width: 810px){tr[_ngcontent-%COMP%]:not(.header-collapsible):not(.test-point-grading) th.test-grade[_ngcontent-%COMP%], tr[_ngcontent-%COMP%]:not(.test-point-grading) th.student-grade[_ngcontent-%COMP%], table[_ngcontent-%COMP%]:not(.test-point-grading) td.test-grade[_ngcontent-%COMP%], table[_ngcontent-%COMP%]:not(.test-point-grading) td.student-grade[_ngcontent-%COMP%]{width:calc(var(--spacer) + var(--grade-input-size) + var(--spacer));min-width:calc(var(--spacer) + var(--grade-input-size) + var(--spacer));max-width:calc(var(--spacer) + var(--grade-input-size) + var(--spacer))}}th.filler[_ngcontent-%COMP%], .header-collapsible[_ngcontent-%COMP%] th.filler[_ngcontent-%COMP%], td.filler[_ngcontent-%COMP%]{padding:0;width:auto}@media (max-width: 810px){th.filler[_ngcontent-%COMP%], .header-collapsible[_ngcontent-%COMP%] th.filler[_ngcontent-%COMP%], td.filler[_ngcontent-%COMP%]{width:0}}th.test-grade[_ngcontent-%COMP%] .column-title.point-input-container[_ngcontent-%COMP%]{width:var(--point-input-size)}@media (max-width: 810px){.desktop[_ngcontent-%COMP%]:not(.selected), .student-grade[_ngcontent-%COMP%]:not(.selected), .student-average[_ngcontent-%COMP%], .test-grade[_ngcontent-%COMP%]:not(.selected){display:none}table[_ngcontent-%COMP%], tbody[_ngcontent-%COMP%], thead[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:100%}th[_ngcontent-%COMP%], tr[_ngcontent-%COMP%]{display:flex;width:100%}.student-name[_ngcontent-%COMP%]{flex:1;display:block;padding-right:0}.test-grade[_ngcontent-%COMP%]{flex:none;display:block}}@media (min-width: 811px){.mobile[_ngcontent-%COMP%]{display:none}.student-name[_ngcontent-%COMP%]{width:var(--student-name-column-width);min-width:var(--student-name-column-width);max-width:var(--student-name-column-width)}.student-grade[_ngcontent-%COMP%]{width:var(--student-grade-column-width);min-width:var(--student-grade-column-width);max-width:var(--student-grade-column-width)}.student-average[_ngcontent-%COMP%]{width:var(--student-average-column-width);min-width:var(--student-average-column-width);max-width:var(--student-average-column-width)}.test-grade[_ngcontent-%COMP%]{width:var(--test-grade-column-width);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%], tbody[_ngcontent-%COMP%] td.student-name[_ngcontent-%COMP%] *[_ngcontent-%COMP%]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}tbody[_ngcontent-%COMP%] td.student-name[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{text-decoration:none}tbody[_ngcontent-%COMP%] td.student-name[_ngcontent-%COMP%] a[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:first-child{text-decoration:underline}tbody[_ngcontent-%COMP%] td.student-name[_ngcontent-%COMP%] a[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:first-child:hover{text-decoration-color:#ea161f}.student-average-inline[_ngcontent-%COMP%]{color:#4e4e4ef2;font-size:.875rem;line-height:1}@media (min-width: 811px){.table-responsive-wrapper[_ngcontent-%COMP%]{display:block;overflow-x:auto}table[_ngcontent-%COMP%]{border-collapse:separate;border-spacing:0}.action-buttons[_ngcontent-%COMP%]{position:sticky;left:0}}@media (max-width: 810px){.apply-average-button[_ngcontent-%COMP%]:not(.visible-on-mobile){display:none!important}}"]})}}return t})();var Ks=()=>["/events"],Zs=t=>({count:t});function Js(t,o){if(t&1&&(s(0,"div",7),p(1),l(2,"translate"),a()),t&2){let e=u();r(),v(" ",F(2,1,e.course.ParticipatingStudents.length===1?"courses.registration":"courses.registrations",D(4,Zs,e.course.ParticipatingStudents.length))," ")}}var Hn=(()=>{class t{constructor(e){this.reportsService=e,this.course$=new q(null),this.reports$=this.course$.pipe(S(i=>i?.Id),Z(),M(i=>i?this.reportsService.getCourseTestsReports(i):U([])),Vt([]))}ngOnChanges(e){e.course&&this.course$.next(e.course.currentValue)}getDesignation(){return ht(this.course)}static{this.\u0275fac=function(i){return new(i||t)(C(ot))}}static{this.\u0275cmp=_({type:t,selectors:[["bkd-tests-header"]],inputs:{course:"course"},features:[ke],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"],[1,"additional-info"]],template:function(i,n){i&1&&(s(0,"bkd-backlink",0)(1,"div",1)(2,"a",2)(3,"i",3),p(4,"add"),a()(),x(5,"bkd-reports-link",4),l(6,"async"),x(7,"div",5),a()(),s(8,"div",6)(9,"h1"),p(10),a(),T(11,Js,3,6,"div",7),a()),i&2&&(m("link",Oe(6,Ks)),r(5),m("reports",c(6,4,n.reports$)),r(5),f(n.getDesignation()),r(),y(n.course.ParticipatingStudents?11:-1))},dependencies:[Ve,Q,nt,Y,I],styles:[".header[_ngcontent-%COMP%]{padding-bottom:1rem;border-bottom:1px solid #dee2e6}h1[_ngcontent-%COMP%]{margin-bottom:0}.additional-info[_ngcontent-%COMP%]{color:#adb5bd}"]})}}return t})();var Qs=()=>[],Xs=t=>({"visible-on-mobile":t});function ea(t,o){t&1&&x(0,"bkd-spinner")}function ta(t,o){if(t&1){let e=G();s(0,"bkd-select",4),b("valueChange",function(n){w(e);let d=u(2);return E(n&&d.testSelected(n))}),a(),x(1,"bkd-test-edit-grades",5)}if(t&2){u(2);let e=O(6),i=O(8),n=O(10);m("options",e)("value",i)("allowEmpty",!1),r(),m("selectedTest",n)}}function ia(t,o){t&1&&(s(0,"p",2),p(1),l(2,"translate"),a()),t&2&&(r(),f(c(2,1,"tests.no-tests")))}function na(t,o){if(t&1&&(s(0,"a",3),l(1,"async"),s(2,"i",6),p(3,"arrow_right_alt"),a(),s(4,"span",7),p(5),l(6,"translate"),a()()),t&2){let e=u(2),i=O(4),n=O(10);le("href",c(1,3,e.buildLinkToRatingOverview()),_e),m("ngClass",D(7,Xs,!i||!n)),r(5),f(c(6,5,"tests.link-to-rating-overview"))}}function ra(t,o){if(t&1&&(x(0,"bkd-tests-header",1),T(1,ta,2,4)(2,ia,3,3,"p",2)(3,na,7,9,"a",3),l(4,"async")),t&2){let e=u(),i=O(0),n=O(2);m("course",i),r(),y(n.length>0?1:2),r(2),y(c(4,3,e.state.canSetFinalGrade$)?3:-1)}}var Nn=(()=>{class t{constructor(e,i,n){this.settings=e,this.state=i,this.translate=n,this.selectTest$=new ie,this.testOptions$=this.state.tests$.pipe(S(d=>[{Key:-1,Value:this.translate.instant("tests.grade")},...d.map(h=>({Key:h.Id,Value:h.Designation}))]),Z()),this.selectedTestId$=ze(this.selectTest$,this.state.tests$.pipe(ae(1),S(d=>d[0]?.Id))).pipe(Z()),this.selectedTest$=this.selectedTestId$.pipe(M(d=>this.state.tests$.pipe(S(h=>h.find(g=>g.Id===d)))),Z())}testSelected(e){this.selectTest$.next(e)}buildLinkToRatingOverview(){return this.state.course$.pipe(ae(1),S(e=>this.settings.eventlist.evaluation.replace(":id",String(e.Id))))}static{this.\u0275fac=function(i){return new(i||t)(C(ce),C(K),C(X))}}static{this.\u0275cmp=_({type:t,selectors:[["bkd-tests-list"]],decls:16,vars:22,consts:[[1,"bkd-container"],[3,"course"],[1,"mt-3","px-3"],[1,"rating-overview","d-flex","justify-content-end","pe-3","border-top","pt-3",3,"ngClass","href"],["width","100%",1,"tests-dropdown",3,"valueChange","options","value","allowEmpty"],[3,"selectedTest"],[1,"material-icons","fw-bold"],[1,"ps-1"]],template:function(i,n){if(i&1&&(R(0),l(1,"async"),R(2),l(3,"async"),R(4),l(5,"async"),R(6),l(7,"async"),R(8),l(9,"async"),R(10),l(11,"async"),s(12,"div",0),T(13,ea,1,0,"bkd-spinner"),l(14,"async"),T(15,ra,5,5),a()),i&2){let d;A(c(1,1,n.state.course$)),r(2),A((d=c(3,4,n.state.tests$))!==null&&d!==void 0?d:Oe(21,Qs)),r(2),A(c(5,7,n.state.hasTests$)),r(2),A(c(7,10,n.testOptions$)),r(2),A(c(9,13,n.selectedTestId$)),r(2),A(c(11,16,n.selectedTest$)),r(3),y(c(14,19,n.state.loading$)?13:15)}},dependencies:[Hn,Be,An,pe,ue,Y,I],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}}"]})}}return t})();var yt=(()=>{class t{constructor(e,i){this.state=e,this.route=i,this.courseId$=this.route.paramMap.pipe(S(n=>Number(n.get("id"))),Z()),this.destroy$=new ie}ngOnInit(){this.courseId$.pipe(Ce(this.destroy$)).subscribe(e=>this.state.setCourseId(e))}ngOnDestroy(){this.destroy$.next()}static{this.\u0275fac=function(i){return new(i||t)(C(K),C(re))}}static{this.\u0275cmp=_({type:t,selectors:[["bkd-tests"]],features:[ne([K])],decls:1,vars:0,template:function(i,n){i&1&&x(0,"router-outlet")},dependencies:[ye],encapsulation:2})}}return t})();function Un(t){return{path:t,component:mn,children:[{path:"",component:pn},{path:"study-course-student/:id",component:cn},It]}}var xc=[{path:"",component:hn,children:[{path:"",component:un},{path:"current",component:tn,children:[{path:"",component:en},Un(":id")]},{path:":id",component:yt,children:[{path:"tests",component:Nn},Un("students")]},{path:":id/tests/:testId/edit",component:yt,children:[{path:"",component:kn}]},{path:":id/tests/add",component:yt,children:[{path:"",component:En}]},{path:":id/tests",children:[It]}]}];export{Yi as a,Un as b,xc as c}; diff --git a/public/apps/webapp-schulverwaltung/chunk-2FW5UFUO.js b/public/apps/webapp-schulverwaltung/chunk-2FW5UFUO.js deleted file mode 100644 index b1a42a48..00000000 --- a/public/apps/webapp-schulverwaltung/chunk-2FW5UFUO.js +++ /dev/null @@ -1,2 +0,0 @@ -import{a as ct}from"./chunk-LHXVMKYN.js";import{a as lt,b as pt}from"./chunk-QB4DIFWS.js";import{a as Vi}from"./chunk-RTY26FN4.js";import{a as It}from"./chunk-3HCVMNJA.js";import{e as Ai}from"./chunk-5WNFCBTP.js";import{a as wt,b as ki,c as Pi,d as Mi,e as Oi,f as st,g as at,h as $i,i as Gi,j as Li,k as Di,l as Fi,m as Be,o as Ri,p as he,r as je,s as Bi,u as ji,v as dt}from"./chunk-A3CECLYB.js";import{e as xi}from"./chunk-746ASKQ4.js";import{b as rt}from"./chunk-DTTSX64G.js";import{a as yi}from"./chunk-Y4QYVF5K.js";import{a as Hi}from"./chunk-BIDSHCYH.js";import{a as mt,c as Ni}from"./chunk-4RZQAAPF.js";import{a as wi,b as Ii}from"./chunk-Z4YBXGVO.js";import{a as bi,d as ot}from"./chunk-3L4RH6QP.js";import{a as Ti,d as Ei}from"./chunk-DTYYCJHM.js";import{L as Si,U as Ae,p as _i}from"./chunk-SRCW6BUG.js";import{a as Re,c as Ci,l as xe}from"./chunk-GOGVGWFJ.js";import{a as nt,b as be}from"./chunk-OSOXMODN.js";import{a as it,b as ue}from"./chunk-PSYDBHTH.js";import{a as ei,b as re,h as pi,i as ci,k as mi,l as ui,r as et,w as me}from"./chunk-W4U7QKJF.js";import{a as tt}from"./chunk-AVBHFGIF.js";import{$ as Vt,$a as a,$b as pe,Ab as R,Ad as De,B as Ft,Bb as A,Bd as li,C as Rt,Cb as O,D as Bt,Db as ie,Ea as bt,Eb as Oe,F as ae,Fa as Pe,Fb as D,Ga as C,Gb as Et,H as Z,Hd as hi,Ia as Yt,Id as gi,J as qe,Ja as Kt,Jb as l,K as jt,Kb as c,Kd as fi,Lb as F,M as Q,Md as vi,Na as T,O as At,Ob as Xt,Od as se,P as M,Pd as I,Qa as m,R as Ce,Ra as de,Rd as Fe,Sb as W,Tb as Jt,Va as y,X as oe,Xa as Me,Ya as V,Za as H,_ as $,_a as s,a as L,ab as x,b as B,ba as Ht,ca as Nt,cc as Y,cd as ce,da as ke,dc as $e,ea as E,eb as G,f as te,fa as w,fd as Ke,g as q,gb as b,h as xt,ha as Ut,hb as u,hd as Le,ib as Zt,id as Ze,jb as Qt,jd as ti,ka as Wt,kb as le,l as N,lb as Tt,lc as Ye,m as Dt,ma as J,md as ii,n as _,nd as ni,o as U,od as Qe,pa as zt,pd as ri,qa as j,qb as Se,ra as qt,rb as p,rd as si,sb as f,sd as ai,tb as v,ub as Ne,w as ze,wa as _e,wc as ne,wd as Xe,x as fe,xa as r,xb as Ee,xc as ye,xd as Je,ya as S,yb as we,yc as Ge,yd as oi,zb as Ie,zc as X,zd as di}from"./chunk-2W7IS4PN.js";var zn=t=>[t,"tests"];function qn(t,o){if(t&1&&(s(0,"span"),p(1),l(2,"date"),x(3,"wbr"),p(4),l(5,"date"),a()),t&2){let e=u();r(),v("",F(2,2,e.event().dateFrom,"dd.MM.yyyy"),"\u2013"),r(3),f(F(5,5,e.event().dateTo,"dd.MM.yyyy"))}}function Yn(t,o){if(t&1&&(s(0,"a",6)(1,"i",7),p(2,"arrow_right_alt"),a(),s(3,"span",8),p(4),a()()),t&2){let e=u(2);m("routerLink",D(2,zn,e.event().id)),r(4),f(e.event().evaluationText)}}function Kn(t,o){if(t&1&&(s(0,"a",6)(1,"i",7),p(2,"arrow_right_alt"),a(),s(3,"span",8),p(4),a()()),t&2){let e=u(2);m("routerLink",e.event().evaluationLink),r(4),v("",e.event().evaluationText," ")}}function Zn(t,o){if(t&1&&(s(0,"div",5),T(1,Yn,5,4,"a",6)(2,Kn,5,2,"a",6),a()),t&2){let e=u();r(),y(e.event().evaluationLink?-1:1),r(),y(e.event().evaluationLink?2:-1)}}var Ui=(()=>{class t{constructor(){this.event=j.required(),this.withRatings=j(!0),this.link=W(()=>Ei(this.event().detailLink))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=C({type:t,selectors:[["bkd-events-list-entry"]],inputs:{event:[1,"event"],withRatings:[1,"withRatings"]},decls:11,vars:9,consts:[[1,"designation"],[3,"routerLink","queryParams"],[1,"date"],[1,"registrations"],[1,"registrations-label"],[1,"rating"],[1,"d-flex",3,"routerLink"],[1,"material-icons"],[1,"ps-1"]],template:function(i,n){i&1&&(s(0,"div",0)(1,"a",1),p(2),a()(),s(3,"div",2),T(4,qn,6,8,"span"),a(),s(5,"div",3),p(6),s(7,"span",4),p(8),l(9,"translate"),a()(),T(10,Zn,3,2,"div",5)),i&2&&(r(),m("routerLink",n.link().link)("queryParams",n.link().params),r(),f(n.event().designation),r(2),y(n.event().dateFrom&&n.event().dateTo?4:-1),r(2),v(" ",n.event().studentCount," "),r(2),f(c(9,7,n.event().studentCount===1?"events.registration":"events.registrations")),r(2),y(n.withRatings()&&n.event().evaluationText?10:-1))},dependencies:[X,$e,I],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}}']})}}return t})();var Qn=10300,Xn=10260,Jn=10250,er=14030,tr=10350;function ut(t){let{HasEvaluationStarted:o,EvaluationUntil:e,HasTestGrading:i}=t.EvaluationStatusRef;if(o===!0&&(t.StatusId===er||t.StatusId===tr))return{value:ee.Rating};if(o===!0&&i===!1){if(e)return{value:ee.RatingUntil};if(t.StatusId===Qn)return{value:ee.IntermediateRating}}return o===!1&&i===!0&&t.StatusId!==Xn&&t.StatusId!==Jn?{value:ee.Tests}:o===!0&&i===!0?e?{value:ee.Tests,label:ee.RatingUntil}:{value:ee.Tests,label:ee.IntermediateRating}:null}function Wi(t){return t.EvaluationStatusRef.HasEvaluationStarted===!0}function zi(t){return t.EvaluationStatusRef.HasReviewOfEvaluationStarted===!0&&!!t.FinalGrades?.length}function ht(t){let o=t.Classes?t.Classes.map(e=>e.Number).join(", "):null;return o?t.Designation+", "+o:t.Designation}function qi(t,o){return t?(o.Leadership??"").split(",").some(e=>e.trim()===t.fullname):!1}function Yi(t,o){let e=new URLSearchParams({returnlink:o});return o.startsWith("/dashboard")?`/dashboard/students/${t}?${e}`:o.startsWith("/events/current")?`/events/current/${t}?${e}`:`/events/${t}/students?${e}`}function Ki(t){let o=t.ParticipatingStudents?.map(e=>({id:e.Id,name:e.FullName,email:e.DisplayEmail??void 0}))??[];return{eventId:t.Id,eventDesignation:t.Designation,studyClasses:(t.Classes??[]).map(e=>e.Designation).sort(),entries:o}}function kt(t,o){return B(L({},t),{entries:t.entries.map(e=>{let i=o.find(d=>d.StudentId===e.id),n=i?[i.CompanyName,i.CompanyNameAddition].filter(Boolean).join(" \u2013 "):void 0;return B(L({},e),{company:n})})})}function Pt(t,o,e,{emailFallback:i}={}){return{eventId:t,eventDesignation:e[0]?.EventDesignation??"",studyClasses:[],entries:o.map(n=>({id:n.Id,subscriptionId:e.find(d=>d.PersonId===n.Id)?.Id,name:n.FullName,email:(i?n.DisplayEmail??n.Email:n.DisplayEmail)??void 0,status:e.find(d=>d.PersonId===n.Id)?.Status}))}}function Zi(t,o){return B(L({},t),{entries:t.entries.map(e=>B(L({},e),{studyClass:o.find(i=>i.StudentRef.Id===e.id)?.StudyClassNumber}))})}var ee=function(t){return t.Rating="rating",t.RatingUntil="rating-until",t.IntermediateRating="intermediate-rating",t.Tests="add-tests",t}(ee||{}),He=(()=>{class t{constructor(e,i,n,d,h,g,k,z,ge){this.coursesRestService=e,this.eventsRestService=i,this.studyClassRestService=n,this.subscriptionsRestService=d,this.loadingService=h,this.storageService=g,this.translate=k,this.router=z,this.settings=ge,this.loading$=this.loadingService.loading$,this.searchFields$=new q(["designation"]),this.searchSubject$=new q(""),this.search$=this.searchSubject$.asObservable(),this.roles$=new q(null),this.isClassTeacher$=this.roles$.pipe(_(ve=>yi(ve,"ClassTeacherRole")),Q(1)),this.withStudyCourses$=new q(!1),this.unratedCourses$=this.roles$.pipe(M(this.loadUnratedCourses.bind(this)),Q(1)),this.studyCourses$=this.withStudyCourses$.pipe(M(this.loadStudyCourses.bind(this)),Q(1)),this.formativeAssessments$=this.isClassTeacher$.pipe(M(this.loadFormativeAssessments.bind(this)),Q(1)),this.studyClasses$=this.isClassTeacher$.pipe(M(this.loadStudyClasses.bind(this)),Q(1)),this.events$=this.getEvents().pipe(Q(1)),this.filteredEvents$=U([this.events$,this.searchFields$,this.search$]).pipe(_(xe(pt)))}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(_(i=>e?i.filter(n=>n.evaluationText):i))}getEvents(){return this.loadingService.load(U([this.unratedCourses$,this.studyCourses$,this.formativeAssessments$,this.studyClasses$]),{stopOnFirstValue:!0}).pipe(_(xe(this.createAndSortEvents.bind(this))))}loadUnratedCourses(e){return this.coursesRestService.getExpandedCourses(e).pipe(_(i=>i.filter(n=>!zi(n))))}loadStudyCourses(e){if(!e)return N([]);let i=this.storageService.getPayload();return this.eventsRestService.getStudyCourseEvents().pipe(_(n=>n.filter(d=>qi(i,d))),M(n=>this.subscriptionsRestService.getSubscriptionCountsByEvents(n.map(d=>d.Id)).pipe(_(d=>n.map(h=>B(L({},h),{StudentCount:d[h.Id]??0}))))))}loadFormativeAssessments(e){return e?this.studyClassRestService.getActiveFormativeAssessments():N([])}loadStudyClasses(e){return e?this.studyClassRestService.getActive():N([])}createAndSortEvents(e,i,n,d){let h=d.filter(g=>!n.map(k=>k.Id).includes(g.Id));return[...this.createFromCourses(e),...this.createFromStudyCourses(i),...this.createFromAssessments(n),...this.createFromStudyClasses(h)].sort((g,k)=>g.designation.localeCompare(k.designation))}createFromCourses(e){return e.map(i=>{let n=ut(i);return{id:i.Id,designation:ht(i),detailLink:this.buildStudentsLink(i.Id),studentCount:i.AttendanceRef.StudentCount||0,dateFrom:i.DateFrom,dateTo:i.DateTo,state:n?.value||null,evaluationText:this.getEvaluationText(n,i.EvaluationStatusRef.EvaluationUntil),evaluationLink:n?.value&&n?.value!==ee.Tests?this.buildEvaluationLink(i.Id):null}})}createFromStudyCourses(e){return e.map(i=>({id:i.Id,designation:i.Designation,detailLink:this.buildStudentsLink(i.Id),studentCount:i.StudentCount,state:null}))}createFromAssessments(e){return this.createFromStudyClasses(e).map(n=>B(L({},n),{state:ee.Rating,evaluationText:this.translate.instant("events.state.rating"),evaluationLink:this.buildEvaluationLink(n.id)}))}createFromStudyClasses(e){return e.map(i=>({id:i.Id,designation:i.Number,detailLink:this.buildStudentsLink(i.Id),studentCount:i.StudentCount,state:null}))}getEvaluationText(e,i){let n=e?.label||e?.value;return n?this.translate.instant(`events.state.${n}`)+(n===ee.RatingUntil?` ${i?_i(i,"dd.MM.yyyy"):""}`:""):""}buildStudentsLink(e){return Yi(e,this.router.url)}buildEvaluationLink(e){return(this.settings.eventlist.evaluation??"").replace(":id",String(e))}static{this.\u0275fac=function(i){return new(i||t)($(he),$(ct),$(Vi),$(je),$(be),$(Fe),$(se),$(Ge),$(ce))}}static{this.\u0275prov=oe({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var rr=(t,o)=>o.id,sr=()=>[];function ar(t,o){t&1&&x(0,"bkd-spinner")}function or(t,o){t&1&&(s(0,"div",7),p(1),l(2,"translate"),a()),t&2&&(r(),v(" ",c(2,1,"events.rating")," "))}function dr(t,o){if(t&1&&x(0,"bkd-events-list-entry",8),t&2){let e=o.$implicit,i=u(3);m("event",e)("withRatings",i.withRatings)}}function lr(t,o){if(t&1&&(s(0,"div",3)(1,"div",4),p(2),l(3,"translate"),a(),s(4,"div",5),p(5),l(6,"translate"),a(),s(7,"div",6),p(8),l(9,"translate"),a(),T(10,or,3,3,"div",7),a(),V(11,dr,1,2,"bkd-events-list-entry",8,rr)),t&2){let e=u(2),i=O(0);r(2),f(c(3,4,"events.designation")),r(3),f(c(6,6,"events.date")),r(3),v(" ",c(9,8,"events.registrations")," "),r(2),y(e.withRatings?10:-1),r(),H(i)}}function pr(t,o){t&1&&(s(0,"p",2),p(1),l(2,"translate"),a()),t&2&&(r(),f(c(2,1,"events.no-events")))}function cr(t,o){if(t&1&&T(0,lr,13,10)(1,pr,3,3,"p",2),t&2){u();let e=O(0);y(e.length>0?0:1)}}var Ji=["designation"],mr=[...Ji,"evaluationText"],ft=(()=>{class t{constructor(e,i){this.state=e,this.storage=i,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?mr:Ji)}static{this.\u0275fac=function(i){return new(i||t)(S(He),S(Fe))}}static{this.\u0275cmp=C({type:t,selectors:[["bkd-events-list"]],inputs:{withStudyCourses:"withStudyCourses",withRatings:"withRatings"},features:[ke],decls:10,vars:17,consts:[[1,"bkd-container"],[1,"d-flex","search",3,"valueChange","value","placeholder","label","disabled"],[1,"mt-3"],[1,"event-header"],[1,"designation"],[1,"date"],[1,"registrations"],[1,"rating"],[3,"event","withRatings"]],template:function(i,n){if(i&1){let d=G();R(0),l(1,"async"),s(2,"div",0)(3,"bkd-resettable-input",1),l(4,"async"),l(5,"translate"),l(6,"translate"),b("valueChange",function(g){return E(d),w(n.state.setSearch(g))}),a(),T(7,ar,1,0,"bkd-spinner"),l(8,"async"),T(9,cr,2,1),a()}if(i&2){let d,h=A((d=c(1,5,n.state.getEntries(n.withRatings)))!==null&&d!==void 0?d:Oe(16,sr));r(3),m("value",c(4,8,n.state.search$))("placeholder",c(5,10,"events.search-by"))("label",c(6,12,"events.search"))("disabled",!h),r(4),y(c(8,14,n.state.loading$)?7:9)}},dependencies:[lt,ue,Y,I,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}}']})}}return t})();var en=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=C({type:t,selectors:[["bkd-events-current-list"]],decls:4,vars:5,consts:[[3,"withStudyCourses","withRatings"]],template:function(i,n){i&1&&(s(0,"h1"),p(1),l(2,"translate"),a(),x(3,"bkd-events-list",0)),i&2&&(r(),f(c(2,3,"events.current.title")),r(2),m("withStudyCourses",!0)("withRatings",!1))},dependencies:[ft,I],encapsulation:2,changeDetection:0})}}return t})();var tn=(()=>{class t{constructor(){}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=C({type:t,selectors:[["bkd-events-current"]],decls:1,vars:0,template:function(i,n){i&1&&x(0,"router-outlet")},dependencies:[ye],encapsulation:2})}}return t})();var nn=(()=>{class t{constructor(){this.entry=j.required(),this.multipleStudyClasses=j(!1),this.returnLink=j(null),this.link=W(()=>["student",this.entry().id,"addresses"]),this.linkParams=W(()=>{let e=this.returnLink();return e?{returnparams:new URLSearchParams({returnlink:e}).toString()}:{}})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=C({type:t,selectors:[["bkd-events-students-course-entry"]],inputs:{entry:[1,"entry"],multipleStudyClasses:[1,"multipleStudyClasses"],returnLink:[1,"returnLink"]},decls:7,vars:10,consts:[[1,"avatar","large",3,"studentId","link","linkParams"],[1,"name",3,"title","routerLink","queryParams"],[1,"study-class"],[1,"company",3,"title"]],template:function(i,n){i&1&&(x(0,"bkd-avatar",0),s(1,"a",1),p(2),a(),s(3,"div",2),p(4),a(),s(5,"div",3),p(6),a()),i&2&&(m("studentId",n.entry().id)("link",n.link())("linkParams",n.linkParams()),r(),m("title",n.entry().name)("routerLink",n.link())("queryParams",n.linkParams()),r(),f(n.entry().name),r(2),v(" ",n.multipleStudyClasses()?n.entry().studyClass:"",` -`),r(),m("title",n.entry().company),r(),f(n.entry().company))},dependencies:[X,Ai],styles:['[_nghost-%COMP%]{display:grid;grid-template-columns:min-content 1fr;grid-template-rows:min-content min-content 1fr;grid-template-areas:"avatar name" "avatar study-class" "avatar company";padding:2rem 1rem}.avatar[_ngcontent-%COMP%]{grid-area:avatar;margin-right:1.5rem}.name[_ngcontent-%COMP%]{grid-area:name}.study-class[_ngcontent-%COMP%]{grid-area:study-class;font-size:.875rem}.company[_ngcontent-%COMP%]{grid-area:company;align-content:end;padding-bottom:1.5rem}.name[_ngcontent-%COMP%], .company[_ngcontent-%COMP%]{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}'],changeDetection:0})}}return t})();var ur=t=>({count:t});function hr(t,o){if(t&1&&(s(0,"div",0),p(1),l(2,"translate"),a()),t&2){u();let e=O(2);r(),v(" ",F(2,1,e===1?"events-students.registration":"events-students.registrations",D(4,ur,e))," ")}}var vt=(()=>{class t{constructor(){this.title=j.required(),this.count=j(null),this.searchTerm=Pe()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=C({type:t,selectors:[["bkd-events-students-header"]],inputs:{title:[1,"title"],count:[1,"count"],searchTerm:[1,"searchTerm"]},outputs:{searchTerm:"searchTermChange"},decls:7,vars:10,consts:[[1,"additional-info"],[1,"search",3,"valueChange","value","placeholder","label"]],template:function(i,n){if(i&1){let d=G();s(0,"h1"),p(1),a(),R(2),T(3,hr,3,6,"div",0),s(4,"bkd-resettable-input",1),l(5,"translate"),l(6,"translate"),b("valueChange",function(g){return E(d),w(n.searchTerm.set(g))}),a()}if(i&2){r(),f(n.title()),r();let d=A(n.count());r(),y(d!==null?3:-1),r(),m("value",n.searchTerm())("placeholder",c(5,6,"events-students.search-placeholder"))("label",c(6,8,"events-students.search"))}},dependencies:[I,lt],styles:["h1[_ngcontent-%COMP%]{margin-bottom:0}.search[_ngcontent-%COMP%]{margin-top:1rem;display:flex;max-width:300px}.additional-info[_ngcontent-%COMP%]{color:#adb5bd}"],changeDetection:0})}}return t})();var gr=(t,o)=>o.id;function fr(t,o){t&1&&(s(0,"p"),p(1),l(2,"translate"),a()),t&2&&(r(),f(c(2,1,"events-students.no-entries")))}function vr(t,o){if(t&1&&x(0,"bkd-events-students-course-entry",2),t&2){let e=o.$implicit,i=u();m("entry",e)("multipleStudyClasses",i.multipleStudyClasses())("returnLink",i.returnLink())}}var rn=(()=>{class t{constructor(){this.title=j.required(),this.count=j.required(),this.entries=j.required(),this.multipleStudyClasses=j(!1),this.returnLink=j(null),this.searchTerm=Pe()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=C({type:t,selectors:[["bkd-events-students-course-list"]],inputs:{title:[1,"title"],count:[1,"count"],entries:[1,"entries"],multipleStudyClasses:[1,"multipleStudyClasses"],returnLink:[1,"returnLink"],searchTerm:[1,"searchTerm"]},outputs:{searchTerm:"searchTermChange"},decls:5,vars:4,consts:[[3,"searchTermChange","title","count","searchTerm"],[1,"list"],[3,"entry","multipleStudyClasses","returnLink"]],template:function(i,n){i&1&&(s(0,"bkd-events-students-header",0),Ie("searchTermChange",function(h){return we(n.searchTerm,h)||(n.searchTerm=h),h}),a(),s(1,"section",1),T(2,fr,3,3,"p"),V(3,vr,1,3,"bkd-events-students-course-entry",2,gr),a()),i&2&&(m("title",n.title())("count",n.count()),Ee("searchTerm",n.searchTerm),r(2),y(n.entries().length===0?2:-1),r(),H(n.entries()))},dependencies:[I,vt,nn],styles:["[_nghost-%COMP%]{display:block;overflow:hidden}section.list[_ngcontent-%COMP%]{width:calc(100% + 1px);margin-top:1rem;display:grid;grid-template-columns:repeat(auto-fill,minmax(400px,1fr))}bkd-events-students-course-entry[_ngcontent-%COMP%]{border-bottom:1px solid #dee2e6;border-right:1px solid #dee2e6}"],changeDetection:0})}}return t})();var sn=(()=>{class t{constructor(){this.entry=j.required(),this.returnLink=j(null),this.link=W(()=>["study-course-student",this.entry().id]),this.linkParams=W(()=>{let e=this.returnLink();return e?{returnparams:new URLSearchParams({returnlink:e}).toString()}:{}})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=C({type:t,selectors:[["bkd-events-students-study-course-entry"]],inputs:{entry:[1,"entry"],returnLink:[1,"returnLink"]},decls:4,vars:4,consts:[[1,"name",3,"routerLink","queryParams"],[1,"status"]],template:function(i,n){i&1&&(s(0,"a",0),p(1),a(),s(2,"div",1),p(3),a()),i&2&&(m("routerLink",n.link())("queryParams",n.linkParams()),r(),f(n.entry().name),r(2),f(n.entry().status))},dependencies:[X],styles:["[_nghost-%COMP%]{display:flex;flex-direction:row;align-items:stretch;border-bottom:1px solid #dee2e6}.name[_ngcontent-%COMP%], .status[_ngcontent-%COMP%]{padding:1rem}.name[_ngcontent-%COMP%]{flex:2;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.status[_ngcontent-%COMP%]{flex:1;padding-left:0}@media (max-width: 750px){[_nghost-%COMP%]{flex-direction:column}.name[_ngcontent-%COMP%]{padding-bottom:0}.status[_ngcontent-%COMP%]{padding-top:0;padding-left:1rem;font-size:.875rem}}"],changeDetection:0})}}return t})();var Cr=(t,o)=>o.id;function _r(t,o){if(t&1){let e=G();s(0,"div",2)(1,"div",4),b("click",function(){E(e);let n=u();return w(n.toggleSort.emit())}),p(2),l(3,"translate"),s(4,"span",5),p(5),a()()()}if(t&2){let e=u();r(),m("className",e.primarySortKey),r(),v(" ",c(3,3,"events-students.list.header."+e.primarySortKey)," "),r(3),f(e.getSortDirectionCharacter(e.sortCriteria()))}}function Sr(t,o){t&1&&(s(0,"p"),p(1),l(2,"translate"),a()),t&2&&(r(),f(c(2,1,"events-students.no-entries")))}function yr(t,o){if(t&1&&x(0,"bkd-events-students-study-course-entry",3),t&2){let e=o.$implicit,i=u();m("entry",e)("returnLink",i.returnLink())}}var an=(()=>{class t{constructor(){this.title=j.required(),this.count=j.required(),this.entries=j.required(),this.returnLink=j(null),this.sortCriteria=j.required(),this.toggleSort=zt(),this.searchTerm=Pe(),this.primarySortKey="name"}getSortDirectionCharacter(e){return e.ascending?"\u2191":"\u2193"}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=C({type:t,selectors:[["bkd-events-students-study-course-list"]],inputs:{title:[1,"title"],count:[1,"count"],entries:[1,"entries"],returnLink:[1,"returnLink"],sortCriteria:[1,"sortCriteria"],searchTerm:[1,"searchTerm"]},outputs:{toggleSort:"toggleSort",searchTerm:"searchTermChange"},features:[ie([])],decls:6,vars:4,consts:[[3,"searchTermChange","title","count","searchTerm"],[1,"list"],[1,"list-header"],[3,"entry","returnLink"],[1,"name",3,"click","className"],[1,"sort-direction"]],template:function(i,n){i&1&&(s(0,"bkd-events-students-header",0),Ie("searchTermChange",function(h){return we(n.searchTerm,h)||(n.searchTerm=h),h}),a(),s(1,"section",1),T(2,_r,6,5,"div",2)(3,Sr,3,3,"p"),V(4,yr,1,2,"bkd-events-students-study-course-entry",3,Cr),a()),i&2&&(m("title",n.title())("count",n.count()),Ee("searchTerm",n.searchTerm),r(2),y(n.entries().length>0?2:3),r(2),H(n.entries()))},dependencies:[I,vt,sn],styles:[".list-header[_ngcontent-%COMP%]{cursor:pointer;display:flex;align-items:center;border-bottom:2px solid #dee2e6}.name[_ngcontent-%COMP%]{padding:1rem}"],changeDetection:0})}}return t})();function on(t,o,e){o||Nt(t);let i=o??Vt(Wt);return e?Ht(i,e):i}function We(t,o){let e=on(We,o?.injector),i;return W(()=>(i||(i=Jt(()=>re(t,B(L({},o),{injector:e})))),i()))}var dn=(()=>{class t extends it{constructor(e,i){super(e,i,wi,"ApprenticeshipContracts")}getCompaniesForStudents(e){let i=new Date,n={"filter.StudentId":`;${e.join(";")}`,"filter.ApprenticeshipDateFrom":`<${i.toISOString()}`,"filter.ApprenticeshipDateTo":`>${i.toISOString()}`,fields:"Id,StudentId,CompanyName,CompanyNameAddition"};return this.http.get(`${this.baseUrl}/`,{params:n}).pipe(M(vi(Ii)))}static{this.\u0275fac=function(i){return new(i||t)($(Ye),$(ce))}}static{this.\u0275prov=oe({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Ct=1;var ln=10,_t=(()=>{class t{constructor(e,i,n,d,h,g,k,z,ge){this.route=e,this.loadingService=i,this.eventsService=n,this.coursesService=d,this.subscriptionsService=h,this.personsService=g,this.apprenticeshipContractsService=k,this.lessonPresencesService=z,this.reportsService=ge,this.eventId$=U([this.route.paramMap,this.route.parent?.paramMap??N(null)]).pipe(_(([ve,Wn])=>Number(ve.get("id")||Wn?.get("id")))),this.eventTypeId$=this.eventId$.pipe(M(this.loadEventTypeId.bind(this))),this.eventTypeId=We(this.eventTypeId$,{initialValue:null}),this.studentEntries=We(this.loadStudentEntries(),{initialValue:null}),this.isStudyCourse=W(()=>this.eventTypeId()===Ct),this.loading=re(this.loadingService.loading(mt)),this.title=W(()=>this.getTitle(this.studentEntries())),this.multipleStudyClasses=W(()=>(this.studentEntries()?.studyClasses?.length??0)>1),this.searchTerm=bt(""),this.sortCriteria=bt({primarySortKey:"name",ascending:!0}),this.entries=W(()=>this.studentEntries()?.entries??[]),this.sortedEntries=W(()=>this.sortStudentEntries(this.entries(),this.sortCriteria())),this.filteredEntries=W(()=>pt(this.sortedEntries(),["name","status","company","studyClass"],this.searchTerm())),this.mailtoLink=W(()=>this.getMailtoLink(this.eventTypeId(),this.entries())),this.reports=We(U([this.eventId$,this.eventTypeId$.pipe(fe(me))]).pipe(M(xe(this.loadReports.bind(this)))),{initialValue:[]})}loadEventTypeId(e){return this.loadingService.load(this.eventsService.getEventTypeId(e),mt)}loadStudentEntries(){return U([this.eventId$,this.eventTypeId$]).pipe(M(([e,i])=>{let n=()=>{switch(i){case null:return N(null);case Ct:return this.loadStudyCourseStudents(e);case ln:return this.loadStudyClassStudents(e);default:return this.loadCourseStudents(e)}};return this.loadingService.load(n(),mt)}))}toggleSort(){this.sortCriteria.update(e=>B(L({},e),{ascending:!e.ascending}))}loadStudyCourseStudents(e){return this.subscriptionsService.getSubscriptionsByCourse(e).pipe(M(i=>this.personsService.getSummaries(i.map(({PersonId:n})=>n).filter(me)).pipe(_(n=>Pt(e,n,i)))))}loadStudyClassStudents(e){return this.subscriptionsService.getSubscriptionsByCourse(e,{"filter.IsOkay":"=1"}).pipe(M(i=>{let n=i.map(({PersonId:d})=>d).filter(me);return U([this.personsService.getSummaries(n),this.apprenticeshipContractsService.getCompaniesForStudents(n)]).pipe(_(([d,h])=>{let g=Pt(e,d,i,{emailFallback:!0});return kt(g,h)}))}))}loadCourseStudents(e){return this.coursesService.getExpandedCourseWithParticipants(e).pipe(_(Ki),M(i=>U([this.apprenticeshipContractsService.getCompaniesForStudents(i.entries.map(({id:n})=>n)),this.lessonPresencesService.getLessonStudyClassesByEvent(e)]).pipe(_(([n,d])=>{let h=kt(i,n);return Zi(h,d)}))))}getTitle(e){if(!e||!e.eventDesignation)return null;let{eventDesignation:i,studyClasses:n}=e;return[i,...n].join(", ")}getMailtoLink(e,i){if(e===null||e===Ct)return null;let n=i.map(d=>d.email).filter(Boolean);return n.length>0?`mailto:${n.join(";")}`:null}loadReports(e,i){switch(i){case null:case Ct:return N([]);case ln:return this.reportsService.getStudyClassStudentsReports(e);default:return this.reportsService.getCourseStudentsReports(e)}}sortStudentEntries(e,i){return[...e].sort(wr(i))}static{this.\u0275fac=function(i){return new(i||t)($(ne),$(be),$(ct),$(he),$(je),$(rt),$(dn),$(xi),$(ot))}}static{this.\u0275prov=oe({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();function wr(t){return(o,e)=>t.ascending?o.name.localeCompare(e.name):e.name.localeCompare(o.name)}var kr=t=>[t];function Pr(t,o){if(t&1&&(s(0,"a",4)(1,"i",6),p(2,"mail"),a()()),t&2){let e=u(2);m("href",e.state.mailtoLink(),_e)}}function Mr(t,o){if(t&1&&(s(0,"bkd-backlink",0)(1,"div",3),T(2,Pr,3,1,"a",4),x(3,"bkd-reports-link",5),a()()),t&2){let e=u(),i=O(0);m("link",D(3,kr,i)),r(2),y(e.state.mailtoLink()?2:-1),r(),m("reports",e.state.reports())}}function Or(t,o){t&1&&x(0,"bkd-spinner")}function $r(t,o){t&1&&(s(0,"p"),p(1),l(2,"translate"),a()),t&2&&(r(),f(c(2,1,"events-students.no-entries")))}function Gr(t,o){if(t&1){let e=G();s(0,"bkd-events-students-study-course-list",7),b("toggleSort",function(){E(e);let n=u();return w(n.state.toggleSort())}),Ie("searchTermChange",function(n){E(e);let d=u();return we(d.state.searchTerm,n)||(d.state.searchTerm=n),w(n)}),a()}if(t&2){let e=u();m("title",e.state.title())("count",e.state.entries().length)("entries",e.state.filteredEntries())("returnLink",e.returnLink())("sortCriteria",e.state.sortCriteria()),Ee("searchTerm",e.state.searchTerm)}}function Lr(t,o){if(t&1){let e=G();s(0,"bkd-events-students-course-list",8),Ie("searchTermChange",function(n){E(e);let d=u();return we(d.state.searchTerm,n)||(d.state.searchTerm=n),w(n)}),a()}if(t&2){let e=u();m("title",e.state.title())("count",e.state.entries().length)("entries",e.state.filteredEntries())("multipleStudyClasses",e.state.multipleStudyClasses())("returnLink",e.returnLink()),Ee("searchTerm",e.state.searchTerm)}}var pn=(()=>{class t{constructor(e,i){this.state=e,this.route=i,this.returnLink=re(this.route.queryParams.pipe(_(({returnlink:n})=>n?decodeURIComponent(n):null)))}static{this.\u0275fac=function(i){return new(i||t)(S(_t),S(ne))}}static{this.\u0275cmp=C({type:t,selectors:[["bkd-events-students-list"]],decls:6,vars:3,consts:[[3,"link"],[3,"title","count","entries","returnLink","sortCriteria","searchTerm"],[3,"title","count","entries","multipleStudyClasses","returnLink","searchTerm"],[1,"d-flex"],["target","_blank",1,"mail","btn","btn-primary","btn-icon","me-2",3,"href"],[1,"ms-2",3,"reports"],[1,"material-icons"],[3,"toggleSort","searchTermChange","title","count","entries","returnLink","sortCriteria","searchTerm"],[3,"searchTermChange","title","count","entries","multipleStudyClasses","returnLink","searchTerm"]],template:function(i,n){if(i&1&&(R(0),T(1,Mr,4,5,"bkd-backlink",0)(2,Or,1,0,"bkd-spinner")(3,$r,3,3,"p")(4,Gr,1,6,"bkd-events-students-study-course-list",1)(5,Lr,1,6,"bkd-events-students-course-list",2)),i&2){let d=A(n.returnLink());r(),y(d?1:-1),r(),y(n.state.loading()?2:n.state.entries().length===0?3:n.state.isStudyCourse()?4:5)}},dependencies:[I,ue,Ae,nt,rn,an],encapsulation:2,changeDetection:0})}}return t})();var Dr=(t,o)=>o.id;function Fr(t,o){if(t&1&&(p(0),l(1,"date")),t&2){u(2);let e=O(2);v(" ",F(1,1,e.Birthdate,"dd.MM.yyyy")," ")}}function Rr(t,o){if(t&1&&p(0),t&2){u(2);let e=O(2);v(" (",e.Gender,") ")}}function Br(t,o){if(t&1&&(p(0),x(1,"br")),t&2){u(2);let e=O(2);v(" ",e.AddressLine1,"")}}function jr(t,o){if(t&1&&(p(0),x(1,"br")),t&2){u(2);let e=O(2);Ne(" ",e.Zip," ",e.Location,"")}}function Ar(t,o){if(t&1&&(s(0,"a",4),p(1),a(),x(2,"br")),t&2){u(2);let e=O(2);Tt("href","tel:",e.PhonePrivate,"",_e),r(),f(e.PhonePrivate)}}function Vr(t,o){if(t&1&&(s(0,"a",4),p(1),a()),t&2){u(2);let e=O(2);Tt("href","tel:",e.PhoneMobile,"",_e),r(),f(e.PhoneMobile)}}function Hr(t,o){if(t&1&&(s(0,"h1"),p(1),a(),s(2,"span",3),T(3,Fr,2,4)(4,Rr,1,1),a(),s(5,"address"),T(6,Br,2,1)(7,jr,2,2)(8,Ar,3,3)(9,Vr,2,3,"a",4),a()),t&2){u();let e=O(2);r(),f(e.FullName),r(2),y(e.Birthdate?3:-1),r(),y(e.Gender?4:-1),r(2),y(e.AddressLine1?6:-1),r(),y(e.Zip&&e.Location?7:-1),r(),y(e.PhonePrivate?8:-1),r(),y(e.PhoneMobile?9:-1)}}function Nr(t,o){if(t&1&&(s(0,"div",2),p(1),l(2,"translate"),s(3,"span",5),p(4),a()()),t&2){u();let e=O(4);r(),v(" ",c(2,2,"events-students.study-course-detail.status"),": "),r(3),f(e)}}function Ur(t,o){if(t&1&&(s(0,"a",7),p(1),a()),t&2){let e=u(2).$implicit;le("href",e.file,_e),r(),f(e.value)}}function Wr(t,o){if(t&1&&p(0),t&2){let e=u(2).$implicit;v(" ",e.value," ")}}function zr(t,o){if(t&1&&(s(0,"div",6)(1,"div"),p(2),a(),T(3,Ur,2,2,"a",7)(4,Wr,1,1),a()),t&2){let e=u().$implicit;r(2),f(e.label),r(),y(e.file!==null?3:4)}}function qr(t,o){if(t&1&&T(0,zr,5,2,"div",6),t&2){let e=o.$implicit;y(e.value?0:-1)}}function Yr(t,o){t&1&&x(0,"bkd-spinner")}var cn=(()=>{class t{constructor(e,i,n,d,h,g){this.settings=e,this.route=i,this.personsService=n,this.subscriptionsService=d,this.storageService=h,this.loadingService=g,this.eventId$=this.route.parent?.paramMap.pipe(_(k=>Number(k.get("id"))))??N(0),this.personId$=this.route.paramMap.pipe(_(k=>Number(k.get("id")))),this.person=re(this.personId$.pipe(M(k=>this.personsService.get(k))),{initialValue:null}),this.subscription=re(this.loadSubscription()),this.subscriptionId=W(()=>this.subscription()?.Id??null),this.subscriptionDetails=re(this.loadSubscriptionDetails(),{initialValue:[]}),this.backLink=re(this.route.queryParams.pipe(_(({returnparams:k})=>k),_(Ti))),this.loading=re(this.loadingService.loading$,{initialValue:!0})}loadSubscription(){return this.loadingService.load(U([this.eventId$,this.personId$]).pipe(M(([e,i])=>this.subscriptionsService.getSubscriptionsByCourse(e,{"filter.PersonId":`=${i}`})),_(e=>e[0]??null)),{stopOnFirstValue:!0})}loadSubscriptionDetails(){return this.loadingService.load(ei(this.subscriptionId).pipe(fe(me),M(e=>this.subscriptionsService.getSubscriptionDetailsById(e)),_(e=>e.map(i=>this.toSubscriptionDetailsEntry(i)))),{stopOnFirstValue:!0})}toSubscriptionDetailsEntry(e){return{id:e.Id,label:e.VssDesignation,value:e.Value??"",file:this.buildFileUrl(e)}}buildFileUrl(e){if(e.VssStyle==="PD"||e.VssStyle==="PF"||e.VssStyle==="DA"){let i=this.storageService.getAccessToken()||"";return`${this.settings.apiUrl}/Files/SubscriptionDetails/${e.Id}?token=${i}`}return null}static{this.\u0275fac=function(i){return new(i||t)(S(ce),S(ne),S(rt),S(je),S(Fe),S(be))}}static{this.\u0275cmp=C({type:t,selectors:[["bkd-events-students-study-course-detail"]],decls:9,vars:6,consts:[[1,"bkd-container","bkd-container-limited"],["link","../..",3,"params"],[1,"status"],[1,"additional-info"],[3,"href"],[1,"ms-2"],[1,"detail"],["target","_blank",3,"href"]],template:function(i,n){if(i&1&&(s(0,"div",0),x(1,"bkd-backlink",1),R(2),T(3,Hr,10,7),R(4),T(5,Nr,5,4,"div",2),V(6,qr,1,1,null,null,Dr),T(8,Yr,1,0,"bkd-spinner"),a()),i&2){let d;r(),m("params",n.backLink()),r();let h=A(n.person());r(),y(h?3:-1),r();let g=A((d=n.subscription())==null?null:d.Status);r(),y(g?5:-1),r(),H(n.subscriptionDetails()),r(2),y(n.loading()?8:-1)}},dependencies:[I,$e,Ae,ue],styles:["h1[_ngcontent-%COMP%]{margin-bottom:0}.additional-info[_ngcontent-%COMP%]{color:#adb5bd}address[_ngcontent-%COMP%]{margin:1rem 0}.status[_ngcontent-%COMP%]{display:flex;align-items:center;padding:1rem 0;border-top:1px solid #dee2e6;border-bottom:1px solid #dee2e6}.detail[_ngcontent-%COMP%]{max-width:70ch;padding-top:1rem}.detail[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{color:#4e4e4ef2;font-size:.875rem}"],changeDetection:0})}}return t})();var mn=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=C({type:t,selectors:[["bkd-events-students"]],features:[ie([_t])],decls:1,vars:0,template:function(i,n){i&1&&x(0,"router-outlet")},dependencies:[ye],encapsulation:2,changeDetection:0})}}return t})();var un=(()=>{class t{constructor(){}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=C({type:t,selectors:[["bkd-events-tests"]],decls:4,vars:4,consts:[[3,"withRatings"]],template:function(i,n){i&1&&(s(0,"h1"),p(1),l(2,"translate"),a(),x(3,"bkd-events-list",0)),i&2&&(r(),f(c(2,2,"events.title")),r(2),m("withRatings",!0))},dependencies:[ft,I],encapsulation:2})}}return t})();var hn=(()=>{class t{constructor(){}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=C({type:t,selectors:[["bkd-events"]],features:[ie([He,Si])],decls:1,vars:0,template:function(i,n){i&1&&x(0,"router-outlet")},dependencies:[ye],encapsulation:2})}}return t})();function gn(t){return o=>{let e=Number(o.value);return e<=t?{greaterThan:{value:e,greaterThanValue:t}}:null}}function Ot(t){return t.map(({finalGrade:o})=>o).filter(Kr)}function Kr(t){return t!==null}function Cn(t,o,e,i){return t?.map(n=>({student:n,finalGrade:Qr(n,e,i),grades:Zr(n,o)}))}function Zr(t,o){return o.map(e=>{if(e.Results===void 0||e.Results?.length===0)return{kind:"no-result",test:e};let i=e.Results?.find(n=>n.StudentId===t.Id);return i!==void 0?{kind:"grade",result:i,test:e}:{kind:"no-result",test:e}})}function Qr(t,o,e){let i=o.find(d=>d.StudentId===t.Id),n=e.find(d=>d.StudentId===t.Id);return i?{id:i.Id,average:Xr(i),finalGradeId:i.GradeId,freeHandGrade:n?Number(n.Grade):null,canGrade:i.CanGrade}:null}function Xr(t){return t.AverageTestResult===0?null:t.AverageTestResult}var _n=({key:t,ascending:o})=>(e,i)=>{let n=o?1:-1;switch(t){case"FullName":return n*e.student.FullName.localeCompare(i.student.FullName);case"FinalGrade":return!e.finalGrade?.finalGradeId||!i.finalGrade?.finalGradeId?n*-1:n*fn(e.finalGrade.finalGradeId,i.finalGrade.finalGradeId);case"TestsMean":return!e.finalGrade?.average||!i.finalGrade?.average?n*-1:n*fn(e.finalGrade.average,i.finalGrade.average)}return n*Jr(t,e,i)},Jr=(t,o,e)=>{let i=o.grades.filter(vn).find(d=>d.test.Id===t.Id),n=e.grades.filter(vn).find(d=>d.test.Id===t.Id);return t.IsPointGrading&&i?.result.GradeId===n?.result.GradeId?(i?.result.Points??0)-(n?.result.Points??0):((i?.result.GradeId??Number.POSITIVE_INFINITY)-(n?.result.GradeId??Number.POSITIVE_INFINITY))*-1};function fn(t,o){return t===o?0:te.average).filter(e=>e!=null&&e!==0).map(Number);return wt(o)}function xn(t,o){let e=t.map(n=>n.freeHandGrade).filter(n=>!!n),i=t.map(n=>n.finalGradeId).filter(n=>n!==null).map(n=>o.find(d=>d.Key===n)).filter(n=>n!==void 0).map(n=>n?.Value).filter(n=>n!==void 0).map(Number).filter(n=>!isNaN(n));return wt([...i,...e])}function $t(t,o){return[...o.filter(e=>e.Id!==t?.Id),t].filter(e=>e!=null)}function bn({id:t,selectedGradeId:o},e){return e.map(i=>i.Id!==t?i:B(L({},i),{GradeId:o}))}function Tn(t,o){switch(o.type){case"reset":return o.payload;case"updateResult":return t?B(L({},t),{Tests:Pi(o.payload.testResult,t.Tests||[],o.payload.ignore),Gradings:o.payload.grading?$t(o.payload.grading,t.Gradings||[]):t.Gradings}):null;case"deleteResult":return t?B(L({},t),{Tests:Mi(o.payload.testId,o.payload.studentId,t.Tests||[]),Gradings:o.payload.grading?$t(o.payload.grading,t.Gradings||[]):t.Gradings||[]}):null;case"toggle-test-state":return t?B(L({},t),{Tests:Oi(o.payload,t.Tests||[])}):null;case"final-grade-overwritten":return t?B(L({},t),{Gradings:bn({id:o.payload.id,selectedGradeId:o.payload.selectedGradeId},t.Gradings||[])}):null;case"replace-grades":return t?B(L({},t),{Gradings:o.payload}):null;case"delete-test":return t?B(L({},t),{Tests:$i(o.payload,t.Tests||[])}):null;default:return t}}var En=(()=>{class t extends it{constructor(e,i){super(e,i,Ri,"Gradings")}updateGrade(e,i){return this.http.put(`${this.baseUrl}/${e}`,{GradeId:i}).pipe(_(()=>e))}static{this.\u0275fac=function(i){return new(i||t)($(Ye),$(ce))}}static{this.\u0275prov=oe({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Gt={onlyMine:!1,hidePublished:!1},K=(()=>{class t{constructor(e,i,n,d,h){this.coursesRestService=e,this.gradingScalesRestService=i,this.gradingsRestService=n,this.loadingService=d,this.sortService=h,this.action$=new xt(1),this.loading$=this.loadingService.loading$,this._courseId$=new xt(1),this.courseId$=this._courseId$.asObservable(),this.fetchedCourse$=this._courseId$.pipe(M(g=>this.loadingService.load(this.coursesRestService.getExpandedCourse(g))),Q(1)),this.course$=ze(this.action$,this.fetchedCourse$.pipe(fe(me),_(g=>({type:"reset",payload:g})))).pipe(jt(Tn,null),fe(me),Q(1)),this.tests$=this.course$.pipe(_(g=>g.Tests||[]),_(Gi)),this.hasTests$=this.tests$.pipe(_(g=>g.length>0)),this.filterSubject$=new q(Gt),this.filter$=this.filterSubject$.asObservable(),this.expandedHeaderSubject$=new q(!1),this.expandedHeader$=this.expandedHeaderSubject$.asObservable(),this.filteredTests$=U([this.tests$,this.filter$]).pipe(_(([g,k])=>g.filter(z=>(!k.onlyMine||z.IsOwner)&&(!k.hidePublished||!z.IsPublished)))),this.sorting$=this.sortService.sorting$,this.studentGrades$=U([this.course$,this.filteredTests$,this.sorting$]).pipe(_(xe(this.toStudentGrades.bind(this)))),this.canSetFinalGrade$=this.course$.pipe(_(Wi)),this.gradingScaleIds$=this.course$.pipe(_(g=>gi([...(g.Tests??[]).map(k=>k.GradingScaleId),g.GradingScaleId]).filter(me)),Z(hi),Q(1)),this.gradingScales$=this.gradingScaleIds$.pipe(M(g=>this.gradingScalesRestService.getGradingScales(g)),Q(1)),this.UNDEFINED_GRADINGSCALE_ID=-1,this.gradingScalesOptions$=this.gradingScales$.pipe(_(g=>g.map(k=>{let z=k?.Id||this.UNDEFINED_GRADINGSCALE_ID,ge=k?.Grades.map(ve=>({Key:ve.Id,Value:ve.Designation}))||[];return{id:z,options:ge}}).reduce((k,z)=>B(L({},k),{[z.id]:z.options}),{})),Q(1)),this.meanOfStudentGradesForCourse$=this.studentGrades$.pipe(_(g=>yn(Ot(g)))),this.meanOfFinalGradesForCourse$=U([this.gradingScalesOptions$,this.studentGrades$]).pipe(M(xe(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(M(e=>this.gradingOptions$(e.GradingScaleId)))}toStudentGrades(e,i=[],n){return Cn(e.ParticipatingStudents??[],i,e.Gradings??[],e.FinalGrades??[]).sort(_n(n))}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(ae(1),_(i=>{let{originalResult:n,updatedResult:d}=this.buildOptimisticResultUpdate(i,e);return this.updateTestResult(d,null),n}))}saveGrade(e,i){this.course$.pipe(ae(1),M(n=>this.coursesRestService.updateTestResult(n.Id,e).pipe(Ft(d=>(i&&this.updateTestResult(L({},i),null),Dt(()=>d)))))).subscribe(({testResult:n,grading:d})=>this.updateOrDeleteTestResult(e.testId,e.studentId,n,d,"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:i}){this.gradingsRestService.updateGrade(e,i).subscribe(()=>{this.action$.next({type:"final-grade-overwritten",payload:{id:e,selectedGradeId:i}})})}setAveragesAsFinalGrades(e){this.coursesRestService.setAverageAsFinalGrade(e).subscribe(i=>this.action$.next({type:"replace-grades",payload:i.Gradings}))}buildOptimisticResultUpdate(e,i){let n=ki(e,i.testId,i.studentId),d=n?L({},n):{Id:"",TestId:i.testId,StudentId:i.studentId,CourseRegistrationId:0,GradeId:null,GradeValue:null,GradeDesignation:null,Points:null};return d.GradeId="gradeId"in i?i.gradeId:n?.GradeId??null,d.Points="points"in i?i.points:n?.Points??null,{originalResult:n,updatedResult:d}}updateOrDeleteTestResult(e,i,n,d,h){n?this.updateTestResult(n,d,h):this.deleteTestResult(e,i,d)}updateTestResult(e,i,n){this.action$.next({type:"updateResult",payload:{testResult:e,grading:i??null,ignore:n}})}deleteTestResult(e,i,n){this.action$.next({type:"deleteResult",payload:{testId:e,studentId:i,grading:n}})}toggleTestPublishedState(e){this.action$.next({type:"toggle-test-state",payload:e})}gradingOptions$(e){return e===null?N(null):this.gradingScalesOptions$.pipe(_(i=>i[e]),Q(1))}meanOfOverwrittenGradesForCourse(e,i){return this.course$.pipe(_(n=>{if(n.GradingScaleId===null||e[n.GradingScaleId]===void 0)return null;let d=e[n.GradingScaleId];return xn(Ot(i),d)}))}static{this.\u0275fac=function(i){return new(i||t)($(he),$(Bi),$(En),$(be),$(Ni))}}static{this.\u0275prov=oe({token:t,factory:t.\u0275fac})}}return t})();var is=t=>["/events",t,"tests"];function ns(t,o){if(t&1&&(s(0,"div",7),p(1),l(2,"translate"),a()),t&2){let e=o.$implicit;r(),v(" ",F(2,1,"global.validation-errors."+e.error,e.params)," ")}}function rs(t,o){if(t&1&&(s(0,"div",7),p(1),l(2,"translate"),a()),t&2){let e=o.$implicit;r(),v(" ",F(2,1,"global.validation-errors."+e.error,e.params)," ")}}function ss(t,o){if(t&1&&(s(0,"div",7),p(1),l(2,"translate"),a()),t&2){let e=o.$implicit;r(),v(" ",F(2,1,"global.validation-errors."+e.error,e.params)," ")}}function as(t,o){if(t&1&&(s(0,"div",7),p(1),l(2,"translate"),a()),t&2){let e=o.$implicit;r(),v(" ",F(2,1,"global.validation-errors."+e.error,e.params)," ")}}function os(t,o){if(t&1&&(s(0,"div",7),p(1),l(2,"translate"),a()),t&2){let e=o.$implicit;r(),v(" ",F(2,1,"global.validation-errors."+e.error,e.params)," ")}}function ds(t,o){if(t&1&&(s(0,"div",29)(1,"div",30)(2,"div",16)(3,"label",31),p(4),l(5,"translate"),a(),s(6,"div",32),x(7,"input",33),l(8,"async"),V(9,as,3,4,"div",7,Me),l(11,"async"),a()()(),s(12,"div",30)(13,"div",16)(14,"label",34),p(15),l(16,"translate"),a(),s(17,"div",32),x(18,"input",35),l(19,"async"),V(20,os,3,4,"div",7,Me),l(22,"async"),a()()()(),s(23,"div",36),Ut(),s(24,"math")(25,"mi"),p(26),l(27,"translate"),a(),s(28,"mo"),p(29,"="),a(),s(30,"mfrac")(31,"mrow")(32,"mi"),p(33),l(34,"translate"),a(),s(35,"mo"),p(36,"\xD7"),a(),s(37,"mn"),p(38,"5"),a()(),s(39,"mi"),p(40),l(41,"translate"),a()(),s(42,"mo"),p(43,"+"),a(),s(44,"mn"),p(45,"1"),a()()()),t&2){let e,i,n=u(2);r(4),f(c(5,9,"tests.form.max-points")),r(3),de("is-invalid",((e=c(8,11,n.maxPointsErrors$))==null?null:e.length)||!1),r(2),H(c(11,13,n.maxPointsErrors$)),r(6),f(c(16,15,"tests.form.max-points-adjusted")),r(3),de("is-invalid",((i=c(19,17,n.maxPointsAdjustedErrors$))==null?null:i.length)||!1),r(2),H(c(22,19,n.maxPointsAdjustedErrors$)),r(6),v(" ",c(27,21,"tests.form.math.grade")," "),r(7),v(" ",c(34,23,"tests.form.math.points")," "),r(7),f(c(41,25,"tests.form.math.max-points"))}}function ls(t,o){t&1&&(s(0,"div",28)(1,"span",37),p(2,"Loading..."),a()())}function ps(t,o){if(t&1){let e=G();s(0,"form",2),b("ngSubmit",function(){E(e);let n=u();return w(n.onSubmit())}),s(1,"div",3)(2,"div",4)(3,"label",5),p(4),l(5,"translate"),a(),x(6,"input",6),l(7,"async"),l(8,"translate"),V(9,ns,3,4,"div",7,Me),l(11,"async"),a(),s(12,"div",8)(13,"label",9),p(14),l(15,"translate"),a(),s(16,"div",10)(17,"span",11)(18,"i",12),p(19,"calendar_today"),a()(),s(20,"input",13,0),l(22,"async"),l(23,"translate"),b("click",function(){E(e);let n=Se(21);return w(n.toggle())}),a(),V(24,rs,3,4,"div",7,Me),l(26,"async"),a()()(),s(27,"div",14)(28,"label",15),p(29),l(30,"translate"),a(),s(31,"div",4)(32,"div",16)(33,"label",17),p(34),l(35,"translate"),a(),s(36,"div",18),x(37,"input",19),l(38,"async"),V(39,ss,3,4,"div",7,Me),l(41,"async"),a()()()(),s(42,"div")(43,"label",15),p(44),l(45,"translate"),a(),s(46,"div",20),x(47,"input",21),s(48,"label",22),p(49),l(50,"translate"),a()(),s(51,"div",20),x(52,"input",23),s(53,"label",24),p(54),l(55,"translate"),a()(),T(56,ds,46,27),a(),s(57,"div",25)(58,"button",26),l(59,"async"),p(60),l(61,"translate"),a(),s(62,"button",27),p(63),l(64,"translate"),T(65,ls,3,0,"div",28),a()()()}if(t&2){let e,i,n,d,h=u();m("formGroup",h.formGroup),r(4),f(c(5,26,"tests.form.designation")),r(2),de("is-invalid",((e=c(7,28,h.designationErrors$))==null?null:e.length)||!1),m("placeholder",c(8,30,"tests.form.designation-placeholder")),r(3),H(c(11,32,h.designationErrors$)),r(5),f(c(15,34,"tests.form.date")),r(3),m("id",h.componentId),r(3),de("is-invalid",((i=c(22,36,h.dateErrors$))==null?null:i.length)||!1),m("placeholder",c(23,38,"shared.date-select.default-placeholder")),r(4),H(c(26,40,h.dateErrors$)),r(5),f(c(30,42,"tests.form.weight")),r(5),f(c(35,44,"tests.form.factor")),r(3),de("is-invalid",((n=c(38,46,h.weightErrors$))==null?null:n.length)||!1),r(2),H(c(41,48,h.weightErrors$)),r(5),f(c(45,50,"tests.form.grading-type")),r(3),m("value",!1),r(2),f(c(50,52,"tests.form.grades")),r(3),m("value",!0),r(2),f(c(55,54,"tests.form.points")),r(2),y((d=h.formGroup.get("isPointGrading"))!=null&&d.value?56:-1),r(2),m("disabled",h.saving)("routerLink",D(62,is,c(59,56,h.courseId$))),r(2),v(" ",c(61,58,"tests.form.cancel")," "),r(2),m("disabled",h.saving),r(),v(" ",c(64,60,"tests.form.save")," "),r(2),y(h.saving?65:-1)}}var St=(()=>{class t{constructor(e,i,n){this.fb=e,this.translate=i,this.testStateService=n,this.test=null,this.saving=!1,this.save=new J,this.componentId=fi("bkd-tests-edit-form"),this.formGroup=this.createFormGroup(),this.submitted$=new q(!1),this.destroy$=new te,this.designationErrors$=Re(N(this.formGroup),this.submitted$,"designation"),this.dateErrors$=Re(N(this.formGroup),this.submitted$,"date"),this.maxPointsErrors$=Re(N(this.formGroup),this.submitted$,"maxPoints"),this.maxPointsAdjustedErrors$=Re(N(this.formGroup),this.submitted$,"maxPointsAdjusted"),this.weightErrors$=Re(N(this.formGroup),this.submitted$,"weight"),this.courseId$=this.testStateService.courseId$}ngOnInit(){this.test&&this.setInitialValues(this.test),Ci(N(this.formGroup),"isPointGrading").pipe(Ce(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:["",Le.required],date:[null,Le.required],weight:[1,Le.compose([Le.required,gn(0)])],isPointGrading:[!1],maxPoints:[{value:null,disabled:!0},Le.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"),i=this.formGroup.get("maxPointsAdjusted");this.formGroup.get("isPointGrading")?.value?(e?.enable(),i?.enable()):(e?.reset({value:this.test?.MaxPoints,disabled:!0}),i?.reset({value:this.test?.MaxPointsAdjusted,disabled:!0}))}static{this.\u0275fac=function(i){return new(i||t)(S(di),S(se),S(K))}}static{this.\u0275cmp=C({type:t,selectors:[["bkd-tests-edit-form"]],inputs:{test:"test",saving:"saving"},outputs:{save:"save"},features:[ie([{provide:pi,useClass:ui},{provide:ci,useClass:Hi}])],decls:1,vars:1,consts:[["dp","ngbDatepicker"],[3,"formGroup"],[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"],[1,"invalid-feedback"],[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"],[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"],["role","status",1,"spinner-border","spinner-border-sm","align-middle"],[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"],[1,"visually-hidden"]],template:function(i,n){i&1&&T(0,ps,66,64,"form",1),i&2&&y(n.formGroup?0:-1)},dependencies:[De,ni,Ke,Qe,ri,Ze,ti,oi,Je,Xe,li,si,ai,mi,X,Y,I],styles:["#factor[_ngcontent-%COMP%], #max-points[_ngcontent-%COMP%], #max-points-adjusted[_ngcontent-%COMP%]{width:5em}"]})}}return t})();var wn=(()=>{class t{constructor(e,i,n,d,h){this.route=e,this.courseService=i,this.toastService=n,this.translate=d,this.router=h,this.saving$=new q(!1),this.courseId$=this.route.paramMap.pipe(_(g=>Number(g.get("id"))),Z())}save(e){this.saving$.next(!0);let{designation:i,date:n,weight:d,isPointGrading:h,maxPoints:g,maxPointsAdjusted:k}=e;this.courseId$.pipe(M(z=>this.courseService.add(z,n,i,d,h,g,k)),qe(()=>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=>void this.router.navigate(["events",e,"tests"]))}static{this.\u0275fac=function(i){return new(i||t)(S(ne),S(he),S(tt),S(se),S(Ge))}}static{this.\u0275cmp=C({type:t,selectors:[["bkd-tests-add"]],decls:6,vars:6,consts:[[1,"bkd-container","bkd-container-limited"],[3,"save","saving"]],template:function(i,n){i&1&&(s(0,"h1"),p(1),l(2,"translate"),a(),s(3,"div",0)(4,"bkd-tests-edit-form",1),l(5,"async"),b("save",function(h){return n.save(h)}),a()()),i&2&&(r(),f(c(2,2,"tests.add-title")),r(3),m("saving",c(5,4,n.saving$)))},dependencies:[St,Y,I],encapsulation:2})}}return t})();var In=(()=>{class t{constructor(e){this.activeModal=e}get canDeleteTest(){return(this.test?.Results?.filter(i=>i.GradeId!==null||i.GradeValue!==null||i.Points!==null)||[]).length===0}static{this.\u0275fac=function(i){return new(i||t)(S(et))}}static{this.\u0275cmp=C({type:t,selectors:[["bkd-tests-delete"]],inputs:{test:"test"},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(i,n){i&1&&(s(0,"div",0)(1,"p",1),p(2),l(3,"translate"),a()(),s(4,"div",2)(5,"button",3),b("click",function(){return n.activeModal.dismiss()}),s(6,"span",4),p(7),l(8,"translate"),a()(),s(9,"button",5),b("click",function(){return n.activeModal.close(n.canDeleteTest?n.test:null)}),s(10,"span",6),p(11),l(12,"translate"),a()()()),i&2&&(r(2),v(" ",c(3,4,n.canDeleteTest?"tests.form.confirm":"tests.form.delete-not-allowed")," "),r(3),m("hidden",!n.canDeleteTest),r(2),v(" ",c(8,6,"tests.dialog.no")," "),r(4),v(" ",c(12,8,n.canDeleteTest?"tests.dialog.yes":"tests.dialog.ok")," "))},dependencies:[I],encapsulation:2})}}return t})();var hs=t=>({test:t});function gs(t,o){t&1&&x(0,"bkd-spinner")}function fs(t,o){if(t&1){let e=G();s(0,"div",1)(1,"h1"),p(2),l(3,"translate"),a(),s(4,"button",2),b("click",function(){E(e);let n=u(),d=O(0);return w(n.openDeleteModal(d))}),s(5,"i",3),p(6,"delete"),a()()(),s(7,"bkd-tests-edit-form",4),b("save",function(n){E(e);let d=u();return w(d.save(n))}),a()}if(t&2){u();let e=O(0),i=O(2);r(2),v(" ",F(3,3,"tests.edit-title",D(6,hs,e.Designation))," "),r(5),m("test",e)("saving",i)}}var kn=(()=>{class t{constructor(e,i,n,d,h,g,k){this.state=e,this.courseService=i,this.route=n,this.toastService=d,this.translate=h,this.router=g,this.modalService=k,this.saving$=new q(!1),this.testId$=this.route.paramMap.pipe(_(z=>Number(z.get("testId"))),Z()),this.test$=U([this.state.tests$,this.testId$]).pipe(_(([z,ge])=>z.find(ve=>ve.Id===ge)))}openDeleteModal(e){let i=this.modalService.open(In);i.componentInstance.test=e,i.result.then(n=>{n&&this.courseService.delete(e.CourseId,e.Id).subscribe(this.onDeleteSuccess.bind(this))},()=>{})}save(e){this.saving$.next(!0);let{designation:i,date:n,weight:d,isPointGrading:h,maxPoints:g,maxPointsAdjusted:k}=e;U([this.state.courseId$,this.testId$]).pipe(ae(1),M(([z,ge])=>this.courseService.update(z,ge,i,n,d,h,g,k)),qe(()=>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(ae(1)).subscribe(e=>void this.router.navigate(["events",e,"tests"]))}static{this.\u0275fac=function(i){return new(i||t)(S(K),S(he),S(ne),S(tt),S(se),S(Ge),S(dt))}}static{this.\u0275cmp=C({type:t,selectors:[["bkd-tests-edit"]],decls:8,vars:9,consts:[[1,"bkd-container","bkd-container-limited"],[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(i,n){if(i&1&&(R(0),l(1,"async"),R(2),l(3,"async"),s(4,"div",0),T(5,gs,1,0,"bkd-spinner"),l(6,"async"),T(7,fs,8,8),a()),i&2){let d=A(c(1,1,n.test$));r(2),A(c(3,4,n.saving$)),r(3),y(c(6,7,n.state.loading$)?5:d?7:-1)}},dependencies:[St,ue,Y,I],encapsulation:2})}}return t})();var vs=t=>({designation:t}),Pn=(()=>{class t{constructor(e){this.activeModal=e}static{this.\u0275fac=function(i){return new(i||t)(S(et))}}static{this.\u0275cmp=C({type:t,selectors:[["bkd-publish-test"]],inputs:{test:"test"},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(i,n){i&1&&(s(0,"div",0)(1,"p",1),p(2),l(3,"translate"),a()(),s(4,"div",2)(5,"button",3),b("click",function(){return n.activeModal.dismiss()}),p(6),l(7,"translate"),a(),s(8,"button",4),b("click",function(){return n.activeModal.close(!0)}),p(9),l(10,"translate"),a()()),i&2&&(r(2),v(" ",F(3,3,n.test.IsPublished?"tests.publishing.unpublish":"tests.publishing.publish",D(10,vs,n.test.Designation))," "),r(4),v(" ",c(7,6,"tests.publishing.cancel")," "),r(3),v(" ",c(10,8,"tests.publishing.confirm")," "))},dependencies:[I],encapsulation:2})}}return t})();var Cs=t=>({maxPoints:t});function _s(t,o){if(t&1&&(s(0,"div",6),p(1),l(2,"translate"),a()),t&2){let e=u(2);r(),v(" ",F(2,1,"global.validation-errors.invalidPoints",D(4,Cs,e.maxPoints))," ")}}function Ss(t,o){if(t&1){let e=G();s(0,"div",3)(1,"input",5,0),b("ngModelChange",function(){E(e);let n=Se(2),d=u();return w(d.onPointsChange(n.value))}),a(),T(3,_s,3,6,"div",6),a()}if(t&2){let e=Se(2),i=u();r(),de("is-invalid",e.errors),le("max",i.maxPoints),le("tabindex",i.tabIndex),m("disabled",i.grade.test.IsPublished)("ngModel",i.grade.kind==="grade"?i.grade.result.Points:null),r(2),y(e.errors?3:-1)}}var ys=1250,Mn=(()=>{class t{constructor(e){this.state=e,this.maxPoints=0,this.pointsSubject$=new te,this.gradeSubject$=new te,this.gradingScaleDisabledSubject$=new q(!0),this.gradingScaleDisabled$=this.gradingScaleDisabledSubject$.asObservable(),this.destroy$=new te}ngOnInit(){this.gradingScaleDisabledSubject$.next(this.disableGradingScale()),this.maxPoints=Sn(this.grade),this.initSave(this.pointsSubject$.pipe(fe(this.isValid.bind(this)),_(e=>({studentId:this.student.Id,testId:this.grade.test.Id,points:e?Number(e):null})))),this.initSave(this.gradeSubject$.pipe(_(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(Rt(i=>this.state.optimisticallyUpdateGrade(i).pipe(_(n=>({params:i,originalResult:n})))),Bt(ys),Ce(this.destroy$)).subscribe(({params:i,originalResult:n})=>this.state.saveGrade(i,n))}disableGradingScale(){return this.grade.test.IsPublished?!0:this.grade.kind==="no-result"?!1:this.grade.result.Points!=null&&this.grade.test.IsPointGrading}static{this.\u0275fac=function(i){return new(i||t)(S(K))}}static{this.\u0275cmp=C({type:t,selectors:[["bkd-grade"]],inputs:{grade:"grade",student:"student",tabIndex:"tabIndex",gradeOptions:"gradeOptions"},features:[ke],decls:5,vars:8,consts:[["points","ngModel"],[1,"d-flex","flex-column","w-100"],[1,"d-flex","flex-row"],[1,"point-input-container","me-2","me-md-3"],["data-testid","grade-select",1,"grade-select",3,"valueChange","options","allowEmpty","value","disabled","tabindex"],["type","number","step","0.01","min","0","data-testid","point-input",1,"form-control",3,"ngModelChange","max","disabled","tabindex","ngModel"],["data-testid","validation-error-message",1,"invalid-feedback"]],template:function(i,n){i&1&&(s(0,"div",1)(1,"div",2),T(2,Ss,4,7,"div",3),s(3,"bkd-select",4),l(4,"async"),b("valueChange",function(h){return n.onGradeChange(h)}),a()()()),i&2&&(r(2),y(n.grade.test.IsPointGrading?2:-1),r(),m("options",n.gradeOptions)("allowEmpty",!0)("value",n.grade.kind==="grade"?n.grade.result.GradeId:null)("disabled",c(4,6,n.gradingScaleDisabled$))("tabindex",n.tabIndex))},dependencies:[De,Ke,Qe,Ze,Je,Xe,ii,Be,Y,I],styles:[".point-input-container[_ngcontent-%COMP%]{width:4em}[_nghost-%COMP%] select{width:127px}@media (min-width: 576px){.point-input-container[_ngcontent-%COMP%]{width:5em}}"]})}}return t})();function xs(t,o){if(t&1&&(s(0,"span",1),p(1),a()),t&2){let e=u();r(),f(e.calculatePointsAverage(e.test))}}var On=(()=>{class t{constructor(e){this.locale=e}calculatePointsAverage(e){return this.safeAverage(e,2,st)}calculateGradeAverage(e){return this.safeAverage(e,3,at)}safeAverage(e,i,n){try{return Fi(n(e),this.locale,i)}catch{return Li}}static{this.\u0275fac=function(i){return new(i||t)(S(Xt))}}static{this.\u0275cmp=C({type:t,selectors:[["bkd-average-grades"]],inputs:{test:"test"},decls:4,vars:2,consts:[[1,"d-flex","flex-row","w-100"],["data-testid","average-points",1,"mr-2","mr-md-3","average-points"],["data-testid","average-grade"]],template:function(i,n){i&1&&(s(0,"div",0),T(1,xs,2,1,"span",1),s(2,"span",2),p(3),a()()),i&2&&(r(),y(n.test.IsPointGrading?1:-1),r(2),f(n.calculateGradeAverage(n.test)))},styles:[".average-points[_ngcontent-%COMP%]{min-width:4.5em}@media (min-width: 576px){.average-points[_ngcontent-%COMP%]{min-width:6em}}"]})}}return t})();var $n=(()=>{class t{constructor(){this.disabled=!1,this.width="127px",this.gradeIdSelected=new J}onGradeChange(e){this.gradeId?.valueOf()!==void 0&&this.gradeIdSelected.emit({id:this.gradeId?.valueOf(),selectedGradeId:e})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=C({type:t,selectors:[["bkd-grade-select"]],inputs:{options:"options",valueId:"valueId",gradeId:"gradeId",disabled:"disabled",width:"width"},outputs:{gradeIdSelected:"gradeIdSelected"},decls:1,vars:5,consts:[["data-testid","grade-select",3,"valueChange","options","allowEmpty","value","disabled","width"]],template:function(i,n){i&1&&(s(0,"bkd-select",0),b("valueChange",function(h){return n.onGradeChange(h)}),a()),i&2&&m("options",n.options)("allowEmpty",!0)("value",n.valueId)("disabled",n.disabled)("width",n.width)},dependencies:[Be],encapsulation:2})}}return t})();var bs=576,Gn=(()=>{class t{constructor(e,i){this.portal=e,this.state=i,this.destroy$=new te,this.handleWindowScroll=()=>{this.updateStickyVisibility(),this.updateStickyTopOffset()},this.handleWindowResize=()=>{this.updateStickyWidth(),this.updateStickyVisibility(),this.updateStickyTopOffset()},this.handleTableScroll=()=>{this.updateStickyLeftOffset()}}ngOnInit(){U([this.state.filteredTests$,this.state.expandedHeader$]).pipe(Ce(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":t,"btn-outline-secondary":o}),Dn=(()=>{class t{constructor(){this.filter=Gt,this.filterChange=new J}showOnlyMine(){this.filterChange.next(B(L({},this.filter),{onlyMine:!0}))}showAll(){this.filterChange.next(B(L({},this.filter),{onlyMine:!1}))}onHidePublishedChange(e){let i=(e.target&&e.target instanceof HTMLInputElement&&e.target?.checked)??!1;this.filterChange.next(B(L({},this.filter),{hidePublished:i}))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=C({type:t,selectors:[["bkd-test-table-filter"]],inputs:{filter:"filter"},outputs:{filterChange:"filterChange"},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(i,n){i&1&&(s(0,"div",0)(1,"button",1),b("click",function(){return n.showAll()}),p(2),l(3,"translate"),a(),s(4,"button",2),b("click",function(){return n.showOnlyMine()}),p(5),l(6,"translate"),a()(),s(7,"div",3)(8,"div",4)(9,"input",5),b("change",function(h){return n.onHidePublishedChange(h)}),a(),s(10,"label",6),p(11),l(12,"translate"),a()()()),i&2&&(r(),m("ngClass",Et(12,Ln,!n.filter.onlyMine,n.filter.onlyMine)),r(),v(" ",c(3,6,"tests.all-tests")," "),r(2),m("ngClass",Et(15,Ln,n.filter.onlyMine,!n.filter.onlyMine)),r(),v(" ",c(6,8,"tests.owned-tests")," "),r(4),m("checked",n.filter.hidePublished),r(2),v(" ",c(12,10,"tests.hide-published")," "))},dependencies:[pe,De,I],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}"]})}}return t})();var Ts=["*"],Fn=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=C({type:t,selectors:[["bkd-preserve-line-height"]],ngContentSelectors:Ts,decls:3,vars:0,template:function(i,n){i&1&&(Zt(),s(0,"div"),Qt(1),p(2,"\xA0"),a())},encapsulation:2})}}return t})();var Rn=(()=>{class t{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")}`:""}static{this.\u0275fac=function(i){return new(i||t)(S(se,16))}}static{this.\u0275pipe=Kt({name:"testSummaryShort",type:t,pure:!0})}}return t})();var Es=t=>[t,"edit"];function ws(t,o){t&1&&(s(0,"i",9),p(1,"edit"),a())}function Is(t,o){if(t&1&&(s(0,"div",5)(1,"div",7)(2,"bkd-preserve-line-height"),p(3),l(4,"date"),a(),s(5,"a",8),T(6,ws,2,0,"i",9),a()(),s(7,"bkd-preserve-line-height"),p(8),l(9,"testSummaryShort"),a(),s(10,"bkd-preserve-line-height"),p(11),a()()),t&2){let e=u();r(3),f(F(4,5,e.test.Date,"dd.MM.yyyy")),r(2),m("routerLink",D(10,Es,e.test.Id)),r(),y(e.test.IsOwner&&e.test.IsPublished===!1?6:-1),r(2),v(" ",c(9,8,e.test)," "),r(3),f(e.test.Owner)}}function ks(t,o){if(t&1){let e=G();s(0,"div",6)(1,"a",10),l(2,"translate"),b("click",function(){E(e);let n=u();return w(n.unpublishTest())}),s(3,"i",11),p(4,"lock"),a(),s(5,"span"),p(6),l(7,"translate"),a()(),s(8,"bkd-caret",12),b("click",function(){E(e);let n=u();return w(n.emitToggleHeader())}),a()()}if(t&2){let e=u();r(),le("title",c(2,3,"tests.edit")),r(5),f(c(7,5,"tests.published")),r(2),m("expanded",e.expanded)}}function Ps(t,o){if(t&1){let e=G();s(0,"div",6)(1,"a",13),l(2,"translate"),b("click",function(){E(e);let n=u();return w(n.publishTest())}),s(3,"i",11),p(4,"lock_open"),a(),s(5,"span"),p(6),l(7,"translate"),a()(),s(8,"bkd-caret",12),b("click",function(){E(e);let n=u();return w(n.emitToggleHeader())}),a()()}if(t&2){let e=u();r(),le("title",c(2,3,"tests.publish")),r(5),f(c(7,5,"tests.not-published")),r(2),m("expanded",e.expanded)}}var Bn=(()=>{class t{constructor(){this.toggleHeader=new J,this.publish=new J,this.unpublish=new J}emitToggleHeader(){this.toggleHeader.emit(!this.expanded)}publishTest(){this.publish.emit(this.test)}unpublishTest(){this.unpublish.emit(this.test)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=C({type:t,selectors:[["bkd-test-table-header"]],inputs:{test:"test",expanded:"expanded"},outputs:{toggleHeader:"toggleHeader",publish:"publish",unpublish:"unpublish"},decls:9,vars:5,consts:[[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"],[1,"d-flex","flex-column","mb-3"],[1,"d-flex","align-items-center","justify-content-between","test-status"],[1,"d-flex","flex-row","justify-content-between"],[1,"btn","btn-link","p-0","edit",3,"routerLink"],[1,"material-icons"],[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(i,n){i&1&&(s(0,"div",0)(1,"div",1),b("click",function(){return n.emitToggleHeader()}),s(2,"div",2),p(3),a(),x(4,"bkd-caret",3),a(),s(5,"div",4),T(6,Is,12,12,"div",5)(7,ks,9,7,"div",6)(8,Ps,9,7,"div",6),a()()),i&2&&(r(2),m("ngClass",n.expanded?"expanded":"collapsed"),r(),v(" ",n.test.Designation," "),r(),m("expanded",n.expanded),r(2),y(n.expanded?6:-1),r(),y(n.test.IsPublished?7:8))},dependencies:[pe,bi,Fn,X,$e,I,Rn],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}}"]})}}return t})();var Ms=["bkdTestEditGradesHeader",""],Lt=(t,o)=>o.Id,Os=t=>({"test-point-grading":t}),$s=t=>({selected:t});function Gs(t,o){if(t&1){let e=G();s(0,"th",3)(1,"bkd-test-table-header",14),b("toggleHeader",function(n){E(e);let d=u();return w(d.state.toggleHeader(n))})("publish",function(n){E(e);let d=u();return w(d.publish.emit(n))})("unpublish",function(n){E(e);let d=u();return w(d.unpublish.emit(n))}),a()()}if(t&2){let e=o.$implicit,i=u(),n=O(4);m("ngClass",e.Id===(i.selectedTest==null?null:i.selectedTest.Id)?"selected":""),r(),m("test",e)("expanded",n)}}function Ls(t,o){if(t&1){let e=G();s(0,"th",4)(1,"bkd-test-table-header",14),b("toggleHeader",function(n){E(e);let d=u();return w(d.state.toggleHeader(n))})("publish",function(n){E(e);let d=u();return w(d.publish.emit(n))})("unpublish",function(n){E(e);let d=u();return w(d.unpublish.emit(n))}),a()()}if(t&2){let e=o.$implicit,i=u(),n=O(4);m("ngClass",e.Id===(i.selectedTest==null?null:i.selectedTest.Id)?"selected":""),r(),m("test",e)("expanded",n)}}function Ds(t,o){if(t&1){let e=G();s(0,"div",15)(1,"span",16),b("click",function(){E(e);let n=u().$implicit,d=u();return w(d.state.sortBy(n))}),p(2),l(3,"translate"),a()()}t&2&&(r(2),v("",c(3,1,"tests.points")," "))}function Fs(t,o){if(t&1){let e=G();s(0,"th",13)(1,"div",8),T(2,Ds,4,3,"div",15),s(3,"div",9)(4,"span",16),b("click",function(){let n=E(e).$implicit,d=u();return w(d.state.sortBy(n))}),p(5),l(6,"translate"),a()(),s(7,"div",10),p(8),l(9,"async"),a()()()}if(t&2){let e=o.$implicit,i=u();m("ngClass",e.Id===(i.selectedTest==null?null:i.selectedTest.Id)?"selected":""),r(2),y(e.IsPointGrading?2:-1),r(3),f(c(6,4,"tests.grade")),r(3),v(" ",c(9,6,i.state.getSortingChar$(e))," ")}}var jn=(()=>{class t{set shown(e){let i=this.element.nativeElement.classList;e?i.add("shown"):i.remove("shown")}constructor(e,i){this.state=e,this.element=i,this.sticky=!1,this.publish=new J,this.unpublish=new J}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(i=>i.getBoundingClientRect().width))}setColumnWidths(e){let i=this.getRowsAndColumns();if(i.length!==e.length||!i.every((n,d)=>n.length===e[d].length))throw new Error("Given column widths do not match number of header rows/columns");i.forEach((n,d)=>n.forEach((h,g)=>{h.style.width=`${e[d][g]}px`,h.style.minWidth=`${e[d][g]}px`}))}getStickyColumnsHeights(){return this.getRowsAndColumns(".sticky").map(e=>e.map(i=>i.getBoundingClientRect().height))}setStickyColumnHeights(e){let i=this.getRowsAndColumns(".sticky");if(i.length!==e.length||!i.every((n,d)=>n.length===e[d].length))throw new Error("Given column heights do not match number of sticky header columns");i.forEach((n,d)=>n.forEach((h,g)=>{h.style.height=`${e[d][g]}px`})),this.getRows().forEach((n,d)=>{let h=e[d].reduce((g,k)=>Math.max(g,k),0);n.style.height=`${h}px`})}getRowsAndColumns(e){return this.getRows().map(i=>Array.from(i.querySelectorAll(`th:not(.header-mobile)${e??""}`)))}getRows(){return Array.from(this.element.nativeElement.querySelectorAll("tr"))}static{this.\u0275fac=function(i){return new(i||t)(S(K),S(qt))}}static{this.\u0275cmp=C({type:t,selectors:[["thead","bkdTestEditGradesHeader",""]],hostVars:2,hostBindings:function(i,n){i&2&&de("sticky",n.sticky)},inputs:{selectedTest:"selectedTest",sticky:"sticky",shown:"shown"},outputs:{publish:"publish",unpublish:"unpublish"},attrs:Ms,decls:42,vars:32,consts:[[1,"header-collapsible"],["colspan","3",1,"desktop","sticky"],[3,"filterChange","filter"],["container","body",1,"test-grade","grade","test-info-desktop",3,"ngClass"],["container","body","colspan","3",1,"test-grade","header-mobile","test-info-mobile",3,"ngClass"],[1,"filler"],[3,"ngClass"],[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",1,"test-grade",3,"ngClass"],[3,"toggleHeader","publish","unpublish","test","expanded"],[1,"column-title","point-input-container","me-2","me-md-3"],[3,"click"]],template:function(i,n){if(i&1){let d=G();R(0),l(1,"async"),R(2),l(3,"async"),R(4),l(5,"async"),s(6,"tr",0)(7,"th",1)(8,"bkd-test-table-filter",2),b("filterChange",function(g){return E(d),w(n.state.setFilter(g))}),a()(),V(9,Gs,2,3,"th",3,Lt),V(11,Ls,2,3,"th",4,Lt),x(13,"th",5),a(),s(14,"tr",6)(15,"th",7),b("click",function(){return E(d),w(n.state.sortBy("FullName"))}),s(16,"div",8)(17,"div",9),p(18),l(19,"translate"),a(),s(20,"div",10),p(21),l(22,"async"),a()()(),s(23,"th",11),b("click",function(){return E(d),w(n.state.sortBy("FinalGrade"))}),s(24,"div",8)(25,"div",9),p(26),l(27,"translate"),a(),s(28,"div",10),p(29),l(30,"async"),a()()(),s(31,"th",12),b("click",function(){return E(d),w(n.state.sortBy("TestsMean"))}),s(32,"div",8)(33,"div",9),p(34),l(35,"translate"),a(),s(36,"div",10),p(37),l(38,"async"),a()()(),V(39,Fs,10,8,"th",13,Lt),x(41,"th",5),a()}if(i&2){let d=c(1,9,n.state.filteredTests$),h=c(3,11,n.state.filter$);r(4),A(c(5,13,n.state.expandedHeader$)),r(4),m("filter",h),r(),H(d),r(2),H(d),r(3),m("ngClass",D(28,Os,n.selectedTest==null?null:n.selectedTest.IsPointGrading)),r(4),v(" ",c(19,16,"tests.student.name")," "),r(3),v(" ",c(22,18,n.state.getSortingChar$("FullName"))," "),r(2),m("ngClass",D(30,$s,n.selectedTest===void 0)),r(3),v(" ",c(27,20,"tests.grade")," "),r(3),v(" ",c(30,22,n.state.getSortingChar$("FinalGrade"))," "),r(5),v(" ",c(35,24,"tests.mean")," "),r(3),v(" ",c(38,26,n.state.getSortingChar$("TestsMean"))," "),r(2),H(d)}},dependencies:[Y,pe,I,Dn,Bn],styles:["[_nghost-%COMP%]{--spacer: 16px;--point-input-size: 4em;--grade-input-size: 127px;--points-grade-gap: 1rem;--student-name-column-width: 225px;--student-grade-column-width: calc( var(--spacer) + var(--grade-input-size) + var(--spacer) );--student-average-column-width: 100px;--test-grade-column-width: calc( var(--spacer) + var(--point-input-size) + var(--points-grade-gap) + var(--grade-input-size) + var(--spacer) );--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}}@media (max-width: 767.98px){[_nghost-%COMP%]{--points-grade-gap: calc(.5 * var(--spacer))}}th[_ngcontent-%COMP%], td[_ngcontent-%COMP%]{padding:1rem}td[_ngcontent-%COMP%]{vertical-align:middle}@media (min-width: 576px){[_nghost-%COMP%]{--point-input-size: 5em}}tr[_ngcontent-%COMP%]:not(.header-collapsible) th.test-grade[_ngcontent-%COMP%], td.test-grade[_ngcontent-%COMP%]{width:var(--test-grade-column-width);min-width:var(--test-grade-column-width);max-width:var(--test-grade-column-width)}@media (max-width: 810px){tr[_ngcontent-%COMP%]:not(.header-collapsible):not(.test-point-grading) th.test-grade[_ngcontent-%COMP%], tr[_ngcontent-%COMP%]:not(.test-point-grading) th.student-grade[_ngcontent-%COMP%], table[_ngcontent-%COMP%]:not(.test-point-grading) td.test-grade[_ngcontent-%COMP%], table[_ngcontent-%COMP%]:not(.test-point-grading) td.student-grade[_ngcontent-%COMP%]{width:calc(var(--spacer) + var(--grade-input-size) + var(--spacer));min-width:calc(var(--spacer) + var(--grade-input-size) + var(--spacer));max-width:calc(var(--spacer) + var(--grade-input-size) + var(--spacer))}}th.filler[_ngcontent-%COMP%], .header-collapsible[_ngcontent-%COMP%] th.filler[_ngcontent-%COMP%], td.filler[_ngcontent-%COMP%]{padding:0;width:auto}@media (max-width: 810px){th.filler[_ngcontent-%COMP%], .header-collapsible[_ngcontent-%COMP%] th.filler[_ngcontent-%COMP%], td.filler[_ngcontent-%COMP%]{width:0}}th.test-grade[_ngcontent-%COMP%] .column-title.point-input-container[_ngcontent-%COMP%]{width:var(--point-input-size)}@media (max-width: 810px){.desktop[_ngcontent-%COMP%]:not(.selected), .student-grade[_ngcontent-%COMP%]:not(.selected), .student-average[_ngcontent-%COMP%], .test-grade[_ngcontent-%COMP%]:not(.selected){display:none}table[_ngcontent-%COMP%], tbody[_ngcontent-%COMP%], thead[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:100%}th[_ngcontent-%COMP%], tr[_ngcontent-%COMP%]{display:flex;width:100%}.student-name[_ngcontent-%COMP%]{flex:1;display:block;padding-right:0}.test-grade[_ngcontent-%COMP%]{flex:none;display:block}}@media (min-width: 811px){.mobile[_ngcontent-%COMP%]{display:none}.student-name[_ngcontent-%COMP%]{width:var(--student-name-column-width);min-width:var(--student-name-column-width);max-width:var(--student-name-column-width)}.student-grade[_ngcontent-%COMP%]{width:var(--student-grade-column-width);min-width:var(--student-grade-column-width);max-width:var(--student-grade-column-width)}.student-average[_ngcontent-%COMP%]{width:var(--student-average-column-width);min-width:var(--student-average-column-width);max-width:var(--student-average-column-width)}.test-grade[_ngcontent-%COMP%]{width:var(--test-grade-column-width);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})}}return t})();var Rs=(t,o)=>o.student.Id,Bs=(t,o)=>o.Id,js=(t,o)=>o.id,As=t=>({"test-point-grading":t}),An=t=>({selected:t}),Vs=t=>["student",t,"grades"],Hs=t=>({"visible-on-mobile":t});function Ns(t,o){if(t&1){let e=G();s(0,"bkd-grade-select",19),l(1,"async"),l(2,"async"),b("gradeIdSelected",function(n){E(e);let d=u(2);return w(d.state.overwriteFinalGrade(n))}),a()}if(t&2){let e=u().$implicit,i=u();m("options",c(1,4,i.state.gradingOptionsForCourse$()))("valueId",e.finalGrade.finalGradeId)("gradeId",e.finalGrade.id)("disabled",c(2,6,i.isEditFinalGradesAllowed(e))===!1)}}function Us(t,o){if(t&1&&(s(0,"div"),p(1),a()),t&2){let e=u().$implicit;r(),v(" ",e.finalGrade.freeHandGrade," ")}}function Ws(t,o){if(t&1&&(R(0),s(1,"td",11),x(2,"bkd-grade",20),l(3,"async"),a()),t&2){let e=o.$implicit,i=o.$index,n=u(),d=n.$implicit,h=n.$index,g=u(),k=e.grade;r(),m("ngClass",g.selectedTest!==void 0&&k.test.Id===g.selectedTest.Id?"selected":""),r(),m("grade",k)("gradeOptions",c(3,5,g.state.gradingOptionsForTest$(k.test)))("student",d.student)("tabIndex",(1+i)*1e3+h)}}function zs(t,o){if(t&1&&(s(0,"tr")(1,"td",6)(2,"a",15)(3,"div"),p(4),a(),s(5,"div",8),p(6),l(7,"translate"),l(8,"decimalOrDash"),a()()(),s(9,"td",16),T(10,Ns,3,8,"bkd-grade-select",17)(11,Us,2,1,"div"),a(),s(12,"td",18),p(13),l(14,"decimalOrDash"),a(),V(15,Ws,4,7,"td",11,js),x(17,"td",12),a()),t&2){let e=o.$implicit,i=u();r(2),m("routerLink",D(16,Vs,e.student.Id)),r(2),f(e.student.FullName),r(2),Ne(" ",c(7,8,"tests.mean"),": ",F(8,10,e.finalGrade==null?null:e.finalGrade.average,"1-3")," "),r(3),m("ngClass",D(18,An,i.selectedTest===void 0)),r(),y(e.finalGrade&&!e.finalGrade.freeHandGrade?10:-1),r(),y(e.finalGrade&&e.finalGrade.freeHandGrade?11:-1),r(2),v(" ",F(14,13,e.finalGrade==null?null:e.finalGrade.average,"1-3")," "),r(2),H(i.getGrades(e))}}function qs(t,o){if(t&1&&(s(0,"td",11),x(1,"bkd-average-grades",21),a()),t&2){let e=o.$implicit,i=u();m("ngClass",e.Id===(i.selectedTest==null?null:i.selectedTest.Id)||e.Id===(i.selectedTest==null?null:i.selectedTest.Id)?"selected":""),r(),m("test",e)}}function Ys(t,o){if(t&1){let e=G();s(0,"button",22),b("click",function(){E(e);let n=u();return w(n.setAverageAsFinalGrade())}),p(1),l(2,"translate"),a()}if(t&2){let e=u(),i=O(2);m("ngClass",D(4,Hs,!i||!e.selectedTest)),r(),v(" ",c(2,2,"tests.set-final-grade")," ")}}var Vn=(()=>{class t{constructor(e,i){this.state=e,this.modalService=i}ngOnInit(){this.state.setSorting({key:"FullName",ascending:!0})}setAverageAsFinalGrade(){this.state.course$.pipe(ae(1)).subscribe(e=>this.state.setAveragesAsFinalGrades({CourseIds:[e.Id]}))}isEditFinalGradesAllowed(e){return this.state.course$.pipe(_(i=>!!(ut(i)?.value&&e.finalGrade?.canGrade)))}getGrades(e){return e.grades.flatMap(i=>({id:`${e.student.Id}-${i.test.Id}`,grade:i}))}publish(e){let i=this.openModal(e);this.onCloseModal(i,()=>this.state.publish(e))}unpublish(e){let i=this.openModal(e);this.onCloseModal(i,()=>this.state.unpublish(e))}calculatePointsAverage(e){return this.safeAverage(e,st)}calculateGradeAverage(e){return this.safeAverage(e,at)}safeAverage(e,i){try{return i(e).toString()}catch{return"\u2013"}}openModal(e){let i=this.modalService.open(Pn);return i.componentInstance.test=e,i}onCloseModal(e,i){e.result.then(n=>{n&&i()},()=>{})}static{this.\u0275fac=function(i){return new(i||t)(S(K),S(dt))}}static{this.\u0275cmp=C({type:t,selectors:[["bkd-test-edit-grades"]],inputs:{selectedTest:"selectedTest"},features:[ie([He])],decls:40,vars:45,consts:[["inlineHeader",""],["stickyHeader",""],[1,"table-responsive-wrapper"],["bkdTestEditGradesHeaderSticky","",1,"table","table-hover","h-100",3,"ngClass","inlineHeader","stickyHeader"],["bkdTestEditGradesHeader","",3,"publish","unpublish","selectedTest"],["bkdTestEditGradesHeader","",3,"publish","unpublish","sticky","selectedTest"],[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"],[1,"test-grade",3,"ngClass"],[1,"filler"],[1,"action-buttons"],["data-testId","apply-average-button","type","button",1,"apply-average-button","btn","btn-primary","m-3",3,"ngClass"],[3,"routerLink"],[1,"sticky","student-grade",3,"ngClass"],[3,"options","valueId","gradeId","disabled"],[1,"border-end","sticky","student-average"],[3,"gradeIdSelected","options","valueId","gradeId","disabled"],[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(i,n){if(i&1){let d=G();R(0),l(1,"async"),R(2),l(3,"async"),R(4),l(5,"async"),s(6,"div",2)(7,"table",3)(8,"thead",4,0),b("publish",function(g){return E(d),w(n.publish(g))})("unpublish",function(g){return E(d),w(n.unpublish(g))}),a(),s(10,"thead",5,1),b("publish",function(g){return E(d),w(n.publish(g))})("unpublish",function(g){return E(d),w(n.unpublish(g))}),a(),s(12,"tbody"),V(13,zs,18,20,"tr",null,Rs),s(15,"tr")(16,"td",6)(17,"div",7)(18,"div"),p(19),l(20,"translate"),a(),s(21,"div",8),p(22),l(23,"translate"),l(24,"async"),l(25,"decimalOrDash"),a()()(),s(26,"td",9),p(27),l(28,"async"),l(29,"decimalOrDash"),a(),s(30,"td",10),p(31),l(32,"async"),l(33,"decimalOrDash"),a(),V(34,qs,2,2,"td",11,Bs),x(36,"td",12),a()()(),s(37,"div",13),T(38,Ys,3,6,"button",14),l(39,"async"),a()()}if(i&2){let d=Se(9),h=Se(11),g=c(1,13,n.state.filteredTests$);r(2),A(c(3,15,n.state.hasTests$));let k=c(5,18,n.state.studentGrades$);r(5),m("ngClass",D(41,As,n.selectedTest==null?null:n.selectedTest.IsPointGrading))("inlineHeader",d)("stickyHeader",h),r(),m("selectedTest",n.selectedTest),r(2),m("sticky",!0)("selectedTest",n.selectedTest),r(3),H(k),r(6),f(c(20,20,"tests.average")),r(3),Ne(" ",c(23,22,"tests.mean"),": ",F(25,26,c(24,24,n.state.meanOfStudentGradesForCourse$),"1-3")," "),r(4),m("ngClass",D(43,An,n.selectedTest===void 0)),r(),v(" ",F(29,31,c(28,29,n.state.meanOfFinalGradesForCourse$),"1-3")," "),r(4),v(" ",F(33,36,c(32,34,n.state.meanOfStudentGradesForCourse$),"1-3")," "),r(3),H(g),r(4),y(c(39,39,n.state.canSetFinalGrade$)?38:-1)}},dependencies:[pe,X,$n,Mn,On,Y,I,Di,Gn,jn],styles:["[_nghost-%COMP%]{--spacer: 16px;--point-input-size: 4em;--grade-input-size: 127px;--points-grade-gap: 1rem;--student-name-column-width: 225px;--student-grade-column-width: calc( var(--spacer) + var(--grade-input-size) + var(--spacer) );--student-average-column-width: 100px;--test-grade-column-width: calc( var(--spacer) + var(--point-input-size) + var(--points-grade-gap) + var(--grade-input-size) + var(--spacer) );--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}}@media (max-width: 767.98px){[_nghost-%COMP%]{--points-grade-gap: calc(.5 * var(--spacer))}}th[_ngcontent-%COMP%], td[_ngcontent-%COMP%]{padding:1rem}td[_ngcontent-%COMP%]{vertical-align:middle}@media (min-width: 576px){[_nghost-%COMP%]{--point-input-size: 5em}}tr[_ngcontent-%COMP%]:not(.header-collapsible) th.test-grade[_ngcontent-%COMP%], td.test-grade[_ngcontent-%COMP%]{width:var(--test-grade-column-width);min-width:var(--test-grade-column-width);max-width:var(--test-grade-column-width)}@media (max-width: 810px){tr[_ngcontent-%COMP%]:not(.header-collapsible):not(.test-point-grading) th.test-grade[_ngcontent-%COMP%], tr[_ngcontent-%COMP%]:not(.test-point-grading) th.student-grade[_ngcontent-%COMP%], table[_ngcontent-%COMP%]:not(.test-point-grading) td.test-grade[_ngcontent-%COMP%], table[_ngcontent-%COMP%]:not(.test-point-grading) td.student-grade[_ngcontent-%COMP%]{width:calc(var(--spacer) + var(--grade-input-size) + var(--spacer));min-width:calc(var(--spacer) + var(--grade-input-size) + var(--spacer));max-width:calc(var(--spacer) + var(--grade-input-size) + var(--spacer))}}th.filler[_ngcontent-%COMP%], .header-collapsible[_ngcontent-%COMP%] th.filler[_ngcontent-%COMP%], td.filler[_ngcontent-%COMP%]{padding:0;width:auto}@media (max-width: 810px){th.filler[_ngcontent-%COMP%], .header-collapsible[_ngcontent-%COMP%] th.filler[_ngcontent-%COMP%], td.filler[_ngcontent-%COMP%]{width:0}}th.test-grade[_ngcontent-%COMP%] .column-title.point-input-container[_ngcontent-%COMP%]{width:var(--point-input-size)}@media (max-width: 810px){.desktop[_ngcontent-%COMP%]:not(.selected), .student-grade[_ngcontent-%COMP%]:not(.selected), .student-average[_ngcontent-%COMP%], .test-grade[_ngcontent-%COMP%]:not(.selected){display:none}table[_ngcontent-%COMP%], tbody[_ngcontent-%COMP%], thead[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:100%}th[_ngcontent-%COMP%], tr[_ngcontent-%COMP%]{display:flex;width:100%}.student-name[_ngcontent-%COMP%]{flex:1;display:block;padding-right:0}.test-grade[_ngcontent-%COMP%]{flex:none;display:block}}@media (min-width: 811px){.mobile[_ngcontent-%COMP%]{display:none}.student-name[_ngcontent-%COMP%]{width:var(--student-name-column-width);min-width:var(--student-name-column-width);max-width:var(--student-name-column-width)}.student-grade[_ngcontent-%COMP%]{width:var(--student-grade-column-width);min-width:var(--student-grade-column-width);max-width:var(--student-grade-column-width)}.student-average[_ngcontent-%COMP%]{width:var(--student-average-column-width);min-width:var(--student-average-column-width);max-width:var(--student-average-column-width)}.test-grade[_ngcontent-%COMP%]{width:var(--test-grade-column-width);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%], tbody[_ngcontent-%COMP%] td.student-name[_ngcontent-%COMP%] *[_ngcontent-%COMP%]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}tbody[_ngcontent-%COMP%] td.student-name[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{text-decoration:none}tbody[_ngcontent-%COMP%] td.student-name[_ngcontent-%COMP%] a[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:first-child{text-decoration:underline}tbody[_ngcontent-%COMP%] td.student-name[_ngcontent-%COMP%] a[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:first-child:hover{text-decoration-color:#ea161f}.student-average-inline[_ngcontent-%COMP%]{color:#4e4e4ef2;font-size:.875rem;line-height:1}@media (min-width: 811px){.table-responsive-wrapper[_ngcontent-%COMP%]{display:block;overflow-x:auto}table[_ngcontent-%COMP%]{border-collapse:separate;border-spacing:0}.action-buttons[_ngcontent-%COMP%]{position:sticky;left:0}}@media (max-width: 810px){.apply-average-button[_ngcontent-%COMP%]:not(.visible-on-mobile){display:none!important}}"]})}}return t})();var Ks=()=>["/events"],Zs=t=>({count:t});function Qs(t,o){if(t&1&&(s(0,"div",7),p(1),l(2,"translate"),a()),t&2){let e=u();r(),v(" ",F(2,1,e.course.ParticipatingStudents.length===1?"courses.registration":"courses.registrations",D(4,Zs,e.course.ParticipatingStudents.length))," ")}}var Hn=(()=>{class t{constructor(e){this.reportsService=e,this.course$=new q(null),this.reports$=this.course$.pipe(_(i=>i?.Id),Z(),M(i=>i?this.reportsService.getCourseTestsReports(i):N([])),At([]))}ngOnChanges(e){e.course&&this.course$.next(e.course.currentValue)}getDesignation(){return ht(this.course)}static{this.\u0275fac=function(i){return new(i||t)(S(ot))}}static{this.\u0275cmp=C({type:t,selectors:[["bkd-tests-header"]],inputs:{course:"course"},features:[ke],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"],[1,"additional-info"]],template:function(i,n){i&1&&(s(0,"bkd-backlink",0)(1,"div",1)(2,"a",2)(3,"i",3),p(4,"add"),a()(),x(5,"bkd-reports-link",4),l(6,"async"),x(7,"div",5),a()(),s(8,"div",6)(9,"h1"),p(10),a(),T(11,Qs,3,6,"div",7),a()),i&2&&(m("link",Oe(6,Ks)),r(5),m("reports",c(6,4,n.reports$)),r(5),f(n.getDesignation()),r(),y(n.course.ParticipatingStudents?11:-1))},dependencies:[Ae,X,nt,Y,I],styles:[".header[_ngcontent-%COMP%]{padding-bottom:1rem;border-bottom:1px solid #dee2e6}h1[_ngcontent-%COMP%]{margin-bottom:0}.additional-info[_ngcontent-%COMP%]{color:#adb5bd}"]})}}return t})();var Xs=()=>[],Js=t=>({"visible-on-mobile":t});function ea(t,o){t&1&&x(0,"bkd-spinner")}function ta(t,o){if(t&1){let e=G();s(0,"bkd-select",4),b("valueChange",function(n){E(e);let d=u(2);return w(n&&d.testSelected(n))}),a(),x(1,"bkd-test-edit-grades",5)}if(t&2){u(2);let e=O(6),i=O(8),n=O(10);m("options",e)("value",i)("allowEmpty",!1),r(),m("selectedTest",n)}}function ia(t,o){t&1&&(s(0,"p",2),p(1),l(2,"translate"),a()),t&2&&(r(),f(c(2,1,"tests.no-tests")))}function na(t,o){if(t&1&&(s(0,"a",3),l(1,"async"),s(2,"i",6),p(3,"arrow_right_alt"),a(),s(4,"span",7),p(5),l(6,"translate"),a()()),t&2){let e=u(2),i=O(4),n=O(10);le("href",c(1,3,e.buildLinkToRatingOverview()),_e),m("ngClass",D(7,Js,!i||!n)),r(5),f(c(6,5,"tests.link-to-rating-overview"))}}function ra(t,o){if(t&1&&(x(0,"bkd-tests-header",1),T(1,ta,2,4)(2,ia,3,3,"p",2)(3,na,7,9,"a",3),l(4,"async")),t&2){let e=u(),i=O(0),n=O(2);m("course",i),r(),y(n.length>0?1:2),r(2),y(c(4,3,e.state.canSetFinalGrade$)?3:-1)}}var Nn=(()=>{class t{constructor(e,i,n){this.settings=e,this.state=i,this.translate=n,this.selectTest$=new te,this.testOptions$=this.state.tests$.pipe(_(d=>[{Key:-1,Value:this.translate.instant("tests.grade")},...d.map(h=>({Key:h.Id,Value:h.Designation}))]),Z()),this.selectedTestId$=ze(this.selectTest$,this.state.tests$.pipe(ae(1),_(d=>d[0]?.Id))).pipe(Z()),this.selectedTest$=this.selectedTestId$.pipe(M(d=>this.state.tests$.pipe(_(h=>h.find(g=>g.Id===d)))),Z())}testSelected(e){this.selectTest$.next(e)}buildLinkToRatingOverview(){return this.state.course$.pipe(ae(1),_(e=>this.settings.eventlist.evaluation.replace(":id",String(e.Id))))}static{this.\u0275fac=function(i){return new(i||t)(S(ce),S(K),S(se))}}static{this.\u0275cmp=C({type:t,selectors:[["bkd-tests-list"]],decls:16,vars:22,consts:[[1,"bkd-container"],[3,"course"],[1,"mt-3","px-3"],[1,"rating-overview","d-flex","justify-content-end","pe-3","border-top","pt-3",3,"ngClass","href"],["width","100%",1,"tests-dropdown",3,"valueChange","options","value","allowEmpty"],[3,"selectedTest"],[1,"material-icons","fw-bold"],[1,"ps-1"]],template:function(i,n){if(i&1&&(R(0),l(1,"async"),R(2),l(3,"async"),R(4),l(5,"async"),R(6),l(7,"async"),R(8),l(9,"async"),R(10),l(11,"async"),s(12,"div",0),T(13,ea,1,0,"bkd-spinner"),l(14,"async"),T(15,ra,5,5),a()),i&2){let d;A(c(1,1,n.state.course$)),r(2),A((d=c(3,4,n.state.tests$))!==null&&d!==void 0?d:Oe(21,Xs)),r(2),A(c(5,7,n.state.hasTests$)),r(2),A(c(7,10,n.testOptions$)),r(2),A(c(9,13,n.selectedTestId$)),r(2),A(c(11,16,n.selectedTest$)),r(3),y(c(14,19,n.state.loading$)?13:15)}},dependencies:[Hn,Be,Vn,pe,ue,Y,I],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}}"]})}}return t})();var yt=(()=>{class t{constructor(e,i){this.state=e,this.route=i,this.courseId$=this.route.paramMap.pipe(_(n=>Number(n.get("id"))),Z()),this.destroy$=new te}ngOnInit(){this.courseId$.pipe(Ce(this.destroy$)).subscribe(e=>this.state.setCourseId(e))}ngOnDestroy(){this.destroy$.next()}static{this.\u0275fac=function(i){return new(i||t)(S(K),S(ne))}}static{this.\u0275cmp=C({type:t,selectors:[["bkd-tests"]],features:[ie([K])],decls:1,vars:0,template:function(i,n){i&1&&x(0,"router-outlet")},dependencies:[ye],encapsulation:2})}}return t})();function Un(t){return{path:t,component:mn,children:[{path:"",component:pn},{path:"study-course-student/:id",component:cn},It]}}var xc=[{path:"",component:hn,children:[{path:"",component:un},{path:"current",component:tn,children:[{path:"",component:en},Un(":id")]},{path:":id",component:yt,children:[{path:"tests",component:Nn},Un("students")]},{path:":id/tests/:testId/edit",component:yt,children:[{path:"",component:kn}]},{path:":id/tests/add",component:yt,children:[{path:"",component:wn}]},{path:":id/tests",children:[It]}]}];export{Yi as a,Un as b,xc as c}; diff --git a/public/apps/webapp-schulverwaltung/chunk-DKHMWL57.js b/public/apps/webapp-schulverwaltung/chunk-45PGF53G.js similarity index 98% rename from public/apps/webapp-schulverwaltung/chunk-DKHMWL57.js rename to public/apps/webapp-schulverwaltung/chunk-45PGF53G.js index 30bf5462..3f402088 100644 --- a/public/apps/webapp-schulverwaltung/chunk-DKHMWL57.js +++ b/public/apps/webapp-schulverwaltung/chunk-45PGF53G.js @@ -1 +1 @@ -import{a as ye,b as Se,c as ge}from"./chunk-4KY7ONEQ.js";import{a as be}from"./chunk-W4ESFJ6M.js";import{a as _e}from"./chunk-RTY26FN4.js";import{a as ue}from"./chunk-3HCVMNJA.js";import"./chunk-5WNFCBTP.js";import"./chunk-A3CECLYB.js";import"./chunk-HCNFZOWE.js";import{b as oe,e as M}from"./chunk-746ASKQ4.js";import"./chunk-DTTSX64G.js";import"./chunk-Y4QYVF5K.js";import"./chunk-AYQPMCNZ.js";import{a as ve,b as Ce,c as fe}from"./chunk-4RZQAAPF.js";import{f as de}from"./chunk-Z4YBXGVO.js";import{d as me}from"./chunk-3L4RH6QP.js";import"./chunk-DTYYCJHM.js";import"./chunk-XAZECV42.js";import{a as he}from"./chunk-3P6YOVUR.js";import{L as re,P as se}from"./chunk-SRCW6BUG.js";import"./chunk-GOGVGWFJ.js";import{a as le,b as pe}from"./chunk-OSOXMODN.js";import{b as ce}from"./chunk-PSYDBHTH.js";import{u as ae}from"./chunk-W4U7QKJF.js";import"./chunk-AVBHFGIF.js";import{$a as r,$b as Y,Ab as $,Bb as j,Cb as S,Db as J,Eb as K,F as W,Fb as N,Ga as x,Jb as s,Kb as l,M as q,Na as C,P as V,Pa as z,Pd as D,Qa as v,R as U,Va as b,X as G,Xb as Q,Ya as I,Za as F,_ as E,_a as o,ab as k,cc as Z,cd as ne,ea as L,eb as P,fa as T,gb as h,hb as p,ma as X,n as H,rb as m,sb as y,tb as f,wc as ee,xa as a,xb as w,xc as te,ya as _,yb as R,zb as B,zc as ie}from"./chunk-2W7IS4PN.js";var Ee=(()=>{class e{constructor(t,i,n){this.studentsService=t,this.educationalEventsService=i,this.studyClassesService=n,this.filter={student:null,educationalEvent:null,studyClass:null},this.filterChange=new X,this.classesHttpFilter={params:{fields:"IsActive","filter.IsActive":"=true"}}}show(){this.filterChange.emit(this.filter)}static{this.\u0275fac=function(i){return new(i||e)(_(de),_(ge),_(_e))}}static{this.\u0275cmp=x({type:e,selectors:[["bkd-evaluate-absences-header"]],inputs:{filter:"filter"},outputs:{filterChange:"filterChange"},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,n){i&1&&(o(0,"div",0)(1,"div",1)(2,"label",2),m(3),s(4,"translate"),r(),o(5,"bkd-typeahead",3),B("valueChange",function(d){return R(n.filter.student,d)||(n.filter.student=d),d}),r()(),o(6,"div",1)(7,"label",2),m(8),s(9,"translate"),r(),o(10,"bkd-typeahead",3),B("valueChange",function(d){return R(n.filter.educationalEvent,d)||(n.filter.educationalEvent=d),d}),r()(),o(11,"div",1)(12,"label",2),m(13),s(14,"translate"),r(),o(15,"bkd-typeahead",4),B("valueChange",function(d){return R(n.filter.studyClass,d)||(n.filter.studyClass=d),d}),r()(),o(16,"div",5)(17,"button",6),h("click",function(){return n.show()}),m(18),s(19,"translate"),r()()()),i&2&&(a(3),y(l(4,11,"evaluate-absences.header.student")),a(2),v("typeaheadService",n.studentsService),w("value",n.filter.student),a(3),y(l(9,13,"evaluate-absences.header.module-instance")),a(2),v("typeaheadService",n.educationalEventsService),w("value",n.filter.educationalEvent),a(3),y(l(14,15,"evaluate-absences.header.study-class")),a(2),v("typeaheadService",n.studyClassesService),w("value",n.filter.studyClass),v("additionalHttpParams",n.classesHttpFilter),a(3),f(" ",l(19,17,"evaluate-absences.header.show")," "))},dependencies:[be,D],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;padding:1rem 1rem 1rem 0;border-bottom:1px solid #dee2e6}"],changeDetection:0})}}return e})();var g=(()=>{class e extends Ce{constructor(t,i,n,u,d){super(t,i,d,n,"/evaluate-absences"),this.lessonPresenceService=u,this.queryParamsString$.pipe(U(this.destroy$)).subscribe(A=>this.confirmBackLinkParams={returnparams:A})}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,n){return this.loadingService.load(this.lessonPresenceService.getStatistics(t,i,n),ve)}buildParamsFromFilter(t){return ye(t)}static{this.\u0275fac=function(i){return new(i||e)(E(Q),E(pe),E(ne),E(M),E(fe))}}static{this.\u0275prov=G({token:e,factory:e.\u0275fac})}}return e})();var ke=(e,c)=>c.key,Pe=(e,c)=>c.StudentRef.Id,Ie=()=>[],Fe=e=>["student",e,"absences"],we=e=>({returnparams:e});function Re(e,c){e&1&&k(0,"bkd-spinner")}function Be(e,c){if(e&1){let t=P();o(0,"th",9),h("click",function(){let n=L(t).$implicit,u=p(4);return T(u.state.sortService.toggleSorting(n.key))}),o(1,"div",10)(2,"div",11),s(3,"translate"),m(4),s(5,"translate"),r(),o(6,"div",12),m(7),s(8,"async"),r()()()}if(e&2){let t=c.$implicit,i=p(4);v("ngClass",t.label),a(2),v("ngbTooltip",l(3,4,"evaluate-absences.list.header."+t.label)),a(2),f(" ",l(5,6,"evaluate-absences.list.header."+t.label)," "),a(3),f(" ",l(8,8,i.state.sortService.getSortingChar$(t.key))," ")}}function $e(e,c){if(e&1&&(o(0,"a",13),s(1,"async"),m(2),r()),e&2){let t=p().$implicit,i=p().$implicit,n=p(5);v("routerLink",N(5,Fe,i.StudentRef.Id))("queryParams",N(7,we,l(1,3,n.profileReturnParams$))),a(2),f(" ",i[t.key]," ")}}function je(e,c){if(e&1&&m(0),e&2){let t=p().$implicit,i=p().$implicit;f(" ",i[t.key]," ")}}function De(e,c){if(e&1&&(o(0,"td"),s(1,"translate"),C(2,$e,3,9,"a",13)(3,je,1,1),r()),e&2){let t=c.$implicit;z("data-label",l(1,2,"evaluate-absences.list.header."+t.label)),a(2),b(t.key==="StudentFullName"?2:3)}}function Me(e,c){if(e&1&&(o(0,"tr"),I(1,De,4,4,"td",null,ke),r()),e&2){let t=p(5);a(),F(t.columns)}}function Ve(e,c){if(e&1&&(o(0,"tbody"),I(1,Me,3,0,"tr",null,Pe),r()),e&2){p(4);let t=S(0);a(),F(t)}}function Ne(e,c){e&1&&k(0,"bkd-spinner",7)}function Oe(e,c){if(e&1){let t=P();o(0,"button",14),h("click",function(){L(t);let n=p(4);return T(n.state.nextPage())}),m(1),s(2,"translate"),r()}e&2&&(a(),f(" ",l(2,1,"global.pagination.load-more")," "))}function He(e,c){if(e&1){let t=P();o(0,"div",2)(1,"div",3),k(2,"bkd-reports-link",4),s(3,"async"),r(),o(4,"table",5),h("scrolled",function(){L(t);let n=p(3);return T(n.onScroll())}),o(5,"thead")(6,"tr"),I(7,Be,9,10,"th",6,ke),r()(),C(9,Ve,3,0,"tbody"),r(),C(10,Ne,1,0,"bkd-spinner",7)(11,Oe,3,3,"button",8),r()}if(e&2){let t,i=p(3),n=S(0),u=S(2),d=S(4);a(2),v("reports",(t=l(3,4,i.reports$))!==null&&t!==void 0?t:K(6,Ie)),a(5),F(i.columns),a(2),b(n&&n.length>0?9:-1),a(),b(d?10:-1),a(),b(u&&!d?11:-1)}}function We(e,c){e&1&&(o(0,"p",1),m(1),s(2,"translate"),r()),e&2&&(a(),f(" ",l(2,1,"evaluate-absences.no-entries")," "))}function qe(e,c){if(e&1&&C(0,He,12,7,"div",2)(1,We,3,3,"p",1),e&2){p(2);let t=S(0),i=S(4);b(t&&t.length>0||i?0:1)}}function Ue(e,c){if(e&1&&(C(0,Re,1,0,"bkd-spinner"),s(1,"async"),C(2,qe,2,1)),e&2){let t=p();b(l(1,1,t.state.loading$)?0:2)}}function Ge(e,c){e&1&&(o(0,"p",1),m(1),s(2,"translate"),r()),e&2&&(a(),y(l(2,1,"evaluate-absences.no-filter")))}var Ae=(()=>{class e{constructor(t,i,n,u,d,A){this.state=t,this.scrollPosition=i,this.route=n,this.presenceTypesService=u,this.reportsService=d,this.lessonPresencesService=A,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(H(Xe)),this.profileReturnParams$=this.state.queryParamsString$}ngOnInit(){this.filterFromParams$.pipe(W(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(V(t=>this.lessonPresencesService.getLessonRefs(t)),V(t=>t.length>0?this.reportsService.getEvaluateAbsencesReports(this.getReportRecordIds(t)):[]),q(1))}getReportRecordIds(t){return t.map(i=>`${i.LessonRef.Id}_${i.RegistrationRef.Id}`)}static{this.\u0275fac=function(i){return new(i||e)(_(g),_(he),_(ee),_(se),_(me),_(M))}}static{this.\u0275cmp=x({type:e,selectors:[["bkd-evaluate-absences-list"]],decls:14,vars:18,consts:[[3,"filterChange","filter"],[1,"mt-3"],[1,"py-3"],[1,"buttons"],[1,"mb-2",3,"reports"],["infiniteScroll","",1,"table","table-striped","table-fixed",3,"scrolled"],["scope","col",3,"ngClass"],[1,"inline"],["type","button",1,"btn","btn-outline-secondary","btn-sm","d-block","mx-auto"],["scope","col",3,"click","ngClass"],[1,"d-flex"],[1,"column-title",3,"ngbTooltip"],[1,"sort-direction"],[1,"student",3,"routerLink","queryParams"],["type","button",1,"btn","btn-outline-secondary","btn-sm","d-block","mx-auto",3,"click"]],template:function(i,n){if(i&1){let u=P();$(0),s(1,"async"),$(2),s(3,"async"),$(4),s(5,"async"),o(6,"h1"),m(7),s(8,"translate"),r(),o(9,"bkd-evaluate-absences-header",0),s(10,"async"),h("filterChange",function(A){return L(u),T(n.state.setFilter(A))}),r(),C(11,Ue,3,3),s(12,"async"),C(13,Ge,3,3,"p",1)}i&2&&(j(l(1,3,n.state.entries$)),a(2),j(l(3,6,n.state.hasMore$)),a(2),j(l(5,9,n.state.loadingPage$)),a(3),y(l(8,12,"evaluate-absences.title")),a(2),v("filter",l(10,14,n.filterFromParams$)),a(2),b(l(12,16,n.state.isFilterValid$)?11:13))},dependencies:[Ee,le,Se,Y,ae,ie,ce,Z,D],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})}}return e})();function Xe(e){return{student:e.student?Number(e.student):null,educationalEvent:e.educationalEvent?Number(e.educationalEvent):null,studyClass:e.studyClass?Number(e.studyClass):null}}var Le=(()=>{class e{constructor(t){this.state=t}static{this.\u0275fac=function(i){return new(i||e)(_(g))}}static{this.\u0275cmp=x({type:e,selectors:[["bkd-evaluate-absences"]],features:[J([g,{provide:oe,useExisting:g},re])],decls:1,vars:0,template:function(i,n){i&1&&k(0,"router-outlet")},dependencies:[te],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return e})();var Bt=[{path:"",component:Le,children:[{path:"",component:Ae,data:{restoreScrollPositionFrom:["/evaluate-absences/student/:id"]}},ue]}];export{Bt as EVALUATE_ABSENCES_ROUTES}; +import{a as ye,b as Se,c as ge}from"./chunk-4KY7ONEQ.js";import{a as be}from"./chunk-W4ESFJ6M.js";import{a as _e}from"./chunk-YQAWVQ54.js";import{a as ue}from"./chunk-THL2WTJD.js";import"./chunk-5WNFCBTP.js";import"./chunk-LASWC23V.js";import"./chunk-HCNFZOWE.js";import{b as oe,e as M}from"./chunk-746ASKQ4.js";import"./chunk-DTTSX64G.js";import"./chunk-Y4QYVF5K.js";import"./chunk-AYQPMCNZ.js";import{a as ve,b as Ce,c as fe}from"./chunk-4RZQAAPF.js";import{f as de}from"./chunk-Z4YBXGVO.js";import{d as me}from"./chunk-3L4RH6QP.js";import"./chunk-DTYYCJHM.js";import"./chunk-XAZECV42.js";import{a as he}from"./chunk-3P6YOVUR.js";import{L as re,P as se}from"./chunk-SRCW6BUG.js";import"./chunk-GOGVGWFJ.js";import{a as le,b as pe}from"./chunk-OSOXMODN.js";import{b as ce}from"./chunk-PSYDBHTH.js";import{u as ae}from"./chunk-W4U7QKJF.js";import"./chunk-AVBHFGIF.js";import{$a as r,$b as Y,Ab as $,Bb as j,Cb as S,Db as J,Eb as K,F as W,Fb as N,Ga as x,Jb as s,Kb as l,M as q,Na as C,P as V,Pa as z,Pd as D,Qa as v,R as U,Va as b,X as G,Xb as Q,Ya as I,Za as F,_ as E,_a as o,ab as k,cc as Z,cd as ne,ea as L,eb as P,fa as T,gb as h,hb as p,ma as X,n as H,rb as m,sb as y,tb as f,wc as ee,xa as a,xb as w,xc as te,ya as _,yb as R,zb as B,zc as ie}from"./chunk-2W7IS4PN.js";var Ee=(()=>{class e{constructor(t,i,n){this.studentsService=t,this.educationalEventsService=i,this.studyClassesService=n,this.filter={student:null,educationalEvent:null,studyClass:null},this.filterChange=new X,this.classesHttpFilter={params:{fields:"IsActive","filter.IsActive":"=true"}}}show(){this.filterChange.emit(this.filter)}static{this.\u0275fac=function(i){return new(i||e)(_(de),_(ge),_(_e))}}static{this.\u0275cmp=x({type:e,selectors:[["bkd-evaluate-absences-header"]],inputs:{filter:"filter"},outputs:{filterChange:"filterChange"},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,n){i&1&&(o(0,"div",0)(1,"div",1)(2,"label",2),m(3),s(4,"translate"),r(),o(5,"bkd-typeahead",3),B("valueChange",function(d){return R(n.filter.student,d)||(n.filter.student=d),d}),r()(),o(6,"div",1)(7,"label",2),m(8),s(9,"translate"),r(),o(10,"bkd-typeahead",3),B("valueChange",function(d){return R(n.filter.educationalEvent,d)||(n.filter.educationalEvent=d),d}),r()(),o(11,"div",1)(12,"label",2),m(13),s(14,"translate"),r(),o(15,"bkd-typeahead",4),B("valueChange",function(d){return R(n.filter.studyClass,d)||(n.filter.studyClass=d),d}),r()(),o(16,"div",5)(17,"button",6),h("click",function(){return n.show()}),m(18),s(19,"translate"),r()()()),i&2&&(a(3),y(l(4,11,"evaluate-absences.header.student")),a(2),v("typeaheadService",n.studentsService),w("value",n.filter.student),a(3),y(l(9,13,"evaluate-absences.header.module-instance")),a(2),v("typeaheadService",n.educationalEventsService),w("value",n.filter.educationalEvent),a(3),y(l(14,15,"evaluate-absences.header.study-class")),a(2),v("typeaheadService",n.studyClassesService),w("value",n.filter.studyClass),v("additionalHttpParams",n.classesHttpFilter),a(3),f(" ",l(19,17,"evaluate-absences.header.show")," "))},dependencies:[be,D],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;padding:1rem 1rem 1rem 0;border-bottom:1px solid #dee2e6}"],changeDetection:0})}}return e})();var g=(()=>{class e extends Ce{constructor(t,i,n,u,d){super(t,i,d,n,"/evaluate-absences"),this.lessonPresenceService=u,this.queryParamsString$.pipe(U(this.destroy$)).subscribe(A=>this.confirmBackLinkParams={returnparams:A})}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,n){return this.loadingService.load(this.lessonPresenceService.getStatistics(t,i,n),ve)}buildParamsFromFilter(t){return ye(t)}static{this.\u0275fac=function(i){return new(i||e)(E(Q),E(pe),E(ne),E(M),E(fe))}}static{this.\u0275prov=G({token:e,factory:e.\u0275fac})}}return e})();var ke=(e,c)=>c.key,Pe=(e,c)=>c.StudentRef.Id,Ie=()=>[],Fe=e=>["student",e,"absences"],we=e=>({returnparams:e});function Re(e,c){e&1&&k(0,"bkd-spinner")}function Be(e,c){if(e&1){let t=P();o(0,"th",9),h("click",function(){let n=L(t).$implicit,u=p(4);return T(u.state.sortService.toggleSorting(n.key))}),o(1,"div",10)(2,"div",11),s(3,"translate"),m(4),s(5,"translate"),r(),o(6,"div",12),m(7),s(8,"async"),r()()()}if(e&2){let t=c.$implicit,i=p(4);v("ngClass",t.label),a(2),v("ngbTooltip",l(3,4,"evaluate-absences.list.header."+t.label)),a(2),f(" ",l(5,6,"evaluate-absences.list.header."+t.label)," "),a(3),f(" ",l(8,8,i.state.sortService.getSortingChar$(t.key))," ")}}function $e(e,c){if(e&1&&(o(0,"a",13),s(1,"async"),m(2),r()),e&2){let t=p().$implicit,i=p().$implicit,n=p(5);v("routerLink",N(5,Fe,i.StudentRef.Id))("queryParams",N(7,we,l(1,3,n.profileReturnParams$))),a(2),f(" ",i[t.key]," ")}}function je(e,c){if(e&1&&m(0),e&2){let t=p().$implicit,i=p().$implicit;f(" ",i[t.key]," ")}}function De(e,c){if(e&1&&(o(0,"td"),s(1,"translate"),C(2,$e,3,9,"a",13)(3,je,1,1),r()),e&2){let t=c.$implicit;z("data-label",l(1,2,"evaluate-absences.list.header."+t.label)),a(2),b(t.key==="StudentFullName"?2:3)}}function Me(e,c){if(e&1&&(o(0,"tr"),I(1,De,4,4,"td",null,ke),r()),e&2){let t=p(5);a(),F(t.columns)}}function Ve(e,c){if(e&1&&(o(0,"tbody"),I(1,Me,3,0,"tr",null,Pe),r()),e&2){p(4);let t=S(0);a(),F(t)}}function Ne(e,c){e&1&&k(0,"bkd-spinner",7)}function Oe(e,c){if(e&1){let t=P();o(0,"button",14),h("click",function(){L(t);let n=p(4);return T(n.state.nextPage())}),m(1),s(2,"translate"),r()}e&2&&(a(),f(" ",l(2,1,"global.pagination.load-more")," "))}function He(e,c){if(e&1){let t=P();o(0,"div",2)(1,"div",3),k(2,"bkd-reports-link",4),s(3,"async"),r(),o(4,"table",5),h("scrolled",function(){L(t);let n=p(3);return T(n.onScroll())}),o(5,"thead")(6,"tr"),I(7,Be,9,10,"th",6,ke),r()(),C(9,Ve,3,0,"tbody"),r(),C(10,Ne,1,0,"bkd-spinner",7)(11,Oe,3,3,"button",8),r()}if(e&2){let t,i=p(3),n=S(0),u=S(2),d=S(4);a(2),v("reports",(t=l(3,4,i.reports$))!==null&&t!==void 0?t:K(6,Ie)),a(5),F(i.columns),a(2),b(n&&n.length>0?9:-1),a(),b(d?10:-1),a(),b(u&&!d?11:-1)}}function We(e,c){e&1&&(o(0,"p",1),m(1),s(2,"translate"),r()),e&2&&(a(),f(" ",l(2,1,"evaluate-absences.no-entries")," "))}function qe(e,c){if(e&1&&C(0,He,12,7,"div",2)(1,We,3,3,"p",1),e&2){p(2);let t=S(0),i=S(4);b(t&&t.length>0||i?0:1)}}function Ue(e,c){if(e&1&&(C(0,Re,1,0,"bkd-spinner"),s(1,"async"),C(2,qe,2,1)),e&2){let t=p();b(l(1,1,t.state.loading$)?0:2)}}function Ge(e,c){e&1&&(o(0,"p",1),m(1),s(2,"translate"),r()),e&2&&(a(),y(l(2,1,"evaluate-absences.no-filter")))}var Ae=(()=>{class e{constructor(t,i,n,u,d,A){this.state=t,this.scrollPosition=i,this.route=n,this.presenceTypesService=u,this.reportsService=d,this.lessonPresencesService=A,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(H(Xe)),this.profileReturnParams$=this.state.queryParamsString$}ngOnInit(){this.filterFromParams$.pipe(W(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(V(t=>this.lessonPresencesService.getLessonRefs(t)),V(t=>t.length>0?this.reportsService.getEvaluateAbsencesReports(this.getReportRecordIds(t)):[]),q(1))}getReportRecordIds(t){return t.map(i=>`${i.LessonRef.Id}_${i.RegistrationRef.Id}`)}static{this.\u0275fac=function(i){return new(i||e)(_(g),_(he),_(ee),_(se),_(me),_(M))}}static{this.\u0275cmp=x({type:e,selectors:[["bkd-evaluate-absences-list"]],decls:14,vars:18,consts:[[3,"filterChange","filter"],[1,"mt-3"],[1,"py-3"],[1,"buttons"],[1,"mb-2",3,"reports"],["infiniteScroll","",1,"table","table-striped","table-fixed",3,"scrolled"],["scope","col",3,"ngClass"],[1,"inline"],["type","button",1,"btn","btn-outline-secondary","btn-sm","d-block","mx-auto"],["scope","col",3,"click","ngClass"],[1,"d-flex"],[1,"column-title",3,"ngbTooltip"],[1,"sort-direction"],[1,"student",3,"routerLink","queryParams"],["type","button",1,"btn","btn-outline-secondary","btn-sm","d-block","mx-auto",3,"click"]],template:function(i,n){if(i&1){let u=P();$(0),s(1,"async"),$(2),s(3,"async"),$(4),s(5,"async"),o(6,"h1"),m(7),s(8,"translate"),r(),o(9,"bkd-evaluate-absences-header",0),s(10,"async"),h("filterChange",function(A){return L(u),T(n.state.setFilter(A))}),r(),C(11,Ue,3,3),s(12,"async"),C(13,Ge,3,3,"p",1)}i&2&&(j(l(1,3,n.state.entries$)),a(2),j(l(3,6,n.state.hasMore$)),a(2),j(l(5,9,n.state.loadingPage$)),a(3),y(l(8,12,"evaluate-absences.title")),a(2),v("filter",l(10,14,n.filterFromParams$)),a(2),b(l(12,16,n.state.isFilterValid$)?11:13))},dependencies:[Ee,le,Se,Y,ae,ie,ce,Z,D],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})}}return e})();function Xe(e){return{student:e.student?Number(e.student):null,educationalEvent:e.educationalEvent?Number(e.educationalEvent):null,studyClass:e.studyClass?Number(e.studyClass):null}}var Le=(()=>{class e{constructor(t){this.state=t}static{this.\u0275fac=function(i){return new(i||e)(_(g))}}static{this.\u0275cmp=x({type:e,selectors:[["bkd-evaluate-absences"]],features:[J([g,{provide:oe,useExisting:g},re])],decls:1,vars:0,template:function(i,n){i&1&&k(0,"router-outlet")},dependencies:[te],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return e})();var Bt=[{path:"",component:Le,children:[{path:"",component:Ae,data:{restoreScrollPositionFrom:["/evaluate-absences/student/:id"]}},ue]}];export{Bt as EVALUATE_ABSENCES_ROUTES}; diff --git a/public/apps/webapp-schulverwaltung/chunk-7KV2DHNF.js b/public/apps/webapp-schulverwaltung/chunk-5V4FYHUO.js similarity index 98% rename from public/apps/webapp-schulverwaltung/chunk-7KV2DHNF.js rename to public/apps/webapp-schulverwaltung/chunk-5V4FYHUO.js index 15875635..6470a772 100644 --- a/public/apps/webapp-schulverwaltung/chunk-7KV2DHNF.js +++ b/public/apps/webapp-schulverwaltung/chunk-5V4FYHUO.js @@ -1 +1 @@ -import{p as Y,r as z,s as Q,t as W,w as X}from"./chunk-A3CECLYB.js";import"./chunk-Y4QYVF5K.js";import"./chunk-AYQPMCNZ.js";import{d as K}from"./chunk-3L4RH6QP.js";import{a as J,b as V}from"./chunk-OSOXMODN.js";import{b as U}from"./chunk-PSYDBHTH.js";import{C as w,w as x}from"./chunk-W4U7QKJF.js";import{$a as u,Ab as G,Bb as I,Cb as $,Db as b,Eb as O,Ga as l,Jb as o,Kb as a,M as E,Na as j,P as _,Pd as R,Qa as v,Rd as q,Va as B,X as P,_ as p,_a as g,ab as m,cc as M,cd as N,h as L,hb as A,n as d,o as k,rb as y,s as D,sb as C,xa as c,xc as H,ya as h}from"./chunk-2W7IS4PN.js";var f=(()=>{class e{constructor(s,t,n,S,se,ne,oe){this.storageService=s,this.loadingService=t,this.coursesRestService=n,this.subscriptionRestService=S,this.reportsService=se,this.gradingScalesRestService=ne,this.settings=oe,this.studentId$=new L(1),this.loading$=this.loadingService.loading$,this.studentCourses$=this.loadCourses().pipe(E(1)),this.studentCoursesSorted$=this.studentCourses$.pipe(d(i=>i.slice().sort((r,ae)=>r.Designation.localeCompare(ae.Designation)))),this.studentCourseIds$=this.studentCourses$.pipe(d(i=>i.flatMap(r=>r.Id))),this.subscriptionIds$=k([this.studentId$,this.studentCourseIds$]).pipe(_(([i,r])=>this.subscriptionRestService.getSubscriptionIdsByStudentAndCourse(i,r))),this.testReports$=this.subscriptionIds$.pipe(d(i=>this.reportsService.getStudentSubscriptionGradesReports(i))),this.tests$=this.studentCourses$.pipe(d(i=>i.flatMap(r=>r.Tests).filter(x))),this.gradingScaleIdsFromTests$=this.tests$.pipe(d(i=>[...i.map(r=>r.GradingScaleId)].filter(x).filter(w))),this.gradingScaleIdsFromCourses$=this.studentCourses$.pipe(d(i=>i.flatMap(r=>r.GradingScaleId).filter(x).filter(w))),this.gradingScaleIds$=k([this.gradingScaleIdsFromCourses$,this.gradingScaleIdsFromTests$]).pipe(d(([i,r])=>i.concat(r).filter(w))),this.gradingScales$=this.gradingScaleIds$.pipe(_(i=>D(i.map(r=>this.gradingScalesRestService.getGradingScale(r)))));let F=this.storageService.getPayload()?.id_person;F&&this.studentId$.next(Number(F))}loadCourses(){return this.loadingService.load(this.coursesRestService.getExpandedCoursesForStudent())}static{this.\u0275fac=function(t){return new(t||e)(p(q),p(V),p(Y),p(z),p(K),p(Q),p(N))}}static{this.\u0275prov=P({token:e,factory:e.\u0275fac})}}return e})();var de=()=>[],ee=(()=>{class e{constructor(s){this.myGradesService=s}static{this.\u0275fac=function(t){return new(t||e)(h(f))}}static{this.\u0275cmp=l({type:e,selectors:[["bkd-my-grades-header"]],decls:7,vars:7,consts:[[1,"d-flex","justify-content-between","header"],[3,"reports"]],template:function(t,n){if(t&1&&(g(0,"div",0)(1,"div"),y(2),o(3,"translate"),u(),g(4,"div"),m(5,"bkd-reports-link",1),o(6,"async"),u()()),t&2){let S;c(2),C(a(3,2,"my-grades.header")),c(3),v("reports",(S=a(6,4,n.myGradesService.testReports$))!==null&&S!==void 0?S:O(6,de))}},dependencies:[J,M,R],styles:[".header[_ngcontent-%COMP%]{padding-bottom:1rem}.report[_ngcontent-%COMP%]{margin-left:1rem}"]})}}return e})();function pe(e,re){e&1&&m(0,"bkd-spinner")}function ce(e,re){if(e&1&&m(0,"bkd-dossier-grades-view",1),e&2){A();let s=$(0),t=$(2),n=$(4);v("courses",s)("studentId",t)("gradingScales",n)("isEditable",!1)}}var te=(()=>{class e{constructor(s){this.myGradesService=s}static{this.\u0275fac=function(t){return new(t||e)(h(f))}}static{this.\u0275cmp=l({type:e,selectors:[["bkd-my-grades-show"]],features:[b([W])],decls:14,vars:15,consts:[[1,"bkd-container","bkd-container-limited"],[3,"courses","studentId","gradingScales","isEditable"]],template:function(t,n){t&1&&(G(0),o(1,"async"),G(2),o(3,"async"),G(4),o(5,"async"),g(6,"div",0)(7,"h1"),y(8),o(9,"translate"),u(),m(10,"bkd-my-grades-header"),j(11,pe,1,0,"bkd-spinner"),o(12,"async"),j(13,ce,1,4,"bkd-dossier-grades-view",1),u()),t&2&&(I(a(1,2,n.myGradesService.studentCoursesSorted$)),c(2),I(a(3,5,n.myGradesService.studentId$)),c(2),I(a(5,8,n.myGradesService.gradingScales$)),c(4),C(a(9,11,"my-grades.title")),c(3),B(a(12,13,n.myGradesService.loading$)?11:13))},dependencies:[ee,X,U,M,R],encapsulation:2})}}return e})();var ie=(()=>{class e{constructor(){}static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275cmp=l({type:e,selectors:[["bkd-my-grades"]],features:[b([f])],decls:1,vars:0,template:function(t,n){t&1&&m(0,"router-outlet")},dependencies:[H],encapsulation:2})}}return e})();var Ee=[{path:"",component:ie,children:[{path:"",component:te}]}];export{Ee as MY_GRADES_ROUTES}; +import{p as Y,r as z,s as Q,t as W,w as X}from"./chunk-LASWC23V.js";import"./chunk-Y4QYVF5K.js";import"./chunk-AYQPMCNZ.js";import{d as K}from"./chunk-3L4RH6QP.js";import{a as J,b as V}from"./chunk-OSOXMODN.js";import{b as U}from"./chunk-PSYDBHTH.js";import{C as w,w as x}from"./chunk-W4U7QKJF.js";import{$a as u,Ab as G,Bb as I,Cb as $,Db as b,Eb as O,Ga as l,Jb as o,Kb as a,M as E,Na as j,P as _,Pd as R,Qa as v,Rd as q,Va as B,X as P,_ as p,_a as g,ab as m,cc as M,cd as N,h as L,hb as A,n as d,o as k,rb as y,s as D,sb as C,xa as c,xc as H,ya as h}from"./chunk-2W7IS4PN.js";var f=(()=>{class e{constructor(s,t,n,S,se,ne,oe){this.storageService=s,this.loadingService=t,this.coursesRestService=n,this.subscriptionRestService=S,this.reportsService=se,this.gradingScalesRestService=ne,this.settings=oe,this.studentId$=new L(1),this.loading$=this.loadingService.loading$,this.studentCourses$=this.loadCourses().pipe(E(1)),this.studentCoursesSorted$=this.studentCourses$.pipe(d(i=>i.slice().sort((r,ae)=>r.Designation.localeCompare(ae.Designation)))),this.studentCourseIds$=this.studentCourses$.pipe(d(i=>i.flatMap(r=>r.Id))),this.subscriptionIds$=k([this.studentId$,this.studentCourseIds$]).pipe(_(([i,r])=>this.subscriptionRestService.getSubscriptionIdsByStudentAndCourse(i,r))),this.testReports$=this.subscriptionIds$.pipe(d(i=>this.reportsService.getStudentSubscriptionGradesReports(i))),this.tests$=this.studentCourses$.pipe(d(i=>i.flatMap(r=>r.Tests).filter(x))),this.gradingScaleIdsFromTests$=this.tests$.pipe(d(i=>[...i.map(r=>r.GradingScaleId)].filter(x).filter(w))),this.gradingScaleIdsFromCourses$=this.studentCourses$.pipe(d(i=>i.flatMap(r=>r.GradingScaleId).filter(x).filter(w))),this.gradingScaleIds$=k([this.gradingScaleIdsFromCourses$,this.gradingScaleIdsFromTests$]).pipe(d(([i,r])=>i.concat(r).filter(w))),this.gradingScales$=this.gradingScaleIds$.pipe(_(i=>D(i.map(r=>this.gradingScalesRestService.getGradingScale(r)))));let F=this.storageService.getPayload()?.id_person;F&&this.studentId$.next(Number(F))}loadCourses(){return this.loadingService.load(this.coursesRestService.getExpandedCoursesForStudent())}static{this.\u0275fac=function(t){return new(t||e)(p(q),p(V),p(Y),p(z),p(K),p(Q),p(N))}}static{this.\u0275prov=P({token:e,factory:e.\u0275fac})}}return e})();var de=()=>[],ee=(()=>{class e{constructor(s){this.myGradesService=s}static{this.\u0275fac=function(t){return new(t||e)(h(f))}}static{this.\u0275cmp=l({type:e,selectors:[["bkd-my-grades-header"]],decls:7,vars:7,consts:[[1,"d-flex","justify-content-between","header"],[3,"reports"]],template:function(t,n){if(t&1&&(g(0,"div",0)(1,"div"),y(2),o(3,"translate"),u(),g(4,"div"),m(5,"bkd-reports-link",1),o(6,"async"),u()()),t&2){let S;c(2),C(a(3,2,"my-grades.header")),c(3),v("reports",(S=a(6,4,n.myGradesService.testReports$))!==null&&S!==void 0?S:O(6,de))}},dependencies:[J,M,R],styles:[".header[_ngcontent-%COMP%]{padding-bottom:1rem}.report[_ngcontent-%COMP%]{margin-left:1rem}"]})}}return e})();function pe(e,re){e&1&&m(0,"bkd-spinner")}function ce(e,re){if(e&1&&m(0,"bkd-dossier-grades-view",1),e&2){A();let s=$(0),t=$(2),n=$(4);v("courses",s)("studentId",t)("gradingScales",n)("isEditable",!1)}}var te=(()=>{class e{constructor(s){this.myGradesService=s}static{this.\u0275fac=function(t){return new(t||e)(h(f))}}static{this.\u0275cmp=l({type:e,selectors:[["bkd-my-grades-show"]],features:[b([W])],decls:14,vars:15,consts:[[1,"bkd-container","bkd-container-limited"],[3,"courses","studentId","gradingScales","isEditable"]],template:function(t,n){t&1&&(G(0),o(1,"async"),G(2),o(3,"async"),G(4),o(5,"async"),g(6,"div",0)(7,"h1"),y(8),o(9,"translate"),u(),m(10,"bkd-my-grades-header"),j(11,pe,1,0,"bkd-spinner"),o(12,"async"),j(13,ce,1,4,"bkd-dossier-grades-view",1),u()),t&2&&(I(a(1,2,n.myGradesService.studentCoursesSorted$)),c(2),I(a(3,5,n.myGradesService.studentId$)),c(2),I(a(5,8,n.myGradesService.gradingScales$)),c(4),C(a(9,11,"my-grades.title")),c(3),B(a(12,13,n.myGradesService.loading$)?11:13))},dependencies:[ee,X,U,M,R],encapsulation:2})}}return e})();var ie=(()=>{class e{constructor(){}static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275cmp=l({type:e,selectors:[["bkd-my-grades"]],features:[b([f])],decls:1,vars:0,template:function(t,n){t&1&&m(0,"router-outlet")},dependencies:[H],encapsulation:2})}}return e})();var Ee=[{path:"",component:ie,children:[{path:"",component:te}]}];export{Ee as MY_GRADES_ROUTES}; diff --git a/public/apps/webapp-schulverwaltung/chunk-A3CECLYB.js b/public/apps/webapp-schulverwaltung/chunk-A3CECLYB.js deleted file mode 100644 index 5498234e..00000000 --- a/public/apps/webapp-schulverwaltung/chunk-A3CECLYB.js +++ /dev/null @@ -1,3 +0,0 @@ -import{a as yt}from"./chunk-Y4QYVF5K.js";import{a as xt}from"./chunk-AYQPMCNZ.js";import{b as Tt,c as _t,d as wt}from"./chunk-3L4RH6QP.js";import{b as Gt}from"./chunk-OSOXMODN.js";import{a as se}from"./chunk-PSYDBHTH.js";import{C as Ce,c as ft,d as ht,e as It,f as St,g as bt,r as vt,s as Ct,w as ve}from"./chunk-W4U7QKJF.js";import{$a as d,Ab as pe,Ad as Se,Bb as ce,Bd as gt,Cb as U,D as we,Eb as Xe,Fb as fe,Ga as D,H as qe,Hc as h,Ic as o,Ja as Q,Jb as c,Jc as j,K as Ke,Kb as f,Lb as L,Ld as q,M as Ee,Mb as Je,Mc as w,Md as N,Na as T,Nc as b,Ob as Ye,Oc as he,Od as be,P as v,Pd as M,Qa as G,Qc as $e,R as Pe,Ra as De,Uc as u,Va as _,Wc as it,X as R,Ya as Z,Za as ee,Zb as Qe,_ as x,_a as l,_c as re,a as O,ab as te,ac as Ze,ad as nt,b as F,c as He,cc as k,cd as W,da as H,dc as et,ea as J,eb as ie,ec as tt,f as ue,fa as Y,fd as rt,g as A,gb as V,h as oe,hb as S,hd as Re,id as Ie,kb as ge,l as Ge,lc as ne,ld as st,m as Ue,ma as ze,md as at,n as m,o as de,od as ot,qb as le,qd as dt,rb as p,s as me,sb as $,tb as C,td as lt,ud as pt,vd as ct,w as Le,wd as ut,x as We,xa as a,xd as mt,ya as P}from"./chunk-2W7IS4PN.js";var ri=(t,r)=>r.Key,si=t=>({width:t});function ai(t,r){if(t&1&&(l(0,"option",1),p(1),c(2,"translate"),d()),t&2){let e=S();G("ngValue",null),a(),C(" ",f(2,2,e.emptyLabel)," ")}}function oi(t,r){if(t&1&&(l(0,"option",1),p(1),d()),t&2){let e=r.$implicit;G("ngValue",e),a(),C(" ",e.Value," ")}}var Et=(()=>{class t{constructor(){this.options=[],this.allowEmpty=!0,this.emptyLabel="",this.value=null,this.disabled=!1,this.tabindex=0,this.width="auto",this.valueChange=new ze,this.options$=new A([]),this.rawValue$=new A(null),this.value$=de([this.rawValue$,this.options$]).pipe(m(([e,i])=>i&&i.find(n=>n.Key===e)||null))}ngOnChanges(e){e.value&&this.rawValue$.next(e.value.currentValue),e.options&&this.options$.next(e.options.currentValue)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=D({type:t,selectors:[["bkd-select"]],inputs:{options:"options",allowEmpty:"allowEmpty",emptyLabel:"emptyLabel",value:"value",disabled:"disabled",tabindex:"tabindex",width:"width"},outputs:{valueChange:"valueChange"},features:[H],decls:6,vars:9,consts:[[1,"form-select",3,"ngModelChange","tabindex","ngStyle","disabled","ngModel"],[3,"ngValue"]],template:function(i,n){i&1&&(l(0,"select",0),c(1,"async"),V("ngModelChange",function(y){return n.valueChange.emit(y&&y.Key)}),T(2,ai,3,4,"option",1),Z(3,oi,2,2,"option",1,ri),p(5,` > -`),d()),i&2&&(ge("tabindex",n.tabindex),G("ngStyle",fe(7,si,n.width))("disabled",n.disabled)("ngModel",f(1,5,n.value$)),a(2),_(n.allowEmpty?2:-1),a(),ee(n.options))},dependencies:[Se,pt,ct,lt,Ie,at,k,Ze,M],encapsulation:2,changeDetection:0})}}return t})();var Pt=b({Id:o,Designation:h,StudentCount:o,Number:h});var Me=b({Id:h,TestId:o,CourseRegistrationId:o,GradeId:u(o),GradeValue:u(o),GradeDesignation:u(h),Points:u(o),StudentId:o});var Dt=b({Id:o,CourseId:o,Date:re,Designation:h,Weight:o,WeightPercent:o,IsPointGrading:j,MaxPoints:u(o),MaxPointsAdjusted:u(o),IsPublished:j,IsOwner:j,Owner:u(h),GradingScaleId:u(o),Results:u(w(Me))});var $t=b({Id:o}),Rt=he({HRef:u(h)}),di=he({HasEvaluationStarted:j,EvaluationUntil:u(re),HasReviewOfEvaluationStarted:j,HasTestGrading:j,Id:o}),li=$e([$t,Rt,di]),pi=he({Id:o,StudentCount:o}),ci=$e([$t,Rt,pi]),ui=b({Grade:h,AverageTestResult:o,Id:o,StudentId:o}),Oe=b({AverageTestResult:o,CanGrade:j,EventId:o,GradeId:u(o),GradeValue:u(o),Id:o,StudentId:o}),K=b({HRef:h,Id:o,Number:h,Designation:h,DateFrom:u(re),DateTo:u(re),StatusId:o,GradingScaleId:u(o),FinalGrades:u(w(ui)),Gradings:u(w(Oe)),Tests:u(w(Dt)),EvaluationStatusRef:li,AttendanceRef:ci,ParticipatingStudents:u(w(_t)),Classes:u(w(Pt))}),Mt=b({TestResults:w(Me),Gradings:w(Oe)}),Ot=b({Gradings:w(Oe)});var xe=(()=>{class t extends se{constructor(e,i){super(e,i,K,"Courses"),this.statusCodec=b(nt(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(v(N(this.statusCodec)),m(e=>e.filter(i=>i.EvaluationStatusRef.HasEvaluationStarted===!0)),m(e=>e.length))}getExpandedCourses(e){return yt(e,"TeacherRole")?this.http.get(`${this.baseUrl}/?expand=EvaluationStatusRef,AttendanceRef,Classes,FinalGrades&filter.StatusId=;${this.settings.eventlist.statusfilter}`,{headers:{"X-Role-Restriction":"TeacherRole"}}).pipe(v(N(K))):Ge([])}getExpandedCourse(e){return this.http.get(`${this.baseUrl}/${e}?expand=ParticipatingStudents,EvaluationStatusRef,Tests,Gradings,FinalGrades,Classes`).pipe(v(q(K)))}getExpandedCourseWithParticipants(e){return this.http.get(`${this.baseUrl}/${e}?expand=ParticipatingStudents,Classes,AttendanceRef`).pipe(v(q(K)))}getExpandedCoursesForDossier(){return this.http.get(`${this.baseUrl}/?expand=Tests,Gradings,FinalGrades,EvaluationStatusRef,ParticipatingStudents,Classes&filter.StatusId=;${this.settings.eventlist.statusfilter}`).pipe(v(N(K)))}getExpandedCoursesForStudent(){return this.http.get(`${this.baseUrl}/?expand=Tests,Gradings,FinalGrades&filter.StatusId=;${this.settings.eventlist.statusfilter}`,{headers:{"X-Role-Restriction":"StudentRole"}}).pipe(v(N(K)))}add(e,i,n,s,y,B,g){let I={Tests:[{Date:i,Designation:n,Weight:s,IsPointGrading:y,MaxPoints:B,MaxPointsAdjusted:g}]};return this.http.put(`${this.baseUrl}/${e}/Tests/New`,I).pipe(m(()=>{}))}update(e,i,n,s,y,B,g,I){let X={Tests:[{Id:i,Designation:n,Date:s,Weight:y,IsPointGrading:B,MaxPoints:g,MaxPointsAdjusted:I}]};return this.http.put(`${this.baseUrl}/${e}/Tests/Update`,X).pipe(m(()=>{}))}delete(e,i){let n={TestIds:[i]};return this.http.put(`${this.baseUrl}/${e}/Tests/Delete`,n).pipe(m(()=>i))}updateTestResult(e,i){let I=i,{studentId:n,testId:s}=I,y=He(I,["studentId","testId"]),B={StudentIds:[n],TestId:s},g="gradeId"in y?F(O({},B),{GradeId:y.gradeId}):F(O({},B),{Points:y.points});return this.http.put(`${this.baseUrl}/${e}/SetTestResult`,g).pipe(v(q(Mt)),v(({TestResults:X,Gradings:Ne})=>X.length<=1&&Ne.length===1?Ge({courseId:e,testResult:X[0]??null,grading:Ne[0]}):Ue(()=>new Error("`TestResults` or `Gradings` does not contain a single value"))))}setAverageAsFinalGrade(e){return this.http.put(`${this.baseUrl}/SetAverageTestResult`,e).pipe(v(q(Ot)))}publishTest(e){let i={TestIds:[e]};return this.http.put(`${this.baseUrl}/PublishTest`,i).pipe(m(()=>e))}unpublishTest(e){let i={TestIds:[e]};return this.http.put(`${this.baseUrl}/UnpublishTest`,i).pipe(m(()=>e))}static{this.\u0275fac=function(i){return new(i||t)(x(ne),x(W))}}static{this.\u0275prov=R({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Bt=b({Id:h,SubscriptionId:o,VssId:o,EventId:o,DropdownItems:u(w(xt)),IdPerson:o,ShowAsRadioButtons:j,Value:u(h),VssDesignation:h,VssStyle:h}),Fe=b({Id:o,EventId:u(o),PersonId:u(o),Status:h,EventDesignation:u(h)});var At=(()=>{class t extends se{constructor(e,i){super(e,i,Fe,"Subscriptions")}getSubscriptionIdsByStudentAndCourse(e,i){return this.http.get(`${this.baseUrl}/`,{params:{"filter.PersonId":`=${e}`,"filter.EventId":`;${i}`}}).pipe(v(N(it)),m(n=>n.map(s=>s.Id)))}getSubscriptionCountsByEvents(e){return this.http.get(`${this.baseUrl}/`,{params:{"filter.EventId":`;${e.join(";")}`,fields:["Id","EventId"].join(",")}}).pipe(v(N(b({Id:o,EventId:o}))),m(i=>i.reduce((n,s)=>(n[s.EventId]=n[s.EventId]?n[s.EventId]+1:1,n),{})))}getSubscriptionsByCourse(e,i){return this.http.get(`${this.baseUrl}/`,{params:F(O({"filter.EventId":`=${e}`},i),{fields:["Id","EventId","EventDesignation","PersonId","Status"].join(",")})}).pipe(v(N(Fe)))}getSubscriptionDetailsById(e){return this.http.get(`${this.baseUrl}/${e}/SubscriptionDetails`).pipe(v(N(Bt)))}static{this.\u0275fac=function(i){return new(i||t)(x(ne),x(W))}}static{this.\u0275prov=R({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();function Vt(t){return t.length===0?0:je(t.map(({value:r,weight:e})=>r*e))/je(t.map(({weight:r})=>r))}function Be(t){return t.length===0?0:Number(je(t)/t.length)}function je(t){return t.reduce(gi,0)}function gi(t,r){return t+r}function Mn(t,r,e){return t?t.Tests?.reduce((i,n)=>i||n.Id===r&&n.Results?.find(s=>s.TestId===r&&s.StudentId===e)||null,null)??null:null}function On(t,r,e){return r.map(i=>i.Id===t.TestId?Ve(t,i,e):i)}function Fn(t,r,e){return e.map(i=>i.Id===t?fi(r,i):i)}function jn(t,r){return r.map(e=>e.Id===t?F(O({},e),{IsPublished:!e.IsPublished}):e)}function Bn(t){let r=Ii(t);if(r.length===0)throw new Error("unable to calculate averages without results");return Be(r)}function Ae(t){return t.MaxPointsAdjusted||t.MaxPoints}function An(t){let r=hi(t);if(r.length===0)throw new Error("unable to calculate averages without results");return Be(r)}function z(t,r){return r.Results?.find(e=>e.StudentId===t)}function Vn(t,r){return r===null?null:r.filter(e=>e.Id!==t)}function Ve(t,r,e){let i=e&&r.Results?.find(s=>s.TestId===t.TestId&&s.StudentId===t.StudentId),n=r.Results?.filter(s=>!(s.TestId===t.TestId&&s.StudentId===t.StudentId))||[];return i&&e==="grade"?t.GradeId=i.GradeId:i&&e==="points"&&(t.Points=i.Points),F(O({},r),{Results:[...n,t]})}function Nt(t){return t.slice().sort((r,e)=>e.Date.getTime()-r.Date.getTime())}function ye(t,r){return r?.find(e=>e.Id===t.GradingScaleId)||null}function fi(t,r){return F(O({},r),{Results:r.Results?.filter(e=>e.StudentId!==t)||[]})}function hi(t){return t.Results?.filter(r=>r.GradeDesignation!==null).map(r=>Number(r.GradeDesignation)).filter(r=>!isNaN(r))||[]}function Ii(t){return t.Results?.map(r=>r.Points!==null?r.Points:kt).filter(r=>r>kt)||[]}var kt=-1;var Si=b({Id:o,Designation:h}),ke=b({Id:o,Grades:w(Si)});var Ht=(()=>{class t extends se{constructor(e,i){super(e,i,ke,"GradingScales")}getGradingScale(e){return this.http.get(`${this.baseUrl}/${e}`).pipe(v(q(ke)))}getGradingScales(e){return me(e.map(this.getGradingScale.bind(this)))}static{this.\u0275fac=function(i){return new(i||t)(x(ne),x(W))}}static{this.\u0275prov=R({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Te=(()=>{class t{constructor(e,i,n,s,y,B){this.coursesRestService=e,this.subscriptionRestService=i,this.reportsService=n,this.loadingService=s,this.gradingScalesRestService=y,this.settings=B,this.studentId$=new oe(1),this.initialStudentCourses$=this.studentId$.pipe(qe(),v(this.loadCourses.bind(this)),m(g=>g.sort((I,X)=>I.Designation.localeCompare(X.Designation))),Ee(1)),this.action$=new oe(1),this.studentCourses$=Le(this.action$,this.initialStudentCourses$.pipe(m(g=>({type:"initializeCourses",payload:g})))).pipe(Ke(this.coursesReducer.bind(this),[]),Ee(1)),this.loading$=this.loadingService.loading$,this.studentCourseIds$=this.studentCourses$.pipe(m(g=>g.flatMap(I=>I.Id))),this.subscriptionIds$=de([this.studentId$,this.studentCourseIds$]).pipe(v(([g,I])=>this.subscriptionRestService.getSubscriptionIdsByStudentAndCourse(g,I))),this.testReports$=this.subscriptionIds$.pipe(m(g=>this.reportsService.getTeacherSubscriptionGradesReports(g))),this.tests$=this.studentCourses$.pipe(m(g=>g.flatMap(I=>I.Tests).filter(ve))),this.gradingScaleIdsFromTests$=this.tests$.pipe(m(g=>[...g.map(I=>I.GradingScaleId)].filter(ve).filter(Ce))),this.gradingScaleIdsFromCourses$=this.studentCourses$.pipe(m(g=>g.flatMap(I=>I.GradingScaleId).filter(ve).filter(Ce))),this.gradingScaleIds$=de([this.gradingScaleIdsFromCourses$,this.gradingScaleIdsFromTests$]).pipe(m(([g,I])=>g.concat(I).filter(Ce))),this.gradingScales$=this.gradingScaleIds$.pipe(v(g=>me(g.map(I=>this.gradingScalesRestService.getGradingScale(I)))))}setStudentId(e){this.studentId$.next(e)}getFinalGradeForStudent(e,i){return e?.FinalGrades?.find(n=>n.StudentId===i)}getGradingForStudent(e,i){return e?.Gradings?.find(n=>n.StudentId===i)}getGradingScaleOfCourse(e,i){return i?.find(n=>n.Id===e.GradingScaleId)}getGradesForStudent(e,i,n){return e.Tests?.flatMap(s=>({value:Number(ye(s,n)?.Grades.find(B=>B.Id===z(i,s)?.GradeId)?.Designation),weight:s.Weight})).filter(({value:s})=>!!s)||[]}updateStudentCourses(e){this.action$.next({type:"updateCourses",payload:e})}loadCourses(e){return this.loadingService.load(this.coursesRestService.getExpandedCoursesForDossier().pipe(m(i=>i.filter(n=>n.ParticipatingStudents?.find(s=>s.Id===e)))))}coursesReducer(e,i){switch(i.type){case"initializeCourses":return i.payload;case"updateCourses":return this.updateCourses([...e],i.payload);default:return e}}updateCourses(e,i){return e.map(n=>F(O({},n),{Tests:n.Tests!==null?n.Tests.map(s=>s.Id===i.Id?i:s):null}))}static{this.\u0275fac=function(i){return new(i||t)(x(xe),x(At),x(wt),x(Gt),x(Ht),x(W))}}static{this.\u0275prov=R({token:t,factory:t.\u0275fac})}}return t})();var Lt=(()=>{class t{constructor(){}get inIframe(){return window.parent!==window}get window(){return this.inIframe?window.parent:null}get document(){return this.window?.document.documentElement??null}querySelector(e){return this.window?.document?.querySelector("bkd-portal")?.shadowRoot?.querySelector(e)??null}getIframeElement(){return this.querySelector("bkd-content")?.shadowRoot?.querySelector("iframe")??null}getIframeTop(){return this.getIframeElement()?.offsetTop??0}getIFrameBottom(){let e=this.getIframeElement();return e?e.offsetTop+e.offsetHeight:0}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=R({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Wt=(()=>{class t{constructor(e,i){this.modal=e,this.portal=i}open(...e){let i=this.modal.open(...e);return this.applyPortalOffsetAndMaxHeight(i),this.disablePortalScrolling(i),i}get activeInstances(){return this.modal.activeInstances}dismissAll(...e){return this.modal.dismissAll(...e)}hasOpenModals(...e){return this.modal.hasOpenModals(...e)}applyPortalOffsetAndMaxHeight(e){let i=this.getModalWindowElement(e);if(!i){console.warn("Trying to apply portal offset to , but element is not present!");return}this.portal.window&&(i.style.top=`${this.getModalIframeOffset()}px`,i.style.maxHeight=`${this.getModalHeight()}px`)}disablePortalScrolling(e){if(this.portal.window&&this.portal.document){let i=this.portal.window.innerWidth-this.portal.document.clientWidth;this.portal.document.style.paddingRight=`${i}px`,this.portal.document.style.overflow="hidden"}e.hidden.subscribe(()=>{this.portal.document&&(this.portal.document.style.paddingRight="0px",this.portal.document.style.overflow="auto")})}getModalWindowElement(e){return e._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}static{this.\u0275fac=function(i){return new(i||t)(x(Ct),x(Lt))}}static{this.\u0275prov=R({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();function _e(t,r,e){return r?r.Grade:yi(t,e)||t?.GradeValue}function yi(t,r){return r?.Grades.find(e=>e.Id===t?.GradeId)?.Designation}var Ti="1-3",Kt="\u2013",zt=(()=>{class t{constructor(e){this.locale=e}transform(e,i,n){let s=Number(e??null);return isNaN(s)?Kt:_i(Number(e??null),n??this.locale,i)}static{this.\u0275fac=function(i){return new(i||t)(P(Ye,16))}}static{this.\u0275pipe=Q({name:"decimalOrDash",type:t,pure:!0})}}return t})();function _i(t,r,e){return t===0?Kt:Qe(t,r,`1.${Gi(e)}`)}function Gi(t){return t?String(t).includes("-")?String(t):`${t}-${t}`:Ti}var Xt=(()=>{class t{constructor(){}getGradeForStudent(){return _e(this.grading,this.finalGrade,this.gradingScale)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=D({type:t,selectors:[["bkd-dossier-grades-final-grade"]],inputs:{finalGrade:"finalGrade",grading:"grading",gradingScale:"gradingScale",average:"average"},decls:14,vars:11,consts:[[1,"final-entry"],["data-testid","final-grade"],["data-testid","average-test-results"]],template:function(i,n){i&1&&(l(0,"div",0)(1,"div"),p(2),c(3,"translate"),d(),l(4,"div",1)(5,"span"),p(6),d()(),l(7,"div"),p(8),c(9,"translate"),d(),l(10,"div",2)(11,"span"),p(12),c(13,"decimalOrDash"),d()()()),i&2&&(a(2),$(f(3,4,"dossier.grade")),a(4),$(n.getGradeForStudent()||"\u2013"),a(2),$(f(9,6,"dossier.average")),a(4),$(L(13,8,n.average,"1-3")))},dependencies:[M,zt],styles:[".final-entry[_ngcontent-%COMP%]{padding:1rem;display:grid;grid-template-columns:repeat(2,1fr)}span[_ngcontent-%COMP%]{margin-left:2em}"]})}}return t})();var Jt=(()=>{class t{constructor(e){this.translate=e}transform(e,i,n,s="tests.points"){return e.IsPointGrading&&(e.IsPublished||n)?`${z(i,e)?.Points||"\u2013"} / ${e.MaxPointsAdjusted||e.MaxPoints} ${this.translate.instant(s)}`:""}static{this.\u0275fac=function(i){return new(i||t)(P(be,16))}}static{this.\u0275pipe=Q({name:"bkdTestPoints",type:t,pure:!0})}}return t})();var Yt=(()=>{class t{constructor(e){this.translate=e}transform(e){return`${this.translate.instant("tests.factor")} ${e.Weight} (${e.WeightPercent}%)`}static{this.\u0275fac=function(i){return new(i||t)(P(be,16))}}static{this.\u0275pipe=Q({name:"bkdTestWeight",type:t,pure:!0})}}return t})();var Ei=t=>({maxPoints:t});function Pi(t,r){if(t&1&&(l(0,"div",13),p(1),c(2,"translate"),d()),t&2){let e=S(2);a(),C(" ",L(2,1,"global.validation-errors.invalidPoints",fe(4,Ei,e.maxPoints))," ")}}function Di(t,r){if(t&1){let e=ie();l(0,"div",3)(1,"label",11),p(2),c(3,"translate"),d(),l(4,"div",6)(5,"input",12,0),V("input",function(){J(e);let n=le(6),s=S();return Y(s.onPointsChange(n.value))}),d()(),T(7,Pi,3,6,"div",13),d()}if(t&2){let e=S();a(2),$(f(3,8,"dossier.dialog.points")),a(2),De("is-invalid",e.pointsInput.errors),a(),De("is-invalid",e.pointsInput.errors),ge("max",e.maxPoints),G("formControl",e.pointsInput),a(2),_(e.pointsInput.errors?7:-1)}}var Qt=500,Zt=(()=>{class t{constructor(e,i){this.activeModal=e,this.courseService=i,this.maxPoints=0,this.gradeSubject$=new ue,this.pointsSubject$=new ue,this.closeButtonDisabled$=new A(!1),this.gradingScaleDisabled$=new A(!0),this.grade$=this.gradeSubject$.pipe(we(Qt)),this.points$=this.pointsSubject$.pipe(we(Qt),We(this.isValid.bind(this)),m(Number)),this.destroy$=new ue}ngOnInit(){this.maxPoints=Ae(this.test),this.pointsInput=new st({value:this.points,disabled:!1},[Re.min(0),Re.pattern("[0-9]+([\\.][0-9]+)?"),this.maxPointValidator()]),this.gradingScaleDisabled$.next(this.test.IsPointGrading&&this.points>0),this.points$.pipe(Pe(this.destroy$)).subscribe(e=>this.updateTestResult({studentId:this.studentId,testId:this.test.Id,points:e})),this.grade$.pipe(Pe(this.destroy$)).subscribe(e=>this.updateTestResult({studentId:this.studentId,testId:this.test.Id,gradeId:e}))}onGradeChange(e){this.gradeSubject$.next(e)}onPointsChange(e){this.pointsSubject$.next(e),this.gradingScaleDisabled$.next(e.length>0)}updateTestResult(e){this.closeButtonDisabled$.next(!0),this.courseService.updateTestResult(this.test.CourseId,e).subscribe(({testResult:i})=>{this.gradeId=i?.GradeId??null,this.updatedTestResult=i,this.closeButtonDisabled$.next(!1)})}isValid(e){return e===""||isNaN(Number(e))?!1:!(Number(e)<0||Number(e)>this.maxPoints)}maxPointValidator(){return e=>Number(e.value)>Ae(this.test)?{customMax:!0}:null}static{this.\u0275fac=function(i){return new(i||t)(P(vt),P(xe))}}static{this.\u0275cmp=D({type:t,selectors:[["bkd-dossier-grades-edit"]],inputs:{test:"test",gradeId:"gradeId",gradeOptions:"gradeOptions",points:"points",studentId:"studentId"},decls:19,vars:20,consts:[["pointInput",""],[1,"modal-body"],[1,"mb-4"],[1,"form-group","row"],[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"],["for","points",1,"col-6","col-form-label"],["id","points","type","number","step","0.01","min","0",1,"form-control",3,"input","max","formControl"],["data-testid","validation-error-message",1,"invalid-feedback","col-6","offset-6"]],template:function(i,n){i&1&&(l(0,"div",1)(1,"p",2),p(2),d(),T(3,Di,8,10,"div",3),l(4,"div",4)(5,"label",5),p(6),c(7,"translate"),d(),l(8,"div",6)(9,"bkd-select",7),c(10,"async"),V("valueChange",function(y){return y&&n.onGradeChange(y)}),d()()(),l(11,"p",8),p(12),c(13,"translate"),d()(),l(14,"div",9)(15,"button",10),c(16,"async"),V("click",function(){return n.activeModal.close(n.updatedTestResult)}),p(17),c(18,"translate"),d()()),i&2&&(a(2),$(n.test.Designation),a(),_(n.test.IsPointGrading?3:-1),a(3),$(f(7,10,"dossier.dialog.grade")),a(3),G("options",n.gradeOptions)("value",n.gradeId)("allowEmpty",!1)("disabled",f(10,12,n.gradingScaleDisabled$)),a(3),C(" ",f(13,14,n.test.IsPointGrading?"dossier.dialog.hint.points":"dossier.dialog.hint.grade")," "),a(3),G("disabled",f(16,16,n.closeButtonDisabled$)),a(2),C(" ",f(18,18,"dossier.dialog.close")," "))},dependencies:[Se,rt,ot,Ie,mt,ut,gt,dt,Et,k,M],encapsulation:2})}}return t})();function $i(t,r){if(t&1){let e=ie();l(0,"a",10),V("click",function(){J(e);let n=S(2),s=U(0);return Y(n.editGrading(s))}),l(1,"i",11),p(2,"edit"),d(),l(3,"span",5),p(4),d()()}if(t&2){S(2);let e=U(2);a(4),$(e)}}function Ri(t,r){if(t&1&&(l(0,"span",5),p(1),d()),t&2){S(2);let e=U(2);a(),$(e)}}function Mi(t,r){if(t&1&&(l(0,"div",9),p(1),c(2,"translate"),d()),t&2){S(2);let e=U(0);a(),C(" ",f(2,1,e.IsPublished?"tests.published":"tests.not-published")," ")}}function Oi(t,r){if(t&1&&(l(0,"div",0)(1,"div",1),p(2),d(),l(3,"div",2),p(4),c(5,"date"),d(),l(6,"div",3),T(7,$i,5,1,"a",4)(8,Ri,2,1,"span",5),d(),l(9,"div",6),p(10),c(11,"bkdTestWeight"),d(),l(12,"div",7)(13,"span"),p(14),c(15,"bkdTestPoints"),d()(),l(16,"div",8),p(17),d(),T(18,Mi,3,3,"div",9),d()),t&2){let e=S(),i=U(0);a(2),C(" ",i.Designation," "),a(2),C(" ",L(5,7,i.Date,"dd.MM.yyyy")," "),a(3),_(e.isEditable&&i.IsOwner?7:8),a(3),C(" ",f(11,10,i)," "),a(4),$(Je(15,12,i,e.studentId,e.isEditable,"dossier.points")),a(3),C(" ",i.Owner," "),a(),_(e.isEditable?18:-1)}}var ei=(()=>{class t{constructor(e,i){this.gradeService=e,this.modalService=i,this.test$=new oe(1),this.grading$=this.test$.pipe(m(this.getGrading.bind(this)))}ngOnChanges(e){e.test&&this.test$.next(this.test)}editGrading(e){let i=this.modalService.open(Zt,{backdrop:"static"});i.componentInstance.test=e,i.componentInstance.gradeId=this.getGradeId(e),i.componentInstance.gradeOptions=t.mapToOptions(this.gradingScale),i.componentInstance.studentId=this.studentId,i.componentInstance.points=this.getPoints(e),i.result.then(n=>{n&&this.updateStudentGrade(n,e)},()=>{})}updateStudentGrade(e,i){let n=Ve(e,i);this.gradeService.updateStudentCourses(n)}getGrading(e){return this.gradingScale?.Grades.find(i=>i.Id===this.getGradeId(e))?.Designation||"\u2013"}getGradeId(e){return z(this.studentId,e)?.GradeId||null}getPoints(e){return z(this.studentId,e)?.Points||null}static mapToOptions(e){return e?.Grades.map(i=>({Key:i.Id,Value:i.Designation}))||null}static{this.\u0275fac=function(i){return new(i||t)(P(Te),P(Wt))}}static{this.\u0275cmp=D({type:t,selectors:[["bkd-dossier-single-test"]],inputs:{test:"test",studentId:"studentId",gradingScale:"gradingScale",isEditable:"isEditable"},features:[H],decls:5,vars:7,consts:[[1,"test-entry"],["data-testid","test-designation",1,"designation"],["data-testid","test-date",1,"date"],[1,"grade"],["aria-label","edit grade",1,"btn","btn-link"],["data-testid","test-grade"],["data-testid","test-factor",1,"factor"],["data-testid","test-points",1,"points"],["data-testid","test-teacher",1,"teacher"],["data-testid","test-status",1,"state"],["aria-label","edit grade",1,"btn","btn-link",3,"click"],["data-testid","test-grade-edit-icon",1,"material-icons"]],template:function(i,n){if(i&1&&(pe(0),c(1,"async"),pe(2),c(3,"async"),T(4,Oi,19,17,"div",0)),i&2){let s=ce(f(1,1,n.test$));a(2),ce(f(3,4,n.grading$)),a(2),_(s?4:-1)}},dependencies:[k,et,M,Jt,Yt],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)}}']})}}return t})();var Fi=(t,r)=>r.Id,ji=()=>[];function Bi(t,r){if(t&1&&te(0,"bkd-dossier-single-test",2),t&2){let e=r.$implicit,i=S(2);G("test",e)("studentId",i.studentId)("gradingScale",i.getGradingScaleOfTest(e))("isEditable",i.isEditable)}}function Ai(t,r){if(t&1&&(l(0,"div"),te(1,"bkd-dossier-grades-final-grade",1),Z(2,Bi,1,4,"bkd-dossier-single-test",2,Fi),d()),t&2){let e=S(),i=U(0);a(),G("finalGrade",e.decoratedCourse.finalGrade)("grading",e.decoratedCourse.grading)("gradingScale",e.decoratedCourse.gradingScale)("average",e.decoratedCourse.average),a(),ee(i)}}function Vi(t,r){t&1&&(l(0,"p",0),p(1),c(2,"translate"),d()),t&2&&(a(),C(" ",f(2,1,"dossier.no-tests")," "))}var ti=(()=>{class t{ngOnChanges(e){e.decoratedCourse&&this.sortedTests$.next(this.sortedTests())}constructor(){this.sortedTests$=new A([])}sortedTests(){return this.decoratedCourse.course.Tests?Nt(this.decoratedCourse.course.Tests):[]}getGradingScaleOfTest(e){return ye(e,this.gradingScales)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=D({type:t,selectors:[["bkd-dossier-course-tests"]],inputs:{studentId:"studentId",decoratedCourse:"decoratedCourse",gradingScales:"gradingScales",isEditable:"isEditable"},features:[H],decls:4,vars:5,consts:[["data-testid","message-no-tests",1,"p-3"],[3,"finalGrade","grading","gradingScale","average"],[3,"test","studentId","gradingScale","isEditable"]],template:function(i,n){if(i&1&&(pe(0),c(1,"async"),T(2,Ai,4,4,"div")(3,Vi,3,3,"p",0)),i&2){let s,y=ce((s=f(1,1,n.sortedTests$))!==null&&s!==void 0?s:Xe(4,ji));a(2),_(y.length>0?2:3)}},dependencies:[Xt,ei,k,M],encapsulation:2})}}return t})();function ki(t,r){if(t&1&&(l(0,"span",0),p(1),d()),t&2){let e=S();a(),C(" (",e.grade,")")}}function Ni(t,r){if(t&1&&(l(0,"span",1),p(1),c(2,"number"),d()),t&2){let e=S();a(),C(" (",L(2,1,e.average,"1.1-3"),")")}}var ii=(()=>{class t{constructor(){}get grade(){return this.getGradeForStudent()}getGradeForStudent(){return _e(this.grading,this.finalGrade,this.gradingScale)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=D({type:t,selectors:[["bkd-dossier-grades-course-header"]],inputs:{designation:"designation",finalGrade:"finalGrade",grading:"grading",gradingScale:"gradingScale",average:"average"},decls:3,vars:3,consts:[["data-testId","grade",1,"grade"],["data-testId","average",1,"average"]],template:function(i,n){i&1&&(p(0),T(1,ki,2,1,"span",0)(2,Ni,3,4,"span",1)),i&2&&(C("",n.designation,` -`),a(),_(n.grade?1:-1),a(),_(!n.grade&&n.average?2:-1))},dependencies:[tt],styles:[".average[_ngcontent-%COMP%]{color:#00000080}"]})}}return t})();var Hi=(t,r)=>r.course.Id;function Ui(t,r){if(t&1&&te(0,"bkd-dossier-course-tests",9),t&2){let e=S().$implicit,i=S(2);G("decoratedCourse",e)("studentId",i.studentId)("gradingScales",i.gradingScales)("isEditable",i.isEditable)}}function Li(t,r){if(t&1){let e=ie();l(0,"div")(1,"div",2)(2,"div",3,0)(4,"div",4)(5,"bkd-student-dossier-entry-header",5),V("click",function(){J(e);let n=le(3);return Y(n.toggle())}),te(6,"bkd-dossier-grades-course-header",6),d()(),l(7,"div",7)(8,"div",8),T(9,Ui,1,4,"ng-template"),d()()()()()}if(t&2){let e=r.$implicit,i=le(3);a(5),G("opened",!i.collapsed),a(),G("designation",e.course.Designation)("finalGrade",e.finalGrade)("grading",e.grading)("gradingScale",e.gradingScale)("average",e.average)}}function Wi(t,r){if(t&1&&(Z(0,Li,10,6,"div",null,Hi),c(2,"async")),t&2){let e=S();ee(f(2,0,e.decoratedCoursesSubject$))}}function qi(t,r){t&1&&(l(0,"p",1),p(1),c(2,"translate"),d()),t&2&&(a(),C(" ",f(2,1,"dossier.no-courses")," "))}var qr=(()=>{class t{constructor(e){this.dossierGradesService=e,this.isEditable=!0,this.decoratedCoursesSubject$=new A([])}ngOnChanges(){this.decoratedCoursesSubject$.next(this.decorateCourses())}decorateCourses(){return this.courses.map(e=>{let i=this.dossierGradesService.getFinalGradeForStudent(e,this.studentId),n=this.dossierGradesService.getGradesForStudent(e,this.studentId,this.gradingScales);return{course:e,finalGrade:i,grading:this.dossierGradesService.getGradingForStudent(e,this.studentId),gradingScale:this.dossierGradesService.getGradingScaleOfCourse(e,this.gradingScales),average:i?.AverageTestResult||Vt(n)}})}static{this.\u0275fac=function(i){return new(i||t)(P(Te))}}static{this.\u0275cmp=D({type:t,selectors:[["bkd-dossier-grades-view"]],inputs:{courses:"courses",studentId:"studentId",gradingScales:"gradingScales",isEditable:"isEditable"},features:[H],decls:2,vars:1,consts:[["courses","ngbAccordionItem"],["data-testid","message-no-courses",1,"py-3"],["ngbAccordion",""],["ngbAccordionItem",""],["ngbAccordionHeader",""],[3,"click","opened"],[3,"designation","finalGrade","grading","gradingScale","average"],["ngbAccordionCollapse",""],["ngbAccordionBody",""],[3,"decoratedCourse","studentId","gradingScales","isEditable"]],template:function(i,n){i&1&&T(0,Wi,3,2)(1,qi,3,3,"p",1),i&2&&_(n.courses.length>0?0:1)},dependencies:[bt,St,It,Tt,ii,ht,ft,ti,k,M],encapsulation:2})}}return t})();export{Be as a,Mn as b,On as c,Fn as d,jn as e,Bn as f,An as g,Vn as h,Nt as i,Kt as j,zt as k,_i as l,Et as m,Pt as n,Oe as o,xe as p,Bt as q,At as r,Ht as s,Te as t,Lt as u,Wt as v,qr as w}; diff --git a/public/apps/webapp-schulverwaltung/chunk-VFFZAFLB.js b/public/apps/webapp-schulverwaltung/chunk-FHLJK5I2.js similarity index 99% rename from public/apps/webapp-schulverwaltung/chunk-VFFZAFLB.js rename to public/apps/webapp-schulverwaltung/chunk-FHLJK5I2.js index cf8887fa..1a23c958 100644 --- a/public/apps/webapp-schulverwaltung/chunk-VFFZAFLB.js +++ b/public/apps/webapp-schulverwaltung/chunk-FHLJK5I2.js @@ -1 +1 @@ -import{a as pe,b as Pe}from"./chunk-DJH5AAGM.js";import{a as bn}from"./chunk-LHXVMKYN.js";import{a as _n,b as vn}from"./chunk-QB4DIFWS.js";import{b as Pn}from"./chunk-6XR42WAQ.js";import{a as Cn}from"./chunk-3HCVMNJA.js";import{e as fn}from"./chunk-5WNFCBTP.js";import{q as gn,v as ye}from"./chunk-A3CECLYB.js";import{a as ct}from"./chunk-HCNFZOWE.js";import{b as zt,c as Xt,e as Qe}from"./chunk-746ASKQ4.js";import{a as rn}from"./chunk-DTTSX64G.js";import"./chunk-Y4QYVF5K.js";import"./chunk-AYQPMCNZ.js";import{a as yn}from"./chunk-BIDSHCYH.js";import{c as at,g as un}from"./chunk-Z4YBXGVO.js";import{a as cn}from"./chunk-3L4RH6QP.js";import{a as an,b as pn}from"./chunk-DTYYCJHM.js";import"./chunk-XAZECV42.js";import{a as Sn}from"./chunk-3P6YOVUR.js";import{A as en,B as tn,C as rt,H as nn,L as on,P as ve,Q as sn,S as st,U as hn,g as Jt,p as Yt,u as Zt,v as He,z as qe}from"./chunk-SRCW6BUG.js";import{j as z,l as se}from"./chunk-GOGVGWFJ.js";import{b as ce}from"./chunk-OSOXMODN.js";import{a as We,b as be,f as ln,g as dn,h as mn}from"./chunk-PSYDBHTH.js";import{h as At,i as Rt,j as Ge,k as Gt,l as Nt,m as Ut,o as Ht,p as qt,q as Le,r as re,w as Kt,y as Ue}from"./chunk-W4U7QKJF.js";import{a as _e}from"./chunk-AVBHFGIF.js";import{$a as a,$b as Ot,Ab as G,Ad as oe,B as ht,Bb as Y,C as Ct,Cb as Q,Cd as ot,D as tt,Db as ue,Eb as ke,F as O,Fb as ne,Ga as D,Gb as $t,H as Be,Hd as Ne,Id as $e,Jb as p,K as _t,Kb as m,L as vt,Lb as U,M as E,Md as Wt,N as nt,Na as L,O as je,Od as K,P as T,Pd as V,Qa as x,R as q,Ra as J,Rd as Qt,Sa as Pt,Ta as Ve,Tc as Bt,Va as k,X as R,Xa as St,Xb as Dt,Ya as B,Za as j,_,_a as c,a as le,ab as W,b as de,cc as ie,cd as H,da as bt,dc as ge,ea as v,eb as S,f as $,fa as b,fd as jt,g as me,gb as C,h as we,hb as f,ia as yt,id as Vt,jc as it,jd as fe,kd as he,l as Z,lb as X,lc as Fe,ma as te,md as Ft,n as u,nb as xt,nd as Ce,o as M,ob as It,pb as wt,qb as Mt,rb as d,s as Me,sb as I,tb as y,u as ft,ub as Tt,vb as kt,w as ee,wb as Lt,wc as Ae,x as Te,xa as s,xc as Et,ya as h,zc as Re}from"./chunk-2W7IS4PN.js";function xn(n,r){return+z(n)<+z(r)}function In(n,r){return+z(n)==+z(r)}function wn(n,r,e){let t=+z(n,e?.in),[i,o]=[+z(r.start,e?.in),+z(r.end,e?.in)].sort((l,g)=>l-g);return t>=i&&t<=o}function Mn(n,r,e){let t=r.map(o=>({eventId:o,group:n})),i=e.map(o=>t.find(l=>l.eventId===o.eventId)||o);return[...new Set([...i,...t])].filter(o=>o.group!==null)}var Ke=(()=>{class n extends nn{static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=yt(n)))(i||n)}})()}static{this.\u0275prov=R({token:n,factory:n.\u0275fac})}}return n})();function Tn(n,r){return[...n].sort(oi(r))}function oi(n){return(r,e)=>{switch(n.primarySortKey){case"name":{let t=r.name.localeCompare(e.name);return n.ascending?t*-1:t}case"group":{let t=(r.detail.Value||"").localeCompare(e.detail.Value||"");return n.ascending?t*-1:t}}}}function kn(n,r){return n.map(e=>ri(e,r))}function ri(n,r){return{id:n.IdPerson,name:r.find(e=>e.StudentRef.Id===n.IdPerson)?.StudentFullName||"",group:n.Value,detail:n}}function Ln(n,r){return n.filter(e=>e.VssId===r.subscriptionDetailGroupId)}function pt(n,r){return n.find(e=>e.VssId===r.subscriptionDetailGroupId)}var si=(n,r)=>r.id;function ci(n,r){if(n&1){let e=S();c(0,"div",1)(1,"input",5),C("change",function(){let i=v(e).$implicit,o=f();return b(o.onSelectionChange(i))}),a(),c(2,"label",6),d(3),a()()}if(n&2){let e=r.$implicit,t=r.$index,i=f();s(),X("id","group-",t,""),x("checked",e.id===i.selected.id)("value",e.id),s(),X("for","group-",t,""),s(),y(" ",e.label," ")}}var De=function(n){return n.Select="select",n.Assign="assign",n}(De||{}),$n=(()=>{class n{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===De.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}static{this.\u0275fac=function(t){return new(t||n)(h(re),h(K))}}static{this.\u0275cmp=D({type:n,selectors:[["bkd-presence-control-group-dialog"]],inputs:{dialogMode:"dialogMode",subscriptionDetailsDefinitions:"subscriptionDetailsDefinitions",group:"group"},decls:14,vars:9,consts:[[1,"modal-body"],[1,"form-check"],[1,"modal-footer"],["type","button",1,"btn","btn-outline-secondary",3,"click"],["type","button",1,"btn","btn-primary",3,"click"],["type","radio","name","groups",1,"form-check-input",3,"change","id","checked","value"],[1,"form-check-label",3,"for"]],template:function(t,i){t&1&&(c(0,"div",0)(1,"p"),d(2),p(3,"translate"),a(),c(4,"form"),B(5,ci,4,7,"div",1,si),a()(),c(7,"div",2)(8,"button",3),C("click",function(){return i.activeModal.dismiss()}),d(9),p(10,"translate"),a(),c(11,"button",4),C("click",function(){return i.activeModal.close(i.getSelectedGroup())}),d(12),p(13,"translate"),a()()),t&2&&(s(2),y(" ",m(3,3,i.title)," "),s(3),j(i.groupOptions),s(4),y(" ",m(10,5,"presence-control.groups.cancel")," "),s(3),y(" ",m(13,7,"presence-control.groups.save")," "))},dependencies:[oe,Ce,fe,he,V],encapsulation:2})}}return n})();function Dn(n,r){return n===null&&r===null||n!==null&&r!==null&&n.TeacherInformation===r.TeacherInformation&&n.LessonDateTimeFrom.getTime()===r.LessonDateTimeFrom.getTime()&&n.LessonDateTimeTo.getTime()===r.LessonDateTimeTo.getTime()}function On(n){let r=new dt(n.TeacherInformation,n.LessonDateTimeFrom,n.LessonDateTimeTo);return r.addLesson(n),r}var dt=class{constructor(r,e,t){this.TeacherInformation=r,this.LessonDateTimeFrom=e,this.LessonDateTimeTo=t,this.lessons=[]}addLesson(r){this.lessons.some(e=>qe(e,r))||(this.lessons.push(r),this.updateId(),this.updateStudyClassNumbers(),this.updateEventDesignations())}getIds(){return[...new Set(this.lessons.map(r=>r.LessonRef.Id))]}getEventIds(){return[...new Set(this.lessons.map(r=>r.EventRef.Id))]}updateId(){this.id=[...new Set(this.lessons.map(r=>r.LessonRef.Id).sort())].join("-")}updateStudyClassNumbers(){this.studyClassNumbers=[...new Set(this.lessons.map(r=>r.StudyClassNumber).sort((r,e)=>r.localeCompare(e)))].join(", ")}updateEventDesignations(){this.eventDesignations=[...new Set(this.lessons.map(r=>r.EventDesignation).sort())].join(", ")}};function En(n){return ai(n).reduce((r,e)=>{let t=r.find(o=>Dn(o,e));if(t)return t.addLesson(e),r;let i=On(e);return[...r,i]},[]).sort(rt)}function Bn(n){if(n.length===0)return null;let r=new Date;if(n=[...n].sort(rt),Xt(r,n[0].LessonDateTimeFrom)){for(let e of n)if(xn(r,e.LessonDateTimeFrom)||wn(r,{start:e.LessonDateTimeFrom,end:e.LessonDateTimeTo}))return e;return n[n.length-1]}return n[0]}function ai(n){return n.reduce((r,e)=>r.some(t=>qe(t,e))?r:[...r,e],[])}function jn(n,r,e,t){return n.map(i=>{let o=r.find(l=>pi(l.presence,i));if(o){let l;return!o.newPresenceTypeId&&i.Comment?l=e.find(g=>g.IsComment)||null:l=e.find(g=>g.Id===o.newPresenceTypeId)||null,de(le({},i),{TypeRef:li(l),Date:null,Type:l?l.Designation:null,ConfirmationStateId:He(l,t)})}return i})}function pi(n,r){return n.LessonRef.Id===r.LessonRef.Id&&n.StudentRef.Id===r.StudentRef.Id}function li(n){return{Id:n?n.Id:null,HRef:null}}function Xe(n){return r=>r.reduce((e,t)=>e+(t.presenceCategory===n?1:0),0)}function Vn(){return n=>n.reduce((r,e)=>r+(e.precedingAbsences&&e.precedingAbsences.length>0?1:0),0)}var Fn=(()=>{class n extends We{constructor(e,t){super(e,t,at,"LessonTeachers")}loadOtherTeachersLessonAbsences(e,t,i){let o=`${this.baseUrl}/except/${e}/LessonAbsences?expand=LessonRef`;return t&&t.length>0&&(o=o.concat("&filter.StudentRef=;"+t.join(";"))),this.http.get(o,{params:i}).pipe(T(Wt(at)))}static{this.\u0275fac=function(t){return new(t||n)(_(Fe),_(H))}}static{this.\u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var Ye=(()=>{class n extends We{constructor(e,t){super(e,t,gn,"SubscriptionDetails")}getListForEvent(e){return this.getList({params:{IdEvent:String(e)}})}update(e,t){let i={IdPerson:t.IdPerson,EventId:t.EventId,Value:e};return this.http.put(`${this.baseUrl}/${t.Id}`,i).pipe(u(()=>{}))}static{this.\u0275fac=function(t){return new(t||n)(_(Fe),_(H))}}static{this.\u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var Rn="presence-control-group",ae=(()=>{class n{constructor(e,t,i,o,l){this.userSettings=e,this.eventService=t,this.subscriptionDetailsService=i,this.loadingService=o,this.settings=l,this.selectGroup$=new $,this.selectedLesson$=new we,this.lessonPresences$=new we,this.reloadSubscriptionDetails$=new $,this.defaultGroup=null,this.savedGroup$=this.selectedLesson$.pipe(T(g=>this.userSettings.getPresenceControlGroupView().pipe(u(w=>this.findGroupByLesson(w,g))))),this.group$=ee(this.selectGroup$,this.savedGroup$).pipe(je(this.defaultGroup),E(1)),this.loading$=this.loadingService.loading(Rn),this.subscriptionDetailsDefinitions$=this.selectedLesson$.pipe(u(g=>g?.getEventIds()||[]),T(g=>Me(g.map(w=>this.eventService.getSubscriptionDetailsDefinitions(w)))),E(1)),this.groupsAvailability$=this.subscriptionDetailsDefinitions$.pipe(u(g=>g.every(w=>pt(w,this.settings))),E(1)),this.subscriptionDetails$=M([this.selectedLesson$,this.groupsAvailability$,this.reloadSubscriptionDetails$.pipe(u(()=>!1),je(!0))]).pipe(T(([g,w,F])=>g&&w?this.loadSubscriptionDetailsForLesson(g,F):Z([])),u(g=>Ln(g,this.settings)),E(1)),this.subscriptionDetailPersonIds$=M([this.group$,this.subscriptionDetails$]).pipe(u(([g,w])=>w.filter(F=>F.Value===g).map(F=>F.IdPerson)),je([]))}selectGroup(e){this.selectGroup$.next(e)}setSelectedLesson(e){this.selectedLesson$.next(e)}setLessonPresences(e){this.lessonPresences$.next(e)}getSubscriptionDetailsDefinitions(){return this.subscriptionDetailsDefinitions$.pipe(u(ot),u(e=>pt(e,this.settings)))}getSubscriptionDetailsForStudents(){return M([this.subscriptionDetails$,this.lessonPresences$]).pipe(u(se(kn)))}reloadSubscriptionDetails(){this.reloadSubscriptionDetails$.next(void 0)}loadSubscriptionDetailsForLesson(e,t=!0){return this.loadingService.load(Me($e(e.getEventIds()).map(i=>this.subscriptionDetailsService.getListForEvent(i))),t?void 0:Rn).pipe(u(ot))}findGroupByLesson(e,t){return e.find(o=>o.eventId===t?.getEventIds()[0])?.group||this.defaultGroup}static{this.\u0275fac=function(t){return new(t||n)(_(Pe),_(bn),_(Ye),_(ce),_(H))}}static{this.\u0275prov=R({token:n,factory:n.\u0275fac})}}return n})();var Un=Object.values(pe),N=(()=>{class n{constructor(e,t,i,o,l,g,w,F,Se,xe){this.userSettings=e,this.lessonPresencesService=t,this.lessonTeacherService=i,this.presenceTypesService=o,this.groupService=l,this.dropDownItemsService=g,this.loadingService=w,this.storageService=F,this.settings=Se,this.location=xe,this.selectedDateSubject$=new me(new Date),this.selectedDate$=this.selectedDateSubject$.asObservable().pipe(u(P=>Jt(P)),Be(Ne)),this.viewModeSubject$=new $,this.viewMode$=ee(this.viewModeSubject$,this.userSettings.getPresenceControlViewMode().pipe(O(1))),this.lessons$=this.selectedDate$.pipe(T(P=>this.loadLessonsByDate(P)),E(1)),this.selectLessonId$=new $,this.selectLesson$=this.selectLessonId$.pipe(T(P=>this.getLessonById(P))),this.selectedLesson$=M([ln(this.selectLesson$.pipe(Be((P,Ie)=>Ne(P,Ie))),dn(this.settings.lessonPresencesRefreshTime)),this.lessons$]).pipe(u(([P,Ie])=>Ie.find(ni=>ni.id===P.id)?P:null),E(1)),this.studyClassCount$=this.selectedLesson$.pipe(u(P=>P?.lessons.length||0)),this.updateLessonPresences$=new $,this.reloadLessonPresences$=new $,this.lessonPresences$=ee(mn(this.selectedLesson$,this.reloadLessonPresences$).pipe(T(P=>P?this.loadLessonPresencesByLesson(P):Z([]))),this.updateLessonPresences$).pipe(E(1)),this.presenceTypes$=this.loadPresenceTypes().pipe(E(1)),this.reloadStudentIdsWithUnconfirmedAbsences$=new $,this.studentIdsWithUnconfirmedAbsences$=ee(this.selectedDate$,this.selectedLesson$.pipe(nt(1)),this.reloadStudentIdsWithUnconfirmedAbsences$).pipe(T(()=>this.loadStudentIdsWithUnconfirmedAbsences()),E(1)),this.loading$=this.loadingService.loading$,this.absenceConfirmationStates$=this.dropDownItemsService.getAbsenceConfirmationStates().pipe(E(1)),this.studentIds$=this.lessonPresences$.pipe(u(P=>$e(P.map(Ie=>Ie.StudentRef.Id))),E(1)),this.otherTeachersAbsences$=this.studentIds$.pipe(Be(Ne),T(P=>P.length>0?this.lessonTeacherService.loadOtherTeachersLessonAbsences(this.getMyself(),P):Z([])),E(1)),this.groupsAvailability$=this.groupService.groupsAvailability$,this.presenceControlEntries$=M([this.selectedLesson$,this.lessonPresences$,this.presenceTypes$,this.absenceConfirmationStates$,this.otherTeachersAbsences$]).pipe(u(se(en))),this.presenceControlEntriesByGroup$=M([this.groupService.group$,this.presenceControlEntries$,this.groupService.subscriptionDetailPersonIds$]).pipe(u(se(Pn)),E(1)),this.presentCount$=this.presenceControlEntriesByGroup$.pipe(u(Xe("present"))),this.absentCount$=this.presenceControlEntriesByGroup$.pipe(u(Xe("absent"))),this.unapprovedCount$=this.presenceControlEntriesByGroup$.pipe(u(Xe("unapproved"))),this.absentPrecedingCount$=this.presenceControlEntriesByGroup$.pipe(u(Vn())),this.queryParamsString$=M([this.selectedDate$,this.selectedLesson$,this.viewMode$]).pipe(u(se(this.buildQueryParams.bind(this))),u(pn)),this.destroy$=new $,this.queryParamsString$.pipe(q(this.destroy$)).subscribe(P=>{this.location.replaceState("/presence-control",P),this.confirmBackLinkParams={returnparams:P}}),this.viewMode$.pipe(nt(1),T(P=>this.userSettings.savePresenceControlViewMode(P)),q(this.destroy$)).subscribe(),this.selectedLesson$.pipe(q(this.destroy$)).subscribe(P=>{this.groupService.setSelectedLesson(P)}),this.lessonPresences$.pipe(q(this.destroy$)).subscribe(P=>this.groupService.setLessonPresences(P))}ngOnDestroy(){this.destroy$.next()}setDate(e){this.selectedDateSubject$.next(e)}setLessonId(e){this.selectLessonId$.next(e)}setViewMode(e){this.viewModeSubject$.next(e)}updateLessonPresencesTypes(e){M([this.lessonPresences$.pipe(O(1)),this.presenceTypes$.pipe(O(1))]).pipe(u(([t,i])=>jn(t,e,i,this.settings))).subscribe(t=>this.updateLessonPresences$.next(t))}getNextPresenceType(e){return this.presenceTypes$.pipe(O(1),u(t=>e.getNextPresenceType(t)))}hasUnconfirmedAbsences(e){return this.studentIdsWithUnconfirmedAbsences$.pipe(u(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(u(En))}loadPresenceTypes(){return this.loadingService.load(this.presenceTypesService.presenceTypes$)}loadStudentIdsWithUnconfirmedAbsences(){return ft(0,this.settings.unconfirmedAbsencesRefreshTime||-1).pipe(T(()=>this.lessonPresencesService.getListOfUnconfirmed()),u(e=>$e(e.map(t=>t.StudentRef.Id))))}buildQueryParams(e,t,i){let o={date:Yt(e,"yyyy-MM-dd"),viewMode:i};return t&&(o.lesson=String(t.id)),o}getLessonById(e){let t=String(e);return this.lessons$.pipe(u(i=>t&&i.find(o=>o.id===t)||Bn(i)),Te(Boolean))}getMyself(){let e=this.storageService.getPayload();return Number(e?.holder_id||e?.id_person)}static{this.\u0275fac=function(t){return new(t||n)(_(Pe),_(Qe),_(Fn),_(ve),_(ae),_(rn),_(ce),_(Qt),_(H),_(Dt))}}static{this.\u0275prov=R({token:n,factory:n.\u0275fac})}}return n})();var fi=(n,r)=>r.id,hi=()=>[],Ci=()=>["/presence-control"];function _i(n,r){if(n&1&&(c(0,"span",12),d(1),a()),n&2){let e=f().$implicit,t=f(),i=Q(0);s(),I(t.getSortDirectionCharacter(i,e))}}function vi(n,r){if(n&1){let e=S();c(0,"div",11),C("click",function(){let i=v(e).$implicit,o=f();return b(o.toggleSort(i))}),d(1),p(2,"translate"),L(3,_i,2,1,"span",12),a()}if(n&2){let e=r.$implicit;f();let t=Q(0);x("className",e),s(),y(" ",m(2,3,"presence-control.groups.list.header."+e)," "),s(2),k(t?3:-1)}}function bi(n,r){n&1&&W(0,"bkd-spinner")}function yi(n,r){n&1&&W(0,"bkd-spinner",18)}function Pi(n,r){if(n&1){let e=S();c(0,"div",13)(1,"div",14)(2,"input",15,0),p(4,"async"),C("change",function(){let i=v(e).$implicit,o=f(2);return b(o.selectionService.toggle(i))}),a()(),c(5,"div",16),d(6),a(),c(7,"div",17)(8,"span"),d(9),a(),L(10,yi,1,0,"bkd-spinner",18),p(11,"async"),a()()}if(n&2){let e=r.$implicit,t=f(2);s(2),x("checked",m(4,4,t.selectionService.isSelected$(e))),s(4),y(" ",e.name," "),s(3),I(e.group?e.group:""),s(),k(m(11,6,t.groupService.loading$)?10:-1)}}function Si(n,r){if(n&1&&B(0,Pi,12,8,"div",13,fi),n&2){f();let e=Q(2);j(e)}}var Wn=(()=>{class n{constructor(e,t,i,o,l,g,w,F,Se){this.route=e,this.state=t,this.selectionService=i,this.groupService=o,this.userSettings=l,this.subscriptionDetailService=g,this.toastService=w,this.translate=F,this.modalService=Se,this.primarySortKeys=["name","group"],this.backlinkQueryParams$=this.route.queryParams.pipe(u(({returnparams:xe})=>xe),u(an)),this.eventIds$=this.state.selectedLesson$.pipe(u(xe=>xe?.getEventIds()||[])),this.sortCriteriaSubject$=new me({primarySortKey:"name",ascending:!1}),this.sortCriteria$=this.sortCriteriaSubject$.asObservable(),this.sortedEntries$=M([this.groupService.getSubscriptionDetailsForStudents(),this.sortCriteria$]).pipe(u(se(Tn))),this.selected=[]}ngOnInit(){this.selectionService.selection$.subscribe(e=>this.selected=e)}selectGroup(){this.openGroupModal(De.Select,this.selectCallback.bind(this))}assignGroup(){this.openGroupModal(De.Assign,this.assignCallback.bind(this))}openGroupModal(e,t){M([this.groupService.getSubscriptionDetailsDefinitions(),this.groupService.group$]).pipe(O(1)).subscribe(([i,o])=>{let l=this.modalService.open($n);l.componentInstance.dialogMode=e,l.componentInstance.subscriptionDetailsDefinitions=i,l.componentInstance.group=o,l.result.then(g=>{t(g)},()=>{})})}selectCallback(e){M([this.eventIds$,this.userSettings.getPresenceControlGroupView()]).pipe(O(1),T(([t,i])=>this.userSettings.savePresenceControlGroupView(Mn(e.id,t,i))),u(()=>e.id)).subscribe(t=>this.groupService.selectGroup(t))}assignCallback(e){Me(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(O(1)).subscribe(t=>{t.primarySortKey===e?this.sortCriteriaSubject$.next({primarySortKey:e,ascending:!t.ascending}):this.sortCriteriaSubject$.next({primarySortKey:e,ascending:e==="name"})})}static{this.\u0275fac=function(t){return new(t||n)(h(Ae),h(N),h(Ke),h(ae),h(Pe),h(Ye),h(_e),h(K),h(ye))}}static{this.\u0275cmp=D({type:n,selectors:[["bkd-presence-control-group"]],features:[ue([Ke])],decls:33,vars:32,consts:[["checkbox",""],[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"],[3,"click","className"],[1,"sort-direction"],[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"],[1,"inline","small"]],template:function(t,i){if(t&1){let o=S();G(0),p(1,"async"),G(2),p(3,"async"),G(4),p(5,"async"),G(6),p(7,"async"),c(8,"div"),W(9,"bkd-backlink",1),p(10,"async"),c(11,"h1"),d(12),p(13,"translate"),a(),c(14,"div",2)(15,"div",3)(16,"span",4),d(17),p(18,"translate"),a(),c(19,"button",5),C("click",function(){return v(o),b(i.selectGroup())}),d(20),p(21,"translate"),p(22,"translate"),a()(),c(23,"a",6),C("click",function(){return v(o),b(i.assignGroup())}),c(24,"i",7),d(25,"edit"),a()()(),c(26,"div",8)(27,"div",9),B(28,vi,4,5,"div",10,St),a(),L(30,bi,1,0,"bkd-spinner"),p(31,"async"),L(32,Si,2,0),a()()}if(t&2){let o;Y(m(1,8,i.sortCriteria$)),s(2),Y(m(3,11,i.sortedEntries$));let l=(o=m(5,14,i.selectionService.selection$))!==null&&o!==void 0?o:ke(30,hi),g=m(7,16,i.groupService.group$);s(7),x("link",ke(31,Ci))("params",m(10,18,i.backlinkQueryParams$)),s(3),I(m(13,20,"presence-control.groups.title")),s(5),I(m(18,22,"presence-control.groups.show")),s(3),y(" ",g?m(21,24,"presence-control.groups.group")+" "+g:m(22,26,"presence-control.groups.all")," "),s(3),J("disabled",l.length===0),s(5),j(i.primarySortKeys),s(2),k(m(31,28,i.state.loading$)?30:32)}},dependencies:[hn,be,ie,V],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})}}return n})();var xi=(n,r)=>r.entry.id;function Ii(n,r){if(n&1){let e=S();c(0,"div",1)(1,"input",5),C("change",function(){let i=v(e).$implicit;return b(i.selected=!i.selected)}),a(),c(2,"label",6)(3,"i"),d(4),a(),c(5,"div",7),d(6),p(7,"date"),p(8,"date"),a()()()}if(n&2){let e=r.$implicit,t=r.$index,i=f();s(),X("id","lesson-presence-",t,""),x("checked",e.selected),s(),J("fw-bold",i.isCurrentLesson(e)),X("for","lesson-presence-",t,""),s(),Ve("",e.entry.presenceCategory," material-icons pe-2"),s(),I(e.entry.presenceCategoryIcon),s(2),kt(" ",U(7,14,e.entry.lessonPresence.LessonDateTimeFrom,"HH:mm"),"\u2013",U(8,17,e.entry.lessonPresence.LessonDateTimeTo,"HH:mm")," ",e.entry.lessonPresence.EventDesignation," ")}}var Qn=(()=>{class n{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 In(e.entry.lessonPresence.LessonDateTimeFrom,this.entry.lessonPresence.LessonDateTimeFrom)}buildLessonPresenceOptions(){return this.blockPresenceControlEntries.map(e=>({entry:e,selected:this.entry.confirmationState===e.confirmationState}))}static{this.\u0275fac=function(t){return new(t||n)(h(re))}}static{this.\u0275cmp=D({type:n,selectors:[["bkd-presence-control-block-lesson-component"]],inputs:{entry:"entry",blockPresenceControlEntries:"blockPresenceControlEntries"},decls:15,vars:11,consts:[[1,"modal-body"],[1,"form-check"],[1,"modal-footer"],["type","button",1,"btn","btn-outline-secondary",3,"click"],["type","button",1,"btn","btn-primary",3,"click","disabled"],["type","checkbox",1,"form-check-input",3,"change","id","checked"],[1,"form-check-label","d-flex",3,"for"],[1,"d-block","text-truncate"]],template:function(t,i){if(t&1){let o=S();c(0,"div",0)(1,"p"),d(2),p(3,"translate"),a(),c(4,"form"),B(5,Ii,9,20,"div",1,xi),a()(),G(7),c(8,"div",2)(9,"button",3),C("click",function(){return v(o),b(i.activeModal.close())}),d(10),p(11,"translate"),a(),c(12,"button",4),C("click",function(){v(o);let g=Q(7);return b(i.activeModal.close(g))}),d(13),p(14,"translate"),a()()}if(t&2){s(2),y(" ",m(3,4,"presence-control.block-lesson.text")," "),s(3),j(i.blockLessonOptions),s(2);let o=Y(i.getSelectedEntries());s(3),y(" ",m(11,7,"presence-control.block-lesson.cancel")," "),s(2),x("disabled",o.length===0),s(),y(" ",m(14,9,"presence-control.block-lesson.save")," ")}},dependencies:[oe,Ce,fe,he,ge,V],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}"]})}}return n})();var wi=30;function gt(n){return`blockLesson${n.lessonPresence.Id}`}var Ze=(()=>{class n{constructor(e,t,i,o){this.state=e,this.lessonPresencesService=t,this.loadingService=i,this.settings=o}getBlockLessonPresenceControlEntries(e){return M([this.state.lessons$.pipe(O(1)),this.loadChangeableLessonPresences(e),this.state.presenceTypes$.pipe(O(1)),this.state.absenceConfirmationStates$.pipe(O(1)),this.state.otherTeachersAbsences$.pipe(O(1))]).pipe(u(([t,i,o,l,g])=>this.filterBlockLessonPresences(e,i).map(w=>tn(t.find(F=>F.id===w.LessonRef.Id.toString()),w,o,l,g))))}filterBlockLessonPresences(e,t){return[...t].sort((i,o)=>i.LessonDateTimeFrom>o.LessonDateTimeFrom?1:-1).reduce((i,o)=>{let l=i[i.length-1];return this.isWithinBlockTime(o,l)?(i.push(o),i):i.find(g=>g.Id===e.lessonPresence.Id)?i:[o]},[])}isWithinBlockTime(e,t){return t?e.LessonDateTimeFrom.getTime()-t.LessonDateTimeTo.getTime()<=wi*60*1e3:!0}loadChangeableLessonPresences(e){return M([this.loadLessonPresences(e),this.state.presenceTypes$.pipe(O(1))]).pipe(u(([t,i])=>t.filter(o=>Zt(o,i.find(l=>l.Id===o.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(u(t=>t.filter(i=>i.TeacherInformation===e.lessonPresence.TeacherInformation))),gt(e))}static{this.\u0275fac=function(t){return new(t||n)(_(N),_(Qe),_(ce),_(H))}}static{this.\u0275prov=R({token:n,factory:n.\u0275fac})}}return n})();var Ti=(n,r)=>r.Id;function ki(n,r){if(n&1&&(c(0,"div"),d(1),p(2,"date"),p(3,"date"),p(4,"addSpace"),a()),n&2){let e=r.$implicit;s(),Lt(" ",U(2,5,e.LessonRef.From,"HH:mm"),"\u2013",U(3,8,e.LessonRef.To,"HH:mm")," ",e.LessonRef.EventDesignation,"",U(4,11,":",":")," ",e.Type," ")}}var Kn=(()=>{class n{constructor(e){this.activeModal=e}static{this.\u0275fac=function(t){return new(t||n)(h(re))}}static{this.\u0275cmp=D({type:n,selectors:[["bkd-presence-control-preceding-absence"]],inputs:{precedingAbsences:"precedingAbsences"},decls:10,vars:6,consts:[[1,"modal-body"],[1,"modal-footer"],["type","button",1,"btn","btn-outline-secondary",3,"click"]],template:function(t,i){t&1&&(c(0,"div",0)(1,"p"),d(2),p(3,"translate"),a(),B(4,ki,5,14,"div",null,Ti),a(),c(6,"div",1)(7,"button",2),C("click",function(){return i.activeModal.dismiss()}),d(8),p(9,"translate"),a()()),t&2&&(s(2),y(" ",m(3,2,"presence-control.preceding-absence.text")," "),s(2),j(i.precedingAbsences),s(4),y(" ",m(9,4,"presence-control.preceding-absence.cancel")," "))},dependencies:[ge,V,un],encapsulation:2})}}return n})();var Li=n=>["student",n,"absences"],$i=n=>["/presence-control/student",n,"absences"];function Di(n,r){if(n&1&&(W(0,"bkd-avatar",0),p(1,"async")),n&2){let e=f();x("studentId",m(1,3,e.studentId$))("link",ne(5,$i,e.entry.lessonPresence.StudentRef.Id.toString()))("linkParams",e.profileReturnParams)}}function Oi(n,r){if(n&1&&(c(0,"span"),d(1),a()),n&2){let e=f(2);s(),I(e.entry.presenceType==null?null:e.entry.presenceType.Designation)}}function Ei(n,r){if(n&1){let e=S();c(0,"button",12),C("click",function(){v(e);let i=f();return b(i.updatePresenceType(i.entry))}),L(1,Oi,2,1,"span"),a()}if(n&2){let e=f();s(),k(e.entry.presenceType!=null&&e.entry.presenceType.IsIncident?-1:1)}}function Bi(n,r){n&1&&W(0,"bkd-spinner",5)}function ji(n,r){if(n&1){let e=S();c(0,"button",13),C("click",function(){v(e);let i=f();return b(i.showPrecedingAbsences(i.entry))}),c(1,"i",14),d(2,"info"),a()()}}function Vi(n,r){if(n&1&&(c(0,"span",9),d(1),a()),n&2){let e=f();s(),y(" ",e.entry.lessonPresence.StudyClassNumber," ")}}function Fi(n,r){if(n&1){let e=S();c(0,"a",15),C("click",function(){v(e);let i=f();return b(i.updateIncident(i.entry))}),c(1,"i",4),d(2,"edit"),a(),c(3,"span"),d(4),p(5,"translate"),a()()}if(n&2){let e=f();s(4),I(m(5,1,(e.entry.presenceType==null?null:e.entry.presenceType.IsIncident)&&(e.entry.presenceType==null?null:e.entry.presenceType.Designation)||"presence-control.entry.incident"))}}var zn=(()=>{class n{get classNames(){return[this.entry.presenceCategory,this.viewMode].join(" ")}constructor(e,t,i,o){this.toastService=e,this.translate=t,this.modalService=i,this.loadingService=o,this.hasUnconfirmedAbsences=!1,this.showClassName=!1,this.togglePresenceType=new te,this.changeIncident=new te,this.entry$=new we(1),this.studentId$=this.entry$.pipe(u(({lessonPresence:l})=>l.StudentRef.Id)),this.loading$=this.entry$.pipe(T(l=>this.loadingService.loading(gt(l))))}ngOnChanges(e){e.entry&&this.entry$.next(e.entry.currentValue)}get isListViewMode(){return this.viewMode===pe.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(Kn);t.componentInstance.precedingAbsences=e.precedingAbsences}static{this.\u0275fac=function(t){return new(t||n)(h(_e),h(K),h(ye),h(ce))}}static{this.\u0275cmp=D({type:n,selectors:[["bkd-presence-control-entry"]],hostVars:2,hostBindings:function(t,i){t&2&&Pt(i.classNames)},inputs:{entry:"entry",hasUnconfirmedAbsences:"hasUnconfirmedAbsences",viewMode:"viewMode",showClassName:"showClassName",profileReturnParams:"profileReturnParams"},outputs:{togglePresenceType:"togglePresenceType",changeIncident:"changeIncident"},features:[bt],decls:18,vars:20,consts:[[1,"avatar","large",3,"studentId","link","linkParams"],["type","button",1,"presence-category","designation","btn","btn-link"],["type","button",1,"presence-category","status","btn","btn-link",3,"click","disabled"],[1,"position-relative"],[1,"material-icons"],[1,"inline","small"],["type","button",1,"previously-absent","d-flex","btn","btn-link"],[1,"student-info",3,"routerLink","queryParams"],[1,"student-name","text-truncate"],[1,"study-class","text-truncate"],[1,"unconfirmed-absences"],[1,"incident","btn","btn-link"],["type","button",1,"presence-category","designation","btn","btn-link",3,"click"],["type","button",1,"previously-absent","d-flex","btn","btn-link",3,"click"],[1,"material-icons-outlined"],[1,"incident","btn","btn-link",3,"click"]],template:function(t,i){if(t&1){let o=S();L(0,Di,2,7,"bkd-avatar",0)(1,Ei,2,1,"button",1),G(2),p(3,"async"),c(4,"button",2),C("click",function(){return v(o),b(i.updatePresenceType(i.entry))}),c(5,"div",3)(6,"i",4),d(7),a(),L(8,Bi,1,0,"bkd-spinner",5),a()(),L(9,ji,3,0,"button",6),c(10,"a",7)(11,"span",8),d(12),a(),L(13,Vi,2,1,"span",9),c(14,"span",10),d(15),p(16,"translate"),a()(),L(17,Fi,6,3,"a",11)}if(t&2){k(i.isListViewMode?-1:0),s(),k(i.entry.showDesignation?1:-1);let o=m(3,14,i.loading$);s(3),x("disabled",o),s(2),J("invisible",o),s(),I(i.entry.presenceCategoryIcon),s(),k(o?8:-1),s(),k(i.entry.precedingAbsences!=null&&i.entry.precedingAbsences.length?9:-1),s(),x("routerLink",ne(18,Li,i.entry.lessonPresence.StudentRef.Id))("queryParams",i.profileReturnParams),s(2),I(i.entry.lessonPresence.StudentFullName),s(),k(i.isListViewMode&&i.showClassName?13:-1),s(2),y(" ",i.hasUnconfirmedAbsences?m(16,16,"presence-control.entry.unconfirmed-absences"):""," "),s(2),k(i.entry.canChangeIncident?17:-1)}},dependencies:[fn,be,Re,ie,V],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}}']})}}return n})();var Ai=(n,r)=>r.viewMode,Ri=(n,r)=>r.id,Gi=(n,r)=>({"btn-link":n,"btn-danger":r}),Ni=n=>["groups",n],Ui=n=>({returnparams:n});function Hi(n,r){if(n&1){let e=S();c(0,"div",22),C("click",function(){v(e);let i=f();return b(i.lessonDropdown==null?null:i.lessonDropdown.toggle())}),d(1),p(2,"date"),c(3,"span",23),d(4),p(5,"date"),a()()}if(n&2){let e=f();s(),y(" ",U(2,2,e.selectedLesson.LessonDateTimeFrom,"HH:mm"),"\u2013"),s(3),I(U(5,5,e.selectedLesson.LessonDateTimeTo,"HH:mm"))}}function qi(n,r){if(n&1){let e=S();c(0,"div",28),C("click",function(){let i=v(e).$implicit,o=f(2);return b(o.selectLessonChange.emit(i))}),c(1,"div",29)(2,"div"),d(3),p(4,"date"),p(5,"date"),a(),c(6,"div",25),d(7),a(),c(8,"div",25),d(9),a()()()}if(n&2){let e=r.$implicit,t=f(2);J("active",e.id===t.selectedLesson.id),s(3),Tt(" ",U(4,6,e.LessonDateTimeFrom,"HH:mm"),"\u2013",U(5,9,e.LessonDateTimeTo,"HH:mm")," "),s(4),y(" ",e.eventDesignations," "),s(2),y(" ",e.studyClassNumbers," ")}}function Wi(n,r){if(n&1&&(c(0,"div",7)(1,"div",24)(2,"div",25),d(3),a(),c(4,"div",25),d(5),a()(),c(6,"div",26),B(7,qi,10,12,"div",27,Ri),a()()),n&2){let e=f();s(3),I(e.selectedLesson.eventDesignations),s(2),I(e.selectedLesson.studyClassNumbers),s(2),j(e.lessons)}}function Qi(n,r){if(n&1){let e=S();c(0,"bkd-caret",30),C("click",function(){v(e);let i=f();return b(i.lessonDropdown==null?null:i.lessonDropdown.toggle())}),a()}if(n&2){let e=f();x("expanded",(e.lessonDropdown==null?null:e.lessonDropdown.isOpen())||!1)}}function Ki(n,r){if(n&1&&(c(0,"a",19),p(1,"async"),p(2,"async"),p(3,"async"),c(4,"i",31),d(5,"groups"),a()()),n&2){let e=f();x("ngClass",$t(9,Gi,m(1,3,e.isGroupSelected$)===!1,m(2,5,e.isGroupSelected$)))("routerLink",ne(12,Ni,e.selectedLesson.id))("queryParams",ne(14,Ui,m(3,7,e.state.queryParamsString$)))}}function zi(n,r){if(n&1){let e=S();c(0,"button",32),C("click",function(){let i=v(e).$implicit,o=f();return b(o.viewModeChange.emit(i.viewMode))}),c(1,"i",31),d(2),a()()}if(n&2){let e=r.$implicit,t=f();J("btn-outline-secondary",e.viewMode===t.viewMode)("btn-link",e.viewMode!==t.viewMode)("active",e.viewMode===t.viewMode),x("disabled",!t.selectedLesson),s(2),I(e.icon)}}var Ji=Le.prototype._positionMenu;Le.prototype._positionMenu=function(...r){let e=Ji.apply(this,r);if(this._anchor.nativeElement.id==="lesson-dropdown"){let t=this._bodyContainer||this._menu.nativeElement,i=t.style.transform?.match(/translate\(([0-9-.]+)px, ([0-9-.]+)px\)/);i&&parseFloat(i[1])<0&&(t.style.transform=`translate(0px, ${i[2]}px)`)}return e};var Jn=(()=>{class n{constructor(e,t,i){this.state=e,this.groupService=t,this.presentCount=null,this.absentCount=null,this.unapprovedCount=null,this.absentPrecedingCount=null,this.search="",this.selectLessonChange=new te,this.selectDateChange=new te,this.searchChange=new te,this.viewModeChange=new te,this.viewModeOptions=[{viewMode:pe.List,icon:"list"},{viewMode:pe.Grid,icon:"view_module"}],this.isGroupSelected$=this.groupService.group$.pipe(u(Kt)),i.popperOptions=o=>de(le({},o),{modifiers:o.modifiers?.map(l=>(l.name==="offset"&&(l.options={offset:({placement:g,reference:w,popper:F})=>g==="bottom-start"?[(window.innerWidth-F.width)/2-w.x,0]:[]}),l))})}static{this.\u0275fac=function(t){return new(t||n)(h(N),h(ae),h(Ge))}}static{this.\u0275cmp=D({type:n,selectors:[["bkd-presence-control-header"]],viewQuery:function(t,i){if(t&1&&xt(Le,5),t&2){let o;It(o=wt())&&(i.lessonDropdown=o.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"},features:[ue([Ge,{provide:At,useClass:Nt},{provide:Rt,useClass:yn}])],decls:41,vars:19,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"],[1,"lesson-time"],["ngbDropdown","","container","body","display","dynamic","placement","bottom",1,"lesson-description"],[1,"dropdown-caret",3,"expanded"],[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",1,"group","btn","me-2","me-sm-4",3,"ngClass","routerLink","queryParams"],[1,"views"],["type","button",1,"view","btn","btn-primary","btn-icon",3,"disabled","btn-outline-secondary","btn-link","active"],[1,"lesson-time",3,"click"],[1,"lesson-time-to"],["id","lesson-dropdown","ngbDropdownToggle",""],[1,"text-truncate"],["ngbDropdownMenu","","aria-labelledby","lesson-dropdown"],["ngbDropdownItem","",3,"active"],["ngbDropdownItem","",3,"click"],[1,"lesson-entry"],[1,"dropdown-caret",3,"click","expanded"],[1,"material-icons","align-middle"],["type","button",1,"view","btn","btn-primary","btn-icon",3,"click","disabled"]],template:function(t,i){if(t&1){let o=S();c(0,"div",1)(1,"div",2)(2,"button",3),C("click",function(){v(o);let g=Mt(6);return b(g.toggle())}),c(3,"i",4),d(4,"calendar_today"),a()(),c(5,"input",5,0),C("ngModelChange",function(g){return v(o),b(i.selectDateChange.emit(g))}),a()(),L(7,Hi,6,8,"div",6)(8,Wi,9,2,"div",7)(9,Qi,1,1,"bkd-caret",8),a(),c(10,"div",9)(11,"div",10)(12,"i",4),d(13,"check_circle"),a(),c(14,"span",11),d(15),a()(),c(16,"div",12)(17,"i",4),d(18,"cancel"),a(),c(19,"span",11),d(20),a()(),c(21,"div",13)(22,"i",4),d(23,"help"),a(),c(24,"span",11),d(25),a()(),c(26,"div",14)(27,"i",15),d(28,"info"),a(),c(29,"span",11),d(30),a()()(),c(31,"div",16)(32,"bkd-resettable-input",17),p(33,"translate"),p(34,"translate"),C("valueChange",function(g){return v(o),b(i.searchChange.emit(g))}),a(),c(35,"div",18),L(36,Ki,6,16,"a",19),p(37,"async"),c(38,"div",20),B(39,zi,3,8,"button",21,Ai),a()()()}t&2&&(s(5),x("ngModel",i.selectDate),s(2),k(i.selectedLesson?7:-1),s(),k(i.selectedLesson?8:-1),s(),k(i.lessons.length>0?9:-1),s(6),I(i.presentCount!==null?i.presentCount:"?"),s(5),I(i.absentCount!==null?i.absentCount:"?"),s(5),I(i.unapprovedCount!==null?i.unapprovedCount:"?"),s(5),I(i.absentPrecedingCount!==null?i.absentPrecedingCount:"?"),s(2),x("value",i.search)("disabled",!i.selectedLesson)("placeholder",m(33,13,"presence-control.header.search-by-name"))("label",m(34,15,"presence-control.header.search")),s(4),k(m(37,17,i.selectedLesson&&i.state.groupsAvailability$)?36:-1),s(3),j(i.viewModeOptions))},dependencies:[Gt,oe,jt,Vt,Ft,Le,qt,Ht,Ut,cn,_n,Ot,Re,ie,ge,V],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}}']})}}return n})();var Xi=(n,r)=>r.id;function Yi(n,r){if(n&1){let e=S();c(0,"div",1)(1,"input",5),C("change",function(){let i=v(e).$implicit,o=f();return b(o.onSelectionChange(i))}),a(),c(2,"label",6),d(3),a()()}if(n&2){let e=r.$implicit,t=r.$index,i=f();s(),X("id","incident-",t,""),x("checked",e.id===i.selected.id)("value",e.id),s(),X("for","incident-",t,""),s(),y(" ",e.label," ")}}var Xn=(()=>{class n{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}static{this.\u0275fac=function(t){return new(t||n)(h(re),h(K))}}static{this.\u0275cmp=D({type:n,selectors:[["bkd-presence-control-incident"]],inputs:{incident:"incident",incidentTypes:"incidentTypes"},decls:14,vars:9,consts:[[1,"modal-body"],[1,"form-check"],[1,"modal-footer"],["type","button",1,"btn","btn-outline-secondary",3,"click"],["type","button",1,"btn","btn-primary",3,"click"],["type","radio","name","incident",1,"form-check-input",3,"change","id","checked","value"],[1,"form-check-label",3,"for"]],template:function(t,i){t&1&&(c(0,"div",0)(1,"p"),d(2),p(3,"translate"),a(),c(4,"form"),B(5,Yi,4,7,"div",1,Xi),a()(),c(7,"div",2)(8,"button",3),C("click",function(){return i.activeModal.dismiss()}),d(9),p(10,"translate"),a(),c(11,"button",4),C("click",function(){return i.activeModal.close(i.getSelectedIncident())}),d(12),p(13,"translate"),a()()),t&2&&(s(2),y(" ",m(3,3,"presence-control.incident.text")," "),s(3),j(i.incidentOptions),s(4),y(" ",m(10,5,"presence-control.incident.cancel")," "),s(3),y(" ",m(13,7,"presence-control.incident.save")," "))},dependencies:[oe,Ce,fe,he,V],styles:["form[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]:first-child{border-bottom:1px solid #dee2e6;padding-bottom:1rem;margin-bottom:1rem}"]})}}return n})();var Zi=20,eo=100,Ee=function(n){return n.AddUpdateAction="ADD",n.RemoveUpdateAction="REMOVE",n}(Ee||{}),et=(()=>{class n{constructor(e,t,i,o,l){this.toastService=e,this.translate=t,this.restService=i,this.presenceTypesService=o,this.settings=l,this.destroy$=new $,this.action$=new $,this.pendingUpdates$=this.action$.pipe(_t(this.reduceUpdates.bind(this),[]),vt()),this.revertUpdates$=new $,this.performUpdates$=this.pendingUpdates$.pipe(tt(eo),Te(Ue(st)),Ct(this.performUpdates.bind(this))),this.stateUpdates$=ee(this.pendingUpdates$,this.revertUpdates$).pipe(tt(Zi),Te(Ue(st))),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 M(Object.keys(t).reduce((i,o)=>{let l=t[o];return Object.keys(l).forEach(g=>{let w=l[g];i.push(this.performUpdateForGroup(w))}),i},[])).pipe(u(()=>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,i=null){return i?(i?this.presenceTypesService.getPresenceType(i):Z(null)).pipe(T(l=>this.restService.editLessonPresences([e],t,l?.Id,He(l,this.settings)||void 0,{context:new it().set(ct,{disableErrorHandling:!0})}))):this.restService.removeLessonPresences([e],t,{context:new it().set(ct,{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(i=>de(le({},i),{newPresenceTypeId:i.presence.TypeRef.Id}))),Z(void 0)}groupUpdates(e){return e.reduce((t,i)=>{let o=String(i.newPresenceTypeId&&i.newPresenceTypeId);return t[o]||(t[o]={}),Array.isArray(t[o][i.presence.LessonRef.Id])||(t[o][i.presence.LessonRef.Id]=[]),t[o][i.presence.LessonRef.Id].push(i),t},{})}reduceUpdates(e,t){switch(t.type){case Ee.AddUpdateAction:{let{presence:i,newPresenceTypeId:o}=t.payload,l=e.findIndex(Yn(i));return l===-1?[...e,{presence:i,newPresenceTypeId:o}]:[...e.slice(0,l),{presence:e[l].presence,newPresenceTypeId:o},...e.slice(l+1)]}case Ee.RemoveUpdateAction:return e.filter(Ue(Yn(t.payload)));default:return e}}dispatchAddUpdate(e,t){this.action$.next({type:Ee.AddUpdateAction,payload:{presence:e,newPresenceTypeId:t}})}dispatchRemoveUpdate(e){this.action$.next({type:Ee.RemoveUpdateAction,payload:e})}static{this.\u0275fac=function(t){return new(t||n)(_(_e),_(K),_(sn),_(ve),_(H))}}static{this.\u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();function Yn(n){return r=>r.presence.LessonRef.Id===n.LessonRef.Id&&r.presence.StudentRef.Id===n.StudentRef.Id}var to=(n,r)=>r.id,no=()=>[],io=n=>({returnparams:n});function oo(n,r){n&1&&W(0,"bkd-spinner")}function ro(n,r){n&1&&(c(0,"p",1),d(1),p(2,"translate"),a()),n&2&&(s(),I(m(2,1,"presence-control.no-lessons")))}function so(n,r){n&1&&(c(0,"p",1),d(1),p(2,"translate"),a()),n&2&&(s(),y(" ",m(2,1,"presence-control.no-lesson-presences")," "))}function co(n,r){if(n&1){let e=S();c(0,"bkd-presence-control-entry",4),p(1,"async"),p(2,"async"),p(3,"async"),p(4,"async"),C("togglePresenceType",function(i){v(e);let o=f(3);return b(o.togglePresenceType(i))})("changeIncident",function(i){v(e);let o=f(3);return b(o.changeIncident(i))}),a()}if(n&2){let e,t=r.$implicit,i=f(3);x("entry",t)("hasUnconfirmedAbsences",m(1,5,i.state.hasUnconfirmedAbsences(t)))("viewMode",m(2,7,i.state.viewMode$))("showClassName",((e=m(3,9,i.state.studyClassCount$))!==null&&e!==void 0?e:0)>1)("profileReturnParams",ne(13,io,m(4,11,i.state.queryParamsString$)))}}function ao(n,r){if(n&1&&(c(0,"div"),p(1,"async"),B(2,co,5,15,"bkd-presence-control-entry",3,to),a()),n&2){let e=f(2),t=Q(4);Ve("default-entries entries view-mode-",m(1,3,e.state.viewMode$),""),s(2),j(t)}}function po(n,r){if(n&1){let e=S();c(0,"bkd-presence-control-header",0),p(1,"async"),p(2,"async"),p(3,"async"),p(4,"async"),p(5,"async"),p(6,"async"),p(7,"async"),C("searchChange",function(i){v(e);let o=f();return b(o.search$.next(i))})("viewModeChange",function(i){v(e);let o=f();return b(o.state.setViewMode(i))})("selectDateChange",function(i){v(e);let o=f();return b(o.state.setDate(i))})("selectLessonChange",function(i){v(e);let o=f();return b(o.state.setLessonId(i.id))}),a(),L(8,ro,3,3,"p",1)(9,so,3,3,"p",1)(10,ao,4,5,"div",2)}if(n&2){let e=f(),t=Q(0),i=Q(2),o=Q(4);x("selectedLesson",t)("lessons",i)("presentCount",m(1,10,e.state.presentCount$))("absentCount",m(2,12,e.state.absentCount$))("unapprovedCount",m(3,14,e.state.unapprovedCount$))("absentPrecedingCount",m(4,16,e.state.absentPrecedingCount$))("viewMode",m(5,18,e.state.viewMode$))("selectDate",m(6,20,e.state.selectedDate$))("search",m(7,22,e.search$)),s(8),k(t?o.length===0?9:10:8)}}var lo=["studentFullName"],ei=(()=>{class n{constructor(e,t,i,o,l,g,w){this.state=e,this.blockLessons=t,this.lessonPresencesUpdateService=i,this.presenceTypesService=o,this.modalService=l,this.scrollPosition=g,this.route=w,this.search$=new me(""),this.entries$=M([this.state.presenceControlEntriesByGroup$,this.search$]).pipe(u(([F,Se])=>vn(F,lo,Se)),E(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(i=>this.lessonPresencesUpdateService.updatePresenceType(t,i?i.Id:null)))}togglePresenceType(e){this.blockLessons.getBlockLessonPresenceControlEntries(e).pipe(O(1)).subscribe(t=>{if(t.length===1){let i=t[0];this.doTogglePresenceType([i])}else{let i=this.modalService.open(Qn);i.componentInstance.entry=e,i.componentInstance.blockPresenceControlEntries=t,i.result.then(o=>{o&&this.doTogglePresenceType(o)},()=>{})}})}updateIncident(e,t){this.lessonPresencesUpdateService.updatePresenceType(e,t)}changeIncident(e){this.presenceTypesService.incidentTypes$.subscribe(t=>{let i=this.modalService.open(Xn);i.componentInstance.incident=t.find(o=>o.Id===e.presenceType?.Id)||null,i.componentInstance.incidentTypes=t,i.result.then(o=>{this.updateIncident(e,o?.Id||null)},()=>{})})}restoreStateFromParams(e){e.date&&this.state.setDate(Bt(e.date));let t=String(e.lesson);t&&this.state.setLessonId(t),e.viewMode&&Un.includes(e.viewMode)&&this.state.setViewMode(e.viewMode)}static{this.\u0275fac=function(t){return new(t||n)(h(N),h(Ze),h(et),h(ve),h(ye),h(Sn),h(Ae))}}static{this.\u0275cmp=D({type:n,selectors:[["bkd-presence-control-list"]],decls:12,vars:16,consts:[[3,"searchChange","viewModeChange","selectDateChange","selectLessonChange","selectedLesson","lessons","presentCount","absentCount","unapprovedCount","absentPrecedingCount","viewMode","selectDate","search"],[1,"mt-3"],[3,"class"],[3,"entry","hasUnconfirmedAbsences","viewMode","showClassName","profileReturnParams"],[3,"togglePresenceType","changeIncident","entry","hasUnconfirmedAbsences","viewMode","showClassName","profileReturnParams"]],template:function(t,i){if(t&1&&(G(0),p(1,"async"),G(2),p(3,"async"),G(4),p(5,"async"),c(6,"h1"),d(7),p(8,"translate"),a(),L(9,oo,1,0,"bkd-spinner"),p(10,"async"),L(11,po,11,24)),t&2){let o;Y(m(1,2,i.state.selectedLesson$)),s(2),Y(m(3,5,i.state.lessons$)),s(2),Y((o=m(5,8,i.entries$))!==null&&o!==void 0?o:ke(15,no)),s(3),I(m(8,11,"presence-control.title")),s(2),k(m(10,13,i.state.loading$)?9:11)}},dependencies:[Jn,zn,be,ie,V],styles:["bkd-presence-control-entry[_ngcontent-%COMP%]{border-bottom:1px solid #dee2e6}.entries.view-mode-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fill,minmax(400px,1fr))}.entries.view-mode-grid[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{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})}}return n})();var ti=(()=>{class n{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()}static{this.\u0275fac=function(t){return new(t||n)(h(N),h(et))}}static{this.\u0275cmp=D({type:n,selectors:[["bkd-presence-control"]],features:[ue([N,Ze,ae,on,{provide:zt,useExisting:N}])],decls:1,vars:0,template:function(t,i){t&1&&W(0,"router-outlet")},dependencies:[Et],encapsulation:2,changeDetection:0})}}return n})();var sc=[{path:"",component:ti,children:[{path:"",component:ei,data:{restoreScrollPositionFrom:["/presence-control/student/:id/addresses","/presence-control/student/:id/absences","/presence-control/student/:id/grades"]}},Cn,{path:"groups/:id",component:Wn}]}];export{sc as PRESENCE_CONTROL_ROUTES}; +import{a as pe,b as Pe}from"./chunk-DJH5AAGM.js";import{a as bn}from"./chunk-ZCHQQKGF.js";import{a as _n,b as vn}from"./chunk-QB4DIFWS.js";import{b as Pn}from"./chunk-6XR42WAQ.js";import{a as Cn}from"./chunk-THL2WTJD.js";import{e as fn}from"./chunk-5WNFCBTP.js";import{q as gn,v as ye}from"./chunk-LASWC23V.js";import{a as ct}from"./chunk-HCNFZOWE.js";import{b as zt,c as Xt,e as Qe}from"./chunk-746ASKQ4.js";import{a as rn}from"./chunk-DTTSX64G.js";import"./chunk-Y4QYVF5K.js";import"./chunk-AYQPMCNZ.js";import{a as yn}from"./chunk-BIDSHCYH.js";import{c as at,g as un}from"./chunk-Z4YBXGVO.js";import{a as cn}from"./chunk-3L4RH6QP.js";import{a as an,b as pn}from"./chunk-DTYYCJHM.js";import"./chunk-XAZECV42.js";import{a as Sn}from"./chunk-3P6YOVUR.js";import{A as en,B as tn,C as rt,H as nn,L as on,P as ve,Q as sn,S as st,U as hn,g as Jt,p as Yt,u as Zt,v as He,z as qe}from"./chunk-SRCW6BUG.js";import{j as z,l as se}from"./chunk-GOGVGWFJ.js";import{b as ce}from"./chunk-OSOXMODN.js";import{a as We,b as be,f as ln,g as dn,h as mn}from"./chunk-PSYDBHTH.js";import{h as At,i as Rt,j as Ge,k as Gt,l as Nt,m as Ut,o as Ht,p as qt,q as Le,r as re,w as Kt,y as Ue}from"./chunk-W4U7QKJF.js";import{a as _e}from"./chunk-AVBHFGIF.js";import{$a as a,$b as Ot,Ab as G,Ad as oe,B as ht,Bb as Y,C as Ct,Cb as Q,Cd as ot,D as tt,Db as ue,Eb as ke,F as O,Fb as ne,Ga as D,Gb as $t,H as Be,Hd as Ne,Id as $e,Jb as p,K as _t,Kb as m,L as vt,Lb as U,M as E,Md as Wt,N as nt,Na as L,O as je,Od as K,P as T,Pd as V,Qa as x,R as q,Ra as J,Rd as Qt,Sa as Pt,Ta as Ve,Tc as Bt,Va as k,X as R,Xa as St,Xb as Dt,Ya as B,Za as j,_,_a as c,a as le,ab as W,b as de,cc as ie,cd as H,da as bt,dc as ge,ea as v,eb as S,f as $,fa as b,fd as jt,g as me,gb as C,h as we,hb as f,ia as yt,id as Vt,jc as it,jd as fe,kd as he,l as Z,lb as X,lc as Fe,ma as te,md as Ft,n as u,nb as xt,nd as Ce,o as M,ob as It,pb as wt,qb as Mt,rb as d,s as Me,sb as I,tb as y,u as ft,ub as Tt,vb as kt,w as ee,wb as Lt,wc as Ae,x as Te,xa as s,xc as Et,ya as h,zc as Re}from"./chunk-2W7IS4PN.js";function xn(n,r){return+z(n)<+z(r)}function In(n,r){return+z(n)==+z(r)}function wn(n,r,e){let t=+z(n,e?.in),[i,o]=[+z(r.start,e?.in),+z(r.end,e?.in)].sort((l,g)=>l-g);return t>=i&&t<=o}function Mn(n,r,e){let t=r.map(o=>({eventId:o,group:n})),i=e.map(o=>t.find(l=>l.eventId===o.eventId)||o);return[...new Set([...i,...t])].filter(o=>o.group!==null)}var Ke=(()=>{class n extends nn{static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=yt(n)))(i||n)}})()}static{this.\u0275prov=R({token:n,factory:n.\u0275fac})}}return n})();function Tn(n,r){return[...n].sort(oi(r))}function oi(n){return(r,e)=>{switch(n.primarySortKey){case"name":{let t=r.name.localeCompare(e.name);return n.ascending?t*-1:t}case"group":{let t=(r.detail.Value||"").localeCompare(e.detail.Value||"");return n.ascending?t*-1:t}}}}function kn(n,r){return n.map(e=>ri(e,r))}function ri(n,r){return{id:n.IdPerson,name:r.find(e=>e.StudentRef.Id===n.IdPerson)?.StudentFullName||"",group:n.Value,detail:n}}function Ln(n,r){return n.filter(e=>e.VssId===r.subscriptionDetailGroupId)}function pt(n,r){return n.find(e=>e.VssId===r.subscriptionDetailGroupId)}var si=(n,r)=>r.id;function ci(n,r){if(n&1){let e=S();c(0,"div",1)(1,"input",5),C("change",function(){let i=v(e).$implicit,o=f();return b(o.onSelectionChange(i))}),a(),c(2,"label",6),d(3),a()()}if(n&2){let e=r.$implicit,t=r.$index,i=f();s(),X("id","group-",t,""),x("checked",e.id===i.selected.id)("value",e.id),s(),X("for","group-",t,""),s(),y(" ",e.label," ")}}var De=function(n){return n.Select="select",n.Assign="assign",n}(De||{}),$n=(()=>{class n{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===De.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}static{this.\u0275fac=function(t){return new(t||n)(h(re),h(K))}}static{this.\u0275cmp=D({type:n,selectors:[["bkd-presence-control-group-dialog"]],inputs:{dialogMode:"dialogMode",subscriptionDetailsDefinitions:"subscriptionDetailsDefinitions",group:"group"},decls:14,vars:9,consts:[[1,"modal-body"],[1,"form-check"],[1,"modal-footer"],["type","button",1,"btn","btn-outline-secondary",3,"click"],["type","button",1,"btn","btn-primary",3,"click"],["type","radio","name","groups",1,"form-check-input",3,"change","id","checked","value"],[1,"form-check-label",3,"for"]],template:function(t,i){t&1&&(c(0,"div",0)(1,"p"),d(2),p(3,"translate"),a(),c(4,"form"),B(5,ci,4,7,"div",1,si),a()(),c(7,"div",2)(8,"button",3),C("click",function(){return i.activeModal.dismiss()}),d(9),p(10,"translate"),a(),c(11,"button",4),C("click",function(){return i.activeModal.close(i.getSelectedGroup())}),d(12),p(13,"translate"),a()()),t&2&&(s(2),y(" ",m(3,3,i.title)," "),s(3),j(i.groupOptions),s(4),y(" ",m(10,5,"presence-control.groups.cancel")," "),s(3),y(" ",m(13,7,"presence-control.groups.save")," "))},dependencies:[oe,Ce,fe,he,V],encapsulation:2})}}return n})();function Dn(n,r){return n===null&&r===null||n!==null&&r!==null&&n.TeacherInformation===r.TeacherInformation&&n.LessonDateTimeFrom.getTime()===r.LessonDateTimeFrom.getTime()&&n.LessonDateTimeTo.getTime()===r.LessonDateTimeTo.getTime()}function On(n){let r=new dt(n.TeacherInformation,n.LessonDateTimeFrom,n.LessonDateTimeTo);return r.addLesson(n),r}var dt=class{constructor(r,e,t){this.TeacherInformation=r,this.LessonDateTimeFrom=e,this.LessonDateTimeTo=t,this.lessons=[]}addLesson(r){this.lessons.some(e=>qe(e,r))||(this.lessons.push(r),this.updateId(),this.updateStudyClassNumbers(),this.updateEventDesignations())}getIds(){return[...new Set(this.lessons.map(r=>r.LessonRef.Id))]}getEventIds(){return[...new Set(this.lessons.map(r=>r.EventRef.Id))]}updateId(){this.id=[...new Set(this.lessons.map(r=>r.LessonRef.Id).sort())].join("-")}updateStudyClassNumbers(){this.studyClassNumbers=[...new Set(this.lessons.map(r=>r.StudyClassNumber).sort((r,e)=>r.localeCompare(e)))].join(", ")}updateEventDesignations(){this.eventDesignations=[...new Set(this.lessons.map(r=>r.EventDesignation).sort())].join(", ")}};function En(n){return ai(n).reduce((r,e)=>{let t=r.find(o=>Dn(o,e));if(t)return t.addLesson(e),r;let i=On(e);return[...r,i]},[]).sort(rt)}function Bn(n){if(n.length===0)return null;let r=new Date;if(n=[...n].sort(rt),Xt(r,n[0].LessonDateTimeFrom)){for(let e of n)if(xn(r,e.LessonDateTimeFrom)||wn(r,{start:e.LessonDateTimeFrom,end:e.LessonDateTimeTo}))return e;return n[n.length-1]}return n[0]}function ai(n){return n.reduce((r,e)=>r.some(t=>qe(t,e))?r:[...r,e],[])}function jn(n,r,e,t){return n.map(i=>{let o=r.find(l=>pi(l.presence,i));if(o){let l;return!o.newPresenceTypeId&&i.Comment?l=e.find(g=>g.IsComment)||null:l=e.find(g=>g.Id===o.newPresenceTypeId)||null,de(le({},i),{TypeRef:li(l),Date:null,Type:l?l.Designation:null,ConfirmationStateId:He(l,t)})}return i})}function pi(n,r){return n.LessonRef.Id===r.LessonRef.Id&&n.StudentRef.Id===r.StudentRef.Id}function li(n){return{Id:n?n.Id:null,HRef:null}}function Xe(n){return r=>r.reduce((e,t)=>e+(t.presenceCategory===n?1:0),0)}function Vn(){return n=>n.reduce((r,e)=>r+(e.precedingAbsences&&e.precedingAbsences.length>0?1:0),0)}var Fn=(()=>{class n extends We{constructor(e,t){super(e,t,at,"LessonTeachers")}loadOtherTeachersLessonAbsences(e,t,i){let o=`${this.baseUrl}/except/${e}/LessonAbsences?expand=LessonRef`;return t&&t.length>0&&(o=o.concat("&filter.StudentRef=;"+t.join(";"))),this.http.get(o,{params:i}).pipe(T(Wt(at)))}static{this.\u0275fac=function(t){return new(t||n)(_(Fe),_(H))}}static{this.\u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var Ye=(()=>{class n extends We{constructor(e,t){super(e,t,gn,"SubscriptionDetails")}getListForEvent(e){return this.getList({params:{IdEvent:String(e)}})}update(e,t){let i={IdPerson:t.IdPerson,EventId:t.EventId,Value:e};return this.http.put(`${this.baseUrl}/${t.Id}`,i).pipe(u(()=>{}))}static{this.\u0275fac=function(t){return new(t||n)(_(Fe),_(H))}}static{this.\u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var Rn="presence-control-group",ae=(()=>{class n{constructor(e,t,i,o,l){this.userSettings=e,this.eventService=t,this.subscriptionDetailsService=i,this.loadingService=o,this.settings=l,this.selectGroup$=new $,this.selectedLesson$=new we,this.lessonPresences$=new we,this.reloadSubscriptionDetails$=new $,this.defaultGroup=null,this.savedGroup$=this.selectedLesson$.pipe(T(g=>this.userSettings.getPresenceControlGroupView().pipe(u(w=>this.findGroupByLesson(w,g))))),this.group$=ee(this.selectGroup$,this.savedGroup$).pipe(je(this.defaultGroup),E(1)),this.loading$=this.loadingService.loading(Rn),this.subscriptionDetailsDefinitions$=this.selectedLesson$.pipe(u(g=>g?.getEventIds()||[]),T(g=>Me(g.map(w=>this.eventService.getSubscriptionDetailsDefinitions(w)))),E(1)),this.groupsAvailability$=this.subscriptionDetailsDefinitions$.pipe(u(g=>g.every(w=>pt(w,this.settings))),E(1)),this.subscriptionDetails$=M([this.selectedLesson$,this.groupsAvailability$,this.reloadSubscriptionDetails$.pipe(u(()=>!1),je(!0))]).pipe(T(([g,w,F])=>g&&w?this.loadSubscriptionDetailsForLesson(g,F):Z([])),u(g=>Ln(g,this.settings)),E(1)),this.subscriptionDetailPersonIds$=M([this.group$,this.subscriptionDetails$]).pipe(u(([g,w])=>w.filter(F=>F.Value===g).map(F=>F.IdPerson)),je([]))}selectGroup(e){this.selectGroup$.next(e)}setSelectedLesson(e){this.selectedLesson$.next(e)}setLessonPresences(e){this.lessonPresences$.next(e)}getSubscriptionDetailsDefinitions(){return this.subscriptionDetailsDefinitions$.pipe(u(ot),u(e=>pt(e,this.settings)))}getSubscriptionDetailsForStudents(){return M([this.subscriptionDetails$,this.lessonPresences$]).pipe(u(se(kn)))}reloadSubscriptionDetails(){this.reloadSubscriptionDetails$.next(void 0)}loadSubscriptionDetailsForLesson(e,t=!0){return this.loadingService.load(Me($e(e.getEventIds()).map(i=>this.subscriptionDetailsService.getListForEvent(i))),t?void 0:Rn).pipe(u(ot))}findGroupByLesson(e,t){return e.find(o=>o.eventId===t?.getEventIds()[0])?.group||this.defaultGroup}static{this.\u0275fac=function(t){return new(t||n)(_(Pe),_(bn),_(Ye),_(ce),_(H))}}static{this.\u0275prov=R({token:n,factory:n.\u0275fac})}}return n})();var Un=Object.values(pe),N=(()=>{class n{constructor(e,t,i,o,l,g,w,F,Se,xe){this.userSettings=e,this.lessonPresencesService=t,this.lessonTeacherService=i,this.presenceTypesService=o,this.groupService=l,this.dropDownItemsService=g,this.loadingService=w,this.storageService=F,this.settings=Se,this.location=xe,this.selectedDateSubject$=new me(new Date),this.selectedDate$=this.selectedDateSubject$.asObservable().pipe(u(P=>Jt(P)),Be(Ne)),this.viewModeSubject$=new $,this.viewMode$=ee(this.viewModeSubject$,this.userSettings.getPresenceControlViewMode().pipe(O(1))),this.lessons$=this.selectedDate$.pipe(T(P=>this.loadLessonsByDate(P)),E(1)),this.selectLessonId$=new $,this.selectLesson$=this.selectLessonId$.pipe(T(P=>this.getLessonById(P))),this.selectedLesson$=M([ln(this.selectLesson$.pipe(Be((P,Ie)=>Ne(P,Ie))),dn(this.settings.lessonPresencesRefreshTime)),this.lessons$]).pipe(u(([P,Ie])=>Ie.find(ni=>ni.id===P.id)?P:null),E(1)),this.studyClassCount$=this.selectedLesson$.pipe(u(P=>P?.lessons.length||0)),this.updateLessonPresences$=new $,this.reloadLessonPresences$=new $,this.lessonPresences$=ee(mn(this.selectedLesson$,this.reloadLessonPresences$).pipe(T(P=>P?this.loadLessonPresencesByLesson(P):Z([]))),this.updateLessonPresences$).pipe(E(1)),this.presenceTypes$=this.loadPresenceTypes().pipe(E(1)),this.reloadStudentIdsWithUnconfirmedAbsences$=new $,this.studentIdsWithUnconfirmedAbsences$=ee(this.selectedDate$,this.selectedLesson$.pipe(nt(1)),this.reloadStudentIdsWithUnconfirmedAbsences$).pipe(T(()=>this.loadStudentIdsWithUnconfirmedAbsences()),E(1)),this.loading$=this.loadingService.loading$,this.absenceConfirmationStates$=this.dropDownItemsService.getAbsenceConfirmationStates().pipe(E(1)),this.studentIds$=this.lessonPresences$.pipe(u(P=>$e(P.map(Ie=>Ie.StudentRef.Id))),E(1)),this.otherTeachersAbsences$=this.studentIds$.pipe(Be(Ne),T(P=>P.length>0?this.lessonTeacherService.loadOtherTeachersLessonAbsences(this.getMyself(),P):Z([])),E(1)),this.groupsAvailability$=this.groupService.groupsAvailability$,this.presenceControlEntries$=M([this.selectedLesson$,this.lessonPresences$,this.presenceTypes$,this.absenceConfirmationStates$,this.otherTeachersAbsences$]).pipe(u(se(en))),this.presenceControlEntriesByGroup$=M([this.groupService.group$,this.presenceControlEntries$,this.groupService.subscriptionDetailPersonIds$]).pipe(u(se(Pn)),E(1)),this.presentCount$=this.presenceControlEntriesByGroup$.pipe(u(Xe("present"))),this.absentCount$=this.presenceControlEntriesByGroup$.pipe(u(Xe("absent"))),this.unapprovedCount$=this.presenceControlEntriesByGroup$.pipe(u(Xe("unapproved"))),this.absentPrecedingCount$=this.presenceControlEntriesByGroup$.pipe(u(Vn())),this.queryParamsString$=M([this.selectedDate$,this.selectedLesson$,this.viewMode$]).pipe(u(se(this.buildQueryParams.bind(this))),u(pn)),this.destroy$=new $,this.queryParamsString$.pipe(q(this.destroy$)).subscribe(P=>{this.location.replaceState("/presence-control",P),this.confirmBackLinkParams={returnparams:P}}),this.viewMode$.pipe(nt(1),T(P=>this.userSettings.savePresenceControlViewMode(P)),q(this.destroy$)).subscribe(),this.selectedLesson$.pipe(q(this.destroy$)).subscribe(P=>{this.groupService.setSelectedLesson(P)}),this.lessonPresences$.pipe(q(this.destroy$)).subscribe(P=>this.groupService.setLessonPresences(P))}ngOnDestroy(){this.destroy$.next()}setDate(e){this.selectedDateSubject$.next(e)}setLessonId(e){this.selectLessonId$.next(e)}setViewMode(e){this.viewModeSubject$.next(e)}updateLessonPresencesTypes(e){M([this.lessonPresences$.pipe(O(1)),this.presenceTypes$.pipe(O(1))]).pipe(u(([t,i])=>jn(t,e,i,this.settings))).subscribe(t=>this.updateLessonPresences$.next(t))}getNextPresenceType(e){return this.presenceTypes$.pipe(O(1),u(t=>e.getNextPresenceType(t)))}hasUnconfirmedAbsences(e){return this.studentIdsWithUnconfirmedAbsences$.pipe(u(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(u(En))}loadPresenceTypes(){return this.loadingService.load(this.presenceTypesService.presenceTypes$)}loadStudentIdsWithUnconfirmedAbsences(){return ft(0,this.settings.unconfirmedAbsencesRefreshTime||-1).pipe(T(()=>this.lessonPresencesService.getListOfUnconfirmed()),u(e=>$e(e.map(t=>t.StudentRef.Id))))}buildQueryParams(e,t,i){let o={date:Yt(e,"yyyy-MM-dd"),viewMode:i};return t&&(o.lesson=String(t.id)),o}getLessonById(e){let t=String(e);return this.lessons$.pipe(u(i=>t&&i.find(o=>o.id===t)||Bn(i)),Te(Boolean))}getMyself(){let e=this.storageService.getPayload();return Number(e?.holder_id||e?.id_person)}static{this.\u0275fac=function(t){return new(t||n)(_(Pe),_(Qe),_(Fn),_(ve),_(ae),_(rn),_(ce),_(Qt),_(H),_(Dt))}}static{this.\u0275prov=R({token:n,factory:n.\u0275fac})}}return n})();var fi=(n,r)=>r.id,hi=()=>[],Ci=()=>["/presence-control"];function _i(n,r){if(n&1&&(c(0,"span",12),d(1),a()),n&2){let e=f().$implicit,t=f(),i=Q(0);s(),I(t.getSortDirectionCharacter(i,e))}}function vi(n,r){if(n&1){let e=S();c(0,"div",11),C("click",function(){let i=v(e).$implicit,o=f();return b(o.toggleSort(i))}),d(1),p(2,"translate"),L(3,_i,2,1,"span",12),a()}if(n&2){let e=r.$implicit;f();let t=Q(0);x("className",e),s(),y(" ",m(2,3,"presence-control.groups.list.header."+e)," "),s(2),k(t?3:-1)}}function bi(n,r){n&1&&W(0,"bkd-spinner")}function yi(n,r){n&1&&W(0,"bkd-spinner",18)}function Pi(n,r){if(n&1){let e=S();c(0,"div",13)(1,"div",14)(2,"input",15,0),p(4,"async"),C("change",function(){let i=v(e).$implicit,o=f(2);return b(o.selectionService.toggle(i))}),a()(),c(5,"div",16),d(6),a(),c(7,"div",17)(8,"span"),d(9),a(),L(10,yi,1,0,"bkd-spinner",18),p(11,"async"),a()()}if(n&2){let e=r.$implicit,t=f(2);s(2),x("checked",m(4,4,t.selectionService.isSelected$(e))),s(4),y(" ",e.name," "),s(3),I(e.group?e.group:""),s(),k(m(11,6,t.groupService.loading$)?10:-1)}}function Si(n,r){if(n&1&&B(0,Pi,12,8,"div",13,fi),n&2){f();let e=Q(2);j(e)}}var Wn=(()=>{class n{constructor(e,t,i,o,l,g,w,F,Se){this.route=e,this.state=t,this.selectionService=i,this.groupService=o,this.userSettings=l,this.subscriptionDetailService=g,this.toastService=w,this.translate=F,this.modalService=Se,this.primarySortKeys=["name","group"],this.backlinkQueryParams$=this.route.queryParams.pipe(u(({returnparams:xe})=>xe),u(an)),this.eventIds$=this.state.selectedLesson$.pipe(u(xe=>xe?.getEventIds()||[])),this.sortCriteriaSubject$=new me({primarySortKey:"name",ascending:!1}),this.sortCriteria$=this.sortCriteriaSubject$.asObservable(),this.sortedEntries$=M([this.groupService.getSubscriptionDetailsForStudents(),this.sortCriteria$]).pipe(u(se(Tn))),this.selected=[]}ngOnInit(){this.selectionService.selection$.subscribe(e=>this.selected=e)}selectGroup(){this.openGroupModal(De.Select,this.selectCallback.bind(this))}assignGroup(){this.openGroupModal(De.Assign,this.assignCallback.bind(this))}openGroupModal(e,t){M([this.groupService.getSubscriptionDetailsDefinitions(),this.groupService.group$]).pipe(O(1)).subscribe(([i,o])=>{let l=this.modalService.open($n);l.componentInstance.dialogMode=e,l.componentInstance.subscriptionDetailsDefinitions=i,l.componentInstance.group=o,l.result.then(g=>{t(g)},()=>{})})}selectCallback(e){M([this.eventIds$,this.userSettings.getPresenceControlGroupView()]).pipe(O(1),T(([t,i])=>this.userSettings.savePresenceControlGroupView(Mn(e.id,t,i))),u(()=>e.id)).subscribe(t=>this.groupService.selectGroup(t))}assignCallback(e){Me(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(O(1)).subscribe(t=>{t.primarySortKey===e?this.sortCriteriaSubject$.next({primarySortKey:e,ascending:!t.ascending}):this.sortCriteriaSubject$.next({primarySortKey:e,ascending:e==="name"})})}static{this.\u0275fac=function(t){return new(t||n)(h(Ae),h(N),h(Ke),h(ae),h(Pe),h(Ye),h(_e),h(K),h(ye))}}static{this.\u0275cmp=D({type:n,selectors:[["bkd-presence-control-group"]],features:[ue([Ke])],decls:33,vars:32,consts:[["checkbox",""],[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"],[3,"click","className"],[1,"sort-direction"],[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"],[1,"inline","small"]],template:function(t,i){if(t&1){let o=S();G(0),p(1,"async"),G(2),p(3,"async"),G(4),p(5,"async"),G(6),p(7,"async"),c(8,"div"),W(9,"bkd-backlink",1),p(10,"async"),c(11,"h1"),d(12),p(13,"translate"),a(),c(14,"div",2)(15,"div",3)(16,"span",4),d(17),p(18,"translate"),a(),c(19,"button",5),C("click",function(){return v(o),b(i.selectGroup())}),d(20),p(21,"translate"),p(22,"translate"),a()(),c(23,"a",6),C("click",function(){return v(o),b(i.assignGroup())}),c(24,"i",7),d(25,"edit"),a()()(),c(26,"div",8)(27,"div",9),B(28,vi,4,5,"div",10,St),a(),L(30,bi,1,0,"bkd-spinner"),p(31,"async"),L(32,Si,2,0),a()()}if(t&2){let o;Y(m(1,8,i.sortCriteria$)),s(2),Y(m(3,11,i.sortedEntries$));let l=(o=m(5,14,i.selectionService.selection$))!==null&&o!==void 0?o:ke(30,hi),g=m(7,16,i.groupService.group$);s(7),x("link",ke(31,Ci))("params",m(10,18,i.backlinkQueryParams$)),s(3),I(m(13,20,"presence-control.groups.title")),s(5),I(m(18,22,"presence-control.groups.show")),s(3),y(" ",g?m(21,24,"presence-control.groups.group")+" "+g:m(22,26,"presence-control.groups.all")," "),s(3),J("disabled",l.length===0),s(5),j(i.primarySortKeys),s(2),k(m(31,28,i.state.loading$)?30:32)}},dependencies:[hn,be,ie,V],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})}}return n})();var xi=(n,r)=>r.entry.id;function Ii(n,r){if(n&1){let e=S();c(0,"div",1)(1,"input",5),C("change",function(){let i=v(e).$implicit;return b(i.selected=!i.selected)}),a(),c(2,"label",6)(3,"i"),d(4),a(),c(5,"div",7),d(6),p(7,"date"),p(8,"date"),a()()()}if(n&2){let e=r.$implicit,t=r.$index,i=f();s(),X("id","lesson-presence-",t,""),x("checked",e.selected),s(),J("fw-bold",i.isCurrentLesson(e)),X("for","lesson-presence-",t,""),s(),Ve("",e.entry.presenceCategory," material-icons pe-2"),s(),I(e.entry.presenceCategoryIcon),s(2),kt(" ",U(7,14,e.entry.lessonPresence.LessonDateTimeFrom,"HH:mm"),"\u2013",U(8,17,e.entry.lessonPresence.LessonDateTimeTo,"HH:mm")," ",e.entry.lessonPresence.EventDesignation," ")}}var Qn=(()=>{class n{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 In(e.entry.lessonPresence.LessonDateTimeFrom,this.entry.lessonPresence.LessonDateTimeFrom)}buildLessonPresenceOptions(){return this.blockPresenceControlEntries.map(e=>({entry:e,selected:this.entry.confirmationState===e.confirmationState}))}static{this.\u0275fac=function(t){return new(t||n)(h(re))}}static{this.\u0275cmp=D({type:n,selectors:[["bkd-presence-control-block-lesson-component"]],inputs:{entry:"entry",blockPresenceControlEntries:"blockPresenceControlEntries"},decls:15,vars:11,consts:[[1,"modal-body"],[1,"form-check"],[1,"modal-footer"],["type","button",1,"btn","btn-outline-secondary",3,"click"],["type","button",1,"btn","btn-primary",3,"click","disabled"],["type","checkbox",1,"form-check-input",3,"change","id","checked"],[1,"form-check-label","d-flex",3,"for"],[1,"d-block","text-truncate"]],template:function(t,i){if(t&1){let o=S();c(0,"div",0)(1,"p"),d(2),p(3,"translate"),a(),c(4,"form"),B(5,Ii,9,20,"div",1,xi),a()(),G(7),c(8,"div",2)(9,"button",3),C("click",function(){return v(o),b(i.activeModal.close())}),d(10),p(11,"translate"),a(),c(12,"button",4),C("click",function(){v(o);let g=Q(7);return b(i.activeModal.close(g))}),d(13),p(14,"translate"),a()()}if(t&2){s(2),y(" ",m(3,4,"presence-control.block-lesson.text")," "),s(3),j(i.blockLessonOptions),s(2);let o=Y(i.getSelectedEntries());s(3),y(" ",m(11,7,"presence-control.block-lesson.cancel")," "),s(2),x("disabled",o.length===0),s(),y(" ",m(14,9,"presence-control.block-lesson.save")," ")}},dependencies:[oe,Ce,fe,he,ge,V],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}"]})}}return n})();var wi=30;function gt(n){return`blockLesson${n.lessonPresence.Id}`}var Ze=(()=>{class n{constructor(e,t,i,o){this.state=e,this.lessonPresencesService=t,this.loadingService=i,this.settings=o}getBlockLessonPresenceControlEntries(e){return M([this.state.lessons$.pipe(O(1)),this.loadChangeableLessonPresences(e),this.state.presenceTypes$.pipe(O(1)),this.state.absenceConfirmationStates$.pipe(O(1)),this.state.otherTeachersAbsences$.pipe(O(1))]).pipe(u(([t,i,o,l,g])=>this.filterBlockLessonPresences(e,i).map(w=>tn(t.find(F=>F.id===w.LessonRef.Id.toString()),w,o,l,g))))}filterBlockLessonPresences(e,t){return[...t].sort((i,o)=>i.LessonDateTimeFrom>o.LessonDateTimeFrom?1:-1).reduce((i,o)=>{let l=i[i.length-1];return this.isWithinBlockTime(o,l)?(i.push(o),i):i.find(g=>g.Id===e.lessonPresence.Id)?i:[o]},[])}isWithinBlockTime(e,t){return t?e.LessonDateTimeFrom.getTime()-t.LessonDateTimeTo.getTime()<=wi*60*1e3:!0}loadChangeableLessonPresences(e){return M([this.loadLessonPresences(e),this.state.presenceTypes$.pipe(O(1))]).pipe(u(([t,i])=>t.filter(o=>Zt(o,i.find(l=>l.Id===o.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(u(t=>t.filter(i=>i.TeacherInformation===e.lessonPresence.TeacherInformation))),gt(e))}static{this.\u0275fac=function(t){return new(t||n)(_(N),_(Qe),_(ce),_(H))}}static{this.\u0275prov=R({token:n,factory:n.\u0275fac})}}return n})();var Ti=(n,r)=>r.Id;function ki(n,r){if(n&1&&(c(0,"div"),d(1),p(2,"date"),p(3,"date"),p(4,"addSpace"),a()),n&2){let e=r.$implicit;s(),Lt(" ",U(2,5,e.LessonRef.From,"HH:mm"),"\u2013",U(3,8,e.LessonRef.To,"HH:mm")," ",e.LessonRef.EventDesignation,"",U(4,11,":",":")," ",e.Type," ")}}var Kn=(()=>{class n{constructor(e){this.activeModal=e}static{this.\u0275fac=function(t){return new(t||n)(h(re))}}static{this.\u0275cmp=D({type:n,selectors:[["bkd-presence-control-preceding-absence"]],inputs:{precedingAbsences:"precedingAbsences"},decls:10,vars:6,consts:[[1,"modal-body"],[1,"modal-footer"],["type","button",1,"btn","btn-outline-secondary",3,"click"]],template:function(t,i){t&1&&(c(0,"div",0)(1,"p"),d(2),p(3,"translate"),a(),B(4,ki,5,14,"div",null,Ti),a(),c(6,"div",1)(7,"button",2),C("click",function(){return i.activeModal.dismiss()}),d(8),p(9,"translate"),a()()),t&2&&(s(2),y(" ",m(3,2,"presence-control.preceding-absence.text")," "),s(2),j(i.precedingAbsences),s(4),y(" ",m(9,4,"presence-control.preceding-absence.cancel")," "))},dependencies:[ge,V,un],encapsulation:2})}}return n})();var Li=n=>["student",n,"absences"],$i=n=>["/presence-control/student",n,"absences"];function Di(n,r){if(n&1&&(W(0,"bkd-avatar",0),p(1,"async")),n&2){let e=f();x("studentId",m(1,3,e.studentId$))("link",ne(5,$i,e.entry.lessonPresence.StudentRef.Id.toString()))("linkParams",e.profileReturnParams)}}function Oi(n,r){if(n&1&&(c(0,"span"),d(1),a()),n&2){let e=f(2);s(),I(e.entry.presenceType==null?null:e.entry.presenceType.Designation)}}function Ei(n,r){if(n&1){let e=S();c(0,"button",12),C("click",function(){v(e);let i=f();return b(i.updatePresenceType(i.entry))}),L(1,Oi,2,1,"span"),a()}if(n&2){let e=f();s(),k(e.entry.presenceType!=null&&e.entry.presenceType.IsIncident?-1:1)}}function Bi(n,r){n&1&&W(0,"bkd-spinner",5)}function ji(n,r){if(n&1){let e=S();c(0,"button",13),C("click",function(){v(e);let i=f();return b(i.showPrecedingAbsences(i.entry))}),c(1,"i",14),d(2,"info"),a()()}}function Vi(n,r){if(n&1&&(c(0,"span",9),d(1),a()),n&2){let e=f();s(),y(" ",e.entry.lessonPresence.StudyClassNumber," ")}}function Fi(n,r){if(n&1){let e=S();c(0,"a",15),C("click",function(){v(e);let i=f();return b(i.updateIncident(i.entry))}),c(1,"i",4),d(2,"edit"),a(),c(3,"span"),d(4),p(5,"translate"),a()()}if(n&2){let e=f();s(4),I(m(5,1,(e.entry.presenceType==null?null:e.entry.presenceType.IsIncident)&&(e.entry.presenceType==null?null:e.entry.presenceType.Designation)||"presence-control.entry.incident"))}}var zn=(()=>{class n{get classNames(){return[this.entry.presenceCategory,this.viewMode].join(" ")}constructor(e,t,i,o){this.toastService=e,this.translate=t,this.modalService=i,this.loadingService=o,this.hasUnconfirmedAbsences=!1,this.showClassName=!1,this.togglePresenceType=new te,this.changeIncident=new te,this.entry$=new we(1),this.studentId$=this.entry$.pipe(u(({lessonPresence:l})=>l.StudentRef.Id)),this.loading$=this.entry$.pipe(T(l=>this.loadingService.loading(gt(l))))}ngOnChanges(e){e.entry&&this.entry$.next(e.entry.currentValue)}get isListViewMode(){return this.viewMode===pe.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(Kn);t.componentInstance.precedingAbsences=e.precedingAbsences}static{this.\u0275fac=function(t){return new(t||n)(h(_e),h(K),h(ye),h(ce))}}static{this.\u0275cmp=D({type:n,selectors:[["bkd-presence-control-entry"]],hostVars:2,hostBindings:function(t,i){t&2&&Pt(i.classNames)},inputs:{entry:"entry",hasUnconfirmedAbsences:"hasUnconfirmedAbsences",viewMode:"viewMode",showClassName:"showClassName",profileReturnParams:"profileReturnParams"},outputs:{togglePresenceType:"togglePresenceType",changeIncident:"changeIncident"},features:[bt],decls:18,vars:20,consts:[[1,"avatar","large",3,"studentId","link","linkParams"],["type","button",1,"presence-category","designation","btn","btn-link"],["type","button",1,"presence-category","status","btn","btn-link",3,"click","disabled"],[1,"position-relative"],[1,"material-icons"],[1,"inline","small"],["type","button",1,"previously-absent","d-flex","btn","btn-link"],[1,"student-info",3,"routerLink","queryParams"],[1,"student-name","text-truncate"],[1,"study-class","text-truncate"],[1,"unconfirmed-absences"],[1,"incident","btn","btn-link"],["type","button",1,"presence-category","designation","btn","btn-link",3,"click"],["type","button",1,"previously-absent","d-flex","btn","btn-link",3,"click"],[1,"material-icons-outlined"],[1,"incident","btn","btn-link",3,"click"]],template:function(t,i){if(t&1){let o=S();L(0,Di,2,7,"bkd-avatar",0)(1,Ei,2,1,"button",1),G(2),p(3,"async"),c(4,"button",2),C("click",function(){return v(o),b(i.updatePresenceType(i.entry))}),c(5,"div",3)(6,"i",4),d(7),a(),L(8,Bi,1,0,"bkd-spinner",5),a()(),L(9,ji,3,0,"button",6),c(10,"a",7)(11,"span",8),d(12),a(),L(13,Vi,2,1,"span",9),c(14,"span",10),d(15),p(16,"translate"),a()(),L(17,Fi,6,3,"a",11)}if(t&2){k(i.isListViewMode?-1:0),s(),k(i.entry.showDesignation?1:-1);let o=m(3,14,i.loading$);s(3),x("disabled",o),s(2),J("invisible",o),s(),I(i.entry.presenceCategoryIcon),s(),k(o?8:-1),s(),k(i.entry.precedingAbsences!=null&&i.entry.precedingAbsences.length?9:-1),s(),x("routerLink",ne(18,Li,i.entry.lessonPresence.StudentRef.Id))("queryParams",i.profileReturnParams),s(2),I(i.entry.lessonPresence.StudentFullName),s(),k(i.isListViewMode&&i.showClassName?13:-1),s(2),y(" ",i.hasUnconfirmedAbsences?m(16,16,"presence-control.entry.unconfirmed-absences"):""," "),s(2),k(i.entry.canChangeIncident?17:-1)}},dependencies:[fn,be,Re,ie,V],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}}']})}}return n})();var Ai=(n,r)=>r.viewMode,Ri=(n,r)=>r.id,Gi=(n,r)=>({"btn-link":n,"btn-danger":r}),Ni=n=>["groups",n],Ui=n=>({returnparams:n});function Hi(n,r){if(n&1){let e=S();c(0,"div",22),C("click",function(){v(e);let i=f();return b(i.lessonDropdown==null?null:i.lessonDropdown.toggle())}),d(1),p(2,"date"),c(3,"span",23),d(4),p(5,"date"),a()()}if(n&2){let e=f();s(),y(" ",U(2,2,e.selectedLesson.LessonDateTimeFrom,"HH:mm"),"\u2013"),s(3),I(U(5,5,e.selectedLesson.LessonDateTimeTo,"HH:mm"))}}function qi(n,r){if(n&1){let e=S();c(0,"div",28),C("click",function(){let i=v(e).$implicit,o=f(2);return b(o.selectLessonChange.emit(i))}),c(1,"div",29)(2,"div"),d(3),p(4,"date"),p(5,"date"),a(),c(6,"div",25),d(7),a(),c(8,"div",25),d(9),a()()()}if(n&2){let e=r.$implicit,t=f(2);J("active",e.id===t.selectedLesson.id),s(3),Tt(" ",U(4,6,e.LessonDateTimeFrom,"HH:mm"),"\u2013",U(5,9,e.LessonDateTimeTo,"HH:mm")," "),s(4),y(" ",e.eventDesignations," "),s(2),y(" ",e.studyClassNumbers," ")}}function Wi(n,r){if(n&1&&(c(0,"div",7)(1,"div",24)(2,"div",25),d(3),a(),c(4,"div",25),d(5),a()(),c(6,"div",26),B(7,qi,10,12,"div",27,Ri),a()()),n&2){let e=f();s(3),I(e.selectedLesson.eventDesignations),s(2),I(e.selectedLesson.studyClassNumbers),s(2),j(e.lessons)}}function Qi(n,r){if(n&1){let e=S();c(0,"bkd-caret",30),C("click",function(){v(e);let i=f();return b(i.lessonDropdown==null?null:i.lessonDropdown.toggle())}),a()}if(n&2){let e=f();x("expanded",(e.lessonDropdown==null?null:e.lessonDropdown.isOpen())||!1)}}function Ki(n,r){if(n&1&&(c(0,"a",19),p(1,"async"),p(2,"async"),p(3,"async"),c(4,"i",31),d(5,"groups"),a()()),n&2){let e=f();x("ngClass",$t(9,Gi,m(1,3,e.isGroupSelected$)===!1,m(2,5,e.isGroupSelected$)))("routerLink",ne(12,Ni,e.selectedLesson.id))("queryParams",ne(14,Ui,m(3,7,e.state.queryParamsString$)))}}function zi(n,r){if(n&1){let e=S();c(0,"button",32),C("click",function(){let i=v(e).$implicit,o=f();return b(o.viewModeChange.emit(i.viewMode))}),c(1,"i",31),d(2),a()()}if(n&2){let e=r.$implicit,t=f();J("btn-outline-secondary",e.viewMode===t.viewMode)("btn-link",e.viewMode!==t.viewMode)("active",e.viewMode===t.viewMode),x("disabled",!t.selectedLesson),s(2),I(e.icon)}}var Ji=Le.prototype._positionMenu;Le.prototype._positionMenu=function(...r){let e=Ji.apply(this,r);if(this._anchor.nativeElement.id==="lesson-dropdown"){let t=this._bodyContainer||this._menu.nativeElement,i=t.style.transform?.match(/translate\(([0-9-.]+)px, ([0-9-.]+)px\)/);i&&parseFloat(i[1])<0&&(t.style.transform=`translate(0px, ${i[2]}px)`)}return e};var Jn=(()=>{class n{constructor(e,t,i){this.state=e,this.groupService=t,this.presentCount=null,this.absentCount=null,this.unapprovedCount=null,this.absentPrecedingCount=null,this.search="",this.selectLessonChange=new te,this.selectDateChange=new te,this.searchChange=new te,this.viewModeChange=new te,this.viewModeOptions=[{viewMode:pe.List,icon:"list"},{viewMode:pe.Grid,icon:"view_module"}],this.isGroupSelected$=this.groupService.group$.pipe(u(Kt)),i.popperOptions=o=>de(le({},o),{modifiers:o.modifiers?.map(l=>(l.name==="offset"&&(l.options={offset:({placement:g,reference:w,popper:F})=>g==="bottom-start"?[(window.innerWidth-F.width)/2-w.x,0]:[]}),l))})}static{this.\u0275fac=function(t){return new(t||n)(h(N),h(ae),h(Ge))}}static{this.\u0275cmp=D({type:n,selectors:[["bkd-presence-control-header"]],viewQuery:function(t,i){if(t&1&&xt(Le,5),t&2){let o;It(o=wt())&&(i.lessonDropdown=o.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"},features:[ue([Ge,{provide:At,useClass:Nt},{provide:Rt,useClass:yn}])],decls:41,vars:19,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"],[1,"lesson-time"],["ngbDropdown","","container","body","display","dynamic","placement","bottom",1,"lesson-description"],[1,"dropdown-caret",3,"expanded"],[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",1,"group","btn","me-2","me-sm-4",3,"ngClass","routerLink","queryParams"],[1,"views"],["type","button",1,"view","btn","btn-primary","btn-icon",3,"disabled","btn-outline-secondary","btn-link","active"],[1,"lesson-time",3,"click"],[1,"lesson-time-to"],["id","lesson-dropdown","ngbDropdownToggle",""],[1,"text-truncate"],["ngbDropdownMenu","","aria-labelledby","lesson-dropdown"],["ngbDropdownItem","",3,"active"],["ngbDropdownItem","",3,"click"],[1,"lesson-entry"],[1,"dropdown-caret",3,"click","expanded"],[1,"material-icons","align-middle"],["type","button",1,"view","btn","btn-primary","btn-icon",3,"click","disabled"]],template:function(t,i){if(t&1){let o=S();c(0,"div",1)(1,"div",2)(2,"button",3),C("click",function(){v(o);let g=Mt(6);return b(g.toggle())}),c(3,"i",4),d(4,"calendar_today"),a()(),c(5,"input",5,0),C("ngModelChange",function(g){return v(o),b(i.selectDateChange.emit(g))}),a()(),L(7,Hi,6,8,"div",6)(8,Wi,9,2,"div",7)(9,Qi,1,1,"bkd-caret",8),a(),c(10,"div",9)(11,"div",10)(12,"i",4),d(13,"check_circle"),a(),c(14,"span",11),d(15),a()(),c(16,"div",12)(17,"i",4),d(18,"cancel"),a(),c(19,"span",11),d(20),a()(),c(21,"div",13)(22,"i",4),d(23,"help"),a(),c(24,"span",11),d(25),a()(),c(26,"div",14)(27,"i",15),d(28,"info"),a(),c(29,"span",11),d(30),a()()(),c(31,"div",16)(32,"bkd-resettable-input",17),p(33,"translate"),p(34,"translate"),C("valueChange",function(g){return v(o),b(i.searchChange.emit(g))}),a(),c(35,"div",18),L(36,Ki,6,16,"a",19),p(37,"async"),c(38,"div",20),B(39,zi,3,8,"button",21,Ai),a()()()}t&2&&(s(5),x("ngModel",i.selectDate),s(2),k(i.selectedLesson?7:-1),s(),k(i.selectedLesson?8:-1),s(),k(i.lessons.length>0?9:-1),s(6),I(i.presentCount!==null?i.presentCount:"?"),s(5),I(i.absentCount!==null?i.absentCount:"?"),s(5),I(i.unapprovedCount!==null?i.unapprovedCount:"?"),s(5),I(i.absentPrecedingCount!==null?i.absentPrecedingCount:"?"),s(2),x("value",i.search)("disabled",!i.selectedLesson)("placeholder",m(33,13,"presence-control.header.search-by-name"))("label",m(34,15,"presence-control.header.search")),s(4),k(m(37,17,i.selectedLesson&&i.state.groupsAvailability$)?36:-1),s(3),j(i.viewModeOptions))},dependencies:[Gt,oe,jt,Vt,Ft,Le,qt,Ht,Ut,cn,_n,Ot,Re,ie,ge,V],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}}']})}}return n})();var Xi=(n,r)=>r.id;function Yi(n,r){if(n&1){let e=S();c(0,"div",1)(1,"input",5),C("change",function(){let i=v(e).$implicit,o=f();return b(o.onSelectionChange(i))}),a(),c(2,"label",6),d(3),a()()}if(n&2){let e=r.$implicit,t=r.$index,i=f();s(),X("id","incident-",t,""),x("checked",e.id===i.selected.id)("value",e.id),s(),X("for","incident-",t,""),s(),y(" ",e.label," ")}}var Xn=(()=>{class n{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}static{this.\u0275fac=function(t){return new(t||n)(h(re),h(K))}}static{this.\u0275cmp=D({type:n,selectors:[["bkd-presence-control-incident"]],inputs:{incident:"incident",incidentTypes:"incidentTypes"},decls:14,vars:9,consts:[[1,"modal-body"],[1,"form-check"],[1,"modal-footer"],["type","button",1,"btn","btn-outline-secondary",3,"click"],["type","button",1,"btn","btn-primary",3,"click"],["type","radio","name","incident",1,"form-check-input",3,"change","id","checked","value"],[1,"form-check-label",3,"for"]],template:function(t,i){t&1&&(c(0,"div",0)(1,"p"),d(2),p(3,"translate"),a(),c(4,"form"),B(5,Yi,4,7,"div",1,Xi),a()(),c(7,"div",2)(8,"button",3),C("click",function(){return i.activeModal.dismiss()}),d(9),p(10,"translate"),a(),c(11,"button",4),C("click",function(){return i.activeModal.close(i.getSelectedIncident())}),d(12),p(13,"translate"),a()()),t&2&&(s(2),y(" ",m(3,3,"presence-control.incident.text")," "),s(3),j(i.incidentOptions),s(4),y(" ",m(10,5,"presence-control.incident.cancel")," "),s(3),y(" ",m(13,7,"presence-control.incident.save")," "))},dependencies:[oe,Ce,fe,he,V],styles:["form[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]:first-child{border-bottom:1px solid #dee2e6;padding-bottom:1rem;margin-bottom:1rem}"]})}}return n})();var Zi=20,eo=100,Ee=function(n){return n.AddUpdateAction="ADD",n.RemoveUpdateAction="REMOVE",n}(Ee||{}),et=(()=>{class n{constructor(e,t,i,o,l){this.toastService=e,this.translate=t,this.restService=i,this.presenceTypesService=o,this.settings=l,this.destroy$=new $,this.action$=new $,this.pendingUpdates$=this.action$.pipe(_t(this.reduceUpdates.bind(this),[]),vt()),this.revertUpdates$=new $,this.performUpdates$=this.pendingUpdates$.pipe(tt(eo),Te(Ue(st)),Ct(this.performUpdates.bind(this))),this.stateUpdates$=ee(this.pendingUpdates$,this.revertUpdates$).pipe(tt(Zi),Te(Ue(st))),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 M(Object.keys(t).reduce((i,o)=>{let l=t[o];return Object.keys(l).forEach(g=>{let w=l[g];i.push(this.performUpdateForGroup(w))}),i},[])).pipe(u(()=>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,i=null){return i?(i?this.presenceTypesService.getPresenceType(i):Z(null)).pipe(T(l=>this.restService.editLessonPresences([e],t,l?.Id,He(l,this.settings)||void 0,{context:new it().set(ct,{disableErrorHandling:!0})}))):this.restService.removeLessonPresences([e],t,{context:new it().set(ct,{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(i=>de(le({},i),{newPresenceTypeId:i.presence.TypeRef.Id}))),Z(void 0)}groupUpdates(e){return e.reduce((t,i)=>{let o=String(i.newPresenceTypeId&&i.newPresenceTypeId);return t[o]||(t[o]={}),Array.isArray(t[o][i.presence.LessonRef.Id])||(t[o][i.presence.LessonRef.Id]=[]),t[o][i.presence.LessonRef.Id].push(i),t},{})}reduceUpdates(e,t){switch(t.type){case Ee.AddUpdateAction:{let{presence:i,newPresenceTypeId:o}=t.payload,l=e.findIndex(Yn(i));return l===-1?[...e,{presence:i,newPresenceTypeId:o}]:[...e.slice(0,l),{presence:e[l].presence,newPresenceTypeId:o},...e.slice(l+1)]}case Ee.RemoveUpdateAction:return e.filter(Ue(Yn(t.payload)));default:return e}}dispatchAddUpdate(e,t){this.action$.next({type:Ee.AddUpdateAction,payload:{presence:e,newPresenceTypeId:t}})}dispatchRemoveUpdate(e){this.action$.next({type:Ee.RemoveUpdateAction,payload:e})}static{this.\u0275fac=function(t){return new(t||n)(_(_e),_(K),_(sn),_(ve),_(H))}}static{this.\u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();function Yn(n){return r=>r.presence.LessonRef.Id===n.LessonRef.Id&&r.presence.StudentRef.Id===n.StudentRef.Id}var to=(n,r)=>r.id,no=()=>[],io=n=>({returnparams:n});function oo(n,r){n&1&&W(0,"bkd-spinner")}function ro(n,r){n&1&&(c(0,"p",1),d(1),p(2,"translate"),a()),n&2&&(s(),I(m(2,1,"presence-control.no-lessons")))}function so(n,r){n&1&&(c(0,"p",1),d(1),p(2,"translate"),a()),n&2&&(s(),y(" ",m(2,1,"presence-control.no-lesson-presences")," "))}function co(n,r){if(n&1){let e=S();c(0,"bkd-presence-control-entry",4),p(1,"async"),p(2,"async"),p(3,"async"),p(4,"async"),C("togglePresenceType",function(i){v(e);let o=f(3);return b(o.togglePresenceType(i))})("changeIncident",function(i){v(e);let o=f(3);return b(o.changeIncident(i))}),a()}if(n&2){let e,t=r.$implicit,i=f(3);x("entry",t)("hasUnconfirmedAbsences",m(1,5,i.state.hasUnconfirmedAbsences(t)))("viewMode",m(2,7,i.state.viewMode$))("showClassName",((e=m(3,9,i.state.studyClassCount$))!==null&&e!==void 0?e:0)>1)("profileReturnParams",ne(13,io,m(4,11,i.state.queryParamsString$)))}}function ao(n,r){if(n&1&&(c(0,"div"),p(1,"async"),B(2,co,5,15,"bkd-presence-control-entry",3,to),a()),n&2){let e=f(2),t=Q(4);Ve("default-entries entries view-mode-",m(1,3,e.state.viewMode$),""),s(2),j(t)}}function po(n,r){if(n&1){let e=S();c(0,"bkd-presence-control-header",0),p(1,"async"),p(2,"async"),p(3,"async"),p(4,"async"),p(5,"async"),p(6,"async"),p(7,"async"),C("searchChange",function(i){v(e);let o=f();return b(o.search$.next(i))})("viewModeChange",function(i){v(e);let o=f();return b(o.state.setViewMode(i))})("selectDateChange",function(i){v(e);let o=f();return b(o.state.setDate(i))})("selectLessonChange",function(i){v(e);let o=f();return b(o.state.setLessonId(i.id))}),a(),L(8,ro,3,3,"p",1)(9,so,3,3,"p",1)(10,ao,4,5,"div",2)}if(n&2){let e=f(),t=Q(0),i=Q(2),o=Q(4);x("selectedLesson",t)("lessons",i)("presentCount",m(1,10,e.state.presentCount$))("absentCount",m(2,12,e.state.absentCount$))("unapprovedCount",m(3,14,e.state.unapprovedCount$))("absentPrecedingCount",m(4,16,e.state.absentPrecedingCount$))("viewMode",m(5,18,e.state.viewMode$))("selectDate",m(6,20,e.state.selectedDate$))("search",m(7,22,e.search$)),s(8),k(t?o.length===0?9:10:8)}}var lo=["studentFullName"],ei=(()=>{class n{constructor(e,t,i,o,l,g,w){this.state=e,this.blockLessons=t,this.lessonPresencesUpdateService=i,this.presenceTypesService=o,this.modalService=l,this.scrollPosition=g,this.route=w,this.search$=new me(""),this.entries$=M([this.state.presenceControlEntriesByGroup$,this.search$]).pipe(u(([F,Se])=>vn(F,lo,Se)),E(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(i=>this.lessonPresencesUpdateService.updatePresenceType(t,i?i.Id:null)))}togglePresenceType(e){this.blockLessons.getBlockLessonPresenceControlEntries(e).pipe(O(1)).subscribe(t=>{if(t.length===1){let i=t[0];this.doTogglePresenceType([i])}else{let i=this.modalService.open(Qn);i.componentInstance.entry=e,i.componentInstance.blockPresenceControlEntries=t,i.result.then(o=>{o&&this.doTogglePresenceType(o)},()=>{})}})}updateIncident(e,t){this.lessonPresencesUpdateService.updatePresenceType(e,t)}changeIncident(e){this.presenceTypesService.incidentTypes$.subscribe(t=>{let i=this.modalService.open(Xn);i.componentInstance.incident=t.find(o=>o.Id===e.presenceType?.Id)||null,i.componentInstance.incidentTypes=t,i.result.then(o=>{this.updateIncident(e,o?.Id||null)},()=>{})})}restoreStateFromParams(e){e.date&&this.state.setDate(Bt(e.date));let t=String(e.lesson);t&&this.state.setLessonId(t),e.viewMode&&Un.includes(e.viewMode)&&this.state.setViewMode(e.viewMode)}static{this.\u0275fac=function(t){return new(t||n)(h(N),h(Ze),h(et),h(ve),h(ye),h(Sn),h(Ae))}}static{this.\u0275cmp=D({type:n,selectors:[["bkd-presence-control-list"]],decls:12,vars:16,consts:[[3,"searchChange","viewModeChange","selectDateChange","selectLessonChange","selectedLesson","lessons","presentCount","absentCount","unapprovedCount","absentPrecedingCount","viewMode","selectDate","search"],[1,"mt-3"],[3,"class"],[3,"entry","hasUnconfirmedAbsences","viewMode","showClassName","profileReturnParams"],[3,"togglePresenceType","changeIncident","entry","hasUnconfirmedAbsences","viewMode","showClassName","profileReturnParams"]],template:function(t,i){if(t&1&&(G(0),p(1,"async"),G(2),p(3,"async"),G(4),p(5,"async"),c(6,"h1"),d(7),p(8,"translate"),a(),L(9,oo,1,0,"bkd-spinner"),p(10,"async"),L(11,po,11,24)),t&2){let o;Y(m(1,2,i.state.selectedLesson$)),s(2),Y(m(3,5,i.state.lessons$)),s(2),Y((o=m(5,8,i.entries$))!==null&&o!==void 0?o:ke(15,no)),s(3),I(m(8,11,"presence-control.title")),s(2),k(m(10,13,i.state.loading$)?9:11)}},dependencies:[Jn,zn,be,ie,V],styles:["bkd-presence-control-entry[_ngcontent-%COMP%]{border-bottom:1px solid #dee2e6}.entries.view-mode-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fill,minmax(400px,1fr))}.entries.view-mode-grid[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{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})}}return n})();var ti=(()=>{class n{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()}static{this.\u0275fac=function(t){return new(t||n)(h(N),h(et))}}static{this.\u0275cmp=D({type:n,selectors:[["bkd-presence-control"]],features:[ue([N,Ze,ae,on,{provide:zt,useExisting:N}])],decls:1,vars:0,template:function(t,i){t&1&&W(0,"router-outlet")},dependencies:[Et],encapsulation:2,changeDetection:0})}}return n})();var sc=[{path:"",component:ti,children:[{path:"",component:ei,data:{restoreScrollPositionFrom:["/presence-control/student/:id/addresses","/presence-control/student/:id/absences","/presence-control/student/:id/grades"]}},Cn,{path:"groups/:id",component:Wn}]}];export{sc as PRESENCE_CONTROL_ROUTES}; diff --git a/public/apps/webapp-schulverwaltung/chunk-3K4NZPMP.js b/public/apps/webapp-schulverwaltung/chunk-GPCFUPHW.js similarity index 66% rename from public/apps/webapp-schulverwaltung/chunk-3K4NZPMP.js rename to public/apps/webapp-schulverwaltung/chunk-GPCFUPHW.js index 69a87a6a..1faf8b82 100644 --- a/public/apps/webapp-schulverwaltung/chunk-3K4NZPMP.js +++ b/public/apps/webapp-schulverwaltung/chunk-GPCFUPHW.js @@ -1 +1 @@ -import{b as a,c as b}from"./chunk-2FW5UFUO.js";import"./chunk-LHXVMKYN.js";import"./chunk-QB4DIFWS.js";import"./chunk-RTY26FN4.js";import"./chunk-3HCVMNJA.js";import"./chunk-5WNFCBTP.js";import"./chunk-A3CECLYB.js";import"./chunk-HCNFZOWE.js";import"./chunk-746ASKQ4.js";import"./chunk-DTTSX64G.js";import"./chunk-Y4QYVF5K.js";import"./chunk-AYQPMCNZ.js";import"./chunk-BIDSHCYH.js";import"./chunk-4RZQAAPF.js";import"./chunk-Z4YBXGVO.js";import"./chunk-3L4RH6QP.js";import"./chunk-DTYYCJHM.js";import"./chunk-XAZECV42.js";import"./chunk-SRCW6BUG.js";import"./chunk-GOGVGWFJ.js";import"./chunk-OSOXMODN.js";import"./chunk-PSYDBHTH.js";import"./chunk-W4U7QKJF.js";import"./chunk-AVBHFGIF.js";import"./chunk-2W7IS4PN.js";export{b as EVENTS_ROUTES,a as getStudentsRoute}; +import{b as a,c as b}from"./chunk-24V6FPDD.js";import"./chunk-ZCHQQKGF.js";import"./chunk-QB4DIFWS.js";import"./chunk-YQAWVQ54.js";import"./chunk-THL2WTJD.js";import"./chunk-5WNFCBTP.js";import"./chunk-LASWC23V.js";import"./chunk-HCNFZOWE.js";import"./chunk-746ASKQ4.js";import"./chunk-DTTSX64G.js";import"./chunk-Y4QYVF5K.js";import"./chunk-AYQPMCNZ.js";import"./chunk-BIDSHCYH.js";import"./chunk-4RZQAAPF.js";import"./chunk-Z4YBXGVO.js";import"./chunk-3L4RH6QP.js";import"./chunk-DTYYCJHM.js";import"./chunk-XAZECV42.js";import"./chunk-SRCW6BUG.js";import"./chunk-GOGVGWFJ.js";import"./chunk-OSOXMODN.js";import"./chunk-PSYDBHTH.js";import"./chunk-W4U7QKJF.js";import"./chunk-AVBHFGIF.js";import"./chunk-2W7IS4PN.js";export{b as EVENTS_ROUTES,a as getStudentsRoute}; diff --git a/public/apps/webapp-schulverwaltung/chunk-LASWC23V.js b/public/apps/webapp-schulverwaltung/chunk-LASWC23V.js new file mode 100644 index 00000000..39e416c7 --- /dev/null +++ b/public/apps/webapp-schulverwaltung/chunk-LASWC23V.js @@ -0,0 +1,3 @@ +import{a as yt}from"./chunk-Y4QYVF5K.js";import{a as xt}from"./chunk-AYQPMCNZ.js";import{b as Tt,c as _t,d as wt}from"./chunk-3L4RH6QP.js";import{b as Gt}from"./chunk-OSOXMODN.js";import{a as se}from"./chunk-PSYDBHTH.js";import{C as Ce,c as ft,d as ht,e as It,f as St,g as bt,r as vt,s as Ct,w as ve}from"./chunk-W4U7QKJF.js";import{$a as d,Ab as pe,Ad as Se,Bb as ce,Bd as gt,Cb as U,D as we,Eb as Xe,Fb as fe,Ga as D,H as qe,Hc as h,Ic as o,Ja as Q,Jb as c,Jc as j,K as Ke,Kb as f,Lb as L,Ld as q,M as Ee,Mb as Je,Mc as w,Md as N,Na as T,Nc as b,Ob as Ye,Oc as he,Od as be,P as v,Pd as M,Qa as G,Qc as $e,R as Pe,Ra as De,Uc as u,Va as _,Wc as it,X as R,Ya as Z,Za as ee,Zb as Qe,_ as x,_a as l,_c as re,a as O,ab as te,ac as Ze,ad as nt,b as F,c as He,cc as k,cd as W,da as H,dc as et,ea as J,eb as ie,ec as tt,f as ue,fa as Y,fd as rt,g as A,gb as V,h as oe,hb as S,hd as Re,id as Ie,kb as ge,l as Ge,lc as ne,ld as st,m as Ue,ma as ze,md as at,n as m,o as de,od as ot,qb as le,qd as dt,rb as p,s as me,sb as $,tb as C,td as lt,ud as pt,vd as ct,w as Le,wd as ut,x as We,xa as a,xd as mt,ya as P}from"./chunk-2W7IS4PN.js";var ri=(t,r)=>r.Key,si=t=>({width:t});function ai(t,r){if(t&1&&(l(0,"option",1),p(1),c(2,"translate"),d()),t&2){let e=S();G("ngValue",null),a(),C(" ",f(2,2,e.emptyLabel)," ")}}function oi(t,r){if(t&1&&(l(0,"option",1),p(1),d()),t&2){let e=r.$implicit;G("ngValue",e),a(),C(" ",e.Value," ")}}var Et=(()=>{class t{constructor(){this.options=[],this.allowEmpty=!0,this.emptyLabel="",this.value=null,this.disabled=!1,this.tabindex=0,this.width="auto",this.valueChange=new ze,this.options$=new A([]),this.rawValue$=new A(null),this.value$=de([this.rawValue$,this.options$]).pipe(m(([e,i])=>i&&i.find(n=>n.Key===e)||null))}ngOnChanges(e){e.value&&this.rawValue$.next(e.value.currentValue),e.options&&this.options$.next(e.options.currentValue)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=D({type:t,selectors:[["bkd-select"]],inputs:{options:"options",allowEmpty:"allowEmpty",emptyLabel:"emptyLabel",value:"value",disabled:"disabled",tabindex:"tabindex",width:"width"},outputs:{valueChange:"valueChange"},features:[H],decls:6,vars:9,consts:[[1,"form-select",3,"ngModelChange","tabindex","ngStyle","disabled","ngModel"],[3,"ngValue"]],template:function(i,n){i&1&&(l(0,"select",0),c(1,"async"),V("ngModelChange",function(y){return n.valueChange.emit(y&&y.Key)}),T(2,ai,3,4,"option",1),Z(3,oi,2,2,"option",1,ri),p(5,` > +`),d()),i&2&&(ge("tabindex",n.tabindex),G("ngStyle",fe(7,si,n.width))("disabled",n.disabled)("ngModel",f(1,5,n.value$)),a(2),_(n.allowEmpty?2:-1),a(),ee(n.options))},dependencies:[Se,pt,ct,lt,Ie,at,k,Ze,M],encapsulation:2,changeDetection:0})}}return t})();var Pt=b({Id:o,Designation:h,StudentCount:o,Number:h});var Me=b({Id:h,TestId:o,CourseRegistrationId:o,GradeId:u(o),GradeValue:u(o),GradeDesignation:u(h),Points:u(o),StudentId:o});var Dt=b({Id:o,CourseId:o,Date:re,Designation:h,Weight:o,WeightPercent:o,IsPointGrading:j,MaxPoints:u(o),MaxPointsAdjusted:u(o),IsPublished:j,IsOwner:j,Owner:u(h),GradingScaleId:u(o),Results:u(w(Me))});var $t=b({Id:o}),Rt=he({HRef:u(h)}),di=he({HasEvaluationStarted:j,EvaluationUntil:u(re),HasReviewOfEvaluationStarted:j,HasTestGrading:j,Id:o}),li=$e([$t,Rt,di]),pi=he({Id:o,StudentCount:o}),ci=$e([$t,Rt,pi]),ui=b({Grade:h,AverageTestResult:o,Id:o,StudentId:o}),Oe=b({AverageTestResult:o,CanGrade:j,EventId:o,GradeId:u(o),GradeValue:u(o),Id:o,StudentId:o}),K=b({HRef:h,Id:o,Number:h,Designation:h,DateFrom:u(re),DateTo:u(re),StatusId:o,GradingScaleId:u(o),FinalGrades:u(w(ui)),Gradings:u(w(Oe)),Tests:u(w(Dt)),EvaluationStatusRef:li,AttendanceRef:ci,ParticipatingStudents:u(w(_t)),Classes:u(w(Pt))}),Mt=b({TestResults:w(Me),Gradings:w(Oe)}),Ot=b({Gradings:w(Oe)});var xe=(()=>{class t extends se{constructor(e,i){super(e,i,K,"Courses"),this.statusCodec=b(nt(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(v(N(this.statusCodec)),m(e=>e.filter(i=>i.EvaluationStatusRef.HasEvaluationStarted===!0)),m(e=>e.length))}getExpandedCourses(e){return yt(e,"TeacherRole")?this.http.get(`${this.baseUrl}/?expand=EvaluationStatusRef,AttendanceRef,Classes,FinalGrades&filter.StatusId=;${this.settings.eventlist.statusfilter}`,{headers:{"X-Role-Restriction":"TeacherRole"}}).pipe(v(N(K))):Ge([])}getExpandedCourse(e){return this.http.get(`${this.baseUrl}/${e}?expand=ParticipatingStudents,EvaluationStatusRef,Tests,Gradings,FinalGrades,Classes`).pipe(v(q(K)))}getExpandedCourseWithParticipants(e){return this.http.get(`${this.baseUrl}/${e}?expand=ParticipatingStudents,Classes,AttendanceRef`).pipe(v(q(K)))}getExpandedCoursesForDossier(){return this.http.get(`${this.baseUrl}/?expand=Tests,Gradings,FinalGrades,EvaluationStatusRef,ParticipatingStudents,Classes&filter.StatusId=;${this.settings.eventlist.statusfilter}`).pipe(v(N(K)))}getExpandedCoursesForStudent(){return this.http.get(`${this.baseUrl}/?expand=Tests,Gradings,FinalGrades&filter.StatusId=;${this.settings.eventlist.statusfilter}`,{headers:{"X-Role-Restriction":"StudentRole"}}).pipe(v(N(K)))}add(e,i,n,s,y,B,g){let I={Tests:[{Date:i,Designation:n,Weight:s,IsPointGrading:y,MaxPoints:B,MaxPointsAdjusted:g}]};return this.http.put(`${this.baseUrl}/${e}/Tests/New`,I).pipe(m(()=>{}))}update(e,i,n,s,y,B,g,I){let X={Tests:[{Id:i,Designation:n,Date:s,Weight:y,IsPointGrading:B,MaxPoints:g,MaxPointsAdjusted:I}]};return this.http.put(`${this.baseUrl}/${e}/Tests/Update`,X).pipe(m(()=>{}))}delete(e,i){let n={TestIds:[i]};return this.http.put(`${this.baseUrl}/${e}/Tests/Delete`,n).pipe(m(()=>i))}updateTestResult(e,i){let I=i,{studentId:n,testId:s}=I,y=He(I,["studentId","testId"]),B={StudentIds:[n],TestId:s},g="gradeId"in y?F(O({},B),{GradeId:y.gradeId}):F(O({},B),{Points:y.points});return this.http.put(`${this.baseUrl}/${e}/SetTestResult`,g).pipe(v(q(Mt)),v(({TestResults:X,Gradings:Ne})=>X.length<=1&&Ne.length===1?Ge({courseId:e,testResult:X[0]??null,grading:Ne[0]}):Ue(()=>new Error("`TestResults` or `Gradings` does not contain a single value"))))}setAverageAsFinalGrade(e){return this.http.put(`${this.baseUrl}/SetAverageTestResult`,e).pipe(v(q(Ot)))}publishTest(e){let i={TestIds:[e]};return this.http.put(`${this.baseUrl}/PublishTest`,i).pipe(m(()=>e))}unpublishTest(e){let i={TestIds:[e]};return this.http.put(`${this.baseUrl}/UnpublishTest`,i).pipe(m(()=>e))}static{this.\u0275fac=function(i){return new(i||t)(x(ne),x(W))}}static{this.\u0275prov=R({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Bt=b({Id:h,SubscriptionId:o,VssId:o,EventId:o,DropdownItems:u(w(xt)),IdPerson:o,ShowAsRadioButtons:j,Value:u(h),VssDesignation:h,VssStyle:h,VssType:h}),Fe=b({Id:o,EventId:u(o),PersonId:u(o),Status:h,EventDesignation:u(h)});var At=(()=>{class t extends se{constructor(e,i){super(e,i,Fe,"Subscriptions")}getSubscriptionIdsByStudentAndCourse(e,i){return this.http.get(`${this.baseUrl}/`,{params:{"filter.PersonId":`=${e}`,"filter.EventId":`;${i}`}}).pipe(v(N(it)),m(n=>n.map(s=>s.Id)))}getSubscriptionCountsByEvents(e){return this.http.get(`${this.baseUrl}/`,{params:{"filter.EventId":`;${e.join(";")}`,fields:["Id","EventId"].join(",")}}).pipe(v(N(b({Id:o,EventId:o}))),m(i=>i.reduce((n,s)=>(n[s.EventId]=n[s.EventId]?n[s.EventId]+1:1,n),{})))}getSubscriptionsByCourse(e,i){return this.http.get(`${this.baseUrl}/`,{params:F(O({"filter.EventId":`=${e}`},i),{fields:["Id","EventId","EventDesignation","PersonId","Status"].join(",")})}).pipe(v(N(Fe)))}getSubscriptionDetailsById(e){return this.http.get(`${this.baseUrl}/${e}/SubscriptionDetails`).pipe(v(N(Bt)))}static{this.\u0275fac=function(i){return new(i||t)(x(ne),x(W))}}static{this.\u0275prov=R({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();function Vt(t){return t.length===0?0:je(t.map(({value:r,weight:e})=>r*e))/je(t.map(({weight:r})=>r))}function Be(t){return t.length===0?0:Number(je(t)/t.length)}function je(t){return t.reduce(gi,0)}function gi(t,r){return t+r}function Mn(t,r,e){return t?t.Tests?.reduce((i,n)=>i||n.Id===r&&n.Results?.find(s=>s.TestId===r&&s.StudentId===e)||null,null)??null:null}function On(t,r,e){return r.map(i=>i.Id===t.TestId?Ve(t,i,e):i)}function Fn(t,r,e){return e.map(i=>i.Id===t?fi(r,i):i)}function jn(t,r){return r.map(e=>e.Id===t?F(O({},e),{IsPublished:!e.IsPublished}):e)}function Bn(t){let r=Ii(t);if(r.length===0)throw new Error("unable to calculate averages without results");return Be(r)}function Ae(t){return t.MaxPointsAdjusted||t.MaxPoints}function An(t){let r=hi(t);if(r.length===0)throw new Error("unable to calculate averages without results");return Be(r)}function z(t,r){return r.Results?.find(e=>e.StudentId===t)}function Vn(t,r){return r===null?null:r.filter(e=>e.Id!==t)}function Ve(t,r,e){let i=e&&r.Results?.find(s=>s.TestId===t.TestId&&s.StudentId===t.StudentId),n=r.Results?.filter(s=>!(s.TestId===t.TestId&&s.StudentId===t.StudentId))||[];return i&&e==="grade"?t.GradeId=i.GradeId:i&&e==="points"&&(t.Points=i.Points),F(O({},r),{Results:[...n,t]})}function Nt(t){return t.slice().sort((r,e)=>e.Date.getTime()-r.Date.getTime())}function ye(t,r){return r?.find(e=>e.Id===t.GradingScaleId)||null}function fi(t,r){return F(O({},r),{Results:r.Results?.filter(e=>e.StudentId!==t)||[]})}function hi(t){return t.Results?.filter(r=>r.GradeDesignation!==null).map(r=>Number(r.GradeDesignation)).filter(r=>!isNaN(r))||[]}function Ii(t){return t.Results?.map(r=>r.Points!==null?r.Points:kt).filter(r=>r>kt)||[]}var kt=-1;var Si=b({Id:o,Designation:h}),ke=b({Id:o,Grades:w(Si)});var Ht=(()=>{class t extends se{constructor(e,i){super(e,i,ke,"GradingScales")}getGradingScale(e){return this.http.get(`${this.baseUrl}/${e}`).pipe(v(q(ke)))}getGradingScales(e){return me(e.map(this.getGradingScale.bind(this)))}static{this.\u0275fac=function(i){return new(i||t)(x(ne),x(W))}}static{this.\u0275prov=R({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Te=(()=>{class t{constructor(e,i,n,s,y,B){this.coursesRestService=e,this.subscriptionRestService=i,this.reportsService=n,this.loadingService=s,this.gradingScalesRestService=y,this.settings=B,this.studentId$=new oe(1),this.initialStudentCourses$=this.studentId$.pipe(qe(),v(this.loadCourses.bind(this)),m(g=>g.sort((I,X)=>I.Designation.localeCompare(X.Designation))),Ee(1)),this.action$=new oe(1),this.studentCourses$=Le(this.action$,this.initialStudentCourses$.pipe(m(g=>({type:"initializeCourses",payload:g})))).pipe(Ke(this.coursesReducer.bind(this),[]),Ee(1)),this.loading$=this.loadingService.loading$,this.studentCourseIds$=this.studentCourses$.pipe(m(g=>g.flatMap(I=>I.Id))),this.subscriptionIds$=de([this.studentId$,this.studentCourseIds$]).pipe(v(([g,I])=>this.subscriptionRestService.getSubscriptionIdsByStudentAndCourse(g,I))),this.testReports$=this.subscriptionIds$.pipe(m(g=>this.reportsService.getTeacherSubscriptionGradesReports(g))),this.tests$=this.studentCourses$.pipe(m(g=>g.flatMap(I=>I.Tests).filter(ve))),this.gradingScaleIdsFromTests$=this.tests$.pipe(m(g=>[...g.map(I=>I.GradingScaleId)].filter(ve).filter(Ce))),this.gradingScaleIdsFromCourses$=this.studentCourses$.pipe(m(g=>g.flatMap(I=>I.GradingScaleId).filter(ve).filter(Ce))),this.gradingScaleIds$=de([this.gradingScaleIdsFromCourses$,this.gradingScaleIdsFromTests$]).pipe(m(([g,I])=>g.concat(I).filter(Ce))),this.gradingScales$=this.gradingScaleIds$.pipe(v(g=>me(g.map(I=>this.gradingScalesRestService.getGradingScale(I)))))}setStudentId(e){this.studentId$.next(e)}getFinalGradeForStudent(e,i){return e?.FinalGrades?.find(n=>n.StudentId===i)}getGradingForStudent(e,i){return e?.Gradings?.find(n=>n.StudentId===i)}getGradingScaleOfCourse(e,i){return i?.find(n=>n.Id===e.GradingScaleId)}getGradesForStudent(e,i,n){return e.Tests?.flatMap(s=>({value:Number(ye(s,n)?.Grades.find(B=>B.Id===z(i,s)?.GradeId)?.Designation),weight:s.Weight})).filter(({value:s})=>!!s)||[]}updateStudentCourses(e){this.action$.next({type:"updateCourses",payload:e})}loadCourses(e){return this.loadingService.load(this.coursesRestService.getExpandedCoursesForDossier().pipe(m(i=>i.filter(n=>n.ParticipatingStudents?.find(s=>s.Id===e)))))}coursesReducer(e,i){switch(i.type){case"initializeCourses":return i.payload;case"updateCourses":return this.updateCourses([...e],i.payload);default:return e}}updateCourses(e,i){return e.map(n=>F(O({},n),{Tests:n.Tests!==null?n.Tests.map(s=>s.Id===i.Id?i:s):null}))}static{this.\u0275fac=function(i){return new(i||t)(x(xe),x(At),x(wt),x(Gt),x(Ht),x(W))}}static{this.\u0275prov=R({token:t,factory:t.\u0275fac})}}return t})();var Lt=(()=>{class t{constructor(){}get inIframe(){return window.parent!==window}get window(){return this.inIframe?window.parent:null}get document(){return this.window?.document.documentElement??null}querySelector(e){return this.window?.document?.querySelector("bkd-portal")?.shadowRoot?.querySelector(e)??null}getIframeElement(){return this.querySelector("bkd-content")?.shadowRoot?.querySelector("iframe")??null}getIframeTop(){return this.getIframeElement()?.offsetTop??0}getIFrameBottom(){let e=this.getIframeElement();return e?e.offsetTop+e.offsetHeight:0}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=R({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Wt=(()=>{class t{constructor(e,i){this.modal=e,this.portal=i}open(...e){let i=this.modal.open(...e);return this.applyPortalOffsetAndMaxHeight(i),this.disablePortalScrolling(i),i}get activeInstances(){return this.modal.activeInstances}dismissAll(...e){return this.modal.dismissAll(...e)}hasOpenModals(...e){return this.modal.hasOpenModals(...e)}applyPortalOffsetAndMaxHeight(e){let i=this.getModalWindowElement(e);if(!i){console.warn("Trying to apply portal offset to , but element is not present!");return}this.portal.window&&(i.style.top=`${this.getModalIframeOffset()}px`,i.style.maxHeight=`${this.getModalHeight()}px`)}disablePortalScrolling(e){if(this.portal.window&&this.portal.document){let i=this.portal.window.innerWidth-this.portal.document.clientWidth;this.portal.document.style.paddingRight=`${i}px`,this.portal.document.style.overflow="hidden"}e.hidden.subscribe(()=>{this.portal.document&&(this.portal.document.style.paddingRight="0px",this.portal.document.style.overflow="auto")})}getModalWindowElement(e){return e._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}static{this.\u0275fac=function(i){return new(i||t)(x(Ct),x(Lt))}}static{this.\u0275prov=R({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();function _e(t,r,e){return r?r.Grade:yi(t,e)||t?.GradeValue}function yi(t,r){return r?.Grades.find(e=>e.Id===t?.GradeId)?.Designation}var Ti="1-3",Kt="\u2013",zt=(()=>{class t{constructor(e){this.locale=e}transform(e,i,n){let s=Number(e??null);return isNaN(s)?Kt:_i(Number(e??null),n??this.locale,i)}static{this.\u0275fac=function(i){return new(i||t)(P(Ye,16))}}static{this.\u0275pipe=Q({name:"decimalOrDash",type:t,pure:!0})}}return t})();function _i(t,r,e){return t===0?Kt:Qe(t,r,`1.${Gi(e)}`)}function Gi(t){return t?String(t).includes("-")?String(t):`${t}-${t}`:Ti}var Xt=(()=>{class t{constructor(){}getGradeForStudent(){return _e(this.grading,this.finalGrade,this.gradingScale)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=D({type:t,selectors:[["bkd-dossier-grades-final-grade"]],inputs:{finalGrade:"finalGrade",grading:"grading",gradingScale:"gradingScale",average:"average"},decls:14,vars:11,consts:[[1,"final-entry"],["data-testid","final-grade"],["data-testid","average-test-results"]],template:function(i,n){i&1&&(l(0,"div",0)(1,"div"),p(2),c(3,"translate"),d(),l(4,"div",1)(5,"span"),p(6),d()(),l(7,"div"),p(8),c(9,"translate"),d(),l(10,"div",2)(11,"span"),p(12),c(13,"decimalOrDash"),d()()()),i&2&&(a(2),$(f(3,4,"dossier.grade")),a(4),$(n.getGradeForStudent()||"\u2013"),a(2),$(f(9,6,"dossier.average")),a(4),$(L(13,8,n.average,"1-3")))},dependencies:[M,zt],styles:[".final-entry[_ngcontent-%COMP%]{padding:1rem;display:grid;grid-template-columns:repeat(2,1fr)}span[_ngcontent-%COMP%]{margin-left:2em}"]})}}return t})();var Jt=(()=>{class t{constructor(e){this.translate=e}transform(e,i,n,s="tests.points"){return e.IsPointGrading&&(e.IsPublished||n)?`${z(i,e)?.Points||"\u2013"} / ${e.MaxPointsAdjusted||e.MaxPoints} ${this.translate.instant(s)}`:""}static{this.\u0275fac=function(i){return new(i||t)(P(be,16))}}static{this.\u0275pipe=Q({name:"bkdTestPoints",type:t,pure:!0})}}return t})();var Yt=(()=>{class t{constructor(e){this.translate=e}transform(e){return`${this.translate.instant("tests.factor")} ${e.Weight} (${e.WeightPercent}%)`}static{this.\u0275fac=function(i){return new(i||t)(P(be,16))}}static{this.\u0275pipe=Q({name:"bkdTestWeight",type:t,pure:!0})}}return t})();var Ei=t=>({maxPoints:t});function Pi(t,r){if(t&1&&(l(0,"div",13),p(1),c(2,"translate"),d()),t&2){let e=S(2);a(),C(" ",L(2,1,"global.validation-errors.invalidPoints",fe(4,Ei,e.maxPoints))," ")}}function Di(t,r){if(t&1){let e=ie();l(0,"div",3)(1,"label",11),p(2),c(3,"translate"),d(),l(4,"div",6)(5,"input",12,0),V("input",function(){J(e);let n=le(6),s=S();return Y(s.onPointsChange(n.value))}),d()(),T(7,Pi,3,6,"div",13),d()}if(t&2){let e=S();a(2),$(f(3,8,"dossier.dialog.points")),a(2),De("is-invalid",e.pointsInput.errors),a(),De("is-invalid",e.pointsInput.errors),ge("max",e.maxPoints),G("formControl",e.pointsInput),a(2),_(e.pointsInput.errors?7:-1)}}var Qt=500,Zt=(()=>{class t{constructor(e,i){this.activeModal=e,this.courseService=i,this.maxPoints=0,this.gradeSubject$=new ue,this.pointsSubject$=new ue,this.closeButtonDisabled$=new A(!1),this.gradingScaleDisabled$=new A(!0),this.grade$=this.gradeSubject$.pipe(we(Qt)),this.points$=this.pointsSubject$.pipe(we(Qt),We(this.isValid.bind(this)),m(Number)),this.destroy$=new ue}ngOnInit(){this.maxPoints=Ae(this.test),this.pointsInput=new st({value:this.points,disabled:!1},[Re.min(0),Re.pattern("[0-9]+([\\.][0-9]+)?"),this.maxPointValidator()]),this.gradingScaleDisabled$.next(this.test.IsPointGrading&&this.points>0),this.points$.pipe(Pe(this.destroy$)).subscribe(e=>this.updateTestResult({studentId:this.studentId,testId:this.test.Id,points:e})),this.grade$.pipe(Pe(this.destroy$)).subscribe(e=>this.updateTestResult({studentId:this.studentId,testId:this.test.Id,gradeId:e}))}onGradeChange(e){this.gradeSubject$.next(e)}onPointsChange(e){this.pointsSubject$.next(e),this.gradingScaleDisabled$.next(e.length>0)}updateTestResult(e){this.closeButtonDisabled$.next(!0),this.courseService.updateTestResult(this.test.CourseId,e).subscribe(({testResult:i})=>{this.gradeId=i?.GradeId??null,this.updatedTestResult=i,this.closeButtonDisabled$.next(!1)})}isValid(e){return e===""||isNaN(Number(e))?!1:!(Number(e)<0||Number(e)>this.maxPoints)}maxPointValidator(){return e=>Number(e.value)>Ae(this.test)?{customMax:!0}:null}static{this.\u0275fac=function(i){return new(i||t)(P(vt),P(xe))}}static{this.\u0275cmp=D({type:t,selectors:[["bkd-dossier-grades-edit"]],inputs:{test:"test",gradeId:"gradeId",gradeOptions:"gradeOptions",points:"points",studentId:"studentId"},decls:19,vars:20,consts:[["pointInput",""],[1,"modal-body"],[1,"mb-4"],[1,"form-group","row"],[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"],["for","points",1,"col-6","col-form-label"],["id","points","type","number","step","0.01","min","0",1,"form-control",3,"input","max","formControl"],["data-testid","validation-error-message",1,"invalid-feedback","col-6","offset-6"]],template:function(i,n){i&1&&(l(0,"div",1)(1,"p",2),p(2),d(),T(3,Di,8,10,"div",3),l(4,"div",4)(5,"label",5),p(6),c(7,"translate"),d(),l(8,"div",6)(9,"bkd-select",7),c(10,"async"),V("valueChange",function(y){return y&&n.onGradeChange(y)}),d()()(),l(11,"p",8),p(12),c(13,"translate"),d()(),l(14,"div",9)(15,"button",10),c(16,"async"),V("click",function(){return n.activeModal.close(n.updatedTestResult)}),p(17),c(18,"translate"),d()()),i&2&&(a(2),$(n.test.Designation),a(),_(n.test.IsPointGrading?3:-1),a(3),$(f(7,10,"dossier.dialog.grade")),a(3),G("options",n.gradeOptions)("value",n.gradeId)("allowEmpty",!1)("disabled",f(10,12,n.gradingScaleDisabled$)),a(3),C(" ",f(13,14,n.test.IsPointGrading?"dossier.dialog.hint.points":"dossier.dialog.hint.grade")," "),a(3),G("disabled",f(16,16,n.closeButtonDisabled$)),a(2),C(" ",f(18,18,"dossier.dialog.close")," "))},dependencies:[Se,rt,ot,Ie,mt,ut,gt,dt,Et,k,M],encapsulation:2})}}return t})();function $i(t,r){if(t&1){let e=ie();l(0,"a",10),V("click",function(){J(e);let n=S(2),s=U(0);return Y(n.editGrading(s))}),l(1,"i",11),p(2,"edit"),d(),l(3,"span",5),p(4),d()()}if(t&2){S(2);let e=U(2);a(4),$(e)}}function Ri(t,r){if(t&1&&(l(0,"span",5),p(1),d()),t&2){S(2);let e=U(2);a(),$(e)}}function Mi(t,r){if(t&1&&(l(0,"div",9),p(1),c(2,"translate"),d()),t&2){S(2);let e=U(0);a(),C(" ",f(2,1,e.IsPublished?"tests.published":"tests.not-published")," ")}}function Oi(t,r){if(t&1&&(l(0,"div",0)(1,"div",1),p(2),d(),l(3,"div",2),p(4),c(5,"date"),d(),l(6,"div",3),T(7,$i,5,1,"a",4)(8,Ri,2,1,"span",5),d(),l(9,"div",6),p(10),c(11,"bkdTestWeight"),d(),l(12,"div",7)(13,"span"),p(14),c(15,"bkdTestPoints"),d()(),l(16,"div",8),p(17),d(),T(18,Mi,3,3,"div",9),d()),t&2){let e=S(),i=U(0);a(2),C(" ",i.Designation," "),a(2),C(" ",L(5,7,i.Date,"dd.MM.yyyy")," "),a(3),_(e.isEditable&&i.IsOwner?7:8),a(3),C(" ",f(11,10,i)," "),a(4),$(Je(15,12,i,e.studentId,e.isEditable,"dossier.points")),a(3),C(" ",i.Owner," "),a(),_(e.isEditable?18:-1)}}var ei=(()=>{class t{constructor(e,i){this.gradeService=e,this.modalService=i,this.test$=new oe(1),this.grading$=this.test$.pipe(m(this.getGrading.bind(this)))}ngOnChanges(e){e.test&&this.test$.next(this.test)}editGrading(e){let i=this.modalService.open(Zt,{backdrop:"static"});i.componentInstance.test=e,i.componentInstance.gradeId=this.getGradeId(e),i.componentInstance.gradeOptions=t.mapToOptions(this.gradingScale),i.componentInstance.studentId=this.studentId,i.componentInstance.points=this.getPoints(e),i.result.then(n=>{n&&this.updateStudentGrade(n,e)},()=>{})}updateStudentGrade(e,i){let n=Ve(e,i);this.gradeService.updateStudentCourses(n)}getGrading(e){return this.gradingScale?.Grades.find(i=>i.Id===this.getGradeId(e))?.Designation||"\u2013"}getGradeId(e){return z(this.studentId,e)?.GradeId||null}getPoints(e){return z(this.studentId,e)?.Points||null}static mapToOptions(e){return e?.Grades.map(i=>({Key:i.Id,Value:i.Designation}))||null}static{this.\u0275fac=function(i){return new(i||t)(P(Te),P(Wt))}}static{this.\u0275cmp=D({type:t,selectors:[["bkd-dossier-single-test"]],inputs:{test:"test",studentId:"studentId",gradingScale:"gradingScale",isEditable:"isEditable"},features:[H],decls:5,vars:7,consts:[[1,"test-entry"],["data-testid","test-designation",1,"designation"],["data-testid","test-date",1,"date"],[1,"grade"],["aria-label","edit grade",1,"btn","btn-link"],["data-testid","test-grade"],["data-testid","test-factor",1,"factor"],["data-testid","test-points",1,"points"],["data-testid","test-teacher",1,"teacher"],["data-testid","test-status",1,"state"],["aria-label","edit grade",1,"btn","btn-link",3,"click"],["data-testid","test-grade-edit-icon",1,"material-icons"]],template:function(i,n){if(i&1&&(pe(0),c(1,"async"),pe(2),c(3,"async"),T(4,Oi,19,17,"div",0)),i&2){let s=ce(f(1,1,n.test$));a(2),ce(f(3,4,n.grading$)),a(2),_(s?4:-1)}},dependencies:[k,et,M,Jt,Yt],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)}}']})}}return t})();var Fi=(t,r)=>r.Id,ji=()=>[];function Bi(t,r){if(t&1&&te(0,"bkd-dossier-single-test",2),t&2){let e=r.$implicit,i=S(2);G("test",e)("studentId",i.studentId)("gradingScale",i.getGradingScaleOfTest(e))("isEditable",i.isEditable)}}function Ai(t,r){if(t&1&&(l(0,"div"),te(1,"bkd-dossier-grades-final-grade",1),Z(2,Bi,1,4,"bkd-dossier-single-test",2,Fi),d()),t&2){let e=S(),i=U(0);a(),G("finalGrade",e.decoratedCourse.finalGrade)("grading",e.decoratedCourse.grading)("gradingScale",e.decoratedCourse.gradingScale)("average",e.decoratedCourse.average),a(),ee(i)}}function Vi(t,r){t&1&&(l(0,"p",0),p(1),c(2,"translate"),d()),t&2&&(a(),C(" ",f(2,1,"dossier.no-tests")," "))}var ti=(()=>{class t{ngOnChanges(e){e.decoratedCourse&&this.sortedTests$.next(this.sortedTests())}constructor(){this.sortedTests$=new A([])}sortedTests(){return this.decoratedCourse.course.Tests?Nt(this.decoratedCourse.course.Tests):[]}getGradingScaleOfTest(e){return ye(e,this.gradingScales)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=D({type:t,selectors:[["bkd-dossier-course-tests"]],inputs:{studentId:"studentId",decoratedCourse:"decoratedCourse",gradingScales:"gradingScales",isEditable:"isEditable"},features:[H],decls:4,vars:5,consts:[["data-testid","message-no-tests",1,"p-3"],[3,"finalGrade","grading","gradingScale","average"],[3,"test","studentId","gradingScale","isEditable"]],template:function(i,n){if(i&1&&(pe(0),c(1,"async"),T(2,Ai,4,4,"div")(3,Vi,3,3,"p",0)),i&2){let s,y=ce((s=f(1,1,n.sortedTests$))!==null&&s!==void 0?s:Xe(4,ji));a(2),_(y.length>0?2:3)}},dependencies:[Xt,ei,k,M],encapsulation:2})}}return t})();function ki(t,r){if(t&1&&(l(0,"span",0),p(1),d()),t&2){let e=S();a(),C(" (",e.grade,")")}}function Ni(t,r){if(t&1&&(l(0,"span",1),p(1),c(2,"number"),d()),t&2){let e=S();a(),C(" (",L(2,1,e.average,"1.1-3"),")")}}var ii=(()=>{class t{constructor(){}get grade(){return this.getGradeForStudent()}getGradeForStudent(){return _e(this.grading,this.finalGrade,this.gradingScale)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=D({type:t,selectors:[["bkd-dossier-grades-course-header"]],inputs:{designation:"designation",finalGrade:"finalGrade",grading:"grading",gradingScale:"gradingScale",average:"average"},decls:3,vars:3,consts:[["data-testId","grade",1,"grade"],["data-testId","average",1,"average"]],template:function(i,n){i&1&&(p(0),T(1,ki,2,1,"span",0)(2,Ni,3,4,"span",1)),i&2&&(C("",n.designation,` +`),a(),_(n.grade?1:-1),a(),_(!n.grade&&n.average?2:-1))},dependencies:[tt],styles:[".average[_ngcontent-%COMP%]{color:#00000080}"]})}}return t})();var Hi=(t,r)=>r.course.Id;function Ui(t,r){if(t&1&&te(0,"bkd-dossier-course-tests",9),t&2){let e=S().$implicit,i=S(2);G("decoratedCourse",e)("studentId",i.studentId)("gradingScales",i.gradingScales)("isEditable",i.isEditable)}}function Li(t,r){if(t&1){let e=ie();l(0,"div")(1,"div",2)(2,"div",3,0)(4,"div",4)(5,"bkd-student-dossier-entry-header",5),V("click",function(){J(e);let n=le(3);return Y(n.toggle())}),te(6,"bkd-dossier-grades-course-header",6),d()(),l(7,"div",7)(8,"div",8),T(9,Ui,1,4,"ng-template"),d()()()()()}if(t&2){let e=r.$implicit,i=le(3);a(5),G("opened",!i.collapsed),a(),G("designation",e.course.Designation)("finalGrade",e.finalGrade)("grading",e.grading)("gradingScale",e.gradingScale)("average",e.average)}}function Wi(t,r){if(t&1&&(Z(0,Li,10,6,"div",null,Hi),c(2,"async")),t&2){let e=S();ee(f(2,0,e.decoratedCoursesSubject$))}}function qi(t,r){t&1&&(l(0,"p",1),p(1),c(2,"translate"),d()),t&2&&(a(),C(" ",f(2,1,"dossier.no-courses")," "))}var qr=(()=>{class t{constructor(e){this.dossierGradesService=e,this.isEditable=!0,this.decoratedCoursesSubject$=new A([])}ngOnChanges(){this.decoratedCoursesSubject$.next(this.decorateCourses())}decorateCourses(){return this.courses.map(e=>{let i=this.dossierGradesService.getFinalGradeForStudent(e,this.studentId),n=this.dossierGradesService.getGradesForStudent(e,this.studentId,this.gradingScales);return{course:e,finalGrade:i,grading:this.dossierGradesService.getGradingForStudent(e,this.studentId),gradingScale:this.dossierGradesService.getGradingScaleOfCourse(e,this.gradingScales),average:i?.AverageTestResult||Vt(n)}})}static{this.\u0275fac=function(i){return new(i||t)(P(Te))}}static{this.\u0275cmp=D({type:t,selectors:[["bkd-dossier-grades-view"]],inputs:{courses:"courses",studentId:"studentId",gradingScales:"gradingScales",isEditable:"isEditable"},features:[H],decls:2,vars:1,consts:[["courses","ngbAccordionItem"],["data-testid","message-no-courses",1,"py-3"],["ngbAccordion",""],["ngbAccordionItem",""],["ngbAccordionHeader",""],[3,"click","opened"],[3,"designation","finalGrade","grading","gradingScale","average"],["ngbAccordionCollapse",""],["ngbAccordionBody",""],[3,"decoratedCourse","studentId","gradingScales","isEditable"]],template:function(i,n){i&1&&T(0,Wi,3,2)(1,qi,3,3,"p",1),i&2&&_(n.courses.length>0?0:1)},dependencies:[bt,St,It,Tt,ii,ht,ft,ti,k,M],encapsulation:2})}}return t})();export{Be as a,Mn as b,On as c,Fn as d,jn as e,Bn as f,An as g,Vn as h,Nt as i,Kt as j,zt as k,_i as l,Et as m,Pt as n,Oe as o,xe as p,Bt as q,At as r,Ht as s,Te as t,Lt as u,Wt as v,qr as w}; diff --git a/public/apps/webapp-schulverwaltung/chunk-U3A3T7IE.js b/public/apps/webapp-schulverwaltung/chunk-QRYQOPD4.js similarity index 98% rename from public/apps/webapp-schulverwaltung/chunk-U3A3T7IE.js rename to public/apps/webapp-schulverwaltung/chunk-QRYQOPD4.js index 1d2a821c..8e78a2cf 100644 --- a/public/apps/webapp-schulverwaltung/chunk-U3A3T7IE.js +++ b/public/apps/webapp-schulverwaltung/chunk-QRYQOPD4.js @@ -1,2 +1,2 @@ -import{a as We,b as Ye}from"./chunk-2FW5UFUO.js";import{b as ie}from"./chunk-DJH5AAGM.js";import"./chunk-LHXVMKYN.js";import"./chunk-QB4DIFWS.js";import{a as Ze}from"./chunk-W4ESFJ6M.js";import"./chunk-RTY26FN4.js";import{a as Ke}from"./chunk-3HCVMNJA.js";import"./chunk-5WNFCBTP.js";import{p as Ge}from"./chunk-A3CECLYB.js";import"./chunk-HCNFZOWE.js";import{e as ee}from"./chunk-746ASKQ4.js";import{b as He}from"./chunk-DTTSX64G.js";import"./chunk-Y4QYVF5K.js";import"./chunk-AYQPMCNZ.js";import"./chunk-BIDSHCYH.js";import"./chunk-4RZQAAPF.js";import{d as Ue,f as F,g as qe}from"./chunk-Z4YBXGVO.js";import"./chunk-3L4RH6QP.js";import{d as ze}from"./chunk-DTYYCJHM.js";import"./chunk-XAZECV42.js";import{L as Ne,b as Be,g as de,p as je,q as Fe}from"./chunk-SRCW6BUG.js";import"./chunk-GOGVGWFJ.js";import{b as Ve}from"./chunk-OSOXMODN.js";import{a as X,b as te}from"./chunk-PSYDBHTH.js";import{w as we}from"./chunk-W4U7QKJF.js";import"./chunk-AVBHFGIF.js";import{$a as c,Ab as E,Bb as U,Cb as H,Db as Te,Eb as w,Ga as S,Hc as Ie,Ic as Ee,Id as Re,Ja as fe,Jb as a,Jd as Ae,Kb as r,Lb as R,M as y,Md as Oe,Na as p,Nb as Pe,Nc as Q,O as be,P as D,Pa as oe,Pd as M,Qa as _,Ra as _e,Rd as Le,Va as m,X as B,Ya as Ce,Za as ge,_ as x,_a as d,a as V,ab as C,b as q,bc as De,cc as O,cd as L,d as pe,db as ae,dc as Y,ea as K,eb as ve,fa as W,g as me,ga as ue,gb as j,h as he,hb as f,hc as ce,ib as ye,jb as Se,l as A,lc as Z,n as u,o as G,qb as re,qc as $e,rb as l,sb as P,tb as T,ub as se,vb as xe,wa as z,xa as n,xc as ke,ya as v,yc as Me,zc as J}from"./chunk-2W7IS4PN.js";var ut=["*"];function ft(e,s){e&1&&ae(0)}function _t(e,s){if(e&1&&(d(0,"a",1),p(1,ft,1,0,"ng-container",3),c()),e&2){let t=f(),i=re(3);_("routerLink",t.link)("queryParams",t.linkParams),n(),_("ngTemplateOutlet",i)}}function Ct(e,s){e&1&&ae(0)}function gt(e,s){if(e&1&&(d(0,"a",2),p(1,Ct,1,0,"ng-container",3),c()),e&2){let t=f(),i=re(3);_("href",t.externalLink,z),n(),_("ngTemplateOutlet",i)}}function vt(e,s){if(e&1&&(d(0,"span",5),l(1),c()),e&2){let t=f(2);n(),P(t.count)}}function yt(e,s){e&1&&(ue(),d(0,"svg",6),C(1,"path",7),c())}function St(e,s){if(e&1&&(d(0,"span",4),l(1),a(2,"translate"),c(),d(3,"div"),Se(4),p(5,vt,2,1,"span",5)(6,yt,2,0,":svg:svg",6),c()),e&2){let t=f();n(),P(r(2,2,t.label)),n(4),m(t.hasCount(t.count)?5:6)}}var Je=(()=>{class e{constructor(){}hasCount(t){return typeof t=="number"&&t>=0}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=S({type:e,selectors:[["bkd-dashboard-action"]],inputs:{label:"label",count:"count",link:"link",linkParams:"linkParams",externalLink:"externalLink"},ngContentSelectors:ut,decls:4,vars:2,consts:[["actionContent",""],[3,"routerLink","queryParams"],[3,"href"],[4,"ngTemplateOutlet"],[1,"label"],[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(i,o){i&1&&(ye(),p(0,_t,2,3,"a",1)(1,gt,2,2,"a",2)(2,St,7,4,"ng-template",null,0,Pe)),i&2&&(m(o.externalLink?-1:0),n(),m(o.externalLink?1:-1))},dependencies:[J,De,M],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}"]})}}return e})();var Qe=(()=>{class e{constructor(){}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=S({type:e,selectors:[["bkd-dashboard-deadline"]],inputs:{count:"count"},decls:3,vars:8,template:function(i,o){i&1&&(l(0),a(1,"translate"),a(2,"addSpace")),i&2&&xe("",r(1,3,"dashboard.actions.deadline"),"",R(2,5,": ",":"),"",o.count,` +import{a as We,b as Ye}from"./chunk-24V6FPDD.js";import{b as ie}from"./chunk-DJH5AAGM.js";import"./chunk-ZCHQQKGF.js";import"./chunk-QB4DIFWS.js";import{a as Ze}from"./chunk-W4ESFJ6M.js";import"./chunk-YQAWVQ54.js";import{a as Ke}from"./chunk-THL2WTJD.js";import"./chunk-5WNFCBTP.js";import{p as Ge}from"./chunk-LASWC23V.js";import"./chunk-HCNFZOWE.js";import{e as ee}from"./chunk-746ASKQ4.js";import{b as He}from"./chunk-DTTSX64G.js";import"./chunk-Y4QYVF5K.js";import"./chunk-AYQPMCNZ.js";import"./chunk-BIDSHCYH.js";import"./chunk-4RZQAAPF.js";import{d as Ue,f as F,g as qe}from"./chunk-Z4YBXGVO.js";import"./chunk-3L4RH6QP.js";import{d as ze}from"./chunk-DTYYCJHM.js";import"./chunk-XAZECV42.js";import{L as Ne,b as Be,g as de,p as je,q as Fe}from"./chunk-SRCW6BUG.js";import"./chunk-GOGVGWFJ.js";import{b as Ve}from"./chunk-OSOXMODN.js";import{a as X,b as te}from"./chunk-PSYDBHTH.js";import{w as we}from"./chunk-W4U7QKJF.js";import"./chunk-AVBHFGIF.js";import{$a as c,Ab as E,Bb as U,Cb as H,Db as Te,Eb as w,Ga as S,Hc as Ie,Ic as Ee,Id as Re,Ja as fe,Jb as a,Jd as Ae,Kb as r,Lb as R,M as y,Md as Oe,Na as p,Nb as Pe,Nc as Q,O as be,P as D,Pa as oe,Pd as M,Qa as _,Ra as _e,Rd as Le,Va as m,X as B,Ya as Ce,Za as ge,_ as x,_a as d,a as V,ab as C,b as q,bc as De,cc as O,cd as L,d as pe,db as ae,dc as Y,ea as K,eb as ve,fa as W,g as me,ga as ue,gb as j,h as he,hb as f,hc as ce,ib as ye,jb as Se,l as A,lc as Z,n as u,o as G,qb as re,qc as $e,rb as l,sb as P,tb as T,ub as se,vb as xe,wa as z,xa as n,xc as ke,ya as v,yc as Me,zc as J}from"./chunk-2W7IS4PN.js";var ut=["*"];function ft(e,s){e&1&&ae(0)}function _t(e,s){if(e&1&&(d(0,"a",1),p(1,ft,1,0,"ng-container",3),c()),e&2){let t=f(),i=re(3);_("routerLink",t.link)("queryParams",t.linkParams),n(),_("ngTemplateOutlet",i)}}function Ct(e,s){e&1&&ae(0)}function gt(e,s){if(e&1&&(d(0,"a",2),p(1,Ct,1,0,"ng-container",3),c()),e&2){let t=f(),i=re(3);_("href",t.externalLink,z),n(),_("ngTemplateOutlet",i)}}function vt(e,s){if(e&1&&(d(0,"span",5),l(1),c()),e&2){let t=f(2);n(),P(t.count)}}function yt(e,s){e&1&&(ue(),d(0,"svg",6),C(1,"path",7),c())}function St(e,s){if(e&1&&(d(0,"span",4),l(1),a(2,"translate"),c(),d(3,"div"),Se(4),p(5,vt,2,1,"span",5)(6,yt,2,0,":svg:svg",6),c()),e&2){let t=f();n(),P(r(2,2,t.label)),n(4),m(t.hasCount(t.count)?5:6)}}var Je=(()=>{class e{constructor(){}hasCount(t){return typeof t=="number"&&t>=0}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=S({type:e,selectors:[["bkd-dashboard-action"]],inputs:{label:"label",count:"count",link:"link",linkParams:"linkParams",externalLink:"externalLink"},ngContentSelectors:ut,decls:4,vars:2,consts:[["actionContent",""],[3,"routerLink","queryParams"],[3,"href"],[4,"ngTemplateOutlet"],[1,"label"],[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(i,o){i&1&&(ye(),p(0,_t,2,3,"a",1)(1,gt,2,2,"a",2)(2,St,7,4,"ng-template",null,0,Pe)),i&2&&(m(o.externalLink?-1:0),n(),m(o.externalLink?1:-1))},dependencies:[J,De,M],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}"]})}}return e})();var Qe=(()=>{class e{constructor(){}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=S({type:e,selectors:[["bkd-dashboard-deadline"]],inputs:{count:"count"},decls:3,vars:8,template:function(i,o){i&1&&(l(0),a(1,"translate"),a(2,"addSpace")),i&2&&xe("",r(1,3,"dashboard.actions.deadline"),"",R(2,5,": ",":"),"",o.count,` `)},dependencies:[M,qe],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}"]})}}return e})();var Xe=Q({Id:Ee,Holder:Ie});var et=(()=>{class e extends X{constructor(t,i){super(t,i,Xe,"TeacherSubstitutions")}getTeacherSubstitution(t){return this.getList({params:{"filter.Id":`=${t}`}}).pipe(u(i=>i[0]||null))}static{this.\u0275fac=function(i){return new(i||e)(x(Z),x(L))}}static{this.\u0275prov=B({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var kt=["LessonTeacherRole","ClassTeacherRole","TeacherRole","AbsenceAdministratorRole"],Mt=["LessonTeacherRole","TeacherRole","StudentRole","SubstituteAdministratorRole"],It=["LessonTeacherRole","StudentRole"],I=(()=>{class e{constructor(t,i,o,h,b,$,N,bt){this.settingsService=t,this.lessonPresencesService=i,this.studentsService=o,this.courseService=h,this.teacherSubstitutionService=b,this.personService=$,this.storageService=N,this.settings=bt,this.rolesAndPermissions$=this.settingsService.getRolesAndPermissions(),this.userId$=new he(1),this.lessonAbsences$=this.userId$.pipe(D(g=>this.studentsService.getLessonAbsences(g)),y(1)),this.lessonIncidents$=this.userId$.pipe(D(g=>this.studentsService.getLessonIncidents(g)),y(1)),this.loading$=this.rolesAndPermissions$.pipe(u(g=>g==null)),this.hasSearch$=this.rolesAndPermissions$.pipe(u(this.hasRoles(kt))),this.hasActions$=this.rolesAndPermissions$.pipe(u(this.hasRoles(Mt))),this.hasTimetable$=this.rolesAndPermissions$.pipe(u(this.hasRoles(It))),this.hasLessonTeacherRole$=this.rolesAndPermissions$.pipe(u(this.hasRoles(["LessonTeacherRole"])),y(1)),this.hasTeacherRole$=this.rolesAndPermissions$.pipe(u(this.hasRoles(["TeacherRole"])),y(1)),this.hasStudentRole$=this.rolesAndPermissions$.pipe(u(this.hasRoles(["StudentRole"])),y(1)),this.hasSubstituteAdministratorRole$=this.rolesAndPermissions$.pipe(u(this.hasRoles(["SubstituteAdministratorRole"])),y(1)),this.editAbsencesCount$=this.hasLessonTeacherRole$.pipe(D(g=>g?this.lessonPresencesService.checkableAbsencesCount():A(!1)),y(1)),this.openAbsencesCount$=this.rolesAndPermissions$.pipe(u(this.hasRoles(["LessonTeacherRole","ClassTeacherRole"])),D(g=>g?this.lessonPresencesService.getListOfUnconfirmed():A([])),u(g=>g.length),y(1)),this.myAbsencesCount$=this.hasStudentRole$.pipe(D(g=>g?this.getMyAbsences():A([])),u(this.getMyAbsencesCount.bind(this)),y(1)),this.coursesToRateCount$=this.courseService.getNumberOfCoursesForRating().pipe(be(0),y(1)),this.hasPresenceControl$=this.hasLessonTeacherRole$.pipe(D(g=>g?this.lessonPresencesService.hasLessonsLessonTeacher():A(!1)),y(1)),this.hasOpenAbsences$=this.openAbsencesCount$.pipe(u(g=>g>0),y(1)),this.editAbsencesParams$=this.getFullName().pipe(u(g=>({confirmationStates:this.settings.checkableAbsenceStateId,teacher:g})),y(1));let le=this.storageService.getPayload()?.id_person;le&&this.userId$.next(Number(le))}hasRoles(t){return i=>(i??[]).some(o=>t.includes(o))}getMyAbsences(){return G([this.userId$,this.lessonAbsences$,this.lessonIncidents$]).pipe(D(([t,i,o])=>this.loadTimetableEntries(t,i,o).pipe(u(h=>[...i,...o].map(b=>this.withTimetableEntry(b,h)).filter(we)))))}getMyAbsencesCount(t){return t?.filter(i=>("ConfirmationStateId"in i?i.ConfirmationStateId:null)===this.settings.unconfirmedAbsenceStateId).length||0}getFullName(){let t=Number(this.storageService.getPayload()?.substitution_id)||null;return t?this.teacherSubstitutionService.getTeacherSubstitution(t).pipe(u(i=>i?.Holder)):this.personService.getMyself().pipe(u(i=>i.FullName))}withTimetableEntry(t,i){return i.find(o=>o.Id===t.LessonRef.Id)?t:null}loadTimetableEntries(t,i,o){return this.studentsService.getTimetableEntries(t,{"filter.Id":`;${[...i,...o].map(h=>h.LessonRef.Id).join(";")}`})}static{this.\u0275fac=function(i){return new(i||e)(x(ie),x(ee),x(F),x(Ge),x(et),x(He),x(Le),x(L))}}static{this.\u0275prov=B({token:e,factory:e.\u0275fac})}}return e})();var Et=()=>["/presence-control"],Rt=()=>["/edit-absences"],At=()=>["/open-absences"],Ot=()=>["/events"],Lt=()=>["/my-absences","report"],wt=()=>["/my-absences"];function Bt(e,s){e&1&&C(0,"bkd-dashboard-action",0),e&2&&_("label","dashboard.actions.presence-control")("link",w(2,Et))}function jt(e,s){if(e&1&&(C(0,"bkd-dashboard-action",1),a(1,"async"),a(2,"async")),e&2){let t=f();_("label","dashboard.actions.edit-absences")("link",w(8,Rt))("linkParams",r(1,4,t.dashboardService.editAbsencesParams$))("count",r(2,6,t.dashboardService.editAbsencesCount$))}}function Ft(e,s){if(e&1&&(C(0,"bkd-dashboard-action",2),a(1,"async")),e&2){let t=f();_("label","dashboard.actions.open-absences")("link",w(5,At))("count",r(1,3,t.dashboardService.openAbsencesCount$))}}function Nt(e,s){if(e&1&&(C(0,"bkd-dashboard-deadline",4),a(1,"async")),e&2){let t=f(2);_("count",r(1,1,t.dashboardService.coursesToRateCount$))}}function zt(e,s){if(e&1&&(d(0,"bkd-dashboard-action",0),p(1,Nt,2,3,"bkd-dashboard-deadline",4),a(2,"async"),c()),e&2){let t,i=f();_("label","dashboard.actions.tests")("link",w(5,Ot)),n(),m((t=r(2,3,i.dashboardService.coursesToRateCount$))!==null&&t!==void 0&&t?1:-1)}}function Ut(e,s){e&1&&C(0,"bkd-dashboard-action",0),e&2&&_("label","dashboard.actions.my-absences-report")("link",w(2,Lt))}function Ht(e,s){if(e&1&&(C(0,"bkd-dashboard-action",2),a(1,"async")),e&2){let t=f();_("label","dashboard.actions.my-absences")("link",w(5,wt))("count",r(1,3,t.dashboardService.myAbsencesCount$))}}function Vt(e,s){if(e&1&&C(0,"bkd-dashboard-action",3),e&2){let t=f();_("label","dashboard.actions.substitutions")("externalLink",t.substitutionsAdminLink)}}var it=(()=>{class e{constructor(t,i){this.dashboardService=t,this.settings=i}get substitutionsAdminLink(){return this.settings.dashboard.substitutionsAdminLink}static{this.\u0275fac=function(i){return new(i||e)(v(I),v(L))}}static{this.\u0275cmp=S({type:e,selectors:[["bkd-dashboard-actions"]],decls:15,vars:23,consts:[[3,"label","link"],[3,"label","link","linkParams","count"],[3,"label","link","count"],[3,"label","externalLink"],[3,"count"]],template:function(i,o){i&1&&(p(0,Bt,1,3,"bkd-dashboard-action",0),a(1,"async"),p(2,jt,3,9,"bkd-dashboard-action",1),a(3,"async"),a(4,"async"),p(5,Ft,2,6,"bkd-dashboard-action",2),a(6,"async"),p(7,zt,3,6,"bkd-dashboard-action",0),a(8,"async"),p(9,Ut,1,3,"bkd-dashboard-action",0),a(10,"async"),p(11,Ht,2,6,"bkd-dashboard-action",2),a(12,"async"),p(13,Vt,1,2,"bkd-dashboard-action",3),a(14,"async")),i&2&&(m(r(1,7,o.dashboardService.hasPresenceControl$)?0:-1),n(2),m(r(3,9,o.dashboardService.hasLessonTeacherRole$)&&r(4,11,o.dashboardService.editAbsencesParams$)?2:-1),n(3),m(r(6,13,o.dashboardService.hasOpenAbsences$)?5:-1),n(2),m(r(8,15,o.dashboardService.hasTeacherRole$)?7:-1),n(2),m(r(10,17,o.dashboardService.hasStudentRole$)?9:-1),n(2),m(r(12,19,o.dashboardService.hasStudentRole$)?11:-1),n(2),m(r(14,21,o.dashboardService.hasSubstituteAdministratorRole$)?13:-1))},dependencies:[Je,Qe,O],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:.5rem}"]})}}return e})();var nt=(()=>{class e{constructor(t,i){this.studentsRestService=t,this.router=i}navigateToDossier(t){return pe(this,null,function*(){let i=Number(t);yield this.router.navigate(["dashboard","student",i,"addresses"])})}static{this.\u0275fac=function(i){return new(i||e)(v(F),v(Me))}}static{this.\u0275cmp=S({type:e,selectors:[["bkd-dashboard-search"]],decls:1,vars:2,consts:[[3,"valueChange","typeaheadService","placeholder"]],template:function(i,o){i&1&&(d(0,"bkd-typeahead",0),j("valueChange",function(b){return b&&o.navigateToDossier(b)}),c()),i&2&&_("typeaheadService",o.studentsRestService)("placeholder","dashboard.search.placeholder")},dependencies:[Ze],styles:["[_nghost-%COMP%]{display:block;padding:.75rem;background:#f7e9d2}"]})}}return e})();var ot=(()=>{class e{constructor(t){this.sanitizer=t}transform(t,i){switch(i){case"html":return this.sanitizer.bypassSecurityTrustHtml(t);case"style":return this.sanitizer.bypassSecurityTrustStyle(t);case"script":return this.sanitizer.bypassSecurityTrustScript(t);case"url":return this.sanitizer.bypassSecurityTrustUrl(t);case"resourceUrl":return this.sanitizer.bypassSecurityTrustResourceUrl(t);default:throw new Error(`Invalid safe type specified: ${i}`)}}static{this.\u0275fac=function(i){return new(i||e)(v($e,16))}}static{this.\u0275pipe=fe({name:"safe",type:e,pure:!0})}}return e})();function at(e){return{id:ct(e.EventId,e.Id),from:e.From,until:e.To,eventId:e.EventId,subject:e.EventDesignation,room:e.EventLocation||void 0,teacher:e.EventManagerInformation||void 0}}function rt(e){let s=e.reduce((t,i)=>{let o=ct(i.EventRef.Id,i.LessonRef.Id);return q(V({},t),{[o]:[...t[o]??[],i.StudyClassNumber]})},{});return Object.keys(s).reduce((t,i)=>q(V({},t),{[i]:Re([...s[i]].sort())}),{})}function st(e,s){return e.map(t=>q(V({},t),{studyClass:s[t.id]?.join(", ")}))}function ct(e,s){return`${e}-${s}`}var qt=(e,s)=>s.id;function Gt(e,s){e&1&&(d(0,"th"),l(1),a(2,"translate"),c()),e&2&&(n(),T(" ",r(2,1,"dashboard.timetable.table.teacher")," "))}function Kt(e,s){if(e&1&&(E(0),d(1,"a",3),l(2),d(3,"span",8),l(4),c()()),e&2){let t=f().$implicit,i=f(2).buildLink(t.eventId);n(),_("routerLink",i.link)("queryParams",i.params),n(),T(" ",t.subject,""),n(2),T(", ",t.studyClass,"")}}function Wt(e,s){if(e&1&&l(0),e&2){let t=f().$implicit;T(" ",t.subject," ")}}function Yt(e,s){if(e&1&&(d(0,"td",4),l(1),a(2,"translate"),c()),e&2){let t=f().$implicit;n(),se(" ",r(2,2,"dashboard.timetable.table.study-class"),": ",t.studyClass," ")}}function Zt(e,s){if(e&1&&(d(0,"td",5),l(1),c()),e&2){let t=f().$implicit;n(),T(" ",t.teacher," ")}}function Jt(e,s){e&1&&(d(0,"span",7),l(1),a(2,"translate"),c()),e&2&&(n(),P(r(2,1,"dashboard.timetable.table.room")))}function Qt(e,s){if(e&1&&(d(0,"tr")(1,"td",1),l(2),a(3,"date"),a(4,"date"),c(),d(5,"td",2),p(6,Kt,5,4,"a",3),a(7,"async"),p(8,Wt,1,1),c(),p(9,Yt,3,4,"td",4),a(10,"async"),p(11,Zt,2,1,"td",5),a(12,"async"),d(13,"td",6),p(14,Jt,3,3,"span",7),l(15),c()()),e&2){let t=s.$implicit,i=f(2);n(2),se(" ",R(3,7,t.from,"HH:mm"),"\u2013",R(4,10,t.until,"HH:mm")," "),n(4),m(r(7,13,i.isTeacher$)?6:8),n(3),m(r(10,15,i.isTeacher$)?9:-1),n(2),m(r(12,17,i.isStudent$)?11:-1),n(3),m(t.room?14:-1),n(),T(" ",t.room," ")}}function Xt(e,s){if(e&1&&(d(0,"table",0)(1,"thead")(2,"tr")(3,"th"),l(4),a(5,"translate"),c(),d(6,"th"),l(7),a(8,"translate"),c(),p(9,Gt,3,3,"th"),a(10,"async"),d(11,"th"),l(12),a(13,"translate"),c()()(),d(14,"tbody"),Ce(15,Qt,16,19,"tr",null,qt),c()()),e&2){let t=f();n(4),P(r(5,4,"dashboard.timetable.table.time")),n(3),P(r(8,6,"dashboard.timetable.table.subject")),n(2),m(r(10,8,t.isStudent$)?9:-1),n(3),T(" ",r(13,10,"dashboard.timetable.table.room")," "),n(3),ge(t.entries)}}function ei(e,s){e&1&&(d(0,"p"),l(1),a(2,"translate"),c()),e&2&&(n(),P(r(2,1,"dashboard.timetable.no-entries")))}var dt=(()=>{class e{constructor(t){this.dashboardService=t,this.entries=[],this.isStudent$=this.dashboardService.hasStudentRole$,this.isTeacher$=this.dashboardService.hasLessonTeacherRole$}buildLink(t){return ze(We(t,"/dashboard"))}static{this.\u0275fac=function(i){return new(i||e)(v(I))}}static{this.\u0275cmp=S({type:e,selectors:[["bkd-dashboard-timetable-table"]],inputs:{entries:"entries"},decls:2,vars:1,consts:[[1,"table"],[1,"time"],[1,"subject"],[3,"routerLink","queryParams"],[1,"study-class"],[1,"teacher"],[1,"room"],[1,"room-label"],[1,"subject-study-class"]],template:function(i,o){i&1&&p(0,Xt,17,12,"table",0)(1,ei,3,3,"p"),i&2&&m(o.entries.length>0?0:1)},dependencies:[O,Y,M,J],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}}']})}}return e})();var ti=Q({}),lt=(()=>{class e extends X{constructor(t,i){super(t,i,ti,"Teachers")}getTimetableEntries(t,i={}){let o=i instanceof ce?i:new ce({fromObject:i});return o=o.set("fields","Id,From,To,EventId,EventNumber,EventDesignation,EventLocation"),this.http.get(`${this.baseUrl}/${t}/TimetableEntries/CurrentSemester`,{params:o}).pipe(D(Oe(Ue)))}static{this.\u0275fac=function(i){return new(i||e)(x(Z),x(L))}}static{this.\u0275prov=B({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();function ni(e,s){e&1&&(d(0,"a",6),a(1,"safe"),l(2),a(3,"translate"),c()),e&2&&(_("href",R(1,2,s,"url"),z),n(2),T(" ",r(3,5,"dashboard.timetable.subscribe-calendar")," "))}function oi(e,s){e&1&&C(0,"bkd-spinner")}function ai(e,s){e&1&&(d(0,"a",8),a(1,"safe"),l(2),a(3,"translate"),c()),e&2&&(_("href",R(1,2,s,"url"),z),n(2),T(" ",r(3,5,"dashboard.timetable.subscribe-calendar")," "))}function ri(e,s){if(e&1&&(C(0,"bkd-dashboard-timetable-table",7),p(1,ai,4,7,"a",8),a(2,"async")),e&2){let t,i=f(),o=H(18);_("entries",o),n(),m((t=r(2,2,i.getSubscribeCalendarUrl()))?1:-1,t)}}var si="cal",pt=(()=>{class e{constructor(t,i,o,h,b,$){this.teachersService=t,this.studentsService=i,this.lessonPresencesService=o,this.userSettings=h,this.dashboardService=b,this.loadingService=$,this.userId$=this.dashboardService.userId$,this.isTeacher$=this.dashboardService.hasLessonTeacherRole$,this.isStudent$=this.dashboardService.hasStudentRole$,this.date$=new me(de(new Date)),this.loading$=this.loadingService.loading$,this.timetableEntries$=this.loadTimetableEntries()}gotoToday(){this.date$.next(de(new Date))}gotoPreviousDay(){this.date$.next(Fe(this.date$.getValue(),1))}gotoNextDay(){this.date$.next(Be(this.date$.getValue(),1))}getSubscribeCalendarUrl(){return this.userSettings.getSetting(si)}loadTimetableEntries(){return G([this.isTeacher$,this.isStudent$,this.userId$,this.date$]).pipe(D(([t,i,o,h])=>{let b=()=>t?this.fetchTimetableEntries("teacher",o,h):i?this.fetchTimetableEntries("student",o,h):A([]);return this.loadingService.load(b())}),y(1))}fetchTimetableEntries(t,i,o){let h={"filter.From":`=${je(o,"yyyy-MM-dd")}`,sort:"From,To"};return(t==="teacher"?this.teachersService.getTimetableEntries(i,h):this.studentsService.getTimetableEntries(i,h)).pipe(u(b=>b.map(at)),u(b=>Ae(b,$=>$.id)),D(b=>t==="teacher"?this.loadStudyClasses(o).pipe(u($=>st(b,$))):A(b)))}loadStudyClasses(t){return this.lessonPresencesService.getLessonStudyClassesByDate(t).pipe(u(rt))}static{this.\u0275fac=function(i){return new(i||e)(v(lt),v(F),v(ee),v(ie),v(I),v(Ve))}}static{this.\u0275cmp=S({type:e,selectors:[["bkd-dashboard-timetable"]],decls:23,vars:24,consts:[[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",1,"btn","btn-secondary","subscribe-calendar-header",3,"href"],[3,"entries"],["target","_parent",1,"btn","btn-secondary","subscribe-calendar-bottom",3,"href"]],template:function(i,o){if(i&1){let h=ve();d(0,"div",0)(1,"button",1),j("click",function(){return K(h),W(o.gotoToday())}),l(2),a(3,"translate"),c(),d(4,"button",2),a(5,"translate"),j("click",function(){return K(h),W(o.gotoPreviousDay())}),d(6,"span",3),l(7,"chevron_left"),c()(),d(8,"button",4),a(9,"translate"),j("click",function(){return K(h),W(o.gotoNextDay())}),d(10,"span",3),l(11,"chevron_right"),c()(),d(12,"div",5),l(13),a(14,"async"),a(15,"date"),c(),p(16,ni,4,7,"a",6),a(17,"async"),c(),E(18),a(19,"async"),p(20,oi,1,0,"bkd-spinner"),a(21,"async"),p(22,ri,3,4)}if(i&2){let h;n(2),T(" ",r(3,6,"dashboard.timetable.today")," "),n(2),oe("aria-label",r(5,8,"dashboard.timetable.previousDay")),n(4),oe("aria-label",r(9,10,"dashboard.timetable.nextDay")),n(5),P(R(15,14,r(14,12,o.date$),"E, dd. MMMM yyyy")),n(3),m((h=r(17,17,o.getSubscribeCalendarUrl()))?16:-1,h),n(2),U(r(19,19,o.timetableEntries$)),n(2),m(r(21,22,o.loading$)?20:22)}},dependencies:[dt,te,O,Y,M,ot],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%}}"]})}}return e})();function ci(e,s){e&1&&C(0,"bkd-spinner")}function di(e,s){e&1&&(d(0,"p"),l(1),a(2,"translate"),c()),e&2&&(n(),T(" ",r(2,1,"dashboard.no-access")," "))}function li(e,s){e&1&&(d(0,"div")(1,"h2"),l(2),a(3,"translate"),c(),C(4,"bkd-dashboard-search"),c()),e&2&&(n(2),P(r(3,1,"dashboard.search.title")))}function pi(e,s){e&1&&(d(0,"div")(1,"h2"),l(2),a(3,"translate"),c(),C(4,"bkd-dashboard-actions"),c()),e&2&&(n(2),P(r(3,1,"dashboard.actions.title")))}function mi(e,s){if(e&1&&(d(0,"div",1),p(1,li,5,3,"div")(2,pi,5,3,"div"),c()),e&2){f();let t=H(2),i=H(4);n(),m(t?1:-1),n(),m(i?2:-1)}}function hi(e,s){e&1&&(d(0,"div",2)(1,"h2"),l(2),a(3,"translate"),c(),C(4,"bkd-dashboard-timetable"),c()),e&2&&(n(2),P(r(3,1,"dashboard.timetable.title")))}var mt=(()=>{class e{constructor(t){this.dashboardService=t}static{this.\u0275fac=function(i){return new(i||e)(v(I))}}static{this.\u0275cmp=S({type:e,selectors:[["bkd-dashboard-layout"]],decls:17,vars:19,consts:[[1,"columns"],[1,"search-actions-column"],[1,"timetable-column"]],template:function(i,o){if(i&1&&(E(0),a(1,"async"),E(2),a(3,"async"),E(4),a(5,"async"),E(6),a(7,"async"),d(8,"div")(9,"h1"),l(10),a(11,"translate"),c(),p(12,ci,1,0,"bkd-spinner")(13,di,3,3,"p"),d(14,"div",0),p(15,mi,3,2,"div",1)(16,hi,5,3,"div",2),c()()),i&2){let h=r(1,7,o.dashboardService.loading$);n(2);let b=U(r(3,9,o.dashboardService.hasSearch$));n(2);let $=U(r(5,12,o.dashboardService.hasActions$)),N=r(7,15,o.dashboardService.hasTimetable$);n(5),_e("visually-hidden",h||b||$||N),n(),T(" ",r(11,17,"dashboard.heading")," "),n(2),m(h?12:-1),n(),m(!h&&!b&&!$&&!N?13:-1),n(2),m(b||$?15:-1),n(),m(N?16:-1)}},dependencies:[te,nt,it,pt,O,M],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})}}return e})();var ht=(()=>{class e{constructor(){}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=S({type:e,selectors:[["bkd-dashboard"]],features:[Te([I,Ne])],decls:1,vars:0,template:function(i,o){i&1&&C(0,"router-outlet")},dependencies:[ke],encapsulation:2,changeDetection:0})}}return e})();var En=[{path:"",component:ht,children:[{path:"",component:mt},Ke,Ye("students/:id")]}];export{En as DASHBOARD_ROUTES}; diff --git a/public/apps/webapp-schulverwaltung/chunk-PUOIWHIP.js b/public/apps/webapp-schulverwaltung/chunk-RENI6OUS.js similarity index 99% rename from public/apps/webapp-schulverwaltung/chunk-PUOIWHIP.js rename to public/apps/webapp-schulverwaltung/chunk-RENI6OUS.js index 5253dfb9..40c1be11 100644 --- a/public/apps/webapp-schulverwaltung/chunk-PUOIWHIP.js +++ b/public/apps/webapp-schulverwaltung/chunk-RENI6OUS.js @@ -1,2 +1,2 @@ -import{a as Bi}from"./chunk-6XR42WAQ.js";import{a as Pi,b as Ni,c as Mi}from"./chunk-4KY7ONEQ.js";import{a as Li}from"./chunk-W4ESFJ6M.js";import{a as wi}from"./chunk-RTY26FN4.js";import{a as xi}from"./chunk-3HCVMNJA.js";import"./chunk-5WNFCBTP.js";import"./chunk-A3CECLYB.js";import"./chunk-HCNFZOWE.js";import{a as ui,b as hi,e as vi}from"./chunk-746ASKQ4.js";import{a as je}from"./chunk-DTTSX64G.js";import"./chunk-Y4QYVF5K.js";import"./chunk-AYQPMCNZ.js";import{a as Vi}from"./chunk-W3JKHGP4.js";import{a as ki}from"./chunk-BIDSHCYH.js";import{a as Ai,b as Fi,c as Di}from"./chunk-4RZQAAPF.js";import{e as Ti,f as Si}from"./chunk-Z4YBXGVO.js";import"./chunk-3L4RH6QP.js";import{a as yi}from"./chunk-DTYYCJHM.js";import"./chunk-XAZECV42.js";import{a as Oi}from"./chunk-3P6YOVUR.js";import{H as _i,I as at,L as gi,M as ot,N as lt,O as Ae,P as He,Q as bi,g as mi,r as fi,s as rt}from"./chunk-SRCW6BUG.js";import{a as $e,c as st,l as Ci}from"./chunk-GOGVGWFJ.js";import{b as Ii}from"./chunk-OSOXMODN.js";import{b as Ei}from"./chunk-PSYDBHTH.js";import{A as pi,h as ri,i as ai,l as oi,y as we}from"./chunk-W4U7QKJF.js";import{a as ci}from"./chunk-AVBHFGIF.js";import{$a as c,$b as Mt,A as gt,Aa as S,Ab as oe,Ad as Me,Bb as le,Bd as si,Ca as wt,Cb as Y,D as bt,Db as pe,Eb as Dt,F as ie,Fb as X,Ga as H,Gb as Lt,Ha as At,Hb as Bt,Hc as tt,Ia as W,Ib as Ot,Ic as it,Id as li,J as Ct,Jb as d,Kb as u,Lb as ne,M as ue,Ma as Pe,Md as di,Na as b,Nb as ce,Nc as Gt,O as vt,Od as Re,P as ye,Pa as J,Pb as Pt,Pd as me,Qa as _,Qb as B,R as N,Ra as G,Rb as Ie,S as Et,Tc as nt,Ua as Ke,Va as y,W as yt,Wb as Nt,X as Z,Xa as Se,Xb as Vt,Y as Tt,Ya as V,Z as St,Za as M,_ as j,_a as l,a as be,ab as L,b as De,bb as Ft,bc as et,cb as kt,cc as ve,cd as he,da as Te,db as Ye,dc as Rt,dd as qt,ea as v,eb as P,ed as Ut,f as re,fa as E,fd as zt,g as ze,gb as x,hb as h,hd as xe,i as mt,ia as It,ib as Ze,id as Ve,j as ft,ja as Qe,jb as Je,jd as Qt,kb as fe,l as _t,lb as Xe,lc as $t,ma as F,mb as q,md as Kt,n as T,na as xt,nb as _e,nd as Yt,o as Le,ob as k,pb as D,pd as Zt,qb as U,ra as ae,rb as p,rd as Jt,sb as I,sd as Xt,t as Ee,tb as C,td as ei,ub as Ce,ud as ti,vd as ii,w as Be,wc as Ne,x as Oe,xa as o,xb as z,xc as jt,ya as f,yb as Q,yc as Ht,zb as K,zc as Wt,zd as ni}from"./chunk-2W7IS4PN.js";var O=function(t){return t.Absent="absent",t.Dispensation="dispensation",t.HalfDay="half-day",t.Incident="incident",t.Present="present",t}(O||{}),$i=(()=>{class t{constructor(e,i){this.updateService=e,this.settings=i}update(e,i,n,r,a,m){let g=[];switch(n){case O.Present:g=this.createResetBulkRequests(e);break;case O.Absent:g=this.createAbsentEditBulkRequests(e,i,r,a);break;case O.Dispensation:g=this.createEditBulkRequests(e,null,this.settings.dispensationPresenceTypeId);break;case O.HalfDay:g=this.createEditBulkRequests(e,null,this.settings.halfDayPresenceTypeId);break;case O.Incident:g=this.createEditBulkRequests(e,null,m);break}return Le(g).pipe(T(()=>{}))}createAbsentEditBulkRequests(e,i,n,r){return n===this.settings.excusedAbsenceStateId?this.createEditBulkRequests(e,n,r):n===this.settings.unexcusedAbsenceStateId?this.createEditBulkRequests(e,n,this.settings.absencePresenceTypeId):[...this.createEditBulkRequests(e.filter(Ri(i,this.settings)),n,this.settings.absencePresenceTypeId),...this.createEditBulkRequests(e.filter(we(Ri(i,this.settings))),n,null)]}createResetBulkRequests(e){return at(e).map(({lessonIds:i,personIds:n})=>this.updateService.removeLessonPresences(i,n))}createEditBulkRequests(e,i,n){return at(e).map(({lessonIds:r,personIds:a})=>this.updateService.editLessonPresences(r,a,n||void 0,i||void 0))}static{this.\u0275fac=function(i){return new(i||t)(j(bi),j(he))}}static{this.\u0275prov=Z({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();function Ri(t,s){return e=>{let i=t.find(n=>n.Id===e.TypeRef.Id);return!i||i.Id===s.dispensationPresenceTypeId||i.Id===s.halfDayPresenceTypeId||i.IsIncident}}var te=(()=>{class t extends Fi{constructor(e,i,n,r,a,m,g){super(e,i,n,r,"/edit-absences"),this.lessonPresencesService=a,this.presenceTypesService=m,this.dropDownItemsService=g,this.weekdays$=this.loadWeekdays().pipe(ue(1)),this.presenceTypes$=this.loadPresenceTypes().pipe(ue(1)),this.absenceConfirmationStates$=this.loadAbsenceConfirmationStates().pipe(T(ui),ue(1)),this.presenceControlEntries$=Le([this.entries$,this.presenceTypes$,this.absenceConfirmationStates$]).pipe(T(Ci(Bi)),ue(1)),this.selected=[],this.queryParamsString$.pipe(N(this.destroy$)).subscribe(A=>this.confirmBackLinkParams={returnparams:A})}resetSelection(){this.selected=[]}updateAfterConfirm(){this.resetEntries()}getInitialFilter(){return{student:null,educationalEvent:null,studyClass:null,teacher:null,dateFrom:null,dateTo:null,weekdays:null,presenceTypes:null,confirmationStates:null,incidentTypes:null}}isValidFilter(e){return!!(e.student||e.educationalEvent||e.studyClass||e.teacher||e.dateFrom||e.dateTo||e.weekdays||e.presenceTypes||e.confirmationStates||e.incidentTypes)}loadEntries(e,i,n){let r={sort:"StudentFullName.asc,LessonDateTimeFrom.asc"};return this.loadingService.load(this.lessonPresencesService.getFilteredList(e,n,r),Ai)}buildParamsFromFilter(e){return Pi(e)}loadWeekdays(){return this.loadingService.load(this.dropDownItemsService.getWeekdays())}loadPresenceTypes(){return this.loadingService.load(this.presenceTypesService.activePresenceTypes$)}loadAbsenceConfirmationStates(){return this.loadingService.load(this.dropDownItemsService.getAbsenceConfirmationStates())}static{this.\u0275fac=function(i){return new(i||t)(j(Vt),j(Ii),j(Di),j(he),j(vi),j(He),j(je))}}static{this.\u0275prov=Z({token:t,factory:t.\u0275fac})}}return t})();var fn=(t,s)=>s.Key,ji=(t,s)=>s.Id;function _n(t,s){if(t&1&&(l(0,"div",3),p(1),d(2,"translate"),c()),t&2){let e=s.$implicit;o(),C(" ",ne(2,1,"global.validation-errors."+e.error,e.params)," ")}}function gn(t,s){if(t&1&&(l(0,"option",18),p(1),c()),t&2){let e=s.$implicit;_("ngValue",e.Id),o(),C(" ",e.Designation," ")}}function bn(t,s){if(t&1&&(l(0,"select",17),d(1,"async"),l(2,"option",18),p(3),d(4,"translate"),c(),V(5,gn,2,2,"option",18,ji),d(7,"async"),c()),t&2){let e,i=h(5);G("is-invalid",((e=u(1,4,i.absenceTypeIdErrors$))==null?null:e.length)||!1),o(2),_("ngValue",null),o(),C(" ",u(4,6,"edit-absences.edit.absence-type-placeholder")," "),o(2),M(u(7,8,i.absenceTypes$))}}function Cn(t,s){if(t&1&&(l(0,"div",16),p(1),d(2,"translate"),c()),t&2){let e=s.$implicit;o(),C(" ",ne(2,1,"global.validation-errors."+e.error,e.params)," ")}}function vn(t,s){if(t&1&&(l(0,"div",13),L(1,"input",14),l(2,"label",11),p(3),c(),b(4,bn,8,10,"select",15),V(5,Cn,3,4,"div",16,Se),d(7,"async"),c()),t&2){let e=s.$implicit,i=h(4);o(),_("id","state-"+e.Key)("value",e.Key),o(),fe("for","state-"+e.Key),o(),C(" ",e.Value," "),o(),y(i.isExcused(e)?4:-1),o(),M(u(7,5,i.absenceTypeIdErrors$))}}function En(t,s){if(t&1&&(l(0,"div",12),V(1,vn,8,7,"div",13,fn),c()),t&2){h(3);let e=Y(0);o(),M(e)}}function yn(t,s){if(t&1&&(l(0,"option",18),p(1),c()),t&2){let e=s.$implicit;_("ngValue",e.Id),o(),C(" ",e.Designation," ")}}function Tn(t,s){if(t&1&&(l(0,"div",16),p(1),d(2,"translate"),c()),t&2){let e=s.$implicit;o(),C(" ",ne(2,1,"global.validation-errors."+e.error,e.params)," ")}}function Sn(t,s){if(t&1&&(l(0,"div",12)(1,"select",19),d(2,"async"),l(3,"option",18),p(4),d(5,"translate"),c(),V(6,yn,2,2,"option",18,ji),d(8,"async"),c(),V(9,Tn,3,4,"div",16,Se),d(11,"async"),c()),t&2){let e,i=h(3);o(),G("is-invalid",((e=u(2,4,i.incidentIdErrors$))==null?null:e.length)||!1),o(2),_("ngValue",null),o(),C(" ",u(5,6,"edit-absences.edit.incident-placeholder")," "),o(2),M(u(8,8,i.incidents$)),o(3),M(u(11,10,i.incidentIdErrors$))}}function In(t,s){if(t&1&&(l(0,"div",5),L(1,"input",10),l(2,"label",11),p(3),d(4,"translate"),c(),b(5,En,3,0,"div",12)(6,Sn,12,12,"div",12),c()),t&2){let e=s.$implicit,i=h(2);o(),_("id","category-"+e)("value",e),o(),fe("for","category-"+e),o(),C(" ",u(4,6,"edit-absences.edit.categories."+e)," "),o(2),y(i.isAbsent(e)?5:-1),o(),y(i.isIncident(e)?6:-1)}}function xn(t,s){t&1&&(l(0,"div",9)(1,"span",20),p(2,"Loading..."),c()())}function wn(t,s){if(t&1){let e=P();l(0,"form",2),x("ngSubmit",function(){v(e);let n=h();return E(n.onSubmit())}),V(1,_n,3,4,"div",3,Se),d(3,"async"),l(4,"div",4),V(5,In,7,8,"div",5,Se),c(),l(7,"div",6)(8,"button",7),d(9,"async"),x("click",function(){v(e);let n=h();return E(n.cancel())}),p(10),d(11,"translate"),c(),l(12,"button",8),d(13,"async"),p(14),d(15,"translate"),b(16,xn,3,0,"div",9),d(17,"async"),c()()()}if(t&2){let e=h(),i=Y(2),n=Y(4);_("formGroup",n),o(),M(u(3,6,e.formErrors$)),o(4),M(i),o(3),_("disabled",u(9,8,e.saving$)),o(2),C(" ",u(11,10,"edit-absences.edit.cancel")," "),o(2),_("disabled",u(13,12,e.saving$)),o(2),C(" ",u(15,14,"edit-absences.edit.save")," "),o(2),y(u(17,16,e.saving$)?16:-1)}}var Hi=(()=>{class t{constructor(e,i,n,r,a,m,g,A,ee,R){this.fb=e,this.router=i,this.route=n,this.toastService=r,this.translate=a,this.state=m,this.dropDownItemsService=g,this.presenceTypesService=A,this.updateService=ee,this.settings=R,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$=$e(this.formGroup$,this.submitted$),this.absenceTypeIdErrors$=$e(this.formGroup$,this.submitted$,"absenceTypeId"),this.incidentIdErrors$=$e(this.formGroup$,this.submitted$,"incidentId"),this.availableCategories=[O.Absent,O.Dispensation,O.HalfDay,O.Incident,O.Present],this.confirmationStates$=this.dropDownItemsService.getAbsenceConfirmationStates().pipe(T(this.sortAbsenceConfirmationStates.bind(this)),ue(1)),this.activeCategories$=this.presenceTypesService.halfDayActive$.pipe(T($=>$?this.availableCategories:this.availableCategories.filter(ge=>ge!==O.HalfDay))),this.destroy$=new re}ngOnInit(){this.state.selected.length===0&&this.navigateBack(),st(this.formGroup$,"category").pipe(N(this.destroy$)).subscribe(this.updateConfirmationValueDisabled.bind(this)),st(this.formGroup$,"confirmationValue").pipe(N(this.destroy$)).subscribe(this.updateAbsenceTypeIdDisabled.bind(this))}ngOnDestroy(){this.destroy$.next()}isAbsent(e){return e===O.Absent}isExcused(e){return e.Key===this.settings.excusedAbsenceStateId}isIncident(e){return e===O.Incident}onSubmit(){this.submitted$.next(!0),this.formGroup$.pipe(ie(1)).subscribe(e=>{e.valid&&this.save(e)})}cancel(){this.navigateBack()}createFormGroup(){return this.getInitialAbsenceTypeId().pipe(T(e=>this.fb.group({category:[O.Absent,xe.required],confirmationValue:[this.settings.excusedAbsenceStateId,xe.required],absenceTypeId:[e,xe.required],incidentId:[{value:null,disabled:!0},xe.required]})),ue(1))}getInitialAbsenceTypeId(){return this.absenceTypes$.pipe(ie(1),T(e=>{let i=e.map(r=>r.Id),n=li(this.state.selected.map(r=>r.TypeRef.Id));return n.length===1&&n[0]!=null&&i.includes(n[0])?n[0]:null}))}updateConfirmationValueDisabled(){this.formGroup$.pipe(ie(1)).subscribe(e=>{let i=e.get("category"),n=e.get("confirmationValue"),r=e.get("absenceTypeId"),a=e.get("incidentId");i&&n&&r&&a&&(i.value===O.Absent?(n.enable(),this.updateAbsenceTypeIdDisabled()):(n.disable(),r.disable()),i.value===O.Incident?a.enable():a.disable())})}updateAbsenceTypeIdDisabled(){this.formGroup$.pipe(ie(1)).subscribe(e=>{let i=e.get("confirmationValue"),n=e.get("absenceTypeId");i&&n&&(i.value===this.settings.excusedAbsenceStateId?n.enable():n.disable())})}save(e){this.saving$.next(!0);let{category:i,confirmationValue:n,absenceTypeId:r,incidentId:a}=e.value;this.presenceTypesService.presenceTypes$.pipe(ye(m=>this.updateService.update(this.state.selected,m,i,n,r,a)),Ct(()=>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(ie(1)).subscribe(i=>{this.router.navigate(["/edit-absences"],{queryParams:De(be({},yi(i.returnparams)),{reload:e})})})}sortAbsenceConfirmationStates(e){return e.slice().sort((i,n)=>i.Key===this.settings.excusedAbsenceStateId?-1:n.Key===this.settings.excusedAbsenceStateId?1:i.Value.localeCompare(n.Value))}static{this.\u0275fac=function(i){return new(i||t)(f(ni),f(Ht),f(Ne),f(ci),f(Re),f(te),f(je),f(He),f($i),f(he))}}static{this.\u0275cmp=H({type:t,selectors:[["bkd-edit-absences-edit"]],decls:11,vars:13,consts:[[1,"bkd-container","bkd-container-limited"],[3,"formGroup"],[3,"ngSubmit","formGroup"],[1,"alert","alert-danger"],[1,"form-group","pb-4"],[1,"form-check","mt-2","mb-3"],[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"],["role","status",1,"spinner-border","spinner-border-sm","align-middle"],["type","radio","formControlName","category",1,"form-check-input",3,"id","value"],[1,"form-check-label",3,"for"],[1,"ms-5"],[1,"form-check","mt-2","mb-2"],["type","radio","formControlName","confirmationValue",1,"form-check-input",3,"id","value"],["formControlName","absenceTypeId",1,"form-select","mt-1",3,"is-invalid"],[1,"invalid-feedback"],["formControlName","absenceTypeId",1,"form-select","mt-1"],[3,"ngValue"],["formControlName","incidentId",1,"form-select","mt-1"],[1,"visually-hidden"]],template:function(i,n){if(i&1&&(oe(0),d(1,"async"),oe(2),d(3,"async"),oe(4),d(5,"async"),l(6,"h1"),p(7),d(8,"translate"),c(),l(9,"div",0),b(10,wn,18,18,"form",1),c()),i&2){let r=le(u(1,2,n.confirmationStates$));o(2),le(u(3,5,n.activeCategories$)),o(2);let a=le(u(5,8,n.formGroup$));o(3),I(u(8,11,"edit-absences.title")),o(3),y(a&&r?10:-1)}},dependencies:[Me,Yt,ti,ii,zt,ei,Zt,Ve,Qt,si,Jt,Xt,ve,me],encapsulation:2,changeDetection:0})}}return t})();var Ge=(()=>{class t extends _i{static{this.\u0275fac=(()=>{let e;return function(n){return(e||(e=It(t)))(n||t)}})()}static{this.\u0275prov=Z({token:t,factory:t.\u0275fac})}}return t})();var Fn=["content"],kn=["scroll"],Dn=["padding"],qi=["*"],ke=t=>({searchTerm:t});function Ln(t,s){if(t&1&&(l(0,"div",3),Ye(1,6),c()),t&2){let e=h();o(),_("ngTemplateOutlet",e.headerTemplate)("ngTemplateOutletContext",X(2,ke,e.filterValue))}}function Bn(t,s){if(t&1&&(l(0,"div",5),Ye(1,6),c()),t&2){let e=h();o(),_("ngTemplateOutlet",e.footerTemplate)("ngTemplateOutletContext",X(2,ke,e.filterValue))}}var On=["searchInput"],Pn=["clearButton"],Nn=(t,s,e)=>({item:t,clear:s,label:e}),Vn=(t,s)=>({items:t,clear:s}),Mn=(t,s,e,i)=>({item:t,item$:s,index:e,searchTerm:i});function Rn(t,s){if(t&1&&(l(0,"div",20),p(1),c()),t&2){let e=h(2);o(),I(e.placeholder)}}function $n(t,s){}function jn(t,s){if(t&1&&b(0,Rn,2,1,"ng-template",null,1,ce)(2,$n,0,0,"ng-template",19),t&2){let e=U(1),i=h();o(2),_("ngTemplateOutlet",i.placeholderTemplate||e)}}function Hn(t,s){if(t&1){let e=P();l(0,"span",23),x("click",function(){v(e);let n=h().$implicit,r=h(2);return E(r.unselect(n))}),p(1,"\xD7"),c(),L(2,"span",24)}if(t&2){let e=h().$implicit,i=h(2);o(2),_("ngItemLabel",e.label)("escape",i.escapeHTML)}}function Wn(t,s){}function Gn(t,s){if(t&1&&(l(0,"div",22),b(1,Hn,3,2,"ng-template",null,2,ce)(3,Wn,0,0,"ng-template",12),c()),t&2){let e=s.$implicit,i=U(2),n=h(2);G("ng-value-disabled",e.disabled),o(3),_("ngTemplateOutlet",n.labelTemplate||i)("ngTemplateOutletContext",Bt(4,Nn,e.value,n.clearItem,e.label))}}function qn(t,s){if(t&1&&V(0,Gn,4,8,"div",21,Ke().trackByOption,!0),t&2){let e=h();M(e.selectedItems)}}function Un(t,s){}function zn(t,s){if(t&1&&b(0,Un,0,0,"ng-template",12),t&2){let e=h();_("ngTemplateOutlet",e.multiLabelTemplate)("ngTemplateOutletContext",Lt(2,Vn,e.selectedValues,e.clearItem))}}function Qn(t,s){t&1&&L(0,"div",25)}function Kn(t,s){}function Yn(t,s){if(t&1&&b(0,Qn,1,0,"ng-template",null,3,ce)(2,Kn,0,0,"ng-template",19),t&2){let e=U(1),i=h();o(2),_("ngTemplateOutlet",i.loadingSpinnerTemplate||e)}}function Zn(t,s){if(t&1&&(l(0,"span",15,4)(2,"span",26),p(3,"\xD7"),c()()),t&2){let e=h();fe("title",e.clearAllText)}}function Jn(t,s){if(t&1&&L(0,"span",31),t&2){let e=h().$implicit,i=h(2);_("ngItemLabel",e.label)("escape",i.escapeHTML)}}function Xn(t,s){}function es(t,s){if(t&1){let e=P();l(0,"div",30),x("click",function(){let n=v(e).$implicit,r=h(2);return E(r.toggleItem(n))})("mouseover",function(){let n=v(e).$implicit,r=h(2);return E(r.onItemHover(n))}),b(1,Jn,1,2,"ng-template",null,5,ce)(3,Xn,0,0,"ng-template",12),c()}if(t&2){let e=s.$implicit,i=U(2),n=h(2);G("ng-option-disabled",e.disabled)("ng-option-selected",e.selected)("ng-optgroup",e.children)("ng-option",!e.children)("ng-option-child",!!e.parent)("ng-option-marked",e===n.itemsList.markedItem),J("role",e.children?"group":"option")("aria-selected",e.selected)("id",e==null?null:e.htmlId),o(3),_("ngTemplateOutlet",e.children?n.optgroupTemplate||i:n.optionTemplate||i)("ngTemplateOutletContext",Ot(17,Mn,e.value,e,e.index,n.searchTerm))}}function ts(t,s){if(t&1&&(l(0,"span")(1,"span",33),p(2),c(),p(3),c()),t&2){let e=h(3);o(2),I(e.addTagText),o(),C('"',e.searchTerm,'"')}}function is(t,s){}function ns(t,s){if(t&1){let e=P();l(0,"div",32),x("mouseover",function(){v(e);let n=h(2);return E(n.itemsList.unmarkItem())})("click",function(){v(e);let n=h(2);return E(n.selectTag())}),b(1,ts,4,2,"ng-template",null,6,ce)(3,is,0,0,"ng-template",12),c()}if(t&2){let e=U(2),i=h(2);G("ng-option-marked",!i.itemsList.markedItem),o(3),_("ngTemplateOutlet",i.tagTemplate||e)("ngTemplateOutletContext",X(4,ke,i.searchTerm))}}function ss(t,s){if(t&1&&(l(0,"div",34),p(1),c()),t&2){let e=h(3);o(),I(e.notFoundText)}}function rs(t,s){}function as(t,s){if(t&1&&b(0,ss,2,1,"ng-template",null,7,ce)(2,rs,0,0,"ng-template",12),t&2){let e=U(1),i=h(2);o(2),_("ngTemplateOutlet",i.notFoundTemplate||e)("ngTemplateOutletContext",X(2,ke,i.searchTerm))}}function os(t,s){if(t&1&&(l(0,"div",34),p(1),c()),t&2){let e=h(3);o(),I(e.typeToSearchText)}}function ls(t,s){}function cs(t,s){if(t&1&&b(0,os,2,1,"ng-template",null,8,ce)(2,ls,0,0,"ng-template",19),t&2){let e=U(1),i=h(2);o(2),_("ngTemplateOutlet",i.typeToSearchTemplate||e)}}function ds(t,s){if(t&1&&(l(0,"div",34),p(1),c()),t&2){let e=h(3);o(),I(e.loadingText)}}function us(t,s){}function ps(t,s){if(t&1&&b(0,ds,2,1,"ng-template",null,9,ce)(2,us,0,0,"ng-template",12),t&2){let e=U(1),i=h(2);o(2),_("ngTemplateOutlet",i.loadingTextTemplate||e)("ngTemplateOutletContext",X(2,ke,i.searchTerm))}}function hs(t,s){if(t&1){let e=P();l(0,"ng-dropdown-panel",27),x("update",function(n){v(e);let r=h();return E(r.viewPortItems=n)})("scroll",function(n){v(e);let r=h();return E(r.scroll.emit(n))})("scrollToEnd",function(n){v(e);let r=h();return E(r.scrollToEnd.emit(n))})("outsideClick",function(){v(e);let n=h();return E(n.close())}),Ft(1),V(2,es,4,22,"div",28,Ke().trackByOption,!0),b(4,ns,4,6,"div",29),kt(),b(5,as,3,4)(6,cs,3,1)(7,ps,3,4),c()}if(t&2){let e=h();G("ng-select-multiple",e.multiple),_("virtualScroll",e.virtualScroll)("bufferAmount",e.bufferAmount)("appendTo",e.appendTo)("position",e.dropdownPosition)("headerTemplate",e.headerTemplate)("footerTemplate",e.footerTemplate)("filterValue",e.searchTerm)("items",e.itemsList.filteredItems)("markedItem",e.itemsList.markedItem)("ngClass",e.appendTo?e.ngClass?e.ngClass:e.classes:null)("id",e.dropdownId),J("aria-label",e.ariaLabelDropdown),o(2),M(e.viewPortItems),o(2),y(e.showAddTag?4:-1),o(),y(e.showNoItemsFound()?5:-1),o(),y(e.showTypeToSearch()?6:-1),o(),y(e.loading&&e.itemsList.filteredItems.length===0?7:-1)}}var Ui=/[&<>"']/g,ms=RegExp(Ui.source),fs={"&":"&","<":"<",">":">",'"':""","'":"'"};function _s(t){return t&&ms.test(t)?t.replace(Ui,s=>fs[s]):t}function w(t){return t!=null}function Fe(t){return typeof t=="object"&&w(t)}function gs(t){return t instanceof Promise}function Ue(t){return t instanceof Function}var bs=(()=>{class t{constructor(e){this.element=e,this.escape=!0}ngOnChanges(e){this.element.nativeElement.innerHTML=this.escape?_s(this.ngItemLabel):this.ngItemLabel}static{this.\u0275fac=function(i){return new(i||t)(f(ae))}}static{this.\u0275dir=W({type:t,selectors:[["","ngItemLabel",""]],inputs:{ngItemLabel:"ngItemLabel",escape:"escape"},features:[Te]})}}return t})(),ut=(()=>{class t{constructor(e){this.template=e}static{this.\u0275fac=function(i){return new(i||t)(f(S))}}static{this.\u0275dir=W({type:t,selectors:[["","ng-option-tmp",""]]})}}return t})(),pt=(()=>{class t{constructor(e){this.template=e}static{this.\u0275fac=function(i){return new(i||t)(f(S))}}static{this.\u0275dir=W({type:t,selectors:[["","ng-optgroup-tmp",""]]})}}return t})(),Cs=(()=>{class t{constructor(e){this.template=e}static{this.\u0275fac=function(i){return new(i||t)(f(S))}}static{this.\u0275dir=W({type:t,selectors:[["","ng-label-tmp",""]]})}}return t})(),ht=(()=>{class t{constructor(e){this.template=e}static{this.\u0275fac=function(i){return new(i||t)(f(S))}}static{this.\u0275dir=W({type:t,selectors:[["","ng-multi-label-tmp",""]]})}}return t})(),vs=(()=>{class t{constructor(e){this.template=e}static{this.\u0275fac=function(i){return new(i||t)(f(S))}}static{this.\u0275dir=W({type:t,selectors:[["","ng-header-tmp",""]]})}}return t})(),Es=(()=>{class t{constructor(e){this.template=e}static{this.\u0275fac=function(i){return new(i||t)(f(S))}}static{this.\u0275dir=W({type:t,selectors:[["","ng-footer-tmp",""]]})}}return t})(),ys=(()=>{class t{constructor(e){this.template=e}static{this.\u0275fac=function(i){return new(i||t)(f(S))}}static{this.\u0275dir=W({type:t,selectors:[["","ng-notfound-tmp",""]]})}}return t})(),Ts=(()=>{class t{constructor(e){this.template=e}static{this.\u0275fac=function(i){return new(i||t)(f(S))}}static{this.\u0275dir=W({type:t,selectors:[["","ng-placeholder-tmp",""]]})}}return t})(),Ss=(()=>{class t{constructor(e){this.template=e}static{this.\u0275fac=function(i){return new(i||t)(f(S))}}static{this.\u0275dir=W({type:t,selectors:[["","ng-typetosearch-tmp",""]]})}}return t})(),Is=(()=>{class t{constructor(e){this.template=e}static{this.\u0275fac=function(i){return new(i||t)(f(S))}}static{this.\u0275dir=W({type:t,selectors:[["","ng-loadingtext-tmp",""]]})}}return t})(),xs=(()=>{class t{constructor(e){this.template=e}static{this.\u0275fac=function(i){return new(i||t)(f(S))}}static{this.\u0275dir=W({type:t,selectors:[["","ng-tag-tmp",""]]})}}return t})(),ws=(()=>{class t{constructor(e){this.template=e}static{this.\u0275fac=function(i){return new(i||t)(f(S))}}static{this.\u0275dir=W({type:t,selectors:[["","ng-loadingspinner-tmp",""]]})}}return t})();function zi(){return"axxxxxxxxxxx".replace(/[x]/g,()=>(Math.random()*16|0).toString(16))}var As={"\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 qe(t){let s=e=>As[e]||e;return t.replace(/[^\u0000-\u007E]/g,s)}var ct=class{constructor(s,e){this._ngSelect=s,this._selectionModel=e,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 s=this.selectedItems.length-1;for(;s>=0;s--){let e=this.selectedItems[s];if(!e.disabled)return e}return null}setItems(s){this._items=s.map((e,i)=>this.mapItem(e,i)),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(s){if(s.selected||this.maxItemsSelected)return;let e=this._ngSelect.multiple;e||this.clearSelected(),this._selectionModel.select(s,e,this._ngSelect.selectableGroupAsModel),this._ngSelect.hideSelected&&this._hideSelected(s)}unselect(s){s.selected&&(this._selectionModel.unselect(s,this._ngSelect.multiple),this._ngSelect.hideSelected&&w(s.index)&&this._ngSelect.multiple&&this._showSelected(s))}findItem(s){let e;return this._ngSelect.compareWith?e=i=>this._ngSelect.compareWith(i.value,s):this._ngSelect.bindValue?e=i=>!i.children&&this.resolveNested(i.value,this._ngSelect.bindValue)===s:e=i=>i.value===s||!i.children&&i.label&&i.label===this.resolveNested(s,this._ngSelect.bindLabel),this._items.find(i=>e(i))}addItem(s){let e=this.mapItem(s,this._items.length);return this._items.push(e),this._filteredItems.push(e),e}clearSelected(s=!1){this._selectionModel.clear(s),this._items.forEach(e=>{e.selected=s&&e.selected&&e.disabled,e.marked=!1}),this._ngSelect.hideSelected&&this.resetFilteredItems()}findByLabel(s){return s=qe(s).toLocaleLowerCase(),this.filteredItems.find(e=>qe(e.label).toLocaleLowerCase().substr(0,s.length)===s)}filter(s){if(!s){this.resetFilteredItems();return}this._filteredItems=[],s=this._ngSelect.searchFn?s:qe(s).toLocaleLowerCase();let e=this._ngSelect.searchFn||this._defaultSearchFn,i=this._ngSelect.hideSelected;for(let n of Array.from(this._groups.keys())){let r=[];for(let a of this._groups.get(n)){if(i&&(a.parent&&a.parent.selected||a.selected))continue;let m=this._ngSelect.searchFn?a.value:a;e(s,m)&&r.push(a)}if(r.length>0){let[a]=r.slice(-1);if(a.parent){let m=this._items.find(g=>g===a.parent);this._filteredItems.push(m)}this._filteredItems.push(...r)}}}resetFilteredItems(){this._filteredItems.length!==this._items.length&&(this._ngSelect.hideSelected&&this.selectedItems.length>0?this._filteredItems=this._items.filter(s=>!s.selected):this._filteredItems=this._items)}unmarkItem(){this._markedIndex=-1}markNextItem(){this._stepToItem(1)}markPreviousItem(){this._stepToItem(-1)}markItem(s){this._markedIndex=this._filteredItems.indexOf(s)}markSelectedOrDefault(s){if(this._filteredItems.length===0)return;let e=this._getLastMarkedIndex();e>-1?this._markedIndex=e:this._markedIndex=s?this.filteredItems.findIndex(i=>!i.disabled):-1}resolveNested(s,e){if(!Fe(s))return s;if(e.indexOf(".")===-1)return s[e];{let i=e.split("."),n=s;for(let r=0,a=i.length;rthis.selectedItems.indexOf(e)===-1))}_showSelected(s){if(this._filteredItems.push(s),s.parent){let e=s.parent;this._filteredItems.find(n=>n===e)||this._filteredItems.push(e)}else if(s.children)for(let e of s.children)e.selected=!1,this._filteredItems.push(e);this._filteredItems=[...this._filteredItems.sort((e,i)=>e.index-i.index)]}_hideSelected(s){this._filteredItems=this._filteredItems.filter(e=>e!==s),s.parent?s.parent.children.every(i=>i.selected)&&(this._filteredItems=this._filteredItems.filter(i=>i!==s.parent)):s.children&&(this._filteredItems=this.filteredItems.filter(e=>e.parent!==s))}_defaultSearchFn(s,e){return qe(e.label).toLocaleLowerCase().indexOf(s)>-1}_getNextItemIndex(s){return s>0?this._markedIndex>=this._filteredItems.length-1?0:this._markedIndex+1:this._markedIndex<=0?this._filteredItems.length-1:this._markedIndex-1}_stepToItem(s){this._filteredItems.length===0||this._filteredItems.every(e=>e.disabled)||(this._markedIndex=this._getNextItemIndex(s),this.markedItem.disabled&&this._stepToItem(s))}_getLastMarkedIndex(){if(this._ngSelect.hideSelected||this._markedIndex>-1&&this.markedItem===void 0)return-1;let s=this._filteredItems.indexOf(this.lastSelectedItem);return this.lastSelectedItem&&s<0?-1:Math.max(this.markedIndex,s)}_groupBy(s,e){let i=new Map;if(s.length===0)return i;if(Array.isArray(s[0].value[e])){for(let a of s){let m=(a.value[e]||[]).map((g,A)=>this.mapItem(g,A));i.set(a,m)}return i}let n=Ue(this._ngSelect.groupBy),r=a=>{let m=n?e(a.value):a.value[e];return w(m)?m:void 0};for(let a of s){let m=r(a),g=i.get(m);g?g.push(a):i.set(m,[a])}return i}_flatten(s){let e=Ue(this._ngSelect.groupBy),i=[];for(let n of Array.from(s.keys())){let r=i.length;if(n===void 0){let R=s.get(void 0)||[];i.push(...R.map($=>($.index=r++,$)));continue}let a=Fe(n),m={label:a?"":String(n),children:void 0,parent:null,index:r++,disabled:!this._ngSelect.selectableGroup,htmlId:zi()},g=e?this._ngSelect.bindLabel:this._ngSelect.groupBy,A=this._ngSelect.groupValue||(()=>a?n.value:{[g]:n}),ee=s.get(n).map(R=>(R.parent=m,R.children=void 0,R.index=r++,R));m.children=ee,m.value=A(n,ee.map(R=>R.value)),i.push(m),i.push(...ee)}return i}},Qi=(()=>{class t{constructor(){this._dimensions={itemHeight:0,panelHeight:0,itemsPerViewport:0}}get dimensions(){return this._dimensions}calculateItems(e,i,n){let r=this._dimensions,a=r.itemHeight*i,g=Math.max(0,e)/a*i,A=Math.min(i,Math.ceil(g)+(r.itemsPerViewport+1)),R=Math.max(0,A-r.itemsPerViewport),$=Math.min(R,Math.floor(g)),ge=r.itemHeight*Math.ceil($)-r.itemHeight*Math.min($,n);return ge=isNaN(ge)?0:ge,$=isNaN($)?-1:$,A=isNaN(A)?-1:A,$-=n,$=Math.max(0,$),A+=n,A=Math.min(i,A),{topPadding:ge,scrollHeight:a,start:$,end:A}}setDimensions(e,i){let n=Math.max(1,Math.floor(i/e));this._dimensions={itemHeight:e,panelHeight:i,itemsPerViewport:n}}getScrollTo(e,i,n){let{panelHeight:r}=this.dimensions,a=e+i,m=n,g=m+r;return r>=a&&n===e?null:a>g?m+a-g:e<=m?e:null}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=Z({token:t,factory:t.\u0275fac})}}return t})(),Wi=["top","right","bottom","left"],Fs=typeof requestAnimationFrame<"u"?ft:mt,Gi=(()=>{class t{constructor(e,i,n,r,a){this._renderer=e,this._zone=i,this._panelService=n,this._document=a,this.items=[],this.position="auto",this.virtualScroll=!1,this.filterValue=null,this.update=new F,this.scroll=new F,this.scrollToEnd=new F,this.outsideClick=new F,this._destroy$=new re,this._scrollToEndFired=!1,this._updateScrollHeight=!1,this._lastScrollPosition=0,this._dropdown=r.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:i}=this._panelService.dimensions,n=this.markedItem.index*e;return i>n?0:n}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 i=e.items;this._onItemsChange(i.currentValue,i.firstChange)}}ngOnDestroy(){this._destroy$.next(),this._destroy$.complete(),this._destroy$.unsubscribe(),this.appendTo&&this._renderer.removeChild(this._dropdown.parentNode,this._dropdown)}scrollTo(e,i=!1){if(!e)return;let n=this.items.indexOf(e);if(n<0||n>=this.itemsLength)return;let r;if(this.virtualScroll){let a=this._panelService.dimensions.itemHeight;r=this._panelService.getScrollTo(n*a,a,this._lastScrollPosition)}else{let a=this._dropdown.querySelector(`#${e.htmlId}`),m=i?a.offsetTop:this._lastScrollPosition;r=this._panelService.getScrollTo(a.offsetTop,a.clientHeight,m)}w(r)&&(this._scrollablePanel.scrollTop=r)}scrollToTag(){let e=this._scrollablePanel;e.scrollTop=e.scrollHeight-e.clientHeight}adjustPosition(){this._updateYPosition()}_handleDropdownPosition(){this._currentPosition=this._calculateCurrentPosition(this._dropdown),Wi.includes(this._currentPosition)?this._updateDropdownClass(this._currentPosition):this._updateDropdownClass("bottom"),this.appendTo&&this._updateYPosition(),this._dropdown.style.opacity="1"}_updateDropdownClass(e){Wi.forEach(n=>{let r=`ng-select-${n}`;this._renderer.removeClass(this._dropdown,r),this._renderer.removeClass(this._select,r)});let i=`ng-select-${e}`;this._renderer.addClass(this._dropdown,i),this._renderer.addClass(this._select,i)}_handleScroll(){this._zone.runOutsideAngular(()=>{Ee(this.scrollElementRef.nativeElement,"scroll").pipe(N(this._destroy$),gt(0,Fs)).subscribe(e=>{let i=e.path||e.composedPath&&e.composedPath();if(!i||i.length===0&&!e.target)return;let n=!i||i.length===0?e.target.scrollTop:i[0].scrollTop;this._onContentScrolled(n)})})}_handleOutsideClick(){this._document&&this._zone.runOutsideAngular(()=>{Be(Ee(this._document,"touchstart",{capture:!0}),Ee(this._document,"click",{capture:!0})).pipe(N(this._destroy$)).subscribe(e=>this._checkToClose(e))})}_checkToClose(e){if(this._select.contains(e.target)||this._dropdown.contains(e.target))return;let i=e.path||e.composedPath&&e.composedPath();e.target&&e.target.shadowRoot&&i&&i[0]&&this._select.contains(i[0])||this._zone.run(()=>this.outsideClick.emit())}_onItemsChange(e,i){this.items=e||[],this._scrollToEndFired=!1,this.itemsLength=e.length,this.virtualScroll?this._updateItemsRange(i):(this._setVirtualHeight(),this._updateItems(i))}_updateItems(e){this.update.emit(this.items),e!==!1&&this._zone.runOutsideAngular(()=>{Promise.resolve().then(()=>{let i=this._scrollablePanel.clientHeight;this._panelService.setDimensions(0,i),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 i=this._panelService.calculateItems(e,this.itemsLength,this.bufferAmount);this._updateVirtualHeight(i.scrollHeight),this._contentPanel.style.transform=`translateY(${i.topPadding}px)`,this._zone.run(()=>{this.update.emit(this.items.slice(i.start,i.end)),this.scroll.emit({start:i.start,end:i.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 n=this._dropdown.querySelector(`#${e.htmlId}`).clientHeight;this._virtualPadding.style.height=`${n*this.itemsLength}px`;let r=this._scrollablePanel.clientHeight;return this._panelService.setDimensions(n,r),this._panelService.dimensions})}_fireScrollToEnd(e){if(this._scrollToEndFired||e===0)return;let i=this.virtualScroll?this._virtualPadding:this._contentPanel;e+this._dropdown.clientHeight>=i.clientHeight-1&&(this._zone.run(()=>this.scrollToEnd.emit()),this._scrollToEndFired=!0)}_calculateCurrentPosition(e){if(this.position!=="auto")return this.position;let i=this._select.getBoundingClientRect(),n=document.documentElement.scrollTop||document.body.scrollTop,r=i.top+window.pageYOffset,a=i.height,m=e.getBoundingClientRect().height;return r+a+m>n+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(),i=this._parent.getBoundingClientRect(),n=e.left-i.left;this._dropdown.style.left=n+"px",this._dropdown.style.width=e.width+"px",this._dropdown.style.minWidth=e.width+"px"}_updateYPosition(){let e=this._select.getBoundingClientRect(),i=this._parent.getBoundingClientRect(),n=e.height;if(this._currentPosition==="top"){let r=i.bottom-e.bottom;this._dropdown.style.bottom=r+n+"px",this._dropdown.style.top="auto"}else if(this._currentPosition==="bottom"){let r=e.top-i.top;this._dropdown.style.top=r+n+"px",this._dropdown.style.bottom="auto"}}_setupMousedownListener(){this._zone.runOutsideAngular(()=>{Ee(this._dropdown,"mousedown").pipe(N(this._destroy$)).subscribe(e=>{e.target.tagName!=="INPUT"&&e.preventDefault()})})}static{this.\u0275fac=function(i){return new(i||t)(f(wt),f(xt),f(Qi),f(ae),f(Nt,8))}}static{this.\u0275cmp=H({type:t,selectors:[["ng-dropdown-panel"]],viewQuery:function(i,n){if(i&1&&(_e(Fn,7,ae),_e(kn,7,ae),_e(Dn,7,ae)),i&2){let r;k(r=D())&&(n.contentElementRef=r.first),k(r=D())&&(n.scrollElementRef=r.first),k(r=D())&&(n.paddingElementRef=r.first)}},inputs:{items:"items",markedItem:"markedItem",position:"position",appendTo:"appendTo",bufferAmount:"bufferAmount",virtualScroll:[2,"virtualScroll","virtualScroll",B],headerTemplate:"headerTemplate",footerTemplate:"footerTemplate",filterValue:"filterValue"},outputs:{update:"update",scroll:"scroll",scrollToEnd:"scrollToEnd",outsideClick:"outsideClick"},features:[Pe,Te],ngContentSelectors:qi,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(i,n){i&1&&(Ze(),b(0,Ln,2,4,"div",3),l(1,"div",4,0),L(3,"div",null,1),l(5,"div",null,2),Je(7),c()(),b(8,Bn,2,4,"div",5)),i&2&&(y(n.headerTemplate?0:-1),o(3),G("total-padding",n.virtualScroll),o(2),G("scrollable-content",n.virtualScroll&&n.items.length),o(3),y(n.footerTemplate?8:-1))},dependencies:[et],encapsulation:2,changeDetection:0})}}return t})(),ks=(()=>{class t{constructor(e){this.elementRef=e,this.disabled=!1,this.stateChange$=new re}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()}static{this.\u0275fac=function(i){return new(i||t)(f(ae))}}static{this.\u0275cmp=H({type:t,selectors:[["ng-option"]],inputs:{value:"value",disabled:[2,"disabled","disabled",B]},features:[Pe,Te],ngContentSelectors:qi,decls:1,vars:0,template:function(i,n){i&1&&(Ze(),Je(0))},encapsulation:2,changeDetection:0})}}return t})(),se=function(t){return t[t.Tab=9]="Tab",t[t.Enter=13]="Enter",t[t.Esc=27]="Esc",t[t.Space=32]="Space",t[t.ArrowUp=38]="ArrowUp",t[t.ArrowDown=40]="ArrowDown",t[t.Backspace=8]="Backspace",t}(se||{});function Ki(){return new dt}var dt=class{constructor(){this._selected=[]}get value(){return this._selected}select(s,e,i){if(s.selected=!0,(!s.children||!e&&i)&&this._selected.push(s),e)if(s.parent){let n=s.parent.children.length,r=s.parent.children.filter(a=>a.selected).length;s.parent.selected=n===r}else s.children&&(this._setChildrenSelectedState(s.children,!0),this._removeChildren(s),i&&this._activeChildren(s)?this._selected=[...this._selected.filter(n=>n.parent!==s),s]:this._selected=[...this._selected,...s.children.filter(n=>!n.disabled)])}unselect(s,e){if(this._selected=this._selected.filter(i=>i!==s),s.selected=!1,e)if(s.parent&&s.parent.selected){let i=s.parent.children;this._removeParent(s.parent),this._removeChildren(s.parent),this._selected.push(...i.filter(n=>n!==s&&!n.disabled)),s.parent.selected=!1}else s.children&&(this._setChildrenSelectedState(s.children,!1),this._removeChildren(s))}clear(s){this._selected=s?this._selected.filter(e=>e.disabled):[]}_setChildrenSelectedState(s,e){for(let i of s)i.disabled||(i.selected=e)}_removeChildren(s){this._selected=[...this._selected.filter(e=>e.parent!==s),...s.children.filter(e=>e.parent===s&&e.disabled&&e.selected)]}_removeParent(s){this._selected=this._selected.filter(e=>e!==s)}_activeChildren(s){return s.children.every(e=>!e.disabled||e.selected)}},Ds=(()=>{class t{constructor(){this.fixedPlaceholder=!0,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"}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=Z({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})(),Ls=(()=>{class t{warn(e){console.warn(e)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=Z({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})(),Yi=new St("ng-select-selection-model"),Zi=(()=>{class t{constructor(e,i,n,r,a,m,g){this.classes=e,this.autoFocus=i,this.config=n,this._cd=m,this._console=g,this.ariaLabelDropdown="Options List",this.markFirst=!0,this.fixedPlaceholder=!0,this.preventToggleOnRightClick=!1,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.ngClass=null,this.multiple=!1,this.addTag=!1,this.searchable=!0,this.clearable=!0,this.isOpen=!1,this.blurEvent=new F,this.focusEvent=new F,this.changeEvent=new F,this.openEvent=new F,this.closeEvent=new F,this.searchEvent=new F,this.clearEvent=new F,this.addEvent=new F,this.removeEvent=new F,this.scroll=new F,this.scrollToEnd=new F,this.useDefaultClass=!0,this.viewPortItems=[],this.searchTerm=null,this.dropdownId=zi(),this.escapeHTML=!0,this._defaultLabel="label",this._pressedKeys=[],this._isComposing=!1,this._destroy$=new re,this._keyPress$=new re,this._items=[],this.keyDownFn=A=>!0,this.clearItem=A=>{let ee=this.selectedItems.find(R=>R.value===A);this.unselect(ee)},this.trackByOption=(A,ee)=>this.trackByFn?this.trackByFn(ee.value):ee,this._onChange=A=>{},this._onTouched=()=>{},this._mergeGlobalConfig(n),this.itemsList=new ct(this,r?r():Ki()),this.element=a.nativeElement}get filtered(){return!!this.searchTerm&&this.searchable||this._isComposing}get single(){return!this.multiple}get items(){return this._items}set items(e){this._itemsAreUsed=!0,this._items=e??[]}get disabled(){return this.readonly||this._disabled}get compareWith(){return this._compareWith}set compareWith(e){if(e!=null&&!Ue(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 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}get showAddTag(){if(!this._validTerm)return!1;let e=this.searchTerm.toLowerCase().trim();return this.addTag&&!this.itemsList.filteredItems.some(i=>i.label.toLowerCase()===e)&&(!this.hideSelected&&this.isOpen||!this.selectedItems.some(i=>i.label.toLowerCase()===e))&&!this.loading}get _editableSearchTerm(){return this.editableSearchTerm&&!this.multiple}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}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(se[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 i=e.target;this.clearButton&&this.clearButton.nativeElement===i?this.handleKeyCodeClear(e):this.handleKeyCodeInput(e)}handleKeyCodeInput(e){switch(e.which){case se.ArrowDown:this._handleArrowDown(e);break;case se.ArrowUp:this._handleArrowUp(e);break;case se.Space:this._handleSpace(e);break;case se.Enter:this._handleEnter(e);break;case se.Tab:this._handleTab(e);break;case se.Esc:this.close(),e.preventDefault();break;case se.Backspace:this._handleBackspace();break}}handleKeyCodeClear(e){switch(e.which){case se.Enter:this.handleClearClick(),e.preventDefault();break}}handleMousedown(e){if(this.preventToggleOnRightClick&&e.button===2)return!1;let i=e.target;if(i.tagName!=="INPUT"&&e.preventDefault(),i.classList.contains("ng-clear-wrapper")){this.handleClearClick();return}if(i.classList.contains("ng-arrow-wrapper")){this.handleArrowClick();return}i.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())}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(),this._onSelectionChanged()}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),this._onSelectionChanged())}selectTag(){let e;Ue(this.addTag)?e=this.addTag(this.searchTerm):e=this._primitive?this.searchTerm:{[this.bindLabel]:this.searchTerm};let i=n=>this._isTypeahead||!this.isOpen?this.itemsList.mapItem(n,null):this.itemsList.addItem(n);gs(e)?e.then(n=>this.select(i(n))).catch(()=>{}):e&&this.select(i(e))}showClear(){return this.clearable&&(this.hasValue||this.searchTerm)&&!this.disabled}focusOnClear(){this.blur(),this.clearButton&&this.clearButton.nativeElement.focus()}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(i=>i.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 i=e[0];this.bindLabel=this.bindLabel||this._defaultLabel,this._primitive=w(i)?!Fe(i):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=n=>{this.items=n.map(r=>({$ngOptionValue:r.value,$ngOptionLabel:r.elementRef.nativeElement.innerHTML,disabled:r.disabled})),this.itemsList.setItems(this.items),this.hasValue&&this.itemsList.mapSelectedItems(),this.detectChanges()},i=()=>{let n=Be(this.ngOptions.changes,this._destroy$);Be(...this.ngOptions.map(r=>r.stateChange$)).pipe(N(n)).subscribe(r=>{let a=this.itemsList.findItem(r.value);a.disabled=r.disabled,a.label=r.label||a.label,this._cd.detectChanges()})};this.ngOptions.changes.pipe(vt(this.ngOptions),N(this._destroy$)).subscribe(n=>{this.bindLabel=this._defaultLabel,e(n),i()})}_isValidWriteValue(e){if(!w(e)||this.multiple&&e===""||Array.isArray(e)&&e.length===0)return!1;let i=n=>!w(this.compareWith)&&Fe(n)&&this.bindValue?(this._console.warn(`Setting object(${JSON.stringify(n)}) as your model with bindValue is not allowed unless [compareWith] is used.`),!1):!0;return this.multiple?Array.isArray(e)?e.every(n=>i(n)):(this._console.warn("Multiple select ngModel should be array."),!1):i(e)}_handleWriteValue(e){if(!this._isValidWriteValue(e))return;let i=n=>{let r=this.itemsList.findItem(n);if(r)this.itemsList.select(r);else{let a=Fe(n),m=!a&&!this.bindValue;a||m?this.itemsList.select(this.itemsList.mapItem(n,null)):this.bindValue&&(r={[this.bindLabel]:null,[this.bindValue]:n},this.itemsList.select(this.itemsList.mapItem(r,null)))}};this.multiple?e.forEach(n=>i(n)):i(e)}_handleKeyPresses(){this.searchable||this._keyPress$.pipe(N(this._destroy$),Et(e=>this._pressedKeys.push(e)),bt(200),Oe(()=>this._pressedKeys.length>0),T(()=>this._pressedKeys.join(""))).subscribe(e=>{let i=this.itemsList.findByLabel(e);i&&(this.isOpen?(this.itemsList.markItem(i),this._scrollToMarked(),this._cd.markForCheck()):this.select(i)),this._pressedKeys=[]})}_setInputAttributes(){let e=this.searchInput.nativeElement,i=be({type:"text",autocorrect:"off",autocapitalize:"off",autocomplete:this.labelForId?"off":this.dropdownId},this.inputAttrs);for(let n of Object.keys(i))e.setAttribute(n,i[n])}_updateNgModel(){let e=[];for(let n of this.selectedItems)if(this.bindValue){let r=null;if(n.children){let a=this.groupValue?this.bindValue:this.groupBy;r=n.value[a||this.groupBy]}else r=this.itemsList.resolveNested(n.value,this.bindValue);e.push(r)}else e.push(n.value);let i=this.selectedItems.map(n=>n.value);this.multiple?(this._onChange(e),this.changeEvent.emit(i)):(this._onChange(w(e[0])?e[0]:null),this.changeEvent.emit(i[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 i=this.itemsList.markedIndex+e;return this.addTag&&this.searchTerm&&this.itemsList.markedItem&&(i<0||i===this.itemsList.filteredItems.length)}_handleBackspace(){this.searchTerm||!this.clearable||!this.clearOnBackspace||!this.hasValue||(this.multiple?this.unselect(this.itemsList.lastSelectedItem):this.clearModel())}_mergeGlobalConfig(e){this.placeholder=this.placeholder||e.placeholder,this.fixedPlaceholder=this.fixedPlaceholder||e.fixedPlaceholder,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}static{this.\u0275fac=function(i){return new(i||t)(Qe("class"),Qe("autofocus"),f(Ds),f(Yi,8),f(ae),f(Pt),f(Ls))}}static{this.\u0275cmp=H({type:t,selectors:[["ng-select"]],contentQueries:function(i,n,r){if(i&1&&(q(r,ut,5,S),q(r,pt,5,S),q(r,Cs,5,S),q(r,ht,5,S),q(r,vs,5,S),q(r,Es,5,S),q(r,ys,5,S),q(r,Ts,5,S),q(r,Ss,5,S),q(r,Is,5,S),q(r,xs,5,S),q(r,ws,5,S),q(r,ks,5)),i&2){let a;k(a=D())&&(n.optionTemplate=a.first),k(a=D())&&(n.optgroupTemplate=a.first),k(a=D())&&(n.labelTemplate=a.first),k(a=D())&&(n.multiLabelTemplate=a.first),k(a=D())&&(n.headerTemplate=a.first),k(a=D())&&(n.footerTemplate=a.first),k(a=D())&&(n.notFoundTemplate=a.first),k(a=D())&&(n.placeholderTemplate=a.first),k(a=D())&&(n.typeToSearchTemplate=a.first),k(a=D())&&(n.loadingTextTemplate=a.first),k(a=D())&&(n.tagTemplate=a.first),k(a=D())&&(n.loadingSpinnerTemplate=a.first),k(a=D())&&(n.ngOptions=a)}},viewQuery:function(i,n){if(i&1&&(_e(Gi,5),_e(On,7),_e(Pn,5)),i&2){let r;k(r=D())&&(n.dropdownPanel=r.first),k(r=D())&&(n.searchInput=r.first),k(r=D())&&(n.clearButton=r.first)}},hostVars:20,hostBindings:function(i,n){i&1&&x("keydown",function(a){return n.handleKeyDown(a)}),i&2&&G("ng-select-typeahead",n.typeahead)("ng-select-multiple",n.multiple)("ng-select-taggable",n.addTag)("ng-select-searchable",n.searchable)("ng-select-clearable",n.clearable)("ng-select-opened",n.isOpen)("ng-select",n.useDefaultClass)("ng-select-filtered",n.filtered)("ng-select-single",n.single)("ng-select-disabled",n.disabled)},inputs:{ariaLabelDropdown:"ariaLabelDropdown",bindLabel:"bindLabel",bindValue:"bindValue",ariaLabel:"ariaLabel",markFirst:[2,"markFirst","markFirst",B],placeholder:"placeholder",fixedPlaceholder:"fixedPlaceholder",notFoundText:"notFoundText",typeToSearchText:"typeToSearchText",preventToggleOnRightClick:"preventToggleOnRightClick",addTagText:"addTagText",loadingText:"loadingText",clearAllText:"clearAllText",appearance:"appearance",dropdownPosition:"dropdownPosition",appendTo:"appendTo",loading:[2,"loading","loading",B],closeOnSelect:[2,"closeOnSelect","closeOnSelect",B],hideSelected:[2,"hideSelected","hideSelected",B],selectOnTab:[2,"selectOnTab","selectOnTab",B],openOnEnter:[2,"openOnEnter","openOnEnter",B],maxSelectedItems:[2,"maxSelectedItems","maxSelectedItems",Ie],groupBy:"groupBy",groupValue:"groupValue",bufferAmount:[2,"bufferAmount","bufferAmount",Ie],virtualScroll:[2,"virtualScroll","virtualScroll",B],selectableGroup:[2,"selectableGroup","selectableGroup",B],selectableGroupAsModel:[2,"selectableGroupAsModel","selectableGroupAsModel",B],searchFn:"searchFn",trackByFn:"trackByFn",clearOnBackspace:[2,"clearOnBackspace","clearOnBackspace",B],labelForId:"labelForId",inputAttrs:"inputAttrs",tabIndex:[2,"tabIndex","tabIndex",Ie],readonly:[2,"readonly","readonly",B],searchWhileComposing:[2,"searchWhileComposing","searchWhileComposing",B],minTermLength:[2,"minTermLength","minTermLength",Ie],editableSearchTerm:[2,"editableSearchTerm","editableSearchTerm",B],ngClass:"ngClass",typeahead:"typeahead",multiple:[2,"multiple","multiple",B],addTag:"addTag",searchable:[2,"searchable","searchable",B],clearable:[2,"clearable","clearable",B],isOpen:"isOpen",items:"items",compareWith:"compareWith",clearSearchOnAdd:"clearSearchOnAdd",deselectOnClick:"deselectOnClick",keyDownFn:"keyDownFn"},outputs:{blurEvent:"blur",focusEvent:"focus",changeEvent:"change",openEvent:"open",closeEvent:"close",searchEvent:"search",clearEvent:"clear",addEvent:"add",removeEvent:"remove",scroll:"scroll",scrollToEnd:"scrollToEnd"},features:[pe([{provide:qt,useExisting:yt(()=>t),multi:!0},Qi]),Pe,Te],decls:13,vars:19,consts:[["searchInput",""],["defaultPlaceholderTemplate",""],["defaultLabelTemplate",""],["defaultLoadingSpinnerTemplate",""],["clearButton",""],["defaultOptionTemplate",""],["defaultTagTemplate",""],["defaultNotFoundTemplate",""],["defaultTypeToSearchTemplate",""],["defaultLoadingTextTemplate",""],[1,"ng-select-container",3,"mousedown"],[1,"ng-value-container"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"ng-input"],["aria-autocomplete","list","role","combobox",3,"blur","change","compositionend","compositionstart","focus","input","disabled","readOnly","value"],["role","button","tabindex","0",1,"ng-clear-wrapper",3,"title"],[1,"ng-arrow-wrapper"],[1,"ng-arrow"],["role","listbox",1,"ng-dropdown-panel",3,"virtualScroll","bufferAmount","appendTo","position","headerTemplate","footerTemplate","filterValue","items","markedItem","ng-select-multiple","ngClass","id"],[3,"ngTemplateOutlet"],[1,"ng-placeholder"],[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"],[1,"ng-spinner-loader"],["aria-hidden","true",1,"ng-clear"],["role","listbox",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(i,n){if(i&1){let r=P();l(0,"div",10),x("mousedown",function(m){return v(r),E(n.handleMousedown(m))}),l(1,"div",11),b(2,jn,3,1)(3,qn,2,0)(4,zn,1,5,null,12),l(5,"div",13)(6,"input",14,0),x("blur",function(m){return v(r),E(n.onInputBlur(m))})("change",function(m){return v(r),E(m.stopPropagation())})("compositionend",function(){v(r);let m=U(7);return E(n.onCompositionEnd(m.value))})("compositionstart",function(){return v(r),E(n.onCompositionStart())})("focus",function(m){return v(r),E(n.onInputFocus(m))})("input",function(){v(r);let m=U(7);return E(n.filter(m.value))}),c()()(),b(8,Yn,3,1)(9,Zn,4,1,"span",15),l(10,"span",16),L(11,"span",17),c()(),b(12,hs,8,18,"ng-dropdown-panel",18)}i&2&&(G("ng-appearance-outline",n.appearance==="outline")("ng-has-value",n.hasValue),o(2),y(n.selectedItems.length===0&&!n.searchTerm||n.fixedPlaceholder===!0?2:-1),o(),y((!n.multiLabelTemplate||!n.multiple)&&n.selectedItems.length>0?3:-1),o(),y(n.multiple&&n.multiLabelTemplate&&n.selectedValues.length>0?4:-1),o(2),_("disabled",n.disabled)("readOnly",!n.searchable||n.itemsList.maxItemsSelected)("value",n.searchTerm?n.searchTerm:""),J("aria-activedescendant",n.isOpen?n.itemsList==null||n.itemsList.markedItem==null?null:n.itemsList.markedItem.htmlId:null)("aria-controls",n.isOpen?n.dropdownId:null)("aria-expanded",n.isOpen)("aria-label",n.ariaLabel)("id",n.labelForId)("tabindex",n.tabIndex),o(2),y(n.loading?8:-1),o(),y(n.showClear()?9:-1),o(3),y(n.isOpen?12:-1))},dependencies:[et,bs,Gi,Mt],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:unset;user-select:unset;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 Bi}from"./chunk-6XR42WAQ.js";import{a as Pi,b as Ni,c as Mi}from"./chunk-4KY7ONEQ.js";import{a as Li}from"./chunk-W4ESFJ6M.js";import{a as wi}from"./chunk-YQAWVQ54.js";import{a as xi}from"./chunk-THL2WTJD.js";import"./chunk-5WNFCBTP.js";import"./chunk-LASWC23V.js";import"./chunk-HCNFZOWE.js";import{a as ui,b as hi,e as vi}from"./chunk-746ASKQ4.js";import{a as je}from"./chunk-DTTSX64G.js";import"./chunk-Y4QYVF5K.js";import"./chunk-AYQPMCNZ.js";import{a as Vi}from"./chunk-W3JKHGP4.js";import{a as ki}from"./chunk-BIDSHCYH.js";import{a as Ai,b as Fi,c as Di}from"./chunk-4RZQAAPF.js";import{e as Ti,f as Si}from"./chunk-Z4YBXGVO.js";import"./chunk-3L4RH6QP.js";import{a as yi}from"./chunk-DTYYCJHM.js";import"./chunk-XAZECV42.js";import{a as Oi}from"./chunk-3P6YOVUR.js";import{H as _i,I as at,L as gi,M as ot,N as lt,O as Ae,P as He,Q as bi,g as mi,r as fi,s as rt}from"./chunk-SRCW6BUG.js";import{a as $e,c as st,l as Ci}from"./chunk-GOGVGWFJ.js";import{b as Ii}from"./chunk-OSOXMODN.js";import{b as Ei}from"./chunk-PSYDBHTH.js";import{A as pi,h as ri,i as ai,l as oi,y as we}from"./chunk-W4U7QKJF.js";import{a as ci}from"./chunk-AVBHFGIF.js";import{$a as c,$b as Mt,A as gt,Aa as S,Ab as oe,Ad as Me,Bb as le,Bd as si,Ca as wt,Cb as Y,D as bt,Db as pe,Eb as Dt,F as ie,Fb as X,Ga as H,Gb as Lt,Ha as At,Hb as Bt,Hc as tt,Ia as W,Ib as Ot,Ic as it,Id as li,J as Ct,Jb as d,Kb as u,Lb as ne,M as ue,Ma as Pe,Md as di,Na as b,Nb as ce,Nc as Gt,O as vt,Od as Re,P as ye,Pa as J,Pb as Pt,Pd as me,Qa as _,Qb as B,R as N,Ra as G,Rb as Ie,S as Et,Tc as nt,Ua as Ke,Va as y,W as yt,Wb as Nt,X as Z,Xa as Se,Xb as Vt,Y as Tt,Ya as V,Z as St,Za as M,_ as j,_a as l,a as be,ab as L,b as De,bb as Ft,bc as et,cb as kt,cc as ve,cd as he,da as Te,db as Ye,dc as Rt,dd as qt,ea as v,eb as P,ed as Ut,f as re,fa as E,fd as zt,g as ze,gb as x,hb as h,hd as xe,i as mt,ia as It,ib as Ze,id as Ve,j as ft,ja as Qe,jb as Je,jd as Qt,kb as fe,l as _t,lb as Xe,lc as $t,ma as F,mb as q,md as Kt,n as T,na as xt,nb as _e,nd as Yt,o as Le,ob as k,pb as D,pd as Zt,qb as U,ra as ae,rb as p,rd as Jt,sb as I,sd as Xt,t as Ee,tb as C,td as ei,ub as Ce,ud as ti,vd as ii,w as Be,wc as Ne,x as Oe,xa as o,xb as z,xc as jt,ya as f,yb as Q,yc as Ht,zb as K,zc as Wt,zd as ni}from"./chunk-2W7IS4PN.js";var O=function(t){return t.Absent="absent",t.Dispensation="dispensation",t.HalfDay="half-day",t.Incident="incident",t.Present="present",t}(O||{}),$i=(()=>{class t{constructor(e,i){this.updateService=e,this.settings=i}update(e,i,n,r,a,m){let g=[];switch(n){case O.Present:g=this.createResetBulkRequests(e);break;case O.Absent:g=this.createAbsentEditBulkRequests(e,i,r,a);break;case O.Dispensation:g=this.createEditBulkRequests(e,null,this.settings.dispensationPresenceTypeId);break;case O.HalfDay:g=this.createEditBulkRequests(e,null,this.settings.halfDayPresenceTypeId);break;case O.Incident:g=this.createEditBulkRequests(e,null,m);break}return Le(g).pipe(T(()=>{}))}createAbsentEditBulkRequests(e,i,n,r){return n===this.settings.excusedAbsenceStateId?this.createEditBulkRequests(e,n,r):n===this.settings.unexcusedAbsenceStateId?this.createEditBulkRequests(e,n,this.settings.absencePresenceTypeId):[...this.createEditBulkRequests(e.filter(Ri(i,this.settings)),n,this.settings.absencePresenceTypeId),...this.createEditBulkRequests(e.filter(we(Ri(i,this.settings))),n,null)]}createResetBulkRequests(e){return at(e).map(({lessonIds:i,personIds:n})=>this.updateService.removeLessonPresences(i,n))}createEditBulkRequests(e,i,n){return at(e).map(({lessonIds:r,personIds:a})=>this.updateService.editLessonPresences(r,a,n||void 0,i||void 0))}static{this.\u0275fac=function(i){return new(i||t)(j(bi),j(he))}}static{this.\u0275prov=Z({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();function Ri(t,s){return e=>{let i=t.find(n=>n.Id===e.TypeRef.Id);return!i||i.Id===s.dispensationPresenceTypeId||i.Id===s.halfDayPresenceTypeId||i.IsIncident}}var te=(()=>{class t extends Fi{constructor(e,i,n,r,a,m,g){super(e,i,n,r,"/edit-absences"),this.lessonPresencesService=a,this.presenceTypesService=m,this.dropDownItemsService=g,this.weekdays$=this.loadWeekdays().pipe(ue(1)),this.presenceTypes$=this.loadPresenceTypes().pipe(ue(1)),this.absenceConfirmationStates$=this.loadAbsenceConfirmationStates().pipe(T(ui),ue(1)),this.presenceControlEntries$=Le([this.entries$,this.presenceTypes$,this.absenceConfirmationStates$]).pipe(T(Ci(Bi)),ue(1)),this.selected=[],this.queryParamsString$.pipe(N(this.destroy$)).subscribe(A=>this.confirmBackLinkParams={returnparams:A})}resetSelection(){this.selected=[]}updateAfterConfirm(){this.resetEntries()}getInitialFilter(){return{student:null,educationalEvent:null,studyClass:null,teacher:null,dateFrom:null,dateTo:null,weekdays:null,presenceTypes:null,confirmationStates:null,incidentTypes:null}}isValidFilter(e){return!!(e.student||e.educationalEvent||e.studyClass||e.teacher||e.dateFrom||e.dateTo||e.weekdays||e.presenceTypes||e.confirmationStates||e.incidentTypes)}loadEntries(e,i,n){let r={sort:"StudentFullName.asc,LessonDateTimeFrom.asc"};return this.loadingService.load(this.lessonPresencesService.getFilteredList(e,n,r),Ai)}buildParamsFromFilter(e){return Pi(e)}loadWeekdays(){return this.loadingService.load(this.dropDownItemsService.getWeekdays())}loadPresenceTypes(){return this.loadingService.load(this.presenceTypesService.activePresenceTypes$)}loadAbsenceConfirmationStates(){return this.loadingService.load(this.dropDownItemsService.getAbsenceConfirmationStates())}static{this.\u0275fac=function(i){return new(i||t)(j(Vt),j(Ii),j(Di),j(he),j(vi),j(He),j(je))}}static{this.\u0275prov=Z({token:t,factory:t.\u0275fac})}}return t})();var fn=(t,s)=>s.Key,ji=(t,s)=>s.Id;function _n(t,s){if(t&1&&(l(0,"div",3),p(1),d(2,"translate"),c()),t&2){let e=s.$implicit;o(),C(" ",ne(2,1,"global.validation-errors."+e.error,e.params)," ")}}function gn(t,s){if(t&1&&(l(0,"option",18),p(1),c()),t&2){let e=s.$implicit;_("ngValue",e.Id),o(),C(" ",e.Designation," ")}}function bn(t,s){if(t&1&&(l(0,"select",17),d(1,"async"),l(2,"option",18),p(3),d(4,"translate"),c(),V(5,gn,2,2,"option",18,ji),d(7,"async"),c()),t&2){let e,i=h(5);G("is-invalid",((e=u(1,4,i.absenceTypeIdErrors$))==null?null:e.length)||!1),o(2),_("ngValue",null),o(),C(" ",u(4,6,"edit-absences.edit.absence-type-placeholder")," "),o(2),M(u(7,8,i.absenceTypes$))}}function Cn(t,s){if(t&1&&(l(0,"div",16),p(1),d(2,"translate"),c()),t&2){let e=s.$implicit;o(),C(" ",ne(2,1,"global.validation-errors."+e.error,e.params)," ")}}function vn(t,s){if(t&1&&(l(0,"div",13),L(1,"input",14),l(2,"label",11),p(3),c(),b(4,bn,8,10,"select",15),V(5,Cn,3,4,"div",16,Se),d(7,"async"),c()),t&2){let e=s.$implicit,i=h(4);o(),_("id","state-"+e.Key)("value",e.Key),o(),fe("for","state-"+e.Key),o(),C(" ",e.Value," "),o(),y(i.isExcused(e)?4:-1),o(),M(u(7,5,i.absenceTypeIdErrors$))}}function En(t,s){if(t&1&&(l(0,"div",12),V(1,vn,8,7,"div",13,fn),c()),t&2){h(3);let e=Y(0);o(),M(e)}}function yn(t,s){if(t&1&&(l(0,"option",18),p(1),c()),t&2){let e=s.$implicit;_("ngValue",e.Id),o(),C(" ",e.Designation," ")}}function Tn(t,s){if(t&1&&(l(0,"div",16),p(1),d(2,"translate"),c()),t&2){let e=s.$implicit;o(),C(" ",ne(2,1,"global.validation-errors."+e.error,e.params)," ")}}function Sn(t,s){if(t&1&&(l(0,"div",12)(1,"select",19),d(2,"async"),l(3,"option",18),p(4),d(5,"translate"),c(),V(6,yn,2,2,"option",18,ji),d(8,"async"),c(),V(9,Tn,3,4,"div",16,Se),d(11,"async"),c()),t&2){let e,i=h(3);o(),G("is-invalid",((e=u(2,4,i.incidentIdErrors$))==null?null:e.length)||!1),o(2),_("ngValue",null),o(),C(" ",u(5,6,"edit-absences.edit.incident-placeholder")," "),o(2),M(u(8,8,i.incidents$)),o(3),M(u(11,10,i.incidentIdErrors$))}}function In(t,s){if(t&1&&(l(0,"div",5),L(1,"input",10),l(2,"label",11),p(3),d(4,"translate"),c(),b(5,En,3,0,"div",12)(6,Sn,12,12,"div",12),c()),t&2){let e=s.$implicit,i=h(2);o(),_("id","category-"+e)("value",e),o(),fe("for","category-"+e),o(),C(" ",u(4,6,"edit-absences.edit.categories."+e)," "),o(2),y(i.isAbsent(e)?5:-1),o(),y(i.isIncident(e)?6:-1)}}function xn(t,s){t&1&&(l(0,"div",9)(1,"span",20),p(2,"Loading..."),c()())}function wn(t,s){if(t&1){let e=P();l(0,"form",2),x("ngSubmit",function(){v(e);let n=h();return E(n.onSubmit())}),V(1,_n,3,4,"div",3,Se),d(3,"async"),l(4,"div",4),V(5,In,7,8,"div",5,Se),c(),l(7,"div",6)(8,"button",7),d(9,"async"),x("click",function(){v(e);let n=h();return E(n.cancel())}),p(10),d(11,"translate"),c(),l(12,"button",8),d(13,"async"),p(14),d(15,"translate"),b(16,xn,3,0,"div",9),d(17,"async"),c()()()}if(t&2){let e=h(),i=Y(2),n=Y(4);_("formGroup",n),o(),M(u(3,6,e.formErrors$)),o(4),M(i),o(3),_("disabled",u(9,8,e.saving$)),o(2),C(" ",u(11,10,"edit-absences.edit.cancel")," "),o(2),_("disabled",u(13,12,e.saving$)),o(2),C(" ",u(15,14,"edit-absences.edit.save")," "),o(2),y(u(17,16,e.saving$)?16:-1)}}var Hi=(()=>{class t{constructor(e,i,n,r,a,m,g,A,ee,R){this.fb=e,this.router=i,this.route=n,this.toastService=r,this.translate=a,this.state=m,this.dropDownItemsService=g,this.presenceTypesService=A,this.updateService=ee,this.settings=R,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$=$e(this.formGroup$,this.submitted$),this.absenceTypeIdErrors$=$e(this.formGroup$,this.submitted$,"absenceTypeId"),this.incidentIdErrors$=$e(this.formGroup$,this.submitted$,"incidentId"),this.availableCategories=[O.Absent,O.Dispensation,O.HalfDay,O.Incident,O.Present],this.confirmationStates$=this.dropDownItemsService.getAbsenceConfirmationStates().pipe(T(this.sortAbsenceConfirmationStates.bind(this)),ue(1)),this.activeCategories$=this.presenceTypesService.halfDayActive$.pipe(T($=>$?this.availableCategories:this.availableCategories.filter(ge=>ge!==O.HalfDay))),this.destroy$=new re}ngOnInit(){this.state.selected.length===0&&this.navigateBack(),st(this.formGroup$,"category").pipe(N(this.destroy$)).subscribe(this.updateConfirmationValueDisabled.bind(this)),st(this.formGroup$,"confirmationValue").pipe(N(this.destroy$)).subscribe(this.updateAbsenceTypeIdDisabled.bind(this))}ngOnDestroy(){this.destroy$.next()}isAbsent(e){return e===O.Absent}isExcused(e){return e.Key===this.settings.excusedAbsenceStateId}isIncident(e){return e===O.Incident}onSubmit(){this.submitted$.next(!0),this.formGroup$.pipe(ie(1)).subscribe(e=>{e.valid&&this.save(e)})}cancel(){this.navigateBack()}createFormGroup(){return this.getInitialAbsenceTypeId().pipe(T(e=>this.fb.group({category:[O.Absent,xe.required],confirmationValue:[this.settings.excusedAbsenceStateId,xe.required],absenceTypeId:[e,xe.required],incidentId:[{value:null,disabled:!0},xe.required]})),ue(1))}getInitialAbsenceTypeId(){return this.absenceTypes$.pipe(ie(1),T(e=>{let i=e.map(r=>r.Id),n=li(this.state.selected.map(r=>r.TypeRef.Id));return n.length===1&&n[0]!=null&&i.includes(n[0])?n[0]:null}))}updateConfirmationValueDisabled(){this.formGroup$.pipe(ie(1)).subscribe(e=>{let i=e.get("category"),n=e.get("confirmationValue"),r=e.get("absenceTypeId"),a=e.get("incidentId");i&&n&&r&&a&&(i.value===O.Absent?(n.enable(),this.updateAbsenceTypeIdDisabled()):(n.disable(),r.disable()),i.value===O.Incident?a.enable():a.disable())})}updateAbsenceTypeIdDisabled(){this.formGroup$.pipe(ie(1)).subscribe(e=>{let i=e.get("confirmationValue"),n=e.get("absenceTypeId");i&&n&&(i.value===this.settings.excusedAbsenceStateId?n.enable():n.disable())})}save(e){this.saving$.next(!0);let{category:i,confirmationValue:n,absenceTypeId:r,incidentId:a}=e.value;this.presenceTypesService.presenceTypes$.pipe(ye(m=>this.updateService.update(this.state.selected,m,i,n,r,a)),Ct(()=>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(ie(1)).subscribe(i=>{this.router.navigate(["/edit-absences"],{queryParams:De(be({},yi(i.returnparams)),{reload:e})})})}sortAbsenceConfirmationStates(e){return e.slice().sort((i,n)=>i.Key===this.settings.excusedAbsenceStateId?-1:n.Key===this.settings.excusedAbsenceStateId?1:i.Value.localeCompare(n.Value))}static{this.\u0275fac=function(i){return new(i||t)(f(ni),f(Ht),f(Ne),f(ci),f(Re),f(te),f(je),f(He),f($i),f(he))}}static{this.\u0275cmp=H({type:t,selectors:[["bkd-edit-absences-edit"]],decls:11,vars:13,consts:[[1,"bkd-container","bkd-container-limited"],[3,"formGroup"],[3,"ngSubmit","formGroup"],[1,"alert","alert-danger"],[1,"form-group","pb-4"],[1,"form-check","mt-2","mb-3"],[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"],["role","status",1,"spinner-border","spinner-border-sm","align-middle"],["type","radio","formControlName","category",1,"form-check-input",3,"id","value"],[1,"form-check-label",3,"for"],[1,"ms-5"],[1,"form-check","mt-2","mb-2"],["type","radio","formControlName","confirmationValue",1,"form-check-input",3,"id","value"],["formControlName","absenceTypeId",1,"form-select","mt-1",3,"is-invalid"],[1,"invalid-feedback"],["formControlName","absenceTypeId",1,"form-select","mt-1"],[3,"ngValue"],["formControlName","incidentId",1,"form-select","mt-1"],[1,"visually-hidden"]],template:function(i,n){if(i&1&&(oe(0),d(1,"async"),oe(2),d(3,"async"),oe(4),d(5,"async"),l(6,"h1"),p(7),d(8,"translate"),c(),l(9,"div",0),b(10,wn,18,18,"form",1),c()),i&2){let r=le(u(1,2,n.confirmationStates$));o(2),le(u(3,5,n.activeCategories$)),o(2);let a=le(u(5,8,n.formGroup$));o(3),I(u(8,11,"edit-absences.title")),o(3),y(a&&r?10:-1)}},dependencies:[Me,Yt,ti,ii,zt,ei,Zt,Ve,Qt,si,Jt,Xt,ve,me],encapsulation:2,changeDetection:0})}}return t})();var Ge=(()=>{class t extends _i{static{this.\u0275fac=(()=>{let e;return function(n){return(e||(e=It(t)))(n||t)}})()}static{this.\u0275prov=Z({token:t,factory:t.\u0275fac})}}return t})();var Fn=["content"],kn=["scroll"],Dn=["padding"],qi=["*"],ke=t=>({searchTerm:t});function Ln(t,s){if(t&1&&(l(0,"div",3),Ye(1,6),c()),t&2){let e=h();o(),_("ngTemplateOutlet",e.headerTemplate)("ngTemplateOutletContext",X(2,ke,e.filterValue))}}function Bn(t,s){if(t&1&&(l(0,"div",5),Ye(1,6),c()),t&2){let e=h();o(),_("ngTemplateOutlet",e.footerTemplate)("ngTemplateOutletContext",X(2,ke,e.filterValue))}}var On=["searchInput"],Pn=["clearButton"],Nn=(t,s,e)=>({item:t,clear:s,label:e}),Vn=(t,s)=>({items:t,clear:s}),Mn=(t,s,e,i)=>({item:t,item$:s,index:e,searchTerm:i});function Rn(t,s){if(t&1&&(l(0,"div",20),p(1),c()),t&2){let e=h(2);o(),I(e.placeholder)}}function $n(t,s){}function jn(t,s){if(t&1&&b(0,Rn,2,1,"ng-template",null,1,ce)(2,$n,0,0,"ng-template",19),t&2){let e=U(1),i=h();o(2),_("ngTemplateOutlet",i.placeholderTemplate||e)}}function Hn(t,s){if(t&1){let e=P();l(0,"span",23),x("click",function(){v(e);let n=h().$implicit,r=h(2);return E(r.unselect(n))}),p(1,"\xD7"),c(),L(2,"span",24)}if(t&2){let e=h().$implicit,i=h(2);o(2),_("ngItemLabel",e.label)("escape",i.escapeHTML)}}function Wn(t,s){}function Gn(t,s){if(t&1&&(l(0,"div",22),b(1,Hn,3,2,"ng-template",null,2,ce)(3,Wn,0,0,"ng-template",12),c()),t&2){let e=s.$implicit,i=U(2),n=h(2);G("ng-value-disabled",e.disabled),o(3),_("ngTemplateOutlet",n.labelTemplate||i)("ngTemplateOutletContext",Bt(4,Nn,e.value,n.clearItem,e.label))}}function qn(t,s){if(t&1&&V(0,Gn,4,8,"div",21,Ke().trackByOption,!0),t&2){let e=h();M(e.selectedItems)}}function Un(t,s){}function zn(t,s){if(t&1&&b(0,Un,0,0,"ng-template",12),t&2){let e=h();_("ngTemplateOutlet",e.multiLabelTemplate)("ngTemplateOutletContext",Lt(2,Vn,e.selectedValues,e.clearItem))}}function Qn(t,s){t&1&&L(0,"div",25)}function Kn(t,s){}function Yn(t,s){if(t&1&&b(0,Qn,1,0,"ng-template",null,3,ce)(2,Kn,0,0,"ng-template",19),t&2){let e=U(1),i=h();o(2),_("ngTemplateOutlet",i.loadingSpinnerTemplate||e)}}function Zn(t,s){if(t&1&&(l(0,"span",15,4)(2,"span",26),p(3,"\xD7"),c()()),t&2){let e=h();fe("title",e.clearAllText)}}function Jn(t,s){if(t&1&&L(0,"span",31),t&2){let e=h().$implicit,i=h(2);_("ngItemLabel",e.label)("escape",i.escapeHTML)}}function Xn(t,s){}function es(t,s){if(t&1){let e=P();l(0,"div",30),x("click",function(){let n=v(e).$implicit,r=h(2);return E(r.toggleItem(n))})("mouseover",function(){let n=v(e).$implicit,r=h(2);return E(r.onItemHover(n))}),b(1,Jn,1,2,"ng-template",null,5,ce)(3,Xn,0,0,"ng-template",12),c()}if(t&2){let e=s.$implicit,i=U(2),n=h(2);G("ng-option-disabled",e.disabled)("ng-option-selected",e.selected)("ng-optgroup",e.children)("ng-option",!e.children)("ng-option-child",!!e.parent)("ng-option-marked",e===n.itemsList.markedItem),J("role",e.children?"group":"option")("aria-selected",e.selected)("id",e==null?null:e.htmlId),o(3),_("ngTemplateOutlet",e.children?n.optgroupTemplate||i:n.optionTemplate||i)("ngTemplateOutletContext",Ot(17,Mn,e.value,e,e.index,n.searchTerm))}}function ts(t,s){if(t&1&&(l(0,"span")(1,"span",33),p(2),c(),p(3),c()),t&2){let e=h(3);o(2),I(e.addTagText),o(),C('"',e.searchTerm,'"')}}function is(t,s){}function ns(t,s){if(t&1){let e=P();l(0,"div",32),x("mouseover",function(){v(e);let n=h(2);return E(n.itemsList.unmarkItem())})("click",function(){v(e);let n=h(2);return E(n.selectTag())}),b(1,ts,4,2,"ng-template",null,6,ce)(3,is,0,0,"ng-template",12),c()}if(t&2){let e=U(2),i=h(2);G("ng-option-marked",!i.itemsList.markedItem),o(3),_("ngTemplateOutlet",i.tagTemplate||e)("ngTemplateOutletContext",X(4,ke,i.searchTerm))}}function ss(t,s){if(t&1&&(l(0,"div",34),p(1),c()),t&2){let e=h(3);o(),I(e.notFoundText)}}function rs(t,s){}function as(t,s){if(t&1&&b(0,ss,2,1,"ng-template",null,7,ce)(2,rs,0,0,"ng-template",12),t&2){let e=U(1),i=h(2);o(2),_("ngTemplateOutlet",i.notFoundTemplate||e)("ngTemplateOutletContext",X(2,ke,i.searchTerm))}}function os(t,s){if(t&1&&(l(0,"div",34),p(1),c()),t&2){let e=h(3);o(),I(e.typeToSearchText)}}function ls(t,s){}function cs(t,s){if(t&1&&b(0,os,2,1,"ng-template",null,8,ce)(2,ls,0,0,"ng-template",19),t&2){let e=U(1),i=h(2);o(2),_("ngTemplateOutlet",i.typeToSearchTemplate||e)}}function ds(t,s){if(t&1&&(l(0,"div",34),p(1),c()),t&2){let e=h(3);o(),I(e.loadingText)}}function us(t,s){}function ps(t,s){if(t&1&&b(0,ds,2,1,"ng-template",null,9,ce)(2,us,0,0,"ng-template",12),t&2){let e=U(1),i=h(2);o(2),_("ngTemplateOutlet",i.loadingTextTemplate||e)("ngTemplateOutletContext",X(2,ke,i.searchTerm))}}function hs(t,s){if(t&1){let e=P();l(0,"ng-dropdown-panel",27),x("update",function(n){v(e);let r=h();return E(r.viewPortItems=n)})("scroll",function(n){v(e);let r=h();return E(r.scroll.emit(n))})("scrollToEnd",function(n){v(e);let r=h();return E(r.scrollToEnd.emit(n))})("outsideClick",function(){v(e);let n=h();return E(n.close())}),Ft(1),V(2,es,4,22,"div",28,Ke().trackByOption,!0),b(4,ns,4,6,"div",29),kt(),b(5,as,3,4)(6,cs,3,1)(7,ps,3,4),c()}if(t&2){let e=h();G("ng-select-multiple",e.multiple),_("virtualScroll",e.virtualScroll)("bufferAmount",e.bufferAmount)("appendTo",e.appendTo)("position",e.dropdownPosition)("headerTemplate",e.headerTemplate)("footerTemplate",e.footerTemplate)("filterValue",e.searchTerm)("items",e.itemsList.filteredItems)("markedItem",e.itemsList.markedItem)("ngClass",e.appendTo?e.ngClass?e.ngClass:e.classes:null)("id",e.dropdownId),J("aria-label",e.ariaLabelDropdown),o(2),M(e.viewPortItems),o(2),y(e.showAddTag?4:-1),o(),y(e.showNoItemsFound()?5:-1),o(),y(e.showTypeToSearch()?6:-1),o(),y(e.loading&&e.itemsList.filteredItems.length===0?7:-1)}}var Ui=/[&<>"']/g,ms=RegExp(Ui.source),fs={"&":"&","<":"<",">":">",'"':""","'":"'"};function _s(t){return t&&ms.test(t)?t.replace(Ui,s=>fs[s]):t}function w(t){return t!=null}function Fe(t){return typeof t=="object"&&w(t)}function gs(t){return t instanceof Promise}function Ue(t){return t instanceof Function}var bs=(()=>{class t{constructor(e){this.element=e,this.escape=!0}ngOnChanges(e){this.element.nativeElement.innerHTML=this.escape?_s(this.ngItemLabel):this.ngItemLabel}static{this.\u0275fac=function(i){return new(i||t)(f(ae))}}static{this.\u0275dir=W({type:t,selectors:[["","ngItemLabel",""]],inputs:{ngItemLabel:"ngItemLabel",escape:"escape"},features:[Te]})}}return t})(),ut=(()=>{class t{constructor(e){this.template=e}static{this.\u0275fac=function(i){return new(i||t)(f(S))}}static{this.\u0275dir=W({type:t,selectors:[["","ng-option-tmp",""]]})}}return t})(),pt=(()=>{class t{constructor(e){this.template=e}static{this.\u0275fac=function(i){return new(i||t)(f(S))}}static{this.\u0275dir=W({type:t,selectors:[["","ng-optgroup-tmp",""]]})}}return t})(),Cs=(()=>{class t{constructor(e){this.template=e}static{this.\u0275fac=function(i){return new(i||t)(f(S))}}static{this.\u0275dir=W({type:t,selectors:[["","ng-label-tmp",""]]})}}return t})(),ht=(()=>{class t{constructor(e){this.template=e}static{this.\u0275fac=function(i){return new(i||t)(f(S))}}static{this.\u0275dir=W({type:t,selectors:[["","ng-multi-label-tmp",""]]})}}return t})(),vs=(()=>{class t{constructor(e){this.template=e}static{this.\u0275fac=function(i){return new(i||t)(f(S))}}static{this.\u0275dir=W({type:t,selectors:[["","ng-header-tmp",""]]})}}return t})(),Es=(()=>{class t{constructor(e){this.template=e}static{this.\u0275fac=function(i){return new(i||t)(f(S))}}static{this.\u0275dir=W({type:t,selectors:[["","ng-footer-tmp",""]]})}}return t})(),ys=(()=>{class t{constructor(e){this.template=e}static{this.\u0275fac=function(i){return new(i||t)(f(S))}}static{this.\u0275dir=W({type:t,selectors:[["","ng-notfound-tmp",""]]})}}return t})(),Ts=(()=>{class t{constructor(e){this.template=e}static{this.\u0275fac=function(i){return new(i||t)(f(S))}}static{this.\u0275dir=W({type:t,selectors:[["","ng-placeholder-tmp",""]]})}}return t})(),Ss=(()=>{class t{constructor(e){this.template=e}static{this.\u0275fac=function(i){return new(i||t)(f(S))}}static{this.\u0275dir=W({type:t,selectors:[["","ng-typetosearch-tmp",""]]})}}return t})(),Is=(()=>{class t{constructor(e){this.template=e}static{this.\u0275fac=function(i){return new(i||t)(f(S))}}static{this.\u0275dir=W({type:t,selectors:[["","ng-loadingtext-tmp",""]]})}}return t})(),xs=(()=>{class t{constructor(e){this.template=e}static{this.\u0275fac=function(i){return new(i||t)(f(S))}}static{this.\u0275dir=W({type:t,selectors:[["","ng-tag-tmp",""]]})}}return t})(),ws=(()=>{class t{constructor(e){this.template=e}static{this.\u0275fac=function(i){return new(i||t)(f(S))}}static{this.\u0275dir=W({type:t,selectors:[["","ng-loadingspinner-tmp",""]]})}}return t})();function zi(){return"axxxxxxxxxxx".replace(/[x]/g,()=>(Math.random()*16|0).toString(16))}var As={"\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 qe(t){let s=e=>As[e]||e;return t.replace(/[^\u0000-\u007E]/g,s)}var ct=class{constructor(s,e){this._ngSelect=s,this._selectionModel=e,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 s=this.selectedItems.length-1;for(;s>=0;s--){let e=this.selectedItems[s];if(!e.disabled)return e}return null}setItems(s){this._items=s.map((e,i)=>this.mapItem(e,i)),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(s){if(s.selected||this.maxItemsSelected)return;let e=this._ngSelect.multiple;e||this.clearSelected(),this._selectionModel.select(s,e,this._ngSelect.selectableGroupAsModel),this._ngSelect.hideSelected&&this._hideSelected(s)}unselect(s){s.selected&&(this._selectionModel.unselect(s,this._ngSelect.multiple),this._ngSelect.hideSelected&&w(s.index)&&this._ngSelect.multiple&&this._showSelected(s))}findItem(s){let e;return this._ngSelect.compareWith?e=i=>this._ngSelect.compareWith(i.value,s):this._ngSelect.bindValue?e=i=>!i.children&&this.resolveNested(i.value,this._ngSelect.bindValue)===s:e=i=>i.value===s||!i.children&&i.label&&i.label===this.resolveNested(s,this._ngSelect.bindLabel),this._items.find(i=>e(i))}addItem(s){let e=this.mapItem(s,this._items.length);return this._items.push(e),this._filteredItems.push(e),e}clearSelected(s=!1){this._selectionModel.clear(s),this._items.forEach(e=>{e.selected=s&&e.selected&&e.disabled,e.marked=!1}),this._ngSelect.hideSelected&&this.resetFilteredItems()}findByLabel(s){return s=qe(s).toLocaleLowerCase(),this.filteredItems.find(e=>qe(e.label).toLocaleLowerCase().substr(0,s.length)===s)}filter(s){if(!s){this.resetFilteredItems();return}this._filteredItems=[],s=this._ngSelect.searchFn?s:qe(s).toLocaleLowerCase();let e=this._ngSelect.searchFn||this._defaultSearchFn,i=this._ngSelect.hideSelected;for(let n of Array.from(this._groups.keys())){let r=[];for(let a of this._groups.get(n)){if(i&&(a.parent&&a.parent.selected||a.selected))continue;let m=this._ngSelect.searchFn?a.value:a;e(s,m)&&r.push(a)}if(r.length>0){let[a]=r.slice(-1);if(a.parent){let m=this._items.find(g=>g===a.parent);this._filteredItems.push(m)}this._filteredItems.push(...r)}}}resetFilteredItems(){this._filteredItems.length!==this._items.length&&(this._ngSelect.hideSelected&&this.selectedItems.length>0?this._filteredItems=this._items.filter(s=>!s.selected):this._filteredItems=this._items)}unmarkItem(){this._markedIndex=-1}markNextItem(){this._stepToItem(1)}markPreviousItem(){this._stepToItem(-1)}markItem(s){this._markedIndex=this._filteredItems.indexOf(s)}markSelectedOrDefault(s){if(this._filteredItems.length===0)return;let e=this._getLastMarkedIndex();e>-1?this._markedIndex=e:this._markedIndex=s?this.filteredItems.findIndex(i=>!i.disabled):-1}resolveNested(s,e){if(!Fe(s))return s;if(e.indexOf(".")===-1)return s[e];{let i=e.split("."),n=s;for(let r=0,a=i.length;rthis.selectedItems.indexOf(e)===-1))}_showSelected(s){if(this._filteredItems.push(s),s.parent){let e=s.parent;this._filteredItems.find(n=>n===e)||this._filteredItems.push(e)}else if(s.children)for(let e of s.children)e.selected=!1,this._filteredItems.push(e);this._filteredItems=[...this._filteredItems.sort((e,i)=>e.index-i.index)]}_hideSelected(s){this._filteredItems=this._filteredItems.filter(e=>e!==s),s.parent?s.parent.children.every(i=>i.selected)&&(this._filteredItems=this._filteredItems.filter(i=>i!==s.parent)):s.children&&(this._filteredItems=this.filteredItems.filter(e=>e.parent!==s))}_defaultSearchFn(s,e){return qe(e.label).toLocaleLowerCase().indexOf(s)>-1}_getNextItemIndex(s){return s>0?this._markedIndex>=this._filteredItems.length-1?0:this._markedIndex+1:this._markedIndex<=0?this._filteredItems.length-1:this._markedIndex-1}_stepToItem(s){this._filteredItems.length===0||this._filteredItems.every(e=>e.disabled)||(this._markedIndex=this._getNextItemIndex(s),this.markedItem.disabled&&this._stepToItem(s))}_getLastMarkedIndex(){if(this._ngSelect.hideSelected||this._markedIndex>-1&&this.markedItem===void 0)return-1;let s=this._filteredItems.indexOf(this.lastSelectedItem);return this.lastSelectedItem&&s<0?-1:Math.max(this.markedIndex,s)}_groupBy(s,e){let i=new Map;if(s.length===0)return i;if(Array.isArray(s[0].value[e])){for(let a of s){let m=(a.value[e]||[]).map((g,A)=>this.mapItem(g,A));i.set(a,m)}return i}let n=Ue(this._ngSelect.groupBy),r=a=>{let m=n?e(a.value):a.value[e];return w(m)?m:void 0};for(let a of s){let m=r(a),g=i.get(m);g?g.push(a):i.set(m,[a])}return i}_flatten(s){let e=Ue(this._ngSelect.groupBy),i=[];for(let n of Array.from(s.keys())){let r=i.length;if(n===void 0){let R=s.get(void 0)||[];i.push(...R.map($=>($.index=r++,$)));continue}let a=Fe(n),m={label:a?"":String(n),children:void 0,parent:null,index:r++,disabled:!this._ngSelect.selectableGroup,htmlId:zi()},g=e?this._ngSelect.bindLabel:this._ngSelect.groupBy,A=this._ngSelect.groupValue||(()=>a?n.value:{[g]:n}),ee=s.get(n).map(R=>(R.parent=m,R.children=void 0,R.index=r++,R));m.children=ee,m.value=A(n,ee.map(R=>R.value)),i.push(m),i.push(...ee)}return i}},Qi=(()=>{class t{constructor(){this._dimensions={itemHeight:0,panelHeight:0,itemsPerViewport:0}}get dimensions(){return this._dimensions}calculateItems(e,i,n){let r=this._dimensions,a=r.itemHeight*i,g=Math.max(0,e)/a*i,A=Math.min(i,Math.ceil(g)+(r.itemsPerViewport+1)),R=Math.max(0,A-r.itemsPerViewport),$=Math.min(R,Math.floor(g)),ge=r.itemHeight*Math.ceil($)-r.itemHeight*Math.min($,n);return ge=isNaN(ge)?0:ge,$=isNaN($)?-1:$,A=isNaN(A)?-1:A,$-=n,$=Math.max(0,$),A+=n,A=Math.min(i,A),{topPadding:ge,scrollHeight:a,start:$,end:A}}setDimensions(e,i){let n=Math.max(1,Math.floor(i/e));this._dimensions={itemHeight:e,panelHeight:i,itemsPerViewport:n}}getScrollTo(e,i,n){let{panelHeight:r}=this.dimensions,a=e+i,m=n,g=m+r;return r>=a&&n===e?null:a>g?m+a-g:e<=m?e:null}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=Z({token:t,factory:t.\u0275fac})}}return t})(),Wi=["top","right","bottom","left"],Fs=typeof requestAnimationFrame<"u"?ft:mt,Gi=(()=>{class t{constructor(e,i,n,r,a){this._renderer=e,this._zone=i,this._panelService=n,this._document=a,this.items=[],this.position="auto",this.virtualScroll=!1,this.filterValue=null,this.update=new F,this.scroll=new F,this.scrollToEnd=new F,this.outsideClick=new F,this._destroy$=new re,this._scrollToEndFired=!1,this._updateScrollHeight=!1,this._lastScrollPosition=0,this._dropdown=r.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:i}=this._panelService.dimensions,n=this.markedItem.index*e;return i>n?0:n}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 i=e.items;this._onItemsChange(i.currentValue,i.firstChange)}}ngOnDestroy(){this._destroy$.next(),this._destroy$.complete(),this._destroy$.unsubscribe(),this.appendTo&&this._renderer.removeChild(this._dropdown.parentNode,this._dropdown)}scrollTo(e,i=!1){if(!e)return;let n=this.items.indexOf(e);if(n<0||n>=this.itemsLength)return;let r;if(this.virtualScroll){let a=this._panelService.dimensions.itemHeight;r=this._panelService.getScrollTo(n*a,a,this._lastScrollPosition)}else{let a=this._dropdown.querySelector(`#${e.htmlId}`),m=i?a.offsetTop:this._lastScrollPosition;r=this._panelService.getScrollTo(a.offsetTop,a.clientHeight,m)}w(r)&&(this._scrollablePanel.scrollTop=r)}scrollToTag(){let e=this._scrollablePanel;e.scrollTop=e.scrollHeight-e.clientHeight}adjustPosition(){this._updateYPosition()}_handleDropdownPosition(){this._currentPosition=this._calculateCurrentPosition(this._dropdown),Wi.includes(this._currentPosition)?this._updateDropdownClass(this._currentPosition):this._updateDropdownClass("bottom"),this.appendTo&&this._updateYPosition(),this._dropdown.style.opacity="1"}_updateDropdownClass(e){Wi.forEach(n=>{let r=`ng-select-${n}`;this._renderer.removeClass(this._dropdown,r),this._renderer.removeClass(this._select,r)});let i=`ng-select-${e}`;this._renderer.addClass(this._dropdown,i),this._renderer.addClass(this._select,i)}_handleScroll(){this._zone.runOutsideAngular(()=>{Ee(this.scrollElementRef.nativeElement,"scroll").pipe(N(this._destroy$),gt(0,Fs)).subscribe(e=>{let i=e.path||e.composedPath&&e.composedPath();if(!i||i.length===0&&!e.target)return;let n=!i||i.length===0?e.target.scrollTop:i[0].scrollTop;this._onContentScrolled(n)})})}_handleOutsideClick(){this._document&&this._zone.runOutsideAngular(()=>{Be(Ee(this._document,"touchstart",{capture:!0}),Ee(this._document,"click",{capture:!0})).pipe(N(this._destroy$)).subscribe(e=>this._checkToClose(e))})}_checkToClose(e){if(this._select.contains(e.target)||this._dropdown.contains(e.target))return;let i=e.path||e.composedPath&&e.composedPath();e.target&&e.target.shadowRoot&&i&&i[0]&&this._select.contains(i[0])||this._zone.run(()=>this.outsideClick.emit())}_onItemsChange(e,i){this.items=e||[],this._scrollToEndFired=!1,this.itemsLength=e.length,this.virtualScroll?this._updateItemsRange(i):(this._setVirtualHeight(),this._updateItems(i))}_updateItems(e){this.update.emit(this.items),e!==!1&&this._zone.runOutsideAngular(()=>{Promise.resolve().then(()=>{let i=this._scrollablePanel.clientHeight;this._panelService.setDimensions(0,i),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 i=this._panelService.calculateItems(e,this.itemsLength,this.bufferAmount);this._updateVirtualHeight(i.scrollHeight),this._contentPanel.style.transform=`translateY(${i.topPadding}px)`,this._zone.run(()=>{this.update.emit(this.items.slice(i.start,i.end)),this.scroll.emit({start:i.start,end:i.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 n=this._dropdown.querySelector(`#${e.htmlId}`).clientHeight;this._virtualPadding.style.height=`${n*this.itemsLength}px`;let r=this._scrollablePanel.clientHeight;return this._panelService.setDimensions(n,r),this._panelService.dimensions})}_fireScrollToEnd(e){if(this._scrollToEndFired||e===0)return;let i=this.virtualScroll?this._virtualPadding:this._contentPanel;e+this._dropdown.clientHeight>=i.clientHeight-1&&(this._zone.run(()=>this.scrollToEnd.emit()),this._scrollToEndFired=!0)}_calculateCurrentPosition(e){if(this.position!=="auto")return this.position;let i=this._select.getBoundingClientRect(),n=document.documentElement.scrollTop||document.body.scrollTop,r=i.top+window.pageYOffset,a=i.height,m=e.getBoundingClientRect().height;return r+a+m>n+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(),i=this._parent.getBoundingClientRect(),n=e.left-i.left;this._dropdown.style.left=n+"px",this._dropdown.style.width=e.width+"px",this._dropdown.style.minWidth=e.width+"px"}_updateYPosition(){let e=this._select.getBoundingClientRect(),i=this._parent.getBoundingClientRect(),n=e.height;if(this._currentPosition==="top"){let r=i.bottom-e.bottom;this._dropdown.style.bottom=r+n+"px",this._dropdown.style.top="auto"}else if(this._currentPosition==="bottom"){let r=e.top-i.top;this._dropdown.style.top=r+n+"px",this._dropdown.style.bottom="auto"}}_setupMousedownListener(){this._zone.runOutsideAngular(()=>{Ee(this._dropdown,"mousedown").pipe(N(this._destroy$)).subscribe(e=>{e.target.tagName!=="INPUT"&&e.preventDefault()})})}static{this.\u0275fac=function(i){return new(i||t)(f(wt),f(xt),f(Qi),f(ae),f(Nt,8))}}static{this.\u0275cmp=H({type:t,selectors:[["ng-dropdown-panel"]],viewQuery:function(i,n){if(i&1&&(_e(Fn,7,ae),_e(kn,7,ae),_e(Dn,7,ae)),i&2){let r;k(r=D())&&(n.contentElementRef=r.first),k(r=D())&&(n.scrollElementRef=r.first),k(r=D())&&(n.paddingElementRef=r.first)}},inputs:{items:"items",markedItem:"markedItem",position:"position",appendTo:"appendTo",bufferAmount:"bufferAmount",virtualScroll:[2,"virtualScroll","virtualScroll",B],headerTemplate:"headerTemplate",footerTemplate:"footerTemplate",filterValue:"filterValue"},outputs:{update:"update",scroll:"scroll",scrollToEnd:"scrollToEnd",outsideClick:"outsideClick"},features:[Pe,Te],ngContentSelectors:qi,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(i,n){i&1&&(Ze(),b(0,Ln,2,4,"div",3),l(1,"div",4,0),L(3,"div",null,1),l(5,"div",null,2),Je(7),c()(),b(8,Bn,2,4,"div",5)),i&2&&(y(n.headerTemplate?0:-1),o(3),G("total-padding",n.virtualScroll),o(2),G("scrollable-content",n.virtualScroll&&n.items.length),o(3),y(n.footerTemplate?8:-1))},dependencies:[et],encapsulation:2,changeDetection:0})}}return t})(),ks=(()=>{class t{constructor(e){this.elementRef=e,this.disabled=!1,this.stateChange$=new re}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()}static{this.\u0275fac=function(i){return new(i||t)(f(ae))}}static{this.\u0275cmp=H({type:t,selectors:[["ng-option"]],inputs:{value:"value",disabled:[2,"disabled","disabled",B]},features:[Pe,Te],ngContentSelectors:qi,decls:1,vars:0,template:function(i,n){i&1&&(Ze(),Je(0))},encapsulation:2,changeDetection:0})}}return t})(),se=function(t){return t[t.Tab=9]="Tab",t[t.Enter=13]="Enter",t[t.Esc=27]="Esc",t[t.Space=32]="Space",t[t.ArrowUp=38]="ArrowUp",t[t.ArrowDown=40]="ArrowDown",t[t.Backspace=8]="Backspace",t}(se||{});function Ki(){return new dt}var dt=class{constructor(){this._selected=[]}get value(){return this._selected}select(s,e,i){if(s.selected=!0,(!s.children||!e&&i)&&this._selected.push(s),e)if(s.parent){let n=s.parent.children.length,r=s.parent.children.filter(a=>a.selected).length;s.parent.selected=n===r}else s.children&&(this._setChildrenSelectedState(s.children,!0),this._removeChildren(s),i&&this._activeChildren(s)?this._selected=[...this._selected.filter(n=>n.parent!==s),s]:this._selected=[...this._selected,...s.children.filter(n=>!n.disabled)])}unselect(s,e){if(this._selected=this._selected.filter(i=>i!==s),s.selected=!1,e)if(s.parent&&s.parent.selected){let i=s.parent.children;this._removeParent(s.parent),this._removeChildren(s.parent),this._selected.push(...i.filter(n=>n!==s&&!n.disabled)),s.parent.selected=!1}else s.children&&(this._setChildrenSelectedState(s.children,!1),this._removeChildren(s))}clear(s){this._selected=s?this._selected.filter(e=>e.disabled):[]}_setChildrenSelectedState(s,e){for(let i of s)i.disabled||(i.selected=e)}_removeChildren(s){this._selected=[...this._selected.filter(e=>e.parent!==s),...s.children.filter(e=>e.parent===s&&e.disabled&&e.selected)]}_removeParent(s){this._selected=this._selected.filter(e=>e!==s)}_activeChildren(s){return s.children.every(e=>!e.disabled||e.selected)}},Ds=(()=>{class t{constructor(){this.fixedPlaceholder=!0,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"}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=Z({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})(),Ls=(()=>{class t{warn(e){console.warn(e)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=Z({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})(),Yi=new St("ng-select-selection-model"),Zi=(()=>{class t{constructor(e,i,n,r,a,m,g){this.classes=e,this.autoFocus=i,this.config=n,this._cd=m,this._console=g,this.ariaLabelDropdown="Options List",this.markFirst=!0,this.fixedPlaceholder=!0,this.preventToggleOnRightClick=!1,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.ngClass=null,this.multiple=!1,this.addTag=!1,this.searchable=!0,this.clearable=!0,this.isOpen=!1,this.blurEvent=new F,this.focusEvent=new F,this.changeEvent=new F,this.openEvent=new F,this.closeEvent=new F,this.searchEvent=new F,this.clearEvent=new F,this.addEvent=new F,this.removeEvent=new F,this.scroll=new F,this.scrollToEnd=new F,this.useDefaultClass=!0,this.viewPortItems=[],this.searchTerm=null,this.dropdownId=zi(),this.escapeHTML=!0,this._defaultLabel="label",this._pressedKeys=[],this._isComposing=!1,this._destroy$=new re,this._keyPress$=new re,this._items=[],this.keyDownFn=A=>!0,this.clearItem=A=>{let ee=this.selectedItems.find(R=>R.value===A);this.unselect(ee)},this.trackByOption=(A,ee)=>this.trackByFn?this.trackByFn(ee.value):ee,this._onChange=A=>{},this._onTouched=()=>{},this._mergeGlobalConfig(n),this.itemsList=new ct(this,r?r():Ki()),this.element=a.nativeElement}get filtered(){return!!this.searchTerm&&this.searchable||this._isComposing}get single(){return!this.multiple}get items(){return this._items}set items(e){this._itemsAreUsed=!0,this._items=e??[]}get disabled(){return this.readonly||this._disabled}get compareWith(){return this._compareWith}set compareWith(e){if(e!=null&&!Ue(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 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}get showAddTag(){if(!this._validTerm)return!1;let e=this.searchTerm.toLowerCase().trim();return this.addTag&&!this.itemsList.filteredItems.some(i=>i.label.toLowerCase()===e)&&(!this.hideSelected&&this.isOpen||!this.selectedItems.some(i=>i.label.toLowerCase()===e))&&!this.loading}get _editableSearchTerm(){return this.editableSearchTerm&&!this.multiple}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}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(se[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 i=e.target;this.clearButton&&this.clearButton.nativeElement===i?this.handleKeyCodeClear(e):this.handleKeyCodeInput(e)}handleKeyCodeInput(e){switch(e.which){case se.ArrowDown:this._handleArrowDown(e);break;case se.ArrowUp:this._handleArrowUp(e);break;case se.Space:this._handleSpace(e);break;case se.Enter:this._handleEnter(e);break;case se.Tab:this._handleTab(e);break;case se.Esc:this.close(),e.preventDefault();break;case se.Backspace:this._handleBackspace();break}}handleKeyCodeClear(e){switch(e.which){case se.Enter:this.handleClearClick(),e.preventDefault();break}}handleMousedown(e){if(this.preventToggleOnRightClick&&e.button===2)return!1;let i=e.target;if(i.tagName!=="INPUT"&&e.preventDefault(),i.classList.contains("ng-clear-wrapper")){this.handleClearClick();return}if(i.classList.contains("ng-arrow-wrapper")){this.handleArrowClick();return}i.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())}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(),this._onSelectionChanged()}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),this._onSelectionChanged())}selectTag(){let e;Ue(this.addTag)?e=this.addTag(this.searchTerm):e=this._primitive?this.searchTerm:{[this.bindLabel]:this.searchTerm};let i=n=>this._isTypeahead||!this.isOpen?this.itemsList.mapItem(n,null):this.itemsList.addItem(n);gs(e)?e.then(n=>this.select(i(n))).catch(()=>{}):e&&this.select(i(e))}showClear(){return this.clearable&&(this.hasValue||this.searchTerm)&&!this.disabled}focusOnClear(){this.blur(),this.clearButton&&this.clearButton.nativeElement.focus()}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(i=>i.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 i=e[0];this.bindLabel=this.bindLabel||this._defaultLabel,this._primitive=w(i)?!Fe(i):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=n=>{this.items=n.map(r=>({$ngOptionValue:r.value,$ngOptionLabel:r.elementRef.nativeElement.innerHTML,disabled:r.disabled})),this.itemsList.setItems(this.items),this.hasValue&&this.itemsList.mapSelectedItems(),this.detectChanges()},i=()=>{let n=Be(this.ngOptions.changes,this._destroy$);Be(...this.ngOptions.map(r=>r.stateChange$)).pipe(N(n)).subscribe(r=>{let a=this.itemsList.findItem(r.value);a.disabled=r.disabled,a.label=r.label||a.label,this._cd.detectChanges()})};this.ngOptions.changes.pipe(vt(this.ngOptions),N(this._destroy$)).subscribe(n=>{this.bindLabel=this._defaultLabel,e(n),i()})}_isValidWriteValue(e){if(!w(e)||this.multiple&&e===""||Array.isArray(e)&&e.length===0)return!1;let i=n=>!w(this.compareWith)&&Fe(n)&&this.bindValue?(this._console.warn(`Setting object(${JSON.stringify(n)}) as your model with bindValue is not allowed unless [compareWith] is used.`),!1):!0;return this.multiple?Array.isArray(e)?e.every(n=>i(n)):(this._console.warn("Multiple select ngModel should be array."),!1):i(e)}_handleWriteValue(e){if(!this._isValidWriteValue(e))return;let i=n=>{let r=this.itemsList.findItem(n);if(r)this.itemsList.select(r);else{let a=Fe(n),m=!a&&!this.bindValue;a||m?this.itemsList.select(this.itemsList.mapItem(n,null)):this.bindValue&&(r={[this.bindLabel]:null,[this.bindValue]:n},this.itemsList.select(this.itemsList.mapItem(r,null)))}};this.multiple?e.forEach(n=>i(n)):i(e)}_handleKeyPresses(){this.searchable||this._keyPress$.pipe(N(this._destroy$),Et(e=>this._pressedKeys.push(e)),bt(200),Oe(()=>this._pressedKeys.length>0),T(()=>this._pressedKeys.join(""))).subscribe(e=>{let i=this.itemsList.findByLabel(e);i&&(this.isOpen?(this.itemsList.markItem(i),this._scrollToMarked(),this._cd.markForCheck()):this.select(i)),this._pressedKeys=[]})}_setInputAttributes(){let e=this.searchInput.nativeElement,i=be({type:"text",autocorrect:"off",autocapitalize:"off",autocomplete:this.labelForId?"off":this.dropdownId},this.inputAttrs);for(let n of Object.keys(i))e.setAttribute(n,i[n])}_updateNgModel(){let e=[];for(let n of this.selectedItems)if(this.bindValue){let r=null;if(n.children){let a=this.groupValue?this.bindValue:this.groupBy;r=n.value[a||this.groupBy]}else r=this.itemsList.resolveNested(n.value,this.bindValue);e.push(r)}else e.push(n.value);let i=this.selectedItems.map(n=>n.value);this.multiple?(this._onChange(e),this.changeEvent.emit(i)):(this._onChange(w(e[0])?e[0]:null),this.changeEvent.emit(i[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 i=this.itemsList.markedIndex+e;return this.addTag&&this.searchTerm&&this.itemsList.markedItem&&(i<0||i===this.itemsList.filteredItems.length)}_handleBackspace(){this.searchTerm||!this.clearable||!this.clearOnBackspace||!this.hasValue||(this.multiple?this.unselect(this.itemsList.lastSelectedItem):this.clearModel())}_mergeGlobalConfig(e){this.placeholder=this.placeholder||e.placeholder,this.fixedPlaceholder=this.fixedPlaceholder||e.fixedPlaceholder,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}static{this.\u0275fac=function(i){return new(i||t)(Qe("class"),Qe("autofocus"),f(Ds),f(Yi,8),f(ae),f(Pt),f(Ls))}}static{this.\u0275cmp=H({type:t,selectors:[["ng-select"]],contentQueries:function(i,n,r){if(i&1&&(q(r,ut,5,S),q(r,pt,5,S),q(r,Cs,5,S),q(r,ht,5,S),q(r,vs,5,S),q(r,Es,5,S),q(r,ys,5,S),q(r,Ts,5,S),q(r,Ss,5,S),q(r,Is,5,S),q(r,xs,5,S),q(r,ws,5,S),q(r,ks,5)),i&2){let a;k(a=D())&&(n.optionTemplate=a.first),k(a=D())&&(n.optgroupTemplate=a.first),k(a=D())&&(n.labelTemplate=a.first),k(a=D())&&(n.multiLabelTemplate=a.first),k(a=D())&&(n.headerTemplate=a.first),k(a=D())&&(n.footerTemplate=a.first),k(a=D())&&(n.notFoundTemplate=a.first),k(a=D())&&(n.placeholderTemplate=a.first),k(a=D())&&(n.typeToSearchTemplate=a.first),k(a=D())&&(n.loadingTextTemplate=a.first),k(a=D())&&(n.tagTemplate=a.first),k(a=D())&&(n.loadingSpinnerTemplate=a.first),k(a=D())&&(n.ngOptions=a)}},viewQuery:function(i,n){if(i&1&&(_e(Gi,5),_e(On,7),_e(Pn,5)),i&2){let r;k(r=D())&&(n.dropdownPanel=r.first),k(r=D())&&(n.searchInput=r.first),k(r=D())&&(n.clearButton=r.first)}},hostVars:20,hostBindings:function(i,n){i&1&&x("keydown",function(a){return n.handleKeyDown(a)}),i&2&&G("ng-select-typeahead",n.typeahead)("ng-select-multiple",n.multiple)("ng-select-taggable",n.addTag)("ng-select-searchable",n.searchable)("ng-select-clearable",n.clearable)("ng-select-opened",n.isOpen)("ng-select",n.useDefaultClass)("ng-select-filtered",n.filtered)("ng-select-single",n.single)("ng-select-disabled",n.disabled)},inputs:{ariaLabelDropdown:"ariaLabelDropdown",bindLabel:"bindLabel",bindValue:"bindValue",ariaLabel:"ariaLabel",markFirst:[2,"markFirst","markFirst",B],placeholder:"placeholder",fixedPlaceholder:"fixedPlaceholder",notFoundText:"notFoundText",typeToSearchText:"typeToSearchText",preventToggleOnRightClick:"preventToggleOnRightClick",addTagText:"addTagText",loadingText:"loadingText",clearAllText:"clearAllText",appearance:"appearance",dropdownPosition:"dropdownPosition",appendTo:"appendTo",loading:[2,"loading","loading",B],closeOnSelect:[2,"closeOnSelect","closeOnSelect",B],hideSelected:[2,"hideSelected","hideSelected",B],selectOnTab:[2,"selectOnTab","selectOnTab",B],openOnEnter:[2,"openOnEnter","openOnEnter",B],maxSelectedItems:[2,"maxSelectedItems","maxSelectedItems",Ie],groupBy:"groupBy",groupValue:"groupValue",bufferAmount:[2,"bufferAmount","bufferAmount",Ie],virtualScroll:[2,"virtualScroll","virtualScroll",B],selectableGroup:[2,"selectableGroup","selectableGroup",B],selectableGroupAsModel:[2,"selectableGroupAsModel","selectableGroupAsModel",B],searchFn:"searchFn",trackByFn:"trackByFn",clearOnBackspace:[2,"clearOnBackspace","clearOnBackspace",B],labelForId:"labelForId",inputAttrs:"inputAttrs",tabIndex:[2,"tabIndex","tabIndex",Ie],readonly:[2,"readonly","readonly",B],searchWhileComposing:[2,"searchWhileComposing","searchWhileComposing",B],minTermLength:[2,"minTermLength","minTermLength",Ie],editableSearchTerm:[2,"editableSearchTerm","editableSearchTerm",B],ngClass:"ngClass",typeahead:"typeahead",multiple:[2,"multiple","multiple",B],addTag:"addTag",searchable:[2,"searchable","searchable",B],clearable:[2,"clearable","clearable",B],isOpen:"isOpen",items:"items",compareWith:"compareWith",clearSearchOnAdd:"clearSearchOnAdd",deselectOnClick:"deselectOnClick",keyDownFn:"keyDownFn"},outputs:{blurEvent:"blur",focusEvent:"focus",changeEvent:"change",openEvent:"open",closeEvent:"close",searchEvent:"search",clearEvent:"clear",addEvent:"add",removeEvent:"remove",scroll:"scroll",scrollToEnd:"scrollToEnd"},features:[pe([{provide:qt,useExisting:yt(()=>t),multi:!0},Qi]),Pe,Te],decls:13,vars:19,consts:[["searchInput",""],["defaultPlaceholderTemplate",""],["defaultLabelTemplate",""],["defaultLoadingSpinnerTemplate",""],["clearButton",""],["defaultOptionTemplate",""],["defaultTagTemplate",""],["defaultNotFoundTemplate",""],["defaultTypeToSearchTemplate",""],["defaultLoadingTextTemplate",""],[1,"ng-select-container",3,"mousedown"],[1,"ng-value-container"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"ng-input"],["aria-autocomplete","list","role","combobox",3,"blur","change","compositionend","compositionstart","focus","input","disabled","readOnly","value"],["role","button","tabindex","0",1,"ng-clear-wrapper",3,"title"],[1,"ng-arrow-wrapper"],[1,"ng-arrow"],["role","listbox",1,"ng-dropdown-panel",3,"virtualScroll","bufferAmount","appendTo","position","headerTemplate","footerTemplate","filterValue","items","markedItem","ng-select-multiple","ngClass","id"],[3,"ngTemplateOutlet"],[1,"ng-placeholder"],[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"],[1,"ng-spinner-loader"],["aria-hidden","true",1,"ng-clear"],["role","listbox",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(i,n){if(i&1){let r=P();l(0,"div",10),x("mousedown",function(m){return v(r),E(n.handleMousedown(m))}),l(1,"div",11),b(2,jn,3,1)(3,qn,2,0)(4,zn,1,5,null,12),l(5,"div",13)(6,"input",14,0),x("blur",function(m){return v(r),E(n.onInputBlur(m))})("change",function(m){return v(r),E(m.stopPropagation())})("compositionend",function(){v(r);let m=U(7);return E(n.onCompositionEnd(m.value))})("compositionstart",function(){return v(r),E(n.onCompositionStart())})("focus",function(m){return v(r),E(n.onInputFocus(m))})("input",function(){v(r);let m=U(7);return E(n.filter(m.value))}),c()()(),b(8,Yn,3,1)(9,Zn,4,1,"span",15),l(10,"span",16),L(11,"span",17),c()(),b(12,hs,8,18,"ng-dropdown-panel",18)}i&2&&(G("ng-appearance-outline",n.appearance==="outline")("ng-has-value",n.hasValue),o(2),y(n.selectedItems.length===0&&!n.searchTerm||n.fixedPlaceholder===!0?2:-1),o(),y((!n.multiLabelTemplate||!n.multiple)&&n.selectedItems.length>0?3:-1),o(),y(n.multiple&&n.multiLabelTemplate&&n.selectedValues.length>0?4:-1),o(2),_("disabled",n.disabled)("readOnly",!n.searchable||n.itemsList.maxItemsSelected)("value",n.searchTerm?n.searchTerm:""),J("aria-activedescendant",n.isOpen?n.itemsList==null||n.itemsList.markedItem==null?null:n.itemsList.markedItem.htmlId:null)("aria-controls",n.isOpen?n.dropdownId:null)("aria-expanded",n.isOpen)("aria-label",n.ariaLabel)("id",n.labelForId)("tabindex",n.tabIndex),o(2),y(n.loading?8:-1),o(),y(n.showClear()?9:-1),o(3),y(n.isOpen?12:-1))},dependencies:[et,bs,Gi,Mt],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:unset;user-select:unset;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})}}return t})(),Ji=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=At({type:t})}static{this.\u0275inj=Tt({providers:[{provide:Yi,useValue:Ki}]})}}return t})();var Os=(t,s)=>s.Key;function Ps(t,s){if(t&1){let e=P();l(0,"div",4),p(1),l(2,"span",5),x("click",function(){let n=v(e).$implicit,r=h().clear;return E(r(n))}),p(3,"\xD7"),c()()}if(t&2){let e=s.$implicit;o(),C(" ",e.Value," ")}}function Ns(t,s){if(t&1&&V(0,Ps,4,1,"div",4,Os),t&2){let e=s.items;M(e)}}function Vs(t,s){if(t&1&&(L(0,"input",6),p(1)),t&2){let e=s.item,i=s.item$,n=s.index;Xe("id","item-",n,""),_("ngModel",i.selected),o(),C(" ",e.Group," ")}}function Ms(t,s){if(t&1&&(L(0,"input",6),p(1)),t&2){let e=s.item,i=s.item$,n=s.index;Xe("id","item-",n,""),_("ngModel",i.selected),o(),C(" ",e.Value," ")}}var Xi=(()=>{class t{constructor(){this.options=[],this.values=[],this.valuesChange=new F}itemsChanged(){this.valuesChange.emit(this.values)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=H({type:t,selectors:[["bkd-multiselect"]],inputs:{options:"options",values:"values"},outputs:{valuesChange:"valuesChange"},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",""],[1,"ng-value"],["aria-hidden","true",1,"ng-value-icon","right",3,"click"],["type","checkbox",3,"id","ngModel"]],template:function(i,n){i&1&&(l(0,"ng-select",0),d(1,"translate"),K("ngModelChange",function(a){return Q(n.values,a)||(n.values=a),a}),x("click",function(){return n.itemsChanged()})("clear",function(){return n.itemsChanged()}),b(2,Ns,2,0,"ng-template",1)(3,Vs,2,4,"ng-template",2)(4,Ms,2,4,"ng-template",3),c()),i&2&&(fe("placeholder",u(1,8,"shared.select.empty-option")),_("items",n.options)("multiple",!0)("selectableGroup",!0)("selectableGroupAsModel",!1)("closeOnSelect",!1),z("ngModel",n.values),_("clearable",!0))},dependencies:[Ji,Zi,pt,ut,ht,Me,Ut,Ve,Kt,me],encapsulation:2})}}return t})();var en=Gt({HRef:tt,Id:it,TeacherId:it,FullName:tt});var tn=(()=>{class t extends Ti{constructor(e,i){super(e,i,en,"TeacherResources","FullName","FullName")}getTypeaheadItemByKey(e){return this.http.get(`${this.baseUrl}/`,{params:{fields:[this.keyAttr,this.labelAttr].join(","),[`filter.${this.labelAttr}`]:`~*${e}*`}}).pipe(ye(di(this.typeaheadCodec)),ye(i=>_t({Key:i[0].FullName,Value:`${i[0].FullName}`})))}static{this.\u0275fac=function(i){return new(i||t)(j($t),j(he))}}static{this.\u0275prov=Z({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var sn=(()=>{class t{constructor(e,i,n,r,a,m){this.studentsService=e,this.educationalEventsService=i,this.studyClassService=n,this.teacherResourcesService=r,this.state=a,this.translate=m,this.filter={student:null,educationalEvent:null,studyClass:null,teacher:null,dateFrom:null,dateTo:null,weekdays:null,presenceTypes:null,confirmationStates:null,incidentTypes:null},this.filterChange=new F,this.weekdaysGrouped$=this.state.weekdays$.pipe(T(g=>Ae(g,this.translate.instant("shared.multiselect.all-option")))),this.absenceConfirmationStatesGrouped$=this.state.absenceConfirmationStates$.pipe(T(g=>Ae(g,this.translate.instant("shared.multiselect.all-option")))),this.presenceTypesGrouped$=this.state.presenceTypes$.pipe(T(g=>g.filter(we(fi)).filter(we(rt))),T(ot),T(lt),T(g=>Ae(g,this.translate.instant("shared.multiselect.all-option")))),this.incidentTypesGrouped$=this.state.presenceTypes$.pipe(T(g=>g.filter(rt)),T(ot),T(lt),T(g=>Ae(g,this.translate.instant("shared.multiselect.all-option")))),this.classesHttpFilter={params:{fields:"IsActive","filter.IsActive":"=true"}}}show(){this.filterChange.emit(De(be({},this.filter),{dateFrom:nn(this.filter.dateFrom),dateTo:nn(this.filter.dateTo)}))}static{this.\u0275fac=function(i){return new(i||t)(f(Si),f(Mi),f(wi),f(tn),f(te),f(Re))}}static{this.\u0275cmp=H({type:t,selectors:[["bkd-edit-absences-header"]],inputs:{filter:"filter"},outputs:{filterChange:"filterChange"},features:[pe([{provide:ri,useClass:oi},{provide:ai,useClass:ki}])],decls:60,vars:60,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"],[3,"valuesChange","options","values"],[1,"row","g-3","align-items-end"],[1,"col-sm-12","col-md"],[1,"col-auto"],["type","button",1,"btn","btn-primary",3,"click"]],template:function(i,n){i&1&&(l(0,"div",0)(1,"div",1)(2,"label",2),p(3),d(4,"translate"),c(),l(5,"bkd-typeahead",3),K("valueChange",function(a){return Q(n.filter.student,a)||(n.filter.student=a),a}),c()(),l(6,"div",1)(7,"label",2),p(8),d(9,"translate"),c(),l(10,"bkd-typeahead",3),K("valueChange",function(a){return Q(n.filter.educationalEvent,a)||(n.filter.educationalEvent=a),a}),c()(),l(11,"div",1)(12,"label",2),p(13),d(14,"translate"),c(),l(15,"bkd-typeahead",4),K("valueChange",function(a){return Q(n.filter.studyClass,a)||(n.filter.studyClass=a),a}),c()(),l(16,"div",1)(17,"label",2),p(18),d(19,"translate"),c(),l(20,"bkd-typeahead",3),K("valueChange",function(a){return Q(n.filter.teacher,a)||(n.filter.teacher=a),a}),c()(),l(21,"div",1)(22,"label",2),p(23),d(24,"translate"),c(),l(25,"bkd-date-select",5),K("valueChange",function(a){return Q(n.filter.dateFrom,a)||(n.filter.dateFrom=a),a}),c()(),l(26,"div",1)(27,"label",2),p(28),d(29,"translate"),c(),l(30,"bkd-date-select",5),K("valueChange",function(a){return Q(n.filter.dateTo,a)||(n.filter.dateTo=a),a}),c()(),l(31,"div",1)(32,"label",2),p(33),d(34,"translate"),c(),l(35,"bkd-multiselect",6),d(36,"async"),K("valuesChange",function(a){return Q(n.filter.weekdays,a)||(n.filter.weekdays=a),a}),c()()(),l(37,"div",7)(38,"div",8)(39,"label",2),p(40),d(41,"translate"),c(),l(42,"bkd-multiselect",6),d(43,"async"),K("valuesChange",function(a){return Q(n.filter.confirmationStates,a)||(n.filter.confirmationStates=a),a}),c()(),l(44,"div",8)(45,"label",2),p(46),d(47,"translate"),c(),l(48,"bkd-multiselect",6),d(49,"async"),K("valuesChange",function(a){return Q(n.filter.presenceTypes,a)||(n.filter.presenceTypes=a),a}),c()(),l(50,"div",8)(51,"label",2),p(52),d(53,"translate"),c(),l(54,"bkd-multiselect",6),d(55,"async"),K("valuesChange",function(a){return Q(n.filter.incidentTypes,a)||(n.filter.incidentTypes=a),a}),c()(),l(56,"div",9)(57,"button",10),x("click",function(){return n.show()}),p(58),d(59,"translate"),c()()()),i&2&&(o(3),I(u(4,30,"edit-absences.header.student")),o(2),_("typeaheadService",n.studentsService),z("value",n.filter.student),o(3),I(u(9,32,"edit-absences.header.module-instance")),o(2),_("typeaheadService",n.educationalEventsService),z("value",n.filter.educationalEvent),o(3),I(u(14,34,"edit-absences.header.study-class")),o(2),_("typeaheadService",n.studyClassService),z("value",n.filter.studyClass),_("additionalHttpParams",n.classesHttpFilter),o(3),I(u(19,36,"edit-absences.header.teacher")),o(2),_("typeaheadService",n.teacherResourcesService),z("value",n.filter.teacher),o(3),I(u(24,38,"edit-absences.header.date-from")),o(2),z("value",n.filter.dateFrom),o(3),I(u(29,40,"edit-absences.header.date-to")),o(2),z("value",n.filter.dateTo),o(3),I(u(34,42,"edit-absences.header.weekdays")),o(2),_("options",u(36,44,n.weekdaysGrouped$)),z("values",n.filter.weekdays),o(5),I(u(41,46,"edit-absences.header.confirmation-state")),o(2),_("options",u(43,48,n.absenceConfirmationStatesGrouped$)),z("values",n.filter.confirmationStates),o(4),I(u(47,50,"edit-absences.header.presence-type")),o(2),_("options",u(49,52,n.presenceTypesGrouped$)),z("values",n.filter.presenceTypes),o(4),I(u(53,54,"edit-absences.header.incident")),o(2),_("options",u(55,56,n.incidentTypesGrouped$)),z("values",n.filter.incidentTypes),o(4),C(" ",u(59,58,"edit-absences.header.show")," "))},dependencies:[Li,Vi,Xi,ve,me],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;padding:0 1rem 1rem 0;border-bottom:1px solid #dee2e6}"],changeDetection:0})}}return t})();function nn(t){return t?mi(t):null}var $s=(t,s)=>s.id,js=()=>[],rn=t=>({count:t}),an=t=>({returnparams:t}),Hs=t=>["student",t,"absences"];function Ws(t,s){t&1&&L(0,"bkd-spinner")}function Gs(t,s){if(t&1&&(l(0,"div",5)(1,"div",9),p(2),d(3,"async"),d(4,"translate"),d(5,"translate"),c(),l(6,"a",10),d(7,"async"),l(8,"i",11),p(9,"edit"),c()()()),t&2){let e=h(4),i=Y(0);o(2),Ce(" ",ne(4,7,"edit-absences.list.total",X(15,rn,u(3,5,e.state.total$)||0)),", ",ne(5,10,"edit-absences.list.selected",X(17,rn,i.length))," "),o(4),G("disabled",i.length===0),_("queryParams",X(19,an,u(7,13,e.state.queryParamsString$)))}}function qs(t,s){if(t&1){let e=P();l(0,"tr")(1,"td",14),x("click",function(n){v(e);let r=U(3),a=h(5);return E(a.onCheckboxCellClick(n,r))}),l(2,"input",12,0),d(4,"async"),x("change",function(){let n=v(e).$implicit,r=h(5);return E(r.selectionService.toggle(n.lessonPresence))}),c()(),l(5,"td",13),d(6,"translate"),l(7,"span",15)(8,"i",11),p(9),c()()(),l(10,"td"),d(11,"translate"),l(12,"a",16),d(13,"async"),p(14),c(),L(15,"br"),p(16),c(),l(17,"td"),d(18,"translate"),p(19),d(20,"date"),c(),l(21,"td"),d(22,"translate"),p(23),d(24,"date"),d(25,"date"),c(),l(26,"td"),d(27,"translate"),p(28),c(),l(29,"td",17),d(30,"translate"),p(31),c(),l(32,"td"),d(33,"translate"),p(34),c()()}if(t&2){let e=s.$implicit,i=h(5);o(2),_("checked",u(4,21,i.selectionService.isSelected$(e.lessonPresence))),o(3),J("data-label",u(6,23,"edit-absences.list.header.presence")),o(2),_("className",e.presenceCategory),o(2),I(e.presenceCategoryIcon),o(),J("data-label",u(11,25,"edit-absences.list.header.mobil-student-module-instance-study-class")),o(2),_("routerLink",X(48,Hs,e.lessonPresence.StudentRef.Id))("queryParams",X(50,an,u(13,27,i.profileReturnParams$))),o(2),C(" ",e.lessonPresence.StudentFullName," "),o(2),Ce(" ",e.lessonPresence.EventDesignation,", ",e.lessonPresence.StudyClassNumber," "),o(),J("data-label",u(18,29,"edit-absences.list.header.date")),o(2),C(" ",ne(20,31,e.lessonPresence.LessonDateTimeFrom,"mediumDate")," "),o(2),J("data-label",u(22,34,"edit-absences.list.header.time")),o(2),Ce(" ",ne(24,36,e.lessonPresence.LessonDateTimeFrom,"shortTime"),"\u2013",ne(25,39,e.lessonPresence.LessonDateTimeTo,"shortTime")," "),o(3),J("data-label",u(27,42,"edit-absences.list.header.confirmation-state")),o(2),C(" ",e.confirmationState==null?null:e.confirmationState.Value," "),o(),J("data-label",u(30,44,"edit-absences.list.header.mobil-presence-type-incident")),o(2),C(" ",e.presenceType==null?null:e.presenceType.Designation," "),o(),J("data-label",u(33,46,"edit-absences.list.header.teacher")),o(2),C(" ",e.lessonPresence.TeacherInformation," ")}}function Us(t,s){if(t&1){let e=P();l(0,"table",6)(1,"thead")(2,"tr")(3,"th")(4,"input",12),x("change",function(n){v(e);let r=h(4);return E(r.toggleAll(n.currentTarget==null?null:n.currentTarget.checked))}),c()(),l(5,"th",13),p(6),d(7,"translate"),c(),l(8,"th"),p(9),d(10,"translate"),L(11,"br"),p(12),d(13,"translate"),d(14,"translate"),c(),l(15,"th"),p(16),d(17,"translate"),c(),l(18,"th"),p(19),d(20,"translate"),c(),l(21,"th"),p(22),d(23,"translate"),c(),l(24,"th"),p(25),d(26,"translate"),d(27,"translate"),c(),l(28,"th"),p(29),d(30,"translate"),c()()(),l(31,"tbody"),V(32,qs,35,52,"tr",null,$s),c()()}if(t&2){h(4);let e=Y(0),i=Y(2);o(4),_("checked",e.length===i.length),o(2),C(" ",u(7,11,"edit-absences.list.header.presence")," "),o(3),C(" ",u(10,13,"edit-absences.list.header.student")," "),o(3),Ce(" ",u(13,15,"edit-absences.list.header.module-instance"),", ",u(14,17,"edit-absences.list.header.study-class")," "),o(4),C(" ",u(17,19,"edit-absences.list.header.date")," "),o(3),I(u(20,21,"edit-absences.list.header.time")),o(3),C(" ",u(23,23,"edit-absences.list.header.confirmation-state")," "),o(3),Ce(" ",u(26,25,"edit-absences.list.header.presence-type")," / ",u(27,27,"edit-absences.list.header.incident")," "),o(4),I(u(30,29,"edit-absences.list.header.teacher")),o(3),M(i)}}function zs(t,s){t&1&&L(0,"bkd-spinner",7)}function Qs(t,s){if(t&1){let e=P();l(0,"button",18),x("click",function(){v(e);let n=h(4);return E(n.state.nextPage())}),p(1),d(2,"translate"),c()}t&2&&(o(),C(" ",u(2,1,"global.pagination.load-more")," "))}function Ks(t,s){if(t&1){let e=P();l(0,"div",4),x("scrolled",function(){v(e);let n=h(3);return E(n.onScroll())}),b(1,Gs,10,21,"div",5)(2,Us,34,31,"table",6)(3,zs,1,0,"bkd-spinner",7)(4,Qs,3,3,"button",8),c()}if(t&2){h(3);let e=Y(2),i=Y(4),n=Y(6);o(),y(e&&e.length>0?1:-1),o(),y(e&&e.length>0?2:-1),o(),y(n?3:-1),o(),y(i&&!n?4:-1)}}function Ys(t,s){t&1&&(l(0,"p",2),p(1),d(2,"translate"),c()),t&2&&(o(),I(u(2,1,"edit-absences.no-entries")))}function Zs(t,s){if(t&1&&b(0,Ks,5,4,"div",3)(1,Ys,3,3,"p",2),t&2){h(2);let e=Y(2),i=Y(6);y(e&&e.length>0||i?0:1)}}function Js(t,s){if(t&1&&(b(0,Ws,1,0,"bkd-spinner"),d(1,"async"),b(2,Zs,2,1)),t&2){let e=h();y(u(1,1,e.state.loading$)?0:2)}}function Xs(t,s){t&1&&(l(0,"p",2),p(1),d(2,"translate"),c()),t&2&&(o(),I(u(2,1,"edit-absences.no-filter")))}var on=(()=>{class t{constructor(e,i,n,r){this.state=e,this.selectionService=i,this.scrollPosition=n,this.route=r,this.filterFromParams$=this.route.queryParams.pipe(T(er)),this.profileReturnParams$=this.state.queryParamsString$,this.destroy$=new re}ngOnInit(){this.filterFromParams$.pipe(ie(1)).subscribe(e=>this.state.setFilter(e)),this.state.validFilter$.pipe(N(this.destroy$)).subscribe(()=>this.selectionService.clear()),this.selectionService.selection$.pipe(N(this.destroy$)).subscribe(e=>this.state.selected=e),this.route.queryParams.pipe(ie(1),T(({reload:e})=>e),Oe(pi)).subscribe(()=>this.state.resetEntries())}ngAfterViewInit(){this.scrollPosition.restore()}ngOnDestroy(){this.destroy$.next()}toggleAll(e){this.state.entries$.pipe(ie(1)).subscribe(i=>this.selectionService.clear(e?i:null))}onCheckboxCellClick(e,i){e.target!==i&&i.click()}onScroll(){this.state.nextPage()}static{this.\u0275fac=function(i){return new(i||t)(f(te),f(Ge),f(Oi),f(Ne))}}static{this.\u0275cmp=H({type:t,selectors:[["bkd-edit-absences-list"]],features:[pe([Ge])],decls:16,vars:22,consts:[["checkbox",""],[3,"filterChange","filter"],[1,"mt-3"],["infiniteScroll","",1,"py-3"],["infiniteScroll","",1,"py-3",3,"scrolled"],[1,"d-flex","align-items-center","justify-content-between"],[1,"table","table-striped"],[1,"inline"],["type","button",1,"btn","btn-outline-secondary","btn-sm","d-block","mx-auto"],[1,"total"],["routerLink","/edit-absences/edit",1,"edit","btn","btn-primary","btn-icon","mt-1","mb-2",3,"queryParams"],[1,"material-icons"],["type","checkbox",3,"change","checked"],[1,"presence-category"],[1,"edit-absences-checkbox",3,"click"],[3,"className"],[1,"student",3,"routerLink","queryParams"],[1,"designation-incident"],["type","button",1,"btn","btn-outline-secondary","btn-sm","d-block","mx-auto",3,"click"]],template:function(i,n){if(i&1){let r=P();oe(0),d(1,"async"),oe(2),d(3,"async"),oe(4),d(5,"async"),oe(6),d(7,"async"),l(8,"h1"),p(9),d(10,"translate"),c(),l(11,"bkd-edit-absences-header",1),d(12,"async"),x("filterChange",function(m){return v(r),E(n.state.setFilter(m))}),c(),b(13,Js,3,3),d(14,"async"),b(15,Xs,3,3,"p",2)}if(i&2){let r;le((r=u(1,3,n.selectionService.selection$))!==null&&r!==void 0?r:Dt(21,js)),o(2),le(u(3,6,n.state.presenceControlEntries$)),o(2),le(u(5,9,n.state.hasMore$)),o(2),le(u(7,12,n.state.loadingPage$)),o(3),I(u(10,15,"edit-absences.title")),o(2),_("filter",u(12,17,n.filterFromParams$)),o(2),y(u(14,19,n.state.isFilterValid$)?13:15)}},dependencies:[sn,Ni,Wt,Ei,ve,Rt,me],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})}}return t})();function er(t){return{student:t.student?Number(t.student):null,educationalEvent:t.educationalEvent?Number(t.educationalEvent):null,studyClass:t.studyClass?Number(t.studyClass):null,teacher:t.teacher??null,dateFrom:t.dateFrom?nt(t.dateFrom):null,dateTo:t.dateTo?nt(t.dateTo):null,weekdays:t.weekdays?t.weekdays.split(","):null,presenceTypes:t.presenceTypes?t.presenceTypes.split(",").map(Number):null,confirmationStates:t.confirmationStates?t.confirmationStates.split(",").map(Number):null,incidentTypes:t.incidentTypes?t.incidentTypes.split(",").map(Number):null}}var ln=(()=>{class t{constructor(e){this.state=e}static{this.\u0275fac=function(i){return new(i||t)(f(te))}}static{this.\u0275cmp=H({type:t,selectors:[["bkd-edit-absences"]],features:[pe([te,{provide:hi,useExisting:te},gi])],decls:1,vars:0,template:function(i,n){i&1&&L(0,"router-outlet")},dependencies:[jt],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var lo=[{path:"",component:ln,children:[{path:"",component:on,data:{restoreScrollPositionFrom:["/edit-absences/edit","/edit-absences/student/:id/addresses","/edit-absences/student/:id/absences","/edit-absences/student/:id/grades"]}},{path:"edit",component:Hi},xi]}];export{lo as EDIT_ABSENCES_ROUTES}; diff --git a/public/apps/webapp-schulverwaltung/chunk-3HCVMNJA.js b/public/apps/webapp-schulverwaltung/chunk-THL2WTJD.js similarity index 99% rename from public/apps/webapp-schulverwaltung/chunk-3HCVMNJA.js rename to public/apps/webapp-schulverwaltung/chunk-THL2WTJD.js index a44b8a20..0417ee65 100644 --- a/public/apps/webapp-schulverwaltung/chunk-3HCVMNJA.js +++ b/public/apps/webapp-schulverwaltung/chunk-THL2WTJD.js @@ -1 +1 @@ -import{a as we,b as Ee,c as je,d as Ve,e as Me}from"./chunk-5WNFCBTP.js";import{t as R,w as Fe}from"./chunk-A3CECLYB.js";import{d as $e,e as Te}from"./chunk-746ASKQ4.js";import{b as te}from"./chunk-3L4RH6QP.js";import{a as Be}from"./chunk-DTYYCJHM.js";import{L as Ie,P as Z,T as Le,U as Re}from"./chunk-SRCW6BUG.js";import{a as Pe}from"./chunk-OSOXMODN.js";import{b as ee}from"./chunk-PSYDBHTH.js";import{c as Y,d as z,e as J,f as K,g as X}from"./chunk-W4U7QKJF.js";import{a as ke}from"./chunk-AVBHFGIF.js";import{$a as a,Ab as g,Ac as Se,Bb as y,Cb as v,Db as W,Eb as re,Fb as ae,Ga as I,Jb as d,Kb as m,L as me,Lb as ve,M as ue,Na as c,O as oe,Od as De,P as E,Pd as M,Qa as p,R as U,Ra as fe,Va as _,Wa as _e,X as Q,Ya as N,Za as O,_ as L,_a as r,a as j,ab as b,b as V,cc as w,cd as Ae,dc as Ce,ea as k,eb as F,f as q,fa as D,g as ce,gb as $,h as se,hb as l,ib as be,jb as he,k as de,l as pe,n as P,o as le,qb as h,rb as u,sb as H,tb as f,wc as xe,xa as n,xc as ge,ya as x,zc as ye}from"./chunk-2W7IS4PN.js";var ie=(()=>{class e{constructor(t,i,s,C,B){this.settings=t,this.lessonPresencesService=i,this.presenceTypesService=s,this.toastService=C,this.translate=B,this.studentId$=new se(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(t){this.studentId$.next(t)}getAbsences(t){return this.studentId$.pipe(E(t),oe(null),me({connector:()=>new se(1)}))}getCounts(){return this.studentId$.pipe(E(t=>le([this.loadStatistics(t).pipe(oe(null)),this.openAbsences$.pipe(P(i=>i?.length??null)),this.checkableAbsences$.pipe(P(i=>i?.length??null))])),P(([t,i,s])=>({openAbsences:i,checkableAbsences:s,excusedAbsences:t?.TotalAbsencesValidExcuse??null,unexcusedAbsences:t?.TotalAbsencesWithoutExcuse??null,incidents:t?.TotalIncidents??null,halfDays:t?.TotalHalfDays??null})))}loadStatistics(t){return this.lessonPresencesService.getStatistics({student:t,educationalEvent:null,studyClass:null},null,0).pipe(E(({entries:i})=>i.length>0?pe(i[0]):(this.toastService.error(this.translate.instant("global.rest-errors.notfound-message"),this.translate.instant("global.rest-errors.notfound-title")),de)))}loadOpenAbsences(t){return this.lessonPresencesService.getListOfUnconfirmed(this.getBaseParams(t))}loadCheckableAbsences(t){return this.lessonPresencesService.getList({params:V(j({},this.getBaseParams(t)),{"filter.ConfirmationStateId":`=${this.settings.checkableAbsenceStateId}`})})}loadExcusedAbsences(t){return this.lessonPresencesService.getList({params:V(j({},this.getBaseParams(t)),{"filter.ConfirmationStateId":`=${this.settings.excusedAbsenceStateId}`})})}loadUnexcusedAbsences(t){return this.lessonPresencesService.getList({params:V(j({},this.getBaseParams(t)),{"filter.ConfirmationStateId":`=${this.settings.unexcusedAbsenceStateId}`})})}loadIncidents(t){return this.presenceTypesService.incidentTypes$.pipe(P(i=>V(j({},this.getBaseParams(t)),{"filter.TypeRef":`;${i.map(s=>s.Id).join(";")}`})),E(i=>this.lessonPresencesService.getList({params:i})))}loadHalfDays(t){return this.lessonPresencesService.getList({params:V(j({},this.getBaseParams(t)),{"filter.TypeRef":`=${this.settings.halfDayPresenceTypeId}`})})}getBaseParams(t){return{sort:"LessonDateTimeFrom.asc","filter.StudentRef":`=${t}`}}static{this.\u0275fac=function(i){return new(i||e)(L(Ae),L(Te),L(Z),L(ke),L(De))}}static{this.\u0275prov=Q({token:e,factory:e.\u0275fac})}}return e})();var T=(()=>{class e{constructor(t,i){this.profileService=t,this.route=i,this.currentDossier$=new ce("addresses"),this.studentId$=this.route.paramMap.pipe(P(s=>Number(s.get("id")))),this.profile$=this.studentId$.pipe(E(s=>this.profileService.getProfile(s)),ue(1)),this.returnParams$=this.route.queryParams.pipe(P(({returnparams:s})=>s)),this.backlinkQueryParams$=this.returnParams$.pipe(P(Be)),this.loading$=this.profileService.loading$}static{this.\u0275fac=function(i){return new(i||e)(L(we),L(xe))}}static{this.\u0275prov=Q({token:e,factory:e.\u0275fac})}}return e})();function ze(e,o){if(e&1&&u(0),e&2){l();let t=v(0);f(" (",t==null?null:t.checkableAbsences,") ")}}function Je(e,o){if(e&1&&b(0,"bkd-student-dossier-absences",13),e&2){let t=l();p("absences$",t.absencesService.checkableAbsences$)}}function Ke(e,o){if(e&1&&u(0),e&2){l();let t=v(0);f(" (",t==null?null:t.openAbsences,") ")}}function Xe(e,o){if(e&1&&b(0,"bkd-student-dossier-absences",14),e&2){let t=l();p("absences$",t.absencesService.openAbsences$)("selectionService",t.absencesSelectionService)}}function Ze(e,o){if(e&1&&u(0),e&2){l();let t=v(0);f(" (",t==null?null:t.excusedAbsences,") ")}}function et(e,o){if(e&1&&b(0,"bkd-student-dossier-absences",13),e&2){let t=l();p("absences$",t.absencesService.excusedAbsences$)}}function tt(e,o){if(e&1&&u(0),e&2){l();let t=v(0);f(" (",t==null?null:t.unexcusedAbsences,") ")}}function it(e,o){if(e&1&&b(0,"bkd-student-dossier-absences",15),e&2){let t=l();p("absences$",t.absencesService.unexcusedAbsences$)("displayPresenceType",!1)}}function nt(e,o){if(e&1&&u(0),e&2){l();let t=v(0);f(" (",t==null?null:t.incidents,") ")}}function st(e,o){if(e&1&&b(0,"bkd-student-dossier-absences",13),e&2){let t=l();p("absences$",t.absencesService.incidents$)}}function ot(e,o){if(e&1&&u(0),e&2){l(2);let t=v(0);f(" (",t==null?null:t.halfDays,") ")}}function rt(e,o){if(e&1&&b(0,"bkd-student-dossier-absences",15),e&2){let t=l(2);p("absences$",t.absencesService.halfDays$)("displayPresenceType",!1)}}function at(e,o){if(e&1){let t=F();r(0,"div",12,5)(2,"div",8)(3,"bkd-student-dossier-entry-header",9),$("click",function(){k(t);let s=h(1);return D(s.toggle())}),u(4),d(5,"translate"),c(6,ot,1,1),a()(),r(7,"div",10)(8,"div",11),c(9,rt,1,2,"ng-template"),a()()()}if(e&2){let t=h(1);l();let i=v(0);n(3),p("opened",!t.collapsed),n(),f(" ",m(5,3,"shared.profile.half-days")," "),n(2),_((i==null?null:i.halfDays)!==null?6:-1)}}var Ge=(()=>{class e{constructor(t,i,s,C){this.state=t,this.presenceTypesService=i,this.absencesService=s,this.absencesSelectionService=C,this.halfDayActive$=this.presenceTypesService.halfDayActive$,this.destroy$=new q,this.state.currentDossier$.next("absences")}ngOnInit(){this.state.studentId$.pipe(U(this.destroy$)).subscribe(t=>this.absencesService.setStudentId(t))}ngOnDestroy(){this.destroy$.next()}static{this.\u0275fac=function(i){return new(i||e)(x(T),x(Z),x(ie),x(Ie))}}static{this.\u0275cmp=I({type:e,selectors:[["bkd-dossier-absences"]],features:[W([ie])],decls:55,vars:31,consts:[["checkableAbsences","ngbAccordionItem"],["openAbsences","ngbAccordionItem"],["excusedAbsences","ngbAccordionItem"],["unexcusedAbsences","ngbAccordionItem"],["incidents","ngbAccordionItem"],["halfDays","ngbAccordionItem"],["ngbAccordion",""],["ngbAccordionItem",""],["ngbAccordionHeader",""],[3,"click","opened"],["ngbAccordionCollapse",""],["ngbAccordionBody",""],["ngbAccordionItem","","id","half-days"],[3,"absences$"],[3,"absences$","selectionService"],[3,"absences$","displayPresenceType"]],template:function(i,s){if(i&1){let C=F();g(0),d(1,"async"),r(2,"div",6)(3,"div",7,0)(5,"div",8)(6,"bkd-student-dossier-entry-header",9),$("click",function(){k(C);let S=h(4);return D(S.toggle())}),u(7),d(8,"translate"),c(9,ze,1,1),a()(),r(10,"div",10)(11,"div",11),c(12,Je,1,1,"ng-template"),a()()(),r(13,"div",7,1)(15,"div",8)(16,"bkd-student-dossier-entry-header",9),$("click",function(){k(C);let S=h(14);return D(S.toggle())}),u(17),d(18,"translate"),c(19,Ke,1,1),a()(),r(20,"div",10)(21,"div",11),c(22,Xe,1,2,"ng-template"),a()()(),r(23,"div",7,2)(25,"div",8)(26,"bkd-student-dossier-entry-header",9),$("click",function(){k(C);let S=h(24);return D(S.toggle())}),u(27),d(28,"translate"),c(29,Ze,1,1),a()(),r(30,"div",10)(31,"div",11),c(32,et,1,1,"ng-template"),a()()(),r(33,"div",7,3)(35,"div",8)(36,"bkd-student-dossier-entry-header",9),$("click",function(){k(C);let S=h(34);return D(S.toggle())}),u(37),d(38,"translate"),c(39,tt,1,1),a()(),r(40,"div",10)(41,"div",11),c(42,it,1,2,"ng-template"),a()()(),r(43,"div",7,4)(45,"div",8)(46,"bkd-student-dossier-entry-header",9),$("click",function(){k(C);let S=h(44);return D(S.toggle())}),u(47),d(48,"translate"),c(49,nt,1,1),a()(),r(50,"div",10)(51,"div",11),c(52,st,1,1,"ng-template"),a()()(),c(53,at,10,5,"div",12),d(54,"async"),a()}if(i&2){let C=h(4),B=h(14),S=h(24),Ue=h(34),Qe=h(44),A=y(m(1,16,s.absencesService.counts$));n(6),p("opened",!C.collapsed),n(),f(" ",m(8,19,"shared.profile.checkable-absences")," "),n(2),_((A==null?null:A.checkableAbsences)!==null?9:-1),n(7),p("opened",!B.collapsed),n(),f(" ",m(18,21,"shared.profile.open-absences")," "),n(2),_((A==null?null:A.openAbsences)!==null?19:-1),n(7),p("opened",!S.collapsed),n(),f(" ",m(28,23,"shared.profile.excused-absences")," "),n(2),_((A==null?null:A.excusedAbsences)!==null?29:-1),n(7),p("opened",!Ue.collapsed),n(),f(" ",m(38,25,"shared.profile.unexcused-absences")," "),n(2),_((A==null?null:A.unexcusedAbsences)!==null?39:-1),n(7),p("opened",!Qe.collapsed),n(),f(" ",m(48,27,"shared.profile.incidents")," "),n(2),_((A==null?null:A.incidents)!==null?49:-1),n(4),_(m(54,29,s.halfDayActive$)?53:-1)}},dependencies:[X,K,J,te,z,Y,Le,w,M],encapsulation:2,changeDetection:0})}}return e})();var ct=(e,o)=>o.apprenticeshipContract.Id,dt=(e,o)=>o.Id;function pt(e,o){if(e&1&&b(0,"bkd-student-dossier-legal-representative",9),e&2){let t=o.$implicit;p("person",t)}}function lt(e,o){if(e&1&&N(0,pt,1,1,"bkd-student-dossier-legal-representative",9,dt),e&2){l(3);let t=v(0);O(t.legalRepresentativePersons)}}function mt(e,o){if(e&1){let t=F();r(0,"div",4,0)(2,"div",5)(3,"bkd-student-dossier-entry-header",6),$("click",function(){k(t);let s=h(1);return D(s.toggle())}),u(4),d(5,"translate"),a()(),r(6,"div",7)(7,"div",8),c(8,lt,2,0,"ng-template"),a()()()}if(e&2){let t=h(1);n(3),p("opened",!t.collapsed),n(),f(" ",m(5,2,"shared.profile.legal-representation")," ")}}function ut(e,o){if(e&1&&u(0),e&2){let t=l().$index;f(" ",t+1," ")}}function ft(e,o){if(e&1&&b(0,"bkd-student-dossier-apprenticeship-company",10),e&2){let t=l().$implicit;p("company",t)}}function _t(e,o){if(e&1){let t=F();r(0,"div",4,1)(2,"div",5)(3,"bkd-student-dossier-entry-header",6),$("click",function(){k(t);let s=h(1);return D(s.toggle())}),u(4),d(5,"translate"),c(6,ut,1,1),a()(),r(7,"div",7)(8,"div",8),c(9,ft,1,1,"ng-template"),a()()()}if(e&2){let t=h(1);l(2);let i=v(0);n(3),p("opened",!t.collapsed),n(),f(" ",m(5,3,"shared.profile.apprenticeship-company")," "),n(2),_(i.apprenticeshipCompanies.length>1?6:-1)}}function bt(e,o){if(e&1&&(b(0,"bkd-student-dossier-address",2),r(1,"div",3),c(2,mt,9,4,"div",4),N(3,_t,10,5,"div",4,ct),a()),e&2){l();let t=v(0);p("student",t.student),n(2),_(t.legalRepresentativePersons.length>0?2:-1),n(),O(t.apprenticeshipCompanies)}}var Ne=(()=>{class e{constructor(t){this.state=t,this.state.currentDossier$.next("addresses")}static{this.\u0275fac=function(i){return new(i||e)(x(T))}}static{this.\u0275cmp=I({type:e,selectors:[["bkd-dossier-addresses"]],decls:3,vars:4,consts:[["legalRepresentatives","ngbAccordionItem"],["apprenticeshipCompanies","ngbAccordionItem"],[1,"profile-entry",3,"student"],["ngbAccordion",""],["ngbAccordionItem",""],["ngbAccordionHeader",""],[3,"click","opened"],["ngbAccordionCollapse",""],["ngbAccordionBody",""],[1,"profile-entry",3,"person"],[1,"profile-entry",3,"company"]],template:function(i,s){if(i&1&&(g(0),d(1,"async"),c(2,bt,5,2)),i&2){let C=y(m(1,1,s.state.profile$));n(2),_(C?2:-1)}},dependencies:[Ee,X,K,J,te,z,Y,Ve,je,w,M],styles:[".profile-entry[_ngcontent-%COMP%]{display:block;padding:0 1rem}"],changeDetection:0})}}return e})();function vt(e,o){e&1&&b(0,"bkd-spinner")}function Ct(e,o){if(e&1&&b(0,"bkd-dossier-grades-view",0),e&2){l();let t=v(0),i=v(2),s=v(4);p("courses",t)("studentId",i)("gradingScales",s)}}var Oe=(()=>{class e{constructor(t,i){this.state=t,this.dossierGradesService=i,this.destroy$=new q}ngOnInit(){this.state.currentDossier$.next("grades"),this.state.studentId$.pipe(U(this.destroy$)).subscribe(t=>this.dossierGradesService.setStudentId(t))}ngOnDestroy(){this.destroy$.next()}static{this.\u0275fac=function(i){return new(i||e)(x(T),x(R))}}static{this.\u0275cmp=I({type:e,selectors:[["bkd-dossier-grades"]],decls:9,vars:12,consts:[[3,"courses","studentId","gradingScales"]],template:function(i,s){i&1&&(g(0),d(1,"async"),g(2),d(3,"async"),g(4),d(5,"async"),c(6,vt,1,0,"bkd-spinner"),d(7,"async"),c(8,Ct,1,3,"bkd-dossier-grades-view",0)),i&2&&(y(m(1,1,s.dossierGradesService.studentCourses$)),n(2),y(m(3,4,s.state.studentId$)),n(2),y(m(5,7,s.dossierGradesService.gradingScales$)),n(2),_(m(7,10,s.dossierGradesService.loading$)?6:8))},dependencies:[Fe,ee,w],encapsulation:2})}}return e})();var xt=["*"];function gt(e,o){if(e&1&&(r(0,"div",5)(1,"span",6),u(2),d(3,"date"),a(),r(4,"span",7),u(5),a()()),e&2){let t=l();n(2),H(ve(3,2,t.student.Birthdate,"dd.MM.yyyy")),n(3),f("(",t.student.Gender,")")}}var He=(()=>{class e{constructor(){this.link="/"}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=I({type:e,selectors:[["bkd-student-backlink"]],inputs:{link:"link",queryParams:"queryParams",studentId:"studentId",studentName:"studentName",student:"student"},ngContentSelectors:xt,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"],[1,"additional-info"],[1,"birthday"],[1,"gender"]],template:function(i,s){i&1&&(be(),r(0,"div",0)(1,"bkd-backlink",1),he(2),a(),r(3,"div",2),b(4,"bkd-avatar",3),r(5,"div",4)(6,"h1"),u(7),a(),c(8,gt,6,5,"div",5),a()()()),i&2&&(n(),p("link",s.link)("params",s.queryParams),n(3),p("studentId",s.studentId),n(3),H(s.student?s.student.FullName:s.studentName),n(),_(s.student?8:-1))},dependencies:[Re,Me,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})}}return e})();var yt=()=>["addresses","absences","grades"],St=()=>[],At=e=>({returnparams:e}),kt=e=>[e];function Dt(e,o){e&1&&b(0,"bkd-spinner")}function It(e,o){if(e&1&&b(0,"bkd-reports-link",3),e&2){let t;l(2);let i=v(4);p("reports",(t=i)!==null&&t!==void 0?t:re(1,St))}}function $t(e,o){if(e&1&&(r(0,"a",5),d(1,"async"),r(2,"button",6,0),u(4),d(5,"translate"),a()()),e&2){let t=o.$implicit,i=h(3),s=l(2);p("queryParams",ae(9,At,m(1,5,s.state.returnParams$)))("routerLink",ae(11,kt,t)),n(2),fe("btn-outline-secondary",!i.isActive),n(2),f(" ",m(5,7,"dossier."+t)," ")}}function Tt(e,o){e&1&&(r(0,"div"),b(1,"router-outlet"),a())}function Pt(e,o){e&1&&(r(0,"p"),u(1),d(2,"translate"),a()),e&2&&(n(),H(m(2,1,"shared.profile.no-profile")))}function Lt(e,o){if(e&1&&(r(0,"bkd-student-backlink",2),d(1,"async"),d(2,"async"),c(3,It,1,2,"bkd-reports-link",3),a(),r(4,"div",4),N(5,$t,6,13,"a",5,_e),a(),c(7,Tt,2,0,"div")(8,Pt,3,3,"p")),e&2){let t=l(),i=v(0),s=v(2);p("link","../..")("queryParams",m(1,6,t.state.backlinkQueryParams$))("studentId",m(2,8,t.state.studentId$))("student",i&&i.student),n(3),_(s==="grades"?3:-1),n(2),O(re(10,yt)),n(2),_(i?7:8)}}var qe=(()=>{class e{constructor(t,i){this.state=t,this.dossierGradesService=i,this.state.currentDossier$.next("addresses")}static{this.\u0275fac=function(i){return new(i||e)(x(T),x(R))}}static{this.\u0275cmp=I({type:e,selectors:[["bkd-student-dossier"]],features:[W([T,R])],decls:10,vars:12,consts:[["rla","routerLinkActive"],[1,"bkd-container","bkd-container-limited"],[1,"mb-2",3,"link","queryParams","studentId","student"],[1,"ms-2",3,"reports"],[1,"d-flex","flex-row","py-3","flex-wrap"],[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(i,s){i&1&&(g(0),d(1,"async"),g(2),d(3,"async"),g(4),d(5,"async"),r(6,"div",1),c(7,Dt,1,0,"bkd-spinner"),d(8,"async"),c(9,Lt,9,11),a()),i&2&&(y(m(1,1,s.state.profile$)),n(2),y(m(3,4,s.state.currentDossier$)),n(2),y(m(5,7,s.dossierGradesService.testReports$)),n(3),_(m(8,10,s.state.loading$)?7:9))},dependencies:[He,Pe,ye,Se,ge,ee,w,M],encapsulation:2,changeDetection:0})}}return e})();var Li={path:"student/:id",children:[{path:"",component:qe,children:[{path:"addresses",component:Ne},{path:"absences",component:Ge},{path:"grades",component:Oe}]},{path:"absences/confirm",component:$e}]};export{Li as a}; +import{a as we,b as Ee,c as je,d as Ve,e as Me}from"./chunk-5WNFCBTP.js";import{t as R,w as Fe}from"./chunk-LASWC23V.js";import{d as $e,e as Te}from"./chunk-746ASKQ4.js";import{b as te}from"./chunk-3L4RH6QP.js";import{a as Be}from"./chunk-DTYYCJHM.js";import{L as Ie,P as Z,T as Le,U as Re}from"./chunk-SRCW6BUG.js";import{a as Pe}from"./chunk-OSOXMODN.js";import{b as ee}from"./chunk-PSYDBHTH.js";import{c as Y,d as z,e as J,f as K,g as X}from"./chunk-W4U7QKJF.js";import{a as ke}from"./chunk-AVBHFGIF.js";import{$a as a,Ab as g,Ac as Se,Bb as y,Cb as v,Db as W,Eb as re,Fb as ae,Ga as I,Jb as d,Kb as m,L as me,Lb as ve,M as ue,Na as c,O as oe,Od as De,P as E,Pd as M,Qa as p,R as U,Ra as fe,Va as _,Wa as _e,X as Q,Ya as N,Za as O,_ as L,_a as r,a as j,ab as b,b as V,cc as w,cd as Ae,dc as Ce,ea as k,eb as F,f as q,fa as D,g as ce,gb as $,h as se,hb as l,ib as be,jb as he,k as de,l as pe,n as P,o as le,qb as h,rb as u,sb as H,tb as f,wc as xe,xa as n,xc as ge,ya as x,zc as ye}from"./chunk-2W7IS4PN.js";var ie=(()=>{class e{constructor(t,i,s,C,B){this.settings=t,this.lessonPresencesService=i,this.presenceTypesService=s,this.toastService=C,this.translate=B,this.studentId$=new se(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(t){this.studentId$.next(t)}getAbsences(t){return this.studentId$.pipe(E(t),oe(null),me({connector:()=>new se(1)}))}getCounts(){return this.studentId$.pipe(E(t=>le([this.loadStatistics(t).pipe(oe(null)),this.openAbsences$.pipe(P(i=>i?.length??null)),this.checkableAbsences$.pipe(P(i=>i?.length??null))])),P(([t,i,s])=>({openAbsences:i,checkableAbsences:s,excusedAbsences:t?.TotalAbsencesValidExcuse??null,unexcusedAbsences:t?.TotalAbsencesWithoutExcuse??null,incidents:t?.TotalIncidents??null,halfDays:t?.TotalHalfDays??null})))}loadStatistics(t){return this.lessonPresencesService.getStatistics({student:t,educationalEvent:null,studyClass:null},null,0).pipe(E(({entries:i})=>i.length>0?pe(i[0]):(this.toastService.error(this.translate.instant("global.rest-errors.notfound-message"),this.translate.instant("global.rest-errors.notfound-title")),de)))}loadOpenAbsences(t){return this.lessonPresencesService.getListOfUnconfirmed(this.getBaseParams(t))}loadCheckableAbsences(t){return this.lessonPresencesService.getList({params:V(j({},this.getBaseParams(t)),{"filter.ConfirmationStateId":`=${this.settings.checkableAbsenceStateId}`})})}loadExcusedAbsences(t){return this.lessonPresencesService.getList({params:V(j({},this.getBaseParams(t)),{"filter.ConfirmationStateId":`=${this.settings.excusedAbsenceStateId}`})})}loadUnexcusedAbsences(t){return this.lessonPresencesService.getList({params:V(j({},this.getBaseParams(t)),{"filter.ConfirmationStateId":`=${this.settings.unexcusedAbsenceStateId}`})})}loadIncidents(t){return this.presenceTypesService.incidentTypes$.pipe(P(i=>V(j({},this.getBaseParams(t)),{"filter.TypeRef":`;${i.map(s=>s.Id).join(";")}`})),E(i=>this.lessonPresencesService.getList({params:i})))}loadHalfDays(t){return this.lessonPresencesService.getList({params:V(j({},this.getBaseParams(t)),{"filter.TypeRef":`=${this.settings.halfDayPresenceTypeId}`})})}getBaseParams(t){return{sort:"LessonDateTimeFrom.asc","filter.StudentRef":`=${t}`}}static{this.\u0275fac=function(i){return new(i||e)(L(Ae),L(Te),L(Z),L(ke),L(De))}}static{this.\u0275prov=Q({token:e,factory:e.\u0275fac})}}return e})();var T=(()=>{class e{constructor(t,i){this.profileService=t,this.route=i,this.currentDossier$=new ce("addresses"),this.studentId$=this.route.paramMap.pipe(P(s=>Number(s.get("id")))),this.profile$=this.studentId$.pipe(E(s=>this.profileService.getProfile(s)),ue(1)),this.returnParams$=this.route.queryParams.pipe(P(({returnparams:s})=>s)),this.backlinkQueryParams$=this.returnParams$.pipe(P(Be)),this.loading$=this.profileService.loading$}static{this.\u0275fac=function(i){return new(i||e)(L(we),L(xe))}}static{this.\u0275prov=Q({token:e,factory:e.\u0275fac})}}return e})();function ze(e,o){if(e&1&&u(0),e&2){l();let t=v(0);f(" (",t==null?null:t.checkableAbsences,") ")}}function Je(e,o){if(e&1&&b(0,"bkd-student-dossier-absences",13),e&2){let t=l();p("absences$",t.absencesService.checkableAbsences$)}}function Ke(e,o){if(e&1&&u(0),e&2){l();let t=v(0);f(" (",t==null?null:t.openAbsences,") ")}}function Xe(e,o){if(e&1&&b(0,"bkd-student-dossier-absences",14),e&2){let t=l();p("absences$",t.absencesService.openAbsences$)("selectionService",t.absencesSelectionService)}}function Ze(e,o){if(e&1&&u(0),e&2){l();let t=v(0);f(" (",t==null?null:t.excusedAbsences,") ")}}function et(e,o){if(e&1&&b(0,"bkd-student-dossier-absences",13),e&2){let t=l();p("absences$",t.absencesService.excusedAbsences$)}}function tt(e,o){if(e&1&&u(0),e&2){l();let t=v(0);f(" (",t==null?null:t.unexcusedAbsences,") ")}}function it(e,o){if(e&1&&b(0,"bkd-student-dossier-absences",15),e&2){let t=l();p("absences$",t.absencesService.unexcusedAbsences$)("displayPresenceType",!1)}}function nt(e,o){if(e&1&&u(0),e&2){l();let t=v(0);f(" (",t==null?null:t.incidents,") ")}}function st(e,o){if(e&1&&b(0,"bkd-student-dossier-absences",13),e&2){let t=l();p("absences$",t.absencesService.incidents$)}}function ot(e,o){if(e&1&&u(0),e&2){l(2);let t=v(0);f(" (",t==null?null:t.halfDays,") ")}}function rt(e,o){if(e&1&&b(0,"bkd-student-dossier-absences",15),e&2){let t=l(2);p("absences$",t.absencesService.halfDays$)("displayPresenceType",!1)}}function at(e,o){if(e&1){let t=F();r(0,"div",12,5)(2,"div",8)(3,"bkd-student-dossier-entry-header",9),$("click",function(){k(t);let s=h(1);return D(s.toggle())}),u(4),d(5,"translate"),c(6,ot,1,1),a()(),r(7,"div",10)(8,"div",11),c(9,rt,1,2,"ng-template"),a()()()}if(e&2){let t=h(1);l();let i=v(0);n(3),p("opened",!t.collapsed),n(),f(" ",m(5,3,"shared.profile.half-days")," "),n(2),_((i==null?null:i.halfDays)!==null?6:-1)}}var Ge=(()=>{class e{constructor(t,i,s,C){this.state=t,this.presenceTypesService=i,this.absencesService=s,this.absencesSelectionService=C,this.halfDayActive$=this.presenceTypesService.halfDayActive$,this.destroy$=new q,this.state.currentDossier$.next("absences")}ngOnInit(){this.state.studentId$.pipe(U(this.destroy$)).subscribe(t=>this.absencesService.setStudentId(t))}ngOnDestroy(){this.destroy$.next()}static{this.\u0275fac=function(i){return new(i||e)(x(T),x(Z),x(ie),x(Ie))}}static{this.\u0275cmp=I({type:e,selectors:[["bkd-dossier-absences"]],features:[W([ie])],decls:55,vars:31,consts:[["checkableAbsences","ngbAccordionItem"],["openAbsences","ngbAccordionItem"],["excusedAbsences","ngbAccordionItem"],["unexcusedAbsences","ngbAccordionItem"],["incidents","ngbAccordionItem"],["halfDays","ngbAccordionItem"],["ngbAccordion",""],["ngbAccordionItem",""],["ngbAccordionHeader",""],[3,"click","opened"],["ngbAccordionCollapse",""],["ngbAccordionBody",""],["ngbAccordionItem","","id","half-days"],[3,"absences$"],[3,"absences$","selectionService"],[3,"absences$","displayPresenceType"]],template:function(i,s){if(i&1){let C=F();g(0),d(1,"async"),r(2,"div",6)(3,"div",7,0)(5,"div",8)(6,"bkd-student-dossier-entry-header",9),$("click",function(){k(C);let S=h(4);return D(S.toggle())}),u(7),d(8,"translate"),c(9,ze,1,1),a()(),r(10,"div",10)(11,"div",11),c(12,Je,1,1,"ng-template"),a()()(),r(13,"div",7,1)(15,"div",8)(16,"bkd-student-dossier-entry-header",9),$("click",function(){k(C);let S=h(14);return D(S.toggle())}),u(17),d(18,"translate"),c(19,Ke,1,1),a()(),r(20,"div",10)(21,"div",11),c(22,Xe,1,2,"ng-template"),a()()(),r(23,"div",7,2)(25,"div",8)(26,"bkd-student-dossier-entry-header",9),$("click",function(){k(C);let S=h(24);return D(S.toggle())}),u(27),d(28,"translate"),c(29,Ze,1,1),a()(),r(30,"div",10)(31,"div",11),c(32,et,1,1,"ng-template"),a()()(),r(33,"div",7,3)(35,"div",8)(36,"bkd-student-dossier-entry-header",9),$("click",function(){k(C);let S=h(34);return D(S.toggle())}),u(37),d(38,"translate"),c(39,tt,1,1),a()(),r(40,"div",10)(41,"div",11),c(42,it,1,2,"ng-template"),a()()(),r(43,"div",7,4)(45,"div",8)(46,"bkd-student-dossier-entry-header",9),$("click",function(){k(C);let S=h(44);return D(S.toggle())}),u(47),d(48,"translate"),c(49,nt,1,1),a()(),r(50,"div",10)(51,"div",11),c(52,st,1,1,"ng-template"),a()()(),c(53,at,10,5,"div",12),d(54,"async"),a()}if(i&2){let C=h(4),B=h(14),S=h(24),Ue=h(34),Qe=h(44),A=y(m(1,16,s.absencesService.counts$));n(6),p("opened",!C.collapsed),n(),f(" ",m(8,19,"shared.profile.checkable-absences")," "),n(2),_((A==null?null:A.checkableAbsences)!==null?9:-1),n(7),p("opened",!B.collapsed),n(),f(" ",m(18,21,"shared.profile.open-absences")," "),n(2),_((A==null?null:A.openAbsences)!==null?19:-1),n(7),p("opened",!S.collapsed),n(),f(" ",m(28,23,"shared.profile.excused-absences")," "),n(2),_((A==null?null:A.excusedAbsences)!==null?29:-1),n(7),p("opened",!Ue.collapsed),n(),f(" ",m(38,25,"shared.profile.unexcused-absences")," "),n(2),_((A==null?null:A.unexcusedAbsences)!==null?39:-1),n(7),p("opened",!Qe.collapsed),n(),f(" ",m(48,27,"shared.profile.incidents")," "),n(2),_((A==null?null:A.incidents)!==null?49:-1),n(4),_(m(54,29,s.halfDayActive$)?53:-1)}},dependencies:[X,K,J,te,z,Y,Le,w,M],encapsulation:2,changeDetection:0})}}return e})();var ct=(e,o)=>o.apprenticeshipContract.Id,dt=(e,o)=>o.Id;function pt(e,o){if(e&1&&b(0,"bkd-student-dossier-legal-representative",9),e&2){let t=o.$implicit;p("person",t)}}function lt(e,o){if(e&1&&N(0,pt,1,1,"bkd-student-dossier-legal-representative",9,dt),e&2){l(3);let t=v(0);O(t.legalRepresentativePersons)}}function mt(e,o){if(e&1){let t=F();r(0,"div",4,0)(2,"div",5)(3,"bkd-student-dossier-entry-header",6),$("click",function(){k(t);let s=h(1);return D(s.toggle())}),u(4),d(5,"translate"),a()(),r(6,"div",7)(7,"div",8),c(8,lt,2,0,"ng-template"),a()()()}if(e&2){let t=h(1);n(3),p("opened",!t.collapsed),n(),f(" ",m(5,2,"shared.profile.legal-representation")," ")}}function ut(e,o){if(e&1&&u(0),e&2){let t=l().$index;f(" ",t+1," ")}}function ft(e,o){if(e&1&&b(0,"bkd-student-dossier-apprenticeship-company",10),e&2){let t=l().$implicit;p("company",t)}}function _t(e,o){if(e&1){let t=F();r(0,"div",4,1)(2,"div",5)(3,"bkd-student-dossier-entry-header",6),$("click",function(){k(t);let s=h(1);return D(s.toggle())}),u(4),d(5,"translate"),c(6,ut,1,1),a()(),r(7,"div",7)(8,"div",8),c(9,ft,1,1,"ng-template"),a()()()}if(e&2){let t=h(1);l(2);let i=v(0);n(3),p("opened",!t.collapsed),n(),f(" ",m(5,3,"shared.profile.apprenticeship-company")," "),n(2),_(i.apprenticeshipCompanies.length>1?6:-1)}}function bt(e,o){if(e&1&&(b(0,"bkd-student-dossier-address",2),r(1,"div",3),c(2,mt,9,4,"div",4),N(3,_t,10,5,"div",4,ct),a()),e&2){l();let t=v(0);p("student",t.student),n(2),_(t.legalRepresentativePersons.length>0?2:-1),n(),O(t.apprenticeshipCompanies)}}var Ne=(()=>{class e{constructor(t){this.state=t,this.state.currentDossier$.next("addresses")}static{this.\u0275fac=function(i){return new(i||e)(x(T))}}static{this.\u0275cmp=I({type:e,selectors:[["bkd-dossier-addresses"]],decls:3,vars:4,consts:[["legalRepresentatives","ngbAccordionItem"],["apprenticeshipCompanies","ngbAccordionItem"],[1,"profile-entry",3,"student"],["ngbAccordion",""],["ngbAccordionItem",""],["ngbAccordionHeader",""],[3,"click","opened"],["ngbAccordionCollapse",""],["ngbAccordionBody",""],[1,"profile-entry",3,"person"],[1,"profile-entry",3,"company"]],template:function(i,s){if(i&1&&(g(0),d(1,"async"),c(2,bt,5,2)),i&2){let C=y(m(1,1,s.state.profile$));n(2),_(C?2:-1)}},dependencies:[Ee,X,K,J,te,z,Y,Ve,je,w,M],styles:[".profile-entry[_ngcontent-%COMP%]{display:block;padding:0 1rem}"],changeDetection:0})}}return e})();function vt(e,o){e&1&&b(0,"bkd-spinner")}function Ct(e,o){if(e&1&&b(0,"bkd-dossier-grades-view",0),e&2){l();let t=v(0),i=v(2),s=v(4);p("courses",t)("studentId",i)("gradingScales",s)}}var Oe=(()=>{class e{constructor(t,i){this.state=t,this.dossierGradesService=i,this.destroy$=new q}ngOnInit(){this.state.currentDossier$.next("grades"),this.state.studentId$.pipe(U(this.destroy$)).subscribe(t=>this.dossierGradesService.setStudentId(t))}ngOnDestroy(){this.destroy$.next()}static{this.\u0275fac=function(i){return new(i||e)(x(T),x(R))}}static{this.\u0275cmp=I({type:e,selectors:[["bkd-dossier-grades"]],decls:9,vars:12,consts:[[3,"courses","studentId","gradingScales"]],template:function(i,s){i&1&&(g(0),d(1,"async"),g(2),d(3,"async"),g(4),d(5,"async"),c(6,vt,1,0,"bkd-spinner"),d(7,"async"),c(8,Ct,1,3,"bkd-dossier-grades-view",0)),i&2&&(y(m(1,1,s.dossierGradesService.studentCourses$)),n(2),y(m(3,4,s.state.studentId$)),n(2),y(m(5,7,s.dossierGradesService.gradingScales$)),n(2),_(m(7,10,s.dossierGradesService.loading$)?6:8))},dependencies:[Fe,ee,w],encapsulation:2})}}return e})();var xt=["*"];function gt(e,o){if(e&1&&(r(0,"div",5)(1,"span",6),u(2),d(3,"date"),a(),r(4,"span",7),u(5),a()()),e&2){let t=l();n(2),H(ve(3,2,t.student.Birthdate,"dd.MM.yyyy")),n(3),f("(",t.student.Gender,")")}}var He=(()=>{class e{constructor(){this.link="/"}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=I({type:e,selectors:[["bkd-student-backlink"]],inputs:{link:"link",queryParams:"queryParams",studentId:"studentId",studentName:"studentName",student:"student"},ngContentSelectors:xt,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"],[1,"additional-info"],[1,"birthday"],[1,"gender"]],template:function(i,s){i&1&&(be(),r(0,"div",0)(1,"bkd-backlink",1),he(2),a(),r(3,"div",2),b(4,"bkd-avatar",3),r(5,"div",4)(6,"h1"),u(7),a(),c(8,gt,6,5,"div",5),a()()()),i&2&&(n(),p("link",s.link)("params",s.queryParams),n(3),p("studentId",s.studentId),n(3),H(s.student?s.student.FullName:s.studentName),n(),_(s.student?8:-1))},dependencies:[Re,Me,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})}}return e})();var yt=()=>["addresses","absences","grades"],St=()=>[],At=e=>({returnparams:e}),kt=e=>[e];function Dt(e,o){e&1&&b(0,"bkd-spinner")}function It(e,o){if(e&1&&b(0,"bkd-reports-link",3),e&2){let t;l(2);let i=v(4);p("reports",(t=i)!==null&&t!==void 0?t:re(1,St))}}function $t(e,o){if(e&1&&(r(0,"a",5),d(1,"async"),r(2,"button",6,0),u(4),d(5,"translate"),a()()),e&2){let t=o.$implicit,i=h(3),s=l(2);p("queryParams",ae(9,At,m(1,5,s.state.returnParams$)))("routerLink",ae(11,kt,t)),n(2),fe("btn-outline-secondary",!i.isActive),n(2),f(" ",m(5,7,"dossier."+t)," ")}}function Tt(e,o){e&1&&(r(0,"div"),b(1,"router-outlet"),a())}function Pt(e,o){e&1&&(r(0,"p"),u(1),d(2,"translate"),a()),e&2&&(n(),H(m(2,1,"shared.profile.no-profile")))}function Lt(e,o){if(e&1&&(r(0,"bkd-student-backlink",2),d(1,"async"),d(2,"async"),c(3,It,1,2,"bkd-reports-link",3),a(),r(4,"div",4),N(5,$t,6,13,"a",5,_e),a(),c(7,Tt,2,0,"div")(8,Pt,3,3,"p")),e&2){let t=l(),i=v(0),s=v(2);p("link","../..")("queryParams",m(1,6,t.state.backlinkQueryParams$))("studentId",m(2,8,t.state.studentId$))("student",i&&i.student),n(3),_(s==="grades"?3:-1),n(2),O(re(10,yt)),n(2),_(i?7:8)}}var qe=(()=>{class e{constructor(t,i){this.state=t,this.dossierGradesService=i,this.state.currentDossier$.next("addresses")}static{this.\u0275fac=function(i){return new(i||e)(x(T),x(R))}}static{this.\u0275cmp=I({type:e,selectors:[["bkd-student-dossier"]],features:[W([T,R])],decls:10,vars:12,consts:[["rla","routerLinkActive"],[1,"bkd-container","bkd-container-limited"],[1,"mb-2",3,"link","queryParams","studentId","student"],[1,"ms-2",3,"reports"],[1,"d-flex","flex-row","py-3","flex-wrap"],[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(i,s){i&1&&(g(0),d(1,"async"),g(2),d(3,"async"),g(4),d(5,"async"),r(6,"div",1),c(7,Dt,1,0,"bkd-spinner"),d(8,"async"),c(9,Lt,9,11),a()),i&2&&(y(m(1,1,s.state.profile$)),n(2),y(m(3,4,s.state.currentDossier$)),n(2),y(m(5,7,s.dossierGradesService.testReports$)),n(3),_(m(8,10,s.state.loading$)?7:9))},dependencies:[He,Pe,ye,Se,ge,ee,w,M],encapsulation:2,changeDetection:0})}}return e})();var Li={path:"student/:id",children:[{path:"",component:qe,children:[{path:"addresses",component:Ne},{path:"absences",component:Ge},{path:"grades",component:Oe}]},{path:"absences/confirm",component:$e}]};export{Li as a}; diff --git a/public/apps/webapp-schulverwaltung/chunk-RTY26FN4.js b/public/apps/webapp-schulverwaltung/chunk-YQAWVQ54.js similarity index 91% rename from public/apps/webapp-schulverwaltung/chunk-RTY26FN4.js rename to public/apps/webapp-schulverwaltung/chunk-YQAWVQ54.js index 0dfdd547..60d6a881 100644 --- a/public/apps/webapp-schulverwaltung/chunk-RTY26FN4.js +++ b/public/apps/webapp-schulverwaltung/chunk-YQAWVQ54.js @@ -1 +1 @@ -import{n as e}from"./chunk-A3CECLYB.js";import{e as p}from"./chunk-Z4YBXGVO.js";import{Md as o,P as i,X as c,_ as s,cd as m,lc as n}from"./chunk-2W7IS4PN.js";var I=(()=>{class t extends p{constructor(a,r){super(a,r,e,"StudyClasses","Number")}getActive(){return this.http.get(`${this.baseUrl}/?filter.IsActive==true`,{headers:{"X-Role-Restriction":"ClassTeacherRole"}}).pipe(i(o(e)))}getActiveFormativeAssessments(){return this.http.get(`${this.baseUrl}/FormativeAssessments?filter.IsActive==true`,{headers:{"X-Role-Restriction":"ClassTeacherRole"}}).pipe(i(o(e)))}static{this.\u0275fac=function(r){return new(r||t)(s(n),s(m))}}static{this.\u0275prov=c({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();export{I as a}; +import{n as e}from"./chunk-LASWC23V.js";import{e as p}from"./chunk-Z4YBXGVO.js";import{Md as o,P as i,X as c,_ as s,cd as m,lc as n}from"./chunk-2W7IS4PN.js";var I=(()=>{class t extends p{constructor(a,r){super(a,r,e,"StudyClasses","Number")}getActive(){return this.http.get(`${this.baseUrl}/?filter.IsActive==true`,{headers:{"X-Role-Restriction":"ClassTeacherRole"}}).pipe(i(o(e)))}getActiveFormativeAssessments(){return this.http.get(`${this.baseUrl}/FormativeAssessments?filter.IsActive==true`,{headers:{"X-Role-Restriction":"ClassTeacherRole"}}).pipe(i(o(e)))}static{this.\u0275fac=function(r){return new(r||t)(s(n),s(m))}}static{this.\u0275prov=c({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();export{I as a}; diff --git a/public/apps/webapp-schulverwaltung/chunk-LHXVMKYN.js b/public/apps/webapp-schulverwaltung/chunk-ZCHQQKGF.js similarity index 93% rename from public/apps/webapp-schulverwaltung/chunk-LHXVMKYN.js rename to public/apps/webapp-schulverwaltung/chunk-ZCHQQKGF.js index d8e6204e..11f0d9e9 100644 --- a/public/apps/webapp-schulverwaltung/chunk-LHXVMKYN.js +++ b/public/apps/webapp-schulverwaltung/chunk-ZCHQQKGF.js @@ -1 +1 @@ -import{q as l}from"./chunk-A3CECLYB.js";import{a as y}from"./chunk-PSYDBHTH.js";import{Hc as n,Ic as i,Md as m,Nc as p,P as o,Vc as d,X as c,_ as s,cd as v,hc as f,lc as u,n as a}from"./chunk-2W7IS4PN.js";var E=p({Id:i,Designation:n,Leadership:d(n),StudentCount:i}),I=p({Id:i,EventType:n,EventTypeId:i});var M=(()=>{class e extends y{constructor(t,r){super(t,r,E,"Events")}getStudyCourseEvents(){let t=new f().set("filter.EventTypeId","=1");return this.getList({params:t})}getSubscriptionDetailsDefinitions(t){return this.http.get(`${this.baseUrl}/${t}/SubscriptionDetails`).pipe(o(m(l)))}getEventTypeId(t){let r={fields:"Id,EventTypeId,EventType","filter.Id":`=${t}`};return this.http.get(`${this.baseUrl}/`,{params:r}).pipe(o(m(I)),a(b=>b[0]?.EventTypeId??null))}static{this.\u0275fac=function(r){return new(r||e)(s(u),s(v))}}static{this.\u0275prov=c({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();export{M as a}; +import{q as l}from"./chunk-LASWC23V.js";import{a as y}from"./chunk-PSYDBHTH.js";import{Hc as n,Ic as i,Md as m,Nc as p,P as o,Vc as d,X as c,_ as s,cd as v,hc as f,lc as u,n as a}from"./chunk-2W7IS4PN.js";var E=p({Id:i,Designation:n,Leadership:d(n),StudentCount:i}),I=p({Id:i,EventType:n,EventTypeId:i});var M=(()=>{class e extends y{constructor(t,r){super(t,r,E,"Events")}getStudyCourseEvents(){let t=new f().set("filter.EventTypeId","=1");return this.getList({params:t})}getSubscriptionDetailsDefinitions(t){return this.http.get(`${this.baseUrl}/${t}/SubscriptionDetails`).pipe(o(m(l)))}getEventTypeId(t){let r={fields:"Id,EventTypeId,EventType","filter.Id":`=${t}`};return this.http.get(`${this.baseUrl}/`,{params:r}).pipe(o(m(I)),a(b=>b[0]?.EventTypeId??null))}static{this.\u0275fac=function(r){return new(r||e)(s(u),s(v))}}static{this.\u0275prov=c({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();export{M as a}; diff --git a/public/apps/webapp-schulverwaltung/main.js b/public/apps/webapp-schulverwaltung/main.js index 32fa8f16..348acdea 100644 --- a/public/apps/webapp-schulverwaltung/main.js +++ b/public/apps/webapp-schulverwaltung/main.js @@ -1 +1 @@ -import{b as Mn}from"./chunk-HCNFZOWE.js";import{c as An}from"./chunk-DTYYCJHM.js";import{a as bn,b as wn}from"./chunk-XAZECV42.js";import{t as gn}from"./chunk-W4U7QKJF.js";import{a as ge}from"./chunk-AVBHFGIF.js";import{$ as H,$a as Y,B as jt,Ba as Gt,Bc as mn,Cc as fn,Ed as yn,Ga as J,Jb as fe,Kb as pe,Ld as _n,Na as xt,Nd as Sn,Od as En,Pd as Oe,Qa as Ne,Qd as vn,Rd as Tn,Sa as Wt,V as v,Va as Jt,Wa as Yt,Wb as nn,X as W,Xa as Xt,Ya as Ce,Z as qt,Za as Fe,_ as j,_a as U,_b as rt,a as Pe,ab as Zt,bd as pn,c as Bt,cc as sn,cd as X,ea as Ut,eb as en,fa as Qt,gb as tn,hb as st,k as Kt,kc as rn,lc as on,mc as an,na as De,nc as ln,oa as Vt,oc as cn,pc as un,rb as re,sa as nt,sb as it,ta as Ht,tb as Re,xa as q,xc as hn,ya as ie,yc as ke,zc as dn}from"./chunk-2W7IS4PN.js";function _s(s){let e=s,t=Math.floor(Math.abs(s)),n=s.toString().replace(/^[^.]*\.?/,"").length;return t===1&&n===0?1:5}var Pn=["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",_s];function Ss(s){let e=s,t=Math.floor(Math.abs(s)),n=s.toString().replace(/^[^.]*\.?/,"").length,i=parseInt(s.toString().replace(/^[^e]*(e([-+]?\d+))?/,"$2"))||0;return t===0||t===1?1:i===0&&t!==0&&t%1e6===0&&n===0||!(i>=0&&i<=5)?4:5}var Dn=["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",Ss];function Es(s,e){if(s&1&&(U(0,"i",3),re(1),Y()),s&2){let t=st().$implicit;q(),it(t.icon)}}function vs(s,e){if(s&1){let t=en();U(0,"ngb-toast",1),tn("hidden",function(){let i=Ut(t).$implicit,r=st();return Qt(r.toastService.remove(i))}),U(1,"div",2),xt(2,Es,2,1,"i",3),U(3,"span"),re(4),Y()()()}if(s&2){let t=e.$implicit;Wt(t.classname),Ne("header",t.header||"")("autohide",!0),q(2),Jt(t.icon?2:-1),q(2),it(t.message)}}var Cn=(()=>{class s{constructor(t){this.toastService=t}static{this.\u0275fac=function(n){return new(n||s)(ie(ge))}}static{this.\u0275cmp=J({type:s,selectors:[["bkd-toast"]],decls:3,vars:2,consts:[[3,"header","class","autohide"],[3,"hidden","header","autohide"],[1,"d-flex","gap-2"],[1,"material-icons"]],template:function(n,i){n&1&&(Ce(0,vs,5,6,"ngb-toast",0,Xt),fe(2,"async")),n&2&&Fe(pe(2,0,i.toastService.toasts$))},dependencies:[gn,sn],styles:["[_nghost-%COMP%]{position:fixed;top:0;right:0;margin:.5em;z-index:1200}[_nghost-%COMP%] > *[_ngcontent-%COMP%]{font-size:medium}"]})}}return s})();var Fn=new qt("Navigator API",{providedIn:"root",factory:()=>navigator});var Rn=(()=>{class s{constructor(t,n,i,r){this.toastService=n,this.settings=i,this.navigator=r,t.initialize(),this.checkSettings()}checkSettings(){_n(pn)(this.settings).pipe(jt(t=>(console.error(String(t)),this.toastService.error("Please check the contents of the settings.js file (see Console output for more details).","Invalid Settings"),Kt))).subscribe()}static{this.\u0275fac=function(n){return new(n||s)(ie(wn),ie(ge),ie(X),ie(Fn))}}static{this.\u0275cmp=J({type:s,selectors:[["bkd-app"]],decls:2,vars:0,consts:[["aria-live","polite","aria-atomic","true"]],template:function(n,i){n&1&&Zt(0,"bkd-toast",0)(1,"router-outlet")},dependencies:[Cn,hn],styles:["[_nghost-%COMP%]{width:100%}"],changeDetection:0})}}return s})();var _=function(s){return s[s.State=0]="State",s[s.Transition=1]="Transition",s[s.Sequence=2]="Sequence",s[s.Group=3]="Group",s[s.Animate=4]="Animate",s[s.Keyframes=5]="Keyframes",s[s.Style=6]="Style",s[s.Trigger=7]="Trigger",s[s.Reference=8]="Reference",s[s.AnimateChild=9]="AnimateChild",s[s.AnimateRef=10]="AnimateRef",s[s.Query=11]="Query",s[s.Stagger=12]="Stagger",s}(_||{}),Q="*";function kn(s,e=null){return{type:_.Sequence,steps:s,options:e}}function ot(s){return{type:_.Style,styles:s,offset:null}}var Z=class{_onDoneFns=[];_onStartFns=[];_onDestroyFns=[];_originalOnDoneFns=[];_originalOnStartFns=[];_started=!1;_destroyed=!1;_finished=!1;_position=0;parentPlayer=null;totalTime;constructor(e=0,t=0){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(n=>n()),t.length=0}},Se=class{_onDoneFns=[];_onStartFns=[];_finished=!1;_started=!1;_destroyed=!1;_onDestroyFns=[];parentPlayer=null;totalTime=0;players;constructor(e){this.players=e;let t=0,n=0,i=0,r=this.players.length;r==0?queueMicrotask(()=>this._onFinish()):this.players.forEach(o=>{o.onDone(()=>{++t==r&&this._onFinish()}),o.onDestroy(()=>{++n==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(n=>{let i=n.totalTime?Math.min(1,t/n.totalTime):1;n.setPosition(i)})}getPosition(){let e=this.players.reduce((t,n)=>t===null||n.totalTime>t.totalTime?n: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(n=>n()),t.length=0}},Ie="!";function On(s){return new v(3e3,!1)}function Ts(){return new v(3100,!1)}function bs(){return new v(3101,!1)}function ws(s){return new v(3001,!1)}function As(s){return new v(3003,!1)}function Ms(s){return new v(3004,!1)}function Ps(s,e){return new v(3005,!1)}function Ds(){return new v(3006,!1)}function Ns(){return new v(3007,!1)}function Cs(s,e){return new v(3008,!1)}function Fs(s){return new v(3002,!1)}function Rs(s,e,t,n,i){return new v(3010,!1)}function ks(){return new v(3011,!1)}function Os(){return new v(3012,!1)}function Is(){return new v(3200,!1)}function Ls(){return new v(3202,!1)}function $s(){return new v(3013,!1)}function zs(s){return new v(3014,!1)}function Bs(s){return new v(3015,!1)}function Ks(s){return new v(3016,!1)}function js(s,e){return new v(3404,!1)}function qs(s){return new v(3502,!1)}function Us(s){return new v(3503,!1)}function Qs(){return new v(3300,!1)}function Vs(s){return new v(3504,!1)}function Hs(s){return new v(3301,!1)}function Gs(s,e){return new v(3302,!1)}function xs(s){return new v(3303,!1)}function Ws(s,e){return new v(3400,!1)}function Js(s){return new v(3401,!1)}function Ys(s){return new v(3402,!1)}function Xs(s,e){return new v(3505,!1)}function ee(s){switch(s.length){case 0:return new Z;case 1:return s[0];default:return new Se(s)}}function xn(s,e,t=new Map,n=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 m=y,g=S;if(y!=="offset")switch(m=s.normalizePropertyName(m,i),g){case Ie:g=t.get(y);break;case Q:g=n.get(y);break;default:g=s.normalizeStyleValue(y,m,g,i);break}u.set(m,g)}),h||r.push(u),a=u,o=c}),i.length)throw qs(i);return r}function Dt(s,e,t,n){switch(e){case"start":s.onStart(()=>n(t&&at(t,"start",s)));break;case"done":s.onDone(()=>n(t&&at(t,"done",s)));break;case"destroy":s.onDestroy(()=>n(t&&at(t,"destroy",s)));break}}function at(s,e,t){let n=t.totalTime,i=!!t.disabled,r=Nt(s.element,s.triggerName,s.fromState,s.toState,e||s.phaseName,n??s.totalTime,i),o=s._data;return o!=null&&(r._data=o),r}function Nt(s,e,t,n,i="",r=0,o){return{element:s,triggerName:e,fromState:t,toState:n,phaseName:i,totalTime:r,disabled:!!o}}function O(s,e,t){let n=s.get(e);return n||s.set(e,n=t),n}function In(s){let e=s.indexOf(":"),t=s.substring(1,e),n=s.slice(e+1);return[t,n]}var Zs=typeof document>"u"?null:document.documentElement;function Ct(s){let e=s.parentNode||s.host||null;return e===Zs?null:e}function ei(s){return s.substring(1,6)=="ebkit"}var ae=null,Ln=!1;function ti(s){ae||(ae=ni()||{},Ln=ae.style?"WebkitAppearance"in ae.style:!1);let e=!0;return ae.style&&!ei(s)&&(e=s in ae.style,!e&&Ln&&(e="Webkit"+s.charAt(0).toUpperCase()+s.slice(1)in ae.style)),e}function ni(){return typeof document<"u"?document.body:null}function Wn(s,e){for(;e;){if(e===s)return!0;e=Ct(e)}return!1}function Jn(s,e,t){if(t)return Array.from(s.querySelectorAll(e));let n=s.querySelector(e);return n?[n]:[]}var Ft=(()=>{class s{validateStyleProperty(t){return ti(t)}containsElement(t,n){return Wn(t,n)}getParentElement(t){return Ct(t)}query(t,n,i){return Jn(t,n,i)}computeStyle(t,n,i){return i||""}animate(t,n,i,r,o,a=[],l){return new Z(i,r)}static \u0275fac=function(n){return new(n||s)};static \u0275prov=W({token:s,factory:s.\u0275fac})}return s})(),ue=class{static NOOP=new Ft},he=class{};var si=1e3,Yn="{{",ii="}}",Xn="ng-enter",mt="ng-leave",Le="ng-trigger",je=".ng-trigger",$n="ng-animating",ft=".ng-animating";function G(s){if(typeof s=="number")return s;let e=s.match(/^(-?[\.\d]+)(m?s)/);return!e||e.length<2?0:pt(parseFloat(e[1]),e[2])}function pt(s,e){switch(e){case"s":return s*si;default:return s}}function qe(s,e,t){return s.hasOwnProperty("duration")?s:ri(s,e,t)}function ri(s,e,t){let n=/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i,i,r=0,o="";if(typeof s=="string"){let a=s.match(n);if(a===null)return e.push(On(s)),{duration:0,delay:0,easing:""};i=pt(parseFloat(a[1]),a[2]);let l=a[3];l!=null&&(r=pt(parseFloat(l),a[4]));let c=a[5];c&&(o=c)}else i=s;if(!t){let a=!1,l=e.length;i<0&&(e.push(Ts()),a=!0),r<0&&(e.push(bs()),a=!0),a&&e.splice(l,0,On(s))}return{duration:i,delay:r,easing:o}}function oi(s){return s.length?s[0]instanceof Map?s:s.map(e=>new Map(Object.entries(e))):[]}function V(s,e,t){e.forEach((n,i)=>{let r=Rt(i);t&&!t.has(i)&&t.set(i,s.style[r]),s.style[r]=n})}function ce(s,e){e.forEach((t,n)=>{let i=Rt(n);s.style[i]=""})}function Ee(s){return Array.isArray(s)?s.length==1?s[0]:kn(s):s}function ai(s,e,t){let n=e.params||{},i=Zn(s);i.length&&i.forEach(r=>{n.hasOwnProperty(r)||t.push(ws(r))})}var gt=new RegExp(`${Yn}\\s*(.+?)\\s*${ii}`,"g");function Zn(s){let e=[];if(typeof s=="string"){let t;for(;t=gt.exec(s);)e.push(t[1]);gt.lastIndex=0}return e}function Te(s,e,t){let n=`${s}`,i=n.replace(gt,(r,o)=>{let a=e[o];return a==null&&(t.push(As(o)),a=""),a.toString()});return i==n?s:i}var li=/-+([a-z0-9])/g;function Rt(s){return s.replace(li,(...e)=>e[1].toUpperCase())}function ci(s,e){return s===0||e===0}function ui(s,e,t){if(t.size&&e.length){let n=e[0],i=[];if(t.forEach((r,o)=>{n.has(o)||i.push(o),n.set(o,r)}),i.length)for(let r=1;ro.set(a,kt(s,a)))}}return e}function k(s,e,t){switch(e.type){case _.Trigger:return s.visitTrigger(e,t);case _.State:return s.visitState(e,t);case _.Transition:return s.visitTransition(e,t);case _.Sequence:return s.visitSequence(e,t);case _.Group:return s.visitGroup(e,t);case _.Animate:return s.visitAnimate(e,t);case _.Keyframes:return s.visitKeyframes(e,t);case _.Style:return s.visitStyle(e,t);case _.Reference:return s.visitReference(e,t);case _.AnimateChild:return s.visitAnimateChild(e,t);case _.AnimateRef:return s.visitAnimateRef(e,t);case _.Query:return s.visitQuery(e,t);case _.Stagger:return s.visitStagger(e,t);default:throw Ms(e.type)}}function kt(s,e){return window.getComputedStyle(s)[e]}var hi=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"]),Ue=class extends he{normalizePropertyName(e,t){return Rt(e)}normalizeStyleValue(e,t,n,i){let r="",o=n.toString().trim();if(hi.has(t)&&n!==0&&n!=="0")if(typeof n=="number")r="px";else{let a=n.match(/^[+-]?[\d\.]+([a-z]*)$/);a&&a[1].length==0&&i.push(Ps(e,n))}return o+r}};var Qe="*";function di(s,e){let t=[];return typeof s=="string"?s.split(/\s*,\s*/).forEach(n=>mi(n,t,e)):t.push(s),t}function mi(s,e,t){if(s[0]==":"){let l=fi(s,t);if(typeof l=="function"){e.push(l);return}s=l}let n=s.match(/^(\*|[-\w]+)\s*()\s*(\*|[-\w]+)$/);if(n==null||n.length<4)return t.push(Bs(s)),e;let i=n[1],r=n[2],o=n[3];e.push(zn(i,o));let a=i==Qe&&o==Qe;r[0]=="<"&&!a&&e.push(zn(o,i))}function fi(s,e){switch(s){case":enter":return"void => *";case":leave":return"* => void";case":increment":return(t,n)=>parseFloat(n)>parseFloat(t);case":decrement":return(t,n)=>parseFloat(n) *"}}var $e=new Set(["true","1"]),ze=new Set(["false","0"]);function zn(s,e){let t=$e.has(s)||ze.has(s),n=$e.has(e)||ze.has(e);return(i,r)=>{let o=s==Qe||s==i,a=e==Qe||e==r;return!o&&t&&typeof i=="boolean"&&(o=i?$e.has(s):ze.has(s)),!a&&n&&typeof r=="boolean"&&(a=r?$e.has(e):ze.has(e)),o&&a}}var es=":self",pi=new RegExp(`s*${es}s*,?`,"g");function ts(s,e,t,n){return new yt(s).build(e,t,n)}var Bn="",yt=class{_driver;constructor(e){this._driver=e}build(e,t,n){let i=new _t(t);return this._resetContextStyleTimingState(i),k(this,Ee(e),i)}_resetContextStyleTimingState(e){e.currentQuerySelector=Bn,e.collectedStyles=new Map,e.collectedStyles.set(Bn,new Map),e.currentTime=0}visitTrigger(e,t){let n=t.queryCount=0,i=t.depCount=0,r=[],o=[];return e.name.charAt(0)=="@"&&t.errors.push(Ds()),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);n+=l.queryCount,i+=l.depCount,o.push(l)}else t.errors.push(Ns())}),{type:_.Trigger,name:e.name,states:r,transitions:o,queryCount:n,depCount:i,options:null}}visitState(e,t){let n=this.visitStyle(e.styles,t),i=e.options&&e.options.params||null;if(n.containsDynamicStyles){let r=new Set,o=i||{};n.styles.forEach(a=>{a instanceof Map&&a.forEach(l=>{Zn(l).forEach(c=>{o.hasOwnProperty(c)||r.add(c)})})}),r.size&&t.errors.push(Cs(e.name,[...r.values()]))}return{type:_.State,name:e.name,style:n,options:i?{params:i}:null}}visitTransition(e,t){t.queryCount=0,t.depCount=0;let n=k(this,Ee(e.animation),t),i=di(e.expr,t.errors);return{type:_.Transition,matchers:i,animation:n,queryCount:t.queryCount,depCount:t.depCount,options:le(e.options)}}visitSequence(e,t){return{type:_.Sequence,steps:e.steps.map(n=>k(this,n,t)),options:le(e.options)}}visitGroup(e,t){let n=t.currentTime,i=0,r=e.steps.map(o=>{t.currentTime=n;let a=k(this,o,t);return i=Math.max(i,t.currentTime),a});return t.currentTime=i,{type:_.Group,steps:r,options:le(e.options)}}visitAnimate(e,t){let n=Si(e.timings,t.errors);t.currentAnimateTimings=n;let i,r=e.styles?e.styles:ot({});if(r.type==_.Keyframes)i=this.visitKeyframes(r,t);else{let o=e.styles,a=!1;if(!o){a=!0;let c={};n.easing&&(c.easing=n.easing),o=ot(c)}t.currentTime+=n.duration+n.delay;let l=this.visitStyle(o,t);l.isEmptyStep=a,i=l}return t.currentAnimateTimings=null,{type:_.Animate,timings:n,style:i,options:null}}visitStyle(e,t){let n=this._makeStyleAst(e,t);return this._validateStyleAst(n,t),n}_makeStyleAst(e,t){let n=[],i=Array.isArray(e.styles)?e.styles:[e.styles];for(let a of i)typeof a=="string"?a===Q?n.push(a):t.errors.push(Fs(a)):n.push(new Map(Object.entries(a)));let r=!1,o=null;return n.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(Yn)>=0){r=!0;break}}}),{type:_.Style,styles:n,easing:o,offset:e.offset,containsDynamicStyles:r,options:null}}_validateStyleAst(e,t){let n=t.currentAnimateTimings,i=t.currentTime,r=t.currentTime;n&&r>0&&(r-=n.duration+n.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(Rs(l,h.startTime,h.endTime,r,i)),u=!1),r=h.startTime),u&&c.set(l,{startTime:r,endTime:i}),t.options&&ai(a,t.options,t.errors)})})}visitKeyframes(e,t){let n={type:_.Keyframes,styles:[],options:null};if(!t.currentAnimateTimings)return t.errors.push(ks()),n;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:_i(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=m+g.delay+P,g.duration=P,this._validateStyleAst(w,t),w.offset=N,n.styles.push(w)}),n}visitReference(e,t){return{type:_.Reference,animation:k(this,Ee(e.animation),t),options:le(e.options)}}visitAnimateChild(e,t){return t.depCount++,{type:_.AnimateChild,options:le(e.options)}}visitAnimateRef(e,t){return{type:_.AnimateRef,animation:this.visitReference(e.animation,t),options:le(e.options)}}visitQuery(e,t){let n=t.currentQuerySelector,i=e.options||{};t.queryCount++,t.currentQuery=e;let[r,o]=gi(e.selector);t.currentQuerySelector=n.length?n+" "+r:r,O(t.collectedStyles,t.currentQuerySelector,new Map);let a=k(this,Ee(e.animation),t);return t.currentQuery=null,t.currentQuerySelector=n,{type:_.Query,selector:r,limit:i.limit||0,optional:!!i.optional,includeSelf:o,animation:a,originalSelector:e.selector,options:le(e.options)}}visitStagger(e,t){t.currentQuery||t.errors.push($s());let n=e.timings==="full"?{duration:0,delay:0,easing:"full"}:qe(e.timings,t.errors,!0);return{type:_.Stagger,animation:k(this,Ee(e.animation),t),timings:n,options:null}}};function gi(s){let e=!!s.split(/\s*,\s*/).find(t=>t==es);return e&&(s=s.replace(pi,"")),s=s.replace(/@\*/g,je).replace(/@\w+/g,t=>je+"-"+t.slice(1)).replace(/:animating/g,ft),[s,e]}function yi(s){return s?Pe({},s):null}var _t=class{errors;queryCount=0;depCount=0;currentTransition=null;currentQuery=null;currentQuerySelector=null;currentAnimateTimings=null;currentTime=0;collectedStyles=new Map;options=null;unsupportedCSSPropertiesFound=new Set;constructor(e){this.errors=e}};function _i(s){if(typeof s=="string")return null;let e=null;if(Array.isArray(s))s.forEach(t=>{if(t instanceof Map&&t.has("offset")){let n=t;e=parseFloat(n.get("offset")),n.delete("offset")}});else if(s instanceof Map&&s.has("offset")){let t=s;e=parseFloat(t.get("offset")),t.delete("offset")}return e}function Si(s,e){if(s.hasOwnProperty("duration"))return s;if(typeof s=="number"){let r=qe(s,e).duration;return lt(r,0,"")}let t=s;if(t.split(/\s+/).some(r=>r.charAt(0)=="{"&&r.charAt(1)=="{")){let r=lt(0,0,"");return r.dynamic=!0,r.strValue=t,r}let i=qe(t,e);return lt(i.duration,i.delay,i.easing)}function le(s){return s?(s=Pe({},s),s.params&&(s.params=yi(s.params))):s={},s}function lt(s,e,t){return{duration:s,delay:e,easing:t}}function Ot(s,e,t,n,i,r,o=null,a=!1){return{type:1,element:s,keyframes:e,preStyleProps:t,postStyleProps:n,duration:i,delay:r,totalTime:i+r,easing:o,subTimeline:a}}var be=class{_map=new Map;get(e){return this._map.get(e)||[]}append(e,t){let n=this._map.get(e);n||this._map.set(e,n=[]),n.push(...t)}has(e){return this._map.has(e)}clear(){this._map.clear()}},Ei=1,vi=":enter",Ti=new RegExp(vi,"g"),bi=":leave",wi=new RegExp(bi,"g");function ns(s,e,t,n,i,r=new Map,o=new Map,a,l,c=[]){return new St().buildKeyframes(s,e,t,n,i,r,o,a,l,c)}var St=class{buildKeyframes(e,t,n,i,r,o,a,l,c,h=[]){c=c||new be;let u=new Et(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,n,u);let y=u.timelines.filter(m=>m.containsAnimation());if(y.length&&a.size){let m;for(let g=y.length-1;g>=0;g--){let T=y[g];if(T.element===t){m=T;break}}m&&!m.allowOnlyTimelineStyles()&&m.setStyles([a],null,u.errors,l)}return y.length?y.map(m=>m.buildKeyframes()):[Ot(t,[],[],[],0,S,"",!1)]}visitTrigger(e,t){}visitState(e,t){}visitTransition(e,t){}visitAnimateChild(e,t){let n=t.subInstructions.get(t.element);if(n){let i=t.createSubContext(e.options),r=t.currentTimeline.currentTime,o=this._visitSubInstructions(n,i,i.options);r!=o&&t.transformIntoNewTimeline(o)}t.previousNode=e}visitAnimateRef(e,t){let n=t.createSubContext(e.options);n.transformIntoNewTimeline(),this._applyAnimationRefDelays([e.options,e.animation.options],t,n),this.visitReference(e.animation,n),t.transformIntoNewTimeline(n.currentTimeline.currentTime),t.previousNode=e}_applyAnimationRefDelays(e,t,n){for(let i of e){let r=i?.delay;if(r){let o=typeof r=="number"?r:G(Te(r,i?.params??{},t.errors));n.delayNextStep(o)}}}_visitSubInstructions(e,t,n){let r=t.currentTimeline.currentTime,o=n.duration!=null?G(n.duration):null,a=n.delay!=null?G(n.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 n=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=Ve);let o=G(r.delay);i.delayNextStep(o)}e.steps.length&&(e.steps.forEach(o=>k(this,o,i)),i.currentTimeline.applyStylesToKeyframe(),i.subContextCount>n&&i.transformIntoNewTimeline()),t.previousNode=e}visitGroup(e,t){let n=[],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),n.push(a.currentTimeline)}),n.forEach(o=>t.currentTimeline.mergeTimelineCollectedStyles(o)),t.transformIntoNewTimeline(i),t.previousNode=e}_visitTiming(e,t){if(e.dynamic){let n=e.strValue,i=t.params?Te(n,t.params,t.errors):n;return qe(i,t.errors)}else return{duration:e.duration,delay:e.delay,easing:e.easing}}visitAnimate(e,t){let n=t.currentAnimateTimings=this._visitTiming(e.timings,t),i=t.currentTimeline;n.delay&&(t.incrementTime(n.delay),i.snapshotCurrentStyles());let r=e.style;r.type==_.Keyframes?this.visitKeyframes(r,t):(t.incrementTime(n.duration),this.visitStyle(r,t),i.applyStylesToKeyframe()),t.currentAnimateTimings=null,t.previousNode=e}visitStyle(e,t){let n=t.currentTimeline,i=t.currentAnimateTimings;!i&&n.hasCurrentStyleProperties()&&n.forwardFrame();let r=i&&i.easing||e.easing;e.isEmptyStep?n.applyEmptyStep(r):n.setStyles(e.styles,r,t.errors,t.options),t.previousNode=e}visitKeyframes(e,t){let n=t.currentAnimateTimings,i=t.currentTimeline.duration,r=n.duration,a=t.createSubContext().currentTimeline;a.easing=n.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 n=t.currentTimeline.currentTime,i=e.options||{},r=i.delay?G(i.delay):0;r&&(t.previousNode.type===_.Style||n==0&&t.currentTimeline.hasCurrentStyleProperties())&&(t.currentTimeline.snapshotCurrentStyles(),t.previousNode=Ve);let o=n,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 n=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=n.currentStaggerTime;break}let h=t.currentTimeline;l&&h.delayNextStep(l);let u=h.currentTime;k(this,e.animation,t),t.previousNode=e,n.currentStaggerTime=i.currentTime-u+(i.startTime-n.currentTimeline.startTime)}},Ve={},Et=class s{_driver;element;subInstructions;_enterClassName;_leaveClassName;errors;timelines;parentContext=null;currentTimeline;currentAnimateTimings=null;previousNode=Ve;subContextCount=0;options={};currentQueryIndex=0;currentQueryTotal=0;currentStaggerTime=0;constructor(e,t,n,i,r,o,a,l){this._driver=e,this.element=t,this.subInstructions=n,this._enterClassName=i,this._leaveClassName=r,this.errors=o,this.timelines=a,this.currentTimeline=l||new He(this._driver,t,0),a.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(e,t){if(!e)return;let n=e,i=this.options;n.duration!=null&&(i.duration=G(n.duration)),n.delay!=null&&(i.delay=G(n.delay));let r=n.params;if(r){let o=i.params;o||(o=this.options.params={}),Object.keys(r).forEach(a=>{(!t||!o.hasOwnProperty(a))&&(o[a]=Te(r[a],o,this.errors))})}}_copyOptions(){let e={};if(this.options){let t=this.options.params;if(t){let n=e.params={};Object.keys(t).forEach(i=>{n[i]=t[i]})}}return e}createSubContext(e=null,t,n){let i=t||this.element,r=new s(this._driver,i,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(i,n||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=Ve,this.currentTimeline=this.currentTimeline.fork(this.element,e),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(e,t,n){let i={duration:t??e.duration,delay:this.currentTimeline.currentTime+(n??0)+e.delay,easing:""},r=new vt(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,n,i,r,o){let a=[];if(i&&a.push(this.element),e.length>0){e=e.replace(Ti,"."+this._enterClassName),e=e.replace(wi,"."+this._leaveClassName);let l=n!=1,c=this._driver.query(this.element,e,l);n!==0&&(c=n<0?c.slice(c.length+n,c.length):c.slice(0,n)),a.push(...c)}return!r&&a.length==0&&o.push(zs(t)),a}},He=class s{_driver;element;startTime;_elementTimelineStylesLookup;duration=0;easing=null;_previousKeyframe=new Map;_currentKeyframe=new Map;_keyframes=new Map;_styleSummary=new Map;_localTimelineStyles=new Map;_globalTimelineStyles;_pendingStyles=new Map;_backFill=new Map;_currentEmptyStepKeyframe=null;constructor(e,t,n,i){this._driver=e,this.element=t,this.startTime=n,this._elementTimelineStylesLookup=i,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 s(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+=Ei,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,n]of this._globalTimelineStyles)this._backFill.set(t,n||Q),this._currentKeyframe.set(t,Q);this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(e,t,n,i){t&&this._previousKeyframe.set("easing",t);let r=i&&i.params||{},o=Ai(e,this._globalTimelineStyles);for(let[a,l]of o){let c=Te(l,r,n);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,n)=>{let i=this._styleSummary.get(n);(!i||t.time>i.time)&&this._updateStyle(n,t.value)})}buildKeyframes(){this.applyStylesToKeyframe();let e=new Set,t=new Set,n=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===Ie?e.add(u):h===Q&&t.add(u)}),n||c.set("offset",l/this.duration),i.push(c)});let r=[...e.values()],o=[...t.values()];if(n){let a=i[0],l=new Map(a);a.set("offset",0),l.set("offset",1),i=[a,l]}return Ot(this.element,i,r,o,this.duration,this.startTime,this.easing,!1)}},vt=class extends He{keyframes;preStyleProps;postStyleProps;_stretchStartingKeyframe;timings;constructor(e,t,n,i,r,o,a=!1){super(e,t,o.delay),this.keyframes=n,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:n,easing:i}=this.timings;if(this._stretchStartingKeyframe&&t){let r=[],o=n+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",Kn(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"),m=t+y*n;S.set("offset",Kn(m/o)),r.push(S)}n=o,t=0,i="",e=r}return Ot(this.element,e,this.preStyleProps,this.postStyleProps,n,t,i,!0)}};function Kn(s,e=3){let t=Math.pow(10,e-1);return Math.round(s*t)/t}function Ai(s,e){let t=new Map,n;return s.forEach(i=>{if(i==="*"){n??=e.keys();for(let r of n)t.set(r,Q)}else for(let[r,o]of i)t.set(r,o)}),t}function jn(s,e,t,n,i,r,o,a,l,c,h,u,S){return{type:0,element:s,triggerName:e,isRemovalTransition:i,fromState:t,fromStyles:r,toState:n,toStyles:o,timelines:a,queriedElements:l,preStyleProps:c,postStyleProps:h,totalTime:u,errors:S}}var ct={},Ge=class{_triggerName;ast;_stateStyles;constructor(e,t,n){this._triggerName=e,this.ast=t,this._stateStyles=n}match(e,t,n,i){return Mi(this.ast.matchers,e,t,n,i)}buildStyles(e,t,n){let i=this._stateStyles.get("*");return e!==void 0&&(i=this._stateStyles.get(e?.toString())||i),i?i.buildStyles(t,n):new Map}build(e,t,n,i,r,o,a,l,c,h){let u=[],S=this.ast.options&&this.ast.options.params||ct,y=a&&a.params||ct,m=this.buildStyles(n,y,u),g=l&&l.params||ct,T=this.buildStyles(i,g,u),w=new Set,A=new Map,N=new Map,P=i==="void",de={params:ss(g,S),delay:this.ast.options?.delay},B=h?[]:ns(e,t,this.ast.animation,r,o,m,T,de,c,u),C=0;return B.forEach(F=>{C=Math.max(F.duration+F.delay,C)}),u.length?jn(t,this._triggerName,n,i,P,m,T,[],[],A,N,C,u):(B.forEach(F=>{let te=F.element,me=O(A,te,new Set);F.preStyleProps.forEach(ne=>me.add(ne));let It=O(N,te,new Set);F.postStyleProps.forEach(ne=>It.add(ne)),te!==t&&w.add(te)}),jn(t,this._triggerName,n,i,P,m,T,B,[...w.values()],A,N,C))}};function Mi(s,e,t,n,i){return s.some(r=>r(e,t,n,i))}function ss(s,e){let t=Pe({},e);return Object.entries(s).forEach(([n,i])=>{i!=null&&(t[n]=i)}),t}var Tt=class{styles;defaultParams;normalizer;constructor(e,t,n){this.styles=e,this.defaultParams=t,this.normalizer=n}buildStyles(e,t){let n=new Map,i=ss(e,this.defaultParams);return this.styles.styles.forEach(r=>{typeof r!="string"&&r.forEach((o,a)=>{o&&(o=Te(o,i,t));let l=this.normalizer.normalizePropertyName(a,t);o=this.normalizer.normalizeStyleValue(a,l,o,t),n.set(a,o)})}),n}};function Pi(s,e,t){return new bt(s,e,t)}var bt=class{name;ast;_normalizer;transitionFactories=[];fallbackTransition;states=new Map;constructor(e,t,n){this.name=e,this.ast=t,this._normalizer=n,t.states.forEach(i=>{let r=i.options&&i.options.params||{};this.states.set(i.name,new Tt(i.style,r,n))}),qn(this.states,"true","1"),qn(this.states,"false","0"),t.transitions.forEach(i=>{this.transitionFactories.push(new Ge(e,i,this.states))}),this.fallbackTransition=Di(e,this.states,this._normalizer)}get containsQueries(){return this.ast.queryCount>0}matchTransition(e,t,n,i){return this.transitionFactories.find(o=>o.match(e,t,n,i))||null}matchStyles(e,t,n){return this.fallbackTransition.buildStyles(e,t,n)}};function Di(s,e,t){let n=[(o,a)=>!0],i={type:_.Sequence,steps:[],options:null},r={type:_.Transition,animation:i,matchers:n,options:null,queryCount:0,depCount:0};return new Ge(s,r,e)}function qn(s,e,t){s.has(e)?s.has(t)||s.set(t,s.get(e)):s.has(t)&&s.set(e,s.get(t))}var Ni=new be,wt=class{bodyNode;_driver;_normalizer;_animations=new Map;_playersById=new Map;players=[];constructor(e,t,n){this.bodyNode=e,this._driver=t,this._normalizer=n}register(e,t){let n=[],i=[],r=ts(this._driver,t,n,i);if(n.length)throw Us(n);i.length&&void 0,this._animations.set(e,r)}_buildPlayer(e,t,n){let i=e.element,r=xn(this._normalizer,e.keyframes,t,n);return this._driver.animate(i,r,e.duration,e.delay,e.easing,[],!0)}create(e,t,n={}){let i=[],r=this._animations.get(e),o,a=new Map;if(r?(o=ns(this._driver,t,r,Xn,mt,new Map,new Map,n,Ni,i),o.forEach(h=>{let u=O(a,h.element,new Map);h.postStyleProps.forEach(S=>u.set(S,null))})):(i.push(Qs()),o=[]),i.length)throw Vs(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=ee(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 n=this.players.indexOf(t);n>=0&&this.players.splice(n,1)}_getPlayer(e){let t=this._playersById.get(e);if(!t)throw Hs(e);return t}listen(e,t,n,i){let r=Nt(t,"","","");return Dt(this._getPlayer(e),n,r,i),()=>{}}command(e,t,n,i){if(n=="register"){this.register(e,i[0]);return}if(n=="create"){let o=i[0]||{};this.create(e,t,o);return}let r=this._getPlayer(e);switch(n){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}}},Un="ng-animate-queued",Ci=".ng-animate-queued",ut="ng-animate-disabled",Fi=".ng-animate-disabled",Ri="ng-star-inserted",ki=".ng-star-inserted",Oi=[],is={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},Ii={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},$="__ng_removed",we=class{namespaceId;value;options;get params(){return this.options.params}constructor(e,t=""){this.namespaceId=t;let n=e&&e.hasOwnProperty("value"),i=n?e.value:e;if(this.value=$i(i),n){let r=e,{value:o}=r,a=Bt(r,["value"]);this.options=a}else this.options={};this.options.params||(this.options.params={})}absorbOptions(e){let t=e.params;if(t){let n=this.options.params;Object.keys(t).forEach(i=>{n[i]==null&&(n[i]=t[i])})}}},ve="void",ht=new we(ve),At=class{id;hostElement;_engine;players=[];_triggers=new Map;_queue=[];_elementListeners=new Map;_hostClassName;constructor(e,t,n){this.id=e,this.hostElement=t,this._engine=n,this._hostClassName="ng-tns-"+e,L(t,this._hostClassName)}listen(e,t,n,i){if(!this._triggers.has(t))throw Gs(n,t);if(n==null||n.length==0)throw xs(t);if(!zi(n))throw Ws(n,t);let r=O(this._elementListeners,e,[]),o={name:t,phase:n,callback:i};r.push(o);let a=O(this._engine.statesByElement,e,new Map);return a.has(t)||(L(e,Le),L(e,Le+"-"+t),a.set(t,ht)),()=>{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 Js(e);return t}trigger(e,t,n,i=!0){let r=this._getTrigger(t),o=new Ae(this.id,t,e),a=this._engine.statesByElement.get(e);a||(L(e,Le),L(e,Le+"-"+t),this._engine.statesByElement.set(e,a=new Map));let l=a.get(t),c=new we(n,this.id);if(!(n&&n.hasOwnProperty("value"))&&l&&c.absorbOptions(l.options),a.set(t,c),l||(l=ht),!(c.value===ve)&&l.value===c.value){if(!ji(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(()=>{ce(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),m=!1;if(!y){if(!i)return;y=r.fallbackTransition,m=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:t,transition:y,fromState:l,toState:c,player:o,isFallbackTransition:m}),m||(L(e,Un),o.onStart(()=>{ye(e,Un)})),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,n)=>{this._elementListeners.set(n,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(n=>n.destroy()),this._engine.playersByElement.delete(e))}_signalRemovalForInnerTriggers(e,t){let n=this._engine.driver.query(e,je,!0);n.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(()=>n.forEach(i=>this.clearElementCache(i)))}triggerLeaveAnimation(e,t,n,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,ve,i);h&&a.push(h)}}),a.length)return this._engine.markElementAsRemoved(this.id,e,!0,t,o),n&&ee(a).onDone(()=>this._engine.processLeaveNode(e)),!0}return!1}prepareLeaveAnimationListeners(e){let t=this._elementListeners.get(e),n=this._engine.statesByElement.get(e);if(t&&n){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=n.get(o)||ht,h=new we(ve),u=new Ae(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 n=this._engine;if(e.childElementCount&&this._signalRemovalForInnerTriggers(e,t),this.triggerLeaveAnimation(e,t,!0))return;let i=!1;if(n.totalAnimations){let r=n.players.length?n.playersByQueriedElement.get(e):[];if(r&&r.length)i=!0;else{let o=e;for(;o=o.parentNode;)if(n.statesByElement.get(o)){i=!0;break}}}if(this.prepareLeaveAnimationListeners(e),i)n.markElementAsRemoved(this.id,e,!1,t);else{let r=e[$];(!r||r===is)&&(n.afterFlush(()=>this.clearElementCache(e)),n.destroyInnerAnimations(e),n._onRemovalComplete(e,t))}}insertNode(e,t){L(e,this._hostClassName)}drainQueuedTransitions(e){let t=[];return this._queue.forEach(n=>{let i=n.player;if(i.destroyed)return;let r=n.element,o=this._elementListeners.get(r);o&&o.forEach(a=>{if(a.name==n.triggerName){let l=Nt(r,n.triggerName,n.fromState.value,n.toState.value);l._data=e,Dt(n.player,a.phase,l,a.callback)}}),i.markedForDestroy?this._engine.afterFlush(()=>{i.destroy()}):t.push(n)}),this._queue=[],t.sort((n,i)=>{let r=n.transition.ast.depCount,o=i.transition.ast.depCount;return r==0||o==0?r-o:this._engine.driver.containsElement(n.element,i.element)?1:-1})}destroy(e){this.players.forEach(t=>t.destroy()),this._signalRemovalForInnerTriggers(this.hostElement,e)}},Mt=class{bodyNode;driver;_normalizer;players=[];newHostElements=new Map;playersByElement=new Map;playersByQueriedElement=new Map;statesByElement=new Map;disabledNodes=new Set;totalAnimations=0;totalQueuedPlayers=0;_namespaceLookup={};_namespaceList=[];_flushFns=[];_whenQuietFns=[];namespacesByHostElement=new Map;collectedEnterElements=[];collectedLeaveElements=[];onRemovalComplete=(e,t)=>{};_onRemovalComplete(e,t){this.onRemovalComplete(e,t)}constructor(e,t,n){this.bodyNode=e,this.driver=t,this._normalizer=n}get queuedPlayers(){let e=[];return this._namespaceList.forEach(t=>{t.players.forEach(n=>{n.queued&&e.push(n)})}),e}createNamespace(e,t){let n=new At(e,t,this);return this.bodyNode&&this.driver.containsElement(this.bodyNode,t)?this._balanceNamespaceList(n,t):(this.newHostElements.set(t,n),this.collectEnterElement(t)),this._namespaceLookup[e]=n}_balanceNamespaceList(e,t){let n=this._namespaceList,i=this.namespacesByHostElement;if(n.length-1>=0){let o=!1,a=this.driver.getParentElement(t);for(;a;){let l=i.get(a);if(l){let c=n.indexOf(l);n.splice(c+1,0,e),o=!0;break}a=this.driver.getParentElement(a)}o||n.unshift(e)}else n.push(e);return i.set(t,e),e}register(e,t){let n=this._namespaceLookup[e];return n||(n=this.createNamespace(e,t)),n}registerTrigger(e,t,n){let i=this._namespaceLookup[e];i&&i.register(t,n)&&this.totalAnimations++}destroy(e,t){e&&(this.afterFlush(()=>{}),this.afterFlushAnimationsDone(()=>{let n=this._fetchNamespace(e);this.namespacesByHostElement.delete(n.hostElement);let i=this._namespaceList.indexOf(n);i>=0&&this._namespaceList.splice(i,1),n.destroy(t),delete this._namespaceLookup[e]}))}_fetchNamespace(e){return this._namespaceLookup[e]}fetchNamespacesByElement(e){let t=new Set,n=this.statesByElement.get(e);if(n){for(let i of n.values())if(i.namespaceId){let r=this._fetchNamespace(i.namespaceId);r&&t.add(r)}}return t}trigger(e,t,n,i){if(Be(t)){let r=this._fetchNamespace(e);if(r)return r.trigger(t,n,i),!0}return!1}insertNode(e,t,n,i){if(!Be(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,n)}i&&this.collectEnterElement(t)}collectEnterElement(e){this.collectedEnterElements.push(e)}markElementAsDisabled(e,t){t?this.disabledNodes.has(e)||(this.disabledNodes.add(e),L(e,ut)):this.disabledNodes.has(e)&&(this.disabledNodes.delete(e),ye(e,ut))}removeNode(e,t,n){if(Be(t)){let i=e?this._fetchNamespace(e):null;i?i.removeNode(t,n):this.markElementAsRemoved(e,t,!1,n);let r=this.namespacesByHostElement.get(t);r&&r.id!==e&&r.removeNode(t,n)}else this._onRemovalComplete(t,n)}markElementAsRemoved(e,t,n,i,r){this.collectedLeaveElements.push(t),t[$]={namespaceId:e,setForRemoval:i,hasAnimation:n,removedBeforeQueried:!1,previousTriggersValues:r}}listen(e,t,n,i,r){return Be(t)?this._fetchNamespace(e).listen(t,n,i,r):()=>{}}_buildInstruction(e,t,n,i,r){return e.transition.build(this.driver,e.element,e.fromState.value,e.toState.value,n,i,e.fromState.options,e.toState.options,t,r)}destroyInnerAnimations(e){let t=this.driver.query(e,je,!0);t.forEach(n=>this.destroyActiveAnimationsForElement(n)),this.playersByQueriedElement.size!=0&&(t=this.driver.query(e,ft,!0),t.forEach(n=>this.finishActiveQueriedAnimationOnElement(n)))}destroyActiveAnimationsForElement(e){let t=this.playersByElement.get(e);t&&t.forEach(n=>{n.queued?n.markedForDestroy=!0:n.destroy()})}finishActiveQueriedAnimationOnElement(e){let t=this.playersByQueriedElement.get(e);t&&t.forEach(n=>n.finish())}whenRenderingDone(){return new Promise(e=>{if(this.players.length)return ee(this.players).onDone(()=>e());e()})}processLeaveNode(e){let t=e[$];if(t&&t.setForRemoval){if(e[$]=is,t.namespaceId){this.destroyInnerAnimations(e);let n=this._fetchNamespace(t.namespaceId);n&&n.clearElementCache(e)}this._onRemovalComplete(e,t.setForRemoval)}e.classList?.contains(ut)&&this.markElementAsDisabled(e,!1),this.driver.query(e,Fi,!0).forEach(n=>{this.markElementAsDisabled(n,!1)})}flush(e=-1){let t=[];if(this.newHostElements.size&&(this.newHostElements.forEach((n,i)=>this._balanceNamespaceList(n,i)),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(let n=0;nn()),this._flushFns=[],this._whenQuietFns.length){let n=this._whenQuietFns;this._whenQuietFns=[],t.length?ee(t).onDone(()=>{n.forEach(i=>i())}):n.forEach(i=>i())}}reportError(e){throw Ys(e)}_flushAnimations(e,t){let n=new be,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 f=this.driver.query(d,Ci,!0);for(let p=0;p{let p=Xn+g++;m.set(f,p),d.forEach(E=>L(E,p))});let T=[],w=new Set,A=new Set;for(let d=0;dw.add(E)):A.add(f))}let N=new Map,P=Hn(S,Array.from(w));P.forEach((d,f)=>{let p=mt+g++;N.set(f,p),d.forEach(E=>L(E,p))}),e.push(()=>{y.forEach((d,f)=>{let p=m.get(f);d.forEach(E=>ye(E,p))}),P.forEach((d,f)=>{let p=N.get(f);d.forEach(E=>ye(E,p))}),T.forEach(d=>{this.processLeaveNode(d)})});let de=[],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(de.push(E),this.collectedEnterElements.length){let D=M[$];if(D&&D.setForMove){if(D.previousTriggersValues&&D.previousTriggersValues.has(p.triggerName)){let se=D.previousTriggersValues.get(p.triggerName),I=this.statesByElement.get(p.element);if(I&&I.has(p.triggerName)){let Me=I.get(p.triggerName);Me.value=se,I.set(p.triggerName,Me)}}E.destroy();return}}let K=!u||!this.driver.containsElement(u,M),R=N.get(M),x=m.get(M),b=this._buildInstruction(p,n,x,R,K);if(b.errors&&b.errors.length){B.push(b);return}if(K){E.onStart(()=>ce(M,b.fromStyles)),E.onDestroy(()=>V(M,b.toStyles)),i.push(E);return}if(p.isFallbackTransition){E.onStart(()=>ce(M,b.fromStyles)),E.onDestroy(()=>V(M,b.toStyles)),i.push(E);return}let zt=[];b.timelines.forEach(D=>{D.stretchStartingKeyframe=!0,this.disabledNodes.has(D.element)||zt.push(D)}),b.timelines=zt,n.append(M,b.timelines);let ys={instruction:b,player:E,element:M};o.push(ys),b.queriedElements.forEach(D=>O(a,D,[]).push(E)),b.preStyleProps.forEach((D,se)=>{if(D.size){let I=l.get(se);I||l.set(se,I=new Set),D.forEach((Me,tt)=>I.add(tt))}}),b.postStyleProps.forEach((D,se)=>{let I=c.get(se);I||c.set(se,I=new Set),D.forEach((Me,tt)=>I.add(tt))})});if(B.length){let d=[];B.forEach(f=>{d.push(Xs(f.triggerName,f.errors))}),de.forEach(f=>f.destroy()),this.reportError(d)}let C=new Map,F=new Map;o.forEach(d=>{let f=d.element;n.has(f)&&(F.set(f,f),this._beforeAnimationBuild(d.player.namespaceId,d.instruction,C))}),i.forEach(d=>{let f=d.element;this._getPreviousPlayers(f,!1,d.namespaceId,d.triggerName,null).forEach(E=>{O(C,f,[]).push(E),E.destroy()})});let te=T.filter(d=>Gn(d,l,c)),me=new Map;Vn(me,this.driver,A,c,Q).forEach(d=>{Gn(d,l,c)&&te.push(d)});let ne=new Map;y.forEach((d,f)=>{Vn(ne,this.driver,new Set(d),l,Ie)}),te.forEach(d=>{let f=me.get(d),p=ne.get(d);me.set(d,new Map([...f?.entries()??[],...p?.entries()??[]]))});let et=[],Lt=[],$t={};o.forEach(d=>{let{element:f,player:p,instruction:E}=d;if(n.has(f)){if(h.has(f)){p.onDestroy(()=>V(f,E.toStyles)),p.disabled=!0,p.overrideTotalTime(E.totalTime),i.push(p);return}let M=$t;if(F.size>1){let R=f,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,ne,me);if(p.setRealPlayer(K),M===$t)et.push(p);else{let R=this.playersByElement.get(M);R&&R.length&&(p.parentPlayer=ee(R)),i.push(p)}}else ce(f,E.fromStyles),p.onDestroy(()=>V(f,E.toStyles)),Lt.push(p),h.has(f)&&i.push(p)}),Lt.forEach(d=>{let f=r.get(d.element);if(f&&f.length){let p=ee(f);d.setRealPlayer(p)}}),i.forEach(d=>{d.parentPlayer?d.syncPlayerEvents(d.parentPlayer):d.destroy()});for(let d=0;d!K.destroyed);M.length?Bi(this,f,M):this.processLeaveNode(f)}return T.length=0,et.forEach(d=>{this.players.push(d),d.onDone(()=>{d.destroy();let f=this.players.indexOf(d);this.players.splice(f,1)}),d.play()}),et}afterFlush(e){this._flushFns.push(e)}afterFlushAnimationsDone(e){this._whenQuietFns.push(e)}_getPreviousPlayers(e,t,n,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==ve;a.forEach(c=>{c.queued||!l&&c.triggerName!=i||o.push(c)})}}return(n||i)&&(o=o.filter(a=>!(n&&n!=a.namespaceId||i&&i!=a.triggerName))),o}_beforeAnimationBuild(e,t,n){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(n,c,[]);this._getPreviousPlayers(c,h,o,a,t.toState).forEach(y=>{let m=y.getRealPlayer();m.beforeDestroy&&m.beforeDestroy(),y.destroy(),u.push(y)})}ce(r,t.fromStyles)}_buildAnimation(e,t,n,i,r,o){let a=t.triggerName,l=t.element,c=[],h=new Set,u=new Set,S=t.timelines.map(m=>{let g=m.element;h.add(g);let T=g[$];if(T&&T.removedBeforeQueried)return new Z(m.duration,m.delay);let w=g!==l,A=Ki((n.get(g)||Oi).map(C=>C.getRealPlayer())).filter(C=>{let F=C;return F.element?F.element===g:!1}),N=r.get(g),P=o.get(g),de=xn(this._normalizer,m.keyframes,N,P),B=this._buildPlayer(m,de,A);if(m.subTimeline&&i&&u.add(g),w){let C=new Ae(e,a,g);C.setRealPlayer(B),c.push(C)}return B});c.forEach(m=>{O(this.playersByQueriedElement,m.element,[]).push(m),m.onDone(()=>Li(this.playersByQueriedElement,m.element,m))}),h.forEach(m=>L(m,$n));let y=ee(S);return y.onDestroy(()=>{h.forEach(m=>ye(m,$n)),V(l,t.toStyles)}),u.forEach(m=>{O(i,m,[]).push(y)}),y}_buildPlayer(e,t,n){return t.length>0?this.driver.animate(e.element,t,e.duration,e.delay,e.easing,n):new Z(e.duration,e.delay)}},Ae=class{namespaceId;triggerName;element;_player=new Z;_containsRealPlayer=!1;_queuedCallbacks=new Map;destroyed=!1;parentPlayer=null;markedForDestroy=!1;disabled=!1;queued=!0;totalTime=0;constructor(e,t,n){this.namespaceId=e,this.triggerName=t,this.element=n}setRealPlayer(e){this._containsRealPlayer||(this._player=e,this._queuedCallbacks.forEach((t,n)=>{t.forEach(i=>Dt(e,n,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 Li(s,e,t){let n=s.get(e);if(n){if(n.length){let i=n.indexOf(t);n.splice(i,1)}n.length==0&&s.delete(e)}return n}function $i(s){return s??null}function Be(s){return s&&s.nodeType===1}function zi(s){return s=="start"||s=="done"}function Qn(s,e){let t=s.style.display;return s.style.display=e??"none",t}function Vn(s,e,t,n,i){let r=[];t.forEach(l=>r.push(Qn(l)));let o=[];n.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[$]=Ii,o.push(c))}),s.set(c,h)});let a=0;return t.forEach(l=>Qn(l,r[a++])),o}function Hn(s,e){let t=new Map;if(s.forEach(a=>t.set(a,[])),e.length==0)return t;let n=1,i=new Set(e),r=new Map;function o(a){if(!a)return n;let l=r.get(a);if(l)return l;let c=a.parentNode;return t.has(c)?l=c:i.has(c)?l=n:l=o(c),r.set(a,l),l}return e.forEach(a=>{let l=o(a);l!==n&&t.get(l).push(a)}),t}function L(s,e){s.classList?.add(e)}function ye(s,e){s.classList?.remove(e)}function Bi(s,e,t){ee(t).onDone(()=>s.processLeaveNode(e))}function Ki(s){let e=[];return rs(s,e),e}function rs(s,e){for(let t=0;ti.add(r)):e.set(s,n),t.delete(s),!0}var _e=class{_driver;_normalizer;_transitionEngine;_timelineEngine;_triggerCache={};onRemovalComplete=(e,t)=>{};constructor(e,t,n){this._driver=t,this._normalizer=n,this._transitionEngine=new Mt(e.body,t,n),this._timelineEngine=new wt(e.body,t,n),this._transitionEngine.onRemovalComplete=(i,r)=>this.onRemovalComplete(i,r)}registerTrigger(e,t,n,i,r){let o=e+"-"+i,a=this._triggerCache[o];if(!a){let l=[],c=[],h=ts(this._driver,r,l,c);if(l.length)throw js(i,l);c.length&&void 0,a=Pi(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,n,i){this._transitionEngine.insertNode(e,t,n,i)}onRemove(e,t,n){this._transitionEngine.removeNode(e,t,n)}disableAnimations(e,t){this._transitionEngine.markElementAsDisabled(e,t)}process(e,t,n,i){if(n.charAt(0)=="@"){let[r,o]=In(n),a=i;this._timelineEngine.command(r,t,o,a)}else this._transitionEngine.trigger(e,t,n,i)}listen(e,t,n,i,r){if(n.charAt(0)=="@"){let[o,a]=In(n);return this._timelineEngine.listen(o,t,a,r)}return this._transitionEngine.listen(e,t,n,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 qi(s,e){let t=null,n=null;return Array.isArray(e)&&e.length?(t=dt(e[0]),e.length>1&&(n=dt(e[e.length-1]))):e instanceof Map&&(t=dt(e)),t||n?new Ui(s,t,n):null}var Ui=(()=>{class s{_element;_startStyles;_endStyles;static initialStylesByElement=new WeakMap;_state=0;_initialStyles;constructor(t,n,i){this._element=t,this._startStyles=n,this._endStyles=i;let r=s.initialStylesByElement.get(t);r||s.initialStylesByElement.set(t,r=new Map),this._initialStyles=r}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&&(s.initialStylesByElement.delete(this._element),this._startStyles&&(ce(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(ce(this._element,this._endStyles),this._endStyles=null),V(this._element,this._initialStyles),this._state=3)}}return s})();function dt(s){let e=null;return s.forEach((t,n)=>{Qi(n)&&(e=e||new Map,e.set(n,t))}),e}function Qi(s){return s==="display"||s==="position"}var xe=class{element;keyframes;options;_specialStyles;_onDoneFns=[];_onStartFns=[];_onDestroyFns=[];_duration;_delay;_initialized=!1;_finished=!1;_started=!1;_destroyed=!1;_finalKeyframe;_originalOnDoneFns=[];_originalOnStartFns=[];domPlayer;time=0;parentPlayer=null;currentSnapshot=new Map;constructor(e,t,n,i){this.element=e,this.keyframes=t,this.options=n,this._specialStyles=i,this._duration=n.duration,this._delay=n.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(n=>{t.push(Object.fromEntries(n))}),t}_triggerWebAnimation(e,t,n){return e.animate(this._convertKeyframesToObject(t),n)}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((n,i)=>{i!=="offset"&&e.set(i,this._finished?n:kt(this.element,i))}),this.currentSnapshot=e}triggerCallback(e){let t=e==="start"?this._onStartFns:this._onDoneFns;t.forEach(n=>n()),t.length=0}},We=class{validateStyleProperty(e){return!0}validateAnimatableStyleProperty(e){return!0}containsElement(e,t){return Wn(e,t)}getParentElement(e){return Ct(e)}query(e,t,n){return Jn(e,t,n)}computeStyle(e,t,n){return kt(e,t)}animate(e,t,n,i,r,o=[]){let a=i==0?"both":"forwards",l={duration:n,delay:i,fill:a};r&&(l.easing=r);let c=new Map,h=o.filter(y=>y instanceof xe);ci(n,i)&&h.forEach(y=>{y.currentSnapshot.forEach((m,g)=>c.set(g,m))});let u=oi(t).map(y=>new Map(y));u=ui(e,u,c);let S=qi(e,u);return new xe(e,u,l,S)}};var Ke="@",os="@.disabled",Je=class{namespaceId;delegate;engine;_onDestroy;\u0275type=0;constructor(e,t,n,i){this.namespaceId=e,this.delegate=t,this.engine=n,this._onDestroy=i}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,n,i=!0){this.delegate.insertBefore(e,t,n),this.engine.onInsert(this.namespaceId,t,e,i)}removeChild(e,t,n){this.parentNode(t)&&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,n,i){this.delegate.setAttribute(e,t,n,i)}removeAttribute(e,t,n){this.delegate.removeAttribute(e,t,n)}addClass(e,t){this.delegate.addClass(e,t)}removeClass(e,t){this.delegate.removeClass(e,t)}setStyle(e,t,n,i){this.delegate.setStyle(e,t,n,i)}removeStyle(e,t,n){this.delegate.removeStyle(e,t,n)}setProperty(e,t,n){t.charAt(0)==Ke&&t==os?this.disableAnimations(e,!!n):this.delegate.setProperty(e,t,n)}setValue(e,t){this.delegate.setValue(e,t)}listen(e,t,n){return this.delegate.listen(e,t,n)}disableAnimations(e,t){this.engine.disableAnimations(e,t)}},Pt=class extends Je{factory;constructor(e,t,n,i,r){super(t,n,i,r),this.factory=e,this.namespaceId=t}setProperty(e,t,n){t.charAt(0)==Ke?t.charAt(1)=="."&&t==os?(n=n===void 0?!0:!!n,this.disableAnimations(e,n)):this.engine.process(this.namespaceId,e,t.slice(1),n):this.delegate.setProperty(e,t,n)}listen(e,t,n){if(t.charAt(0)==Ke){let i=Vi(e),r=t.slice(1),o="";return r.charAt(0)!=Ke&&([r,o]=Hi(r)),this.engine.listen(this.namespaceId,i,r,o,a=>{let l=a._data||-1;this.factory.scheduleListenerCallback(l,n,a)})}return this.delegate.listen(e,t,n)}};function Vi(s){switch(s){case"body":return document.body;case"document":return document;case"window":return window;default:return s}}function Hi(s){let e=s.indexOf("."),t=s.substring(0,e),n=s.slice(e+1);return[t,n]}var Ye=class{delegate;engine;_zone;_currentId=0;_microtaskId=1;_animationCallbacksBuffer=[];_rendererCache=new Map;_cdRecurDepth=0;constructor(e,t,n){this.delegate=e,this.engine=t,this._zone=n,t.onRemovalComplete=(i,r)=>{r?.removeChild(null,i)}}createRenderer(e,t){let n="",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 Je(n,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 Pt(this,o,i,this.engine)}begin(){this._cdRecurDepth++,this.delegate.begin&&this.delegate.begin()}_scheduleCountTask(){queueMicrotask(()=>{this._microtaskId++})}scheduleListenerCallback(e,t,n){if(e>=0&&et(n));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,n])}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 xi=(()=>{class s extends _e{constructor(t,n,i){super(t,n,i)}ngOnDestroy(){this.flush()}static \u0275fac=function(n){return new(n||s)(j(nn),j(ue),j(he))};static \u0275prov=W({token:s,factory:s.\u0275fac})}return s})();function Wi(){return new Ue}function Ji(s,e,t){return new Ye(s,e,t)}var as=[{provide:he,useFactory:Wi},{provide:_e,useClass:xi},{provide:Gt,useFactory:Ji,deps:[cn,_e,De]}],Yi=[{provide:ue,useFactory:()=>new We},{provide:nt,useValue:"BrowserAnimations"},...as],kr=[{provide:ue,useClass:Ft},{provide:nt,useValue:"NoopAnimations"},...as];function ls(){return Ht("NgEagerAnimations"),[...Yi]}var Xe=class{http;prefix;suffix;constructor(e,t="/assets/i18n/",n=".json"){this.http=e,this.prefix=t,this.suffix=n}getTranslation(e){return this.http.get(`${this.prefix}${e}${this.suffix}`)}};function Xi(s,e){if(s&1&&(U(0,"li")(1,"h2")(2,"a",1),re(3),fe(4,"translate"),Y()()()),s&2){let t,n=e.$implicit;q(2),Ne("routerLink","/"+n.path),q(),Re(" ",pe(4,2,((t=n.name)!==null&&t!==void 0?t:n.path)+".title")," ")}}var cs=(()=>{class s{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"}]}static{this.\u0275fac=function(n){return new(n||s)}}static{this.\u0275cmp=J({type:s,selectors:[["bkd-home"]],decls:3,vars:0,consts:[[1,"mt-3"],[3,"routerLink"]],template:function(n,i){n&1&&(U(0,"ul",0),Ce(1,Xi,5,4,"li",null,Yt),Y()),n&2&&(q(),Fe(i.sections))},dependencies:[dn,Oe],encapsulation:2,changeDetection:0})}}return s})();var us=(()=>{class s{constructor(){}static{this.\u0275fac=function(n){return new(n||s)}}static{this.\u0275cmp=J({type:s,selectors:[["bkd-unauthenticated"]],decls:4,vars:3,consts:[[1,"bkd-container"],[1,"alert","alert-danger","my-3"]],template:function(n,i){n&1&&(U(0,"div",0)(1,"div",1),re(2),fe(3,"translate"),Y()()),n&2&&(q(2),Re(" ",pe(3,1,"unauthenticated.message")," "))},dependencies:[Oe],encapsulation:2})}}return s})();var Ze=(()=>{class s{constructor(t){this.storage=t}get isAuthenticated(){return!!this.accessToken}get accessToken(){return this.storage.getAccessToken()}static{this.\u0275fac=function(n){return new(n||s)(j(Tn))}}static{this.\u0275prov=W({token:s,factory:s.\u0275fac,providedIn:"root"})}}return s})();function z(){return()=>{let s=H(Ze),e=H(ke);return s.isAuthenticated?!0:(e.navigate(["/unauthenticated"]),!1)}}var hs=[{path:"dashboard",canActivate:[z()],loadChildren:()=>import("./chunk-U3A3T7IE.js").then(s=>s.DASHBOARD_ROUTES)},{path:"presence-control",canActivate:[z()],loadChildren:()=>import("./chunk-VFFZAFLB.js").then(s=>s.PRESENCE_CONTROL_ROUTES)},{path:"open-absences",canActivate:[z()],loadChildren:()=>import("./chunk-S4T5K3GB.js").then(s=>s.OPEN_ABSENCES_ROUTES)},{path:"edit-absences",canActivate:[z()],loadChildren:()=>import("./chunk-PUOIWHIP.js").then(s=>s.EDIT_ABSENCES_ROUTES)},{path:"evaluate-absences",canActivate:[z()],loadChildren:()=>import("./chunk-DKHMWL57.js").then(s=>s.EVALUATE_ABSENCES_ROUTES)},{path:"events",canActivate:[z()],loadChildren:()=>import("./chunk-3K4NZPMP.js").then(s=>s.EVENTS_ROUTES)},{path:"my-absences",canActivate:[z()],loadChildren:()=>import("./chunk-7LHHIW7H.js").then(s=>s.MY_ABSENCES_ROUTES)},{path:"my-profile",canActivate:[z()],loadChildren:()=>import("./chunk-4RWZ7N7L.js").then(s=>s.MY_PROFILE_ROUTES)},{path:"my-grades",canActivate:[z()],loadChildren:()=>import("./chunk-7KV2DHNF.js").then(s=>s.MY_GRADES_ROUTES)},{path:"my-settings",canActivate:[z()],loadChildren:()=>import("./chunk-B47FYJ6R.js").then(s=>s.MY_SETTINGS_ROUTES)},{path:"unauthenticated",component:us},{path:"",component:cs,pathMatch:"full"}];function ds(){return(s,e)=>{let t=H(Ze),n=H(X);if(s.url.startsWith(n.apiUrl)&&t.accessToken){let i=s.headers.set("Authorization",`Bearer ${t.accessToken}`);return e(s.clone({headers:i}))}return e(s)}}function ms(){return(s,e)=>{let t=H(X);if(!s.headers.has("X-Role-Restriction")&&t.headerRoleRestriction){let n=Zi();if(n&&t.headerRoleRestriction[n]){let i=s.headers.set("X-Role-Restriction",t.headerRoleRestriction[n]);return e(s.clone({headers:i}))}}return e(s)}}function Zi(){let s=H(ke),e=s.url?An(s.url):null;return e?yn(e):null}function fs(){return[{provide:Vt,useClass:er}]}var er=(()=>{class s{constructor(t,n,i){this.ngZone=t,this.translate=n,this.toastService=i}handleError(t){console.error(String(t)),t instanceof rn||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"))})}static{this.\u0275fac=function(n){return new(n||s)(j(De),j(En),j(ge))}}static{this.\u0275prov=W({token:s,factory:s.\u0275fac})}}return s})();function tr(s,e){return new Xe(s,`${e.scriptsAndAssetsPath}/assets/locales/`,".json")}var ps={providers:[mn(hs,fn()),an(ln([Mn(),ds(),ms()])),ls(),fs(),vn({loader:{provide:Sn,useFactory:tr,deps:[on,X]}}),bn()]};var gs={production:!0};gs.production&&void 0;rt(Pn);rt(Dn);un(Rn,ps).catch(s=>console.error(s)); +import{b as Mn}from"./chunk-HCNFZOWE.js";import{c as An}from"./chunk-DTYYCJHM.js";import{a as bn,b as wn}from"./chunk-XAZECV42.js";import{t as gn}from"./chunk-W4U7QKJF.js";import{a as ge}from"./chunk-AVBHFGIF.js";import{$ as H,$a as Y,B as jt,Ba as Gt,Bc as mn,Cc as fn,Ed as yn,Ga as J,Jb as fe,Kb as pe,Ld as _n,Na as xt,Nd as Sn,Od as En,Pd as Oe,Qa as Ne,Qd as vn,Rd as Tn,Sa as Wt,V as v,Va as Jt,Wa as Yt,Wb as nn,X as W,Xa as Xt,Ya as Ce,Z as qt,Za as Fe,_ as j,_a as U,_b as rt,a as Pe,ab as Zt,bd as pn,c as Bt,cc as sn,cd as X,ea as Ut,eb as en,fa as Qt,gb as tn,hb as st,k as Kt,kc as rn,lc as on,mc as an,na as De,nc as ln,oa as Vt,oc as cn,pc as un,rb as re,sa as nt,sb as it,ta as Ht,tb as Re,xa as q,xc as hn,ya as ie,yc as ke,zc as dn}from"./chunk-2W7IS4PN.js";function _s(s){let e=s,t=Math.floor(Math.abs(s)),n=s.toString().replace(/^[^.]*\.?/,"").length;return t===1&&n===0?1:5}var Pn=["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",_s];function Ss(s){let e=s,t=Math.floor(Math.abs(s)),n=s.toString().replace(/^[^.]*\.?/,"").length,i=parseInt(s.toString().replace(/^[^e]*(e([-+]?\d+))?/,"$2"))||0;return t===0||t===1?1:i===0&&t!==0&&t%1e6===0&&n===0||!(i>=0&&i<=5)?4:5}var Dn=["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",Ss];function Es(s,e){if(s&1&&(U(0,"i",3),re(1),Y()),s&2){let t=st().$implicit;q(),it(t.icon)}}function vs(s,e){if(s&1){let t=en();U(0,"ngb-toast",1),tn("hidden",function(){let i=Ut(t).$implicit,r=st();return Qt(r.toastService.remove(i))}),U(1,"div",2),xt(2,Es,2,1,"i",3),U(3,"span"),re(4),Y()()()}if(s&2){let t=e.$implicit;Wt(t.classname),Ne("header",t.header||"")("autohide",!0),q(2),Jt(t.icon?2:-1),q(2),it(t.message)}}var Cn=(()=>{class s{constructor(t){this.toastService=t}static{this.\u0275fac=function(n){return new(n||s)(ie(ge))}}static{this.\u0275cmp=J({type:s,selectors:[["bkd-toast"]],decls:3,vars:2,consts:[[3,"header","class","autohide"],[3,"hidden","header","autohide"],[1,"d-flex","gap-2"],[1,"material-icons"]],template:function(n,i){n&1&&(Ce(0,vs,5,6,"ngb-toast",0,Xt),fe(2,"async")),n&2&&Fe(pe(2,0,i.toastService.toasts$))},dependencies:[gn,sn],styles:["[_nghost-%COMP%]{position:fixed;top:0;right:0;margin:.5em;z-index:1200}[_nghost-%COMP%] > *[_ngcontent-%COMP%]{font-size:medium}"]})}}return s})();var Fn=new qt("Navigator API",{providedIn:"root",factory:()=>navigator});var Rn=(()=>{class s{constructor(t,n,i,r){this.toastService=n,this.settings=i,this.navigator=r,t.initialize(),this.checkSettings()}checkSettings(){_n(pn)(this.settings).pipe(jt(t=>(console.error(String(t)),this.toastService.error("Please check the contents of the settings.js file (see Console output for more details).","Invalid Settings"),Kt))).subscribe()}static{this.\u0275fac=function(n){return new(n||s)(ie(wn),ie(ge),ie(X),ie(Fn))}}static{this.\u0275cmp=J({type:s,selectors:[["bkd-app"]],decls:2,vars:0,consts:[["aria-live","polite","aria-atomic","true"]],template:function(n,i){n&1&&Zt(0,"bkd-toast",0)(1,"router-outlet")},dependencies:[Cn,hn],styles:["[_nghost-%COMP%]{width:100%}"],changeDetection:0})}}return s})();var _=function(s){return s[s.State=0]="State",s[s.Transition=1]="Transition",s[s.Sequence=2]="Sequence",s[s.Group=3]="Group",s[s.Animate=4]="Animate",s[s.Keyframes=5]="Keyframes",s[s.Style=6]="Style",s[s.Trigger=7]="Trigger",s[s.Reference=8]="Reference",s[s.AnimateChild=9]="AnimateChild",s[s.AnimateRef=10]="AnimateRef",s[s.Query=11]="Query",s[s.Stagger=12]="Stagger",s}(_||{}),Q="*";function kn(s,e=null){return{type:_.Sequence,steps:s,options:e}}function ot(s){return{type:_.Style,styles:s,offset:null}}var Z=class{_onDoneFns=[];_onStartFns=[];_onDestroyFns=[];_originalOnDoneFns=[];_originalOnStartFns=[];_started=!1;_destroyed=!1;_finished=!1;_position=0;parentPlayer=null;totalTime;constructor(e=0,t=0){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(n=>n()),t.length=0}},Se=class{_onDoneFns=[];_onStartFns=[];_finished=!1;_started=!1;_destroyed=!1;_onDestroyFns=[];parentPlayer=null;totalTime=0;players;constructor(e){this.players=e;let t=0,n=0,i=0,r=this.players.length;r==0?queueMicrotask(()=>this._onFinish()):this.players.forEach(o=>{o.onDone(()=>{++t==r&&this._onFinish()}),o.onDestroy(()=>{++n==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(n=>{let i=n.totalTime?Math.min(1,t/n.totalTime):1;n.setPosition(i)})}getPosition(){let e=this.players.reduce((t,n)=>t===null||n.totalTime>t.totalTime?n: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(n=>n()),t.length=0}},Ie="!";function On(s){return new v(3e3,!1)}function Ts(){return new v(3100,!1)}function bs(){return new v(3101,!1)}function ws(s){return new v(3001,!1)}function As(s){return new v(3003,!1)}function Ms(s){return new v(3004,!1)}function Ps(s,e){return new v(3005,!1)}function Ds(){return new v(3006,!1)}function Ns(){return new v(3007,!1)}function Cs(s,e){return new v(3008,!1)}function Fs(s){return new v(3002,!1)}function Rs(s,e,t,n,i){return new v(3010,!1)}function ks(){return new v(3011,!1)}function Os(){return new v(3012,!1)}function Is(){return new v(3200,!1)}function Ls(){return new v(3202,!1)}function $s(){return new v(3013,!1)}function zs(s){return new v(3014,!1)}function Bs(s){return new v(3015,!1)}function Ks(s){return new v(3016,!1)}function js(s,e){return new v(3404,!1)}function qs(s){return new v(3502,!1)}function Us(s){return new v(3503,!1)}function Qs(){return new v(3300,!1)}function Vs(s){return new v(3504,!1)}function Hs(s){return new v(3301,!1)}function Gs(s,e){return new v(3302,!1)}function xs(s){return new v(3303,!1)}function Ws(s,e){return new v(3400,!1)}function Js(s){return new v(3401,!1)}function Ys(s){return new v(3402,!1)}function Xs(s,e){return new v(3505,!1)}function ee(s){switch(s.length){case 0:return new Z;case 1:return s[0];default:return new Se(s)}}function xn(s,e,t=new Map,n=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 m=y,g=S;if(y!=="offset")switch(m=s.normalizePropertyName(m,i),g){case Ie:g=t.get(y);break;case Q:g=n.get(y);break;default:g=s.normalizeStyleValue(y,m,g,i);break}u.set(m,g)}),h||r.push(u),a=u,o=c}),i.length)throw qs(i);return r}function Dt(s,e,t,n){switch(e){case"start":s.onStart(()=>n(t&&at(t,"start",s)));break;case"done":s.onDone(()=>n(t&&at(t,"done",s)));break;case"destroy":s.onDestroy(()=>n(t&&at(t,"destroy",s)));break}}function at(s,e,t){let n=t.totalTime,i=!!t.disabled,r=Nt(s.element,s.triggerName,s.fromState,s.toState,e||s.phaseName,n??s.totalTime,i),o=s._data;return o!=null&&(r._data=o),r}function Nt(s,e,t,n,i="",r=0,o){return{element:s,triggerName:e,fromState:t,toState:n,phaseName:i,totalTime:r,disabled:!!o}}function O(s,e,t){let n=s.get(e);return n||s.set(e,n=t),n}function In(s){let e=s.indexOf(":"),t=s.substring(1,e),n=s.slice(e+1);return[t,n]}var Zs=typeof document>"u"?null:document.documentElement;function Ct(s){let e=s.parentNode||s.host||null;return e===Zs?null:e}function ei(s){return s.substring(1,6)=="ebkit"}var ae=null,Ln=!1;function ti(s){ae||(ae=ni()||{},Ln=ae.style?"WebkitAppearance"in ae.style:!1);let e=!0;return ae.style&&!ei(s)&&(e=s in ae.style,!e&&Ln&&(e="Webkit"+s.charAt(0).toUpperCase()+s.slice(1)in ae.style)),e}function ni(){return typeof document<"u"?document.body:null}function Wn(s,e){for(;e;){if(e===s)return!0;e=Ct(e)}return!1}function Jn(s,e,t){if(t)return Array.from(s.querySelectorAll(e));let n=s.querySelector(e);return n?[n]:[]}var Ft=(()=>{class s{validateStyleProperty(t){return ti(t)}containsElement(t,n){return Wn(t,n)}getParentElement(t){return Ct(t)}query(t,n,i){return Jn(t,n,i)}computeStyle(t,n,i){return i||""}animate(t,n,i,r,o,a=[],l){return new Z(i,r)}static \u0275fac=function(n){return new(n||s)};static \u0275prov=W({token:s,factory:s.\u0275fac})}return s})(),ue=class{static NOOP=new Ft},he=class{};var si=1e3,Yn="{{",ii="}}",Xn="ng-enter",mt="ng-leave",Le="ng-trigger",je=".ng-trigger",$n="ng-animating",ft=".ng-animating";function G(s){if(typeof s=="number")return s;let e=s.match(/^(-?[\.\d]+)(m?s)/);return!e||e.length<2?0:pt(parseFloat(e[1]),e[2])}function pt(s,e){switch(e){case"s":return s*si;default:return s}}function qe(s,e,t){return s.hasOwnProperty("duration")?s:ri(s,e,t)}function ri(s,e,t){let n=/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i,i,r=0,o="";if(typeof s=="string"){let a=s.match(n);if(a===null)return e.push(On(s)),{duration:0,delay:0,easing:""};i=pt(parseFloat(a[1]),a[2]);let l=a[3];l!=null&&(r=pt(parseFloat(l),a[4]));let c=a[5];c&&(o=c)}else i=s;if(!t){let a=!1,l=e.length;i<0&&(e.push(Ts()),a=!0),r<0&&(e.push(bs()),a=!0),a&&e.splice(l,0,On(s))}return{duration:i,delay:r,easing:o}}function oi(s){return s.length?s[0]instanceof Map?s:s.map(e=>new Map(Object.entries(e))):[]}function V(s,e,t){e.forEach((n,i)=>{let r=Rt(i);t&&!t.has(i)&&t.set(i,s.style[r]),s.style[r]=n})}function ce(s,e){e.forEach((t,n)=>{let i=Rt(n);s.style[i]=""})}function Ee(s){return Array.isArray(s)?s.length==1?s[0]:kn(s):s}function ai(s,e,t){let n=e.params||{},i=Zn(s);i.length&&i.forEach(r=>{n.hasOwnProperty(r)||t.push(ws(r))})}var gt=new RegExp(`${Yn}\\s*(.+?)\\s*${ii}`,"g");function Zn(s){let e=[];if(typeof s=="string"){let t;for(;t=gt.exec(s);)e.push(t[1]);gt.lastIndex=0}return e}function Te(s,e,t){let n=`${s}`,i=n.replace(gt,(r,o)=>{let a=e[o];return a==null&&(t.push(As(o)),a=""),a.toString()});return i==n?s:i}var li=/-+([a-z0-9])/g;function Rt(s){return s.replace(li,(...e)=>e[1].toUpperCase())}function ci(s,e){return s===0||e===0}function ui(s,e,t){if(t.size&&e.length){let n=e[0],i=[];if(t.forEach((r,o)=>{n.has(o)||i.push(o),n.set(o,r)}),i.length)for(let r=1;ro.set(a,kt(s,a)))}}return e}function k(s,e,t){switch(e.type){case _.Trigger:return s.visitTrigger(e,t);case _.State:return s.visitState(e,t);case _.Transition:return s.visitTransition(e,t);case _.Sequence:return s.visitSequence(e,t);case _.Group:return s.visitGroup(e,t);case _.Animate:return s.visitAnimate(e,t);case _.Keyframes:return s.visitKeyframes(e,t);case _.Style:return s.visitStyle(e,t);case _.Reference:return s.visitReference(e,t);case _.AnimateChild:return s.visitAnimateChild(e,t);case _.AnimateRef:return s.visitAnimateRef(e,t);case _.Query:return s.visitQuery(e,t);case _.Stagger:return s.visitStagger(e,t);default:throw Ms(e.type)}}function kt(s,e){return window.getComputedStyle(s)[e]}var hi=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"]),Ue=class extends he{normalizePropertyName(e,t){return Rt(e)}normalizeStyleValue(e,t,n,i){let r="",o=n.toString().trim();if(hi.has(t)&&n!==0&&n!=="0")if(typeof n=="number")r="px";else{let a=n.match(/^[+-]?[\d\.]+([a-z]*)$/);a&&a[1].length==0&&i.push(Ps(e,n))}return o+r}};var Qe="*";function di(s,e){let t=[];return typeof s=="string"?s.split(/\s*,\s*/).forEach(n=>mi(n,t,e)):t.push(s),t}function mi(s,e,t){if(s[0]==":"){let l=fi(s,t);if(typeof l=="function"){e.push(l);return}s=l}let n=s.match(/^(\*|[-\w]+)\s*()\s*(\*|[-\w]+)$/);if(n==null||n.length<4)return t.push(Bs(s)),e;let i=n[1],r=n[2],o=n[3];e.push(zn(i,o));let a=i==Qe&&o==Qe;r[0]=="<"&&!a&&e.push(zn(o,i))}function fi(s,e){switch(s){case":enter":return"void => *";case":leave":return"* => void";case":increment":return(t,n)=>parseFloat(n)>parseFloat(t);case":decrement":return(t,n)=>parseFloat(n) *"}}var $e=new Set(["true","1"]),ze=new Set(["false","0"]);function zn(s,e){let t=$e.has(s)||ze.has(s),n=$e.has(e)||ze.has(e);return(i,r)=>{let o=s==Qe||s==i,a=e==Qe||e==r;return!o&&t&&typeof i=="boolean"&&(o=i?$e.has(s):ze.has(s)),!a&&n&&typeof r=="boolean"&&(a=r?$e.has(e):ze.has(e)),o&&a}}var es=":self",pi=new RegExp(`s*${es}s*,?`,"g");function ts(s,e,t,n){return new yt(s).build(e,t,n)}var Bn="",yt=class{_driver;constructor(e){this._driver=e}build(e,t,n){let i=new _t(t);return this._resetContextStyleTimingState(i),k(this,Ee(e),i)}_resetContextStyleTimingState(e){e.currentQuerySelector=Bn,e.collectedStyles=new Map,e.collectedStyles.set(Bn,new Map),e.currentTime=0}visitTrigger(e,t){let n=t.queryCount=0,i=t.depCount=0,r=[],o=[];return e.name.charAt(0)=="@"&&t.errors.push(Ds()),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);n+=l.queryCount,i+=l.depCount,o.push(l)}else t.errors.push(Ns())}),{type:_.Trigger,name:e.name,states:r,transitions:o,queryCount:n,depCount:i,options:null}}visitState(e,t){let n=this.visitStyle(e.styles,t),i=e.options&&e.options.params||null;if(n.containsDynamicStyles){let r=new Set,o=i||{};n.styles.forEach(a=>{a instanceof Map&&a.forEach(l=>{Zn(l).forEach(c=>{o.hasOwnProperty(c)||r.add(c)})})}),r.size&&t.errors.push(Cs(e.name,[...r.values()]))}return{type:_.State,name:e.name,style:n,options:i?{params:i}:null}}visitTransition(e,t){t.queryCount=0,t.depCount=0;let n=k(this,Ee(e.animation),t),i=di(e.expr,t.errors);return{type:_.Transition,matchers:i,animation:n,queryCount:t.queryCount,depCount:t.depCount,options:le(e.options)}}visitSequence(e,t){return{type:_.Sequence,steps:e.steps.map(n=>k(this,n,t)),options:le(e.options)}}visitGroup(e,t){let n=t.currentTime,i=0,r=e.steps.map(o=>{t.currentTime=n;let a=k(this,o,t);return i=Math.max(i,t.currentTime),a});return t.currentTime=i,{type:_.Group,steps:r,options:le(e.options)}}visitAnimate(e,t){let n=Si(e.timings,t.errors);t.currentAnimateTimings=n;let i,r=e.styles?e.styles:ot({});if(r.type==_.Keyframes)i=this.visitKeyframes(r,t);else{let o=e.styles,a=!1;if(!o){a=!0;let c={};n.easing&&(c.easing=n.easing),o=ot(c)}t.currentTime+=n.duration+n.delay;let l=this.visitStyle(o,t);l.isEmptyStep=a,i=l}return t.currentAnimateTimings=null,{type:_.Animate,timings:n,style:i,options:null}}visitStyle(e,t){let n=this._makeStyleAst(e,t);return this._validateStyleAst(n,t),n}_makeStyleAst(e,t){let n=[],i=Array.isArray(e.styles)?e.styles:[e.styles];for(let a of i)typeof a=="string"?a===Q?n.push(a):t.errors.push(Fs(a)):n.push(new Map(Object.entries(a)));let r=!1,o=null;return n.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(Yn)>=0){r=!0;break}}}),{type:_.Style,styles:n,easing:o,offset:e.offset,containsDynamicStyles:r,options:null}}_validateStyleAst(e,t){let n=t.currentAnimateTimings,i=t.currentTime,r=t.currentTime;n&&r>0&&(r-=n.duration+n.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(Rs(l,h.startTime,h.endTime,r,i)),u=!1),r=h.startTime),u&&c.set(l,{startTime:r,endTime:i}),t.options&&ai(a,t.options,t.errors)})})}visitKeyframes(e,t){let n={type:_.Keyframes,styles:[],options:null};if(!t.currentAnimateTimings)return t.errors.push(ks()),n;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:_i(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=m+g.delay+P,g.duration=P,this._validateStyleAst(w,t),w.offset=N,n.styles.push(w)}),n}visitReference(e,t){return{type:_.Reference,animation:k(this,Ee(e.animation),t),options:le(e.options)}}visitAnimateChild(e,t){return t.depCount++,{type:_.AnimateChild,options:le(e.options)}}visitAnimateRef(e,t){return{type:_.AnimateRef,animation:this.visitReference(e.animation,t),options:le(e.options)}}visitQuery(e,t){let n=t.currentQuerySelector,i=e.options||{};t.queryCount++,t.currentQuery=e;let[r,o]=gi(e.selector);t.currentQuerySelector=n.length?n+" "+r:r,O(t.collectedStyles,t.currentQuerySelector,new Map);let a=k(this,Ee(e.animation),t);return t.currentQuery=null,t.currentQuerySelector=n,{type:_.Query,selector:r,limit:i.limit||0,optional:!!i.optional,includeSelf:o,animation:a,originalSelector:e.selector,options:le(e.options)}}visitStagger(e,t){t.currentQuery||t.errors.push($s());let n=e.timings==="full"?{duration:0,delay:0,easing:"full"}:qe(e.timings,t.errors,!0);return{type:_.Stagger,animation:k(this,Ee(e.animation),t),timings:n,options:null}}};function gi(s){let e=!!s.split(/\s*,\s*/).find(t=>t==es);return e&&(s=s.replace(pi,"")),s=s.replace(/@\*/g,je).replace(/@\w+/g,t=>je+"-"+t.slice(1)).replace(/:animating/g,ft),[s,e]}function yi(s){return s?Pe({},s):null}var _t=class{errors;queryCount=0;depCount=0;currentTransition=null;currentQuery=null;currentQuerySelector=null;currentAnimateTimings=null;currentTime=0;collectedStyles=new Map;options=null;unsupportedCSSPropertiesFound=new Set;constructor(e){this.errors=e}};function _i(s){if(typeof s=="string")return null;let e=null;if(Array.isArray(s))s.forEach(t=>{if(t instanceof Map&&t.has("offset")){let n=t;e=parseFloat(n.get("offset")),n.delete("offset")}});else if(s instanceof Map&&s.has("offset")){let t=s;e=parseFloat(t.get("offset")),t.delete("offset")}return e}function Si(s,e){if(s.hasOwnProperty("duration"))return s;if(typeof s=="number"){let r=qe(s,e).duration;return lt(r,0,"")}let t=s;if(t.split(/\s+/).some(r=>r.charAt(0)=="{"&&r.charAt(1)=="{")){let r=lt(0,0,"");return r.dynamic=!0,r.strValue=t,r}let i=qe(t,e);return lt(i.duration,i.delay,i.easing)}function le(s){return s?(s=Pe({},s),s.params&&(s.params=yi(s.params))):s={},s}function lt(s,e,t){return{duration:s,delay:e,easing:t}}function Ot(s,e,t,n,i,r,o=null,a=!1){return{type:1,element:s,keyframes:e,preStyleProps:t,postStyleProps:n,duration:i,delay:r,totalTime:i+r,easing:o,subTimeline:a}}var be=class{_map=new Map;get(e){return this._map.get(e)||[]}append(e,t){let n=this._map.get(e);n||this._map.set(e,n=[]),n.push(...t)}has(e){return this._map.has(e)}clear(){this._map.clear()}},Ei=1,vi=":enter",Ti=new RegExp(vi,"g"),bi=":leave",wi=new RegExp(bi,"g");function ns(s,e,t,n,i,r=new Map,o=new Map,a,l,c=[]){return new St().buildKeyframes(s,e,t,n,i,r,o,a,l,c)}var St=class{buildKeyframes(e,t,n,i,r,o,a,l,c,h=[]){c=c||new be;let u=new Et(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,n,u);let y=u.timelines.filter(m=>m.containsAnimation());if(y.length&&a.size){let m;for(let g=y.length-1;g>=0;g--){let T=y[g];if(T.element===t){m=T;break}}m&&!m.allowOnlyTimelineStyles()&&m.setStyles([a],null,u.errors,l)}return y.length?y.map(m=>m.buildKeyframes()):[Ot(t,[],[],[],0,S,"",!1)]}visitTrigger(e,t){}visitState(e,t){}visitTransition(e,t){}visitAnimateChild(e,t){let n=t.subInstructions.get(t.element);if(n){let i=t.createSubContext(e.options),r=t.currentTimeline.currentTime,o=this._visitSubInstructions(n,i,i.options);r!=o&&t.transformIntoNewTimeline(o)}t.previousNode=e}visitAnimateRef(e,t){let n=t.createSubContext(e.options);n.transformIntoNewTimeline(),this._applyAnimationRefDelays([e.options,e.animation.options],t,n),this.visitReference(e.animation,n),t.transformIntoNewTimeline(n.currentTimeline.currentTime),t.previousNode=e}_applyAnimationRefDelays(e,t,n){for(let i of e){let r=i?.delay;if(r){let o=typeof r=="number"?r:G(Te(r,i?.params??{},t.errors));n.delayNextStep(o)}}}_visitSubInstructions(e,t,n){let r=t.currentTimeline.currentTime,o=n.duration!=null?G(n.duration):null,a=n.delay!=null?G(n.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 n=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=Ve);let o=G(r.delay);i.delayNextStep(o)}e.steps.length&&(e.steps.forEach(o=>k(this,o,i)),i.currentTimeline.applyStylesToKeyframe(),i.subContextCount>n&&i.transformIntoNewTimeline()),t.previousNode=e}visitGroup(e,t){let n=[],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),n.push(a.currentTimeline)}),n.forEach(o=>t.currentTimeline.mergeTimelineCollectedStyles(o)),t.transformIntoNewTimeline(i),t.previousNode=e}_visitTiming(e,t){if(e.dynamic){let n=e.strValue,i=t.params?Te(n,t.params,t.errors):n;return qe(i,t.errors)}else return{duration:e.duration,delay:e.delay,easing:e.easing}}visitAnimate(e,t){let n=t.currentAnimateTimings=this._visitTiming(e.timings,t),i=t.currentTimeline;n.delay&&(t.incrementTime(n.delay),i.snapshotCurrentStyles());let r=e.style;r.type==_.Keyframes?this.visitKeyframes(r,t):(t.incrementTime(n.duration),this.visitStyle(r,t),i.applyStylesToKeyframe()),t.currentAnimateTimings=null,t.previousNode=e}visitStyle(e,t){let n=t.currentTimeline,i=t.currentAnimateTimings;!i&&n.hasCurrentStyleProperties()&&n.forwardFrame();let r=i&&i.easing||e.easing;e.isEmptyStep?n.applyEmptyStep(r):n.setStyles(e.styles,r,t.errors,t.options),t.previousNode=e}visitKeyframes(e,t){let n=t.currentAnimateTimings,i=t.currentTimeline.duration,r=n.duration,a=t.createSubContext().currentTimeline;a.easing=n.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 n=t.currentTimeline.currentTime,i=e.options||{},r=i.delay?G(i.delay):0;r&&(t.previousNode.type===_.Style||n==0&&t.currentTimeline.hasCurrentStyleProperties())&&(t.currentTimeline.snapshotCurrentStyles(),t.previousNode=Ve);let o=n,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 n=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=n.currentStaggerTime;break}let h=t.currentTimeline;l&&h.delayNextStep(l);let u=h.currentTime;k(this,e.animation,t),t.previousNode=e,n.currentStaggerTime=i.currentTime-u+(i.startTime-n.currentTimeline.startTime)}},Ve={},Et=class s{_driver;element;subInstructions;_enterClassName;_leaveClassName;errors;timelines;parentContext=null;currentTimeline;currentAnimateTimings=null;previousNode=Ve;subContextCount=0;options={};currentQueryIndex=0;currentQueryTotal=0;currentStaggerTime=0;constructor(e,t,n,i,r,o,a,l){this._driver=e,this.element=t,this.subInstructions=n,this._enterClassName=i,this._leaveClassName=r,this.errors=o,this.timelines=a,this.currentTimeline=l||new He(this._driver,t,0),a.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(e,t){if(!e)return;let n=e,i=this.options;n.duration!=null&&(i.duration=G(n.duration)),n.delay!=null&&(i.delay=G(n.delay));let r=n.params;if(r){let o=i.params;o||(o=this.options.params={}),Object.keys(r).forEach(a=>{(!t||!o.hasOwnProperty(a))&&(o[a]=Te(r[a],o,this.errors))})}}_copyOptions(){let e={};if(this.options){let t=this.options.params;if(t){let n=e.params={};Object.keys(t).forEach(i=>{n[i]=t[i]})}}return e}createSubContext(e=null,t,n){let i=t||this.element,r=new s(this._driver,i,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(i,n||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=Ve,this.currentTimeline=this.currentTimeline.fork(this.element,e),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(e,t,n){let i={duration:t??e.duration,delay:this.currentTimeline.currentTime+(n??0)+e.delay,easing:""},r=new vt(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,n,i,r,o){let a=[];if(i&&a.push(this.element),e.length>0){e=e.replace(Ti,"."+this._enterClassName),e=e.replace(wi,"."+this._leaveClassName);let l=n!=1,c=this._driver.query(this.element,e,l);n!==0&&(c=n<0?c.slice(c.length+n,c.length):c.slice(0,n)),a.push(...c)}return!r&&a.length==0&&o.push(zs(t)),a}},He=class s{_driver;element;startTime;_elementTimelineStylesLookup;duration=0;easing=null;_previousKeyframe=new Map;_currentKeyframe=new Map;_keyframes=new Map;_styleSummary=new Map;_localTimelineStyles=new Map;_globalTimelineStyles;_pendingStyles=new Map;_backFill=new Map;_currentEmptyStepKeyframe=null;constructor(e,t,n,i){this._driver=e,this.element=t,this.startTime=n,this._elementTimelineStylesLookup=i,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 s(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+=Ei,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,n]of this._globalTimelineStyles)this._backFill.set(t,n||Q),this._currentKeyframe.set(t,Q);this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(e,t,n,i){t&&this._previousKeyframe.set("easing",t);let r=i&&i.params||{},o=Ai(e,this._globalTimelineStyles);for(let[a,l]of o){let c=Te(l,r,n);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,n)=>{let i=this._styleSummary.get(n);(!i||t.time>i.time)&&this._updateStyle(n,t.value)})}buildKeyframes(){this.applyStylesToKeyframe();let e=new Set,t=new Set,n=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===Ie?e.add(u):h===Q&&t.add(u)}),n||c.set("offset",l/this.duration),i.push(c)});let r=[...e.values()],o=[...t.values()];if(n){let a=i[0],l=new Map(a);a.set("offset",0),l.set("offset",1),i=[a,l]}return Ot(this.element,i,r,o,this.duration,this.startTime,this.easing,!1)}},vt=class extends He{keyframes;preStyleProps;postStyleProps;_stretchStartingKeyframe;timings;constructor(e,t,n,i,r,o,a=!1){super(e,t,o.delay),this.keyframes=n,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:n,easing:i}=this.timings;if(this._stretchStartingKeyframe&&t){let r=[],o=n+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",Kn(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"),m=t+y*n;S.set("offset",Kn(m/o)),r.push(S)}n=o,t=0,i="",e=r}return Ot(this.element,e,this.preStyleProps,this.postStyleProps,n,t,i,!0)}};function Kn(s,e=3){let t=Math.pow(10,e-1);return Math.round(s*t)/t}function Ai(s,e){let t=new Map,n;return s.forEach(i=>{if(i==="*"){n??=e.keys();for(let r of n)t.set(r,Q)}else for(let[r,o]of i)t.set(r,o)}),t}function jn(s,e,t,n,i,r,o,a,l,c,h,u,S){return{type:0,element:s,triggerName:e,isRemovalTransition:i,fromState:t,fromStyles:r,toState:n,toStyles:o,timelines:a,queriedElements:l,preStyleProps:c,postStyleProps:h,totalTime:u,errors:S}}var ct={},Ge=class{_triggerName;ast;_stateStyles;constructor(e,t,n){this._triggerName=e,this.ast=t,this._stateStyles=n}match(e,t,n,i){return Mi(this.ast.matchers,e,t,n,i)}buildStyles(e,t,n){let i=this._stateStyles.get("*");return e!==void 0&&(i=this._stateStyles.get(e?.toString())||i),i?i.buildStyles(t,n):new Map}build(e,t,n,i,r,o,a,l,c,h){let u=[],S=this.ast.options&&this.ast.options.params||ct,y=a&&a.params||ct,m=this.buildStyles(n,y,u),g=l&&l.params||ct,T=this.buildStyles(i,g,u),w=new Set,A=new Map,N=new Map,P=i==="void",de={params:ss(g,S),delay:this.ast.options?.delay},B=h?[]:ns(e,t,this.ast.animation,r,o,m,T,de,c,u),C=0;return B.forEach(F=>{C=Math.max(F.duration+F.delay,C)}),u.length?jn(t,this._triggerName,n,i,P,m,T,[],[],A,N,C,u):(B.forEach(F=>{let te=F.element,me=O(A,te,new Set);F.preStyleProps.forEach(ne=>me.add(ne));let It=O(N,te,new Set);F.postStyleProps.forEach(ne=>It.add(ne)),te!==t&&w.add(te)}),jn(t,this._triggerName,n,i,P,m,T,B,[...w.values()],A,N,C))}};function Mi(s,e,t,n,i){return s.some(r=>r(e,t,n,i))}function ss(s,e){let t=Pe({},e);return Object.entries(s).forEach(([n,i])=>{i!=null&&(t[n]=i)}),t}var Tt=class{styles;defaultParams;normalizer;constructor(e,t,n){this.styles=e,this.defaultParams=t,this.normalizer=n}buildStyles(e,t){let n=new Map,i=ss(e,this.defaultParams);return this.styles.styles.forEach(r=>{typeof r!="string"&&r.forEach((o,a)=>{o&&(o=Te(o,i,t));let l=this.normalizer.normalizePropertyName(a,t);o=this.normalizer.normalizeStyleValue(a,l,o,t),n.set(a,o)})}),n}};function Pi(s,e,t){return new bt(s,e,t)}var bt=class{name;ast;_normalizer;transitionFactories=[];fallbackTransition;states=new Map;constructor(e,t,n){this.name=e,this.ast=t,this._normalizer=n,t.states.forEach(i=>{let r=i.options&&i.options.params||{};this.states.set(i.name,new Tt(i.style,r,n))}),qn(this.states,"true","1"),qn(this.states,"false","0"),t.transitions.forEach(i=>{this.transitionFactories.push(new Ge(e,i,this.states))}),this.fallbackTransition=Di(e,this.states,this._normalizer)}get containsQueries(){return this.ast.queryCount>0}matchTransition(e,t,n,i){return this.transitionFactories.find(o=>o.match(e,t,n,i))||null}matchStyles(e,t,n){return this.fallbackTransition.buildStyles(e,t,n)}};function Di(s,e,t){let n=[(o,a)=>!0],i={type:_.Sequence,steps:[],options:null},r={type:_.Transition,animation:i,matchers:n,options:null,queryCount:0,depCount:0};return new Ge(s,r,e)}function qn(s,e,t){s.has(e)?s.has(t)||s.set(t,s.get(e)):s.has(t)&&s.set(e,s.get(t))}var Ni=new be,wt=class{bodyNode;_driver;_normalizer;_animations=new Map;_playersById=new Map;players=[];constructor(e,t,n){this.bodyNode=e,this._driver=t,this._normalizer=n}register(e,t){let n=[],i=[],r=ts(this._driver,t,n,i);if(n.length)throw Us(n);i.length&&void 0,this._animations.set(e,r)}_buildPlayer(e,t,n){let i=e.element,r=xn(this._normalizer,e.keyframes,t,n);return this._driver.animate(i,r,e.duration,e.delay,e.easing,[],!0)}create(e,t,n={}){let i=[],r=this._animations.get(e),o,a=new Map;if(r?(o=ns(this._driver,t,r,Xn,mt,new Map,new Map,n,Ni,i),o.forEach(h=>{let u=O(a,h.element,new Map);h.postStyleProps.forEach(S=>u.set(S,null))})):(i.push(Qs()),o=[]),i.length)throw Vs(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=ee(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 n=this.players.indexOf(t);n>=0&&this.players.splice(n,1)}_getPlayer(e){let t=this._playersById.get(e);if(!t)throw Hs(e);return t}listen(e,t,n,i){let r=Nt(t,"","","");return Dt(this._getPlayer(e),n,r,i),()=>{}}command(e,t,n,i){if(n=="register"){this.register(e,i[0]);return}if(n=="create"){let o=i[0]||{};this.create(e,t,o);return}let r=this._getPlayer(e);switch(n){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}}},Un="ng-animate-queued",Ci=".ng-animate-queued",ut="ng-animate-disabled",Fi=".ng-animate-disabled",Ri="ng-star-inserted",ki=".ng-star-inserted",Oi=[],is={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},Ii={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},$="__ng_removed",we=class{namespaceId;value;options;get params(){return this.options.params}constructor(e,t=""){this.namespaceId=t;let n=e&&e.hasOwnProperty("value"),i=n?e.value:e;if(this.value=$i(i),n){let r=e,{value:o}=r,a=Bt(r,["value"]);this.options=a}else this.options={};this.options.params||(this.options.params={})}absorbOptions(e){let t=e.params;if(t){let n=this.options.params;Object.keys(t).forEach(i=>{n[i]==null&&(n[i]=t[i])})}}},ve="void",ht=new we(ve),At=class{id;hostElement;_engine;players=[];_triggers=new Map;_queue=[];_elementListeners=new Map;_hostClassName;constructor(e,t,n){this.id=e,this.hostElement=t,this._engine=n,this._hostClassName="ng-tns-"+e,L(t,this._hostClassName)}listen(e,t,n,i){if(!this._triggers.has(t))throw Gs(n,t);if(n==null||n.length==0)throw xs(t);if(!zi(n))throw Ws(n,t);let r=O(this._elementListeners,e,[]),o={name:t,phase:n,callback:i};r.push(o);let a=O(this._engine.statesByElement,e,new Map);return a.has(t)||(L(e,Le),L(e,Le+"-"+t),a.set(t,ht)),()=>{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 Js(e);return t}trigger(e,t,n,i=!0){let r=this._getTrigger(t),o=new Ae(this.id,t,e),a=this._engine.statesByElement.get(e);a||(L(e,Le),L(e,Le+"-"+t),this._engine.statesByElement.set(e,a=new Map));let l=a.get(t),c=new we(n,this.id);if(!(n&&n.hasOwnProperty("value"))&&l&&c.absorbOptions(l.options),a.set(t,c),l||(l=ht),!(c.value===ve)&&l.value===c.value){if(!ji(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(()=>{ce(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),m=!1;if(!y){if(!i)return;y=r.fallbackTransition,m=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:t,transition:y,fromState:l,toState:c,player:o,isFallbackTransition:m}),m||(L(e,Un),o.onStart(()=>{ye(e,Un)})),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,n)=>{this._elementListeners.set(n,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(n=>n.destroy()),this._engine.playersByElement.delete(e))}_signalRemovalForInnerTriggers(e,t){let n=this._engine.driver.query(e,je,!0);n.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(()=>n.forEach(i=>this.clearElementCache(i)))}triggerLeaveAnimation(e,t,n,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,ve,i);h&&a.push(h)}}),a.length)return this._engine.markElementAsRemoved(this.id,e,!0,t,o),n&&ee(a).onDone(()=>this._engine.processLeaveNode(e)),!0}return!1}prepareLeaveAnimationListeners(e){let t=this._elementListeners.get(e),n=this._engine.statesByElement.get(e);if(t&&n){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=n.get(o)||ht,h=new we(ve),u=new Ae(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 n=this._engine;if(e.childElementCount&&this._signalRemovalForInnerTriggers(e,t),this.triggerLeaveAnimation(e,t,!0))return;let i=!1;if(n.totalAnimations){let r=n.players.length?n.playersByQueriedElement.get(e):[];if(r&&r.length)i=!0;else{let o=e;for(;o=o.parentNode;)if(n.statesByElement.get(o)){i=!0;break}}}if(this.prepareLeaveAnimationListeners(e),i)n.markElementAsRemoved(this.id,e,!1,t);else{let r=e[$];(!r||r===is)&&(n.afterFlush(()=>this.clearElementCache(e)),n.destroyInnerAnimations(e),n._onRemovalComplete(e,t))}}insertNode(e,t){L(e,this._hostClassName)}drainQueuedTransitions(e){let t=[];return this._queue.forEach(n=>{let i=n.player;if(i.destroyed)return;let r=n.element,o=this._elementListeners.get(r);o&&o.forEach(a=>{if(a.name==n.triggerName){let l=Nt(r,n.triggerName,n.fromState.value,n.toState.value);l._data=e,Dt(n.player,a.phase,l,a.callback)}}),i.markedForDestroy?this._engine.afterFlush(()=>{i.destroy()}):t.push(n)}),this._queue=[],t.sort((n,i)=>{let r=n.transition.ast.depCount,o=i.transition.ast.depCount;return r==0||o==0?r-o:this._engine.driver.containsElement(n.element,i.element)?1:-1})}destroy(e){this.players.forEach(t=>t.destroy()),this._signalRemovalForInnerTriggers(this.hostElement,e)}},Mt=class{bodyNode;driver;_normalizer;players=[];newHostElements=new Map;playersByElement=new Map;playersByQueriedElement=new Map;statesByElement=new Map;disabledNodes=new Set;totalAnimations=0;totalQueuedPlayers=0;_namespaceLookup={};_namespaceList=[];_flushFns=[];_whenQuietFns=[];namespacesByHostElement=new Map;collectedEnterElements=[];collectedLeaveElements=[];onRemovalComplete=(e,t)=>{};_onRemovalComplete(e,t){this.onRemovalComplete(e,t)}constructor(e,t,n){this.bodyNode=e,this.driver=t,this._normalizer=n}get queuedPlayers(){let e=[];return this._namespaceList.forEach(t=>{t.players.forEach(n=>{n.queued&&e.push(n)})}),e}createNamespace(e,t){let n=new At(e,t,this);return this.bodyNode&&this.driver.containsElement(this.bodyNode,t)?this._balanceNamespaceList(n,t):(this.newHostElements.set(t,n),this.collectEnterElement(t)),this._namespaceLookup[e]=n}_balanceNamespaceList(e,t){let n=this._namespaceList,i=this.namespacesByHostElement;if(n.length-1>=0){let o=!1,a=this.driver.getParentElement(t);for(;a;){let l=i.get(a);if(l){let c=n.indexOf(l);n.splice(c+1,0,e),o=!0;break}a=this.driver.getParentElement(a)}o||n.unshift(e)}else n.push(e);return i.set(t,e),e}register(e,t){let n=this._namespaceLookup[e];return n||(n=this.createNamespace(e,t)),n}registerTrigger(e,t,n){let i=this._namespaceLookup[e];i&&i.register(t,n)&&this.totalAnimations++}destroy(e,t){e&&(this.afterFlush(()=>{}),this.afterFlushAnimationsDone(()=>{let n=this._fetchNamespace(e);this.namespacesByHostElement.delete(n.hostElement);let i=this._namespaceList.indexOf(n);i>=0&&this._namespaceList.splice(i,1),n.destroy(t),delete this._namespaceLookup[e]}))}_fetchNamespace(e){return this._namespaceLookup[e]}fetchNamespacesByElement(e){let t=new Set,n=this.statesByElement.get(e);if(n){for(let i of n.values())if(i.namespaceId){let r=this._fetchNamespace(i.namespaceId);r&&t.add(r)}}return t}trigger(e,t,n,i){if(Be(t)){let r=this._fetchNamespace(e);if(r)return r.trigger(t,n,i),!0}return!1}insertNode(e,t,n,i){if(!Be(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,n)}i&&this.collectEnterElement(t)}collectEnterElement(e){this.collectedEnterElements.push(e)}markElementAsDisabled(e,t){t?this.disabledNodes.has(e)||(this.disabledNodes.add(e),L(e,ut)):this.disabledNodes.has(e)&&(this.disabledNodes.delete(e),ye(e,ut))}removeNode(e,t,n){if(Be(t)){let i=e?this._fetchNamespace(e):null;i?i.removeNode(t,n):this.markElementAsRemoved(e,t,!1,n);let r=this.namespacesByHostElement.get(t);r&&r.id!==e&&r.removeNode(t,n)}else this._onRemovalComplete(t,n)}markElementAsRemoved(e,t,n,i,r){this.collectedLeaveElements.push(t),t[$]={namespaceId:e,setForRemoval:i,hasAnimation:n,removedBeforeQueried:!1,previousTriggersValues:r}}listen(e,t,n,i,r){return Be(t)?this._fetchNamespace(e).listen(t,n,i,r):()=>{}}_buildInstruction(e,t,n,i,r){return e.transition.build(this.driver,e.element,e.fromState.value,e.toState.value,n,i,e.fromState.options,e.toState.options,t,r)}destroyInnerAnimations(e){let t=this.driver.query(e,je,!0);t.forEach(n=>this.destroyActiveAnimationsForElement(n)),this.playersByQueriedElement.size!=0&&(t=this.driver.query(e,ft,!0),t.forEach(n=>this.finishActiveQueriedAnimationOnElement(n)))}destroyActiveAnimationsForElement(e){let t=this.playersByElement.get(e);t&&t.forEach(n=>{n.queued?n.markedForDestroy=!0:n.destroy()})}finishActiveQueriedAnimationOnElement(e){let t=this.playersByQueriedElement.get(e);t&&t.forEach(n=>n.finish())}whenRenderingDone(){return new Promise(e=>{if(this.players.length)return ee(this.players).onDone(()=>e());e()})}processLeaveNode(e){let t=e[$];if(t&&t.setForRemoval){if(e[$]=is,t.namespaceId){this.destroyInnerAnimations(e);let n=this._fetchNamespace(t.namespaceId);n&&n.clearElementCache(e)}this._onRemovalComplete(e,t.setForRemoval)}e.classList?.contains(ut)&&this.markElementAsDisabled(e,!1),this.driver.query(e,Fi,!0).forEach(n=>{this.markElementAsDisabled(n,!1)})}flush(e=-1){let t=[];if(this.newHostElements.size&&(this.newHostElements.forEach((n,i)=>this._balanceNamespaceList(n,i)),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(let n=0;nn()),this._flushFns=[],this._whenQuietFns.length){let n=this._whenQuietFns;this._whenQuietFns=[],t.length?ee(t).onDone(()=>{n.forEach(i=>i())}):n.forEach(i=>i())}}reportError(e){throw Ys(e)}_flushAnimations(e,t){let n=new be,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 f=this.driver.query(d,Ci,!0);for(let p=0;p{let p=Xn+g++;m.set(f,p),d.forEach(E=>L(E,p))});let T=[],w=new Set,A=new Set;for(let d=0;dw.add(E)):A.add(f))}let N=new Map,P=Hn(S,Array.from(w));P.forEach((d,f)=>{let p=mt+g++;N.set(f,p),d.forEach(E=>L(E,p))}),e.push(()=>{y.forEach((d,f)=>{let p=m.get(f);d.forEach(E=>ye(E,p))}),P.forEach((d,f)=>{let p=N.get(f);d.forEach(E=>ye(E,p))}),T.forEach(d=>{this.processLeaveNode(d)})});let de=[],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(de.push(E),this.collectedEnterElements.length){let D=M[$];if(D&&D.setForMove){if(D.previousTriggersValues&&D.previousTriggersValues.has(p.triggerName)){let se=D.previousTriggersValues.get(p.triggerName),I=this.statesByElement.get(p.element);if(I&&I.has(p.triggerName)){let Me=I.get(p.triggerName);Me.value=se,I.set(p.triggerName,Me)}}E.destroy();return}}let K=!u||!this.driver.containsElement(u,M),R=N.get(M),x=m.get(M),b=this._buildInstruction(p,n,x,R,K);if(b.errors&&b.errors.length){B.push(b);return}if(K){E.onStart(()=>ce(M,b.fromStyles)),E.onDestroy(()=>V(M,b.toStyles)),i.push(E);return}if(p.isFallbackTransition){E.onStart(()=>ce(M,b.fromStyles)),E.onDestroy(()=>V(M,b.toStyles)),i.push(E);return}let zt=[];b.timelines.forEach(D=>{D.stretchStartingKeyframe=!0,this.disabledNodes.has(D.element)||zt.push(D)}),b.timelines=zt,n.append(M,b.timelines);let ys={instruction:b,player:E,element:M};o.push(ys),b.queriedElements.forEach(D=>O(a,D,[]).push(E)),b.preStyleProps.forEach((D,se)=>{if(D.size){let I=l.get(se);I||l.set(se,I=new Set),D.forEach((Me,tt)=>I.add(tt))}}),b.postStyleProps.forEach((D,se)=>{let I=c.get(se);I||c.set(se,I=new Set),D.forEach((Me,tt)=>I.add(tt))})});if(B.length){let d=[];B.forEach(f=>{d.push(Xs(f.triggerName,f.errors))}),de.forEach(f=>f.destroy()),this.reportError(d)}let C=new Map,F=new Map;o.forEach(d=>{let f=d.element;n.has(f)&&(F.set(f,f),this._beforeAnimationBuild(d.player.namespaceId,d.instruction,C))}),i.forEach(d=>{let f=d.element;this._getPreviousPlayers(f,!1,d.namespaceId,d.triggerName,null).forEach(E=>{O(C,f,[]).push(E),E.destroy()})});let te=T.filter(d=>Gn(d,l,c)),me=new Map;Vn(me,this.driver,A,c,Q).forEach(d=>{Gn(d,l,c)&&te.push(d)});let ne=new Map;y.forEach((d,f)=>{Vn(ne,this.driver,new Set(d),l,Ie)}),te.forEach(d=>{let f=me.get(d),p=ne.get(d);me.set(d,new Map([...f?.entries()??[],...p?.entries()??[]]))});let et=[],Lt=[],$t={};o.forEach(d=>{let{element:f,player:p,instruction:E}=d;if(n.has(f)){if(h.has(f)){p.onDestroy(()=>V(f,E.toStyles)),p.disabled=!0,p.overrideTotalTime(E.totalTime),i.push(p);return}let M=$t;if(F.size>1){let R=f,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,ne,me);if(p.setRealPlayer(K),M===$t)et.push(p);else{let R=this.playersByElement.get(M);R&&R.length&&(p.parentPlayer=ee(R)),i.push(p)}}else ce(f,E.fromStyles),p.onDestroy(()=>V(f,E.toStyles)),Lt.push(p),h.has(f)&&i.push(p)}),Lt.forEach(d=>{let f=r.get(d.element);if(f&&f.length){let p=ee(f);d.setRealPlayer(p)}}),i.forEach(d=>{d.parentPlayer?d.syncPlayerEvents(d.parentPlayer):d.destroy()});for(let d=0;d!K.destroyed);M.length?Bi(this,f,M):this.processLeaveNode(f)}return T.length=0,et.forEach(d=>{this.players.push(d),d.onDone(()=>{d.destroy();let f=this.players.indexOf(d);this.players.splice(f,1)}),d.play()}),et}afterFlush(e){this._flushFns.push(e)}afterFlushAnimationsDone(e){this._whenQuietFns.push(e)}_getPreviousPlayers(e,t,n,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==ve;a.forEach(c=>{c.queued||!l&&c.triggerName!=i||o.push(c)})}}return(n||i)&&(o=o.filter(a=>!(n&&n!=a.namespaceId||i&&i!=a.triggerName))),o}_beforeAnimationBuild(e,t,n){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(n,c,[]);this._getPreviousPlayers(c,h,o,a,t.toState).forEach(y=>{let m=y.getRealPlayer();m.beforeDestroy&&m.beforeDestroy(),y.destroy(),u.push(y)})}ce(r,t.fromStyles)}_buildAnimation(e,t,n,i,r,o){let a=t.triggerName,l=t.element,c=[],h=new Set,u=new Set,S=t.timelines.map(m=>{let g=m.element;h.add(g);let T=g[$];if(T&&T.removedBeforeQueried)return new Z(m.duration,m.delay);let w=g!==l,A=Ki((n.get(g)||Oi).map(C=>C.getRealPlayer())).filter(C=>{let F=C;return F.element?F.element===g:!1}),N=r.get(g),P=o.get(g),de=xn(this._normalizer,m.keyframes,N,P),B=this._buildPlayer(m,de,A);if(m.subTimeline&&i&&u.add(g),w){let C=new Ae(e,a,g);C.setRealPlayer(B),c.push(C)}return B});c.forEach(m=>{O(this.playersByQueriedElement,m.element,[]).push(m),m.onDone(()=>Li(this.playersByQueriedElement,m.element,m))}),h.forEach(m=>L(m,$n));let y=ee(S);return y.onDestroy(()=>{h.forEach(m=>ye(m,$n)),V(l,t.toStyles)}),u.forEach(m=>{O(i,m,[]).push(y)}),y}_buildPlayer(e,t,n){return t.length>0?this.driver.animate(e.element,t,e.duration,e.delay,e.easing,n):new Z(e.duration,e.delay)}},Ae=class{namespaceId;triggerName;element;_player=new Z;_containsRealPlayer=!1;_queuedCallbacks=new Map;destroyed=!1;parentPlayer=null;markedForDestroy=!1;disabled=!1;queued=!0;totalTime=0;constructor(e,t,n){this.namespaceId=e,this.triggerName=t,this.element=n}setRealPlayer(e){this._containsRealPlayer||(this._player=e,this._queuedCallbacks.forEach((t,n)=>{t.forEach(i=>Dt(e,n,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 Li(s,e,t){let n=s.get(e);if(n){if(n.length){let i=n.indexOf(t);n.splice(i,1)}n.length==0&&s.delete(e)}return n}function $i(s){return s??null}function Be(s){return s&&s.nodeType===1}function zi(s){return s=="start"||s=="done"}function Qn(s,e){let t=s.style.display;return s.style.display=e??"none",t}function Vn(s,e,t,n,i){let r=[];t.forEach(l=>r.push(Qn(l)));let o=[];n.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[$]=Ii,o.push(c))}),s.set(c,h)});let a=0;return t.forEach(l=>Qn(l,r[a++])),o}function Hn(s,e){let t=new Map;if(s.forEach(a=>t.set(a,[])),e.length==0)return t;let n=1,i=new Set(e),r=new Map;function o(a){if(!a)return n;let l=r.get(a);if(l)return l;let c=a.parentNode;return t.has(c)?l=c:i.has(c)?l=n:l=o(c),r.set(a,l),l}return e.forEach(a=>{let l=o(a);l!==n&&t.get(l).push(a)}),t}function L(s,e){s.classList?.add(e)}function ye(s,e){s.classList?.remove(e)}function Bi(s,e,t){ee(t).onDone(()=>s.processLeaveNode(e))}function Ki(s){let e=[];return rs(s,e),e}function rs(s,e){for(let t=0;ti.add(r)):e.set(s,n),t.delete(s),!0}var _e=class{_driver;_normalizer;_transitionEngine;_timelineEngine;_triggerCache={};onRemovalComplete=(e,t)=>{};constructor(e,t,n){this._driver=t,this._normalizer=n,this._transitionEngine=new Mt(e.body,t,n),this._timelineEngine=new wt(e.body,t,n),this._transitionEngine.onRemovalComplete=(i,r)=>this.onRemovalComplete(i,r)}registerTrigger(e,t,n,i,r){let o=e+"-"+i,a=this._triggerCache[o];if(!a){let l=[],c=[],h=ts(this._driver,r,l,c);if(l.length)throw js(i,l);c.length&&void 0,a=Pi(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,n,i){this._transitionEngine.insertNode(e,t,n,i)}onRemove(e,t,n){this._transitionEngine.removeNode(e,t,n)}disableAnimations(e,t){this._transitionEngine.markElementAsDisabled(e,t)}process(e,t,n,i){if(n.charAt(0)=="@"){let[r,o]=In(n),a=i;this._timelineEngine.command(r,t,o,a)}else this._transitionEngine.trigger(e,t,n,i)}listen(e,t,n,i,r){if(n.charAt(0)=="@"){let[o,a]=In(n);return this._timelineEngine.listen(o,t,a,r)}return this._transitionEngine.listen(e,t,n,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 qi(s,e){let t=null,n=null;return Array.isArray(e)&&e.length?(t=dt(e[0]),e.length>1&&(n=dt(e[e.length-1]))):e instanceof Map&&(t=dt(e)),t||n?new Ui(s,t,n):null}var Ui=(()=>{class s{_element;_startStyles;_endStyles;static initialStylesByElement=new WeakMap;_state=0;_initialStyles;constructor(t,n,i){this._element=t,this._startStyles=n,this._endStyles=i;let r=s.initialStylesByElement.get(t);r||s.initialStylesByElement.set(t,r=new Map),this._initialStyles=r}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&&(s.initialStylesByElement.delete(this._element),this._startStyles&&(ce(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(ce(this._element,this._endStyles),this._endStyles=null),V(this._element,this._initialStyles),this._state=3)}}return s})();function dt(s){let e=null;return s.forEach((t,n)=>{Qi(n)&&(e=e||new Map,e.set(n,t))}),e}function Qi(s){return s==="display"||s==="position"}var xe=class{element;keyframes;options;_specialStyles;_onDoneFns=[];_onStartFns=[];_onDestroyFns=[];_duration;_delay;_initialized=!1;_finished=!1;_started=!1;_destroyed=!1;_finalKeyframe;_originalOnDoneFns=[];_originalOnStartFns=[];domPlayer;time=0;parentPlayer=null;currentSnapshot=new Map;constructor(e,t,n,i){this.element=e,this.keyframes=t,this.options=n,this._specialStyles=i,this._duration=n.duration,this._delay=n.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(n=>{t.push(Object.fromEntries(n))}),t}_triggerWebAnimation(e,t,n){return e.animate(this._convertKeyframesToObject(t),n)}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((n,i)=>{i!=="offset"&&e.set(i,this._finished?n:kt(this.element,i))}),this.currentSnapshot=e}triggerCallback(e){let t=e==="start"?this._onStartFns:this._onDoneFns;t.forEach(n=>n()),t.length=0}},We=class{validateStyleProperty(e){return!0}validateAnimatableStyleProperty(e){return!0}containsElement(e,t){return Wn(e,t)}getParentElement(e){return Ct(e)}query(e,t,n){return Jn(e,t,n)}computeStyle(e,t,n){return kt(e,t)}animate(e,t,n,i,r,o=[]){let a=i==0?"both":"forwards",l={duration:n,delay:i,fill:a};r&&(l.easing=r);let c=new Map,h=o.filter(y=>y instanceof xe);ci(n,i)&&h.forEach(y=>{y.currentSnapshot.forEach((m,g)=>c.set(g,m))});let u=oi(t).map(y=>new Map(y));u=ui(e,u,c);let S=qi(e,u);return new xe(e,u,l,S)}};var Ke="@",os="@.disabled",Je=class{namespaceId;delegate;engine;_onDestroy;\u0275type=0;constructor(e,t,n,i){this.namespaceId=e,this.delegate=t,this.engine=n,this._onDestroy=i}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,n,i=!0){this.delegate.insertBefore(e,t,n),this.engine.onInsert(this.namespaceId,t,e,i)}removeChild(e,t,n){this.parentNode(t)&&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,n,i){this.delegate.setAttribute(e,t,n,i)}removeAttribute(e,t,n){this.delegate.removeAttribute(e,t,n)}addClass(e,t){this.delegate.addClass(e,t)}removeClass(e,t){this.delegate.removeClass(e,t)}setStyle(e,t,n,i){this.delegate.setStyle(e,t,n,i)}removeStyle(e,t,n){this.delegate.removeStyle(e,t,n)}setProperty(e,t,n){t.charAt(0)==Ke&&t==os?this.disableAnimations(e,!!n):this.delegate.setProperty(e,t,n)}setValue(e,t){this.delegate.setValue(e,t)}listen(e,t,n){return this.delegate.listen(e,t,n)}disableAnimations(e,t){this.engine.disableAnimations(e,t)}},Pt=class extends Je{factory;constructor(e,t,n,i,r){super(t,n,i,r),this.factory=e,this.namespaceId=t}setProperty(e,t,n){t.charAt(0)==Ke?t.charAt(1)=="."&&t==os?(n=n===void 0?!0:!!n,this.disableAnimations(e,n)):this.engine.process(this.namespaceId,e,t.slice(1),n):this.delegate.setProperty(e,t,n)}listen(e,t,n){if(t.charAt(0)==Ke){let i=Vi(e),r=t.slice(1),o="";return r.charAt(0)!=Ke&&([r,o]=Hi(r)),this.engine.listen(this.namespaceId,i,r,o,a=>{let l=a._data||-1;this.factory.scheduleListenerCallback(l,n,a)})}return this.delegate.listen(e,t,n)}};function Vi(s){switch(s){case"body":return document.body;case"document":return document;case"window":return window;default:return s}}function Hi(s){let e=s.indexOf("."),t=s.substring(0,e),n=s.slice(e+1);return[t,n]}var Ye=class{delegate;engine;_zone;_currentId=0;_microtaskId=1;_animationCallbacksBuffer=[];_rendererCache=new Map;_cdRecurDepth=0;constructor(e,t,n){this.delegate=e,this.engine=t,this._zone=n,t.onRemovalComplete=(i,r)=>{r?.removeChild(null,i)}}createRenderer(e,t){let n="",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 Je(n,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 Pt(this,o,i,this.engine)}begin(){this._cdRecurDepth++,this.delegate.begin&&this.delegate.begin()}_scheduleCountTask(){queueMicrotask(()=>{this._microtaskId++})}scheduleListenerCallback(e,t,n){if(e>=0&&et(n));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,n])}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 xi=(()=>{class s extends _e{constructor(t,n,i){super(t,n,i)}ngOnDestroy(){this.flush()}static \u0275fac=function(n){return new(n||s)(j(nn),j(ue),j(he))};static \u0275prov=W({token:s,factory:s.\u0275fac})}return s})();function Wi(){return new Ue}function Ji(s,e,t){return new Ye(s,e,t)}var as=[{provide:he,useFactory:Wi},{provide:_e,useClass:xi},{provide:Gt,useFactory:Ji,deps:[cn,_e,De]}],Yi=[{provide:ue,useFactory:()=>new We},{provide:nt,useValue:"BrowserAnimations"},...as],kr=[{provide:ue,useClass:Ft},{provide:nt,useValue:"NoopAnimations"},...as];function ls(){return Ht("NgEagerAnimations"),[...Yi]}var Xe=class{http;prefix;suffix;constructor(e,t="/assets/i18n/",n=".json"){this.http=e,this.prefix=t,this.suffix=n}getTranslation(e){return this.http.get(`${this.prefix}${e}${this.suffix}`)}};function Xi(s,e){if(s&1&&(U(0,"li")(1,"h2")(2,"a",1),re(3),fe(4,"translate"),Y()()()),s&2){let t,n=e.$implicit;q(2),Ne("routerLink","/"+n.path),q(),Re(" ",pe(4,2,((t=n.name)!==null&&t!==void 0?t:n.path)+".title")," ")}}var cs=(()=>{class s{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"}]}static{this.\u0275fac=function(n){return new(n||s)}}static{this.\u0275cmp=J({type:s,selectors:[["bkd-home"]],decls:3,vars:0,consts:[[1,"mt-3"],[3,"routerLink"]],template:function(n,i){n&1&&(U(0,"ul",0),Ce(1,Xi,5,4,"li",null,Yt),Y()),n&2&&(q(),Fe(i.sections))},dependencies:[dn,Oe],encapsulation:2,changeDetection:0})}}return s})();var us=(()=>{class s{constructor(){}static{this.\u0275fac=function(n){return new(n||s)}}static{this.\u0275cmp=J({type:s,selectors:[["bkd-unauthenticated"]],decls:4,vars:3,consts:[[1,"bkd-container"],[1,"alert","alert-danger","my-3"]],template:function(n,i){n&1&&(U(0,"div",0)(1,"div",1),re(2),fe(3,"translate"),Y()()),n&2&&(q(2),Re(" ",pe(3,1,"unauthenticated.message")," "))},dependencies:[Oe],encapsulation:2})}}return s})();var Ze=(()=>{class s{constructor(t){this.storage=t}get isAuthenticated(){return!!this.accessToken}get accessToken(){return this.storage.getAccessToken()}static{this.\u0275fac=function(n){return new(n||s)(j(Tn))}}static{this.\u0275prov=W({token:s,factory:s.\u0275fac,providedIn:"root"})}}return s})();function z(){return()=>{let s=H(Ze),e=H(ke);return s.isAuthenticated?!0:(e.navigate(["/unauthenticated"]),!1)}}var hs=[{path:"dashboard",canActivate:[z()],loadChildren:()=>import("./chunk-QRYQOPD4.js").then(s=>s.DASHBOARD_ROUTES)},{path:"presence-control",canActivate:[z()],loadChildren:()=>import("./chunk-FHLJK5I2.js").then(s=>s.PRESENCE_CONTROL_ROUTES)},{path:"open-absences",canActivate:[z()],loadChildren:()=>import("./chunk-S4T5K3GB.js").then(s=>s.OPEN_ABSENCES_ROUTES)},{path:"edit-absences",canActivate:[z()],loadChildren:()=>import("./chunk-RENI6OUS.js").then(s=>s.EDIT_ABSENCES_ROUTES)},{path:"evaluate-absences",canActivate:[z()],loadChildren:()=>import("./chunk-45PGF53G.js").then(s=>s.EVALUATE_ABSENCES_ROUTES)},{path:"events",canActivate:[z()],loadChildren:()=>import("./chunk-GPCFUPHW.js").then(s=>s.EVENTS_ROUTES)},{path:"my-absences",canActivate:[z()],loadChildren:()=>import("./chunk-7LHHIW7H.js").then(s=>s.MY_ABSENCES_ROUTES)},{path:"my-profile",canActivate:[z()],loadChildren:()=>import("./chunk-4RWZ7N7L.js").then(s=>s.MY_PROFILE_ROUTES)},{path:"my-grades",canActivate:[z()],loadChildren:()=>import("./chunk-5V4FYHUO.js").then(s=>s.MY_GRADES_ROUTES)},{path:"my-settings",canActivate:[z()],loadChildren:()=>import("./chunk-B47FYJ6R.js").then(s=>s.MY_SETTINGS_ROUTES)},{path:"unauthenticated",component:us},{path:"",component:cs,pathMatch:"full"}];function ds(){return(s,e)=>{let t=H(Ze),n=H(X);if(s.url.startsWith(n.apiUrl)&&t.accessToken){let i=s.headers.set("Authorization",`Bearer ${t.accessToken}`);return e(s.clone({headers:i}))}return e(s)}}function ms(){return(s,e)=>{let t=H(X);if(!s.headers.has("X-Role-Restriction")&&t.headerRoleRestriction){let n=Zi();if(n&&t.headerRoleRestriction[n]){let i=s.headers.set("X-Role-Restriction",t.headerRoleRestriction[n]);return e(s.clone({headers:i}))}}return e(s)}}function Zi(){let s=H(ke),e=s.url?An(s.url):null;return e?yn(e):null}function fs(){return[{provide:Vt,useClass:er}]}var er=(()=>{class s{constructor(t,n,i){this.ngZone=t,this.translate=n,this.toastService=i}handleError(t){console.error(String(t)),t instanceof rn||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"))})}static{this.\u0275fac=function(n){return new(n||s)(j(De),j(En),j(ge))}}static{this.\u0275prov=W({token:s,factory:s.\u0275fac})}}return s})();function tr(s,e){return new Xe(s,`${e.scriptsAndAssetsPath}/assets/locales/`,".json")}var ps={providers:[mn(hs,fn()),an(ln([Mn(),ds(),ms()])),ls(),fs(),vn({loader:{provide:Sn,useFactory:tr,deps:[on,X]}}),bn()]};var gs={production:!0};gs.production&&void 0;rt(Pn);rt(Dn);un(Rn,ps).catch(s=>console.error(s));