function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var o=0;o<t.length;o++){var s=t[o];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}function _createClass(e,t,o){return t&&_defineProperties(e.prototype,t),o&&_defineProperties(e,o),e}(window.webpackJsonp=window.webpackJsonp||[]).push([[12],{"3yYE":function(e,t,o){"use strict";o.r(t);var s=o("ofXK"),r=o("3Pt+"),c=o("tyNb"),n=o("mrSG"),i=o("Usal"),a=o("pz8m"),u=o("7NWl"),d=o("zwrK"),l=o("5zJ1"),b=o("ReVU"),h=o("fXoL"),f=o("nD3/"),w=o("LEd3"),m=o("RDfn"),p=o("+kG/");function v(e,t){1&e&&h.Nb(0,"app-loader")}function g(e,t){if(1&e){var o=h.Tb();h.Sb(0,"dynamic-modal-form",11),h.ec("OnSubmit",(function(e){return h.xc(o),h.gc().SubmitForm(e)})),h.Rb()}if(2&e){var s=h.gc();h.nc("controls",s.controls)("showLoader",s.showLoader)("showCancel",!1)("showModal",!1)("submitText",s.submitText)}}var y,S=((y=function(){function e(t,o,s,r,c,n,i,a){_classCallCheck(this,e),this.settingService=t,this.dataService=o,this.coreService=s,this.coreActions=r,this.actions=c,this.formService=n,this.router=i,this.cookieService=a,this.controls=[],this.showLoader=!0,this.submitText="Save Changes",this.User={}}return _createClass(e,[{key:"ngOnInit",value:function(){var e=this;this.auth$.subscribe((function(t){e.User=t.User,e.initializeControls(t.User),e.showLoader=!1}))}},{key:"initializeControls",value:function(e){this.controls=this.formService.getControls(e,4,!1)}},{key:"deleteAccount",value:function(){var e=this;!0===confirm("Are you sure you want to delete your account?")&&this.dataService.DeleteAccount(this.User).subscribe((function(t){"error"===t.status?e.coreActions.Notify({title:t.message,text:"",css:"bg-danger"}):(e.coreActions.Notify({title:"Account Deleted",text:"",css:"bg-success"}),e.router.navigate(["/"])),e.showLoader=!1}),(function(t){e.showLoader=!1,e.coreActions.Notify({title:"Error Occured",text:"",css:"bg-danger"})}))}},{key:"SubmitForm",value:function(e){var t=this;this.User.cpassword=e.cpassword,this.User.opassword=e.opassword,this.User.password=e.password,this.User.viewType=4,this.User.password===this.User.cpassword?(this.User.isadmin=!1,this.showLoader=!0,this.dataService.AddRecord(this.User).subscribe((function(e){"error"===e.status?t.coreActions.Notify({title:e.message,text:"",css:"bg-danger"}):(t.coreActions.Notify({title:"Password changed successfully",text:"",css:"bg-success"}),t.router.navigate(["/"])),t.showLoader=!1}),(function(e){t.showLoader=!1,t.coreActions.Notify({title:"Error Occured",text:"",css:"bg-danger"})}))):this.coreActions.Notify({title:"Confirm Password Not Matched",text:"",css:"bg-danger"})}}]),e}()).\u0275fac=function(e){return new(e||y)(h.Mb(d.a),h.Mb(u.a),h.Mb(f.a),h.Mb(w.a),h.Mb(l.a),h.Mb(a.a),h.Mb(c.c),h.Mb(b.a))},y.\u0275cmp=h.Gb({type:y,selectors:[["app-manageaccount"]],features:[h.yb([u.a,d.a,l.a,a.a,b.a])],decls:14,vars:2,consts:[[1,"row"],[1,"col-md-12"],[1,"card"],[1,"card-header"],[1,"m-b-0"],[1,"card-body"],[4,"ngIf"],[3,"controls","showLoader","showCancel","showModal","submitText","OnSubmit",4,"ngIf"],[1,"card","m-t-20"],[1,"m-t-20","m-b-20","text-center"],[1,"btn","btn-danger",3,"click"],[3,"controls","showLoader","showCancel","showModal","submitText","OnSubmit"]],template:function(e,t){1&e&&(h.Sb(0,"div",0),h.Sb(1,"div",1),h.Sb(2,"div",2),h.Sb(3,"div",3),h.Sb(4,"h4",4),h.Gc(5,"Change Password"),h.Rb(),h.Rb(),h.Sb(6,"div",5),h.Ec(7,v,1,0,"app-loader",6),h.Ec(8,g,1,5,"dynamic-modal-form",7),h.Rb(),h.Rb(),h.Sb(9,"div",8),h.Sb(10,"div",5),h.Sb(11,"div",9),h.Sb(12,"button",10),h.ec("click",(function(){return t.deleteAccount()})),h.Gc(13," Delete Account "),h.Rb(),h.Rb(),h.Rb(),h.Rb(),h.Rb(),h.Rb()),2&e&&(h.zb(7),h.nc("ngIf",t.showLoader),h.zb(1),h.nc("ngIf",!t.showLoader&&t.controls.length>0))},directives:[s.n,m.a,p.a],encapsulation:2}),Object(n.a)([Object(i.e)(["users","auth"])],y.prototype,"auth$",void 0),y),A=o("o+qO"),C=o("/4iV");o.d(t,"ManageAccountModule",(function(){return U}));var M,N=[{path:"",data:{topmenuIndex:C.c.TOPMENU_SETTINGS_INDEX,leftmenuIndex:C.c.SETTINGS_MANAGE_ACCOUNT_INDEX,title:"My Account",urls:[{title:"My Account",url:"/"},{title:"Manage Account"}]},component:S}],U=((M=function e(){_classCallCheck(this,e)}).\u0275mod=h.Kb({type:M}),M.\u0275inj=h.Jb({factory:function(e){return new(e||M)},imports:[[r.i,s.c,A.a,c.f.forChild(N)]]}),M)}}]);