/* eslint-disable import/prefer-default-export */
import Vue from 'vue'
import Router from 'vue-router'
import VueHead from 'vue-head'

import HomePage from '../components/home/homePage.vue'

import TimeshareBuy from '../components/timeshare/buy/buyPage.vue'
import TimeshareSell from '../components/timeshare/sell/sellPage.vue'
import TimeshareFAQ from '../components/timeshare/faqPage.vue'
import TimeshareSearch from '../components/timeshare/buy/weekListPage.vue'
import MyWeeksPage from '../components/timeshare/myWeeksPage.vue'

import Login from '../components/user/loginPage.vue'
import PrivateIndividual from '../components/user/registerPage.vue'
import Agency from '../components/user/registerAgencySection.vue'
import UpdateInfo from '../components/user/updateProfileInfo.vue'
import ForgotPassword from '../components/user/forgotPassword.vue'
import ForgotPasswordReset from '../components/user/forgotPasswordReset.vue'

import PropertySearch from '../components/property/propertySearchPage.vue'
import PropertyPage from '../components/property/propertyPage.vue'
import PropertyEdit from '../components/property/editProperty/editProperty.vue'

import PropertyCreate from '../components/property/propertyCreate.vue'
import CommercialCreate from '../components/property/commercial/createProperty/commercialCreateNew.vue'
import ResidentialCreate from '../components/property/residential/createProperty/residentialCreateNew.vue'
import ListProperty from '../components/property/ListProperty/listPropertyPage.vue'

import PropertyAdminList from '../components/admin/property/propertyAdmin.vue'
import PropertyTypeList from '../components/admin/property/propertyTypeList.vue'
import PropertyType from '../components/admin/property/propertyTypeEdit.vue'
import UserDefinedGroups from '../components/admin/property/userDefinedGroupsPage.vue'
import UserDefinedGroup from '../components/admin/property/userDefinedGroupPage.vue'
import PropertyManagement from '../components/propertyManagement/sectionalTitle/propertyManagement.vue'
import RentalPropertyManagement from '../components/propertyManagement/rentalManagement/rentalPropertyManagement.vue'

import ResidentialPage from '../components/property/residential/residentialPage.vue'
import CommercialPage from '../components/property/commercial/commercialPage.vue'
import SingleCommercialPage from '../components/property/commercial/singleView/singleCommercialPage.vue'
import SingleResidentialPage from '../components/property/residential/singleView/singleResidentialPage.vue'

import AboutUs from '../components/about/aboutUsPage.vue'
import AboutTimeshare from '../components/about/aboutTimeshare.vue'
import Contact from '../components/shared/contact.vue'

import Status from '../components/admin/status/statusPage.vue'
import StatusNew from '../components/admin/status/statusNew.vue'

import timeshareAdminPage from '../components/admin/status/timeshareAdminPage.vue'
import tenderWeekAdminPage from '../components/admin/status/tenderWeekAdminPage.vue'
import userManagementPage from '../components/admin/status/userManagementPage.vue'
import changeLogPage from '../components/admin/status/changeLogPage.vue'
import UnitConfiguration from '../components/admin/unitConfiguration/unitConfigurationPage.vue'
import agentManagementPage from '../components/admin/status/agentUserManagementPage.vue'
import agencyManagementPage from '../components/admin/status/agencyUserManagementPage.vue'
import Fees from '../components/admin/fees/feesPage.vue'
import PasswordOnLogin from '../components/user/firstLoginPasswordUpdate.vue'
import UpdateAgentProfile from '../components/user/updateAgentProfile.vue'

import ResortPage from '../components/timeshare/resort/resortPageNew.vue'
import UnitPage from '../components/timeshare/resort/unit/unitPageNew.vue'
import ToBuySearch from '../components/timeshare/buy/toBuySearchResults.vue'

import ContactUs from '../components/misc/contactUs.vue'
import PrivacyPolicy from '../components/misc//privacyPolicy/privacyPolicyPage.vue'
import WebsiteDisclaimer from '../components/misc/Disclaimer/WebsiteDisclaimer.vue'
import TermsConditions from '../components/admin/misc/termsConditions.vue'
import TermsConditionsView from '../components/misc/TermsConditions/termsConditions.vue'
import ContactUsLog from '../components/communication/contactUsLog.vue'
import ContactUsSourceList from '../components/communication/contactUsSourceList.vue'
import ContactUsSource from '../components/communication/contactUsSource.vue'
import EnquireNowLog from '../components/communication/enquireNowLog.vue'

import MakeOffer from '../components/processFlow/makeOffer.vue'
import Offer from '../components/processFlow/offers.vue'
import searchLog from '../components/admin/logs/SearchLogs.vue'
// import store from '../store';

