@flarehr/apollo-super-selection 1.3.54543 → 1.3.54544

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 (253) hide show
  1. package/dist/lib/apollo-super-selection/apollo-super-selection.css +1 -0
  2. package/dist/lib/apollo-super-selection/apollo-super-selection.esm.js +1 -0
  3. package/dist/lib/apollo-super-selection/apollo-super-selection.js +130 -0
  4. package/dist/lib/apollo-super-selection/assets/icon-exclamation.svg +3 -0
  5. package/dist/lib/apollo-super-selection/assets/icon-information-circle.svg +3 -0
  6. package/dist/lib/apollo-super-selection/index.esm.js +0 -0
  7. package/dist/lib/apollo-super-selection/p-02f24922.system.entry.js +1 -0
  8. package/dist/lib/apollo-super-selection/p-071b8545.entry.js +1 -0
  9. package/dist/lib/apollo-super-selection/p-0a384ec4.entry.js +14 -0
  10. package/dist/lib/apollo-super-selection/p-14885f78.system.js +15 -0
  11. package/dist/lib/apollo-super-selection/p-15f0e5eb.system.js +1 -0
  12. package/dist/lib/apollo-super-selection/p-23cfdd82.entry.js +1 -0
  13. package/dist/lib/apollo-super-selection/p-29c11183.js +15 -0
  14. package/dist/lib/apollo-super-selection/p-44bec843.system.js +1 -0
  15. package/dist/lib/apollo-super-selection/p-50ea2036.system.js +1 -0
  16. package/dist/lib/apollo-super-selection/p-51aefdb1.system.entry.js +1 -0
  17. package/dist/lib/apollo-super-selection/p-51c6dd08.js +1 -0
  18. package/dist/lib/apollo-super-selection/p-6ac8791e.system.entry.js +1 -0
  19. package/dist/lib/apollo-super-selection/p-7a89efaf.js +1 -0
  20. package/dist/lib/apollo-super-selection/p-80178f87.system.js +1 -0
  21. package/dist/lib/apollo-super-selection/p-86e3e03f.js +1 -0
  22. package/dist/lib/apollo-super-selection/p-9c855634.entry.js +1 -0
  23. package/dist/lib/apollo-super-selection/p-b2bb0763.system.entry.js +69 -0
  24. package/dist/lib/apollo-super-selection/p-b89b68db.entry.js +1 -0
  25. package/dist/lib/apollo-super-selection/p-bdcfc026.system.js +1 -0
  26. package/dist/lib/apollo-super-selection/p-ef3afa00.system.entry.js +1 -0
  27. package/dist/lib/apollo-super-selection/p-f29066b9.system.entry.js +1 -0
  28. package/dist/lib/apollo-super-selection/p-fcb4050d.entry.js +1 -0
  29. package/dist/lib/cjs/active-router-1f555f75.js +75 -0
  30. package/dist/lib/cjs/apollo-super-selection.cjs.js +22 -0
  31. package/dist/lib/cjs/app-globals-b1125d8c.js +25 -0
  32. package/dist/lib/cjs/context-consumer.cjs.entry.js +29 -0
  33. package/dist/lib/cjs/datorama-akita-6c9cb8fb.js +3641 -0
  34. package/dist/lib/cjs/index-eb4f212f.js +1766 -0
  35. package/dist/lib/cjs/index.cjs.js +2 -0
  36. package/dist/lib/cjs/loader.cjs.js +24 -0
  37. package/dist/lib/cjs/sss-button_31.cjs.entry.js +17977 -0
  38. package/dist/lib/cjs/stencil-async-content.cjs.entry.js +32 -0
  39. package/dist/lib/cjs/stencil-route-title.cjs.entry.js +32 -0
  40. package/dist/lib/cjs/stencil-router-prompt.cjs.entry.js +59 -0
  41. package/dist/lib/cjs/stencil-router-redirect.cjs.entry.js +32 -0
  42. package/dist/lib/collection/apollo-super-selection.css +1 -0
  43. package/dist/lib/collection/collection-manifest.json +95 -0
  44. package/dist/lib/collection/components/app-host/loading-page.js +9 -0
  45. package/dist/lib/collection/components/app-host/services/app-configuration.query.js +18 -0
  46. package/dist/lib/collection/components/app-host/services/app-configuration.service.js +25 -0
  47. package/dist/lib/collection/components/app-host/services/app-parameters.query.js +13 -0
  48. package/dist/lib/collection/components/app-host/services/app-parameters.service.js +14 -0
  49. package/dist/lib/collection/components/app-host/services/appinsights.service.js +46 -0
  50. package/dist/lib/collection/components/app-host/services/authentication.query.js +21 -0
  51. package/dist/lib/collection/components/app-host/services/authentication.service.js +50 -0
  52. package/dist/lib/collection/components/app-host/services/interop/host-interop.service.js +31 -0
  53. package/dist/lib/collection/components/app-host/services/interop/iframe-interop.service.js +30 -0
  54. package/dist/lib/collection/components/app-host/services/interop/react-native-interop.service.js +20 -0
  55. package/dist/lib/collection/components/app-host/services/interop.query.js +26 -0
  56. package/dist/lib/collection/components/app-host/services/session.store.js +38 -0
  57. package/dist/lib/collection/components/app-host/super-selection-app-host.css +24 -0
  58. package/dist/lib/collection/components/app-host/super-selection-app-host.js +87 -0
  59. package/dist/lib/collection/components/external-loading-page/external-loading-page.js +29 -0
  60. package/dist/lib/collection/components/super-campaign/super-campaign-types.js +6 -0
  61. package/dist/lib/collection/components/super-campaign/super-campaign.js +361 -0
  62. package/dist/lib/collection/components/super-selection-app/api/api-client.js +14 -0
  63. package/dist/lib/collection/components/super-selection-app/api/event-tracking.api.js +9 -0
  64. package/dist/lib/collection/components/super-selection-app/api/super-campaign-errors-api.js +9 -0
  65. package/dist/lib/collection/components/super-selection-app/api/super-campaign-errors.api.dtos.js +1 -0
  66. package/dist/lib/collection/components/super-selection-app/api/super-selection-events.model.js +16 -0
  67. package/dist/lib/collection/components/super-selection-app/api/super-selection.api.dto.js +179 -0
  68. package/dist/lib/collection/components/super-selection-app/api/super-selection.api.js +69 -0
  69. package/dist/lib/collection/components/super-selection-app/app-state-pages/success.js +36 -0
  70. package/dist/lib/collection/components/super-selection-app/assets/icon-exclamation.svg +3 -0
  71. package/dist/lib/collection/components/super-selection-app/assets/icon-information-circle.svg +3 -0
  72. package/dist/lib/collection/components/super-selection-app/existing-choice/existing-choice.js +163 -0
  73. package/dist/lib/collection/components/super-selection-app/footer-section/footer-section.js +39 -0
  74. package/dist/lib/collection/components/super-selection-app/funds/custom-fund/api/custom-fund-choice.api.dto.js +1 -0
  75. package/dist/lib/collection/components/super-selection-app/funds/custom-fund/api/custom-fund-choice.api.js +50 -0
  76. package/dist/lib/collection/components/super-selection-app/funds/custom-fund/custom-fund.js +86 -0
  77. package/dist/lib/collection/components/super-selection-app/funds/custom-fund/custom-fund.store.js +53 -0
  78. package/dist/lib/collection/components/super-selection-app/funds/custom-fund/default-fund/default-fund.js +114 -0
  79. package/dist/lib/collection/components/super-selection-app/funds/custom-fund/member-name-input.js +162 -0
  80. package/dist/lib/collection/components/super-selection-app/funds/custom-fund/my-own-fund/my-own-fund-inputs.js +143 -0
  81. package/dist/lib/collection/components/super-selection-app/funds/custom-fund/my-own-fund/my-own-fund.js +118 -0
  82. package/dist/lib/collection/components/super-selection-app/funds/custom-fund/self-managed-fund/abn-validation.js +11 -0
  83. package/dist/lib/collection/components/super-selection-app/funds/custom-fund/self-managed-fund/bankBsbNumbers.js +111 -0
  84. package/dist/lib/collection/components/super-selection-app/funds/custom-fund/self-managed-fund/self-managed-fund-inputs.js +253 -0
  85. package/dist/lib/collection/components/super-selection-app/funds/custom-fund/self-managed-fund/self-managed-fund.form.js +1 -0
  86. package/dist/lib/collection/components/super-selection-app/funds/custom-fund/self-managed-fund/self-managed-fund.js +121 -0
  87. package/dist/lib/collection/components/super-selection-app/funds/promoted-fund/api/promoted-fund-choice.api.dto.js +1 -0
  88. package/dist/lib/collection/components/super-selection-app/funds/promoted-fund/api/promoted-fund-choice.api.js +31 -0
  89. package/dist/lib/collection/components/super-selection-app/funds/slate-super/api/slate-choice.api.dto.js +1 -0
  90. package/dist/lib/collection/components/super-selection-app/funds/slate-super/api/slate-choice.api.js +13 -0
  91. package/dist/lib/collection/components/super-selection-app/funds/slate-super/api/slate.js +4 -0
  92. package/dist/lib/collection/components/super-selection-app/header-section/header-section.js +53 -0
  93. package/dist/lib/collection/components/super-selection-app/misc/button.js +195 -0
  94. package/dist/lib/collection/components/super-selection-app/misc/dropdown-async.css +7 -0
  95. package/dist/lib/collection/components/super-selection-app/misc/dropdown-async.js +390 -0
  96. package/dist/lib/collection/components/super-selection-app/misc/loading-indicator.js +52 -0
  97. package/dist/lib/collection/components/super-selection-app/prefill-fund/prefill-common.js +22 -0
  98. package/dist/lib/collection/components/super-selection-app/prefill-fund/prefill-display-field.js +42 -0
  99. package/dist/lib/collection/components/super-selection-app/prefill-fund/prefill-error-box.js +66 -0
  100. package/dist/lib/collection/components/super-selection-app/prefill-fund/prefill-invalid-my-own-fund.js +121 -0
  101. package/dist/lib/collection/components/super-selection-app/prefill-fund/prefill-invalid-smsf.js +145 -0
  102. package/dist/lib/collection/components/super-selection-app/prefill-fund/prefill-my-own-fund.js +223 -0
  103. package/dist/lib/collection/components/super-selection-app/prefill-fund/prefill-smsf.js +398 -0
  104. package/dist/lib/collection/components/super-selection-app/prefill-fund/prefill-types.js +288 -0
  105. package/dist/lib/collection/components/super-selection-app/prefill-fund/prefill-warning-box.js +37 -0
  106. package/dist/lib/collection/components/super-selection-app/prefill-fund/prefill.js +81 -0
  107. package/dist/lib/collection/components/super-selection-app/services/australian-fund-lookup.service.js +15 -0
  108. package/dist/lib/collection/components/super-selection-app/services/event-tracking.service.js +97 -0
  109. package/dist/lib/collection/components/super-selection-app/services/existing-super-choice-info.service.js +134 -0
  110. package/dist/lib/collection/components/super-selection-app/services/misc.service.js +7 -0
  111. package/dist/lib/collection/components/super-selection-app/services/navigation.service.js +31 -0
  112. package/dist/lib/collection/components/super-selection-app/services/super-selection-app.routes.js +32 -0
  113. package/dist/lib/collection/components/super-selection-app/services/super-selection-app.service.js +146 -0
  114. package/dist/lib/collection/components/super-selection-app/services/super-selection.store.js +42 -0
  115. package/dist/lib/collection/components/super-selection-app/standard-choice/standard-choice-form.js +155 -0
  116. package/dist/lib/collection/components/super-selection-app/standard-choice/standard-choice-form.store.js +11 -0
  117. package/dist/lib/collection/components/super-selection-app/super-selection-app.css +27 -0
  118. package/dist/lib/collection/components/super-selection-app/super-selection-app.js +291 -0
  119. package/dist/lib/collection/global/init-host.js +25 -0
  120. package/dist/lib/collection/global/main.dev.js +29 -0
  121. package/dist/lib/collection/global/main.js +11 -0
  122. package/dist/lib/collection/global/stencil-router-workaround.js +12 -0
  123. package/dist/lib/collection/index.js +2 -0
  124. package/dist/lib/collection/utils/config.js +2 -0
  125. package/dist/lib/collection/utils/gtm.js +5 -0
  126. package/dist/lib/collection/utils/iframe.js +33 -0
  127. package/dist/lib/collection/utils/index.js +11 -0
  128. package/dist/lib/collection/utils/lazy.js +29 -0
  129. package/dist/lib/collection/utils/storage.js +5 -0
  130. package/dist/lib/esm/active-router-5e40c0f8.js +73 -0
  131. package/dist/lib/esm/apollo-super-selection.js +20 -0
  132. package/dist/lib/esm/app-globals-c1f89805.js +23 -0
  133. package/dist/lib/esm/context-consumer.entry.js +25 -0
  134. package/dist/lib/esm/datorama-akita-127aea91.js +3624 -0
  135. package/dist/lib/esm/index-189b2180.js +1732 -0
  136. package/dist/lib/esm/index.js +1 -0
  137. package/dist/lib/esm/loader.js +20 -0
  138. package/dist/lib/esm/polyfills/core-js.js +11 -0
  139. package/dist/lib/esm/polyfills/css-shim.js +1 -0
  140. package/dist/lib/esm/polyfills/dom.js +79 -0
  141. package/dist/lib/esm/polyfills/es5-html-element.js +1 -0
  142. package/dist/lib/esm/polyfills/index.js +34 -0
  143. package/dist/lib/esm/polyfills/system.js +6 -0
  144. package/dist/lib/esm/sss-button_31.entry.js +17923 -0
  145. package/dist/lib/esm/stencil-async-content.entry.js +28 -0
  146. package/dist/lib/esm/stencil-route-title.entry.js +28 -0
  147. package/dist/lib/esm/stencil-router-prompt.entry.js +55 -0
  148. package/dist/lib/esm/stencil-router-redirect.entry.js +28 -0
  149. package/dist/lib/esm-es5/active-router-5e40c0f8.js +1 -0
  150. package/dist/lib/esm-es5/apollo-super-selection.js +1 -0
  151. package/dist/lib/esm-es5/app-globals-c1f89805.js +1 -0
  152. package/dist/lib/esm-es5/context-consumer.entry.js +1 -0
  153. package/dist/lib/esm-es5/datorama-akita-127aea91.js +15 -0
  154. package/dist/lib/esm-es5/index-189b2180.js +1 -0
  155. package/dist/lib/esm-es5/index.js +0 -0
  156. package/dist/lib/esm-es5/loader.js +1 -0
  157. package/dist/lib/esm-es5/sss-button_31.entry.js +69 -0
  158. package/dist/lib/esm-es5/stencil-async-content.entry.js +1 -0
  159. package/dist/lib/esm-es5/stencil-route-title.entry.js +1 -0
  160. package/dist/lib/esm-es5/stencil-router-prompt.entry.js +1 -0
  161. package/dist/lib/esm-es5/stencil-router-redirect.entry.js +1 -0
  162. package/dist/lib/index.cjs.js +1 -0
  163. package/dist/lib/index.js +1 -0
  164. package/dist/lib/loader/cdn.js +3 -0
  165. package/dist/lib/loader/index.cjs.js +3 -0
  166. package/dist/lib/loader/index.d.ts +13 -0
  167. package/dist/lib/loader/index.es2017.js +3 -0
  168. package/dist/lib/loader/index.js +4 -0
  169. package/dist/lib/loader/package.json +10 -0
  170. package/dist/lib/node_modules/@stencil/router/dist/collection/components/route/route.css +3 -0
  171. package/dist/lib/types/components/app-host/loading-page.d.ts +3 -0
  172. package/dist/lib/types/components/app-host/services/app-configuration.query.d.ts +11 -0
  173. package/dist/lib/types/components/app-host/services/app-configuration.service.d.ts +9 -0
  174. package/dist/lib/types/components/app-host/services/app-parameters.query.d.ts +10 -0
  175. package/dist/lib/types/components/app-host/services/app-parameters.service.d.ts +6 -0
  176. package/dist/lib/types/components/app-host/services/appinsights.service.d.ts +15 -0
  177. package/dist/lib/types/components/app-host/services/authentication.query.d.ts +13 -0
  178. package/dist/lib/types/components/app-host/services/authentication.service.d.ts +9 -0
  179. package/dist/lib/types/components/app-host/services/interop/host-interop.service.d.ts +7 -0
  180. package/dist/lib/types/components/app-host/services/interop/iframe-interop.service.d.ts +5 -0
  181. package/dist/lib/types/components/app-host/services/interop/react-native-interop.service.d.ts +7 -0
  182. package/dist/lib/types/components/app-host/services/interop.query.d.ts +11 -0
  183. package/dist/lib/types/components/app-host/services/session.store.d.ts +31 -0
  184. package/dist/lib/types/components/app-host/super-selection-app-host.d.ts +15 -0
  185. package/dist/lib/types/components/super-campaign/super-campaign-types.d.ts +96 -0
  186. package/dist/lib/types/components/super-campaign/super-campaign.d.ts +37 -0
  187. package/dist/lib/types/components/super-selection-app/api/api-client.d.ts +2 -0
  188. package/dist/lib/types/components/super-selection-app/api/event-tracking.api.d.ts +6 -0
  189. package/dist/lib/types/components/super-selection-app/api/super-campaign-errors-api.d.ts +6 -0
  190. package/dist/lib/types/components/super-selection-app/api/super-campaign-errors.api.dtos.d.ts +7 -0
  191. package/dist/lib/types/components/super-selection-app/api/super-selection-events.model.d.ts +149 -0
  192. package/dist/lib/types/components/super-selection-app/api/super-selection.api.d.ts +16 -0
  193. package/dist/lib/types/components/super-selection-app/api/super-selection.api.dto.d.ts +233 -0
  194. package/dist/lib/types/components/super-selection-app/app-state-pages/success.d.ts +7 -0
  195. package/dist/lib/types/components/super-selection-app/existing-choice/existing-choice.d.ts +12 -0
  196. package/dist/lib/types/components/super-selection-app/footer-section/footer-section.d.ts +5 -0
  197. package/dist/lib/types/components/super-selection-app/funds/custom-fund/api/custom-fund-choice.api.d.ts +10 -0
  198. package/dist/lib/types/components/super-selection-app/funds/custom-fund/api/custom-fund-choice.api.dto.d.ts +43 -0
  199. package/dist/lib/types/components/super-selection-app/funds/custom-fund/custom-fund.d.ts +9 -0
  200. package/dist/lib/types/components/super-selection-app/funds/custom-fund/custom-fund.store.d.ts +30 -0
  201. package/dist/lib/types/components/super-selection-app/funds/custom-fund/default-fund/default-fund.d.ts +13 -0
  202. package/dist/lib/types/components/super-selection-app/funds/custom-fund/member-name-input.d.ts +14 -0
  203. package/dist/lib/types/components/super-selection-app/funds/custom-fund/my-own-fund/my-own-fund-inputs.d.ts +16 -0
  204. package/dist/lib/types/components/super-selection-app/funds/custom-fund/my-own-fund/my-own-fund.d.ts +13 -0
  205. package/dist/lib/types/components/super-selection-app/funds/custom-fund/self-managed-fund/abn-validation.d.ts +1 -0
  206. package/dist/lib/types/components/super-selection-app/funds/custom-fund/self-managed-fund/bankBsbNumbers.d.ts +112 -0
  207. package/dist/lib/types/components/super-selection-app/funds/custom-fund/self-managed-fund/self-managed-fund-inputs.d.ts +29 -0
  208. package/dist/lib/types/components/super-selection-app/funds/custom-fund/self-managed-fund/self-managed-fund.d.ts +14 -0
  209. package/dist/lib/types/components/super-selection-app/funds/custom-fund/self-managed-fund/self-managed-fund.form.d.ts +15 -0
  210. package/dist/lib/types/components/super-selection-app/funds/promoted-fund/api/promoted-fund-choice.api.d.ts +8 -0
  211. package/dist/lib/types/components/super-selection-app/funds/promoted-fund/api/promoted-fund-choice.api.dto.d.ts +25 -0
  212. package/dist/lib/types/components/super-selection-app/funds/slate-super/api/slate-choice.api.d.ts +6 -0
  213. package/dist/lib/types/components/super-selection-app/funds/slate-super/api/slate-choice.api.dto.d.ts +8 -0
  214. package/dist/lib/types/components/super-selection-app/funds/slate-super/api/slate.d.ts +4 -0
  215. package/dist/lib/types/components/super-selection-app/header-section/header-section.d.ts +4 -0
  216. package/dist/lib/types/components/super-selection-app/misc/button.d.ts +14 -0
  217. package/dist/lib/types/components/super-selection-app/misc/dropdown-async.d.ts +52 -0
  218. package/dist/lib/types/components/super-selection-app/misc/loading-indicator.d.ts +5 -0
  219. package/dist/lib/types/components/super-selection-app/prefill-fund/prefill-common.d.ts +9 -0
  220. package/dist/lib/types/components/super-selection-app/prefill-fund/prefill-display-field.d.ts +5 -0
  221. package/dist/lib/types/components/super-selection-app/prefill-fund/prefill-error-box.d.ts +5 -0
  222. package/dist/lib/types/components/super-selection-app/prefill-fund/prefill-invalid-my-own-fund.d.ts +18 -0
  223. package/dist/lib/types/components/super-selection-app/prefill-fund/prefill-invalid-smsf.d.ts +28 -0
  224. package/dist/lib/types/components/super-selection-app/prefill-fund/prefill-my-own-fund.d.ts +30 -0
  225. package/dist/lib/types/components/super-selection-app/prefill-fund/prefill-smsf.d.ts +52 -0
  226. package/dist/lib/types/components/super-selection-app/prefill-fund/prefill-types.d.ts +95 -0
  227. package/dist/lib/types/components/super-selection-app/prefill-fund/prefill-warning-box.d.ts +4 -0
  228. package/dist/lib/types/components/super-selection-app/prefill-fund/prefill.d.ts +14 -0
  229. package/dist/lib/types/components/super-selection-app/services/australian-fund-lookup.service.d.ts +8 -0
  230. package/dist/lib/types/components/super-selection-app/services/event-tracking.service.d.ts +21 -0
  231. package/dist/lib/types/components/super-selection-app/services/existing-super-choice-info.service.d.ts +75 -0
  232. package/dist/lib/types/components/super-selection-app/services/misc.service.d.ts +6 -0
  233. package/dist/lib/types/components/super-selection-app/services/navigation.service.d.ts +17 -0
  234. package/dist/lib/types/components/super-selection-app/services/super-selection-app.routes.d.ts +16 -0
  235. package/dist/lib/types/components/super-selection-app/services/super-selection-app.service.d.ts +38 -0
  236. package/dist/lib/types/components/super-selection-app/services/super-selection.store.d.ts +34 -0
  237. package/dist/lib/types/components/super-selection-app/standard-choice/standard-choice-form.d.ts +16 -0
  238. package/dist/lib/types/components/super-selection-app/standard-choice/standard-choice-form.store.d.ts +42 -0
  239. package/dist/lib/types/components/super-selection-app/super-selection-app.d.ts +27 -0
  240. package/dist/lib/types/components.d.ts +503 -0
  241. package/dist/lib/types/global/init-host.d.ts +1 -0
  242. package/dist/lib/types/global/main.d.ts +1 -0
  243. package/dist/lib/types/global/main.dev.d.ts +1 -0
  244. package/dist/lib/types/global/stencil-router-workaround.d.ts +1 -0
  245. package/dist/lib/types/index.d.ts +2 -0
  246. package/dist/lib/types/stencil-public-runtime.d.ts +1555 -0
  247. package/dist/lib/types/utils/config.d.ts +2 -0
  248. package/dist/lib/types/utils/gtm.d.ts +7 -0
  249. package/dist/lib/types/utils/iframe.d.ts +13 -0
  250. package/dist/lib/types/utils/index.d.ts +4 -0
  251. package/dist/lib/types/utils/lazy.d.ts +12 -0
  252. package/dist/lib/types/utils/storage.d.ts +4 -0
  253. package/package.json +1 -1
