@firestitch/2fa 12.9.5 → 12.9.6

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 (91) hide show
  1. package/app/enums/index.d.ts +1 -1
  2. package/app/enums/verification-method-type.enum.d.ts +5 -5
  3. package/app/interfaces/index.d.ts +1 -1
  4. package/app/interfaces/verification-method.interface.d.ts +11 -11
  5. package/app/modules/code-input/code-input.module.d.ts +8 -8
  6. package/app/modules/code-input/components/code-input/code-input.component.d.ts +13 -13
  7. package/app/modules/code-input/components/code-input/index.d.ts +1 -1
  8. package/app/modules/code-input/index.d.ts +1 -1
  9. package/app/modules/defaulted/components/defaulted/defaulted.component.d.ts +5 -5
  10. package/app/modules/defaulted/components/defaulted/index.d.ts +1 -1
  11. package/app/modules/defaulted/defaulted.module.d.ts +7 -7
  12. package/app/modules/manage/components/2fa-manage/2fa-manage.component.d.ts +30 -30
  13. package/app/modules/manage/components/2fa-manage/index.d.ts +1 -1
  14. package/app/modules/manage/components/app/app.component.d.ts +32 -32
  15. package/app/modules/manage/components/app/index.d.ts +1 -1
  16. package/app/modules/manage/components/email/email.component.d.ts +27 -27
  17. package/app/modules/manage/components/email/index.d.ts +1 -1
  18. package/app/modules/manage/components/emails/emails.component.d.ts +19 -19
  19. package/app/modules/manage/components/emails/index.d.ts +1 -1
  20. package/app/modules/manage/components/manage-methods/index.d.ts +1 -1
  21. package/app/modules/manage/components/manage-methods/manage-methods.component.d.ts +35 -35
  22. package/app/modules/manage/components/number/index.d.ts +1 -1
  23. package/app/modules/manage/components/number/number.component.d.ts +28 -28
  24. package/app/modules/manage/components/numbers/index.d.ts +1 -1
  25. package/app/modules/manage/components/numbers/numbers.component.d.ts +20 -20
  26. package/app/modules/manage/fs-2f-manage.module.d.ts +33 -33
  27. package/app/modules/manage/services/index.d.ts +1 -1
  28. package/app/modules/manage/services/two-factor-manage.service.d.ts +52 -52
  29. package/app/modules/resend/components/resend/index.d.ts +1 -1
  30. package/app/modules/resend/components/resend/resend.component.d.ts +14 -14
  31. package/app/modules/resend/resend.module.d.ts +9 -9
  32. package/app/modules/verification/components/2fa-verification/2fa-verification.component.d.ts +38 -38
  33. package/app/modules/verification/components/2fa-verification-code/2fa-verification-code.component.d.ts +20 -20
  34. package/app/modules/verification/components/2fa-verification-methods/2fa-verification-methods.component.d.ts +22 -22
  35. package/app/modules/verification/directives/2fa-verification-resend.directive.d.ts +11 -11
  36. package/app/modules/verification/directives/index.d.ts +1 -1
  37. package/app/modules/verification/fs-2fa-verification.module.d.ts +25 -25
  38. package/app/modules/verification-methods/components/verification-methods/index.d.ts +1 -1
  39. package/app/modules/verification-methods/components/verification-methods/verification-methods.component.d.ts +26 -26
  40. package/app/modules/verification-methods/fs-2f-verification-methods.module.d.ts +14 -14
  41. package/app/modules/verification-methods/index.d.ts +1 -1
  42. package/bundles/firestitch-2fa.umd.js +1429 -1429
  43. package/bundles/firestitch-2fa.umd.js.map +1 -1
  44. package/esm2015/app/enums/index.js +1 -1
  45. package/esm2015/app/enums/verification-method-type.enum.js +6 -6
  46. package/esm2015/app/interfaces/index.js +1 -1
  47. package/esm2015/app/interfaces/verification-method.interface.js +1 -1
  48. package/esm2015/app/modules/code-input/code-input.module.js +25 -25
  49. package/esm2015/app/modules/code-input/components/code-input/code-input.component.js +35 -35
  50. package/esm2015/app/modules/code-input/components/code-input/index.js +1 -1
  51. package/esm2015/app/modules/code-input/index.js +1 -1
  52. package/esm2015/app/modules/defaulted/components/defaulted/defaulted.component.js +15 -15
  53. package/esm2015/app/modules/defaulted/components/defaulted/index.js +1 -1
  54. package/esm2015/app/modules/defaulted/defaulted.module.js +17 -17
  55. package/esm2015/app/modules/manage/components/2fa-manage/2fa-manage.component.js +103 -103
  56. package/esm2015/app/modules/manage/components/2fa-manage/index.js +1 -1
  57. package/esm2015/app/modules/manage/components/app/app.component.js +83 -83
  58. package/esm2015/app/modules/manage/components/app/index.js +1 -1
  59. package/esm2015/app/modules/manage/components/email/email.component.js +82 -82
  60. package/esm2015/app/modules/manage/components/email/index.js +1 -1
  61. package/esm2015/app/modules/manage/components/emails/emails.component.js +49 -49
  62. package/esm2015/app/modules/manage/components/emails/index.js +1 -1
  63. package/esm2015/app/modules/manage/components/manage-methods/index.js +1 -1
  64. package/esm2015/app/modules/manage/components/manage-methods/manage-methods.component.js +127 -127
  65. package/esm2015/app/modules/manage/components/number/index.js +1 -1
  66. package/esm2015/app/modules/manage/components/number/number.component.js +85 -85
  67. package/esm2015/app/modules/manage/components/numbers/index.js +1 -1
  68. package/esm2015/app/modules/manage/components/numbers/numbers.component.js +50 -50
  69. package/esm2015/app/modules/manage/fs-2f-manage.module.js +117 -117
  70. package/esm2015/app/modules/manage/services/index.js +1 -1
  71. package/esm2015/app/modules/manage/services/two-factor-manage.service.js +160 -160
  72. package/esm2015/app/modules/resend/components/resend/index.js +1 -1
  73. package/esm2015/app/modules/resend/components/resend/resend.component.js +39 -39
  74. package/esm2015/app/modules/resend/resend.module.js +29 -29
  75. package/esm2015/app/modules/verification/components/2fa-verification/2fa-verification.component.js +127 -127
  76. package/esm2015/app/modules/verification/components/2fa-verification-code/2fa-verification-code.component.js +60 -60
  77. package/esm2015/app/modules/verification/components/2fa-verification-methods/2fa-verification-methods.component.js +62 -62
  78. package/esm2015/app/modules/verification/directives/2fa-verification-resend.directive.js +31 -31
  79. package/esm2015/app/modules/verification/directives/index.js +1 -1
  80. package/esm2015/app/modules/verification/fs-2fa-verification.module.js +96 -96
  81. package/esm2015/app/modules/verification-methods/components/verification-methods/index.js +1 -1
  82. package/esm2015/app/modules/verification-methods/components/verification-methods/verification-methods.component.js +121 -121
  83. package/esm2015/app/modules/verification-methods/fs-2f-verification-methods.module.js +47 -47
  84. package/esm2015/app/modules/verification-methods/index.js +1 -1
  85. package/esm2015/firestitch-2fa.js +4 -4
  86. package/esm2015/public_api.js +8 -8
  87. package/fesm2015/firestitch-2fa.js +1280 -1280
  88. package/fesm2015/firestitch-2fa.js.map +1 -1
  89. package/firestitch-2fa.d.ts +5 -5
  90. package/package.json +1 -1
  91. package/public_api.d.ts +9 -9
@@ -45,1332 +45,1332 @@ import * as i4$1 from 'ng-qrcode';
45
45
  import { QrCodeModule } from 'ng-qrcode';
46
46
  import * as i1$3 from '@firestitch/prompt';
47
47
 
48
- var VerificationMethodType;
49
- (function (VerificationMethodType) {
50
- VerificationMethodType["Sms"] = "sms";
51
- VerificationMethodType["Email"] = "email";
52
- VerificationMethodType["App"] = "app";
48
+ var VerificationMethodType;
49
+ (function (VerificationMethodType) {
50
+ VerificationMethodType["Sms"] = "sms";
51
+ VerificationMethodType["Email"] = "email";
52
+ VerificationMethodType["App"] = "app";
53
53
  })(VerificationMethodType || (VerificationMethodType = {}));
54
54
 
55
- class Fs2faVerificationMethodsComponent {
56
- constructor(_dialogData, _dialogRef) {
57
- this._dialogData = _dialogData;
58
- this._dialogRef = _dialogRef;
59
- this.verificationMethodType = VerificationMethodType;
60
- this.setVerificationMethod = () => {
61
- return this._selectVerificationMethod(this.verificationMethod)
62
- .pipe(tap((method) => {
63
- this._dialogRef.close(method);
64
- }));
65
- };
66
- this._selectVerificationMethod = _dialogData.selectVerificationMethod;
67
- this._setActiveMethod();
68
- this._initMethods(_dialogData.verificationMethods);
69
- }
70
- compareWith(o1, o2) {
71
- return o1 && o2 && o1.id === o2.id;
72
- }
73
- _setActiveMethod() {
74
- var _a;
75
- this.verificationMethod = (_a = this._dialogData) === null || _a === void 0 ? void 0 : _a.verificationMethod;
76
- }
77
- _initMethods(verificationMethods) {
78
- this.verificationMethods = verificationMethods
79
- .reduce((acc, method) => {
80
- if (!acc[method.type]) {
81
- acc[method.type] = [];
82
- }
83
- acc[method.type].push(method);
84
- return acc;
85
- }, {});
86
- }
87
- }
88
- Fs2faVerificationMethodsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Fs2faVerificationMethodsComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: i1.MatDialogRef }], target: i0.ɵɵFactoryTarget.Component });
89
- 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>\n <fs-radio-group [(ngModel)]=\"verificationMethod\" name=\"method\" [compareWith]=\"compareWith\">\n <ng-container *ngFor=\"let methodMap of verificationMethods | 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 textsms\n </mat-icon>\n </div>\n <div class=\"method-name\">\n <div class=\"method-title\">Text Message</div>\n <div class=\"method-subtitle\">\n Send verification code to a 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 Send verification code to an email address\n </div>\n </div>\n </div>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"verificationMethodType.App\">\n <div class=\"method-header\">\n <div class=\"method-icon\">\n <mat-icon>\n phone_iphone\n </mat-icon>\n </div>\n <div class=\"method-name\">\n <div class=\"method-title\">Authenticator App</div>\n <div class=\"method-subtitle\">\n Send verification code to your authenticator app\n </div>\n </div>\n </div>\n </ng-container> \n </ng-container>\n\n <mat-radio-button class=\"method-item\" *ngFor=\"let method of methodMap.value\" [value]=\"method\">\n <ng-container [ngSwitch]=\"methodMap.key\">\n <ng-container *ngSwitchCase=\"verificationMethodType.Sms\">\n {{ method.phoneNumber }}\n </ng-container>\n <ng-container *ngSwitchCase=\"verificationMethodType.Email\">\n {{ method.email }}\n </ng-container>\n <ng-container *ngSwitchCase=\"verificationMethodType.App\">\n Authenticator App\n </ng-container> \n </ng-container>\n </mat-radio-button>\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 <button mat-button type=\"submit\" color=\"primary\">Next</button>\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: i3.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode"] }, { type: i3$1.FsRadioGroupComponent, selector: "fs-radio-group", inputs: ["orientation", "label", "name", "disabled", "radioPosition", "compareWith", "required"] }, { 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: i6.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: i8.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i8.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i8.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i9.FsFormDirective, selector: "[fsForm]", inputs: ["wrapperSelector", "messageSelector", "hintSelector", "labelSelector", "autocomplete", "shortcuts", "confirm", "confirmDialog", "confirmDrawer", "confirmBrowser", "confirmTabs", "dirtySubmitButton", "submit", "successDelay", "errorDelay", "tabGroup"], outputs: ["fsForm", "invalid", "valid", "submitted", "reseted", "cleared"] }, { type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i8.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i8.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i9.FsFormNoFsValidatorsDirective, selector: "[ngModel]:not([required]):not([fsFormRequired]):not([fsFormCompare]):not([fsFormDateRange]):not([fsFormEmail]):not([fsFormEmails]):not([fsFormFunction]):not([fsFormGreater]):not([fsFormInteger]):not([fsFormLesser]):not([fsFormMax]):not([fsFormMaxLength]):not([fsFormMin]):not([fsFormMinLength]):not([fsFormNumeric]):not([fsFormPattern]):not([fsFormPhone]):not([fsFormUrl]):not([validate])" }, { type: i9$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i9$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i9$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }, { type: i9.FsSubmitButtonDirective, selector: "button[type=\"submit\"]", inputs: ["name", "dirtySubmit"] }, { type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["type", "mat-dialog-close", "aria-label", "matDialogClose"], exportAs: ["matDialogClose"] }], pipes: { "keyvalue": i9$1.KeyValuePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
90
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Fs2faVerificationMethodsComponent, decorators: [{
91
- type: Component,
92
- args: [{
93
- templateUrl: './2fa-verification-methods.component.html',
94
- styleUrls: [
95
- './2fa-verification-methods.component.scss',
96
- ],
97
- changeDetection: ChangeDetectionStrategy.OnPush,
98
- }]
99
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
100
- type: Inject,
101
- args: [MAT_DIALOG_DATA]
55
+ class Fs2faVerificationMethodsComponent {
56
+ constructor(_dialogData, _dialogRef) {
57
+ this._dialogData = _dialogData;
58
+ this._dialogRef = _dialogRef;
59
+ this.verificationMethodType = VerificationMethodType;
60
+ this.setVerificationMethod = () => {
61
+ return this._selectVerificationMethod(this.verificationMethod)
62
+ .pipe(tap((method) => {
63
+ this._dialogRef.close(method);
64
+ }));
65
+ };
66
+ this._selectVerificationMethod = _dialogData.selectVerificationMethod;
67
+ this._setActiveMethod();
68
+ this._initMethods(_dialogData.verificationMethods);
69
+ }
70
+ compareWith(o1, o2) {
71
+ return o1 && o2 && o1.id === o2.id;
72
+ }
73
+ _setActiveMethod() {
74
+ var _a;
75
+ this.verificationMethod = (_a = this._dialogData) === null || _a === void 0 ? void 0 : _a.verificationMethod;
76
+ }
77
+ _initMethods(verificationMethods) {
78
+ this.verificationMethods = verificationMethods
79
+ .reduce((acc, method) => {
80
+ if (!acc[method.type]) {
81
+ acc[method.type] = [];
82
+ }
83
+ acc[method.type].push(method);
84
+ return acc;
85
+ }, {});
86
+ }
87
+ }
88
+ Fs2faVerificationMethodsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Fs2faVerificationMethodsComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: i1.MatDialogRef }], target: i0.ɵɵFactoryTarget.Component });
89
+ 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>\n <fs-radio-group [(ngModel)]=\"verificationMethod\" name=\"method\" [compareWith]=\"compareWith\">\n <ng-container *ngFor=\"let methodMap of verificationMethods | 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 textsms\n </mat-icon>\n </div>\n <div class=\"method-name\">\n <div class=\"method-title\">Text Message</div>\n <div class=\"method-subtitle\">\n Send verification code to a 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 Send verification code to an email address\n </div>\n </div>\n </div>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"verificationMethodType.App\">\n <div class=\"method-header\">\n <div class=\"method-icon\">\n <mat-icon>\n phone_iphone\n </mat-icon>\n </div>\n <div class=\"method-name\">\n <div class=\"method-title\">Authenticator App</div>\n <div class=\"method-subtitle\">\n Send verification code to your authenticator app\n </div>\n </div>\n </div>\n </ng-container> \n </ng-container>\n\n <mat-radio-button class=\"method-item\" *ngFor=\"let method of methodMap.value\" [value]=\"method\">\n <ng-container [ngSwitch]=\"methodMap.key\">\n <ng-container *ngSwitchCase=\"verificationMethodType.Sms\">\n {{ method.phoneNumber }}\n </ng-container>\n <ng-container *ngSwitchCase=\"verificationMethodType.Email\">\n {{ method.email }}\n </ng-container>\n <ng-container *ngSwitchCase=\"verificationMethodType.App\">\n Authenticator App\n </ng-container> \n </ng-container>\n </mat-radio-button>\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 <button mat-button type=\"submit\" color=\"primary\">Next</button>\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: i3.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode"] }, { type: i3$1.FsRadioGroupComponent, selector: "fs-radio-group", inputs: ["orientation", "label", "name", "disabled", "radioPosition", "compareWith", "required"] }, { 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: i6.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: i8.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i8.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i8.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i9.FsFormDirective, selector: "[fsForm]", inputs: ["wrapperSelector", "messageSelector", "hintSelector", "labelSelector", "autocomplete", "shortcuts", "confirm", "confirmDialog", "confirmDrawer", "confirmBrowser", "confirmTabs", "dirtySubmitButton", "submit", "successDelay", "errorDelay", "tabGroup"], outputs: ["fsForm", "invalid", "valid", "submitted", "reseted", "cleared"] }, { type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i8.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i8.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i9.FsFormNoFsValidatorsDirective, selector: "[ngModel]:not([required]):not([fsFormRequired]):not([fsFormCompare]):not([fsFormDateRange]):not([fsFormEmail]):not([fsFormEmails]):not([fsFormFunction]):not([fsFormGreater]):not([fsFormInteger]):not([fsFormLesser]):not([fsFormMax]):not([fsFormMaxLength]):not([fsFormMin]):not([fsFormMinLength]):not([fsFormNumeric]):not([fsFormPattern]):not([fsFormPhone]):not([fsFormUrl]):not([validate])" }, { type: i9$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i9$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i9$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }, { type: i9.FsSubmitButtonDirective, selector: "button[type=\"submit\"]", inputs: ["name", "dirtySubmit"] }, { type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["type", "mat-dialog-close", "aria-label", "matDialogClose"], exportAs: ["matDialogClose"] }], pipes: { "keyvalue": i9$1.KeyValuePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
90
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Fs2faVerificationMethodsComponent, decorators: [{
91
+ type: Component,
92
+ args: [{
93
+ templateUrl: './2fa-verification-methods.component.html',
94
+ styleUrls: [
95
+ './2fa-verification-methods.component.scss',
96
+ ],
97
+ changeDetection: ChangeDetectionStrategy.OnPush,
98
+ }]
99
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
100
+ type: Inject,
101
+ args: [MAT_DIALOG_DATA]
102
102
  }] }, { type: i1.MatDialogRef }]; } });
103
103
 
