@aws-amplify/ui-angular 3.2.19 → 4.0.1

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 (107) hide show
  1. package/{esm2015/lib/components/authenticator/authenticator.module.js → esm2020/lib/components/authenticator/authenticator.module.mjs} +5 -5
  2. package/esm2020/lib/components/authenticator/components/authenticator/authenticator.component.mjs +176 -0
  3. package/esm2020/lib/components/authenticator/components/base-form-fields/base-form-fields.component.mjs +32 -0
  4. package/esm2020/lib/components/authenticator/components/confirm-reset-password/amplify-confirm-reset-password.component.mjs +45 -0
  5. package/esm2020/lib/components/authenticator/components/confirm-sign-in/confirm-sign-in.component.mjs +49 -0
  6. package/esm2020/lib/components/authenticator/components/confirm-sign-up/confirm-sign-up.component.mjs +49 -0
  7. package/esm2020/lib/components/authenticator/components/confirm-verify-user/amplify-confirm-verify-user.component.mjs +44 -0
  8. package/esm2020/lib/components/authenticator/components/federated-sign-in/federated-sign-in.component.mjs +47 -0
  9. package/esm2020/lib/components/authenticator/components/federated-sign-in-button/federated-sign-in-button.component.mjs +26 -0
  10. package/esm2020/lib/components/authenticator/components/force-new-password/force-new-password-form-fields/force-new-password-form-fields.component.mjs +12 -0
  11. package/esm2020/lib/components/authenticator/components/force-new-password/force-new-password.component.mjs +44 -0
  12. package/esm2020/lib/components/authenticator/components/form-field/form-field.component.mjs +50 -0
  13. package/esm2020/lib/components/authenticator/components/reset-password/reset-password.component.mjs +44 -0
  14. package/esm2020/lib/components/authenticator/components/setup-totp/setup-totp.component.mjs +69 -0
  15. package/esm2020/lib/components/authenticator/components/sign-in/sign-in.component.mjs +41 -0
  16. package/esm2020/lib/components/authenticator/components/sign-up/sign-up-form-fields/sign-up-form-fields.component.mjs +12 -0
  17. package/esm2020/lib/components/authenticator/components/sign-up/sign-up.component.mjs +44 -0
  18. package/esm2020/lib/components/authenticator/components/verify-user/verify-user.component.mjs +56 -0
  19. package/{esm2015/lib/primitives/button/button.component.js → esm2020/lib/primitives/button/button.component.mjs} +5 -8
  20. package/esm2020/lib/primitives/checkbox/checkbox.component.mjs +37 -0
  21. package/esm2020/lib/primitives/error/error.component.mjs +21 -0
  22. package/esm2020/lib/primitives/password-field/password-field.component.mjs +64 -0
  23. package/esm2020/lib/primitives/phone-number-field/phone-number-field.component.mjs +62 -0
  24. package/esm2020/lib/primitives/select/select.component.mjs +22 -0
  25. package/esm2020/lib/primitives/tab-item/tab-item.component.mjs +29 -0
  26. package/{esm2015/lib/primitives/tabs/tabs.component.js → esm2020/lib/primitives/tabs/tabs.component.mjs} +5 -8
  27. package/esm2020/lib/primitives/text-field/text-field.component.mjs +50 -0
  28. package/esm2020/lib/services/authenticator.service.mjs +177 -0
  29. package/esm2020/lib/services/custom-components.service.mjs +25 -0
  30. package/esm2020/lib/utilities/amplify-slot/amplify-slot.component.mjs +33 -0
  31. package/{esm2015/lib/utilities/amplify-slot/amplify-slot.directive.js → esm2020/lib/utilities/amplify-slot/amplify-slot.directive.mjs} +4 -4
  32. package/{esm2015/version.js → esm2020/version.mjs} +2 -2
  33. package/fesm2015/aws-amplify-ui-angular.mjs +1432 -0
  34. package/fesm2015/aws-amplify-ui-angular.mjs.map +1 -0
  35. package/fesm2020/aws-amplify-ui-angular.mjs +1416 -0
  36. package/fesm2020/aws-amplify-ui-angular.mjs.map +1 -0
  37. package/lib/components/authenticator/components/authenticator/authenticator.component.d.ts +1 -1
  38. package/lib/components/authenticator/components/base-form-fields/base-form-fields.component.d.ts +1 -1
  39. package/lib/components/authenticator/components/confirm-reset-password/amplify-confirm-reset-password.component.d.ts +1 -1
  40. package/lib/components/authenticator/components/confirm-sign-in/confirm-sign-in.component.d.ts +1 -1
  41. package/lib/components/authenticator/components/confirm-sign-up/confirm-sign-up.component.d.ts +1 -1
  42. package/lib/components/authenticator/components/confirm-verify-user/amplify-confirm-verify-user.component.d.ts +1 -1
  43. package/lib/components/authenticator/components/federated-sign-in/federated-sign-in.component.d.ts +1 -1
  44. package/lib/components/authenticator/components/federated-sign-in-button/federated-sign-in-button.component.d.ts +1 -1
  45. package/lib/components/authenticator/components/force-new-password/force-new-password-form-fields/force-new-password-form-fields.component.d.ts +1 -1
  46. package/lib/components/authenticator/components/force-new-password/force-new-password.component.d.ts +1 -1
  47. package/lib/components/authenticator/components/form-field/form-field.component.d.ts +1 -1
  48. package/lib/components/authenticator/components/reset-password/reset-password.component.d.ts +1 -1
  49. package/lib/components/authenticator/components/setup-totp/setup-totp.component.d.ts +1 -1
  50. package/lib/components/authenticator/components/sign-in/sign-in.component.d.ts +1 -1
  51. package/lib/components/authenticator/components/sign-up/sign-up-form-fields/sign-up-form-fields.component.d.ts +1 -1
  52. package/lib/components/authenticator/components/sign-up/sign-up.component.d.ts +1 -1
  53. package/lib/components/authenticator/components/verify-user/verify-user.component.d.ts +1 -1
  54. package/lib/primitives/button/button.component.d.ts +1 -1
  55. package/lib/primitives/checkbox/checkbox.component.d.ts +1 -1
  56. package/lib/primitives/error/error.component.d.ts +1 -1
  57. package/lib/primitives/password-field/password-field.component.d.ts +1 -1
  58. package/lib/primitives/phone-number-field/phone-number-field.component.d.ts +1 -1
  59. package/lib/primitives/select/select.component.d.ts +1 -1
  60. package/lib/primitives/tab-item/tab-item.component.d.ts +1 -1
  61. package/lib/primitives/tabs/tabs.component.d.ts +1 -1
  62. package/lib/primitives/text-field/text-field.component.d.ts +1 -1
  63. package/lib/utilities/amplify-slot/amplify-slot.component.d.ts +1 -1
  64. package/lib/utilities/amplify-slot/amplify-slot.directive.d.ts +1 -1
  65. package/package.json +22 -8
  66. package/version.d.ts +1 -1
  67. package/aws-amplify-ui-angular.d.ts +0 -5
  68. package/bundles/aws-amplify-ui-angular.umd.js +0 -2217
  69. package/bundles/aws-amplify-ui-angular.umd.js.map +0 -1
  70. package/esm2015/lib/components/authenticator/components/authenticator/authenticator.component.js +0 -181
  71. package/esm2015/lib/components/authenticator/components/base-form-fields/base-form-fields.component.js +0 -35
  72. package/esm2015/lib/components/authenticator/components/confirm-reset-password/amplify-confirm-reset-password.component.js +0 -48
  73. package/esm2015/lib/components/authenticator/components/confirm-sign-in/confirm-sign-in.component.js +0 -52
  74. package/esm2015/lib/components/authenticator/components/confirm-sign-up/confirm-sign-up.component.js +0 -52
  75. package/esm2015/lib/components/authenticator/components/confirm-verify-user/amplify-confirm-verify-user.component.js +0 -47
  76. package/esm2015/lib/components/authenticator/components/federated-sign-in/federated-sign-in.component.js +0 -51
  77. package/esm2015/lib/components/authenticator/components/federated-sign-in-button/federated-sign-in-button.component.js +0 -29
  78. package/esm2015/lib/components/authenticator/components/force-new-password/force-new-password-form-fields/force-new-password-form-fields.component.js +0 -15
  79. package/esm2015/lib/components/authenticator/components/force-new-password/force-new-password.component.js +0 -47
  80. package/esm2015/lib/components/authenticator/components/form-field/form-field.component.js +0 -54
  81. package/esm2015/lib/components/authenticator/components/reset-password/reset-password.component.js +0 -47
  82. package/esm2015/lib/components/authenticator/components/setup-totp/setup-totp.component.js +0 -78
  83. package/esm2015/lib/components/authenticator/components/sign-in/sign-in.component.js +0 -45
  84. package/esm2015/lib/components/authenticator/components/sign-up/sign-up-form-fields/sign-up-form-fields.component.js +0 -15
  85. package/esm2015/lib/components/authenticator/components/sign-up/sign-up.component.js +0 -47
  86. package/esm2015/lib/components/authenticator/components/verify-user/verify-user.component.js +0 -60
  87. package/esm2015/lib/primitives/checkbox/checkbox.component.js +0 -40
  88. package/esm2015/lib/primitives/error/error.component.js +0 -24
  89. package/esm2015/lib/primitives/password-field/password-field.component.js +0 -67
  90. package/esm2015/lib/primitives/phone-number-field/phone-number-field.component.js +0 -66
  91. package/esm2015/lib/primitives/select/select.component.js +0 -25
  92. package/esm2015/lib/primitives/tab-item/tab-item.component.js +0 -32
  93. package/esm2015/lib/primitives/text-field/text-field.component.js +0 -53
  94. package/esm2015/lib/services/authenticator.service.js +0 -185
  95. package/esm2015/lib/services/custom-components.service.js +0 -25
  96. package/esm2015/lib/utilities/amplify-slot/amplify-slot.component.js +0 -36
  97. package/fesm2015/aws-amplify-ui-angular.js +0 -1517
  98. package/fesm2015/aws-amplify-ui-angular.js.map +0 -1
  99. /package/{esm2015/aws-amplify-ui-angular.js → esm2020/aws-amplify-ui-angular.mjs} +0 -0
  100. /package/{esm2015/index.js → esm2020/index.mjs} +0 -0
  101. /package/{esm2015/lib/common/helpers.js → esm2020/lib/common/helpers.mjs} +0 -0
  102. /package/{esm2015/lib/common/index.js → esm2020/lib/common/index.mjs} +0 -0
  103. /package/{esm2015/lib/common/types/auth-types.js → esm2020/lib/common/types/auth-types.mjs} +0 -0
  104. /package/{esm2015/lib/common/types/component-types.js → esm2020/lib/common/types/component-types.mjs} +0 -0
  105. /package/{esm2015/lib/common/types/index.js → esm2020/lib/common/types/index.mjs} +0 -0
  106. /package/{esm2015/lib/components/authenticator/components/index.js → esm2020/lib/components/authenticator/components/index.mjs} +0 -0
  107. /package/{esm2015/lib/primitives/index.js → esm2020/lib/primitives/index.mjs} +0 -0
