(function(api) {

    api.sectionConstructor['software-cms-upsell'] = api.Section.extend({
        attachEvents: function() {},
        isContextuallyActive: function() {
            return true;
        }
    });

    const software_cms_section_lists = ['banner', 'service'];
    software_cms_section_lists.forEach(software_cms_homepage_scroll);

    function software_cms_homepage_scroll(item, index) {
        item = item.replace(/-/g, '_');
        wp.customize.section('software_cms_' + item + '_section', function(section) {
            section.expanded.bind(function(isExpanding) {
                wp.customize.previewer.send(item, { expanded: isExpanding });
            });
        });
    }
})(wp.customize);