// Populate the sidebar
//
// This is a script, and not included directly in the page, to control the total size of the book.
// The TOC contains an entry for each page, so if each page includes a copy of the TOC,
// the total size of the page becomes O(n**2).
class MDBookSidebarScrollbox extends HTMLElement {
    constructor() {
        super();
    }
    connectedCallback() {
        this.innerHTML = '<ol class="chapter"><li class="chapter-item expanded affix "><a href="introduction.html">Introduction</a></li><li class="chapter-item expanded affix "><li class="part-title">Getting Started</li><li class="chapter-item expanded "><a href="getting-started/installation.html"><strong aria-hidden="true">1.</strong> Installation</a></li><li class="chapter-item expanded "><a href="getting-started/quick-start.html"><strong aria-hidden="true">2.</strong> Quick Start</a></li><li class="chapter-item expanded "><a href="getting-started/basic-tracing.html"><strong aria-hidden="true">3.</strong> Basic Tracing</a></li><li class="chapter-item expanded "><a href="getting-started/understanding-output.html"><strong aria-hidden="true">4.</strong> Understanding Output</a></li><li class="chapter-item expanded affix "><li class="part-title">Core Concepts</li><li class="chapter-item expanded "><a href="core-concepts/syscall-tracing.html"><strong aria-hidden="true">5.</strong> System Call Tracing</a></li><li class="chapter-item expanded "><a href="core-concepts/dwarf-correlation.html"><strong aria-hidden="true">6.</strong> DWARF Source Correlation</a></li><li class="chapter-item expanded "><a href="core-concepts/filtering.html"><strong aria-hidden="true">7.</strong> Filtering Syscalls</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="core-concepts/filtering-classes.html"><strong aria-hidden="true">7.1.</strong> Syscall Classes</a></li><li class="chapter-item expanded "><a href="core-concepts/filtering-negation.html"><strong aria-hidden="true">7.2.</strong> Negation Operator</a></li><li class="chapter-item expanded "><a href="core-concepts/filtering-regex.html"><strong aria-hidden="true">7.3.</strong> Regex Patterns</a></li></ol></li><li class="chapter-item expanded "><a href="core-concepts/statistics.html"><strong aria-hidden="true">8.</strong> Statistics Mode</a></li><li class="chapter-item expanded "><a href="core-concepts/output-formats.html"><strong aria-hidden="true">9.</strong> Output Formats</a></li><li class="chapter-item expanded affix "><li class="part-title">Examples</li><li class="chapter-item expanded "><a href="examples/trace-file-ops.html"><strong aria-hidden="true">10.</strong> Trace File Operations</a></li><li class="chapter-item expanded "><a href="examples/debug-performance.html"><strong aria-hidden="true">11.</strong> Debug Performance Issues</a></li><li class="chapter-item expanded "><a href="examples/debug-compilation.html"><strong aria-hidden="true">12.</strong> Debug Compilation &amp; Transpilation</a></li><li class="chapter-item expanded "><a href="examples/monitor-network.html"><strong aria-hidden="true">13.</strong> Monitor Network Calls</a></li><li class="chapter-item expanded "><a href="examples/attach-process.html"><strong aria-hidden="true">14.</strong> Attach to Running Process</a></li><li class="chapter-item expanded "><a href="examples/multi-process.html"><strong aria-hidden="true">15.</strong> Multi-Process Tracing</a></li><li class="chapter-item expanded "><a href="examples/export-data.html"><strong aria-hidden="true">16.</strong> Export to JSON/CSV</a></li><li class="chapter-item expanded "><a href="examples/html-reports.html"><strong aria-hidden="true">17.</strong> Generate HTML Reports</a></li><li class="chapter-item expanded affix "><li class="part-title">Advanced Topics</li><li class="chapter-item expanded "><a href="advanced/function-profiling.html"><strong aria-hidden="true">18.</strong> Function Profiling</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="advanced/io-bottlenecks.html"><strong aria-hidden="true">18.1.</strong> I/O Bottleneck Detection</a></li><li class="chapter-item expanded "><a href="advanced/call-graphs.html"><strong aria-hidden="true">18.2.</strong> Call Graph Analysis</a></li><li class="chapter-item expanded "><a href="advanced/flamegraphs.html"><strong aria-hidden="true">18.3.</strong> Flamegraph Export</a></li></ol></li><li class="chapter-item expanded "><a href="advanced/statistical-analysis.html"><strong aria-hidden="true">19.</strong> Statistical Analysis</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="advanced/percentiles.html"><strong aria-hidden="true">19.1.</strong> Percentile Analysis</a></li><li class="chapter-item expanded "><a href="advanced/simd-acceleration.html"><strong aria-hidden="true">19.2.</strong> SIMD Acceleration</a></li></ol></li><li class="chapter-item expanded "><a href="advanced/anomaly-detection.html"><strong aria-hidden="true">20.</strong> Anomaly Detection</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="advanced/post-hoc-anomaly.html"><strong aria-hidden="true">20.1.</strong> Post-Hoc Analysis</a></li><li class="chapter-item expanded "><a href="advanced/realtime-anomaly.html"><strong aria-hidden="true">20.2.</strong> Real-Time Monitoring</a></li></ol></li><li class="chapter-item expanded "><a href="advanced/hpu-acceleration.html"><strong aria-hidden="true">21.</strong> HPU Acceleration</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="advanced/correlation-matrix.html"><strong aria-hidden="true">21.1.</strong> Correlation Matrix</a></li><li class="chapter-item expanded "><a href="advanced/kmeans-clustering.html"><strong aria-hidden="true">21.2.</strong> K-means Clustering</a></li></ol></li><li class="chapter-item expanded "><a href="advanced/machine-learning.html"><strong aria-hidden="true">22.</strong> Machine Learning</a></li><li class="chapter-item expanded "><a href="advanced/opentelemetry.html"><strong aria-hidden="true">23.</strong> OpenTelemetry Integration</a></li><li class="chapter-item expanded "><a href="advanced/distributed-tracing.html"><strong aria-hidden="true">24.</strong> Distributed Tracing</a></li><li class="chapter-item expanded "><a href="advanced/transpiler-integration.html"><strong aria-hidden="true">25.</strong> Transpiler Integration</a></li><li class="chapter-item expanded "><a href="advanced/performance-optimization.html"><strong aria-hidden="true">26.</strong> Performance Optimization</a></li><li class="chapter-item expanded "><a href="advanced/single-shot-compile.html"><strong aria-hidden="true">27.</strong> Single-Shot Compile Tooling</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="advanced/syscall-clustering.html"><strong aria-hidden="true">27.1.</strong> Syscall Clustering</a></li><li class="chapter-item expanded "><a href="advanced/sequence-mining.html"><strong aria-hidden="true">27.2.</strong> Sequence Mining</a></li><li class="chapter-item expanded "><a href="advanced/time-attribution.html"><strong aria-hidden="true">27.3.</strong> Time-Weighted Attribution</a></li><li class="chapter-item expanded "><a href="advanced/semantic-equivalence.html"><strong aria-hidden="true">27.4.</strong> Semantic Equivalence</a></li><li class="chapter-item expanded "><a href="advanced/regression-detection.html"><strong aria-hidden="true">27.5.</strong> Regression Detection</a></li></ol></li><li class="chapter-item expanded "><li class="part-title">Reference</li><li class="chapter-item expanded "><a href="reference/cli.html"><strong aria-hidden="true">28.</strong> CLI Reference</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="reference/tracing-options.html"><strong aria-hidden="true">28.1.</strong> Tracing Options</a></li><li class="chapter-item expanded "><a href="reference/filter-syntax.html"><strong aria-hidden="true">28.2.</strong> Filter Syntax</a></li><li class="chapter-item expanded "><a href="reference/output-options.html"><strong aria-hidden="true">28.3.</strong> Output Options</a></li><li class="chapter-item expanded "><a href="reference/analysis-flags.html"><strong aria-hidden="true">28.4.</strong> Analysis Flags</a></li></ol></li><li class="chapter-item expanded "><a href="reference/output-formats.html"><strong aria-hidden="true">29.</strong> Output Formats</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="reference/format-text.html"><strong aria-hidden="true">29.1.</strong> Text Format</a></li><li class="chapter-item expanded "><a href="reference/format-json.html"><strong aria-hidden="true">29.2.</strong> JSON Format</a></li><li class="chapter-item expanded "><a href="reference/format-csv.html"><strong aria-hidden="true">29.3.</strong> CSV Format</a></li><li class="chapter-item expanded "><a href="reference/format-html.html"><strong aria-hidden="true">29.4.</strong> HTML Format</a></li></ol></li><li class="chapter-item expanded "><a href="reference/exit-codes.html"><strong aria-hidden="true">30.</strong> Exit Codes</a></li><li class="chapter-item expanded "><a href="reference/benchmarks.html"><strong aria-hidden="true">31.</strong> Performance Benchmarks</a></li><li class="chapter-item expanded affix "><li class="part-title">Contributing</li><li class="chapter-item expanded "><a href="contributing/setup.html"><strong aria-hidden="true">32.</strong> Development Setup</a></li><li class="chapter-item expanded "><a href="contributing/extreme-tdd.html"><strong aria-hidden="true">33.</strong> EXTREME TDD</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="contributing/red-green-refactor.html"><strong aria-hidden="true">33.1.</strong> RED-GREEN-REFACTOR</a></li><li class="chapter-item expanded "><a href="contributing/property-testing.html"><strong aria-hidden="true">33.2.</strong> Property-Based Testing</a></li><li class="chapter-item expanded "><a href="contributing/mutation-testing.html"><strong aria-hidden="true">33.3.</strong> Mutation Testing</a></li><li class="chapter-item expanded "><a href="contributing/fuzz-testing.html"><strong aria-hidden="true">33.4.</strong> Fuzz Testing</a></li><li class="chapter-item expanded "><a href="contributing/tiered-tdd.html"><strong aria-hidden="true">33.5.</strong> Tiered TDD Workflow</a></li></ol></li><li class="chapter-item expanded "><a href="contributing/chaos-engineering.html"><strong aria-hidden="true">34.</strong> Chaos Engineering</a></li><li class="chapter-item expanded "><a href="contributing/quality-gates.html"><strong aria-hidden="true">35.</strong> Quality Gates</a></li><li class="chapter-item expanded "><a href="contributing/toyota-way.html"><strong aria-hidden="true">36.</strong> Toyota Way Principles</a></li><li class="chapter-item expanded "><a href="contributing/release-process.html"><strong aria-hidden="true">37.</strong> Release Process</a></li><li class="chapter-item expanded affix "><li class="part-title">Appendix</li><li class="chapter-item expanded "><a href="appendix/glossary.html"><strong aria-hidden="true">38.</strong> Glossary</a></li><li class="chapter-item expanded "><a href="appendix/faq.html"><strong aria-hidden="true">39.</strong> FAQ</a></li><li class="chapter-item expanded "><a href="appendix/changelog.html"><strong aria-hidden="true">40.</strong> CHANGELOG</a></li><li class="chapter-item expanded "><a href="appendix/performance-tables.html"><strong aria-hidden="true">41.</strong> Performance Tables</a></li></ol>';
        // Set the current, active page, and reveal it if it's hidden
        let current_page = document.location.href.toString();
        if (current_page.endsWith("/")) {
            current_page += "index.html";
        }
        var links = Array.prototype.slice.call(this.querySelectorAll("a"));
        var l = links.length;
        for (var i = 0; i < l; ++i) {
            var link = links[i];
            var href = link.getAttribute("href");
            if (href && !href.startsWith("#") && !/^(?:[a-z+]+:)?\/\//.test(href)) {
                link.href = path_to_root + href;
            }
            // The "index" page is supposed to alias the first chapter in the book.
            if (link.href === current_page || (i === 0 && path_to_root === "" && current_page.endsWith("/index.html"))) {
                link.classList.add("active");
                var parent = link.parentElement;
                if (parent && parent.classList.contains("chapter-item")) {
                    parent.classList.add("expanded");
                }
                while (parent) {
                    if (parent.tagName === "LI" && parent.previousElementSibling) {
                        if (parent.previousElementSibling.classList.contains("chapter-item")) {
                            parent.previousElementSibling.classList.add("expanded");
                        }
                    }
                    parent = parent.parentElement;
                }
            }
        }
        // Track and set sidebar scroll position
        this.addEventListener('click', function(e) {
            if (e.target.tagName === 'A') {
                sessionStorage.setItem('sidebar-scroll', this.scrollTop);
            }
        }, { passive: true });
        var sidebarScrollTop = sessionStorage.getItem('sidebar-scroll');
        sessionStorage.removeItem('sidebar-scroll');
        if (sidebarScrollTop) {
            // preserve sidebar scroll position when navigating via links within sidebar
            this.scrollTop = sidebarScrollTop;
        } else {
            // scroll sidebar to current active section when navigating via "next/previous chapter" buttons
            var activeSection = document.querySelector('#sidebar .active');
            if (activeSection) {
                activeSection.scrollIntoView({ block: 'center' });
            }
        }
        // Toggle buttons
        var sidebarAnchorToggles = document.querySelectorAll('#sidebar a.toggle');
        function toggleSection(ev) {
            ev.currentTarget.parentElement.classList.toggle('expanded');
        }
        Array.from(sidebarAnchorToggles).forEach(function (el) {
            el.addEventListener('click', toggleSection);
        });
    }
}
window.customElements.define("mdbook-sidebar-scrollbox", MDBookSidebarScrollbox);
