@cleavelandprice/ngx-lib 3.0.11 → 3.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. package/README.md +5 -5
  2. package/authentication/authentication.module.d.ts +3 -16
  3. package/authentication/model/abstract-authentication-service.d.ts +14 -0
  4. package/authentication/model/service-config.d.ts +1 -0
  5. package/authentication/object/authentication-object.module.d.ts +11 -0
  6. package/authentication/object/index.d.ts +5 -0
  7. package/authentication/object/model/default-config.d.ts +2 -0
  8. package/authentication/object/model/service-config.d.ts +3 -0
  9. package/authentication/object/public_api.d.ts +4 -0
  10. package/authentication/object/services/authentication-object.service.d.ts +23 -0
  11. package/authentication/public_api.d.ts +1 -6
  12. package/authentication/token/authentication-token.module.d.ts +11 -0
  13. package/authentication/token/gui/authentication-token-gui.module.d.ts +20 -0
  14. package/authentication/{components → token/gui/components}/login/login.component.d.ts +3 -3
  15. package/authentication/{components → token/gui/components}/login-form/login-form.component.d.ts +3 -3
  16. package/authentication/token/gui/index.d.ts +5 -0
  17. package/authentication/token/gui/model/default-config.d.ts +2 -0
  18. package/authentication/{model → token/gui/model}/login-form-data.d.ts +0 -0
  19. package/authentication/token/gui/model/service-config.d.ts +3 -0
  20. package/authentication/token/gui/public_api.d.ts +7 -0
  21. package/authentication/token/gui/services/authentication-token-gui.service.d.ts +15 -0
  22. package/authentication/token/index.d.ts +5 -0
  23. package/authentication/{model → token/model}/authentication-token.d.ts +0 -0
  24. package/authentication/token/model/default-config.d.ts +2 -0
  25. package/authentication/token/model/service-config.d.ts +4 -0
  26. package/authentication/token/public_api.d.ts +5 -0
  27. package/authentication/token/services/authentication-token.service.d.ts +22 -0
  28. package/esm2020/active-directory/active-directory.module.mjs +5 -5
  29. package/esm2020/active-directory/services/active-directory.service.mjs +3 -3
  30. package/esm2020/authentication/authentication.module.mjs +10 -68
  31. package/esm2020/authentication/model/abstract-authentication-service.mjs +2 -0
  32. package/esm2020/authentication/model/service-config.mjs +1 -1
  33. package/esm2020/authentication/object/authentication-object.module.mjs +39 -0
  34. package/esm2020/authentication/object/cleavelandprice-ngx-lib-authentication-object.mjs +5 -0
  35. package/esm2020/authentication/object/model/default-config.mjs +5 -0
  36. package/esm2020/authentication/object/model/service-config.mjs +4 -0
  37. package/esm2020/authentication/object/public_api.mjs +5 -0
  38. package/esm2020/authentication/object/services/authentication-object.service.mjs +101 -0
  39. package/esm2020/authentication/public_api.mjs +2 -7
  40. package/esm2020/authentication/token/authentication-token.module.mjs +39 -0
  41. package/esm2020/authentication/token/cleavelandprice-ngx-lib-authentication-token.mjs +5 -0
  42. package/esm2020/authentication/token/gui/authentication-token-gui.module.mjs +77 -0
  43. package/esm2020/authentication/token/gui/cleavelandprice-ngx-lib-authentication-token-gui.mjs +5 -0
  44. package/esm2020/authentication/{components → token/gui/components}/login/login.component.mjs +6 -6
  45. package/esm2020/authentication/{components → token/gui/components}/login-form/login-form.component.mjs +6 -6
  46. package/esm2020/authentication/token/gui/model/default-config.mjs +6 -0
  47. package/esm2020/authentication/token/gui/model/login-form-data.mjs +2 -0
  48. package/esm2020/authentication/token/gui/model/service-config.mjs +4 -0
  49. package/esm2020/authentication/token/gui/public_api.mjs +8 -0
  50. package/esm2020/authentication/token/gui/services/authentication-token-gui.service.mjs +74 -0
  51. package/esm2020/authentication/token/model/authentication-token.mjs +2 -0
  52. package/esm2020/authentication/token/model/default-config.mjs +6 -0
  53. package/esm2020/authentication/token/model/service-config.mjs +4 -0
  54. package/esm2020/authentication/token/public_api.mjs +6 -0
  55. package/esm2020/authentication/token/services/authentication-token.service.mjs +112 -0
  56. package/esm2020/dialog/components/base/base.component.mjs +5 -5
  57. package/esm2020/dialog/components/choice/choice.component.mjs +5 -5
  58. package/esm2020/dialog/components/confirmation/confirmation.component.mjs +5 -5
  59. package/esm2020/dialog/components/input/input.component.mjs +5 -5
  60. package/esm2020/dialog/components/message/message.component.mjs +5 -5
  61. package/esm2020/dialog/dialog.module.mjs +5 -5
  62. package/esm2020/lib/ngx-lib.module.mjs +5 -5
  63. package/esm2020/lib/services/app-path-config.service.mjs +3 -3
  64. package/esm2020/public_api.mjs +2 -1
  65. package/esm2020/sharepoint/services/sharepoint.service.mjs +5 -5
  66. package/esm2020/sharepoint/sharepoint.module.mjs +11 -11
  67. package/esm2020/upload/components/upload/upload.component.mjs +5 -5
  68. package/esm2020/upload/components/upload-dialog/upload-dialog.component.mjs +5 -5
  69. package/esm2020/upload/services/upload.service.mjs +3 -3
  70. package/esm2020/upload/upload.module.mjs +5 -5
  71. package/esm2020/url-utilities/pipes/safe-resource-url.pipe.mjs +4 -4
  72. package/esm2020/url-utilities/pipes/safe-url.pipe.mjs +4 -4
  73. package/esm2020/url-utilities/pipes/uri-scheme.pipe.mjs +4 -4
  74. package/esm2020/url-utilities/url-utilities.module.mjs +5 -5
  75. package/fesm2015/cleavelandprice-ngx-lib-active-directory.mjs +7 -7
  76. package/fesm2015/cleavelandprice-ngx-lib-active-directory.mjs.map +1 -1
  77. package/fesm2015/cleavelandprice-ngx-lib-authentication-object.mjs +151 -0
  78. package/fesm2015/cleavelandprice-ngx-lib-authentication-object.mjs.map +1 -0
  79. package/fesm2015/cleavelandprice-ngx-lib-authentication-token-gui.mjs +251 -0
  80. package/fesm2015/cleavelandprice-ngx-lib-authentication-token-gui.mjs.map +1 -0
  81. package/fesm2015/cleavelandprice-ngx-lib-authentication-token.mjs +163 -0
  82. package/fesm2015/cleavelandprice-ngx-lib-authentication-token.mjs.map +1 -0
  83. package/fesm2015/cleavelandprice-ngx-lib-authentication.mjs +10 -280
  84. package/fesm2015/cleavelandprice-ngx-lib-authentication.mjs.map +1 -1
  85. package/fesm2015/cleavelandprice-ngx-lib-dialog.mjs +24 -24
  86. package/fesm2015/cleavelandprice-ngx-lib-dialog.mjs.map +1 -1
  87. package/fesm2015/cleavelandprice-ngx-lib-sharepoint.mjs +14 -14
  88. package/fesm2015/cleavelandprice-ngx-lib-sharepoint.mjs.map +1 -1
  89. package/fesm2015/cleavelandprice-ngx-lib-upload.mjs +15 -15
  90. package/fesm2015/cleavelandprice-ngx-lib-upload.mjs.map +1 -1
  91. package/fesm2015/cleavelandprice-ngx-lib-url-utilities.mjs +13 -13
  92. package/fesm2015/cleavelandprice-ngx-lib-url-utilities.mjs.map +1 -1
  93. package/fesm2015/cleavelandprice-ngx-lib.mjs +11 -11
  94. package/fesm2015/cleavelandprice-ngx-lib.mjs.map +1 -1
  95. package/fesm2020/cleavelandprice-ngx-lib-active-directory.mjs +7 -7
  96. package/fesm2020/cleavelandprice-ngx-lib-active-directory.mjs.map +1 -1
  97. package/fesm2020/cleavelandprice-ngx-lib-authentication-object.mjs +150 -0
  98. package/fesm2020/cleavelandprice-ngx-lib-authentication-object.mjs.map +1 -0
  99. package/fesm2020/cleavelandprice-ngx-lib-authentication-token-gui.mjs +246 -0
  100. package/fesm2020/cleavelandprice-ngx-lib-authentication-token-gui.mjs.map +1 -0
  101. package/fesm2020/cleavelandprice-ngx-lib-authentication-token.mjs +162 -0
  102. package/fesm2020/cleavelandprice-ngx-lib-authentication-token.mjs.map +1 -0
  103. package/fesm2020/cleavelandprice-ngx-lib-authentication.mjs +10 -275
  104. package/fesm2020/cleavelandprice-ngx-lib-authentication.mjs.map +1 -1
  105. package/fesm2020/cleavelandprice-ngx-lib-dialog.mjs +24 -24
  106. package/fesm2020/cleavelandprice-ngx-lib-dialog.mjs.map +1 -1
  107. package/fesm2020/cleavelandprice-ngx-lib-sharepoint.mjs +14 -14
  108. package/fesm2020/cleavelandprice-ngx-lib-sharepoint.mjs.map +1 -1
  109. package/fesm2020/cleavelandprice-ngx-lib-upload.mjs +15 -15
  110. package/fesm2020/cleavelandprice-ngx-lib-upload.mjs.map +1 -1
  111. package/fesm2020/cleavelandprice-ngx-lib-url-utilities.mjs +13 -13
  112. package/fesm2020/cleavelandprice-ngx-lib-url-utilities.mjs.map +1 -1
  113. package/fesm2020/cleavelandprice-ngx-lib.mjs +11 -11
  114. package/fesm2020/cleavelandprice-ngx-lib.mjs.map +1 -1
  115. package/package.json +28 -3
  116. package/public_api.d.ts +1 -0
  117. package/sharepoint/services/sharepoint.service.d.ts +3 -3
  118. package/sharepoint/sharepoint.module.d.ts +6 -6
  119. package/upload/components/upload/upload.component.d.ts +1 -1
  120. package/upload/components/upload-dialog/upload-dialog.component.d.ts +1 -1
  121. package/authentication/model/default-config.d.ts +0 -2
  122. package/authentication/services/authentication.service.d.ts +0 -25
  123. package/esm2020/authentication/model/authentication-token.mjs +0 -2
  124. package/esm2020/authentication/model/default-config.mjs +0 -4
  125. package/esm2020/authentication/model/login-form-data.mjs +0 -2
  126. package/esm2020/authentication/services/authentication.service.mjs +0 -124
