<!DOCTYPE html>
<html lang="ko" xmlns:th="http://www.thymeleaf.org">
<div class="mx-3 pt-3" th:fragment="leftMenuFragment">
  <div class="flex-shrink-0 pe-3 py-3 bg-transparent">
      <ul class="list-unstyled ps-0">
      <li class="mb-1" th:each="firstMenu:${session.menuList}">
        <th:block th:each="cat1Code:${session.commonCode.get('CAT1')}">
        <th:block th:if="${cat1Code.itemCd eq firstMenu.cat1Cd}">
           <button class="btn btn-toggle align-items-center rounded collapsed"
                  data-bs-toggle="collapse" aria-expanded="false"
            th:data-bs-target="'#collapse'+${cat1Code.itemCd}" th:text="${cat1Code.itemValue}">
          </button>
          <div class="collapse ps-3" th:id="|collapse${cat1Code.itemCd}|">
            <ul class="btn-toggle-nav list-unstyled fw-normal pb-1">
                <li th:each="secondMenu:${firstMenu.childList}">
                <th:block th:each="cat2Code:${session.commonCode.get('CAT2')}">
                  <th:block th:if="${cat2Code.itemCd eq secondMenu.cat2Cd}">
                  <ul class="list-unstyled ps-0">
                    <li class="mb-1">
                     <th:block th:unless="${#lists.isEmpty(secondMenu.childList)}">
                      <button class="btn btn-toggle align-items-center rounded collapsed"
                              data-bs-toggle="collapse" aria-expanded="false" th:onclick="location.href='#'"
                              th:data-bs-target="'#collapse'+${cat2Code.itemCd}" th:text="${cat2Code.itemValue}">
                      </button>
                      </th:block>
                     <th:block th:if="${#lists.isEmpty(secondMenu.childList)}">
                      <a th:href="@{${secondMenu.menuUrl}}" class="bi bi-dash link-dark rounded ps-3 text-decoration-none"
                               th:text="${cat2Code.itemValue}"></a>
                      </th:block>
                      <div class="collapse ps-3" th:id="|collapse${cat2Code.itemCd}|">
                        <ul class="btn-toggle-nav list-unstyled fw-normal pb-1">
                          <li th:each="thirdMenu:${secondMenu.childList}">
                          <th:block th:each="cat3Code:${session.commonCode.get('CAT3')}">
                            <th:block th:if="${cat3Code.itemCd eq thirdMenu.cat3Cd}">
                            <ul class="list-unstyled ps-0">
                              <li>
                              <a th:href="@{${thirdMenu.menuUrl}}" class="bi bi-dash link-dark rounded ps-3 text-decoration-none"
                               th:text="${cat3Code.itemValue}"></a>
                              </li>
                            </ul>
                            </th:block>
                            </th:block>
                          </li>
                        </ul>
                      </div>
                    </li>
                  </ul>
                  </th:block>
                  </th:block>
                </li>
            </ul>
          </div>
          </th:block>
          </th:block>
        </li>
      </ul>
    </div>
</div>
</html>