import VueRouter from 'vue-router'

import SchoolAdminDashboard from 'app/views/school-administrator/SchoolAdministratorComponent'
import SchoolAdminDashboardTeacherListView from 'app/views/school-administrator/teachers/SchoolAdminTeacherListView'
import SchoolAdminTeacherView from 'app/views/school-administrator/dashboard/SchoolAdminDashboardTeacherView'

import TeacherClassView from 'app/views/courses/TeacherClassView.vue'
import TeacherStudentView from 'app/views/teachers/classes/TeacherStudentView.vue'

import PageCinematicEditor from '../../ozaria/site/components/cinematic/PageCinematicEditor'
import PageCutsceneEditorList from '../../ozaria/site/components/cutscene/PageCutsceneEditorList'
import PageCutsceneEditor from '../../ozaria/site/components/cutscene/PageCutsceneEditor'
import PageInteractiveEditor from '../../ozaria/site/components/interactive/PageInteractiveEditor'

import CinematicPlaceholder from '../../ozaria/site/components/cinematic/CinematicPlaceholder'

let vueRouter

export default function getVueRouter () {
  if (typeof vueRouter === 'undefined') {
    vueRouter = new VueRouter({
      // Routing is currently driven by Backbone Router.  When we migrate away from backbone, switch to history
      mode: 'abstract',

      routes: [
        {
          // TODO: The cinematic editor route should use vue guards to check for admin access.
          // TODO: Once we have a base editor component, use the nested route structure.
          path: '/editor/cinematic/:slug?',
          component: PageCinematicEditor,
          props: true
        },
        {
          path: '/editor/cutscene',
          component: PageCutsceneEditorList
        },
        {
          path: '/editor/cutscene/:slugOrId',
          component: PageCutsceneEditor,
          props: true
        },
        {
          path: '/editor/interactive/:slug?',
          component: PageInteractiveEditor,
          props: true
        },
        {
          path: '/school-administrator',
          component: SchoolAdminDashboard,
          children: [
            { path: '', component: SchoolAdminDashboardTeacherListView },
            { path: 'teacher/:teacherId', component: SchoolAdminTeacherView },
            { path: 'teacher/:teacherId/classroom/:classroomId', component: TeacherClassView },
            { path: 'teacher/:teacherId/classroom/:classroomId/:studentId', component: TeacherStudentView }
          ]
        },
        {
          path: '/cinematicplaceholder/:levelSlug?',
          component: CinematicPlaceholder,
          props: (route) => {
            return {
              levelSlug: route.params.levelSlug
            }
          }
        }
      ]
    })
  }

  return vueRouter
}

@@ -33,962 +33,8 @@
 r'%0A%0A
-import SchoolAdminDashboard from 'app/views/school-administrator/SchoolAdministratorComponent'%0Aimport SchoolAdminDashboardTeacherListView from 'app/views/school-administrator/teachers/SchoolAdminTeacherListView'%0Aimport SchoolAdminTeacherView from 'app/views/school-administrator/dashboard/SchoolAdminDashboardTeacherView'%0A%0Aimport TeacherClassView from 'app/views/courses/TeacherClassView.vue'%0Aimport TeacherStudentView from 'app/views/teachers/classes/TeacherStudentView.vue'%0A%0Aimport PageCinematicEditor from '../../ozaria/site/components/cinematic/PageCinematicEditor'%0Aimport PageCutsceneEditorList from '../../ozaria/site/components/cutscene/PageCutsceneEditorList'%0Aimport PageCutsceneEditor from '../../ozaria/site/components/cutscene/PageCutsceneEditor'%0Aimport PageInteractiveEditor from '../../ozaria/site/components/interactive/PageInteractiveEditor'%0A%0Aimport CinematicPlaceholder from '../../ozaria/site/components/cinematic/CinematicPlaceholder'%0A%0A
 let 
@@ -568,24 +568,110 @@
  component: 
+() =%3E import(/* webpackChunkName: %22editor%22 */ '../../ozaria/site/components/cinematic/
 PageCinemati
@@ -673,24 +673,26 @@
 ematicEditor
+')
 ,%0A          
@@ -773,32 +773,117 @@
      component: 
+() =%3E import(/* webpackChunkName: %22editor%22 */ '../../ozaria/site/components/cutscene/
 PageCutsceneEdit
@@ -888,16 +888,18 @@
 itorList
+')
 %0A       
@@ -975,24 +975,109 @@
  component: 
+() =%3E import(/* webpackChunkName: %22editor%22 */ '../../ozaria/site/components/cutscene/
 PageCutscene
@@ -1078,24 +1078,26 @@
 tsceneEditor
+')
 ,%0A          
@@ -1196,16 +1196,104 @@
 ponent: 
+() =%3E import(/* webpackChunkName: %22editor%22 */ '../../ozaria/site/components/interactive/
 PageInte
@@ -1305,16 +1305,18 @@
 veEditor
+')
 ,%0A      
@@ -1414,36 +1414,126 @@
 ponent: 
-S
+() =%3E import(/* webpackChunkName: %22teachers%22 */ 'app/views/s
 chool
-A
+-a
 dmin
-Dashboard
+istrator/SchoolAdministratorComponent')
 ,%0A      
@@ -1587,28 +1587,108 @@
 nt: 
-S
+() =%3E import(/* webpackChunkName: %22teachers%22 */ 'app/views/s
 chool
-A
+-a
 dmin
-Dashboard
+istrator/teachers/SchoolAdmin
 Teac
@@ -1694,24 +1694,26 @@
 cherListView
+')
  %7D,%0A        
@@ -1757,16 +1757,106 @@
 ponent: 
+() =%3E import(/* webpackChunkName: %22teachers%22 */ 'app/views/school-administrator/dashboard/
 SchoolAd
@@ -1854,24 +1854,33 @@
 /SchoolAdmin
+Dashboard
 TeacherView 
@@ -1874,24 +1874,26 @@
 dTeacherView
+')
  %7D,%0A        
@@ -1956,24 +1956,91 @@
  component: 
+() =%3E import(/* webpackChunkName: %22teachers%22 */ 'app/views/courses/
 TeacherClass
@@ -2043,16 +2043,22 @@
 lassView
+.vue')
  %7D,%0A    
@@ -2140,16 +2140,92 @@
 ponent: 
+() =%3E import(/* webpackChunkName: %22teachers%22 */ 'app/views/teachers/classes/
 TeacherS
@@ -2234,16 +2234,22 @@
 dentView
+.vue')
  %7D%0A     
@@ -2350,16 +2350,100 @@
 ponent: 
+() =%3E import(/* webpackChunkName: %22play%22 */ '../../ozaria/site/components/cinematic/
 Cinemati
@@ -2454,16 +2454,18 @@
 ceholder
+')
 ,%0A      

Integrate lazy chunk loading with vue router