// (C) 2021-2026 GoodData Corporation
const setDrillableItems = (state, action) => {
    const { items, tabId } = action.payload;
    if (!state.drillableItems[tabId]) {
        state.drillableItems[tabId] = [];
    }
    state.drillableItems[tabId] = items;
};
const crossFilterByWidget = (state, action) => {
    const { item, tabId } = action.payload;
    if (!state.crossFiltering[tabId]) {
        state.crossFiltering[tabId] = [];
    }
    state.crossFiltering[tabId] = [item];
};
const resetCrossFiltering = (state, action) => {
    if (action.payload) {
        state.crossFiltering[action.payload] = [];
    }
    else {
        Object.keys(state.crossFiltering).forEach((tabId) => {
            state.crossFiltering[tabId] = [];
        });
    }
};
export const drillReducers = {
    setDrillableItems,
    crossFilterByWidget,
    resetCrossFiltering,
};
//# sourceMappingURL=drillReducers.js.map