{% macro menuTree(menu, level_max, level = 0) %}
   <ul class="list-unstyled">
      {% for item in menu %}
         {% if item.figure == 'Y' %}
            <li class="item-{{ item.id }}">
               <a href="{{ item.correct_url }}"{% if item.target %} target="{{ item.target }}"{% endif %}
                  title="{{ item.name }}">{{ item.name_short }}</a>
               {% if (level < level_max or level_max < 0) and item.children %}
                  {{ _self.menuTree(item.children, level_max, level + 1) }}
               {% endif %}
            </li>
         {% endif %}
      {% endfor %}
   </ul>
{% endmacro %}

{% if this.menu %}
   <nav {{ attributes.defaults(stimulus_controller(this.shortName, {
      breakpoint: this.breakpoint,
   })) }}>
      {% for item in this.menu.children %}
         {% if item.figure == 'Y' and item.children %}
            <div class="column">
               <button type="button" class="title-default"
                       aria-controls="{{ this.shortName }}-{{ item.id }}"
                       data-{{ this.shortName }}-id-param="{{ item.id }}"
                     {{ stimulus_target(this.shortName, 'toggler') }}
                     {{ stimulus_action(this.shortName, 'toggleMenu', 'click') }}>
                  {{ item.name_short }}
                  <twig:ux:icon name="caret-down" class="c-icon arrow-icon"/>
               </button>

               <ul id="{{ this.shortName }}-{{ item.id }}"
                   class="list-unstyled" data-menu-id="{{ item.id }}"
                     {{ stimulus_target(this.shortName, 'submenu') }}>
                  {% for child in item.children %}
                     {% if child.figure == 'Y' %}
                        <li class="item-{{ child.id }}">
                           <a href="{{ child.correct_url }}"{% if child.target %} target="{{ child.target }}"{% endif %}
                              title="{{ child.name }}">{{ child.name_short }}</a>
                        </li>
                     {% endif %}
                  {% endfor %}
               </ul>
            </div>
         {% endif %}
      {% endfor %}
   </nav>
{% endif %}
