import { isValid } from "@visactor/vutils";

import { TextHeaderStyle } from "./style/MultilineTextHeaderStyle";

import { Style } from "./style/Style";

import { CheckboxStyle } from "./style/CheckboxStyle";

export { Style, TextHeaderStyle };

export function of(headerStyle, defaultHeaderStyle, styleArg, StyleClass, globalAutoWrapText, theme) {
    var _a;
    return headerStyle || defaultHeaderStyle ? headerStyle instanceof Style ? headerStyle : "function" == typeof headerStyle ? of(headerStyle(styleArg), defaultHeaderStyle, styleArg, StyleClass, globalAutoWrapText, theme) : (headerStyle || (headerStyle = {}), 
    globalAutoWrapText && !isValid(headerStyle.autoWrapText) && (headerStyle.autoWrapText = !0), 
    StyleClass === CheckboxStyle ? new CheckboxStyle(null != headerStyle ? headerStyle : {}, null != defaultHeaderStyle ? defaultHeaderStyle : {}, null !== (_a = theme.checkboxStyle) && void 0 !== _a ? _a : {}) : new StyleClass(null != headerStyle ? headerStyle : {}, null != defaultHeaderStyle ? defaultHeaderStyle : {})) : StyleClass.DEFAULT;
}