nested-tab', tabName);
        } else {
            url.searchParams.set('tab', tabName);
            url.searchParams.delete('nested-tab');
        }

        url.searchParams.delete('anchor'); // Remove anchor parameter when switching tabs
        history.replaceState(null, null, url.toString());
    });

    // Re-activate the tab and scroll to anchor if the query parameters change
    $(window).on('popstate', function () {
        activateTabAndHeaderFromUrl();
    });
});
</script>
<script id="quarto-h