104
- class CodeInputComponent {
105
- constructor() {
106
- this.codeCompleted = new EventEmitter();
107
- this.codeChanged = new EventEmitter();
108
- }
109
- focus() {
110
- this.angularCodeInputComponent.focusOnField(0);
111
- }
112
- }
113
- CodeInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: CodeInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
114
- CodeInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: CodeInputComponent, selector: "app-code-input", inputs: { codeLength: "codeLength", code: "code" }, outputs: { codeCompleted: "codeCompleted", codeChanged: "codeChanged" }, viewQueries: [{ propertyName: "angularCodeInputComponent", first: true, predicate: CodeInputComponent$1, descendants: true }], ngImport: i0, template: "<code-input\n [initialFocusField]=\"0\"\n [codeLength]=\"6\"\n [code]=\"code\"\n [isPrevFocusableAfterClearing]=\"false\"\n (codeCompleted)=\"codeCompleted.emit($event)\"\n (codeChanged)=\"codeChanged.emit($event)\">\n</code-input>\n", styles: ["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"], components: [{ type: i1$1.CodeInputComponent, selector: "code-input", inputs: ["isNonDigitsCode", "codeLength", "inputType", "initialFocusField", "isCharsCode", "isCodeHidden", "isPrevFocusableAfterClearing", "isFocusingOnLastByClickIfFilled", "code", "disabled", "autocapitalize"], outputs: ["codeChanged", "codeCompleted"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
115
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: CodeInputComponent, decorators: [{
116
- type: Component,
117
- args: [{
118
- selector: 'app-code-input',
119
- templateUrl: './code-input.component.html',
120
- styleUrls: ['./code-input.component.scss'],
121
- changeDetection: ChangeDetectionStrategy.OnPush,
122
- }]
123
- }], propDecorators: { angularCodeInputComponent: [{
124
- type: ViewChild,
125
- args: [CodeInputComponent$1]
126
- }], codeLength: [{
127
- type: Input
128
- }], code: [{
129
- type: Input
130
- }], codeCompleted: [{
131
- type: Output
132
- }], codeChanged: [{
133
- type: Output
104
+ class CodeInputComponent {
105
+ constructor() {
106
+ this.codeCompleted = new EventEmitter();
107
+ this.codeChanged = new EventEmitter();
108
+ }
109
+ focus() {
110
+ this.angularCodeInputComponent.focusOnField(0);
111
+ }
112
+ }
113
+ CodeInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: CodeInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
114
+ CodeInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: CodeInputComponent, selector: "app-code-input", inputs: { codeLength: "codeLength", code: "code" }, outputs: { codeCompleted: "codeCompleted", codeChanged: "codeChanged" }, viewQueries: [{ propertyName: "angularCodeInputComponent", first: true, predicate: CodeInputComponent$1, descendants: true }], ngImport: i0, template: "<code-input\n [initialFocusField]=\"0\"\n [codeLength]=\"6\"\n [code]=\"code\"\n [isPrevFocusableAfterClearing]=\"false\"\n (codeCompleted)=\"codeCompleted.emit($event)\"\n (codeChanged)=\"codeChanged.emit($event)\">\n</code-input>\n", styles: ["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"], components: [{ type: i1$1.CodeInputComponent, selector: "code-input", inputs: ["isNonDigitsCode", "codeLength", "inputType", "initialFocusField", "isCharsCode", "isCodeHidden", "isPrevFocusableAfterClearing", "isFocusingOnLastByClickIfFilled", "code", "disabled", "autocapitalize"], outputs: ["codeChanged", "codeCompleted"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
115
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: CodeInputComponent, decorators: [{
116
+ type: Component,
117
+ args: [{
118
+ selector: 'app-code-input',
119
+ templateUrl: './code-input.component.html',
120
+ styleUrls: ['./code-input.component.scss'],
121
+ changeDetection: ChangeDetectionStrategy.OnPush,
122
+ }]
123
+ }], propDecorators: { angularCodeInputComponent: [{
124
+ type: ViewChild,
125
+ args: [CodeInputComponent$1]
126
+ }], codeLength: [{
127
+ type: Input
128
+ }], code: [{
129
+ type: Input
130
+ }], codeCompleted: [{
131
+ type: Output
132
+ }], codeChanged: [{
133
+ type: Output
134
134
  }] } });
135
135
 
136
- class Fs2faVerificationCodeComponent {
137
- constructor(_form) {
138
- this._form = _form;
139
- this.codeChanged = new EventEmitter();
140
- this.codeCompleted = new EventEmitter();
141
- this.VerificationMethodType = VerificationMethodType;
142
- }
143
- codeChange(code) {
144
- this.code = code;
145
- this.codeChanged.emit(this.code);
146
- this._form.dirty();
147
- }
148
- focus() {
149
- this.codeInputComponent.focus();
150
- }
151
- }
152
- Fs2faVerificationCodeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Fs2faVerificationCodeComponent, deps: [{ token: i9.FsFormDirective }], target: i0.ɵɵFactoryTarget.Component });
153
- Fs2faVerificationCodeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: Fs2faVerificationCodeComponent, selector: "fs-2fa-verification-code", inputs: { type: "type", recipient: "recipient", code: "code" }, outputs: { codeChanged: "codeChanged", codeCompleted: "codeCompleted" }, viewQueries: [{ propertyName: "codeInputComponent", first: true, predicate: CodeInputComponent, descendants: true }], ngImport: i0, template: "<ng-container *ngIf=\"type === VerificationMethodType.Sms\">\n <p class=\"description\">\n A text message with a verification code was just sent to <span style=\"white-space: nowrap;\">{{ recipient }}</span> to verify it's you.\n </p>\n\n <ng-container *ngTemplateOutlet=\"input\"></ng-container>\n</ng-container>\n\n<ng-container *ngIf=\"type === VerificationMethodType.Email\">\n <p class=\"description\">\n An email with a verification code was just sent to {{ recipient }} to verify it's you.\n </p>\n <ng-container *ngTemplateOutlet=\"input\"></ng-container>\n</ng-container>\n\n<ng-container *ngIf=\"type === VerificationMethodType.App\">\n <p class=\"description\">\n Enter the verification code generated by your 2 factor authenticator app to verify it's you.\n </p>\n <ng-container *ngTemplateOutlet=\"input\"></ng-container>\n</ng-container>\n\n<ng-template #input> \n <app-code-input \n [code]=\"code\"\n (codeChanged)=\"codeChange($event)\"\n (codeCompleted)=\"codeCompleted.emit()\">\n </app-code-input> \n</ng-template> ", styles: ["mat-form-field{width:100%}mat-form-field ::ng-deep .mat-form-field-subscript-wrapper{min-height:unset!important}mat-form-field ::ng-deep .mat-form-field-subscript-wrapper .fs-form-error{padding-bottom:5px}app-code-input{margin-bottom:5px}\n"], components: [{ type: CodeInputComponent, selector: "app-code-input", inputs: ["codeLength", "code"], outputs: ["codeCompleted", "codeChanged"] }], directives: [{ type: i9$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i9$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], viewProviders: [
154
- {
155
- provide: ControlContainer,
156
- useExisting: NgForm,
157
- },
158
- ], changeDetection: i0.ChangeDetectionStrategy.OnPush });
159
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Fs2faVerificationCodeComponent, decorators: [{
160
- type: Component,
161
- args: [{
162
- selector: 'fs-2fa-verification-code',
163
- templateUrl: './2fa-verification-code.component.html',
164
- styleUrls: ['./2fa-verification-code.component.scss'],
165
- changeDetection: ChangeDetectionStrategy.OnPush,
166
- viewProviders: [
167
- {
168
- provide: ControlContainer,
169
- useExisting: NgForm,
170
- },
171
- ],
172
- }]
173
- }], ctorParameters: function () { return [{ type: i9.FsFormDirective }]; }, propDecorators: { codeInputComponent: [{
174
- type: ViewChild,
175
- args: [CodeInputComponent]
176
- }], type: [{
177
- type: Input
178
- }], recipient: [{
179
- type: Input
180
- }], code: [{
181
- type: Input
182
- }], codeChanged: [{
183
- type: Output
184
- }], codeCompleted: [{
185
- type: Output
136
+ class Fs2faVerificationCodeComponent {
137
+ constructor(_form) {
138
+ this._form = _form;
139
+ this.codeChanged = new EventEmitter();
140
+ this.codeCompleted = new EventEmitter();
141
+ this.VerificationMethodType = VerificationMethodType;
142
+ }
143
+ codeChange(code) {
144
+ this.code = code;
145
+ this.codeChanged.emit(this.code);
146
+ this._form.dirty();
147
+ }
148
+ focus() {
149
+ this.codeInputComponent.focus();
150
+ }
151
+ }
152
+ Fs2faVerificationCodeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Fs2faVerificationCodeComponent, deps: [{ token: i9.FsFormDirective }], target: i0.ɵɵFactoryTarget.Component });
153
+ Fs2faVerificationCodeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: Fs2faVerificationCodeComponent, selector: "fs-2fa-verification-code", inputs: { type: "type", recipient: "recipient", code: "code" }, outputs: { codeChanged: "codeChanged", codeCompleted: "codeCompleted" }, viewQueries: [{ propertyName: "codeInputComponent", first: true, predicate: CodeInputComponent, descendants: true }], ngImport: i0, template: "<ng-container *ngIf=\"type === VerificationMethodType.Sms\">\n <p class=\"description\">\n A text message with a verification code was just sent to <span style=\"white-space: nowrap;\">{{ recipient }}</span> to verify it's you.\n </p>\n\n <ng-container *ngTemplateOutlet=\"input\"></ng-container>\n</ng-container>\n\n<ng-container *ngIf=\"type === VerificationMethodType.Email\">\n <p class=\"description\">\n An email with a verification code was just sent to {{ recipient }} to verify it's you.\n </p>\n <ng-container *ngTemplateOutlet=\"input\"></ng-container>\n</ng-container>\n\n<ng-container *ngIf=\"type === VerificationMethodType.App\">\n <p class=\"description\">\n Enter the verification code generated by your 2 factor authenticator app to verify it's you.\n </p>\n <ng-container *ngTemplateOutlet=\"input\"></ng-container>\n</ng-container>\n\n<ng-template #input> \n <app-code-input \n [code]=\"code\"\n (codeChanged)=\"codeChange($event)\"\n (codeCompleted)=\"codeCompleted.emit()\">\n </app-code-input> \n</ng-template> ", styles: ["mat-form-field{width:100%}mat-form-field ::ng-deep .mat-form-field-subscript-wrapper{min-height:unset!important}mat-form-field ::ng-deep .mat-form-field-subscript-wrapper .fs-form-error{padding-bottom:5px}app-code-input{margin-bottom:5px}\n"], components: [{ type: CodeInputComponent, selector: "app-code-input", inputs: ["codeLength", "code"], outputs: ["codeCompleted", "codeChanged"] }], directives: [{ type: i9$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i9$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], viewProviders: [
154
+ {
155
+ provide: ControlContainer,
156
+ useExisting: NgForm,
157
+ },
158
+ ], changeDetection: i0.ChangeDetectionStrategy.OnPush });
159
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Fs2faVerificationCodeComponent, decorators: [{
160
+ type: Component,
161
+ args: [{
162
+ selector: 'fs-2fa-verification-code',
163
+ templateUrl: './2fa-verification-code.component.html',
164
+ styleUrls: ['./2fa-verification-code.component.scss'],
165
+ changeDetection: ChangeDetectionStrategy.OnPush,
166
+ viewProviders: [
167
+ {
168
+ provide: ControlContainer,
169
+ useExisting: NgForm,
170
+ },
171
+ ],
172
+ }]
173
+ }], ctorParameters: function () { return [{ type: i9.FsFormDirective }]; }, propDecorators: { codeInputComponent: [{
174
+ type: ViewChild,
175
+ args: [CodeInputComponent]
176
+ }], type: [{
177
+ type: Input
178
+ }], recipient: [{
179
+ type: Input
180
+ }], code: [{
181
+ type: Input
182
+ }], codeChanged: [{
183
+ type: Output
184
+ }], codeCompleted: [{
185
+ type: Output
186
186
  }] } });
187
187
 
188
- class Fs2faVerificationComponent {
189
- constructor(_cdRef, _dialog, _message) {
190
- this._cdRef = _cdRef;
191
- this._dialog = _dialog;
192
- this._message = _message;
193
- this.showTrustedDevice = true;
194
- this.trustDevice = true;
195
- this.formatRecipient = false;
196
- this.verified = new EventEmitter();
197
- this.codeChanged = new EventEmitter();
198
- this.codeCompleted = new EventEmitter();
199
- this.trustDeviceChange = new EventEmitter();
200
- this.code = '';
201
- this.VerificationMethodType = VerificationMethodType;
202
- this._destroy$ = new Subject();
203
- }
204
- get recipient() {
205
- if (this.verificationMethod.type === VerificationMethodType.Email) {
206
- return this.verificationMethod.email;
207
- }
208
- if (this.verificationMethod.type === VerificationMethodType.Sms) {
209
- return this.verificationMethod.phoneNumber;
210
- }
211
- }
212
- ngOnInit() {
213
- this.codeChanged
214
- .pipe(takeUntil(this._destroy$))
215
- .subscribe((code) => {
216
- this.code = code;
217
- });
218
- }
219
- ngOnDestroy() {
220
- this._destroy$.next();
221
- this._destroy$.complete();
222
- }
223
- ngAfterViewInit() {
224
- this.verificationCodeComponent.focus();
225
- }
226
- resendCode() {
227
- return this.resend()
228
- .pipe(tap(() => {
229
- this.code = '';
230
- this._message.success('Resent Code');
231
- }), finalize(() => {
232
- this.verificationCodeComponent.focus();
233
- }));
234
- }
235
- showVerificationMethods() {
236
- this.getVerificationMethods()
237
- .subscribe((verificationMethods) => {
238
- this._dialog.open(Fs2faVerificationMethodsComponent, {
239
- data: {
240
- verificationMethod: this.verificationMethod,
241
- verificationMethods,
242
- selectVerificationMethod: this.selectVerificationMethod,
243
- }
244
- })
245
- .afterClosed()
246
- .pipe(filter((verificationMethod) => !!verificationMethod))
247
- .subscribe((verificationMethod) => {
248
- this.verificationMethod = verificationMethod;
249
- this.code = '';
250
- this._cdRef.markForCheck();
251
- setTimeout(() => {
252
- this.verificationCodeComponent.focus();
253
- });
254
- });
255
- });
256
- }
257
- }
258
- Fs2faVerificationComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Fs2faVerificationComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i3.FsDialog }, { token: i2.FsMessage }], target: i0.ɵɵFactoryTarget.Component });
259
- Fs2faVerificationComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: Fs2faVerificationComponent, selector: "fs-2fa-verification", inputs: { verificationMethod: "verificationMethod", resend: "resend", showTrustedDevice: "showTrustedDevice", trustDevice: "trustDevice", trustDays: "trustDays", formatRecipient: "formatRecipient", getVerificationMethods: "getVerificationMethods", selectVerificationMethod: "selectVerificationMethod" }, outputs: { verified: "verified", codeChanged: "codeChanged", codeCompleted: "codeCompleted", trustDeviceChange: "trustDeviceChange" }, viewQueries: [{ propertyName: "verificationCodeComponent", first: true, predicate: Fs2faVerificationCodeComponent, descendants: true }], ngImport: i0, template: "<div class=\"code-container\">\n <fs-2fa-verification-code\n [recipient]=\"(formatRecipient && verificationMethod.type === VerificationMethodType.Sms) ? (recipient | fsPhone) : recipient\"\n [type]=\"verificationMethod.type\"\n [code]=\"code\"\n (codeChanged)=\"codeChanged.emit($event)\"\n (codeCompleted)=\"codeCompleted.emit()\">\n </fs-2fa-verification-code>\n</div>\n\n<div class=\"additional\">\n <div \n class=\"trust-device\"\n *ngIf=\"showTrustedDevice\">\n <mat-checkbox\n name=\"trust-device\"\n [(ngModel)]=\"trustDevice\"\n (ngModelChange)=\"trustDeviceChange.emit($event)\">\n Trust Device\n <div class=\"small\">\n Bypass 2-Step Verification on this browser <ng-container *ngIf=\"trustDays\">for {{trustDays}} days</ng-container> unless you clear cookies.</div>\n </mat-checkbox>\n </div>\n</div>", styles: [":host ::ng-deep .mat-checkbox{margin:2px 0}:host ::ng-deep .mat-checkbox .mat-checkbox-label{line-height:normal}:host ::ng-deep .mat-checkbox .mat-checkbox-layout{white-space:normal}.code-container{text-align:center}.additional{display:flex;justify-content:space-between;align-items:center;margin:4px 0 5px}.additional small{color:inherit}.additional .resend{cursor:pointer;text-transform:none}.additional .resend mat-spinner{display:inline-block;vertical-align:middle}\n"], components: [{ type: Fs2faVerificationCodeComponent, selector: "fs-2fa-verification-code", inputs: ["type", "recipient", "code"], outputs: ["codeChanged", "codeCompleted"] }, { type: i6$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"] }], directives: [{ type: i9$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i8.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i8.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i9.FsFormNoFsValidatorsDirective, selector: "[ngModel]:not([required]):not([fsFormRequired]):not([fsFormCompare]):not([fsFormDateRange]):not([fsFormEmail]):not([fsFormEmails]):not([fsFormFunction]):not([fsFormGreater]):not([fsFormInteger]):not([fsFormLesser]):not([fsFormMax]):not([fsFormMaxLength]):not([fsFormMin]):not([fsFormMinLength]):not([fsFormNumeric]):not([fsFormPattern]):not([fsFormPhone]):not([fsFormUrl]):not([validate])" }], pipes: { "fsPhone": i8$1.FsPhonePipe }, viewProviders: [{ provide: ControlContainer, useExisting: NgForm }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
260
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Fs2faVerificationComponent, decorators: [{
261
- type: Component,
262
- args: [{
263
- selector: 'fs-2fa-verification',
264
- templateUrl: './2fa-verification.component.html',
265
- styleUrls: ['./2fa-verification.component.scss'],
266
- changeDetection: ChangeDetectionStrategy.OnPush,
267
- viewProviders: [{ provide: ControlContainer, useExisting: NgForm }],
268
- }]
269
- }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i3.FsDialog }, { type: i2.FsMessage }]; }, propDecorators: { verificationCodeComponent: [{
270
- type: ViewChild,
271
- args: [Fs2faVerificationCodeComponent]
272
- }], verificationMethod: [{
273
- type: Input
274
- }], resend: [{
275
- type: Input
276
- }], showTrustedDevice: [{
277
- type: Input
278
- }], trustDevice: [{
279
- type: Input
280
- }], trustDays: [{
281
- type: Input
282
- }], formatRecipient: [{
283
- type: Input
284
- }], getVerificationMethods: [{
285
- type: Input
286
- }], selectVerificationMethod: [{
287
- type: Input
288
- }], verified: [{
289
- type: Output
290
- }], codeChanged: [{
291
- type: Output
292
- }], codeCompleted: [{
293
- type: Output
294
- }], trustDeviceChange: [{
295
- type: Output
188
+ class Fs2faVerificationComponent {
189
+ constructor(_cdRef, _dialog, _message) {
190
+ this._cdRef = _cdRef;
191
+ this._dialog = _dialog;
192
+ this._message = _message;
193
+ this.showTrustedDevice = true;
194
+ this.trustDevice = true;
195
+ this.formatRecipient = false;
196
+ this.verified = new EventEmitter();
197
+ this.codeChanged = new EventEmitter();
198
+ this.codeCompleted = new EventEmitter();
199
+ this.trustDeviceChange = new EventEmitter();
200
+ this.code = '';
201
+ this.VerificationMethodType = VerificationMethodType;
202
+ this._destroy$ = new Subject();
203
+ }
204
+ get recipient() {
205
+ if (this.verificationMethod.type === VerificationMethodType.Email) {
206
+ return this.verificationMethod.email;
207
+ }
208
+ if (this.verificationMethod.type === VerificationMethodType.Sms) {
209
+ return this.verificationMethod.phoneNumber;
210
+ }
211
+ }
212
+ ngOnInit() {
213
+ this.codeChanged
214
+ .pipe(takeUntil(this._destroy$))
215
+ .subscribe((code) => {
216
+ this.code = code;
217
+ });
218
+ }
219
+ ngOnDestroy() {
220
+ this._destroy$.next();
221
+ this._destroy$.complete();
222
+ }
223
+ ngAfterViewInit() {
224
+ this.verificationCodeComponent.focus();
225
+ }
226
+ resendCode() {
227
+ return this.resend()
228
+ .pipe(tap(() => {
229
+ this.code = '';
230
+ this._message.success('Resent Code');
231
+ }), finalize(() => {
232
+ this.verificationCodeComponent.focus();
233
+ }));
234
+ }
235
+ showVerificationMethods() {
236
+ this.getVerificationMethods()
237
+ .subscribe((verificationMethods) => {
238
+ this._dialog.open(Fs2faVerificationMethodsComponent, {
239
+ data: {
240
+ verificationMethod: this.verificationMethod,
241
+ verificationMethods,
242
+ selectVerificationMethod: this.selectVerificationMethod,
243
+ }
244
+ })
245
+ .afterClosed()
246
+ .pipe(filter((verificationMethod) => !!verificationMethod))
247
+ .subscribe((verificationMethod) => {
248
+ this.verificationMethod = verificationMethod;
249
+ this.code = '';
250
+ this._cdRef.markForCheck();
251
+ setTimeout(() => {
252
+ this.verificationCodeComponent.focus();
253
+ });
254
+ });
255
+ });
256
+ }
257
+ }
258
+ Fs2faVerificationComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Fs2faVerificationComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i3.FsDialog }, { token: i2.FsMessage }], target: i0.ɵɵFactoryTarget.Component });
259
+ Fs2faVerificationComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: Fs2faVerificationComponent, selector: "fs-2fa-verification", inputs: { verificationMethod: "verificationMethod", resend: "resend", showTrustedDevice: "showTrustedDevice", trustDevice: "trustDevice", trustDays: "trustDays", formatRecipient: "formatRecipient", getVerificationMethods: "getVerificationMethods", selectVerificationMethod: "selectVerificationMethod" }, outputs: { verified: "verified", codeChanged: "codeChanged", codeCompleted: "codeCompleted", trustDeviceChange: "trustDeviceChange" }, viewQueries: [{ propertyName: "verificationCodeComponent", first: true, predicate: Fs2faVerificationCodeComponent, descendants: true }], ngImport: i0, template: "<div class=\"code-container\">\n <fs-2fa-verification-code\n [recipient]=\"(formatRecipient && verificationMethod.type === VerificationMethodType.Sms) ? (recipient | fsPhone) : recipient\"\n [type]=\"verificationMethod.type\"\n [code]=\"code\"\n (codeChanged)=\"codeChanged.emit($event)\"\n (codeCompleted)=\"codeCompleted.emit()\">\n </fs-2fa-verification-code>\n</div>\n\n<div class=\"additional\">\n <div \n class=\"trust-device\"\n *ngIf=\"showTrustedDevice\">\n <mat-checkbox\n name=\"trust-device\"\n [(ngModel)]=\"trustDevice\"\n (ngModelChange)=\"trustDeviceChange.emit($event)\">\n Trust Device\n <div class=\"small\">\n Bypass 2-Step Verification on this browser <ng-container *ngIf=\"trustDays\">for {{trustDays}} days</ng-container> unless you clear cookies.</div>\n </mat-checkbox>\n </div>\n</div>", styles: [":host ::ng-deep .mat-checkbox{margin:2px 0}:host ::ng-deep .mat-checkbox .mat-checkbox-label{line-height:normal}:host ::ng-deep .mat-checkbox .mat-checkbox-layout{white-space:normal}.code-container{text-align:center}.additional{display:flex;justify-content:space-between;align-items:center;margin:4px 0 5px}.additional small{color:inherit}.additional .resend{cursor:pointer;text-transform:none}.additional .resend mat-spinner{display:inline-block;vertical-align:middle}\n"], components: [{ type: Fs2faVerificationCodeComponent, selector: "fs-2fa-verification-code", inputs: ["type", "recipient", "code"], outputs: ["codeChanged", "codeCompleted"] }, { type: i6$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"] }], directives: [{ type: i9$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i8.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i8.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i9.FsFormNoFsValidatorsDirective, selector: "[ngModel]:not([required]):not([fsFormRequired]):not([fsFormCompare]):not([fsFormDateRange]):not([fsFormEmail]):not([fsFormEmails]):not([fsFormFunction]):not([fsFormGreater]):not([fsFormInteger]):not([fsFormLesser]):not([fsFormMax]):not([fsFormMaxLength]):not([fsFormMin]):not([fsFormMinLength]):not([fsFormNumeric]):not([fsFormPattern]):not([fsFormPhone]):not([fsFormUrl]):not([validate])" }], pipes: { "fsPhone": i8$1.FsPhonePipe }, viewProviders: [{ provide: ControlContainer, useExisting: NgForm }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
260
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Fs2faVerificationComponent, decorators: [{
261
+ type: Component,
262
+ args: [{
263
+ selector: 'fs-2fa-verification',
264
+ templateUrl: './2fa-verification.component.html',
265
+ styleUrls: ['./2fa-verification.component.scss'],
266
+ changeDetection: ChangeDetectionStrategy.OnPush,
267
+ viewProviders: [{ provide: ControlContainer, useExisting: NgForm }],
268
+ }]
269
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i3.FsDialog }, { type: i2.FsMessage }]; }, propDecorators: { verificationCodeComponent: [{
270
+ type: ViewChild,
271
+ args: [Fs2faVerificationCodeComponent]
272
+ }], verificationMethod: [{
273
+ type: Input
274
+ }], resend: [{
275
+ type: Input
276
+ }], showTrustedDevice: [{
277
+ type: Input
278
+ }], trustDevice: [{
279
+ type: Input
280
+ }], trustDays: [{
281
+ type: Input
282
+ }], formatRecipient: [{
283
+ type: Input
284
+ }], getVerificationMethods: [{
285
+ type: Input
286
+ }], selectVerificationMethod: [{
287
+ type: Input
288
+ }], verified: [{
289
+ type: Output
290
+ }], codeChanged: [{
291
+ type: Output
292
+ }], codeCompleted: [{
293
+ type: Output
294
+ }], trustDeviceChange: [{
295
+ type: Output
296
296
  }] } });
297
297
 
298
- class CodeInputModule {
299
- }
300
- CodeInputModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: CodeInputModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
301
- CodeInputModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: CodeInputModule, declarations: [CodeInputComponent], imports: [CodeInputModule$1], exports: [CodeInputComponent] });
302
- CodeInputModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: CodeInputModule, imports: [[
303
- CodeInputModule$1,
304
- ]] });
305
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: CodeInputModule, decorators: [{
306
- type: NgModule,
307
- args: [{
308
- imports: [
309
- CodeInputModule$1,
310
- ],
311
- declarations: [
312
- CodeInputComponent,
313
- ],
314
- exports: [
315
- CodeInputComponent,
316
- ],
317
- }]
298
+ class CodeInputModule {
299
+ }
300
+ CodeInputModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: CodeInputModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
301
+ CodeInputModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: CodeInputModule, declarations: [CodeInputComponent], imports: [CodeInputModule$1], exports: [CodeInputComponent] });
302
+ CodeInputModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: CodeInputModule, imports: [[
303
+ CodeInputModule$1,
304
+ ]] });
305
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: CodeInputModule, decorators: [{
306
+ type: NgModule,
307
+ args: [{
308
+ imports: [
309
+ CodeInputModule$1,
310
+ ],
311
+ declarations: [
312
+ CodeInputComponent,
313
+ ],
314
+ exports: [
315
+ CodeInputComponent,
316
+ ],
317
+ }]
318
318
  }] });
319
319
 
320
- class ResendComponent {
321
- constructor(_cdRef) {
322
- this._cdRef = _cdRef;
323
- this.resendInProgress = false;
324
- this._destroy$ = new Subject();
325
- }
326
- resendClick() {
327
- this.resendInProgress = true;
328
- this.resend()
329
- .pipe(finalize(() => {
330
- this.resendInProgress = false;
331
- this._cdRef.markForCheck();
332
- }), takeUntil(this._destroy$))
333
- .subscribe();
334
- }
335
- ngOnDestroy() {
336
- this._destroy$.next();
337
- this._destroy$.complete();
338
- }
339
- }
340
- ResendComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ResendComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
341
- ResendComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ResendComponent, selector: "app-resend", inputs: { resend: "resend" }, ngImport: i0, template: "<ng-container *ngIf=\"!resendInProgress else sending\">\n Didn't receive a code? <a (click)=\"resendClick()\">Resend</a>\n</ng-container>\n<ng-template #sending>\n <div class=\"sending\">\n <mat-spinner [diameter]=\"12\"></mat-spinner> Sending\n </div>\n</ng-template>\n\n", styles: ["small{color:inherit}.sending{display:inline-flex;align-items:center}.sending mat-spinner{margin-right:2px}\n"], components: [{ type: i1$2.MatSpinner, selector: "mat-spinner", inputs: ["color"] }], directives: [{ type: i9$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
342
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ResendComponent, decorators: [{
343
- type: Component,
344
- args: [{
345
- selector: 'app-resend',
346
- templateUrl: './resend.component.html',
347
- styleUrls: ['./resend.component.scss'],
348
- changeDetection: ChangeDetectionStrategy.OnPush,
349
- }]
350
- }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { resend: [{
351
- type: Input
320
+ class ResendComponent {
321
+ constructor(_cdRef) {
322
+ this._cdRef = _cdRef;
323
+ this.resendInProgress = false;
324
+ this._destroy$ = new Subject();
325
+ }
326
+ resendClick() {
327
+ this.resendInProgress = true;
328
+ this.resend()
329
+ .pipe(finalize(() => {
330
+ this.resendInProgress = false;
331
+ this._cdRef.markForCheck();
332
+ }), takeUntil(this._destroy$))
333
+ .subscribe();
334
+ }
335
+ ngOnDestroy() {
336
+ this._destroy$.next();
337
+ this._destroy$.complete();
338
+ }
339
+ }
340
+ ResendComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ResendComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
341
+ ResendComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ResendComponent, selector: "app-resend", inputs: { resend: "resend" }, ngImport: i0, template: "<ng-container *ngIf=\"!resendInProgress else sending\">\n Didn't receive a code? <a (click)=\"resendClick()\">Resend</a>\n</ng-container>\n<ng-template #sending>\n <div class=\"sending\">\n <mat-spinner [diameter]=\"12\"></mat-spinner> Sending\n </div>\n</ng-template>\n\n", styles: ["small{color:inherit}.sending{display:inline-flex;align-items:center}.sending mat-spinner{margin-right:2px}\n"], components: [{ type: i1$2.MatSpinner, selector: "mat-spinner", inputs: ["color"] }], directives: [{ type: i9$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
342
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ResendComponent, decorators: [{
343
+ type: Component,
344
+ args: [{
345
+ selector: 'app-resend',
346
+ templateUrl: './resend.component.html',
347
+ styleUrls: ['./resend.component.scss'],
348
+ changeDetection: ChangeDetectionStrategy.OnPush,
349
+ }]
350
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { resend: [{
351
+ type: Input
352
352
  }] } });
353
353
 
354
- class ResendModule {
355
- }
356
- ResendModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ResendModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
357
- ResendModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ResendModule, declarations: [ResendComponent], imports: [CommonModule,
358
- MatProgressSpinnerModule], exports: [ResendComponent] });
359
- ResendModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ResendModule, imports: [[
360
- CommonModule,
361
- MatProgressSpinnerModule,
362
- ]] });
363
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ResendModule, decorators: [{
364
- type: NgModule,
365
- args: [{
366
- imports: [
367
- CommonModule,
368
- MatProgressSpinnerModule,
369
- ],
370
- declarations: [
371
- ResendComponent,
372
- ],
373
- exports: [
374
- ResendComponent,
375
- ],
376
- }]
354
+ class ResendModule {
355
+ }
356
+ ResendModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ResendModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
357
+ ResendModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ResendModule, declarations: [ResendComponent], imports: [CommonModule,
358
+ MatProgressSpinnerModule], exports: [ResendComponent] });
359
+ ResendModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ResendModule, imports: [[
360
+ CommonModule,
361
+ MatProgressSpinnerModule,
362
+ ]] });
363
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ResendModule, decorators: [{
364
+ type: NgModule,
365
+ args: [{
366
+ imports: [
367
+ CommonModule,
368
+ MatProgressSpinnerModule,
369
+ ],
370
+ declarations: [
371
+ ResendComponent,
372
+ ],
373
+ exports: [
374
+ ResendComponent,
375
+ ],
376
+ }]
377
377
  }] });
378
378
 
