# Path: pytablewriter/style/_font.py
# class FontSize(Enum):
#     NONE = "none"
#     TINY = "tiny"
#     SMALL = "small"
#     MEDIUM = "medium"
#     LARGE = "large"
# 
# class FontStyle(Enum):
#     NORMAL = "normal"
#     ITALIC = "italic"
# 
# class FontWeight(Enum):
#     NORMAL = "normal"
#     BOLD = "bold"
# 
# Path: pytablewriter/style/_style.py
# class DecorationLine(Enum):
# class ThousandSeparator(Enum):
# class VerticalAlign(Enum):
# class Style:
#     NONE = "none"
#     LINE_THROUGH = "line_through"
#     STRIKE = "strike"
#     UNDERLINE = "underline"
#     NONE = "none"  #: no thousands separator
#     COMMA = "comma"  #: ``','`` as thousands separator
#     SPACE = "space"  #: ``' '`` as thousands separator
#     UNDERSCORE = "underscore"  #: ``'_'`` as thousands separator
#     BASELINE = (1 << 0, "baseline")
#     TOP = (1 << 1, "top")
#     MIDDLE = (1 << 2, "middle")
#     BOTTOM = (1 << 3, "bottom")
#     def align_code(self):
#     def align_str(self):
#     def __init__(self, code, string):
# def _normalize_thousand_separator(value: Union[str, ThousandSeparator]) -> ThousandSeparator:
#     def align(self) -> Align:
#     def align(self, value: Align) -> None:
#     def vertical_align(self) -> VerticalAlign:
#     def decoration_line(self) -> DecorationLine:
#     def font_size(self) -> FontSize:
#     def font_style(self) -> FontStyle:
#     def font_weight(self) -> FontWeight:
#     def color(self) -> Optional[Color]:
#     def fg_color(self) -> Optional[Color]:
#     def bg_color(self) -> Optional[Color]:
#     def thousand_separator(self) -> ThousandSeparator:
#     def padding(self):
#     def padding(self, value: Optional[int]):
#     def __init__(self, **kwargs) -> None:
#     def __repr__(self) -> str:
#     def __eq__(self, other):
#     def __ne__(self, other):
#     def update(self, **kwargs) -> None:
#     def __update_color(self, initialize: bool, **kwargs) -> None:
#     def __update_font(self, initialize: bool, **kwargs) -> None:
#     def __update_align(self, initialize: bool, **kwargs) -> None:
#     def __update_misc(self, initialize: bool, **kwargs) -> None:
#     def __validate_attr(self, attr_name: str, expected_type) -> None:


import abc
from typing import Any, Optional, cast
from tcolorpy import tcolor
from ._font import FontSize, FontStyle, FontWeight
from ._style import Align, DecorationLine, Style, ThousandSeparator
        from ..writer import RstCsvTableWriter
        from ..writer import RstCsvTableWriter
        if value:
            if style.thousand_separator == ThousandSeparator.SPACE:
                value = value.replace(",", " ")
            elif style.thousand_separator == ThousandSeparator.UNDERSCORE:
                value = value.replace(",", "_")

        return value


class HtmlStyler(TextStyler):
    def _get_font_size_map(self):
        return {
            FontSize.TINY: "font-size:x-small",
            FontSize.SMALL: "font-size:small",
            FontSize.MEDIUM: "font-size:medium",
            FontSize.LARGE: "font-size:large",
        }


class LatexStyler(TextStyler):
    class Command:
        BOLD = r"\bf"
        ITALIC = r"\it"

    def get_additional_char_width(self, style: Style) -> int:
        width = 0

        if self.get_font_size(style):
            width += len(cast(str, self.get_font_size(style)))


# Path: pytablewriter/style/_font.py
# class FontSize(Enum):
#     NONE = "none"
#     TINY = "tiny"
#     SMALL = "small"
#     MEDIUM = "medium"
#     LARGE = "large"
# 
# class FontStyle(Enum):
#     NORMAL = "normal"
#     ITALIC = "italic"
# 
# class FontWeight(Enum):
#     NORMAL = "normal"
#     BOLD = "bold"
# 
# Path: pytablewriter/style/_style.py
# class DecorationLine(Enum):
# class ThousandSeparator(Enum):
# class VerticalAlign(Enum):
# class Style:
#     NONE = "none"
#     LINE_THROUGH = "line_through"
#     STRIKE = "strike"
#     UNDERLINE = "underline"
#     NONE = "none"  #: no thousands separator
#     COMMA = "comma"  #: ``','`` as thousands separator
#     SPACE = "space"  #: ``' '`` as thousands separator
#     UNDERSCORE = "underscore"  #: ``'_'`` as thousands separator
#     BASELINE = (1 << 0, "baseline")
#     TOP = (1 << 1, "top")
#     MIDDLE = (1 << 2, "middle")
#     BOTTOM = (1 << 3, "bottom")
#     def align_code(self):
#     def align_str(self):
#     def __init__(self, code, string):
# def _normalize_thousand_separator(value: Union[str, ThousandSeparator]) -> ThousandSeparator:
#     def align(self) -> Align:
#     def align(self, value: Align) -> None:
#     def vertical_align(self) -> VerticalAlign:
#     def decoration_line(self) -> DecorationLine:
#     def font_size(self) -> FontSize:
#     def font_style(self) -> FontStyle:
#     def font_weight(self) -> FontWeight:
#     def color(self) -> Optional[Color]:
#     def fg_color(self) -> Optional[Color]:
#     def bg_color(self) -> Optional[Color]:
#     def thousand_separator(self) -> ThousandSeparator:
#     def padding(self):
#     def padding(self, value: Optional[int]):
#     def __init__(self, **kwargs) -> None:
#     def __repr__(self) -> str:
#     def __eq__(self, other):
#     def __ne__(self, other):
#     def update(self, **kwargs) -> None:
#     def __update_color(self, initialize: bool, **kwargs) -> None:
#     def __update_font(self, initialize: bool, **kwargs) -> None:
#     def __update_align(self, initialize: bool, **kwargs) -> None:
#     def __update_misc(self, initialize: bool, **kwargs) -> None:
#     def __validate_attr(self, attr_name: str, expected_type) -> None:


# Path: pytablewriter/style/_styler.py
import abc
from typing import Any, Optional, cast
from tcolorpy import tcolor
from ._font import FontSize, FontStyle, FontWeight
from ._style import Align, DecorationLine, Style, ThousandSeparator
        from ..writer import RstCsvTableWriter
        from ..writer import RstCsvTableWriter

        if value:
            if style.thousand_separator == ThousandSeparator.SPACE:
                value = value.replace(",", " ")
            elif style.thousand_separator == ThousandSeparator.UNDERSCORE:
                value = value.replace(",", "_")

        return value


class HtmlStyler(TextStyler):
    def _get_font_size_map(self):
        return {
            FontSize.TINY: "font-size:x-small",
            FontSize.SMALL: "font-size:small",
            FontSize.MEDIUM: "font-size:medium",
            FontSize.LARGE: "font-size:large",
        }


class LatexStyler(TextStyler):
    class Command:
        BOLD = r"\bf"
        ITALIC = r"\it"

    def get_additional_char_width(self, style: Style) -> int:
        width = 0

        if self.get_font_size(style):
            width += len(cast(str, self.get_font_size(style)))


        if style.font_weight == FontWeight.BOLD: