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 _a2124f5c = () => interopDefault(import('..\\pages\\category\\index.vue' /* webpackChunkName: "pages/category/index" */))
const _44eea122 = () => interopDefault(import('..\\pages\\media.vue' /* webpackChunkName: "pages/media" */))
const _04fc68b5 = () => interopDefault(import('..\\pages\\product\\index.vue' /* webpackChunkName: "pages/product/index" */))
const _0015eacb = () => interopDefault(import('..\\pages\\setNewPassword.vue' /* webpackChunkName: "pages/setNewPassword" */))
const _deb5cc66 = () => interopDefault(import('..\\pages\\category\\searchResult\\index.vue' /* webpackChunkName: "pages/category/searchResult/index" */))
const _71def7d9 = () => interopDefault(import('..\\pages\\home\\api.vue' /* webpackChunkName: "pages/home/api" */))
const _0535c35f = () => interopDefault(import('..\\pages\\home\\contact.vue' /* webpackChunkName: "pages/home/contact" */))
const _4f1c215e = () => interopDefault(import('..\\pages\\home\\contactPromoCollection.vue' /* webpackChunkName: "pages/home/contactPromoCollection" */))
const _1588ec4a = () => interopDefault(import('..\\pages\\home\\currentFlyer\\index.vue' /* webpackChunkName: "pages/home/currentFlyer/index" */))
const _6a3cb08e = () => interopDefault(import('..\\pages\\home\\downloadCenter.vue' /* webpackChunkName: "pages/home/downloadCenter" */))
const _45855722 = () => interopDefault(import('..\\pages\\home\\loyaltyProgram.vue' /* webpackChunkName: "pages/home/loyaltyProgram" */))
const _44716754 = () => interopDefault(import('..\\pages\\home\\myDetail\\index.vue' /* webpackChunkName: "pages/home/myDetail/index" */))
const _728747d9 = () => interopDefault(import('..\\pages\\home\\privacyPolicy.vue' /* webpackChunkName: "pages/home/privacyPolicy" */))
const _ab5759ac = () => interopDefault(import('..\\pages\\home\\refundReturns.vue' /* webpackChunkName: "pages/home/refundReturns" */))
const _b86adf44 = () => interopDefault(import('..\\pages\\home\\termsConditions.vue' /* webpackChunkName: "pages/home/termsConditions" */))
const _7af6d314 = () => interopDefault(import('..\\pages\\home\\myDetail\\enquiryDetail.vue' /* webpackChunkName: "pages/home/myDetail/enquiryDetail" */))
const _31d2c1c1 = () => interopDefault(import('..\\pages\\home\\myDetail\\orderDetail.vue' /* webpackChunkName: "pages/home/myDetail/orderDetail" */))
const _1dc9f7fe = () => interopDefault(import('..\\pages\\home\\myDetail\\components\\orderDetailPart.vue' /* webpackChunkName: "pages/home/myDetail/components/orderDetailPart" */))
const _d58f99e0 = () => interopDefault(import('..\\pages\\index.vue' /* webpackChunkName: "pages/index" */))
const _7737dbd6 = () => interopDefault(import('..\\pages\\article\\_type.vue' /* webpackChunkName: "pages/article/_type" */))
const _1bd720ba = () => interopDefault(import('..\\pages\\category\\_firstCategory\\index.vue' /* webpackChunkName: "pages/category/_firstCategory/index" */))
const _738177e8 = () => interopDefault(import('..\\pages\\news\\_newsName.vue' /* webpackChunkName: "pages/news/_newsName" */))
const _4479f23b = () => interopDefault(import('..\\pages\\product-record\\_code.vue' /* webpackChunkName: "pages/product-record/_code" */))
const _06c719af = () => interopDefault(import('..\\pages\\product\\_code.vue' /* webpackChunkName: "pages/product/_code" */))
const _64fcd7ac = () => interopDefault(import('..\\pages\\qrcode\\_id.vue' /* webpackChunkName: "pages/qrcode/_id" */))
const _6e9eeb00 = () => interopDefault(import('..\\pages\\category\\_firstCategory\\_secondCategory\\index.vue' /* webpackChunkName: "pages/category/_firstCategory/_secondCategory/index" */))
const _512a51ba = () => interopDefault(import('..\\pages\\category\\_firstCategory\\_secondCategory\\_thirdCategory\\index.vue' /* webpackChunkName: "pages/category/_firstCategory/_secondCategory/_thirdCategory/index" */))
const _992bbe4e = () => interopDefault(import('..\\pages\\orderShare\\_uid\\_aid\\_id.vue' /* webpackChunkName: "pages/orderShare/_uid/_aid/_id" */))