379
- class Fs2faVerificationResendDirective {
380
- constructor(_button) {
381
- this._button = _button;
382
- }
383
- click() {
384
- this._button.disabled = true;
385
- this.verification.resendCode()
386
- .pipe(finalize(() => this._button.disabled = false))
387
- .subscribe();
388
- }
389
- }
390
- Fs2faVerificationResendDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Fs2faVerificationResendDirective, deps: [{ token: i6.MatButton }], target: i0.ɵɵFactoryTarget.Directive });
391
- Fs2faVerificationResendDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: Fs2faVerificationResendDirective, selector: "[fs2faVerificationResend]", inputs: { verification: ["fs2faVerificationResend", "verification"] }, host: { listeners: { "click": "click()" } }, ngImport: i0 });
392
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Fs2faVerificationResendDirective, decorators: [{
393
- type: Directive,
394
- args: [{
395
- selector: '[fs2faVerificationResend]',
396
- }]
397
- }], ctorParameters: function () { return [{ type: i6.MatButton }]; }, propDecorators: { verification: [{
398
- type: Input,
399
- args: ['fs2faVerificationResend']
400
- }], click: [{
401
- type: HostListener,
402
- args: ['click']
379
+ class Fs2faVerificationResendDirective {
380
+ constructor(_button) {
381
+ this._button = _button;
382
+ }
383
+ click() {
384
+ this._button.disabled = true;
385
+ this.verification.resendCode()
386
+ .pipe(finalize(() => this._button.disabled = false))
387
+ .subscribe();
388
+ }
389
+ }
390
+ Fs2faVerificationResendDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Fs2faVerificationResendDirective, deps: [{ token: i6.MatButton }], target: i0.ɵɵFactoryTarget.Directive });
391
+ Fs2faVerificationResendDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: Fs2faVerificationResendDirective, selector: "[fs2faVerificationResend]", inputs: { verification: ["fs2faVerificationResend", "verification"] }, host: { listeners: { "click": "click()" } }, ngImport: i0 });
392
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Fs2faVerificationResendDirective, decorators: [{
393
+ type: Directive,
394
+ args: [{
395
+ selector: '[fs2faVerificationResend]',
396
+ }]
397
+ }], ctorParameters: function () { return [{ type: i6.MatButton }]; }, propDecorators: { verification: [{
398
+ type: Input,
399
+ args: ['fs2faVerificationResend']
400
+ }], click: [{
401
+ type: HostListener,
402
+ args: ['click']
403
403
  }] } });
404
404
 
405
- class Fs2faVerificationModule {
406
- }
407
- Fs2faVerificationModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Fs2faVerificationModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
408
- Fs2faVerificationModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Fs2faVerificationModule, declarations: [Fs2faVerificationComponent,
409
- Fs2faVerificationCodeComponent,
410
- Fs2faVerificationMethodsComponent,
411
- Fs2faVerificationResendDirective], imports: [CommonModule,
412
- FormsModule,
413
- MatFormFieldModule,
414
- MatInputModule,
415
- MatButtonModule,
416
- MatIconModule,
417
- MatRadioModule,
418
- MatCheckboxModule,
419
- FsFormModule,
420
- FsRadioGroupModule,
421
- FsDialogModule,
422
- FsSkeletonModule,
423
- FsPhoneModule,
424
- FsSkeletonModule,
425
- ResendModule,
426
- CodeInputModule], exports: [Fs2faVerificationComponent,
427
- Fs2faVerificationResendDirective] });
428
- Fs2faVerificationModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Fs2faVerificationModule, providers: [], imports: [[
429
- CommonModule,
430
- FormsModule,
431
- MatFormFieldModule,
432
- MatInputModule,
433
- MatButtonModule,
434
- MatIconModule,
435
- MatRadioModule,
436
- MatCheckboxModule,
437
- FsFormModule,
438
- FsRadioGroupModule,
439
- FsDialogModule,
440
- FsSkeletonModule,
441
- FsPhoneModule,
442
- FsSkeletonModule,
443
- ResendModule,
444
- CodeInputModule,
445
- ]] });
446
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Fs2faVerificationModule, decorators: [{
447
- type: NgModule,
448
- args: [{
449
- imports: [
450
- CommonModule,
451
- FormsModule,
452
- MatFormFieldModule,
453
- MatInputModule,
454
- MatButtonModule,
455
- MatIconModule,
456
- MatRadioModule,
457
- MatCheckboxModule,
458
- FsFormModule,
459
- FsRadioGroupModule,
460
- FsDialogModule,
461
- FsSkeletonModule,
462
- FsPhoneModule,
463
- FsSkeletonModule,
464
- ResendModule,
465
- CodeInputModule,
466
- ],
467
- declarations: [
468
- Fs2faVerificationComponent,
469
- Fs2faVerificationCodeComponent,
470
- Fs2faVerificationMethodsComponent,
471
- Fs2faVerificationResendDirective,
472
- ],
473
- exports: [
474
- Fs2faVerificationComponent,
475
- Fs2faVerificationResendDirective,
476
- ],
477
- providers: [],
478
- }]
405
+ class Fs2faVerificationModule {
406
+ }
407
+ Fs2faVerificationModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Fs2faVerificationModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
408
+ Fs2faVerificationModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Fs2faVerificationModule, declarations: [Fs2faVerificationComponent,
409
+ Fs2faVerificationCodeComponent,
410
+ Fs2faVerificationMethodsComponent,
411
+ Fs2faVerificationResendDirective], imports: [CommonModule,
412
+ FormsModule,
413
+ MatFormFieldModule,
414
+ MatInputModule,
415
+ MatButtonModule,
416
+ MatIconModule,
417
+ MatRadioModule,
418
+ MatCheckboxModule,
419
+ FsFormModule,
420
+ FsRadioGroupModule,
421
+ FsDialogModule,
422
+ FsSkeletonModule,
423
+ FsPhoneModule,
424
+ FsSkeletonModule,
425
+ ResendModule,
426
+ CodeInputModule], exports: [Fs2faVerificationComponent,
427
+ Fs2faVerificationResendDirective] });
428
+ Fs2faVerificationModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Fs2faVerificationModule, providers: [], imports: [[
429
+ CommonModule,
430
+ FormsModule,
431
+ MatFormFieldModule,
432
+ MatInputModule,
433
+ MatButtonModule,
434
+ MatIconModule,
435
+ MatRadioModule,
436
+ MatCheckboxModule,
437
+ FsFormModule,
438
+ FsRadioGroupModule,
439
+ FsDialogModule,
440
+ FsSkeletonModule,
441
+ FsPhoneModule,
442
+ FsSkeletonModule,
443
+ ResendModule,
444
+ CodeInputModule,
445
+ ]] });
446
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Fs2faVerificationModule, decorators: [{
447
+ type: NgModule,
448
+ args: [{
449
+ imports: [
450
+ CommonModule,
451
+ FormsModule,
452
+ MatFormFieldModule,
453
+ MatInputModule,
454
+ MatButtonModule,
455
+ MatIconModule,
456
+ MatRadioModule,
457
+ MatCheckboxModule,
458
+ FsFormModule,
459
+ FsRadioGroupModule,
460
+ FsDialogModule,
461
+ FsSkeletonModule,
462
+ FsPhoneModule,
463
+ FsSkeletonModule,
464
+ ResendModule,
465
+ CodeInputModule,
466
+ ],
467
+ declarations: [
468
+ Fs2faVerificationComponent,
469
+ Fs2faVerificationCodeComponent,
470
+ Fs2faVerificationMethodsComponent,
471
+ Fs2faVerificationResendDirective,
472
+ ],
473
+ exports: [
474
+ Fs2faVerificationComponent,
475
+ Fs2faVerificationResendDirective,
476
+ ],
477
+ providers: [],
478
+ }]
479
479
  }] });
480
480
 
