Repository navigation
Expand file tree
/
Copy pathservice-worker.min.js
More file actions
1 lines (1 loc) · 21.3 KB
/
Copy pathservice-worker.min.js
File metadata and controls
1 lines (1 loc) · 21.3 KB
1
(()=>{try{self["workbox:core:6.5.4"]&&_()}catch{}var Ce=(t,...e)=>{let r=t;return e.length>0&&(r+=` :: ${JSON.stringify(e)}`),r};var ce=Ce;var N=class extends Error{constructor(e,r){let o=ce(e,r);super(o),this.name=e,this.details=r}};try{self["workbox:routing:6.5.4"]&&_()}catch{}var V="GET";var R=t=>t&&typeof t=="object"?t:{handle:t};var l=class{constructor(e,r,o=V){this.handler=R(r),this.match=e,this.method=o}setCatchHandler(e){this.catchHandler=R(e)}};var T=class extends l{constructor(e,r,o){let s=({url:a})=>{let n=e.exec(a.href);if(n&&!(a.origin!==location.origin&&n.index!==0))return n.slice(1)};super(s,r,o)}};var C=class{constructor(){this._routes=new Map,this._defaultHandlerMap=new Map}get routes(){return this._routes}addFetchListener(){self.addEventListener("fetch",(e=>{let{request:r}=e,o=this.handleRequest({request:r,event:e});o&&e.respondWith(o)}))}addCacheListener(){self.addEventListener("message",(e=>{if(e.data&&e.data.type==="CACHE_URLS"){let{payload:r}=e.data,o=Promise.all(r.urlsToCache.map(s=>{typeof s=="string"&&(s=[s]);let a=new Request(...s);return this.handleRequest({request:a,event:e})}));e.waitUntil(o),e.ports&&e.ports[0]&&o.then(()=>e.ports[0].postMessage(!0))}}))}handleRequest({request:e,event:r}){let o=new URL(e.url,location.href);if(!o.protocol.startsWith("http"))return;let s=o.origin===location.origin,{params:a,route:n}=this.findMatchingRoute({event:r,request:e,sameOrigin:s,url:o}),i=n&&n.handler,c=[],p=e.method;if(!i&&this._defaultHandlerMap.has(p)&&(i=this._defaultHandlerMap.get(p)),!i)return;let $;try{$=i.handle({url:o,request:e,event:r,params:a})}catch(k){$=Promise.reject(k)}let w=n&&n.catchHandler;return $ instanceof Promise&&(this._catchHandler||w)&&($=$.catch(async k=>{if(w)try{return await w.handle({url:o,request:e,event:r,params:a})}catch(ie){ie instanceof Error&&(k=ie)}if(this._catchHandler)return this._catchHandler.handle({url:o,request:e,event:r});throw k})),$}findMatchingRoute({url:e,sameOrigin:r,request:o,event:s}){let a=this._routes.get(o.method)||[];for(let n of a){let i,c=n.match({url:e,sameOrigin:r,request:o,event:s});if(c)return i=c,(Array.isArray(i)&&i.length===0||c.constructor===Object&&Object.keys(c).length===0||typeof c=="boolean")&&(i=void 0),{route:n,params:i}}return{}}setDefaultHandler(e,r=V){this._defaultHandlerMap.set(r,R(e))}setCatchHandler(e){this._catchHandler=R(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 N("unregister-route-but-not-found-with-method",{method:e.method});let r=this._routes.get(e.method).indexOf(e);if(r>-1)this._routes.get(e.method).splice(r,1);else throw new N("unregister-route-route-not-registered")}};var O,D=()=>(O||(O=new C,O.addFetchListener(),O.addCacheListener()),O);function v(t,e,r){let o;if(typeof t=="string"){let a=new URL(t,location.href),n=({url:i})=>i.href===a.href;o=new l(n,e,r)}else if(t instanceof RegExp)o=new T(t,e,r);else if(typeof t=="function")o=new l(t,e,r);else if(t instanceof l)o=t;else throw new N("unsupported-route-type",{moduleName:"workbox-routing",funcName:"registerRoute",paramName:"capture"});return D().registerRoute(o),o}function j(t){D().setCatchHandler(t)}var Oe=new RegExp(/<link data-precache.*?rel="?stylesheet"?.*?href="?([^"\s]+)"?[^>]*>/g),De=new RegExp(/<script data-precache.*?src="?([^"\s]+)"?[^>]*><\/script>/g);function Ue(t){return fetch(t.homepage).then(e=>e.text()).then(e=>{let r={scripts:[],styles:[]},o;for(;(o=Oe.exec(e))!==null;)r.styles.push(o[1]);for(;(o=De.exec(e))!==null;)r.scripts.push(o[1]);return r}).then(e=>self.caches.open(t.stylesCacheName).then(r=>r.addAll(e.styles))&&self.caches.open(t.scriptsCacheName).then(r=>r.addAll(e.scripts))).catch(e=>{console.error("unable to fetch and precache styles",e)})}var ue=Ue;function Se(t){let e=new URL(t.baseURL);return async r=>{let o=await self.caches.open(t.fallbacksCacheName),s="/offline/";if(r.request.destination==="image")s=t.fallbacksImage;else{let a=qe(r.request,t);a!==""&&(s="/"+a+s),s=e.pathname.replace(/\/+$/,"")+s}return await o.match(s)||Response.error()}}function qe(t,e){let r=t.url.toString();r=r.replace(e.baseURL,"");let o=r.split("/");return o.length>0&&e.langs.includes(o[0])?o[0]:""}var G=Se;try{self["workbox:core:6.5.3"]&&_()}catch{}try{self["workbox:cacheable-response:6.5.3"]&&_()}catch{}var U=class{constructor(e={}){this._statuses=e.statuses,this._headers=e.headers}isResponseCacheable(e){let r=!0;return this._statuses&&(r=this._statuses.includes(e.status)),this._headers&&r&&(r=Object.keys(this._headers).some(o=>e.headers.get(o)===this._headers[o])),r}};var d=class{constructor(e){this.cacheWillUpdate=async({response:r})=>this._cacheableResponse.isResponseCacheable(r)?r:null,this._cacheableResponse=new U(e)}};try{self["workbox:core:6.5.4"]&&_()}catch{}var Ae=(t,...e)=>{let r=t;return e.length>0&&(r+=` :: ${JSON.stringify(e)}`),r};var le=Ae;var S=class extends Error{constructor(e,r){let o=le(e,r);super(o),this.name=e,this.details=r}};function M(t){t.then(()=>{})}var Le=(t,e)=>e.some(r=>t instanceof r),pe,he;function Pe(){return pe||(pe=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function Ve(){return he||(he=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}var de=new WeakMap,J=new WeakMap,fe=new WeakMap,H=new WeakMap,K=new WeakMap;function Me(t){let e=new Promise((r,o)=>{let s=()=>{t.removeEventListener("success",a),t.removeEventListener("error",n)},a=()=>{r(f(t.result)),s()},n=()=>{o(t.error),s()};t.addEventListener("success",a),t.addEventListener("error",n)});return e.then(r=>{r instanceof IDBCursor&&de.set(r,t)}).catch(()=>{}),K.set(e,t),e}function Fe(t){if(J.has(t))return;let e=new Promise((r,o)=>{let s=()=>{t.removeEventListener("complete",a),t.removeEventListener("error",n),t.removeEventListener("abort",n)},a=()=>{r(),s()},n=()=>{o(t.error||new DOMException("AbortError","AbortError")),s()};t.addEventListener("complete",a),t.addEventListener("error",n),t.addEventListener("abort",n)});J.set(t,e)}var Y={get(t,e,r){if(t instanceof IDBTransaction){if(e==="done")return J.get(t);if(e==="objectStoreNames")return t.objectStoreNames||fe.get(t);if(e==="store")return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return f(t[e])},set(t,e,r){return t[e]=r,!0},has(t,e){return t instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in t}};function me(t){Y=t(Y)}function We(t){return t===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...r){let o=t.call(F(this),e,...r);return fe.set(o,e.sort?e.sort():[e]),f(o)}:Ve().includes(t)?function(...e){return t.apply(F(this),e),f(de.get(this))}:function(...e){return f(t.apply(F(this),e))}}function Ie(t){return typeof t=="function"?We(t):(t instanceof IDBTransaction&&Fe(t),Le(t,Pe())?new Proxy(t,Y):t)}function f(t){if(t instanceof IDBRequest)return Me(t);if(H.has(t))return H.get(t);let e=Ie(t);return e!==t&&(H.set(t,e),K.set(e,t)),e}var F=t=>K.get(t);function we(t,e,{blocked:r,upgrade:o,blocking:s,terminated:a}={}){let n=indexedDB.open(t,e),i=f(n);return o&&n.addEventListener("upgradeneeded",c=>{o(f(n.result),c.oldVersion,c.newVersion,f(n.transaction),c)}),r&&n.addEventListener("blocked",c=>r(c.oldVersion,c.newVersion,c)),i.then(c=>{a&&c.addEventListener("close",()=>a()),s&&c.addEventListener("versionchange",p=>s(p.oldVersion,p.newVersion,p))}).catch(()=>{}),i}function ye(t,{blocked:e}={}){let r=indexedDB.deleteDatabase(t);return e&&r.addEventListener("blocked",o=>e(o.oldVersion,o)),f(r).then(()=>{})}var Be=["get","getKey","getAll","getAllKeys","count"],je=["put","add","delete","clear"],Q=new Map;function ge(t,e){if(!(t instanceof IDBDatabase&&!(e in t)&&typeof e=="string"))return;if(Q.get(e))return Q.get(e);let r=e.replace(/FromIndex$/,""),o=e!==r,s=je.includes(r);if(!(r in(o?IDBIndex:IDBObjectStore).prototype)||!(s||Be.includes(r)))return;let a=async function(n,...i){let c=this.transaction(n,s?"readwrite":"readonly"),p=c.store;return o&&(p=p.index(i.shift())),(await Promise.all([p[r](...i),s&&c.done]))[0]};return Q.set(e,a),a}me(t=>({...t,get:(e,r,o)=>ge(e,r)||t.get(e,r,o),has:(e,r)=>!!ge(e,r)||t.has(e,r)}));try{self["workbox:expiration:6.5.4"]&&_()}catch{}var Ge="workbox-expiration",q="cache-entries",be=t=>{let e=new URL(t,location.href);return e.hash="",e.href},W=class{constructor(e){this._db=null,this._cacheName=e}_upgradeDb(e){let r=e.createObjectStore(q,{keyPath:"id"});r.createIndex("cacheName","cacheName",{unique:!1}),r.createIndex("timestamp","timestamp",{unique:!1})}_upgradeDbAndDeleteOldDbs(e){this._upgradeDb(e),this._cacheName&&ye(this._cacheName)}async setTimestamp(e,r){e=be(e);let o={url:e,timestamp:r,cacheName:this._cacheName,id:this._getId(e)},a=(await this.getDb()).transaction(q,"readwrite",{durability:"relaxed"});await a.store.put(o),await a.done}async getTimestamp(e){let o=await(await this.getDb()).get(q,this._getId(e));return o?.timestamp}async expireEntries(e,r){let o=await this.getDb(),s=await o.transaction(q).store.index("timestamp").openCursor(null,"prev"),a=[],n=0;for(;s;){let c=s.value;c.cacheName===this._cacheName&&(e&&c.timestamp<e||r&&n>=r?a.push(s.value):n++),s=await s.continue()}let i=[];for(let c of a)await o.delete(q,c.id),i.push(c.url);return i}_getId(e){return this._cacheName+"|"+be(e)}async getDb(){return this._db||(this._db=await we(Ge,1,{upgrade:this._upgradeDbAndDeleteOldDbs.bind(this)})),this._db}};var A=class{constructor(e,r={}){this._isRunning=!1,this._rerunRequested=!1,this._maxEntries=r.maxEntries,this._maxAgeSeconds=r.maxAgeSeconds,this._matchOptions=r.matchOptions,this._cacheName=e,this._timestampModel=new W(e)}async expireEntries(){if(this._isRunning){this._rerunRequested=!0;return}this._isRunning=!0;let e=this._maxAgeSeconds?Date.now()-this._maxAgeSeconds*1e3:0,r=await this._timestampModel.expireEntries(e,this._maxEntries),o=await self.caches.open(this._cacheName);for(let s of r)await o.delete(s,this._matchOptions);this._isRunning=!1,this._rerunRequested&&(this._rerunRequested=!1,M(this.expireEntries()))}async updateTimestamp(e){await this._timestampModel.setTimestamp(e,Date.now())}async isURLExpired(e){if(this._maxAgeSeconds){let r=await this._timestampModel.getTimestamp(e),o=Date.now()-this._maxAgeSeconds*1e3;return r!==void 0?r<o:!0}else return!1}async delete(){this._rerunRequested=!1,await this._timestampModel.expireEntries(1/0)}};var x={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:typeof registration<"u"?registration.scope:""},X=t=>[x.prefix,t,x.suffix].filter(e=>e&&e.length>0).join("-"),He=t=>{for(let e of Object.keys(x))t(e)},xe={updateDetails:t=>{He(e=>{typeof t[e]=="string"&&(x[e]=t[e])})},getGoogleAnalyticsName:t=>t||X(x.googleAnalytics),getPrecacheName:t=>t||X(x.precache),getPrefix:()=>x.prefix,getRuntimeName:t=>t||X(x.runtime),getSuffix:()=>x.suffix};var Ee=new Set;function $e(t){Ee.add(t)}var m=class{constructor(e={}){this.cachedResponseWillBeUsed=async({event:r,request:o,cacheName:s,cachedResponse:a})=>{if(!a)return null;let n=this._isResponseDateFresh(a),i=this._getCacheExpiration(s);M(i.expireEntries());let c=i.updateTimestamp(o.url);if(r)try{r.waitUntil(c)}catch{}return n?a:null},this.cacheDidUpdate=async({cacheName:r,request:o})=>{let s=this._getCacheExpiration(r);await s.updateTimestamp(o.url),await s.expireEntries()},this._config=e,this._maxAgeSeconds=e.maxAgeSeconds,this._cacheExpirations=new Map,e.purgeOnQuotaError&&$e(()=>this.deleteCacheAndMetadata())}_getCacheExpiration(e){if(e===xe.getRuntimeName())throw new S("expire-custom-caches-only");let r=this._cacheExpirations.get(e);return r||(r=new A(e,this._config),this._cacheExpirations.set(e,r)),r}_isResponseDateFresh(e){if(!this._maxAgeSeconds)return!0;let r=this._getDateHeaderTimestamp(e);if(r===null)return!0;let o=Date.now();return r>=o-this._maxAgeSeconds*1e3}_getDateHeaderTimestamp(e){if(!e.headers.has("date"))return null;let r=e.headers.get("date"),s=new Date(r).getTime();return isNaN(s)?null:s}async deleteCacheAndMetadata(){for(let[e,r]of this._cacheExpirations)await self.caches.delete(e),await r.delete();this._cacheExpirations=new Map}};try{self["workbox:core:6.5.4"]&&_()}catch{}var Je=(t,...e)=>{let r=t;return e.length>0&&(r+=` :: ${JSON.stringify(e)}`),r};var Ne=Je;var h=class extends Error{constructor(e,r){let o=Ne(e,r);super(o),this.name=e,this.details=r}};var E={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:typeof registration<"u"?registration.scope:""},Z=t=>[E.prefix,t,E.suffix].filter(e=>e&&e.length>0).join("-"),Ye=t=>{for(let e of Object.keys(E))t(e)},ve={updateDetails:t=>{Ye(e=>{typeof t[e]=="string"&&(E[e]=t[e])})},getGoogleAnalyticsName:t=>t||Z(E.googleAnalytics),getPrecacheName:t=>t||Z(E.precache),getPrefix:()=>E.prefix,getRuntimeName:t=>t||Z(E.runtime),getSuffix:()=>E.suffix};var z=t=>new URL(String(t),location.href).href.replace(new RegExp(`^${location.origin}`),"");function Re(t,e){let r=new URL(t);for(let o of e)r.searchParams.delete(o);return r.href}async function _e(t,e,r,o){let s=Re(e.url,r);if(e.url===s)return t.match(e,o);let a=Object.assign(Object.assign({},o),{ignoreSearch:!0}),n=await t.keys(e,a);for(let i of n){let c=Re(i.url,r);if(s===c)return t.match(i,o)}}var I=class{constructor(){this.promise=new Promise((e,r)=>{this.resolve=e,this.reject=r})}};var ke=new Set;async function Te(){for(let t of ke)await t()}function ee(t){return new Promise(e=>setTimeout(e,t))}try{self["workbox:strategies:6.5.4"]&&_()}catch{}function B(t){return typeof t=="string"?new Request(t):t}var L=class{constructor(e,r){this._cacheKeys={},Object.assign(this,r),this.event=r.event,this._strategy=e,this._handlerDeferred=new I,this._extendLifetimePromises=[],this._plugins=[...e.plugins],this._pluginStateMap=new Map;for(let o of this._plugins)this._pluginStateMap.set(o,{});this.event.waitUntil(this._handlerDeferred.promise)}async fetch(e){let{event:r}=this,o=B(e);if(o.mode==="navigate"&&r instanceof FetchEvent&&r.preloadResponse){let n=await r.preloadResponse;if(n)return n}let s=this.hasCallback("fetchDidFail")?o.clone():null;try{for(let n of this.iterateCallbacks("requestWillFetch"))o=await n({request:o.clone(),event:r})}catch(n){if(n instanceof Error)throw new h("plugin-error-request-will-fetch",{thrownErrorMessage:n.message})}let a=o.clone();try{let n;n=await fetch(o,o.mode==="navigate"?void 0:this._strategy.fetchOptions);for(let i of this.iterateCallbacks("fetchDidSucceed"))n=await i({event:r,request:a,response:n});return n}catch(n){throw s&&await this.runCallbacks("fetchDidFail",{error:n,event:r,originalRequest:s.clone(),request:a.clone()}),n}}async fetchAndCachePut(e){let r=await this.fetch(e),o=r.clone();return this.waitUntil(this.cachePut(e,o)),r}async cacheMatch(e){let r=B(e),o,{cacheName:s,matchOptions:a}=this._strategy,n=await this.getCacheKey(r,"read"),i=Object.assign(Object.assign({},a),{cacheName:s});o=await caches.match(n,i);for(let c of this.iterateCallbacks("cachedResponseWillBeUsed"))o=await c({cacheName:s,matchOptions:a,cachedResponse:o,request:n,event:this.event})||void 0;return o}async cachePut(e,r){let o=B(e);await ee(0);let s=await this.getCacheKey(o,"write");if(!r)throw new h("cache-put-with-no-response",{url:z(s.url)});let a=await this._ensureResponseSafeToCache(r);if(!a)return!1;let{cacheName:n,matchOptions:i}=this._strategy,c=await self.caches.open(n),p=this.hasCallback("cacheDidUpdate"),$=p?await _e(c,s.clone(),["__WB_REVISION__"],i):null;try{await c.put(s,p?a.clone():a)}catch(w){if(w instanceof Error)throw w.name==="QuotaExceededError"&&await Te(),w}for(let w of this.iterateCallbacks("cacheDidUpdate"))await w({cacheName:n,oldResponse:$,newResponse:a.clone(),request:s,event:this.event});return!0}async getCacheKey(e,r){let o=`${e.url} | ${r}`;if(!this._cacheKeys[o]){let s=e;for(let a of this.iterateCallbacks("cacheKeyWillBeUsed"))s=B(await a({mode:r,request:s,event:this.event,params:this.params}));this._cacheKeys[o]=s}return this._cacheKeys[o]}hasCallback(e){for(let r of this._strategy.plugins)if(e in r)return!0;return!1}async runCallbacks(e,r){for(let o of this.iterateCallbacks(e))await o(r)}*iterateCallbacks(e){for(let r of this._strategy.plugins)if(typeof r[e]=="function"){let o=this._pluginStateMap.get(r);yield a=>{let n=Object.assign(Object.assign({},a),{state:o});return r[e](n)}}}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 r=e,o=!1;for(let s of this.iterateCallbacks("cacheWillUpdate"))if(r=await s({request:this.request,response:r,event:this.event})||void 0,o=!0,!r)break;return o||r&&r.status!==200&&(r=void 0),r}};var y=class{constructor(e={}){this.cacheName=ve.getRuntimeName(e.cacheName),this.plugins=e.plugins||[],this.fetchOptions=e.fetchOptions,this.matchOptions=e.matchOptions}handle(e){let[r]=this.handleAll(e);return r}handleAll(e){e instanceof FetchEvent&&(e={event:e,request:e.request});let r=e.event,o=typeof e.request=="string"?new Request(e.request):e.request,s="params"in e?e.params:void 0,a=new L(this,{event:r,request:o,params:s}),n=this._getResponse(a,o,r),i=this._awaitComplete(n,a,o,r);return[n,i]}async _getResponse(e,r,o){await e.runCallbacks("handlerWillStart",{event:o,request:r});let s;try{if(s=await this._handle(r,e),!s||s.type==="error")throw new h("no-response",{url:r.url})}catch(a){if(a instanceof Error){for(let n of e.iterateCallbacks("handlerDidError"))if(s=await n({error:a,event:o,request:r}),s)break}if(!s)throw a}for(let a of e.iterateCallbacks("handlerWillRespond"))s=await a({event:o,request:r,response:s});return s}async _awaitComplete(e,r,o,s){let a,n;try{a=await e}catch{}try{await r.runCallbacks("handlerDidRespond",{event:s,request:o,response:a}),await r.doneWaiting()}catch(i){i instanceof Error&&(n=i)}if(await r.runCallbacks("handlerDidComplete",{event:s,request:o,response:a,error:n}),r.destroy(),n)throw n}};var g=class extends y{async _handle(e,r){let o=[],s=await r.cacheMatch(e),a;if(!s)try{s=await r.fetchAndCachePut(e)}catch(n){n instanceof Error&&(a=n)}if(!s)throw new h("no-response",{url:e.url,error:a});return s}};var re={cacheWillUpdate:async({response:t})=>t.status===200||t.status===0?t:null};var P=class extends y{constructor(e={}){super(e),this.plugins.some(r=>"cacheWillUpdate"in r)||this.plugins.unshift(re),this._networkTimeoutSeconds=e.networkTimeoutSeconds||0}async _handle(e,r){let o=[],s=[],a;if(this._networkTimeoutSeconds){let{id:c,promise:p}=this._getTimeoutPromise({request:e,logs:o,handler:r});a=c,s.push(p)}let n=this._getNetworkPromise({timeoutId:a,request:e,logs:o,handler:r});s.push(n);let i=await r.waitUntil((async()=>await r.waitUntil(Promise.race(s))||await n)());if(!i)throw new h("no-response",{url:e.url});return i}_getTimeoutPromise({request:e,logs:r,handler:o}){let s;return{promise:new Promise(n=>{s=setTimeout(async()=>{n(await o.cacheMatch(e))},this._networkTimeoutSeconds*1e3)}),id:s}}async _getNetworkPromise({timeoutId:e,request:r,logs:o,handler:s}){let a,n;try{n=await s.fetchAndCachePut(r)}catch(i){i instanceof Error&&(a=i)}return e&&clearTimeout(e),(a||!n)&&(n=await s.cacheMatch(r)),n}};function Ke(t){return new l(({request:e})=>e.destination==="font",new g({cacheName:t.fontsCacheName,plugins:[new d({statuses:[200]}),new m({maxAgeSeconds:3600*24*30})]}))}var te=Ke;function Qe(t){return new l(({request:e})=>e.destination==="image",new g({cacheName:t.imagesCacheName,plugins:[new d({statuses:[200]}),new m({maxAgeSeconds:3600*24*30})]}))}var oe=Qe;function Xe(t){return new P({cacheName:t.pagesCacheName,plugins:[new d({statuses:[200]})]})}function Ze(t){return new l(({request:e})=>e.mode==="navigate",Xe(t))}var se=Ze;function ze(t){return new l(({request:e,sameOrigin:r})=>r&&e.destination==="script",new g({cacheName:t.scriptsCacheName,plugins:[new d({statuses:[200]}),new m({maxAgeSeconds:3600*24*30})]}))}var ne=ze;function er(t){return new l(({request:e})=>e.destination==="style",new g({cacheName:t.stylesCacheName,plugins:[new d({statuses:[200]}),new m({maxAgeSeconds:3600*24*30})]}))}var ae=er;var b=JSON.parse("{}"),u={env:"production",baseURL:"https://fallingmy.github.io/",homepage:"/",langs:JSON.parse('["en"]'),fallbacks:JSON.parse('["/offline/","https://fallingmy.github.io/manifest.json","/images/offline.png"]'),fallbacksCacheName:"fallbacks",fallbacksImage:"images/offline.png",fonts:b.fonts?b.fonts:[],fontsCacheName:"fonts",images:b.images?b.images:[],imagesCacheName:"images",pages:b.pages?b.pages:[],pagesCacheName:"pages",scripts:b.scripts?b.scripts:[],scriptsCacheName:"scripts",styles:b.styles?b.styles:[],stylesCacheName:"styles"};console.debug("service worker config:",u);v(te(u));v(oe(u));v(se(u));v(ne(u));v(ae(u));self.addEventListener("install",t=>{u.fallbacks&&t.waitUntil(caches.open(u.fallbacksCacheName).then(e=>e.addAll(u.fallbacks)).catch(e=>{console.log("unable to cache fallbacks:",e)})),t.waitUntil(ue(u)),u.fonts&&t.waitUntil(caches.open(u.fontsCacheName).then(e=>e.addAll(u.fonts)).catch(e=>{console.log("unable to cache fonts:",e)})),u.images&&t.waitUntil(caches.open(u.imagesCacheName).then(e=>e.addAll(u.images)).catch(e=>{console.log("unable to cache images:",e)})),u.pages&&t.waitUntil(caches.open(u.pagesCacheName).then(e=>e.addAll(u.pages)).catch(e=>{console.log("unable to cache pages:",e)})),u.scripts&&t.waitUntil(caches.open(u.scriptsCacheName).then(e=>e.addAll(u.scripts)).catch(e=>{console.log("unable to cache scripts:",e)})),u.styles&&t.waitUntil(caches.open(u.stylesCacheName).then(e=>e.addAll(u.styles)).catch(e=>{console.log("unable to cache styles:",e)}))});j(G(u));})();