@firestitch/2fa 12.0.2 → 12.0.5

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 (39) hide show
  1. package/app/components/2fa-verification/2fa-verification.component.d.ts +26 -0
  2. package/app/components/2fa-verification-code/2fa-verification-code.component.d.ts +11 -0
  3. package/app/components/2fa-verification-methods/2fa-verification-methods.component.d.ts +23 -0
  4. package/app/components/2fa-verification-otp/2fa-verification-otp.component.d.ts +12 -0
  5. package/app/enums/verification-method-type.enum.d.ts +6 -0
  6. package/app/fs-2fa.module.d.ts +23 -19
  7. package/app/interfaces/verification-method.interface.d.ts +11 -0
  8. package/app/interfaces/verification-provider.interface.d.ts +8 -0
  9. package/app/tokens/verification.token.d.ts +3 -0
  10. package/bundles/firestitch-2fa.umd.js +336 -196
  11. package/bundles/firestitch-2fa.umd.js.map +1 -1
  12. package/esm2015/app/components/2fa-verification/2fa-verification.component.js +92 -0
  13. package/esm2015/app/components/2fa-verification-code/2fa-verification-code.component.js +45 -0
  14. package/esm2015/app/components/2fa-verification-methods/2fa-verification-methods.component.js +73 -0
  15. package/esm2015/app/components/2fa-verification-otp/2fa-verification-otp.component.js +33 -0
  16. package/esm2015/app/enums/verification-method-type.enum.js +8 -0
  17. package/esm2015/app/fs-2fa.module.js +91 -68
  18. package/esm2015/app/interfaces/verification-method.interface.js +2 -0
  19. package/esm2015/app/interfaces/verification-provider.interface.js +2 -0
  20. package/esm2015/app/tokens/verification.token.js +3 -0
  21. package/esm2015/firestitch-2fa.js +4 -4
  22. package/esm2015/public_api.js +9 -4
  23. package/fesm2015/firestitch-2fa.js +310 -171
  24. package/fesm2015/firestitch-2fa.js.map +1 -1
  25. package/firestitch-2fa.d.ts +5 -5
  26. package/package.json +5 -2
  27. package/public_api.d.ts +6 -7
  28. package/app/components/trusted-current-device/trusted-current-device.component.d.ts +0 -5
  29. package/app/components/trusted-devices/trusted-devices.component.d.ts +0 -26
  30. package/app/interfaces/trusted-device-account.d.ts +0 -6
  31. package/app/interfaces/trusted-device-device.d.ts +0 -10
  32. package/app/interfaces/trusted-device-ip.d.ts +0 -8
  33. package/app/interfaces/trusted-device.d.ts +0 -14
  34. package/esm2015/app/components/trusted-current-device/trusted-current-device.component.js +0 -18
  35. package/esm2015/app/components/trusted-devices/trusted-devices.component.js +0 -99
  36. package/esm2015/app/interfaces/trusted-device-account.js +0 -2
  37. package/esm2015/app/interfaces/trusted-device-device.js +0 -2
  38. package/esm2015/app/interfaces/trusted-device-ip.js +0 -2
  39. package/esm2015/app/interfaces/trusted-device.js +0 -2
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmVyaWZpY2F0aW9uLW1ldGhvZC5pbnRlcmZhY2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvYXBwL2ludGVyZmFjZXMvdmVyaWZpY2F0aW9uLW1ldGhvZC5pbnRlcmZhY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IEZzVmVyaWZpY2F0aW9uTWV0aG9kVHlwZSB9IGZyb20gJy4uL2VudW1zL3ZlcmlmaWNhdGlvbi1tZXRob2QtdHlwZS5lbnVtJztcblxuZXhwb3J0IGludGVyZmFjZSBJRnNWZXJpZmljYXRpb25NZXRob2Qge1xuICBpZDogbnVtYmVyO1xuICBzdGF0ZT86IHN0cmluZztcbiAgdHlwZTogRnNWZXJpZmljYXRpb25NZXRob2RUeXBlO1xuICBwaG9uZUNvZGU/OiBudW1iZXI7XG4gIHBob25lQ291bnRyeT86IHN0cmluZztcbiAgZW1haWw/OiBzdHJpbmc7XG4gIHBob25lTnVtYmVyPzogc3RyaW5nO1xuICBkZWZhdWx0OiBib29sZWFuO1xufVxuIl19
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmVyaWZpY2F0aW9uLXByb3ZpZGVyLmludGVyZmFjZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9hcHAvaW50ZXJmYWNlcy92ZXJpZmljYXRpb24tcHJvdmlkZXIuaW50ZXJmYWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBPYnNlcnZhYmxlIH0gZnJvbSAncnhqcyc7XG5cbmltcG9ydCB7IElGc1ZlcmlmaWNhdGlvbk1ldGhvZCB9IGZyb20gJy4vdmVyaWZpY2F0aW9uLW1ldGhvZC5pbnRlcmZhY2UnO1xuXG5cbmV4cG9ydCBpbnRlcmZhY2UgSUZzVmVyaWZpY2F0aW9uUHJvdmlkZXIge1xuICB2ZXJpZnkoY29kZTogYW55LCB0cnVzdGVkRGV2aWNlOiBib29sZWFuKTogT2JzZXJ2YWJsZTx1bmtub3duPjtcbiAgcmVzZW5kKCk6IE9ic2VydmFibGU8dm9pZD47XG4gIG1ldGhvZHMoKTogT2JzZXJ2YWJsZTxJRnNWZXJpZmljYXRpb25NZXRob2RbXT47XG4gIHVwZGF0ZVZlcmlmaWNhdGlvbk1ldGhvZChpZDogbnVtYmVyKTogT2JzZXJ2YWJsZTxJRnNWZXJpZmljYXRpb25NZXRob2Q+XG59XG4iXX0=
@@ -0,0 +1,3 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ export const FS_2FA_VERIFICATION_PROVIDER = new InjectionToken('Provider for Verification service');
3
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmVyaWZpY2F0aW9uLnRva2VuLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL2FwcC90b2tlbnMvdmVyaWZpY2F0aW9uLnRva2VuLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxjQUFjLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFJL0MsTUFBTSxDQUFDLE1BQU0sNEJBQTRCLEdBQUcsSUFBSSxjQUFjLENBQzVELG1DQUFtQyxDQUNwQyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgSW5qZWN0aW9uVG9rZW4gfSBmcm9tICdAYW5ndWxhci9jb3JlJztcblxuaW1wb3J0IHsgSUZzVmVyaWZpY2F0aW9uUHJvdmlkZXIgfSBmcm9tICcuLi9pbnRlcmZhY2VzL3ZlcmlmaWNhdGlvbi1wcm92aWRlci5pbnRlcmZhY2UnO1xuXG5leHBvcnQgY29uc3QgRlNfMkZBX1ZFUklGSUNBVElPTl9QUk9WSURFUiA9IG5ldyBJbmplY3Rpb25Ub2tlbjxJRnNWZXJpZmljYXRpb25Qcm92aWRlcj4oXG4gICdQcm92aWRlciBmb3IgVmVyaWZpY2F0aW9uIHNlcnZpY2UnLFxuKTtcbiJdfQ==
@@ -1,5 +1,5 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- export * from './public_api';
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ export * from './public_api';
5
5
  //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmlyZXN0aXRjaC0yZmEuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvZmlyZXN0aXRjaC0yZmEudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxjQUFjLGNBQWMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogR2VuZXJhdGVkIGJ1bmRsZSBpbmRleC4gRG8gbm90IGVkaXQuXG4gKi9cblxuZXhwb3J0ICogZnJvbSAnLi9wdWJsaWNfYXBpJztcbiJdfQ==
