@ngageoint/mage.web-app 6.6.3 → 6.6.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[386],{29386:(W,h,e)=>{e.r(h),e.d(h,{ProfileModule:()=>L});var c=e(51308),m=e(21322),w=e(56610),P=e(30322),i=e(37222),R=e(26409),C=e(86323),F=e(45533),I=e(69937),M=e(20579),o=e(93176),u=e(44053),f=e(72221),G=function(){var t,l=(0,c.A)(function s(r){(0,m.A)(this,s),this.dialogRef=r});return(t=l).\u0275fac=function(r){return new(r||t)(o.rXU(u.CP))},t.\u0275cmp=o.VBU({type:t,selectors:[["password-reset-dialog"]],decls:10,vars:0,consts:[[1,"content"],[1,"material-symbols-outlined","icon"],[1,"title"],["mat-dialog-actions","","align","end"],["mat-button","","mat-dialog-close","","color","primary"]],template:function(r,n){1&r&&(o.j41(0,"div",0)(1,"span",1),o.EFF(2,"check_circle"),o.k0s(),o.j41(3,"div",2),o.EFF(4,"Password Changed"),o.k0s(),o.j41(5,"p"),o.EFF(6,"Your password has been changed successfully."),o.k0s()(),o.j41(7,"div",3)(8,"button",4),o.EFF(9,"Return to Login"),o.k0s()())},dependencies:[f.$z,u.tx,u.E7],styles:['.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;margin:48px 0}.title[_ngcontent-%COMP%]{font:400 20px/32px Roboto,Helvetica Neue,sans-serif}.icon[_ngcontent-%COMP%]{color:#4caf50;font-size:96px;font-variation-settings:"fill" 0,"wght" 200,"grad" 0,"opsz" 96;margin-bottom:32px}']}),l}(),k=e(99026),v=e(9675),N=e(69932),y=e(90643),p=e(65468),j=e(26182),E=e(24587),b=e(4684),x=e(23550),_=e(45418);function $(t,l){if(1&t&&(o.j41(0,"div",27)(1,"mat-icon"),o.EFF(2,"error"),o.k0s(),o.j41(3,"p",28),o.EFF(4),o.k0s()()),2&t){var s=o.XpG();o.R7$(4),o.JRh(s.infoError)}}function O(t,l){1&t&&(o.j41(0,"mat-error"),o.EFF(1,"Current password is required"),o.k0s())}function T(t,l){1&t&&(o.j41(0,"mat-error"),o.EFF(1,"Invalid password"),o.k0s())}function S(t,l){1&t&&(o.j41(0,"div"),o.EFF(1,"Password is required."),o.k0s())}function A(t,l){1&t&&(o.j41(0,"mat-error"),o.EFF(1,"New password is required"),o.k0s())}function Y(t,l){1&t&&(o.j41(0,"mat-error"),o.EFF(1,"Passwords must match"),o.k0s())}function D(t,l){1&t&&(o.j41(0,"mat-error"),o.EFF(1,"New password confirmation is required"),o.k0s())}function B(t,l){if(1&t&&(o.j41(0,"div",27)(1,"mat-icon"),o.EFF(2,"error"),o.k0s(),o.j41(3,"p",28),o.EFF(4),o.k0s()()),2&t){var s=o.XpG(2);o.R7$(4),o.JRh(s.passwordError)}}function V(t,l){if(1&t){var s=o.RV6();o.j41(0,"mat-card",7)(1,"div")(2,"div",8),o.EFF(3,"Password"),o.k0s(),o.j41(4,"div",29),o.EFF(5,"It's a good idea to use a strong password that you're not using elsewhere."),o.k0s()(),o.j41(6,"form",9)(7,"mat-form-field",16)(8,"mat-label"),o.EFF(9,"Type your current password"),o.k0s(),o.nrm(10,"input",30),o.DNE(11,O,2,0,"mat-error",31)(12,T,2,0,"mat-error",31)(13,S,2,0,"div",31),o.k0s(),o.j41(14,"mat-form-field",16)(15,"mat-label"),o.EFF(16,"Type your new password"),o.k0s(),o.j41(17,"input",32),o.bIt("input",function(){o.eBV(s);var a=o.XpG();return o.Njj(a.onPasswordChanged(a.password.controls.newPassword.value))}),o.k0s(),o.DNE(18,A,2,0,"mat-error",31)(19,Y,2,0,"mat-error",31),o.k0s(),o.j41(20,"mat-form-field",16)(21,"mat-label"),o.EFF(22,"Confirm your new password"),o.k0s(),o.nrm(23,"input",33),o.DNE(24,D,2,0,"mat-error",31),o.k0s()(),o.j41(25,"div")(26,"div",34)(27,"div",35),o.EFF(28,"Password Strengh"),o.k0s(),o.j41(29,"div",36),o.EFF(30),o.k0s()(),o.nrm(31,"mat-progress-bar",37),o.k0s(),o.DNE(32,B,5,1,"div",21),o.j41(33,"div",22)(34,"button",23),o.bIt("click",function(){o.eBV(s);var a=o.XpG();return o.Njj(a.onCancelPassword())}),o.EFF(35,"Cancel"),o.k0s(),o.j41(36,"button",24),o.bIt("click",function(){o.eBV(s);var a=o.XpG();return o.Njj(a.onResetPassword())}),o.EFF(37,"Reset Password"),o.k0s()()()}if(2&t){var r=o.XpG();o.R7$(6),o.Y8G("formGroup",r.password),o.R7$(4),o.Y8G("formControl",r.password.controls.currentPassword),o.R7$(),o.Y8G("ngIf",r.password.controls.currentPassword.hasError("required")),o.R7$(),o.Y8G("ngIf",r.password.controls.currentPassword.hasError("invalid")),o.R7$(),o.Y8G("ngIf",r.password.controls.currentPassword.required),o.R7$(4),o.Y8G("formControl",r.password.controls.newPassword),o.R7$(),o.Y8G("ngIf",r.password.controls.newPassword.hasError("required")),o.R7$(),o.Y8G("ngIf",r.password.controls.newPassword.hasError("matches")),o.R7$(4),o.Y8G("formControl",r.password.controls.newPasswordConfirm),o.R7$(),o.Y8G("ngIf",r.password.controls.newPasswordConfirm.hasError("required")),o.R7$(6),o.JRh(null==r.passwordStrength?null:r.passwordStrength.text),o.R7$(),o.Y8G("value",null==r.passwordStrength?null:r.passwordStrength.value),o.R7$(),o.Y8G("ngIf",r.passwordError)}}function J(t,l){1&t&&(o.j41(0,"div",38),o.nrm(1,"mat-progress-bar",39),o.k0s())}var X=function(){var t,l=function(){return(0,c.A)(function s(r,n,a){(0,m.A)(this,s),this.dialog=r,this.router=n,this.userService=a,this.saving=!1,this.info=new i.gE({username:new i.MJ({value:"",disabled:!0},[]),displayName:new i.MJ("",[i.k0.required]),email:new i.MJ("",[i.k0.email]),phone:new i.MJ("",[])}),this.password=new i.gE({currentPassword:new i.MJ("",[i.k0.required]),newPassword:new i.MJ("",[i.k0.required]),newPasswordConfirm:new i.MJ("",[i.k0.required])})},[{key:"ngOnInit",value:function(){this.user=this.userService.myself,this.setInfo(this.user),C.u2.setOptions({dictionary:(0,P.A)((0,P.A)({},F.z),I.z),graphs:F.K,translations:M.A})}},{key:"onSave",value:function(){var n=this;this.saving=!0,this.userService.saveProfile({avatar:this.avatar,displayName:this.info.controls.displayName.value,email:this.info.controls.email.value,phone:this.info.controls.phone.value}).subscribe({next:function(d){d.type===R.hv.Response&&(n.saving=!1,n.user=d.body)},error:function(){n.infoError="Error updating profile, please try again later."}})}},{key:"onAvatar",value:function(n){var a=n.target.files[0];a&&(this.avatar=a)}},{key:"onPasswordChanged",value:function(n){if(n&&n.length>0){var a=n&&n.length?(0,C.K1)(n,[this.user.username,this.user.displayName,this.user.email]).score:0;this.passwordStrength=k.s[a]}else this.passwordStrength=k.s[0]}},{key:"onCancelPassword",value:function(){this.password.setValue({currentPassword:"",newPassword:"",newPasswordConfirm:""}),this.password.markAsUntouched()}},{key:"onResetPassword",value:function(){var n=this;this.password.controls.newPassword.setErrors(this.password.controls.newPassword.value!==this.password.controls.newPasswordConfirm.value?{matches:!0}:null),this.password.markAllAsTouched(),this.password.valid&&this.userService.updatePassword(this.password.controls.currentPassword.value,this.password.controls.newPassword.value).subscribe({next:function(){n.dialog.open(G,{disableClose:!0,autoFocus:!1}).afterClosed().subscribe(function(){n.router.navigate(["landing"])})},error:function(d){401===d.status?n.password.controls.currentPassword.setErrors({invalid:!0}):n.passwordError=d.error}})}},{key:"onCancel",value:function(){this.setInfo(this.user)}},{key:"onBack",value:function(){this.router.navigate(["home"])}},{key:"setInfo",value:function(n){this.info.setValue({username:n.username,displayName:n.displayName,email:n.email||"",phone:n.phone||""})}}])}();return(t=l).\u0275fac=function(r){return new(r||t)(o.rXU(u.bZ),o.rXU(v.Ix),o.rXU(N.D))},t.\u0275cmp=o.VBU({type:t,selectors:[["profile"]],decls:48,vars:13,consts:[["fileInput",""],["color","primary"],[1,"navigation"],["mat-icon-button","",3,"click"],[1,"navigation-title"],[1,"container"],[1,"cards"],[1,"card"],[1,"mat-h1"],[3,"formGroup"],[1,"avatar-container"],[1,"avatar"],[3,"user","file","avatarWidth","avatarHeight"],["hidden","","type","file",3,"change"],[1,"avatar-container__button"],[1,"row"],["appearance","fill"],["matInput","","placeholder","Username","disabled","",3,"formControl"],["matInput","","placeholder","Display Name",3,"formControl"],["matInput","","placeholder","Username",3,"formControl"],["matInput","","placeholder","Phone",3,"formControl"],["class","error",4,"ngIf"],[1,"actions"],["mat-flat-button","",3,"click"],["mat-flat-button","","color","primary",3,"click"],["class","card",4,"ngIf"],["class","mask",4,"ngIf"],[1,"error"],[1,"error__text"],[1,"mat-caption"],["matInput","","type","password","placeholder","Current Password",3,"formControl"],[4,"ngIf"],["matInput","","type","password","placeholder","New Password",3,"input","formControl"],["matInput","","type","password","placeholder","New Password confirmation",3,"formControl"],[1,"password-strength"],[1,"mat-body-1"],[1,"mat-body-2"],["mode","determinate",3,"value"],[1,"mask"],["mode","indeterminate"]],template:function(r,n){if(1&r){var a=o.RV6();o.j41(0,"mat-toolbar",1)(1,"div",2)(2,"button",3),o.bIt("click",function(){return o.eBV(a),o.Njj(n.onBack())}),o.j41(3,"mat-icon"),o.EFF(4,"arrow_back"),o.k0s()(),o.j41(5,"span",4),o.EFF(6),o.k0s()()(),o.j41(7,"div",5)(8,"div",6)(9,"mat-card",7)(10,"div",8),o.EFF(11,"General Information"),o.k0s(),o.j41(12,"form",9)(13,"div",10)(14,"div",11),o.nrm(15,"user-avatar",12),o.j41(16,"input",13,0),o.bIt("change",function(g){return o.eBV(a),o.Njj(n.onAvatar(g))}),o.k0s()(),o.j41(18,"div",14)(19,"button",3),o.bIt("click",function(){o.eBV(a);var g=o.sdS(17);return o.Njj(g.click())}),o.j41(20,"mat-icon"),o.EFF(21,"photo_camera"),o.k0s()()()(),o.j41(22,"div",15)(23,"mat-form-field",16)(24,"mat-label"),o.EFF(25,"Username"),o.k0s(),o.nrm(26,"input",17),o.k0s(),o.j41(27,"mat-form-field",16)(28,"mat-label"),o.EFF(29,"Display Name"),o.k0s(),o.nrm(30,"input",18),o.k0s()(),o.j41(31,"div",15)(32,"mat-form-field",16)(33,"mat-label"),o.EFF(34,"Email"),o.k0s(),o.nrm(35,"input",19),o.k0s(),o.j41(36,"mat-form-field",16)(37,"mat-label"),o.EFF(38,"Phone"),o.k0s(),o.nrm(39,"input",20),o.k0s()()(),o.DNE(40,$,5,1,"div",21),o.j41(41,"div",22)(42,"button",23),o.bIt("click",function(){return o.eBV(a),o.Njj(n.onCancel())}),o.EFF(43,"Cancel"),o.k0s(),o.j41(44,"button",24),o.bIt("click",function(){return o.eBV(a),o.Njj(n.onSave())}),o.EFF(45,"Save"),o.k0s()()(),o.DNE(46,V,38,13,"mat-card",25),o.k0s(),o.DNE(47,J,2,0,"div",26),o.k0s()}2&r&&(o.R7$(6),o.JRh(n.info.controls.displayName.value),o.R7$(6),o.Y8G("formGroup",n.info),o.R7$(3),o.Y8G("user",n.user)("file",n.avatar)("avatarWidth",120)("avatarHeight",120),o.R7$(11),o.Y8G("formControl",n.info.controls.username),o.R7$(4),o.Y8G("formControl",n.info.controls.displayName),o.R7$(5),o.Y8G("formControl",n.info.controls.email),o.R7$(4),o.Y8G("formControl",n.info.controls.phone),o.R7$(),o.Y8G("ngIf",n.infoError),o.R7$(6),o.Y8G("ngIf","local"===n.user.authentication.type),o.R7$(),o.Y8G("ngIf",n.saving))},dependencies:[w.bT,f.$z,f.iY,y.RN,p.rl,p.nJ,p.TL,j.An,E.fg,b.HM,x.KQ,i.qT,i.me,i.BC,i.cb,i.l_,i.j4,_.a],styles:["mat-form-field[_ngcontent-%COMP%]{width:100%;margin-bottom:8px}.mat-h1[_ngcontent-%COMP%]{margin:unset}.mat-caption[_ngcontent-%COMP%]{opacity:.6}.navigation[_ngcontent-%COMP%]{display:flex;flex-direction:row;align-items:center;justify-content:center}.navigation-title[_ngcontent-%COMP%]{margin-left:16px}.container[_ngcontent-%COMP%]{position:relative}.cards[_ngcontent-%COMP%]{margin:auto;max-width:1200px;padding:16px 0}.card[_ngcontent-%COMP%]{margin:16px 0;display:flex;flex-direction:column;gap:16px}.avatar-container[_ngcontent-%COMP%]{width:140px;height:140px;position:relative;display:flex;margin-bottom:16px}.avatar[_ngcontent-%COMP%]{width:120px;height:120px;display:flex;align-items:center;justify-content:center;border-radius:60px}.avatar-container__button[_ngcontent-%COMP%]{position:absolute;bottom:20px;right:20px;background-color:#f5f5f5;width:40px;height:40px;border-radius:20px}.avatar-add__background[_ngcontent-%COMP%]{position:absolute;bottom:12px;right:12px;background-color:#f5f5f5;width:40px;height:40px;border-radius:20px}.avatar-add__icon[_ngcontent-%COMP%]{position:absolute;bottom:14px;right:14px;display:flex;align-items:center;justify-content:center;width:36px;height:36px}.row[_ngcontent-%COMP%]{display:flex;flex-direction:row;align-items:center;gap:16px}.actions[_ngcontent-%COMP%]{width:100%;display:flex;flex-direction:row;gap:16px;justify-content:flex-end}.password-strength[_ngcontent-%COMP%]{display:flex;flex-direction:row;align-items:center;gap:4px;margin-bottom:8px}.error[_ngcontent-%COMP%]{display:flex;flex-direction:row;align-items:center;gap:16px;color:#ab3022}.error__text[_ngcontent-%COMP%]{flex:1}.mask[_ngcontent-%COMP%]{position:absolute;inset:0;background-color:#0000001a}"]}),l}(),U=e(22845),H=[{path:"",component:X,resolve:{user:e(71983).u}}],K=function(){var t,l=(0,c.A)(function s(){(0,m.A)(this,s)});return(t=l).\u0275fac=function(r){return new(r||t)},t.\u0275mod=o.$C({type:t}),t.\u0275inj=o.G2t({imports:[w.MD,f.Hl,y.Hu,p.RG,j.m_,E.fS,b.PO,x.s5,i.X1]}),l}(),L=function(){var t,l=(0,c.A)(function s(){(0,m.A)(this,s)});return(t=l).\u0275fac=function(r){return new(r||t)},t.\u0275mod=o.$C({type:t}),t.\u0275inj=o.G2t({imports:[K,U.B,v.iI.forChild(H),v.iI]}),l}()}}]);
1
+ "use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[386],{29386:(W,h,r)=>{r.r(h),r.d(h,{ProfileModule:()=>L});var c=r(51308),m=r(21322),w=r(56610),P=r(30322),i=r(37222),b=r(26409),C=r(86323),F=r(45533),I=r(69937),M=r(20579),o=r(93176),f=r(44053),u=r(72221),G=function(){var t,l=(0,c.A)(function s(e){(0,m.A)(this,s),this.dialogRef=e});return(t=l).\u0275fac=function(e){return new(e||t)(o.rXU(f.CP))},t.\u0275cmp=o.VBU({type:t,selectors:[["password-reset-dialog"]],decls:10,vars:0,consts:[[1,"content"],[1,"material-symbols-outlined","icon"],[1,"title"],["mat-dialog-actions","","align","end"],["mat-button","","mat-dialog-close","","color","primary"]],template:function(e,n){1&e&&(o.j41(0,"div",0)(1,"span",1),o.EFF(2,"check_circle"),o.k0s(),o.j41(3,"div",2),o.EFF(4,"Password Changed"),o.k0s(),o.j41(5,"p"),o.EFF(6,"Your password has been changed successfully."),o.k0s()(),o.j41(7,"div",3)(8,"button",4),o.EFF(9,"Return to Login"),o.k0s()())},dependencies:[u.$z,f.tx,f.E7],styles:['.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;margin:48px 0}.title[_ngcontent-%COMP%]{font:400 20px/32px Roboto,Helvetica Neue,sans-serif}.icon[_ngcontent-%COMP%]{color:#4caf50;font-size:96px;font-variation-settings:"fill" 0,"wght" 200,"grad" 0,"opsz" 96;margin-bottom:32px}']}),l}(),k=r(99026),v=r(9675),N=r(69932),y=r(90643),p=r(65468),j=r(26182),E=r(24587),x=r(4684),R=r(23550),$=r(45418);function O(t,l){if(1&t&&(o.j41(0,"div",27)(1,"mat-icon"),o.EFF(2,"error"),o.k0s(),o.j41(3,"p",28),o.EFF(4),o.k0s()()),2&t){var s=o.XpG();o.R7$(4),o.JRh(s.infoError)}}function T(t,l){1&t&&(o.j41(0,"mat-error"),o.EFF(1,"Current password is required"),o.k0s())}function _(t,l){1&t&&(o.j41(0,"mat-error"),o.EFF(1,"Invalid password"),o.k0s())}function S(t,l){1&t&&(o.j41(0,"div"),o.EFF(1,"Password is required."),o.k0s())}function A(t,l){1&t&&(o.j41(0,"mat-error"),o.EFF(1,"New password is required"),o.k0s())}function Y(t,l){1&t&&(o.j41(0,"mat-error"),o.EFF(1,"Passwords must match"),o.k0s())}function D(t,l){1&t&&(o.j41(0,"mat-error"),o.EFF(1,"New password confirmation is required"),o.k0s())}function B(t,l){if(1&t&&(o.j41(0,"div",27)(1,"mat-icon"),o.EFF(2,"error"),o.k0s(),o.j41(3,"p",28),o.EFF(4),o.k0s()()),2&t){var s=o.XpG(2);o.R7$(4),o.JRh(s.passwordError)}}function V(t,l){if(1&t){var s=o.RV6();o.j41(0,"mat-card",7)(1,"div")(2,"div",8),o.EFF(3,"Password"),o.k0s(),o.j41(4,"div",29),o.EFF(5,"It's a good idea to use a strong password that you're not using elsewhere."),o.k0s()(),o.j41(6,"form",9)(7,"mat-form-field",16)(8,"mat-label"),o.EFF(9,"Type your current password"),o.k0s(),o.nrm(10,"input",30),o.DNE(11,T,2,0,"mat-error",31)(12,_,2,0,"mat-error",31)(13,S,2,0,"div",31),o.k0s(),o.j41(14,"mat-form-field",16)(15,"mat-label"),o.EFF(16,"Type your new password"),o.k0s(),o.j41(17,"input",32),o.bIt("input",function(){o.eBV(s);var a=o.XpG();return o.Njj(a.onPasswordChanged(a.password.controls.newPassword.value))}),o.k0s(),o.DNE(18,A,2,0,"mat-error",31)(19,Y,2,0,"mat-error",31),o.k0s(),o.j41(20,"mat-form-field",16)(21,"mat-label"),o.EFF(22,"Confirm your new password"),o.k0s(),o.nrm(23,"input",33),o.DNE(24,D,2,0,"mat-error",31),o.k0s()(),o.j41(25,"div")(26,"div",34)(27,"div",35),o.EFF(28,"Password Strengh"),o.k0s(),o.j41(29,"div",36),o.EFF(30),o.k0s()(),o.nrm(31,"mat-progress-bar",37),o.k0s(),o.DNE(32,B,5,1,"div",21),o.j41(33,"div",22)(34,"button",23),o.bIt("click",function(){o.eBV(s);var a=o.XpG();return o.Njj(a.onCancelPassword())}),o.EFF(35,"Cancel"),o.k0s(),o.j41(36,"button",24),o.bIt("click",function(){o.eBV(s);var a=o.XpG();return o.Njj(a.onResetPassword())}),o.EFF(37,"Reset Password"),o.k0s()()()}if(2&t){var e=o.XpG();o.R7$(6),o.Y8G("formGroup",e.password),o.R7$(4),o.Y8G("formControl",e.password.controls.currentPassword),o.R7$(),o.Y8G("ngIf",e.password.controls.currentPassword.hasError("required")),o.R7$(),o.Y8G("ngIf",e.password.controls.currentPassword.hasError("invalid")),o.R7$(),o.Y8G("ngIf",e.password.controls.currentPassword.required),o.R7$(4),o.Y8G("formControl",e.password.controls.newPassword),o.R7$(),o.Y8G("ngIf",e.password.controls.newPassword.hasError("required")),o.R7$(),o.Y8G("ngIf",e.password.controls.newPassword.hasError("matches")),o.R7$(4),o.Y8G("formControl",e.password.controls.newPasswordConfirm),o.R7$(),o.Y8G("ngIf",e.password.controls.newPasswordConfirm.hasError("required")),o.R7$(6),o.JRh(null==e.passwordStrength?null:e.passwordStrength.text),o.R7$(),o.Y8G("value",null==e.passwordStrength?null:e.passwordStrength.value),o.R7$(),o.Y8G("ngIf",e.passwordError)}}function J(t,l){1&t&&(o.j41(0,"div",38),o.nrm(1,"mat-progress-bar",39),o.k0s())}var X=function(){var t,l=function(){return(0,c.A)(function s(e,n,a){(0,m.A)(this,s),this.dialog=e,this.router=n,this.userService=a,this.saving=!1,this.info=new i.gE({username:new i.MJ({value:"",disabled:!0},[]),displayName:new i.MJ("",[i.k0.required]),email:new i.MJ("",[i.k0.email]),phone:new i.MJ("",[])}),this.password=new i.gE({currentPassword:new i.MJ("",[i.k0.required]),newPassword:new i.MJ("",[i.k0.required]),newPasswordConfirm:new i.MJ("",[i.k0.required])})},[{key:"ngOnInit",value:function(){this.user=this.userService.myself,this.setInfo(this.user),C.u2.setOptions({dictionary:(0,P.A)((0,P.A)({},F.z),I.z),graphs:F.K,translations:M.A})}},{key:"onSave",value:function(){var n=this;this.saving=!0,this.userService.saveProfile({avatar:this.avatar,displayName:this.info.controls.displayName.value,email:this.info.controls.email.value,phone:this.info.controls.phone.value}).subscribe({next:function(d){d.type===b.hv.Response&&(n.saving=!1,n.user=d.body)},error:function(){n.infoError="Error updating profile, please try again later."}})}},{key:"onAvatar",value:function(n){var a=n.target.files[0];a&&(this.avatar=a)}},{key:"onPasswordChanged",value:function(n){if(n&&n.length>0){var a=n&&n.length?(0,C.K1)(n,[this.user.username,this.user.displayName,this.user.email]).score:0;this.passwordStrength=k.s[a]}else this.passwordStrength=k.s[0]}},{key:"onCancelPassword",value:function(){this.password.setValue({currentPassword:"",newPassword:"",newPasswordConfirm:""}),this.password.markAsUntouched()}},{key:"onResetPassword",value:function(){var n=this;this.password.controls.newPassword.setErrors(this.password.controls.newPassword.value!==this.password.controls.newPasswordConfirm.value?{matches:!0}:null),this.password.markAllAsTouched(),this.password.valid&&this.userService.updatePassword(this.password.controls.currentPassword.value,this.password.controls.newPassword.value).subscribe({next:function(){n.dialog.open(G,{disableClose:!0,autoFocus:!1}).afterClosed().subscribe(function(){n.router.navigate(["landing"])})},error:function(d){401===d.status?n.password.controls.currentPassword.setErrors({invalid:!0}):n.passwordError=d.error}})}},{key:"onCancel",value:function(){this.setInfo(this.user)}},{key:"onBack",value:function(){this.router.navigate(["home"])}},{key:"setInfo",value:function(n){this.info.setValue({username:n.username,displayName:n.displayName,email:n.email||"",phone:n.phone||""})}}])}();return(t=l).\u0275fac=function(e){return new(e||t)(o.rXU(f.bZ),o.rXU(v.Ix),o.rXU(N.D))},t.\u0275cmp=o.VBU({type:t,selectors:[["profile"]],decls:48,vars:13,consts:[["fileInput",""],["color","primary"],[1,"navigation"],["mat-icon-button","",3,"click"],[1,"navigation-title"],[1,"container"],[1,"cards"],[1,"card"],[1,"mat-h1"],[3,"formGroup"],[1,"avatar-container"],[1,"avatar"],[3,"user","file","avatarWidth","avatarHeight"],["hidden","","type","file",3,"change"],[1,"avatar-container__button"],[1,"row"],["appearance","fill"],["matInput","","placeholder","Username","disabled","",3,"formControl"],["matInput","","placeholder","Display Name",3,"formControl"],["matInput","","placeholder","Username",3,"formControl"],["matInput","","placeholder","Phone",3,"formControl"],["class","error",4,"ngIf"],[1,"actions"],["mat-flat-button","",3,"click"],["mat-flat-button","","color","primary",3,"click"],["class","card",4,"ngIf"],["class","mask",4,"ngIf"],[1,"error"],[1,"error__text"],[1,"mat-caption"],["matInput","","type","password","placeholder","Current Password",3,"formControl"],[4,"ngIf"],["matInput","","type","password","placeholder","New Password",3,"input","formControl"],["matInput","","type","password","placeholder","New Password confirmation",3,"formControl"],[1,"password-strength"],[1,"mat-body-1"],[1,"mat-body-2"],["mode","determinate",3,"value"],[1,"mask"],["mode","indeterminate"]],template:function(e,n){if(1&e){var a=o.RV6();o.j41(0,"mat-toolbar",1)(1,"div",2)(2,"button",3),o.bIt("click",function(){return o.eBV(a),o.Njj(n.onBack())}),o.j41(3,"mat-icon"),o.EFF(4,"arrow_back"),o.k0s()(),o.j41(5,"span",4),o.EFF(6),o.k0s()()(),o.j41(7,"div",5)(8,"div",6)(9,"mat-card",7)(10,"div",8),o.EFF(11,"General Information"),o.k0s(),o.j41(12,"form",9)(13,"div",10)(14,"div",11),o.nrm(15,"user-avatar",12),o.j41(16,"input",13,0),o.bIt("change",function(g){return o.eBV(a),o.Njj(n.onAvatar(g))}),o.k0s()(),o.j41(18,"div",14)(19,"button",3),o.bIt("click",function(){o.eBV(a);var g=o.sdS(17);return o.Njj(g.click())}),o.j41(20,"mat-icon"),o.EFF(21,"photo_camera"),o.k0s()()()(),o.j41(22,"div",15)(23,"mat-form-field",16)(24,"mat-label"),o.EFF(25,"Username"),o.k0s(),o.nrm(26,"input",17),o.k0s(),o.j41(27,"mat-form-field",16)(28,"mat-label"),o.EFF(29,"Display Name"),o.k0s(),o.nrm(30,"input",18),o.k0s()(),o.j41(31,"div",15)(32,"mat-form-field",16)(33,"mat-label"),o.EFF(34,"Email"),o.k0s(),o.nrm(35,"input",19),o.k0s(),o.j41(36,"mat-form-field",16)(37,"mat-label"),o.EFF(38,"Phone"),o.k0s(),o.nrm(39,"input",20),o.k0s()()(),o.DNE(40,O,5,1,"div",21),o.j41(41,"div",22)(42,"button",23),o.bIt("click",function(){return o.eBV(a),o.Njj(n.onCancel())}),o.EFF(43,"Cancel"),o.k0s(),o.j41(44,"button",24),o.bIt("click",function(){return o.eBV(a),o.Njj(n.onSave())}),o.EFF(45,"Save"),o.k0s()()(),o.DNE(46,V,38,13,"mat-card",25),o.k0s(),o.DNE(47,J,2,0,"div",26),o.k0s()}2&e&&(o.R7$(6),o.JRh(n.info.controls.displayName.value),o.R7$(6),o.Y8G("formGroup",n.info),o.R7$(3),o.Y8G("user",n.user)("file",n.avatar)("avatarWidth",120)("avatarHeight",120),o.R7$(11),o.Y8G("formControl",n.info.controls.username),o.R7$(4),o.Y8G("formControl",n.info.controls.displayName),o.R7$(5),o.Y8G("formControl",n.info.controls.email),o.R7$(4),o.Y8G("formControl",n.info.controls.phone),o.R7$(),o.Y8G("ngIf",n.infoError),o.R7$(6),o.Y8G("ngIf","local"===n.user.authentication.type),o.R7$(),o.Y8G("ngIf",n.saving))},dependencies:[w.bT,u.$z,u.iY,y.RN,p.rl,p.nJ,p.TL,j.An,E.fg,x.HM,R.KQ,i.qT,i.me,i.BC,i.cb,i.l_,i.j4,$.a],styles:["mat-form-field[_ngcontent-%COMP%]{width:100%;margin-bottom:16px}.mat-h1[_ngcontent-%COMP%]{margin:0;font-size:32px;line-height:40px;font-weight:400}.mat-caption[_ngcontent-%COMP%]{font-size:14px;line-height:20px;opacity:.6}.navigation[_ngcontent-%COMP%]{display:flex;align-items:center}.navigation-title[_ngcontent-%COMP%]{margin-left:16px;font-size:18px;font-weight:500}.container[_ngcontent-%COMP%]{position:relative;padding:16px 0}.cards[_ngcontent-%COMP%]{margin:auto;max-width:1200px}.card[_ngcontent-%COMP%]{margin:16px 0;padding:16px 24px!important;display:flex;flex-direction:column;gap:24px}.avatar-container[_ngcontent-%COMP%]{width:140px;height:140px;position:relative;display:flex;margin:8px 0 24px}.avatar[_ngcontent-%COMP%]{width:120px;height:120px;display:flex;align-items:center;justify-content:center;border-radius:60px;overflow:hidden}.avatar-container__button[_ngcontent-%COMP%]{position:absolute;bottom:20px;right:20px;background-color:#f5f5f5;width:40px;height:40px;border-radius:20px;display:flex;align-items:center;justify-content:center}.row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:16px}.row[_ngcontent-%COMP%] mat-form-field[_ngcontent-%COMP%]{flex:1}.actions[_ngcontent-%COMP%]{width:100%;display:flex;gap:16px;justify-content:flex-end;align-items:center;padding-top:8px}.password-strength[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px;margin-bottom:8px}.error[_ngcontent-%COMP%]{display:flex;align-items:center;gap:16px;color:#ab3022}.error__text[_ngcontent-%COMP%]{flex:1}.mask[_ngcontent-%COMP%]{position:absolute;inset:0;background-color:#0000001a}"]}),l}(),U=r(22845),H=[{path:"",component:X,resolve:{user:r(71983).u}}],K=function(){var t,l=(0,c.A)(function s(){(0,m.A)(this,s)});return(t=l).\u0275fac=function(e){return new(e||t)},t.\u0275mod=o.$C({type:t}),t.\u0275inj=o.G2t({imports:[w.MD,u.Hl,y.Hu,p.RG,j.m_,E.fS,x.PO,R.s5,i.X1]}),l}(),L=function(){var t,l=(0,c.A)(function s(){(0,m.A)(this,s)});return(t=l).\u0275fac=function(e){return new(e||t)},t.\u0275mod=o.$C({type:t}),t.\u0275inj=o.G2t({imports:[K,U.B,v.iI.forChild(H),v.iI]}),l}()}}]);