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 { css } from 'styled-components';
import { addFocus } from '../../mixins';
import { convertRoundnessMatrix } from '../../utils';
/**
 * Создание специализированного миксина со своими размерами и типографикой.
 * @param {Record<string, object>} sizes
 * @param {Record<string, object>} typos
 */ export var getButtonSizesMixin = function getButtonSizesMixin(sizes, typos) {
    return function(param) {
        var size = param.size, pin = param.pin, outlined = param.outlined, focused = param.focused, isContentLeft = param.$isContentLeft, isContentRight = param.$isContentRight, shiftLeft = param.shiftLeft, shiftRight = param.shiftRight, square = param.square, stretch = param.stretch, theme = param.theme;
        var paddingX = sizes[size].paddingX;
        if (square) {
            paddingX = sizes[size].paddingY;
        } else if (stretch) {
            paddingX = sizes[size].paddingStretchX;
        } else if (isContentLeft || isContentRight) {
            paddingX = sizes[size].paddingContentX;
        }
        return css([
            "height:",
            ";padding:",
            " ",
            ";border-radius:",
            ";",
            " ",
            " ",
            " ",
            " ",
            " ",
            ""
        ], sizes[size].height, sizes[size].paddingY, paddingX, convertRoundnessMatrix(pin, sizes[size].radius, sizes[size].radiusCircle), stretch && 'width: 100%;', square && " width: ".concat(sizes[size].height, ";"), shiftLeft && "margin-left: calc(-1 * ".concat(paddingX, ");"), shiftRight && "margin-right: calc(-1 * ".concat(paddingX, ");"), typos[size], addFocus(_object_spread_props(_object_spread({}, theme), {
            focused: focused,
            outlined: outlined,
            outlineRadius: convertRoundnessMatrix(pin, "calc(".concat(sizes[size].radius, " + var(--plasma-outline-size))"), "calc(".concat(sizes[size].radiusCircle, " + var(--plasma-outline-size))"))
        })));
    };
};
