@dbg-riskit/angular-login 9999.9999.9999-rc.41311 → 9999.9999.9999-rc.436399

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.
@@ -0,0 +1,96 @@
1
+ import { ChangeDetectionStrategy, Component, Inject } from '@angular/core';
2
+ import { AUTH_PROVIDER, SECONDARY_LOGO } from '@dbg-riskit/angular-common';
3
+ import { toErrorMessage } from '@dbg-riskit/angular-error';
4
+ import { BaseComponent } from '@dbg-riskit/angular-view';
5
+ import { first, takeUntil } from 'rxjs/operators';
6
+ import * as i0 from "@angular/core";
7
+ import * as i1 from "@dbg-riskit/angular-auth";
8
+ import * as i2 from "@angular/common";
9
+ import * as i3 from "@angular/forms";
10
+ import * as i4 from "@dbg-riskit/angular-view";
11
+ import * as i5 from "@angular/material/button";
12
+ import * as i6 from "@angular/material/card";
13
+ import * as i7 from "@angular/material/form-field";
14
+ import * as i8 from "@angular/material/icon";
15
+ import * as i9 from "@angular/material/input";
16
+ import * as i10 from "@angular/material/progress-spinner";
17
+ export class LoginComponent extends BaseComponent {
18
+ authProvider;
19
+ changeDetectorRef;
20
+ authRoutingFlowService;
21
+ secondaryLogo;
22
+ /**
23
+ * Error message to be displayed.
24
+ */
25
+ errorMessage;
26
+ /**
27
+ * User name binding.
28
+ */
29
+ username;
30
+ /**
31
+ * Password binding.
32
+ */
33
+ password;
34
+ /**
35
+ * Control for "login button-to-spinner".
36
+ */
37
+ loggingIn = false;
38
+ constructor(authProvider, changeDetectorRef, authRoutingFlowService, secondaryLogo) {
39
+ super();
40
+ this.authProvider = authProvider;
41
+ this.changeDetectorRef = changeDetectorRef;
42
+ this.authRoutingFlowService = authRoutingFlowService;
43
+ this.secondaryLogo = secondaryLogo;
44
+ // Update component state on login status change
45
+ this.authProvider.loggedInStream.pipe(takeUntil(this.destroyed)).subscribe(() => this.changeDetectorRef.markForCheck());
46
+ }
47
+ ngAfterViewInit() {
48
+ this.authRoutingFlowService.loginViaService().pipe(takeUntil(this.destroyed)).subscribe(() => {
49
+ this.changeDetectorRef.markForCheck();
50
+ }, (err) => {
51
+ this.errorMessage = toErrorMessage(err).message;
52
+ this.changeDetectorRef.markForCheck();
53
+ });
54
+ }
55
+ get isDirectFlow() {
56
+ return this.authRoutingFlowService.directFlow;
57
+ }
58
+ get authStatus() {
59
+ return this.authProvider.loggedIn;
60
+ }
61
+ get userProfile() {
62
+ return this.authProvider.userProfile;
63
+ }
64
+ login() {
65
+ this.loggingIn = true;
66
+ this.authRoutingFlowService.login(this.username, this.password).pipe(first()).subscribe((res) => {
67
+ if (!res) {
68
+ this.errorMessage = 'Authentication failed. Server did not generate a token.';
69
+ }
70
+ this.loggingIn = false;
71
+ this.changeDetectorRef.markForCheck();
72
+ }, () => {
73
+ this.loggingIn = false;
74
+ this.errorMessage = 'Authentication failed. Is the username and password correct?';
75
+ this.changeDetectorRef.markForCheck();
76
+ });
77
+ }
78
+ get logo() {
79
+ return this.secondaryLogo;
80
+ }
81
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LoginComponent, deps: [{ token: AUTH_PROVIDER }, { token: i0.ChangeDetectorRef }, { token: i1.AuthRoutingFlowService }, { token: SECONDARY_LOGO }], target: i0.ɵɵFactoryTarget.Component });
82
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: LoginComponent, selector: "ng-component", host: { properties: { "class.risk-login-form": "true" } }, usesInheritance: true, ngImport: i0, template: "<risk-flex>\n <risk-flex-spacer></risk-flex-spacer>\n\n <div *ngIf=\"isDirectFlow\">\n <ng-template #loggedOut>\n <risk-error *ngIf=\"errorMessage\" [message]=\"errorMessage\"></risk-error>\n\n <form (ngSubmit)=\"login()\" role=\"form\">\n <mat-card>\n <mat-card-title-group>\n <mat-card-title>Please Sign In</mat-card-title>\n </mat-card-title-group>\n <mat-card-content>\n <mat-form-field class=\"risk-full-width\">\n <input matInput\n type=\"text\"\n placeholder=\"Username\"\n name=\"username\"\n [(ngModel)]=\"username\"\n autofocus>\n </mat-form-field>\n <mat-form-field class=\"risk-full-width\">\n <input matInput\n type=\"password\"\n placeholder=\"Password\"\n name=\"password\"\n [(ngModel)]=\"password\">\n </mat-form-field>\n </mat-card-content>\n <mat-card-actions>\n <button *ngIf=\"!loggingIn\"\n mat-raised-button\n color=\"primary\"\n type=\"submit\">\n Sign in\n </button>\n <img [src]=\"logo\" alt=\"Company logo\">\n <mat-spinner *ngIf=\"loggingIn\" [diameter]=\"36\"></mat-spinner>\n </mat-card-actions>\n </mat-card>\n </form>\n </ng-template>\n\n <ng-template [ngIf]=\"authStatus | async\" [ngIfElse]=\"loggedOut\">\n <ng-template [ngIf]=\"userProfile | async\" let-user=\"ngIf\">\n <risk-good *ngIf=\"user?.name\"\n [message]=\"'Successfully logged in as ' + user.name + '.'\"></risk-good>\n <risk-good *ngIf=\"!user && !user.name\"\n [message]=\"'Successfully logged in!'\"></risk-good>\n </ng-template>\n </ng-template>\n </div>\n\n <div *ngIf=\"!isDirectFlow\">\n <ng-template [ngIf]=\"!errorMessage\">\n <div class=\"risk-login-form-flex-wrapper\">\n <div></div>\n <mat-spinner></mat-spinner>\n <div></div>\n </div>\n <h3>Contacting authentication server...</h3>\n </ng-template>\n <ng-template [ngIf]=\"errorMessage\">\n <div class=\"risk-login-form-flex-wrapper\">\n <div></div>\n <mat-icon class=\"risk-login-form-error\" color=\"warn\">error_outline</mat-icon>\n <div></div>\n </div>\n <h3>Failed to authenticate user: {{errorMessage}}</h3>\n <div class=\"risk-login-form-flex-wrapper\">\n <div></div>\n <button mat-button\n (click)=\"login()\"\n color=\"primary\"\n type=\"button\">\n <mat-icon>autorenew</mat-icon>\n Retry\n </button>\n <div></div>\n </div>\n </ng-template>\n </div>\n\n <risk-flex-spacer></risk-flex-spacer>\n</risk-flex>\n", styles: [":host{display:block;padding:0;margin:0}:host>*{vertical-align:bottom}\n", ".risk-flex>div{width:400px;max-width:97vw;max-height:70vh;margin-top:40px}.mat-mdc-card-title-group{margin:0}.mat-mdc-card-title-group .mat-mdc-card-title{font-weight:500}.mat-mdc-card-actions{margin:0;margin-bottom:-8px!important;padding:0}.mat-mdc-card-actions img{float:right;margin:3px 0;height:30px}.risk-login-form-flex-wrapper{display:-webkit-flex;display:flex}.risk-login-form-flex-wrapper>div{-webkit-flex:1;flex:1}.risk-login-form-error{font-size:100px;height:100px;width:100px}h3{text-align:center}input:-webkit-autofill{-webkit-box-shadow:0 0 0 1000px white inset}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.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: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i3.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: i4.MessageComponent, selector: "risk-error, risk-good, risk-info, risk-message, risk-warn, risk-initial-load, risk-no-data, risk-update-failed", inputs: ["message"] }, { kind: "component", type: i5.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i6.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i6.MatCardActions, selector: "mat-card-actions", inputs: ["align"], exportAs: ["matCardActions"] }, { kind: "directive", type: i6.MatCardContent, selector: "mat-card-content" }, { kind: "directive", type: i6.MatCardTitle, selector: "mat-card-title, [mat-card-title], [matCardTitle]" }, { kind: "component", type: i6.MatCardTitleGroup, selector: "mat-card-title-group" }, { kind: "component", type: i7.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "component", type: i8.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i9.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: i4.FlexComponent, selector: "risk-flex", inputs: ["wrapContent"] }, { kind: "component", type: i4.FlexSpacerComponent, selector: "risk-flex-spacer" }, { kind: "component", type: i10.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
83
+ }
84
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LoginComponent, decorators: [{
85
+ type: Component,
86
+ args: [{ host: {
87
+ '[class.risk-login-form]': 'true'
88
+ }, changeDetection: ChangeDetectionStrategy.OnPush, preserveWhitespaces: false, template: "<risk-flex>\n <risk-flex-spacer></risk-flex-spacer>\n\n <div *ngIf=\"isDirectFlow\">\n <ng-template #loggedOut>\n <risk-error *ngIf=\"errorMessage\" [message]=\"errorMessage\"></risk-error>\n\n <form (ngSubmit)=\"login()\" role=\"form\">\n <mat-card>\n <mat-card-title-group>\n <mat-card-title>Please Sign In</mat-card-title>\n </mat-card-title-group>\n <mat-card-content>\n <mat-form-field class=\"risk-full-width\">\n <input matInput\n type=\"text\"\n placeholder=\"Username\"\n name=\"username\"\n [(ngModel)]=\"username\"\n autofocus>\n </mat-form-field>\n <mat-form-field class=\"risk-full-width\">\n <input matInput\n type=\"password\"\n placeholder=\"Password\"\n name=\"password\"\n [(ngModel)]=\"password\">\n </mat-form-field>\n </mat-card-content>\n <mat-card-actions>\n <button *ngIf=\"!loggingIn\"\n mat-raised-button\n color=\"primary\"\n type=\"submit\">\n Sign in\n </button>\n <img [src]=\"logo\" alt=\"Company logo\">\n <mat-spinner *ngIf=\"loggingIn\" [diameter]=\"36\"></mat-spinner>\n </mat-card-actions>\n </mat-card>\n </form>\n </ng-template>\n\n <ng-template [ngIf]=\"authStatus | async\" [ngIfElse]=\"loggedOut\">\n <ng-template [ngIf]=\"userProfile | async\" let-user=\"ngIf\">\n <risk-good *ngIf=\"user?.name\"\n [message]=\"'Successfully logged in as ' + user.name + '.'\"></risk-good>\n <risk-good *ngIf=\"!user && !user.name\"\n [message]=\"'Successfully logged in!'\"></risk-good>\n </ng-template>\n </ng-template>\n </div>\n\n <div *ngIf=\"!isDirectFlow\">\n <ng-template [ngIf]=\"!errorMessage\">\n <div class=\"risk-login-form-flex-wrapper\">\n <div></div>\n <mat-spinner></mat-spinner>\n <div></div>\n </div>\n <h3>Contacting authentication server...</h3>\n </ng-template>\n <ng-template [ngIf]=\"errorMessage\">\n <div class=\"risk-login-form-flex-wrapper\">\n <div></div>\n <mat-icon class=\"risk-login-form-error\" color=\"warn\">error_outline</mat-icon>\n <div></div>\n </div>\n <h3>Failed to authenticate user: {{errorMessage}}</h3>\n <div class=\"risk-login-form-flex-wrapper\">\n <div></div>\n <button mat-button\n (click)=\"login()\"\n color=\"primary\"\n type=\"button\">\n <mat-icon>autorenew</mat-icon>\n Retry\n </button>\n <div></div>\n </div>\n </ng-template>\n </div>\n\n <risk-flex-spacer></risk-flex-spacer>\n</risk-flex>\n", styles: [":host{display:block;padding:0;margin:0}:host>*{vertical-align:bottom}\n", ".risk-flex>div{width:400px;max-width:97vw;max-height:70vh;margin-top:40px}.mat-mdc-card-title-group{margin:0}.mat-mdc-card-title-group .mat-mdc-card-title{font-weight:500}.mat-mdc-card-actions{margin:0;margin-bottom:-8px!important;padding:0}.mat-mdc-card-actions img{float:right;margin:3px 0;height:30px}.risk-login-form-flex-wrapper{display:-webkit-flex;display:flex}.risk-login-form-flex-wrapper>div{-webkit-flex:1;flex:1}.risk-login-form-error{font-size:100px;height:100px;width:100px}h3{text-align:center}input:-webkit-autofill{-webkit-box-shadow:0 0 0 1000px white inset}\n"] }]
89
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
90
+ type: Inject,
91
+ args: [AUTH_PROVIDER]
92
+ }] }, { type: i0.ChangeDetectorRef }, { type: i1.AuthRoutingFlowService }, { type: undefined, decorators: [{
93
+ type: Inject,
94
+ args: [SECONDARY_LOGO]
95
+ }] }]; } });
96
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9naW4uY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcGtnL2RiZy1yaXNraXQvYW5ndWxhci1sb2dpbi9zcmMvbGliL2xvZ2luLmNvbXBvbmVudC50cyIsIi4uLy4uLy4uLy4uLy4uL3BrZy9kYmctcmlza2l0L2FuZ3VsYXItbG9naW4vc3JjL2xpYi9sb2dpbi5jb21wb25lbnQuaHRtbCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQWdCLHVCQUF1QixFQUFxQixTQUFTLEVBQUUsTUFBTSxFQUFDLE1BQU0sZUFBZSxDQUFDO0FBRzNHLE9BQU8sRUFBQyxhQUFhLEVBQUUsY0F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XNzd29yZCkucGlwZShcbiAgICAgICAgICAgIGZpcnN0KClcbiAgICAgICAgKS5zdWJzY3JpYmUoXG4gICAgICAgICAgICAocmVzOiBib29sZWFuKSA9PiB7XG4gICAgICAgICAgICAgICAgaWYgKCFyZXMpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5lcnJvck1lc3NhZ2UgPSAnQXV0aGVudGljYXRpb24gZmFpbGVkLiBTZXJ2ZXIgZGlkIG5vdCBnZW5lcmF0ZSBhIHRva2VuLic7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHRoaXMubG9nZ2luZ0luID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgdGhpcy5jaGFuZ2VEZXRlY3RvclJlZi5tYXJrRm9yQ2hlY2soKTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAoKSA9PiB7XG4gICAgICAgICAgICAgICAgdGhpcy5sb2dnaW5nSW4gPSBmYWxzZTtcbiAgICAgICAgICAgICAgICB0aGlzLmVycm9yTWVzc2FnZSA9ICdBdXRoZW50aWNhdGlvbiBmYWlsZWQuIElzIHRoZSB1c2VybmFtZSBhbmQgcGFzc3dvcmQgY29ycmVjdD8nO1xuICAgICAgICAgICAgICAgIHRoaXMuY2hhbmdlRGV0ZWN0b3JSZWYubWFya0ZvckNoZWNrKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICk7XG4gICAgfVxuXG4gICAgcHVibGljIGdldCBsb2dvKCk6IHN0cmluZyB7XG4gICAgICAgIHJldHVybiB0aGlzLnNlY29uZGFyeUxvZ287XG4gICAgfVxufVxuIiwiPHJpc2stZmxleD5cbiAgICA8cmlzay1mbGV4LXNwYWNlcj48L3Jpc2stZmxleC1zcGFjZXI+XG5cbiAgICA8ZGl2ICpuZ0lmPVwiaXNEaXJlY3RGbG93XCI+XG4gICAgICAgIDxuZy10ZW1wbGF0ZSAjbG9nZ2VkT3V0PlxuICAgICAgICAgICAgPHJpc2stZXJyb3IgKm5nSWY9XCJlcnJvck1lc3NhZ2VcIiBbbWVzc2FnZV09XCJlcnJvck1lc3NhZ2VcIj48L3Jpc2stZXJyb3I+XG5cbiAgICAgICAgICAgIDxmb3JtIChuZ1N1Ym1pdCk9XCJsb2dpbigpXCIgcm9sZT1cImZvcm1cIj5cbiAgICAgICAgICAgICAgICA8bWF0LWNhcmQ+XG4gICAgICAgICAgICAgICAgICAgIDxtYXQtY2FyZC10aXRsZS1ncm91cD5cbiAgICAgICAgICAgICAgICAgICAgICAgIDxtYXQtY2FyZC10aXRsZT5QbGVhc2UgU2lnbiBJbjwvbWF0LWNhcmQtdGl0bGU+XG4gICAgICAgICAgICAgICAgICAgIDwvbWF0LWNhcmQtdGl0bGUtZ3JvdXA+XG4gICAgICAgICAgICAgICAgICAgIDxtYXQtY2FyZC1jb250ZW50PlxuICAgICAgICAgICAgICAgICAgICAgICAgPG1hdC1mb3JtLWZpZWxkIGNsYXNzPVwicmlzay1mdWxsLXdpZHRoXCI+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPGlucHV0IG1hdElucHV0XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU9XCJ0ZXh0XCJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGxhY2Vob2xkZXI9XCJVc2VybmFtZVwiXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWU9XCJ1c2VybmFtZVwiXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsobmdNb2RlbCldPVwidXNlcm5hbWVcIlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdXRvZm9jdXM+XG4gICAgICAgICAgICAgICAgICAgICAgICA8L21hdC1mb3JtLWZpZWxkPlxuICAgICAgICAgICAgICAgICAgICAgICAgPG1hdC1mb3JtLWZpZWxkIGNsYXNzPVwicmlzay1mdWxsLXdpZHRoXCI+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPGlucHV0IG1hdElucHV0XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU9XCJwYXNzd29yZFwiXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBsYWNlaG9sZGVyPVwiUGFzc3dvcmRcIlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lPVwicGFzc3dvcmRcIlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBbKG5nTW9kZWwpXT1cInBhc3N3b3JkXCI+XG4gICAgICAgICAgICAgICAgICAgICAgICA8L21hdC1mb3JtLWZpZWxkPlxuICAgICAgICAgICAgICAgICAgICA8L21hdC1jYXJkLWNvbnRlbnQ+XG4gICAgICAgICAgICAgICAgICAgIDxtYXQtY2FyZC1hY3Rpb25zPlxuICAgICAgICAgICAgICAgICAgICAgICAgPGJ1dHRvbiAqbmdJZj1cIiFsb2dnaW5nSW5cIlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYXQtcmFpc2VkLWJ1dHRvblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xvcj1cInByaW1hcnlcIlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlPVwic3VibWl0XCI+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgU2lnbiBpblxuICAgICAgICAgICAgICAgICAgICAgICAgPC9idXR0b24+XG4gICAgICAgICAgICAgICAgICAgICAgICA8aW1nIFtzcmNdPVwibG9nb1wiIGFsdD1cIkNvbXBhbnkgbG9nb1wiPlxuICAgICAgICAgICAgICAgICAgICAgICAgPG1hdC1zcGlubmVyICpuZ0lmPVwibG9nZ2luZ0luXCIgW2RpYW1ldGVyXT1cIjM2XCI+PC9tYXQtc3Bpbm5lcj5cbiAgICAgICAgICAgICAgICAgICAgPC9tYXQtY2FyZC1hY3Rpb25zPlxuICAgICAgICAgICAgICAgIDwvbWF0LWNhcmQ+XG4gICAgICAgICAgICA8L2Zvcm0+XG4gICAg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F0aW9uIHNlcnZlci4uLjwvaDM+XG4gICAgICAgIDwvbmctdGVtcGxhdGU+XG4gICAgICAgIDxuZy10ZW1wbGF0ZSBbbmdJZl09XCJlcnJvck1lc3NhZ2VcIj5cbiAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJyaXNrLWxvZ2luLWZvcm0tZmxleC13cmFwcGVyXCI+XG4gICAgICAgICAgICAgICAgPGRpdj48L2Rpdj5cbiAgICAgICAgICAgICAgICA8bWF0LWljb24gY2xhc3M9XCJyaXNrLWxvZ2luLWZvcm0tZXJyb3JcIiBjb2xvcj1cIndhcm5cIj5lcnJvcl9vdXRsaW5lPC9tYXQtaWNvbj5cbiAgICAgICAgICAgICAgICA8ZGl2PjwvZGl2PlxuICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgICA8aDM+RmFpbGVkIHRvIGF1dGhlbnRpY2F0ZSB1c2VyOiB7e2Vycm9yTWVzc2FnZX19PC9oMz5cbiAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJyaXNrLWxvZ2luLWZvcm0tZmxleC13cmFwcGVyXCI+XG4gICAgICAgICAgICAgICAgPGRpdj48L2Rpdj5cbiAgICAgICAgICAgICAgICA8YnV0dG9uIG1hdC1idXR0b25cbiAgICAgICAgICAgICAgICAgICAgICAgIChjbGljayk9XCJsb2dpbigpXCJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbG9yPVwicHJpbWFyeVwiXG4gICAgICAgICAgICAgICAgICAgICAgICB0eXBlPVwiYnV0dG9uXCI+XG4gICAgICAgICAgICAgICAgICAgIDxtYXQtaWNvbj5hdXRvcmVuZXc8L21hdC1pY29uPlxuICAgICAgICAgICAgICAgICAgICBSZXRyeVxuICAgICAgICAgICAgICAgIDwvYnV0dG9uPlxuICAgICAgICAgICAgICAgIDxkaXY+PC9kaXY+XG4gICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgPC9uZy10ZW1wbGF0ZT5cbiAgICA8L2Rpdj5cblxuICAgIDxyaXNrLWZsZXgtc3BhY2VyPjwvcmlzay1mbGV4LXNwYWNlcj5cbjwvcmlzay1mbGV4PlxuIl19
@@ -0,0 +1,86 @@
1
+ import { ChangeDetectionStrategy, Component, Directive, HostBinding, Inject, Input } from '@angular/core';
2
+ import { AUTH_PROVIDER } from '@dbg-riskit/angular-common';
3
+ import { BaseComponent } from '@dbg-riskit/angular-view';
4
+ import { first, takeUntil } from 'rxjs/operators';
5
+ import * as i0 from "@angular/core";
6
+ import * as i1 from "@dbg-riskit/angular-auth";
7
+ import * as i2 from "@angular/common";
8
+ import * as i3 from "@angular/material/button";
9
+ import * as i4 from "@angular/material/icon";
10
+ import * as i5 from "@angular/material/menu";
11
+ export class LoginMenuComponentTitleDirective {
12
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LoginMenuComponentTitleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
13
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: LoginMenuComponentTitleDirective, selector: "risk-login-menu-title-horizontal, risk-login-menu-title-vertical", host: { properties: { "class.risk-login-menu-title": "true" } }, ngImport: i0 });
14
+ }
15
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LoginMenuComponentTitleDirective, decorators: [{
16
+ type: Directive,
17
+ args: [{
18
+ selector: 'risk-login-menu-title-horizontal, '
19
+ + 'risk-login-menu-title-vertical',
20
+ host: {
21
+ '[class.risk-login-menu-title]': 'true'
22
+ }
23
+ }]
24
+ }] });
25
+ export class LoginMenuItemsDirective {
26
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LoginMenuItemsDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
27
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: LoginMenuItemsDirective, selector: "risk-login-menu-before-items-horizontal, risk-login-menu-before-items-vertical,risk-login-menu-after-items-horizontal,risk-login-menu-after-items-vertical", ngImport: i0 });
28
+ }
29
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LoginMenuItemsDirective, decorators: [{
30
+ type: Directive,
31
+ args: [{
32
+ selector: 'risk-login-menu-before-items-horizontal,'
33
+ + ' risk-login-menu-before-items-vertical,'
34
+ + 'risk-login-menu-after-items-horizontal,'
35
+ + 'risk-login-menu-after-items-vertical'
36
+ }]
37
+ }] });
38
+ export class LoginMenuComponent extends BaseComponent {
39
+ authProvider;
40
+ authRoutingFlowService;
41
+ changeDetectorRef;
42
+ orientation = 'row';
43
+ get isRow() {
44
+ return this.orientation === 'row';
45
+ }
46
+ get isColumn() {
47
+ return this.orientation === 'column';
48
+ }
49
+ constructor(authProvider, authRoutingFlowService, changeDetectorRef) {
50
+ super();
51
+ this.authProvider = authProvider;
52
+ this.authRoutingFlowService = authRoutingFlowService;
53
+ this.changeDetectorRef = changeDetectorRef;
54
+ // Update menu state on login status change
55
+ this.authProvider.loggedInStream.pipe(takeUntil(this.destroyed)).subscribe(() => this.changeDetectorRef.markForCheck());
56
+ }
57
+ menuClosed() {
58
+ this.changeDetectorRef.markForCheck();
59
+ }
60
+ get authStatus() {
61
+ return this.authProvider.loggedIn;
62
+ }
63
+ logout() {
64
+ this.authRoutingFlowService.logout().pipe(first()).subscribe();
65
+ }
66
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LoginMenuComponent, deps: [{ token: AUTH_PROVIDER }, { token: i1.AuthRoutingFlowService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
67
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: LoginMenuComponent, selector: "risk-login-menu", inputs: { orientation: "orientation" }, host: { properties: { "class.risk-login-menu": "true", "class.risk-login-menu-flex-row": "this.isRow", "class.risk-login-menu-flex-column": "this.isColumn" } }, usesInheritance: true, ngImport: i0, template: "<ng-template [ngIf]=\"orientation === 'row'\">\n <mat-menu #loginMenu=\"matMenu\"\n [overlapTrigger]=\"false\">\n <ng-content select=\"risk-login-menu-before-items-horizontal\"></ng-content>\n <ng-template [ngIf]=\"authStatus | async\" [ngIfElse]=\"loggedOut\">\n <button mat-menu-item\n (click)=\"logout()\"\n type=\"button\">\n <mat-icon>exit_to_app</mat-icon>\n Logout\n </button>\n </ng-template>\n <ng-template #loggedOut>\n <button mat-menu-item\n (click)=\"logout()\"\n type=\"button\">\n <mat-icon>launch</mat-icon>\n Login\n </button>\n </ng-template>\n <ng-content select=\"risk-login-menu-after-items-horizontal\"></ng-content>\n </mat-menu>\n <button mat-button\n #menu=\"matMenuTrigger\"\n [matMenuTriggerFor]=\"loginMenu\"\n [class.risk-menu-open]=\"menu.menuOpen\"\n (onMenuClose)=\"menuClosed()\"\n type=\"button\">\n <ng-content select=\"risk-login-menu-title-horizontal\"></ng-content>\n <mat-icon>person</mat-icon>\n </button>\n</ng-template>\n\n<ng-template [ngIf]=\"orientation === 'column'\">\n <ng-content select=\"risk-login-menu-title-vertical\"></ng-content>\n <ng-content select=\"risk-login-menu-before-items-vertical\"></ng-content>\n <ng-template [ngIf]=\"authStatus | async\" [ngIfElse]=\"loggedOut2\">\n <a mat-button\n (click)=\"logout()\">\n <mat-icon>exit_to_app</mat-icon>\n Logout\n </a>\n </ng-template>\n <ng-template #loggedOut2>\n <a mat-button\n (click)=\"logout()\">\n <mat-icon>launch</mat-icon>\n Login\n </a>\n </ng-template>\n <ng-content select=\"risk-login-menu-after-items-vertical\"></ng-content>\n</ng-template>\n", styles: [":host{display:block;padding:0;margin:0}:host>*{vertical-align:bottom}\n", ":host{display:-webkit-flex!important;display:flex!important}:host.risk-login-menu-flex-row{-webkit-flex-direction:row;flex-direction:row}:host.risk-login-menu-flex-column{-webkit-flex-direction:column;flex-direction:column}:host .risk-login-menu-title{font-weight:700;margin:0 5px}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.MatAnchor, selector: "a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button]", inputs: ["disabled", "disableRipple", "color", "tabIndex"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i3.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i5.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { kind: "component", type: i5.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i5.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
68
+ }
69
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LoginMenuComponent, decorators: [{
70
+ type: Component,
71
+ args: [{ selector: 'risk-login-menu', host: {
72
+ '[class.risk-login-menu]': 'true'
73
+ }, changeDetection: ChangeDetectionStrategy.OnPush, preserveWhitespaces: false, template: "<ng-template [ngIf]=\"orientation === 'row'\">\n <mat-menu #loginMenu=\"matMenu\"\n [overlapTrigger]=\"false\">\n <ng-content select=\"risk-login-menu-before-items-horizontal\"></ng-content>\n <ng-template [ngIf]=\"authStatus | async\" [ngIfElse]=\"loggedOut\">\n <button mat-menu-item\n (click)=\"logout()\"\n type=\"button\">\n <mat-icon>exit_to_app</mat-icon>\n Logout\n </button>\n </ng-template>\n <ng-template #loggedOut>\n <button mat-menu-item\n (click)=\"logout()\"\n type=\"button\">\n <mat-icon>launch</mat-icon>\n Login\n </button>\n </ng-template>\n <ng-content select=\"risk-login-menu-after-items-horizontal\"></ng-content>\n </mat-menu>\n <button mat-button\n #menu=\"matMenuTrigger\"\n [matMenuTriggerFor]=\"loginMenu\"\n [class.risk-menu-open]=\"menu.menuOpen\"\n (onMenuClose)=\"menuClosed()\"\n type=\"button\">\n <ng-content select=\"risk-login-menu-title-horizontal\"></ng-content>\n <mat-icon>person</mat-icon>\n </button>\n</ng-template>\n\n<ng-template [ngIf]=\"orientation === 'column'\">\n <ng-content select=\"risk-login-menu-title-vertical\"></ng-content>\n <ng-content select=\"risk-login-menu-before-items-vertical\"></ng-content>\n <ng-template [ngIf]=\"authStatus | async\" [ngIfElse]=\"loggedOut2\">\n <a mat-button\n (click)=\"logout()\">\n <mat-icon>exit_to_app</mat-icon>\n Logout\n </a>\n </ng-template>\n <ng-template #loggedOut2>\n <a mat-button\n (click)=\"logout()\">\n <mat-icon>launch</mat-icon>\n Login\n </a>\n </ng-template>\n <ng-content select=\"risk-login-menu-after-items-vertical\"></ng-content>\n</ng-template>\n", styles: [":host{display:block;padding:0;margin:0}:host>*{vertical-align:bottom}\n", ":host{display:-webkit-flex!important;display:flex!important}:host.risk-login-menu-flex-row{-webkit-flex-direction:row;flex-direction:row}:host.risk-login-menu-flex-column{-webkit-flex-direction:column;flex-direction:column}:host .risk-login-menu-title{font-weight:700;margin:0 5px}\n"] }]
74
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
75
+ type: Inject,
76
+ args: [AUTH_PROVIDER]
77
+ }] }, { type: i1.AuthRoutingFlowService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { orientation: [{
78
+ type: Input
79
+ }], isRow: [{
80
+ type: HostBinding,
81
+ args: ['class.risk-login-menu-flex-row']
82
+ }], isColumn: [{
83
+ type: HostBinding,
84
+ args: ['class.risk-login-menu-flex-column']
85
+ }] } });
86
+ //# sourceMappingURL=data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XCI+XG4gICAgICAgICAgICA8YnV0dG9uIG1hdC1tZW51LWl0ZW1cbiAgICAgICAgICAgICAgICAgICAgKGNsaWNrKT1cImxvZ291dCgpXCJcbiAgICAgICAgICAgICAgICAgICAgdHlwZT1cImJ1dHRvblwiPlxuICAgICAgICAgICAgICAgIDxtYXQtaWNvbj5leGl0X3RvX2FwcDwvbWF0LWljb24+XG4gICAgICAgICAgICAgICAgTG9nb3V0XG4gICAgICAgICAgICA8L2J1dHRvbj5cbiAgICAgICAgPC9uZy10ZW1wbGF0ZT5cbiAgICAgICAgPG5nLXRlbXBsYXRlICNsb2dnZWRPdXQ+XG4gICAgICAgICAgICA8YnV0dG9uIG1hdC1tZW51LWl0ZW1cbiAgICAgICAgICAgICAgICAgICAgKGNsaWNrKT1cImxvZ291dCgpXCJcbiAgICAgICAgICAgICAgICAgICAgdHlwZT1cImJ1dHRvblwiPlxuICAgICAgICAgICAgICAgIDxtYXQtaWNvbj5sYXVuY2g8L21hdC1pY29uPlxuICAgICAgICAgICAgICAgIExvZ2luXG4gICAgICAgICAgICA8L2J1dHRvbj5cbiAgICAgICAgPC9uZy10ZW1wbGF0ZT5cbiAgICAgICAgPG5nLWNvbnRlbnQgc2VsZWN0PVwicmlzay1sb2dpbi1tZW51LWFmdGVyLWl0ZW1zLWhvcml6b250YWxcIj48L25nLWNvbnRlbnQ+XG4gICAgPC9tYXQtbWVudT5cbiAgICA8YnV0dG9uIG1hdC1idXR0b25cbiAgICAgICAgICAgICNtZW51PVwibWF0TWVudVRyaWdnZXJcIlxuICAgICAgICAgICAgW21hdE1lbnVUcmlnZ2VyRm9yXT1cImxvZ2luTWVudVwiXG4gICAgICAgICAgICBbY2xhc3Mucmlzay1tZW51LW9wZW5dPVwibWVudS5tZW51T3BlblwiXG4gICAgICAgICAgICAob25NZW51Q2xvc2UpPVwibWVudUNsb3NlZCgpXCJcbiAgICAgICAgICAgIHR5cGU9XCJidXR0b25cIj5cbiAgICAgICAgPG5nLWNvbnRlbnQ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hdGU+XG4iXX0=
@@ -0,0 +1,51 @@
1
+ import { CommonModule } from '@angular/common';
2
+ import { NgModule } from '@angular/core';
3
+ import { FormsModule } from '@angular/forms';
4
+ import { RouterModule } from '@angular/router';
5
+ import { AuthModule } from '@dbg-riskit/angular-auth';
6
+ import { CommonViewModule } from '@dbg-riskit/angular-view';
7
+ import { LoginComponent } from './login.component';
8
+ import { LoginMenuComponent, LoginMenuComponentTitleDirective, LoginMenuItemsDirective } from './login.menu.component';
9
+ import * as i0 from "@angular/core";
10
+ export class LoginModule {
11
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LoginModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
12
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: LoginModule, declarations: [LoginMenuComponent,
13
+ LoginComponent,
14
+ LoginMenuComponentTitleDirective,
15
+ LoginMenuItemsDirective], imports: [CommonModule,
16
+ FormsModule,
17
+ RouterModule,
18
+ AuthModule,
19
+ CommonViewModule], exports: [LoginMenuComponent,
20
+ LoginMenuComponentTitleDirective,
21
+ LoginMenuItemsDirective] });
22
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LoginModule, imports: [CommonModule,
23
+ FormsModule,
24
+ RouterModule,
25
+ AuthModule,
26
+ CommonViewModule] });
27
+ }
28
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LoginModule, decorators: [{
29
+ type: NgModule,
30
+ args: [{
31
+ imports: [
32
+ CommonModule,
33
+ FormsModule,
34
+ RouterModule,
35
+ AuthModule,
36
+ CommonViewModule
37
+ ],
38
+ declarations: [
39
+ LoginMenuComponent,
40
+ LoginComponent,
41
+ LoginMenuComponentTitleDirective,
42
+ LoginMenuItemsDirective
43
+ ],
44
+ exports: [
45
+ LoginMenuComponent,
46
+ L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GUoe1xuICAgIGltcG9ydHMgICAgIDogW1xuICAgICAgICBDb21tb25Nb2R1bGUsXG4gICAgICAgIEZvcm1zTW9kdWxlLFxuICAgICAgICBSb3V0ZXJNb2R1bGUsXG4gICAgICAgIEF1dGhNb2R1bGUsXG4gICAgICAgIENvbW1vblZpZXdNb2R1bGVcbiAgICBdLFxuICAgIGRlY2xhcmF0aW9uczogW1xuICAgICAgICBMb2dpbk1lbnVDb21wb25lbnQsXG4gICAgICAgIExvZ2luQ29tcG9uZW50LFxuICAgICAgICBMb2dpbk1lbnVDb21wb25lbnRUaXRsZURpcmVjdGl2ZSxcbiAgICAgICAgTG9naW5NZW51SXRlbXNEaXJlY3RpdmVcbiAgICBdLFxuICAgIGV4cG9ydHMgICAgIDogW1xuICAgICAgICBMb2dpbk1lbnVDb21wb25lbnQsXG4gICAgICAgIExvZ2luTWVudUNvbXBvbmVudFRpdGxlRGlyZWN0aXZlLFxuICAgICAgICBMb2dpbk1lbnVJdGVtc0RpcmVjdGl2ZVxuICAgIF1cbn0pXG5leHBvcnQgY2xhc3MgTG9naW5Nb2R1bGUge1xufVxuIl19
@@ -0,0 +1,226 @@
1
+ import * as i2 from '@angular/common';
2
+ import { CommonModule } from '@angular/common';
3
+ import * as i0 from '@angular/core';
4
+ import { Component, ChangeDetectionStrategy, Inject, Directive, Input, HostBinding, NgModule } from '@angular/core';
5
+ import * as i3 from '@angular/forms';
6
+ import { FormsModule } from '@angular/forms';
7
+ import { RouterModule } from '@angular/router';
8
+ import * as i1 from '@dbg-riskit/angular-auth';
9
+ import { AuthModule } from '@dbg-riskit/angular-auth';
10
+ import * as i4 from '@dbg-riskit/angular-view';
11
+ import { BaseComponent, CommonViewModule } from '@dbg-riskit/angular-view';
12
+ import { AUTH_PROVIDER, SECONDARY_LOGO } from '@dbg-riskit/angular-common';
13
+ import { toErrorMessage } from '@dbg-riskit/angular-error';
14
+ import { takeUntil, first } from 'rxjs/operators';
15
+ import * as i3$1 from '@angular/material/button';
16
+ import * as i6 from '@angular/material/card';
17
+ import * as i7 from '@angular/material/form-field';
18
+ import * as i8 from '@angular/material/icon';
19
+ import * as i9 from '@angular/material/input';
20
+ import * as i10 from '@angular/material/progress-spinner';
21
+ import * as i5 from '@angular/material/menu';
22
+
23
+ class LoginComponent extends BaseComponent {
24
+ authProvider;
25
+ changeDetectorRef;
26
+ authRoutingFlowService;
27
+ secondaryLogo;
28
+ /**
29
+ * Error message to be displayed.
30
+ */
31
+ errorMessage;
32
+ /**
33
+ * User name binding.
34
+ */
35
+ username;
36
+ /**
37
+ * Password binding.
38
+ */
39
+ password;
40
+ /**
41
+ * Control for "login button-to-spinner".
42
+ */
43
+ loggingIn = false;
44
+ constructor(authProvider, changeDetectorRef, authRoutingFlowService, secondaryLogo) {
45
+ super();
46
+ this.authProvider = authProvider;
47
+ this.changeDetectorRef = changeDetectorRef;
48
+ this.authRoutingFlowService = authRoutingFlowService;
49
+ this.secondaryLogo = secondaryLogo;
50
+ // Update component state on login status change
51
+ this.authProvider.loggedInStream.pipe(takeUntil(this.destroyed)).subscribe(() => this.changeDetectorRef.markForCheck());
52
+ }
53
+ ngAfterViewInit() {
54
+ this.authRoutingFlowService.loginViaService().pipe(takeUntil(this.destroyed)).subscribe(() => {
55
+ this.changeDetectorRef.markForCheck();
56
+ }, (err) => {
57
+ this.errorMessage = toErrorMessage(err).message;
58
+ this.changeDetectorRef.markForCheck();
59
+ });
60
+ }
61
+ get isDirectFlow() {
62
+ return this.authRoutingFlowService.directFlow;
63
+ }
64
+ get authStatus() {
65
+ return this.authProvider.loggedIn;
66
+ }
67
+ get userProfile() {
68
+ return this.authProvider.userProfile;
69
+ }
70
+ login() {
71
+ this.loggingIn = true;
72
+ this.authRoutingFlowService.login(this.username, this.password).pipe(first()).subscribe((res) => {
73
+ if (!res) {
74
+ this.errorMessage = 'Authentication failed. Server did not generate a token.';
75
+ }
76
+ this.loggingIn = false;
77
+ this.changeDetectorRef.markForCheck();
78
+ }, () => {
79
+ this.loggingIn = false;
80
+ this.errorMessage = 'Authentication failed. Is the username and password correct?';
81
+ this.changeDetectorRef.markForCheck();
82
+ });
83
+ }
84
+ get logo() {
85
+ return this.secondaryLogo;
86
+ }
87
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LoginComponent, deps: [{ token: AUTH_PROVIDER }, { token: i0.ChangeDetectorRef }, { token: i1.AuthRoutingFlowService }, { token: SECONDARY_LOGO }], target: i0.ɵɵFactoryTarget.Component });
88
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: LoginComponent, selector: "ng-component", host: { properties: { "class.risk-login-form": "true" } }, usesInheritance: true, ngImport: i0, template: "<risk-flex>\n <risk-flex-spacer></risk-flex-spacer>\n\n <div *ngIf=\"isDirectFlow\">\n <ng-template #loggedOut>\n <risk-error *ngIf=\"errorMessage\" [message]=\"errorMessage\"></risk-error>\n\n <form (ngSubmit)=\"login()\" role=\"form\">\n <mat-card>\n <mat-card-title-group>\n <mat-card-title>Please Sign In</mat-card-title>\n </mat-card-title-group>\n <mat-card-content>\n <mat-form-field class=\"risk-full-width\">\n <input matInput\n type=\"text\"\n placeholder=\"Username\"\n name=\"username\"\n [(ngModel)]=\"username\"\n autofocus>\n </mat-form-field>\n <mat-form-field class=\"risk-full-width\">\n <input matInput\n type=\"password\"\n placeholder=\"Password\"\n name=\"password\"\n [(ngModel)]=\"password\">\n </mat-form-field>\n </mat-card-content>\n <mat-card-actions>\n <button *ngIf=\"!loggingIn\"\n mat-raised-button\n color=\"primary\"\n type=\"submit\">\n Sign in\n </button>\n <img [src]=\"logo\" alt=\"Company logo\">\n <mat-spinner *ngIf=\"loggingIn\" [diameter]=\"36\"></mat-spinner>\n </mat-card-actions>\n </mat-card>\n </form>\n </ng-template>\n\n <ng-template [ngIf]=\"authStatus | async\" [ngIfElse]=\"loggedOut\">\n <ng-template [ngIf]=\"userProfile | async\" let-user=\"ngIf\">\n <risk-good *ngIf=\"user?.name\"\n [message]=\"'Successfully logged in as ' + user.name + '.'\"></risk-good>\n <risk-good *ngIf=\"!user && !user.name\"\n [message]=\"'Successfully logged in!'\"></risk-good>\n </ng-template>\n </ng-template>\n </div>\n\n <div *ngIf=\"!isDirectFlow\">\n <ng-template [ngIf]=\"!errorMessage\">\n <div class=\"risk-login-form-flex-wrapper\">\n <div></div>\n <mat-spinner></mat-spinner>\n <div></div>\n </div>\n <h3>Contacting authentication server...</h3>\n </ng-template>\n <ng-template [ngIf]=\"errorMessage\">\n <div class=\"risk-login-form-flex-wrapper\">\n <div></div>\n <mat-icon class=\"risk-login-form-error\" color=\"warn\">error_outline</mat-icon>\n <div></div>\n </div>\n <h3>Failed to authenticate user: {{errorMessage}}</h3>\n <div class=\"risk-login-form-flex-wrapper\">\n <div></div>\n <button mat-button\n (click)=\"login()\"\n color=\"primary\"\n type=\"button\">\n <mat-icon>autorenew</mat-icon>\n Retry\n </button>\n <div></div>\n </div>\n </ng-template>\n </div>\n\n <risk-flex-spacer></risk-flex-spacer>\n</risk-flex>\n", styles: [":host{display:block;padding:0;margin:0}:host>*{vertical-align:bottom}\n", ".risk-flex>div{width:400px;max-width:97vw;max-height:70vh;margin-top:40px}.mat-mdc-card-title-group{margin:0}.mat-mdc-card-title-group .mat-mdc-card-title{font-weight:500}.mat-mdc-card-actions{margin:0;margin-bottom:-8px!important;padding:0}.mat-mdc-card-actions img{float:right;margin:3px 0;height:30px}.risk-login-form-flex-wrapper{display:-webkit-flex;display:flex}.risk-login-form-flex-wrapper>div{-webkit-flex:1;flex:1}.risk-login-form-error{font-size:100px;height:100px;width:100px}h3{text-align:center}input:-webkit-autofill{-webkit-box-shadow:0 0 0 1000px white inset}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.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: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i3.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: i4.MessageComponent, selector: "risk-error, risk-good, risk-info, risk-message, risk-warn, risk-initial-load, risk-no-data, risk-update-failed", inputs: ["message"] }, { kind: "component", type: i3$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i6.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i6.MatCardActions, selector: "mat-card-actions", inputs: ["align"], exportAs: ["matCardActions"] }, { kind: "directive", type: i6.MatCardContent, selector: "mat-card-content" }, { kind: "directive", type: i6.MatCardTitle, selector: "mat-card-title, [mat-card-title], [matCardTitle]" }, { kind: "component", type: i6.MatCardTitleGroup, selector: "mat-card-title-group" }, { kind: "component", type: i7.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "component", type: i8.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i9.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: i4.FlexComponent, selector: "risk-flex", inputs: ["wrapContent"] }, { kind: "component", type: i4.FlexSpacerComponent, selector: "risk-flex-spacer" }, { kind: "component", type: i10.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
89
+ }
90
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LoginComponent, decorators: [{
91
+ type: Component,
92
+ args: [{ host: {
93
+ '[class.risk-login-form]': 'true'
94
+ }, changeDetection: ChangeDetectionStrategy.OnPush, preserveWhitespaces: false, template: "<risk-flex>\n <risk-flex-spacer></risk-flex-spacer>\n\n <div *ngIf=\"isDirectFlow\">\n <ng-template #loggedOut>\n <risk-error *ngIf=\"errorMessage\" [message]=\"errorMessage\"></risk-error>\n\n <form (ngSubmit)=\"login()\" role=\"form\">\n <mat-card>\n <mat-card-title-group>\n <mat-card-title>Please Sign In</mat-card-title>\n </mat-card-title-group>\n <mat-card-content>\n <mat-form-field class=\"risk-full-width\">\n <input matInput\n type=\"text\"\n placeholder=\"Username\"\n name=\"username\"\n [(ngModel)]=\"username\"\n autofocus>\n </mat-form-field>\n <mat-form-field class=\"risk-full-width\">\n <input matInput\n type=\"password\"\n placeholder=\"Password\"\n name=\"password\"\n [(ngModel)]=\"password\">\n </mat-form-field>\n </mat-card-content>\n <mat-card-actions>\n <button *ngIf=\"!loggingIn\"\n mat-raised-button\n color=\"primary\"\n type=\"submit\">\n Sign in\n </button>\n <img [src]=\"logo\" alt=\"Company logo\">\n <mat-spinner *ngIf=\"loggingIn\" [diameter]=\"36\"></mat-spinner>\n </mat-card-actions>\n </mat-card>\n </form>\n </ng-template>\n\n <ng-template [ngIf]=\"authStatus | async\" [ngIfElse]=\"loggedOut\">\n <ng-template [ngIf]=\"userProfile | async\" let-user=\"ngIf\">\n <risk-good *ngIf=\"user?.name\"\n [message]=\"'Successfully logged in as ' + user.name + '.'\"></risk-good>\n <risk-good *ngIf=\"!user && !user.name\"\n [message]=\"'Successfully logged in!'\"></risk-good>\n </ng-template>\n </ng-template>\n </div>\n\n <div *ngIf=\"!isDirectFlow\">\n <ng-template [ngIf]=\"!errorMessage\">\n <div class=\"risk-login-form-flex-wrapper\">\n <div></div>\n <mat-spinner></mat-spinner>\n <div></div>\n </div>\n <h3>Contacting authentication server...</h3>\n </ng-template>\n <ng-template [ngIf]=\"errorMessage\">\n <div class=\"risk-login-form-flex-wrapper\">\n <div></div>\n <mat-icon class=\"risk-login-form-error\" color=\"warn\">error_outline</mat-icon>\n <div></div>\n </div>\n <h3>Failed to authenticate user: {{errorMessage}}</h3>\n <div class=\"risk-login-form-flex-wrapper\">\n <div></div>\n <button mat-button\n (click)=\"login()\"\n color=\"primary\"\n type=\"button\">\n <mat-icon>autorenew</mat-icon>\n Retry\n </button>\n <div></div>\n </div>\n </ng-template>\n </div>\n\n <risk-flex-spacer></risk-flex-spacer>\n</risk-flex>\n", styles: [":host{display:block;padding:0;margin:0}:host>*{vertical-align:bottom}\n", ".risk-flex>div{width:400px;max-width:97vw;max-height:70vh;margin-top:40px}.mat-mdc-card-title-group{margin:0}.mat-mdc-card-title-group .mat-mdc-card-title{font-weight:500}.mat-mdc-card-actions{margin:0;margin-bottom:-8px!important;padding:0}.mat-mdc-card-actions img{float:right;margin:3px 0;height:30px}.risk-login-form-flex-wrapper{display:-webkit-flex;display:flex}.risk-login-form-flex-wrapper>div{-webkit-flex:1;flex:1}.risk-login-form-error{font-size:100px;height:100px;width:100px}h3{text-align:center}input:-webkit-autofill{-webkit-box-shadow:0 0 0 1000px white inset}\n"] }]
95
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
96
+ type: Inject,
97
+ args: [AUTH_PROVIDER]
98
+ }] }, { type: i0.ChangeDetectorRef }, { type: i1.AuthRoutingFlowService }, { type: undefined, decorators: [{
99
+ type: Inject,
100
+ args: [SECONDARY_LOGO]
101
+ }] }]; } });
102
+
103
+ class LoginMenuComponentTitleDirective {
104
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LoginMenuComponentTitleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
105
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: LoginMenuComponentTitleDirective, selector: "risk-login-menu-title-horizontal, risk-login-menu-title-vertical", host: { properties: { "class.risk-login-menu-title": "true" } }, ngImport: i0 });
106
+ }
107
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LoginMenuComponentTitleDirective, decorators: [{
108
+ type: Directive,
109
+ args: [{
110
+ selector: 'risk-login-menu-title-horizontal, '
111
+ + 'risk-login-menu-title-vertical',
112
+ host: {
113
+ '[class.risk-login-menu-title]': 'true'
114
+ }
115
+ }]
116
+ }] });
117
+ class LoginMenuItemsDirective {
118
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LoginMenuItemsDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
119
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: LoginMenuItemsDirective, selector: "risk-login-menu-before-items-horizontal, risk-login-menu-before-items-vertical,risk-login-menu-after-items-horizontal,risk-login-menu-after-items-vertical", ngImport: i0 });
120
+ }
121
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LoginMenuItemsDirective, decorators: [{
122
+ type: Directive,
123
+ args: [{
124
+ selector: 'risk-login-menu-before-items-horizontal,'
125
+ + ' risk-login-menu-before-items-vertical,'
126
+ + 'risk-login-menu-after-items-horizontal,'
127
+ + 'risk-login-menu-after-items-vertical'
128
+ }]
129
+ }] });
130
+ class LoginMenuComponent extends BaseComponent {
131
+ authProvider;
132
+ authRoutingFlowService;
133
+ changeDetectorRef;
134
+ orientation = 'row';
135
+ get isRow() {
136
+ return this.orientation === 'row';
137
+ }
138
+ get isColumn() {
139
+ return this.orientation === 'column';
140
+ }
141
+ constructor(authProvider, authRoutingFlowService, changeDetectorRef) {
142
+ super();
143
+ this.authProvider = authProvider;
144
+ this.authRoutingFlowService = authRoutingFlowService;
145
+ this.changeDetectorRef = changeDetectorRef;
146
+ // Update menu state on login status change
147
+ this.authProvider.loggedInStream.pipe(takeUntil(this.destroyed)).subscribe(() => this.changeDetectorRef.markForCheck());
148
+ }
149
+ menuClosed() {
150
+ this.changeDetectorRef.markForCheck();
151
+ }
152
+ get authStatus() {
153
+ return this.authProvider.loggedIn;
154
+ }
155
+ logout() {
156
+ this.authRoutingFlowService.logout().pipe(first()).subscribe();
157
+ }
158
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LoginMenuComponent, deps: [{ token: AUTH_PROVIDER }, { token: i1.AuthRoutingFlowService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
159
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: LoginMenuComponent, selector: "risk-login-menu", inputs: { orientation: "orientation" }, host: { properties: { "class.risk-login-menu": "true", "class.risk-login-menu-flex-row": "this.isRow", "class.risk-login-menu-flex-column": "this.isColumn" } }, usesInheritance: true, ngImport: i0, template: "<ng-template [ngIf]=\"orientation === 'row'\">\n <mat-menu #loginMenu=\"matMenu\"\n [overlapTrigger]=\"false\">\n <ng-content select=\"risk-login-menu-before-items-horizontal\"></ng-content>\n <ng-template [ngIf]=\"authStatus | async\" [ngIfElse]=\"loggedOut\">\n <button mat-menu-item\n (click)=\"logout()\"\n type=\"button\">\n <mat-icon>exit_to_app</mat-icon>\n Logout\n </button>\n </ng-template>\n <ng-template #loggedOut>\n <button mat-menu-item\n (click)=\"logout()\"\n type=\"button\">\n <mat-icon>launch</mat-icon>\n Login\n </button>\n </ng-template>\n <ng-content select=\"risk-login-menu-after-items-horizontal\"></ng-content>\n </mat-menu>\n <button mat-button\n #menu=\"matMenuTrigger\"\n [matMenuTriggerFor]=\"loginMenu\"\n [class.risk-menu-open]=\"menu.menuOpen\"\n (onMenuClose)=\"menuClosed()\"\n type=\"button\">\n <ng-content select=\"risk-login-menu-title-horizontal\"></ng-content>\n <mat-icon>person</mat-icon>\n </button>\n</ng-template>\n\n<ng-template [ngIf]=\"orientation === 'column'\">\n <ng-content select=\"risk-login-menu-title-vertical\"></ng-content>\n <ng-content select=\"risk-login-menu-before-items-vertical\"></ng-content>\n <ng-template [ngIf]=\"authStatus | async\" [ngIfElse]=\"loggedOut2\">\n <a mat-button\n (click)=\"logout()\">\n <mat-icon>exit_to_app</mat-icon>\n Logout\n </a>\n </ng-template>\n <ng-template #loggedOut2>\n <a mat-button\n (click)=\"logout()\">\n <mat-icon>launch</mat-icon>\n Login\n </a>\n </ng-template>\n <ng-content select=\"risk-login-menu-after-items-vertical\"></ng-content>\n</ng-template>\n", styles: [":host{display:block;padding:0;margin:0}:host>*{vertical-align:bottom}\n", ":host{display:-webkit-flex!important;display:flex!important}:host.risk-login-menu-flex-row{-webkit-flex-direction:row;flex-direction:row}:host.risk-login-menu-flex-column{-webkit-flex-direction:column;flex-direction:column}:host .risk-login-menu-title{font-weight:700;margin:0 5px}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3$1.MatAnchor, selector: "a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button]", inputs: ["disabled", "disableRipple", "color", "tabIndex"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i3$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i8.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i5.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { kind: "component", type: i5.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i5.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
160
+ }
161
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LoginMenuComponent, decorators: [{
162
+ type: Component,
163
+ args: [{ selector: 'risk-login-menu', host: {
164
+ '[class.risk-login-menu]': 'true'
165
+ }, changeDetection: ChangeDetectionStrategy.OnPush, preserveWhitespaces: false, template: "<ng-template [ngIf]=\"orientation === 'row'\">\n <mat-menu #loginMenu=\"matMenu\"\n [overlapTrigger]=\"false\">\n <ng-content select=\"risk-login-menu-before-items-horizontal\"></ng-content>\n <ng-template [ngIf]=\"authStatus | async\" [ngIfElse]=\"loggedOut\">\n <button mat-menu-item\n (click)=\"logout()\"\n type=\"button\">\n <mat-icon>exit_to_app</mat-icon>\n Logout\n </button>\n </ng-template>\n <ng-template #loggedOut>\n <button mat-menu-item\n (click)=\"logout()\"\n type=\"button\">\n <mat-icon>launch</mat-icon>\n Login\n </button>\n </ng-template>\n <ng-content select=\"risk-login-menu-after-items-horizontal\"></ng-content>\n </mat-menu>\n <button mat-button\n #menu=\"matMenuTrigger\"\n [matMenuTriggerFor]=\"loginMenu\"\n [class.risk-menu-open]=\"menu.menuOpen\"\n (onMenuClose)=\"menuClosed()\"\n type=\"button\">\n <ng-content select=\"risk-login-menu-title-horizontal\"></ng-content>\n <mat-icon>person</mat-icon>\n </button>\n</ng-template>\n\n<ng-template [ngIf]=\"orientation === 'column'\">\n <ng-content select=\"risk-login-menu-title-vertical\"></ng-content>\n <ng-content select=\"risk-login-menu-before-items-vertical\"></ng-content>\n <ng-template [ngIf]=\"authStatus | async\" [ngIfElse]=\"loggedOut2\">\n <a mat-button\n (click)=\"logout()\">\n <mat-icon>exit_to_app</mat-icon>\n Logout\n </a>\n </ng-template>\n <ng-template #loggedOut2>\n <a mat-button\n (click)=\"logout()\">\n <mat-icon>launch</mat-icon>\n Login\n </a>\n </ng-template>\n <ng-content select=\"risk-login-menu-after-items-vertical\"></ng-content>\n</ng-template>\n", styles: [":host{display:block;padding:0;margin:0}:host>*{vertical-align:bottom}\n", ":host{display:-webkit-flex!important;display:flex!important}:host.risk-login-menu-flex-row{-webkit-flex-direction:row;flex-direction:row}:host.risk-login-menu-flex-column{-webkit-flex-direction:column;flex-direction:column}:host .risk-login-menu-title{font-weight:700;margin:0 5px}\n"] }]
166
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
167
+ type: Inject,
168
+ args: [AUTH_PROVIDER]
169
+ }] }, { type: i1.AuthRoutingFlowService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { orientation: [{
170
+ type: Input
171
+ }], isRow: [{
172
+ type: HostBinding,
173
+ args: ['class.risk-login-menu-flex-row']
174
+ }], isColumn: [{
175
+ type: HostBinding,
176
+ args: ['class.risk-login-menu-flex-column']
177
+ }] } });
178
+
179
+ class LoginModule {
180
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LoginModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
181
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: LoginModule, declarations: [LoginMenuComponent,
182
+ LoginComponent,
183
+ LoginMenuComponentTitleDirective,
184
+ LoginMenuItemsDirective], imports: [CommonModule,
185
+ FormsModule,
186
+ RouterModule,
187
+ AuthModule,
188
+ CommonViewModule], exports: [LoginMenuComponent,
189
+ LoginMenuComponentTitleDirective,
190
+ LoginMenuItemsDirective] });
191
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LoginModule, imports: [CommonModule,
192
+ FormsModule,
193
+ RouterModule,
194
+ AuthModule,
195
+ CommonViewModule] });
196
+ }
197
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LoginModule, decorators: [{
198
+ type: NgModule,
199
+ args: [{
200
+ imports: [
201
+ CommonModule,
202
+ FormsModule,
203
+ RouterModule,
204
+ AuthModule,
205
+ CommonViewModule
206
+ ],
207
+ declarations: [
208
+ LoginMenuComponent,
209
+ LoginComponent,
210
+ LoginMenuComponentTitleDirective,
211
+ LoginMenuItemsDirective
212
+ ],
213
+ exports: [
214
+ LoginMenuComponent,
215
+ LoginMenuComponentTitleDirective,
216
+ LoginMenuItemsDirective
217
+ ]
218
+ }]
219
+ }] });
220
+
221
+ /**
222
+ * Generated bundle index. Do not edit.
223
+ */
224
+
225
+ export { LoginComponent, LoginMenuComponent, LoginMenuComponentTitleDirective, LoginMenuItemsDirective, LoginModule };
226
+ //# sourceMappingURL=dbg-riskit-angular-login.mjs.map