import { jsx as _jsx } from "react/jsx-runtime";
// (C) 2025-2026 GoodData Corporation
import { memo } from "react";
import { messages } from "../../../../locales.js";
import { ConfigSection } from "../ConfigSection.js";
import { GeoLegendPositionControl } from "./GeoLegendPositionControl.js";
export const GeoLegendSection = memo(function GeoLegendSection({ controlsDisabled = false, properties = {}, propertiesMeta = {}, defaultLegendEnabled = true, pushData = () => { }, }) {
    const legendEnabled = properties?.controls?.["legend"]?.enabled ?? defaultLegendEnabled;
    const legendPosition = properties?.controls?.["legend"]?.position ?? "auto";
    const legendToggleDisabledByVisualization = !(propertiesMeta?.["legend_enabled"] ?? true);
    const toggleDisabled = controlsDisabled || legendToggleDisabledByVisualization;
    const legendPositionControlDisabled = !legendEnabled || toggleDisabled;
    const showDisabledMessage = controlsDisabled || legendToggleDisabledByVisualization;
    return (_jsx(ConfigSection, { id: "legend_section", valuePath: "legend.enabled", title: messages["title"].id, propertiesMeta: propertiesMeta, properties: properties, canBeToggled: true, toggleDisabled: toggleDisabled, toggledOn: legendEnabled, pushData: pushData, showDisabledMessage: showDisabledMessage, children: _jsx(GeoLegendPositionControl, { disabled: legendPositionControlDisabled, value: legendPosition, showDisabledMessage: showDisabledMessage, properties: properties, pushData: pushData }) }));
});
//# sourceMappingURL=GeoLegendSection.js.map