from typing import List
from typing import Set


def parse_playerlist(playerlist: str) -> List[str]:
    """Split playerlist input text into a list of players."""
    playerlist = playerlist.strip()
    if ('\n' in playerlist) or ('\r' in playerlist):
        playersplit = playerlist.replace('\r', '\n').split('\n')
    else:
        # all on one line => split by ','
        playersplit = playerlist.split(',')
    result = []
    result_as_set: Set[str] = set()
    for x in playersplit:
        x = x.strip()
        if x == '' or x.lower() in result_as_set:
            continue
        result.append(x)
        result_as_set.add(x.lower())
    return result