"""
Constants for the Games XBlock.

This module contains all constant values used throughout the Games XBlock,
including game types, field names, default values, error messages, and UI text.
"""


class GAME_TYPE:
    """Game type constants."""

    FLASHCARDS = "flashcards"
    MATCHING = "matching"
    VALID = [FLASHCARDS, MATCHING]


class DEFAULT:
    """Default values for XBlock fields."""

    MATCHING_TITLE = "Matching"
    FLASHCARDS_TITLE = "Flashcards"
    DISPLAY_NAME = "Games"
    GAME_TYPE = GAME_TYPE.MATCHING
    IS_SHUFFLED = False
    HAS_TIMER = False


class CARD_FIELD:
    """Card field names."""

    CARD_KEY = "id"
    TERM = "term"
    TERM_IMAGE = "term_image"
    DEFINITION = "definition"
    DEFINITION_IMAGE = "definition_image"
    ORDER = "order"


class CONTAINER_TYPE:
    """Container types for matching game."""

    TERM = "term"
    DEFINITION = "definition"


class UPLOAD:
    """File upload settings."""

    PATH_PREFIX = "games"


class CONFIG:
    """Configuration values."""

    RANDOM_STRING_LENGTH = 8
    SALT_LENGTH = 12  # Length of random salt added to obfuscated payloads
    MATCHES_PER_PAGE = 5  # Number of matches displayed per page
    ENCRYPTION_SALT = "gamesxblock_secure_salt_v1"  # Salt for encryption key generation
