@firestitch/2fa 12.0.4 → 12.0.7

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 (27) hide show
  1. package/app/components/2fa-verification/2fa-verification.component.d.ts +32 -26
  2. package/app/components/2fa-verification-code/2fa-verification-code.component.d.ts +18 -11
  3. package/app/components/2fa-verification-methods/2fa-verification-methods.component.d.ts +23 -23
  4. package/app/enums/verification-method-type.enum.d.ts +5 -6
  5. package/app/fs-2fa.module.d.ts +23 -23
  6. package/app/interfaces/verification-method.interface.d.ts +11 -11
  7. package/app/interfaces/verification-provider.interface.d.ts +8 -8
  8. package/app/tokens/verification.token.d.ts +3 -3
  9. package/bundles/firestitch-2fa.umd.js +291 -294
  10. package/bundles/firestitch-2fa.umd.js.map +1 -1
  11. package/esm2015/app/components/2fa-verification/2fa-verification.component.js +106 -92
  12. package/esm2015/app/components/2fa-verification-code/2fa-verification-code.component.js +60 -45
  13. package/esm2015/app/components/2fa-verification-methods/2fa-verification-methods.component.js +73 -73
  14. package/esm2015/app/enums/verification-method-type.enum.js +7 -8
  15. package/esm2015/app/fs-2fa.module.js +88 -91
  16. package/esm2015/app/interfaces/verification-method.interface.js +1 -1
  17. package/esm2015/app/interfaces/verification-provider.interface.js +1 -1
  18. package/esm2015/app/tokens/verification.token.js +2 -2
  19. package/esm2015/firestitch-2fa.js +4 -4
  20. package/esm2015/public_api.js +8 -8
  21. package/fesm2015/firestitch-2fa.js +275 -276
  22. package/fesm2015/firestitch-2fa.js.map +1 -1
  23. package/firestitch-2fa.d.ts +5 -5
  24. package/package.json +1 -1
  25. package/public_api.d.ts +6 -6
  26. package/app/components/2fa-verification-otp/2fa-verification-otp.component.d.ts +0 -12
  27. package/esm2015/app/components/2fa-verification-otp/2fa-verification-otp.component.js +0 -33
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/forms'), require('@angular/common'), require('@angular/material/icon'), require('@angular/material/radio'), require('@angular/material/button'), require('@angular/material/form-field'), require('@angular/material/input'), require('@angular/material/checkbox'), require('@angular/material/progress-spinner'), require('@firestitch/form'), require('@firestitch/skeleton'), require('@firestitch/radiogroup'), require('@firestitch/dialog'), require('rxjs/operators'), require('@angular/material/dialog'), require('rxjs')) :
3
- typeof define === 'function' && define.amd ? define('@firestitch/2fa', ['exports', '@angular/core', '@angular/forms', '@angular/common', '@angular/material/icon', '@angular/material/radio', '@angular/material/button', '@angular/material/form-field', '@angular/material/input', '@angular/material/checkbox', '@angular/material/progress-spinner', '@firestitch/form', '@firestitch/skeleton', '@firestitch/radiogroup', '@firestitch/dialog', 'rxjs/operators', '@angular/material/dialog', 'rxjs'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.firestitch = global.firestitch || {}, global.firestitch["2fa"] = {}), global.ng.core, global.ng.forms, global.ng.common, global.ng.material.icon, global.ng.material.radio, global.ng.material.button, global.ng.material.formField, global.ng.material.input, global.ng.material.checkbox, global.ng.material.progressSpinner, global.i8, global.i9, global.i3, global.i1$1, global.rxjs.operators, global.ng.material.dialog, global.rxjs));
5
- })(this, (function (exports, i0, i7, i10, i4, i5, i5$1, i1$2, i3$1, i4$1, i6, i8, i9, i3, i1$1, operators, i1, rxjs) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/forms'), require('@angular/common'), require('@angular/material/icon'), require('@angular/material/radio'), require('@angular/material/button'), require('@angular/material/form-field'), require('@angular/material/input'), require('@angular/material/checkbox'), require('@angular/material/progress-spinner'), require('@firestitch/form'), require('@firestitch/skeleton'), require('@firestitch/radiogroup'), require('@firestitch/dialog'), require('angular-code-input'), require('rxjs/operators'), require('@angular/material/dialog'), require('rxjs')) :
3
+ typeof define === 'function' && define.amd ? define('@firestitch/2fa', ['exports', '@angular/core', '@angular/forms', '@angular/common', '@angular/material/icon', '@angular/material/radio', '@angular/material/button', '@angular/material/form-field', '@angular/material/input', '@angular/material/checkbox', '@angular/material/progress-spinner', '@firestitch/form', '@firestitch/skeleton', '@firestitch/radiogroup', '@firestitch/dialog', 'angular-code-input', 'rxjs/operators', '@angular/material/dialog', 'rxjs'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.firestitch = global.firestitch || {}, global.firestitch["2fa"] = {}), global.ng.core, global.ng.forms, global.ng.common, global.ng.material.icon, global.ng.material.radio, global.ng.material.button, global.ng.material.formField, global.ng.material.input, global.ng.material.checkbox, global.ng.material.progressSpinner, global.i8, global.i9, global.i3, global.i1$1, global.i1$2, global.rxjs.operators, global.ng.material.dialog, global.rxjs));
5
+ })(this, (function (exports, i0, i7, i10, i4, i5, i6, formField, input, i4$1, i5$1, i8, i9, i3, i1$1, i1$2, operators, i1, rxjs) { 'use strict';
6
6
 
7
7
  function _interopNamespace(e) {
8
8
  if (e && e.__esModule) return e;
@@ -27,317 +27,314 @@
27
27
  var i10__namespace = /*#__PURE__*/_interopNamespace(i10);
28
28
  var i4__namespace = /*#__PURE__*/_interopNamespace(i4);
29
29
  var i5__namespace = /*#__PURE__*/_interopNamespace(i5);
30
- var i5__namespace$1 = /*#__PURE__*/_interopNamespace(i5$1);
31
- var i1__namespace$2 = /*#__PURE__*/_interopNamespace(i1$2);
32
- var i3__namespace$1 = /*#__PURE__*/_interopNamespace(i3$1);
33
- var i4__namespace$1 = /*#__PURE__*/_interopNamespace(i4$1);
34
30
  var i6__namespace = /*#__PURE__*/_interopNamespace(i6);
31
+ var i4__namespace$1 = /*#__PURE__*/_interopNamespace(i4$1);
32
+ var i5__namespace$1 = /*#__PURE__*/_interopNamespace(i5$1);
35
33
  var i8__namespace = /*#__PURE__*/_interopNamespace(i8);
36
34
  var i9__namespace = /*#__PURE__*/_interopNamespace(i9);
37
35
  var i3__namespace = /*#__PURE__*/_interopNamespace(i3);
38
36
  var i1__namespace$1 = /*#__PURE__*/_interopNamespace(i1$1);
37
+ var i1__namespace$2 = /*#__PURE__*/_interopNamespace(i1$2);
39
38
  var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
40
39
 
41
40
  var FS_2FA_VERIFICATION_PROVIDER = new i0.InjectionToken('Provider for Verification service');
42
41
 
43
- exports.FsVerificationMethodType = void 0;
44
- (function (FsVerificationMethodType) {
45
- FsVerificationMethodType["Sms"] = "sms";
46
- FsVerificationMethodType["Email"] = "email";
47
- FsVerificationMethodType["Authenticator"] = "authenticator";
48
- FsVerificationMethodType["Code"] = "code";
42
+ exports.FsVerificationMethodType = void 0;
43
+ (function (FsVerificationMethodType) {
44
+ FsVerificationMethodType["Sms"] = "sms";
45
+ FsVerificationMethodType["Email"] = "email";
46
+ FsVerificationMethodType["App"] = "app";
49
47
  })(exports.FsVerificationMethodType || (exports.FsVerificationMethodType = {}));
50
48
 
51
- var Fs2FaVerificationMethodsComponent = /** @class */ (function () {
52
- function Fs2FaVerificationMethodsComponent(_verificationProvider, _dialogData, _dialogRef) {
53
- var _this = this;
54
- this._verificationProvider = _verificationProvider;
55
- this._dialogData = _dialogData;
56
- this._dialogRef = _dialogRef;
57
- this.verificationMethodType = exports.FsVerificationMethodType;
58
- this.setVerificationMethod = function () {
59
- return _this._verificationProvider
60
- .updateVerificationMethod(_this.method.id)
61
- .pipe(operators.tap(function (method) {
62
- _this._dialogRef.close(method);
63
- }));
64
- };
65
- this._setActiveMethod();
66
- this._initMethods();
67
- }
68
- Fs2FaVerificationMethodsComponent.prototype.compareWith = function (o1, o2) {
69
- return o1 && o2 && o1.id === o2.id;
70
- };
71
- Fs2FaVerificationMethodsComponent.prototype._setActiveMethod = function () {
72
- var _a;
73
- this.method = (_a = this._dialogData) === null || _a === void 0 ? void 0 : _a.method;
74
- };
75
- Fs2FaVerificationMethodsComponent.prototype._initMethods = function () {
76
- this.methods$ = this._verificationProvider
77
- .methods()
78
- .pipe(operators.map(function (methods) {
79
- return methods
80
- .reduce(function (acc, method) {
81
- if (!acc[method.type]) {
82
- acc[method.type] = [];
83
- }
84
- acc[method.type].push(method);
85
- return acc;
86
- }, {});
87
- }), operators.shareReplay(1));
88
- };
89
- return Fs2FaVerificationMethodsComponent;
90
- }());
91
- Fs2FaVerificationMethodsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: Fs2FaVerificationMethodsComponent, deps: [{ token: FS_2FA_VERIFICATION_PROVIDER }, { token: i1.MAT_DIALOG_DATA }, { token: i1__namespace.MatDialogRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
92
- Fs2FaVerificationMethodsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: Fs2FaVerificationMethodsComponent, selector: "ng-component", ngImport: i0__namespace, template: "<fs-dialog>\n <h1 mat-dialog-title>\n Verification Methods\n </h1>\n <form fsForm [submit]=\"setVerificationMethod\">\n <mat-dialog-content>\n <ng-container *fsSkeleton=\"methods$ | async as methods\">\n <fs-radio-group [(ngModel)]=\"method\" name=\"method\" [compareWith]=\"compareWith\">\n <ng-container *ngFor=\"let methodMap of methods | keyvalue\">\n <div class=\"method\">\n <ng-container [ngSwitch]=\"methodMap.key\">\n <ng-container *ngSwitchCase=\"verificationMethodType.Sms\">\n <div class=\"method-header\">\n <div class=\"method-icon\">\n <mat-icon>\n smartphone\n </mat-icon>\n </div>\n <div class=\"method-name\">\n <div class=\"method-title\">Text Message</div>\n <div class=\"method-subtitle\">\n Verification code send to one of following mobile number\n </div>\n </div>\n </div>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"verificationMethodType.Email\">\n <div class=\"method-header\">\n <div class=\"method-icon\">\n <mat-icon>\n mail\n </mat-icon>\n </div>\n <div class=\"method-name\">\n <div class=\"method-title\">Email</div>\n <div class=\"method-subtitle\">\n Verification code send to one of following email\n </div>\n </div>\n </div>\n </ng-container>\n </ng-container>\n\n <ng-container [ngSwitch]=\"methodMap.key\">\n <ng-container *ngSwitchCase=\"verificationMethodType.Sms\">\n <mat-radio-button class=\"method-item\" *ngFor=\"let method of methodMap.value\" [value]=\"method\">\n {{ method.phoneNumber }}\n </mat-radio-button>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"verificationMethodType.Email\">\n <mat-radio-button class=\"method-item\" *ngFor=\"let method of methodMap.value\" [value]=\"method\">\n {{ method.email }}\n </mat-radio-button>\n </ng-container>\n </ng-container>\n </div>\n </ng-container>\n </fs-radio-group>\n </ng-container>\n </mat-dialog-content>\n <mat-dialog-actions>\n <div class=\"actions\">\n <ng-container *ngIf=\"methods$ | async\">\n <button mat-button type=\"submit\" color=\"primary\">Next</button>\n </ng-container>\n <button mat-button type=\"button\" [mat-dialog-close]=\"null\">Cancel</button>\n </div>\n </mat-dialog-actions>\n </form>\n</fs-dialog>\n", styles: [".method{display:block;margin-bottom:20px}.method .method-header{display:flex;align-items:flex-start}.method .method-header .method-name{margin-left:10px}.method .method-header .method-name .method-title{font-size:14px;font-weight:400}.method .method-header .method-name .method-subtitle{font-size:12px;color:#a3a3a3}.method .method-item{display:block;margin:10px 0 0 35px}\n"], components: [{ type: i1__namespace$1.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode"] }, { type: i3__namespace.FsRadioGroupComponent, selector: "fs-radio-group", inputs: ["orientation", "radioPosition", "compareWith", "required", "disabled", "label", "name"] }, { type: i4__namespace.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i5__namespace.MatRadioButton, selector: "mat-radio-button", inputs: ["disableRipple", "tabIndex"], exportAs: ["matRadioButton"] }, { type: i5__namespace$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i1__namespace.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i7__namespace.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i7__namespace.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i7__namespace.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i8__namespace.FsFormDirective, selector: "[fsForm]", inputs: ["wrapperSelector", "messageSelector", "hintSelector", "labelSelector", "autocomplete", "shortcuts", "confirm", "confirmDialog", "confirmDrawer", "confirmBrowser", "confirmTabs", "dirtySubmitButton", "successDelay", "errorDelay", "submit", "tabGroup"], outputs: ["fsForm", "invalid", "valid", "submitted", "reseted", "cleared"] }, { type: i1__namespace.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i9__namespace.ɵa, selector: "[fsSkeleton]", inputs: ["fsSkeletonPattern", "fsSkeleton"] }, { type: i7__namespace.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i7__namespace.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i10__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i10__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i1__namespace.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }, { type: i10__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i8__namespace.ɵw, selector: "button[type=\"submit\"]", inputs: ["dirtySubmit", "name"] }, { type: i1__namespace.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["type", "mat-dialog-close", "aria-label", "matDialogClose"], exportAs: ["matDialogClose"] }], pipes: { "async": i10__namespace.AsyncPipe, "keyvalue": i10__namespace.KeyValuePipe }, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
93
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: Fs2FaVerificationMethodsComponent, decorators: [{
94
- type: i0.Component,
95
- args: [{
96
- templateUrl: './2fa-verification-methods.component.html',
97
- styleUrls: [
98
- './2fa-verification-methods.component.scss',
99
- ],
100
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
101
- }]
102
- }], ctorParameters: function () {
103
- return [{ type: undefined, decorators: [{
104
- type: i0.Inject,
105
- args: [FS_2FA_VERIFICATION_PROVIDER]
106
- }] }, { type: undefined, decorators: [{
107
- type: i0.Inject,
108
- args: [i1.MAT_DIALOG_DATA]
109
- }] }, { type: i1__namespace.MatDialogRef }];
49
+ var Fs2FaVerificationMethodsComponent = /** @class */ (function () {
50
+ function Fs2FaVerificationMethodsComponent(_verificationProvider, _dialogData, _dialogRef) {
51
+ var _this = this;
52
+ this._verificationProvider = _verificationProvider;
53
+ this._dialogData = _dialogData;
54
+ this._dialogRef = _dialogRef;
55
+ this.verificationMethodType = exports.FsVerificationMethodType;
56
+ this.setVerificationMethod = function () {
57
+ return _this._verificationProvider
58
+ .updateVerificationMethod(_this.method.id)
59
+ .pipe(operators.tap(function (method) {
60
+ _this._dialogRef.close(method);
61
+ }));
62
+ };
63
+ this._setActiveMethod();
64
+ this._initMethods();
65
+ }
66
+ Fs2FaVerificationMethodsComponent.prototype.compareWith = function (o1, o2) {
67
+ return o1 && o2 && o1.id === o2.id;
68
+ };
69
+ Fs2FaVerificationMethodsComponent.prototype._setActiveMethod = function () {
70
+ var _a;
71
+ this.method = (_a = this._dialogData) === null || _a === void 0 ? void 0 : _a.method;
72
+ };
73
+ Fs2FaVerificationMethodsComponent.prototype._initMethods = function () {
74
+ this.methods$ = this._verificationProvider
75
+ .methods()
76
+ .pipe(operators.map(function (methods) {
77
+ return methods
78
+ .reduce(function (acc, method) {
79
+ if (!acc[method.type]) {
80
+ acc[method.type] = [];
81
+ }
82
+ acc[method.type].push(method);
83
+ return acc;
84
+ }, {});
85
+ }), operators.shareReplay(1));
86
+ };
87
+ return Fs2FaVerificationMethodsComponent;
88
+ }());
89
+ Fs2FaVerificationMethodsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: Fs2FaVerificationMethodsComponent, deps: [{ token: FS_2FA_VERIFICATION_PROVIDER }, { token: i1.MAT_DIALOG_DATA }, { token: i1__namespace.MatDialogRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
90
+ Fs2FaVerificationMethodsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: Fs2FaVerificationMethodsComponent, selector: "ng-component", ngImport: i0__namespace, template: "<fs-dialog>\n <h1 mat-dialog-title>\n Verification Methods\n </h1>\n <form fsForm [submit]=\"setVerificationMethod\" [dirtySubmitButton]=\"false\">\n <mat-dialog-content>\n <ng-container *fsSkeleton=\"methods$ | async as methods\">\n <fs-radio-group [(ngModel)]=\"method\" name=\"method\" [compareWith]=\"compareWith\">\n <ng-container *ngFor=\"let methodMap of methods | keyvalue\">\n <div class=\"method\">\n <ng-container [ngSwitch]=\"methodMap.key\">\n <ng-container *ngSwitchCase=\"verificationMethodType.Sms\">\n <div class=\"method-header\">\n <div class=\"method-icon\">\n <mat-icon>\n 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 Verification code send to one of following mobile number\n </div>\n </div>\n </div>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"verificationMethodType.Email\">\n <div class=\"method-header\">\n <div class=\"method-icon\">\n <mat-icon>\n mail\n </mat-icon>\n </div>\n <div class=\"method-name\">\n <div class=\"method-title\">Email</div>\n <div class=\"method-subtitle\">\n Verification code send to one of following email\n </div>\n </div>\n </div>\n </ng-container>\n\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 Verification code generated by an 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 <ng-container *ngIf=\"methods$ | async\">\n <button mat-button type=\"submit\" color=\"primary\">Next</button>\n </ng-container>\n <button mat-button type=\"button\" [mat-dialog-close]=\"null\">Cancel</button>\n </div>\n </mat-dialog-actions>\n </form>\n</fs-dialog>\n", styles: [".method{display:block;margin-bottom:20px}.method .method-header{display:flex;align-items:flex-start}.method .method-header .method-name{margin-left:10px}.method .method-header .method-name .method-title{font-size:14px;font-weight:400}.method .method-header .method-name .method-subtitle{font-size:12px;color:#a3a3a3}.method .method-item{display:block;margin:10px 0 0 35px}\n"], components: [{ type: i1__namespace$1.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode"] }, { type: i3__namespace.FsRadioGroupComponent, selector: "fs-radio-group", inputs: ["orientation", "radioPosition", "compareWith", "required", "disabled", "label", "name"] }, { type: i4__namespace.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i5__namespace.MatRadioButton, selector: "mat-radio-button", inputs: ["disableRipple", "tabIndex"], exportAs: ["matRadioButton"] }, { type: i6__namespace.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__namespace.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i7__namespace.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i7__namespace.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i7__namespace.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i8__namespace.FsFormDirective, selector: "[fsForm]", inputs: ["wrapperSelector", "messageSelector", "hintSelector", "labelSelector", "autocomplete", "shortcuts", "confirm", "confirmDialog", "confirmDrawer", "confirmBrowser", "confirmTabs", "dirtySubmitButton", "successDelay", "errorDelay", "submit", "tabGroup"], outputs: ["fsForm", "invalid", "valid", "submitted", "reseted", "cleared"] }, { type: i1__namespace.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i9__namespace.ɵa, selector: "[fsSkeleton]", inputs: ["fsSkeletonPattern", "fsSkeleton"] }, { type: i7__namespace.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i7__namespace.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i10__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i10__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i1__namespace.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }, { type: i10__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i8__namespace.ɵw, selector: "button[type=\"submit\"]", inputs: ["dirtySubmit", "name"] }, { type: i1__namespace.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["type", "mat-dialog-close", "aria-label", "matDialogClose"], exportAs: ["matDialogClose"] }], pipes: { "async": i10__namespace.AsyncPipe, "keyvalue": i10__namespace.KeyValuePipe }, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
91
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: Fs2FaVerificationMethodsComponent, decorators: [{
92
+ type: i0.Component,
93
+ args: [{
94
+ templateUrl: './2fa-verification-methods.component.html',
95
+ styleUrls: [
96
+ './2fa-verification-methods.component.scss',
97
+ ],
98
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
99
+ }]
100
+ }], ctorParameters: function () {
101
+ return [{ type: undefined, decorators: [{
102
+ type: i0.Inject,
103
+ args: [FS_2FA_VERIFICATION_PROVIDER]
104
+ }] }, { type: undefined, decorators: [{
105
+ type: i0.Inject,
106
+ args: [i1.MAT_DIALOG_DATA]
107
+ }] }, { type: i1__namespace.MatDialogRef }];
110
108
  } });
111
109
 
112
- var Fs2FAVerificationOTPComponent = /** @class */ (function () {
113
- function Fs2FAVerificationOTPComponent(form) {
114
- this.form = form;
115
- this.codeChange = new i0.EventEmitter();
116
- }
117
- Fs2FAVerificationOTPComponent.prototype.codeChanged = function (event) {
118
- this.codeChange.emit(event);
119
- this.form.dirty();
120
- };
121
- Fs2FAVerificationOTPComponent.prototype.codeCompleted = function () {
122
- this.form.triggerSubmit();
123
- };
124
- return Fs2FAVerificationOTPComponent;
125
- }());
126
- Fs2FAVerificationOTPComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: Fs2FAVerificationOTPComponent, deps: [{ token: i8__namespace.FsFormDirective }], target: i0__namespace.ɵɵFactoryTarget.Component });
127
- Fs2FAVerificationOTPComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: Fs2FAVerificationOTPComponent, selector: "fs-2fa-verification-otp", outputs: { codeChange: "codeChange" }, ngImport: i0__namespace, template: "<p class=\"description\">\n Enter the verification code generated by your 2 factor authenticator\n app to verify it's you\n</p>\n\n<!--\n<code-input [initialFocusField]=\"0\"\n [codeLength]=\"6\"\n (codeChanged)=\"codeChanged($event)\"\n (codeCompleted)=\"codeCompleted()\">>\n</code-input>\n-->\n", styles: [":host{display:block}code-input{--item-spacing: 10px;--item-height: 20px;--item-border: none;--item-border-bottom: 2px solid #949494;--item-border-has-value: none;--item-border-bottom-has-value: 2px solid #949494;--item-border-focused: none;--item-border-bottom-focused: 2px solid #0061AF;--item-shadow-focused: none;--item-border-radius: 0px}code-input ::ng-deep span:first-child{padding-left:0!important}code-input ::ng-deep span:last-child{padding-right:0!important}code-input ::ng-deep input{font-size:20px!important;height:40px!important;padding:0!important}\n"], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
128
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: Fs2FAVerificationOTPComponent, decorators: [{
129
- type: i0.Component,
130
- args: [{
131
- selector: 'fs-2fa-verification-otp',
132
- templateUrl: './2fa-verification-otp.component.html',
133
- styleUrls: [
134
- './2fa-verification-otp.component.scss'
135
- ],
136
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
137
- }]
138
- }], ctorParameters: function () { return [{ type: i8__namespace.FsFormDirective }]; }, propDecorators: { codeChange: [{
139
- type: i0.Output
140
- }] } });
141
-
142
- var Fs2FAVerificationSMSComponent = /** @class */ (function () {
143
- function Fs2FAVerificationSMSComponent() {
144
- this.codeChange = new i0.EventEmitter();
145
- }
146
- Fs2FAVerificationSMSComponent.prototype.codeChanged = function () {
147
- this.codeChange.emit(this.code);
148
- };
149
- return Fs2FAVerificationSMSComponent;
150
- }());
151
- Fs2FAVerificationSMSComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: Fs2FAVerificationSMSComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
152
- Fs2FAVerificationSMSComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: Fs2FAVerificationSMSComponent, selector: "fs-2fa-verification-code", inputs: { method: "method" }, outputs: { codeChange: "codeChange" }, ngImport: i0__namespace, template: "<p class=\"description\">\n <ng-container *ngIf=\"method.phoneNumber && method.type === 'sms'\">\n A text message with a verification code was just\n sent to <span style=\"white-space: nowrap;\">{{ method.phoneNumber }}</span> to verify it's you.\n </ng-container>\n\n <ng-container *ngIf=\"method.type === 'email'\">\n A email with a verification code was just sent to {{ method.email }} to verify it's you.\n </ng-container>\n\n <ng-container *ngIf=\"false\">\n Enter the one time code generated by the app administrator to verify it's you.\n </ng-container>\n</p>\n\n<mat-form-field>\n <mat-label>Code</mat-label>\n <input type=\"text\"\n matInput\n name=\"code\"\n autocomplete=\"one-time-code\"\n [(ngModel)]=\"code\"\n (ngModelChange)=\"codeChanged()\"\n required\n placeholder=\"Enter the code\"\n inputmode=\"numeric\">\n</mat-form-field>\n", styles: [":host{display:block}mat-form-field{width:100%}\n"], components: [{ type: i1__namespace$2.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }], directives: [{ type: i10__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1__namespace$2.MatLabel, selector: "mat-label" }, { type: i3__namespace$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["id", "disabled", "required", "type", "value", "readonly", "placeholder", "errorStateMatcher", "aria-describedby"], exportAs: ["matInput"] }, { type: i7__namespace.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i7__namespace.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i7__namespace.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i7__namespace.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i8__namespace.ɵf, selector: "[fsFormRequired],[ngModel][required]", inputs: ["fsFormRequired", "required", "fsFormRequiredMessage"] }], viewProviders: [
153
- {
154
- provide: i7.ControlContainer,
155
- useExisting: i7.NgForm,
156
- },
157
- ], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
158
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: Fs2FAVerificationSMSComponent, decorators: [{
159
- type: i0.Component,
160
- args: [{
161
- selector: 'fs-2fa-verification-code',
162
- templateUrl: './2fa-verification-code.component.html',
163
- styleUrls: [
164
- './2fa-verification-code.component.scss',
165
- ],
166
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
167
- viewProviders: [
168
- {
169
- provide: i7.ControlContainer,
170
- useExisting: i7.NgForm,
171
- },
172
- ],
173
- }]
174
- }], propDecorators: { method: [{
175
- type: i0.Input
176
- }], codeChange: [{
177
- type: i0.Output
110
+ var Fs2FAVerificationCodeComponent = /** @class */ (function () {
111
+ function Fs2FAVerificationCodeComponent() {
112
+ this.codeChange = new i0.EventEmitter();
113
+ this.codeComplete = new i0.EventEmitter();
114
+ this.FsVerificationMethodType = exports.FsVerificationMethodType;
115
+ }
116
+ Fs2FAVerificationCodeComponent.prototype.codeChanged = function (code) {
117
+ this.code = code;
118
+ this.codeChange.emit(this.code);
119
+ };
120
+ Fs2FAVerificationCodeComponent.prototype.codeCompleted = function () {
121
+ this.codeComplete.emit();
122
+ };
123
+ Fs2FAVerificationCodeComponent.prototype.focus = function () {
124
+ this.codeInputComponent.focusOnField(0);
125
+ };
126
+ return Fs2FAVerificationCodeComponent;
127
+ }());
128
+ Fs2FAVerificationCodeComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: Fs2FAVerificationCodeComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
129
+ Fs2FAVerificationCodeComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: Fs2FAVerificationCodeComponent, selector: "fs-2fa-verification-code", inputs: { method: "method", code: "code" }, outputs: { codeChange: "codeChange", codeComplete: "codeComplete" }, viewQueries: [{ propertyName: "codeInputComponent", first: true, predicate: i1$2.CodeInputComponent, descendants: true }], ngImport: i0__namespace, template: "<ng-container *ngIf=\"method.phoneNumber && method.type === FsVerificationMethodType.Sms\">\n <p class=\"description\">\n A text message with a verification code was just\n sent to <span style=\"white-space: nowrap;\">{{ method.phoneNumber }}</span> to verify it's you.\n </p>\n\n <ng-container *ngTemplateOutlet=\"input\"></ng-container>\n</ng-container>\n\n<ng-container *ngIf=\"method.type === FsVerificationMethodType.Email\">\n <p class=\"description\">\n A email with a verification code was just sent to {{ method.email }} to verify it's you.\n </p>\n <ng-container *ngTemplateOutlet=\"input\"></ng-container>\n</ng-container>\n\n<ng-container *ngIf=\"method.type === FsVerificationMethodType.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\n<ng-template #input> \n <code-input \n [code]=\"code\"\n [initialFocusField]=\"0\"\n [codeLength]=\"6\"\n (codeChanged)=\"codeChanged($event)\"\n (codeCompleted)=\"codeCompleted()\">\n </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}code-input{margin-bottom:15px;--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__namespace$2.CodeInputComponent, selector: "code-input", inputs: ["isNonDigitsCode", "codeLength", "inputType", "initialFocusField", "isCharsCode", "isCodeHidden", "isPrevFocusableAfterClearing", "isFocusingOnLastByClickIfFilled", "code", "disabled", "autocapitalize"], outputs: ["codeChanged", "codeCompleted"] }], directives: [{ type: i10__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i10__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], viewProviders: [
130
+ {
131
+ provide: i7.ControlContainer,
132
+ useExisting: i7.NgForm,
133
+ },
134
+ ], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
135
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: Fs2FAVerificationCodeComponent, decorators: [{
136
+ type: i0.Component,
137
+ args: [{
138
+ selector: 'fs-2fa-verification-code',
139
+ templateUrl: './2fa-verification-code.component.html',
140
+ styleUrls: [
141
+ './2fa-verification-code.component.scss',
142
+ ],
143
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
144
+ viewProviders: [
145
+ {
146
+ provide: i7.ControlContainer,
147
+ useExisting: i7.NgForm,
148
+ },
149
+ ],
150
+ }]
151
+ }], propDecorators: { codeInputComponent: [{
152
+ type: i0.ViewChild,
153
+ args: [i1$2.CodeInputComponent]
154
+ }], method: [{
155
+ type: i0.Input
156
+ }], code: [{
157
+ type: i0.Input
158
+ }], codeChange: [{
159
+ type: i0.Output
160
+ }], codeComplete: [{
161
+ type: i0.Output
178
162
  }] } });
179
163
 
180
- var Fs2FAVerificationComponent = /** @class */ (function () {
181
- function Fs2FAVerificationComponent(verificationProvider, _cdRef, _dialog) {
182
- var _this = this;
183
- this.verificationProvider = verificationProvider;
184
- this._cdRef = _cdRef;
185
- this._dialog = _dialog;
186
- this.verified = new i0.EventEmitter();
187
- this.backToSignIn = new i0.EventEmitter();
188
- this.resendInProgress = false;
189
- this.trustedDevice = false;
190
- this._destroy$ = new rxjs.Subject();
191
- this.verify = function () {
192
- return _this.verificationProvider
193
- .verify(_this._code, _this.trustedDevice)
194
- .pipe(operators.tap(function (response) {
195
- _this.verified.emit(response);
196
- }));
197
- };
198
- }
199
- Fs2FAVerificationComponent.prototype.ngOnDestroy = function () {
200
- this._destroy$.next();
201
- this._destroy$.complete();
202
- };
203
- Fs2FAVerificationComponent.prototype.codeChanged = function (code) {
204
- this._code = code;
205
- };
206
- Fs2FAVerificationComponent.prototype.resend = function () {
207
- var _this = this;
208
- this.resendInProgress = true;
209
- this.verificationProvider
210
- .resend()
211
- .pipe(operators.takeUntil(this._destroy$))
212
- .subscribe(function () {
213
- _this.resendInProgress = false;
214
- _this._cdRef.markForCheck();
215
- });
216
- };
217
- Fs2FAVerificationComponent.prototype.showVerificationMethods = function () {
218
- var _this = this;
219
- this._dialog.open(Fs2FaVerificationMethodsComponent, {
220
- data: {
221
- method: this.method,
222
- }
223
- })
224
- .afterClosed()
225
- .pipe(operators.filter(function (method) { return !!method; }))
226
- .subscribe(function (method) {
227
- _this.method = method;
228
- _this._cdRef.markForCheck();
229
- });
230
- };
231
- Fs2FAVerificationComponent.prototype.toSignIn = function () {
232
- this.backToSignIn.emit();
233
- };
234
- return Fs2FAVerificationComponent;
235
- }());
236
- Fs2FAVerificationComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: Fs2FAVerificationComponent, deps: [{ token: FS_2FA_VERIFICATION_PROVIDER }, { token: i0__namespace.ChangeDetectorRef }, { token: i1__namespace$1.FsDialog }], target: i0__namespace.ɵɵFactoryTarget.Component });
237
- Fs2FAVerificationComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: Fs2FAVerificationComponent, selector: "fs-2fa-verification", inputs: { method: "method" }, outputs: { verified: "verified", backToSignIn: "backToSignIn" }, ngImport: i0__namespace, template: "<form fsForm [submit]=\"verify\" [dirtySubmitButton]=\"false\">\n <h2>2-Step Verification</h2>\n\n <div class=\"code-container\">\n <ng-container *ngIf=\"method.type === 'authenticator' else code\">\n <fs-2fa-verification-otp class=\"otp\"></fs-2fa-verification-otp>\n </ng-container>\n\n <ng-template #code>\n <fs-2fa-verification-code\n [method]=\"method\"\n (codeChange)=\"codeChanged($event)\">\n </fs-2fa-verification-code>\n </ng-template>\n </div>\n\n <div class=\"additional\">\n <mat-checkbox\n name=\"trust-device\"\n [(ngModel)]=\"trustedDevice\">\n Trust this device\n </mat-checkbox>\n\n <span matSuffix>\n <a mat-button\n type=\"button\"\n color=\"primary\"\n (click)=\"resend()\"\n [disabled]=\"resendInProgress\"\n class=\"resend-code-btn\">\n <ng-container *ngIf=\"!resendInProgress else sending\">\n Resend Code\n </ng-container>\n <ng-template #sending>\n <mat-spinner [diameter]=\"12\"></mat-spinner> Sending\n </ng-template>\n </a>\n </span>\n </div>\n\n <div class=\"actions\">\n <button mat-raised-button\n color=\"primary\"\n type=\"submit\">\n Verify\n </button>\n\n <button mat-button type=\"button\" (click)=\"showVerificationMethods()\">\n Try other ways to verify\n </button>\n\n <button mat-button type=\"button\" (click)=\"toSignIn()\">\n Back to signin\n </button>\n </div>\n</form>\n", styles: [":host{display:block}h2,.code-container{text-align:center}.code-container .otp{margin-bottom:15px}:host ::ng-deep .actions{margin:10px 0}:host ::ng-deep .actions a{width:100%;font-weight:400}:host ::ng-deep .actions button{width:100%;margin-bottom:5px}:host ::ng-deep .actions button[type=button]{font-weight:400}.additional{display:flex;justify-content:space-between;align-items:baseline;margin-top:-5px}.additional .resend-code-btn{text-transform:none}.additional .resend-code-btn mat-spinner{display:inline-block;vertical-align:middle}\n"], components: [{ type: Fs2FAVerificationOTPComponent, selector: "fs-2fa-verification-otp", outputs: ["codeChange"] }, { type: Fs2FAVerificationSMSComponent, selector: "fs-2fa-verification-code", inputs: ["method"], outputs: ["codeChange"] }, { type: i4__namespace$1.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex", "aria-label", "aria-labelledby", "id", "labelPosition", "name", "required", "checked", "disabled", "indeterminate", "aria-describedby", "value"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { type: i5__namespace$1.MatAnchor, selector: "a[mat-button], a[mat-raised-button], a[mat-icon-button], a[mat-fab], a[mat-mini-fab], a[mat-stroked-button], a[mat-flat-button]", inputs: ["disabled", "disableRipple", "color", "tabIndex"], exportAs: ["matButton", "matAnchor"] }, { type: i6__namespace.MatSpinner, selector: "mat-spinner", inputs: ["color"] }, { type: i5__namespace$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i7__namespace.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i7__namespace.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i7__namespace.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i8__namespace.FsFormDirective, selector: "[fsForm]", inputs: ["wrapperSelector", "messageSelector", "hintSelector", "labelSelector", "autocomplete", "shortcuts", "confirm", "confirmDialog", "confirmDrawer", "confirmBrowser", "confirmTabs", "dirtySubmitButton", "successDelay", "errorDelay", "submit", "tabGroup"], outputs: ["fsForm", "invalid", "valid", "submitted", "reseted", "cleared"] }, { type: i10__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7__namespace.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i7__namespace.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i1__namespace$2.MatSuffix, selector: "[matSuffix]" }, { type: i8__namespace.ɵw, selector: "button[type=\"submit\"]", inputs: ["dirtySubmit", "name"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
238
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: Fs2FAVerificationComponent, decorators: [{
239
- type: i0.Component,
240
- args: [{
241
- selector: 'fs-2fa-verification',
242
- templateUrl: './2fa-verification.component.html',
243
- styleUrls: [
244
- './2fa-verification.component.scss',
245
- ],
246
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
247
- }]
248
- }], ctorParameters: function () {
249
- return [{ type: undefined, decorators: [{
250
- type: i0.Inject,
251
- args: [FS_2FA_VERIFICATION_PROVIDER]
252
- }] }, { type: i0__namespace.ChangeDetectorRef }, { type: i1__namespace$1.FsDialog }];
253
- }, propDecorators: { method: [{
254
- type: i0.Input
255
- }], verified: [{
256
- type: i0.Output
257
- }], backToSignIn: [{
258
- type: i0.Output
164
+ var Fs2FAVerificationComponent = /** @class */ (function () {
165
+ function Fs2FAVerificationComponent(verificationProvider, _cdRef, _dialog, _form) {
166
+ var _this = this;
167
+ this.verificationProvider = verificationProvider;
168
+ this._cdRef = _cdRef;
169
+ this._dialog = _dialog;
170
+ this._form = _form;
171
+ this.verified = new i0.EventEmitter();
172
+ this.resendInProgress = false;
173
+ this.code = '';
174
+ this.trustedDevice = true;
175
+ this.FsVerificationMethodType = exports.FsVerificationMethodType;
176
+ this._destroy$ = new rxjs.Subject();
177
+ this.verify = function () {
178
+ return _this.verificationProvider
179
+ .verify(_this.code, _this.trustedDevice)
180
+ .pipe(operators.tap(function (response) {
181
+ _this.verified.emit(response);
182
+ }));
183
+ };
184
+ }
185
+ Fs2FAVerificationComponent.prototype.ngOnDestroy = function () {
186
+ this._destroy$.next();
187
+ this._destroy$.complete();
188
+ };
189
+ Fs2FAVerificationComponent.prototype.ngAfterViewInit = function () {
190
+ this.verificationCodeComponent.focus();
191
+ };
192
+ Fs2FAVerificationComponent.prototype.codeChange = function (code) {
193
+ this.code = code;
194
+ };
195
+ Fs2FAVerificationComponent.prototype.codeComplete = function () {
196
+ if (this._form) {
197
+ this._form.ngSubmit.next();
198
+ }
199
+ };
200
+ Fs2FAVerificationComponent.prototype.resend = function () {
201
+ var _this = this;
202
+ this.resendInProgress = true;
203
+ this.code = '';
204
+ this.verificationProvider
205
+ .resend()
206
+ .pipe(operators.takeUntil(this._destroy$))
207
+ .subscribe(function () {
208
+ _this.resendInProgress = false;
209
+ _this._cdRef.markForCheck();
210
+ });
211
+ };
212
+ Fs2FAVerificationComponent.prototype.showVerificationMethods = function () {
213
+ var _this = this;
214
+ this._dialog.open(Fs2FaVerificationMethodsComponent, {
215
+ data: {
216
+ method: this.method,
217
+ }
218
+ })
219
+ .afterClosed()
220
+ .pipe(operators.filter(function (method) { return !!method; }))
221
+ .subscribe(function (method) {
222
+ _this.method = method;
223
+ _this.code = '';
224
+ _this._cdRef.markForCheck();
225
+ setTimeout(function () {
226
+ _this.verificationCodeComponent.focus();
227
+ });
228
+ });
229
+ };
230
+ return Fs2FAVerificationComponent;
231
+ }());
232
+ Fs2FAVerificationComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: Fs2FAVerificationComponent, deps: [{ token: FS_2FA_VERIFICATION_PROVIDER }, { token: i0__namespace.ChangeDetectorRef }, { token: i1__namespace$1.FsDialog }, { token: i7__namespace.NgForm, optional: true }], target: i0__namespace.ɵɵFactoryTarget.Component });
233
+ Fs2FAVerificationComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: Fs2FAVerificationComponent, selector: "fs-2fa-verification", inputs: { method: "method" }, outputs: { verified: "verified" }, viewQueries: [{ propertyName: "verificationCodeComponent", first: true, predicate: Fs2FAVerificationCodeComponent, descendants: true }], ngImport: i0__namespace, template: "<div class=\"code-container\">\n <fs-2fa-verification-code\n [method]=\"method\"\n [code]=\"code\"\n (codeChange)=\"codeChange($event)\"\n (codeComplete)=\"codeComplete()\">\n </fs-2fa-verification-code>\n</div>\n\n<div class=\"additional\">\n <mat-checkbox\n name=\"trust-device\"\n [(ngModel)]=\"trustedDevice\">\n Trust this device\n </mat-checkbox>\n\n <span class=\"resend-code-btn\">\n <ng-container *ngIf=\"!resendInProgress else sending\">\n <a (click)=\"resend()\">\n Resend Code\n </a>\n </ng-container>\n <ng-template #sending>\n <mat-spinner [diameter]=\"12\"></mat-spinner> Sending\n </ng-template>\n </span>\n</div>", styles: [".code-container{text-align:center}.code-container .otp{margin-bottom:15px}.additional{display:flex;justify-content:space-between;align-items:baseline;margin-top:-5px}.additional .resend-code-btn{cursor:pointer;text-transform:none}.additional .resend-code-btn mat-spinner{display:inline-block;vertical-align:middle}\n"], components: [{ type: Fs2FAVerificationCodeComponent, selector: "fs-2fa-verification-code", inputs: ["method", "code"], outputs: ["codeChange", "codeComplete"] }, { type: i4__namespace$1.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex", "aria-label", "aria-labelledby", "id", "labelPosition", "name", "required", "checked", "disabled", "indeterminate", "aria-describedby", "value"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { type: i5__namespace$1.MatSpinner, selector: "mat-spinner", inputs: ["color"] }], directives: [{ type: i7__namespace.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i7__namespace.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i10__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
234
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: Fs2FAVerificationComponent, decorators: [{
235
+ type: i0.Component,
236
+ args: [{
237
+ selector: 'fs-2fa-verification',
238
+ templateUrl: './2fa-verification.component.html',
239
+ styleUrls: [
240
+ './2fa-verification.component.scss',
241
+ ],
242
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
243
+ }]
244
+ }], ctorParameters: function () {
245
+ return [{ type: undefined, decorators: [{
246
+ type: i0.Inject,
247
+ args: [FS_2FA_VERIFICATION_PROVIDER]
248
+ }] }, { type: i0__namespace.ChangeDetectorRef }, { type: i1__namespace$1.FsDialog }, { type: i7__namespace.NgForm, decorators: [{
249
+ type: i0.Optional
250
+ }] }];
251
+ }, propDecorators: { verificationCodeComponent: [{
252
+ type: i0.ViewChild,
253
+ args: [Fs2FAVerificationCodeComponent]
254
+ }], method: [{
255
+ type: i0.Input
256
+ }], verified: [{
257
+ type: i0.Output
259
258
  }] } });
260
259
 
261
- var Fs2FaModule = /** @class */ (function () {
262
- function Fs2FaModule() {
263
- }
264
- return Fs2FaModule;
265
- }());
266
- Fs2FaModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: Fs2FaModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
267
- Fs2FaModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: Fs2FaModule, declarations: [Fs2FAVerificationComponent,
268
- Fs2FAVerificationSMSComponent,
269
- Fs2FAVerificationOTPComponent,
270
- Fs2FaVerificationMethodsComponent], imports: [i10.CommonModule,
271
- i7.FormsModule,
272
- i1$2.MatFormFieldModule,
273
- i3$1.MatInputModule,
274
- i5$1.MatButtonModule,
275
- i8.FsFormModule,
276
- i3.FsRadioGroupModule,
277
- i1$1.FsDialogModule,
278
- // CodeInputModule,
279
- i4$1.MatCheckboxModule,
280
- i6.MatProgressSpinnerModule,
281
- i9.FsSkeletonModule,
282
- i9.FsSkeletonModule,
283
- i4.MatIconModule,
284
- i5.MatRadioModule], exports: [Fs2FAVerificationComponent] });
285
- Fs2FaModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: Fs2FaModule, providers: [], imports: [[
286
- i10.CommonModule,
287
- i7.FormsModule,
288
- i1$2.MatFormFieldModule,
289
- i3$1.MatInputModule,
290
- i5$1.MatButtonModule,
291
- i8.FsFormModule,
292
- i3.FsRadioGroupModule,
293
- i1$1.FsDialogModule,
294
- // CodeInputModule,
295
- i4$1.MatCheckboxModule,
296
- i6.MatProgressSpinnerModule,
297
- i9.FsSkeletonModule,
298
- i9.FsSkeletonModule,
299
- i4.MatIconModule,
300
- i5.MatRadioModule,
301
- ]] });
302
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: Fs2FaModule, decorators: [{
303
- type: i0.NgModule,
304
- args: [{
305
- imports: [
306
- i10.CommonModule,
307
- i7.FormsModule,
308
- i1$2.MatFormFieldModule,
309
- i3$1.MatInputModule,
310
- i5$1.MatButtonModule,
311
- i8.FsFormModule,
312
- i3.FsRadioGroupModule,
313
- i1$1.FsDialogModule,
314
- // CodeInputModule,
315
- i4$1.MatCheckboxModule,
316
- i6.MatProgressSpinnerModule,
317
- i9.FsSkeletonModule,
318
- i9.FsSkeletonModule,
319
- i4.MatIconModule,
320
- i5.MatRadioModule,
321
- ],
322
- declarations: [
323
- Fs2FAVerificationComponent,
324
- Fs2FAVerificationSMSComponent,
325
- Fs2FAVerificationOTPComponent,
326
- Fs2FaVerificationMethodsComponent,
327
- ],
328
- exports: [
329
- Fs2FAVerificationComponent,
330
- ],
331
- providers: [],
332
- }]
260
+ var Fs2FaModule = /** @class */ (function () {
261
+ function Fs2FaModule() {
262
+ }
263
+ return Fs2FaModule;
264
+ }());
265
+ Fs2FaModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: Fs2FaModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
266
+ Fs2FaModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: Fs2FaModule, declarations: [Fs2FAVerificationComponent,
267
+ Fs2FAVerificationCodeComponent,
268
+ Fs2FaVerificationMethodsComponent], imports: [i10.CommonModule,
269
+ i7.FormsModule,
270
+ formField.MatFormFieldModule,
271
+ input.MatInputModule,
272
+ i6.MatButtonModule,
273
+ i8.FsFormModule,
274
+ i3.FsRadioGroupModule,
275
+ i1$1.FsDialogModule,
276
+ i1$2.CodeInputModule,
277
+ i4$1.MatCheckboxModule,
278
+ i5$1.MatProgressSpinnerModule,
279
+ i9.FsSkeletonModule,
280
+ i9.FsSkeletonModule,
281
+ i4.MatIconModule,
282
+ i5.MatRadioModule], exports: [Fs2FAVerificationComponent] });
283
+ Fs2FaModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: Fs2FaModule, providers: [], imports: [[
284
+ i10.CommonModule,
285
+ i7.FormsModule,
286
+ formField.MatFormFieldModule,
287
+ input.MatInputModule,
288
+ i6.MatButtonModule,
289
+ i8.FsFormModule,
290
+ i3.FsRadioGroupModule,
291
+ i1$1.FsDialogModule,
292
+ i1$2.CodeInputModule,
293
+ i4$1.MatCheckboxModule,
294
+ i5$1.MatProgressSpinnerModule,
295
+ i9.FsSkeletonModule,
296
+ i9.FsSkeletonModule,
297
+ i4.MatIconModule,
298
+ i5.MatRadioModule,
299
+ ]] });
300
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: Fs2FaModule, decorators: [{
301
+ type: i0.NgModule,
302
+ args: [{
303
+ imports: [
304
+ i10.CommonModule,
305
+ i7.FormsModule,
306
+ formField.MatFormFieldModule,
307
+ input.MatInputModule,
308
+ i6.MatButtonModule,
309
+ i8.FsFormModule,
310
+ i3.FsRadioGroupModule,
311
+ i1$1.FsDialogModule,
312
+ i1$2.CodeInputModule,
313
+ i4$1.MatCheckboxModule,
314
+ i5$1.MatProgressSpinnerModule,
315
+ i9.FsSkeletonModule,
316
+ i9.FsSkeletonModule,
317
+ i4.MatIconModule,
318
+ i5.MatRadioModule,
319
+ ],
320
+ declarations: [
321
+ Fs2FAVerificationComponent,
322
+ Fs2FAVerificationCodeComponent,
323
+ Fs2FaVerificationMethodsComponent,
324
+ ],
325
+ exports: [
326
+ Fs2FAVerificationComponent,
327
+ ],
328
+ providers: [],
329
+ }]
333
330
  }] });
334
331
 
335
- /*
336
- * Public API Surface of fs-2fa
332
+ /*
333
+ * Public API Surface of fs-2fa
337
334
  */
338
335
 
339
- /**
340
- * Generated bundle index. Do not edit.
336
+ /**
337
+ * Generated bundle index. Do not edit.
341
338
  */
342
339
 
343
340
  exports.FS_2FA_VERIFICATION_PROVIDER = FS_2FA_VERIFICATION_PROVIDER;