@@ -1,4 +1,9 @@
1
- export { Fs2FaModule } from './app/fs-2fa.module';
2
- export { FsTrustedDevicesComponent } from './app/components/trusted-devices/trusted-devices.component';
3
- export { FsTrustedCurrentDeviceComponent } from './app/components/trusted-current-device/trusted-current-device.component';
4
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9wdWJsaWNfYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxXQUFXLEVBQUUsTUFBTSxxQkFBcUIsQ0FBQztBQUVsRCxPQUFPLEVBQUUseUJBQXlCLEVBQUUsTUFBTSw0REFBNEQsQ0FBQztBQUN2RyxPQUFPLEVBQUUsK0JBQStCLEVBQUUsTUFBTSwwRUFBMEUsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCB7IEZzMkZhTW9kdWxlIH0gZnJvbSAnLi9hcHAvZnMtMmZhLm1vZHVsZSc7XG5cbmV4cG9ydCB7IEZzVHJ1c3RlZERldmljZXNDb21wb25lbnQgfSBmcm9tICcuL2FwcC9jb21wb25lbnRzL3RydXN0ZWQtZGV2aWNlcy90cnVzdGVkLWRldmljZXMuY29tcG9uZW50JztcbmV4cG9ydCB7IEZzVHJ1c3RlZEN1cnJlbnREZXZpY2VDb21wb25lbnQgfSBmcm9tICcuL2FwcC9jb21wb25lbnRzL3RydXN0ZWQtY3VycmVudC1kZXZpY2UvdHJ1c3RlZC1jdXJyZW50LWRldmljZS5jb21wb25lbnQnO1xuXG5leHBvcnQgeyBJVHJ1c3RlZERldmljZSB9IGZyb20gJy4vYXBwL2ludGVyZmFjZXMvdHJ1c3RlZC1kZXZpY2UnO1xuZXhwb3J0IHsgSVRydXN0ZWREZXZpY2VBY2NvdW50IH0gZnJvbSAnLi9hcHAvaW50ZXJmYWNlcy90cnVzdGVkLWRldmljZS1hY2NvdW50JztcbmV4cG9ydCB7IElUcnVzdGVkRGV2aWNlRGV2aWNlIH0gZnJvbSAnLi9hcHAvaW50ZXJmYWNlcy90cnVzdGVkLWRldmljZS1kZXZpY2UnO1xuZXhwb3J0IHsgSVRydXN0ZWREZXZpY2VJcCB9IGZyb20gJy4vYXBwL2ludGVyZmFjZXMvdHJ1c3RlZC1kZXZpY2UtaXAnO1xuIl19
1
+ /*
2
+ * Public API Surface of fs-2fa
3
+ */
4
+ export { Fs2FaModule } from './app/fs-2fa.module';
5
+ // Components
6
+ export { Fs2FAVerificationComponent } from './app/components/2fa-verification/2fa-verification.component';
7
+ export { FsVerificationMethodType } from './app/enums/verification-method-type.enum';
8
+ export { FS_2FA_VERIFICATION_PROVIDER } from './app/tokens/verification.token';
9
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9wdWJsaWNfYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBRUgsT0FBTyxFQUFFLFdBQVcsRUFBRSxNQUFNLHFCQUFxQixDQUFDO0FBRWxELGFBQWE7QUFDYixPQUFPLEVBQUUsMEJBQTBCLEVBQUUsTUFBTSw4REFBOEQsQ0FBQztBQUsxRyxPQUFPLEVBQUUsd0JBQXdCLEVBQUUsTUFBTSwyQ0FBMkMsQ0FBQztBQUVyRixPQUFPLEVBQUUsNEJBQTRCLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qXG4gKiBQdWJsaWMgQVBJIFN1cmZhY2Ugb2YgZnMtMmZhXG4gKi9cblxuZXhwb3J0IHsgRnMyRmFNb2R1bGUgfSBmcm9tICcuL2FwcC9mcy0yZmEubW9kdWxlJztcblxuLy8gQ29tcG9uZW50c1xuZXhwb3J0IHsgRnMyRkFWZXJpZmljYXRpb25Db21wb25lbnQgfSBmcm9tICcuL2FwcC9jb21wb25lbnRzLzJmYS12ZXJpZmljYXRpb24vMmZhLXZlcmlmaWNhdGlvbi5jb21wb25lbnQnO1xuXG5leHBvcnQgeyBJRnNWZXJpZmljYXRpb25Qcm92aWRlciB9IGZyb20gJy4vYXBwL2ludGVyZmFjZXMvdmVyaWZpY2F0aW9uLXByb3ZpZGVyLmludGVyZmFjZSc7XG5leHBvcnQgeyBJRnNWZXJpZmljYXRpb25NZXRob2QgfSBmcm9tICcuL2FwcC9pbnRlcmZhY2VzL3ZlcmlmaWNhdGlvbi1tZXRob2QuaW50ZXJmYWNlJztcblxuZXhwb3J0IHsgRnNWZXJpZmljYXRpb25NZXRob2RUeXBlIH0gZnJvbSAnLi9hcHAvZW51bXMvdmVyaWZpY2F0aW9uLW1ldGhvZC10eXBlLmVudW0nO1xuXG5leHBvcnQgeyBGU18yRkFfVkVSSUZJQ0FUSU9OX1BST1ZJREVSIH0gZnJvbSAnLi9hcHAvdG9rZW5zL3ZlcmlmaWNhdGlvbi50b2tlbic7XG4iXX0=
@@ -1,183 +1,322 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Component, ChangeDetectionStrategy, Input, ViewChild, NgModule } from '@angular/core';
3
- import * as i6 from '@angular/common';
2
+ import { InjectionToken, Component, ChangeDetectionStrategy, Inject, EventEmitter, Output, Input, NgModule } from '@angular/core';
3
+ import * as i7 from '@angular/forms';
4
+ import { ControlContainer, NgForm, FormsModule } from '@angular/forms';
5
+ import * as i10 from '@angular/common';
4
6
  import { CommonModule } from '@angular/common';
