ngx-firebase 1.1.12 → 22.0.0

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 (274) hide show
  1. package/README.md +51 -11
  2. package/fesm2022/ngx-firebase.mjs +158 -0
  3. package/fesm2022/ngx-firebase.mjs.map +1 -0
  4. package/package.json +40 -30
  5. package/types/ngx-firebase.d.ts +55 -0
  6. package/bundles/ngx-firebase-capacitor.umd.js +0 -763
  7. package/bundles/ngx-firebase-capacitor.umd.js.map +0 -1
  8. package/bundles/ngx-firebase-capacitor.umd.min.js +0 -16
  9. package/bundles/ngx-firebase-capacitor.umd.min.js.map +0 -1
  10. package/bundles/ngx-firebase-iap.umd.js +0 -718
  11. package/bundles/ngx-firebase-iap.umd.js.map +0 -1
  12. package/bundles/ngx-firebase-iap.umd.min.js +0 -2
  13. package/bundles/ngx-firebase-iap.umd.min.js.map +0 -1
  14. package/bundles/ngx-firebase-ionic-auth-ui.umd.js +0 -2116
  15. package/bundles/ngx-firebase-ionic-auth-ui.umd.js.map +0 -1
  16. package/bundles/ngx-firebase-ionic-auth-ui.umd.min.js +0 -16
  17. package/bundles/ngx-firebase-ionic-auth-ui.umd.min.js.map +0 -1
  18. package/bundles/ngx-firebase-ionic.umd.js +0 -979
  19. package/bundles/ngx-firebase-ionic.umd.js.map +0 -1
  20. package/bundles/ngx-firebase-ionic.umd.min.js +0 -16
  21. package/bundles/ngx-firebase-ionic.umd.min.js.map +0 -1
  22. package/bundles/ngx-firebase-testing.umd.js +0 -801
  23. package/bundles/ngx-firebase-testing.umd.js.map +0 -1
  24. package/bundles/ngx-firebase-testing.umd.min.js +0 -2
  25. package/bundles/ngx-firebase-testing.umd.min.js.map +0 -1
  26. package/bundles/ngx-firebase.umd.js +0 -2271
  27. package/bundles/ngx-firebase.umd.js.map +0 -1
  28. package/bundles/ngx-firebase.umd.min.js +0 -2
  29. package/bundles/ngx-firebase.umd.min.js.map +0 -1
  30. package/capacitor/capacitor.module.d.ts +0 -9
  31. package/capacitor/interfaces/config.d.ts +0 -12
  32. package/capacitor/interfaces/index.d.ts +0 -1
  33. package/capacitor/ngx-firebase-capacitor.d.ts +0 -5
  34. package/capacitor/ngx-firebase-capacitor.metadata.json +0 -1
  35. package/capacitor/package.json +0 -25
  36. package/capacitor/public-api.d.ts +0 -3
  37. package/capacitor/services/analytics-firebase-capacitor.service.d.ts +0 -9
  38. package/capacitor/services/crashlytics-firebase-capacitor.service.d.ts +0 -8
  39. package/capacitor/services/credential-factory-capacitor.service.d.ts +0 -18
  40. package/capacitor/services/index.d.ts +0 -3
  41. package/esm2015/capacitor/capacitor.module.js +0 -78
  42. package/esm2015/capacitor/interfaces/config.js +0 -3
  43. package/esm2015/capacitor/interfaces/index.js +0 -2
  44. package/esm2015/capacitor/ngx-firebase-capacitor.js +0 -6
  45. package/esm2015/capacitor/public-api.js +0 -4
  46. package/esm2015/capacitor/services/analytics-firebase-capacitor.service.js +0 -43
  47. package/esm2015/capacitor/services/crashlytics-firebase-capacitor.service.js +0 -40
  48. package/esm2015/capacitor/services/credential-factory-capacitor.service.js +0 -182
  49. package/esm2015/capacitor/services/index.js +0 -4
  50. package/esm2015/iap/iap.module.js +0 -32
  51. package/esm2015/iap/interfaces/index.js +0 -5
  52. package/esm2015/iap/ngx-firebase-iap.js +0 -5
  53. package/esm2015/iap/public-api.js +0 -5
  54. package/esm2015/iap/services/iap.service.js +0 -317
  55. package/esm2015/iap/tokens/index.js +0 -4
  56. package/esm2015/ionic/animations/index.js +0 -30
  57. package/esm2015/ionic/components/avatar/avatar.component.js +0 -98
  58. package/esm2015/ionic/components/avatar/index.js +0 -2
  59. package/esm2015/ionic/components/index.js +0 -3
  60. package/esm2015/ionic/components/popover-menu/index.js +0 -3
  61. package/esm2015/ionic/components/popover-menu/interface.js +0 -2
  62. package/esm2015/ionic/components/popover-menu/popover-menu.component.js +0 -34
  63. package/esm2015/ionic/ionic.module.js +0 -46
  64. package/esm2015/ionic/ngx-firebase-ionic.js +0 -5
  65. package/esm2015/ionic/public-api.js +0 -5
  66. package/esm2015/ionic/services/alerts-ionic.service.js +0 -107
  67. package/esm2015/ionic/services/index.js +0 -6
  68. package/esm2015/ionic/services/legality-dialog-ionic.service.js +0 -85
  69. package/esm2015/ionic/services/loading-ionic.service.js +0 -46
  70. package/esm2015/ionic/services/picker-ionic.service.js +0 -44
  71. package/esm2015/ionic/services/toast-ionic.service.js +0 -49
  72. package/esm2015/ionic-auth-ui/animations/index.js +0 -30
  73. package/esm2015/ionic-auth-ui/components/email-confirmation/email-confirmation.component.js +0 -99
  74. package/esm2015/ionic-auth-ui/components/email-field/email-field.component.js +0 -25
  75. package/esm2015/ionic-auth-ui/components/form-field/form-field.component.js +0 -82
  76. package/esm2015/ionic-auth-ui/components/index.js +0 -12
  77. package/esm2015/ionic-auth-ui/components/name-field/name-field.component.js +0 -30
  78. package/esm2015/ionic-auth-ui/components/or-divider/or-divider.component.js +0 -11
  79. package/esm2015/ionic-auth-ui/components/password-field/password-field.component.js +0 -138
  80. package/esm2015/ionic-auth-ui/components/password-field/passwordValidatorFunctions.js +0 -62
  81. package/esm2015/ionic-auth-ui/components/providers/providers.component.js +0 -70
  82. package/esm2015/ionic-auth-ui/components/reauthenticate/reauthenticate.component.js +0 -99
  83. package/esm2015/ionic-auth-ui/components/register/register.component.js +0 -142
  84. package/esm2015/ionic-auth-ui/components/register-with-email/register-with-email.component.js +0 -60
  85. package/esm2015/ionic-auth-ui/components/register-with-email-popover/register-with-email-popover.component.js +0 -26
  86. package/esm2015/ionic-auth-ui/components/signin/signin.component.js +0 -92
  87. package/esm2015/ionic-auth-ui/components/terms-field/terms-field.component.js +0 -99
  88. package/esm2015/ionic-auth-ui/components/user/user.component.js +0 -195
  89. package/esm2015/ionic-auth-ui/ionic-auth-ui.module.js +0 -92
  90. package/esm2015/ionic-auth-ui/ngx-firebase-ionic-auth-ui.js +0 -23
  91. package/esm2015/ionic-auth-ui/pages/index.js +0 -5
  92. package/esm2015/ionic-auth-ui/pages/register/index.js +0 -2
  93. package/esm2015/ionic-auth-ui/pages/register/register.page.js +0 -56
  94. package/esm2015/ionic-auth-ui/pages/signin/index.js +0 -2
  95. package/esm2015/ionic-auth-ui/pages/signin/signin.page.js +0 -78
  96. package/esm2015/ionic-auth-ui/pages/user/index.js +0 -2
  97. package/esm2015/ionic-auth-ui/pages/user/user.page.js +0 -11
  98. package/esm2015/ionic-auth-ui/pages/verifyemail/index.js +0 -2
  99. package/esm2015/ionic-auth-ui/pages/verifyemail/verifyemail.page.js +0 -85
  100. package/esm2015/ionic-auth-ui/public-api.js +0 -5
  101. package/esm2015/ngx-firebase.js +0 -6
  102. package/esm2015/public-api.js +0 -6
  103. package/esm2015/shared/guards/index.js +0 -3
  104. package/esm2015/shared/guards/logged-in.guard.js +0 -60
  105. package/esm2015/shared/guards/verify-email.guard.js +0 -41
  106. package/esm2015/shared/interfaces/accounts.enum.js +0 -9
  107. package/esm2015/shared/interfaces/authprovider.enum.js +0 -15
  108. package/esm2015/shared/interfaces/config.interface.js +0 -61
  109. package/esm2015/shared/interfaces/index.js +0 -8
  110. package/esm2015/shared/interfaces/main.interface.js +0 -7
  111. package/esm2015/shared/interfaces/providers.interface.js +0 -2
  112. package/esm2015/shared/interfaces/tokens.js +0 -19
  113. package/esm2015/shared/interfaces/ui-providers.interface.js +0 -2
  114. package/esm2015/shared/services/analytics.service.js +0 -24
  115. package/esm2015/shared/services/auth-process.service.js +0 -752
  116. package/esm2015/shared/services/crashlytics.service.js +0 -42
  117. package/esm2015/shared/services/device-info.service.js +0 -14
  118. package/esm2015/shared/services/firebase.service.js +0 -37
  119. package/esm2015/shared/services/firestore-sync.service.js +0 -60
  120. package/esm2015/shared/services/index.js +0 -10
  121. package/esm2015/shared/services/performance.service.js +0 -28
  122. package/esm2015/shared/services/remoteconfig.service.js +0 -49
  123. package/esm2015/shared/services/ui.service.js +0 -45
  124. package/esm2015/shared/shared.module.js +0 -175
  125. package/esm2015/shared/types/DisplayWidth.js +0 -9
  126. package/esm2015/shared/types/Location.js +0 -2
  127. package/esm2015/shared/types/ValueAccessorControlComponent.js +0 -85
  128. package/esm2015/shared/types/ValueAccessorValueComponent.js +0 -40
  129. package/esm2015/shared/types/index.js +0 -5
  130. package/esm2015/testing/fakeavatar.module.js +0 -22
  131. package/esm2015/testing/fakes/FakeAuthProcessService.js +0 -31
  132. package/esm2015/testing/fakes/FakeAvatarComponent.js +0 -13
  133. package/esm2015/testing/fakes/FakeFireService.js +0 -21
  134. package/esm2015/testing/fakes/FakeFirestoreSyncService.js +0 -11
  135. package/esm2015/testing/fakes/FakeIAPurchaseService.js +0 -11
  136. package/esm2015/testing/fakes/FakePickerService.js +0 -9
  137. package/esm2015/testing/fakes/FakeRemoteConfigService.js +0 -44
  138. package/esm2015/testing/fakes/FakeTranslateService.js +0 -21
  139. package/esm2015/testing/fakes/FakeUiService.js +0 -26
  140. package/esm2015/testing/fakes/angular-fire/FakeAngularFireAuth.js +0 -30
  141. package/esm2015/testing/fakes/angular-fire/FakeAngularFireFunctions.js +0 -17
  142. package/esm2015/testing/fakes/angular-fire/FakeAngularFirePerformance.js +0 -17
  143. package/esm2015/testing/fakes/angular-fire/FakeAngularFireStorage.js +0 -8
  144. package/esm2015/testing/fakes/angular-fire/FakeAngularFirestore.js +0 -8
  145. package/esm2015/testing/fakes/angular-fire/FakeUserCredential.js +0 -18
  146. package/esm2015/testing/fakes/index.js +0 -19
  147. package/esm2015/testing/ngx-firebase-testing.js +0 -6
  148. package/esm2015/testing/public-api.js +0 -5
  149. package/esm2015/testing/test.module.js +0 -66
  150. package/esm2015/testing/utils/index.js +0 -17
  151. package/esm2015/testing/utils/patchConsole.js +0 -14
  152. package/fesm2015/ngx-firebase-capacitor.js +0 -328
  153. package/fesm2015/ngx-firebase-capacitor.js.map +0 -1
  154. package/fesm2015/ngx-firebase-iap.js +0 -354
  155. package/fesm2015/ngx-firebase-iap.js.map +0 -1
  156. package/fesm2015/ngx-firebase-ionic-auth-ui.js +0 -1482
  157. package/fesm2015/ngx-firebase-ionic-auth-ui.js.map +0 -1
  158. package/fesm2015/ngx-firebase-ionic.js +0 -495
  159. package/fesm2015/ngx-firebase-ionic.js.map +0 -1
  160. package/fesm2015/ngx-firebase-testing.js +0 -388
  161. package/fesm2015/ngx-firebase-testing.js.map +0 -1
  162. package/fesm2015/ngx-firebase.js +0 -1482
  163. package/fesm2015/ngx-firebase.js.map +0 -1
  164. package/iap/iap.module.d.ts +0 -5
  165. package/iap/interfaces/index.d.ts +0 -11
  166. package/iap/ngx-firebase-iap.d.ts +0 -4
  167. package/iap/ngx-firebase-iap.metadata.json +0 -1
  168. package/iap/package.json +0 -23
  169. package/iap/public-api.d.ts +0 -4
  170. package/iap/services/iap.service.d.ts +0 -47
  171. package/iap/tokens/index.d.ts +0 -3
  172. package/ionic/animations/index.d.ts +0 -1
  173. package/ionic/components/avatar/avatar.component.d.ts +0 -27
  174. package/ionic/components/avatar/index.d.ts +0 -1
  175. package/ionic/components/index.d.ts +0 -2
  176. package/ionic/components/popover-menu/index.d.ts +0 -2
  177. package/ionic/components/popover-menu/interface.d.ts +0 -6
  178. package/ionic/components/popover-menu/popover-menu.component.d.ts +0 -10
  179. package/ionic/ionic.module.d.ts +0 -2
  180. package/ionic/ngx-firebase-ionic.d.ts +0 -4
  181. package/ionic/ngx-firebase-ionic.metadata.json +0 -1
  182. package/ionic/package.json +0 -30
  183. package/ionic/public-api.d.ts +0 -4
  184. package/ionic/services/alerts-ionic.service.d.ts +0 -13
  185. package/ionic/services/index.d.ts +0 -5
  186. package/ionic/services/legality-dialog-ionic.service.d.ts +0 -10
  187. package/ionic/services/loading-ionic.service.d.ts +0 -17
  188. package/ionic/services/picker-ionic.service.d.ts +0 -9
  189. package/ionic/services/toast-ionic.service.d.ts +0 -11
  190. package/ionic-auth-ui/animations/index.d.ts +0 -1
  191. package/ionic-auth-ui/components/email-confirmation/email-confirmation.component.d.ts +0 -31
  192. package/ionic-auth-ui/components/email-field/email-field.component.d.ts +0 -7
  193. package/ionic-auth-ui/components/form-field/form-field.component.d.ts +0 -28
  194. package/ionic-auth-ui/components/index.d.ts +0 -11
  195. package/ionic-auth-ui/components/name-field/name-field.component.d.ts +0 -8
  196. package/ionic-auth-ui/components/or-divider/or-divider.component.d.ts +0 -2
  197. package/ionic-auth-ui/components/password-field/password-field.component.d.ts +0 -34
  198. package/ionic-auth-ui/components/password-field/passwordValidatorFunctions.d.ts +0 -4
  199. package/ionic-auth-ui/components/providers/providers.component.d.ts +0 -26
  200. package/ionic-auth-ui/components/reauthenticate/reauthenticate.component.d.ts +0 -30
  201. package/ionic-auth-ui/components/register/register.component.d.ts +0 -26
  202. package/ionic-auth-ui/components/register-with-email/register-with-email.component.d.ts +0 -24
  203. package/ionic-auth-ui/components/register-with-email-popover/register-with-email-popover.component.d.ts +0 -7
  204. package/ionic-auth-ui/components/signin/signin.component.d.ts +0 -28
  205. package/ionic-auth-ui/components/terms-field/terms-field.component.d.ts +0 -27
  206. package/ionic-auth-ui/components/user/user.component.d.ts +0 -45
  207. package/ionic-auth-ui/ionic-auth-ui.module.d.ts +0 -32
  208. package/ionic-auth-ui/ngx-firebase-ionic-auth-ui.d.ts +0 -22
  209. package/ionic-auth-ui/ngx-firebase-ionic-auth-ui.metadata.json +0 -1
  210. package/ionic-auth-ui/package.json +0 -30
  211. package/ionic-auth-ui/pages/index.d.ts +0 -4
  212. package/ionic-auth-ui/pages/register/index.d.ts +0 -1
  213. package/ionic-auth-ui/pages/register/register.page.d.ts +0 -16
  214. package/ionic-auth-ui/pages/signin/index.d.ts +0 -1
  215. package/ionic-auth-ui/pages/signin/signin.page.d.ts +0 -22
  216. package/ionic-auth-ui/pages/user/index.d.ts +0 -1
  217. package/ionic-auth-ui/pages/user/user.page.d.ts +0 -3
  218. package/ionic-auth-ui/pages/verifyemail/index.d.ts +0 -1
  219. package/ionic-auth-ui/pages/verifyemail/verifyemail.page.d.ts +0 -19
  220. package/ionic-auth-ui/public-api.d.ts +0 -4
  221. package/ngx-firebase.d.ts +0 -5
  222. package/ngx-firebase.metadata.json +0 -1
  223. package/public-api.d.ts +0 -5
  224. package/shared/guards/index.d.ts +0 -2
  225. package/shared/guards/logged-in.guard.d.ts +0 -13
  226. package/shared/guards/verify-email.guard.d.ts +0 -11
  227. package/shared/interfaces/accounts.enum.d.ts +0 -7
  228. package/shared/interfaces/authprovider.enum.d.ts +0 -13
  229. package/shared/interfaces/config.interface.d.ts +0 -63
  230. package/shared/interfaces/index.d.ts +0 -7
  231. package/shared/interfaces/main.interface.d.ts +0 -13
  232. package/shared/interfaces/providers.interface.d.ts +0 -63
  233. package/shared/interfaces/tokens.d.ts +0 -16
  234. package/shared/interfaces/ui-providers.interface.d.ts +0 -65
  235. package/shared/services/analytics.service.d.ts +0 -10
  236. package/shared/services/auth-process.service.d.ts +0 -172
  237. package/shared/services/crashlytics.service.d.ts +0 -11
  238. package/shared/services/device-info.service.d.ts +0 -3
  239. package/shared/services/firebase.service.d.ts +0 -16
  240. package/shared/services/firestore-sync.service.d.ts +0 -16
  241. package/shared/services/index.d.ts +0 -9
  242. package/shared/services/performance.service.d.ts +0 -12
  243. package/shared/services/remoteconfig.service.d.ts +0 -18
  244. package/shared/services/ui.service.d.ts +0 -22
  245. package/shared/shared.module.d.ts +0 -14
  246. package/shared/types/DisplayWidth.d.ts +0 -7
  247. package/shared/types/Location.d.ts +0 -8
  248. package/shared/types/ValueAccessorControlComponent.d.ts +0 -27
  249. package/shared/types/ValueAccessorValueComponent.d.ts +0 -19
  250. package/shared/types/index.d.ts +0 -4
  251. package/testing/fakeavatar.module.d.ts +0 -2
  252. package/testing/fakes/FakeAuthProcessService.d.ts +0 -28
  253. package/testing/fakes/FakeAvatarComponent.d.ts +0 -3
  254. package/testing/fakes/FakeFireService.d.ts +0 -20
  255. package/testing/fakes/FakeFirestoreSyncService.d.ts +0 -9
  256. package/testing/fakes/FakeIAPurchaseService.d.ts +0 -9
  257. package/testing/fakes/FakePickerService.d.ts +0 -6
  258. package/testing/fakes/FakeRemoteConfigService.d.ts +0 -19
  259. package/testing/fakes/FakeTranslateService.d.ts +0 -15
  260. package/testing/fakes/FakeUiService.d.ts +0 -25
  261. package/testing/fakes/angular-fire/FakeAngularFireAuth.d.ts +0 -52
  262. package/testing/fakes/angular-fire/FakeAngularFireFunctions.d.ts +0 -11
  263. package/testing/fakes/angular-fire/FakeAngularFirePerformance.d.ts +0 -10
  264. package/testing/fakes/angular-fire/FakeAngularFireStorage.d.ts +0 -5
  265. package/testing/fakes/angular-fire/FakeAngularFirestore.d.ts +0 -5
  266. package/testing/fakes/angular-fire/FakeUserCredential.d.ts +0 -9
  267. package/testing/fakes/index.d.ts +0 -16
  268. package/testing/ngx-firebase-testing.d.ts +0 -5
  269. package/testing/ngx-firebase-testing.metadata.json +0 -1
  270. package/testing/package.json +0 -29
  271. package/testing/public-api.d.ts +0 -4
  272. package/testing/test.module.d.ts +0 -4
  273. package/testing/utils/index.d.ts +0 -5
  274. package/testing/utils/patchConsole.d.ts +0 -4
