{"version":3,"file":"src_app_modules_home_home_module_ts.aa33c4f5476abeaa.js","mappings":"wPAcO,IAAMA,EAAb,MAAM,QAEJC,YACUC,EACAC,EACAC,EACqBC,GAHrBC,mBACAA,yBACAA,mBACqBA,kBAG/BC,WACED,KAAKF,YAAYI,yBAAyBC,UAAUC,IAClDJ,KAAKJ,YAAYS,wBAAwBF,UAAUG,IAC9CA,IASIC,QAAkBP,KAAKD,aACxBS,OAAOC,OAAOC,YAAY,CAAEC,UAAW,UAAWC,MAAO,CAAEC,OAAQP,EAAKQ,GAAIC,OAAQT,EAAKU,UAAWC,IAAKX,EAAKY,iBAAkBd,MAAY,MAALA,OAAK,EAALe,EAAOC,eAAkB,uDAtBjK1B,GAAkB2B,uCAMnBC,iCANC5B,EAAkB6B,iFAAlB7B,GAAb,GCNO,MAAM8B,EAAqB,CAChC,CACEC,KAAM,GACNC,kBAAWC,EACXC,YAAa,CAACC,KACdC,SAAU,CACR,CACEL,KAAM,GACNC,UAAWK,OAIjB,CACEN,KAAM,QACNC,UAAWhC,EACXkC,YAAa,CAACC,OAQX,IAAMG,EAAb,MAAM,sDAAOA,4DAHF,CAACC,cAAsBT,IACtBS,QAECD,GAAb,2BCTO,IAAME,EAAb,MAAM,sDAAOA,4DARF,CACPC,KACAC,IACAC,IACAL,EACAM,SAGSJ,GAAb,EAAaA","names":["EmptyHomeComponent","constructor","userService","appStorageService","authService","platformId","this","ngOnInit","getAuthenticationToken","subscribe","token","getUserPersonLoggedIn","user","isPlatformBrowser","window","parent","postMessage","eventName","model","userId","id","compId","idEmpresa","tel","numeroTelCelular","e","access_token","i0","PLATFORM_ID","selectors","homeRoutes","path","component","HomeComponent","canActivate","MenuGuard","children","FormComponent","HomeRoutingModule","RouterModule","HomeModule","CommonModule","CoreModule","SharedModule","L10nTranslationModule"],"sourceRoot":"webpack:///","sources":["./src/app/modules/home/pages/empty-home/empty-home.component.ts","./src/app/modules/home/home-routing.module.ts","./src/app/modules/home/home.module.ts"],"sourcesContent":["import { isPlatformBrowser } from '@angular/common';\r\nimport { Component, Inject, OnInit, PLATFORM_ID } from '@angular/core';\r\nimport { AppStorageService } from 'src/app/core/services/app-storage.service';\r\nimport { AuthService } from 'src/app/core/services/auth.service';\r\nimport { UserService } from 'src/app/core/services/user.service';\r\n\r\n@Component({\r\n selector: 'empty-home',\r\n templateUrl: './empty-home.component.html',\r\n styles: [''] \r\n})\r\n\r\n// Dummy class just to run the login if the user is not logged in\r\n// This is used from Cliniweb before creating an appointment for SURA\r\nexport class EmptyHomeComponent implements OnInit { \r\n\r\n constructor(\r\n private userService: UserService,\r\n private appStorageService: AppStorageService,\r\n private authService : AuthService,\r\n @Inject(PLATFORM_ID) private platformId: Object\r\n ) {}\r\n\r\n ngOnInit(): void {\r\n this.authService.getAuthenticationToken().subscribe(token => {\r\n this.userService.getUserPersonLoggedIn().subscribe(user => { \r\n if(user) {\r\n let model = { \r\n userId: user.id, \r\n token: token?.access_token \r\n };\r\n \r\n // Post message indicating a successfull login. Other events like \"before login\" and \"login error\" will be fired on \"auth-callback-component\"\r\n //this.iframeMessageService.postMessage(\"user_id\", model); \r\n\r\n if(isPlatformBrowser(this.platformId)){\r\n window.parent.postMessage({ eventName: 'user_id', model: { userId: user.id, compId: user.idEmpresa, tel: user.numeroTelCelular, token: token?.access_token } }, '*');\r\n } \r\n }\r\n }); \r\n }); \r\n } \r\n}\r\n","import { NgModule } from '@angular/core';\nimport { RouterModule, Routes } from '@angular/router';\nimport { MenuGuard } from 'src/app/core/guards/menu.guard';\nimport { FormComponent } from 'src/app/shared/components/form/form.component';\nimport { EmptyHomeComponent } from './pages/empty-home/empty-home.component';\nimport { HomeComponent } from './pages/home/home.component';\n\n\nexport const homeRoutes: Routes = [\n {\n path: '',\n component: HomeComponent,\n canActivate: [MenuGuard],\n children: [\n {\n path: '',\n component: FormComponent,\n }\n ]\n },\n {\n path: 'empty',\n component: EmptyHomeComponent,\n canActivate: [MenuGuard]\n }\n];\n\n@NgModule({\n imports: [RouterModule.forChild(homeRoutes)],\n exports: [RouterModule]\n})\nexport class HomeRoutingModule { }\n","import { NgModule } from '@angular/core';\nimport { HomeComponent } from './pages/home/home.component';\nimport { EmptyHomeComponent } from './pages/empty-home/empty-home.component';\nimport { CoreModule } from 'src/app/core/core.module';\nimport { CommonModule } from '@angular/common';\nimport { HomeRoutingModule } from './home-routing.module';\nimport { SharedModule } from 'src/app/shared/shared.module';\nimport { L10nTranslationModule } from 'angular-l10n';\n\n@NgModule({\n declarations: [\n HomeComponent, \n EmptyHomeComponent\n ],\n imports: [\n CommonModule,\n CoreModule,\n SharedModule,\n HomeRoutingModule,\n L10nTranslationModule,\n ]\n})\nexport class HomeModule { }\n"]}