import { extend, mergeData } from '../../vue';
import { NAME_NAV_ITEM } from '../../constants/components';
import { PROP_TYPE_OBJECT, PROP_TYPE_ARRAY_OBJECT_STRING } from '../../constants/props';
import { omit, sortKeys } from '../../utils/object';
import { makePropsConfigurable, makeProp, pluckProps } from '../../utils/props';
import { props as props$1, BLink } from '../link/link';

// --- Props ---

const linkProps = omit(props$1, ['event', 'routerTag']);
const props = makePropsConfigurable(sortKeys({
  ...linkProps,
  linkAttrs: makeProp(PROP_TYPE_OBJECT, {}),
  linkClasses: makeProp(PROP_TYPE_ARRAY_OBJECT_STRING)
}), NAME_NAV_ITEM);

// --- Main component ---

// @vue/component
const BNavItem = /*#__PURE__*/extend({
  name: NAME_NAV_ITEM,
  functional: true,
  props,
  render(h, _ref) {
    let {
      props,
      data,
      listeners,
      children
    } = _ref;
    return h('li', mergeData(omit(data, ['on']), {
      staticClass: 'nav-item'
    }), [h(BLink, {
      staticClass: 'nav-link',
      class: props.linkClasses,
      attrs: props.linkAttrs,
      props: pluckProps(linkProps, props),
      on: listeners
    }, children)]);
  }
});

export { BNavItem, props };