@@ -0,0 +1,163 @@
1
+ import { ServiceConfig as ServiceConfig$1 } from '@cleavelandprice/ngx-lib/authentication';
2
+ import * as i0 from '@angular/core';
3
+ import { EventEmitter, Injectable, Optional, Output, NgModule, SkipSelf } from '@angular/core';
4
+ import { JwtHelperService } from '@auth0/angular-jwt';
5
+ import * as i2 from '@angular/common/http';
6
+ import { CommonModule } from '@angular/common';
7
+
8
+ const defaultConfig = {
9
+ apiUrl: 'http://utilityapi/authenticate/token',
10
+ tokenName: 'token',
11
+ deferTokenValidation: false
12
+ };
13
+
14
+ class ServiceConfig extends ServiceConfig$1 {
15
+ }
16
+
17
+ class AuthenticationTokenService {
18
+ //#endregion
19
+ //#region Lifecycle
20
+ // If a ServiceConfig object is not provided when the module is imported, then default values are pulled in from default-config.ts.
21
+ constructor(config, http) {
22
+ this.config = config;
23
+ this.http = http;
24
+ //#region Fields
25
+ this.authenticatedChanged = new EventEmitter();
26
+ this.authenticatingChanged = new EventEmitter();
27
+ this.authenticationError = new EventEmitter();
28
+ this.authenticating = false; // Flag set to true while the service is attempting to authenticate the user
29
+ this.authenticated = false; // Flag set to true when the user is successfully authenticated
30
+ this.authenticatedUser = null; // Object representing the authenticated user
31
+ this.config = Object.assign(Object.assign({}, defaultConfig), config);
32
+ if (!this.config.deferTokenValidation) {
33
+ this.checkForExistingToken();
34
+ }
35
+ }
36
+ //#endregion
37
+ //#region Utilities
38
+ //Authenticate the user and store the token in Local Storage
39
+ login(username, password, adminGroup) {
40
+ const request = {
41
+ username: username,
42
+ password: password,
43
+ adminGroup: adminGroup
44
+ };
45
+ this.authenticating = true;
46
+ this.authenticatingChanged.emit(this.authenticating);
47
+ // Sending a 'raw' POST request so that we can tell HttpClient that we are expecting text instead of Json
48
+ // Otherwise, it would throw an error trying to decode Json from the response
49
+ this.http.request('POST', this.config.apiUrl, { body: request, responseType: 'text' })
50
+ .subscribe({
51
+ next: (token) => {
52
+ if (token) {
53
+ this.validateUser(token);
54
+ }
55
+ else {
56
+ this.logout();
57
+ }
58
+ },
59
+ error: (err) => {
60
+ this.authenticating = false;
61
+ this.authenticatingChanged.emit(this.authenticating);
62
+ this.authenticationError.emit(err);
63
+ }
64
+ });
65
+ }
66
+ //Logout the user and delete the token from Local Storage
67
+ logout() {
68
+ if (localStorage.getItem(this.config.tokenName)) {
69
+ localStorage.removeItem(this.config.tokenName);
70
+ }
71
+ this.authenticatedUser = null;
72
+ this.authenticated = false;
73
+ this.authenticatedChanged.emit(false);
74
+ }
75
+ validateUser(token) {
76
+ const jwtHelper = new JwtHelperService();
77
+ const decoded = jwtHelper.decodeToken(token);
78
+ if (jwtHelper.isTokenExpired(token)) {
79
+ this.logout();
80
+ return;
81
+ }
82
+ this.authenticatedUser = {
83
+ admin: decoded.role === 'Admin',
84
+ displayName: decoded.displayName,
85
+ accountName: decoded.winaccountname,
86
+ distinguishedName: decoded.distinguishedName,
87
+ employeeNumber: decoded.employeeNumber,
88
+ memberOf: decoded.memberOf
89
+ };
90
+ localStorage.setItem(this.config.tokenName, token);
91
+ this.authenticated = true;
92
+ this.authenticatedChanged.emit(this.authenticated);
93
+ this.authenticating = false;
94
+ this.authenticatingChanged.emit(this.authenticating);
95
+ }
96
+ checkForExistingToken() {
97
+ const token = localStorage.getItem(this.config.tokenName);
98
+ if (token) {
99
+ this.validateUser(token);
100
+ }
101
+ }
102
+ }
103
+ AuthenticationTokenService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: AuthenticationTokenService, deps: [{ token: ServiceConfig, optional: true }, { token: i2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
104
+ AuthenticationTokenService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: AuthenticationTokenService, providedIn: 'root' });
105
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: AuthenticationTokenService, decorators: [{
106
+ type: Injectable,
107
+ args: [{
108
+ providedIn: 'root'
109
+ }]
110
+ }], ctorParameters: function () {
111
+ return [{ type: ServiceConfig, decorators: [{
112
+ type: Optional
113
+ }] }, { type: i2.HttpClient }];
114
+ }, propDecorators: { authenticatedChanged: [{
115
+ type: Output
116
+ }], authenticatingChanged: [{
117
+ type: Output
118
+ }], authenticationError: [{
119
+ type: Output
120
+ }] } });
121
+
122
+ class AuthenticationTokenModule {
123
+ constructor(parentModule) {
124
+ if (parentModule) {
125
+ throw new Error('AuthenticationTokenModule is already loaded. Import it in the AppModule only');
126
+ }
127
+ }
128
+ static forRoot(config) {
129
+ return {
130
+ ngModule: AuthenticationTokenModule,
131
+ providers: [
132
+ AuthenticationTokenService,
133
+ { provide: ServiceConfig, useValue: config }
134
+ ]
135
+ };
136
+ }
137
+ }
138
+ AuthenticationTokenModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: AuthenticationTokenModule, deps: [{ token: AuthenticationTokenModule, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.NgModule });
139
+ AuthenticationTokenModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.1", ngImport: i0, type: AuthenticationTokenModule, imports: [CommonModule] });
140
+ AuthenticationTokenModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: AuthenticationTokenModule, imports: [CommonModule] });
141
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: AuthenticationTokenModule, decorators: [{
142
+ type: NgModule,
143
+ args: [{
144
+ declarations: [],
145
+ imports: [
146
+ CommonModule
147
+ ],
148
+ exports: []
149
+ }]
150
+ }], ctorParameters: function () {
151
+ return [{ type: AuthenticationTokenModule, decorators: [{
152
+ type: Optional
153
+ }, {
154
+ type: SkipSelf
155
+ }] }];
156
+ } });
157
+
158
+ /**
159
+ * Generated bundle index. Do not edit.
160
+ */
161
+
162
+ export { AuthenticationTokenModule, AuthenticationTokenService, ServiceConfig, defaultConfig };
163
+ //# sourceMappingURL=cleavelandprice-ngx-lib-authentication-token.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cleavelandprice-ngx-lib-authentication-token.mjs","sources":["../../../../projects/cleavelandprice/ngx-lib/authentication/token/src/model/default-config.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/token/src/model/service-config.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/token/src/services/authentication-token.service.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/token/src/authentication-token.module.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/token/src/cleavelandprice-ngx-lib-authentication-token.ts"],"sourcesContent":["import { ServiceConfig } from './service-config';\r\n\r\nexport const defaultConfig: ServiceConfig = {\r\n apiUrl: 'http://utilityapi/authenticate/token',\r\n tokenName: 'token',\r\n deferTokenValidation: false\r\n}","import { ServiceConfig as BaseServiceConfig } from '@cleavelandprice/ngx-lib/authentication';\r\n\r\nexport class ServiceConfig extends BaseServiceConfig {\r\n deferTokenValidation!: boolean;\r\n}","import { EventEmitter, Injectable, Optional, Output } from '@angular/core';\r\nimport { HttpClient } from '@angular/common/http';\r\nimport { JwtHelperService } from '@auth0/angular-jwt';\r\n\r\nimport {\r\n AbstractAuthenticationService,\r\n AuthenticatedUser,\r\n AuthenticationRequest\r\n} from '@cleavelandprice/ngx-lib/authentication';\r\n\r\nimport { AuthenticationToken } from '../model/authentication-token';\r\nimport { defaultConfig } from '../model/default-config';\r\nimport { ServiceConfig } from '../model/service-config';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class AuthenticationTokenService implements AbstractAuthenticationService {\r\n //#region Fields\r\n @Output() authenticatedChanged = new EventEmitter<boolean>();\r\n @Output() authenticatingChanged = new EventEmitter<boolean>();\r\n @Output() authenticationError = new EventEmitter();\r\n authenticating = false; // Flag set to true while the service is attempting to authenticate the user\r\n authenticated = false; // Flag set to true when the user is successfully authenticated\r\n authenticatedUser: AuthenticatedUser | null = null; // Object representing the authenticated user\r\n //#endregion\r\n\r\n //#region Lifecycle\r\n // If a ServiceConfig object is not provided when the module is imported, then default values are pulled in from default-config.ts.\r\n constructor(@Optional() protected config: ServiceConfig,\r\n protected http: HttpClient) {\r\n\r\n this.config = {\r\n ...defaultConfig,\r\n ...config\r\n };\r\n\r\n if (!this.config.deferTokenValidation) {\r\n this.checkForExistingToken();\r\n }\r\n }\r\n //#endregion\r\n\r\n //#region Utilities\r\n //Authenticate the user and store the token in Local Storage\r\n login(username: string, password: string, adminGroup?: string): void {\r\n const request: AuthenticationRequest = {\r\n username: username,\r\n password: password,\r\n adminGroup: adminGroup\r\n };\r\n\r\n this.authenticating = true;\r\n this.authenticatingChanged.emit(this.authenticating);\r\n\r\n // Sending a 'raw' POST request so that we can tell HttpClient that we are expecting text instead of Json\r\n // Otherwise, it would throw an error trying to decode Json from the response\r\n this.http.request('POST', this.config.apiUrl, { body: request, responseType: 'text' })\r\n .subscribe({\r\n next: (token) => {\r\n if (token) {\r\n this.validateUser(token);\r\n } else {\r\n this.logout();\r\n }\r\n },\r\n error: (err) => {\r\n this.authenticating = false;\r\n this.authenticatingChanged.emit(this.authenticating);\r\n this.authenticationError.emit(err);\r\n }\r\n });\r\n }\r\n \r\n //Logout the user and delete the token from Local Storage\r\n logout(): void {\r\n if (localStorage.getItem(this.config.tokenName)) {\r\n localStorage.removeItem(this.config.tokenName);\r\n }\r\n\r\n this.authenticatedUser = null;\r\n this.authenticated = false;\r\n this.authenticatedChanged.emit(false);\r\n }\r\n \r\n validateUser(token: string): void {\r\n const jwtHelper = new JwtHelperService();\r\n const decoded = jwtHelper.decodeToken(token) as AuthenticationToken;\r\n\r\n if (jwtHelper.isTokenExpired(token)) {\r\n this.logout();\r\n return;\r\n }\r\n\r\n this.authenticatedUser = {\r\n admin: decoded.role === 'Admin',\r\n displayName: decoded.displayName,\r\n accountName: decoded.winaccountname,\r\n distinguishedName: decoded.distinguishedName,\r\n employeeNumber: decoded.employeeNumber,\r\n memberOf: decoded.memberOf\r\n };\r\n\r\n localStorage.setItem(this.config.tokenName, token);\r\n \r\n this.authenticated = true;\r\n this.authenticatedChanged.emit(this.authenticated);\r\n\r\n this.authenticating = false;\r\n this.authenticatingChanged.emit(this.authenticating);\r\n }\r\n\r\n checkForExistingToken(): void {\r\n const token = localStorage.getItem(this.config.tokenName);\r\n if (token) {\r\n this.validateUser(token);\r\n }\r\n }\r\n //#endregion\r\n}","import { ModuleWithProviders, NgModule, Optional, SkipSelf } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\n\r\nimport { ServiceConfig } from './model/service-config';\r\n\r\nimport { AuthenticationTokenService } from './services/authentication-token.service';\r\n\r\n@NgModule({\r\n declarations: [],\r\n imports: [\r\n CommonModule\r\n ],\r\n exports: []\r\n})\r\nexport class AuthenticationTokenModule {\r\n static forRoot(config: ServiceConfig): ModuleWithProviders<AuthenticationTokenModule> {\r\n return {\r\n ngModule: AuthenticationTokenModule,\r\n providers: [\r\n AuthenticationTokenService,\r\n { provide: ServiceConfig, useValue: config }\r\n ]\r\n };\r\n }\r\n\r\n constructor(@Optional() @SkipSelf() parentModule: AuthenticationTokenModule) {\r\n if (parentModule) {\r\n throw new Error(\r\n 'AuthenticationTokenModule is already loaded. Import it in the AppModule only');\r\n }\r\n }\r\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["BaseServiceConfig","i1.ServiceConfig"],"mappings":";;;;;;;AAEa,MAAA,aAAa,GAAkB;AACxC,IAAA,MAAM,EAAE,sCAAsC;AAC9C,IAAA,SAAS,EAAE,OAAO;AAClB,IAAA,oBAAoB,EAAE,KAAK;;;ACHzB,MAAO,aAAc,SAAQA,eAAiB,CAAA;AAEnD;;MCaY,0BAA0B,CAAA;;;;IAYrC,WAAkC,CAAA,MAAqB,EACjC,IAAgB,EAAA;AADJ,QAAA,IAAM,CAAA,MAAA,GAAN,MAAM,CAAe;AACjC,QAAA,IAAI,CAAA,IAAA,GAAJ,IAAI,CAAY;;AAX5B,QAAA,IAAA,CAAA,oBAAoB,GAAG,IAAI,YAAY,EAAW,CAAC;AACnD,QAAA,IAAA,CAAA,qBAAqB,GAAG,IAAI,YAAY,EAAW,CAAC;AACpD,QAAA,IAAA,CAAA,mBAAmB,GAAG,IAAI,YAAY,EAAE,CAAC;AACnD,QAAA,IAAA,CAAA,cAAc,GAAG,KAAK,CAAC;AACvB,QAAA,IAAA,CAAA,aAAa,GAAG,KAAK,CAAC;AACtB,QAAA,IAAA,CAAA,iBAAiB,GAA6B,IAAI,CAAC;AAQrC,QAAA,IAAI,CAAC,MAAM,GAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EACN,aAAa,CACb,EAAA,MAAM,CACV,CAAC;AAEF,QAAA,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,oBAAoB,EAAE;YACrC,IAAI,CAAC,qBAAqB,EAAE,CAAC;AAC9B,SAAA;KACd;;;;AAKD,IAAA,KAAK,CAAC,QAAgB,EAAE,QAAgB,EAAE,UAAmB,EAAA;AAC3D,QAAA,MAAM,OAAO,GAA0B;AACrC,YAAA,QAAQ,EAAE,QAAQ;AAClB,YAAA,QAAQ,EAAE,QAAQ;AAClB,YAAA,UAAU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YAAY,CAAA,EAAA,CAAA,CAAA;AAIH,yBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,yBAAyB,YAJlC,YAAY,CAAA,EAAA,CAAA,CAAA;2FAIH,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBAPrC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE,EAAE;AAChB,oBAAA,OAAO,EAAE;wBACP,YAAY;AACb,qBAAA;AACD,oBAAA,OAAO,EAAE,EAAE;iBACZ,CAAA;;;8BAYc,QAAQ;;8BAAI,QAAQ;;;;ACzBnC;;AAEG;;;;"}
@@ -1,299 +1,29 @@
1
1
  import * as i0 from '@angular/core';