5
- import { FlexLayoutModule } from '@angular/flex-layout';
6
- import * as i1 from '@angular/material/icon';
7
+ import * as i4 from '@angular/material/icon';
7
8
  import { MatIconModule } from '@angular/material/icon';
8
- import * as i2$1 from '@firestitch/list';
9
- import { FsListComponent, FsListModule } from '@firestitch/list';
10
- import * as i7 from '@firestitch/date';
11
- import { FsDateModule } from '@firestitch/date';
12
- import * as i1$1 from '@firestitch/country';
13
- import { FsCountryModule } from '@firestitch/country';
14
- import * as i5 from '@firestitch/device';
15
- import { FsDeviceModule } from '@firestitch/device';
16
- import * as i2 from '@angular/material/tooltip';
17
- import { MatTooltipModule } from '@angular/material/tooltip';
18
- import { Observable, Subject } from 'rxjs';
19
- import { takeUntil, map } from 'rxjs/operators';
20
- import * as i3 from '@firestitch/badge';
21
- import { FsBadgeModule } from '@firestitch/badge';
9
+ import * as i5 from '@angular/material/radio';
10
+ import { MatRadioModule } from '@angular/material/radio';
11
+ import * as i5$1 from '@angular/material/button';
12
+ import { MatButtonModule } from '@angular/material/button';
13
+ import * as i1$2 from '@angular/material/form-field';
14
+ import { MatFormFieldModule } from '@angular/material/form-field';
15
+ import * as i3$1 from '@angular/material/input';
16
+ import { MatInputModule } from '@angular/material/input';
17
+ import * as i4$1 from '@angular/material/checkbox';
18
+ import { MatCheckboxModule } from '@angular/material/checkbox';
19
+ import * as i6 from '@angular/material/progress-spinner';
20
+ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
21
+ import * as i8 from '@firestitch/form';
22
+ import { FsFormModule } from '@firestitch/form';
23
+ import * as i9 from '@firestitch/skeleton';
24
+ import { FsSkeletonModule } from '@firestitch/skeleton';
25
+ import * as i3 from '@firestitch/radiogroup';
26
+ import { FsRadioGroupModule } from '@firestitch/radiogroup';
27
+ import * as i1$1 from '@firestitch/dialog';
28
+ import { FsDialogModule } from '@firestitch/dialog';
29
+ import { tap, map, shareReplay, takeUntil, filter } from 'rxjs/operators';
30
+ import * as i1 from '@angular/material/dialog';
31
+ import { MAT_DIALOG_DATA } from '@angular/material/dialog';
32
+ import { Subject } from 'rxjs';
22
33
 
