<?xml version="1.0"?>
<!--
/**
 * Copyright © 2016 Magento. 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">
    <preference for="Magento\Framework\View\Design\Theme\FileInterface" type="Magento\Theme\Model\Theme\File" />
    <preference for="Magento\Framework\View\Design\Theme\ThemeProviderInterface" type="Magento\Theme\Model\Theme\ThemeProvider" />
    <preference for="Magento\Framework\View\Design\Theme\FileProviderInterface" type="Magento\Theme\Model\Theme\FileProvider" />
    <preference for="Magento\Framework\View\Design\Theme\Customization\ConfigInterface" type="Magento\Theme\Model\Theme\Customization\Config" />
    <preference for="Magento\Framework\App\DesignInterface" type="Magento\Theme\Model\Design" />
    <preference for="Magento\Framework\View\Page\FaviconInterface" type="Magento\Theme\Model\Favicon\Favicon" />
    <preference for="Magento\Framework\View\Design\Theme\ListInterface" type="Magento\Theme\Model\Theme\Collection" />
    <preference for="Magento\Framework\View\Element\Message\InterpretationStrategyInterface" type="Magento\Framework\View\Element\Message\InterpretationMediator" />
    <preference for="Magento\Theme\Api\Data\DesignConfigInterface" type="Magento\Theme\Model\Data\Design\Config"/>
    <preference for="Magento\Theme\Api\Data\DesignConfigDataInterface" type="Magento\Theme\Model\Data\Design\Config\Data"/>
    <preference for="Magento\Theme\Api\DesignConfigRepositoryInterface" type="Magento\Theme\Model\DesignConfigRepository"/>
    <preference for="Magento\Framework\View\Model\PageLayout\Config\BuilderInterface" type="Magento\Theme\Model\PageLayout\Config\Builder"/>
    <preference for="Magento\Theme\Model\Design\Config\MetadataProviderInterface" type="Magento\Theme\Model\Design\Config\MetadataProvider"/>
    <type name="Magento\Framework\View\Element\Message\Renderer\RenderersPool">
        <arguments>
            <argument name="renderers" xsi:type="array">
                <item name="escape_renderer" xsi:type="object">Magento\Framework\View\Element\Message\Renderer\EscapeRenderer</item>
                <item name="block_renderer" xsi:type="object">Magento\Framework\View\Element\Message\Renderer\BlockRenderer</item>
            </argument>
        </arguments>
    </type>
    <type name="Magento\Framework\View\Element\Message\MessageConfigurationsPool">
        <arguments>
            <argument name="configurationsMap" xsi:type="array">
                <item name="default_message_identifier" xsi:type="array">
                    <item name="renderer" xsi:type="const">\Magento\Framework\View\Element\Message\Renderer\EscapeRenderer::CODE</item>
                </item>
            </argument>
        </arguments>
    </type>
    <type name="Magento\Theme\Model\Config">
        <arguments>
            <argument name="configCache" xsi:type="object">Magento\Framework\App\Cache\Type\Config</argument>
            <argument name="layoutCache" xsi:type="object">Magento\Framework\App\Cache\Type\Layout</argument>
        </arguments>
    </type>
    <type name="Magento\Theme\Model\Uploader\Service">
        <arguments>
            <argument name="uploadLimits" xsi:type="array">
                <item name="css" xsi:type="string">2M</item>
                <item name="js" xsi:type="string">2M</item>
            </argument>
        </arguments>
    </type>
    <type name="Magento\Theme\Model\Layout\Config\Reader">
        <arguments>
            <argument name="fileName" xsi:type="string">layouts.xml</argument>
            <argument name="converter" xsi:type="object">Magento\Theme\Model\Layout\Config\Converter</argument>
            <argument name="schemaLocator" xsi:type="object">Magento\Theme\Model\Layout\Config\SchemaLocator</argument>
        </arguments>
    </type>
    <virtualType name="Magento\Theme\Model\Layout\Config\Data" type="Magento\Framework\Config\Data">
        <arguments>
            <argument name="reader" xsi:type="object">Magento\Theme\Model\Layout\Config\Reader\Proxy</argument>
            <argument name="cacheId" xsi:type="string">page_layouts_config</argument>
        </arguments>
    </virtualType>
    <type name="Magento\Theme\Model\Layout\Config">
        <arguments>
            <argument name="dataStorage" xsi:type="object">Magento\Theme\Model\Layout\Config\Data</argument>
        </arguments>
    </type>
    <type name="Magento\Theme\Model\Wysiwyg\Storage">
        <arguments>
            <argument name="helper" xsi:type="object">Magento\Theme\Helper\Storage\Proxy</argument>
        </arguments>
    </type>
    <preference for="Magento\Framework\App\View\Deployment\Version\StorageInterface" type="Magento\Framework\App\View\Deployment\Version\Storage\File"/>
    <type name="Magento\Framework\App\View\Deployment\Version\Storage\File">
        <arguments>
            <argument name="directoryCode" xsi:type="const">Magento\Framework\App\Filesystem\DirectoryList::STATIC_VIEW</argument>
            <argument name="fileName" xsi:type="string">deployed_version.txt</argument>
        </arguments>
    </type>
    <type name="Magento\Framework\Url\ScopeInterface">
        <plugin name="urlSignature" type="Magento\Theme\Model\Url\Plugin\Signature"/>
    </type>
    <type name="Magento\Theme\Model\Theme\Collection" shared="false" />
    <type name="Magento\Theme\Model\View\Design">
        <arguments>
            <argument name="themes" xsi:type="array">
                <item name="frontend" xsi:type="string">Magento/luma</item>
                <item name="adminhtml" xsi:type="string">Magento/backend</item>
            </argument>
        </arguments>
    </type>
    <type name="Magento\Framework\App\Area">
        <arguments>
            <argument name="translator" xsi:type="object">Magento\Framework\Translate</argument>
            <argument name="design" xsi:type="object">Magento\Theme\Model\Design\Proxy</argument>
        </arguments>
    </type>
    <type name="Magento\Framework\Console\CommandListInterface">
        <arguments>
            <argument name="commands" xsi:type="array">
                <item name="theme_uninstall" xsi:type="object">Magento\Theme\Console\Command\ThemeUninstallCommand</item>
            </argument>
        </arguments>
    </type>
    <type name="Magento\Theme\Model\DesignConfigRepository">
        <plugin name="save_design_settings_event_dispatching" type="Magento\Theme\Model\Design\Config\Plugin"/>
    </type>
    <virtualType name="Magento\Theme\Model\ResourceModel\Design\Config\Grid\Collection" type="Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult">
        <arguments>
            <argument name="mainTable" xsi:type="string">design_config_grid_flat</argument>
            <argument name="resourceModel" xsi:type="string">Magento\Theme\Model\ResourceModel\Design\Config</argument>
        </arguments>
    </virtualType>
    <virtualType name="Magento\Theme\Model\Scope\WebsiteSource" type="Magento\Framework\App\Scope\Source">
        <arguments>
            <argument name="scope" xsi:type="const">Magento\Store\Model\ScopeInterface::SCOPE_WEBSITE</argument>
        </arguments>
    </virtualType>
    <virtualType name="Magento\Theme\Model\Scope\GroupSource" type="Magento\Framework\App\Scope\Source">
        <arguments>
            <argument name="scope" xsi:type="const">Magento\Store\Model\ScopeInterface::SCOPE_GROUP</argument>
        </arguments>
    </virtualType>
    <virtualType name="Magento\Theme\Model\Scope\StoreSource" type="Magento\Framework\App\Scope\Source">
        <arguments>
            <argument name="scope" xsi:type="const">Magento\Store\Model\ScopeInterface::SCOPE_STORE</argument>
        </arguments>
    </virtualType>
    <type name="Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory">
        <arguments>
             <argument name="collections" xsi:type="array">
                 <item name="design_config_listing_data_source" xsi:type="string">Magento\Theme\Model\ResourceModel\Design\Config\Grid\Collection</item>
             </argument>
         </arguments>
     </type>
    <type name="Magento\Theme\Model\Design\Config\MetadataProvider">
        <arguments>
            <argument name="metadata" xsi:type="array">
                <item name="head_shortcut_icon" xsi:type="array">
                    <item name="path" xsi:type="string">design/head/shortcut_icon</item>
                    <item name="fieldset" xsi:type="string">other_settings/head</item>
                    <item name="backend_model" xsi:type="string">Magento\Theme\Model\Design\Backend\Favicon</item>
                    <item name="base_url" xsi:type="array">
                        <item name="type" xsi:type="string">media</item>
                        <item name="scope_info" xsi:type="string">1</item>
                        <item name="value" xsi:type="string">favicon</item>
                    </item>
                </item>
                <item name="head_default_title" xsi:type="array">
                    <item name="path" xsi:type="string">design/head/default_title</item>
                    <item name="fieldset" xsi:type="string">other_settings/head</item>
                </item>
                <item name="head_title_prefix" xsi:type="array">
                    <item name="path" xsi:type="string">design/head/title_prefix</item>
                    <item name="fieldset" xsi:type="string">other_settings/head</item>
                </item>
                <item name="head_title_suffix" xsi:type="array">
                    <item name="path" xsi:type="string">design/head/title_suffix</item>
                    <item name="fieldset" xsi:type="string">other_settings/head</item>
                </item>
                <item name="head_default_description" xsi:type="array">
                    <item name="path" xsi:type="string">design/head/default_description</item>
                    <item name="fieldset" xsi:type="string">other_settings/head</item>
                </item>
                <item name="head_default_keywords" xsi:type="array">
                    <item name="path" xsi:type="string">design/head/default_keywords</item>
                    <item name="fieldset" xsi:type="string">other_settings/head</item>
                </item>
                <item name="head_includes" xsi:type="array">
                    <item name="path" xsi:type="string">design/head/includes</item>
                    <item name="fieldset" xsi:type="string">other_settings/head</item>
                </item>
                <item name="head_demonotice" xsi:type="array">
                    <item name="path" xsi:type="string">design/head/demonotice</item>
                    <item name="fieldset" xsi:type="string">other_settings/head</item>
                </item>
                <item name="header_logo_src" xsi:type="array">
                    <item name="path" xsi:type="string">design/header/logo_src</item>
                    <item name="fieldset" xsi:type="string">other_settings/header</item>
                    <item name="backend_model" xsi:type="string">Magento\Theme\Model\Design\Backend\Logo</item>
                    <item name="base_url" xsi:type="array">
                        <item name="type" xsi:type="string">media</item>
                        <item name="scope_info" xsi:type="string">1</item>
                        <item name="value" xsi:type="string">logo</item>
                    </item>
                </item>
                <item name="header_logo_width" xsi:type="array">
                    <item name="path" xsi:type="string">design/header/logo_width</item>
                    <item name="fieldset" xsi:type="string">other_settings/header</item>
                </item>
                <item name="header_logo_height" xsi:type="array">
                    <item name="path" xsi:type="string">design/header/logo_height</item>
                    <item name="fieldset" xsi:type="string">other_settings/header</item>
                </item>
                <item name="header_logo_alt" xsi:type="array">
                    <item name="path" xsi:type="string">design/header/logo_alt</item>
                    <item name="fieldset" xsi:type="string">other_settings/header</item>
                </item>
                <item name="header_welcome" xsi:type="array">
                    <item name="path" xsi:type="string">design/header/welcome</item>
                    <item name="fieldset" xsi:type="string">other_settings/header</item>
                </item>
                <item name="footer_copyright" xsi:type="array">
                    <item name="path" xsi:type="string">design/footer/copyright</item>
                    <item name="fieldset" xsi:type="string">other_settings/footer</item>
                </item>
                <item name="footer_absolute_footer" xsi:type="array">
                    <item name="path" xsi:type="string">design/footer/absolute_footer</item>
                    <item name="fieldset" xsi:type="string">other_settings/footer</item>
                </item>
            </argument>
        </arguments>
    </type>
    <type name="Magento\Store\Model\Website">
        <plugin name="themeDesignConfigGridIndexerWebsite" type="Magento\Theme\Model\Indexer\Design\Config\Plugin\Website"/>
    </type>
    <type name="Magento\Store\Model\Store">
        <plugin name="themeDesignConfigGridIndexerStore" type="Magento\Theme\Model\Indexer\Design\Config\Plugin\Store"/>
    </type>
    <type name="Magento\Store\Model\Group">
        <plugin name="themeDesignConfigGridIndexerStoreGroup" type="Magento\Theme\Model\Indexer\Design\Config\Plugin\StoreGroup"/>
    </type>
</config>