481
- class AppComponent {
482
- constructor(_data, _dialogRef, _cdRef, _message) {
483
- this._data = _data;
484
- this._dialogRef = _dialogRef;
485
- this._cdRef = _cdRef;
486
- this._message = _message;
487
- this.mode = 'qr-code';
488
- this.trustDevice = true;
489
- this.verify = () => {
490
- return this.twoFactorManageService.verificationMethodVerify$(this.code, this.trustDevice)
491
- .pipe(tap(() => {
492
- this._message.success('Created app authenticator verification method');
493
- this._dialogRef.close(true);
494
- }));
495
- };
496
- }
497
- ngOnInit() {
498
- this.twoFactorManageService = this._data.twoFactorManageService;
499
- this.accountId = this._data.accountId;
500
- this.default = !this.twoFactorManageService.hasVerificationMethods;
501
- }
502
- appTypeGoogle() {
503
- this.appTypeSelect('google');
504
- }
505
- appTypeAuthy() {
506
- this.appTypeSelect('authy');
507
- }
508
- appTypeSelect(appType) {
509
- this.appType = appType;
510
- this.twoFactorManageService.verificationMethodCreate$({
511
- type: VerificationMethodType.App,
512
- default: this.default,
513
- })
514
- .subscribe((response) => {
515
- this.qrCodeUrl = response.qrCodeUrl;
516
- this._cdRef.markForCheck();
517
- });
518
- }
519
- codeCompleted() {
520
- this.form.triggerSubmit();
521
- }
522
- codeChanged(code) {
523
- this.code = code;
524
- this.form.dirty();
525
- }
526
- next() {
527
- this.mode = 'code-input';
528
- }
529
- }
530
- AppComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: AppComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: i1.MatDialogRef }, { token: i0.ChangeDetectorRef }, { token: i2.FsMessage }], target: i0.ɵɵFactoryTarget.Component });
531
- AppComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: AppComponent, selector: "ng-component", viewQueries: [{ propertyName: "form", first: true, predicate: FsFormDirective, descendants: true }], ngImport: i0, template: "<form fsForm [submit]=\"verify\">\n <fs-dialog>\n <h1 mat-dialog-title>Authenticator App Setup</h1>\n <mat-dialog-content>\n\n <div *ngIf=\"mode === 'qr-code'\" class=\"qr-code\">\n <ng-container *ngIf=\"appType\">\n <ol>\n <li>\n <ng-container *ngIf=\"appType === 'authy'\">\n Install the Authy Authenticator App from the <a href=\"https://apps.apple.com/us/app/authy/id494168017\" target=\"_blank\">App Store</a> or\n the <a href=\"https://play.google.com/store/apps/details?id=com.authy.authy\" target=\"_blank\">Google Play Store</a>.\n </ng-container>\n\n <ng-container *ngIf=\"appType === 'google'\">\n Install the Google Authenticator App from the <a href=\"https://apps.apple.com/us/app/google-authenticator/id388497605\" target=\"_blank\">App Store</a> or\n the <a href=\"https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2&hl=en_US&gl=US\" target=\"_blank\">Google Play Store</a>.\n </ng-container>\n </li>\n <ng-container *ngIf=\"appType === 'authy'\">\n <li>\n Open the Authy app and select <b>Add Account</b>.\n </li>\n <li>\n Select <b>Scan QR Code</b> and scan the QR code below.\n </li>\n </ng-container> \n <ng-container *ngIf=\"appType === 'google'\">\n <li>\n Open the Google Authentictor app and click the <b>Plus icon</b> in the lower right corner.\n </li>\n <li>\n Select <b>Scan a QR code</b> and scan the QR code below.\n </li>\n </ng-container>\n </ol>\n\n <qr-code \n *fsSkeleton=\"qrCodeUrl\"\n [value]=\"qrCodeUrl\"\n size=\"200\"\n errorCorrectionLevel=\"H\"\n [margin]=\"0\">\n </qr-code> \n </ng-container>\n\n <div class=\"app-types\" *ngIf=\"!appType\">\n <p>Select the Authenticator App you prefer</p>\n\n <div class=\"row\">\n <span>\n <a (click)=\"appTypeAuthy()\">\n <svg width=\"50\" height=\"50\" viewBox=\"0 0 256 256\" xmlns=\"http://www.w3.org/2000/svg\" preserveAspectRatio=\"xMidYMid\"><path d=\"M256 127.998C256 198.696 198.694 256 127.997 256 57.304 256 0 198.696 0 127.998 0 57.305 57.304 0 127.997 0 198.694 0 256 57.305 256 127.998z\" fill=\"#EC1C24\"/><path d=\"M117.024 100.89l30.691 30.68c4.43 4.436 11.623 4.436 16.064 0 4.431-4.435 4.441-11.622 0-16.058L133.086 84.82C111.125 62.854 75.631 62.5 53.204 83.704a9.536 9.536 0 0 0-.605.548c-.098.098-.178.202-.275.29-.1.096-.202.182-.297.278-.194.193-.371.396-.54.597-21.215 22.437-20.85 57.932 1.113 79.897L83.292 196c4.44 4.433 11.623 4.433 16.062 0 4.442-4.437 4.442-11.633.011-16.06l-30.693-30.691c-13.398-13.393-13.488-35.129-.278-48.637 13.506-13.21 35.23-13.114 48.63.279zm39.612-40.873c-4.435 4.437-4.435 11.623.012 16.059l30.681 30.693c13.39 13.392 13.477 35.125.268 48.636-13.51 13.2-35.227 13.112-48.623-.282l-30.692-30.689c-4.438-4.437-11.633-4.437-16.066 0-4.443 4.433-4.443 11.642 0 16.065l30.682 30.694c21.968 21.965 57.458 22.322 79.889 1.116.208-.184.404-.355.61-.549.094-.095.182-.192.273-.29.1-.095.197-.183.29-.289.197-.183.365-.384.54-.594 21.215-22.428 20.86-57.911-1.102-79.889l-30.692-30.682c-4.436-4.443-11.638-4.443-16.07.001z\" fill=\"#FFF\"/></svg>\n </a>\n Authy\n </span>\n \n <span>\n <a (click)=\"appTypeGoogle()\"> \n <svg width=\"50\" height=\"50\" viewBox=\"0 0 1024 1024\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"m457.07 45.92c73.67-8.62 149.41.22 218.93 26.24 62.75 23.47 120.59 60.41 167.72 108.09-40.31 39.97-80.25 80.31-120.51 120.33-25.95-25.45-56.19-46.65-89.47-61.37-44.22-19.82-93.39-28.54-141.72-25.2-54.6 3.52-108.11 22.49-152.63 54.3-55.24 38.95-96.61 97.22-114.8 162.35-13.64 47.78-14.77 98.97-3.76 147.4 8.85 39.61 26.09 77.29 50.05 110.03 22.24 30.45 50.3 56.64 82.22 76.71 36.79 23.24 78.76 38.22 121.96 43.48 37.02 4.65 74.9 2.23 111.05-7 3.97-1.91 6.24 2.61 8.73 4.86 40.74 40.95 81.68 81.7 122.43 122.63-73.31 35.6-155.99 51.86-237.3 46.12-68.05-4.51-135.07-24.08-194.71-57.18-24.87-13.6-48.23-29.82-70.33-47.54-17.46-14.81-34.71-30.01-49.72-47.35-25.41-27.39-47.21-58.11-65.17-90.87-4-7.72-8.64-15.12-11.9-23.2-4.47-9.05-8.37-18.36-12.25-27.67-4.96-13.27-10.26-26.44-13.88-40.15-.43-1.81-1.53-3.33-2.52-4.85-8.3-28.66-12.95-58.33-15.44-88.04-2.62-37.36-1.33-75.05 4.78-112.03 12.18-75.48 43.41-147.74 89.86-208.44 30.12-39.5 66.53-74.21 107.46-102.35 62.44-43.11 135.53-70.69 210.92-79.3m49.18 50.48c-5.7.99-10.96 3.76-15.38 7.43-10.4 8.93-14.14 24.81-8.17 37.28 6.33 15.02 25.16 23.1 40.36 17 15.43-5.24 24.78-23.51 19.74-39.06-4.1-15.43-20.92-25.79-36.55-22.65m-267.96 111.99c-5.33.28-10.59 1.92-15.16 4.68-11.47 7.03-17.88 21.74-14.36 34.86 3.09 14.08 16.78 25.06 31.26 24.61 15.03.41 29.08-11.39 31.54-26.17 2.24-10.33-1.61-21.55-9.14-28.85-6.24-6.33-15.3-9.62-24.14-9.13m-115.96 272c-6.62 1.23-12.84 4.58-17.54 9.4-9.45 9.72-11.72 25.57-5.02 37.42 7.16 13.96 25.48 20.86 39.98 14.62 15.02-5.51 23.99-23.42 19.06-38.71-4.04-15.41-20.86-25.96-36.48-22.73m111.98 272.05c-11.49 1.95-21.48 10.72-24.84 21.88-3.87 11.63-.13 25.16 8.9 33.36 6.15 5.48 14.4 8.7 22.67 8.32 11.16-.25 21.98-6.87 27.12-16.8 4.93-8.83 5.15-20.02.71-29.1-5.82-12.78-20.81-20.33-34.56-17.66m272.06 112.03c-11.76 2.02-21.92 11.07-25.09 22.6-3.87 12.57 1.13 27.25 11.91 34.79 7.86 5.79 18.42 7.67 27.77 4.86 9.61-2.77 17.7-10.24 21.07-19.68 4.97-12.74.36-28.32-10.58-36.46-7.02-5.45-16.35-7.67-25.08-6.11z\" fill=\"#a0a0a0\"/>\n <g fill=\"#c1c1c1\">\n <path d=\"m506.25 96.4c15.63-3.14 32.45 7.22 36.55 22.65 5.04 15.55-4.31 33.82-19.74 39.06-15.2 6.1-34.03-1.98-40.36-17-5.97-12.47-2.23-28.35 8.17-37.28 4.42-3.67 9.68-6.44 15.38-7.43z\"/>\n <path d=\"m122.33 480.39c15.62-3.23 32.44 7.32 36.48 22.73 4.93 15.29-4.04 33.2-19.06 38.71-14.5 6.24-32.82-.66-39.98-14.62-6.7-11.85-4.43-27.7 5.02-37.42 4.7-4.82 10.92-8.17 17.54-9.4z\"/>\n </g>\n <path d=\"m843.72 180.25.11-.11c24.64 25.12 46.96 52.6 65.61 82.47 36.01 57.16 59.38 122.22 67.87 189.25 5.67 44.88 5.27 90.6-2.05 135.27-12.7 80.01-46.94 156.41-97.9 219.36-42.3 52.48-95.87 96.04-156.41 125.76l-.63-.26c-1.01-1.1-2.03-2.16-3.05-3.22-40.75-40.93-81.69-81.68-122.43-122.63-2.49-2.25-4.76-6.77-8.73-4.86-36.15 9.23-74.03 11.65-111.05 7-43.2-5.26-85.17-20.24-121.96-43.48-31.92-20.07-59.98-46.26-82.22-76.71-23.96-32.74-41.2-70.42-50.05-110.03-11.01-48.43-9.88-99.62 3.76-147.4 18.19-65.13 59.56-123.4 114.8-162.35 44.52-31.81 98.03-50.78 152.63-54.3 48.33-3.34 97.5 5.38 141.72 25.2 33.28 14.72 63.52 35.92 89.47 61.37 40.26-40.02 80.2-80.36 120.51-120.33m-351.75 183.97c-21.23 2.85-41.89 10.28-59.88 21.94-23.08 14.45-41.76 35.58-53.9 59.91-14.58 29.2-18.64 63.21-12.5 95.17 3.93 19.85 12.03 38.88 23.56 55.51 7.93 11.52 17.65 21.66 27.65 31.38 57.33 57.41 114.61 114.86 171.99 172.21 49.09-13.07 94.67-38.94 131.05-74.4 45.11-43.34 75.66-101.44 86.31-163.06.24-1.04.22-2.91 1.85-2.6 29.63.04 59.26-.01 88.9.05 19.04-.3 36.87-14.77 40.76-33.46.22-1.21 0-2.32-.67-3.35 1.22-5.71 2.08-11.58 1.38-17.43l-.24.4c-2.05-20.34-20.84-37.12-41.25-37.17-80.64-.07-161.28-.01-241.93-.07-6.44-22.08-18.5-42.33-34.03-59.23-25.8-27.5-62.26-45.01-100.02-46.82-9.68.02-19.44-.54-29.03 1.02m286.37 388.31c-12.64 2.06-23.37 12.59-25.7 25.18-1.48 8.14-.14 17.02 4.73 23.85 5.76 9.2 16.8 14.76 27.61 14.25 8.32.03 16.28-3.95 22.16-9.66 4.87-5.6 8.45-12.67 8.67-20.2.86-11.37-5.06-23.1-14.87-28.96-6.52-4.46-14.89-5.75-22.6-4.46z\" fill=\"#686868\"/>\n <path d=\"m238.29 208.39c8.84-.49 17.9 2.8 24.14 9.13 7.53 7.3 11.38 18.52 9.14 28.85-2.46 14.78-16.51 26.58-31.54 26.17-14.48.45-28.17-10.53-31.26-24.61-3.52-13.12 2.89-27.83 14.36-34.86 4.57-2.76 9.83-4.4 15.16-4.68z\" fill=\"#c3c3c3\"/>\n <path d=\"m491.97 364.22c9.59-1.56 19.35-1 29.03-1.02 37.76 1.81 74.22 19.32 100.02 46.82 15.53 16.9 27.59 37.15 34.03 59.23-47.67-.01-95.35-.01-143.03-.01-12.19-.11-24.23 5.42-32.21 14.61-6.01 6.85-9.74 15.65-10.44 24.74-1.19 14.17 5.36 28.7 16.69 37.28 7.62 5.91 17.28 9 26.92 8.8 126.69-.04 253.39-.06 380.08.03 4.76.04 9.59-.15 14.2-1.48 14.21-3.82 26.02-15.47 29.83-29.7.67 1.03.89 2.14.67 3.35-3.89 18.69-21.72 33.16-40.76 33.46-29.64-.06-59.27-.01-88.9-.05-1.63-.31-1.61 1.56-1.85 2.6-10.65 61.62-41.2 119.72-86.31 163.06-36.38 35.46-81.96 61.33-131.05 74.4-57.38-57.35-114.66-114.8-171.99-172.21-10-9.72-19.72-19.86-27.65-31.38-11.53-16.63-19.63-35.66-23.56-55.51-6.14-31.96-2.08-65.97 12.5-95.17 12.14-24.33 30.82-45.46 53.9-59.91 17.99-11.66 38.65-19.09 59.88-21.94z\" fill=\"#474747\"/>\n <g fill=\"#bfbfbf\">\n <path d=\"m479.81 483.85c7.98-9.19 20.02-14.72 32.21-14.61 47.68 0 95.36 0 143.03.01 80.65.06 161.29 0 241.93.07 20.41.05 39.2 16.83 41.25 37.17-.19.33-.58.97-.78 1.29-3.68-18.51-21.57-33.16-40.47-33.05-124.97.1-249.94.12-374.91.17-7.73.13-15.74-.8-23.15 1.96-9.06 2.84-16.73 9.1-22.27 16.7-3.34 4.55-4.39 10.24-7.28 15.03.7-9.09 4.43-17.89 10.44-24.74z\"/>\n <path d=\"m234.31 752.44c13.75-2.67 28.74 4.88 34.56 17.66 4.44 9.08 4.22 20.27-.71 29.1-5.14 9.93-15.96 16.55-27.12 16.8-8.27.38-16.52-2.84-22.67-8.32-9.03-8.2-12.77-21.73-8.9-33.36 3.36-11.16 13.35-19.93 24.84-21.88z\"/>\n </g>\n <path d=\"m498.92 476.86c7.41-2.76 15.42-1.83 23.15-1.96 124.97-.05 249.94-.07 374.91-.17 18.9-.11 36.79 14.54 40.47 33.05.2-.32.59-.96.78-1.29l.24-.4c.7 5.85-.16 11.72-1.38 17.43-3.81 14.23-15.62 25.88-29.83 29.7-4.61 1.33-9.44 1.52-14.2 1.48-126.69-.09-253.39-.07-380.08-.03-9.64.2-19.3-2.89-26.92-8.8-11.33-8.58-17.88-23.11-16.69-37.28 2.89-4.79 3.94-10.48 7.28-15.03 5.54-7.6 13.21-13.86 22.27-16.7z\" fill=\"#b0b0b0\"/>\n <path d=\"m59.49 636.08c.99 1.52 2.09 3.04 2.52 4.85 3.62 13.71 8.92 26.88 13.88 40.15 3.88 9.31 7.78 18.62 12.25 27.67 3.26 8.08 7.9 15.48 11.9 23.2 17.96 32.76 39.76 63.48 65.17 90.87 15.01 17.34 32.26 32.54 49.72 47.35 22.1 17.72 45.46 33.94 70.33 47.54 59.64 33.1 126.66 52.67 194.71 57.18 81.31 5.74 163.99-10.52 237.3-46.12 1.02 1.06 2.04 2.12 3.05 3.22l.03.61c-42.32 21.03-87.88 35.53-134.56 42.91-56.91 8.9-115.46 7.49-171.82-4.5-67.89-14.35-132.42-44.21-187.42-86.51-63.52-48.63-114.32-113.73-145.86-187.27-8.42-19.87-15.93-40.22-21.2-61.15z\" fill=\"#939393\"/>\n <path d=\"m778.34 752.53c7.71-1.29 16.08 0 22.6 4.46 9.81 5.86 15.73 17.59 14.87 28.96-.22 7.53-3.8 14.6-8.67 20.2-5.88 5.71-13.84 9.69-22.16 9.66-10.81.51-21.85-5.05-27.61-14.25-4.87-6.83-6.21-15.71-4.73-23.85 2.33-12.59 13.06-23.12 25.7-25.18z\" fill=\"#767676\"/>\n <path d=\"m506.37 864.47c8.73-1.56 18.06.66 25.08 6.11 10.94 8.14 15.55 23.72 10.58 36.46-3.37 9.44-11.46 16.91-21.07 19.68-9.35 2.81-19.91.93-27.77-4.86-10.78-7.54-15.78-22.22-11.91-34.79 3.17-11.53 13.33-20.58 25.09-22.6z\" fill=\"#bebebe\"/>\n </svg>\n </a>\n Google Authenticator\n </span>\n </div>\n </div>\n \n </div>\n\n <div *ngIf=\"mode === 'code-input'\" class=\"code-input\">\n <div>\n Enter the 6-digit code you see in the App.\n </div>\n\n <app-code-input\n [codeLength]=\"6\"\n (codeChanged)=\"codeChanged($event)\">\n </app-code-input>\n \n <div class=\"checkboxes\">\n <mat-checkbox name=\"trustDevice\" [(ngModel)]=\"trustDevice\" [disableRipple]=\"true\">\n Trust this device\n </mat-checkbox>\n <mat-checkbox name=\"default\" [(ngModel)]=\"default\" [disableRipple]=\"true\">\n Make this the default 2-step verification method\n </mat-checkbox>\n </div>\n </div>\n </mat-dialog-content>\n <mat-dialog-actions>\n <ng-container *ngIf=\"appType\">\n <button\n *ngIf=\"mode === 'qr-code'\"\n type=\"button\"\n mat-button\n color=\"primary\"\n (click)=\"next()\">\n Next\n </button>\n <button\n *ngIf=\"mode === 'code-input'\"\n type=\"submit\"\n mat-button\n color=\"primary\"\n (click)=\"next()\">\n Verify\n </button> \n </ng-container>\n <button\n type=\"button\"\n mat-button\n [mat-dialog-close]=\"null\">\n Cancel\n </button>\n </mat-dialog-actions>\n </fs-dialog>\n</form>\n", styles: ["ul{margin:0;padding-left:24px}qr-code{display:flex;justify-content:center;margin:30px}app-code-input{margin-top:10px}.code-input{width:400px}.app-types{text-align:center;padding:0 40px}.app-types .row{display:flex;justify-content:center}.app-types .row span{display:flex;flex-direction:column;text-align:center;max-width:100px}.app-types .row span+span{margin-left:40px}.checkboxes{margin:8px 0}.checkboxes mat-checkbox{display:block}\n"], components: [{ type: i3.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode"] }, { type: i4$1.QrCodeComponent, selector: "qr-code", inputs: ["value", "size", "darkColor", "lightColor", "errorCorrectionLevel", "centerImageSrc", "centerImageSize", "margin"] }, { type: CodeInputComponent, selector: "app-code-input", inputs: ["codeLength", "code"], outputs: ["codeCompleted", "codeChanged"] }, { type: i6$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: i6.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: i8.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i8.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i8.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i9.FsFormDirective, selector: "[fsForm]", inputs: ["wrapperSelector", "messageSelector", "hintSelector", "labelSelector", "autocomplete", "shortcuts", "confirm", "confirmDialog", "confirmDrawer", "confirmBrowser", "confirmTabs", "dirtySubmitButton", "submit", "successDelay", "errorDelay", "tabGroup"], outputs: ["fsForm", "invalid", "valid", "submitted", "reseted", "cleared"] }, { type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i9$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i11.FsSkeletonContentDirective, selector: "[fsSkeleton]", inputs: ["fsSkeleton", "fsSkeletonPattern"] }, { type: i8.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i8.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i9.FsFormNoFsValidatorsDirective, selector: "[ngModel]:not([required]):not([fsFormRequired]):not([fsFormCompare]):not([fsFormDateRange]):not([fsFormEmail]):not([fsFormEmails]):not([fsFormFunction]):not([fsFormGreater]):not([fsFormInteger]):not([fsFormLesser]):not([fsFormMax]):not([fsFormMaxLength]):not([fsFormMin]):not([fsFormMinLength]):not([fsFormNumeric]):not([fsFormPattern]):not([fsFormPhone]):not([fsFormUrl]):not([validate])" }, { type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }, { type: i9.FsSubmitButtonDirective, selector: "button[type=\"submit\"]", inputs: ["name", "dirtySubmit"] }, { type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["type", "mat-dialog-close", "aria-label", "matDialogClose"], exportAs: ["matDialogClose"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
532
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: AppComponent, decorators: [{
533
- type: Component,
534
- args: [{
535
- templateUrl: './app.component.html',
536
- styleUrls: ['./app.component.scss'],
537
- changeDetection: ChangeDetectionStrategy.OnPush,
538
- }]
539
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
540
- type: Inject,
541
- args: [MAT_DIALOG_DATA]
542
- }] }, { type: i1.MatDialogRef }, { type: i0.ChangeDetectorRef }, { type: i2.FsMessage }]; }, propDecorators: { form: [{
543
- type: ViewChild,
544
- args: [FsFormDirective]
481
+ class AppComponent {
482
+ constructor(_data, _dialogRef, _cdRef, _message) {
483
+ this._data = _data;
484
+ this._dialogRef = _dialogRef;
485
+ this._cdRef = _cdRef;
486
+ this._message = _message;
487
+ this.mode = 'qr-code';
488
+ this.trustDevice = true;
489
+ this.verify = () => {
490
+ return this.twoFactorManageService.verificationMethodVerify$(this.code, this.trustDevice)
491
+ .pipe(tap(() => {
492
+ this._message.success('Created app authenticator verification method');
493
+ this._dialogRef.close(true);
494
+ }));
495
+ };
496
+ }
497
+ ngOnInit() {
498
+ this.twoFactorManageService = this._data.twoFactorManageService;
499
+ this.accountId = this._data.accountId;
500
+ this.default = !this.twoFactorManageService.hasVerificationMethods;
501
+ }
502
+ appTypeGoogle() {
503
+ this.appTypeSelect('google');
504
+ }
505
+ appTypeAuthy() {
506
+ this.appTypeSelect('authy');
507
+ }
508
+ appTypeSelect(appType) {
509
+ this.appType = appType;
510
+ this.twoFactorManageService.verificationMethodCreate$({
511
+ type: VerificationMethodType.App,
512
+ default: this.default,
513
+ })
514
+ .subscribe((response) => {
515
+ this.qrCodeUrl = response.qrCodeUrl;
516
+ this._cdRef.markForCheck();
517
+ });
518
+ }
519
+ codeCompleted() {
520
+ this.form.triggerSubmit();
521
+ }
522
+ codeChanged(code) {
523
+ this.code = code;
524
+ this.form.dirty();
525
+ }
526
+ next() {
527
+ this.mode = 'code-input';
528
+ }
529
+ }
530
+ AppComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: AppComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: i1.MatDialogRef }, { token: i0.ChangeDetectorRef }, { token: i2.FsMessage }], target: i0.ɵɵFactoryTarget.Component });
531
+ AppComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: AppComponent, selector: "ng-component", viewQueries: [{ propertyName: "form", first: true, predicate: FsFormDirective, descendants: true }], ngImport: i0, template: "<form fsForm [submit]=\"verify\">\n <fs-dialog>\n <h1 mat-dialog-title>Authenticator App Setup</h1>\n <mat-dialog-content>\n\n <div *ngIf=\"mode === 'qr-code'\" class=\"qr-code\">\n <ng-container *ngIf=\"appType\">\n <ol>\n <li>\n <ng-container *ngIf=\"appType === 'authy'\">\n Install the Authy Authenticator App from the <a href=\"https://apps.apple.com/us/app/authy/id494168017\" target=\"_blank\">App Store</a> or\n the <a href=\"https://play.google.com/store/apps/details?id=com.authy.authy\" target=\"_blank\">Google Play Store</a>.\n </ng-container>\n\n <ng-container *ngIf=\"appType === 'google'\">\n Install the Google Authenticator App from the <a href=\"https://apps.apple.com/us/app/google-authenticator/id388497605\" target=\"_blank\">App Store</a> or\n the <a href=\"https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2&hl=en_US&gl=US\" target=\"_blank\">Google Play Store</a>.\n </ng-container>\n </li>\n <ng-container *ngIf=\"appType === 'authy'\">\n <li>\n Open the Authy app and select <b>Add Account</b>.\n </li>\n <li>\n Select <b>Scan QR Code</b> and scan the QR code below.\n </li>\n </ng-container> \n <ng-container *ngIf=\"appType === 'google'\">\n <li>\n Open the Google Authentictor app and click the <b>Plus icon</b> in the lower right corner.\n </li>\n <li>\n Select <b>Scan a QR code</b> and scan the QR code below.\n </li>\n </ng-container>\n </ol>\n\n <qr-code \n *fsSkeleton=\"qrCodeUrl\"\n [value]=\"qrCodeUrl\"\n size=\"200\"\n errorCorrectionLevel=\"H\"\n [margin]=\"0\">\n </qr-code> \n </ng-container>\n\n <div class=\"app-types\" *ngIf=\"!appType\">\n <p>Select the Authenticator App you prefer</p>\n\n <div class=\"row\">\n <span>\n <a (click)=\"appTypeAuthy()\">\n <svg width=\"50\" height=\"50\" viewBox=\"0 0 256 256\" xmlns=\"http://www.w3.org/2000/svg\" preserveAspectRatio=\"xMidYMid\"><path d=\"M256 127.998C256 198.696 198.694 256 127.997 256 57.304 256 0 198.696 0 127.998 0 57.305 57.304 0 127.997 0 198.694 0 256 57.305 256 127.998z\" fill=\"#EC1C24\"/><path d=\"M117.024 100.89l30.691 30.68c4.43 4.436 11.623 4.436 16.064 0 4.431-4.435 4.441-11.622 0-16.058L133.086 84.82C111.125 62.854 75.631 62.5 53.204 83.704a9.536 9.536 0 0 0-.605.548c-.098.098-.178.202-.275.29-.1.096-.202.182-.297.278-.194.193-.371.396-.54.597-21.215 22.437-20.85 57.932 1.113 79.897L83.292 196c4.44 4.433 11.623 4.433 16.062 0 4.442-4.437 4.442-11.633.011-16.06l-30.693-30.691c-13.398-13.393-13.488-35.129-.278-48.637 13.506-13.21 35.23-13.114 48.63.279zm39.612-40.873c-4.435 4.437-4.435 11.623.012 16.059l30.681 30.693c13.39 13.392 13.477 35.125.268 48.636-13.51 13.2-35.227 13.112-48.623-.282l-30.692-30.689c-4.438-4.437-11.633-4.437-16.066 0-4.443 4.433-4.443 11.642 0 16.065l30.682 30.694c21.968 21.965 57.458 22.322 79.889 1.116.208-.184.404-.355.61-.549.094-.095.182-.192.273-.29.1-.095.197-.183.29-.289.197-.183.365-.384.54-.594 21.215-22.428 20.86-57.911-1.102-79.889l-30.692-30.682c-4.436-4.443-11.638-4.443-16.07.001z\" fill=\"#FFF\"/></svg>\n </a>\n Authy\n </span>\n \n <span>\n <a (click)=\"appTypeGoogle()\"> \n <svg width=\"50\" height=\"50\" viewBox=\"0 0 1024 1024\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"m457.07 45.92c73.67-8.62 149.41.22 218.93 26.24 62.75 23.47 120.59 60.41 167.72 108.09-40.31 39.97-80.25 80.31-120.51 120.33-25.95-25.45-56.19-46.65-89.47-61.37-44.22-19.82-93.39-28.54-141.72-25.2-54.6 3.52-108.11 22.49-152.63 54.3-55.24 38.95-96.61 97.22-114.8 162.35-13.64 47.78-14.77 98.97-3.76 147.4 8.85 39.61 26.09 77.29 50.05 110.03 22.24 30.45 50.3 56.64 82.22 76.71 36.79 23.24 78.76 38.22 121.96 43.48 37.02 4.65 74.9 2.23 111.05-7 3.97-1.91 6.24 2.61 8.73 4.86 40.74 40.95 81.68 81.7 122.43 122.63-73.31 35.6-155.99 51.86-237.3 46.12-68.05-4.51-135.07-24.08-194.71-57.18-24.87-13.6-48.23-29.82-70.33-47.54-17.46-14.81-34.71-30.01-49.72-47.35-25.41-27.39-47.21-58.11-65.17-90.87-4-7.72-8.64-15.12-11.9-23.2-4.47-9.05-8.37-18.36-12.25-27.67-4.96-13.27-10.26-26.44-13.88-40.15-.43-1.81-1.53-3.33-2.52-4.85-8.3-28.66-12.95-58.33-15.44-88.04-2.62-37.36-1.33-75.05 4.78-112.03 12.18-75.48 43.41-147.74 89.86-208.44 30.12-39.5 66.53-74.21 107.46-102.35 62.44-43.11 135.53-70.69 210.92-79.3m49.18 50.48c-5.7.99-10.96 3.76-15.38 7.43-10.4 8.93-14.14 24.81-8.17 37.28 6.33 15.02 25.16 23.1 40.36 17 15.43-5.24 24.78-23.51 19.74-39.06-4.1-15.43-20.92-25.79-36.55-22.65m-267.96 111.99c-5.33.28-10.59 1.92-15.16 4.68-11.47 7.03-17.88 21.74-14.36 34.86 3.09 14.08 16.78 25.06 31.26 24.61 15.03.41 29.08-11.39 31.54-26.17 2.24-10.33-1.61-21.55-9.14-28.85-6.24-6.33-15.3-9.62-24.14-9.13m-115.96 272c-6.62 1.23-12.84 4.58-17.54 9.4-9.45 9.72-11.72 25.57-5.02 37.42 7.16 13.96 25.48 20.86 39.98 14.62 15.02-5.51 23.99-23.42 19.06-38.71-4.04-15.41-20.86-25.96-36.48-22.73m111.98 272.05c-11.49 1.95-21.48 10.72-24.84 21.88-3.87 11.63-.13 25.16 8.9 33.36 6.15 5.48 14.4 8.7 22.67 8.32 11.16-.25 21.98-6.87 27.12-16.8 4.93-8.83 5.15-20.02.71-29.1-5.82-12.78-20.81-20.33-34.56-17.66m272.06 112.03c-11.76 2.02-21.92 11.07-25.09 22.6-3.87 12.57 1.13 27.25 11.91 34.79 7.86 5.79 18.42 7.67 27.77 4.86 9.61-2.77 17.7-10.24 21.07-19.68 4.97-12.74.36-28.32-10.58-36.46-7.02-5.45-16.35-7.67-25.08-6.11z\" fill=\"#a0a0a0\"/>\n <g fill=\"#c1c1c1\">\n <path d=\"m506.25 96.4c15.63-3.14 32.45 7.22 36.55 22.65 5.04 15.55-4.31 33.82-19.74 39.06-15.2 6.1-34.03-1.98-40.36-17-5.97-12.47-2.23-28.35 8.17-37.28 4.42-3.67 9.68-6.44 15.38-7.43z\"/>\n <path d=\"m122.33 480.39c15.62-3.23 32.44 7.32 36.48 22.73 4.93 15.29-4.04 33.2-19.06 38.71-14.5 6.24-32.82-.66-39.98-14.62-6.7-11.85-4.43-27.7 5.02-37.42 4.7-4.82 10.92-8.17 17.54-9.4z\"/>\n </g>\n <path d=\"m843.72 180.25.11-.11c24.64 25.12 46.96 52.6 65.61 82.47 36.01 57.16 59.38 122.22 67.87 189.25 5.67 44.88 5.27 90.6-2.05 135.27-12.7 80.01-46.94 156.41-97.9 219.36-42.3 52.48-95.87 96.04-156.41 125.76l-.63-.26c-1.01-1.1-2.03-2.16-3.05-3.22-40.75-40.93-81.69-81.68-122.43-122.63-2.49-2.25-4.76-6.77-8.73-4.86-36.15 9.23-74.03 11.65-111.05 7-43.2-5.26-85.17-20.24-121.96-43.48-31.92-20.07-59.98-46.26-82.22-76.71-23.96-32.74-41.2-70.42-50.05-110.03-11.01-48.43-9.88-99.62 3.76-147.4 18.19-65.13 59.56-123.4 114.8-162.35 44.52-31.81 98.03-50.78 152.63-54.3 48.33-3.34 97.5 5.38 141.72 25.2 33.28 14.72 63.52 35.92 89.47 61.37 40.26-40.02 80.2-80.36 120.51-120.33m-351.75 183.97c-21.23 2.85-41.89 10.28-59.88 21.94-23.08 14.45-41.76 35.58-53.9 59.91-14.58 29.2-18.64 63.21-12.5 95.17 3.93 19.85 12.03 38.88 23.56 55.51 7.93 11.52 17.65 21.66 27.65 31.38 57.33 57.41 114.61 114.86 171.99 172.21 49.09-13.07 94.67-38.94 131.05-74.4 45.11-43.34 75.66-101.44 86.31-163.06.24-1.04.22-2.91 1.85-2.6 29.63.04 59.26-.01 88.9.05 19.04-.3 36.87-14.77 40.76-33.46.22-1.21 0-2.32-.67-3.35 1.22-5.71 2.08-11.58 1.38-17.43l-.24.4c-2.05-20.34-20.84-37.12-41.25-37.17-80.64-.07-161.28-.01-241.93-.07-6.44-22.08-18.5-42.33-34.03-59.23-25.8-27.5-62.26-45.01-100.02-46.82-9.68.02-19.44-.54-29.03 1.02m286.37 388.31c-12.64 2.06-23.37 12.59-25.7 25.18-1.48 8.14-.14 17.02 4.73 23.85 5.76 9.2 16.8 14.76 27.61 14.25 8.32.03 16.28-3.95 22.16-9.66 4.87-5.6 8.45-12.67 8.67-20.2.86-11.37-5.06-23.1-14.87-28.96-6.52-4.46-14.89-5.75-22.6-4.46z\" fill=\"#686868\"/>\n <path d=\"m238.29 208.39c8.84-.49 17.9 2.8 24.14 9.13 7.53 7.3 11.38 18.52 9.14 28.85-2.46 14.78-16.51 26.58-31.54 26.17-14.48.45-28.17-10.53-31.26-24.61-3.52-13.12 2.89-27.83 14.36-34.86 4.57-2.76 9.83-4.4 15.16-4.68z\" fill=\"#c3c3c3\"/>\n <path d=\"m491.97 364.22c9.59-1.56 19.35-1 29.03-1.02 37.76 1.81 74.22 19.32 100.02 46.82 15.53 16.9 27.59 37.15 34.03 59.23-47.67-.01-95.35-.01-143.03-.01-12.19-.11-24.23 5.42-32.21 14.61-6.01 6.85-9.74 15.65-10.44 24.74-1.19 14.17 5.36 28.7 16.69 37.28 7.62 5.91 17.28 9 26.92 8.8 126.69-.04 253.39-.06 380.08.03 4.76.04 9.59-.15 14.2-1.48 14.21-3.82 26.02-15.47 29.83-29.7.67 1.03.89 2.14.67 3.35-3.89 18.69-21.72 33.16-40.76 33.46-29.64-.06-59.27-.01-88.9-.05-1.63-.31-1.61 1.56-1.85 2.6-10.65 61.62-41.2 119.72-86.31 163.06-36.38 35.46-81.96 61.33-131.05 74.4-57.38-57.35-114.66-114.8-171.99-172.21-10-9.72-19.72-19.86-27.65-31.38-11.53-16.63-19.63-35.66-23.56-55.51-6.14-31.96-2.08-65.97 12.5-95.17 12.14-24.33 30.82-45.46 53.9-59.91 17.99-11.66 38.65-19.09 59.88-21.94z\" fill=\"#474747\"/>\n <g fill=\"#bfbfbf\">\n <path d=\"m479.81 483.85c7.98-9.19 20.02-14.72 32.21-14.61 47.68 0 95.36 0 143.03.01 80.65.06 161.29 0 241.93.07 20.41.05 39.2 16.83 41.25 37.17-.19.33-.58.97-.78 1.29-3.68-18.51-21.57-33.16-40.47-33.05-124.97.1-249.94.12-374.91.17-7.73.13-15.74-.8-23.15 1.96-9.06 2.84-16.73 9.1-22.27 16.7-3.34 4.55-4.39 10.24-7.28 15.03.7-9.09 4.43-17.89 10.44-24.74z\"/>\n <path d=\"m234.31 752.44c13.75-2.67 28.74 4.88 34.56 17.66 4.44 9.08 4.22 20.27-.71 29.1-5.14 9.93-15.96 16.55-27.12 16.8-8.27.38-16.52-2.84-22.67-8.32-9.03-8.2-12.77-21.73-8.9-33.36 3.36-11.16 13.35-19.93 24.84-21.88z\"/>\n </g>\n <path d=\"m498.92 476.86c7.41-2.76 15.42-1.83 23.15-1.96 124.97-.05 249.94-.07 374.91-.17 18.9-.11 36.79 14.54 40.47 33.05.2-.32.59-.96.78-1.29l.24-.4c.7 5.85-.16 11.72-1.38 17.43-3.81 14.23-15.62 25.88-29.83 29.7-4.61 1.33-9.44 1.52-14.2 1.48-126.69-.09-253.39-.07-380.08-.03-9.64.2-19.3-2.89-26.92-8.8-11.33-8.58-17.88-23.11-16.69-37.28 2.89-4.79 3.94-10.48 7.28-15.03 5.54-7.6 13.21-13.86 22.27-16.7z\" fill=\"#b0b0b0\"/>\n <path d=\"m59.49 636.08c.99 1.52 2.09 3.04 2.52 4.85 3.62 13.71 8.92 26.88 13.88 40.15 3.88 9.31 7.78 18.62 12.25 27.67 3.26 8.08 7.9 15.48 11.9 23.2 17.96 32.76 39.76 63.48 65.17 90.87 15.01 17.34 32.26 32.54 49.72 47.35 22.1 17.72 45.46 33.94 70.33 47.54 59.64 33.1 126.66 52.67 194.71 57.18 81.31 5.74 163.99-10.52 237.3-46.12 1.02 1.06 2.04 2.12 3.05 3.22l.03.61c-42.32 21.03-87.88 35.53-134.56 42.91-56.91 8.9-115.46 7.49-171.82-4.5-67.89-14.35-132.42-44.21-187.42-86.51-63.52-48.63-114.32-113.73-145.86-187.27-8.42-19.87-15.93-40.22-21.2-61.15z\" fill=\"#939393\"/>\n <path d=\"m778.34 752.53c7.71-1.29 16.08 0 22.6 4.46 9.81 5.86 15.73 17.59 14.87 28.96-.22 7.53-3.8 14.6-8.67 20.2-5.88 5.71-13.84 9.69-22.16 9.66-10.81.51-21.85-5.05-27.61-14.25-4.87-6.83-6.21-15.71-4.73-23.85 2.33-12.59 13.06-23.12 25.7-25.18z\" fill=\"#767676\"/>\n <path d=\"m506.37 864.47c8.73-1.56 18.06.66 25.08 6.11 10.94 8.14 15.55 23.72 10.58 36.46-3.37 9.44-11.46 16.91-21.07 19.68-9.35 2.81-19.91.93-27.77-4.86-10.78-7.54-15.78-22.22-11.91-34.79 3.17-11.53 13.33-20.58 25.09-22.6z\" fill=\"#bebebe\"/>\n </svg>\n </a>\n Google Authenticator\n </span>\n </div>\n </div>\n \n </div>\n\n <div *ngIf=\"mode === 'code-input'\" class=\"code-input\">\n <div>\n Enter the 6-digit code you see in the App.\n </div>\n\n <app-code-input\n [codeLength]=\"6\"\n (codeChanged)=\"codeChanged($event)\">\n </app-code-input>\n \n <div class=\"checkboxes\">\n <mat-checkbox name=\"trustDevice\" [(ngModel)]=\"trustDevice\" [disableRipple]=\"true\">\n Trust this device\n </mat-checkbox>\n <mat-checkbox name=\"default\" [(ngModel)]=\"default\" [disableRipple]=\"true\">\n Make this the default 2-step verification method\n </mat-checkbox>\n </div>\n </div>\n </mat-dialog-content>\n <mat-dialog-actions>\n <ng-container *ngIf=\"appType\">\n <button\n *ngIf=\"mode === 'qr-code'\"\n type=\"button\"\n mat-button\n color=\"primary\"\n (click)=\"next()\">\n Next\n </button>\n <button\n *ngIf=\"mode === 'code-input'\"\n type=\"submit\"\n mat-button\n color=\"primary\"\n (click)=\"next()\">\n Verify\n </button> \n </ng-container>\n <button\n type=\"button\"\n mat-button\n [mat-dialog-close]=\"null\">\n Cancel\n </button>\n </mat-dialog-actions>\n </fs-dialog>\n</form>\n", styles: ["ul{margin:0;padding-left:24px}qr-code{display:flex;justify-content:center;margin:30px}app-code-input{margin-top:10px}.code-input{width:400px}.app-types{text-align:center;padding:0 40px}.app-types .row{display:flex;justify-content:center}.app-types .row span{display:flex;flex-direction:column;text-align:center;max-width:100px}.app-types .row span+span{margin-left:40px}.checkboxes{margin:8px 0}.checkboxes mat-checkbox{display:block}\n"], components: [{ type: i3.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode"] }, { type: i4$1.QrCodeComponent, selector: "qr-code", inputs: ["value", "size", "darkColor", "lightColor", "errorCorrectionLevel", "centerImageSrc", "centerImageSize", "margin"] }, { type: CodeInputComponent, selector: "app-code-input", inputs: ["codeLength", "code"], outputs: ["codeCompleted", "codeChanged"] }, { type: i6$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: i6.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: i8.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i8.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i8.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i9.FsFormDirective, selector: "[fsForm]", inputs: ["wrapperSelector", "messageSelector", "hintSelector", "labelSelector", "autocomplete", "shortcuts", "confirm", "confirmDialog", "confirmDrawer", "confirmBrowser", "confirmTabs", "dirtySubmitButton", "submit", "successDelay", "errorDelay", "tabGroup"], outputs: ["fsForm", "invalid", "valid", "submitted", "reseted", "cleared"] }, { type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i9$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i11.FsSkeletonContentDirective, selector: "[fsSkeleton]", inputs: ["fsSkeleton", "fsSkeletonPattern"] }, { type: i8.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i8.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i9.FsFormNoFsValidatorsDirective, selector: "[ngModel]:not([required]):not([fsFormRequired]):not([fsFormCompare]):not([fsFormDateRange]):not([fsFormEmail]):not([fsFormEmails]):not([fsFormFunction]):not([fsFormGreater]):not([fsFormInteger]):not([fsFormLesser]):not([fsFormMax]):not([fsFormMaxLength]):not([fsFormMin]):not([fsFormMinLength]):not([fsFormNumeric]):not([fsFormPattern]):not([fsFormPhone]):not([fsFormUrl]):not([validate])" }, { type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }, { type: i9.FsSubmitButtonDirective, selector: "button[type=\"submit\"]", inputs: ["name", "dirtySubmit"] }, { type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["type", "mat-dialog-close", "aria-label", "matDialogClose"], exportAs: ["matDialogClose"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
532
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: AppComponent, decorators: [{
533
+ type: Component,
534
+ args: [{
535
+ templateUrl: './app.component.html',
536
+ styleUrls: ['./app.component.scss'],
537
+ changeDetection: ChangeDetectionStrategy.OnPush,
538
+ }]
539
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
540
+ type: Inject,
541
+ args: [MAT_DIALOG_DATA]
542
+ }] }, { type: i1.MatDialogRef }, { type: i0.ChangeDetectorRef }, { type: i2.FsMessage }]; }, propDecorators: { form: [{
543
+ type: ViewChild,
544
+ args: [FsFormDirective]
545
545
  }] } });
546
546
 
