function _array_like_to_array(arr, len) {
    if (len == null || len > arr.length) len = arr.length;
    for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
    return arr2;
}
function _array_with_holes(arr) {
    if (Array.isArray(arr)) return arr;
}
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 _iterable_to_array_limit(arr, i) {
    var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
    if (_i == null) return;
    var _arr = [];
    var _n = true;
    var _d = false;
    var _s, _e;
    try {
        for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
            _arr.push(_s.value);
            if (i && _arr.length === i) break;
        }
    } catch (err) {
        _d = true;
        _e = err;
    } finally{
        try {
            if (!_n && _i["return"] != null) _i["return"]();
        } finally{
            if (_d) throw _e;
        }
    }
    return _arr;
}
function _non_iterable_rest() {
    throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _sliced_to_array(arr, i) {
    return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
}
function _unsupported_iterable_to_array(o, minLen) {
    if (!o) return;
    if (typeof o === "string") return _array_like_to_array(o, minLen);
    var n = Object.prototype.toString.call(o).slice(8, -1);
    if (n === "Object" && o.constructor) n = o.constructor.name;
    if (n === "Map" || n === "Set") return Array.from(n);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
}
import { genStyleHooks } from "../../../Hooks/useStyle";
var genStyle = function genStyle(token) {
    var _obj;
    return _define_property({}, token.componentCls, (_obj = {
        display: 'flex',
        flexDirection: 'column',
        '&-toolbar-wrapper': _define_property({
            marginBottom: 16
        }, "@media (max-width: 768px)", {
            marginBottom: 12
        }),
        '&-content': _define_property({
            display: 'grid',
            gap: 16,
            gridTemplateColumns: 'repeat(auto-fit, minmax(var(--donut-item-min-width, 200px), 1fr))'
        }, "@media (max-width: 480px)", {
            gap: 8
        }),
        '&-toolbar': _define_property({
            display: 'flex',
            justifyContent: 'space-between',
            marginBottom: 8
        }, "@media (max-width: 768px)", {
            flexDirection: 'column',
            gap: 8,
            marginBottom: 6
        }),
        '&-chart-wrapper': _define_property({
            overflow: 'visible'
        }, "@media (max-width: 768px)", {
            marginBottom: 12
        }),
        '&-row': _define_property({
            display: 'flex',
            alignItems: 'center',
            flexDirection: 'row',
            overflow: 'visible'
        }, "@media (max-width: 768px)", {
            flexDirection: 'column',
            alignItems: 'stretch'
        }),
        '&-chart': _define_property({
            width: 'var(--donut-chart-width, 200px)',
            height: 'var(--donut-chart-height, 200px)',
            overflow: 'visible'
        }, "@media (max-width: 768px)", {
            alignSelf: 'center',
            marginBottom: 8
        }),
        '&-single': _define_property({
            width: '100%',
            height: 'var(--donut-chart-height, 200px)'
        }, "@media (max-width: 768px)", {
            height: 'var(--donut-chart-height, 180px)'
        }),
        '&-legend': _define_property({
            marginLeft: 12
        }, "@media (max-width: 768px)", {
            marginLeft: 0,
            marginTop: 8
        }),
        '&-legend-item': _define_property({
            display: 'flex',
            alignItems: 'center',
            fontSize: 12,
            padding: '4px 0'
        }, "@media (max-width: 768px)", {
            fontSize: 11,
            marginBottom: 4,
            padding: '4px 0',
            minHeight: '24px'
        }),
        '&-legend-color': _define_property({
            display: 'inline-block',
            width: 12,
            height: 12,
            borderRadius: 4,
            background: 'var(--donut-legend-color, #ccc)',
            marginRight: 6,
            flexShrink: 0
        }, "@media (max-width: 768px)", {
            width: 10,
            height: 10,
            borderRadius: 4,
            marginRight: 4
        }),
        '&-legend-label': _define_property({
            flex: 1,
            color: 'var(--color-gray-text-secondary)',
            fontSize: 13,
            whiteSpace: 'nowrap',
            overflow: 'hidden',
            textOverflow: 'ellipsis'
        }, "@media (max-width: 768px)", {
            fontSize: 11,
            flex: '0 1 auto',
            minWidth: '60px'
        }),
        '&-legend-value': _define_property({
            color: 'var(--color-gray-text-default)',
            fontSize: 13,
            fontWeight: 500,
            marginLeft: 15,
            display: 'flex',
            flexDirection: 'column',
            alignItems: 'flex-end'
        }, "@media (max-width: 768px)", {
            fontSize: 11,
            fontWeight: 400,
            marginLeft: 8
        }),
        '&-legend-percent': _define_property({
            marginLeft: 8,
            fontSize: 12,
            color: 'var(--color-gray-text-default)'
        }, "@media (max-width: 768px)", {
            marginLeft: 0,
            fontSize: 10,
            marginTop: 1
        }),
        '&-legend-pagination': {
            display: 'flex',
            alignItems: 'center',
            justifyContent: 'center',
            gap: 8,
            marginTop: 8,
            paddingTop: 8,
            borderTop: '1px solid rgba(0,0,0,0.06)'
        },
        '&-statistic-container': {
            display: 'flex',
            gap: '16px',
            marginBottom: '16px',
            flexWrap: 'wrap',
            alignItems: 'flex-start'
        }
    }, // 响应式网格调整
    _define_property(_obj, "@media (max-width: 768px)", {
        gap: 12,
        gridTemplateColumns: '1fr'
    }), _define_property(_obj, "@media (max-width: 480px)", {
        gap: 8
    }), _obj));
};
var useGenStyle = genStyleHooks('DonutChart', genStyle);
export function useStyle(prefixCls) {
    var _useGenStyle = _sliced_to_array(useGenStyle(prefixCls !== null && prefixCls !== void 0 ? prefixCls : 'DonutChart'), 2), wrapSSR = _useGenStyle[0], hashId = _useGenStyle[1];
    return {
        wrapSSR: wrapSSR,
        hashId: hashId
    };
}
