PageSourceSearch

https://optionscareers.com.au/chunk-SZE7RIJ4.js

js optionscareers.com.au collected 2026-10-09 22:42:56 UTC 31,514 bytes, 3 lines download raw bytes

1import{a as fe}from"./chunk-K65CYWLC.js";import{a as tt,b as F}from"./chunk-UVSVIP7K.js";import{b as Ke}from"./chunk-WBKZOUYA.js";import{a as Ye}from"./chunk-DYBYIQFB.js";import{b as Y}from"./chunk-XRODTU4K.js";import{a as He,b as K,d as N,e as G,g as P,i as k,j as O,k as U,l as Qe,m as z,n as Je,p as B,q as ee,s as X,t as We,u as me,v as ve}from"./chunk-QZ7CR5VH.js";import{a as et}from"./chunk-WUF7RY33.js";import{a as ft}from"./chunk-55XVJ5S6.js";import"./chunk-ADV4BVB6.js";import{a as Q,b as pe,c as ue}from"./chunk-USHNLJX3.js";import{n as q,o as $,p as te,q as de,r as H}from"./chunk-5OQPJPF3.js";import{a as L}from"./chunk-NSQCVRZL.js";import{b as ze,c as V,d as Be,e as ae,f as le,j as qe}from"./chunk-UAOPAZS6.js";import{a as A}from"./chunk-FDHFUMCN.js";import{a as S,b as I}from"./chunk-R2NT76AB.js";import{i as Xe,m as ce,n as Ze,o as R}from"./chunk-4Z4WTCVN.js";import"./chunk-LMEGLJQ7.js";import{$b as je,Ac as Pe,Bb as E,C as se,Eb as f,Fa as Ie,Fb as h,Hc as Oe,Kc as Ue,Oa as Fe,Ob as Re,Pb as Le,R as b,Ra as c,Rb as d,Sa as m,Sb as J,Tb as T,Yb as j,Zb as v,_b as Me,a as Se,ac as Ne,b as _e,ca as ye,db as Te,dd as Z,ed as W,f as ut,gd as $e,lb as x,na as Ee,nb as u,oa as g,qc as Ge,rb as _,sb as De,tb as Ve,ub as Ae,vb as n,w as we,wa as w,wb as s,xa as y,xb as p,ya as ke}from"./chunk-W4K6KJF3.js";var it=(()=>{let r=class r{constructor(t,e,i,l,C){this.data=t,this.analyticsService=e,this.dialogRef=i,this.schoolService=l,this.toastService=C,this.isSubmitting=!1,this.username=new k("",[X("Required"),me("Not a valid email")]),this.declaration=new k("",[We("Required")]),this.formGroup=new P({username:this.username,declaration:this.declaration})}submit(){if(this.data.id&&this.formGroup.valid&&!this.isSubmitting){this.isSubmitting=!0;let t={username:this.username.value};this.schoolService.addUser(this.data.id,t).pipe(b()).subscribe({next:e=>this.handleResult(e,t),error:e=>this.handleError(e)})}}cancel(){this.dialogRef.close()}handleResult(t,e){e.id=t,this.isSubmitting=!1,this.analyticsService.sendCompleteEvent("School Users Update"),this.dialogRef.close(e)}handleError(t){if(this.isSubmitting=!1,t.status===422){let e=!1,i=!1,l=!1;Object.keys(t.error.errors||{}).forEach(D=>{if(D=="school")l=!0;else{let ne=this.formGroup.get(D);if(ne){let pt=t.error.errors[D][0];ne.setErrors({error:pt}),e=!0}else i=!0}}),e||(l?this.toastService.showError("The school has reached the maximum number of administrators allowed."):i&&this.toastService.showError("An error has occurred. Please try again."))}else this.toastService.showError("An error has occurred. Please try again.")}};r.\u0275fac=function(e){return new(e||r)(m(pe),m(I),m(Q),m(F),m(A))},r.\u0275cmp=g({type:r,selectors:[["app-add-dialog"]],hostAttrs:[1,"flex","flex-col","md:flex-row","gap-4","p-4","rounded-3xl","bg-white","max-w-[calc(100vw-4rem)]","md:min-w-[700px]","md:max-w-[700px]","md:mx-auto","overflow-y-auto","max-h-[calc(100vh-8rem)]"],standalone:!0,features:[v],decls:17,vars:7,consts:[[1,"flex","w-full","flex-col","gap-4","p-4",3,"ngSubmit","formGroup"],[1,"flex","flex-col","gap-1"],["for","username",1,"text-sm","font-semibold"],["appInput","","formControlName","username","id","username","name","username","placeholder","Enter email address","type","email",1,"w-full","bg-zinc-100"],[3,"control"],[1,"flex","gap-4"],["formControlName","declaration"],[1,"flex","gap-4","md:col-span-2"],["app-button","","type","button",1,"border",3,"click","disabled"],["app-button","","type","submit",1,"w-full","bg-gradient-primary-to-r","text-white",3,"disabled","showSpinner"]],template:function(e,i){e&1&&(n(0,"form",0),f("ngSubmit",function(){return i.submit()}),n(1,"div",1)(2,"label",2),d(3,"Email address"),s(),p(4,"input",3)(5,"app-form-control-error",4),s(),n(6,"div",1)(7,"div",5)(8,"div"),d(9),s(),p(10,"app-switch",6),s(),p(11,"app-form-control-error",4),s(),n(12,"div",7)(13,"button",8),f("click",function(){return i.cancel()}),d(14,"Cancel"),s(),n(15,"button",9),d(16," Add "),s()()()),e&2&&(u("formGroup",i.formGroup),c(5),u("control",i.username),c(4),T("I declare that the above email address belongs to a member of ",i.data.school.name,""),c(2),u("control",i.declaration),c(2),u("disabled",i.isSubmitting),c(2),u("disabled",i.isSubmitting)("showSpinner",i.isSubmitting))},dependencies:[S,Y,ee,B,O,K,N,G,U,z,fe]});let o=r;return o}
1)();var ot=(()=>{let r=class r{constructor(t,e,i,l,C){this.data=t,this.analyticsService=e,this.dialogRef=i,this.schoolService=l,this.toastService=C,this.isSubmitting=!1}remove(){!this.data.id||!this.data.user.id||this.isSubmitting||(this.isSubmitting=!0,this.schoolService.removeUser(this.data.id,this.data.user.id).pipe(b()).subscribe({next:()=>this.handleResult(),error:()=>this.handleError()}))}cancel(){this.dialogRef.close(!1)}handleResult(){this.isSubmitting=!1,this.analyticsService.sendCompleteEvent("School Users Update"),this.dialogRef.close(!0)}handleError(){this.isSubmitting=!1,this.toastService.showError("An error has occurred. Please try again.")}};r.\u0275fac=function(e){return new(e||r)(m(pe),m(I),m(Q),m(F),m(A))},r.\u0275cmp=g({type:r,selectors:[["app-remove-dialog"]],hostAttrs:[1,"flex","flex-col","md:flex-row","gap-4","p-4","rounded-3xl","bg-white","max-w-[calc(100vw-4rem)]","md:min-w-[700px]","md:max-w-[700px]","md:mx-auto","overflow-y-auto","max-h-[calc(100vh-8rem)]"],standalone:!0,features:[v],decls:11,vars:5,consts:[[1,"flex","w-full","flex-col","gap-4","p-4"],[1,"font-semibold"],[1,"flex","gap-4","md:col-span-2"],["app-button","","type","button",1,"border",3,"click","disabled"],["app-button","","type","button",1,"w-full","bg-gradient-primary-to-r","text-white",3,"click","disabled","showSpinner"]],template:function(e,i){e&1&&(n(0,"div",0)(1,"p"),d(2," Remove "),n(3,"span",1),d(4),s(),d(5),s(),n(6,"div",2)(7,"button",3),f("click",function(){return i.cancel()}),d(8,"Cancel"),s(),n(9,"button",4),f("click",function(){return i.remove()}),d(10," Remove "),s()()()),e&2&&(c(4),J(i.data.user.username),c(),T(" from ",i.data.school.name,"? "),c(2),u("disabled",i.isSubmitting),c(2),u("disabled",i.isSubmitting)("showSpinner",i.isSubmitting))},dependencies:[S]});let o=r;return o})();function ht(o,r){o&1&&p(0,"app-loading-skeleton",0)}function gt(o,r){o&1&&p(0,"app-error",0)}function vt(o,r){if(o&1){let a=E();n(0,"button",5),f("click",function(){w(a);let e=h(2);return y(e.add())}),p(1,"ng-icon",6),n(2,"span",7),d(3,"Add administrator"),s()()}}function bt(o,r){if(o&1){let a=E();n(0,"div",8)(1,"span",9),d(2),s(),n(3,"button",10),f("click",function(){let e=w(a).$implicit,i=h(2);return y(i.remove(e))}),p(4,"ng-icon",11),s()()}if(o&2){let a=r.$implicit;c(2),J(a.username)}}function xt(o,r){if(o&1&&(n(0,"div",1),x(1,vt,4,0,"button",2),n(2,"cdk-virtual-scroll-viewport",3),x(3,bt,5,1,"div",4),s()()),o&2){let a=h();c(),_(1,a.users.length<3?1:-1),c(),u("itemSize",56),c(),u("cdkVirtualForOf",a.users)}}var rt=(()=>{let r=class r{constructor(t,e,i,l,C,D){this.accountService=t,this.activatedRoute=e,this.analyticsService=i,this.dialog=l,this.schoolService=C,this.router=D,this.id=null,this.isLoading=!0,this.loadingError=!1,this.profile=null,this.school=null,this.subscriptions=[],this.users=[]}ngOnInit(){this.analyticsService.sendPageView("School Users");let t=this.activatedRoute.parent;t&&this.subscriptions.push(t.paramMap.subscribe({next:e=>{this.isLoading=!0,this.loadingError=!1,this.id=e.get("id"),this.id?se({profile:this.accountService.getProfile(),school:this.schoolService.getProfile(this.id),users:this.schoolService.getUsers(this.id)}).subscribe({next:l=>{this.profile=l.profile,this.school=l.school,this.users=l.users,this.loadingError=!1,this.isLoading=!1},error:()=>{this.loadingError=!0,this.isLoading=!1}}):(this.loadingError=!0,this.isLoading=!1)}}))}ngOnDestroy(){this.subscriptions.forEach(t=>{t.unsubscribe()})}add(){this.id&&this.school&&this.dialog.open(it,{data:{id:this.id,school:this.school},autoFocus:!1,disableClose:!0}).closed.pipe(b()).subscribe({next:e=>{e&&this.findIndex(this.users,e)===-1&&(this.users=[...this.users,e].sort((i,l)=>i.username.localeCompare(l.username)))}})}findIndex(t,e){return t.findIndex(i=>i.username.localeCompare(e.username)==0)}remove(t){this.id&&this.school&&this.dialog.open(ot,{data:{id:this.id,school:this.school,user:t},disableClose:!0}).closed.pipe(b()).subscribe({next:i=>{if(i)if(t.username==this.profile?.username)this.router.navigate(["/secure/account/schools"]);else{let l=this.users.indexOf(t);l>-1&&(this.users=[...this.users.slice(0,l),...this.users.slice(l+1)])}}})}};r.\u0275fac=function(e){return new(e||r)(m(Ye),m(V),m(I),m(ue),m(F),m(ae))},r.\u0275cmp=g({type:r,selectors:[["app-administrators"]],hostAttrs:[1,"flex-1"],standalone:!0,features:[j([Z({heroXMark:Ze,heroPlus:ce})]),v],decls:3,vars:1,consts:[[1,"grid","h-full","content-center"],["cdkVirtualScrollingElement","",1,"h-full","w-full"],["type","button",1,"relative","my-2","flex","h-14","w-full","flex-row","items-center","gap-2","rounded-lg","border-2","border-dashed","px-4","text-sm","font-light"],[3,"itemSize"],["class","my-2 flex h-14 flex-row items-center gap-2 rounded-lg border px-4 text-sm font-light",4,"cdkVirtualFor","cdkVirtualForOf"],["type","button",1,"relative","my-2","flex","h-14","w-full","flex-row","items-center","gap-2","rounded-lg","border-2","border-dashed","px-4","text-sm","font-light",3,"click"],["name","heroPlus",1,"!block"],[1,"absolute","left-1/2","top-1/2","-translate-x-1/2","-translate-y-1/2","transform"],[1,"my-2","flex","h-14","flex-row","items-center","gap-2","rounded-lg","border","px-4","text-sm","font-light"],[1,"overflow-wrap-break-word","line-clamp-1","flex-1"],["app-button","",3,"click"],["name","heroXMark",1,"!block"]],template:function(e,i){e&1&&x(0,ht,1,0,"app-loading-skeleton",0)(1,gt,1,0)(2,xt,4,3),e&2&&_(0,i.isLoading?0:i.loadingError?1:2)},dependencies:[L,R,W,H,q,te,$,de,S]});let o=r;return o}
1)();var nt=(()=>{let r=class r{constructor(t){this.dialogRef=t,this.username=new k("",[X("Required"),me("Not a valid email")]),this.formGroup=new P({username:this.username})}submit(){this.formGroup.valid&&this.dialogRef.close(this.username.value)}cancel(){this.dialogRef.close()}};r.\u0275fac=function(e){return new(e||r)(m(Q))},r.\u0275cmp=g({type:r,selectors:[["app-add-dialog"]],hostAttrs:[1,"flex","flex-col","md:flex-row","gap-4","p-4","rounded-3xl","bg-white","max-w-[calc(100vw-4rem)]","md:min-w-[700px]","md:max-w-[700px]","md:mx-auto","overflow-y-auto","max-h-[calc(100vh-8rem)]"],standalone:!0,features:[v],decls:11,vars:2,consts:[[1,"flex","w-full","flex-col","gap-4","p-4",3,"ngSubmit","formGroup"],[1,"flex","flex-col","gap-1"],["for","username",1,"text-sm","font-semibold"],["appInput","","formControlName","username","id","username","name","username","placeholder","Enter email address","type","email",1,"w-full","bg-zinc-100"],[3,"control"],[1,"flex","gap-4","md:col-span-2"],["app-button","","type","button",1,"border",3,"click"],["app-button","","type","submit",1,"w-full","bg-gradient-primary-to-r","text-white"]],template:function(e,i){e&1&&(n(0,"form",0),f("ngSubmit",function(){return i.submit()}),n(1,"div",1)(2,"label",2),d(3,"Email address"),s(),p(4,"input",3)(5,"app-form-control-error",4),s(),n(6,"div",5)(7,"button",6),f("click",function(){return i.cancel()}),d(8,"Cancel"),s(),n(9,"button",7),d(10,"Add"),s()()()),e&2&&(u("formGroup",i.formGroup),c(5),u("control",i.username))},dependencies:[S,Y,ee,B,O,K,N,G,U,z]});let o=r;return o})();var Ct=()=>["/secure"],st=(()=>{let r=class r{constructor(t){this.dialogRef=t}};r.\u0275fac=function(e){return new(e||r)(m(Q))},r.\u0275cmp=g({type:r,selectors:[["app-success-dialog"]],hostAttrs:[1,"flex","flex-col","items-center","gap-2","text-center","rounded-3xl","border","w-max","p-8","bg-white"],standalone:!0,features:[v],decls:6,vars:2,consts:[["alt","Confirmation","height","179","ngSrc","assets/confirmation.svg","width","179",1,"m-","mt-0"],[1,"my-5","max-w-[30ch]","text-sm","text-zinc-400","md:text-base"],[1,"w-full",3,"click","routerLink"],["app-button","",1,"w-full","bg-gradient-primary-to-r","text-white"]],template:function(e,i){e&1&&(p(0,"img",0),n(1,"p",1),d(2,` Thank you for confirming that the administrators are authorised to access and manage the subscriptions for your school
2`),s(),n(3,"a",2),f("click",function(){return i.dialogRef.close()}),n(4,"button",3),d(5,"Done"),s()()),e&2&&(c(3),u("routerLink",Me(1,Ct)))},dependencies:[S,le,Ue]});let o=r;return o})();function St(o,r){o&1&&(n(0,"div",1)(1,"div",2),p(2,"app-loading-skeleton",3),s()())}function _t(o,r){o&1&&(n(0,"div",1)(1,"div",2),p(2,"app-error",3),s()())}function wt(o,r){if(o&1&&(n(0,"div",13)(1,"span",14),d(2),s(),p(3,"app-switch",15),s()),o&2){let a=r.$implicit,t=r.index;c(2),J(a.username),c(),u("formControlName",t)}}function yt(o,r){if(o&1){let a=E();n(0,"button",16),f("click",function(){w(a);let e=h(2);return y(e.add())}),p(1,"ng-icon",17),n(2,"span",18),d(3,"Add administrator"),s()()}}function Et(o,r){if(o&1){let a=E();n(0,"div",4)(1,"div",2)(2,"form",5),f("ngSubmit",function(){w(a);let e=h();return y(e.submit())}),n(3,"p",6),d(4," Are the following administrators still authorised to access and manage the subscriptions for "),n(5,"span",7),d(6),s(),d(7,"? "),s(),n(8,"cdk-virtual-scroll-viewport",8)(9,"div",9),x(10,wt,4,2,"div",10),s(),x(11,yt,4,0,"button",11),s(),n(12,"button",12),d(13," Continue "),s()()()()}if(o&2){let a=h();c(2),u("formGroup",a.formGroup),c(4),J(a.school==null?null:a.school.name),c(4),u("cdkVirtualForOf",a.users),c(),_(11,a.canSelect?11:-1),c(),u("showSpinner",a.isSubmitting)("disabled",a.isSubmitting)}}var Ce=(()=>{let r=class r{constructor(t,e,i,l,C){this.analyticsService=t,this.activatedRoute=e,this.dialog=i,this.schoolService=l,this.toastService=C,this.canSelect=!1,this.id=null,this.isLoading=!0,this.isSubmitting=!1,this.loadingError=!1,this.school=null,this.subscriptions=[],this.updatingControls=!1,this.users=[],this.confirmations=new Je([]),this.formGroup=new P({confirmations:this.confirmations})}ngOnInit(){this.analyticsService.sendPageView("Confirm School Users"),this.subscriptions.push(this.confirmations.valueChanges.subscribe({next:t=>{this.updatingControls||(this.updatingControls=!0,this.canSelect=t.filter(e=>
2e).length<3,this.confirmations.controls.forEach(e=>{e.value||this.canSelect?e.enable():e.disable()}),this.updatingControls=!1)}})),this.subscriptions.push(this.activatedRoute.paramMap.subscribe({next:t=>{this.isLoading=!0,this.loadingError=!1,this.id=t.get("id"),this.id?se({school:this.schoolService.getProfile(this.id),users:this.schoolService.getUsers(this.id)}).subscribe({next:i=>{this.school=i.school,this.users=i.users,this.confirmations.clear(),this.users.forEach(()=>{this.confirmations.push(new k(!0))}),this.loadingError=!1,this.isLoading=!1},error:()=>{this.loadingError=!0,this.isLoading=!1}}):(this.loadingError=!0,this.isLoading=!1)}}))}ngOnDestroy(){this.subscriptions.forEach(t=>{t.unsubscribe()})}add(){this.dialog.open(nt,{autoFocus:!1,disableClose:!0}).closed.pipe(b()).subscribe({next:e=>{if(e){let i={username:e};if(this.findIndex(this.users,i)===-1){let l=this.findInsertIndex(this.users,i);this.users=[...this.users.slice(0,l),i,...this.users.slice(l)],this.confirmations.insert(l,new k(!0))}}}})}findIndex(t,e){return t.findIndex(i=>i.username.localeCompare(e.username)==0)}findInsertIndex(t,e){for(let i=0;i<t.length;i++)if(t[i].username.localeCompare(e.username)>=0)return i;return t.length}submit(){if(this.id!=null&&!this.isSubmitting){this.isSubmitting=!0;let e={users:this.users.filter((i,l)=>this.confirmations.at(l).value).map(i=>i.username)};this.schoolService.confirm(this.id,e).pipe(b()).subscribe({next:()=>this.handleResult(),error:()=>this.handleError()})}}handleResult(){this.isSubmitting=!1,this.analyticsService.sendCompleteEvent("School Users Update"),this.dialog.open(st,{disableClose:!0})}handleError(){this.isSubmitting=!1,this.toastService.showError("An error has occurred. Please try again.")}};r.\u0275fac=function(e){return new(e||r)(m(I),m(V),m(ue),m(F),m(A))},r.\u0275cmp=g({type:r,selectors:[["app-confirm"]],hostAttrs:[1,"grid","place-items-center","h-full","p-2"],standalone:!0,features:[j([Z({heroPlus:ce})]),v],decls:4,vars:1,consts:[[1,"flex","h-full","w-full","flex-col","rounded-3xl","bg-white","p-2","custom-md:mx-auto","custom-md:h-auto","custom-md:min-h-[675px]","custom-md:w-[750px]","custom-md:p-4"],[1,"flex","flex-1","p-2","md:p-8"],[1,"flex-1"],[1,"grid","h-full","content-center"],[1,"flex","flex-1","p-2","pt-4","md:p-8"],[1,"flex","h-full","flex-col","gap-4",3,"ngSubmit","formGroup"],[1,"text-center","mb-4"],[1,"font-semibold"],["itemSize","0",1,"h-full","w-full"],["formArrayName","confirmations"],["class","my-2 flex h-14 flex-row items-center gap-2 rounded-lg border px-4 text-sm font-light",4,"cdkVirtualFor","cdkVirtualForOf"],["type","button",1,"relative","my-2","flex","h-14","w-full","flex-row","items-center","gap-2","rounded-lg","border-2","border-dashed","px-4","text-sm","font-light"],["app-button","","type","submit",1,"w-full","bg-gradient-primary-to-r","text-white",3,"showSpinner","disabled"],[1,"my-2","flex","h-14","flex-row","items-center","gap-2","rounded-lg","border","px-4","text-sm","font-light"],[1,"overflow-wrap-break-word","line-clamp-1","flex-1"],[3,"formControlName"],["type","button",1,"relative","my-2","flex","h-14","w-full","flex-row","items-center","gap-2","rounded-lg","border-2","border-dashed","px-4","text-sm","font-light",3,"click"],["name","heroPlus",1,"!block"],[1,"absolute","left-1/2","top-1/2","-translate-x-1/2","-translate-y-1/2","transform"]],template:function(e,i){e&1&&(n(0,"div",0),x(1,St,3,0,"div",1)(2,_t,3,0)(3,Et,14,6),s()),e&2&&(c(),_(1,i.isLoading?1:i.loadingError?2:3))},dependencies:[S,L,R,W,B,O,N,G,U,z,Qe,H,q,te,$,fe]});let o=r;return o})();var at=ut(ft());function kt(o,r){o&1&&p(0,"app-loading-skeleton",0)}function It(o,r){o&1&&p(0,"app-error",0)}function Ft(o,r){o&1&&(n(0,"div",2),d(1,"No invoices found"),s())}function Tt(o,r){if(o&1){let a=E();n(0,"div",5),d(1),p(2,"div",6),n(3,"span",7),d(4),s(),n(5,"button",8),f("click",function(){let e=w(a).$implicit,i=h(3);return y(i.download(e))}),p(6,"ng-icon",9),s()()}if(o&2){let a=r.$implicit,t=h(3);c(),T(" ",a.date," "),c(3),T(" Invoice ",a.id," "),c(),u("showSpinner",a.isDownloading)("disabled",t.isDownloading)}}function Dt(o,r){if(o&1&&(n(0,"cdk-virtual-scroll-viewport",3),x(1,Tt,7,4,"div",4),s()),o&2){let a=h(2);
2c(),u("cdkVirtualForOf",a.orders)}}function Vt(o,r){if(o&1&&(n(0,"div",1),x(1,Ft,2,0,"div",2)(2,Dt,2,1),s()),o&2){let a=h();c(),_(1,a.orders.length===0?1:2)}}var lt=(()=>{let r=class r{constructor(t,e,i,l,C){this.activatedRoute=t,this.analyticsService=e,this.orderService=i,this.schoolService=l,this.toastService=C,this.isDownloading=!1,this.isLoading=!0,this.loadingError=!1,this.orders=[],this.subscriptions=[]}ngOnInit(){this.analyticsService.sendPageView("School Orders");let t=this.activatedRoute.parent;t&&this.subscriptions.push(t.paramMap.subscribe({next:e=>{this.isLoading=!0,this.loadingError=!1;let i=e.get("id");i?this.schoolService.getOrders(i).pipe(b(),we(l=>l.map(C=>_e(Se({},C),{isDownloading:!1})))).subscribe({next:l=>{this.orders=l,this.loadingError=!1,this.isLoading=!1},error:()=>{this.loadingError=!0,this.isLoading=!1}}):(this.loadingError=!0,this.isLoading=!1)}}))}ngOnDestroy(){this.subscriptions.forEach(t=>{t.unsubscribe()})}download(t){this.isDownloading||(this.isDownloading=!0,t.isDownloading=!0,this.orderService.downloadInvoice(t.id).pipe(b()).subscribe({next:e=>this.handleResult(t,e),error:()=>this.handleError(t)}))}handleResult(t,e){this.isDownloading=!1,t.isDownloading=!1,at.default.saveAs(e,`Invoice ${t.id}.pdf`)}handleError(t){this.isDownloading=!1,t.isDownloading=!1,this.toastService.showError("An error has occurred. Please try again.")}};r.\u0275fac=function(e){return new(e||r)(m(V),m(I),m(tt),m(F),m(A))},r.\u0275cmp=g({type:r,selectors:[["app-invoices"]],hostAttrs:[1,"flex-1"],standalone:!0,features:[j([Z({heroDocumentArrowDown:Xe})]),v],decls:3,vars:1,consts:[[1,"grid","h-full","content-center"],["cdkVirtualScrollingElement","",1,"h-full","w-full"],[1,"text-center","text-gray-500"],["itemSize","56"],["class","my-2 flex h-14 flex-row items-center gap-2 rounded-lg border px-4 text-sm font-light",4,"cdkVirtualFor","cdkVirtualForOf"],[1,"my-2","flex","h-14","flex-row","items-center","gap-2","rounded-lg","border","px-4","text-sm","font-light"],[1,"min-h-4","w-1","border-r","border-gray-300"],[1,"line-clamp-1","flex-1"],["app-image-button","",1,"!rounded-lg","bg-teal-500","!p-2","text-white",3,"click","showSpinner","disabled"],["name","heroDocumentArrowDown",1,"!block"]],template:function(e,i){e&1&&x(0,kt,1,0,"app-loading-skeleton",0)(1,It,1,0)(2,Vt,3,1),e&2&&_(0,i.isLoading?0:i.loadingError?1:2)},dependencies:[L,et,R,W,H,q,te,$,de]});let o=r;return o})();var At=["fileInput"];function Rt(o,r){if(o&1){let a=E();n(0,"div",2),p(1,"img",3),s(),n(2,"button",4),f("click",function(e){w(a);let i=h();return y(i.remove(e))}),d(3,"Remove"),s()}if(o&2){let a=h();c(),u("src",a.imagePreview,Fe)}}function Lt(o,r){if(o&1&&(ke(),n(0,"svg",5),p(1,"path",6)(2,"circle",7),s(),d(3)),o&2){let a=h();c(3),T(" ",a.placeholder(),`
3`)}}var ct=(()=>{let r=class r{constructor(){this.onChange=()=>{},this.onTouch=()=>{},this.disabled=!1,this.value=null,this.placeholder=Ie("Upload an image"),this.fileInput=Te("fileInput")}writeValue(t){this.value=t,this.imagePreview=t}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouch=t}setDisabledState(t){this.disabled=t}onFileChange(t){let e=t.target.files[0];if(e){this.value=e,this.onChange(this.value),this.onTouch();let i=new FileReader;i.onload=l=>this.imagePreview=i.result,i.readAsDataURL(e)}}onClick(){this.fileInput()?.nativeElement.click()}remove(t){t.stopImmediatePropagation(),this.value=null,this.onChange(this.value),this.onTouch(),this.fileInput().nativeElement.value=""}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=g({type:r,selectors:[["app-image-upload"]],viewQuery:function(e,i){e&1&&Re(i.fileInput,At,5),e&2&&Le()},hostAttrs:[1,"block","border-dashed","border-2","rounded-lg","py-4","px-12","text-center","cursor-pointer","transition-colors","flex","flex-col","items-center","justify-center","gap-4","text-sm"],hostBindings:function(e,i){e&1&&f("click",function(){return i.onClick()})},inputs:{placeholder:[Ee.SignalBased,"placeholder"]},standalone:!0,features:[j([{provide:He,useExisting:ye(()=>r),multi:!0}]),v],decls:4,vars:1,consts:[["fileInput",""],["type","file","hidden","",3,"change"],[1,"flex","flex-1","items-center","justify-center","overflow-hidden"],["alt","Image preview",1,"max-h-[95px]","w-36","object-contain",3,"src"],["app-button","",1,"mt-auto","w-full","border",3,"click"],["width","27","height","26","viewBox","0 0 27 26","fill","none","xmlns","http://www.w3.org/2000/svg"],["d","M21.6884 0.753906H5.33142C3.073 0.753906 1.24219 2.58472 1.24219 4.84314V21.2001C1.24219 23.4585 3.073 25.2893 5.33142 25.2893H21.6884C23.9468 25.2893 25.7776 23.4585 25.7776 21.2001V4.84314C25.7776 2.58472 23.9468 0.753906 21.6884 0.753906ZM5.33142 3.48006H21.6884C22.4412 3.48006 23.0514 4.09033 23.0514 4.84314V16.2385L18.6896 12.5173C17.2958 11.3705 15.2853 11.3705 13.8916 12.5173L3.96834 20.7912V4.84314C3.96834 4.09033 4.57861 3.48006 5.33142 3.48006Z","fill","#878787","stroke","white"],["cx","8.05731","cy","8.25165","r","2.04462","fill","#878787","stroke","white"]],template:function(e,i){if(e&1){let l=E();n(0,"input",1,0),f("change",function(D){return w(l),y(i.onFileChange(D))}),s(),x(2,Rt,4,1)(3,Lt,4,1)}e&2&&(c(2),_(2,i.value?2:3))},dependencies:[S]});let o=r;return o}
3)();function Mt(o,r){o&1&&p(0,"app-loading-skeleton",0)}function jt(o,r){o&1&&p(0,"app-error",0)}function Nt(o,r){if(o&1){let a=E();n(0,"form",1),f("ngSubmit",function(){w(a);let e=h();return y(e.submit())}),n(1,"cdk-virtual-scroll-viewport",2)(2,"div",3)(3,"div",4),p(4,"app-image-upload",5)(5,"app-form-control-error",6),s(),n(6,"div",4),p(7,"app-image-upload",7)(8,"app-form-control-error",6),s()(),n(9,"div",8)(10,"label",9),d(11,"Name"),s(),p(12,"input",10)(13,"app-form-control-error",6),s(),n(14,"div",4)(15,"label",11),d(16,"Parent and student access code"),s(),p(17,"input",12)(18,"app-form-control-error",6),s(),n(19,"div",4)(20,"label",13),d(21,"Landing page"),s(),p(22,"input",14),s()(),n(23,"button",15),d(24," Save "),s()()}if(o&2){let a=h();u("formGroup",a.formGroup),c(5),u("control",a.background),c(3),u("control",a.logo),c(5),u("control",a.name),c(5),u("control",a.accessCode),c(4),u("value",a.url()),c(),u("showSpinner",a.isSubmitting)("disabled",a.isSubmitting)}}var mt=(()=>{let r=class r{constructor(t,e,i,l){this.activatedRoute=t,this.schoolService=e,this.analyticsService=i,this.toastService=l,this.id="",this.isLoading=!0,this.isSubmitting=!1,this.loadingError=!1,this.backgroundChanged=!1,this.logoChanged=!1,this.school=null,this.subscriptions=[],this.name=new k("",[X("Required")]),this.accessCode=new k("",[X("Required")]),this.background=new k("",[ve(5e6,"Must be less than 5 MB")]),this.logo=new k("",[ve(5e6,"Must be less than 5 MB")]),this.formGroup=new P({name:this.name,accessCode:this.accessCode,background:this.background,logo:this.logo}),this.accessCodeSignal=Ke(this.accessCode.valueChanges),this.url=Ge(()=>`https://optionscareers.com.au/welcome/${this.accessCodeSignal()}`)}ngOnInit(){this.analyticsService.sendPageView("School Profile"),this.subscriptions.push(this.background.valueChanges.subscribe({next:e=>{this.school&&this.school.background!==e&&(this.backgroundChanged=!0)}}),this.logo.valueChanges.subscribe({next:e=>{this.school&&this.school.logo!==e&&(this.logoChanged=!0)}}));let t=this.activatedRoute.parent;t&&this.subscriptions.push(t.paramMap.subscribe({next:e=>{this.isLoading=!0,this.loadingError=!1;let i=e.get("id");i?(this.id=i,this.schoolService.getProfile(i).pipe(b()).subscribe({next:l=>{this.school=l,this.formGroup.patchValue({name:l.name,accessCode:l.accessCode,background:l.background,logo:l.logo}),this.loadingError=!1,this.isLoading=!1},error:()=>{this.loadingError=!0,this.isLoading=!1}})):(this.loadingError=!0,this.isLoading=!1)}}))}ngOnDestroy(){this.subscriptions.forEach(t=>{t.unsubscribe()})}submit(){if(!this.formGroup.invalid&&!this.isSubmitting){this.isSubmitting=!0;let t={name:this.name.value,accessCode:this.accessCode.value,background:this.backgroundChanged?this.background.value:null,changeBackground:this.backgroundChanged,logo:this.logoChanged?this.logo.value:null,changeLogo:this.logoChanged};this.schoolService.saveProfile(this.id,t).pipe(b()).subscribe({next:()=>this.handleResult(),error:e=>this.handleError(e)})}}handleResult(){this.isSubmitting=!1,this.backgroundChanged=!1,this.logoChanged=!1,this.analyticsService.sendCompleteEvent("School Profile Update"),this.toastService.showSuccess("The school's profile has been updated.")}handleError(t){if(this.isSubmitting=!1,t.status===422){let e=!1,i=!1;Object.keys(t.error.errors||{}).forEach(C=>{let D=this.formGroup.get(C);if(D){let ne=t.error.errors[C][0];D.setErrors({error:ne}),e=!0}else i=!0}),!e&&i&&this.toastService.showError("An error has occurred. Please try again.")}else this.toastService.showError("An error has occurred. Please try again.")}};r.\u0275fac=function(e){return new(e||r)(m(V),m(F),m(I),m(A))},r.\u0275cmp=g({type:r,selectors:[["app-profile"]],hostAttrs:[1,"flex-1"],standalone:!0,features:[v],decls:3,vars:1,consts:[[1,"grid","h-full","content-center"],[1,"flex","h-full","flex-col","gap-4",3,"ngSubmit","formGroup"],["itemSize","0",1,"h-full"],[1,"flex","flex-col","gap-4","sm:flex-row"],[1,"flex","w-full","flex-col","gap-2"],["placeholder","Upload background","formControlName","background",1,"flex-1"],[3,"control"],["placeholder","Upload logo","formControlName","logo",1,"flex-1"],[1,"flex","w-full","flex-col","gap-2","pt-2","md:pt-6"],["for","name",1,"text-sm","font-semibold"],["appInput","","type","text","placeholder","Enter your school's name","name","name","id","name","formControlName","name",1,"w-full","bg-zinc-100"],["for","accessCode",1,"text-sm","font-semibold"],["appInput","","type","text","placeholder","Enter your phone number","id","accessCode","formControlName","accessCode","name","accessCode",1,"w-full","bg-zinc-100"],["for","url",1,"text-sm","font-semibold"],["appInput","","type","text","id","url","name","url","disabled","",1,"w-full","bg-zinc-100",3,"value"],["app-button","","type","submit",1,"w-full","bg-gradient-primary-to-r","text-white",3,"showSpinner","disabled"]],template:function(e,i){e&1&&x(0,Mt,1,0,"app-loading-skeleton",0)(1,jt,1,0)(2,Nt,25,8),e&2&&_(0,i.isLoading?0:i.loadingError?1:2)},dependencies:[S,L,Y,ct,ee,R,B,O,K,N,G,U,z,H,q,$]});let o=r;return o}
3)();var Gt=(o,r)=>["/secure/schools",o,r],Pt=o=>({"border-black !text-black":o});function Ot(o,r){o&1&&(n(0,"div",1)(1,"div",2),p(2,"app-loading-skeleton",3),s()())}function Ut(o,r){o&1&&(n(0,"div",1)(1,"div",2),p(2,"app-error",3),s()())}function zt(o,r){if(o&1&&(n(0,"a",5),d(1),s()),o&2){let a=r.$implicit,t=h(2);u("routerLink",Ne(4,Gt,t.id,a.route))("replaceUrl",!0)("ngClass",je(7,Pt,a===t.selectedTab)),c(),T(" ",a.label," ")}}function Bt(o,r){if(o&1&&(n(0,"div",4),Ve(1,zt,2,9,"a",5,De),s(),n(3,"div",6),p(4,"router-outlet"),s()),o&2){let a=h();c(),Ae(a.tabs)}}var dt=(()=>{let r=class r{constructor(t,e,i){this.authenticationService=t,this.activatedRoute=e,this.router=i,this.id="",this.isLoading=!0,this.loadingError=!1,this.selectedTab=null,this.subscriptions=[],this.tabs=[{label:"Profile",route:"profile"},{label:"Invoices",route:"invoices"},{label:"Administrators",route:"administrators"}]}ngOnInit(){this.setTab(),this.subscriptions.push(this.router.events.subscribe({next:t=>{t instanceof ze&&this.setTab()}})),this.subscriptions.push(this.activatedRoute.paramMap.subscribe({next:t=>{this.isLoading=!0,this.loadingError=!1;let e=t.get("id");e?(this.id=e,this.authenticationService.user().pipe(b()).subscribe({next:i=>{i.user?(this.loadingError=!1,this.isLoading=!1):(this.loadingError=!0,this.isLoading=!1)},error:()=>{this.loadingError=!0,this.isLoading=!1}})):(this.loadingError=!0,this.isLoading=!1)}}))}ngOnDestroy(){this.subscriptions.forEach(t=>{t.unsubscribe()})}setTab(){let t=this.tabs.findIndex(e=>this.router.url.endsWith(e.route));t>=0&&(this.selectedTab=this.tabs[t])}};r.\u0275fac=function(e){return new(e||r)(m($e),m(V),m(ae))},r.\u0275cmp=g({type:r,selectors:[["app-school"]],hostAttrs:[1,"grid","place-items-center","h-full","p-2"],standalone:!0,features:[v],decls:4,vars:1,consts:[[1,"flex","h-full","w-full","flex-col","rounded-3xl","bg-white","p-2","custom-md:mx-auto","custom-md:h-auto","custom-md:min-h-[675px]","custom-md:w-[750px]","custom-md:p-4"],[1,"flex","flex-1","p-2","md:p-8"],[1,"flex-1"],[1,"grid","h-full","content-center"],[1,"flex","w-full","flex-shrink-0","justify-center","overflow-auto"],[1,"block","border-b","px-3","py-3","text-sm","text-zinc-300","md:px-8",3,"routerLink","replaceUrl","ngClass"],[1,"flex","flex-1","p-2","pt-4","md:p-8"]],template:function(e,i){e&1&&(n(0,"div",0),x(1,Ot,3,0,"div",1)(2,Ut,3,0)(3,Bt,5,0),s()),e&2&&(c(),_(1,i.isLoading?1:i.loadingError?2:3))},dependencies:[Oe,Pe,L,R,le,qe,Be]});let o=r;return o})();var ko=[{path:"",redirectTo:"/secure/account/schools",pathMatch:"full"},{path:":id/confirm",component:Ce},{path:":id",component:dt,children:[{path:"",redirectTo:"profile",pathMatch:"full"},{path:"administrators",component:rt},{path:"confirm",component:Ce},{path:"invoices",component:lt},{path:"profile",component:mt}]}];export{ko as Routes};

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.