@nypl/web-reader 3.2.3 → 3.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -174,77 +174,12 @@ var cacheNames = {
174
174
  }
175
175
  };
176
176
 
177
- // node_modules/workbox-core/_private/cacheMatchIgnoreParams.js
178
- function stripParams(fullURL, ignoreParams) {
179
- const strippedURL = new URL(fullURL);
180
- for (const param of ignoreParams) {
181
- strippedURL.searchParams.delete(param);
182
- }
183
- return strippedURL.href;
184
- }
185
- function cacheMatchIgnoreParams(cache, request, ignoreParams, matchOptions) {
186
- return __async(this, null, function* () {
187
- const strippedRequestURL = stripParams(request.url, ignoreParams);
188
- if (request.url === strippedRequestURL) {
189
- return cache.match(request, matchOptions);
190
- }
191
- const keysOptions = Object.assign(Object.assign({}, matchOptions), { ignoreSearch: true });
192
- const cacheKeys = yield cache.keys(request, keysOptions);
193
- for (const cacheKey of cacheKeys) {
194
- const strippedCacheKeyURL = stripParams(cacheKey.url, ignoreParams);
195
- if (strippedRequestURL === strippedCacheKeyURL) {
196
- return cache.match(cacheKey, matchOptions);
197
- }
198
- }
199
- return;
200
- });
201
- }
202
-
203
177
  // node_modules/workbox-core/_private/dontWaitFor.js
204
178
  function dontWaitFor(promise) {
205
179
  void promise.then(() => {
206
180
  });
207
181
  }
208
182
 
209
- // node_modules/workbox-core/_private/Deferred.js
210
- var Deferred = class {
211
- constructor() {
212
- this.promise = new Promise((resolve, reject) => {
213
- this.resolve = resolve;
214
- this.reject = reject;
215
- });
216
- }
217
- };
218
-
219
- // node_modules/workbox-core/_private/executeQuotaErrorCallbacks.js
220
- function executeQuotaErrorCallbacks() {
221
- return __async(this, null, function* () {
222
- if (false) {
223
- logger.log(`About to run ${quotaErrorCallbacks.size} callbacks to clean up caches.`);
224
- }
225
- for (const callback of quotaErrorCallbacks) {
226
- yield callback();
227
- if (false) {
228
- logger.log(callback, "is complete.");
229
- }
230
- }
231
- if (false) {
232
- logger.log("Finished running callbacks.");
233
- }
234
- });
235
- }
236
-
237
- // node_modules/workbox-core/_private/getFriendlyURL.js
238
- var getFriendlyURL = (url) => {
239
- const urlObj = new URL(String(url), location.href);
240
- return urlObj.href.replace(new RegExp(`^${location.origin}`), "");
241
- };
242
-
243
- // node_modules/workbox-core/_private/timeout.js
244
- function timeout(ms) {
245
- return new Promise((resolve) => setTimeout(resolve, ms));
246
- }
247
-
248
183
  // node_modules/workbox-core/clientsClaim.js
249
184
  function clientsClaim() {
250
185
  self.addEventListener("activate", () => self.clients.claim());
@@ -494,9 +429,7 @@ var CacheTimestampsModel = class {
494
429
  id: this._getId(url)
495
430
  };
496
431
  const db = yield this.getDb();
497
- const tx = db.transaction(CACHE_OBJECT_STORE, "readwrite", { durability: "relaxed" });
498
- yield tx.store.put(entry);
499
- yield tx.done;
432
+ yield db.put(CACHE_OBJECT_STORE, entry);
500
433
  });
501
434
  }
502
435
  getTimestamp(url) {
@@ -776,9 +709,195 @@ var ExpirationPlugin = class {
776
709
  }
777
710
  };
778
711
 
