<!--    sélecteurs-->
<div [ngClass]="{
'is-disabled': disabled
}"
     class="input-box"
>

  <i class="ri-search-line search-placeholder"></i>
  <div class="label">
        <span class="d-none">
    {{ label }}
        </span>
  </div>
  <input
    (blur)="displayDropdown = false"
    (click)="onClickInput()"
    (focus)="displayDropdown = true"
    (input)="onSearchInput($event)"
    class=""
    placeholder="{{label}}"
    type="text">

  <span [ngClass]="{ 'is-visible' : selectedChoices?.length}"
        class="selected-items-counter">
    {{ selectedChoices?.length || 0 }}
  </span>
  <div (click)="onClickInput()" class="dropdown-button selector-button">
    <!--          bouton-->
    <i class="ri-arrow-down-s-line"></i>
  </div>

  @if (displayDropdown ) {


    <div class="dropdown">
      <div class="dropdown-list">
        <!--      selected:-->
        @if (selectedChoices?.length && availableChoices?.length) {
          <div class="selected-items">

            @for(sc of getFilteredSelectedChoices(); track sc.value){
            <div (click)="selectedChoicesChangeToggleItem(sc)"

                 class="dropdown-item"
            >
              <i class="ri-checkbox-line"></i>
              {{ sc.label }}
            </div>
            }
          </div>

          <hr>
        }
        <div class="available-items">

<!--          disponibles:-->
          <!--      available:-->
          @for(ac of getFilteredAvailableChoices(); track ac.value){
            <div (click)="availableChoicesChangeToggleItem(ac)"

                 class="dropdown-item"
            >
              <i class="ri-checkbox-line"></i>
              {{ ac.label }}
            </div>
          }

        </div>
      </div>
    </div>
  }

</div>
