// (C) 2021-2025 GoodData Corporation
import { MAX_NEW_VISUALIZATION_HEIGHT, MIDDLE_VISUALIZATION_HEIGHT_FLEXIBLE_LAYOUT, MIN_VISUALIZATION_HEIGHT_FLEXIBLE_LAYOUT, } from "../constants.js";
import { addIntersectionFiltersToInsight, modifyBucketsAttributesForDrillDown } from "../drillDownUtil.js";
export class BaseChartDescriptor {
    getSizeInfo(_insight, layoutDescriptor, settings) {
        return {
            width: {
                default: 4,
                min: 2,
                max: layoutDescriptor.gridColumnsCount,
            },
            height: {
                default: this.getDefaultHeight(settings),
                min: this.getMinHeight(settings),
                max: this.getMaxHeight(settings),
            },
        };
    }
    getDefaultHeight(_settings) {
        // Flexible layout is always enabled now
        return MIDDLE_VISUALIZATION_HEIGHT_FLEXIBLE_LAYOUT;
    }
    getMinHeight(_settings) {
        // Flexible layout is always enabled now
        return MIN_VISUALIZATION_HEIGHT_FLEXIBLE_LAYOUT;
    }
    getMaxHeight(_settings) {
        // Flexible layout is always enabled now
        return MAX_NEW_VISUALIZATION_HEIGHT;
    }
    applyDrillDown(insight, drillDownContext, backendSupportsElementUris) {
        const intersection = drillDownContext.event.drillContext.intersection;
        const withFilters = addIntersectionFiltersToInsight(insight, intersection, backendSupportsElementUris);
        return modifyBucketsAttributesForDrillDown(withFilters, drillDownContext.drillDefinition);
    }
}
//# sourceMappingURL=BaseChartDescriptor.js.map