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AAvE,WAOExC,MAAA,GAAAA,YAAA,+BAEqBA,MAAA,GAAAA,MAAA,GAAAA,MAAA,ioEEjCvDO,CAAc,ODRpB,IAAMyG,EAAkB,MAAzB,MAAOA,EAAkB1B,SAAApE,KAAA,mBAAAqE,iBAAlByB,EAAkB,EAAA1B,SAAApE,KAAA,UAAA+E,EAAAgB,IAAA,MAAlBD,IAAkB1B,SAAApE,KAAA,UAAA+E,EAAAiB,IAAA,UAHnBC,KAAaC,SAAShH,GACtB+G,eAECH,CAAkB,oBEsBxB,IAAMK,EAAW,MAAlB,MAAOA,EAAW/B,SAAApE,KAAA,mBAAAqE,iBAAX8B,EAAW,EAAA/B,SAAApE,KAAA,UAAA+E,EAAAgB,IAAA,MAAXI,IAAW/B,SAAApE,KAAA,UAAA+E,EAAAiB,IAAA,UAbpBI,KACAN,EACAO,KACAC,KACAC,KACAC,KAAaC,UACbC,KAAiBD,QAAQ,CAAEE,KAAM,wBACjCC,KACAC,KACAC,KACAC,eAGSZ,CAAW","names":["i0","role_r5","roleManagementId","roleName","routes","path","component","LoginComponent","constructor","translate","formBuilder","router","storageService","commonService","spinner","toster","apiUrl","sharedService","this","loginForm","group","submitted","IsShowPassword","selectedLanguage","savedLanguage","localStorage","getItem","setDefaultLang","use","ngOnInit","setData","OnInitLoginForm","getRoleList","ErrorConstants","CommonErrorMessages","LabelConstants","LoginLabelConstants","navigate","Email","Validators","required","email","pattern","password","maxLength","Role","loginFormControl","controls","onLogin","invalid","value","show","LoginObj","trim","Password","roleId","doPost","Login","UserLogin","pipe","subscribe","next","response","success","hide","setValue","data","token","userId","Encrypt","firstname","lastname","images","error","message","err","console","clear","togglePasswordVisibility","onForgotPassword","onRegistration","doGet","General","GetRoleList","roleList","log","static","t","i1","i2","i3","i4","i5","i6","i7","i8","i9","core","Xpm","selectors","decls","vars","consts","template","rf","ctx","LoginComponent_span_17_Template","LoginComponent_span_18_Template","LoginComponent_span_30_Template","LoginComponent_mat_option_41_Template","LoginComponent_span_42_Template","errors","LoginRoutingModule","oAB","cJS","RouterModule","forChild","LoginModule","CommonModule","FormsModule","ReactiveFormsModule","HttpClientModule","ToastrModule","forRoot","NgxSpinnerModule","type","MatIconModule","MatFormFieldModule","MatSelectModule","TranslateModule"],"sourceRoot":"webpack:///","sources":["./src/app/pages/login/login.component.html","./src/app/pages/login/login-routing.module.ts","./src/app/pages/login/login.component.ts","./src/app/pages/login/login.module.ts"],"sourcesContent":["
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \"\"\r\n
\r\n
\r\n
\r\n \r\n \r\n\r\n {{\r\n 'CommonErrorMessages.EmailRequired' | translate }}\r\n {{\r\n 'CommonErrorMessages.EmailNotValid' | translate }}\r\n
\r\n
\r\n \r\n
\r\n \r\n {{IsShowPassword\r\n ? \"visibility_off\" : \"visibility\"}}\r\n
\r\n {{\r\n 'CommonErrorMessages.PasswordRequired' | translate }}\r\n
\r\n
\r\n
\r\n {{'loginPage.Role' | translate}}*\r\n \r\n \r\n \r\n {{role.roleName}}\r\n \r\n \r\n \r\n \r\n {{'CommonErrorMessages.RoleRequired' | translate}}\r\n \r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
","import { NgModule } from '@angular/core';\r\nimport { RouterModule, Routes } from '@angular/router';\r\nimport { LoginComponent } from './login.component';\r\n\r\nconst routes: Routes = [{ path: '', component: LoginComponent }];\r\n\r\n@NgModule({\r\n imports: [RouterModule.forChild(routes)],\r\n exports: [RouterModule]\r\n})\r\nexport class LoginRoutingModule { }\r\n","import { Component, OnInit } from '@angular/core';\r\nimport { FormBuilder, FormGroup, Validators } from '@angular/forms';\r\nimport { Router } from '@angular/router';\r\nimport { NgxSpinnerService } from 'ngx-spinner';\r\nimport { ToastrService } from 'ngx-toastr';\r\nimport { CommonErrorMessages } from 'src/app/constants/ErrorMessages';\r\nimport { LoginLabelConstants } from 'src/app/constants/LabelConstants';\r\nimport { ApiUrlHelper } from 'src/app/common/api-url-helper';\r\nimport { CommonService } from 'src/app/services/common/common.service';\r\nimport { SharedService } from 'src/app/services/shared-service/shared.service';\r\nimport { StorageService } from 'src/app/services/storage/storage.service';\r\nimport { TranslateService } from '@ngx-translate/core';\r\n\r\n@Component({\r\n selector: 'app-login',\r\n templateUrl: './login.component.html',\r\n styleUrls: ['./login.component.scss'],\r\n})\r\nexport class LoginComponent implements OnInit {\r\n constructor(\r\n private translate: TranslateService,\r\n private formBuilder: FormBuilder,\r\n private router: Router,\r\n private storageService: StorageService,\r\n private commonService: CommonService,\r\n private spinner: NgxSpinnerService,\r\n private toster: ToastrService,\r\n private apiUrl: ApiUrlHelper,\r\n private sharedService: SharedService,\r\n ) { \r\n const savedLanguage = localStorage.getItem('selectedLanguage') || 'fr';\r\n this.selectedLanguage = savedLanguage;\r\n this.translate.setDefaultLang(this.selectedLanguage);\r\n this.translate.use(this.selectedLanguage);\r\n }\r\n\r\n // Common Properties\r\n loginForm: FormGroup = this.formBuilder.group({});\r\n submitted = false;\r\n IsShowPassword: boolean = false;\r\n ErrorConstants: any;\r\n LabelConstants: any;\r\n roleList:any;\r\n selectedLanguage: string = 'fr';\r\n\r\n ngOnInit(): void {\r\n this.sharedService.setData('Login');\r\n this.OnInitLoginForm();\r\n this.getRoleList();\r\n this.ErrorConstants = CommonErrorMessages;\r\n this.LabelConstants = LoginLabelConstants;\r\n if (localStorage.getItem('authToken')) {\r\n // if ((localStorage.getItem('userRole') ? localStorage.getItem('userRole') : '0') == '1') {\r\n this.router.navigate(['/dashboard']);\r\n // }\r\n // else if((localStorage.getItem('userRole') ? localStorage.getItem('userRole') : '0') == '2'){\r\n // this.router.navigate(['/yoga-session']);\r\n // }\r\n }\r\n }\r\n\r\n // Login Form\r\n OnInitLoginForm() {\r\n this.loginForm = this.formBuilder.group({\r\n Email: [\r\n '',\r\n [\r\n Validators.required,\r\n Validators.email,\r\n Validators.pattern(\r\n /^(?=.{1,30}@)[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$/\r\n ),\r\n ],\r\n ],\r\n password: ['', [Validators.required, Validators.maxLength(100)]],\r\n Role:['',Validators.required]\r\n });\r\n }\r\n\r\n // Getting Form Controls For Validation\r\n get loginFormControl() {\r\n return this.loginForm.controls;\r\n }\r\n\r\n // Login Method\r\n onLogin() {\r\n this.submitted = true;\r\n if (\r\n this.loginForm.invalid ||\r\n !this.loginForm.value.Email ||\r\n !this.loginForm.value.password\r\n ) {\r\n return;\r\n }\r\n this.spinner.show();\r\n let LoginObj = {\r\n Email: this.loginForm.value.Email?.trim(),\r\n Password: this.loginForm.value.password?.trim(),\r\n roleId: this.loginForm.value.Role\r\n };\r\n let apiUrl = this.apiUrl.apiUrl.Login.UserLogin;\r\n this.commonService\r\n .doPost(apiUrl, LoginObj)\r\n .pipe()\r\n .subscribe({\r\n next: (response) => {\r\n if (response.success) {\r\n this.spinner.hide();\r\n this.storageService.setValue('authToken', response.data.token);\r\n this.storageService.setValue('userId', response.data.userId);\r\n this.storageService.setValue('userRole', this.commonService.Encrypt(response.data.roleId));\r\n this.storageService.setValue(\r\n 'userName',\r\n response.data.firstname + ' ' + response.data.lastname\r\n );\r\n this.storageService.setValue('userImage', response.data.images);\r\n // if (response.data.roleId == 1) {\r\n this.router.navigate(['/dashboard']);\r\n // }\r\n } else {\r\n this.spinner.hide();\r\n this.toster.error(response.message);\r\n }\r\n },\r\n error: (err) => {\r\n this.spinner.hide();\r\n console.error(err);\r\n localStorage.clear();\r\n },\r\n });\r\n }\r\n\r\n // Password Show Hide\r\n togglePasswordVisibility() {\r\n this.IsShowPassword = !this.IsShowPassword;\r\n }\r\n\r\n onForgotPassword() {\r\n this.router.navigate(['/forgot-password']);\r\n }\r\n onRegistration() {\r\n this.router.navigate(['/registration']);\r\n }\r\n\r\n getRoleList(){\r\n this.spinner.show();\r\n let api = this.apiUrl.apiUrl.General.GetRoleList;\r\n this.commonService\r\n .doGet(api)\r\n .pipe()\r\n .subscribe({\r\n next: (response) => {\r\n if (response.success) {\r\n this.spinner.hide();\r\n this.roleList = response.data\r\n // this.getStateByCountry();\r\n } else {\r\n this.spinner.hide();\r\n }\r\n },\r\n error: (err) => {\r\n this.spinner.hide();\r\n console.log(err);\r\n },\r\n });\r\n }\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { LoginRoutingModule } from './login-routing.module';\r\nimport { LoginComponent } from './login.component';\r\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\r\nimport { HttpClientModule } from '@angular/common/http';\r\nimport { ToastrModule } from 'ngx-toastr';\r\nimport { NgxSpinnerModule } from 'ngx-spinner';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatFormFieldModule } from '@angular/material/form-field';\r\nimport { MatSelectModule } from '@angular/material/select';\r\nimport { TranslateModule } from '@ngx-translate/core';\r\n\r\n\r\n@NgModule({\r\n declarations: [\r\n LoginComponent\r\n ],\r\n imports: [\r\n CommonModule,\r\n LoginRoutingModule,\r\n FormsModule,\r\n ReactiveFormsModule,\r\n HttpClientModule,\r\n ToastrModule.forRoot() , \r\n NgxSpinnerModule.forRoot({ type: 'ball-scale-multiple' }),\r\n MatIconModule,\r\n MatFormFieldModule,\r\n MatSelectModule,\r\n TranslateModule\r\n ]\r\n})\r\nexport class LoginModule { }\r\n"],"x_google_ignoreList":[]}