!function(q,t){function O(a,c,h){return caches.open(r).then(function(b){var f={};return c.headers.forEach(function(a,b){f[b]=a}),f["x-abtf-sw"]=n(),h&&h.max_age&&(f["x-abtf-sw-expire"]=h.max_age),c.blob().then(function(d){d=new Response(d,{status:c.status,statusText:c.statusText,headers:f});return b.put(a,d)})})}function G(a){if(a)return"string"==typeof a&&(a=new Request(a,{mode:"no-cors"})),w(a).then(function(c){return c?c:(a.url,u(a,{conditions:null},!1,!0))})}function w(a){var c=m.start(1E3);return caches.open(r).then(function(h){return h.match(a).then(function(a){if(a){var b= a.headers.get("x-abtf-sw-expire");if(b)var d=a.headers.get("x-abtf-sw");var g=a.headers.get("expire");g&&(g=A(g));b&&dn()-5)return l[k][1];d=t(e).then(function(a){g(k);var b=!1;if(a.ok&&400>a.status){var d=a.headers.get("link");d&&(d instanceof Array||(d=[d]),m.f(function(){caches.open(r+":push").then(function(a){d.forEach(function(b){b.split(",").forEach(function(b){if(/rel=preload/.test(b)){var e=b.match(/<([^>]+)>/); e&&e[1]&&a.match(e[1]).then(function(b){b||a.put(e[1],new Response(null,{status:204}))})}})})})},1E3));c&&(b=!0,c.conditions&&c.conditions.forEach(function(c){if(b)switch(c.type){case "url":c.regex?(d=B(c.pattern))?(f=d.test(e.url),c.not?f&&(b=!1):f||(b=!1)):b=!1:(f=-1!==e.url.indexOf(c.pattern),c.not?f&&(b=!1):f||(b=!1));break;case "header":var g=a.headers.get(c.name);if(g)if(c.regex){var d=B(c.pattern);d?(f=d.test(g),c.not?f&&(b=!1):f||(b=!1)):b=!1}else if("object"==typeof c.pattern)if(c.pattern.operator)if(g= parseFloat(g),d=parseFloat(c.pattern.value),isNaN(g)||isNaN(d))b=!1;else{switch(c.pattern.operator){case "<":f=g":f=g>d;break;case "=":var f=g===d;break;default:b=!1}b&&(c.not?f&&(b=!1):f||(b=!1))}else b=!1;else-1===g.indexOf(c.pattern)&&(b=!1);else b=!1}}),b&&O(e,a.clone(),c).then(function(){m.complete(f)}))}return b||m.complete(f),a})["catch"](function(a){return g(k),m.complete(f),h?h(e,null,a):null});return b&&(l[k]=[n(),d],l[k][2]=setTimeout(function(){l[k]=!1;delete l[k]},5E3)), d})}function L(){I||(!J||JC&&(c.sort(function(a,b){return a.t>b.t?-1:a.ta.status)return a.json().then(function(a){if(a){a instanceof Array&&(a={policy:a});r="abtf";a.cache_version&&(r=r+":"+a.cache_version);a.policy&&(p=a.policy,z=n());var c=[],b=[];return a.start_url&&b.push(G(a.start_url)),a.policy&&a.policy.forEach(function(a){a.offline&&-1===c.indexOf(a.offline)&&c.push(a.offline)}),a.preload&&a.preload.forEach(function(a){-1===c.indexOf(a)&&c.push(a)}), preloadPromises=[],c.forEach(function(a){preloadPromises.push(G(a))}),a.i&&(b=b.concat(preloadPromises)),Promise.all(b)}});throw p=!1,Error("service worker config not found: "+E);})["catch"](function(a){p=v=!1;setTimeout(function(){throw a;})}))}function N(a){(new Promise(function(c){if(!p||!z||a&&a>z){var h=!p;D().then(function(){h&&c(p?p:!1)})["catch"](function(){h&&c(!1)})}else if(!v&&z>32-b&(1<=Math.pow(2,32))throw Error('Invalid probability: "${p}" must be smaller than 2**32');if(!(0>b;0!=e;--e)this.b(0);this.b(1);this.c(c,b);c=a[d]}return this};var d=new TextEncoder("utf-8");return function(a,b){return f(a,b)}}(),m=function(){function a(f,d,g){var e=!1,k=Object.keys(c);if(0n()-d&&(e=!1)}return e&&function(a,c){setTimeout(function(){var d;if(b.cache.h&&(d=function(){clients.matchAll().then(function(b){b.forEach(function(b){b.postMessage([2, a.url])})})}),b.cache.head_update)P(a,b.cache,c,d);else{var e=u(a,b.cache);d&&e.then(d)}},10)}(a.request.clone(),c.clone()),c}return u(a.request,b.cache,function(c,d){return b.offline?H(b.offline,c.clone()):d||t(a.request.clone())["catch"](function(a){setTimeout(function(){throw a;})})})});case "event":return w(a.request).then(function(c){return c||u(a.request,null,function(c,d){return b.offline?H(b.offline,c.clone()):d||t(a.request)["catch"](function(a){setTimeout(function(){throw a;})})})});default:return u(a.request, b.cache,function(c,d){return w(c).then(function(e){return e||(b.offline?H(b.offline,c.clone()):d||t(a.request)["catch"](function(a){setTimeout(function(){throw a;})}))})})}}(a,p);if(!1!==h)return a.respondWith(h)}}});q.addEventListener("message",function(a){if(a&&a.data&&a.data instanceof Array){if(1===a.data[0]&&(a.data[1]&&!isNaN(parseInt(a.data[1]))&&N(parseInt(a.data[1])),a.data[3]&&!isNaN(parseInt(a.data[3]))&&(C=parseInt(a.data[3])),m.f(L,1E4,"clean-cache")),2===a.data[0]||3===a.data[0])var c= a.ports[0]?function(b,c){a.ports[0].postMessage({error:b,status:c})}:!1;if(2===a.data[0])if(a.data[1]){var h;if("string"==typeof a.data[1]||a.data[1]instanceof Request?h=[a.data[1]]:a.data[1]instanceof Array&&(h=a.data[1]),h){var b=[];h.forEach(function(a){b.push(G(a))});c&&Promise.all(b).then(function(a){var b=[];a.forEach(function(a){var c={url:a.url,status:a.status,statusText:a.statusText};a=a.headers.get("content-length");c.size=isNaN(parseInt(a))?-1:parseInt(a);b.push(c)});c(null,b)})["catch"](function(){})}else c&& c("invalid-data")}else c&&c("no-urls");3===a.data[0]&&(q.registration.showNotification(a.data[1],a.data[2]),c&&c(null,"sent"))}})}(self,self.fetch,Cache);