<commit_before>const rows = document.querySelectorAll("#allVas .vas__item")
const serviceCountryRows = document.querySelectorAll(".vascountry tbody tr")
const vasInput = document.querySelector("#vasfilter")
const filterBtns = document.querySelectorAll("[data-filterbtn]")
const filterSets = document.querySelectorAll("#filtersets fieldset")
const filterChecks = document.querySelectorAll("[data-check]")
const clearBtn = document.querySelector("#clearfilters")
const vasCutoff = document.querySelector("#vas-cutoff")
const showAll = document.querySelector("#showAll")

function vasTableCutoff() {
  rows.forEach((row, i) => {
    if (i > 7) {
      row.hidden = true
    }
  })
}

function vasHideCutoffs() {
  vasCutoff.hidden = true
}

function clearFilters() {
  vasHideCutoffs()
  const activeBtn = document.querySelector("[data-filterbtn].active")
  if (activeBtn) {
    activeBtn.classList.remove("active")
  }
  filterSets.forEach((set) => {
    set.hidden = true
    set.classList.remove("flex")
  })
  filterChecks.forEach((filterCheck) => {
    filterCheck.checked = false
  })
  rows.forEach((row) => {
    row.hidden = false
    row.classList.remove("vas__item--hidden")
  })
  serviceCountryRows.forEach((row) => {
    row.hidden = false
  })
  vasInput.value = ""

  clearBtn.classList.add("dn")
}

clearBtn.addEventListener("click", function () {
  clearFilters()
})

showAll.addEventListener("click", () => {
  clearFilters()
})

// Input filter
vasInput.addEventListener("keyup", function (e) {
  vasHideCutoffs()
  const query = e.target.value.toLowerCase()
  const notEmpty = query.length >= 1<commit_msg>Filter fix<commit_after>const rows = document.querySelectorAll("#allVas .vas__item")
const serviceCountryRows = document.querySelectorAll(".vascountry tbody tr")
const vasInput = document.querySelector("#vasfilter")
const filterBtns = document.querySelectorAll("[data-filterbtn]")
const filterSets = document.querySelectorAll("#filtersets fieldset")
const filterChecks = document.querySelectorAll("[data-check]")
const clearBtn = document.querySelector("#clearfilters")
const vasCutoff = document.querySelector("#vas-cutoff")
const showAll = document.querySelector("#showAll")

function vasTableCutoff() {
  rows.forEach((row, i) => {
    if (i > 7) {
      row.hidden = true
    }
  })
}

function vasHideCutoffs() {
  vasCutoff.hidden = true
}

function clearFilters() {
  vasHideCutoffs()
  const activeBtn = document.querySelector("[data-filterbtn].active")
  if (activeBtn) {
    activeBtn.classList.remove("active")
  }
  filterSets.forEach((set) => {
    set.hidden = true
    set.classList.remove("flex")
  })
  filterChecks.forEach((filterCheck) => {
    filterCheck.checked = false
  })
  rows.forEach((row) => {
    row.hidden = false
    row.classList.remove("vas__item--hidden")
  })
  serviceCountryRows.forEach((row) => {
    row.hidden = false
  })
  vasInput.value = ""

  clearBtn.classList.add("dn")
}

clearBtn.addEventListener("click", function () {
  clearFilters()
})

showAll.addEventListener("click", () => {
  clearFilters()
})

// Input filter
vasInput.addEventListener("keyup", function (e) {
  vasHideCutoffs()
  rows.forEach((row) => {
    row.hidden = false
  })
  const query = e.target.value.toLowerCase()
  const notEmpty = query.length >= 1
{'fraction_non_alphanumeric': 0.14943922400727494, 'fraction_numerical': 0.0012124886329190664, 'mean_word_length': 4.641025641025641, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 20, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1863457', 'n_tokens_mistral': 988, 'n_tokens_neox': 1027, 'n_words': 177}