#
#   Imandra Inc.
#
#   speclogician/presentation/preview/fixtures/__init__.py
#

from __future__ import annotations

from speclogician.presentation.preview.registry import PreviewSpec, register

from . import state_diff
from . import state_instance_summary
from . import trace
from . import data_artifact
from . import artifact_container
from . import predicate
from . import scenario
from . import domain_model
from . import instances_list
from . import spec
from . import smart_find
from . import state_instance


def register_fixtures() -> None:

    # ------------------------------------------------------------------
    # State-level fixtures (already present)
    # ------------------------------------------------------------------

    register(
        PreviewSpec(
            name="state-diff",
            variants=("typical", "minimal", "edge"),
            make=state_diff.make_state_diff_pm,
            render=state_diff.render,
        )
    )

    register(
        PreviewSpec(
            name="state-instance-summary",
            variants=("typical", "minimal", "edge"),
            make=state_instance_summary.make_state_instance_summary_pm,
            render=state_instance_summary.render,
        )
    )

    # ------------------------------------------------------------------
    # Trace fixtures
    # ------------------------------------------------------------------

    register(
        PreviewSpec(
            name="test-trace",
            variants=("typical", "minimal", "edge"),
            make=trace.make_test_trace_pm,
            render=trace.render_test,
        )
    )

    register(
        PreviewSpec(
            name="log-trace",
            variants=("typical", "minimal", "edge"),
            make=trace.make_log_trace_pm,
            render=trace.render_log,
        )
    )

    # ------------------------------------------------------------------
    # Data artifact fixtures
    # ------------------------------------------------------------------


    register(
        PreviewSpec(
            name="doc-ref",
            variants=("typical", "minimal", "edge"),
            make=data_artifact.make_doc_ref_pm,
            render=data_artifact.render_doc,
        )
    )

    register(
        PreviewSpec(
            name="src-code-ref",
            variants=("typical", "minimal", "edge"),
            make=data_artifact.make_src_code_ref_pm,
            render=data_artifact.render_src,
        )
    )

    # ------------------------------------------------------------------
    # Artifact container fixtures
    # ------------------------------------------------------------------

    register(
        PreviewSpec(
            name="artifact-container",
            variants=("typical", "minimal", "edge"),
            make=artifact_container.make_artifact_container_pm,
            render=artifact_container.render,
        )
    )   

    # ------------------------------------------------------------------
    # Predicate/Transition fixtures
    # ------------------------------------------------------------------

    register(
        PreviewSpec(
            name="predicate",
            variants=("typical", "minimal", "edge"),
            make=predicate.make_predicate_pm,
            render=predicate.render_predicate,
        )
    )

    register(
        PreviewSpec(
            name="transition",
            variants=("typical", "minimal", "edge"),
            make=predicate.make_transition_pm,
            render=predicate.render_transition,
        )
    )

    # ------------------------------------------------------------------
    # Scenario fixture
    # ------------------------------------------------------------------

    register(
        PreviewSpec(
            name="scenario",
            variants=("typical", "minimal", "edge"),
            make=scenario.make_scenario_pm,
            render=scenario.render,
        )
    )

    # ------------------------------------------------------------------
    # DomainModel fixture
    # ------------------------------------------------------------------

    register(
        PreviewSpec(
            name="domain-model",
            variants=("typical", "minimal", "edge"),
            make=domain_model.make_domain_model_pm,
            render=domain_model.render,
        )
    )

    # ------------------------------------------------------------------
    # InstancesList fixture
    # ------------------------------------------------------------------

    register(
        PreviewSpec(
            name="instances-list",
            variants=("typical", "minimal", "edge"),
            make=instances_list.make_instances_list_pm,
            render=instances_list.render,
        )
    )

    # ------------------------------------------------------------------
    # Spec fixture
    # ------------------------------------------------------------------

    register(
        PreviewSpec(
            name="spec",
            variants=("typical", "minimal", "edge"),
            make=spec.make_spec_pm,
            render=spec.render,
        )
    )

    # ------------------------------------------------------------------
    # SmartFind
    # ------------------------------------------------------------------
    register(
        PreviewSpec(
            name="smart-find",
            variants=("typical", "minimal", "edge"),
            make=smart_find.make_smart_find_pm,
            render=smart_find.render,
        )
    )


    # ------------------------------------------------------------------
    # SmartFind
    # ------------------------------------------------------------------

    register(
        PreviewSpec(
            name="state-instance",
            variants=("typical", "minimal", "edge"),
            make=state_instance.make_state_instance_pm,
            render=state_instance.render,
        )
    )