1import{a as B}from"./chunk-UHUULQR2.js";import{a as Ee}from"./chunk-7D67F2XJ.js";import"./chunk-JA2CERVR.js";import"./chunk-4FMZEUNL.js";import"./chunk-7JUHHIBN.js";import"./chunk-LIUZYIGL.js";import"./chunk-JAZCBCES.js";import"./chunk-VRNB7AJO.js";import"./chunk-QPGJH3K7.js";import"./chunk-M6UVUTS4.js";import"./chunk-AVVU4IQM.js";import"./chunk-3GTWSGHP.js";import{f as $e}from"./chunk-F3LAH7GK.js";import"./chunk-UIWGV2U6.js";import"./chunk-V3PBLJXT.js";import"./chunk-RGAEAVI4.js";import"./chunk-LYAJRAA7.js";import{n as Fe}from"./chunk-HUGXQ7YO.js";import"./chunk-QBPY7IMF.js";import"./chunk-UWUWNVX6.js";import"./chunk-5C3OIY5V.js";import"./chunk-O2JKT3NX.js";import"./chunk-YE5P6ELA.js";import"./chunk-BOZU3N7D.js";import{a as xe,b as De}from"./chunk-XMTBYMZS.js";import"./chunk-53BPQFZP.js";import"./chunk-3MJDUM2Z.js";import"./chunk-A4SRYQMI.js";import{a as J}from"./chunk-AUEIGRB4.js";import"./chunk-G6MS7VDZ.js";import"./chunk-OUSQIK6P.js";import"./chunk-UAVREOVF.js";import"./chunk-2WWVY3Z6.js";import"./chunk-5CVONPUM.js";import"./chunk-PUQZ2PIE.js";import"./chunk-BJCDYU42.js";import"./chunk-QOG7NWHO.js";import"./chunk-UTBVZPGX.js";import"./chunk-7CIBA6WV.js";import"./chunk-ZSGIDJ5I.js";import"./chunk-FYUZGN4H.js";import"./chunk-HA5UVL53.js";import"./chunk-OTBL3MSG.js";import{a as Ne}from"./chunk-B74PVDQR.js";import"./chunk-MWAKAF5U.js";import"./chunk-BQIL5I57.js";import"./chunk-4QHJRCTN.js";import"./chunk-D6HLX4YJ.js";import"./chunk-R23WVFPP.js";import{a as I}from"./chunk-GNZJIVHV.js";import{c as Pe,e as Te,h as He,v as Le,z as Ae}from"./chunk-KOQTTS5G.js";import"./chunk-6IIIQXQO.js";import"./chunk-LJLENPRV.js";import"./chunk-HIL2EYEU.js";import"./chunk-OEXHENXO.js";import"./chunk-XC5JTGP5.js";import"./chunk-XK6PXV72.js";import"./chunk-H66H7GDN.js";import{b as de,d as ue}from"./chunk-YDBBYUG6.js";import"./chunk-5ZKXSCV2.js";import{b as Me,h as Oe}from"./chunk-G4NTV4H4.js";import"./chunk-SKBWDFI7.js";import"./chunk-HN5LDCIN.js";import"./chunk-ELRWA3VR.js";import{db as ce}from"./chunk-6JXCKV3I.js";import"./chunk-YZB36ZEK.js";import"./chunk-3E4TLBPE.js";import"./chunk-YOQWGJMX.js";import"./chunk-KIY6YMFQ.js";import"./chunk-EEUNE4U7.js";import"./chunk-YSBGWY5V.js";import"./chunk-E6U6KUNX.js";import"./chunk-SOAT5ANV.js";import{a as Se,b as we,c as ke}from"./chunk-DNX2L6GZ.js";import{a as ye,b as be}from"./chunk-ZUUMSVZV.js";import"./chunk-ODHFD4CN.js";import"./chunk-CY3NACZJ.js";import"./chunk-ODIXDGVO.js";import"./chunk-CW3CCC2O.js";import"./chunk-KVLQONS5.js";import"./chunk-JJCU5L2Y.js";import{a as pe}from"./chunk-Q2T7O7RU.js";import"./chunk-GEHOVCQI.js";import{a as E,b as R}from"./chunk-XARSS6BT.js";import{K as Ce,i as fe,j as he,l as ge,p as _,s as ze,w as ve,z as _e}from"./chunk-VM5GAPOB.js";import"./chunk-XWF3DHWI.js";import"./chunk-3YLE7GMM.js";import"./chunk-4EXIS2VV.js";import"./chunk-6INWRZYZ.js";import"./chunk-SZMNBCXC.js";import"./chunk-CSS77SVE.js";import"./chunk-7RWCIHFI.js";import"./chunk-XTLQYN4R.js";import"./chunk-4ZJLZYB7.js";import"./chunk-VTPDZ64Y.js";import"./chunk-QNDFDNVO.js";import{d as F}from"./chunk-MMUJKWCA.js";import{e as me}from"./chunk-MIVTPLLS.js";import"./chunk-P2U6ME4N.js";import"./chunk-NCCDN55D.js";import"./chunk-RYPOWAVO.js";import"./chunk-ZTUFLSLO.js";import"./chunk-TLTQCCO6.js";import{i as se}from"./chunk-2UGB323M.js";import"./chunk-EIEYT4OA.js";import{b as O}from"./chunk-CMTHOT2H.js";import"./chunk-IV43SIEW.js";import{Aa as T,Db as H,Ea as b,Ec as ae,Fc as oe,Ic as z,Jb as te,Jc as M,Kc as U,Lc as re,M as Z,Q as K,R as P,Yb as L,_b as A,_c as $,ad as le,bc as u,cc as f,dc as a,ec as p,ed as c,fc as s,fd as d,gc as g,lb as n,nc as ne,od as q,pa as X,qc as ie,tc as N,va as Y,wa as ee,xb as S}from"./chunk-UAB36AYV.js";import{a as j,b as W}from"./chunk-D4ZM5DW5.js";var x=(function(e){return e.ALL="all",e.FREE="free",e.OCCUPIED="occupied",e})(x||{});var je=(e,t)=>["/",e,t],We=(e,t)=>t.id;function Ue(e,t){if(e&1&&(p(0,"nz-list-item")(1,"span",2)(2,"a",3),z(3),s(),p(4,"nz-tag"),z(5),s(),p(6,"nz-tag",4),z(7),s()()()),e&2){let i=t.$implicit,r=N();n(),a("nzGap",8),n(),a("routerLink",le(7,je,r.routes.TEACHER,i.id)),n(),re("",i.firstName," ",i.lastName),n(2),M(i.status),n(),a("nzColor",r.levelColors[i.level]??"default"),n(),M(i.level)}}function qe(e,t){e&1&&(p(0,"nz-list-item"),z(1,"No teachers found"),s())}var Re=(()=>{let t=class t{constructor(r,l){this.data=r,this.managerReportsApi=l,this.destroyRef=X(T),this.isLoading=b(!0),this.teachers=b([]),this.routes=pe,this.levelColors={Premium:"red",Gold:"gold",Silver:"default",Basic:"blue"}}ngOnInit(){this.managerReportsApi.getSlotsHeatmapTeachers(this.data.query).pipe(P(()=>this.isLoading.set(!1)),O(this.destroyRef)).subscribe(r=>this.teachers.set(r.teachers))}};t.\u0275fac=function(l){return new(l||t)(S(de),S(B))},t.\u0275cmp=H({type:t,selectors:[["math-slots-heatmap-teachers-modal"]],decls:5,vars:2,consts:[[3,"nzSpinning"],["nzSize","small"],["nz-flex","","nzAlign","center",3,"nzGap"],["target","_blank",3,"routerLink"],[3,"nzColor"]],template:function(l,o){l&1&&(p(0,"nz-spin",0)(1,"nz-list",1),u(2,Ue,8,10,"nz-list-item",null,We),L(4,qe,2,0,"nz-list-item"),s()()),l&2&&(a("nzSpinning",o.isLoading()),n(2),f(o.teachers()),n(2),A(!o.isLoading()&&o.teachers().length===0?4:-1))},dependencies:[I,Ne,R,E,xe,De,se],encapsulation:2,changeDetection:0});let e=t;return e})();var Q=()=>[12,12],w=(e,t)=>t.value,Je=(e,t)=>
1t.dayOfWeek,Qe=(e,t)=>t.label,Ze=(e,t)=>t.date;function Ke(e,t){e&1&&(z(0),c(1,"translate")),e&2&&U(" ",d(1,1,"manager_reports.slots_heatmap.report_name"),` 2`)}function Xe(e,t){if(e&1&&(g(0,"nz-option",8),c(1,"translate")),e&2){let i=t.$implicit;a("nzValue",i.value)("nzLabel",d(1,2,i.label))}}function Ye(e,t){if(e&1&&(g(0,"nz-option",8),c(1,"translate")),e&2){let i=t.$implicit;a("nzValue",i.value)("nzLabel",d(1,2,i.label))}}function et(e,t){if(e&1&&(g(0,"nz-option",8),c(1,"translate")),e&2){let i=t.$implicit;a("nzValue",i.value)("nzLabel",d(1,2,i.label))}}function tt(e,t){if(e&1&&g(0,"nz-option",8),e&2){let i=t.$implicit;a("nzValue",i.value)("nzLabel",i.label)}}function nt(e,t){if(e&1&&(g(0,"nz-option",8),c(1,"translate")),e&2){let i=t.$implicit;a("nzValue",i.value)("nzLabel",d(1,2,i.label))}}function it(e,t){if(e&1&&(g(0,"nz-option",8),c(1,"translate")),e&2){let i=t.$implicit;a("nzValue",i.value)("nzLabel",d(1,2,i.label))}}function at(e,t){if(e&1&&(g(0,"nz-option",8),c(1,"translate")),e&2){let i=t.$implicit;a("nzValue",i.value)("nzLabel",d(1,2,i.label))}}function ot(e,t){if(e&1&&(p(0,"th",18),z(1),s()),e&2){let i=t.$implicit;n(),M(i.label)}}function rt(e,t){if(e&1&&z(0),e&2){let i=N().$implicit;U(" ",i.teacherCount," ")}}function lt(e,t){if(e&1){let i=ne();p(0,"td",20),ie("click",function(){let l=Y(i).$implicit,o=N(2);return ee(o.onCellClick(l))}),L(1,rt,1,1),s()}if(e&2){let i=t.$implicit;ae("background-color",i.color),oe("clickable",i.teacherCount>0),n(),A(i.teacherCount>0?1:-1)}}function st(e,t){if(e&1&&(p(0,"tr")(1,"td",17),z(2),s(),u(3,lt,2,5,"td",19,Ze),s()),e&2){let i=t.$implicit;n(2),M(i.label),n(),f(i.cells)}}var Jt=(()=>{let t=class t{constructor(r,l,o){this.managerReportsApi=r,this.modalService=l,this.destroyRef=o,this.isLoading=b(!1),this.cells=b([]),this.regionOptions=Te(),this.statusOptions=Pe(),this.levelOptions=Object.values(ce).map(h=>({label:h,value:h})),this.specialNeedsOptions=Le(),this.studentAvailabilityOptions=Ae(),this.workingClassOptions=b([]),this.slotTypeOptions=[{value:x.ALL,label:"manager_reports.slots_heatmap.slot_type_all"},{value:x.FREE,label:"manager_reports.slots_heatmap.slot_type_free"},{value:x.OCCUPIED,label:"manager_reports.slots_heatmap.slot_type_occupied"}],this.filters=new ge({weekStart:new _(this.getMonday(new Date)),marketRegionId:new _(null),slotType:new _(x.ALL),statuses:new _([J.TRAINEE,J.REGULAR]),levels:new _([]),workingClasses:new _([]),specialNeeds:new _([]),studentAvailability:new _([])}),this.weekStartSignal=b(this.getMonday(new Date)),this.weekDays=q(()=>{let h=F.fromJSDate(this.weekStartSignal()).startOf("week");return["Mon","Tue","Wed","Thu","Fri","Sat","Sun"].map((k,C)=>{let y=h.plus({days:C});return{dayOfWeek:C+1,date:y.toISODate(),label:`${k} ${y.toFormat("dd.MM")}`}})}),this.rows=q(()=>{let h=this.cells(),D=this.weekDays(),k=h.reduce((m,v)=>Math.max(m,v.teacherCount),0)||1,C=new Map;for(let m of h){let v=F.fromJSDate(new Date(m.date)).toISODate(),G=m.teacherCount>0?Math.min(Math.ceil(m.teacherCount/k*5),5):0;C.set(`${v}_${m.hour}_${m.minute}`,W(j({},m),{date:v,color:`var(--heatmap-color-${G})`}))}let y=[];for(let m=0;m<24;m++)for(let v of[0,30]){let G=`${String(m).padStart(2,"0")}:${String(v).padStart(2,"0")}`,Ie=D.map(V=>C.get(`${V.date}_${m}_${v}`)??{dayOfWeek:V.dayOfWeek,date:V.date,hour:m,minute:v,teacherCount:0,color:"transparent"});y.push({label:G,hour:m,minute:v,cells:Ie})}return y})}ngOnInit(){this.loadHeatmap(),this.filters.controls.marketRegionId.valueChanges.pipe(O(this.destroyRef)).subscribe(r=>{this.workingClassOptions.set(r?He(r):[]),this.filters.controls.workingClasses.setValue([])}),this.filters.valueChanges.pipe(Z(300),K(),O(this.destroyRef)).subscribe(()=>{this.weekStartSignal.set(this.filters.controls.weekStart.value),this.loadHeatmap()})}onCellClick(r){if(r.teacherCount===0)return;let l=this.buildQuery(),o=`${String(r.hour).padStart(2,"0")}:${String(r.minute).padStart(2,"0")}`;this.modalService.create({nzTitle:`Teachers \u2014 ${r.date} ${o}`,nzContent:Re,nzWidth:500,nzFooter:null,nzData:{query:W(j({},l),{date:r.date,hour:r.hour,minute:r.minute})}})}loadHeatmap(){this.isLoading.set(!0);let r=this.buildQuery();this.managerReportsApi.getSlotsHeatmap(r).pipe(P(()=>this.isLoading.set(!1)),O(this.destroyRef)).subscribe(l=>this.cells.set(l.cells))}buildQuery(){let r=this.filters.controls.weekStart.value,o={weekStartDate:F.fromJSDate(r).startOf("week").toISO(),slotType:this.filters.controls.slotType.value},h=this.filters.controls.marketRegionId.value;h&&(o.marketRegionId=h);let D=this.filters.controls.statuses.value;D?.length&&(o.statuses=D);let k=this.filters.controls.levels.value;k?.length&&(o.levels=k);let C=this.filters.controls.workingClasses.value;C?.length&&(o.workingClasses=C);let y=this.filters.controls.specialNeeds.value;y?.length&&(o.specialNeeds=y);let m=this.filters.controls.studentAvailability.value;return m?.length&&(o.studentAvailability=m),o}getMonday(r){return F.fromJSDate(r).startOf("week").toJSDate()}};t.\u0275fac=function(l){return new(l||t)(S(B),S(ue),S(T))},t.\u0275cmp=H({type:t,selectors:[["math-slots-heatmap"]],decls:71,vars:42,consts:[["mathHeaderSubtitle",""],[3,"nzSpinning"],["nz-flex","","nzVertical","","nzGap","16"],["nz-form","",3,"formGroup"],["nz-row","",3,"nzGutter"],["nz-col","",3,"nzFlex"],["formControlName","weekStart","nzMode","week",1,"w-full",3,"nzPlaceHolder","nzAllowClear"],["formControlName","marketRegionId","nzAllowClear","",3,"nzPlaceHolder"],[3,"nzValue","nzLabel"],["formControlName","slotType",3,"nzPlaceHolder"],["formControlName","statuses","nzMode","multiple","nzAllowClear","",3,"nzPlaceHolder"],["formControlName","levels","nzMode","multiple","nzAllowClear","",3,"nzPlaceHolder"],["formControlName","workingClasses","nzMode","multiple","nzAllowClear","",3,"nzPlaceHolder","nzDisabled"],["formControlName","specialNeeds","nzMode","multiple","nzAllowClear","",3,"nzPlaceHolder"],["formControlName","studentAvailability","nzMode","multiple","nzAllowClear","",3,"nzPlaceHolder"],[1,"heatmap-wrapper"],[1,"heatmap-table"],[1,"time-col"],[1,"day-col"],[1,"heatmap-cell",3,"background-color","clickable"],[1,"heatmap-cell",3,"click"]],template:function(l,o){l&1&&(te(0,Ke,2,3,"ng-template",0),p(1,"nz-spin",1)(2,"div",2)(3,"form",3)(4,"div",4)(5,"div",5)(6,"nz-form-item")(7,"nz-form-control"),g(8,"nz-date-picker",6),c(9,"translate"),s()()(),p(10,"div",5)(11,"nz-form-item")(12,"nz-form-control")(13,"nz-select",7),c(14,"translate"),u(15,Xe,2,4,"nz-option",8,w),s()()()(),p(17,"div",5)(18,"nz-form-item")(19,"nz-form-control")(20,"nz-select",9),c(21,"translate"),u(22,Ye,2,4,"nz-option",8,w),s()()()()(),p(24,"div",4)(25,"div",5)(26,"nz-form-item")(27,"nz-form-control")(28,"nz-select",10),c(29,"translate"),u(30,et,2,4,"nz-option",8,w),s()()()(),p(32,"div",5)(33,"nz-form-item")(34,"nz-form-control")(35,"nz-select",11),c(36,"translate"),u(37,tt,1,2,"nz-option",8,w),s()()()(),p(39,"div",5)(40,"nz-form-item")(41,"nz-form-control")(42,"nz-select",12),c(43,"translate"),u(44,nt,2,4,"nz-option",8,w),s()()()()(),p(46,"div",4)(47,"div",5)(48,"nz-form-item")(49,"nz-form-control")(50,"nz-select",13),c(51,"translate"),u(52,it,2,4,"nz-option",8,w),s()()()(),p(54,"div",5)(55,"nz-form-item")(56,"nz-form-control")(57,"nz-select",14),c(58,"translate"),u(59,at,2,4,"nz-option",8,w),s()()()()()(),p(61,"div",15)(62,"table",16)(63,"thead")(64,"tr"),g(65,"th",17),u(66,ot,2,1,"th",18,Je),s()(),p(68,"tbody"),u(69,st,5,1,"tr",null,Qe),s()()()()()),l&2&&(n(),a("nzSpinning",o.isLoading()),n(2),a("formGroup",o.filters),n(),a("nzGutter",$(39,Q)),n(),a("nzFlex","auto"),n(3),a("nzPlaceHolder",d(9,23,"manager_reports.slots_heatmap.week"))("nzAllowClear",!1),n(2),a("nzFlex","auto"),n(3),a("nzPlaceHolder",d(14,25,"manager_reports.slots_heatmap.market_region")),n(2),f(o.regionOptions),n(2),a("nzFlex","auto"),n(3),a("nzPlaceHolder",d(21,27,"manager_reports.slots_heatmap.slot_type")),n(2),f(o.slotTypeOptions),n(2),a("nzGutter",$(40,Q)),n(),a("nzFlex","auto"),n(3),a("nzPlaceHolder",d(29,29,"manager_reports.slots_heatmap.teacher_status")),n(2),f(o.statusOptions),n(2),a("nzFlex","auto"),n(3),a("nzPlaceHolder",d(36,31,"manager_reports.slots_heatmap.level")),n(2),f(o.levelOptions),n(2),a("nzFlex","auto"),n(3),a("nzPlaceHolder",d(43,33,"manager_reports.slots_heatmap.working_class"))("nzDisabled",!o.filters.controls.marketRegionId.value),n(2),f(o.workingClassOptions()),n(2),a("nzGutter",$(41,Q)),n(),a("nzFlex","auto"),n(3),a("nzPlaceHolder",d(51,35,"manager_reports.slots_heatmap.special_needs")),n(2),f(o.specialNeedsOptions),n(2),a("nzFlex","auto"),n(3),a("nzPlaceHolder",d(58,37,"manager_reports.slots_heatmap.student_availability")),n(2),f(o.studentAvailabilityOptions),n(7),f(o.weekDays()),n(3),f(o.rows()))},dependencies:[Fe,Ce,ze,fe,he,ve,_e,ye,be,Se,ke,we,$e,Me,Oe,I,R,E,Ee,me],styles:["[_nghost-%COMP%]{--heatmap-color-0: transparent;--heatmap-color-1: var(--math-blue-1);--heatmap-color-2: var(--math-blue-2);--heatmap-color-3: var(--math-blue-3);--heatmap-color-4: var(--math-blue-4);--heatmap-color-5: var(--math-blue-5)}.w-full[_ngcontent-%COMP%]{width:100%}nz-form-item[_ngcontent-%COMP%]{margin:0}form[_ngcontent-%COMP%]{margin-bottom:8px}.heatmap-wrapper[_ngcontent-%COMP%]{overflow-x:auto}.heatmap-table[_ngcontent-%COMP%]{border-collapse:collapse;width:100%;font-size:12px}.heatmap-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .heatmap-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{border:1px solid var(--math-border);text-align:center;padding:2px 4px}.heatmap-table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{position:sticky;top:0;background:var(--math-surface);font-weight:500;padding:6px 4px;white-space:nowrap;z-index:1}.heatmap-table[_ngcontent-%COMP%] .time-col[_ngcontent-%COMP%]{width:60px;min-width:60px;font-weight:500;background:var(--math-surface);position:sticky;left:0;z-index:1;white-space:nowrap}.heatmap-table[_ngcontent-%COMP%] .day-col[_ngcontent-%COMP%]{min-width:80px}.heatmap-table[_ngcontent-%COMP%] .heatmap-cell[_ngcontent-%COMP%]{height:24px;min-width:80px;transition:background-color .15s;color:var(--math-text-primary);font-weight:500}.heatmap-table[_ngcontent-%COMP%] .heatmap-cell.clickable[_ngcontent-%COMP%]{cursor:pointer}.heatmap-table[_ngcontent-%COMP%] .heatmap-cell.clickable[_ngcontent-%COMP%]:hover{outline:2px solid #40a9ff;outline-offset:-2px}"],changeDetection:0});let e=t;return e})();export{Jt as default};
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.