import Vue from 'vue'
import Router from 'vue-router'
import { normalizeURL, decode } from 'ufo'
import { interopDefault } from './utils'
import scrollBehavior from './router.scrollBehavior.js'

const _2cb5a4ab = () => interopDefault(import('../pages/Addbox.vue' /* webpackChunkName: "pages/about/index" */))
const _1c6275f4 = () => interopDefault(import('../pages/paymentanddelivery.vue' /* webpackChunkName: "pages/about/index" */))
const _fb08c83e = () => interopDefault(import('../pages/index.vue' /* webpackChunkName: "pages/about/index" */))
const _39b5bfba = () => interopDefault(import('../pages/aboutus.vue' /* webpackChunkName: "pages/about/index" */))
const _0d319b5e = () => interopDefault(import('../pages/page-orlando-showroom.vue' /* webpackChunkName: "pages/about/index" */))
const _46028fae = () => interopDefault(import('../pages/termsandconditions.vue' /* webpackChunkName: "pages/about/index" */))
const _54366ef9 = () => interopDefault(import('../pages/page-for-dealers.vue' /* webpackChunkName: "pages/about/index" */))
const _3593c5e0 = () => interopDefault(import('../pages/cookiespolicy.vue' /* webpackChunkName: "pages/about/index" */))
const _d81d863a = () => interopDefault(import('../pages/blog.vue' /* webpackChunkName: "pages/blog/index" */))
const _69043d23 = () => interopDefault(import('../pages/blogCat.vue' /* webpackChunkName: "pages/blog/index" */))
const _1d47807f = () => interopDefault(import('../pages/career.vue' /* webpackChunkName: "pages/career/index" */))
const _57ee1f23 = () => interopDefault(import('../pages/page-contact.vue' /* webpackChunkName: "pages/about/index" */))
const _e76615fc = () => interopDefault(import('../pages/help.vue' /* webpackChunkName: "pages/about/index" */))
const _36f53760 = () => interopDefault(import('../pages/products/_id.vue' /* webpackChunkName: "pages/about/index" */))
const _1f27d42c = () => interopDefault(import('../pages/category/_id.vue' /* webpackChunkName: "pages/about/index" */))
const _2032610e = () => interopDefault(import('../pages/blog/_id.vue' /* webpackChunkName: "pages/about/index" */))
const _8878cd3e = () => interopDefault(import('../pages/cart.vue' /* webpackChunkName: "pages/cart" */))
const _fab02928 = () => interopDefault(import('../pages/checkout/address.vue' /* webpackChunkName: "pages/cart" */))
const _41d16cf7 = () => interopDefault(import('../pages/Check.vue' /* webpackChunkName: "pages/cart" */))
const _53cedf54 = () => interopDefault(import('../pages/Thankyou.vue' /* webpackChunkName: "pages/cart" */))
const _586fcab8 = () => interopDefault(import('../pages/page-installers.vue' /* webpackChunkName: "pages/cart" */))
const _dd16306a = () => interopDefault(import('../pages/search-product.vue' /* webpackChunkName: "pages/cart" */))
const _a8f6efc8 = () => interopDefault(import('../pages/account/dashboard/customer.vue' /* webpackChunkName: "pages/cart" */))
const _020ff679 = () => interopDefault(import('../pages/dealer/dashboard/dealer.vue' /* webpackChunkName: "pages/cart" */))
const _67658794 = () => interopDefault(import('../pages/thankyou.vue' /* webpackChunkName: "pages/cart" */))
const _7ffdfcd0 = () => interopDefault(import('../pages/BmwPartOrder.vue' /* webpackChunkName: "pages/cart" */))

const emptyFn = () => {}

Vue.use(Router)

export const routerOptions = {
  mode: 'history',
  base: '/',
  linkActiveClass: 'nuxt-link-active',
  linkExactActiveClass: 'nuxt-link-exact-active',
  scrollBehavior,

  routes: [{
    path: "/add",
    component: _2cb5a4ab,
    name: "home"
  }, {
    path: "/page-payment-and-delivery",
    component: _1c6275f4,
    name: "home"
  }, {
    path: "/",
    component: _fb08c83e,
    name: "home"
  }, {
    path: "/page-about-us",
    component: _39b5bfba,
    name: "About"
  }, {
    path: "/page-orlando-showroom",
    component: _0d319b5e,
    name: "Orlando"
  }, {
    path: "/page-terms-and-conditions",
    component: _46028fae,
    name: "termsandconditions"
  }, {
    path: "/page-for-dealers",
    component: _54366ef9,
    name: "page-for-dealers"
  }, {
    path: "/page-privacy-policy",
    component: _3593c5e0,
    name: "cookiespolicy"
  }, {
    path: "/blog",
    component: _d81d863a,
    name: "Blog"
  }, {
    path: "/blog-:id",
    component: _69043d23,
    name: "Blog"
  }, {
    path: "/career",
    component: _1d47807f,
    name: "Career"
  }, {
    path: "/page-contact",
    component: _57ee1f23,
    name: "Contact"
  }, {
    path: "/page-help",
    component: _e76615fc,
    name: "Help"
  }, {
    path: "/products-:id",
    component: _36f53760,
    name: "product"
  }, {
    path: "/category-:id",
    component: _1f27d42c,
    name: "category"
  }, {
    path: "/Blog/:id",
    component: _2032610e,
    name: "category"
  }, {
    path: "/cart",
    component: _8878cd3e,
    name: "cart"
  }, {
    path: "/checkout/address",
    component: _fab02928,
    name: "address"
  }, {
    path: "/check",
    component: _41d16cf7,
    name: "check"
  }, {
    path: "/thankyou",
    component: _53cedf54,
    name: "Thankyou"
  }, {
    path: "/page-installers",
    component: _586fcab8,
    name: "Installers"
  }, {
    path: "/search-product",
    component: _dd16306a,
    name: "Search"
  }, {
    path: "/account/dashboard",
    component: _a8f6efc8,
    name: "User"
  }, {
    path: "/dealer/dashboard",
    component: _020ff679,
    name: "User"
  }, {
    path: "/related_bmw-accessories_category_bmw-accessories_:id",
    component: _67658794,
    name: "User"
  }, {
    path: "/bmw-part-order",
    component: _7ffdfcd0,
    name: "User"
  }],

  fallback: false
}

export function createRouter (ssrContext, config) {
  const base = (config._app && config._app.basePath) || routerOptions.base
  const router = new Router({ ...routerOptions, base  })

  // TODO: remove in Nuxt 3
  const originalPush = router.push
  router.push = function push (location, onComplete = emptyFn, onAbort) {
    return originalPush.call(this, location, onComplete, onAbort)
  }

  const resolve = router.resolve.bind(router)
  router.resolve = (to, current, append) => {
    if (typeof to === 'string') {
      to = normalizeURL(to)
    }
    return resolve(to, current, append)
  }

  return router
}
