@flarehr/apollo-super-selection 5.86.53344 → 5.88.58802

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 (87) hide show
  1. package/dist/lib/apollo-super-selection/apollo-super-selection.esm.js +1 -1
  2. package/dist/lib/apollo-super-selection/p-035b3fcf.system.js +1 -0
  3. package/dist/lib/apollo-super-selection/p-10c435ea.system.entry.js +1 -0
  4. package/dist/lib/apollo-super-selection/p-157712cb.entry.js +1 -0
  5. package/dist/lib/apollo-super-selection/p-19a451d6.entry.js +1 -0
  6. package/dist/lib/apollo-super-selection/p-19be074b.entry.js +1 -0
  7. package/dist/lib/apollo-super-selection/p-240b48ec.system.entry.js +1 -0
  8. package/dist/lib/apollo-super-selection/p-36ea14fc.entry.js +14 -0
  9. package/dist/lib/apollo-super-selection/p-3cec4189.system.entry.js +1 -0
  10. package/dist/lib/apollo-super-selection/p-524b1ff5.system.js +1 -0
  11. package/dist/lib/apollo-super-selection/p-6a4fc9a6.js +1 -0
  12. package/dist/lib/apollo-super-selection/p-7b1087e8.system.js +1 -0
  13. package/dist/lib/apollo-super-selection/p-9640d3ea.js +1 -0
  14. package/dist/lib/apollo-super-selection/p-9a268e32.js +1 -0
  15. package/dist/lib/apollo-super-selection/p-a68b9b0f.system.js +1 -0
  16. package/dist/lib/apollo-super-selection/p-a7025e9f.js +1 -0
  17. package/dist/lib/apollo-super-selection/p-b819e464.system.entry.js +69 -0
  18. package/dist/lib/apollo-super-selection/p-b88cf353.system.js +1 -0
  19. package/dist/lib/apollo-super-selection/p-bd6e6a8f.system.js +1 -1
  20. package/dist/lib/apollo-super-selection/p-d5c7a35f.js +1 -0
  21. package/dist/lib/apollo-super-selection/p-e435c64b.entry.js +1 -0
  22. package/dist/lib/apollo-super-selection/p-f924ae7d.system.entry.js +1 -0
  23. package/dist/lib/cjs/apollo-super-selection.cjs.js +1 -1
  24. package/dist/lib/cjs/australian-fund-lookup.service-ee589d6c.js +19 -0
  25. package/dist/lib/cjs/custom-fund.store-f56ea1fb.js +37 -0
  26. package/dist/lib/cjs/event-tracking.service-35513098.js +296 -0
  27. package/dist/lib/cjs/injectHistory-eb188cf0.js +9 -0
  28. package/dist/lib/cjs/loader.cjs.js +1 -1
  29. package/dist/lib/cjs/{sss-button_32.cjs.entry.js → sss-button_33.cjs.entry.js} +579 -387
  30. package/dist/lib/cjs/sss-default-fund-router.cjs.entry.js +23 -0
  31. package/dist/lib/cjs/sss-default-fund.cjs.entry.js +61 -0
  32. package/dist/lib/cjs/sss-promoted-fund-router.cjs.entry.js +23 -0
  33. package/dist/lib/cjs/sss-super-byof-host.cjs.entry.js +24 -21
  34. package/dist/lib/cjs/{custom-fund-choice.api-293c1ace.js → super-selection-app.service-352ccc67.js} +12 -331
  35. package/dist/lib/collection/collection-manifest.json +6 -1
  36. package/dist/lib/collection/components/default-fund/super-default-fund-types.js +1 -0
  37. package/dist/lib/collection/components/default-fund/super-default-fund.js +130 -0
  38. package/dist/lib/collection/components/promoted-fund/super-promoted-fund-types.js +1 -0
  39. package/dist/lib/collection/components/promoted-fund/super-promoted-fund.js +194 -0
  40. package/dist/lib/collection/components/super-selection-app/funds/custom-fund/default-fund/default-fund-router.js +37 -0
  41. package/dist/lib/collection/components/super-selection-app/funds/promoted-fund/promoted-fund-router.js +37 -0
  42. package/dist/lib/collection/components/super-selection-app/services/super-selection-app.routes.js +2 -2
  43. package/dist/lib/collection/components/super-selection-app/services/super-selection-app.service.js +8 -0
  44. package/dist/lib/collection/components/super-selection-app/services/super-selection.store.js +3 -1
  45. package/dist/lib/esm/apollo-super-selection.js +1 -1
  46. package/dist/lib/esm/australian-fund-lookup.service-139f6b9d.js +17 -0
  47. package/dist/lib/esm/custom-fund.store-59962585.js +36 -0
  48. package/dist/lib/esm/event-tracking.service-83984310.js +290 -0
  49. package/dist/lib/esm/injectHistory-e92e4664.js +7 -0
  50. package/dist/lib/esm/loader.js +1 -1
  51. package/dist/lib/esm/{sss-button_32.entry.js → sss-button_33.entry.js} +289 -98
  52. package/dist/lib/esm/sss-default-fund-router.entry.js +19 -0
  53. package/dist/lib/esm/sss-default-fund.entry.js +57 -0
  54. package/dist/lib/esm/sss-promoted-fund-router.entry.js +19 -0
  55. package/dist/lib/esm/sss-super-byof-host.entry.js +4 -1
  56. package/dist/lib/esm/{custom-fund-choice.api-42801d64.js → super-selection-app.service-312ba6b0.js} +13 -327
  57. package/dist/lib/esm-es5/apollo-super-selection.js +1 -1
  58. package/dist/lib/esm-es5/australian-fund-lookup.service-139f6b9d.js +1 -0
  59. package/dist/lib/esm-es5/custom-fund.store-59962585.js +1 -0
  60. package/dist/lib/esm-es5/event-tracking.service-83984310.js +1 -0
  61. package/dist/lib/esm-es5/injectHistory-e92e4664.js +1 -0
  62. package/dist/lib/esm-es5/loader.js +1 -1
  63. package/dist/lib/esm-es5/sss-button_33.entry.js +69 -0
  64. package/dist/lib/esm-es5/sss-default-fund-router.entry.js +1 -0
  65. package/dist/lib/esm-es5/sss-default-fund.entry.js +1 -0
  66. package/dist/lib/esm-es5/sss-promoted-fund-router.entry.js +1 -0
  67. package/dist/lib/esm-es5/sss-super-byof-host.entry.js +1 -1
  68. package/dist/lib/esm-es5/super-selection-app.service-312ba6b0.js +1 -0
  69. package/dist/lib/types/components/default-fund/super-default-fund-types.d.ts +23 -0
  70. package/dist/lib/types/components/default-fund/super-default-fund.d.ts +20 -0
  71. package/dist/lib/types/components/promoted-fund/super-promoted-fund-types.d.ts +41 -0
  72. package/dist/lib/types/components/promoted-fund/super-promoted-fund.d.ts +23 -0
  73. package/dist/lib/types/components/super-selection-app/api/super-selection.api.dto.d.ts +2 -0
  74. package/dist/lib/types/components/super-selection-app/funds/custom-fund/default-fund/default-fund-router.d.ts +5 -0
  75. package/dist/lib/types/components/super-selection-app/funds/promoted-fund/promoted-fund-router.d.ts +5 -0
  76. package/dist/lib/types/components/super-selection-app/services/super-selection-app.service.d.ts +2 -0
  77. package/dist/lib/types/components/super-selection-app/services/super-selection.store.d.ts +2 -0
  78. package/dist/lib/types/components.d.ts +60 -0
  79. package/package.json +3 -2
  80. package/dist/lib/apollo-super-selection/p-24d6e2b8.js +0 -1
  81. package/dist/lib/apollo-super-selection/p-40bfe38f.entry.js +0 -14
  82. package/dist/lib/apollo-super-selection/p-a0063575.system.entry.js +0 -1
  83. package/dist/lib/apollo-super-selection/p-b00f648b.entry.js +0 -1
  84. package/dist/lib/apollo-super-selection/p-b2de6265.system.entry.js +0 -69
  85. package/dist/lib/apollo-super-selection/p-cd3ed541.system.js +0 -1
  86. package/dist/lib/esm-es5/custom-fund-choice.api-42801d64.js +0 -1
  87. package/dist/lib/esm-es5/sss-button_32.entry.js +0 -69
