1import{m as q}from"./chunk-QJJDLPQ3.js";import{a as P,b as $}from"./chunk-AKWG4KM7.js";import"./chunk-SEDYUPGI.js";import"./chunk-JEL6HJ7P.js";import{Sc as G,gb as H,ub as V}from"./chunk-YQOD7X2Z.js";import"./chunk-563YFTIG.js";import"./chunk-36JN3LZY.js";import"./chunk-WPHW6CRH.js";import"./chunk-76O7YCWW.js";import{d as N,f as R,g as B,k as U}from"./chunk-YYIIKC2W.js";import"./chunk-3WYGUSDH.js";import"./chunk-LU7SZU5X.js";import{A as j,t as w}from"./chunk-PO2RDVKE.js";import{Ac as C,Nc as S,Pb as g,Rb as f,Tb as F,Tc as T,Ub as K,Vb as O,Vc as _,Wb as m,Xb as s,Yb as a,Zb as l,da as M,db as d,ec as I,jc as y,lc as h,oa as L,pa as D,pb as A,ub as u,vb as x,zc as o}from"./chunk-3URBZWPM.js";import"./chunk-ODN5LVDJ.js";var z=()=>({exact:!0}),te=()=>["./content-changes"],ne=()=>["./subscriptions"],J=(()=>{let e=class e{constructor(){}ngOnInit(){}};e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=u({type:e,selectors:[["admin"]],standalone:!1,decls:12,vars:8,consts:[["routerLinkActive","is-active",3,"routerLinkActiveOptions"],["title","Content",3,"routerLink"],["title","Subscriptions",3,"routerLink"]],template:function(t,r){t&1&&(s(0,"h1"),o(1,"Centre Administration"),a(),s(2,"div")(3,"nav")(4,"ul")(5,"li",0)(6,"a",1),o(7,"Content"),a()(),s(8,"li",0)(9,"a",2),o(10,"Subscriptions"),a()()()()(),l(11,"router-outlet")),t&2&&(d(5),m("routerLinkActiveOptions",S(4,z)),d(),m("routerLink",S(5,te)),d(2),m("routerLinkActiveOptions",S(6,z)),d(),m("routerLink",S(7,ne)))},dependencies:[N,R,B],encapsulation:2});let i=e;return i})();function re(i,e){i&1&&(s(0,"h4"),l(1,"fab-loader"),a())}function se(i,e){if(i&1&&(s(0,"tr")(1,"td"),o(2),a(),s(3,"td"),o(4),a(),s(5,"td"),o(6),T(7,"date"),a()()),i&2){let c=e.$implicit;d(2),C(c.centreCode),d(2),C(c.centreName),d(2),C(_(7,3,c.date,"dd/MM/y"))}}function ae(i,e){if(i&1&&(s(0,"table",0)(1,"thead")(2,"tr")(3,"th"),o(4,"Centre code"),a(),s(5,"th"),o(6,"Centre name"),a(),s(7,"th"),o(8,"Date last updated"),a()()(),s(9,"tbody"),K(10,se,8,6,"tr",null,F),a()()),i&2){let c=h();d(10),O(c.items)}}function oe(i,e){if(i&1&&(s(0,"div",1),o(1),a()),i&2){let c=h();d(),C(c.statusMessage)}}var k=(()=>{let e=class e{constructor(){this.statusMessage=null}ngOnInit(){}};e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=u({type:e,selectors:[["centre-admin-data-table"]],inputs:{items:"items",statusMessage:"statusMessage"},standalone:!1,decls:3,vars:3,consts:[[1,"table","table-responsive","table-sm","table-hover"],[1,"alert","alert-warning"]],template:function(t,r){t&1&&(g(0,re,2,0,"h4"),g(1,ae,12,0,"table",0),g(2,oe,2,1,"div",1)),t&2&&(f(!r.items.length&&!r.statusMessage?0:-1),d(),f(r.items.length?1:-1),d(),f(r.statusMessage?2:-1))},dependencies:[H,w],encapsulation:2});let i=e;return i})();function de(i,e){if(i&1&&(s(0,"div",0)(1,"h3"),o(2),a(),s(3,"p"),o(4," Last updated: "),s(5,"strong"),o(6),T(7,"date"),a()()()),i&2){let c=h();d(2),C(c.centre.name),d(4),C(_(7,2,c.centre.updated_at,"dd/MM/y"))}}var E=(()=>{let e=class e{constructor(){this.centre=null}};e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=u({type:e,selectors:[["centre-admin-view"]],inputs:{centre:"centre"},standalone:!1,decls:1,vars:1,consts:[[1,"centre-admin-view"]],template:function(t,r){t&1&&g(0,de,8,5,"div",0),t&2&&f(r.centre?0:-1)},dependencies:[w],styles:["[_ngcontent-%COMP%]:root{--aat-ui-grey-25: #bfbfbf;--aat-ui-grey-55: #737373;--aat-slate: #3a5066;--aat-ui-grey-05: #f2f2f2}"]});let i=e;return i})();function me(i,e){if(i&1){let c=I();s(0,"button",4),y("click",function(){L(c);let t=h();return D(t.getRecentlyUpdatedCentres())}),o(1,"Load more"),a()}}function le(i,e){if(i&1){let c=I();s(0,"button",4),y("click",function(){L(c);let t=h();return D(t.getStaleCentres())}),o(1,"Load more"),a()}}var Y=(()=>{let e=class e{constructor(n){this.centreService=n,this.centre=null,this.recentlyUpdatedCentres=[],this.recentlyUpdatedLastKey=null,this.recentlyUpdatedMessage=null,this.staleCentres=[],this.staleCentresMessage=null,this.staleCentresLastKey=null}ngOnInit(){this.getRecentlyUpdatedCentres(),this.getStaleCentres()}expandCentre(n){n.toggle=!n.toggle}getRecentlyUpdatedCentres(){let n={sortBy:"updatedAt",sortOrder:"desc"};this.recentlyUpdatedLastKey&&(n.lastkey=this.recentlyUpdatedLastKey),this.centreService.getCentres(n).subscribe(t=>{let r=[];for(let p of t.data){let v={organisationId:p.id,centreCode:p.trainingprovidercode,centreName:p.name,date:p.updatedAt};r.push(v)}this.recentlyUpdatedCentres=this.recentlyUpdatedCentres.concat(r),this.recentlyUpdatedLastKey=t.lastkey},t=>{let r=t.json();this.recentlyUpdatedMessage=r.statusMessage})}getStaleCentres(){let n={sortBy:"updatedAt",sortOrder:"asc",daysSinceUpdated:90};this.staleCentresLastKey&&(n.lastkey=this.staleCentresLastKey),this.centreService.getCentres(n).subscribe(t=>{let r=[];for(let p of t.data){let v={organisationId:p.id,centreCode:p.trainingprovidercode,centreName:p.name,date:p.updatedAt};r.push(v)}this.staleCentres=this.staleCentres.concat(r),this.staleCentresLastKey=t.lastkey},t=>{let r=t.json();this.staleCentresMessage=r.statusMessage})}changeCentre(n){this.centreService.getCentre(n.organisationId).subscribe(t=>{this.centre=t})}};e.\u0275fac=function(t){return new(t||e)(A(P))},e.\u0275cmp=u({type:e,selectors:[["content-admin"]],standalone:!1,decls:14,vars:7,consts:[[3,"items","statusMessage"],[1,"btn","btn-default"],[3,"change"],[3,"centre"],[1,"btn","btn-default",3,"click"]],template:function(t,r){t&1&&(s(0,"h2"),o(1,"Latest content updates"),a(),l(2,"centre-admin-data-table",0),g(3,me,2,0,"button",1),s(4,"h2"),o(5,"Content not updated for 3 months or more"),a(),l(6,"centre-admin-data-table",0),g(7,le,2,0,"button",1),s(8,"h2"),o(9,"View by centre"),a(),s(10,"p"),o(11,"Search by a centre's name to view their training provider and/or assessment venue information."),a(),s(12,"fab-centre-picker",2),y("change",function(v){return r.changeCentre(v)}),a(),l(13,"centre-admin-view",3)),t&2&&(d(2),m("items",r.recentlyUpdatedCentres)("statusMessage",r.recentlyUpdatedMessage),d(),f(r.recentlyUpdatedMessage?-1:3),d(3),m("items",r.staleCentres)("statusMessage",r.staleCentresMessage),d(),f(r.staleCentresMessage?-1:7),d(6),m("centre",r.centre))},dependencies:[V,k,E],encapsulation:2});let i=e;return i})();var Z=(()=>{let e=class e{constructor(n,t){this.centreService=n,this.centreAuditService=t,this.upgradedTrainingProviders=[],this.upgradedTrainingProvidersLastKey=null,this.upgradedTrainingProvidersMessage=null,this.downgradedTrainingProviders=[],this.downgradedTrainingProvidersLastKey=null,this.downgradedTrainingProvidersMessage=null,this.upgradedAssessmentVenues=[],this.upgradedAssessmentVenuesLastKey=null,this.upgradedAssessmentVenuesMessage=null,this.downgradedAssessmentVenues=[],this.downgradedAssessmentVenuesLastKey=null,this.downgradedAssessmentVenuesMessage=null}ngOnInit(){this.getUpgradedTrainingProviders(),this.getDowngradedTrainingProviders(),this.getUpgradedAssessmentVenues(),this.getDowngradedAssessmentVenues()}getUpgradedTrainingProviders(){this.centreAuditService.getSubscriptionAuditHistory().subscribe(n=>{this.upgradedTrainingProviders=this.upgradedTrainingProviders.concat(n)},n=>{this.upgradedTrainingProvidersMessage=n})}getDowngradedTrainingProviders(){this.centreAuditService.getSubscriptionAuditHistory("tp",!0).subscribe(n=>{this.downgradedTrainingProviders=this.downgradedTrainingProviders.concat(n)},n=>{this.downgradedTrainingProvidersMessage=n})}getUpgradedAssessmentVenues(){this.centreAuditService.getSubscriptionAuditHistory("eav").subscribe(n=>{this.upgradedAssessmentVenues=this.upgradedAssessmentVenues.concat(n)},n=>{this.upgradedAssessmentVenuesMessage=n})}getDowngradedAssessmentVenues(){this.centreAuditService.getSubscriptionAuditHistory("eav",!0).subscribe(n=>{this.downgradedAssessmentVenues=this.downgradedAssessmentVenues.concat(n)},n=>{this.downgradedAssessmentVenuesMessage=n})}changeCentre(n){this.centreService.getCentre(n.organisationId).subscribe(t=>{this.centre=t})}};e.\u0275fac=function(t){return new(t||e)(A(P),A($))},e.\u0275cmp=u({type:e,selectors:[["subscriptions-admin"]],standalone:!1,decls:12,vars:5,consts:[[3,"items","statusMessage"],[3,"change"],[3,"centre"]],template:function(t,r){t&1&&(s(0,"h2"),o(1,"Subscription upgrades in the last 30 days"),a(),l(2,"centre-admin-data-table",0),s(3,"h2"),o(4,"Downgrades in the last 30 days"),a(),l(5,"centre-admin-data-table",0),s(6,"h2"),o(7,"View by centre"),a(),s(8,"p"),o(9,"Search by a centre's name to view their training provider and/or assessment venue information."),a(),s(10,"fab-centre-picker",1),y("change",function(v){return r.changeCentre(v)}),a(),l(11,"centre-admin-view",2)),t&2&&(d(2),m("items",r.upgradedTrainingProviders)("statusMessage",r.upgradedTrainingProvidersMessage),d(3),m("items",r.downgradedTrainingProviders)("statusMessage",r.downgradedTrainingProvidersMessage),d(6),m("centre",r.centre))},dependencies:[V,k,E],encapsulation:2});let i=e;return i})();var pe=[{path:"",data:{title:"Administer Training Providers and Assessment Venues",description:"Perform administration tasks on Training Providers and Assessment Venues",groups:["admin","staff"],roles:["Centre Editor"],context:"eav"},canActivate:[G],component:J,children:[{path:"",redirectTo:"content-changes",pathMatch:"full"},{path:"content-changes",data:{title:"Content",description:"",context:"eav"},component:Y},{path:"subscriptions",data:{title:"Subscriptions",description:"",context:"tp",hide:!0},component:Z},{path:"**",redirectTo:"/content-changes",pathMatch:"full"}]}],ee=(()=>{let e=class e{};e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=x({type:e}),e.\u0275inj=M({imports:[U.forChild(pe),U]});let i=e;return i})();var Fe=(()=>{let e=class e{};e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=x({type:e}),e.\u0275inj=M({imports:[j,ee,q]});let i=e;return i})();export{Fe as AdminModule};
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.