const emptyFn = () => {}

Vue.use(Router)

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

  routes: [{
    path: "/category",
    component: _a2124f5c,
    name: "category"
  }, {
    path: "/media",
    component: _44eea122,
    name: "media"
  }, {
    path: "/product",
    component: _04fc68b5,
    name: "product"
  }, {
    path: "/setNewPassword",
    component: _0015eacb,
    name: "setNewPassword"
  }, {
    path: "/category/searchResult",
    component: _deb5cc66,
    name: "category-searchResult"
  }, {
    path: "/home/api",
    component: _71def7d9,
    name: "home-api"
  }, {
    path: "/home/contact",
    component: _0535c35f,
    name: "home-contact"
  }, {
    path: "/home/contactPromoCollection",
    component: _4f1c215e,
    name: "home-contactPromoCollection"
  }, {
    path: "/home/currentFlyer",
    component: _1588ec4a,
    name: "home-currentFlyer"
  }, {
    path: "/home/downloadCenter",
    component: _6a3cb08e,
    name: "home-downloadCenter"
  }, {
    path: "/home/loyaltyProgram",
    component: _45855722,
    name: "home-loyaltyProgram"
  }, {
    path: "/home/myDetail",
    component: _44716754,
    name: "home-myDetail"
  }, {
    path: "/home/privacyPolicy",
    component: _728747d9,
    name: "home-privacyPolicy"
  }, {
    path: "/home/refundReturns",
    component: _ab5759ac,
    name: "home-refundReturns"
  }, {
    path: "/home/termsConditions",
    component: _b86adf44,
    name: "home-termsConditions"
  }, {
    path: "/home/myDetail/enquiryDetail",
    component: _7af6d314,
    name: "home-myDetail-enquiryDetail"
  }, {
    path: "/home/myDetail/orderDetail",
    component: _31d2c1c1,
    name: "home-myDetail-orderDetail"
  }, {
    path: "/home/myDetail/components/orderDetailPart",
    component: _1dc9f7fe,
    name: "home-myDetail-components-orderDetailPart"
  }, {
    path: "/",
    component: _d58f99e0,
    name: "index"
  }, {
    path: "/article/:type?",
    component: _7737dbd6,
    name: "article-type"
  }, {
    path: "/category/:firstCategory",
    component: _1bd720ba,
    name: "category-firstCategory"
  }, {
    path: "/news/:newsName?",
    component: _738177e8,
    name: "news-newsName"
  }, {
    path: "/product-record/:code",
    component: _4479f23b,
    name: "product-record-code"
  }, {
    path: "/product/:code",
    component: _06c719af,
    name: "product-code"
  }, {
    path: "/qrcode/:id?",
    component: _64fcd7ac,
    name: "qrcode-id"
  }, {
    path: "/category/:firstCategory/:secondCategory",
    component: _6e9eeb00,
    name: "category-firstCategory-secondCategory"
  }, {
    path: "/category/:firstCategory/:secondCategory/:thirdCategory",
    component: _512a51ba,
    name: "category-firstCategory-secondCategory-thirdCategory"
  }, {
    path: "/orderShare/:uid?/:aid?/:id?",
    component: _992bbe4e,
    name: "orderShare-uid-aid-id"
  }],

  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
}