547
- class EmailComponent {
548
- constructor(_data, _dialogRef, _cdRef, _message) {
549
- this._data = _data;
550
- this._dialogRef = _dialogRef;
551
- this._cdRef = _cdRef;
552
- this._message = _message;
553
- this.verificationMethod = null;
554
- this.trustDevice = true;
555
- this.resend = () => {
556
- return this.twoFactorManageService.verificationMethodResend()
557
- .pipe(tap(() => {
558
- this._message.success('Resent verification code');
559
- }));
560
- };
561
- this.submit = () => {
562
- return of(true)
563
- .pipe(switchMap(() => {
564
- return this.verificationMethod ?
565
- this.twoFactorManageService.verificationMethodVerify$(this.code, this.trustDevice)
566
- .pipe(tap((verificationMethod) => {
567
- this._message.success('Created email verification method');
568
- this._dialogRef.close(verificationMethod);
569
- })) :
570
- this.twoFactorManageService.verificationMethodCreate$({
571
- type: VerificationMethodType.Email,
572
- email: this.email,
573
- default: this.default,
574
- })
575
- .pipe(tap((verificationMethod) => {
576
- this.verificationMethod = verificationMethod;
577
- this.form.clear();
578
- this._cdRef.markForCheck();
579
- }));
580
- }));
581
- };
582
- this.twoFactorManageService = _data.twoFactorManageService;
583
- this.default = !this.twoFactorManageService.hasVerificationMethods;
584
- }
585
- codeCompleted() {
586
- if (!this.form.submitting) {
587
- this.form.triggerSubmit();
588
- }
589
- }
590
- codeChanged(code) {
591
- this.code = code;
592
- }
593
- }
594
- EmailComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: EmailComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: i1.MatDialogRef }, { token: i0.ChangeDetectorRef }, { token: i2.FsMessage }], target: i0.ɵɵFactoryTarget.Component });
595
- EmailComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: EmailComponent, selector: "ng-component", viewQueries: [{ propertyName: "form", first: true, predicate: FsFormDirective, descendants: true }], ngImport: i0, template: "<form fsForm [submit]=\"submit\">\n <fs-dialog>\n <h1 mat-dialog-title>\n Email Setup\n </h1>\n <mat-dialog-content>\n <ng-container *ngIf=\"verificationMethod; else notVerificationMethod\">\n <fs-2fa-verification\n [verificationMethod]=\"verificationMethod\"\n (codeChanged)=\"codeChanged($event)\"\n [resend]=\"resend\"\n [(trustDevice)]=\"trustDevice\">\n </fs-2fa-verification>\n </ng-container>\n\n <ng-template #notVerificationMethod>\n <p>The app will only use this email for verifying your account security. </p>\n <mat-form-field>\n <mat-label>Email</mat-label>\n <input\n matInput\n [required]=\"true\"\n [(ngModel)]=\"email\"\n [fsFormEmail]=\"true\"\n name=\"email\">\n </mat-form-field>\n <mat-checkbox \n name=\"default\"\n [(ngModel)]=\"default\"\n [disableRipple]=\"true\">\n Make this the default 2-step verification method\n </mat-checkbox>\n </ng-template>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button\n mat-button\n color=\"primary\"\n type=\"submit\">\n Next\n </button>\n <button\n mat-button\n type=\"button\"\n [mat-dialog-close]=\"undefined\">\n Cancel\n </button>\n </mat-dialog-actions>\n </fs-dialog>\n</form>\n", styles: [":host ::ng-deep mat-checkbox .mat-ripple{display:none}mat-form-field{width:100%}mat-dialog-content{width:400px}p{margin-top:0}app-code-input{margin-bottom:5px;display:block}\n"], components: [{ type: i3.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode"] }, { type: Fs2faVerificationComponent, selector: "fs-2fa-verification", inputs: ["verificationMethod", "resend", "showTrustedDevice", "trustDevice", "trustDays", "formatRecipient", "getVerificationMethods", "selectVerificationMethod"], outputs: ["verified", "codeChanged", "codeCompleted", "trustDeviceChange"] }, { type: i5$1.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i6$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: i6.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: i8.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i8.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i8.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i9.FsFormDirective, selector: "[fsForm]", inputs: ["wrapperSelector", "messageSelector", "hintSelector", "labelSelector", "autocomplete", "shortcuts", "confirm", "confirmDialog", "confirmDrawer", "confirmBrowser", "confirmTabs", "dirtySubmitButton", "submit", "successDelay", "errorDelay", "tabGroup"], outputs: ["fsForm", "invalid", "valid", "submitted", "reseted", "cleared"] }, { type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i9$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5$1.MatLabel, selector: "mat-label" }, { type: i11$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: i8.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: i8.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i8.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i8.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i9.FsFormRequiredDirective, selector: "[fsFormRequired],[ngModel][required]", inputs: ["fsFormRequired", "required", "fsFormRequiredMessage"] }, { type: i9.FsFormEmailDirective, selector: "[fsFormEmail]", inputs: ["fsFormEmail", "fsFormEmailMessage"] }, { type: i9.FsFormNoFsValidatorsDirective, selector: "[ngModel]:not([required]):not([fsFormRequired]):not([fsFormCompare]):not([fsFormDateRange]):not([fsFormEmail]):not([fsFormEmails]):not([fsFormFunction]):not([fsFormGreater]):not([fsFormInteger]):not([fsFormLesser]):not([fsFormMax]):not([fsFormMaxLength]):not([fsFormMin]):not([fsFormMinLength]):not([fsFormNumeric]):not([fsFormPattern]):not([fsFormPhone]):not([fsFormUrl]):not([validate])" }, { type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }, { type: i9.FsSubmitButtonDirective, selector: "button[type=\"submit\"]", inputs: ["name", "dirtySubmit"] }, { type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["type", "mat-dialog-close", "aria-label", "matDialogClose"], exportAs: ["matDialogClose"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
596
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: EmailComponent, decorators: [{
597
- type: Component,
598
- args: [{
599
- templateUrl: './email.component.html',
600
- styleUrls: ['./email.component.scss'],
601
- changeDetection: ChangeDetectionStrategy.OnPush,
602
- }]
603
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
604
- type: Inject,
605
- args: [MAT_DIALOG_DATA]
606
- }] }, { type: i1.MatDialogRef }, { type: i0.ChangeDetectorRef }, { type: i2.FsMessage }]; }, propDecorators: { form: [{
607
- type: ViewChild,
608
- args: [FsFormDirective, { static: false }]
547
+ class EmailComponent {
548
+ constructor(_data, _dialogRef, _cdRef, _message) {
549
+ this._data = _data;
550
+ this._dialogRef = _dialogRef;
551
+ this._cdRef = _cdRef;
552
+ this._message = _message;
553
+ this.verificationMethod = null;
554
+ this.trustDevice = true;
555
+ this.resend = () => {
556
+ return this.twoFactorManageService.verificationMethodResend()
557
+ .pipe(tap(() => {
558
+ this._message.success('Resent verification code');
559
+ }));
560
+ };
561
+ this.submit = () => {
562
+ return of(true)
563
+ .pipe(switchMap(() => {
564
+ return this.verificationMethod ?
565
+ this.twoFactorManageService.verificationMethodVerify$(this.code, this.trustDevice)
566
+ .pipe(tap((verificationMethod) => {
567
+ this._message.success('Created email verification method');
568
+ this._dialogRef.close(verificationMethod);
569
+ })) :
570
+ this.twoFactorManageService.verificationMethodCreate$({
571
+ type: VerificationMethodType.Email,
572
+ email: this.email,
573
+ default: this.default,
574
+ })
575
+ .pipe(tap((verificationMethod) => {
576
+ this.verificationMethod = verificationMethod;
577
+ this.form.clear();
578
+ this._cdRef.markForCheck();
579
+ }));
580
+ }));
581
+ };
582
+ this.twoFactorManageService = _data.twoFactorManageService;
583
+ this.default = !this.twoFactorManageService.hasVerificationMethods;
584
+ }
585
+ codeCompleted() {
586
+ if (!this.form.submitting) {
587
+ this.form.triggerSubmit();
588
+ }
589
+ }
590
+ codeChanged(code) {
591
+ this.code = code;
592
+ }
593
+ }
594
+ EmailComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: EmailComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: i1.MatDialogRef }, { token: i0.ChangeDetectorRef }, { token: i2.FsMessage }], target: i0.ɵɵFactoryTarget.Component });
595
+ EmailComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: EmailComponent, selector: "ng-component", viewQueries: [{ propertyName: "form", first: true, predicate: FsFormDirective, descendants: true }], ngImport: i0, template: "<form fsForm [submit]=\"submit\">\n <fs-dialog>\n <h1 mat-dialog-title>\n Email Setup\n </h1>\n <mat-dialog-content>\n <ng-container *ngIf=\"verificationMethod; else notVerificationMethod\">\n <fs-2fa-verification\n [verificationMethod]=\"verificationMethod\"\n (codeChanged)=\"codeChanged($event)\"\n [resend]=\"resend\"\n [(trustDevice)]=\"trustDevice\">\n </fs-2fa-verification>\n </ng-container>\n\n <ng-template #notVerificationMethod>\n <p>The app will only use this email for verifying your account security. </p>\n <mat-form-field>\n <mat-label>Email</mat-label>\n <input\n matInput\n [required]=\"true\"\n [(ngModel)]=\"email\"\n [fsFormEmail]=\"true\"\n name=\"email\">\n </mat-form-field>\n <mat-checkbox \n name=\"default\"\n [(ngModel)]=\"default\"\n [disableRipple]=\"true\">\n Make this the default 2-step verification method\n </mat-checkbox>\n </ng-template>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button\n mat-button\n color=\"primary\"\n type=\"submit\">\n Next\n </button>\n <button\n mat-button\n type=\"button\"\n [mat-dialog-close]=\"undefined\">\n Cancel\n </button>\n </mat-dialog-actions>\n </fs-dialog>\n</form>\n", styles: [":host ::ng-deep mat-checkbox .mat-ripple{display:none}mat-form-field{width:100%}mat-dialog-content{width:400px}p{margin-top:0}app-code-input{margin-bottom:5px;display:block}\n"], components: [{ type: i3.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode"] }, { type: Fs2faVerificationComponent, selector: "fs-2fa-verification", inputs: ["verificationMethod", "resend", "showTrustedDevice", "trustDevice", "trustDays", "formatRecipient", "getVerificationMethods", "selectVerificationMethod"], outputs: ["verified", "codeChanged", "codeCompleted", "trustDeviceChange"] }, { type: i5$1.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i6$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: i6.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: i8.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i8.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i8.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i9.FsFormDirective, selector: "[fsForm]", inputs: ["wrapperSelector", "messageSelector", "hintSelector", "labelSelector", "autocomplete", "shortcuts", "confirm", "confirmDialog", "confirmDrawer", "confirmBrowser", "confirmTabs", "dirtySubmitButton", "submit", "successDelay", "errorDelay", "tabGroup"], outputs: ["fsForm", "invalid", "valid", "submitted", "reseted", "cleared"] }, { type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i9$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5$1.MatLabel, selector: "mat-label" }, { type: i11$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: i8.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: i8.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i8.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i8.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i9.FsFormRequiredDirective, selector: "[fsFormRequired],[ngModel][required]", inputs: ["fsFormRequired", "required", "fsFormRequiredMessage"] }, { type: i9.FsFormEmailDirective, selector: "[fsFormEmail]", inputs: ["fsFormEmail", "fsFormEmailMessage"] }, { type: i9.FsFormNoFsValidatorsDirective, selector: "[ngModel]:not([required]):not([fsFormRequired]):not([fsFormCompare]):not([fsFormDateRange]):not([fsFormEmail]):not([fsFormEmails]):not([fsFormFunction]):not([fsFormGreater]):not([fsFormInteger]):not([fsFormLesser]):not([fsFormMax]):not([fsFormMaxLength]):not([fsFormMin]):not([fsFormMinLength]):not([fsFormNumeric]):not([fsFormPattern]):not([fsFormPhone]):not([fsFormUrl]):not([validate])" }, { type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }, { type: i9.FsSubmitButtonDirective, selector: "button[type=\"submit\"]", inputs: ["name", "dirtySubmit"] }, { type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["type", "mat-dialog-close", "aria-label", "matDialogClose"], exportAs: ["matDialogClose"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
596
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: EmailComponent, decorators: [{
597
+ type: Component,
598
+ args: [{
599
+ templateUrl: './email.component.html',
600
+ styleUrls: ['./email.component.scss'],
601
+ changeDetection: ChangeDetectionStrategy.OnPush,
602
+ }]
603
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
604
+ type: Inject,
605
+ args: [MAT_DIALOG_DATA]
606
+ }] }, { type: i1.MatDialogRef }, { type: i0.ChangeDetectorRef }, { type: i2.FsMessage }]; }, propDecorators: { form: [{
607
+ type: ViewChild,
608
+ args: [FsFormDirective, { static: false }]
609
609
  }] } });
610
610
 
611
- class NumberComponent {
612
- constructor(_data, _dialogRef, _cdRef, _message) {
613
- this._data = _data;
614
- this._dialogRef = _dialogRef;
615
- this._cdRef = _cdRef;
616
- this._message = _message;
617
- this.trustDevice = true;
618
- this.verificationMethod = null;
619
- this.resend = () => {
620
- return this.twoFactorManageService.verificationMethodResend()
621
- .pipe(tap(() => {
622
- this._message.success('Resent verification code');
623
- }));
624
- };
625
- this.submit = () => {
626
- return of(true)
627
- .pipe(switchMap(() => {
628
- return this.verificationMethod ?
629
- this.twoFactorManageService.verificationMethodVerify$(this.code, this.trustDevice)
630
- .pipe(tap((verificationMethod) => {
631
- this._message.success('Created text message verification method');
632
- this._dialogRef.close(verificationMethod);
633
- })) :
634
- this.twoFactorManageService.verificationMethodCreate$({
635
- type: VerificationMethodType.Sms,
636
- phoneNumber: this.phone.number,
637
- phoneCode: this.phone.countryCode,
638
- phoneCountry: this.phone.isoCode,
639
- default: this.default,
640
- })
641
- .pipe(tap((verificationMethod) => {
642
- this.verificationMethod = verificationMethod;
643
- this.form.clear();
644
- this._cdRef.markForCheck();
645
- }));
646
- }));
647
- };
648
- this.twoFactorManageService = _data.twoFactorManageService;
649
- this.defaultCountry = _data.defaultCountry;
650
- this.default = !this.twoFactorManageService.hasVerificationMethods;
651
- }
652
- codeCompleted() {
653
- if (!this.form.submitting) {
654
- this.form.triggerSubmit();
655
- }
656
- }
657
- codeChanged(code) {
658
- this.code = code;
659
- }
660
- }
661
- NumberComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: NumberComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: i1.MatDialogRef }, { token: i0.ChangeDetectorRef }, { token: i2.FsMessage }], target: i0.ɵɵFactoryTarget.Component });
662
- NumberComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: NumberComponent, selector: "ng-component", viewQueries: [{ propertyName: "form", first: true, predicate: FsFormDirective, descendants: true }], ngImport: i0, template: "<form fsForm [submit]=\"submit\" [autocomplete]=\"false\">\n <fs-dialog>\n <h1 mat-dialog-title>\n Text Message Setup\n </h1>\n <mat-dialog-content>\n <ng-container *ngIf=\"verificationMethod; else notVerificationMethod\">\n <fs-2fa-verification\n [verificationMethod]=\"verificationMethod\"\n (codeChanged)=\"codeChanged($event)\"\n [resend]=\"resend\"\n [formatRecipient]=\"true\"\n [(trustDevice)]=\"trustDevice\">\n </fs-2fa-verification>\n </ng-container>\n\n <ng-template #notVerificationMethod>\n <p>The app will only use this number for verifying your account security. Message and data rates may apply by your cell phone provider.</p>\n <mat-form-field>\n <mat-label>Phone number</mat-label>\n <fs-phone-field\n [(ngModel)]=\"phone\"\n [country]=\"defaultCountry\"\n name=\"phone\"\n [mode]=\"'object'\"\n autocomplete=\"off\"\n [required]=\"true\">\n </fs-phone-field>\n </mat-form-field>\n <mat-checkbox \n name=\"default\"\n [(ngModel)]=\"default\"\n [disableRipple]=\"true\">\n Make this the default 2-step verification method\n </mat-checkbox>\n </ng-template>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button\n mat-button\n color=\"primary\"\n type=\"submit\">\n Next\n </button>\n <button\n mat-button\n type=\"button\"\n [mat-dialog-close]=\"undefined\">\n Cancel\n </button>\n </mat-dialog-actions>\n </fs-dialog>\n</form>\n", styles: [":host ::ng-deep mat-checkbox .mat-ripple{display:none}app-code-input{margin-bottom:5px;display:block}mat-form-field{width:100%}mat-dialog-content{width:400px}p{margin-top:0}h1{display:flex;align-items:center}h1 mat-icon{margin-right:5px}\n"], components: [{ type: i3.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode"] }, { type: Fs2faVerificationComponent, selector: "fs-2fa-verification", inputs: ["verificationMethod", "resend", "showTrustedDevice", "trustDevice", "trustDays", "formatRecipient", "getVerificationMethods", "selectVerificationMethod"], outputs: ["verified", "codeChanged", "codeCompleted", "trustDeviceChange"] }, { type: i5$1.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i8$1.FsPhoneFieldComponent, selector: "fs-phone-field", inputs: ["allowNumberExt", "placeholder", "required", "disabled", "mode", "country", "name"] }, { type: i6$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: i6.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: i8.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i8.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i8.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i9.FsFormDirective, selector: "[fsForm]", inputs: ["wrapperSelector", "messageSelector", "hintSelector", "labelSelector", "autocomplete", "shortcuts", "confirm", "confirmDialog", "confirmDrawer", "confirmBrowser", "confirmTabs", "dirtySubmitButton", "submit", "successDelay", "errorDelay", "tabGroup"], outputs: ["fsForm", "invalid", "valid", "submitted", "reseted", "cleared"] }, { type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i9$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5$1.MatLabel, selector: "mat-label" }, { type: i8.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i8.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i9.FsFormRequiredDirective, selector: "[fsFormRequired],[ngModel][required]", inputs: ["fsFormRequired", "required", "fsFormRequiredMessage"] }, { type: i8.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i9.FsFormNoFsValidatorsDirective, selector: "[ngModel]:not([required]):not([fsFormRequired]):not([fsFormCompare]):not([fsFormDateRange]):not([fsFormEmail]):not([fsFormEmails]):not([fsFormFunction]):not([fsFormGreater]):not([fsFormInteger]):not([fsFormLesser]):not([fsFormMax]):not([fsFormMaxLength]):not([fsFormMin]):not([fsFormMinLength]):not([fsFormNumeric]):not([fsFormPattern]):not([fsFormPhone]):not([fsFormUrl]):not([validate])" }, { type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }, { type: i9.FsSubmitButtonDirective, selector: "button[type=\"submit\"]", inputs: ["name", "dirtySubmit"] }, { type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["type", "mat-dialog-close", "aria-label", "matDialogClose"], exportAs: ["matDialogClose"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
663
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: NumberComponent, decorators: [{
664
- type: Component,
665
- args: [{
666
- templateUrl: './number.component.html',
667
- styleUrls: ['./number.component.scss'],
668
- changeDetection: ChangeDetectionStrategy.OnPush,
669
- }]
670
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
671
- type: Inject,
672
- args: [MAT_DIALOG_DATA]
673
- }] }, { type: i1.MatDialogRef }, { type: i0.ChangeDetectorRef }, { type: i2.FsMessage }]; }, propDecorators: { form: [{
674
- type: ViewChild,
675
- args: [FsFormDirective, { static: false }]
611
+ class NumberComponent {
612
+ constructor(_data, _dialogRef, _cdRef, _message) {
613
+ this._data = _data;
614
+ this._dialogRef = _dialogRef;
615
+ this._cdRef = _cdRef;
616
+ this._message = _message;
617
+ this.trustDevice = true;
618
+ this.verificationMethod = null;
619
+ this.resend = () => {
620
+ return this.twoFactorManageService.verificationMethodResend()
621
+ .pipe(tap(() => {
622
+ this._message.success('Resent verification code');
623
+ }));
624
+ };
625
+ this.submit = () => {
626
+ return of(true)
627
+ .pipe(switchMap(() => {
628
+ return this.verificationMethod ?
629
+ this.twoFactorManageService.verificationMethodVerify$(this.code, this.trustDevice)
630
+ .pipe(tap((verificationMethod) => {
631
+ this._message.success('Created text message verification method');
632
+ this._dialogRef.close(verificationMethod);
633
+ })) :
634
+ this.twoFactorManageService.verificationMethodCreate$({
635
+ type: VerificationMethodType.Sms,
636
+ phoneNumber: this.phone.number,
637
+ phoneCode: this.phone.countryCode,
638
+ phoneCountry: this.phone.isoCode,
639
+ default: this.default,
640
+ })
641
+ .pipe(tap((verificationMethod) => {
642
+ this.verificationMethod = verificationMethod;
643
+ this.form.clear();
644
+ this._cdRef.markForCheck();
645
+ }));
646
+ }));
647
+ };
648
+ this.twoFactorManageService = _data.twoFactorManageService;
649
+ this.defaultCountry = _data.defaultCountry;
650
+ this.default = !this.twoFactorManageService.hasVerificationMethods;
651
+ }
652
+ codeCompleted() {
653
+ if (!this.form.submitting) {
654
+ this.form.triggerSubmit();
655
+ }
656
+ }
657
+ codeChanged(code) {
658
+ this.code = code;
659
+ }
660
+ }
661
+ NumberComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: NumberComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: i1.MatDialogRef }, { token: i0.ChangeDetectorRef }, { token: i2.FsMessage }], target: i0.ɵɵFactoryTarget.Component });
662
+ NumberComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: NumberComponent, selector: "ng-component", viewQueries: [{ propertyName: "form", first: true, predicate: FsFormDirective, descendants: true }], ngImport: i0, template: "<form fsForm [submit]=\"submit\" [autocomplete]=\"false\">\n <fs-dialog>\n <h1 mat-dialog-title>\n Text Message Setup\n </h1>\n <mat-dialog-content>\n <ng-container *ngIf=\"verificationMethod; else notVerificationMethod\">\n <fs-2fa-verification\n [verificationMethod]=\"verificationMethod\"\n (codeChanged)=\"codeChanged($event)\"\n [resend]=\"resend\"\n [formatRecipient]=\"true\"\n [(trustDevice)]=\"trustDevice\">\n </fs-2fa-verification>\n </ng-container>\n\n <ng-template #notVerificationMethod>\n <p>The app will only use this number for verifying your account security. Message and data rates may apply by your cell phone provider.</p>\n <mat-form-field>\n <mat-label>Phone number</mat-label>\n <fs-phone-field\n [(ngModel)]=\"phone\"\n [country]=\"defaultCountry\"\n name=\"phone\"\n [mode]=\"'object'\"\n autocomplete=\"off\"\n [required]=\"true\">\n </fs-phone-field>\n </mat-form-field>\n <mat-checkbox \n name=\"default\"\n [(ngModel)]=\"default\"\n [disableRipple]=\"true\">\n Make this the default 2-step verification method\n </mat-checkbox>\n </ng-template>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button\n mat-button\n color=\"primary\"\n type=\"submit\">\n Next\n </button>\n <button\n mat-button\n type=\"button\"\n [mat-dialog-close]=\"undefined\">\n Cancel\n </button>\n </mat-dialog-actions>\n </fs-dialog>\n</form>\n", styles: [":host ::ng-deep mat-checkbox .mat-ripple{display:none}app-code-input{margin-bottom:5px;display:block}mat-form-field{width:100%}mat-dialog-content{width:400px}p{margin-top:0}h1{display:flex;align-items:center}h1 mat-icon{margin-right:5px}\n"], components: [{ type: i3.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode"] }, { type: Fs2faVerificationComponent, selector: "fs-2fa-verification", inputs: ["verificationMethod", "resend", "showTrustedDevice", "trustDevice", "trustDays", "formatRecipient", "getVerificationMethods", "selectVerificationMethod"], outputs: ["verified", "codeChanged", "codeCompleted", "trustDeviceChange"] }, { type: i5$1.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i8$1.FsPhoneFieldComponent, selector: "fs-phone-field", inputs: ["allowNumberExt", "placeholder", "required", "disabled", "mode", "country", "name"] }, { type: i6$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: i6.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: i8.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i8.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i8.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i9.FsFormDirective, selector: "[fsForm]", inputs: ["wrapperSelector", "messageSelector", "hintSelector", "labelSelector", "autocomplete", "shortcuts", "confirm", "confirmDialog", "confirmDrawer", "confirmBrowser", "confirmTabs", "dirtySubmitButton", "submit", "successDelay", "errorDelay", "tabGroup"], outputs: ["fsForm", "invalid", "valid", "submitted", "reseted", "cleared"] }, { type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i9$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5$1.MatLabel, selector: "mat-label" }, { type: i8.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i8.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i9.FsFormRequiredDirective, selector: "[fsFormRequired],[ngModel][required]", inputs: ["fsFormRequired", "required", "fsFormRequiredMessage"] }, { type: i8.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i9.FsFormNoFsValidatorsDirective, selector: "[ngModel]:not([required]):not([fsFormRequired]):not([fsFormCompare]):not([fsFormDateRange]):not([fsFormEmail]):not([fsFormEmails]):not([fsFormFunction]):not([fsFormGreater]):not([fsFormInteger]):not([fsFormLesser]):not([fsFormMax]):not([fsFormMaxLength]):not([fsFormMin]):not([fsFormMinLength]):not([fsFormNumeric]):not([fsFormPattern]):not([fsFormPhone]):not([fsFormUrl]):not([validate])" }, { type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }, { type: i9.FsSubmitButtonDirective, selector: "button[type=\"submit\"]", inputs: ["name", "dirtySubmit"] }, { type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["type", "mat-dialog-close", "aria-label", "matDialogClose"], exportAs: ["matDialogClose"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
663
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: NumberComponent, decorators: [{
664
+ type: Component,
665
+ args: [{
666
+ templateUrl: './number.component.html',
667
+ styleUrls: ['./number.component.scss'],
668
+ changeDetection: ChangeDetectionStrategy.OnPush,
669
+ }]
670
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
671
+ type: Inject,
672
+ args: [MAT_DIALOG_DATA]
673
+ }] }, { type: i1.MatDialogRef }, { type: i0.ChangeDetectorRef }, { type: i2.FsMessage }]; }, propDecorators: { form: [{
674
+ type: ViewChild,
675
+ args: [FsFormDirective, { static: false }]
676
676
  }] } });
