{"version":3,"file":"app-99a89f9b.d152cf98c45d962fa693.bundle.js","mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAcA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAAA;AAxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAgBA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAOA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAGA;;;;;;;;;;;;;AC3PA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sources":["webpack://HRMSPortal/./src/components/performancereview/goalsandcommitments/goalsandcommitments.js","webpack://HRMSPortal/./src/components/performancereview/goalsandcommitments/goalsandcommitments.html"],"sourcesContent":["import {inject} from 'aurelia-framework';\r\nimport {JwtService} from '../../../shared/services/jwtservice';\r\nimport {DialogController} from 'aurelia-dialog';\r\nimport {DialogService} from 'aurelia-dialog';\r\nimport {PerformanceMangemantService} from \"../../../shared/services/performancereviewservice\";\r\nimport {config} from \"../../../shared/services/config\";\r\nimport {AchivemetsPopup} from \"../employeeperformacereview/achivemetsPopup/achivemetsPopup\";\r\nimport {Markascompletemodel} from \"../employeeperformacereview/markascompleteconformationpopup/markascompletemodel\";\r\n\r\n@inject(DialogController, JwtService, DialogService, PerformanceMangemantService)\r\nexport class PerformanceReview {\r\n pageSize = config.kra_PazeSize;\r\n topicsPageSize = config.kra_PazeSize;\r\n ViewID = 2;\r\n isOpen = null;\r\n Successmessages = false;\r\n kraCategories = [];\r\n markascompleted = false;\r\n markascompletachivementpopup = false;\r\n kraCategories = [];\r\n selectedDiv = 0;\r\n activeTab = 'tab1';\r\n\r\n performanceClick() {\r\n event.preventDefault();\r\n const parentDiv = event.target.closest('.parent-div');\r\n if (parentDiv) {\r\n parentDiv.classList.toggle('performance-open');\r\n }\r\n }\r\n\r\n activateTab(tab) {\r\n this.activeTab = tab;\r\n }\r\n\r\n constructor(controller, JwtService, DialogService, PerformanceMangemantService) {\r\n this.controller = controller;\r\n this.jwtService = JwtService;\r\n this.empid = this.jwtService.getEmployeeId();\r\n this.dialogService = DialogService;\r\n this.performaceService = PerformanceMangemantService;\r\n }\r\n\r\n activate(approveData) {\r\n this.params = approveData;\r\n this.ActionName = this.params.ActionName,\r\n this.RecordStatusCode = this.params.RecordStatusCode,\r\n this.PeriodID = this.params.PeriodID,\r\n this.KRAPerformanceReviewID = this.params.KRAPerformanceReviewID,\r\n this.ReviewTypeID = this.params.ReviewTypeID,\r\n this.ReviewFromText = this.params.ReviewFromText,\r\n this.ReviewToText = this.params.ReviewToText\r\n }\r\n\r\n attached() {\r\n this.performaceService.KraCategories(this.empid, this.PeriodID, this.ReviewTypeID, this.ViewID)\r\n .then(data => {\r\n this.kraCategories = data.EmployeeCategoryList;\r\n if (this.kraCategories.length > 0) {\r\n const defaultCategory = this.kraCategories[0]; // Change this to the desired category\r\n this.toggleDisplay(defaultCategory);\r\n }\r\n });\r\n this.performaceService.GetReviewHistory(this.empid, this.PeriodID, this.ReviewTypeID)\r\n .then(data => {\r\n this.GetReviewHistory = data;\r\n });\r\n\r\n this.performaceService.GetAdditionalNotesandComments(this.KRAPerformanceReviewID)\r\n .then(data => {\r\n this.additionalcomments = data;\r\n this.Files = this.additionalcomments.map(option => option.DocumentPath);\r\n if (this.additionalcomments.map(option => option.DocumentPath)) {\r\n this.file = this.additionalcomments.map(option => option.DocumentPath);\r\n this.DocumentName = this.additionalcomments.map(option => option.DocumentPath);\r\n }\r\n });\r\n }\r\n\r\n /*activateTab(index) {\r\n this.selectedDiv = index;\r\n this.kraCategories.forEach((category, idx) => {\r\n category.showDiv = (index === idx);\r\n });\r\n }*/\r\n\r\n markAsComplete(event, EmployeeGoalID, MarkAsCompletedIND, category) {\r\n const result = this.dialogService.open({\r\n viewModel: Markascompletemodel,\r\n model: '',\r\n }).whenClosed(response => {\r\n if (response.wasCancelled) {\r\n this.markascompleted = false;\r\n return;\r\n } else {\r\n this.markascompleted = true;\r\n this.markascompletachivementpopup = true;\r\n const checkbox = document.querySelector(`input[name=\"achievement_${MarkAsCompletedIND == true}\"]`);\r\n if (checkbox) {\r\n checkbox.checked = true;\r\n const markascompletedata = {\r\n EmployeeGoalID: EmployeeGoalID,\r\n EmployeeID: this.empid\r\n };\r\n this.performaceService.MarkasCompletedKraCategories(markascompletedata)\r\n .then(data => {\r\n this.performaceService.KraCategories(this.empid, this.PeriodID, this.ReviewTypeID, this.ViewID)\r\n .then(data => {\r\n this.kraCategories = data.EmployeeCategoryList;\r\n const result = this.kraCategories?.find(item => item.EmployeeCategoryID === category.EmployeeCategoryID);\r\n const defaultCategory = result;\r\n this.toggleDisplay(defaultCategory);\r\n });\r\n\r\n\r\n });\r\n }\r\n }\r\n })\r\n }\r\n\r\n AchivemetsPopup(referenceID, Categorys, Goal, MeasurementCriteria, TargetCompletionDateTxt, EmployeeCategoryID, EmployeeGoalID, MarkAsCompletedIND, GoalStatusTxt, category) {\r\n if (this.markascompletachivementpopup == true) {\r\n this.markascompleted = this.markascompleted;\r\n } else {\r\n this.markascompleted = MarkAsCompletedIND;\r\n }\r\n const AchivemetsData = {\r\n ReviewTypeID: this.ReviewTypeID,\r\n ViewID: this.ViewID,\r\n referenceID: referenceID,\r\n Category: Categorys,\r\n KRAtitle: Goal,\r\n MeasurementCriteria: MeasurementCriteria,\r\n TargetCompletionDateTxt: TargetCompletionDateTxt,\r\n EmployeeCategoryID: EmployeeCategoryID,\r\n EmployeeGoalID: EmployeeGoalID,\r\n RecordStatusCode: this.RecordStatusCode,\r\n ReviewFromdate: this.ReviewFromText,\r\n ReviewToText: this.ReviewToText,\r\n MarkasComplete: this.markascompleted,\r\n GoalStatusTxt: GoalStatusTxt,\r\n };\r\n this.dialogService.open({viewModel: AchivemetsPopup, model: AchivemetsData})\r\n .whenClosed((feedback) => {\r\n if (!feedback.wasCancelled) {\r\n this.messages = \"KRA updated successfully.\";\r\n this.Successmessages = true;\r\n setTimeout(() => {\r\n this.messages = null\r\n }, 5000);\r\n this.performaceService.KraCategories(this.empid, this.PeriodID, this.ReviewTypeID, this.ViewID)\r\n .then(data => {\r\n this.kraCategories = data.EmployeeCategoryList;\r\n if (this.kraCategories.length > 0) {\r\n const result = this.kraCategories?.find(item => item.EmployeeCategoryID === category.EmployeeCategoryID);\r\n const defaultCategory = result;\r\n this.toggleDisplay(defaultCategory);\r\n }\r\n });\r\n }\r\n }\r\n )\r\n }\r\n\r\n openFileDialog() {\r\n document.getElementById('attachments').click();\r\n }\r\n\r\n handleFileSelect(files) {\r\n const file = files[0];\r\n const maxSize = 2.5 * 1024 * 1024;\r\n if (file.size > maxSize) {\r\n this.fileMessage = 'File size should be less than 2.5 MB.';\r\n setTimeout(() => {\r\n this.fileMessage = null;\r\n }, 4000);\r\n this.removeFile();\r\n return;\r\n }\r\n else if (file.size <= maxSize) {\r\n this.files = file;\r\n let reader = new FileReader();\r\n reader.readAsDataURL(file);\r\n this.DocumentNames = file.name;\r\n reader.onload = () => {\r\n this.files = reader.result;\r\n };\r\n }\r\n }\r\n\r\n removeFile() {\r\n this.files = null;\r\n this.DocumentNames = '';\r\n const fileInput = document.getElementById('attachments');\r\n if (fileInput) {\r\n fileInput.value = '';\r\n }\r\n }\r\n\r\n toggleDisplay(category) {\r\n this.kraCategories.forEach(cat => {\r\n if (cat !== category) {\r\n cat.showDiv = false;\r\n }\r\n });\r\n category.showDiv = true;\r\n }\r\n\r\n AcceptRequest() {\r\n if (this.fileMessage) {\r\n return false;\r\n }\r\n let AcceptrequestData = {\r\n EmployeeID: this.empid,\r\n WorkflowComments: this.WorkflowComments,\r\n DocumentPath: this.files,\r\n DocumentName: this.DocumentNames,\r\n KRAPerformanceReviewID: this.KRAPerformanceReviewID,\r\n PeriodID: this.PeriodID,\r\n ReviewTypeID: this.ReviewTypeID,\r\n Actions: \"Accept\"\r\n };\r\n this.performaceService.AcceptKraMyemployee(AcceptrequestData).then(data => {\r\n const datas = {\r\n message: true\r\n };\r\n const queryString = new URLSearchParams(datas).toString();\r\n const performancereviewURL = `/#/KRAPerformanceReview/MyGoalSheet?${queryString}`;\r\n window.location.href = performancereviewURL;\r\n });\r\n }\r\n\r\n openCategory(index) {\r\n this.isOpen = index;\r\n }\r\n\r\n kraClick() {\r\n event.preventDefault();\r\n const clickedDivopen = event.target.closest('div.goalSection > div');\r\n if (clickedDivopen) {\r\n clickedDivopen.classList.toggle('content-open');\r\n }\r\n }\r\n\r\n BackPage() {\r\n const performancereviewURLBackPage = `/#/KRAPerformanceReview/MyGoalSheet`;\r\n window.location.href = performancereviewURLBackPage;\r\n }\r\n\r\n\r\n}\r\n","// Imports\nimport ___HTML_LOADER_GET_SOURCE_FROM_IMPORT___ from \"../../../../node_modules/html-loader/dist/runtime/getUrl.js\";\nvar ___HTML_LOADER_IMPORT_0___ = new URL(\"../../../images/performance-icon.svg\", import.meta.url);\n// Module\nvar ___HTML_LOADER_REPLACEMENT_0___ = ___HTML_LOADER_GET_SOURCE_FROM_IMPORT___(___HTML_LOADER_IMPORT_0___);\nvar code = \"\\r\\n\";\n// Exports\nexport default code;"],"names":[],"sourceRoot":""}