@@ -1,2116 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@ionic/angular'), require('ngx-firebase'), require('@angular/forms'), require('ngx-firebase/ionic'), require('@angular/animations'), require('rxjs'), require('rxjs/operators'), require('@angular/router'), require('@angular/common/http'), require('@angular/common'), require('ionic4-tooltips'), require('@angular/flex-layout')) :
3
- typeof define === 'function' && define.amd ? define('ngx-firebase/ionic-auth-ui', ['exports', '@angular/core', '@ionic/angular', 'ngx-firebase', '@angular/forms', 'ngx-firebase/ionic', '@angular/animations', 'rxjs', 'rxjs/operators', '@angular/router', '@angular/common/http', '@angular/common', 'ionic4-tooltips', '@angular/flex-layout'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global['ngx-firebase'] = global['ngx-firebase'] || {}, global['ngx-firebase']['ionic-auth-ui'] = {}), global.ng.core, global.ionic.angular, global['ngx-firebase'], global.ng.forms, global['ngx-firebase'].ionic, global.ng.animations, global.rxjs, global.rxjs.operators, global.ng.router, global.ng.common.http, global.ng.common, global['ionic4-tooltips'], global.ng.flexLayout));
5
- }(this, (function (exports, core, angular, ngxFirebase, forms, ionic, animations, rxjs, operators, router, http, common, ionic4Tooltips, flexLayout) { 'use strict';
6
-
7
- /*! *****************************************************************************
8
- Copyright (c) Microsoft Corporation.
9
-
10
- Permission to use, copy, modify, and/or distribute this software for any
11
- purpose with or without fee is hereby granted.
12
-
13
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
14
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
15
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
16
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
17
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
18
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19
- PERFORMANCE OF THIS SOFTWARE.
20
- ***************************************************************************** */
21
- /* global Reflect, Promise */
22
- var extendStatics = function (d, b) {
23
- extendStatics = Object.setPrototypeOf ||
24
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
25
- function (d, b) { for (var p in b)
26
- if (Object.prototype.hasOwnProperty.call(b, p))
27
- d[p] = b[p]; };
28
- return extendStatics(d, b);
29
- };
30
- function __extends(d, b) {
31
- if (typeof b !== "function" && b !== null)
32
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
33
- extendStatics(d, b);
34
- function __() { this.constructor = d; }
35
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
36
- }
37
- var __assign = function () {
38
- __assign = Object.assign || function __assign(t) {
39
- for (var s, i = 1, n = arguments.length; i < n; i++) {
40
- s = arguments[i];
41
- for (var p in s)
42
- if (Object.prototype.hasOwnProperty.call(s, p))
43
- t[p] = s[p];
44
- }
45
- return t;
46
- };
47
- return __assign.apply(this, arguments);
48
- };
49
- function __rest(s, e) {
50
- var t = {};
51
- for (var p in s)
52
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
53
- t[p] = s[p];
54
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
55
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
56
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
57
- t[p[i]] = s[p[i]];
58
- }
59
- return t;
60
- }
61
- function __decorate(decorators, target, key, desc) {
62
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
63
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
64
- r = Reflect.decorate(decorators, target, key, desc);
65
- else
66
- for (var i = decorators.length - 1; i >= 0; i--)
67
- if (d = decorators[i])
68
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
69
- return c > 3 && r && Object.defineProperty(target, key, r), r;
70
- }
71
- function __param(paramIndex, decorator) {
72
- return function (target, key) { decorator(target, key, paramIndex); };
73
- }
74
- function __metadata(metadataKey, metadataValue) {
75
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
76
- return Reflect.metadata(metadataKey, metadataValue);
77
- }
78
- function __awaiter(thisArg, _arguments, P, generator) {
79
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
80
- return new (P || (P = Promise))(function (resolve, reject) {
81
- function fulfilled(value) { try {
82
- step(generator.next(value));
83
- }
84
- catch (e) {
85
- reject(e);
86
- } }
87
- function rejected(value) { try {
88
- step(generator["throw"](value));
89
- }
90
- catch (e) {
91
- reject(e);
92
- } }
93
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
94
- step((generator = generator.apply(thisArg, _arguments || [])).next());
95
- });
96
- }
97
- function __generator(thisArg, body) {
98
- var _ = { label: 0, sent: function () { if (t[0] & 1)
99
- throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
100
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
101
- function verb(n) { return function (v) { return step([n, v]); }; }
102
- function step(op) {
103
- if (f)
104
- throw new TypeError("Generator is already executing.");
105
- while (_)
106
- try {
107
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
108
- return t;
109
- if (y = 0, t)
110
- op = [op[0] & 2, t.value];
111
- switch (op[0]) {
112
- case 0:
113
- case 1:
114
- t = op;
115
- break;
116
- case 4:
117
- _.label++;
118
- return { value: op[1], done: false };
119
- case 5:
120
- _.label++;
121
- y = op[1];
122
- op = [0];
123
- continue;
124
- case 7:
125
- op = _.ops.pop();
126
- _.trys.pop();
127
- continue;
128
- default:
129
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
130
- _ = 0;
131
- continue;
132
- }
133
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
134
- _.label = op[1];
135
- break;
136
- }
137
- if (op[0] === 6 && _.label < t[1]) {
138
- _.label = t[1];
139
- t = op;
140
- break;
141
- }
142
- if (t && _.label < t[2]) {
143
- _.label = t[2];
144
- _.ops.push(op);
145
- break;
146
- }
147
- if (t[2])
148
- _.ops.pop();
149
- _.trys.pop();
150
- continue;
151
- }
152
- op = body.call(thisArg, _);
153
- }
154
- catch (e) {
155
- op = [6, e];
156
- y = 0;
157
- }
158
- finally {
159
- f = t = 0;
160
- }
161
- if (op[0] & 5)
162
- throw op[1];
163
- return { value: op[0] ? op[1] : void 0, done: true };
164
- }
165
- }
166
- var __createBinding = Object.create ? (function (o, m, k, k2) {
167
- if (k2 === undefined)
168
- k2 = k;
169
- Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
170
- }) : (function (o, m, k, k2) {
171
- if (k2 === undefined)
172
- k2 = k;
173
- o[k2] = m[k];
174
- });
175
- function __exportStar(m, o) {
176
- for (var p in m)
177
- if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
178
- __createBinding(o, m, p);
179
- }
180
- function __values(o) {
181
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
182
- if (m)
183
- return m.call(o);
184
- if (o && typeof o.length === "number")
185
- return {
186
- next: function () {
187
- if (o && i >= o.length)
188
- o = void 0;
189
- return { value: o && o[i++], done: !o };
190
- }
191
- };
192
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
193
- }
194
- function __read(o, n) {
195
- var m = typeof Symbol === "function" && o[Symbol.iterator];
196
- if (!m)
197
- return o;
198
- var i = m.call(o), r, ar = [], e;
199
- try {
200
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
201
- ar.push(r.value);
202
- }
203
- catch (error) {
204
- e = { error: error };
205
- }
206
- finally {
207
- try {
208
- if (r && !r.done && (m = i["return"]))
209
- m.call(i);
210
- }
211
- finally {
212
- if (e)
213
- throw e.error;
214
- }
215
- }
216
- return ar;
217
- }
218
- /** @deprecated */
219
- function __spread() {
220
- for (var ar = [], i = 0; i < arguments.length; i++)
221
- ar = ar.concat(__read(arguments[i]));
222
- return ar;
223
- }
224
- /** @deprecated */
225
- function __spreadArrays() {
226
- for (var s = 0, i = 0, il = arguments.length; i < il; i++)
227
- s += arguments[i].length;
228
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
229
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
230
- r[k] = a[j];
231
- return r;
232
- }
233
- function __spreadArray(to, from) {
234
- for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
235
- to[j] = from[i];
236
- return to;
237
- }
238
- function __await(v) {
239
- return this instanceof __await ? (this.v = v, this) : new __await(v);
240
- }
241
- function __asyncGenerator(thisArg, _arguments, generator) {
242
- if (!Symbol.asyncIterator)
243
- throw new TypeError("Symbol.asyncIterator is not defined.");
244
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
245
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
246
- function verb(n) { if (g[n])
247
- i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
248
- function resume(n, v) { try {
249
- step(g[n](v));
250
- }
251
- catch (e) {
252
- settle(q[0][3], e);
253
- } }
254
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
255
- function fulfill(value) { resume("next", value); }
256
- function reject(value) { resume("throw", value); }
257
- function settle(f, v) { if (f(v), q.shift(), q.length)
258
- resume(q[0][0], q[0][1]); }
259
- }
260
- function __asyncDelegator(o) {
261
- var i, p;
262
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
263
- function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
264
- }
265
- function __asyncValues(o) {
266
- if (!Symbol.asyncIterator)
267
- throw new TypeError("Symbol.asyncIterator is not defined.");
268
- var m = o[Symbol.asyncIterator], i;
269
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
270
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
271
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
272
- }
273
- function __makeTemplateObject(cooked, raw) {
274
- if (Object.defineProperty) {
275
- Object.defineProperty(cooked, "raw", { value: raw });
276
- }
277
- else {
278
- cooked.raw = raw;
279
- }
280
- return cooked;
281
- }
282
- ;
283
- var __setModuleDefault = Object.create ? (function (o, v) {
284
- Object.defineProperty(o, "default", { enumerable: true, value: v });
285
- }) : function (o, v) {
286
- o["default"] = v;
287
- };
288
- function __importStar(mod) {
289
- if (mod && mod.__esModule)
290
- return mod;
291
- var result = {};
292
- if (mod != null)
293
- for (var k in mod)
294
- if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
295
- __createBinding(result, mod, k);
296
- __setModuleDefault(result, mod);
297
- return result;
298
- }
299
- function __importDefault(mod) {
300
- return (mod && mod.__esModule) ? mod : { default: mod };
301
- }
302
- function __classPrivateFieldGet(receiver, privateMap) {
303
- if (!privateMap.has(receiver)) {
304
- throw new TypeError("attempted to get private field on non-instance");
305
- }
306
- return privateMap.get(receiver);
307
- }
308
- function __classPrivateFieldSet(receiver, privateMap, value) {
309
- if (!privateMap.has(receiver)) {
310
- throw new TypeError("attempted to set private field on non-instance");
311
- }
312
- privateMap.set(receiver, value);
313
- return value;
314
- }
315
-
316
- var EmailConfirmationComponent = /** @class */ (function () {
317
- function EmailConfirmationComponent(aps, changeDetectorRef, navController, fire, ui, config) {
318
- this.aps = aps;
319
- this.changeDetectorRef = changeDetectorRef;
320
- this.navController = navController;
321
- this.fire = fire;
322
- this.ui = ui;
323
- this.config = config;
324
- this.signOut = new core.EventEmitter();
325
- // Context hash to use for verifyEmailTemplate.
326
- this.verifyEmailContext = this.createTemplateContext();
327
- this.isLoading = false;
328
- }
329
- EmailConfirmationComponent.prototype.ngOnChanges = function (changes) {
330
- if (changes.verifyEmailTemplate && changes.verifyEmailTemplate.currentValue == null) {
331
- this.verifyEmailTemplate = this.defaultTemplate;
332
- // console.log('ngOnChanges - defaultTemplate:', this.verifyEmailTemplate);
333
- }
334
- this.verifyEmailContext = this.createTemplateContext();
335
- };
336
- EmailConfirmationComponent.prototype.ngOnInit = function () {
337
- if (!this.verifyEmailTemplate) {
338
- // console.log('ngOnInit - defaultTemplate');
339
- this.verifyEmailTemplate = this.defaultTemplate;
340
- }
341
- this.verifyEmailContext = this.createTemplateContext();
342
- // console.log('verifyEmailTemplate:', this.verifyEmailTemplate);
343
- // console.log('verifyEmailContext:', this.verifyEmailContext);
344
- };
345
- EmailConfirmationComponent.prototype.continue = function () {
346
- return __awaiter(this, void 0, void 0, function () {
347
- var error_1;
348
- return __generator(this, function (_a) {
349
- switch (_a.label) {
350
- case 0:
351
- _a.trys.push([0, 3, , 4]);
352
- return [4 /*yield*/, this.aps.reloadUserInfo()];
353
- case 1:
354
- _a.sent();
355
- return [4 /*yield*/, this.navController.navigateBack([this.goBackURL])];
356
- case 2:
357
- _a.sent();
358
- return [3 /*break*/, 4];
359
- case 3:
360
- error_1 = _a.sent();
361
- this.notifyError(error_1);
362
- return [3 /*break*/, 4];
363
- case 4: return [2 /*return*/];
364
- }
365
- });
366
- });
367
- };
368
- EmailConfirmationComponent.prototype.sendNewVerificationEmail = function () {
369
- return __awaiter(this, void 0, void 0, function () {
370
- var error_2;
371
- return __generator(this, function (_a) {
372
- switch (_a.label) {
373
- case 0:
374
- _a.trys.push([0, 2, 3, 4]);
375
- this.isLoading = true;
376
- this.changeDetectorRef.markForCheck();
377
- return [4 /*yield*/, this.aps.sendNewVerificationEmail()];
378
- case 1:
379
- _a.sent();
380
- this.ui.toast('auth.emailConfirmation.onConfirmationSuccess');
381
- return [3 /*break*/, 4];
382
- case 2:
383
- error_2 = _a.sent();
384
- this.notifyError(error_2);
385
- return [3 /*break*/, 4];
386
- case 3:
387
- this.isLoading = false;
388
- this.changeDetectorRef.markForCheck();
389
- return [7 /*endfinally*/];
390
- case 4: return [2 /*return*/];
391
- }
392
- });
393
- });
394
- };
395
- EmailConfirmationComponent.prototype.createTemplateContext = function () {
396
- return {
397
- email: this.email,
398
- goBackURL: this.goBackURL,
399
- };
400
- };
401
- EmailConfirmationComponent.prototype.notifyError = function (error) {
402
- this.fire.recordException(error);
403
- if (this.config.authUi.toastMessageOnAuthError) {
404
- var message = error.toString() || 'Sorry, something went wrong. Please retry later.';
405
- this.ui.toast(message, { duration: this.config.authUi.toastDefaultDurationMil });
406
- }
407
- };
408
- return EmailConfirmationComponent;
409
- }());
410
- EmailConfirmationComponent.decorators = [
411
- { type: core.Component, args: [{
412
- selector: 'mal-authui-email-confirmation',
413
- template: "<ng-container *ngTemplateOutlet=\"verifyEmailTemplate; context: verifyEmailContext\"></ng-container>\n<ng-template #defaultVerifyEmail let-email=\"email\" let-goBackURL=\"goBackURL\">\n <ion-card class=\"verify-email\">\n <ion-card-content fxLayout=\"column\" fxLayoutAlign=\"center center\">\n <ion-icon color=\"text\" name=\"mail-outline\"></ion-icon>\n <p class=\"title\" fxLayout=\"column\" fxLayoutAlign=\"center center\">\n <span class=\"mat-subheading-2\">{{ \"auth.emailConfirmation.title\" | translate }}</span>\n <span class=\"mat-body-2\">{{ \"auth.email.label\" | translate }}</span>\n </p>\n <p class=\"subtitle\">{{ \"auth.emailConfirmation.bodyText\" | translate }}</p>\n <ion-progress-bar *ngIf=\"isLoading\" type=\"indeterminate\"></ion-progress-bar>\n </ion-card-content>\n <ion-button color=\"primary\" (click)=\"continue()\" *ngIf=\"goBackURL\" class=\"go-back-button action-button\">\n {{ \"auth.emailConfirmation.goBack\" | translate }}\n </ion-button>\n <ion-button (color=\"primary\" click)=\"sendNewVerificationEmail()\" class=\"send-new-mail-button action-button\">\n {{ \"auth.emailConfirmation.sendNewVerificationEmail\" | translate }}\n </ion-button>\n <ion-button color=\"primary\" (click)=\"this.signOut.emit()\" class=\"sign-out-button action-button\" color=\"warn\">\n {{ \"auth.emailConfirmation.signOut\" | translate }}\n </ion-button>\n </ion-card>\n</ng-template>",
414
- changeDetection: core.ChangeDetectionStrategy.OnPush,
415
- styles: [".verify-email{width:360px}.verify-email .mat-icon{height:4rem;width:4rem;color:#444}.verify-email .title{margin-top:16px}.verify-email .title .mat-subheading-2{margin-bottom:0}.verify-email .subtitle{margin:16px auto;text-align:justify}.verify-email p{display:block;-webkit-margin-before:1em;-webkit-margin-after:1em;-webkit-margin-start:0;-webkit-margin-end:0}"]
416
- },] }
417
- ];
418
- EmailConfirmationComponent.ctorParameters = function () { return [
419
- { type: ngxFirebase.AuthProcessService },
420
- { type: core.ChangeDetectorRef },
421
- { type: angular.NavController },
422
- { type: ngxFirebase.FirebaseService },
423
- { type: ngxFirebase.UiService },
424
- { type: undefined, decorators: [{ type: core.Inject, args: [core.forwardRef(function () { return ngxFirebase.MalSharedConfigToken; }),] }] }
425
- ]; };
426
- EmailConfirmationComponent.propDecorators = {
427
- email: [{ type: core.Input }],
428
- goBackURL: [{ type: core.Input }],
429
- template: [{ type: core.Input }],
430
- signOut: [{ type: core.Output }],
431
- defaultTemplate: [{ type: core.ViewChild, args: ['defaultVerifyEmail', { static: true },] }]
432
- };
433
-
434
- var customAnimation = animations.animation([
435
- animations.style({
436
- opacity: '{{opacity}}',
437
- transform: 'scale({{scale}}) translate3d({{x}}, {{y}}, {{z}})'
438
- }),
439
- animations.animate('{{duration}} {{delay}} cubic-bezier(0.0, 0.0, 0.2, 1)', animations.style('*'))
440
- ], {
441
- params: {
442
- duration: '200ms',
443
- delay: '0ms',
444
- opacity: '0',
445
- scale: '1',
446
- x: '0',
447
- y: '0',
448
- z: '0'
449
- }
450
- });
451
- var NgxAuthFirebaseuiAnimations = [
452
- animations.trigger('animate', [animations.transition('void => *', [animations.useAnimation(customAnimation)])]),
453
- animations.trigger('animateStagger', [
454
- animations.state('50', animations.style('*')),
455
- animations.state('100', animations.style('*')),
456
- animations.state('200', animations.style('*')),
457
- animations.transition('void => 50', animations.query('@*', [animations.stagger('50ms', [animations.animateChild()])], { optional: true })),
458
- animations.transition('void => 100', animations.query('@*', [animations.stagger('100ms', [animations.animateChild()])], { optional: true })),
459
- animations.transition('void => 200', animations.query('@*', [animations.stagger('200ms', [animations.animateChild()])], { optional: true }))
460
- ]),
461
- ];
462
-
463
- var AuthUISignInComponent = /** @class */ (function () {
464
- function AuthUISignInComponent(
465
- // tslint:disable-next-line @typescript-eslint/ban-types
466
- aps, alert, changeDetectorRef, config) {
467
- this.aps = aps;
468
- this.alert = alert;
469
- this.changeDetectorRef = changeDetectorRef;
470
- this.config = config;
471
- this.providers = ngxFirebase.AuthProvider.ALL; // google, facebook, twitter, github as array or all as one single string
472
- this.registrationEnabled = true;
473
- this.resetPasswordEnabled = true;
474
- this.tosUrl = '';
475
- this.privacyPolicyUrl = '';
476
- // Events
477
- // tslint:disable no-output-on-prefix
478
- this.onSuccess = this.aps.onSignInEmitter;
479
- this.onError = this.aps.onErrorEmitter;
480
- this.onCreateAccountRequested = new core.EventEmitter();
481
- this.onResetPasswordRequested = new core.EventEmitter();
482
- // tslint:enable no-output-on-prefix
483
- this.signInForm = new forms.FormGroup({
484
- email: new forms.FormControl('', [forms.Validators.required]),
485
- password: new forms.FormControl('', [forms.Validators.required])
486
- });
487
- this.authProviders = ngxFirebase.AuthProvider;
488
- }
489
- AuthUISignInComponent.prototype.signIn = function () {
490
- return __awaiter(this, void 0, void 0, function () {
491
- return __generator(this, function (_a) {
492
- switch (_a.label) {
493
- case 0:
494
- _a.trys.push([0, , 2, 3]);
495
- this.changeDetectorRef.markForCheck();
496
- return [4 /*yield*/, this.aps.signInWith(ngxFirebase.AuthProvider.EmailAndPassword, {
497
- credentials: {
498
- email: this.signInForm.value.email,
499
- password: this.signInForm.value.password
500
- }
501
- })];
502
- case 1:
503
- _a.sent();
504
- return [3 /*break*/, 3];
505
- case 2:
506
- this.changeDetectorRef.markForCheck();
507
- return [7 /*endfinally*/];
508
- case 3: return [2 /*return*/];
509
- }
510
- });
511
- });
512
- };
513
- AuthUISignInComponent.prototype.providerClick = function (provider) {
514
- this.aps.signInWith(provider);
515
- };
516
- AuthUISignInComponent.prototype.ngAfterViewInit = function () {
517
- this.changeDetectorRef.detectChanges();
518
- };
519
- AuthUISignInComponent.prototype.doPasswordReset = function () {
520
- return __awaiter(this, void 0, void 0, function () {
521
- return __generator(this, function (_a) {
522
- switch (_a.label) {
523
- case 0:
524
- if (!this.signInForm.controls.email.invalid) return [3 /*break*/, 2];
525
- return [4 /*yield*/, this.alert.errorAlert('auth.resetPassword.errors.pattern')];
526
- case 1:
527
- _a.sent();
528
- return [3 /*break*/, 4];
529
- case 2: return [4 /*yield*/, this.aps.resetPassword(this.signInForm.value.email)];
530
- case 3:
531
- _a.sent();
532
- _a.label = 4;
533
- case 4: return [2 /*return*/];
534
- }
535
- });
536
- });
537
- };
538
- return AuthUISignInComponent;
539
- }());
540
- AuthUISignInComponent.decorators = [
541
- { type: core.Component, args: [{
542
- selector: 'mal-authui-signin',
543
- template: "<div fxLayout=\"column\" fxLayoutAlign=\"center center\" id=\"signin-wrapper\" class=\"authui-wrapper\">\n <div [@animateStagger]=\"{ value: '50' }\" id=\"signin-inner\" class=\"authui-inner-wrapper\">\n\n <form [@animate]=\"{value:'*',params:{duration:'300ms',y:'100px'}}\" [formGroup]=\"signInForm\" name=\"signInForm\"\n novalidate>\n\n <mal-authui-email-field formControlName=\"email\"\n [@animate]=\"{ value: '*', params: { x: '50px' } }\">\n </mal-authui-email-field>\n\n <mal-authui-password-field formControlName=\"password\"\n [@animate]=\"{ value: '*', params: { x: '50px' } }\">\n </mal-authui-password-field>\n\n <div [@animate]=\"{ value: '*', params: { x: '50px' } }\"\n class=\"forgot-password\"\n fxLayout=\"row\"\n fxLayout.xs=\"column\"\n fxLayoutAlign=\"space-between center\">\n\n <a (click)=\"doPasswordReset()\"\n *ngIf=\"resetPasswordEnabled\"\n [@animate]=\"{ value: '*', params: { x: '-50px' } }\"\n class=\"forgot-password\"\n type=\"button\">\n {{ \"auth.signIn.forgotPassword\" | translate }}\n </a>\n </div>\n\n <ion-button (click)=\"signIn()\"\n color=\"primary\"\n [disabled]=\"signInForm.invalid\"\n aria-label=\"LOG IN\"\n fxLayoutAlign=\"center center\"\n class=\"authui-submit-button\"\n id=\"auth_signin_btn\">\n {{\"auth.signIn.signInButton\" | translate }}\n </ion-button>\n\n </form>\n\n <!--mal-authui-or-divider *ngIf=\"providers.length > 0\"\n [@animate]=\"{ value: '*', params: { z: '50px', delay: '50ms', scale: '0.2' } }\">\n </mal-authui-or-divider> -->\n\n <mal-authui-providers [providers]=\"providers\"\n (providerClick)=\"providerClick($event)\"\n layout=\"column\"></mal-authui-providers>\n\n <div *ngIf=\" registrationEnabled\" [@animateStagger]=\"{ value: '100' }\"\n class=\"authui-alternate-action\"\n fxLayout=\"column\"\n fxLayoutAlign=\"center center\">\n <ion-text [@animate]=\"{ value: '*', params: { x: '100px' } }\"\n color=\"text\"\n class=\"text\">\n {{\"auth.signIn.dontHaveAccount\" | translate}}\n </ion-text>\n <a (click)=\"onCreateAccountRequested.emit()\"\n [@animate]=\"{ value: '*', params: { x: '-100px' } }\"\n id=\"createAccountButton\">\n {{\"auth.signIn.createAccountButton\" | translate}}\n </a>\n </div>\n\n </div>\n</div>",
544
- encapsulation: core.ViewEncapsulation.None,
545
- animations: NgxAuthFirebaseuiAnimations,
546
- styles: ["div.authui-logo{margin:32px auto;width:30%}div.authui-logo img{display:block;max-width:120px;border-radius:20px;margin-left:auto;margin-right:auto}div.authui-title{font-size:20px;margin:16px 0}div.authui-alternate-action{margin:32px auto 24px;font-weight:500}div.authui-alternate-action .text{margin-right:8px}ion-content.auth-page{--background:var(--auth-pages-background,--background)}div.resend-confirmation{margin:24px 0;font-size:.9em;text-align:center}ion-button.authui-provider-button{width:220px;margin:8px auto;display:block;text-align:center;--background:var(--auth-provider-background-color,#fff)}@media screen and (max-width:599px){ion-button.authui-provider-button{width:100%}}ion-button.authui-submit-button{width:220px;margin:16px auto;display:block}@media screen and (max-width:599px){ion-button.authui-submit-button{width:100%}}ion-grid.terms{width:100%;margin:24px 0;text-align:left;font-size:.9em}ion-grid.terms ion-col ion-row a{font-size:16px;margin-left:4px}div.forgot-password{margin:24px 0;font-size:.9em}@media (prefers-color-scheme:dark){a{color:#fff}}div.auth-ui-form{width:384px;max-width:384px;padding:32px;text-align:center;flex:1 0 auto}@media screen and (max-width:599px){div.auth-ui-form{padding:24px;width:100%}}div.auth-ui-form form{width:100%;text-align:left}div.authui-wrapper{width:100%;background-size:cover;flex:1 0 auto;padding:32px}@media screen and (max-width:599px){div.authui-wrapper{padding:16px}}button.confirm:disabled{color:grey}div.email-popover-outer{width:100%}div.email-popover-outer div.email-popover-inner{padding:10%}"]
547
- },] }
548
- ];
549
- AuthUISignInComponent.ctorParameters = function () { return [
550
- { type: ngxFirebase.AuthProcessService },
551
- { type: ionic.MalIonicAlertsService },
552
- { type: core.ChangeDetectorRef },
553
- { type: undefined, decorators: [{ type: core.Inject, args: [core.forwardRef(function () { return ngxFirebase.MalSharedConfigToken; }),] }] }
554
- ]; };
555
- AuthUISignInComponent.propDecorators = {
556
- providers: [{ type: core.Input }],
557
- registrationEnabled: [{ type: core.Input }],
558
- resetPasswordEnabled: [{ type: core.Input }],
559
- tosUrl: [{ type: core.Input }],
560
- privacyPolicyUrl: [{ type: core.Input }],
561
- onSuccess: [{ type: core.Output }],
562
- onError: [{ type: core.Output }],
563
- onCreateAccountRequested: [{ type: core.Output }],
564
- onResetPasswordRequested: [{ type: core.Output }]
565
- };
566
-
567
- function isCreateAccountFormData(x) {
568
- return x && x.email && x.password;
569
- }
570
- var AuthUIRegisterComponent = /** @class */ (function () {
571
- // tslint:disable-next-line @typescript-eslint/ban-types
572
- function AuthUIRegisterComponent(config, aps, ui, popover, changeDetectorRef) {
573
- this.config = config;
574
- this.aps = aps;
575
- this.ui = ui;
576
- this.popover = popover;
577
- this.changeDetectorRef = changeDetectorRef;
578
- this.showEmail = 'popover';
579
- this.providers = ngxFirebase.AuthProvider.ALL; // google, facebook, twitter, github as array or all as one single string
580
- // Events
581
- // tslint:disable no-output-on-prefix
582
- this.onSuccess = this.aps.onRegisterEmitter;
583
- this.onError = this.aps.onErrorEmitter;
584
- this.onLoginRequested = new core.EventEmitter();
585
- // tslint:enable no-output-on-prefix
586
- // Prevent somebody already logged in as guest - relogging in as gyest
587
- this.guestEnabled$ = this.aps.canSignInAsGuest$;
588
- // Private
589
- this.destroy$ = new rxjs.Subject();
590
- }
591
- AuthUIRegisterComponent.prototype.ngAfterViewInit = function () {
592
- this.changeDetectorRef.detectChanges();
593
- };
594
- AuthUIRegisterComponent.prototype.ngOnDestroy = function () {
595
- this.destroy$.next();
596
- this.destroy$.complete();
597
- };
598
- AuthUIRegisterComponent.prototype.doCreateAccount = function (data) {
599
- return __awaiter(this, void 0, void 0, function () {
600
- var error_1;
601
- return __generator(this, function (_a) {
602
- switch (_a.label) {
603
- case 0:
604
- _a.trys.push([0, 2, 3, 4]);
605
- this.changeDetectorRef.markForCheck();
606
- return [4 /*yield*/, this.aps.registerWith(ngxFirebase.AuthProvider.EmailAndPassword, {
607
- credentials: {
608
- email: data.email,
609
- password: data.password
610
- },
611
- displayName: data.name,
612
- skipTosCheck: true
613
- })];
614
- case 1:
615
- _a.sent();
616
- return [3 /*break*/, 4];
617
- case 2:
618
- error_1 = _a.sent();
619
- this.ui.logError(error_1);
620
- return [3 /*break*/, 4];
621
- case 3:
622
- this.changeDetectorRef.markForCheck();
623
- return [7 /*endfinally*/];
624
- case 4: return [2 /*return*/];
625
- }
626
- });
627
- });
628
- };
629
- AuthUIRegisterComponent.prototype.doRegisterAnonymously = function () {
630
- return __awaiter(this, void 0, void 0, function () {
631
- var error_2;
632
- return __generator(this, function (_a) {
633
- switch (_a.label) {
634
- case 0:
635
- _a.trys.push([0, 2, 3, 4]);
636
- this.changeDetectorRef.markForCheck();
637
- return [4 /*yield*/, this.aps.signInWith(ngxFirebase.AuthProvider.ANONYMOUS)];
638
- case 1:
639
- _a.sent();
640
- return [3 /*break*/, 4];
641
- case 2:
642
- error_2 = _a.sent();
643
- this.ui.logError(error_2);
644
- return [3 /*break*/, 4];
645
- case 3:
646
- this.changeDetectorRef.markForCheck();
647
- return [7 /*endfinally*/];
648
- case 4: return [2 /*return*/];
649
- }
650
- });
651
- });
652
- };
653
- AuthUIRegisterComponent.prototype.doRegisterWithEmailPopover = function () {
654
- return __awaiter(this, void 0, void 0, function () {
655
- var data, error_3;
656
- var _this = this;
657
- return __generator(this, function (_a) {
658
- switch (_a.label) {
659
- case 0:
660
- _a.trys.push([0, 4, , 5]);
661
- return [4 /*yield*/, new Promise(function (resolve, reject) { return __awaiter(_this, void 0, void 0, function () {
662
- var AuthUIRegisterWithEmailPopoverComponent, popover, error_4;
663
- return __generator(this, function (_a) {
664
- switch (_a.label) {
665
- case 0:
666
- _a.trys.push([0, 4, , 5]);
667
- return [4 /*yield*/, Promise.resolve().then(function () { return registerWithEmailPopover_component; })];
668
- case 1:
669
- AuthUIRegisterWithEmailPopoverComponent = (_a.sent()).AuthUIRegisterWithEmailPopoverComponent;
670
- return [4 /*yield*/, this.popover.create({
671
- component: AuthUIRegisterWithEmailPopoverComponent,
672
- cssClass: ['wide-popover', 'dark-backdrop']
673
- })];
674
- case 2:
675
- popover = _a.sent();
676
- popover.onDidDismiss().then(function (resp) {
677
- if (isCreateAccountFormData(resp === null || resp === void 0 ? void 0 : resp.data)) {
678
- resolve(resp.data);
679
- }
680
- else {
681
- resolve(null);
682
- }
683
- });
684
- return [4 /*yield*/, popover.present()];
685
- case 3:
686
- _a.sent();
687
- return [3 /*break*/, 5];
688
- case 4:
689
- error_4 = _a.sent();
690
- this.ui.logError(error_4);
691
- reject(error_4);
692
- return [3 /*break*/, 5];
693
- case 5: return [2 /*return*/];
694
- }
695
- });
696
- }); })];
697
- case 1:
698
- data = _a.sent();
699
- if (!data) return [3 /*break*/, 3];
700
- return [4 /*yield*/, this.doCreateAccount(data)];
701
- case 2:
702
- _a.sent();
703
- _a.label = 3;
704
- case 3: return [3 /*break*/, 5];
705
- case 4:
706
- error_3 = _a.sent();
707
- this.ui.logError(error_3);
708
- return [3 /*break*/, 5];
709
- case 5: return [2 /*return*/];
710
- }
711
- });
712
- });
713
- };
714
- AuthUIRegisterComponent.prototype.doProviderClick = function (provider) {
715
- try {
716
- this.aps.registerWith(provider);
717
- }
718
- catch (error) {
719
- this.ui.logError(error);
720
- }
721
- };
722
- return AuthUIRegisterComponent;
723
- }());
724
- AuthUIRegisterComponent.decorators = [
725
- { type: core.Component, args: [{
726
- selector: 'mal-authui-register',
727
- template: "<div fxLayout=\"column\" fxLayoutAlign=\"center center\" id=\"register-wrapper\" class=\"authui-wrapper\">\n <div [@animateStagger]=\"{ value: '50' }\" id=\"register-inner\" class=\"authui-inner-wrapper\">\n\n <mal-authui-register-with-email *ngIf=\"showEmail === 'inline'\">\n (createAccountClick)=\"doCreateAccount($event)\">\n </mal-authui-register-with-email>\n\n <div fxLayoutAlign=\"stretch\"\n fxLayout=\"column\"\n class=\"provider-buttons\">\n\n <div *ngIf=\"showEmail === 'popover'\">\n <ion-button id=\"auth_register_email_btn\"\n (click)=\"doRegisterWithEmailPopover()\"\n [@animate]=\"{ value: '*', params: { x: '-100px' } }\"\n color=\"primary\"\n class=\"authui-provider-button\">\n <ion-icon name=\"mail-outline\"></ion-icon>\n <ion-label slot=\"end\">{{ \"auth.register.emailButton\" | translate }}</ion-label>\n </ion-button>\n </div>\n\n <div *ngIf=\"guestEnabled$ | async\">\n <ion-button id=\"auth_register_anon_btn\"\n (click)=\"doRegisterAnonymously()\"\n [@animate]=\"{ value: '*', params: { x: '-100px' } }\"\n color=\"primary\"\n class=\"authui-provider-button\">\n <ion-icon name=\"finger-print-outline\"></ion-icon>\n <ion-label slot=\"end\">{{ \"auth.register.guestButton\" | translate }}</ion-label>\n </ion-button>\n </div>\n </div>\n\n <mal-authui-providers [providers]=\"providers\"\n (providerClick)=\"doProviderClick($event)\"\n layout=\"column\">\n </mal-authui-providers>\n\n <div [@animate]=\"{value:'*',params:{duration:'300ms',y:'100px'}}\"\n class=\"alternate-action\"\n fxLayout=\"column\"\n fxLayoutAlign=\"center center\">\n\n <ion-text color=\"text\" [@animate]=\"{ value: '*', params: { x: '100px' } }\">\n {{ \"auth.register.alreadyHaveAccount\" | translate }}\n </ion-text>\n\n <a (click)=\"onLoginRequested.emit()\"\n [@animate]=\"{ value: '*', params: { x: '-100px' } }\"\n id=\"loginButton\">\n {{\"auth.register.signInButton\" | translate}}\n </a>\n\n </div>\n </div>",
728
- encapsulation: core.ViewEncapsulation.None,
729
- animations: NgxAuthFirebaseuiAnimations,
730
- styles: ["div.authui-logo{margin:32px auto;width:30%}div.authui-logo img{display:block;max-width:120px;border-radius:20px;margin-left:auto;margin-right:auto}div.authui-title{font-size:20px;margin:16px 0}div.authui-alternate-action{margin:32px auto 24px;font-weight:500}div.authui-alternate-action .text{margin-right:8px}ion-content.auth-page{--background:var(--auth-pages-background,--background)}div.resend-confirmation{margin:24px 0;font-size:.9em;text-align:center}ion-button.authui-provider-button{width:220px;margin:8px auto;display:block;text-align:center;--background:var(--auth-provider-background-color,#fff)}@media screen and (max-width:599px){ion-button.authui-provider-button{width:100%}}ion-button.authui-submit-button{width:220px;margin:16px auto;display:block}@media screen and (max-width:599px){ion-button.authui-submit-button{width:100%}}ion-grid.terms{width:100%;margin:24px 0;text-align:left;font-size:.9em}ion-grid.terms ion-col ion-row a{font-size:16px;margin-left:4px}div.forgot-password{margin:24px 0;font-size:.9em}@media (prefers-color-scheme:dark){a{color:#fff}}div.auth-ui-form{width:384px;max-width:384px;padding:32px;text-align:center;flex:1 0 auto}@media screen and (max-width:599px){div.auth-ui-form{padding:24px;width:100%}}div.auth-ui-form form{width:100%;text-align:left}div.authui-wrapper{width:100%;background-size:cover;flex:1 0 auto;padding:32px}@media screen and (max-width:599px){div.authui-wrapper{padding:16px}}button.confirm:disabled{color:grey}div.email-popover-outer{width:100%}div.email-popover-outer div.email-popover-inner{padding:10%}"]
731
- },] }
732
- ];
733
- AuthUIRegisterComponent.ctorParameters = function () { return [
734
- { type: undefined, decorators: [{ type: core.Inject, args: [core.forwardRef(function () { return ngxFirebase.MalSharedConfigToken; }),] }] },
735
- { type: ngxFirebase.AuthProcessService },
736
- { type: ngxFirebase.UiService },
737
- { type: angular.PopoverController },
738
- { type: core.ChangeDetectorRef }
739
- ]; };
740
- AuthUIRegisterComponent.propDecorators = {
741
- showEmail: [{ type: core.Input }],
742
- providers: [{ type: core.Input }],
743
- onSuccess: [{ type: core.Output }],
744
- onError: [{ type: core.Output }],
745
- onLoginRequested: [{ type: core.Output }]
746
- };
747
-
748
- var AuthUIUserComponent = /** @class */ (function () {
749
- function AuthUIUserComponent(aps, ui, navController, config, popoverController, fire) {
750
- this.aps = aps;
751
- this.ui = ui;
752
- this.navController = navController;
753
- this.config = config;
754
- this.popoverController = popoverController;
755
- this.fire = fire;
756
- this._editMode$ = new rxjs.BehaviorSubject(false);
757
- this.canEditAccount = this.config.authUi.allowAccountEdit;
758
- this.canLogout = this.config.authUi.allowAccountLogout;
759
- this.canDeleteAccount = this.config.authUi.allowAccountDelete;
760
- // tslint:disable no-output-on-prefix
761
- this.onSignOut = this.aps.onSignOutEmitter;
762
- this.onAccountEdited = this.aps.onUserUpdatedEmitter;
763
- this.onAccountDeleted = this.aps.onUserDeletedEmitter;
764
- // tslint:enable no-output-on-prefix
765
- this.destroy$ = new rxjs.Subject();
766
- this.userPhotoUrl$ = this.aps.getUserPhotoUrl();
767
- this.user$ = this.aps.user$;
768
- this.updateFormGroup = new forms.FormGroup({
769
- name: new forms.FormControl('', [forms.Validators.required]),
770
- email: new forms.FormControl('', [forms.Validators.required]),
771
- phoneNumber: new forms.FormControl('', [forms.Validators.pattern(ngxFirebase.PHONE_NUMBER_REGEX)])
772
- });
773
- }
774
- Object.defineProperty(AuthUIUserComponent.prototype, "editMode", {
775
- get: function () { return this._editMode$.value; },
776
- set: function (val) { this._editMode$.next(val); },
777
- enumerable: false,
778
- configurable: true
779
- });
780
- Object.defineProperty(AuthUIUserComponent.prototype, "editMode$", {
781
- get: function () { return this._editMode$.asObservable(); },
782
- enumerable: false,
783
- configurable: true
784
- });
785
- AuthUIUserComponent.prototype.ngOnInit = function () {
786
- var _this = this;
787
- this.aps.user$
788
- .pipe(operators.takeUntil(this.destroy$))
789
- .subscribe(function (currentUser) {
790
- if (currentUser) {
791
- _this.updateFormGroup.patchValue({
792
- name: currentUser.displayName,
793
- email: currentUser.email,
794
- phoneNumber: currentUser.phoneNumber
795
- });
796
- _this.updateFormGroup.markAsPristine();
797
- }
798
- else {
799
- _this.updateFormGroup.reset();
800
- _this.editMode = false;
801
- }
802
- });
803
- this.editMode$
804
- .pipe(operators.takeUntil(this.destroy$))
805
- .subscribe(function (editMode) {
806
- if (editMode) {
807
- _this.updateFormGroup.enable();
808
- }
809
- else {
810
- _this.updateFormGroup.disable();
811
- }
812
- });
813
- this.editMode = false;
814
- this.updateFormGroup.disable();
815
- };
816
- AuthUIUserComponent.prototype.ngOnDestroy = function () {
817
- this.destroy$.next();
818
- this.destroy$.complete();
819
- };
820
- AuthUIUserComponent.prototype.changeEditMode = function () {
821
- this.editMode = !this.editMode;
822
- };
823
- AuthUIUserComponent.prototype.dismiss = function () {
824
- return __awaiter(this, void 0, void 0, function () {
825
- return __generator(this, function (_b) {
826
- switch (_b.label) {
827
- case 0:
828
- if (!(this.popoverController.getTop() !== null)) return [3 /*break*/, 2];
829
- return [4 /*yield*/, this.popoverController.dismiss()];
830
- case 1:
831
- _b.sent();
832
- _b.label = 2;
833
- case 2: return [2 /*return*/];
834
- }
835
- });
836
- });
837
- };
838
- AuthUIUserComponent.prototype.save = function () {
839
- return __awaiter(this, void 0, void 0, function () {
840
- var error_1;
841
- return __generator(this, function (_b) {
842
- switch (_b.label) {
843
- case 0:
844
- if (!this.updateFormGroup.dirty) return [3 /*break*/, 6];
845
- _b.label = 1;
846
- case 1:
847
- _b.trys.push([1, 3, , 4]);
848
- return [4 /*yield*/, this.aps.updateUserInfo({
849
- displayName: (this.updateFormGroup.controls.name.dirty) ? this.updateFormGroup.controls.name.value : undefined,
850
- email: (this.updateFormGroup.controls.email.dirty) ? this.updateFormGroup.controls.email.value : undefined,
851
- phoneNumber: (this.updateFormGroup.controls.phoneNumber.dirty) ? this.updateFormGroup.controls.phoneNumber.value : undefined,
852
- })];
853
- case 2:
854
- _b.sent();
855
- return [3 /*break*/, 4];
856
- case 3:
857
- error_1 = _b.sent();
858
- this.fire.recordException(error_1);
859
- this.ui.toast(error_1 && error_1.message ? error_1.message : error_1);
860
- return [3 /*break*/, 4];
861
- case 4: return [4 /*yield*/, this.dismiss()];
862
- case 5:
863
- _b.sent();
864
- return [3 /*break*/, 7];
865
- case 6:
866
- this.editMode = false;
867
- _b.label = 7;
868
- case 7: return [2 /*return*/];
869
- }
870
- });
871
- });
872
- };
873
- AuthUIUserComponent.prototype.signOut = function () {
874
- return __awaiter(this, void 0, void 0, function () {
875
- var error_2;
876
- return __generator(this, function (_b) {
877
- switch (_b.label) {
878
- case 0:
879
- _b.trys.push([0, 2, , 3]);
880
- return [4 /*yield*/, Promise.all([
881
- this.aps.signOut(),
882
- this.dismiss(),
883
- this.navController.navigateRoot(this.config.authUi.authGuardFallbackURL)
884
- ])];
885
- case 1:
886
- _b.sent();
887
- return [3 /*break*/, 3];
888
- case 2:
889
- error_2 = _b.sent();
890
- this.fire.recordException(error_2);
891
- return [3 /*break*/, 3];
892
- case 3: return [2 /*return*/];
893
- }
894
- });
895
- });
896
- };
897
- /**
898
- * Delete the account of the current firebase ngx-auth-firebaseui-user
899
- *
900
- * On Success, emit the <onAccountDeleted> event and toast a msg!#
901
- * Otherwise, log the and toast and error msg!
902
- *
903
- * If the operation fails due to not having current enough signIn, redrect to reSignInUrl, providing forOperation=deleteUser
904
- *
905
- */
906
- AuthUIUserComponent.prototype.deleteAccount = function () {
907
- var _a;
908
- return __awaiter(this, void 0, void 0, function () {
909
- var error_3;
910
- var _this = this;
911
- return __generator(this, function (_b) {
912
- switch (_b.label) {
913
- case 0:
914
- _b.trys.push([0, 5, , 10]);
915
- return [4 /*yield*/, this.ui.yesNoAlert('auth.user.message.confirmDelete', { defaultToNo: true, interpolateParams: { userName: (_a = this.aps.user) === null || _a === void 0 ? void 0 : _a.displayName } })];
916
- case 1:
917
- if (!_b.sent()) return [3 /*break*/, 4];
918
- return [4 /*yield*/, this.aps.deleteUser()];
919
- case 2:
920
- _b.sent();
921
- return [4 /*yield*/, Promise.all([
922
- this.dismiss(),
923
- this.ui.toast('auth.user.message.acountDeleted'),
924
- this.navController.navigateRoot(this.config.authUi.authGuardFallbackURL)
925
- ])];
926
- case 3:
927
- _b.sent();
928
- _b.label = 4;
929
- case 4: return [3 /*break*/, 10];
930
- case 5:
931
- error_3 = _b.sent();
932
- if (!(error_3.code === ngxFirebase.FirebaseErrorCodes.requiresRecentLogin)) return [3 /*break*/, 7];
933
- // If we've failed due to lack of current credentials ask the user to reauthenticate and try again.
934
- return [4 /*yield*/, new Promise(function (resolve, reject) { return __awaiter(_this, void 0, void 0, function () {
935
- var popover, _b, _c, _d;
936
- var _this = this;
937
- return __generator(this, function (_e) {
938
- switch (_e.label) {
939
- case 0:
940
- _c = (_b = this.popoverController).create;
941
- _d = {};
942
- return [4 /*yield*/, Promise.resolve().then(function () { return reauthenticate_component; }).then(function (m) { return m.AuthUIReauthenticateComponent; })];
943
- case 1: return [4 /*yield*/, _c.apply(_b, [(_d.component = _e.sent(),
944
- _d.componentProps = {
945
- message: error_3.message
946
- },
947
- _d.cssClass = 'wide-popover',
948
- _d)])];
949
- case 2:
950
- popover = _e.sent();
951
- popover.onDidDismiss().then(function () { return __awaiter(_this, void 0, void 0, function () {
952
- var error_4;
953
- return __generator(this, function (_b) {
954
- switch (_b.label) {
955
- case 0:
956
- _b.trys.push([0, 3, , 5]);
957
- return [4 /*yield*/, this.aps.deleteUser()];
958
- case 1:
959
- _b.sent();
960
- return [4 /*yield*/, Promise.all([
961
- this.dismiss(),
962
- this.ui.toast('auth.user.message.acountDeleted'),
963
- this.navController.navigateRoot(this.config.authUi.authGuardFallbackURL)
964
- ])];
965
- case 2:
966
- _b.sent();
967
- return [3 /*break*/, 5];
968
- case 3:
969
- error_4 = _b.sent();
970
- return [4 /*yield*/, this.ui.toast('auth.user.message.acountDeleted', { interpolateParams: { error: error_4.message } })];
971
- case 4:
972
- _b.sent();
973
- return [3 /*break*/, 5];
974
- case 5:
975
- resolve();
976
- return [2 /*return*/];
977
- }
978
- });
979
- }); });
980
- return [4 /*yield*/, popover.present()];
981
- case 3:
982
- _e.sent();
983
- return [2 /*return*/];
984
- }
985
- });
986
- }); })];
987
- case 6:
988
- // If we've failed due to lack of current credentials ask the user to reauthenticate and try again.
989
- _b.sent();
990
- return [3 /*break*/, 9];
991
- case 7:
992
- this.fire.recordException(error_3);
993
- return [4 /*yield*/, this.ui.toast('auth.user.message.acountDeleted', { interpolateParams: { error: error_3.message } })];
994
- case 8:
995
- _b.sent();
996
- _b.label = 9;
997
- case 9: return [3 /*break*/, 10];
998
- case 10: return [2 /*return*/];
999
- }
1000
- });
1001
- });
1002
- };
1003
- return AuthUIUserComponent;
1004
- }());
1005
- AuthUIUserComponent.decorators = [
1006
- { type: core.Component, args: [{
1007
- selector: 'mal-authui-user',
1008
- template: "<div *ngIf=\"user$ | async; then authenticated else none\" class=\"authui-form\">\n</div>\n\n<ng-template #authenticated>\n <ion-card *ngIf=\"(user$ | async) as user\">\n\n <!--card header-->\n <ion-card-header fxLayout=\"column\" fxLayoutAlign=\"center center\">\n\n <ion-avatar>\n <img [alt]=\"user.name\" *ngIf=\"(userPhotoUrl$ | async) as photoUrl\" [src]=\"photoUrl\">\n </ion-avatar>\n\n <div *ngIf=\"user.emailVerified; then emailVerified else emailNotVerified\"></div>\n <ng-template #emailVerified>\n <ion-icon name=\"shield-checkmark-outline\" color=\"primary\" [tooltip]=\"'auth.email.isVerified' | translate\"> </ion-icon>\n </ng-template>\n <ng-template #emailNotVerified>\n <ion-icon name=\"warning-outline\" color=\"warn\" [tooltip]=\"'auth.email.notVerified' | translate\"> </ion-icon>\n </ng-template>\n\n </ion-card-header>\n\n <!--card content-->\n <ion-card-content>\n\n <form (submit)=\"save()\" [formGroup]=\"updateFormGroup\" name=\"updateFormGroup\">\n\n <div fxLayout=\"column\" fxLayoutAlign=\"center center\">\n\n <ion-button *ngIf=\"canEditAccount && !editMode\" (click)=\"changeEditMode()\" class=\"edit-button\"\n color=\"primary\">\n {{ \"auth.user.edit\" | translate }}\n </ion-button>\n </div>\n\n <mal-authui-name-field formControlName=\"name\"></mal-authui-name-field>\n <mal-authui-email-field formControlName=\"email\"></mal-authui-email-field>\n\n <!--phone number-->\n <mal-authui-form-field [control]=\"updateFormGroup.controls.phoneNumber\"\n icon=\"call-outline\"\n label=\"auth.phoneNumber.label\"\n *ngIf=\"false\"\n class=\"full-width\"\n hintEnd=\"auth.phoneNumber.hintEnd\"\n errorPrefix=\"auth.phoneNumber.errors\">\n <ion-input formControlName=\"phoneNumber\" [placeholder]=\"'auth.phoneNumber.placeholder' | translate\" type=\"tel\">\n </ion-input>\n </mal-authui-form-field>\n\n </form>\n\n <div class=\"card-actions\" fxLayout=\"row\" fxLayoutAlign=\"center center\">\n <ion-button *ngIf=\"editMode\" (click)=\"changeEditMode()\" class=\"edit-button\" color=\"warning\">\n {{ \"shared.button.cancel\" | translate }}\n </ion-button>\n <ion-button expand=\"block\" *ngIf=\"editMode\" color=\"primary\" (click)=\"save()\">{{ \"auth.user.actions.save\" | translate }} </ion-button>\n </div>\n <div class=\"card-actions\" fxLayout=\"row\" fxLayoutAlign=\"center center\">\n <a expand=\"block\" (click)=\"signOut()\" *ngIf=\"canLogout\" color=\"primary\">{{ \"auth.user.actions.signOut\" | translate }}</a>\n <a expand=\"block\" (click)=\"deleteAccount()\" *ngIf=\"canDeleteAccount\" color=\"warning\">{{ \"auth.user.actions.deleteAccount\" | translate }} </a>\n </div>\n\n </ion-card-content>\n </ion-card>\n</ng-template>\n\n<ng-template #none>\n <ion-card class=\"none-card\" fxLayout=\"row\" fxLayoutAlign=\"center center\">\n <ion-card-content fxLayout=\"row\" fxLayoutAlign=\"center center\">\n <ion-icon color=\"accent\">warning</ion-icon>\n <span>{{ \"auth.user.notLoggedIn\" | translate }}</span>\n </ion-card-content>\n </ion-card>\n</ng-template>",
1009
- styles: [".edit-button{margin:1rem}.full-width{width:100%}.cut-text{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.none-card{min-height:430px}.none-card span{font-size:24px;text-align:center;color:rgba(0,0,0,.54)}.card-actions a{margin-left:4px;margin-right:4px}", "div.authui-logo{margin:32px auto;width:30%}div.authui-logo img{display:block;max-width:120px;border-radius:20px;margin-left:auto;margin-right:auto}div.authui-title{font-size:20px;margin:16px 0}div.authui-alternate-action{margin:32px auto 24px;font-weight:500}div.authui-alternate-action .text{margin-right:8px}ion-content.auth-page{--background:var(--auth-pages-background,--background)}div.resend-confirmation{margin:24px 0;font-size:.9em;text-align:center}ion-button.authui-provider-button{width:220px;margin:8px auto;display:block;text-align:center;--background:var(--auth-provider-background-color,#fff)}@media screen and (max-width:599px){ion-button.authui-provider-button{width:100%}}ion-button.authui-submit-button{width:220px;margin:16px auto;display:block}@media screen and (max-width:599px){ion-button.authui-submit-button{width:100%}}ion-grid.terms{width:100%;margin:24px 0;text-align:left;font-size:.9em}ion-grid.terms ion-col ion-row a{font-size:16px;margin-left:4px}div.forgot-password{margin:24px 0;font-size:.9em}@media (prefers-color-scheme:dark){a{color:#fff}}div.auth-ui-form{width:384px;max-width:384px;padding:32px;text-align:center;flex:1 0 auto}@media screen and (max-width:599px){div.auth-ui-form{padding:24px;width:100%}}div.auth-ui-form form{width:100%;text-align:left}div.authui-wrapper{width:100%;background-size:cover;flex:1 0 auto;padding:32px}@media screen and (max-width:599px){div.authui-wrapper{padding:16px}}button.confirm:disabled{color:grey}div.email-popover-outer{width:100%}div.email-popover-outer div.email-popover-inner{padding:10%}"]
1010
- },] }
1011
- ];
1012
- AuthUIUserComponent.ctorParameters = function () { return [
1013
- { type: ngxFirebase.AuthProcessService },
1014
- { type: ngxFirebase.UiService },
1015
- { type: angular.NavController },
1016
- { type: undefined, decorators: [{ type: core.Inject, args: [core.forwardRef(function () { return ngxFirebase.MalSharedConfigToken; }),] }] },
1017
- { type: angular.PopoverController },
1018
- { type: ngxFirebase.FirebaseService }
1019
- ]; };
1020
- AuthUIUserComponent.propDecorators = {
1021
- editMode: [{ type: core.Input }],
1022
- onSignOut: [{ type: core.Output }],
1023
- onAccountEdited: [{ type: core.Output }],
1024
- onAccountDeleted: [{ type: core.Output }]
1025
- };
1026
-
1027
- var AuthUIReauthenticateComponent = /** @class */ (function () {
1028
- function AuthUIReauthenticateComponent(
1029
- // tslint:disable-next-line @typescript-eslint/ban-types
1030
- aps, ui, changeDetectorRef, popoverController) {
1031
- this.aps = aps;
1032
- this.ui = ui;
1033
- this.changeDetectorRef = changeDetectorRef;
1034
- this.popoverController = popoverController;
1035
- this.providers = ngxFirebase.AuthProvider.ALL; // google, facebook, twitter, github as array or all as one single string
1036
- this.registrationEnabled = true;
1037
- this.resetPasswordEnabled = true;
1038
- this.tosUrl = '';
1039
- this.privacyPolicyUrl = '';
1040
- // Events
1041
- // tslint:disable no-output-on-prefix
1042
- this.onSuccess = this.aps.onSignInEmitter;
1043
- this.onError = this.aps.onErrorEmitter;
1044
- this.onCreateAccountRequested = new core.EventEmitter();
1045
- this.onResetPasswordRequested = new core.EventEmitter();
1046
- // tslint:enable no-output-on-prefix
1047
- this.providers$ = this.aps.reauthenticateProviders$;
1048
- this.showPasswordProvider$ = this.providers$.pipe(operators.map(function (providers) { return providers.includes(ngxFirebase.AuthProvider.EmailAndPassword); }));
1049
- this.showDivider$ = this.providers$.pipe(operators.map(function (providers) { return providers.length > 1 && providers.includes(ngxFirebase.AuthProvider.EmailAndPassword); }));
1050
- this.message = '';
1051
- this.reauthForm = new forms.FormGroup({
1052
- password: new forms.FormControl(null, [forms.Validators.required])
1053
- });
1054
- }
1055
- AuthUIReauthenticateComponent.prototype.ngAfterViewInit = function () {
1056
- this.changeDetectorRef.detectChanges();
1057
- };
1058
- AuthUIReauthenticateComponent.prototype.dismiss = function () {
1059
- return __awaiter(this, void 0, void 0, function () {
1060
- return __generator(this, function (_b) {
1061
- switch (_b.label) {
1062
- case 0:
1063
- if (!(this.popoverController.getTop() !== null)) return [3 /*break*/, 2];
1064
- return [4 /*yield*/, this.popoverController.dismiss()];
1065
- case 1:
1066
- _b.sent();
1067
- _b.label = 2;
1068
- case 2: return [2 /*return*/];
1069
- }
1070
- });
1071
- });
1072
- };
1073
- AuthUIReauthenticateComponent.prototype.doReauthenticateWithPassword = function () {
1074
- var _a;
1075
- return __awaiter(this, void 0, void 0, function () {
1076
- var error_1;
1077
- return __generator(this, function (_b) {
1078
- switch (_b.label) {
1079
- case 0:
1080
- _b.trys.push([0, 2, 3, 5]);
1081
- if (!((_a = this.aps.user) === null || _a === void 0 ? void 0 : _a.email) || !this.reauthForm.value.password) {
1082
- throw new Error('Trying to reauth with email/password when not valid');
1083
- }
1084
- return [4 /*yield*/, this.aps.reauthenicateWithProvider(ngxFirebase.AuthProvider.EmailAndPassword, { credentials: { email: this.aps.user.email, password: this.reauthForm.value.password } })];
1085
- case 1:
1086
- _b.sent();
1087
- return [3 /*break*/, 5];
1088
- case 2:
1089
- error_1 = _b.sent();
1090
- this.ui.logError(error_1);
1091
- return [3 /*break*/, 5];
1092
- case 3: return [4 /*yield*/, this.dismiss()];
1093
- case 4:
1094
- _b.sent();
1095
- return [7 /*endfinally*/];
1096
- case 5: return [2 /*return*/];
1097
- }
1098
- });
1099
- });
1100
- };
1101
- AuthUIReauthenticateComponent.prototype.doProviderClick = function (provider) {
1102
- try {
1103
- this.aps.reauthenicateWithProvider(provider);
1104
- }
1105
- catch (error) {
1106
- this.ui.logError(error);
1107
- }
1108
- };
1109
- return AuthUIReauthenticateComponent;
1110
- }());
1111
- AuthUIReauthenticateComponent.decorators = [
1112
- { type: core.Component, args: [{
1113
- selector: 'mal-authui-reauthenticate',
1114
- template: "<div fxLayout=\"column\" fxLayoutAlign=\"center center\" id=\"signin-wrapper\" class=\"authui-wrapper\">\n <div [@animateStagger]=\"{ value: '50' }\" id=\"signin-inner\" class=\"authui-inner-wrapper\">\n\n <div *ngIf=\"logoUrl\" class=\"authui-logo\">\n <img [@animate]=\"{ value: '*', params: { x: '50px' } }\" [src]=\"logoUrl\" alt=\"logo\">\n </div>\n\n <div [@animate]=\"{ value: '*', params: { x: '-50px' } }\" class=\"authui-title\">\n {{ \"auth.reauthenticate.tabTitle\" | translate }}\n </div>\n\n {{ message }}\n\n <form *ngIf=\"showPasswordProvider$ | async\"\n [@animate]=\"{value:'*',params:{duration:'300ms',y:'100px'}}\"\n [formGroup]=\"reauthForm\"\n name=\"reauthForm\"\n novalidate>\n\n <mal-authui-password-field formControlName=\"password\"\n [@animate]=\"{ value: '*', params: { x: '50px' } }\">\n </mal-authui-password-field>\n\n <ion-button (click)=\"doReauthenticateWithPassword()\"\n color=\"primary\"\n [disabled]=\"reauthForm.invalid\"\n aria-label=\"LOG IN\"\n fxLayoutAlign=\"center center\"\n class=\"authui-submit-button\"\n id=\"loginButton\">\n {{\"auth.signIn.loginButton\" | translate }}\n </ion-button>\n\n </form>\n\n <mal-authui-or-divider *ngIf=\"showDivider$ | async\"\n [@animate]=\"{ value: '*', params: { z: '50px', delay: '50ms', scale: '0.2' } }\">\n </mal-authui-or-divider>\n\n <mal-authui-providers [providers]=\"providers$ | async\"\n (providerClick)=\"doProviderClick($event)\"\n fxLayoutAlign=\"center center\"\n layout=\"column\"></mal-authui-providers>\n\n </div>\n</div>",
1115
- encapsulation: core.ViewEncapsulation.None,
1116
- animations: NgxAuthFirebaseuiAnimations,
1117
- styles: ["div.authui-logo{margin:32px auto;width:30%}div.authui-logo img{display:block;max-width:120px;border-radius:20px;margin-left:auto;margin-right:auto}div.authui-title{font-size:20px;margin:16px 0}div.authui-alternate-action{margin:32px auto 24px;font-weight:500}div.authui-alternate-action .text{margin-right:8px}ion-content.auth-page{--background:var(--auth-pages-background,--background)}div.resend-confirmation{margin:24px 0;font-size:.9em;text-align:center}ion-button.authui-provider-button{width:220px;margin:8px auto;display:block;text-align:center;--background:var(--auth-provider-background-color,#fff)}@media screen and (max-width:599px){ion-button.authui-provider-button{width:100%}}ion-button.authui-submit-button{width:220px;margin:16px auto;display:block}@media screen and (max-width:599px){ion-button.authui-submit-button{width:100%}}ion-grid.terms{width:100%;margin:24px 0;text-align:left;font-size:.9em}ion-grid.terms ion-col ion-row a{font-size:16px;margin-left:4px}div.forgot-password{margin:24px 0;font-size:.9em}@media (prefers-color-scheme:dark){a{color:#fff}}div.auth-ui-form{width:384px;max-width:384px;padding:32px;text-align:center;flex:1 0 auto}@media screen and (max-width:599px){div.auth-ui-form{padding:24px;width:100%}}div.auth-ui-form form{width:100%;text-align:left}div.authui-wrapper{width:100%;background-size:cover;flex:1 0 auto;padding:32px}@media screen and (max-width:599px){div.authui-wrapper{padding:16px}}button.confirm:disabled{color:grey}div.email-popover-outer{width:100%}div.email-popover-outer div.email-popover-inner{padding:10%}"]
1118
- },] }
1119
- ];
1120
- AuthUIReauthenticateComponent.ctorParameters = function () { return [
1121
- { type: ngxFirebase.AuthProcessService },
1122
- { type: ngxFirebase.UiService },
1123
- { type: core.ChangeDetectorRef },
1124
- { type: angular.PopoverController }
1125
- ]; };
1126
- AuthUIReauthenticateComponent.propDecorators = {
1127
- logoUrl: [{ type: core.Input }],
1128
- providers: [{ type: core.Input }],
1129
- registrationEnabled: [{ type: core.Input }],
1130
- resetPasswordEnabled: [{ type: core.Input }],
1131
- tosUrl: [{ type: core.Input }],
1132
- privacyPolicyUrl: [{ type: core.Input }],
1133
- onSuccess: [{ type: core.Output }],
1134
- onError: [{ type: core.Output }],
1135
- onCreateAccountRequested: [{ type: core.Output }],
1136
- onResetPasswordRequested: [{ type: core.Output }]
1137
- };
1138
-
1139
- var reauthenticate_component = /*#__PURE__*/Object.freeze({
1140
- __proto__: null,
1141
- AuthUIReauthenticateComponent: AuthUIReauthenticateComponent
1142
- });
1143
-
1144
- exports.Layout = void 0;
1145
- (function (Layout) {
1146
- Layout["ROW"] = "row";
1147
- Layout["COLUMN"] = "column";
1148
- })(exports.Layout || (exports.Layout = {}));
1149
- var displayProviders = {
1150
- google: { name: ngxFirebase.AuthProvider.Google, icon: 'logo-google', label: 'Google' },
1151
- apple: { name: ngxFirebase.AuthProvider.Apple, icon: 'logo-apple', label: 'Apple' },
1152
- facebook: { name: ngxFirebase.AuthProvider.Facebook, icon: 'logo-facebook', label: 'Facebook' },
1153
- twitter: { name: ngxFirebase.AuthProvider.Twitter, icon: 'logo-twitter', label: 'Twitter' },
1154
- github: { name: ngxFirebase.AuthProvider.Github, icon: 'logo-github', label: 'GitHub' },
1155
- microsoft: { name: ngxFirebase.AuthProvider.Microsoft, label: 'Microsoft' },
1156
- yahoo: { name: ngxFirebase.AuthProvider.Yahoo, icon: 'logo-yahoo', label: 'Yahoo' }
1157
- };
1158
- var AuthProvidersComponent = /** @class */ (function () {
1159
- function AuthProvidersComponent(aps, ui, config) {
1160
- var _this = this;
1161
- this.aps = aps;
1162
- this.ui = ui;
1163
- this.config = config;
1164
- this.layout = exports.Layout.ROW;
1165
- this.providers$ = new rxjs.BehaviorSubject(ngxFirebase.AuthProvider.ALL);
1166
- this.providerClick = new core.EventEmitter();
1167
- this.displayProviders$ = this.providers$.pipe(
1168
- // Filter for those in config
1169
- operators.map(function (providerOrArray) {
1170
- if (providerOrArray === ngxFirebase.AuthProvider.ALL) {
1171
- providerOrArray = _this.config.authUi.supportedProviders;
1172
- }
1173
- var providers = Array.isArray(providerOrArray) ? providerOrArray : [providerOrArray];
1174
- return providers.filter(function (item) { return _this.providers === ngxFirebase.AuthProvider.ALL || _this.providers.includes(item); });
1175
- }),
1176
- // Filter for those valid on platform
1177
- operators.switchMap(function (providers) { return __awaiter(_this, void 0, void 0, function () {
1178
- var providerFilter;
1179
- var _this = this;
1180
- return __generator(this, function (_a) {
1181
- switch (_a.label) {
1182
- case 0: return [4 /*yield*/, Promise.all(providers.map(function (item) { return _this.aps.isProviderSupported(item); }))];
1183
- case 1:
1184
- providerFilter = _a.sent();
1185
- return [2 /*return*/, providers.filter(function (_item, index) { return providerFilter[index]; })];
1186
- }
1187
- });
1188
- }); }),
1189
- // Map to display type
1190
- operators.map(function (providers) { return providers.map(function (item) { return displayProviders[item]; }); }), operators.catchError(function (error) {
1191
- _this.ui.logError(error);
1192
- return rxjs.of([]);
1193
- }));
1194
- }
1195
- Object.defineProperty(AuthProvidersComponent.prototype, "providers", {
1196
- get: function () { return this.providers$.value; },
1197
- set: function (val) { this.providers$.next(val); },
1198
- enumerable: false,
1199
- configurable: true
1200
- });
1201
- return AuthProvidersComponent;
1202
- }());
1203
- AuthProvidersComponent.decorators = [
1204
- { type: core.Component, args: [{
1205
- selector: 'mal-authui-providers',
1206
- template: "<div [@animateStagger]=\"{ value: '50' }\">\n\n <!--default icon buttons-->\n <div [fxLayoutAlign]=\"layout == 'row' ? 'center' : 'stretch'\"\n [fxLayout]=\"layout\"\n fxLayout.xs=\"column\"\n class=\"provider-buttons\">\n\n <div *ngFor=\"let provider of (displayProviders$ | async)\">\n <ion-button [id]=\"'auth_provider_' + provider.name + '_btn'\"\n (click)=\"providerClick.emit(provider.name)\"\n [@animate]=\"{value:'*',params:{duration:'300ms',y:'100px'}}\"\n [class]=\"provider.name + ' authui-provider-button'\">\n\n <ion-icon *ngIf=\"provider.icon\" slot=\"start\" [name]=\"provider.icon\"></ion-icon>\n <ion-label slot=\"end\">{{ 'auth.provider.' + provider.name | translate }}</ion-label>\n\n </ion-button>\n </div>\n\n </div>\n</div>",
1207
- animations: NgxAuthFirebaseuiAnimations,
1208
- styles: [":host{display:block}ion-button.google{color:#db4437!important}ion-button.apple{color:#000!important}ion-button.facebook{color:#385899!important}ion-button.twitter{color:#1da1f2!important}ion-button.github{color:#000!important}ion-button.microsoft{color:#0078d4!important}ion-button.yahoo{color:#720e9e!important}ion-button.phone{color:#02bd7e}", "div.authui-logo{margin:32px auto;width:30%}div.authui-logo img{display:block;max-width:120px;border-radius:20px;margin-left:auto;margin-right:auto}div.authui-title{font-size:20px;margin:16px 0}div.authui-alternate-action{margin:32px auto 24px;font-weight:500}div.authui-alternate-action .text{margin-right:8px}ion-content.auth-page{--background:var(--auth-pages-background,--background)}div.resend-confirmation{margin:24px 0;font-size:.9em;text-align:center}ion-button.authui-provider-button{width:220px;margin:8px auto;display:block;text-align:center;--background:var(--auth-provider-background-color,#fff)}@media screen and (max-width:599px){ion-button.authui-provider-button{width:100%}}ion-button.authui-submit-button{width:220px;margin:16px auto;display:block}@media screen and (max-width:599px){ion-button.authui-submit-button{width:100%}}ion-grid.terms{width:100%;margin:24px 0;text-align:left;font-size:.9em}ion-grid.terms ion-col ion-row a{font-size:16px;margin-left:4px}div.forgot-password{margin:24px 0;font-size:.9em}@media (prefers-color-scheme:dark){a{color:#fff}}div.auth-ui-form{width:384px;max-width:384px;padding:32px;text-align:center;flex:1 0 auto}@media screen and (max-width:599px){div.auth-ui-form{padding:24px;width:100%}}div.auth-ui-form form{width:100%;text-align:left}div.authui-wrapper{width:100%;background-size:cover;flex:1 0 auto;padding:32px}@media screen and (max-width:599px){div.authui-wrapper{padding:16px}}button.confirm:disabled{color:grey}div.email-popover-outer{width:100%}div.email-popover-outer div.email-popover-inner{padding:10%}"]
1209
- },] }
1210
- ];
1211
- AuthProvidersComponent.ctorParameters = function () { return [
1212
- { type: ngxFirebase.AuthProcessService },
1213
- { type: ngxFirebase.UiService },
1214
- { type: undefined, decorators: [{ type: core.Inject, args: [core.forwardRef(function () { return ngxFirebase.MalSharedConfigToken; }),] }] }
1215
- ]; };
1216
- AuthProvidersComponent.propDecorators = {
1217
- layout: [{ type: core.Input }],
1218
- providers: [{ type: core.Input }],
1219
- providerClick: [{ type: core.Output }]
1220
- };
1221
-
1222
- var AuthUIEmailFieldComponent = /** @class */ (function (_super) {
1223
- __extends(AuthUIEmailFieldComponent, _super);
1224
- function AuthUIEmailFieldComponent(injector, cdRef) {
1225
- var _this = _super.call(this, injector, cdRef) || this;
1226
- _this.control = new forms.FormControl('', [forms.Validators.email]);
1227
- return _this;
1228
- }
1229
- return AuthUIEmailFieldComponent;
1230
- }(ngxFirebase.ValueAccessorControlComponent));
1231
- AuthUIEmailFieldComponent.decorators = [
1232
- { type: core.Component, args: [{
1233
- selector: 'mal-authui-email-field',
1234
- template: "<mal-authui-form-field [control]=\"parentControl\"\n label=\"auth.email.label\"\n errorPrefix=\"auth.email.errors\">\n\n <ion-input [placeholder]=\"'auth.email.placeholder' | translate\"\n [formControl]=\"control\"\n type=\"email\"\n color=\"text\"\n autocomplete=\"email\">\n </ion-input>\n\n</mal-authui-form-field>",
1235
- providers: [
1236
- { provide: forms.NG_VALUE_ACCESSOR, useExisting: core.forwardRef(function () { return AuthUIEmailFieldComponent; }), multi: true },
1237
- { provide: forms.NG_VALIDATORS, useExisting: AuthUIEmailFieldComponent, multi: true }
1238
- ],
1239
- styles: ["div.authui-logo{margin:32px auto;width:30%}div.authui-logo img{display:block;max-width:120px;border-radius:20px;margin-left:auto;margin-right:auto}div.authui-title{font-size:20px;margin:16px 0}div.authui-alternate-action{margin:32px auto 24px;font-weight:500}div.authui-alternate-action .text{margin-right:8px}ion-content.auth-page{--background:var(--auth-pages-background,--background)}div.resend-confirmation{margin:24px 0;font-size:.9em;text-align:center}ion-button.authui-provider-button{width:220px;margin:8px auto;display:block;text-align:center;--background:var(--auth-provider-background-color,#fff)}@media screen and (max-width:599px){ion-button.authui-provider-button{width:100%}}ion-button.authui-submit-button{width:220px;margin:16px auto;display:block}@media screen and (max-width:599px){ion-button.authui-submit-button{width:100%}}ion-grid.terms{width:100%;margin:24px 0;text-align:left;font-size:.9em}ion-grid.terms ion-col ion-row a{font-size:16px;margin-left:4px}div.forgot-password{margin:24px 0;font-size:.9em}@media (prefers-color-scheme:dark){a{color:#fff}}div.auth-ui-form{width:384px;max-width:384px;padding:32px;text-align:center;flex:1 0 auto}@media screen and (max-width:599px){div.auth-ui-form{padding:24px;width:100%}}div.auth-ui-form form{width:100%;text-align:left}div.authui-wrapper{width:100%;background-size:cover;flex:1 0 auto;padding:32px}@media screen and (max-width:599px){div.authui-wrapper{padding:16px}}button.confirm:disabled{color:grey}div.email-popover-outer{width:100%}div.email-popover-outer div.email-popover-inner{padding:10%}"]
1240
- },] }
1241
- ];
1242
- AuthUIEmailFieldComponent.ctorParameters = function () { return [
1243
- { type: core.Injector },
1244
- { type: core.ChangeDetectorRef }
1245
- ]; };
1246
-
1247
- var AuthUIFormFieldComponent = /** @class */ (function () {
1248
- function AuthUIFormFieldComponent(ui) {
1249
- var _this = this;
1250
- this.ui = ui;
1251
- this.label = '';
1252
- this.control$ = new rxjs.BehaviorSubject(undefined);
1253
- this.errors$ = this.control$.pipe(operators.switchMap(function (control) { return (control && control.statusChanges)
1254
- ? control.statusChanges.pipe(operators.startWith(control.errors), operators.map(function (_) { return _this.errorMessageFn(control.errors); }))
1255
- : rxjs.of([]); }), operators.catchError(function (error) {
1256
- _this.ui.logError(error);
1257
- return rxjs.of([error.message]);
1258
- }));
1259
- this.isValid$ = this.control$.pipe(operators.switchMap(function (control) { return (control && control.statusChanges)
1260
- ? control.statusChanges.pipe(operators.startWith(control.valid), operators.map(function () { return control.valid || false; }))
1261
- : rxjs.of(true); }));
1262
- this.isDisabled$ = this.control$.pipe(operators.switchMap(function (control) { return (control && control.statusChanges)
1263
- ? control.statusChanges.pipe(operators.startWith(control.disabled), operators.map(function () { return control.disabled || false; }))
1264
- : rxjs.of(true); }));
1265
- this.errorMessageFn = this.flattenErrors.bind(this);
1266
- this.translateParams = {};
1267
- }
1268
- Object.defineProperty(AuthUIFormFieldComponent.prototype, "control", {
1269
- get: function () { return this.control$.value; },
1270
- set: function (val) { this.control$.next(val); },
1271
- enumerable: false,
1272
- configurable: true
1273
- });
1274
- AuthUIFormFieldComponent.prototype.flattenErrors = function (errors) {
1275
- var _this = this;
1276
- if (errors) {
1277
- if (this.customErrors || this.errorPrefix) {
1278
- return Object.keys(errors)
1279
- .map(function (key) {
1280
- if (_this.customErrors) {
1281
- if (undefined !== _this.customErrors[key]) {
1282
- return _this.customErrors[key];
1283
- }
1284
- else if (undefined !== _this.customErrors.default) {
1285
- return _this.customErrors.default;
1286
- }
1287
- else {
1288
- return '';
1289
- }
1290
- }
1291
- else if (_this.errorPrefix) {
1292
- return _this.errorPrefix + "." + key;
1293
- }
1294
- })
1295
- .filter(function (item) { return !!item; }) || [];
1296
- }
1297
- else if (this.errorMessage) {
1298
- return [this.errorMessage];
1299
- }
1300
- else {
1301
- return [];
1302
- }
1303
- }
1304
- else {
1305
- return [];
1306
- }
1307
- };
1308
- return AuthUIFormFieldComponent;
1309
- }());
1310
- AuthUIFormFieldComponent.decorators = [
1311
- { type: core.Component, args: [{
1312
- selector: 'mal-authui-form-field',
1313
- template: "<ion-item class=\"ion-no-padding input form-field\">\n <ion-label color=\"text\" class=\"text-size-xs\" position=\"floating\">{{ label | translate }}</ion-label>\n <div class=\"input-wrap\">\n <ng-content></ng-content>\n <ion-icon size=\"large\" *ngIf=\"!(isValid$ | async) && !(isDisabled$ | async)\" class=\"invalid\" name=\"remove-circle\"></ion-icon>\n <ion-icon size=\"large\" *ngIf=\"icon\" class=\"custom\" [name]=\"icon\"></ion-icon>\n </div>\n</ion-item>\n<ion-grid class=\"footer-messages\">\n <span class=\"hint-end\" *ngIf=\"hintEnd\">{{ hintEnd | translate:translateParams }}</span>\n <ion-row *ngFor=\"let error of (errors$ | async)\" class=\"error-message\">\n <ion-col>{{ error | translate:translateParams }} </ion-col>\n </ion-row>\n</ion-grid>",
1314
- styles: ["ion-item.form-field{width:100%}ion-item.form-field div.input-wrap{display:flex;flex-wrap:nowrap;width:100%}ion-item.form-field div.input-wrap ion-icon.invalid{color:var(--ion-color-danger,red);align-items:right;height:100%}ion-grid.footer-messages{text-align:left;margin:0;padding:0;font-size:small}ion-grid.footer-messages ion-row.error-message ion-col{color:var(--ion-color-danger,red);margin:0;padding:0}ion-grid.footer-messages span.hint-end{float:right}", "div.authui-logo{margin:32px auto;width:30%}div.authui-logo img{display:block;max-width:120px;border-radius:20px;margin-left:auto;margin-right:auto}div.authui-title{font-size:20px;margin:16px 0}div.authui-alternate-action{margin:32px auto 24px;font-weight:500}div.authui-alternate-action .text{margin-right:8px}ion-content.auth-page{--background:var(--auth-pages-background,--background)}div.resend-confirmation{margin:24px 0;font-size:.9em;text-align:center}ion-button.authui-provider-button{width:220px;margin:8px auto;display:block;text-align:center;--background:var(--auth-provider-background-color,#fff)}@media screen and (max-width:599px){ion-button.authui-provider-button{width:100%}}ion-button.authui-submit-button{width:220px;margin:16px auto;display:block}@media screen and (max-width:599px){ion-button.authui-submit-button{width:100%}}ion-grid.terms{width:100%;margin:24px 0;text-align:left;font-size:.9em}ion-grid.terms ion-col ion-row a{font-size:16px;margin-left:4px}div.forgot-password{margin:24px 0;font-size:.9em}@media (prefers-color-scheme:dark){a{color:#fff}}div.auth-ui-form{width:384px;max-width:384px;padding:32px;text-align:center;flex:1 0 auto}@media screen and (max-width:599px){div.auth-ui-form{padding:24px;width:100%}}div.auth-ui-form form{width:100%;text-align:left}div.authui-wrapper{width:100%;background-size:cover;flex:1 0 auto;padding:32px}@media screen and (max-width:599px){div.authui-wrapper{padding:16px}}button.confirm:disabled{color:grey}div.email-popover-outer{width:100%}div.email-popover-outer div.email-popover-inner{padding:10%}"]
1315
- },] }
1316
- ];
1317
- AuthUIFormFieldComponent.ctorParameters = function () { return [
1318
- { type: ngxFirebase.UiService }
1319
- ]; };
1320
- AuthUIFormFieldComponent.propDecorators = {
1321
- label: [{ type: core.Input }],
1322
- control: [{ type: core.Input }],
1323
- errorMessage: [{ type: core.Input }],
1324
- errorMessageFn: [{ type: core.Input }],
1325
- errorPrefix: [{ type: core.Input }],
1326
- customErrors: [{ type: core.Input }],
1327
- translateParams: [{ type: core.Input }],
1328
- icon: [{ type: core.Input }],
1329
- hintEnd: [{ type: core.Input }]
1330
- };
1331
-
1332
- var AuthUINameFieldComponent = /** @class */ (function (_super) {
1333
- __extends(AuthUINameFieldComponent, _super);
1334
- function AuthUINameFieldComponent(config, injector, cdRef) {
1335
- var _this = _super.call(this, injector, cdRef) || this;
1336
- _this.config = config;
1337
- _this.control = new forms.FormControl('', [
1338
- forms.Validators.minLength(_this.config.authUi.nameMinLength),
1339
- forms.Validators.maxLength(_this.config.authUi.nameMaxLength)
1340
- ]);
1341
- return _this;
1342
- }
1343
- return AuthUINameFieldComponent;
1344
- }(ngxFirebase.ValueAccessorControlComponent));
1345
- AuthUINameFieldComponent.decorators = [
1346
- { type: core.Component, args: [{
1347
- selector: 'mal-authui-name-field',
1348
- template: "<mal-authui-form-field [control]=\"parentControl\"\n label=\"auth.name.label\"\n [hintEnd]=\"(control.value?.length || 0 ) + ' / ' + config.authUi.nameMaxLength\"\n errorPrefix=\"auth.name.errors\">\n\n <ion-input [placeholder]=\"'auth.name.placeholder' | translate\"\n [maxlength]=\"config.authUi.nameMaxLength\"\n [minlength]=\"config.authUi.nameMinLength\"\n color=\"text\"\n [formControl]=\"control\">\n </ion-input>\n\n</mal-authui-form-field>",
1349
- providers: [
1350
- { provide: forms.NG_VALUE_ACCESSOR, useExisting: core.forwardRef(function () { return AuthUINameFieldComponent; }), multi: true },
1351
- { provide: forms.NG_VALIDATORS, useExisting: AuthUINameFieldComponent, multi: true }
1352
- ],
1353
- styles: ["div.authui-logo{margin:32px auto;width:30%}div.authui-logo img{display:block;max-width:120px;border-radius:20px;margin-left:auto;margin-right:auto}div.authui-title{font-size:20px;margin:16px 0}div.authui-alternate-action{margin:32px auto 24px;font-weight:500}div.authui-alternate-action .text{margin-right:8px}ion-content.auth-page{--background:var(--auth-pages-background,--background)}div.resend-confirmation{margin:24px 0;font-size:.9em;text-align:center}ion-button.authui-provider-button{width:220px;margin:8px auto;display:block;text-align:center;--background:var(--auth-provider-background-color,#fff)}@media screen and (max-width:599px){ion-button.authui-provider-button{width:100%}}ion-button.authui-submit-button{width:220px;margin:16px auto;display:block}@media screen and (max-width:599px){ion-button.authui-submit-button{width:100%}}ion-grid.terms{width:100%;margin:24px 0;text-align:left;font-size:.9em}ion-grid.terms ion-col ion-row a{font-size:16px;margin-left:4px}div.forgot-password{margin:24px 0;font-size:.9em}@media (prefers-color-scheme:dark){a{color:#fff}}div.auth-ui-form{width:384px;max-width:384px;padding:32px;text-align:center;flex:1 0 auto}@media screen and (max-width:599px){div.auth-ui-form{padding:24px;width:100%}}div.auth-ui-form form{width:100%;text-align:left}div.authui-wrapper{width:100%;background-size:cover;flex:1 0 auto;padding:32px}@media screen and (max-width:599px){div.authui-wrapper{padding:16px}}button.confirm:disabled{color:grey}div.email-popover-outer{width:100%}div.email-popover-outer div.email-popover-inner{padding:10%}"]
1354
- },] }
1355
- ];
1356
- AuthUINameFieldComponent.ctorParameters = function () { return [
1357
- { type: undefined, decorators: [{ type: core.Inject, args: [core.forwardRef(function () { return ngxFirebase.MalSharedConfigToken; }),] }] },
1358
- { type: core.Injector },
1359
- { type: core.ChangeDetectorRef }
1360
- ]; };
1361
-
1362
- var AuthUIOrDividerComponent = /** @class */ (function () {
1363
- function AuthUIOrDividerComponent() {
1364
- }
1365
- return AuthUIOrDividerComponent;
1366
- }());
1367
- AuthUIOrDividerComponent.decorators = [
1368
- { type: core.Component, args: [{
1369
- selector: 'mal-authui-or-divider',
1370
- template: "<div \n class=\"separator\">\n <ion-text color=\"text\" class=\"text\">{{ \"auth.common.orLabel\" | translate }}</ion-text>\n</div>",
1371
- styles: [".separator{font-size:15px;font-weight:600;margin:20px auto 6px;position:relative;overflow:hidden;width:100px}.separator .text{display:inline-flex;position:relative;padding:0 8px;z-index:9999}.separator .text:after,.separator .text:before{content:\"\";display:block;width:30px;position:absolute;top:10px;border-top:1px solid}.separator .text:before{right:100%}.separator .text:after{left:100%}", "div.authui-logo{margin:32px auto;width:30%}div.authui-logo img{display:block;max-width:120px;border-radius:20px;margin-left:auto;margin-right:auto}div.authui-title{font-size:20px;margin:16px 0}div.authui-alternate-action{margin:32px auto 24px;font-weight:500}div.authui-alternate-action .text{margin-right:8px}ion-content.auth-page{--background:var(--auth-pages-background,--background)}div.resend-confirmation{margin:24px 0;font-size:.9em;text-align:center}ion-button.authui-provider-button{width:220px;margin:8px auto;display:block;text-align:center;--background:var(--auth-provider-background-color,#fff)}@media screen and (max-width:599px){ion-button.authui-provider-button{width:100%}}ion-button.authui-submit-button{width:220px;margin:16px auto;display:block}@media screen and (max-width:599px){ion-button.authui-submit-button{width:100%}}ion-grid.terms{width:100%;margin:24px 0;text-align:left;font-size:.9em}ion-grid.terms ion-col ion-row a{font-size:16px;margin-left:4px}div.forgot-password{margin:24px 0;font-size:.9em}@media (prefers-color-scheme:dark){a{color:#fff}}div.auth-ui-form{width:384px;max-width:384px;padding:32px;text-align:center;flex:1 0 auto}@media screen and (max-width:599px){div.auth-ui-form{padding:24px;width:100%}}div.auth-ui-form form{width:100%;text-align:left}div.authui-wrapper{width:100%;background-size:cover;flex:1 0 auto;padding:32px}@media screen and (max-width:599px){div.authui-wrapper{padding:16px}}button.confirm:disabled{color:grey}div.email-popover-outer{width:100%}div.email-popover-outer div.email-popover-inner{padding:10%}"]
1372
- },] }
1373
- ];
1374
-
1375
- function passwordStrengthValidator(config) {
1376
- return function (control) {
1377
- var strengthErrors = null;
1378
- if (control.value) {
1379
- if (config.passwordMinLength && control.value.length < config.passwordMinLength) {
1380
- return { minlength: true };
1381
- }
1382
- if (config.passwordMaxLength && control.value.length > config.passwordMaxLength) {
1383
- return { maxlength: true };
1384
- }
1385
- if (config.passwordRequireLowercase && (!/[a-z]/.test(control.value))) {
1386
- if (!strengthErrors) {
1387
- strengthErrors = {};
1388
- }
1389
- strengthErrors.requireLowercase = true;
1390
- }
1391
- if (config.passwordRequireUppercase && (!/[A-Z]/.test(control.value))) {
1392
- if (!strengthErrors) {
1393
- strengthErrors = {};
1394
- }
1395
- strengthErrors.requireUppercase = true;
1396
- }
1397
- if (config.passwordRequireSpecial && (!/[!@#\$%\^&]/.test(control.value))) {
1398
- if (!strengthErrors) {
1399
- strengthErrors = {};
1400
- }
1401
- strengthErrors.requireSpecial = true;
1402
- }
1403
- if (config.passwordRequireNumbers && (!/[0-9]/.test(control.value))) {
1404
- if (!strengthErrors) {
1405
- strengthErrors = {};
1406
- }
1407
- strengthErrors.requireNumbers = true;
1408
- }
1409
- if (strengthErrors) {
1410
- return { passwordStrength: strengthErrors };
1411
- }
1412
- }
1413
- return null;
1414
- };
1415
- }
1416
- function confirmPasswordValidator(control) {
1417
- if (!control.parent || !control) {
1418
- return null;
1419
- }
1420
- var password = control.parent.get('password');
1421
- var passwordConfirm = control.parent.get('passwordConfirm');
1422
- if (!password || !passwordConfirm) {
1423
- return null;
1424
- }
1425
- if (!password.value && !passwordConfirm.value) {
1426
- return null;
1427
- }
1428
- if (password.value === passwordConfirm.value) {
1429
- return null;
1430
- }
1431
- if (password.value && !passwordConfirm.value) {
1432
- return { passwordConfirmationRequired: true };
1433
- }
1434
- return { passwordsNotMatching: true };
1435
- }
1436
-
1437
- var AuthUIPasswordFieldComponent = /** @class */ (function () {
1438
- function AuthUIPasswordFieldComponent(config, injector, cdRef, ui) {
1439
- var _this = this;
1440
- this.config = config;
1441
- this.injector = injector;
1442
- this.cdRef = cdRef;
1443
- this.ui = ui;
1444
- // Validators are added by set validators function
1445
- this.form = new forms.FormGroup({
1446
- password: new forms.FormControl('', []),
1447
- passwordConfirm: new forms.FormControl('', [])
1448
- });
1449
- this.autocomplete = 'current-password';
1450
- this._forUpdate = false;
1451
- this.isDisabled = false;
1452
- this.destroy$ = new rxjs.Subject();
1453
- this.propogateChange = function (val) { };
1454
- this.propogateTouch = function () { };
1455
- this.propogateValidationChange = function () { };
1456
- this.setValidators();
1457
- this.form.controls.password.valueChanges
1458
- .pipe(operators.takeUntil(this.destroy$))
1459
- .subscribe(function (val) {
1460
- try {
1461
- _this.form.controls.passwordConfirm.updateValueAndValidity();
1462
- _this.propogateChange(val);
1463
- }
1464
- catch (error) {
1465
- _this.ui.logError(error);
1466
- }
1467
- });
1468
- this.form.statusChanges
1469
- .pipe(operators.takeUntil(this.destroy$))
1470
- .subscribe(function (_) {
1471
- try {
1472
- _this.propogateValidationChange();
1473
- }
1474
- catch (error) {
1475
- _this.ui.logError(error);
1476
- }
1477
- });
1478
- }
1479
- Object.defineProperty(AuthUIPasswordFieldComponent.prototype, "forUpdate", {
1480
- get: function () {
1481
- return this._forUpdate;
1482
- },
1483
- set: function (val) {
1484
- this._forUpdate = val;
1485
- this.setValidators();
1486
- if (val) {
1487
- this.autocomplete = 'new-password';
1488
- }
1489
- else {
1490
- this.autocomplete = 'current-password';
1491
- }
1492
- },
1493
- enumerable: false,
1494
- configurable: true
1495
- });
1496
- Object.defineProperty(AuthUIPasswordFieldComponent.prototype, "value", {
1497
- get: function () {
1498
- return this.form.controls.password.value;
1499
- },
1500
- set: function (val) {
1501
- if (val) {
1502
- this.form.patchValue({
1503
- password: val,
1504
- passwordConfirm: val
1505
- });
1506
- }
1507
- else {
1508
- this.form.reset();
1509
- }
1510
- },
1511
- enumerable: false,
1512
- configurable: true
1513
- });
1514
- AuthUIPasswordFieldComponent.prototype.ngOnDestroy = function () {
1515
- this.destroy$.next();
1516
- this.destroy$.complete();
1517
- };
1518
- AuthUIPasswordFieldComponent.prototype.ngAfterViewInit = function () {
1519
- this.parentControl = this.injector.get(forms.NgControl, null);
1520
- this.setValidators();
1521
- this.cdRef.detectChanges();
1522
- };
1523
- // Form Accessor functions
1524
- AuthUIPasswordFieldComponent.prototype.registerOnChange = function (fn) { this.propogateChange = fn; };
1525
- AuthUIPasswordFieldComponent.prototype.registerOnTouched = function (fn) { this.propogateTouch = fn; };
1526
- AuthUIPasswordFieldComponent.prototype.registerOnValidatorChange = function (fn) { this.propogateValidationChange = fn; };
1527
- AuthUIPasswordFieldComponent.prototype.writeValue = function (val) { this.value = val; };
1528
- AuthUIPasswordFieldComponent.prototype.setDisabledState = function (isDisabled) { this.isDisabled = isDisabled; };
1529
- AuthUIPasswordFieldComponent.prototype.validate = function (control) {
1530
- if (this.form.controls.password.errors || this.form.controls.passwordConfirm.errors) {
1531
- return Object.assign(this.form.controls.password.errors || {}, this.form.controls.passwordConfirm.errors || {});
1532
- }
1533
- else {
1534
- return null;
1535
- }
1536
- };
1537
- AuthUIPasswordFieldComponent.prototype.setValidators = function () {
1538
- if (this.forUpdate) {
1539
- this.form.controls.password.setValidators([
1540
- forms.Validators.maxLength(this.config.authUi.passwordMaxLength),
1541
- forms.Validators.minLength(this.config.authUi.passwordMinLength),
1542
- passwordStrengthValidator(this.config.authUi)
1543
- ]);
1544
- this.form.controls.passwordConfirm.setValidators([
1545
- confirmPasswordValidator
1546
- ]);
1547
- }
1548
- else {
1549
- this.form.controls.password.setValidators([]);
1550
- this.form.controls.passwordConfirm.setValidators([]);
1551
- }
1552
- this.form.controls.password.updateValueAndValidity();
1553
- this.form.controls.passwordConfirm.updateValueAndValidity();
1554
- };
1555
- return AuthUIPasswordFieldComponent;
1556
- }());
1557
- AuthUIPasswordFieldComponent.decorators = [
1558
- { type: core.Component, args: [{
1559
- selector: 'mal-authui-password-field',
1560
- template: "<form name=\"form\" [formGroup]=\"form\">\n <mal-authui-form-field [control]=\"parentControl\"\n label=\"auth.password.label\"\n [hintEnd]=\"form.value.password?.length || 0 + ' / ' + config.authUi.passwordMaxLength\"\n errorPrefix=\"auth.password.errors\">\n\n <ion-input (onBlur)=\"propogateTouch()\"\n [maxlength]=\"config.authUi.passwordMaxLength\"\n [minlength]=\"config.authUi.passwordMinLength\"\n [placeholder]=\"'auth.password.placeholder' | translate\"\n formControlName=\"password\"\n color=\"text\"\n type=\"password\"\n [autocomplete]=\"autocomplete\">\n </ion-input>\n\n </mal-authui-form-field>\n\n <mal-authui-form-field *ngIf=\"forUpdate\"\n label=\"auth.password.confirmLabel\"\n errorPrefix=\"auth.password.errors\">\n\n <ion-input (onBlur)=\"propogateTouch()\"\n [placeholder]=\"'auth.password.confirmPlaceholder' | translate\"\n formControlName=\"passwordConfirm\"\n color=\"text\"\n type=\"password\">\n </ion-input>\n\n </mal-authui-form-field>\n</form>\n\n<!-- TODO <mat-pass-toggle-visibility #toggle matSuffix></mat-pass-toggle-visibility> -->\n<!-- TODO <mat-password-strength #passwordStrength\n [customValidator]=\"customValidator\"\n [enableDigitRule]=\"enableDigitRule\"\n [enableLengthRule]=\"enableLengthRule\"\n [enableLowerCaseLetterRule]=\"enableLowerCaseLetterRule\"\n [enableSpecialCharRule]=\"enableSpecialCharRule\"\n [enableUpperCaseLetterRule]=\"enableUpperCaseLetterRule\"\n [externalError]=\"signUpFormGroup.controls.password.dirty\"\n [max]=\"max\"\n [min]=\"min\"\n [password]=\"signUpFormGroup.value.password\">\n </mat-password-strength> -->",
1561
- providers: [
1562
- { provide: forms.NG_VALUE_ACCESSOR, useExisting: core.forwardRef(function () { return AuthUIPasswordFieldComponent; }), multi: true },
1563
- { provide: forms.NG_VALIDATORS, useExisting: AuthUIPasswordFieldComponent, multi: true }
1564
- ],
1565
- styles: ["div.authui-logo{margin:32px auto;width:30%}div.authui-logo img{display:block;max-width:120px;border-radius:20px;margin-left:auto;margin-right:auto}div.authui-title{font-size:20px;margin:16px 0}div.authui-alternate-action{margin:32px auto 24px;font-weight:500}div.authui-alternate-action .text{margin-right:8px}ion-content.auth-page{--background:var(--auth-pages-background,--background)}div.resend-confirmation{margin:24px 0;font-size:.9em;text-align:center}ion-button.authui-provider-button{width:220px;margin:8px auto;display:block;text-align:center;--background:var(--auth-provider-background-color,#fff)}@media screen and (max-width:599px){ion-button.authui-provider-button{width:100%}}ion-button.authui-submit-button{width:220px;margin:16px auto;display:block}@media screen and (max-width:599px){ion-button.authui-submit-button{width:100%}}ion-grid.terms{width:100%;margin:24px 0;text-align:left;font-size:.9em}ion-grid.terms ion-col ion-row a{font-size:16px;margin-left:4px}div.forgot-password{margin:24px 0;font-size:.9em}@media (prefers-color-scheme:dark){a{color:#fff}}div.auth-ui-form{width:384px;max-width:384px;padding:32px;text-align:center;flex:1 0 auto}@media screen and (max-width:599px){div.auth-ui-form{padding:24px;width:100%}}div.auth-ui-form form{width:100%;text-align:left}div.authui-wrapper{width:100%;background-size:cover;flex:1 0 auto;padding:32px}@media screen and (max-width:599px){div.authui-wrapper{padding:16px}}button.confirm:disabled{color:grey}div.email-popover-outer{width:100%}div.email-popover-outer div.email-popover-inner{padding:10%}"]
1566
- },] }
1567
- ];
1568
- AuthUIPasswordFieldComponent.ctorParameters = function () { return [
1569
- { type: undefined, decorators: [{ type: core.Inject, args: [core.forwardRef(function () { return ngxFirebase.MalSharedConfigToken; }),] }] },
1570
- { type: core.Injector },
1571
- { type: core.ChangeDetectorRef },
1572
- { type: ngxFirebase.UiService }
1573
- ]; };
1574
- AuthUIPasswordFieldComponent.propDecorators = {
1575
- forUpdate: [{ type: core.Input }],
1576
- value: [{ type: core.Input }]
1577
- };
1578
-
1579
- var AuthRegisterPage = /** @class */ (function () {
1580
- function AuthRegisterPage(ui, fire, activatedRoute, navController, config) {
1581
- this.ui = ui;
1582
- this.fire = fire;
1583
- this.activatedRoute = activatedRoute;
1584
- this.navController = navController;
1585
- this.config = config;
1586
- this.logoUrl = this.config.authUi.logoUrl;
1587
- }
1588
- AuthRegisterPage.prototype.ngOnInit = function () {
1589
- this.fire.setScreenName('register', 'AuthRegisterPage');
1590
- };
1591
- AuthRegisterPage.prototype.doSuccess = function () {
1592
- try {
1593
- var redirectUrl = this.activatedRoute.snapshot.queryParamMap.get('redirectUrl');
1594
- if (redirectUrl) {
1595
- console.log('Redirecting logged in user to>', redirectUrl);
1596
- this.navController.navigateRoot(redirectUrl);
1597
- }
1598
- else {
1599
- this.navController.navigateRoot(['/']);
1600
- }
1601
- }
1602
- catch (error) {
1603
- this.ui.logError(error);
1604
- }
1605
- };
1606
- AuthRegisterPage.prototype.doLoginRequested = function () {
1607
- try {
1608
- this.navController.navigateRoot(['/auth', 'signin'], { queryParams: { redirectUrl: this.activatedRoute.snapshot.queryParamMap.get('redirectUrl') } });
1609
- }
1610
- catch (error) {
1611
- this.ui.logError(error);
1612
- }
1613
- };
1614
- return AuthRegisterPage;
1615
- }());
1616
- AuthRegisterPage.decorators = [
1617
- { type: core.Component, args: [{
1618
- template: "<ion-header>\r\n <ion-toolbar class=\"box-shadow\" color=\"toolbar\">\r\n <ion-buttons slot=\"start\">\r\n <ion-back-button defaultHref=\"/\"></ion-back-button>\r\n </ion-buttons>\r\n <ion-title>{{ \"auth.register.pageTitle\" | translate }}</ion-title>\r\n </ion-toolbar>\r\n</ion-header>\r\n\r\n<ion-content [fullscreen]=\"true\" class=\"auth-page\">\r\n <div fxLayout=\"column\" fxLayoutAlign=\"center center\" id=\"register-page-wrapper\">\r\n\r\n <div *ngIf=\"logoUrl\" class=\"authui-logo\">\r\n <img [@animate]=\"{ value: '*', params: { x: '50px' } }\" [src]=\"logoUrl\" alt=\"logo\">\r\n </div>\r\n\r\n <mal-authui-register (onSuccess)=\"doSuccess()\" (onLoginRequested)=\"doLoginRequested()\">\r\n </mal-authui-register>\r\n\r\n </div>\r\n</ion-content>",
1619
- animations: NgxAuthFirebaseuiAnimations,
1620
- styles: ["div.authui-logo{margin:32px auto;width:30%}div.authui-logo img{display:block;max-width:120px;border-radius:20px;margin-left:auto;margin-right:auto}div.authui-title{font-size:20px;margin:16px 0}div.authui-alternate-action{margin:32px auto 24px;font-weight:500}div.authui-alternate-action .text{margin-right:8px}ion-content.auth-page{--background:var(--auth-pages-background,--background)}div.resend-confirmation{margin:24px 0;font-size:.9em;text-align:center}ion-button.authui-provider-button{width:220px;margin:8px auto;display:block;text-align:center;--background:var(--auth-provider-background-color,#fff)}@media screen and (max-width:599px){ion-button.authui-provider-button{width:100%}}ion-button.authui-submit-button{width:220px;margin:16px auto;display:block}@media screen and (max-width:599px){ion-button.authui-submit-button{width:100%}}ion-grid.terms{width:100%;margin:24px 0;text-align:left;font-size:.9em}ion-grid.terms ion-col ion-row a{font-size:16px;margin-left:4px}div.forgot-password{margin:24px 0;font-size:.9em}@media (prefers-color-scheme:dark){a{color:#fff}}div.auth-ui-form{width:384px;max-width:384px;padding:32px;text-align:center;flex:1 0 auto}@media screen and (max-width:599px){div.auth-ui-form{padding:24px;width:100%}}div.auth-ui-form form{width:100%;text-align:left}div.authui-wrapper{width:100%;background-size:cover;flex:1 0 auto;padding:32px}@media screen and (max-width:599px){div.authui-wrapper{padding:16px}}button.confirm:disabled{color:grey}div.email-popover-outer{width:100%}div.email-popover-outer div.email-popover-inner{padding:10%}"]
1621
- },] }
1622
- ];
1623
- AuthRegisterPage.ctorParameters = function () { return [
1624
- { type: ngxFirebase.UiService },
1625
- { type: ngxFirebase.FirebaseService },
1626
- { type: router.ActivatedRoute },
1627
- { type: angular.NavController },
1628
- { type: undefined, decorators: [{ type: core.Inject, args: [core.forwardRef(function () { return ngxFirebase.MalSharedConfigToken; }),] }] }
1629
- ]; };
1630
-
1631
- var AuthSignInPage = /** @class */ (function () {
1632
- function AuthSignInPage(activatedRoute, aps, navController, ui, fire, config) {
1633
- this.activatedRoute = activatedRoute;
1634
- this.aps = aps;
1635
- this.navController = navController;
1636
- this.ui = ui;
1637
- this.fire = fire;
1638
- this.config = config;
1639
- this.logoUrl = this.config.authUi.logoUrl;
1640
- }
1641
- AuthSignInPage.prototype.ngOnInit = function () {
1642
- this.fire.setScreenName('signin', 'AuthSignInPage');
1643
- };
1644
- AuthSignInPage.prototype.doSuccess = function (e) {
1645
- var _a;
1646
- return __awaiter(this, void 0, void 0, function () {
1647
- var redirectUrl, forOperation, _b, error_1;
1648
- return __generator(this, function (_c) {
1649
- switch (_c.label) {
1650
- case 0:
1651
- redirectUrl = this.activatedRoute.snapshot.queryParamMap.get('redirectUrl');
1652
- forOperation = this.activatedRoute.snapshot.queryParamMap.get('forOperation');
1653
- if (!redirectUrl) return [3 /*break*/, 2];
1654
- // Ridirect to page on SignIn
1655
- this.fire.addLogMessage("Redirecting logged in user to> " + redirectUrl);
1656
- return [4 /*yield*/, this.navController.navigateRoot(redirectUrl)];
1657
- case 1:
1658
- _c.sent();
1659
- return [3 /*break*/, 13];
1660
- case 2:
1661
- _c.trys.push([2, 10, 11, 13]);
1662
- _b = forOperation;
1663
- switch (_b) {
1664
- case 'deleteUser': return [3 /*break*/, 3];
1665
- case undefined: return [3 /*break*/, 7];
1666
- case null: return [3 /*break*/, 7];
1667
- }
1668
- return [3 /*break*/, 8];
1669
- case 3: return [4 /*yield*/, this.ui.yesNoAlert('auth.user.message.confirmDelete', { interpolateParams: { userName: (_a = this.aps.user) === null || _a === void 0 ? void 0 : _a.displayName } })];
1670
- case 4:
1671
- if (!_c.sent()) return [3 /*break*/, 6];
1672
- return [4 /*yield*/, this.aps.deleteUser()];
1673
- case 5:
1674
- _c.sent();
1675
- _c.label = 6;
1676
- case 6: return [3 /*break*/, 9];
1677
- case 7: return [3 /*break*/, 9];
1678
- case 8: throw new Error("Unknown forOperation: " + forOperation);
1679
- case 9: return [3 /*break*/, 13];
1680
- case 10:
1681
- error_1 = _c.sent();
1682
- this.ui.logError(error_1);
1683
- return [3 /*break*/, 13];
1684
- case 11: return [4 /*yield*/, this.navController.navigateRoot(this.config.authUi.authGuardLoggedInURL)];
1685
- case 12:
1686
- _c.sent();
1687
- return [7 /*endfinally*/];
1688
- case 13: return [2 /*return*/];
1689
- }
1690
- });
1691
- });
1692
- };
1693
- AuthSignInPage.prototype.doCreateAccountRequested = function () {
1694
- try {
1695
- return this.navController.navigateRoot(['/auth', 'register'], { queryParams: { redirectUrl: this.activatedRoute.snapshot.queryParamMap.get('redirectUrl') } });
1696
- }
1697
- catch (error) {
1698
- this.ui.logError(error);
1699
- }
1700
- };
1701
- return AuthSignInPage;
1702
- }());
1703
- AuthSignInPage.decorators = [
1704
- { type: core.Component, args: [{
1705
- template: "<ion-header>\r\n <ion-toolbar class=\"box-shadow\" color=\"toolbar\">\r\n <ion-buttons slot=\"start\">\r\n <ion-back-button defaultHref=\"/\"></ion-back-button>\r\n </ion-buttons>\r\n <ion-title id=\"auth_signin_title\">{{ \"auth.signIn.pageTitle\" | translate }}</ion-title>\r\n </ion-toolbar>\r\n</ion-header>\r\n\r\n<ion-content [fullscreen]=\"true\" class=\"auth-page\">\r\n <div fxLayout=\"column\" fxLayoutAlign=\"center center\" id=\"register-wrapper\" class=\"authui-wrapper\">\r\n\r\n <div *ngIf=\"logoUrl\" class=\"authui-logo\">\r\n <img [@animate]=\"{ value: '*', params: { x: '50px' } }\" [src]=\"logoUrl\" alt=\"logo\">\r\n </div>\r\n\r\n <mal-authui-signin (onCreateAccountRequested)=\"doCreateAccountRequested()\" (onSuccess)=\"doSuccess($event)\"\r\n [providers]=\"['google', 'apple', 'facebook']\"></mal-authui-signin>\r\n\r\n </div>\r\n</ion-content>",
1706
- animations: NgxAuthFirebaseuiAnimations,
1707
- styles: ["div.authui-logo{margin:32px auto;width:30%}div.authui-logo img{display:block;max-width:120px;border-radius:20px;margin-left:auto;margin-right:auto}div.authui-title{font-size:20px;margin:16px 0}div.authui-alternate-action{margin:32px auto 24px;font-weight:500}div.authui-alternate-action .text{margin-right:8px}ion-content.auth-page{--background:var(--auth-pages-background,--background)}div.resend-confirmation{margin:24px 0;font-size:.9em;text-align:center}ion-button.authui-provider-button{width:220px;margin:8px auto;display:block;text-align:center;--background:var(--auth-provider-background-color,#fff)}@media screen and (max-width:599px){ion-button.authui-provider-button{width:100%}}ion-button.authui-submit-button{width:220px;margin:16px auto;display:block}@media screen and (max-width:599px){ion-button.authui-submit-button{width:100%}}ion-grid.terms{width:100%;margin:24px 0;text-align:left;font-size:.9em}ion-grid.terms ion-col ion-row a{font-size:16px;margin-left:4px}div.forgot-password{margin:24px 0;font-size:.9em}@media (prefers-color-scheme:dark){a{color:#fff}}div.auth-ui-form{width:384px;max-width:384px;padding:32px;text-align:center;flex:1 0 auto}@media screen and (max-width:599px){div.auth-ui-form{padding:24px;width:100%}}div.auth-ui-form form{width:100%;text-align:left}div.authui-wrapper{width:100%;background-size:cover;flex:1 0 auto;padding:32px}@media screen and (max-width:599px){div.authui-wrapper{padding:16px}}button.confirm:disabled{color:grey}div.email-popover-outer{width:100%}div.email-popover-outer div.email-popover-inner{padding:10%}"]
1708
- },] }
1709
- ];
1710
- AuthSignInPage.ctorParameters = function () { return [
1711
- { type: router.ActivatedRoute },
1712
- { type: ngxFirebase.AuthProcessService },
1713
- { type: angular.NavController },
1714
- { type: ngxFirebase.UiService },
1715
- { type: ngxFirebase.FirebaseService },
1716
- { type: undefined, decorators: [{ type: core.Inject, args: [core.forwardRef(function () { return ngxFirebase.MalSharedConfigToken; }),] }] }
1717
- ]; };
1718
-
1719
- var AuthUserPage = /** @class */ (function () {
1720
- function AuthUserPage() {
1721
- }
1722
- return AuthUserPage;
1723
- }());
1724
- AuthUserPage.decorators = [
1725
- { type: core.Component, args: [{
1726
- template: "<!-- Header -->\r\n<ion-header>\r\n <ion-toolbar class=\"box-shadow\">\r\n <ion-buttons slot=\"start\">\r\n <ion-back-button defaultHref=\"/\"></ion-back-button>\r\n </ion-buttons>\r\n <ion-title class=\"ion-text-uppercase\">{{ \"auth.user.title\" | translate }}</ion-title>\r\n </ion-toolbar>\r\n</ion-header>\r\n<!-- Content -->\r\n<ion-content>\r\n <mal-authui-user></mal-authui-user>\r\n</ion-content>"
1727
- },] }
1728
- ];
1729
- AuthUserPage.ctorParameters = function () { return []; };
1730
-
1731
- var AuthVerifyEmailPage = /** @class */ (function () {
1732
- function AuthVerifyEmailPage(ui, fire, aps, route, navCtrl, config) {
1733
- var _a;
1734
- this.ui = ui;
1735
- this.fire = fire;
1736
- this.aps = aps;
1737
- this.route = route;
1738
- this.navCtrl = navCtrl;
1739
- this.config = config;
1740
- this.backgroundClass = ((_a = this.config) === null || _a === void 0 ? void 0 : _a.authUi.verifyEmailBackground) || '';
1741
- this.destroy$ = new rxjs.Subject();
1742
- }
1743
- AuthVerifyEmailPage.prototype.ngOnInit = function () {
1744
- var _this = this;
1745
- this.fire.setScreenName('verifyemail', 'VerifyEmailPage');
1746
- this.aps.user$.pipe(operators.takeUntil(this.destroy$)).subscribe(function (user) {
1747
- try {
1748
- if (user && user.emailVerified) {
1749
- _this.doRetry();
1750
- }
1751
- }
1752
- catch (error) {
1753
- _this.ui.logError(error);
1754
- }
1755
- });
1756
- this.aps.onSignOutEmitter.pipe(operators.takeUntil(this.destroy$)).subscribe(function () {
1757
- try {
1758
- _this.navCtrl.navigateRoot(_this.config.authUi.authGuardFallbackURL || '/');
1759
- }
1760
- catch (error) {
1761
- _this.ui.logError(error);
1762
- }
1763
- });
1764
- };
1765
- AuthVerifyEmailPage.prototype.ngOnDestroy = function () {
1766
- this.destroy$.next();
1767
- this.destroy$.complete();
1768
- };
1769
- AuthVerifyEmailPage.prototype.doRetry = function () {
1770
- return __awaiter(this, void 0, void 0, function () {
1771
- var redirect, error_1;
1772
- return __generator(this, function (_b) {
1773
- switch (_b.label) {
1774
- case 0:
1775
- _b.trys.push([0, 2, , 3]);
1776
- return [4 /*yield*/, this.aps.reloadUserInfo()];
1777
- case 1:
1778
- _b.sent();
1779
- redirect = this.route.snapshot.queryParamMap.get('redirectUrl');
1780
- this.navCtrl.navigateRoot(redirect);
1781
- return [3 /*break*/, 3];
1782
- case 2:
1783
- error_1 = _b.sent();
1784
- this.ui.logError(error_1);
1785
- return [3 /*break*/, 3];
1786
- case 3: return [2 /*return*/];
1787
- }
1788
- });
1789
- });
1790
- };
1791
- AuthVerifyEmailPage.prototype.doResendVerification = function () {
1792
- return __awaiter(this, void 0, void 0, function () {
1793
- var error_2;
1794
- return __generator(this, function (_b) {
1795
- switch (_b.label) {
1796
- case 0:
1797
- _b.trys.push([0, 3, , 4]);
1798
- return [4 /*yield*/, this.aps.sendNewVerificationEmail()];
1799
- case 1:
1800
- _b.sent();
1801
- return [4 /*yield*/, this.ui.toast('auth.emailConfirmation.onConfirmationSuccess')];
1802
- case 2:
1803
- _b.sent();
1804
- return [3 /*break*/, 4];
1805
- case 3:
1806
- error_2 = _b.sent();
1807
- this.ui.logError(error_2);
1808
- return [3 /*break*/, 4];
1809
- case 4: return [2 /*return*/];
1810
- }
1811
- });
1812
- });
1813
- };
1814
- return AuthVerifyEmailPage;
1815
- }());
1816
- AuthVerifyEmailPage.decorators = [
1817
- { type: core.Component, args: [{
1818
- template: "<ion-header>\n <ion-toolbar color=\"toolbar\">\n <ion-title>\n {{ \"auth.emailConfirmation.pageTitle\" | translate }}\n </ion-title>\n <ion-buttons slot=\"start\">\n </ion-buttons>\n <ion-buttons slot=\"end\">\n <mal-auth-avatar></mal-auth-avatar>\n </ion-buttons>\n </ion-toolbar>\n</ion-header>\n\n<ion-content [fullscreen]=\"true\" [class]=\"backgroundClass\">\n <div class=\"message-area\">\n <h2>{{ \"auth.emailConfirmation.title\" | translate }}</h2>\n <ion-text [innerHtml]=\"'auth.emailConfirmation.bodyHtml' | translate\"></ion-text>\n <div class=\"resend-confirmation\">\n <a (click)=\"doResendVerification()\">{{ \"auth.emailConfirmation.sendNewVerificationEmail\" | translate }}</a>\n </div>\n <ion-button expand=\"block\" (click)=\"doRetry()\">{{ \"auth.emailConfirmation.refreshStatus\" | translate }}</ion-button>\n </div>\n</ion-content>",
1819
- styles: ["div.authui-logo{margin:32px auto;width:30%}div.authui-logo img{display:block;max-width:120px;border-radius:20px;margin-left:auto;margin-right:auto}div.authui-title{font-size:20px;margin:16px 0}div.authui-alternate-action{margin:32px auto 24px;font-weight:500}div.authui-alternate-action .text{margin-right:8px}ion-content.auth-page{--background:var(--auth-pages-background,--background)}div.resend-confirmation{margin:24px 0;font-size:.9em;text-align:center}ion-button.authui-provider-button{width:220px;margin:8px auto;display:block;text-align:center;--background:var(--auth-provider-background-color,#fff)}@media screen and (max-width:599px){ion-button.authui-provider-button{width:100%}}ion-button.authui-submit-button{width:220px;margin:16px auto;display:block}@media screen and (max-width:599px){ion-button.authui-submit-button{width:100%}}ion-grid.terms{width:100%;margin:24px 0;text-align:left;font-size:.9em}ion-grid.terms ion-col ion-row a{font-size:16px;margin-left:4px}div.forgot-password{margin:24px 0;font-size:.9em}@media (prefers-color-scheme:dark){a{color:#fff}}div.auth-ui-form{width:384px;max-width:384px;padding:32px;text-align:center;flex:1 0 auto}@media screen and (max-width:599px){div.auth-ui-form{padding:24px;width:100%}}div.auth-ui-form form{width:100%;text-align:left}div.authui-wrapper{width:100%;background-size:cover;flex:1 0 auto;padding:32px}@media screen and (max-width:599px){div.authui-wrapper{padding:16px}}button.confirm:disabled{color:grey}div.email-popover-outer{width:100%}div.email-popover-outer div.email-popover-inner{padding:10%}"]
1820
- },] }
1821
- ];
1822
- AuthVerifyEmailPage.ctorParameters = function () { return [
1823
- { type: ngxFirebase.UiService },
1824
- { type: ngxFirebase.FirebaseService },
1825
- { type: ngxFirebase.AuthProcessService },
1826
- { type: router.ActivatedRoute },
1827
- { type: angular.NavController },
1828
- { type: undefined, decorators: [{ type: core.Inject, args: [core.forwardRef(function () { return ngxFirebase.MalSharedConfigToken; }),] }] }
1829
- ]; };
1830
-
1831
- // Angular & Inionc
1832
- var AuthUITermsFieldComponent = /** @class */ (function () {
1833
- // tslint:disable-next-line @typescript-eslint/ban-types
1834
- function AuthUITermsFieldComponent(config, aps, ui) {
1835
- var _this = this;
1836
- this.config = config;
1837
- this.aps = aps;
1838
- this.ui = ui;
1839
- this.termsForm = new forms.FormGroup({
1840
- tos: new forms.FormControl(true, []),
1841
- privacyPolicy: new forms.FormControl(true, [])
1842
- });
1843
- // Config
1844
- this.tosUrl = this.config.authUi.tosUrl;
1845
- this.privacyPolicyUrl = this.config.authUi.privacyPolicyUrl;
1846
- // Private
1847
- this.destroy$ = new rxjs.Subject();
1848
- this.propogateChange = function (val) { };
1849
- this.propogateTouch = function () { };
1850
- this.propogateValidationChange = function () { };
1851
- this.termsForm.statusChanges
1852
- .pipe(operators.takeUntil(this.destroy$))
1853
- .subscribe(function (_) {
1854
- try {
1855
- _this.propogateValidationChange();
1856
- }
1857
- catch (error) {
1858
- _this.ui.logError(error);
1859
- }
1860
- });
1861
- }
1862
- Object.defineProperty(AuthUITermsFieldComponent.prototype, "value", {
1863
- get: function () {
1864
- return this.termsForm.controls.tos.value && this.termsForm.controls.privacyPolicy.value;
1865
- },
1866
- set: function (val) {
1867
- if (val) {
1868
- this.termsForm.patchValue({
1869
- tos: val,
1870
- privacyPolicy: val
1871
- });
1872
- }
1873
- else {
1874
- this.termsForm.reset();
1875
- }
1876
- },
1877
- enumerable: false,
1878
- configurable: true
1879
- });
1880
- // Form Accessor functions
1881
- AuthUITermsFieldComponent.prototype.registerOnChange = function (fn) { this.propogateChange = fn; };
1882
- AuthUITermsFieldComponent.prototype.registerOnTouched = function (fn) { this.propogateTouch = fn; };
1883
- AuthUITermsFieldComponent.prototype.registerOnValidatorChange = function (fn) { this.propogateValidationChange = fn; };
1884
- AuthUITermsFieldComponent.prototype.writeValue = function (val) { this.value = val; };
1885
- AuthUITermsFieldComponent.prototype.validate = function (control) {
1886
- if (this.termsForm.controls.tos.errors || this.termsForm.controls.privacyPolicy.errors) {
1887
- return Object.assign(this.termsForm.controls.tos.errors || {}, this.termsForm.controls.privacyPolicy.errors || {});
1888
- }
1889
- else {
1890
- return null;
1891
- }
1892
- };
1893
- AuthUITermsFieldComponent.prototype.ngOnInit = function () {
1894
- // If tos or privacy policy url set, ensure that the two form items are required
1895
- if (this.config.authUi.tosUrl) {
1896
- this.termsForm.controls.tos.setValidators(forms.Validators.requiredTrue);
1897
- }
1898
- if (this.config.authUi.privacyPolicyUrl) {
1899
- this.termsForm.controls.privacyPolicy.setValidators(forms.Validators.requiredTrue);
1900
- }
1901
- this.termsForm.updateValueAndValidity();
1902
- };
1903
- AuthUITermsFieldComponent.prototype.ngOnDestroy = function () {
1904
- this.destroy$.next();
1905
- this.destroy$.complete();
1906
- };
1907
- return AuthUITermsFieldComponent;
1908
- }());
1909
- AuthUITermsFieldComponent.decorators = [
1910
- { type: core.Component, args: [{
1911
- selector: 'mal-authui-terms-field',
1912
- template: "<form [formGroup]=\"termsForm\">\n <ion-grid class=\"terms\">\n <ion-row *ngIf=\"this.tosUrl\">\n <ion-col size=\"2\">\n <ion-checkbox color=\"primary\" attr.aria-label=\"{{ 'auth.legal.readAndAccept' | translate }} {{ 'auth.legal.termsAndConditions'\n | translate }}\" formControlName=\"tos\"> </ion-checkbox>\n </ion-col>\n <ion-col>\n <ion-text color=\"text\"> {{ \"auth.legal.readAndAccept\" | translate }}</ion-text>\n <a target=\"_blank\" [href]=\"this.tosUrl\">\n {{ \"auth.legal.termsAndConditions\" | translate }}\n </a>\n </ion-col>\n </ion-row>\n <ion-row *ngIf=\"this.privacyPolicyUrl\">\n <ion-col size=\"2\">\n <ion-checkbox color=\"primary\" attr.aria-label=\"{{ 'auth.legal.readAndAccept' | translate }} {{ 'auth.legal.privacyPolicy'\n | translate }}\" formControlName=\"privacyPolicy\"></ion-checkbox>\n </ion-col>\n <ion-col>\n <ion-text color=\"text\">{{ \"auth.legal.readAndAccept\" | translate }}</ion-text>\n <a target=\"_blank\" [href]=\"this.privacyPolicyUrl\">\n {{ \"auth.legal.privacyPolicy\" | translate }}\n </a>\n </ion-col>\n </ion-row>\n </ion-grid>\n</form>",
1913
- providers: [
1914
- { provide: forms.NG_VALUE_ACCESSOR, useExisting: core.forwardRef(function () { return AuthUITermsFieldComponent; }), multi: true },
1915
- { provide: forms.NG_VALIDATORS, useExisting: AuthUITermsFieldComponent, multi: true }
1916
- ],
1917
- styles: ["div.authui-logo{margin:32px auto;width:30%}div.authui-logo img{display:block;max-width:120px;border-radius:20px;margin-left:auto;margin-right:auto}div.authui-title{font-size:20px;margin:16px 0}div.authui-alternate-action{margin:32px auto 24px;font-weight:500}div.authui-alternate-action .text{margin-right:8px}ion-content.auth-page{--background:var(--auth-pages-background,--background)}div.resend-confirmation{margin:24px 0;font-size:.9em;text-align:center}ion-button.authui-provider-button{width:220px;margin:8px auto;display:block;text-align:center;--background:var(--auth-provider-background-color,#fff)}@media screen and (max-width:599px){ion-button.authui-provider-button{width:100%}}ion-button.authui-submit-button{width:220px;margin:16px auto;display:block}@media screen and (max-width:599px){ion-button.authui-submit-button{width:100%}}ion-grid.terms{width:100%;margin:24px 0;text-align:left;font-size:.9em}ion-grid.terms ion-col ion-row a{font-size:16px;margin-left:4px}div.forgot-password{margin:24px 0;font-size:.9em}@media (prefers-color-scheme:dark){a{color:#fff}}div.auth-ui-form{width:384px;max-width:384px;padding:32px;text-align:center;flex:1 0 auto}@media screen and (max-width:599px){div.auth-ui-form{padding:24px;width:100%}}div.auth-ui-form form{width:100%;text-align:left}div.authui-wrapper{width:100%;background-size:cover;flex:1 0 auto;padding:32px}@media screen and (max-width:599px){div.authui-wrapper{padding:16px}}button.confirm:disabled{color:grey}div.email-popover-outer{width:100%}div.email-popover-outer div.email-popover-inner{padding:10%}"]
1918
- },] }
1919
- ];
1920
- AuthUITermsFieldComponent.ctorParameters = function () { return [
1921
- { type: undefined, decorators: [{ type: core.Inject, args: [core.forwardRef(function () { return ngxFirebase.MalSharedConfigToken; }),] }] },
1922
- { type: ngxFirebase.AuthProcessService },
1923
- { type: ngxFirebase.UiService }
1924
- ]; };
1925
- AuthUITermsFieldComponent.propDecorators = {
1926
- value: [{ type: core.Input }]
1927
- };
1928
-
1929
- var AuthUIRegisterWithEmailComponent = /** @class */ (function () {
1930
- // tslint:disable-next-line @typescript-eslint/ban-types
1931
- function AuthUIRegisterWithEmailComponent(config, aps, ui, changeDetectorRef) {
1932
- this.config = config;
1933
- this.aps = aps;
1934
- this.ui = ui;
1935
- this.changeDetectorRef = changeDetectorRef;
1936
- this.createAccountClick = new core.EventEmitter();
1937
- this.registerForm = new forms.FormGroup({
1938
- name: new forms.FormControl('', [forms.Validators.required]),
1939
- email: new forms.FormControl('', [forms.Validators.required]),
1940
- password: new forms.FormControl('', [forms.Validators.required]),
1941
- terms: new forms.FormControl(true, []),
1942
- });
1943
- // Prevent somebody already logged in as guest - relogging in as gyest
1944
- this.guestEnabled$ = this.aps.canSignInAsGuest$;
1945
- // Private
1946
- this.destroy$ = new rxjs.Subject();
1947
- }
1948
- AuthUIRegisterWithEmailComponent.prototype.ngAfterViewInit = function () {
1949
- this.changeDetectorRef.detectChanges();
1950
- };
1951
- AuthUIRegisterWithEmailComponent.prototype.ngOnDestroy = function () {
1952
- this.destroy$.next();
1953
- this.destroy$.complete();
1954
- };
1955
- AuthUIRegisterWithEmailComponent.prototype.doCreateAccount = function () {
1956
- return __awaiter(this, void 0, void 0, function () {
1957
- return __generator(this, function (_a) {
1958
- this.createAccountClick.emit(this.registerForm.value);
1959
- return [2 /*return*/];
1960
- });
1961
- });
1962
- };
1963
- return AuthUIRegisterWithEmailComponent;
1964
- }());
1965
- AuthUIRegisterWithEmailComponent.decorators = [
1966
- { type: core.Component, args: [{
1967
- selector: 'mal-authui-register-with-email',
1968
- template: "<form [@animate]=\"{value:'*',params:{duration:'300ms',y:'100px'}}\"\n [formGroup]=\"registerForm\"\n novalidate>\n\n <mal-authui-name-field formControlName=\"name\"\n [@animate]=\"{ value: '*', params: { x: '50px' } }\">\n </mal-authui-name-field>\n\n <mal-authui-email-field formControlName=\"email\"\n [@animate]=\"{ value: '*', params: { x: '50px' } }\">\n </mal-authui-email-field>\n\n <mal-authui-password-field formControlName=\"password\"\n [forUpdate]=\"true\"\n [@animate]=\"{ value: '*', params: { x: '50px' } }\">\n </mal-authui-password-field>\n\n <mal-authui-terms-field formControlName=\"terms\"\n [@animate]=\"{ value: '*', params: { x: '50px' } }\">\n </mal-authui-terms-field>\n\n <ion-button (click)=\"doCreateAccount()\"\n color=\"primary\"\n [disabled]=\"registerForm.invalid\"\n aria-label=\"CREATE AN ACCOUNT\"\n class=\"authui-submit-button\"\n id=\"createAccountButton\">\n {{ \"auth.register.createAccountButton\" | translate }}\n </ion-button>\n\n</form>",
1969
- encapsulation: core.ViewEncapsulation.None,
1970
- animations: NgxAuthFirebaseuiAnimations,
1971
- styles: ["div.authui-logo{margin:32px auto;width:30%}div.authui-logo img{display:block;max-width:120px;border-radius:20px;margin-left:auto;margin-right:auto}div.authui-title{font-size:20px;margin:16px 0}div.authui-alternate-action{margin:32px auto 24px;font-weight:500}div.authui-alternate-action .text{margin-right:8px}ion-content.auth-page{--background:var(--auth-pages-background,--background)}div.resend-confirmation{margin:24px 0;font-size:.9em;text-align:center}ion-button.authui-provider-button{width:220px;margin:8px auto;display:block;text-align:center;--background:var(--auth-provider-background-color,#fff)}@media screen and (max-width:599px){ion-button.authui-provider-button{width:100%}}ion-button.authui-submit-button{width:220px;margin:16px auto;display:block}@media screen and (max-width:599px){ion-button.authui-submit-button{width:100%}}ion-grid.terms{width:100%;margin:24px 0;text-align:left;font-size:.9em}ion-grid.terms ion-col ion-row a{font-size:16px;margin-left:4px}div.forgot-password{margin:24px 0;font-size:.9em}@media (prefers-color-scheme:dark){a{color:#fff}}div.auth-ui-form{width:384px;max-width:384px;padding:32px;text-align:center;flex:1 0 auto}@media screen and (max-width:599px){div.auth-ui-form{padding:24px;width:100%}}div.auth-ui-form form{width:100%;text-align:left}div.authui-wrapper{width:100%;background-size:cover;flex:1 0 auto;padding:32px}@media screen and (max-width:599px){div.authui-wrapper{padding:16px}}button.confirm:disabled{color:grey}div.email-popover-outer{width:100%}div.email-popover-outer div.email-popover-inner{padding:10%}"]
1972
- },] }
1973
- ];
1974
- AuthUIRegisterWithEmailComponent.ctorParameters = function () { return [
1975
- { type: undefined, decorators: [{ type: core.Inject, args: [core.forwardRef(function () { return ngxFirebase.MalSharedConfigToken; }),] }] },
1976
- { type: ngxFirebase.AuthProcessService },
1977
- { type: ngxFirebase.UiService },
1978
- { type: core.ChangeDetectorRef }
1979
- ]; };
1980
- AuthUIRegisterWithEmailComponent.propDecorators = {
1981
- createAccountClick: [{ type: core.Output }]
1982
- };
1983
-
1984
- // Angular & Inionc
1985
- var AuthUIRegisterWithEmailPopoverComponent = /** @class */ (function () {
1986
- function AuthUIRegisterWithEmailPopoverComponent(popoverController) {
1987
- this.popoverController = popoverController;
1988
- }
1989
- AuthUIRegisterWithEmailPopoverComponent.prototype.doCreateAccountClick = function (data) {
1990
- this.popoverController.dismiss(data);
1991
- };
1992
- return AuthUIRegisterWithEmailPopoverComponent;
1993
- }());
1994
- AuthUIRegisterWithEmailPopoverComponent.decorators = [
1995
- { type: core.Component, args: [{
1996
- template: "<div class=\"email-popover-outer\">\n <div class=\"email-popover-inner\">\n <mal-authui-register-with-email (createAccountClick)=\"doCreateAccountClick($event)\">\n </mal-authui-register-with-email>\n </div>\n</div>",
1997
- encapsulation: core.ViewEncapsulation.None,
1998
- animations: NgxAuthFirebaseuiAnimations,
1999
- styles: ["div.authui-logo{margin:32px auto;width:30%}div.authui-logo img{display:block;max-width:120px;border-radius:20px;margin-left:auto;margin-right:auto}div.authui-title{font-size:20px;margin:16px 0}div.authui-alternate-action{margin:32px auto 24px;font-weight:500}div.authui-alternate-action .text{margin-right:8px}ion-content.auth-page{--background:var(--auth-pages-background,--background)}div.resend-confirmation{margin:24px 0;font-size:.9em;text-align:center}ion-button.authui-provider-button{width:220px;margin:8px auto;display:block;text-align:center;--background:var(--auth-provider-background-color,#fff)}@media screen and (max-width:599px){ion-button.authui-provider-button{width:100%}}ion-button.authui-submit-button{width:220px;margin:16px auto;display:block}@media screen and (max-width:599px){ion-button.authui-submit-button{width:100%}}ion-grid.terms{width:100%;margin:24px 0;text-align:left;font-size:.9em}ion-grid.terms ion-col ion-row a{font-size:16px;margin-left:4px}div.forgot-password{margin:24px 0;font-size:.9em}@media (prefers-color-scheme:dark){a{color:#fff}}div.auth-ui-form{width:384px;max-width:384px;padding:32px;text-align:center;flex:1 0 auto}@media screen and (max-width:599px){div.auth-ui-form{padding:24px;width:100%}}div.auth-ui-form form{width:100%;text-align:left}div.authui-wrapper{width:100%;background-size:cover;flex:1 0 auto;padding:32px}@media screen and (max-width:599px){div.authui-wrapper{padding:16px}}button.confirm:disabled{color:grey}div.email-popover-outer{width:100%}div.email-popover-outer div.email-popover-inner{padding:10%}"]
2000
- },] }
2001
- ];
2002
- AuthUIRegisterWithEmailPopoverComponent.ctorParameters = function () { return [
2003
- { type: angular.PopoverController }
2004
- ]; };
2005
-
2006
- var registerWithEmailPopover_component = /*#__PURE__*/Object.freeze({
2007
- __proto__: null,
2008
- AuthUIRegisterWithEmailPopoverComponent: AuthUIRegisterWithEmailPopoverComponent
2009
- });
2010
-
2011
- var COMPONENTS = [
2012
- AuthUIUserComponent,
2013
- EmailConfirmationComponent,
2014
- AuthUISignInComponent,
2015
- AuthUIRegisterComponent,
2016
- AuthUIReauthenticateComponent,
2017
- AuthSignInPage,
2018
- AuthRegisterPage,
2019
- AuthUserPage,
2020
- AuthVerifyEmailPage,
2021
- AuthUIPasswordFieldComponent,
2022
- AuthUIEmailFieldComponent,
2023
- AuthUINameFieldComponent,
2024
- AuthUIFormFieldComponent,
2025
- AuthUITermsFieldComponent,
2026
- AuthUIRegisterWithEmailComponent,
2027
- AuthUIRegisterWithEmailPopoverComponent,
2028
- AuthUIOrDividerComponent,
2029
- AuthProvidersComponent
2030
- ];
2031
- var IONIC_AUTH_UI_ROUTER_CONFIG = [
2032
- { path: 'signin', component: AuthSignInPage },
2033
- { path: 'register', component: AuthRegisterPage },
2034
- { path: 'user', component: AuthUserPage },
2035
- { path: 'verify', component: AuthVerifyEmailPage },
2036
- { path: '', pathMatch: 'full', redirectTo: 'signin' }
2037
- ];
2038
- var MalIonicAuthUiModule = /** @class */ (function () {
2039
- function MalIonicAuthUiModule() {
2040
- }
2041
- return MalIonicAuthUiModule;
2042
- }());
2043
- MalIonicAuthUiModule.decorators = [
2044
- { type: core.NgModule, args: [{
2045
- imports: [
2046
- ngxFirebase.MalSharedModule,
2047
- ionic.MalIonicModule,
2048
- angular.IonicModule,
2049
- common.CommonModule,
2050
- ionic4Tooltips.TooltipsModule,
2051
- http.HttpClientModule,
2052
- forms.FormsModule,
2053
- forms.ReactiveFormsModule,
2054
- flexLayout.FlexLayoutModule,
2055
- ],
2056
- exports: __spread(COMPONENTS, [
2057
- forms.FormsModule,
2058
- forms.ReactiveFormsModule,
2059
- flexLayout.FlexLayoutModule,
2060
- angular.IonicModule
2061
- ]),
2062
- declarations: COMPONENTS,
2063
- entryComponents: [
2064
- AuthUIUserComponent
2065
- ]
2066
- },] }
2067
- ];
2068
- // Guards
2069
- // Components
2070
- // services
2071
-
2072
- /**
2073
- * Generated bundle index. Do not edit.
2074
- */
2075
-
2076
- exports.AuthProvidersComponent = AuthProvidersComponent;
2077
- exports.AuthRegisterPage = AuthRegisterPage;
2078
- exports.AuthSignInPage = AuthSignInPage;
2079
- exports.AuthUIEmailFieldComponent = AuthUIEmailFieldComponent;
2080
- exports.AuthUIFormFieldComponent = AuthUIFormFieldComponent;
2081
- exports.AuthUINameFieldComponent = AuthUINameFieldComponent;
2082
- exports.AuthUIOrDividerComponent = AuthUIOrDividerComponent;
2083
- exports.AuthUIPasswordFieldComponent = AuthUIPasswordFieldComponent;
2084
- exports.AuthUIReauthenticateComponent = AuthUIReauthenticateComponent;
2085
- exports.AuthUIRegisterComponent = AuthUIRegisterComponent;
2086
- exports.AuthUISignInComponent = AuthUISignInComponent;
2087
- exports.AuthUIUserComponent = AuthUIUserComponent;
2088
- exports.AuthUserPage = AuthUserPage;
2089
- exports.AuthVerifyEmailPage = AuthVerifyEmailPage;
2090
- exports.EmailConfirmationComponent = EmailConfirmationComponent;
2091
- exports.IONIC_AUTH_UI_ROUTER_CONFIG = IONIC_AUTH_UI_ROUTER_CONFIG;
2092
- exports.MalIonicAuthUiModule = MalIonicAuthUiModule;
2093
- exports.NgxAuthFirebaseuiAnimations = NgxAuthFirebaseuiAnimations;
2094
- exports.ɵa = AuthSignInPage;
2095
- exports.ɵb = AuthRegisterPage;
2096
- exports.ɵc = AuthUserPage;
2097
- exports.ɵd = AuthVerifyEmailPage;
2098
- exports.ɵe = AuthUIUserComponent;
2099
- exports.ɵf = EmailConfirmationComponent;
2100
- exports.ɵg = AuthUISignInComponent;
2101
- exports.ɵh = AuthUIRegisterComponent;
2102
- exports.ɵi = AuthUIReauthenticateComponent;
2103
- exports.ɵj = AuthUIPasswordFieldComponent;
2104
- exports.ɵk = AuthUIEmailFieldComponent;
2105
- exports.ɵl = AuthUINameFieldComponent;
2106
- exports.ɵm = AuthUIFormFieldComponent;
2107
- exports.ɵn = AuthUITermsFieldComponent;
2108
- exports.ɵo = AuthUIRegisterWithEmailComponent;
2109
- exports.ɵp = AuthUIRegisterWithEmailPopoverComponent;
2110
- exports.ɵq = AuthUIOrDividerComponent;
2111
- exports.ɵr = AuthProvidersComponent;
2112
-
2113
- Object.defineProperty(exports, '__esModule', { value: true });
2114
-
2115
- })));
2116
- //# sourceMappingURL=ngx-firebase-ionic-auth-ui.umd.js.map