import TemplatePage from '../components/communication/templatePage.vue'
import CarouselList from '../components/admin/misc/carouselList.vue'
import CarouselDetail from '../components/admin/misc/carousel.vue'
import AlertPage from '../components/shared/alertPage.vue'
import PropertySearchResults from '../components/property/propertySearchResults.vue'
import EmailRecipient from '../components/communication/emailRecipients.vue'
import EmailRecipientNew from '../components/communication/emailRecipientNew.vue'
import EmailRecipientEdit from '../components/communication/emailRecipientEdit.vue'
import EmailTemplates from '../components/communication/emailTemplatesNew.vue'
import EmailTemplateEdit from '../components/communication/editEmailTemplate.vue'
import EmailTemplateNew from '../components/communication/newEmailTemplate.vue'

import CommercialSearchResults from '../components/property/commercial/commercialSearchResults.vue'
import ResidentialSearchResults from '../components/property/residential/residentialSearchResults.vue'

import PaymentGateway from '../components/financial/paygate/paygateProcess.vue'
import Payments from '../components/financial/payments.vue'
import PaymentSuccess from '../components/financial/OrderThankYou.vue'
import PaymentError from '../components/financial/paymentError.vue'
import PaymentOption from '../components/financial/paymentOption.vue'
import EFTPage from '../components/financial/eftPage.vue'
import PayFast from '../components/financial/payFast.vue'

import CampaignUpload from '../components/marketing/campaignUpload.vue'
import LandingPages from '../components/marketing/landingPages.vue'
import LandingPage from '../components/marketing/landingPage.vue'
import LandingPageProperty from '../components/marketing/landingPageProperty.vue'
import NewLandingPage from '../components/marketing/newLandingPage.vue'
import LandingPageWeek from '../components/marketing/landingPageWeek.vue'
import MarketingPage from '../components/marketing/clientView.vue'
import MarketingPageExp from '../components/marketing/landingPageExpired.vue'
import EnquireNow from '../components/property/enquireNow/enquirenow.vue'
import MyWeeksEdit from '../components/admin/status/editTimeShareAdminPage.vue'

import UserRoles from '../components/user/Roles/userRoles.vue'

import htmlPreview from '../components/marketing/htmlPreview.vue'

Vue.use(VueHead)
Vue.use(Router)

