import { _ as _slicedToArray } from './slicedToArray-6ebcbfea.js';
import React__default, { useRef, useState, useEffect } from 'react';
import Container from 'react-bootstrap/Container';
import Nav from 'react-bootstrap/Nav';
import Navbar from 'react-bootstrap/Navbar';
import NavDropdown from 'react-bootstrap/NavDropdown';
import { N as NavFooter } from './NavFooter-e27bd93b.js';
import { S as SocialNavFooter, G as GoSearch } from './index.esm-37268dca.js';
import Segment from './Segment.js';
import SocialIcons from './SocialIcons.js';
import { I as IconContext } from './iconBase-ccc56b97.js';
import Form from 'react-bootstrap/Form';
import FormControl from 'react-bootstrap/FormControl';
import Button from 'react-bootstrap/Button';
import { c as main_44 } from './main-1894c974.js';
import { i as isFunction_1, e as eq_1 } from './eq-bdcbf886.js';
import { i as isObject_1 } from './isSymbol-a7e9aafe.js';
import { t as toNumber_1 } from './toNumber-5aeba6e7.js';
import './_commonjsHelpers-0c4b6f40.js';
import './web.dom.iterable-ab4dea5c.js';
import './core.get-iterator-method-ea258bb1.js';
import './react-social-icons-9be47857.js';
import 'prop-types';
import './asyncToGenerator-958ef5fc.js';
import './_library-528f1934.js';
import './_iter-detect-98db3b07.js';

/**
 * The base implementation of `_.slice` without an iteratee call guard.
 *
 * @private
 * @param {Array} array The array to slice.
 * @param {number} [start=0] The start position.
 * @param {number} [end=array.length] The end position.
 * @returns {Array} Returns the slice of `array`.
 */
function baseSlice(array, start, end) {
  var index = -1,
      length = array.length;

  if (start < 0) {
    start = -start > length ? 0 : (length + start);
  }
  end = end > length ? length : end;
  if (end < 0) {
    end += length;
  }
  length = start > end ? 0 : ((end - start) >>> 0);
  start >>>= 0;

  var result = Array(length);
  while (++index < length) {
    result[index] = array[index + start];
  }
  return result;
}

var _baseSlice = baseSlice;

/** Used as references for various `Number` constants. */
var MAX_SAFE_INTEGER$1 = 9007199254740991;

/**
 * Checks if `value` is a valid array-like length.
 *
 * **Note:** This method is loosely based on
 * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
 * @example
 *
 * _.isLength(3);
 * // => true
 *
 * _.isLength(Number.MIN_VALUE);
 * // => false
 *
 * _.isLength(Infinity);
 * // => false
 *
 * _.isLength('3');
 * // => false
 */
function isLength(value) {
  return typeof value == 'number' &&
    value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER$1;
}

var isLength_1 = isLength;

/**
 * Checks if `value` is array-like. A value is considered array-like if it's
 * not a function and has a `value.length` that's an integer greater than or
 * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
 * @example
 *
 * _.isArrayLike([1, 2, 3]);
 * // => true
 *
 * _.isArrayLike(document.body.children);
 * // => true
 *
 * _.isArrayLike('abc');
 * // => true
 *
 * _.isArrayLike(_.noop);
 * // => false
 */
function isArrayLike(value) {
  return value != null && isLength_1(value.length) && !isFunction_1(value);
}

var isArrayLike_1 = isArrayLike;

/** Used as references for various `Number` constants. */
var MAX_SAFE_INTEGER = 9007199254740991;

/** Used to detect unsigned integer values. */
var reIsUint = /^(?:0|[1-9]\d*)$/;

/**
 * Checks if `value` is a valid array-like index.
 *
 * @private
 * @param {*} value The value to check.
 * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
 * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
 */
function isIndex(value, length) {
  var type = typeof value;
  length = length == null ? MAX_SAFE_INTEGER : length;

  return !!length &&
    (type == 'number' ||
      (type != 'symbol' && reIsUint.test(value))) &&
        (value > -1 && value % 1 == 0 && value < length);
}

var _isIndex = isIndex;

/**
 * Checks if the given arguments are from an iteratee call.
 *
 * @private
 * @param {*} value The potential iteratee value argument.
 * @param {*} index The potential iteratee index or key argument.
 * @param {*} object The potential iteratee object argument.
 * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
 *  else `false`.
 */
