1import{a as H}from"./chunk-XIP5JNX6.js";import{a as $}from"./chunk-JHALHTX6.js";import"./chunk-QPOO26CE.js";import"./chunk-37WTDPRB.js";import{a as A}from"./chunk-RFOBNJQH.js";import{a as L}from"./chunk-BSLGRCY5.js";import"./chunk-WZSF2MJM.js";import{a as P}from"./chunk-2OJ2XBXG.js";import{a as U}from"./chunk-YZ4MIJRL.js";import"./chunk-3YLG643I.js";import"./chunk-JKT7J6LB.js";import"./chunk-Y3PN5BSJ.js";import"./chunk-R4UTJ2DX.js";import"./chunk-RPM7JARY.js";import"./chunk-HE6SPJF2.js";import"./chunk-E457NSCN.js";import{a as N,b as O}from"./chunk-RXWTHBJM.js";import"./chunk-77XYNVEL.js";import"./chunk-4SNYSAET.js";import"./chunk-GAJUY3IC.js";import"./chunk-QJ5AWP4N.js";import{e as q}from"./chunk-MES46NTK.js";import{r as G}from"./chunk-VGJNR7UK.js";import{d as s,g as B,h as F,i as I,o as k,s as E,w as R}from"./chunk-XFDPYF6F.js";import{Bb as V,a as D}from"./chunk-KXQ22SIX.js";import"./chunk-RC4AHRA5.js";import{ha as S}from"./chunk-DDJWHZK7.js";import{A as h,Hc as x,Jc as M,Ld as g,Ma as r,Md as C,Nc as n,Oc as l,Pc as m,Qc as d,Tb as a,Wa as u,Xa as w,Xc as T,ab as v,cd as f,ed as c,lc as _,y as b,ya as y}from"./chunk-VKCGIC6R.js";import"./chunk-2ZPGY3SD.js";function z(p,t){if(p&1){let e=T();l(0,"form",1),f("ngSubmit",function(){u(e);let i=c();return w(i.maintainPassword())}),l(1,"div")(2,"ui-button",2),g(3,"toIconProp"),f("click",function(){u(e);let i=c();return w(i.back())}),m()(),d(4,"ui-heading",3),l(5,"div",4),d(6,"ui-password",5)(7,"ui-password",5),m(),d(8,"ui-button",6),m()}if(p&2){let e=t,o=c();n("formGroup",o.passwordForm),a(2),n("text",e==null?null:e.accountDashboardButtonText)("icon",C(3,11,e==null?null:e.accountDashboardButtonIcon)),a(2),n("text",e==null?null:e.headingText),a(2),n("formControl",o.currentPassword)("label",e==null?null:e.currentPasswordLabel),a(),n("formControl",o.newPassword)("label",e==null?null:e.newPasswordLabel),a(),n("type",o.buttonType.SUBMIT)("text",e==null?null:e.saveButtonText)("isDisabled",!o.passwordForm.valid)}}var j=class p{constructor(){this.userPassword=r(q);this.cmsComponent=r(G);this.globalMessageService=r(L);this.router=r(V);this.currentPassword=new P("",[s.required]);this.newPassword=new P("",[s.required,s.minLength(8),s.maxLength(40),s.pattern(/\d/)]);this.passwordForm=new I({oldPassword:this.currentPassword,newPassword:this.newPassword});this.buttonType=N;this.cms$=this.cmsComponent.data$.pipe(y(t=>{this.currentPassword.setValidationText({required:t.currentValidationTextRequired}),this.newPassword.setValidationText({required:t.newPasswordValidationTextRequired,minlength:t.newPasswordValidationTextMinLength,maxlength:t.newPasswordValidationTextMaxLength,pattern:t.newPasswordValidationTextPattern}),this.successMessage=t.passwordChangedValidationTextSuccess}));this.destroyRef=r(v)}maintainPassword(){this.userPassword.update(this.currentPassword.value,this.newPassword.value).pipe(h(()=>this.cmsComponent.data$),b(t=>t.passwordChangedValidationTextSuccess),D(this.destroyRef)).subscribe({next:()=>{this.globalMessageService.showSuccess(this.successMessage),this.passwordForm.reset()},error:t=>{t?.details?.length?this.globalMessageService.showError(t?.details[0].message??null):this.globalMessageService.showError(this.errorMessage),this.passwordForm.reset()}})}back(){this.router.goByUrl("/account/dashboard")}static{this.\u0275fac=function(e){return new(e||p)}}static{this.\u0275cmp=_({type:p,selectors:[["cms-maintain-password"]],standalone:!1,decls:2,vars:3,consts:[[1,"account",3,"formGroup"],[1,"account",3,"ngSubmit","formGroup"],["link","",1,"account__back",3,"click","text","icon"],[3,"text"],[1,"account__form"],["large","",1,"account__input",3,"formControl","label"],[1,"account__action",3,"type","text","isDisabled"]],template:function(e,o){if(e&1&&(x(0,z,9,13,"form",0),g(1,"async")),e&2){let i;M((i=C(1,1,o.cms$))?0:-1,i)}},dependencies:[k,B,F,E,R,O,U,A,H,S,$],encapsulation:2,changeDetection:0})}};export{j as MaintainPasswordComponent};
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.