diff --git a/src/client/html/sites/credits.html b/src/client/html/sites/credits.html index ca828eb..55fe2ab 100644 --- a/src/client/html/sites/credits.html +++ b/src/client/html/sites/credits.html @@ -1,5 +1,5 @@
-

+

-
\ No newline at end of file + diff --git a/src/client/translations/de.json b/src/client/translations/de.json index 49b9a18..cc73436 100644 --- a/src/client/translations/de.json +++ b/src/client/translations/de.json @@ -23,7 +23,7 @@ "choose-theme-dialog-title": "Theme auswählen:", "install": "Installieren", "share-dialog": "Teilen:", - "credits-sister-text": "Ich danke meiner Lieblingsschwester, denn ohne Sie würde diese App nicht so aussehen, wie sie aussieht (wahrscheinlich eher schlechter :p)", + "credits-text": "Ein großer Dank geht an Hanna, denn ohne sie sähe die App nicht so aus, wie sie aussieht. Danke für deine guten Vorschlä und Ratschläge für das Design!", "credits-coin-text": "Sound:
Der Münz-Sound ist von der Webseite {0}. Alle Rechte für diesen Münz-Sound gehören {0}.", "credits-music-text": "Musik:
Bright And Beautiful - GEMAfreie Musik von {0}
Licensed under Creative Commons: By Attribution 4.0 International (CC BY 4.0)
{1}
Angepasst (geschnitten) für diese App", "storage-info": "Fortschritt {0} dauerhaft gespeichert", diff --git a/src/server/public/bundle.js b/src/server/public/bundle.js index 5a0dada..263753a 100644 --- a/src/server/public/bundle.js +++ b/src/server/public/bundle.js @@ -1,3 +1,5967 @@ -/*! For license information please see bundle.js.LICENSE.txt */ -!function(){var e={11983:function(e,t,n){"use strict";n(16266),n(10990),n(70911),n(14160),n(6197),n(96728),n(54039),n(93568),n(78051),n(38250),n(15434),n(54952),n(96337),n(35666)},24631:function(e,t,n){"use strict";function r(e,t){for(var n=0;n0&&(n=r[r.length-1])}this.storagePath=n}var t,n,u;return t=e,(n=[{key:"download",value:function(){return i(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=s.DataManager.fetchBlob(this.downloadUrl),e.next=4,a.FilePromise.open(this.storagePath);case 4:return n=e.sent,e.next=7,n.createWriter();case 7:return r=e.sent,e.t0=r,e.next=11,t;case 11:return e.t1=e.sent,e.next=14,e.t0.write.call(e.t0,e.t1);case 14:case"end":return e.stop()}}),e,this)})))}}])&&r(t.prototype,n),u&&r(t,u),e}();t.FileTransferPromise=u},70482:function(e,t){"use strict";function n(e,t){for(var n=0;n=r)){t.next=9;break}return i="INSERT OR REPLACE INTO "+a+" ("+c.join(",")+") VALUES "+f.join(","),t.next=7,this._queryRunner.query(i,l);case 7:f=[],l=[];case 9:case"end":return t.stop()}}),t,this)})))}));case 12:if(!(f.length>0)){n.next=16;break}return p="INSERT OR REPLACE INTO "+a+" ("+c.join(",")+") VALUES "+f.join(","),n.next=16,this._queryRunner.query(p,l);case 16:case"end":return n.stop()}}),n,this)})))}},{key:"_deleteModels",value:function(e,t){return i(this,void 0,void 0,regeneratorRuntime.mark((function n(){var r,o,a,u,c,l=this;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(r=300,0!==t.length){n.next=3;break}return n.abrupt("return");case 3:return o=e.getSchemaName(),o=s.Helper.toSnakeCase(o),a=[],u=[],n.next=9,s.Helper.asyncForEach(t,(function(e){return i(l,void 0,void 0,regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a.push(e),u.push("?"),!(u.length>=r)){t.next=8;break}return n="DELETE FROM "+o+" WHERE id IN ("+a.join(",")+")",t.next=6,this._queryRunner.query(n);case 6:u=[],a=[];case 8:case"end":return t.stop()}}),t,this)})))}));case 9:if(!(u.length>0)){n.next=13;break}return c="DELETE FROM "+o+" WHERE id IN ("+a.join(",")+")",n.next=13,this._queryRunner.query(c);case 13:case"end":return n.stop()}}),n,this)})))}},{key:"_handleManyToManyRelations",value:function(){return i(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,n=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._savePromise;case 2:return t=[],Object.keys(this._manyToManyRelations).forEach((function(e){var r="DELETE FROM "+e+" WHERE ",i=[];Object.keys(n._manyToManyRelations[e]).forEach((function(t){t.startsWith("delete_")&&i.push(t.substr(7)+" IN ("+n._manyToManyRelations[e][t].join(",")+")")})),r+=i.join(" OR ")+";",t.push(n._queryRunner.query(r).then((function(){if(n._manyToManyRelations[e].values.length>0){var t=Object.keys(n._manyToManyRelations[e].values[0]),r=[];n._manyToManyRelations[e].values.forEach((function(e){var n=[];t.forEach((function(t){n.push(e[t])})),r.push("("+n.join(",")+")")}));var i="INSERT OR REPLACE INTO "+e+"("+t.join(",")+") VALUES "+r.join(",")+";";return n._queryRunner.query(i)}})))})),e.next=6,Promise.all(t);case 6:case"end":return e.stop()}}),e,this)})))}}])&&r(t.prototype,n),d&&r(t,d),e}();t.SyncJob=d,d.SYNC_PATH_PREFIX="sync"},26590:function(e,t,n){"use strict";function r(e,t){for(var n=0;nr)){a.next=5;break}s=t[r],a.next=9;break;case 5:if(!p.Helper.isNotNull(e.id)){a.next=9;break}return a.next=8,this.findById(e.id,this.getRelations());case 8:s=a.sent;case 9:null===s&&(s=new this),e.version||0===e.version||(e.version=1),t[r]=Object.assign(s,e),this._handleColumns(t[r]),this._handleRelations(t[r],n,o),i();case 15:case"end":return a.stop()}}),a,this)})))})))})),r.next=9,Promise.all(a);case 9:return r.next=11,Promise.all(o);case 11:return i||(t=t.length>0?t[0]:null),r.abrupt("return",t);case 13:case"end":return r.stop()}}),r)})))}},{key:"_handleRelations",value:function(e,t,n){var r=this.getRelationDefinitions();Object.keys(r).forEach((function(i){var o=e[i];if("number"==typeof o||Array.isArray(o)&&o.length>=1&&"number"==typeof o[0])if(!0===t){var a=null;a=Array.isArray(o)?f.BaseDatabase.getModel(r[i].target).findByIds(o):f.BaseDatabase.getModel(r[i].target).findById(o),n.push(a.then((function(t){e[i]=t})))}else!1===t&&("many-to-many"===r[i].type||"one-to-many"===r[i].type?e[i]=[]:e[i]=null)}))}},{key:"_handleColumns",value:function(e){var t=this.getSchemaDefinition().columns;Object.keys(t).forEach((function(n){t[n].escapeHTML&&(e[n]=p.XSSHelper.escapeHTML(e[n])),t[n].escapeJS&&(e[n]=p.XSSHelper.escapeJS(e[n]))}))}},{key:"prepareSync",value:function(e){return e}}],(n=[{key:"toJSON",value:function(e){var t=this,n=this.constructor.getRelationDefinitions(),r=this.constructor.getColumnDefinitions(),i={};return Object.keys(r).forEach((function(e){i[e]=t[e]})),Object.keys(n).forEach((function(n){if(!0===e)i[n]=t[n];else if(Array.isArray(t[n])){var r=[];t[n].forEach((function(e){return e&&r.push(e.id)})),i[n]=r}else t[n]instanceof f.BaseModel?i[n]=t[n].id:i[n]=null})),i}}])&&i(t.prototype,n),r&&i(t,r),EasySyncBaseModel}(f.BaseModel);t.EasySyncBaseModel=EasySyncBaseModel,EasySyncBaseModel.delegateClass=null,EasySyncBaseModel.CAN_BE_SYNCED=!0},38335:function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;nr)){a.next=5;break}s=t[r],a.next=9;break;case 5:if(!d.Helper.isNotNull(e.id)){a.next=9;break}return a.next=8,this.findById(e.id,this.getRelations());case 8:s=a.sent;case 9:null===s&&(s=new this),e.version||(e.version=1),t[r]=Object.assign(s,e),this._handleColumns_(t[r]),this._handleRelations_(t[r],n,o),i();case 15:case"end":return a.stop()}}),a,this)})))})))})),r.next=9,Promise.all(a);case 9:return r.next=11,Promise.all(o);case 11:return i||(t=t.length>0?t[0]:null),r.abrupt("return",t);case 13:case"end":return r.stop()}}),r)})))}},{key:"_handleRelations_",value:function(e,t,n){var r=this.getRelationDefinitions();Object.keys(r).forEach((function(i){var o=e[i];if("number"==typeof o||Array.isArray(o)&&o.length>=1&&"number"==typeof o[0])if(!0===t){var a=null;a=Array.isArray(o)?m.BaseDatabase.getModel(r[i].target).findByIds(o):m.BaseDatabase.getModel(r[i].target).findById(o),n.push(a.then((function(t){e[i]=t})))}else!1===t&&("many-to-many"===r[i].type||"one-to-many"===r[i].type?e[i]=[]:e[i]=null)}))}},{key:"_handleColumns_",value:function(e){var t=this.getSchemaDefinition().columns;Object.keys(t).forEach((function(n){t[n].escapeHTML&&(e[n]=y.XSSHelper.escapeHTML(e[n])),t[n].escapeJS&&(e[n]=y.XSSHelper.escapeJS(e[n]))}))}}],(n=[{key:"toJSON",value:function(e){var t=this,n=this.constructor.getRelationDefinitions(),r=this.constructor.getColumnDefinitions(),i={};return Object.keys(r).forEach((function(e){"clientId"!==e&&(i[e]=t[e])})),Object.keys(n).forEach((function(n){if(!0===e)i[n]=t[n];else if(Array.isArray(t[n])){var r=[];t[n].forEach((function(e){return e&&r.push(e.id)})),i[n]=r}else t[n]instanceof m.BaseModel?i[n]=t[n].id:i[n]=null})),i}}])&&o(t.prototype,n),r&&o(t,r),p}(p.EasySyncBaseModel);t.EasySyncPartialModel=g,g.CAN_BE_SYNCED=!0},95592:function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n=2?c.StartSiteMenuAction._app.startSite(i[0],i[1]):c.StartSiteMenuAction._app.startSite(i))}),o,a,s)}return n}(u.UserMenuAction);t.StartUserSiteMenuAction=l},4705:function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0)){r.next=8;break}return r.abrupt("return",i);case 8:return a=new m.User,r.next=11,c._getNewId();case 11:return a.id=r.sent,a.email=e,a.password=this._hashPassword(n),a.username=t,a.roles=c.DEFAULT_ROLES,a.activated=!0,r.next=19,a.save();case 19:return r.next=21,this.login(e,n);case 21:return r.abrupt("return",a);case 22:case"end":return r.stop()}}),r,this)})))}},{key:"_hashPassword",value:function(e){return e}}])&&a(t.prototype,n),r&&a(t,r),c}(d.UserManager);t.OfflineUserManager=g,g.LOGGED_OUT_ACCESSES=d.UserManager.OFFLINE_ACCESSES,g.DEFAULT_ROLES=[],g._lastId=null},37730:function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){for(var n=0;n0&&(t[n[0]]=decodeURIComponent(n[1]));return t}},{key:"setStartParam",value:function(e,t){this._startParams[e]=t}}],(n=[{key:"addDeepLink",value:function(e,t){this._deepLinks[e]=t}},{key:"startSite",value:function(e,t){return i(this,void 0,void 0,regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!this._siteManager){n.next=2;break}return n.abrupt("return",this._siteManager.startSite(e,t));case 2:case"end":return n.stop()}}),n,this)})))}},{key:"start",value:function(t){return i(this,void 0,void 0,regeneratorRuntime.mark((function n(){var r,i,a;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.ready();case 2:r=t,i=e._getStartParams(),o.Helper.isNotNull(i.s)&&(t=o.Helper.nonNull(this._deepLinks[i.s],t),delete i.s),(a=this._siteManager).init("site",this._deepLinks),o.Helper.removeAllChildren(document.getElementById("site")),a.startSite(t,i),a.setAppEndedListener((function(e){e.startSite(r)}));case 10:case"end":return n.stop()}}),n,this)})))}},{key:"ready",value:function(t){return i(this,void 0,void 0,regeneratorRuntime.mark((function n(){var r,i=this;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(r=this._readyPromise.then((function(){return e._resolver.resolve(i),Promise.all(e._promises)})),!t){n.next=5;break}return n.abrupt("return",r.then(t));case 5:return n.abrupt("return",r);case 6:case"end":return n.stop()}}),n,this)})))}}])&&r(t.prototype,n),s&&r(t,s),e}();t.App=s,s._promises=[],s._resolver={resolve:null,reject:null},s._mainPromise=new Promise((function(e,t){s._resolver={resolve:e,reject:t}})),s._startParams={}},97698:function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n186?{r:0,g:0,b:0}:{r:255,g:255,b:255}:{r:e=255-e,g:t=255-t,b:n=255-n}}},{key:"toHEX",value:function(e,t,n){return"object"===r(e)&&(t=e.g,n=e.b,e=e.r),e=e.toString(16),t=t.toString(16),n=n.toString(16),"#"+f.Helper.padZero(e)+f.Helper.padZero(t)+f.Helper.padZero(n)}}])&&o(t.prototype,n),u&&o(t,u),l}(l.Singleton);t.ColorIndicator=p},8408:function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){for(var n=0;n"),f.Translator.translate("error"));e.setTranslatable(!1),e.show()}),c.MenuAction.SHOW_ALWAYS,-1e3,u.ERROR_ICON))._visible=u._errors.length>0,e._shouldTranslate=!1,console.log("icon: ",u.ERROR_ICON),e}return t=u,r=[{key:"addError",value:function(e){-1===this._errors.indexOf(e)&&(this._errors.push(e),this.getInstance().setVisibility(this._errors.length>0))}},{key:"removeError",value:function(e){var t=this._errors.indexOf(e);t>=0&&(this._errors.splice(t,1),this.getInstance().setVisibility(this._errors.length>0))}},{key:"getInstance",value:function(){return null===this._instance&&(this._instance=new u),this._instance}}],(n=null)&&i(t.prototype,n),r&&i(t,r),u}(c.MenuAction);t.ErrorAction=h,h.ERROR_ICON=p,h._instance=null,h._errors=[]},68515:function(e,t,n){"use strict";function r(e,t){for(var n=0;n=2?n._app.startSite(r[0],r[1]):n._app.startSite(r))}),i,o,a)}return n}(u.MenuAction);t.StartSiteMenuAction=l,l._app=null,c.App.addInitialization((function(e){l._app=e}))},75139:function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){for(var n=0;n span"),r=this.findBy(".background-img"),i=function(){var e=t.findBy("nav.top-bar");n.getBoundingClientRect().bottom>=r.getBoundingClientRect().bottom?e.classList.add("solid"):e.classList.remove("solid")};r.addEventListener("load",i),e.addEventListener("scroll",i),requestAnimationFrame(i)}}},{key:"setBackgroundImage",value:function(e){var t=this;if(this._backgroundImage=e,this._view){var n=this.findBy("nav.top-bar");if(d.Helper.isNotNull(this._backgroundImage)){var r=this.findBy(".background-img"),i=w.ColorIndicator.getInstance();r.addEventListener("load",(function(){if(""!==t._backgroundImage){var e=i.getAverageImgColor(r,void 0,150),o=i.invertColorBW(e);0===o.r&&0===o.g&&0===o.b?(n.classList.remove("color-white"),n.classList.add("color-black")):(n.classList.remove("color-black"),n.classList.add("color-white"))}else n.classList.remove("color-black"),n.classList.remove("color-white")})),requestAnimationFrame((function(){var e=n.querySelector(".grid-container");n.style="min-height:"+e.getBoundingClientRect().height+"px",e.addEventListener("resize",(function(){n.style="min-height:"+e.getBoundingClientRect().height+"px"}))})),r.src=this._backgroundImage,n.classList.add("with-image")}else n.classList.remove("with-image")}}},{key:"onViewLoaded",value:function(){var e=this,t=Object.create(null,{onViewLoaded:{get:function(){return o(c(_.prototype),"onViewLoaded",e)}}});return l(this,void 0,void 0,regeneratorRuntime.mark((function e(){var n,r,i,o,a=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.onViewLoaded.call(this),this.setTitleElement(document.createTextNode(_.title)),(r=[]).push(new g.DropdownRenderer(this.findBy("#navbar-menu-visible"))),r.push(new b.AccordionRenderer(this.findBy("#navbar-menu-hidden"))),this._menu=new m.Menu(r,this._menuActions),this._closeListenerContainer=this.findBy("#navbar-close-listener-container"),this._menu.setOpenSubmenuListener((function(){a._showCloseListener()})),i=this._menu.getOnClickListener(),this._menu.setOnClickListener((function(e){i(e)instanceof v.OpenSubmenuAction||a.closeMenu()})),this._responsiveMenu=this.findBy("#responsive-menu"),this.findBy("#responsive-menu-toggle").onclick=function(){a._responsiveMenu.classList.contains("visible")?a.closeMenu():a.openMenu()},o=this,this.findBy("#navbar-close-listener").addEventListener("click",(function(e){e.target===this&&o.closeMenu()})),window.addEventListener("resize",(function(){a._state===y.Context.STATE_RUNNING&&a.updateToggleButton()})),this.drawMenu(),this.findBy(".back-button").addEventListener("click",(function(){a.goBack()})),this.setCanGoBack(this._canGoBack),this.setBackgroundImage(this._backgroundImage),this.setScrollWidget(this._scrollWidget),this.setLogo(this._logo),e.abrupt("return",n);case 22:case"end":return e.stop()}}),e,this)})))}},{key:"goBack",value:function(){this._canGoBack&&this.getSite().goBack()}},{key:"onStart",value:function(e){var t=this,n=Object.create(null,{onStart:{get:function(){return o(c(_.prototype),"onStart",t)}}});return l(this,void 0,void 0,regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n.onStart.call(this,e),this.updateToggleButton();case 2:case"end":return t.stop()}}),t,this)})))}},{key:"_showCloseListener",value:function(){this._closeListenerContainer&&(this._closeListenerContainer.style.display="block")}},{key:"closeMenu",value:function(){d.Helper.isNotNull(this._responsiveMenu)&&this._responsiveMenu.classList.remove("visible"),this._closeListenerContainer&&(this._closeListenerContainer.style.display="none"),this._menu&&this._menu.close()}},{key:"openMenu",value:function(){d.Helper.isNotNull(this._responsiveMenu)&&this._responsiveMenu.classList.add("visible"),this._showCloseListener()}},{key:"drawMenu",value:function(){d.Helper.isNotNull(this._menu)&&this._menu.draw()}},{key:"updateToggleButton",value:function(){var e=_._getCurrentSize(),t=this.findBy("#navbar-menu-visible");("medium"===e||"smedium"===e||"small"===e)&&t.querySelectorAll("."+h.MenuAction.SHOW_FOR_LARGE+":not(.hidden)").length>0||("smedium"===e||"small"===e)&&t.querySelectorAll("."+h.MenuAction.SHOW_FOR_MEDIUM+":not(.hidden)").length>0||"small"===e&&t.querySelectorAll("."+h.MenuAction.SHOW_FOR_SMEDIUM+":not(.hidden)").length>0||t.querySelectorAll("."+h.MenuAction.SHOW_NEVER+":not(.hidden)").length>0?document.getElementById("responsive-menu-toggle").style.display="block":(document.getElementById("responsive-menu-toggle").style.display="none",this.closeMenu())}},{key:"addAction",value:function(e){this._menuActions.push(e),d.Helper.isNotNull(this._menu)&&this._menu.addAction(e)}},{key:"removeAllActions",value:function(e){this._menuActions=[],d.Helper.isNotNull(this._menu)&&this._menu.removeAllActions(e)}},{key:"setTitleElement",value:function(e){d.Helper.removeAllChildren(this.findBy("#title-element-container")).appendChild(e)}}])&&i(t.prototype,n),u&&i(t,u),_}(f.AbstractFragment);t.NavbarFragment=_,_.queries=[],_.title="MeinBerufBau",_.defaultActions=[]},55181:function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return function(e){if(Array.isArray(e))return o(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=1){var e=this.getCurrentSite();e&&!1!==e.onBackPressed()&&this.endSite(e)}}},{key:"getCurrentSite",value:function(){return this._siteStack.length>=1?this._siteStack[this._siteStack.length-1]:null}},{key:"startSite",value:function(e,t){return i(this,void 0,void 0,regeneratorRuntime.mark((function n(){var r,c,l=this;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(e.prototype instanceof a.AbstractSite){n.next=2;break}throw{error:"wrong class given! Expected AbstractSite, given "+e.name};case 2:return p.EventManager.trigger("site-manager-start-site",{site:e,paramPromise:t}),r=s.ViewInflater.createLoadingSymbol("overlay"),this._siteDiv.appendChild(r),c=new e(this),this._siteStack.unshift(c),Promise.resolve(t).then((function(e){return i(l,void 0,void 0,regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return c._onConstructPromise=c.onConstruct(o.Helper.nonNull(e,{})),t.next=3,Promise.all([c._onConstructPromise,c.getViewPromise()]);case 3:if(c._state===u.Context.STATE_DESTROYED||c._state===u.Context.STATE_DESTROYING){t.next=8;break}return t.next=6,c.onViewLoaded();case 6:return c._viewLoadedPromise.resolve(),t.abrupt("return",this._show(c));case 8:r.remove();case 9:case"end":return t.stop()}}),t,this)})))})).catch((function(t){console.error("site start error for site ",e.name,t),c.getFinishResolver().reject(t),r.remove();for(var n=l._siteStack.length-1;n>=0;n--)if(l._siteStack[n]!==c)return l._show(l._siteStack[n]);c._viewLoadedPromise.reject()})),n.abrupt("return",c.getFinishPromise());case 9:case"end":return n.stop()}}),n,this)})))}},{key:"updateUrl",value:function(e,t){var n=this._generateUrl(e,t);f.HistoryManager.getInstance().replaceState({site:e,parameters:t},e.constructor.name,n)}},{key:"_generateUrl",value:function(e,t){var n=this.getDeepLinkFor(e),r=[location.protocol,"//",location.host,location.pathname].join("");return o.Helper.isNotNull(n)&&(t.s=n,r=[r,l.DataManager.buildQuery(t)].join("")),r}},{key:"getDeepLinkFor",value:function(e){return this._inversedDeepLinks[e.constructor]}},{key:"_pauseSite",value:function(e){e=o.Helper.nonNull(e,this.getCurrentSite()),o.Helper.isNotNull(e)&&e._state===u.Context.STATE_RUNNING&&(e._pauseParameters=e.onPause(),o.Helper.removeAllChildren(this._siteDiv).appendChild(s.ViewInflater.createLoadingSymbol()))}},{key:"_resumeSite",value:function(e){return i(this,void 0,void 0,regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=o.Helper.nonNull(e,this.getCurrentSite()),!o.Helper.isNotNull(e)||e._state!==u.Context.STATE_PAUSED&&e._state!==u.Context.STATE_CONSTRUCTED){t.next=10;break}return t.next=4,e.getViewPromise();case 4:return o.Helper.removeAllChildren(this._siteDiv).appendChild(e._view),t.next=7,c.Translator.getInstance().updateTranslations();case 7:return o.Helper.isNull(e._historyId)?e._historyId=f.HistoryManager.getInstance().pushState({site:e,parameters:e.getParameters()},e.constructor.name,this._generateUrl(e,e.getParameters())):f.HistoryManager.getInstance().stateToCurrentPosition(e._historyId),t.next=10,e.onStart(e._pauseParameters);case 10:case"end":return t.stop()}}),t,this)})))}},{key:"_show",value:function(e){return i(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n,r=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e._state!==u.Context.STATE_DESTROYING&&e._state!==u.Context.STATE_DESTROYED){t.next=2;break}return t.abrupt("return");case 2:if(e._state!==u.Context.STATE_RUNNING||this.getCurrentSite()!==e){t.next=4;break}return t.abrupt("return");case 4:return this._pauseSite(),o.Helper.removeAllChildren(this._siteDiv).appendChild(s.ViewInflater.createLoadingSymbol()),-1!==(n=this._siteStack.indexOf(e))&&this._siteStack.splice(n,1),this._siteStack.push(e),t.abrupt("return",e.getViewPromise().then((function(){return i(r,void 0,void 0,regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.getCurrentSite()!==e){t.next=3;break}return t.next=3,this._resumeSite(e);case 3:case"end":return t.stop()}}),t,this)})))})));case 10:case"end":return t.stop()}}),t,this)})))}},{key:"endSite",value:function(e){return i(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n,r=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=this._siteStack.indexOf(e),this._siteStack.splice(n,1),n===this._siteStack.length&&(this._pauseSite(e),this._siteDiv.appendChild(s.ViewInflater.createLoadingSymbol("overlay")),e.getFinishPromise().then((function(){var e=r.getCurrentSite();o.Helper.isNotNull(e)&&r.toForeground(e)}))),this._siteStack.length<=0&&(console.log("stack is empty, starting normal site!"),f.HistoryManager.getInstance().cutStack(0),f.HistoryManager.getInstance().go(-1*history.length,!0),o.Helper.removeAllChildren(this._siteDiv).appendChild(document.createTextNode("App ist beendet")),"function"==typeof this._appEndedListener&&this._appEndedListener(this)),e._context=u.Context.STATE_DESTROYING,t.next=7,e.onDestroy();case 7:e._context=u.Context.STATE_DESTROYED,e.getFinishResolver().resolve(e._result);case 9:case"end":return t.stop()}}),t,this)})))}},{key:"toForeground",value:function(e){return this._show(e)}},{key:"updateTitle",value:function(e,t,n){n=o.Helper.nonNull(n,o.Helper.isNull(e)?"document-title-empty":"document-title"),o.Helper.isNotNull(this._titleTranslationCallbackId)&&c.Translator.removeTranslationCallback(this._titleTranslationCallbackId),this._titleTranslationCallbackId=c.Translator.addTranslationCallback((function(){!1!==t&&(e=c.Translator.translate(e,t)),document.title=c.Translator.translate(n,[e])}))}}])&&r(t.prototype,n),h&&r(t,h),e}();t.SiteManager=h,h._instance=null},97533:function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){for(var n=0;n=f.MIN_X)){n.next=13;break}if(!(i>0)){n.next=11;break}return n.next=9,this._fragments[this._activeIndex].onSwipeLeft();case 9:n.next=13;break;case 11:return n.next=13,this._fragments[this._activeIndex].onSwipeRight();case 13:case"end":return n.stop()}}),n,this)})))}},{key:"onStart",value:function(e){var t=this,n=Object.create(null,{onStart:{get:function(){return o(c(f.prototype),"onStart",t)}}});return l(this,void 0,void 0,regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._activeIndex>=0&&this._activeIndex=0&&ee.length)&&(t=e.length);for(var n=0,r=new Array(t);nt._currentStackIndex&&t._currentStackIndex>=0&&(r=t._states[t._stack[t._currentStackIndex]]),t._onPopStateListener(r,n,e)}}},this._updateNativeHistoryStack()}var t,n,o;return t=e,o=[{key:"getInstance",value:function(){return i.Helper.isNull(e._instance)&&(e._instance=new e),e._instance}}],(n=[{key:"_updateNativeHistoryStack",value:function(t){t=i.Helper.nonNull(t,window.location.href),this._currentStackIndex>=0&&history.pushState({type:e.BACK},"back",t),history.pushState({type:e.CURRENT},"current",t),this._currentStackIndexthis._currentStackIndex&&this._currentStackIndex>=0&&(this._states[r]={state:e,title:t,url:n},this._updateNativeHistoryStack(n))}},{key:"stateToCurrentPosition",value:function(e){if(i.Helper.isNotNull(this._states[e])){var t=this._stack.indexOf(e);-1!==t&&(this._stack.splice(t,1),this._stack.splice(this._currentStackIndex+(t<=this._currentStackIndex?-1:0),0,e))}}},{key:"go",value:function(e,t){this._ignoreOnPopState=!0===i.Helper.nonNull(t,!1),history.go(e)}},{key:"cutStack",value:function(e){e=i.Helper.nonNull(e,this._currentStackIndex+1),this._stack.splice(e),this._currentStackIndex=Math.min(this._currentStackIndex,this._stack.length-1),this._updateNativeHistoryStack()}},{key:"back",value:function(){this.go(-1)}},{key:"forward",value:function(){this.go(1)}},{key:"setOnPopStateListener",value:function(e){this._onPopStateListener=e}}])&&r(t.prototype,n),o&&r(t,o),e}();t.HistoryManager=o,o.BACK=-1,o.FORWARD=1,o.CURRENT=0},48981:function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){return(o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function a(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=u(e);if(t){var i=u(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return s(this,n)}}function s(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.EventManager=void 0;var c=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&o(e,t)}(n,e);var t=a(n);function n(){return i(this,n),t.apply(this,arguments)}return n}(n(12030).EventManager);t.EventManager=c},34177:function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){for(var n=0;n2?r-2:0),o=2;o1?n-1:0),i=1;i1&&0==(3&c)&&(c%100!=0||c%400==0)?1:0),3),"%k":""+l,"%l":(l+11)%12+1,"%m":m(u+1,2),"%M":m(n.getMinutes(),2),"%p":l<12?"AM":"PM","%P":l<12?"am":"pm","%s":Math.round(n.getTime()/1e3),"%S":m(n.getSeconds(),2),"%u":o||7,"%w":""+o,"%x":n.toLocaleDateString(),"%X":n.toLocaleTimeString(),"%y":(""+c).slice(2),"%Y":c,"%z":n.toTimeString().replace(/.+GMT([+-]\d+).+/,"$1"),"%Z":n.toTimeString().replace(/.+\((.+?)\)$/,"$1")}[e]||e}))}},{key:"arrayToObject",value:function(e,t){var n={};return e.forEach((function(e){n[t(e)]=e})),n}},{key:"cloneJson",value:function(t){var n;if(e.isNull(t)||"object"!==r(t))return t;if(t instanceof Array){var i=[];for(n=0;n=n?t:new Array(n-t.length+1).join(r)+t}},{key:"deepEqual",value:function(t,n){if(t===n)return!0;if("object"===r(t)&&"object"===r(n)){var i=Object.keys(n);return Object.keys(t).every((function(r){var o=i.indexOf(r);return!(o<0)&&(i.splice(o,1),e.deepEqual(t[r],n[r]))}))&&0===i.length}return!1}},{key:"htmlspecialcharsDecode",value:function(t){var n={"&":"&","&":"&","<":"<",">":">",""":'"',"'":"'","’":"’","‘":"‘","–":"–","—":"—","…":"…","”":"”"};return e.isNotNull(t)&&"function"==typeof t.replace?t.replace(/\&[\w\d\#]{2,5}\;/g,(function(e){return n[e]})):t}},{key:"invertKeyValues",value:function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}},{key:"asyncForEach",value:function(t,n,r){return o(this,void 0,void 0,regeneratorRuntime.mark((function i(){var o,a,s,u;return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:r=e.nonNull(r,!1),t instanceof Map&&(t=Array.from(t.values())),o=[],a=0;case 4:if(!(a0)){i.next=8;break}return i.next=8,new Promise((function(e){setTimeout(e,c),t.style.fontSize=f+"px"}));case 8:return p=this,h=function(){return new Promise((function(i){setTimeout((function(){i(p.scaleTo(e,t,n,r,a,s,u,c,!1))}),"number"==typeof l?l:255)}))},!1!==l&&window.addEventListener("resize",h),i.abrupt("return",h);case 12:case"end":return i.stop()}}),i,this)})))}},{key:"scaleToFull",value:function(e,t,n,r,o,a,s,u){return i(this,void 0,void 0,regeneratorRuntime.mark((function i(){return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",this.scaleTo(1,e,t,n,r,o,a,s,u));case 1:case"end":return i.stop()}}),i,this)})))}},{key:"_getNewFontSize",value:function(e,t,n,r,a,s,u,c){return i(this,void 0,void 0,regeneratorRuntime.mark((function i(){var l,f,p,h,d,y,m,v,g,b,w,E,_;return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:for(s=o.Helper.nonNull(s,10),r=o.Helper.nonNull(r,!1),a=o.Helper.nonNull(a,!1),u=o.Helper.nonNull(u,t.innerHTML.length),c=o.Helper.nonNull(c,!0),(l=n.classList.contains("no-transition"))||n.classList.add("no-transition"),f=5,p=0,h=[],d=0;d(1-e)*b||a)&&(g>(1-e)*w||r)){i.next=17;break}case 30:if(m-=s,t.style.fontSize=c?m+"px":y,l){i.next=36;break}return i.next=35,new Promise((function(e){setTimeout(e,50)}));case 35:n.classList.remove("no-transition");case 36:return i.abrupt("return",m);case 37:case"end":return i.stop()}}),i)})))}}])&&r(t.prototype,n),a&&r(t,a),e}();t.ScaleHelper=a},2234:function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){for(var n=0;n=0}},{key:"setItem",value:function(e,t){return o(this,void 0,void 0,regeneratorRuntime.mark((function n(){var r=this;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!this.persistent){n.next=8;break}if(!this._isElectron()){n.next=5;break}return n.abrupt("return",new Promise((function(n,i){return r.electronStorage.set(r.prefix+e,t,(function(e){e?i(e):n()}))})));case 5:return n.abrupt("return",new Promise((function(n,i){return NativeStorage.setItem(r.prefix+e,t,n,i)})));case 6:n.next=9;break;case 8:this._cache[this.prefix+e]=t;case 9:case"end":return n.stop()}}),n,this)})))}},{key:"getItem",value:function(e,t){return o(this,void 0,void 0,regeneratorRuntime.mark((function n(){var r=this;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",new Promise((function(n,i){r._isElectron()?r.electronStorage.get(r.prefix+e,(function(i,o){n(i?a.Helper.nonNull(r._cache[r.prefix+e],t):s.JsonHelper.deepEqual(o,{})?t:o)})):NativeStorage.getItem(r.prefix+e,(function(e){return n(a.Helper.nonNull(e,t))}),(function(i){n(a.Helper.nonNull(r._cache[r.prefix+e],t))}))})));case 1:case"end":return n.stop()}}),n)})))}},{key:"keys",value:function(){return o(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,n=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=[],!this.persistent){e.next=13;break}if(!this._isElectron()){e.next=8;break}return e.next=5,new Promise((function(e,t){return n.electronStorage.keys((function(n,r){n?t(n):e(r)}))}));case 5:t=e.sent,e.next=11;break;case 8:return e.next=10,new Promise((function(e,t){return NativeStorage.keys(e,t)}));case 10:t=e.sent;case 11:e.next=14;break;case 13:t=Object.keys(this._cache);case 14:return e.abrupt("return",t.filter((function(e){return e.startsWith(n.prefix)})));case 15:case"end":return e.stop()}}),e,this)})))}},{key:"remove",value:function(e){return o(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(delete this._cache[this.prefix+e],!this._isElectron()){t.next=5;break}return t.abrupt("return",new Promise((function(t,r){return n.electronStorage.remove(n.prefix+e,(function(e){e?r(e):t()}))})));case 5:return t.abrupt("return",new Promise((function(t,r){return NativeStorage.remove(n.prefix+e,t,r)})));case 6:case"end":return t.stop()}}),t,this)})))}},{key:"clear",value:function(){return o(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,n=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.keys();case 2:return t=e.sent,e.next=5,a.Helper.asyncForEach(t,(function(e){return o(n,void 0,void 0,regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.remove(e);case 2:case"end":return t.stop()}}),t,this)})))}),!0);case 5:case"end":return e.stop()}}),e,this)})))}},{key:"makePersistent",value:function(){return o(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.persistent){e.next=4;break}return this.persistent=!0,e.next=4,a.Helper.asyncForEach(Object.keys(this._cache),(function(e){return o(t,void 0,void 0,regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.setItem(e,this._cache[e]);case 2:case"end":return t.stop()}}),t,this)})))}),!0);case 4:case"end":return e.stop()}}),e,this)})))}},{key:"makeUnpersistent",value:function(){return o(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,n,r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.persistent){e.next=10;break}return e.next=3,this.keys();case 3:return t=e.sent,n={},e.next=7,a.Helper.asyncForEach(t,(function(e){return o(r,void 0,void 0,regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getItem(e);case 2:n[e]=t.sent;case 3:case"end":return t.stop()}}),t,this)})))}));case 7:this.clear(),this.persistent=!1,this._cache=n;case 10:case"end":return e.stop()}}),e,this)})))}}],(n=null)&&i(t.prototype,n),u&&i(t,u),e}();t.NativeStoragePromise=u,u._cache={},u.prefix="",u.persistent=!0,u.electronStorage=null},97961:function(e,t,n){"use strict";function r(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{translations:{},fallbackLanguage:"en",markUntranslatedTranslations:!0,markTranslations:!1,logMissingTranslations:!0};r(this,e),this._translations={},this.addDynamicTranslations(e._translations),this.addDynamicTranslations(n.translations),this._fallbackLanguage=n.fallbackLanguage,this._markUntranslatedTranslations=n.markUntranslatedTranslations,this._markTranslations=n.markTranslations,!0===n.logMissingTranslations?this._logMissingTranslationsFunction=function(e,n){n===t._fallbackLanguage?console.error("missing base translation for key "+e):console.warn("missing translation for language "+n+" and key "+e)}:"function"==typeof n.logMissingTranslations?this._logMissingTranslationsFunction=n.logMissingTranslations:this._logMissingTranslationsFunction=null,this._translationCallbacks=new Map,this._lastTranslationCallbackId=0}var t,n,a;return t=e,a=[{key:"translate",value:function(t,n,r){var i=e.getInstance();return i?i.translate(t,n,r):""}},{key:"addDynamicTranslations",value:function(t){var n=e.getInstance();if(n)return n.addDynamicTranslations(t);Object.keys(t).forEach((function(n){o.Helper.isNull(e._translations[n])&&(e._translations[n]={}),Object.assign(e._translations[n],t[n])}))}},{key:"init",value:function(t){e.instance=new e(t)}},{key:"getInstance",value:function(){return e.instance}},{key:"_isValid",value:function(e){return"string"==typeof e}},{key:"_format",value:function(e,t){return e.replace(/{(\d+)}/g,(function(e,n){return void 0!==t[n]?t[n]:e}))}}],(n=[{key:"translate",value:function(t,n,r){if(o.Helper.isNull(t))return"";r=o.Helper.nonNull(r,n,this._fallbackLanguage);var i=null;return t=t.toLowerCase(),o.Helper.isNotNull(this._translations[r])&&o.Helper.isNotNull(this._translations[r][t])&&(i=this._translations[r][t]),e._isValid(i)||(null!==this._logMissingTranslationsFunction&&this._logMissingTranslationsFunction(t,r),this._translations[this._fallbackLanguage]&&(i=this._translations[this._fallbackLanguage][t]),e._isValid(i)||(null!==this._logMissingTranslationsFunction&&this._logMissingTranslationsFunction(t,r),i=t),this._markUntranslatedTranslations&&(i=">>"+i+"<<")),this._markTranslations&&(i="$"+i+"$"),void 0!==n&&(i=e._format(i,n)),i}},{key:"addDynamicTranslations",value:function(e){for(var t in e)for(var n in this._translations[t]||(this._translations[t]={}),e[t])this._translations[t][n.toLowerCase()]=e[t][n]}},{key:"getLanguages",value:function(){return Object.keys(this._translations)}},{key:"getFallbackLanguage",value:function(){return this._fallbackLanguage}}])&&i(t.prototype,n),a&&i(t,a),e}();t.Translator=a,a._translations={},a.instance=null},79742:function(e,t){"use strict";t.byteLength=function(e){var t=u(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,o=u(e),a=o[0],s=o[1],c=new i(function(e,t,n){return 3*(t+n)/4-n}(0,a,s)),l=0,f=s>0?a-4:a;for(n=0;n>16&255,c[l++]=t>>8&255,c[l++]=255&t;2===s&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,c[l++]=255&t);1===s&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t);return c},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,o=[],a=16383,s=0,u=r-i;su?u:s+a));1===i?(t=e[r-1],o.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],o.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return o.join("")};for(var n=[],r=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,s=o.length;a0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function c(e,t,r){for(var i,o,a=[],s=t;s>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return a.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},48764:function(e,t,n){"use strict";var r=n(79742),i=n(80645),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=u,t.SlowBuffer=function(e){+e!=e&&(e=0);return u.alloc(+e)},t.INSPECT_MAX_BYTES=50;var a=2147483647;function s(e){if(e>a)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return f(e)}return c(e,t,n)}function c(e,t,n){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var n=0|y(e,t),r=s(n),i=r.write(e,t);i!==n&&(r=r.slice(0,i));return r}(e,t);if(ArrayBuffer.isView(e))return p(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(J(e,ArrayBuffer)||e&&J(e.buffer,ArrayBuffer))return h(e,t,n);if("undefined"!=typeof SharedArrayBuffer&&(J(e,SharedArrayBuffer)||e&&J(e.buffer,SharedArrayBuffer)))return h(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return u.from(r,t,n);var i=function(e){if(u.isBuffer(e)){var t=0|d(e.length),n=s(t);return 0===n.length||e.copy(n,0,0,t),n}if(void 0!==e.length)return"number"!=typeof e.length||H(e.length)?s(0):p(e);if("Buffer"===e.type&&Array.isArray(e.data))return p(e.data)}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function f(e){return l(e),s(e<0?0:0|d(e))}function p(e){for(var t=e.length<0?0:0|d(e.length),n=s(t),r=0;r=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|e}function y(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||J(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return B(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return F(e).length;default:if(i)return r?-1:B(e).length;t=(""+t).toLowerCase(),i=!0}}function m(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return M(this,t,n);case"utf8":case"utf-8":return x(this,t,n);case"ascii":return P(this,t,n);case"latin1":case"binary":return N(this,t,n);case"base64":return O(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function v(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function g(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),H(n=+n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:b(e,t,n,r,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):b(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function b(e,t,n,r,i){var o,a=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,n/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var l=-1;for(o=n;os&&(n=s-u),o=n;o>=0;o--){for(var f=!0,p=0;pi&&(r=i):r=i;var o=t.length;r>o/2&&(r=o/2);for(var a=0;a>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function O(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function x(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i239?4:c>223?3:c>191?2:1;if(i+f<=n)switch(f){case 1:c<128&&(l=c);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&c)<<6|63&o)>127&&(l=u);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(u=(15&c)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(u=(15&c)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,f=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),i+=f}return function(e){var t=e.length;if(t<=C)return String.fromCharCode.apply(String,e);var n="",r=0;for(;rn&&(e+=" ... "),""},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(e,t,n,r,i){if(J(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),s=Math.min(o,a),c=this.slice(r,i),l=e.slice(t,n),f=0;f>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return w(this,e,t,n);case"utf8":case"utf-8":return E(this,e,t,n);case"ascii":return _(this,e,t,n);case"latin1":case"binary":return S(this,e,t,n);case"base64":return R(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var C=4096;function P(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;ir)&&(n=r);for(var i="",o=t;on)throw new RangeError("Trying to access beyond buffer length")}function j(e,t,n,r,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function D(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function I(e,t,n,r,o){return t=+t,n>>>=0,o||D(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function L(e,t,n,r,o){return t=+t,n>>>=0,o||D(e,0,n,8),i.write(e,t,n,r,52,8),n+8}u.prototype.slice=function(e,t){var n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t>>=0,t>>>=0,n||k(e,t,this.length);for(var r=this[e],i=1,o=0;++o>>=0,t>>>=0,n||k(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},u.prototype.readUInt8=function(e,t){return e>>>=0,t||k(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||k(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||k(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||k(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||k(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||k(e,t,this.length);for(var r=this[e],i=1,o=0;++o=(i*=128)&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||k(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return e>>>=0,t||k(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||k(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){e>>>=0,t||k(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||k(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||k(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return e>>>=0,t||k(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||k(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||k(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||k(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t>>>=0,n>>>=0,r)||j(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o>>=0,n>>>=0,r)||j(this,e,t,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},u.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);j(this,e,t,n,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);j(this,e,t,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeFloatLE=function(e,t,n){return I(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return I(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return L(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return L(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--o)e[o+t]=this[o+n];else Uint8Array.prototype.set.call(e,this.subarray(n,r),t);return i},u.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!u.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(1===e.length){var i=e.charCodeAt(0);("utf8"===r&&i<128||"latin1"===r)&&(e=i)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function F(e){return r.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(q,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function U(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function J(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function H(e){return e!=e}var V=function(){for(var e="0123456789abcdef",t=new Array(256),n=0;n<16;++n)for(var r=16*n,i=0;i<16;++i)t[r+i]=e[n]+e[i];return t}()},73754:function(e){"use strict";e.exports=JSON.parse('{"login":"Login","logout":"Logout","email":"E-Mail","password":"Passwort","email or password is wrong":"Die E-Mail oder das Passwort stimmt nicht!","stay logged in":"Angemeldet bleiben","goodbye":"Auf Wiedersehen","welcome back":"Willkommen zurück","registration successful":"Registrierung erfolgreich","registration":"Anmelden","I have read and accepted the terms and conditions.":"Ich habe die AGB gelesen und akzeptiert.","retype password":"Passwort wiederholen","the passwords do not match.":"Die Passwörter stimmen nicht überein.","username":"Username","email is already in use.":"Die E-Mail wird bereits verwendet.","username is already in use.":"Der Username ist bereits vergeben.","wrong email or password":"Falsche E-Mail oder falsches Passwort","wrong rights":"Keine Berechtigung!","passwort vergessen?":"Passwort vergessen?","password forgotten":"Passwort vergessen","request new password":"Neues Passwort setzen","email is not in our database":"Die E-Mail ist nicht registriert!","forgot-password-mail sent":"Es wurde eine E-Mail an die angegebene Adresse gesendet.","password resetted":"Das Passwort wurde erfolgreich zurückgesetzt.","token is not valid":"Der Link ist nicht mehr gültig.","reset password":"Passwort zurücksetzen","repeat password":"Passwort wiederholen","token not valid":"Der Link ist nicht mehr gültig","Not allowed":"Nicht erlaubt","You don\'t have the rights to do this!":"Du hast nicht die Berechtigung, um das zu tun!","If you are not logged in, please log in and try again.":"Wenn du noch nicht eingeloggt bist, logge dich ein und versuche es erneut."}')},10562:function(e){"use strict";e.exports=JSON.parse('{"login":"Login","logout":"Logout","email":"E-Mail","password":"Password","email or password is wrong":"The e-mail or password is incorrect!","stay logged in":"Stay logged in","goodbye":"Goodbye","welcome back":"Welcome back","registration successful":"Registration successful","registration":"Registration","I have read and accepted the terms and conditions.":"I have read and accepted the terms and conditions.","retype password":"Retype Password","the passwords do not match.":"The passwords do not match.","username":"Username","email is already in use.":"This e-mail is already in use.","username is already in use.":"This Username is already taken.","wrong email or password":"Wrong E-Mail or Password!","wrong rights":"Wrong Rights!","passwort vergessen?":"password forgotten?","password forgotten":"Password Forgotten","request new password":"Request New Password","email is not in our database":"The given E-Mailaddress is not registered!","forgot-password-mail sent":"We sent you an E-Mail with instructions","password resetted":"The password was successfully changed.","token is not valid":"The given link is no longer valid.","reset password":"Reset Password","repeat password":"Repeat Password","token not valid":"The link is not valid any more","Not allowed":"Not allowed","You don\'t have the rights to do this!":"You don\'t have the rights to do this!","If you are not logged in, please log in and try again.":"If you are not logged in, please log in and try again."}')},77809:function(e){"use strict";e.exports=JSON.parse('{"Sunday":"Sonntag","Monday":"Montag","Tuesday":"Dienstag","Wednesday":"Mittwoch","Thursday":"Donnerstag","Friday":"Freitag","Saturday":"Samstag","January":"Januar","February":"Februar","March":"März","April":"April","May":"Mai","June":"Juni","July":"Juli","August":"August","September":"September","October":"Oktober","November":"November","December":"Dezember","Sun":"So","Mon":"Mo","Tue":"Di","Wed":"Mi","Thu":"Do","Fri":"Fr","Sat":"Sa","Jan":"Jan","Feb":"Feb","Mar":"Mär","Apr":"Apr","Jun":"Jun","Jul":"Jul","Aug":"Aug","Sep":"Sep","Oct":"Okt","Nov":"Nov","Dec":"Dez"}')},85015:function(e){"use strict";e.exports=JSON.parse('{"Sunday":"Sunday","Monday":"Monday","Tuesday":"Tuesday","Wednesday":"Wednesday","Thursday":"Thursday","Friday":"Friday","Saturday":"Saturday","January":"January","February":"February","March":"March","April":"April","May":"May","June":"June","July":"July","August":"August","September":"September","October":"October","November":"November","December":"December","Sun":"Sun","Mon":"Mon","Tue":"Tue","Wed":"Wed","Thu":"Thu","Fri":"Fri","Sat":"Sat","Jan":"Jan","Feb":"Feb","Mar":"Mar","Apr":"Apr","Jun":"Jun","Jul":"Jul","Aug":"Aug","Sep":"Sep","Oct":"Oct","Nov":"Nov","Dec":"Dec"}')},16266:function(e,t,n){n(95767),n(68132),n(48388),n(37470),n(94882),n(41520),n(27476),n(79622),n(89375),n(43533),n(84672),n(64157),n(35095),n(49892),n(75115),n(99176),n(68838),n(96253),n(39730),n(6059),n(48377),n(71084),n(64299),n(11246),n(30726),n(1901),n(75972),n(53403),n(92516),n(49371),n(86479),n(91736),n(51889),n(65177),n(81246),n(76503),n(66786),n(50932),n(57526),n(21591),n(9073),n(80347),n(30579),n(4669),n(67710),n(45789),n(33514),n(99978),n(58472),n(86946),n(35068),n(413),n(50191),n(98306),n(64564),n(39115),n(29539),n(96620),n(62850),n(10823),n(17732),n(40856),n(80703),n(91539),n(5292),n(45177),n(73694),n(37648),n(27795),n(4531),n(23605),n(6780),n(69937),n(10511),n(81822),n(19977),n(91031),n(46331),n(41560),n(20774),n(30522),n(58295),n(87842),n(50110),n(20075),n(24336),n(19371),n(98837),n(26773),n(15745),n(33057),n(3750),n(23369),n(99564),n(32e3),n(48977),n(52310),n(94899),n(31842),n(56997),n(83946),n(18269),n(66108),n(76774),n(21466),n(59357),n(76142),n(51876),n(40851),n(88416),n(98184),n(30147),n(59192),n(30142),n(1786),n(75368),n(46964),n(62152),n(74821),n(79103),n(81303),n(83318),n(70162),n(33834),n(21572),n(82139),n(10685),n(85535),n(17347),n(83049),n(96633),n(68989),n(78270),n(64510),n(73984),n(75769),n(50055),n(96014),e.exports=n(25645)},70911:function(e,t,n){n(1268),e.exports=n(25645).Array.flatMap},10990:function(e,t,n){n(62773),e.exports=n(25645).Array.includes},15434:function(e,t,n){n(83276),e.exports=n(25645).Object.entries},78051:function(e,t,n){n(98351),e.exports=n(25645).Object.getOwnPropertyDescriptors},38250:function(e,t,n){n(96409),e.exports=n(25645).Object.values},54952:function(e,t,n){"use strict";n(40851),n(9865),e.exports=n(25645).Promise.finally},6197:function(e,t,n){n(92770),e.exports=n(25645).String.padEnd},14160:function(e,t,n){n(41784),e.exports=n(25645).String.padStart},54039:function(e,t,n){n(94325),e.exports=n(25645).String.trimRight},96728:function(e,t,n){n(65869),e.exports=n(25645).String.trimLeft},93568:function(e,t,n){n(79665),e.exports=n(28787).f("asyncIterator")},40115:function(e,t,n){n(34579),e.exports=n(11327).global},85663:function(e){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},12159:function(e,t,n){var r=n(36727);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},11327:function(e){var t=e.exports={version:"2.6.11"};"number"==typeof __e&&(__e=t)},19216:function(e,t,n){var r=n(85663);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}},89666:function(e,t,n){e.exports=!n(7929)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},97467:function(e,t,n){var r=n(36727),i=n(33938).document,o=r(i)&&r(i.createElement);e.exports=function(e){return o?i.createElement(e):{}}},83856:function(e,t,n){var r=n(33938),i=n(11327),o=n(19216),a=n(41818),s=n(27069),u=function(e,t,n){var c,l,f,p=e&u.F,h=e&u.G,d=e&u.S,y=e&u.P,m=e&u.B,v=e&u.W,g=h?i:i[t]||(i[t]={}),b=g.prototype,w=h?r:d?r[t]:(r[t]||{}).prototype;for(c in h&&(n=t),n)(l=!p&&w&&void 0!==w[c])&&s(g,c)||(f=l?w[c]:n[c],g[c]=h&&"function"!=typeof w[c]?n[c]:m&&l?o(f,r):v&&w[c]==f?function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};return t.prototype=e.prototype,t}(f):y&&"function"==typeof f?o(Function.call,f):f,y&&((g.virtual||(g.virtual={}))[c]=f,e&u.R&&b&&!b[c]&&a(b,c,f)))};u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,e.exports=u},7929:function(e){e.exports=function(e){try{return!!e()}catch(e){return!0}}},33938:function(e){var t=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=t)},27069:function(e){var t={}.hasOwnProperty;e.exports=function(e,n){return t.call(e,n)}},41818:function(e,t,n){var r=n(4743),i=n(83101);e.exports=n(89666)?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},33758:function(e,t,n){e.exports=!n(89666)&&!n(7929)((function(){return 7!=Object.defineProperty(n(97467)("div"),"a",{get:function(){return 7}}).a}))},36727:function(e){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},4743:function(e,t,n){var r=n(12159),i=n(33758),o=n(33206),a=Object.defineProperty;t.f=n(89666)?Object.defineProperty:function(e,t,n){if(r(e),t=o(t,!0),r(n),i)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},83101:function(e){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},33206:function(e,t,n){var r=n(36727);e.exports=function(e,t){if(!r(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!r(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},34579:function(e,t,n){var r=n(83856);r(r.G,{global:n(33938)})},24963:function(e){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},83365:function(e,t,n){var r=n(92032);e.exports=function(e,t){if("number"!=typeof e&&"Number"!=r(e))throw TypeError(t);return+e}},17722:function(e,t,n){var r=n(86314)("unscopables"),i=Array.prototype;null==i[r]&&n(87728)(i,r,{}),e.exports=function(e){i[r][e]=!0}},76793:function(e,t,n){"use strict";var r=n(24496)(!0);e.exports=function(e,t,n){return t+(n?r(e,t).length:1)}},83328:function(e){e.exports=function(e,t,n,r){if(!(e instanceof t)||void 0!==r&&r in e)throw TypeError(n+": incorrect invocation!");return e}},27007:function(e,t,n){var r=n(55286);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},5216:function(e,t,n){"use strict";var r=n(20508),i=n(92337),o=n(10875);e.exports=[].copyWithin||function(e,t){var n=r(this),a=o(n.length),s=i(e,a),u=i(t,a),c=arguments.length>2?arguments[2]:void 0,l=Math.min((void 0===c?a:i(c,a))-u,a-s),f=1;for(u0;)u in n?n[s]=n[u]:delete n[s],s+=f,u+=f;return n}},46852:function(e,t,n){"use strict";var r=n(20508),i=n(92337),o=n(10875);e.exports=function(e){for(var t=r(this),n=o(t.length),a=arguments.length,s=i(a>1?arguments[1]:void 0,n),u=a>2?arguments[2]:void 0,c=void 0===u?n:i(u,n);c>s;)t[s++]=e;return t}},79315:function(e,t,n){var r=n(22110),i=n(10875),o=n(92337);e.exports=function(e){return function(t,n,a){var s,u=r(t),c=i(u.length),l=o(a,c);if(e&&n!=n){for(;c>l;)if((s=u[l++])!=s)return!0}else for(;c>l;l++)if((e||l in u)&&u[l]===n)return e||l||0;return!e&&-1}}},10050:function(e,t,n){var r=n(741),i=n(49797),o=n(20508),a=n(10875),s=n(16886);e.exports=function(e,t){var n=1==e,u=2==e,c=3==e,l=4==e,f=6==e,p=5==e||f,h=t||s;return function(t,s,d){for(var y,m,v=o(t),g=i(v),b=r(s,d,3),w=a(g.length),E=0,_=n?h(t,w):u?h(t,0):void 0;w>E;E++)if((p||E in g)&&(m=b(y=g[E],E,v),e))if(n)_[E]=m;else if(m)switch(e){case 3:return!0;case 5:return y;case 6:return E;case 2:_.push(y)}else if(l)return!1;return f?-1:c||l?l:_}}},37628:function(e,t,n){var r=n(24963),i=n(20508),o=n(49797),a=n(10875);e.exports=function(e,t,n,s,u){r(t);var c=i(e),l=o(c),f=a(c.length),p=u?f-1:0,h=u?-1:1;if(n<2)for(;;){if(p in l){s=l[p],p+=h;break}if(p+=h,u?p<0:f<=p)throw TypeError("Reduce of empty array with no initial value")}for(;u?p>=0:f>p;p+=h)p in l&&(s=t(s,l[p],p,c));return s}},42736:function(e,t,n){var r=n(55286),i=n(4302),o=n(86314)("species");e.exports=function(e){var t;return i(e)&&("function"!=typeof(t=e.constructor)||t!==Array&&!i(t.prototype)||(t=void 0),r(t)&&null===(t=t[o])&&(t=void 0)),void 0===t?Array:t}},16886:function(e,t,n){var r=n(42736);e.exports=function(e,t){return new(r(e))(t)}},34398:function(e,t,n){"use strict";var r=n(24963),i=n(55286),o=n(97242),a=[].slice,s={},u=function(e,t,n){if(!(t in s)){for(var r=[],i=0;i1?arguments[1]:void 0,3);n=n?n.n:this._f;)for(r(n.v,n.k,this);n&&n.r;)n=n.p},has:function(e){return!!m(d(this,t),e)}}),p&&r(l.prototype,"size",{get:function(){return d(this,t)[y]}}),l},def:function(e,t,n){var r,i,o=m(e,t);return o?o.v=n:(e._l=o={i:i=h(t,!0),k:t,v:n,p:r=e._l,n:void 0,r:!1},e._f||(e._f=o),r&&(r.n=o),e[y]++,"F"!==i&&(e._i[i]=o)),e},getEntry:m,setStrong:function(e,t,n){c(e,t,(function(e,n){this._t=d(e,t),this._k=n,this._l=void 0}),(function(){for(var e=this,t=e._k,n=e._l;n&&n.r;)n=n.p;return e._t&&(e._l=n=n?n.n:e._t._f)?l(0,"keys"==t?n.k:"values"==t?n.v:[n.k,n.v]):(e._t=void 0,l(1))}),n?"entries":"values",!n,!0),f(t)}}},23657:function(e,t,n){"use strict";var r=n(24408),i=n(84728).getWeak,o=n(27007),a=n(55286),s=n(83328),u=n(3531),c=n(10050),l=n(79181),f=n(1616),p=c(5),h=c(6),d=0,y=function(e){return e._l||(e._l=new m)},m=function(){this.a=[]},v=function(e,t){return p(e.a,(function(e){return e[0]===t}))};m.prototype={get:function(e){var t=v(this,e);if(t)return t[1]},has:function(e){return!!v(this,e)},set:function(e,t){var n=v(this,e);n?n[1]=t:this.a.push([e,t])},delete:function(e){var t=h(this.a,(function(t){return t[0]===e}));return~t&&this.a.splice(t,1),!!~t}},e.exports={getConstructor:function(e,t,n,o){var c=e((function(e,r){s(e,c,t,"_i"),e._t=t,e._i=d++,e._l=void 0,null!=r&&u(r,n,e[o],e)}));return r(c.prototype,{delete:function(e){if(!a(e))return!1;var n=i(e);return!0===n?y(f(this,t)).delete(e):n&&l(n,this._i)&&delete n[this._i]},has:function(e){if(!a(e))return!1;var n=i(e);return!0===n?y(f(this,t)).has(e):n&&l(n,this._i)}}),c},def:function(e,t,n){var r=i(o(t),!0);return!0===r?y(e).set(t,n):r[e._i]=n,e},ufstore:y}},45795:function(e,t,n){"use strict";var r=n(3816),i=n(42985),o=n(77234),a=n(24408),s=n(84728),u=n(3531),c=n(83328),l=n(55286),f=n(74253),p=n(7462),h=n(22943),d=n(40266);e.exports=function(e,t,n,y,m,v){var g=r[e],b=g,w=m?"set":"add",E=b&&b.prototype,_={},S=function(e){var t=E[e];o(E,e,"delete"==e||"has"==e?function(e){return!(v&&!l(e))&&t.call(this,0===e?0:e)}:"get"==e?function(e){return v&&!l(e)?void 0:t.call(this,0===e?0:e)}:"add"==e?function(e){return t.call(this,0===e?0:e),this}:function(e,n){return t.call(this,0===e?0:e,n),this})};if("function"==typeof b&&(v||E.forEach&&!f((function(){(new b).entries().next()})))){var R=new b,T=R[w](v?{}:-0,1)!=R,O=f((function(){R.has(1)})),x=p((function(e){new b(e)})),C=!v&&f((function(){for(var e=new b,t=5;t--;)e[w](t,t);return!e.has(-0)}));x||((b=t((function(t,n){c(t,b,e);var r=d(new g,t,b);return null!=n&&u(n,m,r[w],r),r}))).prototype=E,E.constructor=b),(O||C)&&(S("delete"),S("has"),m&&S("get")),(C||T)&&S(w),v&&E.clear&&delete E.clear}else b=y.getConstructor(t,e,m,w),a(b.prototype,n),s.NEED=!0;return h(b,e),_[e]=b,i(i.G+i.W+i.F*(b!=g),_),v||y.setStrong(b,e,m),b}},25645:function(e){var t=e.exports={version:"2.6.11"};"number"==typeof __e&&(__e=t)},92811:function(e,t,n){"use strict";var r=n(99275),i=n(90681);e.exports=function(e,t,n){t in e?r.f(e,t,i(0,n)):e[t]=n}},741:function(e,t,n){var r=n(24963);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}},53537:function(e,t,n){"use strict";var r=n(74253),i=Date.prototype.getTime,o=Date.prototype.toISOString,a=function(e){return e>9?e:"0"+e};e.exports=r((function(){return"0385-07-25T07:06:39.999Z"!=o.call(new Date(-50000000000001))}))||!r((function(){o.call(new Date(NaN))}))?function(){if(!isFinite(i.call(this)))throw RangeError("Invalid time value");var e=this,t=e.getUTCFullYear(),n=e.getUTCMilliseconds(),r=t<0?"-":t>9999?"+":"";return r+("00000"+Math.abs(t)).slice(r?-6:-4)+"-"+a(e.getUTCMonth()+1)+"-"+a(e.getUTCDate())+"T"+a(e.getUTCHours())+":"+a(e.getUTCMinutes())+":"+a(e.getUTCSeconds())+"."+(n>99?n:"0"+a(n))+"Z"}:o},870:function(e,t,n){"use strict";var r=n(27007),i=n(21689),o="number";e.exports=function(e){if("string"!==e&&e!==o&&"default"!==e)throw TypeError("Incorrect hint");return i(r(this),e!=o)}},91355:function(e){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},67057:function(e,t,n){e.exports=!n(74253)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},62457:function(e,t,n){var r=n(55286),i=n(3816).document,o=r(i)&&r(i.createElement);e.exports=function(e){return o?i.createElement(e):{}}},74430:function(e){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},5541:function(e,t,n){var r=n(47184),i=n(64548),o=n(14682);e.exports=function(e){var t=r(e),n=i.f;if(n)for(var a,s=n(e),u=o.f,c=0;s.length>c;)u.call(e,a=s[c++])&&t.push(a);return t}},42985:function(e,t,n){var r=n(3816),i=n(25645),o=n(87728),a=n(77234),s=n(741),u=function(e,t,n){var c,l,f,p,h=e&u.F,d=e&u.G,y=e&u.S,m=e&u.P,v=e&u.B,g=d?r:y?r[t]||(r[t]={}):(r[t]||{}).prototype,b=d?i:i[t]||(i[t]={}),w=b.prototype||(b.prototype={});for(c in d&&(n=t),n)f=((l=!h&&g&&void 0!==g[c])?g:n)[c],p=v&&l?s(f,r):m&&"function"==typeof f?s(Function.call,f):f,g&&a(g,c,f,e&u.U),b[c]!=f&&o(b,c,p),m&&w[c]!=f&&(w[c]=f)};r.core=i,u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,e.exports=u},8852:function(e,t,n){var r=n(86314)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[r]=!1,!"/./"[e](t)}catch(e){}}return!0}},74253:function(e){e.exports=function(e){try{return!!e()}catch(e){return!0}}},28082:function(e,t,n){"use strict";n(18269);var r=n(77234),i=n(87728),o=n(74253),a=n(91355),s=n(86314),u=n(21165),c=s("species"),l=!o((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$")})),f=function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2===n.length&&"a"===n[0]&&"b"===n[1]}();e.exports=function(e,t,n){var p=s(e),h=!o((function(){var t={};return t[p]=function(){return 7},7!=""[e](t)})),d=h?!o((function(){var t=!1,n=/a/;return n.exec=function(){return t=!0,null},"split"===e&&(n.constructor={},n.constructor[c]=function(){return n}),n[p](""),!t})):void 0;if(!h||!d||"replace"===e&&!l||"split"===e&&!f){var y=/./[p],m=n(a,p,""[e],(function(e,t,n,r,i){return t.exec===u?h&&!i?{done:!0,value:y.call(t,n,r)}:{done:!0,value:e.call(n,t,r)}:{done:!1}})),v=m[0],g=m[1];r(String.prototype,e,v),i(RegExp.prototype,p,2==t?function(e,t){return g.call(e,this,t)}:function(e){return g.call(e,this)})}}},53218:function(e,t,n){"use strict";var r=n(27007);e.exports=function(){var e=r(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},13325:function(e,t,n){"use strict";var r=n(4302),i=n(55286),o=n(10875),a=n(741),s=n(86314)("isConcatSpreadable");e.exports=function e(t,n,u,c,l,f,p,h){for(var d,y,m=l,v=0,g=!!p&&a(p,h,3);v0)m=e(t,n,d,o(d.length),m,f-1)-1;else{if(m>=9007199254740991)throw TypeError();t[m]=d}m++}v++}return m}},3531:function(e,t,n){var r=n(741),i=n(28851),o=n(86555),a=n(27007),s=n(10875),u=n(69002),c={},l={},f=e.exports=function(e,t,n,f,p){var h,d,y,m,v=p?function(){return e}:u(e),g=r(n,f,t?2:1),b=0;if("function"!=typeof v)throw TypeError(e+" is not iterable!");if(o(v)){for(h=s(e.length);h>b;b++)if((m=t?g(a(d=e[b])[0],d[1]):g(e[b]))===c||m===l)return m}else for(y=v.call(e);!(d=y.next()).done;)if((m=i(y,g,d.value,t))===c||m===l)return m};f.BREAK=c,f.RETURN=l},40018:function(e,t,n){e.exports=n(3825)("native-function-to-string",Function.toString)},3816:function(e){var t=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=t)},79181:function(e){var t={}.hasOwnProperty;e.exports=function(e,n){return t.call(e,n)}},87728:function(e,t,n){var r=n(99275),i=n(90681);e.exports=n(67057)?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},40639:function(e,t,n){var r=n(3816).document;e.exports=r&&r.documentElement},1734:function(e,t,n){e.exports=!n(67057)&&!n(74253)((function(){return 7!=Object.defineProperty(n(62457)("div"),"a",{get:function(){return 7}}).a}))},40266:function(e,t,n){var r=n(55286),i=n(27375).set;e.exports=function(e,t,n){var o,a=t.constructor;return a!==n&&"function"==typeof a&&(o=a.prototype)!==n.prototype&&r(o)&&i&&i(e,o),e}},97242:function(e){e.exports=function(e,t,n){var r=void 0===n;switch(t.length){case 0:return r?e():e.call(n);case 1:return r?e(t[0]):e.call(n,t[0]);case 2:return r?e(t[0],t[1]):e.call(n,t[0],t[1]);case 3:return r?e(t[0],t[1],t[2]):e.call(n,t[0],t[1],t[2]);case 4:return r?e(t[0],t[1],t[2],t[3]):e.call(n,t[0],t[1],t[2],t[3])}return e.apply(n,t)}},49797:function(e,t,n){var r=n(92032);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},86555:function(e,t,n){var r=n(87234),i=n(86314)("iterator"),o=Array.prototype;e.exports=function(e){return void 0!==e&&(r.Array===e||o[i]===e)}},4302:function(e,t,n){var r=n(92032);e.exports=Array.isArray||function(e){return"Array"==r(e)}},18367:function(e,t,n){var r=n(55286),i=Math.floor;e.exports=function(e){return!r(e)&&isFinite(e)&&i(e)===e}},55286:function(e){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},55364:function(e,t,n){var r=n(55286),i=n(92032),o=n(86314)("match");e.exports=function(e){var t;return r(e)&&(void 0!==(t=e[o])?!!t:"RegExp"==i(e))}},28851:function(e,t,n){var r=n(27007);e.exports=function(e,t,n,i){try{return i?t(r(n)[0],n[1]):t(n)}catch(t){var o=e.return;throw void 0!==o&&r(o.call(e)),t}}},49988:function(e,t,n){"use strict";var r=n(42503),i=n(90681),o=n(22943),a={};n(87728)(a,n(86314)("iterator"),(function(){return this})),e.exports=function(e,t,n){e.prototype=r(a,{next:i(1,n)}),o(e,t+" Iterator")}},42923:function(e,t,n){"use strict";var r=n(4461),i=n(42985),o=n(77234),a=n(87728),s=n(87234),u=n(49988),c=n(22943),l=n(468),f=n(86314)("iterator"),p=!([].keys&&"next"in[].keys()),h="keys",d="values",y=function(){return this};e.exports=function(e,t,n,m,v,g,b){u(n,t,m);var w,E,_,S=function(e){if(!p&&e in x)return x[e];switch(e){case h:case d:return function(){return new n(this,e)}}return function(){return new n(this,e)}},R=t+" Iterator",T=v==d,O=!1,x=e.prototype,C=x[f]||x["@@iterator"]||v&&x[v],P=C||S(v),N=v?T?S("entries"):P:void 0,M="Array"==t&&x.entries||C;if(M&&(_=l(M.call(new e)))!==Object.prototype&&_.next&&(c(_,R,!0),r||"function"==typeof _[f]||a(_,f,y)),T&&C&&C.name!==d&&(O=!0,P=function(){return C.call(this)}),r&&!b||!p&&!O&&x[f]||a(x,f,P),s[t]=P,s[R]=y,v)if(w={values:T?P:S(d),keys:g?P:S(h),entries:N},b)for(E in w)E in x||o(x,E,w[E]);else i(i.P+i.F*(p||O),t,w);return w}},7462:function(e,t,n){var r=n(86314)("iterator"),i=!1;try{var o=[7][r]();o.return=function(){i=!0},Array.from(o,(function(){throw 2}))}catch(e){}e.exports=function(e,t){if(!t&&!i)return!1;var n=!1;try{var o=[7],a=o[r]();a.next=function(){return{done:n=!0}},o[r]=function(){return a},e(o)}catch(e){}return n}},15436:function(e){e.exports=function(e,t){return{value:t,done:!!e}}},87234:function(e){e.exports={}},4461:function(e){e.exports=!1},13086:function(e){var t=Math.expm1;e.exports=!t||t(10)>22025.465794806718||t(10)<22025.465794806718||-2e-17!=t(-2e-17)?function(e){return 0==(e=+e)?e:e>-1e-6&&e<1e-6?e+e*e/2:Math.exp(e)-1}:t},34934:function(e,t,n){var r=n(61801),i=Math.pow,o=i(2,-52),a=i(2,-23),s=i(2,127)*(2-a),u=i(2,-126);e.exports=Math.fround||function(e){var t,n,i=Math.abs(e),c=r(e);return is||n!=n?c*(1/0):c*n}},46206:function(e){e.exports=Math.log1p||function(e){return(e=+e)>-1e-8&&e<1e-8?e-e*e/2:Math.log(1+e)}},61801:function(e){e.exports=Math.sign||function(e){return 0==(e=+e)||e!=e?e:e<0?-1:1}},84728:function(e,t,n){var r=n(93953)("meta"),i=n(55286),o=n(79181),a=n(99275).f,s=0,u=Object.isExtensible||function(){return!0},c=!n(74253)((function(){return u(Object.preventExtensions({}))})),l=function(e){a(e,r,{value:{i:"O"+ ++s,w:{}}})},f=e.exports={KEY:r,NEED:!1,fastKey:function(e,t){if(!i(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!o(e,r)){if(!u(e))return"F";if(!t)return"E";l(e)}return e[r].i},getWeak:function(e,t){if(!o(e,r)){if(!u(e))return!0;if(!t)return!1;l(e)}return e[r].w},onFreeze:function(e){return c&&f.NEED&&u(e)&&!o(e,r)&&l(e),e}}},14351:function(e,t,n){var r=n(3816),i=n(74193).set,o=r.MutationObserver||r.WebKitMutationObserver,a=r.process,s=r.Promise,u="process"==n(92032)(a);e.exports=function(){var e,t,n,c=function(){var r,i;for(u&&(r=a.domain)&&r.exit();e;){i=e.fn,e=e.next;try{i()}catch(r){throw e?n():t=void 0,r}}t=void 0,r&&r.enter()};if(u)n=function(){a.nextTick(c)};else if(!o||r.navigator&&r.navigator.standalone)if(s&&s.resolve){var l=s.resolve(void 0);n=function(){l.then(c)}}else n=function(){i.call(r,c)};else{var f=!0,p=document.createTextNode("");new o(c).observe(p,{characterData:!0}),n=function(){p.data=f=!f}}return function(r){var i={fn:r,next:void 0};t&&(t.next=i),e||(e=i,n()),t=i}}},43499:function(e,t,n){"use strict";var r=n(24963);function i(e){var t,n;this.promise=new e((function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r})),this.resolve=r(t),this.reject=r(n)}e.exports.f=function(e){return new i(e)}},35345:function(e,t,n){"use strict";var r=n(67057),i=n(47184),o=n(64548),a=n(14682),s=n(20508),u=n(49797),c=Object.assign;e.exports=!c||n(74253)((function(){var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach((function(e){t[e]=e})),7!=c({},e)[n]||Object.keys(c({},t)).join("")!=r}))?function(e,t){for(var n=s(e),c=arguments.length,l=1,f=o.f,p=a.f;c>l;)for(var h,d=u(arguments[l++]),y=f?i(d).concat(f(d)):i(d),m=y.length,v=0;m>v;)h=y[v++],r&&!p.call(d,h)||(n[h]=d[h]);return n}:c},42503:function(e,t,n){var r=n(27007),i=n(35588),o=n(74430),a=n(69335)("IE_PROTO"),s=function(){},u=function(){var e,t=n(62457)("iframe"),r=o.length;for(t.style.display="none",n(40639).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("
\ No newline at end of file + + + + + + + + + + + + + + + + WordRotator + + + + +
+
+ +
+
+
+
+ + + +
+
+ + + + + diff --git a/src/server/public/plugins/cordova-plugin-background-fetch/www/BackgroundFetch.js b/src/server/public/plugins/cordova-plugin-background-fetch/www/BackgroundFetch.js new file mode 100644 index 0000000..5332002 --- /dev/null +++ b/src/server/public/plugins/cordova-plugin-background-fetch/www/BackgroundFetch.js @@ -0,0 +1,95 @@ +cordova.define("cordova-plugin-background-fetch.BackgroundFetch", function(require, exports, module) { /*** + * Custom Cordova Background Fetch plugin. + * @author + * iOS native-side is largely based upon http://www.mindsizzlers.com/2011/07/ios-background-location/ + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ +var exec = require("cordova/exec"); + +var EMPTY_FN = function() {} + +var MODULE = "BackgroundFetch"; +module.exports = { + STATUS_RESTRICTED: 0, + STATUS_DENIED: 1, + STATUS_AVAILABLE: 2, + + FETCH_RESULT_NEW_DATA: 0, + FETCH_RESULT_NO_DATA: 1, + FETCH_RESULT_FAILED: 2, + + NETWORK_TYPE_NONE: 0, + NETWORK_TYPE_ANY: 1, + NETWORK_TYPE_UNMETERED: 2, + NETWORK_TYPE_NOT_ROAMING: 3, + NETWORK_TYPE_CELLULAR: 4, + + configure: function(callback, failure, config) { + if (typeof(callback) !== 'function') { + throw "BackgroundFetch configure error: You must provide a callback function as 1st argument"; + } + config = config || {}; + failure = failure || EMPTY_FN; + exec(callback, failure, MODULE, 'configure', [config]); + }, + + finish: function(taskId, success, failure) { + if (typeof(taskId) !== 'string') { + throw "BackgroundGeolocation.finish now requires a String taskId as first argument"; + } + success = success || EMPTY_FN; + failure = failure || EMPTY_FN; + exec(success, failure, MODULE, 'finish',[taskId]); + }, + + start: function(success, failure) { + success = success || EMPTY_FN; + failure = failure || EMPTY_FN; + exec(success, failure, MODULE, 'start',[]); + }, + + stop: function(success, failure) { + success = success || EMPTY_FN; + failure = failure || EMPTY_FN; + exec(success, failure, MODULE, 'stop', []); + }, + + scheduleTask: function(config, success, failure) { + if (typeof(config) !== 'object') throw "[BackgroundFetch stopTask] ERROR: The 1st argument to scheduleTask is a config {}"; + success = success || EMPTY_FN; + failure = failure || EMPTY_FN; + exec(success, failure, MODULE, 'scheduleTask', [config]); + }, + + stopTask: function(taskId, success, failure) { + if (typeof(taskId) !== 'string') throw "[BackgroundFetch stopTask] ERROR: The 1st argument must be a taskId:String"; + success = success || EMPTY_FN; + failure = failure || EMPTY_FN; + exec(success, failure, MODULE, 'stop', [taskId]); + }, + + status: function(success, failure) { + success = success || EMPTY_FN; + failure = failure || EMPTY_FN; + exec(success, failure, MODULE, 'status',[]); + } +}; + +}); diff --git a/src/server/public/plugins/cordova-plugin-badge/src/browser/BadgeProxy.js b/src/server/public/plugins/cordova-plugin-badge/src/browser/BadgeProxy.js new file mode 100644 index 0000000..4446431 --- /dev/null +++ b/src/server/public/plugins/cordova-plugin-badge/src/browser/BadgeProxy.js @@ -0,0 +1,117 @@ +cordova.define("cordova-plugin-badge.Badge.Proxy", function(require, exports, module) { /* + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apache License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://opensource.org/licenses/Apache-2.0/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + */ + +// Instance of the Favico.js libary +exports.favico = new cordova.plugins.notification.badge.Favico({ + animation: 'none' +}); + +// Holds the current badge number +var BADGE_KEY = 'cordova_badge_number'; +// Holds the saved badge config +var CONFIG_KEY = 'APPBadgeConfigKey'; + +/** + * Clears the badge of the app icon. + * + * @param [ Function ] success Success callback + * @param [ Function ] error Error callback + * + * @return [ Void ] + */ +exports.clear = function (success, error) { + exports.set(success, error, [0]); +}; + +/** + * Gets the badge of the app icon. + * + * @param [ Function ] success Success callback + * @param [ Function ] error Error callback + * + * @return [ Void ] + */ +exports.get = function (success, error) { + var badge = localStorage[BADGE_KEY]; + + success(badge || 0); +}; + +/** + * Sets the badge of the app icon. + * + * @param [ Function ] success Success callback + * @param [ Function ] error Error callback + * @param [ Int ] badge The badge number + * + * @return [ Void ] + */ +exports.set = function (success, error, args) { + var badge = args[0]; + + exports.saveBadge(badge); + exports.favico.badge(badge); + + success(badge); +}; + +/** + * Save the badge config. + * + * @param [ Function ] success Success callback + * @param [ Function ] error Error callback + * @param [ Int ] config The config map + * + * @return [ Void ] + */ +exports.save = function (success, error, args) { + var config = args[0] || null, + json = JSON.stringify(config); + + localStorage[CONFIG_KEY] = json; +}; + +/** + * Load the badge config. + * + * @param [ Function ] success Success callback + * @param [ Function ] error Error callback + * + * @return [ Void ] + */ +exports.load = function (success, error) { + var json = localStorage[CONFIG_KEY], + config = JSON.parse(json || null); + + success(config); +}; + +/** + * Persist the badge of the app icon so that `getBadge` is able to return the + * badge number back to the client. + * + * @param [ Int ] badge The badge number + * + * @return [ Void ] + */ +exports.saveBadge = function (badge) { + localStorage[BADGE_KEY] = badge; +}; + +cordova.commandProxy.add('Badge', exports); + +}); diff --git a/src/server/public/plugins/cordova-plugin-badge/src/browser/favico.min.js b/src/server/public/plugins/cordova-plugin-badge/src/browser/favico.min.js new file mode 100644 index 0000000..a5feeeb --- /dev/null +++ b/src/server/public/plugins/cordova-plugin-badge/src/browser/favico.min.js @@ -0,0 +1,8 @@ +cordova.define("cordova-plugin-badge.Badge.Favico", function(require, exports, module) { /** + * @license MIT + * @fileOverview Favico animations + * @author Miroslav Magda, http://blog.ejci.net + * @version 0.3.10 + */ +!function(){var e=function(e){"use strict";function t(e){if(e.paused||e.ended||g)return!1;try{f.clearRect(0,0,s,l),f.drawImage(e,0,0,s,l)}catch(o){}p=setTimeout(function(){t(e)},S.duration),O.setIcon(h)}function o(e){var t=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;e=e.replace(t,function(e,t,o,n){return t+t+o+o+n+n});var o=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return o?{r:parseInt(o[1],16),g:parseInt(o[2],16),b:parseInt(o[3],16)}:!1}function n(e,t){var o,n={};for(o in e)n[o]=e[o];for(o in t)n[o]=t[o];return n}function r(){return b.hidden||b.msHidden||b.webkitHidden||b.mozHidden}e=e?e:{};var i,a,l,s,h,f,c,d,u,y,w,g,x,m,p,b,v={bgColor:"#d00",textColor:"#fff",fontFamily:"sans-serif",fontStyle:"bold",type:"circle",position:"down",animation:"slide",elementId:!1,dataUrl:!1,win:window};x={},x.ff="undefined"!=typeof InstallTrigger,x.chrome=!!window.chrome,x.opera=!!window.opera||navigator.userAgent.indexOf("Opera")>=0,x.ie=/*@cc_on!@*/!1,x.safari=Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor")>0,x.supported=x.chrome||x.ff||x.opera;var C=[];w=function(){},d=g=!1;var E=function(){i=n(v,e),i.bgColor=o(i.bgColor),i.textColor=o(i.textColor),i.position=i.position.toLowerCase(),i.animation=S.types[""+i.animation]?i.animation:v.animation,b=i.win.document;var t=i.position.indexOf("up")>-1,r=i.position.indexOf("left")>-1;if(t||r)for(var d=0;d0?c.height:32,s=c.width>0?c.width:32,h.height=l,h.width=s,f=h.getContext("2d"),M.ready()},c.setAttribute("src",a.getAttribute("href"))):(c.onload=function(){l=32,s=32,c.height=l,c.width=s,h.height=l,h.width=s,f=h.getContext("2d"),M.ready()},c.setAttribute("src",""))},M={};M.ready=function(){d=!0,M.reset(),w()},M.reset=function(){d&&(C=[],u=!1,y=!1,f.clearRect(0,0,s,l),f.drawImage(c,0,0,s,l),O.setIcon(h),window.clearTimeout(m),window.clearTimeout(p))},M.start=function(){if(d&&!y){var e=function(){u=C[0],y=!1,C.length>0&&(C.shift(),M.start())};if(C.length>0){y=!0;var t=function(){["type","animation","bgColor","textColor","fontFamily","fontStyle"].forEach(function(e){e in C[0].options&&(i[e]=C[0].options[e])}),S.run(C[0].options,function(){e()},!1)};u?S.run(u.options,function(){t()},!0):t()}}};var A={},I=function(e){return e.n="number"==typeof e.n?Math.abs(0|e.n):e.n,e.x=s*e.x,e.y=l*e.y,e.w=s*e.w,e.h=l*e.h,e.len=(""+e.n).length,e};A.circle=function(e){e=I(e);var t=!1;2===e.len?(e.x=e.x-.4*e.w,e.w=1.4*e.w,t=!0):e.len>=3&&(e.x=e.x-.65*e.w,e.w=1.65*e.w,t=!0),f.clearRect(0,0,s,l),f.drawImage(c,0,0,s,l),f.beginPath(),f.font=i.fontStyle+" "+Math.floor(e.h*(e.n>99?.85:1))+"px "+i.fontFamily,f.textAlign="center",t?(f.moveTo(e.x+e.w/2,e.y),f.lineTo(e.x+e.w-e.h/2,e.y),f.quadraticCurveTo(e.x+e.w,e.y,e.x+e.w,e.y+e.h/2),f.lineTo(e.x+e.w,e.y+e.h-e.h/2),f.quadraticCurveTo(e.x+e.w,e.y+e.h,e.x+e.w-e.h/2,e.y+e.h),f.lineTo(e.x+e.h/2,e.y+e.h),f.quadraticCurveTo(e.x,e.y+e.h,e.x,e.y+e.h-e.h/2),f.lineTo(e.x,e.y+e.h/2),f.quadraticCurveTo(e.x,e.y,e.x+e.h/2,e.y)):f.arc(e.x+e.w/2,e.y+e.h/2,e.h/2,0,2*Math.PI),f.fillStyle="rgba("+i.bgColor.r+","+i.bgColor.g+","+i.bgColor.b+","+e.o+")",f.fill(),f.closePath(),f.beginPath(),f.stroke(),f.fillStyle="rgba("+i.textColor.r+","+i.textColor.g+","+i.textColor.b+","+e.o+")","number"==typeof e.n&&e.n>999?f.fillText((e.n>9999?9:Math.floor(e.n/1e3))+"k+",Math.floor(e.x+e.w/2),Math.floor(e.y+e.h-.2*e.h)):f.fillText(e.n,Math.floor(e.x+e.w/2),Math.floor(e.y+e.h-.15*e.h)),f.closePath()},A.rectangle=function(e){e=I(e);var t=!1;2===e.len?(e.x=e.x-.4*e.w,e.w=1.4*e.w,t=!0):e.len>=3&&(e.x=e.x-.65*e.w,e.w=1.65*e.w,t=!0),f.clearRect(0,0,s,l),f.drawImage(c,0,0,s,l),f.beginPath(),f.font=i.fontStyle+" "+Math.floor(e.h*(e.n>99?.9:1))+"px "+i.fontFamily,f.textAlign="center",f.fillStyle="rgba("+i.bgColor.r+","+i.bgColor.g+","+i.bgColor.b+","+e.o+")",f.fillRect(e.x,e.y,e.w,e.h),f.fillStyle="rgba("+i.textColor.r+","+i.textColor.g+","+i.textColor.b+","+e.o+")","number"==typeof e.n&&e.n>999?f.fillText((e.n>9999?9:Math.floor(e.n/1e3))+"k+",Math.floor(e.x+e.w/2),Math.floor(e.y+e.h-.2*e.h)):f.fillText(e.n,Math.floor(e.x+e.w/2),Math.floor(e.y+e.h-.15*e.h)),f.closePath()};var T=function(e,t){t=("string"==typeof t?{animation:t}:t)||{},w=function(){try{if("number"==typeof e?e>0:""!==e){var n={type:"badge",options:{n:e}};if("animation"in t&&S.types[""+t.animation]&&(n.options.animation=""+t.animation),"type"in t&&A[""+t.type]&&(n.options.type=""+t.type),["bgColor","textColor"].forEach(function(e){e in t&&(n.options[e]=o(t[e]))}),["fontStyle","fontFamily"].forEach(function(e){e in t&&(n.options[e]=t[e])}),C.push(n),C.length>100)throw new Error("Too many badges requests in queue.");M.start()}else M.reset()}catch(r){throw new Error("Error setting badge. Message: "+r.message)}},d&&w()},U=function(e){w=function(){try{var t=e.width,o=e.height,n=document.createElement("img"),r=o/l>t/s?t/s:o/l;n.setAttribute("crossOrigin","anonymous"),n.onload=function(){f.clearRect(0,0,s,l),f.drawImage(n,0,0,s,l),O.setIcon(h)},n.setAttribute("src",e.getAttribute("src")),n.height=o/r,n.width=t/r}catch(i){throw new Error("Error setting image. Message: "+i.message)}},d&&w()},R=function(e){w=function(){try{if("stop"===e)return g=!0,M.reset(),void(g=!1);e.addEventListener("play",function(){t(this)},!1)}catch(o){throw new Error("Error setting video. Message: "+o.message)}},d&&w()},L=function(e){if(window.URL&&window.URL.createObjectURL||(window.URL=window.URL||{},window.URL.createObjectURL=function(e){return e}),x.supported){var o=!1;navigator.getUserMedia=navigator.getUserMedia||navigator.oGetUserMedia||navigator.msGetUserMedia||navigator.mozGetUserMedia||navigator.webkitGetUserMedia,w=function(){try{if("stop"===e)return g=!0,M.reset(),void(g=!1);o=document.createElement("video"),o.width=s,o.height=l,navigator.getUserMedia({video:!0,audio:!1},function(e){o.src=URL.createObjectURL(e),o.play(),t(o)},function(){})}catch(n){throw new Error("Error setting webcam. Message: "+n.message)}},d&&w()}},O={};O.getIcon=function(){var e=!1,t=function(){for(var e=b.getElementsByTagName("head")[0].getElementsByTagName("link"),t=e.length,o=t-1;o>=0;o--)if(/(^|\s)icon(\s|$)/i.test(e[o].getAttribute("rel")))return e[o];return!1};return i.element?e=i.element:i.elementId?(e=b.getElementById(i.elementId),e.setAttribute("href",e.getAttribute("src"))):(e=t(),e===!1&&(e=b.createElement("link"),e.setAttribute("rel","icon"),b.getElementsByTagName("head")[0].appendChild(e))),e.setAttribute("type","image/png"),e},O.setIcon=function(e){var t=e.toDataURL("image/png");if(i.dataUrl&&i.dataUrl(t),i.element)i.element.setAttribute("href",t),i.element.setAttribute("src",t);else if(i.elementId){var o=b.getElementById(i.elementId);o.setAttribute("href",t),o.setAttribute("src",t)}else if(x.ff||x.opera){var n=a;a=b.createElement("link"),x.opera&&a.setAttribute("rel","icon"),a.setAttribute("rel","icon"),a.setAttribute("type","image/png"),b.getElementsByTagName("head")[0].appendChild(a),a.setAttribute("href",t),n.parentNode&&n.parentNode.removeChild(n)}else a.setAttribute("href",t)};var S={};return S.duration=40,S.types={},S.types.fade=[{x:.4,y:.4,w:.6,h:.6,o:0},{x:.4,y:.4,w:.6,h:.6,o:.1},{x:.4,y:.4,w:.6,h:.6,o:.2},{x:.4,y:.4,w:.6,h:.6,o:.3},{x:.4,y:.4,w:.6,h:.6,o:.4},{x:.4,y:.4,w:.6,h:.6,o:.5},{x:.4,y:.4,w:.6,h:.6,o:.6},{x:.4,y:.4,w:.6,h:.6,o:.7},{x:.4,y:.4,w:.6,h:.6,o:.8},{x:.4,y:.4,w:.6,h:.6,o:.9},{x:.4,y:.4,w:.6,h:.6,o:1}],S.types.none=[{x:.4,y:.4,w:.6,h:.6,o:1}],S.types.pop=[{x:1,y:1,w:0,h:0,o:1},{x:.9,y:.9,w:.1,h:.1,o:1},{x:.8,y:.8,w:.2,h:.2,o:1},{x:.7,y:.7,w:.3,h:.3,o:1},{x:.6,y:.6,w:.4,h:.4,o:1},{x:.5,y:.5,w:.5,h:.5,o:1},{x:.4,y:.4,w:.6,h:.6,o:1}],S.types.popFade=[{x:.75,y:.75,w:0,h:0,o:0},{x:.65,y:.65,w:.1,h:.1,o:.2},{x:.6,y:.6,w:.2,h:.2,o:.4},{x:.55,y:.55,w:.3,h:.3,o:.6},{x:.5,y:.5,w:.4,h:.4,o:.8},{x:.45,y:.45,w:.5,h:.5,o:.9},{x:.4,y:.4,w:.6,h:.6,o:1}],S.types.slide=[{x:.4,y:1,w:.6,h:.6,o:1},{x:.4,y:.9,w:.6,h:.6,o:1},{x:.4,y:.9,w:.6,h:.6,o:1},{x:.4,y:.8,w:.6,h:.6,o:1},{x:.4,y:.7,w:.6,h:.6,o:1},{x:.4,y:.6,w:.6,h:.6,o:1},{x:.4,y:.5,w:.6,h:.6,o:1},{x:.4,y:.4,w:.6,h:.6,o:1}],S.run=function(e,t,o,a){var l=S.types[r()?"none":i.animation];return a=o===!0?"undefined"!=typeof a?a:l.length-1:"undefined"!=typeof a?a:0,t=t?t:function(){},a=0?(A[i.type](n(e,l[a])),m=setTimeout(function(){o?a-=1:a+=1,S.run(e,t,o,a)},S.duration),O.setIcon(h),void 0):void t()},E(),{badge:T,video:R,image:U,webcam:L,reset:M.reset,browser:{supported:x.supported}}};"undefined"!=typeof define&&define.amd?define([],function(){return e}):"undefined"!=typeof module&&module.exports?module.exports=e:this.Favico=e}(); +}); diff --git a/src/server/public/plugins/cordova-plugin-badge/www/badge.js b/src/server/public/plugins/cordova-plugin-badge/www/badge.js new file mode 100644 index 0000000..bbf97e6 --- /dev/null +++ b/src/server/public/plugins/cordova-plugin-badge/www/badge.js @@ -0,0 +1,281 @@ +cordova.define("cordova-plugin-badge.Badge", function(require, exports, module) { /* + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apache License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://opensource.org/licenses/Apache-2.0/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + */ + +var exec = require('cordova/exec'), + channel = require('cordova/channel'), + ua = navigator.userAgent.toLowerCase(), + isIOS = ua.indexOf('ipad') > -1 || ua.indexOf('iphone') > -1, + isMac = ua.indexOf('macintosh') > -1, + isWin = window.Windows !== undefined, + isAndroid = !isWin && ua.indexOf('android') > -1, + isWinPC = isWin && Windows.System.Profile.AnalyticsInfo.versionInfo.deviceFamily.includes('Desktop'), + isDesktop = isMac || isWinPC; + +// Default settings +exports._config = { indicator: 'badge', autoClear: false }; + +/** + * Clears the badge number. + * + * @param [ Function ] callback The callback function to be execute later. + * @param [ Function ] scope Optional scope for the callback function. + * + * @return [ Void ] + */ +exports.clear = function (callback, scope) { + this.exec('clear', null, callback, scope); +}; + +/** + * Sets the badge number. + * + * @param [ Int ] badge The new badge number. + * @param [ Function ] callback The callback function to be execute later. + * @param [ Function ] scope Optional scope for the callback function. + * + * @return [ Void ] + */ +exports.set = function (badge, callback, scope) { + var args = [parseInt(badge) || 0]; + + this.requestPermission(function (granted) { + if (granted) { + this.exec('set', args, callback, scope); + } + }, this); +}; + +/** + * Gets the badge of the app icon. + * + * @param [ Function ] callback The callback function to be execute later. + * @param [ Function ] scope Optional scope for the callback function. + * + * @return [ Void ] + */ +exports.get = function (callback, scope) { + this.exec('get', null, callback, scope); +}; + +/** + * Increases the badge number. + * + * @param [ Int ] count Number to add to the badge number. + * @param [ Function ] callback The callback function to be execute later. + * @param [ Function ] scope Optional scope for the callback function. + * + * @return [ Void ] + */ +exports.increase = function (count, callback, scope) { + this.get(function (badge) { + this.set(badge + (count || 1), callback, scope); + }, this); +}; + +/** + * Decreases the badge number. + * + * @param [ Int ] count Number to substract to the badge number. + * @param [ Function ] callback The callback function to be execute later. + * @param [ Function ] scope Optional scope for the callback function. + * + * @return [ Void ] + */ +exports.decrease = function (count, callback, scope) { + this.get(function (badge) { + this.set(Math.max(0, badge - (count || 1)), callback, scope); + }, this); +}; + +/** + * Check support to show badges. + * + * @param [ Function ] callback The callback function to be execute later. + * @param [ Function ] scope Optional scope for the callback function. + * + * @return [ Void ] + */ +exports.isSupported = function (callback, scope) { + if (isAndroid) { + this.exec('check', null, callback, scope); + } else { + this.createCallbackFn(callback, scope)(true); + } +}; + +/** + * Check permission to show badges. + * + * @param [ Function ] callback The callback function to be execute later. + * @param [ Function ] scope Optional scope for the callback function. + * + * @return [ Void ] + */ +exports.hasPermission = function (callback, scope) { + if (isIOS) { + this.exec('check', null, callback, scope); + } else { + this.createCallbackFn(callback, scope)(true); + } +}; + +/** + * Request permission to show badges. + * + * @param [ Function ] callback The callback function to be execute later. + * @param [ Function ] scope Optional scope for the callback function. + * + * @return [ Void ] + */ +exports.requestPermission = function (callback, scope) { + if (isIOS) { + this.exec('request', null, callback, scope); + } else { + this.createCallbackFn(callback, scope)(true); + } +}; + +/** + * Configures the plugin's platform options. + * + * @param [ Hash ] object Optional config settings. + * + * @return [ Hash ] The merged config settings. + */ +exports.configure = function (config) { + this.mergeConfig(config); + this.exec('save', this._config); + + return this._config; +}; + +/** + * Merge the config values with the current ones. + * + * @param [ Hash ] object Optional config settings. + * + * @return [ Hash ] The merged config settings. + */ +exports.mergeConfig = function (config) { + return Object.assign(this._config, config); +}; + +/** + * Create callback, which will be executed within a specific scope. + * + * @param [ Function ] callback The callback function to be execute later. + * @param [ Function ] scope Optional scope for the callback function. + * + * @return [ Function ] The new callback function + */ +exports.createCallbackFn = function (callbackFn, scope) { + if (typeof callbackFn != 'function') + return; + + return function () { + callbackFn.apply(scope || this, arguments); + }; +}; + +/** + * Clear the badge if autoClear is on and the indicator type is badge. + * + * @return [ Void ] + */ +exports.clearIf = function () { + if (this._config.autoClear && this._config.indicator == 'badge') { + this.clear(); + } +}; + +/** + * Execute the native counterpart. + * + * @param [ String ] action The name of the action to execute. + * @param [ Array ] args Array of arguments to pass with. + * @param [ Function ] callback The callback function to be execute later. + * @param [ Function ] scope Optional scope for the callback function. + * + * @return [ Void ] + */ +exports.exec = function (action, args, callback, scope) { + var fn = this.createCallbackFn(callback, scope), + params = []; + + if (Array.isArray(args)) { + params = args; + } else if (args) { + params.push(args); + } + + exec(fn, null, 'Badge', action, params); +}; + +// Clear badge on app start if autoClear is set to true +channel.onCordovaReady.subscribe(function () { + exports.exec('load', null, function (config) { + this.mergeConfig(config); + this.clearIf(); + }, exports); +}); + +// Clear badge on app resume if autoClear is set to true +channel.onResume.subscribe(function () { + exports.clearIf(); +}); + +// Clear badge on app resume if autoClear is set to true +channel.onActivated.subscribe(function () { + exports.clearIf(); +}); + +if (isDesktop) { + // Clear badge on app resume if autoClear is set to true + document.addEventListener('visibilitychange', function () { + if (!document.hidden) { exports.clearIf(); } + }, false); + + // Clear badge on app resume if autoClear is set to true + window.addEventListener('focus', function () { + exports.clearIf(); + }, false); +} + +// Polyfill for Object.assign +if (typeof Object.assign != 'function') { + Object.assign = function(target) { + 'use strict'; + if (target == null) { + throw new TypeError('Cannot convert undefined or null to object'); + } + + target = Object(target); + for (var index = 1; index < arguments.length; index++) { + var source = arguments[index]; + if (source != null) { + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + } + return target; + }; +} + +}); diff --git a/src/server/public/plugins/cordova-plugin-calendar/www/Calendar.js b/src/server/public/plugins/cordova-plugin-calendar/www/Calendar.js new file mode 100644 index 0000000..b34778c --- /dev/null +++ b/src/server/public/plugins/cordova-plugin-calendar/www/Calendar.js @@ -0,0 +1,304 @@ +cordova.define("cordova-plugin-calendar.Calendar", function(require, exports, module) { "use strict"; +function Calendar() { +} + +Calendar.prototype.getCreateCalendarOptions = function () { + return { + calendarName: null, + calendarColor: null // optional, the OS will choose one if left empty, example: pass "#FF0000" for red + }; +}; + +Calendar.prototype.hasReadPermission = function (successCallback, errorCallback) { + cordova.exec(successCallback, errorCallback, "Calendar", "hasReadPermission", []); +}; + +Calendar.prototype.requestReadPermission = function (successCallback, errorCallback) { + cordova.exec(successCallback, errorCallback, "Calendar", "requestReadPermission", []); +}; + +Calendar.prototype.hasWritePermission = function (successCallback, errorCallback) { + cordova.exec(successCallback, errorCallback, "Calendar", "hasWritePermission", []); +}; + +Calendar.prototype.requestWritePermission = function (successCallback, errorCallback) { + cordova.exec(successCallback, errorCallback, "Calendar", "requestWritePermission", []); +}; + +Calendar.prototype.hasReadWritePermission = function (successCallback, errorCallback) { + cordova.exec(successCallback, errorCallback, "Calendar", "hasReadWritePermission", []); +}; + +Calendar.prototype.requestReadWritePermission = function (successCallback, errorCallback) { + cordova.exec(successCallback, errorCallback, "Calendar", "requestReadWritePermission", []); +}; + +Calendar.prototype.createCalendar = function (calendarNameOrOptionsObject, successCallback, errorCallback) { + var options; + if (typeof calendarNameOrOptionsObject == "string") { + options = { + "calendarName": calendarNameOrOptionsObject + }; + } else { + options = calendarNameOrOptionsObject; + } + // merge passed options with defaults + var mergedOptions = Calendar.prototype.getCreateCalendarOptions(); + for (var val in options) { + if (options.hasOwnProperty(val)) { + mergedOptions[val] = options[val]; + } + } + cordova.exec(successCallback, errorCallback, "Calendar", "createCalendar", [mergedOptions]); +}; + +Calendar.prototype.deleteCalendar = function (calendarName, successCallback, errorCallback) { + cordova.exec(successCallback, errorCallback, "Calendar", "deleteCalendar", [{ + "calendarName": calendarName + }]); +}; + +Calendar.prototype.openCalendar = function (date, successCallback, errorCallback) { + // default: today + if (!(date instanceof Date)) { + date = new Date(); + } + cordova.exec(successCallback, errorCallback, "Calendar", "openCalendar", [{ + "date": date.getTime() + }]); +}; + +Calendar.prototype.getCalendarOptions = function () { + return { + firstReminderMinutes: 60, + secondReminderMinutes: null, + recurrence: null, // options are: 'daily', 'weekly', 'monthly', 'yearly' + recurrenceInterval: 1, // only used when recurrence is set + recurrenceWeekstart: "MO", + recurrenceByDay: null, + recurrenceByMonthDay: null, + recurrenceEndDate: null, + recurrenceCount: null, + calendarName: null, + calendarId: null, + url: null + }; +}; + +/** + * This method can be used if you want more control over the event details. + * Pass in an options object which you can easily override as follow: + * var options = window.plugins.calendar.getCalendarOptions(); + * options.firstReminderMinutes = 150; + */ +Calendar.prototype.createEventWithOptions = function (title, location, notes, startDate, endDate, options, successCallback, errorCallback) { + if (!(startDate instanceof Date && endDate instanceof Date)) { + errorCallback("startDate and endDate must be JavaScript Date Objects"); + return; + } + + // merge passed options with defaults + var mergedOptions = Calendar.prototype.getCalendarOptions(); + for (var val in options) { + if (options.hasOwnProperty(val)) { + mergedOptions[val] = options[val]; + } + } + if (options.recurrenceEndDate != null) { + mergedOptions.recurrenceEndTime = options.recurrenceEndDate.getTime(); + } + cordova.exec(successCallback, errorCallback, "Calendar", "createEventWithOptions", [{ + "title": title, + "location": location, + "notes": notes, + "startTime": startDate instanceof Date ? startDate.getTime() : null, + "endTime": endDate instanceof Date ? endDate.getTime() : null, + "options": mergedOptions + }]); +}; + +/** + * @deprecated use createEventWithOptions instead + */ +Calendar.prototype.createEventInNamedCalendar = function (title, location, notes, startDate, endDate, calendarName, successCallback, errorCallback) { + Calendar.prototype.createEventWithOptions(title, location, notes, startDate, endDate, {calendarName:calendarName}, successCallback, errorCallback); +}; + +Calendar.prototype.createEvent = function (title, location, notes, startDate, endDate, successCallback, errorCallback) { + Calendar.prototype.createEventWithOptions(title, location, notes, startDate, endDate, {}, successCallback, errorCallback); +}; + +Calendar.prototype.createEventInteractively = function (title, location, notes, startDate, endDate, successCallback, errorCallback) { + Calendar.prototype.createEventInteractivelyWithOptions(title, location, notes, startDate, endDate, {}, successCallback, errorCallback); +}; + +Calendar.prototype.createEventInteractivelyWithOptions = function (title, location, notes, startDate, endDate, options, successCallback, errorCallback) { + // merge passed options with defaults + var mergedOptions = Calendar.prototype.getCalendarOptions(); + for (var val in options) { + if (options.hasOwnProperty(val)) { + mergedOptions[val] = options[val]; + } + } + if (options.recurrenceEndDate != null) { + mergedOptions.recurrenceEndTime = options.recurrenceEndDate.getTime(); + } + cordova.exec(successCallback, errorCallback, "Calendar", "createEventInteractively", [{ + "title": title, + "location": location, + "notes": notes, + "startTime": startDate instanceof Date ? startDate.getTime() : null, + "endTime": endDate instanceof Date ? endDate.getTime() : null, + "options": mergedOptions + }]) +}; + +Calendar.prototype.findEventWithOptions = function (title, location, notes, startDate, endDate, options, successCallback, errorCallback) { + // merge passed options with defaults + var mergedOptions = Calendar.prototype.getCalendarOptions(); + for (var val in options) { + if (options.hasOwnProperty(val)) { + mergedOptions[val] = options[val]; + } + } + if (options.recurrenceEndDate != null) { + mergedOptions.recurrenceEndTime = options.recurrenceEndDate.getTime(); + } + cordova.exec(successCallback, errorCallback, "Calendar", "findEventWithOptions", [{ + "title": title, + "location": location, + "notes": notes, + "startTime": startDate instanceof Date ? startDate.getTime() : null, + "endTime": endDate instanceof Date ? endDate.getTime() : null, + "options": mergedOptions + }]) +}; + +Calendar.prototype.findEvent = function (title, location, notes, startDate, endDate, successCallback, errorCallback) { + Calendar.prototype.findEventWithOptions(title, location, notes, startDate, endDate, {}, successCallback, errorCallback); +}; + +Calendar.prototype.findAllEventsInNamedCalendar = function (calendarName, successCallback, errorCallback) { + cordova.exec(successCallback, errorCallback, "Calendar", "findAllEventsInNamedCalendar", [{ + "calendarName": calendarName + }]); +}; + +Calendar.prototype.deleteEvent = function (title, location, notes, startDate, endDate, successCallback, errorCallback) { + if (!(startDate instanceof Date && endDate instanceof Date)) { + errorCallback("startDate and endDate must be JavaScript Date Objects"); + } + cordova.exec(successCallback, errorCallback, "Calendar", "deleteEvent", [{ + "title": title, + "location": location, + "notes": notes, + "startTime": startDate instanceof Date ? startDate.getTime() : null, + "endTime": endDate instanceof Date ? endDate.getTime() : null + }]) +}; + +Calendar.prototype.deleteEventFromNamedCalendar = function (title, location, notes, startDate, endDate, calendarName, successCallback, errorCallback) { + cordova.exec(successCallback, errorCallback, "Calendar", "deleteEventFromNamedCalendar", [{ + "title": title, + "location": location, + "notes": notes, + "startTime": startDate instanceof Date ? startDate.getTime() : null, + "endTime": endDate instanceof Date ? endDate.getTime() : null, + "calendarName": calendarName + }]) +}; + +Calendar.prototype.deleteEventById = function (id, fromDate, successCallback, errorCallback) { + cordova.exec(successCallback, errorCallback, "Calendar", "deleteEventById", [{ + "id": id, + "fromTime": fromDate instanceof Date ? fromDate.getTime() : null + }]); +}; + +Calendar.prototype.modifyEventWithOptions = function (title, location, notes, startDate, endDate, newTitle, newLocation, newNotes, newStartDate, newEndDate, options, newOptions, successCallback, errorCallback) { + if (!(newStartDate instanceof Date && newEndDate instanceof Date)) { + errorCallback("newStartDate and newEndDate must be JavaScript Date Objects"); + return; + } + // merge passed options with defaults + var mergedOptions = Calendar.prototype.getCalendarOptions(); + for (var val in options) { + if (options.hasOwnProperty(val)) { + mergedOptions[val] = options[val]; + } + } + if (options.recurrenceEndDate != null) { + mergedOptions.recurrenceEndTime = options.recurrenceEndDate.getTime(); + } + // and also merge passed newOptions with defaults + var newMergedOptions = Calendar.prototype.getCalendarOptions(); + for (var val2 in newOptions) { + if (newOptions.hasOwnProperty(val2)) { + newMergedOptions[val2] = newOptions[val2]; + } + } + if (newOptions.recurrenceEndDate != null) { + newMergedOptions.recurrenceEndTime = newOptions.recurrenceEndDate.getTime(); + } + cordova.exec(successCallback, errorCallback, "Calendar", "modifyEventWithOptions", [{ + "title": title, + "location": location, + "notes": notes, + "startTime": startDate instanceof Date ? startDate.getTime() : null, + "endTime": endDate instanceof Date ? endDate.getTime() : null, + "newTitle": newTitle, + "newLocation": newLocation, + "newNotes": newNotes, + "newStartTime": newStartDate instanceof Date ? newStartDate.getTime() : null, + "newEndTime": newEndDate instanceof Date ? newEndDate.getTime() : null, + "options": mergedOptions, + "newOptions": newMergedOptions + }]) +}; + +Calendar.prototype.modifyEvent = function (title, location, notes, startDate, endDate, newTitle, newLocation, newNotes, newStartDate, newEndDate, successCallback, errorCallback) { + Calendar.prototype.modifyEventWithOptions(title, location, notes, startDate, endDate, newTitle, newLocation, newNotes, newStartDate, newEndDate, {}, successCallback, errorCallback); +}; + +Calendar.prototype.modifyEventInNamedCalendar = function (title, location, notes, startDate, endDate, newTitle, newLocation, newNotes, newStartDate, newEndDate, calendarName, successCallback, errorCallback) { + var options = Calendar.prototype.getCalendarOptions(); + options.calendarName = calendarName; + Calendar.prototype.modifyEventWithOptions(title, location, notes, startDate, endDate, newTitle, newLocation, newNotes, newStartDate, newEndDate, options, successCallback, errorCallback); +}; + +Calendar.prototype.listEventsInRange = function (startDate, endDate, successCallback, errorCallback) { + cordova.exec(successCallback, errorCallback, "Calendar", "listEventsInRange", [{ + "startTime": startDate instanceof Date ? startDate.getTime() : null, + "endTime": endDate instanceof Date ? endDate.getTime() : null + }]) +}; + +Calendar.prototype.listCalendars = function (successCallback, errorCallback) { + cordova.exec(successCallback, errorCallback, "Calendar", "listCalendars", []); +}; + +Calendar.prototype.parseEventDate = function (dateStr) { + // Handle yyyyMMddTHHmmssZ iCalendar UTC format + var icalRegExp = /\b(\d{4})(\d{2})(\d{2}T\d{2})(\d{2})(\d{2}Z)\b/; + if (icalRegExp.test(dateStr)) + return new Date(String(dateStr).replace(icalRegExp, '$1-$2-$3:$4:$5')); + + var spl; + // Handle yyyy-MM-dd HH:mm:ss format returned by AbstractCalendarAccessor.java L66 and Calendar.m L378, and yyyyMMddTHHmmss iCalendar local format, and similar + return (spl = /^\s*(\d{4})\D?(\d{2})\D?(\d{2})\D?(\d{2})\D?(\d{2})\D?(\d{2})\s*$/.exec(dateStr)) + && new Date(spl[1], spl[2] - 1, spl[3], spl[4], spl[5], spl[6]) + || new Date(dateStr); +}; + +Calendar.install = function () { + if (!window.plugins) { + window.plugins = {}; + } + + window.plugins.calendar = new Calendar(); + return window.plugins.calendar; +}; + +cordova.addConstructor(Calendar.install); + +}); diff --git a/src/server/public/plugins/cordova-plugin-local-notification/www/local-notification-core.js b/src/server/public/plugins/cordova-plugin-local-notification/www/local-notification-core.js new file mode 100644 index 0000000..52e8d29 --- /dev/null +++ b/src/server/public/plugins/cordova-plugin-local-notification/www/local-notification-core.js @@ -0,0 +1,416 @@ +cordova.define("cordova-plugin-local-notification.LocalNotification.Core", function(require, exports, module) { /* + * Apache 2.0 License + * + * Copyright (c) Sebastian Katzer 2017 + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apache License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://opensource.org/licenses/Apache-2.0/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + */ + +var exec = require('cordova/exec'); + +/** + * Check permission to show notifications. + * + * @param [ Function ] callback The function to be exec as the callback. + * @param [ Object ] scope The callback function's scope. + * + * @return [ Void ] + */ +exports.hasPermission = function (callback, scope) { + var fn = this.createCallbackFn(callback, scope); + + exec(fn, null, 'LocalNotification', 'check', []); +}; + +/** + * Request permission to show notifications. + * + * @param [ Function ] callback The function to be exec as the callback. + * @param [ Object ] scope The callback function's scope. + * + * @return [ Void ] + */ +exports.requestPermission = function (callback, scope) { + var fn = this.createCallbackFn(callback, scope); + + exec(fn, null, 'LocalNotification', 'request', []); +}; + +/** + * Schedule notifications. + * + * @param [ Array ] notifications The notifications to schedule. + * @param [ Function ] callback The function to be exec as the callback. + * @param [ Object ] scope The callback function's scope. + * @param [ Object ] args Optional flags how to schedule. + * + * @return [ Void ] + */ +exports.schedule = function (msgs, callback, scope, args) { + var fn = function (granted) { + var toasts = this.toArray(msgs); + + if (!granted && callback) { + callback.call(scope || this, false); + return; + } + + for (var i = 0, len = toasts.length; i < len; i++) { + var toast = toasts[i]; + this.mergeWithDefaults(toast); + this.convertProperties(toast); + } + + this.exec('schedule', toasts, callback, scope); + }; + + if (args && args.skipPermission) { + fn.call(this, true); + } else { + this.requestPermission(fn, this); + } +}; + +/** + * Schedule notifications. + * + * @param [ Array ] notifications The notifications to schedule. + * @param [ Function ] callback The function to be exec as the callback. + * @param [ Object ] scope The callback function's scope. + * @param [ Object ] args Optional flags how to schedule. + * + * @return [ Void ] + */ +exports.update = function (msgs, callback, scope, args) { + var fn = function(granted) { + var toasts = this.toArray(msgs); + + if (!granted && callback) { + callback.call(scope || this, false); + return; + } + + for (var i = 0, len = toasts.length; i < len; i++) { + this.convertProperties(toasts[i]); + } + + this.exec('update', toasts, callback, scope); + }; + + if (args && args.skipPermission) { + fn.call(this, true); + } else { + this.requestPermission(fn, this); + } +}; + +/** + * Clear the specified notifications by id. + * + * @param [ Array ] ids The IDs of the notifications. + * @param [ Function ] callback The function to be exec as the callback. + * @param [ Object ] scope The callback function's scope. + * + * @return [ Void ] + */ +exports.clear = function (ids, callback, scope) { + ids = this.toArray(ids); + ids = this.convertIds(ids); + + this.exec('clear', ids, callback, scope); +}; + +/** + * Clear all triggered notifications. + * + * @param [ Function ] callback The function to be exec as the callback. + * @param [ Object ] scope The callback function's scope. + * + * @return [ Void ] + */ +exports.clearAll = function (callback, scope) { + this.exec('clearAll', null, callback, scope); +}; + +/** + * Clear the specified notifications by id. + * + * @param [ Array ] ids The IDs of the notifications. + * @param [ Function ] callback The function to be exec as the callback. + * @param [ Object ] scope The callback function's scope. + * + * @return [ Void ] + */ +exports.cancel = function (ids, callback, scope) { + ids = this.toArray(ids); + ids = this.convertIds(ids); + + this.exec('cancel', ids, callback, scope); +}; + +/** + * Cancel all scheduled notifications. + * + * @param [ Function ] callback The function to be exec as the callback. + * @param [ Object ] scope The callback function's scope. + * + * @return [ Void ] + */ +exports.cancelAll = function (callback, scope) { + this.exec('cancelAll', null, callback, scope); +}; + +/** + * Check if a notification is present. + * + * @param [ Int ] id The ID of the notification. + * @param [ Function ] callback The function to be exec as the callback. + * @param [ Object ] scope The callback function's scope. + * + * @return [ Void ] + */ +exports.isPresent = function (id, callback, scope) { + var fn = this.createCallbackFn(callback, scope); + + this.getType(id, function (type) { + fn(type != 'unknown'); + }); +}; + +/** + * Check if a notification has a given type. + * + * @param [ Int ] id The ID of the notification. + * @param [ String ] type The type of the notification. + * @param [ Function ] callback The function to be exec as the callback. + * @param [ Object ] scope The callback function's scope. + * + * @return [ Void ] + */ +exports.hasType = function (id, type, callback, scope) { + var fn = this.createCallbackFn(callback, scope); + + this.getType(id, function (type2) { + fn(type == type2); + }); +}; + +/** + * Get the type (triggered, scheduled) for the notification. + * + * @param [ Int ] id The ID of the notification. + * @param [ Function ] callback The function to be exec as the callback. + * @param [ Object ] scope The callback function's scope. + * + * @return [ Void ] + */ +exports.getType = function (id, callback, scope) { + this.exec('type', id, callback, scope); +}; + +/** + * List of all notification ids. + * + * @param [ Function ] callback The function to be exec as the callback. + * @param [ Object ] scope The callback function's scope. + * + * @return [ Void ] + */ +exports.getIds = function (callback, scope) { + this.exec('ids', null, callback, scope); +}; + +/** + * List of all scheduled notification IDs. + * + * @param [ Function ] callback The function to be exec as the callback. + * @param [ Object ] scope The callback function's scope. + * + * @return [ Void ] + */ +exports.getScheduledIds = function (callback, scope) { + this.exec('scheduledIds', null, callback, scope); +}; + +/** + * List of all triggered notification IDs. + * + * @param [ Function ] callback The function to be exec as the callback. + * @param [ Object ] scope The callback function's scope. + * + * @return [ Void ] + */ +exports.getTriggeredIds = function (callback, scope) { + this.exec('triggeredIds', null, callback, scope); +}; + +/** + * List of local notifications specified by id. + * If called without IDs, all notification will be returned. + * + * @param [ Array ] ids The IDs of the notifications. + * @param [ Function ] callback The function to be exec as the callback. + * @param [ Object ] scope The callback function's scope. + * + * @return [ Void ] + */ +exports.get = function () { + var args = Array.apply(null, arguments); + + if (typeof args[0] == 'function') { + args.unshift([]); + } + + var ids = args[0], + callback = args[1], + scope = args[2]; + + if (!Array.isArray(ids)) { + this.exec('notification', Number(ids), callback, scope); + return; + } + + ids = this.convertIds(ids); + + this.exec('notifications', ids, callback, scope); +}; + +/** + * List for all notifications. + * + * @param [ Function ] callback The function to be exec as the callback. + * @param [ Object ] scope The callback function's scope. + * + * @return [ Void ] + */ +exports.getAll = function (callback, scope) { + this.exec('notifications', null, callback, scope); +}; + +/** + * List of all scheduled notifications. + * + * @param [ Function ] callback The function to be exec as the callback. + * @param [ Object ] scope The callback function's scope. + */ +exports.getScheduled = function (callback, scope) { + this.exec('scheduledNotifications', null, callback, scope); +}; + +/** + * List of all triggered notifications. + * + * @param [ Function ] callback The function to be exec as the callback. + * @param [ Object ] scope The callback function's scope. + */ +exports.getTriggered = function (callback, scope) { + this.exec('triggeredNotifications', null, callback, scope); +}; + +/** + * Register an group of actions by id. + * + * @param [ String ] id The Id of the group. + * @param [ Array] actions The action config settings. + * @param [ Function ] callback The function to be exec as the callback. + * @param [ Object ] scope The callback function's scope. + * + * @return [ Void ] + */ +exports.addActionGroup = function (id, actions, callback, scope) { + var config = { actionGroupId: id, actions: actions }; + this.exec('actions', config, callback, scope); +}; + +/** + * The (platform specific) default settings. + * + * @return [ Object ] + */ +exports.getDefaults = function () { + var map = Object.assign({}, this._defaults); + + for (var key in map) { + if (Array.isArray(map[key])) { + map[key] = Array.from(map[key]); + } else + if (Object.prototype.isPrototypeOf(map[key])) { + map[key] = Object.assign({}, map[key]); + } + } + + return map; +}; + +/** + * Overwrite default settings. + * + * @param [ Object ] newDefaults New default values. + * + * @return [ Void ] + */ +exports.setDefaults = function (newDefaults) { + Object.assign(this._defaults, newDefaults); +}; + +/** + * Register callback for given event. + * + * @param [ String ] event The name of the event. + * @param [ Function ] callback The function to be exec as callback. + * @param [ Object ] scope The callback function's scope. + * + * @return [ Void ] + */ +exports.on = function (event, callback, scope) { + + if (typeof callback !== "function") + return; + + if (!this._listener[event]) { + this._listener[event] = []; + } + + var item = [callback, scope || window]; + + this._listener[event].push(item); +}; + +/** + * Unregister callback for given event. + * + * @param [ String ] event The name of the event. + * @param [ Function ] callback The function to be exec as callback. + * + * @return [ Void ] + */ +exports.un = function (event, callback) { + var listener = this._listener[event]; + + if (!listener) + return; + + for (var i = 0; i < listener.length; i++) { + var fn = listener[i][0]; + + if (fn == callback) { + listener.splice(i, 1); + break; + } + } +}; + +}); diff --git a/src/server/public/plugins/cordova-plugin-local-notification/www/local-notification-util.js b/src/server/public/plugins/cordova-plugin-local-notification/www/local-notification-util.js new file mode 100644 index 0000000..e1bc922 --- /dev/null +++ b/src/server/public/plugins/cordova-plugin-local-notification/www/local-notification-util.js @@ -0,0 +1,553 @@ +cordova.define("cordova-plugin-local-notification.LocalNotification.Util", function(require, exports, module) { /* + * Apache 2.0 License + * + * Copyright (c) Sebastian Katzer 2017 + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apache License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://opensource.org/licenses/Apache-2.0/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + */ + +var exec = require('cordova/exec'), + channel = require('cordova/channel'); + +// Default values +exports._defaults = { + actionGroupId : null, + actions : [], + attachments : [], + autoClear : true, + badge : null, + channel : null, + color : null, + data : null, + defaults : 0, + foreground : false, + group : null, + groupSummary : false, + icon : null, + id : 0, + launch : true, + led : true, + lockscreen : true, + mediaSession : null, + number : 0, + priority : 0, + progressBar : false, + showWhen : true, + silent : false, + smallIcon : 'res://icon', + sound : true, + sticky : false, + summary : null, + text : '', + title : '', + trigger : { type : 'calendar' }, + vibrate : false, + wakeup : true +}; + +// Listener +exports._listener = {}; + +/** + * Merge custom properties with the default values. + * + * @param [ Object ] options Set of custom values. + * + * @retrun [ Object ] + */ +exports.mergeWithDefaults = function (options) { + var values = this.getDefaults(); + + if (values.hasOwnProperty('sticky')) { + options.sticky = this.getValueFor(options, 'sticky', 'ongoing'); + } + + if (options.sticky && options.autoClear !== true) { + options.autoClear = false; + } + + Object.assign(values, options); + + for (var key in values) { + if (values[key] !== null) { + options[key] = values[key]; + } else { + delete options[key]; + } + + if (!this._defaults.hasOwnProperty(key)) { + console.warn('Unknown property: ' + key); + } + } + + options.meta = { + plugin: 'cordova-plugin-local-notification', + version: '0.9-beta.2' + }; + + return options; +}; + +/** + * Convert the passed values to their required type. + * + * @param [ Object ] options Properties to convert for. + * + * @return [ Object ] The converted property list + */ +exports.convertProperties = function (options) { + var parseToInt = function (prop, options) { + if (isNaN(options[prop])) { + console.warn(prop + ' is not a number: ' + options[prop]); + return this._defaults[prop]; + } else { + return Number(options[prop]); + } + }; + + if (options.id) { + options.id = parseToInt('id', options); + } + + if (options.title) { + options.title = options.title.toString(); + } + + if (options.badge) { + options.badge = parseToInt('badge', options); + } + + if (options.priority) { + options.priority = parseToInt('priority', options); + } + + if (options.foreground === true) { + options.priority = Math.max(options.priority, 1); + } + + if (options.foreground === false) { + options.priority = Math.min(options.priority, 0); + } + + if (options.defaults) { + options.defaults = parseToInt('defaults', options); + } + + if (options.smallIcon && !options.smallIcon.match(/^res:/)) { + console.warn('Property "smallIcon" must be of kind res://...'); + } + + options.data = JSON.stringify(options.data); + + this.convertTrigger(options); + this.convertActions(options); + this.convertProgressBar(options); + + return options; +}; + +/** + * Convert the passed values to their required type, modifying them + * directly for Android and passing the converted list back for iOS. + * + * @param [ Map ] options Set of custom values. + * + * @return [ Map ] Interaction object with category & actions. + */ +exports.convertActions = function (options) { + var actions = []; + + if (!options.actions) + return null; + + for (var i = 0, len = options.actions.length; i < len; i++) { + var action = options.actions[i]; + + if (!action.id) { + console.warn('Action with title ' + action.title + ' ' + + 'has no id and will not be added.'); + continue; + } + + action.id = action.id.toString(); + + actions.push(action); + } + + options.actions = actions; + + return options; +}; + +/** + * Convert the passed values for the trigger to their required type. + * + * @param [ Map ] options Set of custom values. + * + * @return [ Map ] Interaction object with trigger spec. + */ +exports.convertTrigger = function (options) { + var trigger = options.trigger || {}, + date = this.getValueFor(trigger, 'at', 'firstAt', 'date'); + + var dateToNum = function (date) { + var num = typeof date == 'object' ? date.getTime() : date; + return Math.round(num); + }; + + if (!options.trigger) + return; + + if (!trigger.type) { + trigger.type = trigger.center ? 'location' : 'calendar'; + } + + var isCal = trigger.type == 'calendar'; + + if (isCal && !date) { + date = this.getValueFor(options, 'at', 'firstAt', 'date'); + } + + if (isCal && !trigger.every && options.every) { + trigger.every = options.every; + } + + if (isCal && (trigger.in || trigger.every)) { + date = null; + } + + if (isCal && date) { + trigger.at = dateToNum(date); + } + + if (isCal && trigger.firstAt) { + trigger.firstAt = dateToNum(trigger.firstAt); + } + + if (isCal && trigger.before) { + trigger.before = dateToNum(trigger.before); + } + + if (isCal && trigger.after) { + trigger.after = dateToNum(trigger.after); + } + + if (!trigger.count && device.platform == 'windows') { + trigger.count = trigger.every ? 5 : 1; + } + + if (trigger.count && device.platform == 'iOS') { + console.warn('trigger: { count: } is not supported on iOS.'); + } + + if (!isCal) { + trigger.notifyOnEntry = !!trigger.notifyOnEntry; + trigger.notifyOnExit = trigger.notifyOnExit === true; + trigger.radius = trigger.radius || 5; + trigger.single = !!trigger.single; + } + + if (!isCal || trigger.at) { + delete trigger.every; + } + + delete options.every; + delete options.at; + delete options.firstAt; + delete options.date; + + options.trigger = trigger; + + return options; +}; + +/** + * Convert the passed values for the progressBar to their required type. + * + * @param [ Map ] options Set of custom values. + * + * @return [ Map ] Interaction object with trigger spec. + */ +exports.convertProgressBar = function (options) { + var isAndroid = device.platform == 'Android', + cfg = options.progressBar; + + if (cfg === undefined) + return; + + if (typeof cfg === 'boolean') { + cfg = options.progressBar = { enabled: cfg }; + } + + if (typeof cfg.enabled !== 'boolean') { + cfg.enabled = !!(cfg.value || cfg.maxValue || cfg.indeterminate !== null); + } + + cfg.value = cfg.value || 0; + + if (isAndroid) { + cfg.maxValue = cfg.maxValue || 100; + cfg.indeterminate = !!cfg.indeterminate; + } + + cfg.enabled = !!cfg.enabled; + + return options; +}; + +/** + * Create a callback function to get executed within a specific scope. + * + * @param [ Function ] fn The function to be exec as the callback. + * @param [ Object ] scope The callback function's scope. + * + * @return [ Function ] + */ +exports.createCallbackFn = function (fn, scope) { + + if (typeof fn != 'function') + return; + + return function () { + fn.apply(scope || this, arguments); + }; +}; + +/** + * Convert the IDs to numbers. + * + * @param [ Array ] ids + * + * @return [ Array ] + */ +exports.convertIds = function (ids) { + var convertedIds = []; + + for (var i = 0, len = ids.length; i < len; i++) { + convertedIds.push(Number(ids[i])); + } + + return convertedIds; +}; + +/** + * First found value for the given keys. + * + * @param [ Object ] options Object with key-value properties. + * @param [ *Array ] keys List of keys. + * + * @return [ Object ] + */ +exports.getValueFor = function (options) { + var keys = Array.apply(null, arguments).slice(1); + + for (var i = 0, key = keys[i], len = keys.length; i < len; key = keys[++i]) { + if (options.hasOwnProperty(key)) { + return options[key]; + } + } + + return null; +}; + +/** + * Convert a value to an array. + * + * @param [ Object ] obj Any kind of object. + * + * @return [ Array ] An array with the object as first item. + */ +exports.toArray = function (obj) { + return Array.isArray(obj) ? Array.from(obj) : [obj]; +}; + +/** + * Fire the event with given arguments. + * + * @param [ String ] event The event's name. + * @param [ *Array] args The callback's arguments. + * + * @return [ Void] + */ +exports.fireEvent = function (event) { + var args = Array.apply(null, arguments).slice(1), + listener = this._listener[event]; + + if (!listener) + return; + + if (args[0] && typeof args[0].data === 'string') { + args[0].data = JSON.parse(args[0].data); + } + + for (var i = 0; i < listener.length; i++) { + var fn = listener[i][0], + scope = listener[i][1]; + + fn.apply(scope, args); + } +}; + +/** + * Execute the native counterpart. + * + * @param [ String ] action The name of the action. + * @param [ Array ] args Array of arguments. + * @param [ Function] callback The callback function. + * @param [ Object ] scope The scope for the function. + * + * @return [ Void ] + */ +exports.exec = function (action, args, callback, scope) { + var fn = this.createCallbackFn(callback, scope), + params = []; + + if (Array.isArray(args)) { + params = args; + } else if (args) { + params.push(args); + } + + exec(fn, null, 'LocalNotification', action, params); +}; + +exports.setLaunchDetails = function () { + exports.exec('launch', null, function (details) { + if (details) { + cordova.plugins.notification.local.launchDetails = details; + } + }); +}; + +// Called after 'deviceready' event +channel.deviceready.subscribe(function () { + if (['Android', 'windows', 'iOS'].indexOf(device.platform) > -1) { + exports.exec('ready'); + } +}); + +// Called before 'deviceready' event +channel.onCordovaReady.subscribe(function () { + channel.onCordovaInfoReady.subscribe(function () { + if (['Android', 'windows', 'iOS'].indexOf(device.platform) > -1) { + exports.setLaunchDetails(); + } + }); +}); + +// Polyfill for Object.assign +if (typeof Object.assign != 'function') { + Object.assign = function(target) { + 'use strict'; + if (target == null) { + throw new TypeError('Cannot convert undefined or null to object'); + } + + target = Object(target); + for (var index = 1; index < arguments.length; index++) { + var source = arguments[index]; + if (source != null) { + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + } + return target; + }; +} + +// Production steps of ECMA-262, Edition 6, 22.1.2.1 +// Reference: https://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.from +if (!Array.from) { + Array.from = (function () { + var toStr = Object.prototype.toString; + var isCallable = function (fn) { + return typeof fn === 'function' || toStr.call(fn) === '[object Function]'; + }; + var toInteger = function (value) { + var number = Number(value); + if (isNaN(number)) { return 0; } + if (number === 0 || !isFinite(number)) { return number; } + return (number > 0 ? 1 : -1) * Math.floor(Math.abs(number)); + }; + var maxSafeInteger = Math.pow(2, 53) - 1; + var toLength = function (value) { + var len = toInteger(value); + return Math.min(Math.max(len, 0), maxSafeInteger); + }; + + // The length property of the from method is 1. + return function from(arrayLike/*, mapFn, thisArg */) { + // 1. Let C be the this value. + var C = this; + + // 2. Let items be ToObject(arrayLike). + var items = Object(arrayLike); + + // 3. ReturnIfAbrupt(items). + if (arrayLike == null) { + throw new TypeError("Array.from requires an array-like object - not null or undefined"); + } + + // 4. If mapfn is undefined, then let mapping be false. + var mapFn = arguments.length > 1 ? arguments[1] : void undefined; + var T; + if (typeof mapFn !== 'undefined') { + // 5. else + // 5. a If IsCallable(mapfn) is false, throw a TypeError exception. + if (!isCallable(mapFn)) { + throw new TypeError('Array.from: when provided, the second argument must be a function'); + } + + // 5. b. If thisArg was supplied, let T be thisArg; else let T be undefined. + if (arguments.length > 2) { + T = arguments[2]; + } + } + + // 10. Let lenValue be Get(items, "length"). + // 11. Let len be ToLength(lenValue). + var len = toLength(items.length); + + // 13. If IsConstructor(C) is true, then + // 13. a. Let A be the result of calling the [[Construct]] internal method of C with an argument list containing the single item len. + // 14. a. Else, Let A be ArrayCreate(len). + var A = isCallable(C) ? Object(new C(len)) : new Array(len); + + // 16. Let k be 0. + var k = 0; + // 17. Repeat, while k < len… (also steps a - h) + var kValue; + while (k < len) { + kValue = items[k]; + if (mapFn) { + A[k] = typeof T === 'undefined' ? mapFn(kValue, k) : mapFn.call(T, kValue, k); + } else { + A[k] = kValue; + } + k += 1; + } + // 18. Let putStatus be Put(A, "length", len, true). + A.length = len; + // 20. Return A. + return A; + }; + }()); +} + +}); diff --git a/src/server/public/plugins/cordova-plugin-local-notification/www/local-notification.js b/src/server/public/plugins/cordova-plugin-local-notification/www/local-notification.js new file mode 100644 index 0000000..544bf10 --- /dev/null +++ b/src/server/public/plugins/cordova-plugin-local-notification/www/local-notification.js @@ -0,0 +1,317 @@ +cordova.define("cordova-plugin-local-notification.LocalNotification", function(require, exports, module) { /* + * Apache 2.0 License + * + * Copyright (c) Sebastian Katzer 2017 + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apache License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://opensource.org/licenses/Apache-2.0/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + */ + +/** + * Request permission to show notifications. + * + * @param [ Function ] callback The function to be exec as the callback. + * @param [ Object ] scope The callback function's scope. + * + * @return [ Void ] + */ +exports.hasPermission = function (callback, scope) { + this.core.hasPermission(callback, scope); +}; + +/** + * Request permission to show notifications. + * + * @param [ Function ] callback The function to be exec as the callback. + * @param [ Object ] scope The callback function's scope. + * + * @return [ Void ] + */ +exports.requestPermission = function (callback, scope) { + this.core.requestPermission(callback, scope); +}; + +/** + * Schedule notifications. + * + * @param [ Array ] notifications The notifications to schedule. + * @param [ Function ] callback The function to be exec as the callback. + * @param [ Object ] scope The callback function's scope. + * @param [ Object ] args Optional flags how to schedule. + * + * @return [ Void ] + */ +exports.schedule = function (notifications, callback, scope, args) { + this.core.schedule(notifications, callback, scope, args); +}; + +/** + * Update notifications. + * + * @param [ Array ] notifications The notifications to schedule. + * @param [ Function ] callback The function to be exec as the callback. + * @param [ Object ] scope The callback function's scope. + * @param [ Object ] args Optional flags how to schedule. + * + * @return [ Void ] + */ +exports.update = function (notifications, callback, scope, args) { + this.core.update(notifications, callback, scope, args); +}; + +/** + * Clear the specified notifications by id. + * + * @param [ Array ] ids The IDs of the notifications. + * @param [ Function ] callback The function to be exec as the callback. + * @param [ Object ] scope The callback function's scope. + * + * @return [ Void ] + */ +exports.clear = function (ids, callback, scope) { + this.core.clear(ids, callback, scope); +}; + +/** + * Clear all triggered notifications. + * + * @param [ Function ] callback The function to be exec as the callback. + * @param [ Object ] scope The callback function's scope. + * + * @return [ Void ] + */ +exports.clearAll = function (callback, scope) { + this.core.clearAll(callback, scope); +}; + +/** + * Cancel the specified notifications by id. + * + * @param [ Array ] ids The IDs of the notifications. + * @param [ Function ] callback The function to be exec as the callback. + * @param [ Object ] scope The callback function's scope. + * + * @return [ Void ] + */ +exports.cancel = function (ids, callback, scope) { + this.core.cancel(ids, callback, scope); +}; + +/** + * Cancel all scheduled notifications. + * + * @param [ Function ] callback The function to be exec as the callback. + * @param [ Object ] scope The callback function's scope. + * + * @return [ Void ] + */ +exports.cancelAll = function (callback, scope) { + this.core.cancelAll(callback, scope); +}; + +/** + * Check if a notification is present. + * + * @param [ Int ] id The ID of the notification. + * @param [ Function ] callback The function to be exec as the callback. + * @param [ Object ] scope The callback function's scope. + * + * @return [ Void ] + */ +exports.isPresent = function (id, callback, scope) { + this.core.isPresent(id, callback, scope); +}; + +/** + * Check if a notification is scheduled. + * + * @param [ Int ] id The ID of the notification. + * @param [ Function ] callback The function to be exec as the callback. + * @param [ Object ] scope The callback function's scope. + * + * @return [ Void ] + */ +exports.isScheduled = function (id, callback, scope) { + this.core.hasType(id, 'scheduled', callback, scope); +}; + +/** + * Check if a notification was triggered. + * + * @param [ Int ] id The ID of the notification. + * @param [ Function ] callback The function to be exec as the callback. + * @param [ Object ] scope The callback function's scope. + * + * @return [ Void ] + */ +exports.isTriggered = function (id, callback, scope) { + this.core.hasType(id, 'triggered', callback, scope); +}; + +/** + * Get the type (triggered, scheduled) for the notification. + * + * @param [ Int ] id The ID of the notification. + * @param [ Function ] callback The function to be exec as the callback. + * @param [ Object ] scope The callback function's scope. + * + * @return [ Void ] + */ +exports.getType = function (id, callback, scope) { + this.core.getType(id, callback, scope); +}; + +/** + * List of all notification ids. + * + * @param [ Function ] callback The function to be exec as the callback. + * @param [ Object ] scope The callback function's scope. + * + * @return [ Void ] + */ +exports.getIds = function (callback, scope) { + this.core.getIds(callback, scope); +}; + +/** + * List of all scheduled notification IDs. + * + * @param [ Function ] callback The function to be exec as the callback. + * @param [ Object ] scope The callback function's scope. + * + * @return [ Void ] + */ +exports.getScheduledIds = function (callback, scope) { + this.core.getScheduledIds(callback, scope); +}; + +/** + * List of all triggered notification IDs. + * + * @param [ Function ] callback The function to be exec as the callback. + * @param [ Object ] scope The callback function's scope. + * + * @return [ Void ] + */ +exports.getTriggeredIds = function (callback, scope) { + this.core.getTriggeredIds(callback, scope); +}; + +/** + * List of local notifications specified by id. + * If called without IDs, all notification will be returned. + * + * @param [ Array ] ids The IDs of the notifications. + * @param [ Function ] callback The function to be exec as the callback. + * @param [ Object ] scope The callback function's scope. + * + * @return [ Void ] + */ +exports.get = function (ids, callback, scope) { + this.core.get(ids, callback, scope); +}; + +/** + * List for all notifications. + * + * @param [ Function ] callback The function to be exec as the callback. + * @param [ Object ] scope The callback function's scope. + * + * @return [ Void ] + */ +exports.getAll = function (callback, scope) { + this.core.getAll(callback, scope); +}; + +/** + * List of all scheduled notifications. + * + * @param [ Function ] callback The function to be exec as the callback. + * @param [ Object ] scope The callback function's scope. + */ +exports.getScheduled = function (callback, scope) { + this.core.getScheduled(callback, scope); +}; + +/** + * List of all triggered notifications. + * + * @param [ Function ] callback The function to be exec as the callback. + * @param [ Object ] scope The callback function's scope. + */ +exports.getTriggered = function (callback, scope) { + this.core.getTriggered(callback, scope); +}; + +/** + * Register an group of actions by id. + * + * @param [ String ] id The Id of the group. + * @param [ Array] actions The action config settings. + * @param [ Function ] callback The function to be exec as the callback. + * @param [ Object ] scope The callback function's scope. + * + * @return [ Void ] + */ +exports.addActionGroup = function (id, actions, callback, scope) { + this.core.addActionGroup(id, actions, callback, scope); +}; + +/** + * The (platform specific) default settings. + * + * @return [ Object ] + */ +exports.getDefaults = function () { + return this.core.getDefaults(); +}; + +/** + * Overwrite default settings. + * + * @param [ Object ] newDefaults New default values. + * + * @return [ Void ] + */ +exports.setDefaults = function (defaults) { + this.core.setDefaults(defaults); +}; + +/** + * Register callback for given event. + * + * @param [ String ] event The name of the event. + * @param [ Function ] callback The function to be exec as callback. + * @param [ Object ] scope The callback function's scope. + * + * @return [ Void ] + */ +exports.on = function (event, callback, scope) { + this.core.on(event, callback, scope); +}; + +/** + * Unregister callback for given event. + * + * @param [ String ] event The name of the event. + * @param [ Function ] callback The function to be exec as callback. + * + * @return [ Void ] + */ +exports.un = function (event, callback) { + this.core.un(event, callback); +}; + +}); diff --git a/src/server/public/plugins/cordova-plugin-statusbar/src/browser/StatusBarProxy.js b/src/server/public/plugins/cordova-plugin-statusbar/src/browser/StatusBarProxy.js new file mode 100644 index 0000000..e6e41ec --- /dev/null +++ b/src/server/public/plugins/cordova-plugin-statusbar/src/browser/StatusBarProxy.js @@ -0,0 +1,52 @@ +cordova.define("cordova-plugin-statusbar.StatusBarProxy", function(require, exports, module) { /* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ + +function notSupported(win,fail) { + // + console.log('StatusBar is not supported'); + setTimeout(function(){ + if (win) { + win(); + } + // note that while it is not explicitly supported, it does not fail + // this is really just here to allow developers to test their code in the browser + // and if we fail, then their app might as well. -jm + },0); +} + +module.exports = { + isVisible: false, + styleBlackTranslucent:notSupported, + styleDefault:notSupported, + styleLightContent:notSupported, + styleBlackOpaque:notSupported, + overlaysWebView:notSupported, + styleLightContect: notSupported, + backgroundColorByName: notSupported, + backgroundColorByHexString: notSupported, + hide: notSupported, + show: notSupported, + _ready:notSupported +}; + +require("cordova/exec/proxy").add("StatusBar", module.exports); + + +}); diff --git a/src/server/public/plugins/cordova-plugin-statusbar/www/statusbar.js b/src/server/public/plugins/cordova-plugin-statusbar/www/statusbar.js new file mode 100644 index 0000000..9684d23 --- /dev/null +++ b/src/server/public/plugins/cordova-plugin-statusbar/www/statusbar.js @@ -0,0 +1,115 @@ +cordova.define("cordova-plugin-statusbar.statusbar", function(require, exports, module) { /* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ + +/* global cordova */ + +var exec = require('cordova/exec'); + +var namedColors = { + "black": "#000000", + "darkGray": "#A9A9A9", + "lightGray": "#D3D3D3", + "white": "#FFFFFF", + "gray": "#808080", + "red": "#FF0000", + "green": "#00FF00", + "blue": "#0000FF", + "cyan": "#00FFFF", + "yellow": "#FFFF00", + "magenta": "#FF00FF", + "orange": "#FFA500", + "purple": "#800080", + "brown": "#A52A2A" +}; + +var StatusBar = { + + isVisible: true, + + overlaysWebView: function (doOverlay) { + exec(null, null, "StatusBar", "overlaysWebView", [doOverlay]); + }, + + styleDefault: function () { + // dark text ( to be used on a light background ) + exec(null, null, "StatusBar", "styleDefault", []); + }, + + styleLightContent: function () { + // light text ( to be used on a dark background ) + exec(null, null, "StatusBar", "styleLightContent", []); + }, + + styleBlackTranslucent: function () { + // #88000000 ? Apple says to use lightContent instead + exec(null, null, "StatusBar", "styleBlackTranslucent", []); + }, + + styleBlackOpaque: function () { + // #FF000000 ? Apple says to use lightContent instead + exec(null, null, "StatusBar", "styleBlackOpaque", []); + }, + + backgroundColorByName: function (colorname) { + return StatusBar.backgroundColorByHexString(namedColors[colorname]); + }, + + backgroundColorByHexString: function (hexString) { + if (hexString.charAt(0) !== "#") { + hexString = "#" + hexString; + } + + if (hexString.length === 4) { + var split = hexString.split(""); + hexString = "#" + split[1] + split[1] + split[2] + split[2] + split[3] + split[3]; + } + + exec(null, null, "StatusBar", "backgroundColorByHexString", [hexString]); + }, + + hide: function () { + exec(null, null, "StatusBar", "hide", []); + StatusBar.isVisible = false; + }, + + show: function () { + exec(null, null, "StatusBar", "show", []); + StatusBar.isVisible = true; + } + +}; + +// prime it. setTimeout so that proxy gets time to init +window.setTimeout(function () { + exec(function (res) { + if (typeof res == 'object') { + if (res.type == 'tap') { + cordova.fireWindowEvent('statusTap'); + } + } else { + StatusBar.isVisible = res; + } + }, null, "StatusBar", "_ready", []); +}, 0); + +module.exports = StatusBar; + +}); diff --git a/src/server/public/scripts/localforage.js b/src/server/public/scripts/localforage.js index 89a219a..3d26966 100644 --- a/src/server/public/scripts/localforage.js +++ b/src/server/public/scripts/localforage.js @@ -1,3 +1,2801 @@ -/*! For license information please see localforage.js.LICENSE.txt */ -!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).localforage=e()}}((function(){return function e(n,t,r){function o(a,u){if(!t[a]){if(!n[a]){var c="function"==typeof require&&require;if(!u&&c)return c(a,!0);if(i)return i(a,!0);var f=new Error("Cannot find module '"+a+"'");throw f.code="MODULE_NOT_FOUND",f}var s=t[a]={exports:{}};n[a][0].call(s.exports,(function(e){var t=n[a][1][e];return o(t||e)}),s,s.exports,e,n,t,r)}return t[a].exports}for(var i="function"==typeof require&&require,a=0;a=43)}})).catch((function(){return!1}))}(e).then((function(e){return d=e}))}function m(e){var n=v[e.name],t={};t.promise=new a((function(e,n){t.resolve=e,t.reject=n})),n.deferredOperations.push(t),n.dbReady?n.dbReady=n.dbReady.then((function(){return t.promise})):n.dbReady=t.promise}function g(e){var n=v[e.name].deferredOperations.pop();if(n)return n.resolve(),n.promise}function _(e,n){var t=v[e.name].deferredOperations.pop();if(t)return t.reject(n),t.promise}function w(e,n){return new a((function(t,r){if(v[e.name]=v[e.name]||{forages:[],db:null,dbReady:null,deferredOperations:[]},e.db){if(!n)return t(e.db);m(e),e.db.close()}var i=[e.name];n&&i.push(e.version);var a=o.open.apply(o,i);n&&(a.onupgradeneeded=function(n){var t=a.result;try{t.createObjectStore(e.storeName),n.oldVersion<=1&&t.createObjectStore(l)}catch(t){if("ConstraintError"!==t.name)throw t;console.warn('The database "'+e.name+'" has been upgraded from version '+n.oldVersion+" to version "+n.newVersion+', but the storage "'+e.storeName+'" already exists.')}}),a.onerror=function(e){e.preventDefault(),r(a.error)},a.onsuccess=function(){t(a.result),g(e)}}))}function I(e){return w(e,!1)}function S(e){return w(e,!0)}function E(e,n){if(!e.db)return!0;var t=!e.db.objectStoreNames.contains(e.storeName),r=e.versione.db.version;if(r&&(e.version!==n&&console.warn('The database "'+e.name+"\" can't be downgraded from version "+e.db.version+" to version "+e.version+"."),e.version=e.db.version),o||t){if(t){var i=e.db.version+1;i>e.version&&(e.version=i)}return!0}return!1}function N(e){return i([function(e){for(var n=e.length,t=new ArrayBuffer(n),r=new Uint8Array(t),o=0;o0&&(!e.db||"InvalidStateError"===o.name||"NotFoundError"===o.name))return a.resolve().then((function(){if(!e.db||"NotFoundError"===o.name&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),S(e)})).then((function(){return function(e){m(e);for(var n=v[e.name],t=n.forages,r=0;r>4,s[c++]=(15&r)<<4|o>>2,s[c++]=(3&o)<<6|63&i;return f}function G(e){var n,t=new Uint8Array(e),r="";for(n=0;n>2],r+=D[(3&t[n])<<4|t[n+1]>>4],r+=D[(15&t[n+1])<<2|t[n+2]>>6],r+=D[63&t[n+2]];return t.length%3==2?r=r.substring(0,r.length-1)+"=":t.length%3==1&&(r=r.substring(0,r.length-2)+"=="),r}var J={serialize:function(e,n){var t="";if(e&&(t=Q.call(e)),e&&("[object ArrayBuffer]"===t||e.buffer&&"[object ArrayBuffer]"===Q.call(e.buffer))){var r,o=B;e instanceof ArrayBuffer?(r=e,o+=C):(r=e.buffer,"[object Int8Array]"===t?o+=F:"[object Uint8Array]"===t?o+=L:"[object Uint8ClampedArray]"===t?o+=M:"[object Int16Array]"===t?o+=z:"[object Uint16Array]"===t?o+=q:"[object Int32Array]"===t?o+=P:"[object Uint32Array]"===t?o+=U:"[object Float32Array]"===t?o+=W:"[object Float64Array]"===t?o+=K:n(new Error("Failed to get type for BinaryArray"))),n(o+G(r))}else if("[object Blob]"===t){var i=new FileReader;i.onload=function(){var t="~~local_forage_type~"+e.type+"~"+G(this.result);n("__lfsc__:blob"+t)},i.readAsArrayBuffer(e)}else try{n(JSON.stringify(e))}catch(t){console.error("Couldn't convert value into a JSON string: ",e),n(null,t)}},deserialize:function(e){if(e.substring(0,k)!==B)return JSON.parse(e);var n,t=e.substring(H),r=e.substring(k,H);if(r===T&&x.test(t)){var o=t.match(x);n=o[1],t=t.substring(o[0].length)}var a=X(t);switch(r){case C:return a;case T:return i([a],{type:n});case F:return new Int8Array(a);case L:return new Uint8Array(a);case M:return new Uint8ClampedArray(a);case z:return new Int16Array(a);case q:return new Uint16Array(a);case P:return new Int32Array(a);case U:return new Uint32Array(a);case W:return new Float32Array(a);case K:return new Float64Array(a);default:throw new Error("Unkown type: "+r)}},stringToBuffer:X,bufferToString:G};function V(e,n,t,r){e.executeSql("CREATE TABLE IF NOT EXISTS "+n.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],t,r)}function Y(e,n,t,r,o,i){e.executeSql(t,r,o,(function(e,a){a.code===a.SYNTAX_ERR?e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[n.storeName],(function(e,u){u.rows.length?i(e,a):V(e,n,(function(){e.executeSql(t,r,o,i)}),i)}),i):i(e,a)}),i)}function Z(e,n,t,r){var o=this;e=f(e);var i=new a((function(i,a){o.ready().then((function(){void 0===n&&(n=null);var u=n,c=o._dbInfo;c.serializer.serialize(n,(function(n,f){f?a(f):c.db.transaction((function(t){Y(t,c,"INSERT OR REPLACE INTO "+c.storeName+" (key, value) VALUES (?, ?)",[e,n],(function(){i(u)}),(function(e,n){a(n)}))}),(function(n){if(n.code===n.QUOTA_ERR){if(r>0)return void i(Z.apply(o,[e,u,t,r-1]));a(n)}}))}))})).catch(a)}));return u(i,t),i}function $(e){return new a((function(n,t){e.transaction((function(r){r.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],(function(t,r){for(var o=[],i=0;i0}var re={_driver:"localStorageWrapper",_initStorage:function(e){var n={};if(e)for(var t in e)n[t]=e[t];return n.keyPrefix=ne(e,this._defaultConfig),te()?(this._dbInfo=n,n.serializer=J,a.resolve()):a.reject()},_support:function(){try{return"undefined"!=typeof localStorage&&"setItem"in localStorage&&!!localStorage.setItem}catch(e){return!1}}(),iterate:function(e,n){var t=this,r=t.ready().then((function(){for(var n=t._dbInfo,r=n.keyPrefix,o=r.length,i=localStorage.length,a=1,u=0;u=0;t--){var r=localStorage.key(t);0===r.indexOf(e)&&localStorage.removeItem(r)}}));return u(t,e),t},length:function(e){var n=this.keys().then((function(e){return e.length}));return u(n,e),n},key:function(e,n){var t=this,r=t.ready().then((function(){var n,r=t._dbInfo;try{n=localStorage.key(e)}catch(e){n=null}return n&&(n=n.substring(r.keyPrefix.length)),n}));return u(r,n),r},keys:function(e){var n=this,t=n.ready().then((function(){for(var e=n._dbInfo,t=localStorage.length,r=[],o=0;o=0;n--){var t=localStorage.key(n);0===t.indexOf(e)&&localStorage.removeItem(t)}})):a.reject("Invalid arguments"),n),r}},oe=function(e,n){for(var t,r,o=e.length,i=0;i element; its readystatechange event will be fired asynchronously once it is inserted + // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called. + var scriptEl = global.document.createElement('script'); + scriptEl.onreadystatechange = function () { + nextTick(); + + scriptEl.onreadystatechange = null; + scriptEl.parentNode.removeChild(scriptEl); + scriptEl = null; + }; + global.document.documentElement.appendChild(scriptEl); + }; + } else { + scheduleDrain = function () { + setTimeout(nextTick, 0); + }; + } +} + +var draining; +var queue = []; +//named nextTick for less confusing stack traces +function nextTick() { + draining = true; + var i, oldQueue; + var len = queue.length; + while (len) { + oldQueue = queue; + queue = []; + i = -1; + while (++i < len) { + oldQueue[i](); + } + len = queue.length; + } + draining = false; +} + +module.exports = immediate; +function immediate(task) { + if (queue.push(task) === 1 && !draining) { + scheduleDrain(); + } +} + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{}],2:[function(_dereq_,module,exports){ +'use strict'; +var immediate = _dereq_(1); + +/* istanbul ignore next */ +function INTERNAL() {} + +var handlers = {}; + +var REJECTED = ['REJECTED']; +var FULFILLED = ['FULFILLED']; +var PENDING = ['PENDING']; + +module.exports = Promise; + +function Promise(resolver) { + if (typeof resolver !== 'function') { + throw new TypeError('resolver must be a function'); + } + this.state = PENDING; + this.queue = []; + this.outcome = void 0; + if (resolver !== INTERNAL) { + safelyResolveThenable(this, resolver); + } +} + +Promise.prototype["catch"] = function (onRejected) { + return this.then(null, onRejected); +}; +Promise.prototype.then = function (onFulfilled, onRejected) { + if (typeof onFulfilled !== 'function' && this.state === FULFILLED || + typeof onRejected !== 'function' && this.state === REJECTED) { + return this; + } + var promise = new this.constructor(INTERNAL); + if (this.state !== PENDING) { + var resolver = this.state === FULFILLED ? onFulfilled : onRejected; + unwrap(promise, resolver, this.outcome); + } else { + this.queue.push(new QueueItem(promise, onFulfilled, onRejected)); + } + + return promise; +}; +function QueueItem(promise, onFulfilled, onRejected) { + this.promise = promise; + if (typeof onFulfilled === 'function') { + this.onFulfilled = onFulfilled; + this.callFulfilled = this.otherCallFulfilled; + } + if (typeof onRejected === 'function') { + this.onRejected = onRejected; + this.callRejected = this.otherCallRejected; + } +} +QueueItem.prototype.callFulfilled = function (value) { + handlers.resolve(this.promise, value); +}; +QueueItem.prototype.otherCallFulfilled = function (value) { + unwrap(this.promise, this.onFulfilled, value); +}; +QueueItem.prototype.callRejected = function (value) { + handlers.reject(this.promise, value); +}; +QueueItem.prototype.otherCallRejected = function (value) { + unwrap(this.promise, this.onRejected, value); +}; + +function unwrap(promise, func, value) { + immediate(function () { + var returnValue; + try { + returnValue = func(value); + } catch (e) { + return handlers.reject(promise, e); + } + if (returnValue === promise) { + handlers.reject(promise, new TypeError('Cannot resolve promise with itself')); + } else { + handlers.resolve(promise, returnValue); + } + }); +} + +handlers.resolve = function (self, value) { + var result = tryCatch(getThen, value); + if (result.status === 'error') { + return handlers.reject(self, result.value); + } + var thenable = result.value; + + if (thenable) { + safelyResolveThenable(self, thenable); + } else { + self.state = FULFILLED; + self.outcome = value; + var i = -1; + var len = self.queue.length; + while (++i < len) { + self.queue[i].callFulfilled(value); + } + } + return self; +}; +handlers.reject = function (self, error) { + self.state = REJECTED; + self.outcome = error; + var i = -1; + var len = self.queue.length; + while (++i < len) { + self.queue[i].callRejected(error); + } + return self; +}; + +function getThen(obj) { + // Make sure we only access the accessor once as required by the spec + var then = obj && obj.then; + if (obj && (typeof obj === 'object' || typeof obj === 'function') && typeof then === 'function') { + return function appyThen() { + then.apply(obj, arguments); + }; + } +} + +function safelyResolveThenable(self, thenable) { + // Either fulfill, reject or reject with error + var called = false; + function onError(value) { + if (called) { + return; + } + called = true; + handlers.reject(self, value); + } + + function onSuccess(value) { + if (called) { + return; + } + called = true; + handlers.resolve(self, value); + } + + function tryToUnwrap() { + thenable(onSuccess, onError); + } + + var result = tryCatch(tryToUnwrap); + if (result.status === 'error') { + onError(result.value); + } +} + +function tryCatch(func, value) { + var out = {}; + try { + out.value = func(value); + out.status = 'success'; + } catch (e) { + out.status = 'error'; + out.value = e; + } + return out; +} + +Promise.resolve = resolve; +function resolve(value) { + if (value instanceof this) { + return value; + } + return handlers.resolve(new this(INTERNAL), value); +} + +Promise.reject = reject; +function reject(reason) { + var promise = new this(INTERNAL); + return handlers.reject(promise, reason); +} + +Promise.all = all; +function all(iterable) { + var self = this; + if (Object.prototype.toString.call(iterable) !== '[object Array]') { + return this.reject(new TypeError('must be an array')); + } + + var len = iterable.length; + var called = false; + if (!len) { + return this.resolve([]); + } + + var values = new Array(len); + var resolved = 0; + var i = -1; + var promise = new this(INTERNAL); + + while (++i < len) { + allResolver(iterable[i], i); + } + return promise; + function allResolver(value, i) { + self.resolve(value).then(resolveFromAll, function (error) { + if (!called) { + called = true; + handlers.reject(promise, error); + } + }); + function resolveFromAll(outValue) { + values[i] = outValue; + if (++resolved === len && !called) { + called = true; + handlers.resolve(promise, values); + } + } + } +} + +Promise.race = race; +function race(iterable) { + var self = this; + if (Object.prototype.toString.call(iterable) !== '[object Array]') { + return this.reject(new TypeError('must be an array')); + } + + var len = iterable.length; + var called = false; + if (!len) { + return this.resolve([]); + } + + var i = -1; + var promise = new this(INTERNAL); + + while (++i < len) { + resolver(iterable[i]); + } + return promise; + function resolver(value) { + self.resolve(value).then(function (response) { + if (!called) { + called = true; + handlers.resolve(promise, response); + } + }, function (error) { + if (!called) { + called = true; + handlers.reject(promise, error); + } + }); + } +} + +},{"1":1}],3:[function(_dereq_,module,exports){ +(function (global){ +'use strict'; +if (typeof global.Promise !== 'function') { + global.Promise = _dereq_(2); +} + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"2":2}],4:[function(_dereq_,module,exports){ +'use strict'; + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function getIDB() { + /* global indexedDB,webkitIndexedDB,mozIndexedDB,OIndexedDB,msIndexedDB */ + try { + if (typeof indexedDB !== 'undefined') { + return indexedDB; + } + if (typeof webkitIndexedDB !== 'undefined') { + return webkitIndexedDB; + } + if (typeof mozIndexedDB !== 'undefined') { + return mozIndexedDB; + } + if (typeof OIndexedDB !== 'undefined') { + return OIndexedDB; + } + if (typeof msIndexedDB !== 'undefined') { + return msIndexedDB; + } + } catch (e) { + return; + } +} + +var idb = getIDB(); + +function isIndexedDBValid() { + try { + // Initialize IndexedDB; fall back to vendor-prefixed versions + // if needed. + if (!idb || !idb.open) { + return false; + } + // We mimic PouchDB here; + // + // We test for openDatabase because IE Mobile identifies itself + // as Safari. Oh the lulz... + var isSafari = typeof openDatabase !== 'undefined' && /(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent) && !/Chrome/.test(navigator.userAgent) && !/BlackBerry/.test(navigator.platform); + + var hasFetch = typeof fetch === 'function' && fetch.toString().indexOf('[native code') !== -1; + + // Safari <10.1 does not meet our requirements for IDB support + // (see: https://github.com/pouchdb/pouchdb/issues/5572). + // Safari 10.1 shipped with fetch, we can use that to detect it. + // Note: this creates issues with `window.fetch` polyfills and + // overrides; see: + // https://github.com/localForage/localForage/issues/856 + return (!isSafari || hasFetch) && typeof indexedDB !== 'undefined' && + // some outdated implementations of IDB that appear on Samsung + // and HTC Android devices <4.4 are missing IDBKeyRange + // See: https://github.com/mozilla/localForage/issues/128 + // See: https://github.com/mozilla/localForage/issues/272 + typeof IDBKeyRange !== 'undefined'; + } catch (e) { + return false; + } +} + +// Abstracts constructing a Blob object, so it also works in older +// browsers that don't support the native Blob constructor. (i.e. +// old QtWebKit versions, at least). +// Abstracts constructing a Blob object, so it also works in older +// browsers that don't support the native Blob constructor. (i.e. +// old QtWebKit versions, at least). +function createBlob(parts, properties) { + /* global BlobBuilder,MSBlobBuilder,MozBlobBuilder,WebKitBlobBuilder */ + parts = parts || []; + properties = properties || {}; + try { + return new Blob(parts, properties); + } catch (e) { + if (e.name !== 'TypeError') { + throw e; + } + var Builder = typeof BlobBuilder !== 'undefined' ? BlobBuilder : typeof MSBlobBuilder !== 'undefined' ? MSBlobBuilder : typeof MozBlobBuilder !== 'undefined' ? MozBlobBuilder : WebKitBlobBuilder; + var builder = new Builder(); + for (var i = 0; i < parts.length; i += 1) { + builder.append(parts[i]); + } + return builder.getBlob(properties.type); + } +} + +// This is CommonJS because lie is an external dependency, so Rollup +// can just ignore it. +if (typeof Promise === 'undefined') { + // In the "nopromises" build this will just throw if you don't have + // a global promise object, but it would throw anyway later. + _dereq_(3); +} +var Promise$1 = Promise; + +function executeCallback(promise, callback) { + if (callback) { + promise.then(function (result) { + callback(null, result); + }, function (error) { + callback(error); + }); + } +} + +function executeTwoCallbacks(promise, callback, errorCallback) { + if (typeof callback === 'function') { + promise.then(callback); + } + + if (typeof errorCallback === 'function') { + promise["catch"](errorCallback); + } +} + +function normalizeKey(key) { + // Cast the key to a string, as that's all we can set as a key. + if (typeof key !== 'string') { + console.warn(key + ' used as a key, but it is not a string.'); + key = String(key); + } + + return key; +} + +function getCallback() { + if (arguments.length && typeof arguments[arguments.length - 1] === 'function') { + return arguments[arguments.length - 1]; + } +} + +// Some code originally from async_storage.js in +// [Gaia](https://github.com/mozilla-b2g/gaia). + +var DETECT_BLOB_SUPPORT_STORE = 'local-forage-detect-blob-support'; +var supportsBlobs = void 0; +var dbContexts = {}; +var toString = Object.prototype.toString; + +// Transaction Modes +var READ_ONLY = 'readonly'; +var READ_WRITE = 'readwrite'; + +// Transform a binary string to an array buffer, because otherwise +// weird stuff happens when you try to work with the binary string directly. +// It is known. +// From http://stackoverflow.com/questions/14967647/ (continues on next line) +// encode-decode-image-with-base64-breaks-image (2013-04-21) +function _binStringToArrayBuffer(bin) { + var length = bin.length; + var buf = new ArrayBuffer(length); + var arr = new Uint8Array(buf); + for (var i = 0; i < length; i++) { + arr[i] = bin.charCodeAt(i); + } + return buf; +} + +// +// Blobs are not supported in all versions of IndexedDB, notably +// Chrome <37 and Android <5. In those versions, storing a blob will throw. +// +// Various other blob bugs exist in Chrome v37-42 (inclusive). +// Detecting them is expensive and confusing to users, and Chrome 37-42 +// is at very low usage worldwide, so we do a hacky userAgent check instead. +// +// content-type bug: https://code.google.com/p/chromium/issues/detail?id=408120 +// 404 bug: https://code.google.com/p/chromium/issues/detail?id=447916 +// FileReader bug: https://code.google.com/p/chromium/issues/detail?id=447836 +// +// Code borrowed from PouchDB. See: +// https://github.com/pouchdb/pouchdb/blob/master/packages/node_modules/pouchdb-adapter-idb/src/blobSupport.js +// +function _checkBlobSupportWithoutCaching(idb) { + return new Promise$1(function (resolve) { + var txn = idb.transaction(DETECT_BLOB_SUPPORT_STORE, READ_WRITE); + var blob = createBlob(['']); + txn.objectStore(DETECT_BLOB_SUPPORT_STORE).put(blob, 'key'); + + txn.onabort = function (e) { + // If the transaction aborts now its due to not being able to + // write to the database, likely due to the disk being full + e.preventDefault(); + e.stopPropagation(); + resolve(false); + }; + + txn.oncomplete = function () { + var matchedChrome = navigator.userAgent.match(/Chrome\/(\d+)/); + var matchedEdge = navigator.userAgent.match(/Edge\//); + // MS Edge pretends to be Chrome 42: + // https://msdn.microsoft.com/en-us/library/hh869301%28v=vs.85%29.aspx + resolve(matchedEdge || !matchedChrome || parseInt(matchedChrome[1], 10) >= 43); + }; + })["catch"](function () { + return false; // error, so assume unsupported + }); +} + +function _checkBlobSupport(idb) { + if (typeof supportsBlobs === 'boolean') { + return Promise$1.resolve(supportsBlobs); + } + return _checkBlobSupportWithoutCaching(idb).then(function (value) { + supportsBlobs = value; + return supportsBlobs; + }); +} + +function _deferReadiness(dbInfo) { + var dbContext = dbContexts[dbInfo.name]; + + // Create a deferred object representing the current database operation. + var deferredOperation = {}; + + deferredOperation.promise = new Promise$1(function (resolve, reject) { + deferredOperation.resolve = resolve; + deferredOperation.reject = reject; + }); + + // Enqueue the deferred operation. + dbContext.deferredOperations.push(deferredOperation); + + // Chain its promise to the database readiness. + if (!dbContext.dbReady) { + dbContext.dbReady = deferredOperation.promise; + } else { + dbContext.dbReady = dbContext.dbReady.then(function () { + return deferredOperation.promise; + }); + } +} + +function _advanceReadiness(dbInfo) { + var dbContext = dbContexts[dbInfo.name]; + + // Dequeue a deferred operation. + var deferredOperation = dbContext.deferredOperations.pop(); + + // Resolve its promise (which is part of the database readiness + // chain of promises). + if (deferredOperation) { + deferredOperation.resolve(); + return deferredOperation.promise; + } +} + +function _rejectReadiness(dbInfo, err) { + var dbContext = dbContexts[dbInfo.name]; + + // Dequeue a deferred operation. + var deferredOperation = dbContext.deferredOperations.pop(); + + // Reject its promise (which is part of the database readiness + // chain of promises). + if (deferredOperation) { + deferredOperation.reject(err); + return deferredOperation.promise; + } +} + +function _getConnection(dbInfo, upgradeNeeded) { + return new Promise$1(function (resolve, reject) { + dbContexts[dbInfo.name] = dbContexts[dbInfo.name] || createDbContext(); + + if (dbInfo.db) { + if (upgradeNeeded) { + _deferReadiness(dbInfo); + dbInfo.db.close(); + } else { + return resolve(dbInfo.db); + } + } + + var dbArgs = [dbInfo.name]; + + if (upgradeNeeded) { + dbArgs.push(dbInfo.version); + } + + var openreq = idb.open.apply(idb, dbArgs); + + if (upgradeNeeded) { + openreq.onupgradeneeded = function (e) { + var db = openreq.result; + try { + db.createObjectStore(dbInfo.storeName); + if (e.oldVersion <= 1) { + // Added when support for blob shims was added + db.createObjectStore(DETECT_BLOB_SUPPORT_STORE); + } + } catch (ex) { + if (ex.name === 'ConstraintError') { + console.warn('The database "' + dbInfo.name + '"' + ' has been upgraded from version ' + e.oldVersion + ' to version ' + e.newVersion + ', but the storage "' + dbInfo.storeName + '" already exists.'); + } else { + throw ex; + } + } + }; + } + + openreq.onerror = function (e) { + e.preventDefault(); + reject(openreq.error); + }; + + openreq.onsuccess = function () { + resolve(openreq.result); + _advanceReadiness(dbInfo); + }; + }); +} + +function _getOriginalConnection(dbInfo) { + return _getConnection(dbInfo, false); +} + +function _getUpgradedConnection(dbInfo) { + return _getConnection(dbInfo, true); +} + +function _isUpgradeNeeded(dbInfo, defaultVersion) { + if (!dbInfo.db) { + return true; + } + + var isNewStore = !dbInfo.db.objectStoreNames.contains(dbInfo.storeName); + var isDowngrade = dbInfo.version < dbInfo.db.version; + var isUpgrade = dbInfo.version > dbInfo.db.version; + + if (isDowngrade) { + // If the version is not the default one + // then warn for impossible downgrade. + if (dbInfo.version !== defaultVersion) { + console.warn('The database "' + dbInfo.name + '"' + " can't be downgraded from version " + dbInfo.db.version + ' to version ' + dbInfo.version + '.'); + } + // Align the versions to prevent errors. + dbInfo.version = dbInfo.db.version; + } + + if (isUpgrade || isNewStore) { + // If the store is new then increment the version (if needed). + // This will trigger an "upgradeneeded" event which is required + // for creating a store. + if (isNewStore) { + var incVersion = dbInfo.db.version + 1; + if (incVersion > dbInfo.version) { + dbInfo.version = incVersion; + } + } + + return true; + } + + return false; +} + +// encode a blob for indexeddb engines that don't support blobs +function _encodeBlob(blob) { + return new Promise$1(function (resolve, reject) { + var reader = new FileReader(); + reader.onerror = reject; + reader.onloadend = function (e) { + var base64 = btoa(e.target.result || ''); + resolve({ + __local_forage_encoded_blob: true, + data: base64, + type: blob.type + }); + }; + reader.readAsBinaryString(blob); + }); +} + +// decode an encoded blob +function _decodeBlob(encodedBlob) { + var arrayBuff = _binStringToArrayBuffer(atob(encodedBlob.data)); + return createBlob([arrayBuff], { type: encodedBlob.type }); +} + +// is this one of our fancy encoded blobs? +function _isEncodedBlob(value) { + return value && value.__local_forage_encoded_blob; +} + +// Specialize the default `ready()` function by making it dependent +// on the current database operations. Thus, the driver will be actually +// ready when it's been initialized (default) *and* there are no pending +// operations on the database (initiated by some other instances). +function _fullyReady(callback) { + var self = this; + + var promise = self._initReady().then(function () { + var dbContext = dbContexts[self._dbInfo.name]; + + if (dbContext && dbContext.dbReady) { + return dbContext.dbReady; + } + }); + + executeTwoCallbacks(promise, callback, callback); + return promise; +} + +// Try to establish a new db connection to replace the +// current one which is broken (i.e. experiencing +// InvalidStateError while creating a transaction). +function _tryReconnect(dbInfo) { + _deferReadiness(dbInfo); + + var dbContext = dbContexts[dbInfo.name]; + var forages = dbContext.forages; + + for (var i = 0; i < forages.length; i++) { + var forage = forages[i]; + if (forage._dbInfo.db) { + forage._dbInfo.db.close(); + forage._dbInfo.db = null; + } + } + dbInfo.db = null; + + return _getOriginalConnection(dbInfo).then(function (db) { + dbInfo.db = db; + if (_isUpgradeNeeded(dbInfo)) { + // Reopen the database for upgrading. + return _getUpgradedConnection(dbInfo); + } + return db; + }).then(function (db) { + // store the latest db reference + // in case the db was upgraded + dbInfo.db = dbContext.db = db; + for (var i = 0; i < forages.length; i++) { + forages[i]._dbInfo.db = db; + } + })["catch"](function (err) { + _rejectReadiness(dbInfo, err); + throw err; + }); +} + +// FF doesn't like Promises (micro-tasks) and IDDB store operations, +// so we have to do it with callbacks +function createTransaction(dbInfo, mode, callback, retries) { + if (retries === undefined) { + retries = 1; + } + + try { + var tx = dbInfo.db.transaction(dbInfo.storeName, mode); + callback(null, tx); + } catch (err) { + if (retries > 0 && (!dbInfo.db || err.name === 'InvalidStateError' || err.name === 'NotFoundError')) { + return Promise$1.resolve().then(function () { + if (!dbInfo.db || err.name === 'NotFoundError' && !dbInfo.db.objectStoreNames.contains(dbInfo.storeName) && dbInfo.version <= dbInfo.db.version) { + // increase the db version, to create the new ObjectStore + if (dbInfo.db) { + dbInfo.version = dbInfo.db.version + 1; + } + // Reopen the database for upgrading. + return _getUpgradedConnection(dbInfo); + } + }).then(function () { + return _tryReconnect(dbInfo).then(function () { + createTransaction(dbInfo, mode, callback, retries - 1); + }); + })["catch"](callback); + } + + callback(err); + } +} + +function createDbContext() { + return { + // Running localForages sharing a database. + forages: [], + // Shared database. + db: null, + // Database readiness (promise). + dbReady: null, + // Deferred operations on the database. + deferredOperations: [] + }; +} + +// Open the IndexedDB database (automatically creates one if one didn't +// previously exist), using any options set in the config. +function _initStorage(options) { + var self = this; + var dbInfo = { + db: null + }; + + if (options) { + for (var i in options) { + dbInfo[i] = options[i]; + } + } + + // Get the current context of the database; + var dbContext = dbContexts[dbInfo.name]; + + // ...or create a new context. + if (!dbContext) { + dbContext = createDbContext(); + // Register the new context in the global container. + dbContexts[dbInfo.name] = dbContext; + } + + // Register itself as a running localForage in the current context. + dbContext.forages.push(self); + + // Replace the default `ready()` function with the specialized one. + if (!self._initReady) { + self._initReady = self.ready; + self.ready = _fullyReady; + } + + // Create an array of initialization states of the related localForages. + var initPromises = []; + + function ignoreErrors() { + // Don't handle errors here, + // just makes sure related localForages aren't pending. + return Promise$1.resolve(); + } + + for (var j = 0; j < dbContext.forages.length; j++) { + var forage = dbContext.forages[j]; + if (forage !== self) { + // Don't wait for itself... + initPromises.push(forage._initReady()["catch"](ignoreErrors)); + } + } + + // Take a snapshot of the related localForages. + var forages = dbContext.forages.slice(0); + + // Initialize the connection process only when + // all the related localForages aren't pending. + return Promise$1.all(initPromises).then(function () { + dbInfo.db = dbContext.db; + // Get the connection or open a new one without upgrade. + return _getOriginalConnection(dbInfo); + }).then(function (db) { + dbInfo.db = db; + if (_isUpgradeNeeded(dbInfo, self._defaultConfig.version)) { + // Reopen the database for upgrading. + return _getUpgradedConnection(dbInfo); + } + return db; + }).then(function (db) { + dbInfo.db = dbContext.db = db; + self._dbInfo = dbInfo; + // Share the final connection amongst related localForages. + for (var k = 0; k < forages.length; k++) { + var forage = forages[k]; + if (forage !== self) { + // Self is already up-to-date. + forage._dbInfo.db = dbInfo.db; + forage._dbInfo.version = dbInfo.version; + } + } + }); +} + +function getItem(key, callback) { + var self = this; + + key = normalizeKey(key); + + var promise = new Promise$1(function (resolve, reject) { + self.ready().then(function () { + createTransaction(self._dbInfo, READ_ONLY, function (err, transaction) { + if (err) { + return reject(err); + } + + try { + var store = transaction.objectStore(self._dbInfo.storeName); + var req = store.get(key); + + req.onsuccess = function () { + var value = req.result; + if (value === undefined) { + value = null; + } + if (_isEncodedBlob(value)) { + value = _decodeBlob(value); + } + resolve(value); + }; + + req.onerror = function () { + reject(req.error); + }; + } catch (e) { + reject(e); + } + }); + })["catch"](reject); + }); + + executeCallback(promise, callback); + return promise; +} + +// Iterate over all items stored in database. +function iterate(iterator, callback) { + var self = this; + + var promise = new Promise$1(function (resolve, reject) { + self.ready().then(function () { + createTransaction(self._dbInfo, READ_ONLY, function (err, transaction) { + if (err) { + return reject(err); + } + + try { + var store = transaction.objectStore(self._dbInfo.storeName); + var req = store.openCursor(); + var iterationNumber = 1; + + req.onsuccess = function () { + var cursor = req.result; + + if (cursor) { + var value = cursor.value; + if (_isEncodedBlob(value)) { + value = _decodeBlob(value); + } + var result = iterator(value, cursor.key, iterationNumber++); + + // when the iterator callback returns any + // (non-`undefined`) value, then we stop + // the iteration immediately + if (result !== void 0) { + resolve(result); + } else { + cursor["continue"](); + } + } else { + resolve(); + } + }; + + req.onerror = function () { + reject(req.error); + }; + } catch (e) { + reject(e); + } + }); + })["catch"](reject); + }); + + executeCallback(promise, callback); + + return promise; +} + +function setItem(key, value, callback) { + var self = this; + + key = normalizeKey(key); + + var promise = new Promise$1(function (resolve, reject) { + var dbInfo; + self.ready().then(function () { + dbInfo = self._dbInfo; + if (toString.call(value) === '[object Blob]') { + return _checkBlobSupport(dbInfo.db).then(function (blobSupport) { + if (blobSupport) { + return value; + } + return _encodeBlob(value); + }); + } + return value; + }).then(function (value) { + createTransaction(self._dbInfo, READ_WRITE, function (err, transaction) { + if (err) { + return reject(err); + } + + try { + var store = transaction.objectStore(self._dbInfo.storeName); + + // The reason we don't _save_ null is because IE 10 does + // not support saving the `null` type in IndexedDB. How + // ironic, given the bug below! + // See: https://github.com/mozilla/localForage/issues/161 + if (value === null) { + value = undefined; + } + + var req = store.put(value, key); + + transaction.oncomplete = function () { + // Cast to undefined so the value passed to + // callback/promise is the same as what one would get out + // of `getItem()` later. This leads to some weirdness + // (setItem('foo', undefined) will return `null`), but + // it's not my fault localStorage is our baseline and that + // it's weird. + if (value === undefined) { + value = null; + } + + resolve(value); + }; + transaction.onabort = transaction.onerror = function () { + var err = req.error ? req.error : req.transaction.error; + reject(err); + }; + } catch (e) { + reject(e); + } + }); + })["catch"](reject); + }); + + executeCallback(promise, callback); + return promise; +} + +function removeItem(key, callback) { + var self = this; + + key = normalizeKey(key); + + var promise = new Promise$1(function (resolve, reject) { + self.ready().then(function () { + createTransaction(self._dbInfo, READ_WRITE, function (err, transaction) { + if (err) { + return reject(err); + } + + try { + var store = transaction.objectStore(self._dbInfo.storeName); + // We use a Grunt task to make this safe for IE and some + // versions of Android (including those used by Cordova). + // Normally IE won't like `.delete()` and will insist on + // using `['delete']()`, but we have a build step that + // fixes this for us now. + var req = store["delete"](key); + transaction.oncomplete = function () { + resolve(); + }; + + transaction.onerror = function () { + reject(req.error); + }; + + // The request will be also be aborted if we've exceeded our storage + // space. + transaction.onabort = function () { + var err = req.error ? req.error : req.transaction.error; + reject(err); + }; + } catch (e) { + reject(e); + } + }); + })["catch"](reject); + }); + + executeCallback(promise, callback); + return promise; +} + +function clear(callback) { + var self = this; + + var promise = new Promise$1(function (resolve, reject) { + self.ready().then(function () { + createTransaction(self._dbInfo, READ_WRITE, function (err, transaction) { + if (err) { + return reject(err); + } + + try { + var store = transaction.objectStore(self._dbInfo.storeName); + var req = store.clear(); + + transaction.oncomplete = function () { + resolve(); + }; + + transaction.onabort = transaction.onerror = function () { + var err = req.error ? req.error : req.transaction.error; + reject(err); + }; + } catch (e) { + reject(e); + } + }); + })["catch"](reject); + }); + + executeCallback(promise, callback); + return promise; +} + +function length(callback) { + var self = this; + + var promise = new Promise$1(function (resolve, reject) { + self.ready().then(function () { + createTransaction(self._dbInfo, READ_ONLY, function (err, transaction) { + if (err) { + return reject(err); + } + + try { + var store = transaction.objectStore(self._dbInfo.storeName); + var req = store.count(); + + req.onsuccess = function () { + resolve(req.result); + }; + + req.onerror = function () { + reject(req.error); + }; + } catch (e) { + reject(e); + } + }); + })["catch"](reject); + }); + + executeCallback(promise, callback); + return promise; +} + +function key(n, callback) { + var self = this; + + var promise = new Promise$1(function (resolve, reject) { + if (n < 0) { + resolve(null); + + return; + } + + self.ready().then(function () { + createTransaction(self._dbInfo, READ_ONLY, function (err, transaction) { + if (err) { + return reject(err); + } + + try { + var store = transaction.objectStore(self._dbInfo.storeName); + var advanced = false; + var req = store.openKeyCursor(); + + req.onsuccess = function () { + var cursor = req.result; + if (!cursor) { + // this means there weren't enough keys + resolve(null); + + return; + } + + if (n === 0) { + // We have the first key, return it if that's what they + // wanted. + resolve(cursor.key); + } else { + if (!advanced) { + // Otherwise, ask the cursor to skip ahead n + // records. + advanced = true; + cursor.advance(n); + } else { + // When we get here, we've got the nth key. + resolve(cursor.key); + } + } + }; + + req.onerror = function () { + reject(req.error); + }; + } catch (e) { + reject(e); + } + }); + })["catch"](reject); + }); + + executeCallback(promise, callback); + return promise; +} + +function keys(callback) { + var self = this; + + var promise = new Promise$1(function (resolve, reject) { + self.ready().then(function () { + createTransaction(self._dbInfo, READ_ONLY, function (err, transaction) { + if (err) { + return reject(err); + } + + try { + var store = transaction.objectStore(self._dbInfo.storeName); + var req = store.openKeyCursor(); + var keys = []; + + req.onsuccess = function () { + var cursor = req.result; + + if (!cursor) { + resolve(keys); + return; + } + + keys.push(cursor.key); + cursor["continue"](); + }; + + req.onerror = function () { + reject(req.error); + }; + } catch (e) { + reject(e); + } + }); + })["catch"](reject); + }); + + executeCallback(promise, callback); + return promise; +} + +function dropInstance(options, callback) { + callback = getCallback.apply(this, arguments); + + var currentConfig = this.config(); + options = typeof options !== 'function' && options || {}; + if (!options.name) { + options.name = options.name || currentConfig.name; + options.storeName = options.storeName || currentConfig.storeName; + } + + var self = this; + var promise; + if (!options.name) { + promise = Promise$1.reject('Invalid arguments'); + } else { + var isCurrentDb = options.name === currentConfig.name && self._dbInfo.db; + + var dbPromise = isCurrentDb ? Promise$1.resolve(self._dbInfo.db) : _getOriginalConnection(options).then(function (db) { + var dbContext = dbContexts[options.name]; + var forages = dbContext.forages; + dbContext.db = db; + for (var i = 0; i < forages.length; i++) { + forages[i]._dbInfo.db = db; + } + return db; + }); + + if (!options.storeName) { + promise = dbPromise.then(function (db) { + _deferReadiness(options); + + var dbContext = dbContexts[options.name]; + var forages = dbContext.forages; + + db.close(); + for (var i = 0; i < forages.length; i++) { + var forage = forages[i]; + forage._dbInfo.db = null; + } + + var dropDBPromise = new Promise$1(function (resolve, reject) { + var req = idb.deleteDatabase(options.name); + + req.onerror = req.onblocked = function (err) { + var db = req.result; + if (db) { + db.close(); + } + reject(err); + }; + + req.onsuccess = function () { + var db = req.result; + if (db) { + db.close(); + } + resolve(db); + }; + }); + + return dropDBPromise.then(function (db) { + dbContext.db = db; + for (var i = 0; i < forages.length; i++) { + var _forage = forages[i]; + _advanceReadiness(_forage._dbInfo); + } + })["catch"](function (err) { + (_rejectReadiness(options, err) || Promise$1.resolve())["catch"](function () {}); + throw err; + }); + }); + } else { + promise = dbPromise.then(function (db) { + if (!db.objectStoreNames.contains(options.storeName)) { + return; + } + + var newVersion = db.version + 1; + + _deferReadiness(options); + + var dbContext = dbContexts[options.name]; + var forages = dbContext.forages; + + db.close(); + for (var i = 0; i < forages.length; i++) { + var forage = forages[i]; + forage._dbInfo.db = null; + forage._dbInfo.version = newVersion; + } + + var dropObjectPromise = new Promise$1(function (resolve, reject) { + var req = idb.open(options.name, newVersion); + + req.onerror = function (err) { + var db = req.result; + db.close(); + reject(err); + }; + + req.onupgradeneeded = function () { + var db = req.result; + db.deleteObjectStore(options.storeName); + }; + + req.onsuccess = function () { + var db = req.result; + db.close(); + resolve(db); + }; + }); + + return dropObjectPromise.then(function (db) { + dbContext.db = db; + for (var j = 0; j < forages.length; j++) { + var _forage2 = forages[j]; + _forage2._dbInfo.db = db; + _advanceReadiness(_forage2._dbInfo); + } + })["catch"](function (err) { + (_rejectReadiness(options, err) || Promise$1.resolve())["catch"](function () {}); + throw err; + }); + }); + } + } + + executeCallback(promise, callback); + return promise; +} + +var asyncStorage = { + _driver: 'asyncStorage', + _initStorage: _initStorage, + _support: isIndexedDBValid(), + iterate: iterate, + getItem: getItem, + setItem: setItem, + removeItem: removeItem, + clear: clear, + length: length, + key: key, + keys: keys, + dropInstance: dropInstance +}; + +function isWebSQLValid() { + return typeof openDatabase === 'function'; +} + +// Sadly, the best way to save binary data in WebSQL/localStorage is serializing +// it to Base64, so this is how we store it to prevent very strange errors with less +// verbose ways of binary <-> string data storage. +var BASE_CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; + +var BLOB_TYPE_PREFIX = '~~local_forage_type~'; +var BLOB_TYPE_PREFIX_REGEX = /^~~local_forage_type~([^~]+)~/; + +var SERIALIZED_MARKER = '__lfsc__:'; +var SERIALIZED_MARKER_LENGTH = SERIALIZED_MARKER.length; + +// OMG the serializations! +var TYPE_ARRAYBUFFER = 'arbf'; +var TYPE_BLOB = 'blob'; +var TYPE_INT8ARRAY = 'si08'; +var TYPE_UINT8ARRAY = 'ui08'; +var TYPE_UINT8CLAMPEDARRAY = 'uic8'; +var TYPE_INT16ARRAY = 'si16'; +var TYPE_INT32ARRAY = 'si32'; +var TYPE_UINT16ARRAY = 'ur16'; +var TYPE_UINT32ARRAY = 'ui32'; +var TYPE_FLOAT32ARRAY = 'fl32'; +var TYPE_FLOAT64ARRAY = 'fl64'; +var TYPE_SERIALIZED_MARKER_LENGTH = SERIALIZED_MARKER_LENGTH + TYPE_ARRAYBUFFER.length; + +var toString$1 = Object.prototype.toString; + +function stringToBuffer(serializedString) { + // Fill the string into a ArrayBuffer. + var bufferLength = serializedString.length * 0.75; + var len = serializedString.length; + var i; + var p = 0; + var encoded1, encoded2, encoded3, encoded4; + + if (serializedString[serializedString.length - 1] === '=') { + bufferLength--; + if (serializedString[serializedString.length - 2] === '=') { + bufferLength--; + } + } + + var buffer = new ArrayBuffer(bufferLength); + var bytes = new Uint8Array(buffer); + + for (i = 0; i < len; i += 4) { + encoded1 = BASE_CHARS.indexOf(serializedString[i]); + encoded2 = BASE_CHARS.indexOf(serializedString[i + 1]); + encoded3 = BASE_CHARS.indexOf(serializedString[i + 2]); + encoded4 = BASE_CHARS.indexOf(serializedString[i + 3]); + + /*jslint bitwise: true */ + bytes[p++] = encoded1 << 2 | encoded2 >> 4; + bytes[p++] = (encoded2 & 15) << 4 | encoded3 >> 2; + bytes[p++] = (encoded3 & 3) << 6 | encoded4 & 63; + } + return buffer; +} + +// Converts a buffer to a string to store, serialized, in the backend +// storage library. +function bufferToString(buffer) { + // base64-arraybuffer + var bytes = new Uint8Array(buffer); + var base64String = ''; + var i; + + for (i = 0; i < bytes.length; i += 3) { + /*jslint bitwise: true */ + base64String += BASE_CHARS[bytes[i] >> 2]; + base64String += BASE_CHARS[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4]; + base64String += BASE_CHARS[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6]; + base64String += BASE_CHARS[bytes[i + 2] & 63]; + } + + if (bytes.length % 3 === 2) { + base64String = base64String.substring(0, base64String.length - 1) + '='; + } else if (bytes.length % 3 === 1) { + base64String = base64String.substring(0, base64String.length - 2) + '=='; + } + + return base64String; +} + +// Serialize a value, afterwards executing a callback (which usually +// instructs the `setItem()` callback/promise to be executed). This is how +// we store binary data with localStorage. +function serialize(value, callback) { + var valueType = ''; + if (value) { + valueType = toString$1.call(value); + } + + // Cannot use `value instanceof ArrayBuffer` or such here, as these + // checks fail when running the tests using casper.js... + // + // TODO: See why those tests fail and use a better solution. + if (value && (valueType === '[object ArrayBuffer]' || value.buffer && toString$1.call(value.buffer) === '[object ArrayBuffer]')) { + // Convert binary arrays to a string and prefix the string with + // a special marker. + var buffer; + var marker = SERIALIZED_MARKER; + + if (value instanceof ArrayBuffer) { + buffer = value; + marker += TYPE_ARRAYBUFFER; + } else { + buffer = value.buffer; + + if (valueType === '[object Int8Array]') { + marker += TYPE_INT8ARRAY; + } else if (valueType === '[object Uint8Array]') { + marker += TYPE_UINT8ARRAY; + } else if (valueType === '[object Uint8ClampedArray]') { + marker += TYPE_UINT8CLAMPEDARRAY; + } else if (valueType === '[object Int16Array]') { + marker += TYPE_INT16ARRAY; + } else if (valueType === '[object Uint16Array]') { + marker += TYPE_UINT16ARRAY; + } else if (valueType === '[object Int32Array]') { + marker += TYPE_INT32ARRAY; + } else if (valueType === '[object Uint32Array]') { + marker += TYPE_UINT32ARRAY; + } else if (valueType === '[object Float32Array]') { + marker += TYPE_FLOAT32ARRAY; + } else if (valueType === '[object Float64Array]') { + marker += TYPE_FLOAT64ARRAY; + } else { + callback(new Error('Failed to get type for BinaryArray')); + } + } + + callback(marker + bufferToString(buffer)); + } else if (valueType === '[object Blob]') { + // Conver the blob to a binaryArray and then to a string. + var fileReader = new FileReader(); + + fileReader.onload = function () { + // Backwards-compatible prefix for the blob type. + var str = BLOB_TYPE_PREFIX + value.type + '~' + bufferToString(this.result); + + callback(SERIALIZED_MARKER + TYPE_BLOB + str); + }; + + fileReader.readAsArrayBuffer(value); + } else { + try { + callback(JSON.stringify(value)); + } catch (e) { + console.error("Couldn't convert value into a JSON string: ", value); + + callback(null, e); + } + } +} + +// Deserialize data we've inserted into a value column/field. We place +// special markers into our strings to mark them as encoded; this isn't +// as nice as a meta field, but it's the only sane thing we can do whilst +// keeping localStorage support intact. +// +// Oftentimes this will just deserialize JSON content, but if we have a +// special marker (SERIALIZED_MARKER, defined above), we will extract +// some kind of arraybuffer/binary data/typed array out of the string. +function deserialize(value) { + // If we haven't marked this string as being specially serialized (i.e. + // something other than serialized JSON), we can just return it and be + // done with it. + if (value.substring(0, SERIALIZED_MARKER_LENGTH) !== SERIALIZED_MARKER) { + return JSON.parse(value); + } + + // The following code deals with deserializing some kind of Blob or + // TypedArray. First we separate out the type of data we're dealing + // with from the data itself. + var serializedString = value.substring(TYPE_SERIALIZED_MARKER_LENGTH); + var type = value.substring(SERIALIZED_MARKER_LENGTH, TYPE_SERIALIZED_MARKER_LENGTH); + + var blobType; + // Backwards-compatible blob type serialization strategy. + // DBs created with older versions of localForage will simply not have the blob type. + if (type === TYPE_BLOB && BLOB_TYPE_PREFIX_REGEX.test(serializedString)) { + var matcher = serializedString.match(BLOB_TYPE_PREFIX_REGEX); + blobType = matcher[1]; + serializedString = serializedString.substring(matcher[0].length); + } + var buffer = stringToBuffer(serializedString); + + // Return the right type based on the code/type set during + // serialization. + switch (type) { + case TYPE_ARRAYBUFFER: + return buffer; + case TYPE_BLOB: + return createBlob([buffer], { type: blobType }); + case TYPE_INT8ARRAY: + return new Int8Array(buffer); + case TYPE_UINT8ARRAY: + return new Uint8Array(buffer); + case TYPE_UINT8CLAMPEDARRAY: + return new Uint8ClampedArray(buffer); + case TYPE_INT16ARRAY: + return new Int16Array(buffer); + case TYPE_UINT16ARRAY: + return new Uint16Array(buffer); + case TYPE_INT32ARRAY: + return new Int32Array(buffer); + case TYPE_UINT32ARRAY: + return new Uint32Array(buffer); + case TYPE_FLOAT32ARRAY: + return new Float32Array(buffer); + case TYPE_FLOAT64ARRAY: + return new Float64Array(buffer); + default: + throw new Error('Unkown type: ' + type); + } +} + +var localforageSerializer = { + serialize: serialize, + deserialize: deserialize, + stringToBuffer: stringToBuffer, + bufferToString: bufferToString +}; + +/* + * Includes code from: + * + * base64-arraybuffer + * https://github.com/niklasvh/base64-arraybuffer + * + * Copyright (c) 2012 Niklas von Hertzen + * Licensed under the MIT license. + */ + +function createDbTable(t, dbInfo, callback, errorCallback) { + t.executeSql('CREATE TABLE IF NOT EXISTS ' + dbInfo.storeName + ' ' + '(id INTEGER PRIMARY KEY, key unique, value)', [], callback, errorCallback); +} + +// Open the WebSQL database (automatically creates one if one didn't +// previously exist), using any options set in the config. +function _initStorage$1(options) { + var self = this; + var dbInfo = { + db: null + }; + + if (options) { + for (var i in options) { + dbInfo[i] = typeof options[i] !== 'string' ? options[i].toString() : options[i]; + } + } + + var dbInfoPromise = new Promise$1(function (resolve, reject) { + // Open the database; the openDatabase API will automatically + // create it for us if it doesn't exist. + try { + dbInfo.db = openDatabase(dbInfo.name, String(dbInfo.version), dbInfo.description, dbInfo.size); + } catch (e) { + return reject(e); + } + + // Create our key/value table if it doesn't exist. + dbInfo.db.transaction(function (t) { + createDbTable(t, dbInfo, function () { + self._dbInfo = dbInfo; + resolve(); + }, function (t, error) { + reject(error); + }); + }, reject); + }); + + dbInfo.serializer = localforageSerializer; + return dbInfoPromise; +} + +function tryExecuteSql(t, dbInfo, sqlStatement, args, callback, errorCallback) { + t.executeSql(sqlStatement, args, callback, function (t, error) { + if (error.code === error.SYNTAX_ERR) { + t.executeSql('SELECT name FROM sqlite_master ' + "WHERE type='table' AND name = ?", [dbInfo.storeName], function (t, results) { + if (!results.rows.length) { + // if the table is missing (was deleted) + // re-create it table and retry + createDbTable(t, dbInfo, function () { + t.executeSql(sqlStatement, args, callback, errorCallback); + }, errorCallback); + } else { + errorCallback(t, error); + } + }, errorCallback); + } else { + errorCallback(t, error); + } + }, errorCallback); +} + +function getItem$1(key, callback) { + var self = this; + + key = normalizeKey(key); + + var promise = new Promise$1(function (resolve, reject) { + self.ready().then(function () { + var dbInfo = self._dbInfo; + dbInfo.db.transaction(function (t) { + tryExecuteSql(t, dbInfo, 'SELECT * FROM ' + dbInfo.storeName + ' WHERE key = ? LIMIT 1', [key], function (t, results) { + var result = results.rows.length ? results.rows.item(0).value : null; + + // Check to see if this is serialized content we need to + // unpack. + if (result) { + result = dbInfo.serializer.deserialize(result); + } + + resolve(result); + }, function (t, error) { + reject(error); + }); + }); + })["catch"](reject); + }); + + executeCallback(promise, callback); + return promise; +} + +function iterate$1(iterator, callback) { + var self = this; + + var promise = new Promise$1(function (resolve, reject) { + self.ready().then(function () { + var dbInfo = self._dbInfo; + + dbInfo.db.transaction(function (t) { + tryExecuteSql(t, dbInfo, 'SELECT * FROM ' + dbInfo.storeName, [], function (t, results) { + var rows = results.rows; + var length = rows.length; + + for (var i = 0; i < length; i++) { + var item = rows.item(i); + var result = item.value; + + // Check to see if this is serialized content + // we need to unpack. + if (result) { + result = dbInfo.serializer.deserialize(result); + } + + result = iterator(result, item.key, i + 1); + + // void(0) prevents problems with redefinition + // of `undefined`. + if (result !== void 0) { + resolve(result); + return; + } + } + + resolve(); + }, function (t, error) { + reject(error); + }); + }); + })["catch"](reject); + }); + + executeCallback(promise, callback); + return promise; +} + +function _setItem(key, value, callback, retriesLeft) { + var self = this; + + key = normalizeKey(key); + + var promise = new Promise$1(function (resolve, reject) { + self.ready().then(function () { + // The localStorage API doesn't return undefined values in an + // "expected" way, so undefined is always cast to null in all + // drivers. See: https://github.com/mozilla/localForage/pull/42 + if (value === undefined) { + value = null; + } + + // Save the original value to pass to the callback. + var originalValue = value; + + var dbInfo = self._dbInfo; + dbInfo.serializer.serialize(value, function (value, error) { + if (error) { + reject(error); + } else { + dbInfo.db.transaction(function (t) { + tryExecuteSql(t, dbInfo, 'INSERT OR REPLACE INTO ' + dbInfo.storeName + ' ' + '(key, value) VALUES (?, ?)', [key, value], function () { + resolve(originalValue); + }, function (t, error) { + reject(error); + }); + }, function (sqlError) { + // The transaction failed; check + // to see if it's a quota error. + if (sqlError.code === sqlError.QUOTA_ERR) { + // We reject the callback outright for now, but + // it's worth trying to re-run the transaction. + // Even if the user accepts the prompt to use + // more storage on Safari, this error will + // be called. + // + // Try to re-run the transaction. + if (retriesLeft > 0) { + resolve(_setItem.apply(self, [key, originalValue, callback, retriesLeft - 1])); + return; + } + reject(sqlError); + } + }); + } + }); + })["catch"](reject); + }); + + executeCallback(promise, callback); + return promise; +} + +function setItem$1(key, value, callback) { + return _setItem.apply(this, [key, value, callback, 1]); +} + +function removeItem$1(key, callback) { + var self = this; + + key = normalizeKey(key); + + var promise = new Promise$1(function (resolve, reject) { + self.ready().then(function () { + var dbInfo = self._dbInfo; + dbInfo.db.transaction(function (t) { + tryExecuteSql(t, dbInfo, 'DELETE FROM ' + dbInfo.storeName + ' WHERE key = ?', [key], function () { + resolve(); + }, function (t, error) { + reject(error); + }); + }); + })["catch"](reject); + }); + + executeCallback(promise, callback); + return promise; +} + +// Deletes every item in the table. +// TODO: Find out if this resets the AUTO_INCREMENT number. +function clear$1(callback) { + var self = this; + + var promise = new Promise$1(function (resolve, reject) { + self.ready().then(function () { + var dbInfo = self._dbInfo; + dbInfo.db.transaction(function (t) { + tryExecuteSql(t, dbInfo, 'DELETE FROM ' + dbInfo.storeName, [], function () { + resolve(); + }, function (t, error) { + reject(error); + }); + }); + })["catch"](reject); + }); + + executeCallback(promise, callback); + return promise; +} + +// Does a simple `COUNT(key)` to get the number of items stored in +// localForage. +function length$1(callback) { + var self = this; + + var promise = new Promise$1(function (resolve, reject) { + self.ready().then(function () { + var dbInfo = self._dbInfo; + dbInfo.db.transaction(function (t) { + // Ahhh, SQL makes this one soooooo easy. + tryExecuteSql(t, dbInfo, 'SELECT COUNT(key) as c FROM ' + dbInfo.storeName, [], function (t, results) { + var result = results.rows.item(0).c; + resolve(result); + }, function (t, error) { + reject(error); + }); + }); + })["catch"](reject); + }); + + executeCallback(promise, callback); + return promise; +} + +// Return the key located at key index X; essentially gets the key from a +// `WHERE id = ?`. This is the most efficient way I can think to implement +// this rarely-used (in my experience) part of the API, but it can seem +// inconsistent, because we do `INSERT OR REPLACE INTO` on `setItem()`, so +// the ID of each key will change every time it's updated. Perhaps a stored +// procedure for the `setItem()` SQL would solve this problem? +// TODO: Don't change ID on `setItem()`. +function key$1(n, callback) { + var self = this; + + var promise = new Promise$1(function (resolve, reject) { + self.ready().then(function () { + var dbInfo = self._dbInfo; + dbInfo.db.transaction(function (t) { + tryExecuteSql(t, dbInfo, 'SELECT key FROM ' + dbInfo.storeName + ' WHERE id = ? LIMIT 1', [n + 1], function (t, results) { + var result = results.rows.length ? results.rows.item(0).key : null; + resolve(result); + }, function (t, error) { + reject(error); + }); + }); + })["catch"](reject); + }); + + executeCallback(promise, callback); + return promise; +} + +function keys$1(callback) { + var self = this; + + var promise = new Promise$1(function (resolve, reject) { + self.ready().then(function () { + var dbInfo = self._dbInfo; + dbInfo.db.transaction(function (t) { + tryExecuteSql(t, dbInfo, 'SELECT key FROM ' + dbInfo.storeName, [], function (t, results) { + var keys = []; + + for (var i = 0; i < results.rows.length; i++) { + keys.push(results.rows.item(i).key); + } + + resolve(keys); + }, function (t, error) { + reject(error); + }); + }); + })["catch"](reject); + }); + + executeCallback(promise, callback); + return promise; +} + +// https://www.w3.org/TR/webdatabase/#databases +// > There is no way to enumerate or delete the databases available for an origin from this API. +function getAllStoreNames(db) { + return new Promise$1(function (resolve, reject) { + db.transaction(function (t) { + t.executeSql('SELECT name FROM sqlite_master ' + "WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'", [], function (t, results) { + var storeNames = []; + + for (var i = 0; i < results.rows.length; i++) { + storeNames.push(results.rows.item(i).name); + } + + resolve({ + db: db, + storeNames: storeNames + }); + }, function (t, error) { + reject(error); + }); + }, function (sqlError) { + reject(sqlError); + }); + }); +} + +function dropInstance$1(options, callback) { + callback = getCallback.apply(this, arguments); + + var currentConfig = this.config(); + options = typeof options !== 'function' && options || {}; + if (!options.name) { + options.name = options.name || currentConfig.name; + options.storeName = options.storeName || currentConfig.storeName; + } + + var self = this; + var promise; + if (!options.name) { + promise = Promise$1.reject('Invalid arguments'); + } else { + promise = new Promise$1(function (resolve) { + var db; + if (options.name === currentConfig.name) { + // use the db reference of the current instance + db = self._dbInfo.db; + } else { + db = openDatabase(options.name, '', '', 0); + } + + if (!options.storeName) { + // drop all database tables + resolve(getAllStoreNames(db)); + } else { + resolve({ + db: db, + storeNames: [options.storeName] + }); + } + }).then(function (operationInfo) { + return new Promise$1(function (resolve, reject) { + operationInfo.db.transaction(function (t) { + function dropTable(storeName) { + return new Promise$1(function (resolve, reject) { + t.executeSql('DROP TABLE IF EXISTS ' + storeName, [], function () { + resolve(); + }, function (t, error) { + reject(error); + }); + }); + } + + var operations = []; + for (var i = 0, len = operationInfo.storeNames.length; i < len; i++) { + operations.push(dropTable(operationInfo.storeNames[i])); + } + + Promise$1.all(operations).then(function () { + resolve(); + })["catch"](function (e) { + reject(e); + }); + }, function (sqlError) { + reject(sqlError); + }); + }); + }); + } + + executeCallback(promise, callback); + return promise; +} + +var webSQLStorage = { + _driver: 'webSQLStorage', + _initStorage: _initStorage$1, + _support: isWebSQLValid(), + iterate: iterate$1, + getItem: getItem$1, + setItem: setItem$1, + removeItem: removeItem$1, + clear: clear$1, + length: length$1, + key: key$1, + keys: keys$1, + dropInstance: dropInstance$1 +}; + +function isLocalStorageValid() { + try { + return typeof localStorage !== 'undefined' && 'setItem' in localStorage && + // in IE8 typeof localStorage.setItem === 'object' + !!localStorage.setItem; + } catch (e) { + return false; + } +} + +function _getKeyPrefix(options, defaultConfig) { + var keyPrefix = options.name + '/'; + + if (options.storeName !== defaultConfig.storeName) { + keyPrefix += options.storeName + '/'; + } + return keyPrefix; +} + +// Check if localStorage throws when saving an item +function checkIfLocalStorageThrows() { + var localStorageTestKey = '_localforage_support_test'; + + try { + localStorage.setItem(localStorageTestKey, true); + localStorage.removeItem(localStorageTestKey); + + return false; + } catch (e) { + return true; + } +} + +// Check if localStorage is usable and allows to save an item +// This method checks if localStorage is usable in Safari Private Browsing +// mode, or in any other case where the available quota for localStorage +// is 0 and there wasn't any saved items yet. +function _isLocalStorageUsable() { + return !checkIfLocalStorageThrows() || localStorage.length > 0; +} + +// Config the localStorage backend, using options set in the config. +function _initStorage$2(options) { + var self = this; + var dbInfo = {}; + if (options) { + for (var i in options) { + dbInfo[i] = options[i]; + } + } + + dbInfo.keyPrefix = _getKeyPrefix(options, self._defaultConfig); + + if (!_isLocalStorageUsable()) { + return Promise$1.reject(); + } + + self._dbInfo = dbInfo; + dbInfo.serializer = localforageSerializer; + + return Promise$1.resolve(); +} + +// Remove all keys from the datastore, effectively destroying all data in +// the app's key/value store! +function clear$2(callback) { + var self = this; + var promise = self.ready().then(function () { + var keyPrefix = self._dbInfo.keyPrefix; + + for (var i = localStorage.length - 1; i >= 0; i--) { + var key = localStorage.key(i); + + if (key.indexOf(keyPrefix) === 0) { + localStorage.removeItem(key); + } + } + }); + + executeCallback(promise, callback); + return promise; +} + +// Retrieve an item from the store. Unlike the original async_storage +// library in Gaia, we don't modify return values at all. If a key's value +// is `undefined`, we pass that value to the callback function. +function getItem$2(key, callback) { + var self = this; + + key = normalizeKey(key); + + var promise = self.ready().then(function () { + var dbInfo = self._dbInfo; + var result = localStorage.getItem(dbInfo.keyPrefix + key); + + // If a result was found, parse it from the serialized + // string into a JS object. If result isn't truthy, the key + // is likely undefined and we'll pass it straight to the + // callback. + if (result) { + result = dbInfo.serializer.deserialize(result); + } + + return result; + }); + + executeCallback(promise, callback); + return promise; +} + +// Iterate over all items in the store. +function iterate$2(iterator, callback) { + var self = this; + + var promise = self.ready().then(function () { + var dbInfo = self._dbInfo; + var keyPrefix = dbInfo.keyPrefix; + var keyPrefixLength = keyPrefix.length; + var length = localStorage.length; + + // We use a dedicated iterator instead of the `i` variable below + // so other keys we fetch in localStorage aren't counted in + // the `iterationNumber` argument passed to the `iterate()` + // callback. + // + // See: github.com/mozilla/localForage/pull/435#discussion_r38061530 + var iterationNumber = 1; + + for (var i = 0; i < length; i++) { + var key = localStorage.key(i); + if (key.indexOf(keyPrefix) !== 0) { + continue; + } + var value = localStorage.getItem(key); + + // If a result was found, parse it from the serialized + // string into a JS object. If result isn't truthy, the + // key is likely undefined and we'll pass it straight + // to the iterator. + if (value) { + value = dbInfo.serializer.deserialize(value); + } + + value = iterator(value, key.substring(keyPrefixLength), iterationNumber++); + + if (value !== void 0) { + return value; + } + } + }); + + executeCallback(promise, callback); + return promise; +} + +// Same as localStorage's key() method, except takes a callback. +function key$2(n, callback) { + var self = this; + var promise = self.ready().then(function () { + var dbInfo = self._dbInfo; + var result; + try { + result = localStorage.key(n); + } catch (error) { + result = null; + } + + // Remove the prefix from the key, if a key is found. + if (result) { + result = result.substring(dbInfo.keyPrefix.length); + } + + return result; + }); + + executeCallback(promise, callback); + return promise; +} + +function keys$2(callback) { + var self = this; + var promise = self.ready().then(function () { + var dbInfo = self._dbInfo; + var length = localStorage.length; + var keys = []; + + for (var i = 0; i < length; i++) { + var itemKey = localStorage.key(i); + if (itemKey.indexOf(dbInfo.keyPrefix) === 0) { + keys.push(itemKey.substring(dbInfo.keyPrefix.length)); + } + } + + return keys; + }); + + executeCallback(promise, callback); + return promise; +} + +// Supply the number of keys in the datastore to the callback function. +function length$2(callback) { + var self = this; + var promise = self.keys().then(function (keys) { + return keys.length; + }); + + executeCallback(promise, callback); + return promise; +} + +// Remove an item from the store, nice and simple. +function removeItem$2(key, callback) { + var self = this; + + key = normalizeKey(key); + + var promise = self.ready().then(function () { + var dbInfo = self._dbInfo; + localStorage.removeItem(dbInfo.keyPrefix + key); + }); + + executeCallback(promise, callback); + return promise; +} + +// Set a key's value and run an optional callback once the value is set. +// Unlike Gaia's implementation, the callback function is passed the value, +// in case you want to operate on that value only after you're sure it +// saved, or something like that. +function setItem$2(key, value, callback) { + var self = this; + + key = normalizeKey(key); + + var promise = self.ready().then(function () { + // Convert undefined values to null. + // https://github.com/mozilla/localForage/pull/42 + if (value === undefined) { + value = null; + } + + // Save the original value to pass to the callback. + var originalValue = value; + + return new Promise$1(function (resolve, reject) { + var dbInfo = self._dbInfo; + dbInfo.serializer.serialize(value, function (value, error) { + if (error) { + reject(error); + } else { + try { + localStorage.setItem(dbInfo.keyPrefix + key, value); + resolve(originalValue); + } catch (e) { + // localStorage capacity exceeded. + // TODO: Make this a specific error/event. + if (e.name === 'QuotaExceededError' || e.name === 'NS_ERROR_DOM_QUOTA_REACHED') { + reject(e); + } + reject(e); + } + } + }); + }); + }); + + executeCallback(promise, callback); + return promise; +} + +function dropInstance$2(options, callback) { + callback = getCallback.apply(this, arguments); + + options = typeof options !== 'function' && options || {}; + if (!options.name) { + var currentConfig = this.config(); + options.name = options.name || currentConfig.name; + options.storeName = options.storeName || currentConfig.storeName; + } + + var self = this; + var promise; + if (!options.name) { + promise = Promise$1.reject('Invalid arguments'); + } else { + promise = new Promise$1(function (resolve) { + if (!options.storeName) { + resolve(options.name + '/'); + } else { + resolve(_getKeyPrefix(options, self._defaultConfig)); + } + }).then(function (keyPrefix) { + for (var i = localStorage.length - 1; i >= 0; i--) { + var key = localStorage.key(i); + + if (key.indexOf(keyPrefix) === 0) { + localStorage.removeItem(key); + } + } + }); + } + + executeCallback(promise, callback); + return promise; +} + +var localStorageWrapper = { + _driver: 'localStorageWrapper', + _initStorage: _initStorage$2, + _support: isLocalStorageValid(), + iterate: iterate$2, + getItem: getItem$2, + setItem: setItem$2, + removeItem: removeItem$2, + clear: clear$2, + length: length$2, + key: key$2, + keys: keys$2, + dropInstance: dropInstance$2 +}; + +var sameValue = function sameValue(x, y) { + return x === y || typeof x === 'number' && typeof y === 'number' && isNaN(x) && isNaN(y); +}; + +var includes = function includes(array, searchElement) { + var len = array.length; + var i = 0; + while (i < len) { + if (sameValue(array[i], searchElement)) { + return true; + } + i++; + } + + return false; +}; + +var isArray = Array.isArray || function (arg) { + return Object.prototype.toString.call(arg) === '[object Array]'; +}; + +// Drivers are stored here when `defineDriver()` is called. +// They are shared across all instances of localForage. +var DefinedDrivers = {}; + +var DriverSupport = {}; + +var DefaultDrivers = { + INDEXEDDB: asyncStorage, + WEBSQL: webSQLStorage, + LOCALSTORAGE: localStorageWrapper +}; + +var DefaultDriverOrder = [DefaultDrivers.INDEXEDDB._driver, DefaultDrivers.WEBSQL._driver, DefaultDrivers.LOCALSTORAGE._driver]; + +var OptionalDriverMethods = ['dropInstance']; + +var LibraryMethods = ['clear', 'getItem', 'iterate', 'key', 'keys', 'length', 'removeItem', 'setItem'].concat(OptionalDriverMethods); + +var DefaultConfig = { + description: '', + driver: DefaultDriverOrder.slice(), + name: 'localforage', + // Default DB size is _JUST UNDER_ 5MB, as it's the highest size + // we can use without a prompt. + size: 4980736, + storeName: 'keyvaluepairs', + version: 1.0 +}; + +function callWhenReady(localForageInstance, libraryMethod) { + localForageInstance[libraryMethod] = function () { + var _args = arguments; + return localForageInstance.ready().then(function () { + return localForageInstance[libraryMethod].apply(localForageInstance, _args); + }); + }; +} + +function extend() { + for (var i = 1; i < arguments.length; i++) { + var arg = arguments[i]; + + if (arg) { + for (var _key in arg) { + if (arg.hasOwnProperty(_key)) { + if (isArray(arg[_key])) { + arguments[0][_key] = arg[_key].slice(); + } else { + arguments[0][_key] = arg[_key]; + } + } + } + } + } + + return arguments[0]; +} + +var LocalForage = function () { + function LocalForage(options) { + _classCallCheck(this, LocalForage); + + for (var driverTypeKey in DefaultDrivers) { + if (DefaultDrivers.hasOwnProperty(driverTypeKey)) { + var driver = DefaultDrivers[driverTypeKey]; + var driverName = driver._driver; + this[driverTypeKey] = driverName; + + if (!DefinedDrivers[driverName]) { + // we don't need to wait for the promise, + // since the default drivers can be defined + // in a blocking manner + this.defineDriver(driver); + } + } + } + + this._defaultConfig = extend({}, DefaultConfig); + this._config = extend({}, this._defaultConfig, options); + this._driverSet = null; + this._initDriver = null; + this._ready = false; + this._dbInfo = null; + + this._wrapLibraryMethodsWithReady(); + this.setDriver(this._config.driver)["catch"](function () {}); + } + + // Set any config values for localForage; can be called anytime before + // the first API call (e.g. `getItem`, `setItem`). + // We loop through options so we don't overwrite existing config + // values. + + + LocalForage.prototype.config = function config(options) { + // If the options argument is an object, we use it to set values. + // Otherwise, we return either a specified config value or all + // config values. + if ((typeof options === 'undefined' ? 'undefined' : _typeof(options)) === 'object') { + // If localforage is ready and fully initialized, we can't set + // any new configuration values. Instead, we return an error. + if (this._ready) { + return new Error("Can't call config() after localforage " + 'has been used.'); + } + + for (var i in options) { + if (i === 'storeName') { + options[i] = options[i].replace(/\W/g, '_'); + } + + if (i === 'version' && typeof options[i] !== 'number') { + return new Error('Database version must be a number.'); + } + + this._config[i] = options[i]; + } + + // after all config options are set and + // the driver option is used, try setting it + if ('driver' in options && options.driver) { + return this.setDriver(this._config.driver); + } + + return true; + } else if (typeof options === 'string') { + return this._config[options]; + } else { + return this._config; + } + }; + + // Used to define a custom driver, shared across all instances of + // localForage. + + + LocalForage.prototype.defineDriver = function defineDriver(driverObject, callback, errorCallback) { + var promise = new Promise$1(function (resolve, reject) { + try { + var driverName = driverObject._driver; + var complianceError = new Error('Custom driver not compliant; see ' + 'https://mozilla.github.io/localForage/#definedriver'); + + // A driver name should be defined and not overlap with the + // library-defined, default drivers. + if (!driverObject._driver) { + reject(complianceError); + return; + } + + var driverMethods = LibraryMethods.concat('_initStorage'); + for (var i = 0, len = driverMethods.length; i < len; i++) { + var driverMethodName = driverMethods[i]; + + // when the property is there, + // it should be a method even when optional + var isRequired = !includes(OptionalDriverMethods, driverMethodName); + if ((isRequired || driverObject[driverMethodName]) && typeof driverObject[driverMethodName] !== 'function') { + reject(complianceError); + return; + } + } + + var configureMissingMethods = function configureMissingMethods() { + var methodNotImplementedFactory = function methodNotImplementedFactory(methodName) { + return function () { + var error = new Error('Method ' + methodName + ' is not implemented by the current driver'); + var promise = Promise$1.reject(error); + executeCallback(promise, arguments[arguments.length - 1]); + return promise; + }; + }; + + for (var _i = 0, _len = OptionalDriverMethods.length; _i < _len; _i++) { + var optionalDriverMethod = OptionalDriverMethods[_i]; + if (!driverObject[optionalDriverMethod]) { + driverObject[optionalDriverMethod] = methodNotImplementedFactory(optionalDriverMethod); + } + } + }; + + configureMissingMethods(); + + var setDriverSupport = function setDriverSupport(support) { + if (DefinedDrivers[driverName]) { + console.info('Redefining LocalForage driver: ' + driverName); + } + DefinedDrivers[driverName] = driverObject; + DriverSupport[driverName] = support; + // don't use a then, so that we can define + // drivers that have simple _support methods + // in a blocking manner + resolve(); + }; + + if ('_support' in driverObject) { + if (driverObject._support && typeof driverObject._support === 'function') { + driverObject._support().then(setDriverSupport, reject); + } else { + setDriverSupport(!!driverObject._support); + } + } else { + setDriverSupport(true); + } + } catch (e) { + reject(e); + } + }); + + executeTwoCallbacks(promise, callback, errorCallback); + return promise; + }; + + LocalForage.prototype.driver = function driver() { + return this._driver || null; + }; + + LocalForage.prototype.getDriver = function getDriver(driverName, callback, errorCallback) { + var getDriverPromise = DefinedDrivers[driverName] ? Promise$1.resolve(DefinedDrivers[driverName]) : Promise$1.reject(new Error('Driver not found.')); + + executeTwoCallbacks(getDriverPromise, callback, errorCallback); + return getDriverPromise; + }; + + LocalForage.prototype.getSerializer = function getSerializer(callback) { + var serializerPromise = Promise$1.resolve(localforageSerializer); + executeTwoCallbacks(serializerPromise, callback); + return serializerPromise; + }; + + LocalForage.prototype.ready = function ready(callback) { + var self = this; + + var promise = self._driverSet.then(function () { + if (self._ready === null) { + self._ready = self._initDriver(); + } + + return self._ready; + }); + + executeTwoCallbacks(promise, callback, callback); + return promise; + }; + + LocalForage.prototype.setDriver = function setDriver(drivers, callback, errorCallback) { + var self = this; + + if (!isArray(drivers)) { + drivers = [drivers]; + } + + var supportedDrivers = this._getSupportedDrivers(drivers); + + function setDriverToConfig() { + self._config.driver = self.driver(); + } + + function extendSelfWithDriver(driver) { + self._extend(driver); + setDriverToConfig(); + + self._ready = self._initStorage(self._config); + return self._ready; + } + + function initDriver(supportedDrivers) { + return function () { + var currentDriverIndex = 0; + + function driverPromiseLoop() { + while (currentDriverIndex < supportedDrivers.length) { + var driverName = supportedDrivers[currentDriverIndex]; + currentDriverIndex++; + + self._dbInfo = null; + self._ready = null; + + return self.getDriver(driverName).then(extendSelfWithDriver)["catch"](driverPromiseLoop); + } + + setDriverToConfig(); + var error = new Error('No available storage method found.'); + self._driverSet = Promise$1.reject(error); + return self._driverSet; + } + + return driverPromiseLoop(); + }; + } + + // There might be a driver initialization in progress + // so wait for it to finish in order to avoid a possible + // race condition to set _dbInfo + var oldDriverSetDone = this._driverSet !== null ? this._driverSet["catch"](function () { + return Promise$1.resolve(); + }) : Promise$1.resolve(); + + this._driverSet = oldDriverSetDone.then(function () { + var driverName = supportedDrivers[0]; + self._dbInfo = null; + self._ready = null; + + return self.getDriver(driverName).then(function (driver) { + self._driver = driver._driver; + setDriverToConfig(); + self._wrapLibraryMethodsWithReady(); + self._initDriver = initDriver(supportedDrivers); + }); + })["catch"](function () { + setDriverToConfig(); + var error = new Error('No available storage method found.'); + self._driverSet = Promise$1.reject(error); + return self._driverSet; + }); + + executeTwoCallbacks(this._driverSet, callback, errorCallback); + return this._driverSet; + }; + + LocalForage.prototype.supports = function supports(driverName) { + return !!DriverSupport[driverName]; + }; + + LocalForage.prototype._extend = function _extend(libraryMethodsAndProperties) { + extend(this, libraryMethodsAndProperties); + }; + + LocalForage.prototype._getSupportedDrivers = function _getSupportedDrivers(drivers) { + var supportedDrivers = []; + for (var i = 0, len = drivers.length; i < len; i++) { + var driverName = drivers[i]; + if (this.supports(driverName)) { + supportedDrivers.push(driverName); + } + } + return supportedDrivers; + }; + + LocalForage.prototype._wrapLibraryMethodsWithReady = function _wrapLibraryMethodsWithReady() { + // Add a stub for each driver API method that delays the call to the + // corresponding driver method until localForage is ready. These stubs + // will be replaced by the driver methods as soon as the driver is + // loaded, so there is no performance impact. + for (var i = 0, len = LibraryMethods.length; i < len; i++) { + callWhenReady(this, LibraryMethods[i]); + } + }; + + LocalForage.prototype.createInstance = function createInstance(options) { + return new LocalForage(options); + }; + + return LocalForage; +}(); + +// The actual localForage object that we expose as a module or via a +// global. It's extended by pulling in one of our other libraries. + + +var localforage_js = new LocalForage(); + +module.exports = localforage_js; + +},{"3":3}]},{},[4])(4) +}); diff --git a/src/server/public/scripts/localforage.js.LICENSE.txt b/src/server/public/scripts/localforage.js.LICENSE.txt deleted file mode 100644 index 5bec0c2..0000000 --- a/src/server/public/scripts/localforage.js.LICENSE.txt +++ /dev/null @@ -1,6 +0,0 @@ -/*! - localForage -- Offline Storage, Improved - Version 1.9.0 - https://localforage.github.io/localForage - (c) 2013-2017 Mozilla, Apache License 2.0 -*/ diff --git a/src/server/public/scripts/localforage.js.map b/src/server/public/scripts/localforage.js.map deleted file mode 100644 index 4322a90..0000000 --- a/src/server/public/scripts/localforage.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":[],"names":[],"mappings":"","file":"scripts/localforage.js","sourceRoot":""} \ No newline at end of file diff --git a/src/server/public/scripts/sql-wasm.js b/src/server/public/scripts/sql-wasm.js index e205dbc..fbece93 100644 --- a/src/server/public/scripts/sql-wasm.js +++ b/src/server/public/scripts/sql-wasm.js @@ -1 +1,200 @@ -var initSqlJsPromise=void 0,initSqlJs=function(e){return initSqlJsPromise||(initSqlJsPromise=new Promise((function(t,n){var r,a=void 0!==e?e:{},i=a.onAbort;a.onAbort=function(e){n(new Error(e)),i&&i(e)},a.postRun=a.postRun||[],a.postRun.push((function(){t(a)})),module=void 0,r||(r=void 0!==a?a:{}),r.onRuntimeInitialized=function(){function e(e,t){this.Pa=e,this.db=t,this.Oa=1,this.gb=[]}function t(e){if(this.filename="dbfile_"+(4294967295*Math.random()>>>0),null!=e){var t=this.filename,r=t?de("//"+t):"/";if(r=$e(r,4095&(void 0!==(t=dt(!0,!0))?t:438)|32768,0),e){if("string"==typeof e){for(var a=Array(e.length),o=0,u=e.length;or;++r)i.parameters.push(a["viii"[r]]);r=new WebAssembly.Function(i,e)}else{for(i={i:127,j:126,f:125,d:124},(a=[1,0,1,96]).push(3),r=0;3>r;++r)a.push(i["iii"[r]]);a.push(0),a[1]=a.length-2,r=new Uint8Array([0,97,115,109,1,0,0,0].concat(a,[2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0])),r=new WebAssembly.Module(r),r=new WebAssembly.Instance(r,{e:{f:e}}).exports.f}t.set(n,r)}v.set(e,n),e=n}return e}((function(e,n,r){for(var a,i=[],o=0;o>0]=0;break;case"i16":F[e>>1]=0;break;case"i32":z[e>>2]=0;break;case"i64":ue=[0,(oe=0,1<=+Math.abs(oe)?0>>0:~~+Math.ceil((oe-+(~~oe>>>0))/4294967296)>>>0:0)],z[e>>2]=ue[0],z[e+4>>2]=ue[1];break;case"float":j[e>>2]=0;break;case"double":U[e>>3]=0;break;default:re("invalid type for setValue: "+t)}}function x(e,t){switch("*"===(t=t||"i8").charAt(t.length-1)&&(t="i32"),t){case"i1":case"i8":return T[e>>0];case"i16":return F[e>>1];case"i32":case"i64":return z[e>>2];case"float":return j[e>>2];case"double":return U[e>>3];default:re("invalid type for getValue: "+t)}return null}r.wasmBinary&&(g=r.wasmBinary),r.noExitRuntime&&r.noExitRuntime,"object"!=typeof WebAssembly&&re("no native wasm support detected");var E,S,R=!1;function O(e,t){e||re("Assertion failed: "+t)}function P(e){var t=r["_"+e];return O(t,"Cannot call unknown function "+e+", make sure it is exported"),t}function D(e,t,n,r){var a,i={string:function(e){var t=0;if(null!=e&&0!==e){var n=1+(e.length<<2);t=Qt(n),Q(e,N,t,n)}return t},array:function(e){var t=Qt(e.length);return T.set(e,t),t}},o=P(e),u=[];if(e=0,r)for(var s=0;s=r);)++n;if(16(a=224==(240&a)?(15&a)<<12|i<<6|o:(7&a)<<18|i<<12|o<<6|63&e[t++])?r+=String.fromCharCode(a):(a-=65536,r+=String.fromCharCode(55296|a>>10,56320|1023&a))}}else r+=String.fromCharCode(a)}return r}function C(e){return e?I(N,e,void 0):""}function Q(e,t,n,r){if(!(0=o)o=65536+((1023&o)<<10)|1023&e.charCodeAt(++i);if(127>=o){if(n>=r)break;t[n++]=o}else{if(2047>=o){if(n+1>=r)break;t[n++]=192|o>>6}else{if(65535>=o){if(n+2>=r)break;t[n++]=224|o>>12}else{if(n+3>=r)break;t[n++]=240|o>>18,t[n++]=128|o>>12&63}t[n++]=128|o>>6&63}t[n++]=128|63&o}}return t[n]=0,n-a}function H(e){for(var t=0,n=0;n=r&&(r=65536+((1023&r)<<10)|1023&e.charCodeAt(++n)),127>=r?++t:t=2047>=r?t+2:65535>=r?t+3:t+4}return t}function B(e){var t=H(e)+1,n=Nt(t);return n&&Q(e,T,n,t),n}function V(e){K=e,r.HEAP8=T=new Int8Array(e),r.HEAP16=F=new Int16Array(e),r.HEAP32=z=new Int32Array(e),r.HEAPU8=N=new Uint8Array(e),r.HEAPU16=new Uint16Array(e),r.HEAPU32=new Uint32Array(e),r.HEAPF32=j=new Float32Array(e),r.HEAPF64=U=new Float64Array(e)}var Y=r.INITIAL_MEMORY||16777216;(E=r.wasmMemory?r.wasmMemory:new WebAssembly.Memory({initial:Y/65536,maximum:32768}))&&(K=E.buffer),Y=K.byteLength,V(K);var J=[],X=[],$=[],G=[];function Z(){var e=r.preRun.shift();J.unshift(e)}var ee=0,te=null,ne=null;function re(e){throw r.onAbort&&r.onAbort(e),y(e),R=!0,new WebAssembly.RuntimeError("abort("+e+"). Build with -s ASSERTIONS=1 for more info.")}function ae(e){var t=le;return String.prototype.startsWith?t.startsWith(e):0===t.indexOf(e)}function ie(){return ae("data:application/octet-stream;base64,")}r.preloadedImages={},r.preloadedAudios={};var oe,ue,se,le="sql-wasm.wasm";if(!ie()){var ce=le;le=r.locateFile?r.locateFile(ce,_):_+ce}function fe(){try{if(g)return new Uint8Array(g);if(d)return d(le);throw"both async and sync fetching of the wasm failed"}catch(e){re(e)}}function he(e){for(;0>2]=e}function we(){for(var e="",t=!1,n=arguments.length-1;-1<=n&&!t;n--){if("string"!=typeof(t=0<=n?arguments[n]:"/"))throw new TypeError("Arguments to path.resolve must be strings");if(!t)return"";e=t+"/"+e,t="/"===t.charAt(0)}return(t?"/":"")+(e=pe(e.split("/").filter((function(e){return!!e})),!t).join("/"))||"."}var ye=[];function ve(e,t){ye[e]={input:[],output:[],$a:t},Je(e,ge)}var ge={open:function(e){var t=ye[e.node.rdev];if(!t)throw new De(43);e.tty=t,e.seekable=!1},close:function(e){e.tty.$a.flush(e.tty)},flush:function(e){e.tty.$a.flush(e.tty)},read:function(e,t,n,r){if(!e.tty||!e.tty.$a.qb)throw new De(60);for(var a=0,i=0;i=t||(t=Math.max(t,n*(1048576>n?2:1.125)>>>0),0!=n&&(t=Math.max(t,256)),n=e.Ka,e.Ka=new Uint8Array(t),0t)e.Ka.length=t;else for(;e.Ka.length=e.node.Qa)return 0;if(8<(e=Math.min(e.node.Qa-a,r))&&i.subarray)t.set(i.subarray(a,a+e),n);else for(r=0;rt)throw new De(28);return t},lb:function(e,t,n){Me.ob(e.node,t+n),e.node.Qa=Math.max(e.node.Qa,t+n)},bb:function(e,t,n,r,a,i){if(O(0===t),32768!=(61440&e.node.mode))throw new De(43);if(e=e.node.Ka,2&i||e.buffer!==K){for((0>>0)%Re.length}function Fe(e){var t=Ne(e.parent.id,e.name);if(Re[t]===e)Re[t]=e.Za;else for(t=Re[t];t;){if(t.Za===e){t.Za=e.Za;break}t=t.Za}}function ze(e,t){var n;if(n=(n=Ce(e,"x"))?n:e.La.lookup?0:2)throw new De(n,e);for(n=Re[Ne(e.id,t)];n;n=n.Za){var r=n.name;if(n.parent.id===e.id&&r===t)return n}return e.La.lookup(e,t)}function je(e,t,n,r){return t=Ne((e=new Ot(e,t,n,r)).parent.id,e.name),e.Za=Re[t],Re[t]=e}function Ue(e){return 16384==(61440&e)}var We={r:0,rs:1052672,"r+":2,w:577,wx:705,xw:705,"w+":578,"wx+":706,"xw+":706,a:1089,ax:1217,xa:1217,"a+":1090,"ax+":1218,"xa+":1218};function Ie(e){var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t}function Ce(e,t){return Oe||(-1===t.indexOf("r")||292&e.mode)&&(-1===t.indexOf("w")||146&e.mode)&&(-1===t.indexOf("x")||73&e.mode)?0:2}function Qe(e,t){try{return ze(e,t),20}catch(e){}return Ce(e,"wx")}function He(e,t,n){try{var r=ze(e,t)}catch(e){return e.Na}if(e=Ce(e,"wx"))return e;if(n){if(!Ue(r.mode))return 54;if(r===r.parent||"/"===Te(r))return 10}else if(Ue(r.mode))return 31;return 0}function Be(e,t){_t||((_t=function(){}).prototype={});var n,r=new _t;for(n in e)r[n]=e[n];return e=r,t=function(e){for(e=e||0;e<=4096;e++)if(!Ee[e])return e;throw new De(33)}(t),e.fd=t,Ee[t]=e}var Ve,Ye={open:function(e){e.Ma=xe[e.node.rdev].Ma,e.Ma.open&&e.Ma.open(e)},Xa:function(){throw new De(70)}};function Je(e,t){xe[e]={Ma:t}}function Xe(e,t){var n="/"===t,r=!t;if(n&&Ae)throw new De(10);if(!n&&!r){var a=Ke(t,{pb:!1});if(t=a.path,(a=a.node).Ya)throw new De(10);if(!Ue(a.mode))throw new De(54)}t={type:e,Nb:{},rb:t,Fb:[]},(e=e.Ua(t)).Ua=t,t.root=e,n?Ae=e:a&&(a.Ya=t,a.Ua&&a.Ua.Fb.push(t))}function $e(e,t,n){var r=Ke(e,{parent:!0}).node;if(!(e=be(e))||"."===e||".."===e)throw new De(28);var a=Qe(r,e);if(a)throw new De(a);if(!r.La.ab)throw new De(63);return r.La.ab(r,e,t,n)}function Ge(e,t){$e(e,1023&(void 0!==t?t:511)|16384,0)}function Ze(e,t,n){void 0===n&&(n=t,t=438),$e(e,8192|t,n)}function et(e,t){if(!we(e))throw new De(44);var n=Ke(t,{parent:!0}).node;if(!n)throw new De(44);var r=Qe(n,t=be(t));if(r)throw new De(r);if(!n.La.symlink)throw new De(63);n.La.symlink(n,t,e)}function tt(e){var t=Ke(e,{parent:!0}).node,n=be(e),r=ze(t,n),a=He(t,n,!1);if(a)throw new De(a);if(!t.La.unlink)throw new De(63);if(r.Ya)throw new De(10);try{Pe.willDeletePath&&Pe.willDeletePath(e)}catch(t){y("FS.trackingDelegate['willDeletePath']('"+e+"') threw an exception: "+t.message)}t.La.unlink(t,n),Fe(r);try{Pe.onDeletePath&&Pe.onDeletePath(e)}catch(t){y("FS.trackingDelegate['onDeletePath']('"+e+"') threw an exception: "+t.message)}}function nt(e){if(!(e=Ke(e).node))throw new De(44);if(!e.La.readlink)throw new De(28);return we(Te(e.parent),e.La.readlink(e))}function rt(e,t){if(!(e=Ke(e,{Wa:!t}).node))throw new De(44);if(!e.La.Sa)throw new De(63);return e.La.Sa(e)}function at(e){return rt(e,!0)}function it(e,t){var n;if(!(n="string"==typeof e?Ke(e,{Wa:!0}).node:e).La.Ra)throw new De(63);n.La.Ra(n,{mode:4095&t|-4096&n.mode,timestamp:Date.now()})}function ot(e){var t;if(!(t="string"==typeof e?Ke(e,{Wa:!0}).node:e).La.Ra)throw new De(63);t.La.Ra(t,{timestamp:Date.now()})}function ut(e,t){if(0>t)throw new De(28);var n;if(!(n="string"==typeof e?Ke(e,{Wa:!0}).node:e).La.Ra)throw new De(63);if(Ue(n.mode))throw new De(31);if(32768!=(61440&n.mode))throw new De(28);if(e=Ce(n,"w"))throw new De(e);n.La.Ra(n,{size:t,timestamp:Date.now()})}function st(e,t,n,a){if(""===e)throw new De(44);if("string"==typeof t){var i=We[t];if(void 0===i)throw Error("Unknown file open mode: "+t);t=i}if(n=64&t?4095&(void 0===n?438:n)|32768:0,"object"==typeof e)var o=e;else{e=de(e);try{o=Ke(e,{Wa:!(131072&t)}).node}catch(e){}}if(i=!1,64&t)if(o){if(128&t)throw new De(20)}else o=$e(e,n,0),i=!0;if(!o)throw new De(44);if(8192==(61440&o.mode)&&(t&=-513),65536&t&&!Ue(o.mode))throw new De(54);if(!i&&(n=o?40960==(61440&o.mode)?32:Ue(o.mode)&&("r"!==Ie(t)||512&t)?31:Ce(o,Ie(t)):44))throw new De(n);512&t&&ut(o,0),t&=-131713,(a=Be({node:o,path:Te(o),flags:t,seekable:!0,position:0,Ma:o.Ma,Kb:[],error:!1},a)).Ma.open&&a.Ma.open(a),!r.logReadFiles||1&t||(wt||(wt={}),e in wt||(wt[e]=1,y("FS.trackingDelegate error on read file: "+e)));try{Pe.onOpenFile&&(o=0,1!=(2097155&t)&&(o|=1),0!=(2097155&t)&&(o|=2),Pe.onOpenFile(e,o))}catch(t){y("FS.trackingDelegate['onOpenFile']('"+e+"', flags) threw an exception: "+t.message)}return a}function lt(e){if(null===e.fd)throw new De(8);e.ib&&(e.ib=null);try{e.Ma.close&&e.Ma.close(e)}catch(e){throw e}finally{Ee[e.fd]=null}e.fd=null}function ct(e,t,n){if(null===e.fd)throw new De(8);if(!e.seekable||!e.Ma.Xa)throw new De(70);if(0!=n&&1!=n&&2!=n)throw new De(28);e.position=e.Ma.Xa(e,t,n),e.Kb=[]}function ft(e,t,n,r,a){if(0>r||0>a)throw new De(28);if(null===e.fd)throw new De(8);if(1==(2097155&e.flags))throw new De(8);if(Ue(e.node.mode))throw new De(31);if(!e.Ma.read)throw new De(28);var i=void 0!==a;if(i){if(!e.seekable)throw new De(70)}else a=e.position;return t=e.Ma.read(e,t,n,r,a),i||(e.position+=t),t}function ht(e,t,n,r,a,i){if(0>r||0>a)throw new De(28);if(null===e.fd)throw new De(8);if(0==(2097155&e.flags))throw new De(8);if(Ue(e.node.mode))throw new De(31);if(!e.Ma.write)throw new De(28);e.seekable&&1024&e.flags&&ct(e,0,2);var o=void 0!==a;if(o){if(!e.seekable)throw new De(70)}else a=e.position;t=e.Ma.write(e,t,n,r,a,i),o||(e.position+=t);try{e.path&&Pe.onWriteToFile&&Pe.onWriteToFile(e.path)}catch(t){y("FS.trackingDelegate['onWriteToFile']('"+e.path+"') threw an exception: "+t.message)}return t}function pt(){De||((De=function(e,t){this.node=t,this.Jb=function(e){this.Na=e},this.Jb(e),this.message="FS error"}).prototype=Error(),De.prototype.constructor=De,[44].forEach((function(e){Le[e]=new De(e),Le[e].stack=""})))}function dt(e,t){var n=0;return e&&(n|=365),t&&(n|=146),n}function mt(e,t,n){e=de("/dev/"+e);var r=dt(!!t,!!n);bt||(bt=64);var a=bt++<<8|0;Je(a,{open:function(e){e.seekable=!1},close:function(){n&&n.buffer&&n.buffer.length&&n(10)},read:function(e,n,r,a){for(var i=0,o=0;o>2]=r.dev,z[n+4>>2]=0,z[n+8>>2]=r.ino,z[n+12>>2]=r.mode,z[n+16>>2]=r.nlink,z[n+20>>2]=r.uid,z[n+24>>2]=r.gid,z[n+28>>2]=r.rdev,z[n+32>>2]=0,ue=[r.size>>>0,(oe=r.size,1<=+Math.abs(oe)?0>>0:~~+Math.ceil((oe-+(~~oe>>>0))/4294967296)>>>0:0)],z[n+40>>2]=ue[0],z[n+44>>2]=ue[1],z[n+48>>2]=4096,z[n+52>>2]=r.blocks,z[n+56>>2]=r.atime.getTime()/1e3|0,z[n+60>>2]=0,z[n+64>>2]=r.mtime.getTime()/1e3|0,z[n+68>>2]=0,z[n+72>>2]=r.ctime.getTime()/1e3|0,z[n+76>>2]=0,ue=[r.ino>>>0,(oe=r.ino,1<=+Math.abs(oe)?0>>0:~~+Math.ceil((oe-+(~~oe>>>0))/4294967296)>>>0:0)],z[n+80>>2]=ue[0],z[n+84>>2]=ue[1],0}var qt=void 0;function kt(){return z[(qt+=4)-4>>2]}function Mt(e){if(!(e=Ee[e]))throw new De(8);return e}var At,xt,Et={};function St(){if(!At){var e,t={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:h||"./this.program"};for(e in Et)t[e]=Et[e];var n=[];for(e in t)n.push(e+"="+t[e]);At=n}return At}function Rt(e){for(var t=xt();xt()-t>2]=60*(new Date).getTimezoneOffset();var t=(new Date).getFullYear(),n=new Date(t,0,1);t=new Date(t,6,1),z[Ut()>>2]=Number(n.getTimezoneOffset()!=t.getTimezoneOffset());var r=e(n),a=e(t);r=B(r),a=B(a),t.getTimezoneOffset()>2]=r,z[jt()+4>>2]=a):(z[jt()>>2]=a,z[jt()+4>>2]=r)}}(),e=new Date(1e3*z[e>>2]),z[t>>2]=e.getSeconds(),z[t+4>>2]=e.getMinutes(),z[t+8>>2]=e.getHours(),z[t+12>>2]=e.getDate(),z[t+16>>2]=e.getMonth(),z[t+20>>2]=e.getFullYear()-1900,z[t+24>>2]=e.getDay();var n=new Date(e.getFullYear(),0,1);z[t+28>>2]=(e.getTime()-n.getTime())/864e5|0,z[t+36>>2]=-60*e.getTimezoneOffset();var r=new Date(e.getFullYear(),6,1).getTimezoneOffset();return e=0|(r!=(n=n.getTimezoneOffset())&&e.getTimezoneOffset()==Math.min(n,r)),z[t+32>>2]=e,e=z[jt()+(e?4:0)>>2],z[t+40>>2]=e,t},I:function(e,t){try{var n;if(e=C(e),-8&t)var r=-28;else(n=Ke(e,{Wa:!0}).node)?(e="",4&t&&(e+="r"),2&t&&(e+="w"),1&t&&(e+="x"),r=e&&Ce(n,e)?-2:0):r=-44;return r}catch(e){return void 0!==yt&&e instanceof De||re(e),-e.Na}},t:function(e,t){try{return it(e=C(e),t),0}catch(e){return void 0!==yt&&e instanceof De||re(e),-e.Na}},z:function(e){try{return ot(e=C(e)),0}catch(e){return void 0!==yt&&e instanceof De||re(e),-e.Na}},u:function(e,t){try{var n=Ee[e];if(!n)throw new De(8);return it(n.node,t),0}catch(e){return void 0!==yt&&e instanceof De||re(e),-e.Na}},B:function(e){try{var t=Ee[e];if(!t)throw new De(8);return ot(t.node),0}catch(e){return void 0!==yt&&e instanceof De||re(e),-e.Na}},c:function(e,t,n){qt=n;try{var r=Mt(e);switch(t){case 0:var a=kt();return 0>a?-28:st(r.path,r.flags,0,a).fd;case 1:case 2:return 0;case 3:return r.flags;case 4:return a=kt(),r.flags|=a,0;case 12:return a=kt(),F[a+0>>1]=2,0;case 13:case 14:return 0;case 16:case 8:return-28;case 9:return _e(28),-1;default:return-28}}catch(e){return void 0!==yt&&e instanceof De||re(e),-e.Na}},w:function(e,t){try{return gt(rt,Mt(e).path,t)}catch(e){return void 0!==yt&&e instanceof De||re(e),-e.Na}},F:function(e,t,n){try{var r=Ee[e];if(!r)throw new De(8);if(0==(2097155&r.flags))throw new De(28);return ut(r.node,n),0}catch(e){return void 0!==yt&&e instanceof De||re(e),-e.Na}},J:function(e,t){try{return 0===t?-28:t=n)var r=-28;else{var a=nt(e),i=Math.min(n,H(a)),o=T[t+i];Q(a,N,t,n+1),T[t+i]=o,r=i}return r}catch(e){return void 0!==yt&&e instanceof De||re(e),-e.Na}},H:function(e){try{var t=Ke(e=C(e),{parent:!0}).node,n=be(e),r=ze(t,n),a=He(t,n,!0);if(a)throw new De(a);if(!t.La.rmdir)throw new De(63);if(r.Ya)throw new De(10);try{Pe.willDeletePath&&Pe.willDeletePath(e)}catch(t){y("FS.trackingDelegate['willDeletePath']('"+e+"') threw an exception: "+t.message)}t.La.rmdir(t,n),Fe(r);try{Pe.onDeletePath&&Pe.onDeletePath(e)}catch(t){y("FS.trackingDelegate['onDeletePath']('"+e+"') threw an exception: "+t.message)}return 0}catch(e){return void 0!==yt&&e instanceof De||re(e),-e.Na}},g:function(e,t){try{return gt(rt,e=C(e),t)}catch(e){return void 0!==yt&&e instanceof De||re(e),-e.Na}},G:function(e){try{return tt(e=C(e)),0}catch(e){return void 0!==yt&&e instanceof De||re(e),-e.Na}},m:function(e,t,n){N.copyWithin(e,t,t+n)},d:function(e){e>>>=0;var t=N.length;if(2147483648=n;n*=2){var r=t*(1+.2/n);r=Math.min(r,e+100663296),0<(r=Math.max(16777216,e,r))%65536&&(r+=65536-r%65536);e:{try{E.grow(Math.min(2147483648,r)-K.byteLength+65535>>>16),V(E.buffer);var a=1;break e}catch(e){}a=void 0}if(a)return!0}return!1},o:function(e,t){var n=0;return St().forEach((function(r,a){var i=t+n;for(a=z[e+4*a>>2]=i,i=0;i>0]=r.charCodeAt(i);T[a>>0]=0,n+=r.length+1})),0},p:function(e,t){var n=St();z[e>>2]=n.length;var r=0;return n.forEach((function(e){r+=e.length+1})),z[t>>2]=r,0},f:function(e){try{return lt(Mt(e)),0}catch(e){return void 0!==yt&&e instanceof De||re(e),e.Na}},n:function(e,t){try{var n=Mt(e);return T[t>>0]=n.tty?2:Ue(n.mode)?3:40960==(61440&n.mode)?7:4,0}catch(e){return void 0!==yt&&e instanceof De||re(e),e.Na}},l:function(e,t,n,r,a){try{var i=Mt(e);return-9007199254740992>=(e=4294967296*n+(t>>>0))||9007199254740992<=e?-61:(ct(i,e,r),ue=[i.position>>>0,(oe=i.position,1<=+Math.abs(oe)?0>>0:~~+Math.ceil((oe-+(~~oe>>>0))/4294967296)>>>0:0)],z[a>>2]=ue[0],z[a+4>>2]=ue[1],i.ib&&0===e&&0===r&&(i.ib=null),0)}catch(e){return void 0!==yt&&e instanceof De||re(e),e.Na}},E:function(e){try{var t=Mt(e);return t.Ma&&t.Ma.fsync?-t.Ma.fsync(t):0}catch(e){return void 0!==yt&&e instanceof De||re(e),e.Na}},y:function(e,t,n,r){try{e:{for(var a=Mt(e),i=e=0;i>2],z[t+(8*i+4)>>2],void 0);if(0>o){var u=-1;break e}e+=o}u=e}return z[r>>2]=u,0}catch(e){return void 0!==yt&&e instanceof De||re(e),e.Na}},h:function(e){var t=Date.now();return z[e>>2]=t/1e3|0,z[e+4>>2]=t%1e3*1e3|0,0},a:E,K:function(e,t){if(0===e)return _e(28),-1;var n=z[e>>2];return 0>(e=z[e+4>>2])||999999999n?(_e(28),-1):(0!==t&&(z[t>>2]=0,z[t+4>>2]=0),Rt(1e6*n+e/1e3))},A:function(e){switch(e){case 30:return 16384;case 85:return 131072;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 80:case 81:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:case 79:return 200809;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:return"object"==typeof navigator&&navigator.hardwareConcurrency||1}return _e(28),-1},L:function(e){var t=Date.now()/1e3|0;return e&&(z[e>>2]=t),t},r:function(e,t){if(t){var n=1e3*z[t+8>>2];n+=z[t+12>>2]/1e3}else n=Date.now();e=C(e);try{t=n;var a=Ke(e,{Wa:!0}).node;return a.La.Ra(a,{timestamp:Math.max(t,n)}),0}catch(t){if(!((e=t)instanceof De)){e+=" : ";e:{if(!(a=Error()).stack){try{throw Error()}catch(e){a=e}if(!a.stack){a="(no stack trace available)";break e}}a=a.stack.toString()}throw r.extraStackTrace&&(a+="\n"+r.extraStackTrace()),a=function(e){return e.replace(/\b_Z[\w\d_]+/g,(function(e){return e==e?e:e+" ["+e+"]"}))}(a),e+a}return _e(e.Na),-1}}};!function(){function e(e){r.asm=e.exports,S=r.asm.M,ee--,r.monitorRunDependencies&&r.monitorRunDependencies(ee),0==ee&&(null!==te&&(clearInterval(te),te=null),ne&&(e=ne,ne=null,e()))}function t(t){e(t.instance)}function n(e){return(g||!s&&!l||"function"!=typeof fetch||ae("file://")?Promise.resolve().then(fe):fetch(le,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+le+"'";return e.arrayBuffer()})).catch((function(){return fe()}))).then((function(e){return WebAssembly.instantiate(e,a)})).then(e,(function(e){y("failed to asynchronously prepare wasm: "+e),re(e)}))}var a={a:Dt};if(ee++,r.monitorRunDependencies&&r.monitorRunDependencies(ee),r.instantiateWasm)try{return r.instantiateWasm(a,e)}catch(e){return y("Module.instantiateWasm callback failed with error: "+e),!1}(function(){if(g||"function"!=typeof WebAssembly.instantiateStreaming||ie()||ae("file://")||"function"!=typeof fetch)return n(t);fetch(le,{credentials:"same-origin"}).then((function(e){return WebAssembly.instantiateStreaming(e,a).then(t,(function(e){return y("wasm streaming compile failed: "+e),y("falling back to ArrayBuffer instantiation"),n(t)}))}))})()}();var Lt=r.___wasm_call_ctors=function(){return(Lt=r.___wasm_call_ctors=r.asm.N).apply(null,arguments)},Kt=r._memset=function(){return(Kt=r._memset=r.asm.O).apply(null,arguments)};r._sqlite3_free=function(){return(r._sqlite3_free=r.asm.P).apply(null,arguments)};var Tt=r.___errno_location=function(){return(Tt=r.___errno_location=r.asm.Q).apply(null,arguments)};r._sqlite3_finalize=function(){return(r._sqlite3_finalize=r.asm.R).apply(null,arguments)},r._sqlite3_reset=function(){return(r._sqlite3_reset=r.asm.S).apply(null,arguments)},r._sqlite3_clear_bindings=function(){return(r._sqlite3_clear_bindings=r.asm.T).apply(null,arguments)},r._sqlite3_value_blob=function(){return(r._sqlite3_value_blob=r.asm.U).apply(null,arguments)},r._sqlite3_value_text=function(){return(r._sqlite3_value_text=r.asm.V).apply(null,arguments)},r._sqlite3_value_bytes=function(){return(r._sqlite3_value_bytes=r.asm.W).apply(null,arguments)},r._sqlite3_value_double=function(){return(r._sqlite3_value_double=r.asm.X).apply(null,arguments)},r._sqlite3_value_int=function(){return(r._sqlite3_value_int=r.asm.Y).apply(null,arguments)},r._sqlite3_value_type=function(){return(r._sqlite3_value_type=r.asm.Z).apply(null,arguments)},r._sqlite3_result_blob=function(){return(r._sqlite3_result_blob=r.asm._).apply(null,arguments)},r._sqlite3_result_double=function(){return(r._sqlite3_result_double=r.asm.$).apply(null,arguments)},r._sqlite3_result_error=function(){return(r._sqlite3_result_error=r.asm.aa).apply(null,arguments)},r._sqlite3_result_int=function(){return(r._sqlite3_result_int=r.asm.ba).apply(null,arguments)},r._sqlite3_result_int64=function(){return(r._sqlite3_result_int64=r.asm.ca).apply(null,arguments)},r._sqlite3_result_null=function(){return(r._sqlite3_result_null=r.asm.da).apply(null,arguments)},r._sqlite3_result_text=function(){return(r._sqlite3_result_text=r.asm.ea).apply(null,arguments)},r._sqlite3_step=function(){return(r._sqlite3_step=r.asm.fa).apply(null,arguments)},r._sqlite3_column_count=function(){return(r._sqlite3_column_count=r.asm.ga).apply(null,arguments)},r._sqlite3_data_count=function(){return(r._sqlite3_data_count=r.asm.ha).apply(null,arguments)},r._sqlite3_column_blob=function(){return(r._sqlite3_column_blob=r.asm.ia).apply(null,arguments)},r._sqlite3_column_bytes=function(){return(r._sqlite3_column_bytes=r.asm.ja).apply(null,arguments)},r._sqlite3_column_double=function(){return(r._sqlite3_column_double=r.asm.ka).apply(null,arguments)},r._sqlite3_column_text=function(){return(r._sqlite3_column_text=r.asm.la).apply(null,arguments)},r._sqlite3_column_type=function(){return(r._sqlite3_column_type=r.asm.ma).apply(null,arguments)},r._sqlite3_column_name=function(){return(r._sqlite3_column_name=r.asm.na).apply(null,arguments)},r._sqlite3_bind_blob=function(){return(r._sqlite3_bind_blob=r.asm.oa).apply(null,arguments)},r._sqlite3_bind_double=function(){return(r._sqlite3_bind_double=r.asm.pa).apply(null,arguments)},r._sqlite3_bind_int=function(){return(r._sqlite3_bind_int=r.asm.qa).apply(null,arguments)},r._sqlite3_bind_text=function(){return(r._sqlite3_bind_text=r.asm.ra).apply(null,arguments)},r._sqlite3_bind_parameter_index=function(){return(r._sqlite3_bind_parameter_index=r.asm.sa).apply(null,arguments)},r._sqlite3_errmsg=function(){return(r._sqlite3_errmsg=r.asm.ta).apply(null,arguments)},r._sqlite3_exec=function(){return(r._sqlite3_exec=r.asm.ua).apply(null,arguments)},r._sqlite3_prepare_v2=function(){return(r._sqlite3_prepare_v2=r.asm.va).apply(null,arguments)},r._sqlite3_changes=function(){return(r._sqlite3_changes=r.asm.wa).apply(null,arguments)},r._sqlite3_close_v2=function(){return(r._sqlite3_close_v2=r.asm.xa).apply(null,arguments)},r._sqlite3_create_function_v2=function(){return(r._sqlite3_create_function_v2=r.asm.ya).apply(null,arguments)},r._sqlite3_open=function(){return(r._sqlite3_open=r.asm.za).apply(null,arguments)};var Nt=r._malloc=function(){return(Nt=r._malloc=r.asm.Aa).apply(null,arguments)},Ft=r._free=function(){return(Ft=r._free=r.asm.Ba).apply(null,arguments)};r._RegisterExtensionFunctions=function(){return(r._RegisterExtensionFunctions=r.asm.Ca).apply(null,arguments)};var zt,jt=r.__get_tzname=function(){return(jt=r.__get_tzname=r.asm.Da).apply(null,arguments)},Ut=r.__get_daylight=function(){return(Ut=r.__get_daylight=r.asm.Ea).apply(null,arguments)},Wt=r.__get_timezone=function(){return(Wt=r.__get_timezone=r.asm.Fa).apply(null,arguments)},It=r.stackSave=function(){return(It=r.stackSave=r.asm.Ga).apply(null,arguments)},Ct=r.stackRestore=function(){return(Ct=r.stackRestore=r.asm.Ha).apply(null,arguments)},Qt=r.stackAlloc=function(){return(Qt=r.stackAlloc=r.asm.Ia).apply(null,arguments)},Ht=r._memalign=function(){return(Ht=r._memalign=r.asm.Ja).apply(null,arguments)};function Bt(){function e(){if(!zt&&(zt=!0,r.calledRun=!0,!R)){if(r.noFSInit||Ve||(Ve=!0,pt(),r.stdin=r.stdin,r.stdout=r.stdout,r.stderr=r.stderr,r.stdin?mt("stdin",r.stdin):et("/dev/tty","/dev/stdin"),r.stdout?mt("stdout",null,r.stdout):et("/dev/tty","/dev/stdout"),r.stderr?mt("stderr",null,r.stderr):et("/dev/tty1","/dev/stderr"),st("/dev/stdin","r"),st("/dev/stdout","w"),st("/dev/stderr","w")),he(X),Oe=!1,he($),r.onRuntimeInitialized&&r.onRuntimeInitialized(),r.postRun)for("function"==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;){var e=r.postRun.shift();G.unshift(e)}he(G)}}if(!(0>>0);if(null!=h){var l=this.filename,r=l?k("//"+l):"/";l=aa(!0,!0);r=ba(r,(void 0!==l?l:438)&4095|32768,0);if(h){if("string"===typeof h){for(var q=Array(h.length),A=0,da=h.length;Ad;++d)g.parameters.push(f["viii"[d]]); +d=new WebAssembly.Function(g,a)}else{f=[1,0,1,96];g={i:127,j:126,f:125,d:124};f.push(3);for(d=0;3>d;++d)f.push(g["iii"[d]]);f.push(0);f[1]=f.length-2;d=new Uint8Array([0,97,115,109,1,0,0,0].concat(f,[2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0]));d=new WebAssembly.Module(d);d=(new WebAssembly.Instance(d,{e:{f:a}})).exports.f}b.set(c,d)}G.set(a,c);a=c}return a}function sa(a){va(a)}var Ka;e.wasmBinary&&(Ka=e.wasmBinary);var noExitRuntime;e.noExitRuntime&&(noExitRuntime=e.noExitRuntime); +"object"!==typeof WebAssembly&&I("no native wasm support detected"); +function qa(a){var b="i32";"*"===b.charAt(b.length-1)&&(b="i32");switch(b){case "i1":x[a>>0]=0;break;case "i8":x[a>>0]=0;break;case "i16":La[a>>1]=0;break;case "i32":J[a>>2]=0;break;case "i64":K=[0,(L=0,1<=+Math.abs(L)?0>>0:~~+Math.ceil((L-+(~~L>>>0))/4294967296)>>>0:0)];J[a>>2]=K[0];J[a+4>>2]=K[1];break;case "float":Ma[a>>2]=0;break;case "double":Na[a>>3]=0;break;default:I("invalid type for setValue: "+b)}} +function p(a,b){b=b||"i8";"*"===b.charAt(b.length-1)&&(b="i32");switch(b){case "i1":return x[a>>0];case "i8":return x[a>>0];case "i16":return La[a>>1];case "i32":return J[a>>2];case "i64":return J[a>>2];case "float":return Ma[a>>2];case "double":return Na[a>>3];default:I("invalid type for getValue: "+b)}return null}var M,Ja,Oa=!1;function assert(a,b){a||I("Assertion failed: "+b)}function Pa(a){var b=e["_"+a];assert(b,"Cannot call unknown function "+a+", make sure it is exported");return b} +function Qa(a,b,c,d){var f={string:function(v){var B=0;if(null!==v&&void 0!==v&&0!==v){var H=(v.length<<2)+1;B=u(H);pa(v,N,B,H)}return B},array:function(v){var B=u(v.length);x.set(v,B);return B}},g=Pa(a),n=[];a=0;if(d)for(var t=0;t=d);)++c;if(16f?d+=String.fromCharCode(f):(f-=65536,d+=String.fromCharCode(55296|f>>10,56320|f&1023))}}else d+=String.fromCharCode(f)}return d}function O(a){return a?Va(N,a,void 0):""} +function pa(a,b,c,d){if(!(0=n){var t=a.charCodeAt(++g);n=65536+((n&1023)<<10)|t&1023}if(127>=n){if(c>=d)break;b[c++]=n}else{if(2047>=n){if(c+1>=d)break;b[c++]=192|n>>6}else{if(65535>=n){if(c+2>=d)break;b[c++]=224|n>>12}else{if(c+3>=d)break;b[c++]=240|n>>18;b[c++]=128|n>>12&63}b[c++]=128|n>>6&63}b[c++]=128|n&63}}b[c]=0;return c-f} +function oa(a){for(var b=0,c=0;c=d&&(d=65536+((d&1023)<<10)|a.charCodeAt(++c)&1023);127>=d?++b:b=2047>=d?b+2:65535>=d?b+3:b+4}return b}function Wa(a){var b=oa(a)+1,c=Ta(b);c&&pa(a,x,c,b);return c}var Xa,x,N,La,J,Ma,Na; +function Ya(a){Xa=a;e.HEAP8=x=new Int8Array(a);e.HEAP16=La=new Int16Array(a);e.HEAP32=J=new Int32Array(a);e.HEAPU8=N=new Uint8Array(a);e.HEAPU16=new Uint16Array(a);e.HEAPU32=new Uint32Array(a);e.HEAPF32=Ma=new Float32Array(a);e.HEAPF64=Na=new Float64Array(a)}var Za=e.INITIAL_MEMORY||16777216;e.wasmMemory?M=e.wasmMemory:M=new WebAssembly.Memory({initial:Za/65536,maximum:32768});M&&(Xa=M.buffer);Za=Xa.byteLength;Ya(Xa);var $a=[],ab=[],bb=[],cb=[];function db(){var a=e.preRun.shift();$a.unshift(a)} +var eb=0,fb=null,gb=null;e.preloadedImages={};e.preloadedAudios={};function I(a){if(e.onAbort)e.onAbort(a);F(a);Oa=!0;throw new WebAssembly.RuntimeError("abort("+a+"). Build with -s ASSERTIONS=1 for more info.");}function hb(a){var b=ib;return String.prototype.startsWith?b.startsWith(a):0===b.indexOf(a)}function jb(){return hb("data:application/octet-stream;base64,")}var ib="sql-wasm.wasm";if(!jb()){var kb=ib;ib=e.locateFile?e.locateFile(kb,C):C+kb} +function lb(){try{if(Ka)return new Uint8Array(Ka);if(Ea)return Ea(ib);throw"both async and sync fetching of the wasm failed";}catch(a){I(a)}}function mb(){return Ka||!za&&!z||"function"!==typeof fetch||hb("file://")?Promise.resolve().then(lb):fetch(ib,{credentials:"same-origin"}).then(function(a){if(!a.ok)throw"failed to load wasm binary file at '"+ib+"'";return a.arrayBuffer()}).catch(function(){return lb()})}var L,K; +function nb(a){for(;0>2]=60*(new Date).getTimezoneOffset();var b=(new Date).getFullYear(),c=new Date(b,0,1);b=new Date(b,6,1);J[ub()>>2]=Number(c.getTimezoneOffset()!=b.getTimezoneOffset());var d=a(c),f=a(b);d=Wa(d);f=Wa(f);b.getTimezoneOffset()>2]=d,J[wb()+4>>2]=f):(J[wb()>>2]=f,J[wb()+4>>2]=d)}}var sb; +function xb(a,b){for(var c=0,d=a.length-1;0<=d;d--){var f=a[d];"."===f?a.splice(d,1):".."===f?(a.splice(d,1),c++):c&&(a.splice(d,1),c--)}if(b)for(;c;c--)a.unshift("..");return a}function k(a){var b="/"===a.charAt(0),c="/"===a.substr(-1);(a=xb(a.split("/").filter(function(d){return!!d}),!b).join("/"))||b||(a=".");a&&c&&(a+="/");return(b?"/":"")+a} +function yb(a){var b=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(a).slice(1);a=b[0];b=b[1];if(!a&&!b)return".";b&&(b=b.substr(0,b.length-1));return a+b}function zb(a){if("/"===a)return"/";a=k(a);a=a.replace(/\/$/,"");var b=a.lastIndexOf("/");return-1===b?a:a.substr(b+1)}function Ab(a){J[Bb()>>2]=a} +function Cb(){if("object"===typeof crypto&&"function"===typeof crypto.getRandomValues){var a=new Uint8Array(1);return function(){crypto.getRandomValues(a);return a[0]}}if(Aa)try{var b=require("crypto");return function(){return b.randomBytes(1)[0]}}catch(c){}return function(){I("randomDevice")}} +function Db(){for(var a="",b=!1,c=arguments.length-1;-1<=c&&!b;c--){b=0<=c?arguments[c]:"/";if("string"!==typeof b)throw new TypeError("Arguments to path.resolve must be strings");if(!b)return"";a=b+"/"+a;b="/"===b.charAt(0)}a=xb(a.split("/").filter(function(d){return!!d}),!b).join("/");return(b?"/":"")+a||"."}var Eb=[];function Fb(a,b){Eb[a]={input:[],output:[],$a:b};Gb(a,Hb)} +var Hb={open:function(a){var b=Eb[a.node.rdev];if(!b)throw new Q(43);a.tty=b;a.seekable=!1},close:function(a){a.tty.$a.flush(a.tty)},flush:function(a){a.tty.$a.flush(a.tty)},read:function(a,b,c,d){if(!a.tty||!a.tty.$a.qb)throw new Q(60);for(var f=0,g=0;g=b||(b=Math.max(b,c*(1048576>c?2:1.125)>>>0),0!=c&&(b=Math.max(b,256)),c=a.Ka,a.Ka=new Uint8Array(b),0b)a.Ka.length=b;else for(;a.Ka.length=a.node.Qa)return 0;a=Math.min(a.node.Qa-f,d);if(8b)throw new Q(28);return b},lb:function(a,b,c){R.ob(a.node,b+c);a.node.Qa=Math.max(a.node.Qa,b+c)},bb:function(a,b,c,d,f,g){assert(0===b);if(32768!==(a.node.mode&61440))throw new Q(43);a=a.node.Ka; +if(g&2||a.buffer!==Xa){if(0>>0)%U.length}function Vb(a){var b=Ub(a.parent.id,a.name);if(U[b]===a)U[b]=a.Za;else for(b=U[b];b;){if(b.Za===a){b.Za=a.Za;break}b=b.Za}} +function Nb(a,b){var c;if(c=(c=Wb(a,"x"))?c:a.La.lookup?0:2)throw new Q(c,a);for(c=U[Ub(a.id,b)];c;c=c.Za){var d=c.name;if(c.parent.id===a.id&&d===b)return c}return a.La.lookup(a,b)}function Lb(a,b,c,d){a=new Xb(a,b,c,d);b=Ub(a.parent.id,a.name);a.Za=U[b];return U[b]=a}function S(a){return 16384===(a&61440)}var Yb={r:0,rs:1052672,"r+":2,w:577,wx:705,xw:705,"w+":578,"wx+":706,"xw+":706,a:1089,ax:1217,xa:1217,"a+":1090,"ax+":1218,"xa+":1218}; +function Zb(a){var b=["r","w","rw"][a&3];a&512&&(b+="w");return b}function Wb(a,b){if(Rb)return 0;if(-1===b.indexOf("r")||a.mode&292){if(-1!==b.indexOf("w")&&!(a.mode&146)||-1!==b.indexOf("x")&&!(a.mode&73))return 2}else return 2;return 0}function $b(a,b){try{return Nb(a,b),20}catch(c){}return Wb(a,"wx")}function ac(a,b,c){try{var d=Nb(a,b)}catch(f){return f.Na}if(a=Wb(a,"wx"))return a;if(c){if(!S(d.mode))return 54;if(d===d.parent||"/"===Tb(d))return 10}else if(S(d.mode))return 31;return 0} +function bc(a){var b=4096;for(a=a||0;a<=b;a++)if(!T[a])return a;throw new Q(33);}function cc(a,b){dc||(dc=function(){},dc.prototype={});var c=new dc,d;for(d in a)c[d]=a[d];a=c;b=bc(b);a.fd=b;return T[b]=a}var Kb={open:function(a){a.Ma=Pb[a.node.rdev].Ma;a.Ma.open&&a.Ma.open(a)},Xa:function(){throw new Q(70);}};function Gb(a,b){Pb[a]={Ma:b}} +function ec(a,b){var c="/"===b,d=!b;if(c&&Ob)throw new Q(10);if(!c&&!d){var f=W(b,{pb:!1});b=f.path;f=f.node;if(f.Ya)throw new Q(10);if(!S(f.mode))throw new Q(54);}b={type:a,Nb:{},rb:b,Fb:[]};a=a.Ua(b);a.Ua=b;b.root=a;c?Ob=a:f&&(f.Ya=b,f.Ua&&f.Ua.Fb.push(b))}function ba(a,b,c){var d=W(a,{parent:!0}).node;a=zb(a);if(!a||"."===a||".."===a)throw new Q(28);var f=$b(d,a);if(f)throw new Q(f);if(!d.La.ab)throw new Q(63);return d.La.ab(d,a,b,c)}function X(a,b){ba(a,(void 0!==b?b:511)&1023|16384,0)} +function fc(a,b,c){"undefined"===typeof c&&(c=b,b=438);ba(a,b|8192,c)}function hc(a,b){if(!Db(a))throw new Q(44);var c=W(b,{parent:!0}).node;if(!c)throw new Q(44);b=zb(b);var d=$b(c,b);if(d)throw new Q(d);if(!c.La.symlink)throw new Q(63);c.La.symlink(c,b,a)} +function ua(a){var b=W(a,{parent:!0}).node,c=zb(a),d=Nb(b,c),f=ac(b,c,!1);if(f)throw new Q(f);if(!b.La.unlink)throw new Q(63);if(d.Ya)throw new Q(10);try{V.willDeletePath&&V.willDeletePath(a)}catch(g){F("FS.trackingDelegate['willDeletePath']('"+a+"') threw an exception: "+g.message)}b.La.unlink(b,c);Vb(d);try{if(V.onDeletePath)V.onDeletePath(a)}catch(g){F("FS.trackingDelegate['onDeletePath']('"+a+"') threw an exception: "+g.message)}} +function Sb(a){a=W(a).node;if(!a)throw new Q(44);if(!a.La.readlink)throw new Q(28);return Db(Tb(a.parent),a.La.readlink(a))}function ic(a,b){a=W(a,{Wa:!b}).node;if(!a)throw new Q(44);if(!a.La.Sa)throw new Q(63);return a.La.Sa(a)}function jc(a){return ic(a,!0)}function ca(a,b){var c;"string"===typeof a?c=W(a,{Wa:!0}).node:c=a;if(!c.La.Ra)throw new Q(63);c.La.Ra(c,{mode:b&4095|c.mode&-4096,timestamp:Date.now()})} +function kc(a){var b;"string"===typeof a?b=W(a,{Wa:!0}).node:b=a;if(!b.La.Ra)throw new Q(63);b.La.Ra(b,{timestamp:Date.now()})}function lc(a,b){if(0>b)throw new Q(28);var c;"string"===typeof a?c=W(a,{Wa:!0}).node:c=a;if(!c.La.Ra)throw new Q(63);if(S(c.mode))throw new Q(31);if(32768!==(c.mode&61440))throw new Q(28);if(a=Wb(c,"w"))throw new Q(a);c.La.Ra(c,{size:b,timestamp:Date.now()})} +function m(a,b,c,d){if(""===a)throw new Q(44);if("string"===typeof b){var f=Yb[b];if("undefined"===typeof f)throw Error("Unknown file open mode: "+b);b=f}c=b&64?("undefined"===typeof c?438:c)&4095|32768:0;if("object"===typeof a)var g=a;else{a=k(a);try{g=W(a,{Wa:!(b&131072)}).node}catch(n){}}f=!1;if(b&64)if(g){if(b&128)throw new Q(20);}else g=ba(a,c,0),f=!0;if(!g)throw new Q(44);8192===(g.mode&61440)&&(b&=-513);if(b&65536&&!S(g.mode))throw new Q(54);if(!f&&(c=g?40960===(g.mode&61440)?32:S(g.mode)&& +("r"!==Zb(b)||b&512)?31:Wb(g,Zb(b)):44))throw new Q(c);b&512&&lc(g,0);b&=-131713;d=cc({node:g,path:Tb(g),flags:b,seekable:!0,position:0,Ma:g.Ma,Kb:[],error:!1},d);d.Ma.open&&d.Ma.open(d);!e.logReadFiles||b&1||(Mc||(Mc={}),a in Mc||(Mc[a]=1,F("FS.trackingDelegate error on read file: "+a)));try{V.onOpenFile&&(g=0,1!==(b&2097155)&&(g|=1),0!==(b&2097155)&&(g|=2),V.onOpenFile(a,g))}catch(n){F("FS.trackingDelegate['onOpenFile']('"+a+"', flags) threw an exception: "+n.message)}return d} +function ja(a){if(null===a.fd)throw new Q(8);a.ib&&(a.ib=null);try{a.Ma.close&&a.Ma.close(a)}catch(b){throw b;}finally{T[a.fd]=null}a.fd=null}function Nc(a,b,c){if(null===a.fd)throw new Q(8);if(!a.seekable||!a.Ma.Xa)throw new Q(70);if(0!=c&&1!=c&&2!=c)throw new Q(28);a.position=a.Ma.Xa(a,b,c);a.Kb=[]} +function Pc(a,b,c,d,f){if(0>d||0>f)throw new Q(28);if(null===a.fd)throw new Q(8);if(1===(a.flags&2097155))throw new Q(8);if(S(a.node.mode))throw new Q(31);if(!a.Ma.read)throw new Q(28);var g="undefined"!==typeof f;if(!g)f=a.position;else if(!a.seekable)throw new Q(70);b=a.Ma.read(a,b,c,d,f);g||(a.position+=b);return b} +function fa(a,b,c,d,f,g){if(0>d||0>f)throw new Q(28);if(null===a.fd)throw new Q(8);if(0===(a.flags&2097155))throw new Q(8);if(S(a.node.mode))throw new Q(31);if(!a.Ma.write)throw new Q(28);a.seekable&&a.flags&1024&&Nc(a,0,2);var n="undefined"!==typeof f;if(!n)f=a.position;else if(!a.seekable)throw new Q(70);b=a.Ma.write(a,b,c,d,f,g);n||(a.position+=b);try{if(a.path&&V.onWriteToFile)V.onWriteToFile(a.path)}catch(t){F("FS.trackingDelegate['onWriteToFile']('"+a.path+"') threw an exception: "+t.message)}return b} +function ta(a){var b={encoding:"binary"};b=b||{};b.flags=b.flags||"r";b.encoding=b.encoding||"binary";if("utf8"!==b.encoding&&"binary"!==b.encoding)throw Error('Invalid encoding type "'+b.encoding+'"');var c,d=m(a,b.flags);a=ic(a).size;var f=new Uint8Array(a);Pc(d,f,0,a,0);"utf8"===b.encoding?c=Va(f,0):"binary"===b.encoding&&(c=f);ja(d);return c} +function Qc(){Q||(Q=function(a,b){this.node=b;this.Jb=function(c){this.Na=c};this.Jb(a);this.message="FS error"},Q.prototype=Error(),Q.prototype.constructor=Q,[44].forEach(function(a){Mb[a]=new Q(a);Mb[a].stack=""}))}var Rc;function aa(a,b){var c=0;a&&(c|=365);b&&(c|=146);return c} +function Sc(a,b,c){a=k("/dev/"+a);var d=aa(!!b,!!c);Tc||(Tc=64);var f=Tc++<<8|0;Gb(f,{open:function(g){g.seekable=!1},close:function(){c&&c.buffer&&c.buffer.length&&c(10)},read:function(g,n,t,w){for(var v=0,B=0;B>2]=d.dev;J[c+4>>2]=0;J[c+8>>2]=d.ino;J[c+12>>2]=d.mode;J[c+16>>2]=d.nlink;J[c+20>>2]=d.uid;J[c+24>>2]=d.gid;J[c+28>>2]=d.rdev;J[c+32>>2]=0;K=[d.size>>>0,(L=d.size,1<=+Math.abs(L)?0>>0:~~+Math.ceil((L-+(~~L>>>0))/4294967296)>>>0:0)];J[c+40>>2]=K[0];J[c+44>>2]=K[1];J[c+48>>2]=4096;J[c+52>>2]=d.blocks;J[c+56>>2]=d.atime.getTime()/1E3|0;J[c+60>>2]= +0;J[c+64>>2]=d.mtime.getTime()/1E3|0;J[c+68>>2]=0;J[c+72>>2]=d.ctime.getTime()/1E3|0;J[c+76>>2]=0;K=[d.ino>>>0,(L=d.ino,1<=+Math.abs(L)?0>>0:~~+Math.ceil((L-+(~~L>>>0))/4294967296)>>>0:0)];J[c+80>>2]=K[0];J[c+84>>2]=K[1];return 0}var Wc=void 0;function Xc(){Wc+=4;return J[Wc-4>>2]}function Z(a){a=T[a];if(!a)throw new Q(8);return a}var Yc={}; +function Zc(){if(!$c){var a={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"===typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:ya||"./this.program"},b;for(b in Yc)a[b]=Yc[b];var c=[];for(b in a)c.push(b+"="+a[b]);$c=c}return $c}var $c,ad;Aa?ad=function(){var a=process.hrtime();return 1E3*a[0]+a[1]/1E6}:"undefined"!==typeof dateNow?ad=dateNow:ad=function(){return performance.now()}; +function bd(a){for(var b=ad();ad()-b
>2]);J[b>>2]=a.getSeconds();J[b+4>>2]=a.getMinutes();J[b+8>>2]=a.getHours();J[b+12>>2]=a.getDate();J[b+16>>2]=a.getMonth();J[b+20>>2]=a.getFullYear()-1900;J[b+24>>2]=a.getDay();var c=new Date(a.getFullYear(),0,1);J[b+28>>2]=(a.getTime()-c.getTime())/864E5|0;J[b+36>>2]=-(60*a.getTimezoneOffset());var d=(new Date(a.getFullYear(),6,1)).getTimezoneOffset(); +c=c.getTimezoneOffset();a=(d!=c&&a.getTimezoneOffset()==Math.min(c,d))|0;J[b+32>>2]=a;a=J[wb()+(a?4:0)>>2];J[b+40>>2]=a;return b},I:function(a,b){try{a=O(a);if(b&-8)var c=-28;else{var d;(d=W(a,{Wa:!0}).node)?(a="",b&4&&(a+="r"),b&2&&(a+="w"),b&1&&(a+="x"),c=a&&Wb(d,a)?-2:0):c=-44}return c}catch(f){return"undefined"!==typeof Y&&f instanceof Q||I(f),-f.Na}},t:function(a,b){try{return a=O(a),ca(a,b),0}catch(c){return"undefined"!==typeof Y&&c instanceof Q||I(c),-c.Na}},z:function(a){try{return a=O(a), +kc(a),0}catch(b){return"undefined"!==typeof Y&&b instanceof Q||I(b),-b.Na}},u:function(a,b){try{var c=T[a];if(!c)throw new Q(8);ca(c.node,b);return 0}catch(d){return"undefined"!==typeof Y&&d instanceof Q||I(d),-d.Na}},B:function(a){try{var b=T[a];if(!b)throw new Q(8);kc(b.node);return 0}catch(c){return"undefined"!==typeof Y&&c instanceof Q||I(c),-c.Na}},c:function(a,b,c){Wc=c;try{var d=Z(a);switch(b){case 0:var f=Xc();return 0>f?-28:m(d.path,d.flags,0,f).fd;case 1:case 2:return 0;case 3:return d.flags; +case 4:return f=Xc(),d.flags|=f,0;case 12:return f=Xc(),La[f+0>>1]=2,0;case 13:case 14:return 0;case 16:case 8:return-28;case 9:return Ab(28),-1;default:return-28}}catch(g){return"undefined"!==typeof Y&&g instanceof Q||I(g),-g.Na}},w:function(a,b){try{var c=Z(a);return Vc(ic,c.path,b)}catch(d){return"undefined"!==typeof Y&&d instanceof Q||I(d),-d.Na}},F:function(a,b,c){try{var d=T[a];if(!d)throw new Q(8);if(0===(d.flags&2097155))throw new Q(28);lc(d.node,c);return 0}catch(f){return"undefined"!==typeof Y&& +f instanceof Q||I(f),-f.Na}},J:function(a,b){try{if(0===b)return-28;if(b=c)var d=-28;else{var f=Sb(a),g=Math.min(c,oa(f)),n=x[b+g];pa(f,N,b,c+1);x[b+g]=n;d=g}return d}catch(t){return"undefined"!==typeof Y&&t instanceof Q||I(t),-t.Na}},H:function(a){try{a=O(a);var b=W(a,{parent:!0}).node,c=zb(a),d=Nb(b,c),f=ac(b,c,!0);if(f)throw new Q(f);if(!b.La.rmdir)throw new Q(63);if(d.Ya)throw new Q(10);try{V.willDeletePath&&V.willDeletePath(a)}catch(g){F("FS.trackingDelegate['willDeletePath']('"+a+"') threw an exception: "+ +g.message)}b.La.rmdir(b,c);Vb(d);try{if(V.onDeletePath)V.onDeletePath(a)}catch(g){F("FS.trackingDelegate['onDeletePath']('"+a+"') threw an exception: "+g.message)}return 0}catch(g){return"undefined"!==typeof Y&&g instanceof Q||I(g),-g.Na}},g:function(a,b){try{return a=O(a),Vc(ic,a,b)}catch(c){return"undefined"!==typeof Y&&c instanceof Q||I(c),-c.Na}},G:function(a){try{return a=O(a),ua(a),0}catch(b){return"undefined"!==typeof Y&&b instanceof Q||I(b),-b.Na}},m:function(a,b,c){N.copyWithin(a,b,b+c)}, +d:function(a){a>>>=0;var b=N.length;if(2147483648=c;c*=2){var d=b*(1+.2/c);d=Math.min(d,a+100663296);d=Math.max(16777216,a,d);0>>16);Ya(M.buffer);var f=1;break a}catch(g){}f=void 0}if(f)return!0}return!1},o:function(a,b){var c=0;Zc().forEach(function(d,f){var g=b+c;f=J[a+4*f>>2]=g;for(g=0;g>0]=d.charCodeAt(g);x[f>>0]=0;c+=d.length+1});return 0},p:function(a,b){var c= +Zc();J[a>>2]=c.length;var d=0;c.forEach(function(f){d+=f.length+1});J[b>>2]=d;return 0},f:function(a){try{var b=Z(a);ja(b);return 0}catch(c){return"undefined"!==typeof Y&&c instanceof Q||I(c),c.Na}},n:function(a,b){try{var c=Z(a);x[b>>0]=c.tty?2:S(c.mode)?3:40960===(c.mode&61440)?7:4;return 0}catch(d){return"undefined"!==typeof Y&&d instanceof Q||I(d),d.Na}},l:function(a,b,c,d,f){try{var g=Z(a);a=4294967296*c+(b>>>0);if(-9007199254740992>=a||9007199254740992<=a)return-61;Nc(g,a,d);K=[g.position>>> +0,(L=g.position,1<=+Math.abs(L)?0>>0:~~+Math.ceil((L-+(~~L>>>0))/4294967296)>>>0:0)];J[f>>2]=K[0];J[f+4>>2]=K[1];g.ib&&0===a&&0===d&&(g.ib=null);return 0}catch(n){return"undefined"!==typeof Y&&n instanceof Q||I(n),n.Na}},E:function(a){try{var b=Z(a);return b.Ma&&b.Ma.fsync?-b.Ma.fsync(b):0}catch(c){return"undefined"!==typeof Y&&c instanceof Q||I(c),c.Na}},y:function(a,b,c,d){try{a:{for(var f=Z(a),g=a=0;g>2],J[b+(8* +g+4)>>2],void 0);if(0>n){var t=-1;break a}a+=n}t=a}J[d>>2]=t;return 0}catch(w){return"undefined"!==typeof Y&&w instanceof Q||I(w),w.Na}},h:function(a){var b=Date.now();J[a>>2]=b/1E3|0;J[a+4>>2]=b%1E3*1E3|0;return 0},a:M,K:function(a,b){if(0===a)return Ab(28),-1;var c=J[a>>2];a=J[a+4>>2];if(0>a||999999999c)return Ab(28),-1;0!==b&&(J[b>>2]=0,J[b+4>>2]=0);return bd(1E6*c+a/1E3)},A:function(a){switch(a){case 30:return 16384;case 85:return 131072;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 80:case 81:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:case 79:return 200809; +case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32; +case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1E3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:return"object"===typeof navigator?navigator.hardwareConcurrency||1:1}Ab(28);return-1}, +L:function(a){var b=Date.now()/1E3|0;a&&(J[a>>2]=b);return b},r:function(a,b){if(b){var c=1E3*J[b+8>>2];c+=J[b+12>>2]/1E3}else c=Date.now();a=O(a);try{b=c;var d=W(a,{Wa:!0}).node;d.La.Ra(d,{timestamp:Math.max(b,c)});return 0}catch(f){a=f;if(!(a instanceof Q)){a+=" : ";a:{d=Error();if(!d.stack){try{throw Error();}catch(g){d=g}if(!d.stack){d="(no stack trace available)";break a}}d=d.stack.toString()}e.extraStackTrace&&(d+="\n"+e.extraStackTrace());d=ob(d);throw a+d;}Ab(a.Na);return-1}}}; +(function(){function a(f){e.asm=f.exports;Ja=e.asm.M;eb--;e.monitorRunDependencies&&e.monitorRunDependencies(eb);0==eb&&(null!==fb&&(clearInterval(fb),fb=null),gb&&(f=gb,gb=null,f()))}function b(f){a(f.instance)}function c(f){return mb().then(function(g){return WebAssembly.instantiate(g,d)}).then(f,function(g){F("failed to asynchronously prepare wasm: "+g);I(g)})}var d={a:fd};eb++;e.monitorRunDependencies&&e.monitorRunDependencies(eb);if(e.instantiateWasm)try{return e.instantiateWasm(d,a)}catch(f){return F("Module.instantiateWasm callback failed with error: "+ +f),!1}(function(){if(Ka||"function"!==typeof WebAssembly.instantiateStreaming||jb()||hb("file://")||"function"!==typeof fetch)return c(b);fetch(ib,{credentials:"same-origin"}).then(function(f){return WebAssembly.instantiateStreaming(f,d).then(b,function(g){F("wasm streaming compile failed: "+g);F("falling back to ArrayBuffer instantiation");return c(b)})})})();return{}})(); +var cd=e.___wasm_call_ctors=function(){return(cd=e.___wasm_call_ctors=e.asm.N).apply(null,arguments)},ed=e._memset=function(){return(ed=e._memset=e.asm.O).apply(null,arguments)};e._sqlite3_free=function(){return(e._sqlite3_free=e.asm.P).apply(null,arguments)};var Bb=e.___errno_location=function(){return(Bb=e.___errno_location=e.asm.Q).apply(null,arguments)};e._sqlite3_finalize=function(){return(e._sqlite3_finalize=e.asm.R).apply(null,arguments)}; +e._sqlite3_reset=function(){return(e._sqlite3_reset=e.asm.S).apply(null,arguments)};e._sqlite3_clear_bindings=function(){return(e._sqlite3_clear_bindings=e.asm.T).apply(null,arguments)};e._sqlite3_value_blob=function(){return(e._sqlite3_value_blob=e.asm.U).apply(null,arguments)};e._sqlite3_value_text=function(){return(e._sqlite3_value_text=e.asm.V).apply(null,arguments)};e._sqlite3_value_bytes=function(){return(e._sqlite3_value_bytes=e.asm.W).apply(null,arguments)}; +e._sqlite3_value_double=function(){return(e._sqlite3_value_double=e.asm.X).apply(null,arguments)};e._sqlite3_value_int=function(){return(e._sqlite3_value_int=e.asm.Y).apply(null,arguments)};e._sqlite3_value_type=function(){return(e._sqlite3_value_type=e.asm.Z).apply(null,arguments)};e._sqlite3_result_blob=function(){return(e._sqlite3_result_blob=e.asm._).apply(null,arguments)};e._sqlite3_result_double=function(){return(e._sqlite3_result_double=e.asm.$).apply(null,arguments)}; +e._sqlite3_result_error=function(){return(e._sqlite3_result_error=e.asm.aa).apply(null,arguments)};e._sqlite3_result_int=function(){return(e._sqlite3_result_int=e.asm.ba).apply(null,arguments)};e._sqlite3_result_int64=function(){return(e._sqlite3_result_int64=e.asm.ca).apply(null,arguments)};e._sqlite3_result_null=function(){return(e._sqlite3_result_null=e.asm.da).apply(null,arguments)};e._sqlite3_result_text=function(){return(e._sqlite3_result_text=e.asm.ea).apply(null,arguments)}; +e._sqlite3_step=function(){return(e._sqlite3_step=e.asm.fa).apply(null,arguments)};e._sqlite3_column_count=function(){return(e._sqlite3_column_count=e.asm.ga).apply(null,arguments)};e._sqlite3_data_count=function(){return(e._sqlite3_data_count=e.asm.ha).apply(null,arguments)};e._sqlite3_column_blob=function(){return(e._sqlite3_column_blob=e.asm.ia).apply(null,arguments)};e._sqlite3_column_bytes=function(){return(e._sqlite3_column_bytes=e.asm.ja).apply(null,arguments)}; +e._sqlite3_column_double=function(){return(e._sqlite3_column_double=e.asm.ka).apply(null,arguments)};e._sqlite3_column_text=function(){return(e._sqlite3_column_text=e.asm.la).apply(null,arguments)};e._sqlite3_column_type=function(){return(e._sqlite3_column_type=e.asm.ma).apply(null,arguments)};e._sqlite3_column_name=function(){return(e._sqlite3_column_name=e.asm.na).apply(null,arguments)};e._sqlite3_bind_blob=function(){return(e._sqlite3_bind_blob=e.asm.oa).apply(null,arguments)}; +e._sqlite3_bind_double=function(){return(e._sqlite3_bind_double=e.asm.pa).apply(null,arguments)};e._sqlite3_bind_int=function(){return(e._sqlite3_bind_int=e.asm.qa).apply(null,arguments)};e._sqlite3_bind_text=function(){return(e._sqlite3_bind_text=e.asm.ra).apply(null,arguments)};e._sqlite3_bind_parameter_index=function(){return(e._sqlite3_bind_parameter_index=e.asm.sa).apply(null,arguments)};e._sqlite3_errmsg=function(){return(e._sqlite3_errmsg=e.asm.ta).apply(null,arguments)}; +e._sqlite3_exec=function(){return(e._sqlite3_exec=e.asm.ua).apply(null,arguments)};e._sqlite3_prepare_v2=function(){return(e._sqlite3_prepare_v2=e.asm.va).apply(null,arguments)};e._sqlite3_changes=function(){return(e._sqlite3_changes=e.asm.wa).apply(null,arguments)};e._sqlite3_close_v2=function(){return(e._sqlite3_close_v2=e.asm.xa).apply(null,arguments)};e._sqlite3_create_function_v2=function(){return(e._sqlite3_create_function_v2=e.asm.ya).apply(null,arguments)}; +e._sqlite3_open=function(){return(e._sqlite3_open=e.asm.za).apply(null,arguments)};var Ta=e._malloc=function(){return(Ta=e._malloc=e.asm.Aa).apply(null,arguments)},ma=e._free=function(){return(ma=e._free=e.asm.Ba).apply(null,arguments)};e._RegisterExtensionFunctions=function(){return(e._RegisterExtensionFunctions=e.asm.Ca).apply(null,arguments)}; +var wb=e.__get_tzname=function(){return(wb=e.__get_tzname=e.asm.Da).apply(null,arguments)},ub=e.__get_daylight=function(){return(ub=e.__get_daylight=e.asm.Ea).apply(null,arguments)},tb=e.__get_timezone=function(){return(tb=e.__get_timezone=e.asm.Fa).apply(null,arguments)},na=e.stackSave=function(){return(na=e.stackSave=e.asm.Ga).apply(null,arguments)},ra=e.stackRestore=function(){return(ra=e.stackRestore=e.asm.Ha).apply(null,arguments)},u=e.stackAlloc=function(){return(u=e.stackAlloc=e.asm.Ia).apply(null, +arguments)},dd=e._memalign=function(){return(dd=e._memalign=e.asm.Ja).apply(null,arguments)};e.cwrap=function(a,b,c,d){c=c||[];var f=c.every(function(g){return"number"===g});return"string"!==b&&f&&!d?Pa(a):function(){return Qa(a,b,c,arguments)}};e.stackSave=na;e.stackRestore=ra;e.stackAlloc=u;var gd;gb=function hd(){gd||id();gd||(gb=hd)}; +function id(){function a(){if(!gd&&(gd=!0,e.calledRun=!0,!Oa)){e.noFSInit||Rc||(Rc=!0,Qc(),e.stdin=e.stdin,e.stdout=e.stdout,e.stderr=e.stderr,e.stdin?Sc("stdin",e.stdin):hc("/dev/tty","/dev/stdin"),e.stdout?Sc("stdout",null,e.stdout):hc("/dev/tty","/dev/stdout"),e.stderr?Sc("stderr",null,e.stderr):hc("/dev/tty1","/dev/stderr"),m("/dev/stdin","r"),m("/dev/stdout","w"),m("/dev/stderr","w"));nb(ab);Rb=!1;nb(bb);if(e.onRuntimeInitialized)e.onRuntimeInitialized();if(e.postRun)for("function"==typeof e.postRun&& +(e.postRun=[e.postRun]);e.postRun.length;){var b=e.postRun.shift();cb.unshift(b)}nb(cb)}}if(!(0{"require"!==e&&(e+=".js");let a=Promise.resolve();return i[e]||(a=new Promise(async a=>{if("document"in self){const i=document.createElement("script");i.src=e,document.head.appendChild(i),i.onload=a}else importScripts(e),a()})),a.then(()=>{if(!i[e])throw new Error(`Module ${e} didn’t register its module`);return i[e]})},a=(a,i)=>{Promise.all(a.map(e)).then(e=>i(1===e.length?e[0]:e))},i={require:Promise.resolve(a)};self.define=(a,t,r)=>{i[a]||(i[a]=Promise.resolve().then(()=>{let i={};const c={uri:location.origin+a.slice(1)};return Promise.all(t.map(a=>{switch(a){case"exports":return i;case"module":return c;default:return e(a)}})).then(e=>{const a=r(...e);return i.default||(i.default=a),i})}))}}define("./service-worker.js",["./workbox-69b5a3b7"],(function(e){"use strict";self.addEventListener("message",e=>{e.data&&"SKIP_WAITING"===e.data.type&&self.skipWaiting()}),e.precacheAndRoute([{url:"autobundle.js",revision:"13c52d778d9424443ebc2f01ea905320"},{url:"autohtml/abstractWindowTemplate.html",revision:"6c3ea1af1622920ddbc5bf4b548792f1"},{url:"autohtml/alphabeticListFragment.html",revision:"17b160c9c961ee83eced3a2c7d5f7749"},{url:"autohtml/changeUserSite.html",revision:"32ca48dd5c17c3ca7259a192c6ad3e5f"},{url:"autohtml/chooseDialog.html",revision:"1e4a0cfb29c721b64799c342f7586ad6"},{url:"autohtml/contactSite.html",revision:"2cdee4e20c1728e1f8e03110cbfcbd4c"},{url:"autohtml/container.html",revision:"7c9ef0046546b6535e2197845804df3d"},{url:"autohtml/credits.html",revision:"7ad14642353efd449a3890122bb73b1e"},{url:"autohtml/end.html",revision:"162cd57d50145eb4dbf51ca7bc97256a"},{url:"autohtml/forgotPasswordSite.html",revision:"ef290b527ae9e6ecf6e2ec31ecc99b87"},{url:"autohtml/impressum.html",revision:"1533d5dba0bd88309b004d65bc59c5f1"},{url:"autohtml/level.html",revision:"05cef7e7e823c25ed8bb735da3cf585b"},{url:"autohtml/loginSite.html",revision:"28536b28261bdd966784e32ef8e8bda2"},{url:"autohtml/menu.html",revision:"a356869e90f07077cc3a07dd36c238c5"},{url:"autohtml/menuSite.html",revision:"926a7a940ae8741445644f16132a9f20"},{url:"autohtml/navbar.html",revision:"04c4cb0adaa4e69cb43fb35cc8482b0a"},{url:"autohtml/notAllowedSite.html",revision:"da6b73654dccd61eebe8f4f1ba06e340"},{url:"autohtml/privacyPolicy.html",revision:"7319848c6b090b0af30ac56492101ee8"},{url:"autohtml/registrationSite.html",revision:"0911eeabc518befa874ea1661b64c3d7"},{url:"autohtml/selectUserDialog.html",revision:"23ae55ef46c250f2ab2528f4422a14d6"},{url:"autohtml/settings.html",revision:"d8a6ead5c9f8dd6f6319b61caab9d359"},{url:"autohtml/settingsSite.html",revision:"06f47ad4321d3ede658035e0411df0b0"},{url:"autohtml/shareDialog.html",revision:"cc8b45e9c7f6264e7b61d6da3e6210c6"},{url:"autohtml/swipeFragment.html",revision:"553c580ff0a282c49a2efe35dabad809"},{url:"autohtml/tabFragment.html",revision:"ca8c3b2c4a353a0ee7900aef656cc958"},{url:"autoimg/arrowLeft.svg",revision:"6bbb4f0e313bb88cd0cc80c2b3cd36fc"},{url:"autoimg/background.png",revision:"be3db85ac9a143f4bcac7db7f5a4856e"},{url:"autoimg/brightAndBeautifull__.mp3",revision:"2b40fd6c076d254cf639f8f46819d5ca"},{url:"autoimg/coin.png",revision:"5b380862ff8349f6b4b8d5241893f508"},{url:"autoimg/coinTower.png",revision:"50cef0780a1affcd301c2c4be09ccb25"},{url:"autoimg/errorIcon.png",revision:"b48a01a1871b83b30c317f0fc4aed555"},{url:"autoimg/help.png",revision:"45a8dc0493279dc37f72f8026af5bc10"},{url:"autoimg/logo.png",revision:"5246599497de18a878951e1e98083493"},{url:"autoimg/music.svg",revision:"ce36074e94a8d19dfa383f98bd66a1f4"},{url:"autoimg/settings.png",revision:"c44ce577ac56632e53208833ff78e67f"},{url:"autoimg/share.svg",revision:"ac8fc0221ee400fc843090a834df7c9d"},{url:"autoimg/single_coin_fall_on_concrete_.mp3",revision:"7f0de4f503644a7fc14de7e307bbf722"},{url:"autoimg/speaker.svg",revision:"0d926850f1558dd431e1c6b10fe0c2ef"},{url:"autoimg/telegram.svg",revision:"e366fed4603e06142a2d6b8221be51b8"},{url:"autoimg/whatsapp.svg",revision:"0fa4092ac1f91a5390e74a3c2c03d5e3"},{url:"autoindex.css",revision:"57dd368ab96459de433a2a3cbacc765d"},{url:"autoindex.html",revision:"d9da26b18b24767c7bedb06a44bc31ce"},{url:"autoscripts/localforage.js",revision:"7ae08028a75fed2acce92b8e75fbe08c"},{url:"autoscripts/sql-wasm.js",revision:"b34648b4b4c89ba52bcd7468fa035583"},{url:"autosql-wasm.wasm",revision:"bff856e0a3429d33cfb88d20b7f9fcff"}],{})})); +/** + * Copyright 2018 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// If the loader is already loaded, just stop. +if (!self.define) { + const singleRequire = name => { + if (name !== 'require') { + name = name + '.js'; + } + let promise = Promise.resolve(); + if (!registry[name]) { + + promise = new Promise(async resolve => { + if ("document" in self) { + const script = document.createElement("script"); + script.src = name; + document.head.appendChild(script); + script.onload = resolve; + } else { + importScripts(name); + resolve(); + } + }); + + } + return promise.then(() => { + if (!registry[name]) { + throw new Error(`Module ${name} didn’t register its module`); + } + return registry[name]; + }); + }; + + const require = (names, resolve) => { + Promise.all(names.map(singleRequire)) + .then(modules => resolve(modules.length === 1 ? modules[0] : modules)); + }; + + const registry = { + require: Promise.resolve(require) + }; + + self.define = (moduleName, depsNames, factory) => { + if (registry[moduleName]) { + // Module is already loading or loaded. + return; + } + registry[moduleName] = Promise.resolve().then(() => { + let exports = {}; + const module = { + uri: location.origin + moduleName.slice(1) + }; + return Promise.all( + depsNames.map(depName => { + switch(depName) { + case "exports": + return exports; + case "module": + return module; + default: + return singleRequire(depName); + } + }) + ).then(deps => { + const facValue = factory(...deps); + if(!exports.default) { + exports.default = facValue; + } + return exports; + }); + }); + }; +} +define("./service-worker.js",['./workbox-3b8b670f'], function (workbox) { 'use strict'; + + /** + * Welcome to your Workbox-powered service worker! + * + * You'll need to register this file in your web app. + * See https://goo.gl/nhQhGp + * + * The rest of the code is auto-generated. Please don't update this file + * directly; instead, make changes to your Workbox build configuration + * and re-run your build process. + * See https://goo.gl/2aRDsh + */ + + self.addEventListener('message', event => { + if (event.data && event.data.type === 'SKIP_WAITING') { + self.skipWaiting(); + } + }); + /** + * The precacheAndRoute() method efficiently caches and responds to + * requests for URLs in the manifest. + * See https://goo.gl/S9QRab + */ + + workbox.precacheAndRoute([{ + "url": "bundle.js", + "revision": "45af70c24da2c923b2e86465e4fca63c" + }, { + "url": "html/abstractWindowTemplate.html", + "revision": "00bb2496dac07a457654781fa8c6948c" + }, { + "url": "html/alphabeticListFragment.html", + "revision": "05e1a0c8574de51e0de78277af030920" + }, { + "url": "html/changeUserSite.html", + "revision": "b416ddd8f231490201243a26afa49ca8" + }, { + "url": "html/chooseDialog.html", + "revision": "0171b83550d8a21f1332a5360c10baf5" + }, { + "url": "html/contactSite.html", + "revision": "b8acb685882c2cb4a970e5a7615a5c5d" + }, { + "url": "html/container.html", + "revision": "a7285c607fdacd912f47738462150efe" + }, { + "url": "html/credits.html", + "revision": "efb301e087d02b5dcd97ecda45e661ca" + }, { + "url": "html/end.html", + "revision": "8aa547874fa8716e1ddb8d29276dcc91" + }, { + "url": "html/forgotPasswordSite.html", + "revision": "b063ea7614dce48ed6794400d34b135f" + }, { + "url": "html/impressum.html", + "revision": "d0e2e95559a8820115ac92659e3d2590" + }, { + "url": "html/level.html", + "revision": "481bf599c219a9f2d94eae4096fc6d79" + }, { + "url": "html/loginSite.html", + "revision": "4d8c2f02ba16dbf38ad679827cbd62f2" + }, { + "url": "html/menu.html", + "revision": "06cf7df2e0e4918542d0d83f21a1c2b0" + }, { + "url": "html/menuSite.html", + "revision": "8dae573b1dcba5727f4bc598b1a09007" + }, { + "url": "html/navbar.html", + "revision": "482d5ac8a3b6ea9ae3f06543d3eed977" + }, { + "url": "html/notAllowedSite.html", + "revision": "2a65f4f3da6f1f508736bd63c3d093ea" + }, { + "url": "html/privacyPolicy.html", + "revision": "f55a77320c0744ac684231107bd51012" + }, { + "url": "html/registrationSite.html", + "revision": "5d732604002df8c6eb1f206709bc4b9a" + }, { + "url": "html/selectUserDialog.html", + "revision": "3cd8fc58c0d2c6a260747475f861b855" + }, { + "url": "html/settings.html", + "revision": "5a7cf19679ca839e4badd6624b6c35aa" + }, { + "url": "html/settingsSite.html", + "revision": "c20c185a3dd15b8e5a62d9934f0402f5" + }, { + "url": "html/shareDialog.html", + "revision": "49fd3d7553c48ecc11c3861afc0b0771" + }, { + "url": "html/swipeFragment.html", + "revision": "3278efb5dd279a359cdd950fa002b234" + }, { + "url": "html/tabFragment.html", + "revision": "733ad585b3927993d15cbd04e9c135da" + }, { + "url": "html/tutorialSite.html", + "revision": "24b319cd6fbb2d54fa57fdf46176287a" + }, { + "url": "img/arrowLeft.svg", + "revision": "6bbb4f0e313bb88cd0cc80c2b3cd36fc" + }, { + "url": "img/brightAndBeautifull__.mp3", + "revision": "2b40fd6c076d254cf639f8f46819d5ca" + }, { + "url": "img/coin.png", + "revision": "5b380862ff8349f6b4b8d5241893f508" + }, { + "url": "img/coinTower.png", + "revision": "50cef0780a1affcd301c2c4be09ccb25" + }, { + "url": "img/errorIcon.png", + "revision": "b48a01a1871b83b30c317f0fc4aed555" + }, { + "url": "img/help.png", + "revision": "45a8dc0493279dc37f72f8026af5bc10" + }, { + "url": "img/logo.png", + "revision": "5246599497de18a878951e1e98083493" + }, { + "url": "img/music.svg", + "revision": "ce36074e94a8d19dfa383f98bd66a1f4" + }, { + "url": "img/settings.png", + "revision": "c44ce577ac56632e53208833ff78e67f" + }, { + "url": "img/share.svg", + "revision": "ac8fc0221ee400fc843090a834df7c9d" + }, { + "url": "img/single_coin_fall_on_concrete_.mp3", + "revision": "7f0de4f503644a7fc14de7e307bbf722" + }, { + "url": "img/speaker.svg", + "revision": "0d926850f1558dd431e1c6b10fe0c2ef" + }, { + "url": "img/telegram.svg", + "revision": "e366fed4603e06142a2d6b8221be51b8" + }, { + "url": "img/whatsapp.svg", + "revision": "0fa4092ac1f91a5390e74a3c2c03d5e3" + }, { + "url": "index.css", + "revision": "6fc107452ad861200f8193f85e7709c2" + }, { + "url": "index.html", + "revision": "5f8832bceb6eae4ba8126bf5b03e0d38" + }, { + "url": "scripts/localforage.js", + "revision": "7e2a4110781376e372c538e67787773a" + }, { + "url": "scripts/sql-wasm.js", + "revision": "7da4edc42b013dcff1b48e8c02867e26" + }, { + "url": "sql-wasm.wasm", + "revision": "bff856e0a3429d33cfb88d20b7f9fcff" + }], {}); + +}); //# sourceMappingURL=service-worker.js.map diff --git a/src/server/public/service-worker.js.map b/src/server/public/service-worker.js.map index 374c953..27f34aa 100644 --- a/src/server/public/service-worker.js.map +++ b/src/server/public/service-worker.js.map @@ -1 +1 @@ -{"version":3,"file":"service-worker.js","sources":["../../../../../tmp/e3f29bc3b67803fdffb5ae8cb8dc01fe/service-worker.js"],"sourcesContent":["import {precacheAndRoute as workbox_precaching_precacheAndRoute} from '/home/silas/Projekte/web/wordRotator/node_modules/workbox-precaching/precacheAndRoute.mjs';/**\n * Welcome to your Workbox-powered service worker!\n *\n * You'll need to register this file in your web app.\n * See https://goo.gl/nhQhGp\n *\n * The rest of the code is auto-generated. Please don't update this file\n * directly; instead, make changes to your Workbox build configuration\n * and re-run your build process.\n * See https://goo.gl/2aRDsh\n */\n\n\n\n\n\n\n\n\nself.addEventListener('message', (event) => {\n if (event.data && event.data.type === 'SKIP_WAITING') {\n self.skipWaiting();\n }\n});\n\n\n\n\n/**\n * The precacheAndRoute() method efficiently caches and responds to\n * requests for URLs in the manifest.\n * See https://goo.gl/S9QRab\n */\nworkbox_precaching_precacheAndRoute([\n {\n \"url\": \"autobundle.js\",\n \"revision\": \"13c52d778d9424443ebc2f01ea905320\"\n },\n {\n \"url\": \"autohtml/abstractWindowTemplate.html\",\n \"revision\": \"6c3ea1af1622920ddbc5bf4b548792f1\"\n },\n {\n \"url\": \"autohtml/alphabeticListFragment.html\",\n \"revision\": \"17b160c9c961ee83eced3a2c7d5f7749\"\n },\n {\n \"url\": \"autohtml/changeUserSite.html\",\n \"revision\": \"32ca48dd5c17c3ca7259a192c6ad3e5f\"\n },\n {\n \"url\": \"autohtml/chooseDialog.html\",\n \"revision\": \"1e4a0cfb29c721b64799c342f7586ad6\"\n },\n {\n \"url\": \"autohtml/contactSite.html\",\n \"revision\": \"2cdee4e20c1728e1f8e03110cbfcbd4c\"\n },\n {\n \"url\": \"autohtml/container.html\",\n \"revision\": \"7c9ef0046546b6535e2197845804df3d\"\n },\n {\n \"url\": \"autohtml/credits.html\",\n \"revision\": \"7ad14642353efd449a3890122bb73b1e\"\n },\n {\n \"url\": \"autohtml/end.html\",\n \"revision\": \"162cd57d50145eb4dbf51ca7bc97256a\"\n },\n {\n \"url\": \"autohtml/forgotPasswordSite.html\",\n \"revision\": \"ef290b527ae9e6ecf6e2ec31ecc99b87\"\n },\n {\n \"url\": \"autohtml/impressum.html\",\n \"revision\": \"1533d5dba0bd88309b004d65bc59c5f1\"\n },\n {\n \"url\": \"autohtml/level.html\",\n \"revision\": \"05cef7e7e823c25ed8bb735da3cf585b\"\n },\n {\n \"url\": \"autohtml/loginSite.html\",\n \"revision\": \"28536b28261bdd966784e32ef8e8bda2\"\n },\n {\n \"url\": \"autohtml/menu.html\",\n \"revision\": \"a356869e90f07077cc3a07dd36c238c5\"\n },\n {\n \"url\": \"autohtml/menuSite.html\",\n \"revision\": \"926a7a940ae8741445644f16132a9f20\"\n },\n {\n \"url\": \"autohtml/navbar.html\",\n \"revision\": \"04c4cb0adaa4e69cb43fb35cc8482b0a\"\n },\n {\n \"url\": \"autohtml/notAllowedSite.html\",\n \"revision\": \"da6b73654dccd61eebe8f4f1ba06e340\"\n },\n {\n \"url\": \"autohtml/privacyPolicy.html\",\n \"revision\": \"7319848c6b090b0af30ac56492101ee8\"\n },\n {\n \"url\": \"autohtml/registrationSite.html\",\n \"revision\": \"0911eeabc518befa874ea1661b64c3d7\"\n },\n {\n \"url\": \"autohtml/selectUserDialog.html\",\n \"revision\": \"23ae55ef46c250f2ab2528f4422a14d6\"\n },\n {\n \"url\": \"autohtml/settings.html\",\n \"revision\": \"d8a6ead5c9f8dd6f6319b61caab9d359\"\n },\n {\n \"url\": \"autohtml/settingsSite.html\",\n \"revision\": \"06f47ad4321d3ede658035e0411df0b0\"\n },\n {\n \"url\": \"autohtml/shareDialog.html\",\n \"revision\": \"cc8b45e9c7f6264e7b61d6da3e6210c6\"\n },\n {\n \"url\": \"autohtml/swipeFragment.html\",\n \"revision\": \"553c580ff0a282c49a2efe35dabad809\"\n },\n {\n \"url\": \"autohtml/tabFragment.html\",\n \"revision\": \"ca8c3b2c4a353a0ee7900aef656cc958\"\n },\n {\n \"url\": \"autoimg/arrowLeft.svg\",\n \"revision\": \"6bbb4f0e313bb88cd0cc80c2b3cd36fc\"\n },\n {\n \"url\": \"autoimg/background.png\",\n \"revision\": \"be3db85ac9a143f4bcac7db7f5a4856e\"\n },\n {\n \"url\": \"autoimg/brightAndBeautifull__.mp3\",\n \"revision\": \"2b40fd6c076d254cf639f8f46819d5ca\"\n },\n {\n \"url\": \"autoimg/coin.png\",\n \"revision\": \"5b380862ff8349f6b4b8d5241893f508\"\n },\n {\n \"url\": \"autoimg/coinTower.png\",\n \"revision\": \"50cef0780a1affcd301c2c4be09ccb25\"\n },\n {\n \"url\": \"autoimg/errorIcon.png\",\n \"revision\": \"b48a01a1871b83b30c317f0fc4aed555\"\n },\n {\n \"url\": \"autoimg/help.png\",\n \"revision\": \"45a8dc0493279dc37f72f8026af5bc10\"\n },\n {\n \"url\": \"autoimg/logo.png\",\n \"revision\": \"5246599497de18a878951e1e98083493\"\n },\n {\n \"url\": \"autoimg/music.svg\",\n \"revision\": \"ce36074e94a8d19dfa383f98bd66a1f4\"\n },\n {\n \"url\": \"autoimg/settings.png\",\n \"revision\": \"c44ce577ac56632e53208833ff78e67f\"\n },\n {\n \"url\": \"autoimg/share.svg\",\n \"revision\": \"ac8fc0221ee400fc843090a834df7c9d\"\n },\n {\n \"url\": \"autoimg/single_coin_fall_on_concrete_.mp3\",\n \"revision\": \"7f0de4f503644a7fc14de7e307bbf722\"\n },\n {\n \"url\": \"autoimg/speaker.svg\",\n \"revision\": \"0d926850f1558dd431e1c6b10fe0c2ef\"\n },\n {\n \"url\": \"autoimg/telegram.svg\",\n \"revision\": \"e366fed4603e06142a2d6b8221be51b8\"\n },\n {\n \"url\": \"autoimg/whatsapp.svg\",\n \"revision\": \"0fa4092ac1f91a5390e74a3c2c03d5e3\"\n },\n {\n \"url\": \"autoindex.css\",\n \"revision\": \"57dd368ab96459de433a2a3cbacc765d\"\n },\n {\n \"url\": \"autoindex.html\",\n \"revision\": \"d9da26b18b24767c7bedb06a44bc31ce\"\n },\n {\n \"url\": \"autoscripts/localforage.js\",\n \"revision\": \"7ae08028a75fed2acce92b8e75fbe08c\"\n },\n {\n \"url\": \"autoscripts/sql-wasm.js\",\n \"revision\": \"b34648b4b4c89ba52bcd7468fa035583\"\n },\n {\n \"url\": \"autosql-wasm.wasm\",\n \"revision\": \"bff856e0a3429d33cfb88d20b7f9fcff\"\n }\n], {});\n\n\n\n\n\n\n\n\n"],"names":["self","addEventListener","event","data","type","skipWaiting"],"mappings":"0yBAmBAA,KAAKC,iBAAiB,UAAYC,IAC5BA,EAAMC,MAA4B,iBAApBD,EAAMC,KAAKC,MAC3BJ,KAAKK,mCAY2B,CAClC,KACS,yBACK,oCAEd,KACS,gDACK,oCAEd,KACS,gDACK,oCAEd,KACS,wCACK,oCAEd,KACS,sCACK,oCAEd,KACS,qCACK,oCAEd,KACS,mCACK,oCAEd,KACS,iCACK,oCAEd,KACS,6BACK,oCAEd,KACS,4CACK,oCAEd,KACS,mCACK,oCAEd,KACS,+BACK,oCAEd,KACS,mCACK,oCAEd,KACS,8BACK,oCAEd,KACS,kCACK,oCAEd,KACS,gCACK,oCAEd,KACS,wCACK,oCAEd,KACS,uCACK,oCAEd,KACS,0CACK,oCAEd,KACS,0CACK,oCAEd,KACS,kCACK,oCAEd,KACS,sCACK,oCAEd,KACS,qCACK,oCAEd,KACS,uCACK,oCAEd,KACS,qCACK,oCAEd,KACS,iCACK,oCAEd,KACS,kCACK,oCAEd,KACS,6CACK,oCAEd,KACS,4BACK,oCAEd,KACS,iCACK,oCAEd,KACS,iCACK,oCAEd,KACS,4BACK,oCAEd,KACS,4BACK,oCAEd,KACS,6BACK,oCAEd,KACS,gCACK,oCAEd,KACS,6BACK,oCAEd,KACS,qDACK,oCAEd,KACS,+BACK,oCAEd,KACS,gCACK,oCAEd,KACS,gCACK,oCAEd,KACS,yBACK,oCAEd,KACS,0BACK,oCAEd,KACS,sCACK,oCAEd,KACS,mCACK,oCAEd,KACS,6BACK,qCAEb"} \ No newline at end of file +{"version":3,"file":"service-worker.js","sources":["../../../../../tmp/8df227491eb56a46569914b38d306c2c/service-worker.js"],"sourcesContent":["import {precacheAndRoute as workbox_precaching_precacheAndRoute} from '/home/silas/Projekte/web/wordRotator/node_modules/workbox-precaching/precacheAndRoute.mjs';/**\n * Welcome to your Workbox-powered service worker!\n *\n * You'll need to register this file in your web app.\n * See https://goo.gl/nhQhGp\n *\n * The rest of the code is auto-generated. Please don't update this file\n * directly; instead, make changes to your Workbox build configuration\n * and re-run your build process.\n * See https://goo.gl/2aRDsh\n */\n\n\n\n\n\n\n\n\nself.addEventListener('message', (event) => {\n if (event.data && event.data.type === 'SKIP_WAITING') {\n self.skipWaiting();\n }\n});\n\n\n\n\n/**\n * The precacheAndRoute() method efficiently caches and responds to\n * requests for URLs in the manifest.\n * See https://goo.gl/S9QRab\n */\nworkbox_precaching_precacheAndRoute([\n {\n \"url\": \"bundle.js\",\n \"revision\": \"45af70c24da2c923b2e86465e4fca63c\"\n },\n {\n \"url\": \"html/abstractWindowTemplate.html\",\n \"revision\": \"00bb2496dac07a457654781fa8c6948c\"\n },\n {\n \"url\": \"html/alphabeticListFragment.html\",\n \"revision\": \"05e1a0c8574de51e0de78277af030920\"\n },\n {\n \"url\": \"html/changeUserSite.html\",\n \"revision\": \"b416ddd8f231490201243a26afa49ca8\"\n },\n {\n \"url\": \"html/chooseDialog.html\",\n \"revision\": \"0171b83550d8a21f1332a5360c10baf5\"\n },\n {\n \"url\": \"html/contactSite.html\",\n \"revision\": \"b8acb685882c2cb4a970e5a7615a5c5d\"\n },\n {\n \"url\": \"html/container.html\",\n \"revision\": \"a7285c607fdacd912f47738462150efe\"\n },\n {\n \"url\": \"html/credits.html\",\n \"revision\": \"efb301e087d02b5dcd97ecda45e661ca\"\n },\n {\n \"url\": \"html/end.html\",\n \"revision\": \"8aa547874fa8716e1ddb8d29276dcc91\"\n },\n {\n \"url\": \"html/forgotPasswordSite.html\",\n \"revision\": \"b063ea7614dce48ed6794400d34b135f\"\n },\n {\n \"url\": \"html/impressum.html\",\n \"revision\": \"d0e2e95559a8820115ac92659e3d2590\"\n },\n {\n \"url\": \"html/level.html\",\n \"revision\": \"481bf599c219a9f2d94eae4096fc6d79\"\n },\n {\n \"url\": \"html/loginSite.html\",\n \"revision\": \"4d8c2f02ba16dbf38ad679827cbd62f2\"\n },\n {\n \"url\": \"html/menu.html\",\n \"revision\": \"06cf7df2e0e4918542d0d83f21a1c2b0\"\n },\n {\n \"url\": \"html/menuSite.html\",\n \"revision\": \"8dae573b1dcba5727f4bc598b1a09007\"\n },\n {\n \"url\": \"html/navbar.html\",\n \"revision\": \"482d5ac8a3b6ea9ae3f06543d3eed977\"\n },\n {\n \"url\": \"html/notAllowedSite.html\",\n \"revision\": \"2a65f4f3da6f1f508736bd63c3d093ea\"\n },\n {\n \"url\": \"html/privacyPolicy.html\",\n \"revision\": \"f55a77320c0744ac684231107bd51012\"\n },\n {\n \"url\": \"html/registrationSite.html\",\n \"revision\": \"5d732604002df8c6eb1f206709bc4b9a\"\n },\n {\n \"url\": \"html/selectUserDialog.html\",\n \"revision\": \"3cd8fc58c0d2c6a260747475f861b855\"\n },\n {\n \"url\": \"html/settings.html\",\n \"revision\": \"5a7cf19679ca839e4badd6624b6c35aa\"\n },\n {\n \"url\": \"html/settingsSite.html\",\n \"revision\": \"c20c185a3dd15b8e5a62d9934f0402f5\"\n },\n {\n \"url\": \"html/shareDialog.html\",\n \"revision\": \"49fd3d7553c48ecc11c3861afc0b0771\"\n },\n {\n \"url\": \"html/swipeFragment.html\",\n \"revision\": \"3278efb5dd279a359cdd950fa002b234\"\n },\n {\n \"url\": \"html/tabFragment.html\",\n \"revision\": \"733ad585b3927993d15cbd04e9c135da\"\n },\n {\n \"url\": \"html/tutorialSite.html\",\n \"revision\": \"24b319cd6fbb2d54fa57fdf46176287a\"\n },\n {\n \"url\": \"img/arrowLeft.svg\",\n \"revision\": \"6bbb4f0e313bb88cd0cc80c2b3cd36fc\"\n },\n {\n \"url\": \"img/brightAndBeautifull__.mp3\",\n \"revision\": \"2b40fd6c076d254cf639f8f46819d5ca\"\n },\n {\n \"url\": \"img/coin.png\",\n \"revision\": \"5b380862ff8349f6b4b8d5241893f508\"\n },\n {\n \"url\": \"img/coinTower.png\",\n \"revision\": \"50cef0780a1affcd301c2c4be09ccb25\"\n },\n {\n \"url\": \"img/errorIcon.png\",\n \"revision\": \"b48a01a1871b83b30c317f0fc4aed555\"\n },\n {\n \"url\": \"img/help.png\",\n \"revision\": \"45a8dc0493279dc37f72f8026af5bc10\"\n },\n {\n \"url\": \"img/logo.png\",\n \"revision\": \"5246599497de18a878951e1e98083493\"\n },\n {\n \"url\": \"img/music.svg\",\n \"revision\": \"ce36074e94a8d19dfa383f98bd66a1f4\"\n },\n {\n \"url\": \"img/settings.png\",\n \"revision\": \"c44ce577ac56632e53208833ff78e67f\"\n },\n {\n \"url\": \"img/share.svg\",\n \"revision\": \"ac8fc0221ee400fc843090a834df7c9d\"\n },\n {\n \"url\": \"img/single_coin_fall_on_concrete_.mp3\",\n \"revision\": \"7f0de4f503644a7fc14de7e307bbf722\"\n },\n {\n \"url\": \"img/speaker.svg\",\n \"revision\": \"0d926850f1558dd431e1c6b10fe0c2ef\"\n },\n {\n \"url\": \"img/telegram.svg\",\n \"revision\": \"e366fed4603e06142a2d6b8221be51b8\"\n },\n {\n \"url\": \"img/whatsapp.svg\",\n \"revision\": \"0fa4092ac1f91a5390e74a3c2c03d5e3\"\n },\n {\n \"url\": \"index.css\",\n \"revision\": \"6fc107452ad861200f8193f85e7709c2\"\n },\n {\n \"url\": \"index.html\",\n \"revision\": \"5f8832bceb6eae4ba8126bf5b03e0d38\"\n },\n {\n \"url\": \"scripts/localforage.js\",\n \"revision\": \"7e2a4110781376e372c538e67787773a\"\n },\n {\n \"url\": \"scripts/sql-wasm.js\",\n \"revision\": \"7da4edc42b013dcff1b48e8c02867e26\"\n },\n {\n \"url\": \"sql-wasm.wasm\",\n \"revision\": \"bff856e0a3429d33cfb88d20b7f9fcff\"\n }\n], {});\n\n\n\n\n\n\n\n\n"],"names":["self","addEventListener","event","data","type","skipWaiting","workbox_precaching_precacheAndRoute"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAkK;EAClK;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;EASAA,IAAI,CAACC,gBAAL,CAAsB,SAAtB,EAAkCC,KAAD,IAAW;EAC1C,MAAIA,KAAK,CAACC,IAAN,IAAcD,KAAK,CAACC,IAAN,CAAWC,IAAX,KAAoB,cAAtC,EAAsD;EACpDJ,IAAAA,IAAI,CAACK,WAAL;EACD;EACF,CAJD;EASA;EACA;EACA;EACA;EACA;;AACAC,0BAAmC,CAAC,CAClC;EACE,SAAO,WADT;EAEE,cAAY;EAFd,CADkC,EAKlC;EACE,SAAO,kCADT;EAEE,cAAY;EAFd,CALkC,EASlC;EACE,SAAO,kCADT;EAEE,cAAY;EAFd,CATkC,EAalC;EACE,SAAO,0BADT;EAEE,cAAY;EAFd,CAbkC,EAiBlC;EACE,SAAO,wBADT;EAEE,cAAY;EAFd,CAjBkC,EAqBlC;EACE,SAAO,uBADT;EAEE,cAAY;EAFd,CArBkC,EAyBlC;EACE,SAAO,qBADT;EAEE,cAAY;EAFd,CAzBkC,EA6BlC;EACE,SAAO,mBADT;EAEE,cAAY;EAFd,CA7BkC,EAiClC;EACE,SAAO,eADT;EAEE,cAAY;EAFd,CAjCkC,EAqClC;EACE,SAAO,8BADT;EAEE,cAAY;EAFd,CArCkC,EAyClC;EACE,SAAO,qBADT;EAEE,cAAY;EAFd,CAzCkC,EA6ClC;EACE,SAAO,iBADT;EAEE,cAAY;EAFd,CA7CkC,EAiDlC;EACE,SAAO,qBADT;EAEE,cAAY;EAFd,CAjDkC,EAqDlC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AAO,iBADT;EAEE,cAAY;EAFd,CArJkC,EAyJlC;EACE,SAAO,kBADT;EAEE,cAAY;EAFd,CAzJkC,EA6JlC;EACE,SAAO,kBADT;EAEE,cAAY;EAFd,CA7JkC,EAiKlC;EACE,SAAO,WADT;EAEE,cAAY;EAFd,CAjKkC,EAqKlC;EACE,SAAO,YADT;EAEE,cAAY;EAFd,CArKkC,EAyKlC;EACE,SAAO,wBADT;EAEE,cAAY;EAFd,CAzKkC,EA6KlC;EACE,SAAO,qBADT;EAEE,cAAY;EAFd,CA7KkC,EAiLlC;EACE,SAAO,eADT;EAEE,cAAY;EAFd,CAjLkC,CAAD,EAqLhC,EArLgC,CAAnC;;"} \ No newline at end of file diff --git a/src/server/public/wordRotator.apk b/src/server/public/wordRotator.apk deleted file mode 100644 index 39b87a1..0000000 Binary files a/src/server/public/wordRotator.apk and /dev/null differ diff --git a/src/server/public/workbox-3b8b670f.js b/src/server/public/workbox-3b8b670f.js new file mode 100644 index 0000000..4ae9da6 --- /dev/null +++ b/src/server/public/workbox-3b8b670f.js @@ -0,0 +1,2147 @@ +define("./workbox-3b8b670f.js",['exports'], function (exports) { 'use strict'; + + try { + self['workbox:core:5.1.4'] && _(); + } catch (e) {} + + /* + Copyright 2018 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + const _cacheNameDetails = { + googleAnalytics: 'googleAnalytics', + precache: 'precache-v2', + prefix: 'workbox', + runtime: 'runtime', + suffix: typeof registration !== 'undefined' ? registration.scope : '' + }; + + const _createCacheName = cacheName => { + return [_cacheNameDetails.prefix, cacheName, _cacheNameDetails.suffix].filter(value => value && value.length > 0).join('-'); + }; + + const eachCacheNameDetail = fn => { + for (const key of Object.keys(_cacheNameDetails)) { + fn(key); + } + }; + + const cacheNames = { + updateDetails: details => { + eachCacheNameDetail(key => { + if (typeof details[key] === 'string') { + _cacheNameDetails[key] = details[key]; + } + }); + }, + getGoogleAnalyticsName: userCacheName => { + return userCacheName || _createCacheName(_cacheNameDetails.googleAnalytics); + }, + getPrecacheName: userCacheName => { + return userCacheName || _createCacheName(_cacheNameDetails.precache); + }, + getPrefix: () => { + return _cacheNameDetails.prefix; + }, + getRuntimeName: userCacheName => { + return userCacheName || _createCacheName(_cacheNameDetails.runtime); + }, + getSuffix: () => { + return _cacheNameDetails.suffix; + } + }; + + /* + Copyright 2018 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + + const getFriendlyURL = url => { + const urlObj = new URL(String(url), location.href); // See https://github.com/GoogleChrome/workbox/issues/2323 + // We want to include everything, except for the origin if it's same-origin. + + return urlObj.href.replace(new RegExp(`^${location.origin}`), ''); + }; + + /* + Copyright 2019 Google LLC + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + const logger = (() => { + // Don't overwrite this value if it's already set. + // See https://github.com/GoogleChrome/workbox/pull/2284#issuecomment-560470923 + if (!('__WB_DISABLE_DEV_LOGS' in self)) { + self.__WB_DISABLE_DEV_LOGS = false; + } + + let inGroup = false; + const methodToColorMap = { + debug: `#7f8c8d`, + log: `#2ecc71`, + warn: `#f39c12`, + error: `#c0392b`, + groupCollapsed: `#3498db`, + groupEnd: null + }; + + const print = function (method, args) { + if (self.__WB_DISABLE_DEV_LOGS) { + return; + } + + if (method === 'groupCollapsed') { + // Safari doesn't print all console.groupCollapsed() arguments: + // https://bugs.webkit.org/show_bug.cgi?id=182754 + if (/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) { + console[method](...args); + return; + } + } + + const styles = [`background: ${methodToColorMap[method]}`, `border-radius: 0.5em`, `color: white`, `font-weight: bold`, `padding: 2px 0.5em`]; // When in a group, the workbox prefix is not displayed. + + const logPrefix = inGroup ? [] : ['%cworkbox', styles.join(';')]; + console[method](...logPrefix, ...args); + + if (method === 'groupCollapsed') { + inGroup = true; + } + + if (method === 'groupEnd') { + inGroup = false; + } + }; + + const api = {}; + const loggerMethods = Object.keys(methodToColorMap); + + for (const key of loggerMethods) { + const method = key; + + api[method] = (...args) => { + print(method, args); + }; + } + + return api; + })(); + + /* + Copyright 2018 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + const messages = { + 'invalid-value': ({ + paramName, + validValueDescription, + value + }) => { + if (!paramName || !validValueDescription) { + throw new Error(`Unexpected input to 'invalid-value' error.`); + } + + return `The '${paramName}' parameter was given a value with an ` + `unexpected value. ${validValueDescription} Received a value of ` + `${JSON.stringify(value)}.`; + }, + 'not-an-array': ({ + moduleName, + className, + funcName, + paramName + }) => { + if (!moduleName || !className || !funcName || !paramName) { + throw new Error(`Unexpected input to 'not-an-array' error.`); + } + + return `The parameter '${paramName}' passed into ` + `'${moduleName}.${className}.${funcName}()' must be an array.`; + }, + 'incorrect-type': ({ + expectedType, + paramName, + moduleName, + className, + funcName + }) => { + if (!expectedType || !paramName || !moduleName || !funcName) { + throw new Error(`Unexpected input to 'incorrect-type' error.`); + } + + return `The parameter '${paramName}' passed into ` + `'${moduleName}.${className ? className + '.' : ''}` + `${funcName}()' must be of type ${expectedType}.`; + }, + 'incorrect-class': ({ + expectedClass, + paramName, + moduleName, + className, + funcName, + isReturnValueProblem + }) => { + if (!expectedClass || !moduleName || !funcName) { + throw new Error(`Unexpected input to 'incorrect-class' error.`); + } + + if (isReturnValueProblem) { + return `The return value from ` + `'${moduleName}.${className ? className + '.' : ''}${funcName}()' ` + `must be an instance of class ${expectedClass.name}.`; + } + + return `The parameter '${paramName}' passed into ` + `'${moduleName}.${className ? className + '.' : ''}${funcName}()' ` + `must be an instance of class ${expectedClass.name}.`; + }, + 'missing-a-method': ({ + expectedMethod, + paramName, + moduleName, + className, + funcName + }) => { + if (!expectedMethod || !paramName || !moduleName || !className || !funcName) { + throw new Error(`Unexpected input to 'missing-a-method' error.`); + } + + return `${moduleName}.${className}.${funcName}() expected the ` + `'${paramName}' parameter to expose a '${expectedMethod}' method.`; + }, + 'add-to-cache-list-unexpected-type': ({ + entry + }) => { + return `An unexpected entry was passed to ` + `'workbox-precaching.PrecacheController.addToCacheList()' The entry ` + `'${JSON.stringify(entry)}' isn't supported. You must supply an array of ` + `strings with one or more characters, objects with a url property or ` + `Request objects.`; + }, + 'add-to-cache-list-conflicting-entries': ({ + firstEntry, + secondEntry + }) => { + if (!firstEntry || !secondEntry) { + throw new Error(`Unexpected input to ` + `'add-to-cache-list-duplicate-entries' error.`); + } + + return `Two of the entries passed to ` + `'workbox-precaching.PrecacheController.addToCacheList()' had the URL ` + `${firstEntry._entryId} but different revision details. Workbox is ` + `unable to cache and version the asset correctly. Please remove one ` + `of the entries.`; + }, + 'plugin-error-request-will-fetch': ({ + thrownError + }) => { + if (!thrownError) { + throw new Error(`Unexpected input to ` + `'plugin-error-request-will-fetch', error.`); + } + + return `An error was thrown by a plugins 'requestWillFetch()' method. ` + `The thrown error message was: '${thrownError.message}'.`; + }, + 'invalid-cache-name': ({ + cacheNameId, + value + }) => { + if (!cacheNameId) { + throw new Error(`Expected a 'cacheNameId' for error 'invalid-cache-name'`); + } + + return `You must provide a name containing at least one character for ` + `setCacheDetails({${cacheNameId}: '...'}). Received a value of ` + `'${JSON.stringify(value)}'`; + }, + 'unregister-route-but-not-found-with-method': ({ + method + }) => { + if (!method) { + throw new Error(`Unexpected input to ` + `'unregister-route-but-not-found-with-method' error.`); + } + + return `The route you're trying to unregister was not previously ` + `registered for the method type '${method}'.`; + }, + 'unregister-route-route-not-registered': () => { + return `The route you're trying to unregister was not previously ` + `registered.`; + }, + 'queue-replay-failed': ({ + name + }) => { + return `Replaying the background sync queue '${name}' failed.`; + }, + 'duplicate-queue-name': ({ + name + }) => { + return `The Queue name '${name}' is already being used. ` + `All instances of backgroundSync.Queue must be given unique names.`; + }, + 'expired-test-without-max-age': ({ + methodName, + paramName + }) => { + return `The '${methodName}()' method can only be used when the ` + `'${paramName}' is used in the constructor.`; + }, + 'unsupported-route-type': ({ + moduleName, + className, + funcName, + paramName + }) => { + return `The supplied '${paramName}' parameter was an unsupported type. ` + `Please check the docs for ${moduleName}.${className}.${funcName} for ` + `valid input types.`; + }, + 'not-array-of-class': ({ + value, + expectedClass, + moduleName, + className, + funcName, + paramName + }) => { + return `The supplied '${paramName}' parameter must be an array of ` + `'${expectedClass}' objects. Received '${JSON.stringify(value)},'. ` + `Please check the call to ${moduleName}.${className}.${funcName}() ` + `to fix the issue.`; + }, + 'max-entries-or-age-required': ({ + moduleName, + className, + funcName + }) => { + return `You must define either config.maxEntries or config.maxAgeSeconds` + `in ${moduleName}.${className}.${funcName}`; + }, + 'statuses-or-headers-required': ({ + moduleName, + className, + funcName + }) => { + return `You must define either config.statuses or config.headers` + `in ${moduleName}.${className}.${funcName}`; + }, + 'invalid-string': ({ + moduleName, + funcName, + paramName + }) => { + if (!paramName || !moduleName || !funcName) { + throw new Error(`Unexpected input to 'invalid-string' error.`); + } + + return `When using strings, the '${paramName}' parameter must start with ` + `'http' (for cross-origin matches) or '/' (for same-origin matches). ` + `Please see the docs for ${moduleName}.${funcName}() for ` + `more info.`; + }, + 'channel-name-required': () => { + return `You must provide a channelName to construct a ` + `BroadcastCacheUpdate instance.`; + }, + 'invalid-responses-are-same-args': () => { + return `The arguments passed into responsesAreSame() appear to be ` + `invalid. Please ensure valid Responses are used.`; + }, + 'expire-custom-caches-only': () => { + return `You must provide a 'cacheName' property when using the ` + `expiration plugin with a runtime caching strategy.`; + }, + 'unit-must-be-bytes': ({ + normalizedRangeHeader + }) => { + if (!normalizedRangeHeader) { + throw new Error(`Unexpected input to 'unit-must-be-bytes' error.`); + } + + return `The 'unit' portion of the Range header must be set to 'bytes'. ` + `The Range header provided was "${normalizedRangeHeader}"`; + }, + 'single-range-only': ({ + normalizedRangeHeader + }) => { + if (!normalizedRangeHeader) { + throw new Error(`Unexpected input to 'single-range-only' error.`); + } + + return `Multiple ranges are not supported. Please use a single start ` + `value, and optional end value. The Range header provided was ` + `"${normalizedRangeHeader}"`; + }, + 'invalid-range-values': ({ + normalizedRangeHeader + }) => { + if (!normalizedRangeHeader) { + throw new Error(`Unexpected input to 'invalid-range-values' error.`); + } + + return `The Range header is missing both start and end values. At least ` + `one of those values is needed. The Range header provided was ` + `"${normalizedRangeHeader}"`; + }, + 'no-range-header': () => { + return `No Range header was found in the Request provided.`; + }, + 'range-not-satisfiable': ({ + size, + start, + end + }) => { + return `The start (${start}) and end (${end}) values in the Range are ` + `not satisfiable by the cached response, which is ${size} bytes.`; + }, + 'attempt-to-cache-non-get-request': ({ + url, + method + }) => { + return `Unable to cache '${url}' because it is a '${method}' request and ` + `only 'GET' requests can be cached.`; + }, + 'cache-put-with-no-response': ({ + url + }) => { + return `There was an attempt to cache '${url}' but the response was not ` + `defined.`; + }, + 'no-response': ({ + url, + error + }) => { + let message = `The strategy could not generate a response for '${url}'.`; + + if (error) { + message += ` The underlying error is ${error}.`; + } + + return message; + }, + 'bad-precaching-response': ({ + url, + status + }) => { + return `The precaching request for '${url}' failed with an HTTP ` + `status of ${status}.`; + }, + 'non-precached-url': ({ + url + }) => { + return `createHandlerBoundToURL('${url}') was called, but that URL is ` + `not precached. Please pass in a URL that is precached instead.`; + }, + 'add-to-cache-list-conflicting-integrities': ({ + url + }) => { + return `Two of the entries passed to ` + `'workbox-precaching.PrecacheController.addToCacheList()' had the URL ` + `${url} with different integrity values. Please remove one of them.`; + }, + 'missing-precache-entry': ({ + cacheName, + url + }) => { + return `Unable to find a precached response in ${cacheName} for ${url}.`; + } + }; + + /* + Copyright 2018 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + + const generatorFunction = (code, details = {}) => { + const message = messages[code]; + + if (!message) { + throw new Error(`Unable to find message for code '${code}'.`); + } + + return message(details); + }; + + const messageGenerator = generatorFunction; + + /* + Copyright 2018 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + /** + * Workbox errors should be thrown with this class. + * This allows use to ensure the type easily in tests, + * helps developers identify errors from workbox + * easily and allows use to optimise error + * messages correctly. + * + * @private + */ + + class WorkboxError extends Error { + /** + * + * @param {string} errorCode The error code that + * identifies this particular error. + * @param {Object=} details Any relevant arguments + * that will help developers identify issues should + * be added as a key on the context object. + */ + constructor(errorCode, details) { + const message = messageGenerator(errorCode, details); + super(message); + this.name = errorCode; + this.details = details; + } + + } + + /* + Copyright 2018 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + /* + * This method throws if the supplied value is not an array. + * The destructed values are required to produce a meaningful error for users. + * The destructed and restructured object is so it's clear what is + * needed. + */ + + const isArray = (value, details) => { + if (!Array.isArray(value)) { + throw new WorkboxError('not-an-array', details); + } + }; + + const hasMethod = (object, expectedMethod, details) => { + const type = typeof object[expectedMethod]; + + if (type !== 'function') { + details['expectedMethod'] = expectedMethod; + throw new WorkboxError('missing-a-method', details); + } + }; + + const isType = (object, expectedType, details) => { + if (typeof object !== expectedType) { + details['expectedType'] = expectedType; + throw new WorkboxError('incorrect-type', details); + } + }; + + const isInstance = (object, expectedClass, details) => { + if (!(object instanceof expectedClass)) { + details['expectedClass'] = expectedClass; + throw new WorkboxError('incorrect-class', details); + } + }; + + const isOneOf = (value, validValues, details) => { + if (!validValues.includes(value)) { + details['validValueDescription'] = `Valid values are ${JSON.stringify(validValues)}.`; + throw new WorkboxError('invalid-value', details); + } + }; + + const isArrayOfClass = (value, expectedClass, details) => { + const error = new WorkboxError('not-array-of-class', details); + + if (!Array.isArray(value)) { + throw error; + } + + for (const item of value) { + if (!(item instanceof expectedClass)) { + throw error; + } + } + }; + + const finalAssertExports = { + hasMethod, + isArray, + isInstance, + isOneOf, + isType, + isArrayOfClass + }; + + /* + Copyright 2018 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + + const quotaErrorCallbacks = new Set(); + + /* + Copyright 2018 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + /** + * Runs all of the callback functions, one at a time sequentially, in the order + * in which they were registered. + * + * @memberof module:workbox-core + * @private + */ + + async function executeQuotaErrorCallbacks() { + { + logger.log(`About to run ${quotaErrorCallbacks.size} ` + `callbacks to clean up caches.`); + } + + for (const callback of quotaErrorCallbacks) { + await callback(); + + { + logger.log(callback, 'is complete.'); + } + } + + { + logger.log('Finished running callbacks.'); + } + } + + /* + Copyright 2018 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + const pluginUtils = { + filter: (plugins, callbackName) => { + return plugins.filter(plugin => callbackName in plugin); + } + }; + + /* + Copyright 2018 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + /** + * Checks the list of plugins for the cacheKeyWillBeUsed callback, and + * executes any of those callbacks found in sequence. The final `Request` object + * returned by the last plugin is treated as the cache key for cache reads + * and/or writes. + * + * @param {Object} options + * @param {Request} options.request + * @param {string} options.mode + * @param {Array} [options.plugins=[]] + * @return {Promise} + * + * @private + * @memberof module:workbox-core + */ + + const _getEffectiveRequest = async ({ + request, + mode, + plugins = [] + }) => { + const cacheKeyWillBeUsedPlugins = pluginUtils.filter(plugins, "cacheKeyWillBeUsed" + /* CACHE_KEY_WILL_BE_USED */ + ); + let effectiveRequest = request; + + for (const plugin of cacheKeyWillBeUsedPlugins) { + effectiveRequest = await plugin["cacheKeyWillBeUsed" + /* CACHE_KEY_WILL_BE_USED */ + ].call(plugin, { + mode, + request: effectiveRequest + }); + + if (typeof effectiveRequest === 'string') { + effectiveRequest = new Request(effectiveRequest); + } + + { + finalAssertExports.isInstance(effectiveRequest, Request, { + moduleName: 'Plugin', + funcName: "cacheKeyWillBeUsed" + /* CACHE_KEY_WILL_BE_USED */ + , + isReturnValueProblem: true + }); + } + } + + return effectiveRequest; + }; + /** + * This method will call cacheWillUpdate on the available plugins (or use + * status === 200) to determine if the Response is safe and valid to cache. + * + * @param {Object} options + * @param {Request} options.request + * @param {Response} options.response + * @param {Event} [options.event] + * @param {Array} [options.plugins=[]] + * @return {Promise} + * + * @private + * @memberof module:workbox-core + */ + + + const _isResponseSafeToCache = async ({ + request, + response, + event, + plugins = [] + }) => { + let responseToCache = response; + let pluginsUsed = false; + + for (const plugin of plugins) { + if ("cacheWillUpdate" + /* CACHE_WILL_UPDATE */ + in plugin) { + pluginsUsed = true; + const pluginMethod = plugin["cacheWillUpdate" + /* CACHE_WILL_UPDATE */ + ]; + responseToCache = await pluginMethod.call(plugin, { + request, + response: responseToCache, + event + }); + + { + if (responseToCache) { + finalAssertExports.isInstance(responseToCache, Response, { + moduleName: 'Plugin', + funcName: "cacheWillUpdate" + /* CACHE_WILL_UPDATE */ + , + isReturnValueProblem: true + }); + } + } + + if (!responseToCache) { + break; + } + } + } + + if (!pluginsUsed) { + { + if (responseToCache) { + if (responseToCache.status !== 200) { + if (responseToCache.status === 0) { + logger.warn(`The response for '${request.url}' is an opaque ` + `response. The caching strategy that you're using will not ` + `cache opaque responses by default.`); + } else { + logger.debug(`The response for '${request.url}' returned ` + `a status code of '${response.status}' and won't be cached as a ` + `result.`); + } + } + } + } + + responseToCache = responseToCache && responseToCache.status === 200 ? responseToCache : undefined; + } + + return responseToCache ? responseToCache : null; + }; + /** + * This is a wrapper around cache.match(). + * + * @param {Object} options + * @param {string} options.cacheName Name of the cache to match against. + * @param {Request} options.request The Request that will be used to look up + * cache entries. + * @param {Event} [options.event] The event that prompted the action. + * @param {Object} [options.matchOptions] Options passed to cache.match(). + * @param {Array} [options.plugins=[]] Array of plugins. + * @return {Response} A cached response if available. + * + * @private + * @memberof module:workbox-core + */ + + + const matchWrapper = async ({ + cacheName, + request, + event, + matchOptions, + plugins = [] + }) => { + const cache = await self.caches.open(cacheName); + const effectiveRequest = await _getEffectiveRequest({ + plugins, + request, + mode: 'read' + }); + let cachedResponse = await cache.match(effectiveRequest, matchOptions); + + { + if (cachedResponse) { + logger.debug(`Found a cached response in '${cacheName}'.`); + } else { + logger.debug(`No cached response found in '${cacheName}'.`); + } + } + + for (const plugin of plugins) { + if ("cachedResponseWillBeUsed" + /* CACHED_RESPONSE_WILL_BE_USED */ + in plugin) { + const pluginMethod = plugin["cachedResponseWillBeUsed" + /* CACHED_RESPONSE_WILL_BE_USED */ + ]; + cachedResponse = await pluginMethod.call(plugin, { + cacheName, + event, + matchOptions, + cachedResponse, + request: effectiveRequest + }); + + { + if (cachedResponse) { + finalAssertExports.isInstance(cachedResponse, Response, { + moduleName: 'Plugin', + funcName: "cachedResponseWillBeUsed" + /* CACHED_RESPONSE_WILL_BE_USED */ + , + isReturnValueProblem: true + }); + } + } + } + } + + return cachedResponse; + }; + /** + * Wrapper around cache.put(). + * + * Will call `cacheDidUpdate` on plugins if the cache was updated, using + * `matchOptions` when determining what the old entry is. + * + * @param {Object} options + * @param {string} options.cacheName + * @param {Request} options.request + * @param {Response} options.response + * @param {Event} [options.event] + * @param {Array} [options.plugins=[]] + * @param {Object} [options.matchOptions] + * + * @private + * @memberof module:workbox-core + */ + + + const putWrapper = async ({ + cacheName, + request, + response, + event, + plugins = [], + matchOptions + }) => { + { + if (request.method && request.method !== 'GET') { + throw new WorkboxError('attempt-to-cache-non-get-request', { + url: getFriendlyURL(request.url), + method: request.method + }); + } + } + + const effectiveRequest = await _getEffectiveRequest({ + plugins, + request, + mode: 'write' + }); + + if (!response) { + { + logger.error(`Cannot cache non-existent response for ` + `'${getFriendlyURL(effectiveRequest.url)}'.`); + } + + throw new WorkboxError('cache-put-with-no-response', { + url: getFriendlyURL(effectiveRequest.url) + }); + } + + const responseToCache = await _isResponseSafeToCache({ + event, + plugins, + response, + request: effectiveRequest + }); + + if (!responseToCache) { + { + logger.debug(`Response '${getFriendlyURL(effectiveRequest.url)}' will ` + `not be cached.`, responseToCache); + } + + return; + } + + const cache = await self.caches.open(cacheName); + const updatePlugins = pluginUtils.filter(plugins, "cacheDidUpdate" + /* CACHE_DID_UPDATE */ + ); + const oldResponse = updatePlugins.length > 0 ? await matchWrapper({ + cacheName, + matchOptions, + request: effectiveRequest + }) : null; + + { + logger.debug(`Updating the '${cacheName}' cache with a new Response for ` + `${getFriendlyURL(effectiveRequest.url)}.`); + } + + try { + await cache.put(effectiveRequest, responseToCache); + } catch (error) { + // See https://developer.mozilla.org/en-US/docs/Web/API/DOMException#exception-QuotaExceededError + if (error.name === 'QuotaExceededError') { + await executeQuotaErrorCallbacks(); + } + + throw error; + } + + for (const plugin of updatePlugins) { + await plugin["cacheDidUpdate" + /* CACHE_DID_UPDATE */ + ].call(plugin, { + cacheName, + event, + oldResponse, + newResponse: responseToCache, + request: effectiveRequest + }); + } + }; + + const cacheWrapper = { + put: putWrapper, + match: matchWrapper + }; + + /* + Copyright 2018 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + /** + * Wrapper around the fetch API. + * + * Will call requestWillFetch on available plugins. + * + * @param {Object} options + * @param {Request|string} options.request + * @param {Object} [options.fetchOptions] + * @param {ExtendableEvent} [options.event] + * @param {Array} [options.plugins=[]] + * @return {Promise} + * + * @private + * @memberof module:workbox-core + */ + + const wrappedFetch = async ({ + request, + fetchOptions, + event, + plugins = [] + }) => { + if (typeof request === 'string') { + request = new Request(request); + } // We *should* be able to call `await event.preloadResponse` even if it's + // undefined, but for some reason, doing so leads to errors in our Node unit + // tests. To work around that, explicitly check preloadResponse's value first. + + + if (event instanceof FetchEvent && event.preloadResponse) { + const possiblePreloadResponse = await event.preloadResponse; + + if (possiblePreloadResponse) { + { + logger.log(`Using a preloaded navigation response for ` + `'${getFriendlyURL(request.url)}'`); + } + + return possiblePreloadResponse; + } + } + + { + finalAssertExports.isInstance(request, Request, { + paramName: 'request', + expectedClass: Request, + moduleName: 'workbox-core', + className: 'fetchWrapper', + funcName: 'wrappedFetch' + }); + } + + const failedFetchPlugins = pluginUtils.filter(plugins, "fetchDidFail" + /* FETCH_DID_FAIL */ + ); // If there is a fetchDidFail plugin, we need to save a clone of the + // original request before it's either modified by a requestWillFetch + // plugin or before the original request's body is consumed via fetch(). + + const originalRequest = failedFetchPlugins.length > 0 ? request.clone() : null; + + try { + for (const plugin of plugins) { + if ("requestWillFetch" + /* REQUEST_WILL_FETCH */ + in plugin) { + const pluginMethod = plugin["requestWillFetch" + /* REQUEST_WILL_FETCH */ + ]; + const requestClone = request.clone(); + request = await pluginMethod.call(plugin, { + request: requestClone, + event + }); + + if ("development" !== 'production') { + if (request) { + finalAssertExports.isInstance(request, Request, { + moduleName: 'Plugin', + funcName: "cachedResponseWillBeUsed" + /* CACHED_RESPONSE_WILL_BE_USED */ + , + isReturnValueProblem: true + }); + } + } + } + } + } catch (err) { + throw new WorkboxError('plugin-error-request-will-fetch', { + thrownError: err + }); + } // The request can be altered by plugins with `requestWillFetch` making + // the original request (Most likely from a `fetch` event) to be different + // to the Request we make. Pass both to `fetchDidFail` to aid debugging. + + + const pluginFilteredRequest = request.clone(); + + try { + let fetchResponse; // See https://github.com/GoogleChrome/workbox/issues/1796 + + if (request.mode === 'navigate') { + fetchResponse = await fetch(request); + } else { + fetchResponse = await fetch(request, fetchOptions); + } + + if ("development" !== 'production') { + logger.debug(`Network request for ` + `'${getFriendlyURL(request.url)}' returned a response with ` + `status '${fetchResponse.status}'.`); + } + + for (const plugin of plugins) { + if ("fetchDidSucceed" + /* FETCH_DID_SUCCEED */ + in plugin) { + fetchResponse = await plugin["fetchDidSucceed" + /* FETCH_DID_SUCCEED */ + ].call(plugin, { + event, + request: pluginFilteredRequest, + response: fetchResponse + }); + + if ("development" !== 'production') { + if (fetchResponse) { + finalAssertExports.isInstance(fetchResponse, Response, { + moduleName: 'Plugin', + funcName: "fetchDidSucceed" + /* FETCH_DID_SUCCEED */ + , + isReturnValueProblem: true + }); + } + } + } + } + + return fetchResponse; + } catch (error) { + { + logger.error(`Network request for ` + `'${getFriendlyURL(request.url)}' threw an error.`, error); + } + + for (const plugin of failedFetchPlugins) { + await plugin["fetchDidFail" + /* FETCH_DID_FAIL */ + ].call(plugin, { + error, + event, + originalRequest: originalRequest.clone(), + request: pluginFilteredRequest.clone() + }); + } + + throw error; + } + }; + + const fetchWrapper = { + fetch: wrappedFetch + }; + + /* + Copyright 2019 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + let supportStatus; + /** + * A utility function that determines whether the current browser supports + * constructing a new `Response` from a `response.body` stream. + * + * @return {boolean} `true`, if the current browser can successfully + * construct a `Response` from a `response.body` stream, `false` otherwise. + * + * @private + */ + + function canConstructResponseFromBodyStream() { + if (supportStatus === undefined) { + const testResponse = new Response(''); + + if ('body' in testResponse) { + try { + new Response(testResponse.body); + supportStatus = true; + } catch (error) { + supportStatus = false; + } + } + + supportStatus = false; + } + + return supportStatus; + } + + /* + Copyright 2019 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + /** + * Allows developers to copy a response and modify its `headers`, `status`, + * or `statusText` values (the values settable via a + * [`ResponseInit`]{@link https://developer.mozilla.org/en-US/docs/Web/API/Response/Response#Syntax} + * object in the constructor). + * To modify these values, pass a function as the second argument. That + * function will be invoked with a single object with the response properties + * `{headers, status, statusText}`. The return value of this function will + * be used as the `ResponseInit` for the new `Response`. To change the values + * either modify the passed parameter(s) and return it, or return a totally + * new object. + * + * @param {Response} response + * @param {Function} modifier + * @memberof module:workbox-core + */ + + async function copyResponse(response, modifier) { + const clonedResponse = response.clone(); // Create a fresh `ResponseInit` object by cloning the headers. + + const responseInit = { + headers: new Headers(clonedResponse.headers), + status: clonedResponse.status, + statusText: clonedResponse.statusText + }; // Apply any user modifications. + + const modifiedResponseInit = modifier ? modifier(responseInit) : responseInit; // Create the new response from the body stream and `ResponseInit` + // modifications. Note: not all browsers support the Response.body stream, + // so fall back to reading the entire body into memory as a blob. + + const body = canConstructResponseFromBodyStream() ? clonedResponse.body : await clonedResponse.blob(); + return new Response(body, modifiedResponseInit); + } + + try { + self['workbox:precaching:5.1.4'] && _(); + } catch (e) {} + + /* + Copyright 2018 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + + const REVISION_SEARCH_PARAM = '__WB_REVISION__'; + /** + * Converts a manifest entry into a versioned URL suitable for precaching. + * + * @param {Object|string} entry + * @return {string} A URL with versioning info. + * + * @private + * @memberof module:workbox-precaching + */ + + function createCacheKey(entry) { + if (!entry) { + throw new WorkboxError('add-to-cache-list-unexpected-type', { + entry + }); + } // If a precache manifest entry is a string, it's assumed to be a versioned + // URL, like '/app.abcd1234.js'. Return as-is. + + + if (typeof entry === 'string') { + const urlObject = new URL(entry, location.href); + return { + cacheKey: urlObject.href, + url: urlObject.href + }; + } + + const { + revision, + url + } = entry; + + if (!url) { + throw new WorkboxError('add-to-cache-list-unexpected-type', { + entry + }); + } // If there's just a URL and no revision, then it's also assumed to be a + // versioned URL. + + + if (!revision) { + const urlObject = new URL(url, location.href); + return { + cacheKey: urlObject.href, + url: urlObject.href + }; + } // Otherwise, construct a properly versioned URL using the custom Workbox + // search parameter along with the revision info. + + + const cacheKeyURL = new URL(url, location.href); + const originalURL = new URL(url, location.href); + cacheKeyURL.searchParams.set(REVISION_SEARCH_PARAM, revision); + return { + cacheKey: cacheKeyURL.href, + url: originalURL.href + }; + } + + /* + Copyright 2018 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + /** + * @param {string} groupTitle + * @param {Array} deletedURLs + * + * @private + */ + + const logGroup = (groupTitle, deletedURLs) => { + logger.groupCollapsed(groupTitle); + + for (const url of deletedURLs) { + logger.log(url); + } + + logger.groupEnd(); + }; + /** + * @param {Array} deletedURLs + * + * @private + * @memberof module:workbox-precaching + */ + + + function printCleanupDetails(deletedURLs) { + const deletionCount = deletedURLs.length; + + if (deletionCount > 0) { + logger.groupCollapsed(`During precaching cleanup, ` + `${deletionCount} cached ` + `request${deletionCount === 1 ? ' was' : 's were'} deleted.`); + logGroup('Deleted Cache Requests', deletedURLs); + logger.groupEnd(); + } + } + + /* + Copyright 2018 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + /** + * @param {string} groupTitle + * @param {Array} urls + * + * @private + */ + + function _nestedGroup(groupTitle, urls) { + if (urls.length === 0) { + return; + } + + logger.groupCollapsed(groupTitle); + + for (const url of urls) { + logger.log(url); + } + + logger.groupEnd(); + } + /** + * @param {Array} urlsToPrecache + * @param {Array} urlsAlreadyPrecached + * + * @private + * @memberof module:workbox-precaching + */ + + + function printInstallDetails(urlsToPrecache, urlsAlreadyPrecached) { + const precachedCount = urlsToPrecache.length; + const alreadyPrecachedCount = urlsAlreadyPrecached.length; + + if (precachedCount || alreadyPrecachedCount) { + let message = `Precaching ${precachedCount} file${precachedCount === 1 ? '' : 's'}.`; + + if (alreadyPrecachedCount > 0) { + message += ` ${alreadyPrecachedCount} ` + `file${alreadyPrecachedCount === 1 ? ' is' : 's are'} already cached.`; + } + + logger.groupCollapsed(message); + + _nestedGroup(`View newly precached URLs.`, urlsToPrecache); + + _nestedGroup(`View previously precached URLs.`, urlsAlreadyPrecached); + + logger.groupEnd(); + } + } + + /* + Copyright 2019 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + /** + * Performs efficient precaching of assets. + * + * @memberof module:workbox-precaching + */ + + class PrecacheController { + /** + * Create a new PrecacheController. + * + * @param {string} [cacheName] An optional name for the cache, to override + * the default precache name. + */ + constructor(cacheName) { + this._cacheName = cacheNames.getPrecacheName(cacheName); + this._urlsToCacheKeys = new Map(); + this._urlsToCacheModes = new Map(); + this._cacheKeysToIntegrities = new Map(); + } + /** + * This method will add items to the precache list, removing duplicates + * and ensuring the information is valid. + * + * @param { + * Array + * } entries Array of entries to precache. + */ + + + addToCacheList(entries) { + { + finalAssertExports.isArray(entries, { + moduleName: 'workbox-precaching', + className: 'PrecacheController', + funcName: 'addToCacheList', + paramName: 'entries' + }); + } + + const urlsToWarnAbout = []; + + for (const entry of entries) { + // See https://github.com/GoogleChrome/workbox/issues/2259 + if (typeof entry === 'string') { + urlsToWarnAbout.push(entry); + } else if (entry && entry.revision === undefined) { + urlsToWarnAbout.push(entry.url); + } + + const { + cacheKey, + url + } = createCacheKey(entry); + const cacheMode = typeof entry !== 'string' && entry.revision ? 'reload' : 'default'; + + if (this._urlsToCacheKeys.has(url) && this._urlsToCacheKeys.get(url) !== cacheKey) { + throw new WorkboxError('add-to-cache-list-conflicting-entries', { + firstEntry: this._urlsToCacheKeys.get(url), + secondEntry: cacheKey + }); + } + + if (typeof entry !== 'string' && entry.integrity) { + if (this._cacheKeysToIntegrities.has(cacheKey) && this._cacheKeysToIntegrities.get(cacheKey) !== entry.integrity) { + throw new WorkboxError('add-to-cache-list-conflicting-integrities', { + url + }); + } + + this._cacheKeysToIntegrities.set(cacheKey, entry.integrity); + } + + this._urlsToCacheKeys.set(url, cacheKey); + + this._urlsToCacheModes.set(url, cacheMode); + + if (urlsToWarnAbout.length > 0) { + const warningMessage = `Workbox is precaching URLs without revision ` + `info: ${urlsToWarnAbout.join(', ')}\nThis is generally NOT safe. ` + `Learn more at https://bit.ly/wb-precache`; + + { + logger.warn(warningMessage); + } + } + } + } + /** + * Precaches new and updated assets. Call this method from the service worker + * install event. + * + * @param {Object} options + * @param {Event} [options.event] The install event (if needed). + * @param {Array} [options.plugins] Plugins to be used for fetching + * and caching during install. + * @return {Promise} + */ + + + async install({ + event, + plugins + } = {}) { + { + if (plugins) { + finalAssertExports.isArray(plugins, { + moduleName: 'workbox-precaching', + className: 'PrecacheController', + funcName: 'install', + paramName: 'plugins' + }); + } + } + + const toBePrecached = []; + const alreadyPrecached = []; + const cache = await self.caches.open(this._cacheName); + const alreadyCachedRequests = await cache.keys(); + const existingCacheKeys = new Set(alreadyCachedRequests.map(request => request.url)); + + for (const [url, cacheKey] of this._urlsToCacheKeys) { + if (existingCacheKeys.has(cacheKey)) { + alreadyPrecached.push(url); + } else { + toBePrecached.push({ + cacheKey, + url + }); + } + } + + const precacheRequests = toBePrecached.map(({ + cacheKey, + url + }) => { + const integrity = this._cacheKeysToIntegrities.get(cacheKey); + + const cacheMode = this._urlsToCacheModes.get(url); + + return this._addURLToCache({ + cacheKey, + cacheMode, + event, + integrity, + plugins, + url + }); + }); + await Promise.all(precacheRequests); + const updatedURLs = toBePrecached.map(item => item.url); + + { + printInstallDetails(updatedURLs, alreadyPrecached); + } + + return { + updatedURLs, + notUpdatedURLs: alreadyPrecached + }; + } + /** + * Deletes assets that are no longer present in the current precache manifest. + * Call this method from the service worker activate event. + * + * @return {Promise} + */ + + + async activate() { + const cache = await self.caches.open(this._cacheName); + const currentlyCachedRequests = await cache.keys(); + const expectedCacheKeys = new Set(this._urlsToCacheKeys.values()); + const deletedURLs = []; + + for (const request of currentlyCachedRequests) { + if (!expectedCacheKeys.has(request.url)) { + await cache.delete(request); + deletedURLs.push(request.url); + } + } + + { + printCleanupDetails(deletedURLs); + } + + return { + deletedURLs + }; + } + /** + * Requests the entry and saves it to the cache if the response is valid. + * By default, any response with a status code of less than 400 (including + * opaque responses) is considered valid. + * + * If you need to use custom criteria to determine what's valid and what + * isn't, then pass in an item in `options.plugins` that implements the + * `cacheWillUpdate()` lifecycle event. + * + * @private + * @param {Object} options + * @param {string} options.cacheKey The string to use a cache key. + * @param {string} options.url The URL to fetch and cache. + * @param {string} [options.cacheMode] The cache mode for the network request. + * @param {Event} [options.event] The install event (if passed). + * @param {Array} [options.plugins] An array of plugins to apply to + * fetch and caching. + * @param {string} [options.integrity] The value to use for the `integrity` + * field when making the request. + */ + + + async _addURLToCache({ + cacheKey, + url, + cacheMode, + event, + plugins, + integrity + }) { + const request = new Request(url, { + integrity, + cache: cacheMode, + credentials: 'same-origin' + }); + let response = await fetchWrapper.fetch({ + event, + plugins, + request + }); // Allow developers to override the default logic about what is and isn't + // valid by passing in a plugin implementing cacheWillUpdate(), e.g. + // a `CacheableResponsePlugin` instance. + + let cacheWillUpdatePlugin; + + for (const plugin of plugins || []) { + if ('cacheWillUpdate' in plugin) { + cacheWillUpdatePlugin = plugin; + } + } + + const isValidResponse = cacheWillUpdatePlugin ? // Use a callback if provided. It returns a truthy value if valid. + // NOTE: invoke the method on the plugin instance so the `this` context + // is correct. + await cacheWillUpdatePlugin.cacheWillUpdate({ + event, + request, + response + }) : // Otherwise, default to considering any response status under 400 valid. + // This includes, by default, considering opaque responses valid. + response.status < 400; // Consider this a failure, leading to the `install` handler failing, if + // we get back an invalid response. + + if (!isValidResponse) { + throw new WorkboxError('bad-precaching-response', { + url, + status: response.status + }); + } // Redirected responses cannot be used to satisfy a navigation request, so + // any redirected response must be "copied" rather than cloned, so the new + // response doesn't contain the `redirected` flag. See: + // https://bugs.chromium.org/p/chromium/issues/detail?id=669363&desc=2#c1 + + + if (response.redirected) { + response = await copyResponse(response); + } + + await cacheWrapper.put({ + event, + plugins, + response, + // `request` already uses `url`. We may be able to reuse it. + request: cacheKey === url ? request : new Request(cacheKey), + cacheName: this._cacheName, + matchOptions: { + ignoreSearch: true + } + }); + } + /** + * Returns a mapping of a precached URL to the corresponding cache key, taking + * into account the revision information for the URL. + * + * @return {Map} A URL to cache key mapping. + */ + + + getURLsToCacheKeys() { + return this._urlsToCacheKeys; + } + /** + * Returns a list of all the URLs that have been precached by the current + * service worker. + * + * @return {Array} The precached URLs. + */ + + + getCachedURLs() { + return [...this._urlsToCacheKeys.keys()]; + } + /** + * Returns the cache key used for storing a given URL. If that URL is + * unversioned, like `/index.html', then the cache key will be the original + * URL with a search parameter appended to it. + * + * @param {string} url A URL whose cache key you want to look up. + * @return {string} The versioned URL that corresponds to a cache key + * for the original URL, or undefined if that URL isn't precached. + */ + + + getCacheKeyForURL(url) { + const urlObject = new URL(url, location.href); + return this._urlsToCacheKeys.get(urlObject.href); + } + /** + * This acts as a drop-in replacement for [`cache.match()`](https://developer.mozilla.org/en-US/docs/Web/API/Cache/match) + * with the following differences: + * + * - It knows what the name of the precache is, and only checks in that cache. + * - It allows you to pass in an "original" URL without versioning parameters, + * and it will automatically look up the correct cache key for the currently + * active revision of that URL. + * + * E.g., `matchPrecache('index.html')` will find the correct precached + * response for the currently active service worker, even if the actual cache + * key is `'/index.html?__WB_REVISION__=1234abcd'`. + * + * @param {string|Request} request The key (without revisioning parameters) + * to look up in the precache. + * @return {Promise} + */ + + + async matchPrecache(request) { + const url = request instanceof Request ? request.url : request; + const cacheKey = this.getCacheKeyForURL(url); + + if (cacheKey) { + const cache = await self.caches.open(this._cacheName); + return cache.match(cacheKey); + } + + return undefined; + } + /** + * Returns a function that can be used within a + * {@link module:workbox-routing.Route} that will find a response for the + * incoming request against the precache. + * + * If for an unexpected reason there is a cache miss for the request, + * this will fall back to retrieving the `Response` via `fetch()` when + * `fallbackToNetwork` is `true`. + * + * @param {boolean} [fallbackToNetwork=true] Whether to attempt to get the + * response from the network if there's a precache miss. + * @return {module:workbox-routing~handlerCallback} + */ + + + createHandler(fallbackToNetwork = true) { + return async ({ + request + }) => { + try { + const response = await this.matchPrecache(request); + + if (response) { + return response; + } // This shouldn't normally happen, but there are edge cases: + // https://github.com/GoogleChrome/workbox/issues/1441 + + + throw new WorkboxError('missing-precache-entry', { + cacheName: this._cacheName, + url: request instanceof Request ? request.url : request + }); + } catch (error) { + if (fallbackToNetwork) { + { + logger.debug(`Unable to respond with precached response. ` + `Falling back to network.`, error); + } + + return fetch(request); + } + + throw error; + } + }; + } + /** + * Returns a function that looks up `url` in the precache (taking into + * account revision information), and returns the corresponding `Response`. + * + * If for an unexpected reason there is a cache miss when looking up `url`, + * this will fall back to retrieving the `Response` via `fetch()` when + * `fallbackToNetwork` is `true`. + * + * @param {string} url The precached URL which will be used to lookup the + * `Response`. + * @param {boolean} [fallbackToNetwork=true] Whether to attempt to get the + * response from the network if there's a precache miss. + * @return {module:workbox-routing~handlerCallback} + */ + + + createHandlerBoundToURL(url, fallbackToNetwork = true) { + const cacheKey = this.getCacheKeyForURL(url); + + if (!cacheKey) { + throw new WorkboxError('non-precached-url', { + url + }); + } + + const handler = this.createHandler(fallbackToNetwork); + const request = new Request(url); + return () => handler({ + request + }); + } + + } + + /* + Copyright 2019 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + let precacheController; + /** + * @return {PrecacheController} + * @private + */ + + const getOrCreatePrecacheController = () => { + if (!precacheController) { + precacheController = new PrecacheController(); + } + + return precacheController; + }; + + /* + Copyright 2018 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + /** + * Removes any URL search parameters that should be ignored. + * + * @param {URL} urlObject The original URL. + * @param {Array} ignoreURLParametersMatching RegExps to test against + * each search parameter name. Matches mean that the search parameter should be + * ignored. + * @return {URL} The URL with any ignored search parameters removed. + * + * @private + * @memberof module:workbox-precaching + */ + + function removeIgnoredSearchParams(urlObject, ignoreURLParametersMatching = []) { + // Convert the iterable into an array at the start of the loop to make sure + // deletion doesn't mess up iteration. + for (const paramName of [...urlObject.searchParams.keys()]) { + if (ignoreURLParametersMatching.some(regExp => regExp.test(paramName))) { + urlObject.searchParams.delete(paramName); + } + } + + return urlObject; + } + + /* + Copyright 2019 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + /** + * Generator function that yields possible variations on the original URL to + * check, one at a time. + * + * @param {string} url + * @param {Object} options + * + * @private + * @memberof module:workbox-precaching + */ + + function* generateURLVariations(url, { + ignoreURLParametersMatching, + directoryIndex, + cleanURLs, + urlManipulation + } = {}) { + const urlObject = new URL(url, location.href); + urlObject.hash = ''; + yield urlObject.href; + const urlWithoutIgnoredParams = removeIgnoredSearchParams(urlObject, ignoreURLParametersMatching); + yield urlWithoutIgnoredParams.href; + + if (directoryIndex && urlWithoutIgnoredParams.pathname.endsWith('/')) { + const directoryURL = new URL(urlWithoutIgnoredParams.href); + directoryURL.pathname += directoryIndex; + yield directoryURL.href; + } + + if (cleanURLs) { + const cleanURL = new URL(urlWithoutIgnoredParams.href); + cleanURL.pathname += '.html'; + yield cleanURL.href; + } + + if (urlManipulation) { + const additionalURLs = urlManipulation({ + url: urlObject + }); + + for (const urlToAttempt of additionalURLs) { + yield urlToAttempt.href; + } + } + } + + /* + Copyright 2019 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + /** + * This function will take the request URL and manipulate it based on the + * configuration options. + * + * @param {string} url + * @param {Object} options + * @return {string} Returns the URL in the cache that matches the request, + * if possible. + * + * @private + */ + + const getCacheKeyForURL = (url, options) => { + const precacheController = getOrCreatePrecacheController(); + const urlsToCacheKeys = precacheController.getURLsToCacheKeys(); + + for (const possibleURL of generateURLVariations(url, options)) { + const possibleCacheKey = urlsToCacheKeys.get(possibleURL); + + if (possibleCacheKey) { + return possibleCacheKey; + } + } + }; + + /* + Copyright 2019 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + /** + * Adds a `fetch` listener to the service worker that will + * respond to + * [network requests]{@link https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers#Custom_responses_to_requests} + * with precached assets. + * + * Requests for assets that aren't precached, the `FetchEvent` will not be + * responded to, allowing the event to fall through to other `fetch` event + * listeners. + * + * NOTE: when called more than once this method will replace the previously set + * configuration options. Calling it more than once is not recommended outside + * of tests. + * + * @private + * @param {Object} [options] + * @param {string} [options.directoryIndex=index.html] The `directoryIndex` will + * check cache entries for a URLs ending with '/' to see if there is a hit when + * appending the `directoryIndex` value. + * @param {Array} [options.ignoreURLParametersMatching=[/^utm_/]] An + * array of regex's to remove search params when looking for a cache match. + * @param {boolean} [options.cleanURLs=true] The `cleanURLs` option will + * check the cache for the URL with a `.html` added to the end of the end. + * @param {workbox.precaching~urlManipulation} [options.urlManipulation] + * This is a function that should take a URL and return an array of + * alternative URLs that should be checked for precache matches. + */ + + const addFetchListener = ({ + ignoreURLParametersMatching = [/^utm_/], + directoryIndex = 'index.html', + cleanURLs = true, + urlManipulation + } = {}) => { + const cacheName = cacheNames.getPrecacheName(); // See https://github.com/Microsoft/TypeScript/issues/28357#issuecomment-436484705 + + self.addEventListener('fetch', event => { + const precachedURL = getCacheKeyForURL(event.request.url, { + cleanURLs, + directoryIndex, + ignoreURLParametersMatching, + urlManipulation + }); + + if (!precachedURL) { + { + logger.debug(`Precaching did not find a match for ` + getFriendlyURL(event.request.url)); + } + + return; + } + + let responsePromise = self.caches.open(cacheName).then(cache => { + return cache.match(precachedURL); + }).then(cachedResponse => { + if (cachedResponse) { + return cachedResponse; + } // Fall back to the network if we don't have a cached response + // (perhaps due to manual cache cleanup). + + + { + logger.warn(`The precached response for ` + `${getFriendlyURL(precachedURL)} in ${cacheName} was not found. ` + `Falling back to the network instead.`); + } + + return fetch(precachedURL); + }); + + { + responsePromise = responsePromise.then(response => { + // Workbox is going to handle the route. + // print the routing details to the console. + logger.groupCollapsed(`Precaching is responding to: ` + getFriendlyURL(event.request.url)); + logger.log(`Serving the precached url: ${precachedURL}`); + logger.groupCollapsed(`View request details here.`); + logger.log(event.request); + logger.groupEnd(); + logger.groupCollapsed(`View response details here.`); + logger.log(response); + logger.groupEnd(); + logger.groupEnd(); + return response; + }); + } + + event.respondWith(responsePromise); + }); + }; + + /* + Copyright 2019 Google LLC + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + let listenerAdded = false; + /** + * Add a `fetch` listener to the service worker that will + * respond to + * [network requests]{@link https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers#Custom_responses_to_requests} + * with precached assets. + * + * Requests for assets that aren't precached, the `FetchEvent` will not be + * responded to, allowing the event to fall through to other `fetch` event + * listeners. + * + * @param {Object} [options] + * @param {string} [options.directoryIndex=index.html] The `directoryIndex` will + * check cache entries for a URLs ending with '/' to see if there is a hit when + * appending the `directoryIndex` value. + * @param {Array} [options.ignoreURLParametersMatching=[/^utm_/]] An + * array of regex's to remove search params when looking for a cache match. + * @param {boolean} [options.cleanURLs=true] The `cleanURLs` option will + * check the cache for the URL with a `.html` added to the end of the end. + * @param {module:workbox-precaching~urlManipulation} [options.urlManipulation] + * This is a function that should take a URL and return an array of + * alternative URLs that should be checked for precache matches. + * + * @memberof module:workbox-precaching + */ + + function addRoute(options) { + if (!listenerAdded) { + addFetchListener(options); + listenerAdded = true; + } + } + + /* + Copyright 2019 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + const plugins = []; + const precachePlugins = { + /* + * @return {Array} + * @private + */ + get() { + return plugins; + }, + + /* + * @param {Array} newPlugins + * @private + */ + add(newPlugins) { + plugins.push(...newPlugins); + } + + }; + + /* + Copyright 2019 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + + const installListener = event => { + const precacheController = getOrCreatePrecacheController(); + const plugins = precachePlugins.get(); + event.waitUntil(precacheController.install({ + event, + plugins + }).catch(error => { + { + logger.error(`Service worker installation failed. It will ` + `be retried automatically during the next navigation.`); + } // Re-throw the error to ensure installation fails. + + + throw error; + })); + }; + + const activateListener = event => { + const precacheController = getOrCreatePrecacheController(); + event.waitUntil(precacheController.activate()); + }; + /** + * Adds items to the precache list, removing any duplicates and + * stores the files in the + * ["precache cache"]{@link module:workbox-core.cacheNames} when the service + * worker installs. + * + * This method can be called multiple times. + * + * Please note: This method **will not** serve any of the cached files for you. + * It only precaches files. To respond to a network request you call + * [addRoute()]{@link module:workbox-precaching.addRoute}. + * + * If you have a single array of files to precache, you can just call + * [precacheAndRoute()]{@link module:workbox-precaching.precacheAndRoute}. + * + * @param {Array} [entries=[]] Array of entries to precache. + * + * @memberof module:workbox-precaching + */ + + + function precache(entries) { + const precacheController = getOrCreatePrecacheController(); + precacheController.addToCacheList(entries); + + if (entries.length > 0) { + // NOTE: these listeners will only be added once (even if the `precache()` + // method is called multiple times) because event listeners are implemented + // as a set, where each listener must be unique. + // See https://github.com/Microsoft/TypeScript/issues/28357#issuecomment-436484705 + self.addEventListener('install', installListener); + self.addEventListener('activate', activateListener); + } + } + + /* + Copyright 2019 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + /** + * This method will add entries to the precache list and add a route to + * respond to fetch events. + * + * This is a convenience method that will call + * [precache()]{@link module:workbox-precaching.precache} and + * [addRoute()]{@link module:workbox-precaching.addRoute} in a single call. + * + * @param {Array} entries Array of entries to precache. + * @param {Object} [options] See + * [addRoute() options]{@link module:workbox-precaching.addRoute}. + * + * @memberof module:workbox-precaching + */ + + function precacheAndRoute(entries, options) { + precache(entries); + addRoute(options); + } + + exports.precacheAndRoute = precacheAndRoute; + +}); +//# sourceMappingURL=workbox-3b8b670f.js.map diff --git a/src/server/public/workbox-3b8b670f.js.map b/src/server/public/workbox-3b8b670f.js.map new file mode 100644 index 0000000..bc29757 --- /dev/null +++ b/src/server/public/workbox-3b8b670f.js.map @@ -0,0 +1 @@ +{"version":3,"file":"workbox-3b8b670f.js","sources":["node_modules/workbox-core/_version.js","node_modules/workbox-core/_private/cacheNames.js","node_modules/workbox-core/_private/getFriendlyURL.js","node_modules/workbox-core/_private/logger.js","node_modules/workbox-core/models/messages/messages.js","node_modules/workbox-core/models/messages/messageGenerator.js","node_modules/workbox-core/_private/WorkboxError.js","node_modules/workbox-core/_private/assert.js","node_modules/workbox-core/models/quotaErrorCallbacks.js","node_modules/workbox-core/_private/executeQuotaErrorCallbacks.js","node_modules/workbox-core/utils/pluginUtils.js","node_modules/workbox-core/_private/cacheWrapper.js","node_modules/workbox-core/_private/fetchWrapper.js","node_modules/workbox-core/_private/canConstructResponseFromBodyStream.js","node_modules/workbox-core/copyResponse.js","node_modules/workbox-precaching/_version.js","node_modules/workbox-precaching/utils/createCacheKey.js","node_modules/workbox-precaching/utils/printCleanupDetails.js","node_modules/workbox-precaching/utils/printInstallDetails.js","node_modules/workbox-precaching/PrecacheController.js","node_modules/workbox-precaching/utils/getOrCreatePrecacheController.js","node_modules/workbox-precaching/utils/removeIgnoredSearchParams.js","node_modules/workbox-precaching/utils/generateURLVariations.js","node_modules/workbox-precaching/utils/getCacheKeyForURL.js","node_modules/workbox-precaching/utils/addFetchListener.js","node_modules/workbox-precaching/addRoute.js","node_modules/workbox-precaching/utils/precachePlugins.js","node_modules/workbox-precaching/precache.js","node_modules/workbox-precaching/precacheAndRoute.js"],"sourcesContent":["\"use strict\";\n// @ts-ignore\ntry {\n self['workbox:core:5.1.4'] && _();\n}\ncatch (e) { }\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nconst _cacheNameDetails = {\n googleAnalytics: 'googleAnalytics',\n precache: 'precache-v2',\n prefix: 'workbox',\n runtime: 'runtime',\n suffix: typeof registration !== 'undefined' ? registration.scope : '',\n};\nconst _createCacheName = (cacheName) => {\n return [_cacheNameDetails.prefix, cacheName, _cacheNameDetails.suffix]\n .filter((value) => value && value.length > 0)\n .join('-');\n};\nconst eachCacheNameDetail = (fn) => {\n for (const key of Object.keys(_cacheNameDetails)) {\n fn(key);\n }\n};\nexport const cacheNames = {\n updateDetails: (details) => {\n eachCacheNameDetail((key) => {\n if (typeof details[key] === 'string') {\n _cacheNameDetails[key] = details[key];\n }\n });\n },\n getGoogleAnalyticsName: (userCacheName) => {\n return userCacheName || _createCacheName(_cacheNameDetails.googleAnalytics);\n },\n getPrecacheName: (userCacheName) => {\n return userCacheName || _createCacheName(_cacheNameDetails.precache);\n },\n getPrefix: () => {\n return _cacheNameDetails.prefix;\n },\n getRuntimeName: (userCacheName) => {\n return userCacheName || _createCacheName(_cacheNameDetails.runtime);\n },\n getSuffix: () => {\n return _cacheNameDetails.suffix;\n },\n};\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nconst getFriendlyURL = (url) => {\n const urlObj = new URL(String(url), location.href);\n // See https://github.com/GoogleChrome/workbox/issues/2323\n // We want to include everything, except for the origin if it's same-origin.\n return urlObj.href.replace(new RegExp(`^${location.origin}`), '');\n};\nexport { getFriendlyURL };\n","/*\n Copyright 2019 Google LLC\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nconst logger = (process.env.NODE_ENV === 'production' ? null : (() => {\n // Don't overwrite this value if it's already set.\n // See https://github.com/GoogleChrome/workbox/pull/2284#issuecomment-560470923\n if (!('__WB_DISABLE_DEV_LOGS' in self)) {\n self.__WB_DISABLE_DEV_LOGS = false;\n }\n let inGroup = false;\n const methodToColorMap = {\n debug: `#7f8c8d`,\n log: `#2ecc71`,\n warn: `#f39c12`,\n error: `#c0392b`,\n groupCollapsed: `#3498db`,\n groupEnd: null,\n };\n const print = function (method, args) {\n if (self.__WB_DISABLE_DEV_LOGS) {\n return;\n }\n if (method === 'groupCollapsed') {\n // Safari doesn't print all console.groupCollapsed() arguments:\n // https://bugs.webkit.org/show_bug.cgi?id=182754\n if (/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) {\n console[method](...args);\n return;\n }\n }\n const styles = [\n `background: ${methodToColorMap[method]}`,\n `border-radius: 0.5em`,\n `color: white`,\n `font-weight: bold`,\n `padding: 2px 0.5em`,\n ];\n // When in a group, the workbox prefix is not displayed.\n const logPrefix = inGroup ? [] : ['%cworkbox', styles.join(';')];\n console[method](...logPrefix, ...args);\n if (method === 'groupCollapsed') {\n inGroup = true;\n }\n if (method === 'groupEnd') {\n inGroup = false;\n }\n };\n const api = {};\n const loggerMethods = Object.keys(methodToColorMap);\n for (const key of loggerMethods) {\n const method = key;\n api[method] = (...args) => {\n print(method, args);\n };\n }\n return api;\n})());\nexport { logger };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../../_version.js';\nexport const messages = {\n 'invalid-value': ({ paramName, validValueDescription, value }) => {\n if (!paramName || !validValueDescription) {\n throw new Error(`Unexpected input to 'invalid-value' error.`);\n }\n return `The '${paramName}' parameter was given a value with an ` +\n `unexpected value. ${validValueDescription} Received a value of ` +\n `${JSON.stringify(value)}.`;\n },\n 'not-an-array': ({ moduleName, className, funcName, paramName }) => {\n if (!moduleName || !className || !funcName || !paramName) {\n throw new Error(`Unexpected input to 'not-an-array' error.`);\n }\n return `The parameter '${paramName}' passed into ` +\n `'${moduleName}.${className}.${funcName}()' must be an array.`;\n },\n 'incorrect-type': ({ expectedType, paramName, moduleName, className, funcName }) => {\n if (!expectedType || !paramName || !moduleName || !funcName) {\n throw new Error(`Unexpected input to 'incorrect-type' error.`);\n }\n return `The parameter '${paramName}' passed into ` +\n `'${moduleName}.${className ? (className + '.') : ''}` +\n `${funcName}()' must be of type ${expectedType}.`;\n },\n 'incorrect-class': ({ expectedClass, paramName, moduleName, className, funcName, isReturnValueProblem }) => {\n if (!expectedClass || !moduleName || !funcName) {\n throw new Error(`Unexpected input to 'incorrect-class' error.`);\n }\n if (isReturnValueProblem) {\n return `The return value from ` +\n `'${moduleName}.${className ? (className + '.') : ''}${funcName}()' ` +\n `must be an instance of class ${expectedClass.name}.`;\n }\n return `The parameter '${paramName}' passed into ` +\n `'${moduleName}.${className ? (className + '.') : ''}${funcName}()' ` +\n `must be an instance of class ${expectedClass.name}.`;\n },\n 'missing-a-method': ({ expectedMethod, paramName, moduleName, className, funcName }) => {\n if (!expectedMethod || !paramName || !moduleName || !className\n || !funcName) {\n throw new Error(`Unexpected input to 'missing-a-method' error.`);\n }\n return `${moduleName}.${className}.${funcName}() expected the ` +\n `'${paramName}' parameter to expose a '${expectedMethod}' method.`;\n },\n 'add-to-cache-list-unexpected-type': ({ entry }) => {\n return `An unexpected entry was passed to ` +\n `'workbox-precaching.PrecacheController.addToCacheList()' The entry ` +\n `'${JSON.stringify(entry)}' isn't supported. You must supply an array of ` +\n `strings with one or more characters, objects with a url property or ` +\n `Request objects.`;\n },\n 'add-to-cache-list-conflicting-entries': ({ firstEntry, secondEntry }) => {\n if (!firstEntry || !secondEntry) {\n throw new Error(`Unexpected input to ` +\n `'add-to-cache-list-duplicate-entries' error.`);\n }\n return `Two of the entries passed to ` +\n `'workbox-precaching.PrecacheController.addToCacheList()' had the URL ` +\n `${firstEntry._entryId} but different revision details. Workbox is ` +\n `unable to cache and version the asset correctly. Please remove one ` +\n `of the entries.`;\n },\n 'plugin-error-request-will-fetch': ({ thrownError }) => {\n if (!thrownError) {\n throw new Error(`Unexpected input to ` +\n `'plugin-error-request-will-fetch', error.`);\n }\n return `An error was thrown by a plugins 'requestWillFetch()' method. ` +\n `The thrown error message was: '${thrownError.message}'.`;\n },\n 'invalid-cache-name': ({ cacheNameId, value }) => {\n if (!cacheNameId) {\n throw new Error(`Expected a 'cacheNameId' for error 'invalid-cache-name'`);\n }\n return `You must provide a name containing at least one character for ` +\n `setCacheDetails({${cacheNameId}: '...'}). Received a value of ` +\n `'${JSON.stringify(value)}'`;\n },\n 'unregister-route-but-not-found-with-method': ({ method }) => {\n if (!method) {\n throw new Error(`Unexpected input to ` +\n `'unregister-route-but-not-found-with-method' error.`);\n }\n return `The route you're trying to unregister was not previously ` +\n `registered for the method type '${method}'.`;\n },\n 'unregister-route-route-not-registered': () => {\n return `The route you're trying to unregister was not previously ` +\n `registered.`;\n },\n 'queue-replay-failed': ({ name }) => {\n return `Replaying the background sync queue '${name}' failed.`;\n },\n 'duplicate-queue-name': ({ name }) => {\n return `The Queue name '${name}' is already being used. ` +\n `All instances of backgroundSync.Queue must be given unique names.`;\n },\n 'expired-test-without-max-age': ({ methodName, paramName }) => {\n return `The '${methodName}()' method can only be used when the ` +\n `'${paramName}' is used in the constructor.`;\n },\n 'unsupported-route-type': ({ moduleName, className, funcName, paramName }) => {\n return `The supplied '${paramName}' parameter was an unsupported type. ` +\n `Please check the docs for ${moduleName}.${className}.${funcName} for ` +\n `valid input types.`;\n },\n 'not-array-of-class': ({ value, expectedClass, moduleName, className, funcName, paramName }) => {\n return `The supplied '${paramName}' parameter must be an array of ` +\n `'${expectedClass}' objects. Received '${JSON.stringify(value)},'. ` +\n `Please check the call to ${moduleName}.${className}.${funcName}() ` +\n `to fix the issue.`;\n },\n 'max-entries-or-age-required': ({ moduleName, className, funcName }) => {\n return `You must define either config.maxEntries or config.maxAgeSeconds` +\n `in ${moduleName}.${className}.${funcName}`;\n },\n 'statuses-or-headers-required': ({ moduleName, className, funcName }) => {\n return `You must define either config.statuses or config.headers` +\n `in ${moduleName}.${className}.${funcName}`;\n },\n 'invalid-string': ({ moduleName, funcName, paramName }) => {\n if (!paramName || !moduleName || !funcName) {\n throw new Error(`Unexpected input to 'invalid-string' error.`);\n }\n return `When using strings, the '${paramName}' parameter must start with ` +\n `'http' (for cross-origin matches) or '/' (for same-origin matches). ` +\n `Please see the docs for ${moduleName}.${funcName}() for ` +\n `more info.`;\n },\n 'channel-name-required': () => {\n return `You must provide a channelName to construct a ` +\n `BroadcastCacheUpdate instance.`;\n },\n 'invalid-responses-are-same-args': () => {\n return `The arguments passed into responsesAreSame() appear to be ` +\n `invalid. Please ensure valid Responses are used.`;\n },\n 'expire-custom-caches-only': () => {\n return `You must provide a 'cacheName' property when using the ` +\n `expiration plugin with a runtime caching strategy.`;\n },\n 'unit-must-be-bytes': ({ normalizedRangeHeader }) => {\n if (!normalizedRangeHeader) {\n throw new Error(`Unexpected input to 'unit-must-be-bytes' error.`);\n }\n return `The 'unit' portion of the Range header must be set to 'bytes'. ` +\n `The Range header provided was \"${normalizedRangeHeader}\"`;\n },\n 'single-range-only': ({ normalizedRangeHeader }) => {\n if (!normalizedRangeHeader) {\n throw new Error(`Unexpected input to 'single-range-only' error.`);\n }\n return `Multiple ranges are not supported. Please use a single start ` +\n `value, and optional end value. The Range header provided was ` +\n `\"${normalizedRangeHeader}\"`;\n },\n 'invalid-range-values': ({ normalizedRangeHeader }) => {\n if (!normalizedRangeHeader) {\n throw new Error(`Unexpected input to 'invalid-range-values' error.`);\n }\n return `The Range header is missing both start and end values. At least ` +\n `one of those values is needed. The Range header provided was ` +\n `\"${normalizedRangeHeader}\"`;\n },\n 'no-range-header': () => {\n return `No Range header was found in the Request provided.`;\n },\n 'range-not-satisfiable': ({ size, start, end }) => {\n return `The start (${start}) and end (${end}) values in the Range are ` +\n `not satisfiable by the cached response, which is ${size} bytes.`;\n },\n 'attempt-to-cache-non-get-request': ({ url, method }) => {\n return `Unable to cache '${url}' because it is a '${method}' request and ` +\n `only 'GET' requests can be cached.`;\n },\n 'cache-put-with-no-response': ({ url }) => {\n return `There was an attempt to cache '${url}' but the response was not ` +\n `defined.`;\n },\n 'no-response': ({ url, error }) => {\n let message = `The strategy could not generate a response for '${url}'.`;\n if (error) {\n message += ` The underlying error is ${error}.`;\n }\n return message;\n },\n 'bad-precaching-response': ({ url, status }) => {\n return `The precaching request for '${url}' failed with an HTTP ` +\n `status of ${status}.`;\n },\n 'non-precached-url': ({ url }) => {\n return `createHandlerBoundToURL('${url}') was called, but that URL is ` +\n `not precached. Please pass in a URL that is precached instead.`;\n },\n 'add-to-cache-list-conflicting-integrities': ({ url }) => {\n return `Two of the entries passed to ` +\n `'workbox-precaching.PrecacheController.addToCacheList()' had the URL ` +\n `${url} with different integrity values. Please remove one of them.`;\n },\n 'missing-precache-entry': ({ cacheName, url }) => {\n return `Unable to find a precached response in ${cacheName} for ${url}.`;\n },\n};\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { messages } from './messages.js';\nimport '../../_version.js';\nconst fallback = (code, ...args) => {\n let msg = code;\n if (args.length > 0) {\n msg += ` :: ${JSON.stringify(args)}`;\n }\n return msg;\n};\nconst generatorFunction = (code, details = {}) => {\n const message = messages[code];\n if (!message) {\n throw new Error(`Unable to find message for code '${code}'.`);\n }\n return message(details);\n};\nexport const messageGenerator = (process.env.NODE_ENV === 'production') ?\n fallback : generatorFunction;\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { messageGenerator } from '../models/messages/messageGenerator.js';\nimport '../_version.js';\n/**\n * Workbox errors should be thrown with this class.\n * This allows use to ensure the type easily in tests,\n * helps developers identify errors from workbox\n * easily and allows use to optimise error\n * messages correctly.\n *\n * @private\n */\nclass WorkboxError extends Error {\n /**\n *\n * @param {string} errorCode The error code that\n * identifies this particular error.\n * @param {Object=} details Any relevant arguments\n * that will help developers identify issues should\n * be added as a key on the context object.\n */\n constructor(errorCode, details) {\n const message = messageGenerator(errorCode, details);\n super(message);\n this.name = errorCode;\n this.details = details;\n }\n}\nexport { WorkboxError };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { WorkboxError } from '../_private/WorkboxError.js';\nimport '../_version.js';\n/*\n * This method throws if the supplied value is not an array.\n * The destructed values are required to produce a meaningful error for users.\n * The destructed and restructured object is so it's clear what is\n * needed.\n */\nconst isArray = (value, details) => {\n if (!Array.isArray(value)) {\n throw new WorkboxError('not-an-array', details);\n }\n};\nconst hasMethod = (object, expectedMethod, details) => {\n const type = typeof object[expectedMethod];\n if (type !== 'function') {\n details['expectedMethod'] = expectedMethod;\n throw new WorkboxError('missing-a-method', details);\n }\n};\nconst isType = (object, expectedType, details) => {\n if (typeof object !== expectedType) {\n details['expectedType'] = expectedType;\n throw new WorkboxError('incorrect-type', details);\n }\n};\nconst isInstance = (object, expectedClass, details) => {\n if (!(object instanceof expectedClass)) {\n details['expectedClass'] = expectedClass;\n throw new WorkboxError('incorrect-class', details);\n }\n};\nconst isOneOf = (value, validValues, details) => {\n if (!validValues.includes(value)) {\n details['validValueDescription'] =\n `Valid values are ${JSON.stringify(validValues)}.`;\n throw new WorkboxError('invalid-value', details);\n }\n};\nconst isArrayOfClass = (value, expectedClass, details) => {\n const error = new WorkboxError('not-array-of-class', details);\n if (!Array.isArray(value)) {\n throw error;\n }\n for (const item of value) {\n if (!(item instanceof expectedClass)) {\n throw error;\n }\n }\n};\nconst finalAssertExports = process.env.NODE_ENV === 'production' ? null : {\n hasMethod,\n isArray,\n isInstance,\n isOneOf,\n isType,\n isArrayOfClass,\n};\nexport { finalAssertExports as assert };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n// Callbacks to be executed whenever there's a quota error.\nconst quotaErrorCallbacks = new Set();\nexport { quotaErrorCallbacks };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { logger } from '../_private/logger.js';\nimport { quotaErrorCallbacks } from '../models/quotaErrorCallbacks.js';\nimport '../_version.js';\n/**\n * Runs all of the callback functions, one at a time sequentially, in the order\n * in which they were registered.\n *\n * @memberof module:workbox-core\n * @private\n */\nasync function executeQuotaErrorCallbacks() {\n if (process.env.NODE_ENV !== 'production') {\n logger.log(`About to run ${quotaErrorCallbacks.size} ` +\n `callbacks to clean up caches.`);\n }\n for (const callback of quotaErrorCallbacks) {\n await callback();\n if (process.env.NODE_ENV !== 'production') {\n logger.log(callback, 'is complete.');\n }\n }\n if (process.env.NODE_ENV !== 'production') {\n logger.log('Finished running callbacks.');\n }\n}\nexport { executeQuotaErrorCallbacks };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nexport const pluginUtils = {\n filter: (plugins, callbackName) => {\n return plugins.filter((plugin) => callbackName in plugin);\n },\n};\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from './assert.js';\nimport { executeQuotaErrorCallbacks } from './executeQuotaErrorCallbacks.js';\nimport { getFriendlyURL } from './getFriendlyURL.js';\nimport { logger } from './logger.js';\nimport { pluginUtils } from '../utils/pluginUtils.js';\nimport { WorkboxError } from './WorkboxError.js';\nimport '../_version.js';\n/**\n * Checks the list of plugins for the cacheKeyWillBeUsed callback, and\n * executes any of those callbacks found in sequence. The final `Request` object\n * returned by the last plugin is treated as the cache key for cache reads\n * and/or writes.\n *\n * @param {Object} options\n * @param {Request} options.request\n * @param {string} options.mode\n * @param {Array} [options.plugins=[]]\n * @return {Promise}\n *\n * @private\n * @memberof module:workbox-core\n */\nconst _getEffectiveRequest = async ({ request, mode, plugins = [], }) => {\n const cacheKeyWillBeUsedPlugins = pluginUtils.filter(plugins, \"cacheKeyWillBeUsed\" /* CACHE_KEY_WILL_BE_USED */);\n let effectiveRequest = request;\n for (const plugin of cacheKeyWillBeUsedPlugins) {\n effectiveRequest = await plugin[\"cacheKeyWillBeUsed\" /* CACHE_KEY_WILL_BE_USED */].call(plugin, { mode, request: effectiveRequest });\n if (typeof effectiveRequest === 'string') {\n effectiveRequest = new Request(effectiveRequest);\n }\n if (process.env.NODE_ENV !== 'production') {\n assert.isInstance(effectiveRequest, Request, {\n moduleName: 'Plugin',\n funcName: \"cacheKeyWillBeUsed\" /* CACHE_KEY_WILL_BE_USED */,\n isReturnValueProblem: true,\n });\n }\n }\n return effectiveRequest;\n};\n/**\n * This method will call cacheWillUpdate on the available plugins (or use\n * status === 200) to determine if the Response is safe and valid to cache.\n *\n * @param {Object} options\n * @param {Request} options.request\n * @param {Response} options.response\n * @param {Event} [options.event]\n * @param {Array} [options.plugins=[]]\n * @return {Promise}\n *\n * @private\n * @memberof module:workbox-core\n */\nconst _isResponseSafeToCache = async ({ request, response, event, plugins = [], }) => {\n let responseToCache = response;\n let pluginsUsed = false;\n for (const plugin of plugins) {\n if (\"cacheWillUpdate\" /* CACHE_WILL_UPDATE */ in plugin) {\n pluginsUsed = true;\n const pluginMethod = plugin[\"cacheWillUpdate\" /* CACHE_WILL_UPDATE */];\n responseToCache = await pluginMethod.call(plugin, {\n request,\n response: responseToCache,\n event,\n });\n if (process.env.NODE_ENV !== 'production') {\n if (responseToCache) {\n assert.isInstance(responseToCache, Response, {\n moduleName: 'Plugin',\n funcName: \"cacheWillUpdate\" /* CACHE_WILL_UPDATE */,\n isReturnValueProblem: true,\n });\n }\n }\n if (!responseToCache) {\n break;\n }\n }\n }\n if (!pluginsUsed) {\n if (process.env.NODE_ENV !== 'production') {\n if (responseToCache) {\n if (responseToCache.status !== 200) {\n if (responseToCache.status === 0) {\n logger.warn(`The response for '${request.url}' is an opaque ` +\n `response. The caching strategy that you're using will not ` +\n `cache opaque responses by default.`);\n }\n else {\n logger.debug(`The response for '${request.url}' returned ` +\n `a status code of '${response.status}' and won't be cached as a ` +\n `result.`);\n }\n }\n }\n }\n responseToCache = responseToCache && responseToCache.status === 200 ?\n responseToCache : undefined;\n }\n return responseToCache ? responseToCache : null;\n};\n/**\n * This is a wrapper around cache.match().\n *\n * @param {Object} options\n * @param {string} options.cacheName Name of the cache to match against.\n * @param {Request} options.request The Request that will be used to look up\n * cache entries.\n * @param {Event} [options.event] The event that prompted the action.\n * @param {Object} [options.matchOptions] Options passed to cache.match().\n * @param {Array} [options.plugins=[]] Array of plugins.\n * @return {Response} A cached response if available.\n *\n * @private\n * @memberof module:workbox-core\n */\nconst matchWrapper = async ({ cacheName, request, event, matchOptions, plugins = [], }) => {\n const cache = await self.caches.open(cacheName);\n const effectiveRequest = await _getEffectiveRequest({\n plugins, request, mode: 'read'\n });\n let cachedResponse = await cache.match(effectiveRequest, matchOptions);\n if (process.env.NODE_ENV !== 'production') {\n if (cachedResponse) {\n logger.debug(`Found a cached response in '${cacheName}'.`);\n }\n else {\n logger.debug(`No cached response found in '${cacheName}'.`);\n }\n }\n for (const plugin of plugins) {\n if (\"cachedResponseWillBeUsed\" /* CACHED_RESPONSE_WILL_BE_USED */ in plugin) {\n const pluginMethod = plugin[\"cachedResponseWillBeUsed\" /* CACHED_RESPONSE_WILL_BE_USED */];\n cachedResponse = await pluginMethod.call(plugin, {\n cacheName,\n event,\n matchOptions,\n cachedResponse,\n request: effectiveRequest,\n });\n if (process.env.NODE_ENV !== 'production') {\n if (cachedResponse) {\n assert.isInstance(cachedResponse, Response, {\n moduleName: 'Plugin',\n funcName: \"cachedResponseWillBeUsed\" /* CACHED_RESPONSE_WILL_BE_USED */,\n isReturnValueProblem: true,\n });\n }\n }\n }\n }\n return cachedResponse;\n};\n/**\n * Wrapper around cache.put().\n *\n * Will call `cacheDidUpdate` on plugins if the cache was updated, using\n * `matchOptions` when determining what the old entry is.\n *\n * @param {Object} options\n * @param {string} options.cacheName\n * @param {Request} options.request\n * @param {Response} options.response\n * @param {Event} [options.event]\n * @param {Array} [options.plugins=[]]\n * @param {Object} [options.matchOptions]\n *\n * @private\n * @memberof module:workbox-core\n */\nconst putWrapper = async ({ cacheName, request, response, event, plugins = [], matchOptions, }) => {\n if (process.env.NODE_ENV !== 'production') {\n if (request.method && request.method !== 'GET') {\n throw new WorkboxError('attempt-to-cache-non-get-request', {\n url: getFriendlyURL(request.url),\n method: request.method,\n });\n }\n }\n const effectiveRequest = await _getEffectiveRequest({\n plugins, request, mode: 'write'\n });\n if (!response) {\n if (process.env.NODE_ENV !== 'production') {\n logger.error(`Cannot cache non-existent response for ` +\n `'${getFriendlyURL(effectiveRequest.url)}'.`);\n }\n throw new WorkboxError('cache-put-with-no-response', {\n url: getFriendlyURL(effectiveRequest.url),\n });\n }\n const responseToCache = await _isResponseSafeToCache({\n event,\n plugins,\n response,\n request: effectiveRequest,\n });\n if (!responseToCache) {\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Response '${getFriendlyURL(effectiveRequest.url)}' will ` +\n `not be cached.`, responseToCache);\n }\n return;\n }\n const cache = await self.caches.open(cacheName);\n const updatePlugins = pluginUtils.filter(plugins, \"cacheDidUpdate\" /* CACHE_DID_UPDATE */);\n const oldResponse = updatePlugins.length > 0 ?\n await matchWrapper({ cacheName, matchOptions, request: effectiveRequest }) :\n null;\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Updating the '${cacheName}' cache with a new Response for ` +\n `${getFriendlyURL(effectiveRequest.url)}.`);\n }\n try {\n await cache.put(effectiveRequest, responseToCache);\n }\n catch (error) {\n // See https://developer.mozilla.org/en-US/docs/Web/API/DOMException#exception-QuotaExceededError\n if (error.name === 'QuotaExceededError') {\n await executeQuotaErrorCallbacks();\n }\n throw error;\n }\n for (const plugin of updatePlugins) {\n await plugin[\"cacheDidUpdate\" /* CACHE_DID_UPDATE */].call(plugin, {\n cacheName,\n event,\n oldResponse,\n newResponse: responseToCache,\n request: effectiveRequest,\n });\n }\n};\nexport const cacheWrapper = {\n put: putWrapper,\n match: matchWrapper,\n};\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { WorkboxError } from './WorkboxError.js';\nimport { logger } from './logger.js';\nimport { assert } from './assert.js';\nimport { getFriendlyURL } from '../_private/getFriendlyURL.js';\nimport { pluginUtils } from '../utils/pluginUtils.js';\nimport '../_version.js';\n/**\n * Wrapper around the fetch API.\n *\n * Will call requestWillFetch on available plugins.\n *\n * @param {Object} options\n * @param {Request|string} options.request\n * @param {Object} [options.fetchOptions]\n * @param {ExtendableEvent} [options.event]\n * @param {Array} [options.plugins=[]]\n * @return {Promise}\n *\n * @private\n * @memberof module:workbox-core\n */\nconst wrappedFetch = async ({ request, fetchOptions, event, plugins = [], }) => {\n if (typeof request === 'string') {\n request = new Request(request);\n }\n // We *should* be able to call `await event.preloadResponse` even if it's\n // undefined, but for some reason, doing so leads to errors in our Node unit\n // tests. To work around that, explicitly check preloadResponse's value first.\n if (event instanceof FetchEvent && event.preloadResponse) {\n const possiblePreloadResponse = await event.preloadResponse;\n if (possiblePreloadResponse) {\n if (process.env.NODE_ENV !== 'production') {\n logger.log(`Using a preloaded navigation response for ` +\n `'${getFriendlyURL(request.url)}'`);\n }\n return possiblePreloadResponse;\n }\n }\n if (process.env.NODE_ENV !== 'production') {\n assert.isInstance(request, Request, {\n paramName: 'request',\n expectedClass: Request,\n moduleName: 'workbox-core',\n className: 'fetchWrapper',\n funcName: 'wrappedFetch',\n });\n }\n const failedFetchPlugins = pluginUtils.filter(plugins, \"fetchDidFail\" /* FETCH_DID_FAIL */);\n // If there is a fetchDidFail plugin, we need to save a clone of the\n // original request before it's either modified by a requestWillFetch\n // plugin or before the original request's body is consumed via fetch().\n const originalRequest = failedFetchPlugins.length > 0 ?\n request.clone() : null;\n try {\n for (const plugin of plugins) {\n if (\"requestWillFetch\" /* REQUEST_WILL_FETCH */ in plugin) {\n const pluginMethod = plugin[\"requestWillFetch\" /* REQUEST_WILL_FETCH */];\n const requestClone = request.clone();\n request = await pluginMethod.call(plugin, {\n request: requestClone,\n event,\n });\n if (process.env.NODE_ENV !== 'production') {\n if (request) {\n assert.isInstance(request, Request, {\n moduleName: 'Plugin',\n funcName: \"cachedResponseWillBeUsed\" /* CACHED_RESPONSE_WILL_BE_USED */,\n isReturnValueProblem: true,\n });\n }\n }\n }\n }\n }\n catch (err) {\n throw new WorkboxError('plugin-error-request-will-fetch', {\n thrownError: err,\n });\n }\n // The request can be altered by plugins with `requestWillFetch` making\n // the original request (Most likely from a `fetch` event) to be different\n // to the Request we make. Pass both to `fetchDidFail` to aid debugging.\n const pluginFilteredRequest = request.clone();\n try {\n let fetchResponse;\n // See https://github.com/GoogleChrome/workbox/issues/1796\n if (request.mode === 'navigate') {\n fetchResponse = await fetch(request);\n }\n else {\n fetchResponse = await fetch(request, fetchOptions);\n }\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Network request for ` +\n `'${getFriendlyURL(request.url)}' returned a response with ` +\n `status '${fetchResponse.status}'.`);\n }\n for (const plugin of plugins) {\n if (\"fetchDidSucceed\" /* FETCH_DID_SUCCEED */ in plugin) {\n fetchResponse = await plugin[\"fetchDidSucceed\" /* FETCH_DID_SUCCEED */]\n .call(plugin, {\n event,\n request: pluginFilteredRequest,\n response: fetchResponse,\n });\n if (process.env.NODE_ENV !== 'production') {\n if (fetchResponse) {\n assert.isInstance(fetchResponse, Response, {\n moduleName: 'Plugin',\n funcName: \"fetchDidSucceed\" /* FETCH_DID_SUCCEED */,\n isReturnValueProblem: true,\n });\n }\n }\n }\n }\n return fetchResponse;\n }\n catch (error) {\n if (process.env.NODE_ENV !== 'production') {\n logger.error(`Network request for ` +\n `'${getFriendlyURL(request.url)}' threw an error.`, error);\n }\n for (const plugin of failedFetchPlugins) {\n await plugin[\"fetchDidFail\" /* FETCH_DID_FAIL */].call(plugin, {\n error,\n event,\n originalRequest: originalRequest.clone(),\n request: pluginFilteredRequest.clone(),\n });\n }\n throw error;\n }\n};\nconst fetchWrapper = {\n fetch: wrappedFetch,\n};\nexport { fetchWrapper };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nlet supportStatus;\n/**\n * A utility function that determines whether the current browser supports\n * constructing a new `Response` from a `response.body` stream.\n *\n * @return {boolean} `true`, if the current browser can successfully\n * construct a `Response` from a `response.body` stream, `false` otherwise.\n *\n * @private\n */\nfunction canConstructResponseFromBodyStream() {\n if (supportStatus === undefined) {\n const testResponse = new Response('');\n if ('body' in testResponse) {\n try {\n new Response(testResponse.body);\n supportStatus = true;\n }\n catch (error) {\n supportStatus = false;\n }\n }\n supportStatus = false;\n }\n return supportStatus;\n}\nexport { canConstructResponseFromBodyStream };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { canConstructResponseFromBodyStream } from './_private/canConstructResponseFromBodyStream.js';\nimport './_version.js';\n/**\n * Allows developers to copy a response and modify its `headers`, `status`,\n * or `statusText` values (the values settable via a\n * [`ResponseInit`]{@link https://developer.mozilla.org/en-US/docs/Web/API/Response/Response#Syntax}\n * object in the constructor).\n * To modify these values, pass a function as the second argument. That\n * function will be invoked with a single object with the response properties\n * `{headers, status, statusText}`. The return value of this function will\n * be used as the `ResponseInit` for the new `Response`. To change the values\n * either modify the passed parameter(s) and return it, or return a totally\n * new object.\n *\n * @param {Response} response\n * @param {Function} modifier\n * @memberof module:workbox-core\n */\nasync function copyResponse(response, modifier) {\n const clonedResponse = response.clone();\n // Create a fresh `ResponseInit` object by cloning the headers.\n const responseInit = {\n headers: new Headers(clonedResponse.headers),\n status: clonedResponse.status,\n statusText: clonedResponse.statusText,\n };\n // Apply any user modifications.\n const modifiedResponseInit = modifier ? modifier(responseInit) : responseInit;\n // Create the new response from the body stream and `ResponseInit`\n // modifications. Note: not all browsers support the Response.body stream,\n // so fall back to reading the entire body into memory as a blob.\n const body = canConstructResponseFromBodyStream() ?\n clonedResponse.body : await clonedResponse.blob();\n return new Response(body, modifiedResponseInit);\n}\nexport { copyResponse };\n","\"use strict\";\n// @ts-ignore\ntry {\n self['workbox:precaching:5.1.4'] && _();\n}\ncatch (e) { }\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport '../_version.js';\n// Name of the search parameter used to store revision info.\nconst REVISION_SEARCH_PARAM = '__WB_REVISION__';\n/**\n * Converts a manifest entry into a versioned URL suitable for precaching.\n *\n * @param {Object|string} entry\n * @return {string} A URL with versioning info.\n *\n * @private\n * @memberof module:workbox-precaching\n */\nexport function createCacheKey(entry) {\n if (!entry) {\n throw new WorkboxError('add-to-cache-list-unexpected-type', { entry });\n }\n // If a precache manifest entry is a string, it's assumed to be a versioned\n // URL, like '/app.abcd1234.js'. Return as-is.\n if (typeof entry === 'string') {\n const urlObject = new URL(entry, location.href);\n return {\n cacheKey: urlObject.href,\n url: urlObject.href,\n };\n }\n const { revision, url } = entry;\n if (!url) {\n throw new WorkboxError('add-to-cache-list-unexpected-type', { entry });\n }\n // If there's just a URL and no revision, then it's also assumed to be a\n // versioned URL.\n if (!revision) {\n const urlObject = new URL(url, location.href);\n return {\n cacheKey: urlObject.href,\n url: urlObject.href,\n };\n }\n // Otherwise, construct a properly versioned URL using the custom Workbox\n // search parameter along with the revision info.\n const cacheKeyURL = new URL(url, location.href);\n const originalURL = new URL(url, location.href);\n cacheKeyURL.searchParams.set(REVISION_SEARCH_PARAM, revision);\n return {\n cacheKey: cacheKeyURL.href,\n url: originalURL.href,\n };\n}\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { logger } from 'workbox-core/_private/logger.js';\nimport '../_version.js';\n/**\n * @param {string} groupTitle\n * @param {Array} deletedURLs\n *\n * @private\n */\nconst logGroup = (groupTitle, deletedURLs) => {\n logger.groupCollapsed(groupTitle);\n for (const url of deletedURLs) {\n logger.log(url);\n }\n logger.groupEnd();\n};\n/**\n * @param {Array} deletedURLs\n *\n * @private\n * @memberof module:workbox-precaching\n */\nexport function printCleanupDetails(deletedURLs) {\n const deletionCount = deletedURLs.length;\n if (deletionCount > 0) {\n logger.groupCollapsed(`During precaching cleanup, ` +\n `${deletionCount} cached ` +\n `request${deletionCount === 1 ? ' was' : 's were'} deleted.`);\n logGroup('Deleted Cache Requests', deletedURLs);\n logger.groupEnd();\n }\n}\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { logger } from 'workbox-core/_private/logger.js';\nimport '../_version.js';\n/**\n * @param {string} groupTitle\n * @param {Array} urls\n *\n * @private\n */\nfunction _nestedGroup(groupTitle, urls) {\n if (urls.length === 0) {\n return;\n }\n logger.groupCollapsed(groupTitle);\n for (const url of urls) {\n logger.log(url);\n }\n logger.groupEnd();\n}\n/**\n * @param {Array} urlsToPrecache\n * @param {Array} urlsAlreadyPrecached\n *\n * @private\n * @memberof module:workbox-precaching\n */\nexport function printInstallDetails(urlsToPrecache, urlsAlreadyPrecached) {\n const precachedCount = urlsToPrecache.length;\n const alreadyPrecachedCount = urlsAlreadyPrecached.length;\n if (precachedCount || alreadyPrecachedCount) {\n let message = `Precaching ${precachedCount} file${precachedCount === 1 ? '' : 's'}.`;\n if (alreadyPrecachedCount > 0) {\n message += ` ${alreadyPrecachedCount} ` +\n `file${alreadyPrecachedCount === 1 ? ' is' : 's are'} already cached.`;\n }\n logger.groupCollapsed(message);\n _nestedGroup(`View newly precached URLs.`, urlsToPrecache);\n _nestedGroup(`View previously precached URLs.`, urlsAlreadyPrecached);\n logger.groupEnd();\n }\n}\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { cacheNames } from 'workbox-core/_private/cacheNames.js';\nimport { cacheWrapper } from 'workbox-core/_private/cacheWrapper.js';\nimport { fetchWrapper } from 'workbox-core/_private/fetchWrapper.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { copyResponse } from 'workbox-core/copyResponse.js';\nimport { createCacheKey } from './utils/createCacheKey.js';\nimport { printCleanupDetails } from './utils/printCleanupDetails.js';\nimport { printInstallDetails } from './utils/printInstallDetails.js';\nimport './_version.js';\n/**\n * Performs efficient precaching of assets.\n *\n * @memberof module:workbox-precaching\n */\nclass PrecacheController {\n /**\n * Create a new PrecacheController.\n *\n * @param {string} [cacheName] An optional name for the cache, to override\n * the default precache name.\n */\n constructor(cacheName) {\n this._cacheName = cacheNames.getPrecacheName(cacheName);\n this._urlsToCacheKeys = new Map();\n this._urlsToCacheModes = new Map();\n this._cacheKeysToIntegrities = new Map();\n }\n /**\n * This method will add items to the precache list, removing duplicates\n * and ensuring the information is valid.\n *\n * @param {\n * Array\n * } entries Array of entries to precache.\n */\n addToCacheList(entries) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isArray(entries, {\n moduleName: 'workbox-precaching',\n className: 'PrecacheController',\n funcName: 'addToCacheList',\n paramName: 'entries',\n });\n }\n const urlsToWarnAbout = [];\n for (const entry of entries) {\n // See https://github.com/GoogleChrome/workbox/issues/2259\n if (typeof entry === 'string') {\n urlsToWarnAbout.push(entry);\n }\n else if (entry && entry.revision === undefined) {\n urlsToWarnAbout.push(entry.url);\n }\n const { cacheKey, url } = createCacheKey(entry);\n const cacheMode = (typeof entry !== 'string' && entry.revision) ?\n 'reload' : 'default';\n if (this._urlsToCacheKeys.has(url) &&\n this._urlsToCacheKeys.get(url) !== cacheKey) {\n throw new WorkboxError('add-to-cache-list-conflicting-entries', {\n firstEntry: this._urlsToCacheKeys.get(url),\n secondEntry: cacheKey,\n });\n }\n if (typeof entry !== 'string' && entry.integrity) {\n if (this._cacheKeysToIntegrities.has(cacheKey) &&\n this._cacheKeysToIntegrities.get(cacheKey) !== entry.integrity) {\n throw new WorkboxError('add-to-cache-list-conflicting-integrities', {\n url,\n });\n }\n this._cacheKeysToIntegrities.set(cacheKey, entry.integrity);\n }\n this._urlsToCacheKeys.set(url, cacheKey);\n this._urlsToCacheModes.set(url, cacheMode);\n if (urlsToWarnAbout.length > 0) {\n const warningMessage = `Workbox is precaching URLs without revision ` +\n `info: ${urlsToWarnAbout.join(', ')}\\nThis is generally NOT safe. ` +\n `Learn more at https://bit.ly/wb-precache`;\n if (process.env.NODE_ENV === 'production') {\n // Use console directly to display this warning without bloating\n // bundle sizes by pulling in all of the logger codebase in prod.\n console.warn(warningMessage);\n }\n else {\n logger.warn(warningMessage);\n }\n }\n }\n }\n /**\n * Precaches new and updated assets. Call this method from the service worker\n * install event.\n *\n * @param {Object} options\n * @param {Event} [options.event] The install event (if needed).\n * @param {Array} [options.plugins] Plugins to be used for fetching\n * and caching during install.\n * @return {Promise}\n */\n async install({ event, plugins } = {}) {\n if (process.env.NODE_ENV !== 'production') {\n if (plugins) {\n assert.isArray(plugins, {\n moduleName: 'workbox-precaching',\n className: 'PrecacheController',\n funcName: 'install',\n paramName: 'plugins',\n });\n }\n }\n const toBePrecached = [];\n const alreadyPrecached = [];\n const cache = await self.caches.open(this._cacheName);\n const alreadyCachedRequests = await cache.keys();\n const existingCacheKeys = new Set(alreadyCachedRequests.map((request) => request.url));\n for (const [url, cacheKey] of this._urlsToCacheKeys) {\n if (existingCacheKeys.has(cacheKey)) {\n alreadyPrecached.push(url);\n }\n else {\n toBePrecached.push({ cacheKey, url });\n }\n }\n const precacheRequests = toBePrecached.map(({ cacheKey, url }) => {\n const integrity = this._cacheKeysToIntegrities.get(cacheKey);\n const cacheMode = this._urlsToCacheModes.get(url);\n return this._addURLToCache({\n cacheKey,\n cacheMode,\n event,\n integrity,\n plugins,\n url,\n });\n });\n await Promise.all(precacheRequests);\n const updatedURLs = toBePrecached.map((item) => item.url);\n if (process.env.NODE_ENV !== 'production') {\n printInstallDetails(updatedURLs, alreadyPrecached);\n }\n return {\n updatedURLs,\n notUpdatedURLs: alreadyPrecached,\n };\n }\n /**\n * Deletes assets that are no longer present in the current precache manifest.\n * Call this method from the service worker activate event.\n *\n * @return {Promise}\n */\n async activate() {\n const cache = await self.caches.open(this._cacheName);\n const currentlyCachedRequests = await cache.keys();\n const expectedCacheKeys = new Set(this._urlsToCacheKeys.values());\n const deletedURLs = [];\n for (const request of currentlyCachedRequests) {\n if (!expectedCacheKeys.has(request.url)) {\n await cache.delete(request);\n deletedURLs.push(request.url);\n }\n }\n if (process.env.NODE_ENV !== 'production') {\n printCleanupDetails(deletedURLs);\n }\n return { deletedURLs };\n }\n /**\n * Requests the entry and saves it to the cache if the response is valid.\n * By default, any response with a status code of less than 400 (including\n * opaque responses) is considered valid.\n *\n * If you need to use custom criteria to determine what's valid and what\n * isn't, then pass in an item in `options.plugins` that implements the\n * `cacheWillUpdate()` lifecycle event.\n *\n * @private\n * @param {Object} options\n * @param {string} options.cacheKey The string to use a cache key.\n * @param {string} options.url The URL to fetch and cache.\n * @param {string} [options.cacheMode] The cache mode for the network request.\n * @param {Event} [options.event] The install event (if passed).\n * @param {Array} [options.plugins] An array of plugins to apply to\n * fetch and caching.\n * @param {string} [options.integrity] The value to use for the `integrity`\n * field when making the request.\n */\n async _addURLToCache({ cacheKey, url, cacheMode, event, plugins, integrity }) {\n const request = new Request(url, {\n integrity,\n cache: cacheMode,\n credentials: 'same-origin',\n });\n let response = await fetchWrapper.fetch({\n event,\n plugins,\n request,\n });\n // Allow developers to override the default logic about what is and isn't\n // valid by passing in a plugin implementing cacheWillUpdate(), e.g.\n // a `CacheableResponsePlugin` instance.\n let cacheWillUpdatePlugin;\n for (const plugin of (plugins || [])) {\n if ('cacheWillUpdate' in plugin) {\n cacheWillUpdatePlugin = plugin;\n }\n }\n const isValidResponse = cacheWillUpdatePlugin ?\n // Use a callback if provided. It returns a truthy value if valid.\n // NOTE: invoke the method on the plugin instance so the `this` context\n // is correct.\n await cacheWillUpdatePlugin.cacheWillUpdate({ event, request, response }) :\n // Otherwise, default to considering any response status under 400 valid.\n // This includes, by default, considering opaque responses valid.\n response.status < 400;\n // Consider this a failure, leading to the `install` handler failing, if\n // we get back an invalid response.\n if (!isValidResponse) {\n throw new WorkboxError('bad-precaching-response', {\n url,\n status: response.status,\n });\n }\n // Redirected responses cannot be used to satisfy a navigation request, so\n // any redirected response must be \"copied\" rather than cloned, so the new\n // response doesn't contain the `redirected` flag. See:\n // https://bugs.chromium.org/p/chromium/issues/detail?id=669363&desc=2#c1\n if (response.redirected) {\n response = await copyResponse(response);\n }\n await cacheWrapper.put({\n event,\n plugins,\n response,\n // `request` already uses `url`. We may be able to reuse it.\n request: cacheKey === url ? request : new Request(cacheKey),\n cacheName: this._cacheName,\n matchOptions: {\n ignoreSearch: true,\n },\n });\n }\n /**\n * Returns a mapping of a precached URL to the corresponding cache key, taking\n * into account the revision information for the URL.\n *\n * @return {Map} A URL to cache key mapping.\n */\n getURLsToCacheKeys() {\n return this._urlsToCacheKeys;\n }\n /**\n * Returns a list of all the URLs that have been precached by the current\n * service worker.\n *\n * @return {Array} The precached URLs.\n */\n getCachedURLs() {\n return [...this._urlsToCacheKeys.keys()];\n }\n /**\n * Returns the cache key used for storing a given URL. If that URL is\n * unversioned, like `/index.html', then the cache key will be the original\n * URL with a search parameter appended to it.\n *\n * @param {string} url A URL whose cache key you want to look up.\n * @return {string} The versioned URL that corresponds to a cache key\n * for the original URL, or undefined if that URL isn't precached.\n */\n getCacheKeyForURL(url) {\n const urlObject = new URL(url, location.href);\n return this._urlsToCacheKeys.get(urlObject.href);\n }\n /**\n * This acts as a drop-in replacement for [`cache.match()`](https://developer.mozilla.org/en-US/docs/Web/API/Cache/match)\n * with the following differences:\n *\n * - It knows what the name of the precache is, and only checks in that cache.\n * - It allows you to pass in an \"original\" URL without versioning parameters,\n * and it will automatically look up the correct cache key for the currently\n * active revision of that URL.\n *\n * E.g., `matchPrecache('index.html')` will find the correct precached\n * response for the currently active service worker, even if the actual cache\n * key is `'/index.html?__WB_REVISION__=1234abcd'`.\n *\n * @param {string|Request} request The key (without revisioning parameters)\n * to look up in the precache.\n * @return {Promise}\n */\n async matchPrecache(request) {\n const url = request instanceof Request ? request.url : request;\n const cacheKey = this.getCacheKeyForURL(url);\n if (cacheKey) {\n const cache = await self.caches.open(this._cacheName);\n return cache.match(cacheKey);\n }\n return undefined;\n }\n /**\n * Returns a function that can be used within a\n * {@link module:workbox-routing.Route} that will find a response for the\n * incoming request against the precache.\n *\n * If for an unexpected reason there is a cache miss for the request,\n * this will fall back to retrieving the `Response` via `fetch()` when\n * `fallbackToNetwork` is `true`.\n *\n * @param {boolean} [fallbackToNetwork=true] Whether to attempt to get the\n * response from the network if there's a precache miss.\n * @return {module:workbox-routing~handlerCallback}\n */\n createHandler(fallbackToNetwork = true) {\n return async ({ request }) => {\n try {\n const response = await this.matchPrecache(request);\n if (response) {\n return response;\n }\n // This shouldn't normally happen, but there are edge cases:\n // https://github.com/GoogleChrome/workbox/issues/1441\n throw new WorkboxError('missing-precache-entry', {\n cacheName: this._cacheName,\n url: request instanceof Request ? request.url : request,\n });\n }\n catch (error) {\n if (fallbackToNetwork) {\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Unable to respond with precached response. ` +\n `Falling back to network.`, error);\n }\n return fetch(request);\n }\n throw error;\n }\n };\n }\n /**\n * Returns a function that looks up `url` in the precache (taking into\n * account revision information), and returns the corresponding `Response`.\n *\n * If for an unexpected reason there is a cache miss when looking up `url`,\n * this will fall back to retrieving the `Response` via `fetch()` when\n * `fallbackToNetwork` is `true`.\n *\n * @param {string} url The precached URL which will be used to lookup the\n * `Response`.\n * @param {boolean} [fallbackToNetwork=true] Whether to attempt to get the\n * response from the network if there's a precache miss.\n * @return {module:workbox-routing~handlerCallback}\n */\n createHandlerBoundToURL(url, fallbackToNetwork = true) {\n const cacheKey = this.getCacheKeyForURL(url);\n if (!cacheKey) {\n throw new WorkboxError('non-precached-url', { url });\n }\n const handler = this.createHandler(fallbackToNetwork);\n const request = new Request(url);\n return () => handler({ request });\n }\n}\nexport { PrecacheController };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { PrecacheController } from '../PrecacheController.js';\nimport '../_version.js';\nlet precacheController;\n/**\n * @return {PrecacheController}\n * @private\n */\nexport const getOrCreatePrecacheController = () => {\n if (!precacheController) {\n precacheController = new PrecacheController();\n }\n return precacheController;\n};\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * Removes any URL search parameters that should be ignored.\n *\n * @param {URL} urlObject The original URL.\n * @param {Array} ignoreURLParametersMatching RegExps to test against\n * each search parameter name. Matches mean that the search parameter should be\n * ignored.\n * @return {URL} The URL with any ignored search parameters removed.\n *\n * @private\n * @memberof module:workbox-precaching\n */\nexport function removeIgnoredSearchParams(urlObject, ignoreURLParametersMatching = []) {\n // Convert the iterable into an array at the start of the loop to make sure\n // deletion doesn't mess up iteration.\n for (const paramName of [...urlObject.searchParams.keys()]) {\n if (ignoreURLParametersMatching.some((regExp) => regExp.test(paramName))) {\n urlObject.searchParams.delete(paramName);\n }\n }\n return urlObject;\n}\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { removeIgnoredSearchParams } from './removeIgnoredSearchParams.js';\nimport '../_version.js';\n/**\n * Generator function that yields possible variations on the original URL to\n * check, one at a time.\n *\n * @param {string} url\n * @param {Object} options\n *\n * @private\n * @memberof module:workbox-precaching\n */\nexport function* generateURLVariations(url, { ignoreURLParametersMatching, directoryIndex, cleanURLs, urlManipulation, } = {}) {\n const urlObject = new URL(url, location.href);\n urlObject.hash = '';\n yield urlObject.href;\n const urlWithoutIgnoredParams = removeIgnoredSearchParams(urlObject, ignoreURLParametersMatching);\n yield urlWithoutIgnoredParams.href;\n if (directoryIndex && urlWithoutIgnoredParams.pathname.endsWith('/')) {\n const directoryURL = new URL(urlWithoutIgnoredParams.href);\n directoryURL.pathname += directoryIndex;\n yield directoryURL.href;\n }\n if (cleanURLs) {\n const cleanURL = new URL(urlWithoutIgnoredParams.href);\n cleanURL.pathname += '.html';\n yield cleanURL.href;\n }\n if (urlManipulation) {\n const additionalURLs = urlManipulation({ url: urlObject });\n for (const urlToAttempt of additionalURLs) {\n yield urlToAttempt.href;\n }\n }\n}\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { getOrCreatePrecacheController } from './getOrCreatePrecacheController.js';\nimport { generateURLVariations } from './generateURLVariations.js';\nimport '../_version.js';\n/**\n * This function will take the request URL and manipulate it based on the\n * configuration options.\n *\n * @param {string} url\n * @param {Object} options\n * @return {string} Returns the URL in the cache that matches the request,\n * if possible.\n *\n * @private\n */\nexport const getCacheKeyForURL = (url, options) => {\n const precacheController = getOrCreatePrecacheController();\n const urlsToCacheKeys = precacheController.getURLsToCacheKeys();\n for (const possibleURL of generateURLVariations(url, options)) {\n const possibleCacheKey = urlsToCacheKeys.get(possibleURL);\n if (possibleCacheKey) {\n return possibleCacheKey;\n }\n }\n};\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { cacheNames } from 'workbox-core/_private/cacheNames.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { getCacheKeyForURL } from './getCacheKeyForURL.js';\nimport '../_version.js';\n/**\n * Adds a `fetch` listener to the service worker that will\n * respond to\n * [network requests]{@link https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers#Custom_responses_to_requests}\n * with precached assets.\n *\n * Requests for assets that aren't precached, the `FetchEvent` will not be\n * responded to, allowing the event to fall through to other `fetch` event\n * listeners.\n *\n * NOTE: when called more than once this method will replace the previously set\n * configuration options. Calling it more than once is not recommended outside\n * of tests.\n *\n * @private\n * @param {Object} [options]\n * @param {string} [options.directoryIndex=index.html] The `directoryIndex` will\n * check cache entries for a URLs ending with '/' to see if there is a hit when\n * appending the `directoryIndex` value.\n * @param {Array} [options.ignoreURLParametersMatching=[/^utm_/]] An\n * array of regex's to remove search params when looking for a cache match.\n * @param {boolean} [options.cleanURLs=true] The `cleanURLs` option will\n * check the cache for the URL with a `.html` added to the end of the end.\n * @param {workbox.precaching~urlManipulation} [options.urlManipulation]\n * This is a function that should take a URL and return an array of\n * alternative URLs that should be checked for precache matches.\n */\nexport const addFetchListener = ({ ignoreURLParametersMatching = [/^utm_/], directoryIndex = 'index.html', cleanURLs = true, urlManipulation, } = {}) => {\n const cacheName = cacheNames.getPrecacheName();\n // See https://github.com/Microsoft/TypeScript/issues/28357#issuecomment-436484705\n self.addEventListener('fetch', ((event) => {\n const precachedURL = getCacheKeyForURL(event.request.url, {\n cleanURLs,\n directoryIndex,\n ignoreURLParametersMatching,\n urlManipulation,\n });\n if (!precachedURL) {\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Precaching did not find a match for ` +\n getFriendlyURL(event.request.url));\n }\n return;\n }\n let responsePromise = self.caches.open(cacheName).then((cache) => {\n return cache.match(precachedURL);\n }).then((cachedResponse) => {\n if (cachedResponse) {\n return cachedResponse;\n }\n // Fall back to the network if we don't have a cached response\n // (perhaps due to manual cache cleanup).\n if (process.env.NODE_ENV !== 'production') {\n logger.warn(`The precached response for ` +\n `${getFriendlyURL(precachedURL)} in ${cacheName} was not found. ` +\n `Falling back to the network instead.`);\n }\n return fetch(precachedURL);\n });\n if (process.env.NODE_ENV !== 'production') {\n responsePromise = responsePromise.then((response) => {\n // Workbox is going to handle the route.\n // print the routing details to the console.\n logger.groupCollapsed(`Precaching is responding to: ` +\n getFriendlyURL(event.request.url));\n logger.log(`Serving the precached url: ${precachedURL}`);\n logger.groupCollapsed(`View request details here.`);\n logger.log(event.request);\n logger.groupEnd();\n logger.groupCollapsed(`View response details here.`);\n logger.log(response);\n logger.groupEnd();\n logger.groupEnd();\n return response;\n });\n }\n event.respondWith(responsePromise);\n }));\n};\n","/*\n Copyright 2019 Google LLC\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { addFetchListener } from './utils/addFetchListener.js';\nimport './_version.js';\nlet listenerAdded = false;\n/**\n * Add a `fetch` listener to the service worker that will\n * respond to\n * [network requests]{@link https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers#Custom_responses_to_requests}\n * with precached assets.\n *\n * Requests for assets that aren't precached, the `FetchEvent` will not be\n * responded to, allowing the event to fall through to other `fetch` event\n * listeners.\n *\n * @param {Object} [options]\n * @param {string} [options.directoryIndex=index.html] The `directoryIndex` will\n * check cache entries for a URLs ending with '/' to see if there is a hit when\n * appending the `directoryIndex` value.\n * @param {Array} [options.ignoreURLParametersMatching=[/^utm_/]] An\n * array of regex's to remove search params when looking for a cache match.\n * @param {boolean} [options.cleanURLs=true] The `cleanURLs` option will\n * check the cache for the URL with a `.html` added to the end of the end.\n * @param {module:workbox-precaching~urlManipulation} [options.urlManipulation]\n * This is a function that should take a URL and return an array of\n * alternative URLs that should be checked for precache matches.\n *\n * @memberof module:workbox-precaching\n */\nfunction addRoute(options) {\n if (!listenerAdded) {\n addFetchListener(options);\n listenerAdded = true;\n }\n}\nexport { addRoute };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nconst plugins = [];\nexport const precachePlugins = {\n /*\n * @return {Array}\n * @private\n */\n get() {\n return plugins;\n },\n /*\n * @param {Array} newPlugins\n * @private\n */\n add(newPlugins) {\n plugins.push(...newPlugins);\n },\n};\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { getOrCreatePrecacheController } from './utils/getOrCreatePrecacheController.js';\nimport { precachePlugins } from './utils/precachePlugins.js';\nimport './_version.js';\nconst installListener = (event) => {\n const precacheController = getOrCreatePrecacheController();\n const plugins = precachePlugins.get();\n event.waitUntil(precacheController.install({ event, plugins })\n .catch((error) => {\n if (process.env.NODE_ENV !== 'production') {\n logger.error(`Service worker installation failed. It will ` +\n `be retried automatically during the next navigation.`);\n }\n // Re-throw the error to ensure installation fails.\n throw error;\n }));\n};\nconst activateListener = (event) => {\n const precacheController = getOrCreatePrecacheController();\n event.waitUntil(precacheController.activate());\n};\n/**\n * Adds items to the precache list, removing any duplicates and\n * stores the files in the\n * [\"precache cache\"]{@link module:workbox-core.cacheNames} when the service\n * worker installs.\n *\n * This method can be called multiple times.\n *\n * Please note: This method **will not** serve any of the cached files for you.\n * It only precaches files. To respond to a network request you call\n * [addRoute()]{@link module:workbox-precaching.addRoute}.\n *\n * If you have a single array of files to precache, you can just call\n * [precacheAndRoute()]{@link module:workbox-precaching.precacheAndRoute}.\n *\n * @param {Array} [entries=[]] Array of entries to precache.\n *\n * @memberof module:workbox-precaching\n */\nfunction precache(entries) {\n const precacheController = getOrCreatePrecacheController();\n precacheController.addToCacheList(entries);\n if (entries.length > 0) {\n // NOTE: these listeners will only be added once (even if the `precache()`\n // method is called multiple times) because event listeners are implemented\n // as a set, where each listener must be unique.\n // See https://github.com/Microsoft/TypeScript/issues/28357#issuecomment-436484705\n self.addEventListener('install', installListener);\n self.addEventListener('activate', activateListener);\n }\n}\nexport { precache };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { addRoute } from './addRoute.js';\nimport { precache } from './precache.js';\nimport './_version.js';\n/**\n * This method will add entries to the precache list and add a route to\n * respond to fetch events.\n *\n * This is a convenience method that will call\n * [precache()]{@link module:workbox-precaching.precache} and\n * [addRoute()]{@link module:workbox-precaching.addRoute} in a single call.\n *\n * @param {Array} entries Array of entries to precache.\n * @param {Object} [options] See\n * [addRoute() options]{@link module:workbox-precaching.addRoute}.\n *\n * @memberof module:workbox-precaching\n */\nfunction precacheAndRoute(entries, options) {\n precache(entries);\n addRoute(options);\n}\nexport { precacheAndRoute };\n"],"names":["self","_","e","_cacheNameDetails","googleAnalytics","precache","prefix","runtime","suffix","registration","scope","_createCacheName","cacheName","filter","value","length","join","eachCacheNameDetail","fn","key","Object","keys","cacheNames","updateDetails","details","getGoogleAnalyticsName","userCacheName","getPrecacheName","getPrefix","getRuntimeName","getSuffix","getFriendlyURL","url","urlObj","URL","String","location","href","replace","RegExp","origin","logger","__WB_DISABLE_DEV_LOGS","inGroup","methodToColorMap","debug","log","warn","error","groupCollapsed","groupEnd","print","method","args","test","navigator","userAgent","console","styles","logPrefix","api","loggerMethods","messages","paramName","validValueDescription","Error","JSON","stringify","moduleName","className","funcName","expectedType","expectedClass","isReturnValueProblem","name","expectedMethod","entry","firstEntry","secondEntry","_entryId","thrownError","message","cacheNameId","methodName","normalizedRangeHeader","size","start","end","status","generatorFunction","code","messageGenerator","WorkboxError","constructor","errorCode","isArray","Array","hasMethod","object","type","isType","isInstance","isOneOf","validValues","includes","isArrayOfClass","item","finalAssertExports","quotaErrorCallbacks","Set","executeQuotaErrorCallbacks","callback","pluginUtils","plugins","callbackName","plugin","_getEffectiveRequest","request","mode","cacheKeyWillBeUsedPlugins","effectiveRequest","call","Request","assert","_isResponseSafeToCache","response","event","responseToCache","pluginsUsed","pluginMethod","Response","undefined","matchWrapper","matchOptions","cache","caches","open","cachedResponse","match","putWrapper","updatePlugins","oldResponse","put","newResponse","cacheWrapper","wrappedFetch","fetchOptions","FetchEvent","preloadResponse","possiblePreloadResponse","failedFetchPlugins","originalRequest","clone","requestClone","err","pluginFilteredRequest","fetchResponse","fetch","fetchWrapper","supportStatus","canConstructResponseFromBodyStream","testResponse","body","copyResponse","modifier","clonedResponse","responseInit","headers","Headers","statusText","modifiedResponseInit","blob","REVISION_SEARCH_PARAM","createCacheKey","urlObject","cacheKey","revision","cacheKeyURL","originalURL","searchParams","set","logGroup","groupTitle","deletedURLs","printCleanupDetails","deletionCount","_nestedGroup","urls","printInstallDetails","urlsToPrecache","urlsAlreadyPrecached","precachedCount","alreadyPrecachedCount","PrecacheController","_cacheName","_urlsToCacheKeys","Map","_urlsToCacheModes","_cacheKeysToIntegrities","addToCacheList","entries","urlsToWarnAbout","push","cacheMode","has","get","integrity","warningMessage","install","toBePrecached","alreadyPrecached","alreadyCachedRequests","existingCacheKeys","map","precacheRequests","_addURLToCache","Promise","all","updatedURLs","notUpdatedURLs","activate","currentlyCachedRequests","expectedCacheKeys","values","delete","credentials","cacheWillUpdatePlugin","isValidResponse","cacheWillUpdate","redirected","ignoreSearch","getURLsToCacheKeys","getCachedURLs","getCacheKeyForURL","matchPrecache","createHandler","fallbackToNetwork","createHandlerBoundToURL","handler","precacheController","getOrCreatePrecacheController","removeIgnoredSearchParams","ignoreURLParametersMatching","some","regExp","generateURLVariations","directoryIndex","cleanURLs","urlManipulation","hash","urlWithoutIgnoredParams","pathname","endsWith","directoryURL","cleanURL","additionalURLs","urlToAttempt","options","urlsToCacheKeys","possibleURL","possibleCacheKey","addFetchListener","addEventListener","precachedURL","responsePromise","then","respondWith","listenerAdded","addRoute","precachePlugins","add","newPlugins","installListener","waitUntil","catch","activateListener","precacheAndRoute"],"mappings":";;IAEA,IAAI;IACAA,EAAAA,IAAI,CAAC,oBAAD,CAAJ,IAA8BC,CAAC,EAA/B;IACH,CAFD,CAGA,OAAOC,CAAP,EAAU;;ICLV;IACA;AACA;IACA;IACA;IACA;IACA;AACA,IACA,MAAMC,iBAAiB,GAAG;IACtBC,EAAAA,eAAe,EAAE,iBADK;IAEtBC,EAAAA,QAAQ,EAAE,aAFY;IAGtBC,EAAAA,MAAM,EAAE,SAHc;IAItBC,EAAAA,OAAO,EAAE,SAJa;IAKtBC,EAAAA,MAAM,EAAE,OAAOC,YAAP,KAAwB,WAAxB,GAAsCA,YAAY,CAACC,KAAnD,GAA2D;IAL7C,CAA1B;;IAOA,MAAMC,gBAAgB,GAAIC,SAAD,IAAe;IACpC,SAAO,CAACT,iBAAiB,CAACG,MAAnB,EAA2BM,SAA3B,EAAsCT,iBAAiB,CAACK,MAAxD,EACFK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AK,CAACmJ,SAAN,CAAgBlC,kBAAkB,CAAC/B,OAAnB,CAA2B;IAAElF,IAAAA,KAAF;IAASb,IAAAA;IAAT,GAA3B,EACXiK,KADW,CACJlO,KAAD,IAAW;IAClB;IACIP,MAAAA,MAAM,CAACO,KAAP,CAAc,8CAAD,GACR,sDADL;IAEH,KAJiB;;;IAMlB,UAAMA,KAAN;IACH,GARe,CAAhB;IASH,CAZD;;IAaA,MAAMmO,gBAAgB,GAAIrJ,KAAD,IAAW;IAChC,QAAMiH,kBAAkB,GAAGC,6BAA6B,EAAxD;IACAlH,EAAAA,KAAK,CAACmJ,SAAN,CAAgBlC,kBAAkB,CAACnB,QAAnB,EAAhB;IACH,CAHD;IAIA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;;IACA,SAASvN,QAAT,CAAkBmM,OAAlB,EAA2B;IACvB,QAAMuC,kBAAkB,GAAGC,6BAA6B,EAAxD;IACAD,EAAAA,kBAAkB,CAACxC,cAAnB,CAAkCC,OAAlC;;IACA,MAAIA,OAAO,CAACzL,MAAR,GAAiB,CAArB,EAAwB;IACpB;IACA;IACA;IACA;IACAf,IAAAA,IAAI,CAACsQ,gBAAL,CAAsB,SAAtB,EAAiCU,eAAjC;IACAhR,IAAAA,IAAI,CAACsQ,gBAAL,CAAsB,UAAtB,EAAkCa,gBAAlC;IACH;IACJ;;IC1DD;IACA;AACA;IACA;IACA;IACA;IACA;AACA,IAGA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA,SAASC,gBAAT,CAA0B5E,OAA1B,EAAmCyD,OAAnC,EAA4C;IACxC5P,EAAAA,QAAQ,CAACmM,OAAD,CAAR;IACAoE,EAAAA,QAAQ,CAACX,OAAD,CAAR;IACH;;;;"} \ No newline at end of file diff --git a/src/server/public/workbox-69b5a3b7.js b/src/server/public/workbox-69b5a3b7.js deleted file mode 100644 index 665a640..0000000 --- a/src/server/public/workbox-69b5a3b7.js +++ /dev/null @@ -1,2 +0,0 @@ -define("./workbox-69b5a3b7.js",["exports"],(function(e){"use strict";try{self["workbox:core:5.1.4"]&&_()}catch(e){}const t={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:"undefined"!=typeof registration?registration.scope:""},n=e=>[t.prefix,e,t.suffix].filter(e=>e&&e.length>0).join("-"),s=e=>e||n(t.precache),i=e=>new URL(String(e),location.href).href.replace(new RegExp("^"+location.origin),""),c=(e,...t)=>{let n=e;return t.length>0&&(n+=" :: "+JSON.stringify(t)),n};class o extends Error{constructor(e,t){super(c(e,t)),this.name=e,this.details=t}}const r=new Set;const a=(e,t)=>e.filter(e=>t in e),u=async({request:e,mode:t,plugins:n=[]})=>{const s=a(n,"cacheKeyWillBeUsed");let i=e;for(const e of s)i=await e.cacheKeyWillBeUsed.call(e,{mode:t,request:i}),"string"==typeof i&&(i=new Request(i));return i},l=async({cacheName:e,request:t,event:n,matchOptions:s,plugins:i=[]})=>{const c=await self.caches.open(e),o=await u({plugins:i,request:t,mode:"read"});let r=await c.match(o,s);for(const t of i)if("cachedResponseWillBeUsed"in t){const i=t.cachedResponseWillBeUsed;r=await i.call(t,{cacheName:e,event:n,matchOptions:s,cachedResponse:r,request:o})}return r},h=async({cacheName:e,request:t,response:n,event:s,plugins:c=[],matchOptions:h})=>{const f=await u({plugins:c,request:t,mode:"write"});if(!n)throw new o("cache-put-with-no-response",{url:i(f.url)});const w=await(async({request:e,response:t,event:n,plugins:s=[]})=>{let i=t,c=!1;for(const t of s)if("cacheWillUpdate"in t){c=!0;const s=t.cacheWillUpdate;if(i=await s.call(t,{request:e,response:i,event:n}),!i)break}return c||(i=i&&200===i.status?i:void 0),i||null})({event:s,plugins:c,response:n,request:f});if(!w)return;const d=await self.caches.open(e),p=a(c,"cacheDidUpdate"),y=p.length>0?await l({cacheName:e,matchOptions:h,request:f}):null;try{await d.put(f,w)}catch(e){throw"QuotaExceededError"===e.name&&await async function(){for(const e of r)await e()}(),e}for(const t of p)await t.cacheDidUpdate.call(t,{cacheName:e,event:s,oldResponse:y,newResponse:w,request:f})},f=async({request:e,fetchOptions:t,event:n,plugins:s=[]})=>{if("string"==typeof e&&(e=new Request(e)),n instanceof FetchEvent&&n.preloadResponse){const e=await n.preloadResponse;if(e)return e}const i=a(s,"fetchDidFail"),c=i.length>0?e.clone():null;try{for(const t of s)if("requestWillFetch"in t){const s=t.requestWillFetch,i=e.clone();e=await s.call(t,{request:i,event:n})}}catch(e){throw new o("plugin-error-request-will-fetch",{thrownError:e})}const r=e.clone();try{let i;i="navigate"===e.mode?await fetch(e):await fetch(e,t);for(const e of s)"fetchDidSucceed"in e&&(i=await e.fetchDidSucceed.call(e,{event:n,request:r,response:i}));return i}catch(e){for(const t of i)await t.fetchDidFail.call(t,{error:e,event:n,originalRequest:c.clone(),request:r.clone()});throw e}};let w;async function d(e,t){const n=e.clone(),s={headers:new Headers(n.headers),status:n.status,statusText:n.statusText},i=t?t(s):s,c=function(){if(void 0===w){const e=new Response("");if("body"in e)try{new Response(e.body),w=!0}catch(e){w=!1}w=!1}return w}()?n.body:await n.blob();return new Response(c,i)}try{self["workbox:precaching:5.1.4"]&&_()}catch(e){}function p(e){if(!e)throw new o("add-to-cache-list-unexpected-type",{entry:e});if("string"==typeof e){const t=new URL(e,location.href);return{cacheKey:t.href,url:t.href}}const{revision:t,url:n}=e;if(!n)throw new o("add-to-cache-list-unexpected-type",{entry:e});if(!t){const e=new URL(n,location.href);return{cacheKey:e.href,url:e.href}}const s=new URL(n,location.href),i=new URL(n,location.href);return s.searchParams.set("__WB_REVISION__",t),{cacheKey:s.href,url:i.href}}class y{constructor(e){this.t=s(e),this.s=new Map,this.i=new Map,this.o=new Map}addToCacheList(e){const t=[];for(const n of e){"string"==typeof n?t.push(n):n&&void 0===n.revision&&t.push(n.url);const{cacheKey:e,url:s}=p(n),i="string"!=typeof n&&n.revision?"reload":"default";if(this.s.has(s)&&this.s.get(s)!==e)throw new o("add-to-cache-list-conflicting-entries",{firstEntry:this.s.get(s),secondEntry:e});if("string"!=typeof n&&n.integrity){if(this.o.has(e)&&this.o.get(e)!==n.integrity)throw new o("add-to-cache-list-conflicting-integrities",{url:s});this.o.set(e,n.integrity)}if(this.s.set(s,e),this.i.set(s,i),t.length>0){const e=`Workbox is precaching URLs without revision info: ${t.join(", ")}\nThis is generally NOT safe. Learn more at https://bit.ly/wb-precache`;console.warn(e)}}}async install({event:e,plugins:t}={}){const n=[],s=[],i=await self.caches.open(this.t),c=await i.keys(),o=new Set(c.map(e=>e.url));for(const[e,t]of this.s)o.has(t)?s.push(e):n.push({cacheKey:t,url:e});const r=n.map(({cacheKey:n,url:s})=>{const i=this.o.get(n),c=this.i.get(s);return this.u({cacheKey:n,cacheMode:c,event:e,integrity:i,plugins:t,url:s})});await Promise.all(r);return{updatedURLs:n.map(e=>e.url),notUpdatedURLs:s}}async activate(){const e=await self.caches.open(this.t),t=await e.keys(),n=new Set(this.s.values()),s=[];for(const i of t)n.has(i.url)||(await e.delete(i),s.push(i.url));return{deletedURLs:s}}async u({cacheKey:e,url:t,cacheMode:n,event:s,plugins:i,integrity:c}){const r=new Request(t,{integrity:c,cache:n,credentials:"same-origin"});let a,u=await f({event:s,plugins:i,request:r});for(const e of i||[])"cacheWillUpdate"in e&&(a=e);if(!(a?await a.cacheWillUpdate({event:s,request:r,response:u}):u.status<400))throw new o("bad-precaching-response",{url:t,status:u.status});u.redirected&&(u=await d(u)),await h({event:s,plugins:i,response:u,request:e===t?r:new Request(e),cacheName:this.t,matchOptions:{ignoreSearch:!0}})}getURLsToCacheKeys(){return this.s}getCachedURLs(){return[...this.s.keys()]}getCacheKeyForURL(e){const t=new URL(e,location.href);return this.s.get(t.href)}async matchPrecache(e){const t=e instanceof Request?e.url:e,n=this.getCacheKeyForURL(t);if(n){return(await self.caches.open(this.t)).match(n)}}createHandler(e=!0){return async({request:t})=>{try{const e=await this.matchPrecache(t);if(e)return e;throw new o("missing-precache-entry",{cacheName:this.t,url:t instanceof Request?t.url:t})}catch(n){if(e)return fetch(t);throw n}}}createHandlerBoundToURL(e,t=!0){if(!this.getCacheKeyForURL(e))throw new o("non-precached-url",{url:e});const n=this.createHandler(t),s=new Request(e);return()=>n({request:s})}}let g;const R=()=>(g||(g=new y),g);const q=(e,t)=>{const n=R().getURLsToCacheKeys();for(const s of function*(e,{ignoreURLParametersMatching:t,directoryIndex:n,cleanURLs:s,urlManipulation:i}={}){const c=new URL(e,location.href);c.hash="",yield c.href;const o=function(e,t=[]){for(const n of[...e.searchParams.keys()])t.some(e=>e.test(n))&&e.searchParams.delete(n);return e}(c,t);if(yield o.href,n&&o.pathname.endsWith("/")){const e=new URL(o.href);e.pathname+=n,yield e.href}if(s){const e=new URL(o.href);e.pathname+=".html",yield e.href}if(i){const e=i({url:c});for(const t of e)yield t.href}}(e,t)){const e=n.get(s);if(e)return e}};let U=!1;function m(e){U||((({ignoreURLParametersMatching:e=[/^utm_/],directoryIndex:t="index.html",cleanURLs:n=!0,urlManipulation:i}={})=>{const c=s();self.addEventListener("fetch",s=>{const o=q(s.request.url,{cleanURLs:n,directoryIndex:t,ignoreURLParametersMatching:e,urlManipulation:i});if(!o)return;let r=self.caches.open(c).then(e=>e.match(o)).then(e=>e||fetch(o));s.respondWith(r)})})(e),U=!0)}const v=[],L={get:()=>v,add(e){v.push(...e)}},x=e=>{const t=R(),n=L.get();e.waitUntil(t.install({event:e,plugins:n}).catch(e=>{throw e}))},K=e=>{const t=R();e.waitUntil(t.activate())};e.precacheAndRoute=function(e,t){!function(e){R().addToCacheList(e),e.length>0&&(self.addEventListener("install",x),self.addEventListener("activate",K))}(e),m(t)}})); -//# sourceMappingURL=workbox-69b5a3b7.js.map diff --git a/src/server/public/workbox-69b5a3b7.js.map b/src/server/public/workbox-69b5a3b7.js.map deleted file mode 100644 index 24ece7c..0000000 --- a/src/server/public/workbox-69b5a3b7.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"workbox-69b5a3b7.js","sources":["node_modules/workbox-core/_version.js","node_modules/workbox-core/_private/cacheNames.js","node_modules/workbox-core/_private/getFriendlyURL.js","node_modules/workbox-core/models/messages/messageGenerator.js","node_modules/workbox-core/_private/WorkboxError.js","node_modules/workbox-core/_private/assert.js","node_modules/workbox-core/models/quotaErrorCallbacks.js","node_modules/workbox-core/utils/pluginUtils.js","node_modules/workbox-core/_private/cacheWrapper.js","node_modules/workbox-core/_private/executeQuotaErrorCallbacks.js","node_modules/workbox-core/_private/fetchWrapper.js","node_modules/workbox-core/_private/canConstructResponseFromBodyStream.js","node_modules/workbox-core/copyResponse.js","node_modules/workbox-precaching/_version.js","node_modules/workbox-precaching/utils/createCacheKey.js","node_modules/workbox-precaching/PrecacheController.js","node_modules/workbox-precaching/utils/getOrCreatePrecacheController.js","node_modules/workbox-precaching/utils/getCacheKeyForURL.js","node_modules/workbox-precaching/utils/generateURLVariations.js","node_modules/workbox-precaching/utils/removeIgnoredSearchParams.js","node_modules/workbox-precaching/addRoute.js","node_modules/workbox-precaching/utils/addFetchListener.js","node_modules/workbox-precaching/utils/precachePlugins.js","node_modules/workbox-precaching/precache.js","node_modules/workbox-precaching/precacheAndRoute.js"],"sourcesContent":["\"use strict\";\n// @ts-ignore\ntry {\n self['workbox:core:5.1.4'] && _();\n}\ncatch (e) { }\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nconst _cacheNameDetails = {\n googleAnalytics: 'googleAnalytics',\n precache: 'precache-v2',\n prefix: 'workbox',\n runtime: 'runtime',\n suffix: typeof registration !== 'undefined' ? registration.scope : '',\n};\nconst _createCacheName = (cacheName) => {\n return [_cacheNameDetails.prefix, cacheName, _cacheNameDetails.suffix]\n .filter((value) => value && value.length > 0)\n .join('-');\n};\nconst eachCacheNameDetail = (fn) => {\n for (const key of Object.keys(_cacheNameDetails)) {\n fn(key);\n }\n};\nexport const cacheNames = {\n updateDetails: (details) => {\n eachCacheNameDetail((key) => {\n if (typeof details[key] === 'string') {\n _cacheNameDetails[key] = details[key];\n }\n });\n },\n getGoogleAnalyticsName: (userCacheName) => {\n return userCacheName || _createCacheName(_cacheNameDetails.googleAnalytics);\n },\n getPrecacheName: (userCacheName) => {\n return userCacheName || _createCacheName(_cacheNameDetails.precache);\n },\n getPrefix: () => {\n return _cacheNameDetails.prefix;\n },\n getRuntimeName: (userCacheName) => {\n return userCacheName || _createCacheName(_cacheNameDetails.runtime);\n },\n getSuffix: () => {\n return _cacheNameDetails.suffix;\n },\n};\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nconst getFriendlyURL = (url) => {\n const urlObj = new URL(String(url), location.href);\n // See https://github.com/GoogleChrome/workbox/issues/2323\n // We want to include everything, except for the origin if it's same-origin.\n return urlObj.href.replace(new RegExp(`^${location.origin}`), '');\n};\nexport { getFriendlyURL };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { messages } from './messages.js';\nimport '../../_version.js';\nconst fallback = (code, ...args) => {\n let msg = code;\n if (args.length > 0) {\n msg += ` :: ${JSON.stringify(args)}`;\n }\n return msg;\n};\nconst generatorFunction = (code, details = {}) => {\n const message = messages[code];\n if (!message) {\n throw new Error(`Unable to find message for code '${code}'.`);\n }\n return message(details);\n};\nexport const messageGenerator = (process.env.NODE_ENV === 'production') ?\n fallback : generatorFunction;\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { messageGenerator } from '../models/messages/messageGenerator.js';\nimport '../_version.js';\n/**\n * Workbox errors should be thrown with this class.\n * This allows use to ensure the type easily in tests,\n * helps developers identify errors from workbox\n * easily and allows use to optimise error\n * messages correctly.\n *\n * @private\n */\nclass WorkboxError extends Error {\n /**\n *\n * @param {string} errorCode The error code that\n * identifies this particular error.\n * @param {Object=} details Any relevant arguments\n * that will help developers identify issues should\n * be added as a key on the context object.\n */\n constructor(errorCode, details) {\n const message = messageGenerator(errorCode, details);\n super(message);\n this.name = errorCode;\n this.details = details;\n }\n}\nexport { WorkboxError };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { WorkboxError } from '../_private/WorkboxError.js';\nimport '../_version.js';\n/*\n * This method throws if the supplied value is not an array.\n * The destructed values are required to produce a meaningful error for users.\n * The destructed and restructured object is so it's clear what is\n * needed.\n */\nconst isArray = (value, details) => {\n if (!Array.isArray(value)) {\n throw new WorkboxError('not-an-array', details);\n }\n};\nconst hasMethod = (object, expectedMethod, details) => {\n const type = typeof object[expectedMethod];\n if (type !== 'function') {\n details['expectedMethod'] = expectedMethod;\n throw new WorkboxError('missing-a-method', details);\n }\n};\nconst isType = (object, expectedType, details) => {\n if (typeof object !== expectedType) {\n details['expectedType'] = expectedType;\n throw new WorkboxError('incorrect-type', details);\n }\n};\nconst isInstance = (object, expectedClass, details) => {\n if (!(object instanceof expectedClass)) {\n details['expectedClass'] = expectedClass;\n throw new WorkboxError('incorrect-class', details);\n }\n};\nconst isOneOf = (value, validValues, details) => {\n if (!validValues.includes(value)) {\n details['validValueDescription'] =\n `Valid values are ${JSON.stringify(validValues)}.`;\n throw new WorkboxError('invalid-value', details);\n }\n};\nconst isArrayOfClass = (value, expectedClass, details) => {\n const error = new WorkboxError('not-array-of-class', details);\n if (!Array.isArray(value)) {\n throw error;\n }\n for (const item of value) {\n if (!(item instanceof expectedClass)) {\n throw error;\n }\n }\n};\nconst finalAssertExports = process.env.NODE_ENV === 'production' ? null : {\n hasMethod,\n isArray,\n isInstance,\n isOneOf,\n isType,\n isArrayOfClass,\n};\nexport { finalAssertExports as assert };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n// Callbacks to be executed whenever there's a quota error.\nconst quotaErrorCallbacks = new Set();\nexport { quotaErrorCallbacks };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nexport const pluginUtils = {\n filter: (plugins, callbackName) => {\n return plugins.filter((plugin) => callbackName in plugin);\n },\n};\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from './assert.js';\nimport { executeQuotaErrorCallbacks } from './executeQuotaErrorCallbacks.js';\nimport { getFriendlyURL } from './getFriendlyURL.js';\nimport { logger } from './logger.js';\nimport { pluginUtils } from '../utils/pluginUtils.js';\nimport { WorkboxError } from './WorkboxError.js';\nimport '../_version.js';\n/**\n * Checks the list of plugins for the cacheKeyWillBeUsed callback, and\n * executes any of those callbacks found in sequence. The final `Request` object\n * returned by the last plugin is treated as the cache key for cache reads\n * and/or writes.\n *\n * @param {Object} options\n * @param {Request} options.request\n * @param {string} options.mode\n * @param {Array} [options.plugins=[]]\n * @return {Promise}\n *\n * @private\n * @memberof module:workbox-core\n */\nconst _getEffectiveRequest = async ({ request, mode, plugins = [], }) => {\n const cacheKeyWillBeUsedPlugins = pluginUtils.filter(plugins, \"cacheKeyWillBeUsed\" /* CACHE_KEY_WILL_BE_USED */);\n let effectiveRequest = request;\n for (const plugin of cacheKeyWillBeUsedPlugins) {\n effectiveRequest = await plugin[\"cacheKeyWillBeUsed\" /* CACHE_KEY_WILL_BE_USED */].call(plugin, { mode, request: effectiveRequest });\n if (typeof effectiveRequest === 'string') {\n effectiveRequest = new Request(effectiveRequest);\n }\n if (process.env.NODE_ENV !== 'production') {\n assert.isInstance(effectiveRequest, Request, {\n moduleName: 'Plugin',\n funcName: \"cacheKeyWillBeUsed\" /* CACHE_KEY_WILL_BE_USED */,\n isReturnValueProblem: true,\n });\n }\n }\n return effectiveRequest;\n};\n/**\n * This method will call cacheWillUpdate on the available plugins (or use\n * status === 200) to determine if the Response is safe and valid to cache.\n *\n * @param {Object} options\n * @param {Request} options.request\n * @param {Response} options.response\n * @param {Event} [options.event]\n * @param {Array} [options.plugins=[]]\n * @return {Promise}\n *\n * @private\n * @memberof module:workbox-core\n */\nconst _isResponseSafeToCache = async ({ request, response, event, plugins = [], }) => {\n let responseToCache = response;\n let pluginsUsed = false;\n for (const plugin of plugins) {\n if (\"cacheWillUpdate\" /* CACHE_WILL_UPDATE */ in plugin) {\n pluginsUsed = true;\n const pluginMethod = plugin[\"cacheWillUpdate\" /* CACHE_WILL_UPDATE */];\n responseToCache = await pluginMethod.call(plugin, {\n request,\n response: responseToCache,\n event,\n });\n if (process.env.NODE_ENV !== 'production') {\n if (responseToCache) {\n assert.isInstance(responseToCache, Response, {\n moduleName: 'Plugin',\n funcName: \"cacheWillUpdate\" /* CACHE_WILL_UPDATE */,\n isReturnValueProblem: true,\n });\n }\n }\n if (!responseToCache) {\n break;\n }\n }\n }\n if (!pluginsUsed) {\n if (process.env.NODE_ENV !== 'production') {\n if (responseToCache) {\n if (responseToCache.status !== 200) {\n if (responseToCache.status === 0) {\n logger.warn(`The response for '${request.url}' is an opaque ` +\n `response. The caching strategy that you're using will not ` +\n `cache opaque responses by default.`);\n }\n else {\n logger.debug(`The response for '${request.url}' returned ` +\n `a status code of '${response.status}' and won't be cached as a ` +\n `result.`);\n }\n }\n }\n }\n responseToCache = responseToCache && responseToCache.status === 200 ?\n responseToCache : undefined;\n }\n return responseToCache ? responseToCache : null;\n};\n/**\n * This is a wrapper around cache.match().\n *\n * @param {Object} options\n * @param {string} options.cacheName Name of the cache to match against.\n * @param {Request} options.request The Request that will be used to look up\n * cache entries.\n * @param {Event} [options.event] The event that prompted the action.\n * @param {Object} [options.matchOptions] Options passed to cache.match().\n * @param {Array} [options.plugins=[]] Array of plugins.\n * @return {Response} A cached response if available.\n *\n * @private\n * @memberof module:workbox-core\n */\nconst matchWrapper = async ({ cacheName, request, event, matchOptions, plugins = [], }) => {\n const cache = await self.caches.open(cacheName);\n const effectiveRequest = await _getEffectiveRequest({\n plugins, request, mode: 'read'\n });\n let cachedResponse = await cache.match(effectiveRequest, matchOptions);\n if (process.env.NODE_ENV !== 'production') {\n if (cachedResponse) {\n logger.debug(`Found a cached response in '${cacheName}'.`);\n }\n else {\n logger.debug(`No cached response found in '${cacheName}'.`);\n }\n }\n for (const plugin of plugins) {\n if (\"cachedResponseWillBeUsed\" /* CACHED_RESPONSE_WILL_BE_USED */ in plugin) {\n const pluginMethod = plugin[\"cachedResponseWillBeUsed\" /* CACHED_RESPONSE_WILL_BE_USED */];\n cachedResponse = await pluginMethod.call(plugin, {\n cacheName,\n event,\n matchOptions,\n cachedResponse,\n request: effectiveRequest,\n });\n if (process.env.NODE_ENV !== 'production') {\n if (cachedResponse) {\n assert.isInstance(cachedResponse, Response, {\n moduleName: 'Plugin',\n funcName: \"cachedResponseWillBeUsed\" /* CACHED_RESPONSE_WILL_BE_USED */,\n isReturnValueProblem: true,\n });\n }\n }\n }\n }\n return cachedResponse;\n};\n/**\n * Wrapper around cache.put().\n *\n * Will call `cacheDidUpdate` on plugins if the cache was updated, using\n * `matchOptions` when determining what the old entry is.\n *\n * @param {Object} options\n * @param {string} options.cacheName\n * @param {Request} options.request\n * @param {Response} options.response\n * @param {Event} [options.event]\n * @param {Array} [options.plugins=[]]\n * @param {Object} [options.matchOptions]\n *\n * @private\n * @memberof module:workbox-core\n */\nconst putWrapper = async ({ cacheName, request, response, event, plugins = [], matchOptions, }) => {\n if (process.env.NODE_ENV !== 'production') {\n if (request.method && request.method !== 'GET') {\n throw new WorkboxError('attempt-to-cache-non-get-request', {\n url: getFriendlyURL(request.url),\n method: request.method,\n });\n }\n }\n const effectiveRequest = await _getEffectiveRequest({\n plugins, request, mode: 'write'\n });\n if (!response) {\n if (process.env.NODE_ENV !== 'production') {\n logger.error(`Cannot cache non-existent response for ` +\n `'${getFriendlyURL(effectiveRequest.url)}'.`);\n }\n throw new WorkboxError('cache-put-with-no-response', {\n url: getFriendlyURL(effectiveRequest.url),\n });\n }\n const responseToCache = await _isResponseSafeToCache({\n event,\n plugins,\n response,\n request: effectiveRequest,\n });\n if (!responseToCache) {\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Response '${getFriendlyURL(effectiveRequest.url)}' will ` +\n `not be cached.`, responseToCache);\n }\n return;\n }\n const cache = await self.caches.open(cacheName);\n const updatePlugins = pluginUtils.filter(plugins, \"cacheDidUpdate\" /* CACHE_DID_UPDATE */);\n const oldResponse = updatePlugins.length > 0 ?\n await matchWrapper({ cacheName, matchOptions, request: effectiveRequest }) :\n null;\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Updating the '${cacheName}' cache with a new Response for ` +\n `${getFriendlyURL(effectiveRequest.url)}.`);\n }\n try {\n await cache.put(effectiveRequest, responseToCache);\n }\n catch (error) {\n // See https://developer.mozilla.org/en-US/docs/Web/API/DOMException#exception-QuotaExceededError\n if (error.name === 'QuotaExceededError') {\n await executeQuotaErrorCallbacks();\n }\n throw error;\n }\n for (const plugin of updatePlugins) {\n await plugin[\"cacheDidUpdate\" /* CACHE_DID_UPDATE */].call(plugin, {\n cacheName,\n event,\n oldResponse,\n newResponse: responseToCache,\n request: effectiveRequest,\n });\n }\n};\nexport const cacheWrapper = {\n put: putWrapper,\n match: matchWrapper,\n};\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { logger } from '../_private/logger.js';\nimport { quotaErrorCallbacks } from '../models/quotaErrorCallbacks.js';\nimport '../_version.js';\n/**\n * Runs all of the callback functions, one at a time sequentially, in the order\n * in which they were registered.\n *\n * @memberof module:workbox-core\n * @private\n */\nasync function executeQuotaErrorCallbacks() {\n if (process.env.NODE_ENV !== 'production') {\n logger.log(`About to run ${quotaErrorCallbacks.size} ` +\n `callbacks to clean up caches.`);\n }\n for (const callback of quotaErrorCallbacks) {\n await callback();\n if (process.env.NODE_ENV !== 'production') {\n logger.log(callback, 'is complete.');\n }\n }\n if (process.env.NODE_ENV !== 'production') {\n logger.log('Finished running callbacks.');\n }\n}\nexport { executeQuotaErrorCallbacks };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { WorkboxError } from './WorkboxError.js';\nimport { logger } from './logger.js';\nimport { assert } from './assert.js';\nimport { getFriendlyURL } from '../_private/getFriendlyURL.js';\nimport { pluginUtils } from '../utils/pluginUtils.js';\nimport '../_version.js';\n/**\n * Wrapper around the fetch API.\n *\n * Will call requestWillFetch on available plugins.\n *\n * @param {Object} options\n * @param {Request|string} options.request\n * @param {Object} [options.fetchOptions]\n * @param {ExtendableEvent} [options.event]\n * @param {Array} [options.plugins=[]]\n * @return {Promise}\n *\n * @private\n * @memberof module:workbox-core\n */\nconst wrappedFetch = async ({ request, fetchOptions, event, plugins = [], }) => {\n if (typeof request === 'string') {\n request = new Request(request);\n }\n // We *should* be able to call `await event.preloadResponse` even if it's\n // undefined, but for some reason, doing so leads to errors in our Node unit\n // tests. To work around that, explicitly check preloadResponse's value first.\n if (event instanceof FetchEvent && event.preloadResponse) {\n const possiblePreloadResponse = await event.preloadResponse;\n if (possiblePreloadResponse) {\n if (process.env.NODE_ENV !== 'production') {\n logger.log(`Using a preloaded navigation response for ` +\n `'${getFriendlyURL(request.url)}'`);\n }\n return possiblePreloadResponse;\n }\n }\n if (process.env.NODE_ENV !== 'production') {\n assert.isInstance(request, Request, {\n paramName: 'request',\n expectedClass: Request,\n moduleName: 'workbox-core',\n className: 'fetchWrapper',\n funcName: 'wrappedFetch',\n });\n }\n const failedFetchPlugins = pluginUtils.filter(plugins, \"fetchDidFail\" /* FETCH_DID_FAIL */);\n // If there is a fetchDidFail plugin, we need to save a clone of the\n // original request before it's either modified by a requestWillFetch\n // plugin or before the original request's body is consumed via fetch().\n const originalRequest = failedFetchPlugins.length > 0 ?\n request.clone() : null;\n try {\n for (const plugin of plugins) {\n if (\"requestWillFetch\" /* REQUEST_WILL_FETCH */ in plugin) {\n const pluginMethod = plugin[\"requestWillFetch\" /* REQUEST_WILL_FETCH */];\n const requestClone = request.clone();\n request = await pluginMethod.call(plugin, {\n request: requestClone,\n event,\n });\n if (process.env.NODE_ENV !== 'production') {\n if (request) {\n assert.isInstance(request, Request, {\n moduleName: 'Plugin',\n funcName: \"cachedResponseWillBeUsed\" /* CACHED_RESPONSE_WILL_BE_USED */,\n isReturnValueProblem: true,\n });\n }\n }\n }\n }\n }\n catch (err) {\n throw new WorkboxError('plugin-error-request-will-fetch', {\n thrownError: err,\n });\n }\n // The request can be altered by plugins with `requestWillFetch` making\n // the original request (Most likely from a `fetch` event) to be different\n // to the Request we make. Pass both to `fetchDidFail` to aid debugging.\n const pluginFilteredRequest = request.clone();\n try {\n let fetchResponse;\n // See https://github.com/GoogleChrome/workbox/issues/1796\n if (request.mode === 'navigate') {\n fetchResponse = await fetch(request);\n }\n else {\n fetchResponse = await fetch(request, fetchOptions);\n }\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Network request for ` +\n `'${getFriendlyURL(request.url)}' returned a response with ` +\n `status '${fetchResponse.status}'.`);\n }\n for (const plugin of plugins) {\n if (\"fetchDidSucceed\" /* FETCH_DID_SUCCEED */ in plugin) {\n fetchResponse = await plugin[\"fetchDidSucceed\" /* FETCH_DID_SUCCEED */]\n .call(plugin, {\n event,\n request: pluginFilteredRequest,\n response: fetchResponse,\n });\n if (process.env.NODE_ENV !== 'production') {\n if (fetchResponse) {\n assert.isInstance(fetchResponse, Response, {\n moduleName: 'Plugin',\n funcName: \"fetchDidSucceed\" /* FETCH_DID_SUCCEED */,\n isReturnValueProblem: true,\n });\n }\n }\n }\n }\n return fetchResponse;\n }\n catch (error) {\n if (process.env.NODE_ENV !== 'production') {\n logger.error(`Network request for ` +\n `'${getFriendlyURL(request.url)}' threw an error.`, error);\n }\n for (const plugin of failedFetchPlugins) {\n await plugin[\"fetchDidFail\" /* FETCH_DID_FAIL */].call(plugin, {\n error,\n event,\n originalRequest: originalRequest.clone(),\n request: pluginFilteredRequest.clone(),\n });\n }\n throw error;\n }\n};\nconst fetchWrapper = {\n fetch: wrappedFetch,\n};\nexport { fetchWrapper };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nlet supportStatus;\n/**\n * A utility function that determines whether the current browser supports\n * constructing a new `Response` from a `response.body` stream.\n *\n * @return {boolean} `true`, if the current browser can successfully\n * construct a `Response` from a `response.body` stream, `false` otherwise.\n *\n * @private\n */\nfunction canConstructResponseFromBodyStream() {\n if (supportStatus === undefined) {\n const testResponse = new Response('');\n if ('body' in testResponse) {\n try {\n new Response(testResponse.body);\n supportStatus = true;\n }\n catch (error) {\n supportStatus = false;\n }\n }\n supportStatus = false;\n }\n return supportStatus;\n}\nexport { canConstructResponseFromBodyStream };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { canConstructResponseFromBodyStream } from './_private/canConstructResponseFromBodyStream.js';\nimport './_version.js';\n/**\n * Allows developers to copy a response and modify its `headers`, `status`,\n * or `statusText` values (the values settable via a\n * [`ResponseInit`]{@link https://developer.mozilla.org/en-US/docs/Web/API/Response/Response#Syntax}\n * object in the constructor).\n * To modify these values, pass a function as the second argument. That\n * function will be invoked with a single object with the response properties\n * `{headers, status, statusText}`. The return value of this function will\n * be used as the `ResponseInit` for the new `Response`. To change the values\n * either modify the passed parameter(s) and return it, or return a totally\n * new object.\n *\n * @param {Response} response\n * @param {Function} modifier\n * @memberof module:workbox-core\n */\nasync function copyResponse(response, modifier) {\n const clonedResponse = response.clone();\n // Create a fresh `ResponseInit` object by cloning the headers.\n const responseInit = {\n headers: new Headers(clonedResponse.headers),\n status: clonedResponse.status,\n statusText: clonedResponse.statusText,\n };\n // Apply any user modifications.\n const modifiedResponseInit = modifier ? modifier(responseInit) : responseInit;\n // Create the new response from the body stream and `ResponseInit`\n // modifications. Note: not all browsers support the Response.body stream,\n // so fall back to reading the entire body into memory as a blob.\n const body = canConstructResponseFromBodyStream() ?\n clonedResponse.body : await clonedResponse.blob();\n return new Response(body, modifiedResponseInit);\n}\nexport { copyResponse };\n","\"use strict\";\n// @ts-ignore\ntry {\n self['workbox:precaching:5.1.4'] && _();\n}\ncatch (e) { }\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport '../_version.js';\n// Name of the search parameter used to store revision info.\nconst REVISION_SEARCH_PARAM = '__WB_REVISION__';\n/**\n * Converts a manifest entry into a versioned URL suitable for precaching.\n *\n * @param {Object|string} entry\n * @return {string} A URL with versioning info.\n *\n * @private\n * @memberof module:workbox-precaching\n */\nexport function createCacheKey(entry) {\n if (!entry) {\n throw new WorkboxError('add-to-cache-list-unexpected-type', { entry });\n }\n // If a precache manifest entry is a string, it's assumed to be a versioned\n // URL, like '/app.abcd1234.js'. Return as-is.\n if (typeof entry === 'string') {\n const urlObject = new URL(entry, location.href);\n return {\n cacheKey: urlObject.href,\n url: urlObject.href,\n };\n }\n const { revision, url } = entry;\n if (!url) {\n throw new WorkboxError('add-to-cache-list-unexpected-type', { entry });\n }\n // If there's just a URL and no revision, then it's also assumed to be a\n // versioned URL.\n if (!revision) {\n const urlObject = new URL(url, location.href);\n return {\n cacheKey: urlObject.href,\n url: urlObject.href,\n };\n }\n // Otherwise, construct a properly versioned URL using the custom Workbox\n // search parameter along with the revision info.\n const cacheKeyURL = new URL(url, location.href);\n const originalURL = new URL(url, location.href);\n cacheKeyURL.searchParams.set(REVISION_SEARCH_PARAM, revision);\n return {\n cacheKey: cacheKeyURL.href,\n url: originalURL.href,\n };\n}\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { cacheNames } from 'workbox-core/_private/cacheNames.js';\nimport { cacheWrapper } from 'workbox-core/_private/cacheWrapper.js';\nimport { fetchWrapper } from 'workbox-core/_private/fetchWrapper.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { copyResponse } from 'workbox-core/copyResponse.js';\nimport { createCacheKey } from './utils/createCacheKey.js';\nimport { printCleanupDetails } from './utils/printCleanupDetails.js';\nimport { printInstallDetails } from './utils/printInstallDetails.js';\nimport './_version.js';\n/**\n * Performs efficient precaching of assets.\n *\n * @memberof module:workbox-precaching\n */\nclass PrecacheController {\n /**\n * Create a new PrecacheController.\n *\n * @param {string} [cacheName] An optional name for the cache, to override\n * the default precache name.\n */\n constructor(cacheName) {\n this._cacheName = cacheNames.getPrecacheName(cacheName);\n this._urlsToCacheKeys = new Map();\n this._urlsToCacheModes = new Map();\n this._cacheKeysToIntegrities = new Map();\n }\n /**\n * This method will add items to the precache list, removing duplicates\n * and ensuring the information is valid.\n *\n * @param {\n * Array\n * } entries Array of entries to precache.\n */\n addToCacheList(entries) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isArray(entries, {\n moduleName: 'workbox-precaching',\n className: 'PrecacheController',\n funcName: 'addToCacheList',\n paramName: 'entries',\n });\n }\n const urlsToWarnAbout = [];\n for (const entry of entries) {\n // See https://github.com/GoogleChrome/workbox/issues/2259\n if (typeof entry === 'string') {\n urlsToWarnAbout.push(entry);\n }\n else if (entry && entry.revision === undefined) {\n urlsToWarnAbout.push(entry.url);\n }\n const { cacheKey, url } = createCacheKey(entry);\n const cacheMode = (typeof entry !== 'string' && entry.revision) ?\n 'reload' : 'default';\n if (this._urlsToCacheKeys.has(url) &&\n this._urlsToCacheKeys.get(url) !== cacheKey) {\n throw new WorkboxError('add-to-cache-list-conflicting-entries', {\n firstEntry: this._urlsToCacheKeys.get(url),\n secondEntry: cacheKey,\n });\n }\n if (typeof entry !== 'string' && entry.integrity) {\n if (this._cacheKeysToIntegrities.has(cacheKey) &&\n this._cacheKeysToIntegrities.get(cacheKey) !== entry.integrity) {\n throw new WorkboxError('add-to-cache-list-conflicting-integrities', {\n url,\n });\n }\n this._cacheKeysToIntegrities.set(cacheKey, entry.integrity);\n }\n this._urlsToCacheKeys.set(url, cacheKey);\n this._urlsToCacheModes.set(url, cacheMode);\n if (urlsToWarnAbout.length > 0) {\n const warningMessage = `Workbox is precaching URLs without revision ` +\n `info: ${urlsToWarnAbout.join(', ')}\\nThis is generally NOT safe. ` +\n `Learn more at https://bit.ly/wb-precache`;\n if (process.env.NODE_ENV === 'production') {\n // Use console directly to display this warning without bloating\n // bundle sizes by pulling in all of the logger codebase in prod.\n console.warn(warningMessage);\n }\n else {\n logger.warn(warningMessage);\n }\n }\n }\n }\n /**\n * Precaches new and updated assets. Call this method from the service worker\n * install event.\n *\n * @param {Object} options\n * @param {Event} [options.event] The install event (if needed).\n * @param {Array} [options.plugins] Plugins to be used for fetching\n * and caching during install.\n * @return {Promise}\n */\n async install({ event, plugins } = {}) {\n if (process.env.NODE_ENV !== 'production') {\n if (plugins) {\n assert.isArray(plugins, {\n moduleName: 'workbox-precaching',\n className: 'PrecacheController',\n funcName: 'install',\n paramName: 'plugins',\n });\n }\n }\n const toBePrecached = [];\n const alreadyPrecached = [];\n const cache = await self.caches.open(this._cacheName);\n const alreadyCachedRequests = await cache.keys();\n const existingCacheKeys = new Set(alreadyCachedRequests.map((request) => request.url));\n for (const [url, cacheKey] of this._urlsToCacheKeys) {\n if (existingCacheKeys.has(cacheKey)) {\n alreadyPrecached.push(url);\n }\n else {\n toBePrecached.push({ cacheKey, url });\n }\n }\n const precacheRequests = toBePrecached.map(({ cacheKey, url }) => {\n const integrity = this._cacheKeysToIntegrities.get(cacheKey);\n const cacheMode = this._urlsToCacheModes.get(url);\n return this._addURLToCache({\n cacheKey,\n cacheMode,\n event,\n integrity,\n plugins,\n url,\n });\n });\n await Promise.all(precacheRequests);\n const updatedURLs = toBePrecached.map((item) => item.url);\n if (process.env.NODE_ENV !== 'production') {\n printInstallDetails(updatedURLs, alreadyPrecached);\n }\n return {\n updatedURLs,\n notUpdatedURLs: alreadyPrecached,\n };\n }\n /**\n * Deletes assets that are no longer present in the current precache manifest.\n * Call this method from the service worker activate event.\n *\n * @return {Promise}\n */\n async activate() {\n const cache = await self.caches.open(this._cacheName);\n const currentlyCachedRequests = await cache.keys();\n const expectedCacheKeys = new Set(this._urlsToCacheKeys.values());\n const deletedURLs = [];\n for (const request of currentlyCachedRequests) {\n if (!expectedCacheKeys.has(request.url)) {\n await cache.delete(request);\n deletedURLs.push(request.url);\n }\n }\n if (process.env.NODE_ENV !== 'production') {\n printCleanupDetails(deletedURLs);\n }\n return { deletedURLs };\n }\n /**\n * Requests the entry and saves it to the cache if the response is valid.\n * By default, any response with a status code of less than 400 (including\n * opaque responses) is considered valid.\n *\n * If you need to use custom criteria to determine what's valid and what\n * isn't, then pass in an item in `options.plugins` that implements the\n * `cacheWillUpdate()` lifecycle event.\n *\n * @private\n * @param {Object} options\n * @param {string} options.cacheKey The string to use a cache key.\n * @param {string} options.url The URL to fetch and cache.\n * @param {string} [options.cacheMode] The cache mode for the network request.\n * @param {Event} [options.event] The install event (if passed).\n * @param {Array} [options.plugins] An array of plugins to apply to\n * fetch and caching.\n * @param {string} [options.integrity] The value to use for the `integrity`\n * field when making the request.\n */\n async _addURLToCache({ cacheKey, url, cacheMode, event, plugins, integrity }) {\n const request = new Request(url, {\n integrity,\n cache: cacheMode,\n credentials: 'same-origin',\n });\n let response = await fetchWrapper.fetch({\n event,\n plugins,\n request,\n });\n // Allow developers to override the default logic about what is and isn't\n // valid by passing in a plugin implementing cacheWillUpdate(), e.g.\n // a `CacheableResponsePlugin` instance.\n let cacheWillUpdatePlugin;\n for (const plugin of (plugins || [])) {\n if ('cacheWillUpdate' in plugin) {\n cacheWillUpdatePlugin = plugin;\n }\n }\n const isValidResponse = cacheWillUpdatePlugin ?\n // Use a callback if provided. It returns a truthy value if valid.\n // NOTE: invoke the method on the plugin instance so the `this` context\n // is correct.\n await cacheWillUpdatePlugin.cacheWillUpdate({ event, request, response }) :\n // Otherwise, default to considering any response status under 400 valid.\n // This includes, by default, considering opaque responses valid.\n response.status < 400;\n // Consider this a failure, leading to the `install` handler failing, if\n // we get back an invalid response.\n if (!isValidResponse) {\n throw new WorkboxError('bad-precaching-response', {\n url,\n status: response.status,\n });\n }\n // Redirected responses cannot be used to satisfy a navigation request, so\n // any redirected response must be \"copied\" rather than cloned, so the new\n // response doesn't contain the `redirected` flag. See:\n // https://bugs.chromium.org/p/chromium/issues/detail?id=669363&desc=2#c1\n if (response.redirected) {\n response = await copyResponse(response);\n }\n await cacheWrapper.put({\n event,\n plugins,\n response,\n // `request` already uses `url`. We may be able to reuse it.\n request: cacheKey === url ? request : new Request(cacheKey),\n cacheName: this._cacheName,\n matchOptions: {\n ignoreSearch: true,\n },\n });\n }\n /**\n * Returns a mapping of a precached URL to the corresponding cache key, taking\n * into account the revision information for the URL.\n *\n * @return {Map} A URL to cache key mapping.\n */\n getURLsToCacheKeys() {\n return this._urlsToCacheKeys;\n }\n /**\n * Returns a list of all the URLs that have been precached by the current\n * service worker.\n *\n * @return {Array} The precached URLs.\n */\n getCachedURLs() {\n return [...this._urlsToCacheKeys.keys()];\n }\n /**\n * Returns the cache key used for storing a given URL. If that URL is\n * unversioned, like `/index.html', then the cache key will be the original\n * URL with a search parameter appended to it.\n *\n * @param {string} url A URL whose cache key you want to look up.\n * @return {string} The versioned URL that corresponds to a cache key\n * for the original URL, or undefined if that URL isn't precached.\n */\n getCacheKeyForURL(url) {\n const urlObject = new URL(url, location.href);\n return this._urlsToCacheKeys.get(urlObject.href);\n }\n /**\n * This acts as a drop-in replacement for [`cache.match()`](https://developer.mozilla.org/en-US/docs/Web/API/Cache/match)\n * with the following differences:\n *\n * - It knows what the name of the precache is, and only checks in that cache.\n * - It allows you to pass in an \"original\" URL without versioning parameters,\n * and it will automatically look up the correct cache key for the currently\n * active revision of that URL.\n *\n * E.g., `matchPrecache('index.html')` will find the correct precached\n * response for the currently active service worker, even if the actual cache\n * key is `'/index.html?__WB_REVISION__=1234abcd'`.\n *\n * @param {string|Request} request The key (without revisioning parameters)\n * to look up in the precache.\n * @return {Promise}\n */\n async matchPrecache(request) {\n const url = request instanceof Request ? request.url : request;\n const cacheKey = this.getCacheKeyForURL(url);\n if (cacheKey) {\n const cache = await self.caches.open(this._cacheName);\n return cache.match(cacheKey);\n }\n return undefined;\n }\n /**\n * Returns a function that can be used within a\n * {@link module:workbox-routing.Route} that will find a response for the\n * incoming request against the precache.\n *\n * If for an unexpected reason there is a cache miss for the request,\n * this will fall back to retrieving the `Response` via `fetch()` when\n * `fallbackToNetwork` is `true`.\n *\n * @param {boolean} [fallbackToNetwork=true] Whether to attempt to get the\n * response from the network if there's a precache miss.\n * @return {module:workbox-routing~handlerCallback}\n */\n createHandler(fallbackToNetwork = true) {\n return async ({ request }) => {\n try {\n const response = await this.matchPrecache(request);\n if (response) {\n return response;\n }\n // This shouldn't normally happen, but there are edge cases:\n // https://github.com/GoogleChrome/workbox/issues/1441\n throw new WorkboxError('missing-precache-entry', {\n cacheName: this._cacheName,\n url: request instanceof Request ? request.url : request,\n });\n }\n catch (error) {\n if (fallbackToNetwork) {\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Unable to respond with precached response. ` +\n `Falling back to network.`, error);\n }\n return fetch(request);\n }\n throw error;\n }\n };\n }\n /**\n * Returns a function that looks up `url` in the precache (taking into\n * account revision information), and returns the corresponding `Response`.\n *\n * If for an unexpected reason there is a cache miss when looking up `url`,\n * this will fall back to retrieving the `Response` via `fetch()` when\n * `fallbackToNetwork` is `true`.\n *\n * @param {string} url The precached URL which will be used to lookup the\n * `Response`.\n * @param {boolean} [fallbackToNetwork=true] Whether to attempt to get the\n * response from the network if there's a precache miss.\n * @return {module:workbox-routing~handlerCallback}\n */\n createHandlerBoundToURL(url, fallbackToNetwork = true) {\n const cacheKey = this.getCacheKeyForURL(url);\n if (!cacheKey) {\n throw new WorkboxError('non-precached-url', { url });\n }\n const handler = this.createHandler(fallbackToNetwork);\n const request = new Request(url);\n return () => handler({ request });\n }\n}\nexport { PrecacheController };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { PrecacheController } from '../PrecacheController.js';\nimport '../_version.js';\nlet precacheController;\n/**\n * @return {PrecacheController}\n * @private\n */\nexport const getOrCreatePrecacheController = () => {\n if (!precacheController) {\n precacheController = new PrecacheController();\n }\n return precacheController;\n};\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { getOrCreatePrecacheController } from './getOrCreatePrecacheController.js';\nimport { generateURLVariations } from './generateURLVariations.js';\nimport '../_version.js';\n/**\n * This function will take the request URL and manipulate it based on the\n * configuration options.\n *\n * @param {string} url\n * @param {Object} options\n * @return {string} Returns the URL in the cache that matches the request,\n * if possible.\n *\n * @private\n */\nexport const getCacheKeyForURL = (url, options) => {\n const precacheController = getOrCreatePrecacheController();\n const urlsToCacheKeys = precacheController.getURLsToCacheKeys();\n for (const possibleURL of generateURLVariations(url, options)) {\n const possibleCacheKey = urlsToCacheKeys.get(possibleURL);\n if (possibleCacheKey) {\n return possibleCacheKey;\n }\n }\n};\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { removeIgnoredSearchParams } from './removeIgnoredSearchParams.js';\nimport '../_version.js';\n/**\n * Generator function that yields possible variations on the original URL to\n * check, one at a time.\n *\n * @param {string} url\n * @param {Object} options\n *\n * @private\n * @memberof module:workbox-precaching\n */\nexport function* generateURLVariations(url, { ignoreURLParametersMatching, directoryIndex, cleanURLs, urlManipulation, } = {}) {\n const urlObject = new URL(url, location.href);\n urlObject.hash = '';\n yield urlObject.href;\n const urlWithoutIgnoredParams = removeIgnoredSearchParams(urlObject, ignoreURLParametersMatching);\n yield urlWithoutIgnoredParams.href;\n if (directoryIndex && urlWithoutIgnoredParams.pathname.endsWith('/')) {\n const directoryURL = new URL(urlWithoutIgnoredParams.href);\n directoryURL.pathname += directoryIndex;\n yield directoryURL.href;\n }\n if (cleanURLs) {\n const cleanURL = new URL(urlWithoutIgnoredParams.href);\n cleanURL.pathname += '.html';\n yield cleanURL.href;\n }\n if (urlManipulation) {\n const additionalURLs = urlManipulation({ url: urlObject });\n for (const urlToAttempt of additionalURLs) {\n yield urlToAttempt.href;\n }\n }\n}\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * Removes any URL search parameters that should be ignored.\n *\n * @param {URL} urlObject The original URL.\n * @param {Array} ignoreURLParametersMatching RegExps to test against\n * each search parameter name. Matches mean that the search parameter should be\n * ignored.\n * @return {URL} The URL with any ignored search parameters removed.\n *\n * @private\n * @memberof module:workbox-precaching\n */\nexport function removeIgnoredSearchParams(urlObject, ignoreURLParametersMatching = []) {\n // Convert the iterable into an array at the start of the loop to make sure\n // deletion doesn't mess up iteration.\n for (const paramName of [...urlObject.searchParams.keys()]) {\n if (ignoreURLParametersMatching.some((regExp) => regExp.test(paramName))) {\n urlObject.searchParams.delete(paramName);\n }\n }\n return urlObject;\n}\n","/*\n Copyright 2019 Google LLC\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { addFetchListener } from './utils/addFetchListener.js';\nimport './_version.js';\nlet listenerAdded = false;\n/**\n * Add a `fetch` listener to the service worker that will\n * respond to\n * [network requests]{@link https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers#Custom_responses_to_requests}\n * with precached assets.\n *\n * Requests for assets that aren't precached, the `FetchEvent` will not be\n * responded to, allowing the event to fall through to other `fetch` event\n * listeners.\n *\n * @param {Object} [options]\n * @param {string} [options.directoryIndex=index.html] The `directoryIndex` will\n * check cache entries for a URLs ending with '/' to see if there is a hit when\n * appending the `directoryIndex` value.\n * @param {Array} [options.ignoreURLParametersMatching=[/^utm_/]] An\n * array of regex's to remove search params when looking for a cache match.\n * @param {boolean} [options.cleanURLs=true] The `cleanURLs` option will\n * check the cache for the URL with a `.html` added to the end of the end.\n * @param {module:workbox-precaching~urlManipulation} [options.urlManipulation]\n * This is a function that should take a URL and return an array of\n * alternative URLs that should be checked for precache matches.\n *\n * @memberof module:workbox-precaching\n */\nfunction addRoute(options) {\n if (!listenerAdded) {\n addFetchListener(options);\n listenerAdded = true;\n }\n}\nexport { addRoute };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { cacheNames } from 'workbox-core/_private/cacheNames.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { getCacheKeyForURL } from './getCacheKeyForURL.js';\nimport '../_version.js';\n/**\n * Adds a `fetch` listener to the service worker that will\n * respond to\n * [network requests]{@link https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers#Custom_responses_to_requests}\n * with precached assets.\n *\n * Requests for assets that aren't precached, the `FetchEvent` will not be\n * responded to, allowing the event to fall through to other `fetch` event\n * listeners.\n *\n * NOTE: when called more than once this method will replace the previously set\n * configuration options. Calling it more than once is not recommended outside\n * of tests.\n *\n * @private\n * @param {Object} [options]\n * @param {string} [options.directoryIndex=index.html] The `directoryIndex` will\n * check cache entries for a URLs ending with '/' to see if there is a hit when\n * appending the `directoryIndex` value.\n * @param {Array} [options.ignoreURLParametersMatching=[/^utm_/]] An\n * array of regex's to remove search params when looking for a cache match.\n * @param {boolean} [options.cleanURLs=true] The `cleanURLs` option will\n * check the cache for the URL with a `.html` added to the end of the end.\n * @param {workbox.precaching~urlManipulation} [options.urlManipulation]\n * This is a function that should take a URL and return an array of\n * alternative URLs that should be checked for precache matches.\n */\nexport const addFetchListener = ({ ignoreURLParametersMatching = [/^utm_/], directoryIndex = 'index.html', cleanURLs = true, urlManipulation, } = {}) => {\n const cacheName = cacheNames.getPrecacheName();\n // See https://github.com/Microsoft/TypeScript/issues/28357#issuecomment-436484705\n self.addEventListener('fetch', ((event) => {\n const precachedURL = getCacheKeyForURL(event.request.url, {\n cleanURLs,\n directoryIndex,\n ignoreURLParametersMatching,\n urlManipulation,\n });\n if (!precachedURL) {\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Precaching did not find a match for ` +\n getFriendlyURL(event.request.url));\n }\n return;\n }\n let responsePromise = self.caches.open(cacheName).then((cache) => {\n return cache.match(precachedURL);\n }).then((cachedResponse) => {\n if (cachedResponse) {\n return cachedResponse;\n }\n // Fall back to the network if we don't have a cached response\n // (perhaps due to manual cache cleanup).\n if (process.env.NODE_ENV !== 'production') {\n logger.warn(`The precached response for ` +\n `${getFriendlyURL(precachedURL)} in ${cacheName} was not found. ` +\n `Falling back to the network instead.`);\n }\n return fetch(precachedURL);\n });\n if (process.env.NODE_ENV !== 'production') {\n responsePromise = responsePromise.then((response) => {\n // Workbox is going to handle the route.\n // print the routing details to the console.\n logger.groupCollapsed(`Precaching is responding to: ` +\n getFriendlyURL(event.request.url));\n logger.log(`Serving the precached url: ${precachedURL}`);\n logger.groupCollapsed(`View request details here.`);\n logger.log(event.request);\n logger.groupEnd();\n logger.groupCollapsed(`View response details here.`);\n logger.log(response);\n logger.groupEnd();\n logger.groupEnd();\n return response;\n });\n }\n event.respondWith(responsePromise);\n }));\n};\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nconst plugins = [];\nexport const precachePlugins = {\n /*\n * @return {Array}\n * @private\n */\n get() {\n return plugins;\n },\n /*\n * @param {Array} newPlugins\n * @private\n */\n add(newPlugins) {\n plugins.push(...newPlugins);\n },\n};\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { getOrCreatePrecacheController } from './utils/getOrCreatePrecacheController.js';\nimport { precachePlugins } from './utils/precachePlugins.js';\nimport './_version.js';\nconst installListener = (event) => {\n const precacheController = getOrCreatePrecacheController();\n const plugins = precachePlugins.get();\n event.waitUntil(precacheController.install({ event, plugins })\n .catch((error) => {\n if (process.env.NODE_ENV !== 'production') {\n logger.error(`Service worker installation failed. It will ` +\n `be retried automatically during the next navigation.`);\n }\n // Re-throw the error to ensure installation fails.\n throw error;\n }));\n};\nconst activateListener = (event) => {\n const precacheController = getOrCreatePrecacheController();\n event.waitUntil(precacheController.activate());\n};\n/**\n * Adds items to the precache list, removing any duplicates and\n * stores the files in the\n * [\"precache cache\"]{@link module:workbox-core.cacheNames} when the service\n * worker installs.\n *\n * This method can be called multiple times.\n *\n * Please note: This method **will not** serve any of the cached files for you.\n * It only precaches files. To respond to a network request you call\n * [addRoute()]{@link module:workbox-precaching.addRoute}.\n *\n * If you have a single array of files to precache, you can just call\n * [precacheAndRoute()]{@link module:workbox-precaching.precacheAndRoute}.\n *\n * @param {Array} [entries=[]] Array of entries to precache.\n *\n * @memberof module:workbox-precaching\n */\nfunction precache(entries) {\n const precacheController = getOrCreatePrecacheController();\n precacheController.addToCacheList(entries);\n if (entries.length > 0) {\n // NOTE: these listeners will only be added once (even if the `precache()`\n // method is called multiple times) because event listeners are implemented\n // as a set, where each listener must be unique.\n // See https://github.com/Microsoft/TypeScript/issues/28357#issuecomment-436484705\n self.addEventListener('install', installListener);\n self.addEventListener('activate', activateListener);\n }\n}\nexport { precache };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { addRoute } from './addRoute.js';\nimport { precache } from './precache.js';\nimport './_version.js';\n/**\n * This method will add entries to the precache list and add a route to\n * respond to fetch events.\n *\n * This is a convenience method that will call\n * [precache()]{@link module:workbox-precaching.precache} and\n * [addRoute()]{@link module:workbox-precaching.addRoute} in a single call.\n *\n * @param {Array} entries Array of entries to precache.\n * @param {Object} [options] See\n * [addRoute() options]{@link module:workbox-precaching.addRoute}.\n *\n * @memberof module:workbox-precaching\n */\nfunction precacheAndRoute(entries, options) {\n precache(entries);\n addRoute(options);\n}\nexport { precacheAndRoute };\n"],"names":["self","_","e","_cacheNameDetails","googleAnalytics","precache","prefix","runtime","suffix","registration","scope","_createCacheName","cacheName","filter","value","length","join","cacheNames","userCacheName","getFriendlyURL","url","URL","String","location","href","replace","RegExp","origin","messageGenerator","code","args","msg","JSON","stringify","WorkboxError","Error","constructor","errorCode","details","name","quotaErrorCallbacks","Set","pluginUtils","plugins","callbackName","plugin","_getEffectiveRequest","async","request","mode","cacheKeyWillBeUsedPlugins","effectiveRequest","call","Request","matchWrapper","event","matchOptions","cache","caches","open","cachedResponse","match","pluginMethod","cacheWrapper","response","responseToCache","pluginsUsed","status","undefined","_isResponseSafeToCache","updatePlugins","oldResponse","put","error","callback","executeQuotaErrorCallbacks","newResponse","fetchWrapper","fetchOptions","FetchEvent","preloadResponse","possiblePreloadResponse","failedFetchPlugins","originalRequest","clone","requestClone","err","thrownError","pluginFilteredRequest","fetchResponse","fetch","supportStatus","copyResponse","modifier","clonedResponse","responseInit","headers","Headers","statusText","modifiedResponseInit","body","testResponse","Response","canConstructResponseFromBodyStream","blob","createCacheKey","entry","urlObject","cacheKey","revision","cacheKeyURL","originalURL","searchParams","set","PrecacheController","_cacheName","_urlsToCacheKeys","Map","_urlsToCacheModes","_cacheKeysToIntegrities","addToCacheList","entries","urlsToWarnAbout","push","cacheMode","this","has","get","firstEntry","secondEntry","integrity","warningMessage","console","warn","toBePrecached","alreadyPrecached","alreadyCachedRequests","keys","existingCacheKeys","map","precacheRequests","_addURLToCache","Promise","all","updatedURLs","item","notUpdatedURLs","currentlyCachedRequests","expectedCacheKeys","values","deletedURLs","delete","credentials","cacheWillUpdatePlugin","cacheWillUpdate","redirected","ignoreSearch","getURLsToCacheKeys","getCachedURLs","getCacheKeyForURL","createHandler","fallbackToNetwork","matchPrecache","createHandlerBoundToURL","handler","precacheController","getOrCreatePrecacheController","options","urlsToCacheKeys","possibleURL","ignoreURLParametersMatching","directoryIndex","cleanURLs","urlManipulation","hash","urlWithoutIgnoredParams","paramName","some","regExp","test","removeIgnoredSearchParams","pathname","endsWith","directoryURL","cleanURL","additionalURLs","urlToAttempt","generateURLVariations","possibleCacheKey","listenerAdded","addRoute","addEventListener","precachedURL","responsePromise","then","respondWith","addFetchListener","precachePlugins","add","newPlugins","installListener","waitUntil","install","catch","activateListener","activate"],"mappings":"qEAEA,IACIA,KAAK,uBAAyBC,IAElC,MAAOC,ICGP,MAAMC,EAAoB,CACtBC,gBAAiB,kBACjBC,SAAU,cACVC,OAAQ,UACRC,QAAS,UACTC,OAAgC,oBAAjBC,aAA+BA,aAAaC,MAAQ,IAEjEC,EAAoBC,GACf,CAACT,EAAkBG,OAAQM,EAAWT,EAAkBK,QAC1DK,OAAQC,GAAUA,GAASA,EAAMC,OAAS,GAC1CC,KAAK,KAODC,EAWSC,GACPA,GAAiBP,EAAiBR,EAAkBE,UC7B7Dc,EAAkBC,GACL,IAAIC,IAAIC,OAAOF,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