function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _object_spread(target) {
    for(var i = 1; i < arguments.length; i++){
        var source = arguments[i] != null ? arguments[i] : {};
        var ownKeys = Object.keys(source);
        if (typeof Object.getOwnPropertySymbols === "function") {
            ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
                return Object.getOwnPropertyDescriptor(source, sym).enumerable;
            }));
        }
        ownKeys.forEach(function(key) {
            _define_property(target, key, source[key]);
        });
    }
    return target;
}
function ownKeys(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
        var symbols = Object.getOwnPropertySymbols(object);
        if (enumerableOnly) {
            symbols = symbols.filter(function(sym) {
                return Object.getOwnPropertyDescriptor(object, sym).enumerable;
            });
        }
        keys.push.apply(keys, symbols);
    }
    return keys;
}
function _object_spread_props(target, source) {
    source = source != null ? source : {};
    if (Object.getOwnPropertyDescriptors) {
        Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
    } else {
        ownKeys(Object(source)).forEach(function(key) {
            Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
        });
    }
    return target;
}
import { useEditorStyleRegister } from "../../../Hooks/useStyle";
var genStyle = function(token) {
    return _define_property({}, token.componentCls, {
        // 统计数据容器样式
        '&-statistic-container': {
            display: 'flex',
            gap: '16px',
            marginBottom: '16px',
            flexWrap: 'wrap',
            alignItems: 'flex-start'
        },
        // 柱状图容器样式
        '.chart-wrapper': {
            width: '100%',
            height: 'calc(100% - 120px)',
            minHeight: 300,
            display: 'flex',
            alignItems: 'center',
            justifyContent: 'center',
            overflow: 'hidden'
        },
        // 确保图表不会超出容器边界
        canvas: {
            maxWidth: '100% !important',
            maxHeight: '100% !important'
        },
        // 移动端响应式样式
        '@media (max-width: 768px)': {
            // 移动端优化
            '.chart-wrapper': {
                height: 'calc(100% - 100px)',
                minHeight: 250
            },
            // 移动端图表标题样式优化
            '.chart-title': {
                fontSize: 14,
                marginBottom: 8,
                textAlign: 'center'
            },
            // 移动端筛选器样式优化
            '.chart-filter': {
                flexWrap: 'wrap',
                gap: 8,
                marginBottom: 12,
                '.filter-button': {
                    fontSize: 12,
                    padding: '6px 12px'
                }
            }
        },
        // 超小屏幕优化 (375px以下)
        '@media (max-width: 375px)': {
            padding: 8,
            '.chart-wrapper': {
                minHeight: 220
            }
        }
    });
};
export function useStyle(prefixCls) {
    return useEditorStyleRegister('BarChart', function(token) {
        var barToken = _object_spread_props(_object_spread({}, token), {
            componentCls: ".".concat(prefixCls)
        });
        return [
            genStyle(barToken)
        ];
    });
}
