// (C) 2026 GoodData Corporation
import { insightVisualizationType, } from "@gooddata/sdk-model";
import { isGeoVisualizationUsingNewEngine, normalizeGeoInsightForRawExport } from "@gooddata/sdk-ui";
import { createExportExecutionDefinition } from "@gooddata/sdk-ui/internal";
export function prepareGeoRawExportDefinition({ baseExecutionDefinition, sourceInsight, filledInsight, workspace, settings, resolveDefaultDisplayFormRef, }) {
    if (!isGeoVisualizationUsingNewEngine(insightVisualizationType(sourceInsight), settings)) {
        return {
            executionDefinition: baseExecutionDefinition,
            filledInsight,
        };
    }
    const preparedExecutionInsight = normalizeGeoInsightForRawExport(sourceInsight, {
        resolveDefaultDisplayFormRef,
    });
    const preparedFilledInsight = normalizeGeoInsightForRawExport(filledInsight, {
        resolveDefaultDisplayFormRef,
    });
    return {
        executionDefinition: preparedExecutionInsight === sourceInsight
            ? baseExecutionDefinition
            : createExportExecutionDefinition(preparedExecutionInsight, workspace, baseExecutionDefinition),
        filledInsight: preparedFilledInsight,
    };
}
//# sourceMappingURL=prepareGeoRawExportDefinition.js.map