'use strict';

const store = require('./store-5a3b44dc.js');

function cleanAndLowerString(str) {
  if (!str)
    return str;
  return str
    .replace(/\s{2,}/g, " ")
    .trim()
    .toLowerCase();
}

function getServiceTypes({ filterBy, } = {}) {
  const services = filterBy
    ? ((store.state === null || store.state === void 0 ? void 0 : store.state.services) || []).filter(filterBy)
    : (store.state === null || store.state === void 0 ? void 0 : store.state.services) || [];
  return [
    ...new Set(services.map((service) => cleanAndLowerString(service === null || service === void 0 ? void 0 : service.tab))),
  ]
    .sort((a, b) => (a > b ? 1 : -1))
    .filter((value) => value === null || value === void 0 ? void 0 : value.length)
    .map((value) => ({
    label: value,
    value,
  }));
}

exports.cleanAndLowerString = cleanAndLowerString;
exports.getServiceTypes = getServiceTypes;