712
+ // node_modules/workbox-strategies/node_modules/workbox-core/_version.js
713
+ try {
714
+ self["workbox:core:6.5.3"] && _();
715
+ } catch (e) {
716
+ }
717
+
718
+ // node_modules/workbox-strategies/node_modules/workbox-core/models/messages/messageGenerator.js
719
+ var fallback2 = (code, ...args) => {
720
+ let msg = code;
721
+ if (args.length > 0) {
722
+ msg += ` :: ${JSON.stringify(args)}`;
723
+ }
724
+ return msg;
725
+ };
726
+ var messageGenerator2 = true ? fallback2 : generatorFunction;
727
+
728
+ // node_modules/workbox-strategies/node_modules/workbox-core/_private/WorkboxError.js
729
+ var WorkboxError2 = class extends Error {
730
+ constructor(errorCode, details) {
731
+ const message = messageGenerator2(errorCode, details);
732
+ super(message);
733
+ this.name = errorCode;
734
+ this.details = details;
735
+ }
736
+ };
737
+
738
+ // node_modules/workbox-strategies/node_modules/workbox-core/_private/logger.js
739
+ var logger2 = true ? null : (() => {
740
+ if (!("__WB_DISABLE_DEV_LOGS" in self)) {
741
+ self.__WB_DISABLE_DEV_LOGS = false;
742
+ }
743
+ let inGroup = false;
744
+ const methodToColorMap = {
745
+ debug: `#7f8c8d`,
746
+ log: `#2ecc71`,
747
+ warn: `#f39c12`,
748
+ error: `#c0392b`,
749
+ groupCollapsed: `#3498db`,
750
+ groupEnd: null
751
+ };
752
+ const print = function(method, args) {
753
+ if (self.__WB_DISABLE_DEV_LOGS) {
754
+ return;
755
+ }
756
+ if (method === "groupCollapsed") {
757
+ if (/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) {
758
+ console[method](...args);
759
+ return;
760
+ }
761
+ }
762
+ const styles = [
763
+ `background: ${methodToColorMap[method]}`,
764
+ `border-radius: 0.5em`,
765
+ `color: white`,
766
+ `font-weight: bold`,
767
+ `padding: 2px 0.5em`
768
+ ];
769
+ const logPrefix = inGroup ? [] : ["%cworkbox", styles.join(";")];
770
+ console[method](...logPrefix, ...args);
771
+ if (method === "groupCollapsed") {
772
+ inGroup = true;
773
+ }
774
+ if (method === "groupEnd") {
775
+ inGroup = false;
776
+ }
777
+ };
778
+ const api = {};
779
+ const loggerMethods = Object.keys(methodToColorMap);
780
+ for (const key of loggerMethods) {
781
+ const method = key;
782
+ api[method] = (...args) => {
783
+ print(method, args);
784
+ };
785
+ }
786
+ return api;
787
+ })();
788
+
789
+ // node_modules/workbox-strategies/node_modules/workbox-core/_private/cacheNames.js
790
+ var _cacheNameDetails2 = {
791
+ googleAnalytics: "googleAnalytics",
792
+ precache: "precache-v2",
793
+ prefix: "workbox",
794
+ runtime: "runtime",
795
+ suffix: typeof registration !== "undefined" ? registration.scope : ""
796
+ };
797
+ var _createCacheName2 = (cacheName) => {
798
+ return [_cacheNameDetails2.prefix, cacheName, _cacheNameDetails2.suffix].filter((value) => value && value.length > 0).join("-");
799
+ };
800
+ var eachCacheNameDetail2 = (fn) => {
801
+ for (const key of Object.keys(_cacheNameDetails2)) {
802
+ fn(key);
803
+ }
804
+ };
805
+ var cacheNames3 = {
806
+ updateDetails: (details) => {
807
+ eachCacheNameDetail2((key) => {
808
+ if (typeof details[key] === "string") {
809
+ _cacheNameDetails2[key] = details[key];
810
+ }
811
+ });
812
+ },
813
+ getGoogleAnalyticsName: (userCacheName) => {
814
+ return userCacheName || _createCacheName2(_cacheNameDetails2.googleAnalytics);
815
+ },
816
+ getPrecacheName: (userCacheName) => {
817
+ return userCacheName || _createCacheName2(_cacheNameDetails2.precache);
818
+ },
819
+ getPrefix: () => {
820
+ return _cacheNameDetails2.prefix;
821
+ },
822
+ getRuntimeName: (userCacheName) => {
823
+ return userCacheName || _createCacheName2(_cacheNameDetails2.runtime);
824
+ },
825
+ getSuffix: () => {
826
+ return _cacheNameDetails2.suffix;
827
+ }
828
+ };
829
+
830
+ // node_modules/workbox-strategies/node_modules/workbox-core/_private/getFriendlyURL.js
831
+ var getFriendlyURL2 = (url) => {
832
+ const urlObj = new URL(String(url), location.href);
833
+ return urlObj.href.replace(new RegExp(`^${location.origin}`), "");
834
+ };
835
+
836
+ // node_modules/workbox-strategies/node_modules/workbox-core/_private/cacheMatchIgnoreParams.js
837
+ function stripParams(fullURL, ignoreParams) {
838
+ const strippedURL = new URL(fullURL);
839
+ for (const param of ignoreParams) {
840
+ strippedURL.searchParams.delete(param);
841
+ }
842
+ return strippedURL.href;
843
+ }
844
+ function cacheMatchIgnoreParams2(cache, request, ignoreParams, matchOptions) {
845
+ return __async(this, null, function* () {
846
+ const strippedRequestURL = stripParams(request.url, ignoreParams);
847
+ if (request.url === strippedRequestURL) {
848
+ return cache.match(request, matchOptions);
849
+ }
850
+ const keysOptions = Object.assign(Object.assign({}, matchOptions), { ignoreSearch: true });
851
+ const cacheKeys = yield cache.keys(request, keysOptions);
852
+ for (const cacheKey of cacheKeys) {
853
+ const strippedCacheKeyURL = stripParams(cacheKey.url, ignoreParams);
854
+ if (strippedRequestURL === strippedCacheKeyURL) {
855
+ return cache.match(cacheKey, matchOptions);
856
+ }
857
+ }
858
+ return;
859
+ });
860
+ }
861
+
862
+ // node_modules/workbox-strategies/node_modules/workbox-core/_private/Deferred.js
863
+ var Deferred2 = class {
864
+ constructor() {
865
+ this.promise = new Promise((resolve, reject) => {
866
+ this.resolve = resolve;
867
+ this.reject = reject;
868
+ });
869
+ }
870
+ };
871
+
872
+ // node_modules/workbox-strategies/node_modules/workbox-core/models/quotaErrorCallbacks.js
873
+ var quotaErrorCallbacks2 = /* @__PURE__ */ new Set();
874
+
875
+ // node_modules/workbox-strategies/node_modules/workbox-core/_private/executeQuotaErrorCallbacks.js
876
+ function executeQuotaErrorCallbacks2() {
877
+ return __async(this, null, function* () {
878
+ if (false) {
879
+ logger2.log(`About to run ${quotaErrorCallbacks2.size} callbacks to clean up caches.`);
880
+ }
881
+ for (const callback of quotaErrorCallbacks2) {
882
+ yield callback();
883
+ if (false) {
884
+ logger2.log(callback, "is complete.");
885
+ }
886
+ }
887
+ if (false) {
888
+ logger2.log("Finished running callbacks.");
889
+ }
890
+ });
891
+ }
892
+
893
+ // node_modules/workbox-strategies/node_modules/workbox-core/_private/timeout.js
894
+ function timeout2(ms) {
895
+ return new Promise((resolve) => setTimeout(resolve, ms));
896
+ }
897
+
779
898
  // node_modules/workbox-strategies/_version.js
780
899
  try {
781
- self["workbox:strategies:6.2.4"] && _();
900
+ self["workbox:strategies:6.5.3"] && _();
782
901
  } catch (e) {
783
902
  }
784
903
 
@@ -790,7 +909,7 @@ var StrategyHandler = class {
790
909
  constructor(strategy, options) {
791
910
  this._cacheKeys = {};
792
911
  if (false) {
793
- finalAssertExports.isInstance(options.event, ExtendableEvent, {
912
+ finalAssertExports2.isInstance(options.event, ExtendableEvent, {
794
913
  moduleName: "workbox-strategies",
795
914
  className: "StrategyHandler",
796
915
  funcName: "constructor",
@@ -800,7 +919,7 @@ var StrategyHandler = class {
800
919
  Object.assign(this, options);
801
920
  this.event = options.event;
802
921
  this._strategy = strategy;
803
- this._handlerDeferred = new Deferred();
922
+ this._handlerDeferred = new Deferred2();
804
923
  this._extendLifetimePromises = [];
805
924
  this._plugins = [...strategy.plugins];
806
925
  this._pluginStateMap = /* @__PURE__ */ new Map();
@@ -817,7 +936,7 @@ var StrategyHandler = class {
817
936
  const possiblePreloadResponse = yield event.preloadResponse;
818
937
  if (possiblePreloadResponse) {
819
938
  if (false) {
820
- logger.log(`Using a preloaded navigation response for '${getFriendlyURL(request.url)}'`);
939
+ logger2.log(`Using a preloaded navigation response for '${getFriendlyURL2(request.url)}'`);
821
940
  }
822
941
  return possiblePreloadResponse;
823
942
  }
@@ -829,7 +948,9 @@ var StrategyHandler = class {
829
948
  }
830
949
  } catch (err) {
831
950
  if (err instanceof Error) {
832
- throw new WorkboxError("plugin-error-request-will-fetch", { thrownErrorMessage: err.message });
951
+ throw new WorkboxError2("plugin-error-request-will-fetch", {
952
+ thrownErrorMessage: err.message
953
+ });
833
954
  }
834
955
  }
835
956
  const pluginFilteredRequest = request.clone();
@@ -837,7 +958,7 @@ var StrategyHandler = class {
837
958
  let fetchResponse;
838
959
  fetchResponse = yield fetch(request, request.mode === "navigate" ? void 0 : this._strategy.fetchOptions);
839
960
  if (false) {
840
- logger.debug(`Network request for '${getFriendlyURL(request.url)}' returned a response with status '${fetchResponse.status}'.`);
961
+ logger2.debug(`Network request for '${getFriendlyURL2(request.url)}' returned a response with status '${fetchResponse.status}'.`);
841
962
  }
842
963
  for (const callback of this.iterateCallbacks("fetchDidSucceed")) {
843
964
  fetchResponse = yield callback({
@@ -849,7 +970,7 @@ var StrategyHandler = class {
849
970
  return fetchResponse;
850
971
  } catch (error) {
851
972
  if (false) {
852
- logger.log(`Network request for '${getFriendlyURL(request.url)}' threw an error.`, error);
973
+ logger2.log(`Network request for '${getFriendlyURL2(request.url)}' threw an error.`, error);
853
974
  }
854
975
  if (originalRequest) {
855
976
  yield this.runCallbacks("fetchDidFail", {
@@ -881,9 +1002,9 @@ var StrategyHandler = class {
881
1002
  cachedResponse = yield caches.match(effectiveRequest, multiMatchOptions);
882
1003
  if (false) {
883
1004
  if (cachedResponse) {
884
- logger.debug(`Found a cached response in '${cacheName}'.`);
1005
+ logger2.debug(`Found a cached response in '${cacheName}'.`);
885
1006
  } else {
886
- logger.debug(`No cached response found in '${cacheName}'.`);
1007
+ logger2.debug(`No cached response found in '${cacheName}'.`);
887
1008
  }
888
1009
  }
889
1010
  for (const callback of this.iterateCallbacks("cachedResponseWillBeUsed")) {
@@ -901,48 +1022,48 @@ var StrategyHandler = class {
901
1022
  cachePut(key, response) {
902
1023
  return __async(this, null, function* () {
903
1024
  const request = toRequest(key);
904
- yield timeout(0);
1025
+ yield timeout2(0);
905
1026
  const effectiveRequest = yield this.getCacheKey(request, "write");
906
1027
  if (false) {
907
1028
  if (effectiveRequest.method && effectiveRequest.method !== "GET") {
908
- throw new WorkboxError("attempt-to-cache-non-get-request", {
909
- url: getFriendlyURL(effectiveRequest.url),
1029
+ throw new WorkboxError2("attempt-to-cache-non-get-request", {
1030
+ url: getFriendlyURL2(effectiveRequest.url),
910
1031
  method: effectiveRequest.method
911
1032
  });
912
1033
  }
913
1034
  const vary = response.headers.get("Vary");
914
1035
  if (vary) {
915
- logger.debug(`The response for ${getFriendlyURL(effectiveRequest.url)} has a 'Vary: ${vary}' header. Consider setting the {ignoreVary: true} option on your strategy to ensure cache matching and deletion works as expected.`);
1036
+ logger2.debug(`The response for ${getFriendlyURL2(effectiveRequest.url)} has a 'Vary: ${vary}' header. Consider setting the {ignoreVary: true} option on your strategy to ensure cache matching and deletion works as expected.`);
916
1037
  }
917
1038
  }
918
1039
  if (!response) {
919
1040
  if (false) {
920
- logger.error(`Cannot cache non-existent response for '${getFriendlyURL(effectiveRequest.url)}'.`);
1041
+ logger2.error(`Cannot cache non-existent response for '${getFriendlyURL2(effectiveRequest.url)}'.`);
921
1042
  }
922
- throw new WorkboxError("cache-put-with-no-response", {
923
- url: getFriendlyURL(effectiveRequest.url)
1043
+ throw new WorkboxError2("cache-put-with-no-response", {
1044
+ url: getFriendlyURL2(effectiveRequest.url)
924
1045
  });
925
1046
  }
926
1047
  const responseToCache = yield this._ensureResponseSafeToCache(response);
927
1048
  if (!responseToCache) {
928
1049
  if (false) {
929
- logger.debug(`Response '${getFriendlyURL(effectiveRequest.url)}' will not be cached.`, responseToCache);
1050
+ logger2.debug(`Response '${getFriendlyURL2(effectiveRequest.url)}' will not be cached.`, responseToCache);
930
1051
  }
931
1052
  return false;
932
1053
  }
933
1054
  const { cacheName, matchOptions } = this._strategy;
934
1055
  const cache = yield self.caches.open(cacheName);
935
1056
  const hasCacheUpdateCallback = this.hasCallback("cacheDidUpdate");
936
- const oldResponse = hasCacheUpdateCallback ? yield cacheMatchIgnoreParams(cache, effectiveRequest.clone(), ["__WB_REVISION__"], matchOptions) : null;
1057
+ const oldResponse = hasCacheUpdateCallback ? yield cacheMatchIgnoreParams2(cache, effectiveRequest.clone(), ["__WB_REVISION__"], matchOptions) : null;
937
1058
  if (false) {
938
- logger.debug(`Updating the '${cacheName}' cache with a new Response for ${getFriendlyURL(effectiveRequest.url)}.`);
1059
+ logger2.debug(`Updating the '${cacheName}' cache with a new Response for ${getFriendlyURL2(effectiveRequest.url)}.`);
939
1060
  }
940
1061
  try {
941
1062
  yield cache.put(effectiveRequest, hasCacheUpdateCallback ? responseToCache.clone() : responseToCache);
942
1063
  } catch (error) {
943
1064
  if (error instanceof Error) {
944
1065
  if (error.name === "QuotaExceededError") {
945
- yield executeQuotaErrorCallbacks();
1066
+ yield executeQuotaErrorCallbacks2();
946
1067
  }
947
1068
  throw error;
948
1069
  }
@@ -961,7 +1082,8 @@ var StrategyHandler = class {
961
1082
  }
962
1083
  getCacheKey(request, mode) {
963
1084
  return __async(this, null, function* () {
964
- if (!this._cacheKeys[mode]) {
1085
+ const key = `${request.url} | ${mode}`;
1086
+ if (!this._cacheKeys[key]) {
965
1087
  let effectiveRequest = request;
966
1088
  for (const callback of this.iterateCallbacks("cacheKeyWillBeUsed")) {
967
1089
  effectiveRequest = toRequest(yield callback({
@@ -971,9 +1093,9 @@ var StrategyHandler = class {
971
1093
  params: this.params
972
1094
  }));
973
1095
  }
974
- this._cacheKeys[mode] = effectiveRequest;
1096
+ this._cacheKeys[key] = effectiveRequest;
975
1097
  }
976
- return this._cacheKeys[mode];
1098
+ return this._cacheKeys[key];
977
1099
  });
978
1100
  }
979
1101
  hasCallback(name) {
@@ -1041,9 +1163,9 @@ var StrategyHandler = class {
1041
1163
  if (responseToCache) {
1042
1164
  if (responseToCache.status !== 200) {
1043
1165
  if (responseToCache.status === 0) {
1044
- logger.warn(`The response for '${this.request.url}' is an opaque response. The caching strategy that you're using will not cache opaque responses by default.`);
1166
+ logger2.warn(`The response for '${this.request.url}' is an opaque response. The caching strategy that you're using will not cache opaque responses by default.`);
1045
1167
  } else {
1046
- logger.debug(`The response for '${this.request.url}' returned a status code of '${response.status}' and won't be cached as a result.`);
1168
+ logger2.debug(`The response for '${this.request.url}' returned a status code of '${response.status}' and won't be cached as a result.`);
1047
1169
  }
1048
1170
  }
1049
1171
  }
@@ -1057,7 +1179,7 @@ var StrategyHandler = class {
1057
1179
  // node_modules/workbox-strategies/Strategy.js
1058
1180
  var Strategy = class {
1059
1181
  constructor(options = {}) {
1060
- this.cacheName = cacheNames.getRuntimeName(options.cacheName);
1182
+ this.cacheName = cacheNames3.getRuntimeName(options.cacheName);
1061
1183
  this.plugins = options.plugins || [];
1062
1184
  this.fetchOptions = options.fetchOptions;
1063
1185
  this.matchOptions = options.matchOptions;
@@ -1088,7 +1210,7 @@ var Strategy = class {
1088
1210
  try {
1089
1211
  response = yield this._handle(request, handler);
1090
1212
  if (!response || response.type === "error") {
1091
- throw new WorkboxError("no-response", { url: request.url });
1213
+ throw new WorkboxError2("no-response", { url: request.url });
1092
1214
  }
1093
1215
  } catch (error) {
1094
1216
  if (error instanceof Error) {
@@ -1102,7 +1224,7 @@ var Strategy = class {
1102
1224
  if (!response) {
1103
1225
  throw error;
1104
1226
  } else if (false) {
1105
- logger.log(`While responding to '${getFriendlyURL(request.url)}', an ${error instanceof Error ? error.toString() : ""} error occurred. Using a fallback response provided by a handlerDidError plugin.`);
1227
+ logger2.log(`While responding to '${getFriendlyURL2(request.url)}', an ${error instanceof Error ? error.toString() : ""} error occurred. Using a fallback response provided by a handlerDidError plugin.`);
1106
1228
  }
1107
1229
  }
1108
1230
  for (const callback of handler.iterateCallbacks("handlerWillRespond")) {
@@ -1151,7 +1273,7 @@ var CacheFirst = class extends Strategy {
1151
1273
  return __async(this, null, function* () {
1152
1274
  const logs = [];
1153
1275
  if (false) {
1154
- finalAssertExports.isInstance(request, Request, {
1276
+ finalAssertExports2.isInstance(request, Request, {
1155
1277
  moduleName: "workbox-strategies",
1156
1278
  className: this.constructor.name,
1157
1279
  funcName: "makeRequest",
@@ -1184,15 +1306,15 @@ var CacheFirst = class extends Strategy {
1184
1306
  }
1185
1307
  }
1186
1308
  if (false) {
1187
- logger.groupCollapsed(messages2.strategyStart(this.constructor.name, request));
1309
+ logger2.groupCollapsed(messages3.strategyStart(this.constructor.name, request));
1188
1310
  for (const log2 of logs) {
1189
- logger.log(log2);
1311
+ logger2.log(log2);
1190
1312
  }
1191
- messages2.printFinalResponse(response);
1192
- logger.groupEnd();
1313
+ messages3.printFinalResponse(response);
1314
+ logger2.groupEnd();
1193
1315
  }
1194
1316
  if (!response) {
1195
- throw new WorkboxError("no-response", { url: request.url, error });
1317
+ throw new WorkboxError2("no-response", { url: request.url, error });
1196
1318
  }
1197
1319
  return response;
1198
1320
  });
@@ -1221,7 +1343,7 @@ var StaleWhileRevalidate = class extends Strategy {
1221
1343
  return __async(this, null, function* () {
1222
1344
  const logs = [];
1223
1345
  if (false) {
1224
- finalAssertExports.isInstance(request, Request, {
1346
+ finalAssertExports2.isInstance(request, Request, {
1225
1347
  moduleName: "workbox-strategies",
1226
1348
  className: this.constructor.name,
1227
1349
  funcName: "handle",
@@ -1230,6 +1352,7 @@ var StaleWhileRevalidate = class extends Strategy {
1230
1352
  }
1231
1353
  const fetchAndCachePromise = handler.fetchAndCachePut(request).catch(() => {
1232
1354
  });
1355
+ void handler.waitUntil(fetchAndCachePromise);
1233
1356
  let response = yield handler.cacheMatch(request);
1234
1357
  let error;
1235
1358
  if (response) {
@@ -1249,15 +1372,15 @@ var StaleWhileRevalidate = class extends Strategy {
1249
1372
  }
1250
1373
  }
1251
1374
  if (false) {
1252
- logger.groupCollapsed(messages2.strategyStart(this.constructor.name, request));
1375
+ logger2.groupCollapsed(messages3.strategyStart(this.constructor.name, request));
1253
1376
  for (const log2 of logs) {
1254
- logger.log(log2);
1377
+ logger2.log(log2);
1255
1378
  }
1256
- messages2.printFinalResponse(response);
1257
- logger.groupEnd();
1379
+ messages3.printFinalResponse(response);
1380
+ logger2.groupEnd();
1258
1381
  }
1259
1382
  if (!response) {
1260
- throw new WorkboxError("no-response", { url: request.url, error });
1383
+ throw new WorkboxError2("no-response", { url: request.url, error });
1261
1384
  }
1262
1385
  return response;
1263
1386
  });
@@ -1276,9 +1399,86 @@ var WEBPUB_CACHE_NAME = "webpub-cache";
1276
1399
  var PRECACHE_PUBLICATIONS = "PRECACHE_PUBLICATIONS";
1277
1400
  var CACHE_EXPIRATION_SECONDS = 7 * 24 * 60 * 60;
1278
1401
 
1402
+ // node_modules/workbox-routing/node_modules/workbox-core/_version.js
1403
+ try {
1404
+ self["workbox:core:6.5.3"] && _();
1405
+ } catch (e) {
1406
+ }
1407
+
1408
+ // node_modules/workbox-routing/node_modules/workbox-core/models/messages/messageGenerator.js
1409
+ var fallback3 = (code, ...args) => {
1410
+ let msg = code;
1411
+ if (args.length > 0) {
1412
+ msg += ` :: ${JSON.stringify(args)}`;
1413
+ }
1414
+ return msg;
1415
+ };
1416
+ var messageGenerator3 = true ? fallback3 : generatorFunction;
1417
+
1418
+ // node_modules/workbox-routing/node_modules/workbox-core/_private/WorkboxError.js
1419
+ var WorkboxError3 = class extends Error {
1420
+ constructor(errorCode, details) {
1421
+ const message = messageGenerator3(errorCode, details);
1422
+ super(message);
1423
+ this.name = errorCode;
1424
+ this.details = details;
1425
+ }
1426
+ };
1427
+
1428
+ // node_modules/workbox-routing/node_modules/workbox-core/_private/logger.js
1429
+ var logger3 = true ? null : (() => {
1430
+ if (!("__WB_DISABLE_DEV_LOGS" in self)) {
1431
+ self.__WB_DISABLE_DEV_LOGS = false;
1432
+ }
1433
+ let inGroup = false;
1434
+ const methodToColorMap = {
1435
+ debug: `#7f8c8d`,
1436
+ log: `#2ecc71`,
1437
+ warn: `#f39c12`,
1438
+ error: `#c0392b`,
1439
+ groupCollapsed: `#3498db`,
1440
+ groupEnd: null
1441
+ };
1442
+ const print = function(method, args) {
1443
+ if (self.__WB_DISABLE_DEV_LOGS) {
1444
+ return;
1445
+ }
1446
+ if (method === "groupCollapsed") {
1447
+ if (/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) {
1448
+ console[method](...args);
1449
+ return;
1450
+ }
1451
+ }
1452
+ const styles = [
1453
+ `background: ${methodToColorMap[method]}`,
1454
+ `border-radius: 0.5em`,
1455
+ `color: white`,
1456
+ `font-weight: bold`,
1457
+ `padding: 2px 0.5em`
1458
+ ];
1459
+ const logPrefix = inGroup ? [] : ["%cworkbox", styles.join(";")];
1460
+ console[method](...logPrefix, ...args);
1461
+ if (method === "groupCollapsed") {
1462
+ inGroup = true;
1463
+ }
1464
+ if (method === "groupEnd") {
1465
+ inGroup = false;
1466
+ }
1467
+ };
1468
+ const api = {};
1469
+ const loggerMethods = Object.keys(methodToColorMap);
1470
+ for (const key of loggerMethods) {
1471
+ const method = key;
1472
+ api[method] = (...args) => {
1473
+ print(method, args);
1474
+ };
1475
+ }
1476
+ return api;
1477
+ })();
1478
+
1279
1479
  // node_modules/workbox-routing/_version.js
1280
1480
  try {
1281
- self["workbox:routing:6.2.4"] && _();
1481
+ self["workbox:routing:6.5.3"] && _();
1282
1482
  } catch (e) {
1283
1483
  }
1284
1484
 
@@ -1289,7 +1489,7 @@ var defaultMethod = "GET";
1289
1489
  var normalizeHandler = (handler) => {
1290
1490
  if (handler && typeof handler === "object") {
1291
1491
  if (false) {
1292
- finalAssertExports.hasMethod(handler, "handle", {
1492
+ finalAssertExports3.hasMethod(handler, "handle", {
1293
1493
  moduleName: "workbox-routing",
1294
1494
  className: "Route",
1295
1495
  funcName: "constructor",
@@ -1299,7 +1499,7 @@ var normalizeHandler = (handler) => {
1299
1499
  return handler;
1300
1500
  } else {
1301
1501
  if (false) {
1302
- finalAssertExports.isType(handler, "function", {
1502
+ finalAssertExports3.isType(handler, "function", {
1303
1503
  moduleName: "workbox-routing",
1304
1504
  className: "Route",
1305
1505
  funcName: "constructor",
@@ -1314,14 +1514,14 @@ var normalizeHandler = (handler) => {
1314
1514
  var Route = class {
1315
1515
  constructor(match, handler, method = defaultMethod) {
1316
1516
  if (false) {
1317
- finalAssertExports.isType(match, "function", {
1517
+ finalAssertExports3.isType(match, "function", {
1318
1518
  moduleName: "workbox-routing",
1319
1519
  className: "Route",
1320
1520
  funcName: "constructor",
1321
1521
  paramName: "match"
1322
1522
  });
1323
1523
  if (method) {
1324
- finalAssertExports.isOneOf(method, validMethods, { paramName: "method" });
1524
+ finalAssertExports3.isOneOf(method, validMethods, { paramName: "method" });
1325
1525
  }
1326
1526
  }
1327
1527
  this.handler = normalizeHandler(handler);
@@ -1337,7 +1537,7 @@ var Route = class {
1337
1537
  var RegExpRoute = class extends Route {
1338
1538
  constructor(regExp, handler, method) {
1339
1539
  if (false) {
1340
- finalAssertExports.isInstance(regExp, RegExp, {
1540
+ finalAssertExports3.isInstance(regExp, RegExp, {
1341
1541
  moduleName: "workbox-routing",
1342
1542
  className: "RegExpRoute",
1343
1543
  funcName: "constructor",
@@ -1351,7 +1551,7 @@ var RegExpRoute = class extends Route {
1351
1551
  }
1352
1552
  if (url.origin !== location.origin && result.index !== 0) {
1353
1553
  if (false) {
1354
- logger.debug(`The regular expression '${regExp.toString()}' only partially matched against the cross-origin URL '${url.toString()}'. RegExpRoute's will only handle cross-origin requests if they match the entire URL.`);
1554
+ logger3.debug(`The regular expression '${regExp.toString()}' only partially matched against the cross-origin URL '${url.toString()}'. RegExpRoute's will only handle cross-origin requests if they match the entire URL.`);
1355
1555
  }
1356
1556
  return;
1357
1557
  }
@@ -1384,7 +1584,7 @@ var Router = class {
1384
1584
  if (event.data && event.data.type === "CACHE_URLS") {
1385
1585
  const { payload } = event.data;
1386
1586
  if (false) {
1387
- logger.debug(`Caching URLs from the window`, payload.urlsToCache);
1587
+ logger3.debug(`Caching URLs from the window`, payload.urlsToCache);
1388
1588
  }
1389
1589
  const requestPromises = Promise.all(payload.urlsToCache.map((entry) => {
1390
1590
  if (typeof entry === "string") {
@@ -1402,7 +1602,7 @@ var Router = class {
1402
1602
  }
1403
1603
  handleRequest({ request, event }) {
1404
1604
  if (false) {
1405
- finalAssertExports.isInstance(request, Request, {
1605
+ finalAssertExports3.isInstance(request, Request, {
1406
1606
  moduleName: "workbox-routing",
1407
1607
  className: "Router",
1408
1608
  funcName: "handleRequest",
@@ -1412,7 +1612,7 @@ var Router = class {
1412
1612
  const url = new URL(request.url, location.href);
1413
1613
  if (!url.protocol.startsWith("http")) {
1414
1614
  if (false) {
1415
- logger.debug(`Workbox Router only supports URLs that start with 'http'.`);
1615
+ logger3.debug(`Workbox Router only supports URLs that start with 'http'.`);
1416
1616
  }
1417
1617
  return;
1418
1618
  }
@@ -1427,10 +1627,7 @@ var Router = class {
1427
1627
  const debugMessages = [];
1428
1628
  if (false) {
1429
1629
  if (handler) {
1430
- debugMessages.push([
1431
- `Found a route to handle this request:`,
1432
- route
1433
- ]);
1630
+ debugMessages.push([`Found a route to handle this request:`, route]);
1434
1631
  if (params) {
1435
1632
  debugMessages.push([
1436
1633
  `Passing the following params to the route's handler:`,
@@ -1448,20 +1645,20 @@ var Router = class {
1448
1645
  }
1449
1646
  if (!handler) {
1450
1647
  if (false) {
1451
- logger.debug(`No route found for: ${getFriendlyURL(url)}`);
1648
+ logger3.debug(`No route found for: ${getFriendlyURL3(url)}`);
1452
1649
  }
1453
1650
  return;
1454
1651
  }
1455
1652
  if (false) {
1456
- logger.groupCollapsed(`Router is responding to: ${getFriendlyURL(url)}`);
1653
+ logger3.groupCollapsed(`Router is responding to: ${getFriendlyURL3(url)}`);
1457
1654
  debugMessages.forEach((msg) => {
1458
1655
  if (Array.isArray(msg)) {
1459
- logger.log(...msg);
1656
+ logger3.log(...msg);
1460
1657
  } else {
1461
- logger.log(msg);
1658
+ logger3.log(msg);
1462
1659
  }
1463
1660
  });
1464
- logger.groupEnd();
1661
+ logger3.groupEnd();
1465
1662
  }
1466
1663
  let responsePromise;
1467
1664
  try {
@@ -1474,10 +1671,10 @@ var Router = class {
1474
1671
  responsePromise = responsePromise.catch((err) => __async(this, null, function* () {
1475
1672
  if (catchHandler) {
1476
1673
  if (false) {
1477
- logger.groupCollapsed(`Error thrown when responding to: ${getFriendlyURL(url)}. Falling back to route's Catch Handler.`);
1478
- logger.error(`Error thrown by:`, route);
1479
- logger.error(err);
1480
- logger.groupEnd();
1674
+ logger3.groupCollapsed(`Error thrown when responding to: ${getFriendlyURL3(url)}. Falling back to route's Catch Handler.`);
1675
+ logger3.error(`Error thrown by:`, route);
1676
+ logger3.error(err);
1677
+ logger3.groupEnd();
1481
1678
  }
1482
1679
  try {
1483
1680
  return yield catchHandler.handle({ url, request, event, params });
@@ -1489,10 +1686,10 @@ var Router = class {
1489
1686
  }
1490
1687
  if (this._catchHandler) {
1491
1688
  if (false) {
1492
- logger.groupCollapsed(`Error thrown when responding to: ${getFriendlyURL(url)}. Falling back to global Catch Handler.`);
1493
- logger.error(`Error thrown by:`, route);
1494
- logger.error(err);
1495
- logger.groupEnd();
1689
+ logger3.groupCollapsed(`Error thrown when responding to: ${getFriendlyURL3(url)}. Falling back to global Catch Handler.`);
1690
+ logger3.error(`Error thrown by:`, route);
1691
+ logger3.error(err);
1692
+ logger3.groupEnd();
1496
1693
  }
1497
1694
  return this._catchHandler.handle({ url, request, event });
1498
1695
  }
@@ -1509,7 +1706,7 @@ var Router = class {
1509
1706
  if (matchResult) {
1510
1707
  if (false) {
1511
1708
  if (matchResult instanceof Promise) {
1512
- logger.warn(`While routing ${getFriendlyURL(url)}, an async matchCallback function was used. Please convert the following route to use a synchronous matchCallback function:`, route);
1709
+ logger3.warn(`While routing ${getFriendlyURL3(url)}, an async matchCallback function was used. Please convert the following route to use a synchronous matchCallback function:`, route);
1513
1710
  }
1514
1711
  }
1515
1712
  params = matchResult;
@@ -1533,31 +1730,31 @@ var Router = class {
1533
1730
  }
1534
1731
  registerRoute(route) {
1535
1732
  if (false) {
1536
- finalAssertExports.isType(route, "object", {
1733
+ finalAssertExports3.isType(route, "object", {
1537
1734
  moduleName: "workbox-routing",
1538
1735
  className: "Router",
1539
1736
  funcName: "registerRoute",
1540
1737
  paramName: "route"
1541
1738
  });
1542
- finalAssertExports.hasMethod(route, "match", {
1739
+ finalAssertExports3.hasMethod(route, "match", {
1543
1740
  moduleName: "workbox-routing",
1544
1741
  className: "Router",
1545
1742
  funcName: "registerRoute",
1546
1743
  paramName: "route"
1547
1744
  });
1548
- finalAssertExports.isType(route.handler, "object", {
1745
+ finalAssertExports3.isType(route.handler, "object", {
1549
1746
  moduleName: "workbox-routing",
1550
1747
  className: "Router",
1551
1748
  funcName: "registerRoute",
1552
1749
  paramName: "route"
1553
1750
  });
1554
- finalAssertExports.hasMethod(route.handler, "handle", {
1751
+ finalAssertExports3.hasMethod(route.handler, "handle", {
1555
1752
  moduleName: "workbox-routing",
1556
1753
  className: "Router",
1557
1754
  funcName: "registerRoute",
1558
1755
  paramName: "route.handler"
1559
1756
  });
1560
- finalAssertExports.isType(route.method, "string", {
1757
+ finalAssertExports3.isType(route.method, "string", {
1561
1758
  moduleName: "workbox-routing",
1562
1759
  className: "Router",
1563
1760
  funcName: "registerRoute",
@@ -1571,7 +1768,7 @@ var Router = class {
1571
1768
  }
1572
1769
  unregisterRoute(route) {
1573
1770
  if (!this._routes.has(route.method)) {
1574
- throw new WorkboxError("unregister-route-but-not-found-with-method", {
1771
+ throw new WorkboxError3("unregister-route-but-not-found-with-method", {
1575
1772
  method: route.method
1576
1773
  });
1577
1774
  }
@@ -1579,7 +1776,7 @@ var Router = class {
1579
1776
  if (routeIndex > -1) {
1580
1777
  this._routes.get(route.method).splice(routeIndex, 1);
1581
1778
  } else {
1582
- throw new WorkboxError("unregister-route-route-not-registered");
1779
+ throw new WorkboxError3("unregister-route-route-not-registered");
1583
1780
  }
1584
1781
  }
1585
1782
  };
@@ -1602,7 +1799,7 @@ function registerRoute(capture, handler, method) {
1602
1799
  const captureUrl = new URL(capture, location.href);
1603
1800
  if (false) {
1604
1801
  if (!(capture.startsWith("/") || capture.startsWith("http"))) {
1605
- throw new WorkboxError("invalid-string", {
1802
+ throw new WorkboxError3("invalid-string", {
1606
1803
  moduleName: "workbox-routing",
1607
1804
  funcName: "registerRoute",
1608
1805
  paramName: "capture"
@@ -1611,13 +1808,13 @@ function registerRoute(capture, handler, method) {
1611
1808
  const valueToCheck = capture.startsWith("http") ? captureUrl.pathname : capture;
1612
1809
  const wildcards = "[*:?+]";
1613
1810
  if (new RegExp(`${wildcards}`).exec(valueToCheck)) {
1614
- logger.debug(`The '$capture' parameter contains an Express-style wildcard character (${wildcards}). Strings are now always interpreted as exact matches; use a RegExp for partial or wildcard matches.`);
1811
+ logger3.debug(`The '$capture' parameter contains an Express-style wildcard character (${wildcards}). Strings are now always interpreted as exact matches; use a RegExp for partial or wildcard matches.`);
1615
1812
  }
1616
1813
  }
1617
1814
  const matchCallback = ({ url }) => {
1618
1815
  if (false) {
1619
1816
  if (url.pathname === captureUrl.pathname && url.origin !== captureUrl.origin) {
1620
- logger.debug(`${capture} only partially matches the cross-origin URL ${url.toString()}. This route will only handle cross-origin requests if they match the entire URL.`);
1817
+ logger3.debug(`${capture} only partially matches the cross-origin URL ${url.toString()}. This route will only handle cross-origin requests if they match the entire URL.`);
1621
1818
  }
1622
1819
  }
1623
1820
  return url.href === captureUrl.href;
@@ -1630,7 +1827,7 @@ function registerRoute(capture, handler, method) {
1630
1827
  } else if (capture instanceof Route) {
1631
1828
  route = capture;
1632
1829
  } else {
1633
- throw new WorkboxError("unsupported-route-type", {
1830
+ throw new WorkboxError3("unsupported-route-type", {
1634
1831
  moduleName: "workbox-routing",
1635
1832
  funcName: "registerRoute",
1636
1833
  paramName: "capture"