23
- class FsTrustedCurrentDeviceComponent {
24
- }
25
- FsTrustedCurrentDeviceComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsTrustedCurrentDeviceComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
26
- FsTrustedCurrentDeviceComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsTrustedCurrentDeviceComponent, selector: "fs-trusted-current-device", ngImport: i0, template: "\n<div class=\"current-device\">\n <mat-icon class=\"circle\">circle</mat-icon>\n <mat-icon \n class=\"check\"\n matTooltip=\"This device\">\n check_circle\n </mat-icon>\n</div>\n", styles: [".current-device{transform:scale(.8);z-index:1;position:relative}.current-device .check,.current-device .circle{position:absolute;color:#027db4;top:0}.current-device .circle{color:#fff}\n"], components: [{ type: i1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], directives: [{ type: i2.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
27
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsTrustedCurrentDeviceComponent, decorators: [{
28
- type: Component,
29
- args: [{
30
- selector: 'fs-trusted-current-device',
31
- templateUrl: './trusted-current-device.component.html',
32
- styleUrls: ['./trusted-current-device.component.scss'],
33
- changeDetection: ChangeDetectionStrategy.OnPush,
34
- }]
35
- }] });
34
+ const FS_2FA_VERIFICATION_PROVIDER = new InjectionToken('Provider for Verification service');
35
+
36
+ var FsVerificationMethodType;
37
+ (function (FsVerificationMethodType) {
38
+ FsVerificationMethodType["Sms"] = "sms";
39
+ FsVerificationMethodType["Email"] = "email";
40
+ FsVerificationMethodType["Authenticator"] = "authenticator";
41
+ FsVerificationMethodType["Code"] = "code";
42
+ })(FsVerificationMethodType || (FsVerificationMethodType = {}));
43
+
44
+ class Fs2FaVerificationMethodsComponent {
45
+ constructor(_verificationProvider, _dialogData, _dialogRef) {
46
+ this._verificationProvider = _verificationProvider;
47
+ this._dialogData = _dialogData;
48
+ this._dialogRef = _dialogRef;
49
+ this.verificationMethodType = FsVerificationMethodType;
50
+ this.setVerificationMethod = () => {
51
+ return this._verificationProvider
52
+ .updateVerificationMethod(this.method.id)
53
+ .pipe(tap((method) => {
54
+ this._dialogRef.close(method);
55
+ }));
56
+ };
57
+ this._setActiveMethod();
58
+ this._initMethods();
59
+ }
60
+ compareWith(o1, o2) {
61
+ return o1 && o2 && o1.id === o2.id;
62
+ }
63
+ _setActiveMethod() {
64
+ var _a;
65
+ this.method = (_a = this._dialogData) === null || _a === void 0 ? void 0 : _a.method;
66
+ }
67
+ _initMethods() {
68
+ this.methods$ = this._verificationProvider
69
+ .methods()
70
+ .pipe(map((methods) => {
71
+ return methods
72
+ .reduce((acc, method) => {
73
+ if (!acc[method.type]) {
74
+ acc[method.type] = [];
75
+ }
76
+ acc[method.type].push(method);
77
+ return acc;
78
+ }, {});
79
+ }), shareReplay(1));
80
+ }
81
+ }
82
+ Fs2FaVerificationMethodsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Fs2FaVerificationMethodsComponent, deps: [{ token: FS_2FA_VERIFICATION_PROVIDER }, { token: MAT_DIALOG_DATA }, { token: i1.MatDialogRef }], target: i0.ɵɵFactoryTarget.Component });
83
+ Fs2FaVerificationMethodsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: Fs2FaVerificationMethodsComponent, selector: "ng-component", ngImport: i0, template: "<fs-dialog>\n <h1 mat-dialog-title>\n Verification Methods\n </h1>\n <form fsForm [submit]=\"setVerificationMethod\" [dirtySubmitButton]=\"false\">\n <mat-dialog-content>\n <ng-container *fsSkeleton=\"methods$ | async as methods\">\n <fs-radio-group [(ngModel)]=\"method\" name=\"method\" [compareWith]=\"compareWith\">\n <ng-container *ngFor=\"let methodMap of methods | keyvalue\">\n <div class=\"method\">\n <ng-container [ngSwitch]=\"methodMap.key\">\n <ng-container *ngSwitchCase=\"verificationMethodType.Sms\">\n <div class=\"method-header\">\n <div class=\"method-icon\">\n <mat-icon>\n smartphone\n </mat-icon>\n </div>\n <div class=\"method-name\">\n <div class=\"method-title\">Text Message</div>\n <div class=\"method-subtitle\">\n Verification code send to one of following mobile number\n </div>\n </div>\n </div>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"verificationMethodType.Email\">\n <div class=\"method-header\">\n <div class=\"method-icon\">\n <mat-icon>\n mail\n </mat-icon>\n </div>\n <div class=\"method-name\">\n <div class=\"method-title\">Email</div>\n <div class=\"method-subtitle\">\n Verification code send to one of following email\n </div>\n </div>\n </div>\n </ng-container>\n </ng-container>\n\n <ng-container [ngSwitch]=\"methodMap.key\">\n <ng-container *ngSwitchCase=\"verificationMethodType.Sms\">\n <mat-radio-button class=\"method-item\" *ngFor=\"let method of methodMap.value\" [value]=\"method\">\n {{ method.phoneNumber }}\n </mat-radio-button>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"verificationMethodType.Email\">\n <mat-radio-button class=\"method-item\" *ngFor=\"let method of methodMap.value\" [value]=\"method\">\n {{ method.email }}\n </mat-radio-button>\n </ng-container>\n </ng-container>\n </div>\n </ng-container>\n </fs-radio-group>\n </ng-container>\n </mat-dialog-content>\n <mat-dialog-actions>\n <div class=\"actions\">\n <ng-container *ngIf=\"methods$ | async\">\n <button mat-button type=\"submit\" color=\"primary\">Next</button>\n </ng-container>\n <button mat-button type=\"button\" [mat-dialog-close]=\"null\">Cancel</button>\n </div>\n </mat-dialog-actions>\n </form>\n</fs-dialog>\n", styles: [".method{display:block;margin-bottom:20px}.method .method-header{display:flex;align-items:flex-start}.method .method-header .method-name{margin-left:10px}.method .method-header .method-name .method-title{font-size:14px;font-weight:400}.method .method-header .method-name .method-subtitle{font-size:12px;color:#a3a3a3}.method .method-item{display:block;margin:10px 0 0 35px}\n"], components: [{ type: i1$1.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode"] }, { type: i3.FsRadioGroupComponent, selector: "fs-radio-group", inputs: ["orientation", "radioPosition", "compareWith", "required", "disabled", "label", "name"] }, { type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i5.MatRadioButton, selector: "mat-radio-button", inputs: ["disableRipple", "tabIndex"], exportAs: ["matRadioButton"] }, { type: i5$1.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"] }], directives: [{ type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i7.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i7.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i7.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i8.FsFormDirective, selector: "[fsForm]", inputs: ["wrapperSelector", "messageSelector", "hintSelector", "labelSelector", "autocomplete", "shortcuts", "confirm", "confirmDialog", "confirmDrawer", "confirmBrowser", "confirmTabs", "dirtySubmitButton", "successDelay", "errorDelay", "submit", "tabGroup"], outputs: ["fsForm", "invalid", "valid", "submitted", "reseted", "cleared"] }, { type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i9.ɵa, selector: "[fsSkeleton]", inputs: ["fsSkeletonPattern", "fsSkeleton"] }, { type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i7.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i10.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i10.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }, { type: i10.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i8.ɵw, selector: "button[type=\"submit\"]", inputs: ["dirtySubmit", "name"] }, { type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["type", "mat-dialog-close", "aria-label", "matDialogClose"], exportAs: ["matDialogClose"] }], pipes: { "async": i10.AsyncPipe, "keyvalue": i10.KeyValuePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
84
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Fs2FaVerificationMethodsComponent, decorators: [{
85
+ type: Component,
86
+ args: [{
87
+ templateUrl: './2fa-verification-methods.component.html',
88
+ styleUrls: [
89
+ './2fa-verification-methods.component.scss',
90
+ ],
91
+ changeDetection: ChangeDetectionStrategy.OnPush,
92
+ }]
93
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
94
+ type: Inject,
95
+ args: [FS_2FA_VERIFICATION_PROVIDER]
96
+ }] }, { type: undefined, decorators: [{
97
+ type: Inject,
98
+ args: [MAT_DIALOG_DATA]
99
+ }] }, { type: i1.MatDialogRef }]; } });
100
+
101
+ class Fs2FAVerificationOTPComponent {
102
+ constructor(form) {
103
+ this.form = form;
104
+ this.codeChange = new EventEmitter();
105
+ }
106
+ codeChanged(event) {
107
+ this.codeChange.emit(event);
108
+ this.form.dirty();
109
+ }
110
+ codeCompleted() {
111
+ this.form.triggerSubmit();
112
+ }
113
+ }
114
+ Fs2FAVerificationOTPComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Fs2FAVerificationOTPComponent, deps: [{ token: i8.FsFormDirective }], target: i0.ɵɵFactoryTarget.Component });
115
+ Fs2FAVerificationOTPComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: Fs2FAVerificationOTPComponent, selector: "fs-2fa-verification-otp", outputs: { codeChange: "codeChange" }, ngImport: i0, template: "<p class=\"description\">\n Enter the verification code generated by your 2 factor authenticator\n app to verify it's you\n</p>\n\n<!--\n<code-input [initialFocusField]=\"0\"\n [codeLength]=\"6\"\n (codeChanged)=\"codeChanged($event)\"\n (codeCompleted)=\"codeCompleted()\">>\n</code-input>\n-->\n", styles: [":host{display:block}code-input{--item-spacing: 10px;--item-height: 20px;--item-border: none;--item-border-bottom: 2px solid #949494;--item-border-has-value: none;--item-border-bottom-has-value: 2px solid #949494;--item-border-focused: none;--item-border-bottom-focused: 2px solid #0061AF;--item-shadow-focused: none;--item-border-radius: 0px}code-input ::ng-deep span:first-child{padding-left:0!important}code-input ::ng-deep span:last-child{padding-right:0!important}code-input ::ng-deep input{font-size:20px!important;height:40px!important;padding:0!important}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
116
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Fs2FAVerificationOTPComponent, decorators: [{
117
+ type: Component,
118
+ args: [{
119
+ selector: 'fs-2fa-verification-otp',
120
+ templateUrl: './2fa-verification-otp.component.html',
121
+ styleUrls: [
122
+ './2fa-verification-otp.component.scss'
123
+ ],
124
+ changeDetection: ChangeDetectionStrategy.OnPush,
125
+ }]
126
+ }], ctorParameters: function () { return [{ type: i8.FsFormDirective }]; }, propDecorators: { codeChange: [{
127
+ type: Output
128
+ }] } });
36
129
 
