{"version":3,"file":"app-25dc9f7d.d152cf98c45d962fa693.bundle.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAiCA;AAAA;AA/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAmHA;AACA;AACA;AAKA;AACA;AACA;AAAA;AAGA;AACA;AA9HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AAAA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;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;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAgBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;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;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;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;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;ACjZA;AACA;AACA;AACA;AACA;AACA;AAEA;AAQA;AAAA;AANA;AACA;AACA;AACA;AAgEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAAA;AAGA;AACA;AACA;AACA;AAzEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AAkBA;;;;;;;;;;;;;;;;;;;;;;;;AC3FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAaA;AAAA;AAVA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAKA;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;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAEA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AAEA;AAGA;AACA;AAEA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;ACtLA;AAEA;AASA;AAAA;AAPA;AACA;AAEA;AACA;AAoCA;AACA;AACA;AAEA;AACA;AACA;AACA;AAAA;AAGA;AACA;AACA;AACA;AA7CA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAiBA;AAxDA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAkBA;AACA;;AASA;AAAA;AAzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;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;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;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;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAGA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAEA;AACA;AACA;;AAEA;AACA;;AACA;AAEA;AACA;AAEA;AAEA;AAEA;AACA;AACA;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AAEA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;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;AAGA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AACA;AACA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AAEA;AACA;AAIA;AAEA;;;;;;;;;;;;;;ACjmBA;AAAA;AAAA;AACA;AACA;;;;;;;;;;;;;ACFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACPA;AACA;AACA;AACA;;;;;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACjBA;AACA;AACA;AACA;;;;;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACPA;AACA;AACA;AACA","sources":["webpack://HRMSPortal/./src/components/feedbackform/feedbackcomponent.js","webpack://HRMSPortal/./src/components/feedbackform/fetchsavefeedback/saveddatacomponent.js","webpack://HRMSPortal/./src/components/forgotpassword/forgotpasswordcomponent.js","webpack://HRMSPortal/./src/components/hierarchychart/errormodal/errormodal.js","webpack://HRMSPortal/./src/components/hierarchychart/hierarchychartcomponent.js","webpack://HRMSPortal/./src/components/home/homecomponent.js","webpack://HRMSPortal/./src/components/feedbackform/feedbackcomponent.html","webpack://HRMSPortal/./src/components/feedbackform/fetchsavefeedback/saveddatacomponent.html","webpack://HRMSPortal/./src/components/forgotpassword/forgotpasswordcomponent.html","webpack://HRMSPortal/./src/components/hierarchychart/errormodal/errormodal.html","webpack://HRMSPortal/./src/components/hierarchychart/hierarchychartcomponent.html","webpack://HRMSPortal/./src/components/home/homecomponent.html"],"sourcesContent":["import {inject} from 'aurelia-framework';\r\nimport { FeedbackService } from '../../shared/services/feedbackservice';\r\nimport {ValidationControllerFactory, ValidationRules} from 'aurelia-validation';\r\nimport * as tinymce from 'tinymce';\r\nimport {Router} from 'aurelia-router';\r\nimport { App } from '../../app';\r\nimport {DialogService} from 'aurelia-dialog';\r\nimport {SavedDataComponent} from \"./fetchsavefeedback/saveddatacomponent\";\r\nimport {LoginService} from \"../../shared/services/loginservice\";\r\nimport {JwtService} from \"../../shared/services/jwtservice\";\r\n\r\n@inject(FeedbackService, ValidationControllerFactory,DialogService, Router, App,LoginService,JwtService)\r\nexport class FeedbackComponent {\r\n options = [];\r\n selected = {};\r\n searchText = '';\r\n selectAll = true;\r\n departments = [];\r\n errors = null;\r\n routerView = \"main-content\";\r\n selectedSentoEmployees = [];\r\n SelectedSendtoEmployeesIDs = [];\r\n EmployeeListIDs = [];\r\n showPopup = false;\r\n showDropdown = false;\r\n selectedEmployees = '';\r\n showEmpDropdown = false;\r\n selectedOption = '1';\r\n employeeOrDepartment = '1';\r\n employeeType;\r\n selectedOptionLabel = \"Feedback\";\r\n FeedbackLabel = \"Feedback\";\r\n GrievanceLabel = \"Grievance\";\r\n feedbackValue = \"\";\r\n grievanceValue = \"\";\r\n formType = '';\r\n emails = '';\r\n emailsErrors = null;\r\n selectedFormType = 1;\r\n editor;\r\n commentsMessage;\r\n fileMessage;\r\n pageSize = 10;\r\n isFormSubmitted = false;\r\n constructor(feedbackservice, controllerFactory, dialogService, router, App,loginservice,JwtService) {\r\n this.feedbackservice = feedbackservice;\r\n this.controller = controllerFactory.createForCurrentScope();\r\n this.searchQuery = '';\r\n this.dropdownOptions = [];\r\n this.selectedEmployees = [];\r\n this.selectedSentoEmployees = [];\r\n this.selectedEmployee = null;\r\n this.filterEmpOption = '';\r\n this.dialogService = dialogService;\r\n this.router = router;\r\n this.app = App;\r\n this.loginservice = loginservice;\r\n this.jwtService = JwtService;\r\n document.addEventListener('click', this.handleClickOutsideDropdown);\r\n ValidationRules\r\n .ensure('title').required().withMessage(\"Subject is required\")\r\n .maxLength(100)\r\n .withMessage('Subject should be less than 100 characters.')\r\n // .ensure('selectedOptions').required().withMessage(\"Send to filed is required\")\r\n .ensure('emails')\r\n .satisfies((value) => {\r\n if (value && value.trim() !== '') {\r\n const emails = value.split(',');\r\n const emailRegex = /^[^\\s@]+@[^\\s@]+\\.(com|co|in|org|cc|net)$/;\r\n const invalidEmails = [];\r\n for (const email of emails) {\r\n const trimmedEmail = email.trim();\r\n if (!emailRegex.test(trimmedEmail)) {\r\n invalidEmails.push(trimmedEmail);\r\n }\r\n }\r\n if (invalidEmails.length > 0 || (emails.length > 1 && value.indexOf(',') === -1)) {\r\n this.emailsErrors = ['Invalid email address and Email(s) should be separated by commas'];\r\n return false;\r\n }\r\n }\r\n this.emailsErrors = [];\r\n return true;\r\n }).withMessage('Invalid email address(es) and Email(s) should be separated by commas')\r\n .on(this);\r\n }\r\n attached() {\r\n\r\n tinymce.init({\r\n selector: '#comments',\r\n toolbar: 'undo redo | blocks fontfamily fontsize | bold italic underline strikethrough | link image media table mergetags | addcomment showcomments | spellcheckdialog a11ycheck typography | align lineheight | checklist numlist bullist indent outdent | emoticons charmap | removeformat',\r\n setup: editor => {\r\n editor.on('init', () => {\r\n this.editor = editor;\r\n this.editorContent = '';\r\n });\r\n editor.on('change', () => {\r\n this.editorContent = editor.getContent();\r\n this.commentsMessage = null;\r\n });\r\n },\r\n });\r\n this.app.updatePropertyValue(false);\r\n document.querySelector('router-view').classList.remove(this.routerView);\r\n const fileInput = document.querySelector('input[type=\"file\"]');\r\n const allowedTypes = ['image/jpeg', 'image/png', 'application/msword', 'application/pdf'];\r\n fileInput.addEventListener('change', (event) => {\r\n const file = event.target.files[0];\r\n const fileType = file.type;\r\n if (!allowedTypes.includes(fileType)) {\r\n this.fileMessage = \"Only JPEG, PNG, PDF and DOC files are allowed.\";\r\n } else {\r\n this.fileMessage = null;\r\n\r\n }\r\n }, {\r\n passive: true\r\n });\r\n return this.feedbackservice.SendtoEmployeesName()\r\n .then(data => {\r\n this.options = data;\r\n });\r\n }\r\n get filteredOptions() {\r\n const filtered = this.options.filter(option =>\r\n option.EmployeeName.toLowerCase().includes(this.searchText.toLowerCase())\r\n );\r\n if (filtered.length === 0 && this.searchText.trim().length > 0) {\r\n const errorInfo = {\r\n error: {\r\n message: \"No records found\"\r\n }\r\n };\r\n this.searchTextError = [errorInfo];\r\n } else {\r\n this.searchTextError = [];\r\n }\r\n return filtered;\r\n }\r\n updateLabels(id) {\r\n const selectedRadio = document.querySelector('input[name=\"options\"]:checked');\r\n let selectedOption = selectedRadio.value;\r\n let formType = selectedOption;\r\n this.selectedFormType = id;\r\n if (selectedOption === \"1\") {\r\n this.selectedOptionLabel = \"feedback\";\r\n this.FeedbackLabel = \"Feedback\";\r\n this.GrievanceLabel = \"Feedback\";\r\n } else if (selectedOption === \"2\") {\r\n this.selectedOptionLabel = \"Grievance\";\r\n this.FeedbackLabel = \"Grievance\";\r\n this.GrievanceLabel = \"Grievance\";\r\n }\r\n }\r\n toggleDropdown() {\r\n this.showDropdown = !this.showDropdown;\r\n }\r\n handleClickOutsideDropdown = (event) => {\r\n const dropdownElement = document.querySelector('.dropdown-menu');\r\n const buttonElement = document.querySelector('.sendto');\r\n if (\r\n dropdownElement &&\r\n !dropdownElement.contains(event.target) &&\r\n !buttonElement.contains(event.target)\r\n ) {\r\n this.closeDropdown();\r\n }\r\n };\r\n\r\n closeDropdown = () => {\r\n this.showDropdown = false;\r\n };\r\n selectOption(checked, option) {\r\n this.selected[option.EmployeeID] = checked;\r\n this.selectedOptions = this.options.filter(option => this.selected[option.EmployeeID]);\r\n if (checked) {\r\n this.SendToEmployeeSelectedIds = option.EmployeeID;\r\n this.SelectedSendtoEmployeesIDs.push(this.SendToEmployeeSelectedIds);\r\n this.selectedSentoEmployees.push(option.EmployeeName);\r\n } else {\r\n const index = this.SelectedSendtoEmployeesIDs.indexOf(option.EmployeeID);\r\n if (index > -1) {\r\n this.SelectedSendtoEmployeesIDs.splice(index, 1);\r\n }\r\n const nameIndex = this.selectedSentoEmployees.indexOf(option.EmployeeName);\r\n if (nameIndex > -1) {\r\n this.selectedSentoEmployees.splice(nameIndex, 1);\r\n }\r\n }\r\n }\r\n isSelected(option) {\r\n return this.selected[option];\r\n }\r\n selectAllOptions() {\r\n Object.keys(this.selected).forEach(option => this.selected[option] = this.selectAll);\r\n this.selectedSentoEmployees = this.options.map(option => option.EmployeeName);\r\n if (this.selectAll) {\r\n this.selectedSentoEmployees = this.options.map(option => option.EmployeeName);\r\n } else {\r\n this.selectedSentoEmployees = [];\r\n }\r\n this.selectedOptions = this.options.filter(option => this.selected[option.EmployeeID]);\r\n this.selectAll = !this.selectAll;\r\n }\r\n async onEmployeeSelected() {\r\n this.employeeOrDepartment = '1';\r\n this.employeeType = 1;\r\n if (this.searchQuery) {\r\n this.showEmpDropdown = true;\r\n try {\r\n const response = await this.feedbackservice.EmployeeNamesForDropdown(this.searchQuery);\r\n const data = await response;\r\n const filterOption = this.searchQuery.toLowerCase();\r\n this.dropdownOptions = data.filter(option => option.EmployeeName.toLowerCase().includes(filterOption));\r\n if (this.dropdownOptions.length === 0) {\r\n const errorInfo = {\r\n error: {\r\n message: \"No records found\"\r\n }\r\n };\r\n this.searchQueryError = [errorInfo];\r\n } else {\r\n this.searchQueryError = [];\r\n }\r\n } catch (error) {\r\n console.error(error);\r\n }\r\n } else {\r\n this.showEmpDropdown = false;\r\n this.dropdownOptions = [];\r\n }\r\n }\r\n\r\n selectEmployee(EmpOption) {\r\n const modifiedOption = {\r\n ...EmpOption,\r\n ID: EmpOption.EmployeeID\r\n };\r\n this.searchQuery = modifiedOption.EmployeeName;\r\n this.showEmpDropdown = false;\r\n this.selectedEmployee = modifiedOption;\r\n return false;\r\n }\r\n addToSelectedOptions(id) {\r\n if (!this.searchQuery) {\r\n const errorInfo = {\r\n error: {\r\n message: \"Please select an employee\"\r\n }\r\n };\r\n this.searchQueryError = [errorInfo];\r\n return;\r\n }\r\n this.feedbackservice.GetEmployeesForAdd(id).then(data => {\r\n const selectedEmployee = this.selectedEmployees.find(employee => employee.EmployeeID === data.EmployeeID);\r\n if (selectedEmployee) {\r\n const errorInfo = {\r\n error: {\r\n message: \"Employee name already exists\"\r\n }\r\n };\r\n this.searchQueryError = [errorInfo];\r\n } else {\r\n this.searchQueryError = [];\r\n this.Ids = data.EmployeeID;\r\n this.EmployeeListIDs.push(this.Ids);\r\n this.selectedEmployees.push(data);\r\n this.searchQuery = '';\r\n }\r\n });\r\n }\r\n GetEmployeeNamesForGrid(id) {\r\n this.feedbackservice.GetEmployeesForAdd(id)\r\n .then(data => {\r\n this.selectedEmployees.push(data);\r\n });\r\n }\r\n deleteEmployee(emp) {\r\n const index = this.selectedEmployees.indexOf(emp);\r\n if (index !== -1) {\r\n this.selectedEmployees.splice(index, 1);\r\n }\r\n const deletedIds = emp.EmployeeID;\r\n this.EmployeeListIDs = this.EmployeeListIDs.filter(id => id !== deletedIds);\r\n this.Ids = this.EmployeeListIDs;\r\n }\r\n onDepartmentSelected() {\r\n this.employeeOrDepartment = '2';\r\n this.employeeType = 2;\r\n return this.feedbackservice.DepartmentsForDropdown()\r\n .then(response => {\r\n this.departments = response;\r\n return false;\r\n });\r\n }\r\n handleFileSelect(files) {\r\n const file = files[0];\r\n this.file = file;\r\n let reader = new FileReader();\r\n reader.readAsDataURL(file);\r\n this.DocumentName = file.name;\r\n reader.onload = () => {\r\n this.file = reader.result;\r\n };\r\n }\r\n openFileDialog() {\r\n document.getElementById('attachments').click();\r\n }\r\n removeFile() {\r\n this.file = null;\r\n this.DocumentName = '';\r\n const fileInput = document.getElementById('attachments');\r\n if (fileInput) {\r\n fileInput.value = '';\r\n }\r\n }\r\n submitForm() {\r\n event.preventDefault();\r\n if (this.fileMessage) {\r\n return false;\r\n }\r\n this.errors = null;\r\n this.controller.validate()\r\n .then(result => {\r\n if (result.valid) {\r\n if (this.editorContent === '') {\r\n this.commentsMessage = \"Feedback/grievance field is required.\";\r\n return false;\r\n }\r\n let feedbackData = {\r\n FeedbackorGrievance: this.title,\r\n Comments: this.editorContent,\r\n DocumentPath: this.file,\r\n DepartmentID: this.selectedDepartment,\r\n EmployeeType: this.employeeType,\r\n Employeelist: this.EmployeeListIDs,\r\n SendToList: this.SelectedSendtoEmployeesIDs,\r\n EmployeeEmailIds: this.emails,\r\n Type: this.selectedFormType,\r\n DocumentName: this.DocumentName,\r\n };\r\n this.isFormSubmitted = true;\r\n this.feedbackservice.SaveFeedBack(feedbackData).then((response) => {\r\n this.GrievanceID = response;\r\n this.feedbackservice.ViewFeedbackData(this.GrievanceID)\r\n .then(data => {\r\n this.viewdata = data;\r\n this.openDialogBox(this.viewdata );\r\n });\r\n this.selectedOptionLabel = '';\r\n this.title = '';\r\n this.DocumentName = '';\r\n this.selectedOptions = '';\r\n this.SendToEmployeeSelectedIds = '';\r\n this.selectedSentoEmployees = '';\r\n this.searchQuery = '';\r\n this.selected = {};\r\n this.editorContent = '';\r\n this.department = '';\r\n this.selectedDepartment = null;\r\n\r\n this.emails = '';\r\n const fileInput = document.querySelector('input[type=file]');\r\n if (fileInput) {\r\n fileInput.value = '';\r\n }\r\n if (this.editor) {\r\n this.editor.setContent('');\r\n this.editor = null;\r\n }\r\n this.editorContent = '';\r\n this.selectedEmployees = [];\r\n this.isFormSubmitted = false;\r\n setTimeout(() => {\r\n this.message = null\r\n }, 3000);\r\n this.showPopup = true;\r\n });\r\n } else {\r\n this.errors = \"Invalid credentials\";\r\n }\r\n })\r\n .catch(promise => {\r\n promise.then(err => this.errors = err.errors)\r\n });\r\n }\r\n openDialogBox(data) {\r\n this.dialogService.open({\r\n title: 'Saved Data',\r\n viewModel: SavedDataComponent,\r\n model: data,\r\n }).then(dialogResult => {\r\n });\r\n }\r\n detached() {\r\n tinymce.remove(this.editor);\r\n document.removeEventListener('click', this.handleClickOutsideDropdown);\r\n }\r\n cancle() {\r\n this.router.navigateToRoute('login');\r\n }\r\n}\r\n","import {inject } from 'aurelia-framework';\r\nimport { FeedbackService } from '../../../shared/services/feedbackservice';\r\nimport {Router} from 'aurelia-router';\r\nimport {App} from \"../../../app\";\r\nimport {DialogController} from \"aurelia-dialog\";\r\nimport {config} from \"../../../shared/services/config\";\r\n\r\n@inject(DialogController,FeedbackService, Router, App)\r\nexport class SavedDataComponent {\r\n SendToList = \"\";\r\n URL=config.img_url;\r\n isDragging = false;\r\n dialog;\r\n static inject = [Element];\r\n\r\n constructor(controller,feedbackservice,router,App) {\r\n this.controller = controller;\r\n this.feedbackservice = feedbackservice;\r\n this.router = router;\r\n this.app = App;\r\n this.router = router;\r\n }\r\n activate(model) {\r\n const viewdata = model;\r\n this.TypeName = viewdata.TypeName;\r\n this.RaisedBy = viewdata.RaisedBy;\r\n this.FileName = viewdata.DocumentName;\r\n this.EmployeeEmailIds = viewdata.EmployeeEmailIds;\r\n this.EmployeeNames = viewdata.EmployeeNames;\r\n if (typeof viewdata.EmployeeNames === 'string') {\r\n this.EmployeeNames = viewdata.EmployeeNames.replace(/^,\\s*/, '');\r\n } else {\r\n this.EmployeeNames = viewdata.EmployeeNames;\r\n }\r\n this.EmployeeType = viewdata.EmployeeType;\r\n this.Employeelist = viewdata.Employeelist;\r\n this.FeedbackorGrievance = viewdata.FeedbackorGrievance;\r\n this.SendToList = viewdata.SendToList;\r\n if (typeof viewdata.SendToNames === 'string') {\r\n this.SendToNames = viewdata.SendToNames.replace(/^,\\s*/, '');\r\n console.log(this.SendToNames);\r\n } else {\r\n this.SendToNames = viewdata.SendToNames;\r\n }\r\n this.Comments = viewdata.Comments;\r\n this.DepartmentName = viewdata.DepartmentName;\r\n this.Files = viewdata.DocumentPath;\r\n if (viewdata.DocumentPath) {\r\n this.file = viewdata.DocumentPath;\r\n this.DocumentName = viewdata.DocumentPath;\r\n }\r\n }\r\n downloadFile() {\r\n const downloadUrl = this.URL + this.Files;\r\n const link = document.createElement('a');\r\n link.href = downloadUrl;\r\n link.target = '_blank';\r\n link.download = downloadUrl;\r\n link.click();\r\n }\r\n cancle() {\r\n this.controller.cancel();\r\n this.router.navigateToRoute(\"login\").replace(\"/\",\"\").replace(\"#\",\"\");\r\n }\r\n startDragging(event) {\r\n if (event.button === 0) {\r\n this.isDragging = true;\r\n this.offsetX = event.clientX - this.dialogElement.getBoundingClientRect().left;\r\n this.offsetY = event.clientY - this.dialogElement.getBoundingClientRect().top;\r\n\r\n window.addEventListener('mousemove', this.drag);\r\n window.addEventListener('mouseup', this.stopDragging);\r\n }\r\n }\r\n\r\n drag = (event) => {\r\n if (this.isDragging) {\r\n const x = event.clientX - this.offsetX;\r\n const y = event.clientY - this.offsetY;\r\n\r\n this.dialogElement.style.left = `${x}px`;\r\n this.dialogElement.style.top = `${y}px`;\r\n }\r\n }\r\n\r\n stopDragging = () => {\r\n this.isDragging = false;\r\n window.removeEventListener('mousemove', this.drag);\r\n window.removeEventListener('mouseup', this.stopDragging);\r\n }\r\n\r\n}\r\n","import {inject } from 'aurelia-framework';\r\nimport {HttpClient, json} from 'aurelia-fetch-client';\r\nimport {Router,activationStrategy} from 'aurelia-router';\r\nimport {ValidationControllerFactory, ValidationRules} from 'aurelia-validation';\r\nimport {LoginService} from '../../shared/services/loginservice';\r\nimport {SharedState} from '../../shared/state/sharedstate';\r\nimport {config} from '../../shared/services/config';\r\nimport {JwtService} from \"../../shared/services/jwtservice\";\r\nimport { App } from '../../app';\r\n@inject(LoginService, SharedState, Router, ValidationControllerFactory,HttpClient,JwtService,App)\r\nexport class ForgotComponent {\r\n \r\n type = '';\r\n errors = null;\r\n username = '';\r\n emailId = '';\r\n emailMessage=null;\r\n usernameMessage=null;\r\n forgotpassword={name:'forgotpassword'};\r\n forgotPasswordMatch = (a, b) => a.name === b.name;\r\n routerView = \"main-content\";\r\n \r\n constructor(loginService, sharedState, router, controllerFactory,httpClient,JwtService,App) {\r\n this.loginService = loginService;\r\n this.sharedState = sharedState;\r\n this.router = router;\r\n this.httpClient = httpClient;\r\n this.controller = controllerFactory.createForCurrentScope();\r\n this.jwtService = JwtService;\r\n this.app=App;\r\n\r\n ValidationRules\r\n .ensure('username').required()\r\n .ensure('emailId').email().required().withMessage('Email is required.')\r\n .on(this);\r\n \r\n }\r\n\r\n attached(){\r\n document.querySelector('router-view').classList.remove(this.routerView);\r\n this.app.updatePropertyValue(false);\r\n this.loginService.bindImages().then(data=>{\r\n this.imageSlider = data;\r\n this.bannerUrl=config.img_url;\r\n });\r\n let i =1;\r\n setTimeout(()=>{\r\n let image=document.querySelectorAll(\".banner-image\");\r\n image[0].style.opacity='1';\r\n setInterval(function () {\r\n image.forEach((img,i)=>{\r\n img.style.opacity='0';\r\n });\r\n if(i === image.length){\r\n i=0;\r\n }\r\n console.log(image[i]);\r\n image[i].style.opacity='1';\r\n i++;\r\n },5000);\r\n },200)\r\n\r\n // static slider css remove when banner images dynamic //\r\n const images = document.querySelectorAll('.banner-image img');\r\n let currentIndex = 0;\r\n\r\n function fadeInImage(index) {\r\n images[index].classList.add('active');\r\n }\r\n\r\n function fadeOutImage(index) {\r\n images[index].classList.remove('active');\r\n }\r\n\r\n function nextImage() {\r\n fadeOutImage(currentIndex);\r\n currentIndex = (currentIndex + 1) % images.length;\r\n fadeInImage(currentIndex);\r\n }\r\n\r\n setInterval(nextImage, 3000); // Change image every 3 seconds\r\n fadeInImage(currentIndex); // Initial fade in\r\n // static slider css remove when banner images dynamic //\r\n \r\n } \r\n\r\n determineActivationStrategy() {\r\n return activationStrategy.replace;\r\n }\r\n \r\n activate(params, routeConfig) {\r\n this.type = routeConfig.name;\r\n }\r\n \r\n submit()\r\n {\r\n this.errors = null;\r\n this.controller.validate()\r\n .then(result => {\r\n if (result.valid) {\r\n \r\n let forgotPassword=this.forgotpassword;\r\n let forgot ;\r\n if (forgotPassword.name ==='forgotpassword'){\r\n forgot = {\r\n \"UserName\": this.username, \r\n };\r\n }else if(forgotPassword.name ==='forgotusername'){\r\n forgot = {\r\n \"EmailID\": this.emailId,\r\n \r\n };\r\n }else{\r\n forgot = {\r\n \"EmailID\": this.emailId, \r\n };\r\n }\r\n\r\n this.loginService.NeedHelp(this.type,forgot)\r\n .then(data => \r\n {\r\n \r\n if(data.EmployeeID > 0){\r\n this.router.navigateToRoute('forgotpassword')\r\n console.log(this.forgotpassword);\r\n let forgotPassword=this.forgotpassword;\r\n let forgot1 ;\r\n if (forgotPassword.name ==='forgotpassword'){\r\n forgot1 = { \r\n \"Message\": this.usernameMessage='Password has been sent to your registered email.', \r\n };\r\n }\r\n else if(forgotPassword.name ==='forgotusername'){\r\n forgot1 = {\r\n \"Message\": this.emailMessage='Username is sent to your email address.',\r\n };\r\n }\r\n else{\r\n forgot1 = { \r\n \"Message\": this.usernameMessage=null \r\n };\r\n }\r\n \r\n } \r\n else{\r\n // this.controller.addError(\"Invalid details\"); \r\n this.errors='Invalid details'; \r\n this.usernameMessage=null;\r\n this.emailMessage=null;\r\n } \r\n \r\n }\r\n )\r\n .catch(promise => {\r\n promise.then(err => this.errors = err.errors)\r\n }); \r\n \r\n }\r\n })\r\n }\r\n\r\n \r\n usernameClicked() {\r\n this.emailMessage=null;\r\n this.errors=null;\r\n return true;\r\n }\r\n emailClicked() {\r\n this.usernameMessage=null;\r\n this.errors=null;\r\n return true;\r\n }\r\n // textbox1Clicked()\r\n // {\r\n // this.emailMessage=null;\r\n // return true;\r\n // }\r\n // textbox2Clicked()\r\n // {\r\n // this.usernameMessage=null;\r\n // return true;\r\n // }\r\n }\r\n\r\n \r\n \r\n","import { DialogController } from 'aurelia-dialog';\r\n\r\nexport class Errormodal {\r\n static inject = [DialogController,Element];\r\n manager = true;\r\n employee = false;\r\n \r\n isDragging = false;\r\n dialog;\r\n\r\n\r\n constructor(dialogController) {\r\n this.dialogController = dialogController;\r\n this.message = \"Are You Sure Want To Delete Record?\";\r\n\r\n }\r\n\r\n activate(data) {\r\n console.log(data);\r\n if(data === \"1\"){\r\n this.manager = false;\r\n this.employee = true;\r\n }\r\n }\r\n\r\n cancel() {\r\n this.dialogController.cancel();\r\n }\r\n\r\n ok() {\r\n this.dialogController.ok();\r\n }\r\n startDragging(event) {\r\n if (event.button === 0) {\r\n this.isDragging = true;\r\n this.offsetX = event.clientX - this.dialogElement.getBoundingClientRect().left;\r\n this.offsetY = event.clientY - this.dialogElement.getBoundingClientRect().top;\r\n\r\n window.addEventListener('mousemove', this.drag);\r\n window.addEventListener('mouseup', this.stopDragging);\r\n }\r\n }\r\n\r\n drag = (event) => {\r\n if (this.isDragging) {\r\n const x = event.clientX - this.offsetX;\r\n const y = event.clientY - this.offsetY;\r\n\r\n this.dialogElement.style.left = `${x}px`;\r\n this.dialogElement.style.top = `${y}px`;\r\n }\r\n }\r\n\r\n stopDragging = () => {\r\n this.isDragging = false;\r\n window.removeEventListener('mousemove', this.drag);\r\n window.removeEventListener('mouseup', this.stopDragging);\r\n }\r\n}\r\n","import { OrganizationService } from \"../../shared/services/organizationservice\";\r\nimport {inject} from 'aurelia-framework';\r\nimport { DialogController } from 'aurelia-dialog';\r\nimport {DialogService} from 'aurelia-dialog';\r\nimport {LeavemanagementService} from \"../../shared/services/leavemanagementservice\";\r\nimport jsPDF from 'jspdf';\r\nimport html2pdf from 'html2pdf.js';\r\nimport {ValidationControllerFactory, ValidationRules} from 'aurelia-validation';\r\nimport { Errormodal } from \"./errormodal/errormodal\";\r\nimport {LoginService} from \"../../shared/services/loginservice\";\r\nimport {JwtService} from \"../../shared/services/jwtservice\";\r\nimport {Router} from 'aurelia-router';\r\nimport { HttpClient } from 'aurelia-fetch-client';\r\nimport { constants } from \"../../shared/services/constants\";\r\n\r\n@inject(OrganizationService,DialogController,ValidationControllerFactory,DialogService,LoginService,JwtService,LeavemanagementService,Router,Element)\r\nexport class Hierarchychartcomponent {\r\n\r\n employeeOrDepartment = 'employee';\r\n showEmpDropdown = true;\r\n view='directReport';\r\n showTree = false;\r\n showDirect = true;\r\n showRM = true;\r\n treeChart = [];\r\n managerChild = [];\r\n ManagerId = '';\r\n employeeChildTree = [];\r\n filteredResults = [];\r\n employeeTree = [];\r\n searchTerm = '';\r\n showDropdown = false;\r\n isFirstSelection = true;\r\n manager = \"manager\"; // Default value for the \"Manager\" radio button\r\n employee = \"employee\"; // Default value for the \"Employee\" radio button\r\n manageView = true;\r\n employeeView = false;\r\n searchlabel = \"Reporting Manager\";\r\n selectedView = null;\r\n showPrint = false;\r\n SiteMapId=constants.hierarchychartSiteMapID;\r\n\r\n\r\n constructor(OrganizationService,DialogController,ValidationControllerFactory,DialogService,loginservice,JwtService,LeavemanagementService,router,element) {\r\n this.organizationService = OrganizationService;\r\n this.controller = DialogController;\r\n this.controllerFactory = ValidationControllerFactory;\r\n this.dialogService = DialogService;\r\n this.leavemanagementService = LeavemanagementService;\r\n this.element = element;\r\n this.dropdownOptions = [];\r\n this.managerTree = [];\r\n this.managerResources = [];\r\n this.resourceEmpIds = [];\r\n this.resourceData = [];\r\n this.selectedEmployee = null;\r\n this.clicked = false;\r\n this.jwtService = JwtService;\r\n this.loginservice = loginservice;\r\n this.router = router;\r\n this.httpClient = new HttpClient();\r\n this.empid = this.jwtService.getEmployeeId();\r\n ValidationRules\r\n .ensure('searchManager').required().withMessage('Reporting manager is required')\r\n }\r\n\r\n getCurrentRouteURL() {\r\n const currentInstruction = this.router.currentInstruction;\r\n if (currentInstruction) {\r\n const routeURL = currentInstruction.fragment;\r\n const sidebarListItem = document.querySelector('.sidebar ul li.organization');\r\n if (sidebarListItem) {\r\n const subActiveItems = document.querySelectorAll('.sidebar ul li.sub-active');\r\n subActiveItems.forEach(item => item.classList.remove('sub-active'));\r\n const activeLinkItems = document.querySelectorAll('.sidebar ul li.active-link');\r\n activeLinkItems.forEach(item => item.classList.remove('active-link'));\r\n sidebarListItem.classList.add('sub-active');\r\n }\r\n const sidebarLink = document.querySelector('.sidebar ul li.organization .sidebar-sub .hierarcyChart a');\r\n if (sidebarLink) {\r\n sidebarLink.classList.add('active-link');\r\n }\r\n return routeURL;\r\n }\r\n return '';\r\n }\r\n\r\n async attached() {\r\n this.getCurrentRouteURL();\r\n // if(this.jwtService.getToken() === undefined){\r\n // this.loginservice.purgeAuth();\r\n // this.router.navigateToRoute('login')\r\n // }\r\n this.allEmployees = await this.organizationService.GetEmployeemasterDetails();\r\n this.reportingManagerHierarchy = await this.organizationService.GetManagerHierarchy();\r\n this.managerHierarchy = this.reportingManagerHierarchy.RepList;\r\n this.managerdropdown = await this.organizationService.GetReportingManagersearch();\r\n this.addToRecentItems();\r\n }\r\n\r\n onEmployeeSelected() {\r\n this.employeeOrDepartment = 'employee';\r\n this.employeeTree = [];\r\n this.managerTree = [];\r\n const element = document.querySelector('.popup');\r\n this.clicked=false;\r\n this.showTree = false;\r\n\r\n if (element) {\r\n while (element?.classList.length > 0) {\r\n element?.classList.remove(element?.classList[0]);\r\n }\r\n }\r\n document.getElementById('popup').classList.remove(\"toogleEmployee\");\r\n }\r\n \r\n onDepartmentSelected() {\r\n this.employeeOrDepartment = 'department';\r\n this.showTree = false;\r\n this.showPrint = false;\r\n this.searchTerm = '';\r\n this.viewType=null;\r\n this.view= 'directReport';\r\n this.searchManager=null;\r\n this.managerTree = [];\r\n this.childEmployees=[]\r\n document.getElementById('popup').classList.add(\"toogleEmployee\");\r\n document.getElementById('popup').classList.remove(\"directReport\");\r\n document.getElementById('popup').classList.remove(\"managerHierarchy\");\r\n }\r\n\r\n // const result = await this.dialogService.open({\r\n // viewModel: AlertpopupComponent,\r\n // model: \"\",\r\n // }).whenClosed(response => response);\r\n // if (result.wasCancelled) {\r\n // return;\r\n // }\r\n \r\n async managerSearch(){\r\n if (this.searchManager) {\r\n this.showEmpDropdown = true;\r\n try {\r\n const filterOption = this.searchManager.toLowerCase();\r\n this.dropdownOptions = this.managerdropdown.filter(option => option.EmployeeName.toLowerCase().includes(filterOption));\r\n } catch (error) {\r\n //console.error(error);\r\n }\r\n } else {\r\n this.showEmpDropdown = false;\r\n this.dropdownOptions = [];\r\n }\r\n }\r\n \r\n selectManager(EmpOption) {\r\n const modifiedOption = { ...EmpOption, ID: EmpOption.EmployeeID };\r\n this.ManagerId = EmpOption.EmployeeID; \r\n this.searchManager = modifiedOption.EmployeeName; \r\n this.showEmpDropdown = false;\r\n this.ManagerError = '';\r\n this.selectedEmployee = modifiedOption;\r\n } \r\n\r\n async managergenerate(view, employeeId) {\r\n if (this.searchManager == undefined || this.searchManager == '') {\r\n this.ManagerError = 'Reporting manager is required.';\r\n return;\r\n }\r\n \r\n if (this.dropdownOptions.length < 1) {\r\n const result = await this.dialogService.open({\r\n viewModel: Errormodal,\r\n model: \"\",\r\n }).whenClosed(response => response);\r\n \r\n if (result.wasCancelled) {\r\n this.searchManager = '';\r\n return;\r\n }\r\n }\r\n \r\n this.showTree = true;\r\n this.showPrint = true;\r\n this.viewType = view;\r\n this.ManagerError = '';\r\n document.getElementById('list-container').classList.remove(\"toogleManager\");\r\n \r\n if (view === 'directReport') {\r\n this.filteredItems = [];\r\n this.managerTree = this.allEmployees.filter(option => option.ReportingManagerID === this.ManagerId);\r\n this.employeegenerate();\r\n } else if (view === 'managerHierarchy') {\r\n this.managerTree = [];\r\n this.employeegenerate();\r\n // this.filteredItems = this.allEmployees.filter(item => item.ReportingManagerID === this.ManagerId);\r\n this.filteredItems = this.managerHierarchy.filter(item => item.ReportingManagerID === this.ManagerId);\r\n // Create the initial list element\r\n const list = document.createElement('ul');\r\n // Create and add the list items based on the API data\r\n this.filteredItems.forEach(itemData => {\r\n const item = document.createElement('li');\r\n const contentDiv = document.createElement('div');\r\n contentDiv.className = 'profile-container'; // You can add a CSS class for styling if needed\r\n // Check if the item's RepList has a length greater than 0\r\n if (itemData.RepList && itemData.RepList.length > 0) {\r\n const arrowSpan = document.createElement('span');\r\n arrowSpan.classList.add('arrow-icon'); // You can define a CSS class for the arrow icon\r\n contentDiv.appendChild(arrowSpan);\r\n }\r\n const image = document.createElement('img');\r\n image.src = itemData.PhotoPath;\r\n image.alt = itemData.EmployeeName;\r\n image.width = '20';\r\n image.height = '20';\r\n contentDiv.appendChild(image);\r\n const name = document.createTextNode(itemData.EmployeeName);\r\n contentDiv.appendChild(name);\r\n item.appendChild(contentDiv);\r\n contentDiv.addEventListener('click', () => {\r\n item.classList.toggle('ui-state-active');\r\n const clickedEmployee = item.textContent;\r\n // Check if the clicked item has a different ID than the current list\r\n const filteredID = this.allEmployees.filter(item => item.EmployeeName === clickedEmployee); \r\n //const filteredID = this.managerHierarchy.filter(item => item.EmployeeName === clickedEmployee);\r\n try {\r\n const EmpID = filteredID[0].EmployeeID;\r\n const currentEmpName = filteredID[0].EmployeeName;\r\n const filtered = { id: EmpID, name: currentEmpName };\r\n this.showChild(filtered);\r\n } catch (error) {\r\n //console.log(error);\r\n }\r\n });\r\n list.appendChild(item);\r\n });\r\n // Update the current list ID and add the new list to the container\r\n const container = document.querySelector('#list-container');\r\n container.innerHTML = '';\r\n container.appendChild(list);\r\n }\r\n }\r\n \r\n\r\n async getImageAsBase64(imageUrl) {\r\n return new Promise((resolve, reject) => {\r\n const xhr = new XMLHttpRequest();\r\n xhr.open('GET', imageUrl, true);\r\n xhr.responseType = 'blob';\r\n\r\n xhr.onload = () => {\r\n if (xhr.status === 200) {\r\n const blob = xhr.response;\r\n const reader = new FileReader();\r\n reader.onload = () => {\r\n const base64data = reader.result;\r\n resolve(base64data);\r\n };\r\n reader.readAsDataURL(blob);\r\n } else {\r\n reject(new Error('Image load error'));\r\n }\r\n };\r\n\r\n xhr.send();\r\n });\r\n }\r\n\r\n async employeeGenerateChart() {\r\n if (this.searchTerm == '' || this.searchTerm == undefined) {\r\n this.EmployeeError = \"Employee is required.\";\r\n return;\r\n }\r\n \r\n if (this.filteredResults.length < 1) {\r\n const result = await this.dialogService.open({\r\n viewModel: Errormodal,\r\n model: \"1\",\r\n }).whenClosed(response => response);\r\n if (result.wasCancelled) {\r\n this.searchTerm = '';\r\n return;\r\n }\r\n } else {\r\n this.showPrint = true;\r\n this.clicked = true;\r\n this.employeeTree = [];\r\n this.EmployeeError = '';\r\n //document.getElementById('supervisor-container').classList.add(\"toogleEmployee\");\r\n const employee = this.selectedEmployee;\r\n this.employeeTree.push(employee);\r\n let selectedId = parseInt(employee.ReportingManagerID);\r\n let foundManager = this.allEmployees.find(employee => employee.EmployeeID === selectedId);\r\n while (foundManager) {\r\n this.employeeTree.push(foundManager);\r\n selectedId = parseInt(foundManager.ReportingManagerID);\r\n foundManager = this.allEmployees.find(employee => employee.EmployeeID === selectedId);\r\n }\r\n }\r\n }\r\n \r\n \r\n async showChild(emp) {\r\n //const childTree = this.allEmployees.filter(item => item.ReportingManagerID === emp.id);\r\n const childTree = this.managerHierarchy.filter(item => item.ReportingManagerID === emp.id);\r\n console.log(childTree);\r\n // Create a new nested list element\r\n const nestedList = document.createElement('ul');\r\n // Create and add the list items based on the API data\r\n childTree.forEach(itemData => {\r\n const item = document.createElement('li');\r\n const contentDiv = document.createElement('div');\r\n contentDiv.className = 'profile-container';\r\n // Check if the item's RepList has a length greater than 0\r\n if (itemData.RepList && itemData.RepList.length > 0) {\r\n const arrowSpan = document.createElement('span');\r\n arrowSpan.classList.add('arrow-icon'); // You can define a CSS class for the arrow icon\r\n contentDiv.appendChild(arrowSpan);\r\n }\r\n const image = document.createElement('img');\r\n // image.setAttribute('crossorigin','*');\r\n image.src = itemData.PhotoPath;\r\n image.alt = itemData.EmployeeName;\r\n image.width = '20';\r\n image.height = '20';\r\n contentDiv.appendChild(image);\r\n const name = document.createTextNode(itemData.EmployeeName);\r\n contentDiv.appendChild(name);\r\n item.appendChild(contentDiv);\r\n contentDiv.addEventListener('click', () => {\r\n item.classList.toggle('ui-state-active');\r\n const clickedEmployee = item.textContent;\r\n // Check if the clicked item has a different ID than the current nested list \r\n const filteredID = this.allEmployees.filter(item => item.EmployeeName === clickedEmployee);\r\n //const filteredID = this.managerHierarchy.filter(item => item.EmployeeName === clickedEmployee);\r\n try{\r\n const EmpID = filteredID[0].EmployeeID;\r\n const currentEmpName = filteredID[0].EmployeeName;\r\n const filtered = {id:EmpID,name:currentEmpName};\r\n this.showChild(filtered);\r\n }catch(error){\r\n //console.log(error);\r\n }\r\n });\r\n nestedList.appendChild(item);\r\n });\r\n //} \r\n // Find the clicked list item using its text content\r\n const listItems = document.querySelectorAll('li');\r\n let container;\r\n listItems.forEach(listItem => {\r\n if (listItem.textContent === emp.name) {\r\n container = listItem;\r\n }\r\n });\r\n // Add the new nested list to the clicked list item\r\n container.appendChild(nestedList);\r\n }\r\n \r\n \r\n get reversedEmployees() {\r\n // Create a copy of the original employees array to avoid modifying it directly\r\n const copiedEmployees = [...this.employeeTree];\r\n // Reverse the order of the employees array\r\n const reversedOrder = copiedEmployees.reverse();\r\n return reversedOrder;\r\n }\r\n \r\n isLastElement(index) {\r\n return index === this.employeeTree.length - 1;\r\n }\r\n\r\n async handleSearch() {\r\n if (!this.searchTerm) {\r\n return;\r\n }\r\n this.filteredResults = this.allEmployees.filter(employee =>\r\n employee.EmployeeName.toLowerCase().includes(this.searchTerm.toLowerCase())\r\n );\r\n this.showDropdown = true;\r\n }\r\n \r\n async handleSelection(employee) {\r\n //this.showTree = false;\r\n this.searchTerm = employee.EmployeeName;\r\n this.selectedEmployee = employee;\r\n this.EmployeeError = '';\r\n this.showDropdown = false; // Close the dropdown after selection\r\n }\r\n \r\n closeDropdown() {\r\n this.showDropdown = false; // Close the dropdown when clicking outside it or the input field\r\n }\r\n \r\n employeegenerate(){\r\n const viewValue = document.querySelector('#viewType').value;\r\n if(viewValue === 'directReport'){\r\n document.getElementById('popup').classList.add(\"directReport\");\r\n document.getElementById('popup').classList.remove(\"managerHierarchy\");\r\n }\r\n if(viewValue === 'managerHierarchy'){\r\n document.getElementById('popup').classList.add(\"managerHierarchy\");\r\n document.getElementById('popup').classList.remove(\"directReport\");\r\n }\r\n this.ManagerName = this.searchManager;\r\n }\r\n\r\n employeegenerate2(){\r\n this.showPrint = true;\r\n this.clicked = true;\r\n const employee = this.selectedEmployee;\r\n this.employeeTree.push(employee);\r\n\r\n let selectedId = parseInt(employee.ReportingManagerID);\r\n let foundManager = this.allEmployees.find(employee => employee.EmployeeID === selectedId);\r\n\r\n while (foundManager) {\r\n this.employeeTree.push(foundManager);\r\n selectedId = parseInt(foundManager.ReportingManagerID);\r\n foundManager = this.allEmployees.find(employee => employee.EmployeeID === selectedId);\r\n }\r\n }\r\n \r\n generatePDF1()\r\n {\r\n if(this.employeeOrDepartment)\r\n {\r\n this.views =this.employeeOrDepartment;\r\n console.log(this.views);\r\n if(this.views ==\"employee\")\r\n {\r\n this.ViewByManager =1;\r\n }\r\n if(this.views ==\"department\")\r\n {\r\n this.ViewByManager =2;\r\n }\r\n }\r\n \r\n if(this.ViewByManager == 1)\r\n {\r\n // if(this.ManagerId )\r\n // {\r\n this.EmployeeId=this.ManagerId \r\n \r\n //}\r\n }\r\n if(this.ViewByManager == 2)\r\n {\r\n this.EmployeeId =this.selectedEmployee.EmployeeID;\r\n }\r\n\r\n if(this.view)\r\n {\r\n if(this.view == \"directReport\")\r\n {\r\n this.ChartViewID =1;\r\n }\r\n if(this.view == \"managerHierarchy\")\r\n {\r\n this.ChartViewID=2;\r\n }\r\n }\r\n\r\n // const data = {\r\n // EmployeeId:this.ID,\r\n // ChartViewID:this.view,\r\n // ViewByManager:this.views,\r\n // };\r\n // console.log(data);\r\n\r\n this.organizationService.orgchart(this.EmployeeId,this.ChartViewID,this.ViewByManager).then(data=>\r\n {\r\n this.getHolidayList =data;\r\n console.log(data);\r\n });\r\n\r\n \r\n // this.organizationService.orgchart(this.EmployeeId, this.ChartViewID, this.ViewByManager)\r\n // .then(response => {\r\n // // Create a blob from the response data\r\n // console.log(data);\r\n // const blob = new Blob([response], { type: 'application/pdf' });\r\n \r\n // // Create a URL for the blob\r\n // const url = window.URL.createObjectURL(blob);\r\n \r\n // // Create a link element to trigger the download\r\n // const a = document.createElement('a');\r\n // a.href = url;\r\n // a.download = 'Chart.pdf';\r\n // document.body.appendChild(a);\r\n // a.click();\r\n \r\n // // Clean up the URL object\r\n // window.URL.revokeObjectURL(url);\r\n // })\r\n // .catch(error => {\r\n // console.error('Error downloading PDF:', error);\r\n // });\r\n \r\n // this.organizationService.orgchart(this.EmployeeId, this.ChartViewID, this.ViewByManager)\r\n // .then(response => {\r\n // // Check if the response is a Blob (PDF)\r\n // if (response instanceof Blob) {\r\n // // Create a URL for the blob\r\n // const url = window.URL.createObjectURL(response);\r\n \r\n // // Create a link element to trigger the download\r\n // const a = document.createElement('a');\r\n // a.href = url;\r\n // a.download = 'Chart.pdf';\r\n // document.body.appendChild(a);\r\n // a.click();\r\n // console.log('Response type:', response.type);\r\n // // Clean up the URL object\r\n // window.URL.revokeObjectURL(url);\r\n // } else {\r\n // console.error('Response is not a Blob. Expected a PDF.');\r\n // console.log('Response type:', response);\r\n // }\r\n // })\r\n // .catch(error => {\r\n // console.error('Error downloading PDF:', error);\r\n // });\r\n \r\n \r\n }\r\n\r\n resetData(){\r\n window.location.reload();\r\n this.showTree = false;\r\n this.viewType=null;\r\n this.searchManager = '';\r\n this.view = '';\r\n this.searchTerm = '';\r\n this.employeeTree=[];\r\n document.getElementById('popup').classList.remove(\"directReport\");\r\n document.getElementById('popup').classList.remove(\"managerHierarchy\");\r\n this.showPrint = false;\r\n }\r\n\r\n resetemployee() {\r\n window.location.reload();\r\n this.employeeChildTree = [];\r\n this.employeeTree = [];\r\n this.showTree = false;\r\n this.showPrint = false;\r\n this.searchManager = '';\r\n this.view = '';\r\n this.searchTerm = '';\r\n if (this.clicked) {\r\n this.clicked = false;\r\n this.element.disabled = false;\r\n }\r\n }\r\n\r\n async generatePDF() {\r\n const doc = new jsPDF();\r\n doc.setFontSize(14);\r\n doc.setFont('helvetica', 'bold');\r\n // Set page size and orientation\r\n doc.setPage('a4', 'portrait');\r\n const popupContent = document.getElementById('popup');\r\n const spanElements = document.querySelectorAll('.arrow-icon');\r\n if(spanElements){\r\n spanElements.forEach(span => {\r\n span.style.display = 'none';\r\n });\r\n }\r\n\r\n // const downloadButton = popupContent.querySelector('.xls-down4load');\r\n // if (downloadButton) {\r\n // downloadButton.remove();\r\n // }\r\n // const elementsWithBackground = popupContent.querySelectorAll('.list-container li.parenttree > .profile-container');\r\n // elementsWithBackground.forEach(element => {\r\n // const style = document.createElement('style');\r\n // style.innerHTML = '.profile-container:after { background-image: none !important; }';\r\n // element.appendChild(style);\r\n // });\r\n await html2pdf().from(popupContent).set({\r\n margin: [28,28,28,40],\r\n filename: 'hierarchyChart.pdf',\r\n image: { type: 'png', quality: 0.95 },\r\n html2canvas: {\r\n useCORS:true},\r\n jsPDF: { unit: 'mm', format: 'a4', orientation: 'portrait' }\r\n }).save();\r\n\r\n if(spanElements){\r\n spanElements.forEach(span => {\r\n span.style.display = 'block';\r\n });\r\n }\r\n // Wait for all images to load\r\n }\r\n\r\n cancel() {\r\n this.hierarchyData = [];\r\n this.controller.cancel();\r\n }\r\n\r\n addToRecentItems(){\r\n this.leavemanagementService.AddToRecentItems(this.empid,this.SiteMapId).then(data=>\r\n {\r\n\r\n });\r\n }\r\n \r\n}\r\n","export class HomeComponent {\n header = \"Home Page\";\n}\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/main-logo.png\", import.meta.url);\n// Module\nvar ___HTML_LOADER_REPLACEMENT_0___ = ___HTML_LOADER_GET_SOURCE_FROM_IMPORT___(___HTML_LOADER_IMPORT_0___);\nvar code = \"\";\n// Exports\nexport default code;","// Module\nvar code = \"\\r\\n\";\n// Exports\nexport default code;","// 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/banner2.jpg\", import.meta.url);\nvar ___HTML_LOADER_IMPORT_1___ = new URL(\"../../images/banner3.jpg\", import.meta.url);\nvar ___HTML_LOADER_IMPORT_2___ = new URL(\"../../images/banner4.jpg\", import.meta.url);\nvar ___HTML_LOADER_IMPORT_3___ = new URL(\"../../images/banner5.jpg\", import.meta.url);\nvar ___HTML_LOADER_IMPORT_4___ = new URL(\"../../images/KensiumSolutions-logo-white.svg\", import.meta.url);\nvar ___HTML_LOADER_IMPORT_5___ = new URL(\"../../images/error-icon.svg\", import.meta.url);\n// Module\nvar ___HTML_LOADER_REPLACEMENT_0___ = ___HTML_LOADER_GET_SOURCE_FROM_IMPORT___(___HTML_LOADER_IMPORT_0___);\nvar ___HTML_LOADER_REPLACEMENT_1___ = ___HTML_LOADER_GET_SOURCE_FROM_IMPORT___(___HTML_LOADER_IMPORT_1___);\nvar ___HTML_LOADER_REPLACEMENT_2___ = ___HTML_LOADER_GET_SOURCE_FROM_IMPORT___(___HTML_LOADER_IMPORT_2___);\nvar ___HTML_LOADER_REPLACEMENT_3___ = ___HTML_LOADER_GET_SOURCE_FROM_IMPORT___(___HTML_LOADER_IMPORT_3___);\nvar ___HTML_LOADER_REPLACEMENT_4___ = ___HTML_LOADER_GET_SOURCE_FROM_IMPORT___(___HTML_LOADER_IMPORT_4___);\nvar ___HTML_LOADER_REPLACEMENT_5___ = ___HTML_LOADER_GET_SOURCE_FROM_IMPORT___(___HTML_LOADER_IMPORT_5___);\nvar code = \" \\r\\n\";\n// Exports\nexport default code;","// Module\nvar code = \"\\r\\n\";\n// Exports\nexport default code;","// 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/organization-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;","// Module\nvar code = \"\\n\";\n// Exports\nexport default code;"],"names":[],"sourceRoot":""}