From 80e17c55481e114763019b9e0c5b2cd4aa89f43b Mon Sep 17 00:00:00 2001 From: github-actions Date: Wed, 11 Dec 2024 07:50:49 +0000 Subject: [PATCH] Add webapp-schulverwaltung build 96b4d58d --- public/apps/webapp-schulverwaltung/chunk-4YGUAC2V.js | 1 + .../{chunk-DWOSXMEJ.js => chunk-6Q3B2ZQ3.js} | 2 +- .../{chunk-DRZ46FDG.js => chunk-7KWP4GRQ.js} | 2 +- public/apps/webapp-schulverwaltung/chunk-7VKKHU7R.js | 1 - .../{chunk-6ILHYDRU.js => chunk-CRR2TBGE.js} | 2 +- .../{chunk-24TK3FB4.js => chunk-HAT2K5YI.js} | 2 +- .../{chunk-H5OLZFFB.js => chunk-KZHJ5VQS.js} | 2 +- .../{chunk-6OTM65O7.js => chunk-N753X34U.js} | 2 +- .../{chunk-EQCBS6DP.js => chunk-R6T5CAET.js} | 2 +- public/apps/webapp-schulverwaltung/index.html | 2 +- .../{main-QF3W7LU6.js => main-3R3X57HA.js} | 2 +- 11 files changed, 10 insertions(+), 10 deletions(-) create mode 100644 public/apps/webapp-schulverwaltung/chunk-4YGUAC2V.js rename public/apps/webapp-schulverwaltung/{chunk-DWOSXMEJ.js => chunk-6Q3B2ZQ3.js} (99%) rename public/apps/webapp-schulverwaltung/{chunk-DRZ46FDG.js => chunk-7KWP4GRQ.js} (99%) delete mode 100644 public/apps/webapp-schulverwaltung/chunk-7VKKHU7R.js rename public/apps/webapp-schulverwaltung/{chunk-6ILHYDRU.js => chunk-CRR2TBGE.js} (99%) rename public/apps/webapp-schulverwaltung/{chunk-24TK3FB4.js => chunk-HAT2K5YI.js} (99%) rename public/apps/webapp-schulverwaltung/{chunk-H5OLZFFB.js => chunk-KZHJ5VQS.js} (98%) rename public/apps/webapp-schulverwaltung/{chunk-6OTM65O7.js => chunk-N753X34U.js} (99%) rename public/apps/webapp-schulverwaltung/{chunk-EQCBS6DP.js => chunk-R6T5CAET.js} (99%) rename public/apps/webapp-schulverwaltung/{main-QF3W7LU6.js => main-3R3X57HA.js} (99%) diff --git a/public/apps/webapp-schulverwaltung/chunk-4YGUAC2V.js b/public/apps/webapp-schulverwaltung/chunk-4YGUAC2V.js new file mode 100644 index 00000000..6450d46b --- /dev/null +++ b/public/apps/webapp-schulverwaltung/chunk-4YGUAC2V.js @@ -0,0 +1 @@ +import{a as $}from"./chunk-2H6IFZM2.js";import{a as ce,b as de}from"./chunk-7FRZV7VF.js";import{d as me,e as fe}from"./chunk-VUPOI3TG.js";import{j as K,k as J,l as Q}from"./chunk-NL5E3FC5.js";import{b as ue}from"./chunk-YD3RJIHU.js";import{a as Y,c as W}from"./chunk-KK2SHN2W.js";import{u as q}from"./chunk-AP373D4K.js";import{Ab as A,Cc as d,Dc as z,Gb as u,Ha as _,Hb as x,Ib as F,Ic as N,Jd as se,Kd as le,Ld as O,Ma as ie,Na as ae,P as B,Pc as f,Qc as R,Ra as p,Wa as c,X as j,Xa as m,Xb as re,Ya as s,Yc as k,_ as h,_b as oe,aa as I,da as te,db as l,ec as w,gc as U,ha as ne,hb as y,l as M,n as V,nb as r,o as L,ob as S,pb as C,qb as v,uc as pe,va as g,wa as a,x as ee,xa as Z}from"./chunk-IFJN5CDK.js";function Se(t,o){if(t&1&&(r(0),s(1,"br")),t&2){let e=l();C(" ",e.student.AddressLine2,"")}}function _e(t,o){if(t&1&&(c(0,"a",0),r(1),m(),s(2,"br")),t&2){let e=l();y("href","tel:",e.student.PhonePrivate,"",g),a(),C(" ",e.student.PhonePrivate," ")}}function Pe(t,o){if(t&1&&(c(0,"a",0),r(1),m(),s(2,"br")),t&2){let e=l();y("href","tel:",e.student.PhoneMobile,"",g),a(),C(" ",e.student.PhoneMobile," ")}}function Me(t,o){if(t&1&&(c(0,"a",0),r(1),m()),t&2){let e=l();y("href","mailto:",e.email,"",g),a(),C(" ",e.email," ")}}var Xe=(()=>{class t{constructor(){this.emailProperty="DisplayEmail"}get postalCode(){return"PostalCode"in this.student?this.student.PostalCode:this.student.Zip}get email(){return this.emailProperty==="Email2"&&"Email2"in this.student?this.student.Email2||null:this.student.DisplayEmail}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=I({type:t,selectors:[["bkd-student-dossier-address"]],inputs:{student:"student",emailProperty:"emailProperty"},standalone:!0,features:[A],decls:9,vars:7,consts:[[3,"href"]],template:function(i,n){i&1&&(c(0,"address"),r(1),s(2,"br"),_(3,Se,2,1,"br"),r(4),s(5,"br"),_(6,_e,3,3)(7,Pe,3,3)(8,Me,2,3,"a",0),m()),i&2&&(a(),C(" ",n.student.AddressLine1,""),a(2),p(n.student.AddressLine2?3:-1),a(),v(" ",n.postalCode||""," ",n.student.Location,""),a(2),p(n.student.PhonePrivate?6:-1),a(),p(n.student.PhoneMobile?7:-1),a(),p(n.email?8:-1))},changeDetection:0})}}return t})();var H=(()=>{class t{transform(e){return e?.DisplayEmail||e?.Email||e?.Email2||null}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275pipe=te({name:"bkdPersonEmail",type:t,pure:!0,standalone:!0})}}return t})();function Ie(t,o){if(t&1&&(r(0),s(1,"br")),t&2){let e=l();C(" ",e.company.apprenticeshipManager==null?null:e.company.apprenticeshipManager.CompanyName,"")}}function Ae(t,o){if(t&1&&(r(0),s(1,"br")),t&2){let e=l();C(" ",e.company.apprenticeshipManager==null?null:e.company.apprenticeshipManager.CompanyNameAddition,"")}}function Te(t,o){if(t&1&&(r(0),s(1,"br")),t&2){let e=l();v(" ",(e.company.apprenticeshipManager==null?null:e.company.apprenticeshipManager.Lastname)||""," ",(e.company.apprenticeshipManager==null?null:e.company.apprenticeshipManager.Firstname)||"","")}}function De(t,o){if(t&1&&(r(0),s(1,"br")),t&2){let e=l();C(" ",e.company.apprenticeshipManager==null?null:e.company.apprenticeshipManager.AddressLine1,"")}}function Ee(t,o){if(t&1&&(r(0),s(1,"br")),t&2){let e=l();C(" ",e.company.apprenticeshipManager==null?null:e.company.apprenticeshipManager.AddressLine2,"")}}function Le(t,o){if(t&1&&(r(0),s(1,"br")),t&2){let e=l();v(" ",e.company.apprenticeshipManager==null?null:e.company.apprenticeshipManager.PostalCode," ",e.company.apprenticeshipManager==null?null:e.company.apprenticeshipManager.Location,"")}}function je(t,o){if(t&1&&(c(0,"a",0),r(1),s(2,"br"),m()),t&2){let e=l();y("href","tel:",e.company.apprenticeshipManager==null?null:e.company.apprenticeshipManager.PhoneBusiness,"",g),a(),S(e.company.apprenticeshipManager==null?null:e.company.apprenticeshipManager.PhoneBusiness)}}function ke(t,o){if(t&1&&(c(0,"a",0),u(1,"bkdPersonEmail"),r(2),u(3,"bkdPersonEmail"),m()),t&2){let e=l();y("href","mailto:",x(1,3,e.company.apprenticeshipManager),"",g),a(2),S(x(3,5,e.company.apprenticeshipManager))}}function Fe(t,o){if(t&1&&(c(0,"div",1),r(1),u(2,"translate"),u(3,"addSpace"),s(4,"br"),r(5),u(6,"date"),u(7,"date"),m()),t&2){let e=l();a(),v(" ",x(2,4,"shared.profile.apprenticeship-period"),"",F(3,6,":",":"),""),a(4),v(" ",F(6,9,e.company.apprenticeshipContract.ContractDateFrom,"dd.MM.yyyy"),"\u2013",F(7,12,e.company.apprenticeshipContract.ContractDateTo,"dd.MM.yyyy")," ")}}function Re(t,o){if(t&1&&(r(0),s(1,"br")),t&2){let e=l(2);v(" ",e.company.jobTrainer.Lastname||""," ",e.company.jobTrainer.Firstname||"","")}}function Be(t,o){if(t&1&&(c(0,"a",0),r(1),s(2,"br"),m()),t&2){let e=l(2);y("href","tel:",e.company.jobTrainer.PhoneBusiness,"",g),a(),S(e.company.jobTrainer.PhoneBusiness)}}function we(t,o){if(t&1&&(c(0,"a",0),r(1),s(2,"br"),m()),t&2){let e=l(2);y("href","tel:",e.company.jobTrainer.PhoneMobile,"",g),a(),S(e.company.jobTrainer.PhoneMobile)}}function Ue(t,o){if(t&1&&(c(0,"a",0),u(1,"bkdPersonEmail"),r(2),u(3,"bkdPersonEmail"),m()),t&2){let e=l(2);y("href","mailto:",x(1,3,e.company.jobTrainer),"",g),a(2),S(x(3,5,e.company.jobTrainer))}}function ze(t,o){if(t&1&&(c(0,"div",1),r(1),u(2,"translate"),u(3,"addSpace"),c(4,"address"),_(5,Re,2,2,"br")(6,Be,3,3,"a",0)(7,we,3,3,"a",0)(8,Ue,4,7,"a",0),u(9,"bkdPersonEmail"),m()()),t&2){let e=l();a(),v(" ",x(2,6,"shared.profile.job-trainer"),"",F(3,8,":",":")," "),a(4),p(e.company.jobTrainer.Lastname||e.company.jobTrainer.Firstname?5:-1),a(),p(e.company.jobTrainer.PhoneBusiness?6:-1),a(),p(e.company.jobTrainer.PhoneMobile?7:-1),a(),p(x(9,11,e.company.jobTrainer)?8:-1)}}var pt=(()=>{class t{constructor(){}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=I({type:t,selectors:[["bkd-student-dossier-apprenticeship-company"]],inputs:{company:"company"},standalone:!0,features:[A],decls:12,vars:12,consts:[[3,"href"],[1,"subentry"]],template:function(i,n){i&1&&(c(0,"address"),_(1,Ie,2,1,"br")(2,Ae,2,1,"br")(3,Te,2,2,"br")(4,De,2,1,"br")(5,Ee,2,1,"br")(6,Le,2,2,"br")(7,je,3,3,"a",0)(8,ke,4,7,"a",0),u(9,"bkdPersonEmail"),m(),_(10,Fe,8,15,"div",1)(11,ze,10,13,"div",1)),i&2&&(a(),p(n.company.apprenticeshipManager!=null&&n.company.apprenticeshipManager.CompanyName?1:-1),a(),p(n.company.apprenticeshipManager!=null&&n.company.apprenticeshipManager.CompanyNameAddition?2:-1),a(),p(n.company.apprenticeshipManager!=null&&n.company.apprenticeshipManager.Lastname||n.company.apprenticeshipManager!=null&&n.company.apprenticeshipManager.Firstname?3:-1),a(),p(n.company.apprenticeshipManager!=null&&n.company.apprenticeshipManager.AddressLine1?4:-1),a(),p(n.company.apprenticeshipManager!=null&&n.company.apprenticeshipManager.AddressLine2?5:-1),a(),p(n.company.apprenticeshipManager!=null&&n.company.apprenticeshipManager.PostalCode&&(n.company.apprenticeshipManager!=null&&n.company.apprenticeshipManager.Location)?6:-1),a(),p(n.company.apprenticeshipManager!=null&&n.company.apprenticeshipManager.PhoneBusiness?7:-1),a(),p(x(9,10,n.company.apprenticeshipManager)?8:-1),a(2),p(n.company.apprenticeshipContract.ContractDateFrom?10:-1),a(),p(n.company.jobTrainer?11:-1))},dependencies:[oe,le,se,fe,H],styles:[".subentry[_ngcontent-%COMP%]{padding-bottom:1rem}"],changeDetection:0})}}return t})();function Ne(t,o){if(t&1&&(r(0),s(1,"br")),t&2){let e=l();C(" ",e.person.AddressLine1,"")}}function Oe(t,o){if(t&1&&(r(0),s(1,"br")),t&2){let e=l();C(" ",e.person.AddressLine2,"")}}function Je(t,o){if(t&1&&(r(0),s(1,"br")),t&2){let e=l();v(" ",e.person.Zip," ",e.person.Location,"")}}function Ye(t,o){if(t&1&&(c(0,"a",0),r(1),s(2,"br"),m()),t&2){let e=l();y("href","tel:",e.person.PhonePrivate,"",g),a(),S(e.person.PhonePrivate)}}function $e(t,o){if(t&1&&(c(0,"a",0),r(1),s(2,"br"),m()),t&2){let e=l();y("href","tel:",e.person.PhoneMobile,"",g),a(),S(e.person.PhoneMobile)}}function He(t,o){if(t&1&&(c(0,"a",0),u(1,"bkdPersonEmail"),r(2),u(3,"bkdPersonEmail"),m()),t&2){let e=l();y("href","mailto:",x(1,3,e.person),"",g),a(2),S(x(3,5,e.person))}}var ct=(()=>{class t{constructor(){}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=I({type:t,selectors:[["bkd-student-dossier-legal-representative"]],inputs:{person:"person"},standalone:!0,features:[A],decls:10,vars:10,consts:[[3,"href"]],template:function(i,n){i&1&&(c(0,"address"),r(1),s(2,"br"),_(3,Ne,2,1,"br")(4,Oe,2,1,"br")(5,Je,2,2,"br")(6,Ye,3,3,"a",0)(7,$e,3,3,"a",0)(8,He,4,7,"a",0),u(9,"bkdPersonEmail"),m()),i&2&&(a(),v(" ",n.person.LastName," ",n.person.FirstName,""),a(2),p(n.person.AddressLine1?3:-1),a(),p(n.person.AddressLine2?4:-1),a(),p(n.person.Zip&&n.person.Zip?5:-1),a(),p(n.person.PhonePrivate?6:-1),a(),p(n.person.PhoneMobile?7:-1),a(),p(x(9,8,n.person)?8:-1))},dependencies:[H],changeDetection:0})}}return t})();function X(t,o){let e=+K(t)-+K(o);return e<0?-1:e>0?1:e}function he(t,o,e){let[i,n]=J(e?.in,t,o);return i.getFullYear()-n.getFullYear()}function ge(t,o,e){let[i,n]=J(e?.in,t,o),b=X(i,n),T=Math.abs(he(i,n));i.setFullYear(1584),n.setFullYear(1584);let D=X(i,n)===-b,P=b*(T-+D);return P===0?0:P}var Ge=18;function ye(t){return ge(new Date,t.Birthdate||new Date)>=Ge}var Ce=N({Email:f(d),Email2:f(d),PhoneBusiness:f(d),CompanyName:R(d),CompanyNameAddition:R(d),Firstname:f(d),Lastname:f(d),AddressLine1:R(d),AddressLine2:R(d),PostalCode:f(d),Location:f(d),Id:z});var xe=(()=>{class t extends Y{constructor(e,i){super(e,i,Ce,"ApprenticeshipManagers")}static{this.\u0275fac=function(i){return new(i||t)(h(U),h(k))}}static{this.\u0275prov=j({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var ve=N({Email:f(d),Email2:f(d),PhoneBusiness:f(d),PhoneMobile:f(d),Firstname:f(d),Lastname:f(d),Id:z});var be=(()=>{class t extends Y{constructor(e,i){super(e,i,ve,"JobTrainers")}static{this.\u0275fac=function(i){return new(i||t)(h(U),h(k))}}static{this.\u0275prov=j({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var $t=(()=>{class t{constructor(e,i,n,b,T,D,P){this.studentService=e,this.personsService=i,this.apprenticeshipManagersService=n,this.jobTrainersService=b,this.loadingService=T,this.dropDownItemsService=D,this.storageService=P,this.loading$=this.loadingService.loading$}getProfile(e){return this.loadingService.load(L([this.loadStudent(e),this.loadLegalRepresentatives(e),this.loadApprenticeshipContracts(e)]).pipe(B(Q(this.mapToProfile.bind(this)))))}getMyProfile(){let i=(this.storageService.getPayload()?.roles?.split(";")??[]).includes("StudentRole");return this.loadingService.load(this.personsService.getMyself({context:new w().set($,{disableErrorHandlingForStatus:[403]})}).pipe(B(n=>L([M(n),i?this.loadLegalRepresentatives(n.Id):M([]),i?this.loadApprenticeshipContracts(n.Id):M([]),this.loadStayPermitValue(n.StayPermit)]))).pipe(B(Q(this.mapToProfile.bind(this))),ee(q)))}loadStudent(e){return this.studentService.get(e,{context:new w().set($,{disableErrorHandlingForStatus:[404]})}).pipe(W())}loadLegalRepresentatives(e){return this.studentService.getLegalRepresentatives(e)}loadApprenticeshipContracts(e){return this.studentService.getCurrentApprenticeshipContracts(e,{context:new w().set($,{disableErrorHandlingForStatus:[404]})}).pipe(W([]))}loadStayPermitValue(e){return this.dropDownItemsService.getStayPermits().pipe(V(i=>i.find(n=>n.Key===e)?.Value||null))}mapToProfile(e,i,n,b=null){return e?(i=this.getRelevantLegalRepresentatives(e,i),L([this.loadLegalRepresentativPersons(i),this.loadJobTrainers(n),this.loadApprenticeshipManagers(n)]).pipe(V(([T,D,P])=>this.createProfile(e,b,i,T,n,P,D)))):M(null)}loadLegalRepresentativPersons(e){return e.length===0?M([]):this.personsService.getListForIds(e.map(i=>i.RepresentativeId))}loadJobTrainers(e){let i=e.map(n=>n.JobTrainer).filter(n=>typeof n=="number");return i.length===0?M([]):L(i.map(n=>this.jobTrainersService.get(n)))}loadApprenticeshipManagers(e){let i=e.map(n=>n.ApprenticeshipManagerId);return i.length===0?M([]):L(i.map(n=>this.apprenticeshipManagersService.get(n)))}createProfile(e,i,n,b,T,D,P){return{student:e,stayPermitValue:i||void 0,legalRepresentativePersons:n.map(G=>this.findPerson(G.RepresentativeId,b)).filter(q),apprenticeshipCompanies:T.map(G=>this.createApprenticeshipCompany(G,D,P))}}getRelevantLegalRepresentatives(e,i){let n=ye(e);return i.filter(b=>!n||b.RepresentativeAfterMajority)}createApprenticeshipCompany(e,i,n){return{apprenticeshipContract:e,jobTrainer:this.findPerson(e.JobTrainer,n),apprenticeshipManager:this.findPerson(e.ApprenticeshipManagerId,i)}}findPerson(e,i){return e&&i.find(n=>n.Id===e)||null}static{this.\u0275fac=function(i){return new(i||t)(h(me),h(de),h(xe),h(be),h(ue),h(ce),h(O))}}static{this.\u0275prov=j({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var qt=(()=>{class t{constructor(e,i){this.settings=e,this.storageService=i,this.avatarStyles={}}ngOnChanges(e){e.studentId&&(this.avatarStyles=this.buildAvatarStyles(this.studentId))}buildAvatarStyles(e){return{"background-image":[this.buildAvatarUrl(e),this.fallbackAvatarUrl].map(i=>`url(${i})`).join(", ")}}buildAvatarUrl(e){let i=this.storageService.getAccessToken()||"";return`${this.settings.apiUrl}/Files/personPictures/${e}?token=${i}`}get fallbackAvatarUrl(){return`${this.settings.scriptsAndAssetsPath}/assets/images/avatar-placeholder.png`}static{this.\u0275fac=function(i){return new(i||t)(Z(k),Z(O))}}static{this.\u0275cmp=I({type:t,selectors:[["bkd-avatar"]],inputs:{studentId:"studentId",link:"link",linkParams:"linkParams"},standalone:!0,features:[ne,A],decls:1,vars:5,consts:[[1,"avatar",3,"routerLink","queryParams","ngStyle"]],template:function(i,n){i&1&&s(0,"a",0),i&2&&(ae("disabled",!n.link),ie("routerLink",n.link)("queryParams",n.linkParams)("ngStyle",n.avatarStyles))},dependencies:[pe,re],styles:["[_nghost-%COMP%]{display:flex}.small[_nghost-%COMP%]{width:40px;min-width:40px;height:50px}.medium[_nghost-%COMP%]{width:58px;min-width:58px;height:75px}.large[_nghost-%COMP%]{width:100px;min-width:100px;height:130px}.avatar[_ngcontent-%COMP%]{flex:1;border:1px solid rgba(0,0,0,.25);background-repeat:no-repeat;background-size:cover;background-position:center}a.disabled[_ngcontent-%COMP%]{pointer-events:none;cursor:default}"]})}}return t})();export{$t as a,Xe as b,pt as c,ct as d,qt as e}; diff --git a/public/apps/webapp-schulverwaltung/chunk-DWOSXMEJ.js b/public/apps/webapp-schulverwaltung/chunk-6Q3B2ZQ3.js similarity index 99% rename from public/apps/webapp-schulverwaltung/chunk-DWOSXMEJ.js rename to public/apps/webapp-schulverwaltung/chunk-6Q3B2ZQ3.js index 1afcef1e..b1853e1b 100644 --- a/public/apps/webapp-schulverwaltung/chunk-DWOSXMEJ.js +++ b/public/apps/webapp-schulverwaltung/chunk-6Q3B2ZQ3.js @@ -1 +1 @@ -import{a as Le,b as Fe,c as Ve,d as Ne,e as Oe}from"./chunk-7VKKHU7R.js";import"./chunk-2H6IFZM2.js";import{b as De}from"./chunk-7FRZV7VF.js";import"./chunk-OFB4XAK2.js";import"./chunk-VUPOI3TG.js";import{b as Ae,d as Re}from"./chunk-WACRWBCS.js";import"./chunk-YUHFF3NM.js";import{a as Z}from"./chunk-NL5E3FC5.js";import{a as $e}from"./chunk-YD3RJIHU.js";import{b as Be}from"./chunk-KK2SHN2W.js";import{a as Se,b as Pe,c as Me,d as we,e as Ee,u as Te}from"./chunk-AP373D4K.js";import{a as ke}from"./chunk-B6WYZ7BT.js";import{$c as fe,Ab as g,B as X,F as W,Gb as a,Ha as u,Hb as s,Ib as k,Id as Ie,J as ee,Jd as L,Kd as F,La as re,M as H,Ma as y,Na as ae,O as te,P as T,Ra as _,Ta as Y,Ua as $,Va as B,Wa as r,X as ie,Xa as o,Ya as c,Zb as D,_ as ne,_b as U,aa as x,ab as E,bd as ue,cb as w,cd as _e,db as m,dd as ye,g as R,gb as A,h as J,ha as oe,hd as ve,ia as P,ja as M,l as G,ld as Ce,m as K,mb as S,md as he,n as I,nb as l,ob as C,pb as f,qb as le,rb as pe,sc as se,tc as me,td as xe,uc as ce,ud as ge,vd as be,wa as n,wb as O,x as Q,xa as b,xb as j,yb as v,zb as de}from"./chunk-IFJN5CDK.js";var q="no_access",N=(()=>{class e{constructor(t){this.profileService=t,this.reset$=new R(void 0),this.rawProfile$=this.reset$.pipe(T(()=>this.loadProfile()),H(1)),this.profile$=this.rawProfile$.pipe(I(i=>i===q?null:i)),this.noAccess$=this.rawProfile$.pipe(I(i=>i===q)),this.loading$=this.profileService.loading$}reset(){this.reset$.next()}loadProfile(){return this.profileService.getMyProfile().pipe(X(t=>t.status===403?G(q):K(()=>t)))}static{this.\u0275fac=function(i){return new(i||e)(ne(Le))}}static{this.\u0275prov=ie({token:e,factory:e.\u0275fac})}}return e})();function Ke(e,d){if(e&1&&(r(0,"div"),l(1),o()),e&2){m(2);let t=v(2);n(),f(" ",t.AddressLine2," ")}}function Qe(e,d){if(e&1&&(r(0,"div",5),l(1),a(2,"translate"),o()),e&2){let t=d.$implicit;n(),f(" ",k(2,1,"global.validation-errors."+t.error,t.params)," ")}}function Xe(e,d){if(e&1&&(r(0,"div",13),l(1),a(2,"translate"),o()),e&2){let t=d.$implicit;n(),f(" ",k(2,1,"global.validation-errors."+t.error,t.params)," ")}}function et(e,d){e&1&&(r(0,"div",18)(1,"span",19),l(2,"Loading..."),o()())}function tt(e,d){if(e&1){let t=E();r(0,"form",2),w("ngSubmit",function(){P(t);let p=m();return M(p.onSubmit())}),r(1,"div",3)(2,"p"),l(3),a(4,"translate"),o(),r(5,"address",4)(6,"div"),l(7),o(),u(8,Ke,2,1,"div"),r(9,"div"),l(10),o()()(),$(11,Qe,3,4,"div",5,Y),a(13,"async"),r(14,"div",3)(15,"label",6),l(16),a(17,"translate"),o(),c(18,"input",7),o(),r(19,"div",3)(20,"label",8),l(21),a(22,"translate"),o(),c(23,"input",9),r(24,"small",10),l(25),a(26,"translate"),o()(),r(27,"div",3)(28,"label",11),l(29),a(30,"translate"),o(),c(31,"input",12),a(32,"async"),$(33,Xe,3,4,"div",13,Y),a(35,"async"),r(36,"small",14),l(37),a(38,"translate"),o()(),r(39,"div",15)(40,"button",16),a(41,"async"),w("click",function(){P(t);let p=m();return M(p.cancel())}),l(42),a(43,"translate"),o(),r(44,"button",17),a(45,"async"),l(46),a(47,"translate"),u(48,et,3,0,"div",18),a(49,"async"),o()()()}if(e&2){let t,i=m(),p=v(0),h=v(2);y("formGroup",p),n(3),C(s(4,18,"my-profile.edit.address-changes-remark")),n(4),C(h.AddressLine1),n(),_(h.AddressLine2?8:-1),n(2),le("",h.Zip||""," ",h.Location,""),n(),B(s(13,20,i.formErrors$)),n(5),f(" ",s(17,22,"my-profile.edit.fields.phone-private")," "),n(5),f(" ",s(22,24,"my-profile.edit.fields.phone-mobile")," "),n(4),C(s(26,26,"my-profile.edit.fields.phone-mobile-hint")),n(4),f(" ",s(30,28,"my-profile.edit.fields.email2")," "),n(2),ae("is-invalid",((t=(t=s(32,30,i.email2Errors$))==null?null:t.length)!==null&&t!==void 0?t:0)>0),n(2),B(s(35,32,i.email2Errors$)),n(4),C(s(38,34,"my-profile.edit.fields.email2-hint")),n(3),y("disabled",s(41,36,i.saving$)),n(2),f(" ",s(43,38,"my-profile.edit.cancel")," "),n(2),y("disabled",s(45,40,i.saving$)),n(2),f(" ",s(47,42,"my-profile.edit.save")," "),n(2),_(s(49,44,i.saving$)?48:-1)}}var He=(()=>{class e{constructor(t,i,p,h,z,qe){this.fb=t,this.router=i,this.toastService=p,this.translate=h,this.profileService=z,this.personsService=qe,this.student$=this.profileService.profile$.pipe(Q(Te),I(({student:Je})=>Je)),this.formGroup$=this.student$.pipe(I(this.createFormGroup.bind(this)),H(1)),this.saving$=new R(!1),this.submitted$=new R(!1),this.formErrors$=Z(this.formGroup$,this.submitted$),this.email2Errors$=Z(this.formGroup$,this.submitted$,"email2")}cancel(){this.navigateBack()}onSubmit(){this.submitted$.next(!0),this.formGroup$.pipe(W(1)).subscribe(t=>{if(t.valid){let{phonePrivate:i,phoneMobile:p,email2:h}=t.value;this.save(i?.trim()||null,p?.trim()||null,h||null)}})}createFormGroup(t){return this.fb.group({phonePrivate:[t.PhonePrivate],phoneMobile:[t.PhoneMobile],email2:[t.Email2,ue.email]})}save(t,i,p){this.saving$.next(!0),this.student$.pipe(W(1),T(h=>this.personsService.update(h.Id,t,i,p)),ee(()=>this.saving$.next(!1))).subscribe(this.onSaveSuccess.bind(this))}onSaveSuccess(){this.profileService.reset(),this.toastService.success(this.translate.instant("my-profile.edit.save-success")),this.navigateBack()}navigateBack(){this.router.navigate(["/my-profile"])}static{this.\u0275fac=function(i){return new(i||e)(b(xe),b(me),b(ke),b(Ie),b(N),b(De))}}static{this.\u0275cmp=x({type:e,selectors:[["bkd-my-profile-edit"]],standalone:!0,features:[g],decls:9,vars:10,consts:[[1,"bkd-container","bkd-container-limited"],[3,"formGroup"],[3,"ngSubmit","formGroup"],[1,"mb-3"],[1,"text-muted"],[1,"alert","alert-danger"],["id","my-profile-phone-private",1,"form-label"],["id","my-profile-phone-private","formControlName","phonePrivate","type","tel",1,"form-control"],["id","my-profile-phone-mobile",1,"form-label"],["id","my-profile-phone-mobile","formControlName","phoneMobile","type","tel","aria-describedby","my-profile-phone-mobile-hint",1,"form-control"],["id","my-profile-phone-mobile-hint",1,"form-text"],["for","my-profile-email2",1,"form-label"],["id","my-profile-email2","formControlName","email2","type","email","aria-describedby","my-profile-email2-hint",1,"form-control"],[1,"invalid-feedback"],["id","my-profile-email2-hint",1,"form-text"],[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"],[1,"visually-hidden"]],template:function(i,p){if(i&1&&(O(0),a(1,"async"),O(2),a(3,"async"),r(4,"div",0)(5,"h1"),l(6),a(7,"translate"),o(),u(8,tt,50,46,"form",1),o()),i&2){let h=j(s(1,2,p.formGroup$));n(2);let z=j(s(3,5,p.student$));n(4),C(s(7,8,"my-profile.edit.title")),n(2),_(h&&z?8:-1)}},dependencies:[ge,ve,fe,_e,ye,be,Ce,he,D,F,L],changeDetection:0})}}return e})();var Ue=(()=>{class e{constructor(){}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=x({type:e,selectors:[["bkd-my-profile-address"]],inputs:{address:"address"},standalone:!0,features:[g],decls:2,vars:1,template:function(i,p){i&1&&(r(0,"address"),l(1),o()),i&2&&(n(),C(p.address))},styles:["[_nghost-%COMP%]{padding:1rem}address[_ngcontent-%COMP%]{white-space:pre-wrap}"],changeDetection:0})}}return e})();var ze=(()=>{class e{constructor(){}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=x({type:e,selectors:[["bkd-my-profile-entry"]],inputs:{label:"label",value:"value"},standalone:!0,features:[g],decls:6,vars:4,consts:[[1,"row"],[1,"col-md-6"]],template:function(i,p){i&1&&(r(0,"dl",0)(1,"dt",1),l(2),a(3,"translate"),o(),r(4,"dd",1),l(5),o()()),i&2&&(n(2),C(s(3,2,p.label)),n(3),C(p.value))},dependencies:[F,L],styles:["dl[_ngcontent-%COMP%]{padding:0 1rem}dt[_ngcontent-%COMP%]{font-weight:400;color:#00000080}"],changeDetection:0})}}return e})();function it(e,d){if(e&1&&(r(0,"span"),l(1),o()),e&2){let t=m(2);n(),f("(",t.student.Gender,")")}}function nt(e,d){if(e&1&&(r(0,"div",0)(1,"div",2),c(2,"bkd-avatar",3),r(3,"div",4),l(4),u(5,it,2,1,"span"),r(6,"div",5),l(7),a(8,"date"),o()()(),c(9,"bkd-reports-link",6),a(10,"async"),o()),e&2){let t=m();n(2),y("studentId",t.student.Id),n(2),pe(" ",t.student.LastName," ",t.student.FirstName," ",t.student.MiddleName," "),n(),_(t.student.Gender?5:-1),n(2),f(" ",k(8,7,t.student.Birthdate,"dd.MM.yyyy")," "),n(2),y("reports",s(10,10,t.reports$))}}function ot(e,d){if(e&1&&(r(0,"div",1),l(1),o()),e&2){let t=m();n(),C(t.student.Email)}}var We=(()=>{class e{constructor(t){this.reportsService=t,this.studentId$=new J(1),this.reports$=this.studentId$.pipe(T(i=>i?this.reportsService.getPersonMasterDataReports(i):G([])),te([]))}ngOnChanges(t){t.student&&this.studentId$.next(t.student.currentValue?.Id||null)}static{this.\u0275fac=function(i){return new(i||e)(b(Re))}}static{this.\u0275cmp=x({type:e,selectors:[["bkd-my-profile-header"]],inputs:{student:"student"},standalone:!0,features:[oe,g],decls:2,vars:2,consts:[[1,"avatar-person"],[1,"email"],[1,"d-flex"],[1,"me-3","avatar","large",3,"studentId"],[1,"person"],[1,"birthdate"],[3,"reports"]],template:function(i,p){i&1&&u(0,nt,11,12,"div",0)(1,ot,2,1,"div",1),i&2&&(_(p.student?0:-1),n(),_(p.student?1:-1))},dependencies:[Oe,$e,D,U],styles:[".avatar-person[_ngcontent-%COMP%]{display:flex;justify-content:space-between;padding-left:1rem 1rem 1rem 0}.person[_ngcontent-%COMP%]{align-self:center}.email[_ngcontent-%COMP%]{padding:1rem 1rem 0 0}.report[_ngcontent-%COMP%]{align-self:flex-start;line-height:1}"],changeDetection:0})}}return e})();var rt=(e,d)=>d.apprenticeshipContract.Id,at=(e,d)=>d.Id;function lt(e,d){e&1&&c(0,"bkd-spinner")}function pt(e,d){e&1&&(r(0,"p",7),l(1),a(2,"translate"),o()),e&2&&(n(),f(" ",s(2,1,"shared.profile.substitution-profile")," "))}function dt(e,d){e&1&&(r(0,"p",8),l(1),a(2,"translate"),o()),e&2&&(n(),f(" ",s(2,1,"shared.profile.no-profile")," "))}function st(e,d){if(e&1&&(u(0,pt,3,3,"p",7),a(1,"async"),u(2,dt,3,3,"p",8)),e&2){let t=m();_(s(1,1,t.profileService.noAccess$)?0:2)}}function mt(e,d){if(e&1&&c(0,"bkd-my-profile-entry",12),e&2){m(2);let t=v(0);A("value",t.student.SocialSecurityNumber)}}function ct(e,d){if(e&1&&c(0,"bkd-my-profile-entry",13),e&2){m(2);let t=v(0);A("value",t.student.HomeTown||t.student.Nationality)}}function ft(e,d){if(e&1&&c(0,"bkd-my-profile-entry",14),e&2){m(2);let t=v(0);A("value",t.student.NativeLanguage)}}function ut(e,d){if(e&1&&c(0,"bkd-my-profile-entry",15),e&2){m(2);let t=v(0);A("value",t.stayPermitValue)}}function _t(e,d){if(e&1&&(c(0,"bkd-my-profile-entry",16),a(1,"date")),e&2){m(2);let t=v(0);A("value",k(1,1,t.student.StayPermitExpiry,"mediumDate"))}}function yt(e,d){if(e&1&&(r(0,"div",24)(1,"a",25),a(2,"translate"),r(3,"i",26),l(4,"edit"),o()(),c(5,"bkd-student-dossier-address",27),o()),e&2){m(2);let t=v(0);n(),re("aria-label",s(2,2,"my-profile.edit.title")),n(4),y("student",t.student)}}function vt(e,d){if(e&1&&c(0,"bkd-my-profile-address",28),e&2){m(3);let t=v(0);y("address",t.student.CorrespondenceAddress)}}function Ct(e,d){if(e&1){let t=E();r(0,"div",18,1)(2,"div",19)(3,"bkd-student-dossier-entry-header",20),w("click",function(){P(t);let p=S(1);return M(p.toggle())}),l(4),a(5,"translate"),o()(),r(6,"div",21)(7,"div",22),u(8,vt,1,1,"ng-template"),o()()()}if(e&2){let t=S(1);n(3),y("opened",!t.collapsed),n(),f(" ",s(5,2,"shared.profile.correspondence-address")," ")}}function ht(e,d){if(e&1&&c(0,"bkd-my-profile-address",28),e&2){m(3);let t=v(0);y("address",t.student.BillingAddress)}}function xt(e,d){if(e&1){let t=E();r(0,"div",18,2)(2,"div",19)(3,"bkd-student-dossier-entry-header",20),w("click",function(){P(t);let p=S(1);return M(p.toggle())}),l(4),a(5,"translate"),o()(),r(6,"div",21)(7,"div",22),u(8,ht,1,1,"ng-template"),o()()()}if(e&2){let t=S(1);n(3),y("opened",!t.collapsed),n(),f(" ",s(5,2,"shared.profile.billing-address")," ")}}function gt(e,d){if(e&1&&c(0,"bkd-student-dossier-legal-representative",29),e&2){let t=d.$implicit;y("person",t)}}function bt(e,d){if(e&1&&$(0,gt,1,1,"bkd-student-dossier-legal-representative",29,at),e&2){m(3);let t=v(0);B(t.legalRepresentativePersons)}}function St(e,d){if(e&1){let t=E();r(0,"div",18,3)(2,"div",19)(3,"bkd-student-dossier-entry-header",20),w("click",function(){P(t);let p=S(1);return M(p.toggle())}),l(4),a(5,"translate"),o()(),r(6,"div",21)(7,"div",22),u(8,bt,2,0,"ng-template"),o()()()}if(e&2){let t=S(1);n(3),y("opened",!t.collapsed),n(),f(" ",s(5,2,"shared.profile.legal-representation")," ")}}function Pt(e,d){if(e&1&&l(0),e&2){let t=m().$index;f(" ",t+1," ")}}function Mt(e,d){if(e&1&&c(0,"bkd-student-dossier-apprenticeship-company",30),e&2){let t=m().$implicit;y("company",t)}}function wt(e,d){if(e&1){let t=E();r(0,"div",23,4)(2,"div",19)(3,"bkd-student-dossier-entry-header",20),w("click",function(){P(t);let p=S(1);return M(p.toggle())}),l(4),a(5,"translate"),u(6,Pt,1,1),o()(),r(7,"div",21)(8,"div",22),u(9,Mt,1,1,"ng-template"),o()()()}if(e&2){let t=S(1);m(2);let i=v(0);n(3),y("opened",!t.collapsed),n(),f(" ",s(5,3,"shared.profile.apprenticeship-company")," "),n(2),_(i.apprenticeshipCompanies.length>1?6:-1)}}function Et(e,d){if(e&1){let t=E();c(0,"bkd-my-profile-header",9),r(1,"div",10)(2,"div",11),u(3,mt,1,1,"bkd-my-profile-entry",12)(4,ct,1,1,"bkd-my-profile-entry",13)(5,ft,1,1,"bkd-my-profile-entry",14)(6,ut,1,1,"bkd-my-profile-entry",15)(7,_t,2,4,"bkd-my-profile-entry",16),o(),r(8,"div",17)(9,"div",18,0)(11,"div",19)(12,"bkd-student-dossier-entry-header",20),w("click",function(){P(t);let p=S(10);return M(p.toggle())}),l(13),a(14,"translate"),o()(),r(15,"div",21)(16,"div",22),u(17,yt,6,4,"ng-template"),o()()(),u(18,Ct,9,4,"div",18)(19,xt,9,4,"div",18)(20,St,9,4,"div",18),$(21,wt,10,5,"div",23,rt),o()()}if(e&2){let t=S(10);m();let i=v(0);y("student",i.student),n(3),_(i.student.SocialSecurityNumber?3:-1),n(),_(i.student.HomeTown||i.student.Nationality?4:-1),n(),_(i.student.NativeLanguage?5:-1),n(),_(i.stayPermitValue?6:-1),n(),_(i.student.StayPermitExpiry?7:-1),n(5),y("opened",!t.collapsed),n(),f(" ",s(14,11,"shared.profile.student-address")," "),n(5),_(i.student.CorrespondenceAddress?18:-1),n(),_(i.student.BillingAddress?19:-1),n(),_(i.legalRepresentativePersons.length>0?20:-1),n(),B(i.apprenticeshipCompanies)}}var Ye=(()=>{class e{constructor(t){this.profileService=t}static{this.\u0275fac=function(i){return new(i||e)(b(N))}}static{this.\u0275cmp=x({type:e,selectors:[["bkd-my-profile-show"]],standalone:!0,features:[g],decls:10,vars:9,consts:[["studentAddress","ngbAccordionItem"],["correspondenceAddress","ngbAccordionItem"],["billingAddress","ngbAccordionItem"],["legalRepresentatives","ngbAccordionItem"],["apprenticeshipCompanies","ngbAccordionItem"],[1,"bkd-container","bkd-container-limited"],["data-testid","profile-title"],["data-testid","profile-substitution"],["data-testid","profile-none"],[3,"student"],["data-testid","profile-content",1,"profile-content"],[1,"profile-entries","pt-3"],["label","my-profile.show.social-security-number",3,"value"],["label","my-profile.show.hometown-nationality",3,"value"],["label","my-profile.show.native-language",3,"value"],["label","my-profile.show.stay-permit",3,"value"],["label","my-profile.show.stay-permit-expiry",3,"value"],["ngbAccordion",""],["ngbAccordionItem",""],["ngbAccordionHeader",""],[3,"click","opened"],["ngbAccordionCollapse",""],["ngbAccordionBody",""],[3,"ngbAccordionItem"],[1,"clearfix"],["routerLink","edit",1,"btn","btn-primary","btn-icon","float-end","me-2"],[1,"material-icons"],["emailProperty","Email2",1,"profile-entry",3,"student"],[1,"profile-entry",3,"address"],[1,"profile-entry",3,"person"],[1,"profile-entry",3,"company"]],template:function(i,p){if(i&1&&(O(0),a(1,"async"),r(2,"div",5)(3,"h1",6),l(4),a(5,"translate"),o(),u(6,lt,1,0,"bkd-spinner"),a(7,"async"),u(8,st,3,3)(9,Et,23,13),o()),i&2){let h=j(s(1,2,p.profileService.profile$));n(4),C(s(5,5,"my-profile.title")),n(2),_(s(7,7,p.profileService.loading$)?6:h?9:8)}},dependencies:[We,ze,Ee,we,Me,Ae,Pe,Se,ce,Fe,Ue,Ne,Ve,Be,D,U,F,L],styles:[".profile-content[_ngcontent-%COMP%]{padding-top:1rem}.profile-entry[_ngcontent-%COMP%]{display:block;padding:0 1rem}.profile-entries[_ngcontent-%COMP%]:not(:empty){border-top:1px solid rgb(222,222,222)}"],changeDetection:0})}}return e})();var Ze=(()=>{class e{constructor(){}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=x({type:e,selectors:[["bkd-my-profile"]],standalone:!0,features:[de([N]),g],decls:1,vars:0,template:function(i,p){i&1&&c(0,"router-outlet")},dependencies:[se],changeDetection:0})}}return e})();var Ci=[{path:"",component:Ze,children:[{path:"",component:Ye},{path:"edit",component:He}]}];export{Ci as MY_PROFILE_ROUTES}; +import{a as Le,b as Fe,c as Ve,d as Ne,e as Oe}from"./chunk-4YGUAC2V.js";import"./chunk-2H6IFZM2.js";import{b as De}from"./chunk-7FRZV7VF.js";import"./chunk-OFB4XAK2.js";import"./chunk-VUPOI3TG.js";import{b as Ae,d as Re}from"./chunk-WACRWBCS.js";import"./chunk-YUHFF3NM.js";import{a as Z}from"./chunk-NL5E3FC5.js";import{a as $e}from"./chunk-YD3RJIHU.js";import{b as Be}from"./chunk-KK2SHN2W.js";import{a as Se,b as Pe,c as Me,d as we,e as Ee,u as Te}from"./chunk-AP373D4K.js";import{a as ke}from"./chunk-B6WYZ7BT.js";import{$c as fe,Ab as g,B as X,F as W,Gb as a,Ha as u,Hb as s,Ib as k,Id as Ie,J as ee,Jd as L,Kd as F,La as re,M as H,Ma as y,Na as ae,O as te,P as T,Ra as _,Ta as Y,Ua as $,Va as B,Wa as r,X as ie,Xa as o,Ya as c,Zb as D,_ as ne,_b as U,aa as x,ab as E,bd as ue,cb as w,cd as _e,db as m,dd as ye,g as R,gb as A,h as J,ha as oe,hd as ve,ia as P,ja as M,l as G,ld as Ce,m as K,mb as S,md as he,n as I,nb as l,ob as C,pb as f,qb as le,rb as pe,sc as se,tc as me,td as xe,uc as ce,ud as ge,vd as be,wa as n,wb as O,x as Q,xa as b,xb as j,yb as v,zb as de}from"./chunk-IFJN5CDK.js";var q="no_access",N=(()=>{class e{constructor(t){this.profileService=t,this.reset$=new R(void 0),this.rawProfile$=this.reset$.pipe(T(()=>this.loadProfile()),H(1)),this.profile$=this.rawProfile$.pipe(I(i=>i===q?null:i)),this.noAccess$=this.rawProfile$.pipe(I(i=>i===q)),this.loading$=this.profileService.loading$}reset(){this.reset$.next()}loadProfile(){return this.profileService.getMyProfile().pipe(X(t=>t.status===403?G(q):K(()=>t)))}static{this.\u0275fac=function(i){return new(i||e)(ne(Le))}}static{this.\u0275prov=ie({token:e,factory:e.\u0275fac})}}return e})();function Ke(e,d){if(e&1&&(r(0,"div"),l(1),o()),e&2){m(2);let t=v(2);n(),f(" ",t.AddressLine2," ")}}function Qe(e,d){if(e&1&&(r(0,"div",5),l(1),a(2,"translate"),o()),e&2){let t=d.$implicit;n(),f(" ",k(2,1,"global.validation-errors."+t.error,t.params)," ")}}function Xe(e,d){if(e&1&&(r(0,"div",13),l(1),a(2,"translate"),o()),e&2){let t=d.$implicit;n(),f(" ",k(2,1,"global.validation-errors."+t.error,t.params)," ")}}function et(e,d){e&1&&(r(0,"div",18)(1,"span",19),l(2,"Loading..."),o()())}function tt(e,d){if(e&1){let t=E();r(0,"form",2),w("ngSubmit",function(){P(t);let p=m();return M(p.onSubmit())}),r(1,"div",3)(2,"p"),l(3),a(4,"translate"),o(),r(5,"address",4)(6,"div"),l(7),o(),u(8,Ke,2,1,"div"),r(9,"div"),l(10),o()()(),$(11,Qe,3,4,"div",5,Y),a(13,"async"),r(14,"div",3)(15,"label",6),l(16),a(17,"translate"),o(),c(18,"input",7),o(),r(19,"div",3)(20,"label",8),l(21),a(22,"translate"),o(),c(23,"input",9),r(24,"small",10),l(25),a(26,"translate"),o()(),r(27,"div",3)(28,"label",11),l(29),a(30,"translate"),o(),c(31,"input",12),a(32,"async"),$(33,Xe,3,4,"div",13,Y),a(35,"async"),r(36,"small",14),l(37),a(38,"translate"),o()(),r(39,"div",15)(40,"button",16),a(41,"async"),w("click",function(){P(t);let p=m();return M(p.cancel())}),l(42),a(43,"translate"),o(),r(44,"button",17),a(45,"async"),l(46),a(47,"translate"),u(48,et,3,0,"div",18),a(49,"async"),o()()()}if(e&2){let t,i=m(),p=v(0),h=v(2);y("formGroup",p),n(3),C(s(4,18,"my-profile.edit.address-changes-remark")),n(4),C(h.AddressLine1),n(),_(h.AddressLine2?8:-1),n(2),le("",h.Zip||""," ",h.Location,""),n(),B(s(13,20,i.formErrors$)),n(5),f(" ",s(17,22,"my-profile.edit.fields.phone-private")," "),n(5),f(" ",s(22,24,"my-profile.edit.fields.phone-mobile")," "),n(4),C(s(26,26,"my-profile.edit.fields.phone-mobile-hint")),n(4),f(" ",s(30,28,"my-profile.edit.fields.email2")," "),n(2),ae("is-invalid",((t=(t=s(32,30,i.email2Errors$))==null?null:t.length)!==null&&t!==void 0?t:0)>0),n(2),B(s(35,32,i.email2Errors$)),n(4),C(s(38,34,"my-profile.edit.fields.email2-hint")),n(3),y("disabled",s(41,36,i.saving$)),n(2),f(" ",s(43,38,"my-profile.edit.cancel")," "),n(2),y("disabled",s(45,40,i.saving$)),n(2),f(" ",s(47,42,"my-profile.edit.save")," "),n(2),_(s(49,44,i.saving$)?48:-1)}}var He=(()=>{class e{constructor(t,i,p,h,z,qe){this.fb=t,this.router=i,this.toastService=p,this.translate=h,this.profileService=z,this.personsService=qe,this.student$=this.profileService.profile$.pipe(Q(Te),I(({student:Je})=>Je)),this.formGroup$=this.student$.pipe(I(this.createFormGroup.bind(this)),H(1)),this.saving$=new R(!1),this.submitted$=new R(!1),this.formErrors$=Z(this.formGroup$,this.submitted$),this.email2Errors$=Z(this.formGroup$,this.submitted$,"email2")}cancel(){this.navigateBack()}onSubmit(){this.submitted$.next(!0),this.formGroup$.pipe(W(1)).subscribe(t=>{if(t.valid){let{phonePrivate:i,phoneMobile:p,email2:h}=t.value;this.save(i?.trim()||null,p?.trim()||null,h||null)}})}createFormGroup(t){return this.fb.group({phonePrivate:[t.PhonePrivate],phoneMobile:[t.PhoneMobile],email2:[t.Email2,ue.email]})}save(t,i,p){this.saving$.next(!0),this.student$.pipe(W(1),T(h=>this.personsService.update(h.Id,t,i,p)),ee(()=>this.saving$.next(!1))).subscribe(this.onSaveSuccess.bind(this))}onSaveSuccess(){this.profileService.reset(),this.toastService.success(this.translate.instant("my-profile.edit.save-success")),this.navigateBack()}navigateBack(){this.router.navigate(["/my-profile"])}static{this.\u0275fac=function(i){return new(i||e)(b(xe),b(me),b(ke),b(Ie),b(N),b(De))}}static{this.\u0275cmp=x({type:e,selectors:[["bkd-my-profile-edit"]],standalone:!0,features:[g],decls:9,vars:10,consts:[[1,"bkd-container","bkd-container-limited"],[3,"formGroup"],[3,"ngSubmit","formGroup"],[1,"mb-3"],[1,"text-muted"],[1,"alert","alert-danger"],["id","my-profile-phone-private",1,"form-label"],["id","my-profile-phone-private","formControlName","phonePrivate","type","tel",1,"form-control"],["id","my-profile-phone-mobile",1,"form-label"],["id","my-profile-phone-mobile","formControlName","phoneMobile","type","tel","aria-describedby","my-profile-phone-mobile-hint",1,"form-control"],["id","my-profile-phone-mobile-hint",1,"form-text"],["for","my-profile-email2",1,"form-label"],["id","my-profile-email2","formControlName","email2","type","email","aria-describedby","my-profile-email2-hint",1,"form-control"],[1,"invalid-feedback"],["id","my-profile-email2-hint",1,"form-text"],[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"],[1,"visually-hidden"]],template:function(i,p){if(i&1&&(O(0),a(1,"async"),O(2),a(3,"async"),r(4,"div",0)(5,"h1"),l(6),a(7,"translate"),o(),u(8,tt,50,46,"form",1),o()),i&2){let h=j(s(1,2,p.formGroup$));n(2);let z=j(s(3,5,p.student$));n(4),C(s(7,8,"my-profile.edit.title")),n(2),_(h&&z?8:-1)}},dependencies:[ge,ve,fe,_e,ye,be,Ce,he,D,F,L],changeDetection:0})}}return e})();var Ue=(()=>{class e{constructor(){}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=x({type:e,selectors:[["bkd-my-profile-address"]],inputs:{address:"address"},standalone:!0,features:[g],decls:2,vars:1,template:function(i,p){i&1&&(r(0,"address"),l(1),o()),i&2&&(n(),C(p.address))},styles:["[_nghost-%COMP%]{padding:1rem}address[_ngcontent-%COMP%]{white-space:pre-wrap}"],changeDetection:0})}}return e})();var ze=(()=>{class e{constructor(){}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=x({type:e,selectors:[["bkd-my-profile-entry"]],inputs:{label:"label",value:"value"},standalone:!0,features:[g],decls:6,vars:4,consts:[[1,"row"],[1,"col-md-6"]],template:function(i,p){i&1&&(r(0,"dl",0)(1,"dt",1),l(2),a(3,"translate"),o(),r(4,"dd",1),l(5),o()()),i&2&&(n(2),C(s(3,2,p.label)),n(3),C(p.value))},dependencies:[F,L],styles:["dl[_ngcontent-%COMP%]{padding:0 1rem}dt[_ngcontent-%COMP%]{font-weight:400;color:#00000080}"],changeDetection:0})}}return e})();function it(e,d){if(e&1&&(r(0,"span"),l(1),o()),e&2){let t=m(2);n(),f("(",t.student.Gender,")")}}function nt(e,d){if(e&1&&(r(0,"div",0)(1,"div",2),c(2,"bkd-avatar",3),r(3,"div",4),l(4),u(5,it,2,1,"span"),r(6,"div",5),l(7),a(8,"date"),o()()(),c(9,"bkd-reports-link",6),a(10,"async"),o()),e&2){let t=m();n(2),y("studentId",t.student.Id),n(2),pe(" ",t.student.LastName," ",t.student.FirstName," ",t.student.MiddleName," "),n(),_(t.student.Gender?5:-1),n(2),f(" ",k(8,7,t.student.Birthdate,"dd.MM.yyyy")," "),n(2),y("reports",s(10,10,t.reports$))}}function ot(e,d){if(e&1&&(r(0,"div",1),l(1),o()),e&2){let t=m();n(),C(t.student.Email)}}var We=(()=>{class e{constructor(t){this.reportsService=t,this.studentId$=new J(1),this.reports$=this.studentId$.pipe(T(i=>i?this.reportsService.getPersonMasterDataReports(i):G([])),te([]))}ngOnChanges(t){t.student&&this.studentId$.next(t.student.currentValue?.Id||null)}static{this.\u0275fac=function(i){return new(i||e)(b(Re))}}static{this.\u0275cmp=x({type:e,selectors:[["bkd-my-profile-header"]],inputs:{student:"student"},standalone:!0,features:[oe,g],decls:2,vars:2,consts:[[1,"avatar-person"],[1,"email"],[1,"d-flex"],[1,"me-3","avatar","large",3,"studentId"],[1,"person"],[1,"birthdate"],[3,"reports"]],template:function(i,p){i&1&&u(0,nt,11,12,"div",0)(1,ot,2,1,"div",1),i&2&&(_(p.student?0:-1),n(),_(p.student?1:-1))},dependencies:[Oe,$e,D,U],styles:[".avatar-person[_ngcontent-%COMP%]{display:flex;justify-content:space-between;padding-left:1rem 1rem 1rem 0}.person[_ngcontent-%COMP%]{align-self:center}.email[_ngcontent-%COMP%]{padding:1rem 1rem 0 0}.report[_ngcontent-%COMP%]{align-self:flex-start;line-height:1}"],changeDetection:0})}}return e})();var rt=(e,d)=>d.apprenticeshipContract.Id,at=(e,d)=>d.Id;function lt(e,d){e&1&&c(0,"bkd-spinner")}function pt(e,d){e&1&&(r(0,"p",7),l(1),a(2,"translate"),o()),e&2&&(n(),f(" ",s(2,1,"shared.profile.substitution-profile")," "))}function dt(e,d){e&1&&(r(0,"p",8),l(1),a(2,"translate"),o()),e&2&&(n(),f(" ",s(2,1,"shared.profile.no-profile")," "))}function st(e,d){if(e&1&&(u(0,pt,3,3,"p",7),a(1,"async"),u(2,dt,3,3,"p",8)),e&2){let t=m();_(s(1,1,t.profileService.noAccess$)?0:2)}}function mt(e,d){if(e&1&&c(0,"bkd-my-profile-entry",12),e&2){m(2);let t=v(0);A("value",t.student.SocialSecurityNumber)}}function ct(e,d){if(e&1&&c(0,"bkd-my-profile-entry",13),e&2){m(2);let t=v(0);A("value",t.student.HomeTown||t.student.Nationality)}}function ft(e,d){if(e&1&&c(0,"bkd-my-profile-entry",14),e&2){m(2);let t=v(0);A("value",t.student.NativeLanguage)}}function ut(e,d){if(e&1&&c(0,"bkd-my-profile-entry",15),e&2){m(2);let t=v(0);A("value",t.stayPermitValue)}}function _t(e,d){if(e&1&&(c(0,"bkd-my-profile-entry",16),a(1,"date")),e&2){m(2);let t=v(0);A("value",k(1,1,t.student.StayPermitExpiry,"mediumDate"))}}function yt(e,d){if(e&1&&(r(0,"div",24)(1,"a",25),a(2,"translate"),r(3,"i",26),l(4,"edit"),o()(),c(5,"bkd-student-dossier-address",27),o()),e&2){m(2);let t=v(0);n(),re("aria-label",s(2,2,"my-profile.edit.title")),n(4),y("student",t.student)}}function vt(e,d){if(e&1&&c(0,"bkd-my-profile-address",28),e&2){m(3);let t=v(0);y("address",t.student.CorrespondenceAddress)}}function Ct(e,d){if(e&1){let t=E();r(0,"div",18,1)(2,"div",19)(3,"bkd-student-dossier-entry-header",20),w("click",function(){P(t);let p=S(1);return M(p.toggle())}),l(4),a(5,"translate"),o()(),r(6,"div",21)(7,"div",22),u(8,vt,1,1,"ng-template"),o()()()}if(e&2){let t=S(1);n(3),y("opened",!t.collapsed),n(),f(" ",s(5,2,"shared.profile.correspondence-address")," ")}}function ht(e,d){if(e&1&&c(0,"bkd-my-profile-address",28),e&2){m(3);let t=v(0);y("address",t.student.BillingAddress)}}function xt(e,d){if(e&1){let t=E();r(0,"div",18,2)(2,"div",19)(3,"bkd-student-dossier-entry-header",20),w("click",function(){P(t);let p=S(1);return M(p.toggle())}),l(4),a(5,"translate"),o()(),r(6,"div",21)(7,"div",22),u(8,ht,1,1,"ng-template"),o()()()}if(e&2){let t=S(1);n(3),y("opened",!t.collapsed),n(),f(" ",s(5,2,"shared.profile.billing-address")," ")}}function gt(e,d){if(e&1&&c(0,"bkd-student-dossier-legal-representative",29),e&2){let t=d.$implicit;y("person",t)}}function bt(e,d){if(e&1&&$(0,gt,1,1,"bkd-student-dossier-legal-representative",29,at),e&2){m(3);let t=v(0);B(t.legalRepresentativePersons)}}function St(e,d){if(e&1){let t=E();r(0,"div",18,3)(2,"div",19)(3,"bkd-student-dossier-entry-header",20),w("click",function(){P(t);let p=S(1);return M(p.toggle())}),l(4),a(5,"translate"),o()(),r(6,"div",21)(7,"div",22),u(8,bt,2,0,"ng-template"),o()()()}if(e&2){let t=S(1);n(3),y("opened",!t.collapsed),n(),f(" ",s(5,2,"shared.profile.legal-representation")," ")}}function Pt(e,d){if(e&1&&l(0),e&2){let t=m().$index;f(" ",t+1," ")}}function Mt(e,d){if(e&1&&c(0,"bkd-student-dossier-apprenticeship-company",30),e&2){let t=m().$implicit;y("company",t)}}function wt(e,d){if(e&1){let t=E();r(0,"div",23,4)(2,"div",19)(3,"bkd-student-dossier-entry-header",20),w("click",function(){P(t);let p=S(1);return M(p.toggle())}),l(4),a(5,"translate"),u(6,Pt,1,1),o()(),r(7,"div",21)(8,"div",22),u(9,Mt,1,1,"ng-template"),o()()()}if(e&2){let t=S(1);m(2);let i=v(0);n(3),y("opened",!t.collapsed),n(),f(" ",s(5,3,"shared.profile.apprenticeship-company")," "),n(2),_(i.apprenticeshipCompanies.length>1?6:-1)}}function Et(e,d){if(e&1){let t=E();c(0,"bkd-my-profile-header",9),r(1,"div",10)(2,"div",11),u(3,mt,1,1,"bkd-my-profile-entry",12)(4,ct,1,1,"bkd-my-profile-entry",13)(5,ft,1,1,"bkd-my-profile-entry",14)(6,ut,1,1,"bkd-my-profile-entry",15)(7,_t,2,4,"bkd-my-profile-entry",16),o(),r(8,"div",17)(9,"div",18,0)(11,"div",19)(12,"bkd-student-dossier-entry-header",20),w("click",function(){P(t);let p=S(10);return M(p.toggle())}),l(13),a(14,"translate"),o()(),r(15,"div",21)(16,"div",22),u(17,yt,6,4,"ng-template"),o()()(),u(18,Ct,9,4,"div",18)(19,xt,9,4,"div",18)(20,St,9,4,"div",18),$(21,wt,10,5,"div",23,rt),o()()}if(e&2){let t=S(10);m();let i=v(0);y("student",i.student),n(3),_(i.student.SocialSecurityNumber?3:-1),n(),_(i.student.HomeTown||i.student.Nationality?4:-1),n(),_(i.student.NativeLanguage?5:-1),n(),_(i.stayPermitValue?6:-1),n(),_(i.student.StayPermitExpiry?7:-1),n(5),y("opened",!t.collapsed),n(),f(" ",s(14,11,"shared.profile.student-address")," "),n(5),_(i.student.CorrespondenceAddress?18:-1),n(),_(i.student.BillingAddress?19:-1),n(),_(i.legalRepresentativePersons.length>0?20:-1),n(),B(i.apprenticeshipCompanies)}}var Ye=(()=>{class e{constructor(t){this.profileService=t}static{this.\u0275fac=function(i){return new(i||e)(b(N))}}static{this.\u0275cmp=x({type:e,selectors:[["bkd-my-profile-show"]],standalone:!0,features:[g],decls:10,vars:9,consts:[["studentAddress","ngbAccordionItem"],["correspondenceAddress","ngbAccordionItem"],["billingAddress","ngbAccordionItem"],["legalRepresentatives","ngbAccordionItem"],["apprenticeshipCompanies","ngbAccordionItem"],[1,"bkd-container","bkd-container-limited"],["data-testid","profile-title"],["data-testid","profile-substitution"],["data-testid","profile-none"],[3,"student"],["data-testid","profile-content",1,"profile-content"],[1,"profile-entries","pt-3"],["label","my-profile.show.social-security-number",3,"value"],["label","my-profile.show.hometown-nationality",3,"value"],["label","my-profile.show.native-language",3,"value"],["label","my-profile.show.stay-permit",3,"value"],["label","my-profile.show.stay-permit-expiry",3,"value"],["ngbAccordion",""],["ngbAccordionItem",""],["ngbAccordionHeader",""],[3,"click","opened"],["ngbAccordionCollapse",""],["ngbAccordionBody",""],[3,"ngbAccordionItem"],[1,"clearfix"],["routerLink","edit",1,"btn","btn-primary","btn-icon","float-end","me-2"],[1,"material-icons"],["emailProperty","Email2",1,"profile-entry",3,"student"],[1,"profile-entry",3,"address"],[1,"profile-entry",3,"person"],[1,"profile-entry",3,"company"]],template:function(i,p){if(i&1&&(O(0),a(1,"async"),r(2,"div",5)(3,"h1",6),l(4),a(5,"translate"),o(),u(6,lt,1,0,"bkd-spinner"),a(7,"async"),u(8,st,3,3)(9,Et,23,13),o()),i&2){let h=j(s(1,2,p.profileService.profile$));n(4),C(s(5,5,"my-profile.title")),n(2),_(s(7,7,p.profileService.loading$)?6:h?9:8)}},dependencies:[We,ze,Ee,we,Me,Ae,Pe,Se,ce,Fe,Ue,Ne,Ve,Be,D,U,F,L],styles:[".profile-content[_ngcontent-%COMP%]{padding-top:1rem}.profile-entry[_ngcontent-%COMP%]{display:block;padding:0 1rem}.profile-entries[_ngcontent-%COMP%]:not(:empty){border-top:1px solid rgb(222,222,222)}"],changeDetection:0})}}return e})();var Ze=(()=>{class e{constructor(){}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=x({type:e,selectors:[["bkd-my-profile"]],standalone:!0,features:[de([N]),g],decls:1,vars:0,template:function(i,p){i&1&&c(0,"router-outlet")},dependencies:[se],changeDetection:0})}}return e})();var Ci=[{path:"",component:Ze,children:[{path:"",component:Ye},{path:"edit",component:He}]}];export{Ci as MY_PROFILE_ROUTES}; diff --git a/public/apps/webapp-schulverwaltung/chunk-DRZ46FDG.js b/public/apps/webapp-schulverwaltung/chunk-7KWP4GRQ.js similarity index 99% rename from public/apps/webapp-schulverwaltung/chunk-DRZ46FDG.js rename to public/apps/webapp-schulverwaltung/chunk-7KWP4GRQ.js index 205da9d4..269cdbc3 100644 --- a/public/apps/webapp-schulverwaltung/chunk-DRZ46FDG.js +++ b/public/apps/webapp-schulverwaltung/chunk-7KWP4GRQ.js @@ -1 +1 @@ -import{a as ri}from"./chunk-IOJSQGH6.js";import{a as oi,b as li}from"./chunk-32LHGY5Z.js";import{a as ci}from"./chunk-GKHN5TVX.js";import{a as ai}from"./chunk-24TK3FB4.js";import"./chunk-7VKKHU7R.js";import{a as it,b as Wt,c as zt,d as qt,e as Yt,f as We,g as ze,h as Kt,i as Jt,j as Qt,k as Xt,l as Zt,m as Te,o as ei,p as ce,s as ii,u as ni,v as qe}from"./chunk-LLGOVPQJ.js";import"./chunk-2H6IFZM2.js";import"./chunk-QOR23F4L.js";import"./chunk-7FRZV7VF.js";import{a as Vt}from"./chunk-Y4QYVF5K.js";import"./chunk-OFB4XAK2.js";import{a as di}from"./chunk-6YG4BOT7.js";import{a as pi}from"./chunk-2U5ENDJH.js";import"./chunk-VUPOI3TG.js";import{a as Ut,d as ti}from"./chunk-WACRWBCS.js";import"./chunk-MIRGHONI.js";import"./chunk-YUHFF3NM.js";import{L as jt,U as si,p as At}from"./chunk-H6G6Q6V6.js";import{a as xe,c as Lt,l as ye}from"./chunk-NL5E3FC5.js";import{a as Nt,b as Ue}from"./chunk-YD3RJIHU.js";import{a as Ht,b as Se}from"./chunk-KK2SHN2W.js";import{f as Ot,g as Gt,i as $t,j as Ft,p as je,u as Ne}from"./chunk-AP373D4K.js";import{a as He}from"./chunk-B6WYZ7BT.js";import{$c as Re,Ab as y,B as lt,Bb as fe,Bd as Rt,C as pt,Cb as F,Cd as Bt,D as ct,Db as tt,Ed as Dt,F as ne,Gb as o,H as J,Ha as I,Hb as p,Ib as O,Id as ie,J as Oe,Jd as P,K as mt,Kd as k,Ld as Ve,M as Q,Ma as m,Mb as bt,Na as se,O as ut,P as L,R as oe,Ra as w,Ta as ge,Ua as z,Va as q,Wa as a,Wb as ae,X as ue,Xa as r,Ya as E,Yc as _e,Zb as j,_ as U,_b as Ge,a as D,aa as x,ab as $,b as N,bd as Ce,ca as ht,cb as _,cd as Be,da as gt,db as h,dd as yt,eb as _t,f as ee,fb as Ct,g as A,gb as de,gc as xt,gd as St,h as Ze,ha as he,hd as Tt,ia as S,id as De,ja as T,jd as wt,l as K,la as ft,ld as It,m as dt,mb as le,md as Et,n as b,nb as c,o as te,ob as C,pb as f,qa as X,qb as et,qd as Le,rc as ve,rd as Ae,sc as $e,sd as Pt,ta as vt,tc as Fe,td as kt,uc as re,ud as be,va as Pe,vd as Mt,w as Me,wa as s,wb as R,x as Ee,xa as v,xb as Y,yb as B,zb as pe}from"./chunk-IFJN5CDK.js";var Ji=t=>[t,"tests"];function Qi(t,l){if(t&1&&(a(0,"span"),c(1),o(2,"date"),E(3,"wbr"),c(4),o(5,"date"),r()),t&2){let e=h();s(),f("",O(2,2,e.event.dateFrom,"dd.MM.yyyy"),"\u2013"),s(3),C(O(5,5,e.event.dateTo,"dd.MM.yyyy"))}}function Xi(t,l){if(t&1&&(a(0,"a",6)(1,"i",8),c(2,"arrow_right_alt"),r(),a(3,"span",9),c(4),r()()),t&2){let e=h(2);m("routerLink",F(2,Ji,e.event.id)),s(4),C(e.event.evaluationText)}}function Zi(t,l){if(t&1&&(a(0,"a",7)(1,"i",8),c(2,"arrow_right_alt"),r(),a(3,"span",9),c(4),r()()),t&2){let e=h(2);m("href",e.event.evaluationLink,Pe),s(4),f("",e.event.evaluationText," ")}}function en(t,l){if(t&1&&(a(0,"div",5),I(1,Xi,5,4,"a",6)(2,Zi,5,2,"a",7),r()),t&2){let e=h();s(),w(e.event.evaluationLink?-1:1),s(),w(e.event.evaluationLink?2:-1)}}var mi=(()=>{class t{constructor(){this.withRatings=!0}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=x({type:t,selectors:[["bkd-events-list-entry"]],inputs:{event:"event",withRatings:"withRatings"},standalone:!0,features:[y],decls:11,vars:8,consts:[[1,"designation"],[3,"href"],[1,"date"],[1,"registrations"],[1,"registrations-label"],[1,"rating"],[1,"d-flex",3,"routerLink"],[1,"d-flex",3,"href"],[1,"material-icons"],[1,"ps-1"]],template:function(i,n){i&1&&(a(0,"div",0)(1,"a",1),c(2),r()(),a(3,"div",2),I(4,Qi,6,8,"span"),r(),a(5,"div",3),c(6),a(7,"span",4),c(8),o(9,"translate"),r()(),I(10,en,3,2,"div",5)),i&2&&(s(),m("href",n.event.detailLink,Pe),s(),C(n.event.designation),s(2),w(n.event.dateFrom&&n.event.dateTo?4:-1),s(2),f(" ",n.event.studentCount," "),s(2),C(p(9,6,n.event.studentCount===1?"events.registration":"events.registrations")),s(2),w(n.withRatings&&n.event.evaluationText?10:-1))},dependencies:[re,Ge,k,P],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 tn=10300,nn=10260,sn=10250,an=14030,rn=10350;function Ye(t){let{HasEvaluationStarted:l,EvaluationUntil:e,HasTestGrading:i}=t.EvaluationStatusRef;if(l===!0&&(t.StatusId===an||t.StatusId===rn))return{value:Z.Rating};if(l===!0&&i===!1){if(e)return{value:Z.RatingUntil};if(t.StatusId===tn)return{value:Z.IntermediateRating}}return l===!1&&i===!0&&t.StatusId!==nn&&t.StatusId!==sn?{value:Z.Tests}:l===!0&&i===!0?e?{value:Z.Tests,label:Z.RatingUntil}:{value:Z.Tests,label:Z.IntermediateRating}:null}function ui(t){return t.EvaluationStatusRef.HasEvaluationStarted===!0}function hi(t){return t.EvaluationStatusRef.HasReviewOfEvaluationStarted===!0&&!!t.FinalGrades?.length}function Ke(t){let l=t.Classes?t.Classes.map(e=>e.Number).join(", "):null;return l?t.Designation+", "+l:t.Designation}function gi(t,l){return t?(l.Leadership??"").split(",").some(e=>e.trim()===t.fullname):!1}var Z=function(t){return t.Rating="rating",t.RatingUntil="rating-until",t.IntermediateRating="intermediate-rating",t.Tests="add-tests",t}(Z||{}),we=(()=>{class t{constructor(e,i,n,d,u,g,M){this.coursesRestService=e,this.eventsRestService=i,this.studyClassRestService=n,this.loadingService=d,this.storageService=u,this.translate=g,this.settings=M,this.loading$=this.loadingService.loading$,this.searchFields$=new A(["designation"]),this.searchSubject$=new A(""),this.search$=this.searchSubject$.asObservable(),this.roles$=new A(null),this.isClassTeacher$=this.roles$.pipe(b(V=>Vt(V,"ClassTeacherRole")),Q(1)),this.withStudyCourses$=new A(!1),this.unratedCourses$=this.roles$.pipe(L(this.loadUnratedCourses.bind(this)),Q(1)),this.studyCourses$=this.withStudyCourses$.pipe(L(this.loadStudyCourses.bind(this)),Q(1)),this.formativeAssessments$=this.isClassTeacher$.pipe(L(this.loadFormativeAssessments.bind(this)),Q(1)),this.studyClasses$=this.isClassTeacher$.pipe(L(this.loadStudyClasses.bind(this)),Q(1)),this.events$=this.getEvents().pipe(Q(1)),this.filteredEvents$=te([this.events$,this.searchFields$,this.search$]).pipe(b(ye(oi)))}setSearch(e){this.searchSubject$.next(e)}setRoles(e){this.roles$.next(e)}setWithStudyCourses(e){this.withStudyCourses$.next(e)}setSearchFields(e){this.searchFields$.next(e)}getEntries(e=!1){return this.filteredEvents$.pipe(b(i=>e?i.filter(n=>n.evaluationText):i))}getEvents(){return this.loadingService.load(te([this.unratedCourses$,this.studyCourses$,this.formativeAssessments$,this.studyClasses$]),{stopOnFirstValue:!0}).pipe(b(ye(this.createAndSortEvents.bind(this))))}loadUnratedCourses(e){return this.coursesRestService.getExpandedCourses(e).pipe(b(i=>i.filter(n=>!hi(n))))}loadStudyCourses(e){return e?this.eventsRestService.getStudyCourseEvents():K([])}loadFormativeAssessments(e){return e?this.studyClassRestService.getActiveFormativeAssessments():K([])}loadStudyClasses(e){return e?this.studyClassRestService.getActive():K([])}createAndSortEvents(e,i,n,d){let u=d.filter(g=>!n.map(M=>M.Id).includes(g.Id));return[...this.createFromCourses(e),...this.createFromStudyCourses(i),...this.createFromAssessments(n),...this.createFromStudyClasses(u)].sort((g,M)=>g.designation.localeCompare(M.designation))}createFromCourses(e){return e.map(i=>{let n=Ye(i);return{id:i.Id,designation:Ke(i),detailLink:this.buildLink(i.Id,"eventdetail"),studentCount:i.AttendanceRef.StudentCount||0,dateFrom:i.DateFrom,dateTo:i.DateTo,state:n?.value||null,evaluationText:this.getEvaluationText(n,i.EvaluationStatusRef.EvaluationUntil),evaluationLink:this.getEvaluationLink(n?.value,i)}})}createFromStudyCourses(e){let i=this.storageService.getPayload();return e.filter(n=>gi(i,n)).map(n=>({id:n.Id,designation:n.Designation,detailLink:this.buildLink(n.Id,"eventdetail"),studentCount:n.StudentCount,state:null}))}createFromAssessments(e){return this.createFromStudyClasses(e).map(n=>N(D({},n),{state:Z.Rating,evaluationText:this.translate.instant("events.state.rating"),evaluationLink:this.buildLink(n.id,"evaluation")}))}createFromStudyClasses(e){return e.map(i=>({id:i.Id,designation:i.Number,detailLink:this.buildLink(i.Id,"eventdetail"),studentCount:i.StudentCount,state:null}))}getEvaluationText(e,i){let n=e?.label||e?.value;return n?this.translate.instant(`events.state.${n}`)+(n===Z.RatingUntil?` ${i?At(i,"dd.MM.yyyy"):""}`:""):""}getEvaluationLink(e,i){return e&&e!==Z.Tests?this.buildLink(i.Id,"evaluation"):null}buildLink(e,i){return(this.settings.eventlist[i]??"").replace(":id",String(e))}static{this.\u0275fac=function(i){return new(i||t)(U(ce),U(ri),U(ci),U(Ue),U(Ve),U(ie),U(_e))}}static{this.\u0275prov=ue({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var pn=(t,l)=>l.id,cn=()=>[];function mn(t,l){t&1&&E(0,"bkd-spinner")}function un(t,l){t&1&&(a(0,"div",7),c(1),o(2,"translate"),r()),t&2&&(s(),f(" ",p(2,1,"events.rating")," "))}function hn(t,l){if(t&1&&E(0,"bkd-events-list-entry",8),t&2){let e=l.$implicit,i=h(3);m("event",e)("withRatings",i.withRatings)}}function gn(t,l){if(t&1&&(a(0,"div",3)(1,"div",4),c(2),o(3,"translate"),r(),a(4,"div",5),c(5),o(6,"translate"),r(),a(7,"div",6),c(8),o(9,"translate"),r(),I(10,un,3,3,"div",7),r(),z(11,hn,1,2,"bkd-events-list-entry",8,pn)),t&2){let e=h(2),i=B(0);s(2),C(p(3,4,"events.designation")),s(3),C(p(6,6,"events.date")),s(3),f(" ",p(9,8,"events.registrations")," "),s(2),w(e.withRatings?10:-1),s(),q(i)}}function fn(t,l){t&1&&(a(0,"p",2),c(1),o(2,"translate"),r()),t&2&&(s(),C(p(2,1,"events.no-events")))}function vn(t,l){if(t&1&&I(0,gn,13,10)(1,fn,3,3,"p",2),t&2){h();let e=B(0);w(e.length>0?0:1)}}var fi=["designation"],_n=[...fi,"evaluationText"],Je=(()=>{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?_n:fi)}static{this.\u0275fac=function(i){return new(i||t)(v(we),v(Ve))}}static{this.\u0275cmp=x({type:t,selectors:[["bkd-events-list"]],inputs:{withStudyCourses:"withStudyCourses",withRatings:"withRatings"},standalone:!0,features:[he,y],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=$();R(0),o(1,"async"),a(2,"div",0)(3,"bkd-resettable-input",1),o(4,"async"),o(5,"translate"),o(6,"translate"),_("valueChange",function(g){return S(d),T(n.state.setSearch(g))}),r(),I(7,mn,1,0,"bkd-spinner"),o(8,"async"),I(9,vn,2,1),r()}if(i&2){let d,u=Y((d=p(1,5,n.state.getEntries(n.withRatings)))!==null&&d!==void 0?d:fe(16,cn));s(3),m("value",p(4,8,n.state.search$))("placeholder",p(5,10,"events.search-by"))("label",p(6,12,"events.search"))("disabled",!u),s(4),w(p(8,14,n.state.loading$)?7:9)}},dependencies:[li,Se,j,k,P,mi],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 vi=(()=>{class t{constructor(){}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=x({type:t,selectors:[["bkd-events-current"]],standalone:!0,features:[y],decls:4,vars:5,consts:[[3,"withStudyCourses","withRatings"]],template:function(i,n){i&1&&(a(0,"h1"),c(1),o(2,"translate"),r(),E(3,"bkd-events-list",0)),i&2&&(s(),C(p(2,3,"events.current.title")),s(2),m("withStudyCourses",!0)("withRatings",!1))},dependencies:[Je,k,P]})}}return t})();var _i=(()=>{class t{constructor(){}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=x({type:t,selectors:[["bkd-events-tests"]],standalone:!0,features:[y],decls:4,vars:4,consts:[[3,"withRatings"]],template:function(i,n){i&1&&(a(0,"h1"),c(1),o(2,"translate"),r(),E(3,"bkd-events-list",0)),i&2&&(s(),C(p(2,2,"events.title")),s(2),m("withRatings",!0))},dependencies:[Je,k,P]})}}return t})();var Ci=(()=>{class t{constructor(){}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=x({type:t,selectors:[["bkd-events"]],standalone:!0,features:[pe([we,jt]),y],decls:1,vars:0,template:function(i,n){i&1&&E(0,"router-outlet")},dependencies:[$e]})}}return t})();function bi(t){return l=>{let e=Number(l.value);return e<=t?{greaterThan:{value:e,greaterThanValue:t}}:null}}function st(t){return t.map(({finalGrade:l})=>l).filter(Cn)}function Cn(t){return t!==null}function Si(t,l,e,i){return t?.map(n=>({student:n,finalGrade:xn(n,e,i),grades:bn(n,l)}))}function bn(t,l){return l.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 xn(t,l,e){let i=l.find(d=>d.StudentId===t.Id),n=e.find(d=>d.StudentId===t.Id);return i?{id:i.Id,average:yn(i),finalGradeId:i.GradeId,freeHandGrade:n?Number(n.Grade):null,canGrade:i.CanGrade}:null}function yn(t){return t.AverageTestResult===0?null:t.AverageTestResult}var Ti=({key:t,ascending:l})=>(e,i)=>{let n=l?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*xi(e.finalGrade.finalGradeId,i.finalGrade.finalGradeId);case"TestsMean":return!e.finalGrade?.average||!i.finalGrade?.average?n*-1:n*xi(e.finalGrade.average,i.finalGrade.average)}return n*Sn(t,e,i)},Sn=(t,l,e)=>{let i=l.grades.filter(yi).find(d=>d.test.Id===t.Id),n=e.grades.filter(yi).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 xi(t,l){return t===l?0:te.average).filter(e=>e!=null&&e!==0).map(Number);return it(l)}function Ei(t,l){let e=t.map(n=>n.freeHandGrade).filter(n=>!!n),i=t.map(n=>n.finalGradeId).filter(n=>n!==null).map(n=>l.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 it([...i,...e])}function at(t,l){return[...l.filter(e=>e.Id!==t?.Id),t].filter(e=>e!=null)}function Pi({id:t,selectedGradeId:l},e){return e.map(i=>i.Id!==t?i:N(D({},i),{GradeId:l}))}function ki(t,l){switch(l.type){case"reset":return l.payload;case"updateResult":return t?N(D({},t),{Tests:zt(l.payload.testResult,t.Tests||[],l.payload.ignore),Gradings:l.payload.grading?at(l.payload.grading,t.Gradings||[]):t.Gradings}):null;case"deleteResult":return t?N(D({},t),{Tests:qt(l.payload.testId,l.payload.studentId,t.Tests||[]),Gradings:l.payload.grading?at(l.payload.grading,t.Gradings||[]):t.Gradings||[]}):null;case"toggle-test-state":return t?N(D({},t),{Tests:Yt(l.payload,t.Tests||[])}):null;case"final-grade-overwritten":return t?N(D({},t),{Gradings:Pi({id:l.payload.id,selectedGradeId:l.payload.selectedGradeId},t.Gradings||[])}):null;case"replace-grades":return t?N(D({},t),{Gradings:l.payload}):null;case"delete-test":return t?N(D({},t),{Tests:Kt(l.payload,t.Tests||[])}):null;default:return t}}var Mi=(()=>{class t extends Ht{constructor(e,i){super(e,i,ei,"Gradings")}updateGrade(e,i){return this.http.put(`${this.baseUrl}/${e}`,{GradeId:i}).pipe(b(()=>e))}static{this.\u0275fac=function(i){return new(i||t)(U(xt),U(_e))}}static{this.\u0275prov=ue({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var rt={onlyMine:!1,hidePublished:!1},H=(()=>{class t{constructor(e,i,n,d,u){this.coursesRestService=e,this.gradingScalesRestService=i,this.gradingsRestService=n,this.loadingService=d,this.sortService=u,this.action$=new Ze(1),this.loading$=this.loadingService.loading$,this._courseId$=new Ze(1),this.courseId$=this._courseId$.asObservable(),this.fetchedCourse$=this._courseId$.pipe(L(g=>this.loadingService.load(this.coursesRestService.getExpandedCourse(g))),Q(1)),this.course$=Me(this.action$,this.fetchedCourse$.pipe(Ee(Ne),b(g=>({type:"reset",payload:g})))).pipe(mt(ki,null),Ee(Ne),Q(1)),this.tests$=this.course$.pipe(b(g=>g.Tests||[]),b(Jt)),this.hasTests$=this.tests$.pipe(b(g=>g.length>0)),this.filterSubject$=new A(rt),this.filter$=this.filterSubject$.asObservable(),this.expandedHeaderSubject$=new A(!1),this.expandedHeader$=this.expandedHeaderSubject$.asObservable(),this.filteredTests$=te([this.tests$,this.filter$]).pipe(b(([g,M])=>g.filter(V=>(!M.onlyMine||V.IsOwner)&&(!M.hidePublished||!V.IsPublished)))),this.sorting$=this.sortService.sorting$,this.studentGrades$=te([this.course$,this.filteredTests$,this.sorting$]).pipe(b(ye(this.toStudentGrades.bind(this)))),this.canSetFinalGrade$=this.course$.pipe(b(ui)),this.gradingScaleIds$=this.course$.pipe(b(g=>Bt([...(g.Tests??[]).map(M=>M.GradingScaleId),g.GradingScaleId]).filter(Ne)),J(Rt),Q(1)),this.gradingScales$=this.gradingScaleIds$.pipe(L(g=>this.gradingScalesRestService.getGradingScales(g)),Q(1)),this.UNDEFINED_GRADINGSCALE_ID=-1,this.gradingScalesOptions$=this.gradingScales$.pipe(b(g=>g.map(M=>{let V=M?.Id||this.UNDEFINED_GRADINGSCALE_ID,Ie=M?.Grades.map(ke=>({Key:ke.Id,Value:ke.Designation}))||[];return{id:V,options:Ie}}).reduce((M,V)=>N(D({},M),{[V.id]:V.options}),{})),Q(1)),this.meanOfStudentGradesForCourse$=this.studentGrades$.pipe(b(g=>Ii(st(g)))),this.meanOfFinalGradesForCourse$=te([this.gradingScalesOptions$,this.studentGrades$]).pipe(L(ye(this.meanOfOverwrittenGradesForCourse.bind(this))))}setCourseId(e){this._courseId$.next(e)}setFilter(e){this.filterSubject$.next(e)}gradingOptionsForTest$(e){return this.gradingOptions$(e.GradingScaleId)}gradingOptionsForCourse$(){return this.course$.pipe(L(e=>this.gradingOptions$(e.GradingScaleId)))}toStudentGrades(e,i=[],n){return Si(e.ParticipatingStudents??[],i,e.Gradings??[],e.FinalGrades??[]).sort(Ti(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(ne(1),b(i=>{let{originalResult:n,updatedResult:d}=this.buildOptimisticResultUpdate(i,e);return this.updateTestResult(d,null),n}))}saveGrade(e,i){this.course$.pipe(ne(1),L(n=>this.coursesRestService.updateTestResult(n.Id,e).pipe(lt(d=>(i&&this.updateTestResult(D({},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=Wt(e,i.testId,i.studentId),d=n?D({},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,u){n?this.updateTestResult(n,d,u):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?K(null):this.gradingScalesOptions$.pipe(b(i=>i[e]),Q(1))}meanOfOverwrittenGradesForCourse(e,i){return this.course$.pipe(b(n=>{if(n.GradingScaleId===null||e[n.GradingScaleId]===void 0)return null;let d=e[n.GradingScaleId];return Ei(st(i),d)}))}static{this.\u0275fac=function(i){return new(i||t)(U(ce),U(ii),U(Mi),U(Ue),U(pi))}}static{this.\u0275prov=ue({token:t,factory:t.\u0275fac})}}return t})();var In=t=>["/events",t,"tests"];function En(t,l){if(t&1&&(a(0,"div",7),c(1),o(2,"translate"),r()),t&2){let e=l.$implicit;s(),f(" ",O(2,1,"global.validation-errors."+e.error,e.params)," ")}}function Pn(t,l){if(t&1&&(a(0,"div",7),c(1),o(2,"translate"),r()),t&2){let e=l.$implicit;s(),f(" ",O(2,1,"global.validation-errors."+e.error,e.params)," ")}}function kn(t,l){if(t&1&&(a(0,"div",7),c(1),o(2,"translate"),r()),t&2){let e=l.$implicit;s(),f(" ",O(2,1,"global.validation-errors."+e.error,e.params)," ")}}function Mn(t,l){if(t&1&&(a(0,"div",7),c(1),o(2,"translate"),r()),t&2){let e=l.$implicit;s(),f(" ",O(2,1,"global.validation-errors."+e.error,e.params)," ")}}function On(t,l){if(t&1&&(a(0,"div",7),c(1),o(2,"translate"),r()),t&2){let e=l.$implicit;s(),f(" ",O(2,1,"global.validation-errors."+e.error,e.params)," ")}}function Gn(t,l){if(t&1&&(a(0,"div",29)(1,"div",30)(2,"div",16)(3,"label",31),c(4),o(5,"translate"),r(),a(6,"div",32),E(7,"input",33),o(8,"async"),z(9,Mn,3,4,"div",7,ge),o(11,"async"),r()()(),a(12,"div",30)(13,"div",16)(14,"label",34),c(15),o(16,"translate"),r(),a(17,"div",32),E(18,"input",35),o(19,"async"),z(20,On,3,4,"div",7,ge),o(22,"async"),r()()()(),a(23,"div",36),ft(),a(24,"math")(25,"mi"),c(26),o(27,"translate"),r(),a(28,"mo"),c(29,"="),r(),a(30,"mfrac")(31,"mrow")(32,"mi"),c(33),o(34,"translate"),r(),a(35,"mo"),c(36,"\xD7"),r(),a(37,"mn"),c(38,"5"),r()(),a(39,"mi"),c(40),o(41,"translate"),r()(),a(42,"mo"),c(43,"+"),r(),a(44,"mn"),c(45,"1"),r()()()),t&2){let e,i,n=h(2);s(4),C(p(5,9,"tests.form.max-points")),s(3),se("is-invalid",((e=p(8,11,n.maxPointsErrors$))==null?null:e.length)||!1),s(2),q(p(11,13,n.maxPointsErrors$)),s(6),C(p(16,15,"tests.form.max-points-adjusted")),s(3),se("is-invalid",((i=p(19,17,n.maxPointsAdjustedErrors$))==null?null:i.length)||!1),s(2),q(p(22,19,n.maxPointsAdjustedErrors$)),s(6),f(" ",p(27,21,"tests.form.math.grade")," "),s(7),f(" ",p(34,23,"tests.form.math.points")," "),s(7),C(p(41,25,"tests.form.math.max-points"))}}function $n(t,l){t&1&&(a(0,"div",28)(1,"span",37),c(2,"Loading..."),r()())}function Fn(t,l){if(t&1){let e=$();a(0,"form",2),_("ngSubmit",function(){S(e);let n=h();return T(n.onSubmit())}),a(1,"div",3)(2,"div",4)(3,"label",5),c(4),o(5,"translate"),r(),E(6,"input",6),o(7,"async"),o(8,"translate"),z(9,En,3,4,"div",7,ge),o(11,"async"),r(),a(12,"div",8)(13,"label",9),c(14),o(15,"translate"),r(),a(16,"div",10)(17,"span",11)(18,"i",12),c(19,"calendar_today"),r()(),a(20,"input",13,0),o(22,"async"),o(23,"translate"),_("click",function(){S(e);let n=le(21);return T(n.toggle())}),r(),z(24,Pn,3,4,"div",7,ge),o(26,"async"),r()()(),a(27,"div",14)(28,"label",15),c(29),o(30,"translate"),r(),a(31,"div",4)(32,"div",16)(33,"label",17),c(34),o(35,"translate"),r(),a(36,"div",18),E(37,"input",19),o(38,"async"),z(39,kn,3,4,"div",7,ge),o(41,"async"),r()()()(),a(42,"div")(43,"label",15),c(44),o(45,"translate"),r(),a(46,"div",20),E(47,"input",21),a(48,"label",22),c(49),o(50,"translate"),r()(),a(51,"div",20),E(52,"input",23),a(53,"label",24),c(54),o(55,"translate"),r()(),I(56,Gn,46,27),r(),a(57,"div",25)(58,"button",26),o(59,"async"),c(60),o(61,"translate"),r(),a(62,"button",27),c(63),o(64,"translate"),I(65,$n,3,0,"div",28),r()()()}if(t&2){let e,i,n,d,u=h();m("formGroup",u.formGroup),s(4),C(p(5,26,"tests.form.designation")),s(2),se("is-invalid",((e=p(7,28,u.designationErrors$))==null?null:e.length)||!1),m("placeholder",p(8,30,"tests.form.designation-placeholder")),s(3),q(p(11,32,u.designationErrors$)),s(5),C(p(15,34,"tests.form.date")),s(3),m("id",u.componentId),s(3),se("is-invalid",((i=p(22,36,u.dateErrors$))==null?null:i.length)||!1),m("placeholder",p(23,38,"shared.date-select.default-placeholder")),s(4),q(p(26,40,u.dateErrors$)),s(5),C(p(30,42,"tests.form.weight")),s(5),C(p(35,44,"tests.form.factor")),s(3),se("is-invalid",((n=p(38,46,u.weightErrors$))==null?null:n.length)||!1),s(2),q(p(41,48,u.weightErrors$)),s(5),C(p(45,50,"tests.form.grading-type")),s(3),m("value",!1),s(2),C(p(50,52,"tests.form.grades")),s(3),m("value",!0),s(2),C(p(55,54,"tests.form.points")),s(2),w((d=u.formGroup.get("isPointGrading"))!=null&&d.value?56:-1),s(2),m("disabled",u.saving)("routerLink",F(62,In,p(59,56,u.courseId$))),s(2),f(" ",p(61,58,"tests.form.cancel")," "),s(2),m("disabled",u.saving),s(),f(" ",p(64,60,"tests.form.save")," "),s(2),w(u.saving?65:-1)}}var Qe=(()=>{class t{constructor(e,i,n){this.fb=e,this.translate=i,this.testStateService=n,this.test=null,this.saving=!1,this.save=new X,this.componentId=Dt("bkd-tests-edit-form"),this.formGroup=this.createFormGroup(),this.submitted$=new A(!1),this.destroy$=new ee,this.designationErrors$=xe(K(this.formGroup),this.submitted$,"designation"),this.dateErrors$=xe(K(this.formGroup),this.submitted$,"date"),this.maxPointsErrors$=xe(K(this.formGroup),this.submitted$,"maxPoints"),this.maxPointsAdjustedErrors$=xe(K(this.formGroup),this.submitted$,"maxPointsAdjusted"),this.weightErrors$=xe(K(this.formGroup),this.submitted$,"weight"),this.courseId$=this.testStateService.courseId$}ngOnInit(){this.test&&this.setInitialValues(this.test),Lt(K(this.formGroup),"isPointGrading").pipe(oe(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:["",Ce.required],date:[null,Ce.required],weight:[1,Ce.compose([Ce.required,bi(0)])],isPointGrading:[!1],maxPoints:[{value:null,disabled:!0},Ce.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)(v(kt),v(ie),v(H))}}static{this.\u0275cmp=x({type:t,selectors:[["bkd-tests-edit-form"]],inputs:{test:"test",saving:"saving"},outputs:{save:"save"},standalone:!0,features:[pe([{provide:Ot,useClass:Ft},{provide:Gt,useClass:di}]),y],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&&I(0,Fn,66,64,"form",1),i&2&&w(n.formGroup?0:-1)},dependencies:[be,Tt,Re,De,wt,Be,yt,Pt,Ae,Le,Mt,It,Et,$t,re,j,k,P],styles:["#factor[_ngcontent-%COMP%], #max-points[_ngcontent-%COMP%], #max-points-adjusted[_ngcontent-%COMP%]{width:5em}"]})}}return t})();var Gi=(()=>{class t{constructor(e,i,n,d,u){this.route=e,this.courseService=i,this.toastService=n,this.translate=d,this.router=u,this.saving$=new A(!1),this.courseId$=this.route.paramMap.pipe(b(g=>Number(g.get("id"))),J())}save(e){this.saving$.next(!0);let{designation:i,date:n,weight:d,isPointGrading:u,maxPoints:g,maxPointsAdjusted:M}=e;this.courseId$.pipe(L(V=>this.courseService.add(V,n,i,d,u,g,M)),Oe(()=>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)(v(ve),v(ce),v(He),v(ie),v(Fe))}}static{this.\u0275cmp=x({type:t,selectors:[["bkd-tests-add"]],standalone:!0,features:[y],decls:6,vars:6,consts:[[1,"bkd-container","bkd-container-limited"],[3,"save","saving"]],template:function(i,n){i&1&&(a(0,"h1"),c(1),o(2,"translate"),r(),a(3,"div",0)(4,"bkd-tests-edit-form",1),o(5,"async"),_("save",function(u){return n.save(u)}),r()()),i&2&&(s(),C(p(2,2,"tests.add-title")),s(3),m("saving",p(5,4,n.saving$)))},dependencies:[Qe,j,k,P]})}}return t})();var $i=(()=>{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)(v(je))}}static{this.\u0275cmp=x({type:t,selectors:[["bkd-tests-delete"]],inputs:{test:"test"},standalone:!0,features:[y],decls:13,vars:10,consts:[[1,"modal-body"],["data-testid","confirmation-message"],[1,"modal-footer"],["data-testid","cancel-button","type","button",1,"btn","btn-outline-secondary",3,"click","hidden"],[1,"px-2"],["data-testid","confirm-button","type","button",1,"btn","btn-primary",3,"click"],[1,"px-3"]],template:function(i,n){i&1&&(a(0,"div",0)(1,"p",1),c(2),o(3,"translate"),r()(),a(4,"div",2)(5,"button",3),_("click",function(){return n.activeModal.dismiss()}),a(6,"span",4),c(7),o(8,"translate"),r()(),a(9,"button",5),_("click",function(){return n.activeModal.close(n.canDeleteTest?n.test:null)}),a(10,"span",6),c(11),o(12,"translate"),r()()()),i&2&&(s(2),f(" ",p(3,4,n.canDeleteTest?"tests.form.confirm":"tests.form.delete-not-allowed")," "),s(3),m("hidden",!n.canDeleteTest),s(2),f(" ",p(8,6,"tests.dialog.no")," "),s(4),f(" ",p(12,8,n.canDeleteTest?"tests.dialog.yes":"tests.dialog.ok")," "))},dependencies:[k,P]})}}return t})();var Ln=t=>({test:t});function An(t,l){t&1&&E(0,"bkd-spinner")}function jn(t,l){if(t&1){let e=$();a(0,"div",1)(1,"h1"),c(2),o(3,"translate"),r(),a(4,"button",2),_("click",function(){S(e);let n=h(),d=B(0);return T(n.openDeleteModal(d))}),a(5,"i",3),c(6,"delete"),r()()(),a(7,"bkd-tests-edit-form",4),_("save",function(n){S(e);let d=h();return T(d.save(n))}),r()}if(t&2){h();let e=B(0),i=B(2);s(2),f(" ",O(3,3,"tests.edit-title",F(6,Ln,e.Designation))," "),s(5),m("test",e)("saving",i)}}var Fi=(()=>{class t{constructor(e,i,n,d,u,g,M){this.state=e,this.courseService=i,this.route=n,this.toastService=d,this.translate=u,this.router=g,this.modalService=M,this.saving$=new A(!1),this.testId$=this.route.paramMap.pipe(b(V=>Number(V.get("testId"))),J()),this.test$=te([this.state.tests$,this.testId$]).pipe(b(([V,Ie])=>V.find(ke=>ke.Id===Ie)))}openDeleteModal(e){let i=this.modalService.open($i);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:u,maxPoints:g,maxPointsAdjusted:M}=e;te([this.state.courseId$,this.testId$]).pipe(ne(1),L(([V,Ie])=>this.courseService.update(V,Ie,i,n,d,u,g,M)),Oe(()=>this.saving$.next(!1))).subscribe(this.onSaveSuccess.bind(this))}onSaveSuccess(){this.toastService.success(this.translate.instant("tests.form.save-success")),this.navigateBack()}onDeleteSuccess(e){this.toastService.success(this.translate.instant("tests.form.delete-success")),this.state.deleteTest(e),this.navigateBack()}navigateBack(){this.state.courseId$.pipe(ne(1)).subscribe(e=>void this.router.navigate(["events",e,"tests"]))}static{this.\u0275fac=function(i){return new(i||t)(v(H),v(ce),v(ve),v(He),v(ie),v(Fe),v(qe))}}static{this.\u0275cmp=x({type:t,selectors:[["bkd-tests-edit"]],standalone:!0,features:[y],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),o(1,"async"),R(2),o(3,"async"),a(4,"div",0),I(5,An,1,0,"bkd-spinner"),o(6,"async"),I(7,jn,8,8),r()),i&2){let d=Y(p(1,1,n.test$));s(2),Y(p(3,4,n.saving$)),s(3),w(p(6,7,n.state.loading$)?5:d?7:-1)}},dependencies:[Qe,Se,j,k,P]})}}return t})();var Hn=t=>({designation:t}),Ri=(()=>{class t{constructor(e){this.activeModal=e}static{this.\u0275fac=function(i){return new(i||t)(v(je))}}static{this.\u0275cmp=x({type:t,selectors:[["bkd-publish-test"]],inputs:{test:"test"},standalone:!0,features:[y],decls:11,vars:12,consts:[[1,"modal-body"],["data-testid","confirmation-message"],[1,"modal-footer"],["data-testid","cancel-button","type","button",1,"btn","btn-outline-secondary",3,"click"],["data-testid","confirm-button","type","button",1,"btn","btn-primary",3,"click"]],template:function(i,n){i&1&&(a(0,"div",0)(1,"p",1),c(2),o(3,"translate"),r()(),a(4,"div",2)(5,"button",3),_("click",function(){return n.activeModal.dismiss()}),c(6),o(7,"translate"),r(),a(8,"button",4),_("click",function(){return n.activeModal.close(!0)}),c(9),o(10,"translate"),r()()),i&2&&(s(2),f(" ",O(3,3,n.test.IsPublished?"tests.publishing.unpublish":"tests.publishing.publish",F(10,Hn,n.test.Designation))," "),s(4),f(" ",p(7,6,"tests.publishing.cancel")," "),s(3),f(" ",p(10,8,"tests.publishing.confirm")," "))},dependencies:[k,P],encapsulation:2})}}return t})();var Vn=t=>({maxPoints:t});function Nn(t,l){if(t&1&&(a(0,"div",6),c(1),o(2,"translate"),r()),t&2){let e=h(2);s(),f(" ",O(2,1,"global.validation-errors.invalidPoints",F(4,Vn,e.maxPoints))," ")}}function Un(t,l){if(t&1){let e=$();a(0,"div",3)(1,"input",5,0),_("ngModelChange",function(){S(e);let n=le(2),d=h();return T(d.onPointsChange(n.value))}),r(),I(3,Nn,3,6,"div",6),r()}if(t&2){let e=le(2),i=h();s(),se("is-invalid",e.errors),de("max",i.maxPoints),de("tabindex",i.tabIndex),m("disabled",i.grade.test.IsPublished)("ngModel",i.grade.kind==="grade"?i.grade.result.Points:null),s(2),w(e.errors?3:-1)}}var Wn=1250,Bi=(()=>{class t{constructor(e){this.state=e,this.maxPoints=0,this.pointsSubject$=new ee,this.gradeSubject$=new ee,this.gradingScaleDisabledSubject$=new A(!0),this.gradingScaleDisabled$=this.gradingScaleDisabledSubject$.asObservable(),this.destroy$=new ee}ngOnInit(){this.gradingScaleDisabledSubject$.next(this.disableGradingScale()),this.maxPoints=wi(this.grade),this.initSave(this.pointsSubject$.pipe(Ee(this.isValid.bind(this)),b(e=>({studentId:this.student.Id,testId:this.grade.test.Id,points:e?Number(e):null})))),this.initSave(this.gradeSubject$.pipe(b(e=>({studentId:this.student.Id,testId:this.grade.test.Id,gradeId:e}))))}ngOnChanges(){this.gradingScaleDisabledSubject$.next(this.disableGradingScale())}ngOnDestroy(){this.destroy$.next()}onPointsChange(e){this.pointsSubject$.next(e),this.gradingScaleDisabledSubject$.next(!(e===null||e===""))}onGradeChange(e){this.gradeSubject$.next(e)}isValid(e){return e===""||e===null?!0:isNaN(Number(e))?!1:!(Number(e)<0||Number(e)>this.maxPoints)}initSave(e){e.pipe(pt(i=>this.state.optimisticallyUpdateGrade(i).pipe(b(n=>({params:i,originalResult:n})))),ct(Wn),oe(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)(v(H))}}static{this.\u0275cmp=x({type:t,selectors:[["bkd-grade"]],inputs:{grade:"grade",student:"student",tabIndex:"tabIndex",gradeOptions:"gradeOptions"},standalone:!0,features:[he,y],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&&(a(0,"div",1)(1,"div",2),I(2,Un,4,7,"div",3),a(3,"bkd-select",4),o(4,"async"),_("valueChange",function(u){return n.onGradeChange(u)}),r()()()),i&2&&(s(2),w(n.grade.test.IsPointGrading?2:-1),s(),m("options",n.gradeOptions)("allowEmpty",!0)("value",n.grade.kind==="grade"?n.grade.result.GradeId:null)("disabled",p(4,6,n.gradingScaleDisabled$))("tabindex",n.tabIndex))},dependencies:[be,Re,De,Be,Ae,Le,St,Te,j,k,P],styles:[".point-input-container[_ngcontent-%COMP%]{width:4em}[_nghost-%COMP%] select{min-width:13ch}@media (min-width: 576px){.point-input-container[_ngcontent-%COMP%]{width:5em}}"]})}}return t})();function zn(t,l){if(t&1&&(a(0,"span",1),c(1),r()),t&2){let e=h();s(),C(e.calculatePointsAverage(e.test))}}var Di=(()=>{class t{constructor(e){this.locale=e}calculatePointsAverage(e){return this.safeAverage(e,2,We)}calculateGradeAverage(e){return this.safeAverage(e,3,ze)}safeAverage(e,i,n){try{return Zt(n(e),this.locale,i)}catch{return Qt}}static{this.\u0275fac=function(i){return new(i||t)(v(bt))}}static{this.\u0275cmp=x({type:t,selectors:[["bkd-average-grades"]],inputs:{test:"test"},standalone:!0,features:[y],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&&(a(0,"div",0),I(1,zn,2,1,"span",1),a(2,"span",2),c(3),r()()),i&2&&(s(),w(n.test.IsPointGrading?1:-1),s(2),C(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 Li=(()=>{class t{constructor(){this.disabled=!1,this.width="13ch",this.gradeIdSelected=new X}onGradeChange(e){this.gradeId?.valueOf()!==void 0&&this.gradeIdSelected.emit({id:this.gradeId?.valueOf(),selectedGradeId:e})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=x({type:t,selectors:[["bkd-grade-select"]],inputs:{options:"options",valueId:"valueId",gradeId:"gradeId",disabled:"disabled",width:"width"},outputs:{gradeIdSelected:"gradeIdSelected"},standalone:!0,features:[y],decls:1,vars:5,consts:[["data-testid","grade-select",3,"valueChange","options","allowEmpty","value","disabled","width"]],template:function(i,n){i&1&&(a(0,"bkd-select",0),_("valueChange",function(u){return n.onGradeChange(u)}),r()),i&2&&m("options",n.options)("allowEmpty",!0)("value",n.valueId)("disabled",n.disabled)("width",n.width)},dependencies:[Te]})}}return t})();var qn=576,Ai=(()=>{class t{constructor(e,i){this.portal=e,this.state=i,this.destroy$=new ee,this.handleWindowScroll=()=>{this.updateStickyVisibility(),this.updateStickyTopOffset()},this.handleWindowResize=()=>{this.updateStickyWidth(),this.updateStickyVisibility(),this.updateStickyTopOffset()},this.handleTableScroll=()=>{this.updateStickyLeftOffset()}}ngOnInit(){te([this.state.filteredTests$,this.state.expandedHeader$]).pipe(oe(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":l}),Hi=(()=>{class t{constructor(){this.filter=rt,this.filterChange=new X}showOnlyMine(){this.filterChange.next(N(D({},this.filter),{onlyMine:!0}))}showAll(){this.filterChange.next(N(D({},this.filter),{onlyMine:!1}))}onHidePublishedChange(e){let i=(e.target&&e.target instanceof HTMLInputElement&&e.target?.checked)??!1;this.filterChange.next(N(D({},this.filter),{hidePublished:i}))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=x({type:t,selectors:[["bkd-test-table-filter"]],inputs:{filter:"filter"},outputs:{filterChange:"filterChange"},standalone:!0,features:[y],decls:13,vars:18,consts:[[1,"only-mine-buttons"],["type","button",1,"btn","desktop",3,"click","ngClass"],["type","button",1,"btn","ms-2","desktop",3,"click","ngClass"],[1,"hide-published"],[1,"form-check"],["id","hide-published","type","checkbox",1,"form-check-input",3,"change","checked"],["for","hide-published",1,"form-check-label"]],template:function(i,n){i&1&&(a(0,"div",0)(1,"button",1),_("click",function(){return n.showAll()}),c(2),o(3,"translate"),r(),a(4,"button",2),_("click",function(){return n.showOnlyMine()}),c(5),o(6,"translate"),r()(),a(7,"div",3)(8,"div",4)(9,"input",5),_("change",function(u){return n.onHidePublishedChange(u)}),r(),a(10,"label",6),c(11),o(12,"translate"),r()()()),i&2&&(s(),m("ngClass",tt(12,ji,!n.filter.onlyMine,n.filter.onlyMine)),s(),f(" ",p(3,6,"tests.all-tests")," "),s(2),m("ngClass",tt(15,ji,n.filter.onlyMine,!n.filter.onlyMine)),s(),f(" ",p(6,8,"tests.owned-tests")," "),s(4),m("checked",n.filter.hidePublished),s(2),f(" ",p(12,10,"tests.hide-published")," "))},dependencies:[ae,be,k,P],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 Yn=["*"],Vi=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=x({type:t,selectors:[["bkd-preserve-line-height"]],standalone:!0,features:[y],ngContentSelectors:Yn,decls:3,vars:0,template:function(i,n){i&1&&(_t(),a(0,"div"),Ct(1),c(2,"\xA0"),r())},encapsulation:2})}}return t})();var Ni=(()=>{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)(v(ie,16))}}static{this.\u0275pipe=gt({name:"testSummaryShort",type:t,pure:!0,standalone:!0})}}return t})();var Kn=t=>[t,"edit"];function Jn(t,l){t&1&&(a(0,"i",9),c(1,"edit"),r())}function Qn(t,l){if(t&1&&(a(0,"div",5)(1,"div",7)(2,"bkd-preserve-line-height"),c(3),o(4,"date"),r(),a(5,"a",8),I(6,Jn,2,0,"i",9),r()(),a(7,"bkd-preserve-line-height"),c(8),o(9,"testSummaryShort"),r(),a(10,"bkd-preserve-line-height"),c(11),r()()),t&2){let e=h();s(3),C(O(4,5,e.test.Date,"dd.MM.yyyy")),s(2),m("routerLink",F(10,Kn,e.test.Id)),s(),w(e.test.IsOwner&&e.test.IsPublished===!1?6:-1),s(2),f(" ",p(9,8,e.test)," "),s(3),C(e.test.Owner)}}function Xn(t,l){if(t&1){let e=$();a(0,"div",6)(1,"a",10),o(2,"translate"),_("click",function(){S(e);let n=h();return T(n.unpublishTest())}),a(3,"i",11),c(4,"lock"),r(),a(5,"span"),c(6),o(7,"translate"),r()(),a(8,"bkd-caret",12),_("click",function(){S(e);let n=h();return T(n.emitToggleHeader())}),r()()}if(t&2){let e=h();s(),de("title",p(2,3,"tests.edit")),s(5),C(p(7,5,"tests.published")),s(2),m("expanded",e.expanded)}}function Zn(t,l){if(t&1){let e=$();a(0,"div",6)(1,"a",13),o(2,"translate"),_("click",function(){S(e);let n=h();return T(n.publishTest())}),a(3,"i",11),c(4,"lock_open"),r(),a(5,"span"),c(6),o(7,"translate"),r()(),a(8,"bkd-caret",12),_("click",function(){S(e);let n=h();return T(n.emitToggleHeader())}),r()()}if(t&2){let e=h();s(),de("title",p(2,3,"tests.publish")),s(5),C(p(7,5,"tests.not-published")),s(2),m("expanded",e.expanded)}}var Ui=(()=>{class t{constructor(){this.toggleHeader=new X,this.publish=new X,this.unpublish=new X}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=x({type:t,selectors:[["bkd-test-table-header"]],inputs:{test:"test",expanded:"expanded"},outputs:{toggleHeader:"toggleHeader",publish:"publish",unpublish:"unpublish"},standalone:!0,features:[y],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&&(a(0,"div",0)(1,"div",1),_("click",function(){return n.emitToggleHeader()}),a(2,"div",2),c(3),r(),E(4,"bkd-caret",3),r(),a(5,"div",4),I(6,Qn,12,12,"div",5)(7,Xn,9,7,"div",6)(8,Zn,9,7,"div",6),r()()),i&2&&(s(2),m("ngClass",n.expanded?"expanded":"collapsed"),s(),f(" ",n.test.Designation," "),s(),m("expanded",n.expanded),s(2),w(n.expanded?6:-1),s(),w(n.test.IsPublished?7:8))},dependencies:[ae,Ut,Vi,re,Ge,k,P,Ni],styles:["[_nghost-%COMP%]{font-weight:300}.collapsed[_ngcontent-%COMP%]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.test-designation[_ngcontent-%COMP%]{display:none!important}.test-status[_ngcontent-%COMP%]{order:-1;padding-bottom:1rem}.test-status[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{text-decoration:none}.test-status[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{color:#000}.test-status[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{text-decoration:underline}.test-status[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:hover{text-decoration-color:#ea161f}.edit[_ngcontent-%COMP%]{color:#00000080;text-decoration:none}@media (min-width: 811px){.test-designation[_ngcontent-%COMP%]{display:inherit!important}.test-status[_ngcontent-%COMP%]{order:initial}.expand-mobile[_ngcontent-%COMP%]{display:none!important}}"]})}}return t})();var es=["bkdTestEditGradesHeader",""],ot=(t,l)=>l.Id,ts=t=>({selected:t});function is(t,l){if(t&1){let e=$();a(0,"th",3)(1,"bkd-test-table-header",12),_("toggleHeader",function(n){S(e);let d=h();return T(d.state.toggleHeader(n))})("publish",function(n){S(e);let d=h();return T(d.publish.emit(n))})("unpublish",function(n){S(e);let d=h();return T(d.unpublish.emit(n))}),r()()}if(t&2){let e=l.$implicit,i=h(),n=B(4);m("ngClass",e.Id===(i.selectedTest==null?null:i.selectedTest.Id)?"selected":""),s(),m("test",e)("expanded",n)}}function ns(t,l){if(t&1){let e=$();a(0,"th",4)(1,"bkd-test-table-header",12),_("toggleHeader",function(n){S(e);let d=h();return T(d.state.toggleHeader(n))})("publish",function(n){S(e);let d=h();return T(d.publish.emit(n))})("unpublish",function(n){S(e);let d=h();return T(d.unpublish.emit(n))}),r()()}if(t&2){let e=l.$implicit,i=h(),n=B(4);m("ngClass",e.Id===(i.selectedTest==null?null:i.selectedTest.Id)?"selected":""),s(),m("test",e)("expanded",n)}}function ss(t,l){if(t&1){let e=$();a(0,"div",13)(1,"span",14),_("click",function(){S(e);let n=h().$implicit,d=h();return T(d.state.sortBy(n))}),c(2),o(3,"translate"),r()()}t&2&&(s(2),f("",p(3,1,"tests.points")," "))}function as(t,l){if(t&1){let e=$();a(0,"th",11)(1,"div",6),I(2,ss,4,3,"div",13),a(3,"div",7)(4,"span",14),_("click",function(){let n=S(e).$implicit,d=h();return T(d.state.sortBy(n))}),c(5),o(6,"translate"),r()(),a(7,"div",8),c(8),o(9,"async"),r()()()}if(t&2){let e=l.$implicit,i=h();m("ngClass",e.Id===(i.selectedTest==null?null:i.selectedTest.Id)?"selected":""),s(2),w(e.IsPointGrading?2:-1),s(3),C(p(6,4,"tests.grade")),s(3),f(" ",p(9,6,i.state.getSortingChar$(e))," ")}}var Wi=(()=>{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 X,this.unpublish=new X}getTop(){return this.element.nativeElement.getBoundingClientRect().top}getLeft(){return this.element.nativeElement.getBoundingClientRect().left}setTopOffset(e){this.element.nativeElement.style.top=`${e}px`}setLeftOffset(e){this.element.nativeElement.style.left=`${e}px`}getWidth(){return this.element.nativeElement.getBoundingClientRect().width}setWidth(e){this.element.nativeElement.style.width=`${e}px`}getColumnWidths(){return this.getRowsAndColumns().map(e=>e.map(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((u,g)=>{u.style.width=`${e[d][g]}px`,u.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((u,g)=>{u.style.height=`${e[d][g]}px`})),this.getRows().forEach((n,d)=>{let u=e[d].reduce((g,M)=>Math.max(g,M),0);n.style.height=`${u}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)(v(H),v(vt))}}static{this.\u0275cmp=x({type:t,selectors:[["thead","bkdTestEditGradesHeader",""]],hostVars:2,hostBindings:function(i,n){i&2&&se("sticky",n.sticky)},inputs:{selectedTest:"selectedTest",sticky:"sticky",shown:"shown"},outputs:{publish:"publish",unpublish:"unpublish"},standalone:!0,features:[y],attrs:es,decls:40,vars:29,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,"student-name",3,"click"],[1,"d-flex"],[1,"column-title"],[1,"sort-direction","ms-1"],[1,"student-grade","desktop",3,"click","ngClass"],[1,"border-end","student-average","desktop",3,"click"],["container","body",1,"test-grade",3,"ngClass"],[3,"toggleHeader","publish","unpublish","test","expanded"],[1,"column-title","me-3","point-input-container"],[3,"click"]],template:function(i,n){if(i&1){let d=$();R(0),o(1,"async"),R(2),o(3,"async"),R(4),o(5,"async"),a(6,"tr",0)(7,"th",1)(8,"bkd-test-table-filter",2),_("filterChange",function(g){return S(d),T(n.state.setFilter(g))}),r()(),z(9,is,2,3,"th",3,ot),z(11,ns,2,3,"th",4,ot),r(),a(13,"tr")(14,"th",5),_("click",function(){return S(d),T(n.state.sortBy("FullName"))}),a(15,"div",6)(16,"div",7),c(17),o(18,"translate"),r(),a(19,"div",8),c(20),o(21,"async"),r()()(),a(22,"th",9),_("click",function(){return S(d),T(n.state.sortBy("FinalGrade"))}),a(23,"div",6)(24,"div",7),c(25),o(26,"translate"),r(),a(27,"div",8),c(28),o(29,"async"),r()()(),a(30,"th",10),_("click",function(){return S(d),T(n.state.sortBy("TestsMean"))}),a(31,"div",6)(32,"div",7),c(33),o(34,"translate"),r(),a(35,"div",8),c(36),o(37,"async"),r()()(),z(38,as,10,8,"th",11,ot),r()}if(i&2){let d=p(1,8,n.state.filteredTests$),u=p(3,10,n.state.filter$);s(4),Y(p(5,12,n.state.expandedHeader$)),s(4),m("filter",u),s(),q(d),s(2),q(d),s(6),f(" ",p(18,15,"tests.student.name")," "),s(3),f(" ",p(21,17,n.state.getSortingChar$("FullName"))," "),s(2),m("ngClass",F(27,ts,n.selectedTest===void 0)),s(3),f(" ",p(26,19,"tests.grade")," "),s(3),f(" ",p(29,21,n.state.getSortingChar$("FinalGrade"))," "),s(5),f(" ",p(34,23,"tests.mean")," "),s(3),f(" ",p(37,25,n.state.getSortingChar$("TestsMean"))," "),s(2),q(d)}},dependencies:[j,ae,k,P,Hi,Ui],styles:["[_nghost-%COMP%]{--student-name-column-width: 225px;--student-grade-column-width: 147px;--student-average-column-width: 100px;--test-grade-column-width: 300px;--point-input-size: 4em;--student-grade-column-offset: var(--student-name-column-width);--student-average-column-offset: calc( var(--student-grade-column-offset) + var(--student-grade-column-width) );--test-columns-offset: calc( var(--student-average-column-offset) + var(--student-average-column-width) )}[_nghost-%COMP%] #stickyHeader[_ngcontent-%COMP%]{display:none}[_nghost-%COMP%] .scroll-test-table[_ngcontent-%COMP%]{display:table-caption;overflow-y:auto;height:auto}@media (min-width: 1000px){[_nghost-%COMP%]{--student-name-column-width: 275px}}th[_ngcontent-%COMP%], td[_ngcontent-%COMP%]{padding:1rem}td[_ngcontent-%COMP%]{vertical-align:middle}@media (min-width: 576px){[_nghost-%COMP%]{--point-input-size: 5em}}tr[_ngcontent-%COMP%]:not(.header-collapsible) th.test-grade[_ngcontent-%COMP%], td.test-grade[_ngcontent-%COMP%], th.student-grade[_ngcontent-%COMP%], td.student-grade[_ngcontent-%COMP%]{width:calc(var(--point-input-size) + 13ch + 3rem)}@media (max-width: 810px){.desktop[_ngcontent-%COMP%]:not(.selected), .student-grade[_ngcontent-%COMP%]:not(.selected), .student-average[_ngcontent-%COMP%], .test-grade[_ngcontent-%COMP%]:not(.selected){display:none}table[_ngcontent-%COMP%], tbody[_ngcontent-%COMP%], thead[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:100%}th[_ngcontent-%COMP%], tr[_ngcontent-%COMP%]{display:flex;width:100%}.student-name[_ngcontent-%COMP%]{flex:1;display:block}.test-grade[_ngcontent-%COMP%]{flex:none;display:block}}@media (min-width: 811px){.mobile[_ngcontent-%COMP%]{display:none}.student-name[_ngcontent-%COMP%]{width:var(--student-name-column-width);min-width:var(--student-name-column-width);max-width:var(--student-name-column-width)}.student-grade[_ngcontent-%COMP%]{width:var(--student-grade-column-width);min-width:var(--student-grade-column-width);max-width:var(--student-grade-column-width)}.student-average[_ngcontent-%COMP%]{width:var(--student-average-column-width);min-width:var(--student-average-column-width);max-width:var(--student-average-column-width)}.test-grade[_ngcontent-%COMP%]{min-width:var(--test-grade-column-width);max-width:var(--test-grade-column-width)}th.sticky[_ngcontent-%COMP%], td.sticky[_ngcontent-%COMP%]{position:sticky;left:0;background-color:#fff}th.sticky.student-grade[_ngcontent-%COMP%], td.sticky.student-grade[_ngcontent-%COMP%]{left:var(--student-grade-column-offset)}th.sticky.student-average[_ngcontent-%COMP%], td.sticky.student-average[_ngcontent-%COMP%]{left:var(--student-average-column-offset)}}@media (max-width: 1200px){[_nghost-%COMP%]{--student-average-column-width: 1px}.student-average[_ngcontent-%COMP%]{padding:0;overflow:hidden}}@media (min-width: 1201px){.student-average-inline[_ngcontent-%COMP%]{display:none}}.sticky[_nghost-%COMP%]{position:fixed;top:0;left:0;z-index:1000;display:none}tr[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{border-top:none;vertical-align:top}.header-collapsible[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{border-bottom:1px solid #dee2e6;padding:0 1rem}tr[_ngcontent-%COMP%] th.test-info-desktop[_ngcontent-%COMP%]{display:none!important}@media (min-width: 811px){.sticky.shown[_nghost-%COMP%]{display:table-header-group}tr[_ngcontent-%COMP%] th.test-info-mobile[_ngcontent-%COMP%]{display:none!important}tr[_ngcontent-%COMP%] th.test-info-desktop[_ngcontent-%COMP%]{display:table-cell!important}tr[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{border-top:none;padding-top:.25rem;padding-bottom:.25rem;border-top:initial}.sticky[_nghost-%COMP%]{margin-left:var(--test-columns-offset)}.sticky[_nghost-%COMP%] th.sticky[_ngcontent-%COMP%]{position:fixed}}"],changeDetection:0})}}return t})();var rs=(t,l)=>l.student.Id,os=(t,l)=>l.Id,ds=(t,l)=>l.id,zi=t=>({selected:t}),ls=t=>["student",t,"grades"],ps=t=>({"visible-on-mobile":t});function cs(t,l){if(t&1){let e=$();a(0,"bkd-grade-select",20),o(1,"async"),o(2,"async"),_("gradeIdSelected",function(n){S(e);let d=h(2);return T(d.state.overwriteFinalGrade(n))}),r()}if(t&2){let e=h().$implicit,i=h();m("options",p(1,4,i.state.gradingOptionsForCourse$()))("valueId",e.finalGrade.finalGradeId)("gradeId",e.finalGrade.id)("disabled",p(2,6,i.isEditFinalGradesAllowed(e))===!1)}}function ms(t,l){if(t&1&&(a(0,"div"),c(1),r()),t&2){let e=h().$implicit;s(),f(" ",e.finalGrade.freeHandGrade," ")}}function us(t,l){if(t&1&&(R(0),a(1,"td",12),E(2,"bkd-grade",21),o(3,"async"),r()),t&2){let e=l.$implicit,i=l.$index,n=h(),d=n.$implicit,u=n.$index,g=h(),M=e.grade;s(),m("ngClass",g.selectedTest!==void 0&&M.test.Id===g.selectedTest.Id?"selected":""),s(),m("grade",M)("gradeOptions",p(3,5,g.state.gradingOptionsForTest$(M.test)))("student",d.student)("tabIndex",(1+i)*1e3+u)}}function hs(t,l){if(t&1&&(a(0,"tr")(1,"td",15)(2,"a",16)(3,"div"),c(4),r(),a(5,"div",9),c(6),o(7,"translate"),o(8,"decimalOrDash"),r()()(),a(9,"td",17),I(10,cs,3,8,"bkd-grade-select",18)(11,ms,2,1,"div"),r(),a(12,"td",19),c(13),o(14,"decimalOrDash"),r(),z(15,us,4,7,"td",12,ds),r()),t&2){let e=l.$implicit,i=h();s(2),m("routerLink",F(16,ls,e.student.Id)),s(2),C(e.student.FullName),s(2),et(" ",p(7,8,"tests.mean"),": ",O(8,10,e.finalGrade==null?null:e.finalGrade.average,"1-3")," "),s(3),m("ngClass",F(18,zi,i.selectedTest===void 0)),s(),w(e.finalGrade&&!e.finalGrade.freeHandGrade?10:-1),s(),w(e.finalGrade&&e.finalGrade.freeHandGrade?11:-1),s(2),f(" ",O(14,13,e.finalGrade==null?null:e.finalGrade.average,"1-3")," "),s(2),q(i.getGrades(e))}}function gs(t,l){if(t&1&&(a(0,"td",12),E(1,"bkd-average-grades",22),r()),t&2){let e=l.$implicit,i=h();m("ngClass",e.Id===(i.selectedTest==null?null:i.selectedTest.Id)||e.Id===(i.selectedTest==null?null:i.selectedTest.Id)?"selected":""),s(),m("test",e)}}function fs(t,l){if(t&1){let e=$();a(0,"button",23),_("click",function(){S(e);let n=h();return T(n.setAverageAsFinalGrade())}),c(1),o(2,"translate"),r()}if(t&2){let e=h(),i=B(2);m("ngClass",F(4,ps,!i||!e.selectedTest)),s(),f(" ",p(2,2,"tests.set-final-grade")," ")}}var qi=(()=>{class t{constructor(e,i){this.state=e,this.modalService=i}ngOnInit(){this.state.setSorting({key:"FullName",ascending:!0})}setAverageAsFinalGrade(){this.state.course$.pipe(ne(1)).subscribe(e=>this.state.setAveragesAsFinalGrades({CourseIds:[e.Id]}))}isEditFinalGradesAllowed(e){return this.state.course$.pipe(b(i=>!!(Ye(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,We)}calculateGradeAverage(e){return this.safeAverage(e,ze)}safeAverage(e,i){try{return i(e).toString()}catch{return"\u2013"}}openModal(e){let i=this.modalService.open(Ri);return i.componentInstance.test=e,i}onCloseModal(e,i){e.result.then(n=>{n&&i()},()=>{})}static{this.\u0275fac=function(i){return new(i||t)(v(H),v(qe))}}static{this.\u0275cmp=x({type:t,selectors:[["bkd-test-edit-grades"]],inputs:{selectedTest:"selectedTest"},standalone:!0,features:[pe([we]),y],decls:39,vars:42,consts:[["inlineHeader",""],["stickyHeader",""],[1,"table-responsive-wrapper"],["bkdTestEditGradesHeaderSticky","",1,"table","table-hover","h-100",3,"inlineHeader","stickyHeader"],["bkdTestEditGradesHeader","",2,"display","block",3,"publish","unpublish","selectedTest"],["id","stickyHeader","bkdTestEditGradesHeader","",3,"publish","unpublish","sticky","selectedTest"],["id","scrollTestTable",1,"scroll-test-table"],[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,"action-buttons"],["data-testId","apply-average-button","type","button",1,"apply-average-button","btn","btn-primary","m-3",3,"ngClass"],[1,"student-name"],[3,"routerLink"],[1,"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=$();R(0),o(1,"async"),R(2),o(3,"async"),R(4),o(5,"async"),a(6,"div",2)(7,"table",3)(8,"thead",4,0),_("publish",function(g){return S(d),T(n.publish(g))})("unpublish",function(g){return S(d),T(n.unpublish(g))}),r(),a(10,"thead",5,1),_("publish",function(g){return S(d),T(n.publish(g))})("unpublish",function(g){return S(d),T(n.unpublish(g))}),r(),a(12,"tbody",6),z(13,hs,17,20,"tr",null,rs),a(15,"tr")(16,"td",7)(17,"div",8)(18,"div"),c(19),o(20,"translate"),r(),a(21,"div",9),c(22),o(23,"translate"),o(24,"async"),o(25,"decimalOrDash"),r()()(),a(26,"td",10),c(27),o(28,"async"),o(29,"decimalOrDash"),r(),a(30,"td",11),c(31),o(32,"async"),o(33,"decimalOrDash"),r(),z(34,gs,2,2,"td",12,os),r()()(),a(36,"div",13),I(37,fs,3,6,"button",14),o(38,"async"),r()()}if(i&2){let d=le(9),u=le(11),g=p(1,12,n.state.filteredTests$);s(2),Y(p(3,14,n.state.hasTests$));let M=p(5,17,n.state.studentGrades$);s(5),m("inlineHeader",d)("stickyHeader",u),s(),m("selectedTest",n.selectedTest),s(2),m("sticky",!0)("selectedTest",n.selectedTest),s(3),q(M),s(6),C(p(20,19,"tests.average")),s(3),et(" ",p(23,21,"tests.mean"),": ",O(25,25,p(24,23,n.state.meanOfStudentGradesForCourse$),"1-3")," "),s(4),m("ngClass",F(40,zi,n.selectedTest===void 0)),s(),f(" ",O(29,30,p(28,28,n.state.meanOfFinalGradesForCourse$),"1-3")," "),s(4),f(" ",O(33,35,p(32,33,n.state.meanOfStudentGradesForCourse$),"1-3")," "),s(3),q(g),s(3),w(p(38,38,n.state.canSetFinalGrade$)?37:-1)}},dependencies:[ae,re,Li,Bi,Di,j,k,P,Xt,Ai,Wi],styles:["[_nghost-%COMP%]{--student-name-column-width: 225px;--student-grade-column-width: 147px;--student-average-column-width: 100px;--test-grade-column-width: 300px;--point-input-size: 4em;--student-grade-column-offset: var(--student-name-column-width);--student-average-column-offset: calc( var(--student-grade-column-offset) + var(--student-grade-column-width) );--test-columns-offset: calc( var(--student-average-column-offset) + var(--student-average-column-width) )}[_nghost-%COMP%] #stickyHeader[_ngcontent-%COMP%]{display:none}[_nghost-%COMP%] .scroll-test-table[_ngcontent-%COMP%]{display:table-caption;overflow-y:auto;height:auto}@media (min-width: 1000px){[_nghost-%COMP%]{--student-name-column-width: 275px}}th[_ngcontent-%COMP%], td[_ngcontent-%COMP%]{padding:1rem}td[_ngcontent-%COMP%]{vertical-align:middle}@media (min-width: 576px){[_nghost-%COMP%]{--point-input-size: 5em}}tr[_ngcontent-%COMP%]:not(.header-collapsible) th.test-grade[_ngcontent-%COMP%], td.test-grade[_ngcontent-%COMP%], th.student-grade[_ngcontent-%COMP%], td.student-grade[_ngcontent-%COMP%]{width:calc(var(--point-input-size) + 13ch + 3rem)}@media (max-width: 810px){.desktop[_ngcontent-%COMP%]:not(.selected), .student-grade[_ngcontent-%COMP%]:not(.selected), .student-average[_ngcontent-%COMP%], .test-grade[_ngcontent-%COMP%]:not(.selected){display:none}table[_ngcontent-%COMP%], tbody[_ngcontent-%COMP%], thead[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:100%}th[_ngcontent-%COMP%], tr[_ngcontent-%COMP%]{display:flex;width:100%}.student-name[_ngcontent-%COMP%]{flex:1;display:block}.test-grade[_ngcontent-%COMP%]{flex:none;display:block}}@media (min-width: 811px){.mobile[_ngcontent-%COMP%]{display:none}.student-name[_ngcontent-%COMP%]{width:var(--student-name-column-width);min-width:var(--student-name-column-width);max-width:var(--student-name-column-width)}.student-grade[_ngcontent-%COMP%]{width:var(--student-grade-column-width);min-width:var(--student-grade-column-width);max-width:var(--student-grade-column-width)}.student-average[_ngcontent-%COMP%]{width:var(--student-average-column-width);min-width:var(--student-average-column-width);max-width:var(--student-average-column-width)}.test-grade[_ngcontent-%COMP%]{min-width:var(--test-grade-column-width);max-width:var(--test-grade-column-width)}th.sticky[_ngcontent-%COMP%], td.sticky[_ngcontent-%COMP%]{position:sticky;left:0;background-color:#fff}th.sticky.student-grade[_ngcontent-%COMP%], td.sticky.student-grade[_ngcontent-%COMP%]{left:var(--student-grade-column-offset)}th.sticky.student-average[_ngcontent-%COMP%], td.sticky.student-average[_ngcontent-%COMP%]{left:var(--student-average-column-offset)}}@media (max-width: 1200px){[_nghost-%COMP%]{--student-average-column-width: 1px}.student-average[_ngcontent-%COMP%]{padding:0;overflow:hidden}}@media (min-width: 1201px){.student-average-inline[_ngcontent-%COMP%]{display:none}}tbody[_ngcontent-%COMP%] td.student-name[_ngcontent-%COMP%]{padding-right:0}tbody[_ngcontent-%COMP%] td.student-name[_ngcontent-%COMP%], tbody[_ngcontent-%COMP%] td.student-name[_ngcontent-%COMP%] *[_ngcontent-%COMP%]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}tbody[_ngcontent-%COMP%] td.student-name[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{text-decoration:none}tbody[_ngcontent-%COMP%] td.student-name[_ngcontent-%COMP%] a[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:first-child{text-decoration:underline}tbody[_ngcontent-%COMP%] td.student-name[_ngcontent-%COMP%] a[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:first-child:hover{text-decoration-color:#ea161f}.student-average-inline[_ngcontent-%COMP%]{color:#4e4e4ef2;font-size:.875rem;line-height:1}@media (min-width: 811px){.table-responsive-wrapper[_ngcontent-%COMP%]{display:block;overflow-x:auto}table[_ngcontent-%COMP%]{border-collapse:separate;border-spacing:0}.action-buttons[_ngcontent-%COMP%]{position:sticky;left:0}}@media (max-width: 810px){.apply-average-button[_ngcontent-%COMP%]:not(.visible-on-mobile){display:none!important}}"]})}}return t})();var vs=()=>["/events"],_s=t=>({count:t});function Cs(t,l){if(t&1&&(a(0,"div",7),c(1),o(2,"translate"),r()),t&2){let e=h();s(),f(" ",O(2,1,e.course.ParticipatingStudents.length===1?"courses.registration":"courses.registrations",F(4,_s,e.course.ParticipatingStudents.length))," ")}}var Yi=(()=>{class t{constructor(e){this.reportsService=e,this.course$=new A(null),this.reports$=this.course$.pipe(b(i=>i?.Id),J(),L(i=>i?this.reportsService.getCourseReports(i):K([])),ut([]))}ngOnChanges(e){e.course&&this.course$.next(e.course.currentValue)}getDesignation(){return Ke(this.course)}static{this.\u0275fac=function(i){return new(i||t)(v(ti))}}static{this.\u0275cmp=x({type:t,selectors:[["bkd-tests-header"]],inputs:{course:"course"},standalone:!0,features:[he,y],decls:12,vars:7,consts:[[3,"link"],[1,"d-flex"],["routerLink","add",1,"edit","btn","btn-primary","btn-icon","ms-2"],[1,"material-icons"],[1,"ms-2",3,"reports"],["id","excel-import"],[1,"d-flex","flex-column","header"],[1,"additional-info"]],template:function(i,n){i&1&&(a(0,"bkd-backlink",0)(1,"div",1)(2,"a",2)(3,"i",3),c(4,"add"),r()(),E(5,"bkd-reports-link",4),o(6,"async"),E(7,"div",5),r()(),a(8,"div",6)(9,"h1"),c(10),r(),I(11,Cs,3,6,"div",7),r()),i&2&&(m("link",fe(6,vs)),s(5),m("reports",p(6,4,n.reports$)),s(5),C(n.getDesignation()),s(),w(n.course.ParticipatingStudents?11:-1))},dependencies:[si,re,Nt,j,k,P],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 bs=()=>[],xs=t=>({"visible-on-mobile":t});function ys(t,l){t&1&&E(0,"bkd-spinner")}function Ss(t,l){if(t&1){let e=$();a(0,"bkd-select",4),_("valueChange",function(n){S(e);let d=h(2);return T(n&&d.testSelected(n))}),r(),E(1,"bkd-test-edit-grades",5)}if(t&2){h(2);let e=B(6),i=B(8),n=B(10);m("options",e)("value",i)("allowEmpty",!1),s(),m("selectedTest",n)}}function Ts(t,l){t&1&&(a(0,"p",2),c(1),o(2,"translate"),r()),t&2&&(s(),C(p(2,1,"tests.no-tests")))}function ws(t,l){if(t&1&&(a(0,"a",3),o(1,"async"),a(2,"i",6),c(3,"arrow_right_alt"),r(),a(4,"span",7),c(5),o(6,"translate"),r()()),t&2){let e=h(2),i=B(4),n=B(10);de("href",p(1,3,e.buildLinkToRatingOverview()),Pe),m("ngClass",F(7,xs,!i||!n)),s(5),C(p(6,5,"tests.link-to-rating-overview"))}}function Is(t,l){if(t&1&&(E(0,"bkd-tests-header",1),I(1,Ss,2,4)(2,Ts,3,3,"p",2)(3,ws,7,9,"a",3),o(4,"async")),t&2){let e=h(),i=B(0),n=B(2);m("course",i),s(),w(n.length>0?1:2),s(2),w(p(4,3,e.state.canSetFinalGrade$)?3:-1)}}var Ki=(()=>{class t{constructor(e,i,n){this.settings=e,this.state=i,this.translate=n,this.selectTest$=new ee,this.testOptions$=this.state.tests$.pipe(b(d=>[{Key:-1,Value:this.translate.instant("tests.grade")},...d.map(u=>({Key:u.Id,Value:u.Designation}))]),J()),this.selectedTestId$=Me(this.selectTest$,this.state.tests$.pipe(ne(1),b(d=>d[0]?.Id))).pipe(J()),this.selectedTest$=this.selectedTestId$.pipe(L(d=>this.state.tests$.pipe(b(u=>u.find(g=>g.Id===d)))),J())}testSelected(e){this.selectTest$.next(e)}buildLinkToRatingOverview(){return this.state.course$.pipe(ne(1),b(e=>this.settings.eventlist.evaluation.replace(":id",String(e.Id))))}static{this.\u0275fac=function(i){return new(i||t)(v(_e),v(H),v(ie))}}static{this.\u0275cmp=x({type:t,selectors:[["bkd-tests-list"]],standalone:!0,features:[y],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),o(1,"async"),R(2),o(3,"async"),R(4),o(5,"async"),R(6),o(7,"async"),R(8),o(9,"async"),R(10),o(11,"async"),a(12,"div",0),I(13,ys,1,0,"bkd-spinner"),o(14,"async"),I(15,Is,5,5),r()),i&2){let d;Y(p(1,1,n.state.course$)),s(2),Y((d=p(3,4,n.state.tests$))!==null&&d!==void 0?d:fe(21,bs)),s(2),Y(p(5,7,n.state.hasTests$)),s(2),Y(p(7,10,n.testOptions$)),s(2),Y(p(9,13,n.selectedTestId$)),s(2),Y(p(11,16,n.selectedTest$)),s(3),w(p(14,19,n.state.loading$)?13:15)}},dependencies:[Yi,Te,qi,ae,Se,j,k,P],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 Xe=(()=>{class t{constructor(e,i){this.state=e,this.route=i,this.courseId$=this.route.paramMap.pipe(b(n=>Number(n.get("id"))),J()),this.destroy$=new ee}ngOnInit(){this.courseId$.pipe(oe(this.destroy$)).subscribe(e=>this.state.setCourseId(e))}ngOnDestroy(){this.destroy$.next()}static{this.\u0275fac=function(i){return new(i||t)(v(H),v(ve))}}static{this.\u0275cmp=x({type:t,selectors:[["bkd-tests"]],standalone:!0,features:[pe([H]),y],decls:1,vars:0,template:function(i,n){i&1&&E(0,"router-outlet")},dependencies:[$e]})}}return t})();var md=[{path:"",component:Ci,children:[{path:"",component:_i},{path:"current",component:vi},{path:":id",component:Xe,children:[{path:"tests",component:Ki}]},{path:":id/tests/:testId/edit",component:Xe,children:[{path:"",component:Fi}]},{path:":id/tests/add",component:Xe,children:[{path:"",component:Gi}]},{path:":id/tests",children:[ai]}]}];export{md as EVENTS_ROUTES}; +import{a as ri}from"./chunk-IOJSQGH6.js";import{a as oi,b as li}from"./chunk-32LHGY5Z.js";import{a as ci}from"./chunk-GKHN5TVX.js";import{a as ai}from"./chunk-HAT2K5YI.js";import"./chunk-4YGUAC2V.js";import{a as it,b as Wt,c as zt,d as qt,e as Yt,f as We,g as ze,h as Kt,i as Jt,j as Qt,k as Xt,l as Zt,m as Te,o as ei,p as ce,s as ii,u as ni,v as qe}from"./chunk-LLGOVPQJ.js";import"./chunk-2H6IFZM2.js";import"./chunk-QOR23F4L.js";import"./chunk-7FRZV7VF.js";import{a as Vt}from"./chunk-Y4QYVF5K.js";import"./chunk-OFB4XAK2.js";import{a as di}from"./chunk-6YG4BOT7.js";import{a as pi}from"./chunk-2U5ENDJH.js";import"./chunk-VUPOI3TG.js";import{a as Ut,d as ti}from"./chunk-WACRWBCS.js";import"./chunk-MIRGHONI.js";import"./chunk-YUHFF3NM.js";import{L as jt,U as si,p as At}from"./chunk-H6G6Q6V6.js";import{a as xe,c as Lt,l as ye}from"./chunk-NL5E3FC5.js";import{a as Nt,b as Ue}from"./chunk-YD3RJIHU.js";import{a as Ht,b as Se}from"./chunk-KK2SHN2W.js";import{f as Ot,g as Gt,i as $t,j as Ft,p as je,u as Ne}from"./chunk-AP373D4K.js";import{a as He}from"./chunk-B6WYZ7BT.js";import{$c as Re,Ab as y,B as lt,Bb as fe,Bd as Rt,C as pt,Cb as F,Cd as Bt,D as ct,Db as tt,Ed as Dt,F as ne,Gb as o,H as J,Ha as I,Hb as p,Ib as O,Id as ie,J as Oe,Jd as P,K as mt,Kd as k,Ld as Ve,M as Q,Ma as m,Mb as bt,Na as se,O as ut,P as L,R as oe,Ra as w,Ta as ge,Ua as z,Va as q,Wa as a,Wb as ae,X as ue,Xa as r,Ya as E,Yc as _e,Zb as j,_ as U,_b as Ge,a as D,aa as x,ab as $,b as N,bd as Ce,ca as ht,cb as _,cd as Be,da as gt,db as h,dd as yt,eb as _t,f as ee,fb as Ct,g as A,gb as de,gc as xt,gd as St,h as Ze,ha as he,hd as Tt,ia as S,id as De,ja as T,jd as wt,l as K,la as ft,ld as It,m as dt,mb as le,md as Et,n as b,nb as c,o as te,ob as C,pb as f,qa as X,qb as et,qd as Le,rc as ve,rd as Ae,sc as $e,sd as Pt,ta as vt,tc as Fe,td as kt,uc as re,ud as be,va as Pe,vd as Mt,w as Me,wa as s,wb as R,x as Ee,xa as v,xb as Y,yb as B,zb as pe}from"./chunk-IFJN5CDK.js";var Ji=t=>[t,"tests"];function Qi(t,l){if(t&1&&(a(0,"span"),c(1),o(2,"date"),E(3,"wbr"),c(4),o(5,"date"),r()),t&2){let e=h();s(),f("",O(2,2,e.event.dateFrom,"dd.MM.yyyy"),"\u2013"),s(3),C(O(5,5,e.event.dateTo,"dd.MM.yyyy"))}}function Xi(t,l){if(t&1&&(a(0,"a",6)(1,"i",8),c(2,"arrow_right_alt"),r(),a(3,"span",9),c(4),r()()),t&2){let e=h(2);m("routerLink",F(2,Ji,e.event.id)),s(4),C(e.event.evaluationText)}}function Zi(t,l){if(t&1&&(a(0,"a",7)(1,"i",8),c(2,"arrow_right_alt"),r(),a(3,"span",9),c(4),r()()),t&2){let e=h(2);m("href",e.event.evaluationLink,Pe),s(4),f("",e.event.evaluationText," ")}}function en(t,l){if(t&1&&(a(0,"div",5),I(1,Xi,5,4,"a",6)(2,Zi,5,2,"a",7),r()),t&2){let e=h();s(),w(e.event.evaluationLink?-1:1),s(),w(e.event.evaluationLink?2:-1)}}var mi=(()=>{class t{constructor(){this.withRatings=!0}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=x({type:t,selectors:[["bkd-events-list-entry"]],inputs:{event:"event",withRatings:"withRatings"},standalone:!0,features:[y],decls:11,vars:8,consts:[[1,"designation"],[3,"href"],[1,"date"],[1,"registrations"],[1,"registrations-label"],[1,"rating"],[1,"d-flex",3,"routerLink"],[1,"d-flex",3,"href"],[1,"material-icons"],[1,"ps-1"]],template:function(i,n){i&1&&(a(0,"div",0)(1,"a",1),c(2),r()(),a(3,"div",2),I(4,Qi,6,8,"span"),r(),a(5,"div",3),c(6),a(7,"span",4),c(8),o(9,"translate"),r()(),I(10,en,3,2,"div",5)),i&2&&(s(),m("href",n.event.detailLink,Pe),s(),C(n.event.designation),s(2),w(n.event.dateFrom&&n.event.dateTo?4:-1),s(2),f(" ",n.event.studentCount," "),s(2),C(p(9,6,n.event.studentCount===1?"events.registration":"events.registrations")),s(2),w(n.withRatings&&n.event.evaluationText?10:-1))},dependencies:[re,Ge,k,P],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 tn=10300,nn=10260,sn=10250,an=14030,rn=10350;function Ye(t){let{HasEvaluationStarted:l,EvaluationUntil:e,HasTestGrading:i}=t.EvaluationStatusRef;if(l===!0&&(t.StatusId===an||t.StatusId===rn))return{value:Z.Rating};if(l===!0&&i===!1){if(e)return{value:Z.RatingUntil};if(t.StatusId===tn)return{value:Z.IntermediateRating}}return l===!1&&i===!0&&t.StatusId!==nn&&t.StatusId!==sn?{value:Z.Tests}:l===!0&&i===!0?e?{value:Z.Tests,label:Z.RatingUntil}:{value:Z.Tests,label:Z.IntermediateRating}:null}function ui(t){return t.EvaluationStatusRef.HasEvaluationStarted===!0}function hi(t){return t.EvaluationStatusRef.HasReviewOfEvaluationStarted===!0&&!!t.FinalGrades?.length}function Ke(t){let l=t.Classes?t.Classes.map(e=>e.Number).join(", "):null;return l?t.Designation+", "+l:t.Designation}function gi(t,l){return t?(l.Leadership??"").split(",").some(e=>e.trim()===t.fullname):!1}var Z=function(t){return t.Rating="rating",t.RatingUntil="rating-until",t.IntermediateRating="intermediate-rating",t.Tests="add-tests",t}(Z||{}),we=(()=>{class t{constructor(e,i,n,d,u,g,M){this.coursesRestService=e,this.eventsRestService=i,this.studyClassRestService=n,this.loadingService=d,this.storageService=u,this.translate=g,this.settings=M,this.loading$=this.loadingService.loading$,this.searchFields$=new A(["designation"]),this.searchSubject$=new A(""),this.search$=this.searchSubject$.asObservable(),this.roles$=new A(null),this.isClassTeacher$=this.roles$.pipe(b(V=>Vt(V,"ClassTeacherRole")),Q(1)),this.withStudyCourses$=new A(!1),this.unratedCourses$=this.roles$.pipe(L(this.loadUnratedCourses.bind(this)),Q(1)),this.studyCourses$=this.withStudyCourses$.pipe(L(this.loadStudyCourses.bind(this)),Q(1)),this.formativeAssessments$=this.isClassTeacher$.pipe(L(this.loadFormativeAssessments.bind(this)),Q(1)),this.studyClasses$=this.isClassTeacher$.pipe(L(this.loadStudyClasses.bind(this)),Q(1)),this.events$=this.getEvents().pipe(Q(1)),this.filteredEvents$=te([this.events$,this.searchFields$,this.search$]).pipe(b(ye(oi)))}setSearch(e){this.searchSubject$.next(e)}setRoles(e){this.roles$.next(e)}setWithStudyCourses(e){this.withStudyCourses$.next(e)}setSearchFields(e){this.searchFields$.next(e)}getEntries(e=!1){return this.filteredEvents$.pipe(b(i=>e?i.filter(n=>n.evaluationText):i))}getEvents(){return this.loadingService.load(te([this.unratedCourses$,this.studyCourses$,this.formativeAssessments$,this.studyClasses$]),{stopOnFirstValue:!0}).pipe(b(ye(this.createAndSortEvents.bind(this))))}loadUnratedCourses(e){return this.coursesRestService.getExpandedCourses(e).pipe(b(i=>i.filter(n=>!hi(n))))}loadStudyCourses(e){return e?this.eventsRestService.getStudyCourseEvents():K([])}loadFormativeAssessments(e){return e?this.studyClassRestService.getActiveFormativeAssessments():K([])}loadStudyClasses(e){return e?this.studyClassRestService.getActive():K([])}createAndSortEvents(e,i,n,d){let u=d.filter(g=>!n.map(M=>M.Id).includes(g.Id));return[...this.createFromCourses(e),...this.createFromStudyCourses(i),...this.createFromAssessments(n),...this.createFromStudyClasses(u)].sort((g,M)=>g.designation.localeCompare(M.designation))}createFromCourses(e){return e.map(i=>{let n=Ye(i);return{id:i.Id,designation:Ke(i),detailLink:this.buildLink(i.Id,"eventdetail"),studentCount:i.AttendanceRef.StudentCount||0,dateFrom:i.DateFrom,dateTo:i.DateTo,state:n?.value||null,evaluationText:this.getEvaluationText(n,i.EvaluationStatusRef.EvaluationUntil),evaluationLink:this.getEvaluationLink(n?.value,i)}})}createFromStudyCourses(e){let i=this.storageService.getPayload();return e.filter(n=>gi(i,n)).map(n=>({id:n.Id,designation:n.Designation,detailLink:this.buildLink(n.Id,"eventdetail"),studentCount:n.StudentCount,state:null}))}createFromAssessments(e){return this.createFromStudyClasses(e).map(n=>N(D({},n),{state:Z.Rating,evaluationText:this.translate.instant("events.state.rating"),evaluationLink:this.buildLink(n.id,"evaluation")}))}createFromStudyClasses(e){return e.map(i=>({id:i.Id,designation:i.Number,detailLink:this.buildLink(i.Id,"eventdetail"),studentCount:i.StudentCount,state:null}))}getEvaluationText(e,i){let n=e?.label||e?.value;return n?this.translate.instant(`events.state.${n}`)+(n===Z.RatingUntil?` ${i?At(i,"dd.MM.yyyy"):""}`:""):""}getEvaluationLink(e,i){return e&&e!==Z.Tests?this.buildLink(i.Id,"evaluation"):null}buildLink(e,i){return(this.settings.eventlist[i]??"").replace(":id",String(e))}static{this.\u0275fac=function(i){return new(i||t)(U(ce),U(ri),U(ci),U(Ue),U(Ve),U(ie),U(_e))}}static{this.\u0275prov=ue({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var pn=(t,l)=>l.id,cn=()=>[];function mn(t,l){t&1&&E(0,"bkd-spinner")}function un(t,l){t&1&&(a(0,"div",7),c(1),o(2,"translate"),r()),t&2&&(s(),f(" ",p(2,1,"events.rating")," "))}function hn(t,l){if(t&1&&E(0,"bkd-events-list-entry",8),t&2){let e=l.$implicit,i=h(3);m("event",e)("withRatings",i.withRatings)}}function gn(t,l){if(t&1&&(a(0,"div",3)(1,"div",4),c(2),o(3,"translate"),r(),a(4,"div",5),c(5),o(6,"translate"),r(),a(7,"div",6),c(8),o(9,"translate"),r(),I(10,un,3,3,"div",7),r(),z(11,hn,1,2,"bkd-events-list-entry",8,pn)),t&2){let e=h(2),i=B(0);s(2),C(p(3,4,"events.designation")),s(3),C(p(6,6,"events.date")),s(3),f(" ",p(9,8,"events.registrations")," "),s(2),w(e.withRatings?10:-1),s(),q(i)}}function fn(t,l){t&1&&(a(0,"p",2),c(1),o(2,"translate"),r()),t&2&&(s(),C(p(2,1,"events.no-events")))}function vn(t,l){if(t&1&&I(0,gn,13,10)(1,fn,3,3,"p",2),t&2){h();let e=B(0);w(e.length>0?0:1)}}var fi=["designation"],_n=[...fi,"evaluationText"],Je=(()=>{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?_n:fi)}static{this.\u0275fac=function(i){return new(i||t)(v(we),v(Ve))}}static{this.\u0275cmp=x({type:t,selectors:[["bkd-events-list"]],inputs:{withStudyCourses:"withStudyCourses",withRatings:"withRatings"},standalone:!0,features:[he,y],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=$();R(0),o(1,"async"),a(2,"div",0)(3,"bkd-resettable-input",1),o(4,"async"),o(5,"translate"),o(6,"translate"),_("valueChange",function(g){return S(d),T(n.state.setSearch(g))}),r(),I(7,mn,1,0,"bkd-spinner"),o(8,"async"),I(9,vn,2,1),r()}if(i&2){let d,u=Y((d=p(1,5,n.state.getEntries(n.withRatings)))!==null&&d!==void 0?d:fe(16,cn));s(3),m("value",p(4,8,n.state.search$))("placeholder",p(5,10,"events.search-by"))("label",p(6,12,"events.search"))("disabled",!u),s(4),w(p(8,14,n.state.loading$)?7:9)}},dependencies:[li,Se,j,k,P,mi],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 vi=(()=>{class t{constructor(){}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=x({type:t,selectors:[["bkd-events-current"]],standalone:!0,features:[y],decls:4,vars:5,consts:[[3,"withStudyCourses","withRatings"]],template:function(i,n){i&1&&(a(0,"h1"),c(1),o(2,"translate"),r(),E(3,"bkd-events-list",0)),i&2&&(s(),C(p(2,3,"events.current.title")),s(2),m("withStudyCourses",!0)("withRatings",!1))},dependencies:[Je,k,P]})}}return t})();var _i=(()=>{class t{constructor(){}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=x({type:t,selectors:[["bkd-events-tests"]],standalone:!0,features:[y],decls:4,vars:4,consts:[[3,"withRatings"]],template:function(i,n){i&1&&(a(0,"h1"),c(1),o(2,"translate"),r(),E(3,"bkd-events-list",0)),i&2&&(s(),C(p(2,2,"events.title")),s(2),m("withRatings",!0))},dependencies:[Je,k,P]})}}return t})();var Ci=(()=>{class t{constructor(){}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=x({type:t,selectors:[["bkd-events"]],standalone:!0,features:[pe([we,jt]),y],decls:1,vars:0,template:function(i,n){i&1&&E(0,"router-outlet")},dependencies:[$e]})}}return t})();function bi(t){return l=>{let e=Number(l.value);return e<=t?{greaterThan:{value:e,greaterThanValue:t}}:null}}function st(t){return t.map(({finalGrade:l})=>l).filter(Cn)}function Cn(t){return t!==null}function Si(t,l,e,i){return t?.map(n=>({student:n,finalGrade:xn(n,e,i),grades:bn(n,l)}))}function bn(t,l){return l.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 xn(t,l,e){let i=l.find(d=>d.StudentId===t.Id),n=e.find(d=>d.StudentId===t.Id);return i?{id:i.Id,average:yn(i),finalGradeId:i.GradeId,freeHandGrade:n?Number(n.Grade):null,canGrade:i.CanGrade}:null}function yn(t){return t.AverageTestResult===0?null:t.AverageTestResult}var Ti=({key:t,ascending:l})=>(e,i)=>{let n=l?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*xi(e.finalGrade.finalGradeId,i.finalGrade.finalGradeId);case"TestsMean":return!e.finalGrade?.average||!i.finalGrade?.average?n*-1:n*xi(e.finalGrade.average,i.finalGrade.average)}return n*Sn(t,e,i)},Sn=(t,l,e)=>{let i=l.grades.filter(yi).find(d=>d.test.Id===t.Id),n=e.grades.filter(yi).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 xi(t,l){return t===l?0:te.average).filter(e=>e!=null&&e!==0).map(Number);return it(l)}function Ei(t,l){let e=t.map(n=>n.freeHandGrade).filter(n=>!!n),i=t.map(n=>n.finalGradeId).filter(n=>n!==null).map(n=>l.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 it([...i,...e])}function at(t,l){return[...l.filter(e=>e.Id!==t?.Id),t].filter(e=>e!=null)}function Pi({id:t,selectedGradeId:l},e){return e.map(i=>i.Id!==t?i:N(D({},i),{GradeId:l}))}function ki(t,l){switch(l.type){case"reset":return l.payload;case"updateResult":return t?N(D({},t),{Tests:zt(l.payload.testResult,t.Tests||[],l.payload.ignore),Gradings:l.payload.grading?at(l.payload.grading,t.Gradings||[]):t.Gradings}):null;case"deleteResult":return t?N(D({},t),{Tests:qt(l.payload.testId,l.payload.studentId,t.Tests||[]),Gradings:l.payload.grading?at(l.payload.grading,t.Gradings||[]):t.Gradings||[]}):null;case"toggle-test-state":return t?N(D({},t),{Tests:Yt(l.payload,t.Tests||[])}):null;case"final-grade-overwritten":return t?N(D({},t),{Gradings:Pi({id:l.payload.id,selectedGradeId:l.payload.selectedGradeId},t.Gradings||[])}):null;case"replace-grades":return t?N(D({},t),{Gradings:l.payload}):null;case"delete-test":return t?N(D({},t),{Tests:Kt(l.payload,t.Tests||[])}):null;default:return t}}var Mi=(()=>{class t extends Ht{constructor(e,i){super(e,i,ei,"Gradings")}updateGrade(e,i){return this.http.put(`${this.baseUrl}/${e}`,{GradeId:i}).pipe(b(()=>e))}static{this.\u0275fac=function(i){return new(i||t)(U(xt),U(_e))}}static{this.\u0275prov=ue({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var rt={onlyMine:!1,hidePublished:!1},H=(()=>{class t{constructor(e,i,n,d,u){this.coursesRestService=e,this.gradingScalesRestService=i,this.gradingsRestService=n,this.loadingService=d,this.sortService=u,this.action$=new Ze(1),this.loading$=this.loadingService.loading$,this._courseId$=new Ze(1),this.courseId$=this._courseId$.asObservable(),this.fetchedCourse$=this._courseId$.pipe(L(g=>this.loadingService.load(this.coursesRestService.getExpandedCourse(g))),Q(1)),this.course$=Me(this.action$,this.fetchedCourse$.pipe(Ee(Ne),b(g=>({type:"reset",payload:g})))).pipe(mt(ki,null),Ee(Ne),Q(1)),this.tests$=this.course$.pipe(b(g=>g.Tests||[]),b(Jt)),this.hasTests$=this.tests$.pipe(b(g=>g.length>0)),this.filterSubject$=new A(rt),this.filter$=this.filterSubject$.asObservable(),this.expandedHeaderSubject$=new A(!1),this.expandedHeader$=this.expandedHeaderSubject$.asObservable(),this.filteredTests$=te([this.tests$,this.filter$]).pipe(b(([g,M])=>g.filter(V=>(!M.onlyMine||V.IsOwner)&&(!M.hidePublished||!V.IsPublished)))),this.sorting$=this.sortService.sorting$,this.studentGrades$=te([this.course$,this.filteredTests$,this.sorting$]).pipe(b(ye(this.toStudentGrades.bind(this)))),this.canSetFinalGrade$=this.course$.pipe(b(ui)),this.gradingScaleIds$=this.course$.pipe(b(g=>Bt([...(g.Tests??[]).map(M=>M.GradingScaleId),g.GradingScaleId]).filter(Ne)),J(Rt),Q(1)),this.gradingScales$=this.gradingScaleIds$.pipe(L(g=>this.gradingScalesRestService.getGradingScales(g)),Q(1)),this.UNDEFINED_GRADINGSCALE_ID=-1,this.gradingScalesOptions$=this.gradingScales$.pipe(b(g=>g.map(M=>{let V=M?.Id||this.UNDEFINED_GRADINGSCALE_ID,Ie=M?.Grades.map(ke=>({Key:ke.Id,Value:ke.Designation}))||[];return{id:V,options:Ie}}).reduce((M,V)=>N(D({},M),{[V.id]:V.options}),{})),Q(1)),this.meanOfStudentGradesForCourse$=this.studentGrades$.pipe(b(g=>Ii(st(g)))),this.meanOfFinalGradesForCourse$=te([this.gradingScalesOptions$,this.studentGrades$]).pipe(L(ye(this.meanOfOverwrittenGradesForCourse.bind(this))))}setCourseId(e){this._courseId$.next(e)}setFilter(e){this.filterSubject$.next(e)}gradingOptionsForTest$(e){return this.gradingOptions$(e.GradingScaleId)}gradingOptionsForCourse$(){return this.course$.pipe(L(e=>this.gradingOptions$(e.GradingScaleId)))}toStudentGrades(e,i=[],n){return Si(e.ParticipatingStudents??[],i,e.Gradings??[],e.FinalGrades??[]).sort(Ti(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(ne(1),b(i=>{let{originalResult:n,updatedResult:d}=this.buildOptimisticResultUpdate(i,e);return this.updateTestResult(d,null),n}))}saveGrade(e,i){this.course$.pipe(ne(1),L(n=>this.coursesRestService.updateTestResult(n.Id,e).pipe(lt(d=>(i&&this.updateTestResult(D({},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=Wt(e,i.testId,i.studentId),d=n?D({},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,u){n?this.updateTestResult(n,d,u):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?K(null):this.gradingScalesOptions$.pipe(b(i=>i[e]),Q(1))}meanOfOverwrittenGradesForCourse(e,i){return this.course$.pipe(b(n=>{if(n.GradingScaleId===null||e[n.GradingScaleId]===void 0)return null;let d=e[n.GradingScaleId];return Ei(st(i),d)}))}static{this.\u0275fac=function(i){return new(i||t)(U(ce),U(ii),U(Mi),U(Ue),U(pi))}}static{this.\u0275prov=ue({token:t,factory:t.\u0275fac})}}return t})();var In=t=>["/events",t,"tests"];function En(t,l){if(t&1&&(a(0,"div",7),c(1),o(2,"translate"),r()),t&2){let e=l.$implicit;s(),f(" ",O(2,1,"global.validation-errors."+e.error,e.params)," ")}}function Pn(t,l){if(t&1&&(a(0,"div",7),c(1),o(2,"translate"),r()),t&2){let e=l.$implicit;s(),f(" ",O(2,1,"global.validation-errors."+e.error,e.params)," ")}}function kn(t,l){if(t&1&&(a(0,"div",7),c(1),o(2,"translate"),r()),t&2){let e=l.$implicit;s(),f(" ",O(2,1,"global.validation-errors."+e.error,e.params)," ")}}function Mn(t,l){if(t&1&&(a(0,"div",7),c(1),o(2,"translate"),r()),t&2){let e=l.$implicit;s(),f(" ",O(2,1,"global.validation-errors."+e.error,e.params)," ")}}function On(t,l){if(t&1&&(a(0,"div",7),c(1),o(2,"translate"),r()),t&2){let e=l.$implicit;s(),f(" ",O(2,1,"global.validation-errors."+e.error,e.params)," ")}}function Gn(t,l){if(t&1&&(a(0,"div",29)(1,"div",30)(2,"div",16)(3,"label",31),c(4),o(5,"translate"),r(),a(6,"div",32),E(7,"input",33),o(8,"async"),z(9,Mn,3,4,"div",7,ge),o(11,"async"),r()()(),a(12,"div",30)(13,"div",16)(14,"label",34),c(15),o(16,"translate"),r(),a(17,"div",32),E(18,"input",35),o(19,"async"),z(20,On,3,4,"div",7,ge),o(22,"async"),r()()()(),a(23,"div",36),ft(),a(24,"math")(25,"mi"),c(26),o(27,"translate"),r(),a(28,"mo"),c(29,"="),r(),a(30,"mfrac")(31,"mrow")(32,"mi"),c(33),o(34,"translate"),r(),a(35,"mo"),c(36,"\xD7"),r(),a(37,"mn"),c(38,"5"),r()(),a(39,"mi"),c(40),o(41,"translate"),r()(),a(42,"mo"),c(43,"+"),r(),a(44,"mn"),c(45,"1"),r()()()),t&2){let e,i,n=h(2);s(4),C(p(5,9,"tests.form.max-points")),s(3),se("is-invalid",((e=p(8,11,n.maxPointsErrors$))==null?null:e.length)||!1),s(2),q(p(11,13,n.maxPointsErrors$)),s(6),C(p(16,15,"tests.form.max-points-adjusted")),s(3),se("is-invalid",((i=p(19,17,n.maxPointsAdjustedErrors$))==null?null:i.length)||!1),s(2),q(p(22,19,n.maxPointsAdjustedErrors$)),s(6),f(" ",p(27,21,"tests.form.math.grade")," "),s(7),f(" ",p(34,23,"tests.form.math.points")," "),s(7),C(p(41,25,"tests.form.math.max-points"))}}function $n(t,l){t&1&&(a(0,"div",28)(1,"span",37),c(2,"Loading..."),r()())}function Fn(t,l){if(t&1){let e=$();a(0,"form",2),_("ngSubmit",function(){S(e);let n=h();return T(n.onSubmit())}),a(1,"div",3)(2,"div",4)(3,"label",5),c(4),o(5,"translate"),r(),E(6,"input",6),o(7,"async"),o(8,"translate"),z(9,En,3,4,"div",7,ge),o(11,"async"),r(),a(12,"div",8)(13,"label",9),c(14),o(15,"translate"),r(),a(16,"div",10)(17,"span",11)(18,"i",12),c(19,"calendar_today"),r()(),a(20,"input",13,0),o(22,"async"),o(23,"translate"),_("click",function(){S(e);let n=le(21);return T(n.toggle())}),r(),z(24,Pn,3,4,"div",7,ge),o(26,"async"),r()()(),a(27,"div",14)(28,"label",15),c(29),o(30,"translate"),r(),a(31,"div",4)(32,"div",16)(33,"label",17),c(34),o(35,"translate"),r(),a(36,"div",18),E(37,"input",19),o(38,"async"),z(39,kn,3,4,"div",7,ge),o(41,"async"),r()()()(),a(42,"div")(43,"label",15),c(44),o(45,"translate"),r(),a(46,"div",20),E(47,"input",21),a(48,"label",22),c(49),o(50,"translate"),r()(),a(51,"div",20),E(52,"input",23),a(53,"label",24),c(54),o(55,"translate"),r()(),I(56,Gn,46,27),r(),a(57,"div",25)(58,"button",26),o(59,"async"),c(60),o(61,"translate"),r(),a(62,"button",27),c(63),o(64,"translate"),I(65,$n,3,0,"div",28),r()()()}if(t&2){let e,i,n,d,u=h();m("formGroup",u.formGroup),s(4),C(p(5,26,"tests.form.designation")),s(2),se("is-invalid",((e=p(7,28,u.designationErrors$))==null?null:e.length)||!1),m("placeholder",p(8,30,"tests.form.designation-placeholder")),s(3),q(p(11,32,u.designationErrors$)),s(5),C(p(15,34,"tests.form.date")),s(3),m("id",u.componentId),s(3),se("is-invalid",((i=p(22,36,u.dateErrors$))==null?null:i.length)||!1),m("placeholder",p(23,38,"shared.date-select.default-placeholder")),s(4),q(p(26,40,u.dateErrors$)),s(5),C(p(30,42,"tests.form.weight")),s(5),C(p(35,44,"tests.form.factor")),s(3),se("is-invalid",((n=p(38,46,u.weightErrors$))==null?null:n.length)||!1),s(2),q(p(41,48,u.weightErrors$)),s(5),C(p(45,50,"tests.form.grading-type")),s(3),m("value",!1),s(2),C(p(50,52,"tests.form.grades")),s(3),m("value",!0),s(2),C(p(55,54,"tests.form.points")),s(2),w((d=u.formGroup.get("isPointGrading"))!=null&&d.value?56:-1),s(2),m("disabled",u.saving)("routerLink",F(62,In,p(59,56,u.courseId$))),s(2),f(" ",p(61,58,"tests.form.cancel")," "),s(2),m("disabled",u.saving),s(),f(" ",p(64,60,"tests.form.save")," "),s(2),w(u.saving?65:-1)}}var Qe=(()=>{class t{constructor(e,i,n){this.fb=e,this.translate=i,this.testStateService=n,this.test=null,this.saving=!1,this.save=new X,this.componentId=Dt("bkd-tests-edit-form"),this.formGroup=this.createFormGroup(),this.submitted$=new A(!1),this.destroy$=new ee,this.designationErrors$=xe(K(this.formGroup),this.submitted$,"designation"),this.dateErrors$=xe(K(this.formGroup),this.submitted$,"date"),this.maxPointsErrors$=xe(K(this.formGroup),this.submitted$,"maxPoints"),this.maxPointsAdjustedErrors$=xe(K(this.formGroup),this.submitted$,"maxPointsAdjusted"),this.weightErrors$=xe(K(this.formGroup),this.submitted$,"weight"),this.courseId$=this.testStateService.courseId$}ngOnInit(){this.test&&this.setInitialValues(this.test),Lt(K(this.formGroup),"isPointGrading").pipe(oe(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:["",Ce.required],date:[null,Ce.required],weight:[1,Ce.compose([Ce.required,bi(0)])],isPointGrading:[!1],maxPoints:[{value:null,disabled:!0},Ce.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)(v(kt),v(ie),v(H))}}static{this.\u0275cmp=x({type:t,selectors:[["bkd-tests-edit-form"]],inputs:{test:"test",saving:"saving"},outputs:{save:"save"},standalone:!0,features:[pe([{provide:Ot,useClass:Ft},{provide:Gt,useClass:di}]),y],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&&I(0,Fn,66,64,"form",1),i&2&&w(n.formGroup?0:-1)},dependencies:[be,Tt,Re,De,wt,Be,yt,Pt,Ae,Le,Mt,It,Et,$t,re,j,k,P],styles:["#factor[_ngcontent-%COMP%], #max-points[_ngcontent-%COMP%], #max-points-adjusted[_ngcontent-%COMP%]{width:5em}"]})}}return t})();var Gi=(()=>{class t{constructor(e,i,n,d,u){this.route=e,this.courseService=i,this.toastService=n,this.translate=d,this.router=u,this.saving$=new A(!1),this.courseId$=this.route.paramMap.pipe(b(g=>Number(g.get("id"))),J())}save(e){this.saving$.next(!0);let{designation:i,date:n,weight:d,isPointGrading:u,maxPoints:g,maxPointsAdjusted:M}=e;this.courseId$.pipe(L(V=>this.courseService.add(V,n,i,d,u,g,M)),Oe(()=>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)(v(ve),v(ce),v(He),v(ie),v(Fe))}}static{this.\u0275cmp=x({type:t,selectors:[["bkd-tests-add"]],standalone:!0,features:[y],decls:6,vars:6,consts:[[1,"bkd-container","bkd-container-limited"],[3,"save","saving"]],template:function(i,n){i&1&&(a(0,"h1"),c(1),o(2,"translate"),r(),a(3,"div",0)(4,"bkd-tests-edit-form",1),o(5,"async"),_("save",function(u){return n.save(u)}),r()()),i&2&&(s(),C(p(2,2,"tests.add-title")),s(3),m("saving",p(5,4,n.saving$)))},dependencies:[Qe,j,k,P]})}}return t})();var $i=(()=>{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)(v(je))}}static{this.\u0275cmp=x({type:t,selectors:[["bkd-tests-delete"]],inputs:{test:"test"},standalone:!0,features:[y],decls:13,vars:10,consts:[[1,"modal-body"],["data-testid","confirmation-message"],[1,"modal-footer"],["data-testid","cancel-button","type","button",1,"btn","btn-outline-secondary",3,"click","hidden"],[1,"px-2"],["data-testid","confirm-button","type","button",1,"btn","btn-primary",3,"click"],[1,"px-3"]],template:function(i,n){i&1&&(a(0,"div",0)(1,"p",1),c(2),o(3,"translate"),r()(),a(4,"div",2)(5,"button",3),_("click",function(){return n.activeModal.dismiss()}),a(6,"span",4),c(7),o(8,"translate"),r()(),a(9,"button",5),_("click",function(){return n.activeModal.close(n.canDeleteTest?n.test:null)}),a(10,"span",6),c(11),o(12,"translate"),r()()()),i&2&&(s(2),f(" ",p(3,4,n.canDeleteTest?"tests.form.confirm":"tests.form.delete-not-allowed")," "),s(3),m("hidden",!n.canDeleteTest),s(2),f(" ",p(8,6,"tests.dialog.no")," "),s(4),f(" ",p(12,8,n.canDeleteTest?"tests.dialog.yes":"tests.dialog.ok")," "))},dependencies:[k,P]})}}return t})();var Ln=t=>({test:t});function An(t,l){t&1&&E(0,"bkd-spinner")}function jn(t,l){if(t&1){let e=$();a(0,"div",1)(1,"h1"),c(2),o(3,"translate"),r(),a(4,"button",2),_("click",function(){S(e);let n=h(),d=B(0);return T(n.openDeleteModal(d))}),a(5,"i",3),c(6,"delete"),r()()(),a(7,"bkd-tests-edit-form",4),_("save",function(n){S(e);let d=h();return T(d.save(n))}),r()}if(t&2){h();let e=B(0),i=B(2);s(2),f(" ",O(3,3,"tests.edit-title",F(6,Ln,e.Designation))," "),s(5),m("test",e)("saving",i)}}var Fi=(()=>{class t{constructor(e,i,n,d,u,g,M){this.state=e,this.courseService=i,this.route=n,this.toastService=d,this.translate=u,this.router=g,this.modalService=M,this.saving$=new A(!1),this.testId$=this.route.paramMap.pipe(b(V=>Number(V.get("testId"))),J()),this.test$=te([this.state.tests$,this.testId$]).pipe(b(([V,Ie])=>V.find(ke=>ke.Id===Ie)))}openDeleteModal(e){let i=this.modalService.open($i);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:u,maxPoints:g,maxPointsAdjusted:M}=e;te([this.state.courseId$,this.testId$]).pipe(ne(1),L(([V,Ie])=>this.courseService.update(V,Ie,i,n,d,u,g,M)),Oe(()=>this.saving$.next(!1))).subscribe(this.onSaveSuccess.bind(this))}onSaveSuccess(){this.toastService.success(this.translate.instant("tests.form.save-success")),this.navigateBack()}onDeleteSuccess(e){this.toastService.success(this.translate.instant("tests.form.delete-success")),this.state.deleteTest(e),this.navigateBack()}navigateBack(){this.state.courseId$.pipe(ne(1)).subscribe(e=>void this.router.navigate(["events",e,"tests"]))}static{this.\u0275fac=function(i){return new(i||t)(v(H),v(ce),v(ve),v(He),v(ie),v(Fe),v(qe))}}static{this.\u0275cmp=x({type:t,selectors:[["bkd-tests-edit"]],standalone:!0,features:[y],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),o(1,"async"),R(2),o(3,"async"),a(4,"div",0),I(5,An,1,0,"bkd-spinner"),o(6,"async"),I(7,jn,8,8),r()),i&2){let d=Y(p(1,1,n.test$));s(2),Y(p(3,4,n.saving$)),s(3),w(p(6,7,n.state.loading$)?5:d?7:-1)}},dependencies:[Qe,Se,j,k,P]})}}return t})();var Hn=t=>({designation:t}),Ri=(()=>{class t{constructor(e){this.activeModal=e}static{this.\u0275fac=function(i){return new(i||t)(v(je))}}static{this.\u0275cmp=x({type:t,selectors:[["bkd-publish-test"]],inputs:{test:"test"},standalone:!0,features:[y],decls:11,vars:12,consts:[[1,"modal-body"],["data-testid","confirmation-message"],[1,"modal-footer"],["data-testid","cancel-button","type","button",1,"btn","btn-outline-secondary",3,"click"],["data-testid","confirm-button","type","button",1,"btn","btn-primary",3,"click"]],template:function(i,n){i&1&&(a(0,"div",0)(1,"p",1),c(2),o(3,"translate"),r()(),a(4,"div",2)(5,"button",3),_("click",function(){return n.activeModal.dismiss()}),c(6),o(7,"translate"),r(),a(8,"button",4),_("click",function(){return n.activeModal.close(!0)}),c(9),o(10,"translate"),r()()),i&2&&(s(2),f(" ",O(3,3,n.test.IsPublished?"tests.publishing.unpublish":"tests.publishing.publish",F(10,Hn,n.test.Designation))," "),s(4),f(" ",p(7,6,"tests.publishing.cancel")," "),s(3),f(" ",p(10,8,"tests.publishing.confirm")," "))},dependencies:[k,P],encapsulation:2})}}return t})();var Vn=t=>({maxPoints:t});function Nn(t,l){if(t&1&&(a(0,"div",6),c(1),o(2,"translate"),r()),t&2){let e=h(2);s(),f(" ",O(2,1,"global.validation-errors.invalidPoints",F(4,Vn,e.maxPoints))," ")}}function Un(t,l){if(t&1){let e=$();a(0,"div",3)(1,"input",5,0),_("ngModelChange",function(){S(e);let n=le(2),d=h();return T(d.onPointsChange(n.value))}),r(),I(3,Nn,3,6,"div",6),r()}if(t&2){let e=le(2),i=h();s(),se("is-invalid",e.errors),de("max",i.maxPoints),de("tabindex",i.tabIndex),m("disabled",i.grade.test.IsPublished)("ngModel",i.grade.kind==="grade"?i.grade.result.Points:null),s(2),w(e.errors?3:-1)}}var Wn=1250,Bi=(()=>{class t{constructor(e){this.state=e,this.maxPoints=0,this.pointsSubject$=new ee,this.gradeSubject$=new ee,this.gradingScaleDisabledSubject$=new A(!0),this.gradingScaleDisabled$=this.gradingScaleDisabledSubject$.asObservable(),this.destroy$=new ee}ngOnInit(){this.gradingScaleDisabledSubject$.next(this.disableGradingScale()),this.maxPoints=wi(this.grade),this.initSave(this.pointsSubject$.pipe(Ee(this.isValid.bind(this)),b(e=>({studentId:this.student.Id,testId:this.grade.test.Id,points:e?Number(e):null})))),this.initSave(this.gradeSubject$.pipe(b(e=>({studentId:this.student.Id,testId:this.grade.test.Id,gradeId:e}))))}ngOnChanges(){this.gradingScaleDisabledSubject$.next(this.disableGradingScale())}ngOnDestroy(){this.destroy$.next()}onPointsChange(e){this.pointsSubject$.next(e),this.gradingScaleDisabledSubject$.next(!(e===null||e===""))}onGradeChange(e){this.gradeSubject$.next(e)}isValid(e){return e===""||e===null?!0:isNaN(Number(e))?!1:!(Number(e)<0||Number(e)>this.maxPoints)}initSave(e){e.pipe(pt(i=>this.state.optimisticallyUpdateGrade(i).pipe(b(n=>({params:i,originalResult:n})))),ct(Wn),oe(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)(v(H))}}static{this.\u0275cmp=x({type:t,selectors:[["bkd-grade"]],inputs:{grade:"grade",student:"student",tabIndex:"tabIndex",gradeOptions:"gradeOptions"},standalone:!0,features:[he,y],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&&(a(0,"div",1)(1,"div",2),I(2,Un,4,7,"div",3),a(3,"bkd-select",4),o(4,"async"),_("valueChange",function(u){return n.onGradeChange(u)}),r()()()),i&2&&(s(2),w(n.grade.test.IsPointGrading?2:-1),s(),m("options",n.gradeOptions)("allowEmpty",!0)("value",n.grade.kind==="grade"?n.grade.result.GradeId:null)("disabled",p(4,6,n.gradingScaleDisabled$))("tabindex",n.tabIndex))},dependencies:[be,Re,De,Be,Ae,Le,St,Te,j,k,P],styles:[".point-input-container[_ngcontent-%COMP%]{width:4em}[_nghost-%COMP%] select{min-width:13ch}@media (min-width: 576px){.point-input-container[_ngcontent-%COMP%]{width:5em}}"]})}}return t})();function zn(t,l){if(t&1&&(a(0,"span",1),c(1),r()),t&2){let e=h();s(),C(e.calculatePointsAverage(e.test))}}var Di=(()=>{class t{constructor(e){this.locale=e}calculatePointsAverage(e){return this.safeAverage(e,2,We)}calculateGradeAverage(e){return this.safeAverage(e,3,ze)}safeAverage(e,i,n){try{return Zt(n(e),this.locale,i)}catch{return Qt}}static{this.\u0275fac=function(i){return new(i||t)(v(bt))}}static{this.\u0275cmp=x({type:t,selectors:[["bkd-average-grades"]],inputs:{test:"test"},standalone:!0,features:[y],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&&(a(0,"div",0),I(1,zn,2,1,"span",1),a(2,"span",2),c(3),r()()),i&2&&(s(),w(n.test.IsPointGrading?1:-1),s(2),C(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 Li=(()=>{class t{constructor(){this.disabled=!1,this.width="13ch",this.gradeIdSelected=new X}onGradeChange(e){this.gradeId?.valueOf()!==void 0&&this.gradeIdSelected.emit({id:this.gradeId?.valueOf(),selectedGradeId:e})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=x({type:t,selectors:[["bkd-grade-select"]],inputs:{options:"options",valueId:"valueId",gradeId:"gradeId",disabled:"disabled",width:"width"},outputs:{gradeIdSelected:"gradeIdSelected"},standalone:!0,features:[y],decls:1,vars:5,consts:[["data-testid","grade-select",3,"valueChange","options","allowEmpty","value","disabled","width"]],template:function(i,n){i&1&&(a(0,"bkd-select",0),_("valueChange",function(u){return n.onGradeChange(u)}),r()),i&2&&m("options",n.options)("allowEmpty",!0)("value",n.valueId)("disabled",n.disabled)("width",n.width)},dependencies:[Te]})}}return t})();var qn=576,Ai=(()=>{class t{constructor(e,i){this.portal=e,this.state=i,this.destroy$=new ee,this.handleWindowScroll=()=>{this.updateStickyVisibility(),this.updateStickyTopOffset()},this.handleWindowResize=()=>{this.updateStickyWidth(),this.updateStickyVisibility(),this.updateStickyTopOffset()},this.handleTableScroll=()=>{this.updateStickyLeftOffset()}}ngOnInit(){te([this.state.filteredTests$,this.state.expandedHeader$]).pipe(oe(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":l}),Hi=(()=>{class t{constructor(){this.filter=rt,this.filterChange=new X}showOnlyMine(){this.filterChange.next(N(D({},this.filter),{onlyMine:!0}))}showAll(){this.filterChange.next(N(D({},this.filter),{onlyMine:!1}))}onHidePublishedChange(e){let i=(e.target&&e.target instanceof HTMLInputElement&&e.target?.checked)??!1;this.filterChange.next(N(D({},this.filter),{hidePublished:i}))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=x({type:t,selectors:[["bkd-test-table-filter"]],inputs:{filter:"filter"},outputs:{filterChange:"filterChange"},standalone:!0,features:[y],decls:13,vars:18,consts:[[1,"only-mine-buttons"],["type","button",1,"btn","desktop",3,"click","ngClass"],["type","button",1,"btn","ms-2","desktop",3,"click","ngClass"],[1,"hide-published"],[1,"form-check"],["id","hide-published","type","checkbox",1,"form-check-input",3,"change","checked"],["for","hide-published",1,"form-check-label"]],template:function(i,n){i&1&&(a(0,"div",0)(1,"button",1),_("click",function(){return n.showAll()}),c(2),o(3,"translate"),r(),a(4,"button",2),_("click",function(){return n.showOnlyMine()}),c(5),o(6,"translate"),r()(),a(7,"div",3)(8,"div",4)(9,"input",5),_("change",function(u){return n.onHidePublishedChange(u)}),r(),a(10,"label",6),c(11),o(12,"translate"),r()()()),i&2&&(s(),m("ngClass",tt(12,ji,!n.filter.onlyMine,n.filter.onlyMine)),s(),f(" ",p(3,6,"tests.all-tests")," "),s(2),m("ngClass",tt(15,ji,n.filter.onlyMine,!n.filter.onlyMine)),s(),f(" ",p(6,8,"tests.owned-tests")," "),s(4),m("checked",n.filter.hidePublished),s(2),f(" ",p(12,10,"tests.hide-published")," "))},dependencies:[ae,be,k,P],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 Yn=["*"],Vi=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=x({type:t,selectors:[["bkd-preserve-line-height"]],standalone:!0,features:[y],ngContentSelectors:Yn,decls:3,vars:0,template:function(i,n){i&1&&(_t(),a(0,"div"),Ct(1),c(2,"\xA0"),r())},encapsulation:2})}}return t})();var Ni=(()=>{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)(v(ie,16))}}static{this.\u0275pipe=gt({name:"testSummaryShort",type:t,pure:!0,standalone:!0})}}return t})();var Kn=t=>[t,"edit"];function Jn(t,l){t&1&&(a(0,"i",9),c(1,"edit"),r())}function Qn(t,l){if(t&1&&(a(0,"div",5)(1,"div",7)(2,"bkd-preserve-line-height"),c(3),o(4,"date"),r(),a(5,"a",8),I(6,Jn,2,0,"i",9),r()(),a(7,"bkd-preserve-line-height"),c(8),o(9,"testSummaryShort"),r(),a(10,"bkd-preserve-line-height"),c(11),r()()),t&2){let e=h();s(3),C(O(4,5,e.test.Date,"dd.MM.yyyy")),s(2),m("routerLink",F(10,Kn,e.test.Id)),s(),w(e.test.IsOwner&&e.test.IsPublished===!1?6:-1),s(2),f(" ",p(9,8,e.test)," "),s(3),C(e.test.Owner)}}function Xn(t,l){if(t&1){let e=$();a(0,"div",6)(1,"a",10),o(2,"translate"),_("click",function(){S(e);let n=h();return T(n.unpublishTest())}),a(3,"i",11),c(4,"lock"),r(),a(5,"span"),c(6),o(7,"translate"),r()(),a(8,"bkd-caret",12),_("click",function(){S(e);let n=h();return T(n.emitToggleHeader())}),r()()}if(t&2){let e=h();s(),de("title",p(2,3,"tests.edit")),s(5),C(p(7,5,"tests.published")),s(2),m("expanded",e.expanded)}}function Zn(t,l){if(t&1){let e=$();a(0,"div",6)(1,"a",13),o(2,"translate"),_("click",function(){S(e);let n=h();return T(n.publishTest())}),a(3,"i",11),c(4,"lock_open"),r(),a(5,"span"),c(6),o(7,"translate"),r()(),a(8,"bkd-caret",12),_("click",function(){S(e);let n=h();return T(n.emitToggleHeader())}),r()()}if(t&2){let e=h();s(),de("title",p(2,3,"tests.publish")),s(5),C(p(7,5,"tests.not-published")),s(2),m("expanded",e.expanded)}}var Ui=(()=>{class t{constructor(){this.toggleHeader=new X,this.publish=new X,this.unpublish=new X}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=x({type:t,selectors:[["bkd-test-table-header"]],inputs:{test:"test",expanded:"expanded"},outputs:{toggleHeader:"toggleHeader",publish:"publish",unpublish:"unpublish"},standalone:!0,features:[y],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&&(a(0,"div",0)(1,"div",1),_("click",function(){return n.emitToggleHeader()}),a(2,"div",2),c(3),r(),E(4,"bkd-caret",3),r(),a(5,"div",4),I(6,Qn,12,12,"div",5)(7,Xn,9,7,"div",6)(8,Zn,9,7,"div",6),r()()),i&2&&(s(2),m("ngClass",n.expanded?"expanded":"collapsed"),s(),f(" ",n.test.Designation," "),s(),m("expanded",n.expanded),s(2),w(n.expanded?6:-1),s(),w(n.test.IsPublished?7:8))},dependencies:[ae,Ut,Vi,re,Ge,k,P,Ni],styles:["[_nghost-%COMP%]{font-weight:300}.collapsed[_ngcontent-%COMP%]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.test-designation[_ngcontent-%COMP%]{display:none!important}.test-status[_ngcontent-%COMP%]{order:-1;padding-bottom:1rem}.test-status[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{text-decoration:none}.test-status[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{color:#000}.test-status[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{text-decoration:underline}.test-status[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:hover{text-decoration-color:#ea161f}.edit[_ngcontent-%COMP%]{color:#00000080;text-decoration:none}@media (min-width: 811px){.test-designation[_ngcontent-%COMP%]{display:inherit!important}.test-status[_ngcontent-%COMP%]{order:initial}.expand-mobile[_ngcontent-%COMP%]{display:none!important}}"]})}}return t})();var es=["bkdTestEditGradesHeader",""],ot=(t,l)=>l.Id,ts=t=>({selected:t});function is(t,l){if(t&1){let e=$();a(0,"th",3)(1,"bkd-test-table-header",12),_("toggleHeader",function(n){S(e);let d=h();return T(d.state.toggleHeader(n))})("publish",function(n){S(e);let d=h();return T(d.publish.emit(n))})("unpublish",function(n){S(e);let d=h();return T(d.unpublish.emit(n))}),r()()}if(t&2){let e=l.$implicit,i=h(),n=B(4);m("ngClass",e.Id===(i.selectedTest==null?null:i.selectedTest.Id)?"selected":""),s(),m("test",e)("expanded",n)}}function ns(t,l){if(t&1){let e=$();a(0,"th",4)(1,"bkd-test-table-header",12),_("toggleHeader",function(n){S(e);let d=h();return T(d.state.toggleHeader(n))})("publish",function(n){S(e);let d=h();return T(d.publish.emit(n))})("unpublish",function(n){S(e);let d=h();return T(d.unpublish.emit(n))}),r()()}if(t&2){let e=l.$implicit,i=h(),n=B(4);m("ngClass",e.Id===(i.selectedTest==null?null:i.selectedTest.Id)?"selected":""),s(),m("test",e)("expanded",n)}}function ss(t,l){if(t&1){let e=$();a(0,"div",13)(1,"span",14),_("click",function(){S(e);let n=h().$implicit,d=h();return T(d.state.sortBy(n))}),c(2),o(3,"translate"),r()()}t&2&&(s(2),f("",p(3,1,"tests.points")," "))}function as(t,l){if(t&1){let e=$();a(0,"th",11)(1,"div",6),I(2,ss,4,3,"div",13),a(3,"div",7)(4,"span",14),_("click",function(){let n=S(e).$implicit,d=h();return T(d.state.sortBy(n))}),c(5),o(6,"translate"),r()(),a(7,"div",8),c(8),o(9,"async"),r()()()}if(t&2){let e=l.$implicit,i=h();m("ngClass",e.Id===(i.selectedTest==null?null:i.selectedTest.Id)?"selected":""),s(2),w(e.IsPointGrading?2:-1),s(3),C(p(6,4,"tests.grade")),s(3),f(" ",p(9,6,i.state.getSortingChar$(e))," ")}}var Wi=(()=>{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 X,this.unpublish=new X}getTop(){return this.element.nativeElement.getBoundingClientRect().top}getLeft(){return this.element.nativeElement.getBoundingClientRect().left}setTopOffset(e){this.element.nativeElement.style.top=`${e}px`}setLeftOffset(e){this.element.nativeElement.style.left=`${e}px`}getWidth(){return this.element.nativeElement.getBoundingClientRect().width}setWidth(e){this.element.nativeElement.style.width=`${e}px`}getColumnWidths(){return this.getRowsAndColumns().map(e=>e.map(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((u,g)=>{u.style.width=`${e[d][g]}px`,u.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((u,g)=>{u.style.height=`${e[d][g]}px`})),this.getRows().forEach((n,d)=>{let u=e[d].reduce((g,M)=>Math.max(g,M),0);n.style.height=`${u}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)(v(H),v(vt))}}static{this.\u0275cmp=x({type:t,selectors:[["thead","bkdTestEditGradesHeader",""]],hostVars:2,hostBindings:function(i,n){i&2&&se("sticky",n.sticky)},inputs:{selectedTest:"selectedTest",sticky:"sticky",shown:"shown"},outputs:{publish:"publish",unpublish:"unpublish"},standalone:!0,features:[y],attrs:es,decls:40,vars:29,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,"student-name",3,"click"],[1,"d-flex"],[1,"column-title"],[1,"sort-direction","ms-1"],[1,"student-grade","desktop",3,"click","ngClass"],[1,"border-end","student-average","desktop",3,"click"],["container","body",1,"test-grade",3,"ngClass"],[3,"toggleHeader","publish","unpublish","test","expanded"],[1,"column-title","me-3","point-input-container"],[3,"click"]],template:function(i,n){if(i&1){let d=$();R(0),o(1,"async"),R(2),o(3,"async"),R(4),o(5,"async"),a(6,"tr",0)(7,"th",1)(8,"bkd-test-table-filter",2),_("filterChange",function(g){return S(d),T(n.state.setFilter(g))}),r()(),z(9,is,2,3,"th",3,ot),z(11,ns,2,3,"th",4,ot),r(),a(13,"tr")(14,"th",5),_("click",function(){return S(d),T(n.state.sortBy("FullName"))}),a(15,"div",6)(16,"div",7),c(17),o(18,"translate"),r(),a(19,"div",8),c(20),o(21,"async"),r()()(),a(22,"th",9),_("click",function(){return S(d),T(n.state.sortBy("FinalGrade"))}),a(23,"div",6)(24,"div",7),c(25),o(26,"translate"),r(),a(27,"div",8),c(28),o(29,"async"),r()()(),a(30,"th",10),_("click",function(){return S(d),T(n.state.sortBy("TestsMean"))}),a(31,"div",6)(32,"div",7),c(33),o(34,"translate"),r(),a(35,"div",8),c(36),o(37,"async"),r()()(),z(38,as,10,8,"th",11,ot),r()}if(i&2){let d=p(1,8,n.state.filteredTests$),u=p(3,10,n.state.filter$);s(4),Y(p(5,12,n.state.expandedHeader$)),s(4),m("filter",u),s(),q(d),s(2),q(d),s(6),f(" ",p(18,15,"tests.student.name")," "),s(3),f(" ",p(21,17,n.state.getSortingChar$("FullName"))," "),s(2),m("ngClass",F(27,ts,n.selectedTest===void 0)),s(3),f(" ",p(26,19,"tests.grade")," "),s(3),f(" ",p(29,21,n.state.getSortingChar$("FinalGrade"))," "),s(5),f(" ",p(34,23,"tests.mean")," "),s(3),f(" ",p(37,25,n.state.getSortingChar$("TestsMean"))," "),s(2),q(d)}},dependencies:[j,ae,k,P,Hi,Ui],styles:["[_nghost-%COMP%]{--student-name-column-width: 225px;--student-grade-column-width: 147px;--student-average-column-width: 100px;--test-grade-column-width: 300px;--point-input-size: 4em;--student-grade-column-offset: var(--student-name-column-width);--student-average-column-offset: calc( var(--student-grade-column-offset) + var(--student-grade-column-width) );--test-columns-offset: calc( var(--student-average-column-offset) + var(--student-average-column-width) )}[_nghost-%COMP%] #stickyHeader[_ngcontent-%COMP%]{display:none}[_nghost-%COMP%] .scroll-test-table[_ngcontent-%COMP%]{display:table-caption;overflow-y:auto;height:auto}@media (min-width: 1000px){[_nghost-%COMP%]{--student-name-column-width: 275px}}th[_ngcontent-%COMP%], td[_ngcontent-%COMP%]{padding:1rem}td[_ngcontent-%COMP%]{vertical-align:middle}@media (min-width: 576px){[_nghost-%COMP%]{--point-input-size: 5em}}tr[_ngcontent-%COMP%]:not(.header-collapsible) th.test-grade[_ngcontent-%COMP%], td.test-grade[_ngcontent-%COMP%], th.student-grade[_ngcontent-%COMP%], td.student-grade[_ngcontent-%COMP%]{width:calc(var(--point-input-size) + 13ch + 3rem)}@media (max-width: 810px){.desktop[_ngcontent-%COMP%]:not(.selected), .student-grade[_ngcontent-%COMP%]:not(.selected), .student-average[_ngcontent-%COMP%], .test-grade[_ngcontent-%COMP%]:not(.selected){display:none}table[_ngcontent-%COMP%], tbody[_ngcontent-%COMP%], thead[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:100%}th[_ngcontent-%COMP%], tr[_ngcontent-%COMP%]{display:flex;width:100%}.student-name[_ngcontent-%COMP%]{flex:1;display:block}.test-grade[_ngcontent-%COMP%]{flex:none;display:block}}@media (min-width: 811px){.mobile[_ngcontent-%COMP%]{display:none}.student-name[_ngcontent-%COMP%]{width:var(--student-name-column-width);min-width:var(--student-name-column-width);max-width:var(--student-name-column-width)}.student-grade[_ngcontent-%COMP%]{width:var(--student-grade-column-width);min-width:var(--student-grade-column-width);max-width:var(--student-grade-column-width)}.student-average[_ngcontent-%COMP%]{width:var(--student-average-column-width);min-width:var(--student-average-column-width);max-width:var(--student-average-column-width)}.test-grade[_ngcontent-%COMP%]{min-width:var(--test-grade-column-width);max-width:var(--test-grade-column-width)}th.sticky[_ngcontent-%COMP%], td.sticky[_ngcontent-%COMP%]{position:sticky;left:0;background-color:#fff}th.sticky.student-grade[_ngcontent-%COMP%], td.sticky.student-grade[_ngcontent-%COMP%]{left:var(--student-grade-column-offset)}th.sticky.student-average[_ngcontent-%COMP%], td.sticky.student-average[_ngcontent-%COMP%]{left:var(--student-average-column-offset)}}@media (max-width: 1200px){[_nghost-%COMP%]{--student-average-column-width: 1px}.student-average[_ngcontent-%COMP%]{padding:0;overflow:hidden}}@media (min-width: 1201px){.student-average-inline[_ngcontent-%COMP%]{display:none}}.sticky[_nghost-%COMP%]{position:fixed;top:0;left:0;z-index:1000;display:none}tr[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{border-top:none;vertical-align:top}.header-collapsible[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{border-bottom:1px solid #dee2e6;padding:0 1rem}tr[_ngcontent-%COMP%] th.test-info-desktop[_ngcontent-%COMP%]{display:none!important}@media (min-width: 811px){.sticky.shown[_nghost-%COMP%]{display:table-header-group}tr[_ngcontent-%COMP%] th.test-info-mobile[_ngcontent-%COMP%]{display:none!important}tr[_ngcontent-%COMP%] th.test-info-desktop[_ngcontent-%COMP%]{display:table-cell!important}tr[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{border-top:none;padding-top:.25rem;padding-bottom:.25rem;border-top:initial}.sticky[_nghost-%COMP%]{margin-left:var(--test-columns-offset)}.sticky[_nghost-%COMP%] th.sticky[_ngcontent-%COMP%]{position:fixed}}"],changeDetection:0})}}return t})();var rs=(t,l)=>l.student.Id,os=(t,l)=>l.Id,ds=(t,l)=>l.id,zi=t=>({selected:t}),ls=t=>["student",t,"grades"],ps=t=>({"visible-on-mobile":t});function cs(t,l){if(t&1){let e=$();a(0,"bkd-grade-select",20),o(1,"async"),o(2,"async"),_("gradeIdSelected",function(n){S(e);let d=h(2);return T(d.state.overwriteFinalGrade(n))}),r()}if(t&2){let e=h().$implicit,i=h();m("options",p(1,4,i.state.gradingOptionsForCourse$()))("valueId",e.finalGrade.finalGradeId)("gradeId",e.finalGrade.id)("disabled",p(2,6,i.isEditFinalGradesAllowed(e))===!1)}}function ms(t,l){if(t&1&&(a(0,"div"),c(1),r()),t&2){let e=h().$implicit;s(),f(" ",e.finalGrade.freeHandGrade," ")}}function us(t,l){if(t&1&&(R(0),a(1,"td",12),E(2,"bkd-grade",21),o(3,"async"),r()),t&2){let e=l.$implicit,i=l.$index,n=h(),d=n.$implicit,u=n.$index,g=h(),M=e.grade;s(),m("ngClass",g.selectedTest!==void 0&&M.test.Id===g.selectedTest.Id?"selected":""),s(),m("grade",M)("gradeOptions",p(3,5,g.state.gradingOptionsForTest$(M.test)))("student",d.student)("tabIndex",(1+i)*1e3+u)}}function hs(t,l){if(t&1&&(a(0,"tr")(1,"td",15)(2,"a",16)(3,"div"),c(4),r(),a(5,"div",9),c(6),o(7,"translate"),o(8,"decimalOrDash"),r()()(),a(9,"td",17),I(10,cs,3,8,"bkd-grade-select",18)(11,ms,2,1,"div"),r(),a(12,"td",19),c(13),o(14,"decimalOrDash"),r(),z(15,us,4,7,"td",12,ds),r()),t&2){let e=l.$implicit,i=h();s(2),m("routerLink",F(16,ls,e.student.Id)),s(2),C(e.student.FullName),s(2),et(" ",p(7,8,"tests.mean"),": ",O(8,10,e.finalGrade==null?null:e.finalGrade.average,"1-3")," "),s(3),m("ngClass",F(18,zi,i.selectedTest===void 0)),s(),w(e.finalGrade&&!e.finalGrade.freeHandGrade?10:-1),s(),w(e.finalGrade&&e.finalGrade.freeHandGrade?11:-1),s(2),f(" ",O(14,13,e.finalGrade==null?null:e.finalGrade.average,"1-3")," "),s(2),q(i.getGrades(e))}}function gs(t,l){if(t&1&&(a(0,"td",12),E(1,"bkd-average-grades",22),r()),t&2){let e=l.$implicit,i=h();m("ngClass",e.Id===(i.selectedTest==null?null:i.selectedTest.Id)||e.Id===(i.selectedTest==null?null:i.selectedTest.Id)?"selected":""),s(),m("test",e)}}function fs(t,l){if(t&1){let e=$();a(0,"button",23),_("click",function(){S(e);let n=h();return T(n.setAverageAsFinalGrade())}),c(1),o(2,"translate"),r()}if(t&2){let e=h(),i=B(2);m("ngClass",F(4,ps,!i||!e.selectedTest)),s(),f(" ",p(2,2,"tests.set-final-grade")," ")}}var qi=(()=>{class t{constructor(e,i){this.state=e,this.modalService=i}ngOnInit(){this.state.setSorting({key:"FullName",ascending:!0})}setAverageAsFinalGrade(){this.state.course$.pipe(ne(1)).subscribe(e=>this.state.setAveragesAsFinalGrades({CourseIds:[e.Id]}))}isEditFinalGradesAllowed(e){return this.state.course$.pipe(b(i=>!!(Ye(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,We)}calculateGradeAverage(e){return this.safeAverage(e,ze)}safeAverage(e,i){try{return i(e).toString()}catch{return"\u2013"}}openModal(e){let i=this.modalService.open(Ri);return i.componentInstance.test=e,i}onCloseModal(e,i){e.result.then(n=>{n&&i()},()=>{})}static{this.\u0275fac=function(i){return new(i||t)(v(H),v(qe))}}static{this.\u0275cmp=x({type:t,selectors:[["bkd-test-edit-grades"]],inputs:{selectedTest:"selectedTest"},standalone:!0,features:[pe([we]),y],decls:39,vars:42,consts:[["inlineHeader",""],["stickyHeader",""],[1,"table-responsive-wrapper"],["bkdTestEditGradesHeaderSticky","",1,"table","table-hover","h-100",3,"inlineHeader","stickyHeader"],["bkdTestEditGradesHeader","",2,"display","block",3,"publish","unpublish","selectedTest"],["id","stickyHeader","bkdTestEditGradesHeader","",3,"publish","unpublish","sticky","selectedTest"],["id","scrollTestTable",1,"scroll-test-table"],[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,"action-buttons"],["data-testId","apply-average-button","type","button",1,"apply-average-button","btn","btn-primary","m-3",3,"ngClass"],[1,"student-name"],[3,"routerLink"],[1,"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=$();R(0),o(1,"async"),R(2),o(3,"async"),R(4),o(5,"async"),a(6,"div",2)(7,"table",3)(8,"thead",4,0),_("publish",function(g){return S(d),T(n.publish(g))})("unpublish",function(g){return S(d),T(n.unpublish(g))}),r(),a(10,"thead",5,1),_("publish",function(g){return S(d),T(n.publish(g))})("unpublish",function(g){return S(d),T(n.unpublish(g))}),r(),a(12,"tbody",6),z(13,hs,17,20,"tr",null,rs),a(15,"tr")(16,"td",7)(17,"div",8)(18,"div"),c(19),o(20,"translate"),r(),a(21,"div",9),c(22),o(23,"translate"),o(24,"async"),o(25,"decimalOrDash"),r()()(),a(26,"td",10),c(27),o(28,"async"),o(29,"decimalOrDash"),r(),a(30,"td",11),c(31),o(32,"async"),o(33,"decimalOrDash"),r(),z(34,gs,2,2,"td",12,os),r()()(),a(36,"div",13),I(37,fs,3,6,"button",14),o(38,"async"),r()()}if(i&2){let d=le(9),u=le(11),g=p(1,12,n.state.filteredTests$);s(2),Y(p(3,14,n.state.hasTests$));let M=p(5,17,n.state.studentGrades$);s(5),m("inlineHeader",d)("stickyHeader",u),s(),m("selectedTest",n.selectedTest),s(2),m("sticky",!0)("selectedTest",n.selectedTest),s(3),q(M),s(6),C(p(20,19,"tests.average")),s(3),et(" ",p(23,21,"tests.mean"),": ",O(25,25,p(24,23,n.state.meanOfStudentGradesForCourse$),"1-3")," "),s(4),m("ngClass",F(40,zi,n.selectedTest===void 0)),s(),f(" ",O(29,30,p(28,28,n.state.meanOfFinalGradesForCourse$),"1-3")," "),s(4),f(" ",O(33,35,p(32,33,n.state.meanOfStudentGradesForCourse$),"1-3")," "),s(3),q(g),s(3),w(p(38,38,n.state.canSetFinalGrade$)?37:-1)}},dependencies:[ae,re,Li,Bi,Di,j,k,P,Xt,Ai,Wi],styles:["[_nghost-%COMP%]{--student-name-column-width: 225px;--student-grade-column-width: 147px;--student-average-column-width: 100px;--test-grade-column-width: 300px;--point-input-size: 4em;--student-grade-column-offset: var(--student-name-column-width);--student-average-column-offset: calc( var(--student-grade-column-offset) + var(--student-grade-column-width) );--test-columns-offset: calc( var(--student-average-column-offset) + var(--student-average-column-width) )}[_nghost-%COMP%] #stickyHeader[_ngcontent-%COMP%]{display:none}[_nghost-%COMP%] .scroll-test-table[_ngcontent-%COMP%]{display:table-caption;overflow-y:auto;height:auto}@media (min-width: 1000px){[_nghost-%COMP%]{--student-name-column-width: 275px}}th[_ngcontent-%COMP%], td[_ngcontent-%COMP%]{padding:1rem}td[_ngcontent-%COMP%]{vertical-align:middle}@media (min-width: 576px){[_nghost-%COMP%]{--point-input-size: 5em}}tr[_ngcontent-%COMP%]:not(.header-collapsible) th.test-grade[_ngcontent-%COMP%], td.test-grade[_ngcontent-%COMP%], th.student-grade[_ngcontent-%COMP%], td.student-grade[_ngcontent-%COMP%]{width:calc(var(--point-input-size) + 13ch + 3rem)}@media (max-width: 810px){.desktop[_ngcontent-%COMP%]:not(.selected), .student-grade[_ngcontent-%COMP%]:not(.selected), .student-average[_ngcontent-%COMP%], .test-grade[_ngcontent-%COMP%]:not(.selected){display:none}table[_ngcontent-%COMP%], tbody[_ngcontent-%COMP%], thead[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:100%}th[_ngcontent-%COMP%], tr[_ngcontent-%COMP%]{display:flex;width:100%}.student-name[_ngcontent-%COMP%]{flex:1;display:block}.test-grade[_ngcontent-%COMP%]{flex:none;display:block}}@media (min-width: 811px){.mobile[_ngcontent-%COMP%]{display:none}.student-name[_ngcontent-%COMP%]{width:var(--student-name-column-width);min-width:var(--student-name-column-width);max-width:var(--student-name-column-width)}.student-grade[_ngcontent-%COMP%]{width:var(--student-grade-column-width);min-width:var(--student-grade-column-width);max-width:var(--student-grade-column-width)}.student-average[_ngcontent-%COMP%]{width:var(--student-average-column-width);min-width:var(--student-average-column-width);max-width:var(--student-average-column-width)}.test-grade[_ngcontent-%COMP%]{min-width:var(--test-grade-column-width);max-width:var(--test-grade-column-width)}th.sticky[_ngcontent-%COMP%], td.sticky[_ngcontent-%COMP%]{position:sticky;left:0;background-color:#fff}th.sticky.student-grade[_ngcontent-%COMP%], td.sticky.student-grade[_ngcontent-%COMP%]{left:var(--student-grade-column-offset)}th.sticky.student-average[_ngcontent-%COMP%], td.sticky.student-average[_ngcontent-%COMP%]{left:var(--student-average-column-offset)}}@media (max-width: 1200px){[_nghost-%COMP%]{--student-average-column-width: 1px}.student-average[_ngcontent-%COMP%]{padding:0;overflow:hidden}}@media (min-width: 1201px){.student-average-inline[_ngcontent-%COMP%]{display:none}}tbody[_ngcontent-%COMP%] td.student-name[_ngcontent-%COMP%]{padding-right:0}tbody[_ngcontent-%COMP%] td.student-name[_ngcontent-%COMP%], tbody[_ngcontent-%COMP%] td.student-name[_ngcontent-%COMP%] *[_ngcontent-%COMP%]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}tbody[_ngcontent-%COMP%] td.student-name[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{text-decoration:none}tbody[_ngcontent-%COMP%] td.student-name[_ngcontent-%COMP%] a[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:first-child{text-decoration:underline}tbody[_ngcontent-%COMP%] td.student-name[_ngcontent-%COMP%] a[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:first-child:hover{text-decoration-color:#ea161f}.student-average-inline[_ngcontent-%COMP%]{color:#4e4e4ef2;font-size:.875rem;line-height:1}@media (min-width: 811px){.table-responsive-wrapper[_ngcontent-%COMP%]{display:block;overflow-x:auto}table[_ngcontent-%COMP%]{border-collapse:separate;border-spacing:0}.action-buttons[_ngcontent-%COMP%]{position:sticky;left:0}}@media (max-width: 810px){.apply-average-button[_ngcontent-%COMP%]:not(.visible-on-mobile){display:none!important}}"]})}}return t})();var vs=()=>["/events"],_s=t=>({count:t});function Cs(t,l){if(t&1&&(a(0,"div",7),c(1),o(2,"translate"),r()),t&2){let e=h();s(),f(" ",O(2,1,e.course.ParticipatingStudents.length===1?"courses.registration":"courses.registrations",F(4,_s,e.course.ParticipatingStudents.length))," ")}}var Yi=(()=>{class t{constructor(e){this.reportsService=e,this.course$=new A(null),this.reports$=this.course$.pipe(b(i=>i?.Id),J(),L(i=>i?this.reportsService.getCourseReports(i):K([])),ut([]))}ngOnChanges(e){e.course&&this.course$.next(e.course.currentValue)}getDesignation(){return Ke(this.course)}static{this.\u0275fac=function(i){return new(i||t)(v(ti))}}static{this.\u0275cmp=x({type:t,selectors:[["bkd-tests-header"]],inputs:{course:"course"},standalone:!0,features:[he,y],decls:12,vars:7,consts:[[3,"link"],[1,"d-flex"],["routerLink","add",1,"edit","btn","btn-primary","btn-icon","ms-2"],[1,"material-icons"],[1,"ms-2",3,"reports"],["id","excel-import"],[1,"d-flex","flex-column","header"],[1,"additional-info"]],template:function(i,n){i&1&&(a(0,"bkd-backlink",0)(1,"div",1)(2,"a",2)(3,"i",3),c(4,"add"),r()(),E(5,"bkd-reports-link",4),o(6,"async"),E(7,"div",5),r()(),a(8,"div",6)(9,"h1"),c(10),r(),I(11,Cs,3,6,"div",7),r()),i&2&&(m("link",fe(6,vs)),s(5),m("reports",p(6,4,n.reports$)),s(5),C(n.getDesignation()),s(),w(n.course.ParticipatingStudents?11:-1))},dependencies:[si,re,Nt,j,k,P],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 bs=()=>[],xs=t=>({"visible-on-mobile":t});function ys(t,l){t&1&&E(0,"bkd-spinner")}function Ss(t,l){if(t&1){let e=$();a(0,"bkd-select",4),_("valueChange",function(n){S(e);let d=h(2);return T(n&&d.testSelected(n))}),r(),E(1,"bkd-test-edit-grades",5)}if(t&2){h(2);let e=B(6),i=B(8),n=B(10);m("options",e)("value",i)("allowEmpty",!1),s(),m("selectedTest",n)}}function Ts(t,l){t&1&&(a(0,"p",2),c(1),o(2,"translate"),r()),t&2&&(s(),C(p(2,1,"tests.no-tests")))}function ws(t,l){if(t&1&&(a(0,"a",3),o(1,"async"),a(2,"i",6),c(3,"arrow_right_alt"),r(),a(4,"span",7),c(5),o(6,"translate"),r()()),t&2){let e=h(2),i=B(4),n=B(10);de("href",p(1,3,e.buildLinkToRatingOverview()),Pe),m("ngClass",F(7,xs,!i||!n)),s(5),C(p(6,5,"tests.link-to-rating-overview"))}}function Is(t,l){if(t&1&&(E(0,"bkd-tests-header",1),I(1,Ss,2,4)(2,Ts,3,3,"p",2)(3,ws,7,9,"a",3),o(4,"async")),t&2){let e=h(),i=B(0),n=B(2);m("course",i),s(),w(n.length>0?1:2),s(2),w(p(4,3,e.state.canSetFinalGrade$)?3:-1)}}var Ki=(()=>{class t{constructor(e,i,n){this.settings=e,this.state=i,this.translate=n,this.selectTest$=new ee,this.testOptions$=this.state.tests$.pipe(b(d=>[{Key:-1,Value:this.translate.instant("tests.grade")},...d.map(u=>({Key:u.Id,Value:u.Designation}))]),J()),this.selectedTestId$=Me(this.selectTest$,this.state.tests$.pipe(ne(1),b(d=>d[0]?.Id))).pipe(J()),this.selectedTest$=this.selectedTestId$.pipe(L(d=>this.state.tests$.pipe(b(u=>u.find(g=>g.Id===d)))),J())}testSelected(e){this.selectTest$.next(e)}buildLinkToRatingOverview(){return this.state.course$.pipe(ne(1),b(e=>this.settings.eventlist.evaluation.replace(":id",String(e.Id))))}static{this.\u0275fac=function(i){return new(i||t)(v(_e),v(H),v(ie))}}static{this.\u0275cmp=x({type:t,selectors:[["bkd-tests-list"]],standalone:!0,features:[y],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),o(1,"async"),R(2),o(3,"async"),R(4),o(5,"async"),R(6),o(7,"async"),R(8),o(9,"async"),R(10),o(11,"async"),a(12,"div",0),I(13,ys,1,0,"bkd-spinner"),o(14,"async"),I(15,Is,5,5),r()),i&2){let d;Y(p(1,1,n.state.course$)),s(2),Y((d=p(3,4,n.state.tests$))!==null&&d!==void 0?d:fe(21,bs)),s(2),Y(p(5,7,n.state.hasTests$)),s(2),Y(p(7,10,n.testOptions$)),s(2),Y(p(9,13,n.selectedTestId$)),s(2),Y(p(11,16,n.selectedTest$)),s(3),w(p(14,19,n.state.loading$)?13:15)}},dependencies:[Yi,Te,qi,ae,Se,j,k,P],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 Xe=(()=>{class t{constructor(e,i){this.state=e,this.route=i,this.courseId$=this.route.paramMap.pipe(b(n=>Number(n.get("id"))),J()),this.destroy$=new ee}ngOnInit(){this.courseId$.pipe(oe(this.destroy$)).subscribe(e=>this.state.setCourseId(e))}ngOnDestroy(){this.destroy$.next()}static{this.\u0275fac=function(i){return new(i||t)(v(H),v(ve))}}static{this.\u0275cmp=x({type:t,selectors:[["bkd-tests"]],standalone:!0,features:[pe([H]),y],decls:1,vars:0,template:function(i,n){i&1&&E(0,"router-outlet")},dependencies:[$e]})}}return t})();var md=[{path:"",component:Ci,children:[{path:"",component:_i},{path:"current",component:vi},{path:":id",component:Xe,children:[{path:"tests",component:Ki}]},{path:":id/tests/:testId/edit",component:Xe,children:[{path:"",component:Fi}]},{path:":id/tests/add",component:Xe,children:[{path:"",component:Gi}]},{path:":id/tests",children:[ai]}]}];export{md as EVENTS_ROUTES}; diff --git a/public/apps/webapp-schulverwaltung/chunk-7VKKHU7R.js b/public/apps/webapp-schulverwaltung/chunk-7VKKHU7R.js deleted file mode 100644 index 8be5e2dc..00000000 --- a/public/apps/webapp-schulverwaltung/chunk-7VKKHU7R.js +++ /dev/null @@ -1 +0,0 @@ -import{a as Y}from"./chunk-2H6IFZM2.js";import{a as ce,b as de}from"./chunk-7FRZV7VF.js";import{d as me,e as fe}from"./chunk-VUPOI3TG.js";import{j as q,k as O,l as K}from"./chunk-NL5E3FC5.js";import{b as ue}from"./chunk-YD3RJIHU.js";import{a as J,c as Q}from"./chunk-KK2SHN2W.js";import{u as Z}from"./chunk-AP373D4K.js";import{Ab as M,Cc as d,Dc as z,Gb as u,Ha as _,Hb as x,Ib as F,Ic as N,Jd as pe,Kd as se,Ld as le,Ma as ne,Na as ie,P as B,Pc as f,Qc as R,Ra as p,Wa as c,X as j,Xa as m,Xb as ae,Ya as s,Yc as k,_ as C,_b as re,aa as P,da as ee,db as l,ec as w,gc as U,ha as te,hb as g,l as E,n as G,nb as r,o as L,ob as S,pb as y,qb as v,uc as oe,va as h,wa as a,x as X,xa as V}from"./chunk-IFJN5CDK.js";function Se(t,o){if(t&1&&(r(0),s(1,"br")),t&2){let e=l();y(" ",e.student.AddressLine2,"")}}function _e(t,o){if(t&1&&(c(0,"a",0),r(1),m(),s(2,"br")),t&2){let e=l();g("href","tel:",e.student.PhonePrivate,"",h),a(),y(" ",e.student.PhonePrivate," ")}}function Pe(t,o){if(t&1&&(c(0,"a",0),r(1),m(),s(2,"br")),t&2){let e=l();g("href","tel:",e.student.PhoneMobile,"",h),a(),y(" ",e.student.PhoneMobile," ")}}function Me(t,o){if(t&1&&(c(0,"a",0),r(1),m()),t&2){let e=l();g("href","mailto:",e.email,"",h),a(),y(" ",e.email," ")}}var We=(()=>{class t{constructor(){this.emailProperty="DisplayEmail"}get postalCode(){return"PostalCode"in this.student?this.student.PostalCode:this.student.Zip}get email(){return this.emailProperty==="Email2"&&"Email2"in this.student?this.student.Email2||null:this.student.DisplayEmail}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=P({type:t,selectors:[["bkd-student-dossier-address"]],inputs:{student:"student",emailProperty:"emailProperty"},standalone:!0,features:[M],decls:9,vars:7,consts:[[3,"href"]],template:function(i,n){i&1&&(c(0,"address"),r(1),s(2,"br"),_(3,Se,2,1,"br"),r(4),s(5,"br"),_(6,_e,3,3)(7,Pe,3,3)(8,Me,2,3,"a",0),m()),i&2&&(a(),y(" ",n.student.AddressLine1,""),a(2),p(n.student.AddressLine2?3:-1),a(),v(" ",n.postalCode||""," ",n.student.Location,""),a(2),p(n.student.PhonePrivate?6:-1),a(),p(n.student.PhoneMobile?7:-1),a(),p(n.email?8:-1))},changeDetection:0})}}return t})();var $=(()=>{class t{transform(e){return e?.DisplayEmail||e?.Email||e?.Email2||null}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275pipe=ee({name:"bkdPersonEmail",type:t,pure:!0,standalone:!0})}}return t})();function Ie(t,o){if(t&1&&(r(0),s(1,"br")),t&2){let e=l();y(" ",e.company.apprenticeshipManager==null?null:e.company.apprenticeshipManager.CompanyName,"")}}function Ae(t,o){if(t&1&&(r(0),s(1,"br")),t&2){let e=l();y(" ",e.company.apprenticeshipManager==null?null:e.company.apprenticeshipManager.CompanyNameAddition,"")}}function Te(t,o){if(t&1&&(r(0),s(1,"br")),t&2){let e=l();v(" ",(e.company.apprenticeshipManager==null?null:e.company.apprenticeshipManager.Lastname)||""," ",(e.company.apprenticeshipManager==null?null:e.company.apprenticeshipManager.Firstname)||"","")}}function De(t,o){if(t&1&&(r(0),s(1,"br")),t&2){let e=l();y(" ",e.company.apprenticeshipManager==null?null:e.company.apprenticeshipManager.AddressLine1,"")}}function Ee(t,o){if(t&1&&(r(0),s(1,"br")),t&2){let e=l();y(" ",e.company.apprenticeshipManager==null?null:e.company.apprenticeshipManager.AddressLine2,"")}}function Le(t,o){if(t&1&&(r(0),s(1,"br")),t&2){let e=l();v(" ",e.company.apprenticeshipManager==null?null:e.company.apprenticeshipManager.PostalCode," ",e.company.apprenticeshipManager==null?null:e.company.apprenticeshipManager.Location,"")}}function je(t,o){if(t&1&&(c(0,"a",0),r(1),s(2,"br"),m()),t&2){let e=l();g("href","tel:",e.company.apprenticeshipManager==null?null:e.company.apprenticeshipManager.PhoneBusiness,"",h),a(),S(e.company.apprenticeshipManager==null?null:e.company.apprenticeshipManager.PhoneBusiness)}}function ke(t,o){if(t&1&&(c(0,"a",0),u(1,"bkdPersonEmail"),r(2),u(3,"bkdPersonEmail"),m()),t&2){let e=l();g("href","mailto:",x(1,3,e.company.apprenticeshipManager),"",h),a(2),S(x(3,5,e.company.apprenticeshipManager))}}function Fe(t,o){if(t&1&&(c(0,"div",1),r(1),u(2,"translate"),u(3,"addSpace"),s(4,"br"),r(5),u(6,"date"),u(7,"date"),m()),t&2){let e=l();a(),v(" ",x(2,4,"shared.profile.apprenticeship-period"),"",F(3,6,":",":"),""),a(4),v(" ",F(6,9,e.company.apprenticeshipContract.ContractDateFrom,"dd.MM.yyyy"),"\u2013",F(7,12,e.company.apprenticeshipContract.ContractDateTo,"dd.MM.yyyy")," ")}}function Re(t,o){if(t&1&&(r(0),s(1,"br")),t&2){let e=l(2);v(" ",e.company.jobTrainer.Lastname||""," ",e.company.jobTrainer.Firstname||"","")}}function Be(t,o){if(t&1&&(c(0,"a",0),r(1),s(2,"br"),m()),t&2){let e=l(2);g("href","tel:",e.company.jobTrainer.PhoneBusiness,"",h),a(),S(e.company.jobTrainer.PhoneBusiness)}}function we(t,o){if(t&1&&(c(0,"a",0),r(1),s(2,"br"),m()),t&2){let e=l(2);g("href","tel:",e.company.jobTrainer.PhoneMobile,"",h),a(),S(e.company.jobTrainer.PhoneMobile)}}function Ue(t,o){if(t&1&&(c(0,"a",0),u(1,"bkdPersonEmail"),r(2),u(3,"bkdPersonEmail"),m()),t&2){let e=l(2);g("href","mailto:",x(1,3,e.company.jobTrainer),"",h),a(2),S(x(3,5,e.company.jobTrainer))}}function ze(t,o){if(t&1&&(c(0,"div",1),r(1),u(2,"translate"),u(3,"addSpace"),c(4,"address"),_(5,Re,2,2,"br")(6,Be,3,3,"a",0)(7,we,3,3,"a",0)(8,Ue,4,7,"a",0),u(9,"bkdPersonEmail"),m()()),t&2){let e=l();a(),v(" ",x(2,6,"shared.profile.job-trainer"),"",F(3,8,":",":")," "),a(4),p(e.company.jobTrainer.Lastname||e.company.jobTrainer.Firstname?5:-1),a(),p(e.company.jobTrainer.PhoneBusiness?6:-1),a(),p(e.company.jobTrainer.PhoneMobile?7:-1),a(),p(x(9,11,e.company.jobTrainer)?8:-1)}}var ot=(()=>{class t{constructor(){}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=P({type:t,selectors:[["bkd-student-dossier-apprenticeship-company"]],inputs:{company:"company"},standalone:!0,features:[M],decls:12,vars:12,consts:[[3,"href"],[1,"subentry"]],template:function(i,n){i&1&&(c(0,"address"),_(1,Ie,2,1,"br")(2,Ae,2,1,"br")(3,Te,2,2,"br")(4,De,2,1,"br")(5,Ee,2,1,"br")(6,Le,2,2,"br")(7,je,3,3,"a",0)(8,ke,4,7,"a",0),u(9,"bkdPersonEmail"),m(),_(10,Fe,8,15,"div",1)(11,ze,10,13,"div",1)),i&2&&(a(),p(n.company.apprenticeshipManager!=null&&n.company.apprenticeshipManager.CompanyName?1:-1),a(),p(n.company.apprenticeshipManager!=null&&n.company.apprenticeshipManager.CompanyNameAddition?2:-1),a(),p(n.company.apprenticeshipManager!=null&&n.company.apprenticeshipManager.Lastname||n.company.apprenticeshipManager!=null&&n.company.apprenticeshipManager.Firstname?3:-1),a(),p(n.company.apprenticeshipManager!=null&&n.company.apprenticeshipManager.AddressLine1?4:-1),a(),p(n.company.apprenticeshipManager!=null&&n.company.apprenticeshipManager.AddressLine2?5:-1),a(),p(n.company.apprenticeshipManager!=null&&n.company.apprenticeshipManager.PostalCode&&(n.company.apprenticeshipManager!=null&&n.company.apprenticeshipManager.Location)?6:-1),a(),p(n.company.apprenticeshipManager!=null&&n.company.apprenticeshipManager.PhoneBusiness?7:-1),a(),p(x(9,10,n.company.apprenticeshipManager)?8:-1),a(2),p(n.company.apprenticeshipContract.ContractDateFrom?10:-1),a(),p(n.company.jobTrainer?11:-1))},dependencies:[re,se,pe,fe,$],styles:[".subentry[_ngcontent-%COMP%]{padding-bottom:1rem}"],changeDetection:0})}}return t})();function Ne(t,o){if(t&1&&(r(0),s(1,"br")),t&2){let e=l();y(" ",e.person.AddressLine1,"")}}function Oe(t,o){if(t&1&&(r(0),s(1,"br")),t&2){let e=l();y(" ",e.person.AddressLine2,"")}}function Je(t,o){if(t&1&&(r(0),s(1,"br")),t&2){let e=l();v(" ",e.person.Zip," ",e.person.Location,"")}}function Ye(t,o){if(t&1&&(c(0,"a",0),r(1),s(2,"br"),m()),t&2){let e=l();g("href","tel:",e.person.PhonePrivate,"",h),a(),S(e.person.PhonePrivate)}}function $e(t,o){if(t&1&&(c(0,"a",0),r(1),s(2,"br"),m()),t&2){let e=l();g("href","tel:",e.person.PhoneMobile,"",h),a(),S(e.person.PhoneMobile)}}function He(t,o){if(t&1&&(c(0,"a",0),u(1,"bkdPersonEmail"),r(2),u(3,"bkdPersonEmail"),m()),t&2){let e=l();g("href","mailto:",x(1,3,e.person),"",h),a(2),S(x(3,5,e.person))}}var lt=(()=>{class t{constructor(){}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=P({type:t,selectors:[["bkd-student-dossier-legal-representative"]],inputs:{person:"person"},standalone:!0,features:[M],decls:10,vars:10,consts:[[3,"href"]],template:function(i,n){i&1&&(c(0,"address"),r(1),s(2,"br"),_(3,Ne,2,1,"br")(4,Oe,2,1,"br")(5,Je,2,2,"br")(6,Ye,3,3,"a",0)(7,$e,3,3,"a",0)(8,He,4,7,"a",0),u(9,"bkdPersonEmail"),m()),i&2&&(a(),v(" ",n.person.LastName," ",n.person.FirstName,""),a(2),p(n.person.AddressLine1?3:-1),a(),p(n.person.AddressLine2?4:-1),a(),p(n.person.Zip&&n.person.Zip?5:-1),a(),p(n.person.PhonePrivate?6:-1),a(),p(n.person.PhoneMobile?7:-1),a(),p(x(9,8,n.person)?8:-1))},dependencies:[$],changeDetection:0})}}return t})();function W(t,o){let e=+q(t)-+q(o);return e<0?-1:e>0?1:e}function he(t,o,e){let[i,n]=O(e?.in,t,o);return i.getFullYear()-n.getFullYear()}function ge(t,o,e){let[i,n]=O(e?.in,t,o),b=W(i,n),I=Math.abs(he(i,n));i.setFullYear(1584),n.setFullYear(1584);let A=W(i,n)===-b,D=b*(I-+A);return D===0?0:D}var Ge=18;function ye(t){return ge(new Date,t.Birthdate||new Date)>=Ge}var Ce=N({Email:f(d),Email2:f(d),PhoneBusiness:f(d),CompanyName:R(d),CompanyNameAddition:R(d),Firstname:f(d),Lastname:f(d),AddressLine1:R(d),AddressLine2:R(d),PostalCode:f(d),Location:f(d),Id:z});var xe=(()=>{class t extends J{constructor(e,i){super(e,i,Ce,"ApprenticeshipManagers")}static{this.\u0275fac=function(i){return new(i||t)(C(U),C(k))}}static{this.\u0275prov=j({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var ve=N({Email:f(d),Email2:f(d),PhoneBusiness:f(d),PhoneMobile:f(d),Firstname:f(d),Lastname:f(d),Id:z});var be=(()=>{class t extends J{constructor(e,i){super(e,i,ve,"JobTrainers")}static{this.\u0275fac=function(i){return new(i||t)(C(U),C(k))}}static{this.\u0275prov=j({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Yt=(()=>{class t{constructor(e,i,n,b,I,A){this.studentService=e,this.personsService=i,this.apprenticeshipManagersService=n,this.jobTrainersService=b,this.loadingService=I,this.dropDownItemsService=A,this.loading$=this.loadingService.loading$}getProfile(e){return this.loadingService.load(L([this.loadStudent(e),this.loadLegalRepresentatives(e),this.loadApprenticeshipContracts(e)]).pipe(B(K(this.mapToProfile.bind(this)))))}getMyProfile(){return this.loadingService.load(this.personsService.getMyself({context:new w().set(Y,{disableErrorHandlingForStatus:[403]})}).pipe(B(e=>L([E(e),this.loadLegalRepresentatives(e.Id),this.loadApprenticeshipContracts(e.Id),this.loadStayPermitValue(e.StayPermit)]))).pipe(B(K(this.mapToProfile.bind(this))),X(Z)))}loadStudent(e){return this.studentService.get(e,{context:new w().set(Y,{disableErrorHandlingForStatus:[404]})}).pipe(Q())}loadLegalRepresentatives(e){return this.studentService.getLegalRepresentatives(e)}loadApprenticeshipContracts(e){return this.studentService.getCurrentApprenticeshipContracts(e,{context:new w().set(Y,{disableErrorHandlingForStatus:[404]})}).pipe(Q([]))}loadStayPermitValue(e){return this.dropDownItemsService.getStayPermits().pipe(G(i=>i.find(n=>n.Key===e)?.Value||null))}mapToProfile(e,i,n,b=null){return e?(i=this.getRelevantLegalRepresentatives(e,i),L([this.loadLegalRepresentativPersons(i),this.loadJobTrainers(n),this.loadApprenticeshipManagers(n)]).pipe(G(([I,A,D])=>this.createProfile(e,b,i,I,n,D,A)))):E(null)}loadLegalRepresentativPersons(e){return e.length===0?E([]):this.personsService.getListForIds(e.map(i=>i.RepresentativeId))}loadJobTrainers(e){let i=e.map(n=>n.JobTrainer).filter(n=>typeof n=="number");return i.length===0?E([]):L(i.map(n=>this.jobTrainersService.get(n)))}loadApprenticeshipManagers(e){let i=e.map(n=>n.ApprenticeshipManagerId);return i.length===0?E([]):L(i.map(n=>this.apprenticeshipManagersService.get(n)))}createProfile(e,i,n,b,I,A,D){return{student:e,stayPermitValue:i||void 0,legalRepresentativePersons:n.map(H=>this.findPerson(H.RepresentativeId,b)).filter(Z),apprenticeshipCompanies:I.map(H=>this.createApprenticeshipCompany(H,A,D))}}getRelevantLegalRepresentatives(e,i){let n=ye(e);return i.filter(b=>!n||b.RepresentativeAfterMajority)}createApprenticeshipCompany(e,i,n){return{apprenticeshipContract:e,jobTrainer:this.findPerson(e.JobTrainer,n),apprenticeshipManager:this.findPerson(e.ApprenticeshipManagerId,i)}}findPerson(e,i){return e&&i.find(n=>n.Id===e)||null}static{this.\u0275fac=function(i){return new(i||t)(C(me),C(de),C(xe),C(be),C(ue),C(ce))}}static{this.\u0275prov=j({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var qt=(()=>{class t{constructor(e,i){this.settings=e,this.storageService=i,this.avatarStyles={}}ngOnChanges(e){e.studentId&&(this.avatarStyles=this.buildAvatarStyles(this.studentId))}buildAvatarStyles(e){return{"background-image":[this.buildAvatarUrl(e),this.fallbackAvatarUrl].map(i=>`url(${i})`).join(", ")}}buildAvatarUrl(e){let i=this.storageService.getAccessToken()||"";return`${this.settings.apiUrl}/Files/personPictures/${e}?token=${i}`}get fallbackAvatarUrl(){return`${this.settings.scriptsAndAssetsPath}/assets/images/avatar-placeholder.png`}static{this.\u0275fac=function(i){return new(i||t)(V(k),V(le))}}static{this.\u0275cmp=P({type:t,selectors:[["bkd-avatar"]],inputs:{studentId:"studentId",link:"link",linkParams:"linkParams"},standalone:!0,features:[te,M],decls:1,vars:5,consts:[[1,"avatar",3,"routerLink","queryParams","ngStyle"]],template:function(i,n){i&1&&s(0,"a",0),i&2&&(ie("disabled",!n.link),ne("routerLink",n.link)("queryParams",n.linkParams)("ngStyle",n.avatarStyles))},dependencies:[oe,ae],styles:["[_nghost-%COMP%]{display:flex}.small[_nghost-%COMP%]{width:40px;min-width:40px;height:50px}.medium[_nghost-%COMP%]{width:58px;min-width:58px;height:75px}.large[_nghost-%COMP%]{width:100px;min-width:100px;height:130px}.avatar[_ngcontent-%COMP%]{flex:1;border:1px solid rgba(0,0,0,.25);background-repeat:no-repeat;background-size:cover;background-position:center}a.disabled[_ngcontent-%COMP%]{pointer-events:none;cursor:default}"]})}}return t})();export{Yt as a,We as b,ot as c,lt as d,qt as e}; diff --git a/public/apps/webapp-schulverwaltung/chunk-6ILHYDRU.js b/public/apps/webapp-schulverwaltung/chunk-CRR2TBGE.js similarity index 99% rename from public/apps/webapp-schulverwaltung/chunk-6ILHYDRU.js rename to public/apps/webapp-schulverwaltung/chunk-CRR2TBGE.js index 1cdd764b..840459c5 100644 --- a/public/apps/webapp-schulverwaltung/chunk-6ILHYDRU.js +++ b/public/apps/webapp-schulverwaltung/chunk-CRR2TBGE.js @@ -1 +1 @@ -import{a as me,b as we}from"./chunk-NTSKCSYH.js";import{b as bn}from"./chunk-6HH4DCEF.js";import{a as yn}from"./chunk-IOJSQGH6.js";import{a as Pn,b as xn}from"./chunk-32LHGY5Z.js";import{a as vn}from"./chunk-24TK3FB4.js";import{e as Cn}from"./chunk-7VKKHU7R.js";import{q as hn,v as xe}from"./chunk-LLGOVPQJ.js";import{a as pt}from"./chunk-2H6IFZM2.js";import{b as Xt,c as Zt,e as Je}from"./chunk-QOR23F4L.js";import{a as an}from"./chunk-7FRZV7VF.js";import"./chunk-Y4QYVF5K.js";import"./chunk-OFB4XAK2.js";import{a as wn}from"./chunk-UA2MEY3S.js";import{a as Sn}from"./chunk-6YG4BOT7.js";import{a as lt,e as fn}from"./chunk-VUPOI3TG.js";import{a as pn}from"./chunk-WACRWBCS.js";import{a as ln,b as dn}from"./chunk-MIRGHONI.js";import"./chunk-YUHFF3NM.js";import{A as nn,B as on,C as at,H as rn,L as sn,P as Pe,Q as cn,S as ct,U as _n,g as Yt,p as en,u as tn,v as Qe,z as Ke}from"./chunk-H6G6Q6V6.js";import{j as X,l as ce}from"./chunk-NL5E3FC5.js";import{b as pe}from"./chunk-YD3RJIHU.js";import{a as ze,b as Se,f as mn,g as un,h as gn}from"./chunk-KK2SHN2W.js";import{f as Gt,g as Nt,h as He,i as Ut,j as Ht,k as qt,m as Wt,n as Qt,o as De,p as ae,u as Jt,w as We}from"./chunk-AP373D4K.js";import{a as ye}from"./chunk-B6WYZ7BT.js";import{$c as Vt,Ab as D,B as _t,Bb as Oe,Bd as qe,C as vt,Cb as oe,Cd as Ee,D as it,Db as Dt,F as E,Gb as p,Gd as Kt,H as Ve,Ha as L,Hb as m,Ib as q,Id as J,Jd as V,K as bt,Kd as A,L as yt,Ld as zt,M as B,Ma as x,N as ot,Na as Y,O as Ae,Oa as xt,Oc as Ft,P as T,Pa as Re,R as Q,Ra as k,Sb as Et,Ta as wt,Ua as j,Va as F,Wa as a,Wb as Bt,X as N,Xa as c,Ya as K,Yc as W,Zb as re,_,_b as Ce,a as ue,aa as O,ab as S,b as ge,cb as C,cd as At,db as f,dd as _e,ec as rt,ed as ve,f as $,g as fe,gc as Ge,gd as Rt,h as ke,ha as Pt,hb as Z,hd as be,ia as v,ja as b,jb as It,kb as Mt,l as te,lb as Tt,ma as St,mb as kt,n as u,nb as d,o as M,ob as w,pb as y,qa as ie,qb as Lt,rb as $t,rc as Ne,s as Le,sb as Ot,sc as jt,u as Ct,uc as Ue,ud as se,w as ne,wa as s,wb as U,wd as st,x as $e,xa as h,xb as ee,yb as z,zb as he}from"./chunk-IFJN5CDK.js";function In(n,r){return+X(n)<+X(r)}function Mn(n,r){return+X(n)==+X(r)}function Tn(n,r,e){let t=+X(n,e?.in),[i,o]=[+X(r.start,e?.in),+X(r.end,e?.in)].sort((l,g)=>l-g);return t>=i&&t<=o}function kn(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 Xe=(()=>{class n extends rn{static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=St(n)))(i||n)}})()}static{this.\u0275prov=N({token:n,factory:n.\u0275fac})}}return n})();function Ln(n,r){return[...n].sort(si(r))}function si(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 $n(n,r){return n.map(e=>ai(e,r))}function ai(n,r){return{id:n.IdPerson,name:r.find(e=>e.StudentRef.Id===n.IdPerson)?.StudentFullName||"",group:n.Value,detail:n}}function On(n,r){return n.filter(e=>e.VssId===r.subscriptionDetailGroupId)}function dt(n,r){return n.find(e=>e.VssId===r.subscriptionDetailGroupId)}var ci=(n,r)=>r.id;function pi(n,r){if(n&1){let e=S();a(0,"div",1)(1,"input",5),C("change",function(){let i=v(e).$implicit,o=f();return b(o.onSelectionChange(i))}),c(),a(2,"label",6),d(3),c()()}if(n&2){let e=r.$implicit,t=r.$index,i=f();s(),Z("id","group-",t,""),x("checked",e.id===i.selected.id)("value",e.id),s(),Z("for","group-",t,""),s(),y(" ",e.label," ")}}var Be=function(n){return n.Select="select",n.Assign="assign",n}(Be||{}),Dn=(()=>{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===Be.Select?"presence-control.groups.all":"presence-control.groups.none";return{id:null,label:this.translate.instant(e)}}createGroupOptions(e){return e.DropdownItems?e.DropdownItems.map(t=>({id:t.Key,label:`${this.translate.instant("presence-control.groups.group")} ${t.Value}`})):[]}getSelectedGroup(){return this.selected}onSelectionChange(e){this.selected=e}static{this.\u0275fac=function(t){return new(t||n)(h(ae),h(J))}}static{this.\u0275cmp=O({type:n,selectors:[["bkd-presence-control-group-dialog"]],inputs:{dialogMode:"dialogMode",subscriptionDetailsDefinitions:"subscriptionDetailsDefinitions",group:"group"},standalone:!0,features:[D],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&&(a(0,"div",0)(1,"p"),d(2),p(3,"translate"),c(),a(4,"form"),j(5,pi,4,7,"div",1,ci),c()(),a(7,"div",2)(8,"button",3),C("click",function(){return i.activeModal.dismiss()}),d(9),p(10,"translate"),c(),a(11,"button",4),C("click",function(){return i.activeModal.close(i.getSelectedGroup())}),d(12),p(13,"translate"),c()()),t&2&&(s(2),y(" ",m(3,3,i.title)," "),s(3),F(i.groupOptions),s(4),y(" ",m(10,5,"presence-control.groups.cancel")," "),s(3),y(" ",m(13,7,"presence-control.groups.save")," "))},dependencies:[se,be,_e,ve,A,V]})}}return n})();function En(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 Bn(n){let r=new ut(n.TeacherInformation,n.LessonDateTimeFrom,n.LessonDateTimeTo);return r.addLesson(n),r}var ut=class{constructor(r,e,t){this.TeacherInformation=r,this.LessonDateTimeFrom=e,this.LessonDateTimeTo=t,this.lessons=[]}addLesson(r){this.lessons.some(e=>Ke(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 jn(n){return li(n).reduce((r,e)=>{let t=r.find(o=>En(o,e));if(t)return t.addLesson(e),r;let i=Bn(e);return[...r,i]},[]).sort(at)}function Fn(n){if(n.length===0)return null;let r=new Date;if(n=[...n].sort(at),Zt(r,n[0].LessonDateTimeFrom)){for(let e of n)if(In(r,e.LessonDateTimeFrom)||Tn(r,{start:e.LessonDateTimeFrom,end:e.LessonDateTimeTo}))return e;return n[n.length-1]}return n[0]}function li(n){return n.reduce((r,e)=>r.some(t=>Ke(t,e))?r:[...r,e],[])}function Vn(n,r,e,t){return n.map(i=>{let o=r.find(l=>di(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,ge(ue({},i),{TypeRef:mi(l),Date:null,Type:l?l.Designation:null,ConfirmationStateId:Qe(l,t)})}return i})}function di(n,r){return n.LessonRef.Id===r.LessonRef.Id&&n.StudentRef.Id===r.StudentRef.Id}function mi(n){return{Id:n?n.Id:null,HRef:null}}function Ze(n){return r=>r.reduce((e,t)=>e+(t.presenceCategory===n?1:0),0)}function An(){return n=>n.reduce((r,e)=>r+(e.precedingAbsences&&e.precedingAbsences.length>0?1:0),0)}var Rn=(()=>{class n extends ze{constructor(e,t){super(e,t,lt,"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(Kt(lt)))}static{this.\u0275fac=function(t){return new(t||n)(_(Ge),_(W))}}static{this.\u0275prov=N({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var et=(()=>{class n extends ze{constructor(e,t){super(e,t,hn,"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)(_(Ge),_(W))}}static{this.\u0275prov=N({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var Nn="presence-control-group",de=(()=>{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 ke,this.lessonPresences$=new ke,this.reloadSubscriptionDetails$=new $,this.defaultGroup=null,this.savedGroup$=this.selectedLesson$.pipe(T(g=>this.userSettings.getPresenceControlGroupView().pipe(u(I=>this.findGroupByLesson(I,g))))),this.group$=ne(this.selectGroup$,this.savedGroup$).pipe(Ae(this.defaultGroup),B(1)),this.loading$=this.loadingService.loading(Nn),this.subscriptionDetailsDefinitions$=this.selectedLesson$.pipe(u(g=>g?.getEventIds()||[]),T(g=>Le(g.map(I=>this.eventService.getSubscriptionDetailsDefinitions(I)))),B(1)),this.groupsAvailability$=this.subscriptionDetailsDefinitions$.pipe(u(g=>g.every(I=>dt(I,this.settings))),B(1)),this.subscriptionDetails$=M([this.selectedLesson$,this.groupsAvailability$,this.reloadSubscriptionDetails$.pipe(u(()=>!1),Ae(!0))]).pipe(T(([g,I,R])=>g&&I?this.loadSubscriptionDetailsForLesson(g,R):te([])),u(g=>On(g,this.settings)),B(1)),this.subscriptionDetailPersonIds$=M([this.group$,this.subscriptionDetails$]).pipe(u(([g,I])=>I.filter(R=>R.Value===g).map(R=>R.IdPerson)),Ae([]))}selectGroup(e){this.selectGroup$.next(e)}setSelectedLesson(e){this.selectedLesson$.next(e)}setLessonPresences(e){this.lessonPresences$.next(e)}getSubscriptionDetailsDefinitions(){return this.subscriptionDetailsDefinitions$.pipe(u(st),u(e=>dt(e,this.settings)))}getSubscriptionDetailsForStudents(){return M([this.subscriptionDetails$,this.lessonPresences$]).pipe(u(ce($n)))}reloadSubscriptionDetails(){this.reloadSubscriptionDetails$.next(void 0)}loadSubscriptionDetailsForLesson(e,t=!0){return this.loadingService.load(Le(Ee(e.getEventIds()).map(i=>this.subscriptionDetailsService.getListForEvent(i))),t?void 0:Nn).pipe(u(st))}findGroupByLesson(e,t){return e.find(o=>o.eventId===t?.getEventIds()[0])?.group||this.defaultGroup}static{this.\u0275fac=function(t){return new(t||n)(_(we),_(yn),_(et),_(pe),_(W))}}static{this.\u0275prov=N({token:n,factory:n.\u0275fac})}}return n})();var qn=Object.values(me),H=(()=>{class n{constructor(e,t,i,o,l,g,I,R,Ie,Me){this.userSettings=e,this.lessonPresencesService=t,this.lessonTeacherService=i,this.presenceTypesService=o,this.groupService=l,this.dropDownItemsService=g,this.loadingService=I,this.storageService=R,this.settings=Ie,this.location=Me,this.selectedDateSubject$=new fe(new Date),this.selectedDate$=this.selectedDateSubject$.asObservable().pipe(u(P=>Yt(P)),Ve(qe)),this.viewModeSubject$=new $,this.viewMode$=ne(this.viewModeSubject$,this.userSettings.getPresenceControlViewMode().pipe(E(1))),this.lessons$=this.selectedDate$.pipe(T(P=>this.loadLessonsByDate(P)),B(1)),this.selectLessonId$=new $,this.selectLesson$=this.selectLessonId$.pipe(T(P=>this.getLessonById(P))),this.selectedLesson$=M([mn(this.selectLesson$.pipe(Ve((P,Te)=>qe(P,Te))),un(this.settings.lessonPresencesRefreshTime)),this.lessons$]).pipe(u(([P,Te])=>Te.find(oi=>oi.id===P.id)?P:null),B(1)),this.studyClassCount$=this.selectedLesson$.pipe(u(P=>P?.lessons.length||0)),this.updateLessonPresences$=new $,this.reloadLessonPresences$=new $,this.lessonPresences$=ne(gn(this.selectedLesson$,this.reloadLessonPresences$).pipe(T(P=>P?this.loadLessonPresencesByLesson(P):te([]))),this.updateLessonPresences$).pipe(B(1)),this.presenceTypes$=this.loadPresenceTypes().pipe(B(1)),this.reloadStudentIdsWithUnconfirmedAbsences$=new $,this.studentIdsWithUnconfirmedAbsences$=ne(this.selectedDate$,this.selectedLesson$.pipe(ot(1)),this.reloadStudentIdsWithUnconfirmedAbsences$).pipe(T(()=>this.loadStudentIdsWithUnconfirmedAbsences()),B(1)),this.loading$=this.loadingService.loading$,this.absenceConfirmationStates$=this.dropDownItemsService.getAbsenceConfirmationStates().pipe(B(1)),this.studentIds$=this.lessonPresences$.pipe(u(P=>Ee(P.map(Te=>Te.StudentRef.Id))),B(1)),this.otherTeachersAbsences$=this.studentIds$.pipe(Ve(qe),T(P=>P.length>0?this.lessonTeacherService.loadOtherTeachersLessonAbsences(this.getMyself(),P):te([])),B(1)),this.groupsAvailability$=this.groupService.groupsAvailability$,this.presenceControlEntries$=M([this.selectedLesson$,this.lessonPresences$,this.presenceTypes$,this.absenceConfirmationStates$,this.otherTeachersAbsences$]).pipe(u(ce(nn))),this.presenceControlEntriesByGroup$=M([this.groupService.group$,this.presenceControlEntries$,this.groupService.subscriptionDetailPersonIds$]).pipe(u(ce(bn)),B(1)),this.presentCount$=this.presenceControlEntriesByGroup$.pipe(u(Ze("present"))),this.absentCount$=this.presenceControlEntriesByGroup$.pipe(u(Ze("absent"))),this.unapprovedCount$=this.presenceControlEntriesByGroup$.pipe(u(Ze("unapproved"))),this.absentPrecedingCount$=this.presenceControlEntriesByGroup$.pipe(u(An())),this.queryParamsString$=M([this.selectedDate$,this.selectedLesson$,this.viewMode$]).pipe(u(ce(this.buildQueryParams.bind(this))),u(dn)),this.destroy$=new $,this.queryParamsString$.pipe(Q(this.destroy$)).subscribe(P=>{this.location.replaceState("/presence-control",P),this.confirmBackLinkParams={returnparams:P}}),this.viewMode$.pipe(ot(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(E(1)),this.presenceTypes$.pipe(E(1))]).pipe(u(([t,i])=>Vn(t,e,i,this.settings))).subscribe(t=>this.updateLessonPresences$.next(t))}getNextPresenceType(e){return this.presenceTypes$.pipe(E(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(jn))}loadPresenceTypes(){return this.loadingService.load(this.presenceTypesService.presenceTypes$)}loadStudentIdsWithUnconfirmedAbsences(){return Ct(0,this.settings.unconfirmedAbsencesRefreshTime||-1).pipe(T(()=>this.lessonPresencesService.getListOfUnconfirmed()),u(e=>Ee(e.map(t=>t.StudentRef.Id))))}buildQueryParams(e,t,i){let o={date:en(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)||Fn(i)),$e(Boolean))}getMyself(){let e=this.storageService.getPayload();return Number(e?.holder_id||e?.id_person)}static{this.\u0275fac=function(t){return new(t||n)(_(we),_(Je),_(Rn),_(Pe),_(de),_(an),_(pe),_(zt),_(W),_(Et))}}static{this.\u0275prov=N({token:n,factory:n.\u0275fac})}}return n})();var Ci=(n,r)=>r.id,_i=()=>[],vi=()=>["/presence-control"];function bi(n,r){if(n&1&&(a(0,"span",12),d(1),c()),n&2){let e=f().$implicit,t=f(),i=z(0);s(),w(t.getSortDirectionCharacter(i,e))}}function yi(n,r){if(n&1){let e=S();a(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,bi,2,1,"span",12),c()}if(n&2){let e=r.$implicit;f();let t=z(0);x("className",e),s(),y(" ",m(2,3,"presence-control.groups.list.header."+e)," "),s(2),k(t?3:-1)}}function Pi(n,r){n&1&&K(0,"bkd-spinner")}function Si(n,r){n&1&&K(0,"bkd-spinner",18)}function xi(n,r){if(n&1){let e=S();a(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))}),c()(),a(5,"div",16),d(6),c(),a(7,"div",17)(8,"span"),d(9),c(),L(10,Si,1,0,"bkd-spinner",18),p(11,"async"),c()()}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),w(e.group?e.group:""),s(),k(m(11,6,t.groupService.loading$)?10:-1)}}function wi(n,r){if(n&1&&j(0,xi,12,8,"div",13,Ci),n&2){f();let e=z(2);F(e)}}var Kn=(()=>{class n{constructor(e,t,i,o,l,g,I,R,Ie){this.route=e,this.state=t,this.selectionService=i,this.groupService=o,this.userSettings=l,this.subscriptionDetailService=g,this.toastService=I,this.translate=R,this.modalService=Ie,this.primarySortKeys=["name","group"],this.backlinkQueryParams$=this.route.queryParams.pipe(u(({returnparams:Me})=>Me),u(ln)),this.eventIds$=this.state.selectedLesson$.pipe(u(Me=>Me?.getEventIds()||[])),this.sortCriteriaSubject$=new fe({primarySortKey:"name",ascending:!1}),this.sortCriteria$=this.sortCriteriaSubject$.asObservable(),this.sortedEntries$=M([this.groupService.getSubscriptionDetailsForStudents(),this.sortCriteria$]).pipe(u(ce(Ln))),this.selected=[]}ngOnInit(){this.selectionService.selection$.subscribe(e=>this.selected=e)}selectGroup(){this.openGroupModal(Be.Select,this.selectCallback.bind(this))}assignGroup(){this.openGroupModal(Be.Assign,this.assignCallback.bind(this))}openGroupModal(e,t){M([this.groupService.getSubscriptionDetailsDefinitions(),this.groupService.group$]).pipe(E(1)).subscribe(([i,o])=>{let l=this.modalService.open(Dn);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(E(1),T(([t,i])=>this.userSettings.savePresenceControlGroupView(kn(e.id,t,i))),u(()=>e.id)).subscribe(t=>this.groupService.selectGroup(t))}assignCallback(e){Le(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(E(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(Ne),h(H),h(Xe),h(de),h(we),h(et),h(ye),h(J),h(xe))}}static{this.\u0275cmp=O({type:n,selectors:[["bkd-presence-control-group"]],standalone:!0,features:[he([Xe]),D],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();U(0),p(1,"async"),U(2),p(3,"async"),U(4),p(5,"async"),U(6),p(7,"async"),a(8,"div"),K(9,"bkd-backlink",1),p(10,"async"),a(11,"h1"),d(12),p(13,"translate"),c(),a(14,"div",2)(15,"div",3)(16,"span",4),d(17),p(18,"translate"),c(),a(19,"button",5),C("click",function(){return v(o),b(i.selectGroup())}),d(20),p(21,"translate"),p(22,"translate"),c()(),a(23,"a",6),C("click",function(){return v(o),b(i.assignGroup())}),a(24,"i",7),d(25,"edit"),c()()(),a(26,"div",8)(27,"div",9),j(28,yi,4,5,"div",10,wt),c(),L(30,Pi,1,0,"bkd-spinner"),p(31,"async"),L(32,wi,2,0),c()()}if(t&2){let o;ee(m(1,8,i.sortCriteria$)),s(2),ee(m(3,11,i.sortedEntries$));let l=(o=m(5,14,i.selectionService.selection$))!==null&&o!==void 0?o:Oe(30,_i),g=m(7,16,i.groupService.group$);s(7),x("link",Oe(31,vi))("params",m(10,18,i.backlinkQueryParams$)),s(3),w(m(13,20,"presence-control.groups.title")),s(5),w(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),Y("disabled",l.length===0),s(5),F(i.primarySortKeys),s(2),k(m(31,28,i.state.loading$)?30:32)}},dependencies:[_n,Se,re,A,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 Ii=(n,r)=>r.entry.id;function Mi(n,r){if(n&1){let e=S();a(0,"div",1)(1,"input",5),C("change",function(){let i=v(e).$implicit;return b(i.selected=!i.selected)}),c(),a(2,"label",6)(3,"i"),d(4),c(),a(5,"div",7),d(6),p(7,"date"),p(8,"date"),c()()()}if(n&2){let e=r.$implicit,t=r.$index,i=f();s(),Z("id","lesson-presence-",t,""),x("checked",e.selected),s(),Y("fw-bold",i.isCurrentLesson(e)),Z("for","lesson-presence-",t,""),s(),Re("",e.entry.presenceCategory," material-icons pe-2"),s(),w(e.entry.presenceCategoryIcon),s(2),$t(" ",q(7,14,e.entry.lessonPresence.LessonDateTimeFrom,"HH:mm"),"\u2013",q(8,17,e.entry.lessonPresence.LessonDateTimeTo,"HH:mm")," ",e.entry.lessonPresence.EventDesignation," ")}}var zn=(()=>{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 Mn(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(ae))}}static{this.\u0275cmp=O({type:n,selectors:[["bkd-presence-control-block-lesson-component"]],inputs:{entry:"entry",blockPresenceControlEntries:"blockPresenceControlEntries"},standalone:!0,features:[D],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();a(0,"div",0)(1,"p"),d(2),p(3,"translate"),c(),a(4,"form"),j(5,Mi,9,20,"div",1,Ii),c()(),U(7),a(8,"div",2)(9,"button",3),C("click",function(){return v(o),b(i.activeModal.close())}),d(10),p(11,"translate"),c(),a(12,"button",4),C("click",function(){v(o);let g=z(7);return b(i.activeModal.close(g))}),d(13),p(14,"translate"),c()()}if(t&2){s(2),y(" ",m(3,4,"presence-control.block-lesson.text")," "),s(3),F(i.blockLessonOptions),s(2);let o=ee(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:[se,be,_e,ve,Ce,A,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 Ti=30;function ht(n){return`blockLesson${n.lessonPresence.Id}`}var tt=(()=>{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(E(1)),this.loadChangeableLessonPresences(e),this.state.presenceTypes$.pipe(E(1)),this.state.absenceConfirmationStates$.pipe(E(1)),this.state.otherTeachersAbsences$.pipe(E(1))]).pipe(u(([t,i,o,l,g])=>this.filterBlockLessonPresences(e,i).map(I=>on(t.find(R=>R.id===I.LessonRef.Id.toString()),I,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()<=Ti*60*1e3:!0}loadChangeableLessonPresences(e){return M([this.loadLessonPresences(e),this.state.presenceTypes$.pipe(E(1))]).pipe(u(([t,i])=>t.filter(o=>tn(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))),ht(e))}static{this.\u0275fac=function(t){return new(t||n)(_(H),_(Je),_(pe),_(W))}}static{this.\u0275prov=N({token:n,factory:n.\u0275fac})}}return n})();var Li=(n,r)=>r.Id;function $i(n,r){if(n&1&&(a(0,"div"),d(1),p(2,"date"),p(3,"date"),p(4,"addSpace"),c()),n&2){let e=r.$implicit;s(),Ot(" ",q(2,5,e.LessonRef.From,"HH:mm"),"\u2013",q(3,8,e.LessonRef.To,"HH:mm")," ",e.LessonRef.EventDesignation,"",q(4,11,":",":")," ",e.Type," ")}}var Jn=(()=>{class n{constructor(e){this.activeModal=e}static{this.\u0275fac=function(t){return new(t||n)(h(ae))}}static{this.\u0275cmp=O({type:n,selectors:[["bkd-presence-control-preceding-absence"]],inputs:{precedingAbsences:"precedingAbsences"},standalone:!0,features:[D],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&&(a(0,"div",0)(1,"p"),d(2),p(3,"translate"),c(),j(4,$i,5,14,"div",null,Li),c(),a(6,"div",1)(7,"button",2),C("click",function(){return i.activeModal.dismiss()}),d(8),p(9,"translate"),c()()),t&2&&(s(2),y(" ",m(3,2,"presence-control.preceding-absence.text")," "),s(2),F(i.precedingAbsences),s(4),y(" ",m(9,4,"presence-control.preceding-absence.cancel")," "))},dependencies:[Ce,A,V,fn]})}}return n})();var Oi=n=>["student",n,"absences"],Di=n=>["/presence-control/student",n,"absences"];function Ei(n,r){if(n&1&&(K(0,"bkd-avatar",0),p(1,"async")),n&2){let e=f();x("studentId",m(1,3,e.studentId$))("link",oe(5,Di,e.entry.lessonPresence.StudentRef.Id.toString()))("linkParams",e.profileReturnParams)}}function Bi(n,r){if(n&1&&(a(0,"span"),d(1),c()),n&2){let e=f(2);s(),w(e.entry.presenceType==null?null:e.entry.presenceType.Designation)}}function ji(n,r){if(n&1){let e=S();a(0,"button",12),C("click",function(){v(e);let i=f();return b(i.updatePresenceType(i.entry))}),L(1,Bi,2,1,"span"),c()}if(n&2){let e=f();s(),k(e.entry.presenceType!=null&&e.entry.presenceType.IsIncident?-1:1)}}function Fi(n,r){n&1&&K(0,"bkd-spinner",5)}function Vi(n,r){if(n&1){let e=S();a(0,"button",13),C("click",function(){v(e);let i=f();return b(i.showPrecedingAbsences(i.entry))}),a(1,"i",14),d(2,"info"),c()()}}function Ai(n,r){if(n&1&&(a(0,"span",9),d(1),c()),n&2){let e=f();s(),y(" ",e.entry.lessonPresence.StudyClassNumber," ")}}function Ri(n,r){if(n&1){let e=S();a(0,"a",15),C("click",function(){v(e);let i=f();return b(i.updateIncident(i.entry))}),a(1,"i",4),d(2,"edit"),c(),a(3,"span"),d(4),p(5,"translate"),c()()}if(n&2){let e=f();s(4),w(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 Xn=(()=>{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 ie,this.changeIncident=new ie,this.entry$=new ke(1),this.studentId$=this.entry$.pipe(u(({lessonPresence:l})=>l.StudentRef.Id)),this.loading$=this.entry$.pipe(T(l=>this.loadingService.loading(ht(l))))}ngOnChanges(e){e.entry&&this.entry$.next(e.entry.currentValue)}get isListViewMode(){return this.viewMode===me.List}updatePresenceType(e){e.canChangePresenceType?this.togglePresenceType.emit(e):this.toastService.warning(this.translate.instant("presence-control.entry.update-warning"))}updateIncident(e){e.canChangeIncident&&this.changeIncident.emit(e)}showPrecedingAbsences(e){let t=this.modalService.open(Jn);t.componentInstance.precedingAbsences=e.precedingAbsences}static{this.\u0275fac=function(t){return new(t||n)(h(ye),h(J),h(xe),h(pe))}}static{this.\u0275cmp=O({type:n,selectors:[["bkd-presence-control-entry"]],hostVars:2,hostBindings:function(t,i){t&2&&xt(i.classNames)},inputs:{entry:"entry",hasUnconfirmedAbsences:"hasUnconfirmedAbsences",viewMode:"viewMode",showClassName:"showClassName",profileReturnParams:"profileReturnParams"},outputs:{togglePresenceType:"togglePresenceType",changeIncident:"changeIncident"},standalone:!0,features:[Pt,D],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,Ei,2,7,"bkd-avatar",0)(1,ji,2,1,"button",1),U(2),p(3,"async"),a(4,"button",2),C("click",function(){return v(o),b(i.updatePresenceType(i.entry))}),a(5,"div",3)(6,"i",4),d(7),c(),L(8,Fi,1,0,"bkd-spinner",5),c()(),L(9,Vi,3,0,"button",6),a(10,"a",7)(11,"span",8),d(12),c(),L(13,Ai,2,1,"span",9),a(14,"span",10),d(15),p(16,"translate"),c()(),L(17,Ri,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),Y("invisible",o),s(),w(i.entry.presenceCategoryIcon),s(),k(o?8:-1),s(),k(i.entry.precedingAbsences!=null&&i.entry.precedingAbsences.length?9:-1),s(),x("routerLink",oe(18,Oi,i.entry.lessonPresence.StudentRef.Id))("queryParams",i.profileReturnParams),s(2),w(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:[Cn,Se,Ue,re,A,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 Gi=(n,r)=>r.viewMode,Ni=(n,r)=>r.id,Ui=(n,r)=>({"btn-link":n,"btn-danger":r}),Hi=n=>["groups",n],qi=n=>({returnparams:n});function Wi(n,r){if(n&1){let e=S();a(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"),a(3,"span",23),d(4),p(5,"date"),c()()}if(n&2){let e=f();s(),y(" ",q(2,2,e.selectedLesson.LessonDateTimeFrom,"HH:mm"),"\u2013"),s(3),w(q(5,5,e.selectedLesson.LessonDateTimeTo,"HH:mm"))}}function Qi(n,r){if(n&1){let e=S();a(0,"div",28),C("click",function(){let i=v(e).$implicit,o=f(2);return b(o.selectLessonChange.emit(i))}),a(1,"div",29)(2,"div"),d(3),p(4,"date"),p(5,"date"),c(),a(6,"div",25),d(7),c(),a(8,"div",25),d(9),c()()()}if(n&2){let e=r.$implicit,t=f(2);Y("active",e.id===t.selectedLesson.id),s(3),Lt(" ",q(4,6,e.LessonDateTimeFrom,"HH:mm"),"\u2013",q(5,9,e.LessonDateTimeTo,"HH:mm")," "),s(4),y(" ",e.eventDesignations," "),s(2),y(" ",e.studyClassNumbers," ")}}function Ki(n,r){if(n&1&&(a(0,"div",7)(1,"div",24)(2,"div",25),d(3),c(),a(4,"div",25),d(5),c()(),a(6,"div",26),j(7,Qi,10,12,"div",27,Ni),c()()),n&2){let e=f();s(3),w(e.selectedLesson.eventDesignations),s(2),w(e.selectedLesson.studyClassNumbers),s(2),F(e.lessons)}}function zi(n,r){if(n&1){let e=S();a(0,"bkd-caret",30),C("click",function(){v(e);let i=f();return b(i.lessonDropdown==null?null:i.lessonDropdown.toggle())}),c()}if(n&2){let e=f();x("expanded",(e.lessonDropdown==null?null:e.lessonDropdown.isOpen())||!1)}}function Ji(n,r){if(n&1&&(a(0,"a",19),p(1,"async"),p(2,"async"),p(3,"async"),a(4,"i",31),d(5,"groups"),c()()),n&2){let e=f();x("ngClass",Dt(9,Ui,m(1,3,e.isGroupSelected$)===!1,m(2,5,e.isGroupSelected$)))("routerLink",oe(12,Hi,e.selectedLesson.id))("queryParams",oe(14,qi,m(3,7,e.state.queryParamsString$)))}}function Xi(n,r){if(n&1){let e=S();a(0,"button",32),C("click",function(){let i=v(e).$implicit,o=f();return b(o.viewModeChange.emit(i.viewMode))}),a(1,"i",31),d(2),c()()}if(n&2){let e=r.$implicit,t=f();Y("btn-outline-secondary",e.viewMode===t.viewMode)("btn-link",e.viewMode!==t.viewMode)("active",e.viewMode===t.viewMode),x("disabled",!t.selectedLesson),s(2),w(e.icon)}}var Yi=De.prototype._positionMenu;De.prototype._positionMenu=function(...r){let e=Yi.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 Yn=(()=>{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 ie,this.selectDateChange=new ie,this.searchChange=new ie,this.viewModeChange=new ie,this.viewModeOptions=[{viewMode:me.List,icon:"list"},{viewMode:me.Grid,icon:"view_module"}],this.isGroupSelected$=this.groupService.group$.pipe(u(Jt)),i.popperOptions=o=>ge(ue({},o),{modifiers:o.modifiers?.map(l=>(l.name==="offset"&&(l.options={offset:({placement:g,reference:I,popper:R})=>g==="bottom-start"?[(window.innerWidth-R.width)/2-I.x,0]:[]}),l))})}static{this.\u0275fac=function(t){return new(t||n)(h(H),h(de),h(He))}}static{this.\u0275cmp=O({type:n,selectors:[["bkd-presence-control-header"]],viewQuery:function(t,i){if(t&1&&It(De,5),t&2){let o;Mt(o=Tt())&&(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"},standalone:!0,features:[he([He,{provide:Gt,useClass:Ht},{provide:Nt,useClass:Sn}]),D],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();a(0,"div",1)(1,"div",2)(2,"button",3),C("click",function(){v(o);let g=kt(6);return b(g.toggle())}),a(3,"i",4),d(4,"calendar_today"),c()(),a(5,"input",5,0),C("ngModelChange",function(g){return v(o),b(i.selectDateChange.emit(g))}),c()(),L(7,Wi,6,8,"div",6)(8,Ki,9,2,"div",7)(9,zi,1,1,"bkd-caret",8),c(),a(10,"div",9)(11,"div",10)(12,"i",4),d(13,"check_circle"),c(),a(14,"span",11),d(15),c()(),a(16,"div",12)(17,"i",4),d(18,"cancel"),c(),a(19,"span",11),d(20),c()(),a(21,"div",13)(22,"i",4),d(23,"help"),c(),a(24,"span",11),d(25),c()(),a(26,"div",14)(27,"i",15),d(28,"info"),c(),a(29,"span",11),d(30),c()()(),a(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))}),c(),a(35,"div",18),L(36,Ji,6,16,"a",19),p(37,"async"),a(38,"div",20),j(39,Xi,3,8,"button",21,Gi),c()()()}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),w(i.presentCount!==null?i.presentCount:"?"),s(5),w(i.absentCount!==null?i.absentCount:"?"),s(5),w(i.unapprovedCount!==null?i.unapprovedCount:"?"),s(5),w(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),F(i.viewModeOptions))},dependencies:[Ut,se,Vt,At,Rt,De,Qt,Wt,qt,pn,xn,Bt,Ue,re,Ce,A,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 Zi=(n,r)=>r.id;function eo(n,r){if(n&1){let e=S();a(0,"div",1)(1,"input",5),C("change",function(){let i=v(e).$implicit,o=f();return b(o.onSelectionChange(i))}),c(),a(2,"label",6),d(3),c()()}if(n&2){let e=r.$implicit,t=r.$index,i=f();s(),Z("id","incident-",t,""),x("checked",e.id===i.selected.id)("value",e.id),s(),Z("for","incident-",t,""),s(),y(" ",e.label," ")}}var Zn=(()=>{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(ae),h(J))}}static{this.\u0275cmp=O({type:n,selectors:[["bkd-presence-control-incident"]],inputs:{incident:"incident",incidentTypes:"incidentTypes"},standalone:!0,features:[D],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&&(a(0,"div",0)(1,"p"),d(2),p(3,"translate"),c(),a(4,"form"),j(5,eo,4,7,"div",1,Zi),c()(),a(7,"div",2)(8,"button",3),C("click",function(){return i.activeModal.dismiss()}),d(9),p(10,"translate"),c(),a(11,"button",4),C("click",function(){return i.activeModal.close(i.getSelectedIncident())}),d(12),p(13,"translate"),c()()),t&2&&(s(2),y(" ",m(3,3,"presence-control.incident.text")," "),s(3),F(i.incidentOptions),s(4),y(" ",m(10,5,"presence-control.incident.cancel")," "),s(3),y(" ",m(13,7,"presence-control.incident.save")," "))},dependencies:[se,be,_e,ve,A,V],styles:["form[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]:first-child{border-bottom:1px solid #dee2e6;padding-bottom:1rem;margin-bottom:1rem}"]})}}return n})();var to=20,no=100,Fe=function(n){return n.AddUpdateAction="ADD",n.RemoveUpdateAction="REMOVE",n}(Fe||{}),nt=(()=>{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(bt(this.reduceUpdates.bind(this),[]),yt()),this.revertUpdates$=new $,this.performUpdates$=this.pendingUpdates$.pipe(it(no),$e(We(ct)),vt(this.performUpdates.bind(this))),this.stateUpdates$=ne(this.pendingUpdates$,this.revertUpdates$).pipe(it(to),$e(We(ct))),this.performUpdates$.pipe(Q(this.destroy$)).subscribe()}ngOnDestroy(){this.destroy$.next()}updatePresenceType(e,t=null){this.dispatchAddUpdate(e.lessonPresence,t)}performUpdates(e){let t=this.groupUpdates(e);return M(Object.keys(t).reduce((i,o)=>{let l=t[o];return Object.keys(l).forEach(g=>{let I=l[g];i.push(this.performUpdateForGroup(I))}),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(_t(t=>this.revertUpdatesAfterError(e,t)))}performLessonPresencesUpdatesByIds(e,t,i=null){return i?(i?this.presenceTypesService.getPresenceType(i):te(null)).pipe(T(l=>this.restService.editLessonPresences([e],t,l?.Id,Qe(l,this.settings)||void 0,{context:new rt().set(pt,{disableErrorHandling:!0})}))):this.restService.removeLessonPresences([e],t,{context:new rt().set(pt,{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=>ge(ue({},i),{newPresenceTypeId:i.presence.TypeRef.Id}))),te(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 Fe.AddUpdateAction:{let{presence:i,newPresenceTypeId:o}=t.payload,l=e.findIndex(ei(i));return l===-1?[...e,{presence:i,newPresenceTypeId:o}]:[...e.slice(0,l),{presence:e[l].presence,newPresenceTypeId:o},...e.slice(l+1)]}case Fe.RemoveUpdateAction:return e.filter(We(ei(t.payload)));default:return e}}dispatchAddUpdate(e,t){this.action$.next({type:Fe.AddUpdateAction,payload:{presence:e,newPresenceTypeId:t}})}dispatchRemoveUpdate(e){this.action$.next({type:Fe.RemoveUpdateAction,payload:e})}static{this.\u0275fac=function(t){return new(t||n)(_(ye),_(J),_(cn),_(Pe),_(W))}}static{this.\u0275prov=N({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();function ei(n){return r=>r.presence.LessonRef.Id===n.LessonRef.Id&&r.presence.StudentRef.Id===n.StudentRef.Id}var io=(n,r)=>r.id,oo=()=>[],ro=n=>({returnparams:n});function so(n,r){n&1&&K(0,"bkd-spinner")}function ao(n,r){n&1&&(a(0,"p",1),d(1),p(2,"translate"),c()),n&2&&(s(),w(m(2,1,"presence-control.no-lessons")))}function co(n,r){n&1&&(a(0,"p",1),d(1),p(2,"translate"),c()),n&2&&(s(),y(" ",m(2,1,"presence-control.no-lesson-presences")," "))}function po(n,r){if(n&1){let e=S();a(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))}),c()}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",oe(13,ro,m(4,11,i.state.queryParamsString$)))}}function lo(n,r){if(n&1&&(a(0,"div"),p(1,"async"),j(2,po,5,15,"bkd-presence-control-entry",3,io),c()),n&2){let e=f(2),t=z(4);Re("default-entries entries view-mode-",m(1,3,e.state.viewMode$),""),s(2),F(t)}}function mo(n,r){if(n&1){let e=S();a(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))}),c(),L(8,ao,3,3,"p",1)(9,co,3,3,"p",1)(10,lo,4,5,"div",2)}if(n&2){let e=f(),t=z(0),i=z(2),o=z(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 uo=["studentFullName"],ni=(()=>{class n{constructor(e,t,i,o,l,g,I){this.state=e,this.blockLessons=t,this.lessonPresencesUpdateService=i,this.presenceTypesService=o,this.modalService=l,this.scrollPosition=g,this.route=I,this.search$=new fe(""),this.entries$=M([this.state.presenceControlEntriesByGroup$,this.search$]).pipe(u(([R,Ie])=>Pn(R,uo,Ie)),B(1)),this.destroy$=new $}ngOnInit(){this.route.queryParams.pipe(Q(this.destroy$)).subscribe(this.restoreStateFromParams.bind(this))}ngAfterViewInit(){this.scrollPosition.restore()}ngOnDestroy(){this.destroy$.next()}doTogglePresenceType(e){e.forEach(t=>this.state.getNextPresenceType(t).subscribe(i=>this.lessonPresencesUpdateService.updatePresenceType(t,i?i.Id:null)))}togglePresenceType(e){this.blockLessons.getBlockLessonPresenceControlEntries(e).pipe(E(1)).subscribe(t=>{if(t.length===1){let i=t[0];this.doTogglePresenceType([i])}else{let i=this.modalService.open(zn);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(Zn);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(Ft(e.date));let t=String(e.lesson);t&&this.state.setLessonId(t),e.viewMode&&qn.includes(e.viewMode)&&this.state.setViewMode(e.viewMode)}static{this.\u0275fac=function(t){return new(t||n)(h(H),h(tt),h(nt),h(Pe),h(xe),h(wn),h(Ne))}}static{this.\u0275cmp=O({type:n,selectors:[["bkd-presence-control-list"]],standalone:!0,features:[D],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&&(U(0),p(1,"async"),U(2),p(3,"async"),U(4),p(5,"async"),a(6,"h1"),d(7),p(8,"translate"),c(),L(9,so,1,0,"bkd-spinner"),p(10,"async"),L(11,mo,11,24)),t&2){let o;ee(m(1,2,i.state.selectedLesson$)),s(2),ee(m(3,5,i.state.lessons$)),s(2),ee((o=m(5,8,i.entries$))!==null&&o!==void 0?o:Oe(15,oo)),s(3),w(m(8,11,"presence-control.title")),s(2),k(m(10,13,i.state.loading$)?9:11)}},dependencies:[Yn,Xn,Se,re,A,V],styles:["bkd-presence-control-entry[_ngcontent-%COMP%]{border-bottom:1px solid #dee2e6}.entries.view-mode-grid[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap}.entries.view-mode-grid[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{width:100%}@media (min-width: 400px){.entries.view-mode-grid[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{width:100%;border-right:1px solid #dee2e6}}@media (min-width: 800px){.entries.view-mode-grid[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{width:50%;border-right:1px solid #dee2e6}}@media (min-width: 1200px){.entries.view-mode-grid[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{width:33.3333333333%;border-right:1px solid #dee2e6}}@media (min-width: 1600px){.entries.view-mode-grid[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{width:25%;border-right:1px solid #dee2e6}}@media (min-width: 2000px){.entries.view-mode-grid[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{width:20%;border-right:1px solid #dee2e6}}@media (min-width: 2400px){.entries.view-mode-grid[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{width:16.6666666667%;border-right:1px solid #dee2e6}}[_nghost-%COMP%]{display:block;overflow:hidden;width:100%}.entries.view-mode-grid[_ngcontent-%COMP%]{width:calc(100% + 1px)}"],changeDetection:0})}}return n})();var ii=(()=>{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(H),h(nt))}}static{this.\u0275cmp=O({type:n,selectors:[["bkd-presence-control"]],standalone:!0,features:[he([H,tt,de,sn,{provide:Xt,useExisting:H}]),D],decls:1,vars:0,template:function(t,i){t&1&&K(0,"router-outlet")},dependencies:[jt],changeDetection:0})}}return n})();var ca=[{path:"",component:ii,children:[{path:"",component:ni,data:{restoreScrollPositionFrom:["/presence-control/student/:id/addresses","/presence-control/student/:id/absences","/presence-control/student/:id/grades"]}},vn,{path:"groups/:id",component:Kn}]}];export{ca as PRESENCE_CONTROL_ROUTES}; +import{a as me,b as we}from"./chunk-NTSKCSYH.js";import{b as bn}from"./chunk-6HH4DCEF.js";import{a as yn}from"./chunk-IOJSQGH6.js";import{a as Pn,b as xn}from"./chunk-32LHGY5Z.js";import{a as vn}from"./chunk-HAT2K5YI.js";import{e as Cn}from"./chunk-4YGUAC2V.js";import{q as hn,v as xe}from"./chunk-LLGOVPQJ.js";import{a as pt}from"./chunk-2H6IFZM2.js";import{b as Xt,c as Zt,e as Je}from"./chunk-QOR23F4L.js";import{a as an}from"./chunk-7FRZV7VF.js";import"./chunk-Y4QYVF5K.js";import"./chunk-OFB4XAK2.js";import{a as wn}from"./chunk-UA2MEY3S.js";import{a as Sn}from"./chunk-6YG4BOT7.js";import{a as lt,e as fn}from"./chunk-VUPOI3TG.js";import{a as pn}from"./chunk-WACRWBCS.js";import{a as ln,b as dn}from"./chunk-MIRGHONI.js";import"./chunk-YUHFF3NM.js";import{A as nn,B as on,C as at,H as rn,L as sn,P as Pe,Q as cn,S as ct,U as _n,g as Yt,p as en,u as tn,v as Qe,z as Ke}from"./chunk-H6G6Q6V6.js";import{j as X,l as ce}from"./chunk-NL5E3FC5.js";import{b as pe}from"./chunk-YD3RJIHU.js";import{a as ze,b as Se,f as mn,g as un,h as gn}from"./chunk-KK2SHN2W.js";import{f as Gt,g as Nt,h as He,i as Ut,j as Ht,k as qt,m as Wt,n as Qt,o as De,p as ae,u as Jt,w as We}from"./chunk-AP373D4K.js";import{a as ye}from"./chunk-B6WYZ7BT.js";import{$c as Vt,Ab as D,B as _t,Bb as Oe,Bd as qe,C as vt,Cb as oe,Cd as Ee,D as it,Db as Dt,F as E,Gb as p,Gd as Kt,H as Ve,Ha as L,Hb as m,Ib as q,Id as J,Jd as V,K as bt,Kd as A,L as yt,Ld as zt,M as B,Ma as x,N as ot,Na as Y,O as Ae,Oa as xt,Oc as Ft,P as T,Pa as Re,R as Q,Ra as k,Sb as Et,Ta as wt,Ua as j,Va as F,Wa as a,Wb as Bt,X as N,Xa as c,Ya as K,Yc as W,Zb as re,_,_b as Ce,a as ue,aa as O,ab as S,b as ge,cb as C,cd as At,db as f,dd as _e,ec as rt,ed as ve,f as $,g as fe,gc as Ge,gd as Rt,h as ke,ha as Pt,hb as Z,hd as be,ia as v,ja as b,jb as It,kb as Mt,l as te,lb as Tt,ma as St,mb as kt,n as u,nb as d,o as M,ob as w,pb as y,qa as ie,qb as Lt,rb as $t,rc as Ne,s as Le,sb as Ot,sc as jt,u as Ct,uc as Ue,ud as se,w as ne,wa as s,wb as U,wd as st,x as $e,xa as h,xb as ee,yb as z,zb as he}from"./chunk-IFJN5CDK.js";function In(n,r){return+X(n)<+X(r)}function Mn(n,r){return+X(n)==+X(r)}function Tn(n,r,e){let t=+X(n,e?.in),[i,o]=[+X(r.start,e?.in),+X(r.end,e?.in)].sort((l,g)=>l-g);return t>=i&&t<=o}function kn(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 Xe=(()=>{class n extends rn{static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=St(n)))(i||n)}})()}static{this.\u0275prov=N({token:n,factory:n.\u0275fac})}}return n})();function Ln(n,r){return[...n].sort(si(r))}function si(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 $n(n,r){return n.map(e=>ai(e,r))}function ai(n,r){return{id:n.IdPerson,name:r.find(e=>e.StudentRef.Id===n.IdPerson)?.StudentFullName||"",group:n.Value,detail:n}}function On(n,r){return n.filter(e=>e.VssId===r.subscriptionDetailGroupId)}function dt(n,r){return n.find(e=>e.VssId===r.subscriptionDetailGroupId)}var ci=(n,r)=>r.id;function pi(n,r){if(n&1){let e=S();a(0,"div",1)(1,"input",5),C("change",function(){let i=v(e).$implicit,o=f();return b(o.onSelectionChange(i))}),c(),a(2,"label",6),d(3),c()()}if(n&2){let e=r.$implicit,t=r.$index,i=f();s(),Z("id","group-",t,""),x("checked",e.id===i.selected.id)("value",e.id),s(),Z("for","group-",t,""),s(),y(" ",e.label," ")}}var Be=function(n){return n.Select="select",n.Assign="assign",n}(Be||{}),Dn=(()=>{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===Be.Select?"presence-control.groups.all":"presence-control.groups.none";return{id:null,label:this.translate.instant(e)}}createGroupOptions(e){return e.DropdownItems?e.DropdownItems.map(t=>({id:t.Key,label:`${this.translate.instant("presence-control.groups.group")} ${t.Value}`})):[]}getSelectedGroup(){return this.selected}onSelectionChange(e){this.selected=e}static{this.\u0275fac=function(t){return new(t||n)(h(ae),h(J))}}static{this.\u0275cmp=O({type:n,selectors:[["bkd-presence-control-group-dialog"]],inputs:{dialogMode:"dialogMode",subscriptionDetailsDefinitions:"subscriptionDetailsDefinitions",group:"group"},standalone:!0,features:[D],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&&(a(0,"div",0)(1,"p"),d(2),p(3,"translate"),c(),a(4,"form"),j(5,pi,4,7,"div",1,ci),c()(),a(7,"div",2)(8,"button",3),C("click",function(){return i.activeModal.dismiss()}),d(9),p(10,"translate"),c(),a(11,"button",4),C("click",function(){return i.activeModal.close(i.getSelectedGroup())}),d(12),p(13,"translate"),c()()),t&2&&(s(2),y(" ",m(3,3,i.title)," "),s(3),F(i.groupOptions),s(4),y(" ",m(10,5,"presence-control.groups.cancel")," "),s(3),y(" ",m(13,7,"presence-control.groups.save")," "))},dependencies:[se,be,_e,ve,A,V]})}}return n})();function En(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 Bn(n){let r=new ut(n.TeacherInformation,n.LessonDateTimeFrom,n.LessonDateTimeTo);return r.addLesson(n),r}var ut=class{constructor(r,e,t){this.TeacherInformation=r,this.LessonDateTimeFrom=e,this.LessonDateTimeTo=t,this.lessons=[]}addLesson(r){this.lessons.some(e=>Ke(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 jn(n){return li(n).reduce((r,e)=>{let t=r.find(o=>En(o,e));if(t)return t.addLesson(e),r;let i=Bn(e);return[...r,i]},[]).sort(at)}function Fn(n){if(n.length===0)return null;let r=new Date;if(n=[...n].sort(at),Zt(r,n[0].LessonDateTimeFrom)){for(let e of n)if(In(r,e.LessonDateTimeFrom)||Tn(r,{start:e.LessonDateTimeFrom,end:e.LessonDateTimeTo}))return e;return n[n.length-1]}return n[0]}function li(n){return n.reduce((r,e)=>r.some(t=>Ke(t,e))?r:[...r,e],[])}function Vn(n,r,e,t){return n.map(i=>{let o=r.find(l=>di(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,ge(ue({},i),{TypeRef:mi(l),Date:null,Type:l?l.Designation:null,ConfirmationStateId:Qe(l,t)})}return i})}function di(n,r){return n.LessonRef.Id===r.LessonRef.Id&&n.StudentRef.Id===r.StudentRef.Id}function mi(n){return{Id:n?n.Id:null,HRef:null}}function Ze(n){return r=>r.reduce((e,t)=>e+(t.presenceCategory===n?1:0),0)}function An(){return n=>n.reduce((r,e)=>r+(e.precedingAbsences&&e.precedingAbsences.length>0?1:0),0)}var Rn=(()=>{class n extends ze{constructor(e,t){super(e,t,lt,"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(Kt(lt)))}static{this.\u0275fac=function(t){return new(t||n)(_(Ge),_(W))}}static{this.\u0275prov=N({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var et=(()=>{class n extends ze{constructor(e,t){super(e,t,hn,"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)(_(Ge),_(W))}}static{this.\u0275prov=N({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var Nn="presence-control-group",de=(()=>{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 ke,this.lessonPresences$=new ke,this.reloadSubscriptionDetails$=new $,this.defaultGroup=null,this.savedGroup$=this.selectedLesson$.pipe(T(g=>this.userSettings.getPresenceControlGroupView().pipe(u(I=>this.findGroupByLesson(I,g))))),this.group$=ne(this.selectGroup$,this.savedGroup$).pipe(Ae(this.defaultGroup),B(1)),this.loading$=this.loadingService.loading(Nn),this.subscriptionDetailsDefinitions$=this.selectedLesson$.pipe(u(g=>g?.getEventIds()||[]),T(g=>Le(g.map(I=>this.eventService.getSubscriptionDetailsDefinitions(I)))),B(1)),this.groupsAvailability$=this.subscriptionDetailsDefinitions$.pipe(u(g=>g.every(I=>dt(I,this.settings))),B(1)),this.subscriptionDetails$=M([this.selectedLesson$,this.groupsAvailability$,this.reloadSubscriptionDetails$.pipe(u(()=>!1),Ae(!0))]).pipe(T(([g,I,R])=>g&&I?this.loadSubscriptionDetailsForLesson(g,R):te([])),u(g=>On(g,this.settings)),B(1)),this.subscriptionDetailPersonIds$=M([this.group$,this.subscriptionDetails$]).pipe(u(([g,I])=>I.filter(R=>R.Value===g).map(R=>R.IdPerson)),Ae([]))}selectGroup(e){this.selectGroup$.next(e)}setSelectedLesson(e){this.selectedLesson$.next(e)}setLessonPresences(e){this.lessonPresences$.next(e)}getSubscriptionDetailsDefinitions(){return this.subscriptionDetailsDefinitions$.pipe(u(st),u(e=>dt(e,this.settings)))}getSubscriptionDetailsForStudents(){return M([this.subscriptionDetails$,this.lessonPresences$]).pipe(u(ce($n)))}reloadSubscriptionDetails(){this.reloadSubscriptionDetails$.next(void 0)}loadSubscriptionDetailsForLesson(e,t=!0){return this.loadingService.load(Le(Ee(e.getEventIds()).map(i=>this.subscriptionDetailsService.getListForEvent(i))),t?void 0:Nn).pipe(u(st))}findGroupByLesson(e,t){return e.find(o=>o.eventId===t?.getEventIds()[0])?.group||this.defaultGroup}static{this.\u0275fac=function(t){return new(t||n)(_(we),_(yn),_(et),_(pe),_(W))}}static{this.\u0275prov=N({token:n,factory:n.\u0275fac})}}return n})();var qn=Object.values(me),H=(()=>{class n{constructor(e,t,i,o,l,g,I,R,Ie,Me){this.userSettings=e,this.lessonPresencesService=t,this.lessonTeacherService=i,this.presenceTypesService=o,this.groupService=l,this.dropDownItemsService=g,this.loadingService=I,this.storageService=R,this.settings=Ie,this.location=Me,this.selectedDateSubject$=new fe(new Date),this.selectedDate$=this.selectedDateSubject$.asObservable().pipe(u(P=>Yt(P)),Ve(qe)),this.viewModeSubject$=new $,this.viewMode$=ne(this.viewModeSubject$,this.userSettings.getPresenceControlViewMode().pipe(E(1))),this.lessons$=this.selectedDate$.pipe(T(P=>this.loadLessonsByDate(P)),B(1)),this.selectLessonId$=new $,this.selectLesson$=this.selectLessonId$.pipe(T(P=>this.getLessonById(P))),this.selectedLesson$=M([mn(this.selectLesson$.pipe(Ve((P,Te)=>qe(P,Te))),un(this.settings.lessonPresencesRefreshTime)),this.lessons$]).pipe(u(([P,Te])=>Te.find(oi=>oi.id===P.id)?P:null),B(1)),this.studyClassCount$=this.selectedLesson$.pipe(u(P=>P?.lessons.length||0)),this.updateLessonPresences$=new $,this.reloadLessonPresences$=new $,this.lessonPresences$=ne(gn(this.selectedLesson$,this.reloadLessonPresences$).pipe(T(P=>P?this.loadLessonPresencesByLesson(P):te([]))),this.updateLessonPresences$).pipe(B(1)),this.presenceTypes$=this.loadPresenceTypes().pipe(B(1)),this.reloadStudentIdsWithUnconfirmedAbsences$=new $,this.studentIdsWithUnconfirmedAbsences$=ne(this.selectedDate$,this.selectedLesson$.pipe(ot(1)),this.reloadStudentIdsWithUnconfirmedAbsences$).pipe(T(()=>this.loadStudentIdsWithUnconfirmedAbsences()),B(1)),this.loading$=this.loadingService.loading$,this.absenceConfirmationStates$=this.dropDownItemsService.getAbsenceConfirmationStates().pipe(B(1)),this.studentIds$=this.lessonPresences$.pipe(u(P=>Ee(P.map(Te=>Te.StudentRef.Id))),B(1)),this.otherTeachersAbsences$=this.studentIds$.pipe(Ve(qe),T(P=>P.length>0?this.lessonTeacherService.loadOtherTeachersLessonAbsences(this.getMyself(),P):te([])),B(1)),this.groupsAvailability$=this.groupService.groupsAvailability$,this.presenceControlEntries$=M([this.selectedLesson$,this.lessonPresences$,this.presenceTypes$,this.absenceConfirmationStates$,this.otherTeachersAbsences$]).pipe(u(ce(nn))),this.presenceControlEntriesByGroup$=M([this.groupService.group$,this.presenceControlEntries$,this.groupService.subscriptionDetailPersonIds$]).pipe(u(ce(bn)),B(1)),this.presentCount$=this.presenceControlEntriesByGroup$.pipe(u(Ze("present"))),this.absentCount$=this.presenceControlEntriesByGroup$.pipe(u(Ze("absent"))),this.unapprovedCount$=this.presenceControlEntriesByGroup$.pipe(u(Ze("unapproved"))),this.absentPrecedingCount$=this.presenceControlEntriesByGroup$.pipe(u(An())),this.queryParamsString$=M([this.selectedDate$,this.selectedLesson$,this.viewMode$]).pipe(u(ce(this.buildQueryParams.bind(this))),u(dn)),this.destroy$=new $,this.queryParamsString$.pipe(Q(this.destroy$)).subscribe(P=>{this.location.replaceState("/presence-control",P),this.confirmBackLinkParams={returnparams:P}}),this.viewMode$.pipe(ot(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(E(1)),this.presenceTypes$.pipe(E(1))]).pipe(u(([t,i])=>Vn(t,e,i,this.settings))).subscribe(t=>this.updateLessonPresences$.next(t))}getNextPresenceType(e){return this.presenceTypes$.pipe(E(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(jn))}loadPresenceTypes(){return this.loadingService.load(this.presenceTypesService.presenceTypes$)}loadStudentIdsWithUnconfirmedAbsences(){return Ct(0,this.settings.unconfirmedAbsencesRefreshTime||-1).pipe(T(()=>this.lessonPresencesService.getListOfUnconfirmed()),u(e=>Ee(e.map(t=>t.StudentRef.Id))))}buildQueryParams(e,t,i){let o={date:en(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)||Fn(i)),$e(Boolean))}getMyself(){let e=this.storageService.getPayload();return Number(e?.holder_id||e?.id_person)}static{this.\u0275fac=function(t){return new(t||n)(_(we),_(Je),_(Rn),_(Pe),_(de),_(an),_(pe),_(zt),_(W),_(Et))}}static{this.\u0275prov=N({token:n,factory:n.\u0275fac})}}return n})();var Ci=(n,r)=>r.id,_i=()=>[],vi=()=>["/presence-control"];function bi(n,r){if(n&1&&(a(0,"span",12),d(1),c()),n&2){let e=f().$implicit,t=f(),i=z(0);s(),w(t.getSortDirectionCharacter(i,e))}}function yi(n,r){if(n&1){let e=S();a(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,bi,2,1,"span",12),c()}if(n&2){let e=r.$implicit;f();let t=z(0);x("className",e),s(),y(" ",m(2,3,"presence-control.groups.list.header."+e)," "),s(2),k(t?3:-1)}}function Pi(n,r){n&1&&K(0,"bkd-spinner")}function Si(n,r){n&1&&K(0,"bkd-spinner",18)}function xi(n,r){if(n&1){let e=S();a(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))}),c()(),a(5,"div",16),d(6),c(),a(7,"div",17)(8,"span"),d(9),c(),L(10,Si,1,0,"bkd-spinner",18),p(11,"async"),c()()}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),w(e.group?e.group:""),s(),k(m(11,6,t.groupService.loading$)?10:-1)}}function wi(n,r){if(n&1&&j(0,xi,12,8,"div",13,Ci),n&2){f();let e=z(2);F(e)}}var Kn=(()=>{class n{constructor(e,t,i,o,l,g,I,R,Ie){this.route=e,this.state=t,this.selectionService=i,this.groupService=o,this.userSettings=l,this.subscriptionDetailService=g,this.toastService=I,this.translate=R,this.modalService=Ie,this.primarySortKeys=["name","group"],this.backlinkQueryParams$=this.route.queryParams.pipe(u(({returnparams:Me})=>Me),u(ln)),this.eventIds$=this.state.selectedLesson$.pipe(u(Me=>Me?.getEventIds()||[])),this.sortCriteriaSubject$=new fe({primarySortKey:"name",ascending:!1}),this.sortCriteria$=this.sortCriteriaSubject$.asObservable(),this.sortedEntries$=M([this.groupService.getSubscriptionDetailsForStudents(),this.sortCriteria$]).pipe(u(ce(Ln))),this.selected=[]}ngOnInit(){this.selectionService.selection$.subscribe(e=>this.selected=e)}selectGroup(){this.openGroupModal(Be.Select,this.selectCallback.bind(this))}assignGroup(){this.openGroupModal(Be.Assign,this.assignCallback.bind(this))}openGroupModal(e,t){M([this.groupService.getSubscriptionDetailsDefinitions(),this.groupService.group$]).pipe(E(1)).subscribe(([i,o])=>{let l=this.modalService.open(Dn);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(E(1),T(([t,i])=>this.userSettings.savePresenceControlGroupView(kn(e.id,t,i))),u(()=>e.id)).subscribe(t=>this.groupService.selectGroup(t))}assignCallback(e){Le(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(E(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(Ne),h(H),h(Xe),h(de),h(we),h(et),h(ye),h(J),h(xe))}}static{this.\u0275cmp=O({type:n,selectors:[["bkd-presence-control-group"]],standalone:!0,features:[he([Xe]),D],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();U(0),p(1,"async"),U(2),p(3,"async"),U(4),p(5,"async"),U(6),p(7,"async"),a(8,"div"),K(9,"bkd-backlink",1),p(10,"async"),a(11,"h1"),d(12),p(13,"translate"),c(),a(14,"div",2)(15,"div",3)(16,"span",4),d(17),p(18,"translate"),c(),a(19,"button",5),C("click",function(){return v(o),b(i.selectGroup())}),d(20),p(21,"translate"),p(22,"translate"),c()(),a(23,"a",6),C("click",function(){return v(o),b(i.assignGroup())}),a(24,"i",7),d(25,"edit"),c()()(),a(26,"div",8)(27,"div",9),j(28,yi,4,5,"div",10,wt),c(),L(30,Pi,1,0,"bkd-spinner"),p(31,"async"),L(32,wi,2,0),c()()}if(t&2){let o;ee(m(1,8,i.sortCriteria$)),s(2),ee(m(3,11,i.sortedEntries$));let l=(o=m(5,14,i.selectionService.selection$))!==null&&o!==void 0?o:Oe(30,_i),g=m(7,16,i.groupService.group$);s(7),x("link",Oe(31,vi))("params",m(10,18,i.backlinkQueryParams$)),s(3),w(m(13,20,"presence-control.groups.title")),s(5),w(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),Y("disabled",l.length===0),s(5),F(i.primarySortKeys),s(2),k(m(31,28,i.state.loading$)?30:32)}},dependencies:[_n,Se,re,A,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 Ii=(n,r)=>r.entry.id;function Mi(n,r){if(n&1){let e=S();a(0,"div",1)(1,"input",5),C("change",function(){let i=v(e).$implicit;return b(i.selected=!i.selected)}),c(),a(2,"label",6)(3,"i"),d(4),c(),a(5,"div",7),d(6),p(7,"date"),p(8,"date"),c()()()}if(n&2){let e=r.$implicit,t=r.$index,i=f();s(),Z("id","lesson-presence-",t,""),x("checked",e.selected),s(),Y("fw-bold",i.isCurrentLesson(e)),Z("for","lesson-presence-",t,""),s(),Re("",e.entry.presenceCategory," material-icons pe-2"),s(),w(e.entry.presenceCategoryIcon),s(2),$t(" ",q(7,14,e.entry.lessonPresence.LessonDateTimeFrom,"HH:mm"),"\u2013",q(8,17,e.entry.lessonPresence.LessonDateTimeTo,"HH:mm")," ",e.entry.lessonPresence.EventDesignation," ")}}var zn=(()=>{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 Mn(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(ae))}}static{this.\u0275cmp=O({type:n,selectors:[["bkd-presence-control-block-lesson-component"]],inputs:{entry:"entry",blockPresenceControlEntries:"blockPresenceControlEntries"},standalone:!0,features:[D],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();a(0,"div",0)(1,"p"),d(2),p(3,"translate"),c(),a(4,"form"),j(5,Mi,9,20,"div",1,Ii),c()(),U(7),a(8,"div",2)(9,"button",3),C("click",function(){return v(o),b(i.activeModal.close())}),d(10),p(11,"translate"),c(),a(12,"button",4),C("click",function(){v(o);let g=z(7);return b(i.activeModal.close(g))}),d(13),p(14,"translate"),c()()}if(t&2){s(2),y(" ",m(3,4,"presence-control.block-lesson.text")," "),s(3),F(i.blockLessonOptions),s(2);let o=ee(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:[se,be,_e,ve,Ce,A,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 Ti=30;function ht(n){return`blockLesson${n.lessonPresence.Id}`}var tt=(()=>{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(E(1)),this.loadChangeableLessonPresences(e),this.state.presenceTypes$.pipe(E(1)),this.state.absenceConfirmationStates$.pipe(E(1)),this.state.otherTeachersAbsences$.pipe(E(1))]).pipe(u(([t,i,o,l,g])=>this.filterBlockLessonPresences(e,i).map(I=>on(t.find(R=>R.id===I.LessonRef.Id.toString()),I,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()<=Ti*60*1e3:!0}loadChangeableLessonPresences(e){return M([this.loadLessonPresences(e),this.state.presenceTypes$.pipe(E(1))]).pipe(u(([t,i])=>t.filter(o=>tn(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))),ht(e))}static{this.\u0275fac=function(t){return new(t||n)(_(H),_(Je),_(pe),_(W))}}static{this.\u0275prov=N({token:n,factory:n.\u0275fac})}}return n})();var Li=(n,r)=>r.Id;function $i(n,r){if(n&1&&(a(0,"div"),d(1),p(2,"date"),p(3,"date"),p(4,"addSpace"),c()),n&2){let e=r.$implicit;s(),Ot(" ",q(2,5,e.LessonRef.From,"HH:mm"),"\u2013",q(3,8,e.LessonRef.To,"HH:mm")," ",e.LessonRef.EventDesignation,"",q(4,11,":",":")," ",e.Type," ")}}var Jn=(()=>{class n{constructor(e){this.activeModal=e}static{this.\u0275fac=function(t){return new(t||n)(h(ae))}}static{this.\u0275cmp=O({type:n,selectors:[["bkd-presence-control-preceding-absence"]],inputs:{precedingAbsences:"precedingAbsences"},standalone:!0,features:[D],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&&(a(0,"div",0)(1,"p"),d(2),p(3,"translate"),c(),j(4,$i,5,14,"div",null,Li),c(),a(6,"div",1)(7,"button",2),C("click",function(){return i.activeModal.dismiss()}),d(8),p(9,"translate"),c()()),t&2&&(s(2),y(" ",m(3,2,"presence-control.preceding-absence.text")," "),s(2),F(i.precedingAbsences),s(4),y(" ",m(9,4,"presence-control.preceding-absence.cancel")," "))},dependencies:[Ce,A,V,fn]})}}return n})();var Oi=n=>["student",n,"absences"],Di=n=>["/presence-control/student",n,"absences"];function Ei(n,r){if(n&1&&(K(0,"bkd-avatar",0),p(1,"async")),n&2){let e=f();x("studentId",m(1,3,e.studentId$))("link",oe(5,Di,e.entry.lessonPresence.StudentRef.Id.toString()))("linkParams",e.profileReturnParams)}}function Bi(n,r){if(n&1&&(a(0,"span"),d(1),c()),n&2){let e=f(2);s(),w(e.entry.presenceType==null?null:e.entry.presenceType.Designation)}}function ji(n,r){if(n&1){let e=S();a(0,"button",12),C("click",function(){v(e);let i=f();return b(i.updatePresenceType(i.entry))}),L(1,Bi,2,1,"span"),c()}if(n&2){let e=f();s(),k(e.entry.presenceType!=null&&e.entry.presenceType.IsIncident?-1:1)}}function Fi(n,r){n&1&&K(0,"bkd-spinner",5)}function Vi(n,r){if(n&1){let e=S();a(0,"button",13),C("click",function(){v(e);let i=f();return b(i.showPrecedingAbsences(i.entry))}),a(1,"i",14),d(2,"info"),c()()}}function Ai(n,r){if(n&1&&(a(0,"span",9),d(1),c()),n&2){let e=f();s(),y(" ",e.entry.lessonPresence.StudyClassNumber," ")}}function Ri(n,r){if(n&1){let e=S();a(0,"a",15),C("click",function(){v(e);let i=f();return b(i.updateIncident(i.entry))}),a(1,"i",4),d(2,"edit"),c(),a(3,"span"),d(4),p(5,"translate"),c()()}if(n&2){let e=f();s(4),w(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 Xn=(()=>{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 ie,this.changeIncident=new ie,this.entry$=new ke(1),this.studentId$=this.entry$.pipe(u(({lessonPresence:l})=>l.StudentRef.Id)),this.loading$=this.entry$.pipe(T(l=>this.loadingService.loading(ht(l))))}ngOnChanges(e){e.entry&&this.entry$.next(e.entry.currentValue)}get isListViewMode(){return this.viewMode===me.List}updatePresenceType(e){e.canChangePresenceType?this.togglePresenceType.emit(e):this.toastService.warning(this.translate.instant("presence-control.entry.update-warning"))}updateIncident(e){e.canChangeIncident&&this.changeIncident.emit(e)}showPrecedingAbsences(e){let t=this.modalService.open(Jn);t.componentInstance.precedingAbsences=e.precedingAbsences}static{this.\u0275fac=function(t){return new(t||n)(h(ye),h(J),h(xe),h(pe))}}static{this.\u0275cmp=O({type:n,selectors:[["bkd-presence-control-entry"]],hostVars:2,hostBindings:function(t,i){t&2&&xt(i.classNames)},inputs:{entry:"entry",hasUnconfirmedAbsences:"hasUnconfirmedAbsences",viewMode:"viewMode",showClassName:"showClassName",profileReturnParams:"profileReturnParams"},outputs:{togglePresenceType:"togglePresenceType",changeIncident:"changeIncident"},standalone:!0,features:[Pt,D],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,Ei,2,7,"bkd-avatar",0)(1,ji,2,1,"button",1),U(2),p(3,"async"),a(4,"button",2),C("click",function(){return v(o),b(i.updatePresenceType(i.entry))}),a(5,"div",3)(6,"i",4),d(7),c(),L(8,Fi,1,0,"bkd-spinner",5),c()(),L(9,Vi,3,0,"button",6),a(10,"a",7)(11,"span",8),d(12),c(),L(13,Ai,2,1,"span",9),a(14,"span",10),d(15),p(16,"translate"),c()(),L(17,Ri,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),Y("invisible",o),s(),w(i.entry.presenceCategoryIcon),s(),k(o?8:-1),s(),k(i.entry.precedingAbsences!=null&&i.entry.precedingAbsences.length?9:-1),s(),x("routerLink",oe(18,Oi,i.entry.lessonPresence.StudentRef.Id))("queryParams",i.profileReturnParams),s(2),w(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:[Cn,Se,Ue,re,A,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 Gi=(n,r)=>r.viewMode,Ni=(n,r)=>r.id,Ui=(n,r)=>({"btn-link":n,"btn-danger":r}),Hi=n=>["groups",n],qi=n=>({returnparams:n});function Wi(n,r){if(n&1){let e=S();a(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"),a(3,"span",23),d(4),p(5,"date"),c()()}if(n&2){let e=f();s(),y(" ",q(2,2,e.selectedLesson.LessonDateTimeFrom,"HH:mm"),"\u2013"),s(3),w(q(5,5,e.selectedLesson.LessonDateTimeTo,"HH:mm"))}}function Qi(n,r){if(n&1){let e=S();a(0,"div",28),C("click",function(){let i=v(e).$implicit,o=f(2);return b(o.selectLessonChange.emit(i))}),a(1,"div",29)(2,"div"),d(3),p(4,"date"),p(5,"date"),c(),a(6,"div",25),d(7),c(),a(8,"div",25),d(9),c()()()}if(n&2){let e=r.$implicit,t=f(2);Y("active",e.id===t.selectedLesson.id),s(3),Lt(" ",q(4,6,e.LessonDateTimeFrom,"HH:mm"),"\u2013",q(5,9,e.LessonDateTimeTo,"HH:mm")," "),s(4),y(" ",e.eventDesignations," "),s(2),y(" ",e.studyClassNumbers," ")}}function Ki(n,r){if(n&1&&(a(0,"div",7)(1,"div",24)(2,"div",25),d(3),c(),a(4,"div",25),d(5),c()(),a(6,"div",26),j(7,Qi,10,12,"div",27,Ni),c()()),n&2){let e=f();s(3),w(e.selectedLesson.eventDesignations),s(2),w(e.selectedLesson.studyClassNumbers),s(2),F(e.lessons)}}function zi(n,r){if(n&1){let e=S();a(0,"bkd-caret",30),C("click",function(){v(e);let i=f();return b(i.lessonDropdown==null?null:i.lessonDropdown.toggle())}),c()}if(n&2){let e=f();x("expanded",(e.lessonDropdown==null?null:e.lessonDropdown.isOpen())||!1)}}function Ji(n,r){if(n&1&&(a(0,"a",19),p(1,"async"),p(2,"async"),p(3,"async"),a(4,"i",31),d(5,"groups"),c()()),n&2){let e=f();x("ngClass",Dt(9,Ui,m(1,3,e.isGroupSelected$)===!1,m(2,5,e.isGroupSelected$)))("routerLink",oe(12,Hi,e.selectedLesson.id))("queryParams",oe(14,qi,m(3,7,e.state.queryParamsString$)))}}function Xi(n,r){if(n&1){let e=S();a(0,"button",32),C("click",function(){let i=v(e).$implicit,o=f();return b(o.viewModeChange.emit(i.viewMode))}),a(1,"i",31),d(2),c()()}if(n&2){let e=r.$implicit,t=f();Y("btn-outline-secondary",e.viewMode===t.viewMode)("btn-link",e.viewMode!==t.viewMode)("active",e.viewMode===t.viewMode),x("disabled",!t.selectedLesson),s(2),w(e.icon)}}var Yi=De.prototype._positionMenu;De.prototype._positionMenu=function(...r){let e=Yi.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 Yn=(()=>{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 ie,this.selectDateChange=new ie,this.searchChange=new ie,this.viewModeChange=new ie,this.viewModeOptions=[{viewMode:me.List,icon:"list"},{viewMode:me.Grid,icon:"view_module"}],this.isGroupSelected$=this.groupService.group$.pipe(u(Jt)),i.popperOptions=o=>ge(ue({},o),{modifiers:o.modifiers?.map(l=>(l.name==="offset"&&(l.options={offset:({placement:g,reference:I,popper:R})=>g==="bottom-start"?[(window.innerWidth-R.width)/2-I.x,0]:[]}),l))})}static{this.\u0275fac=function(t){return new(t||n)(h(H),h(de),h(He))}}static{this.\u0275cmp=O({type:n,selectors:[["bkd-presence-control-header"]],viewQuery:function(t,i){if(t&1&&It(De,5),t&2){let o;Mt(o=Tt())&&(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"},standalone:!0,features:[he([He,{provide:Gt,useClass:Ht},{provide:Nt,useClass:Sn}]),D],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();a(0,"div",1)(1,"div",2)(2,"button",3),C("click",function(){v(o);let g=kt(6);return b(g.toggle())}),a(3,"i",4),d(4,"calendar_today"),c()(),a(5,"input",5,0),C("ngModelChange",function(g){return v(o),b(i.selectDateChange.emit(g))}),c()(),L(7,Wi,6,8,"div",6)(8,Ki,9,2,"div",7)(9,zi,1,1,"bkd-caret",8),c(),a(10,"div",9)(11,"div",10)(12,"i",4),d(13,"check_circle"),c(),a(14,"span",11),d(15),c()(),a(16,"div",12)(17,"i",4),d(18,"cancel"),c(),a(19,"span",11),d(20),c()(),a(21,"div",13)(22,"i",4),d(23,"help"),c(),a(24,"span",11),d(25),c()(),a(26,"div",14)(27,"i",15),d(28,"info"),c(),a(29,"span",11),d(30),c()()(),a(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))}),c(),a(35,"div",18),L(36,Ji,6,16,"a",19),p(37,"async"),a(38,"div",20),j(39,Xi,3,8,"button",21,Gi),c()()()}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),w(i.presentCount!==null?i.presentCount:"?"),s(5),w(i.absentCount!==null?i.absentCount:"?"),s(5),w(i.unapprovedCount!==null?i.unapprovedCount:"?"),s(5),w(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),F(i.viewModeOptions))},dependencies:[Ut,se,Vt,At,Rt,De,Qt,Wt,qt,pn,xn,Bt,Ue,re,Ce,A,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 Zi=(n,r)=>r.id;function eo(n,r){if(n&1){let e=S();a(0,"div",1)(1,"input",5),C("change",function(){let i=v(e).$implicit,o=f();return b(o.onSelectionChange(i))}),c(),a(2,"label",6),d(3),c()()}if(n&2){let e=r.$implicit,t=r.$index,i=f();s(),Z("id","incident-",t,""),x("checked",e.id===i.selected.id)("value",e.id),s(),Z("for","incident-",t,""),s(),y(" ",e.label," ")}}var Zn=(()=>{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(ae),h(J))}}static{this.\u0275cmp=O({type:n,selectors:[["bkd-presence-control-incident"]],inputs:{incident:"incident",incidentTypes:"incidentTypes"},standalone:!0,features:[D],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&&(a(0,"div",0)(1,"p"),d(2),p(3,"translate"),c(),a(4,"form"),j(5,eo,4,7,"div",1,Zi),c()(),a(7,"div",2)(8,"button",3),C("click",function(){return i.activeModal.dismiss()}),d(9),p(10,"translate"),c(),a(11,"button",4),C("click",function(){return i.activeModal.close(i.getSelectedIncident())}),d(12),p(13,"translate"),c()()),t&2&&(s(2),y(" ",m(3,3,"presence-control.incident.text")," "),s(3),F(i.incidentOptions),s(4),y(" ",m(10,5,"presence-control.incident.cancel")," "),s(3),y(" ",m(13,7,"presence-control.incident.save")," "))},dependencies:[se,be,_e,ve,A,V],styles:["form[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]:first-child{border-bottom:1px solid #dee2e6;padding-bottom:1rem;margin-bottom:1rem}"]})}}return n})();var to=20,no=100,Fe=function(n){return n.AddUpdateAction="ADD",n.RemoveUpdateAction="REMOVE",n}(Fe||{}),nt=(()=>{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(bt(this.reduceUpdates.bind(this),[]),yt()),this.revertUpdates$=new $,this.performUpdates$=this.pendingUpdates$.pipe(it(no),$e(We(ct)),vt(this.performUpdates.bind(this))),this.stateUpdates$=ne(this.pendingUpdates$,this.revertUpdates$).pipe(it(to),$e(We(ct))),this.performUpdates$.pipe(Q(this.destroy$)).subscribe()}ngOnDestroy(){this.destroy$.next()}updatePresenceType(e,t=null){this.dispatchAddUpdate(e.lessonPresence,t)}performUpdates(e){let t=this.groupUpdates(e);return M(Object.keys(t).reduce((i,o)=>{let l=t[o];return Object.keys(l).forEach(g=>{let I=l[g];i.push(this.performUpdateForGroup(I))}),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(_t(t=>this.revertUpdatesAfterError(e,t)))}performLessonPresencesUpdatesByIds(e,t,i=null){return i?(i?this.presenceTypesService.getPresenceType(i):te(null)).pipe(T(l=>this.restService.editLessonPresences([e],t,l?.Id,Qe(l,this.settings)||void 0,{context:new rt().set(pt,{disableErrorHandling:!0})}))):this.restService.removeLessonPresences([e],t,{context:new rt().set(pt,{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=>ge(ue({},i),{newPresenceTypeId:i.presence.TypeRef.Id}))),te(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 Fe.AddUpdateAction:{let{presence:i,newPresenceTypeId:o}=t.payload,l=e.findIndex(ei(i));return l===-1?[...e,{presence:i,newPresenceTypeId:o}]:[...e.slice(0,l),{presence:e[l].presence,newPresenceTypeId:o},...e.slice(l+1)]}case Fe.RemoveUpdateAction:return e.filter(We(ei(t.payload)));default:return e}}dispatchAddUpdate(e,t){this.action$.next({type:Fe.AddUpdateAction,payload:{presence:e,newPresenceTypeId:t}})}dispatchRemoveUpdate(e){this.action$.next({type:Fe.RemoveUpdateAction,payload:e})}static{this.\u0275fac=function(t){return new(t||n)(_(ye),_(J),_(cn),_(Pe),_(W))}}static{this.\u0275prov=N({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();function ei(n){return r=>r.presence.LessonRef.Id===n.LessonRef.Id&&r.presence.StudentRef.Id===n.StudentRef.Id}var io=(n,r)=>r.id,oo=()=>[],ro=n=>({returnparams:n});function so(n,r){n&1&&K(0,"bkd-spinner")}function ao(n,r){n&1&&(a(0,"p",1),d(1),p(2,"translate"),c()),n&2&&(s(),w(m(2,1,"presence-control.no-lessons")))}function co(n,r){n&1&&(a(0,"p",1),d(1),p(2,"translate"),c()),n&2&&(s(),y(" ",m(2,1,"presence-control.no-lesson-presences")," "))}function po(n,r){if(n&1){let e=S();a(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))}),c()}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",oe(13,ro,m(4,11,i.state.queryParamsString$)))}}function lo(n,r){if(n&1&&(a(0,"div"),p(1,"async"),j(2,po,5,15,"bkd-presence-control-entry",3,io),c()),n&2){let e=f(2),t=z(4);Re("default-entries entries view-mode-",m(1,3,e.state.viewMode$),""),s(2),F(t)}}function mo(n,r){if(n&1){let e=S();a(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))}),c(),L(8,ao,3,3,"p",1)(9,co,3,3,"p",1)(10,lo,4,5,"div",2)}if(n&2){let e=f(),t=z(0),i=z(2),o=z(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 uo=["studentFullName"],ni=(()=>{class n{constructor(e,t,i,o,l,g,I){this.state=e,this.blockLessons=t,this.lessonPresencesUpdateService=i,this.presenceTypesService=o,this.modalService=l,this.scrollPosition=g,this.route=I,this.search$=new fe(""),this.entries$=M([this.state.presenceControlEntriesByGroup$,this.search$]).pipe(u(([R,Ie])=>Pn(R,uo,Ie)),B(1)),this.destroy$=new $}ngOnInit(){this.route.queryParams.pipe(Q(this.destroy$)).subscribe(this.restoreStateFromParams.bind(this))}ngAfterViewInit(){this.scrollPosition.restore()}ngOnDestroy(){this.destroy$.next()}doTogglePresenceType(e){e.forEach(t=>this.state.getNextPresenceType(t).subscribe(i=>this.lessonPresencesUpdateService.updatePresenceType(t,i?i.Id:null)))}togglePresenceType(e){this.blockLessons.getBlockLessonPresenceControlEntries(e).pipe(E(1)).subscribe(t=>{if(t.length===1){let i=t[0];this.doTogglePresenceType([i])}else{let i=this.modalService.open(zn);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(Zn);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(Ft(e.date));let t=String(e.lesson);t&&this.state.setLessonId(t),e.viewMode&&qn.includes(e.viewMode)&&this.state.setViewMode(e.viewMode)}static{this.\u0275fac=function(t){return new(t||n)(h(H),h(tt),h(nt),h(Pe),h(xe),h(wn),h(Ne))}}static{this.\u0275cmp=O({type:n,selectors:[["bkd-presence-control-list"]],standalone:!0,features:[D],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&&(U(0),p(1,"async"),U(2),p(3,"async"),U(4),p(5,"async"),a(6,"h1"),d(7),p(8,"translate"),c(),L(9,so,1,0,"bkd-spinner"),p(10,"async"),L(11,mo,11,24)),t&2){let o;ee(m(1,2,i.state.selectedLesson$)),s(2),ee(m(3,5,i.state.lessons$)),s(2),ee((o=m(5,8,i.entries$))!==null&&o!==void 0?o:Oe(15,oo)),s(3),w(m(8,11,"presence-control.title")),s(2),k(m(10,13,i.state.loading$)?9:11)}},dependencies:[Yn,Xn,Se,re,A,V],styles:["bkd-presence-control-entry[_ngcontent-%COMP%]{border-bottom:1px solid #dee2e6}.entries.view-mode-grid[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap}.entries.view-mode-grid[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{width:100%}@media (min-width: 400px){.entries.view-mode-grid[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{width:100%;border-right:1px solid #dee2e6}}@media (min-width: 800px){.entries.view-mode-grid[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{width:50%;border-right:1px solid #dee2e6}}@media (min-width: 1200px){.entries.view-mode-grid[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{width:33.3333333333%;border-right:1px solid #dee2e6}}@media (min-width: 1600px){.entries.view-mode-grid[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{width:25%;border-right:1px solid #dee2e6}}@media (min-width: 2000px){.entries.view-mode-grid[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{width:20%;border-right:1px solid #dee2e6}}@media (min-width: 2400px){.entries.view-mode-grid[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{width:16.6666666667%;border-right:1px solid #dee2e6}}[_nghost-%COMP%]{display:block;overflow:hidden;width:100%}.entries.view-mode-grid[_ngcontent-%COMP%]{width:calc(100% + 1px)}"],changeDetection:0})}}return n})();var ii=(()=>{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(H),h(nt))}}static{this.\u0275cmp=O({type:n,selectors:[["bkd-presence-control"]],standalone:!0,features:[he([H,tt,de,sn,{provide:Xt,useExisting:H}]),D],decls:1,vars:0,template:function(t,i){t&1&&K(0,"router-outlet")},dependencies:[jt],changeDetection:0})}}return n})();var ca=[{path:"",component:ii,children:[{path:"",component:ni,data:{restoreScrollPositionFrom:["/presence-control/student/:id/addresses","/presence-control/student/:id/absences","/presence-control/student/:id/grades"]}},vn,{path:"groups/:id",component:Kn}]}];export{ca as PRESENCE_CONTROL_ROUTES}; diff --git a/public/apps/webapp-schulverwaltung/chunk-24TK3FB4.js b/public/apps/webapp-schulverwaltung/chunk-HAT2K5YI.js similarity index 99% rename from public/apps/webapp-schulverwaltung/chunk-24TK3FB4.js rename to public/apps/webapp-schulverwaltung/chunk-HAT2K5YI.js index ff25439b..c0f351e2 100644 --- a/public/apps/webapp-schulverwaltung/chunk-24TK3FB4.js +++ b/public/apps/webapp-schulverwaltung/chunk-HAT2K5YI.js @@ -1 +1 @@ -import{a as Fe,b as Me,c as Ve,d as Re,e as Ne}from"./chunk-7VKKHU7R.js";import{t as N,w as Ge}from"./chunk-LLGOVPQJ.js";import{d as Le,e as Be}from"./chunk-QOR23F4L.js";import{b as ie}from"./chunk-WACRWBCS.js";import{a as je}from"./chunk-MIRGHONI.js";import{L as Pe,P as te,T as Ee,U as Oe}from"./chunk-H6G6Q6V6.js";import{a as we}from"./chunk-YD3RJIHU.js";import{b as ne}from"./chunk-KK2SHN2W.js";import{a as J,b as K,c as X,d as Z,e as ee}from"./chunk-AP373D4K.js";import{a as $e}from"./chunk-B6WYZ7BT.js";import{Ab as T,Bb as ce,Cb as de,Gb as d,Ha as c,Hb as m,Ib as ge,Id as Te,Jd as R,Kd as G,L as _e,M as be,Ma as p,Na as he,O as ae,P as j,R as W,Ra as _,Sa as ve,Ua as H,Va as q,Wa as r,X as Y,Xa as a,Ya as b,Yc as Ie,Zb as E,_ as B,_b as ye,a as F,aa as k,ab as V,b as M,cb as $,db as l,eb as Ce,f as Q,fb as xe,g as le,h as re,ia as D,ja as I,k as me,l as ue,mb as h,n as L,nb as u,o as fe,ob as U,pb as f,rc as Se,sc as Ae,uc as ke,vc as De,wa as i,wb as g,xa as x,xb as y,yb as v,zb as z}from"./chunk-IFJN5CDK.js";var se=(()=>{class e{constructor(t,n,s,C,w){this.settings=t,this.lessonPresencesService=n,this.presenceTypesService=s,this.toastService=C,this.translate=w,this.studentId$=new re(1),this.checkableAbsences$=this.getAbsences(this.loadCheckableAbsences.bind(this)),this.openAbsences$=this.getAbsences(this.loadOpenAbsences.bind(this)),this.excusedAbsences$=this.getAbsences(this.loadExcusedAbsences.bind(this)),this.unexcusedAbsences$=this.getAbsences(this.loadUnexcusedAbsences.bind(this)),this.incidents$=this.getAbsences(this.loadIncidents.bind(this)),this.halfDays$=this.getAbsences(this.loadHalfDays.bind(this)),this.counts$=this.getCounts()}setStudentId(t){this.studentId$.next(t)}getAbsences(t){return this.studentId$.pipe(j(t),ae(null),_e({connector:()=>new re(1)}))}getCounts(){return this.studentId$.pipe(j(t=>fe([this.loadStatistics(t).pipe(ae(null)),this.openAbsences$.pipe(L(n=>n?.length??null)),this.checkableAbsences$.pipe(L(n=>n?.length??null))])),L(([t,n,s])=>({openAbsences:n,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(j(({entries:n})=>n.length>0?ue(n[0]):(this.toastService.error(this.translate.instant("global.rest-errors.notfound-message"),this.translate.instant("global.rest-errors.notfound-title")),me)))}loadOpenAbsences(t){return this.lessonPresencesService.getListOfUnconfirmed(this.getBaseParams(t))}loadCheckableAbsences(t){return this.lessonPresencesService.getList({params:M(F({},this.getBaseParams(t)),{"filter.ConfirmationStateId":`=${this.settings.checkableAbsenceStateId}`})})}loadExcusedAbsences(t){return this.lessonPresencesService.getList({params:M(F({},this.getBaseParams(t)),{"filter.ConfirmationStateId":`=${this.settings.excusedAbsenceStateId}`})})}loadUnexcusedAbsences(t){return this.lessonPresencesService.getList({params:M(F({},this.getBaseParams(t)),{"filter.ConfirmationStateId":`=${this.settings.unexcusedAbsenceStateId}`})})}loadIncidents(t){return this.presenceTypesService.incidentTypes$.pipe(L(n=>M(F({},this.getBaseParams(t)),{"filter.TypeRef":`;${n.map(s=>s.Id).join(";")}`})),j(n=>this.lessonPresencesService.getList({params:n})))}loadHalfDays(t){return this.lessonPresencesService.getList({params:M(F({},this.getBaseParams(t)),{"filter.TypeRef":`=${this.settings.halfDayPresenceTypeId}`})})}getBaseParams(t){return{sort:"LessonDateTimeFrom.asc","filter.StudentRef":`=${t}`}}static{this.\u0275fac=function(n){return new(n||e)(B(Ie),B(Be),B(te),B($e),B(Te))}}static{this.\u0275prov=Y({token:e,factory:e.\u0275fac})}}return e})();var P=(()=>{class e{constructor(t,n){this.profileService=t,this.route=n,this.currentDossier$=new le("addresses"),this.studentId$=this.route.paramMap.pipe(L(s=>Number(s.get("id")))),this.profile$=this.studentId$.pipe(j(s=>this.profileService.getProfile(s)),be(1)),this.returnParams$=this.route.queryParams.pipe(L(({returnparams:s})=>s)),this.backlinkQueryParams$=this.returnParams$.pipe(L(je)),this.loading$=this.profileService.loading$}static{this.\u0275fac=function(n){return new(n||e)(B(Fe),B(Se))}}static{this.\u0275prov=Y({token:e,factory:e.\u0275fac})}}return e})();function Xe(e,o){if(e&1&&u(0),e&2){l();let t=v(0);f(" (",t==null?null:t.checkableAbsences,") ")}}function Ze(e,o){if(e&1&&b(0,"bkd-student-dossier-absences",13),e&2){let t=l();p("absences$",t.absencesService.checkableAbsences$)}}function et(e,o){if(e&1&&u(0),e&2){l();let t=v(0);f(" (",t==null?null:t.openAbsences,") ")}}function tt(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 nt(e,o){if(e&1&&u(0),e&2){l();let t=v(0);f(" (",t==null?null:t.excusedAbsences,") ")}}function it(e,o){if(e&1&&b(0,"bkd-student-dossier-absences",13),e&2){let t=l();p("absences$",t.absencesService.excusedAbsences$)}}function st(e,o){if(e&1&&u(0),e&2){l();let t=v(0);f(" (",t==null?null:t.unexcusedAbsences,") ")}}function ot(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 rt(e,o){if(e&1&&u(0),e&2){l();let t=v(0);f(" (",t==null?null:t.incidents,") ")}}function at(e,o){if(e&1&&b(0,"bkd-student-dossier-absences",13),e&2){let t=l();p("absences$",t.absencesService.incidents$)}}function ct(e,o){if(e&1&&u(0),e&2){l(2);let t=v(0);f(" (",t==null?null:t.halfDays,") ")}}function dt(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 pt(e,o){if(e&1){let t=V();r(0,"div",12,5)(2,"div",8)(3,"bkd-student-dossier-entry-header",9),$("click",function(){D(t);let s=h(1);return I(s.toggle())}),u(4),d(5,"translate"),c(6,ct,1,1),a()(),r(7,"div",10)(8,"div",11),c(9,dt,1,2,"ng-template"),a()()()}if(e&2){let t=h(1);l();let n=v(0);i(3),p("opened",!t.collapsed),i(),f(" ",m(5,3,"shared.profile.half-days")," "),i(2),_((n==null?null:n.halfDays)!==null?6:-1)}}var He=(()=>{class e{constructor(t,n,s,C){this.state=t,this.presenceTypesService=n,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(W(this.destroy$)).subscribe(t=>this.absencesService.setStudentId(t))}ngOnDestroy(){this.destroy$.next()}static{this.\u0275fac=function(n){return new(n||e)(x(P),x(te),x(se),x(Pe))}}static{this.\u0275cmp=k({type:e,selectors:[["bkd-dossier-absences"]],standalone:!0,features:[z([se]),T],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(n,s){if(n&1){let C=V();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(){D(C);let S=h(4);return I(S.toggle())}),u(7),d(8,"translate"),c(9,Xe,1,1),a()(),r(10,"div",10)(11,"div",11),c(12,Ze,1,1,"ng-template"),a()()(),r(13,"div",7,1)(15,"div",8)(16,"bkd-student-dossier-entry-header",9),$("click",function(){D(C);let S=h(14);return I(S.toggle())}),u(17),d(18,"translate"),c(19,et,1,1),a()(),r(20,"div",10)(21,"div",11),c(22,tt,1,2,"ng-template"),a()()(),r(23,"div",7,2)(25,"div",8)(26,"bkd-student-dossier-entry-header",9),$("click",function(){D(C);let S=h(24);return I(S.toggle())}),u(27),d(28,"translate"),c(29,nt,1,1),a()(),r(30,"div",10)(31,"div",11),c(32,it,1,1,"ng-template"),a()()(),r(33,"div",7,3)(35,"div",8)(36,"bkd-student-dossier-entry-header",9),$("click",function(){D(C);let S=h(34);return I(S.toggle())}),u(37),d(38,"translate"),c(39,st,1,1),a()(),r(40,"div",10)(41,"div",11),c(42,ot,1,2,"ng-template"),a()()(),r(43,"div",7,4)(45,"div",8)(46,"bkd-student-dossier-entry-header",9),$("click",function(){D(C);let S=h(44);return I(S.toggle())}),u(47),d(48,"translate"),c(49,rt,1,1),a()(),r(50,"div",10)(51,"div",11),c(52,at,1,1,"ng-template"),a()()(),c(53,pt,10,5,"div",12),d(54,"async"),a()}if(n&2){let C=h(4),w=h(14),S=h(24),Ye=h(34),ze=h(44),A=y(m(1,16,s.absencesService.counts$));i(6),p("opened",!C.collapsed),i(),f(" ",m(8,19,"shared.profile.checkable-absences")," "),i(2),_((A==null?null:A.checkableAbsences)!==null?9:-1),i(7),p("opened",!w.collapsed),i(),f(" ",m(18,21,"shared.profile.open-absences")," "),i(2),_((A==null?null:A.openAbsences)!==null?19:-1),i(7),p("opened",!S.collapsed),i(),f(" ",m(28,23,"shared.profile.excused-absences")," "),i(2),_((A==null?null:A.excusedAbsences)!==null?29:-1),i(7),p("opened",!Ye.collapsed),i(),f(" ",m(38,25,"shared.profile.unexcused-absences")," "),i(2),_((A==null?null:A.unexcusedAbsences)!==null?39:-1),i(7),p("opened",!ze.collapsed),i(),f(" ",m(48,27,"shared.profile.incidents")," "),i(2),_((A==null?null:A.incidents)!==null?49:-1),i(4),_(m(54,29,s.halfDayActive$)?53:-1)}},dependencies:[ee,Z,X,ie,K,J,Ee,E,G,R],changeDetection:0})}}return e})();var lt=(e,o)=>o.apprenticeshipContract.Id,mt=(e,o)=>o.Id;function ut(e,o){if(e&1&&b(0,"bkd-student-dossier-legal-representative",9),e&2){let t=o.$implicit;p("person",t)}}function ft(e,o){if(e&1&&H(0,ut,1,1,"bkd-student-dossier-legal-representative",9,mt),e&2){l(3);let t=v(0);q(t.legalRepresentativePersons)}}function _t(e,o){if(e&1){let t=V();r(0,"div",4,0)(2,"div",5)(3,"bkd-student-dossier-entry-header",6),$("click",function(){D(t);let s=h(1);return I(s.toggle())}),u(4),d(5,"translate"),a()(),r(6,"div",7)(7,"div",8),c(8,ft,2,0,"ng-template"),a()()()}if(e&2){let t=h(1);i(3),p("opened",!t.collapsed),i(),f(" ",m(5,2,"shared.profile.legal-representation")," ")}}function bt(e,o){if(e&1&&u(0),e&2){let t=l().$index;f(" ",t+1," ")}}function ht(e,o){if(e&1&&b(0,"bkd-student-dossier-apprenticeship-company",10),e&2){let t=l().$implicit;p("company",t)}}function vt(e,o){if(e&1){let t=V();r(0,"div",4,1)(2,"div",5)(3,"bkd-student-dossier-entry-header",6),$("click",function(){D(t);let s=h(1);return I(s.toggle())}),u(4),d(5,"translate"),c(6,bt,1,1),a()(),r(7,"div",7)(8,"div",8),c(9,ht,1,1,"ng-template"),a()()()}if(e&2){let t=h(1);l(2);let n=v(0);i(3),p("opened",!t.collapsed),i(),f(" ",m(5,3,"shared.profile.apprenticeship-company")," "),i(2),_(n.apprenticeshipCompanies.length>1?6:-1)}}function Ct(e,o){if(e&1&&(b(0,"bkd-student-dossier-address",2),r(1,"div",3),c(2,_t,9,4,"div",4),H(3,vt,10,5,"div",4,lt),a()),e&2){l();let t=v(0);p("student",t.student),i(2),_(t.legalRepresentativePersons.length>0?2:-1),i(),q(t.apprenticeshipCompanies)}}var qe=(()=>{class e{constructor(t){this.state=t,this.state.currentDossier$.next("addresses")}static{this.\u0275fac=function(n){return new(n||e)(x(P))}}static{this.\u0275cmp=k({type:e,selectors:[["bkd-dossier-addresses"]],standalone:!0,features:[T],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(n,s){if(n&1&&(g(0),d(1,"async"),c(2,Ct,5,2)),n&2){let C=y(m(1,1,s.state.profile$));i(2),_(C?2:-1)}},dependencies:[Me,ee,Z,X,ie,K,J,Re,Ve,E,G,R],styles:[".profile-entry[_ngcontent-%COMP%]{display:block;padding:0 1rem}"],changeDetection:0})}}return e})();function gt(e,o){e&1&&b(0,"bkd-spinner")}function yt(e,o){if(e&1&&b(0,"bkd-dossier-grades-view",0),e&2){l();let t=v(0),n=v(2),s=v(4);p("courses",t)("studentId",n)("gradingScales",s)}}var Ue=(()=>{class e{constructor(t,n){this.state=t,this.dossierGradesService=n,this.destroy$=new Q}ngOnInit(){this.state.currentDossier$.next("grades"),this.state.studentId$.pipe(W(this.destroy$)).subscribe(t=>this.dossierGradesService.setStudentId(t))}ngOnDestroy(){this.destroy$.next()}static{this.\u0275fac=function(n){return new(n||e)(x(P),x(N))}}static{this.\u0275cmp=k({type:e,selectors:[["bkd-dossier-grades"]],standalone:!0,features:[T],decls:9,vars:12,consts:[[3,"courses","studentId","gradingScales"]],template:function(n,s){n&1&&(g(0),d(1,"async"),g(2),d(3,"async"),g(4),d(5,"async"),c(6,gt,1,0,"bkd-spinner"),d(7,"async"),c(8,yt,1,3,"bkd-dossier-grades-view",0)),n&2&&(y(m(1,1,s.dossierGradesService.studentCourses$)),i(2),y(m(3,4,s.state.studentId$)),i(2),y(m(5,7,s.dossierGradesService.gradingScales$)),i(2),_(m(7,10,s.dossierGradesService.loading$)?6:8))},dependencies:[Ge,ne,E]})}}return e})();var St=["*"];function At(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();i(2),U(ge(3,2,t.student.Birthdate,"dd.MM.yyyy")),i(3),f("(",t.student.Gender,")")}}var Qe=(()=>{class e{constructor(){this.link="/"}static{this.\u0275fac=function(n){return new(n||e)}}static{this.\u0275cmp=k({type:e,selectors:[["bkd-student-backlink"]],inputs:{link:"link",queryParams:"queryParams",studentId:"studentId",studentName:"studentName",student:"student"},standalone:!0,features:[T],ngContentSelectors:St,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(n,s){n&1&&(Ce(),r(0,"div",0)(1,"bkd-backlink",1),xe(2),a(),r(3,"div",2),b(4,"bkd-avatar",3),r(5,"div",4)(6,"h1"),u(7),a(),c(8,At,6,5,"div",5),a()()()),n&2&&(i(),p("link",s.link)("params",s.queryParams),i(3),p("studentId",s.studentId),i(3),U(s.student?s.student.FullName:s.studentName),i(),_(s.student?8:-1))},dependencies:[Oe,Ne,ye],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 kt=()=>["addresses","absences","grades"],Dt=()=>[],It=e=>({returnparams:e}),$t=e=>[e];function Tt(e,o){e&1&&b(0,"bkd-spinner")}function Pt(e,o){if(e&1&&b(0,"bkd-reports-link",3),e&2){let t;l(2);let n=v(4);p("reports",(t=n)!==null&&t!==void 0?t:ce(1,Dt))}}function Lt(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,n=h(3),s=l(2);p("queryParams",de(9,It,m(1,5,s.state.returnParams$)))("routerLink",de(11,$t,t)),i(2),he("btn-outline-secondary",!n.isActive),i(2),f(" ",m(5,7,"dossier."+t)," ")}}function Bt(e,o){e&1&&(r(0,"div"),b(1,"router-outlet"),a())}function wt(e,o){e&1&&(r(0,"p"),u(1),d(2,"translate"),a()),e&2&&(i(),U(m(2,1,"shared.profile.no-profile")))}function Et(e,o){if(e&1&&(r(0,"bkd-student-backlink",2),d(1,"async"),d(2,"async"),c(3,Pt,1,2,"bkd-reports-link",3),a(),r(4,"div",4),H(5,Lt,6,13,"a",5,ve),a(),c(7,Bt,2,0,"div")(8,wt,3,3,"p")),e&2){let t=l(),n=v(0),s=v(2);p("link","../..")("queryParams",m(1,6,t.state.backlinkQueryParams$))("studentId",m(2,8,t.state.studentId$))("student",n&&n.student),i(3),_(s==="grades"?3:-1),i(2),q(ce(10,kt)),i(2),_(n?7:8)}}var We=(()=>{class e{constructor(t,n){this.state=t,this.dossierGradesService=n,this.state.currentDossier$.next("addresses")}static{this.\u0275fac=function(n){return new(n||e)(x(P),x(N))}}static{this.\u0275cmp=k({type:e,selectors:[["bkd-student-dossier"]],standalone:!0,features:[z([P,N]),T],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(n,s){n&1&&(g(0),d(1,"async"),g(2),d(3,"async"),g(4),d(5,"async"),r(6,"div",1),c(7,Tt,1,0,"bkd-spinner"),d(8,"async"),c(9,Et,9,11),a()),n&2&&(y(m(1,1,s.state.profile$)),i(2),y(m(3,4,s.state.currentDossier$)),i(2),y(m(5,7,s.dossierGradesService.testReports$)),i(3),_(m(8,10,s.state.loading$)?7:9))},dependencies:[Qe,we,ke,De,Ae,ne,E,G,R],changeDetection:0})}}return e})();var En={path:"student/:id",children:[{path:"",component:We,children:[{path:"addresses",component:qe},{path:"absences",component:He},{path:"grades",component:Ue}]},{path:"absences/confirm",component:Le}]};export{En as a}; +import{a as Fe,b as Me,c as Ve,d as Re,e as Ne}from"./chunk-4YGUAC2V.js";import{t as N,w as Ge}from"./chunk-LLGOVPQJ.js";import{d as Le,e as Be}from"./chunk-QOR23F4L.js";import{b as ie}from"./chunk-WACRWBCS.js";import{a as je}from"./chunk-MIRGHONI.js";import{L as Pe,P as te,T as Ee,U as Oe}from"./chunk-H6G6Q6V6.js";import{a as we}from"./chunk-YD3RJIHU.js";import{b as ne}from"./chunk-KK2SHN2W.js";import{a as J,b as K,c as X,d as Z,e as ee}from"./chunk-AP373D4K.js";import{a as $e}from"./chunk-B6WYZ7BT.js";import{Ab as T,Bb as ce,Cb as de,Gb as d,Ha as c,Hb as m,Ib as ge,Id as Te,Jd as R,Kd as G,L as _e,M as be,Ma as p,Na as he,O as ae,P as j,R as W,Ra as _,Sa as ve,Ua as H,Va as q,Wa as r,X as Y,Xa as a,Ya as b,Yc as Ie,Zb as E,_ as B,_b as ye,a as F,aa as k,ab as V,b as M,cb as $,db as l,eb as Ce,f as Q,fb as xe,g as le,h as re,ia as D,ja as I,k as me,l as ue,mb as h,n as L,nb as u,o as fe,ob as U,pb as f,rc as Se,sc as Ae,uc as ke,vc as De,wa as i,wb as g,xa as x,xb as y,yb as v,zb as z}from"./chunk-IFJN5CDK.js";var se=(()=>{class e{constructor(t,n,s,C,w){this.settings=t,this.lessonPresencesService=n,this.presenceTypesService=s,this.toastService=C,this.translate=w,this.studentId$=new re(1),this.checkableAbsences$=this.getAbsences(this.loadCheckableAbsences.bind(this)),this.openAbsences$=this.getAbsences(this.loadOpenAbsences.bind(this)),this.excusedAbsences$=this.getAbsences(this.loadExcusedAbsences.bind(this)),this.unexcusedAbsences$=this.getAbsences(this.loadUnexcusedAbsences.bind(this)),this.incidents$=this.getAbsences(this.loadIncidents.bind(this)),this.halfDays$=this.getAbsences(this.loadHalfDays.bind(this)),this.counts$=this.getCounts()}setStudentId(t){this.studentId$.next(t)}getAbsences(t){return this.studentId$.pipe(j(t),ae(null),_e({connector:()=>new re(1)}))}getCounts(){return this.studentId$.pipe(j(t=>fe([this.loadStatistics(t).pipe(ae(null)),this.openAbsences$.pipe(L(n=>n?.length??null)),this.checkableAbsences$.pipe(L(n=>n?.length??null))])),L(([t,n,s])=>({openAbsences:n,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(j(({entries:n})=>n.length>0?ue(n[0]):(this.toastService.error(this.translate.instant("global.rest-errors.notfound-message"),this.translate.instant("global.rest-errors.notfound-title")),me)))}loadOpenAbsences(t){return this.lessonPresencesService.getListOfUnconfirmed(this.getBaseParams(t))}loadCheckableAbsences(t){return this.lessonPresencesService.getList({params:M(F({},this.getBaseParams(t)),{"filter.ConfirmationStateId":`=${this.settings.checkableAbsenceStateId}`})})}loadExcusedAbsences(t){return this.lessonPresencesService.getList({params:M(F({},this.getBaseParams(t)),{"filter.ConfirmationStateId":`=${this.settings.excusedAbsenceStateId}`})})}loadUnexcusedAbsences(t){return this.lessonPresencesService.getList({params:M(F({},this.getBaseParams(t)),{"filter.ConfirmationStateId":`=${this.settings.unexcusedAbsenceStateId}`})})}loadIncidents(t){return this.presenceTypesService.incidentTypes$.pipe(L(n=>M(F({},this.getBaseParams(t)),{"filter.TypeRef":`;${n.map(s=>s.Id).join(";")}`})),j(n=>this.lessonPresencesService.getList({params:n})))}loadHalfDays(t){return this.lessonPresencesService.getList({params:M(F({},this.getBaseParams(t)),{"filter.TypeRef":`=${this.settings.halfDayPresenceTypeId}`})})}getBaseParams(t){return{sort:"LessonDateTimeFrom.asc","filter.StudentRef":`=${t}`}}static{this.\u0275fac=function(n){return new(n||e)(B(Ie),B(Be),B(te),B($e),B(Te))}}static{this.\u0275prov=Y({token:e,factory:e.\u0275fac})}}return e})();var P=(()=>{class e{constructor(t,n){this.profileService=t,this.route=n,this.currentDossier$=new le("addresses"),this.studentId$=this.route.paramMap.pipe(L(s=>Number(s.get("id")))),this.profile$=this.studentId$.pipe(j(s=>this.profileService.getProfile(s)),be(1)),this.returnParams$=this.route.queryParams.pipe(L(({returnparams:s})=>s)),this.backlinkQueryParams$=this.returnParams$.pipe(L(je)),this.loading$=this.profileService.loading$}static{this.\u0275fac=function(n){return new(n||e)(B(Fe),B(Se))}}static{this.\u0275prov=Y({token:e,factory:e.\u0275fac})}}return e})();function Xe(e,o){if(e&1&&u(0),e&2){l();let t=v(0);f(" (",t==null?null:t.checkableAbsences,") ")}}function Ze(e,o){if(e&1&&b(0,"bkd-student-dossier-absences",13),e&2){let t=l();p("absences$",t.absencesService.checkableAbsences$)}}function et(e,o){if(e&1&&u(0),e&2){l();let t=v(0);f(" (",t==null?null:t.openAbsences,") ")}}function tt(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 nt(e,o){if(e&1&&u(0),e&2){l();let t=v(0);f(" (",t==null?null:t.excusedAbsences,") ")}}function it(e,o){if(e&1&&b(0,"bkd-student-dossier-absences",13),e&2){let t=l();p("absences$",t.absencesService.excusedAbsences$)}}function st(e,o){if(e&1&&u(0),e&2){l();let t=v(0);f(" (",t==null?null:t.unexcusedAbsences,") ")}}function ot(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 rt(e,o){if(e&1&&u(0),e&2){l();let t=v(0);f(" (",t==null?null:t.incidents,") ")}}function at(e,o){if(e&1&&b(0,"bkd-student-dossier-absences",13),e&2){let t=l();p("absences$",t.absencesService.incidents$)}}function ct(e,o){if(e&1&&u(0),e&2){l(2);let t=v(0);f(" (",t==null?null:t.halfDays,") ")}}function dt(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 pt(e,o){if(e&1){let t=V();r(0,"div",12,5)(2,"div",8)(3,"bkd-student-dossier-entry-header",9),$("click",function(){D(t);let s=h(1);return I(s.toggle())}),u(4),d(5,"translate"),c(6,ct,1,1),a()(),r(7,"div",10)(8,"div",11),c(9,dt,1,2,"ng-template"),a()()()}if(e&2){let t=h(1);l();let n=v(0);i(3),p("opened",!t.collapsed),i(),f(" ",m(5,3,"shared.profile.half-days")," "),i(2),_((n==null?null:n.halfDays)!==null?6:-1)}}var He=(()=>{class e{constructor(t,n,s,C){this.state=t,this.presenceTypesService=n,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(W(this.destroy$)).subscribe(t=>this.absencesService.setStudentId(t))}ngOnDestroy(){this.destroy$.next()}static{this.\u0275fac=function(n){return new(n||e)(x(P),x(te),x(se),x(Pe))}}static{this.\u0275cmp=k({type:e,selectors:[["bkd-dossier-absences"]],standalone:!0,features:[z([se]),T],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(n,s){if(n&1){let C=V();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(){D(C);let S=h(4);return I(S.toggle())}),u(7),d(8,"translate"),c(9,Xe,1,1),a()(),r(10,"div",10)(11,"div",11),c(12,Ze,1,1,"ng-template"),a()()(),r(13,"div",7,1)(15,"div",8)(16,"bkd-student-dossier-entry-header",9),$("click",function(){D(C);let S=h(14);return I(S.toggle())}),u(17),d(18,"translate"),c(19,et,1,1),a()(),r(20,"div",10)(21,"div",11),c(22,tt,1,2,"ng-template"),a()()(),r(23,"div",7,2)(25,"div",8)(26,"bkd-student-dossier-entry-header",9),$("click",function(){D(C);let S=h(24);return I(S.toggle())}),u(27),d(28,"translate"),c(29,nt,1,1),a()(),r(30,"div",10)(31,"div",11),c(32,it,1,1,"ng-template"),a()()(),r(33,"div",7,3)(35,"div",8)(36,"bkd-student-dossier-entry-header",9),$("click",function(){D(C);let S=h(34);return I(S.toggle())}),u(37),d(38,"translate"),c(39,st,1,1),a()(),r(40,"div",10)(41,"div",11),c(42,ot,1,2,"ng-template"),a()()(),r(43,"div",7,4)(45,"div",8)(46,"bkd-student-dossier-entry-header",9),$("click",function(){D(C);let S=h(44);return I(S.toggle())}),u(47),d(48,"translate"),c(49,rt,1,1),a()(),r(50,"div",10)(51,"div",11),c(52,at,1,1,"ng-template"),a()()(),c(53,pt,10,5,"div",12),d(54,"async"),a()}if(n&2){let C=h(4),w=h(14),S=h(24),Ye=h(34),ze=h(44),A=y(m(1,16,s.absencesService.counts$));i(6),p("opened",!C.collapsed),i(),f(" ",m(8,19,"shared.profile.checkable-absences")," "),i(2),_((A==null?null:A.checkableAbsences)!==null?9:-1),i(7),p("opened",!w.collapsed),i(),f(" ",m(18,21,"shared.profile.open-absences")," "),i(2),_((A==null?null:A.openAbsences)!==null?19:-1),i(7),p("opened",!S.collapsed),i(),f(" ",m(28,23,"shared.profile.excused-absences")," "),i(2),_((A==null?null:A.excusedAbsences)!==null?29:-1),i(7),p("opened",!Ye.collapsed),i(),f(" ",m(38,25,"shared.profile.unexcused-absences")," "),i(2),_((A==null?null:A.unexcusedAbsences)!==null?39:-1),i(7),p("opened",!ze.collapsed),i(),f(" ",m(48,27,"shared.profile.incidents")," "),i(2),_((A==null?null:A.incidents)!==null?49:-1),i(4),_(m(54,29,s.halfDayActive$)?53:-1)}},dependencies:[ee,Z,X,ie,K,J,Ee,E,G,R],changeDetection:0})}}return e})();var lt=(e,o)=>o.apprenticeshipContract.Id,mt=(e,o)=>o.Id;function ut(e,o){if(e&1&&b(0,"bkd-student-dossier-legal-representative",9),e&2){let t=o.$implicit;p("person",t)}}function ft(e,o){if(e&1&&H(0,ut,1,1,"bkd-student-dossier-legal-representative",9,mt),e&2){l(3);let t=v(0);q(t.legalRepresentativePersons)}}function _t(e,o){if(e&1){let t=V();r(0,"div",4,0)(2,"div",5)(3,"bkd-student-dossier-entry-header",6),$("click",function(){D(t);let s=h(1);return I(s.toggle())}),u(4),d(5,"translate"),a()(),r(6,"div",7)(7,"div",8),c(8,ft,2,0,"ng-template"),a()()()}if(e&2){let t=h(1);i(3),p("opened",!t.collapsed),i(),f(" ",m(5,2,"shared.profile.legal-representation")," ")}}function bt(e,o){if(e&1&&u(0),e&2){let t=l().$index;f(" ",t+1," ")}}function ht(e,o){if(e&1&&b(0,"bkd-student-dossier-apprenticeship-company",10),e&2){let t=l().$implicit;p("company",t)}}function vt(e,o){if(e&1){let t=V();r(0,"div",4,1)(2,"div",5)(3,"bkd-student-dossier-entry-header",6),$("click",function(){D(t);let s=h(1);return I(s.toggle())}),u(4),d(5,"translate"),c(6,bt,1,1),a()(),r(7,"div",7)(8,"div",8),c(9,ht,1,1,"ng-template"),a()()()}if(e&2){let t=h(1);l(2);let n=v(0);i(3),p("opened",!t.collapsed),i(),f(" ",m(5,3,"shared.profile.apprenticeship-company")," "),i(2),_(n.apprenticeshipCompanies.length>1?6:-1)}}function Ct(e,o){if(e&1&&(b(0,"bkd-student-dossier-address",2),r(1,"div",3),c(2,_t,9,4,"div",4),H(3,vt,10,5,"div",4,lt),a()),e&2){l();let t=v(0);p("student",t.student),i(2),_(t.legalRepresentativePersons.length>0?2:-1),i(),q(t.apprenticeshipCompanies)}}var qe=(()=>{class e{constructor(t){this.state=t,this.state.currentDossier$.next("addresses")}static{this.\u0275fac=function(n){return new(n||e)(x(P))}}static{this.\u0275cmp=k({type:e,selectors:[["bkd-dossier-addresses"]],standalone:!0,features:[T],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(n,s){if(n&1&&(g(0),d(1,"async"),c(2,Ct,5,2)),n&2){let C=y(m(1,1,s.state.profile$));i(2),_(C?2:-1)}},dependencies:[Me,ee,Z,X,ie,K,J,Re,Ve,E,G,R],styles:[".profile-entry[_ngcontent-%COMP%]{display:block;padding:0 1rem}"],changeDetection:0})}}return e})();function gt(e,o){e&1&&b(0,"bkd-spinner")}function yt(e,o){if(e&1&&b(0,"bkd-dossier-grades-view",0),e&2){l();let t=v(0),n=v(2),s=v(4);p("courses",t)("studentId",n)("gradingScales",s)}}var Ue=(()=>{class e{constructor(t,n){this.state=t,this.dossierGradesService=n,this.destroy$=new Q}ngOnInit(){this.state.currentDossier$.next("grades"),this.state.studentId$.pipe(W(this.destroy$)).subscribe(t=>this.dossierGradesService.setStudentId(t))}ngOnDestroy(){this.destroy$.next()}static{this.\u0275fac=function(n){return new(n||e)(x(P),x(N))}}static{this.\u0275cmp=k({type:e,selectors:[["bkd-dossier-grades"]],standalone:!0,features:[T],decls:9,vars:12,consts:[[3,"courses","studentId","gradingScales"]],template:function(n,s){n&1&&(g(0),d(1,"async"),g(2),d(3,"async"),g(4),d(5,"async"),c(6,gt,1,0,"bkd-spinner"),d(7,"async"),c(8,yt,1,3,"bkd-dossier-grades-view",0)),n&2&&(y(m(1,1,s.dossierGradesService.studentCourses$)),i(2),y(m(3,4,s.state.studentId$)),i(2),y(m(5,7,s.dossierGradesService.gradingScales$)),i(2),_(m(7,10,s.dossierGradesService.loading$)?6:8))},dependencies:[Ge,ne,E]})}}return e})();var St=["*"];function At(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();i(2),U(ge(3,2,t.student.Birthdate,"dd.MM.yyyy")),i(3),f("(",t.student.Gender,")")}}var Qe=(()=>{class e{constructor(){this.link="/"}static{this.\u0275fac=function(n){return new(n||e)}}static{this.\u0275cmp=k({type:e,selectors:[["bkd-student-backlink"]],inputs:{link:"link",queryParams:"queryParams",studentId:"studentId",studentName:"studentName",student:"student"},standalone:!0,features:[T],ngContentSelectors:St,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(n,s){n&1&&(Ce(),r(0,"div",0)(1,"bkd-backlink",1),xe(2),a(),r(3,"div",2),b(4,"bkd-avatar",3),r(5,"div",4)(6,"h1"),u(7),a(),c(8,At,6,5,"div",5),a()()()),n&2&&(i(),p("link",s.link)("params",s.queryParams),i(3),p("studentId",s.studentId),i(3),U(s.student?s.student.FullName:s.studentName),i(),_(s.student?8:-1))},dependencies:[Oe,Ne,ye],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 kt=()=>["addresses","absences","grades"],Dt=()=>[],It=e=>({returnparams:e}),$t=e=>[e];function Tt(e,o){e&1&&b(0,"bkd-spinner")}function Pt(e,o){if(e&1&&b(0,"bkd-reports-link",3),e&2){let t;l(2);let n=v(4);p("reports",(t=n)!==null&&t!==void 0?t:ce(1,Dt))}}function Lt(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,n=h(3),s=l(2);p("queryParams",de(9,It,m(1,5,s.state.returnParams$)))("routerLink",de(11,$t,t)),i(2),he("btn-outline-secondary",!n.isActive),i(2),f(" ",m(5,7,"dossier."+t)," ")}}function Bt(e,o){e&1&&(r(0,"div"),b(1,"router-outlet"),a())}function wt(e,o){e&1&&(r(0,"p"),u(1),d(2,"translate"),a()),e&2&&(i(),U(m(2,1,"shared.profile.no-profile")))}function Et(e,o){if(e&1&&(r(0,"bkd-student-backlink",2),d(1,"async"),d(2,"async"),c(3,Pt,1,2,"bkd-reports-link",3),a(),r(4,"div",4),H(5,Lt,6,13,"a",5,ve),a(),c(7,Bt,2,0,"div")(8,wt,3,3,"p")),e&2){let t=l(),n=v(0),s=v(2);p("link","../..")("queryParams",m(1,6,t.state.backlinkQueryParams$))("studentId",m(2,8,t.state.studentId$))("student",n&&n.student),i(3),_(s==="grades"?3:-1),i(2),q(ce(10,kt)),i(2),_(n?7:8)}}var We=(()=>{class e{constructor(t,n){this.state=t,this.dossierGradesService=n,this.state.currentDossier$.next("addresses")}static{this.\u0275fac=function(n){return new(n||e)(x(P),x(N))}}static{this.\u0275cmp=k({type:e,selectors:[["bkd-student-dossier"]],standalone:!0,features:[z([P,N]),T],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(n,s){n&1&&(g(0),d(1,"async"),g(2),d(3,"async"),g(4),d(5,"async"),r(6,"div",1),c(7,Tt,1,0,"bkd-spinner"),d(8,"async"),c(9,Et,9,11),a()),n&2&&(y(m(1,1,s.state.profile$)),i(2),y(m(3,4,s.state.currentDossier$)),i(2),y(m(5,7,s.dossierGradesService.testReports$)),i(3),_(m(8,10,s.state.loading$)?7:9))},dependencies:[Qe,we,ke,De,Ae,ne,E,G,R],changeDetection:0})}}return e})();var En={path:"student/:id",children:[{path:"",component:We,children:[{path:"addresses",component:qe},{path:"absences",component:He},{path:"grades",component:Ue}]},{path:"absences/confirm",component:Le}]};export{En as a}; diff --git a/public/apps/webapp-schulverwaltung/chunk-H5OLZFFB.js b/public/apps/webapp-schulverwaltung/chunk-KZHJ5VQS.js similarity index 98% rename from public/apps/webapp-schulverwaltung/chunk-H5OLZFFB.js rename to public/apps/webapp-schulverwaltung/chunk-KZHJ5VQS.js index e32ff819..7ba62987 100644 --- a/public/apps/webapp-schulverwaltung/chunk-H5OLZFFB.js +++ b/public/apps/webapp-schulverwaltung/chunk-KZHJ5VQS.js @@ -1 +1 @@ -import{a as ye,b as ge,c as Ee}from"./chunk-ZATT6MZM.js";import{a as fe}from"./chunk-DYBK5FKC.js";import{a as xe}from"./chunk-GKHN5TVX.js";import{a as ve}from"./chunk-24TK3FB4.js";import"./chunk-7VKKHU7R.js";import"./chunk-LLGOVPQJ.js";import"./chunk-2H6IFZM2.js";import{b as se,e as N}from"./chunk-QOR23F4L.js";import"./chunk-7FRZV7VF.js";import"./chunk-Y4QYVF5K.js";import"./chunk-OFB4XAK2.js";import{a as be,b as he}from"./chunk-RET26MIW.js";import{a as Ce}from"./chunk-UA2MEY3S.js";import{a as Se}from"./chunk-2U5ENDJH.js";import{d as me}from"./chunk-VUPOI3TG.js";import{d as _e}from"./chunk-WACRWBCS.js";import"./chunk-MIRGHONI.js";import"./chunk-YUHFF3NM.js";import{L as le,P as ce}from"./chunk-H6G6Q6V6.js";import"./chunk-NL5E3FC5.js";import{a as de,b as ue}from"./chunk-YD3RJIHU.js";import{b as pe}from"./chunk-KK2SHN2W.js";import{s as re}from"./chunk-AP373D4K.js";import"./chunk-B6WYZ7BT.js";import{Ab as A,Bb as Y,Cb as H,F as U,Gb as s,Ha as f,Hb as l,Jd as D,Kd as V,La as K,M as G,Ma as v,P as O,R as X,Ra as b,Sb as Z,Ua as F,Va as w,Wa as o,Wb as ee,X as z,Xa as r,Ya as k,Yc as oe,Zb as te,_ as E,aa as x,ab as I,cb as h,db as p,ia as L,ja as P,n as q,nb as m,ob as y,pb as C,qa as J,rc as ie,sc as ne,tb as R,ub as B,uc as ae,vb as $,wa as a,wb as j,xa as _,xb as M,yb as S,zb as Q}from"./chunk-IFJN5CDK.js";var ke=(()=>{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 J,this.classesHttpFilter={params:{fields:"IsActive","filter.IsActive":"=true"}}}show(){this.filterChange.emit(this.filter)}static{this.\u0275fac=function(i){return new(i||e)(_(me),_(Ee),_(xe))}}static{this.\u0275cmp=x({type:e,selectors:[["bkd-evaluate-absences-header"]],inputs:{filter:"filter"},outputs:{filterChange:"filterChange"},standalone:!0,features:[A],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),$("valueChange",function(d){return B(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),$("valueChange",function(d){return B(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),$("valueChange",function(d){return B(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),R("value",n.filter.student),a(3),y(l(9,13,"evaluate-absences.header.module-instance")),a(2),v("typeaheadService",n.educationalEventsService),R("value",n.filter.educationalEvent),a(3),y(l(14,15,"evaluate-absences.header.study-class")),a(2),v("typeaheadService",n.studyClassesService),R("value",n.filter.studyClass),v("additionalHttpParams",n.classesHttpFilter),a(3),C(" ",l(19,17,"evaluate-absences.header.show")," "))},dependencies:[fe,V,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 he{constructor(t,i,n,u,d){super(t,i,d,n,"/evaluate-absences"),this.lessonPresenceService=u,this.queryParamsString$.pipe(X(this.destroy$)).subscribe(T=>this.confirmBackLinkParams={returnparams:T})}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),be)}buildParamsFromFilter(t){return ye(t)}static{this.\u0275fac=function(i){return new(i||e)(E(Z),E(ue),E(oe),E(N),E(Se))}}static{this.\u0275prov=z({token:e,factory:e.\u0275fac})}}return e})();var Te=(e,c)=>c.key,we=(e,c)=>c.StudentRef.Id,Re=()=>[],Be=e=>["student",e,"absences"],$e=e=>({returnparams:e});function je(e,c){e&1&&k(0,"bkd-spinner")}function Me(e,c){if(e&1){let t=I();o(0,"th",9),h("click",function(){let n=L(t).$implicit,u=p(4);return P(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),C(" ",l(5,6,"evaluate-absences.list.header."+t.label)," "),a(3),C(" ",l(8,8,i.state.sortService.getSortingChar$(t.key))," ")}}function De(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",H(5,Be,i.StudentRef.Id))("queryParams",H(7,$e,l(1,3,n.profileReturnParams$))),a(2),C(" ",i[t.key]," ")}}function Ve(e,c){if(e&1&&m(0),e&2){let t=p().$implicit,i=p().$implicit;C(" ",i[t.key]," ")}}function Ne(e,c){if(e&1&&(o(0,"td"),s(1,"translate"),f(2,De,3,9,"a",13)(3,Ve,1,1),r()),e&2){let t=c.$implicit;K("data-label",l(1,2,"evaluate-absences.list.header."+t.label)),a(2),b(t.key==="StudentFullName"?2:3)}}function Oe(e,c){if(e&1&&(o(0,"tr"),F(1,Ne,4,4,"td",null,Te),r()),e&2){let t=p(5);a(),w(t.columns)}}function He(e,c){if(e&1&&(o(0,"tbody"),F(1,Oe,3,0,"tr",null,we),r()),e&2){p(4);let t=S(0);a(),w(t)}}function We(e,c){e&1&&k(0,"bkd-spinner",7)}function qe(e,c){if(e&1){let t=I();o(0,"button",14),h("click",function(){L(t);let n=p(4);return P(n.state.nextPage())}),m(1),s(2,"translate"),r()}e&2&&(a(),C(" ",l(2,1,"global.pagination.load-more")," "))}function Ue(e,c){if(e&1){let t=I();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 P(n.onScroll())}),o(5,"thead")(6,"tr"),F(7,Me,9,10,"th",6,Te),r()(),f(9,He,3,0,"tbody"),r(),f(10,We,1,0,"bkd-spinner",7)(11,qe,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:Y(6,Re)),a(5),w(i.columns),a(2),b(n&&n.length>0?9:-1),a(),b(d?10:-1),a(),b(u&&!d?11:-1)}}function Ge(e,c){e&1&&(o(0,"p",1),m(1),s(2,"translate"),r()),e&2&&(a(),C(" ",l(2,1,"evaluate-absences.no-entries")," "))}function Xe(e,c){if(e&1&&f(0,Ue,12,7,"div",2)(1,Ge,3,3,"p",1),e&2){p(2);let t=S(0),i=S(4);b(t&&t.length>0||i?0:1)}}function ze(e,c){if(e&1&&(f(0,je,1,0,"bkd-spinner"),s(1,"async"),f(2,Xe,2,1)),e&2){let t=p();b(l(1,1,t.state.loading$)?0:2)}}function Je(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 Le=(()=>{class e{constructor(t,i,n,u,d,T){this.state=t,this.scrollPosition=i,this.route=n,this.presenceTypesService=u,this.reportsService=d,this.lessonPresencesService=T,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(q(Ke)),this.profileReturnParams$=this.state.queryParamsString$}ngOnInit(){this.filterFromParams$.pipe(U(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(O(t=>this.lessonPresencesService.getLessonRefs(t)),O(t=>t.length>0?this.reportsService.getEvaluateAbsencesReports(this.getReportRecordIds(t)):[]),G(1))}getReportRecordIds(t){return t.map(i=>`${i.LessonRef.Id}_${i.RegistrationRef.Id}`)}static{this.\u0275fac=function(i){return new(i||e)(_(g),_(Ce),_(ie),_(ce),_(_e),_(N))}}static{this.\u0275cmp=x({type:e,selectors:[["bkd-evaluate-absences-list"]],standalone:!0,features:[A],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=I();j(0),s(1,"async"),j(2),s(3,"async"),j(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(T){return L(u),P(n.state.setFilter(T))}),r(),f(11,ze,3,3),s(12,"async"),f(13,Je,3,3,"p",1)}i&2&&(M(l(1,3,n.state.entries$)),a(2),M(l(3,6,n.state.hasMore$)),a(2),M(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:[ke,de,ge,ee,re,ae,pe,te,V,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 Ke(e){return{student:e.student?Number(e.student):null,educationalEvent:e.educationalEvent?Number(e.educationalEvent):null,studyClass:e.studyClass?Number(e.studyClass):null}}var Pe=(()=>{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"]],standalone:!0,features:[Q([g,{provide:se,useExisting:g},le]),A],decls:1,vars:0,template:function(i,n){i&1&&k(0,"router-outlet")},dependencies:[ne],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return e})();var Mt=[{path:"",component:Pe,children:[{path:"",component:Le,data:{restoreScrollPositionFrom:["/evaluate-absences/student/:id"]}},ve]}];export{Mt as EVALUATE_ABSENCES_ROUTES}; +import{a as ye,b as ge,c as Ee}from"./chunk-ZATT6MZM.js";import{a as fe}from"./chunk-DYBK5FKC.js";import{a as xe}from"./chunk-GKHN5TVX.js";import{a as ve}from"./chunk-HAT2K5YI.js";import"./chunk-4YGUAC2V.js";import"./chunk-LLGOVPQJ.js";import"./chunk-2H6IFZM2.js";import{b as se,e as N}from"./chunk-QOR23F4L.js";import"./chunk-7FRZV7VF.js";import"./chunk-Y4QYVF5K.js";import"./chunk-OFB4XAK2.js";import{a as be,b as he}from"./chunk-RET26MIW.js";import{a as Ce}from"./chunk-UA2MEY3S.js";import{a as Se}from"./chunk-2U5ENDJH.js";import{d as me}from"./chunk-VUPOI3TG.js";import{d as _e}from"./chunk-WACRWBCS.js";import"./chunk-MIRGHONI.js";import"./chunk-YUHFF3NM.js";import{L as le,P as ce}from"./chunk-H6G6Q6V6.js";import"./chunk-NL5E3FC5.js";import{a as de,b as ue}from"./chunk-YD3RJIHU.js";import{b as pe}from"./chunk-KK2SHN2W.js";import{s as re}from"./chunk-AP373D4K.js";import"./chunk-B6WYZ7BT.js";import{Ab as A,Bb as Y,Cb as H,F as U,Gb as s,Ha as f,Hb as l,Jd as D,Kd as V,La as K,M as G,Ma as v,P as O,R as X,Ra as b,Sb as Z,Ua as F,Va as w,Wa as o,Wb as ee,X as z,Xa as r,Ya as k,Yc as oe,Zb as te,_ as E,aa as x,ab as I,cb as h,db as p,ia as L,ja as P,n as q,nb as m,ob as y,pb as C,qa as J,rc as ie,sc as ne,tb as R,ub as B,uc as ae,vb as $,wa as a,wb as j,xa as _,xb as M,yb as S,zb as Q}from"./chunk-IFJN5CDK.js";var ke=(()=>{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 J,this.classesHttpFilter={params:{fields:"IsActive","filter.IsActive":"=true"}}}show(){this.filterChange.emit(this.filter)}static{this.\u0275fac=function(i){return new(i||e)(_(me),_(Ee),_(xe))}}static{this.\u0275cmp=x({type:e,selectors:[["bkd-evaluate-absences-header"]],inputs:{filter:"filter"},outputs:{filterChange:"filterChange"},standalone:!0,features:[A],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),$("valueChange",function(d){return B(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),$("valueChange",function(d){return B(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),$("valueChange",function(d){return B(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),R("value",n.filter.student),a(3),y(l(9,13,"evaluate-absences.header.module-instance")),a(2),v("typeaheadService",n.educationalEventsService),R("value",n.filter.educationalEvent),a(3),y(l(14,15,"evaluate-absences.header.study-class")),a(2),v("typeaheadService",n.studyClassesService),R("value",n.filter.studyClass),v("additionalHttpParams",n.classesHttpFilter),a(3),C(" ",l(19,17,"evaluate-absences.header.show")," "))},dependencies:[fe,V,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 he{constructor(t,i,n,u,d){super(t,i,d,n,"/evaluate-absences"),this.lessonPresenceService=u,this.queryParamsString$.pipe(X(this.destroy$)).subscribe(T=>this.confirmBackLinkParams={returnparams:T})}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),be)}buildParamsFromFilter(t){return ye(t)}static{this.\u0275fac=function(i){return new(i||e)(E(Z),E(ue),E(oe),E(N),E(Se))}}static{this.\u0275prov=z({token:e,factory:e.\u0275fac})}}return e})();var Te=(e,c)=>c.key,we=(e,c)=>c.StudentRef.Id,Re=()=>[],Be=e=>["student",e,"absences"],$e=e=>({returnparams:e});function je(e,c){e&1&&k(0,"bkd-spinner")}function Me(e,c){if(e&1){let t=I();o(0,"th",9),h("click",function(){let n=L(t).$implicit,u=p(4);return P(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),C(" ",l(5,6,"evaluate-absences.list.header."+t.label)," "),a(3),C(" ",l(8,8,i.state.sortService.getSortingChar$(t.key))," ")}}function De(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",H(5,Be,i.StudentRef.Id))("queryParams",H(7,$e,l(1,3,n.profileReturnParams$))),a(2),C(" ",i[t.key]," ")}}function Ve(e,c){if(e&1&&m(0),e&2){let t=p().$implicit,i=p().$implicit;C(" ",i[t.key]," ")}}function Ne(e,c){if(e&1&&(o(0,"td"),s(1,"translate"),f(2,De,3,9,"a",13)(3,Ve,1,1),r()),e&2){let t=c.$implicit;K("data-label",l(1,2,"evaluate-absences.list.header."+t.label)),a(2),b(t.key==="StudentFullName"?2:3)}}function Oe(e,c){if(e&1&&(o(0,"tr"),F(1,Ne,4,4,"td",null,Te),r()),e&2){let t=p(5);a(),w(t.columns)}}function He(e,c){if(e&1&&(o(0,"tbody"),F(1,Oe,3,0,"tr",null,we),r()),e&2){p(4);let t=S(0);a(),w(t)}}function We(e,c){e&1&&k(0,"bkd-spinner",7)}function qe(e,c){if(e&1){let t=I();o(0,"button",14),h("click",function(){L(t);let n=p(4);return P(n.state.nextPage())}),m(1),s(2,"translate"),r()}e&2&&(a(),C(" ",l(2,1,"global.pagination.load-more")," "))}function Ue(e,c){if(e&1){let t=I();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 P(n.onScroll())}),o(5,"thead")(6,"tr"),F(7,Me,9,10,"th",6,Te),r()(),f(9,He,3,0,"tbody"),r(),f(10,We,1,0,"bkd-spinner",7)(11,qe,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:Y(6,Re)),a(5),w(i.columns),a(2),b(n&&n.length>0?9:-1),a(),b(d?10:-1),a(),b(u&&!d?11:-1)}}function Ge(e,c){e&1&&(o(0,"p",1),m(1),s(2,"translate"),r()),e&2&&(a(),C(" ",l(2,1,"evaluate-absences.no-entries")," "))}function Xe(e,c){if(e&1&&f(0,Ue,12,7,"div",2)(1,Ge,3,3,"p",1),e&2){p(2);let t=S(0),i=S(4);b(t&&t.length>0||i?0:1)}}function ze(e,c){if(e&1&&(f(0,je,1,0,"bkd-spinner"),s(1,"async"),f(2,Xe,2,1)),e&2){let t=p();b(l(1,1,t.state.loading$)?0:2)}}function Je(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 Le=(()=>{class e{constructor(t,i,n,u,d,T){this.state=t,this.scrollPosition=i,this.route=n,this.presenceTypesService=u,this.reportsService=d,this.lessonPresencesService=T,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(q(Ke)),this.profileReturnParams$=this.state.queryParamsString$}ngOnInit(){this.filterFromParams$.pipe(U(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(O(t=>this.lessonPresencesService.getLessonRefs(t)),O(t=>t.length>0?this.reportsService.getEvaluateAbsencesReports(this.getReportRecordIds(t)):[]),G(1))}getReportRecordIds(t){return t.map(i=>`${i.LessonRef.Id}_${i.RegistrationRef.Id}`)}static{this.\u0275fac=function(i){return new(i||e)(_(g),_(Ce),_(ie),_(ce),_(_e),_(N))}}static{this.\u0275cmp=x({type:e,selectors:[["bkd-evaluate-absences-list"]],standalone:!0,features:[A],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=I();j(0),s(1,"async"),j(2),s(3,"async"),j(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(T){return L(u),P(n.state.setFilter(T))}),r(),f(11,ze,3,3),s(12,"async"),f(13,Je,3,3,"p",1)}i&2&&(M(l(1,3,n.state.entries$)),a(2),M(l(3,6,n.state.hasMore$)),a(2),M(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:[ke,de,ge,ee,re,ae,pe,te,V,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 Ke(e){return{student:e.student?Number(e.student):null,educationalEvent:e.educationalEvent?Number(e.educationalEvent):null,studyClass:e.studyClass?Number(e.studyClass):null}}var Pe=(()=>{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"]],standalone:!0,features:[Q([g,{provide:se,useExisting:g},le]),A],decls:1,vars:0,template:function(i,n){i&1&&k(0,"router-outlet")},dependencies:[ne],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return e})();var Mt=[{path:"",component:Pe,children:[{path:"",component:Le,data:{restoreScrollPositionFrom:["/evaluate-absences/student/:id"]}},ve]}];export{Mt as EVALUATE_ABSENCES_ROUTES}; diff --git a/public/apps/webapp-schulverwaltung/chunk-6OTM65O7.js b/public/apps/webapp-schulverwaltung/chunk-N753X34U.js similarity index 99% rename from public/apps/webapp-schulverwaltung/chunk-6OTM65O7.js rename to public/apps/webapp-schulverwaltung/chunk-N753X34U.js index 13552723..a5437b4b 100644 --- a/public/apps/webapp-schulverwaltung/chunk-6OTM65O7.js +++ b/public/apps/webapp-schulverwaltung/chunk-N753X34U.js @@ -1,2 +1,2 @@ -import{a as Di}from"./chunk-6HH4DCEF.js";import{a as Ni,b as Vi,c as $i}from"./chunk-ZATT6MZM.js";import{a as ki}from"./chunk-DYBK5FKC.js";import{a as ji}from"./chunk-GKHN5TVX.js";import{a as Fi}from"./chunk-24TK3FB4.js";import"./chunk-7VKKHU7R.js";import"./chunk-LLGOVPQJ.js";import"./chunk-2H6IFZM2.js";import{a as hi,b as _i,e as Ti}from"./chunk-QOR23F4L.js";import{a as We}from"./chunk-7FRZV7VF.js";import"./chunk-Y4QYVF5K.js";import"./chunk-OFB4XAK2.js";import{a as Ri}from"./chunk-6SKXLYON.js";import{a as Li,b as Pi}from"./chunk-RET26MIW.js";import{a as Oi}from"./chunk-UA2MEY3S.js";import{a as Bi}from"./chunk-6YG4BOT7.js";import{a as Mi}from"./chunk-2U5ENDJH.js";import{c as xi,d as wi}from"./chunk-VUPOI3TG.js";import"./chunk-WACRWBCS.js";import{a as Ii}from"./chunk-MIRGHONI.js";import"./chunk-YUHFF3NM.js";import{H as Ci,I as lt,L as vi,M as ct,N as dt,O as ke,P as Ge,Q as Ei,g as gi,r as bi,s as ot}from"./chunk-H6G6Q6V6.js";import{a as He,c as at,l as yi}from"./chunk-NL5E3FC5.js";import{b as Ai}from"./chunk-YD3RJIHU.js";import{b as Si}from"./chunk-KK2SHN2W.js";import{f as li,g as ci,j as di,w as Fe,y as fi}from"./chunk-AP373D4K.js";import{a as pi}from"./chunk-B6WYZ7BT.js";import{$a as Je,$c as Yt,A as vt,Ab as U,Ba as Dt,Bb as Lt,Cb as X,Cc as nt,Cd as ui,D as Et,Db as Pt,Dc as st,Eb as Nt,F as ne,Fb as Mt,Ga as Me,Gb as d,Gd as mi,Ha as b,Hb as u,Ib as se,Ic as zt,Id as je,J as yt,Jd as fe,Kb as de,Kd as _e,La as te,M as pe,Ma as _,Na as G,Nb as Vt,O as Tt,Ob as O,Oc as rt,P as Se,Pb as we,Qa as Ze,R as N,Ra as y,Rb as Rt,S as St,Sb as $t,Ta as xe,Ua as M,Va as V,W as It,Wa as l,Wb as jt,X as J,Xa as c,Y as xt,Ya as B,Yb as it,Yc as he,Z as wt,Za as Bt,Zb as ye,Zc as Qt,_ as j,_a as Ot,_b as Ht,_c as Kt,a as ve,aa as H,ab as P,b as Oe,ba as At,bd as Ae,ca as W,cb as x,cd as Re,db as m,dd as Zt,eb as Xe,f as ae,fb as et,g as Ke,gb as ge,gc as Wt,gd as Jt,ha as Ie,hb as tt,hd as Xt,i as gt,ia as v,ib as q,j as bt,ja as E,jb as be,jd as ei,kb as k,l as Ct,lb as D,ld as ti,ma as Ft,mb as z,md as ii,n as T,na as Ye,nb as p,nd as ni,o as Le,ob as I,od as si,pb as C,pd as ri,qa as F,qb as Ee,ra as kt,rc as Ve,sc as Gt,t as Te,ta as oe,tb as Q,tc as qt,td as ai,ub as K,uc as Ut,ud as $e,vb as Y,vd as oi,w as Pe,wa as o,wb as le,x as Ne,xa as f,xb as ce,yb as Z,za as S,zb as me}from"./chunk-IFJN5CDK.js";var L=function(t){return t.Absent="absent",t.Dispensation="dispensation",t.HalfDay="half-day",t.Incident="incident",t.Present="present",t}(L||{}),Wi=(()=>{class t{constructor(e,i){this.updateService=e,this.settings=i}update(e,i,n,r,a,h){let g=[];switch(n){case L.Present:g=this.createResetBulkRequests(e);break;case L.Absent:g=this.createAbsentEditBulkRequests(e,i,r,a);break;case L.Dispensation:g=this.createEditBulkRequests(e,null,this.settings.dispensationPresenceTypeId);break;case L.HalfDay:g=this.createEditBulkRequests(e,null,this.settings.halfDayPresenceTypeId);break;case L.Incident:g=this.createEditBulkRequests(e,null,h);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(Hi(i,this.settings)),n,this.settings.absencePresenceTypeId),...this.createEditBulkRequests(e.filter(Fe(Hi(i,this.settings))),n,null)]}createResetBulkRequests(e){return lt(e).map(({lessonIds:i,personIds:n})=>this.updateService.removeLessonPresences(i,n))}createEditBulkRequests(e,i,n){return lt(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(Ei),j(he))}}static{this.\u0275prov=J({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();function Hi(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 ie=(()=>{class t extends Pi{constructor(e,i,n,r,a,h,g){super(e,i,n,r,"/edit-absences"),this.lessonPresencesService=a,this.presenceTypesService=h,this.dropDownItemsService=g,this.weekdays$=this.loadWeekdays().pipe(pe(1)),this.presenceTypes$=this.loadPresenceTypes().pipe(pe(1)),this.absenceConfirmationStates$=this.loadAbsenceConfirmationStates().pipe(T(hi),pe(1)),this.presenceControlEntries$=Le([this.entries$,this.presenceTypes$,this.absenceConfirmationStates$]).pipe(T(yi(Di)),pe(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),Li)}buildParamsFromFilter(e){return Ni(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($t),j(Ai),j(Mi),j(he),j(Ti),j(Ge),j(We))}}static{this.\u0275prov=J({token:t,factory:t.\u0275fac})}}return t})();var gn=(t,s)=>s.Key,Gi=(t,s)=>s.Id;function bn(t,s){if(t&1&&(l(0,"div",3),p(1),d(2,"translate"),c()),t&2){let e=s.$implicit;o(),C(" ",se(2,1,"global.validation-errors."+e.error,e.params)," ")}}function Cn(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 vn(t,s){if(t&1&&(l(0,"select",17),d(1,"async"),l(2,"option",18),p(3),d(4,"translate"),c(),M(5,Cn,2,2,"option",18,Gi),d(7,"async"),c()),t&2){let e,i=m(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),V(u(7,8,i.absenceTypes$))}}function En(t,s){if(t&1&&(l(0,"div",16),p(1),d(2,"translate"),c()),t&2){let e=s.$implicit;o(),C(" ",se(2,1,"global.validation-errors."+e.error,e.params)," ")}}function yn(t,s){if(t&1&&(l(0,"div",13),B(1,"input",14),l(2,"label",11),p(3),c(),b(4,vn,8,10,"select",15),M(5,En,3,4,"div",16,xe),d(7,"async"),c()),t&2){let e=s.$implicit,i=m(4);o(),_("id","state-"+e.Key)("value",e.Key),o(),ge("for","state-"+e.Key),o(),C(" ",e.Value," "),o(),y(i.isExcused(e)?4:-1),o(),V(u(7,5,i.absenceTypeIdErrors$))}}function Tn(t,s){if(t&1&&(l(0,"div",12),M(1,yn,8,7,"div",13,gn),c()),t&2){m(3);let e=Z(0);o(),V(e)}}function Sn(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 In(t,s){if(t&1&&(l(0,"div",16),p(1),d(2,"translate"),c()),t&2){let e=s.$implicit;o(),C(" ",se(2,1,"global.validation-errors."+e.error,e.params)," ")}}function xn(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(),M(6,Sn,2,2,"option",18,Gi),d(8,"async"),c(),M(9,In,3,4,"div",16,xe),d(11,"async"),c()),t&2){let e,i=m(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),V(u(8,8,i.incidents$)),o(3),V(u(11,10,i.incidentIdErrors$))}}function wn(t,s){if(t&1&&(l(0,"div",5),B(1,"input",10),l(2,"label",11),p(3),d(4,"translate"),c(),b(5,Tn,3,0,"div",12)(6,xn,12,12,"div",12),c()),t&2){let e=s.$implicit,i=m(2);o(),_("id","category-"+e)("value",e),o(),ge("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 An(t,s){t&1&&(l(0,"div",9)(1,"span",20),p(2,"Loading..."),c()())}function Fn(t,s){if(t&1){let e=P();l(0,"form",2),x("ngSubmit",function(){v(e);let n=m();return E(n.onSubmit())}),M(1,bn,3,4,"div",3,xe),d(3,"async"),l(4,"div",4),M(5,wn,7,8,"div",5,xe),c(),l(7,"div",6)(8,"button",7),d(9,"async"),x("click",function(){v(e);let n=m();return E(n.cancel())}),p(10),d(11,"translate"),c(),l(12,"button",8),d(13,"async"),p(14),d(15,"translate"),b(16,An,3,0,"div",9),d(17,"async"),c()()()}if(t&2){let e=m(),i=Z(2),n=Z(4);_("formGroup",n),o(),V(u(3,6,e.formErrors$)),o(4),V(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 qi=(()=>{class t{constructor(e,i,n,r,a,h,g,A,ee,R){this.fb=e,this.router=i,this.route=n,this.toastService=r,this.translate=a,this.state=h,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 Ke(!1),this.submitted$=new Ke(!1),this.formErrors$=He(this.formGroup$,this.submitted$),this.absenceTypeIdErrors$=He(this.formGroup$,this.submitted$,"absenceTypeId"),this.incidentIdErrors$=He(this.formGroup$,this.submitted$,"incidentId"),this.availableCategories=[L.Absent,L.Dispensation,L.HalfDay,L.Incident,L.Present],this.confirmationStates$=this.dropDownItemsService.getAbsenceConfirmationStates().pipe(T(this.sortAbsenceConfirmationStates.bind(this)),pe(1)),this.activeCategories$=this.presenceTypesService.halfDayActive$.pipe(T($=>$?this.availableCategories:this.availableCategories.filter(Ce=>Ce!==L.HalfDay))),this.destroy$=new ae}ngOnInit(){this.state.selected.length===0&&this.navigateBack(),at(this.formGroup$,"category").pipe(N(this.destroy$)).subscribe(this.updateConfirmationValueDisabled.bind(this)),at(this.formGroup$,"confirmationValue").pipe(N(this.destroy$)).subscribe(this.updateAbsenceTypeIdDisabled.bind(this))}ngOnDestroy(){this.destroy$.next()}isAbsent(e){return e===L.Absent}isExcused(e){return e.Key===this.settings.excusedAbsenceStateId}isIncident(e){return e===L.Incident}onSubmit(){this.submitted$.next(!0),this.formGroup$.pipe(ne(1)).subscribe(e=>{e.valid&&this.save(e)})}cancel(){this.navigateBack()}createFormGroup(){return this.getInitialAbsenceTypeId().pipe(T(e=>this.fb.group({category:[L.Absent,Ae.required],confirmationValue:[this.settings.excusedAbsenceStateId,Ae.required],absenceTypeId:[e,Ae.required],incidentId:[{value:null,disabled:!0},Ae.required]})),pe(1))}getInitialAbsenceTypeId(){return this.absenceTypes$.pipe(ne(1),T(e=>{let i=e.map(r=>r.Id),n=ui(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(ne(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===L.Absent?(n.enable(),this.updateAbsenceTypeIdDisabled()):(n.disable(),r.disable()),i.value===L.Incident?a.enable():a.disable())})}updateAbsenceTypeIdDisabled(){this.formGroup$.pipe(ne(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(Se(h=>this.updateService.update(this.state.selected,h,i,n,r,a)),yt(()=>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(ne(1)).subscribe(i=>{this.router.navigate(["/edit-absences"],{queryParams:Oe(ve({},Ii(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(ai),f(qt),f(Ve),f(pi),f(je),f(ie),f(We),f(Ge),f(Wi),f(he))}}static{this.\u0275cmp=H({type:t,selectors:[["bkd-edit-absences-edit"]],standalone:!0,features:[U],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&&(le(0),d(1,"async"),le(2),d(3,"async"),le(4),d(5,"async"),l(6,"h1"),p(7),d(8,"translate"),c(),l(9,"div",0),b(10,Fn,18,18,"form",1),c()),i&2){let r=ce(u(1,2,n.confirmationStates$));o(2),ce(u(3,5,n.activeCategories$)),o(2);let a=ce(u(5,8,n.formGroup$));o(3),I(u(8,11,"edit-absences.title")),o(3),y(a&&r?10:-1)}},dependencies:[$e,Xt,si,ri,Yt,ni,ei,Re,Zt,oi,ti,ii,ye,_e,fe],changeDetection:0})}}return t})();var Ue=(()=>{class t extends Ci{static{this.\u0275fac=(()=>{let e;return function(n){return(e||(e=Ft(t)))(n||t)}})()}static{this.\u0275prov=J({token:t,factory:t.\u0275fac})}}return t})();var Dn=["content"],Bn=["scroll"],On=["padding"],Qi=["*"],Be=t=>({searchTerm:t});function Ln(t,s){if(t&1&&(l(0,"div",3),Je(1,6),c()),t&2){let e=m();o(),_("ngTemplateOutlet",e.headerTemplate)("ngTemplateOutletContext",X(2,Be,e.filterValue))}}function Pn(t,s){if(t&1&&(l(0,"div",5),Je(1,6),c()),t&2){let e=m();o(),_("ngTemplateOutlet",e.footerTemplate)("ngTemplateOutletContext",X(2,Be,e.filterValue))}}var Nn=["searchInput"],Mn=["clearButton"],Vn=(t,s,e)=>({item:t,clear:s,label:e}),Rn=(t,s)=>({items:t,clear:s}),$n=(t,s,e,i)=>({item:t,item$:s,index:e,searchTerm:i});function jn(t,s){if(t&1&&(l(0,"div",20),p(1),c()),t&2){let e=m(2);o(),I(e.placeholder)}}function Hn(t,s){}function Wn(t,s){if(t&1&&b(0,jn,2,1,"ng-template",null,1,de)(2,Hn,0,0,"ng-template",19),t&2){let e=z(1),i=m();o(2),_("ngTemplateOutlet",i.placeholderTemplate||e)}}function Gn(t,s){if(t&1){let e=P();l(0,"span",23),x("click",function(){v(e);let n=m().$implicit,r=m(2);return E(r.unselect(n))}),p(1,"\xD7"),c(),B(2,"span",24)}if(t&2){let e=m().$implicit,i=m(2);o(2),_("ngItemLabel",e.label)("escape",i.escapeHTML)}}function qn(t,s){}function Un(t,s){if(t&1&&(l(0,"div",22),b(1,Gn,3,2,"ng-template",null,2,de)(3,qn,0,0,"ng-template",12),c()),t&2){let e=s.$implicit,i=z(2),n=m(2);G("ng-value-disabled",e.disabled),o(3),_("ngTemplateOutlet",n.labelTemplate||i)("ngTemplateOutletContext",Nt(4,Vn,e.value,n.clearItem,e.label))}}function zn(t,s){if(t&1&&M(0,Un,4,8,"div",21,Ze().trackByOption,!0),t&2){let e=m();V(e.selectedItems)}}function Qn(t,s){}function Kn(t,s){if(t&1&&b(0,Qn,0,0,"ng-template",12),t&2){let e=m();_("ngTemplateOutlet",e.multiLabelTemplate)("ngTemplateOutletContext",Pt(2,Rn,e.selectedValues,e.clearItem))}}function Yn(t,s){t&1&&B(0,"div",25)}function Zn(t,s){}function Jn(t,s){if(t&1&&b(0,Yn,1,0,"ng-template",null,3,de)(2,Zn,0,0,"ng-template",19),t&2){let e=z(1),i=m();o(2),_("ngTemplateOutlet",i.loadingSpinnerTemplate||e)}}function Xn(t,s){if(t&1&&(l(0,"span",15,4)(2,"span",26),p(3,"\xD7"),c()()),t&2){let e=m();ge("title",e.clearAllText)}}function es(t,s){if(t&1&&B(0,"span",31),t&2){let e=m().$implicit,i=m(2);_("ngItemLabel",e.label)("escape",i.escapeHTML)}}function ts(t,s){}function is(t,s){if(t&1){let e=P();l(0,"div",30),x("click",function(){let n=v(e).$implicit,r=m(2);return E(r.toggleItem(n))})("mouseover",function(){let n=v(e).$implicit,r=m(2);return E(r.onItemHover(n))}),b(1,es,1,2,"ng-template",null,5,de)(3,ts,0,0,"ng-template",12),c()}if(t&2){let e=s.$implicit,i=z(2),n=m(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),te("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",Mt(17,$n,e.value,e,e.index,n.searchTerm))}}function ns(t,s){if(t&1&&(l(0,"span")(1,"span",33),p(2),c(),p(3),c()),t&2){let e=m(3);o(2),I(e.addTagText),o(),C('"',e.searchTerm,'"')}}function ss(t,s){}function rs(t,s){if(t&1){let e=P();l(0,"div",32),x("mouseover",function(){v(e);let n=m(2);return E(n.itemsList.unmarkItem())})("click",function(){v(e);let n=m(2);return E(n.selectTag())}),b(1,ns,4,2,"ng-template",null,6,de)(3,ss,0,0,"ng-template",12),c()}if(t&2){let e=z(2),i=m(2);G("ng-option-marked",!i.itemsList.markedItem),o(3),_("ngTemplateOutlet",i.tagTemplate||e)("ngTemplateOutletContext",X(4,Be,i.searchTerm))}}function as(t,s){if(t&1&&(l(0,"div",34),p(1),c()),t&2){let e=m(3);o(),I(e.notFoundText)}}function os(t,s){}function ls(t,s){if(t&1&&b(0,as,2,1,"ng-template",null,7,de)(2,os,0,0,"ng-template",12),t&2){let e=z(1),i=m(2);o(2),_("ngTemplateOutlet",i.notFoundTemplate||e)("ngTemplateOutletContext",X(2,Be,i.searchTerm))}}function cs(t,s){if(t&1&&(l(0,"div",34),p(1),c()),t&2){let e=m(3);o(),I(e.typeToSearchText)}}function ds(t,s){}function us(t,s){if(t&1&&b(0,cs,2,1,"ng-template",null,8,de)(2,ds,0,0,"ng-template",19),t&2){let e=z(1),i=m(2);o(2),_("ngTemplateOutlet",i.typeToSearchTemplate||e)}}function ps(t,s){if(t&1&&(l(0,"div",34),p(1),c()),t&2){let e=m(3);o(),I(e.loadingText)}}function ms(t,s){}function hs(t,s){if(t&1&&b(0,ps,2,1,"ng-template",null,9,de)(2,ms,0,0,"ng-template",12),t&2){let e=z(1),i=m(2);o(2),_("ngTemplateOutlet",i.loadingTextTemplate||e)("ngTemplateOutletContext",X(2,Be,i.searchTerm))}}function fs(t,s){if(t&1){let e=P();l(0,"ng-dropdown-panel",27),x("update",function(n){v(e);let r=m();return E(r.viewPortItems=n)})("scroll",function(n){v(e);let r=m();return E(r.scroll.emit(n))})("scrollToEnd",function(n){v(e);let r=m();return E(r.scrollToEnd.emit(n))})("outsideClick",function(){v(e);let n=m();return E(n.close())}),Bt(1),M(2,is,4,22,"div",28,Ze().trackByOption,!0),b(4,rs,4,6,"div",29),Ot(),b(5,ls,3,4)(6,us,3,1)(7,hs,3,4),c()}if(t&2){let e=m();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),o(2),V(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 Ki=/[&<>"']/g,_s=RegExp(Ki.source),gs={"&":"&","<":"<",">":">",'"':""","'":"'"};function bs(t){return t&&_s.test(t)?t.replace(Ki,s=>gs[s]):t}function w(t){return t!=null}function De(t){return typeof t=="object"&&w(t)}function Cs(t){return t instanceof Promise}function Qe(t){return t instanceof Function}var vs=(()=>{class t{constructor(e){this.element=e,this.escape=!0}ngOnChanges(e){this.element.nativeElement.innerHTML=this.escape?bs(this.ngItemLabel):this.ngItemLabel}static{this.\u0275fac=function(i){return new(i||t)(f(oe))}}static{this.\u0275dir=W({type:t,selectors:[["","ngItemLabel",""]],inputs:{ngItemLabel:"ngItemLabel",escape:"escape"},standalone:!0,features:[Ie]})}}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-option-tmp",""]],standalone:!0})}}return t})(),ft=(()=>{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",""]],standalone:!0})}}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-label-tmp",""]],standalone:!0})}}return t})(),_t=(()=>{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",""]],standalone:!0})}}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-header-tmp",""]],standalone:!0})}}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-footer-tmp",""]],standalone:!0})}}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-notfound-tmp",""]],standalone:!0})}}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-placeholder-tmp",""]],standalone:!0})}}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-typetosearch-tmp",""]],standalone:!0})}}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-loadingtext-tmp",""]],standalone:!0})}}return t})(),As=(()=>{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",""]],standalone:!0})}}return t})(),Fs=(()=>{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",""]],standalone:!0})}}return t})();function Yi(){return"axxxxxxxxxxx".replace(/[x]/g,()=>(Math.random()*16|0).toString(16))}var ks={"\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 ze(t){let s=e=>ks[e]||e;return t.replace(/[^\u0000-\u007E]/g,s)}var pt=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=ze(s).toLocaleLowerCase(),this.filteredItems.find(e=>ze(e.label).toLocaleLowerCase().substr(0,s.length)===s)}filter(s){if(!s){this.resetFilteredItems();return}this._filteredItems=[],s=this._ngSelect.searchFn?s:ze(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 h=this._ngSelect.searchFn?a.value:a;e(s,h)&&r.push(a)}if(r.length>0){let[a]=r.slice(-1);if(a.parent){let h=this._items.find(g=>g===a.parent);this._filteredItems.push(h)}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(!De(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 ze(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 h=(a.value[e]||[]).map((g,A)=>this.mapItem(g,A));i.set(a,h)}return i}let n=Qe(this._ngSelect.groupBy),r=a=>{let h=n?e(a.value):a.value[e];return w(h)?h:void 0};for(let a of s){let h=r(a),g=i.get(h);g?g.push(a):i.set(h,[a])}return i}_flatten(s){let e=Qe(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=De(n),h={label:a?"":String(n),children:void 0,parent:null,index:r++,disabled:!this._ngSelect.selectableGroup,htmlId:Yi()},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=h,R.children=void 0,R.index=r++,R));h.children=ee,h.value=A(n,ee.map(R=>R.value)),i.push(h),i.push(...ee)}return i}},re=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}(re||{}),Zi=(()=>{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)),Ce=r.itemHeight*Math.ceil($)-r.itemHeight*Math.min($,n);return Ce=isNaN(Ce)?0:Ce,$=isNaN($)?-1:$,A=isNaN(A)?-1:A,$-=n,$=Math.max(0,$),A+=n,A=Math.min(i,A),{topPadding:Ce,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,h=n,g=h+r;return r>=a&&n===e?null:a>g?h+a-g:e<=h?e:null}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=J({token:t,factory:t.\u0275fac})}}return t})(),Ui=["top","right","bottom","left"],Ds=typeof requestAnimationFrame<"u"?bt:gt,zi=(()=>{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 ae,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}`),h=i?a.offsetTop:this._lastScrollPosition;r=this._panelService.getScrollTo(a.offsetTop,a.clientHeight,h)}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),Ui.includes(this._currentPosition)?this._updateDropdownClass(this._currentPosition):this._updateDropdownClass("bottom"),this.appendTo&&this._updateYPosition(),this._dropdown.style.opacity="1"}_updateDropdownClass(e){Ui.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(()=>{Te(this.scrollElementRef.nativeElement,"scroll").pipe(N(this._destroy$),vt(0,Ds)).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(()=>{Pe(Te(this._document,"touchstart",{capture:!0}),Te(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,h=e.getBoundingClientRect().height;return r+a+h>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(()=>{Te(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(Dt),f(kt),f(Zi),f(oe),f(Rt,8))}}static{this.\u0275cmp=H({type:t,selectors:[["ng-dropdown-panel"]],viewQuery:function(i,n){if(i&1&&(be(Dn,7,oe),be(Bn,7,oe),be(On,7,oe)),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",O],headerTemplate:"headerTemplate",footerTemplate:"footerTemplate",filterValue:"filterValue"},outputs:{update:"update",scroll:"scroll",scrollToEnd:"scrollToEnd",outsideClick:"outsideClick"},standalone:!0,features:[Me,Ie,U],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&&(Xe(),b(0,Ln,2,4,"div",3),l(1,"div",4,0),B(3,"div",null,1),l(5,"div",null,2),et(7),c()(),b(8,Pn,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:[it],encapsulation:2,changeDetection:0})}}return t})(),Bs=(()=>{class t{constructor(e){this.elementRef=e,this.disabled=!1,this.stateChange$=new ae}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(oe))}}static{this.\u0275cmp=H({type:t,selectors:[["ng-option"]],inputs:{value:"value",disabled:[2,"disabled","disabled",O]},standalone:!0,features:[Me,Ie,U],ngContentSelectors:Qi,decls:1,vars:0,template:function(i,n){i&1&&(Xe(),et(0))},encapsulation:2,changeDetection:0})}}return t})();function Ji(){return new mt}var mt=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)}},Os=(()=>{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=J({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=J({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})(),Xi=new wt("ng-select-selection-model"),en=(()=>{class t{constructor(e,i,n,r,a,h,g){this.classes=e,this.autoFocus=i,this.config=n,this._cd=h,this._console=g,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=Yi(),this.escapeHTML=!0,this._defaultLabel="label",this._pressedKeys=[],this._isComposing=!1,this._destroy$=new ae,this._keyPress$=new ae,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 pt(this,r?r():Ji()),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&&!Qe(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(re[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 re.ArrowDown:this._handleArrowDown(e);break;case re.ArrowUp:this._handleArrowUp(e);break;case re.Space:this._handleSpace(e);break;case re.Enter:this._handleEnter(e);break;case re.Tab:this._handleTab(e);break;case re.Esc:this.close(),e.preventDefault();break;case re.Backspace:this._handleBackspace();break}}handleKeyCodeClear(e){switch(e.which){case re.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;Qe(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);Cs(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)?!De(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=Pe(this.ngOptions.changes,this._destroy$);Pe(...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(Tt(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)&&De(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=De(n),h=!a&&!this.bindValue;a||h?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$),St(e=>this._pressedKeys.push(e)),Et(200),Ne(()=>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=ve({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)(Ye("class"),Ye("autofocus"),f(Os),f(Xi,8),f(oe),f(Vt),f(Ls))}}static{this.\u0275cmp=H({type:t,selectors:[["ng-select"]],contentQueries:function(i,n,r){if(i&1&&(q(r,ht,5,S),q(r,ft,5,S),q(r,Es,5,S),q(r,_t,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,As,5,S),q(r,Fs,5,S),q(r,Bs,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&&(be(zi,5),be(Nn,7),be(Mn,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:{bindLabel:"bindLabel",bindValue:"bindValue",ariaLabel:"ariaLabel",markFirst:[2,"markFirst","markFirst",O],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",O],closeOnSelect:[2,"closeOnSelect","closeOnSelect",O],hideSelected:[2,"hideSelected","hideSelected",O],selectOnTab:[2,"selectOnTab","selectOnTab",O],openOnEnter:[2,"openOnEnter","openOnEnter",O],maxSelectedItems:[2,"maxSelectedItems","maxSelectedItems",we],groupBy:"groupBy",groupValue:"groupValue",bufferAmount:[2,"bufferAmount","bufferAmount",we],virtualScroll:[2,"virtualScroll","virtualScroll",O],selectableGroup:[2,"selectableGroup","selectableGroup",O],selectableGroupAsModel:[2,"selectableGroupAsModel","selectableGroupAsModel",O],searchFn:"searchFn",trackByFn:"trackByFn",clearOnBackspace:[2,"clearOnBackspace","clearOnBackspace",O],labelForId:"labelForId",inputAttrs:"inputAttrs",tabIndex:[2,"tabIndex","tabIndex",we],readonly:[2,"readonly","readonly",O],searchWhileComposing:[2,"searchWhileComposing","searchWhileComposing",O],minTermLength:[2,"minTermLength","minTermLength",we],editableSearchTerm:[2,"editableSearchTerm","editableSearchTerm",O],ngClass:"ngClass",typeahead:"typeahead",multiple:[2,"multiple","multiple",O],addTag:"addTag",searchable:[2,"searchable","searchable",O],clearable:[2,"clearable","clearable",O],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"},standalone:!0,features:[me([{provide:Qt,useExisting:It(()=>t),multi:!0},Zi]),Me,Ie,U],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","aria-label","Options list",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","aria-label","Options list",1,"ng-dropdown-panel",3,"update","scroll","scrollToEnd","outsideClick","virtualScroll","bufferAmount","appendTo","position","headerTemplate","footerTemplate","filterValue","items","markedItem","ngClass","id"],[1,"ng-option",3,"ng-option-disabled","ng-option-selected","ng-optgroup","ng-option","ng-option-child","ng-option-marked"],["role","option",1,"ng-option",3,"ng-option-marked"],[1,"ng-option",3,"click","mouseover"],[1,"ng-option-label",3,"ngItemLabel","escape"],["role","option",1,"ng-option",3,"mouseover","click"],[1,"ng-tag-label"],[1,"ng-option","ng-option-disabled"]],template:function(i,n){if(i&1){let r=P();l(0,"div",10),x("mousedown",function(h){return v(r),E(n.handleMousedown(h))}),l(1,"div",11),b(2,Wn,3,1)(3,zn,2,0)(4,Kn,1,5,null,12),l(5,"div",13)(6,"input",14,0),x("blur",function(h){return v(r),E(n.onInputBlur(h))})("change",function(h){return v(r),E(h.stopPropagation())})("compositionend",function(){v(r);let h=z(7);return E(n.onCompositionEnd(h.value))})("compositionstart",function(){return v(r),E(n.onCompositionStart())})("focus",function(h){return v(r),E(n.onInputFocus(h))})("input",function(){v(r);let h=z(7);return E(n.filter(h.value))}),c()()(),b(8,Jn,3,1)(9,Xn,4,1,"span",15),l(10,"span",16),B(11,"span",17),c()(),b(12,fs,8,17,"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:""),te("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:[it,vs,zi,jt],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 Di}from"./chunk-6HH4DCEF.js";import{a as Ni,b as Vi,c as $i}from"./chunk-ZATT6MZM.js";import{a as ki}from"./chunk-DYBK5FKC.js";import{a as ji}from"./chunk-GKHN5TVX.js";import{a as Fi}from"./chunk-HAT2K5YI.js";import"./chunk-4YGUAC2V.js";import"./chunk-LLGOVPQJ.js";import"./chunk-2H6IFZM2.js";import{a as hi,b as _i,e as Ti}from"./chunk-QOR23F4L.js";import{a as We}from"./chunk-7FRZV7VF.js";import"./chunk-Y4QYVF5K.js";import"./chunk-OFB4XAK2.js";import{a as Ri}from"./chunk-6SKXLYON.js";import{a as Li,b as Pi}from"./chunk-RET26MIW.js";import{a as Oi}from"./chunk-UA2MEY3S.js";import{a as Bi}from"./chunk-6YG4BOT7.js";import{a as Mi}from"./chunk-2U5ENDJH.js";import{c as xi,d as wi}from"./chunk-VUPOI3TG.js";import"./chunk-WACRWBCS.js";import{a as Ii}from"./chunk-MIRGHONI.js";import"./chunk-YUHFF3NM.js";import{H as Ci,I as lt,L as vi,M as ct,N as dt,O as ke,P as Ge,Q as Ei,g as gi,r as bi,s as ot}from"./chunk-H6G6Q6V6.js";import{a as He,c as at,l as yi}from"./chunk-NL5E3FC5.js";import{b as Ai}from"./chunk-YD3RJIHU.js";import{b as Si}from"./chunk-KK2SHN2W.js";import{f as li,g as ci,j as di,w as Fe,y as fi}from"./chunk-AP373D4K.js";import{a as pi}from"./chunk-B6WYZ7BT.js";import{$a as Je,$c as Yt,A as vt,Ab as U,Ba as Dt,Bb as Lt,Cb as X,Cc as nt,Cd as ui,D as Et,Db as Pt,Dc as st,Eb as Nt,F as ne,Fb as Mt,Ga as Me,Gb as d,Gd as mi,Ha as b,Hb as u,Ib as se,Ic as zt,Id as je,J as yt,Jd as fe,Kb as de,Kd as _e,La as te,M as pe,Ma as _,Na as G,Nb as Vt,O as Tt,Ob as O,Oc as rt,P as Se,Pb as we,Qa as Ze,R as N,Ra as y,Rb as Rt,S as St,Sb as $t,Ta as xe,Ua as M,Va as V,W as It,Wa as l,Wb as jt,X as J,Xa as c,Y as xt,Ya as B,Yb as it,Yc as he,Z as wt,Za as Bt,Zb as ye,Zc as Qt,_ as j,_a as Ot,_b as Ht,_c as Kt,a as ve,aa as H,ab as P,b as Oe,ba as At,bd as Ae,ca as W,cb as x,cd as Re,db as m,dd as Zt,eb as Xe,f as ae,fb as et,g as Ke,gb as ge,gc as Wt,gd as Jt,ha as Ie,hb as tt,hd as Xt,i as gt,ia as v,ib as q,j as bt,ja as E,jb as be,jd as ei,kb as k,l as Ct,lb as D,ld as ti,ma as Ft,mb as z,md as ii,n as T,na as Ye,nb as p,nd as ni,o as Le,ob as I,od as si,pb as C,pd as ri,qa as F,qb as Ee,ra as kt,rc as Ve,sc as Gt,t as Te,ta as oe,tb as Q,tc as qt,td as ai,ub as K,uc as Ut,ud as $e,vb as Y,vd as oi,w as Pe,wa as o,wb as le,x as Ne,xa as f,xb as ce,yb as Z,za as S,zb as me}from"./chunk-IFJN5CDK.js";var L=function(t){return t.Absent="absent",t.Dispensation="dispensation",t.HalfDay="half-day",t.Incident="incident",t.Present="present",t}(L||{}),Wi=(()=>{class t{constructor(e,i){this.updateService=e,this.settings=i}update(e,i,n,r,a,h){let g=[];switch(n){case L.Present:g=this.createResetBulkRequests(e);break;case L.Absent:g=this.createAbsentEditBulkRequests(e,i,r,a);break;case L.Dispensation:g=this.createEditBulkRequests(e,null,this.settings.dispensationPresenceTypeId);break;case L.HalfDay:g=this.createEditBulkRequests(e,null,this.settings.halfDayPresenceTypeId);break;case L.Incident:g=this.createEditBulkRequests(e,null,h);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(Hi(i,this.settings)),n,this.settings.absencePresenceTypeId),...this.createEditBulkRequests(e.filter(Fe(Hi(i,this.settings))),n,null)]}createResetBulkRequests(e){return lt(e).map(({lessonIds:i,personIds:n})=>this.updateService.removeLessonPresences(i,n))}createEditBulkRequests(e,i,n){return lt(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(Ei),j(he))}}static{this.\u0275prov=J({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();function Hi(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 ie=(()=>{class t extends Pi{constructor(e,i,n,r,a,h,g){super(e,i,n,r,"/edit-absences"),this.lessonPresencesService=a,this.presenceTypesService=h,this.dropDownItemsService=g,this.weekdays$=this.loadWeekdays().pipe(pe(1)),this.presenceTypes$=this.loadPresenceTypes().pipe(pe(1)),this.absenceConfirmationStates$=this.loadAbsenceConfirmationStates().pipe(T(hi),pe(1)),this.presenceControlEntries$=Le([this.entries$,this.presenceTypes$,this.absenceConfirmationStates$]).pipe(T(yi(Di)),pe(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),Li)}buildParamsFromFilter(e){return Ni(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($t),j(Ai),j(Mi),j(he),j(Ti),j(Ge),j(We))}}static{this.\u0275prov=J({token:t,factory:t.\u0275fac})}}return t})();var gn=(t,s)=>s.Key,Gi=(t,s)=>s.Id;function bn(t,s){if(t&1&&(l(0,"div",3),p(1),d(2,"translate"),c()),t&2){let e=s.$implicit;o(),C(" ",se(2,1,"global.validation-errors."+e.error,e.params)," ")}}function Cn(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 vn(t,s){if(t&1&&(l(0,"select",17),d(1,"async"),l(2,"option",18),p(3),d(4,"translate"),c(),M(5,Cn,2,2,"option",18,Gi),d(7,"async"),c()),t&2){let e,i=m(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),V(u(7,8,i.absenceTypes$))}}function En(t,s){if(t&1&&(l(0,"div",16),p(1),d(2,"translate"),c()),t&2){let e=s.$implicit;o(),C(" ",se(2,1,"global.validation-errors."+e.error,e.params)," ")}}function yn(t,s){if(t&1&&(l(0,"div",13),B(1,"input",14),l(2,"label",11),p(3),c(),b(4,vn,8,10,"select",15),M(5,En,3,4,"div",16,xe),d(7,"async"),c()),t&2){let e=s.$implicit,i=m(4);o(),_("id","state-"+e.Key)("value",e.Key),o(),ge("for","state-"+e.Key),o(),C(" ",e.Value," "),o(),y(i.isExcused(e)?4:-1),o(),V(u(7,5,i.absenceTypeIdErrors$))}}function Tn(t,s){if(t&1&&(l(0,"div",12),M(1,yn,8,7,"div",13,gn),c()),t&2){m(3);let e=Z(0);o(),V(e)}}function Sn(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 In(t,s){if(t&1&&(l(0,"div",16),p(1),d(2,"translate"),c()),t&2){let e=s.$implicit;o(),C(" ",se(2,1,"global.validation-errors."+e.error,e.params)," ")}}function xn(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(),M(6,Sn,2,2,"option",18,Gi),d(8,"async"),c(),M(9,In,3,4,"div",16,xe),d(11,"async"),c()),t&2){let e,i=m(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),V(u(8,8,i.incidents$)),o(3),V(u(11,10,i.incidentIdErrors$))}}function wn(t,s){if(t&1&&(l(0,"div",5),B(1,"input",10),l(2,"label",11),p(3),d(4,"translate"),c(),b(5,Tn,3,0,"div",12)(6,xn,12,12,"div",12),c()),t&2){let e=s.$implicit,i=m(2);o(),_("id","category-"+e)("value",e),o(),ge("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 An(t,s){t&1&&(l(0,"div",9)(1,"span",20),p(2,"Loading..."),c()())}function Fn(t,s){if(t&1){let e=P();l(0,"form",2),x("ngSubmit",function(){v(e);let n=m();return E(n.onSubmit())}),M(1,bn,3,4,"div",3,xe),d(3,"async"),l(4,"div",4),M(5,wn,7,8,"div",5,xe),c(),l(7,"div",6)(8,"button",7),d(9,"async"),x("click",function(){v(e);let n=m();return E(n.cancel())}),p(10),d(11,"translate"),c(),l(12,"button",8),d(13,"async"),p(14),d(15,"translate"),b(16,An,3,0,"div",9),d(17,"async"),c()()()}if(t&2){let e=m(),i=Z(2),n=Z(4);_("formGroup",n),o(),V(u(3,6,e.formErrors$)),o(4),V(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 qi=(()=>{class t{constructor(e,i,n,r,a,h,g,A,ee,R){this.fb=e,this.router=i,this.route=n,this.toastService=r,this.translate=a,this.state=h,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 Ke(!1),this.submitted$=new Ke(!1),this.formErrors$=He(this.formGroup$,this.submitted$),this.absenceTypeIdErrors$=He(this.formGroup$,this.submitted$,"absenceTypeId"),this.incidentIdErrors$=He(this.formGroup$,this.submitted$,"incidentId"),this.availableCategories=[L.Absent,L.Dispensation,L.HalfDay,L.Incident,L.Present],this.confirmationStates$=this.dropDownItemsService.getAbsenceConfirmationStates().pipe(T(this.sortAbsenceConfirmationStates.bind(this)),pe(1)),this.activeCategories$=this.presenceTypesService.halfDayActive$.pipe(T($=>$?this.availableCategories:this.availableCategories.filter(Ce=>Ce!==L.HalfDay))),this.destroy$=new ae}ngOnInit(){this.state.selected.length===0&&this.navigateBack(),at(this.formGroup$,"category").pipe(N(this.destroy$)).subscribe(this.updateConfirmationValueDisabled.bind(this)),at(this.formGroup$,"confirmationValue").pipe(N(this.destroy$)).subscribe(this.updateAbsenceTypeIdDisabled.bind(this))}ngOnDestroy(){this.destroy$.next()}isAbsent(e){return e===L.Absent}isExcused(e){return e.Key===this.settings.excusedAbsenceStateId}isIncident(e){return e===L.Incident}onSubmit(){this.submitted$.next(!0),this.formGroup$.pipe(ne(1)).subscribe(e=>{e.valid&&this.save(e)})}cancel(){this.navigateBack()}createFormGroup(){return this.getInitialAbsenceTypeId().pipe(T(e=>this.fb.group({category:[L.Absent,Ae.required],confirmationValue:[this.settings.excusedAbsenceStateId,Ae.required],absenceTypeId:[e,Ae.required],incidentId:[{value:null,disabled:!0},Ae.required]})),pe(1))}getInitialAbsenceTypeId(){return this.absenceTypes$.pipe(ne(1),T(e=>{let i=e.map(r=>r.Id),n=ui(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(ne(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===L.Absent?(n.enable(),this.updateAbsenceTypeIdDisabled()):(n.disable(),r.disable()),i.value===L.Incident?a.enable():a.disable())})}updateAbsenceTypeIdDisabled(){this.formGroup$.pipe(ne(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(Se(h=>this.updateService.update(this.state.selected,h,i,n,r,a)),yt(()=>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(ne(1)).subscribe(i=>{this.router.navigate(["/edit-absences"],{queryParams:Oe(ve({},Ii(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(ai),f(qt),f(Ve),f(pi),f(je),f(ie),f(We),f(Ge),f(Wi),f(he))}}static{this.\u0275cmp=H({type:t,selectors:[["bkd-edit-absences-edit"]],standalone:!0,features:[U],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&&(le(0),d(1,"async"),le(2),d(3,"async"),le(4),d(5,"async"),l(6,"h1"),p(7),d(8,"translate"),c(),l(9,"div",0),b(10,Fn,18,18,"form",1),c()),i&2){let r=ce(u(1,2,n.confirmationStates$));o(2),ce(u(3,5,n.activeCategories$)),o(2);let a=ce(u(5,8,n.formGroup$));o(3),I(u(8,11,"edit-absences.title")),o(3),y(a&&r?10:-1)}},dependencies:[$e,Xt,si,ri,Yt,ni,ei,Re,Zt,oi,ti,ii,ye,_e,fe],changeDetection:0})}}return t})();var Ue=(()=>{class t extends Ci{static{this.\u0275fac=(()=>{let e;return function(n){return(e||(e=Ft(t)))(n||t)}})()}static{this.\u0275prov=J({token:t,factory:t.\u0275fac})}}return t})();var Dn=["content"],Bn=["scroll"],On=["padding"],Qi=["*"],Be=t=>({searchTerm:t});function Ln(t,s){if(t&1&&(l(0,"div",3),Je(1,6),c()),t&2){let e=m();o(),_("ngTemplateOutlet",e.headerTemplate)("ngTemplateOutletContext",X(2,Be,e.filterValue))}}function Pn(t,s){if(t&1&&(l(0,"div",5),Je(1,6),c()),t&2){let e=m();o(),_("ngTemplateOutlet",e.footerTemplate)("ngTemplateOutletContext",X(2,Be,e.filterValue))}}var Nn=["searchInput"],Mn=["clearButton"],Vn=(t,s,e)=>({item:t,clear:s,label:e}),Rn=(t,s)=>({items:t,clear:s}),$n=(t,s,e,i)=>({item:t,item$:s,index:e,searchTerm:i});function jn(t,s){if(t&1&&(l(0,"div",20),p(1),c()),t&2){let e=m(2);o(),I(e.placeholder)}}function Hn(t,s){}function Wn(t,s){if(t&1&&b(0,jn,2,1,"ng-template",null,1,de)(2,Hn,0,0,"ng-template",19),t&2){let e=z(1),i=m();o(2),_("ngTemplateOutlet",i.placeholderTemplate||e)}}function Gn(t,s){if(t&1){let e=P();l(0,"span",23),x("click",function(){v(e);let n=m().$implicit,r=m(2);return E(r.unselect(n))}),p(1,"\xD7"),c(),B(2,"span",24)}if(t&2){let e=m().$implicit,i=m(2);o(2),_("ngItemLabel",e.label)("escape",i.escapeHTML)}}function qn(t,s){}function Un(t,s){if(t&1&&(l(0,"div",22),b(1,Gn,3,2,"ng-template",null,2,de)(3,qn,0,0,"ng-template",12),c()),t&2){let e=s.$implicit,i=z(2),n=m(2);G("ng-value-disabled",e.disabled),o(3),_("ngTemplateOutlet",n.labelTemplate||i)("ngTemplateOutletContext",Nt(4,Vn,e.value,n.clearItem,e.label))}}function zn(t,s){if(t&1&&M(0,Un,4,8,"div",21,Ze().trackByOption,!0),t&2){let e=m();V(e.selectedItems)}}function Qn(t,s){}function Kn(t,s){if(t&1&&b(0,Qn,0,0,"ng-template",12),t&2){let e=m();_("ngTemplateOutlet",e.multiLabelTemplate)("ngTemplateOutletContext",Pt(2,Rn,e.selectedValues,e.clearItem))}}function Yn(t,s){t&1&&B(0,"div",25)}function Zn(t,s){}function Jn(t,s){if(t&1&&b(0,Yn,1,0,"ng-template",null,3,de)(2,Zn,0,0,"ng-template",19),t&2){let e=z(1),i=m();o(2),_("ngTemplateOutlet",i.loadingSpinnerTemplate||e)}}function Xn(t,s){if(t&1&&(l(0,"span",15,4)(2,"span",26),p(3,"\xD7"),c()()),t&2){let e=m();ge("title",e.clearAllText)}}function es(t,s){if(t&1&&B(0,"span",31),t&2){let e=m().$implicit,i=m(2);_("ngItemLabel",e.label)("escape",i.escapeHTML)}}function ts(t,s){}function is(t,s){if(t&1){let e=P();l(0,"div",30),x("click",function(){let n=v(e).$implicit,r=m(2);return E(r.toggleItem(n))})("mouseover",function(){let n=v(e).$implicit,r=m(2);return E(r.onItemHover(n))}),b(1,es,1,2,"ng-template",null,5,de)(3,ts,0,0,"ng-template",12),c()}if(t&2){let e=s.$implicit,i=z(2),n=m(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),te("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",Mt(17,$n,e.value,e,e.index,n.searchTerm))}}function ns(t,s){if(t&1&&(l(0,"span")(1,"span",33),p(2),c(),p(3),c()),t&2){let e=m(3);o(2),I(e.addTagText),o(),C('"',e.searchTerm,'"')}}function ss(t,s){}function rs(t,s){if(t&1){let e=P();l(0,"div",32),x("mouseover",function(){v(e);let n=m(2);return E(n.itemsList.unmarkItem())})("click",function(){v(e);let n=m(2);return E(n.selectTag())}),b(1,ns,4,2,"ng-template",null,6,de)(3,ss,0,0,"ng-template",12),c()}if(t&2){let e=z(2),i=m(2);G("ng-option-marked",!i.itemsList.markedItem),o(3),_("ngTemplateOutlet",i.tagTemplate||e)("ngTemplateOutletContext",X(4,Be,i.searchTerm))}}function as(t,s){if(t&1&&(l(0,"div",34),p(1),c()),t&2){let e=m(3);o(),I(e.notFoundText)}}function os(t,s){}function ls(t,s){if(t&1&&b(0,as,2,1,"ng-template",null,7,de)(2,os,0,0,"ng-template",12),t&2){let e=z(1),i=m(2);o(2),_("ngTemplateOutlet",i.notFoundTemplate||e)("ngTemplateOutletContext",X(2,Be,i.searchTerm))}}function cs(t,s){if(t&1&&(l(0,"div",34),p(1),c()),t&2){let e=m(3);o(),I(e.typeToSearchText)}}function ds(t,s){}function us(t,s){if(t&1&&b(0,cs,2,1,"ng-template",null,8,de)(2,ds,0,0,"ng-template",19),t&2){let e=z(1),i=m(2);o(2),_("ngTemplateOutlet",i.typeToSearchTemplate||e)}}function ps(t,s){if(t&1&&(l(0,"div",34),p(1),c()),t&2){let e=m(3);o(),I(e.loadingText)}}function ms(t,s){}function hs(t,s){if(t&1&&b(0,ps,2,1,"ng-template",null,9,de)(2,ms,0,0,"ng-template",12),t&2){let e=z(1),i=m(2);o(2),_("ngTemplateOutlet",i.loadingTextTemplate||e)("ngTemplateOutletContext",X(2,Be,i.searchTerm))}}function fs(t,s){if(t&1){let e=P();l(0,"ng-dropdown-panel",27),x("update",function(n){v(e);let r=m();return E(r.viewPortItems=n)})("scroll",function(n){v(e);let r=m();return E(r.scroll.emit(n))})("scrollToEnd",function(n){v(e);let r=m();return E(r.scrollToEnd.emit(n))})("outsideClick",function(){v(e);let n=m();return E(n.close())}),Bt(1),M(2,is,4,22,"div",28,Ze().trackByOption,!0),b(4,rs,4,6,"div",29),Ot(),b(5,ls,3,4)(6,us,3,1)(7,hs,3,4),c()}if(t&2){let e=m();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),o(2),V(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 Ki=/[&<>"']/g,_s=RegExp(Ki.source),gs={"&":"&","<":"<",">":">",'"':""","'":"'"};function bs(t){return t&&_s.test(t)?t.replace(Ki,s=>gs[s]):t}function w(t){return t!=null}function De(t){return typeof t=="object"&&w(t)}function Cs(t){return t instanceof Promise}function Qe(t){return t instanceof Function}var vs=(()=>{class t{constructor(e){this.element=e,this.escape=!0}ngOnChanges(e){this.element.nativeElement.innerHTML=this.escape?bs(this.ngItemLabel):this.ngItemLabel}static{this.\u0275fac=function(i){return new(i||t)(f(oe))}}static{this.\u0275dir=W({type:t,selectors:[["","ngItemLabel",""]],inputs:{ngItemLabel:"ngItemLabel",escape:"escape"},standalone:!0,features:[Ie]})}}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-option-tmp",""]],standalone:!0})}}return t})(),ft=(()=>{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",""]],standalone:!0})}}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-label-tmp",""]],standalone:!0})}}return t})(),_t=(()=>{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",""]],standalone:!0})}}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-header-tmp",""]],standalone:!0})}}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-footer-tmp",""]],standalone:!0})}}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-notfound-tmp",""]],standalone:!0})}}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-placeholder-tmp",""]],standalone:!0})}}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-typetosearch-tmp",""]],standalone:!0})}}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-loadingtext-tmp",""]],standalone:!0})}}return t})(),As=(()=>{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",""]],standalone:!0})}}return t})(),Fs=(()=>{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",""]],standalone:!0})}}return t})();function Yi(){return"axxxxxxxxxxx".replace(/[x]/g,()=>(Math.random()*16|0).toString(16))}var ks={"\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 ze(t){let s=e=>ks[e]||e;return t.replace(/[^\u0000-\u007E]/g,s)}var pt=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=ze(s).toLocaleLowerCase(),this.filteredItems.find(e=>ze(e.label).toLocaleLowerCase().substr(0,s.length)===s)}filter(s){if(!s){this.resetFilteredItems();return}this._filteredItems=[],s=this._ngSelect.searchFn?s:ze(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 h=this._ngSelect.searchFn?a.value:a;e(s,h)&&r.push(a)}if(r.length>0){let[a]=r.slice(-1);if(a.parent){let h=this._items.find(g=>g===a.parent);this._filteredItems.push(h)}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(!De(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 ze(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 h=(a.value[e]||[]).map((g,A)=>this.mapItem(g,A));i.set(a,h)}return i}let n=Qe(this._ngSelect.groupBy),r=a=>{let h=n?e(a.value):a.value[e];return w(h)?h:void 0};for(let a of s){let h=r(a),g=i.get(h);g?g.push(a):i.set(h,[a])}return i}_flatten(s){let e=Qe(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=De(n),h={label:a?"":String(n),children:void 0,parent:null,index:r++,disabled:!this._ngSelect.selectableGroup,htmlId:Yi()},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=h,R.children=void 0,R.index=r++,R));h.children=ee,h.value=A(n,ee.map(R=>R.value)),i.push(h),i.push(...ee)}return i}},re=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}(re||{}),Zi=(()=>{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)),Ce=r.itemHeight*Math.ceil($)-r.itemHeight*Math.min($,n);return Ce=isNaN(Ce)?0:Ce,$=isNaN($)?-1:$,A=isNaN(A)?-1:A,$-=n,$=Math.max(0,$),A+=n,A=Math.min(i,A),{topPadding:Ce,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,h=n,g=h+r;return r>=a&&n===e?null:a>g?h+a-g:e<=h?e:null}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=J({token:t,factory:t.\u0275fac})}}return t})(),Ui=["top","right","bottom","left"],Ds=typeof requestAnimationFrame<"u"?bt:gt,zi=(()=>{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 ae,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}`),h=i?a.offsetTop:this._lastScrollPosition;r=this._panelService.getScrollTo(a.offsetTop,a.clientHeight,h)}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),Ui.includes(this._currentPosition)?this._updateDropdownClass(this._currentPosition):this._updateDropdownClass("bottom"),this.appendTo&&this._updateYPosition(),this._dropdown.style.opacity="1"}_updateDropdownClass(e){Ui.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(()=>{Te(this.scrollElementRef.nativeElement,"scroll").pipe(N(this._destroy$),vt(0,Ds)).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(()=>{Pe(Te(this._document,"touchstart",{capture:!0}),Te(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,h=e.getBoundingClientRect().height;return r+a+h>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(()=>{Te(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(Dt),f(kt),f(Zi),f(oe),f(Rt,8))}}static{this.\u0275cmp=H({type:t,selectors:[["ng-dropdown-panel"]],viewQuery:function(i,n){if(i&1&&(be(Dn,7,oe),be(Bn,7,oe),be(On,7,oe)),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",O],headerTemplate:"headerTemplate",footerTemplate:"footerTemplate",filterValue:"filterValue"},outputs:{update:"update",scroll:"scroll",scrollToEnd:"scrollToEnd",outsideClick:"outsideClick"},standalone:!0,features:[Me,Ie,U],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&&(Xe(),b(0,Ln,2,4,"div",3),l(1,"div",4,0),B(3,"div",null,1),l(5,"div",null,2),et(7),c()(),b(8,Pn,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:[it],encapsulation:2,changeDetection:0})}}return t})(),Bs=(()=>{class t{constructor(e){this.elementRef=e,this.disabled=!1,this.stateChange$=new ae}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(oe))}}static{this.\u0275cmp=H({type:t,selectors:[["ng-option"]],inputs:{value:"value",disabled:[2,"disabled","disabled",O]},standalone:!0,features:[Me,Ie,U],ngContentSelectors:Qi,decls:1,vars:0,template:function(i,n){i&1&&(Xe(),et(0))},encapsulation:2,changeDetection:0})}}return t})();function Ji(){return new mt}var mt=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)}},Os=(()=>{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=J({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=J({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})(),Xi=new wt("ng-select-selection-model"),en=(()=>{class t{constructor(e,i,n,r,a,h,g){this.classes=e,this.autoFocus=i,this.config=n,this._cd=h,this._console=g,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=Yi(),this.escapeHTML=!0,this._defaultLabel="label",this._pressedKeys=[],this._isComposing=!1,this._destroy$=new ae,this._keyPress$=new ae,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 pt(this,r?r():Ji()),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&&!Qe(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(re[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 re.ArrowDown:this._handleArrowDown(e);break;case re.ArrowUp:this._handleArrowUp(e);break;case re.Space:this._handleSpace(e);break;case re.Enter:this._handleEnter(e);break;case re.Tab:this._handleTab(e);break;case re.Esc:this.close(),e.preventDefault();break;case re.Backspace:this._handleBackspace();break}}handleKeyCodeClear(e){switch(e.which){case re.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;Qe(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);Cs(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)?!De(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=Pe(this.ngOptions.changes,this._destroy$);Pe(...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(Tt(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)&&De(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=De(n),h=!a&&!this.bindValue;a||h?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$),St(e=>this._pressedKeys.push(e)),Et(200),Ne(()=>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=ve({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)(Ye("class"),Ye("autofocus"),f(Os),f(Xi,8),f(oe),f(Vt),f(Ls))}}static{this.\u0275cmp=H({type:t,selectors:[["ng-select"]],contentQueries:function(i,n,r){if(i&1&&(q(r,ht,5,S),q(r,ft,5,S),q(r,Es,5,S),q(r,_t,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,As,5,S),q(r,Fs,5,S),q(r,Bs,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&&(be(zi,5),be(Nn,7),be(Mn,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:{bindLabel:"bindLabel",bindValue:"bindValue",ariaLabel:"ariaLabel",markFirst:[2,"markFirst","markFirst",O],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",O],closeOnSelect:[2,"closeOnSelect","closeOnSelect",O],hideSelected:[2,"hideSelected","hideSelected",O],selectOnTab:[2,"selectOnTab","selectOnTab",O],openOnEnter:[2,"openOnEnter","openOnEnter",O],maxSelectedItems:[2,"maxSelectedItems","maxSelectedItems",we],groupBy:"groupBy",groupValue:"groupValue",bufferAmount:[2,"bufferAmount","bufferAmount",we],virtualScroll:[2,"virtualScroll","virtualScroll",O],selectableGroup:[2,"selectableGroup","selectableGroup",O],selectableGroupAsModel:[2,"selectableGroupAsModel","selectableGroupAsModel",O],searchFn:"searchFn",trackByFn:"trackByFn",clearOnBackspace:[2,"clearOnBackspace","clearOnBackspace",O],labelForId:"labelForId",inputAttrs:"inputAttrs",tabIndex:[2,"tabIndex","tabIndex",we],readonly:[2,"readonly","readonly",O],searchWhileComposing:[2,"searchWhileComposing","searchWhileComposing",O],minTermLength:[2,"minTermLength","minTermLength",we],editableSearchTerm:[2,"editableSearchTerm","editableSearchTerm",O],ngClass:"ngClass",typeahead:"typeahead",multiple:[2,"multiple","multiple",O],addTag:"addTag",searchable:[2,"searchable","searchable",O],clearable:[2,"clearable","clearable",O],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"},standalone:!0,features:[me([{provide:Qt,useExisting:It(()=>t),multi:!0},Zi]),Me,Ie,U],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","aria-label","Options list",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","aria-label","Options list",1,"ng-dropdown-panel",3,"update","scroll","scrollToEnd","outsideClick","virtualScroll","bufferAmount","appendTo","position","headerTemplate","footerTemplate","filterValue","items","markedItem","ngClass","id"],[1,"ng-option",3,"ng-option-disabled","ng-option-selected","ng-optgroup","ng-option","ng-option-child","ng-option-marked"],["role","option",1,"ng-option",3,"ng-option-marked"],[1,"ng-option",3,"click","mouseover"],[1,"ng-option-label",3,"ngItemLabel","escape"],["role","option",1,"ng-option",3,"mouseover","click"],[1,"ng-tag-label"],[1,"ng-option","ng-option-disabled"]],template:function(i,n){if(i&1){let r=P();l(0,"div",10),x("mousedown",function(h){return v(r),E(n.handleMousedown(h))}),l(1,"div",11),b(2,Wn,3,1)(3,zn,2,0)(4,Kn,1,5,null,12),l(5,"div",13)(6,"input",14,0),x("blur",function(h){return v(r),E(n.onInputBlur(h))})("change",function(h){return v(r),E(h.stopPropagation())})("compositionend",function(){v(r);let h=z(7);return E(n.onCompositionEnd(h.value))})("compositionstart",function(){return v(r),E(n.onCompositionStart())})("focus",function(h){return v(r),E(n.onInputFocus(h))})("input",function(){v(r);let h=z(7);return E(n.filter(h.value))}),c()()(),b(8,Jn,3,1)(9,Xn,4,1,"span",15),l(10,"span",16),B(11,"span",17),c()(),b(12,fs,8,17,"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:""),te("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:[it,vs,zi,jt],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})(),tn=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=At({type:t})}static{this.\u0275inj=xt({providers:[{provide:Xi,useValue:Ji}]})}}return t})();var Ns=(t,s)=>s.Key;function Ms(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=m().clear;return E(r(n))}),p(3,"\xD7"),c()()}if(t&2){let e=s.$implicit;o(),C(" ",e.Value," ")}}function Vs(t,s){if(t&1&&M(0,Ms,4,1,"div",4,Ns),t&2){let e=s.items;V(e)}}function Rs(t,s){if(t&1&&(B(0,"input",6),p(1)),t&2){let e=s.item,i=s.item$,n=s.index;tt("id","item-",n,""),_("ngModel",i.selected),o(),C(" ",e.Group," ")}}function $s(t,s){if(t&1&&(B(0,"input",6),p(1)),t&2){let e=s.item,i=s.item$,n=s.index;tt("id","item-",n,""),_("ngModel",i.selected),o(),C(" ",e.Value," ")}}var nn=(()=>{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"},standalone:!0,features:[U],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"),Y("ngModelChange",function(a){return K(n.values,a)||(n.values=a),a}),x("click",function(){return n.itemsChanged()})("clear",function(){return n.itemsChanged()}),b(2,Vs,2,0,"ng-template",1)(3,Rs,2,4,"ng-template",2)(4,$s,2,4,"ng-template",3),c()),i&2&&(ge("placeholder",u(1,8,"shared.select.empty-option")),_("items",n.options)("multiple",!0)("selectableGroup",!0)("selectableGroupAsModel",!1)("closeOnSelect",!1),Q("ngModel",n.values),_("clearable",!0))},dependencies:[tn,en,ft,ht,_t,$e,Kt,Re,Jt,_e,fe]})}}return t})();var sn=zt({HRef:nt,Id:st,TeacherId:st,FullName:nt});var rn=(()=>{class t extends xi{constructor(e,i){super(e,i,sn,"TeacherResources","FullName","FullName")}getTypeaheadItemByKey(e){return this.http.get(`${this.baseUrl}/`,{params:{fields:[this.keyAttr,this.labelAttr].join(","),[`filter.${this.labelAttr}`]:`~*${e}*`}}).pipe(Se(mi(this.typeaheadCodec)),Se(i=>Ct({Key:i[0].FullName,Value:`${i[0].FullName}`})))}static{this.\u0275fac=function(i){return new(i||t)(j(Wt),j(he))}}static{this.\u0275prov=J({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var on=(()=>{class t{constructor(e,i,n,r,a,h){this.studentsService=e,this.educationalEventsService=i,this.studyClassService=n,this.teacherResourcesService=r,this.state=a,this.translate=h,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=>ke(g,this.translate.instant("shared.multiselect.all-option")))),this.absenceConfirmationStatesGrouped$=this.state.absenceConfirmationStates$.pipe(T(g=>ke(g,this.translate.instant("shared.multiselect.all-option")))),this.presenceTypesGrouped$=this.state.presenceTypes$.pipe(T(g=>g.filter(Fe(bi)).filter(Fe(ot))),T(ct),T(dt),T(g=>ke(g,this.translate.instant("shared.multiselect.all-option")))),this.incidentTypesGrouped$=this.state.presenceTypes$.pipe(T(g=>g.filter(ot)),T(ct),T(dt),T(g=>ke(g,this.translate.instant("shared.multiselect.all-option")))),this.classesHttpFilter={params:{fields:"IsActive","filter.IsActive":"=true"}}}show(){this.filterChange.emit(Oe(ve({},this.filter),{dateFrom:an(this.filter.dateFrom),dateTo:an(this.filter.dateTo)}))}static{this.\u0275fac=function(i){return new(i||t)(f(wi),f($i),f(ji),f(rn),f(ie),f(je))}}static{this.\u0275cmp=H({type:t,selectors:[["bkd-edit-absences-header"]],inputs:{filter:"filter"},outputs:{filterChange:"filterChange"},standalone:!0,features:[me([{provide:li,useClass:di},{provide:ci,useClass:Bi}]),U],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),Y("valueChange",function(a){return K(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),Y("valueChange",function(a){return K(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),Y("valueChange",function(a){return K(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),Y("valueChange",function(a){return K(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),Y("valueChange",function(a){return K(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),Y("valueChange",function(a){return K(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"),Y("valuesChange",function(a){return K(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"),Y("valuesChange",function(a){return K(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"),Y("valuesChange",function(a){return K(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"),Y("valuesChange",function(a){return K(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),Q("value",n.filter.student),o(3),I(u(9,32,"edit-absences.header.module-instance")),o(2),_("typeaheadService",n.educationalEventsService),Q("value",n.filter.educationalEvent),o(3),I(u(14,34,"edit-absences.header.study-class")),o(2),_("typeaheadService",n.studyClassService),Q("value",n.filter.studyClass),_("additionalHttpParams",n.classesHttpFilter),o(3),I(u(19,36,"edit-absences.header.teacher")),o(2),_("typeaheadService",n.teacherResourcesService),Q("value",n.filter.teacher),o(3),I(u(24,38,"edit-absences.header.date-from")),o(2),Q("value",n.filter.dateFrom),o(3),I(u(29,40,"edit-absences.header.date-to")),o(2),Q("value",n.filter.dateTo),o(3),I(u(34,42,"edit-absences.header.weekdays")),o(2),_("options",u(36,44,n.weekdaysGrouped$)),Q("values",n.filter.weekdays),o(5),I(u(41,46,"edit-absences.header.confirmation-state")),o(2),_("options",u(43,48,n.absenceConfirmationStatesGrouped$)),Q("values",n.filter.confirmationStates),o(4),I(u(47,50,"edit-absences.header.presence-type")),o(2),_("options",u(49,52,n.presenceTypesGrouped$)),Q("values",n.filter.presenceTypes),o(4),I(u(53,54,"edit-absences.header.incident")),o(2),_("options",u(55,56,n.incidentTypesGrouped$)),Q("values",n.filter.incidentTypes),o(4),C(" ",u(59,58,"edit-absences.header.show")," "))},dependencies:[ki,Ri,nn,ye,_e,fe],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;padding:0 1rem 1rem 0;border-bottom:1px solid #dee2e6}"],changeDetection:0})}}return t})();function an(t){return t?gi(t):null}var Hs=(t,s)=>s.id,Ws=()=>[],ln=t=>({count:t}),cn=t=>({returnparams:t}),Gs=t=>["student",t,"absences"];function qs(t,s){t&1&&B(0,"bkd-spinner")}function Us(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=m(4),i=Z(0);o(2),Ee(" ",se(4,7,"edit-absences.list.total",X(15,ln,u(3,5,e.state.total$)||0)),", ",se(5,10,"edit-absences.list.selected",X(17,ln,i.length))," "),o(4),G("disabled",i.length===0),_("queryParams",X(19,cn,u(7,13,e.state.queryParamsString$)))}}function zs(t,s){if(t&1){let e=P();l(0,"tr")(1,"td",14),x("click",function(n){v(e);let r=z(3),a=m(5);return E(a.onCheckboxCellClick(n,r))}),l(2,"input",12,0),d(4,"async"),x("change",function(){let n=v(e).$implicit,r=m(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(),B(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=m(5);o(2),_("checked",u(4,21,i.selectionService.isSelected$(e.lessonPresence))),o(3),te("data-label",u(6,23,"edit-absences.list.header.presence")),o(2),_("className",e.presenceCategory),o(2),I(e.presenceCategoryIcon),o(),te("data-label",u(11,25,"edit-absences.list.header.mobil-student-module-instance-study-class")),o(2),_("routerLink",X(48,Gs,e.lessonPresence.StudentRef.Id))("queryParams",X(50,cn,u(13,27,i.profileReturnParams$))),o(2),C(" ",e.lessonPresence.StudentFullName," "),o(2),Ee(" ",e.lessonPresence.EventDesignation,", ",e.lessonPresence.StudyClassNumber," "),o(),te("data-label",u(18,29,"edit-absences.list.header.date")),o(2),C(" ",se(20,31,e.lessonPresence.LessonDateTimeFrom,"mediumDate")," "),o(2),te("data-label",u(22,34,"edit-absences.list.header.time")),o(2),Ee(" ",se(24,36,e.lessonPresence.LessonDateTimeFrom,"shortTime"),"\u2013",se(25,39,e.lessonPresence.LessonDateTimeTo,"shortTime")," "),o(3),te("data-label",u(27,42,"edit-absences.list.header.confirmation-state")),o(2),C(" ",e.confirmationState==null?null:e.confirmationState.Value," "),o(),te("data-label",u(30,44,"edit-absences.list.header.mobil-presence-type-incident")),o(2),C(" ",e.presenceType==null?null:e.presenceType.Designation," "),o(),te("data-label",u(33,46,"edit-absences.list.header.teacher")),o(2),C(" ",e.lessonPresence.TeacherInformation," ")}}function Qs(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=m(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"),B(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"),M(32,zs,35,52,"tr",null,Hs),c()()}if(t&2){m(4);let e=Z(0),i=Z(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),Ee(" ",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),Ee(" ",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),V(i)}}function Ks(t,s){t&1&&B(0,"bkd-spinner",7)}function Ys(t,s){if(t&1){let e=P();l(0,"button",18),x("click",function(){v(e);let n=m(4);return E(n.state.nextPage())}),p(1),d(2,"translate"),c()}t&2&&(o(),C(" ",u(2,1,"global.pagination.load-more")," "))}function Zs(t,s){if(t&1){let e=P();l(0,"div",4),x("scrolled",function(){v(e);let n=m(3);return E(n.onScroll())}),b(1,Us,10,21,"div",5)(2,Qs,34,31,"table",6)(3,Ks,1,0,"bkd-spinner",7)(4,Ys,3,3,"button",8),c()}if(t&2){m(3);let e=Z(2),i=Z(4),n=Z(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 Js(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 Xs(t,s){if(t&1&&b(0,Zs,5,4,"div",3)(1,Js,3,3,"p",2),t&2){m(2);let e=Z(2),i=Z(6);y(e&&e.length>0||i?0:1)}}function er(t,s){if(t&1&&(b(0,qs,1,0,"bkd-spinner"),d(1,"async"),b(2,Xs,2,1)),t&2){let e=m();y(u(1,1,e.state.loading$)?0:2)}}function tr(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 dn=(()=>{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(ir)),this.profileReturnParams$=this.state.queryParamsString$,this.destroy$=new ae}ngOnInit(){this.filterFromParams$.pipe(ne(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(ne(1),T(({reload:e})=>e),Ne(fi)).subscribe(()=>this.state.resetEntries())}ngAfterViewInit(){this.scrollPosition.restore()}ngOnDestroy(){this.destroy$.next()}toggleAll(e){this.state.entries$.pipe(ne(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(ie),f(Ue),f(Oi),f(Ve))}}static{this.\u0275cmp=H({type:t,selectors:[["bkd-edit-absences-list"]],standalone:!0,features:[me([Ue]),U],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();le(0),d(1,"async"),le(2),d(3,"async"),le(4),d(5,"async"),le(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(h){return v(r),E(n.state.setFilter(h))}),c(),b(13,er,3,3),d(14,"async"),b(15,tr,3,3,"p",2)}if(i&2){let r;ce((r=u(1,3,n.selectionService.selection$))!==null&&r!==void 0?r:Lt(21,Ws)),o(2),ce(u(3,6,n.state.presenceControlEntries$)),o(2),ce(u(5,9,n.state.hasMore$)),o(2),ce(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:[on,Vi,Ut,Si,ye,Ht,_e,fe],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 ir(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?rt(t.dateFrom):null,dateTo:t.dateTo?rt(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 un=(()=>{class t{constructor(e){this.state=e}static{this.\u0275fac=function(i){return new(i||t)(f(ie))}}static{this.\u0275cmp=H({type:t,selectors:[["bkd-edit-absences"]],standalone:!0,features:[me([ie,{provide:_i,useExisting:ie},vi]),U],decls:1,vars:0,template:function(i,n){i&1&&B(0,"router-outlet")},dependencies:[Gt],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var uo=[{path:"",component:un,children:[{path:"",component:dn,data:{restoreScrollPositionFrom:["/edit-absences/edit","/edit-absences/student/:id/addresses","/edit-absences/student/:id/absences","/edit-absences/student/:id/grades"]}},{path:"edit",component:qi},Fi]}];export{uo as EDIT_ABSENCES_ROUTES}; diff --git a/public/apps/webapp-schulverwaltung/chunk-EQCBS6DP.js b/public/apps/webapp-schulverwaltung/chunk-R6T5CAET.js similarity index 99% rename from public/apps/webapp-schulverwaltung/chunk-EQCBS6DP.js rename to public/apps/webapp-schulverwaltung/chunk-R6T5CAET.js index 424b2016..88b0fbe5 100644 --- a/public/apps/webapp-schulverwaltung/chunk-EQCBS6DP.js +++ b/public/apps/webapp-schulverwaltung/chunk-R6T5CAET.js @@ -1,2 +1,2 @@ -import{b as ne}from"./chunk-NTSKCSYH.js";import{a as Ze}from"./chunk-DYBK5FKC.js";import{a as Ye}from"./chunk-24TK3FB4.js";import"./chunk-7VKKHU7R.js";import{p as We}from"./chunk-LLGOVPQJ.js";import"./chunk-2H6IFZM2.js";import{e as te}from"./chunk-QOR23F4L.js";import{b as Ge}from"./chunk-7FRZV7VF.js";import"./chunk-Y4QYVF5K.js";import"./chunk-OFB4XAK2.js";import{b as Ve,d as U,e as Ke}from"./chunk-VUPOI3TG.js";import"./chunk-WACRWBCS.js";import"./chunk-MIRGHONI.js";import"./chunk-YUHFF3NM.js";import{L as He,b as Ne,g as pe,p as ze,q as Ue}from"./chunk-H6G6Q6V6.js";import"./chunk-NL5E3FC5.js";import{b as qe}from"./chunk-YD3RJIHU.js";import{a as ee,b as ie}from"./chunk-KK2SHN2W.js";import{u as Fe}from"./chunk-AP373D4K.js";import"./chunk-B6WYZ7BT.js";import{$a as se,Ab as x,Bb as F,Cc as Re,Cd as Le,Dc as Oe,Dd as we,Gb as o,Gd as Be,Ha as p,Hb as r,Ib as O,Ic as X,Jd as E,Kb as Me,Kd as A,La as re,Ld as je,M as y,Ma as _,Na as ge,O as fe,P as M,Ra as m,Ua as ve,Va as ye,Wa as d,X as N,Xa as c,Ya as g,Yb as $e,Yc as k,Zb as w,_ as T,_b as J,a as q,aa as S,ab as Se,b as K,cb as z,cc as le,d as he,da as _e,db as f,eb as xe,fb as Te,g as be,gc as Q,h as ue,ia as Y,ja as Z,ka as Ce,l as L,lc as Ie,mb as ce,n as u,nb as l,o as W,ob as P,pb as D,qb as de,rb as De,sc as ke,tc as Ee,uc as Ae,va as B,wa as a,wb as j,xa as C,xb as V,yb as G,zb as Pe}from"./chunk-IFJN5CDK.js";var ut=["*"];function ft(e,s){e&1&&se(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=ce(3);_("routerLink",t.link)("queryParams",t.linkParams),a(),_("ngTemplateOutlet",i)}}function Ct(e,s){e&1&&se(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=ce(3);_("href",t.externalLink,B),a(),_("ngTemplateOutlet",i)}}function vt(e,s){if(e&1&&(d(0,"span",5),l(1),c()),e&2){let t=f(2);a(),P(t.count)}}function yt(e,s){e&1&&(Ce(),d(0,"svg",6),g(1,"path",7),c())}function St(e,s){if(e&1&&(d(0,"span",4),l(1),o(2,"translate"),c(),d(3,"div"),Te(4),p(5,vt,2,1,"span",5)(6,yt,2,0,":svg:svg",6),c()),e&2){let t=f();a(),P(r(2,2,t.label)),a(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"},standalone:!0,features:[x],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,n){i&1&&(xe(),p(0,_t,2,3,"a",1)(1,gt,2,2,"a",2)(2,St,7,4,"ng-template",null,0,Me)),i&2&&(m(n.externalLink?-1:0),a(),m(n.externalLink?1:-1))},dependencies:[Ae,$e,A,E],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"},standalone:!0,features:[x],decls:3,vars:8,template:function(i,n){i&1&&(l(0),o(1,"translate"),o(2,"addSpace")),i&2&&De("",r(1,3,"dashboard.actions.deadline"),"",O(2,5,": ",":"),"",n.count,` +import{b as ne}from"./chunk-NTSKCSYH.js";import{a as Ze}from"./chunk-DYBK5FKC.js";import{a as Ye}from"./chunk-HAT2K5YI.js";import"./chunk-4YGUAC2V.js";import{p as We}from"./chunk-LLGOVPQJ.js";import"./chunk-2H6IFZM2.js";import{e as te}from"./chunk-QOR23F4L.js";import{b as Ge}from"./chunk-7FRZV7VF.js";import"./chunk-Y4QYVF5K.js";import"./chunk-OFB4XAK2.js";import{b as Ve,d as U,e as Ke}from"./chunk-VUPOI3TG.js";import"./chunk-WACRWBCS.js";import"./chunk-MIRGHONI.js";import"./chunk-YUHFF3NM.js";import{L as He,b as Ne,g as pe,p as ze,q as Ue}from"./chunk-H6G6Q6V6.js";import"./chunk-NL5E3FC5.js";import{b as qe}from"./chunk-YD3RJIHU.js";import{a as ee,b as ie}from"./chunk-KK2SHN2W.js";import{u as Fe}from"./chunk-AP373D4K.js";import"./chunk-B6WYZ7BT.js";import{$a as se,Ab as x,Bb as F,Cc as Re,Cd as Le,Dc as Oe,Dd as we,Gb as o,Gd as Be,Ha as p,Hb as r,Ib as O,Ic as X,Jd as E,Kb as Me,Kd as A,La as re,Ld as je,M as y,Ma as _,Na as ge,O as fe,P as M,Ra as m,Ua as ve,Va as ye,Wa as d,X as N,Xa as c,Ya as g,Yb as $e,Yc as k,Zb as w,_ as T,_b as J,a as q,aa as S,ab as Se,b as K,cb as z,cc as le,d as he,da as _e,db as f,eb as xe,fb as Te,g as be,gc as Q,h as ue,ia as Y,ja as Z,ka as Ce,l as L,lc as Ie,mb as ce,n as u,nb as l,o as W,ob as P,pb as D,qb as de,rb as De,sc as ke,tc as Ee,uc as Ae,va as B,wa as a,wb as j,xa as C,xb as V,yb as G,zb as Pe}from"./chunk-IFJN5CDK.js";var ut=["*"];function ft(e,s){e&1&&se(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=ce(3);_("routerLink",t.link)("queryParams",t.linkParams),a(),_("ngTemplateOutlet",i)}}function Ct(e,s){e&1&&se(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=ce(3);_("href",t.externalLink,B),a(),_("ngTemplateOutlet",i)}}function vt(e,s){if(e&1&&(d(0,"span",5),l(1),c()),e&2){let t=f(2);a(),P(t.count)}}function yt(e,s){e&1&&(Ce(),d(0,"svg",6),g(1,"path",7),c())}function St(e,s){if(e&1&&(d(0,"span",4),l(1),o(2,"translate"),c(),d(3,"div"),Te(4),p(5,vt,2,1,"span",5)(6,yt,2,0,":svg:svg",6),c()),e&2){let t=f();a(),P(r(2,2,t.label)),a(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"},standalone:!0,features:[x],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,n){i&1&&(xe(),p(0,_t,2,3,"a",1)(1,gt,2,2,"a",2)(2,St,7,4,"ng-template",null,0,Me)),i&2&&(m(n.externalLink?-1:0),a(),m(n.externalLink?1:-1))},dependencies:[Ae,$e,A,E],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"},standalone:!0,features:[x],decls:3,vars:8,template:function(i,n){i&1&&(l(0),o(1,"translate"),o(2,"addSpace")),i&2&&De("",r(1,3,"dashboard.actions.deadline"),"",O(2,5,": ",":"),"",n.count,` `)},dependencies:[A,E,Ke],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=X({Id:Oe,Holder:Re});var et=(()=>{class e extends ee{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)(T(Q),T(k))}}static{this.\u0275prov=N({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var $t=["LessonTeacherRole","ClassTeacherRole","TeacherRole","AbsenceAdministratorRole"],It=["LessonTeacherRole","TeacherRole","StudentRole","SubstituteAdministratorRole"],kt=["LessonTeacherRole","StudentRole"],R=(()=>{class e{constructor(t,i,n,h,b,$,H,bt){this.settingsService=t,this.lessonPresencesService=i,this.studentsService=n,this.courseService=h,this.teacherSubstitutionService=b,this.personService=$,this.storageService=H,this.settings=bt,this.rolesAndPermissions$=this.settingsService.getRolesAndPermissions(),this.userId$=new ue(1),this.lessonAbsences$=this.userId$.pipe(M(v=>this.studentsService.getLessonAbsences(v)),y(1)),this.lessonIncidents$=this.userId$.pipe(M(v=>this.studentsService.getLessonIncidents(v)),y(1)),this.loading$=this.rolesAndPermissions$.pipe(u(v=>v==null)),this.hasSearch$=this.rolesAndPermissions$.pipe(u(this.hasRoles($t))),this.hasActions$=this.rolesAndPermissions$.pipe(u(this.hasRoles(It))),this.hasTimetable$=this.rolesAndPermissions$.pipe(u(this.hasRoles(kt))),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(M(v=>v?this.lessonPresencesService.checkableAbsencesCount():L(!1)),y(1)),this.openAbsencesCount$=this.rolesAndPermissions$.pipe(u(this.hasRoles(["LessonTeacherRole","ClassTeacherRole"])),M(v=>v?this.lessonPresencesService.getListOfUnconfirmed():L([])),u(v=>v.length),y(1)),this.myAbsencesCount$=this.hasStudentRole$.pipe(M(v=>v?this.getMyAbsences():L([])),u(this.getMyAbsencesCount.bind(this)),y(1)),this.coursesToRateCount$=this.courseService.getNumberOfCoursesForRating().pipe(fe(0),y(1)),this.hasPresenceControl$=this.hasLessonTeacherRole$.pipe(M(v=>v?this.lessonPresencesService.hasLessonsLessonTeacher():L(!1)),y(1)),this.hasOpenAbsences$=this.openAbsencesCount$.pipe(u(v=>v>0),y(1)),this.editAbsencesParams$=this.getFullName().pipe(u(v=>({confirmationStates:this.settings.checkableAbsenceStateId,teacher:v})),y(1));let me=this.storageService.getPayload()?.id_person;me&&this.userId$.next(Number(me))}hasRoles(t){return i=>(i??[]).some(n=>t.includes(n))}getMyAbsences(){return W([this.userId$,this.lessonAbsences$,this.lessonIncidents$]).pipe(M(([t,i,n])=>this.loadTimetableEntries(t,i,n).pipe(u(h=>[...i,...n].map(b=>this.withTimetableEntry(b,h)).filter(Fe)))))}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(n=>n.Id===t.LessonRef.Id)?t:null}loadTimetableEntries(t,i,n){return this.studentsService.getTimetableEntries(t,{"filter.Id":`;${[...i,...n].map(h=>h.LessonRef.Id).join(";")}`})}static{this.\u0275fac=function(i){return new(i||e)(T(ne),T(te),T(U),T(We),T(et),T(Ge),T(je),T(k))}}static{this.\u0275prov=N({token:e,factory:e.\u0275fac})}}return e})();var Et=()=>["/presence-control"],At=()=>["/edit-absences"],Rt=()=>["/open-absences"],Ot=()=>["/events"],Lt=()=>["/my-absences","report"],wt=()=>["/my-absences"];function Bt(e,s){e&1&&g(0,"bkd-dashboard-action",0),e&2&&_("label","dashboard.actions.presence-control")("link",F(2,Et))}function jt(e,s){if(e&1&&(g(0,"bkd-dashboard-action",1),o(1,"async"),o(2,"async")),e&2){let t=f();_("label","dashboard.actions.edit-absences")("link",F(8,At))("linkParams",r(1,4,t.dashboardService.editAbsencesParams$))("count",r(2,6,t.dashboardService.editAbsencesCount$))}}function Ft(e,s){if(e&1&&(g(0,"bkd-dashboard-action",2),o(1,"async")),e&2){let t=f();_("label","dashboard.actions.open-absences")("link",F(5,Rt))("count",r(1,3,t.dashboardService.openAbsencesCount$))}}function Nt(e,s){if(e&1&&(g(0,"bkd-dashboard-deadline",4),o(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),o(2,"async"),c()),e&2){let t,i=f();_("label","dashboard.actions.tests")("link",F(5,Ot)),a(),m((t=r(2,3,i.dashboardService.coursesToRateCount$))!==null&&t!==void 0&&t?1:-1)}}function Ut(e,s){e&1&&g(0,"bkd-dashboard-action",0),e&2&&_("label","dashboard.actions.my-absences-report")("link",F(2,Lt))}function Ht(e,s){if(e&1&&(g(0,"bkd-dashboard-action",2),o(1,"async")),e&2){let t=f();_("label","dashboard.actions.my-absences")("link",F(5,wt))("count",r(1,3,t.dashboardService.myAbsencesCount$))}}function Vt(e,s){if(e&1&&g(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)(C(R),C(k))}}static{this.\u0275cmp=S({type:e,selectors:[["bkd-dashboard-actions"]],standalone:!0,features:[x],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,n){i&1&&(p(0,Bt,1,3,"bkd-dashboard-action",0),o(1,"async"),p(2,jt,3,9,"bkd-dashboard-action",1),o(3,"async"),o(4,"async"),p(5,Ft,2,6,"bkd-dashboard-action",2),o(6,"async"),p(7,zt,3,6,"bkd-dashboard-action",0),o(8,"async"),p(9,Ut,1,3,"bkd-dashboard-action",0),o(10,"async"),p(11,Ht,2,6,"bkd-dashboard-action",2),o(12,"async"),p(13,Vt,1,2,"bkd-dashboard-action",3),o(14,"async")),i&2&&(m(r(1,7,n.dashboardService.hasPresenceControl$)?0:-1),a(2),m(r(3,9,n.dashboardService.hasLessonTeacherRole$)&&r(4,11,n.dashboardService.editAbsencesParams$)?2:-1),a(3),m(r(6,13,n.dashboardService.hasOpenAbsences$)?5:-1),a(2),m(r(8,15,n.dashboardService.hasTeacherRole$)?7:-1),a(2),m(r(10,17,n.dashboardService.hasStudentRole$)?9:-1),a(2),m(r(12,19,n.dashboardService.hasStudentRole$)?11:-1),a(2),m(r(14,21,n.dashboardService.hasSubstituteAdministratorRole$)?13:-1))},dependencies:[Je,Qe,w],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 he(this,null,function*(){let i=Number(t);yield this.router.navigate(["dashboard","student",i,"addresses"])})}static{this.\u0275fac=function(i){return new(i||e)(C(U),C(Ee))}}static{this.\u0275cmp=S({type:e,selectors:[["bkd-dashboard-search"]],standalone:!0,features:[x],decls:1,vars:2,consts:[[3,"valueChange","typeaheadService","placeholder"]],template:function(i,n){i&1&&(d(0,"bkd-typeahead",0),z("valueChange",function(b){return b&&n.navigateToDossier(b)}),c()),i&2&&_("typeaheadService",n.studentsRestService)("placeholder","dashboard.search.placeholder")},dependencies:[Ze],styles:["[_nghost-%COMP%]{display:block;padding:.75rem;background:#f7e9d2}"]})}}return e})();var at=(()=>{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)(C(Ie,16))}}static{this.\u0275pipe=_e({name:"safe",type:e,pure:!0,standalone:!0})}}return e})();function ot(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 n=ct(i.EventRef.Id,i.LessonRef.Id);return K(q({},t),{[n]:[...t[n]??[],i.StudyClassNumber]})},{});return Object.keys(s).reduce((t,i)=>K(q({},t),{[i]:Le([...s[i]].sort())}),{})}function st(e,s){return e.map(t=>K(q({},t),{studyClass:s[t.id]?.join(", ")}))}function ct(e,s){return`${e}-${s}`}var Gt=(e,s)=>s.id;function qt(e,s){e&1&&(d(0,"th"),l(1),o(2,"translate"),c()),e&2&&(a(),D(" ",r(2,1,"dashboard.timetable.table.teacher")," "))}function Kt(e,s){if(e&1&&(d(0,"a",3),l(1),d(2,"span",8),l(3),c()()),e&2){let t=f().$implicit,i=f(2);_("href",i.buildLink(t.eventId),B),a(),D(" ",t.subject,""),a(2),D(", ",t.studyClass,"")}}function Wt(e,s){if(e&1&&l(0),e&2){let t=f().$implicit;D(" ",t.subject," ")}}function Yt(e,s){if(e&1&&(d(0,"td",4),l(1),o(2,"translate"),c()),e&2){let t=f().$implicit;a(),de(" ",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;a(),D(" ",t.teacher," ")}}function Jt(e,s){e&1&&(d(0,"span",7),l(1),o(2,"translate"),c()),e&2&&(a(),P(r(2,1,"dashboard.timetable.table.room")))}function Qt(e,s){if(e&1&&(d(0,"tr")(1,"td",1),l(2),o(3,"date"),o(4,"date"),c(),d(5,"td",2),p(6,Kt,4,3,"a",3),o(7,"async"),p(8,Wt,1,1),c(),p(9,Yt,3,4,"td",4),o(10,"async"),p(11,Zt,2,1,"td",5),o(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);a(2),de(" ",O(3,7,t.from,"HH:mm"),"\u2013",O(4,10,t.until,"HH:mm")," "),a(4),m(r(7,13,i.isTeacher$)?6:8),a(3),m(r(10,15,i.isTeacher$)?9:-1),a(2),m(r(12,17,i.isStudent$)?11:-1),a(3),m(t.room?14:-1),a(),D(" ",t.room," ")}}function Xt(e,s){if(e&1&&(d(0,"table",0)(1,"thead")(2,"tr")(3,"th"),l(4),o(5,"translate"),c(),d(6,"th"),l(7),o(8,"translate"),c(),p(9,qt,3,3,"th"),o(10,"async"),d(11,"th"),l(12),o(13,"translate"),c()()(),d(14,"tbody"),ve(15,Qt,16,19,"tr",null,Gt),c()()),e&2){let t=f();a(4),P(r(5,4,"dashboard.timetable.table.time")),a(3),P(r(8,6,"dashboard.timetable.table.subject")),a(2),m(r(10,8,t.isStudent$)?9:-1),a(3),D(" ",r(13,10,"dashboard.timetable.table.room")," "),a(3),ye(t.entries)}}function ei(e,s){e&1&&(d(0,"p"),l(1),o(2,"translate"),c()),e&2&&(a(),P(r(2,1,"dashboard.timetable.no-entries")))}var dt=(()=>{class e{constructor(t,i){this.dashboardService=t,this.settings=i,this.entries=[],this.isStudent$=this.dashboardService.hasStudentRole$,this.isTeacher$=this.dashboardService.hasLessonTeacherRole$}buildLink(t){return this.settings.eventlist.eventdetail.replace(":id",String(t))}static{this.\u0275fac=function(i){return new(i||e)(C(R),C(k))}}static{this.\u0275cmp=S({type:e,selectors:[["bkd-dashboard-timetable-table"]],inputs:{entries:"entries"},standalone:!0,features:[x],decls:2,vars:1,consts:[[1,"table"],[1,"time"],[1,"subject"],["target","_parent",3,"href"],[1,"study-class"],[1,"teacher"],[1,"room"],[1,"room-label"],[1,"subject-study-class"]],template:function(i,n){i&1&&p(0,Xt,17,12,"table",0)(1,ei,3,3,"p"),i&2&&m(n.entries.length>0?0:1)},dependencies:[w,J,A,E],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=X({}),lt=(()=>{class e extends ee{constructor(t,i){super(t,i,ti,"Teachers")}getTimetableEntries(t,i={}){let n=i instanceof le?i:new le({fromObject:i});return n=n.set("fields","Id,From,To,EventId,EventNumber,EventDesignation,EventLocation"),this.http.get(`${this.baseUrl}/${t}/TimetableEntries/CurrentSemester`,{params:n}).pipe(M(Be(Ve)))}static{this.\u0275fac=function(i){return new(i||e)(T(Q),T(k))}}static{this.\u0275prov=N({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();function ni(e,s){e&1&&(d(0,"a",6),o(1,"safe"),l(2),o(3,"translate"),c()),e&2&&(_("href",O(1,2,s,"url"),B),a(2),D(" ",r(3,5,"dashboard.timetable.subscribe-calendar")," "))}function ai(e,s){e&1&&g(0,"bkd-spinner")}function oi(e,s){e&1&&(d(0,"a",8),o(1,"safe"),l(2),o(3,"translate"),c()),e&2&&(_("href",O(1,2,s,"url"),B),a(2),D(" ",r(3,5,"dashboard.timetable.subscribe-calendar")," "))}function ri(e,s){if(e&1&&(g(0,"bkd-dashboard-timetable-table",7),p(1,oi,4,7,"a",8),o(2,"async")),e&2){let t,i=f(),n=G(18);_("entries",n),a(),m((t=r(2,2,i.getSubscribeCalendarUrl()))?1:-1,t)}}var si="cal",pt=(()=>{class e{constructor(t,i,n,h,b,$){this.teachersService=t,this.studentsService=i,this.lessonPresencesService=n,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 be(pe(new Date)),this.loading$=this.loadingService.loading$,this.timetableEntries$=this.loadTimetableEntries()}gotoToday(){this.date$.next(pe(new Date))}gotoPreviousDay(){this.date$.next(Ue(this.date$.getValue(),1))}gotoNextDay(){this.date$.next(Ne(this.date$.getValue(),1))}getSubscribeCalendarUrl(){return this.userSettings.getSetting(si)}loadTimetableEntries(){return W([this.isTeacher$,this.isStudent$,this.userId$,this.date$]).pipe(M(([t,i,n,h])=>{let b=()=>t?this.fetchTimetableEntries("teacher",n,h):i?this.fetchTimetableEntries("student",n,h):L([]);return this.loadingService.load(b())}),y(1))}fetchTimetableEntries(t,i,n){let h={"filter.From":`=${ze(n,"yyyy-MM-dd")}`,sort:"From,To"};return(t==="teacher"?this.teachersService.getTimetableEntries(i,h):this.studentsService.getTimetableEntries(i,h)).pipe(u(b=>b.map(ot)),u(b=>we(b,$=>$.id)),M(b=>t==="teacher"?this.loadStudyClasses(n).pipe(u($=>st(b,$))):L(b)))}loadStudyClasses(t){return this.lessonPresencesService.getLessonStudyClassesByDate(t).pipe(u(rt))}static{this.\u0275fac=function(i){return new(i||e)(C(lt),C(U),C(te),C(ne),C(R),C(qe))}}static{this.\u0275cmp=S({type:e,selectors:[["bkd-dashboard-timetable"]],standalone:!0,features:[x],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,n){if(i&1){let h=Se();d(0,"div",0)(1,"button",1),z("click",function(){return Y(h),Z(n.gotoToday())}),l(2),o(3,"translate"),c(),d(4,"button",2),o(5,"translate"),z("click",function(){return Y(h),Z(n.gotoPreviousDay())}),d(6,"span",3),l(7,"chevron_left"),c()(),d(8,"button",4),o(9,"translate"),z("click",function(){return Y(h),Z(n.gotoNextDay())}),d(10,"span",3),l(11,"chevron_right"),c()(),d(12,"div",5),l(13),o(14,"async"),o(15,"date"),c(),p(16,ni,4,7,"a",6),o(17,"async"),c(),j(18),o(19,"async"),p(20,ai,1,0,"bkd-spinner"),o(21,"async"),p(22,ri,3,4)}if(i&2){let h;a(2),D(" ",r(3,6,"dashboard.timetable.today")," "),a(2),re("aria-label",r(5,8,"dashboard.timetable.previousDay")),a(4),re("aria-label",r(9,10,"dashboard.timetable.nextDay")),a(5),P(O(15,14,r(14,12,n.date$),"E, dd. MMMM yyyy")),a(3),m((h=r(17,17,n.getSubscribeCalendarUrl()))?16:-1,h),a(2),V(r(19,19,n.timetableEntries$)),a(2),m(r(21,22,n.loading$)?20:22)}},dependencies:[dt,ie,w,J,A,E,at],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&&g(0,"bkd-spinner")}function di(e,s){e&1&&(d(0,"p"),l(1),o(2,"translate"),c()),e&2&&(a(),D(" ",r(2,1,"dashboard.no-access")," "))}function li(e,s){e&1&&(d(0,"div")(1,"h2"),l(2),o(3,"translate"),c(),g(4,"bkd-dashboard-search"),c()),e&2&&(a(2),P(r(3,1,"dashboard.search.title")))}function pi(e,s){e&1&&(d(0,"div")(1,"h2"),l(2),o(3,"translate"),c(),g(4,"bkd-dashboard-actions"),c()),e&2&&(a(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=G(2),i=G(4);a(),m(t?1:-1),a(),m(i?2:-1)}}function hi(e,s){e&1&&(d(0,"div",2)(1,"h2"),l(2),o(3,"translate"),c(),g(4,"bkd-dashboard-timetable"),c()),e&2&&(a(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)(C(R))}}static{this.\u0275cmp=S({type:e,selectors:[["bkd-dashboard-layout"]],standalone:!0,features:[x],decls:17,vars:19,consts:[[1,"columns"],[1,"search-actions-column"],[1,"timetable-column"]],template:function(i,n){if(i&1&&(j(0),o(1,"async"),j(2),o(3,"async"),j(4),o(5,"async"),j(6),o(7,"async"),d(8,"div")(9,"h1"),l(10),o(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,n.dashboardService.loading$);a(2);let b=V(r(3,9,n.dashboardService.hasSearch$));a(2);let $=V(r(5,12,n.dashboardService.hasActions$)),H=r(7,15,n.dashboardService.hasTimetable$);a(5),ge("visually-hidden",h||b||$||H),a(),D(" ",r(11,17,"dashboard.heading")," "),a(2),m(h?12:-1),a(),m(!h&&!b&&!$&&!H?13:-1),a(2),m(b||$?15:-1),a(),m(H?16:-1)}},dependencies:[ie,nt,it,pt,w,A,E],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"]],standalone:!0,features:[Pe([R,He]),x],decls:1,vars:0,template:function(i,n){i&1&&g(0,"router-outlet")},dependencies:[ke],changeDetection:0})}}return e})();var $n=[{path:"",component:ht,children:[{path:"",component:mt},Ye]}];export{$n as DASHBOARD_ROUTES}; diff --git a/public/apps/webapp-schulverwaltung/index.html b/public/apps/webapp-schulverwaltung/index.html index ce95d8e5..e21aaab9 100644 --- a/public/apps/webapp-schulverwaltung/index.html +++ b/public/apps/webapp-schulverwaltung/index.html @@ -14,5 +14,5 @@ - + diff --git a/public/apps/webapp-schulverwaltung/main-QF3W7LU6.js b/public/apps/webapp-schulverwaltung/main-3R3X57HA.js similarity index 99% rename from public/apps/webapp-schulverwaltung/main-QF3W7LU6.js rename to public/apps/webapp-schulverwaltung/main-3R3X57HA.js index e7b541a2..0e1f9ec7 100644 --- a/public/apps/webapp-schulverwaltung/main-QF3W7LU6.js +++ b/public/apps/webapp-schulverwaltung/main-3R3X57HA.js @@ -1 +1 @@ -import{b as Ds}from"./chunk-2H6IFZM2.js";import{c as Ps}from"./chunk-MIRGHONI.js";import{a as As,b as Ms}from"./chunk-YUHFF3NM.js";import{r as Ss}from"./chunk-AP373D4K.js";import{a as ye}from"./chunk-B6WYZ7BT.js";import{$ as H,Aa as Jt,Ab as X,B as Qt,Da as Yt,Fd as vs,Gb as pe,Ha as Xt,Hb as ge,Hd as Ts,Id as bs,Jd as Le,Kd as _e,Ld as ws,Ma as Fe,Oa as Zt,Ra as es,Rb as os,Sa as ts,Ta as ss,Ua as Re,V as v,Va as ke,Vb as at,Wa as U,X as W,Xa as Y,Xc as _s,Ya as is,Yc as Z,Z as Vt,Zb as as,_ as j,a as Ce,aa as J,ab as ns,c as qt,cb as rs,db as rt,ea as Ht,fc as ls,gc as cs,hc as us,ia as Gt,ic as hs,ja as xt,jc as ds,k as Ut,kc as fs,nb as oe,ob as ot,pb as Oe,ra as Ne,sa as Wt,sc as ms,tc as Ie,ua as nt,uc as ps,wa as q,wc as gs,xa as re,xc as ys,yd as Es}from"./chunk-IFJN5CDK.js";function vi(i){let e=i,t=Math.floor(Math.abs(i)),s=i.toString().replace(/^[^.]*\.?/,"").length;return t===1&&s===0?1:5}var Cs=["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",vi];function Ti(i){let e=i,t=Math.floor(Math.abs(i)),s=i.toString().replace(/^[^.]*\.?/,"").length,n=parseInt(i.toString().replace(/^[^e]*(e([-+]?\d+))?/,"$2"))||0;return t===0||t===1?1:n===0&&t!==0&&t%1e6===0&&s===0||!(n>=0&&n<=5)?4:5}var Ns=["fr-CH",[["AM","PM"],void 0,void 0],void 0,[["D","L","M","M","J","V","S"],["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],["di","lu","ma","me","je","ve","sa"]],void 0,[["J","F","M","A","M","J","J","A","S","O","N","D"],["janv.","f\xE9vr.","mars","avr.","mai","juin","juil.","ao\xFBt","sept.","oct.","nov.","d\xE9c."],["janvier","f\xE9vrier","mars","avril","mai","juin","juillet","ao\xFBt","septembre","octobre","novembre","d\xE9cembre"]],void 0,[["av. J.-C.","ap. J.-C."],void 0,["avant J\xE9sus-Christ","apr\xE8s J\xE9sus-Christ"]],1,[6,0],["dd.MM.yy","d MMM y","d MMMM y","EEEE, d MMMM y"],["HH:mm","HH:mm:ss","HH:mm:ss z","HH.mm:ss 'h' zzzz"],["{1} {0}","{1}, {0}","{1} '\xE0' {0}",void 0],[",","\u202F",";","%","+","-","E","\xD7","\u2030","\u221E","NaN",":","."],["#,##0.###","#,##0%","#,##0.00\xA0\xA4","#E0"],"CHF","CHF","franc suisse",{ARS:["$AR","$"],AUD:["$AU","$"],BEF:["FB"],BMD:["$BM","$"],BND:["$BN","$"],BYN:[void 0,"\u0440."],BZD:["$BZ","$"],CAD:["$CA","$"],CLP:["$CL","$"],CNY:[void 0,"\xA5"],COP:["$CO","$"],CYP:["\xA3CY"],EGP:[void 0,"\xA3E"],FJD:["$FJ","$"],FKP:["\xA3FK","\xA3"],FRF:["F"],GBP:["\xA3GB","\xA3"],GIP:["\xA3GI","\xA3"],HKD:[void 0,"$"],IEP:["\xA3IE"],ILP:["\xA3IL"],ITL:["\u20A4IT"],JPY:[void 0,"\xA5"],KMF:[void 0,"FC"],LBP:["\xA3LB","\xA3L"],MTP:["\xA3MT"],MXN:["$MX","$"],NAD:["$NA","$"],NIO:[void 0,"$C"],NZD:["$NZ","$"],PHP:[void 0,"\u20B1"],RHD:["$RH"],RON:[void 0,"L"],RWF:[void 0,"FR"],SBD:["$SB","$"],SGD:["$SG","$"],SRD:["$SR","$"],TOP:[void 0,"$T"],TTD:["$TT","$"],TWD:[void 0,"NT$"],USD:["$US","$"],UYU:["$UY","$"],WST:["$WS"],XCD:[void 0,"$"],XPF:["FCFP"],ZMW:[void 0,"Kw"]},"ltr",Ti];function bi(i,e){if(i&1&&(U(0,"i",3),oe(1),Y()),i&2){let t=rt().$implicit;q(),ot(t.icon)}}function wi(i,e){if(i&1){let t=ns();U(0,"ngb-toast",1),rs("hidden",function(){let n=Gt(t).$implicit,r=rt();return xt(r.toastService.remove(n))}),U(1,"div",2),Xt(2,bi,2,1,"i",3),U(3,"span"),oe(4),Y()()()}if(i&2){let t=e.$implicit;Zt(t.classname),Fe("header",t.header||"")("autohide",!0),q(2),es(t.icon?2:-1),q(2),ot(t.message)}}var Rs=(()=>{class i{constructor(t){this.toastService=t}static{this.\u0275fac=function(s){return new(s||i)(re(ye))}}static{this.\u0275cmp=J({type:i,selectors:[["bkd-toast"]],standalone:!0,features:[X],decls:3,vars:2,consts:[[3,"header","class","autohide"],[3,"hidden","header","autohide"],[1,"d-flex","gap-2"],[1,"material-icons"]],template:function(s,n){s&1&&(Re(0,wi,5,6,"ngb-toast",0,ss),pe(2,"async")),s&2&&ke(ge(2,0,n.toastService.toasts$))},dependencies:[Ss,as],styles:["[_nghost-%COMP%]{position:fixed;top:0;right:0;margin:.5em;z-index:1200}[_nghost-%COMP%] > *[_ngcontent-%COMP%]{font-size:medium}"]})}}return i})();var ks=new Vt("Navigator API",{providedIn:"root",factory:()=>navigator});var Os=(()=>{class i{constructor(t,s,n,r){this.toastService=s,this.settings=n,this.navigator=r,t.initialize(),this.checkSettings()}checkSettings(){vs(_s)(this.settings).pipe(Qt(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"),Ut))).subscribe()}static{this.\u0275fac=function(s){return new(s||i)(re(Ms),re(ye),re(Z),re(ks))}}static{this.\u0275cmp=J({type:i,selectors:[["bkd-app"]],standalone:!0,features:[X],decls:2,vars:0,consts:[["aria-live","polite","aria-atomic","true"]],template:function(s,n){s&1&&is(0,"bkd-toast",0)(1,"router-outlet")},dependencies:[Rs,ms],styles:["[_nghost-%COMP%]{width:100%}"],changeDetection:0})}}return i})();var _=function(i){return i[i.State=0]="State",i[i.Transition=1]="Transition",i[i.Sequence=2]="Sequence",i[i.Group=3]="Group",i[i.Animate=4]="Animate",i[i.Keyframes=5]="Keyframes",i[i.Style=6]="Style",i[i.Trigger=7]="Trigger",i[i.Reference=8]="Reference",i[i.AnimateChild=9]="AnimateChild",i[i.AnimateRef=10]="AnimateRef",i[i.Query=11]="Query",i[i.Stagger=12]="Stagger",i}(_||{}),Q="*";function Is(i,e=null){return{type:_.Sequence,steps:i,options:e}}function lt(i){return{type:_.Style,styles:i,offset:null}}var ee=class{constructor(e=0,t=0){this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._originalOnDoneFns=[],this._originalOnStartFns=[],this._started=!1,this._destroyed=!1,this._finished=!1,this._position=0,this.parentPlayer=null,this.totalTime=e+t}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}onStart(e){this._originalOnStartFns.push(e),this._onStartFns.push(e)}onDone(e){this._originalOnDoneFns.push(e),this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}hasStarted(){return this._started}init(){}play(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}triggerMicrotask(){queueMicrotask(()=>this._onFinish())}_onStart(){this._onStartFns.forEach(e=>e()),this._onStartFns=[]}pause(){}restart(){}finish(){this._onFinish()}destroy(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}reset(){this._started=!1,this._finished=!1,this._onStartFns=this._originalOnStartFns,this._onDoneFns=this._originalOnDoneFns}setPosition(e){this._position=this.totalTime?e*this.totalTime:1}getPosition(){return this.totalTime?this._position/this.totalTime:1}triggerCallback(e){let t=e=="start"?this._onStartFns:this._onDoneFns;t.forEach(s=>s()),t.length=0}},ve=class{constructor(e){this._onDoneFns=[],this._onStartFns=[],this._finished=!1,this._started=!1,this._destroyed=!1,this._onDestroyFns=[],this.parentPlayer=null,this.totalTime=0,this.players=e;let t=0,s=0,n=0,r=this.players.length;r==0?queueMicrotask(()=>this._onFinish()):this.players.forEach(o=>{o.onDone(()=>{++t==r&&this._onFinish()}),o.onDestroy(()=>{++s==r&&this._onDestroy()}),o.onStart(()=>{++n==r&&this._onStart()})}),this.totalTime=this.players.reduce((o,a)=>Math.max(o,a.totalTime),0)}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}init(){this.players.forEach(e=>e.init())}onStart(e){this._onStartFns.push(e)}_onStart(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach(e=>e()),this._onStartFns=[])}onDone(e){this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}hasStarted(){return this._started}play(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach(e=>e.play())}pause(){this.players.forEach(e=>e.pause())}restart(){this.players.forEach(e=>e.restart())}finish(){this._onFinish(),this.players.forEach(e=>e.finish())}destroy(){this._onDestroy()}_onDestroy(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach(e=>e.destroy()),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}reset(){this.players.forEach(e=>e.reset()),this._destroyed=!1,this._finished=!1,this._started=!1}setPosition(e){let t=e*this.totalTime;this.players.forEach(s=>{let n=s.totalTime?Math.min(1,t/s.totalTime):1;s.setPosition(n)})}getPosition(){let e=this.players.reduce((t,s)=>t===null||s.totalTime>t.totalTime?s:t,null);return e!=null?e.getPosition():0}beforeDestroy(){this.players.forEach(e=>{e.beforeDestroy&&e.beforeDestroy()})}triggerCallback(e){let t=e=="start"?this._onStartFns:this._onDoneFns;t.forEach(s=>s()),t.length=0}},$e="!";function Ls(i){return new v(3e3,!1)}function Ai(){return new v(3100,!1)}function Mi(){return new v(3101,!1)}function Pi(i){return new v(3001,!1)}function Di(i){return new v(3003,!1)}function Ci(i){return new v(3004,!1)}function Ni(i,e){return new v(3005,!1)}function Fi(){return new v(3006,!1)}function Ri(){return new v(3007,!1)}function ki(i,e){return new v(3008,!1)}function Oi(i){return new v(3002,!1)}function Ii(i,e,t,s,n){return new v(3010,!1)}function Li(){return new v(3011,!1)}function $i(){return new v(3012,!1)}function zi(){return new v(3200,!1)}function Bi(){return new v(3202,!1)}function Ki(){return new v(3013,!1)}function ji(i){return new v(3014,!1)}function qi(i){return new v(3015,!1)}function Ui(i){return new v(3016,!1)}function Qi(i,e){return new v(3404,!1)}function Vi(i){return new v(3502,!1)}function Hi(i){return new v(3503,!1)}function Gi(){return new v(3300,!1)}function xi(i){return new v(3504,!1)}function Wi(i){return new v(3301,!1)}function Ji(i,e){return new v(3302,!1)}function Yi(i){return new v(3303,!1)}function Xi(i,e){return new v(3400,!1)}function Zi(i){return new v(3401,!1)}function en(i){return new v(3402,!1)}function tn(i,e){return new v(3505,!1)}function te(i){switch(i.length){case 0:return new ee;case 1:return i[0];default:return new ve(i)}}function Js(i,e,t=new Map,s=new Map){let n=[],r=[],o=-1,a=null;if(e.forEach(l=>{let c=l.get("offset"),h=c==o,u=h&&a||new Map;l.forEach((S,y)=>{let f=y,g=S;if(y!=="offset")switch(f=i.normalizePropertyName(f,n),g){case $e:g=t.get(y);break;case Q:g=s.get(y);break;default:g=i.normalizeStyleValue(y,f,g,n);break}u.set(f,g)}),h||r.push(u),a=u,o=c}),n.length)throw Vi(n);return r}function Ft(i,e,t,s){switch(e){case"start":i.onStart(()=>s(t&&ct(t,"start",i)));break;case"done":i.onDone(()=>s(t&&ct(t,"done",i)));break;case"destroy":i.onDestroy(()=>s(t&&ct(t,"destroy",i)));break}}function ct(i,e,t){let s=t.totalTime,n=!!t.disabled,r=Rt(i.element,i.triggerName,i.fromState,i.toState,e||i.phaseName,s??i.totalTime,n),o=i._data;return o!=null&&(r._data=o),r}function Rt(i,e,t,s,n="",r=0,o){return{element:i,triggerName:e,fromState:t,toState:s,phaseName:n,totalTime:r,disabled:!!o}}function O(i,e,t){let s=i.get(e);return s||i.set(e,s=t),s}function $s(i){let e=i.indexOf(":"),t=i.substring(1,e),s=i.slice(e+1);return[t,s]}var sn=typeof document>"u"?null:document.documentElement;function kt(i){let e=i.parentNode||i.host||null;return e===sn?null:e}function nn(i){return i.substring(1,6)=="ebkit"}var le=null,zs=!1;function rn(i){le||(le=on()||{},zs=le.style?"WebkitAppearance"in le.style:!1);let e=!0;return le.style&&!nn(i)&&(e=i in le.style,!e&&zs&&(e="Webkit"+i.charAt(0).toUpperCase()+i.slice(1)in le.style)),e}function on(){return typeof document<"u"?document.body:null}function Ys(i,e){for(;e;){if(e===i)return!0;e=kt(e)}return!1}function Xs(i,e,t){if(t)return Array.from(i.querySelectorAll(e));let s=i.querySelector(e);return s?[s]:[]}var Ot=(()=>{class i{validateStyleProperty(t){return rn(t)}containsElement(t,s){return Ys(t,s)}getParentElement(t){return kt(t)}query(t,s,n){return Xs(t,s,n)}computeStyle(t,s,n){return n||""}animate(t,s,n,r,o,a=[],l){return new ee(n,r)}static{this.\u0275fac=function(s){return new(s||i)}}static{this.\u0275prov=W({token:i,factory:i.\u0275fac})}}return i})(),he=class{static{this.NOOP=new Ot}},de=class{};var an=1e3,Zs="{{",ln="}}",ei="ng-enter",pt="ng-leave",ze="ng-trigger",Ue=".ng-trigger",Bs="ng-animating",gt=".ng-animating";function G(i){if(typeof i=="number")return i;let e=i.match(/^(-?[\.\d]+)(m?s)/);return!e||e.length<2?0:yt(parseFloat(e[1]),e[2])}function yt(i,e){switch(e){case"s":return i*an;default:return i}}function Qe(i,e,t){return i.hasOwnProperty("duration")?i:cn(i,e,t)}function cn(i,e,t){let s=/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i,n,r=0,o="";if(typeof i=="string"){let a=i.match(s);if(a===null)return e.push(Ls(i)),{duration:0,delay:0,easing:""};n=yt(parseFloat(a[1]),a[2]);let l=a[3];l!=null&&(r=yt(parseFloat(l),a[4]));let c=a[5];c&&(o=c)}else n=i;if(!t){let a=!1,l=e.length;n<0&&(e.push(Ai()),a=!0),r<0&&(e.push(Mi()),a=!0),a&&e.splice(l,0,Ls(i))}return{duration:n,delay:r,easing:o}}function un(i){return i.length?i[0]instanceof Map?i:i.map(e=>new Map(Object.entries(e))):[]}function V(i,e,t){e.forEach((s,n)=>{let r=It(n);t&&!t.has(n)&&t.set(n,i.style[r]),i.style[r]=s})}function ue(i,e){e.forEach((t,s)=>{let n=It(s);i.style[n]=""})}function Te(i){return Array.isArray(i)?i.length==1?i[0]:Is(i):i}function hn(i,e,t){let s=e.params||{},n=ti(i);n.length&&n.forEach(r=>{s.hasOwnProperty(r)||t.push(Pi(r))})}var _t=new RegExp(`${Zs}\\s*(.+?)\\s*${ln}`,"g");function ti(i){let e=[];if(typeof i=="string"){let t;for(;t=_t.exec(i);)e.push(t[1]);_t.lastIndex=0}return e}function we(i,e,t){let s=`${i}`,n=s.replace(_t,(r,o)=>{let a=e[o];return a==null&&(t.push(Di(o)),a=""),a.toString()});return n==s?i:n}var dn=/-+([a-z0-9])/g;function It(i){return i.replace(dn,(...e)=>e[1].toUpperCase())}function fn(i,e){return i===0||e===0}function mn(i,e,t){if(t.size&&e.length){let s=e[0],n=[];if(t.forEach((r,o)=>{s.has(o)||n.push(o),s.set(o,r)}),n.length)for(let r=1;ro.set(a,Lt(i,a)))}}return e}function k(i,e,t){switch(e.type){case _.Trigger:return i.visitTrigger(e,t);case _.State:return i.visitState(e,t);case _.Transition:return i.visitTransition(e,t);case _.Sequence:return i.visitSequence(e,t);case _.Group:return i.visitGroup(e,t);case _.Animate:return i.visitAnimate(e,t);case _.Keyframes:return i.visitKeyframes(e,t);case _.Style:return i.visitStyle(e,t);case _.Reference:return i.visitReference(e,t);case _.AnimateChild:return i.visitAnimateChild(e,t);case _.AnimateRef:return i.visitAnimateRef(e,t);case _.Query:return i.visitQuery(e,t);case _.Stagger:return i.visitStagger(e,t);default:throw Ci(e.type)}}function Lt(i,e){return window.getComputedStyle(i)[e]}var pn=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"]),Ve=class extends de{normalizePropertyName(e,t){return It(e)}normalizeStyleValue(e,t,s,n){let r="",o=s.toString().trim();if(pn.has(t)&&s!==0&&s!=="0")if(typeof s=="number")r="px";else{let a=s.match(/^[+-]?[\d\.]+([a-z]*)$/);a&&a[1].length==0&&n.push(Ni(e,s))}return o+r}};var He="*";function gn(i,e){let t=[];return typeof i=="string"?i.split(/\s*,\s*/).forEach(s=>yn(s,t,e)):t.push(i),t}function yn(i,e,t){if(i[0]==":"){let l=_n(i,t);if(typeof l=="function"){e.push(l);return}i=l}let s=i.match(/^(\*|[-\w]+)\s*()\s*(\*|[-\w]+)$/);if(s==null||s.length<4)return t.push(qi(i)),e;let n=s[1],r=s[2],o=s[3];e.push(Ks(n,o));let a=n==He&&o==He;r[0]=="<"&&!a&&e.push(Ks(o,n))}function _n(i,e){switch(i){case":enter":return"void => *";case":leave":return"* => void";case":increment":return(t,s)=>parseFloat(s)>parseFloat(t);case":decrement":return(t,s)=>parseFloat(s) *"}}var Be=new Set(["true","1"]),Ke=new Set(["false","0"]);function Ks(i,e){let t=Be.has(i)||Ke.has(i),s=Be.has(e)||Ke.has(e);return(n,r)=>{let o=i==He||i==n,a=e==He||e==r;return!o&&t&&typeof n=="boolean"&&(o=n?Be.has(i):Ke.has(i)),!a&&s&&typeof r=="boolean"&&(a=r?Be.has(e):Ke.has(e)),o&&a}}var si=":self",Sn=new RegExp(`s*${si}s*,?`,"g");function ii(i,e,t,s){return new St(i).build(e,t,s)}var js="",St=class{constructor(e){this._driver=e}build(e,t,s){let n=new Et(t);return this._resetContextStyleTimingState(n),k(this,Te(e),n)}_resetContextStyleTimingState(e){e.currentQuerySelector=js,e.collectedStyles=new Map,e.collectedStyles.set(js,new Map),e.currentTime=0}visitTrigger(e,t){let s=t.queryCount=0,n=t.depCount=0,r=[],o=[];return e.name.charAt(0)=="@"&&t.errors.push(Fi()),e.definitions.forEach(a=>{if(this._resetContextStyleTimingState(t),a.type==_.State){let l=a,c=l.name;c.toString().split(/\s*,\s*/).forEach(h=>{l.name=h,r.push(this.visitState(l,t))}),l.name=c}else if(a.type==_.Transition){let l=this.visitTransition(a,t);s+=l.queryCount,n+=l.depCount,o.push(l)}else t.errors.push(Ri())}),{type:_.Trigger,name:e.name,states:r,transitions:o,queryCount:s,depCount:n,options:null}}visitState(e,t){let s=this.visitStyle(e.styles,t),n=e.options&&e.options.params||null;if(s.containsDynamicStyles){let r=new Set,o=n||{};s.styles.forEach(a=>{a instanceof Map&&a.forEach(l=>{ti(l).forEach(c=>{o.hasOwnProperty(c)||r.add(c)})})}),r.size&&t.errors.push(ki(e.name,[...r.values()]))}return{type:_.State,name:e.name,style:s,options:n?{params:n}:null}}visitTransition(e,t){t.queryCount=0,t.depCount=0;let s=k(this,Te(e.animation),t),n=gn(e.expr,t.errors);return{type:_.Transition,matchers:n,animation:s,queryCount:t.queryCount,depCount:t.depCount,options:ce(e.options)}}visitSequence(e,t){return{type:_.Sequence,steps:e.steps.map(s=>k(this,s,t)),options:ce(e.options)}}visitGroup(e,t){let s=t.currentTime,n=0,r=e.steps.map(o=>{t.currentTime=s;let a=k(this,o,t);return n=Math.max(n,t.currentTime),a});return t.currentTime=n,{type:_.Group,steps:r,options:ce(e.options)}}visitAnimate(e,t){let s=bn(e.timings,t.errors);t.currentAnimateTimings=s;let n,r=e.styles?e.styles:lt({});if(r.type==_.Keyframes)n=this.visitKeyframes(r,t);else{let o=e.styles,a=!1;if(!o){a=!0;let c={};s.easing&&(c.easing=s.easing),o=lt(c)}t.currentTime+=s.duration+s.delay;let l=this.visitStyle(o,t);l.isEmptyStep=a,n=l}return t.currentAnimateTimings=null,{type:_.Animate,timings:s,style:n,options:null}}visitStyle(e,t){let s=this._makeStyleAst(e,t);return this._validateStyleAst(s,t),s}_makeStyleAst(e,t){let s=[],n=Array.isArray(e.styles)?e.styles:[e.styles];for(let a of n)typeof a=="string"?a===Q?s.push(a):t.errors.push(Oi(a)):s.push(new Map(Object.entries(a)));let r=!1,o=null;return s.forEach(a=>{if(a instanceof Map&&(a.has("easing")&&(o=a.get("easing"),a.delete("easing")),!r)){for(let l of a.values())if(l.toString().indexOf(Zs)>=0){r=!0;break}}}),{type:_.Style,styles:s,easing:o,offset:e.offset,containsDynamicStyles:r,options:null}}_validateStyleAst(e,t){let s=t.currentAnimateTimings,n=t.currentTime,r=t.currentTime;s&&r>0&&(r-=s.duration+s.delay),e.styles.forEach(o=>{typeof o!="string"&&o.forEach((a,l)=>{let c=t.collectedStyles.get(t.currentQuerySelector),h=c.get(l),u=!0;h&&(r!=n&&r>=h.startTime&&n<=h.endTime&&(t.errors.push(Ii(l,h.startTime,h.endTime,r,n)),u=!1),r=h.startTime),u&&c.set(l,{startTime:r,endTime:n}),t.options&&hn(a,t.options,t.errors)})})}visitKeyframes(e,t){let s={type:_.Keyframes,styles:[],options:null};if(!t.currentAnimateTimings)return t.errors.push(Li()),s;let n=1,r=0,o=[],a=!1,l=!1,c=0,h=e.steps.map(w=>{let A=this._makeStyleAst(w,t),C=A.offset!=null?A.offset:Tn(A.styles),P=0;return C!=null&&(r++,P=A.offset=C),l=l||P<0||P>1,a=a||P0&&r{let C=S>0?A==y?1:S*A:o[A],P=C*T;t.currentTime=f+g.delay+P,g.duration=P,this._validateStyleAst(w,t),w.offset=C,s.styles.push(w)}),s}visitReference(e,t){return{type:_.Reference,animation:k(this,Te(e.animation),t),options:ce(e.options)}}visitAnimateChild(e,t){return t.depCount++,{type:_.AnimateChild,options:ce(e.options)}}visitAnimateRef(e,t){return{type:_.AnimateRef,animation:this.visitReference(e.animation,t),options:ce(e.options)}}visitQuery(e,t){let s=t.currentQuerySelector,n=e.options||{};t.queryCount++,t.currentQuery=e;let[r,o]=En(e.selector);t.currentQuerySelector=s.length?s+" "+r:r,O(t.collectedStyles,t.currentQuerySelector,new Map);let a=k(this,Te(e.animation),t);return t.currentQuery=null,t.currentQuerySelector=s,{type:_.Query,selector:r,limit:n.limit||0,optional:!!n.optional,includeSelf:o,animation:a,originalSelector:e.selector,options:ce(e.options)}}visitStagger(e,t){t.currentQuery||t.errors.push(Ki());let s=e.timings==="full"?{duration:0,delay:0,easing:"full"}:Qe(e.timings,t.errors,!0);return{type:_.Stagger,animation:k(this,Te(e.animation),t),timings:s,options:null}}};function En(i){let e=!!i.split(/\s*,\s*/).find(t=>t==si);return e&&(i=i.replace(Sn,"")),i=i.replace(/@\*/g,Ue).replace(/@\w+/g,t=>Ue+"-"+t.slice(1)).replace(/:animating/g,gt),[i,e]}function vn(i){return i?Ce({},i):null}var Et=class{constructor(e){this.errors=e,this.queryCount=0,this.depCount=0,this.currentTransition=null,this.currentQuery=null,this.currentQuerySelector=null,this.currentAnimateTimings=null,this.currentTime=0,this.collectedStyles=new Map,this.options=null,this.unsupportedCSSPropertiesFound=new Set}};function Tn(i){if(typeof i=="string")return null;let e=null;if(Array.isArray(i))i.forEach(t=>{if(t instanceof Map&&t.has("offset")){let s=t;e=parseFloat(s.get("offset")),s.delete("offset")}});else if(i instanceof Map&&i.has("offset")){let t=i;e=parseFloat(t.get("offset")),t.delete("offset")}return e}function bn(i,e){if(i.hasOwnProperty("duration"))return i;if(typeof i=="number"){let r=Qe(i,e).duration;return ut(r,0,"")}let t=i;if(t.split(/\s+/).some(r=>r.charAt(0)=="{"&&r.charAt(1)=="{")){let r=ut(0,0,"");return r.dynamic=!0,r.strValue=t,r}let n=Qe(t,e);return ut(n.duration,n.delay,n.easing)}function ce(i){return i?(i=Ce({},i),i.params&&(i.params=vn(i.params))):i={},i}function ut(i,e,t){return{duration:i,delay:e,easing:t}}function $t(i,e,t,s,n,r,o=null,a=!1){return{type:1,element:i,keyframes:e,preStyleProps:t,postStyleProps:s,duration:n,delay:r,totalTime:n+r,easing:o,subTimeline:a}}var Ae=class{constructor(){this._map=new Map}get(e){return this._map.get(e)||[]}append(e,t){let s=this._map.get(e);s||this._map.set(e,s=[]),s.push(...t)}has(e){return this._map.has(e)}clear(){this._map.clear()}},wn=1,An=":enter",Mn=new RegExp(An,"g"),Pn=":leave",Dn=new RegExp(Pn,"g");function ni(i,e,t,s,n,r=new Map,o=new Map,a,l,c=[]){return new vt().buildKeyframes(i,e,t,s,n,r,o,a,l,c)}var vt=class{buildKeyframes(e,t,s,n,r,o,a,l,c,h=[]){c=c||new Ae;let u=new Tt(e,t,c,n,r,h,[]);u.options=l;let S=l.delay?G(l.delay):0;u.currentTimeline.delayNextStep(S),u.currentTimeline.setStyles([o],null,u.errors,l),k(this,s,u);let y=u.timelines.filter(f=>f.containsAnimation());if(y.length&&a.size){let f;for(let g=y.length-1;g>=0;g--){let T=y[g];if(T.element===t){f=T;break}}f&&!f.allowOnlyTimelineStyles()&&f.setStyles([a],null,u.errors,l)}return y.length?y.map(f=>f.buildKeyframes()):[$t(t,[],[],[],0,S,"",!1)]}visitTrigger(e,t){}visitState(e,t){}visitTransition(e,t){}visitAnimateChild(e,t){let s=t.subInstructions.get(t.element);if(s){let n=t.createSubContext(e.options),r=t.currentTimeline.currentTime,o=this._visitSubInstructions(s,n,n.options);r!=o&&t.transformIntoNewTimeline(o)}t.previousNode=e}visitAnimateRef(e,t){let s=t.createSubContext(e.options);s.transformIntoNewTimeline(),this._applyAnimationRefDelays([e.options,e.animation.options],t,s),this.visitReference(e.animation,s),t.transformIntoNewTimeline(s.currentTimeline.currentTime),t.previousNode=e}_applyAnimationRefDelays(e,t,s){for(let n of e){let r=n?.delay;if(r){let o=typeof r=="number"?r:G(we(r,n?.params??{},t.errors));s.delayNextStep(o)}}}_visitSubInstructions(e,t,s){let r=t.currentTimeline.currentTime,o=s.duration!=null?G(s.duration):null,a=s.delay!=null?G(s.delay):null;return o!==0&&e.forEach(l=>{let c=t.appendInstructionToTimeline(l,o,a);r=Math.max(r,c.duration+c.delay)}),r}visitReference(e,t){t.updateOptions(e.options,!0),k(this,e.animation,t),t.previousNode=e}visitSequence(e,t){let s=t.subContextCount,n=t,r=e.options;if(r&&(r.params||r.delay)&&(n=t.createSubContext(r),n.transformIntoNewTimeline(),r.delay!=null)){n.previousNode.type==_.Style&&(n.currentTimeline.snapshotCurrentStyles(),n.previousNode=Ge);let o=G(r.delay);n.delayNextStep(o)}e.steps.length&&(e.steps.forEach(o=>k(this,o,n)),n.currentTimeline.applyStylesToKeyframe(),n.subContextCount>s&&n.transformIntoNewTimeline()),t.previousNode=e}visitGroup(e,t){let s=[],n=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),n=Math.max(n,a.currentTimeline.currentTime),s.push(a.currentTimeline)}),s.forEach(o=>t.currentTimeline.mergeTimelineCollectedStyles(o)),t.transformIntoNewTimeline(n),t.previousNode=e}_visitTiming(e,t){if(e.dynamic){let s=e.strValue,n=t.params?we(s,t.params,t.errors):s;return Qe(n,t.errors)}else return{duration:e.duration,delay:e.delay,easing:e.easing}}visitAnimate(e,t){let s=t.currentAnimateTimings=this._visitTiming(e.timings,t),n=t.currentTimeline;s.delay&&(t.incrementTime(s.delay),n.snapshotCurrentStyles());let r=e.style;r.type==_.Keyframes?this.visitKeyframes(r,t):(t.incrementTime(s.duration),this.visitStyle(r,t),n.applyStylesToKeyframe()),t.currentAnimateTimings=null,t.previousNode=e}visitStyle(e,t){let s=t.currentTimeline,n=t.currentAnimateTimings;!n&&s.hasCurrentStyleProperties()&&s.forwardFrame();let r=n&&n.easing||e.easing;e.isEmptyStep?s.applyEmptyStep(r):s.setStyles(e.styles,r,t.errors,t.options),t.previousNode=e}visitKeyframes(e,t){let s=t.currentAnimateTimings,n=t.currentTimeline.duration,r=s.duration,a=t.createSubContext().currentTimeline;a.easing=s.easing,e.styles.forEach(l=>{let c=l.offset||0;a.forwardTime(c*r),a.setStyles(l.styles,l.easing,t.errors,t.options),a.applyStylesToKeyframe()}),t.currentTimeline.mergeTimelineCollectedStyles(a),t.transformIntoNewTimeline(n+r),t.previousNode=e}visitQuery(e,t){let s=t.currentTimeline.currentTime,n=e.options||{},r=n.delay?G(n.delay):0;r&&(t.previousNode.type===_.Style||s==0&&t.currentTimeline.hasCurrentStyleProperties())&&(t.currentTimeline.snapshotCurrentStyles(),t.previousNode=Ge);let o=s,a=t.invokeQuery(e.selector,e.originalSelector,e.limit,e.includeSelf,!!n.optional,t.errors);t.currentQueryTotal=a.length;let l=null;a.forEach((c,h)=>{t.currentQueryIndex=h;let u=t.createSubContext(e.options,c);r&&u.delayNextStep(r),c===t.element&&(l=u.currentTimeline),k(this,e.animation,u),u.currentTimeline.applyStylesToKeyframe();let S=u.currentTimeline.currentTime;o=Math.max(o,S)}),t.currentQueryIndex=0,t.currentQueryTotal=0,t.transformIntoNewTimeline(o),l&&(t.currentTimeline.mergeTimelineCollectedStyles(l),t.currentTimeline.snapshotCurrentStyles()),t.previousNode=e}visitStagger(e,t){let s=t.parentContext,n=t.currentTimeline,r=e.timings,o=Math.abs(r.duration),a=o*(t.currentQueryTotal-1),l=o*t.currentQueryIndex;switch(r.duration<0?"reverse":r.easing){case"reverse":l=a-l;break;case"full":l=s.currentStaggerTime;break}let h=t.currentTimeline;l&&h.delayNextStep(l);let u=h.currentTime;k(this,e.animation,t),t.previousNode=e,s.currentStaggerTime=n.currentTime-u+(n.startTime-s.currentTimeline.startTime)}},Ge={},Tt=class i{constructor(e,t,s,n,r,o,a,l){this._driver=e,this.element=t,this.subInstructions=s,this._enterClassName=n,this._leaveClassName=r,this.errors=o,this.timelines=a,this.parentContext=null,this.currentAnimateTimings=null,this.previousNode=Ge,this.subContextCount=0,this.options={},this.currentQueryIndex=0,this.currentQueryTotal=0,this.currentStaggerTime=0,this.currentTimeline=l||new xe(this._driver,t,0),a.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(e,t){if(!e)return;let s=e,n=this.options;s.duration!=null&&(n.duration=G(s.duration)),s.delay!=null&&(n.delay=G(s.delay));let r=s.params;if(r){let o=n.params;o||(o=this.options.params={}),Object.keys(r).forEach(a=>{(!t||!o.hasOwnProperty(a))&&(o[a]=we(r[a],o,this.errors))})}}_copyOptions(){let e={};if(this.options){let t=this.options.params;if(t){let s=e.params={};Object.keys(t).forEach(n=>{s[n]=t[n]})}}return e}createSubContext(e=null,t,s){let n=t||this.element,r=new i(this._driver,n,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(n,s||0));return r.previousNode=this.previousNode,r.currentAnimateTimings=this.currentAnimateTimings,r.options=this._copyOptions(),r.updateOptions(e),r.currentQueryIndex=this.currentQueryIndex,r.currentQueryTotal=this.currentQueryTotal,r.parentContext=this,this.subContextCount++,r}transformIntoNewTimeline(e){return this.previousNode=Ge,this.currentTimeline=this.currentTimeline.fork(this.element,e),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(e,t,s){let n={duration:t??e.duration,delay:this.currentTimeline.currentTime+(s??0)+e.delay,easing:""},r=new bt(this._driver,e.element,e.keyframes,e.preStyleProps,e.postStyleProps,n,e.stretchStartingKeyframe);return this.timelines.push(r),n}incrementTime(e){this.currentTimeline.forwardTime(this.currentTimeline.duration+e)}delayNextStep(e){e>0&&this.currentTimeline.delayNextStep(e)}invokeQuery(e,t,s,n,r,o){let a=[];if(n&&a.push(this.element),e.length>0){e=e.replace(Mn,"."+this._enterClassName),e=e.replace(Dn,"."+this._leaveClassName);let l=s!=1,c=this._driver.query(this.element,e,l);s!==0&&(c=s<0?c.slice(c.length+s,c.length):c.slice(0,s)),a.push(...c)}return!r&&a.length==0&&o.push(ji(t)),a}},xe=class i{constructor(e,t,s,n){this._driver=e,this.element=t,this.startTime=s,this._elementTimelineStylesLookup=n,this.duration=0,this.easing=null,this._previousKeyframe=new Map,this._currentKeyframe=new Map,this._keyframes=new Map,this._styleSummary=new Map,this._localTimelineStyles=new Map,this._pendingStyles=new Map,this._backFill=new Map,this._currentEmptyStepKeyframe=null,this._elementTimelineStylesLookup||(this._elementTimelineStylesLookup=new Map),this._globalTimelineStyles=this._elementTimelineStylesLookup.get(t),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(t,this._localTimelineStyles)),this._loadKeyframe()}containsAnimation(){switch(this._keyframes.size){case 0:return!1;case 1:return this.hasCurrentStyleProperties();default:return!0}}hasCurrentStyleProperties(){return this._currentKeyframe.size>0}get currentTime(){return this.startTime+this.duration}delayNextStep(e){let t=this._keyframes.size===1&&this._pendingStyles.size;this.duration||t?(this.forwardTime(this.currentTime+e),t&&this.snapshotCurrentStyles()):this.startTime+=e}fork(e,t){return this.applyStylesToKeyframe(),new i(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+=wn,this._loadKeyframe()}forwardTime(e){this.applyStylesToKeyframe(),this.duration=e,this._loadKeyframe()}_updateStyle(e,t){this._localTimelineStyles.set(e,t),this._globalTimelineStyles.set(e,t),this._styleSummary.set(e,{time:this.currentTime,value:t})}allowOnlyTimelineStyles(){return this._currentEmptyStepKeyframe!==this._currentKeyframe}applyEmptyStep(e){e&&this._previousKeyframe.set("easing",e);for(let[t,s]of this._globalTimelineStyles)this._backFill.set(t,s||Q),this._currentKeyframe.set(t,Q);this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(e,t,s,n){t&&this._previousKeyframe.set("easing",t);let r=n&&n.params||{},o=Cn(e,this._globalTimelineStyles);for(let[a,l]of o){let c=we(l,r,s);this._pendingStyles.set(a,c),this._localTimelineStyles.has(a)||this._backFill.set(a,this._globalTimelineStyles.get(a)??Q),this._updateStyle(a,c)}}applyStylesToKeyframe(){this._pendingStyles.size!=0&&(this._pendingStyles.forEach((e,t)=>{this._currentKeyframe.set(t,e)}),this._pendingStyles.clear(),this._localTimelineStyles.forEach((e,t)=>{this._currentKeyframe.has(t)||this._currentKeyframe.set(t,e)}))}snapshotCurrentStyles(){for(let[e,t]of this._localTimelineStyles)this._pendingStyles.set(e,t),this._updateStyle(e,t)}getFinalKeyframe(){return this._keyframes.get(this.duration)}get properties(){let e=[];for(let t in this._currentKeyframe)e.push(t);return e}mergeTimelineCollectedStyles(e){e._styleSummary.forEach((t,s)=>{let n=this._styleSummary.get(s);(!n||t.time>n.time)&&this._updateStyle(s,t.value)})}buildKeyframes(){this.applyStylesToKeyframe();let e=new Set,t=new Set,s=this._keyframes.size===1&&this.duration===0,n=[];this._keyframes.forEach((a,l)=>{let c=new Map([...this._backFill,...a]);c.forEach((h,u)=>{h===$e?e.add(u):h===Q&&t.add(u)}),s||c.set("offset",l/this.duration),n.push(c)});let r=[...e.values()],o=[...t.values()];if(s){let a=n[0],l=new Map(a);a.set("offset",0),l.set("offset",1),n=[a,l]}return $t(this.element,n,r,o,this.duration,this.startTime,this.easing,!1)}},bt=class extends xe{constructor(e,t,s,n,r,o,a=!1){super(e,t,o.delay),this.keyframes=s,this.preStyleProps=n,this.postStyleProps=r,this._stretchStartingKeyframe=a,this.timings={duration:o.duration,delay:o.delay,easing:o.easing}}containsAnimation(){return this.keyframes.length>1}buildKeyframes(){let e=this.keyframes,{delay:t,duration:s,easing:n}=this.timings;if(this._stretchStartingKeyframe&&t){let r=[],o=s+t,a=t/o,l=new Map(e[0]);l.set("offset",0),r.push(l);let c=new Map(e[0]);c.set("offset",qs(a)),r.push(c);let h=e.length-1;for(let u=1;u<=h;u++){let S=new Map(e[u]),y=S.get("offset"),f=t+y*s;S.set("offset",qs(f/o)),r.push(S)}s=o,t=0,n="",e=r}return $t(this.element,e,this.preStyleProps,this.postStyleProps,s,t,n,!0)}};function qs(i,e=3){let t=Math.pow(10,e-1);return Math.round(i*t)/t}function Cn(i,e){let t=new Map,s;return i.forEach(n=>{if(n==="*"){s??=e.keys();for(let r of s)t.set(r,Q)}else for(let[r,o]of n)t.set(r,o)}),t}function Us(i,e,t,s,n,r,o,a,l,c,h,u,S){return{type:0,element:i,triggerName:e,isRemovalTransition:n,fromState:t,fromStyles:r,toState:s,toStyles:o,timelines:a,queriedElements:l,preStyleProps:c,postStyleProps:h,totalTime:u,errors:S}}var ht={},We=class{constructor(e,t,s){this._triggerName=e,this.ast=t,this._stateStyles=s}match(e,t,s,n){return Nn(this.ast.matchers,e,t,s,n)}buildStyles(e,t,s){let n=this._stateStyles.get("*");return e!==void 0&&(n=this._stateStyles.get(e?.toString())||n),n?n.buildStyles(t,s):new Map}build(e,t,s,n,r,o,a,l,c,h){let u=[],S=this.ast.options&&this.ast.options.params||ht,y=a&&a.params||ht,f=this.buildStyles(s,y,u),g=l&&l.params||ht,T=this.buildStyles(n,g,u),w=new Set,A=new Map,C=new Map,P=n==="void",fe={params:ri(g,S),delay:this.ast.options?.delay},B=h?[]:ni(e,t,this.ast.animation,r,o,f,T,fe,c,u),N=0;return B.forEach(F=>{N=Math.max(F.duration+F.delay,N)}),u.length?Us(t,this._triggerName,s,n,P,f,T,[],[],A,C,N,u):(B.forEach(F=>{let se=F.element,me=O(A,se,new Set);F.preStyleProps.forEach(ie=>me.add(ie));let zt=O(C,se,new Set);F.postStyleProps.forEach(ie=>zt.add(ie)),se!==t&&w.add(se)}),Us(t,this._triggerName,s,n,P,f,T,B,[...w.values()],A,C,N))}};function Nn(i,e,t,s,n){return i.some(r=>r(e,t,s,n))}function ri(i,e){let t=Ce({},e);return Object.entries(i).forEach(([s,n])=>{n!=null&&(t[s]=n)}),t}var wt=class{constructor(e,t,s){this.styles=e,this.defaultParams=t,this.normalizer=s}buildStyles(e,t){let s=new Map,n=ri(e,this.defaultParams);return this.styles.styles.forEach(r=>{typeof r!="string"&&r.forEach((o,a)=>{o&&(o=we(o,n,t));let l=this.normalizer.normalizePropertyName(a,t);o=this.normalizer.normalizeStyleValue(a,l,o,t),s.set(a,o)})}),s}};function Fn(i,e,t){return new At(i,e,t)}var At=class{constructor(e,t,s){this.name=e,this.ast=t,this._normalizer=s,this.transitionFactories=[],this.states=new Map,t.states.forEach(n=>{let r=n.options&&n.options.params||{};this.states.set(n.name,new wt(n.style,r,s))}),Qs(this.states,"true","1"),Qs(this.states,"false","0"),t.transitions.forEach(n=>{this.transitionFactories.push(new We(e,n,this.states))}),this.fallbackTransition=Rn(e,this.states,this._normalizer)}get containsQueries(){return this.ast.queryCount>0}matchTransition(e,t,s,n){return this.transitionFactories.find(o=>o.match(e,t,s,n))||null}matchStyles(e,t,s){return this.fallbackTransition.buildStyles(e,t,s)}};function Rn(i,e,t){let s=[(o,a)=>!0],n={type:_.Sequence,steps:[],options:null},r={type:_.Transition,animation:n,matchers:s,options:null,queryCount:0,depCount:0};return new We(i,r,e)}function Qs(i,e,t){i.has(e)?i.has(t)||i.set(t,i.get(e)):i.has(t)&&i.set(e,i.get(t))}var kn=new Ae,Mt=class{constructor(e,t,s){this.bodyNode=e,this._driver=t,this._normalizer=s,this._animations=new Map,this._playersById=new Map,this.players=[]}register(e,t){let s=[],n=[],r=ii(this._driver,t,s,n);if(s.length)throw Hi(s);n.length&&void 0,this._animations.set(e,r)}_buildPlayer(e,t,s){let n=e.element,r=Js(this._normalizer,e.keyframes,t,s);return this._driver.animate(n,r,e.duration,e.delay,e.easing,[],!0)}create(e,t,s={}){let n=[],r=this._animations.get(e),o,a=new Map;if(r?(o=ni(this._driver,t,r,ei,pt,new Map,new Map,s,kn,n),o.forEach(h=>{let u=O(a,h.element,new Map);h.postStyleProps.forEach(S=>u.set(S,null))})):(n.push(Gi()),o=[]),n.length)throw xi(n);a.forEach((h,u)=>{h.forEach((S,y)=>{h.set(y,this._driver.computeStyle(u,y,Q))})});let l=o.map(h=>{let u=a.get(h.element);return this._buildPlayer(h,new Map,u)}),c=te(l);return this._playersById.set(e,c),c.onDestroy(()=>this.destroy(e)),this.players.push(c),c}destroy(e){let t=this._getPlayer(e);t.destroy(),this._playersById.delete(e);let s=this.players.indexOf(t);s>=0&&this.players.splice(s,1)}_getPlayer(e){let t=this._playersById.get(e);if(!t)throw Wi(e);return t}listen(e,t,s,n){let r=Rt(t,"","","");return Ft(this._getPlayer(e),s,r,n),()=>{}}command(e,t,s,n){if(s=="register"){this.register(e,n[0]);return}if(s=="create"){let o=n[0]||{};this.create(e,t,o);return}let r=this._getPlayer(e);switch(s){case"play":r.play();break;case"pause":r.pause();break;case"reset":r.reset();break;case"restart":r.restart();break;case"finish":r.finish();break;case"init":r.init();break;case"setPosition":r.setPosition(parseFloat(n[0]));break;case"destroy":this.destroy(e);break}}},Vs="ng-animate-queued",On=".ng-animate-queued",dt="ng-animate-disabled",In=".ng-animate-disabled",Ln="ng-star-inserted",$n=".ng-star-inserted",zn=[],oi={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},Bn={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},$="__ng_removed",Me=class{get params(){return this.options.params}constructor(e,t=""){this.namespaceId=t;let s=e&&e.hasOwnProperty("value"),n=s?e.value:e;if(this.value=jn(n),s){let r=e,{value:o}=r,a=qt(r,["value"]);this.options=a}else this.options={};this.options.params||(this.options.params={})}absorbOptions(e){let t=e.params;if(t){let s=this.options.params;Object.keys(t).forEach(n=>{s[n]==null&&(s[n]=t[n])})}}},be="void",ft=new Me(be),Pt=class{constructor(e,t,s){this.id=e,this.hostElement=t,this._engine=s,this.players=[],this._triggers=new Map,this._queue=[],this._elementListeners=new Map,this._hostClassName="ng-tns-"+e,L(t,this._hostClassName)}listen(e,t,s,n){if(!this._triggers.has(t))throw Ji(s,t);if(s==null||s.length==0)throw Yi(t);if(!qn(s))throw Xi(s,t);let r=O(this._elementListeners,e,[]),o={name:t,phase:s,callback:n};r.push(o);let a=O(this._engine.statesByElement,e,new Map);return a.has(t)||(L(e,ze),L(e,ze+"-"+t),a.set(t,ft)),()=>{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 Zi(e);return t}trigger(e,t,s,n=!0){let r=this._getTrigger(t),o=new Pe(this.id,t,e),a=this._engine.statesByElement.get(e);a||(L(e,ze),L(e,ze+"-"+t),this._engine.statesByElement.set(e,a=new Map));let l=a.get(t),c=new Me(s,this.id);if(!(s&&s.hasOwnProperty("value"))&&l&&c.absorbOptions(l.options),a.set(t,c),l||(l=ft),!(c.value===be)&&l.value===c.value){if(!Vn(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(()=>{ue(e,T),V(e,w)})}return}let S=O(this._engine.playersByElement,e,[]);S.forEach(g=>{g.namespaceId==this.id&&g.triggerName==t&&g.queued&&g.destroy()});let y=r.matchTransition(l.value,c.value,e,c.params),f=!1;if(!y){if(!n)return;y=r.fallbackTransition,f=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:t,transition:y,fromState:l,toState:c,player:o,isFallbackTransition:f}),f||(L(e,Vs),o.onStart(()=>{Se(e,Vs)})),o.onDone(()=>{let g=this.players.indexOf(o);g>=0&&this.players.splice(g,1);let T=this._engine.playersByElement.get(e);if(T){let w=T.indexOf(o);w>=0&&T.splice(w,1)}}),this.players.push(o),S.push(o),o}deregister(e){this._triggers.delete(e),this._engine.statesByElement.forEach(t=>t.delete(e)),this._elementListeners.forEach((t,s)=>{this._elementListeners.set(s,t.filter(n=>n.name!=e))})}clearElementCache(e){this._engine.statesByElement.delete(e),this._elementListeners.delete(e);let t=this._engine.playersByElement.get(e);t&&(t.forEach(s=>s.destroy()),this._engine.playersByElement.delete(e))}_signalRemovalForInnerTriggers(e,t){let s=this._engine.driver.query(e,Ue,!0);s.forEach(n=>{if(n[$])return;let r=this._engine.fetchNamespacesByElement(n);r.size?r.forEach(o=>o.triggerLeaveAnimation(n,t,!1,!0)):this.clearElementCache(n)}),this._engine.afterFlushAnimationsDone(()=>s.forEach(n=>this.clearElementCache(n)))}triggerLeaveAnimation(e,t,s,n){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,be,n);h&&a.push(h)}}),a.length)return this._engine.markElementAsRemoved(this.id,e,!0,t,o),s&&te(a).onDone(()=>this._engine.processLeaveNode(e)),!0}return!1}prepareLeaveAnimationListeners(e){let t=this._elementListeners.get(e),s=this._engine.statesByElement.get(e);if(t&&s){let n=new Set;t.forEach(r=>{let o=r.name;if(n.has(o))return;n.add(o);let l=this._triggers.get(o).fallbackTransition,c=s.get(o)||ft,h=new Me(be),u=new Pe(this.id,o,e);this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:o,transition:l,fromState:c,toState:h,player:u,isFallbackTransition:!0})})}}removeNode(e,t){let s=this._engine;if(e.childElementCount&&this._signalRemovalForInnerTriggers(e,t),this.triggerLeaveAnimation(e,t,!0))return;let n=!1;if(s.totalAnimations){let r=s.players.length?s.playersByQueriedElement.get(e):[];if(r&&r.length)n=!0;else{let o=e;for(;o=o.parentNode;)if(s.statesByElement.get(o)){n=!0;break}}}if(this.prepareLeaveAnimationListeners(e),n)s.markElementAsRemoved(this.id,e,!1,t);else{let r=e[$];(!r||r===oi)&&(s.afterFlush(()=>this.clearElementCache(e)),s.destroyInnerAnimations(e),s._onRemovalComplete(e,t))}}insertNode(e,t){L(e,this._hostClassName)}drainQueuedTransitions(e){let t=[];return this._queue.forEach(s=>{let n=s.player;if(n.destroyed)return;let r=s.element,o=this._elementListeners.get(r);o&&o.forEach(a=>{if(a.name==s.triggerName){let l=Rt(r,s.triggerName,s.fromState.value,s.toState.value);l._data=e,Ft(s.player,a.phase,l,a.callback)}}),n.markedForDestroy?this._engine.afterFlush(()=>{n.destroy()}):t.push(s)}),this._queue=[],t.sort((s,n)=>{let r=s.transition.ast.depCount,o=n.transition.ast.depCount;return r==0||o==0?r-o:this._engine.driver.containsElement(s.element,n.element)?1:-1})}destroy(e){this.players.forEach(t=>t.destroy()),this._signalRemovalForInnerTriggers(this.hostElement,e)}},Dt=class{_onRemovalComplete(e,t){this.onRemovalComplete(e,t)}constructor(e,t,s){this.bodyNode=e,this.driver=t,this._normalizer=s,this.players=[],this.newHostElements=new Map,this.playersByElement=new Map,this.playersByQueriedElement=new Map,this.statesByElement=new Map,this.disabledNodes=new Set,this.totalAnimations=0,this.totalQueuedPlayers=0,this._namespaceLookup={},this._namespaceList=[],this._flushFns=[],this._whenQuietFns=[],this.namespacesByHostElement=new Map,this.collectedEnterElements=[],this.collectedLeaveElements=[],this.onRemovalComplete=(n,r)=>{}}get queuedPlayers(){let e=[];return this._namespaceList.forEach(t=>{t.players.forEach(s=>{s.queued&&e.push(s)})}),e}createNamespace(e,t){let s=new Pt(e,t,this);return this.bodyNode&&this.driver.containsElement(this.bodyNode,t)?this._balanceNamespaceList(s,t):(this.newHostElements.set(t,s),this.collectEnterElement(t)),this._namespaceLookup[e]=s}_balanceNamespaceList(e,t){let s=this._namespaceList,n=this.namespacesByHostElement;if(s.length-1>=0){let o=!1,a=this.driver.getParentElement(t);for(;a;){let l=n.get(a);if(l){let c=s.indexOf(l);s.splice(c+1,0,e),o=!0;break}a=this.driver.getParentElement(a)}o||s.unshift(e)}else s.push(e);return n.set(t,e),e}register(e,t){let s=this._namespaceLookup[e];return s||(s=this.createNamespace(e,t)),s}registerTrigger(e,t,s){let n=this._namespaceLookup[e];n&&n.register(t,s)&&this.totalAnimations++}destroy(e,t){e&&(this.afterFlush(()=>{}),this.afterFlushAnimationsDone(()=>{let s=this._fetchNamespace(e);this.namespacesByHostElement.delete(s.hostElement);let n=this._namespaceList.indexOf(s);n>=0&&this._namespaceList.splice(n,1),s.destroy(t),delete this._namespaceLookup[e]}))}_fetchNamespace(e){return this._namespaceLookup[e]}fetchNamespacesByElement(e){let t=new Set,s=this.statesByElement.get(e);if(s){for(let n of s.values())if(n.namespaceId){let r=this._fetchNamespace(n.namespaceId);r&&t.add(r)}}return t}trigger(e,t,s,n){if(je(t)){let r=this._fetchNamespace(e);if(r)return r.trigger(t,s,n),!0}return!1}insertNode(e,t,s,n){if(!je(t))return;let r=t[$];if(r&&r.setForRemoval){r.setForRemoval=!1,r.setForMove=!0;let o=this.collectedLeaveElements.indexOf(t);o>=0&&this.collectedLeaveElements.splice(o,1)}if(e){let o=this._fetchNamespace(e);o&&o.insertNode(t,s)}n&&this.collectEnterElement(t)}collectEnterElement(e){this.collectedEnterElements.push(e)}markElementAsDisabled(e,t){t?this.disabledNodes.has(e)||(this.disabledNodes.add(e),L(e,dt)):this.disabledNodes.has(e)&&(this.disabledNodes.delete(e),Se(e,dt))}removeNode(e,t,s){if(je(t)){let n=e?this._fetchNamespace(e):null;n?n.removeNode(t,s):this.markElementAsRemoved(e,t,!1,s);let r=this.namespacesByHostElement.get(t);r&&r.id!==e&&r.removeNode(t,s)}else this._onRemovalComplete(t,s)}markElementAsRemoved(e,t,s,n,r){this.collectedLeaveElements.push(t),t[$]={namespaceId:e,setForRemoval:n,hasAnimation:s,removedBeforeQueried:!1,previousTriggersValues:r}}listen(e,t,s,n,r){return je(t)?this._fetchNamespace(e).listen(t,s,n,r):()=>{}}_buildInstruction(e,t,s,n,r){return e.transition.build(this.driver,e.element,e.fromState.value,e.toState.value,s,n,e.fromState.options,e.toState.options,t,r)}destroyInnerAnimations(e){let t=this.driver.query(e,Ue,!0);t.forEach(s=>this.destroyActiveAnimationsForElement(s)),this.playersByQueriedElement.size!=0&&(t=this.driver.query(e,gt,!0),t.forEach(s=>this.finishActiveQueriedAnimationOnElement(s)))}destroyActiveAnimationsForElement(e){let t=this.playersByElement.get(e);t&&t.forEach(s=>{s.queued?s.markedForDestroy=!0:s.destroy()})}finishActiveQueriedAnimationOnElement(e){let t=this.playersByQueriedElement.get(e);t&&t.forEach(s=>s.finish())}whenRenderingDone(){return new Promise(e=>{if(this.players.length)return te(this.players).onDone(()=>e());e()})}processLeaveNode(e){let t=e[$];if(t&&t.setForRemoval){if(e[$]=oi,t.namespaceId){this.destroyInnerAnimations(e);let s=this._fetchNamespace(t.namespaceId);s&&s.clearElementCache(e)}this._onRemovalComplete(e,t.setForRemoval)}e.classList?.contains(dt)&&this.markElementAsDisabled(e,!1),this.driver.query(e,In,!0).forEach(s=>{this.markElementAsDisabled(s,!1)})}flush(e=-1){let t=[];if(this.newHostElements.size&&(this.newHostElements.forEach((s,n)=>this._balanceNamespaceList(s,n)),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(let s=0;ss()),this._flushFns=[],this._whenQuietFns.length){let s=this._whenQuietFns;this._whenQuietFns=[],t.length?te(t).onDone(()=>{s.forEach(n=>n())}):s.forEach(n=>n())}}reportError(e){throw en(e)}_flushAnimations(e,t){let s=new Ae,n=[],r=new Map,o=[],a=new Map,l=new Map,c=new Map,h=new Set;this.disabledNodes.forEach(d=>{h.add(d);let m=this.driver.query(d,On,!0);for(let p=0;p{let p=ei+g++;f.set(m,p),d.forEach(E=>L(E,p))});let T=[],w=new Set,A=new Set;for(let d=0;dw.add(E)):A.add(m))}let C=new Map,P=xs(S,Array.from(w));P.forEach((d,m)=>{let p=pt+g++;C.set(m,p),d.forEach(E=>L(E,p))}),e.push(()=>{y.forEach((d,m)=>{let p=f.get(m);d.forEach(E=>Se(E,p))}),P.forEach((d,m)=>{let p=C.get(m);d.forEach(E=>Se(E,p))}),T.forEach(d=>{this.processLeaveNode(d)})});let fe=[],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(fe.push(E),this.collectedEnterElements.length){let D=M[$];if(D&&D.setForMove){if(D.previousTriggersValues&&D.previousTriggersValues.has(p.triggerName)){let ne=D.previousTriggersValues.get(p.triggerName),I=this.statesByElement.get(p.element);if(I&&I.has(p.triggerName)){let De=I.get(p.triggerName);De.value=ne,I.set(p.triggerName,De)}}E.destroy();return}}let K=!u||!this.driver.containsElement(u,M),R=C.get(M),x=f.get(M),b=this._buildInstruction(p,s,x,R,K);if(b.errors&&b.errors.length){B.push(b);return}if(K){E.onStart(()=>ue(M,b.fromStyles)),E.onDestroy(()=>V(M,b.toStyles)),n.push(E);return}if(p.isFallbackTransition){E.onStart(()=>ue(M,b.fromStyles)),E.onDestroy(()=>V(M,b.toStyles)),n.push(E);return}let jt=[];b.timelines.forEach(D=>{D.stretchStartingKeyframe=!0,this.disabledNodes.has(D.element)||jt.push(D)}),b.timelines=jt,s.append(M,b.timelines);let Ei={instruction:b,player:E,element:M};o.push(Ei),b.queriedElements.forEach(D=>O(a,D,[]).push(E)),b.preStyleProps.forEach((D,ne)=>{if(D.size){let I=l.get(ne);I||l.set(ne,I=new Set),D.forEach((De,it)=>I.add(it))}}),b.postStyleProps.forEach((D,ne)=>{let I=c.get(ne);I||c.set(ne,I=new Set),D.forEach((De,it)=>I.add(it))})});if(B.length){let d=[];B.forEach(m=>{d.push(tn(m.triggerName,m.errors))}),fe.forEach(m=>m.destroy()),this.reportError(d)}let N=new Map,F=new Map;o.forEach(d=>{let m=d.element;s.has(m)&&(F.set(m,m),this._beforeAnimationBuild(d.player.namespaceId,d.instruction,N))}),n.forEach(d=>{let m=d.element;this._getPreviousPlayers(m,!1,d.namespaceId,d.triggerName,null).forEach(E=>{O(N,m,[]).push(E),E.destroy()})});let se=T.filter(d=>Ws(d,l,c)),me=new Map;Gs(me,this.driver,A,c,Q).forEach(d=>{Ws(d,l,c)&&se.push(d)});let ie=new Map;y.forEach((d,m)=>{Gs(ie,this.driver,new Set(d),l,$e)}),se.forEach(d=>{let m=me.get(d),p=ie.get(d);me.set(d,new Map([...m?.entries()??[],...p?.entries()??[]]))});let st=[],Bt=[],Kt={};o.forEach(d=>{let{element:m,player:p,instruction:E}=d;if(s.has(m)){if(h.has(m)){p.onDestroy(()=>V(m,E.toStyles)),p.disabled=!0,p.overrideTotalTime(E.totalTime),n.push(p);return}let M=Kt;if(F.size>1){let R=m,x=[];for(;R=R.parentNode;){let b=F.get(R);if(b){M=b;break}x.push(R)}x.forEach(b=>F.set(b,M))}let K=this._buildAnimation(p.namespaceId,E,N,r,ie,me);if(p.setRealPlayer(K),M===Kt)st.push(p);else{let R=this.playersByElement.get(M);R&&R.length&&(p.parentPlayer=te(R)),n.push(p)}}else ue(m,E.fromStyles),p.onDestroy(()=>V(m,E.toStyles)),Bt.push(p),h.has(m)&&n.push(p)}),Bt.forEach(d=>{let m=r.get(d.element);if(m&&m.length){let p=te(m);d.setRealPlayer(p)}}),n.forEach(d=>{d.parentPlayer?d.syncPlayerEvents(d.parentPlayer):d.destroy()});for(let d=0;d!K.destroyed);M.length?Un(this,m,M):this.processLeaveNode(m)}return T.length=0,st.forEach(d=>{this.players.push(d),d.onDone(()=>{d.destroy();let m=this.players.indexOf(d);this.players.splice(m,1)}),d.play()}),st}afterFlush(e){this._flushFns.push(e)}afterFlushAnimationsDone(e){this._whenQuietFns.push(e)}_getPreviousPlayers(e,t,s,n,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==be;a.forEach(c=>{c.queued||!l&&c.triggerName!=n||o.push(c)})}}return(s||n)&&(o=o.filter(a=>!(s&&s!=a.namespaceId||n&&n!=a.triggerName))),o}_beforeAnimationBuild(e,t,s){let n=t.triggerName,r=t.element,o=t.isRemovalTransition?void 0:e,a=t.isRemovalTransition?void 0:n;for(let l of t.timelines){let c=l.element,h=c!==r,u=O(s,c,[]);this._getPreviousPlayers(c,h,o,a,t.toState).forEach(y=>{let f=y.getRealPlayer();f.beforeDestroy&&f.beforeDestroy(),y.destroy(),u.push(y)})}ue(r,t.fromStyles)}_buildAnimation(e,t,s,n,r,o){let a=t.triggerName,l=t.element,c=[],h=new Set,u=new Set,S=t.timelines.map(f=>{let g=f.element;h.add(g);let T=g[$];if(T&&T.removedBeforeQueried)return new ee(f.duration,f.delay);let w=g!==l,A=Qn((s.get(g)||zn).map(N=>N.getRealPlayer())).filter(N=>{let F=N;return F.element?F.element===g:!1}),C=r.get(g),P=o.get(g),fe=Js(this._normalizer,f.keyframes,C,P),B=this._buildPlayer(f,fe,A);if(f.subTimeline&&n&&u.add(g),w){let N=new Pe(e,a,g);N.setRealPlayer(B),c.push(N)}return B});c.forEach(f=>{O(this.playersByQueriedElement,f.element,[]).push(f),f.onDone(()=>Kn(this.playersByQueriedElement,f.element,f))}),h.forEach(f=>L(f,Bs));let y=te(S);return y.onDestroy(()=>{h.forEach(f=>Se(f,Bs)),V(l,t.toStyles)}),u.forEach(f=>{O(n,f,[]).push(y)}),y}_buildPlayer(e,t,s){return t.length>0?this.driver.animate(e.element,t,e.duration,e.delay,e.easing,s):new ee(e.duration,e.delay)}},Pe=class{constructor(e,t,s){this.namespaceId=e,this.triggerName=t,this.element=s,this._player=new ee,this._containsRealPlayer=!1,this._queuedCallbacks=new Map,this.destroyed=!1,this.parentPlayer=null,this.markedForDestroy=!1,this.disabled=!1,this.queued=!0,this.totalTime=0}setRealPlayer(e){this._containsRealPlayer||(this._player=e,this._queuedCallbacks.forEach((t,s)=>{t.forEach(n=>Ft(e,s,void 0,n))}),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 Kn(i,e,t){let s=i.get(e);if(s){if(s.length){let n=s.indexOf(t);s.splice(n,1)}s.length==0&&i.delete(e)}return s}function jn(i){return i??null}function je(i){return i&&i.nodeType===1}function qn(i){return i=="start"||i=="done"}function Hs(i,e){let t=i.style.display;return i.style.display=e??"none",t}function Gs(i,e,t,s,n){let r=[];t.forEach(l=>r.push(Hs(l)));let o=[];s.forEach((l,c)=>{let h=new Map;l.forEach(u=>{let S=e.computeStyle(c,u,n);h.set(u,S),(!S||S.length==0)&&(c[$]=Bn,o.push(c))}),i.set(c,h)});let a=0;return t.forEach(l=>Hs(l,r[a++])),o}function xs(i,e){let t=new Map;if(i.forEach(a=>t.set(a,[])),e.length==0)return t;let s=1,n=new Set(e),r=new Map;function o(a){if(!a)return s;let l=r.get(a);if(l)return l;let c=a.parentNode;return t.has(c)?l=c:n.has(c)?l=s:l=o(c),r.set(a,l),l}return e.forEach(a=>{let l=o(a);l!==s&&t.get(l).push(a)}),t}function L(i,e){i.classList?.add(e)}function Se(i,e){i.classList?.remove(e)}function Un(i,e,t){te(t).onDone(()=>i.processLeaveNode(e))}function Qn(i){let e=[];return ai(i,e),e}function ai(i,e){for(let t=0;tn.add(r)):e.set(i,s),t.delete(i),!0}var Ee=class{constructor(e,t,s){this._driver=t,this._normalizer=s,this._triggerCache={},this.onRemovalComplete=(n,r)=>{},this._transitionEngine=new Dt(e.body,t,s),this._timelineEngine=new Mt(e.body,t,s),this._transitionEngine.onRemovalComplete=(n,r)=>this.onRemovalComplete(n,r)}registerTrigger(e,t,s,n,r){let o=e+"-"+n,a=this._triggerCache[o];if(!a){let l=[],c=[],h=ii(this._driver,r,l,c);if(l.length)throw Qi(n,l);c.length&&void 0,a=Fn(n,h,this._normalizer),this._triggerCache[o]=a}this._transitionEngine.registerTrigger(t,n,a)}register(e,t){this._transitionEngine.register(e,t)}destroy(e,t){this._transitionEngine.destroy(e,t)}onInsert(e,t,s,n){this._transitionEngine.insertNode(e,t,s,n)}onRemove(e,t,s){this._transitionEngine.removeNode(e,t,s)}disableAnimations(e,t){this._transitionEngine.markElementAsDisabled(e,t)}process(e,t,s,n){if(s.charAt(0)=="@"){let[r,o]=$s(s),a=n;this._timelineEngine.command(r,t,o,a)}else this._transitionEngine.trigger(e,t,s,n)}listen(e,t,s,n,r){if(s.charAt(0)=="@"){let[o,a]=$s(s);return this._timelineEngine.listen(o,t,a,r)}return this._transitionEngine.listen(e,t,s,n,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 Hn(i,e){let t=null,s=null;return Array.isArray(e)&&e.length?(t=mt(e[0]),e.length>1&&(s=mt(e[e.length-1]))):e instanceof Map&&(t=mt(e)),t||s?new Ct(i,t,s):null}var Ct=class i{static{this.initialStylesByElement=new WeakMap}constructor(e,t,s){this._element=e,this._startStyles=t,this._endStyles=s,this._state=0;let n=i.initialStylesByElement.get(e);n||i.initialStylesByElement.set(e,n=new Map),this._initialStyles=n}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&&(i.initialStylesByElement.delete(this._element),this._startStyles&&(ue(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(ue(this._element,this._endStyles),this._endStyles=null),V(this._element,this._initialStyles),this._state=3)}};function mt(i){let e=null;return i.forEach((t,s)=>{Gn(s)&&(e=e||new Map,e.set(s,t))}),e}function Gn(i){return i==="display"||i==="position"}var Je=class{constructor(e,t,s,n){this.element=e,this.keyframes=t,this.options=s,this._specialStyles=n,this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._initialized=!1,this._finished=!1,this._started=!1,this._destroyed=!1,this._originalOnDoneFns=[],this._originalOnStartFns=[],this.time=0,this.parentPlayer=null,this.currentSnapshot=new Map,this._duration=s.duration,this._delay=s.delay||0,this.time=this._duration+this._delay}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}init(){this._buildPlayer(),this._preparePlayerBeforeStart()}_buildPlayer(){if(this._initialized)return;this._initialized=!0;let e=this.keyframes;this.domPlayer=this._triggerWebAnimation(this.element,e,this.options),this._finalKeyframe=e.length?e[e.length-1]:new Map;let t=()=>this._onFinish();this.domPlayer.addEventListener("finish",t),this.onDestroy(()=>{this.domPlayer.removeEventListener("finish",t)})}_preparePlayerBeforeStart(){this._delay?this._resetDomPlayerState():this.domPlayer.pause()}_convertKeyframesToObject(e){let t=[];return e.forEach(s=>{t.push(Object.fromEntries(s))}),t}_triggerWebAnimation(e,t,s){return e.animate(this._convertKeyframesToObject(t),s)}onStart(e){this._originalOnStartFns.push(e),this._onStartFns.push(e)}onDone(e){this._originalOnDoneFns.push(e),this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}play(){this._buildPlayer(),this.hasStarted()||(this._onStartFns.forEach(e=>e()),this._onStartFns=[],this._started=!0,this._specialStyles&&this._specialStyles.start()),this.domPlayer.play()}pause(){this.init(),this.domPlayer.pause()}finish(){this.init(),this._specialStyles&&this._specialStyles.finish(),this._onFinish(),this.domPlayer.finish()}reset(){this._resetDomPlayerState(),this._destroyed=!1,this._finished=!1,this._started=!1,this._onStartFns=this._originalOnStartFns,this._onDoneFns=this._originalOnDoneFns}_resetDomPlayerState(){this.domPlayer&&this.domPlayer.cancel()}restart(){this.reset(),this.play()}hasStarted(){return this._started}destroy(){this._destroyed||(this._destroyed=!0,this._resetDomPlayerState(),this._onFinish(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}setPosition(e){this.domPlayer===void 0&&this.init(),this.domPlayer.currentTime=e*this.time}getPosition(){return+(this.domPlayer.currentTime??0)/this.time}get totalTime(){return this._delay+this._duration}beforeDestroy(){let e=new Map;this.hasStarted()&&this._finalKeyframe.forEach((s,n)=>{n!=="offset"&&e.set(n,this._finished?s:Lt(this.element,n))}),this.currentSnapshot=e}triggerCallback(e){let t=e==="start"?this._onStartFns:this._onDoneFns;t.forEach(s=>s()),t.length=0}},Ye=class{validateStyleProperty(e){return!0}validateAnimatableStyleProperty(e){return!0}containsElement(e,t){return Ys(e,t)}getParentElement(e){return kt(e)}query(e,t,s){return Xs(e,t,s)}computeStyle(e,t,s){return Lt(e,t)}animate(e,t,s,n,r,o=[]){let a=n==0?"both":"forwards",l={duration:s,delay:n,fill:a};r&&(l.easing=r);let c=new Map,h=o.filter(y=>y instanceof Je);fn(s,n)&&h.forEach(y=>{y.currentSnapshot.forEach((f,g)=>c.set(g,f))});let u=un(t).map(y=>new Map(y));u=mn(e,u,c);let S=Hn(e,u);return new Je(e,u,l,S)}};var qe="@",li="@.disabled",Xe=class{constructor(e,t,s,n){this.namespaceId=e,this.delegate=t,this.engine=s,this._onDestroy=n,this.\u0275type=0}get data(){return this.delegate.data}destroyNode(e){this.delegate.destroyNode?.(e)}destroy(){this.engine.destroy(this.namespaceId,this.delegate),this.engine.afterFlushAnimationsDone(()=>{queueMicrotask(()=>{this.delegate.destroy()})}),this._onDestroy?.()}createElement(e,t){return this.delegate.createElement(e,t)}createComment(e){return this.delegate.createComment(e)}createText(e){return this.delegate.createText(e)}appendChild(e,t){this.delegate.appendChild(e,t),this.engine.onInsert(this.namespaceId,t,e,!1)}insertBefore(e,t,s,n=!0){this.delegate.insertBefore(e,t,s),this.engine.onInsert(this.namespaceId,t,e,n)}removeChild(e,t,s){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,s,n){this.delegate.setAttribute(e,t,s,n)}removeAttribute(e,t,s){this.delegate.removeAttribute(e,t,s)}addClass(e,t){this.delegate.addClass(e,t)}removeClass(e,t){this.delegate.removeClass(e,t)}setStyle(e,t,s,n){this.delegate.setStyle(e,t,s,n)}removeStyle(e,t,s){this.delegate.removeStyle(e,t,s)}setProperty(e,t,s){t.charAt(0)==qe&&t==li?this.disableAnimations(e,!!s):this.delegate.setProperty(e,t,s)}setValue(e,t){this.delegate.setValue(e,t)}listen(e,t,s){return this.delegate.listen(e,t,s)}disableAnimations(e,t){this.engine.disableAnimations(e,t)}},Nt=class extends Xe{constructor(e,t,s,n,r){super(t,s,n,r),this.factory=e,this.namespaceId=t}setProperty(e,t,s){t.charAt(0)==qe?t.charAt(1)=="."&&t==li?(s=s===void 0?!0:!!s,this.disableAnimations(e,s)):this.engine.process(this.namespaceId,e,t.slice(1),s):this.delegate.setProperty(e,t,s)}listen(e,t,s){if(t.charAt(0)==qe){let n=xn(e),r=t.slice(1),o="";return r.charAt(0)!=qe&&([r,o]=Wn(r)),this.engine.listen(this.namespaceId,n,r,o,a=>{let l=a._data||-1;this.factory.scheduleListenerCallback(l,s,a)})}return this.delegate.listen(e,t,s)}};function xn(i){switch(i){case"body":return document.body;case"document":return document;case"window":return window;default:return i}}function Wn(i){let e=i.indexOf("."),t=i.substring(0,e),s=i.slice(e+1);return[t,s]}var Ze=class{constructor(e,t,s){this.delegate=e,this.engine=t,this._zone=s,this._currentId=0,this._microtaskId=1,this._animationCallbacksBuffer=[],this._rendererCache=new Map,this._cdRecurDepth=0,t.onRemovalComplete=(n,r)=>{r?.removeChild(null,n)}}createRenderer(e,t){let s="",n=this.delegate.createRenderer(e,t);if(!e||!t?.data?.animation){let c=this._rendererCache,h=c.get(n);if(!h){let u=()=>c.delete(n);h=new Xe(s,n,this.engine,u),c.set(n,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 Nt(this,o,n,this.engine)}begin(){this._cdRecurDepth++,this.delegate.begin&&this.delegate.begin()}_scheduleCountTask(){queueMicrotask(()=>{this._microtaskId++})}scheduleListenerCallback(e,t,s){if(e>=0&&et(s));return}let n=this._animationCallbacksBuffer;n.length==0&&queueMicrotask(()=>{this._zone.run(()=>{n.forEach(r=>{let[o,a]=r;o(a)}),this._animationCallbacksBuffer=[]})}),n.push([t,s])}end(){this._cdRecurDepth--,this._cdRecurDepth==0&&this._zone.runOutsideAngular(()=>{this._scheduleCountTask(),this.engine.flush(this._microtaskId)}),this.delegate.end&&this.delegate.end()}whenRenderingDone(){return this.engine.whenRenderingDone()}};var Yn=(()=>{class i extends Ee{constructor(t,s,n){super(t,s,n)}ngOnDestroy(){this.flush()}static{this.\u0275fac=function(s){return new(s||i)(j(os),j(he),j(de))}}static{this.\u0275prov=W({token:i,factory:i.\u0275fac})}}return i})();function Xn(){return new Ve}function Zn(i,e,t){return new Ze(i,e,t)}var ci=[{provide:de,useFactory:Xn},{provide:Ee,useClass:Yn},{provide:Jt,useFactory:Zn,deps:[ds,Ee,Ne]}],er=[{provide:he,useFactory:()=>new Ye},{provide:nt,useValue:"BrowserAnimations"},...ci],Lr=[{provide:he,useClass:Ot},{provide:nt,useValue:"NoopAnimations"},...ci];function ui(){return Yt("NgEagerAnimations"),[...er]}var et=class{http;prefix;suffix;constructor(e,t="/assets/i18n/",s=".json"){this.http=e,this.prefix=t,this.suffix=s}getTranslation(e){return this.http.get(`${this.prefix}${e}${this.suffix}`)}};function tr(i,e){if(i&1&&(U(0,"li")(1,"h2")(2,"a",1),oe(3),pe(4,"translate"),Y()()()),i&2){let t,s=e.$implicit;q(2),Fe("routerLink","/"+s.path),q(),Oe(" ",ge(4,2,((t=s.name)!==null&&t!==void 0?t:s.path)+".title")," ")}}var di=(()=>{class i{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(s){return new(s||i)}}static{this.\u0275cmp=J({type:i,selectors:[["bkd-home"]],standalone:!0,features:[X],decls:3,vars:0,consts:[[1,"mt-3"],[3,"routerLink"]],template:function(s,n){s&1&&(U(0,"ul",0),Re(1,tr,5,4,"li",null,ts),Y()),s&2&&(q(),ke(n.sections))},dependencies:[ps,_e,Le],changeDetection:0})}}return i})();var fi=(()=>{class i{constructor(){}static{this.\u0275fac=function(s){return new(s||i)}}static{this.\u0275cmp=J({type:i,selectors:[["bkd-unauthenticated"]],standalone:!0,features:[X],decls:4,vars:3,consts:[[1,"bkd-container"],[1,"alert","alert-danger","my-3"]],template:function(s,n){s&1&&(U(0,"div",0)(1,"div",1),oe(2),pe(3,"translate"),Y()()),s&2&&(q(2),Oe(" ",ge(3,1,"unauthenticated.message")," "))},dependencies:[_e,Le],encapsulation:2})}}return i})();var tt=(()=>{class i{constructor(t){this.storage=t}get isAuthenticated(){return!!this.accessToken}get accessToken(){return this.storage.getAccessToken()}static{this.\u0275fac=function(s){return new(s||i)(j(ws))}}static{this.\u0275prov=W({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();function z(){return()=>{let i=H(tt),e=H(Ie);return i.isAuthenticated?!0:(e.navigate(["/unauthenticated"]),!1)}}var mi=[{path:"dashboard",canActivate:[z()],loadChildren:()=>import("./chunk-EQCBS6DP.js").then(i=>i.DASHBOARD_ROUTES)},{path:"presence-control",canActivate:[z()],loadChildren:()=>import("./chunk-6ILHYDRU.js").then(i=>i.PRESENCE_CONTROL_ROUTES)},{path:"open-absences",canActivate:[z()],loadChildren:()=>import("./chunk-IJB6DJBC.js").then(i=>i.OPEN_ABSENCES_ROUTES)},{path:"edit-absences",canActivate:[z()],loadChildren:()=>import("./chunk-6OTM65O7.js").then(i=>i.EDIT_ABSENCES_ROUTES)},{path:"evaluate-absences",canActivate:[z()],loadChildren:()=>import("./chunk-H5OLZFFB.js").then(i=>i.EVALUATE_ABSENCES_ROUTES)},{path:"events",canActivate:[z()],loadChildren:()=>import("./chunk-DRZ46FDG.js").then(i=>i.EVENTS_ROUTES)},{path:"my-absences",canActivate:[z()],loadChildren:()=>import("./chunk-RDG4OKQL.js").then(i=>i.MY_ABSENCES_ROUTES)},{path:"my-profile",canActivate:[z()],loadChildren:()=>import("./chunk-DWOSXMEJ.js").then(i=>i.MY_PROFILE_ROUTES)},{path:"my-grades",canActivate:[z()],loadChildren:()=>import("./chunk-4KZ6VB2F.js").then(i=>i.MY_GRADES_ROUTES)},{path:"my-settings",canActivate:[z()],loadChildren:()=>import("./chunk-YHQTYVFP.js").then(i=>i.MY_SETTINGS_ROUTES)},{path:"unauthenticated",component:fi},{path:"",component:di,pathMatch:"full"}];function pi(){return(i,e)=>{let t=H(tt),s=H(Z);if(i.url.startsWith(s.apiUrl)&&t.accessToken){let n=i.headers.set("Authorization",`Bearer ${t.accessToken}`);return e(i.clone({headers:n}))}return e(i)}}function gi(){return(i,e)=>{let t=H(Z);if(!i.headers.has("X-Role-Restriction")&&t.headerRoleRestriction){let s=sr();if(s&&t.headerRoleRestriction[s]){let n=i.headers.set("X-Role-Restriction",t.headerRoleRestriction[s]);return e(i.clone({headers:n}))}}return e(i)}}function sr(){let i=H(Ie),e=i.url?Ps(i.url):null;return e?Es(e):null}function yi(){return[{provide:Wt,useClass:ir}]}var ir=(()=>{class i{constructor(t,s,n){this.ngZone=t,this.translate=s,this.toastService=n}handleError(t){console.error(String(t)),t instanceof ls||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(s){return new(s||i)(j(Ne),j(bs),j(ye))}}static{this.\u0275prov=W({token:i,factory:i.\u0275fac})}}return i})();function nr(i,e){return new et(i,`${e.scriptsAndAssetsPath}/assets/locales/`,".json")}var _i={providers:[gs(mi,ys()),us(hs([Ds(),pi(),gi()])),ui(),yi(),Ht(_e.forRoot({loader:{provide:Ts,useFactory:nr,deps:[cs,Z]}})),As()]};var Si={production:!0};Si.production&&void 0;at(Cs);at(Ns);fs(Os,_i).catch(i=>console.error(i)); +import{b as Ds}from"./chunk-2H6IFZM2.js";import{c as Ps}from"./chunk-MIRGHONI.js";import{a as As,b as Ms}from"./chunk-YUHFF3NM.js";import{r as Ss}from"./chunk-AP373D4K.js";import{a as ye}from"./chunk-B6WYZ7BT.js";import{$ as H,Aa as Jt,Ab as X,B as Qt,Da as Yt,Fd as vs,Gb as pe,Ha as Xt,Hb as ge,Hd as Ts,Id as bs,Jd as Le,Kd as _e,Ld as ws,Ma as Fe,Oa as Zt,Ra as es,Rb as os,Sa as ts,Ta as ss,Ua as Re,V as v,Va as ke,Vb as at,Wa as U,X as W,Xa as Y,Xc as _s,Ya as is,Yc as Z,Z as Vt,Zb as as,_ as j,a as Ce,aa as J,ab as ns,c as qt,cb as rs,db as rt,ea as Ht,fc as ls,gc as cs,hc as us,ia as Gt,ic as hs,ja as xt,jc as ds,k as Ut,kc as fs,nb as oe,ob as ot,pb as Oe,ra as Ne,sa as Wt,sc as ms,tc as Ie,ua as nt,uc as ps,wa as q,wc as gs,xa as re,xc as ys,yd as Es}from"./chunk-IFJN5CDK.js";function vi(i){let e=i,t=Math.floor(Math.abs(i)),s=i.toString().replace(/^[^.]*\.?/,"").length;return t===1&&s===0?1:5}var Cs=["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",vi];function Ti(i){let e=i,t=Math.floor(Math.abs(i)),s=i.toString().replace(/^[^.]*\.?/,"").length,n=parseInt(i.toString().replace(/^[^e]*(e([-+]?\d+))?/,"$2"))||0;return t===0||t===1?1:n===0&&t!==0&&t%1e6===0&&s===0||!(n>=0&&n<=5)?4:5}var Ns=["fr-CH",[["AM","PM"],void 0,void 0],void 0,[["D","L","M","M","J","V","S"],["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],["di","lu","ma","me","je","ve","sa"]],void 0,[["J","F","M","A","M","J","J","A","S","O","N","D"],["janv.","f\xE9vr.","mars","avr.","mai","juin","juil.","ao\xFBt","sept.","oct.","nov.","d\xE9c."],["janvier","f\xE9vrier","mars","avril","mai","juin","juillet","ao\xFBt","septembre","octobre","novembre","d\xE9cembre"]],void 0,[["av. J.-C.","ap. J.-C."],void 0,["avant J\xE9sus-Christ","apr\xE8s J\xE9sus-Christ"]],1,[6,0],["dd.MM.yy","d MMM y","d MMMM y","EEEE, d MMMM y"],["HH:mm","HH:mm:ss","HH:mm:ss z","HH.mm:ss 'h' zzzz"],["{1} {0}","{1}, {0}","{1} '\xE0' {0}",void 0],[",","\u202F",";","%","+","-","E","\xD7","\u2030","\u221E","NaN",":","."],["#,##0.###","#,##0%","#,##0.00\xA0\xA4","#E0"],"CHF","CHF","franc suisse",{ARS:["$AR","$"],AUD:["$AU","$"],BEF:["FB"],BMD:["$BM","$"],BND:["$BN","$"],BYN:[void 0,"\u0440."],BZD:["$BZ","$"],CAD:["$CA","$"],CLP:["$CL","$"],CNY:[void 0,"\xA5"],COP:["$CO","$"],CYP:["\xA3CY"],EGP:[void 0,"\xA3E"],FJD:["$FJ","$"],FKP:["\xA3FK","\xA3"],FRF:["F"],GBP:["\xA3GB","\xA3"],GIP:["\xA3GI","\xA3"],HKD:[void 0,"$"],IEP:["\xA3IE"],ILP:["\xA3IL"],ITL:["\u20A4IT"],JPY:[void 0,"\xA5"],KMF:[void 0,"FC"],LBP:["\xA3LB","\xA3L"],MTP:["\xA3MT"],MXN:["$MX","$"],NAD:["$NA","$"],NIO:[void 0,"$C"],NZD:["$NZ","$"],PHP:[void 0,"\u20B1"],RHD:["$RH"],RON:[void 0,"L"],RWF:[void 0,"FR"],SBD:["$SB","$"],SGD:["$SG","$"],SRD:["$SR","$"],TOP:[void 0,"$T"],TTD:["$TT","$"],TWD:[void 0,"NT$"],USD:["$US","$"],UYU:["$UY","$"],WST:["$WS"],XCD:[void 0,"$"],XPF:["FCFP"],ZMW:[void 0,"Kw"]},"ltr",Ti];function bi(i,e){if(i&1&&(U(0,"i",3),oe(1),Y()),i&2){let t=rt().$implicit;q(),ot(t.icon)}}function wi(i,e){if(i&1){let t=ns();U(0,"ngb-toast",1),rs("hidden",function(){let n=Gt(t).$implicit,r=rt();return xt(r.toastService.remove(n))}),U(1,"div",2),Xt(2,bi,2,1,"i",3),U(3,"span"),oe(4),Y()()()}if(i&2){let t=e.$implicit;Zt(t.classname),Fe("header",t.header||"")("autohide",!0),q(2),es(t.icon?2:-1),q(2),ot(t.message)}}var Rs=(()=>{class i{constructor(t){this.toastService=t}static{this.\u0275fac=function(s){return new(s||i)(re(ye))}}static{this.\u0275cmp=J({type:i,selectors:[["bkd-toast"]],standalone:!0,features:[X],decls:3,vars:2,consts:[[3,"header","class","autohide"],[3,"hidden","header","autohide"],[1,"d-flex","gap-2"],[1,"material-icons"]],template:function(s,n){s&1&&(Re(0,wi,5,6,"ngb-toast",0,ss),pe(2,"async")),s&2&&ke(ge(2,0,n.toastService.toasts$))},dependencies:[Ss,as],styles:["[_nghost-%COMP%]{position:fixed;top:0;right:0;margin:.5em;z-index:1200}[_nghost-%COMP%] > *[_ngcontent-%COMP%]{font-size:medium}"]})}}return i})();var ks=new Vt("Navigator API",{providedIn:"root",factory:()=>navigator});var Os=(()=>{class i{constructor(t,s,n,r){this.toastService=s,this.settings=n,this.navigator=r,t.initialize(),this.checkSettings()}checkSettings(){vs(_s)(this.settings).pipe(Qt(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"),Ut))).subscribe()}static{this.\u0275fac=function(s){return new(s||i)(re(Ms),re(ye),re(Z),re(ks))}}static{this.\u0275cmp=J({type:i,selectors:[["bkd-app"]],standalone:!0,features:[X],decls:2,vars:0,consts:[["aria-live","polite","aria-atomic","true"]],template:function(s,n){s&1&&is(0,"bkd-toast",0)(1,"router-outlet")},dependencies:[Rs,ms],styles:["[_nghost-%COMP%]{width:100%}"],changeDetection:0})}}return i})();var _=function(i){return i[i.State=0]="State",i[i.Transition=1]="Transition",i[i.Sequence=2]="Sequence",i[i.Group=3]="Group",i[i.Animate=4]="Animate",i[i.Keyframes=5]="Keyframes",i[i.Style=6]="Style",i[i.Trigger=7]="Trigger",i[i.Reference=8]="Reference",i[i.AnimateChild=9]="AnimateChild",i[i.AnimateRef=10]="AnimateRef",i[i.Query=11]="Query",i[i.Stagger=12]="Stagger",i}(_||{}),Q="*";function Is(i,e=null){return{type:_.Sequence,steps:i,options:e}}function lt(i){return{type:_.Style,styles:i,offset:null}}var ee=class{constructor(e=0,t=0){this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._originalOnDoneFns=[],this._originalOnStartFns=[],this._started=!1,this._destroyed=!1,this._finished=!1,this._position=0,this.parentPlayer=null,this.totalTime=e+t}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}onStart(e){this._originalOnStartFns.push(e),this._onStartFns.push(e)}onDone(e){this._originalOnDoneFns.push(e),this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}hasStarted(){return this._started}init(){}play(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}triggerMicrotask(){queueMicrotask(()=>this._onFinish())}_onStart(){this._onStartFns.forEach(e=>e()),this._onStartFns=[]}pause(){}restart(){}finish(){this._onFinish()}destroy(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}reset(){this._started=!1,this._finished=!1,this._onStartFns=this._originalOnStartFns,this._onDoneFns=this._originalOnDoneFns}setPosition(e){this._position=this.totalTime?e*this.totalTime:1}getPosition(){return this.totalTime?this._position/this.totalTime:1}triggerCallback(e){let t=e=="start"?this._onStartFns:this._onDoneFns;t.forEach(s=>s()),t.length=0}},ve=class{constructor(e){this._onDoneFns=[],this._onStartFns=[],this._finished=!1,this._started=!1,this._destroyed=!1,this._onDestroyFns=[],this.parentPlayer=null,this.totalTime=0,this.players=e;let t=0,s=0,n=0,r=this.players.length;r==0?queueMicrotask(()=>this._onFinish()):this.players.forEach(o=>{o.onDone(()=>{++t==r&&this._onFinish()}),o.onDestroy(()=>{++s==r&&this._onDestroy()}),o.onStart(()=>{++n==r&&this._onStart()})}),this.totalTime=this.players.reduce((o,a)=>Math.max(o,a.totalTime),0)}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}init(){this.players.forEach(e=>e.init())}onStart(e){this._onStartFns.push(e)}_onStart(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach(e=>e()),this._onStartFns=[])}onDone(e){this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}hasStarted(){return this._started}play(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach(e=>e.play())}pause(){this.players.forEach(e=>e.pause())}restart(){this.players.forEach(e=>e.restart())}finish(){this._onFinish(),this.players.forEach(e=>e.finish())}destroy(){this._onDestroy()}_onDestroy(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach(e=>e.destroy()),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}reset(){this.players.forEach(e=>e.reset()),this._destroyed=!1,this._finished=!1,this._started=!1}setPosition(e){let t=e*this.totalTime;this.players.forEach(s=>{let n=s.totalTime?Math.min(1,t/s.totalTime):1;s.setPosition(n)})}getPosition(){let e=this.players.reduce((t,s)=>t===null||s.totalTime>t.totalTime?s:t,null);return e!=null?e.getPosition():0}beforeDestroy(){this.players.forEach(e=>{e.beforeDestroy&&e.beforeDestroy()})}triggerCallback(e){let t=e=="start"?this._onStartFns:this._onDoneFns;t.forEach(s=>s()),t.length=0}},$e="!";function Ls(i){return new v(3e3,!1)}function Ai(){return new v(3100,!1)}function Mi(){return new v(3101,!1)}function Pi(i){return new v(3001,!1)}function Di(i){return new v(3003,!1)}function Ci(i){return new v(3004,!1)}function Ni(i,e){return new v(3005,!1)}function Fi(){return new v(3006,!1)}function Ri(){return new v(3007,!1)}function ki(i,e){return new v(3008,!1)}function Oi(i){return new v(3002,!1)}function Ii(i,e,t,s,n){return new v(3010,!1)}function Li(){return new v(3011,!1)}function $i(){return new v(3012,!1)}function zi(){return new v(3200,!1)}function Bi(){return new v(3202,!1)}function Ki(){return new v(3013,!1)}function ji(i){return new v(3014,!1)}function qi(i){return new v(3015,!1)}function Ui(i){return new v(3016,!1)}function Qi(i,e){return new v(3404,!1)}function Vi(i){return new v(3502,!1)}function Hi(i){return new v(3503,!1)}function Gi(){return new v(3300,!1)}function xi(i){return new v(3504,!1)}function Wi(i){return new v(3301,!1)}function Ji(i,e){return new v(3302,!1)}function Yi(i){return new v(3303,!1)}function Xi(i,e){return new v(3400,!1)}function Zi(i){return new v(3401,!1)}function en(i){return new v(3402,!1)}function tn(i,e){return new v(3505,!1)}function te(i){switch(i.length){case 0:return new ee;case 1:return i[0];default:return new ve(i)}}function Js(i,e,t=new Map,s=new Map){let n=[],r=[],o=-1,a=null;if(e.forEach(l=>{let c=l.get("offset"),h=c==o,u=h&&a||new Map;l.forEach((S,y)=>{let f=y,g=S;if(y!=="offset")switch(f=i.normalizePropertyName(f,n),g){case $e:g=t.get(y);break;case Q:g=s.get(y);break;default:g=i.normalizeStyleValue(y,f,g,n);break}u.set(f,g)}),h||r.push(u),a=u,o=c}),n.length)throw Vi(n);return r}function Ft(i,e,t,s){switch(e){case"start":i.onStart(()=>s(t&&ct(t,"start",i)));break;case"done":i.onDone(()=>s(t&&ct(t,"done",i)));break;case"destroy":i.onDestroy(()=>s(t&&ct(t,"destroy",i)));break}}function ct(i,e,t){let s=t.totalTime,n=!!t.disabled,r=Rt(i.element,i.triggerName,i.fromState,i.toState,e||i.phaseName,s??i.totalTime,n),o=i._data;return o!=null&&(r._data=o),r}function Rt(i,e,t,s,n="",r=0,o){return{element:i,triggerName:e,fromState:t,toState:s,phaseName:n,totalTime:r,disabled:!!o}}function O(i,e,t){let s=i.get(e);return s||i.set(e,s=t),s}function $s(i){let e=i.indexOf(":"),t=i.substring(1,e),s=i.slice(e+1);return[t,s]}var sn=typeof document>"u"?null:document.documentElement;function kt(i){let e=i.parentNode||i.host||null;return e===sn?null:e}function nn(i){return i.substring(1,6)=="ebkit"}var le=null,zs=!1;function rn(i){le||(le=on()||{},zs=le.style?"WebkitAppearance"in le.style:!1);let e=!0;return le.style&&!nn(i)&&(e=i in le.style,!e&&zs&&(e="Webkit"+i.charAt(0).toUpperCase()+i.slice(1)in le.style)),e}function on(){return typeof document<"u"?document.body:null}function Ys(i,e){for(;e;){if(e===i)return!0;e=kt(e)}return!1}function Xs(i,e,t){if(t)return Array.from(i.querySelectorAll(e));let s=i.querySelector(e);return s?[s]:[]}var Ot=(()=>{class i{validateStyleProperty(t){return rn(t)}containsElement(t,s){return Ys(t,s)}getParentElement(t){return kt(t)}query(t,s,n){return Xs(t,s,n)}computeStyle(t,s,n){return n||""}animate(t,s,n,r,o,a=[],l){return new ee(n,r)}static{this.\u0275fac=function(s){return new(s||i)}}static{this.\u0275prov=W({token:i,factory:i.\u0275fac})}}return i})(),he=class{static{this.NOOP=new Ot}},de=class{};var an=1e3,Zs="{{",ln="}}",ei="ng-enter",pt="ng-leave",ze="ng-trigger",Ue=".ng-trigger",Bs="ng-animating",gt=".ng-animating";function G(i){if(typeof i=="number")return i;let e=i.match(/^(-?[\.\d]+)(m?s)/);return!e||e.length<2?0:yt(parseFloat(e[1]),e[2])}function yt(i,e){switch(e){case"s":return i*an;default:return i}}function Qe(i,e,t){return i.hasOwnProperty("duration")?i:cn(i,e,t)}function cn(i,e,t){let s=/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i,n,r=0,o="";if(typeof i=="string"){let a=i.match(s);if(a===null)return e.push(Ls(i)),{duration:0,delay:0,easing:""};n=yt(parseFloat(a[1]),a[2]);let l=a[3];l!=null&&(r=yt(parseFloat(l),a[4]));let c=a[5];c&&(o=c)}else n=i;if(!t){let a=!1,l=e.length;n<0&&(e.push(Ai()),a=!0),r<0&&(e.push(Mi()),a=!0),a&&e.splice(l,0,Ls(i))}return{duration:n,delay:r,easing:o}}function un(i){return i.length?i[0]instanceof Map?i:i.map(e=>new Map(Object.entries(e))):[]}function V(i,e,t){e.forEach((s,n)=>{let r=It(n);t&&!t.has(n)&&t.set(n,i.style[r]),i.style[r]=s})}function ue(i,e){e.forEach((t,s)=>{let n=It(s);i.style[n]=""})}function Te(i){return Array.isArray(i)?i.length==1?i[0]:Is(i):i}function hn(i,e,t){let s=e.params||{},n=ti(i);n.length&&n.forEach(r=>{s.hasOwnProperty(r)||t.push(Pi(r))})}var _t=new RegExp(`${Zs}\\s*(.+?)\\s*${ln}`,"g");function ti(i){let e=[];if(typeof i=="string"){let t;for(;t=_t.exec(i);)e.push(t[1]);_t.lastIndex=0}return e}function we(i,e,t){let s=`${i}`,n=s.replace(_t,(r,o)=>{let a=e[o];return a==null&&(t.push(Di(o)),a=""),a.toString()});return n==s?i:n}var dn=/-+([a-z0-9])/g;function It(i){return i.replace(dn,(...e)=>e[1].toUpperCase())}function fn(i,e){return i===0||e===0}function mn(i,e,t){if(t.size&&e.length){let s=e[0],n=[];if(t.forEach((r,o)=>{s.has(o)||n.push(o),s.set(o,r)}),n.length)for(let r=1;ro.set(a,Lt(i,a)))}}return e}function k(i,e,t){switch(e.type){case _.Trigger:return i.visitTrigger(e,t);case _.State:return i.visitState(e,t);case _.Transition:return i.visitTransition(e,t);case _.Sequence:return i.visitSequence(e,t);case _.Group:return i.visitGroup(e,t);case _.Animate:return i.visitAnimate(e,t);case _.Keyframes:return i.visitKeyframes(e,t);case _.Style:return i.visitStyle(e,t);case _.Reference:return i.visitReference(e,t);case _.AnimateChild:return i.visitAnimateChild(e,t);case _.AnimateRef:return i.visitAnimateRef(e,t);case _.Query:return i.visitQuery(e,t);case _.Stagger:return i.visitStagger(e,t);default:throw Ci(e.type)}}function Lt(i,e){return window.getComputedStyle(i)[e]}var pn=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"]),Ve=class extends de{normalizePropertyName(e,t){return It(e)}normalizeStyleValue(e,t,s,n){let r="",o=s.toString().trim();if(pn.has(t)&&s!==0&&s!=="0")if(typeof s=="number")r="px";else{let a=s.match(/^[+-]?[\d\.]+([a-z]*)$/);a&&a[1].length==0&&n.push(Ni(e,s))}return o+r}};var He="*";function gn(i,e){let t=[];return typeof i=="string"?i.split(/\s*,\s*/).forEach(s=>yn(s,t,e)):t.push(i),t}function yn(i,e,t){if(i[0]==":"){let l=_n(i,t);if(typeof l=="function"){e.push(l);return}i=l}let s=i.match(/^(\*|[-\w]+)\s*()\s*(\*|[-\w]+)$/);if(s==null||s.length<4)return t.push(qi(i)),e;let n=s[1],r=s[2],o=s[3];e.push(Ks(n,o));let a=n==He&&o==He;r[0]=="<"&&!a&&e.push(Ks(o,n))}function _n(i,e){switch(i){case":enter":return"void => *";case":leave":return"* => void";case":increment":return(t,s)=>parseFloat(s)>parseFloat(t);case":decrement":return(t,s)=>parseFloat(s) *"}}var Be=new Set(["true","1"]),Ke=new Set(["false","0"]);function Ks(i,e){let t=Be.has(i)||Ke.has(i),s=Be.has(e)||Ke.has(e);return(n,r)=>{let o=i==He||i==n,a=e==He||e==r;return!o&&t&&typeof n=="boolean"&&(o=n?Be.has(i):Ke.has(i)),!a&&s&&typeof r=="boolean"&&(a=r?Be.has(e):Ke.has(e)),o&&a}}var si=":self",Sn=new RegExp(`s*${si}s*,?`,"g");function ii(i,e,t,s){return new St(i).build(e,t,s)}var js="",St=class{constructor(e){this._driver=e}build(e,t,s){let n=new Et(t);return this._resetContextStyleTimingState(n),k(this,Te(e),n)}_resetContextStyleTimingState(e){e.currentQuerySelector=js,e.collectedStyles=new Map,e.collectedStyles.set(js,new Map),e.currentTime=0}visitTrigger(e,t){let s=t.queryCount=0,n=t.depCount=0,r=[],o=[];return e.name.charAt(0)=="@"&&t.errors.push(Fi()),e.definitions.forEach(a=>{if(this._resetContextStyleTimingState(t),a.type==_.State){let l=a,c=l.name;c.toString().split(/\s*,\s*/).forEach(h=>{l.name=h,r.push(this.visitState(l,t))}),l.name=c}else if(a.type==_.Transition){let l=this.visitTransition(a,t);s+=l.queryCount,n+=l.depCount,o.push(l)}else t.errors.push(Ri())}),{type:_.Trigger,name:e.name,states:r,transitions:o,queryCount:s,depCount:n,options:null}}visitState(e,t){let s=this.visitStyle(e.styles,t),n=e.options&&e.options.params||null;if(s.containsDynamicStyles){let r=new Set,o=n||{};s.styles.forEach(a=>{a instanceof Map&&a.forEach(l=>{ti(l).forEach(c=>{o.hasOwnProperty(c)||r.add(c)})})}),r.size&&t.errors.push(ki(e.name,[...r.values()]))}return{type:_.State,name:e.name,style:s,options:n?{params:n}:null}}visitTransition(e,t){t.queryCount=0,t.depCount=0;let s=k(this,Te(e.animation),t),n=gn(e.expr,t.errors);return{type:_.Transition,matchers:n,animation:s,queryCount:t.queryCount,depCount:t.depCount,options:ce(e.options)}}visitSequence(e,t){return{type:_.Sequence,steps:e.steps.map(s=>k(this,s,t)),options:ce(e.options)}}visitGroup(e,t){let s=t.currentTime,n=0,r=e.steps.map(o=>{t.currentTime=s;let a=k(this,o,t);return n=Math.max(n,t.currentTime),a});return t.currentTime=n,{type:_.Group,steps:r,options:ce(e.options)}}visitAnimate(e,t){let s=bn(e.timings,t.errors);t.currentAnimateTimings=s;let n,r=e.styles?e.styles:lt({});if(r.type==_.Keyframes)n=this.visitKeyframes(r,t);else{let o=e.styles,a=!1;if(!o){a=!0;let c={};s.easing&&(c.easing=s.easing),o=lt(c)}t.currentTime+=s.duration+s.delay;let l=this.visitStyle(o,t);l.isEmptyStep=a,n=l}return t.currentAnimateTimings=null,{type:_.Animate,timings:s,style:n,options:null}}visitStyle(e,t){let s=this._makeStyleAst(e,t);return this._validateStyleAst(s,t),s}_makeStyleAst(e,t){let s=[],n=Array.isArray(e.styles)?e.styles:[e.styles];for(let a of n)typeof a=="string"?a===Q?s.push(a):t.errors.push(Oi(a)):s.push(new Map(Object.entries(a)));let r=!1,o=null;return s.forEach(a=>{if(a instanceof Map&&(a.has("easing")&&(o=a.get("easing"),a.delete("easing")),!r)){for(let l of a.values())if(l.toString().indexOf(Zs)>=0){r=!0;break}}}),{type:_.Style,styles:s,easing:o,offset:e.offset,containsDynamicStyles:r,options:null}}_validateStyleAst(e,t){let s=t.currentAnimateTimings,n=t.currentTime,r=t.currentTime;s&&r>0&&(r-=s.duration+s.delay),e.styles.forEach(o=>{typeof o!="string"&&o.forEach((a,l)=>{let c=t.collectedStyles.get(t.currentQuerySelector),h=c.get(l),u=!0;h&&(r!=n&&r>=h.startTime&&n<=h.endTime&&(t.errors.push(Ii(l,h.startTime,h.endTime,r,n)),u=!1),r=h.startTime),u&&c.set(l,{startTime:r,endTime:n}),t.options&&hn(a,t.options,t.errors)})})}visitKeyframes(e,t){let s={type:_.Keyframes,styles:[],options:null};if(!t.currentAnimateTimings)return t.errors.push(Li()),s;let n=1,r=0,o=[],a=!1,l=!1,c=0,h=e.steps.map(w=>{let A=this._makeStyleAst(w,t),C=A.offset!=null?A.offset:Tn(A.styles),P=0;return C!=null&&(r++,P=A.offset=C),l=l||P<0||P>1,a=a||P0&&r{let C=S>0?A==y?1:S*A:o[A],P=C*T;t.currentTime=f+g.delay+P,g.duration=P,this._validateStyleAst(w,t),w.offset=C,s.styles.push(w)}),s}visitReference(e,t){return{type:_.Reference,animation:k(this,Te(e.animation),t),options:ce(e.options)}}visitAnimateChild(e,t){return t.depCount++,{type:_.AnimateChild,options:ce(e.options)}}visitAnimateRef(e,t){return{type:_.AnimateRef,animation:this.visitReference(e.animation,t),options:ce(e.options)}}visitQuery(e,t){let s=t.currentQuerySelector,n=e.options||{};t.queryCount++,t.currentQuery=e;let[r,o]=En(e.selector);t.currentQuerySelector=s.length?s+" "+r:r,O(t.collectedStyles,t.currentQuerySelector,new Map);let a=k(this,Te(e.animation),t);return t.currentQuery=null,t.currentQuerySelector=s,{type:_.Query,selector:r,limit:n.limit||0,optional:!!n.optional,includeSelf:o,animation:a,originalSelector:e.selector,options:ce(e.options)}}visitStagger(e,t){t.currentQuery||t.errors.push(Ki());let s=e.timings==="full"?{duration:0,delay:0,easing:"full"}:Qe(e.timings,t.errors,!0);return{type:_.Stagger,animation:k(this,Te(e.animation),t),timings:s,options:null}}};function En(i){let e=!!i.split(/\s*,\s*/).find(t=>t==si);return e&&(i=i.replace(Sn,"")),i=i.replace(/@\*/g,Ue).replace(/@\w+/g,t=>Ue+"-"+t.slice(1)).replace(/:animating/g,gt),[i,e]}function vn(i){return i?Ce({},i):null}var Et=class{constructor(e){this.errors=e,this.queryCount=0,this.depCount=0,this.currentTransition=null,this.currentQuery=null,this.currentQuerySelector=null,this.currentAnimateTimings=null,this.currentTime=0,this.collectedStyles=new Map,this.options=null,this.unsupportedCSSPropertiesFound=new Set}};function Tn(i){if(typeof i=="string")return null;let e=null;if(Array.isArray(i))i.forEach(t=>{if(t instanceof Map&&t.has("offset")){let s=t;e=parseFloat(s.get("offset")),s.delete("offset")}});else if(i instanceof Map&&i.has("offset")){let t=i;e=parseFloat(t.get("offset")),t.delete("offset")}return e}function bn(i,e){if(i.hasOwnProperty("duration"))return i;if(typeof i=="number"){let r=Qe(i,e).duration;return ut(r,0,"")}let t=i;if(t.split(/\s+/).some(r=>r.charAt(0)=="{"&&r.charAt(1)=="{")){let r=ut(0,0,"");return r.dynamic=!0,r.strValue=t,r}let n=Qe(t,e);return ut(n.duration,n.delay,n.easing)}function ce(i){return i?(i=Ce({},i),i.params&&(i.params=vn(i.params))):i={},i}function ut(i,e,t){return{duration:i,delay:e,easing:t}}function $t(i,e,t,s,n,r,o=null,a=!1){return{type:1,element:i,keyframes:e,preStyleProps:t,postStyleProps:s,duration:n,delay:r,totalTime:n+r,easing:o,subTimeline:a}}var Ae=class{constructor(){this._map=new Map}get(e){return this._map.get(e)||[]}append(e,t){let s=this._map.get(e);s||this._map.set(e,s=[]),s.push(...t)}has(e){return this._map.has(e)}clear(){this._map.clear()}},wn=1,An=":enter",Mn=new RegExp(An,"g"),Pn=":leave",Dn=new RegExp(Pn,"g");function ni(i,e,t,s,n,r=new Map,o=new Map,a,l,c=[]){return new vt().buildKeyframes(i,e,t,s,n,r,o,a,l,c)}var vt=class{buildKeyframes(e,t,s,n,r,o,a,l,c,h=[]){c=c||new Ae;let u=new Tt(e,t,c,n,r,h,[]);u.options=l;let S=l.delay?G(l.delay):0;u.currentTimeline.delayNextStep(S),u.currentTimeline.setStyles([o],null,u.errors,l),k(this,s,u);let y=u.timelines.filter(f=>f.containsAnimation());if(y.length&&a.size){let f;for(let g=y.length-1;g>=0;g--){let T=y[g];if(T.element===t){f=T;break}}f&&!f.allowOnlyTimelineStyles()&&f.setStyles([a],null,u.errors,l)}return y.length?y.map(f=>f.buildKeyframes()):[$t(t,[],[],[],0,S,"",!1)]}visitTrigger(e,t){}visitState(e,t){}visitTransition(e,t){}visitAnimateChild(e,t){let s=t.subInstructions.get(t.element);if(s){let n=t.createSubContext(e.options),r=t.currentTimeline.currentTime,o=this._visitSubInstructions(s,n,n.options);r!=o&&t.transformIntoNewTimeline(o)}t.previousNode=e}visitAnimateRef(e,t){let s=t.createSubContext(e.options);s.transformIntoNewTimeline(),this._applyAnimationRefDelays([e.options,e.animation.options],t,s),this.visitReference(e.animation,s),t.transformIntoNewTimeline(s.currentTimeline.currentTime),t.previousNode=e}_applyAnimationRefDelays(e,t,s){for(let n of e){let r=n?.delay;if(r){let o=typeof r=="number"?r:G(we(r,n?.params??{},t.errors));s.delayNextStep(o)}}}_visitSubInstructions(e,t,s){let r=t.currentTimeline.currentTime,o=s.duration!=null?G(s.duration):null,a=s.delay!=null?G(s.delay):null;return o!==0&&e.forEach(l=>{let c=t.appendInstructionToTimeline(l,o,a);r=Math.max(r,c.duration+c.delay)}),r}visitReference(e,t){t.updateOptions(e.options,!0),k(this,e.animation,t),t.previousNode=e}visitSequence(e,t){let s=t.subContextCount,n=t,r=e.options;if(r&&(r.params||r.delay)&&(n=t.createSubContext(r),n.transformIntoNewTimeline(),r.delay!=null)){n.previousNode.type==_.Style&&(n.currentTimeline.snapshotCurrentStyles(),n.previousNode=Ge);let o=G(r.delay);n.delayNextStep(o)}e.steps.length&&(e.steps.forEach(o=>k(this,o,n)),n.currentTimeline.applyStylesToKeyframe(),n.subContextCount>s&&n.transformIntoNewTimeline()),t.previousNode=e}visitGroup(e,t){let s=[],n=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),n=Math.max(n,a.currentTimeline.currentTime),s.push(a.currentTimeline)}),s.forEach(o=>t.currentTimeline.mergeTimelineCollectedStyles(o)),t.transformIntoNewTimeline(n),t.previousNode=e}_visitTiming(e,t){if(e.dynamic){let s=e.strValue,n=t.params?we(s,t.params,t.errors):s;return Qe(n,t.errors)}else return{duration:e.duration,delay:e.delay,easing:e.easing}}visitAnimate(e,t){let s=t.currentAnimateTimings=this._visitTiming(e.timings,t),n=t.currentTimeline;s.delay&&(t.incrementTime(s.delay),n.snapshotCurrentStyles());let r=e.style;r.type==_.Keyframes?this.visitKeyframes(r,t):(t.incrementTime(s.duration),this.visitStyle(r,t),n.applyStylesToKeyframe()),t.currentAnimateTimings=null,t.previousNode=e}visitStyle(e,t){let s=t.currentTimeline,n=t.currentAnimateTimings;!n&&s.hasCurrentStyleProperties()&&s.forwardFrame();let r=n&&n.easing||e.easing;e.isEmptyStep?s.applyEmptyStep(r):s.setStyles(e.styles,r,t.errors,t.options),t.previousNode=e}visitKeyframes(e,t){let s=t.currentAnimateTimings,n=t.currentTimeline.duration,r=s.duration,a=t.createSubContext().currentTimeline;a.easing=s.easing,e.styles.forEach(l=>{let c=l.offset||0;a.forwardTime(c*r),a.setStyles(l.styles,l.easing,t.errors,t.options),a.applyStylesToKeyframe()}),t.currentTimeline.mergeTimelineCollectedStyles(a),t.transformIntoNewTimeline(n+r),t.previousNode=e}visitQuery(e,t){let s=t.currentTimeline.currentTime,n=e.options||{},r=n.delay?G(n.delay):0;r&&(t.previousNode.type===_.Style||s==0&&t.currentTimeline.hasCurrentStyleProperties())&&(t.currentTimeline.snapshotCurrentStyles(),t.previousNode=Ge);let o=s,a=t.invokeQuery(e.selector,e.originalSelector,e.limit,e.includeSelf,!!n.optional,t.errors);t.currentQueryTotal=a.length;let l=null;a.forEach((c,h)=>{t.currentQueryIndex=h;let u=t.createSubContext(e.options,c);r&&u.delayNextStep(r),c===t.element&&(l=u.currentTimeline),k(this,e.animation,u),u.currentTimeline.applyStylesToKeyframe();let S=u.currentTimeline.currentTime;o=Math.max(o,S)}),t.currentQueryIndex=0,t.currentQueryTotal=0,t.transformIntoNewTimeline(o),l&&(t.currentTimeline.mergeTimelineCollectedStyles(l),t.currentTimeline.snapshotCurrentStyles()),t.previousNode=e}visitStagger(e,t){let s=t.parentContext,n=t.currentTimeline,r=e.timings,o=Math.abs(r.duration),a=o*(t.currentQueryTotal-1),l=o*t.currentQueryIndex;switch(r.duration<0?"reverse":r.easing){case"reverse":l=a-l;break;case"full":l=s.currentStaggerTime;break}let h=t.currentTimeline;l&&h.delayNextStep(l);let u=h.currentTime;k(this,e.animation,t),t.previousNode=e,s.currentStaggerTime=n.currentTime-u+(n.startTime-s.currentTimeline.startTime)}},Ge={},Tt=class i{constructor(e,t,s,n,r,o,a,l){this._driver=e,this.element=t,this.subInstructions=s,this._enterClassName=n,this._leaveClassName=r,this.errors=o,this.timelines=a,this.parentContext=null,this.currentAnimateTimings=null,this.previousNode=Ge,this.subContextCount=0,this.options={},this.currentQueryIndex=0,this.currentQueryTotal=0,this.currentStaggerTime=0,this.currentTimeline=l||new xe(this._driver,t,0),a.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(e,t){if(!e)return;let s=e,n=this.options;s.duration!=null&&(n.duration=G(s.duration)),s.delay!=null&&(n.delay=G(s.delay));let r=s.params;if(r){let o=n.params;o||(o=this.options.params={}),Object.keys(r).forEach(a=>{(!t||!o.hasOwnProperty(a))&&(o[a]=we(r[a],o,this.errors))})}}_copyOptions(){let e={};if(this.options){let t=this.options.params;if(t){let s=e.params={};Object.keys(t).forEach(n=>{s[n]=t[n]})}}return e}createSubContext(e=null,t,s){let n=t||this.element,r=new i(this._driver,n,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(n,s||0));return r.previousNode=this.previousNode,r.currentAnimateTimings=this.currentAnimateTimings,r.options=this._copyOptions(),r.updateOptions(e),r.currentQueryIndex=this.currentQueryIndex,r.currentQueryTotal=this.currentQueryTotal,r.parentContext=this,this.subContextCount++,r}transformIntoNewTimeline(e){return this.previousNode=Ge,this.currentTimeline=this.currentTimeline.fork(this.element,e),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(e,t,s){let n={duration:t??e.duration,delay:this.currentTimeline.currentTime+(s??0)+e.delay,easing:""},r=new bt(this._driver,e.element,e.keyframes,e.preStyleProps,e.postStyleProps,n,e.stretchStartingKeyframe);return this.timelines.push(r),n}incrementTime(e){this.currentTimeline.forwardTime(this.currentTimeline.duration+e)}delayNextStep(e){e>0&&this.currentTimeline.delayNextStep(e)}invokeQuery(e,t,s,n,r,o){let a=[];if(n&&a.push(this.element),e.length>0){e=e.replace(Mn,"."+this._enterClassName),e=e.replace(Dn,"."+this._leaveClassName);let l=s!=1,c=this._driver.query(this.element,e,l);s!==0&&(c=s<0?c.slice(c.length+s,c.length):c.slice(0,s)),a.push(...c)}return!r&&a.length==0&&o.push(ji(t)),a}},xe=class i{constructor(e,t,s,n){this._driver=e,this.element=t,this.startTime=s,this._elementTimelineStylesLookup=n,this.duration=0,this.easing=null,this._previousKeyframe=new Map,this._currentKeyframe=new Map,this._keyframes=new Map,this._styleSummary=new Map,this._localTimelineStyles=new Map,this._pendingStyles=new Map,this._backFill=new Map,this._currentEmptyStepKeyframe=null,this._elementTimelineStylesLookup||(this._elementTimelineStylesLookup=new Map),this._globalTimelineStyles=this._elementTimelineStylesLookup.get(t),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(t,this._localTimelineStyles)),this._loadKeyframe()}containsAnimation(){switch(this._keyframes.size){case 0:return!1;case 1:return this.hasCurrentStyleProperties();default:return!0}}hasCurrentStyleProperties(){return this._currentKeyframe.size>0}get currentTime(){return this.startTime+this.duration}delayNextStep(e){let t=this._keyframes.size===1&&this._pendingStyles.size;this.duration||t?(this.forwardTime(this.currentTime+e),t&&this.snapshotCurrentStyles()):this.startTime+=e}fork(e,t){return this.applyStylesToKeyframe(),new i(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+=wn,this._loadKeyframe()}forwardTime(e){this.applyStylesToKeyframe(),this.duration=e,this._loadKeyframe()}_updateStyle(e,t){this._localTimelineStyles.set(e,t),this._globalTimelineStyles.set(e,t),this._styleSummary.set(e,{time:this.currentTime,value:t})}allowOnlyTimelineStyles(){return this._currentEmptyStepKeyframe!==this._currentKeyframe}applyEmptyStep(e){e&&this._previousKeyframe.set("easing",e);for(let[t,s]of this._globalTimelineStyles)this._backFill.set(t,s||Q),this._currentKeyframe.set(t,Q);this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(e,t,s,n){t&&this._previousKeyframe.set("easing",t);let r=n&&n.params||{},o=Cn(e,this._globalTimelineStyles);for(let[a,l]of o){let c=we(l,r,s);this._pendingStyles.set(a,c),this._localTimelineStyles.has(a)||this._backFill.set(a,this._globalTimelineStyles.get(a)??Q),this._updateStyle(a,c)}}applyStylesToKeyframe(){this._pendingStyles.size!=0&&(this._pendingStyles.forEach((e,t)=>{this._currentKeyframe.set(t,e)}),this._pendingStyles.clear(),this._localTimelineStyles.forEach((e,t)=>{this._currentKeyframe.has(t)||this._currentKeyframe.set(t,e)}))}snapshotCurrentStyles(){for(let[e,t]of this._localTimelineStyles)this._pendingStyles.set(e,t),this._updateStyle(e,t)}getFinalKeyframe(){return this._keyframes.get(this.duration)}get properties(){let e=[];for(let t in this._currentKeyframe)e.push(t);return e}mergeTimelineCollectedStyles(e){e._styleSummary.forEach((t,s)=>{let n=this._styleSummary.get(s);(!n||t.time>n.time)&&this._updateStyle(s,t.value)})}buildKeyframes(){this.applyStylesToKeyframe();let e=new Set,t=new Set,s=this._keyframes.size===1&&this.duration===0,n=[];this._keyframes.forEach((a,l)=>{let c=new Map([...this._backFill,...a]);c.forEach((h,u)=>{h===$e?e.add(u):h===Q&&t.add(u)}),s||c.set("offset",l/this.duration),n.push(c)});let r=[...e.values()],o=[...t.values()];if(s){let a=n[0],l=new Map(a);a.set("offset",0),l.set("offset",1),n=[a,l]}return $t(this.element,n,r,o,this.duration,this.startTime,this.easing,!1)}},bt=class extends xe{constructor(e,t,s,n,r,o,a=!1){super(e,t,o.delay),this.keyframes=s,this.preStyleProps=n,this.postStyleProps=r,this._stretchStartingKeyframe=a,this.timings={duration:o.duration,delay:o.delay,easing:o.easing}}containsAnimation(){return this.keyframes.length>1}buildKeyframes(){let e=this.keyframes,{delay:t,duration:s,easing:n}=this.timings;if(this._stretchStartingKeyframe&&t){let r=[],o=s+t,a=t/o,l=new Map(e[0]);l.set("offset",0),r.push(l);let c=new Map(e[0]);c.set("offset",qs(a)),r.push(c);let h=e.length-1;for(let u=1;u<=h;u++){let S=new Map(e[u]),y=S.get("offset"),f=t+y*s;S.set("offset",qs(f/o)),r.push(S)}s=o,t=0,n="",e=r}return $t(this.element,e,this.preStyleProps,this.postStyleProps,s,t,n,!0)}};function qs(i,e=3){let t=Math.pow(10,e-1);return Math.round(i*t)/t}function Cn(i,e){let t=new Map,s;return i.forEach(n=>{if(n==="*"){s??=e.keys();for(let r of s)t.set(r,Q)}else for(let[r,o]of n)t.set(r,o)}),t}function Us(i,e,t,s,n,r,o,a,l,c,h,u,S){return{type:0,element:i,triggerName:e,isRemovalTransition:n,fromState:t,fromStyles:r,toState:s,toStyles:o,timelines:a,queriedElements:l,preStyleProps:c,postStyleProps:h,totalTime:u,errors:S}}var ht={},We=class{constructor(e,t,s){this._triggerName=e,this.ast=t,this._stateStyles=s}match(e,t,s,n){return Nn(this.ast.matchers,e,t,s,n)}buildStyles(e,t,s){let n=this._stateStyles.get("*");return e!==void 0&&(n=this._stateStyles.get(e?.toString())||n),n?n.buildStyles(t,s):new Map}build(e,t,s,n,r,o,a,l,c,h){let u=[],S=this.ast.options&&this.ast.options.params||ht,y=a&&a.params||ht,f=this.buildStyles(s,y,u),g=l&&l.params||ht,T=this.buildStyles(n,g,u),w=new Set,A=new Map,C=new Map,P=n==="void",fe={params:ri(g,S),delay:this.ast.options?.delay},B=h?[]:ni(e,t,this.ast.animation,r,o,f,T,fe,c,u),N=0;return B.forEach(F=>{N=Math.max(F.duration+F.delay,N)}),u.length?Us(t,this._triggerName,s,n,P,f,T,[],[],A,C,N,u):(B.forEach(F=>{let se=F.element,me=O(A,se,new Set);F.preStyleProps.forEach(ie=>me.add(ie));let zt=O(C,se,new Set);F.postStyleProps.forEach(ie=>zt.add(ie)),se!==t&&w.add(se)}),Us(t,this._triggerName,s,n,P,f,T,B,[...w.values()],A,C,N))}};function Nn(i,e,t,s,n){return i.some(r=>r(e,t,s,n))}function ri(i,e){let t=Ce({},e);return Object.entries(i).forEach(([s,n])=>{n!=null&&(t[s]=n)}),t}var wt=class{constructor(e,t,s){this.styles=e,this.defaultParams=t,this.normalizer=s}buildStyles(e,t){let s=new Map,n=ri(e,this.defaultParams);return this.styles.styles.forEach(r=>{typeof r!="string"&&r.forEach((o,a)=>{o&&(o=we(o,n,t));let l=this.normalizer.normalizePropertyName(a,t);o=this.normalizer.normalizeStyleValue(a,l,o,t),s.set(a,o)})}),s}};function Fn(i,e,t){return new At(i,e,t)}var At=class{constructor(e,t,s){this.name=e,this.ast=t,this._normalizer=s,this.transitionFactories=[],this.states=new Map,t.states.forEach(n=>{let r=n.options&&n.options.params||{};this.states.set(n.name,new wt(n.style,r,s))}),Qs(this.states,"true","1"),Qs(this.states,"false","0"),t.transitions.forEach(n=>{this.transitionFactories.push(new We(e,n,this.states))}),this.fallbackTransition=Rn(e,this.states,this._normalizer)}get containsQueries(){return this.ast.queryCount>0}matchTransition(e,t,s,n){return this.transitionFactories.find(o=>o.match(e,t,s,n))||null}matchStyles(e,t,s){return this.fallbackTransition.buildStyles(e,t,s)}};function Rn(i,e,t){let s=[(o,a)=>!0],n={type:_.Sequence,steps:[],options:null},r={type:_.Transition,animation:n,matchers:s,options:null,queryCount:0,depCount:0};return new We(i,r,e)}function Qs(i,e,t){i.has(e)?i.has(t)||i.set(t,i.get(e)):i.has(t)&&i.set(e,i.get(t))}var kn=new Ae,Mt=class{constructor(e,t,s){this.bodyNode=e,this._driver=t,this._normalizer=s,this._animations=new Map,this._playersById=new Map,this.players=[]}register(e,t){let s=[],n=[],r=ii(this._driver,t,s,n);if(s.length)throw Hi(s);n.length&&void 0,this._animations.set(e,r)}_buildPlayer(e,t,s){let n=e.element,r=Js(this._normalizer,e.keyframes,t,s);return this._driver.animate(n,r,e.duration,e.delay,e.easing,[],!0)}create(e,t,s={}){let n=[],r=this._animations.get(e),o,a=new Map;if(r?(o=ni(this._driver,t,r,ei,pt,new Map,new Map,s,kn,n),o.forEach(h=>{let u=O(a,h.element,new Map);h.postStyleProps.forEach(S=>u.set(S,null))})):(n.push(Gi()),o=[]),n.length)throw xi(n);a.forEach((h,u)=>{h.forEach((S,y)=>{h.set(y,this._driver.computeStyle(u,y,Q))})});let l=o.map(h=>{let u=a.get(h.element);return this._buildPlayer(h,new Map,u)}),c=te(l);return this._playersById.set(e,c),c.onDestroy(()=>this.destroy(e)),this.players.push(c),c}destroy(e){let t=this._getPlayer(e);t.destroy(),this._playersById.delete(e);let s=this.players.indexOf(t);s>=0&&this.players.splice(s,1)}_getPlayer(e){let t=this._playersById.get(e);if(!t)throw Wi(e);return t}listen(e,t,s,n){let r=Rt(t,"","","");return Ft(this._getPlayer(e),s,r,n),()=>{}}command(e,t,s,n){if(s=="register"){this.register(e,n[0]);return}if(s=="create"){let o=n[0]||{};this.create(e,t,o);return}let r=this._getPlayer(e);switch(s){case"play":r.play();break;case"pause":r.pause();break;case"reset":r.reset();break;case"restart":r.restart();break;case"finish":r.finish();break;case"init":r.init();break;case"setPosition":r.setPosition(parseFloat(n[0]));break;case"destroy":this.destroy(e);break}}},Vs="ng-animate-queued",On=".ng-animate-queued",dt="ng-animate-disabled",In=".ng-animate-disabled",Ln="ng-star-inserted",$n=".ng-star-inserted",zn=[],oi={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},Bn={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},$="__ng_removed",Me=class{get params(){return this.options.params}constructor(e,t=""){this.namespaceId=t;let s=e&&e.hasOwnProperty("value"),n=s?e.value:e;if(this.value=jn(n),s){let r=e,{value:o}=r,a=qt(r,["value"]);this.options=a}else this.options={};this.options.params||(this.options.params={})}absorbOptions(e){let t=e.params;if(t){let s=this.options.params;Object.keys(t).forEach(n=>{s[n]==null&&(s[n]=t[n])})}}},be="void",ft=new Me(be),Pt=class{constructor(e,t,s){this.id=e,this.hostElement=t,this._engine=s,this.players=[],this._triggers=new Map,this._queue=[],this._elementListeners=new Map,this._hostClassName="ng-tns-"+e,L(t,this._hostClassName)}listen(e,t,s,n){if(!this._triggers.has(t))throw Ji(s,t);if(s==null||s.length==0)throw Yi(t);if(!qn(s))throw Xi(s,t);let r=O(this._elementListeners,e,[]),o={name:t,phase:s,callback:n};r.push(o);let a=O(this._engine.statesByElement,e,new Map);return a.has(t)||(L(e,ze),L(e,ze+"-"+t),a.set(t,ft)),()=>{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 Zi(e);return t}trigger(e,t,s,n=!0){let r=this._getTrigger(t),o=new Pe(this.id,t,e),a=this._engine.statesByElement.get(e);a||(L(e,ze),L(e,ze+"-"+t),this._engine.statesByElement.set(e,a=new Map));let l=a.get(t),c=new Me(s,this.id);if(!(s&&s.hasOwnProperty("value"))&&l&&c.absorbOptions(l.options),a.set(t,c),l||(l=ft),!(c.value===be)&&l.value===c.value){if(!Vn(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(()=>{ue(e,T),V(e,w)})}return}let S=O(this._engine.playersByElement,e,[]);S.forEach(g=>{g.namespaceId==this.id&&g.triggerName==t&&g.queued&&g.destroy()});let y=r.matchTransition(l.value,c.value,e,c.params),f=!1;if(!y){if(!n)return;y=r.fallbackTransition,f=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:t,transition:y,fromState:l,toState:c,player:o,isFallbackTransition:f}),f||(L(e,Vs),o.onStart(()=>{Se(e,Vs)})),o.onDone(()=>{let g=this.players.indexOf(o);g>=0&&this.players.splice(g,1);let T=this._engine.playersByElement.get(e);if(T){let w=T.indexOf(o);w>=0&&T.splice(w,1)}}),this.players.push(o),S.push(o),o}deregister(e){this._triggers.delete(e),this._engine.statesByElement.forEach(t=>t.delete(e)),this._elementListeners.forEach((t,s)=>{this._elementListeners.set(s,t.filter(n=>n.name!=e))})}clearElementCache(e){this._engine.statesByElement.delete(e),this._elementListeners.delete(e);let t=this._engine.playersByElement.get(e);t&&(t.forEach(s=>s.destroy()),this._engine.playersByElement.delete(e))}_signalRemovalForInnerTriggers(e,t){let s=this._engine.driver.query(e,Ue,!0);s.forEach(n=>{if(n[$])return;let r=this._engine.fetchNamespacesByElement(n);r.size?r.forEach(o=>o.triggerLeaveAnimation(n,t,!1,!0)):this.clearElementCache(n)}),this._engine.afterFlushAnimationsDone(()=>s.forEach(n=>this.clearElementCache(n)))}triggerLeaveAnimation(e,t,s,n){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,be,n);h&&a.push(h)}}),a.length)return this._engine.markElementAsRemoved(this.id,e,!0,t,o),s&&te(a).onDone(()=>this._engine.processLeaveNode(e)),!0}return!1}prepareLeaveAnimationListeners(e){let t=this._elementListeners.get(e),s=this._engine.statesByElement.get(e);if(t&&s){let n=new Set;t.forEach(r=>{let o=r.name;if(n.has(o))return;n.add(o);let l=this._triggers.get(o).fallbackTransition,c=s.get(o)||ft,h=new Me(be),u=new Pe(this.id,o,e);this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:o,transition:l,fromState:c,toState:h,player:u,isFallbackTransition:!0})})}}removeNode(e,t){let s=this._engine;if(e.childElementCount&&this._signalRemovalForInnerTriggers(e,t),this.triggerLeaveAnimation(e,t,!0))return;let n=!1;if(s.totalAnimations){let r=s.players.length?s.playersByQueriedElement.get(e):[];if(r&&r.length)n=!0;else{let o=e;for(;o=o.parentNode;)if(s.statesByElement.get(o)){n=!0;break}}}if(this.prepareLeaveAnimationListeners(e),n)s.markElementAsRemoved(this.id,e,!1,t);else{let r=e[$];(!r||r===oi)&&(s.afterFlush(()=>this.clearElementCache(e)),s.destroyInnerAnimations(e),s._onRemovalComplete(e,t))}}insertNode(e,t){L(e,this._hostClassName)}drainQueuedTransitions(e){let t=[];return this._queue.forEach(s=>{let n=s.player;if(n.destroyed)return;let r=s.element,o=this._elementListeners.get(r);o&&o.forEach(a=>{if(a.name==s.triggerName){let l=Rt(r,s.triggerName,s.fromState.value,s.toState.value);l._data=e,Ft(s.player,a.phase,l,a.callback)}}),n.markedForDestroy?this._engine.afterFlush(()=>{n.destroy()}):t.push(s)}),this._queue=[],t.sort((s,n)=>{let r=s.transition.ast.depCount,o=n.transition.ast.depCount;return r==0||o==0?r-o:this._engine.driver.containsElement(s.element,n.element)?1:-1})}destroy(e){this.players.forEach(t=>t.destroy()),this._signalRemovalForInnerTriggers(this.hostElement,e)}},Dt=class{_onRemovalComplete(e,t){this.onRemovalComplete(e,t)}constructor(e,t,s){this.bodyNode=e,this.driver=t,this._normalizer=s,this.players=[],this.newHostElements=new Map,this.playersByElement=new Map,this.playersByQueriedElement=new Map,this.statesByElement=new Map,this.disabledNodes=new Set,this.totalAnimations=0,this.totalQueuedPlayers=0,this._namespaceLookup={},this._namespaceList=[],this._flushFns=[],this._whenQuietFns=[],this.namespacesByHostElement=new Map,this.collectedEnterElements=[],this.collectedLeaveElements=[],this.onRemovalComplete=(n,r)=>{}}get queuedPlayers(){let e=[];return this._namespaceList.forEach(t=>{t.players.forEach(s=>{s.queued&&e.push(s)})}),e}createNamespace(e,t){let s=new Pt(e,t,this);return this.bodyNode&&this.driver.containsElement(this.bodyNode,t)?this._balanceNamespaceList(s,t):(this.newHostElements.set(t,s),this.collectEnterElement(t)),this._namespaceLookup[e]=s}_balanceNamespaceList(e,t){let s=this._namespaceList,n=this.namespacesByHostElement;if(s.length-1>=0){let o=!1,a=this.driver.getParentElement(t);for(;a;){let l=n.get(a);if(l){let c=s.indexOf(l);s.splice(c+1,0,e),o=!0;break}a=this.driver.getParentElement(a)}o||s.unshift(e)}else s.push(e);return n.set(t,e),e}register(e,t){let s=this._namespaceLookup[e];return s||(s=this.createNamespace(e,t)),s}registerTrigger(e,t,s){let n=this._namespaceLookup[e];n&&n.register(t,s)&&this.totalAnimations++}destroy(e,t){e&&(this.afterFlush(()=>{}),this.afterFlushAnimationsDone(()=>{let s=this._fetchNamespace(e);this.namespacesByHostElement.delete(s.hostElement);let n=this._namespaceList.indexOf(s);n>=0&&this._namespaceList.splice(n,1),s.destroy(t),delete this._namespaceLookup[e]}))}_fetchNamespace(e){return this._namespaceLookup[e]}fetchNamespacesByElement(e){let t=new Set,s=this.statesByElement.get(e);if(s){for(let n of s.values())if(n.namespaceId){let r=this._fetchNamespace(n.namespaceId);r&&t.add(r)}}return t}trigger(e,t,s,n){if(je(t)){let r=this._fetchNamespace(e);if(r)return r.trigger(t,s,n),!0}return!1}insertNode(e,t,s,n){if(!je(t))return;let r=t[$];if(r&&r.setForRemoval){r.setForRemoval=!1,r.setForMove=!0;let o=this.collectedLeaveElements.indexOf(t);o>=0&&this.collectedLeaveElements.splice(o,1)}if(e){let o=this._fetchNamespace(e);o&&o.insertNode(t,s)}n&&this.collectEnterElement(t)}collectEnterElement(e){this.collectedEnterElements.push(e)}markElementAsDisabled(e,t){t?this.disabledNodes.has(e)||(this.disabledNodes.add(e),L(e,dt)):this.disabledNodes.has(e)&&(this.disabledNodes.delete(e),Se(e,dt))}removeNode(e,t,s){if(je(t)){let n=e?this._fetchNamespace(e):null;n?n.removeNode(t,s):this.markElementAsRemoved(e,t,!1,s);let r=this.namespacesByHostElement.get(t);r&&r.id!==e&&r.removeNode(t,s)}else this._onRemovalComplete(t,s)}markElementAsRemoved(e,t,s,n,r){this.collectedLeaveElements.push(t),t[$]={namespaceId:e,setForRemoval:n,hasAnimation:s,removedBeforeQueried:!1,previousTriggersValues:r}}listen(e,t,s,n,r){return je(t)?this._fetchNamespace(e).listen(t,s,n,r):()=>{}}_buildInstruction(e,t,s,n,r){return e.transition.build(this.driver,e.element,e.fromState.value,e.toState.value,s,n,e.fromState.options,e.toState.options,t,r)}destroyInnerAnimations(e){let t=this.driver.query(e,Ue,!0);t.forEach(s=>this.destroyActiveAnimationsForElement(s)),this.playersByQueriedElement.size!=0&&(t=this.driver.query(e,gt,!0),t.forEach(s=>this.finishActiveQueriedAnimationOnElement(s)))}destroyActiveAnimationsForElement(e){let t=this.playersByElement.get(e);t&&t.forEach(s=>{s.queued?s.markedForDestroy=!0:s.destroy()})}finishActiveQueriedAnimationOnElement(e){let t=this.playersByQueriedElement.get(e);t&&t.forEach(s=>s.finish())}whenRenderingDone(){return new Promise(e=>{if(this.players.length)return te(this.players).onDone(()=>e());e()})}processLeaveNode(e){let t=e[$];if(t&&t.setForRemoval){if(e[$]=oi,t.namespaceId){this.destroyInnerAnimations(e);let s=this._fetchNamespace(t.namespaceId);s&&s.clearElementCache(e)}this._onRemovalComplete(e,t.setForRemoval)}e.classList?.contains(dt)&&this.markElementAsDisabled(e,!1),this.driver.query(e,In,!0).forEach(s=>{this.markElementAsDisabled(s,!1)})}flush(e=-1){let t=[];if(this.newHostElements.size&&(this.newHostElements.forEach((s,n)=>this._balanceNamespaceList(s,n)),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(let s=0;ss()),this._flushFns=[],this._whenQuietFns.length){let s=this._whenQuietFns;this._whenQuietFns=[],t.length?te(t).onDone(()=>{s.forEach(n=>n())}):s.forEach(n=>n())}}reportError(e){throw en(e)}_flushAnimations(e,t){let s=new Ae,n=[],r=new Map,o=[],a=new Map,l=new Map,c=new Map,h=new Set;this.disabledNodes.forEach(d=>{h.add(d);let m=this.driver.query(d,On,!0);for(let p=0;p{let p=ei+g++;f.set(m,p),d.forEach(E=>L(E,p))});let T=[],w=new Set,A=new Set;for(let d=0;dw.add(E)):A.add(m))}let C=new Map,P=xs(S,Array.from(w));P.forEach((d,m)=>{let p=pt+g++;C.set(m,p),d.forEach(E=>L(E,p))}),e.push(()=>{y.forEach((d,m)=>{let p=f.get(m);d.forEach(E=>Se(E,p))}),P.forEach((d,m)=>{let p=C.get(m);d.forEach(E=>Se(E,p))}),T.forEach(d=>{this.processLeaveNode(d)})});let fe=[],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(fe.push(E),this.collectedEnterElements.length){let D=M[$];if(D&&D.setForMove){if(D.previousTriggersValues&&D.previousTriggersValues.has(p.triggerName)){let ne=D.previousTriggersValues.get(p.triggerName),I=this.statesByElement.get(p.element);if(I&&I.has(p.triggerName)){let De=I.get(p.triggerName);De.value=ne,I.set(p.triggerName,De)}}E.destroy();return}}let K=!u||!this.driver.containsElement(u,M),R=C.get(M),x=f.get(M),b=this._buildInstruction(p,s,x,R,K);if(b.errors&&b.errors.length){B.push(b);return}if(K){E.onStart(()=>ue(M,b.fromStyles)),E.onDestroy(()=>V(M,b.toStyles)),n.push(E);return}if(p.isFallbackTransition){E.onStart(()=>ue(M,b.fromStyles)),E.onDestroy(()=>V(M,b.toStyles)),n.push(E);return}let jt=[];b.timelines.forEach(D=>{D.stretchStartingKeyframe=!0,this.disabledNodes.has(D.element)||jt.push(D)}),b.timelines=jt,s.append(M,b.timelines);let Ei={instruction:b,player:E,element:M};o.push(Ei),b.queriedElements.forEach(D=>O(a,D,[]).push(E)),b.preStyleProps.forEach((D,ne)=>{if(D.size){let I=l.get(ne);I||l.set(ne,I=new Set),D.forEach((De,it)=>I.add(it))}}),b.postStyleProps.forEach((D,ne)=>{let I=c.get(ne);I||c.set(ne,I=new Set),D.forEach((De,it)=>I.add(it))})});if(B.length){let d=[];B.forEach(m=>{d.push(tn(m.triggerName,m.errors))}),fe.forEach(m=>m.destroy()),this.reportError(d)}let N=new Map,F=new Map;o.forEach(d=>{let m=d.element;s.has(m)&&(F.set(m,m),this._beforeAnimationBuild(d.player.namespaceId,d.instruction,N))}),n.forEach(d=>{let m=d.element;this._getPreviousPlayers(m,!1,d.namespaceId,d.triggerName,null).forEach(E=>{O(N,m,[]).push(E),E.destroy()})});let se=T.filter(d=>Ws(d,l,c)),me=new Map;Gs(me,this.driver,A,c,Q).forEach(d=>{Ws(d,l,c)&&se.push(d)});let ie=new Map;y.forEach((d,m)=>{Gs(ie,this.driver,new Set(d),l,$e)}),se.forEach(d=>{let m=me.get(d),p=ie.get(d);me.set(d,new Map([...m?.entries()??[],...p?.entries()??[]]))});let st=[],Bt=[],Kt={};o.forEach(d=>{let{element:m,player:p,instruction:E}=d;if(s.has(m)){if(h.has(m)){p.onDestroy(()=>V(m,E.toStyles)),p.disabled=!0,p.overrideTotalTime(E.totalTime),n.push(p);return}let M=Kt;if(F.size>1){let R=m,x=[];for(;R=R.parentNode;){let b=F.get(R);if(b){M=b;break}x.push(R)}x.forEach(b=>F.set(b,M))}let K=this._buildAnimation(p.namespaceId,E,N,r,ie,me);if(p.setRealPlayer(K),M===Kt)st.push(p);else{let R=this.playersByElement.get(M);R&&R.length&&(p.parentPlayer=te(R)),n.push(p)}}else ue(m,E.fromStyles),p.onDestroy(()=>V(m,E.toStyles)),Bt.push(p),h.has(m)&&n.push(p)}),Bt.forEach(d=>{let m=r.get(d.element);if(m&&m.length){let p=te(m);d.setRealPlayer(p)}}),n.forEach(d=>{d.parentPlayer?d.syncPlayerEvents(d.parentPlayer):d.destroy()});for(let d=0;d!K.destroyed);M.length?Un(this,m,M):this.processLeaveNode(m)}return T.length=0,st.forEach(d=>{this.players.push(d),d.onDone(()=>{d.destroy();let m=this.players.indexOf(d);this.players.splice(m,1)}),d.play()}),st}afterFlush(e){this._flushFns.push(e)}afterFlushAnimationsDone(e){this._whenQuietFns.push(e)}_getPreviousPlayers(e,t,s,n,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==be;a.forEach(c=>{c.queued||!l&&c.triggerName!=n||o.push(c)})}}return(s||n)&&(o=o.filter(a=>!(s&&s!=a.namespaceId||n&&n!=a.triggerName))),o}_beforeAnimationBuild(e,t,s){let n=t.triggerName,r=t.element,o=t.isRemovalTransition?void 0:e,a=t.isRemovalTransition?void 0:n;for(let l of t.timelines){let c=l.element,h=c!==r,u=O(s,c,[]);this._getPreviousPlayers(c,h,o,a,t.toState).forEach(y=>{let f=y.getRealPlayer();f.beforeDestroy&&f.beforeDestroy(),y.destroy(),u.push(y)})}ue(r,t.fromStyles)}_buildAnimation(e,t,s,n,r,o){let a=t.triggerName,l=t.element,c=[],h=new Set,u=new Set,S=t.timelines.map(f=>{let g=f.element;h.add(g);let T=g[$];if(T&&T.removedBeforeQueried)return new ee(f.duration,f.delay);let w=g!==l,A=Qn((s.get(g)||zn).map(N=>N.getRealPlayer())).filter(N=>{let F=N;return F.element?F.element===g:!1}),C=r.get(g),P=o.get(g),fe=Js(this._normalizer,f.keyframes,C,P),B=this._buildPlayer(f,fe,A);if(f.subTimeline&&n&&u.add(g),w){let N=new Pe(e,a,g);N.setRealPlayer(B),c.push(N)}return B});c.forEach(f=>{O(this.playersByQueriedElement,f.element,[]).push(f),f.onDone(()=>Kn(this.playersByQueriedElement,f.element,f))}),h.forEach(f=>L(f,Bs));let y=te(S);return y.onDestroy(()=>{h.forEach(f=>Se(f,Bs)),V(l,t.toStyles)}),u.forEach(f=>{O(n,f,[]).push(y)}),y}_buildPlayer(e,t,s){return t.length>0?this.driver.animate(e.element,t,e.duration,e.delay,e.easing,s):new ee(e.duration,e.delay)}},Pe=class{constructor(e,t,s){this.namespaceId=e,this.triggerName=t,this.element=s,this._player=new ee,this._containsRealPlayer=!1,this._queuedCallbacks=new Map,this.destroyed=!1,this.parentPlayer=null,this.markedForDestroy=!1,this.disabled=!1,this.queued=!0,this.totalTime=0}setRealPlayer(e){this._containsRealPlayer||(this._player=e,this._queuedCallbacks.forEach((t,s)=>{t.forEach(n=>Ft(e,s,void 0,n))}),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 Kn(i,e,t){let s=i.get(e);if(s){if(s.length){let n=s.indexOf(t);s.splice(n,1)}s.length==0&&i.delete(e)}return s}function jn(i){return i??null}function je(i){return i&&i.nodeType===1}function qn(i){return i=="start"||i=="done"}function Hs(i,e){let t=i.style.display;return i.style.display=e??"none",t}function Gs(i,e,t,s,n){let r=[];t.forEach(l=>r.push(Hs(l)));let o=[];s.forEach((l,c)=>{let h=new Map;l.forEach(u=>{let S=e.computeStyle(c,u,n);h.set(u,S),(!S||S.length==0)&&(c[$]=Bn,o.push(c))}),i.set(c,h)});let a=0;return t.forEach(l=>Hs(l,r[a++])),o}function xs(i,e){let t=new Map;if(i.forEach(a=>t.set(a,[])),e.length==0)return t;let s=1,n=new Set(e),r=new Map;function o(a){if(!a)return s;let l=r.get(a);if(l)return l;let c=a.parentNode;return t.has(c)?l=c:n.has(c)?l=s:l=o(c),r.set(a,l),l}return e.forEach(a=>{let l=o(a);l!==s&&t.get(l).push(a)}),t}function L(i,e){i.classList?.add(e)}function Se(i,e){i.classList?.remove(e)}function Un(i,e,t){te(t).onDone(()=>i.processLeaveNode(e))}function Qn(i){let e=[];return ai(i,e),e}function ai(i,e){for(let t=0;tn.add(r)):e.set(i,s),t.delete(i),!0}var Ee=class{constructor(e,t,s){this._driver=t,this._normalizer=s,this._triggerCache={},this.onRemovalComplete=(n,r)=>{},this._transitionEngine=new Dt(e.body,t,s),this._timelineEngine=new Mt(e.body,t,s),this._transitionEngine.onRemovalComplete=(n,r)=>this.onRemovalComplete(n,r)}registerTrigger(e,t,s,n,r){let o=e+"-"+n,a=this._triggerCache[o];if(!a){let l=[],c=[],h=ii(this._driver,r,l,c);if(l.length)throw Qi(n,l);c.length&&void 0,a=Fn(n,h,this._normalizer),this._triggerCache[o]=a}this._transitionEngine.registerTrigger(t,n,a)}register(e,t){this._transitionEngine.register(e,t)}destroy(e,t){this._transitionEngine.destroy(e,t)}onInsert(e,t,s,n){this._transitionEngine.insertNode(e,t,s,n)}onRemove(e,t,s){this._transitionEngine.removeNode(e,t,s)}disableAnimations(e,t){this._transitionEngine.markElementAsDisabled(e,t)}process(e,t,s,n){if(s.charAt(0)=="@"){let[r,o]=$s(s),a=n;this._timelineEngine.command(r,t,o,a)}else this._transitionEngine.trigger(e,t,s,n)}listen(e,t,s,n,r){if(s.charAt(0)=="@"){let[o,a]=$s(s);return this._timelineEngine.listen(o,t,a,r)}return this._transitionEngine.listen(e,t,s,n,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 Hn(i,e){let t=null,s=null;return Array.isArray(e)&&e.length?(t=mt(e[0]),e.length>1&&(s=mt(e[e.length-1]))):e instanceof Map&&(t=mt(e)),t||s?new Ct(i,t,s):null}var Ct=class i{static{this.initialStylesByElement=new WeakMap}constructor(e,t,s){this._element=e,this._startStyles=t,this._endStyles=s,this._state=0;let n=i.initialStylesByElement.get(e);n||i.initialStylesByElement.set(e,n=new Map),this._initialStyles=n}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&&(i.initialStylesByElement.delete(this._element),this._startStyles&&(ue(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(ue(this._element,this._endStyles),this._endStyles=null),V(this._element,this._initialStyles),this._state=3)}};function mt(i){let e=null;return i.forEach((t,s)=>{Gn(s)&&(e=e||new Map,e.set(s,t))}),e}function Gn(i){return i==="display"||i==="position"}var Je=class{constructor(e,t,s,n){this.element=e,this.keyframes=t,this.options=s,this._specialStyles=n,this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._initialized=!1,this._finished=!1,this._started=!1,this._destroyed=!1,this._originalOnDoneFns=[],this._originalOnStartFns=[],this.time=0,this.parentPlayer=null,this.currentSnapshot=new Map,this._duration=s.duration,this._delay=s.delay||0,this.time=this._duration+this._delay}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}init(){this._buildPlayer(),this._preparePlayerBeforeStart()}_buildPlayer(){if(this._initialized)return;this._initialized=!0;let e=this.keyframes;this.domPlayer=this._triggerWebAnimation(this.element,e,this.options),this._finalKeyframe=e.length?e[e.length-1]:new Map;let t=()=>this._onFinish();this.domPlayer.addEventListener("finish",t),this.onDestroy(()=>{this.domPlayer.removeEventListener("finish",t)})}_preparePlayerBeforeStart(){this._delay?this._resetDomPlayerState():this.domPlayer.pause()}_convertKeyframesToObject(e){let t=[];return e.forEach(s=>{t.push(Object.fromEntries(s))}),t}_triggerWebAnimation(e,t,s){return e.animate(this._convertKeyframesToObject(t),s)}onStart(e){this._originalOnStartFns.push(e),this._onStartFns.push(e)}onDone(e){this._originalOnDoneFns.push(e),this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}play(){this._buildPlayer(),this.hasStarted()||(this._onStartFns.forEach(e=>e()),this._onStartFns=[],this._started=!0,this._specialStyles&&this._specialStyles.start()),this.domPlayer.play()}pause(){this.init(),this.domPlayer.pause()}finish(){this.init(),this._specialStyles&&this._specialStyles.finish(),this._onFinish(),this.domPlayer.finish()}reset(){this._resetDomPlayerState(),this._destroyed=!1,this._finished=!1,this._started=!1,this._onStartFns=this._originalOnStartFns,this._onDoneFns=this._originalOnDoneFns}_resetDomPlayerState(){this.domPlayer&&this.domPlayer.cancel()}restart(){this.reset(),this.play()}hasStarted(){return this._started}destroy(){this._destroyed||(this._destroyed=!0,this._resetDomPlayerState(),this._onFinish(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}setPosition(e){this.domPlayer===void 0&&this.init(),this.domPlayer.currentTime=e*this.time}getPosition(){return+(this.domPlayer.currentTime??0)/this.time}get totalTime(){return this._delay+this._duration}beforeDestroy(){let e=new Map;this.hasStarted()&&this._finalKeyframe.forEach((s,n)=>{n!=="offset"&&e.set(n,this._finished?s:Lt(this.element,n))}),this.currentSnapshot=e}triggerCallback(e){let t=e==="start"?this._onStartFns:this._onDoneFns;t.forEach(s=>s()),t.length=0}},Ye=class{validateStyleProperty(e){return!0}validateAnimatableStyleProperty(e){return!0}containsElement(e,t){return Ys(e,t)}getParentElement(e){return kt(e)}query(e,t,s){return Xs(e,t,s)}computeStyle(e,t,s){return Lt(e,t)}animate(e,t,s,n,r,o=[]){let a=n==0?"both":"forwards",l={duration:s,delay:n,fill:a};r&&(l.easing=r);let c=new Map,h=o.filter(y=>y instanceof Je);fn(s,n)&&h.forEach(y=>{y.currentSnapshot.forEach((f,g)=>c.set(g,f))});let u=un(t).map(y=>new Map(y));u=mn(e,u,c);let S=Hn(e,u);return new Je(e,u,l,S)}};var qe="@",li="@.disabled",Xe=class{constructor(e,t,s,n){this.namespaceId=e,this.delegate=t,this.engine=s,this._onDestroy=n,this.\u0275type=0}get data(){return this.delegate.data}destroyNode(e){this.delegate.destroyNode?.(e)}destroy(){this.engine.destroy(this.namespaceId,this.delegate),this.engine.afterFlushAnimationsDone(()=>{queueMicrotask(()=>{this.delegate.destroy()})}),this._onDestroy?.()}createElement(e,t){return this.delegate.createElement(e,t)}createComment(e){return this.delegate.createComment(e)}createText(e){return this.delegate.createText(e)}appendChild(e,t){this.delegate.appendChild(e,t),this.engine.onInsert(this.namespaceId,t,e,!1)}insertBefore(e,t,s,n=!0){this.delegate.insertBefore(e,t,s),this.engine.onInsert(this.namespaceId,t,e,n)}removeChild(e,t,s){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,s,n){this.delegate.setAttribute(e,t,s,n)}removeAttribute(e,t,s){this.delegate.removeAttribute(e,t,s)}addClass(e,t){this.delegate.addClass(e,t)}removeClass(e,t){this.delegate.removeClass(e,t)}setStyle(e,t,s,n){this.delegate.setStyle(e,t,s,n)}removeStyle(e,t,s){this.delegate.removeStyle(e,t,s)}setProperty(e,t,s){t.charAt(0)==qe&&t==li?this.disableAnimations(e,!!s):this.delegate.setProperty(e,t,s)}setValue(e,t){this.delegate.setValue(e,t)}listen(e,t,s){return this.delegate.listen(e,t,s)}disableAnimations(e,t){this.engine.disableAnimations(e,t)}},Nt=class extends Xe{constructor(e,t,s,n,r){super(t,s,n,r),this.factory=e,this.namespaceId=t}setProperty(e,t,s){t.charAt(0)==qe?t.charAt(1)=="."&&t==li?(s=s===void 0?!0:!!s,this.disableAnimations(e,s)):this.engine.process(this.namespaceId,e,t.slice(1),s):this.delegate.setProperty(e,t,s)}listen(e,t,s){if(t.charAt(0)==qe){let n=xn(e),r=t.slice(1),o="";return r.charAt(0)!=qe&&([r,o]=Wn(r)),this.engine.listen(this.namespaceId,n,r,o,a=>{let l=a._data||-1;this.factory.scheduleListenerCallback(l,s,a)})}return this.delegate.listen(e,t,s)}};function xn(i){switch(i){case"body":return document.body;case"document":return document;case"window":return window;default:return i}}function Wn(i){let e=i.indexOf("."),t=i.substring(0,e),s=i.slice(e+1);return[t,s]}var Ze=class{constructor(e,t,s){this.delegate=e,this.engine=t,this._zone=s,this._currentId=0,this._microtaskId=1,this._animationCallbacksBuffer=[],this._rendererCache=new Map,this._cdRecurDepth=0,t.onRemovalComplete=(n,r)=>{r?.removeChild(null,n)}}createRenderer(e,t){let s="",n=this.delegate.createRenderer(e,t);if(!e||!t?.data?.animation){let c=this._rendererCache,h=c.get(n);if(!h){let u=()=>c.delete(n);h=new Xe(s,n,this.engine,u),c.set(n,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 Nt(this,o,n,this.engine)}begin(){this._cdRecurDepth++,this.delegate.begin&&this.delegate.begin()}_scheduleCountTask(){queueMicrotask(()=>{this._microtaskId++})}scheduleListenerCallback(e,t,s){if(e>=0&&et(s));return}let n=this._animationCallbacksBuffer;n.length==0&&queueMicrotask(()=>{this._zone.run(()=>{n.forEach(r=>{let[o,a]=r;o(a)}),this._animationCallbacksBuffer=[]})}),n.push([t,s])}end(){this._cdRecurDepth--,this._cdRecurDepth==0&&this._zone.runOutsideAngular(()=>{this._scheduleCountTask(),this.engine.flush(this._microtaskId)}),this.delegate.end&&this.delegate.end()}whenRenderingDone(){return this.engine.whenRenderingDone()}};var Yn=(()=>{class i extends Ee{constructor(t,s,n){super(t,s,n)}ngOnDestroy(){this.flush()}static{this.\u0275fac=function(s){return new(s||i)(j(os),j(he),j(de))}}static{this.\u0275prov=W({token:i,factory:i.\u0275fac})}}return i})();function Xn(){return new Ve}function Zn(i,e,t){return new Ze(i,e,t)}var ci=[{provide:de,useFactory:Xn},{provide:Ee,useClass:Yn},{provide:Jt,useFactory:Zn,deps:[ds,Ee,Ne]}],er=[{provide:he,useFactory:()=>new Ye},{provide:nt,useValue:"BrowserAnimations"},...ci],Lr=[{provide:he,useClass:Ot},{provide:nt,useValue:"NoopAnimations"},...ci];function ui(){return Yt("NgEagerAnimations"),[...er]}var et=class{http;prefix;suffix;constructor(e,t="/assets/i18n/",s=".json"){this.http=e,this.prefix=t,this.suffix=s}getTranslation(e){return this.http.get(`${this.prefix}${e}${this.suffix}`)}};function tr(i,e){if(i&1&&(U(0,"li")(1,"h2")(2,"a",1),oe(3),pe(4,"translate"),Y()()()),i&2){let t,s=e.$implicit;q(2),Fe("routerLink","/"+s.path),q(),Oe(" ",ge(4,2,((t=s.name)!==null&&t!==void 0?t:s.path)+".title")," ")}}var di=(()=>{class i{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(s){return new(s||i)}}static{this.\u0275cmp=J({type:i,selectors:[["bkd-home"]],standalone:!0,features:[X],decls:3,vars:0,consts:[[1,"mt-3"],[3,"routerLink"]],template:function(s,n){s&1&&(U(0,"ul",0),Re(1,tr,5,4,"li",null,ts),Y()),s&2&&(q(),ke(n.sections))},dependencies:[ps,_e,Le],changeDetection:0})}}return i})();var fi=(()=>{class i{constructor(){}static{this.\u0275fac=function(s){return new(s||i)}}static{this.\u0275cmp=J({type:i,selectors:[["bkd-unauthenticated"]],standalone:!0,features:[X],decls:4,vars:3,consts:[[1,"bkd-container"],[1,"alert","alert-danger","my-3"]],template:function(s,n){s&1&&(U(0,"div",0)(1,"div",1),oe(2),pe(3,"translate"),Y()()),s&2&&(q(2),Oe(" ",ge(3,1,"unauthenticated.message")," "))},dependencies:[_e,Le],encapsulation:2})}}return i})();var tt=(()=>{class i{constructor(t){this.storage=t}get isAuthenticated(){return!!this.accessToken}get accessToken(){return this.storage.getAccessToken()}static{this.\u0275fac=function(s){return new(s||i)(j(ws))}}static{this.\u0275prov=W({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();function z(){return()=>{let i=H(tt),e=H(Ie);return i.isAuthenticated?!0:(e.navigate(["/unauthenticated"]),!1)}}var mi=[{path:"dashboard",canActivate:[z()],loadChildren:()=>import("./chunk-R6T5CAET.js").then(i=>i.DASHBOARD_ROUTES)},{path:"presence-control",canActivate:[z()],loadChildren:()=>import("./chunk-CRR2TBGE.js").then(i=>i.PRESENCE_CONTROL_ROUTES)},{path:"open-absences",canActivate:[z()],loadChildren:()=>import("./chunk-IJB6DJBC.js").then(i=>i.OPEN_ABSENCES_ROUTES)},{path:"edit-absences",canActivate:[z()],loadChildren:()=>import("./chunk-N753X34U.js").then(i=>i.EDIT_ABSENCES_ROUTES)},{path:"evaluate-absences",canActivate:[z()],loadChildren:()=>import("./chunk-KZHJ5VQS.js").then(i=>i.EVALUATE_ABSENCES_ROUTES)},{path:"events",canActivate:[z()],loadChildren:()=>import("./chunk-7KWP4GRQ.js").then(i=>i.EVENTS_ROUTES)},{path:"my-absences",canActivate:[z()],loadChildren:()=>import("./chunk-RDG4OKQL.js").then(i=>i.MY_ABSENCES_ROUTES)},{path:"my-profile",canActivate:[z()],loadChildren:()=>import("./chunk-6Q3B2ZQ3.js").then(i=>i.MY_PROFILE_ROUTES)},{path:"my-grades",canActivate:[z()],loadChildren:()=>import("./chunk-4KZ6VB2F.js").then(i=>i.MY_GRADES_ROUTES)},{path:"my-settings",canActivate:[z()],loadChildren:()=>import("./chunk-YHQTYVFP.js").then(i=>i.MY_SETTINGS_ROUTES)},{path:"unauthenticated",component:fi},{path:"",component:di,pathMatch:"full"}];function pi(){return(i,e)=>{let t=H(tt),s=H(Z);if(i.url.startsWith(s.apiUrl)&&t.accessToken){let n=i.headers.set("Authorization",`Bearer ${t.accessToken}`);return e(i.clone({headers:n}))}return e(i)}}function gi(){return(i,e)=>{let t=H(Z);if(!i.headers.has("X-Role-Restriction")&&t.headerRoleRestriction){let s=sr();if(s&&t.headerRoleRestriction[s]){let n=i.headers.set("X-Role-Restriction",t.headerRoleRestriction[s]);return e(i.clone({headers:n}))}}return e(i)}}function sr(){let i=H(Ie),e=i.url?Ps(i.url):null;return e?Es(e):null}function yi(){return[{provide:Wt,useClass:ir}]}var ir=(()=>{class i{constructor(t,s,n){this.ngZone=t,this.translate=s,this.toastService=n}handleError(t){console.error(String(t)),t instanceof ls||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(s){return new(s||i)(j(Ne),j(bs),j(ye))}}static{this.\u0275prov=W({token:i,factory:i.\u0275fac})}}return i})();function nr(i,e){return new et(i,`${e.scriptsAndAssetsPath}/assets/locales/`,".json")}var _i={providers:[gs(mi,ys()),us(hs([Ds(),pi(),gi()])),ui(),yi(),Ht(_e.forRoot({loader:{provide:Ts,useFactory:nr,deps:[cs,Z]}})),As()]};var Si={production:!0};Si.production&&void 0;at(Cs);at(Ns);fs(Os,_i).catch(i=>console.error(i));