{# Parameters:
  - collapse_id (string) (default: '')
  - background (string) (default: '')
  - brand (object) (default: {})
    format: {
      src: '',
      alt: '',
      class: '',
      label: '', (optional: only for string label)
      link: '',
    }
  - navigation (object Navigation) (default: {})
  - form (object Form) (default: {})
  - expand (string) (default: 'lg')
    options: ['sm', 'md', 'lg']
  - color_set (string) (default: 'light')
    options ['light', 'dark']
  - disable_collapse (boolean) (default: false)
  - attributes (drupal attrs)

  Blocks
    - branding
    - navigation
    - right
#}

{%- set _collapse_id = collapse_id|default('') %}
{% set _background = background|default('') %}
{% set _brand = brand|default({}) %}
{% set _navigation = navigation|default({}) %}
{% set _form = form|default({}) %}
{% set _expand = expand|default('lg') %}
{% set _color_set = color_set|default('light') %}
{% set _disable_collapse = disable_collapse ?? false %}

{%- set _classes = ['navbar', 'navbar-expand-' ~ _expand] %}
{% if _background is not empty %}
  {%- set _classes = _classes|merge(['bg-' ~ _background]) %}
{% endif %}
{% if _color_set is not empty %}
  {%- set _classes = _classes|merge(['navbar-' ~ _color_set]) %}
{% endif %}

{%- if attributes is empty %}
  {%- set attributes = create_attribute() %}
{% endif %}

{%- set attributes = attributes.addClass(_classes) -%}

<nav
  {{ attributes }}
>{# -#}
  <div class='container'>
  {%- block branding %}
    {%- if _brand is not empty -%}
      <a class='navbar-brand' href='{{ _brand.link }}'>
      {%- for logo in _brand.logos -%}
        <img
          src='{{ logo.src }}'
          {% if logo.alt is not empty %}
          alt='{{ logo.alt }}'
          {% endif %}
          {%- if logo.class is not empty %}
          class='{{ logo.class }}'
          {% endif %}
        />
      {%- endfor %}
    {%- if _brand.label is defined -%}
    <div class="h5 ms-4-5 d-none d-lg-inline-block">
      {{- _brand.label -}}
      </div>
    {%- endif -%}
      </a>
    {%- endif %}
  {%- endblock %}

  {%- if not _disable_collapse -%}
    <button
      class="navbar-toggler"
      type="button"
      data-bs-toggle="collapse"
      data-bs-target='#{{ _collapse_id }}'
      aria-controls='{{ _collapse_id }}'
      aria-expanded="false"
      aria-label="Toggle navigation"
    >{# -#}
      <span class="navbar-toggler-icon"></span>{# -#}
    </button>{# -#}
    <div class="collapse navbar-collapse" id='{{ _collapse_id }}'>
  {%- endif %}
  {%- block navigation %}
    {%- if _navigation is not empty %}
      {%- include '@oe-bcl/bcl-navigation/navigation.html.twig' with _navigation only %}
    {%- endif %}
  {%- endblock %}
  {%- block right %}
    {%- if _form is not empty %}
      {%- include '@oe-bcl/bcl-form/form.html.twig' with _form only %}
    {%- endif %}
  {%- endblock %}
  {%- if not _disable_collapse -%}
    </div>
  {%- endif -%}
  </div>{# -#}
</nav>
{#--#}
