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oBAAY,eAAEC,kBAGnC,GAAMxC,KAAKuC,aAAaC,iBAAiBgE,sBADvC,M,OACF,S,mCAIE,YAAAC,iBAAN,W,0EACEzG,KAAK1B,MACFoI,OACAC,QAAQ,KAAc,CACrBC,SAAU5G,KAAKwB,GACfqF,8BAA+B7G,KAAKoB,SACpC0F,WAAY9G,KAAKuB,WACjBE,WAAYzB,KAAKyB,aAElBsF,YAAY,CAAE5F,KAAM,Y,WAGzB,sBACI,kCAAmB,C,IADvB,WAEE,OAAOnB,KAAKd,iBACd,E,gCAHA,IAAC,IAAA8H,cAAa,qB,2FAvzBG,IADlB,IAAAC,c,uBAsDkB,IACA,KACD,KACD,KACF,EAAAC,gBACG,IACI,EAAAC,UACJ,OA5DLC,E,CAAb,E","sources":["webpack://iadviser/./src/routes/app-adviser/diagnostics/diagnostics.ts?518d","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!./diagnostics.ts\"));\n\t}, \"diagnostics\");\n}","// Module\nvar code = \"\\r\\n\";\n// Exports\nexport default code;","import { mapActionTypeToEntityActionType, EntityActionTypeToActionTypeLabel } from 'resources/map-entity-type';\r\nimport { QuoteStepMap, ClaimStepMap } from './steps/quote/config';\r\nimport { ConfirmModalActions } from 'components/ia-modal/ia-modal';\r\nimport { environment } from 'environment';\r\nimport { HttpClient } from 'aurelia-fetch-client';\r\nimport { log } from 'resources/services/log-service';\r\nimport { AppRouter } from 'aurelia-router';\r\nimport { ClaimsService } from 'resources/services/claims-service';\r\nimport { autoinject, computedFrom, TaskQueue } from 'aurelia-framework';\r\nimport styles from '../quotes/quotes.css';\r\nimport { IaToastService } from 'resources/services/ia-toast-service';\r\nimport { captureException } from '@sentry/core';\r\nimport { EventAggregator } from 'aurelia-event-aggregator';\r\nimport { AureliaHooks } from 'resources/services/aurelia-hooks';\r\nimport { EntityMode, EntityActionType, EntityType } from 'routes/app-adviser/client/quotes/interfaces';\r\nimport { getAppClientType, getAppClientInstance } from 'resources/parse-jwt';\r\nimport { DocumentPack } from 'components/document-pack/document-pack';\r\nimport { ModalService } from 'components/modal/modal-service';\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 showIncompleteRiskQuestionsWarning = false;\r\n\r\n public steps = QuoteStepMap;\r\n\r\n public currentStep;\r\n public currentStepIndex = 0;\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\r\n private clientNavLabel;\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 ) {}\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 sessionStorage.removeItem('is_draft_entity_post_6');\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 }\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 sessionStorage.removeItem('is_draft_entity_post_6');\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 }\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 }\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 }\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 if (viewModel) {\r\n viewModel.hasRiskUpdated = false;\r\n }\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.showIncompleteRiskQuestionsWarning = 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 },\r\n route,\r\n ) {\r\n this.statusTypeId = statusTypeId;\r\n this.versionNo = versionNo;\r\n this.isTakeUp = isTakeUp;\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 === '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 === 'policy' || entityType === 'incomplete') {\r\n this.discardTitle = `New ${EntityActionTypeToActionTypeLabel(actionType)}`;\r\n\r\n // prevent users from changing view policy route to edit\r\n if (entityType === 'policy' && !newActionType && entityMode === 'edit') {\r\n const hasCorrection = await this.claims.hasAsync(\r\n 'IadviserProcessingPolicyPolicyMaintenanceContextMenuCorrection',\r\n );\r\n if (hasCorrection) {\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 // 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 sessionStorage.removeItem('is_draft_entity_post_6');\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 }\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 };\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 {\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 },\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 (this.entityMode === EntityMode.View) {\r\n await this.hooks.applyFilter('hideTitle', false);\r\n return true;\r\n }\r\n\r\n // highlight any incomplete mandatory risk questions\r\n await this.hooks.applyFilter('canHighlightFieldsForReview', false);\r\n\r\n // if incomplete risk grid responses or interested parties are present, show modal and prevent navigation\r\n if (\r\n (await this.hooks.applyFilter('showIncompleteGridResponseWarning', false)) ||\r\n (await this.hooks.applyFilter('showIncompleteInterestedPartyWarning', false))\r\n ) {\r\n return false;\r\n }\r\n\r\n // show incomplete mandatory risk questions modal\r\n this.showIncompleteRiskQuestionsWarning = await this.hooks.applyFilter(\r\n 'showIncompleteRiskQuestionsWarning',\r\n false,\r\n );\r\n if (this.showIncompleteRiskQuestionsWarning === 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 }\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 ?? EntityType.Claim,\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 {\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 },\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 ?? EntityType.Claim,\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 {\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 },\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 && policy correction\r\n finish() {\r\n if (this.entityType === EntityType.Claim && this.currentStepIndex === 8) {\r\n this.router.navigateToRoute('clientClaims', { id: this.id, claimId: this.entityId });\r\n }\r\n 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 }\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 @computedFrom('stepTransitioning')\r\n get wizardStepsDisabled() {\r\n return this.stepTransitioning;\r\n }\r\n}\r\n"],"names":["module","exports","cb","require","claims","router","toast","http","ea","hooks","taskQueue","modal","styles","forwardButtonDisabled","noPermission","entityMode","showSaveConfirmModal","showCloseConfirmModal","showStepTransitionConfirmModal","showIncompleteRiskQuestionsWarning","steps","currentStepIndex","backButtonDisabled","stepTransitioning","discardTitle","hasQuoteDocumentPack","hasPolicyDocumentPack","isCorrection","stepRendered","window","location","href","includes","appClientType","appClientInstance","url","toLowerCase","this","fetch","method","headers","localStorage","getItem","then","response","get","setItem","status","publish","bind","addAction","currentStepValidation","hasAsync","unbind","removeAction","saveCallback","type","entityId","endpoint","uri","entityType","id","actionType","sessionStorage","removeItem","navigateToRoute","quoteId","policyId","policyVersionId","statusTypeId","versionNo","claimId","stepValid","parseInt","stepTransitionPrompt","destroyAllToasts","viewModelRef","currentViewModel","stepClickedValue","visitStep","closeConfirmCallback","incompleteRiskQuestionsCallback","viewModel","hasRiskUpdated","currentDirection","setActiveStep","stepIndex","forEach","step","active","canActivate","route","parentEntityId","newActionType","isTakeUp","entityTypeLabel","replace","c","toUpperCase","settings","clientNavLabel","isNaN","Number","mappedActionTyped","nonViewActionTypes","currentStep","mappedActionType","parsedNewActionType","userHasViewPermission","userHasEditPermission","composeModel","stepClicked","index","direction","doAction","updateCurrentStep","undefined","trigger","setTimeout","error","handleError","redirectAfterCreation","applyFilter","isDirty","quoteOrPolicyVersionId","validate","result","continue","nextStep","back","previousStep","closeButtonCallback","subscribe","message","queueMicroTask","stepTransitionMessage","Object","keys","length","finish","requestQuote","cancelQuoteRequest","loadDocumentPack","show","content","clientId","quoteOrPolicyVersionOrClaimId","policyType","withOptions","computedFrom","autoinject","EventAggregator","TaskQueue","Wizard"],"sourceRoot":""}