from __future__ import annotations

from enum import StrEnum


class ModuleCodeEnum(StrEnum):
    """拆镜复刻模块编码。"""

    SHOT_REPLICATE = "shot_replicate"


class ShotReplicateStepCodeEnum(StrEnum):
    """拆镜复刻复用通用模块步骤编码。"""

    MATERIAL_INPUT = "material_input"
    IMAGE_PROMPT_OPTIMIZE = "image_prompt_optimize"
    IMAGE_GENERATE = "image_generate"
    VIDEO_PROMPT_OPTIMIZE = "video_prompt_optimize"
    VIDEO_GENERATE = "video_generate"


class ShotReplicateGenerationModeEnum(StrEnum):
    """复用 ChatGenerationTask 时使用的 generation_mode。"""

    SHOT_REPLICATE = "shot_replicate"


class ShotReplicateStepIOSchemaVersionEnum(StrEnum):
    """拆镜复刻子任务 input_json/output_json 结构版本。"""

    V1 = "shot_replicate_step_io_v1"


class ShotTaskSetStatusEnum(StrEnum):
    """拆镜总任务集状态。"""

    PENDING_ANALYSIS = "pending_analysis"
    ANALYZING = "analyzing"
    ANALYSIS_COMPLETED = "analysis_completed"
    ANALYSIS_FAILED = "analysis_failed"
    SPLITTING = "splitting"
    SPLIT_COMPLETED = "split_completed"
    PARTIAL_FAILED = "partial_failed"
    FAILED = "failed"
    DELETED = "deleted"


class ShotAnalysisStatusEnum(StrEnum):
    """原视频/片段视频分析状态。"""

    PENDING = "pending"
    PROCESSING = "processing"
    COMPLETED = "completed"
    FAILED = "failed"


class ShotSplitStatusEnum(StrEnum):
    """ffmpeg 拆镜状态。"""

    NONE = "none"
    PENDING = "pending"
    PROCESSING = "processing"
    COMPLETED = "completed"
    FAILED = "failed"
    RETRY_WAITING = "retry_waiting"


class ShotSegmentSourceModeEnum(StrEnum):
    """拆镜片段来源。"""

    AI_SUGGESTION = "ai_suggestion"
    CUSTOM = "custom"


class ShotSegmentAnalysisStatusEnum(StrEnum):
    """拆镜片段分析状态。"""

    NOT_REQUIRED = "not_required"
    PENDING = "pending"
    PROCESSING = "processing"
    COMPLETED = "completed"
    FAILED = "failed"


class ShotSegmentReplicateStatusEnum(StrEnum):
    """拆镜片段进入复刻流程后的状态。"""

    NOT_STARTED = "not_started"
    PROJECT_CREATED = "project_created"
    PROCESSING = "processing"
    COMPLETED = "completed"
    FAILED = "failed"
