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C,MAAIF,EAAA3D,UAvETxL,GAAb","sources":["webpack://iadviser/./src/routes/app-adviser/diagnostics/diagnostics.ts?2a85","webpack://iadviser/./src/routes/app-adviser/client/wizard/wizard.html","webpack://iadviser/./src/routes/app-adviser/client/wizard/wizard.ts"],"sourcesContent":["module.exports = function(cb) {\n\trequire.ensure([], function(require) {\n\t\tcb(require(\"!!../../../../node_modules/ts-loader/index.js??ruleSet[1].rules[4].use[0]!./diagnostics.ts\"));\n\t}, \"diagnostics\");\n}","// Module\nvar code = \"\\r\\n\";\n// Exports\nexport default code;","import { captureException } from '@sentry/core';\r\nimport { EventAggregator } from 'aurelia-event-aggregator';\r\nimport { HttpClient } from 'aurelia-fetch-client';\r\nimport { autoinject, computedFrom, TaskQueue } from 'aurelia-framework';\r\nimport { I18N } from 'aurelia-i18n';\r\nimport { AppRouter } from 'aurelia-router';\r\nimport { DocumentPack } from 'components/document-pack/document-pack';\r\nimport { ConfirmModalActions } from 'components/ia-modal/ia-modal';\r\nimport { ModalService } from 'components/modal/modal-service';\r\nimport { environment } from 'environment';\r\nimport { EntityActionTypeToActionTypeLabel, mapActionTypeToEntityActionType } from 'resources/map-entity-type';\r\nimport { getAppClientInstance, getAppClientType } from 'resources/parse-jwt';\r\nimport { AureliaHooks } from 'resources/services/aurelia-hooks';\r\nimport { ClaimsService } from 'resources/services/claims-service';\r\nimport { IaToastService } from 'resources/services/ia-toast-service';\r\nimport { log } from 'resources/services/log-service';\r\nimport { EntityActionType, EntityMode, EntityType } from 'routes/app-adviser/client/quotes/interfaces';\r\nimport styles from '../quotes/quotes.css';\r\nimport { ClaimStepMap, QuoteStepMap, WebFormConsentStepMap, WebFormQuoteStepMap } from './steps/config';\r\n\r\nconst WIZARD_FORM_TYPES = [EntityType.FormQuote, EntityType.FormConsent];\r\n\r\ninterface LabelPair {\r\n label: string;\r\n ariaLabel: string;\r\n}\r\n\r\n@autoinject()\r\nexport class Wizard {\r\n public styles = styles;\r\n\r\n public forwardButtonDisabled = false;\r\n public currentDirection;\r\n public stepClickedValue;\r\n\r\n // Assume no permission by default\r\n public noPermission = true;\r\n public entityMode: EntityMode = EntityMode.None;\r\n public actionType: EntityActionType;\r\n public mappedActionType: string;\r\n public entityType: EntityType;\r\n\r\n public showSaveConfirmModal = false;\r\n public showCloseConfirmModal = false;\r\n public showStepTransitionConfirmModal = false;\r\n public showRiskModal = false;\r\n\r\n public steps = QuoteStepMap;\r\n\r\n public currentStep;\r\n public currentStepIndex = 0; // Confusingly, this is 1-based index to match the step numbers, not a 0-based index\r\n public clickedStep;\r\n\r\n public id;\r\n public entityId;\r\n public step;\r\n public newActionType;\r\n public policyId;\r\n\r\n public backButtonDisabled = false;\r\n public viewModelRef;\r\n public composeModel;\r\n\r\n public stepTransitioning = false;\r\n public stepTransitionMessage;\r\n\r\n public discardTitle = '';\r\n\r\n public hasQuoteDocumentPack = false;\r\n public hasPolicyDocumentPack = false;\r\n\r\n public policyVersionId;\r\n public isCorrection = false;\r\n\r\n public statusTypeId;\r\n public versionNo;\r\n public isTakeUp;\r\n public isEditTakeUpAction;\r\n\r\n private clientNavLabel;\r\n private formId;\r\n private formWizardRoute;\r\n\r\n /**\r\n * Indicates whether the wizard is being used for a user form workflow.\r\n * When true, the wizard behaves as a user-facing form (e.g., navigates to userFormHomeComplete on submission).\r\n * When false, it operates as a client form accessed by advisers.\r\n */\r\n public isUserForm = false;\r\n\r\n constructor(\r\n public claims: ClaimsService,\r\n public router: AppRouter,\r\n public toast: IaToastService,\r\n public http: HttpClient,\r\n public ea: EventAggregator,\r\n public hooks: AureliaHooks,\r\n public taskQueue: TaskQueue,\r\n public modal: ModalService,\r\n private i18n: I18N,\r\n ) {}\r\n\r\n async stepRendered() {\r\n if (!window.location.href.includes('localhost')) {\r\n const appClientType = getAppClientType();\r\n const appClientInstance = getAppClientInstance();\r\n const url = `/index_${appClientType.toLowerCase()}_${appClientInstance.toLowerCase()}.html`;\r\n\r\n await this.http\r\n .fetch(url, {\r\n method: 'HEAD',\r\n headers: {\r\n 'If-Modified-Since': localStorage.getItem('indexLastModified'),\r\n },\r\n })\r\n .then((response) => {\r\n if (response.headers.get('Last-modified')) {\r\n localStorage.setItem('indexLastModified', response.headers.get('Last-modified'));\r\n }\r\n\r\n if (response.status === 200) {\r\n this.ea.publish('promptForRefresh');\r\n }\r\n });\r\n }\r\n }\r\n\r\n async bind() {\r\n // Allow current step validation check to be run via an action\r\n this.hooks.addAction('wizard:validateCurrentStep', this.currentStepValidation);\r\n this.hasQuoteDocumentPack = await this.claims.hasAsync(\r\n 'IadviserProcessingQuoteQuoteSearchContextMenuQuoteDocumentPack',\r\n );\r\n this.hasPolicyDocumentPack = await this.claims.hasAsync(\r\n 'IadviserProcessingPolicyPolicyMaintenanceContextMenuPolicyDocumentPack',\r\n );\r\n }\r\n\r\n unbind() {\r\n this.hooks.removeAction('wizard:validateCurrentStep', this.currentStepValidation);\r\n }\r\n\r\n async saveCallback(type: ConfirmModalActions) {\r\n this.stepTransitioning = false;\r\n\r\n if (type === 'donotsave') {\r\n if (this.entityId) {\r\n let endpoint;\r\n let uri;\r\n\r\n const method = 'DELETE';\r\n\r\n if (this.entityType === 'quote') {\r\n endpoint = environment.clientEndpoints.quotes.delete;\r\n uri = endpoint.uri([this.id, this.entityId]);\r\n } else if (this.entityType === 'incomplete') {\r\n endpoint = environment.clientEndpoints.wizard.delete;\r\n uri = endpoint.uri([this.id, this.actionType, this.entityType, this.entityId]);\r\n } else if (this.entityType === EntityType.Claim) {\r\n endpoint = environment.clientEndpoints.claims.delete;\r\n uri = endpoint.uri([this.id, this.entityId]);\r\n }\r\n\r\n const requestTypes = ['quote', 'incomplete', 'claim'];\r\n\r\n if (requestTypes.includes(this.entityType)) {\r\n await this.http.fetch(uri, {\r\n method: method,\r\n });\r\n }\r\n }\r\n\r\n sessionStorage.removeItem('is_draft_entity');\r\n\r\n if (this.entityType === 'quote') {\r\n this.router.navigateToRoute('clientQuotes', { id: this.id, quoteId: this.entityId });\r\n } else if (this.entityType === 'policy' || this.entityType === 'incomplete') {\r\n this.router.navigateToRoute('clientPolicies', {\r\n id: this.id,\r\n policyId: this.policyId,\r\n policyVersionId: 0,\r\n statusTypeId: this.statusTypeId,\r\n versionNo: this.versionNo,\r\n });\r\n } else if (this.entityType === EntityType.Claim) {\r\n this.router.navigateToRoute('clientClaims', { id: this.id, claimId: this.entityId });\r\n } else if (this.entityType === EntityType.FormQuote) {\r\n this.router.navigateToRoute('clientForms', { id: this.id, formId: this.formId });\r\n }\r\n }\r\n\r\n if (type === 'save') {\r\n let stepValid = false;\r\n\r\n // don't validate when user closes the wizard on the convert step\r\n if (this.currentStepIndex === 10) {\r\n stepValid = true;\r\n } else {\r\n stepValid = await this.currentStepValidation(false, null);\r\n }\r\n\r\n if (stepValid) {\r\n sessionStorage.removeItem('is_draft_entity');\r\n\r\n if (this.entityType === 'quote') {\r\n this.router.navigateToRoute('clientQuotes', { id: this.id, quoteId: this.entityId });\r\n } else if (this.entityType === 'policy' || this.entityType === 'incomplete') {\r\n this.router.navigateToRoute('clientPolicies', {\r\n id: this.id,\r\n policyId: this.policyId,\r\n policyVersionId: 0,\r\n statusTypeId: this.statusTypeId,\r\n versionNo: parseInt(this.versionNo) + 1,\r\n });\r\n } else if (this.entityType === EntityType.Claim) {\r\n this.router.navigateToRoute('clientClaims', { id: this.id, claimId: this.entityId });\r\n } else if (this.entityType === EntityType.FormQuote) {\r\n this.router.navigateToRoute('clientForms', { id: this.id, formId: this.formId });\r\n }\r\n }\r\n }\r\n\r\n this.showSaveConfirmModal = false;\r\n }\r\n\r\n async stepTransitionPrompt(type: ConfirmModalActions) {\r\n this.toast.destroyAllToasts();\r\n this.stepTransitioning = false;\r\n\r\n if (type === 'confirm') {\r\n const viewModel = this.viewModelRef?.currentViewModel;\r\n\r\n if (viewModel) {\r\n if (this.stepClickedValue) {\r\n this.visitStep(this.stepClickedValue);\r\n } else {\r\n this.visitStep(this.currentStepIndex - 1);\r\n }\r\n }\r\n }\r\n\r\n this.showStepTransitionConfirmModal = false;\r\n }\r\n\r\n async closeConfirmCallback(type: ConfirmModalActions) {\r\n this.stepTransitioning = false;\r\n\r\n if (type === 'save') {\r\n let stepValid = false;\r\n\r\n // don't validate when user closes the wizard on the convert step\r\n if (this.currentStepIndex === 10) {\r\n stepValid = true;\r\n } else {\r\n stepValid = await this.currentStepValidation(false, null);\r\n }\r\n\r\n if (stepValid) {\r\n if (this.entityType === 'quote') {\r\n this.router.navigateToRoute('clientQuotes', { id: this.id, quoteId: this.entityId });\r\n } else if (this.entityType === 'policy' || this.entityType === 'incomplete') {\r\n this.router.navigateToRoute('clientPolicies', {\r\n id: this.id,\r\n policyId: this.policyId,\r\n policyVersionId: 0,\r\n statusTypeId: this.statusTypeId,\r\n versionNo: this.versionNo,\r\n });\r\n } else if (this.entityType === EntityType.Claim) {\r\n this.router.navigateToRoute('clientClaims', { id: this.id, claimId: this.entityId });\r\n } else if (this.entityType === EntityType.FormQuote) {\r\n this.router.navigateToRoute('clientForms', { id: this.id, formId: this.formId });\r\n }\r\n }\r\n }\r\n\r\n if (type === 'donotsave') {\r\n if (this.entityType === 'quote') {\r\n this.router.navigateToRoute('clientQuotes', { id: this.id, quoteId: this.entityId });\r\n } else if (this.entityType === 'policy' || this.entityType === 'incomplete') {\r\n this.router.navigateToRoute('clientPolicies', {\r\n id: this.id,\r\n policyId: this.policyId,\r\n policyVersionId: 0,\r\n statusTypeId: this.statusTypeId,\r\n versionNo: this.versionNo,\r\n });\r\n } else if (this.entityType === EntityType.Claim) {\r\n this.router.navigateToRoute('clientClaims', { id: this.id, claimId: this.entityId });\r\n } else if (this.entityType === EntityType.FormQuote) {\r\n this.router.navigateToRoute('clientForms', { id: this.id, formId: this.formId });\r\n }\r\n }\r\n\r\n this.showCloseConfirmModal = false;\r\n }\r\n\r\n incompleteRiskQuestionsCallback(type: ConfirmModalActions) {\r\n this.stepTransitioning = false;\r\n\r\n // reset hasRiskUpdated flag on viewModel\r\n if (type === 'cancel') {\r\n const viewModel = this.viewModelRef?.currentViewModel;\r\n }\r\n\r\n // allow navigation\r\n if (type === 'confirm') {\r\n if (typeof this.stepClickedValue !== 'undefined') {\r\n this.visitStep(this.stepClickedValue);\r\n } else {\r\n if (this.currentDirection === 'forward') {\r\n this.visitStep(this.currentStepIndex + 1);\r\n } else if (this.currentDirection === 'back') {\r\n this.visitStep(this.currentStepIndex - 1);\r\n }\r\n }\r\n }\r\n\r\n this.showRiskModal = false;\r\n }\r\n\r\n setActiveStep(stepIndex: number) {\r\n this.steps.forEach((step) => {\r\n step.active = step.step === stepIndex ? true : false;\r\n });\r\n }\r\n\r\n async canActivate(\r\n {\r\n id,\r\n parentEntityId,\r\n entityId,\r\n actionType,\r\n entityType,\r\n entityMode,\r\n step,\r\n statusTypeId,\r\n versionNo,\r\n newActionType,\r\n isTakeUp,\r\n isEditTakeUpAction,\r\n formId,\r\n },\r\n route,\r\n ) {\r\n this.statusTypeId = statusTypeId;\r\n this.versionNo = versionNo;\r\n this.isTakeUp = isTakeUp;\r\n this.isEditTakeUpAction = isEditTakeUpAction;\r\n\r\n const entityTypeLabel = entityType.replace(/^\\w/, (c) => c.toUpperCase());\r\n route.settings.clientNavLabel = entityTypeLabel;\r\n\r\n if (isNaN(Number(step))) {\r\n step = 1;\r\n }\r\n\r\n if (entityType === EntityType.Quote) {\r\n this.discardTitle = 'New Quote';\r\n\r\n if (entityMode === 'view') {\r\n this.steps = QuoteStepMap.slice(0, 9);\r\n }\r\n\r\n if (entityMode === 'edit' || entityMode === 'new') {\r\n this.steps = QuoteStepMap;\r\n }\r\n }\r\n\r\n if (entityType === EntityType.Policy || entityType === EntityType.Incomplete) {\r\n this.discardTitle = `New ${EntityActionTypeToActionTypeLabel(newActionType ? newActionType : actionType)}`;\r\n\r\n // prevent users from changing view policy route to edit\r\n if (entityType === EntityType.Policy && !newActionType && entityMode === 'edit') {\r\n const hasCorrection = await this.claims.hasAsync(\r\n 'IadviserProcessingPolicyPolicyMaintenanceContextMenuCorrection',\r\n );\r\n const hasEditTakeup = await this.claims.hasAsync(\r\n 'IadviserProcessingPolicyPolicyMaintenanceContextMenuEditTakeUp',\r\n );\r\n if (hasCorrection || (hasEditTakeup && this.isEditTakeUpAction === 'true')) {\r\n this.isCorrection = true;\r\n this.steps = QuoteStepMap.slice(0, 9);\r\n } else {\r\n entityMode = 'view';\r\n }\r\n }\r\n\r\n if (entityMode === 'view') {\r\n this.steps = QuoteStepMap.slice(0, 9);\r\n }\r\n\r\n // *** this block can be removed when all modules are complete - START\r\n // prevent users from changing view incomplete route to edit for action types not yet released\r\n const mappedActionTyped = mapActionTypeToEntityActionType(actionType);\r\n const nonViewActionTypes = [\r\n EntityActionType.Renewal,\r\n EntityActionType.Endorsement,\r\n EntityActionType.Reinstatement,\r\n EntityActionType.Cancellation,\r\n ];\r\n\r\n if (entityType === 'incomplete' && !nonViewActionTypes.includes(mappedActionTyped)) {\r\n entityMode = 'view';\r\n }\r\n // *** this block can be removed when all modules are complete - END\r\n }\r\n\r\n if (entityType === EntityType.Claim) {\r\n this.discardTitle = 'New Claim';\r\n this.steps = ClaimStepMap;\r\n }\r\n\r\n if (entityType === EntityType.FormQuote) {\r\n this.formId = formId;\r\n this.formWizardRoute = route.name;\r\n this.steps = WebFormQuoteStepMap;\r\n this.isUserForm = route.name === 'userFormWizard';\r\n }\r\n\r\n if (entityType === EntityType.FormConsent) {\r\n this.formId = formId;\r\n this.formWizardRoute = route.name;\r\n this.steps = WebFormConsentStepMap;\r\n this.isUserForm = route.name === 'userFormWizard';\r\n }\r\n\r\n // No step number provided or invalid step number provided, default to step 1\r\n if (!step || step === '1') {\r\n this.currentStepIndex = 1;\r\n this.currentStep = this.steps[this.currentStepIndex - 1];\r\n }\r\n\r\n this.id = id;\r\n this.policyId = parentEntityId;\r\n this.entityId = entityId;\r\n this.actionType = actionType;\r\n this.mappedActionType = mapActionTypeToEntityActionType(actionType, true);\r\n this.entityType = entityType;\r\n this.entityMode = entityMode;\r\n this.step = isNaN(Number(step)) ? '1' : step;\r\n this.newActionType = newActionType;\r\n\r\n const parsedNewActionType = parseInt(newActionType);\r\n\r\n // If we have no entityId, it's a new entity, so the other params except \"id\" are not required\r\n // If new action type is not undefined, it's a new type of something not quote related\r\n if (!isNaN(parsedNewActionType) || !entityId) {\r\n this.noPermission = false;\r\n\r\n sessionStorage.setItem('is_draft_entity', 'true');\r\n }\r\n\r\n let userHasViewPermission;\r\n let userHasEditPermission;\r\n\r\n if (this.entityType === EntityType.Quote) {\r\n userHasViewPermission = await this.claims.hasAsync('IadviserProcessingQuoteFindQuoteView');\r\n userHasEditPermission = await this.claims.hasAsync('IadviserProcessingQuoteFindQuoteEdit');\r\n } else if (this.entityType === EntityType.Incomplete || this.entityType === EntityType.Policy) {\r\n userHasViewPermission = await this.claims.hasAsync('IadviserProcessingPolicyFindPolicyView');\r\n userHasEditPermission = await this.claims.hasAsync('IadviserProcessingPolicyFindPolicyEdit');\r\n } else if (this.entityType === EntityType.Claim) {\r\n userHasViewPermission = await this.claims.hasAsync('IadviserProcessingClaimsFindClaimView');\r\n userHasEditPermission = await this.claims.hasAsync('IadviserProcessingClaimsFindClaimEdit');\r\n } else if (this.entityType === EntityType.FormQuote) {\r\n userHasViewPermission = await this.claims.hasAsync('IadviserProcessingWebFormsQuoteView');\r\n userHasEditPermission = await this.claims.hasAsync('IadviserProcessingWebFormsQuoteEdit');\r\n } else if (this.entityType === EntityType.FormConsent) {\r\n userHasViewPermission = await this.claims.hasAsync('IadviserProcessingWebFormsConsentView');\r\n userHasEditPermission = await this.claims.hasAsync('IadviserProcessingWebFormsConsentEdit');\r\n }\r\n\r\n // User has one or more of these claims\r\n if ((isNaN(parsedNewActionType) && userHasViewPermission) || userHasEditPermission) {\r\n // User has permission, but what level? Let's find out\r\n this.noPermission = false;\r\n\r\n // User has edit and view permissions\r\n if (userHasViewPermission && userHasEditPermission) {\r\n // If entityMode is already set via the route as 'view' (user selects 'View Quote') set as 'view'; else 'edit'\r\n // this.entityMode = this.entityMode === EntityMode.View ? EntityMode.View : EntityMode.Edit;\r\n }\r\n // User has view permission only\r\n else if (this.entityMode === EntityMode.View && (userHasViewPermission || userHasEditPermission)) {\r\n this.entityMode = EntityMode.View;\r\n }\r\n // User has edit permission only\r\n else if (this.entityMode === EntityMode.Edit && userHasEditPermission) {\r\n this.entityMode = EntityMode.Edit;\r\n }\r\n }\r\n\r\n if (!userHasViewPermission && !userHasEditPermission) {\r\n this.entityMode = EntityMode.None;\r\n this.noPermission = true;\r\n } else {\r\n this.noPermission = false;\r\n\r\n if (!isNaN(parsedNewActionType)) {\r\n this.entityMode = EntityMode.New;\r\n }\r\n }\r\n\r\n if (!this.noPermission && step) {\r\n log.info('Step provided in URL, display step', step);\r\n this.visitStep(parseInt(step));\r\n }\r\n\r\n this.composeModel = {\r\n id: this.id,\r\n parentEntityId: this.policyId,\r\n entityId: this.entityId,\r\n step: this.step,\r\n entityMode: this.entityMode,\r\n actionType: this.actionType,\r\n entityType: this.entityType,\r\n newActionType: this.newActionType,\r\n statusTypeId: this.statusTypeId,\r\n versionNo: this.versionNo,\r\n isTakeUp: this.isTakeUp,\r\n isEditTakeUpAction: this.isEditTakeUpAction,\r\n formId: this.formId,\r\n };\r\n }\r\n\r\n async stepClicked(step, index: number) {\r\n this.stepTransitioning = true;\r\n this.forwardButtonDisabled = false;\r\n\r\n const direction = index + 1 > this.currentStepIndex ? 'forward' : 'back';\r\n\r\n this.hooks.doAction('wizard:stepClicked', direction, this);\r\n\r\n this.stepClickedValue = step.step;\r\n\r\n const currentStepIsValid = await this.currentStepValidation(true, direction);\r\n\r\n if (currentStepIsValid) {\r\n this.visitStep(step.step);\r\n } else {\r\n this.stepTransitioning = false;\r\n }\r\n }\r\n\r\n async visitStep(step: number) {\r\n if (!this.entityId) {\r\n this.updateCurrentStep(step, 'any');\r\n return;\r\n }\r\n\r\n this.stepClickedValue = undefined;\r\n\r\n try {\r\n this.updateCurrentStep(step, 'any');\r\n\r\n if (this.entityType === EntityType.Claim) {\r\n this.router.navigateToRoute(\r\n 'claimWizard',\r\n {\r\n id: this.id,\r\n entityId: this.entityId ?? 0,\r\n entityMode: this.entityMode,\r\n entityType: this.entityType ?? EntityType.Claim,\r\n step: step,\r\n policyVersionId: this.policyVersionId,\r\n },\r\n {\r\n trigger: false,\r\n },\r\n );\r\n } else if ([EntityType.FormConsent, EntityType.FormQuote].includes(this.entityType)) {\r\n this.router.navigateToRoute(\r\n this.formWizardRoute,\r\n {\r\n id: this.id,\r\n formId: this.formId,\r\n entityId: this.entityId ?? 0,\r\n entityMode: this.entityMode,\r\n entityType: this.entityType,\r\n actionType: this.actionType,\r\n step: step,\r\n isEditTakeUpAction: false,\r\n },\r\n {\r\n trigger: false,\r\n },\r\n );\r\n } else {\r\n this.router.navigateToRoute(\r\n 'wizard',\r\n {\r\n id: this.id,\r\n parentEntityId: this.policyId,\r\n entityId: this.entityId,\r\n entityMode: this.entityMode,\r\n actionType: this.actionType,\r\n entityType: this.entityType,\r\n newActionType: this.newActionType,\r\n step: step,\r\n statusTypeId: this.statusTypeId,\r\n versionNo: this.versionNo,\r\n isTakeUp: this.isTakeUp,\r\n isEditTakeUpAction: this.isEditTakeUpAction,\r\n },\r\n {\r\n trigger: false,\r\n },\r\n );\r\n }\r\n\r\n setTimeout(() => this.stepRendered(), 500);\r\n } catch (error) {\r\n this.handleError(error);\r\n }\r\n }\r\n\r\n async currentStepValidation(redirectAfterCreation = true, direction) {\r\n if (this.viewModelRef?.currentViewModel) {\r\n this.currentDirection = direction;\r\n\r\n if (await this.hooks.applyFilter('showRiskQuestionModal', false)) {\r\n this.showRiskModal = true;\r\n return false;\r\n }\r\n\r\n const viewModel = this.viewModelRef?.currentViewModel;\r\n\r\n // step unchanged - allow navigating back without validating\r\n if (!viewModel?.isDirty && this.currentDirection === 'back') {\r\n return true;\r\n }\r\n\r\n if (viewModel) {\r\n /* istanbul ignore next */\r\n if (viewModel.quoteOrPolicyVersionId) {\r\n this.entityId = viewModel.quoteOrPolicyVersionId;\r\n }\r\n\r\n // validate step\r\n const result = await viewModel.validate(redirectAfterCreation);\r\n\r\n // step changed and invalid\r\n if (!result && this.currentDirection === 'back') {\r\n // show \"This step must be completed in order to save\" modal\r\n this.showStepTransitionConfirmModal = true;\r\n }\r\n\r\n return result;\r\n }\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /* istanbul ignore next */\r\n async continue() {\r\n this.stepClickedValue = undefined;\r\n this.stepTransitioning = true;\r\n\r\n const currentStepValid = await this.currentStepValidation(true, 'forward');\r\n\r\n if (currentStepValid) {\r\n this.nextStep();\r\n } else {\r\n this.stepTransitioning = false;\r\n }\r\n }\r\n\r\n /* istanbul ignore next */\r\n async back() {\r\n this.stepClickedValue = undefined;\r\n this.stepTransitioning = true;\r\n\r\n const currentStepValid = await this.currentStepValidation(true, 'back');\r\n\r\n if (currentStepValid) {\r\n this.previousStep();\r\n } else {\r\n this.stepTransitioning = false;\r\n }\r\n }\r\n\r\n closeButtonCallback() {\r\n // If it's a draft quote/new quote and there are changes\r\n if (this.composeModel.entityMode === EntityMode.New || sessionStorage.getItem('is_draft_entity') !== null) {\r\n this.showSaveConfirmModal = true;\r\n } else {\r\n // The current step has changes, show confirm modal\r\n if (this.viewModelRef?.currentViewModel?.isDirty) {\r\n this.showCloseConfirmModal = true;\r\n } else {\r\n if (this.entityType === 'quote') {\r\n this.router.navigateToRoute('clientQuotes', { id: this.id, quoteId: this.entityId });\r\n } else if (this.entityType === 'policy' || this.entityType === 'incomplete') {\r\n this.router.navigateToRoute('clientPolicies', {\r\n id: this.id,\r\n policyId: this.policyId,\r\n policyVersionId: 0,\r\n statusTypeId: this.statusTypeId,\r\n versionNo: this.versionNo,\r\n });\r\n } else if (this.entityType === EntityType.Claim) {\r\n this.router.navigateToRoute('clientClaims', { id: this.id, claimId: this.entityId });\r\n } else if (this.entityType === EntityType.FormQuote) {\r\n this.router.navigateToRoute('clientForms', { id: this.id, formId: this.formId });\r\n } else if (this.entityType === EntityType.FormConsent) {\r\n this.router.navigateToRoute('clientForms', { id: this.id, formId: this.formId });\r\n }\r\n }\r\n }\r\n }\r\n\r\n /* istanbul ignore next */\r\n async handleError(error: Error) {\r\n captureException(error);\r\n log.error('Entity Wizard Error =>', error);\r\n }\r\n\r\n updateCurrentStep(step, direction) {\r\n if (step !== undefined && step !== null) {\r\n this.currentStepIndex = step;\r\n }\r\n\r\n if (direction === 'previous' && this.currentStepIndex > 1) {\r\n this.currentStepIndex--;\r\n }\r\n\r\n this.currentStep = this.steps[this.currentStepIndex - 1];\r\n\r\n this.setActiveStep(this.currentStepIndex);\r\n\r\n if (this.currentStepIndex === 1) {\r\n this.backButtonDisabled = true;\r\n } else {\r\n this.backButtonDisabled = false;\r\n }\r\n\r\n this.ea.subscribe('stepRendered', (message = 'Loading...') => {\r\n this.taskQueue.queueMicroTask(() => {\r\n this.stepTransitioning = false;\r\n this.stepTransitionMessage = message;\r\n });\r\n });\r\n }\r\n\r\n async nextStep() {\r\n this.hooks.doAction('wizard:nextStep');\r\n\r\n try {\r\n const hasNextStep = Object.keys(this.steps).length < Object.keys(this.steps).length + 1;\r\n\r\n if (hasNextStep) {\r\n this.currentStepIndex++;\r\n\r\n this.updateCurrentStep(null, 'next');\r\n\r\n if (this.entityType === EntityType.Claim) {\r\n this.router.navigateToRoute(\r\n 'claimWizard',\r\n {\r\n id: this.id,\r\n entityId: this.entityId ?? 0,\r\n entityMode: this.entityMode,\r\n entityType: this.entityType,\r\n policyVersionId: this.policyVersionId,\r\n step: this.currentStepIndex,\r\n },\r\n {\r\n trigger: false,\r\n },\r\n );\r\n } else if ([EntityType.FormConsent, EntityType.FormQuote].includes(this.entityType)) {\r\n this.router.navigateToRoute(\r\n this.formWizardRoute,\r\n {\r\n id: this.id,\r\n formId: this.formId,\r\n entityId: this.entityId ?? 0,\r\n entityMode: this.entityMode,\r\n entityType: this.entityType,\r\n actionType: this.actionType,\r\n step: this.currentStepIndex,\r\n isEditTakeUpAction: false,\r\n },\r\n {\r\n trigger: false,\r\n },\r\n );\r\n } else {\r\n this.router.navigateToRoute(\r\n 'wizard',\r\n {\r\n id: this.id,\r\n parentEntityId: this.policyId,\r\n entityId: this.entityId,\r\n entityMode: this.entityMode,\r\n actionType: this.actionType,\r\n entityType: this.entityType,\r\n step: this.currentStepIndex,\r\n statusTypeId: this.statusTypeId,\r\n versionNo: this.versionNo,\r\n isTakeUp: this.isTakeUp,\r\n isEditTakeUpAction: this.isEditTakeUpAction,\r\n },\r\n {\r\n trigger: false,\r\n },\r\n );\r\n }\r\n }\r\n\r\n setTimeout(() => this.stepRendered(), 500);\r\n } catch (error) {\r\n this.handleError(error);\r\n }\r\n }\r\n\r\n async previousStep() {\r\n this.hooks.doAction('wizard:previousStep');\r\n\r\n try {\r\n this.updateCurrentStep(null, 'previous');\r\n\r\n if (this.entityType === EntityType.Claim) {\r\n this.router.navigateToRoute(\r\n 'claimWizard',\r\n {\r\n id: this.id,\r\n entityId: this.entityId ?? 0,\r\n entityMode: this.entityMode,\r\n entityType: this.entityType,\r\n policyVersionId: this.policyVersionId,\r\n step: this.currentStepIndex,\r\n },\r\n {\r\n trigger: false,\r\n },\r\n );\r\n } else if (WIZARD_FORM_TYPES.includes(this.entityType)) {\r\n this.router.navigateToRoute(\r\n this.formWizardRoute,\r\n {\r\n id: this.id,\r\n formId: this.formId,\r\n entityId: this.entityId ?? 0,\r\n entityMode: this.entityMode,\r\n entityType: this.entityType,\r\n actionType: this.actionType,\r\n step: this.currentStepIndex,\r\n isEditTakeUpAction: false,\r\n },\r\n {\r\n trigger: false,\r\n },\r\n );\r\n } else {\r\n this.router.navigateToRoute(\r\n 'wizard',\r\n {\r\n id: this.id,\r\n parentEntityId: this.policyId,\r\n entityId: this.entityId,\r\n entityMode: this.entityMode,\r\n actionType: this.actionType,\r\n entityType: this.entityType,\r\n step: this.currentStepIndex,\r\n statusTypeId: this.statusTypeId,\r\n versionNo: this.versionNo,\r\n isTakeUp: this.isTakeUp,\r\n isEditTakeUpAction: this.isEditTakeUpAction,\r\n },\r\n {\r\n trigger: false,\r\n },\r\n );\r\n }\r\n\r\n setTimeout(() => this.stepRendered(), 500);\r\n\r\n this.forwardButtonDisabled = false;\r\n } catch (error) {\r\n this.handleError(error);\r\n }\r\n }\r\n\r\n // Special case for claims, forms && policy correction\r\n protected async finish() {\r\n this.forwardButtonDisabled = true;\r\n if (this.entityType === EntityType.Claim && this.isLastStep) {\r\n this.router.navigateToRoute('clientClaims', { id: this.id, claimId: this.entityId });\r\n } else if (WIZARD_FORM_TYPES.includes(this.entityType) && this.isLastStep) {\r\n if (this.isUserForm) {\r\n const result = await this.viewModelRef.currentViewModel.submitForm();\r\n if (result) {\r\n this.router.navigateToRoute('userFormHomeComplete');\r\n } else {\r\n // Something went wrong, re-enable submit button to allow user to try again\r\n this.forwardButtonDisabled = false;\r\n }\r\n } else {\r\n this.router.navigateToRoute('clientForms', { id: this.id, formId: this.formId });\r\n }\r\n } else if (this.isCorrection) {\r\n this.router.navigateToRoute('clientPolicies', {\r\n id: this.id,\r\n policyId: this.policyId,\r\n policyVersionId: 0,\r\n statusTypeId: this.statusTypeId,\r\n versionNo: this.versionNo,\r\n });\r\n } else {\r\n // This should never happen, as all cases where this would be called should be handled above\r\n throw new Error('Finish action is only supported for claims, user forms and policy corrections');\r\n }\r\n }\r\n\r\n // Open request quote modal\r\n async requestQuote() {\r\n const viewModel = this.viewModelRef?.currentViewModel;\r\n\r\n if (viewModel) {\r\n await this.viewModelRef.currentViewModel.requestQuote();\r\n }\r\n }\r\n\r\n // Open cancel quote request modal\r\n async cancelQuoteRequest() {\r\n const viewModel = this.viewModelRef?.currentViewModel;\r\n\r\n if (viewModel) {\r\n await this.viewModelRef.currentViewModel.cancelQuoteRequest();\r\n }\r\n }\r\n\r\n async loadDocumentPack() {\r\n this.modal\r\n .show()\r\n .content(DocumentPack, {\r\n clientId: this.id,\r\n quoteOrPolicyVersionOrClaimId: this.entityId,\r\n policyType: this.entityType,\r\n actionType: this.actionType,\r\n })\r\n .withOptions({ type: 'wide-lg' });\r\n }\r\n\r\n /**\r\n * Handler for forward button click.\r\n * \r\n * For quotes, we want to simply call continue(), but for claims, forms & policy correction we need to call finish()\r\n */\r\n protected handleForwardButtonClick() {\r\n if (this.isLastStep && ([EntityType.Claim, EntityType.FormQuote, EntityType.FormConsent].includes(this.entityType) || this.isCorrection)) {\r\n return this.finish();\r\n }\r\n\r\n return this.continue();\r\n }\r\n\r\n @computedFrom('stepTransitioning')\r\n get wizardStepsDisabled() {\r\n return this.stepTransitioning;\r\n }\r\n\r\n @computedFrom('currentStepIndex', 'steps')\r\n protected get isLastStep() {\r\n return this.currentStepIndex === this.steps.length;\r\n }\r\n\r\n @computedFrom('currentStep','isCorrection', 'isLastStep', 'isUserForm', 'steps')\r\n protected get forwardButtonLabel(): LabelPair {\r\n let forwardButtonLabel = this.isLastStep ? this.i18n.tr('buttonLabels:finish') : this.i18n.tr('buttonLabels:next');\r\n let forwardButtonAriaLabel = this.isLastStep ? this.i18n.tr('buttonLabels:finishAria') : this.i18n.tr('buttonLabels:nextAria');\r\n\r\n if (Object.prototype.hasOwnProperty.call(this.currentStep, 'forwardButtonLabel')) {\r\n forwardButtonLabel = this.currentStep.forwardButtonLabel;\r\n\r\n // Get aria label if provided, else default to button label\r\n forwardButtonAriaLabel = Object.prototype.hasOwnProperty.call(this.currentStep, 'forwardButtonAriaLabel')\r\n ? this.currentStep.forwardButtonAriaLabel\r\n : forwardButtonLabel;\r\n }\r\n\r\n if (this.isCorrection && Object.prototype.hasOwnProperty.call(this.currentStep, 'forwardButtonIsCorrectionLabel')) {\r\n forwardButtonLabel = this.currentStep.forwardButtonIsCorrectionLabel;\r\n\r\n // Get aria label if provided, else default to button label\r\n forwardButtonAriaLabel = Object.prototype.hasOwnProperty.call(this.currentStep, 'forwardButtonIsCorrectionAriaLabel')\r\n ? this.currentStep.forwardButtonIsCorrectionAriaLabel\r\n : forwardButtonLabel;\r\n }\r\n\r\n if (this.isUserForm && Object.prototype.hasOwnProperty.call(this.currentStep, 'forwardButtonIsUserFormLabel')) {\r\n forwardButtonLabel = this.currentStep.forwardButtonIsUserFormLabel;\r\n\r\n // Get aria label if provided, else default to button label\r\n forwardButtonAriaLabel = Object.prototype.hasOwnProperty.call(this.currentStep, 'forwardButtonIsUserFormAriaLabel')\r\n ? this.currentStep.forwardButtonIsUserFormAriaLabel\r\n : forwardButtonLabel;\r\n }\r\n\r\n return {\r\n label: forwardButtonLabel,\r\n ariaLabel: forwardButtonAriaLabel,\r\n };\r\n }\r\n\r\n @computedFrom('forwardButtonDisabled', 'stepTransitioning', 'isLastStep', 'entityMode', 'viewModelRef.currentViewModel.config.referrerFeesRequireAcknowledgement', 'viewModelRef.currentViewModel.referrerFeeAcknowledged')\r\n protected get forwardButtonIsDisabled() {\r\n const isReadOnlyLastStepButNotCorrection = !this.isCorrection && this.isLastStep && this.entityMode === EntityMode.View;\r\n const isReferrerFeeAcknowledgementRequired = this.viewModelRef?.currentViewModel?.config?.referrerFeesRequireAcknowledgement && !this.viewModelRef?.currentViewModel?.referrerFeeAcknowledged;\r\n\r\n return this.forwardButtonDisabled || this.stepTransitioning || isReadOnlyLastStepButNotCorrection || isReferrerFeeAcknowledgementRequired;\r\n }\r\n}\r\n"],"names":["module","exports","cb","__webpack_require__","e","then","require","bind","oe","__webpack_exports__","WIZARD_FORM_TYPES","routes_app_adviser_client_quotes_interfaces__WEBPACK_IMPORTED_MODULE_15__","ck","FormQuote","FormConsent","Wizard","claims","router","toast","http","ea","hooks","taskQueue","modal","i18n","this","styles","_quotes_quotes_css__WEBPACK_IMPORTED_MODULE_16__","A","forwardButtonDisabled","noPermission","entityMode","$L","None","showSaveConfirmModal","showCloseConfirmModal","showStepTransitionConfirmModal","showRiskModal","steps","_steps_config__WEBPACK_IMPORTED_MODULE_17__","Db","currentStepIndex","backButtonDisabled","stepTransitioning","discardTitle","hasQuoteDocumentPack","hasPolicyDocumentPack","isCorrection","isUserForm","prototype","stepRendered","window","location","href","includes","appClientType","resources_parse_jwt__WEBPACK_IMPORTED_MODULE_10__","jl","appClientInstance","Ye","url","concat","toLowerCase","fetch","method","headers","localStorage","getItem","response","get","setItem","status","_this","publish","_a","sent","addAction","currentStepValidation","hasAsync","_c","_b","unbind","removeAction","saveCallback","type","entityId","endpoint","uri","entityType","environment__WEBPACK_IMPORTED_MODULE_8__","c","clientEndpoints","quotes","delete","id","wizard","actionType","Claim","sessionStorage","removeItem","navigateToRoute","quoteId","policyId","policyVersionId","statusTypeId","versionNo","claimId","formId","stepValid","parseInt","stepTransitionPrompt","destroyAllToasts","viewModelRef","currentViewModel","stepClickedValue","visitStep","closeConfirmCallback","incompleteRiskQuestionsCallback","currentDirection","setActiveStep","stepIndex","forEach","step","active","canActivate","route_1","route","parentEntityId","newActionType","isTakeUp","isEditTakeUpAction","entityTypeLabel","replace","toUpperCase","settings","clientNavLabel","isNaN","Number","Quote","slice","Policy","Incomplete","resources_map_entity_type__WEBPACK_IMPORTED_MODULE_9__","z","hasCorrection","hasEditTakeup","mappedActionTyped","b","nonViewActionTypes","QX","Renewal","Endorsement","Reinstatement","Cancellation","fr","formWizardRoute","name","$G","Vu","currentStep","mappedActionType","parsedNewActionType","userHasViewPermission","userHasEditPermission","View","Edit","New","resources_services_log_service__WEBPACK_IMPORTED_MODULE_14__","R","info","composeModel","stepClicked","index","direction","doAction","updateCurrentStep","undefined","trigger","setTimeout","error","handleError","redirectAfterCreation","applyFilter","viewModel","isDirty","quoteOrPolicyVersionId","validate","result","continue","nextStep","back","previousStep","closeButtonCallback","_sentry_core__WEBPACK_IMPORTED_MODULE_0__","Cp","subscribe","message","queueMicroTask","stepTransitionMessage","Object","keys","length","finish","isLastStep","submitForm","Error","requestQuote","cancelQuoteRequest","loadDocumentPack","show","content","components_document_pack_document_pack__WEBPACK_IMPORTED_MODULE_6__","Zc","clientId","quoteOrPolicyVersionOrClaimId","policyType","withOptions","handleForwardButtonClick","defineProperty","forwardButtonLabel","tr","forwardButtonAriaLabel","hasOwnProperty","call","forwardButtonIsCorrectionLabel","forwardButtonIsCorrectionAriaLabel","forwardButtonIsUserFormLabel","forwardButtonIsUserFormAriaLabel","label","ariaLabel","isReadOnlyLastStepButNotCorrection","isReferrerFeeAcknowledgementRequired","config","referrerFeesRequireAcknowledgement","_e","_d","referrerFeeAcknowledged","__decorate","aurelia_framework__WEBPACK_IMPORTED_MODULE_3__","computedFrom","autoinject","resources_services_claims_service__WEBPACK_IMPORTED_MODULE_12__","B","aurelia_router__WEBPACK_IMPORTED_MODULE_5__","Lz","resources_services_ia_toast_service__WEBPACK_IMPORTED_MODULE_13__","VC","aurelia_fetch_client__WEBPACK_IMPORTED_MODULE_2__","Qq","aurelia_event_aggregator__WEBPACK_IMPORTED_MODULE_1__","EventAggregator","_f","resources_services_aurelia_hooks__WEBPACK_IMPORTED_MODULE_11__","K","_g","TaskQueue","_h","components_modal_modal_service__WEBPACK_IMPORTED_MODULE_7__","_j","aurelia_i18n__WEBPACK_IMPORTED_MODULE_4__","I18N"],"sourceRoot":""}