export function slugify(text) {
  return text.toLowerCase().replace(/[^\w]+/g, '-');
}
export const sample = (array) => array[Math.floor(Math.random() * array.length)];
export const keyBy = (array, keyMap, valMap) => array.reduce((obj, item) => {
  obj[keyMap(item)] = valMap ? valMap(item) : item;
  return obj;
}, {});
export const debounce = (fn, wait) => {
  let scheduled = null;
  return (...args) => {
    clearTimeout(scheduled);
    scheduled = setTimeout(fn, wait, ...args);
  };
};
export function MyMoodTemplate(feeling, intensity, location) {
  return `Mood : ${feeling} and Level: ${intensity} <gi-mood-image src="${location}"></gi-mood-image>`;
}
export function MyHealthTemplate(heartRate) {
  return `Heart rate  ${heartRate} bpm`;
}
export function MyGoalTemplate(goalName, text, progress) {
  return `Goal update: ${goalName} ${text} Progress: ${progress}`;
}
export class SparkleGlobal {
}
SparkleGlobal.MY_GOALS_APP_ID = 1;
SparkleGlobal.MY_HEALTH_APP_ID = 2;
SparkleGlobal.MY_MOOD_APP_ID = 3;
