-
Notifications
You must be signed in to change notification settings - Fork 9
/
sw.js
1 lines (1 loc) · 22 KB
/
sw.js
1
!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/",r(r.s=135)}({12:function(e,t,r){"use strict";var n;n=self.registration?self.registration.scope:self.scope||new URL("./",self.location).href,e.exports={cache:{name:"$$$toolbox-cache$$$"+n+"$$$",maxAgeSeconds:null,maxEntries:null},debug:!1,networkTimeoutSeconds:null,preCacheItems:[],successResponses:/^0|([123]\d\d)|(40[14567])|410$/}},135:function(e,t,r){e.exports=r(136)},136:function(e,t,r){"use strict";var n,o=r(137),i=(n=o)&&n.__esModule?n:{default:n};self.addEventListener("install",(function(e){return e.waitUntil(self.skipWaiting())})),self.addEventListener("activate",(function(e){return e.waitUntil(self.clients.claim())})),i.default.router.get("/(.*)",i.default.cacheFirst,{origin:"https://cdn.netlify.com"}),i.default.router.get("/(.*)",i.default.cacheFirst,{origin:"https://fonts.googleapis.com"}),i.default.router.default=i.default.networkFirst},137:function(e,t,r){"use strict";var n=r(12),o=r(45),i=r(6),s=r(142),a=r(147);i.debug("Service Worker Toolbox is loading"),self.addEventListener("install",a.installListener),self.addEventListener("activate",a.activateListener),self.addEventListener("fetch",a.fetchListener),e.exports={networkOnly:s.networkOnly,networkFirst:s.networkFirst,cacheOnly:s.cacheOnly,cacheFirst:s.cacheFirst,fastest:s.fastest,router:o,options:n,cache:i.cache,uncache:i.uncache,precache:i.precache}},138:function(e,t,r){"use strict";var n=new URL("./",self.location).pathname,o=r(139),i=function(e,t,r,i){t instanceof RegExp?this.fullUrlRegExp=t:(0!==t.indexOf("/")&&(t=n+t),this.keys=[],this.regexp=o(t,this.keys)),this.method=e,this.options=i,this.handler=r};i.prototype.makeHandler=function(e){var t;if(this.regexp){var r=this.regexp.exec(e);t={},this.keys.forEach((function(e,n){t[e.name]=r[n+1]}))}return function(e){return this.handler(e,t,this.options)}.bind(this)},e.exports=i},139:function(e,t,r){var n=r(140);e.exports=p,e.exports.parse=i,e.exports.compile=function(e,t){return a(i(e,t))},e.exports.tokensToFunction=a,e.exports.tokensToRegExp=l;var o=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function i(e,t){for(var r,n=[],i=0,s=0,a="",f=t&&t.delimiter||"/";null!=(r=o.exec(e));){var h=r[0],l=r[1],p=r.index;if(a+=e.slice(s,p),s=p+h.length,l)a+=l[1];else{var d=e[s],y=r[2],m=r[3],v=r[4],b=r[5],g=r[6],w=r[7];a&&(n.push(a),a="");var x=null!=y&&null!=d&&d!==y,E="+"===g||"*"===g,T="?"===g||"*"===g,A=r[2]||f,R=v||b;n.push({name:m||i++,prefix:y||"",delimiter:A,optional:T,repeat:E,partial:x,asterisk:!!w,pattern:R?c(R):w?".*":"[^"+u(A)+"]+?"})}}return s<e.length&&(a+=e.substr(s)),a&&n.push(a),n}function s(e){return encodeURI(e).replace(/[\/?#]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()}))}function a(e){for(var t=new Array(e.length),r=0;r<e.length;r++)"object"==typeof e[r]&&(t[r]=new RegExp("^(?:"+e[r].pattern+")$"));return function(r,o){for(var i="",a=r||{},u=(o||{}).pretty?s:encodeURIComponent,c=0;c<e.length;c++){var f=e[c];if("string"!=typeof f){var h,l=a[f.name];if(null==l){if(f.optional){f.partial&&(i+=f.prefix);continue}throw new TypeError('Expected "'+f.name+'" to be defined')}if(n(l)){if(!f.repeat)throw new TypeError('Expected "'+f.name+'" to not repeat, but received `'+JSON.stringify(l)+"`");if(0===l.length){if(f.optional)continue;throw new TypeError('Expected "'+f.name+'" to not be empty')}for(var p=0;p<l.length;p++){if(h=u(l[p]),!t[c].test(h))throw new TypeError('Expected all "'+f.name+'" to match "'+f.pattern+'", but received `'+JSON.stringify(h)+"`");i+=(0===p?f.prefix:f.delimiter)+h}}else{if(h=f.asterisk?encodeURI(l).replace(/[?#]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})):u(l),!t[c].test(h))throw new TypeError('Expected "'+f.name+'" to match "'+f.pattern+'", but received "'+h+'"');i+=f.prefix+h}}else i+=f}return i}}function u(e){return e.replace(/([.+*?=^!:${}()[\]|\/\\])/g,"\\$1")}function c(e){return e.replace(/([=!:$\/()])/g,"\\$1")}function f(e,t){return e.keys=t,e}function h(e){return e.sensitive?"":"i"}function l(e,t,r){n(t)||(r=t||r,t=[]);for(var o=(r=r||{}).strict,i=!1!==r.end,s="",a=0;a<e.length;a++){var c=e[a];if("string"==typeof c)s+=u(c);else{var l=u(c.prefix),p="(?:"+c.pattern+")";t.push(c),c.repeat&&(p+="(?:"+l+p+")*"),s+=p=c.optional?c.partial?l+"("+p+")?":"(?:"+l+"("+p+"))?":l+"("+p+")"}}var d=u(r.delimiter||"/"),y=s.slice(-d.length)===d;return o||(s=(y?s.slice(0,-d.length):s)+"(?:"+d+"(?=$))?"),s+=i?"$":o&&y?"":"(?="+d+"|$)",f(new RegExp("^"+s,h(r)),t)}function p(e,t,r){return n(t)||(r=t||r,t=[]),r=r||{},e instanceof RegExp?function(e,t){var r=e.source.match(/\((?!\?)/g);if(r)for(var n=0;n<r.length;n++)t.push({name:n,prefix:null,delimiter:null,optional:!1,repeat:!1,partial:!1,asterisk:!1,pattern:null});return f(e,t)}(e,t):n(e)?function(e,t,r){for(var n=[],o=0;o<e.length;o++)n.push(p(e[o],t,r).source);return f(new RegExp("(?:"+n.join("|")+")",h(r)),t)}(e,t,r):function(e,t,r){return l(i(e,r),t,r)}(e,t,r)}},14:function(e,t,r){(function(t){(function(){!function(e){"use strict";if(!e.fetch){var t={searchParams:"URLSearchParams"in e,iterable:"Symbol"in e&&"iterator"in Symbol,blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e};if(t.arrayBuffer)var r=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],n=function(e){return e&&DataView.prototype.isPrototypeOf(e)},o=ArrayBuffer.isView||function(e){return e&&r.indexOf(Object.prototype.toString.call(e))>-1};f.prototype.append=function(e,t){e=a(e),t=u(t);var r=this.map[e];r||(r=[],this.map[e]=r),r.push(t)},f.prototype.delete=function(e){delete this.map[a(e)]},f.prototype.get=function(e){var t=this.map[a(e)];return t?t[0]:null},f.prototype.getAll=function(e){return this.map[a(e)]||[]},f.prototype.has=function(e){return this.map.hasOwnProperty(a(e))},f.prototype.set=function(e,t){this.map[a(e)]=[u(t)]},f.prototype.forEach=function(e,t){Object.getOwnPropertyNames(this.map).forEach((function(r){this.map[r].forEach((function(n){e.call(t,n,r,this)}),this)}),this)},f.prototype.keys=function(){var e=[];return this.forEach((function(t,r){e.push(r)})),c(e)},f.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),c(e)},f.prototype.entries=function(){var e=[];return this.forEach((function(t,r){e.push([r,t])})),c(e)},t.iterable&&(f.prototype[Symbol.iterator]=f.prototype.entries);var i=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];m.prototype.clone=function(){return new m(this,{body:this._bodyInit})},y.call(m.prototype),y.call(b.prototype),b.prototype.clone=function(){return new b(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new f(this.headers),url:this.url})},b.error=function(){var e=new b(null,{status:0,statusText:""});return e.type="error",e};var s=[301,302,303,307,308];b.redirect=function(e,t){if(-1===s.indexOf(t))throw new RangeError("Invalid status code");return new b(null,{status:t,headers:{location:e}})},e.Headers=f,e.Request=m,e.Response=b,e.fetch=function(e,r){return new Promise((function(n,o){var i=new m(e,r),s=new XMLHttpRequest;s.onload=function(){var e,t,r={status:s.status,statusText:s.statusText,headers:(e=s.getAllResponseHeaders()||"",t=new f,e.split("\r\n").forEach((function(e){var r=e.split(":"),n=r.shift().trim();if(n){var o=r.join(":").trim();t.append(n,o)}})),t)};r.url="responseURL"in s?s.responseURL:r.headers.get("X-Request-URL");var o="response"in s?s.response:s.responseText;n(new b(o,r))},s.onerror=function(){o(new TypeError("Network request failed"))},s.ontimeout=function(){o(new TypeError("Network request failed"))},s.open(i.method,i.url,!0),"include"===i.credentials&&(s.withCredentials=!0),"responseType"in s&&t.blob&&(s.responseType="blob"),i.headers.forEach((function(e,t){s.setRequestHeader(t,e)})),s.send(void 0===i._bodyInit?null:i._bodyInit)}))},e.fetch.polyfill=!0}function a(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function u(e){return"string"!=typeof e&&(e=String(e)),e}function c(e){var r={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return t.iterable&&(r[Symbol.iterator]=function(){return r}),r}function f(e){this.map={},e instanceof f?e.forEach((function(e,t){this.append(t,e)}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function h(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function l(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function p(e){var t=new FileReader,r=l(t);return t.readAsArrayBuffer(e),r}function d(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function y(){return this.bodyUsed=!1,this._initBody=function(e){if(this._bodyInit=e,e)if("string"==typeof e)this._bodyText=e;else if(t.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(t.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(t.searchParams&&URLSearchParams.prototype.isPrototypeOf(e))this._bodyText=e.toString();else if(t.arrayBuffer&&t.blob&&n(e))this._bodyArrayBuffer=d(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer]);else{if(!t.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(e)&&!o(e))throw new Error("unsupported BodyInit type");this._bodyArrayBuffer=d(e)}else this._bodyText="";this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):t.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},t.blob&&(this.blob=function(){var e=h(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?h(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(p)}),this.text=function(){var e,t,r,n=h(this);if(n)return n;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,r=l(t),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},t.formData&&(this.formData=function(){return this.text().then(v)}),this.json=function(){return this.text().then(JSON.parse)},this}function m(e,t){var r,n,o=(t=t||{}).body;if("string"==typeof e)this.url=e;else{if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new f(e.headers)),this.method=e.method,this.mode=e.mode,o||null==e._bodyInit||(o=e._bodyInit,e.bodyUsed=!0)}if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new f(t.headers)),this.method=(r=t.method||this.method||"GET",n=r.toUpperCase(),i.indexOf(n)>-1?n:r),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(o)}function v(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),o=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(o))}})),t}function b(e,t){t||(t={}),this.type="default",this.status="status"in t?t.status:200,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new f(t.headers),this.url=t.url||"",this._initBody(e)}}("undefined"!=typeof self?self:this),e.exports=t.fetch}).call(t)}).call(this,r(3))},140:function(e,t){e.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},141:function(e,t,r){"use strict";var n="sw-toolbox-",o=1,i="store",s="url",a="timestamp",u={};e.exports={getDb:function(e){return e in u||(u[e]=function(e){return new Promise((function(t,r){var u=indexedDB.open(n+e,o);u.onupgradeneeded=function(){u.result.createObjectStore(i,{keyPath:s}).createIndex(a,a,{unique:!1})},u.onsuccess=function(){t(u.result)},u.onerror=function(){r(u.error)}}))}(e)),u[e]},setTimestampForUrl:function(e,t,r){return new Promise((function(n,o){var s=e.transaction(i,"readwrite");s.objectStore(i).put({url:t,timestamp:r}),s.oncomplete=function(){n(e)},s.onabort=function(){o(s.error)}}))},expireEntries:function(e,t,r,n){return function(e,t,r){return t?new Promise((function(n,o){var u=1e3*t,c=[],f=e.transaction(i,"readwrite"),h=f.objectStore(i);h.index(a).openCursor().onsuccess=function(e){var t=e.target.result;if(t&&r-u>t.value[a]){var n=t.value[s];c.push(n),h.delete(n),t.continue()}},f.oncomplete=function(){n(c)},f.onabort=o})):Promise.resolve([])}(e,r,n).then((function(r){return function(e,t){return t?new Promise((function(r,n){var o=[],u=e.transaction(i,"readwrite"),c=u.objectStore(i),f=c.index(a),h=f.count();f.count().onsuccess=function(){var e=h.result;e>t&&(f.openCursor().onsuccess=function(r){var n=r.target.result;if(n){var i=n.value[s];o.push(i),c.delete(i),e-o.length>t&&n.continue()}})},u.oncomplete=function(){r(o)},u.onabort=n})):Promise.resolve([])}(e,t).then((function(e){return r.concat(e)}))}))}}},142:function(e,t,r){e.exports={networkOnly:r(143),networkFirst:r(144),cacheOnly:r(46),cacheFirst:r(145),fastest:r(146)}},143:function(e,t,r){"use strict";(function(t){var n=r(6);e.exports=function(e,r,o){return n.debug("Strategy: network only ["+e.url+"]",o),t(e)}}).call(this,r(14))},144:function(e,t,r){"use strict";var n=r(12),o=r(6);e.exports=function(e,t,r){var i=(r=r||{}).successResponses||n.successResponses,s=r.networkTimeoutSeconds||n.networkTimeoutSeconds;return o.debug("Strategy: network first ["+e.url+"]",r),o.openCache(r).then((function(t){var a,u,c=[];if(s){var f=new Promise((function(i){a=setTimeout((function(){t.match(e).then((function(e){var t=r.cache||n.cache,s=Date.now(),a=t.maxAgeSeconds;o.isResponseFresh(e,a,s)&&i(e)}))}),1e3*s)}));c.push(f)}var h=o.fetchAndCache(e,r).then((function(e){if(a&&clearTimeout(a),i.test(e.status))return e;throw o.debug("Response was an HTTP error: "+e.statusText,r),u=e,new Error("Bad response")})).catch((function(n){return o.debug("Network or response error, fallback to cache ["+e.url+"]",r),t.match(e).then((function(e){if(e)return e;if(u)return u;throw n}))}));return c.push(h),Promise.race(c)}))}},145:function(e,t,r){"use strict";var n=r(12),o=r(6);e.exports=function(e,t,r){return r=r||{},o.debug("Strategy: cache first ["+e.url+"]",r),o.openCache(r).then((function(t){return t.match(e).then((function(t){var i=r.cache||n.cache,s=Date.now();return o.isResponseFresh(t,i.maxAgeSeconds,s)?t:o.fetchAndCache(e,r)}))}))}},146:function(e,t,r){"use strict";var n=r(6),o=r(46);e.exports=function(e,t,r){return n.debug("Strategy: fastest ["+e.url+"]",r),new Promise((function(i,s){var a=!1,u=[],c=function(e){u.push(e.toString()),a?s(new Error('Both cache and network failed: "'+u.join('", "')+'"')):a=!0},f=function(e){e instanceof Response?i(e):c("No result returned")};n.fetchAndCache(e.clone(),r).then(f,c),o(e,t,r).then(f,c)}))}},147:function(e,t,r){"use strict";r(148);var n=r(6),o=r(45),i=r(12);function s(e){return e.reduce((function(e,t){return e.concat(t)}),[])}e.exports={fetchListener:function(e){var t=o.match(e.request);t?e.respondWith(t(e.request)):o.default&&"GET"===e.request.method&&0===e.request.url.indexOf("http")&&e.respondWith(o.default(e.request))},activateListener:function(e){n.debug("activate event fired");var t=i.cache.name+"$$$inactive$$$";e.waitUntil(n.renameCache(t,i.cache.name))},installListener:function(e){var t=i.cache.name+"$$$inactive$$$";n.debug("install event fired"),n.debug("creating cache ["+t+"]"),e.waitUntil(n.openCache({cache:{name:t}}).then((function(e){return Promise.all(i.preCacheItems).then(s).then(n.validatePrecacheInput).then((function(t){return n.debug("preCache list: "+(t.join(", ")||"(none)")),e.addAll(t)}))})))}}},148:function(e,t,r){(function(e){!function(){var t=Cache.prototype.addAll,r=navigator.userAgent.match(/(Firefox|Chrome)\/(\d+\.)/);if(r)var n=r[1],o=parseInt(r[2]);t&&(!r||"Firefox"===n&&o>=46||"Chrome"===n&&o>=50)||(Cache.prototype.addAll=function(t){var r=this;function n(e){this.name="NetworkError",this.code=19,this.message=e}return n.prototype=Object.create(Error.prototype),Promise.resolve().then((function(){if(arguments.length<1)throw new TypeError;return t=t.map((function(e){return e instanceof Request?e:String(e)})),Promise.all(t.map((function(t){"string"==typeof t&&(t=new Request(t));var r=new URL(t.url).protocol;if("http:"!==r&&"https:"!==r)throw new n("Invalid scheme");return e(t.clone())})))})).then((function(e){if(e.some((function(e){return!e.ok})))throw new n("Incorrect response status");return Promise.all(e.map((function(e,n){return r.put(t[n],e)})))})).then((function(){}))},Cache.prototype.add=function(e){return this.addAll([e])})}()}).call(this,r(14))},3:function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==typeof window&&(r=window)}e.exports=r},45:function(e,t,r){"use strict";var n=r(138),o=r(6);var i=function(e,t){for(var r=e.entries(),n=r.next(),o=[];!n.done;){new RegExp(n.value[0]).test(t)&&o.push(n.value[1]),n=r.next()}return o},s=function(){this.routes=new Map,this.routes.set(RegExp,new Map),this.default=null};["get","post","put","delete","head","any"].forEach((function(e){s.prototype[e]=function(t,r,n){return this.add(e,t,r,n)}})),s.prototype.add=function(e,t,r,i){var s;i=i||{},s=t instanceof RegExp?RegExp:(s=i.origin||self.location.origin)instanceof RegExp?s.source:s.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),e=e.toLowerCase();var a=new n(e,t,r,i);this.routes.has(s)||this.routes.set(s,new Map);var u=this.routes.get(s);u.has(e)||u.set(e,new Map);var c=u.get(e),f=a.regexp||a.fullUrlRegExp;c.has(f.source)&&o.debug('"'+t+'" resolves to same regex as existing route.'),c.set(f.source,a)},s.prototype.matchMethod=function(e,t){var r=new URL(t),n=r.origin,o=r.pathname;return this._match(e,i(this.routes,n),o)||this._match(e,[this.routes.get(RegExp)],t)},s.prototype._match=function(e,t,r){if(0===t.length)return null;for(var n=0;n<t.length;n++){var o=t[n],s=o&&o.get(e.toLowerCase());if(s){var a=i(s,r);if(a.length>0)return a[0].makeHandler(r)}}return null},s.prototype.match=function(e){return this.matchMethod(e.method,e.url)||this.matchMethod("any",e.url)},e.exports=new s},46:function(e,t,r){"use strict";var n=r(12),o=r(6);e.exports=function(e,t,r){return r=r||{},o.debug("Strategy: cache only ["+e.url+"]",r),o.openCache(r).then((function(t){return t.match(e).then((function(e){var t=r.cache||n.cache,i=Date.now();if(o.isResponseFresh(e,t.maxAgeSeconds,i))return e}))}))}},6:function(e,t,r){"use strict";(function(t){var n,o=r(12),i=r(141);function s(e,t){((t=t||{}).debug||o.debug)&&console.log("[sw-toolbox] "+e)}function a(e){var t;return e&&e.cache&&(t=e.cache.name),t=t||o.cache.name,caches.open(t)}function u(e,t,r){var n=e.url,o=r.maxAgeSeconds,a=r.maxEntries,u=r.name,c=Date.now();return s("Updating LRU order for "+n+". Max entries is "+a+", max age is "+o),i.getDb(u).then((function(e){return i.setTimestampForUrl(e,n,c)})).then((function(e){return i.expireEntries(e,a,o,c)})).then((function(e){s("Successfully updated IDB.");var r=e.map((function(e){return t.delete(e)}));return Promise.all(r).then((function(){s("Done with cache cleanup.")}))})).catch((function(e){s(e)}))}function c(e){var t=Array.isArray(e);if(t&&e.forEach((function(e){"string"==typeof e||e instanceof Request||(t=!1)})),!t)throw new TypeError("The precache method expects either an array of strings and/or Requests or a Promise that resolves to an array of strings and/or Requests.");return e}e.exports={debug:s,fetchAndCache:function(e,r){var i=(r=r||{}).successResponses||o.successResponses;return t(e.clone()).then((function(t){return"GET"===e.method&&i.test(t.status)&&a(r).then((function(i){i.put(e,t).then((function(){var t=r.cache||o.cache;(t.maxEntries||t.maxAgeSeconds)&&t.name&&function(e,t,r){var o=u.bind(null,e,t,r);n=n?n.then(o):o()}(e,i,t)}))})),t.clone()}))},openCache:a,renameCache:function(e,t,r){return s("Renaming cache: ["+e+"] to ["+t+"]",r),caches.delete(t).then((function(){return Promise.all([caches.open(e),caches.open(t)]).then((function(t){var r=t[0],n=t[1];return r.keys().then((function(e){return Promise.all(e.map((function(e){return r.match(e).then((function(t){return n.put(e,t)}))})))})).then((function(){return caches.delete(e)}))}))}))},cache:function(e,t){return a(t).then((function(t){return t.add(e)}))},uncache:function(e,t){return a(t).then((function(t){return t.delete(e)}))},precache:function(e){e instanceof Promise||c(e),o.preCacheItems=o.preCacheItems.concat(e)},validatePrecacheInput:c,isResponseFresh:function(e,t,r){if(!e)return!1;if(t){var n=e.headers.get("date");if(n)if(new Date(n).getTime()+1e3*t<r)return!1}return!0}}}).call(this,r(14))}});