export default new Router({
    // eslint-disable-next-line no-unused-vars
    scrollBehavior(to, from, savedPosition) {
        return {
            x: 0,
            y: 0,
        }
    },
    routes: [{
            path: '/',
            name: 'Home',
            component: HomePage,
        },
        {
            path: '/shared/alert',
            name: 'AlertPage',
            component: AlertPage,
        },
        {
            path: '/about/us',
            name: 'aboutus',
            component: AboutUs,
        },
        {
            path: '/about/timeshare',
            name: 'abouttimeshare',
            component: AboutTimeshare,
        },
        {
            path: '/share/contact',
            name: 'Contact',
            component: Contact,
        },
        {
            path: '/communication/template',
            name: 'template',
            component: TemplatePage,
        },
        {
            path: '/timeshare/sell',
            name: 'TimeshareSell',
            component: TimeshareSell,
        },
        {
            path: '/timeshare/buy',
            name: 'TimeshareBuy',
            component: TimeshareBuy,
        },
        {
            path: '/timeshare/faq',
            name: 'TimeshareFAQ',
            component: TimeshareFAQ,
        },
        {
            path: '/timeshare/myWeeks',
            name: 'MyWeeks',
            component: MyWeeksPage,
        },
        {
            path: '/user/login',
            name: 'Login',
            props: (route) => ({
                ...route.params,
            }),
            component: Login,
        },
        {
            path: '/user/updateProfileInfo',
            name: 'UpdateInfo',
            props: (route) => ({
                ...route.params,
            }),
            component: UpdateInfo,
        },
        {
            path: '/user/changePasswordOnLogin',
            name: 'PasswordOnLogin',
            component: PasswordOnLogin,
        },
        {
            path: '/user/register',
            name: 'PrivateIndividual',
            component: PrivateIndividual,
        },
        {
            path: '/user/registeragency',
            name: 'Agency',
            component: Agency,
        },
        {
            path: '/property/property/:id',
            name: 'PropertyPage',
            component: PropertyPage,
        },
        {
            path: '/property/list',
            name: 'ListProperty',
            component: ListProperty,
        },
        {
            path: '/property/search',
            name: 'PropertySearchTab',
            component: PropertySearch,
        },
        {
            path: '/property/search/:propertyUsageType',
            name: 'PropertySearchTabType',
            component: PropertySearch,
        },
        {
            path: '/property/new/:saleType',
            name: 'PropertyNew',
            component: PropertyCreate,
        },
        {
            path: '/property/new/:propertyUsageType/:saleType',
            name: 'PropertyNewFromSearch',
            component: PropertyCreate,
        },
        {
            path: '/property/edit/:id',
            name: 'PropertyEdit',
            component: PropertyEdit,
        },
        {
            path: '/PropertyAdmin',
            name: 'PropertyAdminList',
            component: PropertyAdminList,
        },
        {
            path: '/propertyTypes/list',
            name: 'PropertyTypeList',
            component: PropertyTypeList,
        },
        {
            path: '/propertyType/new',
            name: 'PropertyTypeNew',
            component: PropertyType,
        },
        {
            path: '/propertyType/:id',
            name: 'PropertyTypeEdit',
            component: PropertyType,
        },
        {
            path: '/propertyManagement',
            name: 'PropertyManagement',
            component: PropertyManagement,
        },
        {
            path: '/rentalPropertyManagement',
            name: 'RentalPropertyManagement',
            component: RentalPropertyManagement,
        },
        {
            path: '/property/residential',
            name: 'ResidentialPage',
            component: ResidentialPage,
        },
        {
            path: '/property/commercial',
            name: 'CommercialPage',
            component: CommercialPage,
        },
        {
            path: '/property/commercial/searchResult',
            name: 'CommercialSearchResults',
            component: CommercialSearchResults,
        },
        {
            path: '/property/residential/searchResult',
            name: 'ResidentialSearchResults',
            component: ResidentialSearchResults,
        },
        {
            path: '/property/commercial/property/:id',
            name: 'SingleCommercialPage',
            component: SingleCommercialPage,
        },
        {
            path: '/property/commercial/new/:saleType',
            name: 'CommercialCreate',
            component: CommercialCreate,
        },
        {
            path: '/property/residential/new/:saleType',
            name: 'ResidentialCreate',
            component: ResidentialCreate,
        },
        {
            path: '/property/residential/property/:id',
            name: 'SingleResidentialPage',
            component: SingleResidentialPage,
        },
        {
            path: '/userDefinedGroups/list',
            name: 'UserDefinedGroupsList',
            component: UserDefinedGroups,
        },
        {
            path: '/userDefinedGroups/userDefinedGroup/:id',
            name: 'UserDefinedGroupEdit',
            component: UserDefinedGroup,
        },
        {
            path: '/userDefinedGroups/userDefinedGroup',
            name: 'UserDefinedGroupNew',
            component: UserDefinedGroup,
        },
        {
            path: '/status/list',
            name: 'StatusList',
            component: Status,
        },
        {
            path: '/status/timeshareAdmin',
            name: 'TimeshareAdmin',
            component: timeshareAdminPage,
        },
        {
            path: '/status/tenderWeekAdmin',
            name: 'TenderWeekAdmin',
            component: tenderWeekAdminPage,
        },
        {
            path: '/status/userManagementPage',
            name: 'userManagementPage',
            component: userManagementPage,
        },
        {
            path: '/status/agentUserManagementPage',
            name: 'agentManagementPage',
            component: agentManagementPage,
        },
        {
            path: '/status/agencyUserManagementPage',
            name: 'agencyManagementPage',
            component: agencyManagementPage,
        },
        {
            path: '/status/changeLogPage',
            name: 'changeLogPage',
            component: changeLogPage,
        },
        {
            path: '/unitConfiguration/list',
            name: 'UnitConfiguration',
            component: UnitConfiguration,
        },
        {
            path: '/contactUsSource/list',
            name: 'ContactUsSourceList',
            component: ContactUsSourceList,
        },
        {
            path: '/contactUsSource/new',
            name: 'ContactUsSourceNew',
            component: ContactUsSource,
        },
        {
            path: '/contactUsSource/:id',
            name: 'ContactUsSourceEdit',
            component: ContactUsSource,
        },
        {
            path: '/privacypolicy',
            name: 'PrivacyPolicy',
            component: PrivacyPolicy,
        },
        {
            path: '/websitedisclaimer',
            name: 'WebsiteDisclaimer',
            component: WebsiteDisclaimer,
        },
        {
            path: '/resort/:resortCode',
            name: 'ResortPage',
            component: ResortPage,
            props: true,
        },
        {
            path: '/resort/:resortCode/:unitNumber',
            name: 'UnitPage',
            component: UnitPage,
            props: true,
        },
        {
            path: '/timeshare/:weekId',
            name: 'TimeshareSellEdit',
            component: TimeshareSell,
            props: true,
        },
        {
            path: '/MakeOffer',
            name: 'MakeOffer',
            component: MakeOffer,
        },
        {
            path: '/Offers',
            name: 'Offers',
            component: Offer,
        },
        {
            path: '/timesharesearch',
            name: 'TimeshareSearch',
            component: TimeshareSearch,
        },
        {
            path: '/searchLog',
            name: 'SearchLog',
            component: searchLog,
        },
        {
            path: '/fees',
            name: 'fees',
            component: Fees,
        },
        {
            path: '/termsConditions',
            name: 'termsConditions',
            component: TermsConditions,
        },
        {
            path: '/termsConditionsView',
            name: 'termsConditionsView',
            component: TermsConditionsView,
        },
        {
            path: '/carousel',
            name: 'carousel',
            component: CarouselList,
        },
        {
            path: '/carousel/details/:id',
            name: 'CarouselDetails',
            component: CarouselDetail,
        },
        {
            path: '/property/propertySearch/results',
            name: 'PropertySearchResults',
            component: PropertySearchResults,
        },
        {
            path: '/payments/paymentGateway',
            name: 'PaymentGateway',
            props: (route) => ({
                ...route.params,
            }),
            component: PaymentGateway,
        },
        {
            path: '/payments/success',
            name: 'PaymentSuccess',
            component: PaymentSuccess,
        },
        {
            path: '/payments/error/:id',
            name: 'PaymentError',
            component: PaymentError,
        },
        {
            path: '/payments',
            name: 'Payments',
            component: Payments,
        },
        {
            path: '/campaignUpload',
            name: 'CampaignUpload',
            component: CampaignUpload,
        },
        {
            path: '/landingPages',
            name: 'LandingPages',
            component: LandingPages,
        },
        {
            path: '/newLandingPage',
            name: 'newLandingPage',
            component: NewLandingPage,
        },
        {
            path: '/landingPage/:id',
            name: 'LandingPage',
            component: LandingPage,
        },
        {
            path: '/landingPageProperty/:id',
            name: 'LandingPageProperty',
            component: LandingPageProperty,
        },
        {
            path: '/landingPage/week/:id',
            name: 'LandingPageWeek',
            component: LandingPageWeek,
        },
        {
            path: '/MarketingCampaign/:id',
            name: 'MarketingPage',
            component: MarketingPage,
        },
        {
            path: '/CampaignExpired',
            name: 'CampaignExpired',
            component: MarketingPageExp,
        },
        {
            path: '/EnquireNow/:id',
            name: 'EnquireNow',
            component: EnquireNow,
        },
        {
            path: '/timeshareToByResults',
            name: 'ToBuySearch',
            component: ToBuySearch,
        },
        {
            path: '/UserRoles',
            name: 'UserRoles',
            component: UserRoles,
        },
        {
            path: '/editTimeShare',
            name: 'EditTimeshare',
            props: (route) => ({
                ...route.params,
            }),
            component: MyWeeksEdit,
        },
        {
            path: '/htmlPreview',
            name: 'HtmlPreview',
            props: (route) => ({
                ...route.params,
            }),
            component: htmlPreview,
        },
        {
            path: '/user/forgotPassword',
            name: 'forgotPassword',
            component: ForgotPassword,
        },
        {
            path: '/forgotPasswordReset/:token',
            name: 'ForgotPasswordReset',
            component: ForgotPasswordReset,
        },
        {
            path: '/emailTemplates',
            name: 'emailTemplates',
            component: EmailTemplates,
        },
        {
            path: '/emailTemplates/Edit/:id',
            name: 'emailTemplateEdit',
            component: EmailTemplateEdit,
        },
        {
            path: '/emailTemplates/New/',
            name: 'emailTemplateNew',
            component: EmailTemplateNew,
        },
        {
            path: '/emailRecipient',
            name: 'emailRecipient',
            component: EmailRecipient,
        },
        {
            path: '/emailRecipient/new',
            name: 'emailRecipientNew',
            component: EmailRecipientNew,
        },
        {
            path: '/emailRecipient/Edit/:id',
            name: 'emailRecipientEdit',
            component: EmailRecipientEdit,
        },
        {
            path: '/enquireNowLog',
            name: 'enquireNowLog',
            component: EnquireNowLog,
        },
        {
            path: '/contactUsLog',
            name: 'contactUsLog',
            component: ContactUsLog,
        },
        {
            path: '/status/new',
            name: 'statusNew',
            component: StatusNew,
        },
        {
            path: '/financial/paymentOption',
            name: 'PaymentOption',
            props: (route) => ({
                ...route.params,
            }),
            component: PaymentOption,
        },
        {
            path: '/status/Edit/:id',
            name: 'statusEdit',
            component: StatusNew,
        },
        {
            path: '/financial/eftPage',
            name: 'EFTPage',
            props: (route) => ({
                ...route.params,
            }),
            component: EFTPage,
        },
        {
            path: '/user/agent/update',
            name: 'UpdateAgentProfile',
            props: (route) => ({
                ...route.params,
            }),
            component: UpdateAgentProfile,
        },
        {
            path: '/financial/payfast',
            name: 'PayFast',
            props: (route) => ({
                ...route.params,
            }),
            component: PayFast,
        },
    ],
})