function isIterateeCall(value, index, object) {
  if (!isObject_1(object)) {
    return false;
  }
  var type = typeof index;
  if (type == 'number'
        ? (isArrayLike_1(object) && _isIndex(index, object.length))
        : (type == 'string' && index in object)
      ) {
    return eq_1(object[index], value);
  }
  return false;
}

var _isIterateeCall = isIterateeCall;

/** Used as references for various `Number` constants. */
var INFINITY = 1 / 0,
    MAX_INTEGER = 1.7976931348623157e+308;

/**
 * Converts `value` to a finite number.
 *
 * @static
 * @memberOf _
 * @since 4.12.0
 * @category Lang
 * @param {*} value The value to convert.
 * @returns {number} Returns the converted number.
 * @example
 *
 * _.toFinite(3.2);
 * // => 3.2
 *
 * _.toFinite(Number.MIN_VALUE);
 * // => 5e-324
 *
 * _.toFinite(Infinity);
 * // => 1.7976931348623157e+308
 *
 * _.toFinite('3.2');
 * // => 3.2
 */
function toFinite(value) {
  if (!value) {
    return value === 0 ? value : 0;
  }
  value = toNumber_1(value);
  if (value === INFINITY || value === -INFINITY) {
    var sign = (value < 0 ? -1 : 1);
    return sign * MAX_INTEGER;
  }
  return value === value ? value : 0;
}

var toFinite_1 = toFinite;

/**
 * Converts `value` to an integer.
 *
 * **Note:** This method is loosely based on
 * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category Lang
 * @param {*} value The value to convert.
 * @returns {number} Returns the converted integer.
 * @example
 *
 * _.toInteger(3.2);
 * // => 3
 *
 * _.toInteger(Number.MIN_VALUE);
 * // => 0
 *
 * _.toInteger(Infinity);
 * // => 1.7976931348623157e+308
 *
 * _.toInteger('3.2');
 * // => 3
 */
function toInteger(value) {
  var result = toFinite_1(value),
      remainder = result % 1;

  return result === result ? (remainder ? result - remainder : result) : 0;
}

var toInteger_1 = toInteger;

/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeCeil = Math.ceil,
    nativeMax = Math.max;

/**
 * Creates an array of elements split into groups the length of `size`.
 * If `array` can't be split evenly, the final chunk will be the remaining
 * elements.
 *
 * @static
 * @memberOf _
 * @since 3.0.0
 * @category Array
 * @param {Array} array The array to process.
 * @param {number} [size=1] The length of each chunk
 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
 * @returns {Array} Returns the new array of chunks.
 * @example
 *
 * _.chunk(['a', 'b', 'c', 'd'], 2);
 * // => [['a', 'b'], ['c', 'd']]
 *
 * _.chunk(['a', 'b', 'c', 'd'], 3);
 * // => [['a', 'b', 'c'], ['d']]
 */
function chunk(array, size, guard) {
  if ((guard ? _isIterateeCall(array, size, guard) : size === undefined)) {
    size = 1;
  } else {
    size = nativeMax(toInteger_1(size), 0);
  }
  var length = array == null ? 0 : array.length;
  if (!length || size < 1) {
    return [];
  }
  var index = 0,
      resIndex = 0,
      result = Array(nativeCeil(length / size));

  while (index < length) {
    result[resIndex++] = _baseSlice(array, index, (index += size));
  }
  return result;
}

var chunk_1 = chunk;

