text: import { Workbox } from 'workbox-window';
  import Editor from './editor';
  import './database';
  import '../css/style.css';
  
  const main = document.querySelector('#main');
  main.innerHTML = '';
  
  const loadSpinner = () => {
    const spinner = document.createElement('div');
    spinner.classList.add('spinner');
    spinner.innerHTML = `
    <div class="loading-container">
    <div class="loading-spinner" />
    </div>
    `;
    main.appendChild(spinner);
  };
  
  const editor = new Editor();
  
  if (typeof editor === 'undefined') {
    loadSpinner();
  }
  
  // service workers allow apps to continue functioning offline in case the user loses internet connection
  // Check if service workers are supported
  if ('serviceWorker' in navigator) {
    // register workbox service worker
    const workboxSW = new Workbox('/src-sw.js');
    // register service worker
    workboxSW.register();
  } else {
    console.error('Service workers are not supported in this browser.');
  }
  