workbox-window.prod.es5-legacy-99dac659-1763717014417.js 5.7 KB

1
  1. System.register([],function(n,t){"use strict";return{execute:function(){n("messageSW",t);try{self["workbox:window:7.3.0"]&&_()}catch(t){}function t(n,t){return new Promise(function(e){var r=new MessageChannel;r.port1.onmessage=function(n){e(n.data)},n.postMessage(t,[r.port2])})}function e(n,t){(null==t||t>n.length)&&(t=n.length);for(var e=0,r=Array(t);e<t;e++)r[e]=n[e];return r}function r(n,t){for(var e=0;e<t.length;e++){var r=t[e];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,a(r.key),r)}}function i(n,t){var r="undefined"!=typeof Symbol&&n[Symbol.iterator]||n["@@iterator"];if(r)return(r=r.call(n)).next.bind(r);if(Array.isArray(n)||(r=function(n,t){if(n){if("string"==typeof n)return e(n,t);var r={}.toString.call(n).slice(8,-1);return"Object"===r&&n.constructor&&(r=n.constructor.name),"Map"===r||"Set"===r?Array.from(n):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?e(n,t):void 0}}(n))||t&&n&&"number"==typeof n.length){r&&(n=r);var i=0;return function(){return i>=n.length?{done:!0}:{done:!1,value:n[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function o(n,t){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,t){return n.__proto__=t,n},o(n,t)}function a(n){var t=function(n){if("object"!=typeof n||!n)return n;var t=n[Symbol.toPrimitive];if(void 0!==t){var e=t.call(n,"string");if("object"!=typeof e)return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(n)}(n);return"symbol"==typeof t?t:t+""}try{self["workbox:core:7.3.0"]&&_()}catch(t){}var s=function(){var n=this;this.promise=new Promise(function(t,e){n.resolve=t,n.reject=e})};function c(n,t){var e=location.href;return new URL(n,e).href===new URL(t,e).href}var u=n("WorkboxEvent",function(n,t){this.type=n,Object.assign(this,t)});function f(n,t,e){return e?t?t(n):n:(n&&n.then||(n=Promise.resolve(n)),t?n.then(t):n)}function v(){}var l={type:"SKIP_WAITING"};function h(n,t){if(!t)return n&&n.then?n.then(v):Promise.resolve()}n("Workbox",function(n){function e(t,e){var r,i;return void 0===e&&(e={}),(r=n.call(this)||this).nn={},r.tn=0,r.rn=new s,r.en=new s,r.on=new s,r.un=0,r.an=new Set,r.cn=function(){var n=r.fn,t=n.installing;r.tn>0||!c(t.scriptURL,r.sn.toString())||performance.now()>r.un+6e4?(r.vn=t,n.removeEventListener("updatefound",r.cn)):(r.hn=t,r.an.add(t),r.rn.resolve(t)),++r.tn,t.addEventListener("statechange",r.ln)},r.ln=function(n){var t=r.fn,e=n.target,i=e.state,o=e===r.vn,a={sw:e,isExternal:o,originalEvent:n};!o&&r.mn&&(a.isUpdate=!0),r.dispatchEvent(new u(i,a)),"installed"===i?r.wn=self.setTimeout(function(){"installed"===i&&t.waiting===e&&r.dispatchEvent(new u("waiting",a))},200):"activating"===i&&(clearTimeout(r.wn),o||r.en.resolve(e))},r.yn=function(n){var t=r.hn,e=t!==navigator.serviceWorker.controller;r.dispatchEvent(new u("controlling",{isExternal:e,originalEvent:n,sw:t,isUpdate:r.mn})),e||r.on.resolve(t)},r.gn=(i=function(n){var t=n.data,e=n.ports,i=n.source;return f(r.getSW(),function(){r.an.has(i)&&r.dispatchEvent(new u("message",{data:t,originalEvent:n,ports:e,sw:i}))})},function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];try{return Promise.resolve(i.apply(this,n))}catch(n){return Promise.reject(n)}}),r.sn=t,r.nn=e,navigator.serviceWorker.addEventListener("message",r.gn),r}var i,a;a=n,(i=e).prototype=Object.create(a.prototype),i.prototype.constructor=i,o(i,a);var v=e.prototype;return v.register=function(n){var t=(void 0===n?{}:n).immediate,e=void 0!==t&&t;try{var r=this;return f(function(n,t){var e=n();return e&&e.then?e.then(t):t()}(function(){if(!e&&"complete"!==document.readyState)return h(new Promise(function(n){return window.addEventListener("load",n)}))},function(){return r.mn=Boolean(navigator.serviceWorker.controller),r.dn=r.pn(),f(r.bn(),function(n){r.fn=n,r.dn&&(r.hn=r.dn,r.en.resolve(r.dn),r.on.resolve(r.dn),r.dn.addEventListener("statechange",r.ln,{once:!0}));var t=r.fn.waiting;return t&&c(t.scriptURL,r.sn.toString())&&(r.hn=t,Promise.resolve().then(function(){r.dispatchEvent(new u("waiting",{sw:t,wasWaitingBeforeRegister:!0}))}).then(function(){})),r.hn&&(r.rn.resolve(r.hn),r.an.add(r.hn)),r.fn.addEventListener("updatefound",r.cn),navigator.serviceWorker.addEventListener("controllerchange",r.yn),r.fn})}))}catch(n){return Promise.reject(n)}},v.update=function(){try{return this.fn?f(h(this.fn.update())):f()}catch(t){return Promise.reject(t)}},v.getSW=function(){return void 0!==this.hn?Promise.resolve(this.hn):this.rn.promise},v.messageSW=function(n){try{return f(this.getSW(),function(e){return t(e,n)})}catch(t){return Promise.reject(t)}},v.messageSkipWaiting=function(){this.fn&&this.fn.waiting&&t(this.fn.waiting,l)},v.pn=function(){var n=navigator.serviceWorker.controller;return n&&c(n.scriptURL,this.sn.toString())?n:void 0},v.bn=function(){try{var n=this;return f(function(n,t){try{var e=n()}catch(n){return t(n)}return e&&e.then?e.then(void 0,t):e}(function(){return f(navigator.serviceWorker.register(n.sn,n.nn),function(t){return n.un=performance.now(),t})},function(n){throw n}))}catch(n){return Promise.reject(n)}},function(n,t){return t&&r(n.prototype,t),Object.defineProperty(n,"prototype",{writable:!1}),n}(e,[{key:"active",get:function(){return this.en.promise}},{key:"controlling",get:function(){return this.on.promise}}])}(function(){function n(){this.Pn=new Map}var t=n.prototype;return t.addEventListener=function(n,t){this.jn(n).add(t)},t.removeEventListener=function(n,t){this.jn(n).delete(t)},t.dispatchEvent=function(n){n.target=this;for(var t,e=i(this.jn(n.type));!(t=e()).done;)(0,t.value)(n)},t.jn=function(n){return this.Pn.has(n)||this.Pn.set(n,new Set),this.Pn.get(n)},n}()))}}});