<commit_before>export const state = () => ({
    mainFilter: 'question',
    activityTypeFilter: 'selectAll',
    questionOrderFilter: 'mostPopular',
    commitmentOrderFilter: 'mostPopular',
    eventInterestedOnly: false,
    periodOfTimeFilter: 'anyTime',
    regionFilter: null,
    topicFilter: [{id: 'allTopics'}],
    trustCircleFilter: 0
});

export const getters = {
    getFilterParams: state => {
        let params = {};
        if (state.mainFilter === 'activity') {
            if (state.activityTypeFilter !== 'selectAll') {
                params.typeFilter = state.activityTypeFilter;
            }
        }
        if (state.mainFilter === 'question') {
            params.order = state.questionOrderFilter;
            if (params.order === 'mostPopular' && state.periodOfTimeFilter !== 'anyTime') {
                params.periodOfTime = state.periodOfTimeFilter;
            }
        }
        if (state.mainFilter === 'commitment') {
            params.order = state.commitmentOrderFilter;
            if (params.order === 'mostPopular' && state.periodOfTimeFilter !== 'anyTime') {
                params.periodOfTime = state.periodOfTimeFilter;
            }
        }
        if (state.mainFilter === 'event') {
            if (state.eventInterestedOnly) {
                params.interestedOnly = true;
            }
        }
        if (state.regionFilter && state.regionFilter.id !== 'international' && state.mainFilter !== 'question') {
            params.regions = [state.regionFilter]
        }
        if (!(state.topicFilter.length === 1 && state.topicFilter[0].id === 'allTopics')) {
            params.topics = state.topicFilter.map(topic => topic.id);
        }
        if (state.trustCircleFilter > 0) {
            params.trustCircle = state.trustCircleFilter
        }
        return params;
    }
};

export const mutations = {
    SET_MAIN_FILTER(state, filter) {<commit_msg>Bugfix: Not sending trust circle for events.<commit_after>export const state = () => ({
    mainFilter: 'question',
    activityTypeFilter: 'selectAll',
    questionOrderFilter: 'mostPopular',
    commitmentOrderFilter: 'mostPopular',
    eventInterestedOnly: false,
    periodOfTimeFilter: 'anyTime',
    regionFilter: null,
    topicFilter: [{id: 'allTopics'}],
    trustCircleFilter: 0
});

export const getters = {
    getFilterParams: state => {
        let params = {};
        if (state.mainFilter === 'activity') {
            if (state.activityTypeFilter !== 'selectAll') {
                params.typeFilter = state.activityTypeFilter;
            }
        }
        if (state.mainFilter === 'question') {
            params.order = state.questionOrderFilter;
            if (params.order === 'mostPopular' && state.periodOfTimeFilter !== 'anyTime') {
                params.periodOfTime = state.periodOfTimeFilter;
            }
        }
        if (state.mainFilter === 'commitment') {
            params.order = state.commitmentOrderFilter;
            if (params.order === 'mostPopular' && state.periodOfTimeFilter !== 'anyTime') {
                params.periodOfTime = state.periodOfTimeFilter;
            }
        }
        if (state.mainFilter === 'event') {
            if (state.eventInterestedOnly) {
                params.interestedOnly = true;
            }
        }
        if (state.regionFilter && state.regionFilter.id !== 'international' && state.mainFilter !== 'question') {
            params.regions = [state.regionFilter]
        }
        if (!(state.topicFilter.length === 1 && state.topicFilter[0].id === 'allTopics')) {
            params.topics = state.topicFilter.map(topic => topic.id);
        }
        if (state.trustCircleFilter > 0 && state.mainFilter !== 'event') {
            params.trustCircle = state.trustCircleFilter
        }
        return params;
    }
};

export const mutations = {
    SET_MAIN_FILTER(state, filter) {
{'fraction_non_alphanumeric': 0.13100436681222707, 'fraction_numerical': 0.0020549704597996403, 'mean_word_length': 2.2208436724565757, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '5255530', 'n_tokens_mistral': 1082, 'n_tokens_neox': 1054, 'n_words': 200}