export const state = () => ({
  sidebarShow: 'responsive',
  sidebarMinimize: false,
  adminWS: false,
  unreadCuMsgs: 0,
  unreadTickets: 0,
  newCustomers: 0,
  newRepresentations: 0,
  newPieceRequests: 0,
  newOldPieceRequests: 0,
  newBufferRequests: 0,
  newGuaranteeReports: 0,
  newComplaintReports: 0,
  verityProducts: [],
  panatechProducts: [],
  iranProvinces: [],
  iranCities: []
})

export const mutations = {
  toggleSidebarDesktop(state) {
    const sidebarOpened = [true, 'responsive'].includes(state.sidebarShow)
    state.sidebarShow = sidebarOpened ? false : 'responsive'
  },
  toggleSidebarMobile(state) {
    const sidebarClosed = [false, 'responsive'].includes(state.sidebarShow)
    state.sidebarShow = sidebarClosed ? true : 'responsive'
  },
  set(state, [variable, value]) {
    state[variable] = value
  }
}
