jQuery(document).ready(function ($) {
    const $navItems = $('.vs-nav-item');
    const $panels = $('.vs-tab-panel');
    const $title = $('#vs-section-title');
    const $description = $('#vs-section-description');
    const $resetBtn = $('#vs-reset-section-btn');

    $navItems.on('click', function () {
        const $btn = $(this);
        const tab = $btn.data('tab');
        const title = $btn.data('title');
        const description = $btn.data('description');

        $navItems.removeClass('is-active');
        $btn.addClass('is-active');

        $panels.removeClass('is-active');
        $('#vs-tab-' + tab).addClass('is-active');

        if ($title.length) {
            $title.text(title);
        }

        if ($description.length) {
            $description.text(description);
        }
    });

    $resetBtn.on('click', function () {
        alert(vsAdminSettings.resetConfirm);
    });
});