2
- import { EventEmitter, Injectable, Optional, Output, Component, Inject, Input, NgModule, SkipSelf } from '@angular/core';
3
- import { ConfirmationComponent } from '@cleavelandprice/ngx-lib/dialog';
4
- import * as i4 from '@angular/forms';
5
- import { UntypedFormGroup, UntypedFormControl, Validators, ReactiveFormsModule } from '@angular/forms';
6
- import * as i1 from '@angular/material/dialog';
7
- import { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
8
- import { JwtHelperService } from '@auth0/angular-jwt';
9
- import * as i2 from '@angular/common/http';
10
- import * as i3 from '@cleavelandprice/ngx-lib/sharepoint';
11
- import * as i3$1 from '@angular/common';
2
+ import { NgModule } from '@angular/core';
12
3
  import { CommonModule } from '@angular/common';
13
- import * as i5 from '@angular/material/button';
14
- import { MatButtonModule } from '@angular/material/button';
15
- import * as i6 from '@angular/material/form-field';
16
- import { MatFormFieldModule } from '@angular/material/form-field';
17
- import * as i7 from '@angular/material/icon';
18
- import { MatIconModule } from '@angular/material/icon';
19
- import * as i8 from '@angular/material/input';
20
- import { MatInputModule } from '@angular/material/input';
21
- import * as i9 from '@angular/material/progress-spinner';
22
- import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
23
-
24
- const defaultConfig = {
25
- apiUrl: 'http://utilityapi/authenticate/token'
26
- };
27
4
 
28
5
  class ServiceConfig {
29
6
  }
30
7
 
31
- class AuthenticationService {
32
- //#endregion
33
- //#region Lifecycle
34
- // If a ServiceConfig object is not provided when the module is imported, then default values are pulled in from default-config.ts.
35
- constructor(config, http, sharePointService) {
36
- this.config = config;
37
- this.http = http;
38
- this.sharePointService = sharePointService;
39
- //#region Fields
40
- this.authenticatedChanged = new EventEmitter();
41
- this.authenticatingChanged = new EventEmitter();
42
- this.authenticationError = new EventEmitter();
43
- // Flag set to true while the service is attempting to authenticate the user
44
- this.authenticating = false;
45
- //Flag set to true when the user is successfully authenticated
46
- this.authenticated = false;
47
- this.config = Object.assign(Object.assign({}, defaultConfig), this.config);
48
- this.checkForExistingToken();
49
- }
50
- //#endregion
51
- //#region Utilities
52
- //Authenticate the user and store the token in Local Storage
53
- login(username, password, adminGroup) {
54
- const today = new Date();
55
- //const expiration = new Date().setFullYear(today.getFullYear() + 10);
56
- const request = {
57
- username: username,
58
- password: password,
59
- adminGroup: adminGroup
60
- //expirationDate: expiration // moment().add(10, 'years').toDate()
61
- };
62
- this.authenticating = true;
63
- this.authenticatingChanged.emit(this.authenticating);
64
- // Sending a 'raw' POST request so that we can tell HttpClient that we are expecting text instead of Json
65
- // Otherwise, it would throw an error trying to decode Json from the response
66
- this.http.request('POST', this.config.apiUrl, { body: request, responseType: 'text' })
67
- .subscribe({
68
- next: (token) => this.validateUser(token),
69
- error: (err) => {
70
- //console.log('Authentication error', err);
71
- this.authenticating = false;
72
- this.authenticatingChanged.emit(this.authenticating);
73
- this.authenticationError.emit(err);
74
- }
75
- });
76
- }
77
- //Logout the user and delete the token from Local Storage
78
- logout() {
79
- if (localStorage.getItem('token')) {
80
- localStorage.removeItem('token');
81
- }
82
- this.authenticatedUser = null;
83
- this.authenticated = false;
84
- this.authenticatedChanged.emit(false);
85
- }
86
- validateUser(token) {
87
- if (!token) {
88
- return;
89
- }
90
- const jwtHelper = new JwtHelperService();
91
- const decoded = jwtHelper.decodeToken(token);
92
- if (jwtHelper.isTokenExpired(token)) {
93
- this.logout();
94
- return;
95
- }
96
- this.authenticatedUser = {
97
- admin: decoded.role === 'Admin',
98
- displayName: decoded.displayName,
99
- accountName: decoded.winaccountname,
100
- distinguishedName: decoded.distinguishedName,
101
- employeeNumber: decoded.employeeNumber,
102
- memberOf: decoded.memberOf
103
- };
104
- localStorage.setItem('token', token);
105
- this.getPhoto();
106
- this.authenticated = true;
107
- this.authenticatedChanged.emit(this.authenticated);
108
- this.authenticating = false;
109
- this.authenticatingChanged.emit(this.authenticating);
110
- }
111
- getPhoto() {
112
- this.sharePointService.getPhotos()
113
- .subscribe(photos => {
114
- var _a;
115
- // The user may have been logged out by the time the photos came back
116
- if (!((_a = this.authenticatedUser) === null || _a === void 0 ? void 0 : _a.employeeNumber)) {
117
- return;
118
- }
119
- const photo = photos.find(pic => pic.employeeNumber === +this.authenticatedUser.employeeNumber);
120
- if (photo) {
121
- this.authenticatedUser.photoUrl = photo.encodedAbsUrl;
122
- }
123
- });
124
- }
125
- checkForExistingToken() {
126
- this.validateUser(localStorage.getItem('token'));
127
- }
128
- }
129
- AuthenticationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: AuthenticationService, deps: [{ token: ServiceConfig, optional: true }, { token: i2.HttpClient }, { token: i3.SharepointService }], target: i0.ɵɵFactoryTarget.Injectable });
130
- AuthenticationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: AuthenticationService, providedIn: 'root' });
131
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: AuthenticationService, decorators: [{
132
- type: Injectable,
133
- args: [{
134
- providedIn: 'root'
135
- }]
136
- }], ctorParameters: function () {
137
- return [{ type: ServiceConfig, decorators: [{
138
- type: Optional
139
- }] }, { type: i2.HttpClient }, { type: i3.SharepointService }];
140
- }, propDecorators: { authenticatedChanged: [{
141
- type: Output
142
- }], authenticatingChanged: [{
143
- type: Output
144
- }], authenticationError: [{
145
- type: Output
146
- }] } });
147
-
148
- class LoginFormComponent {
149
- constructor(data, dialogRef, authenticationService) {
150
- var _a;
151
- this.dialogRef = dialogRef;
152
- this.authenticationService = authenticationService;
153
- this.errorMessage = null;
154
- this.form = new UntypedFormGroup({
155
- username: new UntypedFormControl(null, [Validators.required]),
156
- password: new UntypedFormControl(null, [Validators.required]),
157
- adminGroup: new UntypedFormControl()
158
- });
159
- (_a = this.form.get('adminGroup')) === null || _a === void 0 ? void 0 : _a.setValue(data.adminGroup);
160
- }
161
- ngOnInit() {
162
- this.authenticatedChangedSubscription = this.authenticationService.authenticatedChanged
163
- .subscribe(this.authChangedHandler.bind(this));
164
- this.authenticationErrorSubscription = this.authenticationService.authenticationError
165
- .subscribe(this.errorHandler.bind(this));
166
- }
167
- ngOnDestroy() {
168
- this.authenticationErrorSubscription.unsubscribe();
169
- this.authenticatedChangedSubscription.unsubscribe();
170
- }
171
- authenticate() {
172
- this.errorMessage = null;
173
- const { username, password, adminGroup } = this.form.value;
174
- this.authenticationService.login(username, password, adminGroup);
175
- }
176
- authChangedHandler(authenticated) {
177
- if (authenticated) {
178
- this.dialogRef.close();
179
- }
180
- }
181
- errorHandler(err) {
182
- console.log('Authentication error', err);
183
- this.errorMessage = `${err.name}: ${err.statusText}`;
184
- }
185
- }
186
- LoginFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: LoginFormComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: i1.MatDialogRef }, { token: AuthenticationService }], target: i0.ɵɵFactoryTarget.Component });
187
- LoginFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: LoginFormComponent, selector: "authentication-login-form", ngImport: i0, template: "<h2 mat-dialog-title>\r\n <span *ngIf=\"!authenticationService.authenticating\">Login</span>\r\n <span *ngIf=\"authenticationService.authenticating\">Authenticating...</span>\r\n</h2>\r\n\r\n<mat-dialog-content>\r\n <div id=\"spinner\" *ngIf=\"authenticationService.authenticating\">\r\n <mat-progress-spinner color=\"primary\" mode=\"indeterminate\"></mat-progress-spinner>\r\n </div>\r\n\r\n <form *ngIf=\"!authenticationService.authenticating\" [formGroup]=\"form\">\r\n <mat-form-field>\r\n <input matInput formControlName=\"username\" placeholder=\"Username\" (keyup.enter)=\"authenticate()\">\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <input matInput formControlName=\"password\" type=\"password\" placeholder=\"Password\" (keyup.enter)=\"authenticate()\">\r\n </mat-form-field>\r\n </form>\r\n\r\n <div *ngIf=\"!authenticationService.authenticating && errorMessage\" id=\"error\">\r\n {{ errorMessage }}\r\n </div>\r\n</mat-dialog-content>\r\n\r\n<mat-dialog-actions *ngIf=\"!authenticationService.authenticating\">\r\n <button mat-raised-button color=\"primary\" (click)=\"authenticate()\"\r\n [disabled]=\"form.invalid\">\r\n <mat-icon fontIcon=\"done\"></mat-icon>\r\n <span>OK</span>\r\n </button>\r\n\r\n <button mat-raised-button (click)=\"dialogRef.close()\">\r\n <mat-icon fontIcon=\"close\"></mat-icon>\r\n <span>Cancel</span>\r\n </button>\r\n</mat-dialog-actions>", styles: ["#spinner{width:100%;height:100%;display:flex;justify-content:center;align-items:center}form{display:grid;gap:1rem}mat-dialog-actions{display:grid;justify-content:center;grid-template-columns:auto auto;gap:1rem}#error{color:red}\n", ".material-icons{font-family:Material Icons;font-weight:400;font-style:normal;font-size:24px;display:inline-block;line-height:1;text-transform:none;letter-spacing:normal;word-wrap:normal;white-space:nowrap;direction:ltr;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale;font-feature-settings:\"liga\"}\n"], dependencies: [{ kind: "directive", type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i4.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "component", type: i6.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "component", type: i7.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i8.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i9.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "diameter", "strokeWidth", "mode", "value"], exportAs: ["matProgressSpinner"] }] });
188
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: LoginFormComponent, decorators: [{
189
- type: Component,
190
- args: [{ selector: 'authentication-login-form', template: "<h2 mat-dialog-title>\r\n <span *ngIf=\"!authenticationService.authenticating\">Login</span>\r\n <span *ngIf=\"authenticationService.authenticating\">Authenticating...</span>\r\n</h2>\r\n\r\n<mat-dialog-content>\r\n <div id=\"spinner\" *ngIf=\"authenticationService.authenticating\">\r\n <mat-progress-spinner color=\"primary\" mode=\"indeterminate\"></mat-progress-spinner>\r\n </div>\r\n\r\n <form *ngIf=\"!authenticationService.authenticating\" [formGroup]=\"form\">\r\n <mat-form-field>\r\n <input matInput formControlName=\"username\" placeholder=\"Username\" (keyup.enter)=\"authenticate()\">\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <input matInput formControlName=\"password\" type=\"password\" placeholder=\"Password\" (keyup.enter)=\"authenticate()\">\r\n </mat-form-field>\r\n </form>\r\n\r\n <div *ngIf=\"!authenticationService.authenticating && errorMessage\" id=\"error\">\r\n {{ errorMessage }}\r\n </div>\r\n</mat-dialog-content>\r\n\r\n<mat-dialog-actions *ngIf=\"!authenticationService.authenticating\">\r\n <button mat-raised-button color=\"primary\" (click)=\"authenticate()\"\r\n [disabled]=\"form.invalid\">\r\n <mat-icon fontIcon=\"done\"></mat-icon>\r\n <span>OK</span>\r\n </button>\r\n\r\n <button mat-raised-button (click)=\"dialogRef.close()\">\r\n <mat-icon fontIcon=\"close\"></mat-icon>\r\n <span>Cancel</span>\r\n </button>\r\n</mat-dialog-actions>", styles: ["#spinner{width:100%;height:100%;display:flex;justify-content:center;align-items:center}form{display:grid;gap:1rem}mat-dialog-actions{display:grid;justify-content:center;grid-template-columns:auto auto;gap:1rem}#error{color:red}\n", ".material-icons{font-family:Material Icons;font-weight:400;font-style:normal;font-size:24px;display:inline-block;line-height:1;text-transform:none;letter-spacing:normal;word-wrap:normal;white-space:nowrap;direction:ltr;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale;font-feature-settings:\"liga\"}\n"] }]
191
- }], ctorParameters: function () {
192
- return [{ type: undefined, decorators: [{
193
- type: Inject,
194
- args: [MAT_DIALOG_DATA]
195
- }] }, { type: i1.MatDialogRef }, { type: AuthenticationService }];
196
- } });
197
-
198
- class LoginComponent {
199
- constructor(dialog, authenticationService) {
200
- this.dialog = dialog;
201
- this.authenticationService = authenticationService;
202
- }
203
- login() {
204
- this.dialog.open(LoginFormComponent, {
205
- data: { adminGroup: this.adminGroup }
206
- });
207
- }
208
- confirmLogout() {
209
- this.dialog.open(ConfirmationComponent, {
210
- data: { message: `Are you sure you want to logout?` }
211
- })
212
- .afterClosed()
213
- .subscribe(result => {
214
- if (result) {
215
- this.authenticationService.logout();
216
- }
217
- });
218
- }
219
- }
220
- LoginComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: LoginComponent, deps: [{ token: i1.MatDialog }, { token: AuthenticationService }], target: i0.ɵɵFactoryTarget.Component });
221
- LoginComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: LoginComponent, selector: "authentication-login", inputs: { adminGroup: "adminGroup" }, ngImport: i0, template: "<div id=\"user-id\">\r\n <!-- Logged out -->\r\n <mat-icon *ngIf=\"!authenticationService.authenticated\"\r\n fontIcon=\"account_circle\"\r\n matTooltip=\"Login\"\r\n (click)=\"login()\">\r\n </mat-icon>\r\n\r\n <!-- Logged in -->\r\n <ng-container *ngIf=\"authenticationService.authenticated\">\r\n <!-- With photo -->\r\n <img *ngIf=\"authenticationService.authenticatedUser?.photoUrl\"\r\n id=\"authenticated-user-image\"\r\n [src]=\"authenticationService.authenticatedUser?.photoUrl\"\r\n matTooltip=\"Logout\"\r\n (click)=\"confirmLogout()\" />\r\n \r\n <!-- Without photo -->\r\n <mat-icon *ngIf=\"!authenticationService.authenticatedUser?.photoUrl\"\r\n fontIcon=\"account_circle\"\r\n matTooltip=\"Logout\"\r\n (click)=\"confirmLogout()\">\r\n </mat-icon>\r\n \r\n <!-- Name -->\r\n <div id=\"user-name\">\r\n {{ authenticationService.authenticatedUser?.displayName }}\r\n </div>\r\n </ng-container>\r\n</div>", styles: ["#user-id{display:flex;height:2em;padding:.3em;font-family:Verdana,Geneva,Tahoma,sans-serif}mat-icon{font-size:2em!important;height:2em!important;width:2em!important}img{border-radius:100%;width:2em;height:2em}#user-id>div{display:flex;align-items:center;height:100%;margin-left:.75em;font-size:1.15em}\n", ".material-icons{font-family:Material Icons;font-weight:400;font-style:normal;font-size:24px;display:inline-block;line-height:1;text-transform:none;letter-spacing:normal;word-wrap:normal;white-space:nowrap;direction:ltr;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale;font-feature-settings:\"liga\"}\n"], dependencies: [{ kind: "directive", type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i7.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
222
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: LoginComponent, decorators: [{
223
- type: Component,
224
- args: [{ selector: 'authentication-login', template: "<div id=\"user-id\">\r\n <!-- Logged out -->\r\n <mat-icon *ngIf=\"!authenticationService.authenticated\"\r\n fontIcon=\"account_circle\"\r\n matTooltip=\"Login\"\r\n (click)=\"login()\">\r\n </mat-icon>\r\n\r\n <!-- Logged in -->\r\n <ng-container *ngIf=\"authenticationService.authenticated\">\r\n <!-- With photo -->\r\n <img *ngIf=\"authenticationService.authenticatedUser?.photoUrl\"\r\n id=\"authenticated-user-image\"\r\n [src]=\"authenticationService.authenticatedUser?.photoUrl\"\r\n matTooltip=\"Logout\"\r\n (click)=\"confirmLogout()\" />\r\n \r\n <!-- Without photo -->\r\n <mat-icon *ngIf=\"!authenticationService.authenticatedUser?.photoUrl\"\r\n fontIcon=\"account_circle\"\r\n matTooltip=\"Logout\"\r\n (click)=\"confirmLogout()\">\r\n </mat-icon>\r\n \r\n <!-- Name -->\r\n <div id=\"user-name\">\r\n {{ authenticationService.authenticatedUser?.displayName }}\r\n </div>\r\n </ng-container>\r\n</div>", styles: ["#user-id{display:flex;height:2em;padding:.3em;font-family:Verdana,Geneva,Tahoma,sans-serif}mat-icon{font-size:2em!important;height:2em!important;width:2em!important}img{border-radius:100%;width:2em;height:2em}#user-id>div{display:flex;align-items:center;height:100%;margin-left:.75em;font-size:1.15em}\n", ".material-icons{font-family:Material Icons;font-weight:400;font-style:normal;font-size:24px;display:inline-block;line-height:1;text-transform:none;letter-spacing:normal;word-wrap:normal;white-space:nowrap;direction:ltr;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale;font-feature-settings:\"liga\"}\n"] }]
225
- }], ctorParameters: function () { return [{ type: i1.MatDialog }, { type: AuthenticationService }]; }, propDecorators: { adminGroup: [{
226
- type: Input
227
- }] } });
228
-
229
8
  class AuthenticationModule {
230
- constructor(parentModule) {
231
- if (parentModule) {
232
- throw new Error('AuthenticationModule is already loaded. Import it in the AppModule only');
233
- }
234
- }
235
- static forRoot(config) {
236
- return {
237
- ngModule: AuthenticationModule,
238
- providers: [
239
- AuthenticationService,
240
- { provide: ServiceConfig, useValue: config }
241
- ]
242
- };
243
- }
244
9
  }