@@ -1,7 +1,11 @@
1
- import { r as registerInstance, h, F as Fragment, g as getAssetPath, H as Host, c as createEvent, s as setErrorHandler, a as getElement, d as getContext } from './index-107d7c24.js';
1
+ import { r as registerInstance, h, F as Fragment, H as Host, c as createEvent, g as getAssetPath, s as setErrorHandler, a as getElement, d as getContext } from './index-107d7c24.js';
2
2
  import { f as from, m as map, S as SimpleOuterSubscriber, a as SimpleInnerSubscriber, i as innerSubscribe, b as isArray, O as Observable, c as isFunction, d as async, g as Subscriber, h as distinctUntilChanged, j as filter, k as StoreConfig, l as Store, Q as Query } from './datorama-akita-127aea91.js';
3
- import { n as none, i as isSome, s as some, a as superSelectionAppService, b as navigationService, S as SuperSelectionAppRoutes, c as injectHistory, C as CustomFundTypes, d as superSelectionApi, O as Option, E as EventTrackingService, e as customFundChoiceApi, f as isNone, g as getPromotedFundId, h as buildBackendApiClient, j as getSuperChoiceUsi, k as getSuperChoiceMemberNumber, l as state, m as state$1, t as toUndefined, o as slate, p as SuperCampaignComponentStatus, q as iframe, r as superSelectionAppStencilRoutes, u as factory, v as fromNullable } from './custom-fund-choice.api-42801d64.js';
3
+ import { n as none, i as isSome, s as some, a as superSelectionAppService, O as Option, b as isNone, g as getPromotedFundId, c as buildBackendApiClient, d as getSuperChoiceUsi, e as getSuperChoiceMemberNumber, S as SuperCampaignComponentStatus, t as toUndefined, f as superSelectionApi, h as slate, j as factory, k as fromNullable } from './super-selection-app.service-312ba6b0.js';
4
4
  import { A as ActiveRouter } from './active-router-d18b36fb.js';
5
+ import { i as injectHistory } from './injectHistory-e92e4664.js';
6
+ import { n as navigationService, S as SuperSelectionAppRoutes, E as EventTrackingService, c as customFundChoiceApi, s as state$1, i as iframe, a as superSelectionAppStencilRoutes } from './event-tracking.service-83984310.js';
7
+ import { C as CustomFundTypes, s as state } from './custom-fund.store-59962585.js';
8
+ import { a as australianFundLookupService } from './australian-fund-lookup.service-139f6b9d.js';
5
9
 
6
10
  function noop() { }
7
11
 
@@ -261,7 +265,7 @@ class TapSubscriber extends Subscriber {
261
265
  }
262
266
  }
263
267
 
264
- const AppVersion = '5.86.53344';
268
+ const AppVersion = '5.88.58802';
265
269
 
266
270
  class Lazy {
267
271
  constructor(factory) {
@@ -916,70 +920,97 @@ const CustomFund = class {
916
920
  };
917
921
  injectHistory(CustomFund);
918
922
 
919
- class AustralianFundLookupService {
920
- async searchFundsAsync(searchString, maxRecordCount) {
921
- return superSelectionApi.getAustralianFundsAsync({
922
- searchString,
923
- maxRecordCount
924
- });
925
- }
926
- async getFundAsync(usi, includeInactive) {
927
- const result = await superSelectionApi.getAustralianFundAsync(usi, includeInactive);
928
- return Option.some(result);
929
- }
930
- }
931
- const australianFundLookupService = new AustralianFundLookupService();
923
+ const LoadWaitingTimeout = 30000;
932
924
 
933
- const DefaultFund = class {
925
+ var SuperDefaultFundComponentStatus;
926
+ (function (SuperDefaultFundComponentStatus) {
927
+ SuperDefaultFundComponentStatus[SuperDefaultFundComponentStatus["NotLoaded"] = 1] = "NotLoaded";
928
+ SuperDefaultFundComponentStatus[SuperDefaultFundComponentStatus["Loaded"] = 2] = "Loaded";
929
+ })(SuperDefaultFundComponentStatus || (SuperDefaultFundComponentStatus = {}));
930
+ let superDefaultFundComponentStatus = SuperDefaultFundComponentStatus.NotLoaded;
931
+ const SuperDefaultFundHost = class {
934
932
  constructor(hostRef) {
935
933
  registerInstance(this, hostRef);
936
- this.defaultFundProductName = 'Loading fund...';
934
+ this.productName = 'Employer’s default fund';
937
935
  this.eventTrackingService = EventTrackingService.Instance;
936
+ this.subscribeToSuperDefaultFundEvents = () => {
937
+ for (const eventName in this.defaultFundEventHandlers) {
938
+ document.addEventListener(eventName, this.defaultFundEventHandlers[eventName]);
939
+ }
940
+ };
941
+ this.unSubscribeFromSuperDefaultFundEvents = () => {
942
+ for (const eventName in this.defaultFundEventHandlers) {
943
+ document.removeEventListener(eventName, this.defaultFundEventHandlers[eventName]);
944
+ }
945
+ };
946
+ this.defaultFundLoaded = async (event) => {
947
+ var _a;
948
+ if (event.detail.sender === 'super-default-fund') {
949
+ superDefaultFundComponentStatus = SuperDefaultFundComponentStatus.Loaded;
950
+ clearTimeout(this.loadingTimeoutRef);
951
+ await this.eventTrackingService.TrackDefaultSuperFundDetailViewedAsync({
952
+ fundUsi: (_a = event.detail.fundUsi) !== null && _a !== void 0 ? _a : '',
953
+ fundName: this.productName,
954
+ promotedFundsShown: superSelectionAppService.promotedFunds,
955
+ defaultFundUsiSet: Option.toUndefined(superSelectionAppService.defaultFundUsi)
956
+ });
957
+ }
958
+ return Promise.resolve();
959
+ };
960
+ this.defaultFundCompleted = async (event) => {
961
+ if (event.detail.sender === 'super-default-fund') {
962
+ navigationService.navigateInternallyToStandardChoice({
963
+ history: this.history,
964
+ fundName: this.productName,
965
+ fundDetails: {
966
+ type: 'default',
967
+ fundName: this.productName,
968
+ fundUsi: event.detail.fundUsi
969
+ },
970
+ handleSubmitFn: async (standardChoiceFormSignature) => {
971
+ await customFundChoiceApi.submitDefaultFundChoiceAsync(Object.assign({ standardChoiceFormSignature }, superSelectionAppService.promotedFundsConfig));
972
+ }
973
+ });
974
+ }
975
+ };
976
+ this.defaultFundCancelled = async (event) => {
977
+ if (event.detail.sender === 'super-default-fund') {
978
+ navigationService.navigateInternally(this.history, SuperSelectionAppRoutes.ChoicePage);
979
+ }
980
+ };
981
+ this.defaultFundEventHandlers = {
982
+ 'default-fund-loaded': this.defaultFundLoaded.bind(this),
983
+ 'default-fund-completed': this.defaultFundCompleted.bind(this),
984
+ 'default-fund-cancelled': this.defaultFundCancelled.bind(this)
985
+ };
938
986
  }
939
987
  async componentWillLoad() {
940
- const defaultFundUsi = superSelectionAppService.defaultFundUsi;
941
- if (Option.isNone(defaultFundUsi)) {
942
- return;
988
+ if (Option.isSome(superSelectionAppService.backendUrl) &&
989
+ Option.isSome(superSelectionAppService.state.jwt)) {
990
+ this.backendUrl = superSelectionAppService.backendUrl.value;
991
+ this.accessToken = superSelectionAppService.state.jwt.value;
992
+ if (superDefaultFundComponentStatus === SuperDefaultFundComponentStatus.NotLoaded) {
993
+ this.loadingTimeoutRef = setTimeout(this.defaultFundLoadingTimeoutTriggered.bind(this), LoadWaitingTimeout);
994
+ }
995
+ this.subscribeToSuperDefaultFundEvents();
943
996
  }
944
- this.isDefaultFundExists = true;
945
- const defaultFundSearchResult = await australianFundLookupService.getFundAsync(defaultFundUsi.value, true);
946
- if (Option.isNone(defaultFundSearchResult)) {
947
- this.isInvalidDefaultFund = true;
948
- return;
997
+ else {
998
+ throw Error(`SuperDefaultFundHost pre-requisites not met.`);
949
999
  }
950
- this.defaultFund = defaultFundSearchResult.value;
951
- this.defaultFundProductName = defaultFundSearchResult.value.productName;
952
1000
  }
953
- componentDidLoad() {
954
- var _a, _b, _c, _d;
955
- return this.eventTrackingService.TrackDefaultSuperFundDetailViewedAsync({
956
- fundUsi: (_b = (_a = this.defaultFund) === null || _a === void 0 ? void 0 : _a.usi) !== null && _b !== void 0 ? _b : '',
957
- fundName: (_d = (_c = this.defaultFund) === null || _c === void 0 ? void 0 : _c.productName) !== null && _d !== void 0 ? _d : '',
958
- promotedFundsShown: superSelectionAppService.promotedFunds,
959
- defaultFundUsiSet: Option.toUndefined(superSelectionAppService.defaultFundUsi)
960
- });
1001
+ disconnectedCallback() {
1002
+ clearTimeout(this.loadingTimeoutRef);
961
1003
  }
962
1004
  render() {
963
- return (h(Host, null, h("sss-header-section", null), h("div", { class: "flex justify-center mt-11" }, h("sss-custom-fund", null, h("div", { class: "p-4 sm:p-6 pb-6 sm:pb-8 border shadow-sm rounded-lg" }, h("p", { class: "sm:text-lg font-bold mb-3" }, "Fund details"), (!this.isDefaultFundExists || this.isInvalidDefaultFund) && (h("div", { class: "bg-yellow-50 border-l-4 border-yellow-400 p-4 my-3" }, h("div", { class: "flex" }, h("div", { class: "flex-shrink-0" }, h("img", { class: "h-5 w-5", src: getAssetPath('assets/icon-exclamation.svg') })), h("div", { class: "ml-3 text-sm text-yellow-700 leading-5" }, h("span", null, "It looks like your employer has not specified a default fund, please contact them if you\u2019d like to use your company\u2019s default fund."))))), this.isDefaultFundExists && !this.isInvalidDefaultFund && (h("div", null, h("div", { class: "mt-3" }, h("label", { class: "text-sm font-medium text-gray-700" }, "Fund Name"), h("div", { class: "mt-1 shadow-sm px-3 py-2 rounded-md border border-gray-300 bg-gray-50 text-gray-500 text-base sm:text-sm" }, this.defaultFundProductName)), h("div", { class: "mt-3" }, h("label", { class: "text-sm font-medium text-gray-700" }, "Fund USI"), h("div", { class: "mt-1 shadow-sm px-3 py-2 rounded-md border border-gray-300 bg-gray-50 text-gray-500 text-base sm:text-sm" }, this.defaultFund.usi)), h("div", { class: "mt-8 mb-8 h-px w-full bg-gray-200" }), h("div", { class: "text-sm text-gray-700" }, h("label", { class: "font-semibold text-gray-900" }, "By clicking \u201CContinue\u201D, you acknowledge that:"), h("ul", { class: "list-disc list-outside pl-5" }, h("li", { class: "mt-2" }, "you are choosing to join your employer\u2019s default super fund;"), h("li", { class: "mt-2" }, "your employer will open a new account for you with their default super fund; and"), h("li", { class: "mt-2" }, "your application to join is subject to Trustee approval.")))))), h("div", { class: "flex justify-center mt-8" }, h("div", { class: "sm:max-w-320 w-full" }, this.isDefaultFundExists && !this.isInvalidDefaultFund && (h("div", { class: "mb-4" }, h("sss-button", { testid: "continue-button", fillWidth: true, promiseFn: () => this.handleSubmitForm() }, "Continue"))), h("stencil-route-link", { url: SuperSelectionAppRoutes.ChoicePage }, h("sss-button", { testid: "back-button", fillWidth: true, variant: "secondary" }, "Back"))))))));
1005
+ return (h(Host, null, h("sss-header-section", null), h("div", { class: "flex justify-center mt-11" }, h("sss-custom-fund", null, h("div", null, h("apollo-super-default-fund", { "backend-url": this.backendUrl, "access-token": this.accessToken }))))));
964
1006
  }
965
- async handleSubmitForm() {
966
- if (this.isInvalidDefaultFund) {
967
- return;
1007
+ async defaultFundLoadingTimeoutTriggered() {
1008
+ if (superDefaultFundComponentStatus !== SuperDefaultFundComponentStatus.Loaded) {
1009
+ throw Error(`Default Fund component failed to load.`);
968
1010
  }
969
- navigationService.navigateInternallyToStandardChoice({
970
- history: this.history,
971
- fundName: `Employer’s default fund`,
972
- fundDetails: {
973
- type: 'default',
974
- fundName: this.defaultFundProductName,
975
- fundUsi: this.defaultFund.usi
976
- },
977
- handleSubmitFn: async (standardChoiceFormSignature) => {
978
- await customFundChoiceApi.submitDefaultFundChoiceAsync(Object.assign({ standardChoiceFormSignature }, superSelectionAppService.promotedFundsConfig));
979
- }
980
- });
981
1011
  }
982
1012
  };
1013
+ injectHistory(SuperDefaultFundHost);
983
1014
 
984
1015
  const dropdownAsyncCss = "html{scroll-behavior:smooth}.sss-dropdown-menu{max-height:min(20rem, 50vh)}";
985
1016
 
@@ -2559,6 +2590,206 @@ const PrefillWarningBox = class {
2559
2590
  }
2560
2591
  };
2561
2592
 
2593
+ class SuperCampaignErrorApi {
2594
+ static get Instance() {
2595
+ return this.instance || (this.instance = new this());
2596
+ }
2597
+ async PostError(error) {
2598
+ buildBackendApiClient().url('super-campaign/errors').post(error);
2599
+ }
2600
+ }
2601
+
2602
+ class PromotedFundChoiceApi {
2603
+ async submitChoiceAsync(dto) {
2604
+ return buildBackendApiClient()
2605
+ .url('super-choice/promoted-fund')
2606
+ .post(dto)
2607
+ .badRequest(() => {
2608
+ throw new Error('Failed to process Promoted Fund choice request');
2609
+ })
2610
+ .text();
2611
+ }
2612
+ async submitDefaultChoiceAsync(dto) {
2613
+ return buildBackendApiClient()
2614
+ .url('super-choice/promoted-fund/default')
2615
+ .post(dto)
2616
+ .badRequest(() => {
2617
+ throw new Error('Failed to process Promoted Default Fund choice request');
2618
+ })
2619
+ .text();
2620
+ }
2621
+ async submitDefaultChoiceWithJoinAsync(dto) {
2622
+ return buildBackendApiClient()
2623
+ .url('super-choice/promoted-fund/default-with-join')
2624
+ .post(dto)
2625
+ .badRequest(() => {
2626
+ throw new Error('Failed to process Promoted Default Fund With Join choice request');
2627
+ })
2628
+ .text();
2629
+ }
2630
+ }
2631
+ const promotedFundChoiceApi = new PromotedFundChoiceApi();
2632
+
2633
+ const LoadWaitingTimeout$1 = 30000;
2634
+
2635
+ var SuperPromotedFundComponentStatus;
2636
+ (function (SuperPromotedFundComponentStatus) {
2637
+ SuperPromotedFundComponentStatus[SuperPromotedFundComponentStatus["NotLoaded"] = 1] = "NotLoaded";
2638
+ SuperPromotedFundComponentStatus[SuperPromotedFundComponentStatus["Loaded"] = 2] = "Loaded";
2639
+ })(SuperPromotedFundComponentStatus || (SuperPromotedFundComponentStatus = {}));
2640
+ let superPromotedFundComponentStatus = SuperPromotedFundComponentStatus.NotLoaded;
2641
+ const SuperPromotedFundHost = class {
2642
+ constructor(hostRef) {
2643
+ registerInstance(this, hostRef);
2644
+ this.subscribeToSuperPromotedFundEvents = () => {
2645
+ for (const eventName in this.promotedFundEventHandlers) {
2646
+ document.addEventListener(eventName, this.promotedFundEventHandlers[eventName]);
2647
+ }
2648
+ };
2649
+ this.unSubscribeFromSuperPromotedFundEvents = () => {
2650
+ for (const eventName in this.promotedFundEventHandlers) {
2651
+ document.removeEventListener(eventName, this.promotedFundEventHandlers[eventName]);
2652
+ }
2653
+ };
2654
+ this.promotedFundLoaded = async (event) => {
2655
+ if (event.detail.sender === 'super-promoted-fund') {
2656
+ superPromotedFundComponentStatus = SuperPromotedFundComponentStatus.Loaded;
2657
+ clearTimeout(this.loadingTimeoutRef);
2658
+ }
2659
+ };
2660
+ this.promotedFundCompleted = async (event) => {
2661
+ if (event.detail.sender === 'super-promoted-fund') {
2662
+ const { fundType, fundId, fundUsi, fundName, memberNumber } = event.detail;
2663
+ const fundDetails = this.buildFundDetails(fundType, fundId, fundUsi, fundName, memberNumber);
2664
+ const handleSubmitFn = this.buildHandleSubmitFn(event.detail);
2665
+ navigationService.navigateInternallyToStandardChoice({
2666
+ history: this.history,
2667
+ fundName,
2668
+ promotedFundId: fundId,
2669
+ fundDetails,
2670
+ handleSubmitFn
2671
+ });
2672
+ }
2673
+ };
2674
+ this.promotedFundCancelled = async (event) => {
2675
+ if (event.detail.sender === 'super-promoted-fund') {
2676
+ navigationService.navigateInternally(this.history, SuperSelectionAppRoutes.MyOwnFund);
2677
+ }
2678
+ };
2679
+ this.superCampaignLoadFailed = async (event) => {
2680
+ if (event.detail.sender === 'super-promoted-fund') {
2681
+ await this.activateFallbackMechanism({
2682
+ type: 'SuperCampaignActivationFailed',
2683
+ reason: event.detail.reason || 'Unknown'
2684
+ });
2685
+ }
2686
+ };
2687
+ this.superCampaignFailed = async (event) => {
2688
+ if (event.detail.sender === 'super-promoted-fund') {
2689
+ await this.activateFallbackMechanism({
2690
+ type: 'SuperCampaignOperationFailed',
2691
+ reason: event.detail.reason || 'Unknown'
2692
+ });
2693
+ }
2694
+ };
2695
+ this.promotedFundEventHandlers = {
2696
+ 'promoted-fund-loaded': this.promotedFundLoaded.bind(this),
2697
+ 'promoted-fund-completed': this.promotedFundCompleted.bind(this),
2698
+ 'promoted-fund-cancelled': this.promotedFundCancelled.bind(this),
2699
+ 'super-campaign-load-failed': this.superCampaignLoadFailed.bind(this),
2700
+ 'super-campaign-failed': this.superCampaignFailed.bind(this)
2701
+ };
2702
+ }
2703
+ async componentWillLoad() {
2704
+ if (Option.isSome(superSelectionAppService.backendUrl) &&
2705
+ Option.isSome(superSelectionAppService.state.jwt)) {
2706
+ this.backendUrl = superSelectionAppService.backendUrl.value;
2707
+ this.accessToken = superSelectionAppService.state.jwt.value;
2708
+ superSelectionAppService.hideFooterSection = true;
2709
+ if (superPromotedFundComponentStatus === SuperPromotedFundComponentStatus.NotLoaded) {
2710
+ this.loadingTimeoutRef = setTimeout(this.promotedFundLoadingTimeoutTriggered.bind(this), LoadWaitingTimeout$1);
2711
+ }
2712
+ this.subscribeToSuperPromotedFundEvents();
2713
+ }
2714
+ else {
2715
+ throw Error(`SuperPromotedFundHost pre-requisites not met.`);
2716
+ }
2717
+ }
2718
+ disconnectedCallback() {
2719
+ clearTimeout(this.loadingTimeoutRef);
2720
+ this.unSubscribeFromSuperPromotedFundEvents();
2721
+ superSelectionAppService.hideFooterSection = false;
2722
+ }
2723
+ render() {
2724
+ return (h(Host, null, h("apollo-super-promoted-fund", { "backend-url": this.backendUrl, "access-token": this.accessToken })));
2725
+ }
2726
+ buildFundDetails(fundType, fundId, fundUsi, fundName, memberNumber) {
2727
+ switch (fundType) {
2728
+ case 'Promoted':
2729
+ return {
2730
+ type: 'promoted',
2731
+ fundName,
2732
+ fundUsi,
2733
+ memberNumber: memberNumber !== null && memberNumber !== void 0 ? memberNumber : '',
2734
+ promotedFundId: fundId
2735
+ };
2736
+ case 'PromotedDefault':
2737
+ return {
2738
+ type: 'promotedDefault',
2739
+ fundName,
2740
+ fundUsi,
2741
+ promotedFundId: fundId
2742
+ };
2743
+ case 'PromotedDefaultWithJoin':
2744
+ return {
2745
+ type: 'promotedDefaultWithJoin',
2746
+ fundName,
2747
+ fundUsi,
2748
+ memberNumber: memberNumber !== null && memberNumber !== void 0 ? memberNumber : '',
2749
+ promotedFundId: fundId
2750
+ };
2751
+ }
2752
+ }
2753
+ buildHandleSubmitFn(detail) {
2754
+ const { fundType, fundId, fundUsi, memberNumber, memberFirstName, memberFamilyName, sourceOfJoin, isDefaultExclusive } = detail;
2755
+ const defaultFundUsiSet = Option.toUndefined(superSelectionAppService.defaultFundUsi);
2756
+ const promotedFundsConfig = superSelectionAppService.promotedFundsConfig;
2757
+ switch (fundType) {
2758
+ case 'Promoted':
2759
+ return (standardChoiceFormSignature) => promotedFundChoiceApi.submitChoiceAsync(Object.assign({ fundId, memberNumber: memberNumber !== null && memberNumber !== void 0 ? memberNumber : '', memberFirstName,
2760
+ memberFamilyName, usi: fundUsi, standardChoiceFormSignature,
2761
+ defaultFundUsiSet, placementId: 'panel', sourceOfJoin,
2762
+ isDefaultExclusive }, promotedFundsConfig));
2763
+ case 'PromotedDefault':
2764
+ return (standardChoiceFormSignature) => promotedFundChoiceApi.submitDefaultChoiceAsync(Object.assign({ fundId, usi: fundUsi, standardChoiceFormSignature,
2765
+ defaultFundUsiSet, placementId: 'panel', sourceOfJoin,
2766
+ isDefaultExclusive }, promotedFundsConfig));
2767
+ case 'PromotedDefaultWithJoin':
2768
+ return (standardChoiceFormSignature) => promotedFundChoiceApi.submitDefaultChoiceWithJoinAsync(Object.assign({ fundId, memberNumber: memberNumber !== null && memberNumber !== void 0 ? memberNumber : '', memberFirstName: memberFirstName !== null && memberFirstName !== void 0 ? memberFirstName : '', memberFamilyName: memberFamilyName !== null && memberFamilyName !== void 0 ? memberFamilyName : '', usi: fundUsi, standardChoiceFormSignature,
2769
+ defaultFundUsiSet, placementId: 'panel', sourceOfJoin,
2770
+ isDefaultExclusive }, promotedFundsConfig));
2771
+ }
2772
+ }
2773
+ async activateFallbackMechanism(error) {
2774
+ if (superSelectionAppService.superCampaignComponentStatus !==
2775
+ SuperCampaignComponentStatus.NotWorking) {
2776
+ superSelectionAppService.superCampaignComponentStatus =
2777
+ SuperCampaignComponentStatus.NotWorking;
2778
+ await SuperCampaignErrorApi.Instance.PostError(error);
2779
+ navigationService.navigateInternally(this.history, SuperSelectionAppRoutes.MyOwnFund);
2780
+ }
2781
+ }
2782
+ async promotedFundLoadingTimeoutTriggered() {
2783
+ if (superPromotedFundComponentStatus !== SuperPromotedFundComponentStatus.Loaded) {
2784
+ this.activateFallbackMechanism({
2785
+ type: 'SuperCampaignActivationFailed',
2786
+ reason: `Activation timeout was triggered after:${LoadWaitingTimeout$1 / 1000} seconds`
2787
+ });
2788
+ }
2789
+ }
2790
+ };
2791
+ injectHistory(SuperPromotedFundHost);
2792
+
2562
2793
  const SmsfEngagementStep = class {
2563
2794
  constructor(hostRef) {
2564
2795
  registerInstance(this, hostRef);
@@ -12505,37 +12736,6 @@ class AppInsightsService {
12505
12736
  }
12506
12737
  const appInsights = new AppInsightsService();
12507
12738
 
12508
- class PromotedFundChoiceApi {
12509
- async submitChoiceAsync(dto) {
12510
- return buildBackendApiClient()
12511
- .url('super-choice/promoted-fund')
12512
- .post(dto)
12513
- .badRequest(() => {
12514
- throw new Error('Failed to process Promoted Fund choice request');
12515
- })
12516
- .text();
12517
- }
12518
- async submitDefaultChoiceAsync(dto) {
12519
- return buildBackendApiClient()
12520
- .url('super-choice/promoted-fund/default')
12521
- .post(dto)
12522
- .badRequest(() => {
12523
- throw new Error('Failed to process Promoted Default Fund choice request');
12524
- })
12525
- .text();
12526
- }
12527
- async submitDefaultChoiceWithJoinAsync(dto) {
12528
- return buildBackendApiClient()
12529
- .url('super-choice/promoted-fund/default-with-join')
12530
- .post(dto)
12531
- .badRequest(() => {
12532
- throw new Error('Failed to process Promoted Default Fund With Join choice request');
12533
- })
12534
- .text();
12535
- }
12536
- }
12537
- const promotedFundChoiceApi = new PromotedFundChoiceApi();
12538
-
12539
12739
  class SlateChoiceApi {
12540
12740
  async submitSlateChoiceAsync(dto) {
12541
12741
  return buildBackendApiClient()
@@ -12554,7 +12754,7 @@ const Usi = {
12554
12754
  return usi.replace(/ /g, '');
12555
12755
  }
12556
12756
  };
12557
- const LoadWaitingTimeout = 30000;
12757
+ const LoadWaitingTimeout$2 = 30000;
12558
12758
 
12559
12759
  class PromotedFundJoinedEventHandler {
12560
12760
  constructor(placementId, history) {
@@ -12746,15 +12946,6 @@ const FeaturedFunds = class {
12746
12946
  };
12747
12947
  injectHistory(FeaturedFunds);
12748
12948
 
12749
- class SuperCampaignErrorApi {
12750
- static get Instance() {
12751
- return this.instance || (this.instance = new this());
12752
- }
12753
- async PostError(error) {
12754
- buildBackendApiClient().url('super-campaign/errors').post(error);
12755
- }
12756
- }
12757
-
12758
12949
  const SuperFundDisclaimerViewedDetail = {
12759
12950
  create: (superCampaignEnabled) => {
12760
12951
  let isDefinedBenefitsEligibleString = 'Not set';
@@ -12883,7 +13074,7 @@ const SuperCampaignHost = class {
12883
13074
  SuperCampaignComponentStatus.NotLoaded) {
12884
13075
  superCampaingScriptPath = this.createApolloSuperCampaignScriptUrl();
12885
13076
  await import(superCampaingScriptPath);
12886
- this.loadingTimeoutRef = setTimeout(this.superCampaignLoadingTimeoutTriggered.bind(this), LoadWaitingTimeout);
13077
+ this.loadingTimeoutRef = setTimeout(this.superCampaignLoadingTimeoutTriggered.bind(this), LoadWaitingTimeout$2);
12887
13078
  }
12888
13079
  this.subscribeToSuperCampaignEvents();
12889
13080
  this.scriptImported = true;
@@ -12921,7 +13112,7 @@ const SuperCampaignHost = class {
12921
13112
  if (superSelectionAppService.superCampaignComponentStatus !== SuperCampaignComponentStatus.Loaded) {
12922
13113
  this.activateFallbackMechanism({
12923
13114
  type: 'SuperCampaignActivationFailed',
12924
- reason: `Activation timeout was triggered after:${LoadWaitingTimeout / 1000} seconds`
13115
+ reason: `Activation timeout was triggered after:${LoadWaitingTimeout$2 / 1000} seconds`
12925
13116
  });
12926
13117
  }
12927
13118
  }
@@ -12943,7 +13134,7 @@ const SuperCampaignHost = class {
12943
13134
  };
12944
13135
  injectHistory(SuperCampaignHost);
12945
13136
 
12946
- const LoadWaitingTimeout$1 = 30000;
13137
+ const LoadWaitingTimeout$3 = 30000;
12947
13138
 
12948
13139
  var SuperSmsfComponentStatus;
12949
13140
  (function (SuperSmsfComponentStatus) {
@@ -13031,7 +13222,7 @@ const SuperSmsfHost = class {
13031
13222
  this.backendUrl = superSelectionAppService.backendUrl.value;
13032
13223
  this.accessToken = superSelectionAppService.state.jwt.value;
13033
13224
  if (superSmsfComponentStatus === SuperSmsfComponentStatus.NotLoaded) {
13034
- this.loadingTimeoutRef = setTimeout(this.smsfLoadingTimeoutTriggered.bind(this), LoadWaitingTimeout$1);
13225
+ this.loadingTimeoutRef = setTimeout(this.smsfLoadingTimeoutTriggered.bind(this), LoadWaitingTimeout$3);
13035
13226
  }
13036
13227
  this.subscribeToSuperSmsfEvents();
13037
13228
  }
@@ -14884,4 +15075,4 @@ const SuperSelectionAppHost = class {
14884
15075
  };
14885
15076
  SuperSelectionAppHost.style = superSelectionAppHostCss;
14886
15077
 
14887
- export { Button as sss_button, ChoiceRouter as sss_choice_router, CustomFund as sss_custom_fund, DefaultFund as sss_default_fund, SelectInputAsync as sss_dropdown_async, ExistingChoice as sss_existing_choice_page, FooterSection as sss_footer_section, HeaderSection as sss_header_section, LoadingIndicator as sss_loading_indicator, LoadingPage as sss_loading_page, MyOwnFundEngagementStep as sss_my_own_fund_engagement_step_host, MemberNameInput as sss_name_input, Prefill as sss_prefill, DisplayField as sss_prefill_display_field, PrefillErrorBox as sss_prefill_error_box, PrefillInvalidMyOwnFund as sss_prefill_invalid_my_own_fund, PrefillInvalidSMSF as sss_prefill_invalid_smsf, PrefillMyOwnFund as sss_prefill_my_own_fund, PrefillSMSF as sss_prefill_smsf, PrefillWarningBox as sss_prefill_warning_box, SmsfEngagementStep as sss_smsf_engagement_step_host, StandardChoiceFormInputDefaultFund as sss_standard_choice_form, Success as sss_success, FeaturedFunds as sss_super_campaign_featured_funds, SuperCampaignHost as sss_super_campaign_host, SuperSmsfHost as sss_super_smsf_host, Route as stencil_route, RouteLink$1 as stencil_route_link, RouteSwitch as stencil_route_switch, Router as stencil_router, SuperSelectionApp as super_selection_app, SuperSelectionAppHost as super_selection_app_host };
15078
+ export { Button as sss_button, ChoiceRouter as sss_choice_router, CustomFund as sss_custom_fund, SuperDefaultFundHost as sss_default_fund_host, SelectInputAsync as sss_dropdown_async, ExistingChoice as sss_existing_choice_page, FooterSection as sss_footer_section, HeaderSection as sss_header_section, LoadingIndicator as sss_loading_indicator, LoadingPage as sss_loading_page, MyOwnFundEngagementStep as sss_my_own_fund_engagement_step_host, MemberNameInput as sss_name_input, Prefill as sss_prefill, DisplayField as sss_prefill_display_field, PrefillErrorBox as sss_prefill_error_box, PrefillInvalidMyOwnFund as sss_prefill_invalid_my_own_fund, PrefillInvalidSMSF as sss_prefill_invalid_smsf, PrefillMyOwnFund as sss_prefill_my_own_fund, PrefillSMSF as sss_prefill_smsf, PrefillWarningBox as sss_prefill_warning_box, SuperPromotedFundHost as sss_promoted_fund_host, SmsfEngagementStep as sss_smsf_engagement_step_host, StandardChoiceFormInputDefaultFund as sss_standard_choice_form, Success as sss_success, FeaturedFunds as sss_super_campaign_featured_funds, SuperCampaignHost as sss_super_campaign_host, SuperSmsfHost as sss_super_smsf_host, Route as stencil_route, RouteLink$1 as stencil_route_link, RouteSwitch as stencil_route_switch, Router as stencil_router, SuperSelectionApp as super_selection_app, SuperSelectionAppHost as super_selection_app_host };
@@ -0,0 +1,19 @@
1
+ import { r as registerInstance, h, H as Host } from './index-107d7c24.js';
2
+ import { a as superSelectionAppService } from './super-selection-app.service-312ba6b0.js';
3
+ import './active-router-d18b36fb.js';
4
+ import { i as injectHistory } from './injectHistory-e92e4664.js';
5
+
6
+ const DefaultFundRouter = class {
7
+ constructor(hostRef) {
8
+ registerInstance(this, hostRef);
9
+ }
10
+ render() {
11
+ if (superSelectionAppService.isDefaultFundNewComponentEnabled) {
12
+ return (h(Host, null, h("sss-default-fund-host", { history: this.history })));
13
+ }
14
+ return (h(Host, null, h("sss-default-fund", { history: this.history })));
15
+ }
16
+ };
17
+ injectHistory(DefaultFundRouter);
18
+
19
+ export { DefaultFundRouter as sss_default_fund_router };
@@ -0,0 +1,57 @@
1
+ import { r as registerInstance, h, g as getAssetPath, H as Host } from './index-107d7c24.js';
2
+ import { O as Option, a as superSelectionAppService } from './super-selection-app.service-312ba6b0.js';
3
+ import { E as EventTrackingService, S as SuperSelectionAppRoutes, n as navigationService, c as customFundChoiceApi } from './event-tracking.service-83984310.js';
4
+ import { a as australianFundLookupService } from './australian-fund-lookup.service-139f6b9d.js';
5
+
6
+ const DefaultFund = class {
7
+ constructor(hostRef) {
8
+ registerInstance(this, hostRef);
9
+ this.defaultFundProductName = 'Loading fund...';
10
+ this.eventTrackingService = EventTrackingService.Instance;
11
+ }
12
+ async componentWillLoad() {
13
+ const defaultFundUsi = superSelectionAppService.defaultFundUsi;
14
+ if (Option.isNone(defaultFundUsi)) {
15
+ return;
16
+ }
17
+ this.isDefaultFundExists = true;
18
+ const defaultFundSearchResult = await australianFundLookupService.getFundAsync(defaultFundUsi.value, true);
19
+ if (Option.isNone(defaultFundSearchResult)) {
20
+ this.isInvalidDefaultFund = true;
21
+ return;
22
+ }
23
+ this.defaultFund = defaultFundSearchResult.value;
24
+ this.defaultFundProductName = defaultFundSearchResult.value.productName;
25
+ }
26
+ componentDidLoad() {
27
+ var _a, _b, _c, _d;
28
+ return this.eventTrackingService.TrackDefaultSuperFundDetailViewedAsync({
29
+ fundUsi: (_b = (_a = this.defaultFund) === null || _a === void 0 ? void 0 : _a.usi) !== null && _b !== void 0 ? _b : '',
30
+ fundName: (_d = (_c = this.defaultFund) === null || _c === void 0 ? void 0 : _c.productName) !== null && _d !== void 0 ? _d : '',
31
+ promotedFundsShown: superSelectionAppService.promotedFunds,
32
+ defaultFundUsiSet: Option.toUndefined(superSelectionAppService.defaultFundUsi)
33
+ });
34
+ }
35
+ render() {
36
+ return (h(Host, null, h("sss-header-section", null), h("div", { class: "flex justify-center mt-11" }, h("sss-custom-fund", null, h("div", { class: "p-4 sm:p-6 pb-6 sm:pb-8 border shadow-sm rounded-lg" }, h("p", { class: "sm:text-lg font-bold mb-3" }, "Fund details"), (!this.isDefaultFundExists || this.isInvalidDefaultFund) && (h("div", { class: "bg-yellow-50 border-l-4 border-yellow-400 p-4 my-3" }, h("div", { class: "flex" }, h("div", { class: "flex-shrink-0" }, h("img", { class: "h-5 w-5", src: getAssetPath('assets/icon-exclamation.svg') })), h("div", { class: "ml-3 text-sm text-yellow-700 leading-5" }, h("span", null, "It looks like your employer has not specified a default fund, please contact them if you\u2019d like to use your company\u2019s default fund."))))), this.isDefaultFundExists && !this.isInvalidDefaultFund && (h("div", null, h("div", { class: "mt-3" }, h("label", { class: "text-sm font-medium text-gray-700" }, "Fund Name"), h("div", { class: "mt-1 shadow-sm px-3 py-2 rounded-md border border-gray-300 bg-gray-50 text-gray-500 text-base sm:text-sm" }, this.defaultFundProductName)), h("div", { class: "mt-3" }, h("label", { class: "text-sm font-medium text-gray-700" }, "Fund USI"), h("div", { class: "mt-1 shadow-sm px-3 py-2 rounded-md border border-gray-300 bg-gray-50 text-gray-500 text-base sm:text-sm" }, this.defaultFund.usi)), h("div", { class: "mt-8 mb-8 h-px w-full bg-gray-200" }), h("div", { class: "text-sm text-gray-700" }, h("label", { class: "font-semibold text-gray-900" }, "By clicking \u201CContinue\u201D, you acknowledge that:"), h("ul", { class: "list-disc list-outside pl-5" }, h("li", { class: "mt-2" }, "you are choosing to join your employer\u2019s default super fund;"), h("li", { class: "mt-2" }, "your employer will open a new account for you with their default super fund; and"), h("li", { class: "mt-2" }, "your application to join is subject to Trustee approval.")))))), h("div", { class: "flex justify-center mt-8" }, h("div", { class: "sm:max-w-320 w-full" }, this.isDefaultFundExists && !this.isInvalidDefaultFund && (h("div", { class: "mb-4" }, h("sss-button", { testid: "continue-button", fillWidth: true, promiseFn: () => this.handleSubmitForm() }, "Continue"))), h("stencil-route-link", { url: SuperSelectionAppRoutes.ChoicePage }, h("sss-button", { testid: "back-button", fillWidth: true, variant: "secondary" }, "Back"))))))));
37
+ }
38
+ async handleSubmitForm() {
39
+ if (this.isInvalidDefaultFund) {
40
+ return;
41
+ }
42
+ navigationService.navigateInternallyToStandardChoice({
43
+ history: this.history,
44
+ fundName: `Employer’s default fund`,
45
+ fundDetails: {
46
+ type: 'default',
47
+ fundName: this.defaultFundProductName,
48
+ fundUsi: this.defaultFund.usi
49
+ },
50
+ handleSubmitFn: async (standardChoiceFormSignature) => {
51
+ await customFundChoiceApi.submitDefaultFundChoiceAsync(Object.assign({ standardChoiceFormSignature }, superSelectionAppService.promotedFundsConfig));
52
+ }
53
+ });
54
+ }
55
+ };
56
+
57
+ export { DefaultFund as sss_default_fund };
@@ -0,0 +1,19 @@
1
+ import { r as registerInstance, h, H as Host } from './index-107d7c24.js';
2
+ import { a as superSelectionAppService } from './super-selection-app.service-312ba6b0.js';
3
+ import './active-router-d18b36fb.js';
4
+ import { i as injectHistory } from './injectHistory-e92e4664.js';
5
+
6
+ const PromotedFundRouter = class {
7
+ constructor(hostRef) {
8
+ registerInstance(this, hostRef);
9
+ }
10
+ render() {
11
+ if (superSelectionAppService.isPromotedFundNewComponentEnabled) {
12
+ return (h(Host, null, h("sss-promoted-fund-host", { history: this.history })));
13
+ }
14
+ return (h(Host, null, h("sss-super-campaign-host", { history: this.history })));
15
+ }
16
+ };
17
+ injectHistory(PromotedFundRouter);
18
+
19
+ export { PromotedFundRouter as sss_promoted_fund_router };
@@ -1,6 +1,9 @@
1
1
  import { r as registerInstance, h, H as Host } from './index-107d7c24.js';
2
- import { E as EventTrackingService, a as superSelectionAppService, O as Option, l as state, b as navigationService, S as SuperSelectionAppRoutes, e as customFundChoiceApi, c as injectHistory } from './custom-fund-choice.api-42801d64.js';
2
+ import { a as superSelectionAppService, O as Option } from './super-selection-app.service-312ba6b0.js';
3
3
  import './active-router-d18b36fb.js';
4
+ import { i as injectHistory } from './injectHistory-e92e4664.js';
5
+ import { E as EventTrackingService, n as navigationService, S as SuperSelectionAppRoutes, c as customFundChoiceApi } from './event-tracking.service-83984310.js';
6
+ import { s as state } from './custom-fund.store-59962585.js';
4
7
 
5
8
  const LoadWaitingTimeout = 30000;
6
9