import Chat from '../components/chat.js'
import InternalMessages from "../components/internalMessagesSection.js"
import ModalDirectMessageClient from '../components/modals/modalDirectMessageClient.js'

$(() => {
    let chat = new Chat($("#chat-factura"))
    chat.init()
    chat.initFactura()
    if($("#internal_messages_chat").length > 0){
    let internalMessages = new InternalMessages($("#internal_messages_chat"))
    internalMessages.init()
    }
    if ($("#modalNewDirectMessageClient").length > 0) {

        let modalDirectMessageClient = new ModalDirectMessageClient("factura", $("#modalNewDirectMessageClient"))
        modalDirectMessageClient.init()
        $("#direct-message-cliente").on("click", () => {
            modalDirectMessageClient.modal.show()
        })
    }
})