( function( window, document ) {
  function interior_design_studio_keepFocusInMenu() {
    document.addEventListener( 'keydown', function( e ) {
      const interior_design_studio_nav = document.querySelector( '.sidenav' );
      if ( ! interior_design_studio_nav || ! interior_design_studio_nav.classList.contains( 'open' ) ) {
        return;
      }
      const elements = [...interior_design_studio_nav.querySelectorAll( 'input, a, button' )],
        interior_design_studio_lastEl = elements[ elements.length - 1 ],
        interior_design_studio_firstEl = elements[0],
        interior_design_studio_activeEl = document.activeElement,
        tabKey = e.keyCode === 9,
        shiftKey = e.shiftKey;
      if ( ! shiftKey && tabKey && interior_design_studio_lastEl === interior_design_studio_activeEl ) {
        e.preventDefault();
        interior_design_studio_firstEl.focus();
      }
      if ( shiftKey && tabKey && interior_design_studio_firstEl === interior_design_studio_activeEl ) {
        e.preventDefault();
        interior_design_studio_lastEl.focus();
      }
    } );
  }
  interior_design_studio_keepFocusInMenu();
} )( window, document );