{"ast":null,"code":"import { __decorate } from \"tslib\";\nimport { Component } from '@angular/core';\nimport { UserGroupDirImportComponent } from '../components/user-group-dir-import/user-group-dir-import.component';\nimport { GroupDirImportComponent } from '../components/group-dir-import/group-dir-import.component';\nimport { IsLogedIn } from '../services/authentication.service';\nimport { LoginComponent } from '../login/login.component';\nlet NavMenuComponent = class NavMenuComponent {\n isLogedIn() {\n return IsLogedIn();\n }\n constructor(dialog, authService) {\n this.dialog = dialog;\n this.authService = authService;\n this.isExpanded = false;\n this.authService.isAuthenticated().subscribe();\n }\n get isDarkTheme() {\n return localStorage.getItem('theme') === 'dark';\n }\n collapse() {\n this.isExpanded = false;\n }\n toggle() {\n this.isExpanded = !this.isExpanded;\n }\n importUser() {\n const dialogRef = this.dialog.open(UserGroupDirImportComponent, {\n width: \"50vw\"\n });\n }\n importGroup() {\n const dialogRef = this.dialog.open(GroupDirImportComponent, {\n width: \"50vw\"\n });\n }\n auth() {\n this.authService.isAuthenticated().subscribe({\n next: res => {\n if (res) this.authService.logout().subscribe();else {\n const dialogRef = this.dialog.open(LoginComponent, {\n width: \"35vw\",\n data: {\n afterLogin: () => {\n dialogRef.close();\n }\n }\n });\n }\n },\n error: err => {\n console.error(\"unexpected err happend\", err);\n }\n });\n }\n};\nNavMenuComponent = __decorate([Component({\n selector: 'app-nav-menu',\n templateUrl: './nav-menu.component.html',\n styleUrls: ['./nav-menu.component.css']\n})], NavMenuComponent);\nexport { NavMenuComponent };","map":{"version":3,"names":["Component","UserGroupDirImportComponent","GroupDirImportComponent","IsLogedIn","LoginComponent","NavMenuComponent","isLogedIn","constructor","dialog","authService","isExpanded","isAuthenticated","subscribe","isDarkTheme","localStorage","getItem","collapse","toggle","importUser","dialogRef","open","width","importGroup","auth","next","res","logout","data","afterLogin","close","error","err","console","__decorate","selector","templateUrl","styleUrls"],"sources":["E:\\TekH\\Visual Studio\\WebUserManager\\DigitalData.UserManager.NgWebUI\\ClientApp\\src\\app\\nav-menu\\nav-menu.component.ts"],"sourcesContent":["import { Component } from '@angular/core';\r\nimport { MatDialog } from '@angular/material/dialog';\r\nimport { UserGroupDirImportComponent } from '../components/user-group-dir-import/user-group-dir-import.component';\r\nimport { GroupDirImportComponent } from '../components/group-dir-import/group-dir-import.component';\r\nimport { AuthenticationService, IsLogedIn } from '../services/authentication.service';\r\nimport { LoginComponent } from '../login/login.component';\r\n\r\n@Component({\r\n selector: 'app-nav-menu',\r\n templateUrl: './nav-menu.component.html',\r\n styleUrls: ['./nav-menu.component.css']\r\n})\r\nexport class NavMenuComponent {\r\n isLogedIn() {\r\n return IsLogedIn(); \r\n }\r\n isExpanded = false;\r\n \r\n constructor(public dialog: MatDialog, private authService: AuthenticationService) {\r\n this.authService.isAuthenticated().subscribe();\r\n }\r\n\r\n get isDarkTheme(): boolean {\r\n return localStorage.getItem('theme') === 'dark'\r\n }\r\n\r\n collapse() {\r\n this.isExpanded = false;\r\n }\r\n\r\n toggle() {\r\n this.isExpanded = !this.isExpanded;\r\n }\r\n\r\n importUser() {\r\n const dialogRef = this.dialog.open(UserGroupDirImportComponent, {\r\n width: \"50vw\"\r\n });\r\n }\r\n importGroup() {\r\n const dialogRef = this.dialog.open(GroupDirImportComponent, {\r\n width: \"50vw\"\r\n });\r\n }\r\n\r\n auth() {\r\n this.authService.isAuthenticated().subscribe({\r\n next: (res) => {\r\n if (res)\r\n this.authService.logout().subscribe();\r\n else {\r\n const dialogRef = this.dialog.open(LoginComponent, {\r\n width: \"35vw\",\r\n data: {\r\n afterLogin: () => {\r\n dialogRef.close();\r\n }\r\n }\r\n });\r\n }\r\n },\r\n error: (err) => {\r\n console.error(\"unexpected err happend\", err)\r\n }\r\n })\r\n }\r\n}"],"mappings":";AAAA,SAASA,SAAS,QAAQ,eAAe;AAEzC,SAASC,2BAA2B,QAAQ,qEAAqE;AACjH,SAASC,uBAAuB,QAAQ,2DAA2D;AACnG,SAAgCC,SAAS,QAAQ,oCAAoC;AACrF,SAASC,cAAc,QAAQ,0BAA0B;AAOl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