/* Import libraries. */
// import telr from '../../api/telr'

/* Import modules (getters). */
import getMasterIV from './profile/getters/getMasterIV' // FIXME: DO WE STILL NEED THIS??
import getMasterSeed from './profile/getters/getMasterSeed'

/* Import modules (actions). */
import destroyProfile from './profile/actions/destroyProfile'
import initProfile from './profile/actions/initProfile'
import updateMasterIV from './profile/actions/updateMasterIV' // FIXME: DO WE STILL NEED THIS??
import updateMasterSeed from './profile/actions/updateMasterSeed'

/* Import modules (mutations). */
import setEmptyProfile from './profile/mutations/setEmptyProfile'
import setMasterIV from './profile/mutations/setMasterIV' // FIXME: DO WE STILL NEED THIS??
import setMasterSeed from './profile/mutations/setMasterSeed'

/* Initialize state. */
const state = {
    /**
     * Master Initialization Vector
     *
     * A 16-byte seed, which can be generated randomly, or by importing
     * from an existing wallet.
     *
     * FIXME: Do we still need this??
     *        Or can we just derive from Master Seed??
     */
    miv: null,

    /**
     * Master Seed
     *
     * A 32-byte seed, which can be generated randomly, or by importing
     * from an existing wallet.
     */
    ms: null,
}

/* Getters. */
const getters = {
    getMasterIV,
    getMasterSeed,
}

/* Actions. */
const actions = {
    destroyProfile,
    initProfile,
    updateMasterIV,
    updateMasterSeed,
}

/* Mutations. */
const mutations = {
    setEmptyProfile,
    setMasterIV, // WARNING: This is a high risk attack vector.
    setMasterSeed, // WARNING: This is the highest risk attack vector.
}

/* Export. */
export default {
    namespaced: true,
    state,
    getters,
    actions,
    mutations
}
