(function () {
    'use strict';

    window.erpCsrfToken = document.querySelector('meta[name="csrf-token"]')
        ? document.querySelector('meta[name="csrf-token"]').getAttribute('content')
        : null;

    var modulesToggle = document.getElementById('enterpriseModulesToggle');
    var modulesBar = document.getElementById('enterpriseModulesBar');

    if (modulesToggle && modulesBar) {
        modulesToggle.addEventListener('click', function () {
            var isOpen = modulesBar.classList.toggle('is-open');
            modulesBar.hidden = !isOpen;
            modulesToggle.setAttribute('aria-expanded', isOpen ? 'true' : 'false');
            modulesToggle.classList.toggle('active', isOpen);
        });
    }
})();
