import { register } from 'register-service-worker'

// The ready(), registered(), cached(), updatefound() and updated()
// events passes a ServiceWorkerRegistration instance in their arguments.
// ServiceWorkerRegistration: https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerRegistration

register(process.env.SERVICE_WORKER_FILE, {
  // The registrationOptions object will be passed as the second argument
  // to ServiceWorkerContainer.register()
  // https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/register#Parameter

  // registrationOptions: { scope: './' },

  ready (/* registration */) {
    // console.log('Service worker is active.')
  },

  registered (/* registration */) {
    // console.log('Service worker has been registered.')
  },

  cached (/* registration */) {
    // console.log('Content has been cached for offline use.')
  },

  updatefound (/* registration */) {
    // console.log('New content is downloading.')
  },

  updated (/* registration */) {
    // console.log('New content is available; please refresh.')
  },

  offline () {
    // console.log('No internet connection found. App is running in offline mode.')
  },

  error (/* err */) {
    // console.error('Error during service worker registration:', err)
  }
})

@@ -43,16 +43,98 @@
 -worker'
+%0Aimport %7B Notify %7D from 'quasar'%0Aimport %7B mdiCached %7D from '@quasar/extras/mdi-v5'
 %0A%0A// The
@@ -1092,35 +1092,103 @@
 ) %7B%0A    
-// console.log('New
+Notify.create(%7B%0A      color: 'negative',%0A      icon: mdiCached,%0A      message: 'Updated
  content
@@ -1204,11 +1204,11 @@
 able
-; p
+. P
 leas
@@ -1216,18 +1216,377 @@
  refresh
-.'
+ the page.',%0A      timeout: 0,%0A      multiLine: true,%0A      position: 'top',%0A      actions: %5B%0A        %7B%0A          label: 'Refresh',%0A          color: 'yellow',%0A          handler: () =%3E %7B%0A            window.location.reload()%0A          %7D%0A        %7D,%0A        %7B%0A          label: 'Dismiss',%0A          color: 'white',%0A          handler: () =%3E %7B%7D%0A        %7D%0A      %5D%0A    %7D
 )%0A  %7D,%0A%0A

add back the "update is available" PWA banner