import Alpine from 'alpinejs'
import { adminApp } from './components/adminApp'
import { postEditorComponent, initPostEditor } from './components/postEditor'
import { pageBuilderComponent } from './components/pageBuilder'
import { mediaManager } from './components/mediaManager'
import { contentTypeBuilder } from './components/contentTypeBuilder'
import { menuEditor } from './components/menuEditor'
import { postsManager } from './components/postsManager'
import { postForm } from './components/postForm'
import { pluginsManager } from './components/pluginsManager'
import { themesManager } from './components/themesManager'
import { usersManager } from './components/usersManager'
import { menusManager } from './components/menusManager'
import { contentTypesManager } from './components/contentTypesManager'
import { settingsManager } from './components/settingsManager'
import { taxonomiesManager } from './components/taxonomiesManager'
import { selectSearch } from './components/selectSearch'
import { sliderEditor, sliderForm, slidersManager } from './components/sliderEditor'
import { editorImagePicker } from './components/editorImagePicker'
import { logsManager } from './components/logsManager'
import { statsChart } from './components/statsChart'

window.Alpine = Alpine
window.initPostEditor = initPostEditor

document.addEventListener('alpine:init', () => {
    Alpine.data('adminApp', adminApp)
    Alpine.data('postEditor', postEditorComponent)
    Alpine.data('pageBuilder', pageBuilderComponent)
    Alpine.data('mediaManager', mediaManager)
    Alpine.data('contentTypeBuilder', contentTypeBuilder)
    Alpine.data('menuEditor', menuEditor)
    Alpine.data('postsManager', postsManager)
    Alpine.data('postForm', postForm)
    Alpine.data('pluginsManager', pluginsManager)
    Alpine.data('themesManager', themesManager)
    Alpine.data('usersManager', usersManager)
    Alpine.data('menusManager', menusManager)
    Alpine.data('contentTypesManager', contentTypesManager)
    Alpine.data('settingsManager', settingsManager)
    Alpine.data('taxonomiesManager', taxonomiesManager)
    Alpine.data('selectSearch', selectSearch)
    Alpine.data('sliderEditor', sliderEditor)
    Alpine.data('sliderForm', sliderForm)
    Alpine.data('slidersManager', slidersManager)
    Alpine.data('editorImagePicker', editorImagePicker)
    Alpine.data('logsManager', logsManager)
    Alpine.data('statsChart', statsChart)
})

Alpine.start()
