"use strict";function _createForOfIteratorHelper(a,b){var c="undefined"!=typeof Symbol&&a[Symbol.iterator]||a["@@iterator"];if(!c){if(Array.isArray(a)||(c=_unsupportedIterableToArray(a))||b&&a&&"number"==typeof a.length){c&&(a=c);var d=0,e=function(){};return{s:e,n:function n(){return d>=a.length?{done:!0}:{done:!1,value:a[d++]}},e:function e(a){throw a},f:e}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var f,g=!0,h=!1;return{s:function s(){c=c.call(a)},n:function n(){var a=c.next();return g=a.done,a},e:function e(a){h=!0,f=a},f:function f(){try{g||null==c.return||c.return()}finally{if(h)throw f}}}}function _unsupportedIterableToArray(a,b){if(a){if("string"==typeof a)return _arrayLikeToArray(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);return"Object"===c&&a.constructor&&(c=a.constructor.name),"Map"===c||"Set"===c?Array.from(a):"Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c)?_arrayLikeToArray(a,b):void 0}}function _arrayLikeToArray(a,b){(null==b||b>a.length)&&(b=a.length);for(var c=0,d=Array(b);ci?new Promise(function(d){return fetch(a.request.clone()).then(function(e){e?(b.put(a.request,e.clone()),d(e)):d(c)}).catch(function(){d(c)})}).catch(function(a){return console.log(a),c}):c}return c}return null}).then(function(c){return c?c:fetch(a.request.clone()).then(function(c){return 400>c.status?(~SUPPORTED_METHODS.indexOf(a.request.method)&&!isBlacklisted(a.request.url)&&"http"===a.request.url.slice(0,4)&&b.put(a.request,c.clone()),c):caches.open(CACHE_VERSIONS.notFound).then(function(a){return a.match(NOT_FOUND_PAGE)})}).then(function(a){if(a)return a}).catch(function(){return caches.open(CACHE_VERSIONS.offline).then(function(a){return a.match(OFFLINE_PAGE)})})}).catch(function(a){throw console.error(" Error in fetch handler:",a),a})}))});