245
- AuthenticationModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: AuthenticationModule, deps: [{ token: AuthenticationModule, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.NgModule });
246
- AuthenticationModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.0", ngImport: i0, type: AuthenticationModule, declarations: [LoginComponent,
247
- LoginFormComponent], imports: [CommonModule,
248
- ReactiveFormsModule,
249
- MatButtonModule,
250
- MatDialogModule,
251
- MatFormFieldModule,
252
- MatIconModule,
253
- MatInputModule,
254
- MatProgressSpinnerModule], exports: [LoginComponent,
255
- LoginFormComponent] });
256
- AuthenticationModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: AuthenticationModule, imports: [CommonModule,
257
- ReactiveFormsModule,
258
- MatButtonModule,
259
- MatDialogModule,
260
- MatFormFieldModule,
261
- MatIconModule,
262
- MatInputModule,
263
- MatProgressSpinnerModule] });
264
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: AuthenticationModule, decorators: [{
10
+ AuthenticationModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: AuthenticationModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
11
+ AuthenticationModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.1", ngImport: i0, type: AuthenticationModule, imports: [CommonModule] });
12
+ AuthenticationModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: AuthenticationModule, imports: [CommonModule] });
13
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: AuthenticationModule, decorators: [{
265
14
  type: NgModule,
266
15
  args: [{
267
- declarations: [
268
- LoginComponent,
269
- LoginFormComponent
270
- ],
16
+ declarations: [],
271
17
  imports: [
272
- CommonModule,
273
- ReactiveFormsModule,
274
- MatButtonModule,
275
- MatDialogModule,
276
- MatFormFieldModule,
277
- MatIconModule,
278
- MatInputModule,
279
- MatProgressSpinnerModule
18
+ CommonModule
280
19
  ],
281
- exports: [
282
- LoginComponent,
283
- LoginFormComponent
284
- ]
20
+ exports: []
285
21
  }]
286
- }], ctorParameters: function () {
287
- return [{ type: AuthenticationModule, decorators: [{
288
- type: Optional
289
- }, {
290
- type: SkipSelf
291
- }] }];
292
- } });
22
+ }] });
293
23
 
