webpack-bootstrap-ui-kit/dist/js/app_sw.js
2021-05-04 00:00:50 +07:00

1 line
1.9 KiB
JavaScript

!function(){var e,t,r,n={382:function(e){e.exports=e=>{false}},2836:function(e){Cache.prototype.add||(Cache.prototype.add=function add(e){return this.addAll([e])}),Cache.prototype.addAll||(Cache.prototype.addAll=function addAll(e){var t=this;function NetworkError(e){this.name="NetworkError",this.code=19,this.message=e}return NetworkError.prototype=Object.create(Error.prototype),Promise.resolve().then((function(){if(arguments.length<1)throw new TypeError;return e=e.map((e=>e instanceof Request?e:String(e))),Promise.all(e.map((e=>{"string"===typeof e&&(e=new Request(e));var t=new URL(e.url).protocol;if("http:"!==t&&"https:"!==t)throw new NetworkError("Invalid scheme");return fetch(e.clone())})))})).then((r=>Promise.all(r.map(((r,n)=>t.put(e[n],r)))))).then((()=>{}))}),CacheStorage.prototype.match||(CacheStorage.prototype.match=function match(e,t){var r=this;return this.keys().then((n=>{var o;return n.reduce(((n,a)=>n.then((()=>o||r.open(a).then((r=>r.match(e,t))).then((e=>o=e))))),Promise.resolve())}))}),e.exports=self.caches}},o={};function __webpack_require__(e){var t=o[e];if(void 0!==t)return t.exports;var r=o[e]={exports:{}};return n[e](r,r.exports,__webpack_require__),r.exports}e="@a2nt/ss-bootstrap-ui-webpack-boilerplate-react-sw",t=__webpack_require__(382),r=__webpack_require__(2836),self.addEventListener("fetch",(n=>{if("GET"!==n.request.method)return;const o=new URL(n.request.url);if(o.pathname.indexOf("admin")>=0||o.pathname.indexOf("Security")>=0||o.pathname.indexOf("/dev")>=0)return void t(`SW: skip admin ${n.request.url}`);const a=n.request.clone(),s=n.request.clone();n.respondWith(fetch(a).then((t=>{const o=t.clone();return r.open(e).then((e=>{const t=n.request.clone();e.put(t,o)})),t})).catch((e=>(t("SW: fetch failed"),r.match(s)))))})),self.addEventListener("activate",(n=>{t("SW: activated: 3.2.0-sw"),n.waitUntil(r.delete(e))})),self.addEventListener("install",(e=>{t("SW: installing version: 3.2.0-sw")}))}();