677
677
 
678
- class TwoFactorManageService {
679
- constructor(_dialog) {
680
- this._dialog = _dialog;
681
- this._destroy$ = new Subject();
682
- this._verificationMethods$ = new BehaviorSubject([]);
683
- }
684
- get verificationMethods$() {
685
- return this._verificationMethods$
686
- .pipe(takeUntil(this._destroy$));
687
- }
688
- get verificationMethods() {
689
- return this._verificationMethods$.getValue();
690
- }
691
- get hasVerificationMethods() {
692
- return !!this._verificationMethods$.getValue().length;
693
- }
694
- get emailVerificationMethods() {
695
- return this.getVerificationMethods(VerificationMethodType.Email);
696
- }
697
- get smsVerificationMethods() {
698
- return this.getVerificationMethods(VerificationMethodType.Sms);
699
- }
700
- get appVerificationMethods() {
701
- return this.getVerificationMethods(VerificationMethodType.App);
702
- }
703
- getVerificationMethods(type) {
704
- return this.verificationMethods
705
- .filter((verificationMethod) => {
706
- return verificationMethod.type === type;
707
- });
708
- }
709
- hasVerificationMethod(type) {
710
- return this.verificationMethods
711
- .some((verificationMethod) => {
712
- return verificationMethod.type === type;
713
- });
714
- }
715
- registerVerificationMethodDefault(value) {
716
- this._verificationMethodDefault = value;
717
- }
718
- registerVerificationMethodResend(value) {
719
- this._verificationMethodResend = value;
720
- }
721
- registerVerificationMethodsFetch(value) {
722
- this._verificationMethodsFetch = value;
723
- }
724
- registerVerificationMethodDelete(value) {
725
- this._verificationMethodDelete = value;
726
- }
727
- registerVerificationMethodCreate(value) {
728
- this._verificationMethodCreate = value;
729
- }
730
- registerVerificationMethodVerify(value) {
731
- this._verificationMethodVerify = value;
732
- }
733
- registerAccountVerify(value) {
734
- this._accountVerify = value;
735
- }
736
- get hasVerificationMethodResend() {
737
- return !!this._verificationMethodResend;
738
- }
739
- get hasVerificationMethodDefault() {
740
- return !!this._verificationMethodDefault;
741
- }
742
- get hasVerificationMethodsFetch() {
743
- return !!this._verificationMethodsFetch;
744
- }
745
- get hasVerificationMethodDelete() {
746
- return !!this._verificationMethodDelete;
747
- }
748
- get hasVerificationMethodCreate() {
749
- return !!this._verificationMethodCreate;
750
- }
751
- get hasVerificationMethodVerify() {
752
- return !!this._verificationMethodVerify;
753
- }
754
- verificationMethodDelete$(verificationMethod) {
755
- return this._verificationMethodDelete(verificationMethod)
756
- .pipe(tap(() => {
757
- this.verificationMethodsFetch();
758
- }));
759
- }
760
- verificationMethodVerify$(code, trustDevice) {
761
- return this._verificationMethodVerify(code, trustDevice)
762
- .pipe(tap(() => {
763
- this.verificationMethodsFetch();
764
- }));
765
- }
766
- verificationMethodCreate$(verificationMethod) {
767
- return this._verificationMethodCreate(verificationMethod);
768
- }
769
- verificationMethodDefault$(verificationMethod) {
770
- return this._verificationMethodDefault(verificationMethod);
771
- }
772
- verificationMethodResend() {
773
- return this._verificationMethodResend();
774
- }
775
- verificationMethodsFetch(query) {
776
- this.verificationMethodsFetch$(query)
777
- .subscribe();
778
- }
779
- verificationMethodsFetch$(query) {
780
- return this._verificationMethodsFetch(query)
781
- .pipe(tap((verificationMethods) => {
782
- this._verificationMethods$.next(verificationMethods);
783
- }));
784
- }
785
- accountVerify$() {
786
- return this._accountVerify ? this._accountVerify() : of(true);
787
- }
788
- ngOnDestroy() {
789
- this._destroy$.next();
790
- this._destroy$.complete();
791
- }
792
- addSms$(defaultCountry) {
793
- return this.accountVerify$()
794
- .pipe(switchMap(() => this._dialog.open(NumberComponent, {
795
- data: {
796
- defaultCountry,
797
- twoFactorManageService: this,
798
- },
799
- })
800
- .afterClosed()), tap(() => {
801
- this.verificationMethodsFetch();
802
- }), takeUntil(this._destroy$));
803
- }
804
- addEmail$() {
805
- return this.accountVerify$()
806
- .pipe(switchMap(() => this._dialog.open(EmailComponent, {
807
- data: { twoFactorManageService: this },
808
- })
809
- .afterClosed()), tap(() => {
810
- this.verificationMethodsFetch();
811
- }), takeUntil(this._destroy$));
812
- }
813
- addApp$() {
814
- return this.accountVerify$()
815
- .pipe(switchMap(() => this._dialog.open(AppComponent, {
816
- data: { twoFactorManageService: this },
817
- })
818
- .afterClosed()), tap(() => {
819
- this.verificationMethodsFetch();
820
- }), takeUntil(this._destroy$));
821
- }
822
- }
823
- TwoFactorManageService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TwoFactorManageService, deps: [{ token: i1.MatDialog }], target: i0.ɵɵFactoryTarget.Injectable });
824
- TwoFactorManageService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TwoFactorManageService });
825
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TwoFactorManageService, decorators: [{
826
- type: Injectable
678
+ class TwoFactorManageService {
679
+ constructor(_dialog) {
680
+ this._dialog = _dialog;
681
+ this._destroy$ = new Subject();
682
+ this._verificationMethods$ = new BehaviorSubject([]);
683
+ }
684
+ get verificationMethods$() {
685
+ return this._verificationMethods$
686
+ .pipe(takeUntil(this._destroy$));
687
+ }
688
+ get verificationMethods() {
689
+ return this._verificationMethods$.getValue();
690
+ }
691
+ get hasVerificationMethods() {
692
+ return !!this._verificationMethods$.getValue().length;
693
+ }
694
+ get emailVerificationMethods() {
695
+ return this.getVerificationMethods(VerificationMethodType.Email);
696
+ }
697
+ get smsVerificationMethods() {
698
+ return this.getVerificationMethods(VerificationMethodType.Sms);
699
+ }
700
+ get appVerificationMethods() {
701
+ return this.getVerificationMethods(VerificationMethodType.App);
702
+ }
703
+ getVerificationMethods(type) {
704
+ return this.verificationMethods
705
+ .filter((verificationMethod) => {
706
+ return verificationMethod.type === type;
707
+ });
708
+ }
709
+ hasVerificationMethod(type) {
710
+ return this.verificationMethods
711
+ .some((verificationMethod) => {
712
+ return verificationMethod.type === type;
713
+ });
714
+ }
715
+ registerVerificationMethodDefault(value) {
716
+ this._verificationMethodDefault = value;
717
+ }
718
+ registerVerificationMethodResend(value) {
719
+ this._verificationMethodResend = value;
720
+ }
721
+ registerVerificationMethodsFetch(value) {
722
+ this._verificationMethodsFetch = value;
723
+ }
724
+ registerVerificationMethodDelete(value) {
725
+ this._verificationMethodDelete = value;
726
+ }
727
+ registerVerificationMethodCreate(value) {
728
+ this._verificationMethodCreate = value;
729
+ }
730
+ registerVerificationMethodVerify(value) {
731
+ this._verificationMethodVerify = value;
732
+ }
733
+ registerAccountVerify(value) {
734
+ this._accountVerify = value;
735
+ }
736
+ get hasVerificationMethodResend() {
737
+ return !!this._verificationMethodResend;
738
+ }
739
+ get hasVerificationMethodDefault() {
740
+ return !!this._verificationMethodDefault;
741
+ }
742
+ get hasVerificationMethodsFetch() {
743
+ return !!this._verificationMethodsFetch;
744
+ }
745
+ get hasVerificationMethodDelete() {
746
+ return !!this._verificationMethodDelete;
747
+ }
748
+ get hasVerificationMethodCreate() {
749
+ return !!this._verificationMethodCreate;
750
+ }
751
+ get hasVerificationMethodVerify() {
752
+ return !!this._verificationMethodVerify;
753
+ }
754
+ verificationMethodDelete$(verificationMethod) {
755
+ return this._verificationMethodDelete(verificationMethod)
756
+ .pipe(tap(() => {
757
+ this.verificationMethodsFetch();
758
+ }));
759
+ }
760
+ verificationMethodVerify$(code, trustDevice) {
761
+ return this._verificationMethodVerify(code, trustDevice)
762
+ .pipe(tap(() => {
763
+ this.verificationMethodsFetch();
764
+ }));
765
+ }
766
+ verificationMethodCreate$(verificationMethod) {
767
+ return this._verificationMethodCreate(verificationMethod);
768
+ }
769
+ verificationMethodDefault$(verificationMethod) {
770
+ return this._verificationMethodDefault(verificationMethod);
771
+ }
772
+ verificationMethodResend() {
773
+ return this._verificationMethodResend();
774
+ }
775
+ verificationMethodsFetch(query) {
776
+ this.verificationMethodsFetch$(query)
777
+ .subscribe();
778
+ }
779
+ verificationMethodsFetch$(query) {
780
+ return this._verificationMethodsFetch(query)
781
+ .pipe(tap((verificationMethods) => {
782
+ this._verificationMethods$.next(verificationMethods);
783
+ }));
784
+ }
785
+ accountVerify$() {
786
+ return this._accountVerify ? this._accountVerify() : of(true);
787
+ }
788
+ ngOnDestroy() {
789
+ this._destroy$.next();
790
+ this._destroy$.complete();
791
+ }
792
+ addSms$(defaultCountry) {
793
+ return this.accountVerify$()
794
+ .pipe(switchMap(() => this._dialog.open(NumberComponent, {
795
+ data: {
796
+ defaultCountry,
797
+ twoFactorManageService: this,
798
+ },
799
+ })
800
+ .afterClosed()), tap(() => {
801
+ this.verificationMethodsFetch();
802
+ }), takeUntil(this._destroy$));
803
+ }
804
+ addEmail$() {
805
+ return this.accountVerify$()
806
+ .pipe(switchMap(() => this._dialog.open(EmailComponent, {
807
+ data: { twoFactorManageService: this },
808
+ })
809
+ .afterClosed()), tap(() => {
810
+ this.verificationMethodsFetch();
811
+ }), takeUntil(this._destroy$));
812
+ }
813
+ addApp$() {
814
+ return this.accountVerify$()
815
+ .pipe(switchMap(() => this._dialog.open(AppComponent, {
816
+ data: { twoFactorManageService: this },
817
+ })
818
+ .afterClosed()), tap(() => {
819
+ this.verificationMethodsFetch();
820
+ }), takeUntil(this._destroy$));
821
+ }
822
+ }
823
+ TwoFactorManageService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TwoFactorManageService, deps: [{ token: i1.MatDialog }], target: i0.ɵɵFactoryTarget.Injectable });
824
+ TwoFactorManageService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TwoFactorManageService });
825
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TwoFactorManageService, decorators: [{
826
+ type: Injectable
827
827
  }], ctorParameters: function () { return [{ type: i1.MatDialog }]; } });
828
828
 
829
- class DefaultedComponent {
830
- }
831
- DefaultedComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DefaultedComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
832
- DefaultedComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: DefaultedComponent, selector: "app-defaulted", ngImport: i0, template: "<span>Default</span>", styles: ["span{font-size:75%;background-color:#02a7f0;padding:2px 4px;border-radius:4px;color:#fff}:host{display:flex}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
833
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DefaultedComponent, decorators: [{
834
- type: Component,
835
- args: [{
836
- selector: 'app-defaulted',
837
- templateUrl: './defaulted.component.html',
838
- styleUrls: ['./defaulted.component.scss'],
839
- changeDetection: ChangeDetectionStrategy.OnPush,
840
- }]
829
+ class DefaultedComponent {
830
+ }
831
+ DefaultedComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DefaultedComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
832
+ DefaultedComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: DefaultedComponent, selector: "app-defaulted", ngImport: i0, template: "<span>Default</span>", styles: ["span{font-size:75%;background-color:#02a7f0;padding:2px 4px;border-radius:4px;color:#fff}:host{display:flex}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
833
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DefaultedComponent, decorators: [{
834
+ type: Component,
835
+ args: [{
836
+ selector: 'app-defaulted',
837
+ templateUrl: './defaulted.component.html',
838
+ styleUrls: ['./defaulted.component.scss'],
839
+ changeDetection: ChangeDetectionStrategy.OnPush,
840
+ }]
841
841
  }] });
842
842
 
843
- class VerificationMethodsComponent {
844
- constructor(_prompt) {
845
- this._prompt = _prompt;
846
- this.deleted = new EventEmitter();
847
- this.VerificationMethodType = VerificationMethodType;
848
- }
849
- ngOnInit() {
850
- var _a, _b, _c, _d;
851
- if (!this.verificationMethodDefault && ((_a = this.twoFactorManageService) === null || _a === void 0 ? void 0 : _a.hasVerificationMethodDefault)) {
852
- this.verificationMethodDefault = (verificationMethod) => {
853
- return this.twoFactorManageService.verificationMethodDefault$(verificationMethod);
854
- };
855
- }
856
- if (!this.verificationMethodDelete && ((_b = this.twoFactorManageService) === null || _b === void 0 ? void 0 : _b.hasVerificationMethodDelete)) {
857
- this.verificationMethodDelete = (verificationMethod) => {
858
- return this.twoFactorManageService.verificationMethodDelete$(verificationMethod);
859
- };
860
- }
861
- if (!this.verificationMethodsFetch && ((_c = this.twoFactorManageService) === null || _c === void 0 ? void 0 : _c.hasVerificationMethodsFetch)) {
862
- this.verificationMethodsFetch = (query) => {
863
- return this.twoFactorManageService.verificationMethodsFetch$(query);
864
- };
865
- }
866
- if (!this.accountVerify && ((_d = this.twoFactorManageService) === null || _d === void 0 ? void 0 : _d.hasVerificationMethodVerify)) {
867
- this.accountVerify = () => {
868
- var _a;
869
- return (_a = this.twoFactorManageService) === null || _a === void 0 ? void 0 : _a.accountVerify$();
870
- };
871
- }
872
- this.listConfig = {
873
- paging: false,
874
- rowActions: [
875
- {
876
- click: (verificationMethod) => {
877
- this.accountVerify()
878
- .pipe(switchMap(() => this.verificationMethodDefault(verificationMethod)))
879
- .subscribe(() => {
880
- this.list.reload();
881
- });
882
- },
883
- show: () => {
884
- return !!this.verificationMethodDefault;
885
- },
886
- label: 'Set as Default',
887
- },
888
- {
889
- click: (verificationMethod) => {
890
- this._prompt.confirm({
891
- title: 'Confirm',
892
- template: 'Would you like to delete this verification method?',
893
- })
894
- .pipe(switchMap(() => this.accountVerify()), switchMap(() => this.verificationMethodDelete(verificationMethod)))
895
- .subscribe(() => {
896
- this.deleted.emit();
897
- this.list.reload();
898
- });
899
- },
900
- show: () => {
901
- return !!this.verificationMethodDelete;
902
- },
903
- label: 'Delete',
904
- },
905
- ],
906
- fetch: (query) => {
907
- query = Object.assign(Object.assign({}, query), { type: this.type });
908
- return this.verificationMethodsFetch(query)
909
- .pipe(map((verificationMethods) => ({
910
- data: verificationMethods.filter((verificationMethod) => {
911
- return !this.type || verificationMethod.type === this.type;
912
- }),
913
- })));
914
- },
915
- };
916
- }
917
- reload() {
918
- this.list.reload();
919
- }
920
- }
921
- VerificationMethodsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: VerificationMethodsComponent, deps: [{ token: i1$3.FsPrompt }], target: i0.ɵɵFactoryTarget.Component });
922
- VerificationMethodsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: VerificationMethodsComponent, selector: "fs-2fa-verification-methods", inputs: { type: "type", accountVerify: "accountVerify", verificationMethodsFetch: "verificationMethodsFetch", verificationMethodDelete: "verificationMethodDelete", verificationMethodDefault: "verificationMethodDefault", twoFactorManageService: "twoFactorManageService" }, outputs: { deleted: "deleted" }, viewQueries: [{ propertyName: "list", first: true, predicate: FsListComponent, descendants: true }], ngImport: i0, template: "<fs-list [config]=\"listConfig\">\n <fs-list-column class=\"col-icon\" width=\"1%\">\n <ng-template fs-list-cell let-row=\"row\">\n <ng-container *ngIf=\"row.type === VerificationMethodType.Sms\">\n <mat-icon>textsms</mat-icon>\n </ng-container>\n\n <ng-container *ngIf=\"row.type === VerificationMethodType.Email\">\n <mat-icon>email</mat-icon>\n </ng-container>\n\n <ng-container *ngIf=\"row.type === VerificationMethodType.App\">\n <mat-icon>phone_iphone</mat-icon>\n </ng-container>\n </ng-template>\n </fs-list-column>\n <fs-list-column class=\"col-name\">\n <ng-template fs-list-cell let-row=\"row\">\n <div class=\"row\">\n <ng-container *ngIf=\"row.type === VerificationMethodType.Sms\">\n <div class=\"row\">\n <fs-country [code]=\"row.phoneCountry\" [showName]=\"false\"></fs-country> \n <span>{{row.phoneNumber | fsPhone}}</span>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"row.type === VerificationMethodType.Email\">\n {{row.email}}\n </ng-container>\n\n <ng-container *ngIf=\"row.type === VerificationMethodType.App\">\n App\n </ng-container>\n\n <app-defaulted *ngIf=\"row.default\"></app-defaulted>\n </div>\n </ng-template>\n </fs-list-column>\n</fs-list>", styles: [":host ::ng-deep .col-name .row{display:flex;align-items:center}:host ::ng-deep .col-name fs-country img{display:flex}fs-country{margin-right:5px}app-defaulted{margin-left:5px}\n"], components: [{ type: i2$1.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }, { type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i4$2.FsCountryComponent, selector: "fs-country", inputs: ["code", "showIcon", "showName", "region", "width"] }, { type: DefaultedComponent, selector: "app-defaulted" }], directives: [{ type: i2$1.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customize", "sortable", "sortableDefault", "direction", "align", "width", "class"] }, { type: i2$1.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }, { type: i9$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "fsPhone": i8$1.FsPhonePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
923
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: VerificationMethodsComponent, decorators: [{
924
- type: Component,
925
- args: [{
926
- selector: 'fs-2fa-verification-methods',
927
- templateUrl: './verification-methods.component.html',
928
- styleUrls: ['./verification-methods.component.scss'],
929
- changeDetection: ChangeDetectionStrategy.OnPush,
930
- }]
931
- }], ctorParameters: function () { return [{ type: i1$3.FsPrompt }]; }, propDecorators: { list: [{
932
- type: ViewChild,
933
- args: [FsListComponent]
934
- }], type: [{
935
- type: Input
936
- }], accountVerify: [{
937
- type: Input
938
- }], verificationMethodsFetch: [{
939
- type: Input
940
- }], verificationMethodDelete: [{
941
- type: Input
942
- }], verificationMethodDefault: [{
943
- type: Input
944
- }], twoFactorManageService: [{
945
- type: Input
946
- }], deleted: [{
947
- type: Output
843
+ class VerificationMethodsComponent {
844
+ constructor(_prompt) {
845
+ this._prompt = _prompt;
846
+ this.deleted = new EventEmitter();
847
+ this.VerificationMethodType = VerificationMethodType;
848
+ }
849
+ ngOnInit() {
850
+ var _a, _b, _c, _d;
851
+ if (!this.verificationMethodDefault && ((_a = this.twoFactorManageService) === null || _a === void 0 ? void 0 : _a.hasVerificationMethodDefault)) {
852
+ this.verificationMethodDefault = (verificationMethod) => {
853
+ return this.twoFactorManageService.verificationMethodDefault$(verificationMethod);
854
+ };
855
+ }
856
+ if (!this.verificationMethodDelete && ((_b = this.twoFactorManageService) === null || _b === void 0 ? void 0 : _b.hasVerificationMethodDelete)) {
857
+ this.verificationMethodDelete = (verificationMethod) => {
858
+ return this.twoFactorManageService.verificationMethodDelete$(verificationMethod);
859
+ };
860
+ }
861
+ if (!this.verificationMethodsFetch && ((_c = this.twoFactorManageService) === null || _c === void 0 ? void 0 : _c.hasVerificationMethodsFetch)) {
862
+ this.verificationMethodsFetch = (query) => {
863
+ return this.twoFactorManageService.verificationMethodsFetch$(query);
864
+ };
865
+ }
866
+ if (!this.accountVerify && ((_d = this.twoFactorManageService) === null || _d === void 0 ? void 0 : _d.hasVerificationMethodVerify)) {
867
+ this.accountVerify = () => {
868
+ var _a;
869
+ return (_a = this.twoFactorManageService) === null || _a === void 0 ? void 0 : _a.accountVerify$();
870
+ };
871
+ }
872
+ this.listConfig = {
873
+ paging: false,
874
+ rowActions: [
875
+ {
876
+ click: (verificationMethod) => {
877
+ this.accountVerify()
878
+ .pipe(switchMap(() => this.verificationMethodDefault(verificationMethod)))
879
+ .subscribe(() => {
880
+ this.list.reload();
881
+ });
882
+ },
883
+ show: (data) => {
884
+ return !!this.verificationMethodDefault && !data.default;
885
+ },
886
+ label: 'Set as Default',
887
+ },
888
+ {
889
+ click: (verificationMethod) => {
890
+ this._prompt.confirm({
891
+ title: 'Confirm',
892
+ template: 'Would you like to delete this verification method?',
893
+ })
894
+ .pipe(switchMap(() => this.accountVerify()), switchMap(() => this.verificationMethodDelete(verificationMethod)))
895
+ .subscribe(() => {
896
+ this.deleted.emit();
897
+ this.list.reload();
898
+ });
899
+ },
900
+ show: () => {
901
+ return !!this.verificationMethodDelete;
902
+ },
903
+ label: 'Delete',
904
+ },
905
+ ],
906
+ fetch: (query) => {
907
+ query = Object.assign(Object.assign({}, query), { type: this.type });
908
+ return this.verificationMethodsFetch(query)
909
+ .pipe(map((verificationMethods) => ({
910
+ data: verificationMethods.filter((verificationMethod) => {
911
+ return !this.type || verificationMethod.type === this.type;
912
+ }),
913
+ })));
914
+ },
915
+ };
916
+ }
917
+ reload() {
918
+ this.list.reload();
919
+ }
920
+ }
921
+ VerificationMethodsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: VerificationMethodsComponent, deps: [{ token: i1$3.FsPrompt }], target: i0.ɵɵFactoryTarget.Component });
922
+ VerificationMethodsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: VerificationMethodsComponent, selector: "fs-2fa-verification-methods", inputs: { type: "type", accountVerify: "accountVerify", verificationMethodsFetch: "verificationMethodsFetch", verificationMethodDelete: "verificationMethodDelete", verificationMethodDefault: "verificationMethodDefault", twoFactorManageService: "twoFactorManageService" }, outputs: { deleted: "deleted" }, viewQueries: [{ propertyName: "list", first: true, predicate: FsListComponent, descendants: true }], ngImport: i0, template: "<fs-list [config]=\"listConfig\">\n <fs-list-column class=\"col-icon\" width=\"1%\">\n <ng-template fs-list-cell let-row=\"row\">\n <ng-container *ngIf=\"row.type === VerificationMethodType.Sms\">\n <mat-icon>textsms</mat-icon>\n </ng-container>\n\n <ng-container *ngIf=\"row.type === VerificationMethodType.Email\">\n <mat-icon>email</mat-icon>\n </ng-container>\n\n <ng-container *ngIf=\"row.type === VerificationMethodType.App\">\n <mat-icon>phone_iphone</mat-icon>\n </ng-container>\n </ng-template>\n </fs-list-column>\n <fs-list-column class=\"col-name\">\n <ng-template fs-list-cell let-row=\"row\">\n <div class=\"row\">\n <ng-container *ngIf=\"row.type === VerificationMethodType.Sms\">\n <div class=\"row\">\n <fs-country [code]=\"row.phoneCountry\" [showName]=\"false\"></fs-country> \n <span>{{row.phoneNumber | fsPhone}}</span>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"row.type === VerificationMethodType.Email\">\n {{row.email}}\n </ng-container>\n\n <ng-container *ngIf=\"row.type === VerificationMethodType.App\">\n App\n </ng-container>\n\n <app-defaulted *ngIf=\"row.default\"></app-defaulted>\n </div>\n </ng-template>\n </fs-list-column>\n</fs-list>", styles: [":host ::ng-deep .col-name .row{display:flex;align-items:center}:host ::ng-deep .col-name fs-country img{display:flex}fs-country{margin-right:5px}app-defaulted{margin-left:5px}\n"], components: [{ type: i2$1.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }, { type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i4$2.FsCountryComponent, selector: "fs-country", inputs: ["code", "showIcon", "showName", "region", "width"] }, { type: DefaultedComponent, selector: "app-defaulted" }], directives: [{ type: i2$1.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customize", "sortable", "sortableDefault", "direction", "align", "width", "class"] }, { type: i2$1.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }, { type: i9$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "fsPhone": i8$1.FsPhonePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
923
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: VerificationMethodsComponent, decorators: [{
924
+ type: Component,
925
+ args: [{
926
+ selector: 'fs-2fa-verification-methods',
927
+ templateUrl: './verification-methods.component.html',
928
+ styleUrls: ['./verification-methods.component.scss'],
929
+ changeDetection: ChangeDetectionStrategy.OnPush,
930
+ }]
931
+ }], ctorParameters: function () { return [{ type: i1$3.FsPrompt }]; }, propDecorators: { list: [{
932
+ type: ViewChild,
933
+ args: [FsListComponent]
934
+ }], type: [{
935
+ type: Input
936
+ }], accountVerify: [{
937
+ type: Input
938
+ }], verificationMethodsFetch: [{
939
+ type: Input
940
+ }], verificationMethodDelete: [{
941
+ type: Input
942
+ }], verificationMethodDefault: [{
943
+ type: Input
944
+ }], twoFactorManageService: [{
945
+ type: Input
946
+ }], deleted: [{
947
+ type: Output
948
948
  }] } });
949
949
 
950
- class NumbersComponent {
951
- constructor(_data, _dialogRef, _message) {
952
- this._data = _data;
953
- this._dialogRef = _dialogRef;
954
- this._message = _message;
955
- this.VerificationMethodType = VerificationMethodType;
956
- this.twoFactorManageService = _data.twoFactorManageService;
957
- this.defaultCountry = _data.defaultCountry;
958
- }
959
- add() {
960
- this.twoFactorManageService.addSms$(this.defaultCountry)
961
- .subscribe(() => {
962
- this.verificationMethods.reload();
963
- });
964
- }
965
- deleted() {
966
- this._message.success('Deleted text message verification method');
967
- if (!this.twoFactorManageService.hasVerificationMethod(VerificationMethodType.Sms)) {
968
- this._dialogRef.close();
969
- }
970
- }
971
- }
972
- NumbersComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: NumbersComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: i1.MatDialogRef }, { token: i2.FsMessage }], target: i0.ɵɵFactoryTarget.Component });
973
- NumbersComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: NumbersComponent, selector: "ng-component", viewQueries: [{ propertyName: "verificationMethods", first: true, predicate: VerificationMethodsComponent, descendants: true }], ngImport: i0, template: "<fs-dialog>\n <h1 mat-dialog-title>\n <mat-icon>textsms</mat-icon> Text Message Numbers\n </h1>\n <mat-dialog-content>\n <fs-2fa-verification-methods\n [type]=\"VerificationMethodType.Sms\"\n [twoFactorManageService]=\"twoFactorManageService\"\n (deleted)=\"deleted()\">\n </fs-2fa-verification-methods> \n </mat-dialog-content>\n <mat-dialog-actions>\n <button\n mat-button\n type=\"button\"\n color=\"primary\"\n [mat-dialog-close]=\"undefined\">\n Close\n </button>\n <button\n mat-button\n (click)=\"add()\"\n type=\"button\">\n Add Number\n </button>\n </mat-dialog-actions>\n</fs-dialog>\n", styles: [""], components: [{ type: i3.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode"] }, { type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: VerificationMethodsComponent, selector: "fs-2fa-verification-methods", inputs: ["type", "accountVerify", "verificationMethodsFetch", "verificationMethodDelete", "verificationMethodDefault", "twoFactorManageService"], outputs: ["deleted"] }, { type: i6.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: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }, { type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["type", "mat-dialog-close", "aria-label", "matDialogClose"], exportAs: ["matDialogClose"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
974
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: NumbersComponent, decorators: [{
975
- type: Component,
976
- args: [{
977
- templateUrl: './numbers.component.html',
978
- styleUrls: ['./numbers.component.scss'],
979
- changeDetection: ChangeDetectionStrategy.OnPush,
980
- }]
981
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
982
- type: Inject,
983
- args: [MAT_DIALOG_DATA]
984
- }] }, { type: i1.MatDialogRef }, { type: i2.FsMessage }]; }, propDecorators: { verificationMethods: [{
985
- type: ViewChild,
986
- args: [VerificationMethodsComponent]
950
+ class NumbersComponent {
951
+ constructor(_data, _dialogRef, _message) {
952
+ this._data = _data;
953
+ this._dialogRef = _dialogRef;
954
+ this._message = _message;
955
+ this.VerificationMethodType = VerificationMethodType;
956
+ this.twoFactorManageService = _data.twoFactorManageService;
957
+ this.defaultCountry = _data.defaultCountry;
958
+ }
959
+ add() {
960
+ this.twoFactorManageService.addSms$(this.defaultCountry)
961
+ .subscribe(() => {
962
+ this.verificationMethods.reload();
963
+ });
964
+ }
965
+ deleted() {
966
+ this._message.success('Deleted text message verification method');
967
+ if (!this.twoFactorManageService.hasVerificationMethod(VerificationMethodType.Sms)) {
968
+ this._dialogRef.close();
969
+ }
970
+ }
971
+ }
972
+ NumbersComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: NumbersComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: i1.MatDialogRef }, { token: i2.FsMessage }], target: i0.ɵɵFactoryTarget.Component });
973
+ NumbersComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: NumbersComponent, selector: "ng-component", viewQueries: [{ propertyName: "verificationMethods", first: true, predicate: VerificationMethodsComponent, descendants: true }], ngImport: i0, template: "<fs-dialog>\n <h1 mat-dialog-title>\n <mat-icon>textsms</mat-icon> Text Message Numbers\n </h1>\n <mat-dialog-content>\n <fs-2fa-verification-methods\n [type]=\"VerificationMethodType.Sms\"\n [twoFactorManageService]=\"twoFactorManageService\"\n (deleted)=\"deleted()\">\n </fs-2fa-verification-methods> \n </mat-dialog-content>\n <mat-dialog-actions>\n <button\n mat-button\n type=\"button\"\n color=\"primary\"\n [mat-dialog-close]=\"undefined\">\n Close\n </button>\n <button\n mat-button\n (click)=\"add()\"\n type=\"button\">\n Add Number\n </button>\n </mat-dialog-actions>\n</fs-dialog>\n", styles: [""], components: [{ type: i3.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode"] }, { type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: VerificationMethodsComponent, selector: "fs-2fa-verification-methods", inputs: ["type", "accountVerify", "verificationMethodsFetch", "verificationMethodDelete", "verificationMethodDefault", "twoFactorManageService"], outputs: ["deleted"] }, { type: i6.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: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }, { type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["type", "mat-dialog-close", "aria-label", "matDialogClose"], exportAs: ["matDialogClose"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
974
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: NumbersComponent, decorators: [{
975
+ type: Component,
976
+ args: [{
977
+ templateUrl: './numbers.component.html',
978
+ styleUrls: ['./numbers.component.scss'],
979
+ changeDetection: ChangeDetectionStrategy.OnPush,
980
+ }]
981
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
982
+ type: Inject,
983
+ args: [MAT_DIALOG_DATA]
984
+ }] }, { type: i1.MatDialogRef }, { type: i2.FsMessage }]; }, propDecorators: { verificationMethods: [{
985
+ type: ViewChild,
986
+ args: [VerificationMethodsComponent]
987
987
  }] } });