294
24
  /**
295
25
  * Generated bundle index. Do not edit.
296
26
  */
297
27
 
298
- export { AuthenticationModule, AuthenticationService, LoginComponent, LoginFormComponent, ServiceConfig, defaultConfig };
28
+ export { AuthenticationModule, ServiceConfig };
299
29
  //# sourceMappingURL=cleavelandprice-ngx-lib-authentication.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"cleavelandprice-ngx-lib-authentication.mjs","sources":["../../../../projects/cleavelandprice/ngx-lib/authentication/src/model/default-config.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/src/model/service-config.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/src/services/authentication.service.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/src/components/login-form/login-form.component.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/src/components/login-form/login-form.component.html","../../../../projects/cleavelandprice/ngx-lib/authentication/src/components/login/login.component.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/src/components/login/login.component.html","../../../../projects/cleavelandprice/ngx-lib/authentication/src/authentication.module.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/src/cleavelandprice-ngx-lib-authentication.ts"],"sourcesContent":["import { ServiceConfig } from \"./service-config\";\r\n\r\nexport const defaultConfig: ServiceConfig = {\r\n apiUrl: 'http://utilityapi/authenticate/token'\r\n}","export class ServiceConfig {\r\n apiUrl!: string;\r\n}\r\n","import { Injectable, Output, EventEmitter, Optional } from '@angular/core';\r\nimport { HttpClient } from '@angular/common/http';\r\nimport { JwtHelperService } from '@auth0/angular-jwt';\r\nimport { SharepointService } from '@cleavelandprice/ngx-lib/sharepoint';\r\n\r\nimport { defaultConfig } from '../model/default-config';\r\n\r\nimport { AuthenticationToken } from '../model/authentication-token';\r\nimport { AuthenticatedUser } from '../model/authenticated-user';\r\nimport { AuthenticationRequest } from '../model/authentication-request';\r\nimport { ServiceConfig } from '../model/service-config';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class AuthenticationService {\r\n //#region Fields\r\n @Output() authenticatedChanged = new EventEmitter<boolean>();\r\n @Output() authenticatingChanged = new EventEmitter<boolean>();\r\n @Output() authenticationError = new EventEmitter();\r\n \r\n // Flag set to true while the service is attempting to authenticate the user\r\n authenticating = false;\r\n \r\n //Flag set to true when the user is successfully authenticated\r\n authenticated = false;\r\n \r\n // Object representing the authenticated user\r\n authenticatedUser!: AuthenticatedUser | null;\r\n //#endregion\r\n \r\n //#region Lifecycle\r\n // If a ServiceConfig object is not provided when the module is imported, then default values are pulled in from default-config.ts.\r\n constructor(@Optional() private config: ServiceConfig,\r\n private http: HttpClient,\r\n private sharePointService: SharepointService) {\r\n\r\n this.config = {\r\n ...defaultConfig,\r\n ...this.config\r\n };\r\n \r\n this.checkForExistingToken();\r\n }\r\n //#endregion\r\n\r\n //#region Utilities\r\n //Authenticate the user and store the token in Local Storage\r\n login(username: string, password: string, adminGroup?: string): void {\r\n const today = new Date();\r\n //const expiration = new Date().setFullYear(today.getFullYear() + 10);\r\n\r\n const request: AuthenticationRequest = {\r\n username: username,\r\n password: password,\r\n adminGroup: adminGroup\r\n //expirationDate: expiration // moment().add(10, 'years').toDate()\r\n };\r\n\r\n this.authenticating = true;\r\n this.authenticatingChanged.emit(this.authenticating);\r\n\r\n // Sending a 'raw' POST request so that we can tell HttpClient that we are expecting text instead of Json\r\n // Otherwise, it would throw an error trying to decode Json from the response\r\n this.http.request('POST', this.config.apiUrl, { body: request, responseType: 'text' })\r\n .subscribe({\r\n next: (token) =>\r\n this.validateUser(token)\r\n , error: (err) => {\r\n //console.log('Authentication error', err);\r\n this.authenticating = false;\r\n this.authenticatingChanged.emit(this.authenticating);\r\n this.authenticationError.emit(err);\r\n }\r\n });\r\n }\r\n \r\n //Logout the user and delete the token from Local Storage\r\n logout(): void {\r\n if (localStorage.getItem('token')) {\r\n localStorage.removeItem('token');\r\n }\r\n\r\n this.authenticatedUser = null;\r\n this.authenticated = false;\r\n this.authenticatedChanged.emit(false);\r\n }\r\n \r\n private validateUser(token: string | null): void {\r\n if (!token) { return; }\r\n\r\n const jwtHelper = new JwtHelperService();\r\n const decoded = jwtHelper.decodeToken(token) as AuthenticationToken;\r\n\r\n if (jwtHelper.isTokenExpired(token)) {\r\n this.logout();\r\n return;\r\n }\r\n\r\n this.authenticatedUser = {\r\n admin: decoded.role === 'Admin',\r\n displayName: decoded.displayName,\r\n accountName: decoded.winaccountname,\r\n distinguishedName: decoded.distinguishedName,\r\n employeeNumber: decoded.employeeNumber,\r\n memberOf: decoded.memberOf\r\n };\r\n\r\n localStorage.setItem('token', token);\r\n\r\n this.getPhoto();\r\n \r\n this.authenticated = true;\r\n this.authenticatedChanged.emit(this.authenticated);\r\n\r\n this.authenticating = false;\r\n this.authenticatingChanged.emit(this.authenticating);\r\n }\r\n\r\n private getPhoto(): void {\r\n this.sharePointService.getPhotos()\r\n .subscribe(photos => {\r\n // The user may have been logged out by the time the photos came back\r\n if (!this.authenticatedUser?.employeeNumber) {\r\n return;\r\n }\r\n\r\n const photo = photos.find(pic => pic.employeeNumber === +this.authenticatedUser!.employeeNumber);\r\n\r\n if (photo) {\r\n this.authenticatedUser.photoUrl = photo.encodedAbsUrl;\r\n }\r\n });\r\n }\r\n\r\n private checkForExistingToken(): void {\r\n this.validateUser(localStorage.getItem('token'));\r\n }\r\n //#endregion\r\n}\r\n ","import { Component, Inject, OnInit, OnDestroy } from '@angular/core';\r\nimport { UntypedFormGroup, UntypedFormControl, Validators } from '@angular/forms';\r\nimport { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';\r\nimport { Subscription } from 'rxjs';\r\n\r\nimport { LoginFormData } from '../../model/login-form-data';\r\nimport { AuthenticationService } from '../../services/authentication.service';\r\n\r\n@Component({\r\n selector: 'authentication-login-form',\r\n templateUrl: './login-form.component.html',\r\n styleUrls: [\r\n './login-form.component.css',\r\n '../../../../styles/mat-icon.css'\r\n ]\r\n})\r\nexport class LoginFormComponent implements OnInit, OnDestroy {\r\n errorMessage: string | null = null;\r\n authenticatedChangedSubscription!: Subscription;\r\n authenticationErrorSubscription!: Subscription;\r\n\r\n form = new UntypedFormGroup({\r\n username: new UntypedFormControl(null, [ Validators.required ]),\r\n password: new UntypedFormControl(null, [ Validators.required ]),\r\n adminGroup: new UntypedFormControl()\r\n });\r\n\r\n constructor(@Inject(MAT_DIALOG_DATA) data: LoginFormData,\r\n public dialogRef: MatDialogRef<LoginFormComponent>,\r\n public authenticationService: AuthenticationService) {\r\n\r\n this.form.get('adminGroup')?.setValue(data.adminGroup);\r\n }\r\n\r\n ngOnInit(): void {\r\n this.authenticatedChangedSubscription = this.authenticationService.authenticatedChanged\r\n .subscribe(this.authChangedHandler.bind(this));\r\n\r\n this.authenticationErrorSubscription = this.authenticationService.authenticationError\r\n .subscribe(this.errorHandler.bind(this));\r\n }\r\n\r\n ngOnDestroy(): void {\r\n this.authenticationErrorSubscription.unsubscribe();\r\n this.authenticatedChangedSubscription.unsubscribe();\r\n }\r\n\r\n authenticate() {\r\n this.errorMessage = null;\r\n const { username, password, adminGroup } = this.form.value;\r\n this.authenticationService.login(username, password, adminGroup);\r\n }\r\n\r\n private authChangedHandler(authenticated: boolean): void {\r\n if (authenticated) {\r\n this.dialogRef.close();\r\n }\r\n }\r\n\r\n private errorHandler(err: any): void {\r\n console.log('Authentication error', err);\r\n this.errorMessage = `${err.name}: ${err.statusText}`;\r\n }\r\n}\r\n","<h2 mat-dialog-title>\r\n <span *ngIf=\"!authenticationService.authenticating\">Login</span>\r\n <span *ngIf=\"authenticationService.authenticating\">Authenticating...</span>\r\n</h2>\r\n\r\n<mat-dialog-content>\r\n <div id=\"spinner\" *ngIf=\"authenticationService.authenticating\">\r\n <mat-progress-spinner color=\"primary\" mode=\"indeterminate\"></mat-progress-spinner>\r\n </div>\r\n\r\n <form *ngIf=\"!authenticationService.authenticating\" [formGroup]=\"form\">\r\n <mat-form-field>\r\n <input matInput formControlName=\"username\" placeholder=\"Username\" (keyup.enter)=\"authenticate()\">\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <input matInput formControlName=\"password\" type=\"password\" placeholder=\"Password\" (keyup.enter)=\"authenticate()\">\r\n </mat-form-field>\r\n </form>\r\n\r\n <div *ngIf=\"!authenticationService.authenticating && errorMessage\" id=\"error\">\r\n {{ errorMessage }}\r\n </div>\r\n</mat-dialog-content>\r\n\r\n<mat-dialog-actions *ngIf=\"!authenticationService.authenticating\">\r\n <button mat-raised-button color=\"primary\" (click)=\"authenticate()\"\r\n [disabled]=\"form.invalid\">\r\n <mat-icon fontIcon=\"done\"></mat-icon>\r\n <span>OK</span>\r\n </button>\r\n\r\n <button mat-raised-button (click)=\"dialogRef.close()\">\r\n <mat-icon fontIcon=\"close\"></mat-icon>\r\n <span>Cancel</span>\r\n </button>\r\n</mat-dialog-actions>","import { Component, Input } from '@angular/core';\r\nimport { MatDialog } from '@angular/material/dialog';\r\nimport { ConfirmationComponent } from '@cleavelandprice/ngx-lib/dialog';\r\n\r\nimport { LoginFormComponent } from '../login-form/login-form.component';\r\nimport { AuthenticationService } from '../../services/authentication.service';\r\n\r\n@Component({\r\n selector: 'authentication-login',\r\n templateUrl: './login.component.html',\r\n styleUrls: [\r\n './login.component.css',\r\n '../../../../styles/mat-icon.css'\r\n ]\r\n})\r\nexport class LoginComponent {\r\n @Input() adminGroup!: string;\r\n\r\n constructor(private dialog: MatDialog,\r\n public authenticationService: AuthenticationService) {\r\n }\r\n\r\n login(): void {\r\n this.dialog.open(LoginFormComponent, {\r\n data: { adminGroup: this.adminGroup }\r\n });\r\n }\r\n\r\n confirmLogout(): void {\r\n this.dialog.open(ConfirmationComponent, {\r\n data: { message: `Are you sure you want to logout?` }\r\n })\r\n .afterClosed()\r\n .subscribe(result => {\r\n if (result) {\r\n this.authenticationService.logout();\r\n }\r\n });\r\n }\r\n}\r\n","<div id=\"user-id\">\r\n <!-- Logged out -->\r\n <mat-icon *ngIf=\"!authenticationService.authenticated\"\r\n fontIcon=\"account_circle\"\r\n matTooltip=\"Login\"\r\n (click)=\"login()\">\r\n </mat-icon>\r\n\r\n <!-- Logged in -->\r\n <ng-container *ngIf=\"authenticationService.authenticated\">\r\n <!-- With photo -->\r\n <img *ngIf=\"authenticationService.authenticatedUser?.photoUrl\"\r\n id=\"authenticated-user-image\"\r\n [src]=\"authenticationService.authenticatedUser?.photoUrl\"\r\n matTooltip=\"Logout\"\r\n (click)=\"confirmLogout()\" />\r\n \r\n <!-- Without photo -->\r\n <mat-icon *ngIf=\"!authenticationService.authenticatedUser?.photoUrl\"\r\n fontIcon=\"account_circle\"\r\n matTooltip=\"Logout\"\r\n (click)=\"confirmLogout()\">\r\n </mat-icon>\r\n \r\n <!-- Name -->\r\n <div id=\"user-name\">\r\n {{ authenticationService.authenticatedUser?.displayName }}\r\n </div>\r\n </ng-container>\r\n</div>","import { ModuleWithProviders, NgModule, Optional, SkipSelf } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { ReactiveFormsModule } from '@angular/forms';\r\n\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatDialogModule } from '@angular/material/dialog';\r\nimport { MatFormFieldModule } from '@angular/material/form-field';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatInputModule } from '@angular/material/input';\r\nimport { MatProgressSpinnerModule } from '@angular/material/progress-spinner';\r\n\r\nimport { ServiceConfig } from './model/service-config';\r\n\r\nimport { AuthenticationService } from './services/authentication.service';\r\n\r\nimport { LoginComponent } from './components/login/login.component';\r\nimport { LoginFormComponent } from './components/login-form/login-form.component';\r\n\r\n@NgModule({\r\n declarations: [\r\n LoginComponent,\r\n LoginFormComponent\r\n ],\r\n imports: [\r\n CommonModule,\r\n ReactiveFormsModule,\r\n \r\n MatButtonModule,\r\n MatDialogModule,\r\n MatFormFieldModule,\r\n MatIconModule,\r\n MatInputModule,\r\n MatProgressSpinnerModule\r\n ],\r\n exports: [\r\n LoginComponent,\r\n LoginFormComponent\r\n ]\r\n})\r\nexport class AuthenticationModule {\r\n static forRoot(config: ServiceConfig): ModuleWithProviders<AuthenticationModule> {\r\n return {\r\n ngModule: AuthenticationModule,\r\n providers: [\r\n AuthenticationService,\r\n { provide: ServiceConfig, useValue: config }\r\n ]\r\n };\r\n }\r\n\r\n constructor( @Optional() @SkipSelf() parentModule: AuthenticationModule) {\r\n if (parentModule) {\r\n throw new Error(\r\n 'AuthenticationModule is already loaded. Import it in the AppModule only');\r\n }\r\n }\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i1.ServiceConfig","i2.AuthenticationService","i3","i4"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAEa,MAAA,aAAa,GAAkB;AACxC,IAAA,MAAM,EAAE,sCAAsC;;;MCHrC,aAAa,CAAA;AAEzB;;MCaY,qBAAqB,CAAA;;;;AAkBhC,IAAA,WAAA,CAAgC,MAAqB,EACjC,IAAgB,EAChB,iBAAoC,EAAA;AAFxB,QAAA,IAAM,CAAA,MAAA,GAAN,MAAM,CAAe;AACjC,QAAA,IAAI,CAAA,IAAA,GAAJ,IAAI,CAAY;AAChB,QAAA,IAAiB,CAAA,iBAAA,GAAjB,iBAAiB,CAAmB;;AAlB9C,QAAA,IAAA,CAAA,oBAAoB,GAAG,IAAI,YAAY,EAAW,CAAC;AACnD,QAAA,IAAA,CAAA,qBAAqB,GAAG,IAAI,YAAY,EAAW,CAAC;AACpD,QAAA,IAAA,CAAA,mBAAmB,GAAG,IAAI,YAAY,EAAE,CAAC;;AAGnD,QAAA,IAAc,CAAA,cAAA,GAAG,KAAK,CAAC;;AAGvB,QAAA,IAAa,CAAA,aAAA,GAAG,KAAK,CAAC;QAYR,IAAI,CAAC,MAAM,GACN,MAAA,CAAA,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"}
