<%
  var hasInnerArchive = theme.smart_menu.innerArchive
  var hasFriends = theme.smart_menu.friends
  var hasAboutme = theme.smart_menu.aboutme
%>
<div class="tools-col" :class="{show:isShow,hide:!isShow}" @click="stop">
  <div class="tools-nav header-menu">
    <ul style="width:70%">
    <% var divide = 100 / Object.keys(theme.smart_menu).length + '%' 
    for (let menu_name in theme.smart_menu){ 
      if(theme.smart_menu[menu_name]){ %>
      <li style="width: <%= divide %>" @click="openSlider($event, '<%-menu_name%>')"><a href="javascript:void(0)" :class="{active:<%-menu_name%>}"><%= __(theme.smart_menu[menu_name]) %></a></li>
      <% }
      } %>
    </ul>
  </div>
  <div class="tools-wrap">
    <%if(hasInnerArchive){%>
    	<section class="tools-section tools-section-all" v-show="innerArchive">
        <div class="search-wrap" >
          <span :class="'search-item'" v-for="(searchItem,index) in searchItems" :key="index">
            <i class="icon icon-book" v-if="searchItem.type === 'category'"></i>
            <i class="icon icon-tag" v-if="searchItem.type === 'tag'"></i>
            <i class="icon icon-calendar" v-if="searchItem.type === 'date'"></i>
            {{searchItem.query}}
            <i class="icon icon-close" @click="searchItems.splice(index,1)"></i>
          </span>
          <input class="search-ipt" v-model="search" @blur="addSearchItem(search)" @keydown="searchKeydown" type="text" placeholder="<%=__('search') %>…">
          <i class="icon icon-search" @click="addSearchItem(search)"></i>
        </div>
        <div class="widget tagcloud search-tag">
          <div>
            <span ><%=__('tags') %>:</span>
            <label class="bui-switch-label bui-switch-animbg">
              <input type="checkbox" @click="showTags=!showTags"/>
              <i class="bui-switch"></i>
            </label>
            <span style="margin-left: 50px;"><%=__('categories') %>:</span>
            <label class="bui-switch-label bui-switch-animbg">
              <input type="checkbox" @click="showCategories=!showCategories"/>
              <i class="bui-switch"></i>
            </label>
          </div>
          <ul class="article-tag-list" v-show="showTags">
            <% site.tags.forEach(function(tag, i){ %> 
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" @click="addSearchItem('<%-tag.name%>','tag')" class="js-tag color<%= tag.name.length % 7 + 1 %>"><%-tag.name%></a>
              </li>
            <% }) %>
            <div class="clearfix"></div>
          </ul>
          <ul class="article-tag-list" v-show="showCategories">
            <% site.categories.forEach(function(category, i){ %> 
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" @click="addSearchItem('<%-category.name%>','category')" class="js-tag color<%= category.name.length % 7 + 1 %>"><%-category.name%></a>
              </li>
            <% }) %>
            <div class="clearfix"></div>
          </ul>
        </div>
        <ul class="search-ul">
          <li class="search-li" v-for="(item,index) in items" :key="index" v-show="!item.isHide">
            <a :href="item.path|urlformat" class="search-title"><i class="icon icon-quote-left"></i>
              <span v-text="item.title"></span>
            </a>
            <p class="search-time" v-if="item.date">
              <i class="icon icon-calendar"></i>
              <span v-text="item.date" @click="addSearchItem(item.date.substr(0,7),'date')"></span>
            </p>
            <p class="search-category" v-if="item.categories.length">
              <i class="icon icon-book" ></i>
              <span v-for="(category,index) in item.categories" :key="index" @click="addSearchItem(category.name, 'category')" v-text="category.name"></span>
            </p>
            <p class="search-tag" v-if="item.tags.length">
              <i class="icon icon-tags" ></i>
              <span v-for="tag in item.tags" @click="addSearchItem(tag.name, 'tag')" v-text="tag.name"></span>
            </p>
          </li>
        </ul>
    	</section>
    <%}%>
    <%if(hasFriends){%>
    	<section class="tools-section tools-section-friends" v-show="friends">
  		<%if(theme.friends && theme.friends.length != 0){%>
        <ul class="search-ul">
          <% for (var i in theme.friends){ %>
            <li class="search-li">
              <a href="<%- url_for(theme.friends[i]) %>" target="_blank" class="search-title"><i class="icon icon-quote-left"></i><%= i %></a>
            </li>
          <% } %>
        </ul>
  		<%}%>
    	</section>
    <%}%>
    <%if(hasAboutme){%>
    	<section class="tools-section tools-section-me" v-show="aboutme">
      <%if(theme.aboutme){%>
        <div class="aboutme-wrap" id="js-aboutme"><%-theme.aboutme%></div>
      <%}%>
    	</section>
    <%}%>
  </div>
</div>