var NavNative = function NavNative(props) {
  /*
  Example Nav with acceptable props
  <MagazineNav
     showLogin
     logo={props.settings.logo}
     dataObject={props.cache.mainNavCache}
     website={website}
     subNav={props.cache.subNavCache}
      />
  */
  // Setting 'socialIconVariant' as 'dark' as default to make the social icons and search icon black
  var logo = props.logo,
      mobileLogo = props.mobileLogo,
      dataObject = props.dataObject,
      subNav = props.subNav,
      _props$website = props.website,
      website = _props$website === undefined ? {} : _props$website;
      props.showLogin;
      props.userData;
      var _props$socialFooterNa = props.socialFooterNav,
      socialFooterNav = _props$socialFooterNa === undefined ? false : _props$socialFooterNa,
      _props$socialIconVari = props.socialIconVariant,
      socialIconVariant = _props$socialIconVari === undefined ? 'dark' : _props$socialIconVari;

  var navRef = useRef(null);
  //  reference to mobile search component
  var searchRef = useRef(null);

  var _useState = useState(0),
      _useState2 = _slicedToArray(_useState, 2),
      resolution = _useState2[0],
      setResolution = _useState2[1];

  var _useState3 = useState(null),
      _useState4 = _slicedToArray(_useState3, 2),
      userAgent = _useState4[0],
      setUserAgent = _useState4[1];

  var _useState5 = useState(0),
      _useState6 = _slicedToArray(_useState5, 2),
      screenWidth = _useState6[0],
      setScreenWidth = _useState6[1];

  var _useState7 = useState(true),
      _useState8 = _slicedToArray(_useState7, 2),
      isDesktop = _useState8[0],
      setIsDesktop = _useState8[1];

  useEffect(function () {
    // Check for desktop or mobile device
    if (window && window.innerWidth < 568) setIsDesktop(false);
    // Initial screenwidth on refresh or on load
    setScreenWidth(parseInt(window.innerWidth));
    // Initial User agent setup on refresh or on load
    setUserAgent(navigator.userAgent.toString());
    // handling the top mast component
    var topNavHeight = document.querySelector('.nav-brands') && document.querySelector('.nav-brands').offsetHeight;
    // Setting the top of the search component based on the offset of navigation component.
    searchRef.current.style.top = (topNavHeight ? topNavHeight + navRef.current.offsetHeight : navRef.current.offsetHeight) + 1 + 'px';
  }, []);

  useEffect(function () {
    setTimeout(function () {
      var segmentLinks = navRef.current.querySelectorAll('a[needsegmentsupport="true"]');
      for (var i = 0; i < segmentLinks.length; i++) {
        var link = segmentLinks[i];
        var href = link.getAttribute('href');
        var newRef = Segment.getURL(href, { needSegmentSupport: true });
        link.setAttribute('href', newRef);
      }
    }, 1000);
  }, []);

  useEffect(function () {
    if (resolution === 0) {
      setResolution(window.innerWidth);
    }
    var handleResize = function handleResize() {
      if (resolution === 0) {
        setResolution(window.innerWidth);
      } else {
        if (window.innerWidth < 568 && resolution >= 568 && isDesktop) {
          console.log('Detected Mobile Resolution');
          window.location.reload();
          // Updating the condition to reload the page on resize in desktop view
        } else if (window.innerWidth >= 568 && !isDesktop) {
          console.log('Detected Tablet/Desktop Resolution');
          window.location.reload();
        }
      }
    };
    window.addEventListener('resize', handleResize);
  }, [resolution]);

  // Check for change in useragent with change in screen resolution
  useEffect(function () {
    var handleResize = function handleResize() {
      if (userAgent && userAgent !== navigator.userAgent.toString()) {
        console.log('Browser change detected, refreshing');
        window.location.reload();
      }
    };
    window.addEventListener('resize', handleResize);
  }, [userAgent]);

  // Search Term

  var _useState9 = useState(''),
      _useState10 = _slicedToArray(_useState9, 2),
      searchKey = _useState10[0],
      setSearchKey = _useState10[1];

  // Search function


  var submitSearch = function submitSearch(e) {
    e.preventDefault();
    window.location.href = '/search?searchTerm=' + encodeURIComponent(searchKey);
  };

  // Toggling class of an element.Can't use toggle() as IE doesn't support toggle()
  var toggleClass = function toggleClass(selector, type, addOn) {
    if (type === 'id') {
      var searchBar = document.getElementById(selector);
      // Aligning search bar below the searchbutton
      var socialComponent = document.getElementById('search-content-desktop').getBoundingClientRect();
      searchBar.style.right = window.innerWidth - socialComponent.left + 'px';
      if (searchBar && searchBar.classList && searchBar.classList.contains(addOn)) {
        searchBar.classList.remove(addOn);
      } else if (searchBar && searchBar.classList) {
        searchBar.classList.add(addOn);
      }
    } else if (type === 'class') {
      var searchBtn = document.getElementsByClassName(selector)[0];
      if (searchBtn && searchBtn.classList && searchBtn.classList.contains(addOn)) {
        searchBtn.classList.remove(addOn);
      } else if (searchBtn && searchBtn.classList) {
        searchBtn.classList.add(addOn);
      }
    }
  };

  // Search Component
  var socialSearchComponent = function socialSearchComponent(type) {
    if (type === 'mobile') {
      return React__default.createElement(
        'div',
        { id: 'search-content-mobile' },
        React__default.createElement(
          'div',
          { id: 'search-bar-mobile', ref: searchRef },
          React__default.createElement(
            Form,
            { inline: true, onSubmit: function onSubmit(e) {
                return submitSearch(e);
              } },
            React__default.createElement(FormControl, { placeholder: 'Search', type: 'text', value: searchKey, onChange: function onChange(e) {
                return setSearchKey(e.target.value);
              } }),
            React__default.createElement(
              Button,
              { variant: 'primary', style: { backgroundColor: 'var(--secondary)', border: 'none' }, onClick: function onClick(e) {
                  return submitSearch(e);
                } },
              'Search'
            )
          )
        ),
        React__default.createElement(
          IconContext.Provider,
          { value: { color: socialIconVariant === 'light' ? 'white' : 'black', className: 'search-btn-mobile', size: '50px' } },
          React__default.createElement(GoSearch, {
            onClick: function onClick() {
              var navToggle = document.getElementsByClassName('navbar-toggler')[0];
              if (navToggle && navToggle.classList && !navToggle.classList.contains('collapsed')) {
                var nav = document.querySelectorAll('.navbar-collapse');
                for (var i = 0; i < nav.length; i++) {
                  if (nav[i] && nav[i].classList) nav[i].classList.remove('show');
                }
                if (navToggle && navToggle.classList) navToggle.classList.add('collapsed');
              }

              toggleClass('search-bar-mobile', 'id', 'show');
              toggleClass('search-btn-mobile', 'class', 'active-search');
            }
          })
        ),
        React__default.createElement(
          'style',
          { jsx: 'true' },
          '\n            #search-content-mobile {\n              display: flex;\n            }\n            @media screen and (min-width: 1192px) {\n              #search-content-mobile {\n                display: none;\n              }\n              #basic-navbar-nav {\n                display: flex !important;\n              }\n              #basic-navbar-sub {\n                display: none !important;\n              }\n            }\n            #search-content-mobile .search-btn-mobile {\n              padding: 5px;\n              position: absolute;\n              right: 4%;\n              height: 35px;\n              width: 35px;\n              margin-top: 12px;\n              cursor: pointer;\n              top: 0px;\n            }\n            #search-content-mobile #search-bar-mobile {\n              position: fixed;\n              display: none;\n              left: 0px;\n              width: 100%;\n              border-radius: 5px;\n              padding: 10px;\n              background-color: var(--primary);\n            }\n            #search-content-mobile #search-bar-mobile .form-inline {\n              margin-top: 0px;\n              width: 100% !important;\n            }\n            #search-content-mobile #search-bar-mobile .form-inline .form-control {\n              width: 78%;\n              border-radius: 5px;\n              height: 45px;\n            }\n            #search-content-mobile #search-bar-mobile .form-inline .btn {\n              width: 20%;\n              border-radius: 5px;\n              background-color: #040c5a;\n              height: 45px;\n              margin-left: 2%;\n              padding: 1px;\n            }\n            .show {\n              display: block !important;\n            }\n            .active-search {\n              border-radius: 5px;\n              border: 1px solid var(--secondary);\n            }\n          '
        )
      );
    } else if (type === 'desktop') {
      return React__default.createElement(
        'div',
        null,
        React__default.createElement(
          'div',
          { id: 'search-content-desktop' },
          React__default.createElement(
            IconContext.Provider,
            { value: { color: socialIconVariant === 'light' ? 'white' : 'black', className: 'search-btn-desktop', size: '50px' } },
            React__default.createElement(GoSearch, {
              onClick: function onClick() {
                toggleClass('search-bar-desktop', 'id', 'show');
                toggleClass('search-btn-desktop', 'class', 'active-search');
              }
            })
          ),
          website && website.socialLinks && website.socialLinks.length !== 0 && React__default.createElement(
            'div',
            { id: 'social-tab-desktop', style: { display: 'flex' } },
            website.socialLinks && React__default.createElement(SocialIcons, { socialLinks: website.socialLinks, variant: socialIconVariant })
          ),
          React__default.createElement(
            'style',
            { jsx: 'true' },
            '\n              #social-tab-desktops {\n                position: relative;\n                display: flex;\n                left: 0px;\n              }\n              #social-tab-desktops svg {\n                height: 25px !important;\n                width: 25px !important;\n              }\n              @media screen and (max-width: 1191px) {\n                #search-content-desktop {\n                  display: none !important;\n                }\n              }\n              @media screen and (min-width: 1199px) {\n                .mobile-nav {\n                  width: 100% !important;\n                }\n              }\n              #search-content-desktop {\n                display: flex;\n                padding-top: 2px;\n                height: 35px;\n                position: relative;\n              }\n              .search-btn-desktop {\n                padding: 5px;\n                height: 35px;\n                width: 35px;\n                margin: -3px 0px 0px 0px;\n                cursor: pointer;\n              }\n              #search-bar-desktop {\n                display: none;\n                background-color: var(--primary);\n                position: fixed;\n                width: 400px;\n                border-radius: 5px;\n                height: 48px;\n                top: 105px;\n              }\n              #search-bar-desktop .form-inline {\n                padding: 5px;\n              }\n              #search-bar-desktop .form-inline .form-control {\n                width: 78%;\n                border-radius: 5px;\n              }\n              #search-bar-desktop .form-inline .btn {\n                width: 20%;\n                border-radius: 5px;\n                padding: 7px;\n                margin-left: 5px;\n              }\n              .show {\n                display: block !important;\n              }\n              .active-search {\n                border-radius: 5px;\n                border: 1px solid var(--secondary);\n                margin-right: 1px !important;\n              }\n              #basic-navbar-nav {\n                margin-right: 20%;\n              }\n            '
          )
        ),
        React__default.createElement(
          'div',
          { id: 'search-bar-desktop' },
          React__default.createElement(
            Form,
            { inline: true, onSubmit: function onSubmit(e) {
                return submitSearch(e);
              } },
            React__default.createElement(FormControl, { placeholder: 'Search', type: 'text', value: searchKey, onChange: function onChange(e) {
                return setSearchKey(e.target.value);
              } }),
            React__default.createElement(
              Button,
              { variant: 'primary', style: { backgroundColor: 'var(--secondary)', border: 'none' }, onClick: function onClick(e) {
                  return submitSearch(e);
                } },
              'Search'
            )
          )
        )
      );
    }
  };

  var handleMegaMenuAlignment = function handleMegaMenuAlignment(id) {
    setTimeout(function () {
      var megaMenu = document.querySelector('#' + id).parentElement;
      if (megaMenu && megaMenu.getBoundingClientRect() && megaMenu.className.includes('show')) {
        var totalWidth = megaMenu.getBoundingClientRect().x + megaMenu.getBoundingClientRect().width;
        if (totalWidth > resolution) {
          var difference = totalWidth - resolution;
          megaMenu.style.left = '-' + (difference + 20) + 'px';
        }
      }
    }, 50);
  };

  return React__default.createElement(
    React__default.Fragment,
    null,
    React__default.createElement(
      Navbar,
      {
        className: main_44 ? 'bottom-nav ios-nav' : 'bottom-nav android-nav',
        variant: 'dark',
        expand: 'lg',
        bg: 'primary',
        sticky: 'top',
        ref: navRef,
        style: { minHeight: '65px', overflow: '' + (main_44 ? 'auto' : '') } },
      React__default.createElement(
        Container,
        { style: { maxHeight: '80vh' }, className: 'mobile-nav' },
        React__default.createElement(
          Navbar.Brand,
          { id: 'nav-mobile-sm', className: 'nav-mobile-logo' },
          React__default.createElement(
            'a',
            { href: '/' },
            mobileLogo && screenWidth < 1200 ? React__default.createElement('img', { src: mobileLogo, alt: website.title ? website.title : website.name ? website.name : 'Website Logo' }) : React__default.createElement('img', { src: logo, className: 'logo', style: { height: '50px' }, alt: website.title ? website.title : website.name ? website.name : 'Website Logo' })
          )
        ),
        React__default.createElement(
          'div',
          { className: 'nav-toggle', style: { width: 'auto' } },
          React__default.createElement(Navbar.Toggle, {
            'aria-controls': 'basic-navbar-nav',
            onClick: function onClick() {
              var searchBar = document.getElementById('search-bar-mobile');
              var searchBtn = document.getElementsByClassName('search-btn-mobile');
              if (searchBar && searchBar.classList) {
                searchBar.classList.remove('show');
              }
              if (searchBtn && searchBtn[0].classList) {
                searchBtn[0].classList.remove('active-search');
              }
            }
          }),
          React__default.createElement(
            Navbar.Brand,
            { id: 'nav-mobile-md', className: 'nav-mobile-logo' },
            React__default.createElement(
              'a',
              { href: '/' },
              mobileLogo && screenWidth < 1200 ? React__default.createElement('img', { src: mobileLogo, style: { height: '40px' }, alt: website.title ? website.title : website.name ? website.name : 'Website Logo' }) : React__default.createElement('img', { src: logo, className: 'logo', style: { height: '40px' }, alt: website.title ? website.title : website.name ? website.name : 'Website Logo' })
            )
          )
        ),
        React__default.createElement(
          'div',
          { className: 'site-logo-wrapper', style: { display: 'none' } },
          React__default.createElement(
            'a',
            { href: '/' },
            React__default.createElement('img', { src: logo })
          ),
          React__default.createElement(
            'style',
            { jsx: 'true' },
            '\n              @media screen and (max-width: 1199px) {\n                .site-logo-wrapper {\n                  display: block !important;\n                  margin: auto;\n                  margin-top: 10px;\n                  padding-right: 8%;\n                }\n                .site-logo-wrapper img {\n                  object-fit: contain;\n                  max-height: 38px;\n                }\n                .nav-mobile-logo {\n                  display: none !important;\n                }\n              }\n              @media screen and (max-width: 767px) {\n                .site-logo-wrapper {\n                  padding-right: 17%;\n                }\n              }\n              @media screen and (max-width: 420px) {\n                .site-logo-wrapper img {\n                  max-width: 200px;\n                }\n              }\n            '
          )
        ),
        socialSearchComponent('mobile'),
        subNav && React__default.createElement(
          Navbar.Collapse,
          { id: 'basic-navbar-sub' },
          React__default.createElement(
            Nav,
            { className: 'mr-auto' },
            subNav && subNav.map(function (row, index) {
              if (row.subQuery && row.subQuery.length > 0) {
                return row.name ? React__default.createElement(
                  'div',
                  { key: index },
                  React__default.createElement(
                    NavDropdown,
                    { title: row.name, id: 'basic-nav-dropdown', renderMenuOnMount: true },
                    row.url && React__default.createElement(
                      'a',
                      {
                        className: 'dropdownlist-expand-btn',
                        href: row.url,
                        style: {
                          position: 'absolute',
                          top: '0px',
                          right: '0px',
                          cursor: 'pointer',
                          color: socialIconVariant === 'dark' ? '#000' : '#ffffff',
                          padding: '5px 10px'
                        } },
                      'View More'
                    ),
                    row.subQuery && row.subQuery.map(function (ddRow, subIndex) {
                      if (ddRow.type === 'divider') {
                        return React__default.createElement(NavDropdown.Divider, { key: subIndex });
                      } else {
                        if (ddRow.url && ddRow.name) {
                          return ddRow.url && ddRow.name ? React__default.createElement(
                            'a',
                            {
                              key: subIndex,
                              needsegmentsupport: ddRow && ddRow.needSegmentSupport ? 'true' : '',
                              href: ddRow.url,
                              target: ddRow.blank ? '_blank' : '_self',
                              className: 'dropdown-item' },
                            ddRow.name
                          ) : null;
                        } else return null;
                      }
                    })
                  ),
                  React__default.createElement(
                    'noscript',
                    null,
                    React__default.createElement(
                      'div',
                      null,
                      row.subQuery && row.subQuery.map(function (ddRow, subIndex) {
                        if (ddRow.type === 'divider') {
                          return React__default.createElement(NavDropdown.Divider, { key: subIndex });
                        } else {
                          if (ddRow.url && ddRow.name) {
                            return ddRow.url && ddRow.name ? React__default.createElement(
                              'a',
                              {
                                key: subIndex,
                                needsegmentsupport: ddRow && ddRow.needSegmentSupport ? 'true' : '',
                                href: ddRow.url,
                                target: ddRow.blank ? '_blank' : '_self',
                                className: 'dropdown-item' },
                              ddRow.name
                            ) : null;
                          } else return null;
                        }
                      })
                    )
                  )
                ) : null;
              } else {
                return row.url && row.name ? React__default.createElement(
                  'a',
                  { key: index, needsegmentsupport: row && row.needSegmentSupport ? 'true' : '', href: row.url, target: row.blank ? '_blank' : '_self', className: 'nav-link' },
                  row.name
                ) : null;
              }
            })
          )
        ),
        React__default.createElement(
          Navbar.Collapse,
          { id: 'basic-navbar-nav' },
          React__default.createElement(
            Nav,
            { className: 'mr-auto' },
            dataObject && dataObject.map(function (row, index) {
              if (row.subQuery && row.subQuery.length > 0) {
                if (!row.name) return null;
                return React__default.createElement(
                  'div',
                  { key: index },
                  props.megaNav ? React__default.createElement(
                    NavDropdown,
                    { title: row.name, id: 'basic-nav-dropdown', renderMenuOnMount: true, onClick: function onClick() {
                        return handleMegaMenuAlignment('mega-menu-' + index);
                      } },
                    React__default.createElement(
                      'div',
                      { id: 'mega-menu-' + index, className: 'mega-menu' },
                      chunk_1(row.subQuery, 10).map(function (items, colIndex) {
                        return React__default.createElement(
                          'div',
                          { key: colIndex, className: 'flex-fill' },
                          items && items.map(function (ddRow) {
                            if (ddRow.type === 'divider') {
                              return React__default.createElement(NavDropdown.Divider, { key: ddRow._id });
                            } else {
                              return ddRow.url && ddRow.name ? React__default.createElement(
                                Nav.Item,
                                { key: ddRow._id },
                                React__default.createElement(
                                  Nav.Link,
                                  {
                                    needsegmentsupport: ddRow && ddRow.needSegmentSupport ? 'true' : '',
                                    href: ddRow.url,
                                    target: ddRow.blank ? '_blank' : '_self',
                                    className: 'dropdown-item' },
                                  ddRow.name
                                )
                              ) : null;
                            }
                          })
                        );
                      })
                    )
                  ) : React__default.createElement(
                    NavDropdown,
                    { key: index, title: row.name, id: 'basic-nav-dropdown', renderMenuOnMount: true },
                    row.subQuery && row.subQuery.map(function (ddRow, subIndex) {
                      if (ddRow.type === 'divider') {
                        return React__default.createElement(NavDropdown.Divider, { key: subIndex });
                      } else {
                        return ddRow.url && ddRow.name ? React__default.createElement(
                          Nav.Item,
                          { key: subIndex },
                          React__default.createElement(
                            Nav.Link,
                            {
                              needsegmentsupport: ddRow && ddRow.needSegmentSupport ? 'true' : '',
                              href: ddRow.url,
                              target: ddRow.blank ? '_blank' : '_self',
                              className: 'dropdown-item' },
                            ddRow.name
                          )
                        ) : null;
                      }
                    })
                  ),
                  React__default.createElement(
                    'noscript',
                    null,
                    React__default.createElement(
                      'div',
                      null,
                      row.subQuery && row.subQuery.map(function (ddRow, subIndex) {
                        if (ddRow.type === 'divider') {
                          return React__default.createElement(NavDropdown.Divider, { key: subIndex });
                        } else {
                          return ddRow.url && ddRow.name ? React__default.createElement(
                            'a',
                            {
                              key: subIndex,
                              needsegmentsupport: ddRow && ddRow.needSegmentSupport ? 'true' : '',
                              href: ddRow.url,
                              target: ddRow.blank ? '_blank' : '_self',
                              className: 'dropdown-item' },
                            ddRow.name
                          ) : null;
                        }
                      })
                    )
                  )
                );
              } else {
                return row.url && row.name ? React__default.createElement(
                  'a',
                  { key: index, needsegmentsupport: row.needSegmentSupport ? 'true' : '', href: row.url, target: row.blank ? '_blank' : '_self', className: 'nav-link' },
                  row.name
                ) : null;
              }
            })
          )
        ),
        website && React__default.createElement(
          Navbar.Collapse,
          { id: 'basic-navbar-sub' },
          React__default.createElement(
            Nav,
            { className: 'mr-auto' },
            socialFooterNav ? React__default.createElement(SocialNavFooter, { website: website }) : React__default.createElement(NavFooter, { website: website })
          )
        ),
        socialSearchComponent('desktop')
      )
    ),
    React__default.createElement(
      'noscript',
      null,
      React__default.createElement(
        'style',
        { jsx: 'true' },
        '\n          .navbar .collapse {\n            display: block;\n          }\n          .mobile-nav {\n            max-height: none !important;\n          }\n          @media screen and (min-width: 1200px) {\n            .navbar #basic-navbar-nav .navbar-nav {\n              position: static !important;\n            }\n          }\n        '
      )
    ),
    React__default.createElement(
      'style',
      { jsx: 'true' },
      '\n        .mega-menu {\n          display: block;\n        }\n        @media screen and (min-width: 1192px) {\n          .mega-menu {\n            display: flex;\n          }\n        }\n        .sticky-home {\n          position: relative;\n          top: -3px;\n          left: -6px;\n          cursor: pointer;\n        }\n        .nav-item svg {\n          margin-bottom: 2px;\n        }\n        #nav-login,\n        #nav-logout,\n        #nav-register {\n          padding: 0.5rem;\n          cursor: pointer;\n        }\n        #nav-mobile-login,\n        #nav-mobile-logout,\n        #nav-mobile-register {\n          display: none;\n        }\n        #nav-mobile-logout,\n        #nav-mobile-login {\n          position: absolute;\n          right: 1rem;\n        }\n        #nav-mobile-register {\n          position: absolute;\n          left: 1rem;\n        }\n        #nav-mobile-sm {\n          display: none;\n        }\n        @media screen and (max-width: 1192px) {\n          .mobile-nav .nav-toggle {\n            display: flex;\n            justify-content: space-between;\n          }\n          .nav-mobile-logo {\n            margin-left: 1.5rem;\n          }\n          #nav-mobile-md {\n            margin-right: auto;\n          }\n          .nav-mobile-logo img {\n            height: 48px !important;\n          }\n          .nav-mobile-logo img {\n            height: 38px !important;\n          }\n          .ios-nav {\n            max-height: none;\n          }\n          .mobile-nav .nav-toggle .navbar-toggler {\n            float: left;\n            height: 45px;\n          }\n          .mobile-nav .nav-toggle .form-inline {\n            float: right;\n            margin: 4px 0px 0px 0px;\n          }\n          .mobile-nav .form-inline .mobile-search {\n            width: auto;\n          }\n          .sticky-home {\n            display: none;\n          }\n          .navbar-expand-lg .show#basic-navbar-sub {\n            display: block;\n          }\n          .navbar .mobile-nav .navbar-collapse.show {\n            padding-bottom: 10px;\n            border-bottom: 0.5px solid white;\n          }\n          .navbar .mobile-nav .navbar-collapse .form-inline {\n            display: none;\n          }\n          .navbar .mobile-nav .navbar-collapse {\n            margin-top: 15px;\n            padding-left: 0.5rem;\n          }\n          .navbar .mobile-nav .navbar-collapse:last-child {\n            border-bottom: none;\n            margin-bottom: 0px;\n            padding-bottom: 0px;\n            margin-top: 0px;\n            padding-top: 10px;\n          }\n          .navbar .mobile-nav .navbar-collapse .nav-footer ul {\n            list-style-type: none;\n            padding: inherit;\n            margin-bottom: 0rem;\n          }\n          .navbar .mobile-nav .navbar-collapse .nav-footer .nav-link {\n            text-transform: capitalize !important;\n            font-weight: 300;\n          }\n          .navbar .mobile-nav .dropdown-item:focus {\n            background-color: #696969;\n          }\n          .navbar .mobile-nav .dropdown-menu .dropdown-item {\n            color: white;\n            /* To break text into next line */\n            white-space: inherit !important;\n            margin-bottom: 0.25rem;\n            padding: 0.25rem 0.5rem;\n          }\n          .navbar .mobile-nav .dropdown-menu {\n            background: inherit;\n            border: none;\n            direction: rtl;\n          }\n        }\n        @media screen and (max-width: 1199px) {\n          #nav-mobile-login,\n          #nav-mobile-logout,\n          #nav-mobile-register {\n            display: block;\n          }\n          .navbar-top {\n            flex-direction: row;\n            justify-content: space-around !important;\n            align-items: center;\n            padding-left: 0.25rem;\n            padding-right: 0.25rem;\n            width: 100%;\n          }\n        }\n        @media screen and (min-width: 1200px) {\n          #basic-navbar-nav .navbar-nav {\n            position: fixed !important;\n          }\n          #search-content-mobile {\n            position: absolute;\n            right: 4%;\n            top: 10%;\n          }\n          #basic-navbar-sub {\n            display: none !important;\n          }\n          .navbar .mobile-nav .dropdown-menu .dropdown-item {\n            color: #696969;\n          }\n          .navbar .mobile-nav .dropdown-menu {\n            background: white;\n            border: 1 px solid #708090;\n          }\n          .mobile-nav .nav-toggle .form-inline {\n            display: none;\n          }\n        }\n        @media screen and (max-width: 376px) {\n          .mobile-nav .nav-toggle .form-inline .mobile-search {\n            width: 60%;\n          }\n          .mobile-nav .nav-toggle .form-inline {\n            flex: 1 1 auto;\n            margin-left: 0.25rem;\n          }\n        }\n        @media screen and (max-width: 328px) {\n          .mobile-nav .nav-toggle .form-inline .mobile-search {\n            margin-right: 5px;\n          }\n        }\n        @media screen and (max-width: 767px) {\n          #nav-mobile-md {\n            display: none;\n          }\n          #nav-mobile-sm {\n            display: inline-block;\n            margin: 0 auto 0.5rem;\n          }\n          .nav-toggle {\n            margin: 0.5rem 0;\n            padding: 0 0.5rem;\n          }\n        }\n      '
    )
  );
};

export default NavNative;
export { NavNative };
