(function () {
    'use strict';

    document.addEventListener('DOMContentLoaded', function () {
        document.querySelectorAll('[data-erp-index-filters]').forEach(function (form) {
            form.querySelectorAll('select[data-auto-submit="1"]').forEach(function (select) {
                select.addEventListener('change', function () {
                    form.requestSubmit ? form.requestSubmit() : form.submit();
                });
            });
        });
    });
})();
