<?xml version="1.0"?>
<!--
/**
 * MageSpecialist
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/osl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to info@magespecialist.it so we can send you a copy immediately.
 *
 * @category   MSP
 * @package    MSP_ReCaptcha
 * @copyright  Copyright (c) 2017 Skeeller srl (http://www.magespecialist.it)
 * @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 */
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="MSP\ReCaptcha\Api\ValidateInterface" type="MSP\ReCaptcha\Model\Validate"/>

    <type name="Magento\Framework\Console\CommandList">
        <arguments>
            <argument name="commands" xsi:type="array">
                <item name="msp_recaptcha" xsi:type="object">MSP\ReCaptcha\Command\ReCaptcha</item>
            </argument>
        </arguments>
    </type>

    <type name="Magento\Framework\View\Asset\Minification">
        <plugin name="msp-exclude" type="MSP\ReCaptcha\Plugin\ExcludeFromMinification"/>
    </type>

    <type name="MSP\ReCaptcha\Block\Frontend\ReCaptcha">
        <arguments>
            <!-- Deprecated parameter encoder -->
            <argument name="encoder" xsi:type="null" />
            <!-- Deprecated parameter decoder -->
            <argument name="decoder" xsi:type="null" />
        </arguments>
    </type>

    <!-- Default HTTP response provider -->
    <preference for="MSP\ReCaptcha\Model\Provider\ResponseProviderInterface"
                type="MSP\ReCaptcha\Model\Provider\Response\DefaultResponseProvider"/>

    <preference for="MSP\ReCaptcha\Model\IsCheckRequiredInterface"
                type="MSP\ReCaptcha\Model\IsCheckRequired"/>

    <!-- Set sensitive information -->
    <type name="Magento\Config\Model\Config\TypePool">
        <arguments>
            <argument name="sensitive" xsi:type="array">
                <item name="msp_securitysuite_recaptcha/general/public_key" xsi:type="string">1</item>
                <item name="msp_securitysuite_recaptcha/general/private_key" xsi:type="string">1</item>
            </argument>
            <argument name="environment" xsi:type="array">
                <item name="msp_securitysuite_recaptcha/general/public_key" xsi:type="string">1</item>
                <item name="msp_securitysuite_recaptcha/general/private_key" xsi:type="string">1</item>
            </argument>
        </arguments>
    </type>
</config>