988
988
 
989
- class EmailsComponent {
990
- constructor(_data, _dialogRef, _message) {
991
- this._data = _data;
992
- this._dialogRef = _dialogRef;
993
- this._message = _message;
994
- this.VerificationMethodType = VerificationMethodType;
995
- this.twoFactorManageService = _data.twoFactorManageService;
996
- }
997
- add() {
998
- this.twoFactorManageService.addEmail$()
999
- .subscribe(() => {
1000
- this.verificationMethods.reload();
1001
- });
1002
- }
1003
- deleted() {
1004
- this._message.success('Deleted email verification method');
1005
- if (!this.twoFactorManageService.hasVerificationMethod(VerificationMethodType.Email)) {
1006
- this._dialogRef.close();
1007
- }
1008
- }
1009
- }
1010
- EmailsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: EmailsComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: i1.MatDialogRef }, { token: i2.FsMessage }], target: i0.ɵɵFactoryTarget.Component });
1011
- EmailsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: EmailsComponent, selector: "ng-component", viewQueries: [{ propertyName: "verificationMethods", first: true, predicate: VerificationMethodsComponent, descendants: true }], ngImport: i0, template: "<fs-dialog>\n <h1 mat-dialog-title>\n <mat-icon>email</mat-icon> Emails\n </h1>\n <mat-dialog-content>\n <fs-2fa-verification-methods\n [type]=\"VerificationMethodType.Email\"\n [twoFactorManageService]=\"twoFactorManageService\"\n (deleted)=\"deleted()\">\n </fs-2fa-verification-methods>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button\n mat-button\n type=\"button\"\n color=\"primary\"\n [mat-dialog-close]=\"undefined\">\n Close\n </button>\n <button\n mat-button\n (click)=\"add()\"\n type=\"button\">\n Add Email\n </button>\n </mat-dialog-actions>\n</fs-dialog>\n", styles: ["h1{display:flex;align-items:center}h1 mat-icon{margin-right:5px}\n"], components: [{ type: i3.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode"] }, { type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: VerificationMethodsComponent, selector: "fs-2fa-verification-methods", inputs: ["type", "accountVerify", "verificationMethodsFetch", "verificationMethodDelete", "verificationMethodDefault", "twoFactorManageService"], outputs: ["deleted"] }, { type: i6.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: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }, { type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["type", "mat-dialog-close", "aria-label", "matDialogClose"], exportAs: ["matDialogClose"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1012
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: EmailsComponent, decorators: [{
1013
- type: Component,
1014
- args: [{
1015
- templateUrl: './emails.component.html',
1016
- styleUrls: ['./emails.component.scss'],
1017
- changeDetection: ChangeDetectionStrategy.OnPush,
1018
- }]
1019
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1020
- type: Inject,
1021
- args: [MAT_DIALOG_DATA]
1022
- }] }, { type: i1.MatDialogRef }, { type: i2.FsMessage }]; }, propDecorators: { verificationMethods: [{
1023
- type: ViewChild,
1024
- args: [VerificationMethodsComponent]
989
+ class EmailsComponent {
990
+ constructor(_data, _dialogRef, _message) {
991
+ this._data = _data;
992
+ this._dialogRef = _dialogRef;
993
+ this._message = _message;
994
+ this.VerificationMethodType = VerificationMethodType;
995
+ this.twoFactorManageService = _data.twoFactorManageService;
996
+ }
997
+ add() {
998
+ this.twoFactorManageService.addEmail$()
999
+ .subscribe(() => {
1000
+ this.verificationMethods.reload();
1001
+ });
1002
+ }
1003
+ deleted() {
1004
+ this._message.success('Deleted email verification method');
1005
+ if (!this.twoFactorManageService.hasVerificationMethod(VerificationMethodType.Email)) {
1006
+ this._dialogRef.close();
1007
+ }
1008
+ }
1009
+ }
1010
+ EmailsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: EmailsComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: i1.MatDialogRef }, { token: i2.FsMessage }], target: i0.ɵɵFactoryTarget.Component });
1011
+ EmailsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: EmailsComponent, selector: "ng-component", viewQueries: [{ propertyName: "verificationMethods", first: true, predicate: VerificationMethodsComponent, descendants: true }], ngImport: i0, template: "<fs-dialog>\n <h1 mat-dialog-title>\n <mat-icon>email</mat-icon> Emails\n </h1>\n <mat-dialog-content>\n <fs-2fa-verification-methods\n [type]=\"VerificationMethodType.Email\"\n [twoFactorManageService]=\"twoFactorManageService\"\n (deleted)=\"deleted()\">\n </fs-2fa-verification-methods>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button\n mat-button\n type=\"button\"\n color=\"primary\"\n [mat-dialog-close]=\"undefined\">\n Close\n </button>\n <button\n mat-button\n (click)=\"add()\"\n type=\"button\">\n Add Email\n </button>\n </mat-dialog-actions>\n</fs-dialog>\n", styles: ["h1{display:flex;align-items:center}h1 mat-icon{margin-right:5px}\n"], components: [{ type: i3.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode"] }, { type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: VerificationMethodsComponent, selector: "fs-2fa-verification-methods", inputs: ["type", "accountVerify", "verificationMethodsFetch", "verificationMethodDelete", "verificationMethodDefault", "twoFactorManageService"], outputs: ["deleted"] }, { type: i6.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: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }, { type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["type", "mat-dialog-close", "aria-label", "matDialogClose"], exportAs: ["matDialogClose"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1012
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: EmailsComponent, decorators: [{
1013
+ type: Component,
1014
+ args: [{
1015
+ templateUrl: './emails.component.html',
1016
+ styleUrls: ['./emails.component.scss'],
1017
+ changeDetection: ChangeDetectionStrategy.OnPush,
1018
+ }]
1019
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1020
+ type: Inject,
1021
+ args: [MAT_DIALOG_DATA]
1022
+ }] }, { type: i1.MatDialogRef }, { type: i2.FsMessage }]; }, propDecorators: { verificationMethods: [{
1023
+ type: ViewChild,
1024
+ args: [VerificationMethodsComponent]
1025
1025
  }] } });
1026
1026
 
1027
- class ManageMethodsComponent {
1028
- constructor(_data, _cdRef, _dialog, _message) {
1029
- this._data = _data;
1030
- this._cdRef = _cdRef;
1031
- this._dialog = _dialog;
1032
- this._message = _message;
1033
- this.verificationMethodTypes = {};
1034
- this.VerificationMethodType = VerificationMethodType;
1035
- this._destroy$ = new Subject();
1036
- }
1037
- ngOnInit() {
1038
- this._defaultCountry = this._data.defaultCountry;
1039
- this.twoFactorManageService = this._data.twoFactorManageService;
1040
- this.verificationMethodTypes = this._data.verificationMethodTypes
1041
- .reduce((verificationMethodTypes, verificationMethodType) => {
1042
- verificationMethodTypes[verificationMethodType] = true;
1043
- return verificationMethodTypes;
1044
- }, {});
1045
- this.twoFactorManageService.verificationMethods$
1046
- .subscribe((verificationMethods) => {
1047
- this.verificationMethods = verificationMethods;
1048
- this._cdRef.markForCheck();
1049
- });
1050
- }
1051
- get defaultSms() {
1052
- return this.twoFactorManageService.smsVerificationMethods
1053
- .some((verificationMethod) => {
1054
- return verificationMethod.default;
1055
- });
1056
- }
1057
- get defaultApp() {
1058
- return this.twoFactorManageService.appVerificationMethods
1059
- .some((verificationMethod) => {
1060
- return verificationMethod.default;
1061
- });
1062
- }
1063
- get defaultEmail() {
1064
- return this.twoFactorManageService.emailVerificationMethods
1065
- .some((verificationMethod) => {
1066
- return verificationMethod.default;
1067
- });
1068
- }
1069
- get textHasVerificationMethod() {
1070
- return this.twoFactorManageService.hasVerificationMethod(VerificationMethodType.Sms);
1071
- }
1072
- get appHasVerificationMethod() {
1073
- return this.twoFactorManageService.hasVerificationMethod(VerificationMethodType.App);
1074
- }
1075
- get emailHasVerificationMethod() {
1076
- return this.twoFactorManageService.hasVerificationMethod(VerificationMethodType.Email);
1077
- }
1078
- textMessageManage() {
1079
- this._dialog.open(NumbersComponent, {
1080
- data: {
1081
- twoFactorManageService: this.twoFactorManageService,
1082
- defaultCountry: this._defaultCountry,
1083
- },
1084
- });
1085
- }
1086
- textMessageAdd() {
1087
- this.twoFactorManageService.addSms$(this._defaultCountry)
1088
- .subscribe();
1089
- }
1090
- emailMessageManage() {
1091
- this._dialog.open(EmailsComponent, {
1092
- data: {
1093
- twoFactorManageService: this.twoFactorManageService,
1094
- },
1095
- });
1096
- }
1097
- emailMessageAdd() {
1098
- this.twoFactorManageService.addEmail$()
1099
- .subscribe();
1100
- }
1101
- appRemove() {
1102
- const verificationMethod = this.verificationMethods
1103
- .find((_verificationMethod) => {
1104
- return _verificationMethod.type === VerificationMethodType.App;
1105
- });
1106
- if (verificationMethod) {
1107
- this.twoFactorManageService.accountVerify$()
1108
- .pipe(switchMap(() => this.twoFactorManageService.verificationMethodDelete$(verificationMethod)))
1109
- .subscribe(() => {
1110
- this._message.success('Removed App Authenticator verification method');
1111
- this._cdRef.markForCheck();
1112
- });
1113
- }
1114
- }
1115
- appAdd() {
1116
- this.twoFactorManageService.addApp$()
1117
- .subscribe();
1118
- }
1119
- ngOnDestroy() {
1120
- this._destroy$.next();
1121
- this._destroy$.complete();
1122
- }
1123
- }
1124
- ManageMethodsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ManageMethodsComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: i0.ChangeDetectorRef }, { token: i1.MatDialog }, { token: i2.FsMessage }], target: i0.ɵɵFactoryTarget.Component });
1125
- ManageMethodsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ManageMethodsComponent, selector: "ng-component", ngImport: i0, template: "<fs-dialog>\n <h1 mat-dialog-title>2-Step Verification</h1>\n <mat-dialog-content>\n <table>\n <tr *ngIf=\"verificationMethodTypes[VerificationMethodType.Sms]\">\n <td>\n <mat-icon>textsms</mat-icon>\n </td>\n <td>\n <div class=\"type\">\n <span>Text Message</span>\n <span *ngIf=\"textHasVerificationMethod\" class=\"enabled\"></span>\n <app-defaulted *ngIf=\"defaultSms\"></app-defaulted>\n </div>\n <div class=\"small\">\n Verification codes are sent by text message\n <ng-container *ngIf=\"textHasVerificationMethod\">\n to <span class=\"items\">\n <span *ngFor=\"let item of twoFactorManageService.smsVerificationMethods\">{{item.phoneNumber | fsPhone}}</span>\n </span>\n </ng-container>\n </div>\n </td>\n <td>\n <button \n *ngIf=\"textHasVerificationMethod; else textMessageManageButton\"\n mat-raised-button \n type=\"button\"\n (click)=\"textMessageManage()\">\n Manage\n </button>\n <ng-template #textMessageManageButton>\n <button \n mat-raised-button \n color=\"primary\"\n type=\"button\"\n (click)=\"textMessageAdd()\">\n Turn On\n </button>\n </ng-template>\n </td>\n </tr>\n <tr *ngIf=\"verificationMethodTypes[VerificationMethodType.Email]\">\n <td>\n <mat-icon>email</mat-icon>\n </td>\n <td>\n <div class=\"type\">\n <span>Email</span> \n <span *ngIf=\"emailHasVerificationMethod\" class=\"enabled\"></span>\n <app-defaulted *ngIf=\"defaultEmail\"></app-defaulted>\n </div>\n <div class=\"small\">\n Verification codes are sent by email\n <ng-container *ngIf=\"emailHasVerificationMethod\">\n to <span class=\"items\">\n <span *ngFor=\"let item of twoFactorManageService.emailVerificationMethods\">{{item.email}}</span>\n </span>\n </ng-container>\n </div>\n </td>\n <td>\n <button \n *ngIf=\"emailHasVerificationMethod; else emailMessageManageButton\"\n mat-raised-button \n type=\"button\"\n (click)=\"emailMessageManage()\">\n Manage\n </button>\n <ng-template #emailMessageManageButton>\n <button \n mat-raised-button \n color=\"primary\"\n type=\"button\"\n (click)=\"emailMessageAdd()\">\n Turn On\n </button>\n </ng-template>\n </td>\n </tr>\n <tr *ngIf=\"verificationMethodTypes[VerificationMethodType.App]\">\n <td>\n <mat-icon>phone_iphone</mat-icon>\n </td>\n <td>\n <div class=\"type\">\n <span>Authenticator App</span>\n <span *ngIf=\"appHasVerificationMethod\" class=\"enabled\"></span>\n <app-defaulted *ngIf=\"defaultApp\"></app-defaulted>\n </div>\n <div class=\"small\">Verification code is generated by an authenticator app such as Authy or Google Authenticator</div>\n </td>\n <td>\n <button \n *ngIf=\"appHasVerificationMethod; else appMessageManageButton\"\n mat-raised-button \n type=\"button\"\n (click)=\"appRemove()\">\n Remove\n </button>\n <ng-template #appMessageManageButton>\n <button \n mat-raised-button \n color=\"primary\"\n type=\"button\"\n (click)=\"appAdd()\">\n Turn On\n </button>\n </ng-template>\n </td>\n </tr> \n </table> \n </mat-dialog-content>\n <mat-dialog-actions>\n <button\n mat-button\n color=\"primary\"\n type=\"button\"\n [mat-dialog-close]=\"undefined\">\n Close\n </button>\n </mat-dialog-actions>\n</fs-dialog>\n", styles: ["mat-dialog-content{max-width:500px}.enabled{font-size:75%;background-color:#70b601;padding:2px 4px;border-radius:4px;color:#fff;margin-left:4px}.enabled:after{content:\"Enabled\"}table tr td:first-child,table tr td:last-child{width:1%}table tr td:first-child mat-icon,table tr td:last-child mat-icon{display:flex}table tr td{padding:6px;vertical-align:middle}table tr .type{display:flex;align-items:center}table tr .type app-defaulted{margin-left:4px}.items span+span:not(:last-child):before{content:\", \"}.items span+span:last-child:before{content:\" and \"}\n"], components: [{ type: i3.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode"] }, { type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: DefaultedComponent, selector: "app-defaulted" }, { type: i6.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: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i9$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i9$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }, { type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["type", "mat-dialog-close", "aria-label", "matDialogClose"], exportAs: ["matDialogClose"] }], pipes: { "fsPhone": i8$1.FsPhonePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1126
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ManageMethodsComponent, decorators: [{
1127
- type: Component,
1128
- args: [{
1129
- templateUrl: './manage-methods.component.html',
1130
- styleUrls: ['./manage-methods.component.scss'],
1131
- changeDetection: ChangeDetectionStrategy.OnPush,
1132
- }]
1133
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1134
- type: Inject,
1135
- args: [MAT_DIALOG_DATA]
1027
+ class ManageMethodsComponent {
1028
+ constructor(_data, _cdRef, _dialog, _message) {
1029
+ this._data = _data;
1030
+ this._cdRef = _cdRef;
1031
+ this._dialog = _dialog;
1032
+ this._message = _message;
1033
+ this.verificationMethodTypes = {};
1034
+ this.VerificationMethodType = VerificationMethodType;
1035
+ this._destroy$ = new Subject();
1036
+ }
1037
+ ngOnInit() {
1038
+ this._defaultCountry = this._data.defaultCountry;
1039
+ this.twoFactorManageService = this._data.twoFactorManageService;
1040
+ this.verificationMethodTypes = this._data.verificationMethodTypes
1041
+ .reduce((verificationMethodTypes, verificationMethodType) => {
1042
+ verificationMethodTypes[verificationMethodType] = true;
1043
+ return verificationMethodTypes;
1044
+ }, {});
1045
+ this.twoFactorManageService.verificationMethods$
1046
+ .subscribe((verificationMethods) => {
1047
+ this.verificationMethods = verificationMethods;
1048
+ this._cdRef.markForCheck();
1049
+ });
1050
+ }
1051
+ get defaultSms() {
1052
+ return this.twoFactorManageService.smsVerificationMethods
1053
+ .some((verificationMethod) => {
1054
+ return verificationMethod.default;
1055
+ });
1056
+ }
1057
+ get defaultApp() {
1058
+ return this.twoFactorManageService.appVerificationMethods
1059
+ .some((verificationMethod) => {
1060
+ return verificationMethod.default;
1061
+ });
1062
+ }
1063
+ get defaultEmail() {
1064
+ return this.twoFactorManageService.emailVerificationMethods
1065
+ .some((verificationMethod) => {
1066
+ return verificationMethod.default;
1067
+ });
1068
+ }
1069
+ get textHasVerificationMethod() {
1070
+ return this.twoFactorManageService.hasVerificationMethod(VerificationMethodType.Sms);
1071
+ }
1072
+ get appHasVerificationMethod() {
1073
+ return this.twoFactorManageService.hasVerificationMethod(VerificationMethodType.App);
1074
+ }
1075
+ get emailHasVerificationMethod() {
1076
+ return this.twoFactorManageService.hasVerificationMethod(VerificationMethodType.Email);
1077
+ }
1078
+ textMessageManage() {
1079
+ this._dialog.open(NumbersComponent, {
1080
+ data: {
1081
+ twoFactorManageService: this.twoFactorManageService,
1082
+ defaultCountry: this._defaultCountry,
1083
+ },
1084
+ });
1085
+ }
1086
+ textMessageAdd() {
1087
+ this.twoFactorManageService.addSms$(this._defaultCountry)
1088
+ .subscribe();
1089
+ }
1090
+ emailMessageManage() {
1091
+ this._dialog.open(EmailsComponent, {
1092
+ data: {
1093
+ twoFactorManageService: this.twoFactorManageService,
1094
+ },
1095
+ });
1096
+ }
1097
+ emailMessageAdd() {
1098
+ this.twoFactorManageService.addEmail$()
1099
+ .subscribe();
1100
+ }
1101
+ appRemove() {
1102
+ const verificationMethod = this.verificationMethods
1103
+ .find((_verificationMethod) => {
1104
+ return _verificationMethod.type === VerificationMethodType.App;
1105
+ });
1106
+ if (verificationMethod) {
1107
+ this.twoFactorManageService.accountVerify$()
1108
+ .pipe(switchMap(() => this.twoFactorManageService.verificationMethodDelete$(verificationMethod)))
1109
+ .subscribe(() => {
1110
+ this._message.success('Removed App Authenticator verification method');
1111
+ this._cdRef.markForCheck();
1112
+ });
1113
+ }
1114
+ }
1115
+ appAdd() {
1116
+ this.twoFactorManageService.addApp$()
1117
+ .subscribe();
1118
+ }
1119
+ ngOnDestroy() {
1120
+ this._destroy$.next();
1121
+ this._destroy$.complete();
1122
+ }
1123
+ }
1124
+ ManageMethodsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ManageMethodsComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: i0.ChangeDetectorRef }, { token: i1.MatDialog }, { token: i2.FsMessage }], target: i0.ɵɵFactoryTarget.Component });
1125
+ ManageMethodsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ManageMethodsComponent, selector: "ng-component", ngImport: i0, template: "<fs-dialog>\n <h1 mat-dialog-title>2-Step Verification</h1>\n <mat-dialog-content>\n <table>\n <tr *ngIf=\"verificationMethodTypes[VerificationMethodType.Sms]\">\n <td>\n <mat-icon>textsms</mat-icon>\n </td>\n <td>\n <div class=\"type\">\n <span>Text Message</span>\n <span *ngIf=\"textHasVerificationMethod\" class=\"enabled\"></span>\n <app-defaulted *ngIf=\"defaultSms\"></app-defaulted>\n </div>\n <div class=\"small\">\n Verification codes are sent by text message\n <ng-container *ngIf=\"textHasVerificationMethod\">\n to <span class=\"items\">\n <span *ngFor=\"let item of twoFactorManageService.smsVerificationMethods\">{{item.phoneNumber | fsPhone}}</span>\n </span>\n </ng-container>\n </div>\n </td>\n <td>\n <button \n *ngIf=\"textHasVerificationMethod; else textMessageManageButton\"\n mat-raised-button \n type=\"button\"\n (click)=\"textMessageManage()\">\n Manage\n </button>\n <ng-template #textMessageManageButton>\n <button \n mat-raised-button \n color=\"primary\"\n type=\"button\"\n (click)=\"textMessageAdd()\">\n Turn On\n </button>\n </ng-template>\n </td>\n </tr>\n <tr *ngIf=\"verificationMethodTypes[VerificationMethodType.Email]\">\n <td>\n <mat-icon>email</mat-icon>\n </td>\n <td>\n <div class=\"type\">\n <span>Email</span> \n <span *ngIf=\"emailHasVerificationMethod\" class=\"enabled\"></span>\n <app-defaulted *ngIf=\"defaultEmail\"></app-defaulted>\n </div>\n <div class=\"small\">\n Verification codes are sent by email\n <ng-container *ngIf=\"emailHasVerificationMethod\">\n to <span class=\"items\">\n <span *ngFor=\"let item of twoFactorManageService.emailVerificationMethods\">{{item.email}}</span>\n </span>\n </ng-container>\n </div>\n </td>\n <td>\n <button \n *ngIf=\"emailHasVerificationMethod; else emailMessageManageButton\"\n mat-raised-button \n type=\"button\"\n (click)=\"emailMessageManage()\">\n Manage\n </button>\n <ng-template #emailMessageManageButton>\n <button \n mat-raised-button \n color=\"primary\"\n type=\"button\"\n (click)=\"emailMessageAdd()\">\n Turn On\n </button>\n </ng-template>\n </td>\n </tr>\n <tr *ngIf=\"verificationMethodTypes[VerificationMethodType.App]\">\n <td>\n <mat-icon>phone_iphone</mat-icon>\n </td>\n <td>\n <div class=\"type\">\n <span>Authenticator App</span>\n <span *ngIf=\"appHasVerificationMethod\" class=\"enabled\"></span>\n <app-defaulted *ngIf=\"defaultApp\"></app-defaulted>\n </div>\n <div class=\"small\">Verification code is generated by an authenticator app such as Authy or Google Authenticator</div>\n </td>\n <td>\n <button \n *ngIf=\"appHasVerificationMethod; else appMessageManageButton\"\n mat-raised-button \n type=\"button\"\n (click)=\"appRemove()\">\n Remove\n </button>\n <ng-template #appMessageManageButton>\n <button \n mat-raised-button \n color=\"primary\"\n type=\"button\"\n (click)=\"appAdd()\">\n Turn On\n </button>\n </ng-template>\n </td>\n </tr> \n </table> \n </mat-dialog-content>\n <mat-dialog-actions>\n <button\n mat-button\n color=\"primary\"\n type=\"button\"\n [mat-dialog-close]=\"undefined\">\n Close\n </button>\n </mat-dialog-actions>\n</fs-dialog>\n", styles: ["mat-dialog-content{max-width:500px}.enabled{font-size:75%;background-color:#70b601;padding:2px 4px;border-radius:4px;color:#fff;margin-left:4px}.enabled:after{content:\"Enabled\"}table tr td:first-child,table tr td:last-child{width:1%}table tr td:first-child mat-icon,table tr td:last-child mat-icon{display:flex}table tr td{padding:6px;vertical-align:middle}table tr .type{display:flex;align-items:center}table tr .type app-defaulted{margin-left:4px}.items span+span:not(:last-child):before{content:\", \"}.items span+span:last-child:before{content:\" and \"}\n"], components: [{ type: i3.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode"] }, { type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: DefaultedComponent, selector: "app-defaulted" }, { type: i6.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: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i9$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i9$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }, { type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["type", "mat-dialog-close", "aria-label", "matDialogClose"], exportAs: ["matDialogClose"] }], pipes: { "fsPhone": i8$1.FsPhonePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1126
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ManageMethodsComponent, decorators: [{
1127
+ type: Component,
1128
+ args: [{
1129
+ templateUrl: './manage-methods.component.html',
1130
+ styleUrls: ['./manage-methods.component.scss'],
1131
+ changeDetection: ChangeDetectionStrategy.OnPush,
1132
+ }]
1133
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1134
+ type: Inject,
1135
+ args: [MAT_DIALOG_DATA]
1136
1136
  }] }, { type: i0.ChangeDetectorRef }, { type: i1.MatDialog }, { type: i2.FsMessage }]; } });