@@ -0,0 +1,398 @@
1
+ import { Component, h, Prop, State } from '@stencil/core';
2
+ import customFundChoiceApi from '../funds/custom-fund/api/custom-fund-choice.api';
3
+ import bsbNumbers from '../funds/custom-fund/self-managed-fund/bankBsbNumbers';
4
+ import { EventTrackingService } from '../services/event-tracking.service';
5
+ import navigationService from '../services/navigation.service';
6
+ import { SuperSelectionAppRoutes } from '../services/super-selection-app.routes';
7
+ import superSelectionAppService from '../services/super-selection-app.service';
8
+ import { DisabledField, Header, isNullOrWhitespace, Style } from './prefill-common';
9
+ import { BankAccountBsb, BankAccountName, BankAccountNumber, BankName, FundAbn, FundAddress, FundAddressCity, FundAddressLine1, FundAddressLine2, FundAddressPostcode, FundAddressState, FundEsa, MemberGivenNames, MemberLastName, SmsfFundName } from './prefill-types';
10
+ export class PrefillSMSF {
11
+ constructor() {
12
+ this.mode = 'review';
13
+ this.formState = 'pristine';
14
+ this.isSubmitDisabled = true;
15
+ this.eventTrackingService = EventTrackingService.Instance;
16
+ this.createSuperFundPrefillDeclinedDetail = (prefill) => {
17
+ return {
18
+ fundType: 'SMSF',
19
+ isAbnValid: prefill.fundAbn.valid,
20
+ isMemberFirstNamePresent: !isNullOrWhitespace(prefill.memberFirstName),
21
+ isMemberLastNamePresent: !isNullOrWhitespace(prefill.memberFamilyName)
22
+ };
23
+ };
24
+ this.createSuperFundPrefillViewedDetail = (prefill) => {
25
+ return {
26
+ fundType: 'SMSF',
27
+ isAbnValid: prefill.fundAbn.valid,
28
+ isMemberFirstNamePresent: !isNullOrWhitespace(prefill.memberFirstName),
29
+ isMemberLastNamePresent: !isNullOrWhitespace(prefill.memberFamilyName)
30
+ };
31
+ };
32
+ }
33
+ componentDidLoad() {
34
+ const detail = this.createSuperFundPrefillViewedDetail(this.prefill);
35
+ return this.eventTrackingService.TrackSuperFundPrefillViewedAsync(detail);
36
+ }
37
+ async componentWillLoad() {
38
+ if (this.prefill && this.prefill.fundAbn.valid) {
39
+ this.initialiseComponent(this.prefill);
40
+ }
41
+ else {
42
+ // If prefill does not exist, or is invalid we should
43
+ // not have landed on this page, navigate to PrefillInvalidSMSFPage page
44
+ navigationService.navigateInternally(this.history, SuperSelectionAppRoutes.PrefillInvalidSMSFPage);
45
+ }
46
+ }
47
+ render() {
48
+ const errorMessages = [
49
+ this.fundName.errorMessage,
50
+ this.fundEsa.errorMessage,
51
+ this.fundAddressLine1.errorMessage,
52
+ this.fundAddressLine2.errorMessage,
53
+ this.fundAddressCity.errorMessage,
54
+ this.fundAddressPostcode.errorMessage,
55
+ this.fundAddressState.errorMessage,
56
+ this.memberLastName.errorMessage,
57
+ this.memberGivenNames.errorMessage,
58
+ this.bankAccountName.errorMessage,
59
+ this.bankAccountBsb.errorMessage,
60
+ this.bankAccountNumber.errorMessage
61
+ ].filter((err) => err !== null);
62
+ return (h("div", null,
63
+ h(Header, null),
64
+ h("div", { class: "flex flex-col items-center gap-8 mt-8 sm:mt-12" },
65
+ h("div", { class: "flex max-w-[560px] flex-col items-start gap-6 p-6 border shadow-sm rounded-lg" },
66
+ h("div", { class: "flex flex-col items-start gap-3 self-stretch" },
67
+ h("div", { class: "self-stretch text-grey-900 text-lg not-italic font-bold leading-7" }, "Your self-managed super fund (SMSF) details"),
68
+ h("sss-prefill-warning-box", { class: "self-stretch", notificationList: [
69
+ 'Make sure your Self-managed super fund (SMSF) is a registered fund before completing this step.'
70
+ ] }),
71
+ this.mode === 'review' && errorMessages.length > 0 && (h("sss-prefill-error-box", { class: "self-stretch", notificationList: errorMessages, withHeader: true })),
72
+ this.mode === 'review' && (h("div", { class: "flex flex-col gap-3 self-stretch mt-4" },
73
+ h("sss-prefill-display-field", { field: this.fundName }),
74
+ h("sss-prefill-display-field", { field: this.fundAbn }),
75
+ h("sss-prefill-display-field", { field: this.fundEsa }),
76
+ h("sss-prefill-display-field", { field: this.fundAddress }),
77
+ h("sss-prefill-display-field", { field: this.memberLastName }),
78
+ h("sss-prefill-display-field", { field: this.memberGivenNames }),
79
+ h("div", { class: "mt-4 mb-2 text-gray-900 text-lg font-bold leading-7" }, "Fund bank details"),
80
+ h("sss-prefill-display-field", { field: this.bankAccountName }),
81
+ h("sss-prefill-display-field", { field: this.bankAccountBsb }),
82
+ this.bankName.isValid && (h("sss-prefill-display-field", { field: this.bankName })),
83
+ h("sss-prefill-display-field", { field: this.bankAccountNumber }))),
84
+ this.mode === 'review' && (h("sss-button", { testid: "edit-details-button", class: "self-stretch mt-3", fillWidth: true, variant: "secondary", promiseFn: () => this.setModeToEdit() },
85
+ h("div", { class: "flex flex-row gap-2" },
86
+ h("div", { class: "text-sm not-italic font-medium leading-4" }, "Edit details"),
87
+ h("div", { class: "w-4 h-4 relative" },
88
+ h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "17", height: "16", viewBox: "0 0 17 16", fill: "currentColor" },
89
+ h("path", { d: "M11.369 2.86865C11.9939 2.24381 13.0069 2.24381 13.6318 2.86865C14.2566 3.49349 14.2566 4.50656 13.6318 5.1314L12.9974 5.76571L10.7347 3.50297L11.369 2.86865Z" }),
90
+ h("path", { d: "M9.60334 4.63434L2.90039 11.3373V13.6H5.16313L11.8661 6.89708L9.60334 4.63434Z" })))))),
91
+ this.mode === 'edit' && (h("form", { noValidate: true, onSubmit: (ev) => ev.preventDefault(), class: {
92
+ 'w-full': true,
93
+ 'was-validated': this.formState === 'validated'
94
+ }, ref: (el) => (this.formElement = el), onInput: (_) => (this.isSubmitDisabled = this.formHasMissingData()) },
95
+ h("div", { class: "mt-3" },
96
+ h("label", { class: "text-sm font-medium text-gray-700" }, this.fundName.name),
97
+ h("div", { class: "mt-1" },
98
+ h("input", { type: "text", class: Style.Input(this.formState === 'validated'), required: true, "data-testid": this.fundName.testId, value: this.fundName.value, onInput: (ev) => {
99
+ this.updateFundName(ev.target.value);
100
+ } }),
101
+ h("div", { class: "mt-2 text-sm text-red-600" }, this.formState === 'validated' && this.fundName.errorMessage))),
102
+ DisabledField(this.fundAbn.name, this.fundAbn.testId, this.fundAbn.value),
103
+ h("div", { class: "mt-3" },
104
+ h("label", { class: "text-sm font-medium text-gray-700" }, this.fundEsa.name),
105
+ h("div", { class: "mt-1" },
106
+ h("input", { type: "text", class: Style.Input(this.formState === 'validated'), required: true, minlength: "2", "data-testid": this.fundEsa.testId, value: this.fundEsa.value, onInput: (ev) => {
107
+ this.updateFundEsa(ev.target.value);
108
+ } }),
109
+ h("div", { class: "mt-2 text-sm text-red-600" }, this.formState === 'validated' && this.fundEsa.errorMessage))),
110
+ h("div", { class: "mt-3" },
111
+ h("label", { class: "text-sm font-medium text-gray-700" }, "Fund address"),
112
+ h("div", { class: "mt-1 rounded-md shadow-sm -space-y-px" },
113
+ h("input", { placeholder: "Address line 1", type: "text", class: Object.assign(Object.assign({}, Style.Input(this.formState === 'validated')), { 'rounded-none rounded-t-md shadow-none border-b-0': true }), required: true, minlength: "2", name: "addressLine1", id: "addressLine1", "data-testid": this.fundAddressLine1.testId, value: this.fundAddressLine1.value, onInput: (ev) => {
114
+ this.updateAddressLine1(ev.target.value);
115
+ } }),
116
+ h("input", { placeholder: "Address line 2 (optional)", type: "text", class: Object.assign(Object.assign({}, Style.Input(this.formState === 'validated')), { 'rounded-none shadow-none border-b-0': true }), "data-testid": this.fundAddressLine2.testId, value: this.fundAddressLine2.value, onInput: (ev) => this.updateAddressLine2(ev.target.value) }),
117
+ h("input", { placeholder: "City/suburb", type: "text", class: Object.assign(Object.assign({}, Style.Input(this.formState === 'validated')), { 'rounded-none shadow-none border-b-0': true }), required: true, "data-testid": this.fundAddressCity.testId, value: this.fundAddressCity.value, onInput: (ev) => {
118
+ this.updateAddressCity(ev.target.value);
119
+ } }),
120
+ h("div", { class: "flex -space-x-px" },
121
+ h("div", { class: "w-1/2 flex-1 min-w-0" },
122
+ h("input", { placeholder: "Postcode", type: "text", required: true, class: Object.assign(Object.assign({}, Style.Input(this.formState === 'validated')), { 'rounded-none rounded-bl-md shadow-none border-r-0': true }), name: "postcode", minlength: "4", maxlength: "4", pattern: "[0-9]{4}", id: "postcode", "data-testid": this.fundAddressPostcode.testId, value: this.fundAddressPostcode.value, inputmode: "numeric", onInput: (ev) => {
123
+ this.updateAddressPostcode(ev.target.value);
124
+ } })),
125
+ h("div", { class: "flex-1 min-w-0" },
126
+ h("select", { class: Object.assign(Object.assign({}, Style.Input(this.formState === 'validated')), { 'rounded-none rounded-br-md shadow-none': true, 'text-gray-500': this.formState !== 'validated' }), name: "state", required: true, "data-testid": this.fundAddressState.testId, id: "state", onInput: (ev) => {
127
+ this.updateAddressState(ev.target.value);
128
+ } },
129
+ h("option", { disabled: true, selected: this.fundAddressState.value !== undefined, value: "" }, "State"),
130
+ this.fundAddressState.options.map((s) => (h("option", { value: s.value, selected: this.fundAddressState.value === s.value }, s.label))))))),
131
+ this.formState === 'validated' && (h("div", { class: "mt-2 text-sm text-red-600" }, this.fundAddressLine1.errorMessage ||
132
+ this.fundAddressLine1.errorMessage ||
133
+ this.fundAddressCity.errorMessage ||
134
+ this.fundAddressPostcode.errorMessage ||
135
+ this.fundAddressState.errorMessage))),
136
+ h("div", { class: "flex gap-x-4 flex-col sm:flex-row" },
137
+ h("div", { class: "mt-3 w-full sm:w-1/2" },
138
+ h("label", { class: "text-sm font-medium text-gray-700" }, this.memberGivenNames.name),
139
+ h("div", { class: "mt-1" },
140
+ h("input", { type: "text", class: Style.Input(this.formState === 'validated'), required: true, "data-testid": this.memberGivenNames.testId, value: this.memberGivenNames.value, onInput: (ev) => {
141
+ this.updateMemberGivenNames(ev.target.value);
142
+ } }),
143
+ h("div", { class: "mt-2 text-sm text-red-600" }, this.formState === 'validated' && this.memberGivenNames.errorMessage))),
144
+ h("div", { class: "mt-3 w-full sm:w-1/2" },
145
+ h("label", { class: "text-sm font-medium text-gray-700" }, this.memberLastName.name),
146
+ h("div", { class: "mt-1" },
147
+ h("input", { type: "text", class: Style.Input(this.formState === 'validated'), required: true, "data-testid": this.memberLastName.testId, value: this.memberLastName.value, onInput: (ev) => {
148
+ this.updateMemberLastName(ev.target.value);
149
+ } }),
150
+ h("div", { class: "mt-2 text-sm text-red-600" }, this.formState === 'validated' && this.memberLastName.errorMessage)))),
151
+ h("div", { class: "mt-6 text-gray-900 text-lg font-bold leading-7" }, "Fund bank details"),
152
+ h("div", { class: "mt-3" },
153
+ h("label", { class: "text-sm font-medium text-gray-700" }, this.bankAccountName.name),
154
+ h("div", { class: "mt-1" },
155
+ h("input", { type: "text", class: Style.Input(this.formState === 'validated'), required: true, "data-testid": this.bankAccountName.testId, value: this.bankAccountName.value, onInput: (ev) => {
156
+ this.updateBankAccountName(ev.target.value);
157
+ } }),
158
+ h("div", { class: "mt-2 text-sm text-red-600" }, this.formState === 'validated' && this.bankAccountName.errorMessage))),
159
+ h("div", { class: "mt-3" },
160
+ h("label", { class: "text-sm font-medium text-gray-700" }, this.bankAccountBsb.name),
161
+ h("div", { class: "mt-1" },
162
+ h("input", { type: "text", class: Style.Input(this.formState === 'validated'), required: true, "data-testid": this.bankAccountBsb.testId, value: this.bankAccountBsb.value, onInput: (ev) => {
163
+ const bsb = ev.target.value;
164
+ this.updateBankName(bsb);
165
+ this.updateBankAccountBsb(bsb);
166
+ } }),
167
+ h("div", { class: "mt-2 text-sm text-red-600" }, this.formState === 'validated' && this.bankAccountBsb.errorMessage))),
168
+ this.bankName.isValid &&
169
+ DisabledField(this.bankName.name, this.bankName.testId, this.bankName.value),
170
+ h("div", { class: "mt-3" },
171
+ h("label", { class: "text-sm font-medium text-gray-700" }, this.bankAccountNumber.name),
172
+ h("div", { class: "mt-1" },
173
+ h("input", { type: "text", class: Style.Input(this.formState === 'validated'), required: true, "data-testid": this.bankAccountNumber.testId, value: this.bankAccountNumber.value, onInput: (ev) => {
174
+ this.updateBankAccountNumber(ev.target.value);
175
+ } }),
176
+ h("div", { class: "mt-2 text-sm text-red-600" }, this.formState === 'validated' && this.bankAccountNumber.errorMessage))))))),
177
+ h("div", { class: "flex w-full sm:w-80 max-w-[560px] flex-col items-start gap-4" },
178
+ h("sss-button", { testid: "continue-button", class: "self-stretch", fillWidth: true, variant: "primary", disabled: this.isSubmitDisabled, promiseFn: () => this.handleSubmitForm() }, "Continue"),
179
+ h("sss-button", { testid: "make-another-nomination-button", class: "self-stretch", fillWidth: true, variant: "secondary", promiseFn: () => this.handleFundNominationDeclined() }, "Make another nomination")))));
180
+ }
181
+ isFormValid() {
182
+ return (this.fundName.isValid &&
183
+ this.fundAbn.isValid &&
184
+ this.fundEsa.isValid &&
185
+ this.fundAddressLine1.isValid &&
186
+ this.fundAddressLine2.isValid &&
187
+ this.fundAddressCity.isValid &&
188
+ this.fundAddressPostcode.isValid &&
189
+ this.fundAddressState.isValid &&
190
+ this.memberGivenNames.isValid &&
191
+ this.memberLastName.isValid &&
192
+ this.bankAccountName.isValid &&
193
+ this.bankAccountBsb.isValid &&
194
+ this.bankAccountNumber.isValid);
195
+ }
196
+ formHasMissingData() {
197
+ return (this.fundName.isEmpty ||
198
+ this.fundAbn.isEmpty ||
199
+ this.fundEsa.isEmpty ||
200
+ this.fundAddressLine1.isEmpty ||
201
+ this.fundAddressCity.isEmpty ||
202
+ this.fundAddressPostcode.isEmpty ||
203
+ this.fundAddressState.isEmpty ||
204
+ this.memberGivenNames.isEmpty ||
205
+ this.memberLastName.isEmpty ||
206
+ this.bankAccountName.isEmpty ||
207
+ this.bankAccountBsb.isEmpty ||
208
+ this.bankAccountNumber.isEmpty);
209
+ }
210
+ setModeToEdit() {
211
+ this.mode = 'edit';
212
+ return Promise.resolve();
213
+ }
214
+ updateFundName(fundName) {
215
+ this.fundName = new SmsfFundName(fundName.trim());
216
+ }
217
+ updateFundEsa(fundEda) {
218
+ this.fundEsa = new FundEsa(fundEda.trim());
219
+ }
220
+ updateAddressLine1(value) {
221
+ this.fundAddressLine1 = new FundAddressLine1(value.trim());
222
+ }
223
+ updateAddressLine2(value) {
224
+ this.fundAddressLine2 = new FundAddressLine2(value.trim());
225
+ }
226
+ updateAddressCity(value) {
227
+ this.fundAddressCity = new FundAddressCity(value.trim());
228
+ }
229
+ updateAddressPostcode(value) {
230
+ this.fundAddressPostcode = new FundAddressPostcode(value.trim());
231
+ }
232
+ updateAddressState(value) {
233
+ this.fundAddressState = new FundAddressState(value.trim());
234
+ }
235
+ updateBankAccountName(bankAccountName) {
236
+ this.bankAccountName = new BankAccountName(bankAccountName.trim());
237
+ }
238
+ updateBankAccountBsb(bankAccountBsb) {
239
+ this.bankAccountBsb = new BankAccountBsb(bankAccountBsb.trim());
240
+ }
241
+ updateBankAccountNumber(bankAccountNumber) {
242
+ this.bankAccountNumber = new BankAccountNumber(bankAccountNumber.trim());
243
+ }
244
+ updateMemberGivenNames(memberGivenNames) {
245
+ this.memberGivenNames = new MemberGivenNames(memberGivenNames);
246
+ }
247
+ updateMemberLastName(memberLastName) {
248
+ this.memberLastName = new MemberLastName(memberLastName.trim());
249
+ }
250
+ filterDigits(str) {
251
+ return str.replace(/[^0-9]/g, '');
252
+ }
253
+ tryGetBankName(bsb) {
254
+ if (bsb == null)
255
+ return null;
256
+ const value = this.filterDigits(bsb);
257
+ const firstTwoNumbers = value.substring(0, 2);
258
+ const firstThreeNumbers = value.substring(0, 3);
259
+ const firstTwoNumberBankName = bsbNumbers[firstTwoNumbers];
260
+ const firstThreeNumberBankName = bsbNumbers[firstThreeNumbers];
261
+ if (firstTwoNumberBankName)
262
+ return firstTwoNumberBankName;
263
+ if (firstThreeNumberBankName)
264
+ return firstThreeNumberBankName;
265
+ return null;
266
+ }
267
+ updateBankName(bsb) {
268
+ const bankName = this.tryGetBankName(bsb);
269
+ this.bankName = new BankName(bankName, bankName != null);
270
+ }
271
+ async handleSubmitForm() {
272
+ this.formState = 'validated';
273
+ if (!this.isFormValid()) {
274
+ return;
275
+ }
276
+ if (this.mode === 'edit' && !this.formElement.checkValidity()) {
277
+ return;
278
+ }
279
+ navigationService.navigateInternallyToStandardChoice({
280
+ history: this.history,
281
+ fundName: 'Self-managed super fund',
282
+ fundDetails: {
283
+ type: 'smsf',
284
+ fundName: this.fundName.value,
285
+ fundEsa: this.fundEsa.value
286
+ },
287
+ handleSubmitFn: async (standardChoiceFormSignature) => {
288
+ const smsfChoiceDto = Object.assign({ smsfChoice: {
289
+ abn: this.fundAbn.value,
290
+ fundName: this.fundName.value,
291
+ fundAddress: {
292
+ addressLine1: this.fundAddressLine1.value,
293
+ addressLine2: this.fundAddressLine2.value.trim() === ''
294
+ ? null
295
+ : this.fundAddressLine2.value.trim(),
296
+ city: this.fundAddressCity.value,
297
+ state: this.fundAddressState.value,
298
+ postcode: this.fundAddressPostcode.value
299
+ },
300
+ bsb: this.bankAccountBsb.value,
301
+ bankAccountName: this.bankAccountName.value,
302
+ bankAccountNumber: this.bankAccountNumber.value,
303
+ electronicServiceAddress: this.fundEsa.value,
304
+ memberFirstName: this.memberGivenNames.value,
305
+ memberFamilyName: this.memberLastName.value
306
+ }, standardChoiceFormSignature }, superSelectionAppService.promotedFundsConfig);
307
+ await customFundChoiceApi.submitSelfManagedFundChoiceAsync(smsfChoiceDto);
308
+ }
309
+ });
310
+ }
311
+ initialiseComponent(prefill) {
312
+ this.fundName = new SmsfFundName(prefill.fundName);
313
+ this.fundAbn = new FundAbn(prefill.fundAbn.value, prefill.fundAbn.valid);
314
+ this.fundEsa = new FundEsa(prefill.electronicServiceAddress);
315
+ this.fundAddressLine1 = new FundAddressLine1(prefill.addressLine1);
316
+ this.fundAddressLine2 = new FundAddressLine2(prefill.addressLine2);
317
+ this.fundAddressCity = new FundAddressCity(prefill.addressCity);
318
+ this.fundAddressPostcode = new FundAddressPostcode(prefill.addressPostcode);
319
+ this.fundAddressState = new FundAddressState(prefill.addressState);
320
+ this.fundAddress = new FundAddress(this.fundAddressLine1, this.fundAddressLine2, this.fundAddressCity, this.fundAddressState, this.fundAddressPostcode);
321
+ this.memberGivenNames = new MemberGivenNames(prefill.memberFirstName);
322
+ this.memberLastName = new MemberLastName(prefill.memberFamilyName);
323
+ this.bankAccountName = new BankAccountName(prefill.bankAccountName);
324
+ const bankName = this.tryGetBankName(prefill.bankAccountBsb);
325
+ this.bankName = new BankName(bankName, bankName != null);
326
+ this.bankAccountBsb = new BankAccountBsb(prefill.bankAccountBsb);
327
+ this.bankAccountNumber = new BankAccountNumber(prefill.bankAccountNumber);
328
+ this.isSubmitDisabled = this.formHasMissingData();
329
+ }
330
+ async handleFundNominationDeclined() {
331
+ const detail = this.createSuperFundPrefillDeclinedDetail(this.prefill);
332
+ await this.eventTrackingService.TrackSuperFundPrefillDeclinedAsync(detail);
333
+ return navigationService.navigateInternally(this.history, SuperSelectionAppRoutes.ChoicePage);
334
+ }
335
+ static get is() { return "sss-prefill-smsf"; }
336
+ static get properties() { return {
337
+ "history": {
338
+ "type": "unknown",
339
+ "mutable": false,
340
+ "complexType": {
341
+ "original": "RouterHistory",
342
+ "resolved": "RouterHistory",
343
+ "references": {
344
+ "RouterHistory": {
345
+ "location": "import",
346
+ "path": "@stencil/router"
347
+ }
348
+ }
349
+ },
350
+ "required": false,
351
+ "optional": false,
352
+ "docs": {
353
+ "tags": [],
354
+ "text": ""
355
+ }
356
+ },
357
+ "prefill": {
358
+ "type": "unknown",
359
+ "mutable": false,
360
+ "complexType": {
361
+ "original": "PrefillSMSFChoiceDto",
362
+ "resolved": "{ fundAbn: { valid: boolean; value: string; }; fundName: string | null; addressLine1: string | null; addressLine2: string | null; addressCity: string | null; addressState: string | null; addressPostcode: string | null; bankAccountBsb: string | null; bankAccountName: string | null; bankAccountNumber: string | null; electronicServiceAddress: string | null; memberFirstName: string | null; memberFamilyName: string | null; }",
363
+ "references": {
364
+ "PrefillSMSFChoiceDto": {
365
+ "location": "import",
366
+ "path": "../api/super-selection.api.dto"
367
+ }
368
+ }
369
+ },
370
+ "required": false,
371
+ "optional": false,
372
+ "docs": {
373
+ "tags": [],
374
+ "text": ""
375
+ }
376
+ }
377
+ }; }
378
+ static get states() { return {
379
+ "mode": {},
380
+ "formState": {},
381
+ "isSubmitDisabled": {},
382
+ "fundName": {},
383
+ "fundAbn": {},
384
+ "fundEsa": {},
385
+ "fundAddressLine1": {},
386
+ "fundAddressLine2": {},
387
+ "fundAddressCity": {},
388
+ "fundAddressPostcode": {},
389
+ "fundAddressState": {},
390
+ "fundAddress": {},
391
+ "memberGivenNames": {},
392
+ "memberLastName": {},
393
+ "bankAccountName": {},
394
+ "bankName": {},
395
+ "bankAccountBsb": {},
396
+ "bankAccountNumber": {}
397
+ }; }
398
+ }
@@ -0,0 +1,288 @@
1
+ import { isNullOrWhitespace } from './prefill-common';
2
+ export const NAME_PATTERN = "[A-Za-z][A-Za-z']+(( |-)[A-Za-z][A-Za-z']+)*\\s*$";
3
+ export class FormField {
4
+ constructor(name, testId, value) {
5
+ this.name = name;
6
+ this.testId = testId;
7
+ this._value = value !== null && value !== void 0 ? value : '';
8
+ this._errorMessage = this.validateAndReturnErrorMessage(this._value);
9
+ }
10
+ get value() {
11
+ return this._value;
12
+ }
13
+ set value(newValue) {
14
+ this._errorMessage = this.validateAndReturnErrorMessage(newValue);
15
+ this._value = newValue;
16
+ }
17
+ get isValid() {
18
+ return this._errorMessage === null;
19
+ }
20
+ get isEmpty() {
21
+ return isNullOrWhitespace(this._value);
22
+ }
23
+ get errorMessage() {
24
+ return this._errorMessage;
25
+ }
26
+ }
27
+ export class StaticFormField {
28
+ constructor(name, testId, value, isValid) {
29
+ this.name = name;
30
+ this.testId = testId;
31
+ this._value = value !== null && value !== void 0 ? value : '';
32
+ this._isValid = isValid;
33
+ }
34
+ get value() {
35
+ return this._value;
36
+ }
37
+ get isValid() {
38
+ return this._isValid;
39
+ }
40
+ get isEmpty() {
41
+ return isNullOrWhitespace(this._value);
42
+ }
43
+ }
44
+ export class FundUsi extends StaticFormField {
45
+ constructor(value, isValid) {
46
+ super('Fund USI', 'fund-usi', value, isValid);
47
+ }
48
+ }
49
+ export class FundName extends StaticFormField {
50
+ constructor(value, isValid) {
51
+ super('Fund name', 'fund-name', value, isValid);
52
+ }
53
+ }
54
+ export class SmsfFundName extends FormField {
55
+ constructor(value) {
56
+ super('Fund name', 'smsf-fund-name', value);
57
+ }
58
+ validateAndReturnErrorMessage(newValue) {
59
+ if (isNullOrWhitespace(newValue)) {
60
+ return 'Fund name is required.';
61
+ }
62
+ else if (newValue.length < 2) {
63
+ return 'Enter a valid Fund name.';
64
+ }
65
+ else {
66
+ return null;
67
+ }
68
+ }
69
+ }
70
+ export class MemberNumber extends FormField {
71
+ constructor(value) {
72
+ super('Member number', 'member-number', value);
73
+ }
74
+ validateAndReturnErrorMessage(newValue) {
75
+ const regex = /^[A-Za-z0-9]{4,16}$/;
76
+ if (isNullOrWhitespace(newValue)) {
77
+ return 'Member number is required.';
78
+ }
79
+ else if (!regex.test(newValue)) {
80
+ return 'Enter a valid member number (only numbers and / or letters)';
81
+ }
82
+ else {
83
+ return null;
84
+ }
85
+ }
86
+ }
87
+ export class MemberLastName extends FormField {
88
+ constructor(value) {
89
+ super('Member last name', 'member-last-name', value);
90
+ }
91
+ validateAndReturnErrorMessage(newValue) {
92
+ const regex = new RegExp(NAME_PATTERN);
93
+ if (isNullOrWhitespace(newValue)) {
94
+ return 'Member last name is required.';
95
+ }
96
+ else if (!regex.test(newValue)) {
97
+ return 'Member last name contains unsupported characters.';
98
+ }
99
+ else {
100
+ return null;
101
+ }
102
+ }
103
+ }
104
+ export class MemberGivenNames extends FormField {
105
+ constructor(value) {
106
+ super('Member given name(s)', 'member-given-names', value);
107
+ }
108
+ validateAndReturnErrorMessage(newValue) {
109
+ const regex = new RegExp(NAME_PATTERN);
110
+ if (isNullOrWhitespace(newValue)) {
111
+ return 'Member given name(s) is required.';
112
+ }
113
+ else if (!regex.test(newValue)) {
114
+ return 'Member given name(s) contains unsupported characters.';
115
+ }
116
+ else {
117
+ return null;
118
+ }
119
+ }
120
+ }
121
+ export class FundAbn extends StaticFormField {
122
+ constructor(value, isValid) {
123
+ super('Fund ABN', 'fund-abn', value, isValid);
124
+ }
125
+ }
126
+ export class FundEsa extends FormField {
127
+ constructor(value) {
128
+ super('Fund ESA', 'fund-esa', value);
129
+ }
130
+ validateAndReturnErrorMessage(newValue) {
131
+ if (isNullOrWhitespace(newValue)) {
132
+ return 'Fund ESA is required.';
133
+ }
134
+ else if (newValue.length < 2) {
135
+ return 'Enter a valid Fund ESA.';
136
+ }
137
+ else {
138
+ return null;
139
+ }
140
+ }
141
+ }
142
+ export class FundAddressLine1 extends FormField {
143
+ constructor(value) {
144
+ super('Address line 1', 'address-line-one', value);
145
+ }
146
+ validateAndReturnErrorMessage(newValue) {
147
+ if (isNullOrWhitespace(newValue)) {
148
+ return 'Address line 1 is required.';
149
+ }
150
+ else if (newValue.length < 2) {
151
+ return 'Enter a valid Address line 1.';
152
+ }
153
+ else {
154
+ return null;
155
+ }
156
+ }
157
+ }
158
+ export class FundAddressLine2 extends FormField {
159
+ constructor(value) {
160
+ super('Address line 2', 'address-line-two', value);
161
+ }
162
+ validateAndReturnErrorMessage(_newValue) {
163
+ return null;
164
+ }
165
+ }
166
+ export class FundAddressCity extends FormField {
167
+ constructor(value) {
168
+ super('City/suburb', 'city-suburb', value);
169
+ }
170
+ validateAndReturnErrorMessage(newValue) {
171
+ if (isNullOrWhitespace(newValue)) {
172
+ return 'City/suburb is required.';
173
+ }
174
+ else {
175
+ return null;
176
+ }
177
+ }
178
+ }
179
+ export class FundAddressPostcode extends FormField {
180
+ constructor(value) {
181
+ super('Postcode', 'postcode', value);
182
+ }
183
+ validateAndReturnErrorMessage(newValue) {
184
+ const regex = /^[0-9]{4}$/;
185
+ if (isNullOrWhitespace(newValue)) {
186
+ return 'Postcode is required.';
187
+ }
188
+ else if (!regex.test(newValue)) {
189
+ return 'Enter a valid postcode.';
190
+ }
191
+ else {
192
+ return null;
193
+ }
194
+ }
195
+ }
196
+ export class FundAddressState extends FormField {
197
+ constructor(value) {
198
+ super('State', 'state', value);
199
+ }
200
+ get options() {
201
+ return [
202
+ { value: 'NSW', label: 'NSW' },
203
+ { value: 'QLD', label: 'QLD' },
204
+ { value: 'ACT', label: 'ACT' },
205
+ { value: 'VIC', label: 'VIC' },
206
+ { value: 'TAS', label: 'TAS' },
207
+ { value: 'WA', label: 'WA' },
208
+ { value: 'SA', label: 'SA' },
209
+ { value: 'NT', label: 'NT' }
210
+ ];
211
+ }
212
+ validateAndReturnErrorMessage(newValue) {
213
+ if (isNullOrWhitespace(newValue)) {
214
+ return 'State is required.';
215
+ }
216
+ else if (this.options.find((option) => (option.value = newValue)) === undefined) {
217
+ return 'Enter a valid state.';
218
+ }
219
+ else {
220
+ return null;
221
+ }
222
+ }
223
+ }
224
+ export class FundAddress extends StaticFormField {
225
+ constructor(addrLine1, addrLine2, city, state, postcode) {
226
+ const value = [addrLine1, addrLine2, city, state, postcode]
227
+ .map((x) => x.value)
228
+ .filter((v) => v)
229
+ .join(', ');
230
+ const isValid = addrLine1.isValid && addrLine2.isValid && city.isValid && state.isValid && postcode.isValid;
231
+ super('Fund address', 'fund-address', value, isValid);
232
+ }
233
+ }
234
+ export class BankAccountName extends FormField {
235
+ constructor(value) {
236
+ super('Account name', 'account-name', value);
237
+ }
238
+ validateAndReturnErrorMessage(newValue) {
239
+ if (isNullOrWhitespace(newValue)) {
240
+ return 'Account name is required.';
241
+ }
242
+ else if (newValue.length < 2) {
243
+ return 'Enter a valid Account name.';
244
+ }
245
+ else {
246
+ return null;
247
+ }
248
+ }
249
+ }
250
+ export class BankName extends StaticFormField {
251
+ constructor(value, isValid) {
252
+ super('Bank name', 'bank-name', value, isValid);
253
+ }
254
+ }
255
+ export class BankAccountBsb extends FormField {
256
+ constructor(value) {
257
+ super('BSB', 'bsb', value);
258
+ }
259
+ validateAndReturnErrorMessage(newValue) {
260
+ const regex = /^[0-9]{6,7}$/;
261
+ if (isNullOrWhitespace(newValue)) {
262
+ return 'BSB is required.';
263
+ }
264
+ else if (!regex.test(newValue)) {
265
+ return 'Enter a valid BSB.';
266
+ }
267
+ else {
268
+ return null;
269
+ }
270
+ }
271
+ }
272
+ export class BankAccountNumber extends FormField {
273
+ constructor(value) {
274
+ super('Account number', 'account-number', value);
275
+ }
276
+ validateAndReturnErrorMessage(newValue) {
277
+ const regex = /^[0-9]{2,11}$/;
278
+ if (isNullOrWhitespace(newValue)) {
279
+ return 'Account number is required.';
280
+ }
281
+ else if (!regex.test(newValue)) {
282
+ return 'Enter a valid Account number.';
283
+ }
284
+ else {
285
+ return null;
286
+ }
287
+ }
288
+ }