let app = angular.module("pm-App", ["ngRoute", "angularUtils.directives.dirPagination", "ui.router", "ngTouch", "CoreCtrls", "angular-jwt", "ui.bootstrap", "ngTagsInput", 'ngSanitize', 'ui.select', 'ui.filters']);
//Edit is virtual of add
app.config([
    "$stateProvider", "$urlRouterProvider", "$locationProvider", "jwtOptionsProvider", "$httpProvider", function ($stateProvider, $urlRouterProvider, $locationProvider, jwtOptionsProvider, $httpProvider) {
        let t = "?t=" + new Date().getTime();
        $urlRouterProvider.otherwise("/404");

        $stateProvider
            .state("home", { url: "/", templateUrl: "app/templates/users/dashboard.html" + t, controller: "DashboardCtrl" })
            .state("v404", { url: "/404", templateUrl: "app/templates/404/index.html" + t, controller: "" })

            .state("login", { url: "/login", templateUrl: "app/templates/users/login.html" + t, controller: "LoginCtrl" })
            .state("resetPassword", { url: "/reset/password/:token", templateUrl: "app/templates/users/resetPassword.html" + t, controller: "ResetPasswordCtrl" })
            .state("forgotPassword", { url: "/forgot/password", templateUrl: "app/templates/users/forgotPassword.html" + t, controller: "ForgotPasswordCtrl" })
            .state("changePassword", { url: "/my/change-password", templateUrl: "app/templates/users/changePassword.html" + t, controller: "ChangePasswordCtrl", data: { requiresLogin: true } })
            .state("dashboard", { url: "/dashboard?token=" + Math.random(), templateUrl: "app/templates/users/dashboard.html" + t, controller: "DashboardCtrl", data: { requiresLogin: true } })

            .state("projectView", { url: "/projects/view/:projectid", templateUrl: "app/templates/projects/projectView.html" + t, controller: "ProjectViewCtrl", data: { requiresLogin: true } })
            .state("projectEdit", { url: "/projects/edit/:projectid", templateUrl: "app/templates/projects/projectAdd.html" + t, controller: "ProjectAddCtrl", data: { requiresLogin: true } })
            .state("projectAdd", { url: "/projects/add", templateUrl: "app/templates/projects/projectAdd.html" + t, controller: "ProjectAddCtrl", data: { requiresLogin: true } })
            .state("projectList", { url: "/projects/list", templateUrl: "app/templates/projects/projectList.html" + t, controller: "ProjectListCtrl", data: { requiresLogin: true } })
            .state("projectWeeklyForecast", { url: "/projects/addprojectforecast/:projectid", templateUrl: "app/templates/projects/projectWeeklyForecast.html" + t, controller: "projectWeeklyForecastCtrl", data: { requiresLogin: true } })
            .state("projectForecastReport", { url: "/projects/forecastreport", templateUrl: "app/templates/projects/projectForecastReport.html" + t, controller: "projectForecastReportCtrl", data: { requiresLogin: true } })

            .state("projectAccountAdd", { url: "/projects/accounts/:accountid", templateUrl: "app/templates/projects/projectAdd.html" + t, controller: "ProjectAddCtrl", data: { requiresLogin: true } })
            .state("projectHeroAdd", { url: "/projects/hero/add/:projectid", templateUrl: "app/templates/projects/projectHeroAdd.html" + t, controller: "ProjectHeroAddCtrl", data: { requiresLogin: true } })
            .state("projectHeroEdit", { url: "/projects/hero/edit/:allocationid", templateUrl: "app/templates/projects/projectHeroEdit.html" + t, controller: "ProjectHeroEditCtrl", data: { requiresLogin: true } })

            .state("accountList", { url: "/accounts/list", templateUrl: "app/templates/accounts/accountList.html" + t, controller: "AccountListCtrl", data: { requiresLogin: true } })
            .state("accountAdd", { url: "/accounts/add", templateUrl: "app/templates/accounts/accountAdd.html" + t, controller: "AccountAddCtrl", data: { requiresLogin: true } })
            .state("accountEdit", { url: "/accounts/edit/:accountid", templateUrl: "app/templates/accounts/accountAdd.html" + t, controller: "AccountAddCtrl", data: { requiresLogin: true } })
            .state("accountView", { url: "/accounts/view/:accountid", templateUrl: "app/templates/accounts/accountView.html" + t, controller: "AccountViewCtrl", data: { requiresLogin: true } })

            .state("myDiaryList", { url: "/my-diary/list", templateUrl: "app/templates/myDiary/myDiaryList.html" + t, controller: "MyDiaryListCtrl", data: { requiresLogin: true } })
            .state("myDiaryReport", { url: "/my-diary/report", templateUrl: "app/templates/myDiary/myDiaryReport.html" + t, controller: "MyDiaryReportCtrl", data: { requiresLogin: true } })
            .state("myDiaryUnfilledReport", { url: "/my-diary/unfilled-report", templateUrl: "app/templates/myDiary/myDiaryUnfilledReport.html" + t, controller: "MyDiaryUnfilledReportCtrl", data: { requiresLogin: true } })
            .state("myDiaryUnfilledReportClone", { url: "/my-diary/unfilled-report-clone", templateUrl: "app/templates/myDiary/myDiaryUnfilledReportClone.html" + t, controller: "MyDiaryUnfilledReportCloneCtrl", data: { requiresLogin: true } })
            .state("myDiaryUnfilledReportClone2", { url: "/my-diary/unfilled-report-clone2", templateUrl: "app/templates/myDiary/myDiaryUnfilledReportClone2.html" + t, controller: "MyDiaryUnfilledReportCloneCtrl2", data: { requiresLogin: true } })
            .state("myDiaryUnfilledReportClone3", { url: "/my-diary/unfilled-report-clone3", templateUrl: "app/templates/myDiary/myDiaryUnfilledReportClone3.html" + t, controller: "MyDiaryUnfilledReportCloneCtrl3", data: { requiresLogin: true } })

            .state("MyDiaryLockedReport", { url: "/my-diary/billing-lock-report", templateUrl: "app/templates/myDiary/MyDiaryLockedReport.html" + t, controller: "MyDiaryLockedReport", data: { requiresLogin: true } })

            .state("MyDiaryUnfilledReportWeekly", { url: "/my-diary/unfilled-report-weekly", templateUrl: "app/templates/myDiary/myDiaryUnfilledReportWeekly.html" + t, controller: "MyDiaryUnfilledReportWeeklyCtrl", data: { requiresLogin: true } })

            .state("myDiaryUtilityReport", { url: "/my-diary/utility-report", templateUrl: "app/templates/myDiary/myDiaryUtilityReport.html" + t, controller: "MyDiaryUtilityReportCtrl", data: { requiresLogin: true } })
            .state("MyDiaryBillingEfficiencyReport", { url: "/my-diary/billing-efficiency-report", templateUrl: "app/templates/myDiary/myDiaryBillingEfficiencyReport.html" + t, controller: "MyDiaryBillingEfficiencyCtrl", data: { requiresLogin: true } })
            .state("myDiaryReportHeroView", { url: "/my-diary/report-heroview", templateUrl: "app/templates/myDiary/myDiaryReportHeroView.html" + t, controller: "MyDiaryReportHeroViewCtrl", data: { requiresLogin: true } })
            .state("myDiaryAdd", { url: "/my-diary/add", templateUrl: "app/templates/myDiary/myDiaryAdd.html" + t, controller: "MyDiaryAddCtrl", data: { requiresLogin: true } })
            .state("myDiaryAdd2", { url: "/my-diary/add2", templateUrl: "app/templates/myDiary/myDiaryAdd2.html" + t, controller: "MyDiaryAddCtrl2", data: { requiresLogin: true } })
            .state("myDiaryAddClone", { url: "/my-diary/add-clone", templateUrl: "app/templates/myDiary/myDiaryAddClone.html" + t, controller: "MyDiaryAddCtrlClone", data: { requiresLogin: true } })

            .state("manPowerPlanningDiscussionsAdd", { url: "/manpowerplanningdiscussions/add", templateUrl: "app/templates/manPowerPlanningDiscussions/ManPowerPlanningDiscussionsAdd.html" + t, controller: "ManPowerPlanningDiscussionsAddCtrl", data: { requiresLogin: true } })
            .state("manPowerPlanningDiscussionsList", { url: "/manpowerplanningdiscussions/list", templateUrl: "app/templates/manPowerPlanningDiscussions/ManPowerPlanningDiscussionsList.html" + t, controller: "ManPowerPlanningDiscussionsListCtrl", data: { requiresLogin: true } })

            .state("projectDiaryList", { url: "/project-diary/list", templateUrl: "app/templates/projectDiary/projectDiaryList.html" + t, controller: "ProjectDiaryListCtrl", data: { requiresLogin: true } })
            .state("projectDiaryReport", { url: "/project-diary/report", templateUrl: "app/templates/projectDiary/projectDiaryReport.html" + t, controller: "ProjectDiaryReportCtrl", data: { requiresLogin: true } })
            .state("projectDiaryAdd", { url: "/project-diary/add", templateUrl: "app/templates/projectDiary/projectDiaryAdd.html" + t, controller: "ProjectDiaryAddCtrl", data: { requiresLogin: true } })

            .state("contactList", { url: "/contacts/list", templateUrl: "app/templates/contacts/contactList.html" + t, controller: "ContactListCtrl", data: { requiresLogin: true } })
            .state("contactAdd", { url: "/contacts/add", templateUrl: "app/templates/contacts/contactAdd.html" + t, controller: "ContactAddCtrl", data: { requiresLogin: true } })
            .state("contactEdit", { url: "/contacts/edit/:contactid", templateUrl: "app/templates/contacts/contactAdd.html" + t, controller: "ContactAddCtrl", data: { requiresLogin: true } })
            .state("contactView", { url: "/contacts/view/:contactid", templateUrl: "app/templates/contacts/contactView.html" + t, controller: "ContactViewCtrl", data: { requiresLogin: true } })

            .state("emailtemplateList", { url: "/emailtemplates/list", templateUrl: "app/templates/emailtemplates/emailtemplateList.html" + t, controller: "EmailTemplateListCtrl", data: { requiresLogin: true } })
            .state("emailtemplateAdd", { url: "/emailtemplates/add", templateUrl: "app/templates/emailtemplates/emailtemplateAdd.html" + t, controller: "EmailtemplateAddCtrl", data: { requiresLogin: true } })
            .state("emailtemplateEdit", { url: "/emailtemplates/edit/:emailtemplateid", templateUrl: "app/templates/emailtemplates/emailtemplateAdd.html" + t, controller: "EmailtemplateAddCtrl", data: { requiresLogin: true } })
            .state("emailtemplateView", { url: "/emailtemplates/view/:emailtemplateid", templateUrl: "app/templates/emailtemplates/emailtemplateView.html" + t, controller: "EmailtemplateViewCtrl", data: { requiresLogin: true } })

            .state("managerList", { url: "/managers/list", templateUrl: "app/templates/managers/managerList.html" + t, controller: "ManagerListCtrl", data: { requiresLogin: true } })

            .state("manageSkill", { url: "/manages/:type", templateUrl: "app/templates/masters/master.html" + t, controller: "MasterCtrl", data: { requiresLogin: true } })
            .state("manageDesignation", { url: "/manages/:type", templateUrl: "app/templates/masters/master.html" + t, controller: "MasterCtrl", data: { requiresLogin: true } })
            .state("AllAllocation", { url: "/allallocation", templateUrl: "app/templates/pool/allAllocation.html" + t, controller: "AllAllocationCtrl", data: { requiresLogin: true } })
            .state("AllAllocationReport", { url: "/allallocationreport", templateUrl: "app/templates/pool/allAllocationReport.html" + t, controller: "AllAllocationReportCtrl", data: { requiresLogin: true } })


            .state("aclList", { url: "/acls/list", templateUrl: "app/templates/acl/aclList.html" + t, controller: "AclListCtrl", data: { requiresLogin: true } })
            .state("poolList", { url: "/pools/list", templateUrl: "app/templates/pool/poolList.html" + t, controller: "PoolListCtrl", data: { requiresLogin: true } })

            .state("myProjectList", { url: "/my/projects/list", templateUrl: "app/templates/my/myProjectsList.html" + t, controller: "MyProjectListCtrl", data: { requiresLogin: true } })
            .state("myTeamList", { url: "/my/teams/list", templateUrl: "app/templates/my/myTeamList.html" + t, controller: "MyTeamListCtrl", data: { requiresLogin: true } })
            .state("mySkillsAdd", { url: "/my/skills/add", templateUrl: "app/templates/my/mySkillsAdd.html" + t, controller: "MySkillsAddCtrl", data: { requiresLogin: true } })
            .state("myProfileAdd", { url: "/my/profile/add", templateUrl: "app/templates/my/myProfileAdd.html" + t, controller: "MyProfileAddCtrl", data: { requiresLogin: true } })
            .state("myCertificateAdd", { url: "/my/certificate/add", templateUrl: "app/templates/my/myCertificateAdd.html" + t, controller: "MyCertificateAddCtrl", data: { requiresLogin: true } })
            .state("myCertificatesList", { url: "/mycertificates/list", templateUrl: "app/templates/my/myCertificatessList.html" + t, controller: "MyCertificateListCtrl", data: { requiresLogin: true } })
            .state("myCertificateReportHeroView", { url: "/mycertificate/report-heroview/:hero_id", templateUrl: "app/templates/my/myCertificateReportHeroView.html" + t, controller: "MyCertificateReportHeroViewCtrl", data: { requiresLogin: true } })
            .state("heroList", { url: "/heroes/list", templateUrl: "app/templates/heroes/heroList.html" + t, controller: "HeroListCtrl", data: { requiresLogin: true } })
            .state("MyTeamSkills", { url: "/heroes/my-team-skills", templateUrl: "app/templates/heroes/MyTeamSkills.html" + t, controller: "MyTeamSkills", data: { requiresLogin: true } })
            .state("heroView", { url: "/heroes/view/:employeeid", templateUrl: "app/templates/heroes/heroView.html" + t, controller: "HeroViewCtrl", data: { requiresLogin: true } })
            .state("heroAdd", { url: "/heroes/add", templateUrl: "app/templates/heroes/heroAdd.html" + t, controller: "HeroAddCtrl", data: { requiresLogin: true } })
            .state("heroEdit", { url: "/heroes/edit/:employeeid", templateUrl: "app/templates/heroes/heroAdd.html" + t, controller: "HeroAddCtrl", data: { requiresLogin: true } })
            .state("heroFeedback", { url: "/heroes/feedback/:employeeid", templateUrl: "app/templates/heroes/heroFeedback.html" + t, controller: "HeroFeedbackCtrl", data: { requiresLogin: true } })
            .state("heroReopeningBooking", { url: "/heroes/reopeningbooking/:employeeid", templateUrl: "app/templates/heroes/heroReopeningBooking.html" + t, controller: "heroReopeningBookingCtrl", data: { requiresLogin: true } })
            .state("heroReopeningBookingReport", { url: "/heroes/reopeningbookingreport", templateUrl: "app/templates/heroes/HeroOfficecReopeningBookingReport.html" + t, controller: "HeroOfficecReopeningBookingReportCtrl", data: { requiresLogin: true } })
            .state("editProfile", { url: "/profile/edit", templateUrl: "app/templates/heroes/heroAdd.html" + t, controller: "HeroAddCtrl", data: { requiresLogin: true } })
            .state("heroProjectAdd", { url: "/hero/project/add/:employeeid", templateUrl: "app/templates/heroes/heroProjectAdd.html" + t, controller: "HeroProjectAddCtrl", data: { requiresLogin: true } })
            .state("heroTimeline", { url: "/heroes/project/timeline/:employeeid", templateUrl: "app/templates/heroes/timeline.html" + t, controller: "HeroProjectTimelineCtrl", data: { requiresLogin: true } })
            .state("projectTimeline", { url: "/projects/timeline", templateUrl: "app/templates/projects/projectTimeline.html" + t, controller: "ProjectTimelineCtrl", data: { requiresLogin: true } })
            .state("heroesBySkills", { url: "/heroes/heroesbyskills", templateUrl: "app/templates/heroes/heroesBySkill.html" + t, controller: "heroesBySkillsCtrl", data: { requiresLogin: true } })

            .state("assessment", { url: "/assessment", templateUrl: "app/templates/assessment/assessment.html" + t, controller: "AssessmentCtrl", data: { requiresLogin: true } })
            .state("OverallAssessment", { url: "/overallassessment", templateUrl: "app/templates/assessment/overallAssessment.html" + t, controller: "OverallAssessmentCtrl", data: { requiresLogin: true } })

            .state("assessmentAdmin", { url: "/assessment/admin", templateUrl: "app/templates/assessment/assessmentAdmin.html" + t, controller: "AssessmentAdminCtrl", data: { requiresLogin: true } })
            .state("assessmentManagerReply", { url: "/assessment/manager/reply/:projectid/:employeeid/:scheduleid", templateUrl: "app/templates/assessment/assessmentManagerReply.html" + t, controller: "AssessmentManagerReplyCtrl", data: { requiresLogin: true } })
            .state("overallassessment", { url: "/overallassessment/manager/reply/:employeeid/:scheduleid", templateUrl: "app/templates/assessment/overallAssessmentManagerReply.html" + t, controller: "OverallAssessmentManagerReplyCtrl", data: { requiresLogin: true } })
            .state("assessmentDashboard", { url: "/assessment/dashboard", templateUrl: "app/templates/assessment/assessmentDashboard.html" + t, controller: "AssessmentDashboardCtrl", data: { requiresLogin: true } })
            .state("OverallAssessmentDashboard", { url: "/overallassessment/dashboard", templateUrl: "app/templates/assessment/overallAssessmentDashboard.html" + t, controller: "OverallAssessmentDashboardCtrl", data: { requiresLogin: true } })

            .state("assessmentSchedule", { url: "/assessment/schedule", templateUrl: "app/templates/assessment/assessmentSchedule.html" + t, controller: "AssessmentScheduleCtrl", data: { requiresLogin: true } })
            .state("assessmentOverall", { url: "/assessment/overall", templateUrl: "app/templates/assessment/overallAssessmentAdmin.html" + t, controller: "OverAllAssessmentAdminCtrl", data: { requiresLogin: true } })

            .state("myGoals", { url: "/my/goals", templateUrl: "app/templates/my/myGoals.html" + t, controller: "MyGoalsCtrl", data: { requiresLogin: true } })
            .state("goalDashboard", { url: "/goal-dashboard/:template_id", templateUrl: "app/templates/my/goalDashboard.html" + t, controller: "GoalDashboardCtrl", data: { requiresLogin: true } })
            .state("goalView", { url: "/goal-dashboard/view/:hero_id/:manager_id", templateUrl: "app/templates/my/heroGoalView.html" + t, controller: "HeroGoalViewCtrl", data: { requiresLogin: true } })//hero goal view by his line manager

            .state("tipList", { url: "/tips/list", templateUrl: "app/templates/tip/tipList.html" + t, controller: "TipListCtrl", data: { requiresLogin: true } })
            .state("tipAdd", { url: "/tips/add", templateUrl: "app/templates/tip/tipAdd.html" + t, controller: "TipAddCtrl", data: { requiresLogin: true } })
            .state("tipEdit", { url: "/tips/edit/:id", templateUrl: "app/templates/tip/tipAdd.html" + t, controller: "TipAddCtrl", data: { requiresLogin: true } })
            .state("tipView", { url: "/tips/view/:id", templateUrl: "app/templates/tip/tipView.html" + t, controller: "TipViewCtrl", data: { requiresLogin: true } })

            .state("ClientAppreciationsList", { url: "/clientappreciation/list", templateUrl: "app/templates/ClientAppreciations/ClientAppreciationsList.html" + t, controller: "ClientAppreciationsListCtrl", data: { requiresLogin: true } })
            .state("HeroAppreciationlList", { url: "/clientappreciation/appreciationlist", templateUrl: "app/templates/ClientAppreciations/HeroAppreciationlList.html" + t, controller: "HeroAppreciationlListCtrl", data: { requiresLogin: true } })
            .state("ClientAppreciationsAdd", { url: "/clientappreciation/add", templateUrl: "app/templates/ClientAppreciations/ClientAppreciationsAdd.html" + t, controller: "ClientAppreciationsAddCtrl", data: { requiresLogin: true } })
            .state("ClientAppreciationsEdit", { url: "/clientappreciation/edit/:id", templateUrl: "app/templates/ClientAppreciations/ClientAppreciationsAdd.html" + t, controller: "ClientAppreciationsAddCtrl", data: { requiresLogin: true } })
            .state("ClientAppreciationsView", { url: "/clientappreciation/view/:id", templateUrl: "app/templates/ClientAppreciations/ClientAppreciationsView.html" + t, controller: "ClientAppreciationsCtrl", data: { requiresLogin: true } })
            .state("tipReport", { url: "/tips/report", templateUrl: "app/templates/tip/tipReport.html" + t, controller: "TipReportCtrl", data: { requiresLogin: true } })

            .state("AssessmentMaster", { url: "/assessment/master", templateUrl: "app/templates/assessment/assessmentMaster.html" + t, controller: "AssessmentMasterCtrl", data: { requiresLogin: true } })
            .state("WatchListTagMaster", { url: "/watchlists/tagmaster", templateUrl: "app/templates/watchlist/watchListTagMaster.html" + t, controller: "WatchListTagMasterCtrl", data: { requiresLogin: true } })
            .state("WatchListMaster", { url: "/watchlists/master", templateUrl: "app/templates/watchlist/watchListMaster.html" + t, controller: "WatchListMasterCtrl", data: { requiresLogin: true } })
            .state("WatchListHeroes", { url: "/watchlists/heroes", templateUrl: "app/templates/watchlist/watchlistHeroes.html" + t, controller: "WatchlistHeroesCtrl", data: { requiresLogin: true } })
            .state("templateMaster", { url: "/my/templatemaster", templateUrl: "app/templates/my/templateMaster.html" + t, controller: "TemplateMasterCtrl", data: { requiresLogin: true } })
            .state("adminAddGoalTemplate", { url: "/my/addgoalbytemplate", templateUrl: "app/templates/my/adminAddGoalTemplate.html" + t, controller: "adminAddGoalTemplateCtrl", data: { requiresLogin: true } })
            .state("goalList", { url: "/goal-dashboard/list/:hero_id/:manager_id", templateUrl: "app/templates/my/goalListTemplate.html" + t, controller: "GoalListTemplateCtrl", data: { requiresLogin: true } })
            .state("ShoutOutList", { url: "/shoutouts/list", templateUrl: "app/templates/ShoutOut/ShoutOutList.html" + t, controller: "ShoutOutListCtrl", data: { requiresLogin: true } })
            .state("HeroShoutOutList", { url: "/shoutouts/heroshoutoutlist", templateUrl: "app/templates/ShoutOut/HeroShoutOutList.html" + t, controller: "HeroShoutOutListCtrl", data: { requiresLogin: true } })
            .state("HeroToShoutOutList", { url: "/shoutouts/herotoshoutoutlist", templateUrl: "app/templates/ShoutOut/HeroToShoutOutList.html" + t, controller: "HeroToShoutOutListCtrl", data: { requiresLogin: true } })
            .state("ShoutOutAdd", { url: "/shoutouts/add", templateUrl: "app/templates/ShoutOut/ShoutOutAdd.html" + t, controller: "ShoutOutAddCtrl", data: { requiresLogin: true } })
            .state("ShoutOutEdit", { url: "/shoutouts/edit/:id", templateUrl: "app/templates/ShoutOut/ShoutOutAdd.html" + t, controller: "ShoutOutAddCtrl", data: { requiresLogin: true } })
            .state("ShoutOutView", { url: "/shoutouts/view/:id", templateUrl: "app/templates/ShoutOut/ShoutOutView.html" + t, controller: "ShoutOutCtrl", data: { requiresLogin: true } })
            .state("goalAdd", { url: "/goal-dashboard/add/", templateUrl: "app/templates/my/heroGoalAdd.html" + t, controller: "HeroGoalAddCtrl", data: { requiresLogin: true } })//hero goal view by his line manager

            .state("projectTypeMaster", { url: "/projects/typemaster/add/", templateUrl: "app/templates/projects/projectTypeMaster.html" + t, controller: "projectTypeMasterCtrl", data: { requiresLogin: true } })//hero goal view by his line manager
            .state("forecastProfileMaster", { url: "/projects/forecastprofile/add/", templateUrl: "app/templates/projects/forecastProfileMaster.html" + t, controller: "forecastProfileMasterCtrl", data: { requiresLogin: true } })//hero goal view by his line manager

            .state("skillReport", { url: "/skillReport", templateUrl: "app/templates/my/skillsUpdatedReport.html" + t, controller: "skillsUpdatedCtrl", data: { requiresLogin: true } })
            .state("goalTemplateDetail", { url: "/my/goalTemplateDetail", templateUrl: "app/templates/my/goalTemplateMatrix.html" + t, controller: "goalTemplateMatrixCtrl", data: { requiresLogin: true } })

            /*25 Jan 2023 Created By Suresh Yadav [This is Use for Manage Newsletter] */
            .state("newsLetterList", { url: "/newsletters/list", templateUrl: "app/templates/newsLetter/newsLetterList.html" + t, controller: "NewsLetterListCtrl", data: { requiresLogin: true } })
            .state("newsLetterAdd", { url: "/newsletters/add", templateUrl: "app/templates/newsLetter/newsLetterAdd.html" + t, controller: "NewsLetterAddCtrl", data: { requiresLogin: true } })
            .state("newsLetterView", { url: "/newsletters/view/:newsletterid", templateUrl: "app/templates/newsLetter/newsLetterView.html" + t, controller: "NewsLetterViewCtrl", data: { requiresLogin: true } })
            .state("newsLetterArchiveList", { url: "/newsletters/archivelist", templateUrl: "app/templates/newsLetter/newsLetterArchiveList.html" + t, controller: "NewsletterArchiveListCtrl", data: { requiresLogin: true } })
            // End By Suresh [This is Use for Manage Newsletter]-------------------------------------
            .state("managecountries", { url: "/managecountries", templateUrl: "app/templates/common/managecountries.html" + t, controller: "ManageCountriesCtrl", data: { requiresLogin: true } })
            .state("emailNotificationConfiguration", { url: "/emailnotificationconfigurations", templateUrl: "app/templates/common/emailNotificationConfiguration.html" + t, controller: "EmailNotificationConfigurationCtrl", data: { requiresLogin: true } })
            .state("birthdayReport", { url: "/report/BirthdayReport", templateUrl: "app/templates/common/birthdayReport.html" + t, controller: "BirthdayReport", data: { requiresLogin: true } })
            .state("workAnniversaryReport", { url: "/report/workAnniversaryReport", templateUrl: "app/templates/common/anniversaryReport.html" + t, controller: "AnniversaryReport", data: { requiresLogin: true } })
            .state("ResourceAllocationList", { url: "/resource/allAllocation", templateUrl: "app/templates/pool/allocationList.html" + t, controller: "AllocationListCtrl", data: { requiresLogin: true } })
            .state("ResourcePoolList", { url: "/resource/resourcepool", templateUrl: "app/templates/pool/ResourcePoolList.html" + t, controller: "ResourcePoolListCtrl", data: { requiresLogin: true } })
            .state("heroesUploadFile", { url: "/heroes/heroesUploadFile/:employeeid", templateUrl: "app/templates/common/heroesUploadFile.html" + t, controller: "HeroesUploadFileCtrl", data: { requiresLogin: true } })
            .state("myDocumentList", { url: "/mydocument/list", templateUrl: "app/templates/common/myDocumentList.html" + t, controller: "MyDocumentListCtrl", data: { requiresLogin: true } })
            .state("newsLetterArchiveView", { url: "/newsletterarchive/view/:newsletterid", templateUrl: "app/templates/newsletter/newsLetterArchiveView.html" + t, controller: "NewsLetterArchiveViewCtrl", data: { requiresLogin: true } })
            .state("diaryReportLocationWise", { url: "/heroDiary/location/", templateUrl: "app/templates/myDiary/MyDiaryLocationReport.html" + t, controller: "MyDiaryLocationReportCtrl", data: { requiresLogin: true } })
            .state("importExcel", { url: "/data/importcsv", templateUrl: "app/templates/common/ImportExcel.html" + t, controller: "importExcelCtrl", data: { requiresLogin: true } })
            .state("aclProfileAdd", { url: "/acls/profile/add", templateUrl: "app/templates/acl/aclProfile.html" + t, controller: "AclProfileCtrl", data: { requiresLogin: true } })
            .state("AclProfileList", { url: "/acls/profile/list", templateUrl: "app/templates/acl/AclProfileList.html" + t, controller: "AclProfileListCtrl", data: { requiresLogin: true } })
            .state("AclProfileEdit", { url: "/acls/profile/edit/:acl_id", templateUrl: "app/templates/acl/AclEditProfile.html" + t, controller: "AclEditProfileCtrl", data: { requiresLogin: true } })
            .state("RMSAIBotCtrl", { url: "/rms_ai_bot/", templateUrl: "app/templates/common/rms_ai_bot.html" + t, controller: "RMSAIBotCtrl", data: { requiresLogin: true } })
            .state("GirikAIBotCtrl", { url: "/girik_ai_bot/", templateUrl: "app/templates/common/girik_ai_bot.html" + t, controller: "GirikAIBotCtrl", data: { requiresLogin: true } })

            .state("invoiceAdd", { url: "/invoices/add/:projectid/", templateUrl: "app/templates/invoice/invoiceAdd.html" + t, controller: "InvoiceAddCtrl", data: { requiresLogin: true } })
            .state("assignAclProfile", { url: "/acls/assignAclProfile", templateUrl: "app/templates/acl/assignAclProfile.html" + t, controller: "assignAclProfile", data: { requiresLogin: true } })
            .state("diaryconfiguration", { url: "/diaryconfiguration", templateUrl: "app/templates/myDiary/diaryconfiguration.html" + t, controller: "DiaryConfigurationCtrl", data: { requiresLogin: true } })

            .state("requisitionStatus", { url: "/requisitions/addstatuses/", templateUrl: "app/templates/requisition/RequisitionStatus.html" + t, controller: "RequisitionStatusCtrl", data: { requiresLogin: true } })
            .state("assignRequisitionForm", { url: "/requisitions/assignForm/:requisition_id", templateUrl: "app/templates/requisition/AssignRequisitionForm.html" + t, controller: "AssignRequisitionFormCtrl", data: { requiresLogin: true } })
            .state("requisitionAdd", { url: "/requisitionadd", templateUrl: "app/templates/requisition/requisitionAdd.html" + t, controller: "RequisitionAddCtrl", data: { requiresLogin: true } })
            .state("requisitionList", { url: "/requisitionlist", templateUrl: "app/templates/requisition/requisitionList.html" + t, controller: "RequisitionListCtrl", data: { requiresLogin: true } })
            .state("requisitionDashboard", { url: "/requisitions/dashboard/", templateUrl: "app/templates/requisition/requisitionDashboard.html" + t, controller: "RequisitionDashboardCtrl", data: { requiresLogin: true } })
            .state("requisitionHeroDetails", { url: "/requisitions/heroDetails/:requisition_id", templateUrl: "app/templates/requisition/requisitionHeroDetails.html" + t, controller: "RequisitionHeroDetailsCtrl", data: { requiresLogin: true } })
            .state("requisitionComment", { url: "/requisitions/heroComment/:reqDetail_id", templateUrl: "app/templates/requisition/requisitionComment.html" + t, controller: "RequisitionCommentCtrl", data: { requiresLogin: true } })
            .state("requisitionEdit", { url: "/requisitions/edit/:requisition_id", templateUrl: "app/templates/requisition/requisitionAdd.html" + t, controller: "RequisitionAddCtrl", data: { requiresLogin: true } })
            .state("heroListBySkill", { url: "/heroes/heroListBySkill/:id", templateUrl: "app/templates/heroes/heroListBySkill.html" + t, controller: "HeroListBySkillCtrl", data: { requiresLogin: true } })
            ;



        //sending authorisation header in every request
        jwtOptionsProvider.config({
            tokenGetter: [
                "options", function (options) {
                    // Skip authentication for any requests ending in .html (templates)
                    if (options && options.url && options.url.indexOf(".html") > -1) {
                        return null;
                    } else {
                        return localStorage.getItem("id_token");
                    }
                }
            ],
            whiteListedDomains: ["localhost", "127.0.0.1", "192.168.7.36", "192.168.7.143", "helpdesk.girikon.com", "rms.girikon.com"],
            unauthenticatedRedirectPath: "login",
            loginPath: "login"
        });

        app.run(function (authManager) {
            authManager.checkAuthOnRefresh();
            authManager.redirectWhenUnauthenticated();
        });

        $httpProvider.interceptors.push("jwtInterceptor");

        //to remove hash tag
        $locationProvider.html5Mode({ enabled: true, requireBase: true });
    }
]);

app.directive('ckEditor', function () {
    return {
        require: '?ngModel',
        link: function (scope, elm, attr, ngModel) {
            var ck = CKEDITOR.replace(elm[0]);

            if (!ngModel) return;

            ck.on('pasteState', function () {
                scope.$apply(function () {
                    ngModel.$setViewValue(ck.getData());
                });
            });

            ngModel.$render = function (value) {
                ck.setData(ngModel.$viewValue);
            };
        }
    };
});
let appCore = angular.module("CoreCtrls", []);
