services:
  _defaults:
    public: true

  prestashop.core.addon.theme.repository:
    class: PrestaShop\PrestaShop\Core\Addon\Theme\ThemeRepository
    arguments:
      - "@prestashop.adapter.legacy.configuration"
      - "@filesystem"
      - "@=service('prestashop.adapter.legacy.context').getContext().shop"

  PrestaShop\PrestaShop\Core\Addon\Theme\ThemeExporter:
    public: false
    arguments:
      - "@prestashop.adapter.legacy.configuration"
      - "@filesystem"
      - "@prestashop.core.admin.lang.repository"
      - "@prestashop.translation.theme.exporter"

  prestashop.core.addon.theme.exporter:
    alias: PrestaShop\PrestaShop\Core\Addon\Theme\ThemeExporter
    public: true
    deprecated:
      package: PrestaShop\PrestaShop
      version: 9.0

  prestashop.core.addon.theme.theme_validator:
    class: PrestaShop\PrestaShop\Core\Addon\Theme\ThemeValidator
    arguments:
      - '@translator'
      - '@prestashop.adapter.legacy.configuration'

  prestashop.core.addon.theme.theme_manager_builder:
    class: PrestaShop\PrestaShop\Core\Addon\Theme\ThemeManagerBuilder
    arguments:
      - '@=service("prestashop.adapter.legacy.context").getContext()'
      - '@prestashop.adapter.legacy_db'
      - '@prestashop.core.addon.theme.theme_validator'
      - '@logger'
      - '@PrestaShop\PrestaShop\Core\Context\ApiClientContext'

  prestashop.core.addon.theme.theme_manager:
    class: PrestaShop\PrestaShop\Core\Addon\Theme\ThemeManager
    lazy: true
    factory: [ '@prestashop.core.addon.theme.theme_manager_builder', 'build' ]

  PrestaShop\PrestaShop\Core\Addon\Theme\ThemePageLayoutsCustomizer:
    public: false
    lazy: true
    arguments:
      - '@=service("prestashop.adapter.legacy.context").getContext().shop.theme'
      - '@prestashop.core.addon.theme.theme_manager'
      - '@prestashop.adapter.cache.clearer.smarty_cache_clearer'

  prestashop.core.addon.theme.theme.page_layouts_customizer:
    alias: PrestaShop\PrestaShop\Core\Addon\Theme\ThemePageLayoutsCustomizer
    public: true
    deprecated:
      package: PrestaShop\PrestaShop
      version: 9.0

  prestashop.core.addon.theme.theme_zip_uploader:
    class: PrestaShop\PrestaShop\Core\Addon\Theme\ThemeZipUploader
    arguments:
      - '@prestashop.adapter.legacy.configuration'

  PrestaShop\PrestaShop\Core\Addon\Theme\ThemeProvider:
    public: false
    arguments:
      - '@prestashop.core.addon.theme.repository'
      - '@=service("prestashop.adapter.legacy.context").getContext().shop.theme'

  prestashop.core.addon.theme.theme_provider:
    alias: PrestaShop\PrestaShop\Core\Addon\Theme\ThemeProvider
    public: true
    deprecated:
      package: PrestaShop\PrestaShop
      version: 9.0
