{namespace neos=Neos\Neos\ViewHelpers}

<ul class="c-footer-menu">
    <f:for each="{items}" as="item" iteration="menuItemIterator">
        <li class="c-footer-menu__item">
            <f:if condition="{item.state} == 'current'">
                <f:then>
                    <neos:link.node node="{item.node}" additionalAttributes="{'aria-current': 'page'}" class="c-footer-menu__link">
                        <svg class="c-footer-menu__icon c-icon">
                            <use xlink:href="#icon-angle-right"></use>
                        </svg>
                        {item.label}
                    </neos:link.node>
                </f:then>
                <f:else>
                    <f:if condition="{item.node.properties.openInNewTab}">
                        <f:then>
                            <f:if condition="{item.node.properties.showLinkPopup}">
                                <f:then>
                                    <div
                                        class="c-footer-menu__link"
                                        data-target-enhancement
                                        data-target-enhancement-targets.0="[data-link-popup-{item.node.identifier}]"
                                        data-target-enhancement-plugins.0.name="toggle-aria-expanded"
                                        data-target-enhancement-exclusive-group="link-popup"
                                    >
                                        <svg class="c-footer-menu__icon c-icon">
                                            <use xlink:href="#icon-angle-right"></use>
                                        </svg>
                                        <span>{item.label}</span>
                                    </div>
                                    <f:render partial="LinkPopUp" arguments="{_all}" />
                                </f:then>
                                <f:else>
                                    <neos:link.node node="{item.node}" class="c-footer-menu__link" target="_blank" rel="noopener noreferrer">
                                        <svg class="c-footer-menu__icon c-icon">
                                            <use xlink:href="#icon-angle-right"></use>
                                        </svg>
                                        <span>{item.label}</span>
                                    </neos:link.node>
                                </f:else>
                            </f:if>
                        </f:then>
                        <f:else>
                            <f:if condition="{item.node.properties.showLinkPopup}">
                                <f:then>
                                    <div
                                        class="c-footer-menu__link"
                                        data-target-enhancement
                                        data-target-enhancement-targets.0="[data-link-popup-{item.node.identifier}]"
                                        data-target-enhancement-plugins.0.name="toggle-aria-expanded"
                                        data-target-enhancement-exclusive-group="link-popup"
                                    >
                                        <svg class="c-footer-menu__icon c-icon">
                                            <use xlink:href="#icon-angle-right"></use>
                                        </svg>
                                        <span>{item.label}</span>
                                    </div>
                                    <f:render partial="LinkPopUp" arguments="{_all}" />
                                </f:then>
                                <f:else>
                                    <neos:link.node node="{item.node}" class="c-footer-menu__link">
                                        <svg class="c-footer-menu__icon c-icon">
                                            <use xlink:href="#icon-angle-right"></use>
                                        </svg>
                                        <span>{item.label}</span>
                                    </neos:link.node>
                                </f:else>
                            </f:if>
                        </f:else>
                    </f:if>
                </f:else>
            </f:if>
        </li>
    </f:for>
</ul>
