<!doctype html>
<html lang="en">

<head>
  <!-- Required meta tags -->
  <meta charset="utf-8">
  <meta name="viewport"
    content="width=device-width, initial-scale=1, shrink-to-fit=no, maximum-scale=1, user-scalable=0">
  <title>LiveTaskyell</title>
  <link rel="stylesheet" href="./css/notosansjp.css">
  <link rel="stylesheet" href="./fontawesome/css/all.css" >
  <link rel="stylesheet" href="./css/bootstrap.min.css">
  <link rel="stylesheet" href="./css/common.css">
  <link rel="stylesheet" href="./css/chat.css">
  <link rel="stylesheet" href="./css/contact.css">
  <link rel="stylesheet" href="./css/footer.css">
  <link rel="stylesheet" href="./css/font-awesome.css">
</head>

<body>
  <!-- ナビメニュー -->
  <nav>
    <div class="row h-100 align-items-center">
      <div class="col-4 pr-0">
        <div class="nav-item">
          <div class="nav_prev">
            <a href="chat.html"><span>チャット</span></a>
          </div>
        </div>
      </div>
      <div class="col-4 p-0">
        <div class="nav-item p-0">
          <h1 class="nav-ttl" id="makeRoomTitle">ルーム開設</h1>
        </div>
      </div>
      <div class="col-4 pl-0">
        <div class="nav-item text-right">
        </div>
      </div><!-- .col -->
    </div><!-- .row -->
  </nav><!-- nav -->

  <!-- コンテンツ -->
  <main id="chatMakeRoom">
    <form id="makeRoomForm" action="chat_make_room_confirm.html" method="post">
      <!-- ユーザー検索 -->
      <div class="search_form">
        <input type="search" name="search" placeholder="ユーザー検索" maxlength="30">
        <span class="src_icon"></span>
        <a href="#" class="cancel none">キャンセル</a>
        <input type="input" name="hidden_for_prevent_submit" hidden>
      </div>

      <!-- タブ -->
      <div class="content tabs">
        <input id="tabMyGroupOnMakeRoom" type="radio" name="tab_item" checked>
        <label class="tab_item m-0" for="tabMyGroupOnMakeRoom">マイグループ</label>
        <input id="tabAllGroupOnMakeRoom" type="radio" name="tab_item">
        <label class="tab_item m-0" for="tabAllGroupOnMakeRoom">全グループ</label>
        <div class="tab_content" id="tab1_content">
          <div class="chat_list">
            <!-- お気に入りグループ -->
            <div class="category">
              <div class="category_name"><span>お気に入り</span></div>
            </div>
            <div id="favoriteListForMakeRoom"></div>
            <div id="myGroupListForMakeRoom"></div>
          </div>
        </div>
        <div class="tab_content" id="tab2_content">
          <div class="breadcrumb" id="groupPathAreaForMakeRoom"></div>
          <div class="chat_list">
            <!-- 全グループ -->
            <ul class="p-0 chat_make_room_list">
              <li class="d-flex align-items-center" id="rootGroupArea">
                <a href="#" class="w-100" id="rootGroupBtnForMakeRoom">
                  <div class="chat_item d-flex flex-row align-items-center">
                    <div class="chat_item_l">
                      <div class="thumbnail">
                        <img src="icon/icon_prev_top.svg" alt="トップグループに戻る" />
                      </div>
                    </div>
                    <div class="chat_item_m px-0">
                      <div class="d-flex flex-column">
                        <div class="chat_item_t">
                          <span class="chat_item_ttl">トップグループに戻る</span>
                        </div>
                      </div>
                    </div>
                  </div>
                </a>
              </li>
              <li class="d-flex align-items-center" id="parentGroupArea">
                <a href="#" class="w-100" id="parentGroupBtnForMakeRoom">
                  <div class="chat_item d-flex flex-row align-items-center">
                    <div class="chat_item_l">
                      <div class="thumbnail">
                        <img src="icon/icon_prev.svg" alt="上位グループに戻る" />
                      </div>
                    </div>
                    <div class="chat_item_m px-0">
                      <div class="d-flex flex-column">
                        <div class="chat_item_t">
                          <span class="chat_item_ttl">上位グループに戻る</span>
                        </div>
                      </div>
                    </div>
                  </div>
                </a>
              </li>
              <div id="childGroupListAreaForMakeRoom" class="chat_make_room"></div>
              <div id="userInGroupListForMakeRoom" class="chat_make_room"></div>
            </ul>
          </div>
        </div>
      </div>
      <div class="chat_make_room">
        <ul class="overlay_src_msg" style="padding-inline-start: 20px;">
        </ul>
      </div>

      <!-- ルーム解説ボタン -->
      <div class="make_room_confirm_btn content" id="makeRoomConfirmBtn">
        <button type="button" name="button">
          ルーム開設<br>
          <span class="select_member_num"></span><span class="select_member">名 選択中</span></button>
      </div>
    </form>
  </main>

  <!-- Library -->
  <script src="./js/libs/jquery-3.3.1.min.js"></script>
  <script src="./js/libs/moment.js"></script>
  <script src="./js/libs/locale/ko.js" charset="UTF-8"></script>
  <script src="./js/libs/locale/ja.js" charset="UTF-8"></script>
  <script src="./js/libs/mustache.min.js"></script>
  <script src="./js/libs/bootstrap.min.js"></script>
  <script src="./js/libs/jquery.mark.min.js"></script>
  <!-- Language -->
  <script src="./js/languages/language.js"></script>
  <script src="./js/languages/language_ko.js" charset="UTF-8"></script>
  <script src="./js/languages/language_ja.js" charset="UTF-8"></script>
  <script src="./js/languages/language_en.js" charset="UTF-8"></script>
  <!-- Common -->
  <script src="./js/common/constant.js"></script>
  <script src="./js/common/native-bridge-delegate.js"></script>
  <script src="./js/common/native-bridge-datasource.js"></script>
  <script src="./js/common/common.js"></script>
  <script src="./js/utils/chat-util.js"></script>
  <!-- Models -->
  <script src="./js/Models/deviceinfo.js"></script>
  <script src="./js/Models/serverinfo.js"></script>
  <script src="./js/Models/userinfo.js"></script>
  <!-- View -->
  <script src="./js/views/chats/management/chat-management-common.js"></script>
  <script src="./js/views/chats/management/chat-make-room.js"></script>

  <script>
    if (NativeBridgeDataSource.loadSelectedUsers() != "") {
      let selectedUsers = NativeBridgeDataSource.loadSelectedUsers();
      selectedUsers.forEach(function (user) {
        ChatManagementCommon.selectedUserList.push(user.shopMemberId);
      })
    };

    if (ChatManagementCommon.selectedUserList.length > 0) {
      $('.select_member_num').text(ChatManagementCommon.selectedUserList.length);
    } else {
      $('.select_member_num').text('0');
    }
    ChatMakeRoom.refreshMyGroupForMakeRoom();
  </script>
</body>

</html>