text: /**
   * Copyright 2020 Marius Wilms, Christoph Labacher. All rights reserved.
   * Copyright 2019 Atelier Disko. All rights reserved.
   *
   * Use of this source code is governed by a BSD-style
   * license that can be found in the LICENSE file.
   */
  
  // via https://gist.github.com/hagemann/382adfc57adbd5af078dc93feef01fe1
  export function slugify(string) {
    const a = 'àáäâãåăæçèéëêǵḧìíïîḿńǹñòóöôœṕŕßśșțùúüûǘẃẍÿź·/_,:;';
    const b = 'aaaaaaaaceeeeghiiiimnnnoooooprssstuuuuuwxyz------';
    const p = new RegExp(a.split('').join('|'), 'g');
    return string
      .toString()
      .toLowerCase()
      .replace(/\s+/g, '-') // Replace spaces with -
      .replace(p, c => b.charAt(a.indexOf(c))) // Replace special characters
      .replace(/&/g, '-and-') // Replace & with ‘and’
      .replace(/[^\w-]+/g, '') // Remove all non-word characters
      .replace(/--+/g, '-') // Replace multiple - with single -
      .replace(/^-+/, '') // Trim - from start of text
      .replace(/-+$/, ''); // Trim - from end of text
  }
  
  // via https://stackoverflow.com/a/30810322/
  export function copyTextToClipboard(text) {
    var textArea = document.createElement('textarea');
  
    textArea.style.position = 'fixed';
    textArea.style.top = -1000;
    textArea.style.left = -1000;
  
    textArea.value = text;
  
    document.body.appendChild(textArea);
    textArea.focus();
    textArea.select();
  
    try {
      document.execCommand('copy');
    } catch (err) {
      console.log('Oops, unable to copy');
    }
  
    document.body.removeChild(textArea);
  }
  