"""Events defpage setup — registers layouts, page helpers, and loads .sx pages."""
from __future__ import annotations


def setup_events_pages() -> None:
    """Register events-specific layouts, page helpers, and load page definitions."""
    from .helpers import _register_events_layouts, _register_events_helpers
    _register_events_layouts()
    _register_events_helpers()
    _load_events_page_files()


def _load_events_page_files() -> None:
    import os
    from shared.sx.pages import load_page_dir
    from shared.sx.jinja_bridge import load_service_components
    sxc_dir = os.path.dirname(os.path.dirname(__file__))         # events/sxc/
    service_root = os.path.dirname(sxc_dir)                       # events/
    load_service_components(service_root, service_name="events")
    load_page_dir(os.path.dirname(__file__), "events")
