const CACHE='wcreports-pwa-v1';
self.addEventListener('install',e=>e.waitUntil(caches.open(CACHE).then(c=>c.addAll(['./','assets/app.css','assets/app.js','manifest.json']))));
self.addEventListener('fetch',e=>{ if(e.request.url.includes('api.php')) return; e.respondWith(caches.match(e.request).then(r=>r||fetch(e.request))); });