1
+ {"version":3,"file":"cleavelandprice-ngx-lib-authentication.mjs","sources":["../../../../projects/cleavelandprice/ngx-lib/authentication/src/model/service-config.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/src/authentication.module.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/src/cleavelandprice-ngx-lib-authentication.ts"],"sourcesContent":["export class ServiceConfig {\r\n apiUrl!: string;\r\n tokenName!: string; // The name used as the Key of the item saved in the browser's LocalStorage\r\n}","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\n\r\n@NgModule({\r\n declarations: [],\r\n imports: [\r\n CommonModule\r\n ],\r\n exports: []\r\n})\r\nexport class AuthenticationModule {}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;MAAa,aAAa,CAAA;AAGzB;;MCOY,oBAAoB,CAAA;;iHAApB,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAApB,oBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,oBAAoB,YAJ7B,YAAY,CAAA,EAAA,CAAA,CAAA;AAIH,oBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,oBAAoB,YAJ7B,YAAY,CAAA,EAAA,CAAA,CAAA;2FAIH,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAPhC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE,EAAE;AAChB,oBAAA,OAAO,EAAE;wBACP,YAAY;AACb,qBAAA;AACD,oBAAA,OAAO,EAAE,EAAE;iBACZ,CAAA;;;ACTD;;AAEG;;;;"}