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AAS,CAACL,KAAK,CAACA,KAAK,CAACW,OAAO,CAAC;MACpD,CAAC,CACF;;EAEL;;;;;;;;;;;AAvDW9C,SAAS,GAAAK,iDAAA,EALrBS,wDAAS,CAAC;EACTiC,QAAQ,EAAE,WAAW;EACrBC,QAAA,EAAAC,wDAAgC;;CAEjC,CAAC,GACWjD,SAAS,CAyDrB;;;;;;;;;;ACrED;AACA,4CAA4C,mBAAO,CAAC,uEAA6D;AACjH,kCAAkC,mBAAO,CAAC,gEAAsD;AAChG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,OAAO,gGAAgG,WAAW,UAAU,UAAU,UAAU,UAAU,WAAW,KAAK,KAAK,UAAU,gCAAgC,qBAAqB,6BAA6B,iBAAiB,kBAAkB,sBAAsB,sBAAsB,qDAAqD,OAAO,eAAe,uBAAuB,OAAO,GAAG,mBAAmB;AAC1d;AACA","sources":["./src/app/login/login-routing.module.ts","./src/app/login/login.module.ts","./src/app/login/login.page.ts","./src/app/login/login.page.scss"],"sourcesContent":["import { NgModule } from '@angular/core';\nimport { Routes, RouterModule } from '@angular/router';\n\nimport { LoginPage } from './login.page';\n\nconst routes: Routes = [\n {\n path: '',\n component: LoginPage\n }\n];\n\n@NgModule({\n imports: [RouterModule.forChild(routes)],\n exports: [RouterModule],\n})\nexport class LoginPageRoutingModule {}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormsModule } from '@angular/forms';\n\nimport { IonicModule } from '@ionic/angular';\n\nimport { LoginPageRoutingModule } from './login-routing.module';\n\nimport { LoginPage } from './login.page';\n\n@NgModule({\n imports: [\n CommonModule,\n FormsModule,\n IonicModule,\n LoginPageRoutingModule\n ],\n declarations: [LoginPage]\n})\nexport class LoginPageModule {}\n","import { Component, OnInit } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { APP_CONFIG } from '../app-config';\nimport IUser from '../interfaces/IUser';\nimport { ApiService } from '../services/api.service';\nimport { GlobalService } from '../services/global.service';\n\n@Component({\n selector: 'app-login',\n templateUrl: './login.page.html',\n styleUrls: ['./login.page.scss'],\n})\nexport class LoginPage implements OnInit {\n\n public loading:boolean = false;\n public showLogin:boolean = false;\n public config:any = APP_CONFIG;\n public user:IUser = {name: '', password: '', target: 'mobile'};\n\n constructor(\n private router: Router,\n private api: ApiService,\n private globalService: GlobalService\n ) {\n let _root = this;\n _root.api.profile().subscribe(\n result => {\n if( result['profile'] ) {\n _root.router.navigate(['/libros']);\n }\n },\n error => {\n localStorage.removeItem('uuid_key');\n localStorage.removeItem('user_uuid');\n localStorage.removeItem('token');\n _root.showLogin = true;\n }\n );\n }\n\n ngOnInit() {\n }\n\n onClickLogin() {\n let _root = this;\n\n // if(!(_root.user.name != '' && _root.user.password != '')) {\n if(!(_root.user.name != '')) {\n _root.globalService.showToast('Ingresa tu código.');\n }\n else {\n _root.loading = true;\n _root.api.login((_root.user.name).toLocaleLowerCase(), (_root.user.name).toLocaleLowerCase(), _root.user.target).subscribe(\n result => {\n _root.loading = false;\n if(result.access_token) {\n _root.api.setTokenToLocal(result.access_token);\n _root.globalService.is_login = true;\n _root.router.navigate(['/libros']);\n }\n },\n error => {\n _root.loading = false;\n _root.globalService.showToast(error.error.message);\n }\n );\n }\n }\n\n}\n","// Imports\nvar ___CSS_LOADER_API_SOURCEMAP_IMPORT___ = require(\"../../../node_modules/css-loader/dist/runtime/sourceMaps.js\");\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../node_modules/css-loader/dist/runtime/api.js\");\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `:host .bg-top-login {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 50%;\n background-color: var(--ion-color-primary);\n}\n:host .logo {\n width: 150px;\n}`, \"\",{\"version\":3,\"sources\":[\"webpack://./src/app/login/login.page.scss\"],\"names\":[],\"mappings\":\"AACI;EACI,kBAAA;EACA,MAAA;EACA,OAAA;EACA,WAAA;EACA,WAAA;EACA,0CAAA;AAAR;AAGI;EACI,YAAA;AADR\",\"sourcesContent\":[\":host {\\n .bg-top-login {\\n position: absolute;\\n top: 0;\\n left: 0;\\n width: 100%;\\n height: 50%;\\n background-color: var(--ion-color-primary);\\n }\\n\\n .logo {\\n width: 150px;\\n }\\n}\"],\"sourceRoot\":\"\"}]);\n// Exports\nmodule.exports = ___CSS_LOADER_EXPORT___.toString();\n"],"names":["NgModule","RouterModule","LoginPage","routes","path","component","LoginPageRoutingModule","__decorate","imports","forChild","exports","CommonModule","FormsModule","IonicModule","LoginPageModule","declarations","Component","Router","APP_CONFIG","ApiService","GlobalService","constructor","router","api","globalService","loading","showLogin","config","user","name","password","target","_root","profile","subscribe","result","navigate","error","localStorage","removeItem","ngOnInit","onClickLogin","showToast","login","toLocaleLowerCase","access_token","setTokenToLocal","is_login","message","selector","template","__NG_CLI_RESOURCE__0"],"sourceRoot":"webpack:///","x_google_ignoreList":[]}