-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathswe-worker-development.js
140 lines (138 loc) · 9.17 KB
/
swe-worker-development.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
/*
* ATTENTION: An "eval-source-map" devtool has been used.
* This devtool is neither made for production nor for readable output files.
* It uses "eval()" calls to create a separate source file with attached SourceMaps in the browser devtools.
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
* or disable the default devtool with "devtool: false".
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
*/
/******/ (function () {
// webpackBootstrap
/******/ 'use strict';
/******/ var __webpack_modules__ = {
/***/ './node_modules/@ducanh2912/next-pwa/dist/sw-entry-worker.js':
/*!*******************************************************************!*\
!*** ./node_modules/@ducanh2912/next-pwa/dist/sw-entry-worker.js ***!
\*******************************************************************/
/***/ function (
__unused_webpack___webpack_module__,
__webpack_exports__,
__webpack_require__
) {
eval(
__webpack_require__.ts(
'__webpack_require__.r(__webpack_exports__);\nself.onmessage = async (e)=>{\n switch(e.data.type){\n case "__START_URL_CACHE__":\n {\n let t = e.data.url, a = await fetch(t);\n if (!a.redirected) return (await caches.open("start-url")).put(t, a);\n return Promise.resolve();\n }\n case "__FRONTEND_NAV_CACHE__":\n {\n let t = e.data.url, a = await caches.open("pages");\n if (await a.match(t, {\n ignoreSearch: !0\n })) return;\n let s = await fetch(t);\n if (!s.ok) return;\n if (a.put(t, s.clone()), e.data.shouldCacheAggressively && s.headers.get("Content-Type")?.includes("text/html")) try {\n let e = await s.text(), t = [], a = await caches.open("static-style-assets"), r = await caches.open("next-static-js-assets"), c = await caches.open("static-js-assets");\n for (let [s, r] of e.matchAll(/<link.*?href=[\'"](.*?)[\'"].*?>/g))/rel=[\'"]stylesheet[\'"]/.test(s) && t.push(a.match(r).then((e)=>e ? Promise.resolve() : a.add(r)));\n for (let [, a] of e.matchAll(/<script.*?src=[\'"](.*?)[\'"].*?>/g)){\n let e = /\\/_next\\/static.+\\.js$/i.test(a) ? r : c;\n t.push(e.match(a).then((t)=>t ? Promise.resolve() : e.add(a)));\n }\n return await Promise.all(t);\n } catch {}\n return Promise.resolve();\n }\n default:\n return Promise.resolve();\n }\n};//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvQGR1Y2FuaDI5MTIvbmV4dC1wd2EvZGlzdC9zdy1lbnRyeS13b3JrZXIuanMiLCJtYXBwaW5ncyI6IjtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsaUJBQWlCO0FBQ2pCO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0Esa0JBQWtCO0FBQ2xCO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZXMiOlsid2VicGFjazovL19OX0UvLi9ub2RlX21vZHVsZXMvQGR1Y2FuaDI5MTIvbmV4dC1wd2EvZGlzdC9zdy1lbnRyeS13b3JrZXIuanM/NGYzOSJdLCJzb3VyY2VzQ29udGVudCI6WyJzZWxmLm9ubWVzc2FnZSA9IGFzeW5jIChlKT0+e1xuICAgIHN3aXRjaChlLmRhdGEudHlwZSl7XG4gICAgICAgIGNhc2UgXCJfX1NUQVJUX1VSTF9DQUNIRV9f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BlbihcInN0YXRpYy1qcy1hc3NldHNcIik7XG4gICAgICAgICAgICAgICAgICAgIGZvciAobGV0IFtzLCByXSBvZiBlLm1hdGNoQWxsKC88bGluay4qP2hyZWY9WydcIl0oLio/KVsnXCJdLio/Pi9nKSkvcmVsPVsnXCJdc3R5bGVzaGVldFsnXCJdLy50ZXN0KHMpICYmIHQucHVzaChhLm1hdGNoKHIpLnRoZW4oKGUpPT5lID8gUHJvbWlzZS5yZXNvbHZlKCkgOiBhLmFkZChyKSkpO1xuICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCBbLCBhXSBvZiBlLm1hdGNoQWxsKC88c2NyaXB0Lio/c3JjPVsnXCJdKC4qPylbJ1wiXS4qPz4vZykpe1xuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGUgPSAvXFwvX25leHRcXC9zdGF0aWMuK1xcLmpzJC9pLnRlc3QoYSkgPyByIDogYztcbiAgICAgICAgICAgICAgICAgICAgICAgIHQucHVzaChlLm1hdGNoKGEpLnRoZW4oKHQpPT50ID8gUHJvbWlzZS5yZXNvbHZlKCkgOiBlLmFkZChhKSkpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBhd2FpdCBQcm9taXNlLmFsbCh0KTtcbiAgICAgICAgICAgICAgICB9IGNhdGNoICB7fVxuICAgICAgICAgICAgICAgIHJldHVybiBQcm9taXNlLnJlc29sdmUoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgIHJldHVybiBQcm9taXNlLnJlc29sdmUoKTtcbiAgICB9XG59OyJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/@ducanh2912/next-pwa/dist/sw-entry-worker.js\n'
)
);
/***/
},
/******/
};
/************************************************************************/
/******/ // The require scope
/******/ var __webpack_require__ = {};
/******/
/************************************************************************/
/******/ /* webpack/runtime/make namespace object */
/******/ !(function () {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function (exports) {
/******/ if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/
}
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/
};
/******/
})();
/******/
/******/ /* webpack/runtime/trusted types policy */
/******/ !(function () {
/******/ var policy;
/******/ __webpack_require__.tt = function () {
/******/ // Create Trusted Type policy if Trusted Types are available and the policy doesn't exist yet.
/******/ if (policy === undefined) {
/******/ policy = {
/******/ createScript: function (script) {
return script;
},
/******/
};
/******/ if (typeof trustedTypes !== 'undefined' && trustedTypes.createPolicy) {
/******/ policy = trustedTypes.createPolicy('nextjs#bundler', policy);
/******/
}
/******/
}
/******/ return policy;
/******/
};
/******/
})();
/******/
/******/ /* webpack/runtime/trusted types script */
/******/ !(function () {
/******/ __webpack_require__.ts = function (script) {
return __webpack_require__.tt().createScript(script);
};
/******/
})();
/******/
/******/ /* webpack/runtime/react refresh */
/******/ !(function () {
/******/ if (__webpack_require__.i) {
/******/ __webpack_require__.i.push(function (options) {
/******/ var originalFactory = options.factory;
/******/ options.factory = function (moduleObject, moduleExports, webpackRequire) {
/******/ var hasRefresh =
typeof self !== 'undefined' && !!self.$RefreshInterceptModuleExecution$;
/******/ var cleanup = hasRefresh
? self.$RefreshInterceptModuleExecution$(moduleObject.id)
: function () {};
/******/ try {
/******/ originalFactory.call(this, moduleObject, moduleExports, webpackRequire);
/******/
} finally {
/******/ cleanup();
/******/
}
/******/
};
/******/
});
/******/
}
/******/
})();
/******/
/******/ /* webpack/runtime/compat */
/******/
/******/
/******/ // noop fns to prevent runtime errors during initialization
/******/ if (typeof self !== 'undefined') {
/******/ self.$RefreshReg$ = function () {};
/******/ self.$RefreshSig$ = function () {
/******/ return function (type) {
/******/ return type;
/******/
};
/******/
};
/******/
}
/******/
/************************************************************************/
/******/
/******/ // startup
/******/ // Load entry module and return exports
/******/ // This entry module can't be inlined because the eval-source-map devtool is used.
/******/ var __webpack_exports__ = {};
/******/ __webpack_modules__['./node_modules/@ducanh2912/next-pwa/dist/sw-entry-worker.js'](
0,
__webpack_exports__,
__webpack_require__
);
/******/
/******/
})();