@@ -1,1517 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { Directive, Input, Injectable, Component, HostBinding, EventEmitter, ContentChildren, Output, ViewEncapsulation, NgModule } from '@angular/core';
3
- import * as i6 from '@angular/common';
4
- import { CommonModule } from '@angular/common';
5
- import { createAuthenticatorMachine, translate, listenToAuthHub, defaultAuthHubHandler, getServiceFacade, authenticatorTextUtil, FederatedIdentityProviders, countryDialCodes, ComponentClassName, getErrors, getSortedFormFields, getFormDataFromEvent, getActorContext, getTotpCodeURL, defaultFormFieldOptions, getActorState, configureComponent } from '@aws-amplify/ui';
6
- export { translations } from '@aws-amplify/ui';
7
- import { __awaiter } from 'tslib';
8
- import { Subject } from 'rxjs';
9
- import { interpret } from 'xstate';
10
- import { Auth, Logger as Logger$1 } from 'aws-amplify';
11
- import { Logger } from '@aws-amplify/core';
12
- import { nanoid } from 'nanoid';
13
- import classnames from 'classnames';
14
- import QRCode from 'qrcode';
15
-
16
- class AmplifySlotDirective {
17
- constructor(template) {
18
- this.template = template;
19
- }
20
- set amplifySlot(component) {
21
- this.name = component;
22
- }
23
- }
24
- AmplifySlotDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AmplifySlotDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
25
- AmplifySlotDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: AmplifySlotDirective, selector: "[amplifySlot]", inputs: { amplifySlot: "amplifySlot" }, ngImport: i0 });
26
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AmplifySlotDirective, decorators: [{
27
- type: Directive,
28
- args: [{
29
- selector: '[amplifySlot]',
30
- }]
31
- }], ctorParameters: function () { return [{ type: i0.TemplateRef }]; }, propDecorators: { amplifySlot: [{
32
- type: Input
33
- }] } });
34
-
35
- /**
36
- * Stores and provides custom components that users provide with `amplify-slot`.
37
- */
38
- class CustomComponentsService {
39
- constructor() {
40
- this._customComponents = {};
41
- }
42
- get customComponents() {
43
- return this._customComponents;
44
- }
45
- set customComponents(customComponents) {
46
- this._customComponents = Object.assign(Object.assign({}, this._customComponents), customComponents);
47
- }
48
- }
49
- CustomComponentsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CustomComponentsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
50
- CustomComponentsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CustomComponentsService, providedIn: 'root' });
51
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CustomComponentsService, decorators: [{
52
- type: Injectable,
53
- args: [{
54
- providedIn: 'root',
55
- }]
56
- }] });
57
-
58
- const VERSION = '3.2.19';
59
-
60
- const logger$1 = new Logger('state-machine');
61
- /**
62
- * AuthenticatorService provides access to the authenticator state and context.
63
- */
64
- class AuthenticatorService {
65
- constructor() {
66
- this._authStatus = 'configuring';
67
- const machine = createAuthenticatorMachine();
68
- this._authService = interpret(machine).start();
69
- this.setupMachineSubscription();
70
- this.setupHubListener();
71
- this.getInitialAuthStatus();
72
- }
73
- /**
74
- * Context facades
75
- */
76
- get error() {
77
- var _a;
78
- return translate((_a = this._facade) === null || _a === void 0 ? void 0 : _a.error);
79
- }
80
- get hasValidationErrors() {
81
- var _a;
82
- return (_a = this._facade) === null || _a === void 0 ? void 0 : _a.hasValidationErrors;
83
- }
84
- get isPending() {
85
- var _a;
86
- return (_a = this._facade) === null || _a === void 0 ? void 0 : _a.isPending;
87
- }
88
- get route() {
89
- var _a;
90
- return (_a = this._facade) === null || _a === void 0 ? void 0 : _a.route;
91
- }
92
- get authStatus() {
93
- return this._authStatus;
94
- }
95
- get user() {
96
- var _a;
97
- return (_a = this._facade) === null || _a === void 0 ? void 0 : _a.user;
98
- }
99
- get validationErrors() {
100
- var _a;
101
- return (_a = this._facade) === null || _a === void 0 ? void 0 : _a.validationErrors;
102
- }
103
- get codeDeliveryDetails() {
104
- var _a;
105
- return (_a = this._facade) === null || _a === void 0 ? void 0 : _a.codeDeliveryDetails;
106
- }
107
- get totpSecretCode() {
108
- var _a;
109
- return (_a = this._facade) === null || _a === void 0 ? void 0 : _a.totpSecretCode;
110
- }
111
- /**
112
- * Service facades
113
- */
114
- get initializeMachine() {
115
- return this._facade.initializeMachine;
116
- }
117
- get updateForm() {
118
- return this._facade.updateForm;
119
- }
120
- get updateBlur() {
121
- return this._facade.updateBlur;
122
- }
123
- get resendCode() {
124
- return this._facade.resendCode;
125
- }
126
- get signOut() {
127
- return this._facade.signOut;
128
- }
129
- get submitForm() {
130
- return this._facade.submitForm;
131
- }
132
- /**
133
- * Transition facades
134
- */
135
- get toFederatedSignIn() {
136
- return this._facade.toFederatedSignIn;
137
- }
138
- get toResetPassword() {
139
- return this._facade.toResetPassword;
140
- }
141
- get toSignIn() {
142
- return this._facade.toSignIn;
143
- }
144
- get toSignUp() {
145
- return this._facade.toSignUp;
146
- }
147
- get skipVerification() {
148
- return this._facade.skipVerification;
149
- }
150
- /**
151
- * Internal utility functions
152
- */
153
- /** @deprecated For internal use only */
154
- get authState() {
155
- return this._authState;
156
- }
157
- /** @deprecated For internal use only */
158
- get authService() {
159
- return this._authService;
160
- }
161
- /** @deprecated For internal use only */
162
- get context() {
163
- return this._authState.context;
164
- }
165
- /** @deprecated For internal use only */
166
- get slotContext() {
167
- return Object.assign(Object.assign({}, this._facade), { $implicit: this._facade });
168
- }
169
- /** @deprecated For internal use only */
170
- get hubSubject() {
171
- return this._hubSubject;
172
- }
173
- subscribe(callback) {
174
- if (!this._authService) {
175
- logger$1.error('Subscription attempted before machine was created. This is likely a bug on the library, please consider filing a bug.');
176
- }
177
- const subscription = this._authService.subscribe(() => {
178
- callback(this._facade);
179
- });
180
- return subscription;
181
- }
182
- ngOnDestroy() {
183
- if (this._machineSubscription)
184
- this._machineSubscription.unsubscribe();
185
- if (this._unsubscribeHub)
186
- this._unsubscribeHub();
187
- }
188
- /** @deprecated For internal use only */
189
- send(event) {
190
- this.authService.send(event);
191
- }
192
- getInitialAuthStatus() {
193
- return __awaiter(this, void 0, void 0, function* () {
194
- try {
195
- yield Auth.currentAuthenticatedUser();
196
- this._authStatus = 'authenticated';
197
- }
198
- catch (e) {
199
- this._authStatus = 'unauthenticated';
200
- }
201
- });
202
- }
203
- setupHubListener() {
204
- this._hubSubject = new Subject();
205
- const onSignIn = () => {
206
- this._authStatus = 'authenticated';
207
- };
208
- const onSignOut = () => {
209
- this._authStatus = 'unauthenticated';
210
- };
211
- this._unsubscribeHub = listenToAuthHub(this._authService, (data, service) => __awaiter(this, void 0, void 0, function* () {
212
- yield defaultAuthHubHandler(data, service, { onSignIn, onSignOut });
213
- this._hubSubject.next();
214
- }));
215
- }
216
- setupMachineSubscription() {
217
- this._machineSubscription = this._authService.subscribe((state) => {
218
- const newState = state;
219
- this._authState = newState;
220
- this._facade = getServiceFacade({
221
- send: this._authService.send,
222
- state: newState,
223
- });
224
- });
225
- }
226
- }
227
- AuthenticatorService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AuthenticatorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
228
- AuthenticatorService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AuthenticatorService, providedIn: 'root' });
229
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AuthenticatorService, decorators: [{
230
- type: Injectable,
231
- args: [{
232
- providedIn: 'root', // ensure we have a singleton service
233
- }]
234
- }], ctorParameters: function () { return []; } });
235
-
236
- class AmplifySlotComponent {
237
- constructor(propService) {
238
- this.propService = propService;
239
- this.display = 'contents';
240
- this.isOverriden = false;
241
- }
242
- ngAfterContentInit() {
243
- const { customComponents } = this.propService;
244
- const overridingComponent = customComponents[this.name];
245
- if (overridingComponent) {
246
- this.overridingComponent = overridingComponent;
247
- this.isOverriden = true;
248
- }
249
- }
250
- }
251
- AmplifySlotComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AmplifySlotComponent, deps: [{ token: CustomComponentsService }], target: i0.ɵɵFactoryTarget.Component });
252
- AmplifySlotComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: AmplifySlotComponent, selector: "amplify-slot", inputs: { name: "name", context: "context" }, host: { properties: { "style.display": "this.display" } }, ngImport: i0, template: "<!-- \n if slot isn't overwritten, we display the the default coponent, which is the \n children passed onto this component.\n-->\n<ng-content *ngIf=\"!isOverriden\"></ng-content>\n\n<!-- If slot is overwritten, we render that instead. -->\n<ng-container\n *ngIf=\"isOverriden\"\n [ngTemplateOutlet]=\"overridingComponent\"\n [ngTemplateOutletContext]=\"context\"\n></ng-container>\n", directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }] });
253
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AmplifySlotComponent, decorators: [{
254
- type: Component,
255
- args: [{
256
- selector: 'amplify-slot',
257
- templateUrl: './amplify-slot.component.html',
258
- }]
259
- }], ctorParameters: function () { return [{ type: CustomComponentsService }]; }, propDecorators: { name: [{
260
- type: Input
261
- }], context: [{
262
- type: Input
263
- }], display: [{
264
- type: HostBinding,
265
- args: ['style.display']
266
- }] } });
267
-
268
- class TabItemComponent {
269
- constructor() {
270
- this.active = false;
271
- this.display = 'block'; // emulate div behavior
272
- }
273
- }
274
- TabItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TabItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
275
- TabItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: TabItemComponent, selector: "amplify-tab-item", inputs: { title: "title", active: "active", id: "id", labelledById: "labelledById", tabIndex: "tabIndex" }, host: { properties: { "style.display": "this.display" } }, ngImport: i0, template: "<div\n data-orientation=\"horizontal\"\n role=\"tabpanel\"\n [id]=\"id\"\n [attr.aria-labelledby]=\"labelledById\"\n [attr.data-state]=\"active ? 'active' : 'inactive'\"\n [attr.tabindex]=\"tabIndex\"\n>\n <ng-content *ngIf=\"active\"></ng-content>\n</div>\n", directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
276
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TabItemComponent, decorators: [{
277
- type: Component,
278
- args: [{
279
- selector: 'amplify-tab-item',
280
- templateUrl: './tab-item.component.html',
281
- }]
282
- }], propDecorators: { title: [{
283
- type: Input
284
- }], active: [{
285
- type: Input
286
- }], id: [{
287
- type: Input
288
- }], labelledById: [{
289
- type: Input
290
- }], tabIndex: [{
291
- type: Input
292
- }], display: [{
293
- type: HostBinding,
294
- args: ['style.display']
295
- }] } });
296
-
297
- class TabsComponent {
298
- constructor() {
299
- this.tabChange = new EventEmitter();
300
- }
301
- ngAfterContentInit() {
302
- // assign ids
303
- this.tabs.forEach((tab, index) => {
304
- tab.id = `radix-id-${nanoid(12)}-1-content-${index}`;
305
- tab.labelledById = `radix-id-${nanoid(12)}-1-trigger-${index}`;
306
- });
307
- // find active tab
308
- // TODO(enhancement): more declarative way for choosing the initial tab to render
309
- const activeTabs = this.tabs.filter((tab) => tab.active);
310
- // set active tab
311
- if (activeTabs.length !== 1) {
312
- this.selectTab(this.tabs.first);
313
- }
314
- }
315
- selectTab(tab) {
316
- this.tabs.forEach((tab) => {
317
- tab.active = false;
318
- });
319
- tab.active = true;
320
- }
321
- handleTabClick(tab) {
322
- if (tab.active)
323
- return; // don't do anything if clicks the current active tab
324
- this.tabChange.emit();
325
- this.selectTab(tab);
326
- }
327
- }
328
- TabsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TabsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
329
- TabsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: TabsComponent, selector: "amplify-tabs", outputs: { tabChange: "tabChange" }, queries: [{ propertyName: "tabs", predicate: TabItemComponent }], ngImport: i0, template: "<div\n tabindex=\"0\"\n aria-orientation=\"horizontal\"\n data-orientation=\"horizontal\"\n role=\"tablist\"\n style=\"outline: none\"\n>\n <div\n class=\"amplify-flex amplify-tabs\"\n data-indicator-position=\"top\"\n style=\"gap: 0px; justify-content: center\"\n >\n <div\n *ngFor=\"let tab of tabs\"\n class=\"amplify-tabs-item\"\n data-spacing=\"equal\"\n data-orientation=\"horizontal\"\n role=\"tab\"\n [id]=\"tab.labelledById\"\n [tabindex]=\"tab.active ? '0' : '1'\"\n [attr.aria-selected]=\"tab.active\"\n [attr.aria-controls]=\"tab.id\"\n [attr.data-state]=\"tab.active ? 'active' : 'inactive'\"\n (click)=\"handleTabClick(tab)\"\n >\n {{ tab.title }}\n </div>\n </div>\n</div>\n\n<ng-content></ng-content>\n", directives: [{ type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
330
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TabsComponent, decorators: [{
331
- type: Component,
332
- args: [{
333
- selector: 'amplify-tabs',
334
- templateUrl: './tabs.component.html',
335
- }]
336
- }], propDecorators: { tabs: [{
337
- type: ContentChildren,
338
- args: [TabItemComponent]
339
- }], tabChange: [{
340
- type: Output
341
- }] } });
342
-
343
- class ButtonComponent {
344
- constructor() {
345
- this.type = 'button';
346
- this.fullWidth = false;
347
- this.isDisabled = false;
348
- this.size = 'medium';
349
- this.variation = 'default';
350
- this.fontWeight = 'normal';
351
- }
352
- get getDisabled() {
353
- return this.isDisabled ? '' : null;
354
- }
355
- get classNames() {
356
- let className = 'amplify-button';
357
- if (this.variation) {
358
- className += ` amplify-button--${this.variation}`;
359
- }
360
- if (this.size) {
361
- className += ` amplify-button--${this.size}`;
362
- }
363
- if (this.fullWidth) {
364
- className += ` amplify-button--fullwidth`;
365
- }
366
- if (this.isDisabled) {
367
- className += ` amplify-button--disabled amplify-button--loading`;
368
- }
369
- return className;
370
- }
371
- ngOnInit() {
372
- this.typeAttr = this.type;
373
- this.fullWidthAttr = this.fullWidth;
374
- this.sizeAttr = this.size;
375
- this.variationAttr = this.variation;
376
- this.fontWeightAttr = this.fontWeight;
377
- }
378
- }
379
- ButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
380
- ButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: ButtonComponent, selector: "button[amplify-button]", inputs: { type: "type", fullWidth: "fullWidth", isDisabled: "isDisabled", size: "size", variation: "variation", fontWeight: "fontWeight" }, host: { properties: { "type": "this.typeAttr", "attr.data-fullwidth": "this.fullWidthAttr", "attr.data-size": "this.sizeAttr", "attr.data-variation": "this.variationAttr", "style.font-weight": "this.fontWeightAttr", "attr.disabled": "this.getDisabled", "class": "this.classNames" } }, ngImport: i0, template: "<ng-content></ng-content>\n" });
381
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ButtonComponent, decorators: [{
382
- type: Component,
383
- args: [{
384
- selector: 'button[amplify-button]',
385
- templateUrl: './button.component.html',
386
- }]
387
- }], propDecorators: { type: [{
388
- type: Input
389
- }], fullWidth: [{
390
- type: Input
391
- }], isDisabled: [{
392
- type: Input
393
- }], size: [{
394
- type: Input
395
- }], variation: [{
396
- type: Input
397
- }], fontWeight: [{
398
- type: Input
399
- }], typeAttr: [{
400
- type: HostBinding,
401
- args: ['type']
402
- }], fullWidthAttr: [{
403
- type: HostBinding,
404
- args: ['attr.data-fullwidth']
405
- }], sizeAttr: [{
406
- type: HostBinding,
407
- args: ['attr.data-size']
408
- }], variationAttr: [{
409
- type: HostBinding,
410
- args: ['attr.data-variation']
411
- }], fontWeightAttr: [{
412
- type: HostBinding,
413
- args: ['style.font-weight']
414
- }], getDisabled: [{
415
- type: HostBinding,
416
- args: ['attr.disabled']
417
- }], classNames: [{
418
- type: HostBinding,
419
- args: ['class']
420
- }] } });
421
-
422
- class FederatedSignInButtonComponent {
423
- constructor(authenticator) {
424
- this.authenticator = authenticator;
425
- this.onClick = () => {
426
- this.authenticator.send({
427
- type: 'FEDERATED_SIGN_IN',
428
- data: { provider: this.provider },
429
- });
430
- };
431
- }
432
- }
433
- FederatedSignInButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FederatedSignInButtonComponent, deps: [{ token: AuthenticatorService }], target: i0.ɵɵFactoryTarget.Component });
434
- FederatedSignInButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: FederatedSignInButtonComponent, selector: "amplify-federated-sign-in-button", inputs: { provider: "provider", text: "text" }, ngImport: i0, template: "<button\n amplify-button\n class=\"amplify-field-group__control federated-sign-in-button\"\n fullWidth=\"true\"\n fontWeight=\"normal\"\n (click)=\"onClick()\"\n>\n <div class=\"amplify-flex federated-sign-in-button-row\">\n <ng-content></ng-content>\n </div>\n</button>\n", components: [{ type: ButtonComponent, selector: "button[amplify-button]", inputs: ["type", "fullWidth", "isDisabled", "size", "variation", "fontWeight"] }] });
435
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FederatedSignInButtonComponent, decorators: [{
436
- type: Component,
437
- args: [{
438
- selector: 'amplify-federated-sign-in-button',
439
- templateUrl: './federated-sign-in-button.component.html',
440
- }]
441
- }], ctorParameters: function () { return [{ type: AuthenticatorService }]; }, propDecorators: { provider: [{
442
- type: Input
443
- }], text: [{
444
- type: Input
445
- }] } });
446
-
447
- const { getSignInWithFederationText, getOrText } = authenticatorTextUtil;
448
- class FederatedSignInComponent {
449
- constructor(authenticator) {
450
- this.authenticator = authenticator;
451
- this.FederatedProviders = FederatedIdentityProviders;
452
- this.includeAmazon = false;
453
- this.includeApple = false;
454
- this.includeFacebook = false;
455
- this.includeGoogle = false;
456
- this.shouldShowFederatedSignIn = false;
457
- }
458
- ngOnInit() {
459
- var _a;
460
- const { socialProviders } = (_a = this.authenticator.context) === null || _a === void 0 ? void 0 : _a.config;
461
- this.setFederatedTexts();
462
- this.includeAmazon = socialProviders === null || socialProviders === void 0 ? void 0 : socialProviders.includes('amazon');
463
- this.includeApple = socialProviders === null || socialProviders === void 0 ? void 0 : socialProviders.includes('apple');
464
- this.includeGoogle = socialProviders === null || socialProviders === void 0 ? void 0 : socialProviders.includes('google');
465
- this.includeFacebook = socialProviders === null || socialProviders === void 0 ? void 0 : socialProviders.includes('facebook');
466
- this.shouldShowFederatedSignIn =
467
- this.includeAmazon ||
468
- this.includeApple ||
469
- this.includeFacebook ||
470
- this.includeGoogle;
471
- }
472
- setFederatedTexts() {
473
- const { route } = this.authenticator;
474
- this.orText = getOrText();
475
- this.signInAmazonText = getSignInWithFederationText(route, 'amazon');
476
- this.signInAppleText = getSignInWithFederationText(route, 'apple');
477
- this.signInFacebookText = getSignInWithFederationText(route, 'facebook');
478
- this.signInGoogleText = getSignInWithFederationText(route, 'google');
479
- }
480
- }
481
- FederatedSignInComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FederatedSignInComponent, deps: [{ token: AuthenticatorService }], target: i0.ɵɵFactoryTarget.Component });
482
- FederatedSignInComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: FederatedSignInComponent, selector: "amplify-federated-sign-in", ngImport: i0, template: "<div\n class=\"amplify-flex federated-sign-in-container\"\n *ngIf=\"shouldShowFederatedSignIn\"\n data-orientation=\"horizontal\"\n data-size=\"small\"\n>\n <amplify-federated-sign-in-button\n *ngIf=\"includeAmazon\"\n [text]=\"signInAmazonText\"\n [provider]=\"FederatedProviders.Amazon\"\n >\n <svg\n aria-label=\"Amazon icon\"\n class=\"amplify-icon federated-sign-in-icon\"\n viewBox=\"0 0 248 268\"\n >\n <path\n d=\"M139.056521,147.024612 C133.548808,156.744524 124.782731,162.726926 115.087401,162.726926 C101.790721,162.726926 93.9937779,152.612964 93.9937779,137.68681 C93.9937779,108.224571 120.447551,102.879017 145.533369,102.879017 L145.533369,110.365976 C145.533369,123.831358 145.876354,135.063787 139.056521,147.024612 M207.206992,162.579655 C209.400505,165.692256 209.887066,169.437725 207.063416,171.770186 C199.996315,177.653081 187.429476,188.590967 180.513926,194.716661 L180.46208,194.621133 C178.176838,196.663031 174.862638,196.810303 172.27828,195.445057 C160.780281,185.9162 158.686473,181.494078 152.405048,172.403055 C133.405233,191.751331 119.909143,197.534719 95.309886,197.534719 C66.1281801,197.534719 43.4791563,179.599451 43.4791563,143.669212 C43.4791563,115.616003 58.6782107,96.5105248 80.4019706,87.1727225 C99.2063636,78.9096034 125.464714,77.4528107 145.533369,75.1641337 L145.533369,70.694248 C145.533369,62.4749122 146.167493,52.7510201 141.297893,45.6541312 C137.110277,39.2856386 129.018206,36.6586354 121.859376,36.6586354 C108.658413,36.6586354 96.9171331,43.4171982 94.0416364,57.4199213 C93.4593582,60.532522 91.1701278,63.5933787 88.003492,63.7406501 L54.4387473,60.1424518 C51.6150972,59.5095829 48.4484614,57.2248862 49.2740201,52.8982915 C56.9712583,12.2553679 93.7983558,0 126.732964,0 C143.587124,0 165.606011,4.47386604 178.902691,17.2148315 C195.760839,32.917146 194.149604,53.8694866 194.149604,76.6726704 L194.149604,130.542157 C194.149604,146.734049 200.87372,153.830938 207.206992,162.579655 Z M233.826346,208.038962 C230.467669,203.683255 211.550709,205.9821 203.056405,206.998432 C200.470662,207.321077 200.076227,205.042397 202.406981,203.404973 C217.475208,192.664928 242.201125,195.766353 245.081698,199.363845 C247.966255,202.981502 244.336653,228.071183 230.172839,240.049379 C228.001452,241.888455 225.929671,240.904388 226.89783,238.468418 C230.077218,230.430525 237.204944,212.418868 233.826346,208.038962 Z M126.768855,264 C74.0234043,264 42.0764048,241.955028 17.7852554,217.541992 C12.9733903,212.705982 6.71799208,206.295994 3.31151296,200.690918 C1.90227474,198.372135 5.59096074,195.021875 8.0442063,196.84375 C38.2390146,219.267578 82.1011654,239.538304 125.529506,239.538304 C154.819967,239.538304 191.046475,227.469543 220.66851,214.867659 C225.146771,212.966167 225.146771,219.180222 224.511585,221.060516 C224.183264,222.03242 209.514625,236.221149 189.247207,247.047411 C170.304273,257.166172 146.397132,264 126.768855,264 Z\"\n fill=\"#FF9900\"\n ></path>\n </svg>\n\n <p class=\"amplify-text amplify-authenticator__federated-text\">\n {{ signInAmazonText }}\n </p>\n </amplify-federated-sign-in-button>\n\n <amplify-federated-sign-in-button\n *ngIf=\"includeApple\"\n [provider]=\"FederatedProviders.Apple\"\n >\n <svg\n aria-label=\"Apple icon\"\n class=\"amplify-icon federated-sign-in-icon\"\n fill=\"#000\"\n preserveAspectRatio=\"xMidYMid\"\n stroke=\"#000\"\n strokeWidth=\"0\"\n viewBox=\"0 0 1024 1024\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M747.4 535.7c-.4-68.2 30.5-119.6 92.9-157.5-34.9-50-87.7-77.5-157.3-82.8-65.9-5.2-138 38.4-164.4 38.4-27.9 0-91.7-36.6-141.9-36.6C273.1 298.8 163 379.8 163 544.6c0 48.7 8.9 99 26.7 150.8 23.8 68.2 109.6 235.3 199.1 232.6 46.8-1.1 79.9-33.2 140.8-33.2 59.1 0 89.7 33.2 141.9 33.2 90.3-1.3 167.9-153.2 190.5-221.6-121.1-57.1-114.6-167.2-114.6-170.7zm-105.1-305c50.7-60.2 46.1-115 44.6-134.7-44.8 2.6-96.6 30.5-126.1 64.8-32.5 36.8-51.6 82.3-47.5 133.6 48.4 3.7 92.6-21.2 129-63.7z\"\n ></path>\n </svg>\n <p class=\"amplify-text amplify-authenticator__federated-text\">\n {{ signInAppleText }}\n </p>\n </amplify-federated-sign-in-button>\n\n <amplify-federated-sign-in-button\n *ngIf=\"includeFacebook\"\n [text]=\"signInFacebookText\"\n [provider]=\"FederatedProviders.Facebook\"\n >\n <svg\n aria-label=\"Facebook icon\"\n class=\"amplify-icon federated-sign-in-icon\"\n viewBox=\"0 0 279 538\"\n >\n <path\n d=\"M82.3409742,538 L82.3409742,292.936652 L0,292.936652 L0,196.990154 L82.2410458,196.990154 L82.2410458,126.4295 C82.2410458,44.575144 132.205229,0 205.252865,0 C240.227794,0 270.306232,2.59855099 279,3.79788222 L279,89.2502322 L228.536175,89.2502322 C188.964542,89.2502322 181.270057,108.139699 181.270057,135.824262 L181.270057,196.89021 L276.202006,196.89021 L263.810888,292.836708 L181.16913,292.836708 L181.16913,538 L82.3409742,538 Z\"\n fill=\"#1877F2\"\n ></path>\n </svg>\n <p class=\"amplify-text amplify-authenticator__federated-text\">\n {{ signInFacebookText }}\n </p>\n </amplify-federated-sign-in-button>\n\n <amplify-federated-sign-in-button\n *ngIf=\"includeGoogle\"\n [provider]=\"FederatedProviders.Google\"\n >\n <svg\n aria-label=\"Google icon\"\n class=\"amplify-icon federated-sign-in-icon\"\n viewBox=\"0 0 256 262\"\n xmlns=\"http://www.w3.org/2000/svg\"\n preserveAspectRatio=\"xMidYMid\"\n >\n <path\n d=\"M255.878 133.451c0-10.734-.871-18.567-2.756-26.69H130.55v48.448h71.947c-1.45 12.04-9.283 30.172-26.69 42.356l-.244 1.622 38.755 30.023 2.685.268c24.659-22.774 38.875-56.282 38.875-96.027\"\n fill=\"#4285F4\"\n ></path>\n <path\n d=\"M130.55 261.1c35.248 0 64.839-11.605 86.453-31.622l-41.196-31.913c-11.024 7.688-25.82 13.055-45.257 13.055-34.523 0-63.824-22.773-74.269-54.25l-1.531.13-40.298 31.187-.527 1.465C35.393 231.798 79.49 261.1 130.55 261.1\"\n fill=\"#34A853\"\n ></path>\n <path\n d=\"M56.281 156.37c-2.756-8.123-4.351-16.827-4.351-25.82 0-8.994 1.595-17.697 4.206-25.82l-.073-1.73L15.26 71.312l-1.335.635C5.077 89.644 0 109.517 0 130.55s5.077 40.905 13.925 58.602l42.356-32.782\"\n fill=\"#FBBC05\"\n ></path>\n <path\n d=\"M130.55 50.479c24.514 0 41.05 10.589 50.479 19.438l36.844-35.974C195.245 12.91 165.798 0 130.55 0 79.49 0 35.393 29.301 13.925 71.947l42.211 32.783c10.59-31.477 39.891-54.251 74.414-54.251\"\n fill=\"#EB4335\"\n ></path>\n </svg>\n <p class=\"amplify-text amplify-authenticator__federated-text\">\n {{ signInGoogleText }}\n </p>\n </amplify-federated-sign-in-button>\n\n <hr\n class=\"amplify-divider amplify-divider--label amplify-divider--small\"\n aria-orientation=\"horizontal\"\n data-size=\"small\"\n [attr.data-label]=\"orText\"\n />\n</div>\n", components: [{ type: FederatedSignInButtonComponent, selector: "amplify-federated-sign-in-button", inputs: ["provider", "text"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
483
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FederatedSignInComponent, decorators: [{
484
- type: Component,
485
- args: [{
486
- selector: 'amplify-federated-sign-in',
487
- templateUrl: './federated-sign-in.component.html',
488
- }]
489
- }], ctorParameters: function () { return [{ type: AuthenticatorService }]; } });
490
-
491
- class SelectComponent {
492
- }
493
- SelectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: SelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
494
- SelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: SelectComponent, selector: "amplify-form-select", inputs: { items: "items", name: "name", label: "label", id: "id", defaultValue: "defaultValue" }, ngImport: i0, template: "<label class=\"amplify-label amplify-visually-hidden\" [for]=\"id\">{{\n label\n}}</label>\n<div class=\"amplify-select__wrapper\">\n <select\n class=\"amplify-select amplify-field-group__control\"\n autocomplete=\"tel-country-code\"\n [id]=\"id\"\n [name]=\"name\"\n >\n <option\n *ngFor=\"let item of items\"\n [value]=\"item\"\n [selected]=\"item === defaultValue\"\n >\n {{ item }}\n </option>\n </select>\n <div\n class=\"amplify-flex amplify-select__icon-wrapper\"\n style=\"align-items: center; justify-content: center\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"amplify-icon amplify-icon--large\"\n viewBox=\"0 0 24 24\"\n data-size=\"large\"\n fill=\"currentColor\"\n >\n <path d=\"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z\"></path>\n </svg>\n </div>\n</div>\n", directives: [{ type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
495
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: SelectComponent, decorators: [{
496
- type: Component,
497
- args: [{
498
- selector: 'amplify-form-select',
499
- templateUrl: './select.component.html',
500
- }]
501
- }], propDecorators: { items: [{
502
- type: Input
503
- }], name: [{
504
- type: Input
505
- }], label: [{
506
- type: Input
507
- }], id: [{
508
- type: Input
509
- }], defaultValue: [{
510
- type: Input
511
- }] } });
512
-
513
- class PhoneNumberFieldComponent {
514
- constructor() {
515
- this.autocomplete = 'new-password';
516
- this.disabled = false;
517
- this.selectFieldId = `amplify-field-${nanoid(12)}`;
518
- this.textFieldId = `amplify-field-${nanoid(12)}`;
519
- this.initialValue = '';
520
- this.label = '';
521
- this.placeholder = '';
522
- this.required = true;
523
- this.labelHidden = false;
524
- this.display = 'contents';
525
- }
526
- ngOnInit() {
527
- var _a;
528
- this.countryDialCodesValues = (_a = this.dialCodeList) !== null && _a !== void 0 ? _a : countryDialCodes;
529
- }
530
- }
531
- PhoneNumberFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: PhoneNumberFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
532
- PhoneNumberFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: PhoneNumberFieldComponent, selector: "amplify-phone-number-field", inputs: { autocomplete: "autocomplete", disabled: "disabled", defaultCountryCode: "defaultCountryCode", selectFieldId: "selectFieldId", textFieldId: "textFieldId", initialValue: "initialValue", label: "label", name: "name", placeholder: "placeholder", required: "required", type: "type", labelHidden: "labelHidden", dialCodeList: "dialCodeList", hasError: "hasError", describedBy: "describedBy" }, host: { properties: { "style.display": "this.display" } }, ngImport: i0, template: "<label\n class=\"amplify-label\"\n [class.amplify-visually-hidden]=\"labelHidden\"\n [for]=\"textFieldId\"\n>\n {{ label }}\n</label>\n<div\n class=\"amplify-flex amplify-phonenumberfield\"\n amplify-field-group\n style=\"gap: 0px\"\n>\n <div class=\"amplify-field-group__outer-start\">\n <div\n class=\"\n amplify-flex\n amplify-field\n amplify-selectfield\n amplify-countrycodeselect\n amplify-dialcodeselect\n \"\n style=\"flex-direction: column\"\n >\n <amplify-form-select\n name=\"country_code\"\n label=\"Country Code\"\n [id]=\"selectFieldId\"\n [items]=\"countryDialCodesValues\"\n [defaultValue]=\"defaultCountryCode\"\n ></amplify-form-select>\n </div>\n </div>\n\n <input\n class=\"amplify-input\"\n [id]=\"textFieldId\"\n [type]=\"type\"\n [name]=\"name\"\n [placeholder]=\"placeholder\"\n [required]=\"required\"\n [value]=\"initialValue\"\n [autocomplete]=\"autocomplete\"\n [attr.disabled]=\"disabled ? '' : null\"\n [attr.aria-invalid]=\"hasError ? 'true' : 'false'\"\n [attr.aria-describedby]=\"describedBy\"\n />\n</div>\n", components: [{ type: SelectComponent, selector: "amplify-form-select", inputs: ["items", "name", "label", "id", "defaultValue"] }] });
533
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: PhoneNumberFieldComponent, decorators: [{
534
- type: Component,
535
- args: [{
536
- selector: 'amplify-phone-number-field',
537
- templateUrl: './phone-number-field.component.html',
538
- }]
539
- }], propDecorators: { autocomplete: [{
540
- type: Input
541
- }], disabled: [{
542
- type: Input
543
- }], defaultCountryCode: [{
544
- type: Input
545
- }], selectFieldId: [{
546
- type: Input
547
- }], textFieldId: [{
548
- type: Input
549
- }], initialValue: [{
550
- type: Input
551
- }], label: [{
552
- type: Input
553
- }], name: [{
554
- type: Input
555
- }], placeholder: [{
556
- type: Input
557
- }], required: [{
558
- type: Input
559
- }], type: [{
560
- type: Input
561
- }], labelHidden: [{
562
- type: Input
563
- }], dialCodeList: [{
564
- type: Input
565
- }], hasError: [{
566
- type: Input
567
- }], describedBy: [{
568
- type: Input
569
- }], display: [{
570
- type: HostBinding,
571
- args: ['style.display']
572
- }] } });
573
-
574
- class PasswordFieldComponent {
575
- constructor() {
576
- this.autocomplete = 'new-password';
577
- this.disabled = false;
578
- this.fieldId = `amplify-field-${nanoid(12)}`;
579
- this.initialValue = '';
580
- this.label = '';
581
- this.placeholder = '';
582
- this.required = true;
583
- this.labelHidden = false;
584
- this.setBlur = new EventEmitter();
585
- this.type = 'password';
586
- this.showPassword = false;
587
- this.showPasswordButtonlabel = translate('Show password');
588
- // re-export utilities so that template html can use them
589
- this.classnames = classnames;
590
- this.ComponentClassName = ComponentClassName;
591
- }
592
- togglePasswordText() {
593
- this.showPassword = !this.showPassword;
594
- this.showPasswordButtonlabel = this.showPassword
595
- ? translate('Hide password')
596
- : translate('Show password');
597
- this.type = this.showPassword ? 'text' : 'password';
598
- }
599
- }
600
- PasswordFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: PasswordFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
601
- PasswordFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: PasswordFieldComponent, selector: "amplify-password-field", inputs: { autocomplete: "autocomplete", disabled: "disabled", fieldId: "fieldId", initialValue: "initialValue", label: "label", name: "name", placeholder: "placeholder", required: "required", labelHidden: "labelHidden", hasError: "hasError", describedBy: "describedBy" }, outputs: { setBlur: "setBlur" }, ngImport: i0, template: "<div\n [class]=\"\n classnames(\n ComponentClassName.Flex,\n ComponentClassName.Field,\n ComponentClassName.TextField,\n ComponentClassName.PasswordField\n )\n \"\n>\n <label\n class=\"amplify-label\"\n [class.amplify-visually-hidden]=\"labelHidden\"\n [for]=\"fieldId\"\n >\n {{ label }}\n </label>\n <div\n [class]=\"classnames(ComponentClassName.Flex, ComponentClassName.FieldGroup)\"\n >\n <div [class]=\"ComponentClassName.FieldGroupFieldWrapper\">\n <input\n [class]=\"\n classnames(\n ComponentClassName.Input,\n ComponentClassName.FieldGroupControl,\n ComponentClassName.FieldShowPassword\n )\n \"\n [id]=\"fieldId\"\n [type]=\"type\"\n [name]=\"name\"\n [placeholder]=\"placeholder\"\n [required]=\"required\"\n [value]=\"initialValue\"\n [autocomplete]=\"autocomplete\"\n [attr.disabled]=\"disabled ? '' : null\"\n [attr.aria-invalid]=\"hasError ? 'true' : 'false'\"\n [attr.aria-describedby]=\"describedBy\"\n (blur)=\"setBlur.emit($event)\"\n />\n </div>\n <div [class]=\"ComponentClassName.FieldGroupOuterEnd\">\n <button\n amplify-button\n role=\"switch\"\n (click)=\"togglePasswordText()\"\n [attr.aria-checked]=\"type !== 'password'\"\n [attr.aria-label]=\"showPasswordButtonlabel\"\n [class]=\"\n classnames(\n ComponentClassName.Input,\n ComponentClassName.FieldGroupControl\n )\n \"\n >\n <svg\n *ngIf=\"!showPassword\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"currentColor\"\n viewBox=\"0 0 24 24\"\n class=\"amplify-icon\"\n >\n <path\n d=\"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z\"\n ></path>\n </svg>\n <svg\n *ngIf=\"showPassword\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"currentColor\"\n viewBox=\"0 0 24 24\"\n class=\"amplify-icon\"\n >\n <path\n d=\"M0 0h24v24H0zm0 0h24v24H0zm0 0h24v24H0zm0 0h24v24H0z\"\n fill=\"none\"\n ></path>\n <path\n d=\"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z\"\n ></path>\n </svg>\n </button>\n </div>\n </div>\n</div>\n", components: [{ type: ButtonComponent, selector: "button[amplify-button]", inputs: ["type", "fullWidth", "isDisabled", "size", "variation", "fontWeight"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
602
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: PasswordFieldComponent, decorators: [{
603
- type: Component,
604
- args: [{
605
- selector: 'amplify-password-field',
606
- templateUrl: './password-field.component.html',
607
- }]
608
- }], propDecorators: { autocomplete: [{
609
- type: Input
610
- }], disabled: [{
611
- type: Input
612
- }], fieldId: [{
613
- type: Input
614
- }], initialValue: [{
615
- type: Input
616
- }], label: [{
617
- type: Input
618
- }], name: [{
619
- type: Input
620
- }], placeholder: [{
621
- type: Input
622
- }], required: [{
623
- type: Input
624
- }], labelHidden: [{
625
- type: Input
626
- }], hasError: [{
627
- type: Input
628
- }], describedBy: [{
629
- type: Input
630
- }], setBlur: [{
631
- type: Output
632
- }] } });
633
-
634
- class TextFieldComponent {
635
- constructor() {
636
- this.autocomplete = 'new-password';
637
- this.disabled = false;
638
- this.fieldId = `amplify-field-${nanoid(12)}`;
639
- this.initialValue = '';
640
- this.label = '';
641
- this.placeholder = '';
642
- this.required = true;
643
- this.labelHidden = false;
644
- this.display = 'contents';
645
- }
646
- }
647
- TextFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TextFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
648
- TextFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: TextFieldComponent, selector: "amplify-text-field", inputs: { autocomplete: "autocomplete", disabled: "disabled", fieldId: "fieldId", initialValue: "initialValue", label: "label", name: "name", placeholder: "placeholder", required: "required", type: "type", labelHidden: "labelHidden", hasError: "hasError", describedBy: "describedBy" }, host: { properties: { "style.display": "this.display" } }, ngImport: i0, template: "<label\n class=\"amplify-label\"\n [class.amplify-visually-hidden]=\"labelHidden\"\n [for]=\"fieldId\"\n>\n {{ label }}\n</label>\n<input\n class=\"amplify-input\"\n [id]=\"fieldId\"\n [type]=\"type\"\n [name]=\"name\"\n [placeholder]=\"placeholder\"\n [required]=\"required\"\n [value]=\"initialValue\"\n [autocomplete]=\"autocomplete\"\n [attr.disabled]=\"disabled ? '' : null\"\n [attr.aria-invalid]=\"hasError ? 'true' : 'false'\"\n [attr.aria-describedby]=\"describedBy\"\n/>\n" });
649
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TextFieldComponent, decorators: [{
650
- type: Component,
651
- args: [{
652
- selector: 'amplify-text-field',
653
- templateUrl: './text-field.component.html',
654
- }]
655
- }], propDecorators: { autocomplete: [{
656
- type: Input
657
- }], disabled: [{
658
- type: Input
659
- }], fieldId: [{
660
- type: Input
661
- }], initialValue: [{
662
- type: Input
663
- }], label: [{
664
- type: Input
665
- }], name: [{
666
- type: Input
667
- }], placeholder: [{
668
- type: Input
669
- }], required: [{
670
- type: Input
671
- }], type: [{
672
- type: Input
673
- }], labelHidden: [{
674
- type: Input
675
- }], hasError: [{
676
- type: Input
677
- }], describedBy: [{
678
- type: Input
679
- }], display: [{
680
- type: HostBinding,
681
- args: ['style.display']
682
- }] } });
683
-
684
- class FormFieldComponent {
685
- constructor(authenticator) {
686
- this.authenticator = authenticator;
687
- this.countryDialCodesValue = countryDialCodes;
688
- this.errorId = nanoid(12);
689
- }
690
- get ariaDescribedBy() {
691
- return this.hasError() ? this.errorId : undefined;
692
- }
693
- get errors() {
694
- const { validationErrors } = this.authenticator;
695
- return getErrors(validationErrors[this.name]);
696
- }
697
- onBlur($event) {
698
- const { name } = $event.target;
699
- this.authenticator.updateBlur({ name });
700
- }
701
- isPasswordField() {
702
- return this.formField.type === 'password';
703
- }
704
- isPhoneField() {
705
- return this.formField.type === 'tel';
706
- }
707
- hasError() {
708
- var _a;
709
- return ((_a = this.errors) === null || _a === void 0 ? void 0 : _a.length) > 0;
710
- }
711
- translate(phrase) {
712
- return translate(phrase);
713
- }
714
- }
715
- FormFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FormFieldComponent, deps: [{ token: AuthenticatorService }], target: i0.ɵɵFactoryTarget.Component });
716
- FormFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: FormFieldComponent, selector: "amplify-form-field", inputs: { name: "name", formField: "formField" }, ngImport: i0, template: "<div class=\"amplify-flex amplify-field amplify-authenticator__column\">\n <!-- Country code field -->\n <amplify-phone-number-field\n *ngIf=\"isPhoneField()\"\n [name]=\"name\"\n [label]=\"formField.label\"\n [defaultCountryCode]=\"formField.dialCode\"\n [dialCodeList]=\"formField.dialCodeList\"\n [placeholder]=\"formField.placeholder\"\n [required]=\"formField.isRequired\"\n [labelHidden]=\"formField.labelHidden\"\n [autocomplete]=\"formField.autocomplete\"\n [hasError]=\"hasError\"\n [describedBy]=\"ariaDescribedBy\"\n type=\"tel\"\n ></amplify-phone-number-field>\n\n <amplify-password-field\n *ngIf=\"isPasswordField()\"\n [name]=\"name\"\n [label]=\"formField.label\"\n [placeholder]=\"formField.placeholder\"\n [required]=\"formField.isRequired\"\n [labelHidden]=\"formField.labelHidden\"\n [autocomplete]=\"formField.autocomplete\"\n [hasError]=\"hasError\"\n [describedBy]=\"ariaDescribedBy\"\n (setBlur)=\"onBlur($event)\"\n ></amplify-password-field>\n\n <amplify-text-field\n *ngIf=\"!isPasswordField() && !isPhoneField()\"\n [name]=\"name\"\n [label]=\"formField.label\"\n [placeholder]=\"formField.placeholder\"\n [required]=\"formField.isRequired\"\n [labelHidden]=\"formField.labelHidden\"\n [autocomplete]=\"formField.autocomplete\"\n [type]=\"formField.type\"\n [hasError]=\"hasError\"\n [describedBy]=\"ariaDescribedBy\"\n ></amplify-text-field>\n\n <div data-amplify-sign-up-errors *ngIf=\"hasError()\" [id]=\"errorId\">\n <div\n class=\"amplify-text amplify-text--error\"\n data-variation=\"error\"\n *ngFor=\"let error of errors\"\n >\n {{ translate(error) }}\n </div>\n </div>\n</div>\n", components: [{ type: PhoneNumberFieldComponent, selector: "amplify-phone-number-field", inputs: ["autocomplete", "disabled", "defaultCountryCode", "selectFieldId", "textFieldId", "initialValue", "label", "name", "placeholder", "required", "type", "labelHidden", "dialCodeList", "hasError", "describedBy"] }, { type: PasswordFieldComponent, selector: "amplify-password-field", inputs: ["autocomplete", "disabled", "fieldId", "initialValue", "label", "name", "placeholder", "required", "labelHidden", "hasError", "describedBy"], outputs: ["setBlur"] }, { type: TextFieldComponent, selector: "amplify-text-field", inputs: ["autocomplete", "disabled", "fieldId", "initialValue", "label", "name", "placeholder", "required", "type", "labelHidden", "hasError", "describedBy"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
717
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FormFieldComponent, decorators: [{
718
- type: Component,
719
- args: [{
720
- selector: 'amplify-form-field',
721
- templateUrl: './form-field.component.html',
722
- }]
723
- }], ctorParameters: function () { return [{ type: AuthenticatorService }]; }, propDecorators: { name: [{
724
- type: Input
725
- }], formField: [{
726
- type: Input
727
- }] } });
728
-
729
- /**
730
- * Sorts the given formFields, then renders them in order.
731
- */
732
- class BaseFormFieldsComponent {
733
- constructor(authenticator) {
734
- this.authenticator = authenticator;
735
- this.display = 'contents';
736
- this.formFields = [];
737
- }
738
- ngOnInit() {
739
- const state = this.authenticator.authState;
740
- this.formFields = getSortedFormFields(this.route, state);
741
- }
742
- }
743
- BaseFormFieldsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: BaseFormFieldsComponent, deps: [{ token: AuthenticatorService }], target: i0.ɵɵFactoryTarget.Component });
744
- BaseFormFieldsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: BaseFormFieldsComponent, selector: "amplify-base-form-fields", inputs: { route: "route" }, host: { properties: { "style.display": "this.display" } }, ngImport: i0, template: "<ng-container *ngFor=\"let formField of formFields\">\n <amplify-form-field\n [name]=\"formField[0]\"\n [formField]=\"formField[1]\"\n ></amplify-form-field>\n</ng-container>\n", components: [{ type: FormFieldComponent, selector: "amplify-form-field", inputs: ["name", "formField"] }], directives: [{ type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
745
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: BaseFormFieldsComponent, decorators: [{
746
- type: Component,
747
- args: [{
748
- selector: 'amplify-base-form-fields',
749
- templateUrl: './base-form-fields.component.html',
750
- }]
751
- }], ctorParameters: function () { return [{ type: AuthenticatorService }]; }, propDecorators: { route: [{
752
- type: Input
753
- }], display: [{
754
- type: HostBinding,
755
- args: ['style.display']
756
- }] } });
757
-
758
- class ErrorComponent {
759
- constructor() {
760
- this.isVisible = true;
761
- this.dismissAriaLabel = translate('Dismiss alert');
762
- }
763
- close() {
764
- this.isVisible = false;
765
- }
766
- }
767
- ErrorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ErrorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
768
- ErrorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: ErrorComponent, selector: "amplify-error", ngImport: i0, template: "<div\n class=\"amplify-flex amplify-alert amplify-alert--error\"\n data-variation=\"error\"\n style=\"align-items: center; justify-content: space-between\"\n *ngIf=\"isVisible\"\n role=\"alert\"\n>\n <div class=\"amplify-flex\" style=\"align-items: center\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"amplify-icon\"\n [attr.aria-hidden]=\"true\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n >\n <path\n d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z\"\n ></path>\n </svg>\n <div><ng-content></ng-content></div>\n </div>\n <button\n amplify-button\n class=\"amplify-field-group__control amplify-alert__dismiss\"\n [attr.aria-label]=\"dismissAriaLabel\"\n variation=\"link\"\n [fullWidth]=\"false\"\n (click)=\"close()\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"amplify-icon\"\n [attr.aria-hidden]=\"true\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n >\n <path\n d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"\n ></path>\n </svg>\n </button>\n</div>\n", components: [{ type: ButtonComponent, selector: "button[amplify-button]", inputs: ["type", "fullWidth", "isDisabled", "size", "variation", "fontWeight"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
769
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ErrorComponent, decorators: [{
770
- type: Component,
771
- args: [{
772
- selector: 'amplify-error',
773
- templateUrl: './error.component.html',
774
- }]
775
- }] });
776
-
777
- const { getForgotPasswordText, getSignInText } = authenticatorTextUtil;
778
- class SignInComponent {
779
- constructor(authenticator) {
780
- this.authenticator = authenticator;
781
- this.dataAttr = '';
782
- this.forgotPasswordText = getForgotPasswordText();
783
- this.signInButtonText = getSignInText();
784
- }
785
- get context() {
786
- return this.authenticator.slotContext;
787
- }
788
- onInput(event) {
789
- event.preventDefault();
790
- const { name, value } = event.target;
791
- this.authenticator.updateForm({ name, value });
792
- }
793
- onSubmit(event) {
794
- event.preventDefault();
795
- this.authenticator.submitForm(getFormDataFromEvent(event));
796
- }
797
- }
798
- SignInComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: SignInComponent, deps: [{ token: AuthenticatorService }], target: i0.ɵɵFactoryTarget.Component });
799
- SignInComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: SignInComponent, selector: "amplify-sign-in", host: { properties: { "attr.data-amplify-authenticator-signin": "this.dataAttr" } }, ngImport: i0, template: "<amplify-slot name=\"sign-in-header\" [context]=\"context\"></amplify-slot>\n\n<form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <amplify-federated-sign-in></amplify-federated-sign-in>\n <fieldset\n class=\"amplify-flex amplify-authenticator__column\"\n style=\"flex-direction: column\"\n data-amplify-fieldset\n [disabled]=\"authenticator.isPending\"\n >\n <legend class=\"amplify-visually-hidden\">Sign in</legend>\n <amplify-base-form-fields route=\"signIn\"></amplify-base-form-fields>\n <button\n amplify-button\n variation=\"primary\"\n fullWidth=\"true\"\n type=\"submit\"\n [isDisabled]=\"authenticator.isPending\"\n >\n {{ signInButtonText }}\n </button>\n\n <amplify-error *ngIf=\"authenticator.error\">\n {{ authenticator.error }}\n </amplify-error>\n </fieldset>\n</form>\n\n<amplify-slot name=\"sign-in-footer\" [context]=\"context\">\n <div data-amplify-footer>\n <button\n amplify-button\n fontWeight=\"normal\"\n size=\"small\"\n variation=\"link\"\n fullWidth=\"true\"\n (click)=\"authenticator.toResetPassword()\"\n >\n {{ forgotPasswordText }}\n </button>\n </div>\n</amplify-slot>\n", components: [{ type: AmplifySlotComponent, selector: "amplify-slot", inputs: ["name", "context"] }, { type: FederatedSignInComponent, selector: "amplify-federated-sign-in" }, { type: BaseFormFieldsComponent, selector: "amplify-base-form-fields", inputs: ["route"] }, { type: ButtonComponent, selector: "button[amplify-button]", inputs: ["type", "fullWidth", "isDisabled", "size", "variation", "fontWeight"] }, { type: ErrorComponent, selector: "amplify-error" }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], encapsulation: i0.ViewEncapsulation.None });
800
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: SignInComponent, decorators: [{
801
- type: Component,
802
- args: [{
803
- selector: 'amplify-sign-in',
804
- templateUrl: './sign-in.component.html',
805
- encapsulation: ViewEncapsulation.None,
806
- }]
807
- }], ctorParameters: function () { return [{ type: AuthenticatorService }]; }, propDecorators: { dataAttr: [{
808
- type: HostBinding,
809
- args: ['attr.data-amplify-authenticator-signin']
810
- }] } });
811
-
812
- class SignUpFormFieldsComponent {
813
- }
814
- SignUpFormFieldsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: SignUpFormFieldsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
815
- SignUpFormFieldsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: SignUpFormFieldsComponent, selector: "amplify-sign-up-form-fields", ngImport: i0, template: "<div class=\"amplify-flex amplify-authenticator__column\" data-amplify-fieldset>\n <amplify-base-form-fields route=\"signUp\"></amplify-base-form-fields>\n</div>\n", components: [{ type: BaseFormFieldsComponent, selector: "amplify-base-form-fields", inputs: ["route"] }] });
816
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: SignUpFormFieldsComponent, decorators: [{
817
- type: Component,
818
- args: [{
819
- selector: 'amplify-sign-up-form-fields',
820
- templateUrl: './sign-up-form-fields.component.html',
821
- }]
822
- }] });
823
-
824
- const { getCreateAccountText } = authenticatorTextUtil;
825
- class SignUpComponent {
826
- constructor(authenticator) {
827
- this.authenticator = authenticator;
828
- this.dataAttr = '';
829
- // translated texts
830
- this.createAccountText = getCreateAccountText();
831
- }
832
- get context() {
833
- return this.authenticator.slotContext;
834
- }
835
- onInput(event) {
836
- const { checked, name, type, value } = event.target;
837
- const isUncheckedCheckbox = type === 'checkbox' && !checked;
838
- this.authenticator.updateForm({
839
- name,
840
- value: isUncheckedCheckbox ? undefined : value,
841
- });
842
- }
843
- onSubmit(event) {
844
- event.preventDefault();
845
- this.authenticator.submitForm(getFormDataFromEvent(event));
846
- }
847
- }
848
- SignUpComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: SignUpComponent, deps: [{ token: AuthenticatorService }], target: i0.ɵɵFactoryTarget.Component });
849
- SignUpComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: SignUpComponent, selector: "amplify-sign-up", host: { properties: { "attr.data-amplify-authenticator-signup": "this.dataAttr" } }, ngImport: i0, template: "<amplify-slot name=\"sign-up-header\" [context]=\"context\"></amplify-slot>\n\n<form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <amplify-federated-sign-in></amplify-federated-sign-in>\n <div class=\"amplify-flex amplify-authenticator__column\">\n <div class=\"amplify-flex amplify-authenticator__column\">\n <amplify-slot name=\"sign-up-form-fields\" [context]=\"context\">\n <amplify-sign-up-form-fields></amplify-sign-up-form-fields>\n </amplify-slot>\n\n <amplify-error *ngIf=\"authenticator.error\">\n {{ authenticator.error }}\n </amplify-error>\n </div>\n\n <amplify-slot name=\"sign-up-button\" [context]=\"context\">\n <button\n [isDisabled]=\"\n authenticator.isPending || authenticator.hasValidationErrors\n \"\n amplify-button\n variation=\"primary\"\n fullWidth=\"true\"\n type=\"submit\"\n >\n {{ createAccountText }}\n </button>\n </amplify-slot>\n </div>\n</form>\n\n<amplify-slot name=\"sign-up-footer\" [context]=\"context\"> </amplify-slot>\n", components: [{ type: AmplifySlotComponent, selector: "amplify-slot", inputs: ["name", "context"] }, { type: FederatedSignInComponent, selector: "amplify-federated-sign-in" }, { type: SignUpFormFieldsComponent, selector: "amplify-sign-up-form-fields" }, { type: ErrorComponent, selector: "amplify-error" }, { type: ButtonComponent, selector: "button[amplify-button]", inputs: ["type", "fullWidth", "isDisabled", "size", "variation", "fontWeight"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
850
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: SignUpComponent, decorators: [{
851
- type: Component,
852
- args: [{
853
- selector: 'amplify-sign-up',
854
- templateUrl: './sign-up.component.html',
855
- }]
856
- }], ctorParameters: function () { return [{ type: AuthenticatorService }]; }, propDecorators: { dataAttr: [{
857
- type: HostBinding,
858
- args: ['attr.data-amplify-authenticator-signup']
859
- }] } });
860
-
861
- const { getResendCodeText: getResendCodeText$1, getConfirmText: getConfirmText$2, getDeliveryMethodText, getDeliveryMessageText, } = authenticatorTextUtil;
862
- class ConfirmSignUpComponent {
863
- constructor(authenticator) {
864
- this.authenticator = authenticator;
865
- this.dataAttr = '';
866
- // translated texts
867
- this.resendCodeText = getResendCodeText$1();
868
- this.confirmText = getConfirmText$2();
869
- }
870
- get context() {
871
- return this.authenticator.slotContext;
872
- }
873
- get confirmSignUpHeading() {
874
- const { codeDeliveryDetails } = this.authenticator;
875
- return getDeliveryMethodText(codeDeliveryDetails);
876
- }
877
- get subtitleText() {
878
- const { codeDeliveryDetails } = this.authenticator;
879
- return getDeliveryMessageText(codeDeliveryDetails);
880
- }
881
- onInput(event) {
882
- event.preventDefault();
883
- const { name, value } = event.target;
884
- this.authenticator.updateForm({ name, value });
885
- }
886
- onSubmit(event) {
887
- event.preventDefault();
888
- this.authenticator.submitForm(getFormDataFromEvent(event));
889
- }
890
- }
891
- ConfirmSignUpComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ConfirmSignUpComponent, deps: [{ token: AuthenticatorService }], target: i0.ɵɵFactoryTarget.Component });
892
- ConfirmSignUpComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: ConfirmSignUpComponent, selector: "amplify-confirm-sign-up", host: { properties: { "attr.data-amplify-authenticator-confirmsignup": "this.dataAttr" } }, ngImport: i0, template: "<ng-container>\n <form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <fieldset\n class=\"amplify-flex amplify-authenticator__column\"\n data-amplify-fieldset\n [disabled]=\"context.isPending\"\n >\n <amplify-slot name=\"confirm-sign-up-header\" [context]=\"context\">\n <h3\n class=\"amplify-heading amplify-authenticator__heading\"\n style=\"font-size: 1.5rem\"\n >\n {{ confirmSignUpHeading }}\n </h3>\n </amplify-slot>\n <span class=\"amplify-authenticator__subtitle\">\n {{ subtitleText }}\n </span>\n <amplify-base-form-fields\n route=\"confirmSignUp\"\n ></amplify-base-form-fields>\n\n <button\n amplify-button\n variation=\"primary\"\n fullWidth=\"true\"\n type=\"submit\"\n [isDisabled]=\"authenticator.isPending\"\n >\n {{ confirmText }}\n </button>\n <button\n amplify-button\n fontWeight=\"normal\"\n (click)=\"authenticator.resendCode()\"\n >\n {{ resendCodeText }}\n </button>\n </fieldset>\n\n <amplify-error *ngIf=\"context.error\">\n {{ authenticator.error }}\n </amplify-error>\n <amplify-slot\n name=\"confirm-sign-up-footer\"\n [context]=\"context\"\n ></amplify-slot>\n </form>\n</ng-container>\n", components: [{ type: AmplifySlotComponent, selector: "amplify-slot", inputs: ["name", "context"] }, { type: BaseFormFieldsComponent, selector: "amplify-base-form-fields", inputs: ["route"] }, { type: ButtonComponent, selector: "button[amplify-button]", inputs: ["type", "fullWidth", "isDisabled", "size", "variation", "fontWeight"] }, { type: ErrorComponent, selector: "amplify-error" }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
893
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ConfirmSignUpComponent, decorators: [{
894
- type: Component,
895
- args: [{
896
- selector: 'amplify-confirm-sign-up',
897
- templateUrl: './confirm-sign-up.component.html',
898
- }]
899
- }], ctorParameters: function () { return [{ type: AuthenticatorService }]; }, propDecorators: { dataAttr: [{
900
- type: HostBinding,
901
- args: ['attr.data-amplify-authenticator-confirmsignup']
902
- }] } });
903
-
904
- const { getConfirmText: getConfirmText$1, getBackToSignInText: getBackToSignInText$4, getChallengeText } = authenticatorTextUtil;
905
- class ConfirmSignInComponent {
906
- constructor(authenticator) {
907
- this.authenticator = authenticator;
908
- this.dataAttr = '';
909
- this.confirmText = getConfirmText$1();
910
- this.backToSignInText = getBackToSignInText$4();
911
- }
912
- get context() {
913
- return this.authenticator.slotContext;
914
- }
915
- ngOnInit() {
916
- this.setHeaderText();
917
- }
918
- setHeaderText() {
919
- const state = this.authenticator.authState;
920
- const actorContext = getActorContext(state);
921
- const { challengeName } = actorContext;
922
- this.headerText = getChallengeText(challengeName);
923
- }
924
- onInput(event) {
925
- event.preventDefault();
926
- const { name, value } = event.target;
927
- this.authenticator.updateForm({ name, value });
928
- }
929
- onSubmit(event) {
930
- event.preventDefault();
931
- this.authenticator.submitForm(getFormDataFromEvent(event));
932
- }
933
- }
934
- ConfirmSignInComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ConfirmSignInComponent, deps: [{ token: AuthenticatorService }], target: i0.ɵɵFactoryTarget.Component });
935
- ConfirmSignInComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: ConfirmSignInComponent, selector: "amplify-confirm-sign-in", host: { properties: { "attr.data-amplify-authenticator-confirmsignin": "this.dataAttr" } }, ngImport: i0, template: "<form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <fieldset\n class=\"amplify-flex amplify-authenticator__column\"\n data-amplify-fieldset\n [disabled]=\"authenticator.isPending\"\n >\n <amplify-slot name=\"confirm-sign-in-header\" [context]=\"context\">\n <h3 class=\"amplify-heading amplify-heading--3\">{{ headerText }}</h3>\n </amplify-slot>\n <amplify-base-form-fields route=\"confirmSignIn\"></amplify-base-form-fields>\n\n <button\n amplify-button\n variation=\"primary\"\n fullWidth=\"true\"\n type=\"submit\"\n [isDisabled]=\"authenticator.isPending\"\n >\n {{ confirmText }}\n </button>\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n (click)=\"authenticator.toSignIn()\"\n >\n {{ backToSignInText }}\n </button>\n <amplify-error *ngIf=\"authenticator.error\">\n {{ authenticator.error }}\n </amplify-error>\n </fieldset>\n <amplify-slot\n name=\"confirm-sign-in-footer\"\n [context]=\"context\"\n ></amplify-slot>\n</form>\n", components: [{ type: AmplifySlotComponent, selector: "amplify-slot", inputs: ["name", "context"] }, { type: BaseFormFieldsComponent, selector: "amplify-base-form-fields", inputs: ["route"] }, { type: ButtonComponent, selector: "button[amplify-button]", inputs: ["type", "fullWidth", "isDisabled", "size", "variation", "fontWeight"] }, { type: ErrorComponent, selector: "amplify-error" }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
936
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ConfirmSignInComponent, decorators: [{
937
- type: Component,
938
- args: [{
939
- selector: 'amplify-confirm-sign-in',
940
- templateUrl: './confirm-sign-in.component.html',
941
- }]
942
- }], ctorParameters: function () { return [{ type: AuthenticatorService }]; }, propDecorators: { dataAttr: [{
943
- type: HostBinding,
944
- args: ['attr.data-amplify-authenticator-confirmsignin']
945
- }] } });
946
-
947
- const logger = new Logger$1('SetupTotp');
948
- const { getSetupTOTPText, getCopyText, getBackToSignInText: getBackToSignInText$3, getConfirmText, getCopiedText, } = authenticatorTextUtil;
949
- class SetupTotpComponent {
950
- constructor(authenticator) {
951
- this.authenticator = authenticator;
952
- this.dataAttr = '';
953
- this.headerText = getSetupTOTPText();
954
- this.qrCodeSource = '';
955
- this.totpSecretCode = '';
956
- this.copyTextLabel = getCopyText();
957
- // translated texts
958
- this.backToSignInText = getBackToSignInText$3();
959
- this.confirmText = getConfirmText();
960
- }
961
- get context() {
962
- return this.authenticator.slotContext;
963
- }
964
- ngOnInit() {
965
- return __awaiter(this, void 0, void 0, function* () {
966
- yield this.generateQRCode();
967
- });
968
- }
969
- generateQRCode() {
970
- var _a, _b;
971
- return __awaiter(this, void 0, void 0, function* () {
972
- const { authState: state, totpSecretCode, user } = this.authenticator;
973
- const { formFields } = getActorContext(state);
974
- const { totpIssuer = 'AWSCognito', totpUsername = user === null || user === void 0 ? void 0 : user.username } = (_b = (_a = formFields === null || formFields === void 0 ? void 0 : formFields.setupTOTP) === null || _a === void 0 ? void 0 : _a.QR) !== null && _b !== void 0 ? _b : {};
975
- this.totpSecretCode = totpSecretCode;
976
- try {
977
- const totpCode = getTotpCodeURL(totpIssuer, totpUsername, this.totpSecretCode);
978
- logger.info('totp code was generated:', totpCode);
979
- this.qrCodeSource = yield QRCode.toDataURL(totpCode);
980
- }
981
- catch (err) {
982
- logger.error(err);
983
- }
984
- });
985
- }
986
- onInput(event) {
987
- event.preventDefault();
988
- const { name, value } = event.target;
989
- this.authenticator.updateForm({ name, value });
990
- }
991
- onSubmit(event) {
992
- event.preventDefault();
993
- this.authenticator.submitForm(getFormDataFromEvent(event));
994
- }
995
- copyText() {
996
- navigator.clipboard.writeText(this.totpSecretCode);
997
- this.copyTextLabel = getCopiedText();
998
- }
999
- }
1000
- SetupTotpComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: SetupTotpComponent, deps: [{ token: AuthenticatorService }], target: i0.ɵɵFactoryTarget.Component });
1001
- SetupTotpComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: SetupTotpComponent, selector: "amplify-setup-totp", host: { properties: { "attr.data-amplify-authenticator-setup-totp": "this.dataAttr" } }, ngImport: i0, template: "<form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <fieldset\n class=\"amplify-flex amplify-authenticator__column\"\n data-amplify-fieldset\n [disabled]=\"authenticator.isPending\"\n >\n <amplify-slot name=\"setup-totp-header\" [context]=\"context\">\n <h3 class=\"amplify-heading amplify-heading--3\">{{ this.headerText }}</h3>\n </amplify-slot>\n <p *ngIf=\"!qrCodeSource\">Loading...</p>\n <img\n *ngIf=\"qrCodeSource\"\n [src]=\"qrCodeSource\"\n alt=\"qr code\"\n data-amplify-qrcode\n width=\"228\"\n height=\"228\"\n />\n <div class=\"amplify-flex\" data-amplify-copy>\n <div>{{ totpSecretCode }}</div>\n <div data-amplify-copy-svg (click)=\"copyText()\">\n <div data-amplify-copy-tooltip>{{ copyTextLabel }}</div>\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M16 1H4C2.9 1 2 1.9 2 3V17H4V3H16V1ZM15 5H8C6.9 5 6.01 5.9 6.01 7L6 21C6 22.1 6.89 23 7.99 23H19C20.1 23 21 22.1 21 21V11L15 5ZM8 21V7H14V12H19V21H8Z\"\n />\n </svg>\n </div>\n </div>\n\n <amplify-base-form-fields route=\"setupTOTP\"></amplify-base-form-fields>\n <button\n amplify-button\n variation=\"primary\"\n fullWidth=\"true\"\n type=\"submit\"\n [isDisabled]=\"authenticator.isPending\"\n >\n {{ confirmText }}\n </button>\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n (click)=\"authenticator.toSignIn()\"\n >\n {{ backToSignInText }}\n </button>\n <amplify-error *ngIf=\"authenticator.error\">\n {{ authenticator.error }}\n </amplify-error>\n </fieldset>\n <amplify-slot name=\"setup-totp-footer\" [context]=\"context\"> </amplify-slot>\n</form>\n", components: [{ type: AmplifySlotComponent, selector: "amplify-slot", inputs: ["name", "context"] }, { type: BaseFormFieldsComponent, selector: "amplify-base-form-fields", inputs: ["route"] }, { type: ButtonComponent, selector: "button[amplify-button]", inputs: ["type", "fullWidth", "isDisabled", "size", "variation", "fontWeight"] }, { type: ErrorComponent, selector: "amplify-error" }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
1002
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: SetupTotpComponent, decorators: [{
1003
- type: Component,
1004
- args: [{
1005
- selector: 'amplify-setup-totp',
1006
- templateUrl: './setup-totp.component.html',
1007
- }]
1008
- }], ctorParameters: function () { return [{ type: AuthenticatorService }]; }, propDecorators: { dataAttr: [{
1009
- type: HostBinding,
1010
- args: ['attr.data-amplify-authenticator-setup-totp']
1011
- }] } });
1012
-
1013
- class ForceNewPasswordFormFieldsComponent {
1014
- }
1015
- ForceNewPasswordFormFieldsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ForceNewPasswordFormFieldsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1016
- ForceNewPasswordFormFieldsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: ForceNewPasswordFormFieldsComponent, selector: "amplify-force-new-password-form-fields", ngImport: i0, template: "<div class=\"amplify-flex amplify-authenticator__column\" data-amplify-fieldset>\n <amplify-base-form-fields route=\"forceNewPassword\"></amplify-base-form-fields>\n</div>\n", components: [{ type: BaseFormFieldsComponent, selector: "amplify-base-form-fields", inputs: ["route"] }] });
1017
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ForceNewPasswordFormFieldsComponent, decorators: [{
1018
- type: Component,
1019
- args: [{
1020
- selector: 'amplify-force-new-password-form-fields',
1021
- templateUrl: './force-new-password-form-fields.component.html',
1022
- }]
1023
- }] });
1024
-
1025
- const { getChangePasswordText, getBackToSignInText: getBackToSignInText$2 } = authenticatorTextUtil;
1026
- class ForceNewPasswordComponent {
1027
- constructor(authenticator) {
1028
- this.authenticator = authenticator;
1029
- this.dataAttr = '';
1030
- this.headerText = getChangePasswordText();
1031
- // translated texts
1032
- this.changePasswordText = getChangePasswordText();
1033
- this.backToSignInText = getBackToSignInText$2();
1034
- }
1035
- get context() {
1036
- return this.authenticator.slotContext;
1037
- }
1038
- onInput(event) {
1039
- event.preventDefault();
1040
- const { name, value } = event.target;
1041
- this.authenticator.updateForm({ name, value });
1042
- }
1043
- onSubmit(event) {
1044
- event.preventDefault();
1045
- this.authenticator.submitForm(getFormDataFromEvent(event));
1046
- }
1047
- }
1048
- ForceNewPasswordComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ForceNewPasswordComponent, deps: [{ token: AuthenticatorService }], target: i0.ɵɵFactoryTarget.Component });
1049
- ForceNewPasswordComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: ForceNewPasswordComponent, selector: "amplify-force-new-password", inputs: { headerText: "headerText" }, host: { properties: { "attr.data-amplify-authenticator-forcenewpassword": "this.dataAttr" } }, ngImport: i0, template: "<form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <fieldset\n class=\"amplify-flex amplify-authenticator__column\"\n data-amplify-fieldset\n [disabled]=\"authenticator.isPending\"\n >\n <amplify-slot name=\"force-new-password-header\" [context]=\"context\">\n <h3 class=\"amplify-heading amplify-heading--3\">{{ this.headerText }}</h3>\n </amplify-slot>\n\n <amplify-slot name=\"force-new-form-fields\" [context]=\"context\">\n <amplify-force-new-password-form-fields></amplify-force-new-password-form-fields>\n </amplify-slot>\n\n <button amplify-button variation=\"primary\" fullWidth=\"true\" type=\"submit\">\n {{ changePasswordText }}\n </button>\n\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n (click)=\"authenticator.toSignIn()\"\n >\n {{ backToSignInText }}\n </button>\n <amplify-error *ngIf=\"authenticator.error\">\n {{ authenticator.error }}\n </amplify-error>\n </fieldset>\n <amplify-slot name=\"force-new-password-footer\" [context]=\"context\">\n </amplify-slot>\n</form>\n", components: [{ type: AmplifySlotComponent, selector: "amplify-slot", inputs: ["name", "context"] }, { type: ForceNewPasswordFormFieldsComponent, selector: "amplify-force-new-password-form-fields" }, { type: ButtonComponent, selector: "button[amplify-button]", inputs: ["type", "fullWidth", "isDisabled", "size", "variation", "fontWeight"] }, { type: ErrorComponent, selector: "amplify-error" }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
1050
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ForceNewPasswordComponent, decorators: [{
1051
- type: Component,
1052
- args: [{
1053
- selector: 'amplify-force-new-password',
1054
- templateUrl: './force-new-password.component.html',
1055
- }]
1056
- }], ctorParameters: function () { return [{ type: AuthenticatorService }]; }, propDecorators: { dataAttr: [{
1057
- type: HostBinding,
1058
- args: ['attr.data-amplify-authenticator-forcenewpassword']
1059
- }], headerText: [{
1060
- type: Input
1061
- }] } });
1062
-
1063
- const { getResetYourPasswordText: getResetYourPasswordText$1, getSendCodeText, getBackToSignInText: getBackToSignInText$1 } = authenticatorTextUtil;
1064
- class ResetPasswordComponent {
1065
- constructor(authenticator) {
1066
- this.authenticator = authenticator;
1067
- this.dataAttr = '';
1068
- this.headerText = getResetYourPasswordText$1();
1069
- // translated texts
1070
- this.sendCodeText = getSendCodeText();
1071
- this.backToSignInText = getBackToSignInText$1();
1072
- }
1073
- get context() {
1074
- return this.authenticator.slotContext;
1075
- }
1076
- onInput(event) {
1077
- event.preventDefault();
1078
- const { name, value } = event.target;
1079
- this.authenticator.updateForm({ name, value });
1080
- }
1081
- onSubmit(event) {
1082
- event.preventDefault();
1083
- this.authenticator.submitForm(getFormDataFromEvent(event));
1084
- }
1085
- }
1086
- ResetPasswordComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ResetPasswordComponent, deps: [{ token: AuthenticatorService }], target: i0.ɵɵFactoryTarget.Component });
1087
- ResetPasswordComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: ResetPasswordComponent, selector: "amplify-reset-password", inputs: { headerText: "headerText" }, host: { properties: { "attr.data-amplify-authenticator-resetPassword": "this.dataAttr" } }, ngImport: i0, template: "<form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <fieldset\n class=\"amplify-flex amplify-authenticator__column\"\n data-amplify-fieldset\n [disabled]=\"authenticator.isPending\"\n >\n <amplify-slot\n class=\"amplify-flex\"\n name=\"reset-password-header\"\n [context]=\"context\"\n >\n <h3 class=\"amplify-heading amplify-heading--3\">{{ this.headerText }}</h3>\n </amplify-slot>\n\n <amplify-base-form-fields route=\"resetPassword\"></amplify-base-form-fields>\n <button\n amplify-button\n variation=\"primary\"\n fullWidth=\"true\"\n type=\"submit\"\n [isDisabled]=\"authenticator.isPending\"\n >\n {{ sendCodeText }}\n </button>\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n (click)=\"authenticator.toSignIn()\"\n >\n {{ backToSignInText }}\n </button>\n <amplify-error *ngIf=\"authenticator.error\">\n {{ authenticator.error }}\n </amplify-error>\n </fieldset>\n\n <amplify-slot name=\"reset-password-footer\" [context]=\"context\">\n </amplify-slot>\n</form>\n", components: [{ type: AmplifySlotComponent, selector: "amplify-slot", inputs: ["name", "context"] }, { type: BaseFormFieldsComponent, selector: "amplify-base-form-fields", inputs: ["route"] }, { type: ButtonComponent, selector: "button[amplify-button]", inputs: ["type", "fullWidth", "isDisabled", "size", "variation", "fontWeight"] }, { type: ErrorComponent, selector: "amplify-error" }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
1088
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ResetPasswordComponent, decorators: [{
1089
- type: Component,
1090
- args: [{
1091
- selector: 'amplify-reset-password',
1092
- templateUrl: './reset-password.component.html',
1093
- }]
1094
- }], ctorParameters: function () { return [{ type: AuthenticatorService }]; }, propDecorators: { dataAttr: [{
1095
- type: HostBinding,
1096
- args: ['attr.data-amplify-authenticator-resetPassword']
1097
- }], headerText: [{
1098
- type: Input
1099
- }] } });
1100
-
1101
- const { getBackToSignInText, getResendCodeText, getSubmitText: getSubmitText$1, getResetYourPasswordText, } = authenticatorTextUtil;
1102
- class ConfirmResetPasswordComponent {
1103
- constructor(authenticator) {
1104
- this.authenticator = authenticator;
1105
- this.dataAttr = '';
1106
- this.headerText = getResetYourPasswordText();
1107
- // translated strings
1108
- this.backToSignInText = getBackToSignInText();
1109
- this.resendCodeText = getResendCodeText();
1110
- this.submitText = getSubmitText$1();
1111
- }
1112
- get context() {
1113
- return this.authenticator.slotContext;
1114
- }
1115
- onInput(event) {
1116
- event.preventDefault();
1117
- const { name, value } = event.target;
1118
- this.authenticator.updateForm({ name, value });
1119
- }
1120
- onSubmit(event) {
1121
- event.preventDefault();
1122
- this.authenticator.submitForm(getFormDataFromEvent(event));
1123
- }
1124
- }
1125
- ConfirmResetPasswordComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ConfirmResetPasswordComponent, deps: [{ token: AuthenticatorService }], target: i0.ɵɵFactoryTarget.Component });
1126
- ConfirmResetPasswordComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: ConfirmResetPasswordComponent, selector: "amplify-confirm-reset-password", inputs: { headerText: "headerText" }, host: { properties: { "attr.data-amplify-authenticator-confirmsignin": "this.dataAttr" } }, ngImport: i0, template: "<form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <fieldset\n class=\"amplify-flex amplify-authenticator__column\"\n data-amplify-fieldset\n [disabled]=\"authenticator.isPending\"\n >\n <amplify-slot name=\"confirm-reset-password-header\" [context]=\"context\">\n <h3 class=\"amplify-heading amplify-heading--3\">{{ headerText }}</h3>\n </amplify-slot>\n\n <amplify-base-form-fields\n route=\"confirmResetPassword\"\n ></amplify-base-form-fields>\n\n <button\n amplify-button\n variation=\"primary\"\n fullWidth=\"true\"\n type=\"submit\"\n [isDisabled]=\"authenticator.isPending\"\n >\n {{ submitText }}\n </button>\n\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n type=\"button\"\n (click)=\"authenticator.resendCode()\"\n >\n {{ resendCodeText }}\n </button>\n\n <amplify-error *ngIf=\"authenticator.error\">\n {{ authenticator.error }}\n </amplify-error>\n </fieldset>\n <amplify-slot name=\"confirm-reset-password-footer\" [context]=\"context\">\n </amplify-slot>\n</form>\n", components: [{ type: AmplifySlotComponent, selector: "amplify-slot", inputs: ["name", "context"] }, { type: BaseFormFieldsComponent, selector: "amplify-base-form-fields", inputs: ["route"] }, { type: ButtonComponent, selector: "button[amplify-button]", inputs: ["type", "fullWidth", "isDisabled", "size", "variation", "fontWeight"] }, { type: ErrorComponent, selector: "amplify-error" }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
1127
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ConfirmResetPasswordComponent, decorators: [{
1128
- type: Component,
1129
- args: [{
1130
- selector: 'amplify-confirm-reset-password',
1131
- templateUrl: './amplify-confirm-reset-password.component.html',
1132
- }]
1133
- }], ctorParameters: function () { return [{ type: AuthenticatorService }]; }, propDecorators: { dataAttr: [{
1134
- type: HostBinding,
1135
- args: ['attr.data-amplify-authenticator-confirmsignin']
1136
- }], headerText: [{
1137
- type: Input
1138
- }] } });
1139
-
1140
- const getAttributeMap = () => defaultFormFieldOptions;
1141
-
1142
- const { getSkipText: getSkipText$1, getVerifyText, getAccountRecoveryInfoText: getAccountRecoveryInfoText$1 } = authenticatorTextUtil;
1143
- class VerifyUserComponent {
1144
- constructor(authenticator) {
1145
- this.authenticator = authenticator;
1146
- this.dataAttr = '';
1147
- this.headerText = getAccountRecoveryInfoText$1();
1148
- this.unverifiedContactMethods = {};
1149
- this.labelId = nanoid(12);
1150
- // translated texts
1151
- this.skipText = getSkipText$1();
1152
- this.verifyText = getVerifyText();
1153
- }
1154
- get context() {
1155
- return this.authenticator.slotContext;
1156
- }
1157
- ngOnInit() {
1158
- const actorState = getActorState(this.authenticator.authState);
1159
- this.unverifiedContactMethods = actorState.context.unverifiedContactMethods;
1160
- }
1161
- getLabel(attr) {
1162
- const attributeMap = getAttributeMap();
1163
- const { label } = attributeMap[attr];
1164
- return translate(label);
1165
- }
1166
- onInput(event) {
1167
- event.preventDefault();
1168
- const { name, value } = event.target;
1169
- this.authenticator.updateForm({ name, value });
1170
- }
1171
- onSubmit(event) {
1172
- event.preventDefault();
1173
- this.authenticator.submitForm(getFormDataFromEvent(event));
1174
- }
1175
- }
1176
- VerifyUserComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: VerifyUserComponent, deps: [{ token: AuthenticatorService }], target: i0.ɵɵFactoryTarget.Component });
1177
- VerifyUserComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: VerifyUserComponent, selector: "amplify-verify-user", inputs: { headerText: "headerText" }, host: { properties: { "attr.data-amplify-authenticator-verifyuser": "this.dataAttr" } }, ngImport: i0, template: "<form data-amplify-form (input)=\"onInput($event)\" (submit)=\"onSubmit($event)\">\n <fieldset\n class=\"amplify-flex amplify-authenticator__column\"\n data-amplify-fieldset\n [disabled]=\"authenticator.isPending\"\n >\n <amplify-slot name=\"verify-user-header\" [context]=\"context\">\n <h3 class=\"amplify-heading amplify-heading--3\">{{ this.headerText }}</h3>\n </amplify-slot>\n\n <div\n *ngFor=\"\n let unverifiedContactMethod of unverifiedContactMethods | keyvalue\n \"\n >\n <input\n name=\"unverifiedAttr\"\n type=\"radio\"\n [value]=\"unverifiedContactMethod.key\"\n [id]=\"labelId\"\n />\n <label [for]=\"labelId\">{{ getLabel(unverifiedContactMethod.key) }}</label>\n </div>\n\n <button\n amplify-button\n variation=\"primary\"\n fullWidth=\"true\"\n type=\"submit\"\n [isDisabled]=\"authenticator.isPending\"\n >\n {{ verifyText }}\n </button>\n\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n (click)=\"authenticator.skipVerification()\"\n >\n {{ skipText }}\n </button>\n\n <amplify-error *ngIf=\"authenticator.error\">\n {{ authenticator.error }}\n </amplify-error>\n </fieldset>\n <amplify-slot name=\"verify-user-footer\" [context]=\"context\"> </amplify-slot>\n</form>\n", components: [{ type: AmplifySlotComponent, selector: "amplify-slot", inputs: ["name", "context"] }, { type: ButtonComponent, selector: "button[amplify-button]", inputs: ["type", "fullWidth", "isDisabled", "size", "variation", "fontWeight"] }, { type: ErrorComponent, selector: "amplify-error" }], directives: [{ type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "keyvalue": i6.KeyValuePipe }, encapsulation: i0.ViewEncapsulation.None });
1178
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: VerifyUserComponent, decorators: [{
1179
- type: Component,
1180
- args: [{
1181
- selector: 'amplify-verify-user',
1182
- templateUrl: './verify-user.component.html',
1183
- encapsulation: ViewEncapsulation.None,
1184
- }]
1185
- }], ctorParameters: function () { return [{ type: AuthenticatorService }]; }, propDecorators: { dataAttr: [{
1186
- type: HostBinding,
1187
- args: ['attr.data-amplify-authenticator-verifyuser']
1188
- }], headerText: [{
1189
- type: Input
1190
- }] } });
1191
-
1192
- const { getAccountRecoveryInfoText, getSkipText, getSubmitText } = authenticatorTextUtil;
1193
- class ConfirmVerifyUserComponent {
1194
- constructor(authenticator) {
1195
- this.authenticator = authenticator;
1196
- this.dataAttr = '';
1197
- this.headerText = getAccountRecoveryInfoText();
1198
- // translated texts
1199
- this.skipText = getSkipText();
1200
- this.submitText = getSubmitText();
1201
- }
1202
- get context() {
1203
- return this.authenticator.slotContext;
1204
- }
1205
- onInput(event) {
1206
- event.preventDefault();
1207
- const { name, value } = event.target;
1208
- this.authenticator.updateForm({ name, value });
1209
- }
1210
- onSubmit(event) {
1211
- event.preventDefault();
1212
- this.authenticator.submitForm(getFormDataFromEvent(event));
1213
- }
1214
- }
1215
- ConfirmVerifyUserComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ConfirmVerifyUserComponent, deps: [{ token: AuthenticatorService }], target: i0.ɵɵFactoryTarget.Component });
1216
- ConfirmVerifyUserComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: ConfirmVerifyUserComponent, selector: "amplify-confirm-verify-user", inputs: { headerText: "headerText" }, host: { properties: { "attr.data-amplify-authenticator-confirmverifyuser": "this.dataAttr" } }, ngImport: i0, template: "<form data-amplify-form (input)=\"onInput($event)\" (submit)=\"onSubmit($event)\">\n <fieldset\n class=\"amplify-flex amplify-authenticator__column\"\n data-amplify-fieldset\n [disabled]=\"authenticator.isPending\"\n >\n <amplify-slot name=\"confirm-verify-user-header\" [context]=\"context\">\n <h3 class=\"amplify-heading amplify-heading--3\">{{ this.headerText }}</h3>\n </amplify-slot>\n <amplify-base-form-fields\n route=\"confirmVerifyUser\"\n ></amplify-base-form-fields>\n <button\n amplify-button\n variation=\"primary\"\n fullWidth=\"true\"\n type=\"submit\"\n [isDisabled]=\"authenticator.isPending\"\n >\n {{ submitText }}\n </button>\n\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n (click)=\"authenticator.skipVerification()\"\n >\n {{ skipText }}\n </button>\n <amplify-error *ngIf=\"authenticator.error\">\n {{ authenticator.error }}\n </amplify-error>\n </fieldset>\n <amplify-slot name=\"confirm-verify-user-footer\" [context]=\"context\">\n </amplify-slot>\n</form>\n", components: [{ type: AmplifySlotComponent, selector: "amplify-slot", inputs: ["name", "context"] }, { type: BaseFormFieldsComponent, selector: "amplify-base-form-fields", inputs: ["route"] }, { type: ButtonComponent, selector: "button[amplify-button]", inputs: ["type", "fullWidth", "isDisabled", "size", "variation", "fontWeight"] }, { type: ErrorComponent, selector: "amplify-error" }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
1217
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ConfirmVerifyUserComponent, decorators: [{
1218
- type: Component,
1219
- args: [{
1220
- selector: 'amplify-confirm-verify-user',
1221
- templateUrl: './amplify-confirm-verify-user.component.html',
1222
- }]
1223
- }], ctorParameters: function () { return [{ type: AuthenticatorService }]; }, propDecorators: { dataAttr: [{
1224
- type: HostBinding,
1225
- args: ['attr.data-amplify-authenticator-confirmverifyuser']
1226
- }], headerText: [{
1227
- type: Input
1228
- }] } });
1229
-
1230
- const { getSignInTabText, getSignUpTabText } = authenticatorTextUtil;
1231
- class AuthenticatorComponent {
1232
- constructor(authenticator, contextService, changeDetector) {
1233
- this.authenticator = authenticator;
1234
- this.contextService = contextService;
1235
- this.changeDetector = changeDetector;
1236
- this.customComponentQuery = null;
1237
- // translated texts
1238
- this.signInTitle = getSignInTabText();
1239
- this.signUpTitle = getSignUpTabText();
1240
- this.hasInitialized = false;
1241
- this.isHandlingHubEvent = false;
1242
- }
1243
- // context passed to "authenticated" slot
1244
- get context() {
1245
- return this.authenticator.slotContext;
1246
- }
1247
- get route() {
1248
- return this.authenticator.route;
1249
- }
1250
- ngOnInit() {
1251
- const { initialState, loginMechanisms, services, signUpAttributes, socialProviders, formFields, } = this;
1252
- configureComponent({
1253
- packageName: '@aws-amplify/ui-angular',
1254
- version: VERSION,
1255
- });
1256
- const { initializeMachine } = this.authenticator;
1257
- this.authenticator.hubSubject.subscribe(() => {
1258
- /*
1259
- * Hub events aren't properly caught by Angular, because they are
1260
- * synchronous events. Angular tracks async network events and
1261
- * html events, but not synchronous events like hub.
1262
- *
1263
- * On any notable hub events, we run change detection manually.
1264
- */
1265
- this.changeDetector.detectChanges();
1266
- /*
1267
- * Hub events that we handle can lead to multiple state changes:
1268
- * e.g. `authenticated` -> `signOut` -> initialState.
1269
- *
1270
- * We want to ensure change detection runs all the way, until
1271
- * we reach back to the initial state. Setting the below flag
1272
- * to true to until we reach initial state.
1273
- */
1274
- this.isHandlingHubEvent = true;
1275
- });
1276
- /**
1277
- * Subscribes to state machine changes and sends INIT event
1278
- * once machine reaches 'setup' state.
1279
- */
1280
- this.unsubscribeMachine = this.authenticator.subscribe(() => {
1281
- const { route } = this.authenticator;
1282
- if (this.isHandlingHubEvent) {
1283
- this.changeDetector.detectChanges();
1284
- const initialStateWithDefault = initialState !== null && initialState !== void 0 ? initialState : 'signIn';
1285
- // We can stop manual change detection if we're back to the initial state
1286
- if (route === initialStateWithDefault) {
1287
- this.isHandlingHubEvent = false;
1288
- }
1289
- }
1290
- if (!this.hasInitialized && route === 'setup') {
1291
- initializeMachine({
1292
- initialState,
1293
- loginMechanisms,
1294
- services,
1295
- signUpAttributes,
1296
- socialProviders,
1297
- formFields,
1298
- });
1299
- this.hasInitialized = true;
1300
- }
1301
- }).unsubscribe;
1302
- /**
1303
- * handling translations after content init, because authenticator and its
1304
- * translations might be initialized before the main app's `ngOnInit` is run.
1305
- */
1306
- this.signInTitle = getSignInTabText();
1307
- this.signUpTitle = getSignUpTabText();
1308
- }
1309
- /**
1310
- * Lifecycle Methods
1311
- */
1312
- ngAfterContentInit() {
1313
- this.contextService.customComponents = this.mapCustomComponents(this.customComponentQuery);
1314
- }
1315
- ngOnDestroy() {
1316
- if (this.unsubscribeMachine)
1317
- this.unsubscribeMachine();
1318
- }
1319
- /**
1320
- * Class Functions
1321
- */
1322
- onTabChange() {
1323
- const { route } = this.authenticator;
1324
- if (route === 'signIn') {
1325
- this.authenticator.toSignUp();
1326
- }
1327
- else {
1328
- this.authenticator.toSignIn();
1329
- }
1330
- }
1331
- hasTabs() {
1332
- const { route } = this.authenticator;
1333
- return route === 'signIn' || route === 'signUp';
1334
- }
1335
- hasRouteComponent() {
1336
- const { route } = this.authenticator;
1337
- switch (route) {
1338
- case 'authenticated':
1339
- case 'idle':
1340
- case 'setup':
1341
- case 'signOut':
1342
- case 'transition':
1343
- return false;
1344
- default:
1345
- return true;
1346
- }
1347
- }
1348
- mapCustomComponents(componentQuery) {
1349
- if (!componentQuery)
1350
- return {};
1351
- const customComponents = {};
1352
- componentQuery.forEach((component) => {
1353
- customComponents[component.name] = component.template;
1354
- });
1355
- return customComponents;
1356
- }
1357
- }
1358
- AuthenticatorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AuthenticatorComponent, deps: [{ token: AuthenticatorService }, { token: CustomComponentsService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
1359
- AuthenticatorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: AuthenticatorComponent, selector: "amplify-authenticator", inputs: { formFields: "formFields", initialState: "initialState", loginMechanisms: "loginMechanisms", services: "services", signUpAttributes: "signUpAttributes", socialProviders: "socialProviders", variation: "variation", hideSignUp: "hideSignUp" }, providers: [CustomComponentsService], queries: [{ propertyName: "customComponentQuery", predicate: AmplifySlotDirective }], ngImport: i0, template: "<div\n data-amplify-authenticator\n [attr.data-variation]=\"variation\"\n *ngIf=\"hasRouteComponent()\"\n>\n <div data-amplify-container>\n <amplify-slot name=\"header\" [context]=\"context\"></amplify-slot>\n <div\n data-amplify-router\n [attr.data-amplify-router-content]=\"hasTabs() ? undefined : ''\"\n >\n <amplify-tabs\n (tabChange)=\"onTabChange()\"\n *ngIf=\"(route === 'signIn' || route === 'signUp') && !hideSignUp\"\n >\n <amplify-tab-item\n [title]=\"signInTitle\"\n [active]=\"route === 'signIn'\"\n data-amplify-router-content\n >\n <!-- signIn component -->\n <amplify-slot\n name=\"sign-in\"\n [context]=\"context\"\n *ngIf=\"route === 'signIn'\"\n >\n <amplify-sign-in></amplify-sign-in>\n </amplify-slot>\n </amplify-tab-item>\n <amplify-tab-item\n [title]=\"signUpTitle\"\n [active]=\"route === 'signUp'\"\n data-amplify-router-content\n >\n <!-- signUp component -->\n <amplify-slot\n name=\"sign-up\"\n [context]=\"context\"\n *ngIf=\"route === 'signUp'\"\n >\n <amplify-sign-up></amplify-sign-up>\n </amplify-slot>\n </amplify-tab-item>\n </amplify-tabs>\n\n <amplify-slot\n name=\"sign-in\"\n [context]=\"context\"\n *ngIf=\"route === 'signIn' && hideSignUp\"\n >\n <amplify-sign-in></amplify-sign-in>\n </amplify-slot>\n\n <!-- confirmSignUp content -->\n <amplify-slot\n name=\"confirm-sign-up\"\n [context]=\"context\"\n *ngIf=\"route === 'confirmSignUp'\"\n >\n <amplify-confirm-sign-up></amplify-confirm-sign-up>\n </amplify-slot>\n\n <!-- confirmSignIn content -->\n <amplify-slot\n name=\"confirm-sign-in\"\n [context]=\"context\"\n *ngIf=\"route === 'confirmSignIn'\"\n >\n <amplify-confirm-sign-in></amplify-confirm-sign-in>\n </amplify-slot>\n\n <!-- setupTotp content -->\n <amplify-slot\n name=\"setup-totp\"\n [context]=\"context\"\n *ngIf=\"route === 'setupTOTP'\"\n >\n <amplify-setup-totp></amplify-setup-totp>\n </amplify-slot>\n\n <!-- forceNewPassword content -->\n <amplify-slot\n name=\"force-new-password\"\n [context]=\"context\"\n *ngIf=\"route === 'forceNewPassword'\"\n >\n <amplify-force-new-password></amplify-force-new-password>\n </amplify-slot>\n\n <!-- resetPassword content -->\n <amplify-slot\n name=\"reset-password\"\n [context]=\"context\"\n *ngIf=\"route === 'resetPassword'\"\n >\n <amplify-reset-password></amplify-reset-password>\n </amplify-slot>\n\n <!-- confirmResetPassword content -->\n <amplify-slot\n name=\"confirm-reset-password\"\n [context]=\"context\"\n *ngIf=\"route === 'confirmResetPassword'\"\n >\n <amplify-confirm-reset-password></amplify-confirm-reset-password>\n </amplify-slot>\n\n <!-- verifyUser content -->\n <amplify-slot\n name=\"verify-user\"\n [context]=\"context\"\n *ngIf=\"route === 'verifyUser'\"\n >\n <amplify-verify-user></amplify-verify-user>\n </amplify-slot>\n\n <!-- confirmVerifyUser content -->\n <amplify-slot\n name=\"confirm-verify-user\"\n [context]=\"context\"\n *ngIf=\"route === 'confirmVerifyUser'\"\n >\n <amplify-confirm-verify-user></amplify-confirm-verify-user>\n </amplify-slot>\n </div>\n\n <amplify-slot name=\"footer\" [context]=\"context\"></amplify-slot>\n </div>\n</div>\n\n<!-- signedIn content is rendered outside authenticator so it's not styled by authenticator -->\n<amplify-slot\n name=\"authenticated\"\n [context]=\"context\"\n *ngIf=\"route === 'authenticated'\"\n>\n <ng-content></ng-content>\n</amplify-slot>\n", components: [{ type: AmplifySlotComponent, selector: "amplify-slot", inputs: ["name", "context"] }, { type: TabsComponent, selector: "amplify-tabs", outputs: ["tabChange"] }, { type: TabItemComponent, selector: "amplify-tab-item", inputs: ["title", "active", "id", "labelledById", "tabIndex"] }, { type: SignInComponent, selector: "amplify-sign-in" }, { type: SignUpComponent, selector: "amplify-sign-up" }, { type: ConfirmSignUpComponent, selector: "amplify-confirm-sign-up" }, { type: ConfirmSignInComponent, selector: "amplify-confirm-sign-in" }, { type: SetupTotpComponent, selector: "amplify-setup-totp" }, { type: ForceNewPasswordComponent, selector: "amplify-force-new-password", inputs: ["headerText"] }, { type: ResetPasswordComponent, selector: "amplify-reset-password", inputs: ["headerText"] }, { type: ConfirmResetPasswordComponent, selector: "amplify-confirm-reset-password", inputs: ["headerText"] }, { type: VerifyUserComponent, selector: "amplify-verify-user", inputs: ["headerText"] }, { type: ConfirmVerifyUserComponent, selector: "amplify-confirm-verify-user", inputs: ["headerText"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], encapsulation: i0.ViewEncapsulation.None });
1360
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AuthenticatorComponent, decorators: [{
1361
- type: Component,
1362
- args: [{
1363
- selector: 'amplify-authenticator',
1364
- templateUrl: './authenticator.component.html',
1365
- providers: [CustomComponentsService],
1366
- encapsulation: ViewEncapsulation.None,
1367
- }]
1368
- }], ctorParameters: function () { return [{ type: AuthenticatorService }, { type: CustomComponentsService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { formFields: [{
1369
- type: Input
1370
- }], initialState: [{
1371
- type: Input
1372
- }], loginMechanisms: [{
1373
- type: Input
1374
- }], services: [{
1375
- type: Input
1376
- }], signUpAttributes: [{
1377
- type: Input
1378
- }], socialProviders: [{
1379
- type: Input
1380
- }], variation: [{
1381
- type: Input
1382
- }], hideSignUp: [{
1383
- type: Input
1384
- }], customComponentQuery: [{
1385
- type: ContentChildren,
1386
- args: [AmplifySlotDirective]
1387
- }] } });
1388
-
1389
- class CheckboxComponent {
1390
- constructor() {
1391
- this.defaultChecked = false;
1392
- this.hasError = false;
1393
- this.isChecked = false;
1394
- }
1395
- ngOnInit() {
1396
- if (this.defaultChecked) {
1397
- this.isChecked = true;
1398
- }
1399
- }
1400
- handleClick() {
1401
- this.isChecked = !this.isChecked;
1402
- }
1403
- }
1404
- CheckboxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CheckboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1405
- CheckboxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: CheckboxComponent, selector: "amplify-checkbox", inputs: { defaultChecked: "defaultChecked", errorMessage: "errorMessage", hasError: "hasError", label: "label", name: "name", value: "value" }, ngImport: i0, template: "<div class=\"amplify-flex amplify-field amplify-checkboxfield\">\n <label class=\"amplify-flex amplify-checkbox\">\n <span class=\"amplify-visually-hidden\">\n <input\n (click)=\"handleClick()\"\n class=\"\n amplify-input\n amplify-field-group__control\n amplify-checkbox__input\n \"\n aria-invalid=\"false\"\n type=\"checkbox\"\n [name]=\"name\"\n [value]=\"value\"\n />\n </span>\n <span\n class=\"amplify-flex amplify-checkbox__button\"\n aria-hidden=\"true\"\n data-focus=\"false\"\n [ngClass]=\"{\n 'amplify-checkbox__button--error': hasError\n }\"\n [attr.data-error]=\"hasError\"\n [attr.data-checked]=\"isChecked\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"amplify-icon amplify-checkbox__icon\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n [attr.data-checked]=\"isChecked\"\n [ngClass]=\"{\n 'amplify-checkbox__icon--checked': isChecked\n }\"\n >\n <path d=\"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z\"></path>\n </svg>\n </span>\n <span class=\"amplify-text amplify-checkbox__label\">\n <ng-content></ng-content>\n </span>\n </label>\n <p *ngIf=\"hasError\" class=\"amplify-text amplify-field__error-message\">\n {{ errorMessage }}\n </p>\n</div>\n", directives: [{ type: i6.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
1406
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CheckboxComponent, decorators: [{
1407
- type: Component,
1408
- args: [{
1409
- selector: 'amplify-checkbox',
1410
- templateUrl: './checkbox.component.html',
1411
- }]
1412
- }], propDecorators: { defaultChecked: [{
1413
- type: Input
1414
- }], errorMessage: [{
1415
- type: Input
1416
- }], hasError: [{
1417
- type: Input
1418
- }], label: [{
1419
- type: Input
1420
- }], name: [{
1421
- type: Input
1422
- }], value: [{
1423
- type: Input
1424
- }] } });
1425
-
1426
- class AmplifyAuthenticatorModule {
1427
- }
1428
- AmplifyAuthenticatorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AmplifyAuthenticatorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1429
- AmplifyAuthenticatorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AmplifyAuthenticatorModule, declarations: [AmplifySlotComponent,
1430
- AmplifySlotDirective,
1431
- AuthenticatorComponent,
1432
- BaseFormFieldsComponent,
1433
- ButtonComponent,
1434
- CheckboxComponent,
1435
- ConfirmResetPasswordComponent,
1436
- ConfirmSignInComponent,
1437
- ConfirmSignUpComponent,
1438
- ConfirmVerifyUserComponent,
1439
- ErrorComponent,
1440
- FederatedSignInButtonComponent,
1441
- FederatedSignInComponent,
1442
- ForceNewPasswordComponent,
1443
- ForceNewPasswordFormFieldsComponent,
1444
- FormFieldComponent,
1445
- PasswordFieldComponent,
1446
- PhoneNumberFieldComponent,
1447
- ResetPasswordComponent,
1448
- SelectComponent,
1449
- SetupTotpComponent,
1450
- SignInComponent,
1451
- SignUpComponent,
1452
- SignUpFormFieldsComponent,
1453
- TabItemComponent,
1454
- TabsComponent,
1455
- TextFieldComponent,
1456
- VerifyUserComponent], imports: [CommonModule], exports: [AmplifySlotDirective,
1457
- AuthenticatorComponent,
1458
- CheckboxComponent,
1459
- SignUpFormFieldsComponent,
1460
- ForceNewPasswordFormFieldsComponent,
1461
- TextFieldComponent] });
1462
- AmplifyAuthenticatorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AmplifyAuthenticatorModule, imports: [[CommonModule]] });
1463
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AmplifyAuthenticatorModule, decorators: [{
1464
- type: NgModule,
1465
- args: [{
1466
- declarations: [
1467
- AmplifySlotComponent,
1468
- AmplifySlotDirective,
1469
- AuthenticatorComponent,
1470
- BaseFormFieldsComponent,
1471
- ButtonComponent,
1472
- CheckboxComponent,
1473
- ConfirmResetPasswordComponent,
1474
- ConfirmSignInComponent,
1475
- ConfirmSignUpComponent,
1476
- ConfirmVerifyUserComponent,
1477
- ErrorComponent,
1478
- FederatedSignInButtonComponent,
1479
- FederatedSignInComponent,
1480
- ForceNewPasswordComponent,
1481
- ForceNewPasswordFormFieldsComponent,
1482
- FormFieldComponent,
1483
- PasswordFieldComponent,
1484
- PhoneNumberFieldComponent,
1485
- ResetPasswordComponent,
1486
- SelectComponent,
1487
- SetupTotpComponent,
1488
- SignInComponent,
1489
- SignUpComponent,
1490
- SignUpFormFieldsComponent,
1491
- TabItemComponent,
1492
- TabsComponent,
1493
- TextFieldComponent,
1494
- VerifyUserComponent,
1495
- ],
1496
- imports: [CommonModule],
1497
- exports: [
1498
- AmplifySlotDirective,
1499
- AuthenticatorComponent,
1500
- CheckboxComponent,
1501
- SignUpFormFieldsComponent,
1502
- ForceNewPasswordFormFieldsComponent,
1503
- TextFieldComponent,
1504
- ],
1505
- }]
1506
- }] });
1507
-
1508
- /*
1509
- * Public API Surface of ui-angular
1510
- */
1511
-
1512
- /**
1513
- * Generated bundle index. Do not edit.
1514
- */
1515
-
1516
- export { AmplifyAuthenticatorModule, AmplifySlotDirective, AuthenticatorComponent, AuthenticatorService, BaseFormFieldsComponent, ButtonComponent, CheckboxComponent, ConfirmResetPasswordComponent, ConfirmSignInComponent, ConfirmSignUpComponent, ConfirmVerifyUserComponent, CustomComponentsService, ErrorComponent, FederatedSignInButtonComponent, FederatedSignInComponent, ForceNewPasswordComponent, ForceNewPasswordFormFieldsComponent, FormFieldComponent, PasswordFieldComponent, PhoneNumberFieldComponent, ResetPasswordComponent, SelectComponent, SetupTotpComponent, SignInComponent, SignUpComponent, SignUpFormFieldsComponent, TabItemComponent, TabsComponent, TextFieldComponent, VerifyUserComponent, getAttributeMap };
1517
- //# sourceMappingURL=aws-amplify-ui-angular.js.map