@aws-amplify/ui-angular 2.0.1-next.6 → 2.0.4

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 (139) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +28 -0
  3. package/aws-amplify-ui-angular.d.ts +26 -24
  4. package/aws-amplify-ui-angular.metadata.json +1 -1
  5. package/bundles/aws-amplify-ui-angular-legacy.umd.js +2229 -0
  6. package/bundles/aws-amplify-ui-angular-legacy.umd.js.map +1 -0
  7. package/bundles/aws-amplify-ui-angular-legacy.umd.min.js +16 -0
  8. package/bundles/aws-amplify-ui-angular-legacy.umd.min.js.map +1 -0
  9. package/bundles/aws-amplify-ui-angular.umd.js +931 -2858
  10. package/bundles/aws-amplify-ui-angular.umd.js.map +1 -1
  11. package/bundles/aws-amplify-ui-angular.umd.min.js +1 -1
  12. package/bundles/aws-amplify-ui-angular.umd.min.js.map +1 -1
  13. package/esm2015/aws-amplify-ui-angular.js +27 -25
  14. package/esm2015/index.js +22 -8
  15. package/esm2015/legacy/aws-amplify-ui-angular-legacy.js +6 -0
  16. package/esm2015/legacy/index.js +3 -0
  17. package/esm2015/legacy/legacy-ui-angular.module.js +53 -0
  18. package/esm2015/legacy/proxies.js +1839 -0
  19. package/esm2015/lib/common/types/auth-types.js +1 -1
  20. package/esm2015/lib/components/authenticator/authenticator.module.js +78 -0
  21. package/esm2015/lib/components/authenticator/components/authenticator/authenticator.component.js +91 -0
  22. package/esm2015/lib/components/authenticator/components/confirm-reset-password/amplify-confirm-reset-password.component.js +40 -0
  23. package/esm2015/lib/components/authenticator/components/confirm-sign-in/confirm-sign-in.component.js +57 -0
  24. package/esm2015/lib/components/authenticator/components/confirm-sign-up/confirm-sign-up.component.js +55 -0
  25. package/esm2015/lib/components/authenticator/components/confirm-verify-user/amplify-confirm-verify-user.component.js +39 -0
  26. package/esm2015/lib/components/authenticator/components/federated-sign-in/federated-sign-in.component.js +47 -0
  27. package/esm2015/lib/components/authenticator/components/federated-sign-in-button/federated-sign-in-button.component.js +27 -0
  28. package/esm2015/lib/components/authenticator/components/force-new-password/force-new-password.component.js +39 -0
  29. package/esm2015/lib/components/authenticator/components/form-field/form-field.component.js +97 -0
  30. package/esm2015/lib/components/authenticator/components/index.js +17 -0
  31. package/esm2015/lib/components/authenticator/components/reset-password/reset-password.component.js +45 -0
  32. package/esm2015/lib/components/authenticator/components/setup-totp/setup-totp.component.js +65 -0
  33. package/esm2015/lib/components/authenticator/components/sign-in/sign-in.component.js +38 -0
  34. package/esm2015/lib/components/authenticator/components/sign-up/sign-up-form-fields/sign-up-form-fields.component.js +34 -0
  35. package/esm2015/lib/components/authenticator/components/sign-up/sign-up.component.js +37 -0
  36. package/esm2015/lib/components/authenticator/components/user-name-alias/user-name-alias.component.js +35 -0
  37. package/esm2015/lib/components/authenticator/components/verify-user/verify-user.component.js +54 -0
  38. package/esm2015/lib/primitives/button/button.component.js +38 -0
  39. package/esm2015/lib/primitives/checkbox/checkbox.component.js +31 -0
  40. package/esm2015/lib/primitives/error/error.component.js +16 -0
  41. package/esm2015/lib/primitives/index.js +10 -3
  42. package/esm2015/lib/primitives/password-field/password-field.component.js +45 -0
  43. package/esm2015/lib/primitives/phone-number-field/phone-number-field.component.js +11 -4
  44. package/esm2015/lib/primitives/{amplify-select/amplify-select.component.js → select/select.component.js} +4 -4
  45. package/esm2015/lib/primitives/tab-item/tab-item.component.js +5 -3
  46. package/esm2015/lib/primitives/tabs/tabs.component.js +2 -2
  47. package/esm2015/lib/primitives/text-field/text-field.component.js +35 -0
  48. package/esm2015/lib/services/authenticator.service.js +141 -0
  49. package/esm2015/lib/services/custom-components.service.js +23 -0
  50. package/esm2015/lib/utilities/amplify-slot/amplify-slot.component.js +32 -0
  51. package/esm2015/lib/utilities/amplify-slot/amplify-slot.directive.js +21 -0
  52. package/fesm2015/aws-amplify-ui-angular-legacy.js +1846 -0
  53. package/fesm2015/aws-amplify-ui-angular-legacy.js.map +1 -0
  54. package/fesm2015/aws-amplify-ui-angular.js +695 -2617
  55. package/fesm2015/aws-amplify-ui-angular.js.map +1 -1
  56. package/index.d.ts +21 -7
  57. package/legacy/aws-amplify-ui-angular-legacy.d.ts +5 -0
  58. package/legacy/aws-amplify-ui-angular-legacy.metadata.json +1 -0
  59. package/legacy/index.d.ts +2 -0
  60. package/legacy/legacy-ui-angular.module.d.ts +2 -0
  61. package/legacy/package.json +11 -0
  62. package/{lib → legacy}/proxies.d.ts +0 -0
  63. package/lib/common/types/auth-types.d.ts +2 -5
  64. package/lib/components/authenticator/authenticator.module.d.ts +2 -0
  65. package/lib/components/authenticator/components/authenticator/authenticator.component.d.ts +73 -0
  66. package/lib/components/authenticator/components/confirm-reset-password/amplify-confirm-reset-password.component.d.ts +55 -0
  67. package/lib/components/authenticator/components/confirm-sign-in/confirm-sign-in.component.d.ts +57 -0
  68. package/lib/components/authenticator/components/confirm-sign-up/confirm-sign-up.component.d.ts +56 -0
  69. package/lib/components/authenticator/components/confirm-verify-user/amplify-confirm-verify-user.component.d.ts +54 -0
  70. package/lib/components/{amplify-federated-sign-in/amplify-federated-sign-in.component.d.ts → authenticator/components/federated-sign-in/federated-sign-in.component.d.ts} +9 -6
  71. package/lib/components/authenticator/components/federated-sign-in-button/federated-sign-in-button.component.d.ts +9 -0
  72. package/lib/components/authenticator/components/force-new-password/force-new-password.component.d.ts +54 -0
  73. package/lib/{primitives/amplify-form-field/amplify-form-field.component.d.ts → components/authenticator/components/form-field/form-field.component.d.ts} +7 -4
  74. package/lib/components/authenticator/components/index.d.ts +16 -0
  75. package/lib/components/authenticator/components/reset-password/reset-password.component.d.ts +57 -0
  76. package/lib/components/authenticator/components/setup-totp/setup-totp.component.d.ts +58 -0
  77. package/lib/components/authenticator/components/sign-in/sign-in.component.d.ts +53 -0
  78. package/lib/components/authenticator/components/sign-up/sign-up-form-fields/sign-up-form-fields.component.d.ts +12 -0
  79. package/lib/components/authenticator/components/sign-up/sign-up.component.d.ts +52 -0
  80. package/lib/{primitives/amplify-user-name-alias/amplify-user-name-alias.component.d.ts → components/authenticator/components/user-name-alias/user-name-alias.component.d.ts} +4 -4
  81. package/lib/components/authenticator/components/verify-user/verify-user.component.d.ts +59 -0
  82. package/lib/primitives/{amplify-button/amplify-button.component.d.ts → button/button.component.d.ts} +1 -1
  83. package/lib/primitives/checkbox/checkbox.component.d.ts +12 -0
  84. package/lib/primitives/error/error.component.d.ts +4 -0
  85. package/lib/primitives/index.d.ts +9 -2
  86. package/lib/primitives/{amplify-password-field/amplify-password-field.component.d.ts → password-field/password-field.component.d.ts} +5 -2
  87. package/lib/primitives/phone-number-field/phone-number-field.component.d.ts +2 -0
  88. package/lib/primitives/{amplify-select/amplify-select.component.d.ts → select/select.component.d.ts} +1 -1
  89. package/lib/primitives/tab-item/tab-item.component.d.ts +1 -0
  90. package/lib/primitives/{amplify-text-field/amplify-text-field.component.d.ts → text-field/text-field.component.d.ts} +4 -2
  91. package/lib/services/authenticator.service.d.ts +101 -0
  92. package/lib/services/custom-components.service.d.ts +9 -0
  93. package/lib/utilities/amplify-slot/amplify-slot.component.d.ts +12 -0
  94. package/lib/{directives → utilities/amplify-slot}/amplify-slot.directive.d.ts +0 -0
  95. package/package.json +3 -4
  96. package/theme.css +0 -1
  97. package/esm2015/lib/components/amplify-authenticator/amplify-authenticator.component.js +0 -85
  98. package/esm2015/lib/components/amplify-confirm-sign-in/amplify-confirm-sign-in.component.js +0 -91
  99. package/esm2015/lib/components/amplify-confirm-sign-up/amplify-confirm-sign-up.component.js +0 -83
  100. package/esm2015/lib/components/amplify-federated-sign-in/amplify-federated-sign-in.component.js +0 -37
  101. package/esm2015/lib/components/amplify-federated-sign-in-button/amplify-federated-sign-in-button.component.js +0 -27
  102. package/esm2015/lib/components/amplify-force-new-password/amplify-force-new-password.component.js +0 -83
  103. package/esm2015/lib/components/amplify-reset-password/amplify-reset-password.component.js +0 -68
  104. package/esm2015/lib/components/amplify-setup-totp/amplify-setup-totp.component.js +0 -100
  105. package/esm2015/lib/components/amplify-sign-in/amplify-sign-in.component.js +0 -78
  106. package/esm2015/lib/components/amplify-sign-up/amplify-sign-up.component.js +0 -97
  107. package/esm2015/lib/components/amplify-verify-user/amplify-verify-user.component.js +0 -78
  108. package/esm2015/lib/components/confirm-reset-password/amplify-confirm-reset-password.component.js +0 -76
  109. package/esm2015/lib/components/confirm-verify-user/amplify-confirm-verify-user.component.js +0 -66
  110. package/esm2015/lib/components/index.js +0 -14
  111. package/esm2015/lib/directives/amplify-slot.directive.js +0 -21
  112. package/esm2015/lib/primitives/amplify-button/amplify-button.component.js +0 -38
  113. package/esm2015/lib/primitives/amplify-error/amplify-error.component.js +0 -10
  114. package/esm2015/lib/primitives/amplify-form-field/amplify-form-field.component.js +0 -91
  115. package/esm2015/lib/primitives/amplify-password-field/amplify-password-field.component.js +0 -39
  116. package/esm2015/lib/primitives/amplify-text-field/amplify-text-field.component.js +0 -29
  117. package/esm2015/lib/primitives/amplify-user-name-alias/amplify-user-name-alias.component.js +0 -35
  118. package/esm2015/lib/proxies.js +0 -1839
  119. package/esm2015/lib/services/authenticator-context.service.js +0 -28
  120. package/esm2015/lib/services/state-machine.service.js +0 -51
  121. package/esm2015/lib/ui-angular.module.js +0 -103
  122. package/lib/components/amplify-authenticator/amplify-authenticator.component.d.ts +0 -35
  123. package/lib/components/amplify-confirm-sign-in/amplify-confirm-sign-in.component.d.ts +0 -31
  124. package/lib/components/amplify-confirm-sign-up/amplify-confirm-sign-up.component.d.ts +0 -34
  125. package/lib/components/amplify-federated-sign-in-button/amplify-federated-sign-in-button.component.d.ts +0 -9
  126. package/lib/components/amplify-force-new-password/amplify-force-new-password.component.d.ts +0 -31
  127. package/lib/components/amplify-reset-password/amplify-reset-password.component.d.ts +0 -30
  128. package/lib/components/amplify-setup-totp/amplify-setup-totp.component.d.ts +0 -31
  129. package/lib/components/amplify-sign-in/amplify-sign-in.component.d.ts +0 -32
  130. package/lib/components/amplify-sign-up/amplify-sign-up.component.d.ts +0 -32
  131. package/lib/components/amplify-verify-user/amplify-verify-user.component.d.ts +0 -32
  132. package/lib/components/confirm-reset-password/amplify-confirm-reset-password.component.d.ts +0 -34
  133. package/lib/components/confirm-verify-user/amplify-confirm-verify-user.component.d.ts +0 -28
  134. package/lib/components/index.d.ts +0 -13
  135. package/lib/primitives/amplify-error/amplify-error.component.d.ts +0 -2
  136. package/lib/services/authenticator-context.service.d.ts +0 -10
  137. package/lib/services/state-machine.service.d.ts +0 -29
  138. package/lib/ui-angular.module.d.ts +0 -2
  139. package/styles/component.css +0 -169
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@aws-amplify/ui'), require('aws-amplify'), require('xstate'), require('qrcode'), require('lodash'), require('nanoid'), require('rxjs'), require('@aws-amplify/ui-components/dist/components')) :
3
- typeof define === 'function' && define.amd ? define('@aws-amplify/ui-angular', ['exports', '@angular/core', '@angular/common', '@aws-amplify/ui', 'aws-amplify', 'xstate', 'qrcode', 'lodash', 'nanoid', 'rxjs', '@aws-amplify/ui-components/dist/components'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global["aws-amplify"] = global["aws-amplify"] || {}, global["aws-amplify"]["ui-angular"] = {}), global.ng.core, global.ng.common, global.ui, global["aws-amplify"], global.xstate, global.QRCode, global.lodash, global.nanoid, global.rxjs, global.components));
5
- })(this, (function (exports, i0, common, ui, awsAmplify, xstate, QRCode, lodash, nanoid, rxjs, components) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@aws-amplify/ui'), require('@aws-amplify/core'), require('xstate'), require('aws-amplify'), require('qrcode'), require('nanoid')) :
3
+ typeof define === 'function' && define.amd ? define('@aws-amplify/ui-angular', ['exports', '@angular/core', '@angular/common', '@aws-amplify/ui', '@aws-amplify/core', 'xstate', 'aws-amplify', 'qrcode', 'nanoid'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global["aws-amplify"] = global["aws-amplify"] || {}, global["aws-amplify"]["ui-angular"] = {}), global.ng.core, global.ng.common, global.ui, global.core, global.xstate, global["aws-amplify"], global.QRCode, global.nanoid));
5
+ })(this, (function (exports, i0, common, ui, core, xstate, awsAmplify, QRCode, nanoid) { 'use strict';
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
@@ -52,12 +52,14 @@
52
52
  amplifySlot: [{ type: i0.Input }]
53
53
  };
54
54
 
55
- var AuthPropService = /** @class */ (function () {
56
- function AuthPropService() {
55
+ /**
56
+ * Stores and provides custom components that users provide with `amplify-slot`.
57
+ */
58
+ var CustomComponentsService = /** @class */ (function () {
59
+ function CustomComponentsService() {
57
60
  this._customComponents = {};
58
- this._props = {};
59
61
  }
60
- Object.defineProperty(AuthPropService.prototype, "customComponents", {
62
+ Object.defineProperty(CustomComponentsService.prototype, "customComponents", {
61
63
  get: function () {
62
64
  return this._customComponents;
63
65
  },
@@ -67,162 +69,302 @@
67
69
  enumerable: false,
68
70
  configurable: true
69
71
  });
70
- Object.defineProperty(AuthPropService.prototype, "props", {
71
- get: function () {
72
- return this._props;
73
- },
74
- set: function (props) {
75
- this._props = Object.assign(Object.assign({}, this._props), props);
76
- },
77
- enumerable: false,
78
- configurable: true
79
- });
80
- return AuthPropService;
72
+ return CustomComponentsService;
81
73
  }());
82
- AuthPropService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function AuthPropService_Factory() { return new AuthPropService(); }, token: AuthPropService, providedIn: "root" });
83
- AuthPropService.decorators = [
74
+ CustomComponentsService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function CustomComponentsService_Factory() { return new CustomComponentsService(); }, token: CustomComponentsService, providedIn: "root" });
75
+ CustomComponentsService.decorators = [
84
76
  { type: i0.Injectable, args: [{
85
77
  providedIn: 'root',
86
78
  },] }
87
79
  ];
88
- AuthPropService.ctorParameters = function () { return []; };
89
80
 
81
+ var logger$2 = new core.Logger('state-machine');
90
82
  /**
91
- * AmplifyContextService contains access to the xstate machine
92
- * and custom components passed by the user.
83
+ * AuthenticatorService provides access to the authenticator state and context.
93
84
  */
94
- var StateMachineService = /** @class */ (function () {
95
- function StateMachineService() {
85
+ var AuthenticatorService = /** @class */ (function () {
86
+ function AuthenticatorService() {
96
87
  }
97
- StateMachineService.prototype.startMachine = function (_a) {
88
+ AuthenticatorService.prototype.startMachine = function (_b) {
98
89
  var _this = this;
99
- var initialState = _a.initialState, loginMechanisms = _a.loginMechanisms;
90
+ var initialState = _b.initialState, loginMechanisms = _b.loginMechanisms, services = _b.services, signUpAttributes = _b.signUpAttributes, socialProviders = _b.socialProviders;
100
91
  var machine = ui.createAuthenticatorMachine({
101
92
  initialState: initialState,
102
93
  loginMechanisms: loginMechanisms,
94
+ services: services,
95
+ signUpAttributes: signUpAttributes,
96
+ socialProviders: socialProviders,
103
97
  });
104
98
  var authService = xstate.interpret(machine, {
105
99
  devTools: process.env.NODE_ENV === 'development',
106
- })
107
- .onTransition(function (state) {
108
- _this._user = state.context.user;
100
+ }).start();
101
+ this._subscription = authService.subscribe(function (state) {
109
102
  _this._authState = state;
110
- })
111
- .start();
112
- this._services = ui.getSendEventAliases(authService.send);
103
+ _this._facade = ui.getServiceContextFacade(state);
104
+ });
105
+ this._sendEventAliases = ui.getSendEventAliases(authService.send);
113
106
  this._authService = authService;
114
107
  };
115
- Object.defineProperty(StateMachineService.prototype, "services", {
108
+ AuthenticatorService.prototype.ngOnDestroy = function () {
109
+ if (this._subscription)
110
+ this._subscription.unsubscribe();
111
+ };
112
+ Object.defineProperty(AuthenticatorService.prototype, "error", {
113
+ /**
114
+ * Context facades
115
+ */
116
+ get: function () {
117
+ var _a;
118
+ return ui.translate((_a = this._facade) === null || _a === void 0 ? void 0 : _a.error);
119
+ },
120
+ enumerable: false,
121
+ configurable: true
122
+ });
123
+ Object.defineProperty(AuthenticatorService.prototype, "hasValidationErrors", {
124
+ get: function () {
125
+ var _a;
126
+ return (_a = this._facade) === null || _a === void 0 ? void 0 : _a.hasValidationErrors;
127
+ },
128
+ enumerable: false,
129
+ configurable: true
130
+ });
131
+ Object.defineProperty(AuthenticatorService.prototype, "isPending", {
132
+ get: function () {
133
+ var _a;
134
+ return (_a = this._facade) === null || _a === void 0 ? void 0 : _a.isPending;
135
+ },
136
+ enumerable: false,
137
+ configurable: true
138
+ });
139
+ Object.defineProperty(AuthenticatorService.prototype, "route", {
140
+ get: function () {
141
+ var _a;
142
+ return (_a = this._facade) === null || _a === void 0 ? void 0 : _a.route;
143
+ },
144
+ enumerable: false,
145
+ configurable: true
146
+ });
147
+ Object.defineProperty(AuthenticatorService.prototype, "user", {
148
+ get: function () {
149
+ var _a;
150
+ return (_a = this._facade) === null || _a === void 0 ? void 0 : _a.user;
151
+ },
152
+ enumerable: false,
153
+ configurable: true
154
+ });
155
+ Object.defineProperty(AuthenticatorService.prototype, "validationErrors", {
156
+ get: function () {
157
+ var _a;
158
+ return (_a = this._facade) === null || _a === void 0 ? void 0 : _a.validationErrors;
159
+ },
160
+ enumerable: false,
161
+ configurable: true
162
+ });
163
+ Object.defineProperty(AuthenticatorService.prototype, "codeDeliveryDetails", {
164
+ get: function () {
165
+ var _a;
166
+ return (_a = this._facade) === null || _a === void 0 ? void 0 : _a.codeDeliveryDetails;
167
+ },
168
+ enumerable: false,
169
+ configurable: true
170
+ });
171
+ Object.defineProperty(AuthenticatorService.prototype, "updateForm", {
172
+ /**
173
+ * Service facades
174
+ */
175
+ get: function () {
176
+ return this._sendEventAliases.updateForm;
177
+ },
178
+ enumerable: false,
179
+ configurable: true
180
+ });
181
+ Object.defineProperty(AuthenticatorService.prototype, "updateBlur", {
182
+ get: function () {
183
+ return this._sendEventAliases.updateBlur;
184
+ },
185
+ enumerable: false,
186
+ configurable: true
187
+ });
188
+ Object.defineProperty(AuthenticatorService.prototype, "resendCode", {
189
+ get: function () {
190
+ return this._sendEventAliases.resendCode;
191
+ },
192
+ enumerable: false,
193
+ configurable: true
194
+ });
195
+ Object.defineProperty(AuthenticatorService.prototype, "signOut", {
116
196
  get: function () {
117
- return this._services;
197
+ return this._sendEventAliases.signOut;
118
198
  },
119
199
  enumerable: false,
120
200
  configurable: true
121
201
  });
122
- Object.defineProperty(StateMachineService.prototype, "authState", {
202
+ Object.defineProperty(AuthenticatorService.prototype, "submitForm", {
203
+ get: function () {
204
+ return this._sendEventAliases.submitForm;
205
+ },
206
+ enumerable: false,
207
+ configurable: true
208
+ });
209
+ Object.defineProperty(AuthenticatorService.prototype, "toFederatedSignIn", {
210
+ /**
211
+ * Transition facades
212
+ */
213
+ get: function () {
214
+ return this._sendEventAliases.toFederatedSignIn;
215
+ },
216
+ enumerable: false,
217
+ configurable: true
218
+ });
219
+ Object.defineProperty(AuthenticatorService.prototype, "toResetPassword", {
220
+ get: function () {
221
+ return this._sendEventAliases.toResetPassword;
222
+ },
223
+ enumerable: false,
224
+ configurable: true
225
+ });
226
+ Object.defineProperty(AuthenticatorService.prototype, "toSignIn", {
227
+ get: function () {
228
+ return this._sendEventAliases.toSignIn;
229
+ },
230
+ enumerable: false,
231
+ configurable: true
232
+ });
233
+ Object.defineProperty(AuthenticatorService.prototype, "toSignUp", {
234
+ get: function () {
235
+ return this._sendEventAliases.toSignUp;
236
+ },
237
+ enumerable: false,
238
+ configurable: true
239
+ });
240
+ Object.defineProperty(AuthenticatorService.prototype, "skipVerification", {
241
+ get: function () {
242
+ return this._sendEventAliases.skipVerification;
243
+ },
244
+ enumerable: false,
245
+ configurable: true
246
+ });
247
+ Object.defineProperty(AuthenticatorService.prototype, "authState", {
248
+ /**
249
+ * Internal utility functions
250
+ */
251
+ /** @deprecated For internal use only */
123
252
  get: function () {
124
253
  return this._authState;
125
254
  },
126
255
  enumerable: false,
127
256
  configurable: true
128
257
  });
129
- Object.defineProperty(StateMachineService.prototype, "authService", {
258
+ Object.defineProperty(AuthenticatorService.prototype, "authService", {
259
+ /** @deprecated For internal use only */
130
260
  get: function () {
131
261
  return this._authService;
132
262
  },
133
263
  enumerable: false,
134
264
  configurable: true
135
265
  });
136
- Object.defineProperty(StateMachineService.prototype, "user", {
266
+ Object.defineProperty(AuthenticatorService.prototype, "context", {
267
+ /** @deprecated For internal use only */
137
268
  get: function () {
138
- return this._user;
269
+ return this._authState.context;
139
270
  },
140
271
  enumerable: false,
141
272
  configurable: true
142
273
  });
143
- Object.defineProperty(StateMachineService.prototype, "context", {
274
+ Object.defineProperty(AuthenticatorService.prototype, "slotContext", {
275
+ /** @deprecated For internal use only */
144
276
  get: function () {
145
- return this._authState.context;
277
+ var slotContext = Object.assign(Object.assign({}, this._facade), this._sendEventAliases);
278
+ return Object.assign(Object.assign({}, slotContext), { $implicit: Object.assign({}, slotContext) });
146
279
  },
147
280
  enumerable: false,
148
281
  configurable: true
149
282
  });
150
- StateMachineService.prototype.send = function (event) {
283
+ /** @deprecated For internal use only */
284
+ AuthenticatorService.prototype.subscribe = function (callback) {
285
+ if (this._authService) {
286
+ return this._authService.subscribe(callback);
287
+ }
288
+ else {
289
+ logger$2.error('Subscription attempted before machine was created. This is likely a bug on the library, please consider filing a bug.');
290
+ }
291
+ };
292
+ /** @deprecated For internal use only */
293
+ AuthenticatorService.prototype.send = function (event) {
151
294
  this.authService.send(event);
152
295
  };
153
- return StateMachineService;
296
+ return AuthenticatorService;
154
297
  }());
155
- StateMachineService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function StateMachineService_Factory() { return new StateMachineService(); }, token: StateMachineService, providedIn: "root" });
156
- StateMachineService.decorators = [
298
+ AuthenticatorService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function AuthenticatorService_Factory() { return new AuthenticatorService(); }, token: AuthenticatorService, providedIn: "root" });
299
+ AuthenticatorService.decorators = [
157
300
  { type: i0.Injectable, args: [{
158
301
  providedIn: 'root',
159
302
  },] }
160
303
  ];
161
304
 
162
- var AmplifyAuthenticatorComponent = /** @class */ (function () {
163
- function AmplifyAuthenticatorComponent(stateMachine, contextService) {
164
- this.stateMachine = stateMachine;
305
+ var AuthenticatorComponent = /** @class */ (function () {
306
+ function AuthenticatorComponent(authenticator, contextService) {
307
+ this.authenticator = authenticator;
165
308
  this.contextService = contextService;
166
309
  this.customComponentQuery = null;
167
- this.customComponents = {};
168
310
  // translated texts
169
311
  this.signInTitle = ui.translate('Sign In');
170
312
  this.signUpTitle = ui.translate('Create Account');
171
313
  }
172
- AmplifyAuthenticatorComponent.prototype.ngOnInit = function () {
173
- awsAmplify.I18n.putVocabularies(ui.translations);
174
- var _a = this, initialState = _a.initialState, loginMechanisms = _a.loginMechanisms;
175
- this.stateMachine.startMachine({ initialState: initialState, loginMechanisms: loginMechanisms });
314
+ AuthenticatorComponent.prototype.ngOnInit = function () {
315
+ var _a = this, initialState = _a.initialState, loginMechanisms = _a.loginMechanisms, services = _a.services, signUpAttributes = _a.signUpAttributes, socialProviders = _a.socialProviders;
316
+ this.authenticator.startMachine({
317
+ initialState: initialState,
318
+ loginMechanisms: loginMechanisms,
319
+ services: services,
320
+ signUpAttributes: signUpAttributes,
321
+ socialProviders: socialProviders,
322
+ });
176
323
  /**
177
324
  * handling translations after content init, because authenticator and its
178
325
  * translations might be initialized before the main app's `ngOnInit` is run.
179
- **/
326
+ */
180
327
  this.signInTitle = ui.translate('Sign In');
181
328
  this.signUpTitle = ui.translate('Create Account');
182
329
  };
183
330
  /**
184
331
  * Lifecycle Methods
185
332
  */
186
- AmplifyAuthenticatorComponent.prototype.ngAfterContentInit = function () {
333
+ AuthenticatorComponent.prototype.ngAfterContentInit = function () {
187
334
  this.contextService.customComponents = this.mapCustomComponents(this.customComponentQuery);
188
- this.customComponents = this.contextService.customComponents;
189
335
  };
190
- Object.defineProperty(AmplifyAuthenticatorComponent.prototype, "context", {
336
+ Object.defineProperty(AuthenticatorComponent.prototype, "context", {
191
337
  /**
192
338
  * Class Functions
193
339
  */
340
+ // context passed to "authenticated" slot
194
341
  get: function () {
195
- var signOut = this.stateMachine.services.signOut;
196
- var user = this.stateMachine.user;
197
- return { signOut: signOut, user: user };
198
- },
199
- enumerable: false,
200
- configurable: true
201
- });
202
- Object.defineProperty(AmplifyAuthenticatorComponent.prototype, "actorState", {
203
- get: function () {
204
- return ui.getActorState(this.stateMachine.authState);
342
+ return this.authenticator.slotContext;
205
343
  },
206
344
  enumerable: false,
207
345
  configurable: true
208
346
  });
209
- Object.defineProperty(AmplifyAuthenticatorComponent.prototype, "authenticatorState", {
347
+ Object.defineProperty(AuthenticatorComponent.prototype, "route", {
210
348
  get: function () {
211
- return this.stateMachine.authState;
349
+ return this.authenticator.route;
212
350
  },
213
351
  enumerable: false,
214
352
  configurable: true
215
353
  });
216
- AmplifyAuthenticatorComponent.prototype.onTabChange = function () {
217
- var currentState = this.stateMachine.authState.value;
218
- if (currentState === 'signIn') {
219
- this.stateMachine.send('SIGN_UP');
354
+ AuthenticatorComponent.prototype.onTabChange = function () {
355
+ var route = this.authenticator.route;
356
+ if (route === 'signIn') {
357
+ this.authenticator.toSignUp();
220
358
  }
221
359
  else {
222
- this.stateMachine.send('SIGN_IN');
360
+ this.authenticator.toSignIn();
223
361
  }
224
362
  };
225
- AmplifyAuthenticatorComponent.prototype.mapCustomComponents = function (componentQuery) {
363
+ AuthenticatorComponent.prototype.hasTabs = function () {
364
+ var route = this.authenticator.route;
365
+ return route === 'signIn' || route === 'signUp';
366
+ };
367
+ AuthenticatorComponent.prototype.mapCustomComponents = function (componentQuery) {
226
368
  if (!componentQuery)
227
369
  return {};
228
370
  var customComponents = {};
@@ -231,410 +373,494 @@
231
373
  });
232
374
  return customComponents;
233
375
  };
234
- return AmplifyAuthenticatorComponent;
376
+ return AuthenticatorComponent;
235
377
  }());
236
- AmplifyAuthenticatorComponent.decorators = [
378
+ AuthenticatorComponent.decorators = [
237
379
  { type: i0.Component, args: [{
238
380
  selector: 'amplify-authenticator',
239
- template: "<!-- \n Define default contents here.\n-->\n<ng-template #signIn>\n <amplify-sign-in></amplify-sign-in>\n</ng-template>\n<ng-template #signUp>\n <amplify-sign-up></amplify-sign-up>\n</ng-template>\n<ng-template #confirmSignUp>\n <amplify-confirm-sign-up></amplify-confirm-sign-up>\n</ng-template>\n<ng-template #confirmSignIn>\n <amplify-confirm-sign-in></amplify-confirm-sign-in>\n</ng-template>\n<ng-template #authenticated> <ng-content></ng-content> </ng-template>\n<ng-template #setupTOTP>\n <amplify-setup-totp></amplify-setup-totp>\n</ng-template>\n<ng-template #forceNewPassword>\n <amplify-force-new-password></amplify-force-new-password>\n</ng-template>\n<ng-template #resetPassword>\n <amplify-reset-password></amplify-reset-password>\n</ng-template>\n<ng-template #confirmResetPassword>\n <amplify-confirm-reset-password></amplify-confirm-reset-password>\n</ng-template>\n<ng-template #verifyUser>\n <amplify-verify-user></amplify-verify-user>\n</ng-template>\n<ng-template #confirmVerifyUser>\n <amplify-confirm-verify-user></amplify-confirm-verify-user>\n</ng-template>\n\n<!-- \n Next, we render respective auth subcomponent respective to the current authState.\n If customer is overriding that component, we render customer's template instead.\n-->\n\n<div data-amplify-authenticator>\n <div data-amplify-modal></div>\n\n <div data-amplify-container>\n <amplify-tabs\n (tabChange)=\"onTabChange()\"\n *ngIf=\"actorState?.matches('signIn') || actorState?.matches('signUp')\"\n >\n <amplify-tab-item\n [title]=\"signInTitle\"\n [active]=\"actorState?.matches('signIn')\"\n >\n <!-- signIn component -->\n <ng-container\n [ngTemplateOutlet]=\"customComponents.signIn || signIn\"\n [ngTemplateOutletContext]=\"context\"\n *ngIf=\"actorState?.matches('signIn')\"\n ></ng-container>\n </amplify-tab-item>\n <amplify-tab-item\n [title]=\"signUpTitle\"\n [active]=\"actorState?.matches('signUp')\"\n >\n <!-- signUp component -->\n <ng-container\n [ngTemplateOutlet]=\"customComponents.signUp || signUp\"\n [ngTemplateOutletContext]=\"context\"\n *ngIf=\"actorState?.matches('signUp')\"\n ></ng-container>\n </amplify-tab-item>\n </amplify-tabs>\n\n <!-- confirmSignUp content -->\n <ng-container\n [ngTemplateOutlet]=\"customComponents.confirmSignUp || confirmSignUp\"\n [ngTemplateOutletContext]=\"context\"\n *ngIf=\"actorState?.matches('confirmSignUp')\"\n >\n </ng-container>\n\n <!-- confirmSignIn content -->\n <ng-container\n [ngTemplateOutlet]=\"customComponents.confirmSignIn || confirmSignIn\"\n [ngTemplateOutletContext]=\"context\"\n *ngIf=\"actorState?.matches('confirmSignIn')\"\n >\n </ng-container>\n\n <!-- setupTotp content -->\n <ng-container\n [ngTemplateOutlet]=\"customComponents.setupTOTP || setupTOTP\"\n [ngTemplateOutletContext]=\"context\"\n *ngIf=\"actorState?.matches('setupTOTP')\"\n >\n </ng-container>\n\n <!-- forceNewPassword content -->\n <ng-container\n [ngTemplateOutlet]=\"customComponents.forceNewPassword || forceNewPassword\"\n [ngTemplateOutletContext]=\"context\"\n *ngIf=\"actorState?.matches('forceNewPassword')\"\n >\n </ng-container>\n\n <!-- resetPassword content -->\n <ng-container\n [ngTemplateOutlet]=\"customComponents.resetPassword || resetPassword\"\n [ngTemplateOutletContext]=\"context\"\n *ngIf=\"actorState?.matches('resetPassword')\"\n >\n </ng-container>\n\n <!-- confirmResetPassword content -->\n <ng-container\n [ngTemplateOutlet]=\"\n customComponents.confirmResetPassword || confirmResetPassword\n \"\n [ngTemplateOutletContext]=\"context\"\n *ngIf=\"actorState?.matches('confirmResetPassword')\"\n >\n </ng-container>\n\n <!-- verifyUser content -->\n <ng-container\n [ngTemplateOutlet]=\"customComponents.verifyUser || verifyUser\"\n [ngTemplateOutletContext]=\"context\"\n *ngIf=\"actorState?.matches('verifyUser')\"\n >\n </ng-container>\n\n <!-- confirmVerifyUser content -->\n <ng-container\n [ngTemplateOutlet]=\"\n customComponents.confirmVerifyUser || confirmVerifyUser\n \"\n [ngTemplateOutletContext]=\"context\"\n *ngIf=\"actorState?.matches('confirmVerifyUser')\"\n >\n </ng-container>\n </div>\n</div>\n\n<!-- signedIn content is rendered outside authenticator so it's not styled by authenticator -->\n<ng-container\n [ngTemplateOutlet]=\"customComponents.authenticated || authenticated\"\n [ngTemplateOutletContext]=\"context\"\n *ngIf=\"authenticatorState.matches('authenticated')\"\n>\n</ng-container>\n",
240
- providers: [AuthPropService],
381
+ template: "<div data-amplify-authenticator [attr.data-variation]=\"variation\">\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'\"\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 <!-- 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",
382
+ providers: [CustomComponentsService],
241
383
  encapsulation: i0.ViewEncapsulation.None
242
384
  },] }
243
385
  ];
244
- AmplifyAuthenticatorComponent.ctorParameters = function () { return [
245
- { type: StateMachineService },
246
- { type: AuthPropService }
386
+ AuthenticatorComponent.ctorParameters = function () { return [
387
+ { type: AuthenticatorService },
388
+ { type: CustomComponentsService }
247
389
  ]; };
248
- AmplifyAuthenticatorComponent.propDecorators = {
390
+ AuthenticatorComponent.propDecorators = {
249
391
  initialState: [{ type: i0.Input }],
250
392
  loginMechanisms: [{ type: i0.Input }],
393
+ services: [{ type: i0.Input }],
394
+ signUpAttributes: [{ type: i0.Input }],
395
+ socialProviders: [{ type: i0.Input }],
396
+ variation: [{ type: i0.Input }],
251
397
  customComponentQuery: [{ type: i0.ContentChildren, args: [AmplifySlotDirective,] }]
252
398
  };
253
399
 
254
- var logger$3 = new awsAmplify.Logger('ConfirmSignIn');
255
- var AmplifyConfirmSignInComponent = /** @class */ (function () {
256
- function AmplifyConfirmSignInComponent(stateMachine, contextService) {
257
- this.stateMachine = stateMachine;
258
- this.contextService = contextService;
400
+ var ConfirmResetPasswordComponent = /** @class */ (function () {
401
+ function ConfirmResetPasswordComponent(authenticator) {
402
+ this.authenticator = authenticator;
259
403
  this.dataAttr = '';
260
- this.customComponents = {};
261
- this.remoteError = '';
262
- this.isPending = false;
263
- this.confirmText = ui.translate('Confirm');
404
+ this.headerText = ui.translate('Reset your password');
405
+ // translated strings
406
+ this.sendCodeText = ui.translate('Send Code');
264
407
  this.backToSignInText = ui.translate('Back to Sign In');
408
+ this.resendCodeText = ui.translate('Resend Code');
265
409
  }
266
- AmplifyConfirmSignInComponent.prototype.ngOnInit = function () {
267
- var _this = this;
268
- this.authSubscription = this.stateMachine.authService.subscribe(function (state) {
269
- _this.onStateUpdate(state);
270
- });
271
- this.setHeaderText();
410
+ Object.defineProperty(ConfirmResetPasswordComponent.prototype, "context", {
411
+ get: function () {
412
+ return this.authenticator.slotContext;
413
+ },
414
+ enumerable: false,
415
+ configurable: true
416
+ });
417
+ ConfirmResetPasswordComponent.prototype.onInput = function (event) {
418
+ event.preventDefault();
419
+ var _a = event.target, name = _a.name, value = _a.value;
420
+ this.authenticator.updateForm({ name: name, value: value });
272
421
  };
273
- AmplifyConfirmSignInComponent.prototype.ngAfterContentInit = function () {
274
- this.customComponents = this.contextService.customComponents;
422
+ ConfirmResetPasswordComponent.prototype.onSubmit = function (event) {
423
+ event.preventDefault();
424
+ this.authenticator.submitForm();
275
425
  };
276
- AmplifyConfirmSignInComponent.prototype.ngOnDestroy = function () {
277
- this.authSubscription.unsubscribe();
426
+ return ConfirmResetPasswordComponent;
427
+ }());
428
+ ConfirmResetPasswordComponent.decorators = [
429
+ { type: i0.Component, args: [{
430
+ selector: 'amplify-confirm-reset-password',
431
+ template: "<div data-amplify-container>\n <form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <fieldset\n class=\"amplify-flex\"\n style=\"flex-direction: 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\">{{ headerText }}</h3>\n </amplify-slot>\n <amplify-form-field\n name=\"confirmation_code\"\n type=\"number\"\n autocomplete=\"one-time-code\"\n ></amplify-form-field>\n <amplify-form-field\n name=\"password\"\n label=\"New password\"\n autocomplete=\"new-password\"\n ></amplify-form-field>\n <amplify-form-field\n name=\"confirm_password\"\n label=\"Confirm Password\"\n type=\"password\"\n autocomplete=\"new-password\"\n ></amplify-form-field>\n\n <button amplify-button variation=\"primary\" fullWidth=\"true\" type=\"submit\">\n {{ sendCodeText }}\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</div>\n"
432
+ },] }
433
+ ];
434
+ ConfirmResetPasswordComponent.ctorParameters = function () { return [
435
+ { type: AuthenticatorService }
436
+ ]; };
437
+ ConfirmResetPasswordComponent.propDecorators = {
438
+ dataAttr: [{ type: i0.HostBinding, args: ['attr.data-amplify-authenticator-confirmsignin',] }],
439
+ headerText: [{ type: i0.Input }]
440
+ };
441
+
442
+ var logger$1 = new awsAmplify.Logger('ConfirmSignIn');
443
+ var ConfirmSignInComponent = /** @class */ (function () {
444
+ function ConfirmSignInComponent(authenticator) {
445
+ this.authenticator = authenticator;
446
+ this.dataAttr = '';
447
+ this.confirmText = ui.translate('Confirm');
448
+ this.backToSignInText = ui.translate('Back to Sign In');
449
+ }
450
+ ConfirmSignInComponent.prototype.ngOnInit = function () {
451
+ this.setHeaderText();
278
452
  };
279
- Object.defineProperty(AmplifyConfirmSignInComponent.prototype, "context", {
453
+ Object.defineProperty(ConfirmSignInComponent.prototype, "context", {
280
454
  get: function () {
281
- var _a = this.stateMachine.services, change = _a.change, signIn = _a.signIn, submit = _a.submit;
282
- var remoteError = this.remoteError;
283
- return { change: change, remoteError: remoteError, signIn: signIn, submit: submit };
455
+ return this.authenticator.slotContext;
284
456
  },
285
457
  enumerable: false,
286
458
  configurable: true
287
459
  });
288
- AmplifyConfirmSignInComponent.prototype.setHeaderText = function () {
289
- var state = this.stateMachine.authState;
460
+ ConfirmSignInComponent.prototype.setHeaderText = function () {
461
+ var state = this.authenticator.authState;
290
462
  var actorContext = ui.getActorContext(state);
291
463
  var challengeName = actorContext.challengeName;
292
464
  switch (challengeName) {
293
465
  case ui.AuthChallengeNames.SOFTWARE_TOKEN_MFA:
294
- // TODO: this string should be centralized and translated from ui.
295
466
  this.headerText = ui.translate('Confirm TOTP Code');
296
467
  break;
297
468
  case ui.AuthChallengeNames.SMS_MFA:
298
469
  this.headerText = ui.translate('Confirm SMS Code');
299
470
  break;
300
471
  default:
301
- logger$3.error('Unexpected challengeName', challengeName);
472
+ logger$1.error('Unexpected challengeName', challengeName);
302
473
  }
303
474
  };
304
- AmplifyConfirmSignInComponent.prototype.onStateUpdate = function (state) {
305
- var actorState = ui.getActorState(state);
306
- this.remoteError = actorState.context.remoteError;
307
- this.isPending = !actorState.matches('confirmSignIn.edit');
308
- };
309
- AmplifyConfirmSignInComponent.prototype.onInput = function (event) {
475
+ ConfirmSignInComponent.prototype.onInput = function (event) {
310
476
  event.preventDefault();
311
477
  var _a = event.target, name = _a.name, value = _a.value;
312
- this.stateMachine.send({
313
- type: 'CHANGE',
314
- data: { name: name, value: value },
315
- });
478
+ this.authenticator.updateForm({ name: name, value: value });
316
479
  };
317
- AmplifyConfirmSignInComponent.prototype.onSubmit = function (event) {
480
+ ConfirmSignInComponent.prototype.onSubmit = function (event) {
318
481
  event.preventDefault();
319
- // TODO: handle form data within the state machine
320
- var formData = new FormData(event.target);
321
- this.stateMachine.send({
322
- type: 'SUBMIT',
323
- data: Object.fromEntries(formData),
324
- });
482
+ this.authenticator.submitForm();
325
483
  };
326
- AmplifyConfirmSignInComponent.prototype.toSignIn = function () {
327
- this.stateMachine.send('SIGN_IN');
328
- };
329
- return AmplifyConfirmSignInComponent;
484
+ return ConfirmSignInComponent;
330
485
  }());
331
- AmplifyConfirmSignInComponent.decorators = [
486
+ ConfirmSignInComponent.decorators = [
332
487
  { type: i0.Component, args: [{
333
488
  selector: 'amplify-confirm-sign-in',
334
- template: "<!-- \n Define default contents here\n-->\n<ng-template #confirmSignInButton>\n <button amplify-button variation=\"primary\" fullWidth=\"true\" type=\"submit\">\n {{ confirmText }}\n </button>\n</ng-template>\n\n<ng-template #confirmSignInForm>\n <form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <fieldset\n class=\"amplify-flex\"\n style=\"flex-direction: column\"\n data-amplify-fieldset\n [disabled]=\"isPending\"\n >\n <h3 class=\"amplify-heading\">{{ headerText }}</h3>\n <amplify-form-field\n name=\"confirmation_code\"\n label=\"Code *\"\n type=\"text\"\n autocomplete=\"one-time-code\"\n ></amplify-form-field>\n\n <ng-container\n [ngTemplateOutlet]=\"\n customComponents.confirmSignInButton || confirmSignInButton\n \"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-container>\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n (click)=\"toSignIn()\"\n >\n {{ backToSignInText }}\n </button>\n <amplify-error *ngIf=\"remoteError\">\n {{ remoteError }}\n </amplify-error>\n </fieldset>\n </form>\n</ng-template>\n\n<!-- \n Render sign in component\n-->\n\n<div data-amplify-container>\n <ng-container\n [ngTemplateOutlet]=\"customComponents.signInForm || confirmSignInForm\"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-container>\n</div>\n"
489
+ template: "<div data-amplify-container>\n <form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <fieldset\n class=\"amplify-flex\"\n style=\"flex-direction: 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\">{{ headerText }}</h3>\n </amplify-slot>\n <amplify-form-field\n name=\"confirmation_code\"\n label=\"Code *\"\n type=\"text\"\n autocomplete=\"one-time-code\"\n ></amplify-form-field>\n\n <button amplify-button variation=\"primary\" fullWidth=\"true\" type=\"submit\">\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</div>\n"
335
490
  },] }
336
491
  ];
337
- AmplifyConfirmSignInComponent.ctorParameters = function () { return [
338
- { type: StateMachineService },
339
- { type: AuthPropService }
492
+ ConfirmSignInComponent.ctorParameters = function () { return [
493
+ { type: AuthenticatorService }
340
494
  ]; };
341
- AmplifyConfirmSignInComponent.propDecorators = {
495
+ ConfirmSignInComponent.propDecorators = {
342
496
  dataAttr: [{ type: i0.HostBinding, args: ['attr.data-amplify-authenticator-confirmsignin',] }]
343
497
  };
344
498
 
345
- var AmplifyConfirmSignUpComponent = /** @class */ (function () {
346
- function AmplifyConfirmSignUpComponent(stateMachine, contextService) {
347
- this.stateMachine = stateMachine;
348
- this.contextService = contextService;
349
- this.dataAttr = '';
499
+ var ConfirmSignUpComponent = /** @class */ (function () {
500
+ function ConfirmSignUpComponent(authenticator) {
501
+ this.authenticator = authenticator;
350
502
  this.headerText = ui.translate('Confirm Sign Up');
351
- this.customComponents = {};
352
- this.remoteError = '';
353
- this.isPending = false;
503
+ this.dataAttr = '';
354
504
  // translated texts
355
505
  this.resendCodeText = ui.translate('Resend Code');
356
- this.lostCodeText = ui.translate('Lost your code? ');
357
506
  this.confirmText = ui.translate('Confirm');
358
507
  }
359
- AmplifyConfirmSignUpComponent.prototype.ngOnInit = function () {
360
- var _this = this;
361
- // TODO: alias for subscribe
362
- this.authSubscription = this.stateMachine.authService.subscribe(function (state) { return _this.onStateUpdate(state); });
363
- };
364
- AmplifyConfirmSignUpComponent.prototype.ngAfterContentInit = function () {
365
- this.customComponents = this.contextService.customComponents;
366
- };
367
- AmplifyConfirmSignUpComponent.prototype.ngOnDestroy = function () {
368
- this.authSubscription.unsubscribe();
508
+ Object.defineProperty(ConfirmSignUpComponent.prototype, "context", {
509
+ get: function () {
510
+ return this.authenticator.slotContext;
511
+ },
512
+ enumerable: false,
513
+ configurable: true
514
+ });
515
+ Object.defineProperty(ConfirmSignUpComponent.prototype, "confirmSignUpHeading", {
516
+ get: function () {
517
+ var _a = this.authenticator.codeDeliveryDetails, _b = _a === void 0 ? {} : _a, DeliveryMedium = _b.DeliveryMedium;
518
+ return DeliveryMedium === 'EMAIL'
519
+ ? ui.translate('We Emailed You')
520
+ : DeliveryMedium === 'SMS'
521
+ ? ui.translate('We Texted You')
522
+ : ui.translate('We Sent A Code');
523
+ },
524
+ enumerable: false,
525
+ configurable: true
526
+ });
527
+ Object.defineProperty(ConfirmSignUpComponent.prototype, "subtitleText", {
528
+ get: function () {
529
+ var _a = this.authenticator.codeDeliveryDetails, _b = _a === void 0 ? {} : _a, DeliveryMedium = _b.DeliveryMedium, Destination = _b.Destination;
530
+ return DeliveryMedium === 'EMAIL'
531
+ ? "Your code is on the way. To log in, enter the code we emailed to " + Destination + ". It may take a minute to arrive."
532
+ : DeliveryMedium === 'SMS'
533
+ ? "Your code is on the way. To log in, enter the code we texted to " + Destination + ". It may take a minute to arrive."
534
+ : ui.translate("Your code is on the way. To log in, enter the code we sent you. It may take a minute to arrive.");
535
+ },
536
+ enumerable: false,
537
+ configurable: true
538
+ });
539
+ ConfirmSignUpComponent.prototype.onInput = function (event) {
540
+ event.preventDefault();
541
+ var _a = event.target, name = _a.name, value = _a.value;
542
+ this.authenticator.updateForm({ name: name, value: value });
369
543
  };
370
- AmplifyConfirmSignUpComponent.prototype.onStateUpdate = function (state) {
371
- var actorState = ui.getActorState(state);
372
- this.remoteError = actorState.context.remoteError;
373
- this.isPending = !actorState.matches('confirmSignUp.edit');
544
+ ConfirmSignUpComponent.prototype.onSubmit = function (event) {
545
+ event.preventDefault();
546
+ this.authenticator.submitForm();
374
547
  };
375
- Object.defineProperty(AmplifyConfirmSignUpComponent.prototype, "context", {
548
+ return ConfirmSignUpComponent;
549
+ }());
550
+ ConfirmSignUpComponent.decorators = [
551
+ { type: i0.Component, args: [{
552
+ selector: 'amplify-confirm-sign-up',
553
+ template: "<div data-amplify-container>\n <form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <fieldset\n class=\"amplify-flex\"\n style=\"flex-direction: column\"\n data-amplify-fieldset\n [disabled]=\"context.isPending\"\n >\n <amplify-slot name=\"confirm-sign-up-header\" [context]=\"context\">\n <h3 class=\"amplify-heading\" style=\"font-size: 1.5rem\">\n {{ confirmSignUpHeading }}\n </h3>\n </amplify-slot>\n <span style=\"margin-bottom: 1rem\">\n {{ subtitleText }}\n </span>\n <amplify-form-field\n name=\"confirmation_code\"\n autocomplete=\"one-time-code\"\n ></amplify-form-field>\n\n <button amplify-button variation=\"primary\" fullWidth=\"true\" type=\"submit\">\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</div>\n"
554
+ },] }
555
+ ];
556
+ ConfirmSignUpComponent.ctorParameters = function () { return [
557
+ { type: AuthenticatorService }
558
+ ]; };
559
+ ConfirmSignUpComponent.propDecorators = {
560
+ headerText: [{ type: i0.Input }],
561
+ dataAttr: [{ type: i0.HostBinding, args: ['attr.data-amplify-authenticator-confirmsignup',] }]
562
+ };
563
+
564
+ var ConfirmVerifyUserComponent = /** @class */ (function () {
565
+ function ConfirmVerifyUserComponent(authenticator) {
566
+ this.authenticator = authenticator;
567
+ this.dataAttr = '';
568
+ this.headerText = ui.translate('Account recovery requires verified contact information');
569
+ // translated texts
570
+ this.skipText = ui.translate('Skip');
571
+ this.submitText = ui.translate('Submit');
572
+ }
573
+ Object.defineProperty(ConfirmVerifyUserComponent.prototype, "context", {
376
574
  get: function () {
377
- var _a = this.stateMachine.services, change = _a.change, resend = _a.resend, signIn = _a.signIn, submit = _a.submit;
378
- var remoteError = this.remoteError;
379
- var username = this.username;
380
- return { change: change, remoteError: remoteError, resend: resend, signIn: signIn, submit: submit, username: username };
575
+ return this.authenticator.slotContext;
381
576
  },
382
577
  enumerable: false,
383
578
  configurable: true
384
579
  });
385
- AmplifyConfirmSignUpComponent.prototype.resend = function () {
386
- this.stateMachine.send({
387
- type: 'RESEND',
388
- data: {
389
- username: this.username,
390
- },
391
- });
392
- };
393
- AmplifyConfirmSignUpComponent.prototype.onInput = function ($event) {
394
- $event.preventDefault();
395
- var _a = $event.target, name = _a.name, value = _a.value;
396
- this.stateMachine.send({
397
- type: 'CHANGE',
398
- data: { name: name, value: value },
399
- });
580
+ ConfirmVerifyUserComponent.prototype.onInput = function (event) {
581
+ event.preventDefault();
582
+ var _a = event.target, name = _a.name, value = _a.value;
583
+ this.authenticator.updateForm({ name: name, value: value });
400
584
  };
401
- AmplifyConfirmSignUpComponent.prototype.onSubmit = function (event) {
585
+ ConfirmVerifyUserComponent.prototype.onSubmit = function (event) {
402
586
  event.preventDefault();
403
- var state = this.stateMachine.authState;
404
- var actorContext = ui.getActorContext(state);
405
- var formValues = actorContext.formValues;
406
- var username = formValues.username, confirmation_code = formValues.confirmation_code;
407
- this.stateMachine.send({
408
- type: 'SUBMIT',
409
- data: { username: username, confirmation_code: confirmation_code },
410
- });
587
+ this.authenticator.submitForm();
411
588
  };
412
- return AmplifyConfirmSignUpComponent;
589
+ return ConfirmVerifyUserComponent;
413
590
  }());
414
- AmplifyConfirmSignUpComponent.decorators = [
591
+ ConfirmVerifyUserComponent.decorators = [
415
592
  { type: i0.Component, args: [{
416
- selector: 'amplify-confirm-sign-up',
417
- template: "<!-- \n Define default contents here\n-->\n<ng-template #confirmSignUpButton>\n <button amplify-button variation=\"primary\" fullWidth=\"true\" type=\"submit\">\n {{ confirmText }}\n </button>\n</ng-template>\n\n<ng-template #confirmSignUpForm>\n <form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <fieldset\n class=\"amplify-flex\"\n style=\"flex-direction: column\"\n data-amplify-fieldset\n [disabled]=\"isPending\"\n >\n <h3 class=\"amplify-heading\">{{ this.headerText }}</h3>\n <amplify-form-field\n name=\"confirmation_code\"\n type=\"number\"\n autocomplete=\"one-time-code\"\n ></amplify-form-field>\n\n <ng-container\n [ngTemplateOutlet]=\"\n customComponents.confirmSignUpButton || confirmSignUpButton\n \"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-container>\n <button amplify-button fontWeight=\"normal\" (click)=\"resend()\">\n {{ resendCodeText }}\n </button>\n </fieldset>\n\n <amplify-error *ngIf=\"remoteError\">\n {{ remoteError }}\n </amplify-error>\n </form>\n</ng-template>\n\n<!-- \n Render confirm sign up component\n-->\n\n<div data-amplify-container>\n <ng-container\n [ngTemplateOutlet]=\"customComponents.confirmSignUpForm || confirmSignUpForm\"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-container>\n</div>\n"
593
+ selector: 'amplify-confirm-verify-user',
594
+ template: "<div data-amplify-container>\n <form data-amplify-form (input)=\"onInput($event)\" (submit)=\"onSubmit($event)\">\n <fieldset\n class=\"amplify-flex\"\n style=\"flex-direction: 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\">{{ this.headerText }}</h3>\n </amplify-slot>\n <amplify-form-field\n name=\"confirmation_code\"\n type=\"number\"\n autocomplete=\"one-time-code\"\n ></amplify-form-field>\n <button amplify-button variation=\"primary\" fullWidth=\"true\" type=\"submit\">\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</div>\n"
418
595
  },] }
419
596
  ];
420
- AmplifyConfirmSignUpComponent.ctorParameters = function () { return [
421
- { type: StateMachineService },
422
- { type: AuthPropService }
597
+ ConfirmVerifyUserComponent.ctorParameters = function () { return [
598
+ { type: AuthenticatorService }
423
599
  ]; };
424
- AmplifyConfirmSignUpComponent.propDecorators = {
425
- dataAttr: [{ type: i0.HostBinding, args: ['attr.data-amplify-authenticator-confirmsignup',] }],
600
+ ConfirmVerifyUserComponent.propDecorators = {
601
+ dataAttr: [{ type: i0.HostBinding, args: ['attr.data-amplify-authenticator-confirmverifyuser',] }],
426
602
  headerText: [{ type: i0.Input }]
427
603
  };
428
604
 
429
- var AmplifyFederatedSignInButtonComponent = /** @class */ (function () {
430
- function AmplifyFederatedSignInButtonComponent(stateMachine) {
605
+ var FederatedSignInButtonComponent = /** @class */ (function () {
606
+ function FederatedSignInButtonComponent(authenticator) {
431
607
  var _this = this;
432
- this.stateMachine = stateMachine;
608
+ this.authenticator = authenticator;
433
609
  this.onClick = function () {
434
- _this.stateMachine.send({
610
+ _this.authenticator.send({
435
611
  type: 'FEDERATED_SIGN_IN',
436
612
  data: { provider: _this.provider },
437
613
  });
438
614
  };
439
615
  }
440
- return AmplifyFederatedSignInButtonComponent;
616
+ return FederatedSignInButtonComponent;
441
617
  }());
442
- AmplifyFederatedSignInButtonComponent.decorators = [
618
+ FederatedSignInButtonComponent.decorators = [
443
619
  { type: i0.Component, args: [{
444
620
  selector: 'amplify-federated-sign-in-button',
445
- template: "<button\n amplify-button\n class=\"amplify-field-group__control federated-sign-in-button\"\n fullWidth=\"true\"\n fontWeight=\"normal\"\n style=\"display: block\"\n (click)=\"onClick()\"\n>\n <div\n class=\"amplify-flex federated-sign-in-button-row\"\n style=\"flex-direction: row; justify-content: center\"\n >\n <ng-content></ng-content>\n </div>\n</button>\n"
621
+ template: "<button\n amplify-button\n class=\"amplify-field-group__control federated-sign-in-button\"\n fullWidth=\"true\"\n fontWeight=\"normal\"\n style=\"display: block\"\n (click)=\"onClick()\"\n>\n <div\n class=\"amplify-flex federated-sign-in-button-row\"\n style=\"flex-direction: row; justify-content: center; align-items: center\"\n >\n <ng-content></ng-content>\n </div>\n</button>\n"
446
622
  },] }
447
623
  ];
448
- AmplifyFederatedSignInButtonComponent.ctorParameters = function () { return [
449
- { type: StateMachineService }
624
+ FederatedSignInButtonComponent.ctorParameters = function () { return [
625
+ { type: AuthenticatorService }
450
626
  ]; };
451
- AmplifyFederatedSignInButtonComponent.propDecorators = {
627
+ FederatedSignInButtonComponent.propDecorators = {
452
628
  provider: [{ type: i0.Input }],
453
629
  text: [{ type: i0.Input }]
454
630
  };
455
631
 
456
- var AmplifyFederatedSignInComponent = /** @class */ (function () {
457
- function AmplifyFederatedSignInComponent(stateMachine) {
458
- this.stateMachine = stateMachine;
632
+ var FederatedSignInComponent = /** @class */ (function () {
633
+ function FederatedSignInComponent(authenticator) {
634
+ this.authenticator = authenticator;
459
635
  this.FederatedProviders = ui.FederatedIdentityProviders;
636
+ this.includeAmazon = false;
637
+ this.includeApple = false;
460
638
  this.includeFacebook = false;
461
639
  this.includeGoogle = false;
462
- this.includeAmazon = false;
463
640
  this.shouldShowFederatedSignIn = false;
464
- // translated texts
465
- this.signInFacebookText = ui.translate('Sign In with Facebook');
466
- this.signInGoogleText = ui.translate('Sign In with Google');
467
- this.signInAmazonText = ui.translate('Sign In with Amazon');
468
641
  }
469
- AmplifyFederatedSignInComponent.prototype.ngOnInit = function () {
470
- var _a, _b;
471
- var loginMechanisms = (_b = (_a = this.stateMachine.context) === null || _a === void 0 ? void 0 : _a.config) === null || _b === void 0 ? void 0 : _b.login_mechanisms;
472
- this.includeFacebook = loginMechanisms === null || loginMechanisms === void 0 ? void 0 : loginMechanisms.includes('facebook');
473
- this.includeGoogle = loginMechanisms === null || loginMechanisms === void 0 ? void 0 : loginMechanisms.includes('google');
474
- this.includeAmazon = loginMechanisms === null || loginMechanisms === void 0 ? void 0 : loginMechanisms.includes('amazon');
642
+ FederatedSignInComponent.prototype.ngOnInit = function () {
643
+ var _a;
644
+ var socialProviders = ((_a = this.authenticator.context) === null || _a === void 0 ? void 0 : _a.config).socialProviders;
645
+ this.setFederatedTexts();
646
+ this.includeAmazon = socialProviders === null || socialProviders === void 0 ? void 0 : socialProviders.includes('amazon');
647
+ this.includeApple = socialProviders === null || socialProviders === void 0 ? void 0 : socialProviders.includes('apple');
648
+ this.includeGoogle = socialProviders === null || socialProviders === void 0 ? void 0 : socialProviders.includes('google');
649
+ this.includeFacebook = socialProviders === null || socialProviders === void 0 ? void 0 : socialProviders.includes('facebook');
475
650
  this.shouldShowFederatedSignIn =
476
- this.includeFacebook || this.includeGoogle || this.includeAmazon;
651
+ this.includeAmazon ||
652
+ this.includeApple ||
653
+ this.includeFacebook ||
654
+ this.includeGoogle;
477
655
  };
478
- return AmplifyFederatedSignInComponent;
656
+ FederatedSignInComponent.prototype.setFederatedTexts = function () {
657
+ var route = this.authenticator.route;
658
+ var federatedText = route === 'signUp' ? 'Up' : 'In';
659
+ this.signInAmazonText = ui.translate("Sign " + federatedText + " with Amazon");
660
+ this.signInAppleText = ui.translate("Sign " + federatedText + " with Apple");
661
+ this.signInFacebookText = ui.translate("Sign " + federatedText + " with Facebook");
662
+ this.signInGoogleText = ui.translate("Sign " + federatedText + " with Google");
663
+ };
664
+ return FederatedSignInComponent;
479
665
  }());
480
- AmplifyFederatedSignInComponent.decorators = [
666
+ FederatedSignInComponent.decorators = [
481
667
  { type: i0.Component, args: [{
482
668
  selector: 'amplify-federated-sign-in',
483
- template: "<div\n class=\"amplify-flex federated-sign-in-container\"\n style=\"flex-direction: column\"\n *ngIf=\"shouldShowFederatedSignIn\"\n data-orientation=\"horizontal\"\n data-size=\"small\"\n>\n <hr\n class=\"amplify-divider\"\n aria-orientation=\"horizontal\"\n data-size=\"small\"\n style=\"margin: '1rem 0'\"\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\" style=\"align-self: center\">\n {{ signInGoogleText }}\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\" style=\"align-self: center\">\n {{ signInFacebookText }}\n </p>\n </amplify-federated-sign-in-button>\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\" style=\"align-self: center\">\n {{ signInAmazonText }}\n </p>\n </amplify-federated-sign-in-button>\n</div>\n"
669
+ template: "<div\n class=\"amplify-flex federated-sign-in-container\"\n style=\"flex-direction: column; padding: 0 0 1rem 0\"\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\" style=\"align-self: center\">\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\" style=\"align-self: center\">\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\" style=\"align-self: center\">\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\" style=\"align-self: center\">\n {{ signInGoogleText }}\n </p>\n </amplify-federated-sign-in-button>\n\n <div class=\"amplify-flex\" data-or-container>\n <div data-or-line>or</div>\n <hr\n class=\"amplify-divider\"\n aria-orientation=\"horizontal\"\n data-size=\"small\"\n />\n </div>\n</div>\n"
484
670
  },] }
485
671
  ];
486
- AmplifyFederatedSignInComponent.ctorParameters = function () { return [
487
- { type: StateMachineService }
672
+ FederatedSignInComponent.ctorParameters = function () { return [
673
+ { type: AuthenticatorService }
488
674
  ]; };
489
675
 
490
- var logger$2 = new awsAmplify.Logger('ForceNewPassword');
491
- var AmplifyForceNewPasswordComponent = /** @class */ (function () {
492
- function AmplifyForceNewPasswordComponent(stateMachine, contextService) {
493
- this.stateMachine = stateMachine;
494
- this.contextService = contextService;
676
+ var ForceNewPasswordComponent = /** @class */ (function () {
677
+ function ForceNewPasswordComponent(authenticator) {
678
+ this.authenticator = authenticator;
495
679
  this.dataAttr = '';
496
680
  this.headerText = ui.translate('Change Password');
497
- this.customComponents = {};
498
- this.remoteError = '';
499
- this.isPending = false;
500
681
  // translated texts
501
682
  this.changePasswordText = ui.translate('Change Password');
502
683
  this.backToSignInText = ui.translate('Back to Sign In');
503
684
  }
504
- AmplifyForceNewPasswordComponent.prototype.ngOnInit = function () {
505
- var _this = this;
506
- this.authSubscription = this.stateMachine.authService.subscribe(function (state) { return _this.onStateUpdate(state); });
507
- };
508
- AmplifyForceNewPasswordComponent.prototype.ngAfterContentInit = function () {
509
- this.customComponents = this.contextService.customComponents;
510
- };
511
- AmplifyForceNewPasswordComponent.prototype.ngOnDestroy = function () {
512
- logger$2.log('sign in destroyed, unsubscribing from state machine...');
513
- this.authSubscription.unsubscribe();
514
- };
515
- AmplifyForceNewPasswordComponent.prototype.onStateUpdate = function (state) {
516
- var actorState = ui.getActorState(state);
517
- this.remoteError = actorState.context.remoteError;
518
- this.isPending = actorState.matches({
519
- signUp: {
520
- submission: 'idle',
521
- },
522
- });
523
- };
524
- Object.defineProperty(AmplifyForceNewPasswordComponent.prototype, "context", {
685
+ Object.defineProperty(ForceNewPasswordComponent.prototype, "context", {
525
686
  get: function () {
526
- var _a = this.stateMachine.services, change = _a.change, signIn = _a.signIn, submit = _a.submit;
527
- var user = this.stateMachine.user;
528
- var remoteError = this.remoteError;
529
- return { change: change, remoteError: remoteError, signIn: signIn, submit: submit, user: user };
687
+ return this.authenticator.slotContext;
530
688
  },
531
689
  enumerable: false,
532
690
  configurable: true
533
691
  });
534
- AmplifyForceNewPasswordComponent.prototype.toSignIn = function () {
535
- this.stateMachine.send('SIGN_IN');
536
- };
537
- AmplifyForceNewPasswordComponent.prototype.onInput = function (event) {
692
+ ForceNewPasswordComponent.prototype.onInput = function (event) {
538
693
  event.preventDefault();
539
694
  var _a = event.target, name = _a.name, value = _a.value;
540
- this.stateMachine.send({
541
- type: 'CHANGE',
542
- data: { name: name, value: value },
543
- });
695
+ this.authenticator.updateForm({ name: name, value: value });
544
696
  };
545
- AmplifyForceNewPasswordComponent.prototype.onSubmit = function (event) {
697
+ ForceNewPasswordComponent.prototype.onSubmit = function (event) {
546
698
  event.preventDefault();
547
- // consider stateMachine directly providing actorState / actorContext
548
- var state = this.stateMachine.authState;
549
- var actorState = ui.getActorContext(state);
550
- var formValues = actorState.formValues;
551
- this.stateMachine.send({
552
- type: 'SUBMIT',
553
- data: formValues,
554
- });
699
+ this.authenticator.submitForm();
555
700
  };
556
- return AmplifyForceNewPasswordComponent;
701
+ return ForceNewPasswordComponent;
557
702
  }());
558
- AmplifyForceNewPasswordComponent.decorators = [
703
+ ForceNewPasswordComponent.decorators = [
559
704
  { type: i0.Component, args: [{
560
705
  selector: 'amplify-force-new-password',
561
- template: "<!-- \n Define default contents here\n-->\n<ng-template #forceNewPasswordSubmitButton>\n <button amplify-button variation=\"primary\" fullWidth=\"true\" type=\"submit\">\n {{ changePasswordText }}\n </button>\n</ng-template>\n\n<ng-template #signInForm>\n <form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <fieldset\n class=\"amplify-flex\"\n style=\"flex-direction: column\"\n data-amplify-fieldset\n [disabled]=\"isPending\"\n >\n <h3 class=\"amplify-heading\">{{ this.headerText }}</h3>\n <amplify-form-field\n name=\"password\"\n type=\"password\"\n autocomplete=\"new-password\"\n ></amplify-form-field>\n\n <amplify-form-field\n name=\"confirm_password\"\n label=\"Confirm Password\"\n type=\"password\"\n autocomplete=\"new-password\"\n ></amplify-form-field>\n\n <ng-container\n [ngTemplateOutlet]=\"\n customComponents.forceNewPasswordSubmitButton ||\n forceNewPasswordSubmitButton\n \"\n [ngTemplateOutletContext]=\"context\"\n ></ng-container>\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n (click)=\"toSignIn()\"\n >\n {{ backToSignInText }}\n </button>\n <amplify-error *ngIf=\"remoteError\">\n {{ remoteError }}\n </amplify-error>\n </fieldset>\n </form>\n</ng-template>\n\n<!-- \n Render force new password component\n-->\n<div data-amplify-container>\n <ng-container\n [ngTemplateOutlet]=\"customComponents.signInForm || signInForm\"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-container>\n</div>\n"
706
+ template: "<div data-amplify-container>\n <form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <fieldset\n class=\"amplify-flex\"\n style=\"flex-direction: 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\">{{ this.headerText }}</h3>\n </amplify-slot>\n <amplify-form-field\n name=\"password\"\n type=\"password\"\n autocomplete=\"new-password\"\n ></amplify-form-field>\n\n <amplify-form-field\n name=\"confirm_password\"\n label=\"Confirm Password\"\n type=\"password\"\n autocomplete=\"new-password\"\n ></amplify-form-field>\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</div>\n"
562
707
  },] }
563
708
  ];
564
- AmplifyForceNewPasswordComponent.ctorParameters = function () { return [
565
- { type: StateMachineService },
566
- { type: AuthPropService }
709
+ ForceNewPasswordComponent.ctorParameters = function () { return [
710
+ { type: AuthenticatorService }
567
711
  ]; };
568
- AmplifyForceNewPasswordComponent.propDecorators = {
712
+ ForceNewPasswordComponent.propDecorators = {
569
713
  dataAttr: [{ type: i0.HostBinding, args: ['attr.data-amplify-authenticator-forcenewpassword',] }],
570
714
  headerText: [{ type: i0.Input }]
571
715
  };
572
716
 
573
- var AmplifyResetPasswordComponent = /** @class */ (function () {
574
- function AmplifyResetPasswordComponent(stateMachine, contextService) {
575
- this.stateMachine = stateMachine;
576
- this.contextService = contextService;
577
- this.dataAttr = '';
578
- this.headerText = ui.translate('Reset your password');
579
- this.customComponents = {};
580
- this.remoteError = '';
581
- this.isPending = false;
582
- // translated texts
583
- this.sendCodeText = ui.translate('Send Code');
584
- this.backToSignInText = ui.translate('Back to Sign In');
717
+ var getAttributeMap = function () { return ui.authInputAttributes; };
718
+
719
+ /**
720
+ * Input interface opinionated for authenticator usage.
721
+ *
722
+ * TODO: Separate this component out to two parts -- 1) amplify-auth-input that
723
+ * contains authenticator opinionated logic and 2) amplify-text-field primitive
724
+ * that does not make any auth-related inference.
725
+ */
726
+ var FormFieldComponent = /** @class */ (function () {
727
+ function FormFieldComponent(authenticator) {
728
+ this.authenticator = authenticator;
729
+ this.required = true;
730
+ this.placeholder = '';
731
+ this.label = '';
732
+ this.initialValue = '';
733
+ this.disabled = false;
734
+ this.autocomplete = '';
735
+ this.labelHidden = true;
736
+ this.countryDialCodes = ui.countryDialCodes;
585
737
  }
586
- AmplifyResetPasswordComponent.prototype.ngOnInit = function () {
587
- var _this = this;
588
- this.authSubscription = this.stateMachine.authService.subscribe(function (state) { return _this.onStateUpdate(state); });
589
- };
590
- AmplifyResetPasswordComponent.prototype.ngAfterContentInit = function () {
591
- this.customComponents = this.contextService.customComponents;
592
- };
593
- AmplifyResetPasswordComponent.prototype.ngOnDestroy = function () {
594
- this.authSubscription.unsubscribe();
595
- };
596
- AmplifyResetPasswordComponent.prototype.onStateUpdate = function (state) {
597
- var actorState = ui.getActorState(state);
598
- this.remoteError = actorState.context.remoteError;
599
- this.isPending = !actorState.matches('resetPassword.edit');
600
- };
601
- Object.defineProperty(AmplifyResetPasswordComponent.prototype, "context", {
738
+ FormFieldComponent.prototype.ngOnInit = function () {
739
+ // TODO: consider better default handling mechanisms across frameworks
740
+ if (this.isPhoneField()) {
741
+ var state = this.authenticator.authState;
742
+ var country_code = ui.getActorContext(state).country_code;
743
+ this.defaultCountryCode = country_code;
744
+ // TODO: remove this side-effect
745
+ this.authenticator.updateForm({
746
+ name: 'country_code',
747
+ value: country_code,
748
+ });
749
+ }
750
+ };
751
+ Object.defineProperty(FormFieldComponent.prototype, "attributeMap", {
602
752
  get: function () {
603
- var _a = this.stateMachine.services, change = _a.change, signIn = _a.signIn, submit = _a.submit;
604
- var remoteError = this.remoteError;
605
- return { change: change, remoteError: remoteError, signIn: signIn, submit: submit };
753
+ return getAttributeMap();
754
+ },
755
+ enumerable: false,
756
+ configurable: true
757
+ });
758
+ Object.defineProperty(FormFieldComponent.prototype, "error", {
759
+ get: function () {
760
+ var formContext = ui.getActorContext(this.authenticator.authState);
761
+ var validationError = formContext.validationError;
762
+ return ui.translate(validationError[this.name]);
606
763
  },
607
764
  enumerable: false,
608
765
  configurable: true
609
766
  });
610
- AmplifyResetPasswordComponent.prototype.toSignIn = function () {
611
- this.stateMachine.send('SIGN_IN');
767
+ FormFieldComponent.prototype.onBlur = function ($event) {
768
+ var name = $event.target.name;
769
+ this.authenticator.updateBlur({ name: name });
770
+ };
771
+ FormFieldComponent.prototype.inferLabel = function () {
772
+ var _a;
773
+ var label = this.label || ((_a = this.attributeMap[this.name]) === null || _a === void 0 ? void 0 : _a.label);
774
+ return ui.translate(label);
775
+ };
776
+ FormFieldComponent.prototype.inferPlaceholder = function () {
777
+ var _a;
778
+ var placeholder = this.placeholder || ((_a = this.attributeMap[this.name]) === null || _a === void 0 ? void 0 : _a.placeholder) ||
779
+ this.inferLabel();
780
+ return ui.translate(placeholder);
781
+ };
782
+ // infers what the `type` of underlying input element should be.
783
+ FormFieldComponent.prototype.inferType = function () {
784
+ var _a, _b, _c;
785
+ return (_c = (_a = this.type) !== null && _a !== void 0 ? _a : (_b = this.attributeMap[this.name]) === null || _b === void 0 ? void 0 : _b.type) !== null && _c !== void 0 ? _c : 'text';
786
+ };
787
+ FormFieldComponent.prototype.inferAutocomplete = function () {
788
+ var _a;
789
+ return this.autocomplete || ((_a = this.attributeMap[this.name]) === null || _a === void 0 ? void 0 : _a.autocomplete);
790
+ };
791
+ // TODO(enhancement): use enum to differentiate special field types
792
+ FormFieldComponent.prototype.isPasswordField = function () {
793
+ return this.inferType() === 'password';
794
+ };
795
+ FormFieldComponent.prototype.isPhoneField = function () {
796
+ return this.inferType() === 'tel';
797
+ };
798
+ return FormFieldComponent;
799
+ }());
800
+ FormFieldComponent.decorators = [
801
+ { type: i0.Component, args: [{
802
+ selector: 'amplify-form-field',
803
+ template: "<div class=\"amplify-flex amplify-field\" style=\"flex-direction: column\">\n <!-- Country code field -->\n <amplify-phone-number-field\n *ngIf=\"isPhoneField()\"\n [defaultCountryCode]=\"defaultCountryCode\"\n [type]=\"inferType()\"\n [name]=\"name\"\n [label]=\"inferLabel()\"\n [placeholder]=\"inferPlaceholder()\"\n [required]=\"required\"\n [initialValue]=\"initialValue\"\n [disabled]=\"disabled\"\n [labelHidden]=\"labelHidden\"\n [autocomplete]=\"inferAutocomplete()\"\n ></amplify-phone-number-field>\n\n <amplify-password-field\n *ngIf=\"isPasswordField()\"\n [name]=\"name\"\n [label]=\"inferLabel()\"\n [placeholder]=\"inferPlaceholder()\"\n [required]=\"required\"\n [initialValue]=\"initialValue\"\n [disabled]=\"disabled\"\n [labelHidden]=\"labelHidden\"\n [autocomplete]=\"inferAutocomplete()\"\n (setBlur)=\"onBlur($event)\"\n ></amplify-password-field>\n\n <amplify-text-field\n *ngIf=\"!isPasswordField() && !isPhoneField()\"\n [type]=\"inferType()\"\n [name]=\"name\"\n [label]=\"inferLabel()\"\n [placeholder]=\"inferPlaceholder()\"\n [required]=\"required\"\n [initialValue]=\"initialValue\"\n [disabled]=\"disabled\"\n [labelHidden]=\"labelHidden\"\n [autocomplete]=\"inferAutocomplete()\"\n ></amplify-text-field>\n\n <amplify-error *ngIf=\"error\">\n {{ error }}\n </amplify-error>\n</div>\n"
804
+ },] }
805
+ ];
806
+ FormFieldComponent.ctorParameters = function () { return [
807
+ { type: AuthenticatorService }
808
+ ]; };
809
+ FormFieldComponent.propDecorators = {
810
+ name: [{ type: i0.Input }],
811
+ type: [{ type: i0.Input }],
812
+ required: [{ type: i0.Input }],
813
+ placeholder: [{ type: i0.Input }],
814
+ label: [{ type: i0.Input }],
815
+ initialValue: [{ type: i0.Input }],
816
+ disabled: [{ type: i0.Input }],
817
+ autocomplete: [{ type: i0.Input }],
818
+ labelHidden: [{ type: i0.Input }]
819
+ };
820
+
821
+ var ResetPasswordComponent = /** @class */ (function () {
822
+ function ResetPasswordComponent(authenticator) {
823
+ this.authenticator = authenticator;
824
+ this.dataAttr = '';
825
+ this.headerText = ui.translate('Reset your password');
826
+ // translated texts
827
+ this.sendCodeText = ui.translate('Send Code');
828
+ this.backToSignInText = ui.translate('Back to Sign In');
829
+ this.labelText = ui.translate('Username');
830
+ }
831
+ ResetPasswordComponent.prototype.ngOnInit = function () {
832
+ var authState = this.authenticator.authState;
833
+ var label = ui.getAliasInfoFromContext(authState.context).label;
834
+ this.labelText = "Enter your " + label.toLowerCase();
612
835
  };
613
- AmplifyResetPasswordComponent.prototype.onInput = function (event) {
836
+ Object.defineProperty(ResetPasswordComponent.prototype, "context", {
837
+ get: function () {
838
+ return this.authenticator.slotContext;
839
+ },
840
+ enumerable: false,
841
+ configurable: true
842
+ });
843
+ ResetPasswordComponent.prototype.onInput = function (event) {
614
844
  event.preventDefault();
615
845
  var _a = event.target, name = _a.name, value = _a.value;
616
- this.stateMachine.send({
617
- type: 'CHANGE',
618
- data: { name: name, value: value },
619
- });
846
+ this.authenticator.updateForm({ name: name, value: value });
620
847
  };
621
- AmplifyResetPasswordComponent.prototype.onSubmit = function (event) {
848
+ ResetPasswordComponent.prototype.onSubmit = function (event) {
622
849
  event.preventDefault();
623
- this.stateMachine.send('SUBMIT');
850
+ this.authenticator.submitForm();
624
851
  };
625
- return AmplifyResetPasswordComponent;
852
+ return ResetPasswordComponent;
626
853
  }());
627
- AmplifyResetPasswordComponent.decorators = [
854
+ ResetPasswordComponent.decorators = [
628
855
  { type: i0.Component, args: [{
629
856
  selector: 'amplify-reset-password',
630
- template: "<!-- \n Define default contents here\n-->\n<ng-template #resetPasswordSubmitButton>\n <button amplify-button variation=\"primary\" fullWidth=\"true\" type=\"submit\">\n {{ sendCodeText }}\n </button>\n</ng-template>\n\n<ng-template #resetPasswordForm>\n <form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <fieldset\n class=\"amplify-flex\"\n style=\"flex-direction: column\"\n data-amplify-fieldset\n [disabled]=\"isPending\"\n >\n <h3 class=\"amplify-heading\">{{ this.headerText }}</h3>\n <amplify-form-field\n name=\"username\"\n type=\"username\"\n autocomplete=\"username\"\n ></amplify-form-field>\n <ng-container\n [ngTemplateOutlet]=\"\n customComponents.resetPasswordSubmitButton ||\n resetPasswordSubmitButton\n \"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-container>\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n (click)=\"toSignIn()\"\n >\n {{ backToSignInText }}\n </button>\n <amplify-error *ngIf=\"remoteError\">\n {{ remoteError }}\n </amplify-error>\n </fieldset>\n </form>\n</ng-template>\n\n<!-- \n Render reset passsword component\n-->\n<div data-amplify-container>\n <ng-container\n [ngTemplateOutlet]=\"customComponents.resetPasswordForm || resetPasswordForm\"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-container>\n</div>\n"
857
+ template: "<div data-amplify-container>\n <form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <fieldset\n class=\"amplify-flex\"\n style=\"flex-direction: 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\">{{ this.headerText }}</h3>\n </amplify-slot>\n\n <amplify-form-field\n name=\"username\"\n type=\"username\"\n autocomplete=\"username\"\n [placeholder]=\"labelText\"\n [label]=\"labelText\"\n ></amplify-form-field>\n <button amplify-button variation=\"primary\" fullWidth=\"true\" type=\"submit\">\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</div>\n"
631
858
  },] }
632
859
  ];
633
- AmplifyResetPasswordComponent.ctorParameters = function () { return [
634
- { type: StateMachineService },
635
- { type: AuthPropService }
860
+ ResetPasswordComponent.ctorParameters = function () { return [
861
+ { type: AuthenticatorService }
636
862
  ]; };
637
- AmplifyResetPasswordComponent.propDecorators = {
863
+ ResetPasswordComponent.propDecorators = {
638
864
  dataAttr: [{ type: i0.HostBinding, args: ['attr.data-amplify-authenticator-resetPassword',] }],
639
865
  headerText: [{ type: i0.Input }]
640
866
  };
@@ -957,531 +1183,283 @@
957
1183
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
958
1184
  }
959
1185
 
960
- var logger$1 = new awsAmplify.Logger('SetupTotp');
961
- var AmplifySetupTotpComponent = /** @class */ (function () {
962
- function AmplifySetupTotpComponent(stateMachine, contextService) {
963
- this.stateMachine = stateMachine;
964
- this.contextService = contextService;
965
- this.customComponents = {};
966
- this.remoteError = '';
967
- this.isPending = false;
1186
+ var logger = new awsAmplify.Logger('SetupTotp');
1187
+ var SetupTotpComponent = /** @class */ (function () {
1188
+ function SetupTotpComponent(authenticator) {
1189
+ this.authenticator = authenticator;
1190
+ this.dataAttr = '';
968
1191
  this.headerText = ui.translate('Setup TOTP');
969
1192
  this.qrCodeSource = '';
970
1193
  // translated texts
971
1194
  this.backToSignInText = ui.translate('Back to Sign In');
972
1195
  this.confirmText = ui.translate('Confirm');
973
1196
  }
974
- AmplifySetupTotpComponent.prototype.ngOnInit = function () {
975
- var _this = this;
976
- this.authSubscription = this.stateMachine.authService.subscribe(function (state) {
977
- _this.onStateUpdate(state);
978
- });
1197
+ SetupTotpComponent.prototype.ngOnInit = function () {
979
1198
  this.generateQRCode();
980
1199
  };
981
- AmplifySetupTotpComponent.prototype.ngAfterContentInit = function () {
982
- this.customComponents = this.contextService.customComponents;
983
- };
984
- AmplifySetupTotpComponent.prototype.ngOnDestroy = function () {
985
- this.authSubscription.unsubscribe();
986
- };
987
- AmplifySetupTotpComponent.prototype.onStateUpdate = function (state) {
988
- var actorState = ui.getActorState(state);
989
- this.remoteError = actorState.context.remoteError;
990
- this.isPending = !actorState.matches('setupTOTP.edit');
991
- };
992
- Object.defineProperty(AmplifySetupTotpComponent.prototype, "context", {
1200
+ Object.defineProperty(SetupTotpComponent.prototype, "context", {
993
1201
  get: function () {
994
- var _b = this.stateMachine.services, change = _b.change, submit = _b.submit;
995
- var remoteError = this.remoteError;
996
- var user = this.stateMachine.user;
997
- return { change: change, remoteError: remoteError, submit: submit, user: user };
1202
+ return this.authenticator.slotContext;
998
1203
  },
999
1204
  enumerable: false,
1000
1205
  configurable: true
1001
1206
  });
1002
- AmplifySetupTotpComponent.prototype.generateQRCode = function () {
1003
- var _a;
1207
+ SetupTotpComponent.prototype.generateQRCode = function () {
1004
1208
  return __awaiter(this, void 0, void 0, function () {
1005
- var state, actorContext, user, secretKey, issuer, totpCode, _b, err_1;
1006
- return __generator(this, function (_c) {
1007
- switch (_c.label) {
1209
+ var state, actorContext, user, secretKey, issuer, totpCode, _a, err_1;
1210
+ return __generator(this, function (_b) {
1211
+ switch (_b.label) {
1008
1212
  case 0:
1009
- state = this.stateMachine.authState;
1213
+ state = this.authenticator.authState;
1010
1214
  actorContext = ui.getActorContext(state);
1011
1215
  user = actorContext.user;
1012
- _c.label = 1;
1216
+ _b.label = 1;
1013
1217
  case 1:
1014
- _c.trys.push([1, 4, , 5]);
1218
+ _b.trys.push([1, 4, , 5]);
1015
1219
  return [4 /*yield*/, awsAmplify.Auth.setupTOTP(user)];
1016
1220
  case 2:
1017
- secretKey = _c.sent();
1221
+ secretKey = _b.sent();
1018
1222
  issuer = 'AWSCognito';
1019
1223
  totpCode = "otpauth://totp/" + issuer + ":" + user.username + "?secret=" + secretKey + "&issuer=" + issuer;
1020
- logger$1.info('totp code was generated:', totpCode);
1021
- _b = this;
1224
+ logger.info('totp code was generated:', totpCode);
1225
+ _a = this;
1022
1226
  return [4 /*yield*/, QRCode__default["default"].toDataURL(totpCode)];
1023
1227
  case 3:
1024
- _b.qrCodeSource = _c.sent();
1228
+ _a.qrCodeSource = _b.sent();
1025
1229
  return [3 /*break*/, 5];
1026
1230
  case 4:
1027
- err_1 = _c.sent();
1028
- this.remoteError = (_a = err_1.message) !== null && _a !== void 0 ? _a : err_1;
1029
- logger$1.error(err_1);
1231
+ err_1 = _b.sent();
1232
+ logger.error(err_1);
1030
1233
  return [3 /*break*/, 5];
1031
1234
  case 5: return [2 /*return*/];
1032
1235
  }
1033
1236
  });
1034
1237
  });
1035
1238
  };
1036
- AmplifySetupTotpComponent.prototype.onInput = function (event) {
1239
+ SetupTotpComponent.prototype.onInput = function (event) {
1037
1240
  event.preventDefault();
1038
- var _b = event.target, name = _b.name, value = _b.value;
1039
- this.stateMachine.send({
1040
- type: 'CHANGE',
1041
- data: { name: name, value: value },
1042
- });
1241
+ var _a = event.target, name = _a.name, value = _a.value;
1242
+ this.authenticator.updateForm({ name: name, value: value });
1043
1243
  };
1044
- AmplifySetupTotpComponent.prototype.onSubmit = function (event) {
1244
+ SetupTotpComponent.prototype.onSubmit = function (event) {
1045
1245
  event.preventDefault();
1046
- // TODO: handle form data within the state machine
1047
- var formData = new FormData(event.target);
1048
- this.stateMachine.send({
1049
- type: 'SUBMIT',
1050
- data: Object.fromEntries(formData),
1051
- });
1052
- };
1053
- AmplifySetupTotpComponent.prototype.toSignIn = function () {
1054
- this.stateMachine.send('SIGN_IN');
1246
+ this.authenticator.submitForm();
1055
1247
  };
1056
- return AmplifySetupTotpComponent;
1248
+ return SetupTotpComponent;
1057
1249
  }());
1058
- AmplifySetupTotpComponent.decorators = [
1250
+ SetupTotpComponent.decorators = [
1059
1251
  { type: i0.Component, args: [{
1060
1252
  selector: 'amplify-setup-totp',
1061
- template: "<!-- \n Define default contents here\n-->\n<ng-template #setupTotpButton>\n <button amplify-button variation=\"primary\" fullWidth=\"true\" type=\"submit\">\n {{ confirmText }}\n </button>\n</ng-template>\n\n<ng-template #setupTotpForm>\n <form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <fieldset\n class=\"amplify-flex\"\n style=\"flex-direction: column\"\n data-amplify-fieldset\n [disabled]=\"isPending\"\n >\n <h3 class=\"amplify-heading\">{{ this.headerText }}</h3>\n <p *ngIf=\"!qrCodeSource\">Loading...</p>\n <img\n *ngIf=\"qrCodeSource\"\n [src]=\"qrCodeSource\"\n alt=\"qr code\"\n data-amplify-qrcode\n />\n <amplify-form-field\n name=\"confirmation_code\"\n label=\"Code *\"\n type=\"text\"\n autocomplete=\"one-time-code\"\n ></amplify-form-field>\n <ng-container\n [ngTemplateOutlet]=\"customComponents.setupTotpButton || setupTotpButton\"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-container>\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n (click)=\"toSignIn()\"\n >\n {{ backToSignInText }}\n </button>\n <amplify-error *ngIf=\"remoteError\">\n {{ remoteError }}\n </amplify-error>\n </fieldset>\n </form>\n</ng-template>\n\n<!-- \n Render sign in component\n-->\n<div data-amplify-container>\n <ng-container\n [ngTemplateOutlet]=\"customComponents.setupTotpForm || setupTotpForm\"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-container>\n</div>\n"
1253
+ template: "<div data-amplify-container>\n <form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <fieldset\n class=\"amplify-flex\"\n style=\"flex-direction: column\"\n data-amplify-fieldset\n [disabled]=\"authenticator.isPending\"\n >\n <amplify-slot name=\"setup-totp-header\" [context]=\"context\">\n <h3 class=\"amplify-heading\">{{ 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 <amplify-form-field\n name=\"confirmation_code\"\n label=\"Code *\"\n type=\"text\"\n autocomplete=\"one-time-code\"\n ></amplify-form-field>\n <button amplify-button variation=\"primary\" fullWidth=\"true\" type=\"submit\">\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</div>\n"
1062
1254
  },] }
1063
1255
  ];
1064
- AmplifySetupTotpComponent.ctorParameters = function () { return [
1065
- { type: StateMachineService },
1066
- { type: AuthPropService }
1256
+ SetupTotpComponent.ctorParameters = function () { return [
1257
+ { type: AuthenticatorService }
1067
1258
  ]; };
1068
- AmplifySetupTotpComponent.propDecorators = {
1069
- customComponents: [{ type: i0.HostBinding, args: ['attr.data-amplify-authenticator-setup-totp',] }]
1259
+ SetupTotpComponent.propDecorators = {
1260
+ dataAttr: [{ type: i0.HostBinding, args: ['attr.data-amplify-authenticator-setup-totp',] }]
1070
1261
  };
1071
1262
 
1072
- var logger = new awsAmplify.Logger('SignIn');
1073
- var AmplifySignInComponent = /** @class */ (function () {
1074
- function AmplifySignInComponent(stateMachine, contextService) {
1075
- this.stateMachine = stateMachine;
1076
- this.contextService = contextService;
1263
+ var SignInComponent = /** @class */ (function () {
1264
+ function SignInComponent(authenticator) {
1265
+ this.authenticator = authenticator;
1077
1266
  this.dataAttr = '';
1078
- this.headerText = ui.translate('Sign in to your account');
1079
- this.customComponents = {};
1080
- this.remoteError = '';
1081
- this.isPending = false;
1082
1267
  // translated phrases
1083
1268
  this.forgotPasswordText = ui.translate('Forgot your password? ');
1084
1269
  this.signInButtonText = ui.translate('Sign in');
1085
- this.noAccountText = ui.translate('No account? ');
1086
1270
  }
1087
- AmplifySignInComponent.prototype.ngOnInit = function () {
1088
- var _this = this;
1089
- this.authSubscription = this.stateMachine.authService.subscribe(function (state) { return _this.onStateUpdate(state); });
1090
- };
1091
- AmplifySignInComponent.prototype.ngAfterContentInit = function () {
1092
- this.customComponents = this.contextService.customComponents;
1093
- };
1094
- AmplifySignInComponent.prototype.ngOnDestroy = function () {
1095
- logger.log('sign in destroyed, unsubscribing from state machine...');
1096
- this.authSubscription.unsubscribe();
1097
- };
1098
- AmplifySignInComponent.prototype.onStateUpdate = function (state) {
1099
- var actorState = ui.getActorState(state);
1100
- this.remoteError = actorState.context.remoteError;
1101
- this.isPending = !actorState.matches('signIn.edit');
1102
- };
1103
- Object.defineProperty(AmplifySignInComponent.prototype, "context", {
1271
+ Object.defineProperty(SignInComponent.prototype, "context", {
1104
1272
  get: function () {
1105
- var _a = this.stateMachine.services, change = _a.change, resetPassword = _a.resetPassword, signUp = _a.signUp, submit = _a.submit;
1106
- var remoteError = this.remoteError;
1107
- return { change: change, remoteError: remoteError, resetPassword: resetPassword, signUp: signUp, submit: submit };
1273
+ return this.authenticator.slotContext;
1108
1274
  },
1109
1275
  enumerable: false,
1110
1276
  configurable: true
1111
1277
  });
1112
- AmplifySignInComponent.prototype.toResetPassword = function () {
1113
- this.stateMachine.send('RESET_PASSWORD');
1114
- };
1115
- AmplifySignInComponent.prototype.onInput = function (event) {
1278
+ SignInComponent.prototype.onInput = function (event) {
1116
1279
  event.preventDefault();
1117
1280
  var _a = event.target, name = _a.name, value = _a.value;
1118
- this.stateMachine.send({
1119
- type: 'CHANGE',
1120
- data: { name: name, value: value },
1121
- });
1281
+ this.authenticator.updateForm({ name: name, value: value });
1122
1282
  };
1123
- AmplifySignInComponent.prototype.onSubmit = function (event) {
1124
- return __awaiter(this, void 0, void 0, function () {
1125
- return __generator(this, function (_a) {
1126
- event.preventDefault();
1127
- this.stateMachine.send({
1128
- type: 'SUBMIT',
1129
- });
1130
- return [2 /*return*/];
1131
- });
1132
- });
1283
+ SignInComponent.prototype.onSubmit = function (event) {
1284
+ event.preventDefault();
1285
+ this.authenticator.submitForm();
1133
1286
  };
1134
- return AmplifySignInComponent;
1287
+ return SignInComponent;
1135
1288
  }());
1136
- AmplifySignInComponent.decorators = [
1289
+ SignInComponent.decorators = [
1137
1290
  { type: i0.Component, args: [{
1138
1291
  selector: 'amplify-sign-in',
1139
- template: "<!-- \n Define default contents here\n-->\n<ng-template #signInButton>\n <button amplify-button variation=\"primary\" fullWidth=\"true\" type=\"submit\">\n {{ signInButtonText }}\n </button>\n</ng-template>\n\n<ng-template #signInForm>\n <form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <fieldset\n class=\"amplify-flex\"\n style=\"flex-direction: column\"\n data-amplify-fieldset\n [disabled]=\"isPending\"\n >\n <h3 class=\"amplify-heading\">{{ this.headerText }}</h3>\n <amplify-user-name-alias></amplify-user-name-alias>\n <amplify-form-field\n data-amplify-password\n name=\"password\"\n type=\"password\"\n autocomplete=\"current-password\"\n ></amplify-form-field>\n <ng-container\n [ngTemplateOutlet]=\"customComponents.signInButton || signInButton\"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-container>\n <button\n amplify-button\n fontWeight=\"normal\"\n size=\"small\"\n variation=\"link\"\n (click)=\"toResetPassword()\"\n >\n {{ forgotPasswordText }}\n </button>\n <amplify-error *ngIf=\"remoteError\">\n {{ remoteError }}\n </amplify-error>\n </fieldset>\n <amplify-federated-sign-in></amplify-federated-sign-in>\n </form>\n</ng-template>\n\n<!-- \n Render sign in component\n-->\n\n<div data-amplify-container>\n <ng-container\n [ngTemplateOutlet]=\"customComponents.signInForm || signInForm\"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-container>\n</div>\n",
1292
+ template: "<div data-amplify-container>\n <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\"\n style=\"flex-direction: column\"\n data-amplify-fieldset\n [disabled]=\"authenticator.isPending\"\n >\n <amplify-user-name-alias></amplify-user-name-alias>\n <amplify-form-field\n data-amplify-password\n name=\"password\"\n type=\"password\"\n autocomplete=\"current-password\"\n ></amplify-form-field>\n <button amplify-button variation=\"primary\" fullWidth=\"true\" type=\"submit\">\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</div>\n",
1140
1293
  encapsulation: i0.ViewEncapsulation.None
1141
1294
  },] }
1142
1295
  ];
1143
- AmplifySignInComponent.ctorParameters = function () { return [
1144
- { type: StateMachineService },
1145
- { type: AuthPropService }
1296
+ SignInComponent.ctorParameters = function () { return [
1297
+ { type: AuthenticatorService }
1146
1298
  ]; };
1147
- AmplifySignInComponent.propDecorators = {
1148
- dataAttr: [{ type: i0.HostBinding, args: ['attr.data-amplify-authenticator-signin',] }],
1149
- headerText: [{ type: i0.Input }]
1299
+ SignInComponent.propDecorators = {
1300
+ dataAttr: [{ type: i0.HostBinding, args: ['attr.data-amplify-authenticator-signin',] }]
1150
1301
  };
1151
1302
 
1152
- var AmplifySignUpComponent = /** @class */ (function () {
1153
- function AmplifySignUpComponent(stateMachine, contextService) {
1154
- this.stateMachine = stateMachine;
1155
- this.contextService = contextService;
1303
+ var SignUpComponent = /** @class */ (function () {
1304
+ function SignUpComponent(authenticator) {
1305
+ this.authenticator = authenticator;
1156
1306
  this.dataAttr = '';
1157
- this.headerText = ui.translate('Create a new account');
1158
- this.remoteError = '';
1159
- this.isPending = false;
1160
- this.primaryAlias = '';
1161
- this.secondaryAliases = [];
1162
- this.validationError = {};
1163
1307
  // translated texts
1164
1308
  this.createAccountText = ui.translate('Create Account');
1165
1309
  }
1166
- Object.defineProperty(AmplifySignUpComponent.prototype, "context", {
1310
+ Object.defineProperty(SignUpComponent.prototype, "context", {
1167
1311
  get: function () {
1168
- var _a = this.stateMachine.services, change = _a.change, signIn = _a.signIn, submit = _a.submit;
1169
- var remoteError = this.remoteError;
1170
- var validationError = this.validationError;
1171
- return {
1172
- change: change,
1173
- remoteError: remoteError,
1174
- signIn: signIn,
1175
- submit: submit,
1176
- validationError: validationError,
1177
- };
1312
+ return this.authenticator.slotContext;
1178
1313
  },
1179
1314
  enumerable: false,
1180
1315
  configurable: true
1181
1316
  });
1182
- AmplifySignUpComponent.prototype.ngOnInit = function () {
1183
- var _this = this;
1184
- this.authSubscription = this.stateMachine.authService.subscribe(function (state) { return _this.onStateUpdate(state); });
1185
- var context = this.stateMachine.context;
1186
- var _a = ui.getConfiguredAliases(context), primaryAlias = _a.primaryAlias, secondaryAliases = _a.secondaryAliases;
1187
- /**
1188
- * If the login_mechanisms are configured to use ONLY username, we need
1189
- * to ask for some sort of secondary contact information in order to
1190
- * verify the user for Cognito. Currently matching this to how Vue is
1191
- * set up.
1192
- */
1193
- if (primaryAlias === 'username' && lodash.isEmpty(secondaryAliases)) {
1194
- secondaryAliases.push('email', 'phone_number');
1195
- }
1196
- this.primaryAlias = primaryAlias;
1197
- this.secondaryAliases = secondaryAliases;
1198
- };
1199
- AmplifySignUpComponent.prototype.ngAfterContentInit = function () {
1200
- this.customComponents = this.contextService.customComponents;
1201
- };
1202
- AmplifySignUpComponent.prototype.ngOnDestroy = function () {
1203
- this.authSubscription.unsubscribe();
1204
- };
1205
- AmplifySignUpComponent.prototype.onStateUpdate = function (state) {
1206
- var actorState = ui.getActorState(state);
1207
- var actorContext = ui.getActorContext(state);
1208
- this.remoteError = actorContext.remoteError;
1209
- this.validationError = actorContext.validationError;
1210
- this.isPending = !actorState.matches({
1211
- signUp: {
1212
- submission: 'idle',
1213
- },
1214
- });
1317
+ SignUpComponent.prototype.onInput = function (event) {
1318
+ var _a = event.target, checked = _a.checked, name = _a.name, type = _a.type, value = _a.value;
1319
+ if (type === 'checkbox' && !checked)
1320
+ value = undefined;
1321
+ this.authenticator.updateForm({ name: name, value: value });
1215
1322
  };
1216
- AmplifySignUpComponent.prototype.onSubmit = function ($event) {
1217
- return __awaiter(this, void 0, void 0, function () {
1218
- return __generator(this, function (_a) {
1219
- $event.preventDefault();
1220
- this.stateMachine.send('SUBMIT');
1221
- return [2 /*return*/];
1222
- });
1223
- });
1224
- };
1225
- AmplifySignUpComponent.prototype.onInput = function (event) {
1323
+ SignUpComponent.prototype.onSubmit = function (event) {
1226
1324
  event.preventDefault();
1227
- var _a = event.target, name = _a.name, value = _a.value;
1228
- this.stateMachine.send({
1229
- type: 'CHANGE',
1230
- data: { name: name, value: value },
1231
- });
1325
+ this.authenticator.submitForm();
1232
1326
  };
1233
- return AmplifySignUpComponent;
1327
+ return SignUpComponent;
1234
1328
  }());
1235
- AmplifySignUpComponent.decorators = [
1329
+ SignUpComponent.decorators = [
1236
1330
  { type: i0.Component, args: [{
1237
1331
  selector: 'amplify-sign-up',
1238
- template: "<ng-template #signUpButton>\n <button amplify-button variation=\"primary\" fullWidth=\"true\" type=\"submit\">\n {{ createAccountText }}\n </button>\n</ng-template>\n\n<ng-template #signUpUsername>\n <amplify-user-name-alias [name]=\"primaryAlias\"></amplify-user-name-alias>\n</ng-template>\n\n<ng-template #signUpPassword>\n <amplify-form-field\n name=\"password\"\n autocomplete=\"new-password\"\n ></amplify-form-field>\n</ng-template>\n\n<ng-template #signUpConfirmPassword>\n <amplify-form-field\n name=\"confirm_password\"\n label=\"Confirm Password\"\n type=\"password\"\n autocomplete=\"new-password\"\n ></amplify-form-field>\n</ng-template>\n\n<ng-template #signUpFieldset>\n <fieldset\n class=\"amplify-flex\"\n style=\"flex-direction: column\"\n data-amplify-fieldset\n [disabled]=\"isPending\"\n >\n <h3 class=\"amplify-heading\">{{ this.headerText }}</h3>\n <ng-container\n [ngTemplateOutlet]=\"customComponents.signUpUsername || signUpUsername\"\n [ngTemplateOutletContext]=\"context\"\n ></ng-container>\n\n <ng-container\n [ngTemplateOutlet]=\"customComponents.signUpPassword || signUpPassword\"\n [ngTemplateOutletContext]=\"context\"\n ></ng-container>\n\n <ng-container\n [ngTemplateOutlet]=\"\n customComponents.signUpConfirmPassword || signUpConfirmPassword\n \"\n [ngTemplateOutletContext]=\"context\"\n ></ng-container>\n\n <ng-container *ngFor=\"let secondaryAlias of secondaryAliases\">\n <amplify-form-field [name]=\"secondaryAlias\"></amplify-form-field>\n </ng-container>\n <ng-container\n [ngTemplateOutlet]=\"customComponents.signUpButton || signUpButton\"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-container>\n <amplify-error *ngIf=\"remoteError\">\n {{ remoteError }}\n </amplify-error>\n </fieldset>\n <amplify-federated-sign-in></amplify-federated-sign-in>\n</ng-template>\n\n<div data-amplify-container>\n <form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <ng-container\n [ngTemplateOutlet]=\"customComponents.signUpFieldset || signUpFieldset\"\n [ngTemplateOutletContext]=\"context\"\n ></ng-container>\n </form>\n</div>\n"
1332
+ 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\" style=\"flex-direction: column\">\n <div class=\"amplify-flex\" style=\"flex-direction: 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 [disabled]=\"\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"
1239
1333
  },] }
1240
1334
  ];
1241
- AmplifySignUpComponent.ctorParameters = function () { return [
1242
- { type: StateMachineService },
1243
- { type: AuthPropService }
1335
+ SignUpComponent.ctorParameters = function () { return [
1336
+ { type: AuthenticatorService }
1244
1337
  ]; };
1245
- AmplifySignUpComponent.propDecorators = {
1246
- dataAttr: [{ type: i0.HostBinding, args: ['attr.data-amplify-authenticator-signup',] }],
1247
- headerText: [{ type: i0.Input }]
1338
+ SignUpComponent.propDecorators = {
1339
+ dataAttr: [{ type: i0.HostBinding, args: ['attr.data-amplify-authenticator-signup',] }]
1248
1340
  };
1249
1341
 
1250
- var getAttributeMap = function () { return ui.authInputAttributes; };
1251
-
1252
- var AmplifyVerifyUserComponent = /** @class */ (function () {
1253
- function AmplifyVerifyUserComponent(stateMachine, contextService) {
1254
- this.stateMachine = stateMachine;
1255
- this.contextService = contextService;
1256
- this.dataAttr = '';
1257
- this.headerText = ui.translate('Account recovery requires verified contact information');
1258
- this.customComponents = {};
1259
- this.unverifiedAttributes = {};
1260
- this.remoteError = '';
1261
- this.isPending = false;
1262
- this.labelId = nanoid.nanoid(12);
1263
- // translated texts
1264
- this.skipText = ui.translate('Skip');
1265
- this.verifyText = ui.translate('Verify');
1342
+ var SignUpFormFieldsComponent = /** @class */ (function () {
1343
+ function SignUpFormFieldsComponent(authenticator) {
1344
+ this.authenticator = authenticator;
1345
+ this.primaryAlias = '';
1346
+ this.secondaryAliases = [];
1266
1347
  }
1267
- AmplifyVerifyUserComponent.prototype.ngOnInit = function () {
1268
- var _this = this;
1269
- this.authSubscription = this.stateMachine.authService.subscribe(function (state) { return _this.onStateUpdate(state); });
1270
- };
1271
- AmplifyVerifyUserComponent.prototype.ngAfterContentInit = function () {
1272
- this.customComponents = this.contextService.customComponents;
1273
- };
1274
- AmplifyVerifyUserComponent.prototype.ngOnDestroy = function () {
1275
- this.authSubscription.unsubscribe();
1276
- };
1277
- AmplifyVerifyUserComponent.prototype.onStateUpdate = function (state) {
1278
- var actorState = ui.getActorState(state);
1279
- this.unverifiedAttributes = actorState.context.unverifiedAttributes;
1280
- this.remoteError = actorState.context.remoteError;
1281
- this.isPending = !actorState.matches('verifyUser.edit');
1282
- };
1283
- Object.defineProperty(AmplifyVerifyUserComponent.prototype, "context", {
1284
- get: function () {
1285
- var _b = this.stateMachine.services, change = _b.change, skip = _b.skip, submit = _b.submit;
1286
- var remoteError = this.remoteError;
1287
- return { change: change, remoteError: remoteError, skip: skip, submit: submit };
1288
- },
1289
- enumerable: false,
1290
- configurable: true
1291
- });
1292
- AmplifyVerifyUserComponent.prototype.skipVerify = function () {
1293
- this.stateMachine.send('SKIP');
1294
- };
1295
- AmplifyVerifyUserComponent.prototype.getLabelForAttr = function (authAttr) {
1296
- var _a;
1297
- var attributeMap = getAttributeMap();
1298
- var label = (_a = attributeMap[authAttr]) === null || _a === void 0 ? void 0 : _a.label;
1299
- return ui.translate(label);
1300
- };
1301
- AmplifyVerifyUserComponent.prototype.onSubmit = function (event) {
1302
- return __awaiter(this, void 0, void 0, function () {
1303
- var formData;
1304
- return __generator(this, function (_b) {
1305
- event.preventDefault();
1306
- formData = new FormData(event.target);
1307
- this.stateMachine.send({
1308
- type: 'SUBMIT',
1309
- data: Object.fromEntries(formData),
1310
- });
1311
- return [2 /*return*/];
1312
- });
1348
+ SignUpFormFieldsComponent.prototype.ngOnInit = function () {
1349
+ var context = this.authenticator.context;
1350
+ var _a = context.config, loginMechanisms = _a.loginMechanisms, signUpAttributes = _a.signUpAttributes;
1351
+ this.fieldNames = Array.from(new Set(__spread(loginMechanisms, signUpAttributes)));
1352
+ this.fieldNames = this.fieldNames.filter(function (fieldName) {
1353
+ var hasDefaultField = !!ui.authInputAttributes[fieldName];
1354
+ if (!hasDefaultField) {
1355
+ console.debug("Authenticator does not have a default implementation for " + fieldName + ". Customize Authenticator.SignUp.FormFields to add your own.");
1356
+ }
1357
+ return hasDefaultField;
1313
1358
  });
1359
+ // Only 1 is supported, so `['email', 'phone_number']` will only show `email`
1360
+ this.loginMechanism = this.fieldNames.shift();
1314
1361
  };
1315
- return AmplifyVerifyUserComponent;
1362
+ return SignUpFormFieldsComponent;
1316
1363
  }());
1317
- AmplifyVerifyUserComponent.decorators = [
1364
+ SignUpFormFieldsComponent.decorators = [
1318
1365
  { type: i0.Component, args: [{
1319
- selector: 'amplify-verify-user',
1320
- template: "<!-- \n Define default contents here\n-->\n<ng-template #verifyButton>\n <button amplify-button variation=\"primary\" fullWidth=\"true\" type=\"submit\">\n {{ verifyText }}\n </button>\n</ng-template>\n\n<ng-template #verifyUserForm>\n <form data-amplify-form (submit)=\"onSubmit($event)\">\n <fieldset\n class=\"amplify-flex\"\n style=\"flex-direction: column\"\n data-amplify-fieldset\n [disabled]=\"isPending\"\n >\n <h3 class=\"amplify-heading\">{{ this.headerText }}</h3>\n\n <div *ngFor=\"let unverifiedAttribute of unverifiedAttributes | keyvalue\">\n <!-- TODO: match React implementation -->\n <input\n name=\"unverifiedAttr\"\n type=\"radio\"\n [value]=\"unverifiedAttribute.key\"\n [id]=\"labelId\"\n />\n <label [for]=\"labelId\">{{\n getLabelForAttr(unverifiedAttribute.key)\n }}</label>\n </div>\n\n <ng-container\n [ngTemplateOutlet]=\"customComponents.verifyButton || verifyButton\"\n [ngTemplateOutletContext]=\"context\"\n ></ng-container>\n\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n (click)=\"skipVerify()\"\n >\n {{ skipText }}\n </button>\n\n <amplify-error *ngIf=\"remoteError\">\n {{ remoteError }}\n </amplify-error>\n </fieldset>\n </form>\n</ng-template>\n\n<!-- \n Render verify user component\n-->\n<div data-amplify-container>\n <ng-container\n [ngTemplateOutlet]=\"customComponents.verifyUserForm || verifyUserForm\"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-container>\n</div>\n",
1321
- encapsulation: i0.ViewEncapsulation.None
1366
+ selector: 'amplify-sign-up-form-fields',
1367
+ template: "<div class=\"amplify-flex\" style=\"flex-direction: column\" data-amplify-fieldset>\n <amplify-user-name-alias [name]=\"loginMechanism\"></amplify-user-name-alias>\n <amplify-form-field\n name=\"password\"\n autocomplete=\"new-password\"\n ></amplify-form-field>\n <amplify-form-field\n name=\"confirm_password\"\n label=\"Confirm Password\"\n type=\"password\"\n autocomplete=\"new-password\"\n ></amplify-form-field>\n\n <ng-container *ngFor=\"let field of fieldNames\">\n <amplify-form-field\n [name]=\"field\"\n [labelHidden]=\"false\"\n ></amplify-form-field>\n </ng-container>\n</div>\n"
1322
1368
  },] }
1323
1369
  ];
1324
- AmplifyVerifyUserComponent.ctorParameters = function () { return [
1325
- { type: StateMachineService },
1326
- { type: AuthPropService }
1370
+ SignUpFormFieldsComponent.ctorParameters = function () { return [
1371
+ { type: AuthenticatorService }
1327
1372
  ]; };
1328
- AmplifyVerifyUserComponent.propDecorators = {
1329
- dataAttr: [{ type: i0.HostBinding, args: ['attr.data-amplify-authenticator-verifyuser',] }],
1330
- headerText: [{ type: i0.Input }]
1331
- };
1332
1373
 
1333
- var ConfirmResetPasswordComponent = /** @class */ (function () {
1334
- function ConfirmResetPasswordComponent(stateMachine, contextService) {
1335
- this.stateMachine = stateMachine;
1336
- this.contextService = contextService;
1337
- this.dataAttr = '';
1338
- this.headerText = ui.translate('Reset your password');
1339
- this.customComponents = {};
1340
- this.remoteError = '';
1341
- this.isPending = false;
1342
- // translated strings
1343
- this.sendCodeText = ui.translate('Send Code');
1344
- this.backToSignInText = ui.translate('Back to Sign In');
1345
- this.lostCodeText = ui.translate('Lost your code? ');
1346
- this.resendCodeText = ui.translate('Resend Code');
1374
+ var UserNameAliasComponent = /** @class */ (function () {
1375
+ function UserNameAliasComponent(authenticator) {
1376
+ this.authenticator = authenticator;
1377
+ this.name = 'username';
1378
+ this.disabled = false;
1379
+ this.initialValue = '';
1380
+ this.required = true;
1347
1381
  }
1348
- ConfirmResetPasswordComponent.prototype.ngOnInit = function () {
1349
- var _this = this;
1350
- this.authSubscription = this.stateMachine.authService.subscribe(function (state) { return _this.onStateUpdate(state); });
1351
- };
1352
- ConfirmResetPasswordComponent.prototype.ngAfterContentInit = function () {
1353
- this.customComponents = this.contextService.customComponents;
1354
- };
1355
- ConfirmResetPasswordComponent.prototype.ngOnDestroy = function () {
1356
- this.authSubscription.unsubscribe();
1357
- };
1358
- ConfirmResetPasswordComponent.prototype.onStateUpdate = function (state) {
1359
- var actorState = ui.getActorState(state);
1360
- this.remoteError = actorState.context.remoteError;
1361
- this.isPending = !actorState.matches('confirmResetPassword.edit');
1362
- };
1363
- Object.defineProperty(ConfirmResetPasswordComponent.prototype, "context", {
1364
- get: function () {
1365
- var _a = this.stateMachine.services, change = _a.change, resend = _a.resend, signIn = _a.signIn, submit = _a.submit;
1366
- var remoteError = this.remoteError;
1367
- return { change: change, resend: resend, remoteError: remoteError, signIn: signIn, submit: submit };
1368
- },
1369
- enumerable: false,
1370
- configurable: true
1371
- });
1372
- ConfirmResetPasswordComponent.prototype.toSignIn = function () {
1373
- this.stateMachine.send('SIGN_IN');
1374
- };
1375
- ConfirmResetPasswordComponent.prototype.resend = function () {
1376
- this.stateMachine.send('RESEND');
1377
- };
1378
- ConfirmResetPasswordComponent.prototype.onInput = function (event) {
1379
- event.preventDefault();
1380
- var _a = event.target, name = _a.name, value = _a.value;
1381
- this.stateMachine.send({
1382
- type: 'CHANGE',
1383
- data: { name: name, value: value },
1384
- });
1385
- };
1386
- ConfirmResetPasswordComponent.prototype.onSubmit = function (event) {
1387
- return __awaiter(this, void 0, void 0, function () {
1388
- return __generator(this, function (_a) {
1389
- event.preventDefault();
1390
- this.stateMachine.send('SUBMIT');
1391
- return [2 /*return*/];
1392
- });
1393
- });
1382
+ UserNameAliasComponent.prototype.ngOnInit = function () {
1383
+ var context = this.authenticator.context;
1384
+ var _a = ui.getAliasInfoFromContext(context), label = _a.label, type = _a.type;
1385
+ this.label = label;
1386
+ this.type = type;
1387
+ this.placeholder = label;
1394
1388
  };
1395
- return ConfirmResetPasswordComponent;
1389
+ return UserNameAliasComponent;
1396
1390
  }());
1397
- ConfirmResetPasswordComponent.decorators = [
1391
+ UserNameAliasComponent.decorators = [
1398
1392
  { type: i0.Component, args: [{
1399
- selector: 'amplify-confirm-reset-password',
1400
- template: "<!-- \n Define default contents here\n-->\n<ng-template #confirmResetPasswordSubmitButton>\n <button amplify-button variation=\"primary\" fullWidth=\"true\" type=\"submit\">\n {{ sendCodeText }}\n </button>\n</ng-template>\n<ng-template #confirmResetPasswordForm>\n <form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <fieldset\n class=\"amplify-flex\"\n style=\"flex-direction: column\"\n data-amplify-fieldset\n [disabled]=\"isPending\"\n >\n <h3 class=\"amplify-heading\">{{ headerText }}</h3>\n <amplify-form-field\n name=\"confirmation_code\"\n type=\"number\"\n autocomplete=\"one-time-code\"\n ></amplify-form-field>\n <amplify-form-field\n name=\"password\"\n label=\"New password\"\n autocomplete=\"new-password\"\n ></amplify-form-field>\n\n <ng-container\n [ngTemplateOutlet]=\"\n customComponents.confirmResetPasswordSubmitButton ||\n confirmResetPasswordSubmitButton\n \"\n [ngTemplateOutletContext]=\"context\"\n ></ng-container>\n\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n type=\"button\"\n (click)=\"resend()\"\n >\n {{ resendCodeText }}\n </button>\n\n <amplify-error *ngIf=\"remoteError\">\n {{ remoteError }}\n </amplify-error>\n </fieldset>\n </form>\n</ng-template>\n\n<!-- \n Render confirm reset password component\n-->\n<div data-amplify-container>\n <ng-container\n [ngTemplateOutlet]=\"\n customComponents.confirmResetPasswordForm || confirmResetPasswordForm\n \"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-container>\n</div>\n"
1393
+ selector: 'amplify-user-name-alias',
1394
+ template: "<amplify-form-field\n data-amplify-usernamealias\n [name]=\"name\"\n [label]=\"label\"\n [type]=\"type\"\n [placeholder]=\"placeholder\"\n [initialValue]=\"initialValue\"\n [disabled]=\"disabled\"\n [required]=\"required\"\n autocomplete=\"username\"\n>\n</amplify-form-field>\n"
1401
1395
  },] }
1402
1396
  ];
1403
- ConfirmResetPasswordComponent.ctorParameters = function () { return [
1404
- { type: StateMachineService },
1405
- { type: AuthPropService }
1397
+ UserNameAliasComponent.ctorParameters = function () { return [
1398
+ { type: AuthenticatorService }
1406
1399
  ]; };
1407
- ConfirmResetPasswordComponent.propDecorators = {
1408
- dataAttr: [{ type: i0.HostBinding, args: ['attr.data-amplify-authenticator-confirmsignin',] }],
1409
- headerText: [{ type: i0.Input }]
1400
+ UserNameAliasComponent.propDecorators = {
1401
+ name: [{ type: i0.Input }],
1402
+ disabled: [{ type: i0.Input }],
1403
+ initialValue: [{ type: i0.Input }],
1404
+ required: [{ type: i0.Input }]
1410
1405
  };
1411
1406
 
1412
- var ConfirmVerifyUserComponent = /** @class */ (function () {
1413
- function ConfirmVerifyUserComponent(stateMachine, contextService) {
1414
- this.stateMachine = stateMachine;
1415
- this.contextService = contextService;
1407
+ var VerifyUserComponent = /** @class */ (function () {
1408
+ function VerifyUserComponent(authenticator) {
1409
+ this.authenticator = authenticator;
1416
1410
  this.dataAttr = '';
1417
1411
  this.headerText = ui.translate('Account recovery requires verified contact information');
1418
- this.customComponents = {};
1419
- this.remoteError = '';
1420
- this.isPending = false;
1412
+ this.unverifiedAttributes = {};
1413
+ this.labelId = nanoid.nanoid(12);
1421
1414
  // translated texts
1422
1415
  this.skipText = ui.translate('Skip');
1423
- this.submitText = ui.translate('Submit');
1416
+ this.verifyText = ui.translate('Verify');
1424
1417
  }
1425
- ConfirmVerifyUserComponent.prototype.ngOnInit = function () {
1426
- var _this = this;
1427
- this.authSubscription = this.stateMachine.authService.subscribe(function (state) { return _this.onStateUpdate(state); });
1428
- };
1429
- ConfirmVerifyUserComponent.prototype.ngAfterContentInit = function () {
1430
- this.customComponents = this.contextService.customComponents;
1431
- };
1432
- ConfirmVerifyUserComponent.prototype.ngOnDestroy = function () {
1433
- this.authSubscription.unsubscribe();
1434
- };
1435
- ConfirmVerifyUserComponent.prototype.onStateUpdate = function (state) {
1436
- var actorState = ui.getActorState(state);
1437
- this.remoteError = actorState.context.remoteError;
1438
- this.isPending = !actorState.matches('confirmVerifyUser.edit');
1418
+ VerifyUserComponent.prototype.ngOnInit = function () {
1419
+ var actorState = ui.getActorState(this.authenticator.authState);
1420
+ this.unverifiedAttributes = actorState.context.unverifiedAttributes;
1439
1421
  };
1440
- Object.defineProperty(ConfirmVerifyUserComponent.prototype, "context", {
1422
+ Object.defineProperty(VerifyUserComponent.prototype, "context", {
1441
1423
  get: function () {
1442
- var _a = this.stateMachine.services, skip = _a.skip, submit = _a.submit;
1443
- var remoteError = this.remoteError;
1444
- return { remoteError: remoteError, skip: skip, submit: submit };
1424
+ return this.authenticator.slotContext;
1445
1425
  },
1446
1426
  enumerable: false,
1447
1427
  configurable: true
1448
1428
  });
1449
- ConfirmVerifyUserComponent.prototype.skipVerify = function () {
1450
- this.stateMachine.send('SKIP');
1429
+ VerifyUserComponent.prototype.getLabelForAttr = function (authAttr) {
1430
+ var _a;
1431
+ var attributeMap = getAttributeMap();
1432
+ var label = (_a = attributeMap[authAttr]) === null || _a === void 0 ? void 0 : _a.label;
1433
+ return ui.translate(label);
1451
1434
  };
1452
- ConfirmVerifyUserComponent.prototype.onSubmit = function (event) {
1453
- return __awaiter(this, void 0, void 0, function () {
1454
- var formData;
1455
- return __generator(this, function (_a) {
1456
- event.preventDefault();
1457
- formData = new FormData(event.target);
1458
- this.stateMachine.send({
1459
- type: 'SUBMIT',
1460
- data: Object.fromEntries(formData),
1461
- });
1462
- return [2 /*return*/];
1463
- });
1464
- });
1435
+ VerifyUserComponent.prototype.onInput = function (event) {
1436
+ event.preventDefault();
1437
+ var _b = event.target, name = _b.name, value = _b.value;
1438
+ this.authenticator.updateForm({ name: name, value: value });
1465
1439
  };
1466
- return ConfirmVerifyUserComponent;
1440
+ VerifyUserComponent.prototype.onSubmit = function (event) {
1441
+ event.preventDefault();
1442
+ this.authenticator.submitForm();
1443
+ };
1444
+ return VerifyUserComponent;
1467
1445
  }());
1468
- ConfirmVerifyUserComponent.decorators = [
1446
+ VerifyUserComponent.decorators = [
1469
1447
  { type: i0.Component, args: [{
1470
- selector: 'amplify-confirm-verify-user',
1471
- template: "<!-- \n Define default contents here\n-->\n<ng-template #confirmVerifyButton>\n <button amplify-button variation=\"primary\" fullWidth=\"true\" type=\"submit\">\n {{ submitText }}\n </button>\n</ng-template>\n\n<ng-template #confirmVerifyUserForm>\n <form data-amplify-form (submit)=\"onSubmit($event)\">\n <fieldset\n class=\"amplify-flex\"\n style=\"flex-direction: column\"\n data-amplify-fieldset\n [disabled]=\"isPending\"\n >\n <h3 class=\"amplify-heading\">{{ this.headerText }}</h3>\n <amplify-form-field\n name=\"confirmation_code\"\n type=\"number\"\n autocomplete=\"one-time-code\"\n ></amplify-form-field>\n <ng-container\n [ngTemplateOutlet]=\"\n customComponents.confirmVerifyButton || confirmVerifyButton\n \"\n [ngTemplateOutletContext]=\"context\"\n ></ng-container>\n\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n (click)=\"skipVerify()\"\n >\n {{ skipText }}\n </button>\n <amplify-error *ngIf=\"remoteError\">\n {{ remoteError }}\n </amplify-error>\n </fieldset>\n </form>\n</ng-template>\n\n<!-- \n Render confirm reset password component\n-->\n<div data-amplify-container>\n <ng-container\n [ngTemplateOutlet]=\"\n customComponents.confirmVerifyUserForm || confirmVerifyUserForm\n \"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-container>\n</div>\n"
1448
+ selector: 'amplify-verify-user',
1449
+ template: "<div data-amplify-container>\n <form data-amplify-form (input)=\"onInput($event)\" (submit)=\"onSubmit($event)\">\n <fieldset\n class=\"amplify-flex\"\n style=\"flex-direction: column\"\n data-amplify-fieldset\n [disabled]=\"authenticator.isPending\"\n >\n <amplify-slot name=\"verify-user-header\" [context]=\"context\">\n <h3 class=\"amplify-heading\">{{ this.headerText }}</h3>\n </amplify-slot>\n\n <div *ngFor=\"let unverifiedAttribute of unverifiedAttributes | keyvalue\">\n <input\n name=\"unverifiedAttr\"\n type=\"radio\"\n [value]=\"unverifiedAttribute.key\"\n [id]=\"labelId\"\n />\n <label [for]=\"labelId\">{{\n getLabelForAttr(unverifiedAttribute.key)\n }}</label>\n </div>\n\n <button amplify-button variation=\"primary\" fullWidth=\"true\" type=\"submit\">\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</div>\n",
1450
+ encapsulation: i0.ViewEncapsulation.None
1472
1451
  },] }
1473
1452
  ];
1474
- ConfirmVerifyUserComponent.ctorParameters = function () { return [
1475
- { type: StateMachineService },
1476
- { type: AuthPropService }
1453
+ VerifyUserComponent.ctorParameters = function () { return [
1454
+ { type: AuthenticatorService }
1477
1455
  ]; };
1478
- ConfirmVerifyUserComponent.propDecorators = {
1479
- dataAttr: [{ type: i0.HostBinding, args: ['attr.data-amplify-authenticator-confirmverifyuser',] }],
1456
+ VerifyUserComponent.propDecorators = {
1457
+ dataAttr: [{ type: i0.HostBinding, args: ['attr.data-amplify-authenticator-verifyuser',] }],
1480
1458
  headerText: [{ type: i0.Input }]
1481
1459
  };
1482
1460
 
1483
- var AmplifyButtonComponent = /** @class */ (function () {
1484
- function AmplifyButtonComponent() {
1461
+ var ButtonComponent = /** @class */ (function () {
1462
+ function ButtonComponent() {
1485
1463
  this.type = 'button';
1486
1464
  this.fullWidth = false;
1487
1465
  this.size = 'medium';
@@ -1489,22 +1467,22 @@
1489
1467
  this.fontWeight = 'normal';
1490
1468
  this.defaultClass = true;
1491
1469
  }
1492
- AmplifyButtonComponent.prototype.ngOnInit = function () {
1470
+ ButtonComponent.prototype.ngOnInit = function () {
1493
1471
  this.typeAttr = this.type;
1494
1472
  this.fullWidthAttr = this.fullWidth;
1495
1473
  this.sizeAttr = this.size;
1496
1474
  this.variationAttr = this.variation;
1497
1475
  this.fontWeightAttr = this.fontWeight;
1498
1476
  };
1499
- return AmplifyButtonComponent;
1477
+ return ButtonComponent;
1500
1478
  }());
1501
- AmplifyButtonComponent.decorators = [
1479
+ ButtonComponent.decorators = [
1502
1480
  { type: i0.Component, args: [{
1503
1481
  selector: 'button[amplify-button]',
1504
1482
  template: "<ng-content></ng-content>\n"
1505
1483
  },] }
1506
1484
  ];
1507
- AmplifyButtonComponent.propDecorators = {
1485
+ ButtonComponent.propDecorators = {
1508
1486
  type: [{ type: i0.Input }],
1509
1487
  fullWidth: [{ type: i0.Input }],
1510
1488
  size: [{ type: i0.Input }],
@@ -1518,163 +1496,146 @@
1518
1496
  fontWeightAttr: [{ type: i0.HostBinding, args: ['style.font-weight',] }]
1519
1497
  };
1520
1498
 
1521
- var AmplifyErrorComponent = /** @class */ (function () {
1522
- function AmplifyErrorComponent() {
1499
+ var CheckboxComponent = /** @class */ (function () {
1500
+ function CheckboxComponent() {
1501
+ this.defaultChecked = false;
1502
+ this.hasError = false;
1503
+ this.isChecked = false;
1504
+ }
1505
+ CheckboxComponent.prototype.ngOnInit = function () {
1506
+ if (this.defaultChecked) {
1507
+ this.isChecked = true;
1508
+ }
1509
+ };
1510
+ CheckboxComponent.prototype.handleClick = function () {
1511
+ this.isChecked = !this.isChecked;
1512
+ };
1513
+ return CheckboxComponent;
1514
+ }());
1515
+ CheckboxComponent.decorators = [
1516
+ { type: i0.Component, args: [{
1517
+ selector: 'amplify-checkbox',
1518
+ 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 [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 >\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"
1519
+ },] }
1520
+ ];
1521
+ CheckboxComponent.propDecorators = {
1522
+ defaultChecked: [{ type: i0.Input }],
1523
+ errorMessage: [{ type: i0.Input }],
1524
+ hasError: [{ type: i0.Input }],
1525
+ label: [{ type: i0.Input }],
1526
+ name: [{ type: i0.Input }],
1527
+ value: [{ type: i0.Input }]
1528
+ };
1529
+
1530
+ var ErrorComponent = /** @class */ (function () {
1531
+ function ErrorComponent() {
1532
+ this.isVisible = true;
1523
1533
  }
1524
- return AmplifyErrorComponent;
1534
+ ErrorComponent.prototype.close = function () {
1535
+ this.isVisible = false;
1536
+ };
1537
+ return ErrorComponent;
1525
1538
  }());
1526
- AmplifyErrorComponent.decorators = [
1539
+ ErrorComponent.decorators = [
1527
1540
  { type: i0.Component, args: [{
1528
1541
  selector: 'amplify-error',
1529
- template: "<span data-ui-error>\n <ng-content></ng-content>\n</span>\n"
1542
+ template: "<div\n class=\"amplify-flex amplify-alert\"\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 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\"\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 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"
1530
1543
  },] }
1531
1544
  ];
1532
1545
 
1533
- /**
1534
- * Input interface opinionated for authenticator usage.
1535
- *
1536
- * TODO: Separate this component out to two parts -- 1) amplify-auth-input that
1537
- * contains authenticator opinionated logic and 2) amplify-text-field primitive
1538
- * that does not make any auth-related inference.
1539
- */
1540
- var AmplifyFormFieldComponent = /** @class */ (function () {
1541
- function AmplifyFormFieldComponent(stateMachine) {
1542
- this.stateMachine = stateMachine;
1543
- this.required = true;
1544
- this.placeholder = '';
1545
- this.label = '';
1546
- this.initialValue = '';
1546
+ var PasswordFieldComponent = /** @class */ (function () {
1547
+ function PasswordFieldComponent() {
1548
+ this.autocomplete = 'new-password';
1547
1549
  this.disabled = false;
1548
- this.autocomplete = '';
1549
- this.countryDialCodes = ui.countryDialCodes;
1550
+ this.fieldId = "amplify-field-" + nanoid.nanoid(12);
1551
+ this.initialValue = '';
1552
+ this.label = '';
1553
+ this.placeholder = '';
1554
+ this.required = true;
1555
+ this.labelHidden = false;
1556
+ this.setBlur = new i0.EventEmitter();
1557
+ this.type = 'password';
1558
+ this.showPassword = false;
1559
+ this.showPasswordButtonlabel = ui.translate('Show password');
1550
1560
  }
1551
- AmplifyFormFieldComponent.prototype.ngOnInit = function () {
1552
- // TODO: field primtiives should have generate these by default.
1553
- this.textFieldId = "amplify-field-" + nanoid.nanoid(12);
1554
- this.selectFieldId = "amplify-field-" + nanoid.nanoid(12);
1555
- // TODO: consider better default handling mechanisms across frameworks
1556
- if (this.isPhoneField()) {
1557
- var state = this.stateMachine.authState;
1558
- var country_code = ui.getActorContext(state).country_code;
1559
- this.defaultCountryCode = country_code;
1560
- // TODO: remove this side-effect
1561
- this.stateMachine.send({
1562
- type: 'CHANGE',
1563
- data: { name: 'country_code', value: country_code },
1564
- });
1565
- }
1566
- };
1567
- Object.defineProperty(AmplifyFormFieldComponent.prototype, "attributeMap", {
1568
- get: function () {
1569
- return getAttributeMap();
1570
- },
1571
- enumerable: false,
1572
- configurable: true
1573
- });
1574
- Object.defineProperty(AmplifyFormFieldComponent.prototype, "error", {
1575
- get: function () {
1576
- var formContext = ui.getActorContext(this.stateMachine.authState);
1577
- var validationError = formContext.validationError;
1578
- return validationError[this.name];
1579
- },
1580
- enumerable: false,
1581
- configurable: true
1582
- });
1583
- AmplifyFormFieldComponent.prototype.inferLabel = function () {
1584
- var _a;
1585
- var label = this.label || ((_a = this.attributeMap[this.name]) === null || _a === void 0 ? void 0 : _a.label);
1586
- return ui.translate(label);
1587
- };
1588
- AmplifyFormFieldComponent.prototype.inferPlaceholder = function () {
1589
- var _a;
1590
- var placeholder = this.placeholder || ((_a = this.attributeMap[this.name]) === null || _a === void 0 ? void 0 : _a.placeholder) ||
1591
- this.inferLabel();
1592
- return ui.translate(placeholder);
1593
- };
1594
- // infers what the `type` of underlying input element should be.
1595
- AmplifyFormFieldComponent.prototype.inferType = function () {
1596
- var _a, _b, _c;
1597
- return (_c = (_a = this.type) !== null && _a !== void 0 ? _a : (_b = this.attributeMap[this.name]) === null || _b === void 0 ? void 0 : _b.type) !== null && _c !== void 0 ? _c : 'text';
1598
- };
1599
- // TODO(enhancement): use enum to differentiate special field types
1600
- AmplifyFormFieldComponent.prototype.isPasswordField = function () {
1601
- return this.inferType() === 'password';
1602
- };
1603
- AmplifyFormFieldComponent.prototype.isPhoneField = function () {
1604
- return this.inferType() === 'tel';
1561
+ PasswordFieldComponent.prototype.togglePasswordText = function () {
1562
+ this.showPassword = !this.showPassword;
1563
+ this.showPasswordButtonlabel = this.showPassword
1564
+ ? ui.translate('Show password')
1565
+ : ui.translate('Hide password');
1566
+ this.type = this.showPassword ? 'text' : 'password';
1605
1567
  };
1606
- return AmplifyFormFieldComponent;
1568
+ return PasswordFieldComponent;
1607
1569
  }());
1608
- AmplifyFormFieldComponent.decorators = [
1570
+ PasswordFieldComponent.decorators = [
1609
1571
  { type: i0.Component, args: [{
1610
- selector: 'amplify-form-field',
1611
- template: "<div class=\"amplify-flex\" style=\"flex-direction: column; gap: 0\">\n <!-- Country code field -->\n <amplify-phone-number-field\n *ngIf=\"isPhoneField()\"\n [selectFieldId]=\"selectFieldId\"\n [defaultCountryCode]=\"defaultCountryCode\"\n [textFieldId]=\"textFieldId\"\n [type]=\"inferType()\"\n [name]=\"name\"\n [label]=\"inferLabel()\"\n [placeholder]=\"inferPlaceholder()\"\n [required]=\"required\"\n [initialValue]=\"initialValue\"\n [disabled]=\"disabled\"\n [autocomplete]=\"autocomplete\"\n ></amplify-phone-number-field>\n\n <amplify-password-field\n *ngIf=\"isPasswordField()\"\n [id]=\"textFieldId\"\n [name]=\"name\"\n [label]=\"inferLabel()\"\n [placeholder]=\"inferPlaceholder()\"\n [required]=\"required\"\n [value]=\"initialValue\"\n [disabled]=\"disabled\"\n [autocomplete]=\"autocomplete\"\n ></amplify-password-field>\n\n <amplify-text-field\n *ngIf=\"!isPasswordField() && !isPhoneField()\"\n [id]=\"textFieldId\"\n [type]=\"inferType()\"\n [name]=\"name\"\n [label]=\"inferLabel()\"\n [placeholder]=\"inferPlaceholder()\"\n [required]=\"required\"\n [value]=\"initialValue\"\n [disabled]=\"disabled\"\n [autocomplete]=\"autocomplete\"\n ></amplify-text-field>\n\n <amplify-error *ngIf=\"error\">\n {{ error }}\n </amplify-error>\n</div>\n"
1572
+ selector: 'amplify-password-field',
1573
+ template: "<label class=\"amplify-label\" [class.sr-only]=\"labelHidden\" [for]=\"fieldId\">\n {{ label }}\n</label>\n<div class=\"amplify-flex amplify-field-group\">\n <input\n class=\"amplify-input amplify-field-group__control\"\n [id]=\"fieldId\"\n [type]=\"type\"\n [name]=\"name\"\n [placeholder]=\"placeholder\"\n [required]=\"required\"\n [value]=\"initialValue\"\n [attr.disabled]=\"disabled ? '' : null\"\n [autocomplete]=\"autocomplete\"\n (blur)=\"setBlur.emit($event)\"\n />\n <div class=\"amplify-field-group__outer-end\">\n <button\n amplify-button\n [attr.aria-label]=\"showPasswordButtonlabel\"\n class=\"amplify-field-group__control amplify-field__show-password\"\n (click)=\"togglePasswordText()\"\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"
1612
1574
  },] }
1613
1575
  ];
1614
- AmplifyFormFieldComponent.ctorParameters = function () { return [
1615
- { type: StateMachineService }
1616
- ]; };
1617
- AmplifyFormFieldComponent.propDecorators = {
1576
+ PasswordFieldComponent.propDecorators = {
1577
+ autocomplete: [{ type: i0.Input }],
1578
+ disabled: [{ type: i0.Input }],
1579
+ fieldId: [{ type: i0.Input }],
1580
+ initialValue: [{ type: i0.Input }],
1581
+ label: [{ type: i0.Input }],
1618
1582
  name: [{ type: i0.Input }],
1619
- type: [{ type: i0.Input }],
1620
- required: [{ type: i0.Input }],
1621
1583
  placeholder: [{ type: i0.Input }],
1622
- label: [{ type: i0.Input }],
1623
- initialValue: [{ type: i0.Input }],
1624
- disabled: [{ type: i0.Input }],
1625
- autocomplete: [{ type: i0.Input }]
1584
+ required: [{ type: i0.Input }],
1585
+ labelHidden: [{ type: i0.Input }],
1586
+ setBlur: [{ type: i0.Output }]
1626
1587
  };
1627
1588
 
1628
- var AmplifyPasswordFieldComponent = /** @class */ (function () {
1629
- function AmplifyPasswordFieldComponent() {
1589
+ var PhoneNumberFieldComponent = /** @class */ (function () {
1590
+ function PhoneNumberFieldComponent() {
1630
1591
  this.autocomplete = 'new-password';
1631
1592
  this.disabled = false;
1593
+ this.selectFieldId = "amplify-field-" + nanoid.nanoid(12);
1594
+ this.textFieldId = "amplify-field-" + nanoid.nanoid(12);
1632
1595
  this.initialValue = '';
1633
1596
  this.label = '';
1634
1597
  this.placeholder = '';
1635
1598
  this.required = true;
1636
- this.type = 'password';
1637
- this.showPassword = false;
1638
- this.showPasswordButtonlabel = ui.translate('Show password');
1599
+ this.labelHidden = false;
1600
+ this.display = 'contents';
1601
+ this.countryDialCodes = ui.countryDialCodes;
1639
1602
  }
1640
- AmplifyPasswordFieldComponent.prototype.togglePasswordText = function () {
1641
- this.showPassword = !this.showPassword;
1642
- this.showPasswordButtonlabel = this.showPassword
1643
- ? ui.translate('Show password')
1644
- : ui.translate('Hide password');
1645
- this.type = this.showPassword ? 'text' : 'password';
1646
- };
1647
- return AmplifyPasswordFieldComponent;
1603
+ return PhoneNumberFieldComponent;
1648
1604
  }());
1649
- AmplifyPasswordFieldComponent.decorators = [
1605
+ PhoneNumberFieldComponent.decorators = [
1650
1606
  { type: i0.Component, args: [{
1651
- selector: 'amplify-password-field',
1652
- template: "<label class=\"amplify-label sr-only\" [for]=\"id\">\n {{ label }}\n</label>\n<div class=\"amplify-flex amplify-field-group\">\n <input\n class=\"amplify-input amplify-field-group__control\"\n [id]=\"id\"\n [type]=\"type\"\n [name]=\"name\"\n [placeholder]=\"placeholder\"\n [required]=\"required\"\n [value]=\"initialValue\"\n [attr.disabled]=\"disabled ? '' : null\"\n [autocomplete]=\"autocomplete\"\n />\n <div class=\"amplify-field-group__outer-end\">\n <button\n amplify-button\n [attr.aria-label]=\"showPasswordButtonlabel\"\n class=\"amplify-field-group__control amplify-field__show-password\"\n (click)=\"togglePasswordText()\"\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"
1607
+ selector: 'amplify-phone-number-field',
1608
+ template: "<label class=\"amplify-label\" [class.sr-only]=\"labelHidden\" [for]=\"textFieldId\">\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 amplify-field amplify-selectfield amplify-countrycodeselect\n \"\n style=\"flex-direction: column\"\n >\n <amplify-form-select\n name=\"country_code\"\n label=\"Country Code\"\n [id]=\"selectFieldId\"\n [items]=\"countryDialCodes\"\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 [attr.disabled]=\"disabled ? '' : null\"\n [autocomplete]=\"autocomplete\"\n />\n</div>\n"
1653
1609
  },] }
1654
1610
  ];
1655
- AmplifyPasswordFieldComponent.propDecorators = {
1611
+ PhoneNumberFieldComponent.propDecorators = {
1656
1612
  autocomplete: [{ type: i0.Input }],
1657
1613
  disabled: [{ type: i0.Input }],
1658
- id: [{ type: i0.Input }],
1614
+ defaultCountryCode: [{ type: i0.Input }],
1615
+ selectFieldId: [{ type: i0.Input }],
1616
+ textFieldId: [{ type: i0.Input }],
1659
1617
  initialValue: [{ type: i0.Input }],
1660
1618
  label: [{ type: i0.Input }],
1661
1619
  name: [{ type: i0.Input }],
1662
1620
  placeholder: [{ type: i0.Input }],
1663
- required: [{ type: i0.Input }]
1621
+ required: [{ type: i0.Input }],
1622
+ type: [{ type: i0.Input }],
1623
+ labelHidden: [{ type: i0.Input }],
1624
+ display: [{ type: i0.HostBinding, args: ['style.display',] }]
1664
1625
  };
1665
1626
 
1666
- var AmplifySelectComponent = /** @class */ (function () {
1667
- function AmplifySelectComponent() {
1627
+ var SelectComponent = /** @class */ (function () {
1628
+ function SelectComponent() {
1668
1629
  }
1669
- return AmplifySelectComponent;
1630
+ return SelectComponent;
1670
1631
  }());
1671
- AmplifySelectComponent.decorators = [
1632
+ SelectComponent.decorators = [
1672
1633
  { type: i0.Component, args: [{
1673
1634
  selector: 'amplify-form-select',
1674
1635
  template: "<label class=\"amplify-label sr-only\" [for]=\"id\">{{ label }}</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\"\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"
1675
1636
  },] }
1676
1637
  ];
1677
- AmplifySelectComponent.propDecorators = {
1638
+ SelectComponent.propDecorators = {
1678
1639
  items: [{ type: i0.Input }],
1679
1640
  name: [{ type: i0.Input }],
1680
1641
  label: [{ type: i0.Input }],
@@ -1685,6 +1646,7 @@
1685
1646
  var TabItemComponent = /** @class */ (function () {
1686
1647
  function TabItemComponent() {
1687
1648
  this.active = false;
1649
+ this.display = 'block'; // emulate div behavior
1688
1650
  }
1689
1651
  return TabItemComponent;
1690
1652
  }());
@@ -1699,7 +1661,8 @@
1699
1661
  active: [{ type: i0.Input }],
1700
1662
  id: [{ type: i0.Input }],
1701
1663
  labelledById: [{ type: i0.Input }],
1702
- tabIndex: [{ type: i0.Input }]
1664
+ tabIndex: [{ type: i0.Input }],
1665
+ display: [{ type: i0.HostBinding, args: ['style.display',] }]
1703
1666
  };
1704
1667
 
1705
1668
  var TabsComponent = /** @class */ (function () {
@@ -1737,7 +1700,7 @@
1737
1700
  TabsComponent.decorators = [
1738
1701
  { type: i0.Component, args: [{
1739
1702
  selector: 'amplify-tabs',
1740
- 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-grow=\"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"
1703
+ 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"
1741
1704
  },] }
1742
1705
  ];
1743
1706
  TabsComponent.propDecorators = {
@@ -1745,2017 +1708,115 @@
1745
1708
  tabChange: [{ type: i0.Output }]
1746
1709
  };
1747
1710
 
1748
- var AmplifyTextFieldComponent = /** @class */ (function () {
1749
- function AmplifyTextFieldComponent() {
1711
+ var TextFieldComponent = /** @class */ (function () {
1712
+ function TextFieldComponent() {
1750
1713
  this.autocomplete = 'new-password';
1751
1714
  this.disabled = false;
1715
+ this.fieldId = "amplify-field-" + nanoid.nanoid(12);
1752
1716
  this.initialValue = '';
1753
1717
  this.label = '';
1754
1718
  this.placeholder = '';
1755
1719
  this.required = true;
1720
+ this.labelHidden = false;
1721
+ this.display = 'contents';
1756
1722
  }
1757
- return AmplifyTextFieldComponent;
1723
+ return TextFieldComponent;
1758
1724
  }());
1759
- AmplifyTextFieldComponent.decorators = [
1725
+ TextFieldComponent.decorators = [
1760
1726
  { type: i0.Component, args: [{
1761
1727
  selector: 'amplify-text-field',
1762
- template: "<label class=\"amplify-label sr-only\" [for]=\"id\">\n {{ label }}\n</label>\n<input\n class=\"amplify-input\"\n [id]=\"id\"\n [type]=\"type\"\n [name]=\"name\"\n [placeholder]=\"placeholder\"\n [required]=\"required\"\n [value]=\"initialValue\"\n [attr.disabled]=\"disabled ? '' : null\"\n [autocomplete]=\"autocomplete\"\n/>\n"
1728
+ template: "<label class=\"amplify-label\" [class.sr-only]=\"labelHidden\" [for]=\"fieldId\">\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 [attr.disabled]=\"disabled ? '' : null\"\n [autocomplete]=\"autocomplete\"\n/>\n"
1763
1729
  },] }
1764
1730
  ];
1765
- AmplifyTextFieldComponent.propDecorators = {
1731
+ TextFieldComponent.propDecorators = {
1766
1732
  autocomplete: [{ type: i0.Input }],
1767
1733
  disabled: [{ type: i0.Input }],
1768
- id: [{ type: i0.Input }],
1734
+ fieldId: [{ type: i0.Input }],
1769
1735
  initialValue: [{ type: i0.Input }],
1770
1736
  label: [{ type: i0.Input }],
1771
1737
  name: [{ type: i0.Input }],
1772
1738
  placeholder: [{ type: i0.Input }],
1773
1739
  required: [{ type: i0.Input }],
1774
- type: [{ type: i0.Input }]
1775
- };
1776
-
1777
- var AmplifyUserNameAliasComponent = /** @class */ (function () {
1778
- function AmplifyUserNameAliasComponent(stateMachine) {
1779
- this.stateMachine = stateMachine;
1780
- this.name = 'username';
1781
- this.disabled = false;
1782
- this.initialValue = '';
1783
- this.required = true;
1784
- }
1785
- AmplifyUserNameAliasComponent.prototype.ngOnInit = function () {
1786
- var context = this.stateMachine.context;
1787
- var _a = ui.getAliasInfoFromContext(context), label = _a.label, type = _a.type;
1788
- this.label = label;
1789
- this.type = type;
1790
- this.placeholder = label;
1791
- };
1792
- return AmplifyUserNameAliasComponent;
1793
- }());
1794
- AmplifyUserNameAliasComponent.decorators = [
1795
- { type: i0.Component, args: [{
1796
- selector: 'amplify-user-name-alias',
1797
- template: "<amplify-form-field\n data-amplify-usernamealias\n [name]=\"name\"\n [label]=\"label\"\n [type]=\"type\"\n [placeholder]=\"placeholder\"\n [initialValue]=\"initialValue\"\n [disabled]=\"disabled\"\n [required]=\"required\"\n autocomplete=\"username\"\n>\n</amplify-form-field>\n"
1798
- },] }
1799
- ];
1800
- AmplifyUserNameAliasComponent.ctorParameters = function () { return [
1801
- { type: StateMachineService }
1802
- ]; };
1803
- AmplifyUserNameAliasComponent.propDecorators = {
1804
- name: [{ type: i0.Input }],
1805
- disabled: [{ type: i0.Input }],
1806
- initialValue: [{ type: i0.Input }],
1807
- required: [{ type: i0.Input }]
1740
+ type: [{ type: i0.Input }],
1741
+ labelHidden: [{ type: i0.Input }],
1742
+ display: [{ type: i0.HostBinding, args: ['style.display',] }]
1808
1743
  };
1809
1744
 
1810
- var proxyInputs = function (Cmp, inputs) {
1811
- var Prototype = Cmp.prototype;
1812
- inputs.forEach(function (item) {
1813
- Object.defineProperty(Prototype, item, {
1814
- get: function () {
1815
- return this.el[item];
1816
- },
1817
- set: function (val) {
1818
- var _this = this;
1819
- this.z.runOutsideAngular(function () { return (_this.el[item] = val); });
1820
- },
1821
- });
1822
- });
1823
- };
1824
- var proxyMethods = function (Cmp, methods) {
1825
- var Prototype = Cmp.prototype;
1826
- methods.forEach(function (methodName) {
1827
- Prototype[methodName] = function () {
1828
- var _this = this;
1829
- var args = arguments;
1830
- return this.z.runOutsideAngular(function () { return _this.el[methodName].apply(_this.el, args); });
1831
- };
1832
- });
1833
- };
1834
- var proxyOutputs = function (instance, el, events) {
1835
- events.forEach(function (eventName) { return (instance[eventName] = rxjs.fromEvent(el, eventName)); });
1836
- };
1837
- // tslint:disable-next-line: only-arrow-functions
1838
- function ProxyCmp(opts) {
1839
- var decorator = function (cls) {
1840
- if (opts.inputs) {
1841
- proxyInputs(cls, opts.inputs);
1745
+ var AmplifySlotComponent = /** @class */ (function () {
1746
+ function AmplifySlotComponent(propService) {
1747
+ this.propService = propService;
1748
+ this.display = 'contents';
1749
+ this.isOverriden = false;
1750
+ }
1751
+ AmplifySlotComponent.prototype.ngAfterContentInit = function () {
1752
+ var customComponents = this.propService.customComponents;
1753
+ var overridingComponent = customComponents[this.name];
1754
+ if (overridingComponent) {
1755
+ this.overridingComponent = overridingComponent;
1756
+ this.isOverriden = true;
1842
1757
  }
1843
- if (opts.methods) {
1844
- proxyMethods(cls, opts.methods);
1845
- }
1846
- return cls;
1847
1758
  };
1848
- return decorator;
1849
- }
1850
- var AmplifyAmazonButton = /** @class */ (function () {
1851
- function AmplifyAmazonButton(c, r, z) {
1852
- this.z = z;
1853
- c.detach();
1854
- this.el = r.nativeElement;
1855
- }
1856
- return AmplifyAmazonButton;
1857
- }());
1858
- AmplifyAmazonButton.decorators = [
1859
- { type: i0.Component, args: [{
1860
- selector: 'amplify-amazon-button',
1861
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
1862
- template: '<ng-content></ng-content>',
1863
- inputs: ['clientId', 'handleAuthStateChange']
1864
- },] }
1865
- ];
1866
- AmplifyAmazonButton.ctorParameters = function () { return [
1867
- { type: i0.ChangeDetectorRef },
1868
- { type: i0.ElementRef },
1869
- { type: i0.NgZone }
1870
- ]; };
1871
- AmplifyAmazonButton = __decorate([
1872
- ProxyCmp({ inputs: ['clientId', 'handleAuthStateChange'] })
1873
- ], AmplifyAmazonButton);
1874
- var AmplifyAuthContainer = /** @class */ (function () {
1875
- function AmplifyAuthContainer(c, r, z) {
1876
- this.z = z;
1877
- c.detach();
1878
- this.el = r.nativeElement;
1879
- }
1880
- return AmplifyAuthContainer;
1881
- }());
1882
- AmplifyAuthContainer.decorators = [
1883
- { type: i0.Component, args: [{
1884
- selector: 'amplify-auth-container',
1885
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
1886
- template: '<ng-content></ng-content>'
1887
- },] }
1888
- ];
1889
- AmplifyAuthContainer.ctorParameters = function () { return [
1890
- { type: i0.ChangeDetectorRef },
1891
- { type: i0.ElementRef },
1892
- { type: i0.NgZone }
1893
- ]; };
1894
- var AmplifyAuthFields = /** @class */ (function () {
1895
- function AmplifyAuthFields(c, r, z) {
1896
- this.z = z;
1897
- c.detach();
1898
- this.el = r.nativeElement;
1899
- }
1900
- return AmplifyAuthFields;
1901
- }());
1902
- AmplifyAuthFields.decorators = [
1903
- { type: i0.Component, args: [{
1904
- selector: 'amplify-auth-fields',
1905
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
1906
- template: '<ng-content></ng-content>',
1907
- inputs: ['formFields']
1908
- },] }
1909
- ];
1910
- AmplifyAuthFields.ctorParameters = function () { return [
1911
- { type: i0.ChangeDetectorRef },
1912
- { type: i0.ElementRef },
1913
- { type: i0.NgZone }
1914
- ]; };
1915
- AmplifyAuthFields = __decorate([
1916
- ProxyCmp({ inputs: ['formFields'] })
1917
- ], AmplifyAuthFields);
1918
- var AmplifyAuth0Button = /** @class */ (function () {
1919
- function AmplifyAuth0Button(c, r, z) {
1920
- this.z = z;
1921
- c.detach();
1922
- this.el = r.nativeElement;
1923
- }
1924
- return AmplifyAuth0Button;
1925
- }());
1926
- AmplifyAuth0Button.decorators = [
1927
- { type: i0.Component, args: [{
1928
- selector: 'amplify-auth0-button',
1929
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
1930
- template: '<ng-content></ng-content>',
1931
- inputs: ['config', 'handleAuthStateChange']
1932
- },] }
1933
- ];
1934
- AmplifyAuth0Button.ctorParameters = function () { return [
1935
- { type: i0.ChangeDetectorRef },
1936
- { type: i0.ElementRef },
1937
- { type: i0.NgZone }
1938
- ]; };
1939
- AmplifyAuth0Button = __decorate([
1940
- ProxyCmp({ inputs: ['config', 'handleAuthStateChange'] })
1941
- ], AmplifyAuth0Button);
1942
- var AmplifyAuthenticator = /** @class */ (function () {
1943
- function AmplifyAuthenticator(c, r, z) {
1944
- this.z = z;
1945
- c.detach();
1946
- this.el = r.nativeElement;
1947
- }
1948
- return AmplifyAuthenticator;
1949
- }());
1950
- AmplifyAuthenticator.decorators = [
1951
- { type: i0.Component, args: [{
1952
- selector: 'amplify-authenticator',
1953
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
1954
- template: '<ng-content></ng-content>',
1955
- inputs: [
1956
- 'federated',
1957
- 'handleAuthStateChange',
1958
- 'hideToast',
1959
- 'initialAuthState',
1960
- 'usernameAlias',
1961
- ]
1962
- },] }
1963
- ];
1964
- AmplifyAuthenticator.ctorParameters = function () { return [
1965
- { type: i0.ChangeDetectorRef },
1966
- { type: i0.ElementRef },
1967
- { type: i0.NgZone }
1968
- ]; };
1969
- AmplifyAuthenticator = __decorate([
1970
- ProxyCmp({
1971
- inputs: [
1972
- 'federated',
1973
- 'handleAuthStateChange',
1974
- 'hideToast',
1975
- 'initialAuthState',
1976
- 'usernameAlias',
1977
- ],
1978
- })
1979
- ], AmplifyAuthenticator);
1980
- exports.AmplifyButton = /** @class */ (function () {
1981
- function AmplifyButton(c, r, z) {
1982
- this.z = z;
1983
- c.detach();
1984
- this.el = r.nativeElement;
1985
- }
1986
- return AmplifyButton;
1987
- }());
1988
- exports.AmplifyButton.decorators = [
1989
- { type: i0.Component, args: [{
1990
- selector: 'amplify-button',
1991
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
1992
- template: '<ng-content></ng-content>',
1993
- inputs: ['disabled', 'handleButtonClick', 'icon', 'type', 'variant']
1994
- },] }
1995
- ];
1996
- exports.AmplifyButton.ctorParameters = function () { return [
1997
- { type: i0.ChangeDetectorRef },
1998
- { type: i0.ElementRef },
1999
- { type: i0.NgZone }
2000
- ]; };
2001
- exports.AmplifyButton = __decorate([
2002
- ProxyCmp({
2003
- inputs: ['disabled', 'handleButtonClick', 'icon', 'type', 'variant'],
2004
- })
2005
- ], exports.AmplifyButton);
2006
- exports.AmplifyChatbot = /** @class */ (function () {
2007
- function AmplifyChatbot(c, r, z) {
2008
- this.z = z;
2009
- c.detach();
2010
- this.el = r.nativeElement;
2011
- proxyOutputs(this, this.el, ['chatCompleted']);
2012
- }
2013
- return AmplifyChatbot;
2014
- }());
2015
- exports.AmplifyChatbot.decorators = [
2016
- { type: i0.Component, args: [{
2017
- selector: 'amplify-chatbot',
2018
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
2019
- template: '<ng-content></ng-content>',
2020
- inputs: [
2021
- 'botName',
2022
- 'botTitle',
2023
- 'clearOnComplete',
2024
- 'conversationModeOn',
2025
- 'silenceThreshold',
2026
- 'silenceTime',
2027
- 'textEnabled',
2028
- 'voiceEnabled',
2029
- 'welcomeMessage',
2030
- ]
2031
- },] }
2032
- ];
2033
- exports.AmplifyChatbot.ctorParameters = function () { return [
2034
- { type: i0.ChangeDetectorRef },
2035
- { type: i0.ElementRef },
2036
- { type: i0.NgZone }
2037
- ]; };
2038
- exports.AmplifyChatbot = __decorate([
2039
- ProxyCmp({
2040
- inputs: [
2041
- 'botName',
2042
- 'botTitle',
2043
- 'clearOnComplete',
2044
- 'conversationModeOn',
2045
- 'silenceThreshold',
2046
- 'silenceTime',
2047
- 'textEnabled',
2048
- 'voiceEnabled',
2049
- 'welcomeMessage',
2050
- ],
2051
- })
2052
- ], exports.AmplifyChatbot);
2053
- var AmplifyCheckbox = /** @class */ (function () {
2054
- function AmplifyCheckbox(c, r, z) {
2055
- this.z = z;
2056
- c.detach();
2057
- this.el = r.nativeElement;
2058
- }
2059
- return AmplifyCheckbox;
2060
- }());
2061
- AmplifyCheckbox.decorators = [
2062
- { type: i0.Component, args: [{
2063
- selector: 'amplify-checkbox',
2064
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
2065
- template: '<ng-content></ng-content>',
2066
- inputs: ['checked', 'disabled', 'fieldId', 'label', 'name', 'value']
2067
- },] }
2068
- ];
2069
- AmplifyCheckbox.ctorParameters = function () { return [
2070
- { type: i0.ChangeDetectorRef },
2071
- { type: i0.ElementRef },
2072
- { type: i0.NgZone }
2073
- ]; };
2074
- AmplifyCheckbox = __decorate([
2075
- ProxyCmp({
2076
- inputs: ['checked', 'disabled', 'fieldId', 'label', 'name', 'value'],
2077
- })
2078
- ], AmplifyCheckbox);
2079
- var AmplifyCodeField = /** @class */ (function () {
2080
- function AmplifyCodeField(c, r, z) {
2081
- this.z = z;
2082
- c.detach();
2083
- this.el = r.nativeElement;
2084
- }
2085
- return AmplifyCodeField;
2086
- }());
2087
- AmplifyCodeField.decorators = [
2088
- { type: i0.Component, args: [{
2089
- selector: 'amplify-code-field',
2090
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
2091
- template: '<ng-content></ng-content>',
2092
- inputs: [
2093
- 'disabled',
2094
- 'fieldId',
2095
- 'handleInputChange',
2096
- 'hint',
2097
- 'inputProps',
2098
- 'label',
2099
- 'placeholder',
2100
- 'required',
2101
- 'value',
2102
- ]
2103
- },] }
2104
- ];
2105
- AmplifyCodeField.ctorParameters = function () { return [
2106
- { type: i0.ChangeDetectorRef },
2107
- { type: i0.ElementRef },
2108
- { type: i0.NgZone }
2109
- ]; };
2110
- AmplifyCodeField = __decorate([
2111
- ProxyCmp({
2112
- inputs: [
2113
- 'disabled',
2114
- 'fieldId',
2115
- 'handleInputChange',
2116
- 'hint',
2117
- 'inputProps',
2118
- 'label',
2119
- 'placeholder',
2120
- 'required',
2121
- 'value',
2122
- ],
2123
- })
2124
- ], AmplifyCodeField);
2125
- var AmplifyConfirmSignIn = /** @class */ (function () {
2126
- function AmplifyConfirmSignIn(c, r, z) {
2127
- this.z = z;
2128
- c.detach();
2129
- this.el = r.nativeElement;
2130
- }
2131
- return AmplifyConfirmSignIn;
2132
- }());
2133
- AmplifyConfirmSignIn.decorators = [
2134
- { type: i0.Component, args: [{
2135
- selector: 'amplify-confirm-sign-in',
2136
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
2137
- template: '<ng-content></ng-content>',
2138
- inputs: [
2139
- 'formFields',
2140
- 'handleAuthStateChange',
2141
- 'handleSubmit',
2142
- 'headerText',
2143
- 'submitButtonText',
2144
- 'user',
2145
- ]
2146
- },] }
2147
- ];
2148
- AmplifyConfirmSignIn.ctorParameters = function () { return [
2149
- { type: i0.ChangeDetectorRef },
2150
- { type: i0.ElementRef },
2151
- { type: i0.NgZone }
2152
- ]; };
2153
- AmplifyConfirmSignIn = __decorate([
2154
- ProxyCmp({
2155
- inputs: [
2156
- 'formFields',
2157
- 'handleAuthStateChange',
2158
- 'handleSubmit',
2159
- 'headerText',
2160
- 'submitButtonText',
2161
- 'user',
2162
- ],
2163
- })
2164
- ], AmplifyConfirmSignIn);
2165
- var AmplifyConfirmSignUp = /** @class */ (function () {
2166
- function AmplifyConfirmSignUp(c, r, z) {
2167
- this.z = z;
2168
- c.detach();
2169
- this.el = r.nativeElement;
2170
- }
2171
- return AmplifyConfirmSignUp;
2172
- }());
2173
- AmplifyConfirmSignUp.decorators = [
2174
- { type: i0.Component, args: [{
2175
- selector: 'amplify-confirm-sign-up',
2176
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
2177
- template: '<ng-content></ng-content>',
2178
- inputs: [
2179
- 'formFields',
2180
- 'handleAuthStateChange',
2181
- 'handleSubmit',
2182
- 'headerText',
2183
- 'submitButtonText',
2184
- 'user',
2185
- 'usernameAlias',
2186
- ]
2187
- },] }
2188
- ];
2189
- AmplifyConfirmSignUp.ctorParameters = function () { return [
2190
- { type: i0.ChangeDetectorRef },
2191
- { type: i0.ElementRef },
2192
- { type: i0.NgZone }
2193
- ]; };
2194
- AmplifyConfirmSignUp = __decorate([
2195
- ProxyCmp({
2196
- inputs: [
2197
- 'formFields',
2198
- 'handleAuthStateChange',
2199
- 'handleSubmit',
2200
- 'headerText',
2201
- 'submitButtonText',
2202
- 'user',
2203
- 'usernameAlias',
2204
- ],
2205
- })
2206
- ], AmplifyConfirmSignUp);
2207
- var AmplifyContainer = /** @class */ (function () {
2208
- function AmplifyContainer(c, r, z) {
2209
- this.z = z;
2210
- c.detach();
2211
- this.el = r.nativeElement;
2212
- }
2213
- return AmplifyContainer;
2214
- }());
2215
- AmplifyContainer.decorators = [
2216
- { type: i0.Component, args: [{
2217
- selector: 'amplify-container',
2218
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
2219
- template: '<ng-content></ng-content>'
2220
- },] }
2221
- ];
2222
- AmplifyContainer.ctorParameters = function () { return [
2223
- { type: i0.ChangeDetectorRef },
2224
- { type: i0.ElementRef },
2225
- { type: i0.NgZone }
2226
- ]; };
2227
- var AmplifyCountryDialCode = /** @class */ (function () {
2228
- function AmplifyCountryDialCode(c, r, z) {
2229
- this.z = z;
2230
- c.detach();
2231
- this.el = r.nativeElement;
2232
- }
2233
- return AmplifyCountryDialCode;
2234
- }());
2235
- AmplifyCountryDialCode.decorators = [
2236
- { type: i0.Component, args: [{
2237
- selector: 'amplify-country-dial-code',
2238
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
2239
- template: '<ng-content></ng-content>',
2240
- inputs: ['dialCode', 'fieldId', 'handleInputChange', 'options']
2241
- },] }
2242
- ];
2243
- AmplifyCountryDialCode.ctorParameters = function () { return [
2244
- { type: i0.ChangeDetectorRef },
2245
- { type: i0.ElementRef },
2246
- { type: i0.NgZone }
2247
- ]; };
2248
- AmplifyCountryDialCode = __decorate([
2249
- ProxyCmp({ inputs: ['dialCode', 'fieldId', 'handleInputChange', 'options'] })
2250
- ], AmplifyCountryDialCode);
2251
- var AmplifyEmailField = /** @class */ (function () {
2252
- function AmplifyEmailField(c, r, z) {
2253
- this.z = z;
2254
- c.detach();
2255
- this.el = r.nativeElement;
2256
- }
2257
- return AmplifyEmailField;
2258
- }());
2259
- AmplifyEmailField.decorators = [
2260
- { type: i0.Component, args: [{
2261
- selector: 'amplify-email-field',
2262
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
2263
- template: '<ng-content></ng-content>',
2264
- inputs: [
2265
- 'disabled',
2266
- 'fieldId',
2267
- 'handleInputChange',
2268
- 'hint',
2269
- 'inputProps',
2270
- 'label',
2271
- 'placeholder',
2272
- 'required',
2273
- 'value',
2274
- ]
2275
- },] }
2276
- ];
2277
- AmplifyEmailField.ctorParameters = function () { return [
2278
- { type: i0.ChangeDetectorRef },
2279
- { type: i0.ElementRef },
2280
- { type: i0.NgZone }
2281
- ]; };
2282
- AmplifyEmailField = __decorate([
2283
- ProxyCmp({
2284
- inputs: [
2285
- 'disabled',
2286
- 'fieldId',
2287
- 'handleInputChange',
2288
- 'hint',
2289
- 'inputProps',
2290
- 'label',
2291
- 'placeholder',
2292
- 'required',
2293
- 'value',
2294
- ],
2295
- })
2296
- ], AmplifyEmailField);
2297
- var AmplifyFacebookButton = /** @class */ (function () {
2298
- function AmplifyFacebookButton(c, r, z) {
2299
- this.z = z;
2300
- c.detach();
2301
- this.el = r.nativeElement;
2302
- }
2303
- return AmplifyFacebookButton;
2304
- }());
2305
- AmplifyFacebookButton.decorators = [
2306
- { type: i0.Component, args: [{
2307
- selector: 'amplify-facebook-button',
2308
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
2309
- template: '<ng-content></ng-content>',
2310
- inputs: ['appId', 'handleAuthStateChange']
2311
- },] }
2312
- ];
2313
- AmplifyFacebookButton.ctorParameters = function () { return [
2314
- { type: i0.ChangeDetectorRef },
2315
- { type: i0.ElementRef },
2316
- { type: i0.NgZone }
2317
- ]; };
2318
- AmplifyFacebookButton = __decorate([
2319
- ProxyCmp({ inputs: ['appId', 'handleAuthStateChange'] })
2320
- ], AmplifyFacebookButton);
2321
- var AmplifyFederatedButtons = /** @class */ (function () {
2322
- function AmplifyFederatedButtons(c, r, z) {
2323
- this.z = z;
2324
- c.detach();
2325
- this.el = r.nativeElement;
2326
- }
2327
- return AmplifyFederatedButtons;
2328
- }());
2329
- AmplifyFederatedButtons.decorators = [
2330
- { type: i0.Component, args: [{
2331
- selector: 'amplify-federated-buttons',
2332
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
2333
- template: '<ng-content></ng-content>',
2334
- inputs: ['authState', 'federated', 'handleAuthStateChange']
2335
- },] }
2336
- ];
2337
- AmplifyFederatedButtons.ctorParameters = function () { return [
2338
- { type: i0.ChangeDetectorRef },
2339
- { type: i0.ElementRef },
2340
- { type: i0.NgZone }
2341
- ]; };
2342
- AmplifyFederatedButtons = __decorate([
2343
- ProxyCmp({ inputs: ['authState', 'federated', 'handleAuthStateChange'] })
2344
- ], AmplifyFederatedButtons);
2345
- var AmplifyFederatedSignIn = /** @class */ (function () {
2346
- function AmplifyFederatedSignIn(c, r, z) {
2347
- this.z = z;
2348
- c.detach();
2349
- this.el = r.nativeElement;
2350
- }
2351
- return AmplifyFederatedSignIn;
2352
- }());
2353
- AmplifyFederatedSignIn.decorators = [
2354
- { type: i0.Component, args: [{
2355
- selector: 'amplify-federated-sign-in',
2356
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
2357
- template: '<ng-content></ng-content>',
2358
- inputs: ['authState', 'federated']
2359
- },] }
2360
- ];
2361
- AmplifyFederatedSignIn.ctorParameters = function () { return [
2362
- { type: i0.ChangeDetectorRef },
2363
- { type: i0.ElementRef },
2364
- { type: i0.NgZone }
2365
- ]; };
2366
- AmplifyFederatedSignIn = __decorate([
2367
- ProxyCmp({ inputs: ['authState', 'federated'] })
2368
- ], AmplifyFederatedSignIn);
2369
- var AmplifyForgotPassword = /** @class */ (function () {
2370
- function AmplifyForgotPassword(c, r, z) {
2371
- this.z = z;
2372
- c.detach();
2373
- this.el = r.nativeElement;
2374
- }
2375
- return AmplifyForgotPassword;
2376
- }());
2377
- AmplifyForgotPassword.decorators = [
2378
- { type: i0.Component, args: [{
2379
- selector: 'amplify-forgot-password',
2380
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
2381
- template: '<ng-content></ng-content>',
2382
- inputs: [
2383
- 'formFields',
2384
- 'handleAuthStateChange',
2385
- 'handleSend',
2386
- 'handleSubmit',
2387
- 'headerText',
2388
- 'sendButtonText',
2389
- 'submitButtonText',
2390
- 'usernameAlias',
2391
- ]
2392
- },] }
2393
- ];
2394
- AmplifyForgotPassword.ctorParameters = function () { return [
2395
- { type: i0.ChangeDetectorRef },
2396
- { type: i0.ElementRef },
2397
- { type: i0.NgZone }
2398
- ]; };
2399
- AmplifyForgotPassword = __decorate([
2400
- ProxyCmp({
2401
- inputs: [
2402
- 'formFields',
2403
- 'handleAuthStateChange',
2404
- 'handleSend',
2405
- 'handleSubmit',
2406
- 'headerText',
2407
- 'sendButtonText',
2408
- 'submitButtonText',
2409
- 'usernameAlias',
2410
- ],
2411
- })
2412
- ], AmplifyForgotPassword);
2413
- var AmplifyFormField = /** @class */ (function () {
2414
- function AmplifyFormField(c, r, z) {
2415
- this.z = z;
2416
- c.detach();
2417
- this.el = r.nativeElement;
2418
- }
2419
- return AmplifyFormField;
2420
- }());
2421
- AmplifyFormField.decorators = [
2422
- { type: i0.Component, args: [{
2423
- selector: 'amplify-form-field',
2424
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
2425
- template: '<ng-content></ng-content>',
2426
- inputs: [
2427
- 'description',
2428
- 'disabled',
2429
- 'fieldId',
2430
- 'handleInputChange',
2431
- 'hint',
2432
- 'inputProps',
2433
- 'label',
2434
- 'name',
2435
- 'placeholder',
2436
- 'required',
2437
- 'type',
2438
- 'value',
2439
- ]
2440
- },] }
2441
- ];
2442
- AmplifyFormField.ctorParameters = function () { return [
2443
- { type: i0.ChangeDetectorRef },
2444
- { type: i0.ElementRef },
2445
- { type: i0.NgZone }
2446
- ]; };
2447
- AmplifyFormField = __decorate([
2448
- ProxyCmp({
2449
- inputs: [
2450
- 'description',
2451
- 'disabled',
2452
- 'fieldId',
2453
- 'handleInputChange',
2454
- 'hint',
2455
- 'inputProps',
2456
- 'label',
2457
- 'name',
2458
- 'placeholder',
2459
- 'required',
2460
- 'type',
2461
- 'value',
2462
- ],
2463
- })
2464
- ], AmplifyFormField);
2465
- var AmplifyFormSection = /** @class */ (function () {
2466
- function AmplifyFormSection(c, r, z) {
2467
- this.z = z;
2468
- c.detach();
2469
- this.el = r.nativeElement;
2470
- }
2471
- return AmplifyFormSection;
2472
- }());
2473
- AmplifyFormSection.decorators = [
2474
- { type: i0.Component, args: [{
2475
- selector: 'amplify-form-section',
2476
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
2477
- template: '<ng-content></ng-content>',
2478
- inputs: [
2479
- 'handleSubmit',
2480
- 'headerText',
2481
- 'loading',
2482
- 'secondaryFooterContent',
2483
- 'submitButtonText',
2484
- 'testDataPrefix',
2485
- ]
2486
- },] }
2487
- ];
2488
- AmplifyFormSection.ctorParameters = function () { return [
2489
- { type: i0.ChangeDetectorRef },
2490
- { type: i0.ElementRef },
2491
- { type: i0.NgZone }
2492
- ]; };
2493
- AmplifyFormSection = __decorate([
2494
- ProxyCmp({
2495
- inputs: [
2496
- 'handleSubmit',
2497
- 'headerText',
2498
- 'loading',
2499
- 'secondaryFooterContent',
2500
- 'submitButtonText',
2501
- 'testDataPrefix',
2502
- ],
2503
- })
2504
- ], AmplifyFormSection);
2505
- var AmplifyGoogleButton = /** @class */ (function () {
2506
- function AmplifyGoogleButton(c, r, z) {
2507
- this.z = z;
2508
- c.detach();
2509
- this.el = r.nativeElement;
2510
- }
2511
- return AmplifyGoogleButton;
2512
- }());
2513
- AmplifyGoogleButton.decorators = [
2514
- { type: i0.Component, args: [{
2515
- selector: 'amplify-google-button',
2516
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
2517
- template: '<ng-content></ng-content>',
2518
- inputs: ['clientId', 'handleAuthStateChange']
2519
- },] }
2520
- ];
2521
- AmplifyGoogleButton.ctorParameters = function () { return [
2522
- { type: i0.ChangeDetectorRef },
2523
- { type: i0.ElementRef },
2524
- { type: i0.NgZone }
2525
- ]; };
2526
- AmplifyGoogleButton = __decorate([
2527
- ProxyCmp({ inputs: ['clientId', 'handleAuthStateChange'] })
2528
- ], AmplifyGoogleButton);
2529
- var AmplifyGreetings = /** @class */ (function () {
2530
- function AmplifyGreetings(c, r, z) {
2531
- this.z = z;
2532
- c.detach();
2533
- this.el = r.nativeElement;
2534
- }
2535
- return AmplifyGreetings;
2536
- }());
2537
- AmplifyGreetings.decorators = [
2538
- { type: i0.Component, args: [{
2539
- selector: 'amplify-greetings',
2540
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
2541
- template: '<ng-content></ng-content>',
2542
- inputs: ['handleAuthStateChange', 'logo', 'username']
2543
- },] }
2544
- ];
2545
- AmplifyGreetings.ctorParameters = function () { return [
2546
- { type: i0.ChangeDetectorRef },
2547
- { type: i0.ElementRef },
2548
- { type: i0.NgZone }
2549
- ]; };
2550
- AmplifyGreetings = __decorate([
2551
- ProxyCmp({ inputs: ['handleAuthStateChange', 'logo', 'username'] })
2552
- ], AmplifyGreetings);
2553
- var AmplifyHint = /** @class */ (function () {
2554
- function AmplifyHint(c, r, z) {
2555
- this.z = z;
2556
- c.detach();
2557
- this.el = r.nativeElement;
2558
- }
2559
- return AmplifyHint;
2560
- }());
2561
- AmplifyHint.decorators = [
2562
- { type: i0.Component, args: [{
2563
- selector: 'amplify-hint',
2564
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
2565
- template: '<ng-content></ng-content>'
2566
- },] }
2567
- ];
2568
- AmplifyHint.ctorParameters = function () { return [
2569
- { type: i0.ChangeDetectorRef },
2570
- { type: i0.ElementRef },
2571
- { type: i0.NgZone }
2572
- ]; };
2573
- var AmplifyIcon = /** @class */ (function () {
2574
- function AmplifyIcon(c, r, z) {
2575
- this.z = z;
2576
- c.detach();
2577
- this.el = r.nativeElement;
2578
- }
2579
- return AmplifyIcon;
2580
- }());
2581
- AmplifyIcon.decorators = [
2582
- { type: i0.Component, args: [{
2583
- selector: 'amplify-icon',
2584
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
2585
- template: '<ng-content></ng-content>',
2586
- inputs: ['name']
2587
- },] }
2588
- ];
2589
- AmplifyIcon.ctorParameters = function () { return [
2590
- { type: i0.ChangeDetectorRef },
2591
- { type: i0.ElementRef },
2592
- { type: i0.NgZone }
2593
- ]; };
2594
- AmplifyIcon = __decorate([
2595
- ProxyCmp({ inputs: ['name'] })
2596
- ], AmplifyIcon);
2597
- var AmplifyIconButton = /** @class */ (function () {
2598
- function AmplifyIconButton(c, r, z) {
2599
- this.z = z;
2600
- c.detach();
2601
- this.el = r.nativeElement;
2602
- }
2603
- return AmplifyIconButton;
2604
- }());
2605
- AmplifyIconButton.decorators = [
2606
- { type: i0.Component, args: [{
2607
- selector: 'amplify-icon-button',
2608
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
2609
- template: '<ng-content></ng-content>',
2610
- inputs: ['autoShowTooltip', 'name', 'tooltip']
2611
- },] }
2612
- ];
2613
- AmplifyIconButton.ctorParameters = function () { return [
2614
- { type: i0.ChangeDetectorRef },
2615
- { type: i0.ElementRef },
2616
- { type: i0.NgZone }
2617
- ]; };
2618
- AmplifyIconButton = __decorate([
2619
- ProxyCmp({ inputs: ['autoShowTooltip', 'name', 'tooltip'] })
2620
- ], AmplifyIconButton);
2621
- exports.AmplifyInput = /** @class */ (function () {
2622
- function AmplifyInput(c, r, z) {
2623
- this.z = z;
2624
- c.detach();
2625
- this.el = r.nativeElement;
2626
- }
2627
- return AmplifyInput;
2628
- }());
2629
- exports.AmplifyInput.decorators = [
2630
- { type: i0.Component, args: [{
2631
- selector: 'amplify-input',
2632
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
2633
- template: '<ng-content></ng-content>',
2634
- inputs: [
2635
- 'description',
2636
- 'disabled',
2637
- 'fieldId',
2638
- 'handleInputChange',
2639
- 'inputProps',
2640
- 'name',
2641
- 'placeholder',
2642
- 'required',
2643
- 'type',
2644
- 'value',
2645
- ]
2646
- },] }
2647
- ];
2648
- exports.AmplifyInput.ctorParameters = function () { return [
2649
- { type: i0.ChangeDetectorRef },
2650
- { type: i0.ElementRef },
2651
- { type: i0.NgZone }
2652
- ]; };
2653
- exports.AmplifyInput = __decorate([
2654
- ProxyCmp({
2655
- inputs: [
2656
- 'description',
2657
- 'disabled',
2658
- 'fieldId',
2659
- 'handleInputChange',
2660
- 'inputProps',
2661
- 'name',
2662
- 'placeholder',
2663
- 'required',
2664
- 'type',
2665
- 'value',
2666
- ],
2667
- })
2668
- ], exports.AmplifyInput);
2669
- var AmplifyLabel = /** @class */ (function () {
2670
- function AmplifyLabel(c, r, z) {
2671
- this.z = z;
2672
- c.detach();
2673
- this.el = r.nativeElement;
2674
- }
2675
- return AmplifyLabel;
2676
- }());
2677
- AmplifyLabel.decorators = [
2678
- { type: i0.Component, args: [{
2679
- selector: 'amplify-label',
2680
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
2681
- template: '<ng-content></ng-content>',
2682
- inputs: ['htmlFor']
2683
- },] }
2684
- ];
2685
- AmplifyLabel.ctorParameters = function () { return [
2686
- { type: i0.ChangeDetectorRef },
2687
- { type: i0.ElementRef },
2688
- { type: i0.NgZone }
2689
- ]; };
2690
- AmplifyLabel = __decorate([
2691
- ProxyCmp({ inputs: ['htmlFor'] })
2692
- ], AmplifyLabel);
2693
- var AmplifyLink = /** @class */ (function () {
2694
- function AmplifyLink(c, r, z) {
2695
- this.z = z;
2696
- c.detach();
2697
- this.el = r.nativeElement;
2698
- }
2699
- return AmplifyLink;
2700
- }());
2701
- AmplifyLink.decorators = [
2702
- { type: i0.Component, args: [{
2703
- selector: 'amplify-link',
2704
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
2705
- template: '<ng-content></ng-content>',
2706
- inputs: ['role']
2707
- },] }
2708
- ];
2709
- AmplifyLink.ctorParameters = function () { return [
2710
- { type: i0.ChangeDetectorRef },
2711
- { type: i0.ElementRef },
2712
- { type: i0.NgZone }
2713
- ]; };
2714
- AmplifyLink = __decorate([
2715
- ProxyCmp({ inputs: ['role'] })
2716
- ], AmplifyLink);
2717
- var AmplifyLoadingSpinner = /** @class */ (function () {
2718
- function AmplifyLoadingSpinner(c, r, z) {
2719
- this.z = z;
2720
- c.detach();
2721
- this.el = r.nativeElement;
2722
- }
2723
- return AmplifyLoadingSpinner;
2724
- }());
2725
- AmplifyLoadingSpinner.decorators = [
2726
- { type: i0.Component, args: [{
2727
- selector: 'amplify-loading-spinner',
2728
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
2729
- template: '<ng-content></ng-content>'
2730
- },] }
2731
- ];
2732
- AmplifyLoadingSpinner.ctorParameters = function () { return [
2733
- { type: i0.ChangeDetectorRef },
2734
- { type: i0.ElementRef },
2735
- { type: i0.NgZone }
2736
- ]; };
2737
- var AmplifyNav = /** @class */ (function () {
2738
- function AmplifyNav(c, r, z) {
2739
- this.z = z;
2740
- c.detach();
2741
- this.el = r.nativeElement;
2742
- }
2743
- return AmplifyNav;
2744
- }());
2745
- AmplifyNav.decorators = [
2746
- { type: i0.Component, args: [{
2747
- selector: 'amplify-nav',
2748
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
2749
- template: '<ng-content></ng-content>'
2750
- },] }
2751
- ];
2752
- AmplifyNav.ctorParameters = function () { return [
2753
- { type: i0.ChangeDetectorRef },
2754
- { type: i0.ElementRef },
2755
- { type: i0.NgZone }
2756
- ]; };
2757
- var AmplifyOauthButton = /** @class */ (function () {
2758
- function AmplifyOauthButton(c, r, z) {
2759
- this.z = z;
2760
- c.detach();
2761
- this.el = r.nativeElement;
2762
- }
2763
- return AmplifyOauthButton;
2764
- }());
2765
- AmplifyOauthButton.decorators = [
2766
- { type: i0.Component, args: [{
2767
- selector: 'amplify-oauth-button',
2768
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
2769
- template: '<ng-content></ng-content>',
2770
- inputs: ['config']
2771
- },] }
2772
- ];
2773
- AmplifyOauthButton.ctorParameters = function () { return [
2774
- { type: i0.ChangeDetectorRef },
2775
- { type: i0.ElementRef },
2776
- { type: i0.NgZone }
2777
- ]; };
2778
- AmplifyOauthButton = __decorate([
2779
- ProxyCmp({ inputs: ['config'] })
2780
- ], AmplifyOauthButton);
2781
- var AmplifyPasswordField = /** @class */ (function () {
2782
- function AmplifyPasswordField(c, r, z) {
2783
- this.z = z;
2784
- c.detach();
2785
- this.el = r.nativeElement;
2786
- }
2787
- return AmplifyPasswordField;
2788
- }());
2789
- AmplifyPasswordField.decorators = [
2790
- { type: i0.Component, args: [{
2791
- selector: 'amplify-password-field',
2792
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
2793
- template: '<ng-content></ng-content>',
2794
- inputs: [
2795
- 'disabled',
2796
- 'fieldId',
2797
- 'handleInputChange',
2798
- 'hint',
2799
- 'inputProps',
2800
- 'label',
2801
- 'placeholder',
2802
- 'required',
2803
- 'value',
2804
- ]
2805
- },] }
2806
- ];
2807
- AmplifyPasswordField.ctorParameters = function () { return [
2808
- { type: i0.ChangeDetectorRef },
2809
- { type: i0.ElementRef },
2810
- { type: i0.NgZone }
2811
- ]; };
2812
- AmplifyPasswordField = __decorate([
2813
- ProxyCmp({
2814
- inputs: [
2815
- 'disabled',
2816
- 'fieldId',
2817
- 'handleInputChange',
2818
- 'hint',
2819
- 'inputProps',
2820
- 'label',
2821
- 'placeholder',
2822
- 'required',
2823
- 'value',
2824
- ],
2825
- })
2826
- ], AmplifyPasswordField);
2827
- var AmplifyPhoneField = /** @class */ (function () {
2828
- function AmplifyPhoneField(c, r, z) {
2829
- this.z = z;
2830
- c.detach();
2831
- this.el = r.nativeElement;
2832
- }
2833
- return AmplifyPhoneField;
2834
- }());
2835
- AmplifyPhoneField.decorators = [
2836
- { type: i0.Component, args: [{
2837
- selector: 'amplify-phone-field',
2838
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
2839
- template: '<ng-content></ng-content>',
2840
- inputs: [
2841
- 'dialCode',
2842
- 'disabled',
2843
- 'fieldId',
2844
- 'handleInputChange',
2845
- 'hint',
2846
- 'inputProps',
2847
- 'label',
2848
- 'placeholder',
2849
- 'required',
2850
- 'value',
2851
- ]
2852
- },] }
2853
- ];
2854
- AmplifyPhoneField.ctorParameters = function () { return [
2855
- { type: i0.ChangeDetectorRef },
2856
- { type: i0.ElementRef },
2857
- { type: i0.NgZone }
2858
- ]; };
2859
- AmplifyPhoneField = __decorate([
2860
- ProxyCmp({
2861
- inputs: [
2862
- 'dialCode',
2863
- 'disabled',
2864
- 'fieldId',
2865
- 'handleInputChange',
2866
- 'hint',
2867
- 'inputProps',
2868
- 'label',
2869
- 'placeholder',
2870
- 'required',
2871
- 'value',
2872
- ],
2873
- })
2874
- ], AmplifyPhoneField);
2875
- exports.AmplifyPhotoPicker = /** @class */ (function () {
2876
- function AmplifyPhotoPicker(c, r, z) {
2877
- this.z = z;
2878
- c.detach();
2879
- this.el = r.nativeElement;
2880
- }
2881
- return AmplifyPhotoPicker;
2882
- }());
2883
- exports.AmplifyPhotoPicker.decorators = [
2884
- { type: i0.Component, args: [{
2885
- selector: 'amplify-photo-picker',
2886
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
2887
- template: '<ng-content></ng-content>',
2888
- inputs: [
2889
- 'buttonText',
2890
- 'handleClick',
2891
- 'headerHint',
2892
- 'headerTitle',
2893
- 'placeholderHint',
2894
- 'previewSrc',
2895
- ]
2896
- },] }
2897
- ];
2898
- exports.AmplifyPhotoPicker.ctorParameters = function () { return [
2899
- { type: i0.ChangeDetectorRef },
2900
- { type: i0.ElementRef },
2901
- { type: i0.NgZone }
2902
- ]; };
2903
- exports.AmplifyPhotoPicker = __decorate([
2904
- ProxyCmp({
2905
- inputs: [
2906
- 'buttonText',
2907
- 'handleClick',
2908
- 'headerHint',
2909
- 'headerTitle',
2910
- 'placeholderHint',
2911
- 'previewSrc',
2912
- ],
2913
- })
2914
- ], exports.AmplifyPhotoPicker);
2915
- exports.AmplifyPicker = /** @class */ (function () {
2916
- function AmplifyPicker(c, r, z) {
2917
- this.z = z;
2918
- c.detach();
2919
- this.el = r.nativeElement;
2920
- }
2921
- return AmplifyPicker;
2922
- }());
2923
- exports.AmplifyPicker.decorators = [
2924
- { type: i0.Component, args: [{
2925
- selector: 'amplify-picker',
2926
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
2927
- template: '<ng-content></ng-content>',
2928
- inputs: ['acceptValue', 'inputHandler', 'pickerText']
2929
- },] }
2930
- ];
2931
- exports.AmplifyPicker.ctorParameters = function () { return [
2932
- { type: i0.ChangeDetectorRef },
2933
- { type: i0.ElementRef },
2934
- { type: i0.NgZone }
2935
- ]; };
2936
- exports.AmplifyPicker = __decorate([
2937
- ProxyCmp({ inputs: ['acceptValue', 'inputHandler', 'pickerText'] })
2938
- ], exports.AmplifyPicker);
2939
- var AmplifyRadioButton = /** @class */ (function () {
2940
- function AmplifyRadioButton(c, r, z) {
2941
- this.z = z;
2942
- c.detach();
2943
- this.el = r.nativeElement;
2944
- }
2945
- return AmplifyRadioButton;
2946
- }());
2947
- AmplifyRadioButton.decorators = [
2948
- { type: i0.Component, args: [{
2949
- selector: 'amplify-radio-button',
2950
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
2951
- template: '<ng-content></ng-content>',
2952
- inputs: [
2953
- 'checked',
2954
- 'disabled',
2955
- 'fieldId',
2956
- 'handleInputChange',
2957
- 'inputProps',
2958
- 'label',
2959
- 'name',
2960
- 'placeholder',
2961
- 'value',
2962
- ]
2963
- },] }
2964
- ];
2965
- AmplifyRadioButton.ctorParameters = function () { return [
2966
- { type: i0.ChangeDetectorRef },
2967
- { type: i0.ElementRef },
2968
- { type: i0.NgZone }
2969
- ]; };
2970
- AmplifyRadioButton = __decorate([
2971
- ProxyCmp({
2972
- inputs: [
2973
- 'checked',
2974
- 'disabled',
2975
- 'fieldId',
2976
- 'handleInputChange',
2977
- 'inputProps',
2978
- 'label',
2979
- 'name',
2980
- 'placeholder',
2981
- 'value',
2982
- ],
2983
- })
2984
- ], AmplifyRadioButton);
2985
- var AmplifyRequireNewPassword = /** @class */ (function () {
2986
- function AmplifyRequireNewPassword(c, r, z) {
2987
- this.z = z;
2988
- c.detach();
2989
- this.el = r.nativeElement;
2990
- }
2991
- return AmplifyRequireNewPassword;
2992
- }());
2993
- AmplifyRequireNewPassword.decorators = [
2994
- { type: i0.Component, args: [{
2995
- selector: 'amplify-require-new-password',
2996
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
2997
- template: '<ng-content></ng-content>',
2998
- inputs: [
2999
- 'formFields',
3000
- 'handleAuthStateChange',
3001
- 'handleSubmit',
3002
- 'headerText',
3003
- 'submitButtonText',
3004
- 'user',
3005
- ]
3006
- },] }
3007
- ];
3008
- AmplifyRequireNewPassword.ctorParameters = function () { return [
3009
- { type: i0.ChangeDetectorRef },
3010
- { type: i0.ElementRef },
3011
- { type: i0.NgZone }
3012
- ]; };
3013
- AmplifyRequireNewPassword = __decorate([
3014
- ProxyCmp({
3015
- inputs: [
3016
- 'formFields',
3017
- 'handleAuthStateChange',
3018
- 'handleSubmit',
3019
- 'headerText',
3020
- 'submitButtonText',
3021
- 'user',
3022
- ],
3023
- })
3024
- ], AmplifyRequireNewPassword);
3025
- exports.AmplifyS3Album = /** @class */ (function () {
3026
- function AmplifyS3Album(c, r, z) {
3027
- this.z = z;
3028
- c.detach();
3029
- this.el = r.nativeElement;
3030
- }
3031
- return AmplifyS3Album;
3032
- }());
3033
- exports.AmplifyS3Album.decorators = [
3034
- { type: i0.Component, args: [{
3035
- selector: 'amplify-s3-album',
3036
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
3037
- template: '<ng-content></ng-content>',
3038
- inputs: [
3039
- 'contentType',
3040
- 'fileToKey',
3041
- 'filter',
3042
- 'handleOnError',
3043
- 'handleOnLoad',
3044
- 'identityId',
3045
- 'level',
3046
- 'path',
3047
- 'picker',
3048
- 'pickerText',
3049
- 'sort',
3050
- 'track',
3051
- ]
3052
- },] }
3053
- ];
3054
- exports.AmplifyS3Album.ctorParameters = function () { return [
3055
- { type: i0.ChangeDetectorRef },
3056
- { type: i0.ElementRef },
3057
- { type: i0.NgZone }
3058
- ]; };
3059
- exports.AmplifyS3Album = __decorate([
3060
- ProxyCmp({
3061
- inputs: [
3062
- 'contentType',
3063
- 'fileToKey',
3064
- 'filter',
3065
- 'handleOnError',
3066
- 'handleOnLoad',
3067
- 'identityId',
3068
- 'level',
3069
- 'path',
3070
- 'picker',
3071
- 'pickerText',
3072
- 'sort',
3073
- 'track',
3074
- ],
3075
- })
3076
- ], exports.AmplifyS3Album);
3077
- exports.AmplifyS3Image = /** @class */ (function () {
3078
- function AmplifyS3Image(c, r, z) {
3079
- this.z = z;
3080
- c.detach();
3081
- this.el = r.nativeElement;
3082
- }
3083
- return AmplifyS3Image;
3084
- }());
3085
- exports.AmplifyS3Image.decorators = [
3086
- { type: i0.Component, args: [{
3087
- selector: 'amplify-s3-image',
3088
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
3089
- template: '<ng-content></ng-content>',
3090
- inputs: [
3091
- 'alt',
3092
- 'body',
3093
- 'contentType',
3094
- 'handleOnError',
3095
- 'handleOnLoad',
3096
- 'identityId',
3097
- 'imgKey',
3098
- 'imgProps',
3099
- 'level',
3100
- 'path',
3101
- 'track',
3102
- ]
3103
- },] }
3104
- ];
3105
- exports.AmplifyS3Image.ctorParameters = function () { return [
3106
- { type: i0.ChangeDetectorRef },
3107
- { type: i0.ElementRef },
3108
- { type: i0.NgZone }
3109
- ]; };
3110
- exports.AmplifyS3Image = __decorate([
3111
- ProxyCmp({
3112
- inputs: [
3113
- 'alt',
3114
- 'body',
3115
- 'contentType',
3116
- 'handleOnError',
3117
- 'handleOnLoad',
3118
- 'identityId',
3119
- 'imgKey',
3120
- 'imgProps',
3121
- 'level',
3122
- 'path',
3123
- 'track',
3124
- ],
3125
- })
3126
- ], exports.AmplifyS3Image);
3127
- exports.AmplifyS3ImagePicker = /** @class */ (function () {
3128
- function AmplifyS3ImagePicker(c, r, z) {
3129
- this.z = z;
3130
- c.detach();
3131
- this.el = r.nativeElement;
3132
- }
3133
- return AmplifyS3ImagePicker;
1759
+ return AmplifySlotComponent;
3134
1760
  }());
3135
- exports.AmplifyS3ImagePicker.decorators = [
1761
+ AmplifySlotComponent.decorators = [
3136
1762
  { type: i0.Component, args: [{
3137
- selector: 'amplify-s3-image-picker',
3138
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
3139
- template: '<ng-content></ng-content>',
3140
- inputs: [
3141
- 'buttonText',
3142
- 'contentType',
3143
- 'fileToKey',
3144
- 'headerHint',
3145
- 'headerTitle',
3146
- 'identityId',
3147
- 'level',
3148
- 'path',
3149
- 'placeholderHint',
3150
- 'track',
3151
- ]
1763
+ selector: 'amplify-slot',
1764
+ 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"
3152
1765
  },] }
3153
1766
  ];
3154
- exports.AmplifyS3ImagePicker.ctorParameters = function () { return [
3155
- { type: i0.ChangeDetectorRef },
3156
- { type: i0.ElementRef },
3157
- { type: i0.NgZone }
1767
+ AmplifySlotComponent.ctorParameters = function () { return [
1768
+ { type: CustomComponentsService }
3158
1769
  ]; };
3159
- exports.AmplifyS3ImagePicker = __decorate([
3160
- ProxyCmp({
3161
- inputs: [
3162
- 'buttonText',
3163
- 'contentType',
3164
- 'fileToKey',
3165
- 'headerHint',
3166
- 'headerTitle',
3167
- 'identityId',
3168
- 'level',
3169
- 'path',
3170
- 'placeholderHint',
3171
- 'track',
3172
- ],
3173
- })
3174
- ], exports.AmplifyS3ImagePicker);
3175
- exports.AmplifyS3Text = /** @class */ (function () {
3176
- function AmplifyS3Text(c, r, z) {
3177
- this.z = z;
3178
- c.detach();
3179
- this.el = r.nativeElement;
3180
- }
3181
- return AmplifyS3Text;
3182
- }());
3183
- exports.AmplifyS3Text.decorators = [
3184
- { type: i0.Component, args: [{
3185
- selector: 'amplify-s3-text',
3186
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
3187
- template: '<ng-content></ng-content>',
3188
- inputs: [
3189
- 'body',
3190
- 'contentType',
3191
- 'fallbackText',
3192
- 'identityId',
3193
- 'level',
3194
- 'path',
3195
- 'textKey',
3196
- 'track',
3197
- ]
3198
- },] }
3199
- ];
3200
- exports.AmplifyS3Text.ctorParameters = function () { return [
3201
- { type: i0.ChangeDetectorRef },
3202
- { type: i0.ElementRef },
3203
- { type: i0.NgZone }
3204
- ]; };
3205
- exports.AmplifyS3Text = __decorate([
3206
- ProxyCmp({
3207
- inputs: [
3208
- 'body',
3209
- 'contentType',
3210
- 'fallbackText',
3211
- 'identityId',
3212
- 'level',
3213
- 'path',
3214
- 'textKey',
3215
- 'track',
3216
- ],
3217
- })
3218
- ], exports.AmplifyS3Text);
3219
- exports.AmplifyS3TextPicker = /** @class */ (function () {
3220
- function AmplifyS3TextPicker(c, r, z) {
3221
- this.z = z;
3222
- c.detach();
3223
- this.el = r.nativeElement;
3224
- }
3225
- return AmplifyS3TextPicker;
3226
- }());
3227
- exports.AmplifyS3TextPicker.decorators = [
3228
- { type: i0.Component, args: [{
3229
- selector: 'amplify-s3-text-picker',
3230
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
3231
- template: '<ng-content></ng-content>',
3232
- inputs: [
3233
- 'contentType',
3234
- 'fallbackText',
3235
- 'fileToKey',
3236
- 'identityId',
3237
- 'level',
3238
- 'path',
3239
- 'track',
3240
- ]
3241
- },] }
3242
- ];
3243
- exports.AmplifyS3TextPicker.ctorParameters = function () { return [
3244
- { type: i0.ChangeDetectorRef },
3245
- { type: i0.ElementRef },
3246
- { type: i0.NgZone }
3247
- ]; };
3248
- exports.AmplifyS3TextPicker = __decorate([
3249
- ProxyCmp({
3250
- inputs: [
3251
- 'contentType',
3252
- 'fallbackText',
3253
- 'fileToKey',
3254
- 'identityId',
3255
- 'level',
3256
- 'path',
3257
- 'track',
3258
- ],
3259
- })
3260
- ], exports.AmplifyS3TextPicker);
3261
- var AmplifySection = /** @class */ (function () {
3262
- function AmplifySection(c, r, z) {
3263
- this.z = z;
3264
- c.detach();
3265
- this.el = r.nativeElement;
3266
- }
3267
- return AmplifySection;
3268
- }());
3269
- AmplifySection.decorators = [
3270
- { type: i0.Component, args: [{
3271
- selector: 'amplify-section',
3272
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
3273
- template: '<ng-content></ng-content>',
3274
- inputs: ['role']
3275
- },] }
3276
- ];
3277
- AmplifySection.ctorParameters = function () { return [
3278
- { type: i0.ChangeDetectorRef },
3279
- { type: i0.ElementRef },
3280
- { type: i0.NgZone }
3281
- ]; };
3282
- AmplifySection = __decorate([
3283
- ProxyCmp({ inputs: ['role'] })
3284
- ], AmplifySection);
3285
- var AmplifySelect = /** @class */ (function () {
3286
- function AmplifySelect(c, r, z) {
3287
- this.z = z;
3288
- c.detach();
3289
- this.el = r.nativeElement;
3290
- }
3291
- return AmplifySelect;
3292
- }());
3293
- AmplifySelect.decorators = [
3294
- { type: i0.Component, args: [{
3295
- selector: 'amplify-select',
3296
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
3297
- template: '<ng-content></ng-content>',
3298
- inputs: ['fieldId', 'handleInputChange', 'options', 'selected']
3299
- },] }
3300
- ];
3301
- AmplifySelect.ctorParameters = function () { return [
3302
- { type: i0.ChangeDetectorRef },
3303
- { type: i0.ElementRef },
3304
- { type: i0.NgZone }
3305
- ]; };
3306
- AmplifySelect = __decorate([
3307
- ProxyCmp({ inputs: ['fieldId', 'handleInputChange', 'options', 'selected'] })
3308
- ], AmplifySelect);
3309
- var AmplifySelectMfaType = /** @class */ (function () {
3310
- function AmplifySelectMfaType(c, r, z) {
3311
- this.z = z;
3312
- c.detach();
3313
- this.el = r.nativeElement;
3314
- }
3315
- return AmplifySelectMfaType;
3316
- }());
3317
- AmplifySelectMfaType.decorators = [
3318
- { type: i0.Component, args: [{
3319
- selector: 'amplify-select-mfa-type',
3320
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
3321
- template: '<ng-content></ng-content>',
3322
- inputs: ['MFATypes', 'authData', 'handleSubmit']
3323
- },] }
3324
- ];
3325
- AmplifySelectMfaType.ctorParameters = function () { return [
3326
- { type: i0.ChangeDetectorRef },
3327
- { type: i0.ElementRef },
3328
- { type: i0.NgZone }
3329
- ]; };
3330
- AmplifySelectMfaType = __decorate([
3331
- ProxyCmp({ inputs: ['MFATypes', 'authData', 'handleSubmit'] })
3332
- ], AmplifySelectMfaType);
3333
- var AmplifySignIn = /** @class */ (function () {
3334
- function AmplifySignIn(c, r, z) {
3335
- this.z = z;
3336
- c.detach();
3337
- this.el = r.nativeElement;
3338
- }
3339
- return AmplifySignIn;
3340
- }());
3341
- AmplifySignIn.decorators = [
3342
- { type: i0.Component, args: [{
3343
- selector: 'amplify-sign-in',
3344
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
3345
- template: '<ng-content></ng-content>',
3346
- inputs: [
3347
- 'federated',
3348
- 'formFields',
3349
- 'handleAuthStateChange',
3350
- 'handleSubmit',
3351
- 'headerText',
3352
- 'hideSignUp',
3353
- 'submitButtonText',
3354
- 'usernameAlias',
3355
- ]
3356
- },] }
3357
- ];
3358
- AmplifySignIn.ctorParameters = function () { return [
3359
- { type: i0.ChangeDetectorRef },
3360
- { type: i0.ElementRef },
3361
- { type: i0.NgZone }
3362
- ]; };
3363
- AmplifySignIn = __decorate([
3364
- ProxyCmp({
3365
- inputs: [
3366
- 'federated',
3367
- 'formFields',
3368
- 'handleAuthStateChange',
3369
- 'handleSubmit',
3370
- 'headerText',
3371
- 'hideSignUp',
3372
- 'submitButtonText',
3373
- 'usernameAlias',
3374
- ],
3375
- })
3376
- ], AmplifySignIn);
3377
- var AmplifySignInButton = /** @class */ (function () {
3378
- function AmplifySignInButton(c, r, z) {
3379
- this.z = z;
3380
- c.detach();
3381
- this.el = r.nativeElement;
3382
- }
3383
- return AmplifySignInButton;
3384
- }());
3385
- AmplifySignInButton.decorators = [
3386
- { type: i0.Component, args: [{
3387
- selector: 'amplify-sign-in-button',
3388
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
3389
- template: '<ng-content></ng-content>',
3390
- inputs: ['provider']
3391
- },] }
3392
- ];
3393
- AmplifySignInButton.ctorParameters = function () { return [
3394
- { type: i0.ChangeDetectorRef },
3395
- { type: i0.ElementRef },
3396
- { type: i0.NgZone }
3397
- ]; };
3398
- AmplifySignInButton = __decorate([
3399
- ProxyCmp({ inputs: ['provider'] })
3400
- ], AmplifySignInButton);
3401
- var AmplifySignOut = /** @class */ (function () {
3402
- function AmplifySignOut(c, r, z) {
3403
- this.z = z;
3404
- c.detach();
3405
- this.el = r.nativeElement;
3406
- }
3407
- return AmplifySignOut;
3408
- }());
3409
- AmplifySignOut.decorators = [
3410
- { type: i0.Component, args: [{
3411
- selector: 'amplify-sign-out',
3412
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
3413
- template: '<ng-content></ng-content>',
3414
- inputs: ['buttonText', 'handleAuthStateChange']
3415
- },] }
3416
- ];
3417
- AmplifySignOut.ctorParameters = function () { return [
3418
- { type: i0.ChangeDetectorRef },
3419
- { type: i0.ElementRef },
3420
- { type: i0.NgZone }
3421
- ]; };
3422
- AmplifySignOut = __decorate([
3423
- ProxyCmp({ inputs: ['buttonText', 'handleAuthStateChange'] })
3424
- ], AmplifySignOut);
3425
- var AmplifySignUp = /** @class */ (function () {
3426
- function AmplifySignUp(c, r, z) {
3427
- this.z = z;
3428
- c.detach();
3429
- this.el = r.nativeElement;
3430
- }
3431
- return AmplifySignUp;
3432
- }());
3433
- AmplifySignUp.decorators = [
3434
- { type: i0.Component, args: [{
3435
- selector: 'amplify-sign-up',
3436
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
3437
- template: '<ng-content></ng-content>',
3438
- inputs: [
3439
- 'formFields',
3440
- 'handleAuthStateChange',
3441
- 'handleSignUp',
3442
- 'handleSubmit',
3443
- 'haveAccountText',
3444
- 'headerText',
3445
- 'signInText',
3446
- 'submitButtonText',
3447
- 'usernameAlias',
3448
- 'validationErrors',
3449
- ]
3450
- },] }
3451
- ];
3452
- AmplifySignUp.ctorParameters = function () { return [
3453
- { type: i0.ChangeDetectorRef },
3454
- { type: i0.ElementRef },
3455
- { type: i0.NgZone }
3456
- ]; };
3457
- AmplifySignUp = __decorate([
3458
- ProxyCmp({
3459
- inputs: [
3460
- 'formFields',
3461
- 'handleAuthStateChange',
3462
- 'handleSignUp',
3463
- 'handleSubmit',
3464
- 'haveAccountText',
3465
- 'headerText',
3466
- 'signInText',
3467
- 'submitButtonText',
3468
- 'usernameAlias',
3469
- 'validationErrors',
3470
- ],
3471
- })
3472
- ], AmplifySignUp);
3473
- var AmplifyStrike = /** @class */ (function () {
3474
- function AmplifyStrike(c, r, z) {
3475
- this.z = z;
3476
- c.detach();
3477
- this.el = r.nativeElement;
3478
- }
3479
- return AmplifyStrike;
3480
- }());
3481
- AmplifyStrike.decorators = [
3482
- { type: i0.Component, args: [{
3483
- selector: 'amplify-strike',
3484
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
3485
- template: '<ng-content></ng-content>'
3486
- },] }
3487
- ];
3488
- AmplifyStrike.ctorParameters = function () { return [
3489
- { type: i0.ChangeDetectorRef },
3490
- { type: i0.ElementRef },
3491
- { type: i0.NgZone }
3492
- ]; };
3493
- exports.AmplifyToast = /** @class */ (function () {
3494
- function AmplifyToast(c, r, z) {
3495
- this.z = z;
3496
- c.detach();
3497
- this.el = r.nativeElement;
3498
- }
3499
- return AmplifyToast;
3500
- }());
3501
- exports.AmplifyToast.decorators = [
3502
- { type: i0.Component, args: [{
3503
- selector: 'amplify-toast',
3504
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
3505
- template: '<ng-content></ng-content>',
3506
- inputs: ['handleClose', 'message']
3507
- },] }
3508
- ];
3509
- exports.AmplifyToast.ctorParameters = function () { return [
3510
- { type: i0.ChangeDetectorRef },
3511
- { type: i0.ElementRef },
3512
- { type: i0.NgZone }
3513
- ]; };
3514
- exports.AmplifyToast = __decorate([
3515
- ProxyCmp({ inputs: ['handleClose', 'message'] })
3516
- ], exports.AmplifyToast);
3517
- var AmplifyTooltip = /** @class */ (function () {
3518
- function AmplifyTooltip(c, r, z) {
3519
- this.z = z;
3520
- c.detach();
3521
- this.el = r.nativeElement;
3522
- }
3523
- return AmplifyTooltip;
3524
- }());
3525
- AmplifyTooltip.decorators = [
3526
- { type: i0.Component, args: [{
3527
- selector: 'amplify-tooltip',
3528
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
3529
- template: '<ng-content></ng-content>',
3530
- inputs: ['shouldAutoShow', 'text']
3531
- },] }
3532
- ];
3533
- AmplifyTooltip.ctorParameters = function () { return [
3534
- { type: i0.ChangeDetectorRef },
3535
- { type: i0.ElementRef },
3536
- { type: i0.NgZone }
3537
- ]; };
3538
- AmplifyTooltip = __decorate([
3539
- ProxyCmp({ inputs: ['shouldAutoShow', 'text'] })
3540
- ], AmplifyTooltip);
3541
- var AmplifyTotpSetup = /** @class */ (function () {
3542
- function AmplifyTotpSetup(c, r, z) {
3543
- this.z = z;
3544
- c.detach();
3545
- this.el = r.nativeElement;
3546
- }
3547
- return AmplifyTotpSetup;
3548
- }());
3549
- AmplifyTotpSetup.decorators = [
3550
- { type: i0.Component, args: [{
3551
- selector: 'amplify-totp-setup',
3552
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
3553
- template: '<ng-content></ng-content>',
3554
- inputs: [
3555
- 'handleAuthStateChange',
3556
- 'handleComplete',
3557
- 'headerText',
3558
- 'issuer',
3559
- 'standalone',
3560
- 'user',
3561
- ]
3562
- },] }
3563
- ];
3564
- AmplifyTotpSetup.ctorParameters = function () { return [
3565
- { type: i0.ChangeDetectorRef },
3566
- { type: i0.ElementRef },
3567
- { type: i0.NgZone }
3568
- ]; };
3569
- AmplifyTotpSetup = __decorate([
3570
- ProxyCmp({
3571
- inputs: [
3572
- 'handleAuthStateChange',
3573
- 'handleComplete',
3574
- 'headerText',
3575
- 'issuer',
3576
- 'standalone',
3577
- 'user',
3578
- ],
3579
- })
3580
- ], AmplifyTotpSetup);
3581
- var AmplifyUsernameField = /** @class */ (function () {
3582
- function AmplifyUsernameField(c, r, z) {
3583
- this.z = z;
3584
- c.detach();
3585
- this.el = r.nativeElement;
3586
- }
3587
- return AmplifyUsernameField;
3588
- }());
3589
- AmplifyUsernameField.decorators = [
3590
- { type: i0.Component, args: [{
3591
- selector: 'amplify-username-field',
3592
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
3593
- template: '<ng-content></ng-content>',
3594
- inputs: [
3595
- 'disabled',
3596
- 'fieldId',
3597
- 'handleInputChange',
3598
- 'hint',
3599
- 'inputProps',
3600
- 'label',
3601
- 'placeholder',
3602
- 'required',
3603
- 'value',
3604
- ]
3605
- },] }
3606
- ];
3607
- AmplifyUsernameField.ctorParameters = function () { return [
3608
- { type: i0.ChangeDetectorRef },
3609
- { type: i0.ElementRef },
3610
- { type: i0.NgZone }
3611
- ]; };
3612
- AmplifyUsernameField = __decorate([
3613
- ProxyCmp({
3614
- inputs: [
3615
- 'disabled',
3616
- 'fieldId',
3617
- 'handleInputChange',
3618
- 'hint',
3619
- 'inputProps',
3620
- 'label',
3621
- 'placeholder',
3622
- 'required',
3623
- 'value',
3624
- ],
3625
- })
3626
- ], AmplifyUsernameField);
3627
- var AmplifyVerifyContact = /** @class */ (function () {
3628
- function AmplifyVerifyContact(c, r, z) {
3629
- this.z = z;
3630
- c.detach();
3631
- this.el = r.nativeElement;
3632
- }
3633
- return AmplifyVerifyContact;
3634
- }());
3635
- AmplifyVerifyContact.decorators = [
3636
- { type: i0.Component, args: [{
3637
- selector: 'amplify-verify-contact',
3638
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
3639
- template: '<ng-content></ng-content>',
3640
- inputs: ['handleAuthStateChange', 'user']
3641
- },] }
3642
- ];
3643
- AmplifyVerifyContact.ctorParameters = function () { return [
3644
- { type: i0.ChangeDetectorRef },
3645
- { type: i0.ElementRef },
3646
- { type: i0.NgZone }
3647
- ]; };
3648
- AmplifyVerifyContact = __decorate([
3649
- ProxyCmp({ inputs: ['handleAuthStateChange', 'user'] })
3650
- ], AmplifyVerifyContact);
3651
-
3652
- var PhoneNumberFieldComponent = /** @class */ (function () {
3653
- function PhoneNumberFieldComponent() {
3654
- this.autocomplete = 'new-password';
3655
- this.disabled = false;
3656
- this.initialValue = '';
3657
- this.label = '';
3658
- this.placeholder = '';
3659
- this.required = true;
3660
- this.countryDialCodes = ui.countryDialCodes;
3661
- }
3662
- return PhoneNumberFieldComponent;
3663
- }());
3664
- PhoneNumberFieldComponent.decorators = [
3665
- { type: i0.Component, args: [{
3666
- selector: 'amplify-phone-number-field',
3667
- template: "<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=\" amplify-flex amplify-field amplify-selectfield amplify-countrycodeselect\"\n style=\"flex-direction: column\"\n >\n <amplify-form-select\n name=\"country_code\"\n label=\"Country Code\"\n [id]=\"selectFieldId\"\n [items]=\"countryDialCodes\"\n [defaultValue]=\"defaultCountryCode\"\n ></amplify-form-select>\n </div>\n </div>\n\n <label class=\"sr-only amplify-label\" [for]=\"textFieldId\">\n {{ label }}\n </label>\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 [attr.disabled]=\"disabled ? '' : null\"\n [autocomplete]=\"autocomplete\"\n />\n</div>\n"
3668
- },] }
3669
- ];
3670
- PhoneNumberFieldComponent.propDecorators = {
3671
- autocomplete: [{ type: i0.Input }],
3672
- disabled: [{ type: i0.Input }],
3673
- defaultCountryCode: [{ type: i0.Input }],
3674
- selectFieldId: [{ type: i0.Input }],
3675
- textFieldId: [{ type: i0.Input }],
3676
- initialValue: [{ type: i0.Input }],
3677
- label: [{ type: i0.Input }],
1770
+ AmplifySlotComponent.propDecorators = {
3678
1771
  name: [{ type: i0.Input }],
3679
- placeholder: [{ type: i0.Input }],
3680
- required: [{ type: i0.Input }],
3681
- type: [{ type: i0.Input }]
1772
+ context: [{ type: i0.Input }],
1773
+ display: [{ type: i0.HostBinding, args: ['style.display',] }]
3682
1774
  };
3683
1775
 
3684
- customElements.define('amplify-button', components.AmplifyButton);
3685
- customElements.define('amplify-input', components.AmplifyInput);
3686
- customElements.define('amplify-toast', components.AmplifyToast);
3687
- customElements.define('amplify-chatbot', components.AmplifyChatbot);
3688
- customElements.define('amplify-s3-album', components.AmplifyS3Album);
3689
- customElements.define('amplify-s3-image-picker', components.AmplifyS3ImagePicker);
3690
- customElements.define('amplify-s3-text', components.AmplifyS3Text);
3691
- customElements.define('amplify-s3-text-picker', components.AmplifyS3TextPicker);
3692
- customElements.define('amplify-s3-image', components.AmplifyS3Image);
3693
- customElements.define('amplify-picker', components.AmplifyPicker);
3694
- customElements.define('amplify-photo-picker', components.AmplifyPhotoPicker);
3695
- var UiAngularModule = /** @class */ (function () {
3696
- function UiAngularModule() {
1776
+ var AmplifyAuthenticatorModule = /** @class */ (function () {
1777
+ function AmplifyAuthenticatorModule() {
3697
1778
  }
3698
- return UiAngularModule;
1779
+ return AmplifyAuthenticatorModule;
3699
1780
  }());
3700
- UiAngularModule.decorators = [
1781
+ AmplifyAuthenticatorModule.decorators = [
3701
1782
  { type: i0.NgModule, args: [{
3702
1783
  declarations: [
3703
- exports.AmplifyChatbot,
3704
- exports.AmplifyToast,
3705
- exports.AmplifyInput,
3706
- exports.AmplifyButton,
3707
- exports.AmplifyS3Album,
3708
- exports.AmplifyS3ImagePicker,
3709
- exports.AmplifyS3Text,
3710
- exports.AmplifyS3TextPicker,
3711
- exports.AmplifyS3Image,
3712
- exports.AmplifyPicker,
3713
- exports.AmplifyPhotoPicker,
3714
- AmplifyAuthenticatorComponent,
3715
- AmplifySignInComponent,
3716
- AmplifySignUpComponent,
3717
- AmplifyFormFieldComponent,
3718
- AmplifyErrorComponent,
1784
+ AmplifySlotComponent,
3719
1785
  AmplifySlotDirective,
3720
- AmplifyConfirmSignUpComponent,
3721
- AmplifyUserNameAliasComponent,
3722
- AmplifyConfirmSignInComponent,
3723
- AmplifySetupTotpComponent,
3724
- AmplifyForceNewPasswordComponent,
3725
- AmplifyFederatedSignInComponent,
3726
- AmplifyFederatedSignInButtonComponent,
3727
- AmplifyResetPasswordComponent,
3728
- AmplifyVerifyUserComponent,
1786
+ AuthenticatorComponent,
1787
+ ButtonComponent,
1788
+ CheckboxComponent,
3729
1789
  ConfirmResetPasswordComponent,
1790
+ ConfirmSignInComponent,
1791
+ ConfirmSignUpComponent,
3730
1792
  ConfirmVerifyUserComponent,
3731
- AmplifySelectComponent,
3732
- AmplifyButtonComponent,
3733
- AmplifyPasswordFieldComponent,
3734
- AmplifyTextFieldComponent,
3735
- TabsComponent,
3736
- TabItemComponent,
1793
+ ErrorComponent,
1794
+ FederatedSignInButtonComponent,
1795
+ FederatedSignInComponent,
1796
+ ForceNewPasswordComponent,
1797
+ FormFieldComponent,
1798
+ PasswordFieldComponent,
3737
1799
  PhoneNumberFieldComponent,
1800
+ ResetPasswordComponent,
1801
+ SelectComponent,
1802
+ SetupTotpComponent,
1803
+ SignInComponent,
1804
+ SignUpComponent,
1805
+ SignUpFormFieldsComponent,
1806
+ TabItemComponent,
1807
+ TabsComponent,
1808
+ TextFieldComponent,
1809
+ UserNameAliasComponent,
1810
+ VerifyUserComponent,
3738
1811
  ],
3739
1812
  imports: [common.CommonModule],
3740
1813
  exports: [
3741
- exports.AmplifyChatbot,
3742
- exports.AmplifyToast,
3743
- exports.AmplifyInput,
3744
- exports.AmplifyButton,
3745
- exports.AmplifyS3Album,
3746
- exports.AmplifyS3ImagePicker,
3747
- exports.AmplifyS3Text,
3748
- exports.AmplifyS3TextPicker,
3749
- exports.AmplifyS3Image,
3750
- exports.AmplifyPicker,
3751
- exports.AmplifyPhotoPicker,
3752
- AmplifyAuthenticatorComponent,
3753
- AmplifySignInComponent,
3754
- AmplifyFormFieldComponent,
3755
- AmplifyErrorComponent,
3756
1814
  AmplifySlotDirective,
1815
+ AuthenticatorComponent,
1816
+ CheckboxComponent,
1817
+ SignUpFormFieldsComponent,
1818
+ TextFieldComponent,
3757
1819
  ],
3758
- schemas: [i0.CUSTOM_ELEMENTS_SCHEMA],
3759
1820
  },] }
3760
1821
  ];
3761
1822
 
@@ -3767,50 +1828,62 @@
3767
1828
  * Generated bundle index. Do not edit.
3768
1829
  */
3769
1830
 
3770
- exports.AmplifyAuthenticatorComponent = AmplifyAuthenticatorComponent;
3771
- exports.AmplifyConfirmSignInComponent = AmplifyConfirmSignInComponent;
3772
- exports.AmplifyConfirmSignUpComponent = AmplifyConfirmSignUpComponent;
3773
- exports.AmplifyErrorComponent = AmplifyErrorComponent;
3774
- exports.AmplifyFederatedSignInButtonComponent = AmplifyFederatedSignInButtonComponent;
3775
- exports.AmplifyFederatedSignInComponent = AmplifyFederatedSignInComponent;
3776
- exports.AmplifyForceNewPasswordComponent = AmplifyForceNewPasswordComponent;
3777
- exports.AmplifyFormFieldComponent = AmplifyFormFieldComponent;
3778
- exports.AmplifyResetPasswordComponent = AmplifyResetPasswordComponent;
3779
- exports.AmplifySetupTotpComponent = AmplifySetupTotpComponent;
3780
- exports.AmplifySignInComponent = AmplifySignInComponent;
3781
- exports.AmplifySignUpComponent = AmplifySignUpComponent;
1831
+ exports.AmplifyAuthenticatorModule = AmplifyAuthenticatorModule;
3782
1832
  exports.AmplifySlotDirective = AmplifySlotDirective;
3783
- exports.AmplifyVerifyUserComponent = AmplifyVerifyUserComponent;
3784
- exports.AuthPropService = AuthPropService;
1833
+ exports.AuthenticatorComponent = AuthenticatorComponent;
1834
+ exports.AuthenticatorService = AuthenticatorService;
1835
+ exports.ButtonComponent = ButtonComponent;
1836
+ exports.CheckboxComponent = CheckboxComponent;
3785
1837
  exports.ConfirmResetPasswordComponent = ConfirmResetPasswordComponent;
1838
+ exports.ConfirmSignInComponent = ConfirmSignInComponent;
1839
+ exports.ConfirmSignUpComponent = ConfirmSignUpComponent;
3786
1840
  exports.ConfirmVerifyUserComponent = ConfirmVerifyUserComponent;
3787
- exports.StateMachineService = StateMachineService;
3788
- exports.UiAngularModule = UiAngularModule;
1841
+ exports.CustomComponentsService = CustomComponentsService;
1842
+ exports.ErrorComponent = ErrorComponent;
1843
+ exports.FederatedSignInButtonComponent = FederatedSignInButtonComponent;
1844
+ exports.FederatedSignInComponent = FederatedSignInComponent;
1845
+ exports.ForceNewPasswordComponent = ForceNewPasswordComponent;
1846
+ exports.FormFieldComponent = FormFieldComponent;
1847
+ exports.PasswordFieldComponent = PasswordFieldComponent;
1848
+ exports.PhoneNumberFieldComponent = PhoneNumberFieldComponent;
1849
+ exports.ResetPasswordComponent = ResetPasswordComponent;
1850
+ exports.SelectComponent = SelectComponent;
1851
+ exports.SetupTotpComponent = SetupTotpComponent;
1852
+ exports.SignInComponent = SignInComponent;
1853
+ exports.SignUpComponent = SignUpComponent;
1854
+ exports.SignUpFormFieldsComponent = SignUpFormFieldsComponent;
1855
+ exports.TabItemComponent = TabItemComponent;
1856
+ exports.TabsComponent = TabsComponent;
1857
+ exports.TextFieldComponent = TextFieldComponent;
1858
+ exports.UserNameAliasComponent = UserNameAliasComponent;
1859
+ exports.VerifyUserComponent = VerifyUserComponent;
3789
1860
  exports.getAttributeMap = getAttributeMap;
3790
- exports["ɵa"] = ProxyCmp;
3791
- exports["ɵb"] = AmplifyAuthenticatorComponent;
3792
- exports["ɵc"] = AmplifySignInComponent;
3793
- exports["ɵd"] = AmplifySignUpComponent;
3794
- exports["ɵe"] = AmplifyFormFieldComponent;
3795
- exports["ɵf"] = AmplifyErrorComponent;
3796
- exports["ɵg"] = AmplifyConfirmSignUpComponent;
3797
- exports["ɵh"] = AmplifyUserNameAliasComponent;
3798
- exports["ɵi"] = AmplifyConfirmSignInComponent;
3799
- exports["ɵj"] = AmplifySetupTotpComponent;
3800
- exports["ɵk"] = AmplifyForceNewPasswordComponent;
3801
- exports["ɵl"] = AmplifyFederatedSignInComponent;
3802
- exports["ɵm"] = AmplifyFederatedSignInButtonComponent;
3803
- exports["ɵn"] = AmplifyResetPasswordComponent;
3804
- exports["ɵo"] = AmplifyVerifyUserComponent;
3805
- exports["ɵp"] = ConfirmResetPasswordComponent;
3806
- exports["ɵq"] = ConfirmVerifyUserComponent;
3807
- exports["ɵr"] = AmplifySelectComponent;
3808
- exports["ɵs"] = AmplifyButtonComponent;
3809
- exports["ɵt"] = AmplifyPasswordFieldComponent;
3810
- exports["ɵu"] = AmplifyTextFieldComponent;
3811
- exports["ɵv"] = TabsComponent;
3812
- exports["ɵw"] = TabItemComponent;
3813
- exports["ɵx"] = PhoneNumberFieldComponent;
1861
+ exports["ɵa"] = AmplifySlotComponent;
1862
+ exports["ɵb"] = AuthenticatorComponent;
1863
+ exports["ɵc"] = ButtonComponent;
1864
+ exports["ɵd"] = CheckboxComponent;
1865
+ exports["ɵe"] = ConfirmResetPasswordComponent;
1866
+ exports["ɵf"] = ConfirmSignInComponent;
1867
+ exports["ɵg"] = ConfirmSignUpComponent;
1868
+ exports["ɵh"] = ConfirmVerifyUserComponent;
1869
+ exports["ɵi"] = ErrorComponent;
1870
+ exports["ɵj"] = FederatedSignInButtonComponent;
1871
+ exports["ɵk"] = FederatedSignInComponent;
1872
+ exports["ɵl"] = ForceNewPasswordComponent;
1873
+ exports["ɵm"] = FormFieldComponent;
1874
+ exports["ɵn"] = PasswordFieldComponent;
1875
+ exports["ɵo"] = PhoneNumberFieldComponent;
1876
+ exports["ɵp"] = ResetPasswordComponent;
1877
+ exports["ɵq"] = SelectComponent;
1878
+ exports["ɵr"] = SetupTotpComponent;
1879
+ exports["ɵs"] = SignInComponent;
1880
+ exports["ɵt"] = SignUpComponent;
1881
+ exports["ɵu"] = SignUpFormFieldsComponent;
1882
+ exports["ɵv"] = TabItemComponent;
1883
+ exports["ɵw"] = TabsComponent;
1884
+ exports["ɵx"] = TextFieldComponent;
1885
+ exports["ɵy"] = UserNameAliasComponent;
1886
+ exports["ɵz"] = VerifyUserComponent;
3814
1887
 
3815
1888
  Object.defineProperty(exports, '__esModule', { value: true });
3816
1889