37
- class FsTrustedDevicesComponent {
38
- constructor(_fsCountry) {
39
- this._fsCountry = _fsCountry;
40
- this.fetchTrustedDevices = (query) => new Observable();
41
- this.deleteTrustedDevice = (trustedDevice) => new Observable();
42
- this.signOutTrustedDevice = (trustedDevice) => new Observable();
43
- this.showAccount = true;
44
- this._destroy$ = new Subject();
45
- }
46
- ngOnInit() {
47
- this._fsCountry.ready$
48
- .pipe(takeUntil(this._destroy$))
49
- .subscribe(() => {
50
- this._initListConfig();
51
- });
52
- }
53
- ngOnDestroy() {
54
- this._destroy$.next();
55
- this._destroy$.complete();
56
- }
57
- _initListConfig() {
58
- this.listConfig = {
59
- rowActions: [
60
- {
61
- click: (data) => {
62
- this.signOutTrustedDevice(data)
63
- .subscribe(() => {
64
- this.reload();
65
- });
66
- },
67
- menu: true,
68
- label: 'Sign Out',
69
- },
70
- {
71
- click: (data) => {
72
- this.deleteTrustedDevice(data)
73
- .subscribe(() => {
74
- this.reload();
75
- });
76
- },
77
- remove: {
78
- title: 'Confirm',
79
- template: 'Are you sure you would like to delete this trusted device?',
80
- },
81
- menu: true,
82
- label: 'Delete',
83
- },
84
- ],
85
- fetch: (query) => {
86
- return this.fetchTrustedDevices(query)
87
- .pipe(map((response) => {
88
- return {
89
- data: response.data,
90
- paging: response.paging,
91
- };
92
- }));
93
- },
94
- };
95
- }
96
- reload() {
97
- this.listComponent.reload();
98
- }
99
- }
100
- FsTrustedDevicesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsTrustedDevicesComponent, deps: [{ token: i1$1.FsCountry }], target: i0.ɵɵFactoryTarget.Component });
101
- FsTrustedDevicesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsTrustedDevicesComponent, selector: "fs-trusted-devices", inputs: { fetchTrustedDevices: "fetchTrustedDevices", deleteTrustedDevice: "deleteTrustedDevice", signOutTrustedDevice: "signOutTrustedDevice", showAccount: "showAccount" }, viewQueries: [{ propertyName: "listComponent", first: true, predicate: FsListComponent, descendants: true }], ngImport: i0, template: "<fs-list [config]=\"listConfig\">\n <fs-list-column title=\"Account\" [show]=\"showAccount\">\n <ng-template fs-list-cell let-row=\"row\" class=\"col-account\">\n <div *ngIf=\"row.account\" class=\"row\">\n <fs-badge \n *ngIf=\"row.account.avatarUrl\"\n shape=\"circle\" \n image=\"{{ row.account.avatarUrl }}\">\n </fs-badge>\n <div>\n {{ row.account.name }}\n <div class=\"small\" *ngIf=\"row.account.email\">{{ row.account.email }}</div> \n </div>\n </div>\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"Device\">\n <ng-template fs-list-cell let-row=\"row\" class=\"col-device\">\n <div class=\"device\" *ngIf=\"row.device\">\n <fs-trusted-current-device *ngIf=\"row.currentDevice\"></fs-trusted-current-device>\n <fs-device-os\n [type]=\"row.device.type\"\n [os]=\"row.device.osType\"\n [version]=\"row.device.osVersion\">\n </fs-device-os>\n </div> \n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"Browser\">\n <ng-template fs-list-cell let-row=\"row\">\n <fs-device-browser\n *ngIf=\"row.device\"\n [type]=\"row.device.browserType\"\n [version]=\"row.device.browserVersion\"\n [showName]=\"true\"\n ></fs-device-browser>\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"Added\">\n <ng-template fs-list-cell let-row=\"row\">\n {{ row.createDate | fsDateAgo }}\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"Location\">\n <ng-template fs-list-cell let-row=\"row\">\n <!-- Use FsIp and pass in region, country, lat and lng -->\n <fs-country [code]=\"row.ip.country\"></fs-country>\n <div><small>{{row.ip.ip}}</small></div>\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"Last signed in\">\n <ng-template fs-list-cell let-row=\"row\">\n {{ row.activityDate | fsDateAgo }}\n </ng-template>\n </fs-list-column>\n</fs-list>\n", styles: [":host ::ng-deep .col-account .row{display:flex;align-items:center}:host ::ng-deep .col-account .row fs-badge{margin-right:5px}:host ::ng-deep .col-device .device{position:relative;display:inline-block}:host ::ng-deep .col-device .device .current-device{right:8px;top:-8px;position:absolute}\n"], components: [{ type: i2$1.FsListComponent, selector: "fs-list", inputs: ["loaderLines", "config"], outputs: ["filtersReady"] }, { type: i3.FsBadgeComponent, selector: "fs-badge", inputs: ["text", "shape", "color", "tooltip", "size", "image", "icon", "iconSize", "iconColor", "backgroundSize"] }, { type: FsTrustedCurrentDeviceComponent, selector: "fs-trusted-current-device" }, { type: i5.FsDeviceOsComponent, selector: "fs-device-os", inputs: ["type", "os", "showName", "version"] }, { type: i5.FsDeviceBrowserComponent, selector: "fs-device-browser", inputs: ["type", "version", "showName"] }, { type: i1$1.FsCountryComponent, selector: "fs-country", inputs: ["showIcon", "showName", "width", "code"] }], directives: [{ type: i2$1.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "customize", "title", "name", "sortable", "sortableDefault", "direction", "align", "width", "class"] }, { type: i2$1.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "fsDateAgo": i7.FsDateAgoPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
102
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsTrustedDevicesComponent, decorators: [{
103
- type: Component,
104
- args: [{
105
- selector: 'fs-trusted-devices',
106
- templateUrl: './trusted-devices.component.html',
107
- styleUrls: ['./trusted-devices.component.scss'],
108
- changeDetection: ChangeDetectionStrategy.OnPush,
109
- }]
110
- }], ctorParameters: function () { return [{ type: i1$1.FsCountry }]; }, propDecorators: { fetchTrustedDevices: [{
111
- type: Input
112
- }], deleteTrustedDevice: [{
113
- type: Input
114
- }], signOutTrustedDevice: [{
115
- type: Input
116
- }], showAccount: [{
117
- type: Input
118
- }], listComponent: [{
119
- type: ViewChild,
120
- args: [FsListComponent]
130
+ class Fs2FAVerificationSMSComponent {
131
+ constructor() {
132
+ this.codeChange = new EventEmitter();
133
+ }
134
+ codeChanged() {
135
+ this.codeChange.emit(this.code);
136
+ }
137
+ }
138
+ Fs2FAVerificationSMSComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Fs2FAVerificationSMSComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
139
+ Fs2FAVerificationSMSComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: Fs2FAVerificationSMSComponent, selector: "fs-2fa-verification-code", inputs: { method: "method" }, outputs: { codeChange: "codeChange" }, ngImport: i0, template: "<p class=\"description\">\n <ng-container *ngIf=\"method.phoneNumber && method.type === 'sms'\">\n A text message with a verification code was just\n sent to <span style=\"white-space: nowrap;\">{{ method.phoneNumber }}</span> to verify it's you.\n </ng-container>\n\n <ng-container *ngIf=\"method.type === 'email'\">\n A email with a verification code was just sent to {{ method.email }} to verify it's you.\n </ng-container>\n\n <ng-container *ngIf=\"false\">\n Enter the one time code generated by the app administrator to verify it's you.\n </ng-container>\n</p>\n\n<mat-form-field>\n <mat-label>Code</mat-label>\n <input type=\"text\"\n matInput\n name=\"code\"\n autocomplete=\"one-time-code\"\n [(ngModel)]=\"code\"\n (ngModelChange)=\"codeChanged()\"\n required\n placeholder=\"Enter the code\"\n inputmode=\"numeric\">\n</mat-form-field>\n", styles: [":host{display:block}mat-form-field{width:100%}\n"], components: [{ type: i1$2.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }], directives: [{ type: i10.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$2.MatLabel, selector: "mat-label" }, { type: i3$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["id", "disabled", "required", "type", "value", "readonly", "placeholder", "errorStateMatcher", "aria-describedby"], exportAs: ["matInput"] }, { type: i7.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i7.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i7.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i8.ɵf, selector: "[fsFormRequired],[ngModel][required]", inputs: ["fsFormRequired", "required", "fsFormRequiredMessage"] }], viewProviders: [
140
+ {
141
+ provide: ControlContainer,
142
+ useExisting: NgForm,
143
+ },
144
+ ], changeDetection: i0.ChangeDetectionStrategy.OnPush });
145
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Fs2FAVerificationSMSComponent, decorators: [{
146
+ type: Component,
147
+ args: [{
148
+ selector: 'fs-2fa-verification-code',
149
+ templateUrl: './2fa-verification-code.component.html',
150
+ styleUrls: [
151
+ './2fa-verification-code.component.scss',
152
+ ],
153
+ changeDetection: ChangeDetectionStrategy.OnPush,
154
+ viewProviders: [
155
+ {
156
+ provide: ControlContainer,
157
+ useExisting: NgForm,
158
+ },
159
+ ],
160
+ }]
161
+ }], propDecorators: { method: [{
162
+ type: Input
163
+ }], codeChange: [{
164
+ type: Output
121
165
  }] } });
