services:
    _instanceof:
        App\Service\Layout\Compiler\NodeCompilerInterface:
            tags:
                - app.node_compiler

        App\Service\Layout\Compiler\StampProcessorInterface:
            tags:
                - app.stamp_processor

    # Compiler
    app.layout.compiler.recursive:
        class: App\Service\Layout\Compiler\RecursiveCompiler
        arguments:
            - '@event_dispatcher'
            - !tagged_iterator app.node_compiler
            - !tagged_iterator app.stamp_processor

    app.layout.compiler.traceable:
        class: App\Service\Layout\Compiler\TraceableCompiler
        decorates: app.layout_compiler
        arguments:
            - '@.inner'
            - '@debug.stopwatch'

    app.layout_compiler:
        alias: app.layout.compiler.recursive

    App\Service\Layout\Compiler\CompilerInterface:
        alias: app.layout_compiler

    # Widget
    ## ArticleBox
    app.layout.widget.article_box.compiler:
        class: App\Service\Layout\Widget\ArticleBox\ArticleBoxCompiler
        arguments:
            - '@serializer'

    ## ArticlePage
    app.layout.widget.article_page.compiler:
        class: App\Service\Layout\Widget\ArticlePage\ArticlePageCompiler
        arguments:
            - '@serializer'

    ## Box
    app.layout.widget.box.compiler:
        class: App\Service\Layout\Widget\Box\BoxCompiler
        arguments:
            - '@serializer'

    ## Menu
    app.layout.widget.menu.compiler:
        class: App\Service\Layout\Widget\Menu\MenuCompiler
        arguments:
            - '@serializer'

    ## Page
    app.layout.widget.page.open_graph_article_stamp_processor:
        class: App\Service\Layout\Widget\Page\OpenGraph\Article\ArticleStampProcessor

    app.layout.widget.page.open_graph_image_stamp_processor:
        class: App\Service\Layout\Widget\Page\OpenGraph\Image\ImageStampProcessor

    app.layout.widget.page.open_graph_meta_stamp_processor:
        class: App\Service\Layout\Widget\Page\OpenGraph\Meta\MetaStampProcessor

    app.layout.widget.page.page_meta_stamp_processor:
        class: App\Service\Layout\Widget\Page\PageMeta\PageMetaStampProcessor

    app.layout.widget.page.twitter_meta_stamp_processor:
        class: App\Service\Layout\Widget\Page\Twitter\TwitterMetaStampProcessor

    app.layout.widget.page.compiler:
        class: App\Service\Layout\Widget\Page\PageCompiler
        arguments:
            - '@serializer'