function init() {
    if ( !atomicHelpers.setInitFlag( _dom ) ) {
      return standardType.UNDEFINED;
    }

    // DOM selectors.
    var rootMenuDom = _dom;
    var rootContentDom = rootMenuDom.querySelector( '.' + BASE_CLASS + '_content' );

    // Create model.
    _menus = new Tree();

    // Create root menu.
    var transition = new MoveTransition( rootContentDom ).init();
    var rootMenu = new FlyoutMenu( rootMenuDom ).init();
    // Set initial position.
    rootMenu.setExpandTransition( transition, transition.moveToOrigin );
    rootMenu.setCollapseTransition( transition, transition.moveLeft );
    _addEvents( rootMenu );

    // Populate tree model with menus.
    var rootNode = _menus.init( rootMenu ).getRoot();
    rootMenu.setData( rootNode );
    _populateTreeFromDom( rootMenuDom, rootNode, _addMenu );

    // Initialize screen-size specific behaviors.
    _desktopNav = new MegaMenuDesktop( _menus ).init();
    _mobileNav = new MegaMenuMobile( _menus ).init();
    _mobileNav.addEventListener( 'rootExpandBegin',
                                 fnBind( _handleRootExpandBegin, this ) );
    _mobileNav.addEventListener( 'rootCollapseEnd',
                                 fnBind( _handleRootCollapseEnd, this ) );

    window.addEventListener( 'resize', _resizeHandler );
    // Pipe window resize handler into orientation change on supported devices.
    if ( 'onorientationchange' in window ) {
      window.addEventListener( 'orientationchange', _resizeHandler );
    }

    if ( breakpointState.isInDesktop() ) {
      _desktopNav.resume();
    } else {
      _mobileNav.resume();
    }

    _dom.classList.remove( 'u-hidden' );

    _tabTriggerDom.addEventListener( 'keyup', _handleTabPress );

    return this;
  }
/**
   * @returns {MegaMenu|undefined} An instance,
   *   or undefined if it was already initialized.
   */
@returns {MegaMenu|undefined} An instance,
or undefined if it was already initialized.
@returns { MegaMenu|undefined } An instance or undefined if it was already initialized .
function init() {
    if ( !atomicHelpers.setInitFlag( _dom ) ) {
      return standardType.UNDEFINED;
    }
    var rootMenuDom = _dom;
    var rootContentDom = rootMenuDom.querySelector( '.' + BASE_CLASS + '_content' );
    _menus = new Tree();
    var transition = new MoveTransition( rootContentDom ).init();
    var rootMenu = new FlyoutMenu( rootMenuDom ).init();
    rootMenu.setExpandTransition( transition, transition.moveToOrigin );
    rootMenu.setCollapseTransition( transition, transition.moveLeft );
    _addEvents( rootMenu );
    var rootNode = _menus.init( rootMenu ).getRoot();
    rootMenu.setData( rootNode );
    _populateTreeFromDom( rootMenuDom, rootNode, _addMenu );
    _desktopNav = new MegaMenuDesktop( _menus ).init();
    _mobileNav = new MegaMenuMobile( _menus ).init();
    _mobileNav.addEventListener( 'rootExpandBegin',
                                 fnBind( _handleRootExpandBegin, this ) );
    _mobileNav.addEventListener( 'rootCollapseEnd',
                                 fnBind( _handleRootCollapseEnd, this ) );
    window.addEventListener( 'resize', _resizeHandler );
    if ( 'onorientationchange' in window ) {
      window.addEventListener( 'orientationchange', _resizeHandler );
    }
    if ( breakpointState.isInDesktop() ) {
      _desktopNav.resume();
    } else {
      _mobileNav.resume();
    }
    _dom.classList.remove( 'u-hidden' );
    _tabTriggerDom.addEventListener( 'keyup', _handleTabPress );
    return this;
  }
function init ( ) { if ( ! atomicHelpers . setInitFlag ( _dom ) ) { return standardType . UNDEFINED ; } var rootMenuDom = _dom ; var rootContentDom = rootMenuDom . querySelector ( '.' + BASE_CLASS + '_content' ) ; _menus = new Tree ( ) ; var transition = new MoveTransition ( rootContentDom ) . init ( ) ; var rootMenu = new FlyoutMenu ( rootMenuDom ) . init ( ) ; rootMenu . setExpandTransition ( transition , transition . moveToOrigin ) ; rootMenu . setCollapseTransition ( transition , transition . moveLeft ) ; _addEvents ( rootMenu ) ; var rootNode = _menus . init ( rootMenu ) . getRoot ( ) ; rootMenu . setData ( rootNode ) ; _populateTreeFromDom ( rootMenuDom , rootNode , _addMenu ) ; _desktopNav = new MegaMenuDesktop ( _menus ) . init ( ) ; _mobileNav = new MegaMenuMobile ( _menus ) . init ( ) ; _mobileNav . addEventListener ( 'rootExpandBegin' , fnBind ( _handleRootExpandBegin , this ) ) ; _mobileNav . addEventListener ( 'rootCollapseEnd' , fnBind ( _handleRootCollapseEnd , this ) ) ; window . addEventListener ( 'resize' , _resizeHandler ) ; if ( 'onorientationchange' in window ) { window . addEventListener ( 'orientationchange' , _resizeHandler ) ; } if ( breakpointState . isInDesktop ( ) ) { _desktopNav . resume ( ) ; } else { _mobileNav . resume ( ) ; } _dom . classList . remove ( 'u-hidden' ) ; _tabTriggerDom . addEventListener ( 'keyup' , _handleTabPress ) ; return this ; }
@returns {MegaMenu|undefined} An instance,
   or undefined if it was already initialized.
@returns { MegaMenu|undefined } An instance or undefined if it was already initialized .
// DOM selectors. // Create model. // Create root menu. // Set initial position. // Populate tree model with menus. // Initialize screen-size specific behaviors. // Pipe window resize handler into orientation change on supported devices.