1137
1137
 
1138
- class Fs2faManageComponent {
1139
- constructor(_cdRef, _dialog, _twoFactorManageService) {
1140
- this._cdRef = _cdRef;
1141
- this._dialog = _dialog;
1142
- this._twoFactorManageService = _twoFactorManageService;
1143
- this._destroy$ = new Subject();
1144
- }
1145
- ngOnInit() {
1146
- this.verificationMethodTypes = this.verificationMethodTypes || [
1147
- VerificationMethodType.Sms,
1148
- VerificationMethodType.Email,
1149
- VerificationMethodType.App
1150
- ];
1151
- this._twoFactorManageService.registerVerificationMethodsFetch(this.verificationMethodsFetch);
1152
- this._twoFactorManageService.registerVerificationMethodDelete(this.verificationMethodDelete);
1153
- this._twoFactorManageService.registerVerificationMethodCreate(this.verificationMethodCreate);
1154
- this._twoFactorManageService.registerVerificationMethodVerify(this.verificationMethodVerify);
1155
- this._twoFactorManageService.registerVerificationMethodResend(this.verificationMethodResend);
1156
- this._twoFactorManageService.registerVerificationMethodDefault(this.verificationMethodDefault);
1157
- this._twoFactorManageService.registerAccountVerify(this.accountVerify);
1158
- this._twoFactorManageService.verificationMethods$
1159
- .subscribe((verificationMethods) => {
1160
- const types = {
1161
- sms: 'Text Message',
1162
- email: 'Email',
1163
- app: 'Authenticator App',
1164
- };
1165
- this.statuses = Object.keys(verificationMethods.reduce((accum, verificationMethod) => {
1166
- accum[verificationMethod.type] = true;
1167
- return accum;
1168
- }, {}))
1169
- .map((type) => {
1170
- return types[type];
1171
- });
1172
- this._cdRef.markForCheck();
1173
- });
1174
- this._twoFactorManageService.verificationMethodsFetch();
1175
- }
1176
- manage() {
1177
- const dialogRef = this._dialog.open(ManageMethodsComponent, {
1178
- autoFocus: false,
1179
- data: {
1180
- defaultCountry: this.defaultCountry,
1181
- twoFactorManageService: this._twoFactorManageService,
1182
- verificationMethodTypes: this.verificationMethodTypes,
1183
- },
1184
- });
1185
- dialogRef.afterClosed()
1186
- .pipe(takeUntil(this._destroy$))
1187
- .subscribe(() => {
1188
- this._cdRef.markForCheck();
1189
- });
1190
- }
1191
- reload() {
1192
- this._twoFactorManageService.verificationMethodsFetch();
1193
- }
1194
- ngOnDestroy() {
1195
- this._destroy$.next();
1196
- this._destroy$.complete();
1197
- }
1198
- }
1199
- Fs2faManageComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Fs2faManageComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1.MatDialog }, { token: TwoFactorManageService }], target: i0.ɵɵFactoryTarget.Component });
1200
- Fs2faManageComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: Fs2faManageComponent, selector: "fs-2fa-manage", inputs: { accountVerify: "accountVerify", defaultCountry: "defaultCountry", verificationMethodTypes: "verificationMethodTypes", verificationMethodsFetch: "verificationMethodsFetch", verificationMethodDelete: "verificationMethodDelete", verificationMethodCreate: "verificationMethodCreate", verificationMethodDefault: "verificationMethodDefault", verificationMethodVerify: "verificationMethodVerify", verificationMethodResend: "verificationMethodResend" }, providers: [TwoFactorManageService], ngImport: i0, template: "<fs-label-field>\n <fs-label>Status</fs-label>\n <ng-container *ngIf=\"statuses\">\n <ng-container *ngIf=\"statuses.length === 1\">\n {{statuses[0]}} verification is enabled\n </ng-container>\n\n <ng-container *ngIf=\"statuses.length > 1\">\n {{statuses.join(', ')}} verifications are enabled\n </ng-container>\n\n <ng-container *ngIf=\"statuses.length === 0\">\n No verification methods are enabled\n </ng-container>\n </ng-container>\n</fs-label-field>", styles: [""], components: [{ type: i3$2.FsLabelFieldComponent, selector: "fs-label-field", inputs: ["bottomMargin", "topMargin", "labelMargin"] }, { type: i3$2.FsLabelComponent, selector: "fs-label" }], directives: [{ type: i9$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1201
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Fs2faManageComponent, decorators: [{
1202
- type: Component,
1203
- args: [{
1204
- selector: 'fs-2fa-manage',
1205
- templateUrl: './2fa-manage.component.html',
1206
- styleUrls: ['./2fa-manage.component.scss'],
1207
- changeDetection: ChangeDetectionStrategy.OnPush,
1208
- providers: [TwoFactorManageService],
1209
- }]
1210
- }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i1.MatDialog }, { type: TwoFactorManageService }]; }, propDecorators: { accountVerify: [{
1211
- type: Input
1212
- }], defaultCountry: [{
1213
- type: Input
1214
- }], verificationMethodTypes: [{
1215
- type: Input
1216
- }], verificationMethodsFetch: [{
1217
- type: Input
1218
- }], verificationMethodDelete: [{
1219
- type: Input
1220
- }], verificationMethodCreate: [{
1221
- type: Input
1222
- }], verificationMethodDefault: [{
1223
- type: Input
1224
- }], verificationMethodVerify: [{
1225
- type: Input
1226
- }], verificationMethodResend: [{
1227
- type: Input
1138
+ class Fs2faManageComponent {
1139
+ constructor(_cdRef, _dialog, _twoFactorManageService) {
1140
+ this._cdRef = _cdRef;
1141
+ this._dialog = _dialog;
1142
+ this._twoFactorManageService = _twoFactorManageService;
1143
+ this._destroy$ = new Subject();
1144
+ }
1145
+ ngOnInit() {
1146
+ this.verificationMethodTypes = this.verificationMethodTypes || [
1147
+ VerificationMethodType.Sms,
1148
+ VerificationMethodType.Email,
1149
+ VerificationMethodType.App
1150
+ ];
1151
+ this._twoFactorManageService.registerVerificationMethodsFetch(this.verificationMethodsFetch);
1152
+ this._twoFactorManageService.registerVerificationMethodDelete(this.verificationMethodDelete);
1153
+ this._twoFactorManageService.registerVerificationMethodCreate(this.verificationMethodCreate);
1154
+ this._twoFactorManageService.registerVerificationMethodVerify(this.verificationMethodVerify);
1155
+ this._twoFactorManageService.registerVerificationMethodResend(this.verificationMethodResend);
1156
+ this._twoFactorManageService.registerVerificationMethodDefault(this.verificationMethodDefault);
1157
+ this._twoFactorManageService.registerAccountVerify(this.accountVerify);
1158
+ this._twoFactorManageService.verificationMethods$
1159
+ .subscribe((verificationMethods) => {
1160
+ const types = {
1161
+ sms: 'Text Message',
1162
+ email: 'Email',
1163
+ app: 'Authenticator App',
1164
+ };
1165
+ this.statuses = Object.keys(verificationMethods.reduce((accum, verificationMethod) => {
1166
+ accum[verificationMethod.type] = true;
1167
+ return accum;
1168
+ }, {}))
1169
+ .map((type) => {
1170
+ return types[type];
1171
+ });
1172
+ this._cdRef.markForCheck();
1173
+ });
1174
+ this._twoFactorManageService.verificationMethodsFetch();
1175
+ }
1176
+ manage() {
1177
+ const dialogRef = this._dialog.open(ManageMethodsComponent, {
1178
+ autoFocus: false,
1179
+ data: {
1180
+ defaultCountry: this.defaultCountry,
1181
+ twoFactorManageService: this._twoFactorManageService,
1182
+ verificationMethodTypes: this.verificationMethodTypes,
1183
+ },
1184
+ });
1185
+ dialogRef.afterClosed()
1186
+ .pipe(takeUntil(this._destroy$))
1187
+ .subscribe(() => {
1188
+ this._cdRef.markForCheck();
1189
+ });
1190
+ }
1191
+ reload() {
1192
+ this._twoFactorManageService.verificationMethodsFetch();
1193
+ }
1194
+ ngOnDestroy() {
1195
+ this._destroy$.next();
1196
+ this._destroy$.complete();
1197
+ }
1198
+ }
1199
+ Fs2faManageComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Fs2faManageComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1.MatDialog }, { token: TwoFactorManageService }], target: i0.ɵɵFactoryTarget.Component });
1200
+ Fs2faManageComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: Fs2faManageComponent, selector: "fs-2fa-manage", inputs: { accountVerify: "accountVerify", defaultCountry: "defaultCountry", verificationMethodTypes: "verificationMethodTypes", verificationMethodsFetch: "verificationMethodsFetch", verificationMethodDelete: "verificationMethodDelete", verificationMethodCreate: "verificationMethodCreate", verificationMethodDefault: "verificationMethodDefault", verificationMethodVerify: "verificationMethodVerify", verificationMethodResend: "verificationMethodResend" }, providers: [TwoFactorManageService], ngImport: i0, template: "<fs-label-field>\n <fs-label>Status</fs-label>\n <ng-container *ngIf=\"statuses\">\n <ng-container *ngIf=\"statuses.length === 1\">\n {{statuses[0]}} verification is enabled\n </ng-container>\n\n <ng-container *ngIf=\"statuses.length > 1\">\n {{statuses.join(', ')}} verifications are enabled\n </ng-container>\n\n <ng-container *ngIf=\"statuses.length === 0\">\n No verification methods are enabled\n </ng-container>\n </ng-container>\n</fs-label-field>", styles: [""], components: [{ type: i3$2.FsLabelFieldComponent, selector: "fs-label-field", inputs: ["bottomMargin", "topMargin", "labelMargin"] }, { type: i3$2.FsLabelComponent, selector: "fs-label" }], directives: [{ type: i9$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1201
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Fs2faManageComponent, decorators: [{
1202
+ type: Component,
1203
+ args: [{
1204
+ selector: 'fs-2fa-manage',
1205
+ templateUrl: './2fa-manage.component.html',
1206
+ styleUrls: ['./2fa-manage.component.scss'],
1207
+ changeDetection: ChangeDetectionStrategy.OnPush,
1208
+ providers: [TwoFactorManageService],
1209
+ }]
1210
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i1.MatDialog }, { type: TwoFactorManageService }]; }, propDecorators: { accountVerify: [{
1211
+ type: Input
1212
+ }], defaultCountry: [{
1213
+ type: Input
1214
+ }], verificationMethodTypes: [{
1215
+ type: Input
1216
+ }], verificationMethodsFetch: [{
1217
+ type: Input
1218
+ }], verificationMethodDelete: [{
1219
+ type: Input
1220
+ }], verificationMethodCreate: [{
1221
+ type: Input
1222
+ }], verificationMethodDefault: [{
1223
+ type: Input
1224
+ }], verificationMethodVerify: [{
1225
+ type: Input
1226
+ }], verificationMethodResend: [{
1227
+ type: Input
1228
1228
  }] } });
1229
1229
 
1230
- class DefautledModule {
1231
- }
1232
- DefautledModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DefautledModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1233
- DefautledModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DefautledModule, declarations: [DefaultedComponent], exports: [DefaultedComponent] });
1234
- DefautledModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DefautledModule });
1235
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DefautledModule, decorators: [{
1236
- type: NgModule,
1237
- args: [{
1238
- declarations: [
1239
- DefaultedComponent,
1240
- ],
1241
- exports: [DefaultedComponent],
1242
- }]
1230
+ class DefautledModule {
1231
+ }
1232
+ DefautledModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DefautledModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1233
+ DefautledModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DefautledModule, declarations: [DefaultedComponent], exports: [DefaultedComponent] });
1234
+ DefautledModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DefautledModule });
1235
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DefautledModule, decorators: [{
1236
+ type: NgModule,
1237
+ args: [{
1238
+ declarations: [
1239
+ DefaultedComponent,
1240
+ ],
1241
+ exports: [DefaultedComponent],
1242
+ }]
1243
1243
  }] });
1244
1244
 
1245
- class Fs2faVerificationMethodsModule {
1246
- }
1247
- Fs2faVerificationMethodsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Fs2faVerificationMethodsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1248
- Fs2faVerificationMethodsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Fs2faVerificationMethodsModule, declarations: [VerificationMethodsComponent], imports: [CommonModule,
1249
- FormsModule,
1250
- MatIconModule,
1251
- FsListModule,
1252
- FsPhoneModule,
1253
- FsCountryModule,
1254
- DefautledModule], exports: [VerificationMethodsComponent] });
1255
- Fs2faVerificationMethodsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Fs2faVerificationMethodsModule, imports: [[
1256
- CommonModule,
1257
- FormsModule,
1258
- MatIconModule,
1259
- FsListModule,
1260
- FsPhoneModule,
1261
- FsCountryModule,
1262
- DefautledModule,
1263
- ]] });
1264
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Fs2faVerificationMethodsModule, decorators: [{
1265
- type: NgModule,
1266
- args: [{
1267
- imports: [
1268
- CommonModule,
1269
- FormsModule,
1270
- MatIconModule,
1271
- FsListModule,
1272
- FsPhoneModule,
1273
- FsCountryModule,
1274
- DefautledModule,
1275
- ],
1276
- declarations: [
1277
- VerificationMethodsComponent,
1278
- ],
1279
- exports: [VerificationMethodsComponent],
1280
- }]
1245
+ class Fs2faVerificationMethodsModule {
1246
+ }
1247
+ Fs2faVerificationMethodsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Fs2faVerificationMethodsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1248
+ Fs2faVerificationMethodsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Fs2faVerificationMethodsModule, declarations: [VerificationMethodsComponent], imports: [CommonModule,
1249
+ FormsModule,
1250
+ MatIconModule,
1251
+ FsListModule,
1252
+ FsPhoneModule,
1253
+ FsCountryModule,
1254
+ DefautledModule], exports: [VerificationMethodsComponent] });
1255
+ Fs2faVerificationMethodsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Fs2faVerificationMethodsModule, imports: [[
1256
+ CommonModule,
1257
+ FormsModule,
1258
+ MatIconModule,
1259
+ FsListModule,
1260
+ FsPhoneModule,
1261
+ FsCountryModule,
1262
+ DefautledModule,
1263
+ ]] });
1264
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Fs2faVerificationMethodsModule, decorators: [{
1265
+ type: NgModule,
1266
+ args: [{
1267
+ imports: [
1268
+ CommonModule,
1269
+ FormsModule,
1270
+ MatIconModule,
1271
+ FsListModule,
1272
+ FsPhoneModule,
1273
+ FsCountryModule,
1274
+ DefautledModule,
1275
+ ],
1276
+ declarations: [
1277
+ VerificationMethodsComponent,
1278
+ ],
1279
+ exports: [VerificationMethodsComponent],
1280
+ }]
1281
1281
  }] });
1282
1282
 
1283
- class Fs2faManageModule {
1284
- }
1285
- Fs2faManageModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Fs2faManageModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1286
- Fs2faManageModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Fs2faManageModule, declarations: [Fs2faManageComponent,
1287
- ManageMethodsComponent,
1288
- NumbersComponent,
1289
- AppComponent,
1290
- EmailComponent,
1291
- NumberComponent,
1292
- EmailsComponent], imports: [CommonModule,
1293
- FormsModule,
1294
- MatButtonModule,
1295
- MatDialogModule,
1296
- MatInputModule,
1297
- MatIconModule,
1298
- MatCheckboxModule,
1299
- FsDialogModule,
1300
- FsListModule,
1301
- FsFormModule,
1302
- FsLabelModule,
1303
- FsPhoneModule,
1304
- FsSkeletonModule,
1305
- FsCountryModule,
1306
- CodeInputModule,
1307
- QrCodeModule,
1308
- ResendModule,
1309
- DefautledModule,
1310
- Fs2faVerificationModule,
1311
- Fs2faVerificationMethodsModule], exports: [Fs2faManageComponent] });
1312
- Fs2faManageModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Fs2faManageModule, imports: [[
1313
- CommonModule,
1314
- FormsModule,
1315
- MatButtonModule,
1316
- MatDialogModule,
1317
- MatInputModule,
1318
- MatIconModule,
1319
- MatCheckboxModule,
1320
- FsDialogModule,
1321
- FsListModule,
1322
- FsFormModule,
1323
- FsLabelModule,
1324
- FsPhoneModule,
1325
- FsSkeletonModule,
1326
- FsCountryModule,
1327
- CodeInputModule,
1328
- QrCodeModule,
1329
- ResendModule,
1330
- DefautledModule,
1331
- Fs2faVerificationModule,
1332
- Fs2faVerificationMethodsModule,
1333
- ]] });
1334
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Fs2faManageModule, decorators: [{
1335
- type: NgModule,
1336
- args: [{
1337
- imports: [
1338
- CommonModule,
1339
- FormsModule,
1340
- MatButtonModule,
1341
- MatDialogModule,
1342
- MatInputModule,
1343
- MatIconModule,
1344
- MatCheckboxModule,
1345
- FsDialogModule,
1346
- FsListModule,
1347
- FsFormModule,
1348
- FsLabelModule,
1349
- FsPhoneModule,
1350
- FsSkeletonModule,
1351
- FsCountryModule,
1352
- CodeInputModule,
1353
- QrCodeModule,
1354
- ResendModule,
1355
- DefautledModule,
1356
- Fs2faVerificationModule,
1357
- Fs2faVerificationMethodsModule,
1358
- ],
1359
- declarations: [
1360
- Fs2faManageComponent,
1361
- ManageMethodsComponent,
1362
- NumbersComponent,
1363
- AppComponent,
1364
- EmailComponent,
1365
- NumberComponent,
1366
- EmailsComponent,
1367
- ],
1368
- exports: [Fs2faManageComponent],
1369
- }]
1283
+ class Fs2faManageModule {
1284
+ }
1285
+ Fs2faManageModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Fs2faManageModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1286
+ Fs2faManageModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Fs2faManageModule, declarations: [Fs2faManageComponent,
1287
+ ManageMethodsComponent,
1288
+ NumbersComponent,
1289
+ AppComponent,
1290
+ EmailComponent,
1291
+ NumberComponent,
1292
+ EmailsComponent], imports: [CommonModule,
1293
+ FormsModule,
1294
+ MatButtonModule,
1295
+ MatDialogModule,
1296
+ MatInputModule,
1297
+ MatIconModule,
1298
+ MatCheckboxModule,
1299
+ FsDialogModule,
1300
+ FsListModule,
1301
+ FsFormModule,
1302
+ FsLabelModule,
1303
+ FsPhoneModule,
1304
+ FsSkeletonModule,
1305
+ FsCountryModule,
1306
+ CodeInputModule,
1307
+ QrCodeModule,
1308
+ ResendModule,
1309
+ DefautledModule,
1310
+ Fs2faVerificationModule,
1311
+ Fs2faVerificationMethodsModule], exports: [Fs2faManageComponent] });
1312
+ Fs2faManageModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Fs2faManageModule, imports: [[
1313
+ CommonModule,
1314
+ FormsModule,
1315
+ MatButtonModule,
1316
+ MatDialogModule,
1317
+ MatInputModule,
1318
+ MatIconModule,
1319
+ MatCheckboxModule,
1320
+ FsDialogModule,
1321
+ FsListModule,
1322
+ FsFormModule,
1323
+ FsLabelModule,
1324
+ FsPhoneModule,
1325
+ FsSkeletonModule,
1326
+ FsCountryModule,
1327
+ CodeInputModule,
1328
+ QrCodeModule,
1329
+ ResendModule,
1330
+ DefautledModule,
1331
+ Fs2faVerificationModule,
1332
+ Fs2faVerificationMethodsModule,
1333
+ ]] });
1334
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Fs2faManageModule, decorators: [{
1335
+ type: NgModule,
1336
+ args: [{
1337
+ imports: [
1338
+ CommonModule,
1339
+ FormsModule,
1340
+ MatButtonModule,
1341
+ MatDialogModule,
1342
+ MatInputModule,
1343
+ MatIconModule,
1344
+ MatCheckboxModule,
1345
+ FsDialogModule,
1346
+ FsListModule,
1347
+ FsFormModule,
1348
+ FsLabelModule,
1349
+ FsPhoneModule,
1350
+ FsSkeletonModule,
1351
+ FsCountryModule,
1352
+ CodeInputModule,
1353
+ QrCodeModule,
1354
+ ResendModule,
1355
+ DefautledModule,
1356
+ Fs2faVerificationModule,
1357
+ Fs2faVerificationMethodsModule,
1358
+ ],
1359
+ declarations: [
1360
+ Fs2faManageComponent,
1361
+ ManageMethodsComponent,
1362
+ NumbersComponent,
1363
+ AppComponent,
1364
+ EmailComponent,
1365
+ NumberComponent,
1366
+ EmailsComponent,
1367
+ ],
1368
+ exports: [Fs2faManageComponent],
1369
+ }]
1370
1370
  }] });
1371
1371
 
1372
- /**
1373
- * Generated bundle index. Do not edit.
1372
+ /**
1373
+ * Generated bundle index. Do not edit.
1374
1374
  */
1375
1375
 
1376
1376
  export { Fs2faManageComponent, Fs2faManageModule, Fs2faVerificationComponent, Fs2faVerificationMethodsModule, Fs2faVerificationModule, Fs2faVerificationResendDirective, VerificationMethodType, VerificationMethodsComponent };