text: 'use strict';
  {
      const toggleNavSidebar = document.getElementById('toggle-nav-sidebar');
      if (toggleNavSidebar !== null) {
          const navLinks = document.querySelectorAll('#nav-sidebar a');
          function disableNavLinkTabbing() {
              for (const navLink of navLinks) {
                  navLink.tabIndex = -1;
              }
          }
          function enableNavLinkTabbing() {
              for (const navLink of navLinks) {
                  navLink.tabIndex = 0;
              }
          }
  
          const main = document.getElementById('main');
          let navSidebarIsOpen = localStorage.getItem('django.admin.navSidebarIsOpen');
          if (navSidebarIsOpen === null) {
              navSidebarIsOpen = 'true';
          }
          if (navSidebarIsOpen === 'false') {
              disableNavLinkTabbing();
          }
          main.classList.toggle('shifted', navSidebarIsOpen === 'true');
  
          toggleNavSidebar.addEventListener('click', function() {
              if (navSidebarIsOpen === 'true') {
                  navSidebarIsOpen = 'false';
                  disableNavLinkTabbing();
              } else {
                  navSidebarIsOpen = 'true';
                  enableNavLinkTabbing();
              }
              localStorage.setItem('django.admin.navSidebarIsOpen', navSidebarIsOpen);
              main.classList.toggle('shifted');
          });
      }
  
      function resizeSidebar() {
          const sidebar = document.querySelector("#nav-sidebar.sticky");
          if (!sidebar) {
              return;
          }
  
          let headerHeight = 0;
          const header = document.getElementById('header');
          const breadcrumbs = document.getElementsByClassName('breadcrumbs');
  
          if (header) {
              headerHeight += header.offsetHeight;
          }
  
          if (breadcrumbs) {
              Array.from(breadcrumbs).forEach(function(element) {
                  headerHeight += element.offsetHeight;
              });
          }
  
          const visibleHeader = Math.max(headerHeight - window.pageYOffset, 0);
          const sidebarHeight = window.innerHeight - visibleHeader - 1;
          sidebar.style.maxHeight = `${sidebarHeight}px`;
      }
      resizeSidebar();
      document.addEventListener('scroll', resizeSidebar, false);
      window.addEventListener('resize', resizeSidebar, false);
  
      function initSidebarQuickFilter() {
          const options = [];
          const navSidebar = document.getElementById('nav-sidebar');
          if (!navSidebar) {
              return;
          }
          navSidebar.querySelectorAll('th[scope=row] a').forEach((container) => {
              options.push({title: container.innerHTML, node: container});
          });
  
          function checkValue(event) {
              let filterValue = event.target.value;
              if (filterValue) {
                  filterValue = filterValue.toLowerCase();
              }
              if (event.key === 'Escape') {
                  filterValue = '';
                  event.target.value = ''; // clear input
              }
              let matches = false;
              for (const o of options) {
                  let displayValue = '';
                  if (filterValue) {
                      if (o.title.toLowerCase().indexOf(filterValue) === -1) {
                          displayValue = 'none';
                      } else {
                          matches = true;
                      }
                  }
                  // show/hide parent <TR>
                  o.node.parentNode.parentNode.style.display = displayValue;
              }
              if (!filterValue || matches) {
                  event.target.classList.remove('no-results');
              } else {
                  event.target.classList.add('no-results');
              }
              localStorage.setItem('django.admin.navSidebarFilterValue', filterValue);
          }
  
          const nav = document.getElementById('nav-filter');
          nav.addEventListener('change', checkValue, false);
          nav.addEventListener('input', checkValue, false);
          nav.addEventListener('keyup', checkValue, false);
  
          const storedValue = localStorage.getItem('django.admin.navSidebarFilterValue');
          if (storedValue) {
              nav.value = storedValue;
              checkValue({target: nav, key: ''});
          }
      }
      window.initSidebarQuickFilter = initSidebarQuickFilter;
      initSidebarQuickFilter();
  }
  