/* global registerBackward, CONST */

registerBackward('1.4.18', 'Search', function (control) {
    'use strict';

    CONST.RESPONSIVE_MODES.forEach(function (mode) {
        if (control.search.input.input.css &&
            typeof control.search.input.input.css[mode] === 'object' &&
            control.search.input.input.css[mode].hasOwnProperty('hidden')) {

            control.search.css = control.search.css || {};
            control.search.css[mode] = control.search.css[mode] || {};

            control.search.css[mode].hidden = control.search.input.input.css[mode].hidden;
            delete control.search.input.input.css[mode].hidden;
        }
    });

    return control;
});