from typing import Union
from typing import Iterable
import itertools


def join_cs(*args: Union[Iterable[str], str]) -> str:
    """Return comma separated string from one or more comma separated strings or iterables of strings.

    It deals with empty strings and properly inserting comma's.

    See: `test_join_cs` for examples.

    Args:
        args: One or more comma separated strings or iterables that should be joined.

    Returns:
        A comma separated string.

    """

    def to_iterable(value: Union[Iterable[str], str]) -> Iterable[str]:
        if isinstance(value, str):
            return filter(None, value.split(","))
        return value

    return ",".join(itertools.chain(*map(to_iterable, args)))