@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.
- package/dist/lib/apollo-super-selection/apollo-super-selection.css +1 -0
- package/dist/lib/apollo-super-selection/apollo-super-selection.esm.js +1 -0
- package/dist/lib/apollo-super-selection/apollo-super-selection.js +130 -0
- package/dist/lib/apollo-super-selection/assets/icon-exclamation.svg +3 -0
- package/dist/lib/apollo-super-selection/assets/icon-information-circle.svg +3 -0
- package/dist/lib/apollo-super-selection/index.esm.js +0 -0
- package/dist/lib/apollo-super-selection/p-02f24922.system.entry.js +1 -0
- package/dist/lib/apollo-super-selection/p-071b8545.entry.js +1 -0
- package/dist/lib/apollo-super-selection/p-0a384ec4.entry.js +14 -0
- package/dist/lib/apollo-super-selection/p-14885f78.system.js +15 -0
- package/dist/lib/apollo-super-selection/p-15f0e5eb.system.js +1 -0
- package/dist/lib/apollo-super-selection/p-23cfdd82.entry.js +1 -0
- package/dist/lib/apollo-super-selection/p-29c11183.js +15 -0
- package/dist/lib/apollo-super-selection/p-44bec843.system.js +1 -0
- package/dist/lib/apollo-super-selection/p-50ea2036.system.js +1 -0
- package/dist/lib/apollo-super-selection/p-51aefdb1.system.entry.js +1 -0
- package/dist/lib/apollo-super-selection/p-51c6dd08.js +1 -0
- package/dist/lib/apollo-super-selection/p-6ac8791e.system.entry.js +1 -0
- package/dist/lib/apollo-super-selection/p-7a89efaf.js +1 -0
- package/dist/lib/apollo-super-selection/p-80178f87.system.js +1 -0
- package/dist/lib/apollo-super-selection/p-86e3e03f.js +1 -0
- package/dist/lib/apollo-super-selection/p-9c855634.entry.js +1 -0
- package/dist/lib/apollo-super-selection/p-b2bb0763.system.entry.js +69 -0
- package/dist/lib/apollo-super-selection/p-b89b68db.entry.js +1 -0
- package/dist/lib/apollo-super-selection/p-bdcfc026.system.js +1 -0
- package/dist/lib/apollo-super-selection/p-ef3afa00.system.entry.js +1 -0
- package/dist/lib/apollo-super-selection/p-f29066b9.system.entry.js +1 -0
- package/dist/lib/apollo-super-selection/p-fcb4050d.entry.js +1 -0
- package/dist/lib/cjs/active-router-1f555f75.js +75 -0
- package/dist/lib/cjs/apollo-super-selection.cjs.js +22 -0
- package/dist/lib/cjs/app-globals-b1125d8c.js +25 -0
- package/dist/lib/cjs/context-consumer.cjs.entry.js +29 -0
- package/dist/lib/cjs/datorama-akita-6c9cb8fb.js +3641 -0
- package/dist/lib/cjs/index-eb4f212f.js +1766 -0
- package/dist/lib/cjs/index.cjs.js +2 -0
- package/dist/lib/cjs/loader.cjs.js +24 -0
- package/dist/lib/cjs/sss-button_31.cjs.entry.js +17977 -0
- package/dist/lib/cjs/stencil-async-content.cjs.entry.js +32 -0
- package/dist/lib/cjs/stencil-route-title.cjs.entry.js +32 -0
- package/dist/lib/cjs/stencil-router-prompt.cjs.entry.js +59 -0
- package/dist/lib/cjs/stencil-router-redirect.cjs.entry.js +32 -0
- package/dist/lib/collection/apollo-super-selection.css +1 -0
- package/dist/lib/collection/collection-manifest.json +95 -0
- package/dist/lib/collection/components/app-host/loading-page.js +9 -0
- package/dist/lib/collection/components/app-host/services/app-configuration.query.js +18 -0
- package/dist/lib/collection/components/app-host/services/app-configuration.service.js +25 -0
- package/dist/lib/collection/components/app-host/services/app-parameters.query.js +13 -0
- package/dist/lib/collection/components/app-host/services/app-parameters.service.js +14 -0
- package/dist/lib/collection/components/app-host/services/appinsights.service.js +46 -0
- package/dist/lib/collection/components/app-host/services/authentication.query.js +21 -0
- package/dist/lib/collection/components/app-host/services/authentication.service.js +50 -0
- package/dist/lib/collection/components/app-host/services/interop/host-interop.service.js +31 -0
- package/dist/lib/collection/components/app-host/services/interop/iframe-interop.service.js +30 -0
- package/dist/lib/collection/components/app-host/services/interop/react-native-interop.service.js +20 -0
- package/dist/lib/collection/components/app-host/services/interop.query.js +26 -0
- package/dist/lib/collection/components/app-host/services/session.store.js +38 -0
- package/dist/lib/collection/components/app-host/super-selection-app-host.css +24 -0
- package/dist/lib/collection/components/app-host/super-selection-app-host.js +87 -0
- package/dist/lib/collection/components/external-loading-page/external-loading-page.js +29 -0
- package/dist/lib/collection/components/super-campaign/super-campaign-types.js +6 -0
- package/dist/lib/collection/components/super-campaign/super-campaign.js +361 -0
- package/dist/lib/collection/components/super-selection-app/api/api-client.js +14 -0
- package/dist/lib/collection/components/super-selection-app/api/event-tracking.api.js +9 -0
- package/dist/lib/collection/components/super-selection-app/api/super-campaign-errors-api.js +9 -0
- package/dist/lib/collection/components/super-selection-app/api/super-campaign-errors.api.dtos.js +1 -0
- package/dist/lib/collection/components/super-selection-app/api/super-selection-events.model.js +16 -0
- package/dist/lib/collection/components/super-selection-app/api/super-selection.api.dto.js +179 -0
- package/dist/lib/collection/components/super-selection-app/api/super-selection.api.js +69 -0
- package/dist/lib/collection/components/super-selection-app/app-state-pages/success.js +36 -0
- package/dist/lib/collection/components/super-selection-app/assets/icon-exclamation.svg +3 -0
- package/dist/lib/collection/components/super-selection-app/assets/icon-information-circle.svg +3 -0
- package/dist/lib/collection/components/super-selection-app/existing-choice/existing-choice.js +163 -0
- package/dist/lib/collection/components/super-selection-app/footer-section/footer-section.js +39 -0
- package/dist/lib/collection/components/super-selection-app/funds/custom-fund/api/custom-fund-choice.api.dto.js +1 -0
- package/dist/lib/collection/components/super-selection-app/funds/custom-fund/api/custom-fund-choice.api.js +50 -0
- package/dist/lib/collection/components/super-selection-app/funds/custom-fund/custom-fund.js +86 -0
- package/dist/lib/collection/components/super-selection-app/funds/custom-fund/custom-fund.store.js +53 -0
- package/dist/lib/collection/components/super-selection-app/funds/custom-fund/default-fund/default-fund.js +114 -0
- package/dist/lib/collection/components/super-selection-app/funds/custom-fund/member-name-input.js +162 -0
- package/dist/lib/collection/components/super-selection-app/funds/custom-fund/my-own-fund/my-own-fund-inputs.js +143 -0
- package/dist/lib/collection/components/super-selection-app/funds/custom-fund/my-own-fund/my-own-fund.js +118 -0
- package/dist/lib/collection/components/super-selection-app/funds/custom-fund/self-managed-fund/abn-validation.js +11 -0
- package/dist/lib/collection/components/super-selection-app/funds/custom-fund/self-managed-fund/bankBsbNumbers.js +111 -0
- package/dist/lib/collection/components/super-selection-app/funds/custom-fund/self-managed-fund/self-managed-fund-inputs.js +253 -0
- package/dist/lib/collection/components/super-selection-app/funds/custom-fund/self-managed-fund/self-managed-fund.form.js +1 -0
- package/dist/lib/collection/components/super-selection-app/funds/custom-fund/self-managed-fund/self-managed-fund.js +121 -0
- package/dist/lib/collection/components/super-selection-app/funds/promoted-fund/api/promoted-fund-choice.api.dto.js +1 -0
- package/dist/lib/collection/components/super-selection-app/funds/promoted-fund/api/promoted-fund-choice.api.js +31 -0
- package/dist/lib/collection/components/super-selection-app/funds/slate-super/api/slate-choice.api.dto.js +1 -0
- package/dist/lib/collection/components/super-selection-app/funds/slate-super/api/slate-choice.api.js +13 -0
- package/dist/lib/collection/components/super-selection-app/funds/slate-super/api/slate.js +4 -0
- package/dist/lib/collection/components/super-selection-app/header-section/header-section.js +53 -0
- package/dist/lib/collection/components/super-selection-app/misc/button.js +195 -0
- package/dist/lib/collection/components/super-selection-app/misc/dropdown-async.css +7 -0
- package/dist/lib/collection/components/super-selection-app/misc/dropdown-async.js +390 -0
- package/dist/lib/collection/components/super-selection-app/misc/loading-indicator.js +52 -0
- package/dist/lib/collection/components/super-selection-app/prefill-fund/prefill-common.js +22 -0
- package/dist/lib/collection/components/super-selection-app/prefill-fund/prefill-display-field.js +42 -0
- package/dist/lib/collection/components/super-selection-app/prefill-fund/prefill-error-box.js +66 -0
- package/dist/lib/collection/components/super-selection-app/prefill-fund/prefill-invalid-my-own-fund.js +121 -0
- package/dist/lib/collection/components/super-selection-app/prefill-fund/prefill-invalid-smsf.js +145 -0
- package/dist/lib/collection/components/super-selection-app/prefill-fund/prefill-my-own-fund.js +223 -0
- package/dist/lib/collection/components/super-selection-app/prefill-fund/prefill-smsf.js +398 -0
- package/dist/lib/collection/components/super-selection-app/prefill-fund/prefill-types.js +288 -0
- package/dist/lib/collection/components/super-selection-app/prefill-fund/prefill-warning-box.js +37 -0
- package/dist/lib/collection/components/super-selection-app/prefill-fund/prefill.js +81 -0
- package/dist/lib/collection/components/super-selection-app/services/australian-fund-lookup.service.js +15 -0
- package/dist/lib/collection/components/super-selection-app/services/event-tracking.service.js +97 -0
- package/dist/lib/collection/components/super-selection-app/services/existing-super-choice-info.service.js +134 -0
- package/dist/lib/collection/components/super-selection-app/services/misc.service.js +7 -0
- package/dist/lib/collection/components/super-selection-app/services/navigation.service.js +31 -0
- package/dist/lib/collection/components/super-selection-app/services/super-selection-app.routes.js +32 -0
- package/dist/lib/collection/components/super-selection-app/services/super-selection-app.service.js +146 -0
- package/dist/lib/collection/components/super-selection-app/services/super-selection.store.js +42 -0
- package/dist/lib/collection/components/super-selection-app/standard-choice/standard-choice-form.js +155 -0
- package/dist/lib/collection/components/super-selection-app/standard-choice/standard-choice-form.store.js +11 -0
- package/dist/lib/collection/components/super-selection-app/super-selection-app.css +27 -0
- package/dist/lib/collection/components/super-selection-app/super-selection-app.js +291 -0
- package/dist/lib/collection/global/init-host.js +25 -0
- package/dist/lib/collection/global/main.dev.js +29 -0
- package/dist/lib/collection/global/main.js +11 -0
- package/dist/lib/collection/global/stencil-router-workaround.js +12 -0
- package/dist/lib/collection/index.js +2 -0
- package/dist/lib/collection/utils/config.js +2 -0
- package/dist/lib/collection/utils/gtm.js +5 -0
- package/dist/lib/collection/utils/iframe.js +33 -0
- package/dist/lib/collection/utils/index.js +11 -0
- package/dist/lib/collection/utils/lazy.js +29 -0
- package/dist/lib/collection/utils/storage.js +5 -0
- package/dist/lib/esm/active-router-5e40c0f8.js +73 -0
- package/dist/lib/esm/apollo-super-selection.js +20 -0
- package/dist/lib/esm/app-globals-c1f89805.js +23 -0
- package/dist/lib/esm/context-consumer.entry.js +25 -0
- package/dist/lib/esm/datorama-akita-127aea91.js +3624 -0
- package/dist/lib/esm/index-189b2180.js +1732 -0
- package/dist/lib/esm/index.js +1 -0
- package/dist/lib/esm/loader.js +20 -0
- package/dist/lib/esm/polyfills/core-js.js +11 -0
- package/dist/lib/esm/polyfills/css-shim.js +1 -0
- package/dist/lib/esm/polyfills/dom.js +79 -0
- package/dist/lib/esm/polyfills/es5-html-element.js +1 -0
- package/dist/lib/esm/polyfills/index.js +34 -0
- package/dist/lib/esm/polyfills/system.js +6 -0
- package/dist/lib/esm/sss-button_31.entry.js +17923 -0
- package/dist/lib/esm/stencil-async-content.entry.js +28 -0
- package/dist/lib/esm/stencil-route-title.entry.js +28 -0
- package/dist/lib/esm/stencil-router-prompt.entry.js +55 -0
- package/dist/lib/esm/stencil-router-redirect.entry.js +28 -0
- package/dist/lib/esm-es5/active-router-5e40c0f8.js +1 -0
- package/dist/lib/esm-es5/apollo-super-selection.js +1 -0
- package/dist/lib/esm-es5/app-globals-c1f89805.js +1 -0
- package/dist/lib/esm-es5/context-consumer.entry.js +1 -0
- package/dist/lib/esm-es5/datorama-akita-127aea91.js +15 -0
- package/dist/lib/esm-es5/index-189b2180.js +1 -0
- package/dist/lib/esm-es5/index.js +0 -0
- package/dist/lib/esm-es5/loader.js +1 -0
- package/dist/lib/esm-es5/sss-button_31.entry.js +69 -0
- package/dist/lib/esm-es5/stencil-async-content.entry.js +1 -0
- package/dist/lib/esm-es5/stencil-route-title.entry.js +1 -0
- package/dist/lib/esm-es5/stencil-router-prompt.entry.js +1 -0
- package/dist/lib/esm-es5/stencil-router-redirect.entry.js +1 -0
- package/dist/lib/index.cjs.js +1 -0
- package/dist/lib/index.js +1 -0
- package/dist/lib/loader/cdn.js +3 -0
- package/dist/lib/loader/index.cjs.js +3 -0
- package/dist/lib/loader/index.d.ts +13 -0
- package/dist/lib/loader/index.es2017.js +3 -0
- package/dist/lib/loader/index.js +4 -0
- package/dist/lib/loader/package.json +10 -0
- package/dist/lib/node_modules/@stencil/router/dist/collection/components/route/route.css +3 -0
- package/dist/lib/types/components/app-host/loading-page.d.ts +3 -0
- package/dist/lib/types/components/app-host/services/app-configuration.query.d.ts +11 -0
- package/dist/lib/types/components/app-host/services/app-configuration.service.d.ts +9 -0
- package/dist/lib/types/components/app-host/services/app-parameters.query.d.ts +10 -0
- package/dist/lib/types/components/app-host/services/app-parameters.service.d.ts +6 -0
- package/dist/lib/types/components/app-host/services/appinsights.service.d.ts +15 -0
- package/dist/lib/types/components/app-host/services/authentication.query.d.ts +13 -0
- package/dist/lib/types/components/app-host/services/authentication.service.d.ts +9 -0
- package/dist/lib/types/components/app-host/services/interop/host-interop.service.d.ts +7 -0
- package/dist/lib/types/components/app-host/services/interop/iframe-interop.service.d.ts +5 -0
- package/dist/lib/types/components/app-host/services/interop/react-native-interop.service.d.ts +7 -0
- package/dist/lib/types/components/app-host/services/interop.query.d.ts +11 -0
- package/dist/lib/types/components/app-host/services/session.store.d.ts +31 -0
- package/dist/lib/types/components/app-host/super-selection-app-host.d.ts +15 -0
- package/dist/lib/types/components/super-campaign/super-campaign-types.d.ts +96 -0
- package/dist/lib/types/components/super-campaign/super-campaign.d.ts +37 -0
- package/dist/lib/types/components/super-selection-app/api/api-client.d.ts +2 -0
- package/dist/lib/types/components/super-selection-app/api/event-tracking.api.d.ts +6 -0
- package/dist/lib/types/components/super-selection-app/api/super-campaign-errors-api.d.ts +6 -0
- package/dist/lib/types/components/super-selection-app/api/super-campaign-errors.api.dtos.d.ts +7 -0
- package/dist/lib/types/components/super-selection-app/api/super-selection-events.model.d.ts +149 -0
- package/dist/lib/types/components/super-selection-app/api/super-selection.api.d.ts +16 -0
- package/dist/lib/types/components/super-selection-app/api/super-selection.api.dto.d.ts +233 -0
- package/dist/lib/types/components/super-selection-app/app-state-pages/success.d.ts +7 -0
- package/dist/lib/types/components/super-selection-app/existing-choice/existing-choice.d.ts +12 -0
- package/dist/lib/types/components/super-selection-app/footer-section/footer-section.d.ts +5 -0
- package/dist/lib/types/components/super-selection-app/funds/custom-fund/api/custom-fund-choice.api.d.ts +10 -0
- package/dist/lib/types/components/super-selection-app/funds/custom-fund/api/custom-fund-choice.api.dto.d.ts +43 -0
- package/dist/lib/types/components/super-selection-app/funds/custom-fund/custom-fund.d.ts +9 -0
- package/dist/lib/types/components/super-selection-app/funds/custom-fund/custom-fund.store.d.ts +30 -0
- package/dist/lib/types/components/super-selection-app/funds/custom-fund/default-fund/default-fund.d.ts +13 -0
- package/dist/lib/types/components/super-selection-app/funds/custom-fund/member-name-input.d.ts +14 -0
- package/dist/lib/types/components/super-selection-app/funds/custom-fund/my-own-fund/my-own-fund-inputs.d.ts +16 -0
- package/dist/lib/types/components/super-selection-app/funds/custom-fund/my-own-fund/my-own-fund.d.ts +13 -0
- package/dist/lib/types/components/super-selection-app/funds/custom-fund/self-managed-fund/abn-validation.d.ts +1 -0
- package/dist/lib/types/components/super-selection-app/funds/custom-fund/self-managed-fund/bankBsbNumbers.d.ts +112 -0
- package/dist/lib/types/components/super-selection-app/funds/custom-fund/self-managed-fund/self-managed-fund-inputs.d.ts +29 -0
- package/dist/lib/types/components/super-selection-app/funds/custom-fund/self-managed-fund/self-managed-fund.d.ts +14 -0
- package/dist/lib/types/components/super-selection-app/funds/custom-fund/self-managed-fund/self-managed-fund.form.d.ts +15 -0
- package/dist/lib/types/components/super-selection-app/funds/promoted-fund/api/promoted-fund-choice.api.d.ts +8 -0
- package/dist/lib/types/components/super-selection-app/funds/promoted-fund/api/promoted-fund-choice.api.dto.d.ts +25 -0
- package/dist/lib/types/components/super-selection-app/funds/slate-super/api/slate-choice.api.d.ts +6 -0
- package/dist/lib/types/components/super-selection-app/funds/slate-super/api/slate-choice.api.dto.d.ts +8 -0
- package/dist/lib/types/components/super-selection-app/funds/slate-super/api/slate.d.ts +4 -0
- package/dist/lib/types/components/super-selection-app/header-section/header-section.d.ts +4 -0
- package/dist/lib/types/components/super-selection-app/misc/button.d.ts +14 -0
- package/dist/lib/types/components/super-selection-app/misc/dropdown-async.d.ts +52 -0
- package/dist/lib/types/components/super-selection-app/misc/loading-indicator.d.ts +5 -0
- package/dist/lib/types/components/super-selection-app/prefill-fund/prefill-common.d.ts +9 -0
- package/dist/lib/types/components/super-selection-app/prefill-fund/prefill-display-field.d.ts +5 -0
- package/dist/lib/types/components/super-selection-app/prefill-fund/prefill-error-box.d.ts +5 -0
- package/dist/lib/types/components/super-selection-app/prefill-fund/prefill-invalid-my-own-fund.d.ts +18 -0
- package/dist/lib/types/components/super-selection-app/prefill-fund/prefill-invalid-smsf.d.ts +28 -0
- package/dist/lib/types/components/super-selection-app/prefill-fund/prefill-my-own-fund.d.ts +30 -0
- package/dist/lib/types/components/super-selection-app/prefill-fund/prefill-smsf.d.ts +52 -0
- package/dist/lib/types/components/super-selection-app/prefill-fund/prefill-types.d.ts +95 -0
- package/dist/lib/types/components/super-selection-app/prefill-fund/prefill-warning-box.d.ts +4 -0
- package/dist/lib/types/components/super-selection-app/prefill-fund/prefill.d.ts +14 -0
- package/dist/lib/types/components/super-selection-app/services/australian-fund-lookup.service.d.ts +8 -0
- package/dist/lib/types/components/super-selection-app/services/event-tracking.service.d.ts +21 -0
- package/dist/lib/types/components/super-selection-app/services/existing-super-choice-info.service.d.ts +75 -0
- package/dist/lib/types/components/super-selection-app/services/misc.service.d.ts +6 -0
- package/dist/lib/types/components/super-selection-app/services/navigation.service.d.ts +17 -0
- package/dist/lib/types/components/super-selection-app/services/super-selection-app.routes.d.ts +16 -0
- package/dist/lib/types/components/super-selection-app/services/super-selection-app.service.d.ts +38 -0
- package/dist/lib/types/components/super-selection-app/services/super-selection.store.d.ts +34 -0
- package/dist/lib/types/components/super-selection-app/standard-choice/standard-choice-form.d.ts +16 -0
- package/dist/lib/types/components/super-selection-app/standard-choice/standard-choice-form.store.d.ts +42 -0
- package/dist/lib/types/components/super-selection-app/super-selection-app.d.ts +27 -0
- package/dist/lib/types/components.d.ts +503 -0
- package/dist/lib/types/global/init-host.d.ts +1 -0
- package/dist/lib/types/global/main.d.ts +1 -0
- package/dist/lib/types/global/main.dev.d.ts +1 -0
- package/dist/lib/types/global/stencil-router-workaround.d.ts +1 -0
- package/dist/lib/types/index.d.ts +2 -0
- package/dist/lib/types/stencil-public-runtime.d.ts +1555 -0
- package/dist/lib/types/utils/config.d.ts +2 -0
- package/dist/lib/types/utils/gtm.d.ts +7 -0
- package/dist/lib/types/utils/iframe.d.ts +13 -0
- package/dist/lib/types/utils/index.d.ts +4 -0
- package/dist/lib/types/utils/lazy.d.ts +12 -0
- package/dist/lib/types/utils/storage.d.ts +4 -0
- package/package.json +1 -1
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { Store, StoreConfig } from '@datorama/akita';
|
|
8
|
+
import * as O from 'fp-ts/Option';
|
|
9
|
+
export var AuthenticationState;
|
|
10
|
+
(function (AuthenticationState) {
|
|
11
|
+
AuthenticationState[AuthenticationState["Unauthorized"] = 0] = "Unauthorized";
|
|
12
|
+
AuthenticationState[AuthenticationState["Authenticated"] = 1] = "Authenticated";
|
|
13
|
+
AuthenticationState[AuthenticationState["Error"] = 2] = "Error";
|
|
14
|
+
})(AuthenticationState || (AuthenticationState = {}));
|
|
15
|
+
export class ReactNativeInteropMode {
|
|
16
|
+
}
|
|
17
|
+
export class IframeInteropMode {
|
|
18
|
+
}
|
|
19
|
+
export function createInitialState() {
|
|
20
|
+
return {
|
|
21
|
+
authenticationState: AuthenticationState.Unauthorized,
|
|
22
|
+
jwt: O.none,
|
|
23
|
+
reactNativeInterop: O.none,
|
|
24
|
+
iframeInterop: O.none,
|
|
25
|
+
appConfiguration: O.none,
|
|
26
|
+
ignoreExistingSelection: false
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
let SessionStore = class SessionStore extends Store {
|
|
30
|
+
constructor() {
|
|
31
|
+
super(createInitialState());
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
SessionStore = __decorate([
|
|
35
|
+
StoreConfig({ name: 'sss-session', resettable: true })
|
|
36
|
+
], SessionStore);
|
|
37
|
+
export { SessionStore };
|
|
38
|
+
export default new SessionStore();
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
html {
|
|
2
|
+
scroll-behavior: smooth;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.sss-app-container {
|
|
6
|
+
--fl-color-primary: #fdbd00;
|
|
7
|
+
--fl-color-primary-light: #fef3c7;
|
|
8
|
+
--fl-color-primary-dark: #d97706;
|
|
9
|
+
--fl-color-primary-disabled: #ffde7e;
|
|
10
|
+
--fl-color-primary-hover: #e4aa00;
|
|
11
|
+
--fl-color-primary-focus: #ca9700;
|
|
12
|
+
--fl-color-primary-text: #3d3d3d;
|
|
13
|
+
--fl-color-secondary: #e5e5e5;
|
|
14
|
+
--fl-color-secondary-hover: #b3b3b3;
|
|
15
|
+
--fl-color-secondary-focus: #b3b3b3;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@media screen and (-webkit-min-device-pixel-ratio: 0) {
|
|
19
|
+
select,
|
|
20
|
+
textarea,
|
|
21
|
+
input {
|
|
22
|
+
font-size: 16px;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { ResizeObserver as ResizeObserverPolyfill } from '@juggle/resize-observer';
|
|
2
|
+
import { Component, getAssetPath, h, Host, State } from '@stencil/core';
|
|
3
|
+
import { isNone, toUndefined } from 'fp-ts/lib/Option';
|
|
4
|
+
import initHost from '../../global/init-host';
|
|
5
|
+
import { assertExhaustive } from '../../utils';
|
|
6
|
+
import iframe from '../../utils/iframe';
|
|
7
|
+
import appInsights from '../app-host/services/appinsights.service';
|
|
8
|
+
import appConfigurationQuery from './services/app-configuration.query';
|
|
9
|
+
import appConfigurationService from './services/app-configuration.service';
|
|
10
|
+
import appParametersQuery from './services/app-parameters.query';
|
|
11
|
+
import sessionQuery from './services/authentication.query';
|
|
12
|
+
import hostInteropService from './services/interop/host-interop.service';
|
|
13
|
+
import { AuthenticationState } from './services/session.store';
|
|
14
|
+
export class SuperSelectionAppHost {
|
|
15
|
+
async componentWillLoad() {
|
|
16
|
+
await initHost();
|
|
17
|
+
sessionQuery.sessionState$.subscribe((updatedState) => (this.sessionState = updatedState));
|
|
18
|
+
sessionQuery.jwt$.subscribe((newToken) => (this.jwt = newToken));
|
|
19
|
+
appConfigurationQuery.appConfiguration$.subscribe((updatedConfiguration) => (this.appConfiguration = updatedConfiguration));
|
|
20
|
+
appParametersQuery.ignoreExistingSelection$.subscribe((newValue) => (this.ignoreExistingSelection = newValue));
|
|
21
|
+
}
|
|
22
|
+
render() {
|
|
23
|
+
return (h(Host, null,
|
|
24
|
+
h("link", { rel: "stylesheet", href: getAssetPath('apollo-super-selection.css'), media: "all" }),
|
|
25
|
+
h("div", { ref: (el) => this.observeContentResize(el) }, isNone(this.appConfiguration) ? (h("sss-loading-page", { class: "font-inter" })) : (this.renderAppContent()))));
|
|
26
|
+
}
|
|
27
|
+
renderAppContent() {
|
|
28
|
+
return (h("stencil-router", { root: appConfigurationService.getAppRootUrl(), class: "sss-app-container" },
|
|
29
|
+
h("stencil-route-switch", { scrollTopOffset: 0 },
|
|
30
|
+
h("stencil-route", { url: "/", routeRender: this.renderProtectedRoute((props) => (h("super-selection-app", Object.assign({ accessToken: toUndefined(this.jwt), ignoreExistingSelection: this.ignoreExistingSelection, backendUrl: appConfigurationQuery.configuration.ApiBaseUrl, appBaseUrl: this.getAppBaseUrl(), onSuccessPageAcknowledged: this.handleSuccessPageAcknowledged, "onStep-completion": this.handleStepSubmitSuccess, onInitialised: this.handleAppInitialised, isSelfHosted: true }, props)))) }))));
|
|
31
|
+
}
|
|
32
|
+
getAppBaseUrl() {
|
|
33
|
+
const splits = window.location.pathname.split('app');
|
|
34
|
+
return splits[0] + 'app/';
|
|
35
|
+
}
|
|
36
|
+
handleSuccessPageAcknowledged() {
|
|
37
|
+
hostInteropService.completeSuperSelectionStep();
|
|
38
|
+
}
|
|
39
|
+
handleStepSubmitSuccess() {
|
|
40
|
+
iframe.submitSuccess();
|
|
41
|
+
}
|
|
42
|
+
handleAppInitialised(evt) {
|
|
43
|
+
appInsights.addCustomProperties({
|
|
44
|
+
'X-ACCOUNT-ID': evt.detail.accountIdOrDefault,
|
|
45
|
+
'X-PARTNER-ID': evt.detail.partnerIdOrDefault,
|
|
46
|
+
'X-PROFILE-ID': evt.detail.profileId
|
|
47
|
+
});
|
|
48
|
+
appInsights.getAppInsights().trackPageView();
|
|
49
|
+
const loadingPageContainer = document.getElementById('sss-external-loading-page-container');
|
|
50
|
+
if (loadingPageContainer) {
|
|
51
|
+
document.body.removeChild(loadingPageContainer);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
observeContentResize(appContent) {
|
|
55
|
+
const ResizeObserver = window.ResizeObserver || ResizeObserverPolyfill;
|
|
56
|
+
new ResizeObserver(() => {
|
|
57
|
+
iframe.resize(appContent.offsetHeight, -1);
|
|
58
|
+
}).observe(appContent);
|
|
59
|
+
}
|
|
60
|
+
renderProtectedRoute(renderProtectedComponent) {
|
|
61
|
+
switch (this.sessionState) {
|
|
62
|
+
case AuthenticationState.Authenticated:
|
|
63
|
+
return renderProtectedComponent;
|
|
64
|
+
case AuthenticationState.Unauthorized:
|
|
65
|
+
return () => h("sss-loading-page", null);
|
|
66
|
+
case AuthenticationState.Error:
|
|
67
|
+
return () => h("h1", null, "Authentication Error");
|
|
68
|
+
default:
|
|
69
|
+
assertExhaustive(this.sessionState);
|
|
70
|
+
return () => h("h1", null, "Authentication Error");
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
static get is() { return "super-selection-app-host"; }
|
|
74
|
+
static get encapsulation() { return "shadow"; }
|
|
75
|
+
static get originalStyleUrls() { return {
|
|
76
|
+
"$": ["super-selection-app-host.scss"]
|
|
77
|
+
}; }
|
|
78
|
+
static get styleUrls() { return {
|
|
79
|
+
"$": ["super-selection-app-host.css"]
|
|
80
|
+
}; }
|
|
81
|
+
static get states() { return {
|
|
82
|
+
"sessionState": {},
|
|
83
|
+
"jwt": {},
|
|
84
|
+
"appConfiguration": {},
|
|
85
|
+
"ignoreExistingSelection": {}
|
|
86
|
+
}; }
|
|
87
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
(function () {
|
|
2
|
+
var container = document.getElementById('sss-external-loading-page-container');
|
|
3
|
+
|
|
4
|
+
setTimeout(function () {
|
|
5
|
+
var loadingPage1 = document.getElementById('sss-external-loading-page-1');
|
|
6
|
+
if (container && loadingPage1) {
|
|
7
|
+
container.removeChild(loadingPage1);
|
|
8
|
+
}
|
|
9
|
+
}, 8000);
|
|
10
|
+
|
|
11
|
+
setTimeout(function () {
|
|
12
|
+
var loadingPage2 = document.getElementById('sss-external-loading-page-2');
|
|
13
|
+
if (container && loadingPage2) {
|
|
14
|
+
container.removeChild(loadingPage2);
|
|
15
|
+
}
|
|
16
|
+
}, 30000);
|
|
17
|
+
|
|
18
|
+
setTimeout(function () {
|
|
19
|
+
window.parent.postMessage(
|
|
20
|
+
{
|
|
21
|
+
type: 'contentResized',
|
|
22
|
+
height: container.offsetHeight,
|
|
23
|
+
width: -1,
|
|
24
|
+
sender: 'flare'
|
|
25
|
+
},
|
|
26
|
+
'*'
|
|
27
|
+
);
|
|
28
|
+
}, 0);
|
|
29
|
+
})();
|
|
@@ -0,0 +1,361 @@
|
|
|
1
|
+
import { Component, h, Prop, State } from '@stencil/core';
|
|
2
|
+
import { injectHistory } from '@stencil/router';
|
|
3
|
+
import * as O from 'fp-ts/lib/Option';
|
|
4
|
+
import { isSome } from 'fp-ts/lib/Option';
|
|
5
|
+
import appInsightsService from '../app-host/services/appinsights.service';
|
|
6
|
+
import { SuperCampaignErrorApi } from '../super-selection-app/api/super-campaign-errors-api';
|
|
7
|
+
import { SuperFundDisclaimerViewedDetail } from '../super-selection-app/api/super-selection-events.model';
|
|
8
|
+
import customFundChoiceApi from '../super-selection-app/funds/custom-fund/api/custom-fund-choice.api';
|
|
9
|
+
import promotedFundChoiceApi from '../super-selection-app/funds/promoted-fund/api/promoted-fund-choice.api';
|
|
10
|
+
import { slate } from '../super-selection-app/funds/slate-super/api/slate';
|
|
11
|
+
import slateChoiceApi from '../super-selection-app/funds/slate-super/api/slate-choice.api';
|
|
12
|
+
import { EventTrackingService } from '../super-selection-app/services/event-tracking.service';
|
|
13
|
+
import miscService from '../super-selection-app/services/misc.service';
|
|
14
|
+
import navigationService from '../super-selection-app/services/navigation.service';
|
|
15
|
+
import { SuperCampaignComponentStatus } from '../super-selection-app/services/super-selection.store';
|
|
16
|
+
import { SuperSelectionAppRoutes } from '../super-selection-app/services/super-selection-app.routes';
|
|
17
|
+
import superSelectionAppService from '../super-selection-app/services/super-selection-app.service';
|
|
18
|
+
import { LoadWaitingTimeout, Usi } from './super-campaign-types';
|
|
19
|
+
export class SuperCampaignHost {
|
|
20
|
+
constructor() {
|
|
21
|
+
this.scriptImported = false;
|
|
22
|
+
this.getEnvironmentTag = () => {
|
|
23
|
+
const discriminator = window.location.hostname.toLowerCase().split('.')[0];
|
|
24
|
+
switch (discriminator) {
|
|
25
|
+
case 'autodev-partner':
|
|
26
|
+
return 'autodev';
|
|
27
|
+
case 'test-partner':
|
|
28
|
+
return 'test';
|
|
29
|
+
case 'partner':
|
|
30
|
+
return 'prod';
|
|
31
|
+
case 'sandbox-partner':
|
|
32
|
+
return 'sandbox';
|
|
33
|
+
default:
|
|
34
|
+
return 'autodev';
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
this.subscribeToSuperCampaignEvents = () => {
|
|
38
|
+
for (const eventName in this.superCampaignEventHandlers) {
|
|
39
|
+
document.addEventListener(eventName, this.superCampaignEventHandlers[eventName]);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
this.unSubscribeFromSuperCampaignEvents = () => {
|
|
43
|
+
for (const eventName in this.superCampaignEventHandlers) {
|
|
44
|
+
document.removeEventListener(eventName, this.superCampaignEventHandlers[eventName]);
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
this.superCampaignLoaded = async (event) => {
|
|
48
|
+
if (event.detail.sender == 'super-campaign') {
|
|
49
|
+
superSelectionAppService.superCampaignComponentStatus = SuperCampaignComponentStatus.Loaded;
|
|
50
|
+
clearTimeout(this.loadingTimeoutRef);
|
|
51
|
+
await EventTrackingService.Instance.TrackSuperCampaignActivationSucceededAsync({});
|
|
52
|
+
}
|
|
53
|
+
return Promise.resolve();
|
|
54
|
+
};
|
|
55
|
+
this.superCampaignLoadFailed = async (event) => {
|
|
56
|
+
if (event.detail.sender == 'super-campaign') {
|
|
57
|
+
await this.activateFallbackMechanism({
|
|
58
|
+
type: 'SuperCampaignActivationFailed',
|
|
59
|
+
reason: event.detail.reason || 'Unknown'
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
this.superCampaignFailed = async (event) => {
|
|
64
|
+
if (event.detail.sender == 'super-campaign') {
|
|
65
|
+
await this.activateFallbackMechanism({
|
|
66
|
+
type: 'SuperCampaignOperationFailed',
|
|
67
|
+
reason: event.detail.reason || 'Unknown'
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
this.chooseAnotherFundRequested = async (event) => {
|
|
72
|
+
if (event.detail.sender == 'super-campaign') {
|
|
73
|
+
await navigationService.navigateInternally(this.history, SuperSelectionAppRoutes.MyOwnFund);
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
this.fundPanelShown = async (event) => {
|
|
77
|
+
if (event.detail.sender == 'super-campaign') {
|
|
78
|
+
superSelectionAppService.setSuperCampaignPromotedFundsShown(event.detail.shownFunds);
|
|
79
|
+
await superSelectionAppService.viewSuperFundPanelAsync();
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
this.fundTileClicked = async (event) => {
|
|
83
|
+
var _a, _b;
|
|
84
|
+
const eventDetails = event.detail;
|
|
85
|
+
if (eventDetails.sender == 'super-campaign') {
|
|
86
|
+
const promotedFundsShown = this.SuperCampaignState.PromotedFundIds;
|
|
87
|
+
const defaultFundUsiSet = O.toUndefined(superSelectionAppService.defaultFundUsi);
|
|
88
|
+
await Promise.all([
|
|
89
|
+
eventDetails.fundType == 'promoted-default'
|
|
90
|
+
? await EventTrackingService.Instance.TrackPromotedDefaultSuperFundDetailViewedAsync({
|
|
91
|
+
fundUsi: (_a = eventDetails.fundUsi) !== null && _a !== void 0 ? _a : '',
|
|
92
|
+
fundName: eventDetails.fundName,
|
|
93
|
+
promotedFundId: eventDetails.fundId,
|
|
94
|
+
promotedFundsShown,
|
|
95
|
+
defaultFundUsiSet,
|
|
96
|
+
superCampaignEnabled: true
|
|
97
|
+
})
|
|
98
|
+
: await EventTrackingService.Instance.TrackPromotedSuperFundDetailViewedAsync({
|
|
99
|
+
fundUsi: (_b = eventDetails.fundUsi) !== null && _b !== void 0 ? _b : undefined,
|
|
100
|
+
fundName: eventDetails.fundName,
|
|
101
|
+
promotedFundId: eventDetails.fundId,
|
|
102
|
+
promotedFundsShown,
|
|
103
|
+
defaultFundUsiSet,
|
|
104
|
+
superCampaignEnabled: true
|
|
105
|
+
}),
|
|
106
|
+
miscService.trackClickPromotedTileAsync(eventDetails.fundType == 'promoted-default'
|
|
107
|
+
? {
|
|
108
|
+
promotedDefault: {
|
|
109
|
+
fundId: eventDetails.fundId
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
: {
|
|
113
|
+
promoted: {
|
|
114
|
+
fundId: eventDetails.fundId
|
|
115
|
+
}
|
|
116
|
+
})
|
|
117
|
+
]);
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
this.fundPdsViewed = async (event) => {
|
|
121
|
+
if (event.detail.sender == 'super-campaign') {
|
|
122
|
+
await EventTrackingService.Instance.TrackSuperFundPdsViewedAsync({
|
|
123
|
+
fundName: event.detail.fundName,
|
|
124
|
+
fundUsi: event.detail.fundUsi,
|
|
125
|
+
pageName: event.detail.pageName,
|
|
126
|
+
superCampaignEnabled: true
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
this.disclaimerViewed = async (event) => {
|
|
131
|
+
if (event.detail.sender == 'super-campaign') {
|
|
132
|
+
await EventTrackingService.Instance.TrackSuperFundDisclaimerViewedAsync(SuperFundDisclaimerViewedDetail.create(true));
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
this.disclaimerAccepted = async (event) => {
|
|
136
|
+
if (event.detail.sender == 'super-campaign') {
|
|
137
|
+
await EventTrackingService.Instance.TrackSuperFundDisclaimerAcceptedAsync({
|
|
138
|
+
superCampaignEnabled: true
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
this.promotedFundJoined = async (event) => {
|
|
143
|
+
if (event.detail.sender == 'super-campaign') {
|
|
144
|
+
const fundJoinInfo = event.detail.fundJoinInfo;
|
|
145
|
+
switch (fundJoinInfo.fundType) {
|
|
146
|
+
case 'Promoted':
|
|
147
|
+
this.handlePromotedFundJoined(fundJoinInfo);
|
|
148
|
+
break;
|
|
149
|
+
case 'DefinedBenefits':
|
|
150
|
+
await this.handleDefinedBenefitsJoined(fundJoinInfo);
|
|
151
|
+
break;
|
|
152
|
+
case 'PromotedDefault':
|
|
153
|
+
this.handlePromotedDefaultFundJoined(fundJoinInfo);
|
|
154
|
+
break;
|
|
155
|
+
case 'PromotedDefaultWithJoin':
|
|
156
|
+
this.handlePromotedDefaultFundWithJoinWasJoined(fundJoinInfo);
|
|
157
|
+
break;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
return Promise.resolve();
|
|
161
|
+
};
|
|
162
|
+
this.stringIsNullOrEmtpty = (s) => {
|
|
163
|
+
return !(typeof s === 'string' && s.trim().length > 0);
|
|
164
|
+
};
|
|
165
|
+
this.handlePromotedFundJoined = (data) => {
|
|
166
|
+
if (this.stringIsNullOrEmtpty(data.memberNumber) || this.stringIsNullOrEmtpty(data.usi)) {
|
|
167
|
+
appInsightsService.trackErrorTrace('Super Campaign did not return (Promoted) memberNumber and/or usi');
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
const usi = Usi.clean(data.usi);
|
|
171
|
+
const defaultFundUsiSet = O.toUndefined(superSelectionAppService.defaultFundUsi);
|
|
172
|
+
navigationService.navigateInternallyToStandardChoice({
|
|
173
|
+
history: this.history,
|
|
174
|
+
fundName: data.fundName,
|
|
175
|
+
promotedFundId: data.fundId,
|
|
176
|
+
fundDetails: {
|
|
177
|
+
type: 'promoted',
|
|
178
|
+
fundName: data.fundName,
|
|
179
|
+
fundUsi: usi,
|
|
180
|
+
memberNumber: data.memberNumber,
|
|
181
|
+
promotedFundId: data.fundId
|
|
182
|
+
},
|
|
183
|
+
handleSubmitFn: async (standardChoiceFormSignature) => {
|
|
184
|
+
if (data.fundId == slate.fundId) {
|
|
185
|
+
await slateChoiceApi.submitSlateChoiceAsync(Object.assign({ memberNumber: data.memberNumber, memberFirstName: data.memberFirstName, memberFamilyName: data.memberFamilyName, standardChoiceFormSignature,
|
|
186
|
+
defaultFundUsiSet }, this.PromotedFundsConfig));
|
|
187
|
+
}
|
|
188
|
+
else {
|
|
189
|
+
await promotedFundChoiceApi.submitChoiceAsync(Object.assign({ fundId: data.fundId, memberNumber: data.memberNumber, memberFirstName: data.memberFirstName, memberFamilyName: data.memberFamilyName, usi,
|
|
190
|
+
standardChoiceFormSignature,
|
|
191
|
+
defaultFundUsiSet }, this.PromotedFundsConfig));
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
};
|
|
196
|
+
this.handlePromotedDefaultFundJoined = (data) => {
|
|
197
|
+
if (this.stringIsNullOrEmtpty(data.usi)) {
|
|
198
|
+
appInsightsService.trackErrorTrace('Super Campaign did not return (PromotedDefault) usi');
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
const usi = Usi.clean(data.usi);
|
|
202
|
+
navigationService.navigateInternallyToStandardChoice({
|
|
203
|
+
history: this.history,
|
|
204
|
+
fundName: data.fundName,
|
|
205
|
+
promotedFundId: data.fundId,
|
|
206
|
+
fundDetails: {
|
|
207
|
+
type: 'promotedDefault',
|
|
208
|
+
fundName: data.fundName,
|
|
209
|
+
fundUsi: usi,
|
|
210
|
+
promotedFundId: data.fundId
|
|
211
|
+
},
|
|
212
|
+
handleSubmitFn: (standardChoiceFormSignature) => promotedFundChoiceApi.submitDefaultChoiceAsync(Object.assign({ fundId: data.fundId, usi,
|
|
213
|
+
standardChoiceFormSignature, defaultFundUsiSet: O.toUndefined(superSelectionAppService.defaultFundUsi) }, this.PromotedFundsConfig))
|
|
214
|
+
});
|
|
215
|
+
};
|
|
216
|
+
this.handlePromotedDefaultFundWithJoinWasJoined = (data) => {
|
|
217
|
+
if (this.stringIsNullOrEmtpty(data.memberNumber) || this.stringIsNullOrEmtpty(data.usi)) {
|
|
218
|
+
appInsightsService.trackErrorTrace('Super Campaign did not return (PromotedDefaultWithJoin) memberNumber and/or usi');
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
const usi = Usi.clean(data.usi);
|
|
222
|
+
navigationService.navigateInternallyToStandardChoice({
|
|
223
|
+
history: this.history,
|
|
224
|
+
fundName: data.fundName,
|
|
225
|
+
promotedFundId: data.fundId,
|
|
226
|
+
fundDetails: {
|
|
227
|
+
type: 'promotedDefaultWithJoin',
|
|
228
|
+
fundName: data.fundName,
|
|
229
|
+
fundUsi: usi,
|
|
230
|
+
memberNumber: data.memberNumber,
|
|
231
|
+
promotedFundId: data.fundId
|
|
232
|
+
},
|
|
233
|
+
handleSubmitFn: (standardChoiceFormSignature) => promotedFundChoiceApi.submitDefaultChoiceWithJoinAsync(Object.assign({ fundId: data.fundId, memberNumber: data.memberNumber, memberFirstName: data.memberFirstName, memberFamilyName: data.memberFamilyName, usi,
|
|
234
|
+
standardChoiceFormSignature, defaultFundUsiSet: O.toUndefined(superSelectionAppService.defaultFundUsi) }, this.PromotedFundsConfig))
|
|
235
|
+
});
|
|
236
|
+
};
|
|
237
|
+
this.handleDefinedBenefitsJoined = async (data) => {
|
|
238
|
+
if (this.stringIsNullOrEmtpty(data.memberNumber) || this.stringIsNullOrEmtpty(data.usi)) {
|
|
239
|
+
appInsightsService.trackErrorTrace('Super Campaign did not return (DefinedBenefits) memberNumber and/or usi');
|
|
240
|
+
return;
|
|
241
|
+
}
|
|
242
|
+
await customFundChoiceApi.submitDefinedBenefitsChoiceAsync(Object.assign({ fundUsi: Usi.clean(data.usi), fundId: data.fundId, memberNumber: data.memberNumber, memberElectContributionRatePreTax: data.memberElectContributionRatePreTax, memberElectContributionRatePostTax: data.memberElectContributionRatePostTax }, this.PromotedFundsConfig));
|
|
243
|
+
superSelectionAppService.markSuperSelectionAsSubmitted();
|
|
244
|
+
};
|
|
245
|
+
this.superCampaignEventHandlers = {
|
|
246
|
+
'choose-another-fund-requested': this.chooseAnotherFundRequested.bind(this),
|
|
247
|
+
'fund-panel-shown': this.fundPanelShown.bind(this),
|
|
248
|
+
'fund-tile-clicked': this.fundTileClicked.bind(this),
|
|
249
|
+
'fund-pds-viewed': this.fundPdsViewed.bind(this),
|
|
250
|
+
'disclaimer-viewed': this.disclaimerViewed.bind(this),
|
|
251
|
+
'disclaimer-accepted': this.disclaimerAccepted.bind(this),
|
|
252
|
+
'promoted-fund-joined': this.promotedFundJoined.bind(this),
|
|
253
|
+
'super-campaign-loaded': this.superCampaignLoaded.bind(this),
|
|
254
|
+
'super-campaign-load-failed': this.superCampaignLoadFailed.bind(this),
|
|
255
|
+
'super-campaign-failed': this.superCampaignFailed.bind(this)
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
async componentWillLoad() {
|
|
259
|
+
if (superSelectionAppService.state.superCampaignComponentStatus ===
|
|
260
|
+
SuperCampaignComponentStatus.NotWorking) {
|
|
261
|
+
navigationService.navigateInternally(this.history, SuperSelectionAppRoutes.MyOwnFund);
|
|
262
|
+
return;
|
|
263
|
+
}
|
|
264
|
+
let superCampaingScriptPath = undefined;
|
|
265
|
+
try {
|
|
266
|
+
if (isSome(superSelectionAppService.state.apiBaseUrl) &&
|
|
267
|
+
isSome(superSelectionAppService.state.jwt)) {
|
|
268
|
+
this.backendUrl = this.getBaseUrl(superSelectionAppService.state.apiBaseUrl.value);
|
|
269
|
+
this.accessToken = superSelectionAppService.state.jwt.value;
|
|
270
|
+
this.unSubscribeFromSuperCampaignEvents();
|
|
271
|
+
if (superSelectionAppService.state.superCampaignComponentStatus ===
|
|
272
|
+
SuperCampaignComponentStatus.NotLoaded) {
|
|
273
|
+
superCampaingScriptPath = this.createApolloSuperCampaignScriptUrl(this.getEnvironmentTag());
|
|
274
|
+
await import(superCampaingScriptPath);
|
|
275
|
+
this.loadingTimeoutRef = setTimeout(this.superCampaignLoadingTimeoutTriggered.bind(this), LoadWaitingTimeout);
|
|
276
|
+
}
|
|
277
|
+
this.subscribeToSuperCampaignEvents();
|
|
278
|
+
this.scriptImported = true;
|
|
279
|
+
superSelectionAppService.superCampaignIsInView = true;
|
|
280
|
+
}
|
|
281
|
+
else {
|
|
282
|
+
throw Error(`SuperCampaignHost pre-requisites not met.`);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
catch (error) {
|
|
286
|
+
this.activateFallbackMechanism({
|
|
287
|
+
type: 'SuperCampaignActivationFailed',
|
|
288
|
+
reason: `Problem in loading SuperCampaing script from:${superCampaingScriptPath} Error: ${error}`
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
disconnectedCallback() {
|
|
293
|
+
clearTimeout(this.loadingTimeoutRef);
|
|
294
|
+
this.unSubscribeFromSuperCampaignEvents();
|
|
295
|
+
superSelectionAppService.superCampaignIsInView = false;
|
|
296
|
+
}
|
|
297
|
+
render() {
|
|
298
|
+
return (h("div", null, this.scriptImported ? (h("apollo-super-campaign", { "backend-url": this.backendUrl, "access-token": this.accessToken })) : null));
|
|
299
|
+
}
|
|
300
|
+
async activateFallbackMechanism(error) {
|
|
301
|
+
if (superSelectionAppService.superCampaignComponentStatus !==
|
|
302
|
+
SuperCampaignComponentStatus.NotWorking) {
|
|
303
|
+
superSelectionAppService.superCampaignComponentStatus =
|
|
304
|
+
SuperCampaignComponentStatus.NotWorking;
|
|
305
|
+
await SuperCampaignErrorApi.Instance.PostError(error);
|
|
306
|
+
await navigationService.navigateInternally(this.history, SuperSelectionAppRoutes.MyOwnFund);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
async superCampaignLoadingTimeoutTriggered() {
|
|
310
|
+
if (superSelectionAppService.superCampaignComponentStatus !== SuperCampaignComponentStatus.Loaded) {
|
|
311
|
+
this.activateFallbackMechanism({
|
|
312
|
+
type: 'SuperCampaignActivationFailed',
|
|
313
|
+
reason: `Activation timeout was triggered after:${LoadWaitingTimeout / 1000} seconds`
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
createApolloSuperCampaignScriptUrl(envTag) {
|
|
318
|
+
return `https://npm-cdn.flarehr.com/@flarehr/apollo-super-campaign@${envTag}/dist/apollo-super-campaign.js`;
|
|
319
|
+
}
|
|
320
|
+
getBaseUrl(url) {
|
|
321
|
+
const parsedUrl = new URL(url);
|
|
322
|
+
return `${parsedUrl.protocol}//${parsedUrl.hostname}${parsedUrl.port.length > 0 ? `:${parsedUrl.port}` : ''}`;
|
|
323
|
+
}
|
|
324
|
+
get SuperCampaignState() {
|
|
325
|
+
if (superSelectionAppService.superCampaignState != undefined)
|
|
326
|
+
return superSelectionAppService.superCampaignState;
|
|
327
|
+
throw new Error('Super campaign state has not been initialized');
|
|
328
|
+
}
|
|
329
|
+
get PromotedFundsConfig() {
|
|
330
|
+
return superSelectionAppService.promotedFundsConfig;
|
|
331
|
+
}
|
|
332
|
+
static get is() { return "sss-super-campaign-host"; }
|
|
333
|
+
static get properties() { return {
|
|
334
|
+
"history": {
|
|
335
|
+
"type": "unknown",
|
|
336
|
+
"mutable": false,
|
|
337
|
+
"complexType": {
|
|
338
|
+
"original": "RouterHistory",
|
|
339
|
+
"resolved": "RouterHistory",
|
|
340
|
+
"references": {
|
|
341
|
+
"RouterHistory": {
|
|
342
|
+
"location": "import",
|
|
343
|
+
"path": "@stencil/router"
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
},
|
|
347
|
+
"required": false,
|
|
348
|
+
"optional": false,
|
|
349
|
+
"docs": {
|
|
350
|
+
"tags": [],
|
|
351
|
+
"text": ""
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
}; }
|
|
355
|
+
static get states() { return {
|
|
356
|
+
"scriptImported": {},
|
|
357
|
+
"backendUrl": {},
|
|
358
|
+
"accessToken": {}
|
|
359
|
+
}; }
|
|
360
|
+
}
|
|
361
|
+
injectHistory(SuperCampaignHost);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import wretch from 'wretch';
|
|
2
|
+
import superSelectionAppService from '../services/super-selection-app.service';
|
|
3
|
+
export function buildBackendApiClient() {
|
|
4
|
+
const jwt = superSelectionAppService.jwt;
|
|
5
|
+
const profileId = superSelectionAppService.profileId;
|
|
6
|
+
const accountId = superSelectionAppService.accountIdOrDefault;
|
|
7
|
+
const partnerId = superSelectionAppService.partnerIdOrDefault;
|
|
8
|
+
return wretch(superSelectionAppService.apiBaseUrl).headers({
|
|
9
|
+
Authorization: `Bearer ${jwt}`,
|
|
10
|
+
'X-PROFILE-ID': profileId,
|
|
11
|
+
'X-PARTNER-ID': partnerId,
|
|
12
|
+
'X-ACCOUNT-ID': accountId
|
|
13
|
+
});
|
|
14
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { buildBackendApiClient } from '../api/api-client';
|
|
2
|
+
export class EventTrackingApi {
|
|
3
|
+
static get Instance() {
|
|
4
|
+
return this.instance || (this.instance = new this());
|
|
5
|
+
}
|
|
6
|
+
async PostAnalyticsEventAsync(event) {
|
|
7
|
+
return buildBackendApiClient().url('analytics-events').post(event).res();
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { buildBackendApiClient } from './api-client';
|
|
2
|
+
export class SuperCampaignErrorApi {
|
|
3
|
+
static get Instance() {
|
|
4
|
+
return this.instance || (this.instance = new this());
|
|
5
|
+
}
|
|
6
|
+
async PostError(error) {
|
|
7
|
+
buildBackendApiClient().url('super-campaign/errors').post(error);
|
|
8
|
+
}
|
|
9
|
+
}
|
package/dist/lib/collection/components/super-selection-app/api/super-campaign-errors.api.dtos.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/lib/collection/components/super-selection-app/api/super-selection-events.model.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { isSome } from 'fp-ts/lib/Option';
|
|
2
|
+
import superSelectionService from '../services/super-selection-app.service';
|
|
3
|
+
export const SuperFundDisclaimerViewedDetail = {
|
|
4
|
+
create: (superCampaignEnabled) => {
|
|
5
|
+
let isDefinedBenefitsEligibleString = 'Not set';
|
|
6
|
+
if (isSome(superSelectionService.isDefinedBenefitsEligible)) {
|
|
7
|
+
isDefinedBenefitsEligibleString = superSelectionService.isDefinedBenefitsEligible.value
|
|
8
|
+
? 'True'
|
|
9
|
+
: 'False';
|
|
10
|
+
}
|
|
11
|
+
return {
|
|
12
|
+
isDefinedBenefitsEligible: isDefinedBenefitsEligibleString,
|
|
13
|
+
superCampaignEnabled: superCampaignEnabled
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
};
|