'use strict';
Object.defineProperty(exports, '__esModule', {
    value: true
});
var isUnitlessNumber = {
    boxFlex: !(exports.default = void 0),
    boxFlexGroup: true,
    columnCount: true,
    flex: true,
    flexGrow: true,
    flexPositive: true,
    flexShrink: true,
    flexNegative: true,
    fontWeight: true,
    lineClamp: true,
    lineHeight: true,
    opacity: true,
    order: true,
    orphans: true,
    widows: true,
    zIndex: true,
    zoom: true,
    fillOpacity: true,
    strokeDashoffset: true,
    strokeOpacity: true,
    strokeWidth: true
};
function prefixKey(e, t) {
    return e + t.charAt(0).toUpperCase() + t.substring(1);
}
var prefixes = ['Webkit', 'ms', 'Moz', 'O'];
Object.keys(isUnitlessNumber).forEach(function (t) {
    prefixes.forEach(function (e) {
        isUnitlessNumber[prefixKey(e, t)] = isUnitlessNumber[t];
    });
});
var msPattern = /^ms-/;
var _uppercasePattern = /([A-Z])/g;
function hyphenate(e) {
    return e.replace(_uppercasePattern, '-$1').toLowerCase();
}
function hyphenateStyleName(e) {
    return hyphenate(e).replace(msPattern, '-ms-');
}
var isArray = Array.isArray;
var keys = Object.keys;
var unquotedContentValueRegex = /^(normal|none|(\b(url\([^)]*\)|chapter_counter|attr\([^)]*\)|(no-)?(open|close)-quote|inherit)((\b\s*)|$|\s+))+)$/;
function buildRule(e, t) {
    if (isUnitlessNumber[e] || 'number' != typeof t) {
        'content' !== e || unquotedContentValueRegex.test(t) || (t = "'" + t.replace(/'/g, "\\'") + "'");
    } else {
        t += 'px';
    }
    return hyphenateStyleName(e) + ': ' + t + ';  ';
}
function styleToCssString(e) {
    var t = '';
    if ('string' == typeof e) {
        return ';' === (e = e.trim()).slice(-1) ? ''.concat(e, ' ') : ''.concat(e, '; ');
    }
    if (!e || 0 === keys(e).length) {
        return t;
    }
    for (r = keys(e), n = 0, s = r.length, void 0; n < s; n++) {
        var r;
        var n;
        var s;
        var o = r[n];
        var i = e[o];
        if (isArray(i)) {
            for (a = 0, u = i.length, void 0; a < u; a++) {
                var a;
                var u;
                t += buildRule(o, i[a]);
            }
        } else {
            t += buildRule(o, i);
        }
    }
    return t;
}
var _default = styleToCssString;
exports.default = _default;
