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,SAASC,gBAAgBQ,eAAiB,EAAKJ,oBAAoBI,gBAK1B,MAA5C,EAAKJ,oBAAoBI,iBAC3B,EAAKT,SAASC,gBAAgBC,cAAgB,MAGhD,EAAKS,QAAQjB,aAAa,EAAKM,SAAU,EAAKY,MAChD,GACF,E,mUAvC+B,GADhC,IAAAC,eAAc,4BACFqD,E,CAAb,CAA0C,I,klBCA1C,2B,8CAQA,QAR8B,OAC5B,YAAAxE,aAAA,SAAaC,GAAb,gBAAa,IAAAA,IAAAA,GAAA,GACXE,KAAKC,UAAUC,WAAU,WACvB,YAAML,aAAY,OAACC,GAEnB,EAAKgB,QAAQjB,aAAa,EAAKM,SAAU,EAAKY,MAChD,GACF,E,mUAPmB,GADpB,IAAAC,eAAc,aACFgF,E,CAAb,CAA8B,I","sources":["webpack://iadviser/./src/components/qce/components/date-format-free-text.html","webpack://iadviser/./src/components/qce/components/date-format.html","webpack://iadviser/./src/components/qce/components/debug.html","webpack://iadviser/./src/components/qce/components/decimal-format-free-text.html","webpack://iadviser/./src/components/qce/components/decimal-format.html","webpack://iadviser/./src/components/qce/components/dropdown-with-currency.html","webpack://iadviser/./src/components/qce/components/dropdown-with-dropdown.html","webpack://iadviser/./src/components/qce/components/dropdown-with-free-text.html","webpack://iadviser/./src/components/qce/components/dropdown.html","webpack://iadviser/./src/components/qce/components/date-format-free-text.ts","webpack://iadviser/./src/components/qce/components/date-format.ts","webpack://iadviser/./src/components/qce/components/decimal-format-free-text.ts","webpack://iadviser/./src/components/qce/components/decimal-format.ts","webpack://iadviser/./src/components/qce/components/decorators/calculate-source-questions.ts","webpack://iadviser/./src/components/qce/components/dropdown-with-currency.ts","webpack://iadviser/./src/components/qce/components/dropdown-with-dropdown.ts","webpack://iadviser/./src/components/qce/components/dropdown-with-free-text.ts","webpack://iadviser/./src/components/qce/components/dropdown.ts"],"sourcesContent":["// Module\nvar code = \"\\r\\n \\r\\n \\r\\n\\r\\n \\r\\n\\r\\n \\r\\n \\r\\n\\r\\n or\\r\\n\\r\\n \\r\\n \\r\\n\";\n// Exports\nexport default code;","// Module\nvar code = \"\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\";\n// Exports\nexport default code;","// Module\nvar code = \"\\r\\n \\r\\n Debug: \\r\\n \\r\\n \\r\\n QCE View Mode: ${context.viewMode}\\r\\n \\r\\n\\r\\n \\r\\n \\r\\n Question ID: ${question.questionId}\\r\\n Display Type ID: ${question.displayTypeId}\\r\\n Display Type: ${question.displayType}\\r\\n Answer Length: ${question.answerLength}\\r\\n Response Value: ${question.currentResponse.responseValue}\\r\\n Mandatory on Quote: ${question.mandatoryOnQuoteFlag}\\r\\n Mandatory on Policy: ${question.mandatoryOnPolicyFlag}\\r\\n Question Read Only: ${question.readOnlyFlag}\\r\\n Disabled by Flow: ${question.disabledByQuestionFlowFlag}\\r\\n \\r\\n \\r\\n\";\n// Exports\nexport default code;","// Module\nvar code = \"\\r\\n \\r\\n \\r\\n\\r\\n \\r\\n\\r\\n \\r\\n \\r\\n\\r\\n or\\r\\n\\r\\n \\r\\n \\r\\n\";\n// Exports\nexport default code;","// Module\nvar code = \"\\r\\n \\r\\n \\r\\n\\r\\n \\r\\n\";\n// Exports\nexport default code;","// Module\nvar code = \"\\r\\n \\r\\n \\r\\n\\r\\n \\r\\n\\r\\n \\r\\n \\r\\n ${answer.answerText}\\r\\n \\r\\n \\r\\n\\r\\n or\\r\\n\\r\\n \\r\\n\\r\\n \\r\\n\";\n// Exports\nexport default code;","// Module\nvar code = \"\\r\\n \\r\\n \\r\\n\\r\\n \\r\\n\\r\\n \\r\\n \\r\\n Town\\r\\n \\r\\n \\r\\n ${region.externalSystemRegionName}\\r\\n \\r\\n \\r\\n\\r\\n \\r\\n Suburb\\r\\n \\r\\n \\r\\n ${suburb.externalSystemSuburbName}\\r\\n \\r\\n \\r\\n \\r\\n\\r\\n\";\n// Exports\nexport default code;","// Module\nvar code = \"\\r\\n \\r\\n \\r\\n\\r\\n \\r\\n\\r\\n \\r\\n \\r\\n ${answer.answerText}\\r\\n \\r\\n \\r\\n\\r\\n or\\r\\n\\r\\n \\r\\n \\r\\n\";\n// Exports\nexport default code;","// Module\nvar code = \"\\r\\n \\r\\n \\r\\n\\r\\n \\r\\n \\r\\n ${answer.answerText}\\r\\n \\r\\n\";\n// Exports\nexport default code;","import { generateGuidString } from 'resources/utilities/insecure-guid';\r\nimport { ComponentBase } from './component-base';\r\nimport { customElement } from 'aurelia-framework';\r\n\r\n@customElement('date-format-free-text')\r\nexport class DateFormatFreeText extends ComponentBase {\r\n public id = generateGuidString();\r\n public iaInput: HTMLInputElement; \r\n\r\n fieldChanged(isInput = false, type = 'freeText') { \r\n this.taskQueue.queueTask(() => {\r\n\r\n if (!this.question.currentResponse.responseValue || this.question.currentResponse.responseValue.toString().trim() === '') {\r\n // Set current workflow item to be NoResponse type\r\n this.currentWorkflowItem = this.question.questionFlow.find(f => f.responseTypeId === -1);\r\n } else {\r\n if (type === 'date') {\r\n // We have a user entered value, set the response type to Date\r\n this.currentWorkflowItem = this.question.questionFlow.find(f => f.responseTypeId === 600000003);\r\n } else if (type === 'freeText') {\r\n // We have a user entered value, set the response type to FreeText\r\n this.currentWorkflowItem = this.question.questionFlow.find(f => f.responseTypeId === 600000005);\r\n }\r\n }\r\n\r\n this.question.currentResponse.responseType = this.currentWorkflowItem.responseType;\r\n this.question.currentResponse.responseTypeId = this.currentWorkflowItem.responseTypeId;\r\n\r\n this.context.fieldChanged(this.question, this.group);\r\n });\r\n }\r\n}\r\n","import { log } from './../../../resources/services/log-service';\r\nimport { generateGuidString } from 'resources/utilities/insecure-guid';\r\nimport { ComponentBase } from './component-base';\r\nimport { customElement, bindable } from 'aurelia-framework';\r\n\r\n@customElement('date-format')\r\nexport class DateFormat extends ComponentBase {\r\n public id = generateGuidString();\r\n public iaInput: HTMLInputElement;\r\n @bindable() inputFormat = 'DD/MM/YYYY';\r\n\r\n fieldChanged(isInput = false) { \r\n this.taskQueue.queueTask(() => {\r\n super.fieldChanged(isInput);\r\n\r\n this.question.currentResponse.responseType = this.currentWorkflowItem.responseType;\r\n this.question.currentResponse.responseTypeId = this.currentWorkflowItem.responseTypeId;\r\n\r\n this.context.fieldChanged(this.question, this.group);\r\n });\r\n }\r\n}\r\n","import { generateGuidString } from 'resources/utilities/insecure-guid';\r\nimport { ComponentBase } from './component-base';\r\nimport { customElement } from 'aurelia-framework';\r\n\r\nconst inputMaskOptions = {\r\n alias: 'decimal',\r\n autoUnmask: true\r\n};\r\n\r\n@customElement('decimal-format-free-text')\r\nexport class DecimalFormatText extends ComponentBase {\r\n public id = generateGuidString();\r\n public iaInput: HTMLInputElement;\r\n private inputMaskOptions = { ...inputMaskOptions };\r\n\r\n bind() {\r\n super.bind();\r\n }\r\n\r\n fieldChanged(isInput = false, type = 'freeText') { \r\n this.taskQueue.queueTask(() => { \r\n if (!this.question.currentResponse.responseValue || this.question.currentResponse.responseValue.toString().trim() === '') {\r\n // Set current workflow item to be NoResponse type\r\n this.currentWorkflowItem = this.question.questionFlow.find(f => f.responseTypeId === -1);\r\n } else {\r\n if (type === 'decimal') {\r\n // We have a user entered value, set the response type to Currency\r\n this.currentWorkflowItem = this.question.questionFlow.find(f => f.responseTypeId === 600000004);\r\n } else if (type === 'freeText') {\r\n // We have a user entered value, set the response type to FreeText\r\n this.currentWorkflowItem = this.question.questionFlow.find(f => f.responseTypeId === 600000005);\r\n }\r\n }\r\n\r\n this.question.currentResponse.responseType = this.currentWorkflowItem.responseType;\r\n this.question.currentResponse.responseTypeId = this.currentWorkflowItem.responseTypeId;\r\n\r\n this.context.fieldChanged(this.question, this.group);\r\n });\r\n }\r\n}\r\n","import { generateGuidString } from 'resources/utilities/insecure-guid';\r\nimport { ComponentBase } from './component-base';\r\nimport { customElement } from 'aurelia-framework';\r\n\r\nconst inputMaskOptions = {\r\n alias: 'decimal',\r\n autoUnmask: true\r\n};\r\n\r\n@customElement('decimal-format')\r\nexport class DecimalFormat extends ComponentBase {\r\n public id = generateGuidString();\r\n public iaInput: HTMLInputElement;\r\n private inputMaskOptions = { ...inputMaskOptions };\r\n\r\n bind() {\r\n super.bind();\r\n }\r\n\r\n fieldChanged(isInput = false) { \r\n this.taskQueue.queueTask(() => {\r\n super.fieldChanged(isInput);\r\n\r\n this.question.currentResponse.responseType = this.currentWorkflowItem.responseType;\r\n this.question.currentResponse.responseTypeId = this.currentWorkflowItem.responseTypeId;\r\n this.question.currentResponse.responseValue = this.iaInput.inputmask.unmaskedvalue();\r\n\r\n this.context.fieldChanged(this.question, this.group);\r\n });\r\n }\r\n}\r\n","export function calculateSourceQuestions() {\r\n return function (target: any) {\r\n target.prototype.calculateSourceQuestions = function () {\r\n // recalculate calculated questions across all groups\r\n this.context?.model?.groups.forEach((group) => {\r\n if (group && group.questions) {\r\n group.questions = group.questions.map((question) => {\r\n const allowedDecmials = [600000020, 5, 14];\r\n const allowDollarSign = [600000030, 600000031, 1, 16, 600000021, 600000020];\r\n\r\n // This is a source calculated field, there will be one or more ID's to calculate from\r\n if (question.sourceCalculatedQuestions && question.sourceCalculatedQuestions.length) {\r\n let calculatedTotal = 0;\r\n let calculatedAtLeastOnce = false;\r\n\r\n // Loop over all questions\r\n for (const id of question.sourceCalculatedQuestions) {\r\n const foundQuestion = this.context.findQuestionByIdInModel(id);\r\n\r\n // Do we have a source question, a value and it hasn't been disabled? It gets factored into the calculation\r\n if (\r\n foundQuestion &&\r\n !foundQuestion.disabledByQuestionFlowFlag &&\r\n foundQuestion.currentResponse.responseValue !== null\r\n ) {\r\n // Filter the current value of anything potentially user entered that cannot be calculated\r\n let responseValue = foundQuestion.currentResponse.responseValue\r\n .toString()\r\n .replace(/,/g, ' ')\r\n .replace(/\\s/g, '');\r\n\r\n // Strip out dollar sign\r\n if (allowDollarSign.includes(question.displayTypeId)) {\r\n responseValue = responseValue.replace('$', '');\r\n }\r\n\r\n // If the length of this equals two, it's a decimal value\r\n const splitAtCents = responseValue.split('.');\r\n\r\n // We have a value, and it's a decimal\r\n if (responseValue && splitAtCents.length > 1) {\r\n if (!allowedDecmials.includes(question.displayTypeId)) {\r\n continue;\r\n }\r\n\r\n // Decimals provided are greater than allowed two\r\n if (splitAtCents[1].length > 2) {\r\n continue;\r\n }\r\n }\r\n\r\n // Value contains non-numeric values, skip\r\n if (\r\n !responseValue.match(/^[0-9]*$/gm) &&\r\n !responseValue.includes('.') &&\r\n !responseValue.includes('-')\r\n ) {\r\n continue;\r\n }\r\n\r\n // Parse the value\r\n const possibleAmount = allowedDecmials.includes(question.displayTypeId)\r\n ? parseFloat(responseValue)\r\n : parseInt(responseValue);\r\n\r\n // Is it a number? Add it to the running total\r\n if (!isNaN(possibleAmount)) {\r\n calculatedTotal += possibleAmount;\r\n calculatedAtLeastOnce = true;\r\n }\r\n }\r\n }\r\n\r\n if (calculatedTotal === 0 && !calculatedAtLeastOnce) {\r\n question.currentResponse.responseValue = null;\r\n question.currentResponse.responsePresent = false;\r\n question.currentResponse.responseTypeId = -1;\r\n } else {\r\n question.currentResponse.responseValue = allowedDecmials.includes(question.displayTypeId)\r\n ? calculatedTotal.toFixed(2)\r\n : calculatedTotal.toFixed(0);\r\n question.currentResponse.responsePresent = true;\r\n question.currentResponse.responseTypeId = 600000001;\r\n }\r\n }\r\n\r\n return question;\r\n });\r\n }\r\n });\r\n };\r\n };\r\n}\r\n","import { ComponentBase } from './component-base';\r\nimport { customElement } from 'aurelia-framework';\r\n\r\n@customElement('dropdown-with-currency')\r\nexport class DropdownWithCurrency extends ComponentBase {\r\n // private inputMaskOptions: any = {\r\n // alias: 'currency',\r\n // digits: 0,\r\n // max: '999999999',\r\n // clearMaskOnLostFocus: true,\r\n // autoUnmask: true\r\n // };\r\n\r\n private inputMaskOptions: any = {\r\n decimalPlaces : 0,\r\n minimumValue : '-999999999999',\r\n maximumValue : '999999999999',\r\n emptyInputBehavior: 'focus'\r\n };\r\n\r\n bind() {\r\n super.bind();\r\n\r\n // Decimal\r\n if (this.question.displayTypeId === 600000031) {\r\n // this.inputMaskOptions.digits = 2;\r\n // this.inputMaskOptions.max = '999999999.99';\r\n\r\n this.inputMaskOptions.decimalPlaces = 2;\r\n this.inputMaskOptions.minimumValue = '-999999999.99'\r\n this.inputMaskOptions.maximumValue = '999999999.99'\r\n }\r\n }\r\n\r\n fieldChanged(isInput = false) {\r\n this.taskQueue.queueTask(() => {\r\n super.fieldChanged(isInput);\r\n\r\n // If it's not an input, it's a dropdown\r\n if (isInput) {\r\n // We have no currently user entered value, it's empty\r\n if (!this.questionHasValidCurrentResponse()) {\r\n // Set current workflow item to be NoResponse type\r\n this.currentWorkflowItem = this.question.questionFlow.find(f => f.responseTypeId === -1);\r\n } else {\r\n // We have a user entered value, set the response type to Currency\r\n this.currentWorkflowItem = this.question.questionFlow.find(f => f.responseTypeId === 600000002);\r\n }\r\n\r\n this.question.currentResponse.responseType = this.currentWorkflowItem.responseType;\r\n this.question.currentResponse.responseTypeId = this.currentWorkflowItem.responseTypeId;\r\n } else {\r\n if (this.question.currentResponse && this.question._selectedValue) {\r\n const answerOption = this.question.answerOptions.find(a => a.answerId === this.question._selectedValue.answerId);\r\n\r\n const responseValue = answerOption.answerText.toString()\r\n .replace(/,/g, ' ').replace('$', '').replace(/\\s/g, '');\r\n\r\n if (responseValue) {\r\n this.question.currentResponse.responseValue = responseValue;\r\n } else {\r\n this.question.currentResponse.responsePresent = false;\r\n this.question.currentResponse.responseTypeId = -1;\r\n this.question.currentResponse.responseValue = null;\r\n }\r\n } else {\r\n this.question.currentResponse.responsePresent = false;\r\n this.question.currentResponse.responseTypeId = -1;\r\n this.question.currentResponse.responseValue = null;\r\n }\r\n }\r\n\r\n if (!this.question.currentResponse.responseValue || this.question.currentResponse.responseValue.toString().trim() === '') {\r\n this.currentWorkflowItem = this.question.questionFlow.find(f => f.responseTypeId === -1);\r\n }\r\n\r\n this.calculateSourceQuestions();\r\n\r\n this.context.fieldChanged(this.question, this.group);\r\n });\r\n }\r\n}\r\n","import { ComponentBase } from './component-base';\r\nimport { customElement } from 'aurelia-framework';\r\nimport { environment } from 'base-environment';\r\n\r\n// DisplayTypeId 610000070\r\n\r\n@customElement('dropdown-with-dropdown')\r\nexport class DropdownWithDropdown extends ComponentBase {\r\n private isLoading = false;\r\n private regionTypes = [];\r\n private suburbTypes = [];\r\n\r\n async bind() {\r\n super.bind();\r\n\r\n const endpoint = environment.refData.externalSystemRegions;\r\n const uri = endpoint.uri();\r\n const result = await this.http.fetch(uri, { method: endpoint.method });\r\n if (result.ok) {\r\n this.regionTypes = await result.json();\r\n }\r\n\r\n if (this.question) {\r\n const currentValue = this.question.currentResponse.responseValue;\r\n\r\n if (currentValue) {\r\n const regionSuburb = currentValue.split('|');\r\n const region = regionSuburb[0];\r\n const suburb = regionSuburb[1];\r\n\r\n if(region){\r\n const regionFound = this.regionTypes.find((x) => x.externalSystemRegionName === region);\r\n this.question._selectedRegion = regionFound;\r\n\r\n if(regionFound){\r\n await this.getSuburbTypes(regionFound.externalSystemRegionId);\r\n\r\n if(this.suburbTypes.length){\r\n const foundSuburb = this.suburbTypes.find((x) => x.externalSystemSuburbName === suburb);\r\n if(foundSuburb){\r\n this.question._selectedSuburb = foundSuburb;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n async regionTypeChanged(){\r\n this.taskQueue.queueTask(async () => {\r\n this.suburbTypes = [];\r\n this.question._selectedSuburb = null;\r\n\r\n if(this.question._selectedRegion){\r\n this.isLoading = true;\r\n await this.getSuburbTypes(this.question._selectedRegion.externalSystemRegionId)\r\n this.isLoading = false;\r\n }\r\n\r\n this.fieldChanged();\r\n })\r\n }\r\n\r\n suburbTypeChanged() {\r\n this.taskQueue.queueTask(() => {\r\n\r\n if (this.question._selectedSuburb) {\r\n this.question.currentResponse.responseValue = `${this.question._selectedRegion.externalSystemRegionName}|${this.question._selectedSuburb.externalSystemSuburbName}`\r\n }\r\n\r\n this.fieldChanged();\r\n });\r\n }\r\n\r\n fieldChanged() {\r\n this.taskQueue.queueTask(() => {\r\n\r\n if (this.question._selectedSuburb) {\r\n const currentWorkflowItem = this.question.questionFlow.find(q => q.responseTypeId === 600000001);\r\n\r\n this.question.currentResponse.responsePresent = true;\r\n this.question.currentResponse = { ...this.question.currentResponse, ...currentWorkflowItem };\r\n } else {\r\n const currentWorkflowItem = this.question.questionFlow.find(q => q.responseTypeId === -1);\r\n\r\n this.question.currentResponse.responsePresent = false;\r\n this.question.currentResponse = { ...this.question.currentResponse, ...currentWorkflowItem };\r\n }\r\n\r\n this.context.fieldChanged(this.question, this.group);\r\n });\r\n }\r\n\r\n async getSuburbTypes(externalSystemRegionId){\r\n const endpoint = environment.refData.externalSystemSuburbs;\r\n const uri = endpoint.uri([externalSystemRegionId]);\r\n const result = await this.http.fetch(uri, { method: endpoint.method });\r\n if (result.ok) {\r\n this.suburbTypes = await result.json();\r\n }\r\n }\r\n}\r\n","import { ComponentBase } from './component-base';\r\nimport { customElement } from 'aurelia-framework';\r\n\r\n@customElement('dropdown-with-free-text')\r\nexport class DropdownWithCurrency extends ComponentBase {\r\n\r\n bind() {\r\n super.bind();\r\n\r\n // The current value is a dropdown selection\r\n // so we want to remove the response value (which is user entered)\r\n if (this.currentWorkflowItem && this.currentWorkflowItem.responseTypeId === 600000000) {\r\n this.question.currentResponse.responseValue = null;\r\n }\r\n }\r\n\r\n fieldChanged(isInput = false) { \r\n this.taskQueue.queueTask(() => {\r\n super.fieldChanged(isInput);\r\n\r\n // If it's not an input, it's a dropdown\r\n if (isInput) {\r\n // We have no currently user entered value, it's empty\r\n if (!this.question.currentResponse.responseValue || this.question.currentResponse.responseValue.toString().trim() === '') {\r\n // Set current workflow item to be NoResponse type\r\n this.currentWorkflowItem = this.question.questionFlow.find(f => f.responseTypeId === -1);\r\n } else {\r\n // We have a user entered value, set the response type to FreeText\r\n this.currentWorkflowItem = this.question.questionFlow.find(f => f.responseTypeId === 600000005);\r\n }\r\n\r\n this.question.currentResponse.responseType = this.currentWorkflowItem.responseType;\r\n this.question.currentResponse.responseTypeId = this.currentWorkflowItem.responseTypeId;\r\n }\r\n\r\n // The current value is a dropdown selection\r\n // so we want to remove the response value (which is user entered)\r\n if (this.currentWorkflowItem.responseTypeId === 600000000) {\r\n this.question.currentResponse.responseValue = null;\r\n }\r\n\r\n this.context.fieldChanged(this.question, this.group);\r\n });\r\n }\r\n}\r\n","import { ComponentBase } from './component-base';\r\nimport { customElement } from 'aurelia-framework';\r\n\r\n@customElement('dropdown')\r\nexport class Dropdown extends ComponentBase {\r\n fieldChanged(isInput = false) { \r\n this.taskQueue.queueTask(() => {\r\n super.fieldChanged(isInput);\r\n \r\n this.context.fieldChanged(this.question, this.group);\r\n });\r\n }\r\n}\r\n"],"names":["id","fieldChanged","isInput","type","this","taskQueue","queueTask","question","currentResponse","responseValue","toString","trim","currentWorkflowItem","questionFlow","find","f","responseTypeId","responseType","context","group","customElement","DateFormatFreeText","inputFormat","bindable","DateFormat","inputMaskOptions","alias","autoUnmask","bind","DecimalFormatText","iaInput","inputmask","unmaskedvalue","DecimalFormat","calculateSourceQuestions","target","prototype","model","groups","forEach","questions","map","allowedDecmials","allowDollarSign","sourceCalculatedQuestions","length","calculatedTotal","calculatedAtLeastOnce","foundQuestion","findQuestionByIdInModel","disabledByQuestionFlowFlag","replace","includes","displayTypeId","splitAtCents","split","match","possibleAmount","parseFloat","parseInt","isNaN","toFixed","responsePresent","decimalPlaces","minimumValue","maximumValue","emptyInputBehavior","questionHasValidCurrentResponse","_selectedValue","answerOptions","a","answerId","answerText","DropdownWithCurrency","isLoading","regionTypes","suburbTypes","endpoint","uri","http","fetch","method","result","ok","json","currentValue","regionSuburb","regionFound","x","externalSystemRegionName","_selectedRegion","getSuburbTypes","externalSystemRegionId","foundSuburb","externalSystemSuburbName","_selectedSuburb","regionTypeChanged","suburbTypeChanged","q","DropdownWithDropdown","Dropdown"],"sourceRoot":""}