<?xml version="1.0"?>
<!--
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <virtualType name="Magento\Catalog\Model\ResourceModel\Category\Collection\FetchStrategy" type="Magento\Framework\Data\Collection\Db\FetchStrategy\Cache">
        <arguments>
            <argument name="cacheTags" xsi:type="array">
                <item name="categoryTag" xsi:type="const">Magento\Catalog\Model\Category::CACHE_TAG</item>
            </argument>
        </arguments>
    </virtualType>
    <type name="Magento\Catalog\Model\ResourceModel\Category\Collection">
        <arguments>
            <argument name="fetchStrategy" xsi:type="object">Magento\Catalog\Model\ResourceModel\Category\Collection\FetchStrategy</argument>
        </arguments>
    </type>
    <type name="Magento\Catalog\Model\Indexer\AbstractFlatState">
        <arguments>
            <argument name="isAvailable" xsi:type="boolean">true</argument>
        </arguments>
    </type>
    <virtualType name="Magento\Catalog\Block\ShortcutButtons\InCatalog" type="Magento\Catalog\Block\ShortcutButtons">
        <arguments>
            <argument name="isCatalogProduct" xsi:type="boolean">true</argument>
        </arguments>
    </virtualType>
    <virtualType name="Magento\Catalog\Block\ShortcutButtons\InCatalog\PositionAfter" type="Magento\Catalog\Block\ShortcutButtons">
        <arguments>
            <argument name="isCatalogProduct" xsi:type="boolean">true</argument>
            <argument name="orPosition" xsi:type="const">Magento\Catalog\Block\ShortcutButtons::POSITION_AFTER</argument>
        </arguments>
    </virtualType>
    <type name="Magento\Catalog\Model\Indexer\Product\Flat\State">
        <arguments>
            <argument name="isAvailable" xsi:type="boolean">true</argument>
        </arguments>
    </type>
    <type name="Magento\Framework\View\Layout">
        <plugin name="catalog-session-depersonalize"
                type="Magento\Catalog\Model\Layout\DepersonalizePlugin" sortOrder="10"/>
    </type>
    <type name="Magento\Customer\CustomerData\SectionPoolInterface">
        <arguments>
            <argument name="sectionSourceMap" xsi:type="array">
                <item name="compare-products" xsi:type="string">Magento\Catalog\CustomerData\CompareProducts</item>
            </argument>
        </arguments>
    </type>
    <type name="Magento\Catalog\Helper\Product\ConfigurationPool">
        <arguments>
            <argument name="instancesByType" xsi:type="array">
                <item name="default" xsi:type="object">Magento\Catalog\Helper\Product\Configuration</item>
            </argument>
        </arguments>
    </type>
    <type name="Magento\Framework\Pricing\Render\PriceBox">
        <plugin name="catalog_price_box_key" type="Magento\Catalog\Block\Category\Plugin\PriceBoxTags" />
    </type>
    <type name="Magento\Customer\CustomerData\SectionPool">
        <arguments>
            <argument name="sectionSourceMap" xsi:type="array">
                <item name="recently_viewed_product" xsi:type="string">Magento\Catalog\CustomerData\RecentlyViewedProductsSection</item>
                <item name="recently_compared_product" xsi:type="string">Magento\Catalog\CustomerData\RecentlyComparedProductsSection</item>
                <item name="product_data_storage" xsi:type="string">Magento\Catalog\CustomerData\ProductsRenderInfoSection</item>
            </argument>
        </arguments>
    </type>
    <virtualType name="Magento\Catalog\CustomerData\RecentlyViewedProductsSection" type="Magento\Catalog\CustomerData\ProductFrontendActionSection">
        <arguments>
            <argument name="typeId" xsi:type="string">recently_viewed_product</argument>
        </arguments>
    </virtualType>
    <virtualType name="Magento\Catalog\CustomerData\RecentlyComparedProductsSection" type="Magento\Catalog\CustomerData\ProductFrontendActionSection">
        <arguments>
            <argument name="typeId" xsi:type="string">recently_compared_product</argument>
        </arguments>
    </virtualType>
    <type name="Magento\Framework\View\Element\Message\MessageConfigurationsPool">
        <arguments>
            <argument name="configurationsMap" xsi:type="array">
                <item name="addCompareSuccessMessage" xsi:type="array">
                    <item name="renderer" xsi:type="const">\Magento\Framework\View\Element\Message\Renderer\BlockRenderer::CODE</item>
                    <item name="data" xsi:type="array">
                        <item name="template" xsi:type="string">Magento_Catalog::messages/addCompareSuccessMessage.phtml</item>
                    </item>
                </item>
            </argument>
        </arguments>
    </type>
    <type name="Magento\Framework\App\ResourceConnection">
        <plugin name="get_catalog_category_product_index_table_name" type="Magento\Catalog\Model\Indexer\Category\Product\Plugin\TableResolver"/>
        <plugin name="get_catalog_product_price_index_table_name" type="Magento\Catalog\Model\Indexer\Product\Price\Plugin\TableResolver"/>
    </type>
    <type name="Magento\Framework\App\Action\AbstractAction">
        <plugin name="catalog_app_action_dispatch_controller_context_plugin" type="Magento\Catalog\Plugin\Framework\App\Action\ContextPlugin" />
    </type>
</config>
