"use strict";
// @ts-nocheck
exports.__esModule = true;
exports.Title = exports.cnTitle = exports.typographyPropWeight = exports.typographyPropSpacing = exports.typographyPropSizeDefault = exports.typographyPropSize = exports.typographyPropDisplay = void 0;
var tslib_1 = require("tslib");
require("./Title.css");
var react_1 = (0, tslib_1.__importDefault)(require("react"));
var react_router_dom_1 = require("react-router-dom");
var bem_1 = require("../../../utils/bem");
var borderImageBase64_1 = require("../../../utils/borderImageBase64");
var PropsWithAsAttributes_1 = require("../../../utils/types/PropsWithAsAttributes");
exports.typographyPropDisplay = ['block', 'inlineBlock', 'inline'];
exports.typographyPropSize = ['tiny', 'hg', 'lg', 'md', 'sm'];
exports.typographyPropSizeDefault = exports.typographyPropSize[0];
exports.typographyPropSpacing = ['xs', 's', 'm', 'l'];
exports.typographyPropWeight = ['bold'];
exports.cnTitle = (0, bem_1.cn)('Title');
exports.Title = (0, PropsWithAsAttributes_1.forwardRefWithAs)(function (props, ref) {
    var _a = props.as, as = _a === void 0 ? 'div' : _a, display = props.display, font = props.font, _b = props.size, size = _b === void 0 ? exports.typographyPropSizeDefault : _b, spacing = props.spacing, _c = props.weight, weight = _c === void 0 ? 'bold' : _c, color = props.color, className = props.className, children = props.children, parse = props.parse, inverted = props.inverted, otherProps = (0, tslib_1.__rest)(props, ["as", "display", "font", "size", "spacing", "weight", "color", "className", "children", "parse", "inverted"]);
    var Tag = as;
    if (Tag === 'link') {
        return (react_1["default"].createElement(react_router_dom_1.Link, (0, tslib_1.__assign)({}, otherProps, { className: (0, exports.cnTitle)({
                display: display,
                font: font,
                size: size,
                spacing: spacing,
                weight: weight,
                color: color,
                inverted: inverted
            }, [className]), ref: ref }), parse ? (0, borderImageBase64_1.parseContent)(children) : children));
    }
    return (react_1["default"].createElement(Tag, (0, tslib_1.__assign)({}, otherProps, { className: (0, exports.cnTitle)({
            display: display,
            font: font,
            size: size,
            spacing: spacing,
            weight: weight,
            inverted: inverted
        }, [className]), ref: ref }), parse ? (0, borderImageBase64_1.parseContent)(children) : children));
});
