2 lines
No EOL
29 KiB
JavaScript
2 lines
No EOL
29 KiB
JavaScript
!function(){"use strict";var e={913:function(){try{self["workbox:core:6.5.4"]&&_()}catch(e){}},550:function(){try{self["workbox:expiration:6.5.4"]&&_()}catch(e){}},977:function(){try{self["workbox:precaching:6.5.4"]&&_()}catch(e){}},80:function(){try{self["workbox:routing:6.5.4"]&&_()}catch(e){}},873:function(){try{self["workbox:strategies:6.5.4"]&&_()}catch(e){}}},t={};function s(a){var r=t[a];if(void 0!==r)return r.exports;var i=t[a]={exports:{}},n=!0;try{e[a](i,i.exports,s),n=!1}finally{n&&delete t[a]}return i.exports}!function(){var e;let t,a,r,i,n;s(913);let o=(e,...t)=>{let s=e;return t.length>0&&(s+=` :: ${JSON.stringify(t)}`),s};class c extends Error{constructor(e,t){let s=o(e,t);super(s),this.name=e,this.details=t}}let l=new Set,h={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:"undefined"!=typeof registration?registration.scope:""},u=e=>[h.prefix,e,h.suffix].filter(e=>e&&e.length>0).join("-"),d=e=>{for(let t of Object.keys(h))e(t)},f={updateDetails:e=>{d(t=>{"string"==typeof e[t]&&(h[t]=e[t])})},getGoogleAnalyticsName:e=>e||u(h.googleAnalytics),getPrecacheName:e=>e||u(h.precache),getPrefix:()=>h.prefix,getRuntimeName:e=>e||u(h.runtime),getSuffix:()=>h.suffix};function p(e,t){let s=new URL(e);for(let e of t)s.searchParams.delete(e);return s.href}async function g(e,t,s,a){let r=p(t.url,s);if(t.url===r)return e.match(t,a);let i=Object.assign(Object.assign({},a),{ignoreSearch:!0}),n=await e.keys(t,i);for(let t of n){let i=p(t.url,s);if(r===i)return e.match(t,a)}}function w(e){e.then(()=>{})}class m{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}}async function y(){for(let e of l)await e()}let x=e=>{let t=new URL(String(e),location.href);return t.href.replace(RegExp(`^${location.origin}`),"")};function b(e){return new Promise(t=>setTimeout(t,e))}function E(e,t){let s=t();return e.waitUntil(s),s}async function R(e,s){let a=null;if(e.url){let t=new URL(e.url);a=t.origin}if(a!==self.location.origin)throw new c("cross-origin-copy-response",{origin:a});let r=e.clone(),i={headers:new Headers(r.headers),status:r.status,statusText:r.statusText},n=s?s(i):i,o=!function(){if(void 0===t){let e=new Response("");if("body"in e)try{new Response(e.body),t=!0}catch(e){t=!1}t=!1}return t}()?await r.blob():r.body;return new Response(o,n)}let v=(e,t)=>t.some(t=>e instanceof t),C=new WeakMap,T=new WeakMap,k=new WeakMap,D=new WeakMap,L=new WeakMap,N={get(e,t,s){if(e instanceof IDBTransaction){if("done"===t)return T.get(e);if("objectStoreNames"===t)return e.objectStoreNames||k.get(e);if("store"===t)return s.objectStoreNames[1]?void 0:s.objectStore(s.objectStoreNames[0])}return S(e[t])},set:(e,t,s)=>(e[t]=s,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function S(e){var t;if(e instanceof IDBRequest)return function(e){let t=new Promise((t,s)=>{let a=()=>{e.removeEventListener("success",r),e.removeEventListener("error",i)},r=()=>{t(S(e.result)),a()},i=()=>{s(e.error),a()};e.addEventListener("success",r),e.addEventListener("error",i)});return t.then(t=>{t instanceof IDBCursor&&C.set(t,e)}).catch(()=>{}),L.set(t,e),t}(e);if(D.has(e))return D.get(e);let s="function"==typeof(t=e)?t!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(r||(r=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(t)?function(...e){return t.apply(U(this),e),S(C.get(this))}:function(...e){return S(t.apply(U(this),e))}:function(e,...s){let a=t.call(U(this),e,...s);return k.set(a,e.sort?e.sort():[e]),S(a)}:(t instanceof IDBTransaction&&function(e){if(T.has(e))return;let t=new Promise((t,s)=>{let a=()=>{e.removeEventListener("complete",r),e.removeEventListener("error",i),e.removeEventListener("abort",i)},r=()=>{t(),a()},i=()=>{s(e.error||new DOMException("AbortError","AbortError")),a()};e.addEventListener("complete",r),e.addEventListener("error",i),e.addEventListener("abort",i)});T.set(e,t)}(t),v(t,a||(a=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])))?new Proxy(t,N):t;return s!==e&&(D.set(e,s),L.set(s,e)),s}let U=e=>L.get(e),P=["get","getKey","getAll","getAllKeys","count"],A=["put","add","delete","clear"],I=new Map;function M(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&"string"==typeof t))return;if(I.get(t))return I.get(t);let s=t.replace(/FromIndex$/,""),a=t!==s,r=A.includes(s);if(!(s in(a?IDBIndex:IDBObjectStore).prototype)||!(r||P.includes(s)))return;let i=async function(e,...t){let i=this.transaction(e,r?"readwrite":"readonly"),n=i.store;return a&&(n=n.index(t.shift())),(await Promise.all([n[s](...t),r&&i.done]))[0]};return I.set(t,i),i}N={...e=N,get:(t,s,a)=>M(t,s)||e.get(t,s,a),has:(t,s)=>!!M(t,s)||e.has(t,s)},s(550);let q="cache-entries",K=e=>{let t=new URL(e,location.href);return t.hash="",t.href};class O{constructor(e){this._db=null,this._cacheName=e}_upgradeDb(e){let t=e.createObjectStore(q,{keyPath:"id"});t.createIndex("cacheName","cacheName",{unique:!1}),t.createIndex("timestamp","timestamp",{unique:!1})}_upgradeDbAndDeleteOldDbs(e){this._upgradeDb(e),this._cacheName&&function(e,{blocked:t}={}){let s=indexedDB.deleteDatabase(e);t&&s.addEventListener("blocked",e=>t(e.oldVersion,e)),S(s).then(()=>void 0)}(this._cacheName)}async setTimestamp(e,t){e=K(e);let s={url:e,timestamp:t,cacheName:this._cacheName,id:this._getId(e)},a=await this.getDb(),r=a.transaction(q,"readwrite",{durability:"relaxed"});await r.store.put(s),await r.done}async getTimestamp(e){let t=await this.getDb(),s=await t.get(q,this._getId(e));return null==s?void 0:s.timestamp}async expireEntries(e,t){let s=await this.getDb(),a=await s.transaction(q).store.index("timestamp").openCursor(null,"prev"),r=[],i=0;for(;a;){let s=a.value;s.cacheName===this._cacheName&&(e&&s.timestamp<e||t&&i>=t?r.push(a.value):i++),a=await a.continue()}let n=[];for(let e of r)await s.delete(q,e.id),n.push(e.url);return n}_getId(e){return this._cacheName+"|"+K(e)}async getDb(){return this._db||(this._db=await function(e,t,{blocked:s,upgrade:a,blocking:r,terminated:i}={}){let n=indexedDB.open(e,1),o=S(n);return a&&n.addEventListener("upgradeneeded",e=>{a(S(n.result),e.oldVersion,e.newVersion,S(n.transaction),e)}),s&&n.addEventListener("blocked",e=>s(e.oldVersion,e.newVersion,e)),o.then(e=>{i&&e.addEventListener("close",()=>i()),r&&e.addEventListener("versionchange",e=>r(e.oldVersion,e.newVersion,e))}).catch(()=>{}),o}("workbox-expiration",0,{upgrade:this._upgradeDbAndDeleteOldDbs.bind(this)})),this._db}}class W{constructor(e,t={}){this._isRunning=!1,this._rerunRequested=!1,this._maxEntries=t.maxEntries,this._maxAgeSeconds=t.maxAgeSeconds,this._matchOptions=t.matchOptions,this._cacheName=e,this._timestampModel=new O(e)}async expireEntries(){if(this._isRunning){this._rerunRequested=!0;return}this._isRunning=!0;let e=this._maxAgeSeconds?Date.now()-1e3*this._maxAgeSeconds:0,t=await this._timestampModel.expireEntries(e,this._maxEntries),s=await self.caches.open(this._cacheName);for(let e of t)await s.delete(e,this._matchOptions);this._isRunning=!1,this._rerunRequested&&(this._rerunRequested=!1,w(this.expireEntries()))}async updateTimestamp(e){await this._timestampModel.setTimestamp(e,Date.now())}async isURLExpired(e){if(!this._maxAgeSeconds)return!1;{let t=await this._timestampModel.getTimestamp(e),s=Date.now()-1e3*this._maxAgeSeconds;return void 0===t||t<s}}async delete(){this._rerunRequested=!1,await this._timestampModel.expireEntries(1/0)}}class j{constructor(e={}){this.cachedResponseWillBeUsed=async({event:e,request:t,cacheName:s,cachedResponse:a})=>{if(!a)return null;let r=this._isResponseDateFresh(a),i=this._getCacheExpiration(s);w(i.expireEntries());let n=i.updateTimestamp(t.url);if(e)try{e.waitUntil(n)}catch(e){}return r?a:null},this.cacheDidUpdate=async({cacheName:e,request:t})=>{let s=this._getCacheExpiration(e);await s.updateTimestamp(t.url),await s.expireEntries()},this._config=e,this._maxAgeSeconds=e.maxAgeSeconds,this._cacheExpirations=new Map,e.purgeOnQuotaError&&l.add(()=>this.deleteCacheAndMetadata())}_getCacheExpiration(e){if(e===f.getRuntimeName())throw new c("expire-custom-caches-only");let t=this._cacheExpirations.get(e);return t||(t=new W(e,this._config),this._cacheExpirations.set(e,t)),t}_isResponseDateFresh(e){if(!this._maxAgeSeconds)return!0;let t=this._getDateHeaderTimestamp(e);if(null===t)return!0;let s=Date.now();return t>=s-1e3*this._maxAgeSeconds}_getDateHeaderTimestamp(e){if(!e.headers.has("date"))return null;let t=e.headers.get("date"),s=new Date(t),a=s.getTime();return isNaN(a)?null:a}async deleteCacheAndMetadata(){for(let[e,t]of this._cacheExpirations)await self.caches.delete(e),await t.delete();this._cacheExpirations=new Map}}function B(e){return"string"==typeof e?new Request(e):e}s(873);class H{constructor(e,t){for(let s of(this._cacheKeys={},Object.assign(this,t),this.event=t.event,this._strategy=e,this._handlerDeferred=new m,this._extendLifetimePromises=[],this._plugins=[...e.plugins],this._pluginStateMap=new Map,this._plugins))this._pluginStateMap.set(s,{});this.event.waitUntil(this._handlerDeferred.promise)}async fetch(e){let{event:t}=this,s=B(e);if("navigate"===s.mode&&t instanceof FetchEvent&&t.preloadResponse){let e=await t.preloadResponse;if(e)return e}let a=this.hasCallback("fetchDidFail")?s.clone():null;try{for(let e of this.iterateCallbacks("requestWillFetch"))s=await e({request:s.clone(),event:t})}catch(e){if(e instanceof Error)throw new c("plugin-error-request-will-fetch",{thrownErrorMessage:e.message})}let r=s.clone();try{let e;for(let a of(e=await fetch(s,"navigate"===s.mode?void 0:this._strategy.fetchOptions),this.iterateCallbacks("fetchDidSucceed")))e=await a({event:t,request:r,response:e});return e}catch(e){throw a&&await this.runCallbacks("fetchDidFail",{error:e,event:t,originalRequest:a.clone(),request:r.clone()}),e}}async fetchAndCachePut(e){let t=await this.fetch(e),s=t.clone();return this.waitUntil(this.cachePut(e,s)),t}async cacheMatch(e){let t;let s=B(e),{cacheName:a,matchOptions:r}=this._strategy,i=await this.getCacheKey(s,"read"),n=Object.assign(Object.assign({},r),{cacheName:a});for(let e of(t=await caches.match(i,n),this.iterateCallbacks("cachedResponseWillBeUsed")))t=await e({cacheName:a,matchOptions:r,cachedResponse:t,request:i,event:this.event})||void 0;return t}async cachePut(e,t){let s=B(e);await b(0);let a=await this.getCacheKey(s,"write");if(!t)throw new c("cache-put-with-no-response",{url:x(a.url)});let r=await this._ensureResponseSafeToCache(t);if(!r)return!1;let{cacheName:i,matchOptions:n}=this._strategy,o=await self.caches.open(i),l=this.hasCallback("cacheDidUpdate"),h=l?await g(o,a.clone(),["__WB_REVISION__"],n):null;try{await o.put(a,l?r.clone():r)}catch(e){if(e instanceof Error)throw"QuotaExceededError"===e.name&&await y(),e}for(let e of this.iterateCallbacks("cacheDidUpdate"))await e({cacheName:i,oldResponse:h,newResponse:r.clone(),request:a,event:this.event});return!0}async getCacheKey(e,t){let s=`${e.url} | ${t}`;if(!this._cacheKeys[s]){let a=e;for(let e of this.iterateCallbacks("cacheKeyWillBeUsed"))a=B(await e({mode:t,request:a,event:this.event,params:this.params}));this._cacheKeys[s]=a}return this._cacheKeys[s]}hasCallback(e){for(let t of this._strategy.plugins)if(e in t)return!0;return!1}async runCallbacks(e,t){for(let s of this.iterateCallbacks(e))await s(t)}*iterateCallbacks(e){for(let t of this._strategy.plugins)if("function"==typeof t[e]){let s=this._pluginStateMap.get(t),a=a=>{let r=Object.assign(Object.assign({},a),{state:s});return t[e](r)};yield a}}waitUntil(e){return this._extendLifetimePromises.push(e),e}async doneWaiting(){let e;for(;e=this._extendLifetimePromises.shift();)await e}destroy(){this._handlerDeferred.resolve(null)}async _ensureResponseSafeToCache(e){let t=e,s=!1;for(let e of this.iterateCallbacks("cacheWillUpdate"))if(t=await e({request:this.request,response:t,event:this.event})||void 0,s=!0,!t)break;return!s&&t&&200!==t.status&&(t=void 0),t}}class F{constructor(e={}){this.cacheName=f.getRuntimeName(e.cacheName),this.plugins=e.plugins||[],this.fetchOptions=e.fetchOptions,this.matchOptions=e.matchOptions}handle(e){let[t]=this.handleAll(e);return t}handleAll(e){e instanceof FetchEvent&&(e={event:e,request:e.request});let t=e.event,s="string"==typeof e.request?new Request(e.request):e.request,a="params"in e?e.params:void 0,r=new H(this,{event:t,request:s,params:a}),i=this._getResponse(r,s,t),n=this._awaitComplete(i,r,s,t);return[i,n]}async _getResponse(e,t,s){let a;await e.runCallbacks("handlerWillStart",{event:s,request:t});try{if(!(a=await this._handle(t,e))||"error"===a.type)throw new c("no-response",{url:t.url})}catch(r){if(r instanceof Error){for(let i of e.iterateCallbacks("handlerDidError"))if(a=await i({error:r,event:s,request:t}))break}if(a);else throw r}for(let r of e.iterateCallbacks("handlerWillRespond"))a=await r({event:s,request:t,response:a});return a}async _awaitComplete(e,t,s,a){let r,i;try{r=await e}catch(e){}try{await t.runCallbacks("handlerDidRespond",{event:a,request:s,response:r}),await t.doneWaiting()}catch(e){e instanceof Error&&(i=e)}if(await t.runCallbacks("handlerDidComplete",{event:a,request:s,response:r,error:i}),t.destroy(),i)throw i}}class $ extends F{async _handle(e,t){let s,a=await t.cacheMatch(e);if(!a)try{a=await t.fetchAndCachePut(e)}catch(e){e instanceof Error&&(s=e)}if(!a)throw new c("no-response",{url:e.url,error:s});return a}}let G={cacheWillUpdate:async({response:e})=>200===e.status||0===e.status?e:null};class Q extends F{constructor(e={}){super(e),this.plugins.some(e=>"cacheWillUpdate"in e)||this.plugins.unshift(G),this._networkTimeoutSeconds=e.networkTimeoutSeconds||0}async _handle(e,t){let s;let a=[],r=[];if(this._networkTimeoutSeconds){let{id:i,promise:n}=this._getTimeoutPromise({request:e,logs:a,handler:t});s=i,r.push(n)}let i=this._getNetworkPromise({timeoutId:s,request:e,logs:a,handler:t});r.push(i);let n=await t.waitUntil((async()=>await t.waitUntil(Promise.race(r))||await i)());if(!n)throw new c("no-response",{url:e.url});return n}_getTimeoutPromise({request:e,logs:t,handler:s}){let a;let r=new Promise(t=>{let r=async()=>{t(await s.cacheMatch(e))};a=setTimeout(r,1e3*this._networkTimeoutSeconds)});return{promise:r,id:a}}async _getNetworkPromise({timeoutId:e,request:t,logs:s,handler:a}){let r,i;try{i=await a.fetchAndCachePut(t)}catch(e){e instanceof Error&&(r=e)}return e&&clearTimeout(e),(r||!i)&&(i=await a.cacheMatch(t)),i}}class V extends F{constructor(e={}){super(e),this._networkTimeoutSeconds=e.networkTimeoutSeconds||0}async _handle(e,t){let s,a;try{let a=[t.fetch(e)];if(this._networkTimeoutSeconds){let e=b(1e3*this._networkTimeoutSeconds);a.push(e)}if(!(s=await Promise.race(a)))throw Error(`Timed out the network response after ${this._networkTimeoutSeconds} seconds.`)}catch(e){e instanceof Error&&(a=e)}if(!s)throw new c("no-response",{url:e.url,error:a});return s}}class J extends F{constructor(e={}){super(e),this.plugins.some(e=>"cacheWillUpdate"in e)||this.plugins.unshift(G)}async _handle(e,t){let s;let a=t.fetchAndCachePut(e).catch(()=>{});t.waitUntil(a);let r=await t.cacheMatch(e);if(r);else try{r=await a}catch(e){e instanceof Error&&(s=e)}if(!r)throw new c("no-response",{url:e.url,error:s});return r}}s(80);let z=e=>e&&"object"==typeof e?e:{handle:e};class X{constructor(e,t,s="GET"){this.handler=z(t),this.match=e,this.method=s}setCatchHandler(e){this.catchHandler=z(e)}}class Y extends X{constructor(e,t,s){super(({url:t})=>{let s=e.exec(t.href);if(s&&(t.origin===location.origin||0===s.index))return s.slice(1)},t,s)}}class Z{constructor(){this._routes=new Map,this._defaultHandlerMap=new Map}get routes(){return this._routes}addFetchListener(){self.addEventListener("fetch",e=>{let{request:t}=e,s=this.handleRequest({request:t,event:e});s&&e.respondWith(s)})}addCacheListener(){self.addEventListener("message",e=>{if(e.data&&"CACHE_URLS"===e.data.type){let{payload:t}=e.data,s=Promise.all(t.urlsToCache.map(t=>{"string"==typeof t&&(t=[t]);let s=new Request(...t);return this.handleRequest({request:s,event:e})}));e.waitUntil(s),e.ports&&e.ports[0]&&s.then(()=>e.ports[0].postMessage(!0))}})}handleRequest({request:e,event:t}){let s;let a=new URL(e.url,location.href);if(!a.protocol.startsWith("http"))return;let r=a.origin===location.origin,{params:i,route:n}=this.findMatchingRoute({event:t,request:e,sameOrigin:r,url:a}),o=n&&n.handler,c=e.method;if(!o&&this._defaultHandlerMap.has(c)&&(o=this._defaultHandlerMap.get(c)),!o)return;try{s=o.handle({url:a,request:e,event:t,params:i})}catch(e){s=Promise.reject(e)}let l=n&&n.catchHandler;return s instanceof Promise&&(this._catchHandler||l)&&(s=s.catch(async s=>{if(l)try{return await l.handle({url:a,request:e,event:t,params:i})}catch(e){e instanceof Error&&(s=e)}if(this._catchHandler)return this._catchHandler.handle({url:a,request:e,event:t});throw s})),s}findMatchingRoute({url:e,sameOrigin:t,request:s,event:a}){let r=this._routes.get(s.method)||[];for(let i of r){let r;let n=i.match({url:e,sameOrigin:t,request:s,event:a});if(n)return Array.isArray(r=n)&&0===r.length?r=void 0:n.constructor===Object&&0===Object.keys(n).length?r=void 0:"boolean"==typeof n&&(r=void 0),{route:i,params:r}}return{}}setDefaultHandler(e,t="GET"){this._defaultHandlerMap.set(t,z(e))}setCatchHandler(e){this._catchHandler=z(e)}registerRoute(e){this._routes.has(e.method)||this._routes.set(e.method,[]),this._routes.get(e.method).push(e)}unregisterRoute(e){if(!this._routes.has(e.method))throw new c("unregister-route-but-not-found-with-method",{method:e.method});let t=this._routes.get(e.method).indexOf(e);if(t>-1)this._routes.get(e.method).splice(t,1);else throw new c("unregister-route-route-not-registered")}}let ee=()=>(i||((i=new Z).addFetchListener(),i.addCacheListener()),i);function et(e,t,s){let a;if("string"==typeof e){let r=new URL(e,location.href);a=new X(({url:e})=>e.href===r.href,t,s)}else if(e instanceof RegExp)a=new Y(e,t,s);else if("function"==typeof e)a=new X(e,t,s);else if(e instanceof X)a=e;else throw new c("unsupported-route-type",{moduleName:"workbox-routing",funcName:"registerRoute",paramName:"capture"});let r=ee();return r.registerRoute(a),a}s(977);class es{constructor(){this.updatedURLs=[],this.notUpdatedURLs=[],this.handlerWillStart=async({request:e,state:t})=>{t&&(t.originalRequest=e)},this.cachedResponseWillBeUsed=async({event:e,state:t,cachedResponse:s})=>{if("install"===e.type&&t&&t.originalRequest&&t.originalRequest instanceof Request){let e=t.originalRequest.url;s?this.notUpdatedURLs.push(e):this.updatedURLs.push(e)}return s}}}class ea{constructor({precacheController:e}){this.cacheKeyWillBeUsed=async({request:e,params:t})=>{let s=(null==t?void 0:t.cacheKey)||this._precacheController.getCacheKeyForURL(e.url);return s?new Request(s,{headers:e.headers}):e},this._precacheController=e}}class er extends F{constructor(e={}){e.cacheName=f.getPrecacheName(e.cacheName),super(e),this._fallbackToNetwork=!1!==e.fallbackToNetwork,this.plugins.push(er.copyRedirectedCacheableResponsesPlugin)}async _handle(e,t){let s=await t.cacheMatch(e);return s||(t.event&&"install"===t.event.type?await this._handleInstall(e,t):await this._handleFetch(e,t))}async _handleFetch(e,t){let s;let a=t.params||{};if(this._fallbackToNetwork){let r=a.integrity,i=e.integrity,n=!i||i===r;s=await t.fetch(new Request(e,{integrity:"no-cors"!==e.mode?i||r:void 0})),r&&n&&"no-cors"!==e.mode&&(this._useDefaultCacheabilityPluginIfNeeded(),await t.cachePut(e,s.clone()))}else throw new c("missing-precache-entry",{cacheName:this.cacheName,url:e.url});return s}async _handleInstall(e,t){this._useDefaultCacheabilityPluginIfNeeded();let s=await t.fetch(e),a=await t.cachePut(e,s.clone());if(!a)throw new c("bad-precaching-response",{url:e.url,status:s.status});return s}_useDefaultCacheabilityPluginIfNeeded(){let e=null,t=0;for(let[s,a]of this.plugins.entries())a!==er.copyRedirectedCacheableResponsesPlugin&&(a===er.defaultPrecacheCacheabilityPlugin&&(e=s),a.cacheWillUpdate&&t++);0===t?this.plugins.push(er.defaultPrecacheCacheabilityPlugin):t>1&&null!==e&&this.plugins.splice(e,1)}}er.defaultPrecacheCacheabilityPlugin={cacheWillUpdate:async({response:e})=>!e||e.status>=400?null:e},er.copyRedirectedCacheableResponsesPlugin={cacheWillUpdate:async({response:e})=>e.redirected?await R(e):e};class ei{constructor({cacheName:e,plugins:t=[],fallbackToNetwork:s=!0}={}){this._urlsToCacheKeys=new Map,this._urlsToCacheModes=new Map,this._cacheKeysToIntegrities=new Map,this._strategy=new er({cacheName:f.getPrecacheName(e),plugins:[...t,new ea({precacheController:this})],fallbackToNetwork:s}),this.install=this.install.bind(this),this.activate=this.activate.bind(this)}get strategy(){return this._strategy}precache(e){this.addToCacheList(e),this._installAndActiveListenersAdded||(self.addEventListener("install",this.install),self.addEventListener("activate",this.activate),this._installAndActiveListenersAdded=!0)}addToCacheList(e){let t=[];for(let s of e){"string"==typeof s?t.push(s):s&&void 0===s.revision&&t.push(s.url);let{cacheKey:e,url:a}=function(e){if(!e)throw new c("add-to-cache-list-unexpected-type",{entry:e});if("string"==typeof e){let t=new URL(e,location.href);return{cacheKey:t.href,url:t.href}}let{revision:t,url:s}=e;if(!s)throw new c("add-to-cache-list-unexpected-type",{entry:e});if(!t){let e=new URL(s,location.href);return{cacheKey:e.href,url:e.href}}let a=new URL(s,location.href),r=new URL(s,location.href);return a.searchParams.set("__WB_REVISION__",t),{cacheKey:a.href,url:r.href}}(s),r="string"!=typeof s&&s.revision?"reload":"default";if(this._urlsToCacheKeys.has(a)&&this._urlsToCacheKeys.get(a)!==e)throw new c("add-to-cache-list-conflicting-entries",{firstEntry:this._urlsToCacheKeys.get(a),secondEntry:e});if("string"!=typeof s&&s.integrity){if(this._cacheKeysToIntegrities.has(e)&&this._cacheKeysToIntegrities.get(e)!==s.integrity)throw new c("add-to-cache-list-conflicting-integrities",{url:a});this._cacheKeysToIntegrities.set(e,s.integrity)}if(this._urlsToCacheKeys.set(a,e),this._urlsToCacheModes.set(a,r),t.length>0){let e=`Workbox is precaching URLs without revision info: ${t.join(", ")}
|
|
This is generally NOT safe. Learn more at https://bit.ly/wb-precache`;console.warn(e)}}}install(e){return E(e,async()=>{let t=new es;for(let[s,a]of(this.strategy.plugins.push(t),this._urlsToCacheKeys)){let t=this._cacheKeysToIntegrities.get(a),r=this._urlsToCacheModes.get(s),i=new Request(s,{integrity:t,cache:r,credentials:"same-origin"});await Promise.all(this.strategy.handleAll({params:{cacheKey:a},request:i,event:e}))}let{updatedURLs:s,notUpdatedURLs:a}=t;return{updatedURLs:s,notUpdatedURLs:a}})}activate(e){return E(e,async()=>{let e=await self.caches.open(this.strategy.cacheName),t=await e.keys(),s=new Set(this._urlsToCacheKeys.values()),a=[];for(let r of t)s.has(r.url)||(await e.delete(r),a.push(r.url));return{deletedURLs:a}})}getURLsToCacheKeys(){return this._urlsToCacheKeys}getCachedURLs(){return[...this._urlsToCacheKeys.keys()]}getCacheKeyForURL(e){let t=new URL(e,location.href);return this._urlsToCacheKeys.get(t.href)}getIntegrityForCacheKey(e){return this._cacheKeysToIntegrities.get(e)}async matchPrecache(e){let t=e instanceof Request?e.url:e,s=this.getCacheKeyForURL(t);if(s){let e=await self.caches.open(this.strategy.cacheName);return e.match(s)}}createHandlerBoundToURL(e){let t=this.getCacheKeyForURL(e);if(!t)throw new c("non-precached-url",{url:e});return s=>(s.request=new Request(e),s.params=Object.assign({cacheKey:t},s.params),this.strategy.handle(s))}}let en=()=>(n||(n=new ei),n);class eo extends X{constructor(e,t){super(({request:s})=>{let a=e.getURLsToCacheKeys();for(let r of function*(e,{ignoreURLParametersMatching:t=[/^utm_/,/^fbclid$/],directoryIndex:s="index.html",cleanURLs:a=!0,urlManipulation:r}={}){let i=new URL(e,location.href);i.hash="",yield i.href;let n=function(e,t=[]){for(let s of[...e.searchParams.keys()])t.some(e=>e.test(s))&&e.searchParams.delete(s);return e}(i,t);if(yield n.href,s&&n.pathname.endsWith("/")){let e=new URL(n.href);e.pathname+=s,yield e.href}if(a){let e=new URL(n.href);e.pathname+=".html",yield e.href}if(r){let e=r({url:i});for(let t of e)yield t.href}}(s.url,t)){let t=a.get(r);if(t){let s=e.getIntegrityForCacheKey(t);return{cacheKey:t,integrity:s}}}},e.strategy)}}let ec="-precache-",el=async(e,t=ec)=>{let s=await self.caches.keys(),a=s.filter(s=>s.includes(t)&&s.includes(self.registration.scope)&&s!==e);return await Promise.all(a.map(e=>self.caches.delete(e))),a};self.skipWaiting(),self.addEventListener("activate",()=>self.clients.claim());let eh=[{'revision':'967bbb9a96704c622f2a84dc4f378d32','url':'/SMOR-192.png'},{'revision':'8f400b22ba1e248648aa31404809f139','url':'/SMOR-256.png'},{'revision':'885b67c19e14202e3db3dc6cd7ec1904','url':'/SMOR-384.png'},{'revision':'72e10288e397bba4fc17871c253a49c8','url':'/SMOR-512.png'},{'revision':'c4a0666421c67903ecefab989be39be9','url':'/_next/static/UfeZUSqoHvjDSa_oQBkwi/_buildManifest.js'},{'revision':'b6652df95db52feb4daf4eca35380933','url':'/_next/static/UfeZUSqoHvjDSa_oQBkwi/_ssgManifest.js'},{'revision':'6e9181afbaec203e','url':'/_next/static/chunks/189-6e9181afbaec203e.js'},{'revision':'232cbe61266e8d95','url':'/_next/static/chunks/269-232cbe61266e8d95.js'},{'revision':'c2b8c91fa0e8a184','url':'/_next/static/chunks/746.c2b8c91fa0e8a184.js'},{'revision':'02eec8d48cd193d5','url':'/_next/static/chunks/841-02eec8d48cd193d5.js'},{'revision':'347b4fb2c1067f50','url':'/_next/static/chunks/92.347b4fb2c1067f50.js'},{'revision':'66d32731bdd20e83','url':'/_next/static/chunks/framework-66d32731bdd20e83.js'},{'revision':'de5fab2c168950a1','url':'/_next/static/chunks/main-de5fab2c168950a1.js'},{'revision':'314b65cb4b1d9946','url':'/_next/static/chunks/pages/_app-314b65cb4b1d9946.js'},{'revision':'ee5b5fb91d29d86f','url':'/_next/static/chunks/pages/_error-ee5b5fb91d29d86f.js'},{'revision':'69089c35182a69af','url':'/_next/static/chunks/pages/content-69089c35182a69af.js'},{'revision':'a0d74969397295b4','url':'/_next/static/chunks/pages/home-a0d74969397295b4.js'},{'revision':'80d900f395b87b27','url':'/_next/static/chunks/pages/index-80d900f395b87b27.js'},{'revision':'13673ddbf3ea83c6','url':'/_next/static/chunks/pages/learningpage/%5Bpage%5D-13673ddbf3ea83c6.js'},{'revision':'fcb3e3f221ddad35','url':'/_next/static/chunks/pages/learningpath/%5Blearningpath%5D-fcb3e3f221ddad35.js'},{'revision':'ae2c6b0455f37ed2','url':'/_next/static/chunks/pages/login-ae2c6b0455f37ed2.js'},{'revision':'493440b6a6bd590b','url':'/_next/static/chunks/pages/menu-493440b6a6bd590b.js'},{'revision':'837c0df77fd5009c9e46d446188ecfd0','url':'/_next/static/chunks/polyfills-c67a75d1b6f99dc8.js'},{'revision':'ec276577129b176b','url':'/_next/static/chunks/webpack-ec276577129b176b.js'},{'revision':'666586677e60428aa5e58d13871736c7','url':'/favicon.ico'},{'revision':'f860f7e189e86a35e1732f324f0708dd','url':'/firebase-messaging-sw.js'},{'revision':'7e742e758c9028e8bd0c4345655e93c4','url':'/freebessimagelight.png'},{'revision':'ed26a1bbca33bba35e0e25bccec594f1','url':'/icon-192x192.png'},{'revision':'ed2c6547ed3aeea9df44fe44bc30007f','url':'/icon-256x256.png'},{'revision':'22a4a4214cd9cfa1b401091618ca0ac9','url':'/icon-384x384.png'},{'revision':'562865edb386df86d7c72587c9096528','url':'/icon-512x512.png'},{'revision':'967bbb9a96704c622f2a84dc4f378d32','url':'/images/SMOR-192.png'},{'revision':'8f400b22ba1e248648aa31404809f139','url':'/images/SMOR-256.png'},{'revision':'885b67c19e14202e3db3dc6cd7ec1904','url':'/images/SMOR-384.png'},{'revision':'72e10288e397bba4fc17871c253a49c8','url':'/images/SMOR-512.png'},{'revision':'12f9ee78f32722610c775ca7375c0c11','url':'/images/no-image.png'},{'revision':'4b4f1876502eb6721764637fe5c41702','url':'/images/vercel.svg'},{'revision':'7941bf46fca6595db5fdc02141a64097','url':'/manifest.json'},{'revision':'3023f02d03ea538d8e3c39bdf0de383d','url':'/marker-icon.png'},{'revision':'bbaa057c651bda9f5cc89df7a557c064','url':'/service-worker.js'},{'revision':'386bb589800b7a5eee387134743d1587','url':'/sw.js'},{'revision':'b9cb6cdefceda6356b10f26018cffacd','url':'/test.html'},{'revision':'4b4f1876502eb6721764637fe5c41702','url':'/vercel.svg'}];eh.push({url:"/fallback",revision:"1234567890"}),function(e){let t=en();t.precache(e)}(eh),function(e){let t=en(),s=new eo(t,e);et(s)}(void 0),self.addEventListener("activate",e=>{let t=f.getPrecacheName();e.waitUntil(el(t).then(e=>{}))}),et("/",new Q({cacheName:"start-url",plugins:[new j({maxEntries:1,maxAgeSeconds:86400,purgeOnQuotaError:!0})]}),"GET"),et(/^https:\/\/fonts\.(?:googleapis|gstatic)\.com\/.*/i,new $({cacheName:"google-fonts",plugins:[new j({maxEntries:4,maxAgeSeconds:31536e3,purgeOnQuotaError:!0})]}),"GET"),et(/\.(?:eot|otf|ttc|ttf|woff|woff2|font.css)$/i,new J({cacheName:"static-font-assets",plugins:[new j({maxEntries:4,maxAgeSeconds:604800,purgeOnQuotaError:!0})]}),"GET"),et(/\.(?:jpg|jpeg|gif|png|svg|ico|webp)$/i,new V({cacheName:"static-image-assets",plugins:[new j({maxEntries:64,maxAgeSeconds:86400,purgeOnQuotaError:!0})]}),"GET"),et(/\.(?:js)$/i,new J({cacheName:"static-js-assets",plugins:[new j({maxEntries:32,maxAgeSeconds:86400,purgeOnQuotaError:!0})]}),"GET"),et(/\.(?:css|less)$/i,new J({cacheName:"static-style-assets",plugins:[new j({maxEntries:32,maxAgeSeconds:86400,purgeOnQuotaError:!0})]}),"GET"),et(/\.(?:json|xml|csv)$/i,new Q({cacheName:"static-data-assets",plugins:[new j({maxEntries:32,maxAgeSeconds:86400,purgeOnQuotaError:!0})]}),"GET"),et(/\/api\/.*$/i,new Q({cacheName:"apis",networkTimeoutSeconds:10,plugins:[new j({maxEntries:16,maxAgeSeconds:86400,purgeOnQuotaError:!0})]}),"GET"),et(/.*/i,new Q({cacheName:"others",networkTimeoutSeconds:10,plugins:[new j({maxEntries:32,maxAgeSeconds:86400,purgeOnQuotaError:!0})]}),"GET"),function(e){let t=ee();t.setDefaultHandler(e)}(new J),function(e){let t=ee();t.setCatchHandler(e)}(e=>{let{event:t}=e;return"document"===t.request.destination?function(e){let t=en();return t.matchPrecache(e)}("/fallback"):Response.error()})}()}(); |