1import{a as ie}from"./chunk-O2K735F6.js";import{c as Z,e as ee,o as te}from"./chunk-SGGWWVGS.js";import"./chunk-JEL6HJ7P.js";import{$a as Y,Qa as H,Ua as Q,_a as W,bb as z,gb as G,hc as K,ib as J,ic as X,n as L,o as R,q as U,sa as $,ya as O}from"./chunk-YQOD7X2Z.js";import"./chunk-563YFTIG.js";import"./chunk-36JN3LZY.js";import"./chunk-WPHW6CRH.js";import{K as q,h as j,o as F}from"./chunk-76O7YCWW.js";import{e as P}from"./chunk-YYIIKC2W.js";import"./chunk-3WYGUSDH.js";import"./chunk-LU7SZU5X.js";import{A as N,q as V}from"./chunk-PO2RDVKE.js";import{Ac as E,F as x,N as D,Pb as m,Qb as w,Rb as p,S as y,Sb as k,Tc as f,Ub as M,Uc as g,Vb as T,Wb as c,Xb as d,Yb as r,Zb as C,db as a,ec as B,jc as b,lc as u,oa as A,pa as S,pb as _,s as v,ub as I,zc as h}from"./chunk-3URBZWPM.js";import"./chunk-ODN5LVDJ.js";function se(t,s){if(t&1&&(d(0,"app-question-section",6)(1,"p"),h(2),f(3,"async"),r()()),t&2){let o,i=u();a(2),E((o=g(3,1,i.service.incidentData).organisation)==null?null:o.name)}}function oe(t,s){t&1&&C(0,"fab-loader")}function ae(t,s){if(t&1){let o=B();d(0,"div",11)(1,"fab-input-checkbox",12),b("isCheckedChange",function(n){let e=A(o).$implicit,l=u(4);return S(l.onAssessmentSelect(n,e))}),r()()}if(t&2){let o=s.$implicit;a(),c("content",o)("isChecked",o.isSelected)}}function re(t,s){t&1&&(d(0,"p"),h(1,"You have no assessments available for this date. Please check the date and change it."),r())}function de(t,s){if(t&1&&(M(0,ae,2,2,"div",11,k),f(2,"async"),m(3,re,2,0,"p"),f(4,"async")),t&2){let o,i=u(3);T(g(2,1,i.studentAssessments)),a(3),p(((o=g(4,3,i.studentAssessments))==null?null:o.length)===0?3:-1)}}function ce(t,s){if(t&1&&(d(0,"app-question-section",10)(1,"p"),h(2,"Select the assessment(s) that were affected by the incident."),r(),m(3,oe,1,0,"fab-loader"),f(4,"async"),w(5,de,5,5),r()),t&2){let o=u(2);a(3),p(g(4,1,o.studentAssessments)?5:3)}}function le(t,s){if(t&1&&m(0,ce,6,3,"app-question-section",10),t&2){let o=u();p(o.service.incidentData.value.scheduledDate?0:-1)}}var Ie=(()=>{let s=class s{constructor(i,n,e){this.service=i,this.router=n,this.auth=e,this.tooltip="Select an assessment date to continue",this.selectedAssessments=[],this.today=new Date,this.minDate=new Date(new Date(this.today).setDate(this.today.getDate()-45)),this.studentAssessmentsLoading=!0,this.studentAssessments=this.getAssessments()}ngOnInit(){this.minDate.setUTCHours(0,0,0,0),this.config=te(this.service.pathway,"assessment-details"),this.nextBtn=Z(()=>this.router.navigate(this.config.getNextStep().router),{title:`Continue to ${this.config.getNextStep().title.toLowerCase()}`}),this.setScheduledDateConfig(),this.currentUser=this.auth.getCurrentUser()}onDateSelect(i){i&&(this.selectedDate=i,this.service.updateDate(new Date(i)),this.studentAssessments=this.getAssessments())}
1onAssessmentSelect(i,n){if(i===!1){let e=this.selectedAssessments.findIndex(l=>l.assessmentId===n.id);this.selectedAssessments.splice(e,1),this.service.setStudentsInAssessment(this.selectedAssessments);return}this.currentUser.pipe(v(e=>{this.selectedAssessments.push({assessmentId:n.id,assessmentName:n.label,firstname:e.given_name,lastname:e.family_name,membershipNumber:e["custom:member_id"],assessmentVenueId:n.assessmentVenueId}),this.service.setStudentsInAssessment(this.selectedAssessments)})).pipe(D()).subscribe()}setScheduledDateConfig(){this.service.incidentData.pipe(D()).subscribe(i=>{i.scheduledDate&&(this.selectedDate=new Date(i.scheduledDate))})}getAssessments(){return this.service.incidentData.pipe(x(this.service.getAssessmentsOnDate("contact")),v(([i,n])=>(this.selectedAssessments=i.affectedStudents,n.map(e=>({label:e.assessmentName,id:e.assessmentId,isSelected:this.selectedAssessments.map(l=>l.assessmentId).includes(e.assessmentId),assessmentVenueId:e.assessmentVenueId})))),y())}isFormValid(){return this.config.showSections.includes("remote-invigilation-assessments")?this.service.incidentData.value.scheduledDate&&this.service.incidentData.value.affectedStudents.length>0:this.service.incidentData.value.scheduledDate}};s.\u0275fac=function(n){return new(n||s)(_(ee),_(P),_(U))},s.\u0275cmp=I({type:s,selectors:[["app-ir-assessment-details"]],decls:12,vars:15,consts:[[3,"config"],[1,"content-box"],["header","Assessment date",3,"step","stepTitle"],[1,"flex","flex-col","gap-2","w-full","sm:w-2/3"],["for","assessment_date",1,"text-sm"],["dateFormat","dd/mm/yy","inputId","assessment_date","data-auto","assessmentDate","fluid","",3,"ngModelChange","maxDate","minDate","ngModel","showIcon"],["header","Assessment centre"],["id","nav-btns"],["id","incident-reporting-secondary-btn",3,"button"],["id","incident-reporting-primary-btn",3,"button","tooltip","positionInput","visible","enabled"],["header","Remote invigilation assessments"],[1,"assessment"],[3,"isCheckedChange","content","isChecked"]],template:function(n,e){n&1&&(C(0,"fab-progress-indicator",0),d(1,"section",1)(2,"app-question-section",2)(3,"div",3)(4,"label",4),h(5,"Select the date when the assessment took place (up to 45 days in the past)."),r(),d(6,"p-datepicker",5),b("ngModelChange",function(ne){return e.onDateSelect(ne)}),r()()(),m(7,se,4,3,"app-question-section",6),m(8,le,1,1),r(),d(9,"section",7),C(10,"fab-button",8)(11,"fab-button",9),r()),n&2&&(c("config",e.config.progressIndicator),a(2),c("step",e.config.progressIndicator.currentStep)("stepTitle",e.config.title),a(4),c("maxDate",e.today)("minDate",e.minDate)("ngModel",e.selectedDate)("showIcon",!0),a(),p(e.config.showSections.includes("assessment-centre")?7:-1),a(),p(e.config.showSections.includes("remote-invigilation-assessments")?8:-1),a(2),c("button",e.service.genericBackButtonConfig),a(),c("button",e.nextBtn)("tooltip",e.tooltip)("positionInput","left")("visible",!e.selectedDate)("enabled",e.selectedDate))},dependencies:[O,ie,$,N,X,K,z,Q,H,Y,W,J,G,R,L,q,j,F,V],styles:[`:root{--aat-ui-grey-25: #bfbfbf;--aat-ui-grey-55: #737373;--aat-slate: #3a5066;--aat-ui-grey-05: #f2f2f2}#incident-reporting-layout #hero-container{background-color:#dce6f0;height:100px;padding:8px;text-align:center;display:flex;justify-content:center;align-items:center;border-bottom:1px solid #000000}#incident-reporting-layout #nav-btns{display:flex;flex-direction:row;justify-content:center}#incident-reporting-primary-btn{margin-left:auto}#router-content{margin:0 10%}@media (min-width: 768px){#router-content{margin:0 15%}}.assessment{border:#dce6f0 1px solid;display:flex;padding:15px;margin-top:15px;margin-bottom:15px;border-radius:3px;justify-content:space-between;align-items:center} 2`],encapsulation:2});let t=s;return t})();export{Ie as AssessmentDetailsComponent};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.