"""Runtime edition selection shared by source and packaged entry points."""

from __future__ import annotations

import os


TRIAL_ENVIRONMENT_VARIABLE = "MUSICGRIDSTUDIO_EDITION"
TRIAL_MAX_USER_PLAYLISTS = 1
TRIAL_MAX_TRACKS_PER_PLAYLIST = 20


def is_trial_edition() -> bool:
    return (
        os.environ.get(TRIAL_ENVIRONMENT_VARIABLE, "full").strip().casefold()
        == "trial"
    )


def product_name() -> str:
    return "MusicGridStudio Trial" if is_trial_edition() else "MusicGridStudio"