122
166
 
123
- class Fs2FaModule {
124
- static forRoot() {
125
- return {
126
- ngModule: Fs2FaModule,
127
- };
128
- }
129
- }
130
- Fs2FaModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Fs2FaModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
131
- Fs2FaModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Fs2FaModule, declarations: [FsTrustedDevicesComponent,
132
- FsTrustedCurrentDeviceComponent], imports: [CommonModule,
133
- FlexLayoutModule,
134
- MatIconModule,
135
- MatTooltipModule,
136
- FsListModule,
137
- FsDateModule,
138
- FsCountryModule,
139
- FsDeviceModule,
140
- FsBadgeModule], exports: [FsTrustedDevicesComponent,
141
- FsTrustedCurrentDeviceComponent] });
142
- Fs2FaModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Fs2FaModule, imports: [[
143
- CommonModule,
144
- FlexLayoutModule,
145
- MatIconModule,
146
- MatTooltipModule,
147
- FsListModule,
148
- FsDateModule,
149
- FsCountryModule,
150
- FsDeviceModule,
151
- FsBadgeModule,
152
- ]] });
153
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Fs2FaModule, decorators: [{
154
- type: NgModule,
155
- args: [{
156
- imports: [
157
- CommonModule,
158
- FlexLayoutModule,
159
- MatIconModule,
160
- MatTooltipModule,
161
- FsListModule,
162
- FsDateModule,
163
- FsCountryModule,
164
- FsDeviceModule,
165
- FsBadgeModule,
166
- ],
167
- exports: [
168
- FsTrustedDevicesComponent,
169
- FsTrustedCurrentDeviceComponent,
170
- ],
171
- declarations: [
172
- FsTrustedDevicesComponent,
173
- FsTrustedCurrentDeviceComponent,
174
- ],
175
- }]
167
+ class Fs2FAVerificationComponent {
168
+ constructor(verificationProvider, _cdRef, _dialog) {
169
+ this.verificationProvider = verificationProvider;
170
+ this._cdRef = _cdRef;
171
+ this._dialog = _dialog;
172
+ this.verified = new EventEmitter();
173
+ this.backToSignIn = new EventEmitter();
174
+ this.resendInProgress = false;
175
+ this.trustedDevice = false;
176
+ this._destroy$ = new Subject();
177
+ this.verify = () => {
178
+ return this.verificationProvider
179
+ .verify(this._code, this.trustedDevice)
180
+ .pipe(tap((response) => {
181
+ this.verified.emit(response);
182
+ }));
183
+ };
184
+ }
185
+ ngOnDestroy() {
186
+ this._destroy$.next();
187
+ this._destroy$.complete();
188
+ }
189
+ codeChanged(code) {
190
+ this._code = code;
191
+ }
192
+ resend() {
193
+ this.resendInProgress = true;
194
+ this.verificationProvider
195
+ .resend()
196
+ .pipe(takeUntil(this._destroy$))
197
+ .subscribe(() => {
198
+ this.resendInProgress = false;
199
+ this._cdRef.markForCheck();
200
+ });
201
+ }
202
+ showVerificationMethods() {
203
+ this._dialog.open(Fs2FaVerificationMethodsComponent, {
204
+ data: {
205
+ method: this.method,
206
+ }
207
+ })
208
+ .afterClosed()
209
+ .pipe(filter((method) => !!method))
210
+ .subscribe((method) => {
211
+ this.method = method;
212
+ this._cdRef.markForCheck();
213
+ });
214
+ }
215
+ toSignIn() {
216
+ this.backToSignIn.emit();
217
+ }
218
+ }
219
+ Fs2FAVerificationComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Fs2FAVerificationComponent, deps: [{ token: FS_2FA_VERIFICATION_PROVIDER }, { token: i0.ChangeDetectorRef }, { token: i1$1.FsDialog }], target: i0.ɵɵFactoryTarget.Component });
220
+ Fs2FAVerificationComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: Fs2FAVerificationComponent, selector: "fs-2fa-verification", inputs: { method: "method" }, outputs: { verified: "verified", backToSignIn: "backToSignIn" }, ngImport: i0, template: "<form fsForm [submit]=\"verify\" [dirtySubmitButton]=\"false\">\n <h2>2-Step Verification</h2>\n\n <div class=\"code-container\">\n <ng-container *ngIf=\"method.type === 'authenticator' else code\">\n <fs-2fa-verification-otp class=\"otp\"></fs-2fa-verification-otp>\n </ng-container>\n\n <ng-template #code>\n <fs-2fa-verification-code\n [method]=\"method\"\n (codeChange)=\"codeChanged($event)\">\n </fs-2fa-verification-code>\n </ng-template>\n </div>\n\n <div class=\"additional\">\n <mat-checkbox\n name=\"trust-device\"\n [(ngModel)]=\"trustedDevice\">\n Trust this device\n </mat-checkbox>\n\n <span matSuffix>\n <a mat-button\n type=\"button\"\n color=\"primary\"\n (click)=\"resend()\"\n [disabled]=\"resendInProgress\"\n class=\"resend-code-btn\">\n <ng-container *ngIf=\"!resendInProgress else sending\">\n Resend Code\n </ng-container>\n <ng-template #sending>\n <mat-spinner [diameter]=\"12\"></mat-spinner> Sending\n </ng-template>\n </a>\n </span>\n </div>\n\n <div class=\"actions\">\n <button mat-raised-button\n color=\"primary\"\n type=\"submit\">\n Verify\n </button>\n\n <button mat-button type=\"button\" (click)=\"showVerificationMethods()\">\n Try other ways to verify\n </button>\n\n <button mat-button type=\"button\" (click)=\"toSignIn()\">\n Back to signin\n </button>\n </div>\n</form>\n", styles: [":host{display:block}h2,.code-container{text-align:center}.code-container .otp{margin-bottom:15px}:host ::ng-deep .actions{margin:10px 0}:host ::ng-deep .actions a{width:100%;font-weight:400}:host ::ng-deep .actions button{width:100%;margin-bottom:5px}:host ::ng-deep .actions button[type=button]{font-weight:400}.additional{display:flex;justify-content:space-between;align-items:baseline;margin-top:-5px}.additional .resend-code-btn{text-transform:none}.additional .resend-code-btn mat-spinner{display:inline-block;vertical-align:middle}\n"], components: [{ type: Fs2FAVerificationOTPComponent, selector: "fs-2fa-verification-otp", outputs: ["codeChange"] }, { type: Fs2FAVerificationSMSComponent, selector: "fs-2fa-verification-code", inputs: ["method"], outputs: ["codeChange"] }, { type: i4$1.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex", "aria-label", "aria-labelledby", "id", "labelPosition", "name", "required", "checked", "disabled", "indeterminate", "aria-describedby", "value"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { type: i5$1.MatAnchor, selector: "a[mat-button], a[mat-raised-button], a[mat-icon-button], a[mat-fab], a[mat-mini-fab], a[mat-stroked-button], a[mat-flat-button]", inputs: ["disabled", "disableRipple", "color", "tabIndex"], exportAs: ["matButton", "matAnchor"] }, { type: i6.MatSpinner, selector: "mat-spinner", inputs: ["color"] }, { type: i5$1.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"] }], directives: [{ type: i7.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i7.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i7.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i8.FsFormDirective, selector: "[fsForm]", inputs: ["wrapperSelector", "messageSelector", "hintSelector", "labelSelector", "autocomplete", "shortcuts", "confirm", "confirmDialog", "confirmDrawer", "confirmBrowser", "confirmTabs", "dirtySubmitButton", "successDelay", "errorDelay", "submit", "tabGroup"], outputs: ["fsForm", "invalid", "valid", "submitted", "reseted", "cleared"] }, { type: i10.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i7.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i1$2.MatSuffix, selector: "[matSuffix]" }, { type: i8.ɵw, selector: "button[type=\"submit\"]", inputs: ["dirtySubmit", "name"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
221
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Fs2FAVerificationComponent, decorators: [{
222
+ type: Component,
223
+ args: [{
224
+ selector: 'fs-2fa-verification',
225
+ templateUrl: './2fa-verification.component.html',
226
+ styleUrls: [
227
+ './2fa-verification.component.scss',
228
+ ],
229
+ changeDetection: ChangeDetectionStrategy.OnPush,
230
+ }]
231
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
232
+ type: Inject,
233
+ args: [FS_2FA_VERIFICATION_PROVIDER]
234
+ }] }, { type: i0.ChangeDetectorRef }, { type: i1$1.FsDialog }]; }, propDecorators: { method: [{
235
+ type: Input
236
+ }], verified: [{
237
+ type: Output
238
+ }], backToSignIn: [{
239
+ type: Output
240
+ }] } });
241
+
242
+ class Fs2FaModule {
243
+ }
244
+ Fs2FaModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Fs2FaModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
245
+ Fs2FaModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Fs2FaModule, declarations: [Fs2FAVerificationComponent,
246
+ Fs2FAVerificationSMSComponent,
247
+ Fs2FAVerificationOTPComponent,
248
+ Fs2FaVerificationMethodsComponent], imports: [CommonModule,
249
+ FormsModule,
250
+ MatFormFieldModule,
251
+ MatInputModule,
252
+ MatButtonModule,
253
+ FsFormModule,
254
+ FsRadioGroupModule,
255
+ FsDialogModule,
256
+ // CodeInputModule,
257
+ MatCheckboxModule,
258
+ MatProgressSpinnerModule,
259
+ FsSkeletonModule,
260
+ FsSkeletonModule,
261
+ MatIconModule,
262
+ MatRadioModule], exports: [Fs2FAVerificationComponent] });
263
+ Fs2FaModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Fs2FaModule, providers: [], imports: [[
264
+ CommonModule,
265
+ FormsModule,
266
+ MatFormFieldModule,
267
+ MatInputModule,
268
+ MatButtonModule,
269
+ FsFormModule,
270
+ FsRadioGroupModule,
271
+ FsDialogModule,
272
+ // CodeInputModule,
273
+ MatCheckboxModule,
274
+ MatProgressSpinnerModule,
275
+ FsSkeletonModule,
276
+ FsSkeletonModule,
277
+ MatIconModule,
278
+ MatRadioModule,
279
+ ]] });
280
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Fs2FaModule, decorators: [{
281
+ type: NgModule,
282
+ args: [{
283
+ imports: [
284
+ CommonModule,
285
+ FormsModule,
286
+ MatFormFieldModule,
287
+ MatInputModule,
288
+ MatButtonModule,
289
+ FsFormModule,
290
+ FsRadioGroupModule,
291
+ FsDialogModule,
292
+ // CodeInputModule,
293
+ MatCheckboxModule,
294
+ MatProgressSpinnerModule,
295
+ FsSkeletonModule,
296
+ FsSkeletonModule,
297
+ MatIconModule,
298
+ MatRadioModule,
299
+ ],
300
+ declarations: [
301
+ Fs2FAVerificationComponent,
302
+ Fs2FAVerificationSMSComponent,
303
+ Fs2FAVerificationOTPComponent,
304
+ Fs2FaVerificationMethodsComponent,
305
+ ],
306
+ exports: [
307
+ Fs2FAVerificationComponent,
308
+ ],
309
+ providers: [],
310
+ }]
176
311
  }] });
177
312
 
178
- /**
179
- * Generated bundle index. Do not edit.
313
+ /*
314
+ * Public API Surface of fs-2fa
315
+ */
316
+
317
+ /**
318
+ * Generated bundle index. Do not edit.
180
319
  */
181
320
 
182
- export { Fs2FaModule, FsTrustedCurrentDeviceComponent, FsTrustedDevicesComponent };
321
+ export { FS_2FA_VERIFICATION_PROVIDER, Fs2FAVerificationComponent, Fs2FaModule, FsVerificationMethodType };
183
322
  //# sourceMappingURL=firestitch-2fa.js.map