services:
    _instanceof:
        Oro\Bundle\WebCatalogBundle\ContentNodeDeletionChecker\ContentNodeDeletionCheckerInterface:
            tags:
                - { name: 'content_node.deletion_checker' }
                
    oro_web_catalog.provider.web_catalog_usage_provider:
        class: Oro\Bundle\WebCatalogBundle\Provider\WebCatalogUsageProvider
        public: false
        arguments:
            - '@oro_config.manager'
            - '@doctrine'

    oro_web_catalog.cacheable_web_catalog_usage_provider:
        class: Oro\Bundle\WebCatalogBundle\Provider\CacheableWebCatalogUsageProvider
        public: false
        decorates: 'oro_web_catalog.provider.web_catalog_usage_provider'
        decoration_priority: -255 # the cacheable provider should be at the top of the decoration chain
        arguments:
            - '@.inner'

    oro_web_catalog.web_catalog_usage_listener:
        class: Oro\Bundle\WebCatalogBundle\EventListener\WebCatalogUsageListener
        arguments:
            - '@oro_web_catalog.cacheable_web_catalog_usage_provider'
        tags:
            - { name: kernel.event_listener, event: oro_config.update_after, method: onConfigurationUpdate }
            - { name: doctrine.event_listener, event: onFlush, priority: -255 }

    oro_web_catalog.acl.voter.web_catalog:
        class: Oro\Bundle\WebCatalogBundle\Acl\Voter\WebCatalogVoter
        arguments:
            - '@oro_entity.doctrine_helper'
            - '@Psr\Container\ContainerInterface'
        calls:
            - [setClassName, ['Oro\Bundle\WebCatalogBundle\Entity\WebCatalog']]
        tags:
            - { name: security.voter, priority: 10 }
            - { name: container.service_subscriber, id: oro_web_catalog.provider.web_catalog_usage_provider }

    oro_web_catalog.content_variant_type.registry:
        class: 'Oro\Bundle\WebCatalogBundle\ContentVariantType\ContentVariantTypeRegistry'
        public: true
        arguments:
            - !tagged_iterator oro_web_catalog.content_variant_type

    Oro\Bundle\WebCatalogBundle\ContentVariantType\ContentVariantTypeRegistry:
        alias: 'oro_web_catalog.content_variant_type.registry'

    oro_web_catalog.content_variant_type.system_page:
        class: Oro\Bundle\WebCatalogBundle\ContentVariantType\SystemPageContentVariantType
        public: false
        tags:
            - { name: oro_web_catalog.content_variant_type }

    oro_web_catalog.content_variant_provider:
        class: Oro\Bundle\WebCatalogBundle\Provider\ContentVariantProvider
        arguments:
            - !tagged_iterator oro_web_catalog.content_variant_provider
        public: false

    oro_web_catalog.content_node_tree_handler:
        class: Oro\Bundle\WebCatalogBundle\JsTree\ContentNodeTreeHandler
        arguments:
            - 'Oro\Bundle\WebCatalogBundle\Entity\ContentNode'
            - '@doctrine'
            - '@oro_locale.helper.localization'
            - '@oro_message_queue.client.message_producer'
            - '@oro_web_catalog.model.resolve_node_slugs_message_factory'
            - '@oro_web_catalog.unique_content_node_slug_prototype_resolver'

    Oro\Bundle\WebCatalogBundle\JsTree\ContentNodeTreeHandler:
        alias: 'oro_web_catalog.content_node_tree_handler'

    oro_web_catalog.twig.extension:
        class: Oro\Bundle\WebCatalogBundle\Twig\WebCatalogExtension
        public: false
        arguments:
            - '@oro_platform.twig.service_locator'
        tags:
            - { name: twig.extension }

    oro_web_catalog.event_listener.orm.content_node_entity_listener:
        class: 'Oro\Bundle\WebCatalogBundle\EventListener\ContentNodeListener'
        arguments:
            - '@oro_web_catalog.model.content_node_materialized_path_modifier'
            - '@oro_commerce_entity.extra_insert_entity_storage'
            - '@oro_message_queue.client.message_producer'
            - '@oro_web_catalog.model.resolve_node_slugs_message_factory'
            - '@oro_product.handler.collection_sort_order'
        tags:
            - { name: doctrine.orm.entity_listener, entity: 'Oro\Bundle\WebCatalogBundle\Entity\ContentNode', event: postPersist }
            - { name: doctrine.orm.entity_listener, entity: 'Oro\Bundle\WebCatalogBundle\Entity\ContentNode', event: preUpdate }
            - { name: doctrine.orm.entity_listener, entity: 'Oro\Bundle\WebCatalogBundle\Entity\ContentNode', event: postRemove }
            - { name: kernel.event_listener, event: oro.form.update_handler.after_entity_flush.oro_web_catalog_content_node, method: onFormAfterFlush }

    oro_web_catalog.event_listener.orm.content_variant_entity_listener:
        class: 'Oro\Bundle\WebCatalogBundle\EventListener\ContentVariantListener'
        arguments:
            - '@oro_web_catalog.content_variant_type.registry'
            - '@oro_security.owner.metadata_provider.chain'
            - '@oro_entity.doctrine_helper'
            - '@property_accessor'
        tags:
            - { name: doctrine.orm.entity_listener, entity: 'Oro\Bundle\WebCatalogBundle\Entity\ContentVariant', event: prePersist }
            - { name: doctrine.orm.entity_listener, entity: 'Oro\Bundle\WebCatalogBundle\Entity\ContentVariant', event: preUpdate }

    oro_web_catalog.event_listener.orm.content_variant_remove_entity_listener:
        class: Oro\Bundle\WebCatalogBundle\EventListener\ContentVariantSlugsRemoveListener
        tags:
            - { name: doctrine.event_listener, event: onFlush }

    oro_web_catalog.model.content_node_materialized_path_modifier:
        class: 'Oro\Bundle\WebCatalogBundle\Model\ContentNodeMaterializedPathModifier'
        public: false
        arguments:
            - '@doctrine'

    oro_web_catalog.event_listener.system_config.web_catalog:
        class: Oro\Bundle\ConfigBundle\EventListener\EntitySystemConfigListener
        arguments:
            - '@doctrine'
            - 'Oro\Bundle\WebCatalogBundle\Entity\WebCatalog'
            - 'oro_web_catalog.web_catalog'
        tags:
            - { name: kernel.event_listener, event: oro_config.settings_form_preset, method: onFormPreSetData }
            - { name: kernel.event_listener, event: oro_config.settings_before_save, method: onSettingsSaveBefore }

    oro_web_catalog.event_listener.webcatalog_config:
        class: Oro\Bundle\WebCatalogBundle\EventListener\WebCatalogConfigChangeListener
        arguments:
            - '@event_dispatcher'
        tags:
            - { name: kernel.event_listener, event: oro_config.update_after, method: onConfigurationUpdate }

    oro_web_catalog.event_listener.webcatalog_cache_config:
        class: Oro\Bundle\WebCatalogBundle\EventListener\WebCatalogCacheConfigChangeListener
        arguments:
            - '@oro_message_queue.client.message_producer'
        tags:
            - { name: kernel.event_listener, event: oro_config.update_after, method: onConfigurationUpdate }

    oro_web_catalog.migration.demo_data_fixtures_listener.disable_webcatalog_cache_config_listener:
        parent: oro_platform.event_listener.demo_data_fixtures_listener.abstract
        calls:
            - [disableListener, ['oro_web_catalog.event_listener.webcatalog_cache_config']]
        tags:
            - { name: kernel.event_listener, event: oro_migration.data_fixtures.pre_load, method: onPreLoad }
            - { name: kernel.event_listener, event: oro_migration.data_fixtures.post_load, method: onPostLoad }

    oro_web_catalog.request_web_content_variant_provider:
        class: Oro\Bundle\WebCatalogBundle\Provider\RequestWebContentVariantProvider
        arguments:
            - '@request_stack'
            - '@doctrine'

    oro_web_catalog.request_web_content_scope_provider:
        class: Oro\Bundle\WebCatalogBundle\Provider\RequestWebContentScopeProvider
        arguments:
            - '@request_stack'
            - '@doctrine'
            - '@oro_scope.scope_manager'
            - '@oro_redirect.routing.matched_url_decision_maker'

    oro_web_catalog.form.autocomplete.web_catalog.search_handler:
        parent: oro_form.autocomplete.search_handler
        arguments:
            - 'Oro\Bundle\WebCatalogBundle\Entity\WebCatalog'
            - ['name']
        tags:
            - { name: oro_form.autocomplete.search_handler, alias: Oro\Bundle\WebCatalogBundle\Form\Type\WebCatalogType, acl_resource: oro_web_catalog_view }

    oro_web_catalog.form.type.content_node_select:
        class: Oro\Bundle\WebCatalogBundle\Form\Type\ContentNodeSelectType
        arguments:
            - '@oro_web_catalog.content_node_tree_handler'
        tags:
            - { name: form.type, alias: oro_web_catalog_content_node_select }

    oro_web_catalog.form.type.web_catalog:
        class: Oro\Bundle\WebCatalogBundle\Form\Type\WebCatalogType
        tags:
            - { name: form.type, alias: oro_web_catalog }

    oro_web_catalog.form.type.web_catalog_select:
        class: Oro\Bundle\WebCatalogBundle\Form\Type\WebCatalogSelectType
        tags:
            - { name: form.type, alias: oro_web_catalog_select }

    oro_web_catalog.form.type.content_node:
        class: Oro\Bundle\WebCatalogBundle\Form\Type\ContentNodeType
        arguments:
            - '@router'
        tags:
            - { name: form.type, alias: oro_web_catalog_content_node }

    oro_web_catalog.form.type.oro_web_catalog_content_variant_system_page:
        class: Oro\Bundle\WebCatalogBundle\Form\Type\SystemPageVariantType
        tags:
            - { name: form.type, alias: oro_web_catalog_system_page_variant }

    oro_web_catalog.form.type.oro_web_catalog_content_variant_collection:
        class: Oro\Bundle\WebCatalogBundle\Form\Type\ContentVariantCollectionType
        arguments:
            - '@oro_web_catalog.content_variant_type.registry'
        tags:
            - { name: form.type, alias: oro_web_catalog_content_variant_collection }

    oro_web_catalog.generator.canonical_url_generator:
        class: Oro\Bundle\WebCatalogBundle\Generator\CanonicalUrlGenerator
        decorates: oro_redirect.generator.canonical_url
        parent: oro_redirect.generator.canonical_url
        calls:
            - ['setContentNodeProvider', ['@oro_web_catalog.content_node_provider']]
        tags:
            - { name: oro_featuretogle.feature, feature: web_catalog_based_canonical_urls }

    oro_web_catalog.generator.slug_generator:
        class: Oro\Bundle\WebCatalogBundle\Generator\SlugGenerator
        arguments:
            - '@oro_web_catalog.content_variant_type.registry'
            - '@oro_redirect.generator.redirect'
            - '@oro_locale.helper.localization'
            - '@oro_redirect.generator.slug_url_differ'
            - '@oro_web_catalog.unique_content_node_slug_prototype_resolver'

    Oro\Bundle\WebCatalogBundle\Generator\SlugGenerator:
        alias: 'oro_web_catalog.generator.slug_generator'

    oro_web_catalog.generator.slug_generator.link:
        tags:
            - { name: oro_service_link,  service: oro_web_catalog.generator.slug_generator }

    oro_web_catalog.web_catalog_scope_criteria_provider:
        class: Oro\Bundle\WebCatalogBundle\Provider\ScopeWebCatalogProvider
        public: false
        arguments:
            - '@oro_web_catalog.web_catalog_provider'
        tags:
            - { name: oro_scope.provider, scopeType: web_content, priority: 250 }
            - { name: oro_scope.provider, scopeType: web_content_for_sitemap, priority: 250 }

    oro_web_catalog.web_catalog_provider:
        class: Oro\Bundle\WebCatalogBundle\Provider\WebCatalogProvider
        public: false
        arguments:
            - '@doctrine'
            - '@oro_config.manager'

    oro_web_catalog.content_node_entity_name_provider:
        class: Oro\Bundle\WebCatalogBundle\Provider\ContentNodeEntityNameProvider
        tags:
            - { name: oro_entity.name_provider, priority: 100 }

    oro_web_catalog.content_node_provider:
        class: Oro\Bundle\WebCatalogBundle\Provider\ContentNodeProvider
        arguments:
            - '@oro_entity.doctrine_helper'
            - '@oro_scope.scope_manager'
            - '@event_dispatcher'
            - '@oro_web_catalog.web_catalog_provider'
            - '@stof_doctrine_extensions.listener.tree'

    oro_web_catalog.unique_content_node_slug_prototype_resolver:
        class: Oro\Bundle\WebCatalogBundle\Resolver\UniqueContentNodeSlugPrototypesResolver
        arguments:
            - '@doctrine'

    oro_web_catalog.form.extension.web_catalog_scope:
        class: Oro\Bundle\WebCatalogBundle\Form\Extension\WebCatalogScopeExtension
        tags:
            - { name: form.type_extension, extended_type: Oro\Bundle\ScopeBundle\Form\Type\ScopeType }

    oro_web_catalog.form.extension.page_variant_type:
        class: Oro\Bundle\WebCatalogBundle\Form\Extension\PageVariantTypeExtension
        tags:
            - { name: form.type_extension, extended_type: Oro\Component\WebCatalog\Form\PageVariantType }

    oro_web_catalog.form.extension.content_node_type:
        class: Oro\Bundle\WebCatalogBundle\Form\Extension\ContentNodeTypeExtension
        arguments:
            - '@oro_web_catalog.content_variant_type.registry'
            - '@oro_security.owner.metadata_provider.chain'
            - '@oro_entity.doctrine_helper'
            - '@property_accessor'
        tags:
            - { name: form.type_extension, extended_type: Oro\Bundle\WebCatalogBundle\Form\Type\ContentNodeType }

    oro_web_catalog.event_listener.website_search_index:
        class: 'Oro\Bundle\WebCatalogBundle\EventListener\WebCatalogEntityIndexerListener'
        arguments:
            - '@doctrine'
            - '@oro_config.manager'
            - '@oro_website.provider.website_localization'
            - '@oro_website_search.manager.website_context_manager'
            - '@oro_web_catalog.content_variant_provider'
            - '@oro_locale.helper.localization'
            - '@oro_website_search.formatter.decimal_flat_value_formatter'
        tags:
            - { name: kernel.event_listener, event: oro_website_search.event.index_entity, method: onWebsiteSearchIndex }

    oro_web_catalog.resolved_content_nodes_merger:
        class: Oro\Bundle\WebCatalogBundle\Cache\ResolvedContentNodesMerger

    Oro\Bundle\WebCatalogBundle\ContentNodeUtils\ContentNodeTreeResolverInterface:
        alias: oro_web_catalog.content_node_tree_resolver

    oro_web_catalog.content_node_tree_resolver:
        class: Oro\Bundle\WebCatalogBundle\ContentNodeUtils\ContentNodeTreeResolver
        arguments:
            - '@oro_entity.doctrine_helper'
            - '@oro_web_catalog.content_node_provider'
            - '@oro_scope.scope_manager'
            - '@oro_web_catalog.resolved_content_nodes_loader'
            - '@property_accessor'

    oro_web_catalog.content_node_tree_resolver.caching:
        class: Oro\Bundle\WebCatalogBundle\Cache\ContentNodeTreeCachingResolver
        decorates: oro_web_catalog.content_node_tree_resolver
        decoration_priority: 20
        arguments:
            - '@.inner'
            - '@doctrine'
            - '@oro_web_catalog.content_node_tree_cache.root'

    oro_web_catalog.content_node_tree_resolver.merging:
        class: Oro\Bundle\WebCatalogBundle\Cache\ContentNodeTreeMergingResolver
        decorates: oro_web_catalog.content_node_tree_resolver
        decoration_priority: 10
        arguments:
            - '@.inner'
            - '@oro_web_catalog.resolved_content_nodes_merger'
            - '@oro_web_catalog.content_node_tree_cache.merged'

    oro_web_catalog.cache.root:
        parent: oro.data.cache
        tags:
            - { name: 'cache.pool', namespace: 'oro_web_catalog_root' }

    oro_web_catalog.cache.merged:
        parent: oro.data.cache
        tags:
            - { name: 'cache.pool', namespace: 'oro_web_catalog_merged' }

    oro_web_catalog.resolved_content_variants_loader:
        class: Oro\Bundle\WebCatalogBundle\ContentNodeUtils\Loader\ResolvedContentVariantsLoader
        arguments:
            - '@doctrine'
            - '@oro_web_catalog.resolved_content_variant_factory'

    oro_web_catalog.resolved_content_nodes_loader:
        class: Oro\Bundle\WebCatalogBundle\ContentNodeUtils\Loader\ResolvedContentNodesLoader
        arguments:
            - '@doctrine'
            - '@oro_web_catalog.resolved_content_variants_loader'
            - '@oro_web_catalog.resolved_content_node_factory'

    oro_web_catalog.resolved_content_variant_factory:
        class: Oro\Bundle\WebCatalogBundle\ContentNodeUtils\Factory\ResolvedContentVariantFactory
        arguments:
            - '@doctrine'
            - '@oro_locale.cache.normalizer.localized_fallback_value'

    oro_web_catalog.resolved_content_node_factory:
        class: Oro\Bundle\WebCatalogBundle\ContentNodeUtils\Factory\ResolvedContentNodeFactory
        arguments:
            - '@oro_web_catalog.resolved_content_identifier_generator'
            - '@oro_web_catalog.resolved_content_variant_factory'
            - '@oro_locale.cache.normalizer.localized_fallback_value_collection'

    oro_web_catalog.resolved_content_identifier_generator:
        class: Oro\Bundle\WebCatalogBundle\ContentNodeUtils\Factory\ResolvedContentNodeIdentifierGenerator

    oro_web_catalog.cache.content_node_tree_cache_warmer:
        class: Oro\Bundle\WebCatalogBundle\Cache\ContentNodeTreeCacheWarmer
        arguments:
            - '@oro_message_queue.client.message_producer'
            - '@oro_entity.doctrine_helper'
            - '@oro_config.manager'
        tags:
            - { name: 'kernel.cache_warmer' }

    oro_web_catalog.content_node_tree_cache.root:
        class: Oro\Bundle\WebCatalogBundle\Cache\ContentNodeTreeCache
        arguments:
            - '@oro_web_catalog.cache.root'
            - '@oro_web_catalog.cache.resolved_content_node_normalizer'

    oro_web_catalog.content_node_tree_cache.merged:
        class: Oro\Bundle\WebCatalogBundle\Cache\ContentNodeTreeCache
        arguments:
            - '@oro_web_catalog.cache.merged'
            - '@oro_web_catalog.cache.resolved_content_node_normalizer'

    oro_web_catalog.content_node_tree_cache_dumper:
        class: Oro\Bundle\WebCatalogBundle\Cache\ContentNodeTreeCacheDumper
        public: true
        arguments:
            - '@doctrine'
            - '@oro_web_catalog.content_node_tree_resolver'
            - '@oro_web_catalog.content_node_tree_cache.root'
            - '@oro_web_catalog.content_node_tree_cache.merged'

    oro_web_catalog.layout.data_provider.content_variant:
        class: Oro\Bundle\WebCatalogBundle\Layout\DataProvider\ContentVariantDataProvider
        arguments:
            - '@oro_web_catalog.request_web_content_variant_provider'
        tags:
            - { name: layout.data_provider, alias: web_catalog_content_variant }

    oro_web_catalog.layout.data_provider.breadcrumb_data:
        class: Oro\Bundle\WebCatalogBundle\Layout\DataProvider\WebCatalogBreadcrumbProvider
        public: true
        arguments:
            - '@doctrine'
            - '@oro_locale.helper.localization'
            - '@request_stack'
            - '@oro_web_catalog.request_web_content_variant_provider'
            - '@oro_catalog.layout.data_provider.category_breadcrumb'
        tags:
            - { name: layout.data_provider, alias: web_catalog_breadcrumbs }

    oro_web_catalog.layout.context_configurator.web_catalog:
        class: Oro\Bundle\WebCatalogBundle\Layout\Extension\WebCatalogContextConfigurator
        arguments:
            - '@oro_config.manager'
        tags:
            - { name: layout.context_configurator }

    oro_web_catalog.resolver.default_variant_scope:
        class: Oro\Bundle\WebCatalogBundle\Resolver\DefaultVariantScopesResolver
        arguments:
            - '@doctrine'
            - '@oro_scope.scope_manager'

    oro_web_catalog.layout.data_provider.title_data:
        class: Oro\Bundle\WebCatalogBundle\Layout\DataProvider\TitleDataProvider
        arguments:
            - '@oro_web_catalog.request_web_content_variant_provider'
            - '@oro_locale.helper.localization'
        tags:
            - { name: layout.data_provider, alias: web_catalog_title }

    oro_web_catalog.model.resolve_node_slugs_message_factory:
        class: Oro\Bundle\WebCatalogBundle\Model\ResolveNodeSlugsMessageFactory
        public: false
        arguments:
            - '@oro_entity.doctrine_helper'
            - '@oro_config.manager'

    oro_web_catalog.feature.voter.feature_voter:
        class: Oro\Bundle\WebCatalogBundle\Feature\Voter\FeatureVoter
        arguments:
            - '@oro_config.manager'
        tags:
            - { name: oro_featuretogle.voter }

    oro_web_catalog.validator_constraints.not_empty_scopes_validator:
        class: 'Oro\Bundle\WebCatalogBundle\Validator\Constraint\NotEmptyScopesValidator'
        public: true
        arguments:
            - '@oro_scope.scope_manager'
        tags:
            - { name: validator.constraint_validator, alias: oro_web_catalog.validator_constraints.not_empty_scopes_validator }

    oro_web_catalog.validator_constraints.same_organization_validator:
        class: 'Oro\Bundle\WebCatalogBundle\Validator\Constraint\SameOrganizationValidator'
        public: true
        arguments:
            - '@oro_web_catalog.content_variant_type.registry'
            - '@oro_security.owner.entity_owner_accessor'
        tags:
            - { name: validator.constraint_validator, alias: oro_web_catalog.validator_constraints.same_organization_validator }

    oro_web_catalog.form.type.content_node_select_system_config:
        class: Oro\Bundle\WebCatalogBundle\Form\Type\ContentNodeSelectSystemConfigType
        arguments:
            - '@oro_entity.doctrine_helper'
            - '@oro_config.manager'
        tags:
            - { name: form.type, alias: oro_web_catalog_content_node_select }

    oro_web_catalog.form.data_transformer.navigation_root_option:
        class: 'Oro\Bundle\WebCatalogBundle\Form\DataTransformer\NavigationRootOptionTransformer'
        public: true
        arguments:
            - '@oro_entity.doctrine_helper'

    oro_web_catalog.form.type.content_node_from_web_catalog_select:
        class: 'Oro\Bundle\WebCatalogBundle\Form\Type\ContentNodeFromWebCatalogSelectType'
        arguments:
            - '@oro_web_catalog.content_node_tree_handler'
        tags:
            - { name: form.type }

    Oro\Bundle\WebCatalogBundle\Form\Handler\ContentNodeHandler:
        class: Oro\Bundle\WebCatalogBundle\Form\Handler\ContentNodeHandler
        parent: oro_form.form.handler.default

    Oro\Bundle\WebCatalogBundle\Form\ContentNodeFormTemplateDataProvider:
        class: Oro\Bundle\WebCatalogBundle\Form\ContentNodeFormTemplateDataProvider
        arguments:
            - '@oro_catalog.utils.sort_order_dialog_target_storage'

    Oro\Bundle\WebCatalogBundle\Validator\Constraint\UniqueSlugPrototypeValidator:
        class: Oro\Bundle\WebCatalogBundle\Validator\Constraint\UniqueSlugPrototypeValidator
        arguments:
            - '@doctrine'
        tags:
            - { name: validator.constraint_validator }

    oro_web_catalog.provider.content_variant_slug_source_entity:
        class: Oro\Bundle\WebCatalogBundle\Provider\ContentVariantSlugSourceEntityProvider
        arguments:
            - '@oro_redirect.sluggable_entity_finder'
            - '@oro_website.manager'
        tags:
            - { name: oro_redirect.slug_source_entity_provider, priority: 100 }
            - { name: oro_featuretogle.feature, feature: frontend_master_catalog }

    oro_web_catalog.cache.resolved_content_node_normalizer:
        class: Oro\Bundle\WebCatalogBundle\Cache\ResolvedContentNodeNormalizer
        arguments:
            - '@oro_entity.doctrine_helper'
            - '@oro_locale.cache.normalizer.localized_fallback_value'
            - '@oro_web_catalog.resolved_content_node_factory'

    oro_web_catalog.menu.content_nodes_provider:
        class: Oro\Bundle\WebCatalogBundle\Menu\CompositeMenuContentNodesProvider
        arguments:
            - '@oro_web_catalog.menu.content_nodes_provider.backoffice'
            - '@oro_web_catalog.menu.content_nodes_provider.storefront'
            - '@oro_frontend.request.frontend_helper'

    oro_web_catalog.menu.content_nodes_provider.backoffice:
        class: Oro\Bundle\WebCatalogBundle\Menu\MenuContentNodesProvider
        arguments:
            - '@doctrine'
            - '@oro_web_catalog.resolved_content_nodes_loader'
        calls:
            - ['setAuthorizationChecker', ['@security.authorization_checker']]

    oro_web_catalog.menu.content_nodes_provider.storefront:
        class: Oro\Bundle\WebCatalogBundle\Menu\StorefrontMenuContentNodesProvider
        arguments:
            - '@oro_web_catalog.request_web_content_scope_provider'
            - '@oro_web_catalog.content_node_tree_resolver'

    oro_web_catalog.event_listener.form_handler.sort_order_dialog_target:
        class: Oro\Bundle\CatalogBundle\EventListener\SortOrderDialogTargetFormHandlerEventListener
        arguments:
            - '@oro_catalog.utils.sort_order_dialog_target_storage'
            - '@oro_ui.router'
            - '@property_accessor'
        tags:
            - { name: kernel.event_listener, event: oro.form.update_handler.after_entity_flush.oro_web_catalog_content_node, method: onFormAfterFlush }

    oro_web_catalog.content_node.deletion_resolver:
        class: Oro\Bundle\WebCatalogBundle\Resolver\ContentNodeDeletionResolver
        arguments:
            - '@translator'
            - !tagged_iterator content_node.deletion_checker
        public: true

    Oro\Bundle\WebCatalogBundle\ContentNodeDeletionChecker\ContentNodeEntityReferencesChecker:
        arguments:
            - '@translator'

    Oro\Bundle\WebCatalogBundle\ContentNodeDeletionChecker\ContentNodeInConfigReferencesChecker:
        arguments:
            - '@translator'
            - '@oro_config.manager'
            - '@oro_website.website.provider'
