services:
  _defaults:
    public: true

  # COMMAND HANDLERS

  prestashop.core.domain.theme.command_handler.import_theme_handler:
    class: 'PrestaShop\PrestaShop\Core\Domain\Theme\CommandHandler\ImportThemeHandler'
    autoconfigure: true
    arguments:
      - '@prestashop.core.addon.theme.theme_zip_uploader'
      - '@prestashop.core.addon.theme.theme_manager'
      - '@prestashop.adapter.legacy.configuration'

  prestashop.core.domain.theme.command_handler.enable_theme_handler:
    class: 'PrestaShop\PrestaShop\Core\Domain\Theme\CommandHandler\EnableThemeHandler'
    autoconfigure: true
    arguments:
      - '@prestashop.core.addon.theme.theme_manager'
      - '@prestashop.adapter.cache.clearer.smarty_cache_clearer'
      - '@=service("prestashop.adapter.shop.context").isSingleShopContext()'

  prestashop.core.domain.theme.command_handler.delete_theme_handler:
    class: 'PrestaShop\PrestaShop\Core\Domain\Theme\CommandHandler\DeleteThemeHandler'
    autoconfigure: true
    arguments:
      - '@prestashop.core.addon.theme.theme_manager'

  prestashop.core.domain.theme.command_handler.adapt_theme_to_rtl_languages_handler:
    class: 'PrestaShop\PrestaShop\Core\Domain\Theme\CommandHandler\AdaptThemeToRTLLanguagesHandler'
    autoconfigure: true
    arguments:
      - '@PrestaShop\PrestaShop\Core\Localization\RTL\StyleSheetProcessorFactory'

  prestashop.core.domain.theme.command_handler.reset_theme_layouts_handler:
    class: 'PrestaShop\PrestaShop\Core\Domain\Theme\CommandHandler\ResetThemeLayoutsHandler'
    autoconfigure: true
    arguments:
      - '@prestashop.core.addon.theme.theme_manager'
