<commit_before>// messages
export const SEND_MESSAGE = 'SEND_MESSAGE'
export const RECEIVE_MESSAGE = 'RECEIVE_MESSAGE'
// user
export const UPDATE_USER = 'UPDATE_USER'
export const LOGIN = 'LOGIN'
export const LOGOUT = 'LOGOUT'
// modals
export const SHOW_MODAL = 'SHOW_MODAL'
export const HIDE_MODAL = 'SHOW_MODAL'
// prefs
export const TOGGLE_CHAT_PIN = 'TOGGLE_CHAT_PIN'
export const CHANGE_THEME = 'CHANGE_THEME'
export const RECEIVE_PREFS = 'RECEIVE_PREFS'
// sidebar
export const CHANGE_SIDEBAR_TAB = 'CHANGE_SIDEBAR_TAB'

export const MODALS = {
  LOGIN_MODAL: 'LOGIN_MODAL',
  PROFILE_MODAL: 'PROFILE_MODAL'
}

export const THEMES = {
  LIGHT: 'LIGHT',
  DARK: 'DARK'
}

export function sendMessage (text) {
  return { type: SEND_MESSAGE, text }
}

export function receiveMessage (message) {
  const { key, from, text, result } = message
  return { type: RECEIVE_MESSAGE, key, from, text, result }
}

export function updateUser (user) {
  return { type: UPDATE_USER, user }
}

export function login (email, password) {
  return { type: LOGIN, email, password } 
}

export function logout () {
  return { type: LOGOUT }
}

export function showModal (modal) {
  return { type: SHOW_MODAL, modal }
}

export function hideModal () {
  return { type: HIDE_MODAL }
}

export function toggleChatPin () {
  return { type: TOGGLE_CHAT_PIN }
}

export function changeTheme (theme) {
  return { type: CHANGE_THEME }
}

export function receivePreferences (prefs) {
  return { type: RECEIVE_PREFS, prefs }
}

export const changeSidebarTab = tab => ({ type: CHANGE_SIDEBAR_TAB, tab })<commit_msg>Reorganize actions and action creators.<commit_after>export const MODALS = {
  LOGIN_MODAL: 'LOGIN_MODAL',
  PROFILE_MODAL: 'PROFILE_MODAL'
}

export const THEMES = {
  LIGHT: 'LIGHT',
  DARK: 'DARK'
}

/* Messages */

export const SEND_MESSAGE = 'SEND_MESSAGE'
export const sendMessage = text => ({type: SEND_MESSAGE, text })

export const RECEIVE_MESSAGE = 'RECEIVE_MESSAGE'
export const receiveMessage = message => {
  const { key, from, text, result } = message
  return { type: RECEIVE_MESSAGE, key, from, text, result }
}

/* User */
export const UPDATE_USER = 'UPDATE_USER'
export const updateUser = user => ({ type: UPDATE_USER, user })

export const LOGIN = 'LOGIN'
export const login = (email, password) => ({ type: LOGIN, email, password })

export const LOGOUT = 'LOGOUT'
export const logout = () => ({ type: LOGOUT })

/* Modals */
export const SHOW_MODAL = 'SHOW_MODAL'
export const showModal = modal => ({ type: SHOW_MODAL, modal })

export const HIDE_MODAL = 'SHOW_MODAL'
export const hideModal = () => ({ type: HIDE_MODAL })

/* Preferences */
export const TOGGLE_CHAT_PIN = 'TOGGLE_CHAT_PIN'
export const toggleChatPin = () => ({ type: TOGGLE_CHAT_PIN })

export const CHANGE_THEME = 'CHANGE_THEME'
export const changeTheme = theme => ({ type: CHANGE_THEME })

export const RECEIVE_PREFS = 'RECEIVE_PREFS'
export const receivePreferences = prefs => ({ type: RECEIVE_PREFS, prefs })

/* Sidebar */
export const CHANGE_SIDEBAR_TAB = 'CHANGE_SIDEBAR_TAB'
export const changeSidebarTab = tab => ({ type: CHANGE_SIDEBAR_TAB, tab })
{'fraction_non_alphanumeric': 0.11263560944479897, 'fraction_numerical': 0.0, 'mean_word_length': 4.784132841328414, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4246060', 'n_tokens_mistral': 1111, 'n_tokens_neox': 1080, 'n_words': 304}